{"version":3,"file":"static/chunks/2219-c3f1b2b4fc4d96b8.js","mappings":"scAQO,IEEP,EiBNO,EOsEP,EM9DO,EIHP,ECOA,EAyCA,EMnDA,EEoCA,EmBjBA,EIzBA,ECAI,EEMJ,ECDA,EQLI,EhFQG,GACP,OqETM,GrEUN,GgFVM,GhFUN,QACA,YACA,YACA,aACA,EAUO,UACA,KACP,mCACA,UACC,EACD,6BACO,GACP,wBACA,oBACA,sBACA,sBACA,uBACA,ECnCO,gBACP,kBAEA,QADA,KACA,IAAyB,mBAAuB,IAChD,kBAEA,IACA,wBACA,CACA,SACY,EAAO,UACnB,CACA,CACA,CCdA,MAAiC,eAAZ,CACrB,QADyB,CACzB,GAD6B,OAC7B,EADiC,IACjC,0BAA6E,IAAO,KACpF,YACA,yCACA,WAGA,iDACA,EAGA,KAIO,cACP,GACA,CAKO,kBACP,cACA,mBAEA,QADA,KACA,IAAyB,mBAAuB,IAChD,kBAGA,MADA,WACA,aACA,CACA,CACO,cACP,kBAEA,0BACA,CACA,CACO,CAFA,QAEA,SACP,IAEA,mBACA,CACA,SAEA,GADA,KACA,EACA,IACA,IACA,CACA,SACA,IACA,CAEA,CACA,CACO,aAEP,QADA,KACA,IAAqB,mBAAuB,IAC5C,kBAEA,GACQ,EAAO,YAAa,EAAO,sBAEnC,CChEO,SAAS,EAAQ,KACxB,WADwB,CACxB,YACA,CACO,cACP,cACA,qBAEA,SACA,oBACA,sBAA4C,iBAA0B,OAGtE,YAAwB,WAAsB,IAC9C,aAGA,QACA,CAsBO,cACP,sCAAoD,YAAqB,CACzE,CAIO,gBACP,8BACA,CAiCO,SAAS,EAAM,GAEtB,QADA,GADsB,CACtB,CACA,IAAqB,mBAAuB,IAC5C,oBASA,OAPA,sBACA,eACA,2CACA,WAGA,CAAK,EACL,CACA,CE1FO,aACP,+BACA,kBAEA,oDACA,eACA,WACA,CAAS,CACT,eACA,CAAK,EAEL,gBAgBA,OAdA,kCACA,qBAGA,sBACA,OAGA,EADA,wBACA,O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yBAGA,OAFA,MAPA,EAOA,GACA,QAAiB,yBAA6D,EAC9E,CACA,CAuEA,mBACI,EAAO,uGACX,CCnLA,kBACA,cACA,wBACA,kBAoBA,OAlBA,kCACA,WAKA,MAJA,+CACA,6DAEA,uBACA,CACA,uBACA,2CAA4E,aAAqB,EACjG,0CACA,qBAEA,CAAa,CAEb,EACA,+BACA,mCAAqD,YAAwB,CAC7E,EACA,CACA,CAAC,GAEM,cAEP,QADA,KACA,IAAqB,mBAAuB,IAC5C,kBAEA,0BACA,wBACA,+BAA0D,mBAAuC,CACjG,CAAS,EACT,kBAA6B,6BAAuD,uBAAoC,EACxH,CAAK,CACL,CCjCO,eACP,SACA,MAA+B,GAC/B,GACA,IAFyC,OAEzC,WAAkC,OHgDlC,SGhDkD,GAAY,CAC9D,uBACgB,OAAO,UACvB,EAA0B,GAAQ,GAClC,yBAGA,iBAEA,UACA,CAAS,CACT,iCACA,KAA2B,GAAQ,GACnC,EADmC,kBACnC,IACA,UACA,CAAS,CACT,kCACA,YACA,wBACA,UACA,CAAS,CACT,wBACA,KACA,sBACA,UACA,CAAS,CACT,kBACA,EACA,QACA,CCpCO,QACP,kBACA,yBACA,EC8DO,uBACP,oBAAgC,mCAChC,EAA8B,EAAO,YACrC,yDAGA,GACA,IAEA,KACA,CAAK,EACL,KAA8B,qBAAqC,EACnE,EAAc,EAAsB,sBAEpC,aACA,MAAqB,EAAsB,yBAC3C,sBAAkD,uBAA2E,CAC7H,CACA,OALA,sBAA8C,uBAAwE,EAKtH,CACA,MACA,CACA,EAlFA,YACA,+BACA,gBACA,uBACA,qBACA,cACA,uBACA,kBACA,2BACA,uBACA,yBACA,uCACA,uBACA,kBACA,kBACA,wCACA,6BACA,yBACA,iCACA,2BACA,uBACA,yBACA,qBACA,yBACA,gBACA,cACA,6BACA,kBACA,kBACA,gBACA,cACA,gBACA,sDACA,qCACA,mBACA,CAAC,YCrCD,UACO,qBACP,MAqBA,UAxBA,QAwBA,YArBA,EAqBA,YArBA,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A,EAqCA,yBArCA,EAqCA,eApCA,MACA,GACA,mBACA,wBACA,QACA,OACA,cACA,SACA,WACA,gBACA,gBACA,OACA,UACA,QACA,SACA,aACA,CACA,CAqBO,eACP,gDACA,yBACA,MACA,CACO,eACP,YAQA,OAPA,4BACA,wCACA,+DACA,+BACA,2CACA,wEACA,CAAK,EACL,CACA,CAKO,eACP,uDACA,CAkCO,iBAGP,IAFA,QACA,KACA,wDACA,MAAyB,GAAiB,SAC1C,KAD0C,CAC1C,EACA,wBACA,SACA,2BACA,cACA,CAAS,EACT,UAEA,wBACA,CCvHO,QACP,cACA,kBAEA,gBACA,kBACA,gBACA,eACA,ECqBO,cAMP,2BACA,CAIO,cACP,wBACA,CACO,cACP,OAAa,wBANb,IAMa,CACb,CA8BA,cAIA,OAHA,YACA,uCAEA,CACA,CChFA,OAA8B,WAAZ,CAAY,MAC9B,EADsB,EACtB,EAD0B,EAC1B,OAD8B,GAC9B,iEACA,kGACA,qBAA6C,KAAQ,oDACrD,6CACA,EAEO,IACP,cACA,cACA,YACA,WACA,EACO,IACP,kBACA,WAEA,EACO,mBACP,cACA,wBACA,aAAsC,WACtC,aAAgC,YAChC,aAAwC,MACxC,yBACA,mBACA,aACA,oBAA8B,GAAoB,GAClD,cADkD,KAClD,eACA,GACA,iDAA+D,OAAY,CAE3E,CAyEA,OAxEA,kCAGA,GAFA,aAAiC,WAEjC,SAEA,IAHA,EAGA,EAA2B,GAAe,CAC1C,WAFA,mBAAsD,GAAiB,UAGvE,IAHuE,UAGvE,EACA,0BACA,OAAwB,GAAW,OACnC,CADmC,QACnC,UACA,YAA6B,IAC7B,CAAa,EACb,GACA,cACA,YACA,kBACA,gBAEA,CACA,MAAsC,GAAQ,GAC9C,EAD8C,EAEhC,EAAO,CAAG,IAAH,EAAG,EAAqB,IAC7C,EACA,wBACA,QAAqB,GAAQ,GAC7B,EAD6B,MAC7B,EACA,QACA,CAAS,MACT,EACA,kCACA,wBACA,EACA,iCACA,uBACA,EACA,iCACA,uBACA,EACA,kCACA,wBACA,EACA,mCACA,iCACA,EACA,kCACA,uCACA,EACA,6CACA,2CACA,EACA,8CACA,4CACA,EACA,oCACA,kCACA,EACA,mCACA,kBACA,EACA,kCACA,yBAEA,iCACA,YACA,EACA,gCACA,mBAEA,IACQ,EACR,OADiB,KACjB,aACA,CACA,CAAC,GEpGM,iBACP,mBACA,MACA,aAEA,CCTA,kBACA,aACA,eAeA,OAbA,4BACA,oBANA,KAQA,uBAEA,EACA,+BACQ,GAAU,cAClB,EACA,8BACA,gCAAkD,YAAuB,EACzE,oBACA,EACA,CACA,CAAC,GClBM,cACP,MAoCW,IAAe,mBAnC1B,KAGA,OACA,2BACA,MACA,oFACA,CAAS,CACT,2BACA,MACA,gEACA,CAAS,CACT,kCACA,6CACA,CAAS,CACT,qBAEA,uBAAoD,yBADpD,GAAkC,MAAa,MACK,CAAgD,EACpG,CAAS,CAET,CAKO,eAEP,aAAkC,YAAoB,IAAe,yCACrE,IAFA,EAEA,OACA,WACA,EACA,yBACA,qB5BYO,I4BZoC,e5BYpC,E4BZkF,E5BYlF,E4BZkF,KAAR,KAAQ,I5BazF,uB4BbyF,CAAyC,CAClI,ECxBA,YACA,sBACA,gCACA,8CACA,8CACA,0CACA,wDACA,wDACA,+BACA,CAAC,UAAkD,EACnD,eCnBO,eACP,kCACA,CAIO,eACP,MAAW,UAGX,OAHmB,eACnB,CCRO,eACP,SAEA,iEACA,oGACA,CACA,2BAAoD,MGP7C,qBACP,eACA,yBACA,yCACA,iCACA,gBAA+C,6BAC/C,gBAA+C,WAC/C,qBAAyD,eACzD,6CAA2D,cAAqB,OAAO,mDACvF,CACO,eACP,OHHO,cAGP,IAFA,KGEkC,OHFlC,KAEA,CACA,iBACA,KACA,aACA,WACA,MAGA,KAEA,CACA,EGXkC,kBAClC,CAMO,eAIP,OAHA,GACA,GAA2B,SHGpB,GACP,YGJmD,EHOnD,IAFA,iBAEA,CACA,iBACA,KACA,sBAGA,KAEA,CACA,QACA,EGj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AEA,sBAKA,OAJA,GACY,EAAa,YAGzB,CACA,GAxCA,aACA,wBAIA,8BACA,EAEA,OADA,OACA,CACA,gBACA,SACA,OAGA,GAEA,CAAS,CAET,CCzDA,mBAqBA,eACA,4CACA,UACA,aACA,+BACA,IAAa,GAAY,UACzB,CAAK,CACL,CAsCA,eACA,eACA,YACA,GACA,gBAEA,CIyCA,wBACA,2CACA,kEAEA,CACA,CG7HA,kBACA,aACA,iBACA,CAmBA,OAlBA,iCACA,wBACA,GACA,sBAAyD,YAAwB,CAEjF,EACA,oCACA,WAKA,OAJA,mBACA,uBAEA,0BACA,CACA,uBACA,iDAAkG,aAA4B,CAC9H,CACA,CACA,EACA,CACA,CAAC,GEpBM,IACH,CAD4B,EAAE,GAAK,CAChC,GAAU,SADiB,CAE5B,CAAC,GAAU,QACb,CAAE,CAAC,GAAU,QACb,CAAE,CAAC,GAAU,SACb,EAAE,CAwBC,mBACP,qBACA,yBACA,gCAAiF,EAAQ,IACzF,CC/BA,WD8ByF,OC7BzF,oBACA,WACA,eACA,eACA,uBACA,yBACA,qBACA,kFAAmG,kBAA4B,CAC/H,CA+EA,OA9EA,4BACA,mBACA,EACA,iCACA,qBACA,EACA,4BACA,oCACA,EACA,8BACA,IzBuBO,EyBvBP,EAA6B,EAAY,6BACzC,sBACA,OzBqBO,EyBrBkC,QAAhB,CzBsBd,EAAS,EAAY,QyBrBhC,EzBqBgC,CyBtBS,CACzC,EzBqBmB,EyBrBnB,sCACA,MAKA,sBACA,+BAEA,qBACA,WAGA,mDACA,GACA,GACA,OACA,WAAgC,EAAiB,GACjD,YADiD,EACjD,OACiB,CAEjB,MAEA,GACA,0DAEA,gCACA,UACA,CAAa,CAEb,EACA,sCACA,MAAgC,EAAa,GAC7C,QAD6C,MAC7C,8BACA,8BACY,EAAO,sHACnB,MACA,CACA,uBACA,eAEA,gBACA,EACA,iCACA,WACA,+CACA,YACA,uBACA,8CAGA,qEACA,4CACA,CAAa,CAEb,EACA,+BACA,kCACA,q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6BAA8B,GAArsB,GAA2sB,EAA3sB,SAA2sB,cAAe,kCAA+B,CAAK,oBAAoB,4DAAoE,OAAO,uBAAyB,IAAO,sBAAsB,0BAA8D,yBAA6B,6BAA16C,KAA6B,eAAe,kCAAkC,KAAM,YAAY,WAAW,IAAK,QAAQ,kDAAkD,EAAG,SAAS,CAAovC,KAAkD,iBAA1sC,OAA9D,wBAAyB,WAA+uC,KAA/uC,OAAkC,EAAG,gBAA0sC,GAAgD,CAAzqC,IAA/B,EAAwsC,QAA/2L,qBAAssJ,CAA9sJ,EAAQ,cAAsC,SAAW,EAAwzE,UAAj3E,EAA27E,QAA5D,cAAsB,oBAAr5E,EAAslH,mBAA0H,QAAtF,cAAoB,SAAS,OAA0B,EAA1B,SAA0B,MAAyhB,qBAA1sI,EAAwtL,iBAA4L,kBAA4B,GAAI,aAAiB,+BCWxjM,gBACA,eAEA,IADA,UACY,KAAW,CACvB,GADuB,CACvB,UACA,OACA,YACA,uBACA,KACA,CACA,CACA,cACA,6BACA,CACA,cACA,4BACA,WACA,UACA,UACA,OACA,IACA,2BACA,KAEA,CACA,gBACA,OACA,MACA,OACA,YACA,cACA,QACA,OACA,KACA,QACA,OACA,UACA,iBACA,uBACA,KACA,CACA,CACA,QACA,CACA,gBACA,8BACA,yBAGA,GADA,cAAoB,QACpB,kEACA,IA0HA,EA1HA,cACE,cAAoB,YACtB,cACA,CACA,EAAE,IACF,WACA,UACE,cAAoB,YACtB,gBACA,CACA,CACA,SACA,KACA,IACA,OACA,IACA,KACA,KACA,KACA,gDACA,oDACA,qDACA,cACA,eAAqC,UAAgB,CACrD,GADqD,OACrD,qBACA,kBACA,KACA,6BACA,YACA,MACA,MACA,CACA,CACA,cAGA,GAFA,KACA,KACA,IACA,eACA,aACA,CACA,UACA,WACA,kBACA,EACA,CACA,SACA,KACA,IACA,KACA,aACA,6BACA,CACA,aACA,MACA,uBACA,IACA,SACA,IACA,GACA,KACA,GACA,MACA,KACA,MACA,KACA,QACA,IACA,GAEA,IADA,KAEA,OACA,UACA,CACA,2BAGA,CACA,iBACA,yBACA,gBACA,kBACA,QACA,qBAGA,GADA,mBACA,sBACA,aACA,KACA,KACA,OACA,CACA,eACA,IACA,EAAgB,SAChB,MACA,CACA,qBACA,CACA,UACA,WACA,EACA,EACA,eAEA,IACA,CACA,CACA,OACA,EAAU,OACV,OACA,IACA,IACA,CACA,QACA,CACA,EAAM,OACN,EACA,IACA,IACA,CACA,CACA,CAEA,wBACA,aACA,IACA,OACA,uCACA,yBACA,UACA,oBACA,aACA,mBACA,CACA,EAAE,IACF,aACA,MACA,EACA,aACA,GACA,UACA,CACA,gBACA,eACA,mBACA,CAAG,GACH,CACA,uBAA6B,GAC7B,4BAAkC,GAClC,sBAA4B,GAC5B,yBAA+B,GAC/B,oBAA0B,MAC1B,+BAAqC,GACrC,yBAA+B,aAC/B,eACA,EACA,4BAAkC,YAClC,GACA,GACA,UACA,EACA,yBAA+B,aAC/B,WACA,cACA,mHAEA,yBACA,EACA,kCAAwC,YACxC,QACA,EACA,+BAAqC,YACrC,WACA,EACA,eAAqB,aACrB,UACA,OACA,OACA,OACA,QACA,KACA,SACA,GACA,CACA,QACA,IACA,IACA,UACA,EAAI,OACJ,GACA,CACA,EACA,yBAA+B,cAC/B,uBAA6B,cAC7B,0BAAgC,eAChC,UACA,OACA,OACA,OACA,OACA,OACA,KACA,SACA,GACA,CACA,QACA,IACA,IACA,UACA,EAAI,OACJ,GACA,CACA,EACA,2BAAiC,UACjC,EACA,EACA,GAEA,uBAQA,OALA,EAFA,8BAGA,gBAFA,aAEA,IACA,IACA,EAEA,GACA,OACA,SACA,KACA,QACA,MACA,KACA,QACA,aACA,KACA,QACA,MACA,KACA,SACA,KACA,CAwBA,OAvBA,MACA,GACA,OACA,WACA,gBACA,YACA,iBACA,YACA,EACA,IACA,eACA,OACA,aACA,UACA,GACA,YACA,KACA,WACA,eACA,OACA,GACA,GACA,YACA,CACA,EACA,sBAA4B,GAC5B,uBAA6B,aAC7B,QACA,kBACA,QACA,IACA,IACA,8BACA,EAAM,OACN,GACA,CACA,CACA,gCCjVE,kBAAyD,+BCF3D,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,uCAAsD,CACtD,cACA,eACA,QACA,CACA,CAAC,EAAC,IACF,EAA4B,EAAQ,KAA8C,EAClF,EAAsB,EAAQ,IAA8C,EADzC,EAER,EAAQ,IAA8C,EACjF,CAF6B,CAEH,EAAQ,KAA2C,EAC7E,qJCbA,qCAA6C,CAC7C,QACA,CAAC,EAAC,SAwDF,KACA,0CACA,cACA,SACK,CACL,EACA,GACA,yBACA,QACA,CAAK,CACL,yBACA,QACA,CAAK,CACL,0BACA,QACA,CAAK,CACL,0BACA,QACA,CAAK,CACL,+BACA,QACA,CAAK,CACL,iCACA,QACA,CAAK,CACL,uCACA,QACA,CAAK,CACL,kCACA,QACA,CAAK,CACL,0BACA,QACA,CAAK,CACL,yCACA,QACA,CAAK,CACL,+BACA,QACA,CAAK,CACL,+BACA,QACA,CAAK,CACL,sCACA,QACA,CAAK,CACL,4BACA,QACA,CAAK,CACL,sCACA,QACA,CAAK,CACL,8CACA,QACA,CAAK,CACL,kDACA,QACA,CAAK,CACL,uCACA,QACA,CAAK,CACL,0CACA,QACA,CAAK,CACL,kCACA,QACA,CAAK,CACL,oCACA,QACA,CAAK,CACL,qCACA,QACA,CAAK,CACL,4BACA,QACA,CAAK,CACL,2CACA,QACA,CAAK,CACL,4BACA,QACA,CAAK,CACL,mCACA,QACA,CAAK,CACL,8BACA,QACA,CAAK,CACL,iCACA,QACA,CAAK,CACL,2BACA,QACA,CAAK,CACL,uCACA,QACA,CAAK,CACL,sDACA,QACA,CAAK,CACL,0CACA,QACA,CAAK,CACL,0BACA,QACA,CAAK,CACL,2CACA,QACA,CAAK,CACL,uCACA,QACA,CAAK,CACL,kCACA,QACA,CAAK,CACL,qCACA,QACA,CAAK,CACL,mCACA,QACA,CAAK,CACL,mCACA,QACA,CAAK,CACL,+BACA,QACA,CAAK,CACL,mCACA,QACA,CAAK,CACL,8BACA,QACA,CAAK,CACL,sBACA,QACA,CAAK,CACL,qCACA,QACA,CAAK,CACL,gDACA,QACA,CAAK,CACL,qCACA,QACA,CAAK,CACL,0BACA,QACA,CAAK,CACL,qCACA,QACA,CAAK,CACL,0CACA,QACA,CAAK,CACL,sDACA,QACA,CAAK,CACL,4CACA,QACA,CAAK,CACL,0BACA,SACA,CAAK,CACL,oCACA,SACA,CACA,CAAC,EACD,aACA,SACA,mBACA,2BACA,wCACA,kBACA,cACA,iBACA,SACA,YACA,UACA,UACA,UACA,sBACA,2BACA,4BACA,gCACA,gBACA,MACA,MACA,OACA,UACA,UACA,aACA,eACA,cAA+C,EAAoB,EACnE,oBACA,uBACA,qBACA,0BACA,yBACA,mCACA,qCACA,sCACA,mCACA,uCACA,2CACA,kLACA,wGACA,4FACA,2HACA,4GACA,0HACA,+FACA,mGACA,uGACA,6JACA,sNACA,yJACA,GACA,MACA,QACA,aACA,MACA,MACA,CACA,GACA,YACA,qCACA,eACA,EAIA,GAGA,gBAIA,4BAGA,0BAGA,+BAGA,UAGA,wBAGA,wBAGA,uBAGA,mCACA,EACA,IACA,KACA,OACA,cACA,wBACA,gBACA,CACA,YACA,wBACA,gBACA,aACA,aACA,CACA,eAEA,MACA,CACA,YACA,sBACA,kBACA,CACA,SACA,wBACA,gBACA,sBACA,kBACA,SACA,aACA,CACA,UAEA,wBACA,sBACA,kBACA,gBACA,CAEA,EACA,IACA,uCACA,6BACA,wCACA,gDACA,8BCjWA,cACA,0DACA,CAXA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,8BAA6C,CAC7C,cACA,eACA,QACA,CACA,CAAC,EAAC,8BCRF,qCAA6C,CAC7C,QACA,CAAC,EAAC,SAKF,KACA,0CACA,cACA,SACK,CACL,EACA,GAIA,mBACA,QACA,CAAK,CACL,0BACA,QACA,CACA,CAAC,EACD,MAAuB,EAAQ,KAA+B,EAC9D,UAD8B,CAC9B,GACA,6DACA,CAcA,qBAC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,EAC5E,UADgD,KAChD,qBAAoE,KACpE,CACA,CAlBA,qCAA6C,CAC7C,QACA,CAAC,EACD,0CAAkD,CAClD,cACA,eACA,QACA,CACA,CAAC,EAAC,8BCRF,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,sCAAqD,CACrD,cACA,eACA,oCAEA,CAAC,EAAC,IACF,EAAoC,EAAQ,KAAiC,YAAlC,oBCT3C,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,iDAAgE,CAChE,cACA,eACA,QACA,CACA,CAAC,EAED,WADmC,KAAuB,EAC1D,UADkC,aAClC,kCCVA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,yCAAwD,CACxD,cACA,eACA,uCAEA,CAAC,EAAC,IACF,EAAuC,EAAQ,KAAqC,YAAtC,kBCT9C,qCAA6C,CAC7C,QACA,CAAC,EAAC,SAMF,KACA,0CACA,cACA,SACK,CACL,EACA,GACA,wBACA,QACA,CAAK,CACL,mCACA,QACA,CAAK,CACL,0BACA,QACA,CACA,CAAC,EACD,yFACA,SACA,UACA,OACA,CACA,WAGA,CACA,MACA,OACA,CACA,OACA,OACA,CACA,YACA,OACA,CACA,eACA,QACA,CACA,CACA,mEACA,oBACA,EACA,MAEA,KACA,CACA,qBACA,EACA,UAEA,SACA,CACA,oBACA,EACA,aAEA,iBACA,cACA,CACA,gCC/CA,qCAA6C,CAC7C,QACA,CAAC,EAgCD,SANA,KACA,0CACA,cACA,SACK,CACL,EACA,GACA,oBACA,QACA,CAAK,CACL,uDACA,QACA,CAAK,CACL,8CACA,QACA,CAAK,CACL,+BACA,QACA,CAAK,CACL,iCACA,QACA,CAAK,CACL,gCACA,QACA,CAAK,CACL,sCACA,QACA,CAAK,CACL,wCACA,QACA,CAAK,CACL,sCACA,QACA,CAAK,CACL,oCACA,QACA,CAAK,CACL,iCACA,QACA,CAAK,CACL,6BACA,QACA,CAAK,CACL,uCACA,QACA,CAAK,CACL,qCACA,QACA,CAAK,CACL,gCACA,QACA,CAAK,CACL,oCACA,QACA,CAAK,CACL,4CACA,QACA,CAAK,CACL,qCACA,QACA,CAAK,CACL,2CACA,QACA,CAAK,CACL,sCACA,QACA,CAAK,CACL,iDACA,QACA,CAAK,CACL,kDACA,QACA,CAAK,CACL,iCACA,QACA,CACA,CAAC,EACD,eAOA,GACA,0BACA,SACA,CACA,EAXsD,EAAQ,IAAO,GACrE,EAA4B,EAAQ,KAA8C,CADrB,CAE7D,EAAiC,EAAQ,KAAmD,CADzD,CAEnC,EAAsC,EAAQ,KAAoC,CAD1C,CAExC,EAAkC,EAAQ,KAA2C,CADxC,CAE7C,EAA+B,EAAQ,KAA4B,CAD1B,CAEzC,EAA2B,EAAQ,KAAuC,CADpC,CAOtC,UANkC,IAMlC,mCACA,cACA,OACA,yBACA,mBACA,6BACA,8BACA,CACA,CACA,aACA,OACA,uBACA,sBACA,sBACA,wBACA,iBAEA,CACA,cACA,MACA,yDACA,CACA,kBACA,QACA,2CADA,IAWA,gCACA,wBACA,2CAA0E,SAAa,+EAA+E,EAAW,+HAEjL,MACA,4BACA,oCACU,gCACV,eAEA,wCAA4E,SAAa,kDAAkD,EAAW,6EAGtJ,OAFA,4BACA,4BACA,CACA,EAAU,CAIV,CACA,OALmB,EAKnB,OACA,wCACA,6BACA,8BACA,CACA,kBAEA,wCAAoE,SAAa,oDAAoD,EAAW,+EAIhJ,OAHA,eACA,4BACA,4BACA,CACA,CACA,gBACA,GACA,6CAMA,qDACA,gBAMA,CAIA,kBAEA,QADA,SAA4B,GAAO,kEAAkE,EAAW,IAEhH,sBACA,wBACA,GACA,wBAGA,oDACA,YACA,CAAS,CAET,CACA,oBACA,wBAOA,OANA,GACA,qCACA,0BACA,+BAGA,QACA,CACA,cAGA,mBACA,CACA,oBACA,uBAaA,OAZA,GACA,qCACA,0BACA,8BACA,mBAGA,0BAIA,SACA,WAAmD,GAAO,kEAAkE,EAAW,GACvI,CACA,QACA,mBAAoB,UAAe,EACnC,wCAEA,MADA,mDAEA,CACA,kBACA,IACA,GACA,wBAGA,oDACA,YACA,CAAS,EAET,mCACA,CACA,gBACA,eAAoB,GAAO,kEAAkE,EAAW,oKAExG,oBACA,0DACA,YAGA,CACA,cACA,iKACA,CACA,0BACA,sGAEA,mCACA,cACA,eAEA,OADA,WACA,CACA,CACA,cACA,+FACA,CACA,cACA,iBACA,CACA,gBAKA,OADA,6CACA,kBAEA,cACA,gFAAgH,UAAmB,IACnI,gBAGA,qBAEA,kCAIA,8BAIA,wBAIS,WACT,6BAA4C,EAAW;AAAA,EAAK,EAAM,GAElE,CACA,aACA,MACA,+IAEA,CACA,cACA,IACA,0BAEA,IACA,8BACA,CAAM,SACN,UACA,CACA,gBAEA,gBACA,wBACA,GACA,wBACA,oDACA,YACA,CAAS,CAET,CACA,cACA,+BACA,oCACA,iFAGA,wCACA,IAEA,qBAIA,0DACkB,yBAElB,+BACkB,6BAClB,SAGA,CACA,CACA,CACA,yCACA,sBAAiD,yBAA0C,WAC3F,sBAAiD,yBAA0C,WAC3F,sBAA+C,uBAAwC,WACvF,sBACA,eAGM,cACN,wBACA,MACA,CAAM,cACN,wBACA,MACA,CAAM,cACN,yBACA,MACA,CAAM,6DACN,0BACA,MACA,EAAM,IAEN,eAKA,KACA,eAEA,OADA,sBACA,CACA,EAVA,UAAkC,EAAM,iVACxC,GACA,wBACA,MACA,EACA,CAMA,wBACA,EACA,EACA,EAcA,GAbA,6BACA,8BACA,0BACA,4BACM,6BACN,8BACA,0BACA,6BAEA,OACA,SACA,MAEA,0BAOA,MANA,GAGA,iBAGA,4BAEA,sBACA,aACA,YAAuB,WAA0B,IACjD,mBAEA,kCACA,CACA,2BACA,yBACA,KAEA,MADA,iBACA,sCAAmF,EAAM,sEAAsE,GAAgB,gFAE/K,6CAA+E,EAAM,gdACrF,CAAU,yBACV,KAEA,MADA,iBACA,sCAAmF,EAAM,sEAAsE,GAAgB,gFAE/K,6CAA+E,EAAM,gdACrF,CACA,CACA,gCCvdA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,mCAAkD,CAClD,cACA,eACA,QACA,CACA,CAAC,EAAC,IACF,EAA4B,EAAQ,GAA4B,EAChE,YADmC,EAEnC,kEAMA,CAHA,GACA,sBAEA,yCACA,CAGA,yBACA,mBACA,EAEA,sCACA,CACA,yCACA,mBACA,EAEA,mCACA,CACA,uCACA,mBACA,EAEA,IACA,gCCtCA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,oCAAmD,CACnD,cACA,eACA,kCAEA,CAAC,EAAC,IACF,EAAkC,EAAQ,KAA+B,YAAhC,oBCTzC,qCAA6C,CAC7C,QACA,CAAC,EAaD,SANA,KACA,0CACA,cACA,SACK,CACL,EACA,GACA,mCACA,QACA,CAAK,CACL,uCACA,QACA,CAAK,CACL,oCACA,QACA,CAAK,CACL,gCACA,qCACA,CACA,CAAC,EACD,MAAsC,EAAQ,KAAoC,EAClF,UAD6C,CAC7C,GACA,gDACA,MACA,sBACA,SAEA,+EAEA,iBAAiC,EAAkB,oEAEnD,oBACA,iBAAiC,EAAkB,8JACzC,6BACV,iBAAiC,EAAkB,wKAEnD,CACA,iBAAyB,EAAkB,mHAC3C,CACA,oBACA,+CACA,2BAEA,IACA,CACA,oBACA,yEACA,mBACA,wBAIA,2BAEA,IACA,gCChEA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,+DAA8E,CAC9E,cACA,eACA,QACA,CACA,CAAC,EAAC,IACF,WASA,KACA,mBACA,SAEA,sDACA,OACA,SACA,EAEA,QATA,QAUA,eACA,gBAEA,OACA,cACA,EACA,yDACA,eACA,6DACA,iDACA,mBACA,6BAEA,UAQA,OAJA,YACA,GACA,WAEA,CACA,EAzCuD,EAAQ,IAAO,GACtE,UAD8D,CAC9D,GACA,0CACA,kBACA,cACA,qBACA,YACA,EAAK,GACL,CAkCA,OACA,YACA,EAEA,0CAIA,EAAuB,KAA6B,GAAG,CAAa,IAWpE,EAXuB,OAWvB,KACA,sBAkBA,EAjBA,QAmBA,CACA,CA9BA,EACA,IACA,IACA,YACA,EAAM,OACN,cACA,CACA,CAAC,8BCtDD,gBACA,0BACA,gCACA,gCAAqD,GAAY,sGAAsG,GAAY,uJACnL,CAAS,EACT,OACA,CAAS,CACT,CAAK,EAKL,OADA,WACA,CACA,CACA,cAvBA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,sCAAqD,CACrD,cACA,eACA,QACA,CACA,CAAC,EAAC,4BCdF,qCAA6C,CAC7C,QACA,CAAC,EAAC,SAMF,KACA,0CACA,cACA,QACA,CAAK,CACL,EACA,GACA,sCACA,QACA,CAAK,CACL,+CACA,QACA,CAAK,CACL,sCACA,QACA,CACA,CAAC,EACD,MAAkB,EAAQ,KAAyC,EACnE,GACA,OAFyB,IAGzB,MACA,OACA,QACA,CACA,cAEA,gEACA,CACA,cACA,UACA,0BAEA,GADA,6BACA,CAEA,mBACA,KACA,CAEA,cACA,2CAAuD,EAAK,oFAI5D,OAFA,4BAEA,GACA,UAGA,EADA,QACA,IAAuC,EAAiB,EAExD,QAEA,KACA,YAEA,WACA,2CAA+D,EAAK,+DAEpE,+CACA,KACA,aAEA,QACA,KACA,gBAEA,mBACA,eACA,2CAA+D,EAAK,kEAEpE,oCACA,KACA,SACA,2CACA,CACA,OACA,oBACA,kBACA,CACA,8BCtFA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,8BAA6C,CAC7C,cACA,eACA,QACA,CACA,CAAC,EAAC,IACF,+BACA,cACA,kDACA,gCCZA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,gDAA+D,CAC/D,cACA,eACA,QACA,CACA,CAAC,EAAC,EACuB,KAAwC,EACzC,EAAQ,KAAkC,EADlE,CAAwB,GAExB,EAAe,EAAQ,EADQ,GACC,EAChC,UADsB,CACtB,GAIA,gBAIA,GACA,eACA,KACA,SAEA,yBAWA,OAVA,WACA,2BACA,8BAKA,WAEA,CAAK,EACL,CACA,EArBA,EAEA,CACA,gDCnBA,qCAA6C,CAC7C,QACA,CAAC,EAAC,SAQF,KACA,0CACA,cACA,SACK,CACL,EACA,GACA,kCACA,QACA,CAAK,CACL,iDACA,QACA,CAAK,CACL,yCACA,QACA,CAAK,CACL,sCACA,QACA,CAAK,CACL,8CACA,QACA,CACA,CAAC,EACgB,EAAQ,KAAwC,EAAjE,IACA,EAA0B,EAAQ,EADV,GAC2C,EACnE,EAAsC,EAAQ,KAAgD,CAD7D,CAEjC,EAAwB,EAAQ,KAAkC,CADrB,CAE7C,EAAe,EAAQ,KAAS,CADD,CAE/B,EAA+B,EAAQ,KAA4B,CAD7C,CAEtB,EAAkD,EAAQ,KAAmD,CADvE,CAGtC,UAFyD,CAEzD,KACA,wCACA,KACA,eACA,gBACA,oBACA,uBACA,eAEA,CAEA,OA+EA,EA/EA,EACA,CAbmB,EAAQ,KAAqB,EAchD,QACA,EAf0B,OAe1B,OACA,wCACA,KACA,eACA,gBACA,oBACA,uBACA,eAEA,CAEA,OAiEA,EAjEA,EACA,CACA,gBACA,wCACA,KACA,eACA,gBACA,oBACA,uBACA,eAEA,CAEA,OAoDA,EApDA,EACA,CACA,gBACA,wCACA,4BACA,4BACA,KACA,gBACA,YAIA,yDAEA,CAEA,CAIA,yBACA,CACA,kBACA,4BACA,MACA,SACA,eACA,aACA,KACA,KACA,CAEA,WAEA,qBAsBA,gBACA,eACA,KACA,SAEA,0DAyBA,OAxBA,WACA,2BACA,8BAIA,2BACA,MACA,qDACA,SACA,0DACA,CAAiB,CACjB,OACA,2BACA,QACA,YACA,aACA,CAAqB,CACrB,CAAiB,CACjB,cACA,eACA,CAAa,CAEb,CAAK,EACL,CACA,EAnDA,aAMA,SA8CA,SACA,eACA,KACA,SAEA,OACA,MAKA,qBA4DA,OA3DA,WACA,2BACA,+BAIA,UACA,2BACA,MACA,oDAOA,0BAEA,wDAGA,6CAEA,CAAqB,CACrB,aACA,CAAiB,EACjB,2BACA,MACA,oDAOA,0BAEA,wDAGA,6CAEA,CAAqB,CACrB,OACA,2BACA,QACA,YACA,aACA,CAAyB,CACzB,C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gBACA,oBACA,uBACA,aAEA,CAEA,aACA,CAbmB,EAAQ,KAAqB,EAchD,QACA,EAf0B,OAe1B,OACA,wCACA,KACA,eACA,gBACA,oBACA,uBACA,aAEA,CAEA,aACA,CACA,cACA,iBAGA,yBAAiC,EAEjC,+CACA,wBAIA,0DAKA,kBAA6B,CAC7B,CACA,uBACA,cAGA,kBAAiC,EAEjC,qBAuBA,cACA,eACA,KACA,SAEA,gEACA,eACA,WACA,sBAIA,mCAEA,UACA,WAIA,MADA,4BADA,wDACA,GACA,2BAEA,cAIA,MADA,4BADA,yDACA,GACA,2BAGA,sBACA,oBACA,2BACA,eACA,cACA,qBAGA,YACA,cAGA,aACA,eACA,iBAIA,kCAEA,SAEA,uBACA,2DACA,SACA,0DACA,CACA,kCAEA,CACA,CAAS,CACT,SAKA,uBACA,gEACA,SACA,0DACA,CACA,gCACA,CAAS,CACT,UACA,SAAkC,gBAAgB,4CAClD,SACA,0DACA,CACA,CAAK,EAEL,OADA,WACA,CACA,EApGA,WAqGA,cACA,eACA,KACA,SAMA,sBAJA,IAKA,eACA,WACA,sBAIA,mCAEA,UAEA,qBACA,oBACA,2BACA,eACA,cACA,qBAGA,YACA,cAGA,aACA,eACA,iBAIA,kCAEA,YACA,CACA,6DACA,sBACA,uEAC0B,yBAE1B,wDAGA,8CAEA,MACA,CACA,aACA,CACA,8DACA,sBACA,uEAC0B,yBAE1B,wDAGA,8CAEA,MACA,CACA,QAEA,uBACA,0DACA,sBACA,uEAC8B,yBAE9B,wDAGA,6CAEA,CACA,kCAEA,CACA,CAAS,CACT,SAKA,uBACA,gEAUA,OATA,qBACA,uEACkB,yBAElB,wDAGA,8CAEA,EACA,CACA,gCACA,CAAS,CACT,UACA,SAAkC,gBAAgB,2CAClD,sBACA,uEACc,yBAEd,wDAGA,6CAEA,CACA,CAAK,EAEL,OADA,WACA,CACA,EAzNA,IACA,CACA,uBACA,cAGA,kBAAiC,EAKjC,SA+MA,KACA,eACA,KACA,SAKA,yBAgDA,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oBACA,KAGA,gBAFA,kBAGA,sBACA,EACA,GACA,OACA,KACA,WACA,EACA,aAAmB,aACnB,4BACA,EACA,SAAe,eACf,iDACA,WACA,qBACA,EACA,gDACA,EACA,iCACA,gBACA,MACA,aACA,MACA,EACA,kDACA,CACA,cACA,YACA,eACA,GAEA,cACA,SACA,cACA,YACA,gBACA,6CACA,CAAS,CACT,CACA,EACA,eAAqB,eACrB,uBACA,gCACA,iCACA,QACA,KACA,eAEA,SACA,cACA,UACA,gDACA,6CACA,CAAS,CACT,OACM,kBACN,EACA,SAAe,eACf,GACA,oBACA,oBACA,UACA,sBACA,CACA,WACA,qBACA,WACA,cACA,UACA,gDACA,8CACA,2CACA,cACA,iCACA,gBACA,OACA,eACA,kCACA,iBACA,OACA,YACA,oDACA,WACA,kDACA,6CACA,CAAK,CACL,CACA,EACA,eAAqB,eACrB,uBACA,MACA,4BACA,SACA,GACA,uCACA,KACA,OACA,cACA,UACA,+CACA,CAAO,CACP,EAAM,aACN,EACA,kBAAwB,aACxB,QACA,EACA,yBAA+B,eAC/B,WACA,EACA,cAAoB,iBACpB,8BACA,EACA,eAAqB,YACrB,oCACA,EACA,SAAe,6DChLf,CA/BA,aAEA,GACA,oDACA,2DAcA,IAEA,0CACA,CAAI,SAGJ,gBACA,EACA,IAME,kBAAgE,+BCDlE,CA/BA,aAEA,GACA,oDACA,2DAcA,IAEA,0CACA,CAAI,SAGJ,gBACA,EACA,IAME,kBAAyD,+BCvB3D,MAAe,EAAQ,KAAW,EAClC,GAAqB,WA0CrB,UACA,cACA,MAAgB,EAAmB,SACnC,QADmC,IACnC,sCACA,MACA,OACA,YACA,qBACA,SACA,CAAK,CACL,YACA,oBACA,UACA,GAEA,EACA,CACA,cACA,cACA,wBAAuD,YAAmB,CAC1E,aACA,SACA,UACA,YACA,YACA,EAAyB,GAAsB,IAC/C,UACA,uBACA,YACA,YACA,mBACA,CACA,oBACA,aACA,QACA,+BACA,cACA,CAAS,EACT,WACA,eACA,IACA,CACA,cACA,MAAsB,EAAmB,MACzC,WADyC,IACzC,6BACA,0BACA,eACA,eACA,iBACA,EACA,UACA,aACA,UACA,EACA,QAEA,cACA,EAA4B,EAAmB,EAC/C,EAAmB,aAD4B,CAE/C,GADmB,CACnB,WACA,kBACA,EACA,IACA,EACA,MACA,+DACA,2CACA,2BACA,kBAQA,uBACA,gBACA,wBACA,mBACA,cAsYA,oBACA,cACA,aACA,cACA,gBACA,CAyBA,cACA,iBACA,qBACA,KACA,KACA,uBACA,IACA,CACA,iBACA,gBACA,cACA,eACA,cACA,OACA,SACA,eAEA,CACA,cACA,mCACA,CACA,gBACA,YAAkB,WAAsB,eACxC,CACA,kBACA,iBACA,gBACA,aACA,KACA,eACA,cACA,WACA,YAAwB,WAA6B,IACrD,wBACA,UACA,YACA,MACA,IACA,IACA,WACA,IAEA,yBACQ,WACR,KACA,gBACA,gBACA,CACA,CACA,gBACA,8CACA,sBACA,CACA,eACA,oBACA,WACA,gBACA,CACA,CACA,kBACA,aACA,iBACA,KAAc,wBAA0B,4BAAoC,EAC5E,KACA,EAEA,CACA,kBACA,EACA,EACA,KAAc,wBAA0B,4BAAoC,EAE5E,CACA,gBACA,qDACA,CACA,cACA,WACA,0BACA,UACA,UACA,MACA,SACA,CACA,CACA,gBACA,+CACA,cACA,WACA,2BACA,UACA,UACA,MACA,SACA,CACA,CAvHA,6CACA,+BACA,oBACA,qBACA,QACA,KACA,uBACA,OACA,CACA,oBACA,gBACA,cACA,KACA,eACA,cACA,GACA,wDACA,GACA,2DACA,KACA,SACA,iBACA,CACA,EAiGA,WACA,cACA,QACA,OACA,cACA,mBACA,aACA,cACA,IACA,0CACA,UAKA,GAJA,UACA,cACA,cACA,QACA,UACA,2BACA,aACA,UACA,UACA,MACA,CACA,CACA,qBACA,SACA,CAAI,SACJ,8BACA,EAAI,OACJ,GACA,CACA,CACA,cACA,IACA,gBACA,sBACA,SACA,CAAI,SACJ,8BACA,CACA,CACA,gBACA,8BACA,4BACA,CAAG,CACH,CACA,cACA,OAAW,8BACX,CACA,gBACA,gBACA,WAEA,OADA,uBACA,CACA,CACA,WACA,EACA,EACA,EACA,EACA,EACA,GAsCA,cACA,eACA,aACA,UACA,qBACA,GACA,sBACA,MACA,CACA,CACA,MACA,OACA,SACA,EAAI,IACJ,KACA,YACA,WACA,WACA,OACA,UACA,EAEA,OADA,OAzDA,cACA,YAAoB,WAAiB,KACrC,KAAa,gBACb,cADiD,EACjD,YACA,eACA,wCACA,CACA,gBACA,YACA,MACA,CACA,UAEA,aACA,OACA,oCAEA,UACA,0BACA,gBACA,uBAEA,UACA,MADA,IAEA,YAEA,SACA,YAEA,OADA,aAEA,sBACA,WACA,qBACA,gBACA,uBACA,EAsBA,GACA,IACA,CACA,oBACA,6BACA,OA1QA,cACA,aACA,4CACA,SACA,uBACA,uBACA,oCACA,uBACA,CAAW,EACX,MACA,CACA,IAdA,EAcA,OACA,UAEA,OAjBA,EAgBA,CAAoC,aAAsB,CAf1D,MAeA,EAfA,GAgBA,CACA,EA2PA,iBACA,MAruBA,cACA,SACA,OACA,kBACA,CACA,yBAIA,GAHA,QACA,gBACA,mBACA,GACA,YACA,8BACA,EACA,iGAEA,CACA,eACA,oBACA,mBAotBA,yBACA,MAEA,UACA,2CACA,YACA,YADA,2BAEA,MACA,OACA,SACA,EAAI,IACJ,KACA,YACA,WACA,WACA,OACA,UACA,EA0CA,OAzCA,OACA,WACA,WACA,YACA,6BACA,gBACA,mBACA,CACA,OACA,oCAEA,UACA,0BACA,gBACA,uBAEA,UACA,MADA,IAEA,YAEA,SACA,YAEA,OADA,aAEA,sBACA,WACA,qBACA,gBACA,uBACA,CAAK,CACL,YACA,eACA,aACA,UACA,qBACA,GACA,sBACA,MACA,CACA,GAEA,IACA,CACA,sBAEA,eADA,gBACA,QAEA,QADA,UACA,QACA,qBACA,KACA,KACA,uBACA,IACA,CACA,iBACA,gBACA,cACA,QAAmB,WAAuB,KAC1C,KAAe,gBACf,cADmD,GACnD,sBAGA,SACA,EACA,EACA,EACA,EACA,EACA,mBARA,UAUA,UAEA,iBACA,eACA,cACA,qBACA,SACA,OACA,EACA,cACA,kBACA,GACA,YACA,WACA,eACA,OACA,UACA,CAAa,CACb,IAEA,CACA,CACA,gBACA,iBACA,CACA,gBACA,iBACA,CACA,gBACA,4BAAoC,UAAgB,CACpD,CACA,gBACA,eACA,YAAkB,WAAkB,IACpC,0BACA,QACA,CACA,gBACA,2BACA,CACA,gBACA,QACA,CAkGA,aACA,YACA,oHAEA,CACA,WACA,EACA,EACA,EACA,EACA,EACA,EACA,GAEA,IAuaA,EAvaA,SACA,uBACA,8BACA,sBACA,gCACA,yBACA,cACA,eACA,oCACA,oBACA,0DACA,gBACA,iBACA,gBA0ZA,EA1ZA,KA2ZA,cACA,sBACA,OAzhBA,kBACA,eACA,WACA,OACA,UACA,SACA,IACA,SACA,WACA,WACA,OACA,UACA,EAAW,CACX,EAEA,aACA,QACA,iBACA,SACA,OACA,EACA,MADA,2BAIA,SACA,+CAAiE,EAEjE,WADA,0BAEA,SACA,6BACA,SACA,OAEA,EACA,EAFA,aAIA,EACA,EACA,EAGA,SAGA,GAFA,iBAEA,MADA,gBAEA,YACA,sKAEA,eACA,SACA,OACA,EACA,EADA,aACA,MAEA,SACA,OAEA,IADA,aACA,MAEA,SACA,OACA,EACA,EADA,aACA,MAEA,SACA,OAEA,IADA,aACA,MAEA,SACA,UACA,SACA,OAEA,IADA,aACA,MAEA,SACA,UACA,SACA,uBACA,SACA,UACA,SACA,MACA,SACA,uCACA,SACA,yBACA,SACA,OACA,EACA,EADA,aACA,MAEA,CACA,CACA,QACA,EAybA,YACA,iCACA,YACA,IACA,GACA,WACA,UACA,SACA,SACA,WACW,CACX,UAEA,GACA,QACA,OACA,UAGA,IADA,yCAEA,aACA,YACA,UACA,KACA,KACA,EAEA,WACA,UACA,MACA,QACQ,IACR,QACA,CACA,QACA,EA/bA,CACA,kBACA,gBACA,UACA,yBACA,yBACA,oCACA,CA6BA,oBACA,gBACA,UACA,GACA,sBACA,WACA,qBACA,UACA,WACA,wBACA,MACA,EACA,yBAEA,CACA,kBACA,WACA,sBACA,OACA,kBACA,GACA,CACA,CAAG,EACH,WACA,SACA,yBACA,SACA,aACA,kBACA,YACA,CAAW,CACX,CAAK,CACL,yBACA,aACA,uCACA,KACA,uBACA,mBACA,QACA,YACA,mBACA,CAAe,CACf,YACA,iBACA,GAEA,IACA,EAAQ,IACR,IACA,WACA,OACA,YACA,mBACA,CAAW,CACX,YACA,iBACA,GAEA,IACA,kBACA,gBACA,MACA,CAAS,CACT,CACA,CAAK,CACL,iBACA,0BACA,CACA,QACA,OACA,kBACA,gBACA,CAAS,CACT,CACA,CAAK,CACL,kBACA,2BACA,CACA,QACA,OACA,kBACA,iBACA,CAAS,CACT,CACA,CACA,CAAG,CACH,CACA,aACA,YAOA,kBACA,SACA,KACA,IACA,IAEA,iBACA,IAZA,EAYA,IACA,MAZA,IAAW,KADX,EAaA,YACA,cACA,YACA,oFAEA,iBACA,KACA,aACA,YACA,CAAgB,qBAAyB,CACzC,KACA,EAEA,UACA,CACA,aACA,CAAO,CA5BI,CACX,MACA,CA2BA,CAAK,CAEL,EACA,EACA,EACA,WACA,CACA,yBACA,gBACA,WACA,YACA,CAAc,gBAAwB,CACtC,KACA,OAEA,CACA,WACA,UACA,WACA,qBACA,SAA0B,iBAC1B,UACA,QACA,CACA,GACA,CAAO,CACP,yBACA,aACA,OACA,EACA,EACA,IAEA,aACA,GACA,CAAO,CACP,kBASA,IARA,KACA,aACA,OACA,EACA,EACA,IAEA,aACA,IAA+B,YAAgC,EAE/D,OACA,eACA,GAEA,CAAO,CACP,kBAEA,IADA,KAEA,cACA,YACA,YAGA,WACA,CACA,EAEA,CACA,aACA,YACA,wQAGA,OADA,4BACA,CACA,CACA,iBACA,kCAAoE,IAAO,IAC3E,mBACA,oBACA,cAA2B,IAAU,KACrC,WACA,WACA,gBAGA,OADA,WACA,CACA,CACA,YACA,EACA,EACA,EACA,EACA,EACA,GAWA,MALA,QACA,CALA,EACA,gCACA,EACA,SAEA,OACA,aACA,gBAGA,CA+LA,eACA,aACA,KACA,KACA,KACA,oCACA,OACA,OACA,yBACA,sBACA,OAEA,CACA,iBAqFA,cACA,MACA,CACA,oBACA,cAxFA,cACA,cACA,+CACA,CACA,QACA,cACA,WACA,IACA,gBACA,eACA,YACA,WACA,KAEA,CACA,SACA,UACA,OAEA,KADA,WAEA,IACA,EACA,sBACA,QACA,QAEA,KADA,UAEA,QACA,QACA,SACA,QACA,QACA,SACA,QACA,SACA,QACA,SACA,QACA,SACA,OACA,cACA,YACA,QACA,SACA,QACA,cACA,UACA,QACA,QAEA,KADA,WAEA,IACA,EACA,KACA,iBACA,QACA,QACA,kBACA,KACA,QACA,wBACA,CACA,qBACA,QAEA,CA7QA,oBACA,UACA,QACA,sBACA,MACA,SACA,wBACA,MACA,UACA,EACA,EACA,EACA,wBAEA,MACA,SACA,gCACA,MACA,SACA,yBACA,MACA,UACA,0BACA,MACA,SACA,yBACA,MACA,UACA,0BACA,MACA,SACA,2BACA,MACA,UACA,2BACA,MACA,SACA,4BACA,MACA,UACA,6BACA,MACA,SACA,uBACA,MACA,CACA,IACA,gCACA,WACA,IAEA,oBAEA,OADA,iBACA,GACA,SACA,SAlTA,OACA,gBACA,WACA,4BACA,eAvgCA,KACA,MACA,cACA,gBACA,aACA,CAEA,IADA,cAEA,YACA,8BACA,KACA,2GAEA,OAEA,oBACA,oBACA,kBAEA,QACA,EAm/BA,oBACA,WACA,MACA,OACA,mBACA,EAAM,IACN,+BACA,WACA,OACA,WACA,aACA,CAAO,CACP,YACA,aACA,EAEA,EAAI,IACJ,EACA,OACA,MACA,EACA,kCAEA,EAuRA,OACA,KACA,SAKA,OAJA,OAEA,aADA,aACA,aACA,MACA,GACA,QACA,OACA,KACA,SACA,mBACA,OACA,eACA,KACA,SACA,OACA,OACA,aACA,cACA,SACA,KACA,SACA,mBACA,OACA,eACA,KACA,SACA,mBACA,OACA,eACA,KACA,SACA,mBACA,OACA,IACA,KACA,qBACA,0BAEA,KACA,SACA,mBACA,OACA,cACA,CACA,KACA,SACA,gBACA,QACA,gBAEA,GADA,cACA,QACA,OACA,oCACA,KACA,SAEA,IADA,aACA,8BACA,yBACA,qCACA,KACA,SACA,QACA,YACA,kMAEA,SACA,cACA,KACA,UACA,eACA,KACA,SACA,UACA,KACA,UACA,UACA,KACA,SACA,sBACA,wBACA,wCACA,KACA,SAEA,IADA,aACA,QACA,OACA,MACA,EACA,iCAEA,EACA,EAwHA,QADA,kCAEA,IACA,WACA,UACA,eACA,CACA,4CACA,UACA,gBACA,KACA,CACA,CAKA,OAJA,cACA,WACA,YACA,eACA,yBACA,CACA,GAKA,QACA,CACA,iBAAuB,eACvB,YASA,OARA,OACA,YACA,YACA,CAAK,CACL,YACA,MACA,GAEA,MACA,EACA,0BAAgC,eAGhC,OADA,GADA,QACA,GACA,MACA,EACA,uBAA6B,mBAzkC7B,EA0kCA,aACA,4CACA,aACA,CAEA,OA/kCA,EA8kCA,CAAoC,gBAAqB,CA7kCzD,MA6kCA,EA7kCA,GA8kCA,CACA,EACA,6BAAmC,YACnC,cACA,EACA,aAAmB,eACnB,iCACA,MA77CA,SACA,EACA,EACA,EACA,EACA,GAEA,gBACA,YACA,eACA,SACA,aACA,cAEA,EACA,UAGA,OAFA,2BACA,SA86CA,GA96CA,KACA,oBACA,CAsFA,gBACA,wBACA,uBACA,mBACA,OACA,oCACA,IAtIA,EAgGA,IAyBA,EAEA,EAWA,cACA,cACA,OACA,iBACA,IAEA,CACA,YACA,qJAEA,QACA,aACA,qBACA,oBACA,IACA,IACA,WACA,MACA,SAEA,OADA,SA6zCA,GA7zCA,KACA,kBACA,CAAY,SACZ,GACA,oBACA,UACA,0BACA,CACA,IACA,UAaA,OAZA,aACA,IACA,aACA,IACA,SA+yCA,GA/yCA,KACA,IACA,WACA,CAAkB,SAClB,IACA,CACA,EACA,YACA,kBACA,CAEA,OADA,KACA,IACA,EAAY,OACZ,GACA,CACA,CACA,8BACA,2BACA,IACA,UAYA,OAXA,mBACA,IACA,aACA,MACA,cACA,IACA,WACA,CAAY,SACZ,IACA,CACA,CAAS,IACT,mBACA,CAEA,YADA,cAEA,SACA,SADA,YAGA,qBAEA,SADA,iBAEA,WACA,WACA,YACA,YACA,iBACA,0BACA,2BACA,QAEA,IADA,QACA,IAIA,OAHA,wBACA,eACA,CAAS,EACT,mBACA,CACA,oBACA,OACA,MACA,qBACA,2BACA,gBACA,oBAEA,oBACA,OACA,MACA,qBACA,2BACA,gBACA,oBAEA,4BACA,OACA,gBACA,MACA,2BACA,gBACA,oBAEA,0CACA,2CACA,kCACA,gBACA,2CACA,4CACA,2CACA,4CACA,6CACA,6CACA,8BACA,gBACA,+BACA,gBACA,yCACA,8CACA,OACA,2BACA,MACA,gBACA,oBAEA,KA5QA,QADA,EA6QA,IA5QA,wBAIA,kBAHA,GACA,SACA,iBACA,OAyQA,MACA,gBACA,EACA,OACA,IACA,cACA,GAEA,2BACA,gBACA,qBACA,cAEA,GACA,mCACA,4BAEA,OAvMA,YACA,IACA,IAxBA,EAgBA,EAEA,EAzCA,EAgBA,EAEA,EACA,EA4BA,eAA4C,YAAc,CAC1D,CAAM,SACN,OA1BA,EA0BA,cAXA,2BACA,IACA,IACA,MACA,cAlBA,cACA,UACA,kBAEA,kBAEA,IACA,gCACA,gBACA,kBACA,CAAU,SACV,IACA,CACA,EAKA,GACA,mBAOA,CACA,OAnDA,EAmDA,EApCA,2BACA,IACA,IACA,MACA,KACA,kCAnBA,cACA,OACA,OACA,0BACA,SACA,IACA,0BAEA,kBAEA,cACA,iBACA,uCACA,EAMA,GACA,mBA+BA,EAgMA,GAEA,qBADA,SAEA,OAlMA,EAkMA,EAlMA,EAkMA,UA1KA,2BACA,IACA,IACA,MACA,QACA,cA5BA,cACA,WACA,oBACA,uBAEA,IACA,gCACA,mBACA,CAAY,SACZ,KACA,MACA,CAEA,YACA,EAAQ,IACR,IACA,gCACA,gBACA,kBACA,CAAU,SACV,IACA,CACA,EAMA,GACA,+BAsKA,GACA,CAFA,UAEA,GACA,wBACA,CACA,cACA,YACA,6HAEA,UACA,CACA,QACA,CACA,4BACA,4CACA,OACA,qBAGA,gCACA,6BA1SA,gBA0SA,GAzSA,IAySA,GAzSA,QAySA,EAxSA,MAwSA,EAtSA,MAsSA,EArSA,YACA,OAoSA,EAnSA,aACA,OAmSA,iCACA,yBAEA,YADA,aAEA,OACA,sBACA,2BACA,MACA,aACA,oBAEA,GACA,YACA,qBACA,KACA,IADA,gBAGA,OACA,qBAEA,aACA,kIAEA,CACA,uBACA,GACA,YACA,qBACA,KACA,IADA,gBAGA,OACA,qBAEA,aACA,gIAEA,CACA,+CACA,aACA,QACA,SACA,yDAEA,CACA,gBAOA,MANA,oBACA,UACA,sBACA,WACA,wBACA,IACA,mBACA,CACA,QACA,IACA,OACA,cACA,IACA,SAKA,OAJA,SACA,KACA,gBACA,aACA,WACA,KACA,KACA,mBACA,CACA,EAwlCA,EACA,GACA,yBACA,sBACA,OACA,EACA,GAEA,gBACA,eACA,6BACA,CACA,iBACA,YACA,gCACA,EACA,6BACA,CACA,CACA,CAAG,CACH,gCCjmDE,kBAAuF,+BCDzF,kBAA4C,6BCS5C,+CACA,+BACA,kBACA,WAGA,GAFA,qBACA,6BACA,UAEA,aADA,KACA,EACA,4BACI,IAEJ,OACA,WACA,OACA,MACA,aALA,UAKA,OACA,OACA,CACA,CACA,UAAgB,GAChB,KAAW,GACX,MAAY,gDCtBZ,2CACA,6BACA,+BACA,kCACA,+BACA,+BACA,8BACA,kCACA,+BACA,2BACA,2BACA,kBAQA,GACA,qBACA,QACA,CAAK,CACL,+BAAsC,CACtC,gCAAuC,CACvC,4BACA,CAAG,CACH,gBACA,KACA,kBACA,aACA,eACA,YACA,iBACA,CAgBA,cAEA,kBACA,aACA,eACA,YACA,iBACA,CAtBA,gCACA,mCACA,GACA,oBACA,sBACA,QAEA,YACA,0GAEA,iDACA,EACA,oCACA,qDACA,EAEA,wBAOA,wBACA,gBACA,iBACA,0BACA,oBACA,GAA2B,4BAAoC,CAC/D,kCACA,wBAEA,OACA,WACA,OACA,MACA,aALA,UAKA,OACA,OACA,CACA,CAWA,cACA,MACA,oBACA,UACA,cAEA,CAUA,aACA,oBAVA,EACA,EAUA,iDAXA,EAYA,SAXA,GAAwB,mBAExB,IACA,8BACA,WACA,CAAK,GAOL,cACA,CACA,cA8IA,kBACA,oBACA,SACA,IAIA,OApHA,sBACA,IAlEA,IA/DA,EAiIA,WACA,2CACA,SACA,sBAEA,UACA,aACA,aACA,aACA,KACA,KACA,cACA,mBACA,OACA,OACA,KACA,KACA,QACA,OACA,cAEA,YACA,EACA,EACA,EACA,EAGA,CACA,CACA,KACA,OACA,OACA,EACA,oBACA,KACA,MACA,SACA,GACA,wBACA,uBACA,QACA,EAAW,EACX,SACA,QA9GA,EAgHA,EAhHA,EAiHA,EACA,cACA,iBACA,GACA,mBACA,EACA,OACA,KACA,EAVA,EA9GA,EACA,OACA,EACA,OACA,OACA,OACA,UAoHA,WACA,EAEA,IACA,uBACA,QACA,YAAoB,WAAqB,IACzC,EACA,IADA,OACA,GACA,KACA,EACA,EACA,EACA,EACA,QAEA,wBAzMA,QADA,EA0MA,IAzMA,wBAIA,kBAHA,GACA,SACA,iBACA,MAqMA,EACA,IACA,gBACA,oBAGA,EACA,IADA,UACA,KACA,KACA,EACA,EACA,EACA,EACA,QAEA,iBACA,6BACA,SACA,SA5HA,GACA,iBACA,gBACA,mBACA,WACA,uBAEA,OACA,0BACA,YACA,oBACA,OACA,YACA,sBACA,sBACA,UACA,CAAe,CACf,YACA,sBACA,gCACA,EACA,EACA,UAEA,gBACA,mBACA,WACA,cACA,CACA,CACA,OACA,EA6FA,GACA,EACA,EACA,EACA,EAGA,aACA,kDACA,qBAHA,cAIA,mBAA+B,8BAAyC,EACxE,GACA,4EAEA,CACA,QACA,EAKA,sBACA,sBACA,CAAG,EACH,CACA,CACA,cACA,mBACA,gBACA,QACA,KACA,YACA,iCACA,yBACA,CAAO,CACP,YACA,iCACA,yBACA,GAEA,yCACA,CACA,gDACA,UAEA,MACA,+BACA,YACA,YACA,GACA,yBACA,qCACA,CACA,qCACA,WACA,cACA,QACA,oBACA,UACA,2BACA,kBACA,UACA,OACA,CAAW,EACX,kCACA,EAAU,OACV,iBAA8B,GAC9B,IADqC,QACrC,OAAgC,EAAO,MAE7B,EAAO,4BACjB,MACA,CACA,gBACA,EACA,cACA,UAAgB,EAChB,MACA,wBACA,EACA,EACA,WACA,uBACA,CAAO,CACP,EAEA,CAAG,CACH,kBACA,QAIA,OAHA,eACA,GACA,CAAK,EACL,CACA,CAAG,CACH,oBACA,OACA,gBACA,QACA,CAAO,KAEP,CAAG,CACH,iBACA,SACA,YACA,yEAEA,QACA,CACA,EACA,WAAiB,GACjB,UAAgB,GAChB,UAAgB,GAChB,eAAqB,GACrB,YAAkB,GAClB,UAAgB,GAChB,iEAAuE,CACvE,EACA,oBAA0B,EAC1B,cACA,0BACA,CACA,EACA,KAAW,YACX,uEACA,EACA,OAAa,aACb,kBACA,8BACA,CACA,EACA,cAAoB,iBACpB,WACA,YACA,+DAEA,UAAuB,UACvB,QACA,SACA,WACA,oCACA,6BACA,EACA,aACA,WACA,cACA,gBACA,6BACA,YACA,yBACA,2BACA,QACA,uBAAkD,IAAc,IAChE,oBACA,YACA,CACA,oCACA,EACA,eAAqB,aAcrB,MAbA,IACA,WACA,gBACA,iBACA,eACA,cACA,aACA,GACA,WACA,YACA,WACA,UACA,EACA,CACA,EACA,eAAqB,iBACrB,MACA,IAAc,CACd,OACA,WACA,wCACA,aACA,WACA,cACA,gBACA,YACA,yBACA,2BACA,QACA,uBAAwD,IAAoB,IAC5E,oBACA,YACA,CACA,qBACA,0BACA,eACA,YACA,kCACA,EACA,WAAiB,YACjB,OAAW,aACX,EACA,YAAkB,aAClB,OAAW,oBACX,EACA,gBAAsB,GACtB,MAAY,aACZ,OACA,WACA,UAAgB,qBAA4B,CAC5C,OACA,CACA,EACA,MAAY,eACZ,OACA,WACA,OACA,yBACA,CACA,EACA,iBAAuB,aACvB,UACA,IACA,OACA,IACA,UACA,aACA,GACA,OACA,oBACA,UACA,2BACA,WACA,CAAI,SACJ,IACA,EAAI,OACJ,KACA,CACA,EACA,0BAAgC,YAChC,4BACA,EACA,KAAW,aACX,iBACA,EACA,gBAAsB,iBACtB,gCACA,EACA,aAAmB,eACnB,2BACA,EACA,YAAkB,aAClB,wBACA,EACA,eAAqB,cACrB,kBAAwB,eACxB,gCACA,EACA,WAAiB,eACjB,yBACA,EACA,OAAa,YACb,kBACA,EACA,qBAA2B,iBAC3B,qCACA,EACA,oBAA0B,eAC1B,kCACA,EACA,iBAAuB,eACvB,+BACA,EACA,SAAe,eACf,uBACA,EACA,eAAqB,eACrB,6BACA,EACA,YAAkB,iBAClB,4BACA,EACA,QAAc,aACd,oBACA,EACA,UAAgB,aAChB,sBACA,EACA,sBAA4B,UAC5B,EACA,EACA,GAEA,gCACA,EACA,EACA,EAEA,EACA,eAAqB,YACrB,0BACA,EACA,SAAe,4DC3hBb,kBAAqD,+BCArD,kBAAiE,+BCFnE,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,8CAA6D,CAC7D,cACA,eACA,QACA,CACA,CAAC,EAED,WADmC,KAAuB,EAC1D,UADkC,aAClC,gCCVA,qCAA6C,CAC7C,QACA,CAAC,EAMD,cACA,0CACA,cACA,SACK,CACL,EACA,GACA,wBACA,QACA,CAAK,CACL,mCACA,QACA,CAAK,CACL,0BACA,QACA,CACA,CAAC,EACD,yFACA,SACA,UACA,OACA,CACA,WAGA,CACA,MACA,OACA,CACA,OACA,OACA,CACA,YACA,OACA,CACA,eACA,QACA,CACA,CACA,mEACA,oBACA,EACA,MAEA,KACA,CACA,qBACA,EACA,UAEA,SACA,CACA,oBACA,EACA,aAEA,iBACA,cACA,CACA,gCCnEA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,4CAA2D,CAC3D,cACA,eACA,QACA,CACA,CAAC,EAAC,IAEF,KAD2B,EAA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EE,GAAU,mCACZ,yEC5CA,WAQA,WACA,GAEA,2BACE,QAAU,MACV,QAAe,KACjB,CAEA,aACA,EAAoC,GAAU,sBAI5C,GAAU,wCAER,QAAe,sBADnB,IAGA,GAEA,uBAIA,EAEE,GAAU,gDACZ,yGChCA,SACA,KAGA,gBACA,cACA,YACA,CAaA,gBACA,UACA,QACA,IACA,GACA,CAAM,SACA,GAAW,EAAI,IAAM,oCAAoC,EAAK,IACpE,CACA,CACA,CAGA,gBACA,cACA,KAIA,eACA,IACA,IACA,CAAM,SACA,GAAW,EACT,IAAM,OACd;AAAA,QAAoE,KAAK;AAAA,QAAU,QAAe,UAAU;AAAA,QAC5G,EAEA,CAEA,gLCrDA,gCASA,cACA,kBACA,qBACA,yBACA,4BACA,qCACA,QACA,SACA,iBACA,CACA,CAQA,gBACA,8BAAiD,EAAU,GAU3D,cACA,wBACA,CASA,cACA,sBACA,CASA,cACA,0BACA,CASA,cACA,oBACA,CASA,cACA,MACA,oBACA,UACA,kCACA,gCAEA,CASA,cACA,+DACA,CASA,cACA,oBACA,CASA,cACA,2CACA,CASA,cACA,+CACA,CASA,cACA,oBACA,CAMA,cAEA,8CACA,CASA,cACA,2EACA,CAUA,gBACA,IACA,qBACA,CAAI,SACJ,QACA,CACA,CAQA,cAEA,6DACA,sFE1LA,aAEA,oCAA4C,CDS5C,CAAK,OAAe,IACuD,qBAA3E,+BAAiD,SAAP,EAA0B,EAAO,GAA1B,EAA0B,WCL3E,QAAmB,CAAU,SAC7B,iCANqD,CACrD,uGCHA,OACA,QACA,OACA,OACA,QACA,MACA,SACA,QACA,CAGA,EAEA,GAUA,cACA,KAAQ,iBACR,WAGA,MAAkB,GAAU,SAC5B,KAEA,iBAGA,cACA,WACA,UACA,MACA,CAAG,EAEH,IACA,UACA,EAAI,OAEJ,cACA,UACK,CACL,CACA,CAqCA,MAAe,OAAkB,UAnCjC,WACA,SACA,GACA,YACA,IACA,CAAK,CACL,aACA,IACA,CAAK,CACL,eACA,EAkB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A,CAAM,SAEN,CACA,CAEA,mFCxJA,wBACA,0BACA,EAEA,iBAAsC,aAAkB,KAoDxD,gBACA,qBACA,SAGA,SAEA,YAAkB,WAAkB,KACpC,WACA,IAMU,QAAc,IACxB,yBAEA,iBAEA,CAAM,SACN,sCACA,CACA,CAEA,gBACA,CAuCA,WACA,EACA,KACA,MAEA,kBAlCA,SACA,EACA,EACA,YAEA,EAAO,QAAQ,MAIT,QAAQ,IACd,YAEM,QAAQ,KACd,yBAIA,EAiBA,OACA,8FCpIA,MAAe,UAAU,CAwDzB,aACA,kBACA,SAGA,IAIA,OAHA,YACA,sCACA,aACA,EACA,CAAI,SACJ,QACA,CACA,CAMA,cACA,mCAA0C,uBAAuB,qBACjE,CAQA,aACA,gCACA,SAGA,QACA,SAKA,cACA,SAKA,SACA,aAEA,yCACA,IACA,+BACA,aACA,sBACA,wCAEA,6BAEA,qBACA,CAAM,SACA,GAAW,EACT,IAAM,0FACd,CAGA,QACA,wECxHA,aAiBA,cACA,iBACA,IACA,CAAG,CACH,CAQA,cACA,qBACA,IACA,CAAG,CACH,EAjCY,YAES,YAArB,EAAqB,WAEC,aAAtB,EAAsB,YAEA,aAAtB,EAAsB,WACtB,CAAC,UAAwB,CAgCzB,SAEA,YACA,EACA,CAAK,8BAAwC,+BAAyC,+BAAyC,+BAC/H,sBACA,kBAEA,IACA,6BACA,CAAM,SACN,eACA,CACA,CAGA,KACA,EACA,EACA,CACA,qBACA,qBACA,GACA,IACA,KAKA,IACA,OACA,CAAc,SACd,IACA,MANA,IAQA,CAAS,CACT,IACA,KAGA,IACA,OACA,CAAc,SACd,IACA,MANA,IAQA,CAAS,CACT,EACA,uBACA,CAAK,CACL,CAGA,MACA,EACA,CACA,wBACA,CAGA,WACA,qBACA,MACA,EAEA,iBACA,IACA,KACA,IACA,GACA,GAEA,CAAS,CACT,IACA,KACA,IACA,GACA,GAEA,CAAS,EACT,UACA,MACA,KACA,MACA,CAEA,IACA,CAAO,CACP,CAAK,CACL,CA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S,EAAK,IACd,UACA,QACA,CAAK,EACL,GACA,CAAG,CACH,CAEA,YACA,EACA,EACA,EACA,EACA,UAIA,EAWA,OAbA,QAIA,OACA,MACA,SAGA,GACA,GAAe,SAAuB,EAGtC,kBACA,CAmBA,iBACA,cACA,YACA,CAGA,YACA,EACA,EACA,GAEA,WACA,GACA,IAGA,WAEA,MACA,OAGA,kBACA,SACA,aAEA,CACA,CAKA,eACA,oBACA,gEC7NA,WACA,MAAmB,OAAkB,GACrC,8BACA,gECDA,eACA,MACI,GAAM,cAAgB,GAAM,+BAAiC,GAAM,+CAQvE,GAGA,IACA,wDAEA,QAEA,gECpBA,SAEA,MAMe,WAAN,GAAM,2BAA2C,GAAM,6BAGhE,MAGY,WAAN,GAAM,kCAQZ,4CAGA,IAEA,EAEA,OACA,0CAKA,2CACA,EAEA,OACA,6CACA,8CACA,EAEA,OACM,GAAM,iBAKZ,MACA,KAEA,CACA,sBACA,QACA,CAAK,iEC7CL,UACA,UACA,sBAAsC,GAAM,WAAmB,WAAN,GAAM,4BAC/D,IAEA,EAEM,GAAM,YACZ,0CAGA,kCAEA,iDCxCA,MAAe,UAAU,6BCFzB,gBACA,8CACA,kEAGA,QACA,+ECNA,QAEA,cACA,4BACA,gCCJA,cACA,0BAA2C,UAC3C,uDCFA,cACA,0CAEA,kBACA,cAEA,qBACA,YACA,EAAK,GACL,CACA,gBACA,gCACA,6DAAuF,WAEvF,WAEA,+BAEA,OAAmB,gBACnB,yDAEA,eACA,6DACA,iDACA,gDACA,UAQA,OAJA,YAEA,cAEA,CACA","sources":["webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/display.js?146a","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/catchUserErrors.js?4b18","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/monitor.js?5f0b","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/polyfills.js?6afc","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/boot/init.js?9723","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/getGlobalObject.js?17b8","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/byteUtils.js?bbfe","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/getZoneJsOriginalValue.js?9d2c","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/timer.js?5e1f","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/functionUtils.js?a665","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/serialisation/jsonStringify.js?93db","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/objectUtils.js?c809","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/context/customerDataTracker.js?7aa4","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/typeUtils.js?6729","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/mergeInto.js?898b","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/serialisation/sanitize.js?1d90","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/observable.js?fe9e","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/context/contextManager.js?a5db","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/trackingConsent.js?333f","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/browser/addEventListener.js?fc16","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/context/storeContextManager.js?fb72","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/user/user.js?0b8a","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/boot/displayAlreadyInitializedError.js?e930","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/error/computeStackTrace.js?efed","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/error/error.js?dd39","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/error/error.types.js?5af1","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/timeUtils.js?f5f5","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/logger.js?89d6","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/contexts/commonContext.js?2cac","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/arrayUtils.js?4c98","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/boundedBuffer.js?15f8","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/transport/eventBridge.js?7705","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/experimentalFeatures.js?21c6","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/numberUtils.js?6ba2","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/stringUtils.js?26f2","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/session/sessionConstants.js?ef95","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/browserDetection.js?e3eb","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/browser/cookie.js?24c0","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/session/storeStrategies/sessionStoreStrategy.js?94ae","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/session/sessionState.js?e9c0","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/session/oldCookiesMigration.js?a3cf","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/session/storeStrategies/sessionInCookie.js?5d6d","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/session/storeStrategies/sessionInLocalStorage.js?33b2","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/session/sessionStoreOperations.js?251c","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/session/sessionStore.js?4e29","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/urlPolyfill.js?637c","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/configuration/intakeSites.js?9da3","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/configuration/endpointBuilder.js?ffc6","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/configuration/tags.js?2fc0","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/configuration/transportConfiguration.js?7a5d","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/configuration/configuration.js?c44a","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/report/reportObservable.js?6428","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/configuration.js?fbc4","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/boot/preStartLogs.js?1bd8","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/boot/logsPublicApi.js?b68a","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/sendToExtension.js?f161","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/browser/pageExitObservable.js?8a0c","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/synthetics/syntheticsWorkerValues.js?4b49","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/valueHistory.js?6ee7","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/session/sessionManager.js?d618","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/logsSessionManager.js?0f44","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/eventRateLimiter/createEventRateLimiter.js?899d","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/connectivity/connectivity.js?28a8","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/telemetry/rawTelemetryEvent.types.js?b70b","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/telemetry/telemetry.js?caad","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/contexts/rumInternalContext.js?a863","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/assembly.js?629f","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/console/consoleObservable.js?b30a","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/console/consoleCollection.js?720b","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/report/reportCollection.js?3537","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/instrumentMethod.js?184c","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/browser/xhrObservable.js?f2dd","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/browser/fetchObservable.js?1185","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/utils/responseUtils.js?843b","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/readBytesFromStream.js?a4ac","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/networkError/networkErrorCollection.js?8c5d","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/domain/error/trackRuntimeError.js?4847","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/runtimeError/runtimeErrorCollection.js?d900","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/abstractLifeCycle.js?af6e","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/lifeCycle.js?e43b","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/logger/loggerCollection.js?8b5d","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/transport/batch.js?4484","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/transport/sendWithRetryStrategy.js?0654","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/transport/httpRequest.js?8b1b","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/transport/flushController.js?d1db","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/transport/startBatchWithReplica.js?3c88","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-core@5.13.0/node_modules/@datadog/browser-core/esm/tools/encoder.js?13e7","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/transport/startLogsBatch.js?c53f","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/transport/startLogsBridge.js?9a62","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/contexts/internalContext.js?d247","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/reportError.js?ae5a","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/domain/logsTelemetry.js?1fc8","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/boot/startLogs.js?3a8c","webpack://_N_E/./node_modules/.pnpm/@datadog+browser-logs@5.13.0/node_modules/@datadog/browser-logs/esm/entries/main.js?1549","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/build/deployment-id.js?b9a8","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/build/polyfills/polyfill-module.js?d8f4","webpack://_N_E/../../src/client/add-base-path.ts","webpack://_N_E/../../src/client/add-locale.ts","webpack://_N_E/../../src/client/app-bootstrap.ts","webpack://_N_E/../../src/client/app-build-id.ts","webpack://_N_E/../../src/client/app-call-server.ts","webpack://_N_E/../../src/client/app-find-source-map-url.ts","webpack://_N_E/../../src/client/app-index.tsx","webpack://_N_E/../../src/client/app-next.ts","webpack://_N_E/../../src/client/app-webpack.ts","webpack://_N_E/../../src/client/assign-location.ts","webpack://_N_E/../../client/components/app-router-announcer.tsx","webpack://_N_E/../../client/components/app-router-headers.ts","webpack://_N_E/../../client/components/app-router.tsx","webpack://_N_E/../../client/components/bailout-to-client-rendering.ts","webpack://_N_E/../../client/components/client-page.tsx","webpack://_N_E/../../client/components/client-segment.tsx","webpack://_N_E/../../client/components/error-boundary.tsx","webpack://_N_E/../../client/components/forbidden.ts","webpack://_N_E/../../../../src/client/components/globals/handle-global-errors.ts","webpack://_N_E/../../../../src/client/components/globals/intercept-console-error.ts","webpack://_N_E/../../../../src/client/components/globals/patch-console.ts","webpack://_N_E/../../client/components/hooks-server-context.ts","webpack://_N_E/../../../../src/client/components/http-access-fallback/error-boundary.tsx","webpack://_N_E/../../../../src/client/components/http-access-fallback/http-access-fallback.ts","webpack://_N_E/../../client/components/is-hydration-error.ts","webpack://_N_E/../../client/components/is-next-router-error.ts","webpack://_N_E/../../client/components/layout-router.tsx","webpack://_N_E/../../client/components/match-segments.ts","webpack://_N_E/../../client/components/nav-failure-handler.ts","webpack://_N_E/../../client/components/navigation-untracked.ts","webpack://_N_E/../../client/components/navigation.ts","webpack://_N_E/../../client/components/navigation.react-server.ts","webpack://_N_E/../../client/components/not-found.ts","webpack://_N_E/../../client/components/promise-queue.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/attach-hydration-error-state.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/console-error.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/enqueue-client-error.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/hydration-error-info.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/stitched-error.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/use-error-handler.ts","webpack://_N_E/../../client/components/redirect-boundary.tsx","webpack://_N_E/../../client/components/redirect-error.ts","webpack://_N_E/../../client/components/redirect-status-code.ts","webpack://_N_E/../../client/components/redirect.ts","webpack://_N_E/../../client/components/render-from-template-context.tsx","webpack://_N_E/../../../../src/client/components/router-reducer/aliased-prefetch-navigations.ts","webpack://_N_E/../../../../src/client/components/router-reducer/apply-flight-data.ts","webpack://_N_E/../../../../src/client/components/router-reducer/apply-router-state-patch-to-tree.ts","webpack://_N_E/../../../../src/client/components/router-reducer/clear-cache-node-data-for-segment-path.ts","webpack://_N_E/../../../../src/client/components/router-reducer/compute-changed-path.ts","webpack://_N_E/../../../../src/client/components/router-reducer/create-href-from-url.ts","webpack://_N_E/../../../../src/client/components/router-reducer/create-initial-router-state.ts","webpack://_N_E/../../../../src/client/components/router-reducer/create-router-cache-key.ts","webpack://_N_E/../../../../src/client/components/router-reducer/fetch-server-response.ts","webpack://_N_E/../../../../src/client/components/router-reducer/fill-cache-with-new-subtree-data.ts","webpack://_N_E/../../../../src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts","webpack://_N_E/../../../../src/client/components/router-reducer/handle-mutable.ts","webpack://_N_E/../../../../src/client/components/router-reducer/handle-segment-mismatch.ts","webpack://_N_E/../../../../src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts","webpack://_N_E/../../../../src/client/components/router-reducer/invalidate-cache-by-router-state.ts","webpack://_N_E/../../../../src/client/components/router-reducer/is-navigating-to-new-root-layout.ts","webpack://_N_E/../../../../src/client/components/router-reducer/ppr-navigations.ts","webpack://_N_E/../../../../src/client/components/router-reducer/prefetch-cache-utils.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/find-head-in-cache.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/get-segment-value.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/has-interception-route-in-current-tree.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/hmr-refresh-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/navigate-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/prefetch-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/refresh-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/restore-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/server-action-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/server-patch-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/server-reference-info.ts","webpack://_N_E/../../../../src/client/components/router-reducer/refetch-inactive-parallel-segments.ts","webpack://_N_E/../../../../src/client/components/router-reducer/router-reducer-types.ts","webpack://_N_E/../../../../src/client/components/router-reducer/router-reducer.ts","webpack://_N_E/../../../../src/client/components/router-reducer/should-hard-navigate.ts","webpack://_N_E/../../../../src/client/components/segment-cache/cache-key.ts","webpack://_N_E/../../../../src/client/components/segment-cache/cache.ts","webpack://_N_E/../../../../src/client/components/segment-cache/lru.ts","webpack://_N_E/../../../../src/client/components/segment-cache/navigation.ts","webpack://_N_E/../../../../src/client/components/segment-cache/prefetch.ts","webpack://_N_E/../../../../src/client/components/segment-cache/scheduler.ts","webpack://_N_E/../../../../src/client/components/segment-cache/tuple-map.ts","webpack://_N_E/../../client/components/static-generation-bailout.ts","webpack://_N_E/../../client/components/unauthorized.ts","webpack://_N_E/../../client/components/unresolved-thenable.ts","webpack://_N_E/../../client/components/unstable-rethrow.ts","webpack://_N_E/../../client/components/use-reducer.ts","webpack://_N_E/../../src/client/detect-domain-locale.ts","webpack://_N_E/../../src/client/flight-data-helpers.ts","webpack://_N_E/../../src/client/has-base-path.ts","webpack://_N_E/../../client/lib/console.ts","webpack://_N_E/../../src/client/normalize-trailing-slash.ts","webpack://_N_E/../../client/react-client-callbacks/app-router.ts","webpack://_N_E/../../client/react-client-callbacks/report-global-error.ts","webpack://_N_E/../../client/react-client-callbacks/shared.ts","webpack://_N_E/../../src/client/remove-base-path.ts","webpack://_N_E/../../src/client/remove-locale.ts","webpack://_N_E/../../src/client/request-idle-callback.ts","webpack://_N_E/../../src/client/resolve-href.ts","webpack://_N_E/../../src/client/route-loader.ts","webpack://_N_E/../../src/client/router.ts","webpack://_N_E/../../src/client/script.tsx","webpack://_N_E/../../src/client/set-attributes-from-props.ts","webpack://_N_E/../../src/client/trusted-types.ts","webpack://_N_E/../../src/client/with-router.tsx","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/cookie/index.js?a5d3","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/path-to-regexp/index.js?6f8a","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/scheduler/cjs/scheduler.production.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/scheduler/index.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/export/helpers/is-dynamic-usage-error.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/lib/constants.js?93f6","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/lib/is-api-route.js?4618","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/lib/is-error.js?51d4","webpack://_N_E/../../lib/metadata/metadata-boundary.tsx","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/lib/metadata/metadata-constants.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/lib/scheduler.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/api-utils/get-cookie-parser.js?6576","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/action-async-storage.external.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/after-task-async-storage.external.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/async-local-storage.js?f01d","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/dynamic-rendering.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/get-segment-param.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/work-async-storage.external.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/dynamic-rendering-utils.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/lib/interception-routes.js?f592","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/lib/router-utils/is-postpone.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/request/params.browser.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/request/params.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/request/search-params.browser.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/request/search-params.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/request/utils.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js","webpack://_N_E/../../shared/lib/app-router-context.shared-runtime.ts","webpack://_N_E/../../shared/lib/bloom-filter.ts","webpack://_N_E/../../shared/lib/encode-uri-path.ts","webpack://_N_E/../../shared/lib/escape-regexp.ts","webpack://_N_E/../../shared/lib/hash.ts","webpack://_N_E/../../shared/lib/head-manager-context.shared-runtime.ts","webpack://_N_E/../../shared/lib/hooks-client-context.shared-runtime.ts","webpack://_N_E/../../../../src/shared/lib/i18n/normalize-locale-path.ts","webpack://_N_E/../../shared/lib/invariant-error.ts","webpack://_N_E/../../shared/lib/is-plain-object.ts","webpack://_N_E/../../shared/lib/is-thenable.ts","webpack://_N_E/../../../../src/shared/lib/lazy-dynamic/bailout-to-csr.ts","webpack://_N_E/../../shared/lib/mitt.ts","webpack://_N_E/../../../../src/shared/lib/page-path/denormalize-page-path.ts","webpack://_N_E/../../../../src/shared/lib/page-path/ensure-leading-slash.ts","webpack://_N_E/../../../../src/shared/lib/page-path/normalize-path-sep.ts","webpack://_N_E/../../shared/lib/router-context.shared-runtime.ts","webpack://_N_E/../../../../src/shared/lib/router/action-queue.ts","webpack://_N_E/../../../../src/shared/lib/router/router.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/add-locale.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/add-path-prefix.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/add-path-suffix.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/app-paths.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/compare-states.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/format-next-pathname-info.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/format-url.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/get-asset-path-from-route.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/get-next-pathname-info.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/handle-smooth-scroll.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/index.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/interpolate-as.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/is-bot.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/is-dynamic.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/is-local-url.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/omit.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/parse-path.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/parse-relative-url.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/parse-url.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/path-has-prefix.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/path-match.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/prepare-destination.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/querystring.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/remove-path-prefix.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/remove-trailing-slash.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/resolve-rewrites.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/route-matcher.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/route-regex.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/sorted-routes.ts","webpack://_N_E/../../shared/lib/segment.ts","webpack://_N_E/../../shared/lib/server-inserted-html.shared-runtime.tsx","webpack://_N_E/../../shared/lib/utils.ts","webpack://_N_E/../../../../src/shared/lib/utils/warn-once.ts","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/react-dom/client.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/react-dom/index.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/react-server-dom-webpack/client.browser.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/react-server-dom-webpack/client.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/react/cjs/react-jsx-runtime.production.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/react/cjs/react.production.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/react/index.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/compiled/react/jsx-runtime.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/action-async-storage-instance.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/async-local-storage.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/work-async-storage-instance.js","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","webpack://_N_E/./node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js?5d15","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/debug-build.js?7aed","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/helpers.js?3c57","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/integrations/inboundfilters.js?d576","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/integrations/functiontostring.js?e606","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/integrations/dedupe.js?58f5","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/sdk.js?0f35","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/api.js?ddcc","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/clientreport.js?8528","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/error.js?0a73","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/baseclient.js?e804","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/eventbuilder.js?60e8","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/userfeedback.js?9f78","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/client.js?58e8","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/instrument/console.js?7ad7","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/breadcrumb-log-level.js?87e9","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/integrations/breadcrumbs.js?5d9e","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/integrations/browserapierrors.js?ba55","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/integrations/browsersession.js?26a9","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/integrations/globalhandlers.js?3bfb","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/integrations/httpcontext.js?49f5","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/aggregate-errors.js?db64","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/integrations/linkederrors.js?a080","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/stack-parsers.js?89c0","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/promisebuffer.js?13ff","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/transports/base.js?a598","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/transports/fetch.js?6431","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/sdk.js?b5c3","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/defaultScopes.js?e7e5","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js?d28c","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/asyncContext/index.js?dfbc","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/breadcrumbs.js?471b","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/carrier.js?1e52","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/constants.js?d6d6","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/currentScopes.js?25f3","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/debug-build.js?adc2","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/envelope.js?427b","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/exports.js?eb2d","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/integration.js?d11b","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/metrics/metric-summary.js?636a","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/scope.js?9e68","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/semanticAttributes.js?5b6a","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/session.js?3d83","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js?9247","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/spanstatus.js?ca3e","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/baggage.js?57d1","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/browser.js?efae","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/buildPolyfills/_nullishCoalesce.js?18dc","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/buildPolyfills/_optionalChain.js?61be","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js?9985","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/dsn.js?c56d","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/env.js?213c","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/envelope.js?a262","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/instrument/fetch.js?bdb4","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalError.js?8edb","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalUnhandledRejection.js?b00e","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js?c14d","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/is.js?8de0","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/node.js?1e7e","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/isBrowser.js?e00a","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/logger.js?0179","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/misc.js?9d15","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/memo.js?1ad7","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/normalize.js?f02f","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/object.js?7b0f","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/propagationContext.js?5fb9","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/ratelimit.js?5cf8","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/severity.js?33e2","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js?d7d9","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/string.js?c768","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/supports.js?84b7","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/syncpromise.js?c972","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/time.js?127a","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/tracing.js?6b88","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/url.js?9a30","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/version.js?a894","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js?f1d8","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js?fff9","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils/isSentryRequestUrl.js?a12d","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils/merge.js?63ea","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils/parseSampleRate.js?4230","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/eventProcessors.js?5cdb","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/debug-ids.js?6f08","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils/applyScopeDataToEvent.js?1254","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils/prepareEvent.js?b54d","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils/sdkMetadata.js?1bf5","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils/spanOnScope.js?b39f","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils/spanUtils.js?e828","webpack://_N_E/./node_modules/.pnpm/@sentry+react@8.50.0_react@19.0.0/node_modules/@sentry/react/build/esm/sdk.js?48e0","webpack://_N_E/./node_modules/.pnpm/@sentry+nextjs@8.50.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemet_ed54b7cb89f111f96051ccec484b8026/node_modules/@sentry/nextjs/build/esm/common/getVercelEnv.js?4353","webpack://_N_E/./node_modules/.pnpm/@sentry+nextjs@8.50.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemet_ed54b7cb89f111f96051ccec484b8026/node_modules/@sentry/nextjs/build/esm/common/nextNavigationErrorUtils.js?fa1c","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/measurement.js?d78f","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/logSpans.js?5917","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/sampling.js?6a13","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/sentryNonRecordingSpan.js?853d","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/utils.js?7577","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/sentrySpan.js?1bd5","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/trace.js?c510","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/utils.js?4e32","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/cls.js?5bd6","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/browserMetrics.js?3b12","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/inp.js?f759","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/idleSpan.js?088d","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/tracing/errors.js?9d90","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/tracing/backgroundtab.js?d5fa","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils/traceData.js?2b6e","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/fetch.js?bbca","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/tracing/request.js?16fe","webpack://_N_E/./node_modules/.pnpm/@sentry+browser@8.50.0/node_modules/@sentry/browser/build/npm/esm/tracing/browserTracingIntegration.js?9ed2","webpack://_N_E/./node_modules/.pnpm/@sentry+nextjs@8.50.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemet_ed54b7cb89f111f96051ccec484b8026/node_modules/@sentry/nextjs/build/esm/client/routing/appRouterRoutingInstrumentation.js?4adc","webpack://_N_E/./node_modules/.pnpm/next@15.1.4_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/api/router.js","webpack://_N_E/./node_modules/.pnpm/@sentry+nextjs@8.50.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemet_ed54b7cb89f111f96051ccec484b8026/node_modules/@sentry/nextjs/build/esm/common/debug-build.js?4cae","webpack://_N_E/./node_modules/.pnpm/@sentry+nextjs@8.50.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemet_ed54b7cb89f111f96051ccec484b8026/node_modules/@sentry/nextjs/build/esm/client/routing/pagesRouterRoutingInstrumentation.js?7720","webpack://_N_E/./node_modules/.pnpm/@sentry+nextjs@8.50.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemet_ed54b7cb89f111f96051ccec484b8026/node_modules/@sentry/nextjs/build/esm/client/routing/nextRoutingInstrumentation.js?def2","webpack://_N_E/./node_modules/.pnpm/@sentry+nextjs@8.50.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemet_ed54b7cb89f111f96051ccec484b8026/node_modules/@sentry/nextjs/build/esm/client/browserTracingIntegration.js?3b0c","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/path.js?a60b","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/integrations/rewriteframes.js?fb48","webpack://_N_E/./node_modules/.pnpm/@sentry+nextjs@8.50.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemet_ed54b7cb89f111f96051ccec484b8026/node_modules/@sentry/nextjs/build/esm/client/clientNormalizationIntegration.js?a38b","webpack://_N_E/./node_modules/.pnpm/@sentry+nextjs@8.50.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemet_ed54b7cb89f111f96051ccec484b8026/node_modules/@sentry/nextjs/build/esm/client/tunnelRoute.js?b24a","webpack://_N_E/./node_modules/.pnpm/@sentry+nextjs@8.50.0_@opentelemetry+core@1.30.1_@opentelemetry+api@1.9.0__@opentelemet_ed54b7cb89f111f96051ccec484b8026/node_modules/@sentry/nextjs/build/esm/client/index.js?c31b","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/debug-build.js?d78e","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/getNativeImplementation.js?3b6c","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/instrument/dom.js?a783","webpack://_N_E/./node_modules/.pnpm/@sentry+core@8.50.0/node_modules/@sentry/core/build/esm/utils-hoist/vendor/supportsHistory.js?8175","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js?8857","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js?5c2f","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/bindReporter.js?e6b2","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/generateUniqueID.js?f17f","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/initMetric.js?cd76","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js?6fc7","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/runOnce.js?6e10","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/whenActivated.js?0fba","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/onFCP.js?52df","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getCLS.js?90da","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getFID.js?20be","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.js?e628","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/interactions.js?ea25","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/whenIdle.js?b40b","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getINP.js?cfe6","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getLCP.js?adbe","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/onTTFB.js?a51b","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/instrument.js?181e","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getActivationStart.js?1fc4","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getNavigationEntry.js?25b8","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getVisibilityWatcher.js?2bae","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/onHidden.js?5940","webpack://_N_E/./node_modules/.pnpm/@sentry-internal+browser-utils@8.50.0/node_modules/@sentry-internal/browser-utils/build/esm/types.js?75cc","webpack://_N_E/./node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_private_field_loose_base.js","webpack://_N_E/./node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_private_field_loose_key.js","webpack://_N_E/./node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_interop_require_default.js?46fc","webpack://_N_E/./node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_interop_require_wildcard.js?36d0"],"sourcesContent":["/* eslint-disable local-rules/disallow-side-effects */\n/**\n * Keep references on console methods to avoid triggering patched behaviors\n *\n * NB: in some setup, console could already be patched by another SDK.\n * In this case, some display messages can be sent by the other SDK\n * but we should be safe from infinite loop nonetheless.\n */\nexport var ConsoleApiName = {\n log: 'log',\n debug: 'debug',\n info: 'info',\n warn: 'warn',\n error: 'error',\n};\n/**\n * When building JS bundles, some users might use a plugin[1] or configuration[2] to remove\n * \"console.*\" references. This causes some issue as we expect `console.*` to be defined.\n * As a workaround, let's use a variable alias, so those expressions won't be taken into account by\n * simple static analysis.\n *\n * [1]: https://babeljs.io/docs/babel-plugin-transform-remove-console/\n * [2]: https://github.com/terser/terser#compress-options (look for drop_console)\n */\nexport var globalConsole = console;\nexport var originalConsoleMethods = {};\nObject.keys(ConsoleApiName).forEach(function (name) {\n originalConsoleMethods[name] = globalConsole[name];\n});\nvar PREFIX = 'Datadog Browser SDK:';\nexport var display = {\n debug: originalConsoleMethods.debug.bind(globalConsole, PREFIX),\n log: originalConsoleMethods.log.bind(globalConsole, PREFIX),\n info: originalConsoleMethods.info.bind(globalConsole, PREFIX),\n warn: originalConsoleMethods.warn.bind(globalConsole, PREFIX),\n error: originalConsoleMethods.error.bind(globalConsole, PREFIX),\n};\n//# sourceMappingURL=display.js.map","import { display } from './display';\nexport function catchUserErrors(fn, errorMsg) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n try {\n return fn.apply(void 0, args);\n }\n catch (err) {\n display.error(errorMsg, err);\n }\n };\n}\n//# sourceMappingURL=catchUserErrors.js.map","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { display } from './display';\nvar onMonitorErrorCollected;\nvar debugMode = false;\nexport function startMonitorErrorCollection(newOnMonitorErrorCollected) {\n onMonitorErrorCollected = newOnMonitorErrorCollected;\n}\nexport function setDebugMode(newDebugMode) {\n debugMode = newDebugMode;\n}\nexport function resetMonitor() {\n onMonitorErrorCollected = undefined;\n debugMode = false;\n}\nexport function monitored(_, __, descriptor) {\n var originalMethod = descriptor.value;\n descriptor.value = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var decorated = onMonitorErrorCollected ? monitor(originalMethod) : originalMethod;\n return decorated.apply(this, args);\n };\n}\nexport function monitor(fn) {\n return function () {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return callMonitored(fn, this, arguments);\n }; // consider output type has input type\n}\nexport function callMonitored(fn, context, args) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return fn.apply(context, args);\n }\n catch (e) {\n displayIfDebugEnabled(e);\n if (onMonitorErrorCollected) {\n try {\n onMonitorErrorCollected(e);\n }\n catch (e) {\n displayIfDebugEnabled(e);\n }\n }\n }\n}\nexport function displayIfDebugEnabled() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (debugMode) {\n display.error.apply(display, __spreadArray(['[MONITOR]'], args, false));\n }\n}\n//# sourceMappingURL=monitor.js.map","export function includes(candidate, search) {\n return candidate.indexOf(search) !== -1;\n}\nexport function arrayFrom(arrayLike) {\n if (Array.from) {\n return Array.from(arrayLike);\n }\n var array = [];\n if (arrayLike instanceof Set) {\n arrayLike.forEach(function (item) { return array.push(item); });\n }\n else {\n for (var i = 0; i < arrayLike.length; i++) {\n array.push(arrayLike[i]);\n }\n }\n return array;\n}\nexport function find(array, predicate) {\n for (var i = 0; i < array.length; i += 1) {\n var item = array[i];\n if (predicate(item, i)) {\n return item;\n }\n }\n return undefined;\n}\nexport function findLast(array, predicate) {\n for (var i = array.length - 1; i >= 0; i -= 1) {\n var item = array[i];\n if (predicate(item, i, array)) {\n return item;\n }\n }\n return undefined;\n}\nexport function forEach(list, callback) {\n Array.prototype.forEach.call(list, callback);\n}\nexport function objectValues(object) {\n return Object.keys(object).map(function (key) { return object[key]; });\n}\nexport function objectEntries(object) {\n return Object.keys(object).map(function (key) { return [key, object[key]]; });\n}\nexport function startsWith(candidate, search) {\n return candidate.slice(0, search.length) === search;\n}\nexport function endsWith(candidate, search) {\n return candidate.slice(-search.length) === search;\n}\nexport function elementMatches(element, selector) {\n if (element.matches) {\n return element.matches(selector);\n }\n // IE11 support\n if (element.msMatchesSelector) {\n return element.msMatchesSelector(selector);\n }\n return false;\n}\n// https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/selector/escapeSelector.js\nexport function cssEscape(str) {\n if (window.CSS && window.CSS.escape) {\n return window.CSS.escape(str);\n }\n // eslint-disable-next-line no-control-regex\n return str.replace(/([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\x80-\\uFFFF\\w-]/g, function (ch, asCodePoint) {\n if (asCodePoint) {\n // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n if (ch === '\\0') {\n return '\\uFFFD';\n }\n // Control characters and (dependent upon position) numbers get escaped as code points\n return \"\".concat(ch.slice(0, -1), \"\\\\\").concat(ch.charCodeAt(ch.length - 1).toString(16), \" \");\n }\n // Other potentially-special ASCII characters get backslash-escaped\n return \"\\\\\".concat(ch);\n });\n}\nexport function assign(target) {\n var toAssign = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n toAssign[_i - 1] = arguments[_i];\n }\n toAssign.forEach(function (source) {\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n });\n return target;\n}\n//# sourceMappingURL=polyfills.js.map","import { catchUserErrors } from '../tools/catchUserErrors';\nimport { setDebugMode } from '../tools/monitor';\nimport { assign } from '../tools/utils/polyfills';\nexport function makePublicApi(stub) {\n var publicApi = assign({\n version: \"5.13.0\",\n // This API method is intentionally not monitored, since the only thing executed is the\n // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and\n // we don't want to interfere with the user uncaught exceptions.\n onReady: function (callback) {\n callback();\n },\n }, stub);\n // Add a \"hidden\" property to set debug mode. We define it that way to hide it\n // as much as possible but of course it's not a real protection.\n Object.defineProperty(publicApi, '_setDebug', {\n get: function () {\n return setDebugMode;\n },\n enumerable: false,\n });\n return publicApi;\n}\nexport function defineGlobal(global, name, api) {\n var existingGlobalVariable = global[name];\n global[name] = api;\n if (existingGlobalVariable && existingGlobalVariable.q) {\n existingGlobalVariable.q.forEach(function (fn) { return catchUserErrors(fn, 'onReady callback threw an error:')(); });\n }\n}\n//# sourceMappingURL=init.js.map","/**\n * inspired by https://mathiasbynens.be/notes/globalthis\n */\nexport function getGlobalObject() {\n if (typeof globalThis === 'object') {\n return globalThis;\n }\n Object.defineProperty(Object.prototype, '_dd_temp_', {\n get: function () {\n return this;\n },\n configurable: true,\n });\n // @ts-ignore _dd_temp is defined using defineProperty\n var globalObject = _dd_temp_;\n // @ts-ignore _dd_temp is defined using defineProperty\n delete Object.prototype._dd_temp_;\n if (typeof globalObject !== 'object') {\n // on safari _dd_temp_ is available on window but not globally\n // fallback on other browser globals check\n if (typeof self === 'object') {\n globalObject = self;\n }\n else if (typeof window === 'object') {\n globalObject = window;\n }\n else {\n globalObject = {};\n }\n }\n return globalObject;\n}\n//# sourceMappingURL=getGlobalObject.js.map","export var ONE_KIBI_BYTE = 1024;\nexport var ONE_MEBI_BYTE = 1024 * ONE_KIBI_BYTE;\n// eslint-disable-next-line no-control-regex\nvar HAS_MULTI_BYTES_CHARACTERS = /[^\\u0000-\\u007F]/;\nexport function computeBytesCount(candidate) {\n // Accurate bytes count computations can degrade performances when there is a lot of events to process\n if (!HAS_MULTI_BYTES_CHARACTERS.test(candidate)) {\n return candidate.length;\n }\n if (window.TextEncoder !== undefined) {\n return new TextEncoder().encode(candidate).length;\n }\n return new Blob([candidate]).size;\n}\nexport function concatBuffers(buffers) {\n var length = buffers.reduce(function (total, buffer) { return total + buffer.length; }, 0);\n var result = new Uint8Array(length);\n var offset = 0;\n for (var _i = 0, buffers_1 = buffers; _i < buffers_1.length; _i++) {\n var buffer = buffers_1[_i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n return result;\n}\n//# sourceMappingURL=byteUtils.js.map","import { getGlobalObject } from './getGlobalObject';\n/**\n * Gets the original value for a DOM API that was potentially patched by Zone.js.\n *\n * Zone.js[1] is a library that patches a bunch of JS and DOM APIs. It usually stores the original\n * value of the patched functions/constructors/methods in a hidden property prefixed by\n * __zone_symbol__.\n *\n * In multiple occasions, we observed that Zone.js is the culprit of important issues leading to\n * browser resource exhaustion (memory leak, high CPU usage). This method is used as a workaround to\n * use the original DOM API instead of the one patched by Zone.js.\n *\n * [1]: https://github.com/angular/angular/tree/main/packages/zone.js\n */\nexport function getZoneJsOriginalValue(target, name) {\n var browserWindow = getGlobalObject();\n var original;\n if (browserWindow.Zone && typeof browserWindow.Zone.__symbol__ === 'function') {\n original = target[browserWindow.Zone.__symbol__(name)];\n }\n if (!original) {\n original = target[name];\n }\n return original;\n}\n//# sourceMappingURL=getZoneJsOriginalValue.js.map","import { getZoneJsOriginalValue } from './getZoneJsOriginalValue';\nimport { monitor } from './monitor';\nimport { getGlobalObject } from './getGlobalObject';\nexport function setTimeout(callback, delay) {\n return getZoneJsOriginalValue(getGlobalObject(), 'setTimeout')(monitor(callback), delay);\n}\nexport function clearTimeout(timeoutId) {\n getZoneJsOriginalValue(getGlobalObject(), 'clearTimeout')(timeoutId);\n}\nexport function setInterval(callback, delay) {\n return getZoneJsOriginalValue(getGlobalObject(), 'setInterval')(monitor(callback), delay);\n}\nexport function clearInterval(timeoutId) {\n getZoneJsOriginalValue(getGlobalObject(), 'clearInterval')(timeoutId);\n}\n//# sourceMappingURL=timer.js.map","import { setTimeout, clearTimeout } from '../timer';\n// use lodash API\nexport function throttle(fn, wait, options) {\n var needLeadingExecution = options && options.leading !== undefined ? options.leading : true;\n var needTrailingExecution = options && options.trailing !== undefined ? options.trailing : true;\n var inWaitPeriod = false;\n var pendingExecutionWithParameters;\n var pendingTimeoutId;\n return {\n throttled: function () {\n var parameters = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n parameters[_i] = arguments[_i];\n }\n if (inWaitPeriod) {\n pendingExecutionWithParameters = parameters;\n return;\n }\n if (needLeadingExecution) {\n fn.apply(void 0, parameters);\n }\n else {\n pendingExecutionWithParameters = parameters;\n }\n inWaitPeriod = true;\n pendingTimeoutId = setTimeout(function () {\n if (needTrailingExecution && pendingExecutionWithParameters) {\n fn.apply(void 0, pendingExecutionWithParameters);\n }\n inWaitPeriod = false;\n pendingExecutionWithParameters = undefined;\n }, wait);\n },\n cancel: function () {\n clearTimeout(pendingTimeoutId);\n inWaitPeriod = false;\n pendingExecutionWithParameters = undefined;\n },\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nexport function noop() { }\n//# sourceMappingURL=functionUtils.js.map","import { noop } from '../utils/functionUtils';\n/**\n * Custom implementation of JSON.stringify that ignores some toJSON methods. We need to do that\n * because some sites badly override toJSON on certain objects. Removing all toJSON methods from\n * nested values would be too costly, so we just detach them from the root value, and native classes\n * used to build JSON values (Array and Object).\n *\n * Note: this still assumes that JSON.stringify is correct.\n */\nexport function jsonStringify(value, replacer, space) {\n if (typeof value !== 'object' || value === null) {\n return JSON.stringify(value);\n }\n // Note: The order matter here. We need to detach toJSON methods on parent classes before their\n // subclasses.\n var restoreObjectPrototypeToJson = detachToJsonMethod(Object.prototype);\n var restoreArrayPrototypeToJson = detachToJsonMethod(Array.prototype);\n var restoreValuePrototypeToJson = detachToJsonMethod(Object.getPrototypeOf(value));\n var restoreValueToJson = detachToJsonMethod(value);\n try {\n return JSON.stringify(value, replacer, space);\n }\n catch (_a) {\n return '';\n }\n finally {\n restoreObjectPrototypeToJson();\n restoreArrayPrototypeToJson();\n restoreValuePrototypeToJson();\n restoreValueToJson();\n }\n}\nexport function detachToJsonMethod(value) {\n var object = value;\n var objectToJson = object.toJSON;\n if (objectToJson) {\n delete object.toJSON;\n return function () {\n object.toJSON = objectToJson;\n };\n }\n return noop;\n}\n//# sourceMappingURL=jsonStringify.js.map","import { assign } from './polyfills';\nexport function shallowClone(object) {\n return assign({}, object);\n}\nexport function objectHasValue(object, value) {\n return Object.keys(object).some(function (key) { return object[key] === value; });\n}\nexport function isEmptyObject(object) {\n return Object.keys(object).length === 0;\n}\nexport function mapValues(object, fn) {\n var newObject = {};\n for (var _i = 0, _a = Object.keys(object); _i < _a.length; _i++) {\n var key = _a[_i];\n newObject[key] = fn(object[key]);\n }\n return newObject;\n}\n//# sourceMappingURL=objectUtils.js.map","import { ONE_KIBI_BYTE, computeBytesCount } from '../../tools/utils/byteUtils';\nimport { throttle } from '../../tools/utils/functionUtils';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nimport { display } from '../../tools/display';\nimport { isEmptyObject } from '../../tools/utils/objectUtils';\n// RUM and logs batch bytes limit is 16KB\n// ensure that we leave room for other event attributes and maintain a decent amount of event per batch\n// (3KB (customer data) + 1KB (other attributes)) * 4 (events per batch) = 16KB\nexport var CUSTOMER_DATA_BYTES_LIMIT = 3 * ONE_KIBI_BYTE;\n// We observed that the compression ratio is around 8 in general, but we also want to keep a margin\n// because some data might not be compressed (ex: last view update on page exit). We chose 16KiB\n// because it is also the limit of the 'batchBytesCount' that we use for RUM and Logs data, but this\n// is a bit arbitrary.\nexport var CUSTOMER_COMPRESSED_DATA_BYTES_LIMIT = 16 * ONE_KIBI_BYTE;\nexport var BYTES_COMPUTATION_THROTTLING_DELAY = 200;\nexport function createCustomerDataTrackerManager(compressionStatus) {\n if (compressionStatus === void 0) { compressionStatus = 2 /* CustomerDataCompressionStatus.Disabled */; }\n var customerDataTrackers = new Map();\n var alreadyWarned = false;\n function checkCustomerDataLimit(initialBytesCount) {\n if (initialBytesCount === void 0) { initialBytesCount = 0; }\n if (alreadyWarned || compressionStatus === 0 /* CustomerDataCompressionStatus.Unknown */) {\n return;\n }\n var bytesCountLimit = compressionStatus === 2 /* CustomerDataCompressionStatus.Disabled */\n ? CUSTOMER_DATA_BYTES_LIMIT\n : CUSTOMER_COMPRESSED_DATA_BYTES_LIMIT;\n var bytesCount = initialBytesCount;\n customerDataTrackers.forEach(function (tracker) {\n bytesCount += tracker.getBytesCount();\n });\n if (bytesCount > bytesCountLimit) {\n displayCustomerDataLimitReachedWarning(bytesCountLimit);\n alreadyWarned = true;\n }\n }\n return {\n /**\n * Creates a detached tracker. The manager will not store a reference to that tracker, and the\n * bytes count will be counted independently from other detached trackers.\n *\n * This is particularly useful when we don't know when the tracker will be unused, so we don't\n * leak memory (ex: when used in Logger instances).\n */\n createDetachedTracker: function () {\n var tracker = createCustomerDataTracker(function () { return checkCustomerDataLimit(tracker.getBytesCount()); });\n return tracker;\n },\n /**\n * Creates a tracker if it doesn't exist, and returns it.\n */\n getOrCreateTracker: function (type) {\n if (!customerDataTrackers.has(type)) {\n customerDataTrackers.set(type, createCustomerDataTracker(checkCustomerDataLimit));\n }\n return customerDataTrackers.get(type);\n },\n setCompressionStatus: function (newCompressionStatus) {\n if (compressionStatus === 0 /* CustomerDataCompressionStatus.Unknown */) {\n compressionStatus = newCompressionStatus;\n checkCustomerDataLimit();\n }\n },\n getCompressionStatus: function () { return compressionStatus; },\n stop: function () {\n customerDataTrackers.forEach(function (tracker) { return tracker.stop(); });\n customerDataTrackers.clear();\n },\n };\n}\nexport function createCustomerDataTracker(checkCustomerDataLimit) {\n var bytesCountCache = 0;\n // Throttle the bytes computation to minimize the impact on performance.\n // Especially useful if the user call context APIs synchronously multiple times in a row\n var _a = throttle(function (context) {\n bytesCountCache = computeBytesCount(jsonStringify(context));\n checkCustomerDataLimit();\n }, BYTES_COMPUTATION_THROTTLING_DELAY), computeBytesCountThrottled = _a.throttled, cancelComputeBytesCount = _a.cancel;\n var resetBytesCount = function () {\n cancelComputeBytesCount();\n bytesCountCache = 0;\n };\n return {\n updateCustomerData: function (context) {\n if (isEmptyObject(context)) {\n resetBytesCount();\n }\n else {\n computeBytesCountThrottled(context);\n }\n },\n resetCustomerData: resetBytesCount,\n getBytesCount: function () { return bytesCountCache; },\n stop: function () {\n cancelComputeBytesCount();\n },\n };\n}\nfunction displayCustomerDataLimitReachedWarning(bytesCountLimit) {\n display.warn(\"Customer data exceeds the recommended \".concat(bytesCountLimit / ONE_KIBI_BYTE, \"KiB threshold. More details: https://docs.datadoghq.com/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-threshold-warning\"));\n}\n//# sourceMappingURL=customerDataTracker.js.map","/**\n * Similar to `typeof`, but distinguish plain objects from `null` and arrays\n */\nexport function getType(value) {\n if (value === null) {\n return 'null';\n }\n if (Array.isArray(value)) {\n return 'array';\n }\n return typeof value;\n}\n//# sourceMappingURL=typeUtils.js.map","import { getType } from './utils/typeUtils';\n/**\n * Iterate over source and affect its sub values into destination, recursively.\n * If the source and destination can't be merged, return source.\n */\nexport function mergeInto(destination, source, circularReferenceChecker) {\n if (circularReferenceChecker === void 0) { circularReferenceChecker = createCircularReferenceChecker(); }\n // ignore the source if it is undefined\n if (source === undefined) {\n return destination;\n }\n if (typeof source !== 'object' || source === null) {\n // primitive values - just return source\n return source;\n }\n else if (source instanceof Date) {\n return new Date(source.getTime());\n }\n else if (source instanceof RegExp) {\n var flags = source.flags ||\n // old browsers compatibility\n [\n source.global ? 'g' : '',\n source.ignoreCase ? 'i' : '',\n source.multiline ? 'm' : '',\n source.sticky ? 'y' : '',\n source.unicode ? 'u' : '',\n ].join('');\n return new RegExp(source.source, flags);\n }\n if (circularReferenceChecker.hasAlreadyBeenSeen(source)) {\n // remove circular references\n return undefined;\n }\n else if (Array.isArray(source)) {\n var merged_1 = Array.isArray(destination) ? destination : [];\n for (var i = 0; i < source.length; ++i) {\n merged_1[i] = mergeInto(merged_1[i], source[i], circularReferenceChecker);\n }\n return merged_1;\n }\n var merged = getType(destination) === 'object' ? destination : {};\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n merged[key] = mergeInto(merged[key], source[key], circularReferenceChecker);\n }\n }\n return merged;\n}\n/**\n * A simplistic implementation of a deep clone algorithm.\n * Caveats:\n * - It doesn't maintain prototype chains - don't use with instances of custom classes.\n * - It doesn't handle Map and Set\n */\nexport function deepClone(value) {\n return mergeInto(undefined, value);\n}\nexport function combine() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n var destination;\n for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {\n var source = sources_1[_a];\n // Ignore any undefined or null sources.\n if (source === undefined || source === null) {\n continue;\n }\n destination = mergeInto(destination, source);\n }\n return destination;\n}\nfunction createCircularReferenceChecker() {\n if (typeof WeakSet !== 'undefined') {\n var set_1 = new WeakSet();\n return {\n hasAlreadyBeenSeen: function (value) {\n var has = set_1.has(value);\n if (!has) {\n set_1.add(value);\n }\n return has;\n },\n };\n }\n var array = [];\n return {\n hasAlreadyBeenSeen: function (value) {\n var has = array.indexOf(value) >= 0;\n if (!has) {\n array.push(value);\n }\n return has;\n },\n };\n}\n//# sourceMappingURL=mergeInto.js.map","import { display } from '../display';\nimport { ONE_KIBI_BYTE } from '../utils/byteUtils';\nimport { detachToJsonMethod } from './jsonStringify';\n// The maximum size of a single event is 256KiB. By default, we ensure that user-provided data\n// going through sanitize fits inside our events, while leaving room for other contexts, metadata, ...\nvar SANITIZE_DEFAULT_MAX_CHARACTER_COUNT = 220 * ONE_KIBI_BYTE;\n// Symbol for the root element of the JSONPath used for visited objects\nvar JSON_PATH_ROOT_ELEMENT = '$';\n// When serializing (using JSON.stringify) a key of an object, { key: 42 } gets wrapped in quotes as \"key\".\n// With the separator (:), we need to add 3 characters to the count.\nvar KEY_DECORATION_LENGTH = 3;\nexport function sanitize(source, maxCharacterCount) {\n var _a;\n if (maxCharacterCount === void 0) { maxCharacterCount = SANITIZE_DEFAULT_MAX_CHARACTER_COUNT; }\n // Unbind any toJSON function we may have on [] or {} prototypes\n var restoreObjectPrototypeToJson = detachToJsonMethod(Object.prototype);\n var restoreArrayPrototypeToJson = detachToJsonMethod(Array.prototype);\n // Initial call to sanitizeProcessor - will populate containerQueue if source is an Array or a plain Object\n var containerQueue = [];\n var visitedObjectsWithPath = new WeakMap();\n var sanitizedData = sanitizeProcessor(source, JSON_PATH_ROOT_ELEMENT, undefined, containerQueue, visitedObjectsWithPath);\n var accumulatedCharacterCount = ((_a = JSON.stringify(sanitizedData)) === null || _a === void 0 ? void 0 : _a.length) || 0;\n if (accumulatedCharacterCount > maxCharacterCount) {\n warnOverCharacterLimit(maxCharacterCount, 'discarded', source);\n return undefined;\n }\n while (containerQueue.length > 0 && accumulatedCharacterCount < maxCharacterCount) {\n var containerToProcess = containerQueue.shift();\n var separatorLength = 0; // 0 for the first element, 1 for subsequent elements\n // Arrays and Objects have to be handled distinctly to ensure\n // we do not pick up non-numerical properties from Arrays\n if (Array.isArray(containerToProcess.source)) {\n for (var key = 0; key < containerToProcess.source.length; key++) {\n var targetData = sanitizeProcessor(containerToProcess.source[key], containerToProcess.path, key, containerQueue, visitedObjectsWithPath);\n if (targetData !== undefined) {\n accumulatedCharacterCount += JSON.stringify(targetData).length;\n }\n else {\n // When an element of an Array (targetData) is undefined, it is serialized as null:\n // JSON.stringify([undefined]) => '[null]' - This accounts for 4 characters\n accumulatedCharacterCount += 4;\n }\n accumulatedCharacterCount += separatorLength;\n separatorLength = 1;\n if (accumulatedCharacterCount > maxCharacterCount) {\n warnOverCharacterLimit(maxCharacterCount, 'truncated', source);\n break;\n }\n ;\n containerToProcess.target[key] = targetData;\n }\n }\n else {\n for (var key in containerToProcess.source) {\n if (Object.prototype.hasOwnProperty.call(containerToProcess.source, key)) {\n var targetData = sanitizeProcessor(containerToProcess.source[key], containerToProcess.path, key, containerQueue, visitedObjectsWithPath);\n // When a property of an object has an undefined value, it will be dropped during serialization:\n // JSON.stringify({a:undefined}) => '{}'\n if (targetData !== undefined) {\n accumulatedCharacterCount +=\n JSON.stringify(targetData).length + separatorLength + key.length + KEY_DECORATION_LENGTH;\n separatorLength = 1;\n }\n if (accumulatedCharacterCount > maxCharacterCount) {\n warnOverCharacterLimit(maxCharacterCount, 'truncated', source);\n break;\n }\n ;\n containerToProcess.target[key] = targetData;\n }\n }\n }\n }\n // Rebind detached toJSON functions\n restoreObjectPrototypeToJson();\n restoreArrayPrototypeToJson();\n return sanitizedData;\n}\n/**\n * Internal function to factorize the process common to the\n * initial call to sanitize, and iterations for Arrays and Objects\n *\n */\nfunction sanitizeProcessor(source, parentPath, key, queue, visitedObjectsWithPath) {\n // Start by handling toJSON, as we want to sanitize its output\n var sourceToSanitize = tryToApplyToJSON(source);\n if (!sourceToSanitize || typeof sourceToSanitize !== 'object') {\n return sanitizePrimitivesAndFunctions(sourceToSanitize);\n }\n var sanitizedSource = sanitizeObjects(sourceToSanitize);\n if (sanitizedSource !== '[Object]' && sanitizedSource !== '[Array]' && sanitizedSource !== '[Error]') {\n return sanitizedSource;\n }\n // Handle potential cyclic references\n // We need to use source as sourceToSanitize could be a reference to a new object\n // At this stage, we know the source is an object type\n var sourceAsObject = source;\n if (visitedObjectsWithPath.has(sourceAsObject)) {\n return \"[Reference seen at \".concat(visitedObjectsWithPath.get(sourceAsObject), \"]\");\n }\n // Add processed source to queue\n var currentPath = key !== undefined ? \"\".concat(parentPath, \".\").concat(key) : parentPath;\n var target = Array.isArray(sourceToSanitize) ? [] : {};\n visitedObjectsWithPath.set(sourceAsObject, currentPath);\n queue.push({ source: sourceToSanitize, target: target, path: currentPath });\n return target;\n}\n/**\n * Handles sanitization of simple, non-object types\n *\n */\nfunction sanitizePrimitivesAndFunctions(value) {\n // BigInt cannot be serialized by JSON.stringify(), convert it to a string representation\n if (typeof value === 'bigint') {\n return \"[BigInt] \".concat(value.toString());\n }\n // Functions cannot be serialized by JSON.stringify(). Moreover, if a faulty toJSON is present, it needs to be converted\n // so it won't prevent stringify from serializing later\n if (typeof value === 'function') {\n return \"[Function] \".concat(value.name || 'unknown');\n }\n // JSON.stringify() does not serialize symbols.\n if (typeof value === 'symbol') {\n return \"[Symbol] \".concat(value.description || value.toString());\n }\n return value;\n}\n/**\n * Handles sanitization of object types\n *\n * LIMITATIONS\n * - If a class defines a toStringTag Symbol, it will fall in the catch-all method and prevent enumeration of properties.\n * To avoid this, a toJSON method can be defined.\n * - IE11 does not return a distinct type for objects such as Map, WeakMap, ... These objects will pass through and their\n * properties enumerated if any.\n *\n */\nfunction sanitizeObjects(value) {\n try {\n // Handle events - Keep a simple implementation to avoid breaking changes\n if (value instanceof Event) {\n return {\n isTrusted: value.isTrusted,\n };\n }\n // Handle all remaining object types in a generic way\n var result = Object.prototype.toString.call(value);\n var match = result.match(/\\[object (.*)\\]/);\n if (match && match[1]) {\n return \"[\".concat(match[1], \"]\");\n }\n }\n catch (_a) {\n // If the previous serialization attempts failed, and we cannot convert using\n // Object.prototype.toString, declare the value unserializable\n }\n return '[Unserializable]';\n}\n/**\n * Checks if a toJSON function exists and tries to execute it\n *\n */\nfunction tryToApplyToJSON(value) {\n var object = value;\n if (object && typeof object.toJSON === 'function') {\n try {\n return object.toJSON();\n }\n catch (_a) {\n // If toJSON fails, we continue by trying to serialize the value manually\n }\n }\n return value;\n}\n/**\n * Helper function to display the warning when the accumulated character count is over the limit\n */\nfunction warnOverCharacterLimit(maxCharacterCount, changeType, source) {\n display.warn(\"The data provided has been \".concat(changeType, \" as it is over the limit of \").concat(maxCharacterCount, \" characters:\"), source);\n}\n//# sourceMappingURL=sanitize.js.map","var Observable = /** @class */ (function () {\n function Observable(onFirstSubscribe) {\n this.onFirstSubscribe = onFirstSubscribe;\n this.observers = [];\n }\n Observable.prototype.subscribe = function (f) {\n var _this = this;\n if (!this.observers.length && this.onFirstSubscribe) {\n this.onLastUnsubscribe = this.onFirstSubscribe(this) || undefined;\n }\n this.observers.push(f);\n return {\n unsubscribe: function () {\n _this.observers = _this.observers.filter(function (other) { return f !== other; });\n if (!_this.observers.length && _this.onLastUnsubscribe) {\n _this.onLastUnsubscribe();\n }\n },\n };\n };\n Observable.prototype.notify = function (data) {\n this.observers.forEach(function (observer) { return observer(data); });\n };\n return Observable;\n}());\nexport { Observable };\nexport function mergeObservables() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return new Observable(function (globalObservable) {\n var subscriptions = observables.map(function (observable) {\n return observable.subscribe(function (data) { return globalObservable.notify(data); });\n });\n return function () { return subscriptions.forEach(function (subscription) { return subscription.unsubscribe(); }); };\n });\n}\n//# sourceMappingURL=observable.js.map","import { deepClone } from '../../tools/mergeInto';\nimport { getType } from '../../tools/utils/typeUtils';\nimport { sanitize } from '../../tools/serialisation/sanitize';\nimport { Observable } from '../../tools/observable';\nexport function createContextManager(customerDataTracker) {\n var context = {};\n var changeObservable = new Observable();\n var contextManager = {\n getContext: function () { return deepClone(context); },\n setContext: function (newContext) {\n if (getType(newContext) === 'object') {\n context = sanitize(newContext);\n customerDataTracker.updateCustomerData(context);\n }\n else {\n contextManager.clearContext();\n }\n changeObservable.notify();\n },\n setContextProperty: function (key, property) {\n context[key] = sanitize(property);\n customerDataTracker.updateCustomerData(context);\n changeObservable.notify();\n },\n removeContextProperty: function (key) {\n delete context[key];\n customerDataTracker.updateCustomerData(context);\n changeObservable.notify();\n },\n clearContext: function () {\n context = {};\n customerDataTracker.resetCustomerData();\n changeObservable.notify();\n },\n changeObservable: changeObservable,\n };\n return contextManager;\n}\n//# sourceMappingURL=contextManager.js.map","import { Observable } from '../tools/observable';\nexport var TrackingConsent = {\n GRANTED: 'granted',\n NOT_GRANTED: 'not-granted',\n};\nexport function createTrackingConsentState(currentConsent) {\n var observable = new Observable();\n return {\n tryToInit: function (trackingConsent) {\n if (!currentConsent) {\n currentConsent = trackingConsent;\n }\n },\n update: function (trackingConsent) {\n currentConsent = trackingConsent;\n observable.notify();\n },\n isGranted: function () {\n return currentConsent === TrackingConsent.GRANTED;\n },\n observable: observable,\n };\n}\n//# sourceMappingURL=trackingConsent.js.map","import { monitor } from '../tools/monitor';\nimport { getZoneJsOriginalValue } from '../tools/getZoneJsOriginalValue';\n// We want to use a real enum (i.e. not a const enum) here, to be able to iterate over it to automatically add _ddIsTrusted in e2e tests\n// eslint-disable-next-line no-restricted-syntax\nexport var DOM_EVENT;\n(function (DOM_EVENT) {\n DOM_EVENT[\"BEFORE_UNLOAD\"] = \"beforeunload\";\n DOM_EVENT[\"CLICK\"] = \"click\";\n DOM_EVENT[\"DBL_CLICK\"] = \"dblclick\";\n DOM_EVENT[\"KEY_DOWN\"] = \"keydown\";\n DOM_EVENT[\"LOAD\"] = \"load\";\n DOM_EVENT[\"POP_STATE\"] = \"popstate\";\n DOM_EVENT[\"SCROLL\"] = \"scroll\";\n DOM_EVENT[\"TOUCH_START\"] = \"touchstart\";\n DOM_EVENT[\"TOUCH_END\"] = \"touchend\";\n DOM_EVENT[\"TOUCH_MOVE\"] = \"touchmove\";\n DOM_EVENT[\"VISIBILITY_CHANGE\"] = \"visibilitychange\";\n DOM_EVENT[\"PAGE_SHOW\"] = \"pageshow\";\n DOM_EVENT[\"FREEZE\"] = \"freeze\";\n DOM_EVENT[\"RESUME\"] = \"resume\";\n DOM_EVENT[\"DOM_CONTENT_LOADED\"] = \"DOMContentLoaded\";\n DOM_EVENT[\"POINTER_DOWN\"] = \"pointerdown\";\n DOM_EVENT[\"POINTER_UP\"] = \"pointerup\";\n DOM_EVENT[\"POINTER_CANCEL\"] = \"pointercancel\";\n DOM_EVENT[\"HASH_CHANGE\"] = \"hashchange\";\n DOM_EVENT[\"PAGE_HIDE\"] = \"pagehide\";\n DOM_EVENT[\"MOUSE_DOWN\"] = \"mousedown\";\n DOM_EVENT[\"MOUSE_UP\"] = \"mouseup\";\n DOM_EVENT[\"MOUSE_MOVE\"] = \"mousemove\";\n DOM_EVENT[\"FOCUS\"] = \"focus\";\n DOM_EVENT[\"BLUR\"] = \"blur\";\n DOM_EVENT[\"CONTEXT_MENU\"] = \"contextmenu\";\n DOM_EVENT[\"RESIZE\"] = \"resize\";\n DOM_EVENT[\"CHANGE\"] = \"change\";\n DOM_EVENT[\"INPUT\"] = \"input\";\n DOM_EVENT[\"PLAY\"] = \"play\";\n DOM_EVENT[\"PAUSE\"] = \"pause\";\n DOM_EVENT[\"SECURITY_POLICY_VIOLATION\"] = \"securitypolicyviolation\";\n DOM_EVENT[\"SELECTION_CHANGE\"] = \"selectionchange\";\n DOM_EVENT[\"STORAGE\"] = \"storage\";\n})(DOM_EVENT || (DOM_EVENT = {}));\n/**\n * Add an event listener to an event target object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by: using an option object only if needed and emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n */\nexport function addEventListener(configuration, eventTarget, eventName, listener, options) {\n return addEventListeners(configuration, eventTarget, [eventName], listener, options);\n}\n/**\n * Add event listeners to an event target object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by: using an option object only if needed and emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n *\n * * with `once: true`, the listener will be called at most once, even if different events are listened\n */\nexport function addEventListeners(configuration, eventTarget, eventNames, listener, _a) {\n var _b = _a === void 0 ? {} : _a, once = _b.once, capture = _b.capture, passive = _b.passive;\n var listenerWithMonitor = monitor(function (event) {\n if (!event.isTrusted && !event.__ddIsTrusted && !configuration.allowUntrustedEvents) {\n return;\n }\n if (once) {\n stop();\n }\n listener(event);\n });\n var options = passive ? { capture: capture, passive: passive } : capture;\n var add = getZoneJsOriginalValue(eventTarget, 'addEventListener');\n eventNames.forEach(function (eventName) { return add.call(eventTarget, eventName, listenerWithMonitor, options); });\n function stop() {\n var remove = getZoneJsOriginalValue(eventTarget, 'removeEventListener');\n eventNames.forEach(function (eventName) { return remove.call(eventTarget, eventName, listenerWithMonitor, options); });\n }\n return {\n stop: stop,\n };\n}\n//# sourceMappingURL=addEventListener.js.map","import { addEventListener, DOM_EVENT } from '../../browser/addEventListener';\nimport { combine } from '../../tools/mergeInto';\nvar CONTEXT_STORE_KEY_PREFIX = '_dd_c';\nvar storageListeners = [];\nexport function storeContextManager(configuration, contextManager, productKey, customerDataType) {\n var storageKey = buildStorageKey(productKey, customerDataType);\n storageListeners.push(addEventListener(configuration, window, DOM_EVENT.STORAGE, function (_a) {\n var key = _a.key;\n if (storageKey === key) {\n synchronizeWithStorage();\n }\n }));\n contextManager.changeObservable.subscribe(dumpToStorage);\n contextManager.setContext(combine(getFromStorage(), contextManager.getContext()));\n function synchronizeWithStorage() {\n contextManager.setContext(getFromStorage());\n }\n function dumpToStorage() {\n localStorage.setItem(storageKey, JSON.stringify(contextManager.getContext()));\n }\n function getFromStorage() {\n var rawContext = localStorage.getItem(storageKey);\n return rawContext !== null ? JSON.parse(rawContext) : {};\n }\n}\nexport function buildStorageKey(productKey, customerDataType) {\n return \"\".concat(CONTEXT_STORE_KEY_PREFIX, \"_\").concat(productKey, \"_\").concat(customerDataType);\n}\nexport function removeStorageListeners() {\n storageListeners.map(function (listener) { return listener.stop(); });\n}\n//# sourceMappingURL=storeContextManager.js.map","import { display } from '../../tools/display';\nimport { getType } from '../../tools/utils/typeUtils';\nimport { assign } from '../../tools/utils/polyfills';\n/**\n * Clone input data and ensure known user properties (id, name, email)\n * are strings, as defined here:\n * https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#user-related-attributes\n */\nexport function sanitizeUser(newUser) {\n // We shallow clone only to prevent mutation of user data.\n var user = assign({}, newUser);\n var keys = ['id', 'name', 'email'];\n keys.forEach(function (key) {\n if (key in user) {\n user[key] = String(user[key]);\n }\n });\n return user;\n}\n/**\n * Simple check to ensure user is valid\n */\nexport function checkUser(newUser) {\n var isValid = getType(newUser) === 'object';\n if (!isValid) {\n display.error('Unsupported user:', newUser);\n }\n return isValid;\n}\n//# sourceMappingURL=user.js.map","import { display } from '../tools/display';\nexport function displayAlreadyInitializedError(sdkName, initConfiguration) {\n if (!initConfiguration.silentMultipleInit) {\n display.error(\"\".concat(sdkName, \" is already initialized.\"));\n }\n}\n//# sourceMappingURL=displayAlreadyInitializedError.js.map","/**\n * Cross-browser stack trace computation.\n *\n * Reference implementation: https://github.com/csnover/TraceKit/blob/04530298073c3823de72deb0b97e7b38ca7bcb59/tracekit.js\n */\nimport { startsWith } from '../../tools/utils/polyfills';\nvar UNKNOWN_FUNCTION = '?';\nexport function computeStackTrace(ex) {\n var stack = [];\n var stackProperty = tryToGetString(ex, 'stack');\n var exString = String(ex);\n if (stackProperty && startsWith(stackProperty, exString)) {\n stackProperty = stackProperty.slice(exString.length);\n }\n if (stackProperty) {\n stackProperty.split('\\n').forEach(function (line) {\n var stackFrame = parseChromeLine(line) || parseChromeAnonymousLine(line) || parseWinLine(line) || parseGeckoLine(line);\n if (stackFrame) {\n if (!stackFrame.func && stackFrame.line) {\n stackFrame.func = UNKNOWN_FUNCTION;\n }\n stack.push(stackFrame);\n }\n });\n }\n return {\n message: tryToGetString(ex, 'message'),\n name: tryToGetString(ex, 'name'),\n stack: stack,\n };\n}\nvar fileUrl = '((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet||\\\\w+\\\\.|\\\\/).*?)';\nvar filePosition = '(?::(\\\\d+))';\nvar CHROME_LINE_RE = new RegExp(\"^\\\\s*at (.*?) ?\\\\(\".concat(fileUrl).concat(filePosition, \"?\").concat(filePosition, \"?\\\\)?\\\\s*$\"), 'i');\nvar CHROME_EVAL_RE = new RegExp(\"\\\\((\\\\S*)\".concat(filePosition).concat(filePosition, \"\\\\)\"));\nfunction parseChromeLine(line) {\n var parts = CHROME_LINE_RE.exec(line);\n if (!parts) {\n return;\n }\n var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n var submatch = CHROME_EVAL_RE.exec(parts[2]);\n if (isEval && submatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n parts[3] = submatch[2]; // line\n parts[4] = submatch[3]; // column\n }\n return {\n args: isNative ? [parts[2]] : [],\n column: parts[4] ? +parts[4] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: parts[3] ? +parts[3] : undefined,\n url: !isNative ? parts[2] : undefined,\n };\n}\nvar CHROME_ANONYMOUS_FUNCTION_RE = new RegExp(\"^\\\\s*at ?\".concat(fileUrl).concat(filePosition, \"?\").concat(filePosition, \"??\\\\s*$\"), 'i');\nfunction parseChromeAnonymousLine(line) {\n var parts = CHROME_ANONYMOUS_FUNCTION_RE.exec(line);\n if (!parts) {\n return;\n }\n return {\n args: [],\n column: parts[3] ? +parts[3] : undefined,\n func: UNKNOWN_FUNCTION,\n line: parts[2] ? +parts[2] : undefined,\n url: parts[1],\n };\n}\nvar WINJS_LINE_RE = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\nfunction parseWinLine(line) {\n var parts = WINJS_LINE_RE.exec(line);\n if (!parts) {\n return;\n }\n return {\n args: [],\n column: parts[4] ? +parts[4] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: +parts[3],\n url: parts[2],\n };\n}\nvar GECKO_LINE_RE = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nvar GECKO_EVAL_RE = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\nfunction parseGeckoLine(line) {\n var parts = GECKO_LINE_RE.exec(line);\n if (!parts) {\n return;\n }\n var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n var submatch = GECKO_EVAL_RE.exec(parts[3]);\n if (isEval && submatch) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = undefined; // no column when eval\n }\n return {\n args: parts[2] ? parts[2].split(',') : [],\n column: parts[5] ? +parts[5] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: parts[4] ? +parts[4] : undefined,\n url: parts[3],\n };\n}\nfunction tryToGetString(candidate, property) {\n if (typeof candidate !== 'object' || !candidate || !(property in candidate)) {\n return undefined;\n }\n var value = candidate[property];\n return typeof value === 'string' ? value : undefined;\n}\nexport function computeStackTraceFromOnErrorMessage(messageObj, url, line, column) {\n var stack = [{ url: url, column: column, line: line }];\n var _a = tryToParseMessage(messageObj), name = _a.name, message = _a.message;\n return {\n name: name,\n message: message,\n stack: stack,\n };\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types\nvar ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\\s\\S]*)$/;\nfunction tryToParseMessage(messageObj) {\n var _a;\n var name;\n var message;\n if ({}.toString.call(messageObj) === '[object String]') {\n ;\n _a = ERROR_TYPES_RE.exec(messageObj), name = _a[1], message = _a[2];\n }\n return { name: name, message: message };\n}\n//# sourceMappingURL=computeStackTrace.js.map","import { callMonitored } from '../../tools/monitor';\nimport { sanitize } from '../../tools/serialisation/sanitize';\nimport { noop } from '../../tools/utils/functionUtils';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nimport { computeStackTrace } from './computeStackTrace';\nexport var NO_ERROR_STACK_PRESENT_MESSAGE = 'No stack, consider using an instance of Error';\nexport function computeRawError(_a) {\n var stackTrace = _a.stackTrace, originalError = _a.originalError, handlingStack = _a.handlingStack, startClocks = _a.startClocks, nonErrorPrefix = _a.nonErrorPrefix, source = _a.source, handling = _a.handling;\n var isErrorInstance = originalError instanceof Error;\n var message = computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError);\n var stack = hasUsableStack(isErrorInstance, stackTrace)\n ? toStackTraceString(stackTrace)\n : NO_ERROR_STACK_PRESENT_MESSAGE;\n var causes = isErrorInstance ? flattenErrorCauses(originalError, source) : undefined;\n var type = stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name;\n var fingerprint = tryToGetFingerprint(originalError);\n return {\n startClocks: startClocks,\n source: source,\n handling: handling,\n handlingStack: handlingStack,\n originalError: originalError,\n type: type,\n message: message,\n stack: stack,\n causes: causes,\n fingerprint: fingerprint,\n };\n}\nfunction computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError) {\n // Favor stackTrace message only if tracekit has really been able to extract something meaningful (message + name)\n // TODO rework tracekit integration to avoid scattering error building logic\n return (stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.message) && (stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name)\n ? stackTrace.message\n : !isErrorInstance\n ? \"\".concat(nonErrorPrefix, \" \").concat(jsonStringify(sanitize(originalError)))\n : 'Empty message';\n}\nfunction hasUsableStack(isErrorInstance, stackTrace) {\n if (stackTrace === undefined) {\n return false;\n }\n if (isErrorInstance) {\n return true;\n }\n // handle cases where tracekit return stack = [] or stack = [{url: undefined, line: undefined, column: undefined}]\n // TODO rework tracekit integration to avoid generating those unusable stack\n return stackTrace.stack.length > 0 && (stackTrace.stack.length > 1 || stackTrace.stack[0].url !== undefined);\n}\nexport function tryToGetFingerprint(originalError) {\n return originalError instanceof Error && 'dd_fingerprint' in originalError\n ? String(originalError.dd_fingerprint)\n : undefined;\n}\nexport function toStackTraceString(stack) {\n var result = formatErrorMessage(stack);\n stack.stack.forEach(function (frame) {\n var func = frame.func === '?' ? '' : frame.func;\n var args = frame.args && frame.args.length > 0 ? \"(\".concat(frame.args.join(', '), \")\") : '';\n var line = frame.line ? \":\".concat(frame.line) : '';\n var column = frame.line && frame.column ? \":\".concat(frame.column) : '';\n result += \"\\n at \".concat(func).concat(args, \" @ \").concat(frame.url).concat(line).concat(column);\n });\n return result;\n}\nexport function getFileFromStackTraceString(stack) {\n var _a;\n return (_a = /@ (.+)/.exec(stack)) === null || _a === void 0 ? void 0 : _a[1];\n}\nexport function formatErrorMessage(stack) {\n return \"\".concat(stack.name || 'Error', \": \").concat(stack.message);\n}\n/**\n Creates a stacktrace without SDK internal frames.\n \n Constraints:\n - Has to be called at the utmost position of the call stack.\n - No monitored function should encapsulate it, that is why we need to use callMonitored inside it.\n */\nexport function createHandlingStack() {\n /**\n * Skip the two internal frames:\n * - SDK API (console.error, ...)\n * - this function\n * in order to keep only the user calls\n */\n var internalFramesToSkip = 2;\n var error = new Error();\n var formattedStack;\n // IE needs to throw the error to fill in the stack trace\n if (!error.stack) {\n try {\n throw error;\n }\n catch (e) {\n noop();\n }\n }\n callMonitored(function () {\n var stackTrace = computeStackTrace(error);\n stackTrace.stack = stackTrace.stack.slice(internalFramesToSkip);\n formattedStack = toStackTraceString(stackTrace);\n });\n return formattedStack;\n}\nexport function flattenErrorCauses(error, parentSource) {\n var currentError = error;\n var causes = [];\n while ((currentError === null || currentError === void 0 ? void 0 : currentError.cause) instanceof Error && causes.length < 10) {\n var stackTrace = computeStackTrace(currentError.cause);\n causes.push({\n message: currentError.cause.message,\n source: parentSource,\n type: stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name,\n stack: stackTrace && toStackTraceString(stackTrace),\n });\n currentError = currentError.cause;\n }\n return causes.length ? causes : undefined;\n}\n//# sourceMappingURL=error.js.map","export var ErrorSource = {\n AGENT: 'agent',\n CONSOLE: 'console',\n CUSTOM: 'custom',\n LOGGER: 'logger',\n NETWORK: 'network',\n SOURCE: 'source',\n REPORT: 'report',\n};\n//# sourceMappingURL=error.types.js.map","import { isNumber, round } from './numberUtils';\nexport var ONE_SECOND = 1000;\nexport var ONE_MINUTE = 60 * ONE_SECOND;\nexport var ONE_HOUR = 60 * ONE_MINUTE;\nexport var ONE_DAY = 24 * ONE_HOUR;\nexport var ONE_YEAR = 365 * ONE_DAY;\nexport function relativeToClocks(relative) {\n return { relative: relative, timeStamp: getCorrectedTimeStamp(relative) };\n}\nexport function timeStampToClocks(timeStamp) {\n return { relative: getRelativeTime(timeStamp), timeStamp: timeStamp };\n}\nfunction getCorrectedTimeStamp(relativeTime) {\n var correctedOrigin = (dateNow() - performance.now());\n // apply correction only for positive drift\n if (correctedOrigin > getNavigationStart()) {\n return Math.round(addDuration(correctedOrigin, relativeTime));\n }\n return getTimeStamp(relativeTime);\n}\nexport function currentDrift() {\n return Math.round(dateNow() - addDuration(getNavigationStart(), performance.now()));\n}\nexport function toServerDuration(duration) {\n if (!isNumber(duration)) {\n return duration;\n }\n return round(duration * 1e6, 0);\n}\nexport function dateNow() {\n // Do not use `Date.now` because sometimes websites are wrongly \"polyfilling\" it. For example, we\n // had some users using a very old version of `datejs`, which patched `Date.now` to return a Date\n // instance instead of a timestamp[1]. Those users are unlikely to fix this, so let's handle this\n // case ourselves.\n // [1]: https://github.com/datejs/Datejs/blob/97f5c7c58c5bc5accdab8aa7602b6ac56462d778/src/core-debug.js#L14-L16\n return new Date().getTime();\n}\nexport function timeStampNow() {\n return dateNow();\n}\nexport function relativeNow() {\n return performance.now();\n}\nexport function clocksNow() {\n return { relative: relativeNow(), timeStamp: timeStampNow() };\n}\nexport function clocksOrigin() {\n return { relative: 0, timeStamp: getNavigationStart() };\n}\nexport function elapsed(start, end) {\n return (end - start);\n}\nexport function addDuration(a, b) {\n return a + b;\n}\n/**\n * Get the time since the navigation was started.\n *\n * Note: this does not use `performance.timeOrigin` because it doesn't seem to reflect the actual\n * time on which the navigation has started: it may be much farther in the past, at least in Firefox 71.\n * Related issue in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1429926\n */\nexport function getRelativeTime(timestamp) {\n return (timestamp - getNavigationStart());\n}\nexport function getTimeStamp(relativeTime) {\n return Math.round(addDuration(getNavigationStart(), relativeTime));\n}\nexport function looksLikeRelativeTime(time) {\n return time < ONE_YEAR;\n}\n/**\n * Navigation start slightly change on some rare cases\n */\nvar navigationStart;\nfunction getNavigationStart() {\n if (navigationStart === undefined) {\n navigationStart = performance.timing.navigationStart;\n }\n return navigationStart;\n}\nexport function resetNavigationStart() {\n navigationStart = undefined;\n}\n//# sourceMappingURL=timeUtils.js.map","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { clocksNow, computeRawError, computeStackTrace, combine, createContextManager, ErrorSource, monitored, sanitize, } from '@datadog/browser-core';\nexport var StatusType = {\n debug: 'debug',\n error: 'error',\n info: 'info',\n warn: 'warn',\n};\nexport var HandlerType = {\n console: 'console',\n http: 'http',\n silent: 'silent',\n};\nexport var STATUSES = Object.keys(StatusType);\nvar Logger = /** @class */ (function () {\n function Logger(handleLogStrategy, customerDataTracker, name, handlerType, level, loggerContext) {\n if (handlerType === void 0) { handlerType = HandlerType.http; }\n if (level === void 0) { level = StatusType.debug; }\n if (loggerContext === void 0) { loggerContext = {}; }\n this.handleLogStrategy = handleLogStrategy;\n this.handlerType = handlerType;\n this.level = level;\n this.contextManager = createContextManager(customerDataTracker);\n this.contextManager.setContext(loggerContext);\n if (name) {\n this.contextManager.setContextProperty('logger', { name: name });\n }\n }\n Logger.prototype.log = function (message, messageContext, status, error) {\n if (status === void 0) { status = StatusType.info; }\n var errorContext;\n if (error !== undefined && error !== null) {\n var stackTrace = error instanceof Error ? computeStackTrace(error) : undefined;\n var rawError = computeRawError({\n stackTrace: stackTrace,\n originalError: error,\n nonErrorPrefix: \"Provided\" /* NonErrorPrefix.PROVIDED */,\n source: ErrorSource.LOGGER,\n handling: \"handled\" /* ErrorHandling.HANDLED */,\n startClocks: clocksNow(),\n });\n errorContext = {\n stack: rawError.stack,\n kind: rawError.type,\n message: rawError.message,\n causes: rawError.causes,\n };\n }\n var sanitizedMessageContext = sanitize(messageContext);\n var context = errorContext\n ? combine({ error: errorContext }, sanitizedMessageContext)\n : sanitizedMessageContext;\n this.handleLogStrategy({\n message: sanitize(message),\n context: context,\n status: status,\n }, this);\n };\n Logger.prototype.debug = function (message, messageContext, error) {\n this.log(message, messageContext, StatusType.debug, error);\n };\n Logger.prototype.info = function (message, messageContext, error) {\n this.log(message, messageContext, StatusType.info, error);\n };\n Logger.prototype.warn = function (message, messageContext, error) {\n this.log(message, messageContext, StatusType.warn, error);\n };\n Logger.prototype.error = function (message, messageContext, error) {\n this.log(message, messageContext, StatusType.error, error);\n };\n Logger.prototype.setContext = function (context) {\n this.contextManager.setContext(context);\n };\n Logger.prototype.getContext = function () {\n return this.contextManager.getContext();\n };\n Logger.prototype.setContextProperty = function (key, value) {\n this.contextManager.setContextProperty(key, value);\n };\n Logger.prototype.removeContextProperty = function (key) {\n this.contextManager.removeContextProperty(key);\n };\n Logger.prototype.clearContext = function () {\n this.contextManager.clearContext();\n };\n Logger.prototype.setHandler = function (handler) {\n this.handlerType = handler;\n };\n Logger.prototype.getHandler = function () {\n return this.handlerType;\n };\n Logger.prototype.setLevel = function (level) {\n this.level = level;\n };\n Logger.prototype.getLevel = function () {\n return this.level;\n };\n __decorate([\n monitored\n ], Logger.prototype, \"log\", null);\n return Logger;\n}());\nexport { Logger };\n//# sourceMappingURL=logger.js.map","export function buildCommonContext(globalContextManager, userContextManager) {\n return {\n view: {\n referrer: document.referrer,\n url: window.location.href,\n },\n context: globalContextManager.getContext(),\n user: userContextManager.getContext(),\n };\n}\n//# sourceMappingURL=commonContext.js.map","import { arrayFrom } from './polyfills';\nexport function removeDuplicates(array) {\n var set = new Set();\n array.forEach(function (item) { return set.add(item); });\n return arrayFrom(set);\n}\nexport function removeItem(array, item) {\n var index = array.indexOf(item);\n if (index >= 0) {\n array.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrayUtils.js.map","import { removeItem } from './utils/arrayUtils';\nvar BUFFER_LIMIT = 500;\nvar BoundedBuffer = /** @class */ (function () {\n function BoundedBuffer() {\n this.buffer = [];\n }\n BoundedBuffer.prototype.add = function (callback) {\n var length = this.buffer.push(callback);\n if (length > BUFFER_LIMIT) {\n this.buffer.splice(0, 1);\n }\n };\n BoundedBuffer.prototype.remove = function (callback) {\n removeItem(this.buffer, callback);\n };\n BoundedBuffer.prototype.drain = function (arg) {\n this.buffer.forEach(function (callback) { return callback(arg); });\n this.buffer.length = 0;\n };\n return BoundedBuffer;\n}());\nexport { BoundedBuffer };\n//# sourceMappingURL=boundedBuffer.js.map","import { endsWith, includes } from '../tools/utils/polyfills';\nimport { getGlobalObject } from '../tools/getGlobalObject';\nexport function getEventBridge() {\n var eventBridgeGlobal = getEventBridgeGlobal();\n if (!eventBridgeGlobal) {\n return;\n }\n return {\n getCapabilities: function () {\n var _a;\n return JSON.parse(((_a = eventBridgeGlobal.getCapabilities) === null || _a === void 0 ? void 0 : _a.call(eventBridgeGlobal)) || '[]');\n },\n getPrivacyLevel: function () {\n var _a;\n return (_a = eventBridgeGlobal.getPrivacyLevel) === null || _a === void 0 ? void 0 : _a.call(eventBridgeGlobal);\n },\n getAllowedWebViewHosts: function () {\n return JSON.parse(eventBridgeGlobal.getAllowedWebViewHosts());\n },\n send: function (eventType, event, viewId) {\n var view = viewId ? { id: viewId } : undefined;\n eventBridgeGlobal.send(JSON.stringify({ eventType: eventType, event: event, view: view }));\n },\n };\n}\nexport function bridgeSupports(capability) {\n var bridge = getEventBridge();\n return !!bridge && includes(bridge.getCapabilities(), capability);\n}\nexport function canUseEventBridge(currentHost) {\n var _a;\n if (currentHost === void 0) { currentHost = (_a = getGlobalObject().location) === null || _a === void 0 ? void 0 : _a.hostname; }\n var bridge = getEventBridge();\n return (!!bridge &&\n bridge\n .getAllowedWebViewHosts()\n .some(function (allowedHost) { return currentHost === allowedHost || endsWith(currentHost, \".\".concat(allowedHost)); }));\n}\nfunction getEventBridgeGlobal() {\n return getGlobalObject().DatadogEventBridge;\n}\n//# sourceMappingURL=eventBridge.js.map","/**\n * LIMITATION:\n * For NPM setup, this feature flag singleton is shared between RUM and Logs product.\n * This means that an experimental flag set on the RUM product will be set on the Logs product.\n * So keep in mind that in certain configurations, your experimental feature flag may affect other products.\n *\n * FORMAT:\n * All feature flags should be snake_cased\n */\n// We want to use a real enum (i.e. not a const enum) here, to be able to check whether an arbitrary\n// string is an expected feature flag\n// eslint-disable-next-line no-restricted-syntax\nexport var ExperimentalFeature;\n(function (ExperimentalFeature) {\n ExperimentalFeature[\"PAGEHIDE\"] = \"pagehide\";\n ExperimentalFeature[\"FEATURE_FLAGS\"] = \"feature_flags\";\n ExperimentalFeature[\"RESOURCE_PAGE_STATES\"] = \"resource_page_states\";\n ExperimentalFeature[\"COLLECT_FLUSH_REASON\"] = \"collect_flush_reason\";\n ExperimentalFeature[\"ZERO_LCP_TELEMETRY\"] = \"zero_lcp_telemetry\";\n ExperimentalFeature[\"DISABLE_REPLAY_INLINE_CSS\"] = \"disable_replay_inline_css\";\n ExperimentalFeature[\"WRITABLE_RESOURCE_GRAPHQL\"] = \"writable_resource_graphql\";\n ExperimentalFeature[\"CUSTOM_VITALS\"] = \"custom_vitals\";\n})(ExperimentalFeature || (ExperimentalFeature = {}));\nvar enabledExperimentalFeatures = new Set();\nexport function addExperimentalFeatures(enabledFeatures) {\n enabledFeatures.forEach(function (flag) {\n enabledExperimentalFeatures.add(flag);\n });\n}\nexport function isExperimentalFeatureEnabled(featureName) {\n return enabledExperimentalFeatures.has(featureName);\n}\nexport function resetExperimentalFeatures() {\n enabledExperimentalFeatures.clear();\n}\nexport function getExperimentalFeatures() {\n return enabledExperimentalFeatures;\n}\n//# sourceMappingURL=experimentalFeatures.js.map","/**\n * Return true if the draw is successful\n * @param threshold between 0 and 100\n */\nexport function performDraw(threshold) {\n return threshold !== 0 && Math.random() * 100 <= threshold;\n}\nexport function round(num, decimals) {\n return +num.toFixed(decimals);\n}\nexport function isPercentage(value) {\n return isNumber(value) && value >= 0 && value <= 100;\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\n//# sourceMappingURL=numberUtils.js.map","/**\n * UUID v4\n * from https://gist.github.com/jed/982883\n */\nexport function generateUUID(placeholder) {\n return placeholder\n ? // eslint-disable-next-line no-bitwise\n (parseInt(placeholder, 10) ^ ((Math.random() * 16) >> (parseInt(placeholder, 10) / 4))).toString(16)\n : \"\".concat(1e7, \"-\").concat(1e3, \"-\").concat(4e3, \"-\").concat(8e3, \"-\").concat(1e11).replace(/[018]/g, generateUUID);\n}\nvar COMMA_SEPARATED_KEY_VALUE = /([\\w-]+)\\s*=\\s*([^;]+)/g;\nexport function findCommaSeparatedValue(rawString, name) {\n COMMA_SEPARATED_KEY_VALUE.lastIndex = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var match = COMMA_SEPARATED_KEY_VALUE.exec(rawString);\n if (match) {\n if (match[1] === name) {\n return match[2];\n }\n }\n else {\n break;\n }\n }\n}\nexport function findCommaSeparatedValues(rawString) {\n var result = new Map();\n COMMA_SEPARATED_KEY_VALUE.lastIndex = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var match = COMMA_SEPARATED_KEY_VALUE.exec(rawString);\n if (match) {\n result.set(match[1], match[2]);\n }\n else {\n break;\n }\n }\n return result;\n}\nexport function safeTruncate(candidate, length, suffix) {\n if (suffix === void 0) { suffix = ''; }\n var lastChar = candidate.charCodeAt(length - 1);\n var isLastCharSurrogatePair = lastChar >= 0xd800 && lastChar <= 0xdbff;\n var correctedLength = isLastCharSurrogatePair ? length + 1 : length;\n if (candidate.length <= correctedLength) {\n return candidate;\n }\n return \"\".concat(candidate.slice(0, correctedLength)).concat(suffix);\n}\n//# sourceMappingURL=stringUtils.js.map","import { ONE_HOUR, ONE_MINUTE } from '../../tools/utils/timeUtils';\nexport var SESSION_TIME_OUT_DELAY = 4 * ONE_HOUR;\nexport var SESSION_EXPIRATION_DELAY = 15 * ONE_MINUTE;\n//# sourceMappingURL=sessionConstants.js.map","export function isIE() {\n return detectBrowserCached() === 0 /* Browser.IE */;\n}\nexport function isChromium() {\n return detectBrowserCached() === 1 /* Browser.CHROMIUM */;\n}\nexport function isSafari() {\n return detectBrowserCached() === 2 /* Browser.SAFARI */;\n}\nvar browserCache;\nfunction detectBrowserCached() {\n return browserCache !== null && browserCache !== void 0 ? browserCache : (browserCache = detectBrowser());\n}\n// Exported only for tests\nexport function detectBrowser(browserWindow) {\n var _a;\n if (browserWindow === void 0) { browserWindow = window; }\n var userAgent = browserWindow.navigator.userAgent;\n if (browserWindow.chrome || /HeadlessChrome/.test(userAgent)) {\n return 1 /* Browser.CHROMIUM */;\n }\n if (\n // navigator.vendor is deprecated, but it is the most resilient way we found to detect\n // \"Apple maintained browsers\" (AKA Safari). If one day it gets removed, we still have the\n // useragent test as a semi-working fallback.\n ((_a = browserWindow.navigator.vendor) === null || _a === void 0 ? void 0 : _a.indexOf('Apple')) === 0 ||\n (/safari/i.test(userAgent) && !/chrome|android/i.test(userAgent))) {\n return 2 /* Browser.SAFARI */;\n }\n if (browserWindow.document.documentMode) {\n return 0 /* Browser.IE */;\n }\n return 3 /* Browser.OTHER */;\n}\n//# sourceMappingURL=browserDetection.js.map","import { display } from '../tools/display';\nimport { ONE_MINUTE, ONE_SECOND } from '../tools/utils/timeUtils';\nimport { findCommaSeparatedValue, findCommaSeparatedValues, generateUUID } from '../tools/utils/stringUtils';\nexport function setCookie(name, value, expireDelay, options) {\n var date = new Date();\n date.setTime(date.getTime() + expireDelay);\n var expires = \"expires=\".concat(date.toUTCString());\n var sameSite = options && options.crossSite ? 'none' : 'strict';\n var domain = options && options.domain ? \";domain=\".concat(options.domain) : '';\n var secure = options && options.secure ? ';secure' : '';\n var partitioned = options && options.partitioned ? ';partitioned' : '';\n document.cookie = \"\".concat(name, \"=\").concat(value, \";\").concat(expires, \";path=/;samesite=\").concat(sameSite).concat(domain).concat(secure).concat(partitioned);\n}\nexport function getCookie(name) {\n return findCommaSeparatedValue(document.cookie, name);\n}\nvar initCookieParsed;\n/**\n * Returns a cached value of the cookie. Use this during SDK initialization (and whenever possible)\n * to avoid accessing document.cookie multiple times.\n */\nexport function getInitCookie(name) {\n if (!initCookieParsed) {\n initCookieParsed = findCommaSeparatedValues(document.cookie);\n }\n return initCookieParsed.get(name);\n}\nexport function resetInitCookies() {\n initCookieParsed = undefined;\n}\nexport function deleteCookie(name, options) {\n setCookie(name, '', 0, options);\n}\nexport function areCookiesAuthorized(options) {\n if (document.cookie === undefined || document.cookie === null) {\n return false;\n }\n try {\n // Use a unique cookie name to avoid issues when the SDK is initialized multiple times during\n // the test cookie lifetime\n var testCookieName = \"dd_cookie_test_\".concat(generateUUID());\n var testCookieValue = 'test';\n setCookie(testCookieName, testCookieValue, ONE_MINUTE, options);\n var isCookieCorrectlySet = getCookie(testCookieName) === testCookieValue;\n deleteCookie(testCookieName, options);\n return isCookieCorrectlySet;\n }\n catch (error) {\n display.error(error);\n return false;\n }\n}\n/**\n * No API to retrieve it, number of levels for subdomain and suffix are unknown\n * strategy: find the minimal domain on which cookies are allowed to be set\n * https://web.dev/same-site-same-origin/#site\n */\nvar getCurrentSiteCache;\nexport function getCurrentSite() {\n if (getCurrentSiteCache === undefined) {\n // Use a unique cookie name to avoid issues when the SDK is initialized multiple times during\n // the test cookie lifetime\n var testCookieName = \"dd_site_test_\".concat(generateUUID());\n var testCookieValue = 'test';\n var domainLevels = window.location.hostname.split('.');\n var candidateDomain = domainLevels.pop();\n while (domainLevels.length && !getCookie(testCookieName)) {\n candidateDomain = \"\".concat(domainLevels.pop(), \".\").concat(candidateDomain);\n setCookie(testCookieName, testCookieValue, ONE_SECOND, { domain: candidateDomain });\n }\n deleteCookie(testCookieName, { domain: candidateDomain });\n getCurrentSiteCache = candidateDomain;\n }\n return getCurrentSiteCache;\n}\n//# sourceMappingURL=cookie.js.map","export var SESSION_STORE_KEY = '_dd_s';\n//# sourceMappingURL=sessionStoreStrategy.js.map","import { isEmptyObject } from '../../tools/utils/objectUtils';\nimport { objectEntries } from '../../tools/utils/polyfills';\nimport { dateNow } from '../../tools/utils/timeUtils';\nimport { SESSION_EXPIRATION_DELAY } from './sessionConstants';\nvar SESSION_ENTRY_REGEXP = /^([a-z]+)=([a-z0-9-]+)$/;\nvar SESSION_ENTRY_SEPARATOR = '&';\nexport function isSessionInExpiredState(session) {\n return isEmptyObject(session);\n}\nexport function expandSessionState(session) {\n session.expire = String(dateNow() + SESSION_EXPIRATION_DELAY);\n}\nexport function toSessionString(session) {\n return objectEntries(session)\n .map(function (_a) {\n var key = _a[0], value = _a[1];\n return \"\".concat(key, \"=\").concat(value);\n })\n .join(SESSION_ENTRY_SEPARATOR);\n}\nexport function toSessionState(sessionString) {\n var session = {};\n if (isValidSessionString(sessionString)) {\n sessionString.split(SESSION_ENTRY_SEPARATOR).forEach(function (entry) {\n var matches = SESSION_ENTRY_REGEXP.exec(entry);\n if (matches !== null) {\n var key = matches[1], value = matches[2];\n session[key] = value;\n }\n });\n }\n return session;\n}\nfunction isValidSessionString(sessionString) {\n return (!!sessionString &&\n (sessionString.indexOf(SESSION_ENTRY_SEPARATOR) !== -1 || SESSION_ENTRY_REGEXP.test(sessionString)));\n}\n//# sourceMappingURL=sessionState.js.map","import { getInitCookie } from '../../browser/cookie';\nimport { SESSION_STORE_KEY } from './storeStrategies/sessionStoreStrategy';\nimport { expandSessionState, isSessionInExpiredState } from './sessionState';\nexport var OLD_SESSION_COOKIE_NAME = '_dd';\nexport var OLD_RUM_COOKIE_NAME = '_dd_r';\nexport var OLD_LOGS_COOKIE_NAME = '_dd_l';\n// duplicate values to avoid dependency issues\nexport var RUM_SESSION_KEY = 'rum';\nexport var LOGS_SESSION_KEY = 'logs';\n/**\n * This migration should remain in the codebase as long as older versions are available/live\n * to allow older sdk versions to be upgraded to newer versions without compatibility issues.\n */\nexport function tryOldCookiesMigration(cookieStoreStrategy) {\n var sessionString = getInitCookie(SESSION_STORE_KEY);\n if (!sessionString) {\n var oldSessionId = getInitCookie(OLD_SESSION_COOKIE_NAME);\n var oldRumType = getInitCookie(OLD_RUM_COOKIE_NAME);\n var oldLogsType = getInitCookie(OLD_LOGS_COOKIE_NAME);\n var session = {};\n if (oldSessionId) {\n session.id = oldSessionId;\n }\n if (oldLogsType && /^[01]$/.test(oldLogsType)) {\n session[LOGS_SESSION_KEY] = oldLogsType;\n }\n if (oldRumType && /^[012]$/.test(oldRumType)) {\n session[RUM_SESSION_KEY] = oldRumType;\n }\n if (!isSessionInExpiredState(session)) {\n expandSessionState(session);\n cookieStoreStrategy.persistSession(session);\n }\n }\n}\n//# sourceMappingURL=oldCookiesMigration.js.map","import { isChromium } from '../../../tools/utils/browserDetection';\nimport { getCurrentSite, areCookiesAuthorized, deleteCookie, getCookie, setCookie } from '../../../browser/cookie';\nimport { tryOldCookiesMigration } from '../oldCookiesMigration';\nimport { SESSION_EXPIRATION_DELAY } from '../sessionConstants';\nimport { toSessionString, toSessionState } from '../sessionState';\nimport { SESSION_STORE_KEY } from './sessionStoreStrategy';\nexport function selectCookieStrategy(initConfiguration) {\n var cookieOptions = buildCookieOptions(initConfiguration);\n return areCookiesAuthorized(cookieOptions) ? { type: 'Cookie', cookieOptions: cookieOptions } : undefined;\n}\nexport function initCookieStrategy(cookieOptions) {\n var cookieStore = {\n /**\n * Lock strategy allows mitigating issues due to concurrent access to cookie.\n * This issue concerns only chromium browsers and enabling this on firefox increases cookie write failures.\n */\n isLockEnabled: isChromium(),\n persistSession: persistSessionCookie(cookieOptions),\n retrieveSession: retrieveSessionCookie,\n clearSession: deleteSessionCookie(cookieOptions),\n };\n tryOldCookiesMigration(cookieStore);\n return cookieStore;\n}\nfunction persistSessionCookie(options) {\n return function (session) {\n setCookie(SESSION_STORE_KEY, toSessionString(session), SESSION_EXPIRATION_DELAY, options);\n };\n}\nfunction retrieveSessionCookie() {\n var sessionString = getCookie(SESSION_STORE_KEY);\n return toSessionState(sessionString);\n}\nfunction deleteSessionCookie(options) {\n return function () {\n deleteCookie(SESSION_STORE_KEY, options);\n };\n}\nexport function buildCookieOptions(initConfiguration) {\n var cookieOptions = {};\n cookieOptions.secure =\n !!initConfiguration.useSecureSessionCookie ||\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie;\n cookieOptions.crossSite =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie || !!initConfiguration.useCrossSiteSessionCookie;\n cookieOptions.partitioned = !!initConfiguration.usePartitionedCrossSiteSessionCookie;\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite();\n }\n return cookieOptions;\n}\n//# sourceMappingURL=sessionInCookie.js.map","import { generateUUID } from '../../../tools/utils/stringUtils';\nimport { toSessionString, toSessionState } from '../sessionState';\nimport { SESSION_STORE_KEY } from './sessionStoreStrategy';\nvar LOCAL_STORAGE_TEST_KEY = '_dd_test_';\nexport function selectLocalStorageStrategy() {\n try {\n var id = generateUUID();\n var testKey = \"\".concat(LOCAL_STORAGE_TEST_KEY).concat(id);\n localStorage.setItem(testKey, id);\n var retrievedId = localStorage.getItem(testKey);\n localStorage.removeItem(testKey);\n return id === retrievedId ? { type: 'LocalStorage' } : undefined;\n }\n catch (e) {\n return undefined;\n }\n}\nexport function initLocalStorageStrategy() {\n return {\n isLockEnabled: false,\n persistSession: persistInLocalStorage,\n retrieveSession: retrieveSessionFromLocalStorage,\n clearSession: clearSessionFromLocalStorage,\n };\n}\nfunction persistInLocalStorage(sessionState) {\n localStorage.setItem(SESSION_STORE_KEY, toSessionString(sessionState));\n}\nfunction retrieveSessionFromLocalStorage() {\n var sessionString = localStorage.getItem(SESSION_STORE_KEY);\n return toSessionState(sessionString);\n}\nfunction clearSessionFromLocalStorage() {\n localStorage.removeItem(SESSION_STORE_KEY);\n}\n//# sourceMappingURL=sessionInLocalStorage.js.map","import { setTimeout } from '../../tools/timer';\nimport { generateUUID } from '../../tools/utils/stringUtils';\nimport { expandSessionState, isSessionInExpiredState } from './sessionState';\nexport var LOCK_RETRY_DELAY = 10;\nexport var LOCK_MAX_TRIES = 100;\nvar bufferedOperations = [];\nvar ongoingOperations;\nexport function processSessionStoreOperations(operations, sessionStoreStrategy, numberOfRetries) {\n var _a;\n if (numberOfRetries === void 0) { numberOfRetries = 0; }\n var isLockEnabled = sessionStoreStrategy.isLockEnabled, retrieveSession = sessionStoreStrategy.retrieveSession, persistSession = sessionStoreStrategy.persistSession, clearSession = sessionStoreStrategy.clearSession;\n if (!ongoingOperations) {\n ongoingOperations = operations;\n }\n if (operations !== ongoingOperations) {\n bufferedOperations.push(operations);\n return;\n }\n if (isLockEnabled && numberOfRetries >= LOCK_MAX_TRIES) {\n next(sessionStoreStrategy);\n return;\n }\n var currentLock;\n var currentSession = retrieveSession();\n if (isLockEnabled) {\n // if someone has lock, retry later\n if (currentSession.lock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n // acquire lock\n currentLock = generateUUID();\n currentSession.lock = currentLock;\n persistSession(currentSession);\n // if lock is not acquired, retry later\n currentSession = retrieveSession();\n if (currentSession.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n }\n var processedSession = operations.process(currentSession);\n if (isLockEnabled) {\n // if lock corrupted after process, retry later\n currentSession = retrieveSession();\n if (currentSession.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n }\n if (processedSession) {\n if (isSessionInExpiredState(processedSession)) {\n clearSession();\n }\n else {\n expandSessionState(processedSession);\n persistSession(processedSession);\n }\n }\n if (isLockEnabled) {\n // correctly handle lock around expiration would require to handle this case properly at several levels\n // since we don't have evidence of lock issues around expiration, let's just not do the corruption check for it\n if (!(processedSession && isSessionInExpiredState(processedSession))) {\n // if lock corrupted after persist, retry later\n currentSession = retrieveSession();\n if (currentSession.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n delete currentSession.lock;\n persistSession(currentSession);\n processedSession = currentSession;\n }\n }\n // call after even if session is not persisted in order to perform operations on\n // up-to-date session state value => the value could have been modified by another tab\n (_a = operations.after) === null || _a === void 0 ? void 0 : _a.call(operations, processedSession || currentSession);\n next(sessionStoreStrategy);\n}\nfunction retryLater(operations, sessionStore, currentNumberOfRetries) {\n setTimeout(function () {\n processSessionStoreOperations(operations, sessionStore, currentNumberOfRetries + 1);\n }, LOCK_RETRY_DELAY);\n}\nfunction next(sessionStore) {\n ongoingOperations = undefined;\n var nextOperations = bufferedOperations.shift();\n if (nextOperations) {\n processSessionStoreOperations(nextOperations, sessionStore);\n }\n}\n//# sourceMappingURL=sessionStoreOperations.js.map","import { clearInterval, setInterval } from '../../tools/timer';\nimport { Observable } from '../../tools/observable';\nimport { ONE_SECOND, dateNow } from '../../tools/utils/timeUtils';\nimport { throttle } from '../../tools/utils/functionUtils';\nimport { generateUUID } from '../../tools/utils/stringUtils';\nimport { SESSION_TIME_OUT_DELAY } from './sessionConstants';\nimport { selectCookieStrategy, initCookieStrategy } from './storeStrategies/sessionInCookie';\nimport { initLocalStorageStrategy, selectLocalStorageStrategy } from './storeStrategies/sessionInLocalStorage';\nimport { processSessionStoreOperations } from './sessionStoreOperations';\n/**\n * Every second, the storage will be polled to check for any change that can occur\n * to the session state in another browser tab, or another window.\n * This value has been determined from our previous cookie-only implementation.\n */\nexport var STORAGE_POLL_DELAY = ONE_SECOND;\n/**\n * Checks if cookies are available as the preferred storage\n * Else, checks if LocalStorage is allowed and available\n */\nexport function selectSessionStoreStrategyType(initConfiguration) {\n var sessionStoreStrategyType = selectCookieStrategy(initConfiguration);\n if (!sessionStoreStrategyType && initConfiguration.allowFallbackToLocalStorage) {\n sessionStoreStrategyType = selectLocalStorageStrategy();\n }\n return sessionStoreStrategyType;\n}\n/**\n * Different session concepts:\n * - tracked, the session has an id and is updated along the user navigation\n * - not tracked, the session does not have an id but it is updated along the user navigation\n * - inactive, no session in store or session expired, waiting for a renew session\n */\nexport function startSessionStore(sessionStoreStrategyType, productKey, computeSessionState) {\n var renewObservable = new Observable();\n var expireObservable = new Observable();\n var sessionStoreStrategy = sessionStoreStrategyType.type === 'Cookie'\n ? initCookieStrategy(sessionStoreStrategyType.cookieOptions)\n : initLocalStorageStrategy();\n var clearSession = sessionStoreStrategy.clearSession, retrieveSession = sessionStoreStrategy.retrieveSession;\n var watchSessionTimeoutId = setInterval(watchSession, STORAGE_POLL_DELAY);\n var sessionCache = retrieveActiveSession();\n var _a = throttle(function () {\n var isTracked;\n processSessionStoreOperations({\n process: function (sessionState) {\n var synchronizedSession = synchronizeSession(sessionState);\n isTracked = expandOrRenewSessionState(synchronizedSession);\n return synchronizedSession;\n },\n after: function (sessionState) {\n if (isTracked && !hasSessionInCache()) {\n renewSessionInCache(sessionState);\n }\n sessionCache = sessionState;\n },\n }, sessionStoreStrategy);\n }, STORAGE_POLL_DELAY), throttledExpandOrRenewSession = _a.throttled, cancelExpandOrRenewSession = _a.cancel;\n function expandSession() {\n processSessionStoreOperations({\n process: function (sessionState) { return (hasSessionInCache() ? synchronizeSession(sessionState) : undefined); },\n }, sessionStoreStrategy);\n }\n /**\n * allows two behaviors:\n * - if the session is active, synchronize the session cache without updating the session store\n * - if the session is not active, clear the session store and expire the session cache\n */\n function watchSession() {\n processSessionStoreOperations({\n process: function (sessionState) { return (!isActiveSession(sessionState) ? {} : undefined); },\n after: synchronizeSession,\n }, sessionStoreStrategy);\n }\n function synchronizeSession(sessionState) {\n if (!isActiveSession(sessionState)) {\n sessionState = {};\n }\n if (hasSessionInCache()) {\n if (isSessionInCacheOutdated(sessionState)) {\n expireSessionInCache();\n }\n else {\n sessionCache = sessionState;\n }\n }\n return sessionState;\n }\n function expandOrRenewSessionState(sessionState) {\n var _a = computeSessionState(sessionState[productKey]), trackingType = _a.trackingType, isTracked = _a.isTracked;\n sessionState[productKey] = trackingType;\n if (isTracked && !sessionState.id) {\n sessionState.id = generateUUID();\n sessionState.created = String(dateNow());\n }\n return isTracked;\n }\n function hasSessionInCache() {\n return sessionCache[productKey] !== undefined;\n }\n function isSessionInCacheOutdated(sessionState) {\n return sessionCache.id !== sessionState.id || sessionCache[productKey] !== sessionState[productKey];\n }\n function expireSessionInCache() {\n sessionCache = {};\n expireObservable.notify();\n }\n function renewSessionInCache(sessionState) {\n sessionCache = sessionState;\n renewObservable.notify();\n }\n function retrieveActiveSession() {\n var session = retrieveSession();\n if (isActiveSession(session)) {\n return session;\n }\n return {};\n }\n function isActiveSession(sessionState) {\n // created and expire can be undefined for versions which was not storing them\n // these checks could be removed when older versions will not be available/live anymore\n return ((sessionState.created === undefined || dateNow() - Number(sessionState.created) < SESSION_TIME_OUT_DELAY) &&\n (sessionState.expire === undefined || dateNow() < Number(sessionState.expire)));\n }\n return {\n expandOrRenewSession: throttledExpandOrRenewSession,\n expandSession: expandSession,\n getSession: function () { return sessionCache; },\n renewObservable: renewObservable,\n expireObservable: expireObservable,\n expire: function () {\n cancelExpandOrRenewSession();\n clearSession();\n synchronizeSession({});\n },\n stop: function () {\n clearInterval(watchSessionTimeoutId);\n },\n };\n}\n//# sourceMappingURL=sessionStore.js.map","import { jsonStringify } from '../serialisation/jsonStringify';\nexport function normalizeUrl(url) {\n return buildUrl(url, location.href).href;\n}\nexport function isValidUrl(url) {\n try {\n return !!buildUrl(url);\n }\n catch (_a) {\n return false;\n }\n}\nexport function getPathName(url) {\n var pathname = buildUrl(url).pathname;\n return pathname[0] === '/' ? pathname : \"/\".concat(pathname);\n}\nexport function buildUrl(url, base) {\n var supportedURL = getSupportedUrl();\n if (supportedURL) {\n try {\n return base !== undefined ? new supportedURL(url, base) : new supportedURL(url);\n }\n catch (error) {\n throw new Error(\"Failed to construct URL: \".concat(String(error), \" \").concat(jsonStringify({ url: url, base: base })));\n }\n }\n if (base === undefined && !/:/.test(url)) {\n throw new Error(\"Invalid URL: '\".concat(url, \"'\"));\n }\n var doc = document;\n var anchorElement = doc.createElement('a');\n if (base !== undefined) {\n doc = document.implementation.createHTMLDocument('');\n var baseElement = doc.createElement('base');\n baseElement.href = base;\n doc.head.appendChild(baseElement);\n doc.body.appendChild(anchorElement);\n }\n anchorElement.href = url;\n return anchorElement;\n}\nvar originalURL = URL;\nvar isURLSupported;\nfunction getSupportedUrl() {\n if (isURLSupported === undefined) {\n try {\n var url = new originalURL('http://test/path');\n isURLSupported = url.href === 'http://test/path';\n }\n catch (_a) {\n isURLSupported = false;\n }\n }\n return isURLSupported ? originalURL : undefined;\n}\n//# sourceMappingURL=urlPolyfill.js.map","export var INTAKE_SITE_STAGING = 'datad0g.com';\nexport var INTAKE_SITE_FED_STAGING = 'dd0g-gov.com';\nexport var INTAKE_SITE_US1 = 'datadoghq.com';\nexport var INTAKE_SITE_EU1 = 'datadoghq.eu';\nexport var INTAKE_SITE_US1_FED = 'ddog-gov.com';\nexport var PCI_INTAKE_HOST_US1 = 'pci.browser-intake-datadoghq.com';\n//# sourceMappingURL=intakeSites.js.map","import { timeStampNow } from '../../tools/utils/timeUtils';\nimport { normalizeUrl } from '../../tools/utils/urlPolyfill';\nimport { ExperimentalFeature, isExperimentalFeatureEnabled } from '../../tools/experimentalFeatures';\nimport { generateUUID } from '../../tools/utils/stringUtils';\nimport { INTAKE_SITE_US1, INTAKE_SITE_FED_STAGING, PCI_INTAKE_HOST_US1 } from './intakeSites';\nexport function createEndpointBuilder(initConfiguration, trackType, configurationTags) {\n var buildUrlWithParameters = createEndpointUrlWithParametersBuilder(initConfiguration, trackType);\n return {\n build: function (api, payload) {\n var parameters = buildEndpointParameters(initConfiguration, trackType, configurationTags, api, payload);\n return buildUrlWithParameters(parameters);\n },\n urlPrefix: buildUrlWithParameters(''),\n trackType: trackType,\n };\n}\n/**\n * Create a function used to build a full endpoint url from provided parameters. The goal of this\n * function is to pre-compute some parts of the URL to avoid re-computing everything on every\n * request, as only parameters are changing.\n */\nfunction createEndpointUrlWithParametersBuilder(initConfiguration, trackType) {\n var path = \"/api/v2/\".concat(trackType);\n var proxy = initConfiguration.proxy;\n if (typeof proxy === 'string') {\n var normalizedProxyUrl_1 = normalizeUrl(proxy);\n return function (parameters) { return \"\".concat(normalizedProxyUrl_1, \"?ddforward=\").concat(encodeURIComponent(\"\".concat(path, \"?\").concat(parameters))); };\n }\n if (typeof proxy === 'function') {\n return function (parameters) { return proxy({ path: path, parameters: parameters }); };\n }\n var host = buildEndpointHost(trackType, initConfiguration);\n return function (parameters) { return \"https://\".concat(host).concat(path, \"?\").concat(parameters); };\n}\nfunction buildEndpointHost(trackType, initConfiguration) {\n var _a = initConfiguration.site, site = _a === void 0 ? INTAKE_SITE_US1 : _a, internalAnalyticsSubdomain = initConfiguration.internalAnalyticsSubdomain;\n if (trackType === 'logs' && initConfiguration.usePciIntake && site === INTAKE_SITE_US1) {\n return PCI_INTAKE_HOST_US1;\n }\n if (internalAnalyticsSubdomain && site === INTAKE_SITE_US1) {\n return \"\".concat(internalAnalyticsSubdomain, \".\").concat(INTAKE_SITE_US1);\n }\n if (site === INTAKE_SITE_FED_STAGING) {\n return \"http-intake.logs.\".concat(site);\n }\n var domainParts = site.split('.');\n var extension = domainParts.pop();\n return \"browser-intake-\".concat(domainParts.join('-'), \".\").concat(extension);\n}\n/**\n * Build parameters to be used for an intake request. Parameters should be re-built for each\n * request, as they change randomly.\n */\nfunction buildEndpointParameters(_a, trackType, configurationTags, api, _b) {\n var clientToken = _a.clientToken, internalAnalyticsSubdomain = _a.internalAnalyticsSubdomain;\n var retry = _b.retry, flushReason = _b.flushReason, encoding = _b.encoding;\n var tags = [\"sdk_version:\".concat(\"5.13.0\"), \"api:\".concat(api)].concat(configurationTags);\n if (flushReason && isExperimentalFeatureEnabled(ExperimentalFeature.COLLECT_FLUSH_REASON)) {\n tags.push(\"flush_reason:\".concat(flushReason));\n }\n if (retry) {\n tags.push(\"retry_count:\".concat(retry.count), \"retry_after:\".concat(retry.lastFailureStatus));\n }\n var parameters = [\n 'ddsource=browser',\n \"ddtags=\".concat(encodeURIComponent(tags.join(','))),\n \"dd-api-key=\".concat(clientToken),\n \"dd-evp-origin-version=\".concat(encodeURIComponent(\"5.13.0\")),\n 'dd-evp-origin=browser',\n \"dd-request-id=\".concat(generateUUID()),\n ];\n if (encoding) {\n parameters.push(\"dd-evp-encoding=\".concat(encoding));\n }\n if (trackType === 'rum') {\n parameters.push(\"batch_time=\".concat(timeStampNow()));\n }\n if (internalAnalyticsSubdomain) {\n parameters.reverse();\n }\n return parameters.join('&');\n}\n//# sourceMappingURL=endpointBuilder.js.map","import { display } from '../../tools/display';\nexport var TAG_SIZE_LIMIT = 200;\nexport function buildTags(configuration) {\n var env = configuration.env, service = configuration.service, version = configuration.version, datacenter = configuration.datacenter;\n var tags = [];\n if (env) {\n tags.push(buildTag('env', env));\n }\n if (service) {\n tags.push(buildTag('service', service));\n }\n if (version) {\n tags.push(buildTag('version', version));\n }\n if (datacenter) {\n tags.push(buildTag('datacenter', datacenter));\n }\n return tags;\n}\nvar FORBIDDEN_CHARACTERS = /[^a-z0-9_:./-]/;\nexport function buildTag(key, rawValue) {\n // See https://docs.datadoghq.com/getting_started/tagging/#defining-tags for tags syntax. Note\n // that the backend may not follow the exact same rules, so we only want to display an informal\n // warning.\n var valueSizeLimit = TAG_SIZE_LIMIT - key.length - 1;\n if (rawValue.length > valueSizeLimit || FORBIDDEN_CHARACTERS.test(rawValue)) {\n display.warn(\"\".concat(key, \" value doesn't meet tag requirements and will be sanitized\"));\n }\n // Let the backend do most of the sanitization, but still make sure multiple tags can't be crafted\n // by forging a value containing commas.\n var sanitizedValue = rawValue.replace(/,/g, '_');\n return \"\".concat(key, \":\").concat(sanitizedValue);\n}\n//# sourceMappingURL=tags.js.map","import { objectValues, assign } from '../../tools/utils/polyfills';\nimport { createEndpointBuilder } from './endpointBuilder';\nimport { buildTags } from './tags';\nimport { INTAKE_SITE_US1, PCI_INTAKE_HOST_US1 } from './intakeSites';\nexport function computeTransportConfiguration(initConfiguration) {\n var site = initConfiguration.site || INTAKE_SITE_US1;\n var tags = buildTags(initConfiguration);\n var endpointBuilders = computeEndpointBuilders(initConfiguration, tags);\n var intakeUrlPrefixes = computeIntakeUrlPrefixes(endpointBuilders, site);\n var replicaConfiguration = computeReplicaConfiguration(initConfiguration, intakeUrlPrefixes, tags);\n return assign({\n isIntakeUrl: function (url) { return intakeUrlPrefixes.some(function (intakeEndpoint) { return url.indexOf(intakeEndpoint) === 0; }); },\n replica: replicaConfiguration,\n site: site,\n }, endpointBuilders);\n}\nfunction computeEndpointBuilders(initConfiguration, tags) {\n return {\n logsEndpointBuilder: createEndpointBuilder(initConfiguration, 'logs', tags),\n rumEndpointBuilder: createEndpointBuilder(initConfiguration, 'rum', tags),\n sessionReplayEndpointBuilder: createEndpointBuilder(initConfiguration, 'replay', tags),\n };\n}\nfunction computeReplicaConfiguration(initConfiguration, intakeUrlPrefixes, tags) {\n if (!initConfiguration.replica) {\n return;\n }\n var replicaConfiguration = assign({}, initConfiguration, {\n site: INTAKE_SITE_US1,\n clientToken: initConfiguration.replica.clientToken,\n });\n var replicaEndpointBuilders = {\n logsEndpointBuilder: createEndpointBuilder(replicaConfiguration, 'logs', tags),\n rumEndpointBuilder: createEndpointBuilder(replicaConfiguration, 'rum', tags),\n };\n intakeUrlPrefixes.push.apply(intakeUrlPrefixes, objectValues(replicaEndpointBuilders).map(function (builder) { return builder.urlPrefix; }));\n return assign({ applicationId: initConfiguration.replica.applicationId }, replicaEndpointBuilders);\n}\nfunction computeIntakeUrlPrefixes(endpointBuilders, site) {\n var intakeUrlPrefixes = objectValues(endpointBuilders).map(function (builder) { return builder.urlPrefix; });\n if (site === INTAKE_SITE_US1) {\n intakeUrlPrefixes.push(\"https://\".concat(PCI_INTAKE_HOST_US1, \"/\"));\n }\n return intakeUrlPrefixes;\n}\n//# sourceMappingURL=transportConfiguration.js.map","import { catchUserErrors } from '../../tools/catchUserErrors';\nimport { display } from '../../tools/display';\nimport { ExperimentalFeature, addExperimentalFeatures } from '../../tools/experimentalFeatures';\nimport { ONE_SECOND } from '../../tools/utils/timeUtils';\nimport { isPercentage } from '../../tools/utils/numberUtils';\nimport { ONE_KIBI_BYTE } from '../../tools/utils/byteUtils';\nimport { objectHasValue } from '../../tools/utils/objectUtils';\nimport { assign } from '../../tools/utils/polyfills';\nimport { selectSessionStoreStrategyType } from '../session/sessionStore';\nimport { TrackingConsent } from '../trackingConsent';\nimport { computeTransportConfiguration } from './transportConfiguration';\nexport var DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input',\n};\nexport var TraceContextInjection = {\n ALL: 'all',\n SAMPLED: 'sampled',\n};\nexport function validateAndBuildConfiguration(initConfiguration) {\n var _a, _b, _c, _d;\n if (!initConfiguration || !initConfiguration.clientToken) {\n display.error('Client Token is not configured, we will not send any data.');\n return;\n }\n if (initConfiguration.sessionSampleRate !== undefined && !isPercentage(initConfiguration.sessionSampleRate)) {\n display.error('Session Sample Rate should be a number between 0 and 100');\n return;\n }\n if (initConfiguration.telemetrySampleRate !== undefined && !isPercentage(initConfiguration.telemetrySampleRate)) {\n display.error('Telemetry Sample Rate should be a number between 0 and 100');\n return;\n }\n if (initConfiguration.telemetryConfigurationSampleRate !== undefined &&\n !isPercentage(initConfiguration.telemetryConfigurationSampleRate)) {\n display.error('Telemetry Configuration Sample Rate should be a number between 0 and 100');\n return;\n }\n if (initConfiguration.trackingConsent !== undefined &&\n !objectHasValue(TrackingConsent, initConfiguration.trackingConsent)) {\n display.error('Tracking Consent should be either \"granted\" or \"not-granted\"');\n return;\n }\n // Set the experimental feature flags as early as possible, so we can use them in most places\n if (Array.isArray(initConfiguration.enableExperimentalFeatures)) {\n addExperimentalFeatures(initConfiguration.enableExperimentalFeatures.filter(function (flag) {\n return objectHasValue(ExperimentalFeature, flag);\n }));\n }\n return assign({\n beforeSend: initConfiguration.beforeSend && catchUserErrors(initConfiguration.beforeSend, 'beforeSend threw an error:'),\n sessionStoreStrategyType: selectSessionStoreStrategyType(initConfiguration),\n sessionSampleRate: (_a = initConfiguration.sessionSampleRate) !== null && _a !== void 0 ? _a : 100,\n telemetrySampleRate: (_b = initConfiguration.telemetrySampleRate) !== null && _b !== void 0 ? _b : 20,\n telemetryConfigurationSampleRate: (_c = initConfiguration.telemetryConfigurationSampleRate) !== null && _c !== void 0 ? _c : 5,\n service: initConfiguration.service,\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n allowUntrustedEvents: !!initConfiguration.allowUntrustedEvents,\n trackingConsent: (_d = initConfiguration.trackingConsent) !== null && _d !== void 0 ? _d : TrackingConsent.GRANTED,\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: (30 * ONE_SECOND),\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE,\n }, computeTransportConfiguration(initConfiguration));\n}\nexport function serializeConfiguration(initConfiguration) {\n return {\n session_sample_rate: initConfiguration.sessionSampleRate,\n telemetry_sample_rate: initConfiguration.telemetrySampleRate,\n telemetry_configuration_sample_rate: initConfiguration.telemetryConfigurationSampleRate,\n use_before_send: !!initConfiguration.beforeSend,\n use_cross_site_session_cookie: initConfiguration.useCrossSiteSessionCookie,\n use_partitioned_cross_site_session_cookie: initConfiguration.usePartitionedCrossSiteSessionCookie,\n use_secure_session_cookie: initConfiguration.useSecureSessionCookie,\n use_proxy: !!initConfiguration.proxy,\n silent_multiple_init: initConfiguration.silentMultipleInit,\n track_session_across_subdomains: initConfiguration.trackSessionAcrossSubdomains,\n allow_fallback_to_local_storage: !!initConfiguration.allowFallbackToLocalStorage,\n store_contexts_across_pages: !!initConfiguration.storeContextsAcrossPages,\n allow_untrusted_events: !!initConfiguration.allowUntrustedEvents,\n tracking_consent: initConfiguration.trackingConsent,\n };\n}\n//# sourceMappingURL=configuration.js.map","import { toStackTraceString } from '../error/error';\nimport { monitor } from '../../tools/monitor';\nimport { mergeObservables, Observable } from '../../tools/observable';\nimport { addEventListener, DOM_EVENT } from '../../browser/addEventListener';\nimport { includes } from '../../tools/utils/polyfills';\nimport { safeTruncate } from '../../tools/utils/stringUtils';\nexport var RawReportType = {\n intervention: 'intervention',\n deprecation: 'deprecation',\n cspViolation: 'csp_violation',\n};\nexport function initReportObservable(configuration, apis) {\n var observables = [];\n if (includes(apis, RawReportType.cspViolation)) {\n observables.push(createCspViolationReportObservable(configuration));\n }\n var reportTypes = apis.filter(function (api) { return api !== RawReportType.cspViolation; });\n if (reportTypes.length) {\n observables.push(createReportObservable(reportTypes));\n }\n return mergeObservables.apply(void 0, observables);\n}\nfunction createReportObservable(reportTypes) {\n return new Observable(function (observable) {\n if (!window.ReportingObserver) {\n return;\n }\n var handleReports = monitor(function (reports, _) {\n return reports.forEach(function (report) {\n observable.notify(buildRawReportFromReport(report));\n });\n });\n var observer = new window.ReportingObserver(handleReports, {\n types: reportTypes,\n buffered: true,\n });\n observer.observe();\n return function () {\n observer.disconnect();\n };\n });\n}\nfunction createCspViolationReportObservable(configuration) {\n return new Observable(function (observable) {\n var stop = addEventListener(configuration, document, DOM_EVENT.SECURITY_POLICY_VIOLATION, function (event) {\n observable.notify(buildRawReportFromCspViolation(event));\n }).stop;\n return stop;\n });\n}\nfunction buildRawReportFromReport(report) {\n var type = report.type, body = report.body;\n return {\n type: type,\n subtype: body.id,\n message: \"\".concat(type, \": \").concat(body.message),\n originalReport: report,\n stack: buildStack(body.id, body.message, body.sourceFile, body.lineNumber, body.columnNumber),\n };\n}\nfunction buildRawReportFromCspViolation(event) {\n var type = RawReportType.cspViolation;\n var message = \"'\".concat(event.blockedURI, \"' blocked by '\").concat(event.effectiveDirective, \"' directive\");\n return {\n type: RawReportType.cspViolation,\n subtype: event.effectiveDirective,\n message: \"\".concat(type, \": \").concat(message),\n stack: buildStack(event.effectiveDirective, event.originalPolicy\n ? \"\".concat(message, \" of the policy \\\"\").concat(safeTruncate(event.originalPolicy, 100, '...'), \"\\\"\")\n : 'no policy', event.sourceFile, event.lineNumber, event.columnNumber),\n originalReport: event,\n };\n}\nfunction buildStack(name, message, sourceFile, lineNumber, columnNumber) {\n return sourceFile\n ? toStackTraceString({\n name: name,\n message: message,\n stack: [\n {\n func: '?',\n url: sourceFile,\n line: lineNumber !== null && lineNumber !== void 0 ? lineNumber : undefined,\n column: columnNumber !== null && columnNumber !== void 0 ? columnNumber : undefined,\n },\n ],\n })\n : undefined;\n}\n//# sourceMappingURL=reportObservable.js.map","import { serializeConfiguration, assign, ONE_KIBI_BYTE, validateAndBuildConfiguration, display, removeDuplicates, ConsoleApiName, RawReportType, includes, objectValues, } from '@datadog/browser-core';\n/**\n * arbitrary value, byte precision not needed\n */\nexport var DEFAULT_REQUEST_ERROR_RESPONSE_LENGTH_LIMIT = 32 * ONE_KIBI_BYTE;\nexport function validateAndBuildLogsConfiguration(initConfiguration) {\n if (initConfiguration.usePciIntake === true && initConfiguration.site && initConfiguration.site !== 'datadoghq.com') {\n display.warn('PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.');\n }\n var baseConfiguration = validateAndBuildConfiguration(initConfiguration);\n var forwardConsoleLogs = validateAndBuildForwardOption(initConfiguration.forwardConsoleLogs, objectValues(ConsoleApiName), 'Forward Console Logs');\n var forwardReports = validateAndBuildForwardOption(initConfiguration.forwardReports, objectValues(RawReportType), 'Forward Reports');\n if (!baseConfiguration || !forwardConsoleLogs || !forwardReports) {\n return;\n }\n if (initConfiguration.forwardErrorsToLogs && !includes(forwardConsoleLogs, ConsoleApiName.error)) {\n forwardConsoleLogs.push(ConsoleApiName.error);\n }\n return assign({\n forwardErrorsToLogs: initConfiguration.forwardErrorsToLogs !== false,\n forwardConsoleLogs: forwardConsoleLogs,\n forwardReports: forwardReports,\n requestErrorResponseLengthLimit: DEFAULT_REQUEST_ERROR_RESPONSE_LENGTH_LIMIT,\n }, baseConfiguration);\n}\nexport function validateAndBuildForwardOption(option, allowedValues, label) {\n if (option === undefined) {\n return [];\n }\n if (!(option === 'all' || (Array.isArray(option) && option.every(function (api) { return includes(allowedValues, api); })))) {\n display.error(\"\".concat(label, \" should be \\\"all\\\" or an array with allowed values \\\"\").concat(allowedValues.join('\", \"'), \"\\\"\"));\n return;\n }\n return option === 'all' ? allowedValues : removeDuplicates(option);\n}\nexport function serializeLogsConfiguration(configuration) {\n var baseSerializedInitConfiguration = serializeConfiguration(configuration);\n return assign({\n forward_errors_to_logs: configuration.forwardErrorsToLogs,\n forward_console_logs: configuration.forwardConsoleLogs,\n forward_reports: configuration.forwardReports,\n use_pci_intake: configuration.usePciIntake,\n }, baseSerializedInitConfiguration);\n}\n//# sourceMappingURL=configuration.js.map","import { BoundedBuffer, assign, canUseEventBridge, display, displayAlreadyInitializedError, noop, timeStampNow, } from '@datadog/browser-core';\nimport { validateAndBuildLogsConfiguration, } from '../domain/configuration';\nexport function createPreStartStrategy(getCommonContext, trackingConsentState, doStartLogs) {\n var bufferApiCalls = new BoundedBuffer();\n var cachedInitConfiguration;\n var cachedConfiguration;\n var trackingConsentStateSubscription = trackingConsentState.observable.subscribe(tryStartLogs);\n function tryStartLogs() {\n if (!cachedConfiguration || !cachedInitConfiguration || !trackingConsentState.isGranted()) {\n return;\n }\n trackingConsentStateSubscription.unsubscribe();\n var startLogsResult = doStartLogs(cachedInitConfiguration, cachedConfiguration);\n bufferApiCalls.drain(startLogsResult);\n }\n return {\n init: function (initConfiguration) {\n if (!initConfiguration) {\n display.error('Missing configuration');\n return;\n }\n if (canUseEventBridge()) {\n initConfiguration = overrideInitConfigurationForBridge(initConfiguration);\n }\n // Expose the initial configuration regardless of initialization success.\n cachedInitConfiguration = initConfiguration;\n if (cachedConfiguration) {\n displayAlreadyInitializedError('DD_LOGS', initConfiguration);\n return;\n }\n var configuration = validateAndBuildLogsConfiguration(initConfiguration);\n if (!configuration) {\n return;\n }\n cachedConfiguration = configuration;\n trackingConsentState.tryToInit(configuration.trackingConsent);\n tryStartLogs();\n },\n get initConfiguration() {\n return cachedInitConfiguration;\n },\n getInternalContext: noop,\n handleLog: function (message, statusType, context, date) {\n if (context === void 0) { context = getCommonContext(); }\n if (date === void 0) { date = timeStampNow(); }\n bufferApiCalls.add(function (startLogsResult) { return startLogsResult.handleLog(message, statusType, context, date); });\n },\n };\n}\nfunction overrideInitConfigurationForBridge(initConfiguration) {\n return assign({}, initConfiguration, { clientToken: 'empty' });\n}\n//# sourceMappingURL=preStartLogs.js.map","import { assign, createContextManager, makePublicApi, monitor, checkUser, sanitizeUser, sanitize, createCustomerDataTrackerManager, storeContextManager, displayAlreadyInitializedError, deepClone, createTrackingConsentState, } from '@datadog/browser-core';\nimport { Logger } from '../domain/logger';\nimport { buildCommonContext } from '../domain/contexts/commonContext';\nimport { createPreStartStrategy } from './preStartLogs';\nvar LOGS_STORAGE_KEY = 'logs';\nexport function makeLogsPublicApi(startLogsImpl) {\n var customerDataTrackerManager = createCustomerDataTrackerManager();\n var globalContextManager = createContextManager(customerDataTrackerManager.getOrCreateTracker(2 /* CustomerDataType.GlobalContext */));\n var userContextManager = createContextManager(customerDataTrackerManager.getOrCreateTracker(1 /* CustomerDataType.User */));\n var trackingConsentState = createTrackingConsentState();\n function getCommonContext() {\n return buildCommonContext(globalContextManager, userContextManager);\n }\n var strategy = createPreStartStrategy(getCommonContext, trackingConsentState, function (initConfiguration, configuration) {\n if (initConfiguration.storeContextsAcrossPages) {\n storeContextManager(configuration, globalContextManager, LOGS_STORAGE_KEY, 2 /* CustomerDataType.GlobalContext */);\n storeContextManager(configuration, userContextManager, LOGS_STORAGE_KEY, 1 /* CustomerDataType.User */);\n }\n var startLogsResult = startLogsImpl(initConfiguration, configuration, getCommonContext, trackingConsentState);\n strategy = createPostStartStrategy(initConfiguration, startLogsResult);\n return startLogsResult;\n });\n var customLoggers = {};\n var mainLogger = new Logger(function () {\n var params = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n params[_i] = arguments[_i];\n }\n return strategy.handleLog.apply(strategy, params);\n }, customerDataTrackerManager.createDetachedTracker());\n return makePublicApi({\n logger: mainLogger,\n init: monitor(function (initConfiguration) { return strategy.init(initConfiguration); }),\n /**\n * Set the tracking consent of the current user.\n *\n * @param {\"granted\" | \"not-granted\"} trackingConsent The user tracking consent\n *\n * Logs will be sent only if it is set to \"granted\". This value won't be stored by the library\n * across page loads: you will need to call this method or set the appropriate `trackingConsent`\n * field in the init() method at each page load.\n *\n * If this method is called before the init() method, the provided value will take precedence\n * over the one provided as initialization parameter.\n */\n setTrackingConsent: monitor(function (trackingConsent) { return trackingConsentState.update(trackingConsent); }),\n getGlobalContext: monitor(function () { return globalContextManager.getContext(); }),\n setGlobalContext: monitor(function (context) { return globalContextManager.setContext(context); }),\n setGlobalContextProperty: monitor(function (key, value) { return globalContextManager.setContextProperty(key, value); }),\n removeGlobalContextProperty: monitor(function (key) { return globalContextManager.removeContextProperty(key); }),\n clearGlobalContext: monitor(function () { return globalContextManager.clearContext(); }),\n createLogger: monitor(function (name, conf) {\n if (conf === void 0) { conf = {}; }\n customLoggers[name] = new Logger(function () {\n var params = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n params[_i] = arguments[_i];\n }\n return strategy.handleLog.apply(strategy, params);\n }, customerDataTrackerManager.createDetachedTracker(), sanitize(name), conf.handler, conf.level, sanitize(conf.context));\n return customLoggers[name];\n }),\n getLogger: monitor(function (name) { return customLoggers[name]; }),\n getInitConfiguration: monitor(function () { return deepClone(strategy.initConfiguration); }),\n getInternalContext: monitor(function (startTime) { return strategy.getInternalContext(startTime); }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser));\n }\n }),\n getUser: monitor(function () { return userContextManager.getContext(); }),\n setUserProperty: monitor(function (key, property) {\n var _a;\n var sanitizedProperty = sanitizeUser((_a = {}, _a[key] = property, _a))[key];\n userContextManager.setContextProperty(key, sanitizedProperty);\n }),\n removeUserProperty: monitor(function (key) { return userContextManager.removeContextProperty(key); }),\n clearUser: monitor(function () { return userContextManager.clearContext(); }),\n });\n}\nfunction createPostStartStrategy(initConfiguration, startLogsResult) {\n return assign({\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DD_LOGS', initConfiguration);\n },\n initConfiguration: initConfiguration,\n }, startLogsResult);\n}\n//# sourceMappingURL=logsPublicApi.js.map","export function sendToExtension(type, payload) {\n var callback = window.__ddBrowserSdkExtensionCallback;\n if (callback) {\n callback({ type: type, payload: payload });\n }\n}\n//# sourceMappingURL=sendToExtension.js.map","import { isExperimentalFeatureEnabled, ExperimentalFeature } from '../tools/experimentalFeatures';\nimport { Observable } from '../tools/observable';\nimport { objectValues, includes } from '../tools/utils/polyfills';\nimport { noop } from '../tools/utils/functionUtils';\nimport { addEventListeners, addEventListener, DOM_EVENT } from './addEventListener';\nexport var PageExitReason = {\n HIDDEN: 'visibility_hidden',\n UNLOADING: 'before_unload',\n PAGEHIDE: 'page_hide',\n FROZEN: 'page_frozen',\n};\nexport function createPageExitObservable(configuration) {\n return new Observable(function (observable) {\n var pagehideEnabled = isExperimentalFeatureEnabled(ExperimentalFeature.PAGEHIDE);\n var stopListeners = addEventListeners(configuration, window, [DOM_EVENT.VISIBILITY_CHANGE, DOM_EVENT.FREEZE, DOM_EVENT.PAGE_HIDE], function (event) {\n if (event.type === DOM_EVENT.PAGE_HIDE && pagehideEnabled) {\n /**\n * Only event that detect page unload events while being compatible with the back/forward cache (bfcache)\n */\n observable.notify({ reason: PageExitReason.PAGEHIDE });\n }\n else if (event.type === DOM_EVENT.VISIBILITY_CHANGE && document.visibilityState === 'hidden') {\n /**\n * Only event that guarantee to fire on mobile devices when the page transitions to background state\n * (e.g. when user switches to a different application, goes to homescreen, etc), or is being unloaded.\n */\n observable.notify({ reason: PageExitReason.HIDDEN });\n }\n else if (event.type === DOM_EVENT.FREEZE) {\n /**\n * After transitioning in background a tab can be freezed to preserve resources. (cf: https://developer.chrome.com/blog/page-lifecycle-api)\n * Allow to collect events happening between hidden and frozen state.\n */\n observable.notify({ reason: PageExitReason.FROZEN });\n }\n }, { capture: true }).stop;\n var stopBeforeUnloadListener = noop;\n if (!pagehideEnabled) {\n stopBeforeUnloadListener = addEventListener(configuration, window, DOM_EVENT.BEFORE_UNLOAD, function () {\n observable.notify({ reason: PageExitReason.UNLOADING });\n }).stop;\n }\n return function () {\n stopListeners();\n stopBeforeUnloadListener();\n };\n });\n}\nexport function isPageExitReason(reason) {\n return includes(objectValues(PageExitReason), reason);\n}\n//# sourceMappingURL=pageExitObservable.js.map","import { getInitCookie } from '../../browser/cookie';\nexport var SYNTHETICS_TEST_ID_COOKIE_NAME = 'datadog-synthetics-public-id';\nexport var SYNTHETICS_RESULT_ID_COOKIE_NAME = 'datadog-synthetics-result-id';\nexport var SYNTHETICS_INJECTS_RUM_COOKIE_NAME = 'datadog-synthetics-injects-rum';\nexport function willSyntheticsInjectRum() {\n return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM || getInitCookie(SYNTHETICS_INJECTS_RUM_COOKIE_NAME));\n}\nexport function getSyntheticsTestId() {\n var value = window._DATADOG_SYNTHETICS_PUBLIC_ID || getInitCookie(SYNTHETICS_TEST_ID_COOKIE_NAME);\n return typeof value === 'string' ? value : undefined;\n}\nexport function getSyntheticsResultId() {\n var value = window._DATADOG_SYNTHETICS_RESULT_ID || getInitCookie(SYNTHETICS_RESULT_ID_COOKIE_NAME);\n return typeof value === 'string' ? value : undefined;\n}\n//# sourceMappingURL=syntheticsWorkerValues.js.map","import { setInterval, clearInterval } from './timer';\nimport { removeItem } from './utils/arrayUtils';\nimport { addDuration, relativeNow, ONE_MINUTE } from './utils/timeUtils';\nvar END_OF_TIMES = Infinity;\nexport var CLEAR_OLD_VALUES_INTERVAL = ONE_MINUTE;\n/**\n * Store and keep track of values spans. This whole class assumes that values are added in\n * chronological order (i.e. all entries have an increasing start time).\n */\nvar ValueHistory = /** @class */ (function () {\n function ValueHistory(expireDelay, maxEntries) {\n var _this = this;\n this.expireDelay = expireDelay;\n this.maxEntries = maxEntries;\n this.entries = [];\n this.clearOldValuesInterval = setInterval(function () { return _this.clearOldValues(); }, CLEAR_OLD_VALUES_INTERVAL);\n }\n /**\n * Add a value to the history associated with a start time. Returns a reference to this newly\n * added entry that can be removed or closed.\n */\n ValueHistory.prototype.add = function (value, startTime) {\n var _this = this;\n var entry = {\n value: value,\n startTime: startTime,\n endTime: END_OF_TIMES,\n remove: function () {\n removeItem(_this.entries, entry);\n },\n close: function (endTime) {\n entry.endTime = endTime;\n },\n };\n if (this.maxEntries && this.entries.length >= this.maxEntries) {\n this.entries.pop();\n }\n this.entries.unshift(entry);\n return entry;\n };\n /**\n * Return the latest value that was active during `startTime`, or the currently active value\n * if no `startTime` is provided. This method assumes that entries are not overlapping.\n */\n ValueHistory.prototype.find = function (startTime) {\n if (startTime === void 0) { startTime = END_OF_TIMES; }\n for (var _i = 0, _a = this.entries; _i < _a.length; _i++) {\n var entry = _a[_i];\n if (entry.startTime <= startTime) {\n if (startTime <= entry.endTime) {\n return entry.value;\n }\n break;\n }\n }\n };\n /**\n * Helper function to close the currently active value, if any. This method assumes that entries\n * are not overlapping.\n */\n ValueHistory.prototype.closeActive = function (endTime) {\n var latestEntry = this.entries[0];\n if (latestEntry && latestEntry.endTime === END_OF_TIMES) {\n latestEntry.close(endTime);\n }\n };\n /**\n * Return all values with an active period overlapping with the duration,\n * or all values that were active during `startTime` if no duration is provided,\n * or all currently active values if no `startTime` is provided.\n */\n ValueHistory.prototype.findAll = function (startTime, duration) {\n if (startTime === void 0) { startTime = END_OF_TIMES; }\n if (duration === void 0) { duration = 0; }\n var endTime = addDuration(startTime, duration);\n return this.entries\n .filter(function (entry) { return entry.startTime <= endTime && startTime <= entry.endTime; })\n .map(function (entry) { return entry.value; });\n };\n /**\n * Remove all entries from this collection.\n */\n ValueHistory.prototype.reset = function () {\n this.entries = [];\n };\n /**\n * Stop internal garbage collection of past entries.\n */\n ValueHistory.prototype.stop = function () {\n clearInterval(this.clearOldValuesInterval);\n };\n ValueHistory.prototype.clearOldValues = function () {\n var oldTimeThreshold = relativeNow() - this.expireDelay;\n while (this.entries.length > 0 && this.entries[this.entries.length - 1].endTime < oldTimeThreshold) {\n this.entries.pop();\n }\n };\n return ValueHistory;\n}());\nexport { ValueHistory };\n//# sourceMappingURL=valueHistory.js.map","import { Observable } from '../../tools/observable';\nimport { ValueHistory } from '../../tools/valueHistory';\nimport { relativeNow, clocksOrigin, ONE_MINUTE } from '../../tools/utils/timeUtils';\nimport { DOM_EVENT, addEventListener, addEventListeners } from '../../browser/addEventListener';\nimport { clearInterval, setInterval } from '../../tools/timer';\nimport { SESSION_TIME_OUT_DELAY } from './sessionConstants';\nimport { startSessionStore } from './sessionStore';\nexport var VISIBILITY_CHECK_DELAY = ONE_MINUTE;\nvar SESSION_CONTEXT_TIMEOUT_DELAY = SESSION_TIME_OUT_DELAY;\nvar stopCallbacks = [];\nexport function startSessionManager(configuration, productKey, computeSessionState, trackingConsentState) {\n var renewObservable = new Observable();\n var expireObservable = new Observable();\n // TODO - Improve configuration type and remove assertion\n var sessionStore = startSessionStore(configuration.sessionStoreStrategyType, productKey, computeSessionState);\n stopCallbacks.push(function () { return sessionStore.stop(); });\n var sessionContextHistory = new ValueHistory(SESSION_CONTEXT_TIMEOUT_DELAY);\n stopCallbacks.push(function () { return sessionContextHistory.stop(); });\n sessionStore.renewObservable.subscribe(function () {\n sessionContextHistory.add(buildSessionContext(), relativeNow());\n renewObservable.notify();\n });\n sessionStore.expireObservable.subscribe(function () {\n expireObservable.notify();\n sessionContextHistory.closeActive(relativeNow());\n });\n // We expand/renew session unconditionally as tracking consent is always granted when the session\n // manager is started.\n sessionStore.expandOrRenewSession();\n sessionContextHistory.add(buildSessionContext(), clocksOrigin().relative);\n trackingConsentState.observable.subscribe(function () {\n if (trackingConsentState.isGranted()) {\n sessionStore.expandOrRenewSession();\n }\n else {\n sessionStore.expire();\n }\n });\n trackActivity(configuration, function () {\n if (trackingConsentState.isGranted()) {\n sessionStore.expandOrRenewSession();\n }\n });\n trackVisibility(configuration, function () { return sessionStore.expandSession(); });\n function buildSessionContext() {\n return {\n id: sessionStore.getSession().id,\n trackingType: sessionStore.getSession()[productKey],\n };\n }\n return {\n findActiveSession: function (startTime) { return sessionContextHistory.find(startTime); },\n renewObservable: renewObservable,\n expireObservable: expireObservable,\n expire: sessionStore.expire,\n };\n}\nexport function stopSessionManager() {\n stopCallbacks.forEach(function (e) { return e(); });\n stopCallbacks = [];\n}\nfunction trackActivity(configuration, expandOrRenewSession) {\n var stop = addEventListeners(configuration, window, [DOM_EVENT.CLICK, DOM_EVENT.TOUCH_START, DOM_EVENT.KEY_DOWN, DOM_EVENT.SCROLL], expandOrRenewSession, { capture: true, passive: true }).stop;\n stopCallbacks.push(stop);\n}\nfunction trackVisibility(configuration, expandSession) {\n var expandSessionWhenVisible = function () {\n if (document.visibilityState === 'visible') {\n expandSession();\n }\n };\n var stop = addEventListener(configuration, document, DOM_EVENT.VISIBILITY_CHANGE, expandSessionWhenVisible).stop;\n stopCallbacks.push(stop);\n var visibilityCheckInterval = setInterval(expandSessionWhenVisible, VISIBILITY_CHECK_DELAY);\n stopCallbacks.push(function () {\n clearInterval(visibilityCheckInterval);\n });\n}\n//# sourceMappingURL=sessionManager.js.map","import { Observable, performDraw, startSessionManager } from '@datadog/browser-core';\nexport var LOGS_SESSION_KEY = 'logs';\nexport function startLogsSessionManager(configuration, trackingConsentState) {\n var sessionManager = startSessionManager(configuration, LOGS_SESSION_KEY, function (rawTrackingType) { return computeSessionState(configuration, rawTrackingType); }, trackingConsentState);\n return {\n findTrackedSession: function (startTime) {\n var session = sessionManager.findActiveSession(startTime);\n return session && session.trackingType === \"1\" /* LoggerTrackingType.TRACKED */\n ? {\n id: session.id,\n }\n : undefined;\n },\n expireObservable: sessionManager.expireObservable,\n };\n}\nexport function startLogsSessionManagerStub(configuration) {\n var isTracked = computeTrackingType(configuration) === \"1\" /* LoggerTrackingType.TRACKED */;\n var session = isTracked ? {} : undefined;\n return {\n findTrackedSession: function () { return session; },\n expireObservable: new Observable(),\n };\n}\nfunction computeTrackingType(configuration) {\n if (!performDraw(configuration.sessionSampleRate)) {\n return \"0\" /* LoggerTrackingType.NOT_TRACKED */;\n }\n return \"1\" /* LoggerTrackingType.TRACKED */;\n}\nfunction computeSessionState(configuration, rawSessionType) {\n var trackingType = hasValidLoggerSession(rawSessionType) ? rawSessionType : computeTrackingType(configuration);\n return {\n trackingType: trackingType,\n isTracked: trackingType === \"1\" /* LoggerTrackingType.TRACKED */,\n };\n}\nfunction hasValidLoggerSession(trackingType) {\n return trackingType === \"0\" /* LoggerTrackingType.NOT_TRACKED */ || trackingType === \"1\" /* LoggerTrackingType.TRACKED */;\n}\n//# sourceMappingURL=logsSessionManager.js.map","import { setTimeout } from '../../tools/timer';\nimport { clocksNow, ONE_MINUTE } from '../../tools/utils/timeUtils';\nimport { ErrorSource } from '../error/error.types';\nexport function createEventRateLimiter(eventType, limit, onLimitReached) {\n var eventCount = 0;\n var allowNextEvent = false;\n return {\n isLimitReached: function () {\n if (eventCount === 0) {\n setTimeout(function () {\n eventCount = 0;\n }, ONE_MINUTE);\n }\n eventCount += 1;\n if (eventCount <= limit || allowNextEvent) {\n allowNextEvent = false;\n return false;\n }\n if (eventCount === limit + 1) {\n allowNextEvent = true;\n try {\n onLimitReached({\n message: \"Reached max number of \".concat(eventType, \"s by minute: \").concat(limit),\n source: ErrorSource.AGENT,\n startClocks: clocksNow(),\n });\n }\n finally {\n allowNextEvent = false;\n }\n }\n return true;\n },\n };\n}\n//# sourceMappingURL=createEventRateLimiter.js.map","export function getConnectivity() {\n var _a;\n var navigator = window.navigator;\n return {\n status: navigator.onLine ? 'connected' : 'not_connected',\n interfaces: navigator.connection && navigator.connection.type ? [navigator.connection.type] : undefined,\n effective_type: (_a = navigator.connection) === null || _a === void 0 ? void 0 : _a.effectiveType,\n };\n}\n//# sourceMappingURL=connectivity.js.map","export var TelemetryType = {\n log: 'log',\n configuration: 'configuration',\n};\n//# sourceMappingURL=rawTelemetryEvent.types.js.map","import { ConsoleApiName } from '../../tools/display';\nimport { toStackTraceString, NO_ERROR_STACK_PRESENT_MESSAGE } from '../error/error';\nimport { getExperimentalFeatures } from '../../tools/experimentalFeatures';\nimport { INTAKE_SITE_STAGING, INTAKE_SITE_US1_FED } from '../configuration';\nimport { Observable } from '../../tools/observable';\nimport { timeStampNow } from '../../tools/utils/timeUtils';\nimport { displayIfDebugEnabled, startMonitorErrorCollection } from '../../tools/monitor';\nimport { sendToExtension } from '../../tools/sendToExtension';\nimport { startsWith, arrayFrom, includes, assign } from '../../tools/utils/polyfills';\nimport { performDraw } from '../../tools/utils/numberUtils';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nimport { combine } from '../../tools/mergeInto';\nimport { computeStackTrace } from '../error/computeStackTrace';\nimport { getConnectivity } from '../connectivity';\nimport { TelemetryType } from './rawTelemetryEvent.types';\nvar ALLOWED_FRAME_URLS = [\n 'https://www.datadoghq-browser-agent.com',\n 'https://www.datad0g-browser-agent.com',\n 'https://d3uc069fcn7uxw.cloudfront.net',\n 'https://d20xtzwzcl0ceb.cloudfront.net',\n 'http://localhost',\n '',\n];\nvar TELEMETRY_EXCLUDED_SITES = [INTAKE_SITE_US1_FED];\nvar telemetryConfiguration = { maxEventsPerPage: 0, sentEventCount: 0, telemetryEnabled: false, telemetryConfigurationEnabled: false };\nvar onRawTelemetryEventCollected;\nexport function startTelemetry(telemetryService, configuration) {\n var contextProvider;\n var observable = new Observable();\n telemetryConfiguration.telemetryEnabled =\n !includes(TELEMETRY_EXCLUDED_SITES, configuration.site) && performDraw(configuration.telemetrySampleRate);\n telemetryConfiguration.telemetryConfigurationEnabled =\n telemetryConfiguration.telemetryEnabled && performDraw(configuration.telemetryConfigurationSampleRate);\n var runtimeEnvInfo = getRuntimeEnvInfo();\n onRawTelemetryEventCollected = function (rawEvent) {\n if (telemetryConfiguration.telemetryEnabled) {\n var event_1 = toTelemetryEvent(telemetryService, rawEvent, runtimeEnvInfo);\n observable.notify(event_1);\n sendToExtension('telemetry', event_1);\n }\n };\n startMonitorErrorCollection(addTelemetryError);\n assign(telemetryConfiguration, {\n maxEventsPerPage: configuration.maxTelemetryEventsPerPage,\n sentEventCount: 0,\n });\n function toTelemetryEvent(telemetryService, event, runtimeEnvInfo) {\n return combine({\n type: 'telemetry',\n date: timeStampNow(),\n service: telemetryService,\n version: \"5.13.0\",\n source: 'browser',\n _dd: {\n format_version: 2,\n },\n telemetry: combine(event, {\n runtime_env: runtimeEnvInfo,\n connectivity: getConnectivity(),\n }),\n experimental_features: arrayFrom(getExperimentalFeatures()),\n }, contextProvider !== undefined ? contextProvider() : {});\n }\n return {\n setContextProvider: function (provider) {\n contextProvider = provider;\n },\n observable: observable,\n enabled: telemetryConfiguration.telemetryEnabled,\n };\n}\nfunction getRuntimeEnvInfo() {\n return {\n is_local_file: window.location.protocol === 'file:',\n is_worker: 'WorkerGlobalScope' in self,\n };\n}\nexport function startFakeTelemetry() {\n var events = [];\n assign(telemetryConfiguration, {\n maxEventsPerPage: Infinity,\n sentEventCount: 0,\n });\n onRawTelemetryEventCollected = function (event) {\n events.push(event);\n };\n return events;\n}\nexport function resetTelemetry() {\n onRawTelemetryEventCollected = undefined;\n}\n/**\n * Avoid mixing telemetry events from different data centers\n * but keep replicating staging events for reliability\n */\nexport function isTelemetryReplicationAllowed(configuration) {\n return configuration.site === INTAKE_SITE_STAGING;\n}\nexport function addTelemetryDebug(message, context) {\n displayIfDebugEnabled(ConsoleApiName.debug, message, context);\n addTelemetry(assign({\n type: TelemetryType.log,\n message: message,\n status: \"debug\" /* StatusType.debug */,\n }, context));\n}\nexport function addTelemetryError(e, context) {\n addTelemetry(assign({\n type: TelemetryType.log,\n status: \"error\" /* StatusType.error */,\n }, formatError(e), context));\n}\nexport function addTelemetryConfiguration(configuration) {\n if (telemetryConfiguration.telemetryConfigurationEnabled) {\n addTelemetry({\n type: TelemetryType.configuration,\n configuration: configuration,\n });\n }\n}\nfunction addTelemetry(event) {\n if (onRawTelemetryEventCollected && telemetryConfiguration.sentEventCount < telemetryConfiguration.maxEventsPerPage) {\n telemetryConfiguration.sentEventCount += 1;\n onRawTelemetryEventCollected(event);\n }\n}\nexport function formatError(e) {\n if (e instanceof Error) {\n var stackTrace = computeStackTrace(e);\n return {\n error: {\n kind: stackTrace.name,\n stack: toStackTraceString(scrubCustomerFrames(stackTrace)),\n },\n message: stackTrace.message,\n };\n }\n return {\n error: {\n stack: NO_ERROR_STACK_PRESENT_MESSAGE,\n },\n message: \"\".concat(\"Uncaught\" /* NonErrorPrefix.UNCAUGHT */, \" \").concat(jsonStringify(e)),\n };\n}\nexport function scrubCustomerFrames(stackTrace) {\n stackTrace.stack = stackTrace.stack.filter(function (frame) { return !frame.url || ALLOWED_FRAME_URLS.some(function (allowedFrameUrl) { return startsWith(frame.url, allowedFrameUrl); }); });\n return stackTrace;\n}\n//# sourceMappingURL=telemetry.js.map","import { willSyntheticsInjectRum, addTelemetryDebug, getSyntheticsTestId, getSyntheticsResultId, } from '@datadog/browser-core';\nvar logsSentBeforeRumInjectionTelemetryAdded = false;\nexport function getRUMInternalContext(startTime) {\n var browserWindow = window;\n if (willSyntheticsInjectRum()) {\n var context = getInternalContextFromRumGlobal(browserWindow.DD_RUM_SYNTHETICS);\n if (!context && !logsSentBeforeRumInjectionTelemetryAdded) {\n logsSentBeforeRumInjectionTelemetryAdded = true;\n addTelemetryDebug('Logs sent before RUM is injected by the synthetics worker', {\n testId: getSyntheticsTestId(),\n resultId: getSyntheticsResultId(),\n });\n }\n return context;\n }\n return getInternalContextFromRumGlobal(browserWindow.DD_RUM);\n function getInternalContextFromRumGlobal(rumGlobal) {\n if (rumGlobal && rumGlobal.getInternalContext) {\n return rumGlobal.getInternalContext(startTime);\n }\n }\n}\nexport function resetRUMInternalContext() {\n logsSentBeforeRumInjectionTelemetryAdded = false;\n}\n//# sourceMappingURL=rumInternalContext.js.map","import { ErrorSource, combine, createEventRateLimiter, getRelativeTime, isEmptyObject } from '@datadog/browser-core';\nimport { STATUSES } from './logger';\nimport { getRUMInternalContext } from './contexts/rumInternalContext';\nexport function startLogsAssembly(sessionManager, configuration, lifeCycle, getCommonContext, reportError) {\n var statusWithCustom = STATUSES.concat(['custom']);\n var logRateLimiters = {};\n statusWithCustom.forEach(function (status) {\n logRateLimiters[status] = createEventRateLimiter(status, configuration.eventRateLimiterThreshold, reportError);\n });\n lifeCycle.subscribe(0 /* LifeCycleEventType.RAW_LOG_COLLECTED */, function (_a) {\n var _b, _c;\n var rawLogsEvent = _a.rawLogsEvent, _d = _a.messageContext, messageContext = _d === void 0 ? undefined : _d, _e = _a.savedCommonContext, savedCommonContext = _e === void 0 ? undefined : _e;\n var startTime = getRelativeTime(rawLogsEvent.date);\n var session = sessionManager.findTrackedSession(startTime);\n if (!session) {\n return;\n }\n var commonContext = savedCommonContext || getCommonContext();\n var log = combine({\n service: configuration.service,\n session_id: session.id,\n // Insert user first to allow overrides from global context\n usr: !isEmptyObject(commonContext.user) ? commonContext.user : undefined,\n view: commonContext.view,\n }, commonContext.context, getRUMInternalContext(startTime), rawLogsEvent, messageContext);\n if (((_b = configuration.beforeSend) === null || _b === void 0 ? void 0 : _b.call(configuration, log)) === false ||\n (log.origin !== ErrorSource.AGENT &&\n ((_c = logRateLimiters[log.status]) !== null && _c !== void 0 ? _c : logRateLimiters['custom']).isLimitReached())) {\n return;\n }\n lifeCycle.notify(1 /* LifeCycleEventType.LOG_COLLECTED */, log);\n });\n}\n//# sourceMappingURL=assembly.js.map","import { createHandlingStack, flattenErrorCauses, formatErrorMessage, toStackTraceString, tryToGetFingerprint, } from '../error/error';\nimport { mergeObservables, Observable } from '../../tools/observable';\nimport { ConsoleApiName, globalConsole } from '../../tools/display';\nimport { callMonitored } from '../../tools/monitor';\nimport { sanitize } from '../../tools/serialisation/sanitize';\nimport { find } from '../../tools/utils/polyfills';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nimport { computeStackTrace } from '../error/computeStackTrace';\nvar consoleObservablesByApi = {};\nexport function initConsoleObservable(apis) {\n var consoleObservables = apis.map(function (api) {\n if (!consoleObservablesByApi[api]) {\n consoleObservablesByApi[api] = createConsoleObservable(api);\n }\n return consoleObservablesByApi[api];\n });\n return mergeObservables.apply(void 0, consoleObservables);\n}\nexport function resetConsoleObservable() {\n consoleObservablesByApi = {};\n}\nfunction createConsoleObservable(api) {\n return new Observable(function (observable) {\n var originalConsoleApi = globalConsole[api];\n globalConsole[api] = function () {\n var params = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n params[_i] = arguments[_i];\n }\n originalConsoleApi.apply(console, params);\n var handlingStack = createHandlingStack();\n callMonitored(function () {\n observable.notify(buildConsoleLog(params, api, handlingStack));\n });\n };\n return function () {\n globalConsole[api] = originalConsoleApi;\n };\n });\n}\nfunction buildConsoleLog(params, api, handlingStack) {\n var message = params.map(function (param) { return formatConsoleParameters(param); }).join(' ');\n var stack;\n var fingerprint;\n var causes;\n if (api === ConsoleApiName.error) {\n var firstErrorParam = find(params, function (param) { return param instanceof Error; });\n stack = firstErrorParam ? toStackTraceString(computeStackTrace(firstErrorParam)) : undefined;\n fingerprint = tryToGetFingerprint(firstErrorParam);\n causes = firstErrorParam ? flattenErrorCauses(firstErrorParam, 'console') : undefined;\n }\n return {\n api: api,\n message: message,\n stack: stack,\n handlingStack: handlingStack,\n fingerprint: fingerprint,\n causes: causes,\n };\n}\nfunction formatConsoleParameters(param) {\n if (typeof param === 'string') {\n return sanitize(param);\n }\n if (param instanceof Error) {\n return formatErrorMessage(computeStackTrace(param));\n }\n return jsonStringify(sanitize(param), undefined, 2);\n}\n//# sourceMappingURL=consoleObservable.js.map","var _a;\nimport { timeStampNow, ConsoleApiName, ErrorSource, initConsoleObservable } from '@datadog/browser-core';\nimport { StatusType } from '../logger';\nexport var LogStatusForApi = (_a = {},\n _a[ConsoleApiName.log] = StatusType.info,\n _a[ConsoleApiName.debug] = StatusType.debug,\n _a[ConsoleApiName.info] = StatusType.info,\n _a[ConsoleApiName.warn] = StatusType.warn,\n _a[ConsoleApiName.error] = StatusType.error,\n _a);\nexport function startConsoleCollection(configuration, lifeCycle) {\n var consoleSubscription = initConsoleObservable(configuration.forwardConsoleLogs).subscribe(function (log) {\n lifeCycle.notify(0 /* LifeCycleEventType.RAW_LOG_COLLECTED */, {\n rawLogsEvent: {\n date: timeStampNow(),\n message: log.message,\n origin: ErrorSource.CONSOLE,\n error: log.api === ConsoleApiName.error\n ? {\n stack: log.stack,\n fingerprint: log.fingerprint,\n causes: log.causes,\n }\n : undefined,\n status: LogStatusForApi[log.api],\n },\n });\n });\n return {\n stop: function () {\n consoleSubscription.unsubscribe();\n },\n };\n}\n//# sourceMappingURL=consoleCollection.js.map","var _a;\nimport { timeStampNow, ErrorSource, RawReportType, getFileFromStackTraceString, initReportObservable, } from '@datadog/browser-core';\nimport { StatusType } from '../logger';\nvar LogStatusForReport = (_a = {},\n _a[RawReportType.cspViolation] = StatusType.error,\n _a[RawReportType.intervention] = StatusType.error,\n _a[RawReportType.deprecation] = StatusType.warn,\n _a);\nexport function startReportCollection(configuration, lifeCycle) {\n var reportSubscription = initReportObservable(configuration, configuration.forwardReports).subscribe(function (report) {\n var message = report.message;\n var status = LogStatusForReport[report.type];\n var error;\n if (status === StatusType.error) {\n error = {\n kind: report.subtype,\n stack: report.stack,\n };\n }\n else if (report.stack) {\n message += \" Found in \".concat(getFileFromStackTraceString(report.stack));\n }\n lifeCycle.notify(0 /* LifeCycleEventType.RAW_LOG_COLLECTED */, {\n rawLogsEvent: {\n date: timeStampNow(),\n message: message,\n origin: ErrorSource.REPORT,\n error: error,\n status: status,\n },\n });\n });\n return {\n stop: function () {\n reportSubscription.unsubscribe();\n },\n };\n}\n//# sourceMappingURL=reportCollection.js.map","import { setTimeout } from './timer';\nimport { callMonitored } from './monitor';\nimport { noop } from './utils/functionUtils';\nimport { arrayFrom, startsWith } from './utils/polyfills';\n/**\n * Instruments a method on a object, calling the given callback before the original method is\n * invoked. The callback receives an object with information about the method call.\n *\n * This function makes sure that we are \"good citizens\" regarding third party instrumentations: when\n * removing the instrumentation, the original method is usually restored, but if a third party\n * instrumentation was set after ours, we keep it in place and just replace our instrumentation with\n * a noop.\n *\n * Note: it is generally better to instrument methods that are \"owned\" by the object instead of ones\n * that are inherited from the prototype chain. Example:\n * * do: `instrumentMethod(Array.prototype, 'push', ...)`\n * * don't: `instrumentMethod([], 'push', ...)`\n *\n * This method is also used to set event handler properties (ex: window.onerror = ...), as it has\n * the same requirements as instrumenting a method:\n * * if the event handler is already set by a third party, we need to call it and not just blindly\n * override it.\n * * if the event handler is set by a third party after us, we need to keep it in place when\n * removing ours.\n *\n * @example\n *\n * instrumentMethod(window, 'fetch', ({ target, parameters, onPostCall }) => {\n * console.log('Before calling fetch on', target, 'with parameters', parameters)\n *\n * onPostCall((result) => {\n * console.log('After fetch calling on', target, 'with parameters', parameters, 'and result', result)\n * })\n * })\n */\nexport function instrumentMethod(targetPrototype, method, onPreCall) {\n var original = targetPrototype[method];\n if (typeof original !== 'function') {\n if (startsWith(method, 'on')) {\n original = noop;\n }\n else {\n return { stop: noop };\n }\n }\n var instrumentation = createInstrumentedMethod(original, onPreCall);\n var instrumentationWrapper = function () {\n if (typeof instrumentation !== 'function') {\n return undefined;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call\n return instrumentation.apply(this, arguments);\n };\n targetPrototype[method] = instrumentationWrapper;\n return {\n stop: function () {\n if (targetPrototype[method] === instrumentationWrapper) {\n targetPrototype[method] = original;\n }\n else {\n instrumentation = original;\n }\n },\n };\n}\nfunction createInstrumentedMethod(original, onPreCall) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return function () {\n var parameters = arrayFrom(arguments);\n var postCallCallback;\n callMonitored(onPreCall, null, [\n {\n target: this,\n parameters: parameters,\n onPostCall: function (callback) {\n postCallCallback = callback;\n },\n },\n ]);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n var result = original.apply(this, parameters);\n if (postCallCallback) {\n callMonitored(postCallCallback, null, [result]);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return result;\n };\n}\nexport function instrumentSetter(targetPrototype, property, after) {\n var originalDescriptor = Object.getOwnPropertyDescriptor(targetPrototype, property);\n if (!originalDescriptor || !originalDescriptor.set || !originalDescriptor.configurable) {\n return { stop: noop };\n }\n var stoppedInstrumentation = noop;\n var instrumentation = function (target, value) {\n // put hooked setter into event loop to avoid of set latency\n setTimeout(function () {\n if (instrumentation !== stoppedInstrumentation) {\n after(target, value);\n }\n }, 0);\n };\n var instrumentationWrapper = function (value) {\n originalDescriptor.set.call(this, value);\n instrumentation(this, value);\n };\n Object.defineProperty(targetPrototype, property, {\n set: instrumentationWrapper,\n });\n return {\n stop: function () {\n var _a;\n if (((_a = Object.getOwnPropertyDescriptor(targetPrototype, property)) === null || _a === void 0 ? void 0 : _a.set) === instrumentationWrapper) {\n Object.defineProperty(targetPrototype, property, originalDescriptor);\n }\n instrumentation = stoppedInstrumentation;\n },\n };\n}\n//# sourceMappingURL=instrumentMethod.js.map","import { instrumentMethod } from '../tools/instrumentMethod';\nimport { Observable } from '../tools/observable';\nimport { elapsed, clocksNow, timeStampNow } from '../tools/utils/timeUtils';\nimport { normalizeUrl } from '../tools/utils/urlPolyfill';\nimport { shallowClone } from '../tools/utils/objectUtils';\nimport { addEventListener } from './addEventListener';\nvar xhrObservable;\nvar xhrContexts = new WeakMap();\nexport function initXhrObservable(configuration) {\n if (!xhrObservable) {\n xhrObservable = createXhrObservable(configuration);\n }\n return xhrObservable;\n}\nfunction createXhrObservable(configuration) {\n return new Observable(function (observable) {\n var stopInstrumentingStart = instrumentMethod(XMLHttpRequest.prototype, 'open', openXhr).stop;\n var stopInstrumentingSend = instrumentMethod(XMLHttpRequest.prototype, 'send', function (call) {\n sendXhr(call, configuration, observable);\n }).stop;\n var stopInstrumentingAbort = instrumentMethod(XMLHttpRequest.prototype, 'abort', abortXhr).stop;\n return function () {\n stopInstrumentingStart();\n stopInstrumentingSend();\n stopInstrumentingAbort();\n };\n });\n}\nfunction openXhr(_a) {\n var xhr = _a.target, _b = _a.parameters, method = _b[0], url = _b[1];\n xhrContexts.set(xhr, {\n state: 'open',\n method: String(method).toUpperCase(),\n url: normalizeUrl(String(url)),\n });\n}\nfunction sendXhr(_a, configuration, observable) {\n var xhr = _a.target;\n var context = xhrContexts.get(xhr);\n if (!context) {\n return;\n }\n var startContext = context;\n startContext.state = 'start';\n startContext.startClocks = clocksNow();\n startContext.isAborted = false;\n startContext.xhr = xhr;\n var hasBeenReported = false;\n var stopInstrumentingOnReadyStateChange = instrumentMethod(xhr, 'onreadystatechange', function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n // Try to report the XHR as soon as possible, because the XHR may be mutated by the\n // application during a future event. For example, Angular is calling .abort() on\n // completed requests during an onreadystatechange event, so the status becomes '0'\n // before the request is collected.\n onEnd();\n }\n }).stop;\n var onEnd = function () {\n unsubscribeLoadEndListener();\n stopInstrumentingOnReadyStateChange();\n if (hasBeenReported) {\n return;\n }\n hasBeenReported = true;\n var completeContext = context;\n completeContext.state = 'complete';\n completeContext.duration = elapsed(startContext.startClocks.timeStamp, timeStampNow());\n completeContext.status = xhr.status;\n observable.notify(shallowClone(completeContext));\n };\n var unsubscribeLoadEndListener = addEventListener(configuration, xhr, 'loadend', onEnd).stop;\n observable.notify(startContext);\n}\nfunction abortXhr(_a) {\n var xhr = _a.target;\n var context = xhrContexts.get(xhr);\n if (context) {\n context.isAborted = true;\n }\n}\n//# sourceMappingURL=xhrObservable.js.map","import { instrumentMethod } from '../tools/instrumentMethod';\nimport { monitor } from '../tools/monitor';\nimport { Observable } from '../tools/observable';\nimport { clocksNow } from '../tools/utils/timeUtils';\nimport { normalizeUrl } from '../tools/utils/urlPolyfill';\nvar fetchObservable;\nexport function initFetchObservable() {\n if (!fetchObservable) {\n fetchObservable = createFetchObservable();\n }\n return fetchObservable;\n}\nfunction createFetchObservable() {\n return new Observable(function (observable) {\n if (!window.fetch) {\n return;\n }\n var stop = instrumentMethod(window, 'fetch', function (call) { return beforeSend(call, observable); }).stop;\n return stop;\n });\n}\nfunction beforeSend(_a, observable) {\n var parameters = _a.parameters, onPostCall = _a.onPostCall;\n var input = parameters[0], init = parameters[1];\n var methodFromParams = init && init.method;\n if (methodFromParams === undefined && input instanceof Request) {\n methodFromParams = input.method;\n }\n var method = methodFromParams !== undefined ? String(methodFromParams).toUpperCase() : 'GET';\n var url = input instanceof Request ? input.url : normalizeUrl(String(input));\n var startClocks = clocksNow();\n var context = {\n state: 'start',\n init: init,\n input: input,\n method: method,\n startClocks: startClocks,\n url: url,\n };\n observable.notify(context);\n // Those properties can be changed by observable subscribers\n parameters[0] = context.input;\n parameters[1] = context.init;\n onPostCall(function (responsePromise) { return afterSend(observable, responsePromise, context); });\n}\nfunction afterSend(observable, responsePromise, startContext) {\n var reportFetch = function (response) {\n var context = startContext;\n context.state = 'resolve';\n if ('stack' in response || response instanceof Error) {\n context.status = 0;\n context.isAborted = response instanceof DOMException && response.code === DOMException.ABORT_ERR;\n context.error = response;\n }\n else if ('status' in response) {\n context.response = response;\n context.responseType = response.type;\n context.status = response.status;\n context.isAborted = false;\n }\n observable.notify(context);\n };\n responsePromise.then(monitor(reportFetch), monitor(reportFetch));\n}\n//# sourceMappingURL=fetchObservable.js.map","export function isServerError(status) {\n return status >= 500;\n}\nexport function tryToClone(response) {\n try {\n return response.clone();\n }\n catch (e) {\n // clone can throw if the response has already been used by another instrumentation or is disturbed\n return;\n }\n}\n//# sourceMappingURL=responseUtils.js.map","import { monitor } from './monitor';\nimport { noop } from './utils/functionUtils';\n/**\n * Read bytes from a ReadableStream until at least `limit` bytes have been read (or until the end of\n * the stream). The callback is invoked with the at most `limit` bytes, and indicates that the limit\n * has been exceeded if more bytes were available.\n */\nexport function readBytesFromStream(stream, callback, options) {\n var reader = stream.getReader();\n var chunks = [];\n var readBytesCount = 0;\n readMore();\n function readMore() {\n reader.read().then(monitor(function (result) {\n if (result.done) {\n onDone();\n return;\n }\n if (options.collectStreamBody) {\n chunks.push(result.value);\n }\n readBytesCount += result.value.length;\n if (readBytesCount > options.bytesLimit) {\n onDone();\n }\n else {\n readMore();\n }\n }), monitor(function (error) { return callback(error); }));\n }\n function onDone() {\n reader.cancel().catch(\n // we don't care if cancel fails, but we still need to catch the error to avoid reporting it\n // as an unhandled rejection\n noop);\n var bytes;\n var limitExceeded;\n if (options.collectStreamBody) {\n var completeBuffer_1;\n if (chunks.length === 1) {\n // optimization: if the response is small enough to fit in a single buffer (provided by the browser), just\n // use it directly.\n completeBuffer_1 = chunks[0];\n }\n else {\n // else, we need to copy buffers into a larger buffer to concatenate them.\n completeBuffer_1 = new Uint8Array(readBytesCount);\n var offset_1 = 0;\n chunks.forEach(function (chunk) {\n completeBuffer_1.set(chunk, offset_1);\n offset_1 += chunk.length;\n });\n }\n bytes = completeBuffer_1.slice(0, options.bytesLimit);\n limitExceeded = completeBuffer_1.length > options.bytesLimit;\n }\n callback(undefined, bytes, limitExceeded);\n }\n}\n//# sourceMappingURL=readBytesFromStream.js.map","import { ErrorSource, initXhrObservable, initFetchObservable, computeStackTrace, toStackTraceString, monitor, noop, readBytesFromStream, tryToClone, isServerError, } from '@datadog/browser-core';\nimport { StatusType } from '../logger';\nexport function startNetworkErrorCollection(configuration, lifeCycle) {\n if (!configuration.forwardErrorsToLogs) {\n return { stop: noop };\n }\n var xhrSubscription = initXhrObservable(configuration).subscribe(function (context) {\n if (context.state === 'complete') {\n handleResponse(\"xhr\" /* RequestType.XHR */, context);\n }\n });\n var fetchSubscription = initFetchObservable().subscribe(function (context) {\n if (context.state === 'resolve') {\n handleResponse(\"fetch\" /* RequestType.FETCH */, context);\n }\n });\n function handleResponse(type, request) {\n if (!configuration.isIntakeUrl(request.url) && (isRejected(request) || isServerError(request.status))) {\n if ('xhr' in request) {\n computeXhrResponseData(request.xhr, configuration, onResponseDataAvailable);\n }\n else if (request.response) {\n computeFetchResponseText(request.response, configuration, onResponseDataAvailable);\n }\n else if (request.error) {\n computeFetchErrorText(request.error, configuration, onResponseDataAvailable);\n }\n }\n function onResponseDataAvailable(responseData) {\n lifeCycle.notify(0 /* LifeCycleEventType.RAW_LOG_COLLECTED */, {\n rawLogsEvent: {\n message: \"\".concat(format(type), \" error \").concat(request.method, \" \").concat(request.url),\n date: request.startClocks.timeStamp,\n error: {\n stack: responseData || 'Failed to load',\n },\n http: {\n method: request.method, // Cast resource method because of case mismatch cf issue RUMF-1152\n status_code: request.status,\n url: request.url,\n },\n status: StatusType.error,\n origin: ErrorSource.NETWORK,\n },\n });\n }\n }\n return {\n stop: function () {\n xhrSubscription.unsubscribe();\n fetchSubscription.unsubscribe();\n },\n };\n}\n// TODO: ideally, computeXhrResponseData should always call the callback with a string instead of\n// `unknown`. But to keep backward compatibility, in the case of XHR with a `responseType` different\n// than \"text\", the response data should be whatever `xhr.response` is. This is a bit confusing as\n// Logs event 'stack' is expected to be a string. This should be changed in a future major version\n// as it could be a breaking change.\nexport function computeXhrResponseData(xhr, configuration, callback) {\n if (typeof xhr.response === 'string') {\n callback(truncateResponseText(xhr.response, configuration));\n }\n else {\n callback(xhr.response);\n }\n}\nexport function computeFetchErrorText(error, configuration, callback) {\n callback(truncateResponseText(toStackTraceString(computeStackTrace(error)), configuration));\n}\nexport function computeFetchResponseText(response, configuration, callback) {\n var clonedResponse = tryToClone(response);\n if (!clonedResponse || !clonedResponse.body) {\n // if the clone failed or if the body is null, let's not try to read it.\n callback();\n }\n else if (!window.TextDecoder) {\n // If the browser doesn't support TextDecoder, let's read the whole response then truncate it.\n //\n // This should only be the case on early versions of Edge (before they migrated to Chromium).\n // Even if it could be possible to implement a workaround for the missing TextDecoder API (using\n // a Blob and FileReader), we found another issue preventing us from reading only the first\n // bytes from the response: contrary to other browsers, when reading from the cloned response,\n // if the original response gets canceled, the cloned response is also canceled and we can't\n // know about it. In the following illustration, the promise returned by `reader.read()` may\n // never be fulfilled:\n //\n // fetch('/').then((response) => {\n // const reader = response.clone().body.getReader()\n // readMore()\n // function readMore() {\n // reader.read().then(\n // (result) => {\n // if (result.done) {\n // console.log('done')\n // } else {\n // readMore()\n // }\n // },\n // () => console.log('error')\n // )\n // }\n // response.body.getReader().cancel()\n // })\n clonedResponse.text().then(monitor(function (text) { return callback(truncateResponseText(text, configuration)); }), monitor(function (error) { return callback(\"Unable to retrieve response: \".concat(error)); }));\n }\n else {\n truncateResponseStream(clonedResponse.body, configuration.requestErrorResponseLengthLimit, function (error, responseText) {\n if (error) {\n callback(\"Unable to retrieve response: \".concat(error));\n }\n else {\n callback(responseText);\n }\n });\n }\n}\nfunction isRejected(request) {\n return request.status === 0 && request.responseType !== 'opaque';\n}\nfunction truncateResponseText(responseText, configuration) {\n if (responseText.length > configuration.requestErrorResponseLengthLimit) {\n return \"\".concat(responseText.substring(0, configuration.requestErrorResponseLengthLimit), \"...\");\n }\n return responseText;\n}\nfunction format(type) {\n if (\"xhr\" /* RequestType.XHR */ === type) {\n return 'XHR';\n }\n return 'Fetch';\n}\nfunction truncateResponseStream(stream, bytesLimit, callback) {\n readBytesFromStream(stream, function (error, bytes, limitExceeded) {\n if (error) {\n callback(error);\n }\n else {\n var responseText = new TextDecoder().decode(bytes);\n if (limitExceeded) {\n responseText += '...';\n }\n callback(undefined, responseText);\n }\n }, {\n bytesLimit: bytesLimit,\n collectStreamBody: true,\n });\n}\n//# sourceMappingURL=networkErrorCollection.js.map","import { instrumentMethod } from '../../tools/instrumentMethod';\nimport { clocksNow } from '../../tools/utils/timeUtils';\nimport { computeStackTrace, computeStackTraceFromOnErrorMessage } from './computeStackTrace';\nimport { computeRawError } from './error';\nimport { ErrorSource } from './error.types';\nexport function trackRuntimeError(errorObservable) {\n var handleRuntimeError = function (stackTrace, originalError) {\n var rawError = computeRawError({\n stackTrace: stackTrace,\n originalError: originalError,\n startClocks: clocksNow(),\n nonErrorPrefix: \"Uncaught\" /* NonErrorPrefix.UNCAUGHT */,\n source: ErrorSource.SOURCE,\n handling: \"unhandled\" /* ErrorHandling.UNHANDLED */,\n });\n errorObservable.notify(rawError);\n };\n var stopInstrumentingOnError = instrumentOnError(handleRuntimeError).stop;\n var stopInstrumentingOnUnhandledRejection = instrumentUnhandledRejection(handleRuntimeError).stop;\n return {\n stop: function () {\n stopInstrumentingOnError();\n stopInstrumentingOnUnhandledRejection();\n },\n };\n}\nexport function instrumentOnError(callback) {\n return instrumentMethod(window, 'onerror', function (_a) {\n var _b = _a.parameters, messageObj = _b[0], url = _b[1], line = _b[2], column = _b[3], errorObj = _b[4];\n var stackTrace;\n if (errorObj instanceof Error) {\n stackTrace = computeStackTrace(errorObj);\n }\n else {\n stackTrace = computeStackTraceFromOnErrorMessage(messageObj, url, line, column);\n }\n callback(stackTrace, errorObj !== null && errorObj !== void 0 ? errorObj : messageObj);\n });\n}\nexport function instrumentUnhandledRejection(callback) {\n return instrumentMethod(window, 'onunhandledrejection', function (_a) {\n var e = _a.parameters[0];\n var reason = e.reason || 'Empty reason';\n var stack = computeStackTrace(reason);\n callback(stack, reason);\n });\n}\n//# sourceMappingURL=trackRuntimeError.js.map","import { noop, ErrorSource, trackRuntimeError, Observable } from '@datadog/browser-core';\nimport { StatusType } from '../logger';\nexport function startRuntimeErrorCollection(configuration, lifeCycle) {\n if (!configuration.forwardErrorsToLogs) {\n return { stop: noop };\n }\n var rawErrorObservable = new Observable();\n var stopRuntimeErrorTracking = trackRuntimeError(rawErrorObservable).stop;\n var rawErrorSubscription = rawErrorObservable.subscribe(function (rawError) {\n lifeCycle.notify(0 /* LifeCycleEventType.RAW_LOG_COLLECTED */, {\n rawLogsEvent: {\n message: rawError.message,\n date: rawError.startClocks.timeStamp,\n error: {\n kind: rawError.type,\n stack: rawError.stack,\n causes: rawError.causes,\n },\n origin: ErrorSource.SOURCE,\n status: StatusType.error,\n },\n });\n });\n return {\n stop: function () {\n stopRuntimeErrorTracking();\n rawErrorSubscription.unsubscribe();\n },\n };\n}\n//# sourceMappingURL=runtimeErrorCollection.js.map","var AbstractLifeCycle = /** @class */ (function () {\n function AbstractLifeCycle() {\n this.callbacks = {};\n }\n AbstractLifeCycle.prototype.notify = function (eventType, data) {\n var eventCallbacks = this.callbacks[eventType];\n if (eventCallbacks) {\n eventCallbacks.forEach(function (callback) { return callback(data); });\n }\n };\n AbstractLifeCycle.prototype.subscribe = function (eventType, callback) {\n var _this = this;\n if (!this.callbacks[eventType]) {\n this.callbacks[eventType] = [];\n }\n this.callbacks[eventType].push(callback);\n return {\n unsubscribe: function () {\n _this.callbacks[eventType] = _this.callbacks[eventType].filter(function (other) { return callback !== other; });\n },\n };\n };\n return AbstractLifeCycle;\n}());\nexport { AbstractLifeCycle };\n//# sourceMappingURL=abstractLifeCycle.js.map","import { AbstractLifeCycle } from '@datadog/browser-core';\nexport var LifeCycle = (AbstractLifeCycle);\n//# sourceMappingURL=lifeCycle.js.map","var _a;\nimport { includes, combine, ErrorSource, timeStampNow, originalConsoleMethods, globalConsole, } from '@datadog/browser-core';\nimport { StatusType, HandlerType } from '../logger';\nexport var STATUS_PRIORITIES = (_a = {},\n _a[StatusType.debug] = 0,\n _a[StatusType.info] = 1,\n _a[StatusType.warn] = 2,\n _a[StatusType.error] = 3,\n _a);\nexport function startLoggerCollection(lifeCycle) {\n function handleLog(logsMessage, logger, savedCommonContext, savedDate) {\n var messageContext = combine(logger.getContext(), logsMessage.context);\n if (isAuthorized(logsMessage.status, HandlerType.console, logger)) {\n displayInConsole(logsMessage, messageContext);\n }\n if (isAuthorized(logsMessage.status, HandlerType.http, logger)) {\n lifeCycle.notify(0 /* LifeCycleEventType.RAW_LOG_COLLECTED */, {\n rawLogsEvent: {\n date: savedDate || timeStampNow(),\n message: logsMessage.message,\n status: logsMessage.status,\n origin: ErrorSource.LOGGER,\n },\n messageContext: messageContext,\n savedCommonContext: savedCommonContext,\n });\n }\n }\n return {\n handleLog: handleLog,\n };\n}\nexport function isAuthorized(status, handlerType, logger) {\n var loggerHandler = logger.getHandler();\n var sanitizedHandlerType = Array.isArray(loggerHandler) ? loggerHandler : [loggerHandler];\n return (STATUS_PRIORITIES[status] >= STATUS_PRIORITIES[logger.getLevel()] && includes(sanitizedHandlerType, handlerType));\n}\nfunction displayInConsole(logsMessage, messageContext) {\n originalConsoleMethods[logsMessage.status].call(globalConsole, logsMessage.message, messageContext);\n}\n//# sourceMappingURL=loggerCollection.js.map","import { display } from '../tools/display';\nimport { objectValues } from '../tools/utils/polyfills';\nimport { isPageExitReason } from '../browser/pageExitObservable';\nimport { jsonStringify } from '../tools/serialisation/jsonStringify';\nimport { computeBytesCount } from '../tools/utils/byteUtils';\nvar Batch = /** @class */ (function () {\n function Batch(encoder, request, flushController, messageBytesLimit) {\n var _this = this;\n this.encoder = encoder;\n this.request = request;\n this.flushController = flushController;\n this.messageBytesLimit = messageBytesLimit;\n this.upsertBuffer = {};\n this.flushSubscription = this.flushController.flushObservable.subscribe(function (event) { return _this.flush(event); });\n }\n Batch.prototype.add = function (message) {\n this.addOrUpdate(message);\n };\n Batch.prototype.upsert = function (message, key) {\n this.addOrUpdate(message, key);\n };\n Batch.prototype.stop = function () {\n this.flushSubscription.unsubscribe();\n };\n Batch.prototype.flush = function (event) {\n var upsertMessages = objectValues(this.upsertBuffer).join('\\n');\n this.upsertBuffer = {};\n var isPageExit = isPageExitReason(event.reason);\n var send = isPageExit ? this.request.sendOnExit : this.request.send;\n if (isPageExit &&\n // Note: checking that the encoder is async is not strictly needed, but it's an optimization:\n // if the encoder is async we need to send two requests in some cases (one for encoded data\n // and the other for non-encoded data). But if it's not async, we don't have to worry about\n // it and always send a single request.\n this.encoder.isAsync) {\n var encoderResult = this.encoder.finishSync();\n // Send encoded messages\n if (encoderResult.outputBytesCount) {\n send(formatPayloadFromEncoder(encoderResult, event));\n }\n // Send messages that are not yet encoded at this point\n var pendingMessages = [encoderResult.pendingData, upsertMessages].filter(Boolean).join('\\n');\n if (pendingMessages) {\n send({\n data: pendingMessages,\n bytesCount: computeBytesCount(pendingMessages),\n flushReason: event.reason,\n });\n }\n }\n else {\n if (upsertMessages) {\n this.encoder.write(this.encoder.isEmpty ? upsertMessages : \"\\n\".concat(upsertMessages));\n }\n this.encoder.finish(function (encoderResult) {\n send(formatPayloadFromEncoder(encoderResult, event));\n });\n }\n };\n Batch.prototype.addOrUpdate = function (message, key) {\n var serializedMessage = jsonStringify(message);\n var estimatedMessageBytesCount = this.encoder.estimateEncodedBytesCount(serializedMessage);\n if (estimatedMessageBytesCount >= this.messageBytesLimit) {\n display.warn(\"Discarded a message whose size was bigger than the maximum allowed size \".concat(this.messageBytesLimit, \"KB.\"));\n return;\n }\n if (this.hasMessageFor(key)) {\n this.remove(key);\n }\n this.push(serializedMessage, estimatedMessageBytesCount, key);\n };\n Batch.prototype.push = function (serializedMessage, estimatedMessageBytesCount, key) {\n var _this = this;\n this.flushController.notifyBeforeAddMessage(estimatedMessageBytesCount);\n if (key !== undefined) {\n this.upsertBuffer[key] = serializedMessage;\n this.flushController.notifyAfterAddMessage();\n }\n else {\n this.encoder.write(this.encoder.isEmpty ? serializedMessage : \"\\n\".concat(serializedMessage), function (realMessageBytesCount) {\n _this.flushController.notifyAfterAddMessage(realMessageBytesCount - estimatedMessageBytesCount);\n });\n }\n };\n Batch.prototype.remove = function (key) {\n var removedMessage = this.upsertBuffer[key];\n delete this.upsertBuffer[key];\n var messageBytesCount = this.encoder.estimateEncodedBytesCount(removedMessage);\n this.flushController.notifyAfterRemoveMessage(messageBytesCount);\n };\n Batch.prototype.hasMessageFor = function (key) {\n return key !== undefined && this.upsertBuffer[key] !== undefined;\n };\n return Batch;\n}());\nexport { Batch };\nfunction formatPayloadFromEncoder(encoderResult, flushEvent) {\n var data;\n if (typeof encoderResult.output === 'string') {\n data = encoderResult.output;\n }\n else {\n data = new Blob([encoderResult.output], {\n // This will set the 'Content-Type: text/plain' header. Reasoning:\n // * The intake rejects the request if there is no content type.\n // * The browser will issue CORS preflight requests if we set it to 'application/json', which\n // could induce higher intake load (and maybe has other impacts).\n // * Also it's not quite JSON, since we are concatenating multiple JSON objects separated by\n // new lines.\n type: 'text/plain',\n });\n }\n return {\n data: data,\n bytesCount: encoderResult.outputBytesCount,\n encoding: encoderResult.encoding,\n flushReason: flushEvent.reason,\n };\n}\n//# sourceMappingURL=batch.js.map","import { setTimeout } from '../tools/timer';\nimport { clocksNow, ONE_MINUTE, ONE_SECOND } from '../tools/utils/timeUtils';\nimport { ONE_MEBI_BYTE, ONE_KIBI_BYTE } from '../tools/utils/byteUtils';\nimport { isServerError } from '../tools/utils/responseUtils';\nimport { ErrorSource } from '../domain/error/error.types';\nexport var MAX_ONGOING_BYTES_COUNT = 80 * ONE_KIBI_BYTE;\nexport var MAX_ONGOING_REQUESTS = 32;\nexport var MAX_QUEUE_BYTES_COUNT = 3 * ONE_MEBI_BYTE;\nexport var MAX_BACKOFF_TIME = ONE_MINUTE;\nexport var INITIAL_BACKOFF_TIME = ONE_SECOND;\nexport function sendWithRetryStrategy(payload, state, sendStrategy, trackType, reportError) {\n if (state.transportStatus === 0 /* TransportStatus.UP */ &&\n state.queuedPayloads.size() === 0 &&\n state.bandwidthMonitor.canHandle(payload)) {\n send(payload, state, sendStrategy, {\n onSuccess: function () { return retryQueuedPayloads(0 /* RetryReason.AFTER_SUCCESS */, state, sendStrategy, trackType, reportError); },\n onFailure: function () {\n state.queuedPayloads.enqueue(payload);\n scheduleRetry(state, sendStrategy, trackType, reportError);\n },\n });\n }\n else {\n state.queuedPayloads.enqueue(payload);\n }\n}\nfunction scheduleRetry(state, sendStrategy, trackType, reportError) {\n if (state.transportStatus !== 2 /* TransportStatus.DOWN */) {\n return;\n }\n setTimeout(function () {\n var payload = state.queuedPayloads.first();\n send(payload, state, sendStrategy, {\n onSuccess: function () {\n state.queuedPayloads.dequeue();\n state.currentBackoffTime = INITIAL_BACKOFF_TIME;\n retryQueuedPayloads(1 /* RetryReason.AFTER_RESUME */, state, sendStrategy, trackType, reportError);\n },\n onFailure: function () {\n state.currentBackoffTime = Math.min(MAX_BACKOFF_TIME, state.currentBackoffTime * 2);\n scheduleRetry(state, sendStrategy, trackType, reportError);\n },\n });\n }, state.currentBackoffTime);\n}\nfunction send(payload, state, sendStrategy, _a) {\n var onSuccess = _a.onSuccess, onFailure = _a.onFailure;\n state.bandwidthMonitor.add(payload);\n sendStrategy(payload, function (response) {\n state.bandwidthMonitor.remove(payload);\n if (!shouldRetryRequest(response)) {\n state.transportStatus = 0 /* TransportStatus.UP */;\n onSuccess();\n }\n else {\n // do not consider transport down if another ongoing request could succeed\n state.transportStatus =\n state.bandwidthMonitor.ongoingRequestCount > 0 ? 1 /* TransportStatus.FAILURE_DETECTED */ : 2 /* TransportStatus.DOWN */;\n payload.retry = {\n count: payload.retry ? payload.retry.count + 1 : 1,\n lastFailureStatus: response.status,\n };\n onFailure();\n }\n });\n}\nfunction retryQueuedPayloads(reason, state, sendStrategy, trackType, reportError) {\n if (reason === 0 /* RetryReason.AFTER_SUCCESS */ && state.queuedPayloads.isFull() && !state.queueFullReported) {\n reportError({\n message: \"Reached max \".concat(trackType, \" events size queued for upload: \").concat(MAX_QUEUE_BYTES_COUNT / ONE_MEBI_BYTE, \"MiB\"),\n source: ErrorSource.AGENT,\n startClocks: clocksNow(),\n });\n state.queueFullReported = true;\n }\n var previousQueue = state.queuedPayloads;\n state.queuedPayloads = newPayloadQueue();\n while (previousQueue.size() > 0) {\n sendWithRetryStrategy(previousQueue.dequeue(), state, sendStrategy, trackType, reportError);\n }\n}\nfunction shouldRetryRequest(response) {\n return (response.type !== 'opaque' &&\n ((response.status === 0 && !navigator.onLine) ||\n response.status === 408 ||\n response.status === 429 ||\n isServerError(response.status)));\n}\nexport function newRetryState() {\n return {\n transportStatus: 0 /* TransportStatus.UP */,\n currentBackoffTime: INITIAL_BACKOFF_TIME,\n bandwidthMonitor: newBandwidthMonitor(),\n queuedPayloads: newPayloadQueue(),\n queueFullReported: false,\n };\n}\nfunction newPayloadQueue() {\n var queue = [];\n return {\n bytesCount: 0,\n enqueue: function (payload) {\n if (this.isFull()) {\n return;\n }\n queue.push(payload);\n this.bytesCount += payload.bytesCount;\n },\n first: function () {\n return queue[0];\n },\n dequeue: function () {\n var payload = queue.shift();\n if (payload) {\n this.bytesCount -= payload.bytesCount;\n }\n return payload;\n },\n size: function () {\n return queue.length;\n },\n isFull: function () {\n return this.bytesCount >= MAX_QUEUE_BYTES_COUNT;\n },\n };\n}\nfunction newBandwidthMonitor() {\n return {\n ongoingRequestCount: 0,\n ongoingByteCount: 0,\n canHandle: function (payload) {\n return (this.ongoingRequestCount === 0 ||\n (this.ongoingByteCount + payload.bytesCount <= MAX_ONGOING_BYTES_COUNT &&\n this.ongoingRequestCount < MAX_ONGOING_REQUESTS));\n },\n add: function (payload) {\n this.ongoingRequestCount += 1;\n this.ongoingByteCount += payload.bytesCount;\n },\n remove: function (payload) {\n this.ongoingRequestCount -= 1;\n this.ongoingByteCount -= payload.bytesCount;\n },\n };\n}\n//# sourceMappingURL=sendWithRetryStrategy.js.map","import { addTelemetryError } from '../domain/telemetry';\nimport { monitor } from '../tools/monitor';\nimport { addEventListener } from '../browser/addEventListener';\nimport { newRetryState, sendWithRetryStrategy } from './sendWithRetryStrategy';\nexport function createHttpRequest(configuration, endpointBuilder, bytesLimit, reportError) {\n var retryState = newRetryState();\n var sendStrategyForRetry = function (payload, onResponse) {\n return fetchKeepAliveStrategy(configuration, endpointBuilder, bytesLimit, payload, onResponse);\n };\n return {\n send: function (payload) {\n sendWithRetryStrategy(payload, retryState, sendStrategyForRetry, endpointBuilder.trackType, reportError);\n },\n /**\n * Since fetch keepalive behaves like regular fetch on Firefox,\n * keep using sendBeaconStrategy on exit\n */\n sendOnExit: function (payload) {\n sendBeaconStrategy(configuration, endpointBuilder, bytesLimit, payload);\n },\n };\n}\nfunction sendBeaconStrategy(configuration, endpointBuilder, bytesLimit, payload) {\n var canUseBeacon = !!navigator.sendBeacon && payload.bytesCount < bytesLimit;\n if (canUseBeacon) {\n try {\n var beaconUrl = endpointBuilder.build('beacon', payload);\n var isQueued = navigator.sendBeacon(beaconUrl, payload.data);\n if (isQueued) {\n return;\n }\n }\n catch (e) {\n reportBeaconError(e);\n }\n }\n var xhrUrl = endpointBuilder.build('xhr', payload);\n sendXHR(configuration, xhrUrl, payload.data);\n}\nvar hasReportedBeaconError = false;\nfunction reportBeaconError(e) {\n if (!hasReportedBeaconError) {\n hasReportedBeaconError = true;\n addTelemetryError(e);\n }\n}\nexport function fetchKeepAliveStrategy(configuration, endpointBuilder, bytesLimit, payload, onResponse) {\n var canUseKeepAlive = isKeepAliveSupported() && payload.bytesCount < bytesLimit;\n if (canUseKeepAlive) {\n var fetchUrl = endpointBuilder.build('fetch', payload);\n fetch(fetchUrl, { method: 'POST', body: payload.data, keepalive: true, mode: 'cors' }).then(monitor(function (response) { return onResponse === null || onResponse === void 0 ? void 0 : onResponse({ status: response.status, type: response.type }); }), monitor(function () {\n var xhrUrl = endpointBuilder.build('xhr', payload);\n // failed to queue the request\n sendXHR(configuration, xhrUrl, payload.data, onResponse);\n }));\n }\n else {\n var xhrUrl = endpointBuilder.build('xhr', payload);\n sendXHR(configuration, xhrUrl, payload.data, onResponse);\n }\n}\nfunction isKeepAliveSupported() {\n // Request can throw, cf https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#errors\n try {\n return window.Request && 'keepalive' in new Request('http://a');\n }\n catch (_a) {\n return false;\n }\n}\nexport function sendXHR(configuration, url, data, onResponse) {\n var request = new XMLHttpRequest();\n request.open('POST', url, true);\n if (data instanceof Blob) {\n // When using a Blob instance, IE does not use its 'type' to define the 'Content-Type' header\n // automatically, so the intake request ends up being rejected with an HTTP status 415\n // Defining the header manually fixes this issue.\n request.setRequestHeader('Content-Type', data.type);\n }\n addEventListener(configuration, request, 'loadend', function () {\n onResponse === null || onResponse === void 0 ? void 0 : onResponse({ status: request.status });\n }, {\n // prevent multiple onResponse callbacks\n // if the xhr instance is reused by a third party\n once: true,\n });\n request.send(data);\n}\n//# sourceMappingURL=httpRequest.js.map","import { Observable } from '../tools/observable';\nimport { clearTimeout, setTimeout } from '../tools/timer';\n/**\n * Returns a \"flush controller\", responsible of notifying when flushing a pool of pending data needs\n * to happen. The implementation is designed to support both synchronous and asynchronous usages,\n * but relies on invariants described in each method documentation to keep a coherent state.\n */\nexport function createFlushController(_a) {\n var messagesLimit = _a.messagesLimit, bytesLimit = _a.bytesLimit, durationLimit = _a.durationLimit, pageExitObservable = _a.pageExitObservable, sessionExpireObservable = _a.sessionExpireObservable;\n var pageExitSubscription = pageExitObservable.subscribe(function (event) { return flush(event.reason); });\n var sessionExpireSubscription = sessionExpireObservable.subscribe(function () { return flush('session_expire'); });\n var flushObservable = new Observable(function () { return function () {\n pageExitSubscription.unsubscribe();\n sessionExpireSubscription.unsubscribe();\n }; });\n var currentBytesCount = 0;\n var currentMessagesCount = 0;\n function flush(flushReason) {\n if (currentMessagesCount === 0) {\n return;\n }\n var messagesCount = currentMessagesCount;\n var bytesCount = currentBytesCount;\n currentMessagesCount = 0;\n currentBytesCount = 0;\n cancelDurationLimitTimeout();\n flushObservable.notify({\n reason: flushReason,\n messagesCount: messagesCount,\n bytesCount: bytesCount,\n });\n }\n var durationLimitTimeoutId;\n function scheduleDurationLimitTimeout() {\n if (durationLimitTimeoutId === undefined) {\n durationLimitTimeoutId = setTimeout(function () {\n flush('duration_limit');\n }, durationLimit);\n }\n }\n function cancelDurationLimitTimeout() {\n clearTimeout(durationLimitTimeoutId);\n durationLimitTimeoutId = undefined;\n }\n return {\n flushObservable: flushObservable,\n get messagesCount() {\n return currentMessagesCount;\n },\n /**\n * Notifies that a message will be added to a pool of pending messages waiting to be flushed.\n *\n * This function needs to be called synchronously, right before adding the message, so no flush\n * event can happen after `notifyBeforeAddMessage` and before adding the message.\n *\n * @param estimatedMessageBytesCount: an estimation of the message bytes count once it is\n * actually added.\n */\n notifyBeforeAddMessage: function (estimatedMessageBytesCount) {\n if (currentBytesCount + estimatedMessageBytesCount >= bytesLimit) {\n flush('bytes_limit');\n }\n // Consider the message to be added now rather than in `notifyAfterAddMessage`, because if no\n // message was added yet and `notifyAfterAddMessage` is called asynchronously, we still want\n // to notify when a flush is needed (for example on page exit).\n currentMessagesCount += 1;\n currentBytesCount += estimatedMessageBytesCount;\n scheduleDurationLimitTimeout();\n },\n /**\n * Notifies that a message *was* added to a pool of pending messages waiting to be flushed.\n *\n * This function can be called asynchronously after the message was added, but in this case it\n * should not be called if a flush event occurred in between.\n *\n * @param messageBytesCountDiff: the difference between the estimated message bytes count and\n * its actual bytes count once added to the pool.\n */\n notifyAfterAddMessage: function (messageBytesCountDiff) {\n if (messageBytesCountDiff === void 0) { messageBytesCountDiff = 0; }\n currentBytesCount += messageBytesCountDiff;\n if (currentMessagesCount >= messagesLimit) {\n flush('messages_limit');\n }\n else if (currentBytesCount >= bytesLimit) {\n flush('bytes_limit');\n }\n },\n /**\n * Notifies that a message was removed from a pool of pending messages waiting to be flushed.\n *\n * This function needs to be called synchronously, right after removing the message, so no flush\n * event can happen after removing the message and before `notifyAfterRemoveMessage`.\n *\n * @param messageBytesCount: the message bytes count that was added to the pool. Should\n * correspond to the sum of bytes counts passed to `notifyBeforeAddMessage` and\n * `notifyAfterAddMessage`.\n */\n notifyAfterRemoveMessage: function (messageBytesCount) {\n currentBytesCount -= messageBytesCount;\n currentMessagesCount -= 1;\n if (currentMessagesCount === 0) {\n cancelDurationLimitTimeout();\n }\n },\n };\n}\n//# sourceMappingURL=flushController.js.map","import { Batch } from './batch';\nimport { createHttpRequest } from './httpRequest';\nimport { createFlushController } from './flushController';\nexport function startBatchWithReplica(configuration, primary, replica, reportError, pageExitObservable, sessionExpireObservable) {\n var primaryBatch = createBatch(configuration, primary);\n var replicaBatch = replica && createBatch(configuration, replica);\n function createBatch(configuration, _a) {\n var endpoint = _a.endpoint, encoder = _a.encoder;\n return new Batch(encoder, createHttpRequest(configuration, endpoint, configuration.batchBytesLimit, reportError), createFlushController({\n messagesLimit: configuration.batchMessagesLimit,\n bytesLimit: configuration.batchBytesLimit,\n durationLimit: configuration.flushTimeout,\n pageExitObservable: pageExitObservable,\n sessionExpireObservable: sessionExpireObservable,\n }), configuration.messageBytesLimit);\n }\n return {\n flushObservable: primaryBatch.flushController.flushObservable,\n add: function (message, replicated) {\n if (replicated === void 0) { replicated = true; }\n primaryBatch.add(message);\n if (replicaBatch && replicated) {\n replicaBatch.add(replica.transformMessage ? replica.transformMessage(message) : message);\n }\n },\n upsert: function (message, key) {\n primaryBatch.upsert(message, key);\n if (replicaBatch) {\n replicaBatch.upsert(replica.transformMessage ? replica.transformMessage(message) : message, key);\n }\n },\n stop: function () {\n primaryBatch.stop();\n replicaBatch === null || replicaBatch === void 0 ? void 0 : replicaBatch.stop();\n },\n };\n}\n//# sourceMappingURL=startBatchWithReplica.js.map","import { computeBytesCount } from './utils/byteUtils';\nexport function createIdentityEncoder() {\n var output = '';\n var outputBytesCount = 0;\n return {\n isAsync: false,\n get isEmpty() {\n return !output;\n },\n write: function (data, callback) {\n var additionalEncodedBytesCount = computeBytesCount(data);\n outputBytesCount += additionalEncodedBytesCount;\n output += data;\n if (callback) {\n callback(additionalEncodedBytesCount);\n }\n },\n finish: function (callback) {\n callback(this.finishSync());\n },\n finishSync: function () {\n var result = {\n output: output,\n outputBytesCount: outputBytesCount,\n rawBytesCount: outputBytesCount,\n pendingData: '',\n };\n output = '';\n outputBytesCount = 0;\n return result;\n },\n estimateEncodedBytesCount: function (data) {\n return data.length;\n },\n };\n}\n//# sourceMappingURL=encoder.js.map","import { createIdentityEncoder, startBatchWithReplica } from '@datadog/browser-core';\nexport function startLogsBatch(configuration, lifeCycle, reportError, pageExitObservable, session) {\n var batch = startBatchWithReplica(configuration, {\n endpoint: configuration.logsEndpointBuilder,\n encoder: createIdentityEncoder(),\n }, configuration.replica && {\n endpoint: configuration.replica.logsEndpointBuilder,\n encoder: createIdentityEncoder(),\n }, reportError, pageExitObservable, session.expireObservable);\n lifeCycle.subscribe(1 /* LifeCycleEventType.LOG_COLLECTED */, function (serverLogsEvent) {\n batch.add(serverLogsEvent);\n });\n return batch;\n}\n//# sourceMappingURL=startLogsBatch.js.map","import { getEventBridge } from '@datadog/browser-core';\nexport function startLogsBridge(lifeCycle) {\n var bridge = getEventBridge();\n lifeCycle.subscribe(1 /* LifeCycleEventType.LOG_COLLECTED */, function (serverLogsEvent) {\n bridge.send('log', serverLogsEvent);\n });\n}\n//# sourceMappingURL=startLogsBridge.js.map","export function startInternalContext(sessionManager) {\n return {\n get: function (startTime) {\n var trackedSession = sessionManager.findTrackedSession(startTime);\n if (trackedSession) {\n return {\n session_id: trackedSession.id,\n };\n }\n },\n };\n}\n//# sourceMappingURL=internalContext.js.map","import { ErrorSource, addTelemetryDebug } from '@datadog/browser-core';\nimport { StatusType } from './logger';\nexport function startReportError(lifeCycle) {\n return function (error) {\n lifeCycle.notify(0 /* LifeCycleEventType.RAW_LOG_COLLECTED */, {\n rawLogsEvent: {\n message: error.message,\n date: error.startClocks.timeStamp,\n origin: ErrorSource.AGENT,\n status: StatusType.error,\n },\n });\n addTelemetryDebug('Error reported to customer', { 'error.message': error.message });\n };\n}\n//# sourceMappingURL=reportError.js.map","import { startTelemetry, canUseEventBridge, getEventBridge, startBatchWithReplica, createIdentityEncoder, isTelemetryReplicationAllowed, addTelemetryConfiguration, } from '@datadog/browser-core';\nimport { getRUMInternalContext } from './contexts/rumInternalContext';\nimport { serializeLogsConfiguration } from './configuration';\nexport function startLogsTelemetry(initConfiguration, configuration, reportError, pageExitObservable, session) {\n var telemetry = startTelemetry(\"browser-logs-sdk\" /* TelemetryService.LOGS */, configuration);\n telemetry.setContextProvider(function () {\n var _a, _b, _c, _d, _e, _f;\n return ({\n application: {\n id: (_a = getRUMInternalContext()) === null || _a === void 0 ? void 0 : _a.application_id,\n },\n session: {\n id: (_b = session.findTrackedSession()) === null || _b === void 0 ? void 0 : _b.id,\n },\n view: {\n id: (_d = (_c = getRUMInternalContext()) === null || _c === void 0 ? void 0 : _c.view) === null || _d === void 0 ? void 0 : _d.id,\n },\n action: {\n id: (_f = (_e = getRUMInternalContext()) === null || _e === void 0 ? void 0 : _e.user_action) === null || _f === void 0 ? void 0 : _f.id,\n },\n });\n });\n var cleanupTasks = [];\n if (canUseEventBridge()) {\n var bridge_1 = getEventBridge();\n var telemetrySubscription_1 = telemetry.observable.subscribe(function (event) { return bridge_1.send('internal_telemetry', event); });\n cleanupTasks.push(function () { return telemetrySubscription_1.unsubscribe(); });\n }\n else {\n var telemetryBatch_1 = startBatchWithReplica(configuration, {\n endpoint: configuration.rumEndpointBuilder,\n encoder: createIdentityEncoder(),\n }, configuration.replica && {\n endpoint: configuration.replica.rumEndpointBuilder,\n encoder: createIdentityEncoder(),\n }, reportError, pageExitObservable, session.expireObservable);\n cleanupTasks.push(function () { return telemetryBatch_1.stop(); });\n var telemetrySubscription_2 = telemetry.observable.subscribe(function (event) {\n return telemetryBatch_1.add(event, isTelemetryReplicationAllowed(configuration));\n });\n cleanupTasks.push(function () { return telemetrySubscription_2.unsubscribe(); });\n }\n addTelemetryConfiguration(serializeLogsConfiguration(initConfiguration));\n return {\n telemetry: telemetry,\n stop: function () {\n cleanupTasks.forEach(function (task) { return task(); });\n },\n };\n}\n//# sourceMappingURL=logsTelemetry.js.map","import { sendToExtension, createPageExitObservable, willSyntheticsInjectRum, canUseEventBridge, } from '@datadog/browser-core';\nimport { startLogsSessionManager, startLogsSessionManagerStub } from '../domain/logsSessionManager';\nimport { startLogsAssembly } from '../domain/assembly';\nimport { startConsoleCollection } from '../domain/console/consoleCollection';\nimport { startReportCollection } from '../domain/report/reportCollection';\nimport { startNetworkErrorCollection } from '../domain/networkError/networkErrorCollection';\nimport { startRuntimeErrorCollection } from '../domain/runtimeError/runtimeErrorCollection';\nimport { LifeCycle } from '../domain/lifeCycle';\nimport { startLoggerCollection } from '../domain/logger/loggerCollection';\nimport { startLogsBatch } from '../transport/startLogsBatch';\nimport { startLogsBridge } from '../transport/startLogsBridge';\nimport { startInternalContext } from '../domain/contexts/internalContext';\nimport { startReportError } from '../domain/reportError';\nimport { startLogsTelemetry } from '../domain/logsTelemetry';\nexport function startLogs(initConfiguration, configuration, getCommonContext, \n// `startLogs` and its subcomponents assume tracking consent is granted initially and starts\n// collecting logs unconditionally. As such, `startLogs` should be called with a\n// `trackingConsentState` set to \"granted\".\ntrackingConsentState) {\n var lifeCycle = new LifeCycle();\n var cleanupTasks = [];\n lifeCycle.subscribe(1 /* LifeCycleEventType.LOG_COLLECTED */, function (log) { return sendToExtension('logs', log); });\n var reportError = startReportError(lifeCycle);\n var pageExitObservable = createPageExitObservable(configuration);\n var session = configuration.sessionStoreStrategyType && !canUseEventBridge() && !willSyntheticsInjectRum()\n ? startLogsSessionManager(configuration, trackingConsentState)\n : startLogsSessionManagerStub(configuration);\n var stopLogsTelemetry = startLogsTelemetry(initConfiguration, configuration, reportError, pageExitObservable, session).stop;\n cleanupTasks.push(function () { return stopLogsTelemetry(); });\n startNetworkErrorCollection(configuration, lifeCycle);\n startRuntimeErrorCollection(configuration, lifeCycle);\n startConsoleCollection(configuration, lifeCycle);\n startReportCollection(configuration, lifeCycle);\n var handleLog = startLoggerCollection(lifeCycle).handleLog;\n startLogsAssembly(session, configuration, lifeCycle, getCommonContext, reportError);\n if (!canUseEventBridge()) {\n var stopLogsBatch_1 = startLogsBatch(configuration, lifeCycle, reportError, pageExitObservable, session).stop;\n cleanupTasks.push(function () { return stopLogsBatch_1(); });\n }\n else {\n startLogsBridge(lifeCycle);\n }\n var internalContext = startInternalContext(session);\n return {\n handleLog: handleLog,\n getInternalContext: internalContext.get,\n stop: function () {\n cleanupTasks.forEach(function (task) { return task(); });\n },\n };\n}\n//# sourceMappingURL=startLogs.js.map","import { defineGlobal, getGlobalObject } from '@datadog/browser-core';\nimport { makeLogsPublicApi } from '../boot/logsPublicApi';\nimport { startLogs } from '../boot/startLogs';\nexport { Logger, StatusType, HandlerType } from '../domain/logger';\nexport var datadogLogs = makeLogsPublicApi(startLogs);\ndefineGlobal(getGlobalObject(), 'DD_LOGS', datadogLogs);\n//# sourceMappingURL=main.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"getDeploymentIdQueryOrEmptyString\", {\n enumerable: true,\n get: function() {\n return getDeploymentIdQueryOrEmptyString;\n }\n});\nfunction getDeploymentIdQueryOrEmptyString() {\n if (process.env.NEXT_DEPLOYMENT_ID) {\n return `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`;\n }\n return '';\n}\n\n//# sourceMappingURL=deployment-id.js.map","\"trimStart\"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),\"trimEnd\"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),\"description\"in Symbol.prototype||Object.defineProperty(Symbol.prototype,\"description\",{configurable:!0,get:function(){var t=/\\((.*)\\)/.exec(this.toString());return t?t[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(t,r){return r=this.concat.apply([],this),t>1&&r.some(Array.isArray)?r.flat(t-1):r},Array.prototype.flatMap=function(t,r){return this.map(t,r).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(t){if(\"function\"!=typeof t)return this.then(t,t);var r=this.constructor||Promise;return this.then(function(n){return r.resolve(t()).then(function(){return n})},function(n){return r.resolve(t()).then(function(){throw n})})}),Object.fromEntries||(Object.fromEntries=function(t){return Array.from(t).reduce(function(t,r){return t[r[0]]=r[1],t},{})}),Array.prototype.at||(Array.prototype.at=function(t){var r=Math.trunc(t)||0;if(r<0&&(r+=this.length),!(r<0||r>=this.length))return this[r]}),Object.hasOwn||(Object.hasOwn=function(t,r){if(null==t)throw new TypeError(\"Cannot convert undefined or null to object\");return Object.prototype.hasOwnProperty.call(Object(t),r)}),\"canParse\"in URL||(URL.canParse=function(t,r){try{return!!new URL(t,r)}catch(t){return!1}});\n","import { addPathPrefix } from '../shared/lib/router/utils/add-path-prefix'\nimport { normalizePathTrailingSlash } from './normalize-trailing-slash'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function addBasePath(path: string, required?: boolean): string {\n return normalizePathTrailingSlash(\n process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required\n ? path\n : addPathPrefix(path, basePath)\n )\n}\n","import type { addLocale as Fn } from '../shared/lib/router/utils/add-locale'\nimport { normalizePathTrailingSlash } from './normalize-trailing-slash'\n\nexport const addLocale: typeof Fn = (path, ...args) => {\n if (process.env.__NEXT_I18N_SUPPORT) {\n return normalizePathTrailingSlash(\n require('../shared/lib/router/utils/add-locale').addLocale(path, ...args)\n )\n }\n return path\n}\n","/**\n * Before starting the Next.js runtime and requiring any module, we need to make\n * sure the following scripts are executed in the correct order:\n * - Polyfills\n * - next/script with `beforeInteractive` strategy\n */\n\nconst version = process.env.__NEXT_VERSION\n\nwindow.next = {\n version,\n appDir: true,\n}\n\nfunction loadScriptsInSequence(\n scripts: [src: string, props: { [prop: string]: any }][],\n hydrate: () => void\n) {\n if (!scripts || !scripts.length) {\n return hydrate()\n }\n\n return scripts\n .reduce((promise, [src, props]) => {\n return promise.then(() => {\n return new Promise((resolve, reject) => {\n const el = document.createElement('script')\n\n if (props) {\n for (const key in props) {\n if (key !== 'children') {\n el.setAttribute(key, props[key])\n }\n }\n }\n\n if (src) {\n el.src = src\n el.onload = () => resolve()\n el.onerror = reject\n } else if (props) {\n el.innerHTML = props.children\n setTimeout(resolve)\n }\n\n document.head.appendChild(el)\n })\n })\n }, Promise.resolve())\n .catch((err: Error) => {\n console.error(err)\n // Still try to hydrate even if there's an error.\n })\n .then(() => {\n hydrate()\n })\n}\n\nexport function appBootstrap(callback: () => void) {\n loadScriptsInSequence((self as any).__next_s, () => {\n callback()\n })\n}\n","// This gets assigned as a side-effect during app initialization. Because it\n// represents the build used to create the JS bundle, it should never change\n// after being set, so we store it in a global variable.\n//\n// When performing RSC requests, if the incoming data has a different build ID,\n// we perform an MPA navigation/refresh to load the updated build and ensure\n// that the client and server in sync.\n\n// Starts as an empty string. In practice, because setAppBuildId is called\n// during initialization before hydration starts, this will always get\n// reassigned to the actual build ID before it's ever needed by a navigation.\n// If for some reasons it didn't, due to a bug or race condition, then on\n// navigation the build comparision would fail and trigger an MPA navigation.\nlet globalBuildId: string = ''\n\nexport function setAppBuildId(buildId: string) {\n globalBuildId = buildId\n}\n\nexport function getAppBuildId(): string {\n return globalBuildId\n}\n","import { startTransition, useCallback } from 'react'\nimport {\n ACTION_SERVER_ACTION,\n type ReducerActions,\n type ServerActionDispatcher,\n} from './components/router-reducer/router-reducer-types'\n\nlet globalServerActionDispatcher = null as ServerActionDispatcher | null\n\nexport function useServerActionDispatcher(\n dispatch: React.Dispatch\n) {\n const serverActionDispatcher: ServerActionDispatcher = useCallback(\n (actionPayload) => {\n startTransition(() => {\n dispatch({\n ...actionPayload,\n type: ACTION_SERVER_ACTION,\n })\n })\n },\n [dispatch]\n )\n globalServerActionDispatcher = serverActionDispatcher\n}\n\nexport async function callServer(actionId: string, actionArgs: any[]) {\n const actionDispatcher = globalServerActionDispatcher\n\n if (!actionDispatcher) {\n throw new Error('Invariant: missing action dispatcher.')\n }\n\n return new Promise((resolve, reject) => {\n actionDispatcher({\n actionId,\n actionArgs,\n resolve,\n reject,\n })\n })\n}\n","const basePath = process.env.__NEXT_ROUTER_BASEPATH || ''\nconst pathname = `${basePath}/__nextjs_source-map`\n\nexport const findSourceMapURL =\n process.env.NODE_ENV === 'development'\n ? function findSourceMapURL(filename: string): string | null {\n if (filename === '') {\n return null\n }\n\n if (\n filename.startsWith(document.location.origin) &&\n filename.includes('/_next/static')\n ) {\n // This is a request for a client chunk. This can only happen when\n // using Turbopack. In this case, since we control how those source\n // maps are generated, we can safely assume that the sourceMappingURL\n // is relative to the filename, with an added `.map` extension. The\n // browser can just request this file, and it gets served through the\n // normal dev server, without the need to route this through\n // the `/__nextjs_source-map` dev middleware.\n return `${filename}.map`\n }\n\n const url = new URL(pathname, document.location.origin)\n url.searchParams.set('filename', filename)\n\n return url.href\n }\n : undefined\n","// imports polyfill from `@next/polyfill-module` after build.\nimport '../build/polyfills/polyfill-module'\n\nimport './components/globals/patch-console'\nimport './components/globals/handle-global-errors'\n\nimport ReactDOMClient from 'react-dom/client'\nimport React, { use } from 'react'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromReadableStream } from 'react-server-dom-webpack/client'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport { onRecoverableError } from './react-client-callbacks/shared'\nimport {\n onCaughtError,\n onUncaughtError,\n} from './react-client-callbacks/app-router'\nimport { callServer } from './app-call-server'\nimport { findSourceMapURL } from './app-find-source-map-url'\nimport {\n type AppRouterActionQueue,\n createMutableActionQueue,\n} from '../shared/lib/router/action-queue'\nimport AppRouter from './components/app-router'\nimport type { InitialRSCPayload } from '../server/app-render/types'\nimport { createInitialRouterState } from './components/router-reducer/create-initial-router-state'\nimport { MissingSlotContext } from '../shared/lib/app-router-context.shared-runtime'\nimport { setAppBuildId } from './app-build-id'\n\n/// \n\nconst appElement: HTMLElement | Document | null = document\n\nconst encoder = new TextEncoder()\n\nlet initialServerDataBuffer: (string | Uint8Array)[] | undefined = undefined\nlet initialServerDataWriter: ReadableStreamDefaultController | undefined =\n undefined\nlet initialServerDataLoaded = false\nlet initialServerDataFlushed = false\n\nlet initialFormStateData: null | any = null\n\nfunction nextServerDataCallback(\n seg:\n | [isBootStrap: 0]\n | [isNotBootstrap: 1, responsePartial: string]\n | [isFormState: 2, formState: any]\n | [isBinary: 3, responseBase64Partial: string]\n): void {\n if (seg[0] === 0) {\n initialServerDataBuffer = []\n } else if (seg[0] === 1) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(encoder.encode(seg[1]))\n } else {\n initialServerDataBuffer.push(seg[1])\n }\n } else if (seg[0] === 2) {\n initialFormStateData = seg[1]\n } else if (seg[0] === 3) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n // Decode the base64 string back to binary data.\n const binaryString = atob(seg[1])\n const decodedChunk = new Uint8Array(binaryString.length)\n for (var i = 0; i < binaryString.length; i++) {\n decodedChunk[i] = binaryString.charCodeAt(i)\n }\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(decodedChunk)\n } else {\n initialServerDataBuffer.push(decodedChunk)\n }\n }\n}\n\nfunction isStreamErrorOrUnfinished(ctr: ReadableStreamDefaultController) {\n // If `desiredSize` is null, it means the stream is closed or errored. If it is lower than 0, the stream is still unfinished.\n return ctr.desiredSize === null || ctr.desiredSize < 0\n}\n\n// There might be race conditions between `nextServerDataRegisterWriter` and\n// `DOMContentLoaded`. The former will be called when React starts to hydrate\n// the root, the latter will be called when the DOM is fully loaded.\n// For streaming, the former is called first due to partial hydration.\n// For non-streaming, the latter can be called first.\n// Hence, we use two variables `initialServerDataLoaded` and\n// `initialServerDataFlushed` to make sure the writer will be closed and\n// `initialServerDataBuffer` will be cleared in the right time.\nfunction nextServerDataRegisterWriter(ctr: ReadableStreamDefaultController) {\n if (initialServerDataBuffer) {\n initialServerDataBuffer.forEach((val) => {\n ctr.enqueue(typeof val === 'string' ? encoder.encode(val) : val)\n })\n if (initialServerDataLoaded && !initialServerDataFlushed) {\n if (isStreamErrorOrUnfinished(ctr)) {\n ctr.error(\n new Error(\n 'The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection.'\n )\n )\n } else {\n ctr.close()\n }\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n }\n\n initialServerDataWriter = ctr\n}\n\n// When `DOMContentLoaded`, we can close all pending writers to finish hydration.\nconst DOMContentLoaded = function () {\n if (initialServerDataWriter && !initialServerDataFlushed) {\n initialServerDataWriter.close()\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n initialServerDataLoaded = true\n}\n\n// It's possible that the DOM is already loaded.\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', DOMContentLoaded, false)\n} else {\n // Delayed in marco task to ensure it's executed later than hydration\n setTimeout(DOMContentLoaded)\n}\n\nconst nextServerDataLoadingGlobal = ((self as any).__next_f =\n (self as any).__next_f || [])\nnextServerDataLoadingGlobal.forEach(nextServerDataCallback)\nnextServerDataLoadingGlobal.push = nextServerDataCallback\n\nconst readable = new ReadableStream({\n start(controller) {\n nextServerDataRegisterWriter(controller)\n },\n})\n\nconst initialServerResponse = createFromReadableStream(\n readable,\n { callServer, findSourceMapURL }\n)\n\n// React overrides `.then` and doesn't return a new promise chain,\n// so we wrap the action queue in a promise to ensure that its value\n// is defined when the promise resolves.\n// https://github.com/facebook/react/blob/163365a07872337e04826c4f501565d43dbd2fd4/packages/react-client/src/ReactFlightClient.js#L189-L190\nconst pendingActionQueue: Promise = new Promise(\n (resolve, reject) => {\n initialServerResponse.then(\n (initialRSCPayload) => {\n // setAppBuildId should be called only once, during JS initialization\n // and before any components have hydrated.\n setAppBuildId(initialRSCPayload.b)\n\n resolve(\n createMutableActionQueue(\n createInitialRouterState({\n initialFlightData: initialRSCPayload.f,\n initialCanonicalUrlParts: initialRSCPayload.c,\n initialParallelRoutes: new Map(),\n location: window.location,\n couldBeIntercepted: initialRSCPayload.i,\n postponed: initialRSCPayload.s,\n prerendered: initialRSCPayload.S,\n })\n )\n )\n },\n (err: Error) => reject(err)\n )\n }\n)\n\nfunction ServerRoot(): React.ReactNode {\n const initialRSCPayload = use(initialServerResponse)\n const actionQueue = use(pendingActionQueue)\n\n const router = (\n \n )\n\n if (process.env.NODE_ENV === 'development' && initialRSCPayload.m) {\n // We provide missing slot information in a context provider only during development\n // as we log some additional information about the missing slots in the console.\n return (\n \n {router}\n \n )\n }\n\n return router\n}\n\nconst StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP\n ? React.StrictMode\n : React.Fragment\n\nfunction Root({ children }: React.PropsWithChildren<{}>) {\n if (process.env.__NEXT_TEST_MODE) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n window.__NEXT_HYDRATED = true\n window.__NEXT_HYDRATED_CB?.()\n }, [])\n }\n\n return children\n}\n\nconst reactRootOptions = {\n onRecoverableError,\n onCaughtError,\n onUncaughtError,\n} satisfies ReactDOMClient.RootOptions\n\nexport function hydrate() {\n const reactEl = (\n \n \n \n \n \n \n \n )\n\n const rootLayoutMissingTags = window.__next_root_layout_missing_tags\n const hasMissingTags = !!rootLayoutMissingTags?.length\n\n const isError =\n document.documentElement.id === '__next_error__' || hasMissingTags\n\n if (isError) {\n if (process.env.NODE_ENV !== 'production') {\n const createDevOverlayElement =\n require('./components/react-dev-overlay/client-entry').createDevOverlayElement\n const errorTree = createDevOverlayElement(reactEl)\n ReactDOMClient.createRoot(appElement as any, reactRootOptions).render(\n errorTree\n )\n } else {\n ReactDOMClient.createRoot(appElement as any, reactRootOptions).render(\n reactEl\n )\n }\n } else {\n React.startTransition(() =>\n (ReactDOMClient as any).hydrateRoot(appElement, reactEl, {\n ...reactRootOptions,\n formState: initialFormStateData,\n })\n )\n }\n\n // TODO-APP: Remove this logic when Float has GC built-in in development.\n if (process.env.NODE_ENV !== 'production') {\n const { linkGc } =\n require('./app-link-gc') as typeof import('./app-link-gc')\n linkGc()\n }\n}\n","// This import must go first because it needs to patch webpack chunk loading\n// before React patches chunk loading.\nimport './app-webpack'\nimport { appBootstrap } from './app-bootstrap'\n\nappBootstrap(() => {\n const { hydrate } = require('./app-index')\n // Include app-router and layout-router in the main chunk\n require('next/dist/client/components/app-router')\n require('next/dist/client/components/layout-router')\n hydrate()\n})\n","// Override chunk URL mapping in the webpack runtime\n// https://github.com/webpack/webpack/blob/2738eebc7880835d88c727d364ad37f3ec557593/lib/RuntimeGlobals.js#L204\n\nimport { getDeploymentIdQueryOrEmptyString } from '../build/deployment-id'\nimport { encodeURIPath } from '../shared/lib/encode-uri-path'\n\ndeclare const __webpack_require__: any\n\n// If we have a deployment ID, we need to append it to the webpack chunk names\n// I am keeping the process check explicit so this can be statically optimized\nif (process.env.NEXT_DEPLOYMENT_ID) {\n const suffix = getDeploymentIdQueryOrEmptyString()\n // eslint-disable-next-line no-undef\n const getChunkScriptFilename = __webpack_require__.u\n // eslint-disable-next-line no-undef\n __webpack_require__.u = (...args: any[]) =>\n // We encode the chunk filename because our static server matches against and encoded\n // filename path.\n encodeURIPath(getChunkScriptFilename(...args)) + suffix\n\n // eslint-disable-next-line no-undef\n const getChunkCssFilename = __webpack_require__.k\n // eslint-disable-next-line no-undef\n __webpack_require__.k = (...args: any[]) =>\n getChunkCssFilename(...args) + suffix\n\n // eslint-disable-next-line no-undef\n const getMiniCssFilename = __webpack_require__.miniCssF\n // eslint-disable-next-line no-undef\n __webpack_require__.miniCssF = (...args: any[]) =>\n getMiniCssFilename(...args) + suffix\n} else {\n // eslint-disable-next-line no-undef\n const getChunkScriptFilename = __webpack_require__.u\n // eslint-disable-next-line no-undef\n __webpack_require__.u = (...args: any[]) =>\n // We encode the chunk filename because our static server matches against and encoded\n // filename path.\n encodeURIPath(getChunkScriptFilename(...args))\n\n // We don't need to override __webpack_require__.k because we don't modify\n // the css chunk name when not using deployment id suffixes\n\n // WE don't need to override __webpack_require__.miniCssF because we don't modify\n // the mini css chunk name when not using deployment id suffixes\n}\n\nexport {}\n","import { addBasePath } from './add-base-path'\n\n/**\n * Function to correctly assign location to URL\n *\n * The method will add basePath, and will also correctly add location (including if it is a relative path)\n * @param location Location that should be added to the url\n * @param url Base URL to which the location should be assigned\n */\nexport function assignLocation(location: string, url: URL): URL {\n if (location.startsWith('.')) {\n const urlBase = url.origin + url.pathname\n return new URL(\n // In order for a relative path to be added to the current url correctly, the current url must end with a slash\n // new URL('./relative', 'https://example.com/subdir').href -> 'https://example.com/relative'\n // new URL('./relative', 'https://example.com/subdir/').href -> 'https://example.com/subdir/relative'\n (urlBase.endsWith('/') ? urlBase : urlBase + '/') + location\n )\n }\n\n return new URL(addBasePath(location), url.href)\n}\n","import { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport type { FlightRouterState } from '../../server/app-render/types'\n\nconst ANNOUNCER_TYPE = 'next-route-announcer'\nconst ANNOUNCER_ID = '__next-route-announcer__'\n\nfunction getAnnouncerNode() {\n const existingAnnouncer = document.getElementsByName(ANNOUNCER_TYPE)[0]\n if (existingAnnouncer?.shadowRoot?.childNodes[0]) {\n return existingAnnouncer.shadowRoot.childNodes[0] as HTMLElement\n } else {\n const container = document.createElement(ANNOUNCER_TYPE)\n container.style.cssText = 'position:absolute'\n const announcer = document.createElement('div')\n announcer.ariaLive = 'assertive'\n announcer.id = ANNOUNCER_ID\n announcer.role = 'alert'\n announcer.style.cssText =\n 'position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal'\n\n // Use shadow DOM here to avoid any potential CSS bleed\n const shadow = container.attachShadow({ mode: 'open' })\n shadow.appendChild(announcer)\n document.body.appendChild(container)\n return announcer\n }\n}\n\nexport function AppRouterAnnouncer({ tree }: { tree: FlightRouterState }) {\n const [portalNode, setPortalNode] = useState(null)\n\n useEffect(() => {\n const announcer = getAnnouncerNode()\n setPortalNode(announcer)\n return () => {\n const container = document.getElementsByTagName(ANNOUNCER_TYPE)[0]\n if (container?.isConnected) {\n document.body.removeChild(container)\n }\n }\n }, [])\n\n const [routeAnnouncement, setRouteAnnouncement] = useState('')\n const previousTitle = useRef(undefined)\n\n useEffect(() => {\n let currentTitle = ''\n if (document.title) {\n currentTitle = document.title\n } else {\n const pageHeader = document.querySelector('h1')\n if (pageHeader) {\n currentTitle = pageHeader.innerText || pageHeader.textContent || ''\n }\n }\n\n // Only announce the title change, but not for the first load because screen\n // readers do that automatically.\n if (\n previousTitle.current !== undefined &&\n previousTitle.current !== currentTitle\n ) {\n setRouteAnnouncement(currentTitle)\n }\n previousTitle.current = currentTitle\n }, [tree])\n\n return portalNode ? createPortal(routeAnnouncement, portalNode) : null\n}\n","export const RSC_HEADER = 'RSC' as const\nexport const ACTION_HEADER = 'Next-Action' as const\n// TODO: Instead of sending the full router state, we only need to send the\n// segment path. Saves bytes. Then we could also use this field for segment\n// prefetches, which also need to specify a particular segment.\nexport const NEXT_ROUTER_STATE_TREE_HEADER = 'Next-Router-State-Tree' as const\nexport const NEXT_ROUTER_PREFETCH_HEADER = 'Next-Router-Prefetch' as const\n// This contains the path to the segment being prefetched.\n// TODO: If we change Next-Router-State-Tree to be a segment path, we can use\n// that instead. Then Next-Router-Prefetch and Next-Router-Segment-Prefetch can\n// be merged into a single enum.\nexport const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =\n 'Next-Router-Segment-Prefetch' as const\nexport const NEXT_HMR_REFRESH_HEADER = 'Next-HMR-Refresh' as const\nexport const NEXT_URL = 'Next-Url' as const\nexport const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const\n\nexport const FLIGHT_HEADERS = [\n RSC_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n] as const\n\nexport const NEXT_RSC_UNION_QUERY = '_rsc' as const\n\nexport const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time' as const\nexport const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed' as const\nexport const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender' as const\n","'use client'\n\nimport React, {\n use,\n useEffect,\n useMemo,\n useCallback,\n startTransition,\n useInsertionEffect,\n useDeferredValue,\n} from 'react'\nimport {\n AppRouterContext,\n LayoutRouterContext,\n GlobalLayoutRouterContext,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport type {\n CacheNode,\n AppRouterInstance,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n ACTION_HMR_REFRESH,\n ACTION_NAVIGATE,\n ACTION_PREFETCH,\n ACTION_REFRESH,\n ACTION_RESTORE,\n ACTION_SERVER_PATCH,\n PrefetchKind,\n} from './router-reducer/router-reducer-types'\nimport type {\n AppRouterState,\n ReducerActions,\n RouterChangeByServerResponse,\n RouterNavigate,\n} from './router-reducer/router-reducer-types'\nimport { createHrefFromUrl } from './router-reducer/create-href-from-url'\nimport {\n SearchParamsContext,\n PathnameContext,\n PathParamsContext,\n} from '../../shared/lib/hooks-client-context.shared-runtime'\nimport { useReducer, useUnwrapState } from './use-reducer'\nimport { ErrorBoundary, type ErrorComponent } from './error-boundary'\nimport { isBot } from '../../shared/lib/router/utils/is-bot'\nimport { addBasePath } from '../add-base-path'\nimport { AppRouterAnnouncer } from './app-router-announcer'\nimport { RedirectBoundary } from './redirect-boundary'\nimport { findHeadInCache } from './router-reducer/reducers/find-head-in-cache'\nimport { unresolvedThenable } from './unresolved-thenable'\nimport { removeBasePath } from '../remove-base-path'\nimport { hasBasePath } from '../has-base-path'\nimport { getSelectedParams } from './router-reducer/compute-changed-path'\nimport type { FlightRouterState } from '../../server/app-render/types'\nimport { useNavFailureHandler } from './nav-failure-handler'\nimport { useServerActionDispatcher } from '../app-call-server'\nimport type { AppRouterActionQueue } from '../../shared/lib/router/action-queue'\nimport { prefetch as prefetchWithSegmentCache } from '../components/segment-cache/prefetch'\nimport { getRedirectTypeFromError, getURLFromRedirectError } from './redirect'\nimport { isRedirectError, RedirectType } from './redirect-error'\n\nconst globalMutable: {\n pendingMpaPath?: string\n} = {}\n\nfunction isExternalURL(url: URL) {\n return url.origin !== window.location.origin\n}\n\n/**\n * Given a link href, constructs the URL that should be prefetched. Returns null\n * in cases where prefetching should be disabled, like external URLs, or\n * during development.\n * @param href The href passed to , router.prefetch(), or similar\n * @returns A URL object to prefetch, or null if prefetching should be disabled\n */\nexport function createPrefetchURL(href: string): URL | null {\n // Don't prefetch for bots as they don't navigate.\n if (isBot(window.navigator.userAgent)) {\n return null\n }\n\n let url: URL\n try {\n url = new URL(addBasePath(href), window.location.href)\n } catch (_) {\n // TODO: Does this need to throw or can we just console.error instead? Does\n // anyone rely on this throwing? (Seems unlikely.)\n throw new Error(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n }\n\n // Don't prefetch during development (improves compilation performance)\n if (process.env.NODE_ENV === 'development') {\n return null\n }\n\n // External urls can't be prefetched in the same way.\n if (isExternalURL(url)) {\n return null\n }\n\n return url\n}\n\nfunction HistoryUpdater({\n appRouterState,\n}: {\n appRouterState: AppRouterState\n}) {\n useInsertionEffect(() => {\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n // clear pending URL as navigation is no longer\n // in flight\n window.next.__pendingUrl = undefined\n }\n\n const { tree, pushRef, canonicalUrl } = appRouterState\n const historyState = {\n ...(pushRef.preserveCustomHistoryState ? window.history.state : {}),\n // Identifier is shortened intentionally.\n // __NA is used to identify if the history entry can be handled by the app-router.\n // __N is used to identify if the history entry can be handled by the old router.\n __NA: true,\n __PRIVATE_NEXTJS_INTERNALS_TREE: tree,\n }\n if (\n pushRef.pendingPush &&\n // Skip pushing an additional history entry if the canonicalUrl is the same as the current url.\n // This mirrors the browser behavior for normal navigation.\n createHrefFromUrl(new URL(window.location.href)) !== canonicalUrl\n ) {\n // This intentionally mutates React state, pushRef is overwritten to ensure additional push/replace calls do not trigger an additional history entry.\n pushRef.pendingPush = false\n window.history.pushState(historyState, '', canonicalUrl)\n } else {\n window.history.replaceState(historyState, '', canonicalUrl)\n }\n }, [appRouterState])\n return null\n}\n\nexport function createEmptyCacheNode(): CacheNode {\n return {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n}\n\n/**\n * Server response that only patches the cache and tree.\n */\nfunction useChangeByServerResponse(\n dispatch: React.Dispatch\n): RouterChangeByServerResponse {\n return useCallback(\n ({ previousTree, serverResponse }) => {\n startTransition(() => {\n dispatch({\n type: ACTION_SERVER_PATCH,\n previousTree,\n serverResponse,\n })\n })\n },\n [dispatch]\n )\n}\n\nfunction useNavigate(dispatch: React.Dispatch): RouterNavigate {\n return useCallback(\n (href, navigateType, shouldScroll) => {\n const url = new URL(addBasePath(href), location.href)\n\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n window.next.__pendingUrl = url\n }\n\n return dispatch({\n type: ACTION_NAVIGATE,\n url,\n isExternalUrl: isExternalURL(url),\n locationSearch: location.search,\n shouldScroll: shouldScroll ?? true,\n navigateType,\n allowAliasing: true,\n })\n },\n [dispatch]\n )\n}\n\nfunction copyNextJsInternalHistoryState(data: any) {\n if (data == null) data = {}\n const currentState = window.history.state\n const __NA = currentState?.__NA\n if (__NA) {\n data.__NA = __NA\n }\n const __PRIVATE_NEXTJS_INTERNALS_TREE =\n currentState?.__PRIVATE_NEXTJS_INTERNALS_TREE\n if (__PRIVATE_NEXTJS_INTERNALS_TREE) {\n data.__PRIVATE_NEXTJS_INTERNALS_TREE = __PRIVATE_NEXTJS_INTERNALS_TREE\n }\n\n return data\n}\n\nfunction Head({\n headCacheNode,\n}: {\n headCacheNode: CacheNode | null\n}): React.ReactNode {\n // If this segment has a `prefetchHead`, it's the statically prefetched data.\n // We should use that on initial render instead of `head`. Then we'll switch\n // to `head` when the dynamic response streams in.\n const head = headCacheNode !== null ? headCacheNode.head : null\n const prefetchHead =\n headCacheNode !== null ? headCacheNode.prefetchHead : null\n\n // If no prefetch data is available, then we go straight to rendering `head`.\n const resolvedPrefetchRsc = prefetchHead !== null ? prefetchHead : head\n\n // We use `useDeferredValue` to handle switching between the prefetched and\n // final values. The second argument is returned on initial render, then it\n // re-renders with the first argument.\n //\n // @ts-expect-error The second argument to `useDeferredValue` is only\n // available in the experimental builds. When its disabled, it will always\n // return `head`.\n return useDeferredValue(head, resolvedPrefetchRsc)\n}\n\n/**\n * The global router that wraps the application components.\n */\nfunction Router({\n actionQueue,\n assetPrefix,\n}: {\n actionQueue: AppRouterActionQueue\n assetPrefix: string\n}) {\n const [state, dispatch] = useReducer(actionQueue)\n const { canonicalUrl } = useUnwrapState(state)\n // Add memoized pathname/query for useSearchParams and usePathname.\n const { searchParams, pathname } = useMemo(() => {\n const url = new URL(\n canonicalUrl,\n typeof window === 'undefined' ? 'http://n' : window.location.href\n )\n\n return {\n // This is turned into a readonly class in `useSearchParams`\n searchParams: url.searchParams,\n pathname: hasBasePath(url.pathname)\n ? removeBasePath(url.pathname)\n : url.pathname,\n }\n }, [canonicalUrl])\n\n const changeByServerResponse = useChangeByServerResponse(dispatch)\n const navigate = useNavigate(dispatch)\n useServerActionDispatcher(dispatch)\n\n /**\n * The app router that is exposed through `useRouter`. It's only concerned with dispatching actions to the reducer, does not hold state.\n */\n const appRouter = useMemo(() => {\n const routerInstance: AppRouterInstance = {\n back: () => window.history.back(),\n forward: () => window.history.forward(),\n prefetch:\n process.env.__NEXT_PPR && process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? // Unlike the old implementation, the Segment Cache doesn't store its\n // data in the router reducer state; it writes into a global mutable\n // cache. So we don't need to dispatch an action.\n (href) => prefetchWithSegmentCache(href, actionQueue.state.nextUrl)\n : (href, options) => {\n // Use the old prefetch implementation.\n const url = createPrefetchURL(href)\n if (url !== null) {\n startTransition(() => {\n dispatch({\n type: ACTION_PREFETCH,\n url,\n kind: options?.kind ?? PrefetchKind.FULL,\n })\n })\n }\n },\n replace: (href, options = {}) => {\n startTransition(() => {\n navigate(href, 'replace', options.scroll ?? true)\n })\n },\n push: (href, options = {}) => {\n startTransition(() => {\n navigate(href, 'push', options.scroll ?? true)\n })\n },\n refresh: () => {\n startTransition(() => {\n dispatch({\n type: ACTION_REFRESH,\n origin: window.location.origin,\n })\n })\n },\n hmrRefresh: () => {\n if (process.env.NODE_ENV !== 'development') {\n throw new Error(\n 'hmrRefresh can only be used in development mode. Please use refresh instead.'\n )\n } else {\n startTransition(() => {\n dispatch({\n type: ACTION_HMR_REFRESH,\n origin: window.location.origin,\n })\n })\n }\n },\n }\n\n return routerInstance\n }, [actionQueue, dispatch, navigate])\n\n useEffect(() => {\n // Exists for debugging purposes. Don't use in application code.\n if (window.next) {\n window.next.router = appRouter\n }\n }, [appRouter])\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const { cache, prefetchCache, tree } = useUnwrapState(state)\n\n // This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n // Add `window.nd` for debugging purposes.\n // This is not meant for use in applications as concurrent rendering will affect the cache/tree/router.\n // @ts-ignore this is for debugging\n window.nd = {\n router: appRouter,\n cache,\n prefetchCache,\n tree,\n }\n }, [appRouter, cache, prefetchCache, tree])\n }\n\n useEffect(() => {\n // If the app is restored from bfcache, it's possible that\n // pushRef.mpaNavigation is true, which would mean that any re-render of this component\n // would trigger the mpa navigation logic again from the lines below.\n // This will restore the router to the initial state in the event that the app is restored from bfcache.\n function handlePageShow(event: PageTransitionEvent) {\n if (\n !event.persisted ||\n !window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE\n ) {\n return\n }\n\n // Clear the pendingMpaPath value so that a subsequent MPA navigation to the same URL can be triggered.\n // This is necessary because if the browser restored from bfcache, the pendingMpaPath would still be set to the value\n // of the last MPA navigation.\n globalMutable.pendingMpaPath = undefined\n\n dispatch({\n type: ACTION_RESTORE,\n url: new URL(window.location.href),\n tree: window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE,\n })\n }\n\n window.addEventListener('pageshow', handlePageShow)\n\n return () => {\n window.removeEventListener('pageshow', handlePageShow)\n }\n }, [dispatch])\n\n useEffect(() => {\n // Ensure that any redirect errors that bubble up outside of the RedirectBoundary\n // are caught and handled by the router.\n function handleUnhandledRedirect(\n event: ErrorEvent | PromiseRejectionEvent\n ) {\n const error = 'reason' in event ? event.reason : event.error\n if (isRedirectError(error)) {\n event.preventDefault()\n const url = getURLFromRedirectError(error)\n const redirectType = getRedirectTypeFromError(error)\n if (redirectType === RedirectType.push) {\n appRouter.push(url, {})\n } else {\n appRouter.replace(url, {})\n }\n }\n }\n window.addEventListener('error', handleUnhandledRedirect)\n window.addEventListener('unhandledrejection', handleUnhandledRedirect)\n\n return () => {\n window.removeEventListener('error', handleUnhandledRedirect)\n window.removeEventListener('unhandledrejection', handleUnhandledRedirect)\n }\n }, [appRouter])\n\n // When mpaNavigation flag is set do a hard navigation to the new url.\n // Infinitely suspend because we don't actually want to rerender any child\n // components with the new URL and any entangled state updates shouldn't\n // commit either (eg: useTransition isPending should stay true until the page\n // unloads).\n //\n // This is a side effect in render. Don't try this at home, kids. It's\n // probably safe because we know this is a singleton component and it's never\n // in . At least I hope so. (It will run twice in dev strict mode,\n // but that's... fine?)\n const { pushRef } = useUnwrapState(state)\n if (pushRef.mpaNavigation) {\n // if there's a re-render, we don't want to trigger another redirect if one is already in flight to the same URL\n if (globalMutable.pendingMpaPath !== canonicalUrl) {\n const location = window.location\n if (pushRef.pendingPush) {\n location.assign(canonicalUrl)\n } else {\n location.replace(canonicalUrl)\n }\n\n globalMutable.pendingMpaPath = canonicalUrl\n }\n // TODO-APP: Should we listen to navigateerror here to catch failed\n // navigations somehow? And should we call window.stop() if a SPA navigation\n // should interrupt an MPA one?\n use(unresolvedThenable)\n }\n\n useEffect(() => {\n const originalPushState = window.history.pushState.bind(window.history)\n const originalReplaceState = window.history.replaceState.bind(\n window.history\n )\n\n // Ensure the canonical URL in the Next.js Router is updated when the URL is changed so that `usePathname` and `useSearchParams` hold the pushed values.\n const applyUrlFromHistoryPushReplace = (\n url: string | URL | null | undefined\n ) => {\n const href = window.location.href\n const tree: FlightRouterState | undefined =\n window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE\n\n startTransition(() => {\n dispatch({\n type: ACTION_RESTORE,\n url: new URL(url ?? href, href),\n tree,\n })\n })\n }\n\n /**\n * Patch pushState to ensure external changes to the history are reflected in the Next.js Router.\n * Ensures Next.js internal history state is copied to the new history entry.\n * Ensures usePathname and useSearchParams hold the newly provided url.\n */\n window.history.pushState = function pushState(\n data: any,\n _unused: string,\n url?: string | URL | null\n ): void {\n // Avoid a loop when Next.js internals trigger pushState/replaceState\n if (data?.__NA || data?._N) {\n return originalPushState(data, _unused, url)\n }\n\n data = copyNextJsInternalHistoryState(data)\n\n if (url) {\n applyUrlFromHistoryPushReplace(url)\n }\n\n return originalPushState(data, _unused, url)\n }\n\n /**\n * Patch replaceState to ensure external changes to the history are reflected in the Next.js Router.\n * Ensures Next.js internal history state is copied to the new history entry.\n * Ensures usePathname and useSearchParams hold the newly provided url.\n */\n window.history.replaceState = function replaceState(\n data: any,\n _unused: string,\n url?: string | URL | null\n ): void {\n // Avoid a loop when Next.js internals trigger pushState/replaceState\n if (data?.__NA || data?._N) {\n return originalReplaceState(data, _unused, url)\n }\n data = copyNextJsInternalHistoryState(data)\n\n if (url) {\n applyUrlFromHistoryPushReplace(url)\n }\n return originalReplaceState(data, _unused, url)\n }\n\n /**\n * Handle popstate event, this is used to handle back/forward in the browser.\n * By default dispatches ACTION_RESTORE, however if the history entry was not pushed/replaced by app-router it will reload the page.\n * That case can happen when the old router injected the history entry.\n */\n const onPopState = (event: PopStateEvent) => {\n if (!event.state) {\n // TODO-APP: this case only happens when pushState/replaceState was called outside of Next.js. It should probably reload the page in this case.\n return\n }\n\n // This case happens when the history entry was pushed by the `pages` router.\n if (!event.state.__NA) {\n window.location.reload()\n return\n }\n\n // TODO-APP: Ideally the back button should not use startTransition as it should apply the updates synchronously\n // Without startTransition works if the cache is there for this path\n startTransition(() => {\n dispatch({\n type: ACTION_RESTORE,\n url: new URL(window.location.href),\n tree: event.state.__PRIVATE_NEXTJS_INTERNALS_TREE,\n })\n })\n }\n\n // Register popstate event to call onPopstate.\n window.addEventListener('popstate', onPopState)\n return () => {\n window.history.pushState = originalPushState\n window.history.replaceState = originalReplaceState\n window.removeEventListener('popstate', onPopState)\n }\n }, [dispatch])\n\n const { cache, tree, nextUrl, focusAndScrollRef } = useUnwrapState(state)\n\n const matchingHead = useMemo(() => {\n return findHeadInCache(cache, tree[1])\n }, [cache, tree])\n\n // Add memoized pathParams for useParams.\n const pathParams = useMemo(() => {\n return getSelectedParams(tree)\n }, [tree])\n\n const layoutRouterContext = useMemo(() => {\n return {\n childNodes: cache.parallelRoutes,\n tree,\n // Root node always has `url`\n // Provided in AppTreeContext to ensure it can be overwritten in layout-router\n url: canonicalUrl,\n loading: cache.loading,\n }\n }, [cache.parallelRoutes, tree, canonicalUrl, cache.loading])\n\n const globalLayoutRouterContext = useMemo(() => {\n return {\n changeByServerResponse,\n tree,\n focusAndScrollRef,\n nextUrl,\n }\n }, [changeByServerResponse, tree, focusAndScrollRef, nextUrl])\n\n let head\n if (matchingHead !== null) {\n // The head is wrapped in an extra component so we can use\n // `useDeferredValue` to swap between the prefetched and final versions of\n // the head. (This is what LayoutRouter does for segment data, too.)\n //\n // The `key` is used to remount the component whenever the head moves to\n // a different segment.\n const [headCacheNode, headKey] = matchingHead\n head = \n } else {\n head = null\n }\n\n let content = (\n \n {head}\n {cache.rsc}\n \n \n )\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof window !== 'undefined') {\n const { DevRootHTTPAccessFallbackBoundary } =\n require('./dev-root-http-access-fallback-boundary') as typeof import('./dev-root-http-access-fallback-boundary')\n content = (\n \n {content}\n \n )\n }\n const HotReloader: typeof import('./react-dev-overlay/app/hot-reloader-client').default =\n require('./react-dev-overlay/app/hot-reloader-client').default\n\n content = {content}\n }\n\n return (\n <>\n \n \n \n \n \n \n \n \n {content}\n \n \n \n \n \n \n \n )\n}\n\nexport default function AppRouter({\n actionQueue,\n globalErrorComponentAndStyles: [globalErrorComponent, globalErrorStyles],\n assetPrefix,\n}: {\n actionQueue: AppRouterActionQueue\n globalErrorComponentAndStyles: [ErrorComponent, React.ReactNode | undefined]\n assetPrefix: string\n}) {\n useNavFailureHandler()\n\n return (\n \n \n \n )\n}\n\nconst runtimeStyles = new Set()\nlet runtimeStyleChanged = new Set<() => void>()\n\nglobalThis._N_E_STYLE_LOAD = function (href: string) {\n let len = runtimeStyles.size\n runtimeStyles.add(href)\n if (runtimeStyles.size !== len) {\n runtimeStyleChanged.forEach((cb) => cb())\n }\n // TODO figure out how to get a promise here\n // But maybe it's not necessary as react would block rendering until it's loaded\n return Promise.resolve()\n}\n\nfunction RuntimeStyles() {\n const [, forceUpdate] = React.useState(0)\n const renderedStylesSize = runtimeStyles.size\n useEffect(() => {\n const changed = () => forceUpdate((c) => c + 1)\n runtimeStyleChanged.add(changed)\n if (renderedStylesSize !== runtimeStyles.size) {\n changed()\n }\n return () => {\n runtimeStyleChanged.delete(changed)\n }\n }, [renderedStylesSize, forceUpdate])\n\n const dplId = process.env.NEXT_DEPLOYMENT_ID\n ? `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`\n : ''\n return [...runtimeStyles].map((href, i) => (\n \n ))\n}\n","import { BailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { workAsyncStorage } from '../../server/app-render/work-async-storage.external'\n\nexport function bailoutToClientRendering(reason: string): void | never {\n const workStore = workAsyncStorage.getStore()\n\n if (workStore?.forceStatic) return\n\n if (workStore?.isStaticGeneration) throw new BailoutToCSRError(reason)\n}\n","'use client'\n\nimport type { ParsedUrlQuery } from 'querystring'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nimport type { Params } from '../../server/request/params'\n\n/**\n * When the Page is a client component we send the params and searchParams to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Page component.\n *\n * additionally we may send promises representing the params and searchParams. We don't ever use these passed\n * values but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations.\n * It is up to the caller to decide if the promises are needed.\n */\nexport function ClientPageRoot({\n Component,\n searchParams,\n params,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n promises,\n}: {\n Component: React.ComponentType\n searchParams: ParsedUrlQuery\n params: Params\n promises?: Array>\n}) {\n if (typeof window === 'undefined') {\n const { workAsyncStorage } =\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n\n let clientSearchParams: Promise\n let clientParams: Promise\n // We are going to instrument the searchParams prop with tracking for the\n // appropriate context. We wrap differently in prerendering vs rendering\n const store = workAsyncStorage.getStore()\n if (!store) {\n throw new InvariantError(\n 'Expected workStore to exist when handling searchParams in a client Page.'\n )\n }\n\n const { createSearchParamsFromClient } =\n require('../../server/request/search-params') as typeof import('../../server/request/search-params')\n clientSearchParams = createSearchParamsFromClient(searchParams, store)\n\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n clientParams = createParamsFromClient(params, store)\n\n return \n } else {\n const { createRenderSearchParamsFromClient } =\n require('../../server/request/search-params.browser') as typeof import('../../server/request/search-params.browser')\n const clientSearchParams = createRenderSearchParamsFromClient(searchParams)\n const { createRenderParamsFromClient } =\n require('../../server/request/params.browser') as typeof import('../../server/request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n\n return \n }\n}\n","'use client'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nimport type { Params } from '../../server/request/params'\n\n/**\n * When the Page is a client component we send the params to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Segment component.\n *\n * additionally we may send a promise representing params. We don't ever use this passed\n * value but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations\n * such as when dynamicIO is enabled. It is up to the caller to decide if the promises are needed.\n */\nexport function ClientSegmentRoot({\n Component,\n slots,\n params,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n promise,\n}: {\n Component: React.ComponentType\n slots: { [key: string]: React.ReactNode }\n params: Params\n promise?: Promise\n}) {\n if (typeof window === 'undefined') {\n const { workAsyncStorage } =\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n\n let clientParams: Promise\n // We are going to instrument the searchParams prop with tracking for the\n // appropriate context. We wrap differently in prerendering vs rendering\n const store = workAsyncStorage.getStore()\n if (!store) {\n throw new InvariantError(\n 'Expected workStore to exist when handling params in a client segment such as a Layout or Template.'\n )\n }\n\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n clientParams = createParamsFromClient(params, store)\n\n return \n } else {\n const { createRenderParamsFromClient } =\n require('../../server/request/params.browser') as typeof import('../../server/request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n return \n }\n}\n","'use client'\n\nimport React, { type JSX } from 'react'\nimport { useUntrackedPathname } from './navigation-untracked'\nimport { isNextRouterError } from './is-next-router-error'\nimport { handleHardNavError } from './nav-failure-handler'\nimport { workAsyncStorage } from '../../server/app-render/work-async-storage.external'\n\nconst styles = {\n error: {\n // https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css#L38-L52\n fontFamily:\n 'system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"',\n height: '100vh',\n textAlign: 'center',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n text: {\n fontSize: '14px',\n fontWeight: 400,\n lineHeight: '28px',\n margin: '0 8px',\n },\n} as const\n\nexport type ErrorComponent = React.ComponentType<{\n error: Error\n reset: () => void\n}>\n\nexport interface ErrorBoundaryProps {\n children?: React.ReactNode\n errorComponent: ErrorComponent | undefined\n errorStyles?: React.ReactNode | undefined\n errorScripts?: React.ReactNode | undefined\n}\n\ninterface ErrorBoundaryHandlerProps extends ErrorBoundaryProps {\n pathname: string | null\n errorComponent: ErrorComponent\n}\n\ninterface ErrorBoundaryHandlerState {\n error: Error | null\n previousPathname: string | null\n}\n\n// if we are revalidating we want to re-throw the error so the\n// function crashes so we can maintain our previous cache\n// instead of caching the error page\nfunction HandleISRError({ error }: { error: any }) {\n const store = workAsyncStorage.getStore()\n if (store?.isRevalidate || store?.isStaticGeneration) {\n console.error(error)\n throw error\n }\n\n return null\n}\n\nexport class ErrorBoundaryHandler extends React.Component<\n ErrorBoundaryHandlerProps,\n ErrorBoundaryHandlerState\n> {\n constructor(props: ErrorBoundaryHandlerProps) {\n super(props)\n this.state = { error: null, previousPathname: this.props.pathname }\n }\n\n static getDerivedStateFromError(error: Error) {\n if (isNextRouterError(error)) {\n // Re-throw if an expected internal Next.js router error occurs\n // this means it should be handled by a different boundary (such as a NotFound boundary in a parent segment)\n throw error\n }\n\n return { error }\n }\n\n static getDerivedStateFromProps(\n props: ErrorBoundaryHandlerProps,\n state: ErrorBoundaryHandlerState\n ): ErrorBoundaryHandlerState | null {\n const { error } = state\n\n // if we encounter an error while\n // a navigation is pending we shouldn't render\n // the error boundary and instead should fallback\n // to a hard navigation to attempt recovering\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n if (error && handleHardNavError(error)) {\n // clear error so we don't render anything\n return {\n error: null,\n previousPathname: props.pathname,\n }\n }\n }\n\n /**\n * Handles reset of the error boundary when a navigation happens.\n * Ensures the error boundary does not stay enabled when navigating to a new page.\n * Approach of setState in render is safe as it checks the previous pathname and then overrides\n * it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\n if (props.pathname !== state.previousPathname && state.error) {\n return {\n error: null,\n previousPathname: props.pathname,\n }\n }\n return {\n error: state.error,\n previousPathname: props.pathname,\n }\n }\n\n reset = () => {\n this.setState({ error: null })\n }\n\n // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.\n render(): React.ReactNode {\n if (this.state.error) {\n return (\n <>\n \n {this.props.errorStyles}\n {this.props.errorScripts}\n \n \n )\n }\n\n return this.props.children\n }\n}\n\nexport function GlobalError({ error }: { error: any }) {\n const digest: string | undefined = error?.digest\n return (\n \n \n \n \n
\n
\n

\n {`Application error: a ${\n digest ? 'server' : 'client'\n }-side exception has occurred (see the ${\n digest ? 'server logs' : 'browser console'\n } for more information).`}\n

\n {digest ?

{`Digest: ${digest}`}

: null}\n
\n
\n \n \n )\n}\n\n// Exported so that the import signature in the loaders can be identical to user\n// supplied custom global error signatures.\nexport default GlobalError\n\n/**\n * Handles errors through `getDerivedStateFromError`.\n * Renders the provided error component and provides a way to `reset` the error boundary state.\n */\n\n/**\n * Renders error boundary with the provided \"errorComponent\" property as the fallback.\n * If no \"errorComponent\" property is provided it renders the children without an error boundary.\n */\nexport function ErrorBoundary({\n errorComponent,\n errorStyles,\n errorScripts,\n children,\n}: ErrorBoundaryProps & {\n children: React.ReactNode\n}): JSX.Element {\n // When we're rendering the missing params shell, this will return null. This\n // is because we won't be rendering any not found boundaries or error\n // boundaries for the missing params shell. When this runs on the client\n // (where these errors can occur), we will get the correct pathname.\n const pathname = useUntrackedPathname()\n if (errorComponent) {\n return (\n \n {children}\n \n )\n }\n\n return <>{children}\n}\n","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n// TODO: Add `forbidden` docs\n/**\n * @experimental\n * This function allows you to render the [forbidden.js file](https://nextjs.org/docs/app/api-reference/file-conventions/forbidden)\n * within a route segment as well as inject a tag.\n *\n * `forbidden()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * Read more: [Next.js Docs: `forbidden`](https://nextjs.org/docs/app/api-reference/functions/forbidden)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};403`\n\nexport function forbidden(): never {\n if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {\n throw new Error(\n `\\`forbidden()\\` is experimental and only allowed to be enabled when \\`experimental.authInterrupts\\` is enabled.`\n )\n }\n\n // eslint-disable-next-line no-throw-literal\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n throw error\n}\n","import { handleGlobalErrors } from '../react-dev-overlay/internal/helpers/use-error-handler'\n\nhandleGlobalErrors()\n","import isError from '../../../lib/is-error'\nimport { isNextRouterError } from '../is-next-router-error'\nimport { handleClientError } from '../react-dev-overlay/internal/helpers/use-error-handler'\n\nexport const originConsoleError = window.console.error\n\n// Patch console.error to collect information about hydration errors\nexport function patchConsoleError() {\n // Ensure it's only patched once\n if (typeof window === 'undefined') {\n return\n }\n window.console.error = function error(...args: any[]) {\n let maybeError: unknown\n if (process.env.NODE_ENV !== 'production') {\n const replayedError = matchReplayedError(...args)\n if (replayedError) {\n maybeError = replayedError\n } else if (isError(args[0])) {\n maybeError = args[0]\n } else {\n // See https://github.com/facebook/react/blob/d50323eb845c5fde0d720cae888bf35dedd05506/packages/react-reconciler/src/ReactFiberErrorLogger.js#L78\n maybeError = args[1]\n }\n } else {\n maybeError = args[0]\n }\n\n if (!isNextRouterError(maybeError)) {\n if (process.env.NODE_ENV !== 'production') {\n handleClientError(\n // replayed errors have their own complex format string that should be used,\n // but if we pass the error directly, `handleClientError` will ignore it\n maybeError,\n args,\n true\n )\n }\n\n originConsoleError.apply(window.console, args)\n }\n }\n}\n\nfunction matchReplayedError(...args: unknown[]): Error | null {\n // See\n // https://github.com/facebook/react/blob/65a56d0e99261481c721334a3ec4561d173594cd/packages/react-devtools-shared/src/backend/flight/renderer.js#L88-L93\n //\n // Logs replayed from the server look like this:\n // [\n // \"%c%s%c %o\\n\\n%s\\n\\n%s\\n\",\n // \"background: #e6e6e6; ...\",\n // \" Server \", // can also be e.g. \" Prerender \"\n // \"\",\n // Error\n // \"The above error occurred in the component.\"\n // ...\n // ]\n if (\n args.length > 3 &&\n typeof args[0] === 'string' &&\n args[0].startsWith('%c%s%c ') &&\n typeof args[1] === 'string' &&\n typeof args[2] === 'string' &&\n typeof args[3] === 'string'\n ) {\n const maybeError = args[4]\n if (isError(maybeError)) {\n return maybeError\n }\n }\n\n return null\n}\n","import { patchConsoleError } from './intercept-console-error'\n\npatchConsoleError()\n","const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE'\n\nexport class DynamicServerError extends Error {\n digest: typeof DYNAMIC_ERROR_CODE = DYNAMIC_ERROR_CODE\n\n constructor(public readonly description: string) {\n super(`Dynamic server usage: ${description}`)\n }\n}\n\nexport function isDynamicServerError(err: unknown): err is DynamicServerError {\n if (\n typeof err !== 'object' ||\n err === null ||\n !('digest' in err) ||\n typeof err.digest !== 'string'\n ) {\n return false\n }\n\n return err.digest === DYNAMIC_ERROR_CODE\n}\n","'use client'\n\n/**\n * HTTPAccessFallbackBoundary is a boundary that catches errors and renders a\n * fallback component for HTTP errors.\n *\n * It receives the status code, and determine if it should render fallbacks for few HTTP 4xx errors.\n *\n * e.g. 404\n * 404 represents not found, and the fallback component pair contains the component and its styles.\n *\n */\n\nimport React, { useContext } from 'react'\nimport { useUntrackedPathname } from '../navigation-untracked'\nimport {\n HTTPAccessErrorStatus,\n getAccessFallbackHTTPStatus,\n getAccessFallbackErrorTypeByStatus,\n isHTTPAccessFallbackError,\n} from './http-access-fallback'\nimport { warnOnce } from '../../../shared/lib/utils/warn-once'\nimport { MissingSlotContext } from '../../../shared/lib/app-router-context.shared-runtime'\n\ninterface HTTPAccessFallbackBoundaryProps {\n notFound?: React.ReactNode\n forbidden?: React.ReactNode\n unauthorized?: React.ReactNode\n children: React.ReactNode\n missingSlots?: Set\n}\n\ninterface HTTPAccessFallbackErrorBoundaryProps\n extends HTTPAccessFallbackBoundaryProps {\n pathname: string | null\n missingSlots?: Set\n}\n\ninterface HTTPAccessBoundaryState {\n triggeredStatus: number | undefined\n previousPathname: string | null\n}\n\nclass HTTPAccessFallbackErrorBoundary extends React.Component<\n HTTPAccessFallbackErrorBoundaryProps,\n HTTPAccessBoundaryState\n> {\n constructor(props: HTTPAccessFallbackErrorBoundaryProps) {\n super(props)\n this.state = {\n triggeredStatus: undefined,\n previousPathname: props.pathname,\n }\n }\n\n componentDidCatch(): void {\n if (\n process.env.NODE_ENV === 'development' &&\n this.props.missingSlots &&\n // A missing children slot is the typical not-found case, so no need to warn\n !this.props.missingSlots.has('children')\n ) {\n let warningMessage =\n 'No default component was found for a parallel route rendered on this page. Falling back to nearest NotFound boundary.\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs\\n\\n'\n\n if (this.props.missingSlots.size > 0) {\n const formattedSlots = Array.from(this.props.missingSlots)\n .sort((a, b) => a.localeCompare(b))\n .map((slot) => `@${slot}`)\n .join(', ')\n\n warningMessage += 'Missing slots: ' + formattedSlots\n }\n\n warnOnce(warningMessage)\n }\n }\n\n static getDerivedStateFromError(error: any) {\n if (isHTTPAccessFallbackError(error)) {\n const httpStatus = getAccessFallbackHTTPStatus(error)\n return {\n triggeredStatus: httpStatus,\n }\n }\n // Re-throw if error is not for 404\n throw error\n }\n\n static getDerivedStateFromProps(\n props: HTTPAccessFallbackErrorBoundaryProps,\n state: HTTPAccessBoundaryState\n ): HTTPAccessBoundaryState | null {\n /**\n * Handles reset of the error boundary when a navigation happens.\n * Ensures the error boundary does not stay enabled when navigating to a new page.\n * Approach of setState in render is safe as it checks the previous pathname and then overrides\n * it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\n if (props.pathname !== state.previousPathname && state.triggeredStatus) {\n return {\n triggeredStatus: undefined,\n previousPathname: props.pathname,\n }\n }\n return {\n triggeredStatus: state.triggeredStatus,\n previousPathname: props.pathname,\n }\n }\n\n render() {\n const { notFound, forbidden, unauthorized, children } = this.props\n const { triggeredStatus } = this.state\n const errorComponents = {\n [HTTPAccessErrorStatus.NOT_FOUND]: notFound,\n [HTTPAccessErrorStatus.FORBIDDEN]: forbidden,\n [HTTPAccessErrorStatus.UNAUTHORIZED]: unauthorized,\n }\n\n if (triggeredStatus) {\n const isNotFound =\n triggeredStatus === HTTPAccessErrorStatus.NOT_FOUND && notFound\n const isForbidden =\n triggeredStatus === HTTPAccessErrorStatus.FORBIDDEN && forbidden\n const isUnauthorized =\n triggeredStatus === HTTPAccessErrorStatus.UNAUTHORIZED && unauthorized\n\n // If there's no matched boundary in this layer, keep throwing the error by rendering the children\n if (!(isNotFound || isForbidden || isUnauthorized)) {\n return children\n }\n\n return (\n <>\n \n {process.env.NODE_ENV === 'development' && (\n \n )}\n {errorComponents[triggeredStatus]}\n \n )\n }\n\n return children\n }\n}\n\nexport function HTTPAccessFallbackBoundary({\n notFound,\n forbidden,\n unauthorized,\n children,\n}: HTTPAccessFallbackBoundaryProps) {\n // When we're rendering the missing params shell, this will return null. This\n // is because we won't be rendering any not found boundaries or error\n // boundaries for the missing params shell. When this runs on the client\n // (where these error can occur), we will get the correct pathname.\n const pathname = useUntrackedPathname()\n const missingSlots = useContext(MissingSlotContext)\n const hasErrorFallback = !!(notFound || forbidden || unauthorized)\n\n if (hasErrorFallback) {\n return (\n \n {children}\n \n )\n }\n\n return <>{children}\n}\n","export const HTTPAccessErrorStatus = {\n NOT_FOUND: 404,\n FORBIDDEN: 403,\n UNAUTHORIZED: 401,\n}\n\nconst ALLOWED_CODES = new Set(Object.values(HTTPAccessErrorStatus))\n\nexport const HTTP_ERROR_FALLBACK_ERROR_CODE = 'NEXT_HTTP_ERROR_FALLBACK'\n\nexport type HTTPAccessFallbackError = Error & {\n digest: `${typeof HTTP_ERROR_FALLBACK_ERROR_CODE};${string}`\n}\n\n/**\n * Checks an error to determine if it's an error generated by\n * the HTTP navigation APIs `notFound()`, `forbidden()` or `unauthorized()`.\n *\n * @param error the error that may reference a HTTP access error\n * @returns true if the error is a HTTP access error\n */\nexport function isHTTPAccessFallbackError(\n error: unknown\n): error is HTTPAccessFallbackError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n const [prefix, httpStatus] = error.digest.split(';')\n\n return (\n prefix === HTTP_ERROR_FALLBACK_ERROR_CODE &&\n ALLOWED_CODES.has(Number(httpStatus))\n )\n}\n\nexport function getAccessFallbackHTTPStatus(\n error: HTTPAccessFallbackError\n): number {\n const httpStatus = error.digest.split(';')[1]\n return Number(httpStatus)\n}\n\nexport function getAccessFallbackErrorTypeByStatus(\n status: number\n): 'not-found' | 'forbidden' | 'unauthorized' | undefined {\n switch (status) {\n case 401:\n return 'unauthorized'\n case 403:\n return 'forbidden'\n case 404:\n return 'not-found'\n default:\n return\n }\n}\n","import isError from '../../lib/is-error'\n\nconst hydrationErrorRegex =\n /hydration failed|while hydrating|content does not match|did not match|HTML didn't match/i\n\nconst reactUnifiedMismatchWarning = `Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used`\n\nconst reactHydrationStartMessages = [\n reactUnifiedMismatchWarning,\n `A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:`,\n]\n\nconst reactHydrationErrorDocLink = 'https://react.dev/link/hydration-mismatch'\n\nexport const getDefaultHydrationErrorMessage = () => {\n return reactUnifiedMismatchWarning\n}\n\nexport function isHydrationError(error: unknown): boolean {\n return isError(error) && hydrationErrorRegex.test(error.message)\n}\n\nexport function isReactHydrationErrorMessage(msg: string): boolean {\n return reactHydrationStartMessages.some((prefix) => msg.startsWith(prefix))\n}\n\nexport function getHydrationErrorStackInfo(rawMessage: string): {\n message: string | null\n link?: string\n stack?: string\n diff?: string\n} {\n rawMessage = rawMessage.replace(/^Error: /, '')\n if (!isReactHydrationErrorMessage(rawMessage)) {\n return { message: null }\n }\n const firstLineBreak = rawMessage.indexOf('\\n')\n rawMessage = rawMessage.slice(firstLineBreak + 1).trim()\n\n const [message, trailing] = rawMessage.split(`${reactHydrationErrorDocLink}`)\n const trimmedMessage = message.trim()\n // React built-in hydration diff starts with a newline, checking if length is > 1\n if (trailing && trailing.length > 1) {\n const stacks: string[] = []\n const diffs: string[] = []\n trailing.split('\\n').forEach((line) => {\n if (line.trim() === '') return\n if (line.trim().startsWith('at ')) {\n stacks.push(line)\n } else {\n diffs.push(line)\n }\n })\n\n return {\n message: trimmedMessage,\n link: reactHydrationErrorDocLink,\n diff: diffs.join('\\n'),\n stack: stacks.join('\\n'),\n }\n } else {\n return {\n message: trimmedMessage,\n link: reactHydrationErrorDocLink,\n stack: trailing, // without hydration diff\n }\n }\n}\n","import {\n isHTTPAccessFallbackError,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\nimport { isRedirectError, type RedirectError } from './redirect-error'\n\n/**\n * Returns true if the error is a navigation signal error. These errors are\n * thrown by user code to perform navigation operations and interrupt the React\n * render.\n */\nexport function isNextRouterError(\n error: unknown\n): error is RedirectError | HTTPAccessFallbackError {\n return isRedirectError(error) || isHTTPAccessFallbackError(error)\n}\n","'use client'\n\nimport type {\n ChildSegmentMap,\n LazyCacheNode,\n LoadingModuleData,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n} from '../../server/app-render/types'\nimport type { ErrorComponent } from './error-boundary'\nimport type { FocusAndScrollRef } from './router-reducer/router-reducer-types'\n\nimport React, {\n useContext,\n use,\n startTransition,\n Suspense,\n useDeferredValue,\n type JSX,\n} from 'react'\nimport ReactDOM from 'react-dom'\nimport {\n LayoutRouterContext,\n GlobalLayoutRouterContext,\n TemplateContext,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { fetchServerResponse } from './router-reducer/fetch-server-response'\nimport { unresolvedThenable } from './unresolved-thenable'\nimport { ErrorBoundary } from './error-boundary'\nimport { matchSegment } from './match-segments'\nimport { handleSmoothScroll } from '../../shared/lib/router/utils/handle-smooth-scroll'\nimport { RedirectBoundary } from './redirect-boundary'\nimport { HTTPAccessFallbackBoundary } from './http-access-fallback/error-boundary'\nimport { getSegmentValue } from './router-reducer/reducers/get-segment-value'\nimport { createRouterCacheKey } from './router-reducer/create-router-cache-key'\nimport { hasInterceptionRouteInCurrentTree } from './router-reducer/reducers/has-interception-route-in-current-tree'\n\n/**\n * Add refetch marker to router state at the point of the current layout segment.\n * This ensures the response returned is not further down than the current layout segment.\n */\nfunction walkAddRefetch(\n segmentPathToWalk: FlightSegmentPath | undefined,\n treeToRecreate: FlightRouterState\n): FlightRouterState {\n if (segmentPathToWalk) {\n const [segment, parallelRouteKey] = segmentPathToWalk\n const isLast = segmentPathToWalk.length === 2\n\n if (matchSegment(treeToRecreate[0], segment)) {\n if (treeToRecreate[1].hasOwnProperty(parallelRouteKey)) {\n if (isLast) {\n const subTree = walkAddRefetch(\n undefined,\n treeToRecreate[1][parallelRouteKey]\n )\n return [\n treeToRecreate[0],\n {\n ...treeToRecreate[1],\n [parallelRouteKey]: [\n subTree[0],\n subTree[1],\n subTree[2],\n 'refetch',\n ],\n },\n ]\n }\n\n return [\n treeToRecreate[0],\n {\n ...treeToRecreate[1],\n [parallelRouteKey]: walkAddRefetch(\n segmentPathToWalk.slice(2),\n treeToRecreate[1][parallelRouteKey]\n ),\n },\n ]\n }\n }\n }\n\n return treeToRecreate\n}\n\nconst __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = (\n ReactDOM as any\n).__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE\n\n// TODO-APP: Replace with new React API for finding dom nodes without a `ref` when available\n/**\n * Wraps ReactDOM.findDOMNode with additional logic to hide React Strict Mode warning\n */\nfunction findDOMNode(\n instance: React.ReactInstance | null | undefined\n): Element | Text | null {\n // Tree-shake for server bundle\n if (typeof window === 'undefined') return null\n\n // __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode is null during module init.\n // We need to lazily reference it.\n const internal_reactDOMfindDOMNode =\n __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode\n return internal_reactDOMfindDOMNode(instance)\n}\n\nconst rectProperties = [\n 'bottom',\n 'height',\n 'left',\n 'right',\n 'top',\n 'width',\n 'x',\n 'y',\n] as const\n/**\n * Check if a HTMLElement is hidden or fixed/sticky position\n */\nfunction shouldSkipElement(element: HTMLElement) {\n // we ignore fixed or sticky positioned elements since they'll likely pass the \"in-viewport\" check\n // and will result in a situation we bail on scroll because of something like a fixed nav,\n // even though the actual page content is offscreen\n if (['sticky', 'fixed'].includes(getComputedStyle(element).position)) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'Skipping auto-scroll behavior due to `position: sticky` or `position: fixed` on element:',\n element\n )\n }\n return true\n }\n\n // Uses `getBoundingClientRect` to check if the element is hidden instead of `offsetParent`\n // because `offsetParent` doesn't consider document/body\n const rect = element.getBoundingClientRect()\n return rectProperties.every((item) => rect[item] === 0)\n}\n\n/**\n * Check if the top corner of the HTMLElement is in the viewport.\n */\nfunction topOfElementInViewport(element: HTMLElement, viewportHeight: number) {\n const rect = element.getBoundingClientRect()\n return rect.top >= 0 && rect.top <= viewportHeight\n}\n\n/**\n * Find the DOM node for a hash fragment.\n * If `top` the page has to scroll to the top of the page. This mirrors the browser's behavior.\n * If the hash fragment is an id, the page has to scroll to the element with that id.\n * If the hash fragment is a name, the page has to scroll to the first element with that name.\n */\nfunction getHashFragmentDomNode(hashFragment: string) {\n // If the hash fragment is `top` the page has to scroll to the top of the page.\n if (hashFragment === 'top') {\n return document.body\n }\n\n // If the hash fragment is an id, the page has to scroll to the element with that id.\n return (\n document.getElementById(hashFragment) ??\n // If the hash fragment is a name, the page has to scroll to the first element with that name.\n document.getElementsByName(hashFragment)[0]\n )\n}\ninterface ScrollAndFocusHandlerProps {\n focusAndScrollRef: FocusAndScrollRef\n children: React.ReactNode\n segmentPath: FlightSegmentPath\n}\nclass InnerScrollAndFocusHandler extends React.Component {\n handlePotentialScroll = () => {\n // Handle scroll and focus, it's only applied once in the first useEffect that triggers that changed.\n const { focusAndScrollRef, segmentPath } = this.props\n\n if (focusAndScrollRef.apply) {\n // segmentPaths is an array of segment paths that should be scrolled to\n // if the current segment path is not in the array, the scroll is not applied\n // unless the array is empty, in which case the scroll is always applied\n if (\n focusAndScrollRef.segmentPaths.length !== 0 &&\n !focusAndScrollRef.segmentPaths.some((scrollRefSegmentPath) =>\n segmentPath.every((segment, index) =>\n matchSegment(segment, scrollRefSegmentPath[index])\n )\n )\n ) {\n return\n }\n\n let domNode:\n | ReturnType\n | ReturnType = null\n const hashFragment = focusAndScrollRef.hashFragment\n\n if (hashFragment) {\n domNode = getHashFragmentDomNode(hashFragment)\n }\n\n // `findDOMNode` is tricky because it returns just the first child if the component is a fragment.\n // This already caused a bug where the first child was a in head.\n if (!domNode) {\n domNode = findDOMNode(this)\n }\n\n // If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree.\n if (!(domNode instanceof Element)) {\n return\n }\n\n // Verify if the element is a HTMLElement and if we want to consider it for scroll behavior.\n // If the element is skipped, try to select the next sibling and try again.\n while (!(domNode instanceof HTMLElement) || shouldSkipElement(domNode)) {\n // No siblings found that match the criteria are found, so handle scroll higher up in the tree instead.\n if (domNode.nextElementSibling === null) {\n return\n }\n domNode = domNode.nextElementSibling\n }\n\n // State is mutated to ensure that the focus and scroll is applied only once.\n focusAndScrollRef.apply = false\n focusAndScrollRef.hashFragment = null\n focusAndScrollRef.segmentPaths = []\n\n handleSmoothScroll(\n () => {\n // In case of hash scroll, we only need to scroll the element into view\n if (hashFragment) {\n ;(domNode as HTMLElement).scrollIntoView()\n\n return\n }\n // Store the current viewport height because reading `clientHeight` causes a reflow,\n // and it won't change during this function.\n const htmlElement = document.documentElement\n const viewportHeight = htmlElement.clientHeight\n\n // If the element's top edge is already in the viewport, exit early.\n if (topOfElementInViewport(domNode as HTMLElement, viewportHeight)) {\n return\n }\n\n // Otherwise, try scrolling go the top of the document to be backward compatible with pages\n // scrollIntoView() called on `` element scrolls horizontally on chrome and firefox (that shouldn't happen)\n // We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left\n // scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically\n htmlElement.scrollTop = 0\n\n // Scroll to domNode if domNode is not in viewport when scrolled to top of document\n if (!topOfElementInViewport(domNode as HTMLElement, viewportHeight)) {\n // Scroll into view doesn't scroll horizontally by default when not needed\n ;(domNode as HTMLElement).scrollIntoView()\n }\n },\n {\n // We will force layout by querying domNode position\n dontForceLayout: true,\n onlyHashChange: focusAndScrollRef.onlyHashChange,\n }\n )\n\n // Mutate after scrolling so that it can be read by `handleSmoothScroll`\n focusAndScrollRef.onlyHashChange = false\n\n // Set focus on the element\n domNode.focus()\n }\n }\n\n componentDidMount() {\n this.handlePotentialScroll()\n }\n\n componentDidUpdate() {\n // Because this property is overwritten in handlePotentialScroll it's fine to always run it when true as it'll be set to false for subsequent renders.\n if (this.props.focusAndScrollRef.apply) {\n this.handlePotentialScroll()\n }\n }\n\n render() {\n return this.props.children\n }\n}\n\nfunction ScrollAndFocusHandler({\n segmentPath,\n children,\n}: {\n segmentPath: FlightSegmentPath\n children: React.ReactNode\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n return (\n \n {children}\n \n )\n}\n\n/**\n * InnerLayoutRouter handles rendering the provided segment based on the cache.\n */\nfunction InnerLayoutRouter({\n parallelRouterKey,\n url,\n childNodes,\n segmentPath,\n tree,\n // TODO-APP: implement `` when available.\n // isActive,\n cacheKey,\n}: {\n parallelRouterKey: string\n url: string\n childNodes: ChildSegmentMap\n segmentPath: FlightSegmentPath\n tree: FlightRouterState\n isActive: boolean\n cacheKey: ReturnType\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n const { changeByServerResponse, tree: fullTree } = context\n\n // Read segment path from the parallel router cache node.\n let childNode = childNodes.get(cacheKey)\n\n // When data is not available during rendering client-side we need to fetch\n // it from the server.\n if (childNode === undefined) {\n const newLazyCacheNode: LazyCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n\n /**\n * Flight data fetch kicked off during render and put into the cache.\n */\n childNode = newLazyCacheNode\n childNodes.set(cacheKey, newLazyCacheNode)\n }\n\n // `rsc` represents the renderable node for this segment.\n\n // If this segment has a `prefetchRsc`, it's the statically prefetched data.\n // We should use that on initial render instead of `rsc`. Then we'll switch\n // to `rsc` when the dynamic response streams in.\n //\n // If no prefetch data is available, then we go straight to rendering `rsc`.\n const resolvedPrefetchRsc =\n childNode.prefetchRsc !== null ? childNode.prefetchRsc : childNode.rsc\n\n // We use `useDeferredValue` to handle switching between the prefetched and\n // final values. The second argument is returned on initial render, then it\n // re-renders with the first argument.\n //\n // @ts-expect-error The second argument to `useDeferredValue` is only\n // available in the experimental builds. When its disabled, it will always\n // return `rsc`.\n const rsc: any = useDeferredValue(childNode.rsc, resolvedPrefetchRsc)\n\n // `rsc` is either a React node or a promise for a React node, except we\n // special case `null` to represent that this segment's data is missing. If\n // it's a promise, we need to unwrap it so we can determine whether or not the\n // data is missing.\n const resolvedRsc: React.ReactNode =\n typeof rsc === 'object' && rsc !== null && typeof rsc.then === 'function'\n ? use(rsc)\n : rsc\n\n if (!resolvedRsc) {\n // The data for this segment is not available, and there's no pending\n // navigation that will be able to fulfill it. We need to fetch more from\n // the server and patch the cache.\n\n // Check if there's already a pending request.\n let lazyData = childNode.lazyData\n if (lazyData === null) {\n /**\n * Router state with refetch marker added\n */\n // TODO-APP: remove ''\n const refetchTree = walkAddRefetch(['', ...segmentPath], fullTree)\n const includeNextUrl = hasInterceptionRouteInCurrentTree(fullTree)\n childNode.lazyData = lazyData = fetchServerResponse(\n new URL(url, location.origin),\n {\n flightRouterState: refetchTree,\n nextUrl: includeNextUrl ? context.nextUrl : null,\n }\n ).then((serverResponse) => {\n startTransition(() => {\n changeByServerResponse({\n previousTree: fullTree,\n serverResponse,\n })\n })\n\n return serverResponse\n })\n }\n // Suspend infinitely as `changeByServerResponse` will cause a different part of the tree to be rendered.\n // A falsey `resolvedRsc` indicates missing data -- we should not commit that branch, and we need to wait for the data to arrive.\n use(unresolvedThenable) as never\n }\n\n // If we get to this point, then we know we have something we can render.\n const subtree = (\n // The layout router context narrows down tree and childNodes at each level.\n \n {resolvedRsc}\n \n )\n // Ensure root layout is not wrapped in a div as the root layout renders ``\n return subtree\n}\n\n/**\n * Renders suspense boundary with the provided \"loading\" property as the fallback.\n * If no loading property is provided it renders the children without a suspense boundary.\n */\nfunction LoadingBoundary({\n loading,\n children,\n}: {\n loading: LoadingModuleData | Promise\n children: React.ReactNode\n}): JSX.Element {\n // If loading is a promise, unwrap it. This happens in cases where we haven't\n // yet received the loading data from the server — which includes whether or\n // not this layout has a loading component at all.\n //\n // It's OK to suspend here instead of inside the fallback because this\n // promise will resolve simultaneously with the data for the segment itself.\n // So it will never suspend for longer than it would have if we didn't use\n // a Suspense fallback at all.\n let loadingModuleData\n if (\n typeof loading === 'object' &&\n loading !== null &&\n typeof (loading as any).then === 'function'\n ) {\n const promiseForLoading = loading as Promise\n loadingModuleData = use(promiseForLoading)\n } else {\n loadingModuleData = loading as LoadingModuleData\n }\n\n if (loadingModuleData) {\n const loadingRsc = loadingModuleData[0]\n const loadingStyles = loadingModuleData[1]\n const loadingScripts = loadingModuleData[2]\n return (\n \n {loadingStyles}\n {loadingScripts}\n {loadingRsc}\n \n }\n >\n {children}\n \n )\n }\n\n return <>{children}\n}\n\n/**\n * OuterLayoutRouter handles the current segment as well as rendering of other segments.\n * It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.\n */\nexport default function OuterLayoutRouter({\n parallelRouterKey,\n segmentPath,\n error,\n errorStyles,\n errorScripts,\n templateStyles,\n templateScripts,\n template,\n notFound,\n forbidden,\n unauthorized,\n}: {\n parallelRouterKey: string\n segmentPath: FlightSegmentPath\n error: ErrorComponent | undefined\n errorStyles: React.ReactNode | undefined\n errorScripts: React.ReactNode | undefined\n templateStyles: React.ReactNode | undefined\n templateScripts: React.ReactNode | undefined\n template: React.ReactNode\n notFound: React.ReactNode | undefined\n forbidden: React.ReactNode | undefined\n unauthorized: React.ReactNode | undefined\n}) {\n const context = useContext(LayoutRouterContext)\n if (!context) {\n throw new Error('invariant expected layout router to be mounted')\n }\n\n const { childNodes, tree, url, loading } = context\n\n // Get the current parallelRouter cache node\n let childNodesForParallelRouter = childNodes.get(parallelRouterKey)\n // If the parallel router cache node does not exist yet, create it.\n // This writes to the cache when there is no item in the cache yet. It never *overwrites* existing cache items which is why it's safe in concurrent mode.\n if (!childNodesForParallelRouter) {\n childNodesForParallelRouter = new Map()\n childNodes.set(parallelRouterKey, childNodesForParallelRouter)\n }\n\n // Get the active segment in the tree\n // The reason arrays are used in the data format is that these are transferred from the server to the browser so it's optimized to save bytes.\n const treeSegment = tree[1][parallelRouterKey][0]\n\n // If segment is an array it's a dynamic route and we want to read the dynamic route value as the segment to get from the cache.\n const currentChildSegmentValue = getSegmentValue(treeSegment)\n\n /**\n * Decides which segments to keep rendering, all segments that are not active will be wrapped in ``.\n */\n // TODO-APP: Add handling of `` when it's available.\n const preservedSegments: Segment[] = [treeSegment]\n\n return (\n <>\n {preservedSegments.map((preservedSegment) => {\n const preservedSegmentValue = getSegmentValue(preservedSegment)\n const cacheKey = createRouterCacheKey(preservedSegment)\n\n return (\n /*\n - Error boundary\n - Only renders error boundary if error component is provided.\n - Rendered for each segment to ensure they have their own error state.\n - Loading boundary\n - Only renders suspense boundary if loading components is provided.\n - Rendered for each segment to ensure they have their own loading state.\n - Passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch.\n */\n \n \n \n \n \n \n \n \n \n \n \n }\n >\n {templateStyles}\n {templateScripts}\n {template}\n \n )\n })}\n \n )\n}\n","import { getSegmentParam } from '../../server/app-render/get-segment-param'\nimport type { Segment } from '../../server/app-render/types'\n\nexport const matchSegment = (\n existingSegment: Segment,\n segment: Segment\n): boolean => {\n // segment is either Array or string\n if (typeof existingSegment === 'string') {\n if (typeof segment === 'string') {\n // Common case: segment is just a string\n return existingSegment === segment\n }\n return false\n }\n\n if (typeof segment === 'string') {\n return false\n }\n return existingSegment[0] === segment[0] && existingSegment[1] === segment[1]\n}\n\n/*\n * This function is used to determine if an existing segment can be overridden by the incoming segment.\n */\nexport const canSegmentBeOverridden = (\n existingSegment: Segment,\n segment: Segment\n): boolean => {\n if (Array.isArray(existingSegment) || !Array.isArray(segment)) {\n return false\n }\n\n return getSegmentParam(existingSegment)?.param === segment[0]\n}\n","import { useEffect } from 'react'\nimport { createHrefFromUrl } from './router-reducer/create-href-from-url'\n\nexport function handleHardNavError(error: unknown): boolean {\n if (\n error &&\n typeof window !== 'undefined' &&\n window.next.__pendingUrl &&\n createHrefFromUrl(new URL(window.location.href)) !==\n createHrefFromUrl(window.next.__pendingUrl)\n ) {\n console.error(\n `Error occurred during navigation, falling back to hard navigation`,\n error\n )\n window.location.href = window.next.__pendingUrl.toString()\n return true\n }\n return false\n}\n\nexport function useNavFailureHandler() {\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n // this if is only for DCE of the feature flag not conditional\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n const uncaughtExceptionHandler = (\n evt: ErrorEvent | PromiseRejectionEvent\n ) => {\n const error = 'reason' in evt ? evt.reason : evt.error\n // if we have an unhandled exception/rejection during\n // a navigation we fall back to a hard navigation to\n // attempt recovering to a good state\n handleHardNavError(error)\n }\n window.addEventListener('unhandledrejection', uncaughtExceptionHandler)\n window.addEventListener('error', uncaughtExceptionHandler)\n return () => {\n window.removeEventListener('error', uncaughtExceptionHandler)\n window.removeEventListener(\n 'unhandledrejection',\n uncaughtExceptionHandler\n )\n }\n }, [])\n }\n}\n","import { useContext } from 'react'\nimport { PathnameContext } from '../../shared/lib/hooks-client-context.shared-runtime'\n\n/**\n * This checks to see if the current render has any unknown route parameters.\n * It's used to trigger a different render path in the error boundary.\n *\n * @returns true if there are any unknown route parameters, false otherwise\n */\nfunction hasFallbackRouteParams() {\n if (typeof window === 'undefined') {\n // AsyncLocalStorage should not be included in the client bundle.\n const { workAsyncStorage } =\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n\n const workStore = workAsyncStorage.getStore()\n if (!workStore) return false\n\n const { fallbackRouteParams } = workStore\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) return false\n\n return true\n }\n\n return false\n}\n\n/**\n * This returns a `null` value if there are any unknown route parameters, and\n * otherwise returns the pathname from the context. This is an alternative to\n * `usePathname` that is used in the error boundary to avoid rendering the\n * error boundary when there are unknown route parameters. This doesn't throw\n * when accessed with unknown route parameters.\n *\n * @returns\n *\n * @internal\n */\nexport function useUntrackedPathname(): string | null {\n // If there are any unknown route parameters we would typically throw\n // an error, but this internal method allows us to return a null value instead\n // for components that do not propagate the pathname to the static shell (like\n // the error boundary).\n if (hasFallbackRouteParams()) {\n return null\n }\n\n // This shouldn't cause any issues related to conditional rendering because\n // the environment will be consistent for the render.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useContext(PathnameContext)\n}\n","import type { FlightRouterState } from '../../server/app-render/types'\nimport type { Params } from '../../server/request/params'\n\nimport { useContext, useMemo } from 'react'\nimport {\n AppRouterContext,\n LayoutRouterContext,\n type AppRouterInstance,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n SearchParamsContext,\n PathnameContext,\n PathParamsContext,\n} from '../../shared/lib/hooks-client-context.shared-runtime'\nimport { getSegmentValue } from './router-reducer/reducers/get-segment-value'\nimport { PAGE_SEGMENT_KEY, DEFAULT_SEGMENT_KEY } from '../../shared/lib/segment'\nimport { ReadonlyURLSearchParams } from './navigation.react-server'\nimport { useDynamicRouteParams } from '../../server/app-render/dynamic-rendering'\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you *read* the current URL's search parameters.\n *\n * Learn more about [`URLSearchParams` on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useSearchParams } from 'next/navigation'\n *\n * export default function Page() {\n * const searchParams = useSearchParams()\n * searchParams.get('foo') // returns 'bar' when ?foo=bar\n * // ...\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSearchParams`](https://nextjs.org/docs/app/api-reference/functions/use-search-params)\n */\n// Client components API\nexport function useSearchParams(): ReadonlyURLSearchParams {\n const searchParams = useContext(SearchParamsContext)\n\n // In the case where this is `null`, the compat types added in\n // `next-env.d.ts` will add a new overload that changes the return type to\n // include `null`.\n const readonlySearchParams = useMemo(() => {\n if (!searchParams) {\n // When the router is not ready in pages, we won't have the search params\n // available.\n return null\n }\n\n return new ReadonlyURLSearchParams(searchParams)\n }, [searchParams]) as ReadonlyURLSearchParams\n\n if (typeof window === 'undefined') {\n // AsyncLocalStorage should not be included in the client bundle.\n const { bailoutToClientRendering } =\n require('./bailout-to-client-rendering') as typeof import('./bailout-to-client-rendering')\n // TODO-APP: handle dynamic = 'force-static' here and on the client\n bailoutToClientRendering('useSearchParams()')\n }\n\n return readonlySearchParams\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the current URL's pathname.\n *\n * @example\n * ```ts\n * \"use client\"\n * import { usePathname } from 'next/navigation'\n *\n * export default function Page() {\n * const pathname = usePathname() // returns \"/dashboard\" on /dashboard?foo=bar\n * // ...\n * }\n * ```\n *\n * Read more: [Next.js Docs: `usePathname`](https://nextjs.org/docs/app/api-reference/functions/use-pathname)\n */\n// Client components API\nexport function usePathname(): string {\n useDynamicRouteParams('usePathname()')\n\n // In the case where this is `null`, the compat types added in `next-env.d.ts`\n // will add a new overload that changes the return type to include `null`.\n return useContext(PathnameContext) as string\n}\n\n// Client components API\nexport {\n ServerInsertedHTMLContext,\n useServerInsertedHTML,\n} from '../../shared/lib/server-inserted-html.shared-runtime'\n\n/**\n *\n * This hook allows you to programmatically change routes inside [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components).\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useRouter } from 'next/navigation'\n *\n * export default function Page() {\n * const router = useRouter()\n * // ...\n * router.push('/dashboard') // Navigate to /dashboard\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useRouter`](https://nextjs.org/docs/app/api-reference/functions/use-router)\n */\n// Client components API\nexport function useRouter(): AppRouterInstance {\n const router = useContext(AppRouterContext)\n if (router === null) {\n throw new Error('invariant expected app router to be mounted')\n }\n\n return router\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read a route's dynamic params filled in by the current URL.\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useParams } from 'next/navigation'\n *\n * export default function Page() {\n * // on /dashboard/[team] where pathname is /dashboard/nextjs\n * const { team } = useParams() // team === \"nextjs\"\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useParams`](https://nextjs.org/docs/app/api-reference/functions/use-params)\n */\n// Client components API\nexport function useParams(): T {\n useDynamicRouteParams('useParams()')\n\n return useContext(PathParamsContext) as T\n}\n\n/** Get the canonical parameters from the current level to the leaf node. */\n// Client components API\nfunction getSelectedLayoutSegmentPath(\n tree: FlightRouterState,\n parallelRouteKey: string,\n first = true,\n segmentPath: string[] = []\n): string[] {\n let node: FlightRouterState\n if (first) {\n // Use the provided parallel route key on the first parallel route\n node = tree[1][parallelRouteKey]\n } else {\n // After first parallel route prefer children, if there's no children pick the first parallel route.\n const parallelRoutes = tree[1]\n node = parallelRoutes.children ?? Object.values(parallelRoutes)[0]\n }\n\n if (!node) return segmentPath\n const segment = node[0]\n\n let segmentValue = getSegmentValue(segment)\n\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) {\n return segmentPath\n }\n\n segmentPath.push(segmentValue)\n\n return getSelectedLayoutSegmentPath(\n node,\n parallelRouteKey,\n false,\n segmentPath\n )\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the active route segments **below** the Layout it is called from.\n *\n * @example\n * ```ts\n * 'use client'\n *\n * import { useSelectedLayoutSegments } from 'next/navigation'\n *\n * export default function ExampleClientComponent() {\n * const segments = useSelectedLayoutSegments()\n *\n * return (\n *
    \n * {segments.map((segment, index) => (\n *
  • {segment}
  • \n * ))}\n *
\n * )\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSelectedLayoutSegments`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segments)\n */\n// Client components API\nexport function useSelectedLayoutSegments(\n parallelRouteKey: string = 'children'\n): string[] {\n useDynamicRouteParams('useSelectedLayoutSegments()')\n\n const context = useContext(LayoutRouterContext)\n // @ts-expect-error This only happens in `pages`. Type is overwritten in navigation.d.ts\n if (!context) return null\n\n return getSelectedLayoutSegmentPath(context.tree, parallelRouteKey)\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the active route segment **one level below** the Layout it is called from.\n *\n * @example\n * ```ts\n * 'use client'\n * import { useSelectedLayoutSegment } from 'next/navigation'\n *\n * export default function ExampleClientComponent() {\n * const segment = useSelectedLayoutSegment()\n *\n * return

Active segment: {segment}

\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSelectedLayoutSegment`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segment)\n */\n// Client components API\nexport function useSelectedLayoutSegment(\n parallelRouteKey: string = 'children'\n): string | null {\n useDynamicRouteParams('useSelectedLayoutSegment()')\n\n const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey)\n\n if (!selectedLayoutSegments || selectedLayoutSegments.length === 0) {\n return null\n }\n\n const selectedLayoutSegment =\n parallelRouteKey === 'children'\n ? selectedLayoutSegments[0]\n : selectedLayoutSegments[selectedLayoutSegments.length - 1]\n\n // if the default slot is showing, we return null since it's not technically \"selected\" (it's a fallback)\n // and returning an internal value like `__DEFAULT__` would be confusing.\n return selectedLayoutSegment === DEFAULT_SEGMENT_KEY\n ? null\n : selectedLayoutSegment\n}\n\n// Shared components APIs\nexport {\n notFound,\n forbidden,\n unauthorized,\n redirect,\n permanentRedirect,\n RedirectType,\n ReadonlyURLSearchParams,\n unstable_rethrow,\n} from './navigation.react-server'\n","/** @internal */\nclass ReadonlyURLSearchParamsError extends Error {\n constructor() {\n super(\n 'Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams'\n )\n }\n}\n\nclass ReadonlyURLSearchParams extends URLSearchParams {\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n append() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n delete() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n set() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n sort() {\n throw new ReadonlyURLSearchParamsError()\n }\n}\n\nexport { redirect, permanentRedirect } from './redirect'\nexport { RedirectType } from './redirect-error'\nexport { notFound } from './not-found'\nexport { forbidden } from './forbidden'\nexport { unauthorized } from './unauthorized'\nexport { unstable_rethrow } from './unstable-rethrow'\nexport { ReadonlyURLSearchParams }\n","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n/**\n * This function allows you to render the [not-found.js file](https://nextjs.org/docs/app/api-reference/file-conventions/not-found)\n * within a route segment as well as inject a tag.\n *\n * `notFound()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a `` meta tag and set the status code to 404.\n * - In a Route Handler or Server Action, it will serve a 404 to the caller.\n *\n * Read more: [Next.js Docs: `notFound`](https://nextjs.org/docs/app/api-reference/functions/not-found)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};404`\n\nexport function notFound(): never {\n // eslint-disable-next-line no-throw-literal\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n\n throw error\n}\n","/*\n This is a simple promise queue that allows you to limit the number of concurrent promises\n that are running at any given time. It's used to limit the number of concurrent\n prefetch requests that are being made to the server but could be used for other\n things as well.\n*/\nexport class PromiseQueue {\n #maxConcurrency: number\n #runningCount: number\n #queue: Array<{\n promiseFn: Promise\n task: () => void\n }>\n\n constructor(maxConcurrency = 5) {\n this.#maxConcurrency = maxConcurrency\n this.#runningCount = 0\n this.#queue = []\n }\n\n enqueue(promiseFn: () => Promise): Promise {\n let taskResolve: (value: T | PromiseLike) => void\n let taskReject: (reason?: any) => void\n\n const taskPromise = new Promise((resolve, reject) => {\n taskResolve = resolve\n taskReject = reject\n }) as Promise\n\n const task = async () => {\n try {\n this.#runningCount++\n const result = await promiseFn()\n taskResolve(result)\n } catch (error) {\n taskReject(error)\n } finally {\n this.#runningCount--\n this.#processNext()\n }\n }\n\n const enqueueResult = { promiseFn: taskPromise, task }\n // wonder if we should take a LIFO approach here\n this.#queue.push(enqueueResult)\n this.#processNext()\n\n return taskPromise\n }\n\n bump(promiseFn: Promise) {\n const index = this.#queue.findIndex((item) => item.promiseFn === promiseFn)\n\n if (index > -1) {\n const bumpedItem = this.#queue.splice(index, 1)[0]\n this.#queue.unshift(bumpedItem)\n this.#processNext(true)\n }\n }\n\n #processNext(forced = false) {\n if (\n (this.#runningCount < this.#maxConcurrency || forced) &&\n this.#queue.length > 0\n ) {\n this.#queue.shift()?.task()\n }\n }\n}\n","import {\n isHydrationError,\n getDefaultHydrationErrorMessage,\n} from '../../../is-hydration-error'\nimport {\n hydrationErrorState,\n getReactHydrationDiffSegments,\n} from './hydration-error-info'\n\nexport function attachHydrationErrorState(error: Error) {\n if (\n isHydrationError(error) &&\n !error.message.includes(\n 'https://nextjs.org/docs/messages/react-hydration-error'\n )\n ) {\n const reactHydrationDiffSegments = getReactHydrationDiffSegments(\n error.message\n )\n let parsedHydrationErrorState: typeof hydrationErrorState = {}\n if (reactHydrationDiffSegments) {\n parsedHydrationErrorState = {\n ...(error as any).details,\n ...hydrationErrorState,\n warning: hydrationErrorState.warning || [\n getDefaultHydrationErrorMessage(),\n ],\n notes: reactHydrationDiffSegments[0],\n reactOutputComponentDiff: reactHydrationDiffSegments[1],\n }\n } else {\n // If there's any extra information in the error message to display,\n // append it to the error message details property\n if (hydrationErrorState.warning) {\n // The patched console.error found hydration errors logged by React\n // Append the logged warning to the error message\n parsedHydrationErrorState = {\n ...(error as any).details,\n // It contains the warning, component stack, server and client tag names\n ...hydrationErrorState,\n }\n }\n }\n ;(error as any).details = parsedHydrationErrorState\n }\n}\n","// To distinguish from React error.digest, we use a different symbol here to determine if the error is from console.error or unhandled promise rejection.\nconst digestSym = Symbol.for('next.console.error.digest')\nconst consoleTypeSym = Symbol.for('next.console.error.type')\n\n// Represent non Error shape unhandled promise rejections or console.error errors.\n// Those errors will be captured and displayed in Error Overlay.\ntype UnhandledError = Error & {\n [digestSym]: 'NEXT_UNHANDLED_ERROR'\n [consoleTypeSym]: 'string' | 'error'\n}\n\nexport function createUnhandledError(message: string | Error): UnhandledError {\n const error = (\n typeof message === 'string' ? new Error(message) : message\n ) as UnhandledError\n error[digestSym] = 'NEXT_UNHANDLED_ERROR'\n error[consoleTypeSym] = typeof message === 'string' ? 'string' : 'error'\n return error\n}\n\nexport const isUnhandledConsoleOrRejection = (\n error: any\n): error is UnhandledError => {\n return error && error[digestSym] === 'NEXT_UNHANDLED_ERROR'\n}\n\nexport const getUnhandledErrorType = (error: UnhandledError) => {\n return error[consoleTypeSym]\n}\n","import { isHydrationError } from '../../../is-hydration-error'\n\n// Dedupe the two consecutive errors: If the previous one is same as current one, ignore the current one.\nexport function enqueueConsecutiveDedupedError(\n queue: Array,\n error: Error\n) {\n const isFront = isHydrationError(error)\n const previousError = isFront ? queue[0] : queue[queue.length - 1]\n // Compare the error stack to dedupe the consecutive errors\n if (previousError && previousError.stack === error.stack) {\n return\n }\n // TODO: change all to push error into errorQueue,\n // currently there's a async api error is always erroring while hydration error showing up.\n // Move hydration error to the front of the queue to unblock.\n if (isFront) {\n queue.unshift(error)\n } else {\n queue.push(error)\n }\n}\n","import { getHydrationErrorStackInfo } from '../../../is-hydration-error'\n\nexport type HydrationErrorState = {\n // Hydration warning template format: \n warning?: [string, string, string]\n componentStack?: string\n serverContent?: string\n clientContent?: string\n // React 19 hydration diff format: \n notes?: string\n reactOutputComponentDiff?: string\n}\n\ntype NullableText = string | null | undefined\n\nexport const hydrationErrorState: HydrationErrorState = {}\n\n// https://github.com/facebook/react/blob/main/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js used as a reference\nconst htmlTagsWarnings = new Set([\n 'Warning: In HTML, %s cannot be a child of <%s>.%s\\nThis will cause a hydration error.%s',\n 'Warning: In HTML, %s cannot be a descendant of <%s>.\\nThis will cause a hydration error.%s',\n 'Warning: In HTML, text nodes cannot be a child of <%s>.\\nThis will cause a hydration error.',\n \"Warning: In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.\\nThis will cause a hydration error.\",\n 'Warning: Expected server HTML to contain a matching <%s> in <%s>.%s',\n 'Warning: Did not expect server HTML to contain a <%s> in <%s>.%s',\n])\nconst textAndTagsMismatchWarnings = new Set([\n 'Warning: Expected server HTML to contain a matching text node for \"%s\" in <%s>.%s',\n 'Warning: Did not expect server HTML to contain the text node \"%s\" in <%s>.%s',\n])\nconst textMismatchWarning =\n 'Warning: Text content did not match. Server: \"%s\" Client: \"%s\"%s'\n\nexport const getHydrationWarningType = (\n message: NullableText\n): 'tag' | 'text' | 'text-in-tag' => {\n if (typeof message !== 'string') {\n // TODO: Doesn't make sense to treat no message as a hydration error message.\n // We should bail out somewhere earlier.\n return 'text'\n }\n\n const normalizedMessage = message.startsWith('Warning: ')\n ? message\n : `Warning: ${message}`\n\n if (isHtmlTagsWarning(normalizedMessage)) return 'tag'\n if (isTextInTagsMismatchWarning(normalizedMessage)) return 'text-in-tag'\n\n return 'text'\n}\n\nconst isHtmlTagsWarning = (message: string) => htmlTagsWarnings.has(message)\n\nconst isTextMismatchWarning = (message: string) =>\n textMismatchWarning === message\nconst isTextInTagsMismatchWarning = (msg: string) =>\n textAndTagsMismatchWarnings.has(msg)\n\nconst isKnownHydrationWarning = (message: NullableText) => {\n if (typeof message !== 'string') {\n return false\n }\n // React 18 has the `Warning: ` prefix.\n // React 19 does not.\n const normalizedMessage = message.startsWith('Warning: ')\n ? message\n : `Warning: ${message}`\n\n return (\n isHtmlTagsWarning(normalizedMessage) ||\n isTextInTagsMismatchWarning(normalizedMessage) ||\n isTextMismatchWarning(normalizedMessage)\n )\n}\n\nexport const getReactHydrationDiffSegments = (msg: NullableText) => {\n if (msg) {\n const { message, diff } = getHydrationErrorStackInfo(msg)\n if (message) return [message, diff]\n }\n return undefined\n}\n\n/**\n * Patch console.error to capture hydration errors.\n * If any of the knownHydrationWarnings are logged, store the message and component stack.\n * When the hydration runtime error is thrown, the message and component stack are added to the error.\n * This results in a more helpful error message in the error overlay.\n */\n\nexport function storeHydrationErrorStateFromConsoleArgs(...args: any[]) {\n const [msg, serverContent, clientContent, componentStack] = args\n if (isKnownHydrationWarning(msg)) {\n hydrationErrorState.warning = [\n // remove the last %s from the message\n msg,\n serverContent,\n clientContent,\n ]\n hydrationErrorState.componentStack = componentStack\n hydrationErrorState.serverContent = serverContent\n hydrationErrorState.clientContent = clientContent\n }\n}\n","import React from 'react'\nimport isError from '../../../../../lib/is-error'\n\nconst REACT_ERROR_STACK_BOTTOM_FRAME = 'react-stack-bottom-frame'\nconst REACT_ERROR_STACK_BOTTOM_FRAME_REGEX = new RegExp(\n `(at ${REACT_ERROR_STACK_BOTTOM_FRAME} )|(${REACT_ERROR_STACK_BOTTOM_FRAME}\\\\@)`\n)\n\nconst captureOwnerStack = (React as any).captureOwnerStack\n ? (React as any).captureOwnerStack\n : () => ''\n\nexport function getReactStitchedError(err: T): Error | T {\n if (typeof (React as any).captureOwnerStack !== 'function') {\n return err\n }\n const isErrorInstance = isError(err)\n const originStack = isErrorInstance ? err.stack || '' : ''\n const originMessage = isErrorInstance ? err.message : ''\n const stackLines = originStack.split('\\n')\n const indexOfSplit = stackLines.findIndex((line) =>\n REACT_ERROR_STACK_BOTTOM_FRAME_REGEX.test(line)\n )\n const isOriginalReactError = indexOfSplit >= 0 // has the react-stack-bottom-frame\n let newStack = isOriginalReactError\n ? stackLines.slice(0, indexOfSplit).join('\\n')\n : originStack\n\n const newError = new Error(originMessage)\n // Copy all enumerable properties, e.g. digest\n Object.assign(newError, err)\n newError.stack = newStack\n\n // Avoid duplicate overriding stack frames\n appendOwnerStack(newError)\n\n return newError\n}\n\nfunction appendOwnerStack(error: Error) {\n let stack = error.stack || ''\n // Avoid duplicate overriding stack frames\n const ownerStack = captureOwnerStack()\n if (ownerStack && stack.endsWith(ownerStack) === false) {\n stack += ownerStack\n // Override stack\n error.stack = stack\n }\n}\n","import { useEffect } from 'react'\nimport { attachHydrationErrorState } from './attach-hydration-error-state'\nimport { isNextRouterError } from '../../../is-next-router-error'\nimport { storeHydrationErrorStateFromConsoleArgs } from './hydration-error-info'\nimport { formatConsoleArgs } from '../../../../lib/console'\nimport isError from '../../../../../lib/is-error'\nimport { createUnhandledError } from './console-error'\nimport { enqueueConsecutiveDedupedError } from './enqueue-client-error'\nimport { getReactStitchedError } from './stitched-error'\n\nconst queueMicroTask =\n globalThis.queueMicrotask || ((cb: () => void) => Promise.resolve().then(cb))\n\nexport type ErrorHandler = (error: Error) => void\n\nconst errorQueue: Array = []\nconst errorHandlers: Array = []\nconst rejectionQueue: Array = []\nconst rejectionHandlers: Array = []\n\nexport function handleClientError(\n originError: unknown,\n consoleErrorArgs: any[],\n capturedFromConsole: boolean = false\n) {\n let error: Error\n if (!originError || !isError(originError)) {\n // If it's not an error, format the args into an error\n const formattedErrorMessage = formatConsoleArgs(consoleErrorArgs)\n error = createUnhandledError(formattedErrorMessage)\n } else {\n error = capturedFromConsole\n ? createUnhandledError(originError)\n : originError\n }\n error = getReactStitchedError(error)\n\n storeHydrationErrorStateFromConsoleArgs(...consoleErrorArgs)\n attachHydrationErrorState(error)\n\n enqueueConsecutiveDedupedError(errorQueue, error)\n for (const handler of errorHandlers) {\n // Delayed the error being passed to React Dev Overlay,\n // avoid the state being synchronously updated in the component.\n queueMicroTask(() => {\n handler(error)\n })\n }\n}\n\nexport function useErrorHandler(\n handleOnUnhandledError: ErrorHandler,\n handleOnUnhandledRejection: ErrorHandler\n) {\n useEffect(() => {\n // Handle queued errors.\n errorQueue.forEach(handleOnUnhandledError)\n rejectionQueue.forEach(handleOnUnhandledRejection)\n\n // Listen to new errors.\n errorHandlers.push(handleOnUnhandledError)\n rejectionHandlers.push(handleOnUnhandledRejection)\n\n return () => {\n // Remove listeners.\n errorHandlers.splice(errorHandlers.indexOf(handleOnUnhandledError), 1)\n rejectionHandlers.splice(\n rejectionHandlers.indexOf(handleOnUnhandledRejection),\n 1\n )\n }\n }, [handleOnUnhandledError, handleOnUnhandledRejection])\n}\n\nfunction onUnhandledError(event: WindowEventMap['error']): void | boolean {\n if (isNextRouterError(event.error)) {\n event.preventDefault()\n return false\n }\n handleClientError(event.error, [])\n}\n\nfunction onUnhandledRejection(ev: WindowEventMap['unhandledrejection']): void {\n const reason = ev?.reason\n if (isNextRouterError(reason)) {\n ev.preventDefault()\n return\n }\n\n let error = reason\n if (error && !isError(error)) {\n error = createUnhandledError(error + '')\n }\n\n rejectionQueue.push(error)\n for (const handler of rejectionHandlers) {\n handler(error)\n }\n}\n\nexport function handleGlobalErrors() {\n if (typeof window !== 'undefined') {\n try {\n // Increase the number of stack frames on the client\n Error.stackTraceLimit = 50\n } catch {}\n\n window.addEventListener('error', onUnhandledError)\n window.addEventListener('unhandledrejection', onUnhandledRejection)\n }\n}\n","'use client'\nimport React, { useEffect } from 'react'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useRouter } from './navigation'\nimport { getRedirectTypeFromError, getURLFromRedirectError } from './redirect'\nimport { RedirectType, isRedirectError } from './redirect-error'\n\ninterface RedirectBoundaryProps {\n router: AppRouterInstance\n children: React.ReactNode\n}\n\nfunction HandleRedirect({\n redirect,\n reset,\n redirectType,\n}: {\n redirect: string\n redirectType: RedirectType\n reset: () => void\n}) {\n const router = useRouter()\n\n useEffect(() => {\n React.startTransition(() => {\n if (redirectType === RedirectType.push) {\n router.push(redirect, {})\n } else {\n router.replace(redirect, {})\n }\n reset()\n })\n }, [redirect, redirectType, reset, router])\n\n return null\n}\n\nexport class RedirectErrorBoundary extends React.Component<\n RedirectBoundaryProps,\n { redirect: string | null; redirectType: RedirectType | null }\n> {\n constructor(props: RedirectBoundaryProps) {\n super(props)\n this.state = { redirect: null, redirectType: null }\n }\n\n static getDerivedStateFromError(error: any) {\n if (isRedirectError(error)) {\n const url = getURLFromRedirectError(error)\n const redirectType = getRedirectTypeFromError(error)\n return { redirect: url, redirectType }\n }\n // Re-throw if error is not for redirect\n throw error\n }\n\n // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.\n render(): React.ReactNode {\n const { redirect, redirectType } = this.state\n if (redirect !== null && redirectType !== null) {\n return (\n this.setState({ redirect: null })}\n />\n )\n }\n\n return this.props.children\n }\n}\n\nexport function RedirectBoundary({ children }: { children: React.ReactNode }) {\n const router = useRouter()\n return (\n {children}\n )\n}\n","import { RedirectStatusCode } from './redirect-status-code'\n\nexport const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT'\n\nexport enum RedirectType {\n push = 'push',\n replace = 'replace',\n}\n\nexport type RedirectError = Error & {\n digest: `${typeof REDIRECT_ERROR_CODE};${RedirectType};${string};${RedirectStatusCode};`\n}\n\n/**\n * Checks an error to determine if it's an error generated by the\n * `redirect(url)` helper.\n *\n * @param error the error that may reference a redirect error\n * @returns true if the error is a redirect error\n */\nexport function isRedirectError(error: unknown): error is RedirectError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n\n const digest = error.digest.split(';')\n const [errorCode, type] = digest\n const destination = digest.slice(2, -2).join(';')\n const status = digest.at(-2)\n\n const statusCode = Number(status)\n\n return (\n errorCode === REDIRECT_ERROR_CODE &&\n (type === 'replace' || type === 'push') &&\n typeof destination === 'string' &&\n !isNaN(statusCode) &&\n statusCode in RedirectStatusCode\n )\n}\n","export enum RedirectStatusCode {\n SeeOther = 303,\n TemporaryRedirect = 307,\n PermanentRedirect = 308,\n}\n","import { actionAsyncStorage } from '../../server/app-render/action-async-storage.external'\nimport { RedirectStatusCode } from './redirect-status-code'\nimport {\n RedirectType,\n type RedirectError,\n isRedirectError,\n REDIRECT_ERROR_CODE,\n} from './redirect-error'\n\nexport function getRedirectError(\n url: string,\n type: RedirectType,\n statusCode: RedirectStatusCode = RedirectStatusCode.TemporaryRedirect\n): RedirectError {\n const error = new Error(REDIRECT_ERROR_CODE) as RedirectError\n error.digest = `${REDIRECT_ERROR_CODE};${type};${url};${statusCode};`\n return error\n}\n\n/**\n * This function allows you to redirect the user to another URL. It can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a meta tag to redirect the user to the target page.\n * - In a Route Handler or Server Action, it will serve a 307/303 to the caller.\n * - In a Server Action, type defaults to 'push' and 'replace' elsewhere.\n *\n * Read more: [Next.js Docs: `redirect`](https://nextjs.org/docs/app/api-reference/functions/redirect)\n */\nexport function redirect(\n /** The URL to redirect to */\n url: string,\n type?: RedirectType\n): never {\n const actionStore = actionAsyncStorage.getStore()\n const redirectType =\n type || (actionStore?.isAction ? RedirectType.push : RedirectType.replace)\n throw getRedirectError(\n url,\n redirectType,\n RedirectStatusCode.TemporaryRedirect\n )\n}\n\n/**\n * This function allows you to redirect the user to another URL. It can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a meta tag to redirect the user to the target page.\n * - In a Route Handler or Server Action, it will serve a 308/303 to the caller.\n *\n * Read more: [Next.js Docs: `redirect`](https://nextjs.org/docs/app/api-reference/functions/redirect)\n */\nexport function permanentRedirect(\n /** The URL to redirect to */\n url: string,\n type: RedirectType = RedirectType.replace\n): never {\n throw getRedirectError(url, type, RedirectStatusCode.PermanentRedirect)\n}\n\n/**\n * Returns the encoded URL from the error if it's a RedirectError, null\n * otherwise. Note that this does not validate the URL returned.\n *\n * @param error the error that may be a redirect error\n * @return the url if the error was a redirect error\n */\nexport function getURLFromRedirectError(error: RedirectError): string\nexport function getURLFromRedirectError(error: unknown): string | null {\n if (!isRedirectError(error)) return null\n\n // Slices off the beginning of the digest that contains the code and the\n // separating ';'.\n return error.digest.split(';').slice(2, -2).join(';')\n}\n\nexport function getRedirectTypeFromError(error: RedirectError): RedirectType {\n if (!isRedirectError(error)) {\n throw new Error('Not a redirect error')\n }\n\n return error.digest.split(';', 2)[1] as RedirectType\n}\n\nexport function getRedirectStatusCodeFromError(error: RedirectError): number {\n if (!isRedirectError(error)) {\n throw new Error('Not a redirect error')\n }\n\n return Number(error.digest.split(';').at(-2))\n}\n","'use client'\n\nimport React, { useContext, type JSX } from 'react'\nimport { TemplateContext } from '../../shared/lib/app-router-context.shared-runtime'\n\nexport default function RenderFromTemplateContext(): JSX.Element {\n const children = useContext(TemplateContext)\n return <>{children}\n}\n","import type {\n CacheNodeSeedData,\n FlightRouterState,\n} from '../../../server/app-render/types'\nimport type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport {\n addSearchParamsIfPageSegment,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { createEmptyCacheNode } from '../app-router'\nimport { applyRouterStatePatchToTree } from './apply-router-state-patch-to-tree'\nimport { createHrefFromUrl } from './create-href-from-url'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport { fillCacheWithNewSubTreeDataButOnlyLoading } from './fill-cache-with-new-subtree-data'\nimport { handleMutable } from './handle-mutable'\nimport type { Mutable, ReadonlyReducerState } from './router-reducer-types'\n\n/**\n * This is a stop-gap until per-segment caching is implemented. It leverages the `aliased` flag that is added\n * to prefetch entries when it's determined that the loading state from that entry should be used for this navigation.\n * This function takes the aliased entry and only applies the loading state to the updated cache node.\n * We should remove this once per-segment fetching is implemented as ideally the prefetch cache will contain a\n * more granular segment map and so the router will be able to simply re-use the loading segment for the new navigation.\n */\nexport function handleAliasedPrefetchEntry(\n state: ReadonlyReducerState,\n flightData: NormalizedFlightData[],\n url: URL,\n mutable: Mutable\n) {\n let currentTree = state.tree\n let currentCache = state.cache\n const href = createHrefFromUrl(url)\n let applied\n\n for (const normalizedFlightData of flightData) {\n // If the segment doesn't have a loading component, we don't need to do anything.\n if (!hasLoadingComponentInSeedData(normalizedFlightData.seedData)) {\n continue\n }\n\n let treePatch = normalizedFlightData.tree\n // Segments are keyed by searchParams (e.g. __PAGE__?{\"foo\":\"bar\"}). We might return a less specific, param-less entry,\n // so we ensure that the final tree contains the correct searchParams (reflected in the URL) are provided in the updated FlightRouterState tree.\n // We only do this on the first read, as otherwise we'd be overwriting the searchParams that may have already been set\n treePatch = addSearchParamsToPageSegments(\n treePatch,\n Object.fromEntries(url.searchParams)\n )\n\n const { seedData, isRootRender, pathToSegment } = normalizedFlightData\n // TODO-APP: remove ''\n const flightSegmentPathWithLeadingEmpty = ['', ...pathToSegment]\n\n // Segments are keyed by searchParams (e.g. __PAGE__?{\"foo\":\"bar\"}). We might return a less specific, param-less entry,\n // so we ensure that the final tree contains the correct searchParams (reflected in the URL) are provided in the updated FlightRouterState tree.\n // We only do this on the first read, as otherwise we'd be overwriting the searchParams that may have already been set\n treePatch = addSearchParamsToPageSegments(\n treePatch,\n Object.fromEntries(url.searchParams)\n )\n\n let newTree = applyRouterStatePatchToTree(\n flightSegmentPathWithLeadingEmpty,\n currentTree,\n treePatch,\n href\n )\n\n const newCache = createEmptyCacheNode()\n\n // The prefetch cache entry was aliased -- this signals that we only fill in the cache with the\n // loading state and not the actual parallel route seed data.\n if (isRootRender && seedData) {\n // Fill in the cache with the new loading / rsc data\n const rsc = seedData[1]\n const loading = seedData[3]\n newCache.loading = loading\n newCache.rsc = rsc\n\n // Construct a new tree and apply the aliased loading state for each parallel route\n fillNewTreeWithOnlyLoadingSegments(\n newCache,\n currentCache,\n treePatch,\n seedData\n )\n } else {\n // Copy rsc for the root node of the cache.\n newCache.rsc = currentCache.rsc\n newCache.prefetchRsc = currentCache.prefetchRsc\n newCache.loading = currentCache.loading\n newCache.parallelRoutes = new Map(currentCache.parallelRoutes)\n\n // copy the loading state only into the leaf node (the part that changed)\n fillCacheWithNewSubTreeDataButOnlyLoading(\n newCache,\n currentCache,\n normalizedFlightData\n )\n }\n\n // If we don't have an updated tree, there's no reason to update the cache, as the tree\n // dictates what cache nodes to render.\n if (newTree) {\n currentTree = newTree\n currentCache = newCache\n applied = true\n }\n }\n\n if (!applied) {\n return false\n }\n\n mutable.patchedTree = currentTree\n mutable.cache = currentCache\n mutable.canonicalUrl = href\n mutable.hashFragment = url.hash\n\n return handleMutable(state, mutable)\n}\n\nfunction hasLoadingComponentInSeedData(seedData: CacheNodeSeedData | null) {\n if (!seedData) return false\n\n const parallelRoutes = seedData[2]\n const loading = seedData[3]\n\n if (loading) {\n return true\n }\n\n for (const key in parallelRoutes) {\n if (hasLoadingComponentInSeedData(parallelRoutes[key])) {\n return true\n }\n }\n\n return false\n}\n\nfunction fillNewTreeWithOnlyLoadingSegments(\n newCache: CacheNode,\n existingCache: CacheNode,\n routerState: FlightRouterState,\n cacheNodeSeedData: CacheNodeSeedData | null\n) {\n const isLastSegment = Object.keys(routerState[1]).length === 0\n if (isLastSegment) {\n return\n }\n\n for (const key in routerState[1]) {\n const parallelRouteState = routerState[1][key]\n const segmentForParallelRoute = parallelRouteState[0]\n const cacheKey = createRouterCacheKey(segmentForParallelRoute)\n\n const parallelSeedData =\n cacheNodeSeedData !== null && cacheNodeSeedData[2][key] !== undefined\n ? cacheNodeSeedData[2][key]\n : null\n\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const rsc = parallelSeedData[1]\n const loading = parallelSeedData[3]\n newCacheNode = {\n lazyData: null,\n // copy the layout but null the page segment as that's not meant to be used\n rsc: segmentForParallelRoute.includes(PAGE_SEGMENT_KEY) ? null : rsc,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading,\n }\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n }\n\n const existingParallelRoutes = newCache.parallelRoutes.get(key)\n if (existingParallelRoutes) {\n existingParallelRoutes.set(cacheKey, newCacheNode)\n } else {\n newCache.parallelRoutes.set(key, new Map([[cacheKey, newCacheNode]]))\n }\n\n fillNewTreeWithOnlyLoadingSegments(\n newCacheNode,\n existingCache,\n parallelRouteState,\n parallelSeedData\n )\n }\n}\n\n/**\n * Add search params to the page segments in the flight router state\n * Page segments that are associated with search params have a page segment key\n * followed by a query string. This function will add those params to the page segment.\n * This is useful if we return an aliased prefetch entry (ie, won't have search params)\n * but the canonical router URL has search params.\n */\nexport function addSearchParamsToPageSegments(\n flightRouterState: FlightRouterState,\n searchParams: Record\n): FlightRouterState {\n const [segment, parallelRoutes, ...rest] = flightRouterState\n\n // If it's a page segment, modify the segment by adding search params\n if (segment.includes(PAGE_SEGMENT_KEY)) {\n const newSegment = addSearchParamsIfPageSegment(segment, searchParams)\n return [newSegment, parallelRoutes, ...rest]\n }\n\n // Otherwise, recurse through the parallel routes and return a new tree\n const updatedParallelRoutes: { [key: string]: FlightRouterState } = {}\n\n for (const [key, parallelRoute] of Object.entries(parallelRoutes)) {\n updatedParallelRoutes[key] = addSearchParamsToPageSegments(\n parallelRoute,\n searchParams\n )\n }\n\n return [segment, updatedParallelRoutes, ...rest]\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'\nimport { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data'\nimport type { PrefetchCacheEntry } from './router-reducer-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\n\nexport function applyFlightData(\n existingCache: CacheNode,\n cache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry?: PrefetchCacheEntry\n): boolean {\n // The one before last item is the router state tree patch\n const { tree: treePatch, seedData, head, isRootRender } = flightData\n\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (seedData === null) {\n return false\n }\n\n if (isRootRender) {\n const rsc = seedData[1]\n const loading = seedData[3]\n cache.loading = loading\n cache.rsc = rsc\n // This is a PPR-only field. When PPR is enabled, we shouldn't hit\n // this path during a navigation, but until PPR is fully implemented\n // yet it's possible the existing node does have a non-null\n // `prefetchRsc`. As an incremental step, we'll just de-opt to the\n // old behavior — no PPR value.\n cache.prefetchRsc = null\n fillLazyItemsTillLeafWithHead(\n cache,\n existingCache,\n treePatch,\n seedData,\n head,\n prefetchEntry\n )\n } else {\n // Copy rsc for the root node of the cache.\n cache.rsc = existingCache.rsc\n // This is a PPR-only field. Unlike the previous branch, since we're\n // just cloning the existing cache node, we might as well keep the\n // PPR value, if it exists.\n cache.prefetchRsc = existingCache.prefetchRsc\n cache.parallelRoutes = new Map(existingCache.parallelRoutes)\n cache.loading = existingCache.loading\n // Create a copy of the existing cache with the rsc applied.\n fillCacheWithNewSubTreeData(cache, existingCache, flightData, prefetchEntry)\n }\n\n return true\n}\n","import type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../server/app-render/types'\nimport { DEFAULT_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\nimport { matchSegment } from '../match-segments'\nimport { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-parallel-segments'\n\n/**\n * Deep merge of the two router states. Parallel route keys are preserved if the patch doesn't have them.\n */\nfunction applyPatch(\n initialTree: FlightRouterState,\n patchTree: FlightRouterState\n): FlightRouterState {\n const [initialSegment, initialParallelRoutes] = initialTree\n const [patchSegment, patchParallelRoutes] = patchTree\n\n // if the applied patch segment is __DEFAULT__ then it can be ignored in favor of the initial tree\n // this is because the __DEFAULT__ segment is used as a placeholder on navigation\n if (\n patchSegment === DEFAULT_SEGMENT_KEY &&\n initialSegment !== DEFAULT_SEGMENT_KEY\n ) {\n return initialTree\n }\n\n if (matchSegment(initialSegment, patchSegment)) {\n const newParallelRoutes: FlightRouterState[1] = {}\n for (const key in initialParallelRoutes) {\n const isInPatchTreeParallelRoutes =\n typeof patchParallelRoutes[key] !== 'undefined'\n if (isInPatchTreeParallelRoutes) {\n newParallelRoutes[key] = applyPatch(\n initialParallelRoutes[key],\n patchParallelRoutes[key]\n )\n } else {\n newParallelRoutes[key] = initialParallelRoutes[key]\n }\n }\n\n for (const key in patchParallelRoutes) {\n if (newParallelRoutes[key]) {\n continue\n }\n\n newParallelRoutes[key] = patchParallelRoutes[key]\n }\n\n const tree: FlightRouterState = [initialSegment, newParallelRoutes]\n\n // Copy over the existing tree\n if (initialTree[2]) {\n tree[2] = initialTree[2]\n }\n\n if (initialTree[3]) {\n tree[3] = initialTree[3]\n }\n\n if (initialTree[4]) {\n tree[4] = initialTree[4]\n }\n\n return tree\n }\n\n return patchTree\n}\n\n/**\n * Apply the router state from the Flight response, but skip patching default segments.\n * Useful for patching the router cache when navigating, where we persist the existing default segment if there isn't a new one.\n * Creates a new router state tree.\n */\nexport function applyRouterStatePatchToTree(\n flightSegmentPath: FlightSegmentPath,\n flightRouterState: FlightRouterState,\n treePatch: FlightRouterState,\n path: string\n): FlightRouterState | null {\n const [segment, parallelRoutes, url, refetch, isRootLayout] =\n flightRouterState\n\n // Root refresh\n if (flightSegmentPath.length === 1) {\n const tree: FlightRouterState = applyPatch(flightRouterState, treePatch)\n\n addRefreshMarkerToActiveParallelSegments(tree, path)\n\n return tree\n }\n\n const [currentSegment, parallelRouteKey] = flightSegmentPath\n\n // Tree path returned from the server should always match up with the current tree in the browser\n if (!matchSegment(currentSegment, segment)) {\n return null\n }\n\n const lastSegment = flightSegmentPath.length === 2\n\n let parallelRoutePatch\n if (lastSegment) {\n parallelRoutePatch = applyPatch(parallelRoutes[parallelRouteKey], treePatch)\n } else {\n parallelRoutePatch = applyRouterStatePatchToTree(\n getNextFlightSegmentPath(flightSegmentPath),\n parallelRoutes[parallelRouteKey],\n treePatch,\n path\n )\n\n if (parallelRoutePatch === null) {\n return null\n }\n }\n\n const tree: FlightRouterState = [\n flightSegmentPath[0],\n {\n ...parallelRoutes,\n [parallelRouteKey]: parallelRoutePatch,\n },\n url,\n refetch,\n ]\n\n // Current segment is the root layout\n if (isRootLayout) {\n tree[4] = true\n }\n\n addRefreshMarkerToActiveParallelSegments(tree, path)\n\n return tree\n}\n","import type { FlightSegmentPath } from '../../../server/app-render/types'\nimport type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\nimport { createRouterCacheKey } from './create-router-cache-key'\n\n/**\n * This will clear the CacheNode data for a particular segment path. This will cause a lazy-fetch in layout router to fill in new data.\n */\nexport function clearCacheNodeDataForSegmentPath(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightSegmentPath: FlightSegmentPath\n): void {\n const isLastEntry = flightSegmentPath.length <= 2\n\n const [parallelRouteKey, segment] = flightSegmentPath\n const cacheKey = createRouterCacheKey(segment)\n\n const existingChildSegmentMap =\n existingCache.parallelRoutes.get(parallelRouteKey)\n\n let childSegmentMap = newCache.parallelRoutes.get(parallelRouteKey)\n\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap)\n newCache.parallelRoutes.set(parallelRouteKey, childSegmentMap)\n }\n\n const existingChildCacheNode = existingChildSegmentMap?.get(cacheKey)\n let childCacheNode = childSegmentMap.get(cacheKey)\n\n // In case of last segment start off the fetch at this level and don't copy further down.\n if (isLastEntry) {\n if (\n !childCacheNode ||\n !childCacheNode.lazyData ||\n childCacheNode === existingChildCacheNode\n ) {\n childSegmentMap.set(cacheKey, {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n })\n }\n return\n }\n\n if (!childCacheNode || !existingChildCacheNode) {\n // Start fetch in the place where the existing cache doesn't have the data yet.\n if (!childCacheNode) {\n childSegmentMap.set(cacheKey, {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n })\n }\n return\n }\n\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n loading: childCacheNode.loading,\n } as CacheNode\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n\n return clearCacheNodeDataForSegmentPath(\n childCacheNode,\n existingChildCacheNode,\n getNextFlightSegmentPath(flightSegmentPath)\n )\n}\n","import type {\n FlightRouterState,\n Segment,\n} from '../../../server/app-render/types'\nimport { INTERCEPTION_ROUTE_MARKERS } from '../../../server/lib/interception-routes'\nimport type { Params } from '../../../server/request/params'\nimport {\n isGroupSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\n\nconst removeLeadingSlash = (segment: string): string => {\n return segment[0] === '/' ? segment.slice(1) : segment\n}\n\nconst segmentToPathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n // 'children' is not a valid path -- it's technically a parallel route that corresponds with the current segment's page\n // if we don't skip it, then the computed pathname might be something like `/children` which doesn't make sense.\n if (segment === 'children') return ''\n\n return segment\n }\n\n return segment[1]\n}\n\nfunction normalizeSegments(segments: string[]): string {\n return (\n segments.reduce((acc, segment) => {\n segment = removeLeadingSlash(segment)\n if (segment === '' || isGroupSegment(segment)) {\n return acc\n }\n\n return `${acc}/${segment}`\n }, '') || '/'\n )\n}\n\nexport function extractPathFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const segment = Array.isArray(flightRouterState[0])\n ? flightRouterState[0][1]\n : flightRouterState[0]\n\n if (\n segment === DEFAULT_SEGMENT_KEY ||\n INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m))\n )\n return undefined\n\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return ''\n\n const segments = [segmentToPathname(segment)]\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractPathFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n segments.push(childrenPath)\n } else {\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractPathFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n segments.push(childPath)\n }\n }\n }\n\n return normalizeSegments(segments)\n}\n\nfunction computeChangedPathImpl(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const [segmentA, parallelRoutesA] = treeA\n const [segmentB, parallelRoutesB] = treeB\n\n const normalizedSegmentA = segmentToPathname(segmentA)\n const normalizedSegmentB = segmentToPathname(segmentB)\n\n if (\n INTERCEPTION_ROUTE_MARKERS.some(\n (m) =>\n normalizedSegmentA.startsWith(m) || normalizedSegmentB.startsWith(m)\n )\n ) {\n return ''\n }\n\n if (!matchSegment(segmentA, segmentB)) {\n // once we find where the tree changed, we compute the rest of the path by traversing the tree\n return extractPathFromFlightRouterState(treeB) ?? ''\n }\n\n for (const parallelRouterKey in parallelRoutesA) {\n if (parallelRoutesB[parallelRouterKey]) {\n const changedPath = computeChangedPathImpl(\n parallelRoutesA[parallelRouterKey],\n parallelRoutesB[parallelRouterKey]\n )\n if (changedPath !== null) {\n return `${segmentToPathname(segmentB)}/${changedPath}`\n }\n }\n }\n\n return null\n}\n\nexport function computeChangedPath(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const changedPath = computeChangedPathImpl(treeA, treeB)\n\n if (changedPath == null || changedPath === '/') {\n return changedPath\n }\n\n // lightweight normalization to remove route groups\n return normalizeSegments(changedPath.split('/'))\n}\n\n/**\n * Recursively extracts dynamic parameters from FlightRouterState.\n */\nexport function getSelectedParams(\n currentTree: FlightRouterState,\n params: Params = {}\n): Params {\n const parallelRoutes = currentTree[1]\n\n for (const parallelRoute of Object.values(parallelRoutes)) {\n const segment = parallelRoute[0]\n const isDynamicParameter = Array.isArray(segment)\n const segmentValue = isDynamicParameter ? segment[1] : segment\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) continue\n\n // Ensure catchAll and optional catchall are turned into an array\n const isCatchAll =\n isDynamicParameter && (segment[2] === 'c' || segment[2] === 'oc')\n\n if (isCatchAll) {\n params[segment[0]] = segment[1].split('/')\n } else if (isDynamicParameter) {\n params[segment[0]] = segment[1]\n }\n\n params = getSelectedParams(parallelRoute, params)\n }\n\n return params\n}\n","export function createHrefFromUrl(\n url: Pick,\n includeHash: boolean = true\n): string {\n return url.pathname + url.search + (includeHash ? url.hash : '')\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { FlightDataPath } from '../../../server/app-render/types'\n\nimport { createHrefFromUrl } from './create-href-from-url'\nimport { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'\nimport { extractPathFromFlightRouterState } from './compute-changed-path'\nimport { createSeededPrefetchCacheEntry } from './prefetch-cache-utils'\nimport { PrefetchKind, type PrefetchCacheEntry } from './router-reducer-types'\nimport { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-parallel-segments'\nimport { getFlightDataPartsFromPath } from '../../flight-data-helpers'\n\nexport interface InitialRouterStateParameters {\n initialCanonicalUrlParts: string[]\n initialParallelRoutes: CacheNode['parallelRoutes']\n initialFlightData: FlightDataPath[]\n location: Location | null\n couldBeIntercepted: boolean\n postponed: boolean\n prerendered: boolean\n}\n\nexport function createInitialRouterState({\n initialFlightData,\n initialCanonicalUrlParts,\n initialParallelRoutes,\n location,\n couldBeIntercepted,\n postponed,\n prerendered,\n}: InitialRouterStateParameters) {\n // When initialized on the server, the canonical URL is provided as an array of parts.\n // This is to ensure that when the RSC payload streamed to the client, crawlers don't interpret it\n // as a URL that should be crawled.\n const initialCanonicalUrl = initialCanonicalUrlParts.join('/')\n const normalizedFlightData = getFlightDataPartsFromPath(initialFlightData[0])\n const {\n tree: initialTree,\n seedData: initialSeedData,\n head: initialHead,\n } = normalizedFlightData\n const isServer = !location\n // For the SSR render, seed data should always be available (we only send back a `null` response\n // in the case of a `loading` segment, pre-PPR.)\n const rsc = initialSeedData?.[1]\n const loading = initialSeedData?.[3] ?? null\n\n const cache: CacheNode = {\n lazyData: null,\n rsc,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n // The cache gets seeded during the first render. `initialParallelRoutes` ensures the cache from the first render is there during the second render.\n parallelRoutes: isServer ? new Map() : initialParallelRoutes,\n loading,\n }\n\n const canonicalUrl =\n // location.href is read as the initial value for canonicalUrl in the browser\n // This is safe to do as canonicalUrl can't be rendered, it's only used to control the history updates in the useEffect further down in this file.\n location\n ? // window.location does not have the same type as URL but has all the fields createHrefFromUrl needs.\n createHrefFromUrl(location)\n : initialCanonicalUrl\n\n addRefreshMarkerToActiveParallelSegments(initialTree, canonicalUrl)\n\n const prefetchCache = new Map()\n\n // When the cache hasn't been seeded yet we fill the cache with the head.\n if (initialParallelRoutes === null || initialParallelRoutes.size === 0) {\n fillLazyItemsTillLeafWithHead(\n cache,\n undefined,\n initialTree,\n initialSeedData,\n initialHead\n )\n }\n\n const initialState = {\n tree: initialTree,\n cache,\n prefetchCache,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // First render needs to preserve the previous window.history.state\n // to avoid it being overwritten on navigation back/forward with MPA Navigation.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: {\n apply: false,\n onlyHashChange: false,\n hashFragment: null,\n segmentPaths: [],\n },\n canonicalUrl,\n nextUrl:\n // the || operator is intentional, the pathname can be an empty string\n (extractPathFromFlightRouterState(initialTree) || location?.pathname) ??\n null,\n }\n\n if (process.env.NODE_ENV !== 'development' && location) {\n // Seed the prefetch cache with this page's data.\n // This is to prevent needlessly re-prefetching a page that is already reusable,\n // and will avoid triggering a loading state/data fetch stall when navigating back to the page.\n // We don't currently do this in development because links aren't prefetched in development\n // so having a mismatch between prefetch/no prefetch provides inconsistent behavior based on which page\n // was loaded first.\n const url = new URL(\n `${location.pathname}${location.search}`,\n location.origin\n )\n\n createSeededPrefetchCacheEntry({\n url,\n data: {\n flightData: [normalizedFlightData],\n canonicalUrl: undefined,\n couldBeIntercepted: !!couldBeIntercepted,\n prerendered,\n postponed,\n // TODO: The initial RSC payload includes both static and dynamic data\n // in the same response, even if PPR is enabled. So if there's any\n // dynamic data at all, we can't set a stale time. In the future we may\n // add a way to split a single Flight stream into static and dynamic\n // parts. But in the meantime we should at least make this work for\n // fully static pages.\n staleTime: -1,\n },\n tree: initialState.tree,\n prefetchCache: initialState.prefetchCache,\n nextUrl: initialState.nextUrl,\n kind: prerendered ? PrefetchKind.FULL : PrefetchKind.AUTO,\n })\n }\n\n return initialState\n}\n","import type { Segment } from '../../../server/app-render/types'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\n\nexport function createRouterCacheKey(\n segment: Segment,\n withoutSearchParameters: boolean = false\n) {\n // if the segment is an array, it means it's a dynamic segment\n // for example, ['lang', 'en', 'd']. We need to convert it to a string to store it as a cache node key.\n if (Array.isArray(segment)) {\n return `${segment[0]}|${segment[1]}|${segment[2]}`\n }\n\n // Page segments might have search parameters, ie __PAGE__?foo=bar\n // When `withoutSearchParameters` is true, we only want to return the page segment\n if (withoutSearchParameters && segment.startsWith(PAGE_SEGMENT_KEY)) {\n return PAGE_SEGMENT_KEY\n }\n\n return segment\n}\n","'use client'\n\n// @ts-ignore\n// eslint-disable-next-line import/no-extraneous-dependencies\n// import { createFromReadableStream } from 'react-server-dom-webpack/client'\nconst { createFromReadableStream } = (\n !!process.env.NEXT_RUNTIME\n ? // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client.edge')\n : // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client')\n) as typeof import('react-server-dom-webpack/client')\n\nimport type {\n FlightRouterState,\n NavigationFlightResponse,\n} from '../../../server/app-render/types'\nimport {\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_RSC_UNION_QUERY,\n NEXT_URL,\n RSC_HEADER,\n RSC_CONTENT_TYPE_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_DID_POSTPONE_HEADER,\n NEXT_ROUTER_STALE_TIME_HEADER,\n} from '../app-router-headers'\nimport { callServer } from '../../app-call-server'\nimport { findSourceMapURL } from '../../app-find-source-map-url'\nimport { PrefetchKind } from './router-reducer-types'\nimport { hexHash } from '../../../shared/lib/hash'\nimport {\n normalizeFlightData,\n type NormalizedFlightData,\n} from '../../flight-data-helpers'\nimport { getAppBuildId } from '../../app-build-id'\n\nexport interface FetchServerResponseOptions {\n readonly flightRouterState: FlightRouterState\n readonly nextUrl: string | null\n readonly prefetchKind?: PrefetchKind\n readonly isHmrRefresh?: boolean\n}\n\nexport type FetchServerResponseResult = {\n flightData: NormalizedFlightData[] | string\n canonicalUrl: URL | undefined\n couldBeIntercepted: boolean\n prerendered: boolean\n postponed: boolean\n staleTime: number\n}\n\nexport type RequestHeaders = {\n [RSC_HEADER]?: '1'\n [NEXT_ROUTER_STATE_TREE_HEADER]?: string\n [NEXT_URL]?: string\n [NEXT_ROUTER_PREFETCH_HEADER]?: '1'\n [NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]?: string\n 'x-deployment-id'?: string\n [NEXT_HMR_REFRESH_HEADER]?: '1'\n // A header that is only added in test mode to assert on fetch priority\n 'Next-Test-Fetch-Priority'?: RequestInit['priority']\n}\n\nexport function urlToUrlWithoutFlightMarker(url: string): URL {\n const urlWithoutFlightParameters = new URL(url, location.origin)\n urlWithoutFlightParameters.searchParams.delete(NEXT_RSC_UNION_QUERY)\n if (process.env.NODE_ENV === 'production') {\n if (\n process.env.__NEXT_CONFIG_OUTPUT === 'export' &&\n urlWithoutFlightParameters.pathname.endsWith('.txt')\n ) {\n const { pathname } = urlWithoutFlightParameters\n const length = pathname.endsWith('/index.txt') ? 10 : 4\n // Slice off `/index.txt` or `.txt` from the end of the pathname\n urlWithoutFlightParameters.pathname = pathname.slice(0, -length)\n }\n }\n return urlWithoutFlightParameters\n}\n\nfunction doMpaNavigation(url: string): FetchServerResponseResult {\n return {\n flightData: urlToUrlWithoutFlightMarker(url).toString(),\n canonicalUrl: undefined,\n couldBeIntercepted: false,\n prerendered: false,\n postponed: false,\n staleTime: -1,\n }\n}\n\n/**\n * Fetch the flight data for the provided url. Takes in the current router state\n * to decide what to render server-side.\n */\nexport async function fetchServerResponse(\n url: URL,\n options: FetchServerResponseOptions\n): Promise {\n const { flightRouterState, nextUrl, prefetchKind } = options\n\n const headers: RequestHeaders = {\n // Enable flight response\n [RSC_HEADER]: '1',\n // Provide the current router state\n [NEXT_ROUTER_STATE_TREE_HEADER]: encodeURIComponent(\n JSON.stringify(flightRouterState)\n ),\n }\n\n /**\n * Three cases:\n * - `prefetchKind` is `undefined`, it means it's a normal navigation, so we want to prefetch the page data fully\n * - `prefetchKind` is `full` - we want to prefetch the whole page so same as above\n * - `prefetchKind` is `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully\n */\n if (prefetchKind === PrefetchKind.AUTO) {\n headers[NEXT_ROUTER_PREFETCH_HEADER] = '1'\n }\n\n if (process.env.NODE_ENV === 'development' && options.isHmrRefresh) {\n headers[NEXT_HMR_REFRESH_HEADER] = '1'\n }\n\n if (nextUrl) {\n headers[NEXT_URL] = nextUrl\n }\n\n try {\n // When creating a \"temporary\" prefetch (the \"on-demand\" prefetch that gets created on navigation, if one doesn't exist)\n // we send the request with a \"high\" priority as it's in response to a user interaction that could be blocking a transition.\n // Otherwise, all other prefetches are sent with a \"low\" priority.\n // We use \"auto\" for in all other cases to match the existing default, as this function is shared outside of prefetching.\n const fetchPriority = prefetchKind\n ? prefetchKind === PrefetchKind.TEMPORARY\n ? 'high'\n : 'low'\n : 'auto'\n\n const res = await createFetch(url, headers, fetchPriority)\n\n const responseUrl = urlToUrlWithoutFlightMarker(res.url)\n const canonicalUrl = res.redirected ? responseUrl : undefined\n\n const contentType = res.headers.get('content-type') || ''\n const interception = !!res.headers.get('vary')?.includes(NEXT_URL)\n const postponed = !!res.headers.get(NEXT_DID_POSTPONE_HEADER)\n const staleTimeHeader = res.headers.get(NEXT_ROUTER_STALE_TIME_HEADER)\n const staleTime =\n staleTimeHeader !== null ? parseInt(staleTimeHeader, 10) : -1\n let isFlightResponse = contentType.startsWith(RSC_CONTENT_TYPE_HEADER)\n\n if (process.env.NODE_ENV === 'production') {\n if (process.env.__NEXT_CONFIG_OUTPUT === 'export') {\n if (!isFlightResponse) {\n isFlightResponse = contentType.startsWith('text/plain')\n }\n }\n }\n\n // If fetch returns something different than flight response handle it like a mpa navigation\n // If the fetch was not 200, we also handle it like a mpa navigation\n if (!isFlightResponse || !res.ok || !res.body) {\n // in case the original URL came with a hash, preserve it before redirecting to the new URL\n if (url.hash) {\n responseUrl.hash = url.hash\n }\n\n return doMpaNavigation(responseUrl.toString())\n }\n\n // We may navigate to a page that requires a different Webpack runtime.\n // In prod, every page will have the same Webpack runtime.\n // In dev, the Webpack runtime is minimal for each page.\n // We need to ensure the Webpack runtime is updated before executing client-side JS of the new page.\n if (process.env.NODE_ENV !== 'production' && !process.env.TURBOPACK) {\n await require('../react-dev-overlay/app/hot-reloader-client').waitForWebpackRuntimeHotUpdate()\n }\n\n // Handle the `fetch` readable stream that can be unwrapped by `React.use`.\n const flightStream = postponed\n ? createUnclosingPrefetchStream(res.body)\n : res.body\n const response = await (createFromNextReadableStream(\n flightStream\n ) as Promise)\n\n if (getAppBuildId() !== response.b) {\n return doMpaNavigation(res.url)\n }\n\n return {\n flightData: normalizeFlightData(response.f),\n canonicalUrl: canonicalUrl,\n couldBeIntercepted: interception,\n prerendered: response.S,\n postponed,\n staleTime,\n }\n } catch (err) {\n console.error(\n `Failed to fetch RSC payload for ${url}. Falling back to browser navigation.`,\n err\n )\n // If fetch fails handle it like a mpa navigation\n // TODO-APP: Add a test for the case where a CORS request fails, e.g. external url redirect coming from the response.\n // See https://github.com/vercel/next.js/issues/43605#issuecomment-1451617521 for a reproduction.\n return {\n flightData: url.toString(),\n canonicalUrl: undefined,\n couldBeIntercepted: false,\n prerendered: false,\n postponed: false,\n staleTime: -1,\n }\n }\n}\n\nexport function createFetch(\n url: URL,\n headers: RequestHeaders,\n fetchPriority: 'auto' | 'high' | 'low' | null\n) {\n const fetchUrl = new URL(url)\n\n if (process.env.NODE_ENV === 'production') {\n if (process.env.__NEXT_CONFIG_OUTPUT === 'export') {\n if (fetchUrl.pathname.endsWith('/')) {\n fetchUrl.pathname += 'index.txt'\n } else {\n fetchUrl.pathname += '.txt'\n }\n }\n }\n\n // This is used to cache bust CDNs that don't support custom headers. The\n // result is stored in a search param.\n // TODO: Given that we have to use a search param anyway, we might as well\n // _only_ use a search param and not bother with the custom headers.\n // Add unique cache query to avoid caching conflicts on CDN which don't respect the Vary header\n const uniqueCacheQuery = hexHash(\n [\n headers[NEXT_ROUTER_PREFETCH_HEADER] || '0',\n headers[NEXT_ROUTER_SEGMENT_PREFETCH_HEADER] || '0',\n headers[NEXT_ROUTER_STATE_TREE_HEADER],\n headers[NEXT_URL],\n ].join(',')\n )\n\n fetchUrl.searchParams.set(NEXT_RSC_UNION_QUERY, uniqueCacheQuery)\n\n if (process.env.__NEXT_TEST_MODE && fetchPriority !== null) {\n headers['Next-Test-Fetch-Priority'] = fetchPriority\n }\n\n if (process.env.NEXT_DEPLOYMENT_ID) {\n headers['x-deployment-id'] = process.env.NEXT_DEPLOYMENT_ID\n }\n\n return fetch(fetchUrl, {\n // Backwards compat for older browsers. `same-origin` is the default in modern browsers.\n credentials: 'same-origin',\n headers,\n priority: fetchPriority || undefined,\n })\n}\n\nexport function createFromNextReadableStream(\n flightStream: ReadableStream\n): Promise {\n return createFromReadableStream(flightStream, {\n callServer,\n findSourceMapURL,\n })\n}\n\nfunction createUnclosingPrefetchStream(\n originalFlightStream: ReadableStream\n): ReadableStream {\n // When PPR is enabled, prefetch streams may contain references that never\n // resolve, because that's how we encode dynamic data access. In the decoded\n // object returned by the Flight client, these are reified into hanging\n // promises that suspend during render, which is effectively what we want.\n // The UI resolves when it switches to the dynamic data stream\n // (via useDeferredValue(dynamic, static)).\n //\n // However, the Flight implementation currently errors if the server closes\n // the response before all the references are resolved. As a cheat to work\n // around this, we wrap the original stream in a new stream that never closes,\n // and therefore doesn't error.\n const reader = originalFlightStream.getReader()\n return new ReadableStream({\n async pull(controller) {\n while (true) {\n const { done, value } = await reader.read()\n if (!done) {\n // Pass to the target stream and keep consuming the Flight response\n // from the server.\n controller.enqueue(value)\n continue\n }\n // The server stream has closed. Exit, but intentionally do not close\n // the target stream.\n return\n }\n },\n })\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { Segment } from '../../../server/app-render/types'\nimport { invalidateCacheByRouterState } from './invalidate-cache-by-router-state'\nimport { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport type { PrefetchCacheEntry } from './router-reducer-types'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\n\n/**\n * Common logic for filling cache with new sub tree data.\n */\nfunction fillCacheHelper(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry: PrefetchCacheEntry | undefined,\n fillLazyItems: boolean\n): void {\n const {\n segmentPath,\n seedData: cacheNodeSeedData,\n tree: treePatch,\n head,\n } = flightData\n let newCacheNode = newCache\n let existingCacheNode = existingCache\n\n for (let i = 0; i < segmentPath.length; i += 2) {\n const parallelRouteKey: string = segmentPath[i]\n const segment: Segment = segmentPath[i + 1]\n\n // segmentPath is a repeating tuple of parallelRouteKey and segment\n // we know we've hit the last entry we've reached our final pair\n const isLastEntry = i === segmentPath.length - 2\n const cacheKey = createRouterCacheKey(segment)\n\n const existingChildSegmentMap =\n existingCacheNode.parallelRoutes.get(parallelRouteKey)\n\n if (!existingChildSegmentMap) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n continue\n }\n\n let childSegmentMap = newCacheNode.parallelRoutes.get(parallelRouteKey)\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap)\n newCacheNode.parallelRoutes.set(parallelRouteKey, childSegmentMap)\n }\n\n const existingChildCacheNode = existingChildSegmentMap.get(cacheKey)\n let childCacheNode = childSegmentMap.get(cacheKey)\n\n if (isLastEntry) {\n if (\n cacheNodeSeedData &&\n (!childCacheNode ||\n !childCacheNode.lazyData ||\n childCacheNode === existingChildCacheNode)\n ) {\n const incomingSegment = cacheNodeSeedData[0]\n const rsc = cacheNodeSeedData[1]\n const loading = cacheNodeSeedData[3]\n\n childCacheNode = {\n lazyData: null,\n // When `fillLazyItems` is false, we only want to fill the RSC data for the layout,\n // not the page segment.\n rsc:\n fillLazyItems || incomingSegment !== PAGE_SEGMENT_KEY ? rsc : null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n loading,\n parallelRoutes:\n fillLazyItems && existingChildCacheNode\n ? new Map(existingChildCacheNode.parallelRoutes)\n : new Map(),\n }\n\n if (existingChildCacheNode && fillLazyItems) {\n invalidateCacheByRouterState(\n childCacheNode,\n existingChildCacheNode,\n treePatch\n )\n }\n if (fillLazyItems) {\n fillLazyItemsTillLeafWithHead(\n childCacheNode,\n existingChildCacheNode,\n treePatch,\n cacheNodeSeedData,\n head,\n prefetchEntry\n )\n }\n\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n continue\n }\n\n if (!childCacheNode || !existingChildCacheNode) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n continue\n }\n\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n loading: childCacheNode.loading,\n } as CacheNode\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n\n // Move deeper into the cache nodes\n newCacheNode = childCacheNode\n existingCacheNode = existingChildCacheNode\n }\n}\n\n/**\n * Fill cache with rsc based on flightDataPath\n */\nexport function fillCacheWithNewSubTreeData(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry?: PrefetchCacheEntry\n): void {\n fillCacheHelper(newCache, existingCache, flightData, prefetchEntry, true)\n}\n\nexport function fillCacheWithNewSubTreeDataButOnlyLoading(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry?: PrefetchCacheEntry\n): void {\n fillCacheHelper(newCache, existingCache, flightData, prefetchEntry, false)\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n CacheNodeSeedData,\n} from '../../../server/app-render/types'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport {\n PrefetchCacheEntryStatus,\n type PrefetchCacheEntry,\n} from './router-reducer-types'\n\nexport function fillLazyItemsTillLeafWithHead(\n newCache: CacheNode,\n existingCache: CacheNode | undefined,\n routerState: FlightRouterState,\n cacheNodeSeedData: CacheNodeSeedData | null,\n head: React.ReactNode,\n prefetchEntry?: PrefetchCacheEntry\n): void {\n const isLastSegment = Object.keys(routerState[1]).length === 0\n if (isLastSegment) {\n newCache.head = head\n return\n }\n // Remove segment that we got data for so that it is filled in during rendering of rsc.\n for (const key in routerState[1]) {\n const parallelRouteState = routerState[1][key]\n const segmentForParallelRoute = parallelRouteState[0]\n const cacheKey = createRouterCacheKey(segmentForParallelRoute)\n\n // TODO: We should traverse the cacheNodeSeedData tree instead of the router\n // state tree. Ideally, they would always be the same shape, but because of\n // the loading.js pattern, cacheNodeSeedData sometimes only represents a\n // partial tree. That's why this node is sometimes null. Once PPR lands,\n // loading.js will no longer have special behavior and we can traverse the\n // data tree instead.\n //\n // We should also consider merging the router state tree and the data tree\n // in the response format, so that we don't have to send the keys twice.\n // Then the client can convert them into separate representations.\n const parallelSeedData =\n cacheNodeSeedData !== null && cacheNodeSeedData[2][key] !== undefined\n ? cacheNodeSeedData[2][key]\n : null\n if (existingCache) {\n const existingParallelRoutesCacheNode =\n existingCache.parallelRoutes.get(key)\n if (existingParallelRoutesCacheNode) {\n const hasReusablePrefetch =\n prefetchEntry?.kind === 'auto' &&\n prefetchEntry.status === PrefetchCacheEntryStatus.reusable\n\n let parallelRouteCacheNode = new Map(existingParallelRoutesCacheNode)\n const existingCacheNode = parallelRouteCacheNode.get(cacheKey)\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const seedNode = parallelSeedData[1]\n const loading = parallelSeedData[3]\n newCacheNode = {\n lazyData: null,\n rsc: seedNode,\n // This is a PPR-only field. When PPR is enabled, we shouldn't hit\n // this path during a navigation, but until PPR is fully implemented\n // yet it's possible the existing node does have a non-null\n // `prefetchRsc`. As an incremental step, we'll just de-opt to the\n // old behavior — no PPR value.\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n loading,\n parallelRoutes: new Map(existingCacheNode?.parallelRoutes),\n }\n } else if (hasReusablePrefetch && existingCacheNode) {\n // No new data was sent from the server, but the existing cache node\n // was prefetched, so we should reuse that.\n newCacheNode = {\n lazyData: existingCacheNode.lazyData,\n rsc: existingCacheNode.rsc,\n // This is a PPR-only field. Unlike the previous branch, since we're\n // just cloning the existing cache node, we might as well keep the\n // PPR value, if it exists.\n prefetchRsc: existingCacheNode.prefetchRsc,\n head: existingCacheNode.head,\n prefetchHead: existingCacheNode.prefetchHead,\n parallelRoutes: new Map(existingCacheNode.parallelRoutes),\n loading: existingCacheNode.loading,\n } as CacheNode\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(existingCacheNode?.parallelRoutes),\n loading: null,\n }\n }\n\n // Overrides the cache key with the new cache node.\n parallelRouteCacheNode.set(cacheKey, newCacheNode)\n // Traverse deeper to apply the head / fill lazy items till the head.\n fillLazyItemsTillLeafWithHead(\n newCacheNode,\n existingCacheNode,\n parallelRouteState,\n parallelSeedData ? parallelSeedData : null,\n head,\n prefetchEntry\n )\n\n newCache.parallelRoutes.set(key, parallelRouteCacheNode)\n continue\n }\n }\n\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const seedNode = parallelSeedData[1]\n const loading = parallelSeedData[3]\n newCacheNode = {\n lazyData: null,\n rsc: seedNode,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading,\n }\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n }\n\n const existingParallelRoutes = newCache.parallelRoutes.get(key)\n if (existingParallelRoutes) {\n existingParallelRoutes.set(cacheKey, newCacheNode)\n } else {\n newCache.parallelRoutes.set(key, new Map([[cacheKey, newCacheNode]]))\n }\n\n fillLazyItemsTillLeafWithHead(\n newCacheNode,\n undefined,\n parallelRouteState,\n parallelSeedData,\n head,\n prefetchEntry\n )\n }\n}\n","import { computeChangedPath } from './compute-changed-path'\nimport type {\n Mutable,\n ReadonlyReducerState,\n ReducerState,\n} from './router-reducer-types'\n\nfunction isNotUndefined(value: T): value is Exclude {\n return typeof value !== 'undefined'\n}\n\nexport function handleMutable(\n state: ReadonlyReducerState,\n mutable: Mutable\n): ReducerState {\n // shouldScroll is true by default, can override to false.\n const shouldScroll = mutable.shouldScroll ?? true\n\n let nextUrl = state.nextUrl\n\n if (isNotUndefined(mutable.patchedTree)) {\n // If we received a patched tree, we need to compute the changed path.\n const changedPath = computeChangedPath(state.tree, mutable.patchedTree)\n if (changedPath) {\n // If the tree changed, we need to update the nextUrl\n nextUrl = changedPath\n } else if (!nextUrl) {\n // if the tree ends up being the same (ie, no changed path), and we don't have a nextUrl, then we should use the canonicalUrl\n nextUrl = state.canonicalUrl\n }\n // otherwise this will be a no-op and continue to use the existing nextUrl\n }\n\n return {\n // Set href.\n canonicalUrl: isNotUndefined(mutable.canonicalUrl)\n ? mutable.canonicalUrl === state.canonicalUrl\n ? state.canonicalUrl\n : mutable.canonicalUrl\n : state.canonicalUrl,\n pushRef: {\n pendingPush: isNotUndefined(mutable.pendingPush)\n ? mutable.pendingPush\n : state.pushRef.pendingPush,\n mpaNavigation: isNotUndefined(mutable.mpaNavigation)\n ? mutable.mpaNavigation\n : state.pushRef.mpaNavigation,\n preserveCustomHistoryState: isNotUndefined(\n mutable.preserveCustomHistoryState\n )\n ? mutable.preserveCustomHistoryState\n : state.pushRef.preserveCustomHistoryState,\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: shouldScroll\n ? isNotUndefined(mutable?.scrollableSegments)\n ? true\n : state.focusAndScrollRef.apply\n : // If shouldScroll is false then we should not apply scroll and focus management.\n false,\n onlyHashChange: mutable.onlyHashChange || false,\n hashFragment: shouldScroll\n ? // Empty hash should trigger default behavior of scrolling layout into view.\n // #top is handled in layout-router.\n mutable.hashFragment && mutable.hashFragment !== ''\n ? // Remove leading # and decode hash to make non-latin hashes work.\n decodeURIComponent(mutable.hashFragment.slice(1))\n : state.focusAndScrollRef.hashFragment\n : // If shouldScroll is false then we should not apply scroll and focus management.\n null,\n segmentPaths: shouldScroll\n ? mutable?.scrollableSegments ?? state.focusAndScrollRef.segmentPaths\n : // If shouldScroll is false then we should not apply scroll and focus management.\n [],\n },\n // Apply cache.\n cache: mutable.cache ? mutable.cache : state.cache,\n prefetchCache: mutable.prefetchCache\n ? mutable.prefetchCache\n : state.prefetchCache,\n // Apply patched router state.\n tree: isNotUndefined(mutable.patchedTree)\n ? mutable.patchedTree\n : state.tree,\n nextUrl,\n }\n}\n","import type { FlightRouterState } from '../../../server/app-render/types'\nimport { handleExternalUrl } from './reducers/navigate-reducer'\nimport type {\n ReadonlyReducerState,\n ReducerActions,\n} from './router-reducer-types'\n\n/**\n * Handles the case where the client router attempted to patch the tree but, due to a mismatch, the patch failed.\n * This will perform an MPA navigation to return the router to a valid state.\n */\nexport function handleSegmentMismatch(\n state: ReadonlyReducerState,\n action: ReducerActions,\n treePatch: FlightRouterState\n) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'Performing hard navigation because your application experienced an unrecoverable error. If this keeps occurring, please file a Next.js issue.\\n\\n' +\n 'Reason: Segment mismatch\\n' +\n `Last Action: ${action.type}\\n\\n` +\n `Current Tree: ${JSON.stringify(state.tree)}\\n\\n` +\n `Tree Patch Payload: ${JSON.stringify(treePatch)}`\n )\n }\n\n return handleExternalUrl(state, {}, state.canonicalUrl, true)\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { FlightSegmentPath } from '../../../server/app-render/types'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\n\n/**\n * Fill cache up to the end of the flightSegmentPath, invalidating anything below it.\n */\nexport function invalidateCacheBelowFlightSegmentPath(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightSegmentPath: FlightSegmentPath\n): void {\n const isLastEntry = flightSegmentPath.length <= 2\n const [parallelRouteKey, segment] = flightSegmentPath\n\n const cacheKey = createRouterCacheKey(segment)\n\n const existingChildSegmentMap =\n existingCache.parallelRoutes.get(parallelRouteKey)\n\n if (!existingChildSegmentMap) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n return\n }\n\n let childSegmentMap = newCache.parallelRoutes.get(parallelRouteKey)\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap)\n newCache.parallelRoutes.set(parallelRouteKey, childSegmentMap)\n }\n\n // In case of last entry don't copy further down.\n if (isLastEntry) {\n childSegmentMap.delete(cacheKey)\n return\n }\n\n const existingChildCacheNode = existingChildSegmentMap.get(cacheKey)\n let childCacheNode = childSegmentMap.get(cacheKey)\n\n if (!childCacheNode || !existingChildCacheNode) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n return\n }\n\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n } as CacheNode\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n\n invalidateCacheBelowFlightSegmentPath(\n childCacheNode,\n existingChildCacheNode,\n getNextFlightSegmentPath(flightSegmentPath)\n )\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { FlightRouterState } from '../../../server/app-render/types'\nimport { createRouterCacheKey } from './create-router-cache-key'\n\n/**\n * Invalidate cache one level down from the router state.\n */\nexport function invalidateCacheByRouterState(\n newCache: CacheNode,\n existingCache: CacheNode,\n routerState: FlightRouterState\n): void {\n // Remove segment that we got data for so that it is filled in during rendering of rsc.\n for (const key in routerState[1]) {\n const segmentForParallelRoute = routerState[1][key][0]\n const cacheKey = createRouterCacheKey(segmentForParallelRoute)\n const existingParallelRoutesCacheNode =\n existingCache.parallelRoutes.get(key)\n if (existingParallelRoutesCacheNode) {\n let parallelRouteCacheNode = new Map(existingParallelRoutesCacheNode)\n parallelRouteCacheNode.delete(cacheKey)\n newCache.parallelRoutes.set(key, parallelRouteCacheNode)\n }\n }\n}\n","import type { FlightRouterState } from '../../../server/app-render/types'\n\nexport function isNavigatingToNewRootLayout(\n currentTree: FlightRouterState,\n nextTree: FlightRouterState\n): boolean {\n // Compare segments\n const currentTreeSegment = currentTree[0]\n const nextTreeSegment = nextTree[0]\n\n // If any segment is different before we find the root layout, the root layout has changed.\n // E.g. /same/(group1)/layout.js -> /same/(group2)/layout.js\n // First segment is 'same' for both, keep looking. (group1) changed to (group2) before the root layout was found, it must have changed.\n if (Array.isArray(currentTreeSegment) && Array.isArray(nextTreeSegment)) {\n // Compare dynamic param name and type but ignore the value, different values would not affect the current root layout\n // /[name] - /slug1 and /slug2, both values (slug1 & slug2) still has the same layout /[name]/layout.js\n if (\n currentTreeSegment[0] !== nextTreeSegment[0] ||\n currentTreeSegment[2] !== nextTreeSegment[2]\n ) {\n return true\n }\n } else if (currentTreeSegment !== nextTreeSegment) {\n return true\n }\n\n // Current tree root layout found\n if (currentTree[4]) {\n // If the next tree doesn't have the root layout flag, it must have changed.\n return !nextTree[4]\n }\n // Current tree didn't have its root layout here, must have changed.\n if (nextTree[4]) {\n return true\n }\n // We can't assume it's `parallelRoutes.children` here in case the root layout is `app/@something/layout.js`\n // But it's not possible to be more than one parallelRoutes before the root layout is found\n // TODO-APP: change to traverse all parallel routes\n const currentTreeChild = Object.values(currentTree[1])[0]\n const nextTreeChild = Object.values(nextTree[1])[0]\n if (!currentTreeChild || !nextTreeChild) return true\n return isNavigatingToNewRootLayout(currentTreeChild, nextTreeChild)\n}\n","import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n} from '../../../server/app-render/types'\nimport type {\n CacheNode,\n ChildSegmentMap,\n ReadyCacheNode,\n} from '../../../shared/lib/app-router-context.shared-runtime'\nimport { DEFAULT_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport type { FetchServerResponseResult } from './fetch-server-response'\n\n// This is yet another tree type that is used to track pending promises that\n// need to be fulfilled once the dynamic data is received. The terminal nodes of\n// this tree represent the new Cache Node trees that were created during this\n// request. We can't use the Cache Node tree or Route State tree directly\n// because those include reused nodes, too. This tree is discarded as soon as\n// the navigation response is received.\nexport type Task = {\n // The router state that corresponds to the tree that this Task represents.\n route: FlightRouterState\n // The CacheNode that corresponds to the tree that this Task represents. If\n // `children` is null (i.e. if this is a terminal task node), then `node`\n // represents a brand new Cache Node tree, which way or may not need to be\n // filled with dynamic data from the server.\n node: CacheNode | null\n // Whether anything in this tree contains dynamic holes that need to be filled\n // by the server.\n needsDynamicRequest: boolean\n children: Map | null\n}\n\n// Creates a new Cache Node tree (i.e. copy-on-write) that represents the\n// optimistic result of a navigation, using both the current Cache Node tree and\n// data that was prefetched prior to navigation.\n//\n// At the moment we call this function, we haven't yet received the navigation\n// response from the server. It could send back something completely different\n// from the tree that was prefetched — due to rewrites, default routes, parallel\n// routes, etc.\n//\n// But in most cases, it will return the same tree that we prefetched, just with\n// the dynamic holes filled in. So we optimistically assume this will happen,\n// and accept that the real result could be arbitrarily different.\n//\n// We'll reuse anything that was already in the previous tree, since that's what\n// the server does.\n//\n// New segments (ones that don't appear in the old tree) are assigned an\n// unresolved promise. The data for these promises will be fulfilled later, when\n// the navigation response is received.\n//\n// The tree can be rendered immediately after it is created (that's why this is\n// a synchronous function). Any new trees that do not have prefetch data will\n// suspend during rendering, until the dynamic data streams in.\n//\n// Returns a Task object, which contains both the updated Cache Node and a path\n// to the pending subtrees that need to be resolved by the navigation response.\n//\n// A return value of `null` means there were no changes, and the previous tree\n// can be reused without initiating a server request.\nexport function updateCacheNodeOnNavigation(\n oldCacheNode: CacheNode,\n oldRouterState: FlightRouterState,\n newRouterState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: React.ReactNode | null,\n isPrefetchHeadPartial: boolean\n): Task | null {\n // Diff the old and new trees to reuse the shared layouts.\n const oldRouterStateChildren = oldRouterState[1]\n const newRouterStateChildren = newRouterState[1]\n const prefetchDataChildren = prefetchData !== null ? prefetchData[2] : null\n\n const oldParallelRoutes = oldCacheNode.parallelRoutes\n\n // Clone the current set of segment children, even if they aren't active in\n // the new tree.\n // TODO: We currently retain all the inactive segments indefinitely, until\n // there's an explicit refresh, or a parent layout is lazily refreshed. We\n // rely on this for popstate navigations, which update the Router State Tree\n // but do not eagerly perform a data fetch, because they expect the segment\n // data to already be in the Cache Node tree. For highly static sites that\n // are mostly read-only, this may happen only rarely, causing memory to\n // leak. We should figure out a better model for the lifetime of inactive\n // segments, so we can maintain instant back/forward navigations without\n // leaking memory indefinitely.\n const prefetchParallelRoutes = new Map(oldParallelRoutes)\n\n // As we diff the trees, we may sometimes modify (copy-on-write, not mutate)\n // the Route Tree that was returned by the server — for example, in the case\n // of default parallel routes, we preserve the currently active segment. To\n // avoid mutating the original tree, we clone the router state children along\n // the return path.\n let patchedRouterStateChildren: {\n [parallelRouteKey: string]: FlightRouterState\n } = {}\n let taskChildren = null\n\n // Most navigations require a request to fetch additional data from the\n // server, either because the data was not already prefetched, or because the\n // target route contains dynamic data that cannot be prefetched.\n //\n // However, if the target route is fully static, and it's already completely\n // loaded into the segment cache, then we can skip the server request.\n //\n // This starts off as `false`, and is set to `true` if any of the child\n // routes requires a dynamic request.\n let needsDynamicRequest = false\n\n for (let parallelRouteKey in newRouterStateChildren) {\n const newRouterStateChild: FlightRouterState =\n newRouterStateChildren[parallelRouteKey]\n const oldRouterStateChild: FlightRouterState | void =\n oldRouterStateChildren[parallelRouteKey]\n const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey)\n const prefetchDataChild: CacheNodeSeedData | void | null =\n prefetchDataChildren !== null\n ? prefetchDataChildren[parallelRouteKey]\n : null\n\n const newSegmentChild = newRouterStateChild[0]\n const newSegmentKeyChild = createRouterCacheKey(newSegmentChild)\n\n const oldSegmentChild =\n oldRouterStateChild !== undefined ? oldRouterStateChild[0] : undefined\n\n const oldCacheNodeChild =\n oldSegmentMapChild !== undefined\n ? oldSegmentMapChild.get(newSegmentKeyChild)\n : undefined\n\n let taskChild: Task | null\n if (newSegmentChild === DEFAULT_SEGMENT_KEY) {\n // This is another kind of leaf segment — a default route.\n //\n // Default routes have special behavior. When there's no matching segment\n // for a parallel route, Next.js preserves the currently active segment\n // during a client navigation — but not for initial render. The server\n // leaves it to the client to account for this. So we need to handle\n // it here.\n if (oldRouterStateChild !== undefined) {\n // Reuse the existing Router State for this segment. We spawn a \"task\"\n // just to keep track of the updated router state; unlike most, it's\n // already fulfilled and won't be affected by the dynamic response.\n taskChild = spawnReusedTask(oldRouterStateChild)\n } else {\n // There's no currently active segment. Switch to the \"create\" path.\n taskChild = createCacheNodeOnNavigation(\n newRouterStateChild,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial\n )\n }\n } else if (\n oldSegmentChild !== undefined &&\n matchSegment(newSegmentChild, oldSegmentChild)\n ) {\n if (\n oldCacheNodeChild !== undefined &&\n oldRouterStateChild !== undefined\n ) {\n // This segment exists in both the old and new trees. Recursively update\n // the children.\n taskChild = updateCacheNodeOnNavigation(\n oldCacheNodeChild,\n oldRouterStateChild,\n newRouterStateChild,\n prefetchDataChild,\n prefetchHead,\n isPrefetchHeadPartial\n )\n } else {\n // Either there's no existing Cache Node for this segment, or this\n // segment doesn't exist in the old Router State tree. Switch to the\n // \"create\" path.\n taskChild = createCacheNodeOnNavigation(\n newRouterStateChild,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial\n )\n }\n } else {\n // This is a new tree. Switch to the \"create\" path.\n taskChild = createCacheNodeOnNavigation(\n newRouterStateChild,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial\n )\n }\n\n if (taskChild !== null) {\n // Something changed in the child tree. Keep track of the child task.\n if (taskChildren === null) {\n taskChildren = new Map()\n }\n taskChildren.set(parallelRouteKey, taskChild)\n const newCacheNodeChild = taskChild.node\n if (newCacheNodeChild !== null) {\n const newSegmentMapChild: ChildSegmentMap = new Map(oldSegmentMapChild)\n newSegmentMapChild.set(newSegmentKeyChild, newCacheNodeChild)\n prefetchParallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n\n if (taskChild.needsDynamicRequest) {\n needsDynamicRequest = true\n }\n\n // The child tree's route state may be different from the prefetched\n // route sent by the server. We need to clone it as we traverse back up\n // the tree.\n patchedRouterStateChildren[parallelRouteKey] = taskChild.route\n } else {\n // The child didn't change. We can use the prefetched router state.\n patchedRouterStateChildren[parallelRouteKey] = newRouterStateChild\n }\n }\n\n if (taskChildren === null) {\n // No new tasks were spawned.\n return null\n }\n\n const newCacheNode: ReadyCacheNode = {\n lazyData: null,\n rsc: oldCacheNode.rsc,\n // We intentionally aren't updating the prefetchRsc field, since this node\n // is already part of the current tree, because it would be weird for\n // prefetch data to be newer than the final data. It probably won't ever be\n // observable anyway, but it could happen if the segment is unmounted then\n // mounted again, because LayoutRouter will momentarily switch to rendering\n // prefetchRsc, via useDeferredValue.\n prefetchRsc: oldCacheNode.prefetchRsc,\n head: oldCacheNode.head,\n prefetchHead: oldCacheNode.prefetchHead,\n loading: oldCacheNode.loading,\n\n // Everything is cloned except for the children, which we computed above.\n parallelRoutes: prefetchParallelRoutes,\n }\n\n return {\n // Return a cloned copy of the router state with updated children.\n route: patchRouterStateWithNewChildren(\n newRouterState,\n patchedRouterStateChildren\n ),\n node: newCacheNode,\n needsDynamicRequest,\n children: taskChildren,\n }\n}\n\nfunction createCacheNodeOnNavigation(\n routerState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n possiblyPartialPrefetchHead: React.ReactNode | null,\n isPrefetchHeadPartial: boolean\n): Task {\n // Same traversal as updateCacheNodeNavigation, but we switch to this path\n // once we reach the part of the tree that was not in the previous route. We\n // don't need to diff against the old tree, we just need to create a new one.\n if (prefetchData === null) {\n // There's no prefetch for this segment. Everything from this point will be\n // requested from the server, even if there are static children below it.\n // Create a terminal task node that will later be fulfilled by\n // server response.\n return spawnPendingTask(\n routerState,\n null,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial\n )\n }\n\n const routerStateChildren = routerState[1]\n const isPrefetchRscPartial = prefetchData[4]\n\n // The head is assigned to every leaf segment delivered by the server. Based\n // on corresponding logic in fill-lazy-items-till-leaf-with-head.ts\n const isLeafSegment = Object.keys(routerStateChildren).length === 0\n\n // If prefetch data is available for a segment, and it's fully static (i.e.\n // does not contain any dynamic holes), we don't need to request it from\n // the server.\n if (\n // Check if the segment data is partial\n isPrefetchRscPartial ||\n // Check if the head is partial (only relevant if this is a leaf segment)\n (isPrefetchHeadPartial && isLeafSegment)\n ) {\n // We only have partial data from this segment. Like missing segments, we\n // must request the full data from the server.\n return spawnPendingTask(\n routerState,\n prefetchData,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial\n )\n }\n\n // The prefetched segment is fully static, so we don't need to request a new\n // one from the server. Keep traversing down the tree until we reach something\n // that requires a dynamic request.\n const prefetchDataChildren = prefetchData[2]\n const taskChildren = new Map()\n const cacheNodeChildren = new Map()\n let needsDynamicRequest = false\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const prefetchDataChild: CacheNodeSeedData | void | null =\n prefetchDataChildren !== null\n ? prefetchDataChildren[parallelRouteKey]\n : null\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n const taskChild = createCacheNodeOnNavigation(\n routerStateChild,\n prefetchDataChild,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial\n )\n taskChildren.set(parallelRouteKey, taskChild)\n if (taskChild.needsDynamicRequest) {\n needsDynamicRequest = true\n }\n const newCacheNodeChild = taskChild.node\n if (newCacheNodeChild !== null) {\n const newSegmentMapChild: ChildSegmentMap = new Map()\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n cacheNodeChildren.set(parallelRouteKey, newSegmentMapChild)\n }\n }\n\n const rsc = prefetchData[1]\n const loading = prefetchData[3]\n return {\n route: routerState,\n node: {\n lazyData: null,\n // Since this is a fully static segment, we don't need to use the\n // `prefetchRsc` field.\n rsc,\n prefetchRsc: null,\n head: isLeafSegment ? possiblyPartialPrefetchHead : null,\n prefetchHead: null,\n loading,\n parallelRoutes: cacheNodeChildren,\n },\n needsDynamicRequest,\n children: taskChildren,\n }\n}\n\nfunction patchRouterStateWithNewChildren(\n baseRouterState: FlightRouterState,\n newChildren: { [parallelRouteKey: string]: FlightRouterState }\n): FlightRouterState {\n const clone: FlightRouterState = [baseRouterState[0], newChildren]\n // Based on equivalent logic in apply-router-state-patch-to-tree, but should\n // confirm whether we need to copy all of these fields. Not sure the server\n // ever sends, e.g. the refetch marker.\n if (2 in baseRouterState) {\n clone[2] = baseRouterState[2]\n }\n if (3 in baseRouterState) {\n clone[3] = baseRouterState[3]\n }\n if (4 in baseRouterState) {\n clone[4] = baseRouterState[4]\n }\n return clone\n}\n\nfunction spawnPendingTask(\n routerState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: React.ReactNode | null,\n isPrefetchHeadPartial: boolean\n): Task {\n // Create a task that will later be fulfilled by data from the server.\n const newTask: Task = {\n route: routerState,\n\n // Corresponds to the part of the route that will be rendered on the server.\n node: createPendingCacheNode(\n routerState,\n prefetchData,\n prefetchHead,\n isPrefetchHeadPartial\n ),\n // Set this to true to indicate that this tree is missing data. This will\n // be propagated to all the parent tasks.\n needsDynamicRequest: true,\n children: null,\n }\n return newTask\n}\n\nfunction spawnReusedTask(reusedRouterState: FlightRouterState): Task {\n // Create a task that reuses an existing segment, e.g. when reusing\n // the current active segment in place of a default route.\n return {\n route: reusedRouterState,\n node: null,\n needsDynamicRequest: false,\n children: null,\n }\n}\n\n// Writes a dynamic server response into the tree created by\n// updateCacheNodeOnNavigation. All pending promises that were spawned by the\n// navigation will be resolved, either with dynamic data from the server, or\n// `null` to indicate that the data is missing.\n//\n// A `null` value will trigger a lazy fetch during render, which will then patch\n// up the tree using the same mechanism as the non-PPR implementation\n// (serverPatchReducer).\n//\n// Usually, the server will respond with exactly the subset of data that we're\n// waiting for — everything below the nearest shared layout. But technically,\n// the server can return anything it wants.\n//\n// This does _not_ create a new tree; it modifies the existing one in place.\n// Which means it must follow the Suspense rules of cache safety.\nexport function listenForDynamicRequest(\n task: Task,\n responsePromise: Promise\n) {\n responsePromise.then(\n ({ flightData }: FetchServerResponseResult) => {\n if (typeof flightData === 'string') {\n // Happens when navigating to page in `pages` from `app`. We shouldn't\n // get here because should have already handled this during\n // the prefetch.\n return\n }\n for (const normalizedFlightData of flightData) {\n const {\n segmentPath,\n tree: serverRouterState,\n seedData: dynamicData,\n head: dynamicHead,\n } = normalizedFlightData\n\n if (!dynamicData) {\n // This shouldn't happen. PPR should always send back a response.\n // However, `FlightDataPath` is a shared type and the pre-PPR handling of\n // this might return null.\n continue\n }\n\n writeDynamicDataIntoPendingTask(\n task,\n segmentPath,\n serverRouterState,\n dynamicData,\n dynamicHead\n )\n }\n\n // Now that we've exhausted all the data we received from the server, if\n // there are any remaining pending tasks in the tree, abort them now.\n // If there's any missing data, it will trigger a lazy fetch.\n abortTask(task, null)\n },\n (error: any) => {\n // This will trigger an error during render\n abortTask(task, error)\n }\n )\n}\n\nfunction writeDynamicDataIntoPendingTask(\n rootTask: Task,\n segmentPath: FlightSegmentPath,\n serverRouterState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: React.ReactNode\n) {\n // The data sent by the server represents only a subtree of the app. We need\n // to find the part of the task tree that matches the server response, and\n // fulfill it using the dynamic data.\n //\n // segmentPath represents the parent path of subtree. It's a repeating pattern\n // of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // Iterate through the path and finish any tasks that match this payload.\n let task = rootTask\n for (let i = 0; i < segmentPath.length; i += 2) {\n const parallelRouteKey: string = segmentPath[i]\n const segment: Segment = segmentPath[i + 1]\n const taskChildren = task.children\n if (taskChildren !== null) {\n const taskChild = taskChildren.get(parallelRouteKey)\n if (taskChild !== undefined) {\n const taskSegment = taskChild.route[0]\n if (matchSegment(segment, taskSegment)) {\n // Found a match for this task. Keep traversing down the task tree.\n task = taskChild\n continue\n }\n }\n }\n // We didn't find a child task that matches the server data. Exit. We won't\n // abort the task, though, because a different FlightDataPath may be able to\n // fulfill it (see loop in listenForDynamicRequest). We only abort tasks\n // once we've run out of data.\n return\n }\n\n finishTaskUsingDynamicDataPayload(\n task,\n serverRouterState,\n dynamicData,\n dynamicHead\n )\n}\n\nfunction finishTaskUsingDynamicDataPayload(\n task: Task,\n serverRouterState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: React.ReactNode\n) {\n if (!task.needsDynamicRequest) {\n // Everything in this subtree is already complete. Bail out.\n return\n }\n\n // dynamicData may represent a larger subtree than the task. Before we can\n // finish the task, we need to line them up.\n const taskChildren = task.children\n const taskNode = task.node\n if (taskChildren === null) {\n // We've reached the leaf node of the pending task. The server data tree\n // lines up the pending Cache Node tree. We can now switch to the\n // normal algorithm.\n if (taskNode !== null) {\n finishPendingCacheNode(\n taskNode,\n task.route,\n serverRouterState,\n dynamicData,\n dynamicHead\n )\n // Set this to false to indicate that this task is now complete.\n task.needsDynamicRequest = false\n }\n return\n }\n // The server returned more data than we need to finish the task. Skip over\n // the extra segments until we reach the leaf task node.\n const serverChildren = serverRouterState[1]\n const dynamicDataChildren = dynamicData[2]\n\n for (const parallelRouteKey in serverRouterState) {\n const serverRouterStateChild: FlightRouterState =\n serverChildren[parallelRouteKey]\n const dynamicDataChild: CacheNodeSeedData | null | void =\n dynamicDataChildren[parallelRouteKey]\n\n const taskChild = taskChildren.get(parallelRouteKey)\n if (taskChild !== undefined) {\n const taskSegment = taskChild.route[0]\n if (\n matchSegment(serverRouterStateChild[0], taskSegment) &&\n dynamicDataChild !== null &&\n dynamicDataChild !== undefined\n ) {\n // Found a match for this task. Keep traversing down the task tree.\n return finishTaskUsingDynamicDataPayload(\n taskChild,\n serverRouterStateChild,\n dynamicDataChild,\n dynamicHead\n )\n }\n }\n // We didn't find a child task that matches the server data. We won't abort\n // the task, though, because a different FlightDataPath may be able to\n // fulfill it (see loop in listenForDynamicRequest). We only abort tasks\n // once we've run out of data.\n }\n}\n\nfunction createPendingCacheNode(\n routerState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: React.ReactNode | null,\n isPrefetchHeadPartial: boolean\n): ReadyCacheNode {\n const routerStateChildren = routerState[1]\n const prefetchDataChildren = prefetchData !== null ? prefetchData[2] : null\n\n const parallelRoutes = new Map()\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const prefetchDataChild: CacheNodeSeedData | null | void =\n prefetchDataChildren !== null\n ? prefetchDataChildren[parallelRouteKey]\n : null\n\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n\n const newCacheNodeChild = createPendingCacheNode(\n routerStateChild,\n prefetchDataChild === undefined ? null : prefetchDataChild,\n prefetchHead,\n isPrefetchHeadPartial\n )\n\n const newSegmentMapChild: ChildSegmentMap = new Map()\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n parallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n\n // The head is assigned to every leaf segment delivered by the server. Based\n // on corresponding logic in fill-lazy-items-till-leaf-with-head.ts\n const isLeafSegment = parallelRoutes.size === 0\n const maybePrefetchRsc = prefetchData !== null ? prefetchData[1] : null\n const maybePrefetchLoading = prefetchData !== null ? prefetchData[3] : null\n return {\n lazyData: null,\n parallelRoutes: parallelRoutes,\n\n prefetchRsc: maybePrefetchRsc !== undefined ? maybePrefetchRsc : null,\n prefetchHead: isLeafSegment ? prefetchHead : null,\n\n // TODO: Technically, a loading boundary could contain dynamic data. We must\n // have separate `loading` and `prefetchLoading` fields to handle this, like\n // we do for the segment data and head.\n loading: maybePrefetchLoading !== undefined ? maybePrefetchLoading : null,\n\n // Create a deferred promise. This will be fulfilled once the dynamic\n // response is received from the server.\n rsc: createDeferredRsc() as React.ReactNode,\n head: isLeafSegment ? (createDeferredRsc() as React.ReactNode) : null,\n }\n}\n\nfunction finishPendingCacheNode(\n cacheNode: CacheNode,\n taskState: FlightRouterState,\n serverState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: React.ReactNode\n): void {\n // Writes a dynamic response into an existing Cache Node tree. This does _not_\n // create a new tree, it updates the existing tree in-place. So it must follow\n // the Suspense rules of cache safety — it can resolve pending promises, but\n // it cannot overwrite existing data. It can add segments to the tree (because\n // a missing segment will cause the layout router to suspend).\n // but it cannot delete them.\n //\n // We must resolve every promise in the tree, or else it will suspend\n // indefinitely. If we did not receive data for a segment, we will resolve its\n // data promise to `null` to trigger a lazy fetch during render.\n const taskStateChildren = taskState[1]\n const serverStateChildren = serverState[1]\n const dataChildren = dynamicData[2]\n\n // The router state that we traverse the tree with (taskState) is the same one\n // that we used to construct the pending Cache Node tree. That way we're sure\n // to resolve all the pending promises.\n const parallelRoutes = cacheNode.parallelRoutes\n for (let parallelRouteKey in taskStateChildren) {\n const taskStateChild: FlightRouterState =\n taskStateChildren[parallelRouteKey]\n const serverStateChild: FlightRouterState | void =\n serverStateChildren[parallelRouteKey]\n const dataChild: CacheNodeSeedData | null | void =\n dataChildren[parallelRouteKey]\n\n const segmentMapChild = parallelRoutes.get(parallelRouteKey)\n const taskSegmentChild = taskStateChild[0]\n const taskSegmentKeyChild = createRouterCacheKey(taskSegmentChild)\n\n const cacheNodeChild =\n segmentMapChild !== undefined\n ? segmentMapChild.get(taskSegmentKeyChild)\n : undefined\n\n if (cacheNodeChild !== undefined) {\n if (\n serverStateChild !== undefined &&\n matchSegment(taskSegmentChild, serverStateChild[0])\n ) {\n if (dataChild !== undefined && dataChild !== null) {\n // This is the happy path. Recursively update all the children.\n finishPendingCacheNode(\n cacheNodeChild,\n taskStateChild,\n serverStateChild,\n dataChild,\n dynamicHead\n )\n } else {\n // The server never returned data for this segment. Trigger a lazy\n // fetch during render. This shouldn't happen because the Route Tree\n // and the Seed Data tree sent by the server should always be the same\n // shape when part of the same server response.\n abortPendingCacheNode(taskStateChild, cacheNodeChild, null)\n }\n } else {\n // The server never returned data for this segment. Trigger a lazy\n // fetch during render.\n abortPendingCacheNode(taskStateChild, cacheNodeChild, null)\n }\n } else {\n // The server response matches what was expected to receive, but there's\n // no matching Cache Node in the task tree. This is a bug in the\n // implementation because we should have created a node for every\n // segment in the tree that's associated with this task.\n }\n }\n\n // Use the dynamic data from the server to fulfill the deferred RSC promise\n // on the Cache Node.\n const rsc = cacheNode.rsc\n const dynamicSegmentData = dynamicData[1]\n if (rsc === null) {\n // This is a lazy cache node. We can overwrite it. This is only safe\n // because we know that the LayoutRouter suspends if `rsc` is `null`.\n cacheNode.rsc = dynamicSegmentData\n } else if (isDeferredRsc(rsc)) {\n // This is a deferred RSC promise. We can fulfill it with the data we just\n // received from the server. If it was already resolved by a different\n // navigation, then this does nothing because we can't overwrite data.\n rsc.resolve(dynamicSegmentData)\n } else {\n // This is not a deferred RSC promise, nor is it empty, so it must have\n // been populated by a different navigation. We must not overwrite it.\n }\n\n // Check if this is a leaf segment. If so, it will have a `head` property with\n // a pending promise that needs to be resolved with the dynamic head from\n // the server.\n const head = cacheNode.head\n if (isDeferredRsc(head)) {\n head.resolve(dynamicHead)\n }\n}\n\nexport function abortTask(task: Task, error: any): void {\n const cacheNode = task.node\n if (cacheNode === null) {\n // This indicates the task is already complete.\n return\n }\n\n const taskChildren = task.children\n if (taskChildren === null) {\n // Reached the leaf task node. This is the root of a pending cache\n // node tree.\n abortPendingCacheNode(task.route, cacheNode, error)\n } else {\n // This is an intermediate task node. Keep traversing until we reach a\n // task node with no children. That will be the root of the cache node tree\n // that needs to be resolved.\n for (const taskChild of taskChildren.values()) {\n abortTask(taskChild, error)\n }\n }\n\n // Set this to false to indicate that this task is now complete.\n task.needsDynamicRequest = false\n}\n\nfunction abortPendingCacheNode(\n routerState: FlightRouterState,\n cacheNode: CacheNode,\n error: any\n): void {\n // For every pending segment in the tree, resolve its `rsc` promise to `null`\n // to trigger a lazy fetch during render.\n //\n // Or, if an error object is provided, it will error instead.\n const routerStateChildren = routerState[1]\n const parallelRoutes = cacheNode.parallelRoutes\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const segmentMapChild = parallelRoutes.get(parallelRouteKey)\n if (segmentMapChild === undefined) {\n // This shouldn't happen because we're traversing the same tree that was\n // used to construct the cache nodes in the first place.\n continue\n }\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n const cacheNodeChild = segmentMapChild.get(segmentKeyChild)\n if (cacheNodeChild !== undefined) {\n abortPendingCacheNode(routerStateChild, cacheNodeChild, error)\n } else {\n // This shouldn't happen because we're traversing the same tree that was\n // used to construct the cache nodes in the first place.\n }\n }\n const rsc = cacheNode.rsc\n if (isDeferredRsc(rsc)) {\n if (error === null) {\n // This will trigger a lazy fetch during render.\n rsc.resolve(null)\n } else {\n // This will trigger an error during rendering.\n rsc.reject(error)\n }\n }\n\n // Check if this is a leaf segment. If so, it will have a `head` property with\n // a pending promise that needs to be resolved. If an error was provided, we\n // will not resolve it with an error, since this is rendered at the root of\n // the app. We want the segment to error, not the entire app.\n const head = cacheNode.head\n if (isDeferredRsc(head)) {\n head.resolve(null)\n }\n}\n\nexport function updateCacheNodeOnPopstateRestoration(\n oldCacheNode: CacheNode,\n routerState: FlightRouterState\n) {\n // A popstate navigation reads data from the local cache. It does not issue\n // new network requests (unless the cache entries have been evicted). So, we\n // update the cache to drop the prefetch data for any segment whose dynamic\n // data was already received. This prevents an unnecessary flash back to PPR\n // state during a back/forward navigation.\n //\n // This function clones the entire cache node tree and sets the `prefetchRsc`\n // field to `null` to prevent it from being rendered. We can't mutate the node\n // in place because this is a concurrent data structure.\n\n const routerStateChildren = routerState[1]\n const oldParallelRoutes = oldCacheNode.parallelRoutes\n const newParallelRoutes = new Map(oldParallelRoutes)\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey)\n if (oldSegmentMapChild !== undefined) {\n const oldCacheNodeChild = oldSegmentMapChild.get(segmentKeyChild)\n if (oldCacheNodeChild !== undefined) {\n const newCacheNodeChild = updateCacheNodeOnPopstateRestoration(\n oldCacheNodeChild,\n routerStateChild\n )\n const newSegmentMapChild = new Map(oldSegmentMapChild)\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n newParallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n }\n }\n\n // Only show prefetched data if the dynamic data is still pending.\n //\n // Tehnically, what we're actually checking is whether the dynamic network\n // response was received. But since it's a streaming response, this does not\n // mean that all the dynamic data has fully streamed in. It just means that\n // _some_ of the dynamic data was received. But as a heuristic, we assume that\n // the rest dynamic data will stream in quickly, so it's still better to skip\n // the prefetch state.\n const rsc = oldCacheNode.rsc\n const shouldUsePrefetch = isDeferredRsc(rsc) && rsc.status === 'pending'\n\n return {\n lazyData: null,\n rsc,\n head: oldCacheNode.head,\n\n prefetchHead: shouldUsePrefetch ? oldCacheNode.prefetchHead : null,\n prefetchRsc: shouldUsePrefetch ? oldCacheNode.prefetchRsc : null,\n loading: oldCacheNode.loading,\n\n // These are the cloned children we computed above\n parallelRoutes: newParallelRoutes,\n }\n}\n\nconst DEFERRED = Symbol()\n\ntype PendingDeferredRsc = Promise & {\n status: 'pending'\n resolve: (value: React.ReactNode) => void\n reject: (error: any) => void\n tag: Symbol\n}\n\ntype FulfilledDeferredRsc = Promise & {\n status: 'fulfilled'\n value: React.ReactNode\n resolve: (value: React.ReactNode) => void\n reject: (error: any) => void\n tag: Symbol\n}\n\ntype RejectedDeferredRsc = Promise & {\n status: 'rejected'\n reason: any\n resolve: (value: React.ReactNode) => void\n reject: (error: any) => void\n tag: Symbol\n}\n\ntype DeferredRsc =\n | PendingDeferredRsc\n | FulfilledDeferredRsc\n | RejectedDeferredRsc\n\n// This type exists to distinguish a DeferredRsc from a Flight promise. It's a\n// compromise to avoid adding an extra field on every Cache Node, which would be\n// awkward because the pre-PPR parts of codebase would need to account for it,\n// too. We can remove it once type Cache Node type is more settled.\nfunction isDeferredRsc(value: any): value is DeferredRsc {\n return value && value.tag === DEFERRED\n}\n\nfunction createDeferredRsc(): PendingDeferredRsc {\n let resolve: any\n let reject: any\n const pendingRsc = new Promise((res, rej) => {\n resolve = res\n reject = rej\n }) as PendingDeferredRsc\n pendingRsc.status = 'pending'\n pendingRsc.resolve = (value: React.ReactNode) => {\n if (pendingRsc.status === 'pending') {\n const fulfilledRsc: FulfilledDeferredRsc = pendingRsc as any\n fulfilledRsc.status = 'fulfilled'\n fulfilledRsc.value = value\n resolve(value)\n }\n }\n pendingRsc.reject = (error: any) => {\n if (pendingRsc.status === 'pending') {\n const rejectedRsc: RejectedDeferredRsc = pendingRsc as any\n rejectedRsc.status = 'rejected'\n rejectedRsc.reason = error\n reject(error)\n }\n }\n pendingRsc.tag = DEFERRED\n return pendingRsc\n}\n","import {\n fetchServerResponse,\n type FetchServerResponseResult,\n} from './fetch-server-response'\nimport {\n PrefetchCacheEntryStatus,\n type PrefetchCacheEntry,\n PrefetchKind,\n type ReadonlyReducerState,\n} from './router-reducer-types'\nimport { prefetchQueue } from './reducers/prefetch-reducer'\n\nconst INTERCEPTION_CACHE_KEY_MARKER = '%'\n\nexport type AliasedPrefetchCacheEntry = PrefetchCacheEntry & {\n /** This is a special property that indicates a prefetch entry associated with a different URL\n * was returned rather than the requested URL. This signals to the router that it should only\n * apply the part that doesn't depend on searchParams (specifically the loading state).\n */\n aliased?: boolean\n}\n\n/**\n * Creates a cache key for the router prefetch cache\n *\n * @param url - The URL being navigated to\n * @param nextUrl - an internal URL, primarily used for handling rewrites. Defaults to '/'.\n * @return The generated prefetch cache key.\n */\nfunction createPrefetchCacheKeyImpl(\n url: URL,\n includeSearchParams: boolean,\n prefix?: string | null\n) {\n // Initially we only use the pathname as the cache key. We don't want to include\n // search params so that multiple URLs with the same search parameter can re-use\n // loading states.\n let pathnameFromUrl = url.pathname\n\n // RSC responses can differ based on search params, specifically in the case where we aren't\n // returning a partial response (ie with `PrefetchKind.AUTO`).\n // In the auto case, since loading.js & layout.js won't have access to search params,\n // we can safely re-use that cache entry. But for full prefetches, we should not\n // re-use the cache entry as the response may differ.\n if (includeSearchParams) {\n // if we have a full prefetch, we can include the search param in the key,\n // as we'll be getting back a full response. The server might have read the search\n // params when generating the full response.\n pathnameFromUrl += url.search\n }\n\n if (prefix) {\n return `${prefix}${INTERCEPTION_CACHE_KEY_MARKER}${pathnameFromUrl}`\n }\n\n return pathnameFromUrl\n}\n\nfunction createPrefetchCacheKey(\n url: URL,\n kind: PrefetchKind | undefined,\n nextUrl?: string | null\n) {\n return createPrefetchCacheKeyImpl(url, kind === PrefetchKind.FULL, nextUrl)\n}\n\nfunction getExistingCacheEntry(\n url: URL,\n kind: PrefetchKind = PrefetchKind.TEMPORARY,\n nextUrl: string | null,\n prefetchCache: Map,\n allowAliasing: boolean\n): AliasedPrefetchCacheEntry | undefined {\n // We first check if there's a more specific interception route prefetch entry\n // This is because when we detect a prefetch that corresponds with an interception route, we prefix it with nextUrl (see `createPrefetchCacheKey`)\n // to avoid conflicts with other pages that may have the same URL but render different things depending on the `Next-URL` header.\n for (const maybeNextUrl of [nextUrl, null]) {\n const cacheKeyWithParams = createPrefetchCacheKeyImpl(\n url,\n true,\n maybeNextUrl\n )\n const cacheKeyWithoutParams = createPrefetchCacheKeyImpl(\n url,\n false,\n maybeNextUrl\n )\n\n // First, we check if we have a cache entry that exactly matches the URL\n const cacheKeyToUse = url.search\n ? cacheKeyWithParams\n : cacheKeyWithoutParams\n\n const existingEntry = prefetchCache.get(cacheKeyToUse)\n if (existingEntry && allowAliasing) {\n // We know we're returning an aliased entry when the pathname matches but the search params don't,\n const isAliased =\n existingEntry.url.pathname === url.pathname &&\n existingEntry.url.search !== url.search\n\n if (isAliased) {\n return {\n ...existingEntry,\n aliased: true,\n }\n }\n\n return existingEntry\n }\n\n // If the request contains search params, and we're not doing a full prefetch, we can return the\n // param-less entry if it exists.\n // This is technically covered by the check at the bottom of this function, which iterates over cache entries,\n // but lets us arrive there quicker in the param-full case.\n const entryWithoutParams = prefetchCache.get(cacheKeyWithoutParams)\n if (\n process.env.NODE_ENV !== 'development' &&\n allowAliasing &&\n url.search &&\n kind !== PrefetchKind.FULL &&\n entryWithoutParams &&\n // We shouldn't return the aliased entry if it was relocated to a new cache key.\n // Since it's rewritten, it could respond with a completely different loading state.\n !entryWithoutParams.key.includes(INTERCEPTION_CACHE_KEY_MARKER)\n ) {\n return { ...entryWithoutParams, aliased: true }\n }\n }\n\n // If we've gotten to this point, we didn't find a specific cache entry that matched\n // the request URL.\n // We attempt a partial match by checking if there's a cache entry with the same pathname.\n // Regardless of what we find, since it doesn't correspond with the requested URL, we'll mark it \"aliased\".\n // This will signal to the router that it should only apply the loading state on the prefetched data.\n if (\n process.env.NODE_ENV !== 'development' &&\n kind !== PrefetchKind.FULL &&\n allowAliasing\n ) {\n for (const cacheEntry of prefetchCache.values()) {\n if (\n cacheEntry.url.pathname === url.pathname &&\n // We shouldn't return the aliased entry if it was relocated to a new cache key.\n // Since it's rewritten, it could respond with a completely different loading state.\n !cacheEntry.key.includes(INTERCEPTION_CACHE_KEY_MARKER)\n ) {\n return { ...cacheEntry, aliased: true }\n }\n }\n }\n\n return undefined\n}\n\n/**\n * Returns a prefetch cache entry if one exists. Otherwise creates a new one and enqueues a fetch request\n * to retrieve the prefetch data from the server.\n */\nexport function getOrCreatePrefetchCacheEntry({\n url,\n nextUrl,\n tree,\n prefetchCache,\n kind,\n allowAliasing = true,\n}: Pick & {\n url: URL\n kind?: PrefetchKind\n allowAliasing: boolean\n}): AliasedPrefetchCacheEntry {\n const existingCacheEntry = getExistingCacheEntry(\n url,\n kind,\n nextUrl,\n prefetchCache,\n allowAliasing\n )\n\n if (existingCacheEntry) {\n // Grab the latest status of the cache entry and update it\n existingCacheEntry.status = getPrefetchEntryCacheStatus(existingCacheEntry)\n\n // when `kind` is provided, an explicit prefetch was requested.\n // if the requested prefetch is \"full\" and the current cache entry wasn't, we want to re-prefetch with the new intent\n const switchedToFullPrefetch =\n existingCacheEntry.kind !== PrefetchKind.FULL &&\n kind === PrefetchKind.FULL\n\n if (switchedToFullPrefetch) {\n // If we switched to a full prefetch, validate that the existing cache entry contained partial data.\n // It's possible that the cache entry was seeded with full data but has a cache type of \"auto\" (ie when cache entries\n // are seeded but without a prefetch intent)\n existingCacheEntry.data.then((prefetchResponse) => {\n const isFullPrefetch =\n Array.isArray(prefetchResponse.flightData) &&\n prefetchResponse.flightData.some((flightData) => {\n // If we started rendering from the root and we returned RSC data (seedData), we already had a full prefetch.\n return flightData.isRootRender && flightData.seedData !== null\n })\n\n if (!isFullPrefetch) {\n return createLazyPrefetchEntry({\n tree,\n url,\n nextUrl,\n prefetchCache,\n // If we didn't get an explicit prefetch kind, we want to set a temporary kind\n // rather than assuming the same intent as the previous entry, to be consistent with how we\n // lazily create prefetch entries when intent is left unspecified.\n kind: kind ?? PrefetchKind.TEMPORARY,\n })\n }\n })\n }\n\n // If the existing cache entry was marked as temporary, it means it was lazily created when attempting to get an entry,\n // where we didn't have the prefetch intent. Now that we have the intent (in `kind`), we want to update the entry to the more accurate kind.\n if (kind && existingCacheEntry.kind === PrefetchKind.TEMPORARY) {\n existingCacheEntry.kind = kind\n }\n\n // We've determined that the existing entry we found is still valid, so we return it.\n return existingCacheEntry\n }\n\n // If we didn't return an entry, create a new one.\n return createLazyPrefetchEntry({\n tree,\n url,\n nextUrl,\n prefetchCache,\n kind: kind || PrefetchKind.TEMPORARY,\n })\n}\n\n/*\n * Used to take an existing cache entry and prefix it with the nextUrl, if it exists.\n * This ensures that we don't have conflicting cache entries for the same URL (as is the case with route interception).\n */\nfunction prefixExistingPrefetchCacheEntry({\n url,\n nextUrl,\n prefetchCache,\n existingCacheKey,\n}: Pick & {\n url: URL\n existingCacheKey: string\n}) {\n const existingCacheEntry = prefetchCache.get(existingCacheKey)\n if (!existingCacheEntry) {\n // no-op -- there wasn't an entry to move\n return\n }\n\n const newCacheKey = createPrefetchCacheKey(\n url,\n existingCacheEntry.kind,\n nextUrl\n )\n prefetchCache.set(newCacheKey, { ...existingCacheEntry, key: newCacheKey })\n prefetchCache.delete(existingCacheKey)\n\n return newCacheKey\n}\n\n/**\n * Use to seed the prefetch cache with data that has already been fetched.\n */\nexport function createSeededPrefetchCacheEntry({\n nextUrl,\n tree,\n prefetchCache,\n url,\n data,\n kind,\n}: Pick & {\n url: URL\n data: FetchServerResponseResult\n kind: PrefetchKind\n}) {\n // The initial cache entry technically includes full data, but it isn't explicitly prefetched -- we just seed the\n // prefetch cache so that we can skip an extra prefetch request later, since we already have the data.\n // if the prefetch corresponds with an interception route, we use the nextUrl to prefix the cache key\n const prefetchCacheKey = data.couldBeIntercepted\n ? createPrefetchCacheKey(url, kind, nextUrl)\n : createPrefetchCacheKey(url, kind)\n\n const prefetchEntry = {\n treeAtTimeOfPrefetch: tree,\n data: Promise.resolve(data),\n kind,\n prefetchTime: Date.now(),\n lastUsedTime: Date.now(),\n staleTime: -1,\n key: prefetchCacheKey,\n status: PrefetchCacheEntryStatus.fresh,\n url,\n } satisfies PrefetchCacheEntry\n\n prefetchCache.set(prefetchCacheKey, prefetchEntry)\n\n return prefetchEntry\n}\n\n/**\n * Creates a prefetch entry entry and enqueues a fetch request to retrieve the data.\n */\nfunction createLazyPrefetchEntry({\n url,\n kind,\n tree,\n nextUrl,\n prefetchCache,\n}: Pick & {\n url: URL\n kind: PrefetchKind\n}): PrefetchCacheEntry {\n const prefetchCacheKey = createPrefetchCacheKey(url, kind)\n\n // initiates the fetch request for the prefetch and attaches a listener\n // to the promise to update the prefetch cache entry when the promise resolves (if necessary)\n const data = prefetchQueue.enqueue(() =>\n fetchServerResponse(url, {\n flightRouterState: tree,\n nextUrl,\n prefetchKind: kind,\n }).then((prefetchResponse) => {\n // TODO: `fetchServerResponse` should be more tighly coupled to these prefetch cache operations\n // to avoid drift between this cache key prefixing logic\n // (which is currently directly influenced by the server response)\n let newCacheKey\n\n if (prefetchResponse.couldBeIntercepted) {\n // Determine if we need to prefix the cache key with the nextUrl\n newCacheKey = prefixExistingPrefetchCacheEntry({\n url,\n existingCacheKey: prefetchCacheKey,\n nextUrl,\n prefetchCache,\n })\n }\n\n // If the prefetch was a cache hit, we want to update the existing cache entry to reflect that it was a full prefetch.\n // This is because we know that a static response will contain the full RSC payload, and can be updated to respect the `static`\n // staleTime.\n if (prefetchResponse.prerendered) {\n const existingCacheEntry = prefetchCache.get(\n // if we prefixed the cache key due to route interception, we want to use the new key. Otherwise we use the original key\n newCacheKey ?? prefetchCacheKey\n )\n if (existingCacheEntry) {\n existingCacheEntry.kind = PrefetchKind.FULL\n if (prefetchResponse.staleTime !== -1) {\n // This is the stale time that was collected by the server during\n // static generation. Use this in place of the default stale time.\n existingCacheEntry.staleTime = prefetchResponse.staleTime\n }\n }\n }\n\n return prefetchResponse\n })\n )\n\n const prefetchEntry = {\n treeAtTimeOfPrefetch: tree,\n data,\n kind,\n prefetchTime: Date.now(),\n lastUsedTime: null,\n staleTime: -1,\n key: prefetchCacheKey,\n status: PrefetchCacheEntryStatus.fresh,\n url,\n }\n\n prefetchCache.set(prefetchCacheKey, prefetchEntry)\n\n return prefetchEntry\n}\n\nexport function prunePrefetchCache(\n prefetchCache: ReadonlyReducerState['prefetchCache']\n) {\n for (const [href, prefetchCacheEntry] of prefetchCache) {\n if (\n getPrefetchEntryCacheStatus(prefetchCacheEntry) ===\n PrefetchCacheEntryStatus.expired\n ) {\n prefetchCache.delete(href)\n }\n }\n}\n\n// These values are set by `define-env-plugin` (based on `nextConfig.experimental.staleTimes`)\n// and default to 5 minutes (static) / 0 seconds (dynamic)\nconst DYNAMIC_STALETIME_MS =\n Number(process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME) * 1000\n\nconst STATIC_STALETIME_MS =\n Number(process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME) * 1000\n\nfunction getPrefetchEntryCacheStatus({\n kind,\n prefetchTime,\n lastUsedTime,\n staleTime,\n}: PrefetchCacheEntry): PrefetchCacheEntryStatus {\n if (staleTime !== -1) {\n // `staleTime` is the value sent by the server during static generation.\n // When this is available, it takes precedence over any of the heuristics\n // that follow.\n //\n // TODO: When PPR is enabled, the server will *always* return a stale time\n // when prefetching. We should never use a prefetch entry that hasn't yet\n // received data from the server. So the only two cases should be 1) we use\n // the server-generated stale time 2) the unresolved entry is discarded.\n return Date.now() < prefetchTime + staleTime\n ? PrefetchCacheEntryStatus.fresh\n : PrefetchCacheEntryStatus.stale\n }\n\n // We will re-use the cache entry data for up to the `dynamic` staletime window.\n if (Date.now() < (lastUsedTime ?? prefetchTime) + DYNAMIC_STALETIME_MS) {\n return lastUsedTime\n ? PrefetchCacheEntryStatus.reusable\n : PrefetchCacheEntryStatus.fresh\n }\n\n // For \"auto\" prefetching, we'll re-use only the loading boundary for up to `static` staletime window.\n // A stale entry will only re-use the `loading` boundary, not the full data.\n // This will trigger a \"lazy fetch\" for the full data.\n if (kind === PrefetchKind.AUTO) {\n if (Date.now() < prefetchTime + STATIC_STALETIME_MS) {\n return PrefetchCacheEntryStatus.stale\n }\n }\n\n // for \"full\" prefetching, we'll re-use the cache entry data for up to `static` staletime window.\n if (kind === PrefetchKind.FULL) {\n if (Date.now() < prefetchTime + STATIC_STALETIME_MS) {\n return PrefetchCacheEntryStatus.reusable\n }\n }\n\n return PrefetchCacheEntryStatus.expired\n}\n","import type { FlightRouterState } from '../../../../server/app-render/types'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { createRouterCacheKey } from '../create-router-cache-key'\n\nexport function findHeadInCache(\n cache: CacheNode,\n parallelRoutes: FlightRouterState[1]\n): [CacheNode, string] | null {\n return findHeadInCacheImpl(cache, parallelRoutes, '')\n}\n\nfunction findHeadInCacheImpl(\n cache: CacheNode,\n parallelRoutes: FlightRouterState[1],\n keyPrefix: string\n): [CacheNode, string] | null {\n const isLastItem = Object.keys(parallelRoutes).length === 0\n if (isLastItem) {\n // Returns the entire Cache Node of the segment whose head we will render.\n return [cache, keyPrefix]\n }\n for (const key in parallelRoutes) {\n const [segment, childParallelRoutes] = parallelRoutes[key]\n const childSegmentMap = cache.parallelRoutes.get(key)\n if (!childSegmentMap) {\n continue\n }\n\n const cacheKey = createRouterCacheKey(segment)\n\n const cacheNode = childSegmentMap.get(cacheKey)\n if (!cacheNode) {\n continue\n }\n\n const item = findHeadInCacheImpl(\n cacheNode,\n childParallelRoutes,\n keyPrefix + '/' + cacheKey\n )\n if (item) {\n return item\n }\n }\n\n return null\n}\n","import type { Segment } from '../../../../server/app-render/types'\n\nexport function getSegmentValue(segment: Segment) {\n return Array.isArray(segment) ? segment[1] : segment\n}\n","import type { FlightRouterState } from '../../../../server/app-render/types'\nimport { isInterceptionRouteAppPath } from '../../../../server/lib/interception-routes'\n\nexport function hasInterceptionRouteInCurrentTree([\n segment,\n parallelRoutes,\n]: FlightRouterState): boolean {\n // If we have a dynamic segment, it's marked as an interception route by the presence of the `i` suffix.\n if (Array.isArray(segment) && (segment[2] === 'di' || segment[2] === 'ci')) {\n return true\n }\n\n // If segment is not an array, apply the existing string-based check\n if (typeof segment === 'string' && isInterceptionRouteAppPath(segment)) {\n return true\n }\n\n // Iterate through parallelRoutes if they exist\n if (parallelRoutes) {\n for (const key in parallelRoutes) {\n if (hasInterceptionRouteInCurrentTree(parallelRoutes[key])) {\n return true\n }\n }\n }\n\n return false\n}\n","import { fetchServerResponse } from '../fetch-server-response'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type {\n ReadonlyReducerState,\n ReducerState,\n HmrRefreshAction,\n Mutable,\n} from '../router-reducer-types'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { handleMutable } from '../handle-mutable'\nimport { applyFlightData } from '../apply-flight-data'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { handleSegmentMismatch } from '../handle-segment-mismatch'\nimport { hasInterceptionRouteInCurrentTree } from './has-interception-route-in-current-tree'\n\n// A version of refresh reducer that keeps the cache around instead of wiping all of it.\nfunction hmrRefreshReducerImpl(\n state: ReadonlyReducerState,\n action: HmrRefreshAction\n): ReducerState {\n const { origin } = action\n const mutable: Mutable = {}\n const href = state.canonicalUrl\n\n mutable.preserveCustomHistoryState = false\n\n const cache: CacheNode = createEmptyCacheNode()\n // If the current tree was intercepted, the nextUrl should be included in the request.\n // This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.\n const includeNextUrl = hasInterceptionRouteInCurrentTree(state.tree)\n\n // TODO-APP: verify that `href` is not an external url.\n // Fetch data from the root of the tree.\n cache.lazyData = fetchServerResponse(new URL(href, origin), {\n flightRouterState: [state.tree[0], state.tree[1], state.tree[2], 'refetch'],\n nextUrl: includeNextUrl ? state.nextUrl : null,\n isHmrRefresh: true,\n })\n\n return cache.lazyData.then(\n ({ flightData, canonicalUrl: canonicalUrlOverride }) => {\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n // Remove cache.lazyData as it has been resolved at this point.\n cache.lazyData = null\n\n let currentTree = state.tree\n let currentCache = state.cache\n\n for (const normalizedFlightData of flightData) {\n const { tree: treePatch, isRootRender } = normalizedFlightData\n if (!isRootRender) {\n // TODO-APP: handle this case better\n console.log('REFRESH FAILED')\n return state\n }\n\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n [''],\n currentTree,\n treePatch,\n state.canonicalUrl\n )\n\n if (newTree === null) {\n return handleSegmentMismatch(state, action, treePatch)\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(\n state,\n mutable,\n href,\n state.pushRef.pendingPush\n )\n }\n\n const canonicalUrlOverrideHref = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : undefined\n\n if (canonicalUrlOverride) {\n mutable.canonicalUrl = canonicalUrlOverrideHref\n }\n const applied = applyFlightData(\n currentCache,\n cache,\n normalizedFlightData\n )\n\n if (applied) {\n mutable.cache = cache\n currentCache = cache\n }\n\n mutable.patchedTree = newTree\n mutable.canonicalUrl = href\n\n currentTree = newTree\n }\n return handleMutable(state, mutable)\n },\n () => state\n )\n}\n\nfunction hmrRefreshReducerNoop(\n state: ReadonlyReducerState,\n _action: HmrRefreshAction\n): ReducerState {\n return state\n}\n\nexport const hmrRefreshReducer =\n process.env.NODE_ENV === 'production'\n ? hmrRefreshReducerNoop\n : hmrRefreshReducerImpl\n","import type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../../server/app-render/types'\nimport { fetchServerResponse } from '../fetch-server-response'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { invalidateCacheBelowFlightSegmentPath } from '../invalidate-cache-below-flight-segmentpath'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { shouldHardNavigate } from '../should-hard-navigate'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport {\n PrefetchCacheEntryStatus,\n type Mutable,\n type NavigateAction,\n type ReadonlyReducerState,\n type ReducerState,\n} from '../router-reducer-types'\nimport { handleMutable } from '../handle-mutable'\nimport { applyFlightData } from '../apply-flight-data'\nimport { prefetchQueue } from './prefetch-reducer'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { DEFAULT_SEGMENT_KEY } from '../../../../shared/lib/segment'\nimport {\n listenForDynamicRequest,\n updateCacheNodeOnNavigation,\n} from '../ppr-navigations'\nimport {\n getOrCreatePrefetchCacheEntry,\n prunePrefetchCache,\n} from '../prefetch-cache-utils'\nimport { clearCacheNodeDataForSegmentPath } from '../clear-cache-node-data-for-segment-path'\nimport { handleAliasedPrefetchEntry } from '../aliased-prefetch-navigations'\nimport {\n navigate as navigateUsingSegmentCache,\n NavigationResultTag,\n type NavigationResult,\n} from '../../segment-cache/navigation'\n\nexport function handleExternalUrl(\n state: ReadonlyReducerState,\n mutable: Mutable,\n url: string,\n pendingPush: boolean\n) {\n mutable.mpaNavigation = true\n mutable.canonicalUrl = url\n mutable.pendingPush = pendingPush\n mutable.scrollableSegments = undefined\n\n return handleMutable(state, mutable)\n}\n\nfunction generateSegmentsFromPatch(\n flightRouterPatch: FlightRouterState\n): FlightSegmentPath[] {\n const segments: FlightSegmentPath[] = []\n const [segment, parallelRoutes] = flightRouterPatch\n\n if (Object.keys(parallelRoutes).length === 0) {\n return [[segment]]\n }\n\n for (const [parallelRouteKey, parallelRoute] of Object.entries(\n parallelRoutes\n )) {\n for (const childSegment of generateSegmentsFromPatch(parallelRoute)) {\n // If the segment is empty, it means we are at the root of the tree\n if (segment === '') {\n segments.push([parallelRouteKey, ...childSegment])\n } else {\n segments.push([segment, parallelRouteKey, ...childSegment])\n }\n }\n }\n\n return segments\n}\n\nfunction triggerLazyFetchForLeafSegments(\n newCache: CacheNode,\n currentCache: CacheNode,\n flightSegmentPath: FlightSegmentPath,\n treePatch: FlightRouterState\n) {\n let appliedPatch = false\n\n newCache.rsc = currentCache.rsc\n newCache.prefetchRsc = currentCache.prefetchRsc\n newCache.loading = currentCache.loading\n newCache.parallelRoutes = new Map(currentCache.parallelRoutes)\n\n const segmentPathsToFill = generateSegmentsFromPatch(treePatch).map(\n (segment) => [...flightSegmentPath, ...segment]\n )\n\n for (const segmentPaths of segmentPathsToFill) {\n clearCacheNodeDataForSegmentPath(newCache, currentCache, segmentPaths)\n\n appliedPatch = true\n }\n\n return appliedPatch\n}\n\nfunction handleNavigationResult(\n state: ReadonlyReducerState,\n mutable: Mutable,\n pendingPush: boolean,\n result: NavigationResult\n): ReducerState {\n switch (result.tag) {\n case NavigationResultTag.MPA: {\n // Perform an MPA navigation.\n const newUrl = result.data\n return handleExternalUrl(state, mutable, newUrl, pendingPush)\n }\n case NavigationResultTag.NoOp:\n // The server responded with no change to the current page.\n return handleMutable(state, mutable)\n case NavigationResultTag.Success: {\n // Received a new result.\n mutable.cache = result.data.cacheNode\n mutable.patchedTree = result.data.flightRouterState\n mutable.canonicalUrl = result.data.canonicalUrl\n // TODO: Not yet implemented\n // mutable.scrollableSegments = scrollableSegments\n // mutable.hashFragment = hash\n // mutable.shouldScroll = shouldScroll\n return handleMutable(state, mutable)\n }\n case NavigationResultTag.Async: {\n return result.data.then(\n (asyncResult) =>\n handleNavigationResult(state, mutable, pendingPush, asyncResult),\n // If the navigation failed, return the current state.\n // TODO: This matches the current behavior but we need to do something\n // better here if the network fails.\n () => {\n return state\n }\n )\n }\n default:\n const _exhaustiveCheck: never = result\n return state\n }\n}\n\nexport function navigateReducer(\n state: ReadonlyReducerState,\n action: NavigateAction\n): ReducerState {\n const { url, isExternalUrl, navigateType, shouldScroll, allowAliasing } =\n action\n const mutable: Mutable = {}\n const { hash } = url\n const href = createHrefFromUrl(url)\n const pendingPush = navigateType === 'push'\n // we want to prune the prefetch cache on every navigation to avoid it growing too large\n prunePrefetchCache(state.prefetchCache)\n\n mutable.preserveCustomHistoryState = false\n mutable.pendingPush = pendingPush\n\n if (isExternalUrl) {\n return handleExternalUrl(state, mutable, url.toString(), pendingPush)\n }\n\n // Handles case where `` tag is present,\n // which will trigger an MPA navigation.\n if (document.getElementById('__next-page-redirect')) {\n return handleExternalUrl(state, mutable, href, pendingPush)\n }\n\n if (process.env.__NEXT_PPR && process.env.__NEXT_CLIENT_SEGMENT_CACHE) {\n // (Very Early Experimental Feature) Segment Cache\n //\n // Bypass the normal prefetch cache and use the new per-segment cache\n // implementation instead. This is only supported if PPR is enabled, too.\n //\n // Temporary glue code between the router reducer and the new navigation\n // implementation. Eventually we'll rewrite the router reducer to a\n // state machine.\n // TODO: Currently this always returns an async result, but in the future\n // it will return a sync result if the navigation was prefetched. Hence\n // a result type that's more complicated than you might expect.\n const result = navigateUsingSegmentCache(\n url,\n state.cache,\n state.tree,\n state.nextUrl\n )\n return handleNavigationResult(state, mutable, pendingPush, result)\n }\n\n const prefetchValues = getOrCreatePrefetchCacheEntry({\n url,\n nextUrl: state.nextUrl,\n tree: state.tree,\n prefetchCache: state.prefetchCache,\n allowAliasing,\n })\n const { treeAtTimeOfPrefetch, data } = prefetchValues\n\n prefetchQueue.bump(data)\n\n return data.then(\n ({ flightData, canonicalUrl: canonicalUrlOverride, postponed }) => {\n let isFirstRead = false\n // we only want to mark this once\n if (!prefetchValues.lastUsedTime) {\n // important: we should only mark the cache node as dirty after we unsuspend from the call above\n prefetchValues.lastUsedTime = Date.now()\n isFirstRead = true\n }\n\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(state, mutable, flightData, pendingPush)\n }\n\n const updatedCanonicalUrl = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : href\n\n const onlyHashChange =\n !!hash &&\n state.canonicalUrl.split('#', 1)[0] ===\n updatedCanonicalUrl.split('#', 1)[0]\n\n // If only the hash has changed, the server hasn't sent us any new data. We can just update\n // the mutable properties responsible for URL and scroll handling and return early.\n if (onlyHashChange) {\n mutable.onlyHashChange = true\n mutable.canonicalUrl = updatedCanonicalUrl\n mutable.shouldScroll = shouldScroll\n mutable.hashFragment = hash\n mutable.scrollableSegments = []\n return handleMutable(state, mutable)\n }\n\n if (prefetchValues.aliased) {\n const result = handleAliasedPrefetchEntry(\n state,\n flightData,\n url,\n mutable\n )\n\n // We didn't return new router state because we didn't apply the aliased entry for some reason.\n // We'll re-invoke the navigation handler but ensure that we don't attempt to use the aliased entry. This\n // will create an on-demand prefetch entry.\n if (result === false) {\n return navigateReducer(state, { ...action, allowAliasing: false })\n }\n\n return result\n }\n\n let currentTree = state.tree\n let currentCache = state.cache\n let scrollableSegments: FlightSegmentPath[] = []\n for (const normalizedFlightData of flightData) {\n const {\n pathToSegment: flightSegmentPath,\n seedData,\n head,\n isHeadPartial,\n isRootRender,\n } = normalizedFlightData\n let treePatch = normalizedFlightData.tree\n\n // TODO-APP: remove ''\n const flightSegmentPathWithLeadingEmpty = ['', ...flightSegmentPath]\n\n // Create new tree based on the flightSegmentPath and router state patch\n let newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty,\n currentTree,\n treePatch,\n href\n )\n\n // If the tree patch can't be applied to the current tree then we use the tree at time of prefetch\n // TODO-APP: This should instead fill in the missing pieces in `currentTree` with the data from `treeAtTimeOfPrefetch`, then apply the patch.\n if (newTree === null) {\n newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty,\n treeAtTimeOfPrefetch,\n treePatch,\n href\n )\n }\n\n if (newTree !== null) {\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(state, mutable, href, pendingPush)\n }\n\n if (\n // This is just a paranoid check. When a route is PPRed, the server\n // will send back a static response that's rendered from\n // the root. If for some reason it doesn't, we fall back to the\n // non-PPR implementation.\n // TODO: We should get rid of the else branch and do all navigations\n // via updateCacheNodeOnNavigation. The current structure is just\n // an incremental step.\n seedData &&\n isRootRender &&\n postponed\n ) {\n const task = updateCacheNodeOnNavigation(\n currentCache,\n currentTree,\n treePatch,\n seedData,\n head,\n isHeadPartial\n )\n\n if (task !== null) {\n // Use the tree computed by updateCacheNodeOnNavigation instead\n // of the one computed by applyRouterStatePatchToTree.\n // TODO: We should remove applyRouterStatePatchToTree\n // from the PPR path entirely.\n const patchedRouterState: FlightRouterState = task.route\n newTree = patchedRouterState\n\n const newCache = task.node\n if (newCache !== null) {\n // We've created a new Cache Node tree that contains a prefetched\n // version of the next page. This can be rendered instantly.\n mutable.cache = newCache\n }\n if (task.needsDynamicRequest) {\n // The prefetched tree has dynamic holes in it. We initiate a\n // dynamic request to fill them in.\n //\n // Do not block on the result. We'll immediately render the Cache\n // Node tree and suspend on the dynamic parts. When the request\n // comes in, we'll fill in missing data and ping React to\n // re-render. Unlike the lazy fetching model in the non-PPR\n // implementation, this is modeled as a single React update +\n // streaming, rather than multiple top-level updates. (However,\n // even in the new model, we'll still need to sometimes update the\n // root multiple times per navigation, like if the server sends us\n // a different response than we expected. For now, we revert back\n // to the lazy fetching mechanism in that case.)\n const dynamicRequest = fetchServerResponse(url, {\n flightRouterState: currentTree,\n nextUrl: state.nextUrl,\n })\n\n listenForDynamicRequest(task, dynamicRequest)\n // We store the dynamic request on the `lazyData` property of the CacheNode\n // because we're not going to await the dynamic request here. Since we're not blocking\n // on the dynamic request, `layout-router` will\n // task.node.lazyData = dynamicRequest\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We can skip the dynamic request.\n }\n } else {\n // Nothing changed, so reuse the old cache.\n // TODO: What if the head changed but not any of the segment data?\n // Is that possible? If so, we should clone the whole tree and\n // update the head.\n newTree = treePatch\n }\n } else {\n // The static response does not include any dynamic holes, so\n // there's no need to do a second request.\n // TODO: As an incremental step this just reverts back to the\n // non-PPR implementation. We can simplify this branch further,\n // given that PPR prefetches are always static and return the whole\n // tree. Or in the meantime we could factor it out into a\n // separate function.\n const cache: CacheNode = createEmptyCacheNode()\n let applied = false\n\n if (\n prefetchValues.status === PrefetchCacheEntryStatus.stale &&\n !isFirstRead\n ) {\n // When we have a stale prefetch entry, we only want to re-use the loading state of the route we're navigating to, to support instant loading navigations\n // this will trigger a lazy fetch for the actual page data by nulling the `rsc` and `prefetchRsc` values for page data,\n // while copying over the `loading` for the segment that contains the page data.\n // We only do this on subsequent reads, as otherwise there'd be no loading data to re-use.\n\n // We skip this branch if only the hash fragment has changed, as we don't want to trigger a lazy fetch in that case\n applied = triggerLazyFetchForLeafSegments(\n cache,\n currentCache,\n flightSegmentPath,\n treePatch\n )\n // since we re-used the stale cache's loading state & refreshed the data,\n // update the `lastUsedTime` so that it can continue to be re-used for the next 30s\n prefetchValues.lastUsedTime = Date.now()\n } else {\n applied = applyFlightData(\n currentCache,\n cache,\n normalizedFlightData,\n prefetchValues\n )\n }\n\n const hardNavigate = shouldHardNavigate(\n // TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty,\n currentTree\n )\n\n if (hardNavigate) {\n // Copy rsc for the root node of the cache.\n cache.rsc = currentCache.rsc\n cache.prefetchRsc = currentCache.prefetchRsc\n\n invalidateCacheBelowFlightSegmentPath(\n cache,\n currentCache,\n flightSegmentPath\n )\n // Ensure the existing cache value is used when the cache was not invalidated.\n mutable.cache = cache\n } else if (applied) {\n mutable.cache = cache\n // If we applied the cache, we update the \"current cache\" value so any other\n // segments in the FlightDataPath will be able to reference the updated cache.\n currentCache = cache\n }\n }\n\n currentTree = newTree\n\n for (const subSegment of generateSegmentsFromPatch(treePatch)) {\n const scrollableSegmentPath = [...flightSegmentPath, ...subSegment]\n // Filter out the __DEFAULT__ paths as they shouldn't be scrolled to in this case.\n if (\n scrollableSegmentPath[scrollableSegmentPath.length - 1] !==\n DEFAULT_SEGMENT_KEY\n ) {\n scrollableSegments.push(scrollableSegmentPath)\n }\n }\n }\n }\n\n mutable.patchedTree = currentTree\n mutable.canonicalUrl = updatedCanonicalUrl\n mutable.scrollableSegments = scrollableSegments\n mutable.hashFragment = hash\n mutable.shouldScroll = shouldScroll\n\n return handleMutable(state, mutable)\n },\n () => state\n )\n}\n","import type {\n PrefetchAction,\n ReducerState,\n ReadonlyReducerState,\n} from '../router-reducer-types'\nimport { PromiseQueue } from '../../promise-queue'\nimport {\n getOrCreatePrefetchCacheEntry,\n prunePrefetchCache,\n} from '../prefetch-cache-utils'\n\nexport const prefetchQueue = new PromiseQueue(5)\n\nexport const prefetchReducer =\n process.env.__NEXT_PPR && process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? identityReducerWhenSegmentCacheIsEnabled\n : prefetchReducerImpl\n\nfunction identityReducerWhenSegmentCacheIsEnabled(state: T): T {\n // Unlike the old implementation, the Segment Cache doesn't store its data in\n // the router reducer state.\n //\n // This shouldn't be reachable because we wrap the prefetch API in a check,\n // too, which prevents the action from being dispatched. But it's here for\n // clarity + code elimination.\n return state\n}\n\nfunction prefetchReducerImpl(\n state: ReadonlyReducerState,\n action: PrefetchAction\n): ReducerState {\n // let's prune the prefetch cache before we do anything else\n prunePrefetchCache(state.prefetchCache)\n\n const { url } = action\n\n getOrCreatePrefetchCacheEntry({\n url,\n nextUrl: state.nextUrl,\n prefetchCache: state.prefetchCache,\n kind: action.kind,\n tree: state.tree,\n allowAliasing: true,\n })\n\n return state\n}\n","import { fetchServerResponse } from '../fetch-server-response'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type {\n Mutable,\n ReadonlyReducerState,\n ReducerState,\n RefreshAction,\n} from '../router-reducer-types'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { handleMutable } from '../handle-mutable'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { fillLazyItemsTillLeafWithHead } from '../fill-lazy-items-till-leaf-with-head'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { handleSegmentMismatch } from '../handle-segment-mismatch'\nimport { hasInterceptionRouteInCurrentTree } from './has-interception-route-in-current-tree'\nimport { refreshInactiveParallelSegments } from '../refetch-inactive-parallel-segments'\n\nexport function refreshReducer(\n state: ReadonlyReducerState,\n action: RefreshAction\n): ReducerState {\n const { origin } = action\n const mutable: Mutable = {}\n const href = state.canonicalUrl\n\n let currentTree = state.tree\n\n mutable.preserveCustomHistoryState = false\n\n const cache: CacheNode = createEmptyCacheNode()\n\n // If the current tree was intercepted, the nextUrl should be included in the request.\n // This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.\n const includeNextUrl = hasInterceptionRouteInCurrentTree(state.tree)\n\n // TODO-APP: verify that `href` is not an external url.\n // Fetch data from the root of the tree.\n cache.lazyData = fetchServerResponse(new URL(href, origin), {\n flightRouterState: [\n currentTree[0],\n currentTree[1],\n currentTree[2],\n 'refetch',\n ],\n nextUrl: includeNextUrl ? state.nextUrl : null,\n })\n\n return cache.lazyData.then(\n async ({ flightData, canonicalUrl: canonicalUrlOverride }) => {\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n // Remove cache.lazyData as it has been resolved at this point.\n cache.lazyData = null\n\n for (const normalizedFlightData of flightData) {\n const {\n tree: treePatch,\n seedData: cacheNodeSeedData,\n head,\n isRootRender,\n } = normalizedFlightData\n\n if (!isRootRender) {\n // TODO-APP: handle this case better\n console.log('REFRESH FAILED')\n return state\n }\n\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n [''],\n currentTree,\n treePatch,\n state.canonicalUrl\n )\n\n if (newTree === null) {\n return handleSegmentMismatch(state, action, treePatch)\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(\n state,\n mutable,\n href,\n state.pushRef.pendingPush\n )\n }\n\n const canonicalUrlOverrideHref = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : undefined\n\n if (canonicalUrlOverride) {\n mutable.canonicalUrl = canonicalUrlOverrideHref\n }\n\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (cacheNodeSeedData !== null) {\n const rsc = cacheNodeSeedData[1]\n const loading = cacheNodeSeedData[3]\n cache.rsc = rsc\n cache.prefetchRsc = null\n cache.loading = loading\n fillLazyItemsTillLeafWithHead(\n cache,\n // Existing cache is not passed in as `router.refresh()` has to invalidate the entire cache.\n undefined,\n treePatch,\n cacheNodeSeedData,\n head\n )\n mutable.prefetchCache = new Map()\n }\n\n await refreshInactiveParallelSegments({\n state,\n updatedTree: newTree,\n updatedCache: cache,\n includeNextUrl,\n canonicalUrl: mutable.canonicalUrl || state.canonicalUrl,\n })\n\n mutable.cache = cache\n mutable.patchedTree = newTree\n\n currentTree = newTree\n }\n\n return handleMutable(state, mutable)\n },\n () => state\n )\n}\n","import { createHrefFromUrl } from '../create-href-from-url'\nimport type {\n ReadonlyReducerState,\n ReducerState,\n RestoreAction,\n} from '../router-reducer-types'\nimport { extractPathFromFlightRouterState } from '../compute-changed-path'\nimport { updateCacheNodeOnPopstateRestoration } from '../ppr-navigations'\n\nexport function restoreReducer(\n state: ReadonlyReducerState,\n action: RestoreAction\n): ReducerState {\n const { url, tree } = action\n const href = createHrefFromUrl(url)\n // This action is used to restore the router state from the history state.\n // However, it's possible that the history state no longer contains the `FlightRouterState`.\n // We will copy over the internal state on pushState/replaceState events, but if a history entry\n // occurred before hydration, or if the user navigated to a hash using a regular anchor link,\n // the history state will not contain the `FlightRouterState`.\n // In this case, we'll continue to use the existing tree so the router doesn't get into an invalid state.\n const treeToRestore = tree || state.tree\n\n const oldCache = state.cache\n const newCache = process.env.__NEXT_PPR\n ? // When PPR is enabled, we update the cache to drop the prefetch\n // data for any segment whose dynamic data was already received. This\n // prevents an unnecessary flash back to PPR state during a\n // back/forward navigation.\n updateCacheNodeOnPopstateRestoration(oldCache, treeToRestore)\n : oldCache\n\n return {\n // Set canonical url\n canonicalUrl: href,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache: newCache,\n prefetchCache: state.prefetchCache,\n // Restore provided tree\n tree: treeToRestore,\n nextUrl: extractPathFromFlightRouterState(treeToRestore) ?? url.pathname,\n }\n}\n","import type {\n ActionFlightResponse,\n ActionResult,\n} from '../../../../server/app-render/types'\nimport { callServer } from '../../../app-call-server'\nimport { findSourceMapURL } from '../../../app-find-source-map-url'\nimport {\n ACTION_HEADER,\n NEXT_IS_PRERENDER_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_URL,\n RSC_CONTENT_TYPE_HEADER,\n} from '../../app-router-headers'\n\n// // eslint-disable-next-line import/no-extraneous-dependencies\n// import { createFromFetch } from 'react-server-dom-webpack/client'\n// // eslint-disable-next-line import/no-extraneous-dependencies\n// import { encodeReply } from 'react-server-dom-webpack/client'\nconst { createFromFetch, createTemporaryReferenceSet, encodeReply } = (\n !!process.env.NEXT_RUNTIME\n ? // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client.edge')\n : // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client')\n) as typeof import('react-server-dom-webpack/client')\n\nimport {\n PrefetchKind,\n type ReadonlyReducerState,\n type ReducerState,\n type ServerActionAction,\n type ServerActionMutable,\n} from '../router-reducer-types'\nimport { assignLocation } from '../../../assign-location'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { handleMutable } from '../handle-mutable'\nimport { fillLazyItemsTillLeafWithHead } from '../fill-lazy-items-till-leaf-with-head'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { hasInterceptionRouteInCurrentTree } from './has-interception-route-in-current-tree'\nimport { handleSegmentMismatch } from '../handle-segment-mismatch'\nimport { refreshInactiveParallelSegments } from '../refetch-inactive-parallel-segments'\nimport {\n normalizeFlightData,\n type NormalizedFlightData,\n} from '../../../flight-data-helpers'\nimport { getRedirectError } from '../../redirect'\nimport { RedirectType } from '../../redirect-error'\nimport { createSeededPrefetchCacheEntry } from '../prefetch-cache-utils'\nimport { removeBasePath } from '../../../remove-base-path'\nimport { hasBasePath } from '../../../has-base-path'\nimport {\n extractInfoFromServerReferenceId,\n omitUnusedArgs,\n} from './server-reference-info'\n\ntype FetchServerActionResult = {\n redirectLocation: URL | undefined\n redirectType: RedirectType | undefined\n actionResult?: ActionResult\n actionFlightData?: NormalizedFlightData[] | string\n isPrerender: boolean\n revalidatedParts: {\n tag: boolean\n cookie: boolean\n paths: string[]\n }\n}\n\nasync function fetchServerAction(\n state: ReadonlyReducerState,\n nextUrl: ReadonlyReducerState['nextUrl'],\n { actionId, actionArgs }: ServerActionAction\n): Promise {\n const temporaryReferences = createTemporaryReferenceSet()\n const info = extractInfoFromServerReferenceId(actionId)\n\n // TODO: Currently, we're only omitting unused args for the experimental \"use\n // cache\" functions. Once the server reference info byte feature is stable, we\n // should apply this to server actions as well.\n const usedArgs =\n info.type === 'use-cache' ? omitUnusedArgs(actionArgs, info) : actionArgs\n\n const body = await encodeReply(usedArgs, { temporaryReferences })\n\n const res = await fetch('', {\n method: 'POST',\n headers: {\n Accept: RSC_CONTENT_TYPE_HEADER,\n [ACTION_HEADER]: actionId,\n [NEXT_ROUTER_STATE_TREE_HEADER]: encodeURIComponent(\n JSON.stringify(state.tree)\n ),\n ...(process.env.NEXT_DEPLOYMENT_ID\n ? {\n 'x-deployment-id': process.env.NEXT_DEPLOYMENT_ID,\n }\n : {}),\n ...(nextUrl\n ? {\n [NEXT_URL]: nextUrl,\n }\n : {}),\n },\n body,\n })\n\n const redirectHeader = res.headers.get('x-action-redirect')\n const [location, _redirectType] = redirectHeader?.split(';') || []\n let redirectType: RedirectType | undefined\n switch (_redirectType) {\n case 'push':\n redirectType = RedirectType.push\n break\n case 'replace':\n redirectType = RedirectType.replace\n break\n default:\n redirectType = undefined\n }\n\n const isPrerender = !!res.headers.get(NEXT_IS_PRERENDER_HEADER)\n let revalidatedParts: FetchServerActionResult['revalidatedParts']\n try {\n const revalidatedHeader = JSON.parse(\n res.headers.get('x-action-revalidated') || '[[],0,0]'\n )\n revalidatedParts = {\n paths: revalidatedHeader[0] || [],\n tag: !!revalidatedHeader[1],\n cookie: revalidatedHeader[2],\n }\n } catch (e) {\n revalidatedParts = {\n paths: [],\n tag: false,\n cookie: false,\n }\n }\n\n const redirectLocation = location\n ? assignLocation(\n location,\n new URL(state.canonicalUrl, window.location.href)\n )\n : undefined\n\n const contentType = res.headers.get('content-type')\n\n if (contentType?.startsWith(RSC_CONTENT_TYPE_HEADER)) {\n const response: ActionFlightResponse = await createFromFetch(\n Promise.resolve(res),\n { callServer, findSourceMapURL, temporaryReferences }\n )\n\n if (location) {\n // if it was a redirection, then result is just a regular RSC payload\n return {\n actionFlightData: normalizeFlightData(response.f),\n redirectLocation,\n redirectType,\n revalidatedParts,\n isPrerender,\n }\n }\n\n return {\n actionResult: response.a,\n actionFlightData: normalizeFlightData(response.f),\n redirectLocation,\n redirectType,\n revalidatedParts,\n isPrerender,\n }\n }\n\n // Handle invalid server action responses\n if (res.status >= 400) {\n // The server can respond with a text/plain error message, but we'll fallback to something generic\n // if there isn't one.\n const error =\n contentType === 'text/plain'\n ? await res.text()\n : 'An unexpected response was received from the server.'\n\n throw new Error(error)\n }\n\n return {\n redirectLocation,\n redirectType,\n revalidatedParts,\n isPrerender,\n }\n}\n\n/*\n * This reducer is responsible for calling the server action and processing any side-effects from the server action.\n * It does not mutate the state by itself but rather delegates to other reducers to do the actual mutation.\n */\nexport function serverActionReducer(\n state: ReadonlyReducerState,\n action: ServerActionAction\n): ReducerState {\n const { resolve, reject } = action\n const mutable: ServerActionMutable = {}\n\n let currentTree = state.tree\n\n mutable.preserveCustomHistoryState = false\n\n // only pass along the `nextUrl` param (used for interception routes) if the current route was intercepted.\n // If the route has been intercepted, the action should be as well.\n // Otherwise the server action might be intercepted with the wrong action id\n // (ie, one that corresponds with the intercepted route)\n const nextUrl =\n state.nextUrl && hasInterceptionRouteInCurrentTree(state.tree)\n ? state.nextUrl\n : null\n\n return fetchServerAction(state, nextUrl, action).then(\n async ({\n actionResult,\n actionFlightData: flightData,\n redirectLocation,\n redirectType,\n isPrerender,\n revalidatedParts,\n }) => {\n let redirectHref: string | undefined\n\n // honor the redirect type instead of defaulting to push in case of server actions.\n if (redirectLocation) {\n if (redirectType === RedirectType.replace) {\n state.pushRef.pendingPush = false\n mutable.pendingPush = false\n } else {\n state.pushRef.pendingPush = true\n mutable.pendingPush = true\n }\n\n redirectHref = createHrefFromUrl(redirectLocation, false)\n mutable.canonicalUrl = redirectHref\n }\n\n if (!flightData) {\n resolve(actionResult)\n\n // If there is a redirect but no flight data we need to do a mpaNavigation.\n if (redirectLocation) {\n return handleExternalUrl(\n state,\n mutable,\n redirectLocation.href,\n state.pushRef.pendingPush\n )\n }\n return state\n }\n\n if (typeof flightData === 'string') {\n // Handle case when navigating to page in `pages` from `app`\n resolve(actionResult)\n\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n const actionRevalidated =\n revalidatedParts.paths.length > 0 ||\n revalidatedParts.tag ||\n revalidatedParts.cookie\n\n for (const normalizedFlightData of flightData) {\n const {\n tree: treePatch,\n seedData: cacheNodeSeedData,\n head,\n isRootRender,\n } = normalizedFlightData\n\n if (!isRootRender) {\n // TODO-APP: handle this case better\n console.log('SERVER ACTION APPLY FAILED')\n resolve(actionResult)\n\n return state\n }\n\n // Given the path can only have two items the items are only the router state and rsc for the root.\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n [''],\n currentTree,\n treePatch,\n redirectHref ? redirectHref : state.canonicalUrl\n )\n\n if (newTree === null) {\n resolve(actionResult)\n\n return handleSegmentMismatch(state, action, treePatch)\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n resolve(actionResult)\n\n return handleExternalUrl(\n state,\n mutable,\n redirectHref || state.canonicalUrl,\n state.pushRef.pendingPush\n )\n }\n\n // The server sent back RSC data for the server action, so we need to apply it to the cache.\n if (cacheNodeSeedData !== null) {\n const rsc = cacheNodeSeedData[1]\n const cache: CacheNode = createEmptyCacheNode()\n cache.rsc = rsc\n cache.prefetchRsc = null\n cache.loading = cacheNodeSeedData[3]\n fillLazyItemsTillLeafWithHead(\n cache,\n // Existing cache is not passed in as server actions have to invalidate the entire cache.\n undefined,\n treePatch,\n cacheNodeSeedData,\n head\n )\n\n mutable.cache = cache\n mutable.prefetchCache = new Map()\n\n if (actionRevalidated) {\n await refreshInactiveParallelSegments({\n state,\n updatedTree: newTree,\n updatedCache: cache,\n includeNextUrl: Boolean(nextUrl),\n canonicalUrl: mutable.canonicalUrl || state.canonicalUrl,\n })\n }\n }\n\n mutable.patchedTree = newTree\n currentTree = newTree\n }\n\n if (redirectLocation && redirectHref) {\n // Because the RedirectBoundary will trigger a navigation, we need to seed the prefetch cache\n // with the FlightData that we got from the server action for the target page, so that it's\n // available when the page is navigated to and doesn't need to be re-fetched.\n // We only do this if the server action didn't revalidate any data, as in that case the\n // client cache will be cleared and the data will be re-fetched anyway.\n if (!actionRevalidated) {\n createSeededPrefetchCacheEntry({\n url: redirectLocation,\n data: {\n flightData,\n canonicalUrl: undefined,\n couldBeIntercepted: false,\n prerendered: false,\n postponed: false,\n // TODO: We should be able to set this if the server action\n // returned a fully static response.\n staleTime: -1,\n },\n tree: state.tree,\n prefetchCache: state.prefetchCache,\n nextUrl: state.nextUrl,\n kind: isPrerender ? PrefetchKind.FULL : PrefetchKind.AUTO,\n })\n mutable.prefetchCache = state.prefetchCache\n }\n\n // If the action triggered a redirect, the action promise promise will be rejected with\n // a redirect so that it's handled by RedirectBoundary as we won't have a valid\n // action result to resolve the promise with. This will effectively reset the state of\n // the component that called the action as the error boundary will remount the tree.\n // The status code doesn't matter here as the action handler will have already sent\n // a response with the correct status code.\n reject(\n getRedirectError(\n hasBasePath(redirectHref)\n ? removeBasePath(redirectHref)\n : redirectHref,\n redirectType || RedirectType.push\n )\n )\n } else {\n resolve(actionResult)\n }\n\n return handleMutable(state, mutable)\n },\n (e: any) => {\n // When the server action is rejected we don't update the state and instead call the reject handler of the promise.\n reject(e)\n\n return state\n }\n )\n}\n","import { createHrefFromUrl } from '../create-href-from-url'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type {\n ServerPatchAction,\n ReducerState,\n ReadonlyReducerState,\n Mutable,\n} from '../router-reducer-types'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { applyFlightData } from '../apply-flight-data'\nimport { handleMutable } from '../handle-mutable'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { createEmptyCacheNode } from '../../app-router'\n\nexport function serverPatchReducer(\n state: ReadonlyReducerState,\n action: ServerPatchAction\n): ReducerState {\n const {\n serverResponse: { flightData, canonicalUrl: canonicalUrlOverride },\n } = action\n\n const mutable: Mutable = {}\n\n mutable.preserveCustomHistoryState = false\n\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n let currentTree = state.tree\n let currentCache = state.cache\n\n for (const normalizedFlightData of flightData) {\n const { segmentPath: flightSegmentPath, tree: treePatch } =\n normalizedFlightData\n\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n ['', ...flightSegmentPath],\n currentTree,\n treePatch,\n state.canonicalUrl\n )\n\n // `applyRouterStatePatchToTree` returns `null` when it determined that the server response is not applicable to the current tree.\n // In other words, the server responded with a tree that doesn't match what the client is currently rendering.\n // This can happen if the server patch action took longer to resolve than a subsequent navigation which would have changed the tree.\n // Previously this case triggered an MPA navigation but it should be safe to simply discard the server response rather than forcing\n // the entire page to reload.\n if (newTree === null) {\n return state\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(\n state,\n mutable,\n state.canonicalUrl,\n state.pushRef.pendingPush\n )\n }\n\n const canonicalUrlOverrideHref = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : undefined\n\n if (canonicalUrlOverrideHref) {\n mutable.canonicalUrl = canonicalUrlOverrideHref\n }\n\n const cache: CacheNode = createEmptyCacheNode()\n applyFlightData(currentCache, cache, normalizedFlightData)\n\n mutable.patchedTree = newTree\n mutable.cache = cache\n\n currentCache = cache\n currentTree = newTree\n }\n\n return handleMutable(state, mutable)\n}\n","export interface ServerReferenceInfo {\n type: 'server-action' | 'use-cache'\n usedArgs: [boolean, boolean, boolean, boolean, boolean, boolean]\n hasRestArgs: boolean\n}\n\n/**\n * Extracts info about the server reference for the given server reference ID by\n * parsing the first byte of the hex-encoded ID.\n *\n * ```\n * Bit positions: [7] [6] [5] [4] [3] [2] [1] [0]\n * Bits: typeBit argMask restArgs\n * ```\n *\n * If the `typeBit` is `1` the server reference represents a `\"use cache\"`\n * function, otherwise a server action.\n *\n * The `argMask` encodes whether the function uses the argument at the\n * respective position.\n *\n * The `restArgs` bit indicates whether the function uses a rest parameter. It's\n * also set to 1 if the function has more than 6 args.\n *\n * @param id hex-encoded server reference ID\n */\nexport function extractInfoFromServerReferenceId(\n id: string\n): ServerReferenceInfo {\n const infoByte = parseInt(id.slice(0, 2), 16)\n const typeBit = (infoByte >> 7) & 0x1\n const argMask = (infoByte >> 1) & 0x3f\n const restArgs = infoByte & 0x1\n const usedArgs = Array(6)\n\n for (let index = 0; index < 6; index++) {\n const bitPosition = 5 - index\n const bit = (argMask >> bitPosition) & 0x1\n usedArgs[index] = bit === 1\n }\n\n return {\n type: typeBit === 1 ? 'use-cache' : 'server-action',\n usedArgs: usedArgs as [\n boolean,\n boolean,\n boolean,\n boolean,\n boolean,\n boolean,\n ],\n hasRestArgs: restArgs === 1,\n }\n}\n\n/**\n * Creates a sparse array containing only the used arguments based on the\n * provided action info.\n */\nexport function omitUnusedArgs(\n args: unknown[],\n info: ServerReferenceInfo\n): unknown[] {\n const filteredArgs = new Array(args.length)\n\n for (let index = 0; index < args.length; index++) {\n if (\n (index < 6 && info.usedArgs[index]) ||\n // This assumes that the server reference info byte has the restArgs bit\n // set to 1 if there are more than 6 args.\n (index >= 6 && info.hasRestArgs)\n ) {\n filteredArgs[index] = args[index]\n }\n }\n\n return filteredArgs\n}\n","import type { FlightRouterState } from '../../../server/app-render/types'\nimport type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { AppRouterState } from './router-reducer-types'\nimport { applyFlightData } from './apply-flight-data'\nimport { fetchServerResponse } from './fetch-server-response'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\n\ninterface RefreshInactiveParallelSegments {\n state: AppRouterState\n updatedTree: FlightRouterState\n updatedCache: CacheNode\n includeNextUrl: boolean\n canonicalUrl: string\n}\n\n/**\n * Refreshes inactive segments that are still in the current FlightRouterState.\n * A segment is considered \"inactive\" when the server response indicates it didn't match to a page component.\n * This happens during a soft-navigation, where the server will want to patch in the segment\n * with the \"default\" component, but we explicitly ignore the server in this case\n * and keep the existing state for that segment. New data for inactive segments are inherently\n * not part of the server response when we patch the tree, because they were associated with a response\n * from an earlier navigation/request. For each segment, once it becomes \"active\", we encode the URL that provided\n * the data for it. This function traverses parallel routes looking for these markers so that it can re-fetch\n * and patch the new data into the tree.\n */\nexport async function refreshInactiveParallelSegments(\n options: RefreshInactiveParallelSegments\n) {\n const fetchedSegments = new Set()\n await refreshInactiveParallelSegmentsImpl({\n ...options,\n rootTree: options.updatedTree,\n fetchedSegments,\n })\n}\n\nasync function refreshInactiveParallelSegmentsImpl({\n state,\n updatedTree,\n updatedCache,\n includeNextUrl,\n fetchedSegments,\n rootTree = updatedTree,\n canonicalUrl,\n}: RefreshInactiveParallelSegments & {\n fetchedSegments: Set\n rootTree: FlightRouterState\n}) {\n const [, parallelRoutes, refetchPath, refetchMarker] = updatedTree\n const fetchPromises = []\n\n if (\n refetchPath &&\n refetchPath !== canonicalUrl &&\n refetchMarker === 'refresh' &&\n // it's possible for the tree to contain multiple segments that contain data at the same URL\n // we keep track of them so we can dedupe the requests\n !fetchedSegments.has(refetchPath)\n ) {\n fetchedSegments.add(refetchPath) // Mark this URL as fetched\n\n // Eagerly kick off the fetch for the refetch path & the parallel routes. This should be fine to do as they each operate\n // independently on their own cache nodes, and `applyFlightData` will copy anything it doesn't care about from the existing cache.\n const fetchPromise = fetchServerResponse(\n new URL(refetchPath, location.origin),\n {\n // refetch from the root of the updated tree, otherwise it will be scoped to the current segment\n // and might not contain the data we need to patch in interception route data (such as dynamic params from a previous segment)\n flightRouterState: [rootTree[0], rootTree[1], rootTree[2], 'refetch'],\n nextUrl: includeNextUrl ? state.nextUrl : null,\n }\n ).then(({ flightData }) => {\n if (typeof flightData !== 'string') {\n for (const flightDataPath of flightData) {\n // we only pass the new cache as this function is called after clearing the router cache\n // and filling in the new page data from the server. Meaning the existing cache is actually the cache that's\n // just been created & has been written to, but hasn't been \"committed\" yet.\n applyFlightData(updatedCache, updatedCache, flightDataPath)\n }\n } else {\n // When flightData is a string, it suggests that the server response should have triggered an MPA navigation\n // I'm not 100% sure of this decision, but it seems unlikely that we'd want to introduce a redirect side effect\n // when refreshing on-screen data, so handling this has been ommitted.\n }\n })\n\n fetchPromises.push(fetchPromise)\n }\n\n for (const key in parallelRoutes) {\n const parallelFetchPromise = refreshInactiveParallelSegmentsImpl({\n state,\n updatedTree: parallelRoutes[key],\n updatedCache,\n includeNextUrl,\n fetchedSegments,\n rootTree,\n canonicalUrl,\n })\n\n fetchPromises.push(parallelFetchPromise)\n }\n\n await Promise.all(fetchPromises)\n}\n\n/**\n * Walks the current parallel segments to determine if they are \"active\".\n * An active parallel route will have a `__PAGE__` segment in the FlightRouterState.\n * As opposed to a `__DEFAULT__` segment, which means there was no match for that parallel route.\n * We add a special marker here so that we know how to refresh its data when the router is revalidated.\n */\nexport function addRefreshMarkerToActiveParallelSegments(\n tree: FlightRouterState,\n path: string\n) {\n const [segment, parallelRoutes, , refetchMarker] = tree\n // a page segment might also contain concatenated search params, so we do a partial match on the key\n if (segment.includes(PAGE_SEGMENT_KEY) && refetchMarker !== 'refresh') {\n tree[2] = path\n tree[3] = 'refresh'\n }\n\n for (const key in parallelRoutes) {\n addRefreshMarkerToActiveParallelSegments(parallelRoutes[key], path)\n }\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../server/app-render/types'\nimport type { FetchServerResponseResult } from './fetch-server-response'\n\nexport const ACTION_REFRESH = 'refresh'\nexport const ACTION_NAVIGATE = 'navigate'\nexport const ACTION_RESTORE = 'restore'\nexport const ACTION_SERVER_PATCH = 'server-patch'\nexport const ACTION_PREFETCH = 'prefetch'\nexport const ACTION_HMR_REFRESH = 'hmr-refresh'\nexport const ACTION_SERVER_ACTION = 'server-action'\n\nexport type RouterChangeByServerResponse = ({\n previousTree,\n serverResponse,\n}: {\n previousTree: FlightRouterState\n serverResponse: FetchServerResponseResult\n}) => void\n\nexport type RouterNavigate = (\n href: string,\n navigateType: 'push' | 'replace',\n shouldScroll: boolean\n) => void\n\nexport interface Mutable {\n mpaNavigation?: boolean\n patchedTree?: FlightRouterState\n canonicalUrl?: string\n scrollableSegments?: FlightSegmentPath[]\n pendingPush?: boolean\n cache?: CacheNode\n prefetchCache?: AppRouterState['prefetchCache']\n hashFragment?: string\n shouldScroll?: boolean\n preserveCustomHistoryState?: boolean\n onlyHashChange?: boolean\n}\n\nexport interface ServerActionMutable extends Mutable {\n inFlightServerAction?: Promise | null\n}\n\n/**\n * Refresh triggers a refresh of the full page data.\n * - fetches the Flight data and fills rsc at the root of the cache.\n * - The router state is updated at the root.\n */\nexport interface RefreshAction {\n type: typeof ACTION_REFRESH\n origin: Location['origin']\n}\n\nexport interface HmrRefreshAction {\n type: typeof ACTION_HMR_REFRESH\n origin: Location['origin']\n}\n\nexport type ServerActionDispatcher = (\n args: Omit<\n ServerActionAction,\n 'type' | 'mutable' | 'navigate' | 'changeByServerResponse' | 'cache'\n >\n) => void\n\nexport interface ServerActionAction {\n type: typeof ACTION_SERVER_ACTION\n actionId: string\n actionArgs: any[]\n resolve: (value: any) => void\n reject: (reason?: any) => void\n}\n\n/**\n * Navigate triggers a navigation to the provided url. It supports two types: `push` and `replace`.\n *\n * `navigateType`:\n * - `push` - pushes a new history entry in the browser history\n * - `replace` - replaces the current history entry in the browser history\n *\n * Navigate has multiple cache heuristics:\n * - page was prefetched\n * - Apply router state tree from prefetch\n * - Apply Flight data from prefetch to the cache\n * - If Flight data is a string, it's a redirect and the state is updated to trigger a redirect\n * - Check if hard navigation is needed\n * - Hard navigation happens when a dynamic parameter below the common layout changed\n * - When hard navigation is needed the cache is invalidated below the flightSegmentPath\n * - The missing cache nodes of the page will be fetched in layout-router and trigger the SERVER_PATCH action\n * - If hard navigation is not needed\n * - The cache is reused\n * - If any cache nodes are missing they'll be fetched in layout-router and trigger the SERVER_PATCH action\n * - page was not prefetched\n * - The navigate was called from `next/router` (`router.push()` / `router.replace()`) / `next/link` without prefetched data available (e.g. the prefetch didn't come back from the server before clicking the link)\n * - Flight data is fetched in the reducer (suspends the reducer)\n * - Router state tree is created based on Flight data\n * - Cache is filled based on the Flight data\n *\n * Above steps explain 3 cases:\n * - `soft` - Reuses the existing cache and fetches missing nodes in layout-router.\n * - `hard` - Creates a new cache where cache nodes are removed below the common layout and fetches missing nodes in layout-router.\n * - `optimistic` (explicit no prefetch) - Creates a new cache and kicks off the data fetch in the reducer. The data fetch is awaited in the layout-router.\n */\nexport interface NavigateAction {\n type: typeof ACTION_NAVIGATE\n url: URL\n isExternalUrl: boolean\n locationSearch: Location['search']\n navigateType: 'push' | 'replace'\n shouldScroll: boolean\n allowAliasing: boolean\n}\n\n/**\n * Restore applies the provided router state.\n * - Used for `popstate` (back/forward navigation) where a known router state has to be applied.\n * - Also used when syncing the router state with `pushState`/`replaceState` calls.\n * - Router state is applied as-is from the history state, if available.\n * - If the history state does not contain the router state, the existing router state is used.\n * - If any cache node is missing it will be fetched in layout-router during rendering and the server-patch case.\n * - If existing cache nodes match these are used.\n */\nexport interface RestoreAction {\n type: typeof ACTION_RESTORE\n url: URL\n tree: FlightRouterState | undefined\n}\n\n/**\n * Server-patch applies the provided Flight data to the cache and router tree.\n * - Only triggered in layout-router.\n * - Creates a new cache and router state with the Flight data applied.\n */\nexport interface ServerPatchAction {\n type: typeof ACTION_SERVER_PATCH\n serverResponse: FetchServerResponseResult\n previousTree: FlightRouterState\n}\n\n/**\n * PrefetchKind defines the type of prefetching that should be done.\n * - `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully.\n * - `full` - prefetch the page data fully.\n * - `temporary` - a temporary prefetch entry is added to the cache, this is used when prefetch={false} is used in next/link or when you push a route programmatically.\n */\n\nexport enum PrefetchKind {\n AUTO = 'auto',\n FULL = 'full',\n TEMPORARY = 'temporary',\n}\n\n/**\n * Prefetch adds the provided FlightData to the prefetch cache\n * - Creates the router state tree based on the patch in FlightData\n * - Adds the FlightData to the prefetch cache\n * - In ACTION_NAVIGATE the prefetch cache is checked and the router state tree and FlightData are applied.\n */\nexport interface PrefetchAction {\n type: typeof ACTION_PREFETCH\n url: URL\n kind: PrefetchKind\n}\n\nexport interface PushRef {\n /**\n * If the app-router should push a new history entry in app-router's useEffect()\n */\n pendingPush: boolean\n /**\n * Multi-page navigation through location.href.\n */\n mpaNavigation: boolean\n /**\n * Skip applying the router state to the browser history state.\n */\n preserveCustomHistoryState: boolean\n}\n\nexport type FocusAndScrollRef = {\n /**\n * If focus and scroll should be set in the layout-router's useEffect()\n */\n apply: boolean\n /**\n * The hash fragment that should be scrolled to.\n */\n hashFragment: string | null\n /**\n * The paths of the segments that should be focused.\n */\n segmentPaths: FlightSegmentPath[]\n /**\n * If only the URLs hash fragment changed\n */\n onlyHashChange: boolean\n}\n\nexport type PrefetchCacheEntry = {\n treeAtTimeOfPrefetch: FlightRouterState\n data: Promise\n kind: PrefetchKind\n prefetchTime: number\n staleTime: number\n lastUsedTime: number | null\n key: string\n status: PrefetchCacheEntryStatus\n url: URL\n}\n\nexport enum PrefetchCacheEntryStatus {\n fresh = 'fresh',\n reusable = 'reusable',\n expired = 'expired',\n stale = 'stale',\n}\n\n/**\n * Handles keeping the state of app-router.\n */\nexport type AppRouterState = {\n /**\n * The router state, this is written into the history state in app-router using replaceState/pushState.\n * - Has to be serializable as it is written into the history state.\n * - Holds which segments and parallel routes are shown on the screen.\n */\n tree: FlightRouterState\n /**\n * The cache holds React nodes for every segment that is shown on screen as well as previously shown segments.\n * It also holds in-progress data requests.\n * Prefetched data is stored separately in `prefetchCache`, that is applied during ACTION_NAVIGATE.\n */\n cache: CacheNode\n /**\n * Cache that holds prefetched Flight responses keyed by url.\n */\n prefetchCache: Map\n /**\n * Decides if the update should create a new history entry and if the navigation has to trigger a browser navigation.\n */\n pushRef: PushRef\n /**\n * Decides if the update should apply scroll and focus management.\n */\n focusAndScrollRef: FocusAndScrollRef\n /**\n * The canonical url that is pushed/replaced.\n * - This is the url you see in the browser.\n */\n canonicalUrl: string\n /**\n * The underlying \"url\" representing the UI state, which is used for intercepting routes.\n */\n nextUrl: string | null\n}\n\nexport type ReadonlyReducerState = Readonly\nexport type ReducerState = Promise | AppRouterState\nexport type ReducerActions = Readonly<\n | RefreshAction\n | NavigateAction\n | RestoreAction\n | ServerPatchAction\n | PrefetchAction\n | HmrRefreshAction\n | ServerActionAction\n>\n","import {\n ACTION_NAVIGATE,\n ACTION_SERVER_PATCH,\n ACTION_RESTORE,\n ACTION_REFRESH,\n ACTION_PREFETCH,\n ACTION_HMR_REFRESH,\n ACTION_SERVER_ACTION,\n} from './router-reducer-types'\nimport type {\n ReducerActions,\n ReducerState,\n ReadonlyReducerState,\n} from './router-reducer-types'\nimport { navigateReducer } from './reducers/navigate-reducer'\nimport { serverPatchReducer } from './reducers/server-patch-reducer'\nimport { restoreReducer } from './reducers/restore-reducer'\nimport { refreshReducer } from './reducers/refresh-reducer'\nimport { prefetchReducer } from './reducers/prefetch-reducer'\nimport { hmrRefreshReducer } from './reducers/hmr-refresh-reducer'\nimport { serverActionReducer } from './reducers/server-action-reducer'\n\n/**\n * Reducer that handles the app-router state updates.\n */\nfunction clientReducer(\n state: ReadonlyReducerState,\n action: ReducerActions\n): ReducerState {\n switch (action.type) {\n case ACTION_NAVIGATE: {\n return navigateReducer(state, action)\n }\n case ACTION_SERVER_PATCH: {\n return serverPatchReducer(state, action)\n }\n case ACTION_RESTORE: {\n return restoreReducer(state, action)\n }\n case ACTION_REFRESH: {\n return refreshReducer(state, action)\n }\n case ACTION_HMR_REFRESH: {\n return hmrRefreshReducer(state, action)\n }\n case ACTION_PREFETCH: {\n return prefetchReducer(state, action)\n }\n case ACTION_SERVER_ACTION: {\n return serverActionReducer(state, action)\n }\n // This case should never be hit as dispatch is strongly typed.\n default:\n throw new Error('Unknown action')\n }\n}\n\nfunction serverReducer(\n state: ReadonlyReducerState,\n _action: ReducerActions\n): ReducerState {\n return state\n}\n\n// we don't run the client reducer on the server, so we use a noop function for better tree shaking\nexport const reducer =\n typeof window === 'undefined' ? serverReducer : clientReducer\n","import type {\n FlightRouterState,\n FlightDataPath,\n Segment,\n} from '../../../server/app-render/types'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\nimport { matchSegment } from '../match-segments'\n\n// TODO-APP: flightSegmentPath will be empty in case of static response, needs to be handled.\nexport function shouldHardNavigate(\n flightSegmentPath: FlightDataPath,\n flightRouterState: FlightRouterState\n): boolean {\n const [segment, parallelRoutes] = flightRouterState\n // TODO-APP: Check if `as` can be replaced.\n const [currentSegment, parallelRouteKey] = flightSegmentPath as [\n Segment,\n string,\n ]\n\n // Check if current segment matches the existing segment.\n if (!matchSegment(currentSegment, segment)) {\n // If dynamic parameter in tree doesn't match up with segment path a hard navigation is triggered.\n if (Array.isArray(currentSegment)) {\n return true\n }\n\n // If the existing segment did not match soft navigation is triggered.\n return false\n }\n const lastSegment = flightSegmentPath.length <= 2\n\n if (lastSegment) {\n return false\n }\n\n return shouldHardNavigate(\n getNextFlightSegmentPath(flightSegmentPath),\n parallelRoutes[parallelRouteKey]\n )\n}\n","// TypeScript trick to simulate opaque types, like in Flow.\ntype Opaque = T & { __brand: K }\n\n// Only functions in this module should be allowed to create CacheKeys.\nexport type NormalizedHref = Opaque<'NormalizedHref', string>\nexport type NormalizedNextUrl = Opaque<'NormalizedNextUrl', string>\n\nexport type RouteCacheKey = Opaque<\n 'RouteCacheKey',\n {\n href: NormalizedHref\n nextUrl: NormalizedNextUrl | null\n }\n>\n\nexport function createCacheKey(\n originalHref: string,\n nextUrl: string | null\n): RouteCacheKey {\n const originalUrl = new URL(originalHref)\n\n // TODO: As of now, we never include search params in the cache key because\n // per-segment prefetch requests are always static, and cannot contain search\n // params. But to support , we will sometimes populate\n // the cache with dynamic data, so this will have to change.\n originalUrl.search = ''\n\n const normalizedHref = originalUrl.href as NormalizedHref\n const normalizedNextUrl = nextUrl as NormalizedNextUrl | null\n\n const cacheKey = {\n href: normalizedHref,\n nextUrl: normalizedNextUrl,\n } as RouteCacheKey\n\n return cacheKey\n}\n","import type {\n TreePrefetch,\n RootTreePrefetch,\n SegmentPrefetch,\n} from '../../../server/app-render/collect-segment-data'\nimport type { LoadingModuleData } from '../../../shared/lib/app-router-context.shared-runtime'\nimport {\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n NEXT_URL,\n RSC_CONTENT_TYPE_HEADER,\n RSC_HEADER,\n} from '../app-router-headers'\nimport {\n createFetch,\n createFromNextReadableStream,\n urlToUrlWithoutFlightMarker,\n type RequestHeaders,\n} from '../router-reducer/fetch-server-response'\nimport {\n trackPrefetchRequestBandwidth,\n pingPrefetchTask,\n type PrefetchTask,\n spawnPrefetchSubtask,\n} from './scheduler'\nimport { getAppBuildId } from '../../app-build-id'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport type {\n NormalizedHref,\n NormalizedNextUrl,\n RouteCacheKey,\n} from './cache-key'\nimport { createTupleMap, type TupleMap, type Prefix } from './tuple-map'\nimport { createLRU, type LRU } from './lru'\n\n// A note on async/await when working in the prefetch cache:\n//\n// Most async operations in the prefetch cache should *not* use async/await,\n// Instead, spawn a subtask that writes the results to a cache entry, and attach\n// a \"ping\" listener to notify the prefetch queue to try again.\n//\n// The reason is we need to be able to access the segment cache and traverse its\n// data structures synchronously. For example, if there's a synchronous update\n// we can take an immediate snapshot of the cache to produce something we can\n// render. Limiting the use of async/await also makes it easier to avoid race\n// conditions, which is especially important because is cache is mutable.\n//\n// Another reason is that while we're performing async work, it's possible for\n// existing entries to become stale, or for Link prefetches to be removed from\n// the queue. For optimal scheduling, we need to be able to \"cancel\" subtasks\n// that are no longer needed. So, when a segment is received from the server, we\n// restart from the root of the tree that's being prefetched, to confirm all the\n// parent segments are still cached. If the segment is no longer reachable from\n// the root, then it's effectively canceled. This is similar to the design of\n// Rust Futures, or React Suspense.\n\ntype RouteCacheEntryShared = {\n staleAt: number\n // This is false only if we're certain the route cannot be intercepted. It's\n // true in all other cases, including on initialization when we haven't yet\n // received a response from the server.\n couldBeIntercepted: boolean\n\n // LRU-related fields\n keypath: null | Prefix\n next: null | RouteCacheEntry\n prev: null | RouteCacheEntry\n size: number\n}\n\nexport const enum EntryStatus {\n Pending,\n Rejected,\n Fulfilled,\n}\n\ntype PendingRouteCacheEntry = RouteCacheEntryShared & {\n status: EntryStatus.Pending\n blockedTasks: Set | null\n canonicalUrl: null\n tree: null\n head: null\n isHeadPartial: true\n}\n\ntype RejectedRouteCacheEntry = RouteCacheEntryShared & {\n status: EntryStatus.Rejected\n blockedTasks: Set | null\n canonicalUrl: null\n tree: null\n head: null\n isHeadPartial: true\n}\n\nexport type FulfilledRouteCacheEntry = RouteCacheEntryShared & {\n status: EntryStatus.Fulfilled\n blockedTasks: null\n canonicalUrl: string\n tree: TreePrefetch\n head: React.ReactNode | null\n isHeadPartial: boolean\n}\n\nexport type RouteCacheEntry =\n | PendingRouteCacheEntry\n | FulfilledRouteCacheEntry\n | RejectedRouteCacheEntry\n\ntype SegmentCacheEntryShared = {\n staleAt: number\n\n // LRU-related fields\n key: null | string\n next: null | RouteCacheEntry\n prev: null | RouteCacheEntry\n size: number\n}\n\ntype PendingSegmentCacheEntry = SegmentCacheEntryShared & {\n status: EntryStatus.Pending\n rsc: null\n loading: null\n isPartial: true\n promise: null | PromiseWithResolvers\n}\n\ntype RejectedSegmentCacheEntry = SegmentCacheEntryShared & {\n status: EntryStatus.Rejected\n rsc: null\n loading: null\n isPartial: true\n promise: null\n}\n\ntype FulfilledSegmentCacheEntry = SegmentCacheEntryShared & {\n status: EntryStatus.Fulfilled\n rsc: React.ReactNode | null\n loading: LoadingModuleData | Promise\n isPartial: boolean\n promise: null\n}\n\nexport type SegmentCacheEntry =\n | PendingSegmentCacheEntry\n | RejectedSegmentCacheEntry\n | FulfilledSegmentCacheEntry\n\n// Route cache entries vary on multiple keys: the href and the Next-Url. Each of\n// these parts needs to be included in the internal cache key. Rather than\n// concatenate the keys into a single key, we use a multi-level map, where the\n// first level is keyed by href, the second level is keyed by Next-Url, and so\n// on (if were to add more levels).\ntype RouteCacheKeypath = [NormalizedHref, NormalizedNextUrl]\nconst routeCacheMap: TupleMap =\n createTupleMap()\n\n// We use an LRU for memory management. We must update this whenever we add or\n// remove a new cache entry, or when an entry changes size.\n// TODO: I chose the max size somewhat arbitrarily. Consider setting this based\n// on navigator.deviceMemory, or some other heuristic. We should make this\n// customizable via the Next.js config, too.\nconst maxRouteLruSize = 10 * 1024 * 1024 // 10 MB\nconst routeCacheLru = createLRU(\n maxRouteLruSize,\n onRouteLRUEviction\n)\n\n// TODO: We may eventually store segment entries in a tuple map, too, to\n// account for search params.\nconst segmentCacheMap = new Map()\n// NOTE: Segments and Route entries are managed by separate LRUs. We could\n// combine them into a single LRU, but because they are separate types, we'd\n// need to wrap each one in an extra LRU node (to maintain monomorphism, at the\n// cost of additional memory).\nconst maxSegmentLruSize = 50 * 1024 * 1024 // 50 MB\nconst segmentCacheLru = createLRU(\n maxSegmentLruSize,\n onSegmentLRUEviction\n)\n\nexport function readExactRouteCacheEntry(\n now: number,\n href: NormalizedHref,\n nextUrl: NormalizedNextUrl | null\n): RouteCacheEntry | null {\n const keypath: Prefix =\n nextUrl === null ? [href] : [href, nextUrl]\n const existingEntry = routeCacheMap.get(keypath)\n if (existingEntry !== null) {\n // Check if the entry is stale\n if (existingEntry.staleAt > now) {\n // Reuse the existing entry.\n\n // Since this is an access, move the entry to the front of the LRU.\n routeCacheLru.put(existingEntry)\n\n return existingEntry\n } else {\n // Evict the stale entry from the cache.\n deleteRouteFromCache(existingEntry, keypath)\n }\n }\n return null\n}\n\nexport function readRouteCacheEntry(\n now: number,\n key: RouteCacheKey\n): RouteCacheEntry | null {\n // First check if there's a non-intercepted entry. Most routes cannot be\n // intercepted, so this is the common case.\n const nonInterceptedEntry = readExactRouteCacheEntry(now, key.href, null)\n if (nonInterceptedEntry !== null && !nonInterceptedEntry.couldBeIntercepted) {\n // Found a match, and the route cannot be intercepted. We can reuse it.\n return nonInterceptedEntry\n }\n // There was no match. Check again but include the Next-Url this time.\n return readExactRouteCacheEntry(now, key.href, key.nextUrl)\n}\n\nexport function readSegmentCacheEntry(\n now: number,\n path: string\n): SegmentCacheEntry | null {\n const existingEntry = segmentCacheMap.get(path)\n if (existingEntry !== undefined) {\n // Check if the entry is stale\n if (existingEntry.staleAt > now) {\n // Reuse the existing entry.\n\n // Since this is an access, move the entry to the front of the LRU.\n segmentCacheLru.put(existingEntry)\n\n return existingEntry\n } else {\n // Evict the stale entry from the cache.\n deleteSegmentFromCache(existingEntry, path)\n }\n }\n return null\n}\n\nexport function waitForSegmentCacheEntry(\n pendingEntry: PendingSegmentCacheEntry\n): Promise {\n // Because the entry is pending, there's already a in-progress request.\n // Attach a promise to the entry that will resolve when the server responds.\n let promiseWithResolvers = pendingEntry.promise\n if (promiseWithResolvers === null) {\n promiseWithResolvers = pendingEntry.promise =\n createPromiseWithResolvers()\n } else {\n // There's already a promise we can use\n }\n return promiseWithResolvers.promise\n}\n\n/**\n * Reads the route cache for a matching entry *and* spawns a request if there's\n * no match. Because this may issue a network request, it should only be called\n * from within the context of a prefetch task.\n */\nexport function requestRouteCacheEntryFromCache(\n now: number,\n task: PrefetchTask\n): RouteCacheEntry {\n const key = task.key\n // First check if there's a non-intercepted entry. Most routes cannot be\n // intercepted, so this is the common case.\n const nonInterceptedEntry = readExactRouteCacheEntry(now, key.href, null)\n if (nonInterceptedEntry !== null && !nonInterceptedEntry.couldBeIntercepted) {\n // Found a match, and the route cannot be intercepted. We can reuse it.\n return nonInterceptedEntry\n }\n // There was no match. Check again but include the Next-Url this time.\n const exactEntry = readExactRouteCacheEntry(now, key.href, key.nextUrl)\n if (exactEntry !== null) {\n return exactEntry\n }\n // Create a pending entry and spawn a request for its data.\n const pendingEntry: PendingRouteCacheEntry = {\n canonicalUrl: null,\n status: EntryStatus.Pending,\n blockedTasks: null,\n tree: null,\n head: null,\n isHeadPartial: true,\n // If the request takes longer than a minute, a subsequent request should\n // retry instead of waiting for this one.\n //\n // When the response is received, this value will be replaced by a new value\n // based on the stale time sent from the server.\n staleAt: now + 60 * 1000,\n // This is initialized to true because we don't know yet whether the route\n // could be intercepted. It's only set to false once we receive a response\n // from the server.\n couldBeIntercepted: true,\n\n // LRU-related fields\n keypath: null,\n next: null,\n prev: null,\n size: 0,\n }\n spawnPrefetchSubtask(fetchRouteOnCacheMiss(pendingEntry, task))\n const keypath: Prefix =\n key.nextUrl === null ? [key.href] : [key.href, key.nextUrl]\n routeCacheMap.set(keypath, pendingEntry)\n // Stash the keypath on the entry so we know how to remove it from the map\n // if it gets evicted from the LRU.\n pendingEntry.keypath = keypath\n routeCacheLru.put(pendingEntry)\n return pendingEntry\n}\n\n/**\n * Reads the route cache for a matching entry *and* spawns a request if there's\n * no match. Because this may issue a network request, it should only be called\n * from within the context of a prefetch task.\n */\nexport function requestSegmentEntryFromCache(\n now: number,\n task: PrefetchTask,\n route: FulfilledRouteCacheEntry,\n path: string,\n accessToken: string\n): SegmentCacheEntry {\n const existingEntry = readSegmentCacheEntry(now, path)\n if (existingEntry !== null) {\n return existingEntry\n }\n // Create a pending entry and spawn a request for its data.\n const pendingEntry: PendingSegmentCacheEntry = {\n status: EntryStatus.Pending,\n rsc: null,\n loading: null,\n staleAt: route.staleAt,\n isPartial: true,\n promise: null,\n\n // LRU-related fields\n key: null,\n next: null,\n prev: null,\n size: 0,\n }\n spawnPrefetchSubtask(\n fetchSegmentEntryOnCacheMiss(\n route,\n pendingEntry,\n task.key,\n path,\n accessToken\n )\n )\n segmentCacheMap.set(path, pendingEntry)\n // Stash the keypath on the entry so we know how to remove it from the map\n // if it gets evicted from the LRU.\n pendingEntry.key = path\n segmentCacheLru.put(pendingEntry)\n return pendingEntry\n}\n\nfunction deleteRouteFromCache(\n entry: RouteCacheEntry,\n keypath: Prefix\n): void {\n pingBlockedTasks(entry)\n routeCacheMap.delete(keypath)\n routeCacheLru.delete(entry)\n}\n\nfunction deleteSegmentFromCache(entry: SegmentCacheEntry, key: string): void {\n cancelEntryListeners(entry)\n segmentCacheMap.delete(key)\n segmentCacheLru.delete(entry)\n}\n\nfunction onRouteLRUEviction(entry: RouteCacheEntry): void {\n // The LRU evicted this entry. Remove it from the map.\n const keypath = entry.keypath\n if (keypath !== null) {\n entry.keypath = null\n pingBlockedTasks(entry)\n routeCacheMap.delete(keypath)\n }\n}\n\nfunction onSegmentLRUEviction(entry: SegmentCacheEntry): void {\n // The LRU evicted this entry. Remove it from the map.\n const key = entry.key\n if (key !== null) {\n entry.key = null\n cancelEntryListeners(entry)\n segmentCacheMap.delete(key)\n }\n}\n\nfunction cancelEntryListeners(entry: SegmentCacheEntry): void {\n if (entry.status === EntryStatus.Pending && entry.promise !== null) {\n // There were listeners for this entry. Resolve them with `null` to indicate\n // that the prefetch failed. It's up to the listener to decide how to handle\n // this case.\n // NOTE: We don't currently propagate the reason the prefetch was canceled\n // but we could by accepting a `reason` argument.\n entry.promise.resolve(null)\n entry.promise = null\n }\n}\n\nfunction pingBlockedTasks(entry: {\n blockedTasks: Set | null\n}): void {\n const blockedTasks = entry.blockedTasks\n if (blockedTasks !== null) {\n for (const task of blockedTasks) {\n pingPrefetchTask(task)\n }\n entry.blockedTasks = null\n }\n}\n\nfunction fulfillRouteCacheEntry(\n entry: PendingRouteCacheEntry,\n tree: TreePrefetch,\n head: React.ReactNode,\n isHeadPartial: boolean,\n staleAt: number,\n couldBeIntercepted: boolean,\n canonicalUrl: string\n): FulfilledRouteCacheEntry {\n const fulfilledEntry: FulfilledRouteCacheEntry = entry as any\n fulfilledEntry.status = EntryStatus.Fulfilled\n fulfilledEntry.tree = tree\n fulfilledEntry.head = head\n fulfilledEntry.isHeadPartial = isHeadPartial\n fulfilledEntry.staleAt = staleAt\n fulfilledEntry.couldBeIntercepted = couldBeIntercepted\n fulfilledEntry.canonicalUrl = canonicalUrl\n pingBlockedTasks(entry)\n return fulfilledEntry\n}\n\nfunction fulfillSegmentCacheEntry(\n segmentCacheEntry: PendingSegmentCacheEntry,\n rsc: React.ReactNode,\n loading: LoadingModuleData | Promise,\n staleAt: number,\n isPartial: boolean\n) {\n const fulfilledEntry: FulfilledSegmentCacheEntry = segmentCacheEntry as any\n fulfilledEntry.status = EntryStatus.Fulfilled\n fulfilledEntry.rsc = rsc\n fulfilledEntry.loading = loading\n fulfilledEntry.staleAt = staleAt\n fulfilledEntry.isPartial = isPartial\n // Resolve any listeners that were waiting for this data.\n if (segmentCacheEntry.promise !== null) {\n segmentCacheEntry.promise.resolve(fulfilledEntry)\n // Free the promise for garbage collection.\n fulfilledEntry.promise = null\n }\n}\n\nfunction rejectRouteCacheEntry(\n entry: PendingRouteCacheEntry,\n staleAt: number\n): void {\n const rejectedEntry: RejectedRouteCacheEntry = entry as any\n rejectedEntry.status = EntryStatus.Rejected\n rejectedEntry.staleAt = staleAt\n pingBlockedTasks(entry)\n}\n\nfunction rejectSegmentCacheEntry(\n entry: PendingSegmentCacheEntry,\n staleAt: number\n): void {\n const rejectedEntry: RejectedSegmentCacheEntry = entry as any\n rejectedEntry.status = EntryStatus.Rejected\n rejectedEntry.staleAt = staleAt\n if (entry.promise !== null) {\n // NOTE: We don't currently propagate the reason the prefetch was canceled\n // but we could by accepting a `reason` argument.\n entry.promise.resolve(null)\n entry.promise = null\n }\n}\n\nasync function fetchRouteOnCacheMiss(\n entry: PendingRouteCacheEntry,\n task: PrefetchTask\n): Promise {\n // This function is allowed to use async/await because it contains the actual\n // fetch that gets issued on a cache miss. Notice though that it does not\n // return anything; it writes the result to the cache entry directly, then\n // pings the scheduler to unblock the corresponding prefetch task.\n const key = task.key\n const href = key.href\n const nextUrl = key.nextUrl\n try {\n const response = await fetchSegmentPrefetchResponse(href, '/_tree', nextUrl)\n if (\n !response ||\n !response.ok ||\n // 204 is a Cache miss. Though theoretically this shouldn't happen when\n // PPR is enabled, because we always respond to route tree requests, even\n // if it needs to be blockingly generated on demand.\n response.status === 204 ||\n !response.body\n ) {\n // Server responded with an error, or with a miss. We should still cache\n // the response, but we can try again after 10 seconds.\n rejectRouteCacheEntry(entry, Date.now() + 10 * 1000)\n return\n }\n const prefetchStream = createPrefetchResponseStream(\n response.body,\n routeCacheLru,\n entry\n )\n const serverData: RootTreePrefetch = await (createFromNextReadableStream(\n prefetchStream\n ) as Promise)\n if (serverData.buildId !== getAppBuildId()) {\n // The server build does not match the client. Treat as a 404. During\n // an actual navigation, the router will trigger an MPA navigation.\n // TODO: Consider moving the build ID to a response header so we can check\n // it before decoding the response, and so there's one way of checking\n // across all response types.\n rejectRouteCacheEntry(entry, Date.now() + 10 * 1000)\n return\n }\n\n // This is a bit convoluted but it's taken from router-reducer and\n // fetch-server-response\n const canonicalUrl = response.redirected\n ? createHrefFromUrl(urlToUrlWithoutFlightMarker(response.url))\n : href\n\n // Check whether the response varies based on the Next-Url header.\n const varyHeader = response.headers.get('vary')\n const couldBeIntercepted =\n varyHeader !== null && varyHeader.includes(NEXT_URL)\n\n fulfillRouteCacheEntry(\n entry,\n serverData.tree,\n serverData.head,\n serverData.isHeadPartial,\n Date.now() + serverData.staleTime,\n couldBeIntercepted,\n canonicalUrl\n )\n\n if (!couldBeIntercepted && nextUrl !== null) {\n // This route will never be intercepted. So we can use this entry for all\n // requests to this route, regardless of the Next-Url header. This works\n // because when reading the cache we always check for a valid\n // non-intercepted entry first.\n //\n // Re-key the entry. Since we're in an async task, we must first confirm\n // that the entry hasn't been concurrently modified by a different task.\n const currentKeypath: Prefix = [href, nextUrl]\n const expectedEntry = routeCacheMap.get(currentKeypath)\n if (expectedEntry === entry) {\n routeCacheMap.delete(currentKeypath)\n const newKeypath: Prefix = [href]\n routeCacheMap.set(newKeypath, entry)\n // We don't need to update the LRU because the entry is already in it.\n // But since we changed the keypath, we do need to update that, so we\n // know how to remove it from the map if it gets evicted from the LRU.\n entry.keypath = newKeypath\n } else {\n // Something else modified this entry already. Since the re-keying is\n // just a performance optimization, we can safely skip it.\n }\n }\n } catch (error) {\n // Either the connection itself failed, or something bad happened while\n // decoding the response.\n rejectRouteCacheEntry(entry, Date.now() + 10 * 1000)\n }\n}\n\nasync function fetchSegmentEntryOnCacheMiss(\n route: FulfilledRouteCacheEntry,\n segmentCacheEntry: PendingSegmentCacheEntry,\n routeKey: RouteCacheKey,\n segmentPath: string,\n accessToken: string | null\n): Promise {\n // This function is allowed to use async/await because it contains the actual\n // fetch that gets issued on a cache miss. Notice though that it does not\n // return anything; it writes the result to the cache entry directly.\n //\n // Segment fetches are non-blocking so we don't need to ping the scheduler\n // on completion.\n const href = routeKey.href\n try {\n const response = await fetchSegmentPrefetchResponse(\n href,\n accessToken === '' ? segmentPath : `${segmentPath}.${accessToken}`,\n routeKey.nextUrl\n )\n if (\n !response ||\n !response.ok ||\n response.status === 204 || // Cache miss\n !response.body\n ) {\n // Server responded with an error, or with a miss. We should still cache\n // the response, but we can try again after 10 seconds.\n rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000)\n return\n }\n // Wrap the original stream in a new stream that never closes. That way the\n // Flight client doesn't error if there's a hanging promise.\n const prefetchStream = createPrefetchResponseStream(\n response.body,\n segmentCacheLru,\n segmentCacheEntry\n )\n const serverData = await (createFromNextReadableStream(\n prefetchStream\n ) as Promise)\n if (serverData.buildId !== getAppBuildId()) {\n // The server build does not match the client. Treat as a 404. During\n // an actual navigation, the router will trigger an MPA navigation.\n // TODO: Consider moving the build ID to a response header so we can check\n // it before decoding the response, and so there's one way of checking\n // across all response types.\n rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000)\n return\n }\n fulfillSegmentCacheEntry(\n segmentCacheEntry,\n serverData.rsc,\n serverData.loading,\n // TODO: The server does not currently provide per-segment stale time.\n // So we use the stale time of the route.\n route.staleAt,\n serverData.isPartial\n )\n } catch (error) {\n // Either the connection itself failed, or something bad happened while\n // decoding the response.\n rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000)\n }\n}\n\nasync function fetchSegmentPrefetchResponse(\n href: NormalizedHref,\n segmentPath: string,\n nextUrl: NormalizedNextUrl | null\n): Promise {\n const headers: RequestHeaders = {\n [RSC_HEADER]: '1',\n [NEXT_ROUTER_PREFETCH_HEADER]: '1',\n [NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]: segmentPath,\n }\n if (nextUrl !== null) {\n headers[NEXT_URL] = nextUrl\n }\n const fetchPriority = 'low'\n const responsePromise = createFetch(new URL(href), headers, fetchPriority)\n trackPrefetchRequestBandwidth(responsePromise)\n const response = await responsePromise\n const contentType = response.headers.get('content-type')\n const isFlightResponse =\n contentType && contentType.startsWith(RSC_CONTENT_TYPE_HEADER)\n if (!response.ok || !isFlightResponse) {\n return null\n }\n return response\n}\n\nfunction createPrefetchResponseStream<\n T extends RouteCacheEntry | SegmentCacheEntry,\n>(\n originalFlightStream: ReadableStream,\n lru: LRU,\n lruEntry: T\n): ReadableStream {\n // When PPR is enabled, prefetch streams may contain references that never\n // resolve, because that's how we encode dynamic data access. In the decoded\n // object returned by the Flight client, these are reified into hanging\n // promises that suspend during render, which is effectively what we want.\n // The UI resolves when it switches to the dynamic data stream\n // (via useDeferredValue(dynamic, static)).\n //\n // However, the Flight implementation currently errors if the server closes\n // the response before all the references are resolved. As a cheat to work\n // around this, we wrap the original stream in a new stream that never closes,\n // and therefore doesn't error.\n //\n // While processing the original stream, we also incrementally update the size\n // of the cache entry in the LRU.\n let totalByteLength = 0\n const reader = originalFlightStream.getReader()\n return new ReadableStream({\n async pull(controller) {\n while (true) {\n const { done, value } = await reader.read()\n if (!done) {\n // Pass to the target stream and keep consuming the Flight response\n // from the server.\n controller.enqueue(value)\n\n // Incrementally update the size of the cache entry in the LRU.\n // NOTE: Since prefetch responses are delivered in a single chunk,\n // it's not really necessary to do this streamingly, but I'm doing it\n // anyway in case this changes in the future.\n totalByteLength += value.byteLength\n lru.updateSize(lruEntry, totalByteLength)\n\n continue\n }\n // The server stream has closed. Exit, but intentionally do not close\n // the target stream.\n return\n }\n },\n })\n}\n\nfunction createPromiseWithResolvers(): PromiseWithResolvers {\n // Shim of Stage 4 Promise.withResolvers proposal\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason: any) => void\n const promise = new Promise((res, rej) => {\n resolve = res\n reject = rej\n })\n return { resolve: resolve!, reject: reject!, promise }\n}\n","export type LRU = {\n put(node: T): void\n delete(node: T): void\n updateSize(node: T, size: number): void\n}\n\n// Doubly-linked list\ntype LRUNode = {\n // Although it's not encoded in the type, these are both null if the node is\n // not in the LRU; both non-null if it is.\n prev: T | null\n next: T | null\n size: number\n}\n\n// Rather than create an internal LRU node, the passed-in type must conform\n// the LRUNode interface. This is just a memory optimization to avoid creating\n// another object; we only use this for Segment Cache entries so it doesn't need\n// to be general purpose.\nexport function createLRU(\n // From the LRU's perspective, the size unit is arbitrary, but for our\n // purposes this is the byte size.\n maxLruSize: number,\n onEviction: (node: T) => void\n): LRU {\n let head: T | null = null\n let didScheduleCleanup: boolean = false\n let lruSize: number = 0\n\n function put(node: T) {\n if (head === node) {\n // Already at the head\n return\n }\n const prev = node.prev\n const next = node.next\n if (next === null || prev === null) {\n // This is an insertion\n lruSize += node.size\n // Whenever we add an entry, we need to check if we've exceeded the\n // max size. We don't evict entries immediately; they're evicted later in\n // an asynchronous task.\n ensureCleanupIsScheduled()\n } else {\n // This is a move. Remove from its current position.\n prev.next = next\n next.prev = prev\n }\n\n // Move to the front of the list\n if (head === null) {\n // This is the first entry\n node.prev = node\n node.next = node\n } else {\n // Add to the front of the list\n const tail = head.prev\n node.prev = tail\n tail.next = node\n node.next = head\n head.prev = node\n }\n head = node\n }\n\n function updateSize(node: T, newNodeSize: number) {\n // This is a separate function so that we can resize the entry after it's\n // already been inserted.\n if (node.next === null) {\n // No longer part of LRU.\n return\n }\n const prevNodeSize = node.size\n node.size = newNodeSize\n lruSize = lruSize - prevNodeSize + newNodeSize\n ensureCleanupIsScheduled()\n }\n\n function deleteNode(deleted: T) {\n const next = deleted.next\n const prev = deleted.prev\n if (next !== null && prev !== null) {\n lruSize -= deleted.size\n\n deleted.next = null\n deleted.prev = null\n\n // Remove from the list\n if (head === deleted) {\n // Update the head\n if (next === head) {\n // This was the last entry\n head = null\n } else {\n head = next\n }\n } else {\n prev.next = next\n next.prev = prev\n }\n } else {\n // Already deleted\n }\n }\n\n function ensureCleanupIsScheduled() {\n if (didScheduleCleanup || lruSize <= maxLruSize) {\n return\n }\n didScheduleCleanup = true\n requestCleanupCallback(cleanup)\n }\n\n function cleanup() {\n didScheduleCleanup = false\n\n // Evict entries until we're at 90% capacity. We can assume this won't\n // infinite loop because even if `maxLruSize` were 0, eventually\n // `deleteNode` sets `head` to `null` when we run out entries.\n const ninetyPercentMax = maxLruSize * 0.9\n while (lruSize > ninetyPercentMax && head !== null) {\n const tail = head.prev\n deleteNode(tail)\n onEviction(tail)\n }\n }\n\n return {\n put,\n delete: deleteNode,\n updateSize,\n }\n}\n\nconst requestCleanupCallback =\n typeof requestIdleCallback === 'function'\n ? requestIdleCallback\n : (cb: () => void) => setTimeout(cb, 0)\n","import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../server/app-render/types'\nimport type {\n CacheNode,\n LoadingModuleData,\n} from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n updateCacheNodeOnNavigation,\n listenForDynamicRequest,\n type Task as PPRNavigationTask,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl as createCanonicalUrl } from '../router-reducer/create-href-from-url'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n readSegmentCacheEntry,\n waitForSegmentCacheEntry,\n} from './cache'\nimport type { TreePrefetch } from '../../../server/app-render/collect-segment-data'\nimport { createCacheKey } from './cache-key'\n\nexport const enum NavigationResultTag {\n MPA,\n Success,\n NoOp,\n Async,\n}\n\ntype MPANavigationResult = {\n tag: NavigationResultTag.MPA\n data: string\n}\n\ntype NoOpNavigationResult = {\n tag: NavigationResultTag.NoOp\n data: null\n}\n\ntype SuccessfulNavigationResult = {\n tag: NavigationResultTag.Success\n data: {\n flightRouterState: FlightRouterState\n cacheNode: CacheNode\n canonicalUrl: string\n }\n}\n\ntype AsyncNavigationResult = {\n tag: NavigationResultTag.Async\n data: Promise<\n MPANavigationResult | NoOpNavigationResult | SuccessfulNavigationResult\n >\n}\n\nexport type NavigationResult =\n | MPANavigationResult\n | SuccessfulNavigationResult\n | NoOpNavigationResult\n | AsyncNavigationResult\n\nconst noOpNavigationResult: NoOpNavigationResult = {\n tag: NavigationResultTag.NoOp,\n data: null,\n}\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n url: URL,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null\n): AsyncNavigationResult | SuccessfulNavigationResult | NoOpNavigationResult {\n const now = Date.now()\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n const snapshot = readRenderSnapshotFromCache(now, route.tree)\n const prefetchFlightRouterState = snapshot.flightRouterState\n const prefetchSeedData = snapshot.seedData\n const prefetchHead = route.head\n const isPrefetchHeadPartial = route.isHeadPartial\n const canonicalUrl = route.canonicalUrl\n return navigateUsingPrefetchedRouteTree(\n url,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n canonicalUrl\n )\n }\n // There's no matching prefetch for this route in the cache.\n return {\n tag: NavigationResultTag.Async,\n data: navigateDynamicallyWithNoPrefetch(\n url,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState\n ),\n }\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n url: URL,\n nextUrl: string | null,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n prefetchFlightRouterState: FlightRouterState,\n prefetchSeedData: CacheNodeSeedData | null,\n prefetchHead: React.ReactNode | null,\n isPrefetchHeadPartial: boolean,\n canonicalUrl: string\n): SuccessfulNavigationResult | NoOpNavigationResult {\n // Recursively construct a prefetch tree by reading from the Segment Cache. To\n // maintain compatibility, we output the same data structures as the old\n // prefetching implementation: FlightRouterState and CacheNodeSeedData.\n // TODO: Eventually updateCacheNodeOnNavigation (or the equivalent) should\n // read from the Segment Cache directly. It's only structured this way for now\n // so we can share code with the old prefetching implementation.\n const task = updateCacheNodeOnNavigation(\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial\n )\n if (task !== null) {\n if (task.needsDynamicRequest) {\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: currentFlightRouterState,\n nextUrl,\n })\n listenForDynamicRequest(task, promiseForDynamicServerResponse)\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We can skip the dynamic request.\n }\n return navigationTaskToResult(task, currentCacheNode, canonicalUrl)\n }\n // The server sent back an empty tree patch. There's nothing to update.\n return noOpNavigationResult\n}\n\nfunction navigationTaskToResult(\n task: PPRNavigationTask,\n currentCacheNode: CacheNode,\n canonicalUrl: string\n): SuccessfulNavigationResult {\n const newCacheNode = task.node\n return {\n tag: NavigationResultTag.Success,\n data: {\n flightRouterState: task.route,\n cacheNode: newCacheNode !== null ? newCacheNode : currentCacheNode,\n canonicalUrl,\n },\n }\n}\n\nfunction readRenderSnapshotFromCache(\n now: number,\n tree: TreePrefetch\n): { flightRouterState: FlightRouterState; seedData: CacheNodeSeedData } {\n let childRouterStates: { [parallelRouteKey: string]: FlightRouterState } = {}\n let childSeedDatas: {\n [parallelRouteKey: string]: CacheNodeSeedData | null\n } = {}\n const slots = tree.slots\n if (slots !== null) {\n for (const parallelRouteKey in slots) {\n const childTree = slots[parallelRouteKey]\n const childResult = readRenderSnapshotFromCache(now, childTree)\n childRouterStates[parallelRouteKey] = childResult.flightRouterState\n childSeedDatas[parallelRouteKey] = childResult.seedData\n }\n }\n\n let rsc: React.ReactNode | null = null\n let loading: LoadingModuleData | Promise = null\n let isPartial: boolean = true\n\n const segmentEntry = readSegmentCacheEntry(now, tree.path)\n if (segmentEntry !== null) {\n switch (segmentEntry.status) {\n case EntryStatus.Fulfilled: {\n // Happy path: a cache hit\n rsc = segmentEntry.rsc\n loading = segmentEntry.loading\n isPartial = segmentEntry.isPartial\n break\n }\n case EntryStatus.Pending: {\n // We haven't received data for this segment yet, but there's already\n // an in-progress request. Since it's extremely likely to arrive\n // before the dynamic data response, we might as well use it.\n const promiseForFulfilledEntry = waitForSegmentCacheEntry(segmentEntry)\n rsc = promiseForFulfilledEntry.then((entry) =>\n entry !== null ? entry.rsc : null\n )\n loading = promiseForFulfilledEntry.then((entry) =>\n entry !== null ? entry.loading : null\n )\n // Since we don't know yet whether the segment is partial or fully\n // static, we must assume it's partial; we can't skip the\n // dynamic request.\n isPartial = true\n break\n }\n case EntryStatus.Rejected:\n break\n default: {\n const _exhaustiveCheck: never = segmentEntry\n break\n }\n }\n }\n\n const extra = tree.extra\n const flightRouterStateSegment = extra[0]\n const isRootLayout = extra[1]\n\n return {\n flightRouterState: [\n flightRouterStateSegment,\n childRouterStates,\n null,\n null,\n isRootLayout,\n ],\n seedData: [\n flightRouterStateSegment,\n rsc,\n childSeedDatas,\n loading,\n isPartial,\n ],\n }\n}\n\nasync function navigateDynamicallyWithNoPrefetch(\n url: URL,\n nextUrl: string | null,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState\n): Promise<\n MPANavigationResult | SuccessfulNavigationResult | NoOpNavigationResult\n> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: currentFlightRouterState,\n nextUrl,\n })\n const { flightData, canonicalUrl: canonicalUrlOverride } =\n await promiseForDynamicServerResponse\n\n // TODO: Detect if the only thing that changed was the hash, like we do in\n // in navigateReducer\n\n if (typeof flightData === 'string') {\n // This is an MPA navigation.\n const newUrl = flightData\n return {\n tag: NavigationResultTag.MPA,\n data: newUrl,\n }\n }\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const prefetchFlightRouterState = simulatePrefetchTreeUsingDynamicTreePatch(\n currentFlightRouterState,\n flightData\n )\n\n // In our simulated prefetch payload, we pretend that there's no seed data\n // nor a prefetch head.\n const prefetchSeedData = null\n const prefetchHead = null\n const isPrefetchHeadPartial = true\n\n const canonicalUrl = createCanonicalUrl(\n canonicalUrlOverride ? canonicalUrlOverride : url\n )\n\n // Now we proceed exactly as we would for normal navigation.\n const task = updateCacheNodeOnNavigation(\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial\n )\n if (task !== null) {\n if (task.needsDynamicRequest) {\n listenForDynamicRequest(task, promiseForDynamicServerResponse)\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We can skip the dynamic request.\n }\n return navigationTaskToResult(task, currentCacheNode, canonicalUrl)\n }\n // The server sent back an empty tree patch. There's nothing to update.\n return noOpNavigationResult\n}\n\nfunction simulatePrefetchTreeUsingDynamicTreePatch(\n currentTree: FlightRouterState,\n flightData: Array\n): FlightRouterState {\n // Takes the current FlightRouterState and applies the router state patch\n // received from the server, to create a full FlightRouterState tree that we\n // can pretend was returned by a prefetch.\n //\n // (It sounds similar to what applyRouterStatePatch does, but it doesn't need\n // to handle stuff like interception routes or diffing since that will be\n // handled later.)\n let baseTree = currentTree\n for (const { segmentPath, tree: treePatch } of flightData) {\n // If the server sends us multiple tree patches, we only need to clone the\n // base tree when applying the first patch. After the first patch, we can\n // apply the remaining patches in place without copying.\n const canMutateInPlace = baseTree !== currentTree\n baseTree = simulatePrefetchTreeUsingDynamicTreePatchImpl(\n baseTree,\n treePatch,\n segmentPath,\n canMutateInPlace,\n 0\n )\n }\n\n return baseTree\n}\n\nfunction simulatePrefetchTreeUsingDynamicTreePatchImpl(\n baseRouterState: FlightRouterState,\n patch: FlightRouterState,\n segmentPath: FlightSegmentPath,\n canMutateInPlace: boolean,\n index: number\n) {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return patch\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: In the case of a fully dynamic request with no prefetch, we receive\n // the FlightRouterState patch in the same request as the dynamic data.\n // Therefore we don't need to worry about diffing the segment values; we can\n // assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseChildren = baseRouterState[1]\n const newChildren: { [parallelRouteKey: string]: FlightRouterState } = {}\n for (const parallelRouteKey in baseChildren) {\n if (parallelRouteKey === updatedParallelRouteKey) {\n const childBaseRouterState = baseChildren[parallelRouteKey]\n newChildren[parallelRouteKey] =\n simulatePrefetchTreeUsingDynamicTreePatchImpl(\n childBaseRouterState,\n patch,\n segmentPath,\n canMutateInPlace,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n } else {\n // This child is not being patched. Copy it over as-is.\n newChildren[parallelRouteKey] = baseChildren[parallelRouteKey]\n }\n }\n\n if (canMutateInPlace) {\n // We can mutate the base tree in place, because the base tree is already\n // a clone.\n baseRouterState[1] = newChildren\n return baseRouterState\n }\n\n // Clone all the fields except the children.\n //\n // Based on equivalent logic in apply-router-state-patch-to-tree, but should\n // confirm whether we need to copy all of these fields. Not sure the server\n // ever sends, e.g. the refetch marker.\n const clone: FlightRouterState = [baseRouterState[0], newChildren]\n if (2 in baseRouterState) {\n clone[2] = baseRouterState[2]\n }\n if (3 in baseRouterState) {\n clone[3] = baseRouterState[3]\n }\n if (4 in baseRouterState) {\n clone[4] = baseRouterState[4]\n }\n return clone\n}\n","import { createPrefetchURL } from '../../components/app-router'\nimport { createCacheKey } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\n\n/**\n * Entrypoint for prefetching a URL into the Segment Cache.\n * @param href - The URL to prefetch. Typically this will come from a ,\n * or router.prefetch. It must be validated before we attempt to prefetch it.\n */\nexport function prefetch(href: string, nextUrl: string | null) {\n const url = createPrefetchURL(href)\n if (url === null) {\n // This href should not be prefetched.\n return\n }\n const cacheKey = createCacheKey(url.href, nextUrl)\n schedulePrefetchTask(cacheKey)\n}\n","import type { TreePrefetch } from '../../../server/app-render/collect-segment-data'\nimport {\n requestRouteCacheEntryFromCache,\n requestSegmentEntryFromCache,\n EntryStatus,\n type FulfilledRouteCacheEntry,\n type RouteCacheEntry,\n} from './cache'\nimport type { RouteCacheKey } from './cache-key'\n\nconst scheduleMicrotask =\n typeof queueMicrotask === 'function'\n ? queueMicrotask\n : (fn: () => unknown) =>\n Promise.resolve()\n .then(fn)\n .catch((error) =>\n setTimeout(() => {\n throw error\n })\n )\n\nexport type PrefetchTask = {\n key: RouteCacheKey\n\n /**\n * sortId is an incrementing counter\n *\n * Newer prefetches are prioritized over older ones, so that as new links\n * enter the viewport, they are not starved by older links that are no\n * longer relevant. In the future, we can add additional prioritization\n * heuristics, like removing prefetches once a link leaves the viewport.\n *\n * The sortId is assigned when the prefetch is initiated, and reassigned if\n * the same URL is prefetched again (effectively bumping it to the top of\n * the queue).\n *\n * TODO: We can add additional fields here to indicate what kind of prefetch\n * it is. For example, was it initiated by a link? Or was it an imperative\n * call? If it was initiated by a link, we can remove it from the queue when\n * the link leaves the viewport, but if it was an imperative call, then we\n * should keep it in the queue until it's fulfilled.\n *\n * We can also add priority levels. For example, hovering over a link could\n * increase the priority of its prefetch.\n */\n sortId: number\n\n /**\n * True if the prefetch is blocked by network data. We remove tasks from the\n * queue once they are blocked, and add them back when they receive data.\n *\n * isBlocked also indicates whether the task is currently in the queue; tasks\n * are removed from the queue when they are blocked. Use this to avoid\n * queueing the same task multiple times.\n */\n isBlocked: boolean\n\n /**\n * The index of the task in the heap's backing array. Used to efficiently\n * change the priority of a task by re-sifting it, which requires knowing\n * where it is in the array. This is only used internally by the heap\n * algorithm. The naive alternative is indexOf every time a task is queued,\n * which has O(n) complexity.\n */\n _heapIndex: number\n}\n\nconst enum PrefetchTaskExitStatus {\n /**\n * The task yielded because there are too many requests in progress.\n */\n InProgress,\n\n /**\n * The task is blocked. It needs more data before it can proceed.\n *\n * Currently the only reason this happens is we're still waiting to receive a\n * route tree from the server, because we can't start prefetching the segments\n * until we know what to prefetch.\n */\n Blocked,\n\n /**\n * There's nothing left to prefetch.\n */\n Done,\n}\n\nconst taskHeap: Array = []\n\n// This is intentionally low so that when a navigation happens, the browser's\n// internal network queue is not already saturated with prefetch requests.\nconst MAX_CONCURRENT_PREFETCH_REQUESTS = 3\nlet inProgressRequests = 0\n\nlet sortIdCounter = 0\nlet didScheduleMicrotask = false\n\n/**\n * Initiates a prefetch task for the given URL. If a prefetch for the same URL\n * is already in progress, this will bump it to the top of the queue.\n *\n * This is not a user-facing function. By the time this is called, the href is\n * expected to be validated and normalized.\n *\n * @param key The RouteCacheKey to prefetch.\n */\nexport function schedulePrefetchTask(key: RouteCacheKey): void {\n // Spawn a new prefetch task\n const task: PrefetchTask = {\n key,\n sortId: sortIdCounter++,\n isBlocked: false,\n _heapIndex: -1,\n }\n heapPush(taskHeap, task)\n\n // Schedule an async task to process the queue.\n //\n // The main reason we process the queue in an async task is for batching.\n // It's common for a single JS task/event to trigger multiple prefetches.\n // By deferring to a microtask, we only process the queue once per JS task.\n // If they have different priorities, it also ensures they are processed in\n // the optimal order.\n ensureWorkIsScheduled()\n}\n\nfunction ensureWorkIsScheduled() {\n if (didScheduleMicrotask || !hasNetworkBandwidth()) {\n // Either we already scheduled a task to process the queue, or there are\n // too many concurrent requests in progress. In the latter case, the\n // queue will resume processing once more bandwidth is available.\n return\n }\n didScheduleMicrotask = true\n scheduleMicrotask(processQueueInMicrotask)\n}\n\n/**\n * Checks if we've exceeded the maximum number of concurrent prefetch requests,\n * to avoid saturating the browser's internal network queue. This is a\n * cooperative limit — prefetch tasks should check this before issuing\n * new requests.\n */\nfunction hasNetworkBandwidth(): boolean {\n // TODO: Also check if there's an in-progress navigation. We should never\n // add prefetch requests to the network queue if an actual navigation is\n // taking place, to ensure there's sufficient bandwidth for render-blocking\n // data and resources.\n return inProgressRequests < MAX_CONCURRENT_PREFETCH_REQUESTS\n}\n\n/**\n * Notifies the scheduler of an in-progress prefetch request. This is used to\n * control network bandwidth by limiting the number of concurrent requests.\n *\n * @param promise A promise that resolves when the request has finished.\n */\nexport function trackPrefetchRequestBandwidth(\n promiseForServerData: Promise\n) {\n inProgressRequests++\n promiseForServerData.then(\n onPrefetchRequestCompletion,\n onPrefetchRequestCompletion\n )\n}\n\nconst noop = () => {}\n\nexport function spawnPrefetchSubtask(promise: Promise) {\n // When the scheduler spawns an async task, we don't await its result\n // directly. Instead, the async task writes its result directly into the\n // cache, then pings the scheduler to continue.\n //\n // This function only exists to prevent warnings about unhandled promises.\n promise.then(noop, noop)\n}\n\nfunction onPrefetchRequestCompletion(): void {\n inProgressRequests--\n\n // Notify the scheduler that we have more bandwidth, and can continue\n // processing tasks.\n ensureWorkIsScheduled()\n}\n\n/**\n * Notify the scheduler that we've received new data for an in-progress\n * prefetch. The corresponding task will be added back to the queue (unless the\n * task has been canceled in the meantime).\n */\nexport function pingPrefetchTask(task: PrefetchTask) {\n // \"Ping\" a prefetch that's already in progress to notify it of new data.\n if (!task.isBlocked) {\n // Prefetch is already queued.\n return\n }\n // Unblock the task and requeue it.\n task.isBlocked = false\n heapPush(taskHeap, task)\n ensureWorkIsScheduled()\n}\n\nfunction processQueueInMicrotask() {\n didScheduleMicrotask = false\n\n // We aim to minimize how often we read the current time. Since nearly all\n // functions in the prefetch scheduler are synchronous, we can read the time\n // once and pass it as an argument wherever it's needed.\n const now = Date.now()\n\n // Process the task queue until we run out of network bandwidth.\n let task = heapPeek(taskHeap)\n while (task !== null && hasNetworkBandwidth()) {\n const route = requestRouteCacheEntryFromCache(now, task)\n const exitStatus = pingRouteTree(now, task, route)\n switch (exitStatus) {\n case PrefetchTaskExitStatus.InProgress:\n // The task yielded because there are too many requests in progress.\n // Stop processing tasks until we have more bandwidth.\n return\n case PrefetchTaskExitStatus.Blocked:\n // The task is blocked. It needs more data before it can proceed.\n // Keep the task out of the queue until the server responds.\n task.isBlocked = true\n\n // Continue to the next task\n heapPop(taskHeap)\n task = heapPeek(taskHeap)\n continue\n case PrefetchTaskExitStatus.Done:\n // The prefetch is complete. Continue to the next task.\n heapPop(taskHeap)\n task = heapPeek(taskHeap)\n continue\n default: {\n const _exhaustiveCheck: never = exitStatus\n return\n }\n }\n }\n}\n\nfunction pingRouteTree(\n now: number,\n task: PrefetchTask,\n route: RouteCacheEntry\n): PrefetchTaskExitStatus {\n switch (route.status) {\n case EntryStatus.Pending: {\n // Still pending. We can't start prefetching the segments until the route\n // tree has loaded.\n const blockedTasks = route.blockedTasks\n if (blockedTasks === null) {\n route.blockedTasks = new Set([task])\n } else {\n blockedTasks.add(task)\n }\n return PrefetchTaskExitStatus.Blocked\n }\n case EntryStatus.Rejected: {\n // Route tree failed to load. Treat as a 404.\n return PrefetchTaskExitStatus.Done\n }\n case EntryStatus.Fulfilled: {\n // Recursively fill in the segment tree.\n if (!hasNetworkBandwidth()) {\n // Stop prefetching segments until there's more bandwidth.\n return PrefetchTaskExitStatus.InProgress\n }\n const tree = route.tree\n requestSegmentEntryFromCache(now, task, route, tree.path, '')\n return pingSegmentTree(now, task, route, tree)\n }\n default: {\n const _exhaustiveCheck: never = route\n return PrefetchTaskExitStatus.Done\n }\n }\n}\n\nfunction pingSegmentTree(\n now: number,\n task: PrefetchTask,\n route: FulfilledRouteCacheEntry,\n tree: TreePrefetch\n): PrefetchTaskExitStatus.InProgress | PrefetchTaskExitStatus.Done {\n if (tree.slots !== null) {\n // Recursively ping the children.\n for (const parallelRouteKey in tree.slots) {\n const childTree = tree.slots[parallelRouteKey]\n if (!hasNetworkBandwidth()) {\n // Stop prefetching segments until there's more bandwidth.\n return PrefetchTaskExitStatus.InProgress\n } else {\n const childPath = childTree.path\n const childToken = childTree.token\n requestSegmentEntryFromCache(now, task, route, childPath, childToken)\n }\n const childExitStatus = pingSegmentTree(now, task, route, childTree)\n if (childExitStatus === PrefetchTaskExitStatus.InProgress) {\n // Child yielded without finishing.\n return PrefetchTaskExitStatus.InProgress\n }\n }\n }\n // This segment and all its children have finished prefetching.\n return PrefetchTaskExitStatus.Done\n}\n\n// -----------------------------------------------------------------------------\n// The remainider of the module is a MinHeap implementation. Try not to put any\n// logic below here unless it's related to the heap algorithm. We can extract\n// this to a separate module if/when we need multiple kinds of heaps.\n// -----------------------------------------------------------------------------\n\nfunction compareQueuePriority(a: PrefetchTask, b: PrefetchTask) {\n // Since the queue is a MinHeap, this should return a positive number if b is\n // higher priority than a, and a negative number if a is higher priority\n // than b.\n //\n // sortId is an incrementing counter assigned to prefetches. We want to\n // process the newest prefetches first.\n return b.sortId - a.sortId\n}\n\nfunction heapPush(heap: Array, node: PrefetchTask): void {\n const index = heap.length\n heap.push(node)\n node._heapIndex = index\n heapSiftUp(heap, node, index)\n}\n\nfunction heapPeek(heap: Array): PrefetchTask | null {\n return heap.length === 0 ? null : heap[0]\n}\n\nfunction heapPop(heap: Array): PrefetchTask | null {\n if (heap.length === 0) {\n return null\n }\n const first = heap[0]\n first._heapIndex = -1\n const last = heap.pop() as PrefetchTask\n if (last !== first) {\n heap[0] = last\n last._heapIndex = 0\n heapSiftDown(heap, last, 0)\n }\n return first\n}\n\n// Not currently used, but will be once we add the ability to update a\n// task's priority.\n// function heapSift(heap: Array, node: PrefetchTask) {\n// const index = node._heapIndex\n// if (index !== -1) {\n// const parentIndex = (index - 1) >>> 1\n// const parent = heap[parentIndex]\n// if (compareQueuePriority(parent, node) > 0) {\n// // The parent is larger. Sift up.\n// heapSiftUp(heap, node, index)\n// } else {\n// // The parent is smaller (or equal). Sift down.\n// heapSiftDown(heap, node, index)\n// }\n// }\n// }\n\nfunction heapSiftUp(\n heap: Array,\n node: PrefetchTask,\n i: number\n): void {\n let index = i\n while (index > 0) {\n const parentIndex = (index - 1) >>> 1\n const parent = heap[parentIndex]\n if (compareQueuePriority(parent, node) > 0) {\n // The parent is larger. Swap positions.\n heap[parentIndex] = node\n node._heapIndex = parentIndex\n heap[index] = parent\n parent._heapIndex = index\n\n index = parentIndex\n } else {\n // The parent is smaller. Exit.\n return\n }\n }\n}\n\nfunction heapSiftDown(\n heap: Array,\n node: PrefetchTask,\n i: number\n): void {\n let index = i\n const length = heap.length\n const halfLength = length >>> 1\n while (index < halfLength) {\n const leftIndex = (index + 1) * 2 - 1\n const left = heap[leftIndex]\n const rightIndex = leftIndex + 1\n const right = heap[rightIndex]\n\n // If the left or right node is smaller, swap with the smaller of those.\n if (compareQueuePriority(left, node) < 0) {\n if (rightIndex < length && compareQueuePriority(right, left) < 0) {\n heap[index] = right\n right._heapIndex = index\n heap[rightIndex] = node\n node._heapIndex = rightIndex\n\n index = rightIndex\n } else {\n heap[index] = left\n left._heapIndex = index\n heap[leftIndex] = node\n node._heapIndex = leftIndex\n\n index = leftIndex\n }\n } else if (rightIndex < length && compareQueuePriority(right, node) < 0) {\n heap[index] = right\n right._heapIndex = index\n heap[rightIndex] = node\n node._heapIndex = rightIndex\n\n index = rightIndex\n } else {\n // Neither child is smaller. Exit.\n return\n }\n }\n}\n","// Utility type. Prefix<[A, B, C, D]> matches [A], [A, B], [A, B, C] etc.\nexport type Prefix = T extends [infer First, ...infer Rest]\n ? [] | [First] | [First, ...Prefix]\n : []\n\nexport type TupleMap, V> = {\n set(keys: Prefix, value: V): void\n get(keys: Prefix): V | null\n delete(keys: Prefix): void\n}\n\n/**\n * Creates a map whose keys are tuples. Tuples are compared per-element. This\n * is useful when a key has multiple parts, but you don't want to concatenate\n * them into a single string value.\n *\n * In the Segment Cache, we use this to store cache entries by both their href\n * and their Next-URL.\n *\n * Example:\n * map.set(['https://localhost', 'foo/bar/baz'], 'yay');\n * map.get(['https://localhost', 'foo/bar/baz']); // returns 'yay'\n */\nexport function createTupleMap, V>(): TupleMap<\n Keypath,\n V\n> {\n type MapEntryShared = {\n parent: MapEntry | null\n key: any\n map: Map | null\n }\n\n type EmptyMapEntry = MapEntryShared & {\n value: null\n hasValue: false\n }\n\n type FullMapEntry = MapEntryShared & {\n value: V\n hasValue: true\n }\n\n type MapEntry = EmptyMapEntry | FullMapEntry\n\n let rootEntry: MapEntry = {\n parent: null,\n key: null,\n hasValue: false,\n value: null,\n map: null,\n }\n\n // To optimize successive lookups, we cache the last accessed keypath.\n // Although it's not encoded in the type, these are both null or\n // both non-null. It uses object equality, so to take advantage of this\n // optimization, you must pass the same array instance to each successive\n // method call, and you must also not mutate the array between calls.\n let lastAccessedEntry: MapEntry | null = null\n let lastAccessedKeys: Prefix | null = null\n\n function getOrCreateEntry(keys: Prefix): MapEntry {\n if (lastAccessedKeys === keys) {\n return lastAccessedEntry!\n }\n\n // Go through each level of keys until we find the entry that matches,\n // or create a new one if it doesn't already exist.\n let entry = rootEntry\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n let map = entry.map\n if (map !== null) {\n const existingEntry = map.get(key)\n if (existingEntry !== undefined) {\n // Found a match. Keep going.\n entry = existingEntry\n continue\n }\n } else {\n map = new Map()\n entry.map = map\n }\n // No entry exists yet at this level. Create a new one.\n const newEntry: MapEntry = {\n parent: entry,\n key,\n value: null,\n hasValue: false,\n map: null,\n }\n map.set(key, newEntry)\n entry = newEntry\n }\n\n lastAccessedKeys = keys\n lastAccessedEntry = entry\n\n return entry\n }\n\n function getEntryIfExists(keys: Prefix): MapEntry | null {\n if (lastAccessedKeys === keys) {\n return lastAccessedEntry\n }\n\n // Go through each level of keys until we find the entry that matches, or\n // return null if no match exists.\n let entry = rootEntry\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n let map = entry.map\n if (map !== null) {\n const existingEntry = map.get(key)\n if (existingEntry !== undefined) {\n // Found a match. Keep going.\n entry = existingEntry\n continue\n }\n }\n // No entry exists at this level.\n return null\n }\n\n lastAccessedKeys = keys\n lastAccessedEntry = entry\n\n return entry\n }\n\n function set(keys: Prefix, value: V): void {\n const entry = getOrCreateEntry(keys)\n entry.hasValue = true\n entry.value = value\n }\n\n function get(keys: Prefix): V | null {\n const entry = getEntryIfExists(keys)\n if (entry === null || !entry.hasValue) {\n return null\n }\n return entry.value\n }\n\n function deleteEntry(keys: Prefix): void {\n const entry = getEntryIfExists(keys)\n if (entry === null || !entry.hasValue) {\n return\n }\n\n // Found a match. Delete it from the cache.\n const deletedEntry: EmptyMapEntry = entry as any\n deletedEntry.hasValue = false\n deletedEntry.value = null\n\n // Check if we can garbage collect the entry.\n if (deletedEntry.map === null) {\n // Since this entry has no value, and also no child entries, we can\n // garbage collect it. Remove it from its parent, and keep garbage\n // collecting the parents until we reach a non-empty entry.\n\n // Unlike a `set` operation, these are no longer valid because the entry\n // itself is being modified, not just the value it contains.\n lastAccessedEntry = null\n lastAccessedKeys = null\n\n let parent = deletedEntry.parent\n let key = deletedEntry.key\n while (parent !== null) {\n const parentMap = parent.map\n if (parentMap !== null) {\n parentMap.delete(key)\n if (parentMap.size === 0) {\n // We just removed the last entry in the parent map.\n parent.map = null\n if (parent.value === null) {\n // The parent node has no child entries, nor does it have a value\n // on itself. It can be garbage collected. Keep going.\n key = parent.key\n parent = parent.parent\n continue\n }\n }\n }\n // The parent is not empty. Stop garbage collecting.\n break\n }\n }\n }\n\n return {\n set,\n get,\n delete: deleteEntry,\n }\n}\n","const NEXT_STATIC_GEN_BAILOUT = 'NEXT_STATIC_GEN_BAILOUT'\n\nexport class StaticGenBailoutError extends Error {\n public readonly code = NEXT_STATIC_GEN_BAILOUT\n}\n\nexport function isStaticGenBailoutError(\n error: unknown\n): error is StaticGenBailoutError {\n if (typeof error !== 'object' || error === null || !('code' in error)) {\n return false\n }\n\n return error.code === NEXT_STATIC_GEN_BAILOUT\n}\n","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n// TODO: Add `unauthorized` docs\n/**\n * @experimental\n * This function allows you to render the [unauthorized.js file](https://nextjs.org/docs/app/api-reference/file-conventions/unauthorized)\n * within a route segment as well as inject a tag.\n *\n * `unauthorized()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n *\n * Read more: [Next.js Docs: `unauthorized`](https://nextjs.org/docs/app/api-reference/functions/unauthorized)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};401`\n\nexport function unauthorized(): never {\n if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {\n throw new Error(\n `\\`unauthorized()\\` is experimental and only allowed to be used when \\`experimental.authInterrupts\\` is enabled.`\n )\n }\n\n // eslint-disable-next-line no-throw-literal\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n throw error\n}\n","/**\n * Create a \"Thenable\" that does not resolve. This is used to suspend indefinitely when data is not available yet.\n */\nexport const unresolvedThenable = {\n then: () => {},\n} as PromiseLike\n","import { isDynamicUsageError } from '../../export/helpers/is-dynamic-usage-error'\nimport { isPostpone } from '../../server/lib/router-utils/is-postpone'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { isNextRouterError } from './is-next-router-error'\n\n/**\n * This function should be used to rethrow internal Next.js errors so that they can be handled by the framework.\n * When wrapping an API that uses errors to interrupt control flow, you should use this function before you do any error handling.\n * This function will rethrow the error if it is a Next.js error so it can be handled, otherwise it will do nothing.\n *\n * Read more: [Next.js Docs: `unstable_rethrow`](https://nextjs.org/docs/app/api-reference/functions/unstable_rethrow)\n */\nexport function unstable_rethrow(error: unknown): void {\n if (\n isNextRouterError(error) ||\n isBailoutToCSRError(error) ||\n isDynamicUsageError(error) ||\n isPostpone(error)\n ) {\n throw error\n }\n\n if (error instanceof Error && 'cause' in error) {\n unstable_rethrow(error.cause)\n }\n}\n","import type { Dispatch } from 'react'\nimport React, { use } from 'react'\nimport { useCallback } from 'react'\nimport type {\n AppRouterState,\n ReducerActions,\n ReducerState,\n} from './router-reducer/router-reducer-types'\nimport type { AppRouterActionQueue } from '../../shared/lib/router/action-queue'\nimport { isThenable } from '../../shared/lib/is-thenable'\n\nexport function useUnwrapState(state: ReducerState): AppRouterState {\n // reducer actions can be async, so sometimes we need to suspend until the state is resolved\n if (isThenable(state)) {\n const result = use(state)\n return result\n }\n\n return state\n}\n\nexport function useReducer(\n actionQueue: AppRouterActionQueue\n): [ReducerState, Dispatch] {\n const [state, setState] = React.useState(actionQueue.state)\n\n const dispatch = useCallback(\n (action: ReducerActions) => {\n actionQueue.dispatch(action, setState)\n },\n [actionQueue]\n )\n\n return [state, dispatch]\n}\n","import type { detectDomainLocale as Fn } from '../shared/lib/i18n/detect-domain-locale'\n\nexport const detectDomainLocale: typeof Fn = (...args) => {\n if (process.env.__NEXT_I18N_SUPPORT) {\n return require('../shared/lib/i18n/detect-domain-locale').detectDomainLocale(\n ...args\n )\n }\n}\n","import type {\n CacheNodeSeedData,\n FlightData,\n FlightDataPath,\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n} from '../server/app-render/types'\n\nexport type NormalizedFlightData = {\n /**\n * The full `FlightSegmentPath` inclusive of the final `Segment`\n */\n segmentPath: FlightSegmentPath\n /**\n * The `FlightSegmentPath` exclusive of the final `Segment`\n */\n pathToSegment: FlightSegmentPath\n segment: Segment\n tree: FlightRouterState\n seedData: CacheNodeSeedData | null\n head: React.ReactNode | null\n isHeadPartial: boolean\n isRootRender: boolean\n}\n\n// TODO: We should only have to export `normalizeFlightData`, however because the initial flight data\n// that gets passed to `createInitialRouterState` doesn't conform to the `FlightDataPath` type (it's missing the root segment)\n// we're currently exporting it so we can use it directly. This should be fixed as part of the unification of\n// the different ways we express `FlightSegmentPath`.\nexport function getFlightDataPartsFromPath(\n flightDataPath: FlightDataPath\n): NormalizedFlightData {\n // tree, seedData, and head are *always* the last three items in the `FlightDataPath`.\n const [tree, seedData, head, isHeadPartial] = flightDataPath.slice(-4)\n // The `FlightSegmentPath` is everything except the last three items. For a root render, it won't be present.\n const segmentPath = flightDataPath.slice(0, -4)\n\n return {\n // TODO: Unify these two segment path helpers. We are inconsistently pushing an empty segment (\"\")\n // to the start of the segment path in some places which makes it hard to use solely the segment path.\n // Look for \"// TODO-APP: remove ''\" in the codebase.\n pathToSegment: segmentPath.slice(0, -1),\n segmentPath,\n // if the `FlightDataPath` corresponds with the root, there'll be no segment path,\n // in which case we default to ''.\n segment: segmentPath[segmentPath.length - 1] ?? '',\n tree,\n seedData,\n head,\n isHeadPartial,\n isRootRender: flightDataPath.length === 4,\n }\n}\n\nexport function getNextFlightSegmentPath(\n flightSegmentPath: FlightSegmentPath\n): FlightSegmentPath {\n // Since `FlightSegmentPath` is a repeated tuple of `Segment` and `ParallelRouteKey`, we slice off two items\n // to get the next segment path.\n return flightSegmentPath.slice(2)\n}\n\nexport function normalizeFlightData(\n flightData: FlightData\n): NormalizedFlightData[] | string {\n // FlightData can be a string when the server didn't respond with a proper flight response,\n // or when a redirect happens, to signal to the client that it needs to perform an MPA navigation.\n if (typeof flightData === 'string') {\n return flightData\n }\n\n return flightData.map(getFlightDataPartsFromPath)\n}\n","import { pathHasPrefix } from '../shared/lib/router/utils/path-has-prefix'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function hasBasePath(path: string): boolean {\n return pathHasPrefix(path, basePath)\n}\n","function formatObject(arg: unknown, depth: number) {\n switch (typeof arg) {\n case 'object':\n if (arg === null) {\n return 'null'\n } else if (Array.isArray(arg)) {\n let result = '['\n if (depth < 1) {\n for (let i = 0; i < arg.length; i++) {\n if (result !== '[') {\n result += ','\n }\n if (Object.prototype.hasOwnProperty.call(arg, i)) {\n result += formatObject(arg[i], depth + 1)\n }\n }\n } else {\n result += arg.length > 0 ? '...' : ''\n }\n result += ']'\n return result\n } else if (arg instanceof Error) {\n return arg + ''\n } else {\n const keys = Object.keys(arg)\n let result = '{'\n if (depth < 1) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n const desc = Object.getOwnPropertyDescriptor(arg, 'key')\n if (desc && !desc.get && !desc.set) {\n const jsonKey = JSON.stringify(key)\n if (jsonKey !== '\"' + key + '\"') {\n result += jsonKey + ': '\n } else {\n result += key + ': '\n }\n result += formatObject(desc.value, depth + 1)\n }\n }\n } else {\n result += keys.length > 0 ? '...' : ''\n }\n result += '}'\n return result\n }\n case 'string':\n return JSON.stringify(arg)\n default:\n return String(arg)\n }\n}\n\nexport function formatConsoleArgs(args: unknown[]): string {\n let message: string\n let idx: number\n if (typeof args[0] === 'string') {\n message = args[0]\n idx = 1\n } else {\n message = ''\n idx = 0\n }\n let result = ''\n let startQuote = false\n for (let i = 0; i < message.length; ++i) {\n const char = message[i]\n if (char !== '%' || i === message.length - 1 || idx >= args.length) {\n result += char\n continue\n }\n\n const code = message[++i]\n switch (code) {\n case 'c': {\n // TODO: We should colorize with HTML instead of turning into a string.\n // Ignore for now.\n result = startQuote ? `${result}]` : `[${result}`\n startQuote = !startQuote\n idx++\n break\n }\n case 'O':\n case 'o': {\n result += formatObject(args[idx++], 0)\n break\n }\n case 'd':\n case 'i': {\n result += parseInt(args[idx++] as any, 10)\n break\n }\n case 'f': {\n result += parseFloat(args[idx++] as any)\n break\n }\n case 's': {\n result += String(args[idx++])\n break\n }\n default:\n result += '%' + code\n }\n }\n\n for (; idx < args.length; idx++) {\n result += (idx > 0 ? ' ' : '') + formatObject(args[idx], 0)\n }\n\n return result\n}\n","import { removeTrailingSlash } from '../shared/lib/router/utils/remove-trailing-slash'\nimport { parsePath } from '../shared/lib/router/utils/parse-path'\n\n/**\n * Normalizes the trailing slash of a path according to the `trailingSlash` option\n * in `next.config.js`.\n */\nexport const normalizePathTrailingSlash = (path: string) => {\n if (!path.startsWith('/') || process.env.__NEXT_MANUAL_TRAILING_SLASH) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n if (process.env.__NEXT_TRAILING_SLASH) {\n if (/\\.[^/]+\\/?$/.test(pathname)) {\n return `${removeTrailingSlash(pathname)}${query}${hash}`\n } else if (pathname.endsWith('/')) {\n return `${pathname}${query}${hash}`\n } else {\n return `${pathname}/${query}${hash}`\n }\n }\n\n return `${removeTrailingSlash(pathname)}${query}${hash}`\n}\n","// This file is only used in app router due to the specific error state handling.\n\nimport type { HydrationOptions } from 'react-dom/client'\nimport { getReactStitchedError } from '../components/react-dev-overlay/internal/helpers/stitched-error'\nimport { handleClientError } from '../components/react-dev-overlay/internal/helpers/use-error-handler'\nimport { isNextRouterError } from '../components/is-next-router-error'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { reportGlobalError } from './report-global-error'\nimport { originConsoleError } from '../components/globals/intercept-console-error'\n\nexport const onCaughtError: HydrationOptions['onCaughtError'] = (\n err,\n errorInfo\n) => {\n // Skip certain custom errors which are not expected to be reported on client\n if (isBailoutToCSRError(err) || isNextRouterError(err)) return\n\n if (process.env.NODE_ENV !== 'production') {\n const errorBoundaryComponent = errorInfo?.errorBoundary?.constructor\n const errorBoundaryName =\n // read react component displayName\n (errorBoundaryComponent as any)?.displayName ||\n errorBoundaryComponent?.name ||\n 'Unknown'\n\n const componentThatErroredFrame = errorInfo?.componentStack?.split('\\n')[1]\n\n // Match chrome or safari stack trace\n const matches =\n // regex to match the function name in the stack trace\n // example 1: at Page (http://localhost:3000/_next/static/chunks/pages/index.js?ts=1631600000000:2:1)\n // example 2: Page@http://localhost:3000/_next/static/chunks/pages/index.js?ts=1631600000000:2:1\n componentThatErroredFrame?.match(/\\s+at (\\w+)\\s+|(\\w+)@/) ?? []\n const componentThatErroredName = matches[1] || matches[2] || 'Unknown'\n\n // Create error location with errored component and error boundary, to match the behavior of default React onCaughtError handler.\n const errorBoundaryMessage = `It was handled by the <${errorBoundaryName}> error boundary.`\n const componentErrorMessage = componentThatErroredName\n ? `The above error occurred in the <${componentThatErroredName}> component.`\n : `The above error occurred in one of your components.`\n\n const errorLocation = `${componentErrorMessage} ${errorBoundaryMessage}`\n\n const stitchedError = getReactStitchedError(err)\n // TODO: change to passing down errorInfo later\n // In development mode, pass along the component stack to the error\n if (errorInfo.componentStack) {\n ;(stitchedError as any)._componentStack = errorInfo.componentStack\n }\n\n // Log and report the error with location but without modifying the error stack\n originConsoleError('%o\\n\\n%s', err, errorLocation)\n\n handleClientError(stitchedError, [])\n } else {\n originConsoleError(err)\n }\n}\n\nexport const onUncaughtError: HydrationOptions['onUncaughtError'] = (\n err,\n errorInfo\n) => {\n // Skip certain custom errors which are not expected to be reported on client\n if (isBailoutToCSRError(err) || isNextRouterError(err)) return\n\n if (process.env.NODE_ENV !== 'production') {\n const componentThatErroredFrame = errorInfo?.componentStack?.split('\\n')[1]\n\n // Match chrome or safari stack trace\n const matches =\n componentThatErroredFrame?.match(/\\s+at (\\w+)\\s+|(\\w+)@/) ?? []\n const componentThatErroredName = matches[1] || matches[2] || 'Unknown'\n\n // Create error location with errored component and error boundary, to match the behavior of default React onCaughtError handler.\n const errorLocation = componentThatErroredName\n ? `The above error occurred in the <${componentThatErroredName}> component.`\n : `The above error occurred in one of your components.`\n\n const stitchedError = getReactStitchedError(err)\n // TODO: change to passing down errorInfo later\n // In development mode, pass along the component stack to the error\n if (errorInfo.componentStack) {\n ;(stitchedError as any)._componentStack = errorInfo.componentStack\n }\n\n // Log and report the error with location but without modifying the error stack\n originConsoleError('%o\\n\\n%s', err, errorLocation)\n reportGlobalError(stitchedError)\n } else {\n reportGlobalError(err)\n }\n}\n","export const reportGlobalError =\n typeof reportError === 'function'\n ? // In modern browsers, reportError will dispatch an error event,\n // emulating an uncaught JavaScript error.\n reportError\n : (error: unknown) => {\n window.console.error(error)\n }\n","// This module can be shared between both pages router and app router\n\nimport type { HydrationOptions } from 'react-dom/client'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { reportGlobalError } from './report-global-error'\nimport { getReactStitchedError } from '../components/react-dev-overlay/internal/helpers/stitched-error'\nimport isError from '../../lib/is-error'\n\nexport const onRecoverableError: HydrationOptions['onRecoverableError'] = (\n error,\n errorInfo\n) => {\n // x-ref: https://github.com/facebook/react/pull/28736\n const cause = isError(error) && 'cause' in error ? error.cause : error\n const stitchedError = getReactStitchedError(cause)\n // In development mode, pass along the component stack to the error\n if (process.env.NODE_ENV === 'development' && errorInfo.componentStack) {\n ;(stitchedError as any)._componentStack = errorInfo.componentStack\n }\n // Skip certain custom errors which are not expected to be reported on client\n if (isBailoutToCSRError(cause)) return\n\n reportGlobalError(stitchedError)\n}\n","import { hasBasePath } from './has-base-path'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function removeBasePath(path: string): string {\n if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {\n if (!hasBasePath(path)) {\n return path\n }\n }\n\n // Can't trim the basePath if it has zero length!\n if (basePath.length === 0) return path\n\n path = path.slice(basePath.length)\n if (!path.startsWith('/')) path = `/${path}`\n return path\n}\n","import { parsePath } from '../shared/lib/router/utils/parse-path'\n\nexport function removeLocale(path: string, locale?: string) {\n if (process.env.__NEXT_I18N_SUPPORT) {\n const { pathname } = parsePath(path)\n const pathLower = pathname.toLowerCase()\n const localeLower = locale?.toLowerCase()\n\n return locale &&\n (pathLower.startsWith(`/${localeLower}/`) ||\n pathLower === `/${localeLower}`)\n ? `${pathname.length === locale.length + 1 ? `/` : ``}${path.slice(\n locale.length + 1\n )}`\n : path\n }\n return path\n}\n","export const requestIdleCallback =\n (typeof self !== 'undefined' &&\n self.requestIdleCallback &&\n self.requestIdleCallback.bind(window)) ||\n function (cb: IdleRequestCallback): number {\n let start = Date.now()\n return self.setTimeout(function () {\n cb({\n didTimeout: false,\n timeRemaining: function () {\n return Math.max(0, 50 - (Date.now() - start))\n },\n })\n }, 1)\n }\n\nexport const cancelIdleCallback =\n (typeof self !== 'undefined' &&\n self.cancelIdleCallback &&\n self.cancelIdleCallback.bind(window)) ||\n function (id: number) {\n return clearTimeout(id)\n }\n","import type { NextRouter, Url } from '../shared/lib/router/router'\n\nimport { searchParamsToUrlQuery } from '../shared/lib/router/utils/querystring'\nimport { formatWithValidation } from '../shared/lib/router/utils/format-url'\nimport { omit } from '../shared/lib/router/utils/omit'\nimport { normalizeRepeatedSlashes } from '../shared/lib/utils'\nimport { normalizePathTrailingSlash } from './normalize-trailing-slash'\nimport { isLocalURL } from '../shared/lib/router/utils/is-local-url'\nimport { isDynamicRoute } from '../shared/lib/router/utils'\nimport { interpolateAs } from '../shared/lib/router/utils/interpolate-as'\n\n/**\n * Resolves a given hyperlink with a certain router state (basePath not included).\n * Preserves absolute urls.\n */\nexport function resolveHref(\n router: NextRouter,\n href: Url,\n resolveAs: true\n): [string, string] | [string]\nexport function resolveHref(\n router: NextRouter,\n href: Url,\n resolveAs?: false\n): string\nexport function resolveHref(\n router: NextRouter,\n href: Url,\n resolveAs?: boolean\n): [string, string] | [string] | string {\n // we use a dummy base url for relative urls\n let base: URL\n let urlAsString = typeof href === 'string' ? href : formatWithValidation(href)\n\n // repeated slashes and backslashes in the URL are considered\n // invalid and will never match a Next.js page/file\n const urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\\/\\//)\n const urlAsStringNoProto = urlProtoMatch\n ? urlAsString.slice(urlProtoMatch[0].length)\n : urlAsString\n\n const urlParts = urlAsStringNoProto.split('?', 1)\n\n if ((urlParts[0] || '').match(/(\\/\\/|\\\\)/)) {\n console.error(\n `Invalid href '${urlAsString}' passed to next/router in page: '${router.pathname}'. Repeated forward-slashes (//) or backslashes \\\\ are not valid in the href.`\n )\n const normalizedUrl = normalizeRepeatedSlashes(urlAsStringNoProto)\n urlAsString = (urlProtoMatch ? urlProtoMatch[0] : '') + normalizedUrl\n }\n\n // Return because it cannot be routed by the Next.js router\n if (!isLocalURL(urlAsString)) {\n return (resolveAs ? [urlAsString] : urlAsString) as string\n }\n\n try {\n base = new URL(\n urlAsString.startsWith('#') ? router.asPath : router.pathname,\n 'http://n'\n )\n } catch (_) {\n // fallback to / for invalid asPath values e.g. //\n base = new URL('/', 'http://n')\n }\n\n try {\n const finalUrl = new URL(urlAsString, base)\n finalUrl.pathname = normalizePathTrailingSlash(finalUrl.pathname)\n let interpolatedAs = ''\n\n if (\n isDynamicRoute(finalUrl.pathname) &&\n finalUrl.searchParams &&\n resolveAs\n ) {\n const query = searchParamsToUrlQuery(finalUrl.searchParams)\n\n const { result, params } = interpolateAs(\n finalUrl.pathname,\n finalUrl.pathname,\n query\n )\n\n if (result) {\n interpolatedAs = formatWithValidation({\n pathname: result,\n hash: finalUrl.hash,\n query: omit(query, params),\n })\n }\n }\n\n // if the origin didn't change, it means we received a relative href\n const resolvedHref =\n finalUrl.origin === base.origin\n ? finalUrl.href.slice(finalUrl.origin.length)\n : finalUrl.href\n\n return resolveAs\n ? [resolvedHref, interpolatedAs || resolvedHref]\n : resolvedHref\n } catch (_) {\n return resolveAs ? [urlAsString] : urlAsString\n }\n}\n","import type { ComponentType } from 'react'\nimport type { MiddlewareMatcher } from '../build/analysis/get-page-static-info'\nimport getAssetPathFromRoute from '../shared/lib/router/utils/get-asset-path-from-route'\nimport { __unsafeCreateTrustedScriptURL } from './trusted-types'\nimport { requestIdleCallback } from './request-idle-callback'\nimport { getDeploymentIdQueryOrEmptyString } from '../build/deployment-id'\nimport { encodeURIPath } from '../shared/lib/encode-uri-path'\n\n// 3.8s was arbitrarily chosen as it's what https://web.dev/interactive\n// considers as \"Good\" time-to-interactive. We must assume something went\n// wrong beyond this point, and then fall-back to a full page transition to\n// show the user something of value.\nconst MS_MAX_IDLE_DELAY = 3800\n\ndeclare global {\n interface Window {\n __BUILD_MANIFEST?: Record\n __BUILD_MANIFEST_CB?: Function\n __MIDDLEWARE_MATCHERS?: MiddlewareMatcher[]\n __MIDDLEWARE_MANIFEST_CB?: Function\n __REACT_LOADABLE_MANIFEST?: any\n __DYNAMIC_CSS_MANIFEST?: any\n __RSC_MANIFEST?: any\n __RSC_SERVER_MANIFEST?: any\n __NEXT_FONT_MANIFEST?: any\n __SUBRESOURCE_INTEGRITY_MANIFEST?: string\n __INTERCEPTION_ROUTE_REWRITE_MANIFEST?: string\n }\n}\n\ninterface LoadedEntrypointSuccess {\n component: ComponentType\n exports: any\n}\ninterface LoadedEntrypointFailure {\n error: unknown\n}\ntype RouteEntrypoint = LoadedEntrypointSuccess | LoadedEntrypointFailure\n\ninterface RouteStyleSheet {\n href: string\n content: string\n}\n\ninterface LoadedRouteSuccess extends LoadedEntrypointSuccess {\n styles: RouteStyleSheet[]\n}\ninterface LoadedRouteFailure {\n error: unknown\n}\ntype RouteLoaderEntry = LoadedRouteSuccess | LoadedRouteFailure\n\ninterface Future {\n resolve: (entrypoint: V) => void\n future: Promise\n}\nfunction withFuture(\n key: string,\n map: Map | T>,\n generator?: () => Promise\n): Promise {\n let entry = map.get(key)\n if (entry) {\n if ('future' in entry) {\n return entry.future\n }\n return Promise.resolve(entry)\n }\n let resolver: (entrypoint: T) => void\n const prom: Promise = new Promise((resolve) => {\n resolver = resolve\n })\n map.set(key, { resolve: resolver!, future: prom })\n return generator\n ? generator()\n .then((value) => {\n resolver(value)\n return value\n })\n .catch((err) => {\n map.delete(key)\n throw err\n })\n : prom\n}\n\nexport interface RouteLoader {\n whenEntrypoint(route: string): Promise\n onEntrypoint(route: string, execute: () => unknown): void\n loadRoute(route: string, prefetch?: boolean): Promise\n prefetch(route: string): Promise\n}\n\nconst ASSET_LOAD_ERROR = Symbol('ASSET_LOAD_ERROR')\n// TODO: unexport\nexport function markAssetError(err: Error): Error {\n return Object.defineProperty(err, ASSET_LOAD_ERROR, {})\n}\n\nexport function isAssetError(err?: Error): boolean | undefined {\n return err && ASSET_LOAD_ERROR in err\n}\n\nfunction hasPrefetch(link?: HTMLLinkElement): boolean {\n try {\n link = document.createElement('link')\n return (\n // detect IE11 since it supports prefetch but isn't detected\n // with relList.support\n (!!window.MSInputMethodContext && !!(document as any).documentMode) ||\n link.relList.supports('prefetch')\n )\n } catch {\n return false\n }\n}\n\nconst canPrefetch: boolean = hasPrefetch()\n\nconst getAssetQueryString = () => {\n return getDeploymentIdQueryOrEmptyString()\n}\n\nfunction prefetchViaDom(\n href: string,\n as: string,\n link?: HTMLLinkElement\n): Promise {\n return new Promise((resolve, reject) => {\n const selector = `\n link[rel=\"prefetch\"][href^=\"${href}\"],\n link[rel=\"preload\"][href^=\"${href}\"],\n script[src^=\"${href}\"]`\n if (document.querySelector(selector)) {\n return resolve()\n }\n\n link = document.createElement('link')\n\n // The order of property assignment here is intentional:\n if (as) link!.as = as\n link!.rel = `prefetch`\n link!.crossOrigin = process.env.__NEXT_CROSS_ORIGIN!\n link!.onload = resolve as any\n link!.onerror = () =>\n reject(markAssetError(new Error(`Failed to prefetch: ${href}`)))\n\n // `href` should always be last:\n link!.href = href\n\n document.head.appendChild(link)\n })\n}\n\nfunction appendScript(\n src: TrustedScriptURL | string,\n script?: HTMLScriptElement\n): Promise {\n return new Promise((resolve, reject) => {\n script = document.createElement('script')\n\n // The order of property assignment here is intentional.\n // 1. Setup success/failure hooks in case the browser synchronously\n // executes when `src` is set.\n script.onload = resolve\n script.onerror = () =>\n reject(markAssetError(new Error(`Failed to load script: ${src}`)))\n\n // 2. Configure the cross-origin attribute before setting `src` in case the\n // browser begins to fetch.\n script.crossOrigin = process.env.__NEXT_CROSS_ORIGIN!\n\n // 3. Finally, set the source and inject into the DOM in case the child\n // must be appended for fetching to start.\n script.src = src as string\n document.body.appendChild(script)\n })\n}\n\n// We wait for pages to be built in dev before we start the route transition\n// timeout to prevent an un-necessary hard navigation in development.\nlet devBuildPromise: Promise | undefined\n\n// Resolve a promise that times out after given amount of milliseconds.\nfunction resolvePromiseWithTimeout(\n p: Promise,\n ms: number,\n err: Error\n): Promise {\n return new Promise((resolve, reject) => {\n let cancelled = false\n\n p.then((r) => {\n // Resolved, cancel the timeout\n cancelled = true\n resolve(r)\n }).catch(reject)\n\n // We wrap these checks separately for better dead-code elimination in\n // production bundles.\n if (process.env.NODE_ENV === 'development') {\n ;(devBuildPromise || Promise.resolve()).then(() => {\n requestIdleCallback(() =>\n setTimeout(() => {\n if (!cancelled) {\n reject(err)\n }\n }, ms)\n )\n })\n }\n\n if (process.env.NODE_ENV !== 'development') {\n requestIdleCallback(() =>\n setTimeout(() => {\n if (!cancelled) {\n reject(err)\n }\n }, ms)\n )\n }\n })\n}\n\n// TODO: stop exporting or cache the failure\n// It'd be best to stop exporting this. It's an implementation detail. We're\n// only exporting it for backwards compatibility with the `page-loader`.\n// Only cache this response as a last resort if we cannot eliminate all other\n// code branches that use the Build Manifest Callback and push them through\n// the Route Loader interface.\nexport function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST)\n }\n\n const onBuildManifest = new Promise>((resolve) => {\n // Mandatory because this is not concurrent safe:\n const cb = self.__BUILD_MANIFEST_CB\n self.__BUILD_MANIFEST_CB = () => {\n resolve(self.__BUILD_MANIFEST!)\n cb && cb()\n }\n })\n\n return resolvePromiseWithTimeout(\n onBuildManifest,\n MS_MAX_IDLE_DELAY,\n markAssetError(new Error('Failed to load client build manifest'))\n )\n}\n\ninterface RouteFiles {\n scripts: (TrustedScriptURL | string)[]\n css: string[]\n}\nfunction getFilesForRoute(\n assetPrefix: string,\n route: string\n): Promise {\n if (process.env.NODE_ENV === 'development') {\n const scriptUrl =\n assetPrefix +\n '/_next/static/chunks/pages' +\n encodeURIPath(getAssetPathFromRoute(route, '.js')) +\n getAssetQueryString()\n return Promise.resolve({\n scripts: [__unsafeCreateTrustedScriptURL(scriptUrl)],\n // Styles are handled by `style-loader` in development:\n css: [],\n })\n }\n return getClientBuildManifest().then((manifest) => {\n if (!(route in manifest)) {\n throw markAssetError(new Error(`Failed to lookup route: ${route}`))\n }\n const allFiles = manifest[route].map(\n (entry) => assetPrefix + '/_next/' + encodeURIPath(entry)\n )\n return {\n scripts: allFiles\n .filter((v) => v.endsWith('.js'))\n .map((v) => __unsafeCreateTrustedScriptURL(v) + getAssetQueryString()),\n css: allFiles\n .filter((v) => v.endsWith('.css'))\n .map((v) => v + getAssetQueryString()),\n }\n })\n}\n\nexport function createRouteLoader(assetPrefix: string): RouteLoader {\n const entrypoints: Map | RouteEntrypoint> =\n new Map()\n const loadedScripts: Map> = new Map()\n const styleSheets: Map> = new Map()\n const routes: Map | RouteLoaderEntry> =\n new Map()\n\n function maybeExecuteScript(\n src: TrustedScriptURL | string\n ): Promise {\n // With HMR we might need to \"reload\" scripts when they are\n // disposed and readded. Executing scripts twice has no functional\n // differences\n if (process.env.NODE_ENV !== 'development') {\n let prom: Promise | undefined = loadedScripts.get(src.toString())\n if (prom) {\n return prom\n }\n\n // Skip executing script if it's already in the DOM:\n if (document.querySelector(`script[src^=\"${src}\"]`)) {\n return Promise.resolve()\n }\n\n loadedScripts.set(src.toString(), (prom = appendScript(src)))\n return prom\n } else {\n return appendScript(src)\n }\n }\n\n function fetchStyleSheet(href: string): Promise {\n let prom: Promise | undefined = styleSheets.get(href)\n if (prom) {\n return prom\n }\n\n styleSheets.set(\n href,\n (prom = fetch(href, { credentials: 'same-origin' })\n .then((res) => {\n if (!res.ok) {\n throw new Error(`Failed to load stylesheet: ${href}`)\n }\n return res.text().then((text) => ({ href: href, content: text }))\n })\n .catch((err) => {\n throw markAssetError(err)\n }))\n )\n return prom\n }\n\n return {\n whenEntrypoint(route: string) {\n return withFuture(route, entrypoints)\n },\n onEntrypoint(route: string, execute: undefined | (() => unknown)) {\n ;(execute\n ? Promise.resolve()\n .then(() => execute())\n .then(\n (exports: any) => ({\n component: (exports && exports.default) || exports,\n exports: exports,\n }),\n (err) => ({ error: err })\n )\n : Promise.resolve(undefined)\n ).then((input: RouteEntrypoint | undefined) => {\n const old = entrypoints.get(route)\n if (old && 'resolve' in old) {\n if (input) {\n entrypoints.set(route, input)\n old.resolve(input)\n }\n } else {\n if (input) {\n entrypoints.set(route, input)\n } else {\n entrypoints.delete(route)\n }\n // when this entrypoint has been resolved before\n // the route is outdated and we want to invalidate\n // this cache entry\n routes.delete(route)\n }\n })\n },\n loadRoute(route: string, prefetch?: boolean) {\n return withFuture(route, routes, () => {\n let devBuildPromiseResolve: () => void\n\n if (process.env.NODE_ENV === 'development') {\n devBuildPromise = new Promise((resolve) => {\n devBuildPromiseResolve = resolve\n })\n }\n\n return resolvePromiseWithTimeout(\n getFilesForRoute(assetPrefix, route)\n .then(({ scripts, css }) => {\n return Promise.all([\n entrypoints.has(route)\n ? []\n : Promise.all(scripts.map(maybeExecuteScript)),\n Promise.all(css.map(fetchStyleSheet)),\n ] as const)\n })\n .then((res) => {\n return this.whenEntrypoint(route).then((entrypoint) => ({\n entrypoint,\n styles: res[1],\n }))\n }),\n MS_MAX_IDLE_DELAY,\n markAssetError(new Error(`Route did not complete loading: ${route}`))\n )\n .then(({ entrypoint, styles }) => {\n const res: RouteLoaderEntry = Object.assign<\n { styles: RouteStyleSheet[] },\n RouteEntrypoint\n >({ styles: styles! }, entrypoint)\n return 'error' in entrypoint ? entrypoint : res\n })\n .catch((err) => {\n if (prefetch) {\n // we don't want to cache errors during prefetch\n throw err\n }\n return { error: err }\n })\n .finally(() => devBuildPromiseResolve?.())\n })\n },\n prefetch(route: string): Promise {\n // https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118\n // License: Apache 2.0\n let cn\n if ((cn = (navigator as any).connection)) {\n // Don't prefetch if using 2G or if Save-Data is enabled.\n if (cn.saveData || /2g/.test(cn.effectiveType)) return Promise.resolve()\n }\n return getFilesForRoute(assetPrefix, route)\n .then((output) =>\n Promise.all(\n canPrefetch\n ? output.scripts.map((script) =>\n prefetchViaDom(script.toString(), 'script')\n )\n : []\n )\n )\n .then(() => {\n requestIdleCallback(() => this.loadRoute(route, true).catch(() => {}))\n })\n .catch(\n // swallow prefetch errors\n () => {}\n )\n },\n }\n}\n","/* global window */\nimport React from 'react'\nimport Router from '../shared/lib/router/router'\nimport type { NextRouter } from '../shared/lib/router/router'\nimport { RouterContext } from '../shared/lib/router-context.shared-runtime'\nimport isError from '../lib/is-error'\n\ntype SingletonRouterBase = {\n router: Router | null\n readyCallbacks: Array<() => any>\n ready(cb: () => any): void\n}\n\nexport { Router }\n\nexport type { NextRouter }\n\nexport type SingletonRouter = SingletonRouterBase & NextRouter\n\nconst singletonRouter: SingletonRouterBase = {\n router: null, // holds the actual router instance\n readyCallbacks: [],\n ready(callback: () => void) {\n if (this.router) return callback()\n if (typeof window !== 'undefined') {\n this.readyCallbacks.push(callback)\n }\n },\n}\n\n// Create public properties and methods of the router in the singletonRouter\nconst urlPropertyFields = [\n 'pathname',\n 'route',\n 'query',\n 'asPath',\n 'components',\n 'isFallback',\n 'basePath',\n 'locale',\n 'locales',\n 'defaultLocale',\n 'isReady',\n 'isPreview',\n 'isLocaleDomain',\n 'domainLocales',\n] as const\nconst routerEvents = [\n 'routeChangeStart',\n 'beforeHistoryChange',\n 'routeChangeComplete',\n 'routeChangeError',\n 'hashChangeStart',\n 'hashChangeComplete',\n] as const\nexport type RouterEvent = (typeof routerEvents)[number]\n\nconst coreMethodFields = [\n 'push',\n 'replace',\n 'reload',\n 'back',\n 'prefetch',\n 'beforePopState',\n] as const\n\n// Events is a static property on the router, the router doesn't have to be initialized to use it\nObject.defineProperty(singletonRouter, 'events', {\n get() {\n return Router.events\n },\n})\n\nfunction getRouter(): Router {\n if (!singletonRouter.router) {\n const message =\n 'No router instance found.\\n' +\n 'You should only use \"next/router\" on the client side of your app.\\n'\n throw new Error(message)\n }\n return singletonRouter.router\n}\n\nurlPropertyFields.forEach((field) => {\n // Here we need to use Object.defineProperty because we need to return\n // the property assigned to the actual router\n // The value might get changed as we change routes and this is the\n // proper way to access it\n Object.defineProperty(singletonRouter, field, {\n get() {\n const router = getRouter()\n return router[field] as string\n },\n })\n})\n\ncoreMethodFields.forEach((field) => {\n // We don't really know the types here, so we add them later instead\n ;(singletonRouter as any)[field] = (...args: any[]) => {\n const router = getRouter() as any\n return router[field](...args)\n }\n})\n\nrouterEvents.forEach((event) => {\n singletonRouter.ready(() => {\n Router.events.on(event, (...args) => {\n const eventField = `on${event.charAt(0).toUpperCase()}${event.substring(\n 1\n )}`\n const _singletonRouter = singletonRouter as any\n if (_singletonRouter[eventField]) {\n try {\n _singletonRouter[eventField](...args)\n } catch (err) {\n console.error(`Error when running the Router event: ${eventField}`)\n console.error(\n isError(err) ? `${err.message}\\n${err.stack}` : err + ''\n )\n }\n }\n })\n })\n})\n\n// Export the singletonRouter and this is the public API.\nexport default singletonRouter as SingletonRouter\n\n// Reexport the withRouter HOC\nexport { default as withRouter } from './with-router'\n\n/**\n * This hook gives access the [router object](https://nextjs.org/docs/pages/api-reference/functions/use-router#router-object)\n * inside the [Pages Router](https://nextjs.org/docs/pages/building-your-application).\n *\n * Read more: [Next.js Docs: `useRouter`](https://nextjs.org/docs/pages/api-reference/functions/use-router)\n */\nexport function useRouter(): NextRouter {\n const router = React.useContext(RouterContext)\n if (!router) {\n throw new Error(\n 'NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted'\n )\n }\n\n return router\n}\n\n/**\n * Create a router and assign it as the singleton instance.\n * This is used in client side when we are initializing the app.\n * This should **not** be used inside the server.\n * @internal\n */\nexport function createRouter(\n ...args: ConstructorParameters\n): Router {\n singletonRouter.router = new Router(...args)\n singletonRouter.readyCallbacks.forEach((cb) => cb())\n singletonRouter.readyCallbacks = []\n\n return singletonRouter.router\n}\n\n/**\n * This function is used to create the `withRouter` router instance\n * @internal\n */\nexport function makePublicRouterInstance(router: Router): NextRouter {\n const scopedRouter = router as any\n const instance = {} as any\n\n for (const property of urlPropertyFields) {\n if (typeof scopedRouter[property] === 'object') {\n instance[property] = Object.assign(\n Array.isArray(scopedRouter[property]) ? [] : {},\n scopedRouter[property]\n ) // makes sure query is not stateful\n continue\n }\n\n instance[property] = scopedRouter[property]\n }\n\n // Events is a static property on the router, the router doesn't have to be initialized to use it\n instance.events = Router.events\n\n coreMethodFields.forEach((field) => {\n instance[field] = (...args: any[]) => {\n return scopedRouter[field](...args)\n }\n })\n\n return instance\n}\n","'use client'\n\nimport ReactDOM from 'react-dom'\nimport React, { useEffect, useContext, useRef, type JSX } from 'react'\nimport type { ScriptHTMLAttributes } from 'react'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport { setAttributesFromProps } from './set-attributes-from-props'\nimport { requestIdleCallback } from './request-idle-callback'\n\nconst ScriptCache = new Map()\nconst LoadCache = new Set()\n\nexport interface ScriptProps extends ScriptHTMLAttributes {\n strategy?: 'afterInteractive' | 'lazyOnload' | 'beforeInteractive' | 'worker'\n id?: string\n onLoad?: (e: any) => void\n onReady?: () => void | null\n onError?: (e: any) => void\n children?: React.ReactNode\n stylesheets?: string[]\n}\n\n/**\n * @deprecated Use `ScriptProps` instead.\n */\nexport type Props = ScriptProps\n\nconst insertStylesheets = (stylesheets: string[]) => {\n // Case 1: Styles for afterInteractive/lazyOnload with appDir injected via handleClientScriptLoad\n //\n // Using ReactDOM.preinit to feature detect appDir and inject styles\n // Stylesheets might have already been loaded if initialized with Script component\n // Re-inject styles here to handle scripts loaded via handleClientScriptLoad\n // ReactDOM.preinit handles dedup and ensures the styles are loaded only once\n if (ReactDOM.preinit) {\n stylesheets.forEach((stylesheet: string) => {\n ReactDOM.preinit(stylesheet, { as: 'style' })\n })\n\n return\n }\n\n // Case 2: Styles for afterInteractive/lazyOnload with pages injected via handleClientScriptLoad\n //\n // We use this function to load styles when appdir is not detected\n // TODO: Use React float APIs to load styles once available for pages dir\n if (typeof window !== 'undefined') {\n let head = document.head\n stylesheets.forEach((stylesheet: string) => {\n let link = document.createElement('link')\n\n link.type = 'text/css'\n link.rel = 'stylesheet'\n link.href = stylesheet\n\n head.appendChild(link)\n })\n }\n}\n\nconst loadScript = (props: ScriptProps): void => {\n const {\n src,\n id,\n onLoad = () => {},\n onReady = null,\n dangerouslySetInnerHTML,\n children = '',\n strategy = 'afterInteractive',\n onError,\n stylesheets,\n } = props\n\n const cacheKey = id || src\n\n // Script has already loaded\n if (cacheKey && LoadCache.has(cacheKey)) {\n return\n }\n\n // Contents of this script are already loading/loaded\n if (ScriptCache.has(src)) {\n LoadCache.add(cacheKey)\n // It is possible that multiple `next/script` components all have same \"src\", but has different \"onLoad\"\n // This is to make sure the same remote script will only load once, but \"onLoad\" are executed in order\n ScriptCache.get(src).then(onLoad, onError)\n return\n }\n\n /** Execute after the script first loaded */\n const afterLoad = () => {\n // Run onReady for the first time after load event\n if (onReady) {\n onReady()\n }\n // add cacheKey to LoadCache when load successfully\n LoadCache.add(cacheKey)\n }\n\n const el = document.createElement('script')\n\n const loadPromise = new Promise((resolve, reject) => {\n el.addEventListener('load', function (e) {\n resolve()\n if (onLoad) {\n onLoad.call(this, e)\n }\n afterLoad()\n })\n el.addEventListener('error', function (e) {\n reject(e)\n })\n }).catch(function (e) {\n if (onError) {\n onError(e)\n }\n })\n\n if (dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n el.innerHTML = (dangerouslySetInnerHTML.__html as string) || ''\n\n afterLoad()\n } else if (children) {\n el.textContent =\n typeof children === 'string'\n ? children\n : Array.isArray(children)\n ? children.join('')\n : ''\n\n afterLoad()\n } else if (src) {\n el.src = src\n // do not add cacheKey into LoadCache for remote script here\n // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)\n\n ScriptCache.set(src, loadPromise)\n }\n\n setAttributesFromProps(el, props)\n\n if (strategy === 'worker') {\n el.setAttribute('type', 'text/partytown')\n }\n\n el.setAttribute('data-nscript', strategy)\n\n // Load styles associated with this script\n if (stylesheets) {\n insertStylesheets(stylesheets)\n }\n\n document.body.appendChild(el)\n}\n\nexport function handleClientScriptLoad(props: ScriptProps) {\n const { strategy = 'afterInteractive' } = props\n if (strategy === 'lazyOnload') {\n window.addEventListener('load', () => {\n requestIdleCallback(() => loadScript(props))\n })\n } else {\n loadScript(props)\n }\n}\n\nfunction loadLazyScript(props: ScriptProps) {\n if (document.readyState === 'complete') {\n requestIdleCallback(() => loadScript(props))\n } else {\n window.addEventListener('load', () => {\n requestIdleCallback(() => loadScript(props))\n })\n }\n}\n\nfunction addBeforeInteractiveToCache() {\n const scripts = [\n ...document.querySelectorAll('[data-nscript=\"beforeInteractive\"]'),\n ...document.querySelectorAll('[data-nscript=\"beforePageRender\"]'),\n ]\n scripts.forEach((script) => {\n const cacheKey = script.id || script.getAttribute('src')\n LoadCache.add(cacheKey)\n })\n}\n\nexport function initScriptLoader(scriptLoaderItems: ScriptProps[]) {\n scriptLoaderItems.forEach(handleClientScriptLoad)\n addBeforeInteractiveToCache()\n}\n\n/**\n * Load a third-party scripts in an optimized way.\n *\n * Read more: [Next.js Docs: `next/script`](https://nextjs.org/docs/app/api-reference/components/script)\n */\nfunction Script(props: ScriptProps): JSX.Element | null {\n const {\n id,\n src = '',\n onLoad = () => {},\n onReady = null,\n strategy = 'afterInteractive',\n onError,\n stylesheets,\n ...restProps\n } = props\n\n // Context is available only during SSR\n const { updateScripts, scripts, getIsSsr, appDir, nonce } =\n useContext(HeadManagerContext)\n\n /**\n * - First mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)\n * onReady is skipped, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. hasLoadScriptEffectCalled.current is false, loadScript executes\n * Once the script is loaded, the onLoad and onReady will be called by then\n * [If strict mode is enabled / is wrapped in component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n *\n * - Second mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)\n * onReady is called, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. The script is already loaded, loadScript bails out\n * [If strict mode is enabled / is wrapped in component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n */\n const hasOnReadyEffectCalled = useRef(false)\n\n useEffect(() => {\n const cacheKey = id || src\n if (!hasOnReadyEffectCalled.current) {\n // Run onReady if script has loaded before but component is re-mounted\n if (onReady && cacheKey && LoadCache.has(cacheKey)) {\n onReady()\n }\n\n hasOnReadyEffectCalled.current = true\n }\n }, [onReady, id, src])\n\n const hasLoadScriptEffectCalled = useRef(false)\n\n useEffect(() => {\n if (!hasLoadScriptEffectCalled.current) {\n if (strategy === 'afterInteractive') {\n loadScript(props)\n } else if (strategy === 'lazyOnload') {\n loadLazyScript(props)\n }\n\n hasLoadScriptEffectCalled.current = true\n }\n }, [props, strategy])\n\n if (strategy === 'beforeInteractive' || strategy === 'worker') {\n if (updateScripts) {\n scripts[strategy] = (scripts[strategy] || []).concat([\n {\n id,\n src,\n onLoad,\n onReady,\n onError,\n ...restProps,\n },\n ])\n updateScripts(scripts)\n } else if (getIsSsr && getIsSsr()) {\n // Script has already loaded during SSR\n LoadCache.add(id || src)\n } else if (getIsSsr && !getIsSsr()) {\n loadScript(props)\n }\n }\n\n // For the app directory, we need React Float to preload these scripts.\n if (appDir) {\n // Injecting stylesheets here handles beforeInteractive and worker scripts correctly\n // For other strategies injecting here ensures correct stylesheet order\n // ReactDOM.preinit handles loading the styles in the correct order,\n // also ensures the stylesheet is loaded only once and in a consistent manner\n //\n // Case 1: Styles for beforeInteractive/worker with appDir - handled here\n // Case 2: Styles for beforeInteractive/worker with pages dir - Not handled yet\n // Case 3: Styles for afterInteractive/lazyOnload with appDir - handled here\n // Case 4: Styles for afterInteractive/lazyOnload with pages dir - handled in insertStylesheets function\n if (stylesheets) {\n stylesheets.forEach((styleSrc) => {\n ReactDOM.preinit(styleSrc, { as: 'style' })\n })\n }\n\n // Before interactive scripts need to be loaded by Next.js' runtime instead\n // of native