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AGA,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,KAA8C,CADzC,CAEnC,EAA2B,EAAQ,KAA8C,CADpD,CAE7B,EAA0B,EAAQ,KAA2C,CAD3C,CAElC,qJCbA,qCAA6C,CAC7C,QACA,CAAC,EA8DD,SANA,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,8B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ACD,UAOA,4BAIY,EAAO,WAEnB,CAAK,CACL,EACA,MAIA,eAEA,EACA,aACA,2BACA,CACA,aAIA,sCAEA,gCC5DA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,sCAAqD,CACrD,cACA,eACA,mCACA,CACA,CAAC,EAAC,IACF,EAAoC,EAAQ,KAAiC,YAAlC,mBCT3C,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,iDAAgE,CAChE,cACA,eACA,QACA,CACA,CAAC,EAAC,IAEF,OADmC,KAAuB,EAC1D,UADkC,aAClC,kCCVA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,yCAAwD,CACxD,cACA,eACA,uCAEA,CAAC,EAAC,IACF,EAAuC,EAAQ,IAAqC,aAAtC,iBCT9C,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,EAAC,SA0BF,KACA,0CACA,cACA,QACA,CAAK,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,KAAO,GACrE,EAA4B,EAAQ,KADyB,EAE7D,EAAiC,EAAQ,KAAmD,CADzD,CAEnC,EAAsC,EAAQ,KAAoC,CAD1C,CAExC,EAAkC,EAAQ,KAA2C,CADxC,CAE7C,EAA+B,EAAQ,IAA4B,EACnE,EAA2B,EAAQ,KAAuC,EADpC,EAOtC,QANkC,IAMlC,mCACA,cACA,OACA,yBACA,mBACA,6BACA,8BACA,CACA,CACA,aACA,OACA,uBACA,sBACA,sBACA,wBACA,iBAEA,CACA,cACA,MACA,0DAEA,kBACA,QACA,+CAUA,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,GAL8G,CAK9G,CALgH,EAEvG,IAIT,oCACA,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,8BACA,GACA,qCACA,0BACA,8BACA,mBAGA,0BAIA,SACA,WAAmD,GAAO,kEAAkE,EAAW,GACvI,CACA,QACA,YAAoB,iBAAe,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,mCAEA,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,KAA4B,EAChE,UADmC,CACnC,GACA,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,EACD,2CAAmD,CACnD,cACA,eACA,kCAEA,CAAC,EAAC,IACF,EAAkC,EAAQ,KAA+B,YAAhC,oBCTzC,qCAA6C,CAC7C,QACA,CAAC,EAAC,SAOF,KACA,0CACA,cACA,SACK,CACL,EACA,GACA,mCACA,QACA,CAAK,CACL,uCACA,QACA,CAAK,CACL,oCACA,QACA,CAAK,CACL,gCACA,sCAEA,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,KAAO,GACtE,SAD8D,EAC9D,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,6BCtDD,gBACA,0BACA,gCACA,gCAAqD,GAAY,sGAAsG,GAAY,uJACnL,CAAS,EACT,OACA,CAAS,CACT,CAAK,EAKL,OADA,WACA,CACA,CACA,cAvBA,qCAA6C,CAC7C,QACA,CAAC,EACD,6CAAqD,CACrD,cACA,eACA,QACA,CACA,CAAC,EAAC,8BCdF,qCAA6C,CAC7C,QACA,CAAC,EAYD,SANA,KACA,0CACA,cACA,SACK,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,EACD,uDAA+D,CAC/D,cACA,eACA,QACA,CACA,CAAC,EAAC,EACuB,KAAwC,EACzC,EAAQ,IAAkC,EADlE,EAAwB,EAExB,EAAe,EAAQ,GADQ,EACC,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,EAcD,SANA,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,IAAkC,EAClE,EAAe,EAAQ,KAAS,EAChC,EAA+B,EAAQ,IAA4B,EAD7C,EAE4B,EAAQ,KAAmD,EADvE,SAGtC,CAFyD,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,aAoDA,kBACA,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,CAAqB,CACrB,cACA,eACA,CAAiB,GAGjB,UAGA,CAAK,EACL,CACA,EAtHA,QAEA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ACA,gBACA,oBACA,uBACA,aAEA,CAEA,aACA,CACA,cACA,iBAGA,yBAAiC,EAEjC,+CACA,wBAIA,0DAKA,kBAA6B,CAC7B,CACA,uBACA,cAGA,kBAAiC,EAEjC,qBAEA,SAqBA,KACA,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,EAoNjC,cACA,eACA,KACA,SAKA,yBAgDA,OA/CA,WACA,2BACA,UAEA,qBACA,oBACA,2BACA,eACA,cACA,qBAGA,WACA,YACA,cAGA,aAGA,aACA,eACA,iBAEA,K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A,mBACA,iCACA,CACA,8DAAoE,CACpE,EACA,cAAoB,eACpB,MACA,4DACA,GACA,IACA,gBACA,gBACA,gBAEA,oBACA,OA9BA,gBACA,MACA,4DACA,OACA,WACA,sBACA,WACA,gBACA,gBACA,CACA,EAoBA,WACA,EACA,WAAiB,aACjB,UACA,MACA,IACA,8BACA,EAAI,OACJ,MACA,MACA,OACA,CACA,EACA,YAAkB,eAClB,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,OADC,CACD,GA0CrB,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,OACA,CACA,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,mBACA,UACA,cACA,OACA,SACA,cACA,CACA,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,UACA,4BACA,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,oBAEA,YAEA,SACA,YAEA,OADA,aAEA,sBACA,WACA,qBACA,gBACA,uBACA,EAsBA,GACA,IACA,CACA,oBACA,6BACA,gBA1QA,KACA,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,oBAEA,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,OADA,WACA,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,OACA,EAEA,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,OACA,EACA,EADA,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,MAXA,CADA,GAAW,KADX,EAaA,YACA,cACA,YACA,oFAEA,iBACA,KACA,aACA,YACA,CAAgB,qBAAyB,CACzC,KACA,EAEA,UACA,CACA,cACO,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,QAJA,GACA,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,QACA,CA5QA,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,GADA,cACA,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,SACA,CACA,EADA,cACA,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,iBACA,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,iBACA,kBACA,CAAY,SACZ,GACA,oBACA,UACA,0BACA,CACA,IACA,UAaA,OAZA,aACA,IACA,aACA,IACA,iBACA,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,MAEA,CADA,eACA,EACA,OACA,IACA,cACA,GAEA,2BACA,gBACA,qBACA,cAEA,GACA,mCACA,4BAEA,gBAvMA,GACA,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,GADA,WAEA,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,YACK,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,oBAIA,MADA,UACA,KACA,KACA,EACA,EACA,EACA,EACA,QAEA,iBACA,6BACA,SA3HA,YACA,iBACA,gBACA,cACA,gBACA,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,KACvC,CACU,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,MAEJ,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,mBACA,aACA,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,6DC3hBb,kBAAqD,+BCArD,kBAAiE,+BCFnE,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,8CAA6D,CAC7D,cACA,eACA,QACA,CACA,CAAC,EAAC,IAEF,KAD2B,EAAQ,KAAuB,EAC1D,UADkC,aAClC,gCCVA,qCAA6C,CAC7C,QACA,CAAC,EAYD,SANA,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,gCCnEA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,4CAA2D,CAC3D,cACA,eACA,QACA,CACA,CAAC,EAAC,IAEF,KAD2B,EAAQ,KAAuB,EAC1D,UADkC,aAClC,kCCVA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,gDAA+D,CAC/D,cACA,eACA,QACA,CACA,CAAC,EAAC,IAEF,KAD2B,EAAQ,KAAuB,EAC1D,UADkC,aAClC,eCVA,IAOA,EACA,EAkFA,EA1FA,eAUA,aACA,8CACA,CACA,aACA,gDACA,CAqBA,cACA,kBAEA,uBAGA,2BAEA,OADA,aACA,gBAEA,IAEA,aACA,CAAM,SACN,IAEA,uBACA,CAAU,SAEV,uBACA,CACA,CAGA,EA5CA,WACA,IAEA,EADA,8BACA,WAEA,CAEA,CAAM,SACN,GACA,CACA,IAEA,EADA,gCACA,aAEA,CAEA,CAAM,SACN,GACA,CACA,EAAE,EAqDF,SACA,KAEA,KAEA,aACA,OAGA,KACA,SACA,cAEA,KAEA,UACA,IAEA,CAEA,aACA,OAGA,WACA,KAGA,IADA,eACA,IAGA,IAFA,IACA,KACA,OACA,GACA,WAGA,KACA,WAEA,OACA,KACA,SApEA,GACA,oBAEA,uBAGA,6BAEA,OADA,eACA,gBAEA,IAEA,IACA,CAAM,SACN,IAEA,qBACA,CAAU,SAGV,qBACA,CACA,CAIA,EA0CA,GACA,CAgBA,gBACA,WACA,YACA,CAWA,cA5BA,uBACA,gCACA,sBACA,YAAwB,mBAAsB,IAC9C,oBAGA,mBACA,iBACA,IAEA,EAOA,2BACA,+BACA,EACA,kBACA,aACA,SACA,UACA,aACA,CADsB,CACtB,YAIA,OACA,gBACA,SACA,QACA,mBACA,uBACA,SACA,oBACA,wBAEA,wBAAsC,UAEtC,sBACA,+CACA,EAEA,iBAA4B,W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C,GACA,GAAQ,QAAS,KAhJmB,EAiJpC,OAGA,IAAY,iCAA+B,EAE3C,QAA0C,KAAmB,EAG7D,cACA,OAGA,WAAY,8BAAiC,EAQ7C,GACA,UACA,QACA,iBACA,cACA,EAEA,EAAkB,GAAuC,GAErD,QAAa,CACjB,CACA,eACA,KAlBA,CACA,EAYyD,KAZzD,EACA,MACA,aACA,EAeA,YACA,OACA,CAAO,CACP,EAEA,GArLA,SACQ,YA2LR,GACA,GAAQ,QAAS,IA5LqB,GA6LtC,OAGA,mBAAY,kBAA+B,EAG3C,SAIA,mEAKA,YACA,kBACA,GACA,aACA,aACA,iBACA,cACA,EAEM,QAAa,CACnB,CACA,iBACA,OACA,cACA,WACA,CAAS,CACT,EAEA,EAAM,IACN,iBACA,GACA,eACA,yBAEA,GACA,aACA,WACA,iBACA,cACA,EACA,EAAoB,GAAuC,eAErD,QAAa,CACnB,CACA,WAJ2D,MAK3D,OACA,YACA,OACA,CAAS,CACT,EAEA,EACA,GApPA,WACQ,OAAgC,UA0PxC,GACA,GAAQ,QAAS,KA3PuB,EA4PxC,OAGA,aACA,OACA,EAAsB,GAAS,GAAM,EAAP,MAAO,OACrC,IAA4B,GAAQ,UACpC,EAAqB,GAAQ,GAG7B,EAH6B,CAG7B,QACA,MAKA,0CACA,eAEA,0CACA,eAGI,QAAa,EACjB,sBACA,MACA,OACA,IACA,CAAO,CACF,CACL,GAxRA,UACA,gCAYA,GACQ,QAAS,KAbjB,GAiBI,QAAa,CACjB,CACA,mBAA4B,6CAAuD,EACnF,oBACA,cACA,QAAiB,QAAmB,GACpC,CAAO,CACP,CACA,OACA,CAAO,CAEP,EA1BA,CACA,CACA,CAAC,CCzCD,IACA,cACA,SACA,OACA,mBACA,iBACA,mBACA,oBACA,kBACA,cACA,aACA,qBACA,cACA,aACA,iBACA,eACA,kBACA,cACA,cACA,eACA,qBACA,SACA,eACA,YACA,eACA,gBACA,YACA,kBACA,SACA,iBACA,4BACA,uBACA,CA+CA,GA3CA,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ACA,KACA,IAEA,eAMA,GALA,aACA,0BACA,WAGA,GACA,sBACA,GACA,QAEA,CAEA,eAA6B,0DAAmE,CAChG,CAEA,cACA,OACA,oBACA,0BACA,gBACA,YACA,gBACA,gBACA,qBACA,CACA,CA4CA,cACA,mCACA,MA5CA,YACA,IAAO,GAAW,CAClB,SAGA,SAAU,0BAA4B,QAWtC,CATA,4CACA,QACA,QACM,IAAM,8BAA8B,GAAW,UACrD,OASA,iBA1FA,SA+FA,GA/FA,UA+FA,GAKA,6BACI,IAAM,2CAA2C,EAAK,GAC1D,KANI,IAAM,+CAA+C,EAAS,GAClE,KANI,IAAM,gDAAgD,EAAU,GACpE,IAcA,EAQA,GAGA,QACA,gCCzGA,aACA,gFACA,CAKA,aAEA,WACA,kMCpBA,mBACA,YAQA,gBACA,WACA,mBASA,WACA,EACA,GAIA,aAFA,KAEA,CACA,gBAGA,GAFA,OAGA,QAEA,CAEA,QACA,CAYA,cACA,OAAS,GAAU,aAAe,GAAU,2BACtC,GAAU,8BAChB,2BACA,CAcA,cACA,WAGA,oBAEA,cACA,mBACA,kCAEA,iCAEA,CAEA,gBACA,WAIA,GAFA;AAAA,EAAgB,4BAA4B;AAAA,GAE5C,4CACA,SACM,CACN,MACA,IACA,mBACA,CAAQ,SAIR,iBAA4C,QAAS,IACrD,CACA,IACA,CACA,CAEA,oCAGA,GAGA,qBAFA,+BAGA,IACA,eACA,WACA,YAGA,QACA,EAdA,EACA,CAuDA,cAKA,OAJA,CACA,WACA,EAEA,EACA,CAKA,cACA,+CAEA,OACI,QAAiB,EACrB,kBACA,gBACA,oBACA,2BACA,iCACK,EACL,EACA,CAGA,OACA,kBACA,mBACA,wBACA,0BACA,cACA,yBACA,sBACA,kBACA,wBACA,sBACA,0BACA,mBACA,oBACA,YACA,sBACA,EAKA,cACA,YAIA,cACA,cACA,OAEA,IAAU,kBAAgB,MAC1B,YAAW,YACX,CAMA,WACA,EACA,EACA,EACA,GAEA,8EACA,OACA,oBACA,iCACA,OAAqB,MAAc,CACnC,YAA6B,IAAK,QAAW,IAAO,CACpD,OACA,MAAa,QAAiB,EAAG,KAA2B,CAC5D,CAAK,CAEL,yGClPA,SACA,KAGA,gBACA,cACA,YACA,CAaA,gBACA,OACA,IACA,QAEA,CAGA,gBACA,cACA,KAIA,eACA,IACA,IACA,CAAM,SACA,GAAW,EACT,IAAM,OACd;AAAA,QAAoE,KAAK;AAAA,QAAU,QAAe,UAAU;AAAA,QAC5G,EAEA,CAEA,gLCjDA,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,oCDSA,EAAK,MCTgD,CDSjC,IACuD,qBAA3E,oCAAiD,IAAP,EAA0B,EAAO,GAA1B,EAA0B,KCH5D,IAAf,EAAK,CAAU,uBAA8B,GAAU,cANvD,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,CAsCA,MAAe,OAAkB,UApCjC,WACA,SACA,GACA,YACA,IACA,CAAK,CACL,aACA,IACA,CAAK,CACL,eACA,EAmBA,OAjBM,GAAW,CACjB,cAEA,cACA,GACA,OACY,GAAU,eAAkB,OAAO,QAAG,KAAK,MACvD,CAAW,CAEX,CACA,CAAK,EAEL,cACA,eACA,CAAK,EAG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U,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,8FCrIA,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,CAGA,SAAc,kBACd,6BACA,EAGA,UAAe,iBACf,6BACA,EAGA,UAAe,wBACf,4BAIA,GAAQ,QAAU,KAClB,mCACA,MACA,CAEA,cACA,cAEA,wBACA,EAGA,UAAe,2BACf,2BACA,OAGA,4BACA,mBAEA,cACA,OAIA,0BACA,kBAGA,0BACA,kBAGA,QACA,CAAK,CACL,EACA,mFC9KA,aACA,kBAbA,GAcA,CA0CA,MAlCA,WACA,gBAAU,GAAc,EAAE,CAAU,CACpC,cACA,SAKA,yBACA,sCAWA,UACA,YA3CA,GA6CA,IAsBA,QAKA,gBAAU,GAAc,EAAE,CAAU,CACpC,cAEA,OAIA,cACA,aAGA,eACA,2BANA,KAgBA,qCAGA,EAFA,mBAEA,gBAnBA,YAQA,EARA,MAoBA,EApBA,KAwBA,KAEA,aAGA,EAMA,EACA,CAAC,sFChHD,aACA,6DA0CA,WACA,EACA,GAEA,MAhCA,gBAUA,EATA,MACA,OAGA,iBACA,KAWA,MANA,WACA,KACI,YACJ,OAGA,CACA,aACA,gBACA,iBACA,CACA,EAUA,GACA,EAAiC,QAAqC,IAEtE,CAAU,0CAAuC,aAEjD,EAMA,CACA,WAA0B,QAAK,GAC/B,gBAAoC,QAAK,iBACzC,OAAc,QAAK,iBACnB,UACA,SAAuC,EAVvC,CACA,WAA0B,QAAK,GAC/B,OAAc,QAAK,gBACnB,CAUA,CAKA,WACA,EAAY,QAAK,GACjB,EAAW,QAAK,iBAChB,GAEA,SAIA,OAHA,YACA,gBAEA,GAAY,EAAQ,GAAG,EAAO,EAAE,EAAc,iDCpF9C,oFCGA,iBAaA,kBACA,WACA,+BAA2D,CAC3D,IAAuC,GAAW,IAAe,GAAW,KAAO,CACnF,uBACA,gCCrBA,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/next/dist/build/deployment-id.js?cfd0","webpack://_N_E/./node_modules/next/dist/build/polyfills/polyfill-module.js?2e05","webpack://_N_E/../client/add-base-path.ts","webpack://_N_E/../client/add-locale.ts","webpack://_N_E/../client/app-bootstrap.ts","webpack://_N_E/../client/app-build-id.ts","webpack://_N_E/../client/app-call-server.ts","webpack://_N_E/../client/app-find-source-map-url.ts","webpack://_N_E/../client/app-index.tsx","webpack://_N_E/../client/app-next.ts","webpack://_N_E/../client/app-webpack.ts","webpack://_N_E/../client/assign-location.ts","webpack://_N_E/../../../src/client/components/app-router-announcer.tsx","webpack://_N_E/../../../src/client/components/app-router-headers.ts","webpack://_N_E/../../../src/client/components/app-router.tsx","webpack://_N_E/../../../src/client/components/bailout-to-client-rendering.ts","webpack://_N_E/../../../src/client/components/client-page.tsx","webpack://_N_E/../../../src/client/components/client-segment.tsx","webpack://_N_E/../../../src/client/components/error-boundary.tsx","webpack://_N_E/../../../src/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/../../../src/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/../../../src/client/components/is-hydration-error.ts","webpack://_N_E/../../../src/client/components/is-next-router-error.ts","webpack://_N_E/../../../src/client/components/layout-router.tsx","webpack://_N_E/../../../src/client/components/match-segments.ts","webpack://_N_E/../../../src/client/components/nav-failure-handler.ts","webpack://_N_E/../../../src/client/components/navigation-untracked.ts","webpack://_N_E/../../../src/client/components/navigation.ts","webpack://_N_E/../../../src/client/components/navigation.react-server.ts","webpack://_N_E/../../../src/client/components/not-found.ts","webpack://_N_E/../../../src/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/../../../src/client/components/redirect-boundary.tsx","webpack://_N_E/../../../src/client/components/redirect-error.ts","webpack://_N_E/../../../src/client/components/redirect-status-code.ts","webpack://_N_E/../../../src/client/components/redirect.ts","webpack://_N_E/../../../src/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/../../../src/client/components/static-generation-bailout.ts","webpack://_N_E/../../../src/client/components/unauthorized.ts","webpack://_N_E/../../../src/client/components/unresolved-thenable.ts","webpack://_N_E/../../../src/client/components/unstable-rethrow.ts","webpack://_N_E/../../../src/client/components/use-reducer.ts","webpack://_N_E/../client/detect-domain-locale.ts","webpack://_N_E/../client/flight-data-helpers.ts","webpack://_N_E/../client/has-base-path.ts","webpack://_N_E/../../../src/client/lib/console.ts","webpack://_N_E/../client/normalize-trailing-slash.ts","webpack://_N_E/../../../src/client/react-client-callbacks/app-router.ts","webpack://_N_E/../../../src/client/react-client-callbacks/report-global-error.ts","webpack://_N_E/../../../src/client/react-client-callbacks/shared.ts","webpack://_N_E/../client/remove-base-path.ts","webpack://_N_E/../client/remove-locale.ts","webpack://_N_E/../client/request-idle-callback.ts","webpack://_N_E/../client/resolve-href.ts","webpack://_N_E/../client/route-loader.ts","webpack://_N_E/../client/router.ts","webpack://_N_E/../client/script.tsx","webpack://_N_E/../client/set-attributes-from-props.ts","webpack://_N_E/../client/trusted-types.ts","webpack://_N_E/../client/with-router.tsx","webpack://_N_E/./node_modules/next/dist/compiled/scheduler/cjs/scheduler.production.js","webpack://_N_E/./node_modules/next/dist/compiled/scheduler/index.js","webpack://_N_E/./node_modules/next/dist/export/helpers/is-dynamic-usage-error.js","webpack://_N_E/./node_modules/next/dist/lib/constants.js?e887","webpack://_N_E/./node_modules/next/dist/lib/is-api-route.js?2711","webpack://_N_E/./node_modules/next/dist/lib/is-error.js?e710","webpack://_N_E/../../../src/lib/metadata/metadata-boundary.tsx","webpack://_N_E/./node_modules/next/dist/lib/metadata/metadata-constants.js","webpack://_N_E/./node_modules/next/dist/lib/scheduler.js","webpack://_N_E/./node_modules/next/dist/server/app-render/action-async-storage.external.js","webpack://_N_E/./node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","webpack://_N_E/./node_modules/next/dist/server/app-render/after-task-async-storage.external.js","webpack://_N_E/./node_modules/next/dist/server/app-render/async-local-storage.js?6d2a","webpack://_N_E/./node_modules/next/dist/server/app-render/dynamic-rendering.js","webpack://_N_E/./node_modules/next/dist/server/app-render/get-segment-param.js","webpack://_N_E/./node_modules/next/dist/server/app-render/work-async-storage.external.js","webpack://_N_E/./node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","webpack://_N_E/./node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js","webpack://_N_E/./node_modules/next/dist/server/dynamic-rendering-utils.js","webpack://_N_E/./node_modules/next/dist/server/lib/interception-routes.js?0fd2","webpack://_N_E/./node_modules/next/dist/server/lib/router-utils/is-postpone.js","webpack://_N_E/./node_modules/next/dist/server/request/params.browser.js","webpack://_N_E/./node_modules/next/dist/server/request/params.js","webpack://_N_E/./node_modules/next/dist/server/request/search-params.browser.js","webpack://_N_E/./node_modules/next/dist/server/request/search-params.js","webpack://_N_E/./node_modules/next/dist/server/request/utils.js","webpack://_N_E/./node_modules/next/dist/server/web/spec-extension/adapters/reflect.js","webpack://_N_E/../../../src/shared/lib/app-router-context.shared-runtime.ts","webpack://_N_E/../../../src/shared/lib/bloom-filter.ts","webpack://_N_E/../../../src/shared/lib/encode-uri-path.ts","webpack://_N_E/../../../src/shared/lib/escape-regexp.ts","webpack://_N_E/../../../src/shared/lib/hash.ts","webpack://_N_E/../../../src/shared/lib/head-manager-context.shared-runtime.ts","webpack://_N_E/../../../src/shared/lib/hooks-client-context.shared-runtime.ts","webpack://_N_E/../../../../src/shared/lib/i18n/normalize-locale-path.ts","webpack://_N_E/../../../src/shared/lib/invariant-error.ts","webpack://_N_E/../../../src/shared/lib/is-plain-object.ts","webpack://_N_E/../../../src/shared/lib/is-thenable.ts","webpack://_N_E/../../../../src/shared/lib/lazy-dynamic/bailout-to-csr.ts","webpack://_N_E/../../../src/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/../../../src/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/path-has-prefix.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/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/../../../src/shared/lib/segment.ts","webpack://_N_E/../../../src/shared/lib/server-inserted-html.shared-runtime.tsx","webpack://_N_E/../../../src/shared/lib/utils.ts","webpack://_N_E/../../../../src/shared/lib/utils/warn-once.ts","webpack://_N_E/./node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.js","webpack://_N_E/./node_modules/next/dist/compiled/react-dom/client.js","webpack://_N_E/./node_modules/next/dist/compiled/react-dom/index.js","webpack://_N_E/./node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js","webpack://_N_E/./node_modules/next/dist/compiled/react-server-dom-webpack/client.browser.js","webpack://_N_E/./node_modules/next/dist/compiled/react-server-dom-webpack/client.js","webpack://_N_E/./node_modules/next/dist/compiled/react/cjs/react-jsx-runtime.production.js","webpack://_N_E/./node_modules/next/dist/compiled/react/cjs/react.production.js","webpack://_N_E/./node_modules/next/dist/compiled/react/index.js","webpack://_N_E/./node_modules/next/dist/compiled/react/jsx-runtime.js","webpack://_N_E/./node_modules/next/dist/server/app-render/action-async-storage-instance.js","webpack://_N_E/./node_modules/next/dist/server/app-render/async-local-storage.js","webpack://_N_E/./node_modules/next/dist/server/app-render/work-async-storage-instance.js","webpack://_N_E/./node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","webpack://_N_E/./node_modules/process/browser.js?47a6","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/debug-build.js?9b5e","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/getNativeImplementation.js?67a2","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/instrument/dom.js?32a5","webpack://_N_E/./node_modules/@sentry/utils/build/esm/vendor/supportsHistory.js?7804","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js?62b9","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js?5388","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/bindReporter.js?f1fc","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/generateUniqueID.js?9021","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/initMetric.js?0650","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js?f359","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/runOnce.js?3ec6","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/whenActivated.js?7054","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/onFCP.js?622a","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getCLS.js?21c1","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getFID.js?2251","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.js?52c4","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getINP.js?0e62","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/getLCP.js?711a","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/onTTFB.js?2690","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/instrument.js?47c7","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getActivationStart.js?9dd2","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getNavigationEntry.js?4ad4","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/getVisibilityWatcher.js?a568","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/onHidden.js?da69","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/types.js?8979","webpack://_N_E/./node_modules/@sentry/core/build/esm/defaultScopes.js?4e87","webpack://_N_E/./node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js?d106","webpack://_N_E/./node_modules/@sentry/core/build/esm/asyncContext/index.js?6c27","webpack://_N_E/./node_modules/@sentry/core/build/esm/breadcrumbs.js?9437","webpack://_N_E/./node_modules/@sentry/core/build/esm/carrier.js?5adc","webpack://_N_E/./node_modules/@sentry/core/build/esm/constants.js?9c56","webpack://_N_E/./node_modules/@sentry/core/build/esm/currentScopes.js?43a6","webpack://_N_E/./node_modules/@sentry/core/build/esm/debug-build.js?2b3d","webpack://_N_E/./node_modules/@sentry/core/build/esm/exports.js?ae9e","webpack://_N_E/./node_modules/@sentry/core/build/esm/metrics/metric-summary.js?3fa2","webpack://_N_E/./node_modules/@sentry/core/build/esm/scope.js?076b","webpack://_N_E/./node_modules/@sentry/core/build/esm/semanticAttributes.js?dc52","webpack://_N_E/./node_modules/@sentry/core/build/esm/session.js?86cc","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js?8473","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/spanstatus.js?4481","webpack://_N_E/./node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js?a3f6","webpack://_N_E/./node_modules/@sentry/core/build/esm/utils/isSentryRequestUrl.js?30d1","webpack://_N_E/./node_modules/@sentry/core/build/esm/utils/parseSampleRate.js?1278","webpack://_N_E/./node_modules/@sentry/core/build/esm/eventProcessors.js?e500","webpack://_N_E/./node_modules/@sentry/core/build/esm/utils/applyScopeDataToEvent.js?c527","webpack://_N_E/./node_modules/@sentry/core/build/esm/utils/prepareEvent.js?3593","webpack://_N_E/./node_modules/@sentry/core/build/esm/utils/spanOnScope.js?71f7","webpack://_N_E/./node_modules/@sentry/core/build/esm/utils/spanUtils.js?0057","webpack://_N_E/./node_modules/@sentry/core/build/esm/utils/sdkMetadata.js?0131","webpack://_N_E/./node_modules/@sentry/core/build/esm/integration.js?d3b9","webpack://_N_E/./node_modules/@sentry/core/build/esm/integrations/inboundfilters.js?72e0","webpack://_N_E/./node_modules/@sentry/core/build/esm/integrations/functiontostring.js?36bb","webpack://_N_E/./node_modules/@sentry/core/build/esm/integrations/dedupe.js?3d49","webpack://_N_E/./node_modules/@sentry/core/build/esm/sdk.js?252b","webpack://_N_E/./node_modules/@sentry/utils/build/esm/error.js?f279","webpack://_N_E/./node_modules/@sentry/utils/build/esm/clientreport.js?1336","webpack://_N_E/./node_modules/@sentry/core/build/esm/api.js?15f9","webpack://_N_E/./node_modules/@sentry/core/build/esm/envelope.js?d3c9","webpack://_N_E/./node_modules/@sentry/core/build/esm/baseclient.js?d431","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/debug-build.js?12b0","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/eventbuilder.js?6bb2","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/helpers.js?13e7","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/userfeedback.js?a91f","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/client.js?fef1","webpack://_N_E/./node_modules/@sentry/utils/build/esm/instrument/console.js?e27d","webpack://_N_E/./node_modules/@sentry/utils/build/esm/instrument/fetch.js?8c50","webpack://_N_E/./node_modules/@sentry/utils/build/esm/breadcrumb-log-level.js?7450","webpack://_N_E/./node_modules/@sentry/utils/build/esm/url.js?ec10","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/integrations/breadcrumbs.js?5891","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/integrations/browserapierrors.js?eed7","webpack://_N_E/./node_modules/@sentry/utils/build/esm/instrument/globalError.js?9995","webpack://_N_E/./node_modules/@sentry/utils/build/esm/instrument/globalUnhandledRejection.js?6af7","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/integrations/globalhandlers.js?f0f5","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/integrations/httpcontext.js?72e7","webpack://_N_E/./node_modules/@sentry/utils/build/esm/aggregate-errors.js?61a5","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/integrations/linkederrors.js?2d92","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/stack-parsers.js?11fe","webpack://_N_E/./node_modules/@sentry/utils/build/esm/promisebuffer.js?6a34","webpack://_N_E/./node_modules/@sentry/core/build/esm/transports/base.js?14f9","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/transports/fetch.js?f9c0","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/sdk.js?4674","webpack://_N_E/./node_modules/@sentry/react/build/esm/sdk.js?8b3d","webpack://_N_E/./node_modules/@sentry/nextjs/build/esm/common/getVercelEnv.js?737d","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/logSpans.js?1058","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/sampling.js?1e57","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/sentryNonRecordingSpan.js?1dd1","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/measurement.js?2b23","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/utils.js?f9fb","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/sentrySpan.js?7f09","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/trace.js?1d4e","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/utils.js?7a4f","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/cls.js?7e0c","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/browserMetrics.js?5342","webpack://_N_E/./node_modules/@sentry-internal/browser-utils/build/esm/metrics/inp.js?e51d","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/idleSpan.js?3c65","webpack://_N_E/./node_modules/@sentry/core/build/esm/tracing/errors.js?b669","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/tracing/backgroundtab.js?1811","webpack://_N_E/./node_modules/@sentry/core/build/esm/fetch.js?ef68","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/tracing/request.js?62a4","webpack://_N_E/./node_modules/@sentry/browser/build/npm/esm/tracing/browserTracingIntegration.js?a3eb","webpack://_N_E/./node_modules/@sentry/nextjs/build/esm/client/routing/appRouterRoutingInstrumentation.js?3fa8","webpack://_N_E/./node_modules/next/dist/api/router.js","webpack://_N_E/./node_modules/@sentry/nextjs/build/esm/common/debug-build.js?5eb0","webpack://_N_E/./node_modules/@sentry/nextjs/build/esm/client/routing/pagesRouterRoutingInstrumentation.js?5ffe","webpack://_N_E/./node_modules/@sentry/nextjs/build/esm/client/routing/nextRoutingInstrumentation.js?7494","webpack://_N_E/./node_modules/@sentry/nextjs/build/esm/client/browserTracingIntegration.js?f8b1","webpack://_N_E/./node_modules/@sentry/utils/build/esm/path.js?6dd6","webpack://_N_E/./node_modules/@sentry/core/build/esm/integrations/rewriteframes.js?4d0d","webpack://_N_E/./node_modules/@sentry/nextjs/build/esm/client/clientNormalizationIntegration.js?11f9","webpack://_N_E/./node_modules/@sentry/nextjs/build/esm/client/tunnelRoute.js?3f5b","webpack://_N_E/./node_modules/@sentry/nextjs/build/esm/client/index.js?c7a1","webpack://_N_E/./node_modules/@sentry/utils/build/esm/baggage.js?012d","webpack://_N_E/./node_modules/@sentry/utils/build/esm/browser.js?1210","webpack://_N_E/./node_modules/@sentry/utils/build/esm/buildPolyfills/_nullishCoalesce.js?da51","webpack://_N_E/./node_modules/@sentry/utils/build/esm/buildPolyfills/_optionalChain.js?a747","webpack://_N_E/./node_modules/@sentry/utils/build/esm/debug-build.js?e179","webpack://_N_E/./node_modules/@sentry/utils/build/esm/dsn.js?4df1","webpack://_N_E/./node_modules/@sentry/utils/build/esm/env.js?a5ea","webpack://_N_E/./node_modules/@sentry/utils/build/esm/envelope.js?625d","webpack://_N_E/./node_modules/@sentry/utils/build/esm/instrument/handlers.js?fb4c","webpack://_N_E/./node_modules/@sentry/utils/build/esm/is.js?e8bc","webpack://_N_E/./node_modules/@sentry/utils/build/esm/node.js?1116","webpack://_N_E/./node_modules/@sentry/utils/build/esm/isBrowser.js?4b02","webpack://_N_E/./node_modules/@sentry/utils/build/esm/logger.js?5276","webpack://_N_E/./node_modules/@sentry/utils/build/esm/misc.js?7b5d","webpack://_N_E/./node_modules/@sentry/utils/build/esm/memo.js?5d81","webpack://_N_E/./node_modules/@sentry/utils/build/esm/normalize.js?1263","webpack://_N_E/./node_modules/@sentry/utils/build/esm/object.js?4d99","webpack://_N_E/./node_modules/@sentry/utils/build/esm/propagationContext.js?d6ff","webpack://_N_E/./node_modules/@sentry/utils/build/esm/ratelimit.js?3686","webpack://_N_E/./node_modules/@sentry/utils/build/esm/severity.js?d71f","webpack://_N_E/./node_modules/@sentry/utils/build/esm/stacktrace.js?d4f8","webpack://_N_E/./node_modules/@sentry/utils/build/esm/string.js?d2c1","webpack://_N_E/./node_modules/@sentry/utils/build/esm/supports.js?cd4d","webpack://_N_E/./node_modules/@sentry/utils/build/esm/syncpromise.js?0127","webpack://_N_E/./node_modules/@sentry/utils/build/esm/time.js?f61f","webpack://_N_E/./node_modules/@sentry/utils/build/esm/tracing.js?de10","webpack://_N_E/./node_modules/@sentry/utils/build/esm/version.js?9817","webpack://_N_E/./node_modules/@sentry/utils/build/esm/worldwide.js?66ac","webpack://_N_E/./node_modules/@swc/helpers/esm/_class_private_field_loose_base.js","webpack://_N_E/./node_modules/@swc/helpers/esm/_class_private_field_loose_key.js","webpack://_N_E/./node_modules/@swc/helpers/esm/_interop_require_default.js?8500","webpack://_N_E/./node_modules/@swc/helpers/esm/_interop_require_wildcard.js?fa45"],"sourcesContent":["\"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<void>((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<ReducerActions>\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/// <reference types=\"react-dom/experimental\" />\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<InitialRSCPayload>(\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<AppRouterActionQueue> = 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<AppRouterActionQueue>(pendingActionQueue)\n\n const router = (\n <AppRouter\n actionQueue={actionQueue}\n globalErrorComponentAndStyles={initialRSCPayload.G}\n assetPrefix={initialRSCPayload.p}\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 <MissingSlotContext value={initialRSCPayload.m}>\n {router}\n </MissingSlotContext>\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 <StrictModeIfEnabled>\n <HeadManagerContext.Provider value={{ appDir: true }}>\n <Root>\n <ServerRoot />\n </Root>\n </HeadManagerContext.Provider>\n </StrictModeIfEnabled>\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<HTMLElement | null>(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<string | undefined>(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 <Link>, 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<ReducerActions>\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<ReducerActions>): 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<AppRouterInstance>(() => {\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 <Offscreen>. 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 = <Head key={headKey} headCacheNode={headCacheNode} />\n } else {\n head = null\n }\n\n let content = (\n <RedirectBoundary>\n {head}\n {cache.rsc}\n <AppRouterAnnouncer tree={tree} />\n </RedirectBoundary>\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 <DevRootHTTPAccessFallbackBoundary>\n {content}\n </DevRootHTTPAccessFallbackBoundary>\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 = <HotReloader assetPrefix={assetPrefix}>{content}</HotReloader>\n }\n\n return (\n <>\n <HistoryUpdater appRouterState={useUnwrapState(state)} />\n <RuntimeStyles />\n <PathParamsContext.Provider value={pathParams}>\n <PathnameContext.Provider value={pathname}>\n <SearchParamsContext.Provider value={searchParams}>\n <GlobalLayoutRouterContext.Provider\n value={globalLayoutRouterContext}\n >\n <AppRouterContext.Provider value={appRouter}>\n <LayoutRouterContext.Provider value={layoutRouterContext}>\n {content}\n </LayoutRouterContext.Provider>\n </AppRouterContext.Provider>\n </GlobalLayoutRouterContext.Provider>\n </SearchParamsContext.Provider>\n </PathnameContext.Provider>\n </PathParamsContext.Provider>\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 <ErrorBoundary\n errorComponent={globalErrorComponent}\n errorStyles={globalErrorStyles}\n >\n <Router actionQueue={actionQueue} assetPrefix={assetPrefix} />\n </ErrorBoundary>\n )\n}\n\nconst runtimeStyles = new Set<string>()\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 <link\n key={i}\n rel=\"stylesheet\"\n href={`${href}${dplId}`}\n // @ts-ignore\n precedence=\"next\"\n // TODO figure out crossOrigin and nonce\n // crossOrigin={TODO}\n // nonce={TODO}\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<any>\n searchParams: ParsedUrlQuery\n params: Params\n promises?: Array<Promise<any>>\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<ParsedUrlQuery>\n let clientParams: Promise<Params>\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 <Component params={clientParams} searchParams={clientSearchParams} />\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 <Component params={clientParams} searchParams={clientSearchParams} />\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<any>\n slots: { [key: string]: React.ReactNode }\n params: Params\n promise?: Promise<any>\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<Params>\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 <Component {...slots} params={clientParams} />\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 <Component {...slots} params={clientParams} />\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 <HandleISRError error={this.state.error} />\n {this.props.errorStyles}\n {this.props.errorScripts}\n <this.props.errorComponent\n error={this.state.error}\n reset={this.reset}\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 <html id=\"__next_error__\">\n <head></head>\n <body>\n <HandleISRError error={error} />\n <div style={styles.error}>\n <div>\n <h2 style={styles.text}>\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 </h2>\n {digest ? <p style={styles.text}>{`Digest: ${digest}`}</p> : null}\n </div>\n </div>\n </body>\n </html>\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 <ErrorBoundaryHandler\n pathname={pathname}\n errorComponent={errorComponent}\n errorStyles={errorStyles}\n errorScripts={errorScripts}\n >\n {children}\n </ErrorBoundaryHandler>\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 <Page> 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<string>\n}\n\ninterface HTTPAccessFallbackErrorBoundaryProps\n extends HTTPAccessFallbackBoundaryProps {\n pathname: string | null\n missingSlots?: Set<string>\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 <meta name=\"robots\" content=\"noindex\" />\n {process.env.NODE_ENV === 'development' && (\n <meta\n name=\"next-error\"\n content={getAccessFallbackErrorTypeByStatus(triggeredStatus)}\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 <HTTPAccessFallbackErrorBoundary\n pathname={pathname}\n notFound={notFound}\n forbidden={forbidden}\n unauthorized={unauthorized}\n missingSlots={missingSlots}\n >\n {children}\n </HTTPAccessFallbackErrorBoundary>\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<ScrollAndFocusHandlerProps> {\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<typeof getHashFragmentDomNode>\n | ReturnType<typeof findDOMNode> = 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 <link/> 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 `<html/>` 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 <InnerScrollAndFocusHandler\n segmentPath={segmentPath}\n focusAndScrollRef={context.focusAndScrollRef}\n >\n {children}\n </InnerScrollAndFocusHandler>\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 `<Offscreen>` 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<typeof createRouterCacheKey>\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 <LayoutRouterContext.Provider\n value={{\n tree: tree[1][parallelRouterKey],\n childNodes: childNode.parallelRoutes,\n // TODO-APP: overriding of url for parallel routes\n url: url,\n loading: childNode.loading,\n }}\n >\n {resolvedRsc}\n </LayoutRouterContext.Provider>\n )\n // Ensure root layout is not wrapped in a div as the root layout renders `<html>`\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<LoadingModuleData>\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<LoadingModuleData>\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 <Suspense\n fallback={\n <>\n {loadingStyles}\n {loadingScripts}\n {loadingRsc}\n </>\n }\n >\n {children}\n </Suspense>\n )\n }\n\n return <>{children}</>\n}\n\n/**\n * OuterLayoutRouter handles the current segment as well as <Offscreen> 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 `<Offscreen>`.\n */\n // TODO-APP: Add handling of `<Offscreen>` 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 <TemplateContext.Provider\n key={createRouterCacheKey(preservedSegment, true)}\n value={\n <ScrollAndFocusHandler segmentPath={segmentPath}>\n <ErrorBoundary\n errorComponent={error}\n errorStyles={errorStyles}\n errorScripts={errorScripts}\n >\n <LoadingBoundary loading={loading}>\n <HTTPAccessFallbackBoundary\n notFound={notFound}\n forbidden={forbidden}\n unauthorized={unauthorized}\n >\n <RedirectBoundary>\n <InnerLayoutRouter\n parallelRouterKey={parallelRouterKey}\n url={url}\n tree={tree}\n childNodes={childNodesForParallelRouter!}\n segmentPath={segmentPath}\n cacheKey={cacheKey}\n isActive={\n currentChildSegmentValue === preservedSegmentValue\n }\n />\n </RedirectBoundary>\n </HTTPAccessFallbackBoundary>\n </LoadingBoundary>\n </ErrorBoundary>\n </ScrollAndFocusHandler>\n }\n >\n {templateStyles}\n {templateScripts}\n {template}\n </TemplateContext.Provider>\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 extends Params = Params>(): 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 * <ul>\n * {segments.map((segment, index) => (\n * <li key={index}>{segment}</li>\n * ))}\n * </ul>\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 <p>Active segment: {segment}</p>\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 name=\"robots\" content=\"noindex\" />` 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<any>\n task: () => void\n }>\n\n constructor(maxConcurrency = 5) {\n this.#maxConcurrency = maxConcurrency\n this.#runningCount = 0\n this.#queue = []\n }\n\n enqueue<T>(promiseFn: () => Promise<T>): Promise<T> {\n let taskResolve: (value: T | PromiseLike<T>) => void\n let taskReject: (reason?: any) => void\n\n const taskPromise = new Promise((resolve, reject) => {\n taskResolve = resolve\n taskReject = reject\n }) as Promise<T>\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<any>) {\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<Error>,\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: <message> <serverContent> <clientContent>\n warning?: [string, string, string]\n componentStack?: string\n serverContent?: string\n clientContent?: string\n // React 19 hydration diff format: <notes> <link> <component diff?>\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<T = unknown>(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<Error> = []\nconst errorHandlers: Array<ErrorHandler> = []\nconst rejectionQueue: Array<Error> = []\nconst rejectionHandlers: Array<ErrorHandler> = []\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 // When there's an error property present, we log the error to error overlay.\n // Otherwise we don't do anything as it's not logging in the console either.\n if (event.error) {\n handleClientError(event.error, [])\n }\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 <HandleRedirect\n redirect={redirect}\n redirectType={redirectType}\n reset={() => 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 <RedirectErrorBoundary router={router}>{children}</RedirectErrorBoundary>\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<string, string | string[] | undefined>\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<URL, 'pathname' | 'search' | 'hash'>,\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<string, PrefetchCacheEntry>()\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<FetchServerResponseResult> {\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<NavigationFlightResponse>)\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<Uint8Array>\n): Promise<unknown> {\n return createFromReadableStream(flightStream, {\n callServer,\n findSourceMapURL,\n })\n}\n\nfunction createUnclosingPrefetchStream(\n originalFlightStream: ReadableStream<Uint8Array>\n): ReadableStream<Uint8Array> {\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<T>(value: T): value is Exclude<T, undefined> {\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<string, Task> | 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<FetchServerResponseResult>\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<React.ReactNode> & {\n status: 'pending'\n resolve: (value: React.ReactNode) => void\n reject: (error: any) => void\n tag: Symbol\n}\n\ntype FulfilledDeferredRsc = Promise<React.ReactNode> & {\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<React.ReactNode> & {\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<React.ReactNode>((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<string, PrefetchCacheEntry>,\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<ReadonlyReducerState, 'nextUrl' | 'prefetchCache' | 'tree'> & {\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<ReadonlyReducerState, 'nextUrl' | 'prefetchCache'> & {\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<ReadonlyReducerState, 'nextUrl' | 'tree' | 'prefetchCache'> & {\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<ReadonlyReducerState, 'nextUrl' | 'tree' | 'prefetchCache'> & {\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 `<meta http-equiv=\"refresh\">` 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<T>(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<FetchServerActionResult> {\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<string>()\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<string>\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<any> | 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<FetchServerResponseResult>\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<string, PrefetchCacheEntry>\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<AppRouterState>\nexport type ReducerState = Promise<AppRouterState> | 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<K, T> = 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 <Link prefetch={true}>, 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<RouteCacheKeypath>\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<PrefetchTask> | 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<PrefetchTask> | 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<FulfilledSegmentCacheEntry | null>\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<LoadingModuleData>\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<RouteCacheKeypath, RouteCacheEntry> =\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<RouteCacheEntry>(\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<string, SegmentCacheEntry>()\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<SegmentCacheEntry>(\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<RouteCacheKeypath> =\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<FulfilledSegmentCacheEntry | null> {\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<FulfilledSegmentCacheEntry | null>()\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<RouteCacheKeypath> =\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<RouteCacheKeypath>\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<PrefetchTask> | 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<LoadingModuleData>,\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<void> {\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<RootTreePrefetch>)\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<RouteCacheKeypath> = [href, nextUrl]\n const expectedEntry = routeCacheMap.get(currentKeypath)\n if (expectedEntry === entry) {\n routeCacheMap.delete(currentKeypath)\n const newKeypath: Prefix<RouteCacheKeypath> = [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<void> {\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<SegmentPrefetch>)\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<Response | null> {\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<Uint8Array>,\n lru: LRU<T>,\n lruEntry: T\n): ReadableStream<Uint8Array> {\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<T>(): PromiseWithResolvers<T> {\n // Shim of Stage 4 Promise.withResolvers proposal\n let resolve: (value: T | PromiseLike<T>) => void\n let reject: (reason: any) => void\n const promise = new Promise<T>((res, rej) => {\n resolve = res\n reject = rej\n })\n return { resolve: resolve!, reject: reject!, promise }\n}\n","export type LRU<T extends LRUNode> = {\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<T = any> = {\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<T extends LRUNode>(\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<T> {\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<LoadingModuleData> = 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<NormalizedFlightData>\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 <Link>,\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<PrefetchTask> = []\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<unknown>\n) {\n inProgressRequests++\n promiseForServerData.then(\n onPrefetchRequestCompletion,\n onPrefetchRequestCompletion\n )\n}\n\nconst noop = () => {}\n\nexport function spawnPrefetchSubtask(promise: Promise<any>) {\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<PrefetchTask>, 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>): PrefetchTask | null {\n return heap.length === 0 ? null : heap[0]\n}\n\nfunction heapPop(heap: Array<PrefetchTask>): 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<PrefetchTask>, 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<PrefetchTask>,\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<PrefetchTask>,\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 any[]> = T extends [infer First, ...infer Rest]\n ? [] | [First] | [First, ...Prefix<Rest>]\n : []\n\nexport type TupleMap<Keypath extends Array<any>, V> = {\n set(keys: Prefix<Keypath>, value: V): void\n get(keys: Prefix<Keypath>): V | null\n delete(keys: Prefix<Keypath>): 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<Keypath extends Array<any>, V>(): TupleMap<\n Keypath,\n V\n> {\n type MapEntryShared = {\n parent: MapEntry | null\n key: any\n map: Map<any, MapEntry> | 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<Keypath> | null = null\n\n function getOrCreateEntry(keys: Prefix<Keypath>): 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<Keypath>): 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<Keypath>, value: V): void {\n const entry = getOrCreateEntry(keys)\n entry.hasValue = true\n entry.value = value\n }\n\n function get(keys: Prefix<Keypath>): 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<Keypath>): 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<void>\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<ReducerActions>] {\n const [state, setState] = React.useState<ReducerState>(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<string, string[]>\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<V> {\n resolve: (entrypoint: V) => void\n future: Promise<V>\n}\nfunction withFuture<T extends object>(\n key: string,\n map: Map<string, Future<T> | T>,\n generator?: () => Promise<T>\n): Promise<T> {\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<T> = new Promise<T>((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<RouteEntrypoint>\n onEntrypoint(route: string, execute: () => unknown): void\n loadRoute(route: string, prefetch?: boolean): Promise<RouteLoaderEntry>\n prefetch(route: string): Promise<void>\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<any> {\n return new Promise<void>((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<unknown> {\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<void> | undefined\n\n// Resolve a promise that times out after given amount of milliseconds.\nfunction resolvePromiseWithTimeout<T>(\n p: Promise<T>,\n ms: number,\n err: Error\n): Promise<T> {\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<Record<string, string[]>>((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<RouteFiles> {\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<string, Future<RouteEntrypoint> | RouteEntrypoint> =\n new Map()\n const loadedScripts: Map<string, Promise<unknown>> = new Map()\n const styleSheets: Map<string, Promise<RouteStyleSheet>> = new Map()\n const routes: Map<string, Future<RouteLoaderEntry> | RouteLoaderEntry> =\n new Map()\n\n function maybeExecuteScript(\n src: TrustedScriptURL | string\n ): Promise<unknown> {\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<unknown> | 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<RouteStyleSheet> {\n let prom: Promise<RouteStyleSheet> | 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<RouteLoaderEntry>(route, routes, () => {\n let devBuildPromiseResolve: () => void\n\n if (process.env.NODE_ENV === 'development') {\n devBuildPromise = new Promise<void>((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<void> {\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<typeof Router>\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<HTMLScriptElement> {\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<void>((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 <OffScreen /> 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 <OffScreen /> 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 <script> tags, because they no longer have `defer`.\n if (strategy === 'beforeInteractive') {\n if (!src) {\n // For inlined scripts, we put the content in `children`.\n if (restProps.dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n restProps.children = restProps.dangerouslySetInnerHTML\n .__html as string\n delete restProps.dangerouslySetInnerHTML\n }\n\n return (\n <script\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([\n 0,\n { ...restProps, id },\n ])})`,\n }}\n />\n )\n } else {\n // @ts-ignore\n ReactDOM.preload(\n src,\n restProps.integrity\n ? {\n as: 'script',\n integrity: restProps.integrity,\n nonce,\n crossOrigin: restProps.crossOrigin,\n }\n : { as: 'script', nonce, crossOrigin: restProps.crossOrigin }\n )\n return (\n <script\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([\n src,\n { ...restProps, id },\n ])})`,\n }}\n />\n )\n }\n } else if (strategy === 'afterInteractive') {\n if (src) {\n // @ts-ignore\n ReactDOM.preload(\n src,\n restProps.integrity\n ? {\n as: 'script',\n integrity: restProps.integrity,\n nonce,\n crossOrigin: restProps.crossOrigin,\n }\n : { as: 'script', nonce, crossOrigin: restProps.crossOrigin }\n )\n }\n }\n }\n\n return null\n}\n\nObject.defineProperty(Script, '__nextScript', { value: true })\n\nexport default Script\n","const DOMAttributeNames: Record<string, string> = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n noModule: 'noModule',\n}\n\nconst ignoreProps = [\n 'onLoad',\n 'onReady',\n 'dangerouslySetInnerHTML',\n 'children',\n 'onError',\n 'strategy',\n 'stylesheets',\n]\n\nfunction isBooleanScriptAttribute(\n attr: string\n): attr is 'async' | 'defer' | 'noModule' {\n return ['async', 'defer', 'noModule'].includes(attr)\n}\n\nexport function setAttributesFromProps(el: HTMLElement, props: object) {\n for (const [p, value] of Object.entries(props)) {\n if (!props.hasOwnProperty(p)) continue\n if (ignoreProps.includes(p)) continue\n\n // we don't render undefined props to the DOM\n if (value === undefined) {\n continue\n }\n\n const attr = DOMAttributeNames[p] || p.toLowerCase()\n\n if (el.tagName === 'SCRIPT' && isBooleanScriptAttribute(attr)) {\n // Correctly assign boolean script attributes\n // https://github.com/vercel/next.js/pull/20748\n ;(el as HTMLScriptElement)[attr] = !!value\n } else {\n el.setAttribute(attr, String(value))\n }\n\n // Remove falsy non-zero boolean attributes so they are correctly interpreted\n // (e.g. if we set them to false, this coerces to the string \"false\", which the browser interprets as true)\n if (\n value === false ||\n (el.tagName === 'SCRIPT' &&\n isBooleanScriptAttribute(attr) &&\n (!value || value === 'false'))\n ) {\n // Call setAttribute before, as we need to set and unset the attribute to override force async:\n // https://html.spec.whatwg.org/multipage/scripting.html#script-force-async\n el.setAttribute(attr, '')\n el.removeAttribute(attr)\n }\n }\n}\n","/**\n * Stores the Trusted Types Policy. Starts as undefined and can be set to null\n * if Trusted Types is not supported in the browser.\n */\nlet policy: TrustedTypePolicy | null | undefined\n\n/**\n * Getter for the Trusted Types Policy. If it is undefined, it is instantiated\n * here or set to null if Trusted Types is not supported in the browser.\n */\nfunction getPolicy() {\n if (typeof policy === 'undefined' && typeof window !== 'undefined') {\n policy =\n window.trustedTypes?.createPolicy('nextjs', {\n createHTML: (input) => input,\n createScript: (input) => input,\n createScriptURL: (input) => input,\n }) || null\n }\n\n return policy\n}\n\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * when Trusted Types are not available.\n * This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will cause a browser to load and execute a resource, e.g. when\n * assigning to script.src.\n */\nexport function __unsafeCreateTrustedScriptURL(\n url: string\n): TrustedScriptURL | string {\n return getPolicy()?.createScriptURL(url) || url\n}\n","import React, { type JSX } from 'react'\nimport type {\n BaseContext,\n NextComponentType,\n NextPageContext,\n} from '../shared/lib/utils'\nimport type { NextRouter } from './router'\nimport { useRouter } from './router'\n\nexport type WithRouterProps = {\n router: NextRouter\n}\n\nexport type ExcludeRouterProps<P> = Pick<\n P,\n Exclude<keyof P, keyof WithRouterProps>\n>\n\nexport default function withRouter<\n P extends WithRouterProps,\n C extends BaseContext = NextPageContext,\n>(\n ComposedComponent: NextComponentType<C, any, P>\n): React.ComponentType<ExcludeRouterProps<P>> {\n function WithRouterWrapper(props: any): JSX.Element {\n return <ComposedComponent router={useRouter()} {...props} />\n }\n\n WithRouterWrapper.getInitialProps = ComposedComponent.getInitialProps\n // This is needed to allow checking for custom getInitialProps in _app\n ;(WithRouterWrapper as any).origGetInitialProps = (\n ComposedComponent as any\n ).origGetInitialProps\n if (process.env.NODE_ENV !== 'production') {\n const name =\n ComposedComponent.displayName || ComposedComponent.name || 'Unknown'\n WithRouterWrapper.displayName = `withRouter(${name})`\n }\n\n return WithRouterWrapper\n}\n","/**\n * @license React\n * scheduler.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n a: for (; 0 < index; ) {\n var parentIndex = (index - 1) >>> 1,\n parent = heap[parentIndex];\n if (0 < compare(parent, node))\n (heap[parentIndex] = node), (heap[index] = parent), (index = parentIndex);\n else break a;\n }\n}\nfunction peek(heap) {\n return 0 === heap.length ? null : heap[0];\n}\nfunction pop(heap) {\n if (0 === heap.length) return null;\n var first = heap[0],\n last = heap.pop();\n if (last !== first) {\n heap[0] = last;\n a: for (\n var index = 0, length = heap.length, halfLength = length >>> 1;\n index < halfLength;\n\n ) {\n var leftIndex = 2 * (index + 1) - 1,\n left = heap[leftIndex],\n rightIndex = leftIndex + 1,\n right = heap[rightIndex];\n if (0 > compare(left, last))\n rightIndex < length && 0 > compare(right, left)\n ? ((heap[index] = right),\n (heap[rightIndex] = last),\n (index = rightIndex))\n : ((heap[index] = left),\n (heap[leftIndex] = last),\n (index = leftIndex));\n else if (rightIndex < length && 0 > compare(right, last))\n (heap[index] = right), (heap[rightIndex] = last), (index = rightIndex);\n else break a;\n }\n }\n return first;\n}\nfunction compare(a, b) {\n var diff = a.sortIndex - b.sortIndex;\n return 0 !== diff ? diff : a.id - b.id;\n}\nexports.unstable_now = void 0;\nif (\"object\" === typeof performance && \"function\" === typeof performance.now) {\n var localPerformance = performance;\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n} else {\n var localDate = Date,\n initialTime = localDate.now();\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n}\nvar taskQueue = [],\n timerQueue = [],\n taskIdCounter = 1,\n currentTask = null,\n currentPriorityLevel = 3,\n isPerformingWork = !1,\n isHostCallbackScheduled = !1,\n isHostTimeoutScheduled = !1,\n localSetTimeout = \"function\" === typeof setTimeout ? setTimeout : null,\n localClearTimeout = \"function\" === typeof clearTimeout ? clearTimeout : null,\n localSetImmediate = \"undefined\" !== typeof setImmediate ? setImmediate : null;\nfunction advanceTimers(currentTime) {\n for (var timer = peek(timerQueue); null !== timer; ) {\n if (null === timer.callback) pop(timerQueue);\n else if (timer.startTime <= currentTime)\n pop(timerQueue),\n (timer.sortIndex = timer.expirationTime),\n push(taskQueue, timer);\n else break;\n timer = peek(timerQueue);\n }\n}\nfunction handleTimeout(currentTime) {\n isHostTimeoutScheduled = !1;\n advanceTimers(currentTime);\n if (!isHostCallbackScheduled)\n if (null !== peek(taskQueue))\n (isHostCallbackScheduled = !0), requestHostCallback();\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n}\nvar isMessageLoopRunning = !1,\n taskTimeoutID = -1,\n frameInterval = 5,\n startTime = -1;\nfunction shouldYieldToHost() {\n return exports.unstable_now() - startTime < frameInterval ? !1 : !0;\n}\nfunction performWorkUntilDeadline() {\n if (isMessageLoopRunning) {\n var currentTime = exports.unstable_now();\n startTime = currentTime;\n var hasMoreWork = !0;\n try {\n a: {\n isHostCallbackScheduled = !1;\n isHostTimeoutScheduled &&\n ((isHostTimeoutScheduled = !1),\n localClearTimeout(taskTimeoutID),\n (taskTimeoutID = -1));\n isPerformingWork = !0;\n var previousPriorityLevel = currentPriorityLevel;\n try {\n b: {\n advanceTimers(currentTime);\n for (\n currentTask = peek(taskQueue);\n null !== currentTask &&\n !(\n currentTask.expirationTime > currentTime && shouldYieldToHost()\n );\n\n ) {\n var callback = currentTask.callback;\n if (\"function\" === typeof callback) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var continuationCallback = callback(\n currentTask.expirationTime <= currentTime\n );\n currentTime = exports.unstable_now();\n if (\"function\" === typeof continuationCallback) {\n currentTask.callback = continuationCallback;\n advanceTimers(currentTime);\n hasMoreWork = !0;\n break b;\n }\n currentTask === peek(taskQueue) && pop(taskQueue);\n advanceTimers(currentTime);\n } else pop(taskQueue);\n currentTask = peek(taskQueue);\n }\n if (null !== currentTask) hasMoreWork = !0;\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(\n handleTimeout,\n firstTimer.startTime - currentTime\n );\n hasMoreWork = !1;\n }\n }\n break a;\n } finally {\n (currentTask = null),\n (currentPriorityLevel = previousPriorityLevel),\n (isPerformingWork = !1);\n }\n hasMoreWork = void 0;\n }\n } finally {\n hasMoreWork\n ? schedulePerformWorkUntilDeadline()\n : (isMessageLoopRunning = !1);\n }\n }\n}\nvar schedulePerformWorkUntilDeadline;\nif (\"function\" === typeof localSetImmediate)\n schedulePerformWorkUntilDeadline = function () {\n localSetImmediate(performWorkUntilDeadline);\n };\nelse if (\"undefined\" !== typeof MessageChannel) {\n var channel = new MessageChannel(),\n port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n schedulePerformWorkUntilDeadline = function () {\n port.postMessage(null);\n };\n} else\n schedulePerformWorkUntilDeadline = function () {\n localSetTimeout(performWorkUntilDeadline, 0);\n };\nfunction requestHostCallback() {\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());\n}\nfunction requestHostTimeout(callback, ms) {\n taskTimeoutID = localSetTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n}\nexports.unstable_IdlePriority = 5;\nexports.unstable_ImmediatePriority = 1;\nexports.unstable_LowPriority = 4;\nexports.unstable_NormalPriority = 3;\nexports.unstable_Profiling = null;\nexports.unstable_UserBlockingPriority = 2;\nexports.unstable_cancelCallback = function (task) {\n task.callback = null;\n};\nexports.unstable_continueExecution = function () {\n isHostCallbackScheduled ||\n isPerformingWork ||\n ((isHostCallbackScheduled = !0), requestHostCallback());\n};\nexports.unstable_forceFrameRate = function (fps) {\n 0 > fps || 125 < fps\n ? console.error(\n \"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"\n )\n : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);\n};\nexports.unstable_getCurrentPriorityLevel = function () {\n return currentPriorityLevel;\n};\nexports.unstable_getFirstCallbackNode = function () {\n return peek(taskQueue);\n};\nexports.unstable_next = function (eventHandler) {\n switch (currentPriorityLevel) {\n case 1:\n case 2:\n case 3:\n var priorityLevel = 3;\n break;\n default:\n priorityLevel = currentPriorityLevel;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_pauseExecution = function () {};\nexports.unstable_requestPaint = function () {};\nexports.unstable_runWithPriority = function (priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n break;\n default:\n priorityLevel = 3;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_scheduleCallback = function (\n priorityLevel,\n callback,\n options\n) {\n var currentTime = exports.unstable_now();\n \"object\" === typeof options && null !== options\n ? ((options = options.delay),\n (options =\n \"number\" === typeof options && 0 < options\n ? currentTime + options\n : currentTime))\n : (options = currentTime);\n switch (priorityLevel) {\n case 1:\n var timeout = -1;\n break;\n case 2:\n timeout = 250;\n break;\n case 5:\n timeout = 1073741823;\n break;\n case 4:\n timeout = 1e4;\n break;\n default:\n timeout = 5e3;\n }\n timeout = options + timeout;\n priorityLevel = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: options,\n expirationTime: timeout,\n sortIndex: -1\n };\n options > currentTime\n ? ((priorityLevel.sortIndex = options),\n push(timerQueue, priorityLevel),\n null === peek(taskQueue) &&\n priorityLevel === peek(timerQueue) &&\n (isHostTimeoutScheduled\n ? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))\n : (isHostTimeoutScheduled = !0),\n requestHostTimeout(handleTimeout, options - currentTime)))\n : ((priorityLevel.sortIndex = timeout),\n push(taskQueue, priorityLevel),\n isHostCallbackScheduled ||\n isPerformingWork ||\n ((isHostCallbackScheduled = !0), requestHostCallback()));\n return priorityLevel;\n};\nexports.unstable_shouldYield = shouldYieldToHost;\nexports.unstable_wrapCallback = function (callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isDynamicUsageError\", {\n enumerable: true,\n get: function() {\n return isDynamicUsageError;\n }\n});\nconst _hooksservercontext = require(\"../../client/components/hooks-server-context\");\nconst _bailouttocsr = require(\"../../shared/lib/lazy-dynamic/bailout-to-csr\");\nconst _isnextroutererror = require(\"../../client/components/is-next-router-error\");\nconst _dynamicrendering = require(\"../../server/app-render/dynamic-rendering\");\nconst isDynamicUsageError = (err)=>(0, _hooksservercontext.isDynamicServerError)(err) || (0, _bailouttocsr.isBailoutToCSRError)(err) || (0, _isnextroutererror.isNextRouterError)(err) || (0, _dynamicrendering.isDynamicPostpone)(err);\n\n//# sourceMappingURL=is-dynamic-usage-error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n ACTION_SUFFIX: null,\n APP_DIR_ALIAS: null,\n CACHE_ONE_YEAR: null,\n DOT_NEXT_ALIAS: null,\n ESLINT_DEFAULT_DIRS: null,\n GSP_NO_RETURNED_VALUE: null,\n GSSP_COMPONENT_MEMBER_ERROR: null,\n GSSP_NO_RETURNED_VALUE: null,\n INFINITE_CACHE: null,\n INSTRUMENTATION_HOOK_FILENAME: null,\n MATCHED_PATH_HEADER: null,\n MIDDLEWARE_FILENAME: null,\n MIDDLEWARE_LOCATION_REGEXP: null,\n NEXT_BODY_SUFFIX: null,\n NEXT_CACHE_IMPLICIT_TAG_ID: null,\n NEXT_CACHE_REVALIDATED_TAGS_HEADER: null,\n NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: null,\n NEXT_CACHE_SOFT_TAGS_HEADER: null,\n NEXT_CACHE_SOFT_TAG_MAX_LENGTH: null,\n NEXT_CACHE_TAGS_HEADER: null,\n NEXT_CACHE_TAG_MAX_ITEMS: null,\n NEXT_CACHE_TAG_MAX_LENGTH: null,\n NEXT_DATA_SUFFIX: null,\n NEXT_INTERCEPTION_MARKER_PREFIX: null,\n NEXT_META_SUFFIX: null,\n NEXT_QUERY_PARAM_PREFIX: null,\n NEXT_RESUME_HEADER: null,\n NON_STANDARD_NODE_ENV: null,\n PAGES_DIR_ALIAS: null,\n PRERENDER_REVALIDATE_HEADER: null,\n PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: null,\n PUBLIC_DIR_MIDDLEWARE_CONFLICT: null,\n ROOT_DIR_ALIAS: null,\n RSC_ACTION_CLIENT_WRAPPER_ALIAS: null,\n RSC_ACTION_ENCRYPTION_ALIAS: null,\n RSC_ACTION_PROXY_ALIAS: null,\n RSC_ACTION_VALIDATE_ALIAS: null,\n RSC_CACHE_WRAPPER_ALIAS: null,\n RSC_MOD_REF_PROXY_ALIAS: null,\n RSC_PREFETCH_SUFFIX: null,\n RSC_SEGMENTS_DIR_SUFFIX: null,\n RSC_SEGMENT_SUFFIX: null,\n RSC_SUFFIX: null,\n SERVER_PROPS_EXPORT_ERROR: null,\n SERVER_PROPS_GET_INIT_PROPS_CONFLICT: null,\n SERVER_PROPS_SSG_CONFLICT: null,\n SERVER_RUNTIME: null,\n SSG_FALLBACK_EXPORT_ERROR: null,\n SSG_GET_INITIAL_PROPS_CONFLICT: null,\n STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: null,\n UNSTABLE_REVALIDATE_RENAME_ERROR: null,\n WEBPACK_LAYERS: null,\n WEBPACK_RESOURCE_QUERIES: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n ACTION_SUFFIX: function() {\n return ACTION_SUFFIX;\n },\n APP_DIR_ALIAS: function() {\n return APP_DIR_ALIAS;\n },\n CACHE_ONE_YEAR: function() {\n return CACHE_ONE_YEAR;\n },\n DOT_NEXT_ALIAS: function() {\n return DOT_NEXT_ALIAS;\n },\n ESLINT_DEFAULT_DIRS: function() {\n return ESLINT_DEFAULT_DIRS;\n },\n GSP_NO_RETURNED_VALUE: function() {\n return GSP_NO_RETURNED_VALUE;\n },\n GSSP_COMPONENT_MEMBER_ERROR: function() {\n return GSSP_COMPONENT_MEMBER_ERROR;\n },\n GSSP_NO_RETURNED_VALUE: function() {\n return GSSP_NO_RETURNED_VALUE;\n },\n INFINITE_CACHE: function() {\n return INFINITE_CACHE;\n },\n INSTRUMENTATION_HOOK_FILENAME: function() {\n return INSTRUMENTATION_HOOK_FILENAME;\n },\n MATCHED_PATH_HEADER: function() {\n return MATCHED_PATH_HEADER;\n },\n MIDDLEWARE_FILENAME: function() {\n return MIDDLEWARE_FILENAME;\n },\n MIDDLEWARE_LOCATION_REGEXP: function() {\n return MIDDLEWARE_LOCATION_REGEXP;\n },\n NEXT_BODY_SUFFIX: function() {\n return NEXT_BODY_SUFFIX;\n },\n NEXT_CACHE_IMPLICIT_TAG_ID: function() {\n return NEXT_CACHE_IMPLICIT_TAG_ID;\n },\n NEXT_CACHE_REVALIDATED_TAGS_HEADER: function() {\n return NEXT_CACHE_REVALIDATED_TAGS_HEADER;\n },\n NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: function() {\n return NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER;\n },\n NEXT_CACHE_SOFT_TAGS_HEADER: function() {\n return NEXT_CACHE_SOFT_TAGS_HEADER;\n },\n NEXT_CACHE_SOFT_TAG_MAX_LENGTH: function() {\n return NEXT_CACHE_SOFT_TAG_MAX_LENGTH;\n },\n NEXT_CACHE_TAGS_HEADER: function() {\n return NEXT_CACHE_TAGS_HEADER;\n },\n NEXT_CACHE_TAG_MAX_ITEMS: function() {\n return NEXT_CACHE_TAG_MAX_ITEMS;\n },\n NEXT_CACHE_TAG_MAX_LENGTH: function() {\n return NEXT_CACHE_TAG_MAX_LENGTH;\n },\n NEXT_DATA_SUFFIX: function() {\n return NEXT_DATA_SUFFIX;\n },\n NEXT_INTERCEPTION_MARKER_PREFIX: function() {\n return NEXT_INTERCEPTION_MARKER_PREFIX;\n },\n NEXT_META_SUFFIX: function() {\n return NEXT_META_SUFFIX;\n },\n NEXT_QUERY_PARAM_PREFIX: function() {\n return NEXT_QUERY_PARAM_PREFIX;\n },\n NEXT_RESUME_HEADER: function() {\n return NEXT_RESUME_HEADER;\n },\n NON_STANDARD_NODE_ENV: function() {\n return NON_STANDARD_NODE_ENV;\n },\n PAGES_DIR_ALIAS: function() {\n return PAGES_DIR_ALIAS;\n },\n PRERENDER_REVALIDATE_HEADER: function() {\n return PRERENDER_REVALIDATE_HEADER;\n },\n PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: function() {\n return PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER;\n },\n PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {\n return PUBLIC_DIR_MIDDLEWARE_CONFLICT;\n },\n ROOT_DIR_ALIAS: function() {\n return ROOT_DIR_ALIAS;\n },\n RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {\n return RSC_ACTION_CLIENT_WRAPPER_ALIAS;\n },\n RSC_ACTION_ENCRYPTION_ALIAS: function() {\n return RSC_ACTION_ENCRYPTION_ALIAS;\n },\n RSC_ACTION_PROXY_ALIAS: function() {\n return RSC_ACTION_PROXY_ALIAS;\n },\n RSC_ACTION_VALIDATE_ALIAS: function() {\n return RSC_ACTION_VALIDATE_ALIAS;\n },\n RSC_CACHE_WRAPPER_ALIAS: function() {\n return RSC_CACHE_WRAPPER_ALIAS;\n },\n RSC_MOD_REF_PROXY_ALIAS: function() {\n return RSC_MOD_REF_PROXY_ALIAS;\n },\n RSC_PREFETCH_SUFFIX: function() {\n return RSC_PREFETCH_SUFFIX;\n },\n RSC_SEGMENTS_DIR_SUFFIX: function() {\n return RSC_SEGMENTS_DIR_SUFFIX;\n },\n RSC_SEGMENT_SUFFIX: function() {\n return RSC_SEGMENT_SUFFIX;\n },\n RSC_SUFFIX: function() {\n return RSC_SUFFIX;\n },\n SERVER_PROPS_EXPORT_ERROR: function() {\n return SERVER_PROPS_EXPORT_ERROR;\n },\n SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {\n return SERVER_PROPS_GET_INIT_PROPS_CONFLICT;\n },\n SERVER_PROPS_SSG_CONFLICT: function() {\n return SERVER_PROPS_SSG_CONFLICT;\n },\n SERVER_RUNTIME: function() {\n return SERVER_RUNTIME;\n },\n SSG_FALLBACK_EXPORT_ERROR: function() {\n return SSG_FALLBACK_EXPORT_ERROR;\n },\n SSG_GET_INITIAL_PROPS_CONFLICT: function() {\n return SSG_GET_INITIAL_PROPS_CONFLICT;\n },\n STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {\n return STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR;\n },\n UNSTABLE_REVALIDATE_RENAME_ERROR: function() {\n return UNSTABLE_REVALIDATE_RENAME_ERROR;\n },\n WEBPACK_LAYERS: function() {\n return WEBPACK_LAYERS;\n },\n WEBPACK_RESOURCE_QUERIES: function() {\n return WEBPACK_RESOURCE_QUERIES;\n }\n});\nconst NEXT_QUERY_PARAM_PREFIX = 'nxtP';\nconst NEXT_INTERCEPTION_MARKER_PREFIX = 'nxtI';\nconst MATCHED_PATH_HEADER = 'x-matched-path';\nconst PRERENDER_REVALIDATE_HEADER = 'x-prerender-revalidate';\nconst PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = 'x-prerender-revalidate-if-generated';\nconst RSC_PREFETCH_SUFFIX = '.prefetch.rsc';\nconst RSC_SEGMENTS_DIR_SUFFIX = '.segments';\nconst RSC_SEGMENT_SUFFIX = '.segment.rsc';\nconst RSC_SUFFIX = '.rsc';\nconst ACTION_SUFFIX = '.action';\nconst NEXT_DATA_SUFFIX = '.json';\nconst NEXT_META_SUFFIX = '.meta';\nconst NEXT_BODY_SUFFIX = '.body';\nconst NEXT_CACHE_TAGS_HEADER = 'x-next-cache-tags';\nconst NEXT_CACHE_SOFT_TAGS_HEADER = 'x-next-cache-soft-tags';\nconst NEXT_CACHE_REVALIDATED_TAGS_HEADER = 'x-next-revalidated-tags';\nconst NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = 'x-next-revalidate-tag-token';\nconst NEXT_RESUME_HEADER = 'next-resume';\nconst NEXT_CACHE_TAG_MAX_ITEMS = 128;\nconst NEXT_CACHE_TAG_MAX_LENGTH = 256;\nconst NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;\nconst NEXT_CACHE_IMPLICIT_TAG_ID = '_N_T_';\nconst CACHE_ONE_YEAR = 31536000;\nconst INFINITE_CACHE = 0xfffffffe;\nconst MIDDLEWARE_FILENAME = 'middleware';\nconst MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;\nconst INSTRUMENTATION_HOOK_FILENAME = 'instrumentation';\nconst PAGES_DIR_ALIAS = 'private-next-pages';\nconst DOT_NEXT_ALIAS = 'private-dot-next';\nconst ROOT_DIR_ALIAS = 'private-next-root-dir';\nconst APP_DIR_ALIAS = 'private-next-app-dir';\nconst RSC_MOD_REF_PROXY_ALIAS = 'private-next-rsc-mod-ref-proxy';\nconst RSC_ACTION_VALIDATE_ALIAS = 'private-next-rsc-action-validate';\nconst RSC_ACTION_PROXY_ALIAS = 'private-next-rsc-server-reference';\nconst RSC_CACHE_WRAPPER_ALIAS = 'private-next-rsc-cache-wrapper';\nconst RSC_ACTION_ENCRYPTION_ALIAS = 'private-next-rsc-action-encryption';\nconst RSC_ACTION_CLIENT_WRAPPER_ALIAS = 'private-next-rsc-action-client-wrapper';\nconst PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;\nconst SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;\nconst SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;\nconst SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;\nconst STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;\nconst SERVER_PROPS_EXPORT_ERROR = `pages with \\`getServerSideProps\\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;\nconst GSP_NO_RETURNED_VALUE = 'Your `getStaticProps` function did not return an object. Did you forget to add a `return`?';\nconst GSSP_NO_RETURNED_VALUE = 'Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?';\nconst UNSTABLE_REVALIDATE_RENAME_ERROR = 'The `unstable_revalidate` property is available for general use.\\n' + 'Please use `revalidate` instead.';\nconst GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;\nconst NON_STANDARD_NODE_ENV = `You are using a non-standard \"NODE_ENV\" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;\nconst SSG_FALLBACK_EXPORT_ERROR = `Pages with \\`fallback\\` enabled in \\`getStaticPaths\\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;\nconst ESLINT_DEFAULT_DIRS = [\n 'app',\n 'pages',\n 'components',\n 'lib',\n 'src'\n];\nconst SERVER_RUNTIME = {\n edge: 'edge',\n experimentalEdge: 'experimental-edge',\n nodejs: 'nodejs'\n};\n/**\n * The names of the webpack layers. These layers are the primitives for the\n * webpack chunks.\n */ const WEBPACK_LAYERS_NAMES = {\n /**\n * The layer for the shared code between the client and server bundles.\n */ shared: 'shared',\n /**\n * The layer for server-only runtime and picking up `react-server` export conditions.\n * Including app router RSC pages and app router custom routes and metadata routes.\n */ reactServerComponents: 'rsc',\n /**\n * Server Side Rendering layer for app (ssr).\n */ serverSideRendering: 'ssr',\n /**\n * The browser client bundle layer for actions.\n */ actionBrowser: 'action-browser',\n /**\n * The layer for the API routes.\n */ api: 'api',\n /**\n * The layer for the middleware code.\n */ middleware: 'middleware',\n /**\n * The layer for the instrumentation hooks.\n */ instrument: 'instrument',\n /**\n * The layer for assets on the edge.\n */ edgeAsset: 'edge-asset',\n /**\n * The browser client bundle layer for App directory.\n */ appPagesBrowser: 'app-pages-browser'\n};\nconst WEBPACK_LAYERS = {\n ...WEBPACK_LAYERS_NAMES,\n GROUP: {\n builtinReact: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser\n ],\n serverOnly: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.instrument,\n WEBPACK_LAYERS_NAMES.middleware\n ],\n neutralTarget: [\n // pages api\n WEBPACK_LAYERS_NAMES.api\n ],\n clientOnly: [\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser\n ],\n bundled: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n WEBPACK_LAYERS_NAMES.shared,\n WEBPACK_LAYERS_NAMES.instrument\n ],\n appPages: [\n // app router pages and layouts\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n WEBPACK_LAYERS_NAMES.actionBrowser\n ]\n }\n};\nconst WEBPACK_RESOURCE_QUERIES = {\n edgeSSREntry: '__next_edge_ssr_entry__',\n metadata: '__next_metadata__',\n metadataRoute: '__next_metadata_route__',\n metadataImageMeta: '__next_metadata_image_meta__'\n};\n\n//# sourceMappingURL=constants.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isAPIRoute\", {\n enumerable: true,\n get: function() {\n return isAPIRoute;\n }\n});\nfunction isAPIRoute(value) {\n return value === '/api' || Boolean(value == null ? void 0 : value.startsWith('/api/'));\n}\n\n//# sourceMappingURL=is-api-route.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n default: null,\n getProperError: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n /**\n * Checks whether the given value is a NextError.\n * This can be used to print a more detailed error message with properties like `code` & `digest`.\n */ default: function() {\n return isError;\n },\n getProperError: function() {\n return getProperError;\n }\n});\nconst _isplainobject = require(\"../shared/lib/is-plain-object\");\nfunction isError(err) {\n return typeof err === 'object' && err !== null && 'name' in err && 'message' in err;\n}\nfunction safeStringify(obj) {\n const seen = new WeakSet();\n return JSON.stringify(obj, (_key, value)=>{\n // If value is an object and already seen, replace with \"[Circular]\"\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return '[Circular]';\n }\n seen.add(value);\n }\n return value;\n });\n}\nfunction getProperError(err) {\n if (isError(err)) {\n return err;\n }\n if (process.env.NODE_ENV === 'development') {\n // provide better error for case where `throw undefined`\n // is called in development\n if (typeof err === 'undefined') {\n return new Error('An undefined error was thrown, ' + 'see here for more info: https://nextjs.org/docs/messages/threw-undefined');\n }\n if (err === null) {\n return new Error('A null error was thrown, ' + 'see here for more info: https://nextjs.org/docs/messages/threw-undefined');\n }\n }\n return new Error((0, _isplainobject.isPlainObject)(err) ? safeStringify(err) : err + '');\n}\n\n//# sourceMappingURL=is-error.js.map","'use client'\n\nimport {\n METADATA_BOUNDARY_NAME,\n VIEWPORT_BOUNDARY_NAME,\n OUTLET_BOUNDARY_NAME,\n} from './metadata-constants'\n\n// We use a namespace object to allow us to recover the name of the function\n// at runtime even when production bundling/minification is used.\nconst NameSpace = {\n [METADATA_BOUNDARY_NAME]: function ({\n children,\n }: {\n children: React.ReactNode\n }) {\n return children\n },\n [VIEWPORT_BOUNDARY_NAME]: function ({\n children,\n }: {\n children: React.ReactNode\n }) {\n return children\n },\n [OUTLET_BOUNDARY_NAME]: function ({\n children,\n }: {\n children: React.ReactNode\n }) {\n return children\n },\n}\n\nexport const MetadataBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[METADATA_BOUNDARY_NAME.slice(0) as typeof METADATA_BOUNDARY_NAME]\n\nexport const ViewportBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[VIEWPORT_BOUNDARY_NAME.slice(0) as typeof VIEWPORT_BOUNDARY_NAME]\n\nexport const OutletBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[OUTLET_BOUNDARY_NAME.slice(0) as typeof OUTLET_BOUNDARY_NAME]\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n METADATA_BOUNDARY_NAME: null,\n OUTLET_BOUNDARY_NAME: null,\n VIEWPORT_BOUNDARY_NAME: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n METADATA_BOUNDARY_NAME: function() {\n return METADATA_BOUNDARY_NAME;\n },\n OUTLET_BOUNDARY_NAME: function() {\n return OUTLET_BOUNDARY_NAME;\n },\n VIEWPORT_BOUNDARY_NAME: function() {\n return VIEWPORT_BOUNDARY_NAME;\n }\n});\nconst METADATA_BOUNDARY_NAME = '__next_metadata_boundary__';\nconst VIEWPORT_BOUNDARY_NAME = '__next_viewport_boundary__';\nconst OUTLET_BOUNDARY_NAME = '__next_outlet_boundary__';\n\n//# sourceMappingURL=metadata-constants.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n atLeastOneTask: null,\n scheduleImmediate: null,\n scheduleOnNextTick: null,\n waitAtLeastOneReactRenderTask: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n atLeastOneTask: function() {\n return atLeastOneTask;\n },\n scheduleImmediate: function() {\n return scheduleImmediate;\n },\n scheduleOnNextTick: function() {\n return scheduleOnNextTick;\n },\n waitAtLeastOneReactRenderTask: function() {\n return waitAtLeastOneReactRenderTask;\n }\n});\nconst scheduleOnNextTick = (cb)=>{\n // We use Promise.resolve().then() here so that the operation is scheduled at\n // the end of the promise job queue, we then add it to the next process tick\n // to ensure it's evaluated afterwards.\n //\n // This was inspired by the implementation of the DataLoader interface: https://github.com/graphql/dataloader/blob/d336bd15282664e0be4b4a657cb796f09bafbc6b/src/index.js#L213-L255\n //\n Promise.resolve().then(()=>{\n if (process.env.NEXT_RUNTIME === 'edge') {\n setTimeout(cb, 0);\n } else {\n process.nextTick(cb);\n }\n });\n};\nconst scheduleImmediate = (cb)=>{\n if (process.env.NEXT_RUNTIME === 'edge') {\n setTimeout(cb, 0);\n } else {\n setImmediate(cb);\n }\n};\nfunction atLeastOneTask() {\n return new Promise((resolve)=>scheduleImmediate(resolve));\n}\nfunction waitAtLeastOneReactRenderTask() {\n if (process.env.NEXT_RUNTIME === 'edge') {\n return new Promise((r)=>setTimeout(r, 0));\n } else {\n return new Promise((r)=>setImmediate(r));\n }\n}\n\n//# sourceMappingURL=scheduler.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"actionAsyncStorage\", {\n enumerable: true,\n get: function() {\n return _actionasyncstorageinstance.actionAsyncStorageInstance;\n }\n});\nconst _actionasyncstorageinstance = require(\"./action-async-storage-instance\");\n\n//# sourceMappingURL=action-async-storage.external.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"afterTaskAsyncStorageInstance\", {\n enumerable: true,\n get: function() {\n return afterTaskAsyncStorageInstance;\n }\n});\nconst _asynclocalstorage = require(\"./async-local-storage\");\nconst afterTaskAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();\n\n//# sourceMappingURL=after-task-async-storage-instance.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"afterTaskAsyncStorage\", {\n enumerable: true,\n get: function() {\n return _aftertaskasyncstorageinstance.afterTaskAsyncStorageInstance;\n }\n});\nconst _aftertaskasyncstorageinstance = require(\"./after-task-async-storage-instance\");\n\n//# sourceMappingURL=after-task-async-storage.external.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n bindSnapshot: null,\n createAsyncLocalStorage: null,\n createSnapshot: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n bindSnapshot: function() {\n return bindSnapshot;\n },\n createAsyncLocalStorage: function() {\n return createAsyncLocalStorage;\n },\n createSnapshot: function() {\n return createSnapshot;\n }\n});\nconst sharedAsyncLocalStorageNotAvailableError = new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available');\nclass FakeAsyncLocalStorage {\n disable() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n getStore() {\n // This fake implementation of AsyncLocalStorage always returns `undefined`.\n return undefined;\n }\n run() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n exit() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n enterWith() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n static bind(fn) {\n return fn;\n }\n}\nconst maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage;\nfunction createAsyncLocalStorage() {\n if (maybeGlobalAsyncLocalStorage) {\n return new maybeGlobalAsyncLocalStorage();\n }\n return new FakeAsyncLocalStorage();\n}\nfunction bindSnapshot(fn) {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.bind(fn);\n }\n return FakeAsyncLocalStorage.bind(fn);\n}\nfunction createSnapshot() {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.snapshot();\n }\n return function(fn, ...args) {\n return fn(...args);\n };\n}\n\n//# sourceMappingURL=async-local-storage.js.map","/**\n * The functions provided by this module are used to communicate certain properties\n * about the currently running code so that Next.js can make decisions on how to handle\n * the current execution in different rendering modes such as pre-rendering, resuming, and SSR.\n *\n * Today Next.js treats all code as potentially static. Certain APIs may only make sense when dynamically rendering.\n * Traditionally this meant deopting the entire render to dynamic however with PPR we can now deopt parts\n * of a React tree as dynamic while still keeping other parts static. There are really two different kinds of\n * Dynamic indications.\n *\n * The first is simply an intention to be dynamic. unstable_noStore is an example of this where\n * the currently executing code simply declares that the current scope is dynamic but if you use it\n * inside unstable_cache it can still be cached. This type of indication can be removed if we ever\n * make the default dynamic to begin with because the only way you would ever be static is inside\n * a cache scope which this indication does not affect.\n *\n * The second is an indication that a dynamic data source was read. This is a stronger form of dynamic\n * because it means that it is inappropriate to cache this at all. using a dynamic data source inside\n * unstable_cache should error. If you want to use some dynamic data inside unstable_cache you should\n * read that data outside the cache and pass it in as an argument to the cached function.\n */ \"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n Postpone: null,\n abortAndThrowOnSynchronousRequestDataAccess: null,\n abortOnSynchronousPlatformIOAccess: null,\n accessedDynamicData: null,\n annotateDynamicAccess: null,\n consumeDynamicAccess: null,\n createDynamicTrackingState: null,\n createDynamicValidationState: null,\n createPostponedAbortSignal: null,\n formatDynamicAPIAccesses: null,\n getFirstDynamicReason: null,\n isDynamicPostpone: null,\n isPrerenderInterruptedError: null,\n markCurrentScopeAsDynamic: null,\n postponeWithTracking: null,\n throwIfDisallowedDynamic: null,\n throwToInterruptStaticGeneration: null,\n trackAllowedDynamicAccess: null,\n trackDynamicDataInDynamicRender: null,\n trackFallbackParamAccessed: null,\n trackSynchronousPlatformIOAccessInDev: null,\n trackSynchronousRequestDataAccessInDev: null,\n useDynamicRouteParams: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n Postpone: function() {\n return Postpone;\n },\n abortAndThrowOnSynchronousRequestDataAccess: function() {\n return abortAndThrowOnSynchronousRequestDataAccess;\n },\n abortOnSynchronousPlatformIOAccess: function() {\n return abortOnSynchronousPlatformIOAccess;\n },\n accessedDynamicData: function() {\n return accessedDynamicData;\n },\n annotateDynamicAccess: function() {\n return annotateDynamicAccess;\n },\n consumeDynamicAccess: function() {\n return consumeDynamicAccess;\n },\n createDynamicTrackingState: function() {\n return createDynamicTrackingState;\n },\n createDynamicValidationState: function() {\n return createDynamicValidationState;\n },\n createPostponedAbortSignal: function() {\n return createPostponedAbortSignal;\n },\n formatDynamicAPIAccesses: function() {\n return formatDynamicAPIAccesses;\n },\n getFirstDynamicReason: function() {\n return getFirstDynamicReason;\n },\n isDynamicPostpone: function() {\n return isDynamicPostpone;\n },\n isPrerenderInterruptedError: function() {\n return isPrerenderInterruptedError;\n },\n markCurrentScopeAsDynamic: function() {\n return markCurrentScopeAsDynamic;\n },\n postponeWithTracking: function() {\n return postponeWithTracking;\n },\n throwIfDisallowedDynamic: function() {\n return throwIfDisallowedDynamic;\n },\n throwToInterruptStaticGeneration: function() {\n return throwToInterruptStaticGeneration;\n },\n trackAllowedDynamicAccess: function() {\n return trackAllowedDynamicAccess;\n },\n trackDynamicDataInDynamicRender: function() {\n return trackDynamicDataInDynamicRender;\n },\n trackFallbackParamAccessed: function() {\n return trackFallbackParamAccessed;\n },\n trackSynchronousPlatformIOAccessInDev: function() {\n return trackSynchronousPlatformIOAccessInDev;\n },\n trackSynchronousRequestDataAccessInDev: function() {\n return trackSynchronousRequestDataAccessInDev;\n },\n useDynamicRouteParams: function() {\n return useDynamicRouteParams;\n }\n});\nconst _react = /*#__PURE__*/ _interop_require_default(require(\"react\"));\nconst _hooksservercontext = require(\"../../client/components/hooks-server-context\");\nconst _staticgenerationbailout = require(\"../../client/components/static-generation-bailout\");\nconst _workunitasyncstorageexternal = require(\"./work-unit-async-storage.external\");\nconst _workasyncstorageexternal = require(\"../app-render/work-async-storage.external\");\nconst _dynamicrenderingutils = require(\"../dynamic-rendering-utils\");\nconst _metadataconstants = require(\"../../lib/metadata/metadata-constants\");\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst hasPostpone = typeof _react.default.unstable_postpone === 'function';\nfunction createDynamicTrackingState(isDebugDynamicAccesses) {\n return {\n isDebugDynamicAccesses,\n dynamicAccesses: [],\n syncDynamicExpression: undefined,\n syncDynamicErrorWithStack: null\n };\n}\nfunction createDynamicValidationState() {\n return {\n hasSuspendedDynamic: false,\n hasDynamicMetadata: false,\n hasDynamicViewport: false,\n hasSyncDynamicErrors: false,\n dynamicErrors: []\n };\n}\nfunction getFirstDynamicReason(trackingState) {\n var _trackingState_dynamicAccesses_;\n return (_trackingState_dynamicAccesses_ = trackingState.dynamicAccesses[0]) == null ? void 0 : _trackingState_dynamicAccesses_.expression;\n}\nfunction markCurrentScopeAsDynamic(store, workUnitStore, expression) {\n if (workUnitStore) {\n if (workUnitStore.type === 'cache' || workUnitStore.type === 'unstable-cache') {\n // inside cache scopes marking a scope as dynamic has no effect because the outer cache scope\n // creates a cache boundary. This is subtly different from reading a dynamic data source which is\n // forbidden inside a cache scope.\n return;\n }\n }\n // If we're forcing dynamic rendering or we're forcing static rendering, we\n // don't need to do anything here because the entire page is already dynamic\n // or it's static and it should not throw or postpone here.\n if (store.forceDynamic || store.forceStatic) return;\n if (store.dynamicShouldError) {\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route ${store.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);\n }\n if (workUnitStore) {\n if (workUnitStore.type === 'prerender-ppr') {\n postponeWithTracking(store.route, expression, workUnitStore.dynamicTracking);\n } else if (workUnitStore.type === 'prerender-legacy') {\n workUnitStore.revalidate = 0;\n // We aren't prerendering but we are generating a static page. We need to bail out of static generation\n const err = new _hooksservercontext.DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);\n store.dynamicUsageDescription = expression;\n store.dynamicUsageStack = err.stack;\n throw err;\n } else if (process.env.NODE_ENV === 'development' && workUnitStore && workUnitStore.type === 'request') {\n workUnitStore.usedDynamic = true;\n }\n }\n}\nfunction trackFallbackParamAccessed(store, expression) {\n const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (!prerenderStore || prerenderStore.type !== 'prerender-ppr') return;\n postponeWithTracking(store.route, expression, prerenderStore.dynamicTracking);\n}\nfunction throwToInterruptStaticGeneration(expression, store, prerenderStore) {\n // We aren't prerendering but we are generating a static page. We need to bail out of static generation\n const err = new _hooksservercontext.DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);\n prerenderStore.revalidate = 0;\n store.dynamicUsageDescription = expression;\n store.dynamicUsageStack = err.stack;\n throw err;\n}\nfunction trackDynamicDataInDynamicRender(_store, workUnitStore) {\n if (workUnitStore) {\n if (workUnitStore.type === 'cache' || workUnitStore.type === 'unstable-cache') {\n // inside cache scopes marking a scope as dynamic has no effect because the outer cache scope\n // creates a cache boundary. This is subtly different from reading a dynamic data source which is\n // forbidden inside a cache scope.\n return;\n }\n if (workUnitStore.type === 'prerender' || workUnitStore.type === 'prerender-legacy') {\n workUnitStore.revalidate = 0;\n }\n if (process.env.NODE_ENV === 'development' && workUnitStore.type === 'request') {\n workUnitStore.usedDynamic = true;\n }\n }\n}\n// Despite it's name we don't actually abort unless we have a controller to call abort on\n// There are times when we let a prerender run long to discover caches where we want the semantics\n// of tracking dynamic access without terminating the prerender early\nfunction abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore) {\n const reason = `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`;\n const error = createPrerenderInterruptedError(reason);\n prerenderStore.controller.abort(error);\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n // When we aren't debugging, we don't need to create another error for the\n // stack trace.\n stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,\n expression\n });\n }\n}\nfunction abortOnSynchronousPlatformIOAccess(route, expression, errorWithStack, prerenderStore) {\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n if (dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicExpression = expression;\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack;\n }\n }\n return abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);\n}\nfunction trackSynchronousPlatformIOAccessInDev(requestStore) {\n // We don't actually have a controller to abort but we do the semantic equivalent by\n // advancing the request store out of prerender mode\n requestStore.prerenderPhase = false;\n}\nfunction abortAndThrowOnSynchronousRequestDataAccess(route, expression, errorWithStack, prerenderStore) {\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n if (dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicExpression = expression;\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack;\n if (prerenderStore.validating === true) {\n // We always log Request Access in dev at the point of calling the function\n // So we mark the dynamic validation as not requiring it to be printed\n dynamicTracking.syncDynamicLogged = true;\n }\n }\n }\n abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);\n throw createPrerenderInterruptedError(`Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`);\n}\nconst trackSynchronousRequestDataAccessInDev = trackSynchronousPlatformIOAccessInDev;\nfunction Postpone({ reason, route }) {\n const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n const dynamicTracking = prerenderStore && prerenderStore.type === 'prerender-ppr' ? prerenderStore.dynamicTracking : null;\n postponeWithTracking(route, reason, dynamicTracking);\n}\nfunction postponeWithTracking(route, expression, dynamicTracking) {\n assertPostpone();\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n // When we aren't debugging, we don't need to create another error for the\n // stack trace.\n stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,\n expression\n });\n }\n _react.default.unstable_postpone(createPostponeReason(route, expression));\n}\nfunction createPostponeReason(route, expression) {\n return `Route ${route} needs to bail out of prerendering at this point because it used ${expression}. ` + `React throws this special object to indicate where. It should not be caught by ` + `your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;\n}\nfunction isDynamicPostpone(err) {\n if (typeof err === 'object' && err !== null && typeof err.message === 'string') {\n return isDynamicPostponeReason(err.message);\n }\n return false;\n}\nfunction isDynamicPostponeReason(reason) {\n return reason.includes('needs to bail out of prerendering at this point because it used') && reason.includes('Learn more: https://nextjs.org/docs/messages/ppr-caught-error');\n}\nif (isDynamicPostponeReason(createPostponeReason('%%%', '^^^')) === false) {\n throw new Error('Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js');\n}\nconst NEXT_PRERENDER_INTERRUPTED = 'NEXT_PRERENDER_INTERRUPTED';\nfunction createPrerenderInterruptedError(message) {\n const error = new Error(message);\n error.digest = NEXT_PRERENDER_INTERRUPTED;\n return error;\n}\nfunction isPrerenderInterruptedError(error) {\n return typeof error === 'object' && error !== null && error.digest === NEXT_PRERENDER_INTERRUPTED && 'name' in error && 'message' in error && error instanceof Error;\n}\nfunction accessedDynamicData(dynamicAccesses) {\n return dynamicAccesses.length > 0;\n}\nfunction consumeDynamicAccess(serverDynamic, clientDynamic) {\n // We mutate because we only call this once we are no longer writing\n // to the dynamicTrackingState and it's more efficient than creating a new\n // array.\n serverDynamic.dynamicAccesses.push(...clientDynamic.dynamicAccesses);\n return serverDynamic.dynamicAccesses;\n}\nfunction formatDynamicAPIAccesses(dynamicAccesses) {\n return dynamicAccesses.filter((access)=>typeof access.stack === 'string' && access.stack.length > 0).map(({ expression, stack })=>{\n stack = stack.split('\\n')// Remove the \"Error: \" prefix from the first line of the stack trace as\n // well as the first 4 lines of the stack trace which is the distance\n // from the user code and the `new Error().stack` call.\n .slice(4).filter((line)=>{\n // Exclude Next.js internals from the stack trace.\n if (line.includes('node_modules/next/')) {\n return false;\n }\n // Exclude anonymous functions from the stack trace.\n if (line.includes(' (<anonymous>)')) {\n return false;\n }\n // Exclude Node.js internals from the stack trace.\n if (line.includes(' (node:')) {\n return false;\n }\n return true;\n }).join('\\n');\n return `Dynamic API Usage Debug - ${expression}:\\n${stack}`;\n });\n}\nfunction assertPostpone() {\n if (!hasPostpone) {\n throw new Error(`Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js`);\n }\n}\nfunction createPostponedAbortSignal(reason) {\n assertPostpone();\n const controller = new AbortController();\n // We get our hands on a postpone instance by calling postpone and catching the throw\n try {\n _react.default.unstable_postpone(reason);\n } catch (x) {\n controller.abort(x);\n }\n return controller.signal;\n}\nfunction annotateDynamicAccess(expression, prerenderStore) {\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,\n expression\n });\n }\n}\nfunction useDynamicRouteParams(expression) {\n if (typeof window === 'undefined') {\n const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();\n if (workStore && workStore.isStaticGeneration && workStore.fallbackRouteParams && workStore.fallbackRouteParams.size > 0) {\n // There are fallback route params, we should track these as dynamic\n // accesses.\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n // We're prerendering with dynamicIO or PPR or both\n if (workUnitStore.type === 'prerender') {\n // We are in a prerender with dynamicIO semantics\n // We are going to hang here and never resolve. This will cause the currently\n // rendering component to effectively be a dynamic hole\n _react.default.use((0, _dynamicrenderingutils.makeHangingPromise)(workUnitStore.renderSignal, expression));\n } else if (workUnitStore.type === 'prerender-ppr') {\n // We're prerendering with PPR\n postponeWithTracking(workStore.route, expression, workUnitStore.dynamicTracking);\n } else if (workUnitStore.type === 'prerender-legacy') {\n throwToInterruptStaticGeneration(expression, workStore, workUnitStore);\n }\n }\n }\n }\n}\nconst hasSuspenseRegex = /\\n\\s+at Suspense \\(<anonymous>\\)/;\nconst hasMetadataRegex = new RegExp(`\\\\n\\\\s+at ${_metadataconstants.METADATA_BOUNDARY_NAME}[\\\\n\\\\s]`);\nconst hasViewportRegex = new RegExp(`\\\\n\\\\s+at ${_metadataconstants.VIEWPORT_BOUNDARY_NAME}[\\\\n\\\\s]`);\nconst hasOutletRegex = new RegExp(`\\\\n\\\\s+at ${_metadataconstants.OUTLET_BOUNDARY_NAME}[\\\\n\\\\s]`);\nfunction trackAllowedDynamicAccess(route, componentStack, dynamicValidation, serverDynamic, clientDynamic) {\n if (hasOutletRegex.test(componentStack)) {\n // We don't need to track that this is dynamic. It is only so when something else is also dynamic.\n return;\n } else if (hasMetadataRegex.test(componentStack)) {\n dynamicValidation.hasDynamicMetadata = true;\n return;\n } else if (hasViewportRegex.test(componentStack)) {\n dynamicValidation.hasDynamicViewport = true;\n return;\n } else if (hasSuspenseRegex.test(componentStack)) {\n dynamicValidation.hasSuspendedDynamic = true;\n return;\n } else if (serverDynamic.syncDynamicErrorWithStack || clientDynamic.syncDynamicErrorWithStack) {\n dynamicValidation.hasSyncDynamicErrors = true;\n return;\n } else {\n const message = `Route \"${route}\": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a \"use cache\" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`;\n const error = createErrorWithComponentStack(message, componentStack);\n dynamicValidation.dynamicErrors.push(error);\n return;\n }\n}\nfunction createErrorWithComponentStack(message, componentStack) {\n const error = new Error(message);\n error.stack = 'Error: ' + message + componentStack;\n return error;\n}\nfunction throwIfDisallowedDynamic(route, dynamicValidation, serverDynamic, clientDynamic) {\n let syncError;\n let syncExpression;\n let syncLogged;\n if (serverDynamic.syncDynamicErrorWithStack) {\n syncError = serverDynamic.syncDynamicErrorWithStack;\n syncExpression = serverDynamic.syncDynamicExpression;\n syncLogged = serverDynamic.syncDynamicLogged === true;\n } else if (clientDynamic.syncDynamicErrorWithStack) {\n syncError = clientDynamic.syncDynamicErrorWithStack;\n syncExpression = clientDynamic.syncDynamicExpression;\n syncLogged = clientDynamic.syncDynamicLogged === true;\n } else {\n syncError = null;\n syncExpression = undefined;\n syncLogged = false;\n }\n if (dynamicValidation.hasSyncDynamicErrors && syncError) {\n if (!syncLogged) {\n // In dev we already log errors about sync dynamic access. But during builds we need to ensure\n // the offending sync error is logged before we exit the build\n console.error(syncError);\n }\n // The actual error should have been logged when the sync access ocurred\n throw new _staticgenerationbailout.StaticGenBailoutError();\n }\n const dynamicErrors = dynamicValidation.dynamicErrors;\n if (dynamicErrors.length) {\n for(let i = 0; i < dynamicErrors.length; i++){\n console.error(dynamicErrors[i]);\n }\n throw new _staticgenerationbailout.StaticGenBailoutError();\n }\n if (!dynamicValidation.hasSuspendedDynamic) {\n if (dynamicValidation.hasDynamicMetadata) {\n if (syncError) {\n console.error(syncError);\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route \"${route}\" has a \\`generateMetadata\\` that could not finish rendering before ${syncExpression} was used. Follow the instructions in the error for this expression to resolve.`);\n }\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route \"${route}\" has a \\`generateMetadata\\` that depends on Request data (\\`cookies()\\`, etc...) or external data (\\`fetch(...)\\`, etc...) but the rest of the route was static or only used cached data (\\`\"use cache\"\\`). If you expected this route to be prerenderable update your \\`generateMetadata\\` to not use Request data and only use cached external data. Otherwise, add \\`await connection()\\` somewhere within this route to indicate explicitly it should not be prerendered.`);\n } else if (dynamicValidation.hasDynamicViewport) {\n if (syncError) {\n console.error(syncError);\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route \"${route}\" has a \\`generateViewport\\` that could not finish rendering before ${syncExpression} was used. Follow the instructions in the error for this expression to resolve.`);\n }\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route \"${route}\" has a \\`generateViewport\\` that depends on Request data (\\`cookies()\\`, etc...) or external data (\\`fetch(...)\\`, etc...) but the rest of the route was static or only used cached data (\\`\"use cache\"\\`). If you expected this route to be prerenderable update your \\`generateViewport\\` to not use Request data and only use cached external data. Otherwise, add \\`await connection()\\` somewhere within this route to indicate explicitly it should not be prerendered.`);\n }\n }\n}\n\n//# sourceMappingURL=dynamic-rendering.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"getSegmentParam\", {\n enumerable: true,\n get: function() {\n return getSegmentParam;\n }\n});\nconst _interceptionroutes = require(\"../lib/interception-routes\");\nfunction getSegmentParam(segment) {\n const interceptionMarker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((marker)=>segment.startsWith(marker));\n // if an interception marker is part of the path segment, we need to jump ahead\n // to the relevant portion for param parsing\n if (interceptionMarker) {\n segment = segment.slice(interceptionMarker.length);\n }\n if (segment.startsWith('[[...') && segment.endsWith(']]')) {\n return {\n // TODO-APP: Optional catchall does not currently work with parallel routes,\n // so for now aren't handling a potential interception marker.\n type: 'optional-catchall',\n param: segment.slice(5, -2)\n };\n }\n if (segment.startsWith('[...') && segment.endsWith(']')) {\n return {\n type: interceptionMarker ? 'catchall-intercepted' : 'catchall',\n param: segment.slice(4, -1)\n };\n }\n if (segment.startsWith('[') && segment.endsWith(']')) {\n return {\n type: interceptionMarker ? 'dynamic-intercepted' : 'dynamic',\n param: segment.slice(1, -1)\n };\n }\n return null;\n}\n\n//# sourceMappingURL=get-segment-param.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"workAsyncStorage\", {\n enumerable: true,\n get: function() {\n return _workasyncstorageinstance.workAsyncStorageInstance;\n }\n});\nconst _workasyncstorageinstance = require(\"./work-async-storage-instance\");\n\n//# sourceMappingURL=work-async-storage.external.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n getExpectedRequestStore: null,\n getPrerenderResumeDataCache: null,\n getRenderResumeDataCache: null,\n workUnitAsyncStorage: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n getExpectedRequestStore: function() {\n return getExpectedRequestStore;\n },\n getPrerenderResumeDataCache: function() {\n return getPrerenderResumeDataCache;\n },\n getRenderResumeDataCache: function() {\n return getRenderResumeDataCache;\n },\n workUnitAsyncStorage: function() {\n return _workunitasyncstorageinstance.workUnitAsyncStorageInstance;\n }\n});\nconst _workunitasyncstorageinstance = require(\"./work-unit-async-storage-instance\");\nfunction getExpectedRequestStore(callingExpression) {\n const workUnitStore = _workunitasyncstorageinstance.workUnitAsyncStorageInstance.getStore();\n if (workUnitStore) {\n if (workUnitStore.type === 'request') {\n return workUnitStore;\n }\n if (workUnitStore.type === 'prerender' || workUnitStore.type === 'prerender-ppr' || workUnitStore.type === 'prerender-legacy') {\n // This should not happen because we should have checked it already.\n throw new Error(`\\`${callingExpression}\\` cannot be called inside a prerender. This is a bug in Next.js.`);\n }\n if (workUnitStore.type === 'cache') {\n throw new Error(`\\`${callingExpression}\\` cannot be called inside \"use cache\". Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/messages/next-request-in-use-cache`);\n } else if (workUnitStore.type === 'unstable-cache') {\n throw new Error(`\\`${callingExpression}\\` cannot be called inside unstable_cache. Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);\n }\n }\n throw new Error(`\\`${callingExpression}\\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`);\n}\nfunction getPrerenderResumeDataCache(workUnitStore) {\n if (workUnitStore.type === 'prerender' || workUnitStore.type === 'prerender-ppr') {\n return workUnitStore.prerenderResumeDataCache;\n }\n return null;\n}\nfunction getRenderResumeDataCache(workUnitStore) {\n if (workUnitStore.type !== 'prerender-legacy' && workUnitStore.type !== 'cache' && workUnitStore.type !== 'unstable-cache') {\n if (workUnitStore.type === 'request') {\n return workUnitStore.renderResumeDataCache;\n }\n // We return the mutable resume data cache here as an immutable version of\n // the cache as it can also be used for reading.\n return workUnitStore.prerenderResumeDataCache;\n }\n return null;\n}\n\n//# sourceMappingURL=work-unit-async-storage.external.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"createDedupedByCallsiteServerErrorLoggerDev\", {\n enumerable: true,\n get: function() {\n return createDedupedByCallsiteServerErrorLoggerDev;\n }\n});\nconst _react = /*#__PURE__*/ _interop_require_wildcard(require(\"react\"));\nfunction _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) {\n return obj;\n }\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") {\n return {\n default: obj\n };\n }\n var cache = _getRequireWildcardCache(nodeInterop);\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n var newObj = {\n __proto__: null\n };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n for(var key in obj){\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n newObj.default = obj;\n if (cache) {\n cache.set(obj, newObj);\n }\n return newObj;\n}\nconst errorRef = {\n current: null\n};\n// React.cache is currently only available in canary/experimental React channels.\nconst cache = typeof _react.cache === 'function' ? _react.cache : (fn)=>fn;\n// When Dynamic IO is enabled, we record these as errors so that they\n// are captured by the dev overlay as it's more critical to fix these\n// when enabled.\nconst logErrorOrWarn = process.env.__NEXT_DYNAMIC_IO ? console.error : console.warn;\n// We don't want to dedupe across requests.\n// The developer might've just attempted to fix the warning so we should warn again if it still happens.\nconst flushCurrentErrorIfNew = cache(// eslint-disable-next-line @typescript-eslint/no-unused-vars -- cache key\n(key)=>{\n try {\n logErrorOrWarn(errorRef.current);\n } finally{\n errorRef.current = null;\n }\n});\nfunction createDedupedByCallsiteServerErrorLoggerDev(getMessage) {\n return function logDedupedError(...args) {\n const message = getMessage(...args);\n if (process.env.NODE_ENV !== 'production') {\n var _stack;\n const callStackFrames = (_stack = new Error().stack) == null ? void 0 : _stack.split('\\n');\n if (callStackFrames === undefined || callStackFrames.length < 4) {\n logErrorOrWarn(message);\n } else {\n // Error:\n // logDedupedError\n // asyncApiBeingAccessedSynchronously\n // <userland callsite>\n // TODO: This breaks if sourcemaps with ignore lists are enabled.\n const key = callStackFrames[4];\n errorRef.current = message;\n flushCurrentErrorIfNew(key);\n }\n } else {\n logErrorOrWarn(message);\n }\n };\n}\n\n//# sourceMappingURL=create-deduped-by-callsite-server-error-logger.js.map","/**\n * This function constructs a promise that will never resolve. This is primarily\n * useful for dynamicIO where we use promise resolution timing to determine which\n * parts of a render can be included in a prerender.\n *\n * @internal\n */ \"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"makeHangingPromise\", {\n enumerable: true,\n get: function() {\n return makeHangingPromise;\n }\n});\nfunction makeHangingPromise(signal, expression) {\n const hangingPromise = new Promise((_, reject)=>{\n signal.addEventListener('abort', ()=>{\n reject(new Error(`During prerendering, ${expression} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${expression} to a different context by using \\`setTimeout\\`, \\`after\\`, or similar functions you may observe this error and you should handle it in that context.`));\n }, {\n once: true\n });\n });\n // We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so\n // we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct\n // your own promise out of it you'll need to ensure you handle the error when it rejects.\n hangingPromise.catch(ignoreReject);\n return hangingPromise;\n}\nfunction ignoreReject() {}\n\n//# sourceMappingURL=dynamic-rendering-utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n INTERCEPTION_ROUTE_MARKERS: null,\n extractInterceptionRouteInformation: null,\n isInterceptionRouteAppPath: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n INTERCEPTION_ROUTE_MARKERS: function() {\n return INTERCEPTION_ROUTE_MARKERS;\n },\n extractInterceptionRouteInformation: function() {\n return extractInterceptionRouteInformation;\n },\n isInterceptionRouteAppPath: function() {\n return isInterceptionRouteAppPath;\n }\n});\nconst _apppaths = require(\"../../shared/lib/router/utils/app-paths\");\nconst INTERCEPTION_ROUTE_MARKERS = [\n '(..)(..)',\n '(.)',\n '(..)',\n '(...)'\n];\nfunction isInterceptionRouteAppPath(path) {\n // TODO-APP: add more serious validation\n return path.split('/').find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined;\n}\nfunction extractInterceptionRouteInformation(path) {\n let interceptingRoute, marker, interceptedRoute;\n for (const segment of path.split('/')){\n marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));\n if (marker) {\n ;\n [interceptingRoute, interceptedRoute] = path.split(marker, 2);\n break;\n }\n }\n if (!interceptingRoute || !marker || !interceptedRoute) {\n throw new Error(`Invalid interception route: ${path}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);\n }\n interceptingRoute = (0, _apppaths.normalizeAppPath)(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed\n ;\n switch(marker){\n case '(.)':\n // (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route\n if (interceptingRoute === '/') {\n interceptedRoute = `/${interceptedRoute}`;\n } else {\n interceptedRoute = interceptingRoute + '/' + interceptedRoute;\n }\n break;\n case '(..)':\n // (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route\n if (interceptingRoute === '/') {\n throw new Error(`Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`);\n }\n interceptedRoute = interceptingRoute.split('/').slice(0, -1).concat(interceptedRoute).join('/');\n break;\n case '(...)':\n // (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route\n interceptedRoute = '/' + interceptedRoute;\n break;\n case '(..)(..)':\n // (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route\n const splitInterceptingRoute = interceptingRoute.split('/');\n if (splitInterceptingRoute.length <= 2) {\n throw new Error(`Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`);\n }\n interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join('/');\n break;\n default:\n throw new Error('Invariant: unexpected marker');\n }\n return {\n interceptingRoute,\n interceptedRoute\n };\n}\n\n//# sourceMappingURL=interception-routes.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isPostpone\", {\n enumerable: true,\n get: function() {\n return isPostpone;\n }\n});\nconst REACT_POSTPONE_TYPE = Symbol.for('react.postpone');\nfunction isPostpone(error) {\n return typeof error === 'object' && error !== null && error.$$typeof === REACT_POSTPONE_TYPE;\n}\n\n//# sourceMappingURL=is-postpone.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"createRenderParamsFromClient\", {\n enumerable: true,\n get: function() {\n return createRenderParamsFromClient;\n }\n});\nconst _reflect = require(\"../web/spec-extension/adapters/reflect\");\nconst _invarianterror = require(\"../../shared/lib/invariant-error\");\nconst _utils = require(\"./utils\");\nfunction createRenderParamsFromClient(underlyingParams) {\n if (process.env.NODE_ENV === 'development') {\n return makeDynamicallyTrackedExoticParamsWithDevWarnings(underlyingParams);\n } else {\n return makeUntrackedExoticParams(underlyingParams);\n }\n}\nconst CachedParams = new WeakMap();\nfunction makeUntrackedExoticParams(underlyingParams) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n const promise = Promise.resolve(underlyingParams);\n CachedParams.set(underlyingParams, promise);\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n ;\n promise[prop] = underlyingParams[prop];\n }\n });\n return promise;\n}\nfunction makeDynamicallyTrackedExoticParamsWithDevWarnings(underlyingParams) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(underlyingParams);\n const proxiedProperties = new Set();\n const unproxiedProperties = [];\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n proxiedProperties.add(prop);\n promise[prop] = underlyingParams[prop];\n }\n });\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (typeof prop === 'string') {\n if (// We are accessing a property that was proxied to the promise instance\n proxiedProperties.has(prop)) {\n const expression = (0, _utils.describeStringPropertyAccess)('params', prop);\n warnForSyncAccess(expression);\n }\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === 'string') {\n proxiedProperties.delete(prop);\n }\n return _reflect.ReflectAdapter.set(target, prop, value, receiver);\n },\n ownKeys (target) {\n warnForEnumeration(unproxiedProperties);\n return Reflect.ownKeys(target);\n }\n });\n CachedParams.set(underlyingParams, proxiedPromise);\n return proxiedPromise;\n}\nconst noop = ()=>{};\nconst warnForSyncAccess = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : function warnForSyncAccess(expression) {\n if (process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS) {\n return;\n }\n console.error(`A param property was accessed directly with ${expression}. \\`params\\` is now a Promise and should be unwrapped with \\`React.use()\\` before accessing properties of the underlying params object. In this version of Next.js direct access to param properties is still supported to facilitate migration but in a future version you will be required to unwrap \\`params\\` with \\`React.use()\\`.`);\n};\nconst warnForEnumeration = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : function warnForEnumeration(missingProperties) {\n if (process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS) {\n return;\n }\n if (missingProperties.length) {\n const describedMissingProperties = describeListOfPropertyNames(missingProperties);\n console.error(`params are being enumerated incompletely missing these properties: ${describedMissingProperties}. ` + `\\`params\\` should be unwrapped with \\`React.use()\\` before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n } else {\n console.error(`params are being enumerated. ` + `\\`params\\` should be unwrapped with \\`React.use()\\` before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n }\n};\nfunction describeListOfPropertyNames(properties) {\n switch(properties.length){\n case 0:\n throw new _invarianterror.InvariantError('Expected describeListOfPropertyNames to be called with a non-empty list of strings.');\n case 1:\n return `\\`${properties[0]}\\``;\n case 2:\n return `\\`${properties[0]}\\` and \\`${properties[1]}\\``;\n default:\n {\n let description = '';\n for(let i = 0; i < properties.length - 1; i++){\n description += `\\`${properties[i]}\\`, `;\n }\n description += `, and \\`${properties[properties.length - 1]}\\``;\n return description;\n }\n }\n}\n\n//# sourceMappingURL=params.browser.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n createParamsFromClient: null,\n createPrerenderParamsForClientSegment: null,\n createServerParamsForMetadata: null,\n createServerParamsForRoute: null,\n createServerParamsForServerSegment: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n createParamsFromClient: function() {\n return createParamsFromClient;\n },\n createPrerenderParamsForClientSegment: function() {\n return createPrerenderParamsForClientSegment;\n },\n createServerParamsForMetadata: function() {\n return createServerParamsForMetadata;\n },\n createServerParamsForRoute: function() {\n return createServerParamsForRoute;\n },\n createServerParamsForServerSegment: function() {\n return createServerParamsForServerSegment;\n }\n});\nconst _reflect = require(\"../web/spec-extension/adapters/reflect\");\nconst _dynamicrendering = require(\"../app-render/dynamic-rendering\");\nconst _workunitasyncstorageexternal = require(\"../app-render/work-unit-async-storage.external\");\nconst _invarianterror = require(\"../../shared/lib/invariant-error\");\nconst _utils = require(\"./utils\");\nconst _dynamicrenderingutils = require(\"../dynamic-rendering-utils\");\nconst _creatededupedbycallsiteservererrorlogger = require(\"../create-deduped-by-callsite-server-error-logger\");\nconst _scheduler = require(\"../../lib/scheduler\");\nfunction createParamsFromClient(underlyingParams, workStore) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderParams(underlyingParams, workStore, workUnitStore);\n default:\n }\n }\n return createRenderParams(underlyingParams, workStore);\n}\nconst createServerParamsForMetadata = createServerParamsForServerSegment;\nfunction createServerParamsForRoute(underlyingParams, workStore) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderParams(underlyingParams, workStore, workUnitStore);\n default:\n }\n }\n return createRenderParams(underlyingParams, workStore);\n}\nfunction createServerParamsForServerSegment(underlyingParams, workStore) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderParams(underlyingParams, workStore, workUnitStore);\n default:\n }\n }\n return createRenderParams(underlyingParams, workStore);\n}\nfunction createPrerenderParamsForClientSegment(underlyingParams, workStore) {\n const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (prerenderStore && prerenderStore.type === 'prerender') {\n const fallbackParams = workStore.fallbackRouteParams;\n if (fallbackParams) {\n for(let key in underlyingParams){\n if (fallbackParams.has(key)) {\n // This params object has one of more fallback params so we need to consider\n // the awaiting of this params object \"dynamic\". Since we are in dynamicIO mode\n // we encode this as a promise that never resolves\n return (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`params`');\n }\n }\n }\n }\n // We're prerendering in a mode that does not abort. We resolve the promise without\n // any tracking because we're just transporting a value from server to client where the tracking\n // will be applied.\n return Promise.resolve(underlyingParams);\n}\nfunction createPrerenderParams(underlyingParams, workStore, prerenderStore) {\n const fallbackParams = workStore.fallbackRouteParams;\n if (fallbackParams) {\n let hasSomeFallbackParams = false;\n for(const key in underlyingParams){\n if (fallbackParams.has(key)) {\n hasSomeFallbackParams = true;\n break;\n }\n }\n if (hasSomeFallbackParams) {\n // params need to be treated as dynamic because we have at least one fallback param\n if (prerenderStore.type === 'prerender') {\n // We are in a dynamicIO (PPR or otherwise) prerender\n return makeAbortingExoticParams(underlyingParams, workStore.route, prerenderStore);\n }\n // remaining cases are prender-ppr and prerender-legacy\n // We aren't in a dynamicIO prerender but we do have fallback params at this\n // level so we need to make an erroring exotic params object which will postpone\n // if you access the fallback params\n return makeErroringExoticParams(underlyingParams, fallbackParams, workStore, prerenderStore);\n }\n }\n // We don't have any fallback params so we have an entirely static safe params object\n return makeUntrackedExoticParams(underlyingParams);\n}\nfunction createRenderParams(underlyingParams, workStore) {\n if (process.env.NODE_ENV === 'development' && !workStore.isPrefetchRequest) {\n return makeDynamicallyTrackedExoticParamsWithDevWarnings(underlyingParams, workStore);\n } else {\n return makeUntrackedExoticParams(underlyingParams);\n }\n}\nconst CachedParams = new WeakMap();\nfunction makeAbortingExoticParams(underlyingParams, route, prerenderStore) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`params`');\n CachedParams.set(underlyingParams, promise);\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n Object.defineProperty(promise, prop, {\n get () {\n const expression = (0, _utils.describeStringPropertyAccess)('params', prop);\n const error = createParamsAccessError(route, expression);\n (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);\n },\n set (newValue) {\n Object.defineProperty(promise, prop, {\n value: newValue,\n writable: true,\n enumerable: true\n });\n },\n enumerable: true,\n configurable: true\n });\n }\n });\n return promise;\n}\nfunction makeErroringExoticParams(underlyingParams, fallbackParams, workStore, prerenderStore) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n const augmentedUnderlying = {\n ...underlyingParams\n };\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(augmentedUnderlying);\n CachedParams.set(underlyingParams, promise);\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n if (fallbackParams.has(prop)) {\n Object.defineProperty(augmentedUnderlying, prop, {\n get () {\n const expression = (0, _utils.describeStringPropertyAccess)('params', prop);\n // In most dynamic APIs we also throw if `dynamic = \"error\"` however\n // for params is only dynamic when we're generating a fallback shell\n // and even when `dynamic = \"error\"` we still support generating dynamic\n // fallback shells\n // TODO remove this comment when dynamicIO is the default since there\n // will be no `dynamic = \"error\"`\n if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n },\n enumerable: true\n });\n Object.defineProperty(promise, prop, {\n get () {\n const expression = (0, _utils.describeStringPropertyAccess)('params', prop);\n // In most dynamic APIs we also throw if `dynamic = \"error\"` however\n // for params is only dynamic when we're generating a fallback shell\n // and even when `dynamic = \"error\"` we still support generating dynamic\n // fallback shells\n // TODO remove this comment when dynamicIO is the default since there\n // will be no `dynamic = \"error\"`\n if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n },\n set (newValue) {\n Object.defineProperty(promise, prop, {\n value: newValue,\n writable: true,\n enumerable: true\n });\n },\n enumerable: true,\n configurable: true\n });\n } else {\n ;\n promise[prop] = underlyingParams[prop];\n }\n }\n });\n return promise;\n}\nfunction makeUntrackedExoticParams(underlyingParams) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(underlyingParams);\n CachedParams.set(underlyingParams, promise);\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n ;\n promise[prop] = underlyingParams[prop];\n }\n });\n return promise;\n}\nfunction makeDynamicallyTrackedExoticParamsWithDevWarnings(underlyingParams, store) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = new Promise((resolve)=>(0, _scheduler.scheduleImmediate)(()=>resolve(underlyingParams)));\n const proxiedProperties = new Set();\n const unproxiedProperties = [];\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n unproxiedProperties.push(prop);\n } else {\n proxiedProperties.add(prop);\n promise[prop] = underlyingParams[prop];\n }\n });\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (typeof prop === 'string') {\n if (// We are accessing a property that was proxied to the promise instance\n proxiedProperties.has(prop)) {\n const expression = (0, _utils.describeStringPropertyAccess)('params', prop);\n syncIODev(store.route, expression);\n }\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === 'string') {\n proxiedProperties.delete(prop);\n }\n return _reflect.ReflectAdapter.set(target, prop, value, receiver);\n },\n ownKeys (target) {\n const expression = '`...params` or similar expression';\n syncIODev(store.route, expression, unproxiedProperties);\n return Reflect.ownKeys(target);\n }\n });\n CachedParams.set(underlyingParams, proxiedPromise);\n return proxiedPromise;\n}\nfunction syncIODev(route, expression, missingProperties) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore && workUnitStore.type === 'request' && workUnitStore.prerenderPhase === true) {\n // When we're rendering dynamically in dev we need to advance out of the\n // Prerender environment when we read Request data synchronously\n const requestStore = workUnitStore;\n (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(requestStore);\n }\n // In all cases we warn normally\n if (missingProperties && missingProperties.length > 0) {\n warnForIncompleteEnumeration(route, expression, missingProperties);\n } else {\n warnForSyncAccess(route, expression);\n }\n}\nconst noop = ()=>{};\nconst warnForSyncAccess = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createParamsAccessError);\nconst warnForIncompleteEnumeration = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createIncompleteEnumerationError);\nfunction createParamsAccessError(route, expression) {\n const prefix = route ? `Route \"${route}\" ` : 'This route ';\n return new Error(`${prefix}used ${expression}. ` + `\\`params\\` should be awaited before using its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n}\nfunction createIncompleteEnumerationError(route, expression, missingProperties) {\n const prefix = route ? `Route \"${route}\" ` : 'This route ';\n return new Error(`${prefix}used ${expression}. ` + `\\`params\\` should be awaited before using its properties. ` + `The following properties were not available through enumeration ` + `because they conflict with builtin property names: ` + `${describeListOfPropertyNames(missingProperties)}. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n}\nfunction describeListOfPropertyNames(properties) {\n switch(properties.length){\n case 0:\n throw new _invarianterror.InvariantError('Expected describeListOfPropertyNames to be called with a non-empty list of strings.');\n case 1:\n return `\\`${properties[0]}\\``;\n case 2:\n return `\\`${properties[0]}\\` and \\`${properties[1]}\\``;\n default:\n {\n let description = '';\n for(let i = 0; i < properties.length - 1; i++){\n description += `\\`${properties[i]}\\`, `;\n }\n description += `, and \\`${properties[properties.length - 1]}\\``;\n return description;\n }\n }\n}\n\n//# sourceMappingURL=params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"createRenderSearchParamsFromClient\", {\n enumerable: true,\n get: function() {\n return createRenderSearchParamsFromClient;\n }\n});\nconst _reflect = require(\"../web/spec-extension/adapters/reflect\");\nconst _utils = require(\"./utils\");\nfunction createRenderSearchParamsFromClient(underlyingSearchParams) {\n if (process.env.NODE_ENV === 'development') {\n return makeUntrackedExoticSearchParamsWithDevWarnings(underlyingSearchParams);\n } else {\n return makeUntrackedExoticSearchParams(underlyingSearchParams);\n }\n}\nconst CachedSearchParams = new WeakMap();\nfunction makeUntrackedExoticSearchParamsWithDevWarnings(underlyingSearchParams) {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n const proxiedProperties = new Set();\n const unproxiedProperties = [];\n const promise = Promise.resolve(underlyingSearchParams);\n Object.keys(underlyingSearchParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n unproxiedProperties.push(prop);\n } else {\n proxiedProperties.add(prop);\n promise[prop] = underlyingSearchParams[prop];\n }\n });\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (typeof prop === 'string') {\n if (!_utils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor\n // the underlying searchParams.\n Reflect.has(target, prop) === false)) {\n const expression = (0, _utils.describeStringPropertyAccess)('searchParams', prop);\n warnForSyncAccess(expression);\n }\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === 'string') {\n proxiedProperties.delete(prop);\n }\n return Reflect.set(target, prop, value, receiver);\n },\n has (target, prop) {\n if (typeof prop === 'string') {\n if (!_utils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor\n // the underlying searchParams.\n Reflect.has(target, prop) === false)) {\n const expression = (0, _utils.describeHasCheckingStringProperty)('searchParams', prop);\n warnForSyncAccess(expression);\n }\n }\n return Reflect.has(target, prop);\n },\n ownKeys (target) {\n warnForSyncSpread();\n return Reflect.ownKeys(target);\n }\n });\n CachedSearchParams.set(underlyingSearchParams, proxiedPromise);\n return proxiedPromise;\n}\nfunction makeUntrackedExoticSearchParams(underlyingSearchParams) {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n // We don't use makeResolvedReactPromise here because searchParams\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(underlyingSearchParams);\n CachedSearchParams.set(underlyingSearchParams, promise);\n Object.keys(underlyingSearchParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n ;\n promise[prop] = underlyingSearchParams[prop];\n }\n });\n return promise;\n}\nconst noop = ()=>{};\nconst warnForSyncAccess = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : function warnForSyncAccess(expression) {\n if (process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS) {\n return;\n }\n console.error(`A searchParam property was accessed directly with ${expression}. ` + `\\`searchParams\\` should be unwrapped with \\`React.use()\\` before accessing its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n};\nconst warnForSyncSpread = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : function warnForSyncSpread() {\n if (process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS) {\n return;\n }\n console.error(`The keys of \\`searchParams\\` were accessed directly. ` + `\\`searchParams\\` should be unwrapped with \\`React.use()\\` before accessing its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n};\n\n//# sourceMappingURL=search-params.browser.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n createPrerenderSearchParamsForClientPage: null,\n createSearchParamsFromClient: null,\n createServerSearchParamsForMetadata: null,\n createServerSearchParamsForServerPage: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n createPrerenderSearchParamsForClientPage: function() {\n return createPrerenderSearchParamsForClientPage;\n },\n createSearchParamsFromClient: function() {\n return createSearchParamsFromClient;\n },\n createServerSearchParamsForMetadata: function() {\n return createServerSearchParamsForMetadata;\n },\n createServerSearchParamsForServerPage: function() {\n return createServerSearchParamsForServerPage;\n }\n});\nconst _reflect = require(\"../web/spec-extension/adapters/reflect\");\nconst _dynamicrendering = require(\"../app-render/dynamic-rendering\");\nconst _workunitasyncstorageexternal = require(\"../app-render/work-unit-async-storage.external\");\nconst _invarianterror = require(\"../../shared/lib/invariant-error\");\nconst _dynamicrenderingutils = require(\"../dynamic-rendering-utils\");\nconst _creatededupedbycallsiteservererrorlogger = require(\"../create-deduped-by-callsite-server-error-logger\");\nconst _utils = require(\"./utils\");\nconst _scheduler = require(\"../../lib/scheduler\");\nfunction createSearchParamsFromClient(underlyingSearchParams, workStore) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderSearchParams(workStore, workUnitStore);\n default:\n }\n }\n return createRenderSearchParams(underlyingSearchParams, workStore);\n}\nconst createServerSearchParamsForMetadata = createServerSearchParamsForServerPage;\nfunction createServerSearchParamsForServerPage(underlyingSearchParams, workStore) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderSearchParams(workStore, workUnitStore);\n default:\n }\n }\n return createRenderSearchParams(underlyingSearchParams, workStore);\n}\nfunction createPrerenderSearchParamsForClientPage(workStore) {\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // dictionary object.\n return Promise.resolve({});\n }\n const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (prerenderStore && prerenderStore.type === 'prerender') {\n // dynamicIO Prerender\n // We're prerendering in a mode that aborts (dynamicIO) and should stall\n // the promise to ensure the RSC side is considered dynamic\n return (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`searchParams`');\n }\n // We're prerendering in a mode that does not aborts. We resolve the promise without\n // any tracking because we're just transporting a value from server to client where the tracking\n // will be applied.\n return Promise.resolve({});\n}\nfunction createPrerenderSearchParams(workStore, prerenderStore) {\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // dictionary object.\n return Promise.resolve({});\n }\n if (prerenderStore.type === 'prerender') {\n // We are in a dynamicIO (PPR or otherwise) prerender\n return makeAbortingExoticSearchParams(workStore.route, prerenderStore);\n }\n // The remaining cases are prerender-ppr and prerender-legacy\n // We are in a legacy static generation and need to interrupt the prerender\n // when search params are accessed.\n return makeErroringExoticSearchParams(workStore, prerenderStore);\n}\nfunction createRenderSearchParams(underlyingSearchParams, workStore) {\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // dictionary object.\n return Promise.resolve({});\n } else {\n if (process.env.NODE_ENV === 'development' && !workStore.isPrefetchRequest) {\n return makeDynamicallyTrackedExoticSearchParamsWithDevWarnings(underlyingSearchParams, workStore);\n } else {\n return makeUntrackedExoticSearchParams(underlyingSearchParams, workStore);\n }\n }\n}\nconst CachedSearchParams = new WeakMap();\nfunction makeAbortingExoticSearchParams(route, prerenderStore) {\n const cachedSearchParams = CachedSearchParams.get(prerenderStore);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`searchParams`');\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (Object.hasOwn(promise, prop)) {\n // The promise has this property directly. we must return it.\n // We know it isn't a dynamic access because it can only be something\n // that was previously written to the promise and thus not an underlying searchParam value\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n switch(prop){\n case 'then':\n {\n const expression = '`await searchParams`, `searchParams.then`, or similar';\n (0, _dynamicrendering.annotateDynamicAccess)(expression, prerenderStore);\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n case 'status':\n {\n const expression = '`use(searchParams)`, `searchParams.status`, or similar';\n (0, _dynamicrendering.annotateDynamicAccess)(expression, prerenderStore);\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n // Object prototype\n case 'hasOwnProperty':\n case 'isPrototypeOf':\n case 'propertyIsEnumerable':\n case 'toString':\n case 'valueOf':\n case 'toLocaleString':\n // Promise prototype\n // fallthrough\n case 'catch':\n case 'finally':\n // Common tested properties\n // fallthrough\n case 'toJSON':\n case '$$typeof':\n case '__esModule':\n {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n default:\n {\n if (typeof prop === 'string') {\n const expression = (0, _utils.describeStringPropertyAccess)('searchParams', prop);\n const error = createSearchAccessError(route, expression);\n (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n }\n },\n has (target, prop) {\n // We don't expect key checking to be used except for testing the existence of\n // searchParams so we make all has tests trigger dynamic. this means that `promise.then`\n // can resolve to the then function on the Promise prototype but 'then' in promise will assume\n // you are testing whether the searchParams has a 'then' property.\n if (typeof prop === 'string') {\n const expression = (0, _utils.describeHasCheckingStringProperty)('searchParams', prop);\n const error = createSearchAccessError(route, expression);\n (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);\n }\n return _reflect.ReflectAdapter.has(target, prop);\n },\n ownKeys () {\n const expression = '`{...searchParams}`, `Object.keys(searchParams)`, or similar';\n const error = createSearchAccessError(route, expression);\n (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);\n }\n });\n CachedSearchParams.set(prerenderStore, proxiedPromise);\n return proxiedPromise;\n}\nfunction makeErroringExoticSearchParams(workStore, prerenderStore) {\n const cachedSearchParams = CachedSearchParams.get(workStore);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n const underlyingSearchParams = {};\n // For search params we don't construct a ReactPromise because we want to interrupt\n // rendering on any property access that was not set from outside and so we only want\n // to have properties like value and status if React sets them.\n const promise = Promise.resolve(underlyingSearchParams);\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (Object.hasOwn(promise, prop)) {\n // The promise has this property directly. we must return it.\n // We know it isn't a dynamic access because it can only be something\n // that was previously written to the promise and thus not an underlying searchParam value\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n switch(prop){\n // Object prototype\n case 'hasOwnProperty':\n case 'isPrototypeOf':\n case 'propertyIsEnumerable':\n case 'toString':\n case 'valueOf':\n case 'toLocaleString':\n // Promise prototype\n // fallthrough\n case 'catch':\n case 'finally':\n // Common tested properties\n // fallthrough\n case 'toJSON':\n case '$$typeof':\n case '__esModule':\n {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n case 'then':\n {\n const expression = '`await searchParams`, `searchParams.then`, or similar';\n if (workStore.dynamicShouldError) {\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n return;\n }\n case 'status':\n {\n const expression = '`use(searchParams)`, `searchParams.status`, or similar';\n if (workStore.dynamicShouldError) {\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n return;\n }\n default:\n {\n if (typeof prop === 'string') {\n const expression = (0, _utils.describeStringPropertyAccess)('searchParams', prop);\n if (workStore.dynamicShouldError) {\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n }\n },\n has (target, prop) {\n // We don't expect key checking to be used except for testing the existence of\n // searchParams so we make all has tests trigger dynamic. this means that `promise.then`\n // can resolve to the then function on the Promise prototype but 'then' in promise will assume\n // you are testing whether the searchParams has a 'then' property.\n if (typeof prop === 'string') {\n const expression = (0, _utils.describeHasCheckingStringProperty)('searchParams', prop);\n if (workStore.dynamicShouldError) {\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n return false;\n }\n return _reflect.ReflectAdapter.has(target, prop);\n },\n ownKeys () {\n const expression = '`{...searchParams}`, `Object.keys(searchParams)`, or similar';\n if (workStore.dynamicShouldError) {\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n }\n });\n CachedSearchParams.set(workStore, proxiedPromise);\n return proxiedPromise;\n}\nfunction makeUntrackedExoticSearchParams(underlyingSearchParams, store) {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n // We don't use makeResolvedReactPromise here because searchParams\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(underlyingSearchParams);\n CachedSearchParams.set(underlyingSearchParams, promise);\n Object.keys(underlyingSearchParams).forEach((prop)=>{\n switch(prop){\n // Object prototype\n case 'hasOwnProperty':\n case 'isPrototypeOf':\n case 'propertyIsEnumerable':\n case 'toString':\n case 'valueOf':\n case 'toLocaleString':\n // Promise prototype\n // fallthrough\n case 'then':\n case 'catch':\n case 'finally':\n // React Promise extension\n // fallthrough\n case 'status':\n // Common tested properties\n // fallthrough\n case 'toJSON':\n case '$$typeof':\n case '__esModule':\n {\n break;\n }\n default:\n {\n Object.defineProperty(promise, prop, {\n get () {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n (0, _dynamicrendering.trackDynamicDataInDynamicRender)(store, workUnitStore);\n return underlyingSearchParams[prop];\n },\n set (value) {\n Object.defineProperty(promise, prop, {\n value,\n writable: true,\n enumerable: true\n });\n },\n enumerable: true,\n configurable: true\n });\n }\n }\n });\n return promise;\n}\nfunction makeDynamicallyTrackedExoticSearchParamsWithDevWarnings(underlyingSearchParams, store) {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n const proxiedProperties = new Set();\n const unproxiedProperties = [];\n // We have an unfortunate sequence of events that requires this initialization logic. We want to instrument the underlying\n // searchParams object to detect if you are accessing values in dev. This is used for warnings and for things like the static prerender\n // indicator. However when we pass this proxy to our Promise.resolve() below the VM checks if the resolved value is a promise by looking\n // at the `.then` property. To our dynamic tracking logic this is indistinguishable from a `then` searchParam and so we would normally trigger\n // dynamic tracking. However we know that this .then is not real dynamic access, it's just how thenables resolve in sequence. So we introduce\n // this initialization concept so we omit the dynamic check until after we've constructed our resolved promise.\n let promiseInitialized = false;\n const proxiedUnderlying = new Proxy(underlyingSearchParams, {\n get (target, prop, receiver) {\n if (typeof prop === 'string' && promiseInitialized) {\n if (store.dynamicShouldError) {\n const expression = (0, _utils.describeStringPropertyAccess)('searchParams', prop);\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);\n }\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n (0, _dynamicrendering.trackDynamicDataInDynamicRender)(store, workUnitStore);\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n has (target, prop) {\n if (typeof prop === 'string') {\n if (store.dynamicShouldError) {\n const expression = (0, _utils.describeHasCheckingStringProperty)('searchParams', prop);\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);\n }\n }\n return Reflect.has(target, prop);\n },\n ownKeys (target) {\n if (store.dynamicShouldError) {\n const expression = '`{...searchParams}`, `Object.keys(searchParams)`, or similar';\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);\n }\n return Reflect.ownKeys(target);\n }\n });\n // We don't use makeResolvedReactPromise here because searchParams\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = new Promise((resolve)=>(0, _scheduler.scheduleImmediate)(()=>resolve(underlyingSearchParams)));\n promise.then(()=>{\n promiseInitialized = true;\n });\n Object.keys(underlyingSearchParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n unproxiedProperties.push(prop);\n } else {\n proxiedProperties.add(prop);\n Object.defineProperty(promise, prop, {\n get () {\n return proxiedUnderlying[prop];\n },\n set (newValue) {\n Object.defineProperty(promise, prop, {\n value: newValue,\n writable: true,\n enumerable: true\n });\n },\n enumerable: true,\n configurable: true\n });\n }\n });\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (prop === 'then' && store.dynamicShouldError) {\n const expression = '`searchParams.then`';\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);\n }\n if (typeof prop === 'string') {\n if (!_utils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor\n // the underlying searchParams.\n Reflect.has(target, prop) === false)) {\n const expression = (0, _utils.describeStringPropertyAccess)('searchParams', prop);\n syncIODev(store.route, expression);\n }\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === 'string') {\n proxiedProperties.delete(prop);\n }\n return Reflect.set(target, prop, value, receiver);\n },\n has (target, prop) {\n if (typeof prop === 'string') {\n if (!_utils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor\n // the underlying searchParams.\n Reflect.has(target, prop) === false)) {\n const expression = (0, _utils.describeHasCheckingStringProperty)('searchParams', prop);\n syncIODev(store.route, expression);\n }\n }\n return Reflect.has(target, prop);\n },\n ownKeys (target) {\n const expression = '`Object.keys(searchParams)` or similar';\n syncIODev(store.route, expression, unproxiedProperties);\n return Reflect.ownKeys(target);\n }\n });\n CachedSearchParams.set(underlyingSearchParams, proxiedPromise);\n return proxiedPromise;\n}\nfunction syncIODev(route, expression, missingProperties) {\n // In all cases we warn normally\n if (missingProperties && missingProperties.length > 0) {\n warnForIncompleteEnumeration(route, expression, missingProperties);\n } else {\n warnForSyncAccess(route, expression);\n }\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore && workUnitStore.type === 'request' && workUnitStore.prerenderPhase === true) {\n // When we're rendering dynamically in dev we need to advance out of the\n // Prerender environment when we read Request data synchronously\n const requestStore = workUnitStore;\n (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(requestStore);\n }\n}\nconst noop = ()=>{};\nconst warnForSyncAccess = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createSearchAccessError);\nconst warnForIncompleteEnumeration = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createIncompleteEnumerationError);\nfunction createSearchAccessError(route, expression) {\n const prefix = route ? `Route \"${route}\" ` : 'This route ';\n return new Error(`${prefix}used ${expression}. ` + `\\`searchParams\\` should be awaited before using its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n}\nfunction createIncompleteEnumerationError(route, expression, missingProperties) {\n const prefix = route ? `Route \"${route}\" ` : 'This route ';\n return new Error(`${prefix}used ${expression}. ` + `\\`searchParams\\` should be awaited before using its properties. ` + `The following properties were not available through enumeration ` + `because they conflict with builtin or well-known property names: ` + `${describeListOfPropertyNames(missingProperties)}. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n}\nfunction describeListOfPropertyNames(properties) {\n switch(properties.length){\n case 0:\n throw new _invarianterror.InvariantError('Expected describeListOfPropertyNames to be called with a non-empty list of strings.');\n case 1:\n return `\\`${properties[0]}\\``;\n case 2:\n return `\\`${properties[0]}\\` and \\`${properties[1]}\\``;\n default:\n {\n let description = '';\n for(let i = 0; i < properties.length - 1; i++){\n description += `\\`${properties[i]}\\`, `;\n }\n description += `, and \\`${properties[properties.length - 1]}\\``;\n return description;\n }\n }\n}\n\n//# sourceMappingURL=search-params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n describeHasCheckingStringProperty: null,\n describeStringPropertyAccess: null,\n isRequestAPICallableInsideAfter: null,\n throwWithStaticGenerationBailoutError: null,\n throwWithStaticGenerationBailoutErrorWithDynamicError: null,\n wellKnownProperties: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n describeHasCheckingStringProperty: function() {\n return describeHasCheckingStringProperty;\n },\n describeStringPropertyAccess: function() {\n return describeStringPropertyAccess;\n },\n isRequestAPICallableInsideAfter: function() {\n return isRequestAPICallableInsideAfter;\n },\n throwWithStaticGenerationBailoutError: function() {\n return throwWithStaticGenerationBailoutError;\n },\n throwWithStaticGenerationBailoutErrorWithDynamicError: function() {\n return throwWithStaticGenerationBailoutErrorWithDynamicError;\n },\n wellKnownProperties: function() {\n return wellKnownProperties;\n }\n});\nconst _staticgenerationbailout = require(\"../../client/components/static-generation-bailout\");\nconst _aftertaskasyncstorageexternal = require(\"../app-render/after-task-async-storage.external\");\n// This regex will have fast negatives meaning valid identifiers may not pass\n// this test. However this is only used during static generation to provide hints\n// about why a page bailed out of some or all prerendering and we can use bracket notation\n// for example while `ಠ_ಠ` is a valid identifier it's ok to print `searchParams['ಠ_ಠ']`\n// even if this would have been fine too `searchParams.ಠ_ಠ`\nconst isDefinitelyAValidIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\nfunction describeStringPropertyAccess(target, prop) {\n if (isDefinitelyAValidIdentifier.test(prop)) {\n return `\\`${target}.${prop}\\``;\n }\n return `\\`${target}[${JSON.stringify(prop)}]\\``;\n}\nfunction describeHasCheckingStringProperty(target, prop) {\n const stringifiedProp = JSON.stringify(prop);\n return `\\`Reflect.has(${target}, ${stringifiedProp})\\`, \\`${stringifiedProp} in ${target}\\`, or similar`;\n}\nfunction throwWithStaticGenerationBailoutError(route, expression) {\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route ${route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);\n}\nfunction throwWithStaticGenerationBailoutErrorWithDynamicError(route, expression) {\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route ${route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);\n}\nfunction isRequestAPICallableInsideAfter() {\n const afterTaskStore = _aftertaskasyncstorageexternal.afterTaskAsyncStorage.getStore();\n return (afterTaskStore == null ? void 0 : afterTaskStore.rootTaskSpawnPhase) === 'action';\n}\nconst wellKnownProperties = new Set([\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toString',\n 'valueOf',\n 'toLocaleString',\n // Promise prototype\n // fallthrough\n 'then',\n 'catch',\n 'finally',\n // React Promise extension\n // fallthrough\n 'status',\n // React introspection\n 'displayName',\n // Common tested properties\n // fallthrough\n 'toJSON',\n '$$typeof',\n '__esModule'\n]);\n\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"ReflectAdapter\", {\n enumerable: true,\n get: function() {\n return ReflectAdapter;\n }\n});\nclass ReflectAdapter {\n static get(target, prop, receiver) {\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n }\n static set(target, prop, value, receiver) {\n return Reflect.set(target, prop, value, receiver);\n }\n static has(target, prop) {\n return Reflect.has(target, prop);\n }\n static deleteProperty(target, prop) {\n return Reflect.deleteProperty(target, prop);\n }\n}\n\n//# sourceMappingURL=reflect.js.map","'use client'\n\nimport type { FetchServerResponseResult } from '../../client/components/router-reducer/fetch-server-response'\nimport type {\n FocusAndScrollRef,\n PrefetchKind,\n RouterChangeByServerResponse,\n} from '../../client/components/router-reducer/router-reducer-types'\nimport type { FlightRouterState } from '../../server/app-render/types'\nimport React from 'react'\n\nexport type ChildSegmentMap = Map<string, CacheNode>\n\n/**\n * Cache node used in app-router / layout-router.\n */\nexport type CacheNode = ReadyCacheNode | LazyCacheNode\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\nexport type LazyCacheNode = {\n /**\n * When rsc is null, this is a lazily-initialized cache node.\n *\n * If the app attempts to render it, it triggers a lazy data fetch,\n * postpones the render, and schedules an update to a new tree.\n *\n * TODO: This mechanism should not be used when PPR is enabled, though it\n * currently is in some cases until we've implemented partial\n * segment fetching.\n */\n rsc: null\n\n /**\n * A prefetched version of the segment data. See explanation in corresponding\n * field of ReadyCacheNode (below).\n *\n * Since LazyCacheNode mostly only exists in the non-PPR implementation, this\n * will usually be null, but it could have been cloned from a previous\n * CacheNode that was created by the PPR implementation. Eventually we want\n * to migrate everything away from LazyCacheNode entirely.\n */\n prefetchRsc: React.ReactNode\n\n /**\n * A pending response for the lazy data fetch. If this is not present\n * during render, it is lazily created.\n */\n lazyData: Promise<FetchServerResponseResult> | null\n\n prefetchHead: React.ReactNode\n head: React.ReactNode\n\n loading: LoadingModuleData | Promise<LoadingModuleData>\n\n /**\n * Child parallel routes.\n */\n parallelRoutes: Map<string, ChildSegmentMap>\n}\n\nexport type ReadyCacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * <LayoutRouter> component, we can use `null` to represent empty.\n *\n * TODO: For additional type safety, update this type to\n * Exclude<React.ReactNode, null>. Need to update createEmptyCacheNode to\n * accept rsc as an argument, or just inline the callers.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n /**\n * There should never be a lazy data request in this case.\n */\n lazyData: null\n prefetchHead: React.ReactNode\n head: React.ReactNode\n\n loading: LoadingModuleData | Promise<LoadingModuleData>\n\n parallelRoutes: Map<string, ChildSegmentMap>\n}\n\nexport interface NavigateOptions {\n scroll?: boolean\n}\n\nexport interface PrefetchOptions {\n kind: PrefetchKind\n}\n\nexport interface AppRouterInstance {\n /**\n * Navigate to the previous history entry.\n */\n back(): void\n /**\n * Navigate to the next history entry.\n */\n forward(): void\n /**\n * Refresh the current page.\n */\n refresh(): void\n /**\n * Refresh the current page. Use in development only.\n * @internal\n */\n hmrRefresh(): void\n /**\n * Navigate to the provided href.\n * Pushes a new history entry.\n */\n push(href: string, options?: NavigateOptions): void\n /**\n * Navigate to the provided href.\n * Replaces the current history entry.\n */\n replace(href: string, options?: NavigateOptions): void\n /**\n * Prefetch the provided href.\n */\n prefetch(href: string, options?: PrefetchOptions): void\n}\n\nexport const AppRouterContext = React.createContext<AppRouterInstance | null>(\n null\n)\nexport const LayoutRouterContext = React.createContext<{\n childNodes: CacheNode['parallelRoutes']\n tree: FlightRouterState\n url: string\n loading: LoadingModuleData | Promise<LoadingModuleData>\n} | null>(null)\n\nexport const GlobalLayoutRouterContext = React.createContext<{\n tree: FlightRouterState\n changeByServerResponse: RouterChangeByServerResponse\n focusAndScrollRef: FocusAndScrollRef\n nextUrl: string | null\n}>(null as any)\n\nexport const TemplateContext = React.createContext<React.ReactNode>(null as any)\n\nif (process.env.NODE_ENV !== 'production') {\n AppRouterContext.displayName = 'AppRouterContext'\n LayoutRouterContext.displayName = 'LayoutRouterContext'\n GlobalLayoutRouterContext.displayName = 'GlobalLayoutRouterContext'\n TemplateContext.displayName = 'TemplateContext'\n}\n\nexport const MissingSlotContext = React.createContext<Set<string>>(new Set())\n","// minimal implementation MurmurHash2 hash function\nfunction murmurhash2(str: string) {\n let h = 0\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i)\n h = Math.imul(h ^ c, 0x5bd1e995)\n h ^= h >>> 13\n h = Math.imul(h, 0x5bd1e995)\n }\n return h >>> 0\n}\n\n// default to 0.01% error rate as the filter compresses very well\nconst DEFAULT_ERROR_RATE = 0.0001\n\nexport class BloomFilter {\n numItems: number\n errorRate: number\n numBits: number\n numHashes: number\n bitArray: number[]\n\n constructor(numItems: number, errorRate: number = DEFAULT_ERROR_RATE) {\n this.numItems = numItems\n this.errorRate = errorRate\n this.numBits = Math.ceil(\n -(numItems * Math.log(errorRate)) / (Math.log(2) * Math.log(2))\n )\n this.numHashes = Math.ceil((this.numBits / numItems) * Math.log(2))\n this.bitArray = new Array(this.numBits).fill(0)\n }\n\n static from(items: string[], errorRate = DEFAULT_ERROR_RATE) {\n const filter = new BloomFilter(items.length, errorRate)\n\n for (const item of items) {\n filter.add(item)\n }\n return filter\n }\n\n export() {\n const data = {\n numItems: this.numItems,\n errorRate: this.errorRate,\n numBits: this.numBits,\n numHashes: this.numHashes,\n bitArray: this.bitArray,\n }\n\n if (process.env.NEXT_RUNTIME === 'nodejs') {\n if (this.errorRate < DEFAULT_ERROR_RATE) {\n const filterData = JSON.stringify(data)\n const gzipSize = require('next/dist/compiled/gzip-size').sync(\n filterData\n )\n\n if (gzipSize > 1024) {\n console.warn(\n `Creating filter with error rate less than 0.1% (0.001) can increase the size dramatically proceed with caution. Received error rate ${this.errorRate} resulted in size ${filterData.length} bytes, ${gzipSize} bytes (gzip)`\n )\n }\n }\n }\n\n return data\n }\n\n import(data: ReturnType<(typeof this)['export']>) {\n this.numItems = data.numItems\n this.errorRate = data.errorRate\n this.numBits = data.numBits\n this.numHashes = data.numHashes\n this.bitArray = data.bitArray\n }\n\n add(item: string) {\n const hashValues = this.getHashValues(item)\n hashValues.forEach((hash) => {\n this.bitArray[hash] = 1\n })\n }\n\n contains(item: string) {\n const hashValues = this.getHashValues(item)\n return hashValues.every((hash) => this.bitArray[hash])\n }\n\n getHashValues(item: string) {\n const hashValues = []\n for (let i = 1; i <= this.numHashes; i++) {\n const hash = murmurhash2(`${item}${i}`) % this.numBits\n hashValues.push(hash)\n }\n return hashValues\n }\n}\n","export function encodeURIPath(file: string) {\n return file\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')\n}\n","// regexp is based on https://github.com/sindresorhus/escape-string-regexp\nconst reHasRegExp = /[|\\\\{}()[\\]^$+*?.-]/\nconst reReplaceRegExp = /[|\\\\{}()[\\]^$+*?.-]/g\n\nexport function escapeStringRegexp(str: string) {\n // see also: https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/escapeRegExp.js#L23\n if (reHasRegExp.test(str)) {\n return str.replace(reReplaceRegExp, '\\\\$&')\n }\n return str\n}\n","// http://www.cse.yorku.ca/~oz/hash.html\n// More specifically, 32-bit hash via djbxor\n// (ref: https://gist.github.com/eplawless/52813b1d8ad9af510d85?permalink_comment_id=3367765#gistcomment-3367765)\n// This is due to number type differences between rust for turbopack to js number types,\n// where rust does not have easy way to repreesnt js's 53-bit float number type for the matching\n// overflow behavior. This is more `correct` in terms of having canonical hash across different runtime / implementation\n// as can gaurantee determinstic output from 32bit hash.\nexport function djb2Hash(str: string) {\n let hash = 5381\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = ((hash << 5) + hash + char) & 0xffffffff\n }\n return hash >>> 0\n}\n\nexport function hexHash(str: string) {\n return djb2Hash(str).toString(36).slice(0, 5)\n}\n","import React from 'react'\n\nexport const HeadManagerContext: React.Context<{\n updateHead?: (state: any) => void\n mountedInstances?: any\n updateScripts?: (state: any) => void\n scripts?: any\n getIsSsr?: () => boolean\n\n // Used in app directory, to render script tags as server components.\n appDir?: boolean\n nonce?: string\n}> = React.createContext({})\n\nif (process.env.NODE_ENV !== 'production') {\n HeadManagerContext.displayName = 'HeadManagerContext'\n}\n","'use client'\n\nimport { createContext } from 'react'\nimport type { Params } from '../../server/request/params'\n\nexport const SearchParamsContext = createContext<URLSearchParams | null>(null)\nexport const PathnameContext = createContext<string | null>(null)\nexport const PathParamsContext = createContext<Params | null>(null)\n\nif (process.env.NODE_ENV !== 'production') {\n SearchParamsContext.displayName = 'SearchParamsContext'\n PathnameContext.displayName = 'PathnameContext'\n PathParamsContext.displayName = 'PathParamsContext'\n}\n","export interface PathLocale {\n detectedLocale?: string\n pathname: string\n}\n\n/**\n * For a pathname that may include a locale from a list of locales, it\n * removes the locale from the pathname returning it alongside with the\n * detected locale.\n *\n * @param pathname A pathname that may include a locale.\n * @param locales A list of locales.\n * @returns The detected locale and pathname without locale\n */\nexport function normalizeLocalePath(\n pathname: string,\n locales?: string[]\n): PathLocale {\n let detectedLocale: string | undefined\n // first item will be empty string from splitting at first char\n const pathnameParts = pathname.split('/')\n\n ;(locales || []).some((locale) => {\n if (\n pathnameParts[1] &&\n pathnameParts[1].toLowerCase() === locale.toLowerCase()\n ) {\n detectedLocale = locale\n pathnameParts.splice(1, 1)\n pathname = pathnameParts.join('/') || '/'\n return true\n }\n return false\n })\n\n return {\n pathname,\n detectedLocale,\n }\n}\n","export class InvariantError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(\n `Invariant: ${message.endsWith('.') ? message : message + '.'} This is a bug in Next.js.`,\n options\n )\n this.name = 'InvariantError'\n }\n}\n","export function getObjectClassLabel(value: any): string {\n return Object.prototype.toString.call(value)\n}\n\nexport function isPlainObject(value: any): boolean {\n if (getObjectClassLabel(value) !== '[object Object]') {\n return false\n }\n\n const prototype = Object.getPrototypeOf(value)\n\n /**\n * this used to be previously:\n *\n * `return prototype === null || prototype === Object.prototype`\n *\n * but Edge Runtime expose Object from vm, being that kind of type-checking wrongly fail.\n *\n * It was changed to the current implementation since it's resilient to serialization.\n */\n return prototype === null || prototype.hasOwnProperty('isPrototypeOf')\n}\n","/**\n * Check to see if a value is Thenable.\n *\n * @param promise the maybe-thenable value\n * @returns true if the value is thenable\n */\nexport function isThenable<T = unknown>(\n promise: Promise<T> | T\n): promise is Promise<T> {\n return (\n promise !== null &&\n typeof promise === 'object' &&\n 'then' in promise &&\n typeof promise.then === 'function'\n )\n}\n","// This has to be a shared module which is shared between client component error boundary and dynamic component\nconst BAILOUT_TO_CSR = 'BAILOUT_TO_CLIENT_SIDE_RENDERING'\n\n/** An error that should be thrown when we want to bail out to client-side rendering. */\nexport class BailoutToCSRError extends Error {\n public readonly digest = BAILOUT_TO_CSR\n\n constructor(public readonly reason: string) {\n super(`Bail out to client-side rendering: ${reason}`)\n }\n}\n\n/** Checks if a passed argument is an error that is thrown if we want to bail out to client-side rendering. */\nexport function isBailoutToCSRError(err: unknown): err is BailoutToCSRError {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false\n }\n\n return err.digest === BAILOUT_TO_CSR\n}\n","/*\nMIT License\n\nCopyright (c) Jason Miller (https://jasonformat.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n// This file is based on https://github.com/developit/mitt/blob/v1.1.3/src/index.js\n// It's been edited for the needs of this script\n// See the LICENSE at the top of the file\n\ntype Handler = (...evts: any[]) => void\n\nexport type MittEmitter<T> = {\n on(type: T, handler: Handler): void\n off(type: T, handler: Handler): void\n emit(type: T, ...evts: any[]): void\n}\n\nexport default function mitt(): MittEmitter<string> {\n const all: { [s: string]: Handler[] } = Object.create(null)\n\n return {\n on(type: string, handler: Handler) {\n ;(all[type] || (all[type] = [])).push(handler)\n },\n\n off(type: string, handler: Handler) {\n if (all[type]) {\n all[type].splice(all[type].indexOf(handler) >>> 0, 1)\n }\n },\n\n emit(type: string, ...evts: any[]) {\n // eslint-disable-next-line array-callback-return\n ;(all[type] || []).slice().map((handler: Handler) => {\n handler(...evts)\n })\n },\n }\n}\n","import { isDynamicRoute } from '../router/utils'\nimport { normalizePathSep } from './normalize-path-sep'\n\n/**\n * Performs the opposite transformation of `normalizePagePath`. Note that\n * this function is not idempotent either in cases where there are multiple\n * leading `/index` for the page. Examples:\n * - `/index` -> `/`\n * - `/index/foo` -> `/foo`\n * - `/index/index` -> `/index`\n */\nexport function denormalizePagePath(page: string) {\n let _page = normalizePathSep(page)\n return _page.startsWith('/index/') && !isDynamicRoute(_page)\n ? _page.slice(6)\n : _page !== '/index'\n ? _page\n : '/'\n}\n","/**\n * For a given page path, this function ensures that there is a leading slash.\n * If there is not a leading slash, one is added, otherwise it is noop.\n */\nexport function ensureLeadingSlash(path: string) {\n return path.startsWith('/') ? path : `/${path}`\n}\n","/**\n * For a given page path, this function ensures that there is no backslash\n * escaping slashes in the path. Example:\n * - `foo\\/bar\\/baz` -> `foo/bar/baz`\n */\nexport function normalizePathSep(path: string): string {\n return path.replace(/\\\\/g, '/')\n}\n","import React from 'react'\nimport type { NextRouter } from './router/router'\n\nexport const RouterContext = React.createContext<NextRouter | null>(null)\n\nif (process.env.NODE_ENV !== 'production') {\n RouterContext.displayName = 'RouterContext'\n}\n","import {\n type AppRouterState,\n type ReducerActions,\n type ReducerState,\n ACTION_REFRESH,\n ACTION_SERVER_ACTION,\n ACTION_NAVIGATE,\n ACTION_RESTORE,\n} from '../../../client/components/router-reducer/router-reducer-types'\nimport { reducer } from '../../../client/components/router-reducer/router-reducer'\nimport { startTransition } from 'react'\nimport { isThenable } from '../is-thenable'\n\nexport type DispatchStatePromise = React.Dispatch<ReducerState>\n\nexport type AppRouterActionQueue = {\n state: AppRouterState\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) => void\n action: (state: AppRouterState, action: ReducerActions) => ReducerState\n pending: ActionQueueNode | null\n needsRefresh?: boolean\n last: ActionQueueNode | null\n}\n\nexport type ActionQueueNode = {\n payload: ReducerActions\n next: ActionQueueNode | null\n resolve: (value: ReducerState) => void\n reject: (err: Error) => void\n discarded?: boolean\n}\n\nfunction runRemainingActions(\n actionQueue: AppRouterActionQueue,\n setState: DispatchStatePromise\n) {\n if (actionQueue.pending !== null) {\n actionQueue.pending = actionQueue.pending.next\n if (actionQueue.pending !== null) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n } else {\n // No more actions are pending, check if a refresh is needed\n if (actionQueue.needsRefresh) {\n actionQueue.needsRefresh = false\n actionQueue.dispatch(\n {\n type: ACTION_REFRESH,\n origin: window.location.origin,\n },\n setState\n )\n }\n }\n }\n}\n\nasync function runAction({\n actionQueue,\n action,\n setState,\n}: {\n actionQueue: AppRouterActionQueue\n action: ActionQueueNode\n setState: DispatchStatePromise\n}) {\n const prevState = actionQueue.state\n\n actionQueue.pending = action\n\n const payload = action.payload\n const actionResult = actionQueue.action(prevState, payload)\n\n function handleResult(nextState: AppRouterState) {\n // if we discarded this action, the state should also be discarded\n if (action.discarded) {\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, setState)\n action.resolve(nextState)\n }\n\n // if the action is a promise, set up a callback to resolve it\n if (isThenable(actionResult)) {\n actionResult.then(handleResult, (err) => {\n runRemainingActions(actionQueue, setState)\n action.reject(err)\n })\n } else {\n handleResult(actionResult)\n }\n}\n\nfunction dispatchAction(\n actionQueue: AppRouterActionQueue,\n payload: ReducerActions,\n setState: DispatchStatePromise\n) {\n let resolvers: {\n resolve: (value: ReducerState) => void\n reject: (reason: any) => void\n } = { resolve: setState, reject: () => {} }\n\n // most of the action types are async with the exception of restore\n // it's important that restore is handled quickly since it's fired on the popstate event\n // and we don't want to add any delay on a back/forward nav\n // this only creates a promise for the async actions\n if (payload.type !== ACTION_RESTORE) {\n // Create the promise and assign the resolvers to the object.\n const deferredPromise = new Promise<AppRouterState>((resolve, reject) => {\n resolvers = { resolve, reject }\n })\n\n startTransition(() => {\n // we immediately notify React of the pending promise -- the resolver is attached to the action node\n // and will be called when the associated action promise resolves\n setState(deferredPromise)\n })\n }\n\n const newAction: ActionQueueNode = {\n payload,\n next: null,\n resolve: resolvers.resolve,\n reject: resolvers.reject,\n }\n\n // Check if the queue is empty\n if (actionQueue.pending === null) {\n // The queue is empty, so add the action and start it immediately\n // Mark this action as the last in the queue\n actionQueue.last = newAction\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else if (\n payload.type === ACTION_NAVIGATE ||\n payload.type === ACTION_RESTORE\n ) {\n // Navigations (including back/forward) take priority over any pending actions.\n // Mark the pending action as discarded (so the state is never applied) and start the navigation action immediately.\n actionQueue.pending.discarded = true\n\n // Mark this action as the last in the queue\n actionQueue.last = newAction\n\n // if the pending action was a server action, mark the queue as needing a refresh once events are processed\n if (actionQueue.pending.payload.type === ACTION_SERVER_ACTION) {\n actionQueue.needsRefresh = true\n }\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else {\n // The queue is not empty, so add the action to the end of the queue\n // It will be started by runRemainingActions after the previous action finishes\n if (actionQueue.last !== null) {\n actionQueue.last.next = newAction\n }\n actionQueue.last = newAction\n }\n}\n\nexport function createMutableActionQueue(\n initialState: AppRouterState\n): AppRouterActionQueue {\n const actionQueue: AppRouterActionQueue = {\n state: initialState,\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) =>\n dispatchAction(actionQueue, payload, setState),\n action: async (state: AppRouterState, action: ReducerActions) => {\n const result = reducer(state, action)\n return result\n },\n pending: null,\n last: null,\n }\n\n return actionQueue\n}\n","// tslint:disable:no-console\nimport type { ComponentType } from 'react'\nimport type { DomainLocale } from '../../../server/config'\nimport type { MittEmitter } from '../mitt'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { RouterEvent } from '../../../client/router'\nimport type { StyleSheetTuple } from '../../../client/page-loader'\nimport type { UrlObject } from 'url'\nimport type PageLoader from '../../../client/page-loader'\nimport type { AppContextType, NextPageContext, NEXT_DATA } from '../utils'\nimport { removeTrailingSlash } from './utils/remove-trailing-slash'\nimport {\n getClientBuildManifest,\n isAssetError,\n markAssetError,\n} from '../../../client/route-loader'\nimport { handleClientScriptLoad } from '../../../client/script'\nimport isError, { getProperError } from '../../../lib/is-error'\nimport { denormalizePagePath } from '../page-path/denormalize-page-path'\nimport { normalizeLocalePath } from '../i18n/normalize-locale-path'\nimport mitt from '../mitt'\nimport { getLocationOrigin, getURL, loadGetInitialProps, ST } from '../utils'\nimport { isDynamicRoute } from './utils/is-dynamic'\nimport { parseRelativeUrl } from './utils/parse-relative-url'\nimport resolveRewrites from './utils/resolve-rewrites'\nimport { getRouteMatcher } from './utils/route-matcher'\nimport { getRouteRegex } from './utils/route-regex'\nimport { formatWithValidation } from './utils/format-url'\nimport { detectDomainLocale } from '../../../client/detect-domain-locale'\nimport { parsePath } from './utils/parse-path'\nimport { addLocale } from '../../../client/add-locale'\nimport { removeLocale } from '../../../client/remove-locale'\nimport { removeBasePath } from '../../../client/remove-base-path'\nimport { addBasePath } from '../../../client/add-base-path'\nimport { hasBasePath } from '../../../client/has-base-path'\nimport { resolveHref } from '../../../client/resolve-href'\nimport { isAPIRoute } from '../../../lib/is-api-route'\nimport { getNextPathnameInfo } from './utils/get-next-pathname-info'\nimport { formatNextPathnameInfo } from './utils/format-next-pathname-info'\nimport { compareRouterStates } from './utils/compare-states'\nimport { isLocalURL } from './utils/is-local-url'\nimport { isBot } from './utils/is-bot'\nimport { omit } from './utils/omit'\nimport { interpolateAs } from './utils/interpolate-as'\nimport { handleSmoothScroll } from './utils/handle-smooth-scroll'\nimport type { Params } from '../../../server/request/params'\nimport { MATCHED_PATH_HEADER } from '../../../lib/constants'\n\ndeclare global {\n interface Window {\n /* prod */\n __NEXT_DATA__: NEXT_DATA\n }\n}\n\ninterface RouteProperties {\n shallow: boolean\n}\n\ninterface TransitionOptions {\n shallow?: boolean\n locale?: string | false\n scroll?: boolean\n unstable_skipClientCache?: boolean\n}\n\ninterface NextHistoryState {\n url: string\n as: string\n options: TransitionOptions\n}\n\nexport type HistoryState =\n | null\n | { __NA: true; __N?: false }\n | { __N: false; __NA?: false }\n | ({ __NA?: false; __N: true; key: string } & NextHistoryState)\n\nfunction buildCancellationError() {\n return Object.assign(new Error('Route Cancelled'), {\n cancelled: true,\n })\n}\n\ninterface MiddlewareEffectParams<T extends FetchDataOutput> {\n fetchData?: () => Promise<T>\n locale?: string\n asPath: string\n router: Router\n}\n\nexport async function matchesMiddleware<T extends FetchDataOutput>(\n options: MiddlewareEffectParams<T>\n): Promise<boolean> {\n const matchers = await Promise.resolve(\n options.router.pageLoader.getMiddleware()\n )\n if (!matchers) return false\n\n const { pathname: asPathname } = parsePath(options.asPath)\n // remove basePath first since path prefix has to be in the order of `/${basePath}/${locale}`\n const cleanedAs = hasBasePath(asPathname)\n ? removeBasePath(asPathname)\n : asPathname\n const asWithBasePathAndLocale = addBasePath(\n addLocale(cleanedAs, options.locale)\n )\n\n // Check only path match on client. Matching \"has\" should be done on server\n // where we can access more info such as headers, HttpOnly cookie, etc.\n return matchers.some((m) =>\n new RegExp(m.regexp).test(asWithBasePathAndLocale)\n )\n}\n\nfunction stripOrigin(url: string) {\n const origin = getLocationOrigin()\n\n return url.startsWith(origin) ? url.substring(origin.length) : url\n}\n\nfunction prepareUrlAs(router: NextRouter, url: Url, as?: Url) {\n // If url and as provided as an object representation,\n // we'll format them into the string version here.\n let [resolvedHref, resolvedAs] = resolveHref(router, url, true)\n const origin = getLocationOrigin()\n const hrefWasAbsolute = resolvedHref.startsWith(origin)\n const asWasAbsolute = resolvedAs && resolvedAs.startsWith(origin)\n\n resolvedHref = stripOrigin(resolvedHref)\n resolvedAs = resolvedAs ? stripOrigin(resolvedAs) : resolvedAs\n\n const preparedUrl = hrefWasAbsolute ? resolvedHref : addBasePath(resolvedHref)\n const preparedAs = as\n ? stripOrigin(resolveHref(router, as))\n : resolvedAs || resolvedHref\n\n return {\n url: preparedUrl,\n as: asWasAbsolute ? preparedAs : addBasePath(preparedAs),\n }\n}\n\nfunction resolveDynamicRoute(pathname: string, pages: string[]) {\n const cleanPathname = removeTrailingSlash(denormalizePagePath(pathname))\n if (cleanPathname === '/404' || cleanPathname === '/_error') {\n return pathname\n }\n\n // handle resolving href for dynamic routes\n if (!pages.includes(cleanPathname)) {\n // eslint-disable-next-line array-callback-return\n pages.some((page) => {\n if (isDynamicRoute(page) && getRouteRegex(page).re.test(cleanPathname)) {\n pathname = page\n return true\n }\n })\n }\n return removeTrailingSlash(pathname)\n}\n\nfunction getMiddlewareData<T extends FetchDataOutput>(\n source: string,\n response: Response,\n options: MiddlewareEffectParams<T>\n) {\n const nextConfig = {\n basePath: options.router.basePath,\n i18n: { locales: options.router.locales },\n trailingSlash: Boolean(process.env.__NEXT_TRAILING_SLASH),\n }\n const rewriteHeader = response.headers.get('x-nextjs-rewrite')\n\n let rewriteTarget =\n rewriteHeader || response.headers.get('x-nextjs-matched-path')\n\n const matchedPath = response.headers.get(MATCHED_PATH_HEADER)\n\n if (\n matchedPath &&\n !rewriteTarget &&\n !matchedPath.includes('__next_data_catchall') &&\n !matchedPath.includes('/_error') &&\n !matchedPath.includes('/404')\n ) {\n // leverage x-matched-path to detect next.config.js rewrites\n rewriteTarget = matchedPath\n }\n\n if (rewriteTarget) {\n if (\n rewriteTarget.startsWith('/') ||\n process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE\n ) {\n const parsedRewriteTarget = parseRelativeUrl(rewriteTarget)\n const pathnameInfo = getNextPathnameInfo(parsedRewriteTarget.pathname, {\n nextConfig,\n parseData: true,\n })\n\n let fsPathname = removeTrailingSlash(pathnameInfo.pathname)\n return Promise.all([\n options.router.pageLoader.getPageList(),\n getClientBuildManifest(),\n ]).then(([pages, { __rewrites: rewrites }]: any) => {\n let as = addLocale(pathnameInfo.pathname, pathnameInfo.locale)\n\n if (\n isDynamicRoute(as) ||\n (!rewriteHeader &&\n pages.includes(\n normalizeLocalePath(removeBasePath(as), options.router.locales)\n .pathname\n ))\n ) {\n const parsedSource = getNextPathnameInfo(\n parseRelativeUrl(source).pathname,\n {\n nextConfig: process.env.__NEXT_HAS_REWRITES\n ? undefined\n : nextConfig,\n parseData: true,\n }\n )\n\n as = addBasePath(parsedSource.pathname)\n parsedRewriteTarget.pathname = as\n }\n\n if (process.env.__NEXT_HAS_REWRITES) {\n const result = resolveRewrites(\n as,\n pages,\n rewrites,\n parsedRewriteTarget.query,\n (path: string) => resolveDynamicRoute(path, pages),\n options.router.locales\n )\n\n if (result.matchedPage) {\n parsedRewriteTarget.pathname = result.parsedAs.pathname\n as = parsedRewriteTarget.pathname\n Object.assign(parsedRewriteTarget.query, result.parsedAs.query)\n }\n } else if (!pages.includes(fsPathname)) {\n const resolvedPathname = resolveDynamicRoute(fsPathname, pages)\n\n if (resolvedPathname !== fsPathname) {\n fsPathname = resolvedPathname\n }\n }\n\n const resolvedHref = !pages.includes(fsPathname)\n ? resolveDynamicRoute(\n normalizeLocalePath(\n removeBasePath(parsedRewriteTarget.pathname),\n options.router.locales\n ).pathname,\n pages\n )\n : fsPathname\n\n if (isDynamicRoute(resolvedHref)) {\n const matches = getRouteMatcher(getRouteRegex(resolvedHref))(as)\n Object.assign(parsedRewriteTarget.query, matches || {})\n }\n\n return {\n type: 'rewrite' as const,\n parsedAs: parsedRewriteTarget,\n resolvedHref,\n }\n })\n }\n const src = parsePath(source)\n const pathname = formatNextPathnameInfo({\n ...getNextPathnameInfo(src.pathname, { nextConfig, parseData: true }),\n defaultLocale: options.router.defaultLocale,\n buildId: '',\n })\n\n return Promise.resolve({\n type: 'redirect-external' as const,\n destination: `${pathname}${src.query}${src.hash}`,\n })\n }\n\n const redirectTarget = response.headers.get('x-nextjs-redirect')\n\n if (redirectTarget) {\n if (redirectTarget.startsWith('/')) {\n const src = parsePath(redirectTarget)\n const pathname = formatNextPathnameInfo({\n ...getNextPathnameInfo(src.pathname, { nextConfig, parseData: true }),\n defaultLocale: options.router.defaultLocale,\n buildId: '',\n })\n\n return Promise.resolve({\n type: 'redirect-internal' as const,\n newAs: `${pathname}${src.query}${src.hash}`,\n newUrl: `${pathname}${src.query}${src.hash}`,\n })\n }\n\n return Promise.resolve({\n type: 'redirect-external' as const,\n destination: redirectTarget,\n })\n }\n\n return Promise.resolve({ type: 'next' as const })\n}\n\ninterface WithMiddlewareEffectsOutput extends FetchDataOutput {\n effect: Awaited<ReturnType<typeof getMiddlewareData>>\n}\n\nasync function withMiddlewareEffects<T extends FetchDataOutput>(\n options: MiddlewareEffectParams<T>\n): Promise<WithMiddlewareEffectsOutput | null> {\n const matches = await matchesMiddleware(options)\n if (!matches || !options.fetchData) {\n return null\n }\n\n const data = await options.fetchData()\n\n const effect = await getMiddlewareData(data.dataHref, data.response, options)\n\n return {\n dataHref: data.dataHref,\n json: data.json,\n response: data.response,\n text: data.text,\n cacheKey: data.cacheKey,\n effect,\n }\n}\n\nexport type Url = UrlObject | string\n\nexport type BaseRouter = {\n route: string\n pathname: string\n query: ParsedUrlQuery\n asPath: string\n basePath: string\n locale?: string | undefined\n locales?: string[] | undefined\n defaultLocale?: string | undefined\n domainLocales?: DomainLocale[] | undefined\n isLocaleDomain: boolean\n}\n\nexport type NextRouter = BaseRouter &\n Pick<\n Router,\n | 'push'\n | 'replace'\n | 'reload'\n | 'back'\n | 'forward'\n | 'prefetch'\n | 'beforePopState'\n | 'events'\n | 'isFallback'\n | 'isReady'\n | 'isPreview'\n >\n\nexport type PrefetchOptions = {\n priority?: boolean\n locale?: string | false\n unstable_skipClientCache?: boolean\n}\n\nexport type PrivateRouteInfo =\n | (Omit<CompletePrivateRouteInfo, 'styleSheets'> & { initial: true })\n | CompletePrivateRouteInfo\n\nexport type CompletePrivateRouteInfo = {\n Component: ComponentType\n styleSheets: StyleSheetTuple[]\n __N_SSG?: boolean\n __N_SSP?: boolean\n props?: Record<string, any>\n err?: Error\n error?: any\n route?: string\n resolvedAs?: string\n query?: ParsedUrlQuery\n}\n\nexport type AppProps = Pick<CompletePrivateRouteInfo, 'Component' | 'err'> & {\n router: Router\n} & Record<string, any>\nexport type AppComponent = ComponentType<AppProps>\n\ntype Subscription = (\n data: PrivateRouteInfo,\n App: AppComponent,\n resetScroll: { x: number; y: number } | null\n) => Promise<void>\n\ntype BeforePopStateCallback = (state: NextHistoryState) => boolean\n\ntype ComponentLoadCancel = (() => void) | null\n\ntype HistoryMethod = 'replaceState' | 'pushState'\n\nconst manualScrollRestoration =\n process.env.__NEXT_SCROLL_RESTORATION &&\n typeof window !== 'undefined' &&\n 'scrollRestoration' in window.history &&\n !!(function () {\n try {\n let v = '__next'\n // eslint-disable-next-line no-sequences\n return sessionStorage.setItem(v, v), sessionStorage.removeItem(v), true\n } catch (n) {}\n })()\n\nconst SSG_DATA_NOT_FOUND = Symbol('SSG_DATA_NOT_FOUND')\n\nfunction fetchRetry(\n url: string,\n attempts: number,\n options: Pick<RequestInit, 'method' | 'headers'>\n): Promise<Response> {\n return fetch(url, {\n // Cookies are required to be present for Next.js' SSG \"Preview Mode\".\n // Cookies may also be required for `getServerSideProps`.\n //\n // > `fetch` won’t send cookies, unless you set the credentials init\n // > option.\n // https://developer.mozilla.org/docs/Web/API/Fetch_API/Using_Fetch\n //\n // > For maximum browser compatibility when it comes to sending &\n // > receiving cookies, always supply the `credentials: 'same-origin'`\n // > option instead of relying on the default.\n // https://github.com/github/fetch#caveats\n credentials: 'same-origin',\n method: options.method || 'GET',\n headers: Object.assign({}, options.headers, {\n 'x-nextjs-data': '1',\n }),\n }).then((response) => {\n return !response.ok && attempts > 1 && response.status >= 500\n ? fetchRetry(url, attempts - 1, options)\n : response\n })\n}\n\ninterface FetchDataOutput {\n dataHref: string\n json: Record<string, any> | null\n response: Response\n text: string\n cacheKey: string\n}\n\ninterface FetchNextDataParams {\n dataHref: string\n isServerRender: boolean\n parseJSON: boolean | undefined\n hasMiddleware?: boolean\n inflightCache: NextDataCache\n persistCache: boolean\n isPrefetch: boolean\n isBackground?: boolean\n unstable_skipClientCache?: boolean\n}\n\nfunction tryToParseAsJSON(text: string) {\n try {\n return JSON.parse(text)\n } catch (error) {\n return null\n }\n}\n\nfunction fetchNextData({\n dataHref,\n inflightCache,\n isPrefetch,\n hasMiddleware,\n isServerRender,\n parseJSON,\n persistCache,\n isBackground,\n unstable_skipClientCache,\n}: FetchNextDataParams): Promise<FetchDataOutput> {\n const { href: cacheKey } = new URL(dataHref, window.location.href)\n const getData = (params?: { method?: 'HEAD' | 'GET' }) =>\n fetchRetry(dataHref, isServerRender ? 3 : 1, {\n headers: Object.assign(\n {} as HeadersInit,\n isPrefetch ? { purpose: 'prefetch' } : {},\n isPrefetch && hasMiddleware ? { 'x-middleware-prefetch': '1' } : {}\n ),\n method: params?.method ?? 'GET',\n })\n .then((response) => {\n if (response.ok && params?.method === 'HEAD') {\n return { dataHref, response, text: '', json: {}, cacheKey }\n }\n\n return response.text().then((text) => {\n if (!response.ok) {\n /**\n * When the data response is a redirect because of a middleware\n * we do not consider it an error. The headers must bring the\n * mapped location.\n * TODO: Change the status code in the handler.\n */\n if (\n hasMiddleware &&\n [301, 302, 307, 308].includes(response.status)\n ) {\n return { dataHref, response, text, json: {}, cacheKey }\n }\n\n if (response.status === 404) {\n if (tryToParseAsJSON(text)?.notFound) {\n return {\n dataHref,\n json: { notFound: SSG_DATA_NOT_FOUND },\n response,\n text,\n cacheKey,\n }\n }\n }\n\n const error = new Error(`Failed to load static props`)\n\n /**\n * We should only trigger a server-side transition if this was\n * caused on a client-side transition. Otherwise, we'd get into\n * an infinite loop.\n */\n if (!isServerRender) {\n markAssetError(error)\n }\n\n throw error\n }\n\n return {\n dataHref,\n json: parseJSON ? tryToParseAsJSON(text) : null,\n response,\n text,\n cacheKey,\n }\n })\n })\n .then((data) => {\n if (\n !persistCache ||\n process.env.NODE_ENV !== 'production' ||\n data.response.headers.get('x-middleware-cache') === 'no-cache'\n ) {\n delete inflightCache[cacheKey]\n }\n return data\n })\n .catch((err) => {\n if (!unstable_skipClientCache) {\n delete inflightCache[cacheKey]\n }\n if (\n // chrome\n err.message === 'Failed to fetch' ||\n // firefox\n err.message === 'NetworkError when attempting to fetch resource.' ||\n // safari\n err.message === 'Load failed'\n ) {\n markAssetError(err)\n }\n throw err\n })\n\n // when skipping client cache we wait to update\n // inflight cache until successful data response\n // this allows racing click event with fetching newer data\n // without blocking navigation when stale data is available\n if (unstable_skipClientCache && persistCache) {\n return getData({}).then((data) => {\n if (data.response.headers.get('x-middleware-cache') !== 'no-cache') {\n // only update cache if not marked as no-cache\n inflightCache[cacheKey] = Promise.resolve(data)\n }\n\n return data\n })\n }\n\n if (inflightCache[cacheKey] !== undefined) {\n return inflightCache[cacheKey]\n }\n return (inflightCache[cacheKey] = getData(\n isBackground ? { method: 'HEAD' } : {}\n ))\n}\n\ninterface NextDataCache {\n [asPath: string]: Promise<FetchDataOutput>\n}\n\nexport function createKey() {\n return Math.random().toString(36).slice(2, 10)\n}\n\nfunction handleHardNavigation({\n url,\n router,\n}: {\n url: string\n router: Router\n}) {\n // ensure we don't trigger a hard navigation to the same\n // URL as this can end up with an infinite refresh\n if (url === addBasePath(addLocale(router.asPath, router.locale))) {\n throw new Error(\n `Invariant: attempted to hard navigate to the same URL ${url} ${location.href}`\n )\n }\n window.location.href = url\n}\n\nconst getCancelledHandler = ({\n route,\n router,\n}: {\n route: string\n router: Router\n}) => {\n let cancelled = false\n const cancel = (router.clc = () => {\n cancelled = true\n })\n\n const handleCancelled = () => {\n if (cancelled) {\n const error: any = new Error(\n `Abort fetching component for route: \"${route}\"`\n )\n error.cancelled = true\n throw error\n }\n\n if (cancel === router.clc) {\n router.clc = null\n }\n }\n return handleCancelled\n}\n\nexport default class Router implements BaseRouter {\n basePath: string\n\n /**\n * Map of all components loaded in `Router`\n */\n components: { [pathname: string]: PrivateRouteInfo }\n // Server Data Cache (full data requests)\n sdc: NextDataCache = {}\n // Server Background Cache (HEAD requests)\n sbc: NextDataCache = {}\n\n sub: Subscription\n clc: ComponentLoadCancel\n pageLoader: PageLoader\n _bps: BeforePopStateCallback | undefined\n events: MittEmitter<RouterEvent>\n _wrapApp: (App: AppComponent) => any\n isSsr: boolean\n _inFlightRoute?: string | undefined\n _shallow?: boolean | undefined\n locales?: string[] | undefined\n defaultLocale?: string | undefined\n domainLocales?: DomainLocale[] | undefined\n isReady: boolean\n isLocaleDomain: boolean\n isFirstPopStateEvent = true\n _initialMatchesMiddlewarePromise: Promise<boolean>\n // static entries filter\n _bfl_s?: import('../../lib/bloom-filter').BloomFilter\n // dynamic entires filter\n _bfl_d?: import('../../lib/bloom-filter').BloomFilter\n\n private state: Readonly<{\n route: string\n pathname: string\n query: ParsedUrlQuery\n asPath: string\n locale: string | undefined\n isFallback: boolean\n isPreview: boolean\n }>\n\n private _key: string = createKey()\n\n static events: MittEmitter<RouterEvent> = mitt()\n\n constructor(\n pathname: string,\n query: ParsedUrlQuery,\n as: string,\n {\n initialProps,\n pageLoader,\n App,\n wrapApp,\n Component,\n err,\n subscription,\n isFallback,\n locale,\n locales,\n defaultLocale,\n domainLocales,\n isPreview,\n }: {\n subscription: Subscription\n initialProps: any\n pageLoader: any\n Component: ComponentType\n App: AppComponent\n wrapApp: (WrapAppComponent: AppComponent) => any\n err?: Error\n isFallback: boolean\n locale?: string\n locales?: string[]\n defaultLocale?: string\n domainLocales?: DomainLocale[]\n isPreview?: boolean\n }\n ) {\n // represents the current component key\n const route = removeTrailingSlash(pathname)\n\n // set up the component cache (by route keys)\n this.components = {}\n // We should not keep the cache, if there's an error\n // Otherwise, this cause issues when when going back and\n // come again to the errored page.\n if (pathname !== '/_error') {\n this.components[route] = {\n Component,\n initial: true,\n props: initialProps,\n err,\n __N_SSG: initialProps && initialProps.__N_SSG,\n __N_SSP: initialProps && initialProps.__N_SSP,\n }\n }\n\n this.components['/_app'] = {\n Component: App as ComponentType,\n styleSheets: [\n /* /_app does not need its stylesheets managed */\n ],\n }\n\n // Backwards compat for Router.router.events\n // TODO: Should be remove the following major version as it was never documented\n this.events = Router.events\n\n this.pageLoader = pageLoader\n // if auto prerendered and dynamic route wait to update asPath\n // until after mount to prevent hydration mismatch\n const autoExportDynamic =\n isDynamicRoute(pathname) && self.__NEXT_DATA__.autoExport\n\n this.basePath = process.env.__NEXT_ROUTER_BASEPATH || ''\n this.sub = subscription\n this.clc = null\n this._wrapApp = wrapApp\n // make sure to ignore extra popState in safari on navigating\n // back from external site\n this.isSsr = true\n this.isLocaleDomain = false\n this.isReady = !!(\n self.__NEXT_DATA__.gssp ||\n self.__NEXT_DATA__.gip ||\n self.__NEXT_DATA__.isExperimentalCompile ||\n (self.__NEXT_DATA__.appGip && !self.__NEXT_DATA__.gsp) ||\n (!autoExportDynamic &&\n !self.location.search &&\n !process.env.__NEXT_HAS_REWRITES)\n )\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n this.locales = locales\n this.defaultLocale = defaultLocale\n this.domainLocales = domainLocales\n this.isLocaleDomain = !!detectDomainLocale(\n domainLocales,\n self.location.hostname\n )\n }\n\n this.state = {\n route,\n pathname,\n query,\n asPath: autoExportDynamic ? pathname : as,\n isPreview: !!isPreview,\n locale: process.env.__NEXT_I18N_SUPPORT ? locale : undefined,\n isFallback,\n }\n\n this._initialMatchesMiddlewarePromise = Promise.resolve(false)\n\n if (typeof window !== 'undefined') {\n // make sure \"as\" doesn't start with double slashes or else it can\n // throw an error as it's considered invalid\n if (!as.startsWith('//')) {\n // in order for `e.state` to work on the `onpopstate` event\n // we have to register the initial route upon initialization\n const options: TransitionOptions = { locale }\n const asPath = getURL()\n\n this._initialMatchesMiddlewarePromise = matchesMiddleware({\n router: this,\n locale,\n asPath,\n }).then((matches) => {\n // if middleware matches we leave resolving to the change function\n // as the server needs to resolve for correct priority\n ;(options as any)._shouldResolveHref = as !== pathname\n\n this.changeState(\n 'replaceState',\n matches\n ? asPath\n : formatWithValidation({\n pathname: addBasePath(pathname),\n query,\n }),\n asPath,\n options\n )\n return matches\n })\n }\n\n window.addEventListener('popstate', this.onPopState)\n\n // enable custom scroll restoration handling when available\n // otherwise fallback to browser's default handling\n if (process.env.__NEXT_SCROLL_RESTORATION) {\n if (manualScrollRestoration) {\n window.history.scrollRestoration = 'manual'\n }\n }\n }\n }\n\n onPopState = (e: PopStateEvent): void => {\n const { isFirstPopStateEvent } = this\n this.isFirstPopStateEvent = false\n\n const state = e.state as HistoryState\n\n if (!state) {\n // We get state as undefined for two reasons.\n // 1. With older safari (< 8) and older chrome (< 34)\n // 2. When the URL changed with #\n //\n // In the both cases, we don't need to proceed and change the route.\n // (as it's already changed)\n // But we can simply replace the state with the new changes.\n // Actually, for (1) we don't need to nothing. But it's hard to detect that event.\n // So, doing the following for (1) does no harm.\n const { pathname, query } = this\n this.changeState(\n 'replaceState',\n formatWithValidation({ pathname: addBasePath(pathname), query }),\n getURL()\n )\n return\n }\n\n // __NA is used to identify if the history entry can be handled by the app-router.\n if (state.__NA) {\n window.location.reload()\n return\n }\n\n if (!state.__N) {\n return\n }\n\n // Safari fires popstateevent when reopening the browser.\n if (\n isFirstPopStateEvent &&\n this.locale === state.options.locale &&\n state.as === this.asPath\n ) {\n return\n }\n\n let forcedScroll: { x: number; y: number } | undefined\n const { url, as, options, key } = state\n if (process.env.__NEXT_SCROLL_RESTORATION) {\n if (manualScrollRestoration) {\n if (this._key !== key) {\n // Snapshot current scroll position:\n try {\n sessionStorage.setItem(\n '__next_scroll_' + this._key,\n JSON.stringify({ x: self.pageXOffset, y: self.pageYOffset })\n )\n } catch {}\n\n // Restore old scroll position:\n try {\n const v = sessionStorage.getItem('__next_scroll_' + key)\n forcedScroll = JSON.parse(v!)\n } catch {\n forcedScroll = { x: 0, y: 0 }\n }\n }\n }\n }\n this._key = key\n\n const { pathname } = parseRelativeUrl(url)\n\n // Make sure we don't re-render on initial load,\n // can be caused by navigating back from an external site\n if (\n this.isSsr &&\n as === addBasePath(this.asPath) &&\n pathname === addBasePath(this.pathname)\n ) {\n return\n }\n\n // If the downstream application returns falsy, return.\n // They will then be responsible for handling the event.\n if (this._bps && !this._bps(state)) {\n return\n }\n\n this.change(\n 'replaceState',\n url,\n as,\n Object.assign<{}, TransitionOptions, TransitionOptions>({}, options, {\n shallow: options.shallow && this._shallow,\n locale: options.locale || this.defaultLocale,\n // @ts-ignore internal value not exposed on types\n _h: 0,\n }),\n forcedScroll\n )\n }\n\n reload(): void {\n window.location.reload()\n }\n\n /**\n * Go back in history\n */\n back() {\n window.history.back()\n }\n\n /**\n * Go forward in history\n */\n forward() {\n window.history.forward()\n }\n\n /**\n * Performs a `pushState` with arguments\n * @param url of the route\n * @param as masks `url` for the browser\n * @param options object you can define `shallow` and other options\n */\n push(url: Url, as?: Url, options: TransitionOptions = {}) {\n if (process.env.__NEXT_SCROLL_RESTORATION) {\n // TODO: remove in the future when we update history before route change\n // is complete, as the popstate event should handle this capture.\n if (manualScrollRestoration) {\n try {\n // Snapshot scroll position right before navigating to a new page:\n sessionStorage.setItem(\n '__next_scroll_' + this._key,\n JSON.stringify({ x: self.pageXOffset, y: self.pageYOffset })\n )\n } catch {}\n }\n }\n ;({ url, as } = prepareUrlAs(this, url, as))\n return this.change('pushState', url, as, options)\n }\n\n /**\n * Performs a `replaceState` with arguments\n * @param url of the route\n * @param as masks `url` for the browser\n * @param options object you can define `shallow` and other options\n */\n replace(url: Url, as?: Url, options: TransitionOptions = {}) {\n ;({ url, as } = prepareUrlAs(this, url, as))\n return this.change('replaceState', url, as, options)\n }\n\n async _bfl(\n as: string,\n resolvedAs?: string,\n locale?: string | false,\n skipNavigate?: boolean\n ) {\n if (process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED) {\n if (!this._bfl_s && !this._bfl_d) {\n const { BloomFilter } =\n require('../../lib/bloom-filter') as typeof import('../../lib/bloom-filter')\n\n type Filter = ReturnType<\n import('../../lib/bloom-filter').BloomFilter['export']\n >\n let staticFilterData: Filter | undefined\n let dynamicFilterData: Filter | undefined\n\n try {\n ;({\n __routerFilterStatic: staticFilterData,\n __routerFilterDynamic: dynamicFilterData,\n } = (await getClientBuildManifest()) as any as {\n __routerFilterStatic?: Filter\n __routerFilterDynamic?: Filter\n })\n } catch (err) {\n // failed to load build manifest hard navigate\n // to be safe\n console.error(err)\n if (skipNavigate) {\n return true\n }\n handleHardNavigation({\n url: addBasePath(\n addLocale(as, locale || this.locale, this.defaultLocale)\n ),\n router: this,\n })\n return new Promise(() => {})\n }\n\n const routerFilterSValue: Filter | false = process.env\n .__NEXT_CLIENT_ROUTER_S_FILTER as any\n\n if (!staticFilterData && routerFilterSValue) {\n staticFilterData = routerFilterSValue ? routerFilterSValue : undefined\n }\n\n const routerFilterDValue: Filter | false = process.env\n .__NEXT_CLIENT_ROUTER_D_FILTER as any\n\n if (!dynamicFilterData && routerFilterDValue) {\n dynamicFilterData = routerFilterDValue\n ? routerFilterDValue\n : undefined\n }\n\n if (staticFilterData?.numHashes) {\n this._bfl_s = new BloomFilter(\n staticFilterData.numItems,\n staticFilterData.errorRate\n )\n this._bfl_s.import(staticFilterData)\n }\n\n if (dynamicFilterData?.numHashes) {\n this._bfl_d = new BloomFilter(\n dynamicFilterData.numItems,\n dynamicFilterData.errorRate\n )\n this._bfl_d.import(dynamicFilterData)\n }\n }\n\n let matchesBflStatic = false\n let matchesBflDynamic = false\n const pathsToCheck: Array<{ as?: string; allowMatchCurrent?: boolean }> =\n [{ as }, { as: resolvedAs }]\n\n for (const { as: curAs, allowMatchCurrent } of pathsToCheck) {\n if (curAs) {\n const asNoSlash = removeTrailingSlash(\n new URL(curAs, 'http://n').pathname\n )\n const asNoSlashLocale = addBasePath(\n addLocale(asNoSlash, locale || this.locale)\n )\n\n if (\n allowMatchCurrent ||\n asNoSlash !==\n removeTrailingSlash(new URL(this.asPath, 'http://n').pathname)\n ) {\n matchesBflStatic =\n matchesBflStatic ||\n !!this._bfl_s?.contains(asNoSlash) ||\n !!this._bfl_s?.contains(asNoSlashLocale)\n\n for (const normalizedAS of [asNoSlash, asNoSlashLocale]) {\n // if any sub-path of as matches a dynamic filter path\n // it should be hard navigated\n const curAsParts = normalizedAS.split('/')\n for (\n let i = 0;\n !matchesBflDynamic && i < curAsParts.length + 1;\n i++\n ) {\n const currentPart = curAsParts.slice(0, i).join('/')\n if (currentPart && this._bfl_d?.contains(currentPart)) {\n matchesBflDynamic = true\n break\n }\n }\n }\n\n // if the client router filter is matched then we trigger\n // a hard navigation\n if (matchesBflStatic || matchesBflDynamic) {\n if (skipNavigate) {\n return true\n }\n handleHardNavigation({\n url: addBasePath(\n addLocale(as, locale || this.locale, this.defaultLocale)\n ),\n router: this,\n })\n return new Promise(() => {})\n }\n }\n }\n }\n }\n return false\n }\n\n private async change(\n method: HistoryMethod,\n url: string,\n as: string,\n options: TransitionOptions,\n forcedScroll?: { x: number; y: number }\n ): Promise<boolean> {\n if (!isLocalURL(url)) {\n handleHardNavigation({ url, router: this })\n return false\n }\n // WARNING: `_h` is an internal option for handing Next.js client-side\n // hydration. Your app should _never_ use this property. It may change at\n // any time without notice.\n const isQueryUpdating = (options as any)._h === 1\n\n if (!isQueryUpdating && !options.shallow) {\n await this._bfl(as, undefined, options.locale)\n }\n\n let shouldResolveHref =\n isQueryUpdating ||\n (options as any)._shouldResolveHref ||\n parsePath(url).pathname === parsePath(as).pathname\n\n const nextState = {\n ...this.state,\n }\n\n // for static pages with query params in the URL we delay\n // marking the router ready until after the query is updated\n // or a navigation has occurred\n const readyStateChange = this.isReady !== true\n this.isReady = true\n const isSsr = this.isSsr\n\n if (!isQueryUpdating) {\n this.isSsr = false\n }\n\n // if a route transition is already in progress before\n // the query updating is triggered ignore query updating\n if (isQueryUpdating && this.clc) {\n return false\n }\n\n const prevLocale = nextState.locale\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n nextState.locale =\n options.locale === false\n ? this.defaultLocale\n : options.locale || nextState.locale\n\n if (typeof options.locale === 'undefined') {\n options.locale = nextState.locale\n }\n\n const parsedAs = parseRelativeUrl(\n hasBasePath(as) ? removeBasePath(as) : as\n )\n const localePathResult = normalizeLocalePath(\n parsedAs.pathname,\n this.locales\n )\n\n if (localePathResult.detectedLocale) {\n nextState.locale = localePathResult.detectedLocale\n parsedAs.pathname = addBasePath(parsedAs.pathname)\n as = formatWithValidation(parsedAs)\n url = addBasePath(\n normalizeLocalePath(\n hasBasePath(url) ? removeBasePath(url) : url,\n this.locales\n ).pathname\n )\n }\n let didNavigate = false\n\n // we need to wrap this in the env check again since regenerator runtime\n // moves this on its own due to the return\n if (process.env.__NEXT_I18N_SUPPORT) {\n // if the locale isn't configured hard navigate to show 404 page\n if (!this.locales?.includes(nextState.locale!)) {\n parsedAs.pathname = addLocale(parsedAs.pathname, nextState.locale)\n handleHardNavigation({\n url: formatWithValidation(parsedAs),\n router: this,\n })\n // this was previously a return but was removed in favor\n // of better dead code elimination with regenerator runtime\n didNavigate = true\n }\n }\n\n const detectedDomain = detectDomainLocale(\n this.domainLocales,\n undefined,\n nextState.locale\n )\n\n // we need to wrap this in the env check again since regenerator runtime\n // moves this on its own due to the return\n if (process.env.__NEXT_I18N_SUPPORT) {\n // if we are navigating to a domain locale ensure we redirect to the\n // correct domain\n if (\n !didNavigate &&\n detectedDomain &&\n this.isLocaleDomain &&\n self.location.hostname !== detectedDomain.domain\n ) {\n const asNoBasePath = removeBasePath(as)\n handleHardNavigation({\n url: `http${detectedDomain.http ? '' : 's'}://${\n detectedDomain.domain\n }${addBasePath(\n `${\n nextState.locale === detectedDomain.defaultLocale\n ? ''\n : `/${nextState.locale}`\n }${asNoBasePath === '/' ? '' : asNoBasePath}` || '/'\n )}`,\n router: this,\n })\n // this was previously a return but was removed in favor\n // of better dead code elimination with regenerator runtime\n didNavigate = true\n }\n }\n\n if (didNavigate) {\n return new Promise(() => {})\n }\n }\n\n // marking route changes as a navigation start entry\n if (ST) {\n performance.mark('routeChange')\n }\n\n const { shallow = false, scroll = true } = options\n const routeProps = { shallow }\n\n if (this._inFlightRoute && this.clc) {\n if (!isSsr) {\n Router.events.emit(\n 'routeChangeError',\n buildCancellationError(),\n this._inFlightRoute,\n routeProps\n )\n }\n this.clc()\n this.clc = null\n }\n\n as = addBasePath(\n addLocale(\n hasBasePath(as) ? removeBasePath(as) : as,\n options.locale,\n this.defaultLocale\n )\n )\n const cleanedAs = removeLocale(\n hasBasePath(as) ? removeBasePath(as) : as,\n nextState.locale\n )\n this._inFlightRoute = as\n\n const localeChange = prevLocale !== nextState.locale\n\n // If the url change is only related to a hash change\n // We should not proceed. We should only change the state.\n\n if (!isQueryUpdating && this.onlyAHashChange(cleanedAs) && !localeChange) {\n nextState.asPath = cleanedAs\n Router.events.emit('hashChangeStart', as, routeProps)\n // TODO: do we need the resolved href when only a hash change?\n this.changeState(method, url, as, {\n ...options,\n scroll: false,\n })\n if (scroll) {\n this.scrollToHash(cleanedAs)\n }\n try {\n await this.set(nextState, this.components[nextState.route], null)\n } catch (err) {\n if (isError(err) && err.cancelled) {\n Router.events.emit('routeChangeError', err, cleanedAs, routeProps)\n }\n throw err\n }\n\n Router.events.emit('hashChangeComplete', as, routeProps)\n return true\n }\n\n let parsed = parseRelativeUrl(url)\n let { pathname, query } = parsed\n\n // The build manifest needs to be loaded before auto-static dynamic pages\n // get their query parameters to allow ensuring they can be parsed properly\n // when rewritten to\n let pages: string[], rewrites: any\n try {\n ;[pages, { __rewrites: rewrites }] = await Promise.all([\n this.pageLoader.getPageList(),\n getClientBuildManifest(),\n this.pageLoader.getMiddleware(),\n ])\n } catch (err) {\n // If we fail to resolve the page list or client-build manifest, we must\n // do a server-side transition:\n handleHardNavigation({ url: as, router: this })\n return false\n }\n\n // If asked to change the current URL we should reload the current page\n // (not location.reload() but reload getInitialProps and other Next.js stuffs)\n // We also need to set the method = replaceState always\n // as this should not go into the history (That's how browsers work)\n // We should compare the new asPath to the current asPath, not the url\n if (!this.urlIsNew(cleanedAs) && !localeChange) {\n method = 'replaceState'\n }\n\n // we need to resolve the as value using rewrites for dynamic SSG\n // pages to allow building the data URL correctly\n let resolvedAs = as\n\n // url and as should always be prefixed with basePath by this\n // point by either next/link or router.push/replace so strip the\n // basePath from the pathname to match the pages dir 1-to-1\n pathname = pathname\n ? removeTrailingSlash(removeBasePath(pathname))\n : pathname\n\n let route = removeTrailingSlash(pathname)\n const parsedAsPathname = as.startsWith('/') && parseRelativeUrl(as).pathname\n\n // if we detected the path as app route during prefetching\n // trigger hard navigation\n if ((this.components[pathname] as any)?.__appRouter) {\n handleHardNavigation({ url: as, router: this })\n return new Promise(() => {})\n }\n\n const isMiddlewareRewrite = !!(\n parsedAsPathname &&\n route !== parsedAsPathname &&\n (!isDynamicRoute(route) ||\n !getRouteMatcher(getRouteRegex(route))(parsedAsPathname))\n )\n\n // we don't attempt resolve asPath when we need to execute\n // middleware as the resolving will occur server-side\n const isMiddlewareMatch =\n !options.shallow &&\n (await matchesMiddleware({\n asPath: as,\n locale: nextState.locale,\n router: this,\n }))\n\n if (isQueryUpdating && isMiddlewareMatch) {\n shouldResolveHref = false\n }\n\n if (shouldResolveHref && pathname !== '/_error') {\n ;(options as any)._shouldResolveHref = true\n\n if (process.env.__NEXT_HAS_REWRITES && as.startsWith('/')) {\n const rewritesResult = resolveRewrites(\n addBasePath(addLocale(cleanedAs, nextState.locale), true),\n pages,\n rewrites,\n query,\n (p: string) => resolveDynamicRoute(p, pages),\n this.locales\n )\n\n if (rewritesResult.externalDest) {\n handleHardNavigation({ url: as, router: this })\n return true\n }\n if (!isMiddlewareMatch) {\n resolvedAs = rewritesResult.asPath\n }\n\n if (rewritesResult.matchedPage && rewritesResult.resolvedHref) {\n // if this directly matches a page we need to update the href to\n // allow the correct page chunk to be loaded\n pathname = rewritesResult.resolvedHref\n parsed.pathname = addBasePath(pathname)\n\n if (!isMiddlewareMatch) {\n url = formatWithValidation(parsed)\n }\n }\n } else {\n parsed.pathname = resolveDynamicRoute(pathname, pages)\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname\n parsed.pathname = addBasePath(pathname)\n\n if (!isMiddlewareMatch) {\n url = formatWithValidation(parsed)\n }\n }\n }\n }\n\n if (!isLocalURL(as)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invalid href: \"${url}\" and as: \"${as}\", received relative href and external as` +\n `\\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`\n )\n }\n handleHardNavigation({ url: as, router: this })\n return false\n }\n\n resolvedAs = removeLocale(removeBasePath(resolvedAs), nextState.locale)\n\n route = removeTrailingSlash(pathname)\n let routeMatch: Params | false = false\n\n if (isDynamicRoute(route)) {\n const parsedAs = parseRelativeUrl(resolvedAs)\n const asPathname = parsedAs.pathname\n\n const routeRegex = getRouteRegex(route)\n routeMatch = getRouteMatcher(routeRegex)(asPathname)\n const shouldInterpolate = route === asPathname\n const interpolatedAs = shouldInterpolate\n ? interpolateAs(route, asPathname, query)\n : ({} as { result: undefined; params: undefined })\n\n if (!routeMatch || (shouldInterpolate && !interpolatedAs.result)) {\n const missingParams = Object.keys(routeRegex.groups).filter(\n (param) => !query[param] && !routeRegex.groups[param].optional\n )\n\n if (missingParams.length > 0 && !isMiddlewareMatch) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `${\n shouldInterpolate\n ? `Interpolating href`\n : `Mismatching \\`as\\` and \\`href\\``\n } failed to manually provide ` +\n `the params: ${missingParams.join(\n ', '\n )} in the \\`href\\`'s \\`query\\``\n )\n }\n\n throw new Error(\n (shouldInterpolate\n ? `The provided \\`href\\` (${url}) value is missing query values (${missingParams.join(\n ', '\n )}) to be interpolated properly. `\n : `The provided \\`as\\` value (${asPathname}) is incompatible with the \\`href\\` value (${route}). `) +\n `Read more: https://nextjs.org/docs/messages/${\n shouldInterpolate\n ? 'href-interpolation-failed'\n : 'incompatible-href-as'\n }`\n )\n }\n } else if (shouldInterpolate) {\n as = formatWithValidation(\n Object.assign({}, parsedAs, {\n pathname: interpolatedAs.result,\n query: omit(query, interpolatedAs.params!),\n })\n )\n } else {\n // Merge params into `query`, overwriting any specified in search\n Object.assign(query, routeMatch)\n }\n }\n\n if (!isQueryUpdating) {\n Router.events.emit('routeChangeStart', as, routeProps)\n }\n\n const isErrorRoute = this.pathname === '/404' || this.pathname === '/_error'\n\n try {\n let routeInfo = await this.getRouteInfo({\n route,\n pathname,\n query,\n as,\n resolvedAs,\n routeProps,\n locale: nextState.locale,\n isPreview: nextState.isPreview,\n hasMiddleware: isMiddlewareMatch,\n unstable_skipClientCache: options.unstable_skipClientCache,\n isQueryUpdating: isQueryUpdating && !this.isFallback,\n isMiddlewareRewrite,\n })\n\n if (!isQueryUpdating && !options.shallow) {\n await this._bfl(\n as,\n 'resolvedAs' in routeInfo ? routeInfo.resolvedAs : undefined,\n nextState.locale\n )\n }\n\n if ('route' in routeInfo && isMiddlewareMatch) {\n pathname = routeInfo.route || route\n route = pathname\n\n if (!routeProps.shallow) {\n query = Object.assign({}, routeInfo.query || {}, query)\n }\n\n const cleanedParsedPathname = hasBasePath(parsed.pathname)\n ? removeBasePath(parsed.pathname)\n : parsed.pathname\n\n if (routeMatch && pathname !== cleanedParsedPathname) {\n Object.keys(routeMatch).forEach((key) => {\n if (routeMatch && query[key] === routeMatch[key]) {\n delete query[key]\n }\n })\n }\n\n if (isDynamicRoute(pathname)) {\n const prefixedAs =\n !routeProps.shallow && routeInfo.resolvedAs\n ? routeInfo.resolvedAs\n : addBasePath(\n addLocale(\n new URL(as, location.href).pathname,\n nextState.locale\n ),\n true\n )\n\n let rewriteAs = prefixedAs\n\n if (hasBasePath(rewriteAs)) {\n rewriteAs = removeBasePath(rewriteAs)\n }\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n const localeResult = normalizeLocalePath(rewriteAs, this.locales)\n nextState.locale = localeResult.detectedLocale || nextState.locale\n rewriteAs = localeResult.pathname\n }\n const routeRegex = getRouteRegex(pathname)\n const curRouteMatch = getRouteMatcher(routeRegex)(\n new URL(rewriteAs, location.href).pathname\n )\n\n if (curRouteMatch) {\n Object.assign(query, curRouteMatch)\n }\n }\n }\n\n // If the routeInfo brings a redirect we simply apply it.\n if ('type' in routeInfo) {\n if (routeInfo.type === 'redirect-internal') {\n return this.change(method, routeInfo.newUrl, routeInfo.newAs, options)\n } else {\n handleHardNavigation({ url: routeInfo.destination, router: this })\n return new Promise(() => {})\n }\n }\n\n const component: any = routeInfo.Component\n if (component && component.unstable_scriptLoader) {\n const scripts = [].concat(component.unstable_scriptLoader())\n\n scripts.forEach((script: any) => {\n handleClientScriptLoad(script.props)\n })\n }\n\n // handle redirect on client-transition\n if ((routeInfo.__N_SSG || routeInfo.__N_SSP) && routeInfo.props) {\n if (\n routeInfo.props.pageProps &&\n routeInfo.props.pageProps.__N_REDIRECT\n ) {\n // Use the destination from redirect without adding locale\n options.locale = false\n\n const destination = routeInfo.props.pageProps.__N_REDIRECT\n\n // check if destination is internal (resolves to a page) and attempt\n // client-navigation if it is falling back to hard navigation if\n // it's not\n if (\n destination.startsWith('/') &&\n routeInfo.props.pageProps.__N_REDIRECT_BASE_PATH !== false\n ) {\n const parsedHref = parseRelativeUrl(destination)\n parsedHref.pathname = resolveDynamicRoute(\n parsedHref.pathname,\n pages\n )\n\n const { url: newUrl, as: newAs } = prepareUrlAs(\n this,\n destination,\n destination\n )\n return this.change(method, newUrl, newAs, options)\n }\n handleHardNavigation({ url: destination, router: this })\n return new Promise(() => {})\n }\n\n nextState.isPreview = !!routeInfo.props.__N_PREVIEW\n\n // handle SSG data 404\n if (routeInfo.props.notFound === SSG_DATA_NOT_FOUND) {\n let notFoundRoute\n\n try {\n await this.fetchComponent('/404')\n notFoundRoute = '/404'\n } catch (_) {\n notFoundRoute = '/_error'\n }\n\n routeInfo = await this.getRouteInfo({\n route: notFoundRoute,\n pathname: notFoundRoute,\n query,\n as,\n resolvedAs,\n routeProps: { shallow: false },\n locale: nextState.locale,\n isPreview: nextState.isPreview,\n isNotFound: true,\n })\n\n if ('type' in routeInfo) {\n throw new Error(`Unexpected middleware effect on /404`)\n }\n }\n }\n\n if (\n isQueryUpdating &&\n this.pathname === '/_error' &&\n self.__NEXT_DATA__.props?.pageProps?.statusCode === 500 &&\n routeInfo.props?.pageProps\n ) {\n // ensure statusCode is still correct for static 500 page\n // when updating query information\n routeInfo.props.pageProps.statusCode = 500\n }\n\n // shallow routing is only allowed for same page URL changes.\n const isValidShallowRoute =\n options.shallow && nextState.route === (routeInfo.route ?? route)\n\n const shouldScroll =\n options.scroll ?? (!isQueryUpdating && !isValidShallowRoute)\n const resetScroll = shouldScroll ? { x: 0, y: 0 } : null\n const upcomingScrollState = forcedScroll ?? resetScroll\n\n // the new state that the router gonna set\n const upcomingRouterState = {\n ...nextState,\n route,\n pathname,\n query,\n asPath: cleanedAs,\n isFallback: false,\n }\n\n // When the page being rendered is the 404 page, we should only update the\n // query parameters. Route changes here might add the basePath when it\n // wasn't originally present. This is also why this block is before the\n // below `changeState` call which updates the browser's history (changing\n // the URL).\n if (isQueryUpdating && isErrorRoute) {\n routeInfo = await this.getRouteInfo({\n route: this.pathname,\n pathname: this.pathname,\n query,\n as,\n resolvedAs,\n routeProps: { shallow: false },\n locale: nextState.locale,\n isPreview: nextState.isPreview,\n isQueryUpdating: isQueryUpdating && !this.isFallback,\n })\n\n if ('type' in routeInfo) {\n throw new Error(`Unexpected middleware effect on ${this.pathname}`)\n }\n\n if (\n this.pathname === '/_error' &&\n self.__NEXT_DATA__.props?.pageProps?.statusCode === 500 &&\n routeInfo.props?.pageProps\n ) {\n // ensure statusCode is still correct for static 500 page\n // when updating query information\n routeInfo.props.pageProps.statusCode = 500\n }\n\n try {\n await this.set(upcomingRouterState, routeInfo, upcomingScrollState)\n } catch (err) {\n if (isError(err) && err.cancelled) {\n Router.events.emit('routeChangeError', err, cleanedAs, routeProps)\n }\n throw err\n }\n\n return true\n }\n\n Router.events.emit('beforeHistoryChange', as, routeProps)\n this.changeState(method, url, as, options)\n\n // for query updates we can skip it if the state is unchanged and we don't\n // need to scroll\n // https://github.com/vercel/next.js/issues/37139\n const canSkipUpdating =\n isQueryUpdating &&\n !upcomingScrollState &&\n !readyStateChange &&\n !localeChange &&\n compareRouterStates(upcomingRouterState, this.state)\n\n if (!canSkipUpdating) {\n try {\n await this.set(upcomingRouterState, routeInfo, upcomingScrollState)\n } catch (e: any) {\n if (e.cancelled) routeInfo.error = routeInfo.error || e\n else throw e\n }\n\n if (routeInfo.error) {\n if (!isQueryUpdating) {\n Router.events.emit(\n 'routeChangeError',\n routeInfo.error,\n cleanedAs,\n routeProps\n )\n }\n\n throw routeInfo.error\n }\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n if (nextState.locale) {\n document.documentElement.lang = nextState.locale\n }\n }\n\n if (!isQueryUpdating) {\n Router.events.emit('routeChangeComplete', as, routeProps)\n }\n\n // A hash mark # is the optional last part of a URL\n const hashRegex = /#.+$/\n if (shouldScroll && hashRegex.test(as)) {\n this.scrollToHash(as)\n }\n }\n\n return true\n } catch (err) {\n if (isError(err) && err.cancelled) {\n return false\n }\n throw err\n }\n }\n\n changeState(\n method: HistoryMethod,\n url: string,\n as: string,\n options: TransitionOptions = {}\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof window.history === 'undefined') {\n console.error(`Warning: window.history is not available.`)\n return\n }\n\n if (typeof window.history[method] === 'undefined') {\n console.error(`Warning: window.history.${method} is not available`)\n return\n }\n }\n\n if (method !== 'pushState' || getURL() !== as) {\n this._shallow = options.shallow\n window.history[method](\n {\n url,\n as,\n options,\n __N: true,\n key: (this._key = method !== 'pushState' ? this._key : createKey()),\n } as HistoryState,\n // Most browsers currently ignores this parameter, although they may use it in the future.\n // Passing the empty string here should be safe against future changes to the method.\n // https://developer.mozilla.org/docs/Web/API/History/replaceState\n '',\n as\n )\n }\n }\n\n async handleRouteInfoError(\n err: Error & { code?: any; cancelled?: boolean },\n pathname: string,\n query: ParsedUrlQuery,\n as: string,\n routeProps: RouteProperties,\n loadErrorFail?: boolean\n ): Promise<CompletePrivateRouteInfo> {\n if (err.cancelled) {\n // bubble up cancellation errors\n throw err\n }\n\n if (isAssetError(err) || loadErrorFail) {\n Router.events.emit('routeChangeError', err, as, routeProps)\n\n // If we can't load the page it could be one of following reasons\n // 1. Page doesn't exists\n // 2. Page does exist in a different zone\n // 3. Internal error while loading the page\n\n // So, doing a hard reload is the proper way to deal with this.\n handleHardNavigation({\n url: as,\n router: this,\n })\n\n // Changing the URL doesn't block executing the current code path.\n // So let's throw a cancellation error stop the routing logic.\n throw buildCancellationError()\n }\n\n console.error(err)\n\n try {\n let props: Record<string, any> | undefined\n const { page: Component, styleSheets } =\n await this.fetchComponent('/_error')\n\n const routeInfo: CompletePrivateRouteInfo = {\n props,\n Component,\n styleSheets,\n err,\n error: err,\n }\n\n if (!routeInfo.props) {\n try {\n routeInfo.props = await this.getInitialProps(Component, {\n err,\n pathname,\n query,\n } as any)\n } catch (gipErr) {\n console.error('Error in error page `getInitialProps`: ', gipErr)\n routeInfo.props = {}\n }\n }\n\n return routeInfo\n } catch (routeInfoErr) {\n return this.handleRouteInfoError(\n isError(routeInfoErr) ? routeInfoErr : new Error(routeInfoErr + ''),\n pathname,\n query,\n as,\n routeProps,\n true\n )\n }\n }\n\n async getRouteInfo({\n route: requestedRoute,\n pathname,\n query,\n as,\n resolvedAs,\n routeProps,\n locale,\n hasMiddleware,\n isPreview,\n unstable_skipClientCache,\n isQueryUpdating,\n isMiddlewareRewrite,\n isNotFound,\n }: {\n route: string\n pathname: string\n query: ParsedUrlQuery\n as: string\n resolvedAs: string\n hasMiddleware?: boolean\n routeProps: RouteProperties\n locale: string | undefined\n isPreview: boolean\n unstable_skipClientCache?: boolean\n isQueryUpdating?: boolean\n isMiddlewareRewrite?: boolean\n isNotFound?: boolean\n }) {\n /**\n * This `route` binding can change if there's a rewrite\n * so we keep a reference to the original requested route\n * so we can store the cache for it and avoid re-requesting every time\n * for shallow routing purposes.\n */\n let route = requestedRoute\n\n try {\n let existingInfo: PrivateRouteInfo | undefined = this.components[route]\n if (routeProps.shallow && existingInfo && this.route === route) {\n return existingInfo\n }\n\n const handleCancelled = getCancelledHandler({ route, router: this })\n\n if (hasMiddleware) {\n existingInfo = undefined\n }\n\n let cachedRouteInfo =\n existingInfo &&\n !('initial' in existingInfo) &&\n process.env.NODE_ENV !== 'development'\n ? existingInfo\n : undefined\n\n const isBackground = isQueryUpdating\n const fetchNextDataParams: FetchNextDataParams = {\n dataHref: this.pageLoader.getDataHref({\n href: formatWithValidation({ pathname, query }),\n skipInterpolation: true,\n asPath: isNotFound ? '/404' : resolvedAs,\n locale,\n }),\n hasMiddleware: true,\n isServerRender: this.isSsr,\n parseJSON: true,\n inflightCache: isBackground ? this.sbc : this.sdc,\n persistCache: !isPreview,\n isPrefetch: false,\n unstable_skipClientCache,\n isBackground,\n }\n\n let data:\n | WithMiddlewareEffectsOutput\n | (Pick<WithMiddlewareEffectsOutput, 'json'> &\n Omit<Partial<WithMiddlewareEffectsOutput>, 'json'>)\n | null =\n isQueryUpdating && !isMiddlewareRewrite\n ? null\n : await withMiddlewareEffects({\n fetchData: () => fetchNextData(fetchNextDataParams),\n asPath: isNotFound ? '/404' : resolvedAs,\n locale: locale,\n router: this,\n }).catch((err) => {\n // we don't hard error during query updating\n // as it's un-necessary and doesn't need to be fatal\n // unless it is a fallback route and the props can't\n // be loaded\n if (isQueryUpdating) {\n return null\n }\n throw err\n })\n\n // when rendering error routes we don't apply middleware\n // effects\n if (data && (pathname === '/_error' || pathname === '/404')) {\n data.effect = undefined\n }\n\n if (isQueryUpdating) {\n if (!data) {\n data = { json: self.__NEXT_DATA__.props }\n } else {\n data.json = self.__NEXT_DATA__.props\n }\n }\n\n handleCancelled()\n\n if (\n data?.effect?.type === 'redirect-internal' ||\n data?.effect?.type === 'redirect-external'\n ) {\n return data.effect\n }\n\n if (data?.effect?.type === 'rewrite') {\n const resolvedRoute = removeTrailingSlash(data.effect.resolvedHref)\n const pages = await this.pageLoader.getPageList()\n\n // during query updating the page must match although during\n // client-transition a redirect that doesn't match a page\n // can be returned and this should trigger a hard navigation\n // which is valid for incremental migration\n if (!isQueryUpdating || pages.includes(resolvedRoute)) {\n route = resolvedRoute\n pathname = data.effect.resolvedHref\n query = { ...query, ...data.effect.parsedAs.query }\n resolvedAs = removeBasePath(\n normalizeLocalePath(data.effect.parsedAs.pathname, this.locales)\n .pathname\n )\n\n // Check again the cache with the new destination.\n existingInfo = this.components[route]\n if (\n routeProps.shallow &&\n existingInfo &&\n this.route === route &&\n !hasMiddleware\n ) {\n // If we have a match with the current route due to rewrite,\n // we can copy the existing information to the rewritten one.\n // Then, we return the information along with the matched route.\n return { ...existingInfo, route }\n }\n }\n }\n\n if (isAPIRoute(route)) {\n handleHardNavigation({ url: as, router: this })\n return new Promise<never>(() => {})\n }\n\n const routeInfo =\n cachedRouteInfo ||\n (await this.fetchComponent(route).then<CompletePrivateRouteInfo>(\n (res) => ({\n Component: res.page,\n styleSheets: res.styleSheets,\n __N_SSG: res.mod.__N_SSG,\n __N_SSP: res.mod.__N_SSP,\n })\n ))\n\n if (process.env.NODE_ENV !== 'production') {\n const { isValidElementType } = require('next/dist/compiled/react-is')\n if (!isValidElementType(routeInfo.Component)) {\n throw new Error(\n `The default export is not a React Component in page: \"${pathname}\"`\n )\n }\n }\n const wasBailedPrefetch = data?.response?.headers.get('x-middleware-skip')\n\n const shouldFetchData = routeInfo.__N_SSG || routeInfo.__N_SSP\n\n // For non-SSG prefetches that bailed before sending data\n // we clear the cache to fetch full response\n if (wasBailedPrefetch && data?.dataHref) {\n delete this.sdc[data.dataHref]\n }\n\n const { props, cacheKey } = await this._getData(async () => {\n if (shouldFetchData) {\n if (data?.json && !wasBailedPrefetch) {\n return { cacheKey: data.cacheKey, props: data.json }\n }\n\n const dataHref = data?.dataHref\n ? data.dataHref\n : this.pageLoader.getDataHref({\n href: formatWithValidation({ pathname, query }),\n asPath: resolvedAs,\n locale,\n })\n\n const fetched = await fetchNextData({\n dataHref,\n isServerRender: this.isSsr,\n parseJSON: true,\n inflightCache: wasBailedPrefetch ? {} : this.sdc,\n persistCache: !isPreview,\n isPrefetch: false,\n unstable_skipClientCache,\n })\n\n return {\n cacheKey: fetched.cacheKey,\n props: fetched.json || {},\n }\n }\n\n return {\n headers: {},\n props: await this.getInitialProps(\n routeInfo.Component,\n // we provide AppTree later so this needs to be `any`\n {\n pathname,\n query,\n asPath: as,\n locale,\n locales: this.locales,\n defaultLocale: this.defaultLocale,\n } as any\n ),\n }\n })\n\n // Only bust the data cache for SSP routes although\n // middleware can skip cache per request with\n // x-middleware-cache: no-cache as well\n if (routeInfo.__N_SSP && fetchNextDataParams.dataHref && cacheKey) {\n delete this.sdc[cacheKey]\n }\n\n // we kick off a HEAD request in the background\n // when a non-prefetch request is made to signal revalidation\n if (\n !this.isPreview &&\n routeInfo.__N_SSG &&\n process.env.NODE_ENV !== 'development' &&\n !isQueryUpdating\n ) {\n fetchNextData(\n Object.assign({}, fetchNextDataParams, {\n isBackground: true,\n persistCache: false,\n inflightCache: this.sbc,\n })\n ).catch(() => {})\n }\n\n props.pageProps = Object.assign({}, props.pageProps)\n routeInfo.props = props\n routeInfo.route = route\n routeInfo.query = query\n routeInfo.resolvedAs = resolvedAs\n this.components[route] = routeInfo\n\n return routeInfo\n } catch (err) {\n return this.handleRouteInfoError(\n getProperError(err),\n pathname,\n query,\n as,\n routeProps\n )\n }\n }\n\n private set(\n state: typeof this.state,\n data: PrivateRouteInfo,\n resetScroll: { x: number; y: number } | null\n ): Promise<void> {\n this.state = state\n\n return this.sub(\n data,\n this.components['/_app'].Component as AppComponent,\n resetScroll\n )\n }\n\n /**\n * Callback to execute before replacing router state\n * @param cb callback to be executed\n */\n beforePopState(cb: BeforePopStateCallback) {\n this._bps = cb\n }\n\n onlyAHashChange(as: string): boolean {\n if (!this.asPath) return false\n const [oldUrlNoHash, oldHash] = this.asPath.split('#', 2)\n const [newUrlNoHash, newHash] = as.split('#', 2)\n\n // Makes sure we scroll to the provided hash if the url/hash are the same\n if (newHash && oldUrlNoHash === newUrlNoHash && oldHash === newHash) {\n return true\n }\n\n // If the urls are change, there's more than a hash change\n if (oldUrlNoHash !== newUrlNoHash) {\n return false\n }\n\n // If the hash has changed, then it's a hash only change.\n // This check is necessary to handle both the enter and\n // leave hash === '' cases. The identity case falls through\n // and is treated as a next reload.\n return oldHash !== newHash\n }\n\n scrollToHash(as: string): void {\n const [, hash = ''] = as.split('#', 2)\n\n handleSmoothScroll(\n () => {\n // Scroll to top if the hash is just `#` with no value or `#top`\n // To mirror browsers\n if (hash === '' || hash === 'top') {\n window.scrollTo(0, 0)\n return\n }\n\n // Decode hash to make non-latin anchor works.\n const rawHash = decodeURIComponent(hash)\n // First we check if the element by id is found\n const idEl = document.getElementById(rawHash)\n if (idEl) {\n idEl.scrollIntoView()\n return\n }\n // If there's no element with the id, we check the `name` property\n // To mirror browsers\n const nameEl = document.getElementsByName(rawHash)[0]\n if (nameEl) {\n nameEl.scrollIntoView()\n }\n },\n {\n onlyHashChange: this.onlyAHashChange(as),\n }\n )\n }\n\n urlIsNew(asPath: string): boolean {\n return this.asPath !== asPath\n }\n\n /**\n * Prefetch page code, you may wait for the data during page rendering.\n * This feature only works in production!\n * @param url the href of prefetched page\n * @param asPath the as path of the prefetched page\n */\n async prefetch(\n url: string,\n asPath: string = url,\n options: PrefetchOptions = {}\n ): Promise<void> {\n // Prefetch is not supported in development mode because it would trigger on-demand-entries\n if (process.env.NODE_ENV !== 'production') {\n return\n }\n\n if (typeof window !== 'undefined' && isBot(window.navigator.userAgent)) {\n // No prefetches for bots that render the link since they are typically navigating\n // links via the equivalent of a hard navigation and hence never utilize these\n // prefetches.\n return\n }\n let parsed = parseRelativeUrl(url)\n const urlPathname = parsed.pathname\n\n let { pathname, query } = parsed\n const originalPathname = pathname\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n if (options.locale === false) {\n pathname = normalizeLocalePath!(pathname, this.locales).pathname\n parsed.pathname = pathname\n url = formatWithValidation(parsed)\n\n let parsedAs = parseRelativeUrl(asPath)\n const localePathResult = normalizeLocalePath!(\n parsedAs.pathname,\n this.locales\n )\n parsedAs.pathname = localePathResult.pathname\n options.locale = localePathResult.detectedLocale || this.defaultLocale\n asPath = formatWithValidation(parsedAs)\n }\n }\n\n const pages = await this.pageLoader.getPageList()\n let resolvedAs = asPath\n\n const locale =\n typeof options.locale !== 'undefined'\n ? options.locale || undefined\n : this.locale\n\n const isMiddlewareMatch = await matchesMiddleware({\n asPath: asPath,\n locale: locale,\n router: this,\n })\n\n if (process.env.__NEXT_HAS_REWRITES && asPath.startsWith('/')) {\n let rewrites: any\n ;({ __rewrites: rewrites } = await getClientBuildManifest())\n\n const rewritesResult = resolveRewrites(\n addBasePath(addLocale(asPath, this.locale), true),\n pages,\n rewrites,\n parsed.query,\n (p: string) => resolveDynamicRoute(p, pages),\n this.locales\n )\n\n if (rewritesResult.externalDest) {\n return\n }\n\n if (!isMiddlewareMatch) {\n resolvedAs = removeLocale(\n removeBasePath(rewritesResult.asPath),\n this.locale\n )\n }\n\n if (rewritesResult.matchedPage && rewritesResult.resolvedHref) {\n // if this directly matches a page we need to update the href to\n // allow the correct page chunk to be loaded\n pathname = rewritesResult.resolvedHref\n parsed.pathname = pathname\n\n if (!isMiddlewareMatch) {\n url = formatWithValidation(parsed)\n }\n }\n }\n parsed.pathname = resolveDynamicRoute(parsed.pathname, pages)\n\n if (isDynamicRoute(parsed.pathname)) {\n pathname = parsed.pathname\n parsed.pathname = pathname\n Object.assign(\n query,\n getRouteMatcher(getRouteRegex(parsed.pathname))(\n parsePath(asPath).pathname\n ) || {}\n )\n\n if (!isMiddlewareMatch) {\n url = formatWithValidation(parsed)\n }\n }\n\n const data =\n process.env.__NEXT_MIDDLEWARE_PREFETCH === 'strict'\n ? null\n : await withMiddlewareEffects({\n fetchData: () =>\n fetchNextData({\n dataHref: this.pageLoader.getDataHref({\n href: formatWithValidation({\n pathname: originalPathname,\n query,\n }),\n skipInterpolation: true,\n asPath: resolvedAs,\n locale,\n }),\n hasMiddleware: true,\n isServerRender: false,\n parseJSON: true,\n inflightCache: this.sdc,\n persistCache: !this.isPreview,\n isPrefetch: true,\n }),\n asPath: asPath,\n locale: locale,\n router: this,\n })\n\n /**\n * If there was a rewrite we apply the effects of the rewrite on the\n * current parameters for the prefetch.\n */\n if (data?.effect.type === 'rewrite') {\n parsed.pathname = data.effect.resolvedHref\n pathname = data.effect.resolvedHref\n query = { ...query, ...data.effect.parsedAs.query }\n resolvedAs = data.effect.parsedAs.pathname\n url = formatWithValidation(parsed)\n }\n\n /**\n * If there is a redirect to an external destination then we don't have\n * to prefetch content as it will be unused.\n */\n if (data?.effect.type === 'redirect-external') {\n return\n }\n\n const route = removeTrailingSlash(pathname)\n\n if (await this._bfl(asPath, resolvedAs, options.locale, true)) {\n this.components[urlPathname] = { __appRouter: true } as any\n }\n\n await Promise.all([\n this.pageLoader._isSsg(route).then((isSsg) => {\n return isSsg\n ? fetchNextData({\n dataHref: data?.json\n ? data?.dataHref\n : this.pageLoader.getDataHref({\n href: url,\n asPath: resolvedAs,\n locale: locale,\n }),\n isServerRender: false,\n parseJSON: true,\n inflightCache: this.sdc,\n persistCache: !this.isPreview,\n isPrefetch: true,\n unstable_skipClientCache:\n options.unstable_skipClientCache ||\n (options.priority &&\n !!process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE),\n })\n .then(() => false)\n .catch(() => false)\n : false\n }),\n this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route),\n ])\n }\n\n async fetchComponent(route: string) {\n const handleCancelled = getCancelledHandler({ route, router: this })\n\n try {\n const componentResult = await this.pageLoader.loadPage(route)\n handleCancelled()\n\n return componentResult\n } catch (err) {\n handleCancelled()\n throw err\n }\n }\n\n _getData<T>(fn: () => Promise<T>): Promise<T> {\n let cancelled = false\n const cancel = () => {\n cancelled = true\n }\n this.clc = cancel\n return fn().then((data) => {\n if (cancel === this.clc) {\n this.clc = null\n }\n\n if (cancelled) {\n const err: any = new Error('Loading initial props cancelled')\n err.cancelled = true\n throw err\n }\n\n return data\n })\n }\n\n getInitialProps(\n Component: ComponentType,\n ctx: NextPageContext\n ): Promise<Record<string, any>> {\n const { Component: App } = this.components['/_app']\n const AppTree = this._wrapApp(App as AppComponent)\n ctx.AppTree = AppTree\n return loadGetInitialProps<AppContextType<Router>>(App, {\n AppTree,\n Component,\n router: this,\n ctx,\n })\n }\n\n get route(): string {\n return this.state.route\n }\n\n get pathname(): string {\n return this.state.pathname\n }\n\n get query(): ParsedUrlQuery {\n return this.state.query\n }\n\n get asPath(): string {\n return this.state.asPath\n }\n\n get locale(): string | undefined {\n return this.state.locale\n }\n\n get isFallback(): boolean {\n return this.state.isFallback\n }\n\n get isPreview(): boolean {\n return this.state.isPreview\n }\n}\n","import { addPathPrefix } from './add-path-prefix'\nimport { pathHasPrefix } from './path-has-prefix'\n\n/**\n * For a given path and a locale, if the locale is given, it will prefix the\n * locale. The path shouldn't be an API path. If a default locale is given the\n * prefix will be omitted if the locale is already the default locale.\n */\nexport function addLocale(\n path: string,\n locale?: string | false,\n defaultLocale?: string,\n ignorePrefix?: boolean\n) {\n // If no locale was given or the locale is the default locale, we don't need\n // to prefix the path.\n if (!locale || locale === defaultLocale) return path\n\n const lower = path.toLowerCase()\n\n // If the path is an API path or the path already has the locale prefix, we\n // don't need to prefix the path.\n if (!ignorePrefix) {\n if (pathHasPrefix(lower, '/api')) return path\n if (pathHasPrefix(lower, `/${locale.toLowerCase()}`)) return path\n }\n\n // Add the locale prefix to the path.\n return addPathPrefix(path, `/${locale}`)\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Adds the provided prefix to the given path. It first ensures that the path\n * is indeed starting with a slash.\n */\nexport function addPathPrefix(path: string, prefix?: string) {\n if (!path.startsWith('/') || !prefix) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n return `${prefix}${pathname}${query}${hash}`\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Similarly to `addPathPrefix`, this function adds a suffix at the end on the\n * provided path. It also works only for paths ensuring the argument starts\n * with a slash.\n */\nexport function addPathSuffix(path: string, suffix?: string) {\n if (!path.startsWith('/') || !suffix) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n return `${pathname}${suffix}${query}${hash}`\n}\n","import { ensureLeadingSlash } from '../../page-path/ensure-leading-slash'\nimport { isGroupSegment } from '../../segment'\n\n/**\n * Normalizes an app route so it represents the actual request path. Essentially\n * performing the following transformations:\n *\n * - `/(dashboard)/user/[id]/page` to `/user/[id]`\n * - `/(dashboard)/account/page` to `/account`\n * - `/user/[id]/page` to `/user/[id]`\n * - `/account/page` to `/account`\n * - `/page` to `/`\n * - `/(dashboard)/user/[id]/route` to `/user/[id]`\n * - `/(dashboard)/account/route` to `/account`\n * - `/user/[id]/route` to `/user/[id]`\n * - `/account/route` to `/account`\n * - `/route` to `/`\n * - `/` to `/`\n *\n * @param route the app route to normalize\n * @returns the normalized pathname\n */\nexport function normalizeAppPath(route: string) {\n return ensureLeadingSlash(\n route.split('/').reduce((pathname, segment, index, segments) => {\n // Empty segments are ignored.\n if (!segment) {\n return pathname\n }\n\n // Groups are ignored.\n if (isGroupSegment(segment)) {\n return pathname\n }\n\n // Parallel segments are ignored.\n if (segment[0] === '@') {\n return pathname\n }\n\n // The last segment (if it's a leaf) should be ignored.\n if (\n (segment === 'page' || segment === 'route') &&\n index === segments.length - 1\n ) {\n return pathname\n }\n\n return `${pathname}/${segment}`\n }, '')\n )\n}\n\n/**\n * Strips the `.rsc` extension if it's in the pathname.\n * Since this function is used on full urls it checks `?` for searchParams handling.\n */\nexport function normalizeRscURL(url: string) {\n return url.replace(\n /\\.rsc($|\\?)/,\n // $1 ensures `?` is preserved\n '$1'\n )\n}\n","import type { default as Router } from '../router'\n\nexport function compareRouterStates(a: Router['state'], b: Router['state']) {\n const stateKeys = Object.keys(a)\n if (stateKeys.length !== Object.keys(b).length) return false\n\n for (let i = stateKeys.length; i--; ) {\n const key = stateKeys[i]\n if (key === 'query') {\n const queryKeys = Object.keys(a.query)\n if (queryKeys.length !== Object.keys(b.query).length) {\n return false\n }\n for (let j = queryKeys.length; j--; ) {\n const queryKey = queryKeys[j]\n if (\n !b.query.hasOwnProperty(queryKey) ||\n a.query[queryKey] !== b.query[queryKey]\n ) {\n return false\n }\n }\n } else if (\n !b.hasOwnProperty(key) ||\n a[key as keyof Router['state']] !== b[key as keyof Router['state']]\n ) {\n return false\n }\n }\n\n return true\n}\n","import type { NextPathnameInfo } from './get-next-pathname-info'\nimport { removeTrailingSlash } from './remove-trailing-slash'\nimport { addPathPrefix } from './add-path-prefix'\nimport { addPathSuffix } from './add-path-suffix'\nimport { addLocale } from './add-locale'\n\ninterface ExtendedInfo extends NextPathnameInfo {\n defaultLocale?: string\n ignorePrefix?: boolean\n}\n\nexport function formatNextPathnameInfo(info: ExtendedInfo) {\n let pathname = addLocale(\n info.pathname,\n info.locale,\n info.buildId ? undefined : info.defaultLocale,\n info.ignorePrefix\n )\n\n if (info.buildId || !info.trailingSlash) {\n pathname = removeTrailingSlash(pathname)\n }\n\n if (info.buildId) {\n pathname = addPathSuffix(\n addPathPrefix(pathname, `/_next/data/${info.buildId}`),\n info.pathname === '/' ? 'index.json' : '.json'\n )\n }\n\n pathname = addPathPrefix(pathname, info.basePath)\n return !info.buildId && info.trailingSlash\n ? !pathname.endsWith('/')\n ? addPathSuffix(pathname, '/')\n : pathname\n : removeTrailingSlash(pathname)\n}\n","// Format function modified from nodejs\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { UrlObject } from 'url'\nimport type { ParsedUrlQuery } from 'querystring'\nimport * as querystring from './querystring'\n\nconst slashedProtocols = /https?|ftp|gopher|file/\n\nexport function formatUrl(urlObj: UrlObject) {\n let { auth, hostname } = urlObj\n let protocol = urlObj.protocol || ''\n let pathname = urlObj.pathname || ''\n let hash = urlObj.hash || ''\n let query = urlObj.query || ''\n let host: string | false = false\n\n auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ':') + '@' : ''\n\n if (urlObj.host) {\n host = auth + urlObj.host\n } else if (hostname) {\n host = auth + (~hostname.indexOf(':') ? `[${hostname}]` : hostname)\n if (urlObj.port) {\n host += ':' + urlObj.port\n }\n }\n\n if (query && typeof query === 'object') {\n query = String(querystring.urlQueryToSearchParams(query as ParsedUrlQuery))\n }\n\n let search = urlObj.search || (query && `?${query}`) || ''\n\n if (protocol && !protocol.endsWith(':')) protocol += ':'\n\n if (\n urlObj.slashes ||\n ((!protocol || slashedProtocols.test(protocol)) && host !== false)\n ) {\n host = '//' + (host || '')\n if (pathname && pathname[0] !== '/') pathname = '/' + pathname\n } else if (!host) {\n host = ''\n }\n\n if (hash && hash[0] !== '#') hash = '#' + hash\n if (search && search[0] !== '?') search = '?' + search\n\n pathname = pathname.replace(/[?#]/g, encodeURIComponent)\n search = search.replace('#', '%23')\n\n return `${protocol}${host}${pathname}${search}${hash}`\n}\n\nexport const urlObjectKeys = [\n 'auth',\n 'hash',\n 'host',\n 'hostname',\n 'href',\n 'path',\n 'pathname',\n 'port',\n 'protocol',\n 'query',\n 'search',\n 'slashes',\n]\n\nexport function formatWithValidation(url: UrlObject): string {\n if (process.env.NODE_ENV === 'development') {\n if (url !== null && typeof url === 'object') {\n Object.keys(url).forEach((key) => {\n if (!urlObjectKeys.includes(key)) {\n console.warn(\n `Unknown key passed via urlObject into url.format: ${key}`\n )\n }\n })\n }\n }\n\n return formatUrl(url)\n}\n","// Translates a logical route into its pages asset path (relative from a common prefix)\n// \"asset path\" being its javascript file, data file, prerendered html,...\nexport default function getAssetPathFromRoute(\n route: string,\n ext: string = ''\n): string {\n const path =\n route === '/'\n ? '/index'\n : /^\\/index(\\/|$)/.test(route)\n ? `/index${route}`\n : route\n return path + ext\n}\n","import { normalizeLocalePath } from '../../i18n/normalize-locale-path'\nimport { removePathPrefix } from './remove-path-prefix'\nimport { pathHasPrefix } from './path-has-prefix'\nimport type { I18NProvider } from '../../../../server/lib/i18n-provider'\n\nexport interface NextPathnameInfo {\n /**\n * The base path in case the pathname included it.\n */\n basePath?: string\n /**\n * The buildId for when the parsed URL is a data URL. Parsing it can be\n * disabled with the `parseData` option.\n */\n buildId?: string\n /**\n * If there was a locale in the pathname, this will hold its value.\n */\n locale?: string\n /**\n * The processed pathname without a base path, locale, or data URL elements\n * when parsing it is enabled.\n */\n pathname: string\n /**\n * A boolean telling if the pathname had a trailingSlash. This can be only\n * true if trailingSlash is enabled.\n */\n trailingSlash?: boolean\n}\n\ninterface Options {\n /**\n * When passed to true, this function will also parse Nextjs data URLs.\n */\n parseData?: boolean\n /**\n * A partial of the Next.js configuration to parse the URL.\n */\n nextConfig?: {\n basePath?: string\n i18n?: { locales?: string[] } | null\n trailingSlash?: boolean\n }\n\n /**\n * If provided, this normalizer will be used to detect the locale instead of\n * the default locale detection.\n */\n i18nProvider?: I18NProvider\n}\n\nexport function getNextPathnameInfo(\n pathname: string,\n options: Options\n): NextPathnameInfo {\n const { basePath, i18n, trailingSlash } = options.nextConfig ?? {}\n const info: NextPathnameInfo = {\n pathname,\n trailingSlash: pathname !== '/' ? pathname.endsWith('/') : trailingSlash,\n }\n\n if (basePath && pathHasPrefix(info.pathname, basePath)) {\n info.pathname = removePathPrefix(info.pathname, basePath)\n info.basePath = basePath\n }\n let pathnameNoDataPrefix = info.pathname\n\n if (\n info.pathname.startsWith('/_next/data/') &&\n info.pathname.endsWith('.json')\n ) {\n const paths = info.pathname\n .replace(/^\\/_next\\/data\\//, '')\n .replace(/\\.json$/, '')\n .split('/')\n\n const buildId = paths[0]\n info.buildId = buildId\n pathnameNoDataPrefix =\n paths[1] !== 'index' ? `/${paths.slice(1).join('/')}` : '/'\n\n // update pathname with normalized if enabled although\n // we use normalized to populate locale info still\n if (options.parseData === true) {\n info.pathname = pathnameNoDataPrefix\n }\n }\n\n // If provided, use the locale route normalizer to detect the locale instead\n // of the function below.\n if (i18n) {\n let result = options.i18nProvider\n ? options.i18nProvider.analyze(info.pathname)\n : normalizeLocalePath(info.pathname, i18n.locales)\n\n info.locale = result.detectedLocale\n info.pathname = result.pathname ?? info.pathname\n\n if (!result.detectedLocale && info.buildId) {\n result = options.i18nProvider\n ? options.i18nProvider.analyze(pathnameNoDataPrefix)\n : normalizeLocalePath(pathnameNoDataPrefix, i18n.locales)\n\n if (result.detectedLocale) {\n info.locale = result.detectedLocale\n }\n }\n }\n return info\n}\n","/**\n * Run function with `scroll-behavior: auto` applied to `<html/>`.\n * This css change will be reverted after the function finishes.\n */\nexport function handleSmoothScroll(\n fn: () => void,\n options: { dontForceLayout?: boolean; onlyHashChange?: boolean } = {}\n) {\n // if only the hash is changed, we don't need to disable smooth scrolling\n // we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX\n if (options.onlyHashChange) {\n fn()\n return\n }\n const htmlElement = document.documentElement\n const existing = htmlElement.style.scrollBehavior\n htmlElement.style.scrollBehavior = 'auto'\n if (!options.dontForceLayout) {\n // In Chrome-based browsers we need to force reflow before calling `scrollTo`.\n // Otherwise it will not pickup the change in scrollBehavior\n // More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042\n htmlElement.getClientRects()\n }\n fn()\n htmlElement.style.scrollBehavior = existing\n}\n","export { getSortedRoutes, getSortedRouteObjects } from './sorted-routes'\nexport { isDynamicRoute } from './is-dynamic'\n","import type { ParsedUrlQuery } from 'querystring'\n\nimport { getRouteMatcher } from './route-matcher'\nimport { getRouteRegex } from './route-regex'\n\nexport function interpolateAs(\n route: string,\n asPathname: string,\n query: ParsedUrlQuery\n) {\n let interpolatedRoute = ''\n\n const dynamicRegex = getRouteRegex(route)\n const dynamicGroups = dynamicRegex.groups\n const dynamicMatches =\n // Try to match the dynamic route against the asPath\n (asPathname !== route ? getRouteMatcher(dynamicRegex)(asPathname) : '') ||\n // Fall back to reading the values from the href\n // TODO: should this take priority; also need to change in the router.\n query\n\n interpolatedRoute = route\n const params = Object.keys(dynamicGroups)\n\n if (\n !params.every((param) => {\n let value = dynamicMatches[param] || ''\n const { repeat, optional } = dynamicGroups[param]\n\n // support single-level catch-all\n // TODO: more robust handling for user-error (passing `/`)\n let replaced = `[${repeat ? '...' : ''}${param}]`\n if (optional) {\n replaced = `${!value ? '/' : ''}[${replaced}]`\n }\n if (repeat && !Array.isArray(value)) value = [value]\n\n return (\n (optional || param in dynamicMatches) &&\n // Interpolate group into data URL if present\n (interpolatedRoute =\n interpolatedRoute!.replace(\n replaced,\n repeat\n ? (value as string[])\n .map(\n // these values should be fully encoded instead of just\n // path delimiter escaped since they are being inserted\n // into the URL and we expect URL encoded segments\n // when parsing dynamic route params\n (segment) => encodeURIComponent(segment)\n )\n .join('/')\n : encodeURIComponent(value as string)\n ) || '/')\n )\n })\n ) {\n interpolatedRoute = '' // did not satisfy all requirements\n\n // n.b. We ignore this error because we handle warning for this case in\n // development in the `<Link>` component directly.\n }\n return {\n params,\n result: interpolatedRoute,\n }\n}\n","const BOT_UA_RE =\n /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i\n\nexport function isBot(userAgent: string): boolean {\n return BOT_UA_RE.test(userAgent)\n}\n","import {\n extractInterceptionRouteInformation,\n isInterceptionRouteAppPath,\n} from '../../../../server/lib/interception-routes'\n\n// Identify /[param]/ in route string\nconst TEST_ROUTE = /\\/\\[[^/]+?\\](?=\\/|$)/\n\nexport function isDynamicRoute(route: string): boolean {\n if (isInterceptionRouteAppPath(route)) {\n route = extractInterceptionRouteInformation(route).interceptedRoute\n }\n\n return TEST_ROUTE.test(route)\n}\n","import { isAbsoluteUrl, getLocationOrigin } from '../../utils'\nimport { hasBasePath } from '../../../../client/has-base-path'\n\n/**\n * Detects whether a given url is routable by the Next.js router (browser only).\n */\nexport function isLocalURL(url: string): boolean {\n // prevent a hydration mismatch on href for url with anchor refs\n if (!isAbsoluteUrl(url)) return true\n try {\n // absolute urls can be local if they are on the same origin\n const locationOrigin = getLocationOrigin()\n const resolved = new URL(url, locationOrigin)\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname)\n } catch (_) {\n return false\n }\n}\n","export function omit<T extends { [key: string]: unknown }, K extends keyof T>(\n object: T,\n keys: K[]\n): Omit<T, K> {\n const omitted: { [key: string]: unknown } = {}\n Object.keys(object).forEach((key) => {\n if (!keys.includes(key as K)) {\n omitted[key] = object[key]\n }\n })\n return omitted as Omit<T, K>\n}\n","/**\n * Given a path this function will find the pathname, query and hash and return\n * them. This is useful to parse full paths on the client side.\n * @param path A path to parse e.g. /foo/bar?id=1#hash\n */\nexport function parsePath(path: string) {\n const hashIndex = path.indexOf('#')\n const queryIndex = path.indexOf('?')\n const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex)\n\n if (hasQuery || hashIndex > -1) {\n return {\n pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),\n query: hasQuery\n ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined)\n : '',\n hash: hashIndex > -1 ? path.slice(hashIndex) : '',\n }\n }\n\n return { pathname: path, query: '', hash: '' }\n}\n","import type { ParsedUrlQuery } from 'querystring'\nimport { getLocationOrigin } from '../../utils'\nimport { searchParamsToUrlQuery } from './querystring'\n\nexport interface ParsedRelativeUrl {\n hash: string\n href: string\n pathname: string\n query: ParsedUrlQuery\n search: string\n}\n\n/**\n * Parses path-relative urls (e.g. `/hello/world?foo=bar`). If url isn't path-relative\n * (e.g. `./hello`) then at least base must be.\n * Absolute urls are rejected with one exception, in the browser, absolute urls that are on\n * the current origin will be parsed as relative\n */\nexport function parseRelativeUrl(\n url: string,\n base?: string,\n parseQuery?: true\n): ParsedRelativeUrl\nexport function parseRelativeUrl(\n url: string,\n base: string | undefined,\n parseQuery: false\n): Omit<ParsedRelativeUrl, 'query'>\nexport function parseRelativeUrl(\n url: string,\n base?: string,\n parseQuery = true\n): ParsedRelativeUrl | Omit<ParsedRelativeUrl, 'query'> {\n const globalBase = new URL(\n typeof window === 'undefined' ? 'http://n' : getLocationOrigin()\n )\n\n const resolvedBase = base\n ? new URL(base, globalBase)\n : url.startsWith('.')\n ? new URL(\n typeof window === 'undefined' ? 'http://n' : window.location.href\n )\n : globalBase\n\n const { pathname, searchParams, search, hash, href, origin } = new URL(\n url,\n resolvedBase\n )\n\n if (origin !== globalBase.origin) {\n throw new Error(`invariant: invalid relative URL, router received ${url}`)\n }\n\n return {\n pathname,\n query: parseQuery ? searchParamsToUrlQuery(searchParams) : undefined,\n search,\n hash,\n href: href.slice(origin.length),\n }\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Checks if a given path starts with a given prefix. It ensures it matches\n * exactly without containing extra chars. e.g. prefix /docs should replace\n * for /docs, /docs/, /docs/a but not /docsss\n * @param path The path to check.\n * @param prefix The prefix to check against.\n */\nexport function pathHasPrefix(path: string, prefix: string) {\n if (typeof path !== 'string') {\n return false\n }\n\n const { pathname } = parsePath(path)\n return pathname === prefix || pathname.startsWith(prefix + '/')\n}\n","import type { ParsedUrlQuery } from 'querystring'\n\nexport function searchParamsToUrlQuery(\n searchParams: URLSearchParams\n): ParsedUrlQuery {\n const query: ParsedUrlQuery = {}\n searchParams.forEach((value, key) => {\n if (typeof query[key] === 'undefined') {\n query[key] = value\n } else if (Array.isArray(query[key])) {\n ;(query[key] as string[]).push(value)\n } else {\n query[key] = [query[key] as string, value]\n }\n })\n return query\n}\n\nfunction stringifyUrlQueryParam(param: unknown): string {\n if (\n typeof param === 'string' ||\n (typeof param === 'number' && !isNaN(param)) ||\n typeof param === 'boolean'\n ) {\n return String(param)\n } else {\n return ''\n }\n}\n\nexport function urlQueryToSearchParams(\n urlQuery: ParsedUrlQuery\n): URLSearchParams {\n const result = new URLSearchParams()\n Object.entries(urlQuery).forEach(([key, value]) => {\n if (Array.isArray(value)) {\n value.forEach((item) => result.append(key, stringifyUrlQueryParam(item)))\n } else {\n result.set(key, stringifyUrlQueryParam(value))\n }\n })\n return result\n}\n\nexport function assign(\n target: URLSearchParams,\n ...searchParamsList: URLSearchParams[]\n): URLSearchParams {\n searchParamsList.forEach((searchParams) => {\n Array.from(searchParams.keys()).forEach((key) => target.delete(key))\n searchParams.forEach((value, key) => target.append(key, value))\n })\n return target\n}\n","import { pathHasPrefix } from './path-has-prefix'\n\n/**\n * Given a path and a prefix it will remove the prefix when it exists in the\n * given path. It ensures it matches exactly without containing extra chars\n * and if the prefix is not there it will be noop.\n *\n * @param path The path to remove the prefix from.\n * @param prefix The prefix to be removed.\n */\nexport function removePathPrefix(path: string, prefix: string): string {\n // If the path doesn't start with the prefix we can return it as is. This\n // protects us from situations where the prefix is a substring of the path\n // prefix such as:\n //\n // For prefix: /blog\n //\n // /blog -> true\n // /blog/ -> true\n // /blog/1 -> true\n // /blogging -> false\n // /blogging/ -> false\n // /blogging/1 -> false\n if (!pathHasPrefix(path, prefix)) {\n return path\n }\n\n // Remove the prefix from the path via slicing.\n const withoutPrefix = path.slice(prefix.length)\n\n // If the path without the prefix starts with a `/` we can return it as is.\n if (withoutPrefix.startsWith('/')) {\n return withoutPrefix\n }\n\n // If the path without the prefix doesn't start with a `/` we need to add it\n // back to the path to make sure it's a valid path.\n return `/${withoutPrefix}`\n}\n","/**\n * Removes the trailing slash for a given route or page path. Preserves the\n * root page. Examples:\n * - `/foo/bar/` -> `/foo/bar`\n * - `/foo/bar` -> `/foo/bar`\n * - `/` -> `/`\n */\nexport function removeTrailingSlash(route: string) {\n return route.replace(/\\/$/, '') || '/'\n}\n","import type { RouteRegex } from './route-regex'\nimport { DecodeError } from '../../utils'\nimport type { Params } from '../../../../server/request/params'\n\nexport interface RouteMatchFn {\n (pathname: string | null | undefined): false | Params\n}\n\nexport function getRouteMatcher({ re, groups }: RouteRegex): RouteMatchFn {\n return (pathname: string | null | undefined) => {\n const routeMatch = re.exec(pathname!)\n if (!routeMatch) {\n return false\n }\n\n const decode = (param: string) => {\n try {\n return decodeURIComponent(param)\n } catch (_) {\n throw new DecodeError('failed to decode param')\n }\n }\n const params: { [paramName: string]: string | string[] } = {}\n\n Object.keys(groups).forEach((slugName: string) => {\n const g = groups[slugName]\n const m = routeMatch[g.pos]\n if (m !== undefined) {\n params[slugName] = ~m.indexOf('/')\n ? m.split('/').map((entry) => decode(entry))\n : g.repeat\n ? [decode(m)]\n : decode(m)\n }\n })\n return params\n }\n}\n","import {\n NEXT_INTERCEPTION_MARKER_PREFIX,\n NEXT_QUERY_PARAM_PREFIX,\n} from '../../../../lib/constants'\nimport { INTERCEPTION_ROUTE_MARKERS } from '../../../../server/lib/interception-routes'\nimport { escapeStringRegexp } from '../../escape-regexp'\nimport { removeTrailingSlash } from './remove-trailing-slash'\n\nexport interface Group {\n pos: number\n repeat: boolean\n optional: boolean\n}\n\nexport interface RouteRegex {\n groups: { [groupName: string]: Group }\n re: RegExp\n}\n\n/**\n * Regular expression pattern used to match route parameters.\n * Matches both single parameters and parameter groups.\n * Examples:\n * - `[[...slug]]` matches parameter group with key 'slug', repeat: true, optional: true\n * - `[...slug]` matches parameter group with key 'slug', repeat: true, optional: false\n * - `[[foo]]` matches parameter with key 'foo', repeat: false, optional: true\n * - `[bar]` matches parameter with key 'bar', repeat: false, optional: false\n */\nconst PARAMETER_PATTERN = /\\[((?:\\[.*\\])|.+)\\]/\n\n/**\n * Parses a given parameter from a route to a data structure that can be used\n * to generate the parametrized route.\n * Examples:\n * - `[[...slug]]` -> `{ key: 'slug', repeat: true, optional: true }`\n * - `[...slug]` -> `{ key: 'slug', repeat: true, optional: false }`\n * - `[[foo]]` -> `{ key: 'foo', repeat: false, optional: true }`\n * - `[bar]` -> `{ key: 'bar', repeat: false, optional: false }`\n * - `fizz` -> `{ key: 'fizz', repeat: false, optional: false }`\n * @param param - The parameter to parse.\n * @returns The parsed parameter as a data structure.\n */\nexport function parseParameter(param: string) {\n const match = param.match(PARAMETER_PATTERN)\n\n if (!match) {\n return parseMatchedParameter(param)\n }\n\n return parseMatchedParameter(match[1])\n}\n\n/**\n * Parses a matched parameter from the PARAMETER_PATTERN regex to a data structure that can be used\n * to generate the parametrized route.\n * Examples:\n * - `[...slug]` -> `{ key: 'slug', repeat: true, optional: true }`\n * - `...slug` -> `{ key: 'slug', repeat: true, optional: false }`\n * - `[foo]` -> `{ key: 'foo', repeat: false, optional: true }`\n * - `bar` -> `{ key: 'bar', repeat: false, optional: false }`\n * @param param - The matched parameter to parse.\n * @returns The parsed parameter as a data structure.\n */\nfunction parseMatchedParameter(param: string) {\n const optional = param.startsWith('[') && param.endsWith(']')\n if (optional) {\n param = param.slice(1, -1)\n }\n const repeat = param.startsWith('...')\n if (repeat) {\n param = param.slice(3)\n }\n return { key: param, repeat, optional }\n}\n\nfunction getParametrizedRoute(route: string) {\n const segments = removeTrailingSlash(route).slice(1).split('/')\n const groups: { [groupName: string]: Group } = {}\n let groupIndex = 1\n return {\n parameterizedRoute: segments\n .map((segment) => {\n const markerMatch = INTERCEPTION_ROUTE_MARKERS.find((m) =>\n segment.startsWith(m)\n )\n const paramMatches = segment.match(PARAMETER_PATTERN) // Check for parameters\n\n if (markerMatch && paramMatches) {\n const { key, optional, repeat } = parseMatchedParameter(\n paramMatches[1]\n )\n groups[key] = { pos: groupIndex++, repeat, optional }\n return `/${escapeStringRegexp(markerMatch)}([^/]+?)`\n } else if (paramMatches) {\n const { key, repeat, optional } = parseMatchedParameter(\n paramMatches[1]\n )\n groups[key] = { pos: groupIndex++, repeat, optional }\n return repeat ? (optional ? '(?:/(.+?))?' : '/(.+?)') : '/([^/]+?)'\n } else {\n return `/${escapeStringRegexp(segment)}`\n }\n })\n .join(''),\n groups,\n }\n}\n\n/**\n * From a normalized route this function generates a regular expression and\n * a corresponding groups object intended to be used to store matching groups\n * from the regular expression.\n */\nexport function getRouteRegex(normalizedRoute: string): RouteRegex {\n const { parameterizedRoute, groups } = getParametrizedRoute(normalizedRoute)\n return {\n re: new RegExp(`^${parameterizedRoute}(?:/)?$`),\n groups: groups,\n }\n}\n\n/**\n * Builds a function to generate a minimal routeKey using only a-z and minimal\n * number of characters.\n */\nfunction buildGetSafeRouteKey() {\n let i = 0\n\n return () => {\n let routeKey = ''\n let j = ++i\n while (j > 0) {\n routeKey += String.fromCharCode(97 + ((j - 1) % 26))\n j = Math.floor((j - 1) / 26)\n }\n return routeKey\n }\n}\n\nfunction getSafeKeyFromSegment({\n interceptionMarker,\n getSafeRouteKey,\n segment,\n routeKeys,\n keyPrefix,\n}: {\n interceptionMarker?: string\n getSafeRouteKey: () => string\n segment: string\n routeKeys: Record<string, string>\n keyPrefix?: string\n}) {\n const { key, optional, repeat } = parseMatchedParameter(segment)\n\n // replace any non-word characters since they can break\n // the named regex\n let cleanedKey = key.replace(/\\W/g, '')\n\n if (keyPrefix) {\n cleanedKey = `${keyPrefix}${cleanedKey}`\n }\n let invalidKey = false\n\n // check if the key is still invalid and fallback to using a known\n // safe key\n if (cleanedKey.length === 0 || cleanedKey.length > 30) {\n invalidKey = true\n }\n if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) {\n invalidKey = true\n }\n\n if (invalidKey) {\n cleanedKey = getSafeRouteKey()\n }\n\n if (keyPrefix) {\n routeKeys[cleanedKey] = `${keyPrefix}${key}`\n } else {\n routeKeys[cleanedKey] = key\n }\n\n // if the segment has an interception marker, make sure that's part of the regex pattern\n // this is to ensure that the route with the interception marker doesn't incorrectly match\n // the non-intercepted route (ie /app/(.)[username] should not match /app/[username])\n const interceptionPrefix = interceptionMarker\n ? escapeStringRegexp(interceptionMarker)\n : ''\n\n return repeat\n ? optional\n ? `(?:/${interceptionPrefix}(?<${cleanedKey}>.+?))?`\n : `/${interceptionPrefix}(?<${cleanedKey}>.+?)`\n : `/${interceptionPrefix}(?<${cleanedKey}>[^/]+?)`\n}\n\nfunction getNamedParametrizedRoute(route: string, prefixRouteKeys: boolean) {\n const segments = removeTrailingSlash(route).slice(1).split('/')\n const getSafeRouteKey = buildGetSafeRouteKey()\n const routeKeys: { [named: string]: string } = {}\n return {\n namedParameterizedRoute: segments\n .map((segment) => {\n const hasInterceptionMarker = INTERCEPTION_ROUTE_MARKERS.some((m) =>\n segment.startsWith(m)\n )\n const paramMatches = segment.match(/\\[((?:\\[.*\\])|.+)\\]/) // Check for parameters\n\n if (hasInterceptionMarker && paramMatches) {\n const [usedMarker] = segment.split(paramMatches[0])\n\n return getSafeKeyFromSegment({\n getSafeRouteKey,\n interceptionMarker: usedMarker,\n segment: paramMatches[1],\n routeKeys,\n keyPrefix: prefixRouteKeys\n ? NEXT_INTERCEPTION_MARKER_PREFIX\n : undefined,\n })\n } else if (paramMatches) {\n return getSafeKeyFromSegment({\n getSafeRouteKey,\n segment: paramMatches[1],\n routeKeys,\n keyPrefix: prefixRouteKeys ? NEXT_QUERY_PARAM_PREFIX : undefined,\n })\n } else {\n return `/${escapeStringRegexp(segment)}`\n }\n })\n .join(''),\n routeKeys,\n }\n}\n\n/**\n * This function extends `getRouteRegex` generating also a named regexp where\n * each group is named along with a routeKeys object that indexes the assigned\n * named group with its corresponding key. When the routeKeys need to be\n * prefixed to uniquely identify internally the \"prefixRouteKey\" arg should\n * be \"true\" currently this is only the case when creating the routes-manifest\n * during the build\n */\nexport function getNamedRouteRegex(\n normalizedRoute: string,\n prefixRouteKey: boolean\n) {\n const result = getNamedParametrizedRoute(normalizedRoute, prefixRouteKey)\n return {\n ...getRouteRegex(normalizedRoute),\n namedRegex: `^${result.namedParameterizedRoute}(?:/)?$`,\n routeKeys: result.routeKeys,\n }\n}\n\n/**\n * Generates a named regexp.\n * This is intended to be using for build time only.\n */\nexport function getNamedMiddlewareRegex(\n normalizedRoute: string,\n options: {\n catchAll?: boolean\n }\n) {\n const { parameterizedRoute } = getParametrizedRoute(normalizedRoute)\n const { catchAll = true } = options\n if (parameterizedRoute === '/') {\n let catchAllRegex = catchAll ? '.*' : ''\n return {\n namedRegex: `^/${catchAllRegex}$`,\n }\n }\n\n const { namedParameterizedRoute } = getNamedParametrizedRoute(\n normalizedRoute,\n false\n )\n let catchAllGroupedRegex = catchAll ? '(?:(/.*)?)' : ''\n return {\n namedRegex: `^${namedParameterizedRoute}${catchAllGroupedRegex}$`,\n }\n}\n","class UrlNode {\n placeholder: boolean = true\n children: Map<string, UrlNode> = new Map()\n slugName: string | null = null\n restSlugName: string | null = null\n optionalRestSlugName: string | null = null\n\n insert(urlPath: string): void {\n this._insert(urlPath.split('/').filter(Boolean), [], false)\n }\n\n smoosh(): string[] {\n return this._smoosh()\n }\n\n private _smoosh(prefix: string = '/'): string[] {\n const childrenPaths = [...this.children.keys()].sort()\n if (this.slugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf('[]'), 1)\n }\n if (this.restSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf('[...]'), 1)\n }\n if (this.optionalRestSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf('[[...]]'), 1)\n }\n\n const routes = childrenPaths\n .map((c) => this.children.get(c)!._smoosh(`${prefix}${c}/`))\n .reduce((prev, curr) => [...prev, ...curr], [])\n\n if (this.slugName !== null) {\n routes.push(\n ...this.children.get('[]')!._smoosh(`${prefix}[${this.slugName}]/`)\n )\n }\n\n if (!this.placeholder) {\n const r = prefix === '/' ? '/' : prefix.slice(0, -1)\n if (this.optionalRestSlugName != null) {\n throw new Error(\n `You cannot define a route with the same specificity as a optional catch-all route (\"${r}\" and \"${r}[[...${this.optionalRestSlugName}]]\").`\n )\n }\n\n routes.unshift(r)\n }\n\n if (this.restSlugName !== null) {\n routes.push(\n ...this.children\n .get('[...]')!\n ._smoosh(`${prefix}[...${this.restSlugName}]/`)\n )\n }\n\n if (this.optionalRestSlugName !== null) {\n routes.push(\n ...this.children\n .get('[[...]]')!\n ._smoosh(`${prefix}[[...${this.optionalRestSlugName}]]/`)\n )\n }\n\n return routes\n }\n\n private _insert(\n urlPaths: string[],\n slugNames: string[],\n isCatchAll: boolean\n ): void {\n if (urlPaths.length === 0) {\n this.placeholder = false\n return\n }\n\n if (isCatchAll) {\n throw new Error(`Catch-all must be the last part of the URL.`)\n }\n\n // The next segment in the urlPaths list\n let nextSegment = urlPaths[0]\n\n // Check if the segment matches `[something]`\n if (nextSegment.startsWith('[') && nextSegment.endsWith(']')) {\n // Strip `[` and `]`, leaving only `something`\n let segmentName = nextSegment.slice(1, -1)\n\n let isOptional = false\n if (segmentName.startsWith('[') && segmentName.endsWith(']')) {\n // Strip optional `[` and `]`, leaving only `something`\n segmentName = segmentName.slice(1, -1)\n isOptional = true\n }\n\n if (segmentName.startsWith('…')) {\n throw new Error(\n `Detected a three-dot character ('…') at ('${segmentName}'). Did you mean ('...')?`\n )\n }\n\n if (segmentName.startsWith('...')) {\n // Strip `...`, leaving only `something`\n segmentName = segmentName.substring(3)\n isCatchAll = true\n }\n\n if (segmentName.startsWith('[') || segmentName.endsWith(']')) {\n throw new Error(\n `Segment names may not start or end with extra brackets ('${segmentName}').`\n )\n }\n\n if (segmentName.startsWith('.')) {\n throw new Error(\n `Segment names may not start with erroneous periods ('${segmentName}').`\n )\n }\n\n function handleSlug(previousSlug: string | null, nextSlug: string) {\n if (previousSlug !== null) {\n // If the specific segment already has a slug but the slug is not `something`\n // This prevents collisions like:\n // pages/[post]/index.js\n // pages/[id]/index.js\n // Because currently multiple dynamic params on the same segment level are not supported\n if (previousSlug !== nextSlug) {\n // TODO: This error seems to be confusing for users, needs an error link, the description can be based on above comment.\n throw new Error(\n `You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`\n )\n }\n }\n\n slugNames.forEach((slug) => {\n if (slug === nextSlug) {\n throw new Error(\n `You cannot have the same slug name \"${nextSlug}\" repeat within a single dynamic path`\n )\n }\n\n if (slug.replace(/\\W/g, '') === nextSegment.replace(/\\W/g, '')) {\n throw new Error(\n `You cannot have the slug names \"${slug}\" and \"${nextSlug}\" differ only by non-word symbols within a single dynamic path`\n )\n }\n })\n\n slugNames.push(nextSlug)\n }\n\n if (isCatchAll) {\n if (isOptional) {\n if (this.restSlugName != null) {\n throw new Error(\n `You cannot use both an required and optional catch-all route at the same level (\"[...${this.restSlugName}]\" and \"${urlPaths[0]}\" ).`\n )\n }\n\n handleSlug(this.optionalRestSlugName, segmentName)\n // slugName is kept as it can only be one particular slugName\n this.optionalRestSlugName = segmentName\n // nextSegment is overwritten to [[...]] so that it can later be sorted specifically\n nextSegment = '[[...]]'\n } else {\n if (this.optionalRestSlugName != null) {\n throw new Error(\n `You cannot use both an optional and required catch-all route at the same level (\"[[...${this.optionalRestSlugName}]]\" and \"${urlPaths[0]}\").`\n )\n }\n\n handleSlug(this.restSlugName, segmentName)\n // slugName is kept as it can only be one particular slugName\n this.restSlugName = segmentName\n // nextSegment is overwritten to [...] so that it can later be sorted specifically\n nextSegment = '[...]'\n }\n } else {\n if (isOptional) {\n throw new Error(\n `Optional route parameters are not yet supported (\"${urlPaths[0]}\").`\n )\n }\n handleSlug(this.slugName, segmentName)\n // slugName is kept as it can only be one particular slugName\n this.slugName = segmentName\n // nextSegment is overwritten to [] so that it can later be sorted specifically\n nextSegment = '[]'\n }\n }\n\n // If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode\n if (!this.children.has(nextSegment)) {\n this.children.set(nextSegment, new UrlNode())\n }\n\n this.children\n .get(nextSegment)!\n ._insert(urlPaths.slice(1), slugNames, isCatchAll)\n }\n}\n\nexport function getSortedRoutes(\n normalizedPages: ReadonlyArray<string>\n): string[] {\n // First the UrlNode is created, and every UrlNode can have only 1 dynamic segment\n // Eg you can't have pages/[post]/abc.js and pages/[hello]/something-else.js\n // Only 1 dynamic segment per nesting level\n\n // So in the case that is test/integration/dynamic-routing it'll be this:\n // pages/[post]/comments.js\n // pages/blog/[post]/comment/[id].js\n // Both are fine because `pages/[post]` and `pages/blog` are on the same level\n // So in this case `UrlNode` created here has `this.slugName === 'post'`\n // And since your PR passed through `slugName` as an array basically it'd including it in too many possibilities\n // Instead what has to be passed through is the upwards path's dynamic names\n const root = new UrlNode()\n\n // Here the `root` gets injected multiple paths, and insert will break them up into sublevels\n normalizedPages.forEach((pagePath) => root.insert(pagePath))\n // Smoosh will then sort those sublevels up to the point where you get the correct route definition priority\n return root.smoosh()\n}\n\nexport function getSortedRouteObjects<T>(\n objects: T[],\n getter: (obj: T) => string\n): T[] {\n // We're assuming here that all the pathnames are unique, that way we can\n // sort the list and use the index as the key.\n const indexes: Record<string, number> = {}\n const pathnames: string[] = []\n for (let i = 0; i < objects.length; i++) {\n const pathname = getter(objects[i])\n indexes[pathname] = i\n pathnames[i] = pathname\n }\n\n // Sort the pathnames.\n const sorted = getSortedRoutes(pathnames)\n\n // Map the sorted pathnames back to the original objects using the new sorted\n // index.\n return sorted.map((pathname) => objects[indexes[pathname]])\n}\n","import type { Segment } from '../../server/app-render/types'\n\nexport function isGroupSegment(segment: string) {\n // Use array[0] for performant purpose\n return segment[0] === '(' && segment.endsWith(')')\n}\n\nexport function isParallelRouteSegment(segment: string) {\n return segment.startsWith('@') && segment !== '@children'\n}\n\nexport function addSearchParamsIfPageSegment(\n segment: Segment,\n searchParams: Record<string, string | string[] | undefined>\n) {\n const isPageSegment = segment.includes(PAGE_SEGMENT_KEY)\n\n if (isPageSegment) {\n const stringifiedQuery = JSON.stringify(searchParams)\n return stringifiedQuery !== '{}'\n ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery\n : PAGE_SEGMENT_KEY\n }\n\n return segment\n}\n\nexport const PAGE_SEGMENT_KEY = '__PAGE__'\nexport const DEFAULT_SEGMENT_KEY = '__DEFAULT__'\n","'use client'\n\nimport React, { useContext } from 'react'\n\nexport type ServerInsertedHTMLHook = (callbacks: () => React.ReactNode) => void\n\n// Use `React.createContext` to avoid errors from the RSC checks because\n// it can't be imported directly in Server Components:\n//\n// import { createContext } from 'react'\n//\n// More info: https://github.com/vercel/next.js/pull/40686\nexport const ServerInsertedHTMLContext =\n React.createContext<ServerInsertedHTMLHook | null>(null as any)\n\nexport function useServerInsertedHTML(callback: () => React.ReactNode): void {\n const addInsertedServerHTMLCallback = useContext(ServerInsertedHTMLContext)\n // Should have no effects on client where there's no flush effects provider\n if (addInsertedServerHTMLCallback) {\n addInsertedServerHTMLCallback(callback)\n }\n}\n","import type { HtmlProps } from './html-context.shared-runtime'\nimport type { ComponentType, JSX } from 'react'\nimport type { DomainLocale } from '../../server/config'\nimport type { Env } from '@next/env'\nimport type { IncomingMessage, ServerResponse } from 'http'\nimport type { NextRouter } from './router/router'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { PreviewData } from '../../types'\nimport type { COMPILER_NAMES } from './constants'\nimport type fs from 'fs'\n\nexport type NextComponentType<\n Context extends BaseContext = NextPageContext,\n InitialProps = {},\n Props = {},\n> = ComponentType<Props> & {\n /**\n * Used for initial page load data population. Data returned from `getInitialProps` is serialized when server rendered.\n * Make sure to return plain `Object` without using `Date`, `Map`, `Set`.\n * @param context Context of `page`\n */\n getInitialProps?(context: Context): InitialProps | Promise<InitialProps>\n}\n\nexport type DocumentType = NextComponentType<\n DocumentContext,\n DocumentInitialProps,\n DocumentProps\n>\n\nexport type AppType<P = {}> = NextComponentType<\n AppContextType,\n P,\n AppPropsType<any, P>\n>\n\nexport type AppTreeType = ComponentType<\n AppInitialProps & { [name: string]: any }\n>\n\n/**\n * Web vitals provided to _app.reportWebVitals by Core Web Vitals plugin developed by Google Chrome team.\n * https://nextjs.org/blog/next-9-4#integrated-web-vitals-reporting\n */\nexport const WEB_VITALS = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'] as const\nexport type NextWebVitalsMetric = {\n id: string\n startTime: number\n value: number\n attribution?: { [key: string]: unknown }\n} & (\n | {\n label: 'web-vital'\n name: (typeof WEB_VITALS)[number]\n }\n | {\n label: 'custom'\n name:\n | 'Next.js-hydration'\n | 'Next.js-route-change-to-render'\n | 'Next.js-render'\n }\n)\n\nexport type Enhancer<C> = (Component: C) => C\n\nexport type ComponentsEnhancer =\n | {\n enhanceApp?: Enhancer<AppType>\n enhanceComponent?: Enhancer<NextComponentType>\n }\n | Enhancer<NextComponentType>\n\nexport type RenderPageResult = {\n html: string\n head?: Array<JSX.Element | null>\n}\n\nexport type RenderPage = (\n options?: ComponentsEnhancer\n) => DocumentInitialProps | Promise<DocumentInitialProps>\n\nexport type BaseContext = {\n res?: ServerResponse\n [k: string]: any\n}\n\nexport type NEXT_DATA = {\n props: Record<string, any>\n page: string\n query: ParsedUrlQuery\n buildId: string\n assetPrefix?: string\n runtimeConfig?: { [key: string]: any }\n nextExport?: boolean\n autoExport?: boolean\n isFallback?: boolean\n isExperimentalCompile?: boolean\n dynamicIds?: (string | number)[]\n err?: Error & {\n statusCode?: number\n source?: typeof COMPILER_NAMES.server | typeof COMPILER_NAMES.edgeServer\n }\n gsp?: boolean\n gssp?: boolean\n customServer?: boolean\n gip?: boolean\n appGip?: boolean\n locale?: string\n locales?: string[]\n defaultLocale?: string\n domainLocales?: DomainLocale[]\n scriptLoader?: any[]\n isPreview?: boolean\n notFoundSrcPage?: string\n}\n\n/**\n * `Next` context\n */\nexport interface NextPageContext {\n /**\n * Error object if encountered during rendering\n */\n err?: (Error & { statusCode?: number }) | null\n /**\n * `HTTP` request object.\n */\n req?: IncomingMessage\n /**\n * `HTTP` response object.\n */\n res?: ServerResponse\n /**\n * Path section of `URL`.\n */\n pathname: string\n /**\n * Query string section of `URL` parsed as an object.\n */\n query: ParsedUrlQuery\n /**\n * `String` of the actual path including query.\n */\n asPath?: string\n /**\n * The currently active locale\n */\n locale?: string\n /**\n * All configured locales\n */\n locales?: string[]\n /**\n * The configured default locale\n */\n defaultLocale?: string\n /**\n * `Component` the tree of the App to use if needing to render separately\n */\n AppTree: AppTreeType\n}\n\nexport type AppContextType<Router extends NextRouter = NextRouter> = {\n Component: NextComponentType<NextPageContext>\n AppTree: AppTreeType\n ctx: NextPageContext\n router: Router\n}\n\nexport type AppInitialProps<PageProps = any> = {\n pageProps: PageProps\n}\n\nexport type AppPropsType<\n Router extends NextRouter = NextRouter,\n PageProps = {},\n> = AppInitialProps<PageProps> & {\n Component: NextComponentType<NextPageContext, any, any>\n router: Router\n __N_SSG?: boolean\n __N_SSP?: boolean\n}\n\nexport type DocumentContext = NextPageContext & {\n renderPage: RenderPage\n defaultGetInitialProps(\n ctx: DocumentContext,\n options?: { nonce?: string }\n ): Promise<DocumentInitialProps>\n}\n\nexport type DocumentInitialProps = RenderPageResult & {\n styles?: React.ReactElement[] | Iterable<React.ReactNode> | JSX.Element\n}\n\nexport type DocumentProps = DocumentInitialProps & HtmlProps\n\n/**\n * Next `API` route request\n */\nexport interface NextApiRequest extends IncomingMessage {\n /**\n * Object of `query` values from url\n */\n query: Partial<{\n [key: string]: string | string[]\n }>\n /**\n * Object of `cookies` from header\n */\n cookies: Partial<{\n [key: string]: string\n }>\n\n body: any\n\n env: Env\n\n draftMode?: boolean\n\n preview?: boolean\n /**\n * Preview data set on the request, if any\n * */\n previewData?: PreviewData\n}\n\n/**\n * Send body of response\n */\ntype Send<T> = (body: T) => void\n\n/**\n * Next `API` route response\n */\nexport type NextApiResponse<Data = any> = ServerResponse & {\n /**\n * Send data `any` data in response\n */\n send: Send<Data>\n /**\n * Send data `json` data in response\n */\n json: Send<Data>\n status: (statusCode: number) => NextApiResponse<Data>\n redirect(url: string): NextApiResponse<Data>\n redirect(status: number, url: string): NextApiResponse<Data>\n\n /**\n * Set draft mode\n */\n setDraftMode: (options: { enable: boolean }) => NextApiResponse<Data>\n\n /**\n * Set preview data for Next.js' prerender mode\n */\n setPreviewData: (\n data: object | string,\n options?: {\n /**\n * Specifies the number (in seconds) for the preview session to last for.\n * The given number will be converted to an integer by rounding down.\n * By default, no maximum age is set and the preview session finishes\n * when the client shuts down (browser is closed).\n */\n maxAge?: number\n /**\n * Specifies the path for the preview session to work under. By default,\n * the path is considered the \"default path\", i.e., any pages under \"/\".\n */\n path?: string\n }\n ) => NextApiResponse<Data>\n\n /**\n * Clear preview data for Next.js' prerender mode\n */\n clearPreviewData: (options?: { path?: string }) => NextApiResponse<Data>\n\n /**\n * Revalidate a specific page and regenerate it using On-Demand Incremental\n * Static Regeneration.\n * The path should be an actual path, not a rewritten path. E.g. for\n * \"/blog/[slug]\" this should be \"/blog/post-1\".\n * @link https://nextjs.org/docs/app/building-your-application/data-fetching/incremental-static-regeneration#on-demand-revalidation-with-revalidatepath\n */\n revalidate: (\n urlPath: string,\n opts?: {\n unstable_onlyGenerated?: boolean\n }\n ) => Promise<void>\n}\n\n/**\n * Next `API` route handler\n */\nexport type NextApiHandler<T = any> = (\n req: NextApiRequest,\n res: NextApiResponse<T>\n) => unknown | Promise<unknown>\n\n/**\n * Utils\n */\nexport function execOnce<T extends (...args: any[]) => ReturnType<T>>(\n fn: T\n): T {\n let used = false\n let result: ReturnType<T>\n\n return ((...args: any[]) => {\n if (!used) {\n used = true\n result = fn(...args)\n }\n return result\n }) as T\n}\n\n// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1\n// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\nconst ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\\d+\\-.]*?:/\nexport const isAbsoluteUrl = (url: string) => ABSOLUTE_URL_REGEX.test(url)\n\nexport function getLocationOrigin() {\n const { protocol, hostname, port } = window.location\n return `${protocol}//${hostname}${port ? ':' + port : ''}`\n}\n\nexport function getURL() {\n const { href } = window.location\n const origin = getLocationOrigin()\n return href.substring(origin.length)\n}\n\nexport function getDisplayName<P>(Component: ComponentType<P>) {\n return typeof Component === 'string'\n ? Component\n : Component.displayName || Component.name || 'Unknown'\n}\n\nexport function isResSent(res: ServerResponse) {\n return res.finished || res.headersSent\n}\n\nexport function normalizeRepeatedSlashes(url: string) {\n const urlParts = url.split('?')\n const urlNoQuery = urlParts[0]\n\n return (\n urlNoQuery\n // first we replace any non-encoded backslashes with forward\n // then normalize repeated forward slashes\n .replace(/\\\\/g, '/')\n .replace(/\\/\\/+/g, '/') +\n (urlParts[1] ? `?${urlParts.slice(1).join('?')}` : '')\n )\n}\n\nexport async function loadGetInitialProps<\n C extends BaseContext,\n IP = {},\n P = {},\n>(App: NextComponentType<C, IP, P>, ctx: C): Promise<IP> {\n if (process.env.NODE_ENV !== 'production') {\n if (App.prototype?.getInitialProps) {\n const message = `\"${getDisplayName(\n App\n )}.getInitialProps()\" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.`\n throw new Error(message)\n }\n }\n // when called from _app `ctx` is nested in `ctx`\n const res = ctx.res || (ctx.ctx && ctx.ctx.res)\n\n if (!App.getInitialProps) {\n if (ctx.ctx && ctx.Component) {\n // @ts-ignore pageProps default\n return {\n pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx),\n }\n }\n return {} as IP\n }\n\n const props = await App.getInitialProps(ctx)\n\n if (res && isResSent(res)) {\n return props\n }\n\n if (!props) {\n const message = `\"${getDisplayName(\n App\n )}.getInitialProps()\" should resolve to an object. But found \"${props}\" instead.`\n throw new Error(message)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (Object.keys(props).length === 0 && !ctx.ctx) {\n console.warn(\n `${getDisplayName(\n App\n )} returned an empty object from \\`getInitialProps\\`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps`\n )\n }\n }\n\n return props\n}\n\nexport const SP = typeof performance !== 'undefined'\nexport const ST =\n SP &&\n (['mark', 'measure', 'getEntriesByName'] as const).every(\n (method) => typeof performance[method] === 'function'\n )\n\nexport class DecodeError extends Error {}\nexport class NormalizeError extends Error {}\nexport class PageNotFoundError extends Error {\n code: string\n\n constructor(page: string) {\n super()\n this.code = 'ENOENT'\n this.name = 'PageNotFoundError'\n this.message = `Cannot find module for page: ${page}`\n }\n}\n\nexport class MissingStaticPage extends Error {\n constructor(page: string, message: string) {\n super()\n this.message = `Failed to load static file for page: ${page} ${message}`\n }\n}\n\nexport class MiddlewareNotFoundError extends Error {\n code: string\n constructor() {\n super()\n this.code = 'ENOENT'\n this.message = `Cannot find the middleware module`\n }\n}\n\nexport interface CacheFs {\n existsSync: typeof fs.existsSync\n readFile: typeof fs.promises.readFile\n readFileSync: typeof fs.readFileSync\n writeFile(f: string, d: any): Promise<void>\n mkdir(dir: string): Promise<void | string>\n stat(f: string): Promise<{ mtime: Date }>\n}\n\nexport function stringifyError(error: Error) {\n return JSON.stringify({ message: error.message, stack: error.stack })\n}\n","let warnOnce = (_: string) => {}\nif (process.env.NODE_ENV !== 'production') {\n const warnings = new Set<string>()\n warnOnce = (msg: string) => {\n if (!warnings.has(msg)) {\n console.warn(msg)\n }\n warnings.add(msg)\n }\n}\n\nexport { warnOnce }\n","/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"next/dist/compiled/react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.0.0-rc-65e06cb7-20241218\";\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom-client.production.js');\n} else {\n module.exports = require('./cjs/react-dom-client.development.js');\n}\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","/**\n * @license React\n * react-server-dom-webpack-client.browser.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar ReactDOM = require(\"react-dom\"),\n decoderOptions = { stream: !0 };\nfunction resolveClientReference(bundlerConfig, metadata) {\n if (bundlerConfig) {\n var moduleExports = bundlerConfig[metadata[0]];\n if ((bundlerConfig = moduleExports && moduleExports[metadata[2]]))\n moduleExports = bundlerConfig.name;\n else {\n bundlerConfig = moduleExports && moduleExports[\"*\"];\n if (!bundlerConfig)\n throw Error(\n 'Could not find the module \"' +\n metadata[0] +\n '\" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.'\n );\n moduleExports = metadata[2];\n }\n return 4 === metadata.length\n ? [bundlerConfig.id, bundlerConfig.chunks, moduleExports, 1]\n : [bundlerConfig.id, bundlerConfig.chunks, moduleExports];\n }\n return metadata;\n}\nfunction resolveServerReference(bundlerConfig, id) {\n var name = \"\",\n resolvedModuleData = bundlerConfig[id];\n if (resolvedModuleData) name = resolvedModuleData.name;\n else {\n var idx = id.lastIndexOf(\"#\");\n -1 !== idx &&\n ((name = id.slice(idx + 1)),\n (resolvedModuleData = bundlerConfig[id.slice(0, idx)]));\n if (!resolvedModuleData)\n throw Error(\n 'Could not find the module \"' +\n id +\n '\" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'\n );\n }\n return resolvedModuleData.async\n ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]\n : [resolvedModuleData.id, resolvedModuleData.chunks, name];\n}\nvar chunkCache = new Map();\nfunction requireAsyncModule(id) {\n var promise = __webpack_require__(id);\n if (\"function\" !== typeof promise.then || \"fulfilled\" === promise.status)\n return null;\n promise.then(\n function (value) {\n promise.status = \"fulfilled\";\n promise.value = value;\n },\n function (reason) {\n promise.status = \"rejected\";\n promise.reason = reason;\n }\n );\n return promise;\n}\nfunction ignoreReject() {}\nfunction preloadModule(metadata) {\n for (var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) {\n var chunkId = chunks[i++],\n chunkFilename = chunks[i++],\n entry = chunkCache.get(chunkId);\n void 0 === entry\n ? (chunkMap.set(chunkId, chunkFilename),\n (chunkFilename = __webpack_chunk_load__(chunkId)),\n promises.push(chunkFilename),\n (entry = chunkCache.set.bind(chunkCache, chunkId, null)),\n chunkFilename.then(entry, ignoreReject),\n chunkCache.set(chunkId, chunkFilename))\n : null !== entry && promises.push(entry);\n }\n return 4 === metadata.length\n ? 0 === promises.length\n ? requireAsyncModule(metadata[0])\n : Promise.all(promises).then(function () {\n return requireAsyncModule(metadata[0]);\n })\n : 0 < promises.length\n ? Promise.all(promises)\n : null;\n}\nfunction requireModule(metadata) {\n var moduleExports = __webpack_require__(metadata[0]);\n if (4 === metadata.length && \"function\" === typeof moduleExports.then)\n if (\"fulfilled\" === moduleExports.status)\n moduleExports = moduleExports.value;\n else throw moduleExports.reason;\n return \"*\" === metadata[2]\n ? moduleExports\n : \"\" === metadata[2]\n ? moduleExports.__esModule\n ? moduleExports.default\n : moduleExports\n : moduleExports[metadata[2]];\n}\nvar chunkMap = new Map(),\n webpackGetChunkFilename = __webpack_require__.u;\n__webpack_require__.u = function (chunkId) {\n var flightChunk = chunkMap.get(chunkId);\n return void 0 !== flightChunk\n ? flightChunk\n : webpackGetChunkFilename(chunkId);\n};\nvar ReactDOMSharedInternals =\n ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ASYNC_ITERATOR = Symbol.asyncIterator,\n isArrayImpl = Array.isArray,\n getPrototypeOf = Object.getPrototypeOf,\n ObjectPrototype = Object.prototype,\n knownServerReferences = new WeakMap();\nfunction serializeNumber(number) {\n return Number.isFinite(number)\n ? 0 === number && -Infinity === 1 / number\n ? \"$-0\"\n : number\n : Infinity === number\n ? \"$Infinity\"\n : -Infinity === number\n ? \"$-Infinity\"\n : \"$NaN\";\n}\nfunction processReply(\n root,\n formFieldPrefix,\n temporaryReferences,\n resolve,\n reject\n) {\n function serializeTypedArray(tag, typedArray) {\n typedArray = new Blob([\n new Uint8Array(\n typedArray.buffer,\n typedArray.byteOffset,\n typedArray.byteLength\n )\n ]);\n var blobId = nextPartId++;\n null === formData && (formData = new FormData());\n formData.append(formFieldPrefix + blobId, typedArray);\n return \"$\" + tag + blobId.toString(16);\n }\n function serializeBinaryReader(reader) {\n function progress(entry) {\n entry.done\n ? ((entry = nextPartId++),\n data.append(formFieldPrefix + entry, new Blob(buffer)),\n data.append(\n formFieldPrefix + streamId,\n '\"$o' + entry.toString(16) + '\"'\n ),\n data.append(formFieldPrefix + streamId, \"C\"),\n pendingParts--,\n 0 === pendingParts && resolve(data))\n : (buffer.push(entry.value),\n reader.read(new Uint8Array(1024)).then(progress, reject));\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++,\n buffer = [];\n reader.read(new Uint8Array(1024)).then(progress, reject);\n return \"$r\" + streamId.toString(16);\n }\n function serializeReader(reader) {\n function progress(entry) {\n if (entry.done)\n data.append(formFieldPrefix + streamId, \"C\"),\n pendingParts--,\n 0 === pendingParts && resolve(data);\n else\n try {\n var partJSON = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, partJSON);\n reader.read().then(progress, reject);\n } catch (x) {\n reject(x);\n }\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++;\n reader.read().then(progress, reject);\n return \"$R\" + streamId.toString(16);\n }\n function serializeReadableStream(stream) {\n try {\n var binaryReader = stream.getReader({ mode: \"byob\" });\n } catch (x) {\n return serializeReader(stream.getReader());\n }\n return serializeBinaryReader(binaryReader);\n }\n function serializeAsyncIterable(iterable, iterator) {\n function progress(entry) {\n if (entry.done) {\n if (void 0 === entry.value)\n data.append(formFieldPrefix + streamId, \"C\");\n else\n try {\n var partJSON = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, \"C\" + partJSON);\n } catch (x) {\n reject(x);\n return;\n }\n pendingParts--;\n 0 === pendingParts && resolve(data);\n } else\n try {\n var partJSON$22 = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, partJSON$22);\n iterator.next().then(progress, reject);\n } catch (x$23) {\n reject(x$23);\n }\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++;\n iterable = iterable === iterator;\n iterator.next().then(progress, reject);\n return \"$\" + (iterable ? \"x\" : \"X\") + streamId.toString(16);\n }\n function resolveToJSON(key, value) {\n if (null === value) return null;\n if (\"object\" === typeof value) {\n switch (value.$$typeof) {\n case REACT_ELEMENT_TYPE:\n if (void 0 !== temporaryReferences && -1 === key.indexOf(\":\")) {\n var parentReference = writtenObjects.get(this);\n if (void 0 !== parentReference)\n return (\n temporaryReferences.set(parentReference + \":\" + key, value),\n \"$T\"\n );\n }\n throw Error(\n \"React Element cannot be passed to Server Functions from the Client without a temporary reference set. Pass a TemporaryReferenceSet to the options.\"\n );\n case REACT_LAZY_TYPE:\n parentReference = value._payload;\n var init = value._init;\n null === formData && (formData = new FormData());\n pendingParts++;\n try {\n var resolvedModel = init(parentReference),\n lazyId = nextPartId++,\n partJSON = serializeModel(resolvedModel, lazyId);\n formData.append(formFieldPrefix + lazyId, partJSON);\n return \"$\" + lazyId.toString(16);\n } catch (x) {\n if (\n \"object\" === typeof x &&\n null !== x &&\n \"function\" === typeof x.then\n ) {\n pendingParts++;\n var lazyId$24 = nextPartId++;\n parentReference = function () {\n try {\n var partJSON$25 = serializeModel(value, lazyId$24),\n data$26 = formData;\n data$26.append(formFieldPrefix + lazyId$24, partJSON$25);\n pendingParts--;\n 0 === pendingParts && resolve(data$26);\n } catch (reason) {\n reject(reason);\n }\n };\n x.then(parentReference, parentReference);\n return \"$\" + lazyId$24.toString(16);\n }\n reject(x);\n return null;\n } finally {\n pendingParts--;\n }\n }\n if (\"function\" === typeof value.then) {\n null === formData && (formData = new FormData());\n pendingParts++;\n var promiseId = nextPartId++;\n value.then(function (partValue) {\n try {\n var partJSON$28 = serializeModel(partValue, promiseId);\n partValue = formData;\n partValue.append(formFieldPrefix + promiseId, partJSON$28);\n pendingParts--;\n 0 === pendingParts && resolve(partValue);\n } catch (reason) {\n reject(reason);\n }\n }, reject);\n return \"$@\" + promiseId.toString(16);\n }\n parentReference = writtenObjects.get(value);\n if (void 0 !== parentReference)\n if (modelRoot === value) modelRoot = null;\n else return parentReference;\n else\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference &&\n ((key = parentReference + \":\" + key),\n writtenObjects.set(value, key),\n void 0 !== temporaryReferences &&\n temporaryReferences.set(key, value)));\n if (isArrayImpl(value)) return value;\n if (value instanceof FormData) {\n null === formData && (formData = new FormData());\n var data$32 = formData;\n key = nextPartId++;\n var prefix = formFieldPrefix + key + \"_\";\n value.forEach(function (originalValue, originalKey) {\n data$32.append(prefix + originalKey, originalValue);\n });\n return \"$K\" + key.toString(16);\n }\n if (value instanceof Map)\n return (\n (key = nextPartId++),\n (parentReference = serializeModel(Array.from(value), key)),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$Q\" + key.toString(16)\n );\n if (value instanceof Set)\n return (\n (key = nextPartId++),\n (parentReference = serializeModel(Array.from(value), key)),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$W\" + key.toString(16)\n );\n if (value instanceof ArrayBuffer)\n return (\n (key = new Blob([value])),\n (parentReference = nextPartId++),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + parentReference, key),\n \"$A\" + parentReference.toString(16)\n );\n if (value instanceof Int8Array) return serializeTypedArray(\"O\", value);\n if (value instanceof Uint8Array) return serializeTypedArray(\"o\", value);\n if (value instanceof Uint8ClampedArray)\n return serializeTypedArray(\"U\", value);\n if (value instanceof Int16Array) return serializeTypedArray(\"S\", value);\n if (value instanceof Uint16Array) return serializeTypedArray(\"s\", value);\n if (value instanceof Int32Array) return serializeTypedArray(\"L\", value);\n if (value instanceof Uint32Array) return serializeTypedArray(\"l\", value);\n if (value instanceof Float32Array) return serializeTypedArray(\"G\", value);\n if (value instanceof Float64Array) return serializeTypedArray(\"g\", value);\n if (value instanceof BigInt64Array)\n return serializeTypedArray(\"M\", value);\n if (value instanceof BigUint64Array)\n return serializeTypedArray(\"m\", value);\n if (value instanceof DataView) return serializeTypedArray(\"V\", value);\n if (\"function\" === typeof Blob && value instanceof Blob)\n return (\n null === formData && (formData = new FormData()),\n (key = nextPartId++),\n formData.append(formFieldPrefix + key, value),\n \"$B\" + key.toString(16)\n );\n if ((key = getIteratorFn(value)))\n return (\n (parentReference = key.call(value)),\n parentReference === value\n ? ((key = nextPartId++),\n (parentReference = serializeModel(\n Array.from(parentReference),\n key\n )),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$i\" + key.toString(16))\n : Array.from(parentReference)\n );\n if (\n \"function\" === typeof ReadableStream &&\n value instanceof ReadableStream\n )\n return serializeReadableStream(value);\n key = value[ASYNC_ITERATOR];\n if (\"function\" === typeof key)\n return serializeAsyncIterable(value, key.call(value));\n key = getPrototypeOf(value);\n if (\n key !== ObjectPrototype &&\n (null === key || null !== getPrototypeOf(key))\n ) {\n if (void 0 === temporaryReferences)\n throw Error(\n \"Only plain objects, and a few built-ins, can be passed to Server Functions. Classes or null prototypes are not supported.\"\n );\n return \"$T\";\n }\n return value;\n }\n if (\"string\" === typeof value) {\n if (\"Z\" === value[value.length - 1] && this[key] instanceof Date)\n return \"$D\" + value;\n key = \"$\" === value[0] ? \"$\" + value : value;\n return key;\n }\n if (\"boolean\" === typeof value) return value;\n if (\"number\" === typeof value) return serializeNumber(value);\n if (\"undefined\" === typeof value) return \"$undefined\";\n if (\"function\" === typeof value) {\n parentReference = knownServerReferences.get(value);\n if (void 0 !== parentReference)\n return (\n (key = JSON.stringify(parentReference, resolveToJSON)),\n null === formData && (formData = new FormData()),\n (parentReference = nextPartId++),\n formData.set(formFieldPrefix + parentReference, key),\n \"$F\" + parentReference.toString(16)\n );\n if (\n void 0 !== temporaryReferences &&\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference)\n )\n return (\n temporaryReferences.set(parentReference + \":\" + key, value), \"$T\"\n );\n throw Error(\n \"Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again.\"\n );\n }\n if (\"symbol\" === typeof value) {\n if (\n void 0 !== temporaryReferences &&\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference)\n )\n return (\n temporaryReferences.set(parentReference + \":\" + key, value), \"$T\"\n );\n throw Error(\n \"Symbols cannot be passed to a Server Function without a temporary reference set. Pass a TemporaryReferenceSet to the options.\"\n );\n }\n if (\"bigint\" === typeof value) return \"$n\" + value.toString(10);\n throw Error(\n \"Type \" +\n typeof value +\n \" is not supported as an argument to a Server Function.\"\n );\n }\n function serializeModel(model, id) {\n \"object\" === typeof model &&\n null !== model &&\n ((id = \"$\" + id.toString(16)),\n writtenObjects.set(model, id),\n void 0 !== temporaryReferences && temporaryReferences.set(id, model));\n modelRoot = model;\n return JSON.stringify(model, resolveToJSON);\n }\n var nextPartId = 1,\n pendingParts = 0,\n formData = null,\n writtenObjects = new WeakMap(),\n modelRoot = root,\n json = serializeModel(root, 0);\n null === formData\n ? resolve(json)\n : (formData.set(formFieldPrefix + \"0\", json),\n 0 === pendingParts && resolve(formData));\n return function () {\n 0 < pendingParts &&\n ((pendingParts = 0),\n null === formData ? resolve(json) : resolve(formData));\n };\n}\nfunction registerServerReference(proxy, reference) {\n knownServerReferences.set(proxy, reference);\n}\nfunction createBoundServerReference(metaData, callServer) {\n function action() {\n var args = Array.prototype.slice.call(arguments);\n return bound\n ? \"fulfilled\" === bound.status\n ? callServer(id, bound.value.concat(args))\n : Promise.resolve(bound).then(function (boundArgs) {\n return callServer(id, boundArgs.concat(args));\n })\n : callServer(id, args);\n }\n var id = metaData.id,\n bound = metaData.bound;\n registerServerReference(action, { id: id, bound: bound });\n return action;\n}\nfunction ReactPromise(status, value, reason, response) {\n this.status = status;\n this.value = value;\n this.reason = reason;\n this._response = response;\n}\nReactPromise.prototype = Object.create(Promise.prototype);\nReactPromise.prototype.then = function (resolve, reject) {\n switch (this.status) {\n case \"resolved_model\":\n initializeModelChunk(this);\n break;\n case \"resolved_module\":\n initializeModuleChunk(this);\n }\n switch (this.status) {\n case \"fulfilled\":\n resolve(this.value);\n break;\n case \"pending\":\n case \"blocked\":\n resolve &&\n (null === this.value && (this.value = []), this.value.push(resolve));\n reject &&\n (null === this.reason && (this.reason = []), this.reason.push(reject));\n break;\n default:\n reject && reject(this.reason);\n }\n};\nfunction readChunk(chunk) {\n switch (chunk.status) {\n case \"resolved_model\":\n initializeModelChunk(chunk);\n break;\n case \"resolved_module\":\n initializeModuleChunk(chunk);\n }\n switch (chunk.status) {\n case \"fulfilled\":\n return chunk.value;\n case \"pending\":\n case \"blocked\":\n throw chunk;\n default:\n throw chunk.reason;\n }\n}\nfunction createPendingChunk(response) {\n return new ReactPromise(\"pending\", null, null, response);\n}\nfunction wakeChunk(listeners, value) {\n for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);\n}\nfunction wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {\n switch (chunk.status) {\n case \"fulfilled\":\n wakeChunk(resolveListeners, chunk.value);\n break;\n case \"pending\":\n case \"blocked\":\n if (chunk.value)\n for (var i = 0; i < resolveListeners.length; i++)\n chunk.value.push(resolveListeners[i]);\n else chunk.value = resolveListeners;\n if (chunk.reason) {\n if (rejectListeners)\n for (\n resolveListeners = 0;\n resolveListeners < rejectListeners.length;\n resolveListeners++\n )\n chunk.reason.push(rejectListeners[resolveListeners]);\n } else chunk.reason = rejectListeners;\n break;\n case \"rejected\":\n rejectListeners && wakeChunk(rejectListeners, chunk.reason);\n }\n}\nfunction triggerErrorOnChunk(chunk, error) {\n if (\"pending\" !== chunk.status && \"blocked\" !== chunk.status)\n chunk.reason.error(error);\n else {\n var listeners = chunk.reason;\n chunk.status = \"rejected\";\n chunk.reason = error;\n null !== listeners && wakeChunk(listeners, error);\n }\n}\nfunction createResolvedIteratorResultChunk(response, value, done) {\n return new ReactPromise(\n \"resolved_model\",\n (done ? '{\"done\":true,\"value\":' : '{\"done\":false,\"value\":') + value + \"}\",\n null,\n response\n );\n}\nfunction resolveIteratorResultChunk(chunk, value, done) {\n resolveModelChunk(\n chunk,\n (done ? '{\"done\":true,\"value\":' : '{\"done\":false,\"value\":') + value + \"}\"\n );\n}\nfunction resolveModelChunk(chunk, value) {\n if (\"pending\" !== chunk.status) chunk.reason.enqueueModel(value);\n else {\n var resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"resolved_model\";\n chunk.value = value;\n null !== resolveListeners &&\n (initializeModelChunk(chunk),\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));\n }\n}\nfunction resolveModuleChunk(chunk, value) {\n if (\"pending\" === chunk.status || \"blocked\" === chunk.status) {\n var resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"resolved_module\";\n chunk.value = value;\n null !== resolveListeners &&\n (initializeModuleChunk(chunk),\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));\n }\n}\nvar initializingHandler = null;\nfunction initializeModelChunk(chunk) {\n var prevHandler = initializingHandler;\n initializingHandler = null;\n var resolvedModel = chunk.value;\n chunk.status = \"blocked\";\n chunk.value = null;\n chunk.reason = null;\n try {\n var value = JSON.parse(resolvedModel, chunk._response._fromJSON),\n resolveListeners = chunk.value;\n null !== resolveListeners &&\n ((chunk.value = null),\n (chunk.reason = null),\n wakeChunk(resolveListeners, value));\n if (null !== initializingHandler) {\n if (initializingHandler.errored) throw initializingHandler.value;\n if (0 < initializingHandler.deps) {\n initializingHandler.value = value;\n initializingHandler.chunk = chunk;\n return;\n }\n }\n chunk.status = \"fulfilled\";\n chunk.value = value;\n } catch (error) {\n (chunk.status = \"rejected\"), (chunk.reason = error);\n } finally {\n initializingHandler = prevHandler;\n }\n}\nfunction initializeModuleChunk(chunk) {\n try {\n var value = requireModule(chunk.value);\n chunk.status = \"fulfilled\";\n chunk.value = value;\n } catch (error) {\n (chunk.status = \"rejected\"), (chunk.reason = error);\n }\n}\nfunction reportGlobalError(response, error) {\n response._chunks.forEach(function (chunk) {\n \"pending\" === chunk.status && triggerErrorOnChunk(chunk, error);\n });\n}\nfunction createLazyChunkWrapper(chunk) {\n return { $$typeof: REACT_LAZY_TYPE, _payload: chunk, _init: readChunk };\n}\nfunction getChunk(response, id) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk || ((chunk = createPendingChunk(response)), chunks.set(id, chunk));\n return chunk;\n}\nfunction waitForReference(\n referencedChunk,\n parentObject,\n key,\n response,\n map,\n path\n) {\n function fulfill(value) {\n for (var i = 1; i < path.length; i++) {\n for (; value.$$typeof === REACT_LAZY_TYPE; )\n if (((value = value._payload), value === handler.chunk))\n value = handler.value;\n else if (\"fulfilled\" === value.status) value = value.value;\n else {\n path.splice(0, i - 1);\n value.then(fulfill, reject);\n return;\n }\n value = value[path[i]];\n }\n i = map(response, value, parentObject, key);\n parentObject[key] = i;\n \"\" === key && null === handler.value && (handler.value = i);\n if (\n parentObject[0] === REACT_ELEMENT_TYPE &&\n \"object\" === typeof handler.value &&\n null !== handler.value &&\n handler.value.$$typeof === REACT_ELEMENT_TYPE\n )\n switch (((value = handler.value), key)) {\n case \"3\":\n value.props = i;\n }\n handler.deps--;\n 0 === handler.deps &&\n ((i = handler.chunk),\n null !== i &&\n \"blocked\" === i.status &&\n ((value = i.value),\n (i.status = \"fulfilled\"),\n (i.value = handler.value),\n null !== value && wakeChunk(value, handler.value)));\n }\n function reject(error) {\n if (!handler.errored) {\n handler.errored = !0;\n handler.value = error;\n var chunk = handler.chunk;\n null !== chunk &&\n \"blocked\" === chunk.status &&\n triggerErrorOnChunk(chunk, error);\n }\n }\n if (initializingHandler) {\n var handler = initializingHandler;\n handler.deps++;\n } else\n handler = initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n deps: 1,\n errored: !1\n };\n referencedChunk.then(fulfill, reject);\n return null;\n}\nfunction loadServerReference(response, metaData, parentObject, key) {\n if (!response._serverReferenceConfig)\n return createBoundServerReference(metaData, response._callServer);\n var serverReference = resolveServerReference(\n response._serverReferenceConfig,\n metaData.id\n );\n if ((response = preloadModule(serverReference)))\n metaData.bound && (response = Promise.all([response, metaData.bound]));\n else if (metaData.bound) response = Promise.resolve(metaData.bound);\n else return requireModule(serverReference);\n if (initializingHandler) {\n var handler = initializingHandler;\n handler.deps++;\n } else\n handler = initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n deps: 1,\n errored: !1\n };\n response.then(\n function () {\n var resolvedValue = requireModule(serverReference);\n if (metaData.bound) {\n var boundArgs = metaData.bound.value.slice(0);\n boundArgs.unshift(null);\n resolvedValue = resolvedValue.bind.apply(resolvedValue, boundArgs);\n }\n parentObject[key] = resolvedValue;\n \"\" === key && null === handler.value && (handler.value = resolvedValue);\n if (\n parentObject[0] === REACT_ELEMENT_TYPE &&\n \"object\" === typeof handler.value &&\n null !== handler.value &&\n handler.value.$$typeof === REACT_ELEMENT_TYPE\n )\n switch (((boundArgs = handler.value), key)) {\n case \"3\":\n boundArgs.props = resolvedValue;\n }\n handler.deps--;\n 0 === handler.deps &&\n ((resolvedValue = handler.chunk),\n null !== resolvedValue &&\n \"blocked\" === resolvedValue.status &&\n ((boundArgs = resolvedValue.value),\n (resolvedValue.status = \"fulfilled\"),\n (resolvedValue.value = handler.value),\n null !== boundArgs && wakeChunk(boundArgs, handler.value)));\n },\n function (error) {\n if (!handler.errored) {\n handler.errored = !0;\n handler.value = error;\n var chunk = handler.chunk;\n null !== chunk &&\n \"blocked\" === chunk.status &&\n triggerErrorOnChunk(chunk, error);\n }\n }\n );\n return null;\n}\nfunction getOutlinedModel(response, reference, parentObject, key, map) {\n reference = reference.split(\":\");\n var id = parseInt(reference[0], 16);\n id = getChunk(response, id);\n switch (id.status) {\n case \"resolved_model\":\n initializeModelChunk(id);\n break;\n case \"resolved_module\":\n initializeModuleChunk(id);\n }\n switch (id.status) {\n case \"fulfilled\":\n var value = id.value;\n for (id = 1; id < reference.length; id++) {\n for (; value.$$typeof === REACT_LAZY_TYPE; )\n if (((value = value._payload), \"fulfilled\" === value.status))\n value = value.value;\n else\n return waitForReference(\n value,\n parentObject,\n key,\n response,\n map,\n reference.slice(id - 1)\n );\n value = value[reference[id]];\n }\n return map(response, value, parentObject, key);\n case \"pending\":\n case \"blocked\":\n return waitForReference(id, parentObject, key, response, map, reference);\n default:\n return (\n initializingHandler\n ? ((initializingHandler.errored = !0),\n (initializingHandler.value = id.reason))\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: id.reason,\n deps: 0,\n errored: !0\n }),\n null\n );\n }\n}\nfunction createMap(response, model) {\n return new Map(model);\n}\nfunction createSet(response, model) {\n return new Set(model);\n}\nfunction createBlob(response, model) {\n return new Blob(model.slice(1), { type: model[0] });\n}\nfunction createFormData(response, model) {\n response = new FormData();\n for (var i = 0; i < model.length; i++)\n response.append(model[i][0], model[i][1]);\n return response;\n}\nfunction extractIterator(response, model) {\n return model[Symbol.iterator]();\n}\nfunction createModel(response, model) {\n return model;\n}\nfunction parseModelString(response, parentObject, key, value) {\n if (\"$\" === value[0]) {\n if (\"$\" === value)\n return (\n null !== initializingHandler &&\n \"0\" === key &&\n (initializingHandler = {\n parent: initializingHandler,\n chunk: null,\n value: null,\n deps: 0,\n errored: !1\n }),\n REACT_ELEMENT_TYPE\n );\n switch (value[1]) {\n case \"$\":\n return value.slice(1);\n case \"L\":\n return (\n (parentObject = parseInt(value.slice(2), 16)),\n (response = getChunk(response, parentObject)),\n createLazyChunkWrapper(response)\n );\n case \"@\":\n if (2 === value.length) return new Promise(function () {});\n parentObject = parseInt(value.slice(2), 16);\n return getChunk(response, parentObject);\n case \"S\":\n return Symbol.for(value.slice(2));\n case \"F\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(\n response,\n value,\n parentObject,\n key,\n loadServerReference\n )\n );\n case \"T\":\n parentObject = \"$\" + value.slice(2);\n response = response._tempRefs;\n if (null == response)\n throw Error(\n \"Missing a temporary reference set but the RSC response returned a temporary reference. Pass a temporaryReference option with the set that was used with the reply.\"\n );\n return response.get(parentObject);\n case \"Q\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createMap)\n );\n case \"W\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createSet)\n );\n case \"B\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createBlob)\n );\n case \"K\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createFormData)\n );\n case \"Z\":\n return resolveErrorProd();\n case \"i\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, extractIterator)\n );\n case \"I\":\n return Infinity;\n case \"-\":\n return \"$-0\" === value ? -0 : -Infinity;\n case \"N\":\n return NaN;\n case \"u\":\n return;\n case \"D\":\n return new Date(Date.parse(value.slice(2)));\n case \"n\":\n return BigInt(value.slice(2));\n default:\n return (\n (value = value.slice(1)),\n getOutlinedModel(response, value, parentObject, key, createModel)\n );\n }\n }\n return value;\n}\nfunction missingCall() {\n throw Error(\n 'Trying to call a function from \"use server\" but the callServer option was not implemented in your router runtime.'\n );\n}\nfunction ResponseInstance(\n bundlerConfig,\n serverReferenceConfig,\n moduleLoading,\n callServer,\n encodeFormAction,\n nonce,\n temporaryReferences\n) {\n var chunks = new Map();\n this._bundlerConfig = bundlerConfig;\n this._serverReferenceConfig = serverReferenceConfig;\n this._moduleLoading = moduleLoading;\n this._callServer = void 0 !== callServer ? callServer : missingCall;\n this._encodeFormAction = encodeFormAction;\n this._nonce = nonce;\n this._chunks = chunks;\n this._stringDecoder = new TextDecoder();\n this._fromJSON = null;\n this._rowLength = this._rowTag = this._rowID = this._rowState = 0;\n this._buffer = [];\n this._tempRefs = temporaryReferences;\n this._fromJSON = createFromJSONCallback(this);\n}\nfunction resolveBuffer(response, id, buffer) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk && \"pending\" !== chunk.status\n ? chunk.reason.enqueueValue(buffer)\n : chunks.set(id, new ReactPromise(\"fulfilled\", buffer, null, response));\n}\nfunction resolveModule(response, id, model) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n model = JSON.parse(model, response._fromJSON);\n var clientReference = resolveClientReference(response._bundlerConfig, model);\n if ((model = preloadModule(clientReference))) {\n if (chunk) {\n var blockedChunk = chunk;\n blockedChunk.status = \"blocked\";\n } else\n (blockedChunk = new ReactPromise(\"blocked\", null, null, response)),\n chunks.set(id, blockedChunk);\n model.then(\n function () {\n return resolveModuleChunk(blockedChunk, clientReference);\n },\n function (error) {\n return triggerErrorOnChunk(blockedChunk, error);\n }\n );\n } else\n chunk\n ? resolveModuleChunk(chunk, clientReference)\n : chunks.set(\n id,\n new ReactPromise(\"resolved_module\", clientReference, null, response)\n );\n}\nfunction resolveStream(response, id, stream, controller) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk\n ? \"pending\" === chunk.status &&\n ((response = chunk.value),\n (chunk.status = \"fulfilled\"),\n (chunk.value = stream),\n (chunk.reason = controller),\n null !== response && wakeChunk(response, chunk.value))\n : chunks.set(\n id,\n new ReactPromise(\"fulfilled\", stream, controller, response)\n );\n}\nfunction startReadableStream(response, id, type) {\n var controller = null;\n type = new ReadableStream({\n type: type,\n start: function (c) {\n controller = c;\n }\n });\n var previousBlockedChunk = null;\n resolveStream(response, id, type, {\n enqueueValue: function (value) {\n null === previousBlockedChunk\n ? controller.enqueue(value)\n : previousBlockedChunk.then(function () {\n controller.enqueue(value);\n });\n },\n enqueueModel: function (json) {\n if (null === previousBlockedChunk) {\n var chunk = new ReactPromise(\"resolved_model\", json, null, response);\n initializeModelChunk(chunk);\n \"fulfilled\" === chunk.status\n ? controller.enqueue(chunk.value)\n : (chunk.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n ),\n (previousBlockedChunk = chunk));\n } else {\n chunk = previousBlockedChunk;\n var chunk$52 = createPendingChunk(response);\n chunk$52.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n );\n previousBlockedChunk = chunk$52;\n chunk.then(function () {\n previousBlockedChunk === chunk$52 && (previousBlockedChunk = null);\n resolveModelChunk(chunk$52, json);\n });\n }\n },\n close: function () {\n if (null === previousBlockedChunk) controller.close();\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.close();\n });\n }\n },\n error: function (error) {\n if (null === previousBlockedChunk) controller.error(error);\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.error(error);\n });\n }\n }\n });\n}\nfunction asyncIterator() {\n return this;\n}\nfunction createIterator(next) {\n next = { next: next };\n next[ASYNC_ITERATOR] = asyncIterator;\n return next;\n}\nfunction startAsyncIterable(response, id, iterator) {\n var buffer = [],\n closed = !1,\n nextWriteIndex = 0,\n $jscomp$compprop0 = {};\n $jscomp$compprop0 =\n (($jscomp$compprop0[ASYNC_ITERATOR] = function () {\n var nextReadIndex = 0;\n return createIterator(function (arg) {\n if (void 0 !== arg)\n throw Error(\n \"Values cannot be passed to next() of AsyncIterables passed to Client Components.\"\n );\n if (nextReadIndex === buffer.length) {\n if (closed)\n return new ReactPromise(\n \"fulfilled\",\n { done: !0, value: void 0 },\n null,\n response\n );\n buffer[nextReadIndex] = createPendingChunk(response);\n }\n return buffer[nextReadIndex++];\n });\n }),\n $jscomp$compprop0);\n resolveStream(\n response,\n id,\n iterator ? $jscomp$compprop0[ASYNC_ITERATOR]() : $jscomp$compprop0,\n {\n enqueueValue: function (value) {\n if (nextWriteIndex === buffer.length)\n buffer[nextWriteIndex] = new ReactPromise(\n \"fulfilled\",\n { done: !1, value: value },\n null,\n response\n );\n else {\n var chunk = buffer[nextWriteIndex],\n resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"fulfilled\";\n chunk.value = { done: !1, value: value };\n null !== resolveListeners &&\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners);\n }\n nextWriteIndex++;\n },\n enqueueModel: function (value) {\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !1\n ))\n : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !1);\n nextWriteIndex++;\n },\n close: function (value) {\n closed = !0;\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !0\n ))\n : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !0);\n for (nextWriteIndex++; nextWriteIndex < buffer.length; )\n resolveIteratorResultChunk(\n buffer[nextWriteIndex++],\n '\"$undefined\"',\n !0\n );\n },\n error: function (error) {\n closed = !0;\n for (\n nextWriteIndex === buffer.length &&\n (buffer[nextWriteIndex] = createPendingChunk(response));\n nextWriteIndex < buffer.length;\n\n )\n triggerErrorOnChunk(buffer[nextWriteIndex++], error);\n }\n }\n );\n}\nfunction resolveErrorProd() {\n var error = Error(\n \"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.\"\n );\n error.stack = \"Error: \" + error.message;\n return error;\n}\nfunction mergeBuffer(buffer, lastChunk) {\n for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++)\n byteLength += buffer[i].byteLength;\n byteLength = new Uint8Array(byteLength);\n for (var i$53 = (i = 0); i$53 < l; i$53++) {\n var chunk = buffer[i$53];\n byteLength.set(chunk, i);\n i += chunk.byteLength;\n }\n byteLength.set(lastChunk, i);\n return byteLength;\n}\nfunction resolveTypedArray(\n response,\n id,\n buffer,\n lastChunk,\n constructor,\n bytesPerElement\n) {\n buffer =\n 0 === buffer.length && 0 === lastChunk.byteOffset % bytesPerElement\n ? lastChunk\n : mergeBuffer(buffer, lastChunk);\n constructor = new constructor(\n buffer.buffer,\n buffer.byteOffset,\n buffer.byteLength / bytesPerElement\n );\n resolveBuffer(response, id, constructor);\n}\nfunction processFullBinaryRow(response, id, tag, buffer, chunk) {\n switch (tag) {\n case 65:\n resolveBuffer(response, id, mergeBuffer(buffer, chunk).buffer);\n return;\n case 79:\n resolveTypedArray(response, id, buffer, chunk, Int8Array, 1);\n return;\n case 111:\n resolveBuffer(\n response,\n id,\n 0 === buffer.length ? chunk : mergeBuffer(buffer, chunk)\n );\n return;\n case 85:\n resolveTypedArray(response, id, buffer, chunk, Uint8ClampedArray, 1);\n return;\n case 83:\n resolveTypedArray(response, id, buffer, chunk, Int16Array, 2);\n return;\n case 115:\n resolveTypedArray(response, id, buffer, chunk, Uint16Array, 2);\n return;\n case 76:\n resolveTypedArray(response, id, buffer, chunk, Int32Array, 4);\n return;\n case 108:\n resolveTypedArray(response, id, buffer, chunk, Uint32Array, 4);\n return;\n case 71:\n resolveTypedArray(response, id, buffer, chunk, Float32Array, 4);\n return;\n case 103:\n resolveTypedArray(response, id, buffer, chunk, Float64Array, 8);\n return;\n case 77:\n resolveTypedArray(response, id, buffer, chunk, BigInt64Array, 8);\n return;\n case 109:\n resolveTypedArray(response, id, buffer, chunk, BigUint64Array, 8);\n return;\n case 86:\n resolveTypedArray(response, id, buffer, chunk, DataView, 1);\n return;\n }\n for (\n var stringDecoder = response._stringDecoder, row = \"\", i = 0;\n i < buffer.length;\n i++\n )\n row += stringDecoder.decode(buffer[i], decoderOptions);\n buffer = row += stringDecoder.decode(chunk);\n switch (tag) {\n case 73:\n resolveModule(response, id, buffer);\n break;\n case 72:\n id = buffer[0];\n buffer = buffer.slice(1);\n response = JSON.parse(buffer, response._fromJSON);\n buffer = ReactDOMSharedInternals.d;\n switch (id) {\n case \"D\":\n buffer.D(response);\n break;\n case \"C\":\n \"string\" === typeof response\n ? buffer.C(response)\n : buffer.C(response[0], response[1]);\n break;\n case \"L\":\n id = response[0];\n tag = response[1];\n 3 === response.length\n ? buffer.L(id, tag, response[2])\n : buffer.L(id, tag);\n break;\n case \"m\":\n \"string\" === typeof response\n ? buffer.m(response)\n : buffer.m(response[0], response[1]);\n break;\n case \"X\":\n \"string\" === typeof response\n ? buffer.X(response)\n : buffer.X(response[0], response[1]);\n break;\n case \"S\":\n \"string\" === typeof response\n ? buffer.S(response)\n : buffer.S(\n response[0],\n 0 === response[1] ? void 0 : response[1],\n 3 === response.length ? response[2] : void 0\n );\n break;\n case \"M\":\n \"string\" === typeof response\n ? buffer.M(response)\n : buffer.M(response[0], response[1]);\n }\n break;\n case 69:\n tag = JSON.parse(buffer);\n buffer = resolveErrorProd();\n buffer.digest = tag.digest;\n tag = response._chunks;\n (chunk = tag.get(id))\n ? triggerErrorOnChunk(chunk, buffer)\n : tag.set(id, new ReactPromise(\"rejected\", null, buffer, response));\n break;\n case 84:\n tag = response._chunks;\n (chunk = tag.get(id)) && \"pending\" !== chunk.status\n ? chunk.reason.enqueueValue(buffer)\n : tag.set(id, new ReactPromise(\"fulfilled\", buffer, null, response));\n break;\n case 68:\n case 87:\n throw Error(\n \"Failed to read a RSC payload created by a development version of React on the server while using a production version on the client. Always use matching versions on the server and the client.\"\n );\n case 82:\n startReadableStream(response, id, void 0);\n break;\n case 114:\n startReadableStream(response, id, \"bytes\");\n break;\n case 88:\n startAsyncIterable(response, id, !1);\n break;\n case 120:\n startAsyncIterable(response, id, !0);\n break;\n case 67:\n (response = response._chunks.get(id)) &&\n \"fulfilled\" === response.status &&\n response.reason.close(\"\" === buffer ? '\"$undefined\"' : buffer);\n break;\n default:\n (tag = response._chunks),\n (chunk = tag.get(id))\n ? resolveModelChunk(chunk, buffer)\n : tag.set(\n id,\n new ReactPromise(\"resolved_model\", buffer, null, response)\n );\n }\n}\nfunction createFromJSONCallback(response) {\n return function (key, value) {\n if (\"string\" === typeof value)\n return parseModelString(response, this, key, value);\n if (\"object\" === typeof value && null !== value) {\n if (value[0] === REACT_ELEMENT_TYPE) {\n if (\n ((key = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: value[1],\n key: value[2],\n ref: null,\n props: value[3]\n }),\n null !== initializingHandler)\n )\n if (\n ((value = initializingHandler),\n (initializingHandler = value.parent),\n value.errored)\n )\n (key = new ReactPromise(\"rejected\", null, value.value, response)),\n (key = createLazyChunkWrapper(key));\n else if (0 < value.deps) {\n var blockedChunk = new ReactPromise(\n \"blocked\",\n null,\n null,\n response\n );\n value.value = key;\n value.chunk = blockedChunk;\n key = createLazyChunkWrapper(blockedChunk);\n }\n } else key = value;\n return key;\n }\n return value;\n };\n}\nfunction createResponseFromOptions(options) {\n return new ResponseInstance(\n null,\n null,\n null,\n options && options.callServer ? options.callServer : void 0,\n void 0,\n void 0,\n options && options.temporaryReferences\n ? options.temporaryReferences\n : void 0\n );\n}\nfunction startReadingFromStream(response, stream) {\n function progress(_ref) {\n var value = _ref.value;\n if (_ref.done) reportGlobalError(response, Error(\"Connection closed.\"));\n else {\n var i = 0,\n rowState = response._rowState;\n _ref = response._rowID;\n for (\n var rowTag = response._rowTag,\n rowLength = response._rowLength,\n buffer = response._buffer,\n chunkLength = value.length;\n i < chunkLength;\n\n ) {\n var lastIdx = -1;\n switch (rowState) {\n case 0:\n lastIdx = value[i++];\n 58 === lastIdx\n ? (rowState = 1)\n : (_ref =\n (_ref << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 1:\n rowState = value[i];\n 84 === rowState ||\n 65 === rowState ||\n 79 === rowState ||\n 111 === rowState ||\n 85 === rowState ||\n 83 === rowState ||\n 115 === rowState ||\n 76 === rowState ||\n 108 === rowState ||\n 71 === rowState ||\n 103 === rowState ||\n 77 === rowState ||\n 109 === rowState ||\n 86 === rowState\n ? ((rowTag = rowState), (rowState = 2), i++)\n : (64 < rowState && 91 > rowState) ||\n 35 === rowState ||\n 114 === rowState ||\n 120 === rowState\n ? ((rowTag = rowState), (rowState = 3), i++)\n : ((rowTag = 0), (rowState = 3));\n continue;\n case 2:\n lastIdx = value[i++];\n 44 === lastIdx\n ? (rowState = 4)\n : (rowLength =\n (rowLength << 4) |\n (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 3:\n lastIdx = value.indexOf(10, i);\n break;\n case 4:\n (lastIdx = i + rowLength), lastIdx > value.length && (lastIdx = -1);\n }\n var offset = value.byteOffset + i;\n if (-1 < lastIdx)\n (rowLength = new Uint8Array(value.buffer, offset, lastIdx - i)),\n processFullBinaryRow(response, _ref, rowTag, buffer, rowLength),\n (i = lastIdx),\n 3 === rowState && i++,\n (rowLength = _ref = rowTag = rowState = 0),\n (buffer.length = 0);\n else {\n value = new Uint8Array(value.buffer, offset, value.byteLength - i);\n buffer.push(value);\n rowLength -= value.byteLength;\n break;\n }\n }\n response._rowState = rowState;\n response._rowID = _ref;\n response._rowTag = rowTag;\n response._rowLength = rowLength;\n return reader.read().then(progress).catch(error);\n }\n }\n function error(e) {\n reportGlobalError(response, e);\n }\n var reader = stream.getReader();\n reader.read().then(progress).catch(error);\n}\nexports.createFromFetch = function (promiseForResponse, options) {\n var response = createResponseFromOptions(options);\n promiseForResponse.then(\n function (r) {\n startReadingFromStream(response, r.body);\n },\n function (e) {\n reportGlobalError(response, e);\n }\n );\n return getChunk(response, 0);\n};\nexports.createFromReadableStream = function (stream, options) {\n options = createResponseFromOptions(options);\n startReadingFromStream(options, stream);\n return getChunk(options, 0);\n};\nexports.createServerReference = function (id, callServer) {\n function action() {\n var args = Array.prototype.slice.call(arguments);\n return callServer(id, args);\n }\n registerServerReference(action, { id: id, bound: null });\n return action;\n};\nexports.createTemporaryReferenceSet = function () {\n return new Map();\n};\nexports.encodeReply = function (value, options) {\n return new Promise(function (resolve, reject) {\n var abort = processReply(\n value,\n \"\",\n options && options.temporaryReferences\n ? options.temporaryReferences\n : void 0,\n resolve,\n reject\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(signal.reason);\n else {\n var listener = function () {\n abort(signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n });\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-server-dom-webpack-client.browser.production.js');\n} else {\n module.exports = require('./cjs/react-server-dom-webpack-client.browser.development.js');\n}\n","'use strict';\n\nmodule.exports = require('./client.browser');\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function () {},\n enqueueReplaceState: function () {},\n enqueueSetState: function () {}\n },\n assign = Object.assign,\n emptyObject = {};\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nComponent.prototype.isReactComponent = {};\nComponent.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n};\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n};\nfunction ComponentDummy() {}\nComponentDummy.prototype = Component.prototype;\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nvar pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());\npureComponentPrototype.constructor = PureComponent;\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = !0;\nvar isArrayImpl = Array.isArray,\n ReactSharedInternals = { H: null, A: null, T: null, S: null },\n hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction ReactElement(type, key, self, source, owner, props) {\n self = props.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== self ? self : null,\n props: props\n };\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n return ReactElement(\n oldElement.type,\n newKey,\n void 0,\n void 0,\n void 0,\n oldElement.props\n );\n}\nfunction isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\nfunction escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n}\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction getElementKey(element, index) {\n return \"object\" === typeof element && null !== element && null != element.key\n ? escape(\"\" + element.key)\n : index.toString(36);\n}\nfunction noop$1() {}\nfunction resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop$1, noop$1)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n}\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback)\n return (\n (callback = callback(children)),\n (invokeCallback =\n \"\" === nameSoFar ? \".\" + getElementKey(children, 0) : nameSoFar),\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != invokeCallback &&\n (escapedPrefix =\n invokeCallback.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (callback = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (children && children.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n invokeCallback\n )),\n array.push(callback)),\n 1\n );\n invokeCallback = 0;\n var nextNamePrefix = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = nextNamePrefix + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n children = i.call(children), i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = nextNamePrefix + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n}\nfunction mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\nfunction lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ctor = payload._result;\n ctor = ctor();\n ctor.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 1), (payload._result = moduleObject);\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 2), (payload._result = error);\n }\n );\n -1 === payload._status && ((payload._status = 0), (payload._result = ctor));\n }\n if (1 === payload._status) return payload._result.default;\n throw payload._result;\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n };\nfunction noop() {}\nexports.Children = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n};\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\nexports.__COMPILER_RUNTIME = {\n c: function (size) {\n return ReactSharedInternals.H.useMemoCache(size);\n }\n};\nexports.act = function () {\n throw Error(\"act(...) is not supported in production builds of React.\");\n};\nexports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n};\nexports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" + element + \".\"\n );\n var props = assign({}, element.props),\n key = element.key,\n owner = void 0;\n if (null != config)\n for (propName in (void 0 !== config.ref && (owner = void 0),\n void 0 !== config.key && (key = \"\" + config.key),\n config))\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n for (var childArray = Array(propName), i = 0; i < propName; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n return ReactElement(element.type, key, void 0, void 0, owner, props);\n};\nexports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n return defaultValue;\n};\nexports.createElement = function (type, config, children) {\n var propName,\n props = {},\n key = null;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (props[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) props.children = children;\n else if (1 < childrenLength) {\n for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === props[propName] &&\n (props[propName] = childrenLength[propName]);\n return ReactElement(type, key, void 0, void 0, null, props);\n};\nexports.createRef = function () {\n return { current: null };\n};\nexports.forwardRef = function (render) {\n return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };\n};\nexports.isValidElement = isValidElement;\nexports.lazy = function (ctor) {\n return {\n $$typeof: REACT_LAZY_TYPE,\n _payload: { _status: -1, _result: ctor },\n _init: lazyInitializer\n };\n};\nexports.memo = function (type, compare) {\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n};\nexports.startTransition = function (scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n returnValue.then(noop, reportGlobalError);\n } catch (error) {\n reportGlobalError(error);\n } finally {\n ReactSharedInternals.T = prevTransition;\n }\n};\nexports.unstable_useCacheRefresh = function () {\n return ReactSharedInternals.H.useCacheRefresh();\n};\nexports.use = function (usable) {\n return ReactSharedInternals.H.use(usable);\n};\nexports.useActionState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useActionState(action, initialState, permalink);\n};\nexports.useCallback = function (callback, deps) {\n return ReactSharedInternals.H.useCallback(callback, deps);\n};\nexports.useContext = function (Context) {\n return ReactSharedInternals.H.useContext(Context);\n};\nexports.useDebugValue = function () {};\nexports.useDeferredValue = function (value, initialValue) {\n return ReactSharedInternals.H.useDeferredValue(value, initialValue);\n};\nexports.useEffect = function (create, deps) {\n return ReactSharedInternals.H.useEffect(create, deps);\n};\nexports.useId = function () {\n return ReactSharedInternals.H.useId();\n};\nexports.useImperativeHandle = function (ref, create, deps) {\n return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);\n};\nexports.useInsertionEffect = function (create, deps) {\n return ReactSharedInternals.H.useInsertionEffect(create, deps);\n};\nexports.useLayoutEffect = function (create, deps) {\n return ReactSharedInternals.H.useLayoutEffect(create, deps);\n};\nexports.useMemo = function (create, deps) {\n return ReactSharedInternals.H.useMemo(create, deps);\n};\nexports.useOptimistic = function (passthrough, reducer) {\n return ReactSharedInternals.H.useOptimistic(passthrough, reducer);\n};\nexports.useReducer = function (reducer, initialArg, init) {\n return ReactSharedInternals.H.useReducer(reducer, initialArg, init);\n};\nexports.useRef = function (initialValue) {\n return ReactSharedInternals.H.useRef(initialValue);\n};\nexports.useState = function (initialState) {\n return ReactSharedInternals.H.useState(initialState);\n};\nexports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n) {\n return ReactSharedInternals.H.useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n};\nexports.useTransition = function () {\n return ReactSharedInternals.H.useTransition();\n};\nexports.version = \"19.0.0-rc-65e06cb7-20241218\";\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"actionAsyncStorageInstance\", {\n enumerable: true,\n get: function() {\n return actionAsyncStorageInstance;\n }\n});\nconst _asynclocalstorage = require(\"./async-local-storage\");\nconst actionAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();\n\n//# sourceMappingURL=action-async-storage-instance.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n bindSnapshot: null,\n createAsyncLocalStorage: null,\n createSnapshot: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n bindSnapshot: function() {\n return bindSnapshot;\n },\n createAsyncLocalStorage: function() {\n return createAsyncLocalStorage;\n },\n createSnapshot: function() {\n return createSnapshot;\n }\n});\nconst sharedAsyncLocalStorageNotAvailableError = new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available');\nclass FakeAsyncLocalStorage {\n disable() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n getStore() {\n // This fake implementation of AsyncLocalStorage always returns `undefined`.\n return undefined;\n }\n run() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n exit() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n enterWith() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n static bind(fn) {\n return fn;\n }\n}\nconst maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage;\nfunction createAsyncLocalStorage() {\n if (maybeGlobalAsyncLocalStorage) {\n return new maybeGlobalAsyncLocalStorage();\n }\n return new FakeAsyncLocalStorage();\n}\nfunction bindSnapshot(fn) {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.bind(fn);\n }\n return FakeAsyncLocalStorage.bind(fn);\n}\nfunction createSnapshot() {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.snapshot();\n }\n return function(fn, ...args) {\n return fn(...args);\n };\n}\n\n//# sourceMappingURL=async-local-storage.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"workAsyncStorageInstance\", {\n enumerable: true,\n get: function() {\n return workAsyncStorageInstance;\n }\n});\nconst _asynclocalstorage = require(\"./async-local-storage\");\nconst workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();\n\n//# sourceMappingURL=work-async-storage-instance.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"workUnitAsyncStorageInstance\", {\n enumerable: true,\n get: function() {\n return workUnitAsyncStorageInstance;\n }\n});\nconst _asynclocalstorage = require(\"./async-local-storage\");\nconst workUnitAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();\n\n//# sourceMappingURL=work-unit-async-storage-instance.js.map","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { isNativeFunction, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { WINDOW } from './types.js';\n\n/**\n * We generally want to use window.fetch / window.setTimeout.\n * However, in some cases this may be wrapped (e.g. by Zone.js for Angular),\n * so we try to get an unpatched version of this from a sandboxed iframe.\n */\n\nconst cachedImplementations = {};\n\n/**\n * Get the native implementation of a browser function.\n *\n * This can be used to ensure we get an unwrapped version of a function, in cases where a wrapped function can lead to problems.\n *\n * The following methods can be retrieved:\n * - `setTimeout`: This can be wrapped by e.g. Angular, causing change detection to be triggered.\n * - `fetch`: This can be wrapped by e.g. ad-blockers, causing an infinite loop when a request is blocked.\n */\nfunction getNativeImplementation(\n name,\n) {\n const cached = cachedImplementations[name];\n if (cached) {\n return cached;\n }\n\n let impl = WINDOW[name] ;\n\n // Fast path to avoid DOM I/O\n if (isNativeFunction(impl)) {\n return (cachedImplementations[name] = impl.bind(WINDOW) );\n }\n\n const document = WINDOW.document;\n // eslint-disable-next-line deprecation/deprecation\n if (document && typeof document.createElement === 'function') {\n try {\n const sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n const contentWindow = sandbox.contentWindow;\n if (contentWindow && contentWindow[name]) {\n impl = contentWindow[name] ;\n }\n document.head.removeChild(sandbox);\n } catch (e) {\n // Could not create sandbox iframe, just use window.xxx\n DEBUG_BUILD && logger.warn(`Could not create sandbox iframe for ${name} check, bailing to window.${name}: `, e);\n }\n }\n\n // Sanity check: This _should_ not happen, but if it does, we just skip caching...\n // This can happen e.g. in tests where fetch may not be available in the env, or similar.\n if (!impl) {\n return impl;\n }\n\n return (cachedImplementations[name] = impl.bind(WINDOW) );\n}\n\n/** Clear a cached implementation. */\nfunction clearCachedImplementation(name) {\n cachedImplementations[name] = undefined;\n}\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n * const p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\nfunction fetch(...rest) {\n return getNativeImplementation('fetch')(...rest);\n}\n\n/**\n * Get an unwrapped `setTimeout` method.\n * This ensures that even if e.g. Angular wraps `setTimeout`, we get the native implementation,\n * avoiding triggering change detection.\n */\nfunction setTimeout(...rest) {\n return getNativeImplementation('setTimeout')(...rest);\n}\n\nexport { clearCachedImplementation, fetch, getNativeImplementation, setTimeout };\n//# sourceMappingURL=getNativeImplementation.js.map\n","import { addHandler, maybeInstrument, triggerHandlers, fill, addNonEnumerableProperty, uuid4 } from '@sentry/utils';\nimport { WINDOW } from '../types.js';\n\nconst DEBOUNCE_DURATION = 1000;\n\nlet debounceTimerID;\nlet lastCapturedEventType;\nlet lastCapturedEventTargetId;\n\n/**\n * Add an instrumentation handler for when a click or a keypress happens.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addClickKeypressInstrumentationHandler(handler) {\n const type = 'dom';\n addHandler(type, handler);\n maybeInstrument(type, instrumentDOM);\n}\n\n/** Exported for tests only. */\nfunction instrumentDOM() {\n if (!WINDOW.document) {\n return;\n }\n\n // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n const triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n WINDOW.document.addEventListener('click', globalDOMEventHandler, false);\n WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);\n\n // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n // guaranteed to fire at least once.)\n ['EventTarget', 'Node'].forEach((target) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n const proto = (WINDOW )[target] && (WINDOW )[target].prototype;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (originalAddEventListener) {\n return function (\n\n type,\n listener,\n options,\n ) {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this ;\n const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});\n const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });\n\n if (!handlerForType.handler) {\n const handler = makeDOMEventHandler(triggerDOMHandler);\n handlerForType.handler = handler;\n originalAddEventListener.call(this, type, handler, options);\n }\n\n handlerForType.refCount++;\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalAddEventListener.call(this, type, listener, options);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (originalRemoveEventListener) {\n return function (\n\n type,\n listener,\n options,\n ) {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this ;\n const handlers = el.__sentry_instrumentation_handlers__ || {};\n const handlerForType = handlers[type];\n\n if (handlerForType) {\n handlerForType.refCount--;\n // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n if (handlerForType.refCount <= 0) {\n originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n handlerForType.handler = undefined;\n delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n }\n\n // If there are no longer any custom handlers of any type on this element, cleanup everything.\n if (Object.keys(handlers).length === 0) {\n delete el.__sentry_instrumentation_handlers__;\n }\n }\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalRemoveEventListener.call(this, type, listener, options);\n };\n },\n );\n });\n}\n\n/**\n * Check whether the event is similar to the last captured one. For example, two click events on the same button.\n */\nfunction isSimilarToLastCapturedEvent(event) {\n // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n if (event.type !== lastCapturedEventType) {\n return false;\n }\n\n try {\n // If both events have the same type, it's still possible that actions were performed on different targets.\n // e.g. 2 clicks on different buttons.\n if (!event.target || (event.target )._sentryId !== lastCapturedEventTargetId) {\n return false;\n }\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n // to which an event listener was attached), we treat them as the same action, as we want to capture\n // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n return true;\n}\n\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\nfunction shouldSkipDOMEvent(eventType, target) {\n // We are only interested in filtering `keypress` events for now.\n if (eventType !== 'keypress') {\n return false;\n }\n\n if (!target || !target.tagName) {\n return true;\n }\n\n // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n // e.g.tabbing through elements, hotkeys, etc.\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n */\nfunction makeDOMEventHandler(\n handler,\n globalListener = false,\n) {\n return (event) => {\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors).\n // Ignore if we've already captured that event.\n if (!event || event['_sentryCaptured']) {\n return;\n }\n\n const target = getEventTarget(event);\n\n // We always want to skip _some_ events.\n if (shouldSkipDOMEvent(event.type, target)) {\n return;\n }\n\n // Mark event as \"seen\"\n addNonEnumerableProperty(event, '_sentryCaptured', true);\n\n if (target && !target._sentryId) {\n // Add UUID to event target so we can identify if\n addNonEnumerableProperty(target, '_sentryId', uuid4());\n }\n\n const name = event.type === 'keypress' ? 'input' : event.type;\n\n // If there is no last captured event, it means that we can safely capture the new event and store it for future comparisons.\n // If there is a last captured event, see if the new event is different enough to treat it as a unique one.\n // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n if (!isSimilarToLastCapturedEvent(event)) {\n const handlerData = { event, name, global: globalListener };\n handler(handlerData);\n lastCapturedEventType = event.type;\n lastCapturedEventTargetId = target ? target._sentryId : undefined;\n }\n\n // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n clearTimeout(debounceTimerID);\n debounceTimerID = WINDOW.setTimeout(() => {\n lastCapturedEventTargetId = undefined;\n lastCapturedEventType = undefined;\n }, DEBOUNCE_DURATION);\n };\n}\n\nfunction getEventTarget(event) {\n try {\n return event.target ;\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n return null;\n }\n}\n\nexport { addClickKeypressInstrumentationHandler, instrumentDOM };\n//# sourceMappingURL=dom.js.map\n","import { GLOBAL_OBJ } from '../worldwide.js';\n\n// Based on https://github.com/angular/angular.js/pull/13945/files\n// The MIT License\n\n\nconst WINDOW = GLOBAL_OBJ ;\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsHistory() {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chromeVar = (WINDOW ).chrome;\n const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;\n\n return !isChromePackagedApp && hasHistoryApi;\n}\n\nexport { supportsHistory };\n//# sourceMappingURL=supportsHistory.js.map\n","import { addHandler, maybeInstrument, supportsHistory, triggerHandlers, fill } from '@sentry/utils';\nimport { WINDOW } from '../types.js';\n\nlet lastHref;\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addHistoryInstrumentationHandler(handler) {\n const type = 'history';\n addHandler(type, handler);\n maybeInstrument(type, instrumentHistory);\n}\n\nfunction instrumentHistory() {\n if (!supportsHistory()) {\n return;\n }\n\n const oldOnPopState = WINDOW.onpopstate;\n WINDOW.onpopstate = function ( ...args) {\n const to = WINDOW.location.href;\n // keep track of the current URL state, as we always receive only the updated state\n const from = lastHref;\n lastHref = to;\n const handlerData = { from, to };\n triggerHandlers('history', handlerData);\n if (oldOnPopState) {\n // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n // https://github.com/getsentry/sentry-javascript/issues/3344\n // https://github.com/bugsnag/bugsnag-js/issues/469\n try {\n return oldOnPopState.apply(this, args);\n } catch (_oO) {\n // no-empty\n }\n }\n };\n\n function historyReplacementFunction(originalHistoryFunction) {\n return function ( ...args) {\n const url = args.length > 2 ? args[2] : undefined;\n if (url) {\n // coerce to string (this is what pushState does)\n const from = lastHref;\n const to = String(url);\n // keep track of the current URL state, as we always receive only the updated state\n lastHref = to;\n const handlerData = { from, to };\n triggerHandlers('history', handlerData);\n }\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(WINDOW.history, 'pushState', historyReplacementFunction);\n fill(WINDOW.history, 'replaceState', historyReplacementFunction);\n}\n\nexport { addHistoryInstrumentationHandler };\n//# sourceMappingURL=history.js.map\n","import { addHandler, maybeInstrument, timestampInSeconds, isString, triggerHandlers } from '@sentry/utils';\nimport { WINDOW } from '../types.js';\n\nconst SENTRY_XHR_DATA_KEY = '__sentry_xhr_v3__';\n\n/**\n * Add an instrumentation handler for when an XHR request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addXhrInstrumentationHandler(handler) {\n const type = 'xhr';\n addHandler(type, handler);\n maybeInstrument(type, instrumentXHR);\n}\n\n/** Exported only for tests. */\nfunction instrumentXHR() {\n if (!(WINDOW ).XMLHttpRequest) {\n return;\n }\n\n const xhrproto = XMLHttpRequest.prototype;\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n xhrproto.open = new Proxy(xhrproto.open, {\n apply(originalOpen, xhrOpenThisArg, xhrOpenArgArray) {\n const startTimestamp = timestampInSeconds() * 1000;\n\n // open() should always be called with two or more arguments\n // But to be on the safe side, we actually validate this and bail out if we don't have a method & url\n const method = isString(xhrOpenArgArray[0]) ? xhrOpenArgArray[0].toUpperCase() : undefined;\n const url = parseUrl(xhrOpenArgArray[1]);\n\n if (!method || !url) {\n return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray);\n }\n\n xhrOpenThisArg[SENTRY_XHR_DATA_KEY] = {\n method,\n url,\n request_headers: {},\n };\n\n // if Sentry key appears in URL, don't capture it as a request\n if (method === 'POST' && url.match(/sentry_key/)) {\n xhrOpenThisArg.__sentry_own_request__ = true;\n }\n\n const onreadystatechangeHandler = () => {\n // For whatever reason, this is not the same instance here as from the outer method\n const xhrInfo = xhrOpenThisArg[SENTRY_XHR_DATA_KEY];\n\n if (!xhrInfo) {\n return;\n }\n\n if (xhrOpenThisArg.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n xhrInfo.status_code = xhrOpenThisArg.status;\n } catch (e) {\n /* do nothing */\n }\n\n const handlerData = {\n endTimestamp: timestampInSeconds() * 1000,\n startTimestamp,\n xhr: xhrOpenThisArg,\n };\n triggerHandlers('xhr', handlerData);\n }\n };\n\n if ('onreadystatechange' in xhrOpenThisArg && typeof xhrOpenThisArg.onreadystatechange === 'function') {\n xhrOpenThisArg.onreadystatechange = new Proxy(xhrOpenThisArg.onreadystatechange, {\n apply(originalOnreadystatechange, onreadystatechangeThisArg, onreadystatechangeArgArray) {\n onreadystatechangeHandler();\n return originalOnreadystatechange.apply(onreadystatechangeThisArg, onreadystatechangeArgArray);\n },\n });\n } else {\n xhrOpenThisArg.addEventListener('readystatechange', onreadystatechangeHandler);\n }\n\n // Intercepting `setRequestHeader` to access the request headers of XHR instance.\n // This will only work for user/library defined headers, not for the default/browser-assigned headers.\n // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.\n xhrOpenThisArg.setRequestHeader = new Proxy(xhrOpenThisArg.setRequestHeader, {\n apply(\n originalSetRequestHeader,\n setRequestHeaderThisArg,\n setRequestHeaderArgArray,\n ) {\n const [header, value] = setRequestHeaderArgArray;\n\n const xhrInfo = setRequestHeaderThisArg[SENTRY_XHR_DATA_KEY];\n\n if (xhrInfo && isString(header) && isString(value)) {\n xhrInfo.request_headers[header.toLowerCase()] = value;\n }\n\n return originalSetRequestHeader.apply(setRequestHeaderThisArg, setRequestHeaderArgArray);\n },\n });\n\n return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray);\n },\n });\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n xhrproto.send = new Proxy(xhrproto.send, {\n apply(originalSend, sendThisArg, sendArgArray) {\n const sentryXhrData = sendThisArg[SENTRY_XHR_DATA_KEY];\n\n if (!sentryXhrData) {\n return originalSend.apply(sendThisArg, sendArgArray);\n }\n\n if (sendArgArray[0] !== undefined) {\n sentryXhrData.body = sendArgArray[0];\n }\n\n const handlerData = {\n startTimestamp: timestampInSeconds() * 1000,\n xhr: sendThisArg,\n };\n triggerHandlers('xhr', handlerData);\n\n return originalSend.apply(sendThisArg, sendArgArray);\n },\n });\n}\n\nfunction parseUrl(url) {\n if (isString(url)) {\n return url;\n }\n\n try {\n // url can be a string or URL\n // but since URL is not available in IE11, we do not check for it,\n // but simply assume it is an URL and return `toString()` from it (which returns the full URL)\n // If that fails, we just return undefined\n return (url ).toString();\n } catch (e2) {} // eslint-disable-line no-empty\n\n return undefined;\n}\n\nexport { SENTRY_XHR_DATA_KEY, addXhrInstrumentationHandler, instrumentXHR };\n//# sourceMappingURL=xhr.js.map\n","const getRating = (value, thresholds) => {\n if (value > thresholds[1]) {\n return 'poor';\n }\n if (value > thresholds[0]) {\n return 'needs-improvement';\n }\n return 'good';\n};\n\nconst bindReporter = (\n callback,\n metric,\n thresholds,\n reportAllChanges,\n) => {\n let prevValue;\n let delta;\n return (forceReport) => {\n if (metric.value >= 0) {\n if (forceReport || reportAllChanges) {\n delta = metric.value - (prevValue || 0);\n\n // Report the metric if there's a non-zero delta or if no previous\n // value exists (which can happen in the case of the document becoming\n // hidden when the metric value is 0).\n // See: https://github.com/GoogleChrome/web-vitals/issues/14\n if (delta || prevValue === undefined) {\n prevValue = metric.value;\n metric.delta = delta;\n metric.rating = getRating(metric.value, thresholds);\n callback(metric);\n }\n }\n }\n };\n};\n\nexport { bindReporter };\n//# sourceMappingURL=bindReporter.js.map\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nconst generateUniqueID = () => {\n return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n\nexport { generateUniqueID };\n//# sourceMappingURL=generateUniqueID.js.map\n","import { WINDOW } from '../../../types.js';\nimport { generateUniqueID } from './generateUniqueID.js';\nimport { getActivationStart } from './getActivationStart.js';\nimport { getNavigationEntry } from './getNavigationEntry.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nconst initMetric = (name, value) => {\n const navEntry = getNavigationEntry();\n let navigationType = 'navigate';\n\n if (navEntry) {\n if ((WINDOW.document && WINDOW.document.prerendering) || getActivationStart() > 0) {\n navigationType = 'prerender';\n } else if (WINDOW.document && WINDOW.document.wasDiscarded) {\n navigationType = 'restore';\n } else if (navEntry.type) {\n navigationType = navEntry.type.replace(/_/g, '-') ;\n }\n }\n\n // Use `entries` type specific for the metric.\n const entries = [];\n\n return {\n name,\n value: typeof value === 'undefined' ? -1 : value,\n rating: 'good' , // If needed, will be updated when reported. `const` to keep the type from widening to `string`.\n delta: 0,\n entries,\n id: generateUniqueID(),\n navigationType,\n };\n};\n\nexport { initMetric };\n//# sourceMappingURL=initMetric.js.map\n","/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nconst observe = (\n type,\n callback,\n opts,\n) => {\n try {\n if (PerformanceObserver.supportedEntryTypes.includes(type)) {\n const po = new PerformanceObserver(list => {\n // Delay by a microtask to workaround a bug in Safari where the\n // callback is invoked immediately, rather than in a separate task.\n // See: https://github.com/GoogleChrome/web-vitals/issues/277\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Promise.resolve().then(() => {\n callback(list.getEntries() );\n });\n });\n po.observe(\n Object.assign(\n {\n type,\n buffered: true,\n },\n opts || {},\n ) ,\n );\n return po;\n }\n } catch (e) {\n // Do nothing.\n }\n return;\n};\n\nexport { observe };\n//# sourceMappingURL=observe.js.map\n","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst runOnce = (cb) => {\n let called = false;\n return (arg) => {\n if (!called) {\n cb(arg);\n called = true;\n }\n };\n};\n\nexport { runOnce };\n//# sourceMappingURL=runOnce.js.map\n","import { WINDOW } from '../../../types.js';\n\n/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nconst whenActivated = (callback) => {\n if (WINDOW.document && WINDOW.document.prerendering) {\n addEventListener('prerenderingchange', () => callback(), true);\n } else {\n callback();\n }\n};\n\nexport { whenActivated };\n//# sourceMappingURL=whenActivated.js.map\n","import { bindReporter } from './lib/bindReporter.js';\nimport { getActivationStart } from './lib/getActivationStart.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { whenActivated } from './lib/whenActivated.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/** Thresholds for FCP. See https://web.dev/articles/fcp#what_is_a_good_fcp_score */\nconst FCPThresholds = [1800, 3000];\n\n/**\n * Calculates the [FCP](https://web.dev/articles/fcp) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `paint` performance entry used to determine the value. The reported\n * value is a `DOMHighResTimeStamp`.\n */\nconst onFCP = (onReport, opts = {}) => {\n whenActivated(() => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('FCP');\n let report;\n\n const handleEntries = (entries) => {\n (entries ).forEach(entry => {\n if (entry.name === 'first-contentful-paint') {\n po.disconnect();\n\n // Only report if the page wasn't hidden prior to the first paint.\n if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n // The activationStart reference is used because FCP should be\n // relative to page activation rather than navigation start if the\n // page was prerendered. But in cases where `activationStart` occurs\n // after the FCP, this time should be clamped at 0.\n metric.value = Math.max(entry.startTime - getActivationStart(), 0);\n metric.entries.push(entry);\n report(true);\n }\n }\n });\n };\n\n const po = observe('paint', handleEntries);\n\n if (po) {\n report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges);\n }\n });\n};\n\nexport { FCPThresholds, onFCP };\n//# sourceMappingURL=onFCP.js.map\n","import { bindReporter } from './lib/bindReporter.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\nimport { runOnce } from './lib/runOnce.js';\nimport { onFCP } from './onFCP.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/** Thresholds for CLS. See https://web.dev/articles/cls#what_is_a_good_cls_score */\nconst CLSThresholds = [0.1, 0.25];\n\n/**\n * Calculates the [CLS](https://web.dev/articles/cls) value for the current page and\n * calls the `callback` function once the value is ready to be reported, along\n * with all `layout-shift` performance entries that were used in the metric\n * value calculation. The reported value is a `double` (corresponding to a\n * [layout shift score](https://web.dev/articles/cls#layout_shift_score)).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** CLS should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nconst onCLS = (onReport, opts = {}) => {\n // Start monitoring FCP so we can only report CLS if FCP is also reported.\n // Note: this is done to match the current behavior of CrUX.\n onFCP(\n runOnce(() => {\n const metric = initMetric('CLS', 0);\n let report;\n\n let sessionValue = 0;\n let sessionEntries = [];\n\n const handleEntries = (entries) => {\n entries.forEach(entry => {\n // Only count layout shifts without recent user input.\n if (!entry.hadRecentInput) {\n const firstSessionEntry = sessionEntries[0];\n const lastSessionEntry = sessionEntries[sessionEntries.length - 1];\n\n // If the entry occurred less than 1 second after the previous entry\n // and less than 5 seconds after the first entry in the session,\n // include the entry in the current session. Otherwise, start a new\n // session.\n if (\n sessionValue &&\n firstSessionEntry &&\n lastSessionEntry &&\n entry.startTime - lastSessionEntry.startTime < 1000 &&\n entry.startTime - firstSessionEntry.startTime < 5000\n ) {\n sessionValue += entry.value;\n sessionEntries.push(entry);\n } else {\n sessionValue = entry.value;\n sessionEntries = [entry];\n }\n }\n });\n\n // If the current session value is larger than the current CLS value,\n // update CLS and the entries contributing to it.\n if (sessionValue > metric.value) {\n metric.value = sessionValue;\n metric.entries = sessionEntries;\n report();\n }\n };\n\n const po = observe('layout-shift', handleEntries);\n if (po) {\n report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges);\n\n onHidden(() => {\n handleEntries(po.takeRecords() );\n report(true);\n });\n\n // Queue a task to report (if nothing else triggers a report first).\n // This allows CLS to be reported as soon as FCP fires when\n // `reportAllChanges` is true.\n setTimeout(report, 0);\n }\n }),\n );\n};\n\nexport { CLSThresholds, onCLS };\n//# sourceMappingURL=getCLS.js.map\n","import { bindReporter } from './lib/bindReporter.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\nimport { runOnce } from './lib/runOnce.js';\nimport { whenActivated } from './lib/whenActivated.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/** Thresholds for FID. See https://web.dev/articles/fid#what_is_a_good_fid_score */\nconst FIDThresholds = [100, 300];\n\n/**\n * Calculates the [FID](https://web.dev/articles/fid) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `first-input` performance entry used to determine the value. The\n * reported value is a `DOMHighResTimeStamp`.\n *\n * _**Important:** since FID is only reported after the user interacts with the\n * page, it's possible that it will not be reported for some page loads._\n */\nconst onFID = (onReport, opts = {}) => {\n whenActivated(() => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('FID');\n // eslint-disable-next-line prefer-const\n let report;\n\n const handleEntry = (entry) => {\n // Only report if the page wasn't hidden prior to the first input.\n if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n metric.value = entry.processingStart - entry.startTime;\n metric.entries.push(entry);\n report(true);\n }\n };\n\n const handleEntries = (entries) => {\n (entries ).forEach(handleEntry);\n };\n\n const po = observe('first-input', handleEntries);\n report = bindReporter(onReport, metric, FIDThresholds, opts.reportAllChanges);\n\n if (po) {\n onHidden(\n runOnce(() => {\n handleEntries(po.takeRecords() );\n po.disconnect();\n }),\n );\n }\n });\n};\n\nexport { FIDThresholds, onFID };\n//# sourceMappingURL=getFID.js.map\n","import { observe } from '../observe.js';\n\nlet interactionCountEstimate = 0;\nlet minKnownInteractionId = Infinity;\nlet maxKnownInteractionId = 0;\n\nconst updateEstimate = (entries) => {\n (entries ).forEach(e => {\n if (e.interactionId) {\n minKnownInteractionId = Math.min(minKnownInteractionId, e.interactionId);\n maxKnownInteractionId = Math.max(maxKnownInteractionId, e.interactionId);\n\n interactionCountEstimate = maxKnownInteractionId ? (maxKnownInteractionId - minKnownInteractionId) / 7 + 1 : 0;\n }\n });\n};\n\nlet po;\n\n/**\n * Returns the `interactionCount` value using the native API (if available)\n * or the polyfill estimate in this module.\n */\nconst getInteractionCount = () => {\n return po ? interactionCountEstimate : performance.interactionCount || 0;\n};\n\n/**\n * Feature detects native support or initializes the polyfill if needed.\n */\nconst initInteractionCountPolyfill = () => {\n if ('interactionCount' in performance || po) return;\n\n po = observe('event', updateEstimate, {\n type: 'event',\n buffered: true,\n durationThreshold: 0,\n } );\n};\n\nexport { getInteractionCount, initInteractionCountPolyfill };\n//# sourceMappingURL=interactionCountPolyfill.js.map\n","import { WINDOW } from '../../types.js';\nimport { bindReporter } from './lib/bindReporter.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\nimport { initInteractionCountPolyfill, getInteractionCount } from './lib/polyfills/interactionCountPolyfill.js';\nimport { whenActivated } from './lib/whenActivated.js';\n\n/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/** Thresholds for INP. See https://web.dev/articles/inp#what_is_a_good_inp_score */\nconst INPThresholds = [200, 500];\n\n// Used to store the interaction count after a bfcache restore, since p98\n// interaction latencies should only consider the current navigation.\nconst prevInteractionCount = 0;\n\n/**\n * Returns the interaction count since the last bfcache restore (or for the\n * full page lifecycle if there were no bfcache restores).\n */\nconst getInteractionCountForNavigation = () => {\n return getInteractionCount() - prevInteractionCount;\n};\n\n// To prevent unnecessary memory usage on pages with lots of interactions,\n// store at most 10 of the longest interactions to consider as INP candidates.\nconst MAX_INTERACTIONS_TO_CONSIDER = 10;\n\n// A list of longest interactions on the page (by latency) sorted so the\n// longest one is first. The list is as most MAX_INTERACTIONS_TO_CONSIDER long.\nconst longestInteractionList = [];\n\n// A mapping of longest interactions by their interaction ID.\n// This is used for faster lookup.\nconst longestInteractionMap = {};\n\n/**\n * Takes a performance entry and adds it to the list of worst interactions\n * if its duration is long enough to make it among the worst. If the\n * entry is part of an existing interaction, it is merged and the latency\n * and entries list is updated as needed.\n */\nconst processEntry = (entry) => {\n // The least-long of the 10 longest interactions.\n const minLongestInteraction = longestInteractionList[longestInteractionList.length - 1];\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const existingInteraction = longestInteractionMap[entry.interactionId];\n\n // Only process the entry if it's possibly one of the ten longest,\n // or if it's part of an existing interaction.\n if (\n existingInteraction ||\n longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER ||\n (minLongestInteraction && entry.duration > minLongestInteraction.latency)\n ) {\n // If the interaction already exists, update it. Otherwise create one.\n if (existingInteraction) {\n existingInteraction.entries.push(entry);\n existingInteraction.latency = Math.max(existingInteraction.latency, entry.duration);\n } else {\n const interaction = {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n id: entry.interactionId,\n latency: entry.duration,\n entries: [entry],\n };\n longestInteractionMap[interaction.id] = interaction;\n longestInteractionList.push(interaction);\n }\n\n // Sort the entries by latency (descending) and keep only the top ten.\n longestInteractionList.sort((a, b) => b.latency - a.latency);\n longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER).forEach(i => {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete longestInteractionMap[i.id];\n });\n }\n};\n\n/**\n * Returns the estimated p98 longest interaction based on the stored\n * interaction candidates and the interaction count for the current page.\n */\nconst estimateP98LongestInteraction = () => {\n const candidateInteractionIndex = Math.min(\n longestInteractionList.length - 1,\n Math.floor(getInteractionCountForNavigation() / 50),\n );\n\n return longestInteractionList[candidateInteractionIndex];\n};\n\n/**\n * Calculates the [INP](https://web.dev/articles/inp) value for the current\n * page and calls the `callback` function once the value is ready, along with\n * the `event` performance entries reported for that interaction. The reported\n * value is a `DOMHighResTimeStamp`.\n *\n * A custom `durationThreshold` configuration option can optionally be passed to\n * control what `event-timing` entries are considered for INP reporting. The\n * default threshold is `40`, which means INP scores of less than 40 are\n * reported as 0. Note that this will not affect your 75th percentile INP value\n * unless that value is also less than 40 (well below the recommended\n * [good](https://web.dev/articles/inp#what_is_a_good_inp_score) threshold).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** INP should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nconst onINP = (onReport, opts = {}) => {\n whenActivated(() => {\n // TODO(philipwalton): remove once the polyfill is no longer needed.\n initInteractionCountPolyfill();\n\n const metric = initMetric('INP');\n // eslint-disable-next-line prefer-const\n let report;\n\n const handleEntries = (entries) => {\n entries.forEach(entry => {\n if (entry.interactionId) {\n processEntry(entry);\n }\n\n // Entries of type `first-input` don't currently have an `interactionId`,\n // so to consider them in INP we have to first check that an existing\n // entry doesn't match the `duration` and `startTime`.\n // Note that this logic assumes that `event` entries are dispatched\n // before `first-input` entries. This is true in Chrome (the only browser\n // that currently supports INP).\n // TODO(philipwalton): remove once crbug.com/1325826 is fixed.\n if (entry.entryType === 'first-input') {\n const noMatchingEntry = !longestInteractionList.some(interaction => {\n return interaction.entries.some(prevEntry => {\n return entry.duration === prevEntry.duration && entry.startTime === prevEntry.startTime;\n });\n });\n if (noMatchingEntry) {\n processEntry(entry);\n }\n }\n });\n\n const inp = estimateP98LongestInteraction();\n\n if (inp && inp.latency !== metric.value) {\n metric.value = inp.latency;\n metric.entries = inp.entries;\n report();\n }\n };\n\n const po = observe('event', handleEntries, {\n // Event Timing entries have their durations rounded to the nearest 8ms,\n // so a duration of 40ms would be any event that spans 2.5 or more frames\n // at 60Hz. This threshold is chosen to strike a balance between usefulness\n // and performance. Running this callback for any interaction that spans\n // just one or two frames is likely not worth the insight that could be\n // gained.\n durationThreshold: opts.durationThreshold != null ? opts.durationThreshold : 40,\n } );\n\n report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges);\n\n if (po) {\n // If browser supports interactionId (and so supports INP), also\n // observe entries of type `first-input`. This is useful in cases\n // where the first interaction is less than the `durationThreshold`.\n if ('PerformanceEventTiming' in WINDOW && 'interactionId' in PerformanceEventTiming.prototype) {\n po.observe({ type: 'first-input', buffered: true });\n }\n\n onHidden(() => {\n handleEntries(po.takeRecords() );\n\n // If the interaction count shows that there were interactions but\n // none were captured by the PerformanceObserver, report a latency of 0.\n if (metric.value < 0 && getInteractionCountForNavigation() > 0) {\n metric.value = 0;\n metric.entries = [];\n }\n\n report(true);\n });\n }\n });\n};\n\nexport { INPThresholds, onINP };\n//# sourceMappingURL=getINP.js.map\n","import { WINDOW } from '../../types.js';\nimport { bindReporter } from './lib/bindReporter.js';\nimport { getActivationStart } from './lib/getActivationStart.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\nimport { runOnce } from './lib/runOnce.js';\nimport { whenActivated } from './lib/whenActivated.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/** Thresholds for LCP. See https://web.dev/articles/lcp#what_is_a_good_lcp_score */\nconst LCPThresholds = [2500, 4000];\n\nconst reportedMetricIDs = {};\n\n/**\n * Calculates the [LCP](https://web.dev/articles/lcp) value for the current page and\n * calls the `callback` function once the value is ready (along with the\n * relevant `largest-contentful-paint` performance entry used to determine the\n * value). The reported value is a `DOMHighResTimeStamp`.\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called any time a new `largest-contentful-paint`\n * performance entry is dispatched, or once the final value of the metric has\n * been determined.\n */\nconst onLCP = (onReport, opts = {}) => {\n whenActivated(() => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('LCP');\n let report;\n\n const handleEntries = (entries) => {\n const lastEntry = entries[entries.length - 1] ;\n if (lastEntry) {\n // Only report if the page wasn't hidden prior to LCP.\n if (lastEntry.startTime < visibilityWatcher.firstHiddenTime) {\n // The startTime attribute returns the value of the renderTime if it is\n // not 0, and the value of the loadTime otherwise. The activationStart\n // reference is used because LCP should be relative to page activation\n // rather than navigation start if the page was prerendered. But in cases\n // where `activationStart` occurs after the LCP, this time should be\n // clamped at 0.\n metric.value = Math.max(lastEntry.startTime - getActivationStart(), 0);\n metric.entries = [lastEntry];\n report();\n }\n }\n };\n\n const po = observe('largest-contentful-paint', handleEntries);\n\n if (po) {\n report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges);\n\n const stopListening = runOnce(() => {\n if (!reportedMetricIDs[metric.id]) {\n handleEntries(po.takeRecords() );\n po.disconnect();\n reportedMetricIDs[metric.id] = true;\n report(true);\n }\n });\n\n // Stop listening after input. Note: while scrolling is an input that\n // stops LCP observation, it's unreliable since it can be programmatically\n // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n ['keydown', 'click'].forEach(type => {\n if (WINDOW.document) {\n // Wrap in a setTimeout so the callback is run in a separate task\n // to avoid extending the keyboard/click handler to reduce INP impact\n // https://github.com/GoogleChrome/web-vitals/issues/383\n addEventListener(type, () => setTimeout(stopListening, 0), true);\n }\n });\n\n onHidden(stopListening);\n }\n });\n};\n\nexport { LCPThresholds, onLCP };\n//# sourceMappingURL=getLCP.js.map\n","import { WINDOW } from '../../types.js';\nimport { bindReporter } from './lib/bindReporter.js';\nimport { getActivationStart } from './lib/getActivationStart.js';\nimport { getNavigationEntry } from './lib/getNavigationEntry.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { whenActivated } from './lib/whenActivated.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/** Thresholds for TTFB. See https://web.dev/articles/ttfb#what_is_a_good_ttfb_score */\nconst TTFBThresholds = [800, 1800];\n\n/**\n * Runs in the next task after the page is done loading and/or prerendering.\n * @param callback\n */\nconst whenReady = (callback) => {\n if (WINDOW.document && WINDOW.document.prerendering) {\n whenActivated(() => whenReady(callback));\n } else if (WINDOW.document && WINDOW.document.readyState !== 'complete') {\n addEventListener('load', () => whenReady(callback), true);\n } else {\n // Queue a task so the callback runs after `loadEventEnd`.\n setTimeout(callback, 0);\n }\n};\n\n/**\n * Calculates the [TTFB](https://web.dev/articles/ttfb) value for the\n * current page and calls the `callback` function once the page has loaded,\n * along with the relevant `navigation` performance entry used to determine the\n * value. The reported value is a `DOMHighResTimeStamp`.\n *\n * Note, this function waits until after the page is loaded to call `callback`\n * in order to ensure all properties of the `navigation` entry are populated.\n * This is useful if you want to report on other metrics exposed by the\n * [Navigation Timing API](https://w3c.github.io/navigation-timing/). For\n * example, the TTFB metric starts from the page's [time\n * origin](https://www.w3.org/TR/hr-time-2/#sec-time-origin), which means it\n * includes time spent on DNS lookup, connection negotiation, network latency,\n * and server processing time.\n */\nconst onTTFB = (onReport, opts = {}) => {\n const metric = initMetric('TTFB');\n const report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges);\n\n whenReady(() => {\n const navEntry = getNavigationEntry();\n\n if (navEntry) {\n const responseStart = navEntry.responseStart;\n\n // In some cases no value is reported by the browser (for\n // privacy/security reasons), and in other cases (bugs) the value is\n // negative or is larger than the current page time. Ignore these cases:\n // https://github.com/GoogleChrome/web-vitals/issues/137\n // https://github.com/GoogleChrome/web-vitals/issues/162\n // https://github.com/GoogleChrome/web-vitals/issues/275\n if (responseStart <= 0 || responseStart > performance.now()) return;\n\n // The activationStart reference is used because TTFB should be\n // relative to page activation rather than navigation start if the\n // page was prerendered. But in cases where `activationStart` occurs\n // after the first byte is received, this time should be clamped at 0.\n metric.value = Math.max(responseStart - getActivationStart(), 0);\n\n metric.entries = [navEntry];\n report(true);\n }\n });\n};\n\nexport { TTFBThresholds, onTTFB };\n//# sourceMappingURL=onTTFB.js.map\n","import { logger, getFunctionName } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { onCLS } from './web-vitals/getCLS.js';\nimport { onFID } from './web-vitals/getFID.js';\nimport { onINP } from './web-vitals/getINP.js';\nimport { onLCP } from './web-vitals/getLCP.js';\nimport { observe } from './web-vitals/lib/observe.js';\nimport { onTTFB } from './web-vitals/onTTFB.js';\n\nconst handlers = {};\nconst instrumented = {};\n\nlet _previousCls;\nlet _previousFid;\nlet _previousLcp;\nlet _previousTtfb;\nlet _previousInp;\n\n/**\n * Add a callback that will be triggered when a CLS metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n *\n * Pass `stopOnCallback = true` to stop listening for CLS when the cleanup callback is called.\n * This will lead to the CLS being finalized and frozen.\n */\nfunction addClsInstrumentationHandler(\n callback,\n stopOnCallback = false,\n) {\n return addMetricObserver('cls', callback, instrumentCls, _previousCls, stopOnCallback);\n}\n\n/**\n * Add a callback that will be triggered when a LCP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n *\n * Pass `stopOnCallback = true` to stop listening for LCP when the cleanup callback is called.\n * This will lead to the LCP being finalized and frozen.\n */\nfunction addLcpInstrumentationHandler(\n callback,\n stopOnCallback = false,\n) {\n return addMetricObserver('lcp', callback, instrumentLcp, _previousLcp, stopOnCallback);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nfunction addFidInstrumentationHandler(callback) {\n return addMetricObserver('fid', callback, instrumentFid, _previousFid);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n */\nfunction addTtfbInstrumentationHandler(callback) {\n return addMetricObserver('ttfb', callback, instrumentTtfb, _previousTtfb);\n}\n\n/**\n * Add a callback that will be triggered when a INP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nfunction addInpInstrumentationHandler(\n callback,\n) {\n return addMetricObserver('inp', callback, instrumentInp, _previousInp);\n}\n\n/**\n * Add a callback that will be triggered when a performance observer is triggered,\n * and receives the entries of the observer.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nfunction addPerformanceInstrumentationHandler(\n type,\n callback,\n) {\n addHandler(type, callback);\n\n if (!instrumented[type]) {\n instrumentPerformanceObserver(type);\n instrumented[type] = true;\n }\n\n return getCleanupCallback(type, callback);\n}\n\n/** Trigger all handlers of a given type. */\nfunction triggerHandlers(type, data) {\n const typeHandlers = handlers[type];\n\n if (!typeHandlers || !typeHandlers.length) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n\nfunction instrumentCls() {\n return onCLS(\n metric => {\n triggerHandlers('cls', {\n metric,\n });\n _previousCls = metric;\n },\n // We want the callback to be called whenever the CLS value updates.\n // By default, the callback is only called when the tab goes to the background.\n { reportAllChanges: true },\n );\n}\n\nfunction instrumentFid() {\n return onFID(metric => {\n triggerHandlers('fid', {\n metric,\n });\n _previousFid = metric;\n });\n}\n\nfunction instrumentLcp() {\n return onLCP(\n metric => {\n triggerHandlers('lcp', {\n metric,\n });\n _previousLcp = metric;\n },\n // We want the callback to be called whenever the LCP value updates.\n // By default, the callback is only called when the tab goes to the background.\n { reportAllChanges: true },\n );\n}\n\nfunction instrumentTtfb() {\n return onTTFB(metric => {\n triggerHandlers('ttfb', {\n metric,\n });\n _previousTtfb = metric;\n });\n}\n\nfunction instrumentInp() {\n return onINP(metric => {\n triggerHandlers('inp', {\n metric,\n });\n _previousInp = metric;\n });\n}\n\nfunction addMetricObserver(\n type,\n callback,\n instrumentFn,\n previousValue,\n stopOnCallback = false,\n) {\n addHandler(type, callback);\n\n let stopListening;\n\n if (!instrumented[type]) {\n stopListening = instrumentFn();\n instrumented[type] = true;\n }\n\n if (previousValue) {\n callback({ metric: previousValue });\n }\n\n return getCleanupCallback(type, callback, stopOnCallback ? stopListening : undefined);\n}\n\nfunction instrumentPerformanceObserver(type) {\n const options = {};\n\n // Special per-type options we want to use\n if (type === 'event') {\n options.durationThreshold = 0;\n }\n\n observe(\n type,\n entries => {\n triggerHandlers(type, { entries });\n },\n options,\n );\n}\n\nfunction addHandler(type, handler) {\n handlers[type] = handlers[type] || [];\n (handlers[type] ).push(handler);\n}\n\n// Get a callback which can be called to remove the instrumentation handler\nfunction getCleanupCallback(\n type,\n callback,\n stopListening,\n) {\n return () => {\n if (stopListening) {\n stopListening();\n }\n\n const typeHandlers = handlers[type];\n\n if (!typeHandlers) {\n return;\n }\n\n const index = typeHandlers.indexOf(callback);\n if (index !== -1) {\n typeHandlers.splice(index, 1);\n }\n };\n}\n\n/**\n * Check if a PerformanceEntry is a PerformanceEventTiming by checking for the `duration` property.\n */\nfunction isPerformanceEventTiming(entry) {\n return 'duration' in entry;\n}\n\nexport { addClsInstrumentationHandler, addFidInstrumentationHandler, addInpInstrumentationHandler, addLcpInstrumentationHandler, addPerformanceInstrumentationHandler, addTtfbInstrumentationHandler, isPerformanceEventTiming };\n//# sourceMappingURL=instrument.js.map\n","import { getNavigationEntry } from './getNavigationEntry.js';\n\n/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nconst getActivationStart = () => {\n const navEntry = getNavigationEntry();\n return (navEntry && navEntry.activationStart) || 0;\n};\n\nexport { getActivationStart };\n//# sourceMappingURL=getActivationStart.js.map\n","import { WINDOW } from '../../../types.js';\n\n/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nconst getNavigationEntry = () => {\n return WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];\n};\n\nexport { getNavigationEntry };\n//# sourceMappingURL=getNavigationEntry.js.map\n","import { WINDOW } from '../../../types.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nlet firstHiddenTime = -1;\n\nconst initHiddenTime = () => {\n // If the document is hidden when this code runs, assume it was always\n // hidden and the page was loaded in the background, with the one exception\n // that visibility state is always 'hidden' during prerendering, so we have\n // to ignore that case until prerendering finishes (see: `prerenderingchange`\n // event logic below).\n firstHiddenTime = WINDOW.document.visibilityState === 'hidden' && !WINDOW.document.prerendering ? 0 : Infinity;\n};\n\nconst onVisibilityUpdate = (event) => {\n // If the document is 'hidden' and no previous hidden timestamp has been\n // set, update it based on the current event data.\n if (WINDOW.document.visibilityState === 'hidden' && firstHiddenTime > -1) {\n // If the event is a 'visibilitychange' event, it means the page was\n // visible prior to this change, so the event timestamp is the first\n // hidden time.\n // However, if the event is not a 'visibilitychange' event, then it must\n // be a 'prerenderingchange' event, and the fact that the document is\n // still 'hidden' from the above check means the tab was activated\n // in a background state and so has always been hidden.\n firstHiddenTime = event.type === 'visibilitychange' ? event.timeStamp : 0;\n\n // Remove all listeners now that a `firstHiddenTime` value has been set.\n removeEventListener('visibilitychange', onVisibilityUpdate, true);\n removeEventListener('prerenderingchange', onVisibilityUpdate, true);\n }\n};\n\nconst addChangeListeners = () => {\n addEventListener('visibilitychange', onVisibilityUpdate, true);\n // IMPORTANT: when a page is prerendering, its `visibilityState` is\n // 'hidden', so in order to account for cases where this module checks for\n // visibility during prerendering, an additional check after prerendering\n // completes is also required.\n addEventListener('prerenderingchange', onVisibilityUpdate, true);\n};\n\nconst getVisibilityWatcher = () => {\n if (WINDOW.document && firstHiddenTime < 0) {\n // If the document is hidden when this code runs, assume it was hidden\n // since navigation start. This isn't a perfect heuristic, but it's the\n // best we can do until an API is available to support querying past\n // visibilityState.\n initHiddenTime();\n addChangeListeners();\n }\n return {\n get firstHiddenTime() {\n return firstHiddenTime;\n },\n };\n};\n\nexport { getVisibilityWatcher };\n//# sourceMappingURL=getVisibilityWatcher.js.map\n","import { WINDOW } from '../../../types.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nconst onHidden = (cb) => {\n const onHiddenOrPageHide = (event) => {\n if (event.type === 'pagehide' || (WINDOW.document && WINDOW.document.visibilityState === 'hidden')) {\n cb(event);\n }\n };\n\n if (WINDOW.document) {\n addEventListener('visibilitychange', onHiddenOrPageHide, true);\n // Some browsers have buggy implementations of visibilitychange,\n // so we use pagehide in addition, just to be safe.\n addEventListener('pagehide', onHiddenOrPageHide, true);\n }\n};\n\nexport { onHidden };\n//# sourceMappingURL=onHidden.js.map\n","import { GLOBAL_OBJ } from '@sentry/utils';\n\nconst WINDOW = GLOBAL_OBJ\n\n;\n\nexport { WINDOW };\n//# sourceMappingURL=types.js.map\n","import { getGlobalSingleton } from '@sentry/utils';\nimport { Scope } from './scope.js';\n\n/** Get the default current scope. */\nfunction getDefaultCurrentScope() {\n return getGlobalSingleton('defaultCurrentScope', () => new Scope());\n}\n\n/** Get the default isolation scope. */\nfunction getDefaultIsolationScope() {\n return getGlobalSingleton('defaultIsolationScope', () => new Scope());\n}\n\nexport { getDefaultCurrentScope, getDefaultIsolationScope };\n//# sourceMappingURL=defaultScopes.js.map\n","import { isThenable } from '@sentry/utils';\nimport { getDefaultCurrentScope, getDefaultIsolationScope } from '../defaultScopes.js';\nimport { Scope } from '../scope.js';\nimport { getMainCarrier, getSentryCarrier } from '../carrier.js';\n\n/**\n * This is an object that holds a stack of scopes.\n */\nclass AsyncContextStack {\n\n constructor(scope, isolationScope) {\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n // scope stack for domains or the process\n this._stack = [{ scope: assignedScope }];\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * Fork a scope for the stack.\n */\n withScope(callback) {\n const scope = this._pushScope();\n\n let maybePromiseResult;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n this._popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n // @ts-expect-error - isThenable returns the wrong type\n return maybePromiseResult.then(\n res => {\n this._popScope();\n return res;\n },\n e => {\n this._popScope();\n throw e;\n },\n );\n }\n\n this._popScope();\n return maybePromiseResult;\n }\n\n /**\n * Get the client of the stack.\n */\n getClient() {\n return this.getStackTop().client ;\n }\n\n /**\n * Returns the scope of the top stack.\n */\n getScope() {\n return this.getStackTop().scope;\n }\n\n /**\n * Get the isolation scope for the stack.\n */\n getIsolationScope() {\n return this._isolationScope;\n }\n\n /**\n * Returns the topmost scope layer in the order domain > local > process.\n */\n getStackTop() {\n return this._stack[this._stack.length - 1] ;\n }\n\n /**\n * Push a scope to the stack.\n */\n _pushScope() {\n // We want to clone the content of prev scope\n const scope = this.getScope().clone();\n this._stack.push({\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * Pop a scope from the stack.\n */\n _popScope() {\n if (this._stack.length <= 1) return false;\n return !!this._stack.pop();\n }\n}\n\n/**\n * Get the global async context stack.\n * This will be removed during the v8 cycle and is only here to make migration easier.\n */\nfunction getAsyncContextStack() {\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n\n return (sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope()));\n}\n\nfunction withScope(callback) {\n return getAsyncContextStack().withScope(callback);\n}\n\nfunction withSetScope(scope, callback) {\n const stack = getAsyncContextStack() ;\n return stack.withScope(() => {\n stack.getStackTop().scope = scope;\n return callback(scope);\n });\n}\n\nfunction withIsolationScope(callback) {\n return getAsyncContextStack().withScope(() => {\n return callback(getAsyncContextStack().getIsolationScope());\n });\n}\n\n/**\n * Get the stack-based async context strategy.\n */\nfunction getStackAsyncContextStrategy() {\n return {\n withIsolationScope,\n withScope,\n withSetScope,\n withSetIsolationScope: (_isolationScope, callback) => {\n return withIsolationScope(callback);\n },\n getCurrentScope: () => getAsyncContextStack().getScope(),\n getIsolationScope: () => getAsyncContextStack().getIsolationScope(),\n };\n}\n\nexport { AsyncContextStack, getStackAsyncContextStrategy };\n//# sourceMappingURL=stackStrategy.js.map\n","import { getMainCarrier, getSentryCarrier } from '../carrier.js';\nimport { getStackAsyncContextStrategy } from './stackStrategy.js';\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nfunction setAsyncContextStrategy(strategy) {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n sentry.acs = strategy;\n}\n\n/**\n * Get the current async context strategy.\n * If none has been setup, the default will be used.\n */\nfunction getAsyncContextStrategy(carrier) {\n const sentry = getSentryCarrier(carrier);\n\n if (sentry.acs) {\n return sentry.acs;\n }\n\n // Otherwise, use the default one (stack)\n return getStackAsyncContextStrategy();\n}\n\nexport { getAsyncContextStrategy, setAsyncContextStrategy };\n//# sourceMappingURL=index.js.map\n","import { dateTimestampInSeconds, consoleSandbox } from '@sentry/utils';\nimport { getClient, getIsolationScope } from './currentScopes.js';\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n */\nfunction addBreadcrumb(breadcrumb, hint) {\n const client = getClient();\n const isolationScope = getIsolationScope();\n\n if (!client) return;\n\n const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client.getOptions();\n\n if (maxBreadcrumbs <= 0) return;\n\n const timestamp = dateTimestampInSeconds();\n const mergedBreadcrumb = { timestamp, ...breadcrumb };\n const finalBreadcrumb = beforeBreadcrumb\n ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) )\n : mergedBreadcrumb;\n\n if (finalBreadcrumb === null) return;\n\n if (client.emit) {\n client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);\n }\n\n isolationScope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n}\n\nexport { addBreadcrumb };\n//# sourceMappingURL=breadcrumbs.js.map\n","import { GLOBAL_OBJ, SDK_VERSION } from '@sentry/utils';\n\n/**\n * An object that contains globally accessible properties and maintains a scope stack.\n * @hidden\n */\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nfunction getMainCarrier() {\n // This ensures a Sentry carrier exists\n getSentryCarrier(GLOBAL_OBJ);\n return GLOBAL_OBJ;\n}\n\n/** Will either get the existing sentry carrier, or create a new one. */\nfunction getSentryCarrier(carrier) {\n const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n\n // For now: First SDK that sets the .version property wins\n __SENTRY__.version = __SENTRY__.version || SDK_VERSION;\n\n // Intentionally populating and returning the version of \"this\" SDK instance\n // rather than what's set in .version so that \"this\" SDK always gets its carrier\n return (__SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {});\n}\n\nexport { getMainCarrier, getSentryCarrier };\n//# sourceMappingURL=carrier.js.map\n","const DEFAULT_ENVIRONMENT = 'production';\n\nexport { DEFAULT_ENVIRONMENT };\n//# sourceMappingURL=constants.js.map\n","import { getGlobalSingleton } from '@sentry/utils';\nimport { getAsyncContextStrategy } from './asyncContext/index.js';\nimport { getMainCarrier } from './carrier.js';\nimport { Scope } from './scope.js';\n\n/**\n * Get the currently active scope.\n */\nfunction getCurrentScope() {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n return acs.getCurrentScope();\n}\n\n/**\n * Get the currently active isolation scope.\n * The isolation scope is active for the current exection context.\n */\nfunction getIsolationScope() {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n return acs.getIsolationScope();\n}\n\n/**\n * Get the global scope.\n * This scope is applied to _all_ events.\n */\nfunction getGlobalScope() {\n return getGlobalSingleton('globalScope', () => new Scope());\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n */\n\n/**\n * Either creates a new active scope, or sets the given scope as active scope in the given callback.\n */\nfunction withScope(\n ...rest\n) {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [scope, callback] = rest;\n\n if (!scope) {\n return acs.withScope(callback);\n }\n\n return acs.withSetScope(scope, callback);\n }\n\n return acs.withScope(rest[0]);\n}\n\n/**\n * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no\n * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the\n * case, for example, in the browser).\n *\n * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.\n *\n * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in \"normal\"\n * applications directly because it comes with pitfalls. Use at your own risk!\n */\n\n/**\n * Either creates a new active isolation scope, or sets the given isolation scope as active scope in the given callback.\n */\nfunction withIsolationScope(\n ...rest\n\n) {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [isolationScope, callback] = rest;\n\n if (!isolationScope) {\n return acs.withIsolationScope(callback);\n }\n\n return acs.withSetIsolationScope(isolationScope, callback);\n }\n\n return acs.withIsolationScope(rest[0]);\n}\n\n/**\n * Get the currently active client.\n */\nfunction getClient() {\n return getCurrentScope().getClient();\n}\n\nexport { getClient, getCurrentScope, getGlobalScope, getIsolationScope, withIsolationScope, withScope };\n//# sourceMappingURL=currentScopes.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { logger, uuid4, timestampInSeconds, isThenable, GLOBAL_OBJ } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from './constants.js';\nimport { getCurrentScope, getIsolationScope, getClient, withIsolationScope } from './currentScopes.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { makeSession, updateSession, closeSession } from './session.js';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent.js';\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nfunction captureException(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n exception,\n hint,\n) {\n return getCurrentScope().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param captureContext Define the level of the message or pass in additional data to attach to the message.\n * @returns the id of the captured message.\n */\nfunction captureMessage(message, captureContext) {\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n return getCurrentScope().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\nfunction captureEvent(event, hint) {\n return getCurrentScope().captureEvent(event, hint);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setContext(name, context) {\n getIsolationScope().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nfunction setExtras(extras) {\n getIsolationScope().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\nfunction setExtra(key, extra) {\n getIsolationScope().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nfunction setTags(tags) {\n getIsolationScope().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\nfunction setTag(key, value) {\n getIsolationScope().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nfunction setUser(user) {\n getIsolationScope().setUser(user);\n}\n\n/**\n * The last error event id of the isolation scope.\n *\n * Warning: This function really returns the last recorded error event id on the current\n * isolation scope. If you call this function after handling a certain error and another error\n * is captured in between, the last one is returned instead of the one you might expect.\n * Also, ids of events that were never sent to Sentry (for example because\n * they were dropped in `beforeSend`) could be returned.\n *\n * @returns The last event id of the isolation scope.\n */\nfunction lastEventId() {\n return getIsolationScope().lastEventId();\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nfunction captureCheckIn(checkIn, upsertMonitorConfig) {\n const scope = getCurrentScope();\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. No client defined.');\n } else if (!client.captureCheckIn) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');\n } else {\n return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n }\n\n return uuid4();\n}\n\n/**\n * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.\n *\n * @param monitorSlug The distinct slug of the monitor.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nfunction withMonitor(\n monitorSlug,\n callback,\n upsertMonitorConfig,\n) {\n const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);\n const now = timestampInSeconds();\n\n function finishCheckIn(status) {\n captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });\n }\n\n return withIsolationScope(() => {\n let maybePromiseResult;\n try {\n maybePromiseResult = callback();\n } catch (e) {\n finishCheckIn('error');\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishCheckIn('ok');\n },\n () => {\n finishCheckIn('error');\n },\n );\n } else {\n finishCheckIn('ok');\n }\n\n return maybePromiseResult;\n });\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nasync function flush(timeout) {\n const client = getClient();\n if (client) {\n return client.flush(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nasync function close(timeout) {\n const client = getClient();\n if (client) {\n return client.close(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Returns true if Sentry has been properly initialized.\n */\nfunction isInitialized() {\n return !!getClient();\n}\n\n/** If the SDK is initialized & enabled. */\nfunction isEnabled() {\n const client = getClient();\n return !!client && client.getOptions().enabled !== false && !!client.getTransport();\n}\n\n/**\n * Add an event processor.\n * This will be added to the current isolation scope, ensuring any event that is processed in the current execution\n * context will have the processor applied.\n */\nfunction addEventProcessor(callback) {\n getIsolationScope().addEventProcessor(callback);\n}\n\n/**\n * Start a session on the current isolation scope.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns the new active session\n */\nfunction startSession(context) {\n const client = getClient();\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: currentScope.getUser() || isolationScope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = isolationScope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n\n endSession();\n\n // Afterwards we set the new session on the scope\n isolationScope.setSession(session);\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession(session);\n\n return session;\n}\n\n/**\n * End the session on the current isolation scope.\n */\nfunction endSession() {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session) {\n closeSession(session);\n }\n _sendSessionUpdate();\n\n // the session is over; take it off of the scope\n isolationScope.setSession();\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession();\n}\n\n/**\n * Sends the current Session on the scope\n */\nfunction _sendSessionUpdate() {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n const client = getClient();\n // TODO (v8): Remove currentScope and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session && client) {\n client.captureSession(session);\n }\n}\n\n/**\n * Sends the current session on the scope to Sentry\n *\n * @param end If set the session will be marked as exited and removed from the scope.\n * Defaults to `false`.\n */\nfunction captureSession(end = false) {\n // both send the update and pull the session from the scope\n if (end) {\n endSession();\n return;\n }\n\n // only send the update\n _sendSessionUpdate();\n}\n\nexport { addEventProcessor, captureCheckIn, captureEvent, captureException, captureMessage, captureSession, close, endSession, flush, isEnabled, isInitialized, lastEventId, setContext, setExtra, setExtras, setTag, setTags, setUser, startSession, withMonitor };\n//# sourceMappingURL=exports.js.map\n","import { dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * key: bucketKey\n * value: [exportKey, MetricSummary]\n */\n\nconst METRICS_SPAN_FIELD = '_sentryMetrics';\n\n/**\n * Fetches the metric summary if it exists for the passed span\n */\nfunction getMetricSummaryJsonForSpan(span) {\n const storage = (span )[METRICS_SPAN_FIELD];\n\n if (!storage) {\n return undefined;\n }\n const output = {};\n\n for (const [, [exportKey, summary]] of storage) {\n const arr = output[exportKey] || (output[exportKey] = []);\n arr.push(dropUndefinedKeys(summary));\n }\n\n return output;\n}\n\n/**\n * Updates the metric summary on a span.\n */\nfunction updateMetricSummaryOnSpan(\n span,\n metricType,\n sanitizedName,\n value,\n unit,\n tags,\n bucketKey,\n) {\n const existingStorage = (span )[METRICS_SPAN_FIELD];\n const storage =\n existingStorage ||\n ((span )[METRICS_SPAN_FIELD] = new Map());\n\n const exportKey = `${metricType}:${sanitizedName}@${unit}`;\n const bucketItem = storage.get(bucketKey);\n\n if (bucketItem) {\n const [, summary] = bucketItem;\n storage.set(bucketKey, [\n exportKey,\n {\n min: Math.min(summary.min, value),\n max: Math.max(summary.max, value),\n count: (summary.count += 1),\n sum: (summary.sum += value),\n tags: summary.tags,\n },\n ]);\n } else {\n storage.set(bucketKey, [\n exportKey,\n {\n min: value,\n max: value,\n count: 1,\n sum: value,\n tags,\n },\n ]);\n }\n}\n\nexport { getMetricSummaryJsonForSpan, updateMetricSummaryOnSpan };\n//# sourceMappingURL=metric-summary.js.map\n","import { generatePropagationContext, isPlainObject, dateTimestampInSeconds, uuid4, logger } from '@sentry/utils';\nimport { updateSession } from './session.js';\nimport { _setSpanForScope, _getSpanForScope } from './utils/spanOnScope.js';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * Holds additional event information.\n */\nclass ScopeClass {\n /** Flag if notifying is happening. */\n\n /** Callback for client to receive scope changes. */\n\n /** Callback list that will be called during event processing. */\n\n /** Array of breadcrumbs. */\n\n /** User */\n\n /** Tags */\n\n /** Extra */\n\n /** Contexts */\n\n /** Attachments */\n\n /** Propagation Context for distributed tracing */\n\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n\n /** Fingerprint */\n\n /** Severity */\n\n /**\n * Transaction Name\n *\n * IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects.\n * It's purpose is to assign a transaction to the scope that's added to non-transaction events.\n */\n\n /** Session */\n\n /** Request Mode Session Status */\n\n /** The client on this scope */\n\n /** Contains the last event id of a captured event. */\n\n // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n constructor() {\n this._notifyingListeners = false;\n this._scopeListeners = [];\n this._eventProcessors = [];\n this._breadcrumbs = [];\n this._attachments = [];\n this._user = {};\n this._tags = {};\n this._extra = {};\n this._contexts = {};\n this._sdkProcessingMetadata = {};\n this._propagationContext = generatePropagationContext();\n }\n\n /**\n * @inheritDoc\n */\n clone() {\n const newScope = new ScopeClass();\n newScope._breadcrumbs = [...this._breadcrumbs];\n newScope._tags = { ...this._tags };\n newScope._extra = { ...this._extra };\n newScope._contexts = { ...this._contexts };\n newScope._user = this._user;\n newScope._level = this._level;\n newScope._session = this._session;\n newScope._transactionName = this._transactionName;\n newScope._fingerprint = this._fingerprint;\n newScope._eventProcessors = [...this._eventProcessors];\n newScope._requestSession = this._requestSession;\n newScope._attachments = [...this._attachments];\n newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };\n newScope._propagationContext = { ...this._propagationContext };\n newScope._client = this._client;\n newScope._lastEventId = this._lastEventId;\n\n _setSpanForScope(newScope, _getSpanForScope(this));\n\n return newScope;\n }\n\n /**\n * @inheritDoc\n */\n setClient(client) {\n this._client = client;\n }\n\n /**\n * @inheritDoc\n */\n setLastEventId(lastEventId) {\n this._lastEventId = lastEventId;\n }\n\n /**\n * @inheritDoc\n */\n getClient() {\n return this._client ;\n }\n\n /**\n * @inheritDoc\n */\n lastEventId() {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n */\n addScopeListener(callback) {\n this._scopeListeners.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n addEventProcessor(callback) {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setUser(user) {\n // If null is passed we want to unset everything, but still define keys,\n // so that later down in the pipeline any existing values are cleared.\n this._user = user || {\n email: undefined,\n id: undefined,\n ip_address: undefined,\n username: undefined,\n };\n\n if (this._session) {\n updateSession(this._session, { user });\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getUser() {\n return this._user;\n }\n\n /**\n * @inheritDoc\n */\n getRequestSession() {\n return this._requestSession;\n }\n\n /**\n * @inheritDoc\n */\n setRequestSession(requestSession) {\n this._requestSession = requestSession;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTags(tags) {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTag(key, value) {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setExtras(extras) {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setExtra(key, extra) {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setFingerprint(fingerprint) {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setLevel(level) {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTransactionName(name) {\n this._transactionName = name;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setContext(key, context) {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setSession(session) {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getSession() {\n return this._session;\n }\n\n /**\n * @inheritDoc\n */\n update(captureContext) {\n if (!captureContext) {\n return this;\n }\n\n const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext;\n\n const [scopeInstance, requestSession] =\n scopeToMerge instanceof Scope\n ? [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()]\n : isPlainObject(scopeToMerge)\n ? [captureContext , (captureContext ).requestSession]\n : [];\n\n const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {};\n\n this._tags = { ...this._tags, ...tags };\n this._extra = { ...this._extra, ...extra };\n this._contexts = { ...this._contexts, ...contexts };\n\n if (user && Object.keys(user).length) {\n this._user = user;\n }\n\n if (level) {\n this._level = level;\n }\n\n if (fingerprint.length) {\n this._fingerprint = fingerprint;\n }\n\n if (propagationContext) {\n this._propagationContext = propagationContext;\n }\n\n if (requestSession) {\n this._requestSession = requestSession;\n }\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n clear() {\n // client is not cleared here on purpose!\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._requestSession = undefined;\n this._session = undefined;\n _setSpanForScope(this, undefined);\n this._attachments = [];\n this._propagationContext = generatePropagationContext();\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n addBreadcrumb(breadcrumb, maxBreadcrumbs) {\n const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n // No data has been changed, so don't notify scope listeners\n if (maxCrumbs <= 0) {\n return this;\n }\n\n const mergedBreadcrumb = {\n timestamp: dateTimestampInSeconds(),\n ...breadcrumb,\n };\n\n const breadcrumbs = this._breadcrumbs;\n breadcrumbs.push(mergedBreadcrumb);\n this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;\n\n this._notifyScopeListeners();\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getLastBreadcrumb() {\n return this._breadcrumbs[this._breadcrumbs.length - 1];\n }\n\n /**\n * @inheritDoc\n */\n clearBreadcrumbs() {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n addAttachment(attachment) {\n this._attachments.push(attachment);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n clearAttachments() {\n this._attachments = [];\n return this;\n }\n\n /** @inheritDoc */\n getScopeData() {\n return {\n breadcrumbs: this._breadcrumbs,\n attachments: this._attachments,\n contexts: this._contexts,\n tags: this._tags,\n extra: this._extra,\n user: this._user,\n level: this._level,\n fingerprint: this._fingerprint || [],\n eventProcessors: this._eventProcessors,\n propagationContext: this._propagationContext,\n sdkProcessingMetadata: this._sdkProcessingMetadata,\n transactionName: this._transactionName,\n span: _getSpanForScope(this),\n };\n }\n\n /**\n * @inheritDoc\n */\n setSDKProcessingMetadata(newData) {\n this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setPropagationContext(context) {\n this._propagationContext = context;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getPropagationContext() {\n return this._propagationContext;\n }\n\n /**\n * @inheritDoc\n */\n captureException(exception, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture exception!');\n return eventId;\n }\n\n const syntheticException = new Error('Sentry syntheticException');\n\n this._client.captureException(\n exception,\n {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureMessage(message, level, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture message!');\n return eventId;\n }\n\n const syntheticException = new Error(message);\n\n this._client.captureMessage(\n message,\n level,\n {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureEvent(event, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture event!');\n return eventId;\n }\n\n this._client.captureEvent(event, { ...hint, event_id: eventId }, this);\n\n return eventId;\n }\n\n /**\n * This will be called on every set call.\n */\n _notifyScopeListeners() {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }\n}\n\n// NOTE: By exporting this here as const & type, instead of doing `export class`,\n// We can get the correct class when importing from `@sentry/core`, but the original type (from `@sentry/types`)\n// This is helpful for interop, e.g. when doing `import type { Scope } from '@sentry/node';` (which re-exports this)\n\n/**\n * Holds additional event information.\n */\nconst Scope = ScopeClass;\n\n/**\n * Holds additional event information.\n */\n\nexport { Scope };\n//# sourceMappingURL=scope.js.map\n","/**\n * Use this attribute to represent the source of a span.\n * Should be one of: custom, url, route, view, component, task, unknown\n *\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Use this attribute to represent the sample rate used for a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n\n/**\n * Use this attribute to represent the operation of a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op';\n\n/**\n * Use this attribute to represent the origin of a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin';\n\n/** The reason why an idle span finished. */\nconst SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = 'sentry.idle_span_finish_reason';\n\n/** The unit of a measurement, which may be stored as a TimedEvent. */\nconst SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = 'sentry.measurement_unit';\n\n/** The value of a measurement, which may be stored as a TimedEvent. */\nconst SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = 'sentry.measurement_value';\n\n/**\n * The id of the profile that this span occured in.\n */\nconst SEMANTIC_ATTRIBUTE_PROFILE_ID = 'sentry.profile_id';\n\nconst SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = 'sentry.exclusive_time';\n\nconst SEMANTIC_ATTRIBUTE_CACHE_HIT = 'cache.hit';\n\nconst SEMANTIC_ATTRIBUTE_CACHE_KEY = 'cache.key';\n\nconst SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = 'cache.item_size';\n\n/** TODO: Remove these once we update to latest semantic conventions */\nconst SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = 'http.request.method';\nconst SEMANTIC_ATTRIBUTE_URL_FULL = 'url.full';\n\nexport { SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_URL_FULL };\n//# sourceMappingURL=semanticAttributes.js.map\n","import { timestampInSeconds, uuid4, dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nfunction makeSession(context) {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nfunction updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nfunction closeSession(session, status) {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session) {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n\nexport { closeSession, makeSession, updateSession };\n//# sourceMappingURL=session.js.map\n","import { dropUndefinedKeys, baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader, addNonEnumerableProperty } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getClient } from '../currentScopes.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes.js';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled.js';\nimport { spanToJSON, getRootSpan, spanIsSampled } from '../utils/spanUtils.js';\n\n/**\n * If you change this value, also update the terser plugin config to\n * avoid minification of the object property!\n */\nconst FROZEN_DSC_FIELD = '_frozenDsc';\n\n/**\n * Freeze the given DSC on the given span.\n */\nfunction freezeDscOnSpan(span, dsc) {\n const spanWithMaybeDsc = span ;\n addNonEnumerableProperty(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc);\n}\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nfunction getDynamicSamplingContextFromClient(trace_id, client) {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n public_key,\n trace_id,\n }) ;\n\n client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nfunction getDynamicSamplingContextFromSpan(span) {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client);\n\n const rootSpan = getRootSpan(span);\n\n // For core implementation, we freeze the DSC onto the span as a non-enumerable property\n const frozenDsc = (rootSpan )[FROZEN_DSC_FIELD];\n if (frozenDsc) {\n return frozenDsc;\n }\n\n // For OpenTelemetry, we freeze the DSC on the trace state\n const traceState = rootSpan.spanContext().traceState;\n const traceStateDsc = traceState && traceState.get('sentry.dsc');\n\n // If the span has a DSC, we want it to take precedence\n const dscOnTraceState = traceStateDsc && baggageHeaderToDynamicSamplingContext(traceStateDsc);\n\n if (dscOnTraceState) {\n return dscOnTraceState;\n }\n\n // Else, we generate it from the span\n const jsonSpan = spanToJSON(rootSpan);\n const attributes = jsonSpan.data || {};\n const maybeSampleRate = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];\n\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n const name = jsonSpan.description;\n if (source !== 'url' && name) {\n dsc.transaction = name;\n }\n\n // How can we even land here with hasTracingEnabled() returning false?\n // Otel creates a Non-recording span in Tracing Without Performance mode when handling incoming requests\n // So we end up with an active span that is not sampled (neither positively nor negatively)\n if (hasTracingEnabled()) {\n dsc.sampled = String(spanIsSampled(rootSpan));\n }\n\n client.emit('createDsc', dsc, rootSpan);\n\n return dsc;\n}\n\n/**\n * Convert a Span to a baggage header.\n */\nfunction spanToBaggageHeader(span) {\n const dsc = getDynamicSamplingContextFromSpan(span);\n return dynamicSamplingContextToSentryBaggageHeader(dsc);\n}\n\nexport { freezeDscOnSpan, getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan, spanToBaggageHeader };\n//# sourceMappingURL=dynamicSamplingContext.js.map\n","const SPAN_STATUS_UNSET = 0;\nconst SPAN_STATUS_OK = 1;\nconst SPAN_STATUS_ERROR = 2;\n\n/**\n * Converts a HTTP status code into a sentry status with a message.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\n// https://develop.sentry.dev/sdk/event-payloads/span/\nfunction getSpanStatusFromHttpCode(httpStatus) {\n if (httpStatus < 400 && httpStatus >= 100) {\n return { code: SPAN_STATUS_OK };\n }\n\n if (httpStatus >= 400 && httpStatus < 500) {\n switch (httpStatus) {\n case 401:\n return { code: SPAN_STATUS_ERROR, message: 'unauthenticated' };\n case 403:\n return { code: SPAN_STATUS_ERROR, message: 'permission_denied' };\n case 404:\n return { code: SPAN_STATUS_ERROR, message: 'not_found' };\n case 409:\n return { code: SPAN_STATUS_ERROR, message: 'already_exists' };\n case 413:\n return { code: SPAN_STATUS_ERROR, message: 'failed_precondition' };\n case 429:\n return { code: SPAN_STATUS_ERROR, message: 'resource_exhausted' };\n case 499:\n return { code: SPAN_STATUS_ERROR, message: 'cancelled' };\n default:\n return { code: SPAN_STATUS_ERROR, message: 'invalid_argument' };\n }\n }\n\n if (httpStatus >= 500 && httpStatus < 600) {\n switch (httpStatus) {\n case 501:\n return { code: SPAN_STATUS_ERROR, message: 'unimplemented' };\n case 503:\n return { code: SPAN_STATUS_ERROR, message: 'unavailable' };\n case 504:\n return { code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' };\n default:\n return { code: SPAN_STATUS_ERROR, message: 'internal_error' };\n }\n }\n\n return { code: SPAN_STATUS_ERROR, message: 'unknown_error' };\n}\n\n/**\n * Sets the Http status attributes on the current span based on the http code.\n * Additionally, the span's status is updated, depending on the http code.\n */\nfunction setHttpStatus(span, httpStatus) {\n span.setAttribute('http.response.status_code', httpStatus);\n\n const spanStatus = getSpanStatusFromHttpCode(httpStatus);\n if (spanStatus.message !== 'unknown_error') {\n span.setStatus(spanStatus);\n }\n}\n\nexport { SPAN_STATUS_ERROR, SPAN_STATUS_OK, SPAN_STATUS_UNSET, getSpanStatusFromHttpCode, setHttpStatus };\n//# sourceMappingURL=spanstatus.js.map\n","import { getClient } from '../currentScopes.js';\n\n// Treeshakable guard to remove all code related to tracing\n\n/**\n * Determines if tracing is currently enabled.\n *\n * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.\n */\nfunction hasTracingEnabled(\n maybeOptions,\n) {\n if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {\n return false;\n }\n\n const client = getClient();\n const options = maybeOptions || (client && client.getOptions());\n // eslint-disable-next-line deprecation/deprecation\n return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);\n}\n\nexport { hasTracingEnabled };\n//# sourceMappingURL=hasTracingEnabled.js.map\n","/**\n * Checks whether given url points to Sentry server\n *\n * @param url url to verify\n */\nfunction isSentryRequestUrl(url, client) {\n const dsn = client && client.getDsn();\n const tunnel = client && client.getOptions().tunnel;\n return checkDsn(url, dsn) || checkTunnel(url, tunnel);\n}\n\nfunction checkTunnel(url, tunnel) {\n if (!tunnel) {\n return false;\n }\n\n return removeTrailingSlash(url) === removeTrailingSlash(tunnel);\n}\n\nfunction checkDsn(url, dsn) {\n return dsn ? url.includes(dsn.host) : false;\n}\n\nfunction removeTrailingSlash(str) {\n return str[str.length - 1] === '/' ? str.slice(0, -1) : str;\n}\n\nexport { isSentryRequestUrl };\n//# sourceMappingURL=isSentryRequestUrl.js.map\n","import { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\n\n/**\n * Parse a sample rate from a given value.\n * This will either return a boolean or number sample rate, if the sample rate is valid (between 0 and 1).\n * If a string is passed, we try to convert it to a number.\n *\n * Any invalid sample rate will return `undefined`.\n */\nfunction parseSampleRate(sampleRate) {\n if (typeof sampleRate === 'boolean') {\n return Number(sampleRate);\n }\n\n const rate = typeof sampleRate === 'string' ? parseFloat(sampleRate) : sampleRate;\n if (typeof rate !== 'number' || isNaN(rate) || rate < 0 || rate > 1) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n sampleRate,\n )} of type ${JSON.stringify(typeof sampleRate)}.`,\n );\n return undefined;\n }\n\n return rate;\n}\n\nexport { parseSampleRate };\n//# sourceMappingURL=parseSampleRate.js.map\n","import { SyncPromise, logger, isThenable } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\n\n/**\n * Process an array of event processors, returning the processed event (or `null` if the event was dropped).\n */\nfunction notifyEventProcessors(\n processors,\n event,\n hint,\n index = 0,\n) {\n return new SyncPromise((resolve, reject) => {\n const processor = processors[index];\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n const result = processor({ ...event }, hint) ;\n\n DEBUG_BUILD && processor.id && result === null && logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n if (isThenable(result)) {\n void result\n .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n .then(null, reject);\n } else {\n void notifyEventProcessors(processors, result, hint, index + 1)\n .then(resolve)\n .then(null, reject);\n }\n }\n });\n}\n\nexport { notifyEventProcessors };\n//# sourceMappingURL=eventProcessors.js.map\n","import { dropUndefinedKeys, arrayify } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext.js';\nimport { spanToTraceContext, getRootSpan, spanToJSON } from './spanUtils.js';\n\n/**\n * Applies data from the scope to the event and runs all event processors on it.\n */\nfunction applyScopeDataToEvent(event, data) {\n const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data;\n\n // Apply general data\n applyDataToEvent(event, data);\n\n // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relies on that.\n if (span) {\n applySpanToEvent(event, span);\n }\n\n applyFingerprintToEvent(event, fingerprint);\n applyBreadcrumbsToEvent(event, breadcrumbs);\n applySdkMetadataToEvent(event, sdkProcessingMetadata);\n}\n\n/** Merge data of two scopes together. */\nfunction mergeScopeData(data, mergeData) {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n sdkProcessingMetadata,\n breadcrumbs,\n fingerprint,\n eventProcessors,\n attachments,\n propagationContext,\n transactionName,\n span,\n } = mergeData;\n\n mergeAndOverwriteScopeData(data, 'extra', extra);\n mergeAndOverwriteScopeData(data, 'tags', tags);\n mergeAndOverwriteScopeData(data, 'user', user);\n mergeAndOverwriteScopeData(data, 'contexts', contexts);\n mergeAndOverwriteScopeData(data, 'sdkProcessingMetadata', sdkProcessingMetadata);\n\n if (level) {\n data.level = level;\n }\n\n if (transactionName) {\n data.transactionName = transactionName;\n }\n\n if (span) {\n data.span = span;\n }\n\n if (breadcrumbs.length) {\n data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs];\n }\n\n if (fingerprint.length) {\n data.fingerprint = [...data.fingerprint, ...fingerprint];\n }\n\n if (eventProcessors.length) {\n data.eventProcessors = [...data.eventProcessors, ...eventProcessors];\n }\n\n if (attachments.length) {\n data.attachments = [...data.attachments, ...attachments];\n }\n\n data.propagationContext = { ...data.propagationContext, ...propagationContext };\n}\n\n/**\n * Merges certain scope data. Undefined values will overwrite any existing values.\n * Exported only for tests.\n */\nfunction mergeAndOverwriteScopeData\n\n(data, prop, mergeVal) {\n if (mergeVal && Object.keys(mergeVal).length) {\n // Clone object\n data[prop] = { ...data[prop] };\n for (const key in mergeVal) {\n if (Object.prototype.hasOwnProperty.call(mergeVal, key)) {\n data[prop][key] = mergeVal[key];\n }\n }\n }\n}\n\nfunction applyDataToEvent(event, data) {\n const { extra, tags, user, contexts, level, transactionName } = data;\n\n const cleanedExtra = dropUndefinedKeys(extra);\n if (cleanedExtra && Object.keys(cleanedExtra).length) {\n event.extra = { ...cleanedExtra, ...event.extra };\n }\n\n const cleanedTags = dropUndefinedKeys(tags);\n if (cleanedTags && Object.keys(cleanedTags).length) {\n event.tags = { ...cleanedTags, ...event.tags };\n }\n\n const cleanedUser = dropUndefinedKeys(user);\n if (cleanedUser && Object.keys(cleanedUser).length) {\n event.user = { ...cleanedUser, ...event.user };\n }\n\n const cleanedContexts = dropUndefinedKeys(contexts);\n if (cleanedContexts && Object.keys(cleanedContexts).length) {\n event.contexts = { ...cleanedContexts, ...event.contexts };\n }\n\n if (level) {\n event.level = level;\n }\n\n // transaction events get their `transaction` from the root span name\n if (transactionName && event.type !== 'transaction') {\n event.transaction = transactionName;\n }\n}\n\nfunction applyBreadcrumbsToEvent(event, breadcrumbs) {\n const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs];\n event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined;\n}\n\nfunction applySdkMetadataToEvent(event, sdkProcessingMetadata) {\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n ...sdkProcessingMetadata,\n };\n}\n\nfunction applySpanToEvent(event, span) {\n event.contexts = {\n trace: spanToTraceContext(span),\n ...event.contexts,\n };\n\n event.sdkProcessingMetadata = {\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),\n ...event.sdkProcessingMetadata,\n };\n\n const rootSpan = getRootSpan(span);\n const transactionName = spanToJSON(rootSpan).description;\n if (transactionName && !event.transaction && event.type === 'transaction') {\n event.transaction = transactionName;\n }\n}\n\n/**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\nfunction applyFingerprintToEvent(event, fingerprint) {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n // If we have something on the scope, then merge it with event\n if (fingerprint) {\n event.fingerprint = event.fingerprint.concat(fingerprint);\n }\n\n // If we have no data at all, remove empty array default\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n}\n\nexport { applyScopeDataToEvent, mergeAndOverwriteScopeData, mergeScopeData };\n//# sourceMappingURL=applyScopeDataToEvent.js.map\n","import { uuid4, dateTimestampInSeconds, addExceptionMechanism, truncate, GLOBAL_OBJ, normalize } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getGlobalScope } from '../currentScopes.js';\nimport { notifyEventProcessors } from '../eventProcessors.js';\nimport { Scope } from '../scope.js';\nimport { mergeScopeData, applyScopeDataToEvent } from './applyScopeDataToEvent.js';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nfunction prepareEvent(\n options,\n event,\n hint,\n scope,\n client,\n isolationScope,\n) {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;\n const prepared = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n if (client) {\n client.emit('applyFrameMetadata', event);\n }\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Scope.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n const eventProcessors = [\n ...clientEventProcessors,\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event, options) {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\nconst debugIdStackParserCache = new WeakMap();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nfunction applyDebugIds(event, stackParser) {\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n if (!debugIdMap) {\n return;\n }\n\n let debugIdStackFramesCache;\n const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n if (cachedDebugIdStackFrameCache) {\n debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n } else {\n debugIdStackFramesCache = new Map();\n debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n }\n\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = Object.entries(debugIdMap).reduce(\n (acc, [debugIdStackTrace, debugIdValue]) => {\n let parsedStack;\n const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n if (cachedParsedStack) {\n parsedStack = cachedParsedStack;\n } else {\n parsedStack = stackParser(debugIdStackTrace);\n debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n }\n\n for (let i = parsedStack.length - 1; i >= 0; i--) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const stackFrame = parsedStack[i];\n if (stackFrame.filename) {\n acc[stackFrame.filename] = debugIdValue;\n break;\n }\n }\n return acc;\n },\n {},\n );\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nfunction applyDebugMeta(event) {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id,\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event, integrationNames) {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event, depth, maxBreadth) {\n if (!event) {\n return null;\n }\n\n const normalized = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n return {\n ...span,\n ...(span.data && {\n data: normalize(span.data, depth, maxBreadth),\n }),\n };\n });\n }\n\n return normalized;\n}\n\nfunction getFinalScope(\n scope,\n captureContext,\n) {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nfunction parseEventHintOrCaptureContext(\n hint,\n) {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(\n hint,\n) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\nconst captureContextKeys = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'requestSession',\n 'propagationContext',\n] ;\n\nfunction hintIsScopeContext(hint) {\n return Object.keys(hint).some(key => captureContextKeys.includes(key ));\n}\n\nexport { applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext, prepareEvent };\n//# sourceMappingURL=prepareEvent.js.map\n","import { addNonEnumerableProperty } from '@sentry/utils';\n\nconst SCOPE_SPAN_FIELD = '_sentrySpan';\n\n/**\n * Set the active span for a given scope.\n * NOTE: This should NOT be used directly, but is only used internally by the trace methods.\n */\nfunction _setSpanForScope(scope, span) {\n if (span) {\n addNonEnumerableProperty(scope , SCOPE_SPAN_FIELD, span);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete (scope )[SCOPE_SPAN_FIELD];\n }\n}\n\n/**\n * Get the active span for a given scope.\n * NOTE: This should NOT be used directly, but is only used internally by the trace methods.\n */\nfunction _getSpanForScope(scope) {\n return scope[SCOPE_SPAN_FIELD];\n}\n\nexport { _getSpanForScope, _setSpanForScope };\n//# sourceMappingURL=spanOnScope.js.map\n","import { dropUndefinedKeys, generateSentryTraceHeader, timestampInSeconds, addNonEnumerableProperty } from '@sentry/utils';\nimport { getAsyncContextStrategy } from '../asyncContext/index.js';\nimport { getMainCarrier } from '../carrier.js';\nimport { getCurrentScope } from '../currentScopes.js';\nimport { getMetricSummaryJsonForSpan, updateMetricSummaryOnSpan } from '../metrics/metric-summary.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../semanticAttributes.js';\nimport { SPAN_STATUS_UNSET, SPAN_STATUS_OK } from '../tracing/spanstatus.js';\nimport { _getSpanForScope } from './spanOnScope.js';\n\n// These are aligned with OpenTelemetry trace flags\nconst TRACE_FLAG_NONE = 0x0;\nconst TRACE_FLAG_SAMPLED = 0x1;\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in an event.\n * By default, this will only include trace_id, span_id & parent_span_id.\n * If `includeAllData` is true, it will also include data, op, status & origin.\n */\nfunction spanToTransactionTraceContext(span) {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { data, op, parent_span_id, status, origin } = spanToJSON(span);\n\n return dropUndefinedKeys({\n parent_span_id,\n span_id,\n trace_id,\n data,\n op,\n status,\n origin,\n });\n}\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in a non-transaction event.\n */\nfunction spanToTraceContext(span) {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { parent_span_id } = spanToJSON(span);\n\n return dropUndefinedKeys({ parent_span_id, span_id, trace_id });\n}\n\n/**\n * Convert a Span to a Sentry trace header.\n */\nfunction spanToTraceHeader(span) {\n const { traceId, spanId } = span.spanContext();\n const sampled = spanIsSampled(span);\n return generateSentryTraceHeader(traceId, spanId, sampled);\n}\n\n/**\n * Convert a span time input into a timestamp in seconds.\n */\nfunction spanTimeInputToSeconds(input) {\n if (typeof input === 'number') {\n return ensureTimestampInSeconds(input);\n }\n\n if (Array.isArray(input)) {\n // See {@link HrTime} for the array-based time format\n return input[0] + input[1] / 1e9;\n }\n\n if (input instanceof Date) {\n return ensureTimestampInSeconds(input.getTime());\n }\n\n return timestampInSeconds();\n}\n\n/**\n * Converts a timestamp to second, if it was in milliseconds, or keeps it as second.\n */\nfunction ensureTimestampInSeconds(timestamp) {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Convert a span to a JSON representation.\n */\n// Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).\n// This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.\n// And `spanToJSON` needs the Span class from `span.ts` to check here.\nfunction spanToJSON(span) {\n if (spanIsSentrySpan(span)) {\n return span.getSpanJSON();\n }\n\n try {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n\n // Handle a span from @opentelemetry/sdk-base-trace's `Span` class\n if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) {\n const { attributes, startTime, name, endTime, parentSpanId, status } = span;\n\n return dropUndefinedKeys({\n span_id,\n trace_id,\n data: attributes,\n description: name,\n parent_span_id: parentSpanId,\n start_timestamp: spanTimeInputToSeconds(startTime),\n // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time\n timestamp: spanTimeInputToSeconds(endTime) || undefined,\n status: getStatusMessage(status),\n op: attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP],\n origin: attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] ,\n _metrics_summary: getMetricSummaryJsonForSpan(span),\n });\n }\n\n // Finally, at least we have `spanContext()`....\n return {\n span_id,\n trace_id,\n };\n } catch (e) {\n return {};\n }\n}\n\nfunction spanIsOpenTelemetrySdkTraceBaseSpan(span) {\n const castSpan = span ;\n return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status;\n}\n\n/** Exported only for tests. */\n\n/**\n * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof.\n * :( So instead we approximate this by checking if it has the `getSpanJSON` method.\n */\nfunction spanIsSentrySpan(span) {\n return typeof (span ).getSpanJSON === 'function';\n}\n\n/**\n * Returns true if a span is sampled.\n * In most cases, you should just use `span.isRecording()` instead.\n * However, this has a slightly different semantic, as it also returns false if the span is finished.\n * So in the case where this distinction is important, use this method.\n */\nfunction spanIsSampled(span) {\n // We align our trace flags with the ones OpenTelemetry use\n // So we also check for sampled the same way they do.\n const { traceFlags } = span.spanContext();\n return traceFlags === TRACE_FLAG_SAMPLED;\n}\n\n/** Get the status message to use for a JSON representation of a span. */\nfunction getStatusMessage(status) {\n if (!status || status.code === SPAN_STATUS_UNSET) {\n return undefined;\n }\n\n if (status.code === SPAN_STATUS_OK) {\n return 'ok';\n }\n\n return status.message || 'unknown_error';\n}\n\nconst CHILD_SPANS_FIELD = '_sentryChildSpans';\nconst ROOT_SPAN_FIELD = '_sentryRootSpan';\n\n/**\n * Adds an opaque child span reference to a span.\n */\nfunction addChildSpanToSpan(span, childSpan) {\n // We store the root span reference on the child span\n // We need this for `getRootSpan()` to work\n const rootSpan = span[ROOT_SPAN_FIELD] || span;\n addNonEnumerableProperty(childSpan , ROOT_SPAN_FIELD, rootSpan);\n\n // We store a list of child spans on the parent span\n // We need this for `getSpanDescendants()` to work\n if (span[CHILD_SPANS_FIELD]) {\n span[CHILD_SPANS_FIELD].add(childSpan);\n } else {\n addNonEnumerableProperty(span, CHILD_SPANS_FIELD, new Set([childSpan]));\n }\n}\n\n/** This is only used internally by Idle Spans. */\nfunction removeChildSpanFromSpan(span, childSpan) {\n if (span[CHILD_SPANS_FIELD]) {\n span[CHILD_SPANS_FIELD].delete(childSpan);\n }\n}\n\n/**\n * Returns an array of the given span and all of its descendants.\n */\nfunction getSpanDescendants(span) {\n const resultSet = new Set();\n\n function addSpanChildren(span) {\n // This exit condition is required to not infinitely loop in case of a circular dependency.\n if (resultSet.has(span)) {\n return;\n // We want to ignore unsampled spans (e.g. non recording spans)\n } else if (spanIsSampled(span)) {\n resultSet.add(span);\n const childSpans = span[CHILD_SPANS_FIELD] ? Array.from(span[CHILD_SPANS_FIELD]) : [];\n for (const childSpan of childSpans) {\n addSpanChildren(childSpan);\n }\n }\n }\n\n addSpanChildren(span);\n\n return Array.from(resultSet);\n}\n\n/**\n * Returns the root span of a given span.\n */\nfunction getRootSpan(span) {\n return span[ROOT_SPAN_FIELD] || span;\n}\n\n/**\n * Returns the currently active span.\n */\nfunction getActiveSpan() {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n if (acs.getActiveSpan) {\n return acs.getActiveSpan();\n }\n\n return _getSpanForScope(getCurrentScope());\n}\n\n/**\n * Updates the metric summary on the currently active span\n */\nfunction updateMetricSummaryOnActiveSpan(\n metricType,\n sanitizedName,\n value,\n unit,\n tags,\n bucketKey,\n) {\n const span = getActiveSpan();\n if (span) {\n updateMetricSummaryOnSpan(span, metricType, sanitizedName, value, unit, tags, bucketKey);\n }\n}\n\nexport { TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED, addChildSpanToSpan, getActiveSpan, getRootSpan, getSpanDescendants, getStatusMessage, removeChildSpanFromSpan, spanIsSampled, spanTimeInputToSeconds, spanToJSON, spanToTraceContext, spanToTraceHeader, spanToTransactionTraceContext, updateMetricSummaryOnActiveSpan };\n//# sourceMappingURL=spanUtils.js.map\n","import { SDK_VERSION } from '@sentry/utils';\n\n/**\n * A builder for the SDK metadata in the options for the SDK initialization.\n *\n * Note: This function is identical to `buildMetadata` in Remix and NextJS and SvelteKit.\n * We don't extract it for bundle size reasons.\n * @see https://github.com/getsentry/sentry-javascript/pull/7404\n * @see https://github.com/getsentry/sentry-javascript/pull/4196\n *\n * If you make changes to this function consider updating the others as well.\n *\n * @param options SDK options object that gets mutated\n * @param names list of package names\n */\nfunction applySdkMetadata(options, name, names = [name], source = 'npm') {\n const metadata = options._metadata || {};\n\n if (!metadata.sdk) {\n metadata.sdk = {\n name: `sentry.javascript.${name}`,\n packages: names.map(name => ({\n name: `${source}:@sentry/${name}`,\n version: SDK_VERSION,\n })),\n version: SDK_VERSION,\n };\n }\n\n options._metadata = metadata;\n}\n\nexport { applySdkMetadata };\n//# sourceMappingURL=sdkMetadata.js.map\n","import { arrayify, logger } from '@sentry/utils';\nimport { getClient } from './currentScopes.js';\nimport { DEBUG_BUILD } from './debug-build.js';\n\nconst installedIntegrations = [];\n\n/** Map of integrations assigned to a client */\n\n/**\n * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to\n * preserve the order of integrations in the array.\n *\n * @private\n */\nfunction filterDuplicates(integrations) {\n const integrationsByName = {};\n\n integrations.forEach(currentInstance => {\n const { name } = currentInstance;\n\n const existingInstance = integrationsByName[name];\n\n // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a\n // default instance to overwrite an existing user instance\n if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n return;\n }\n\n integrationsByName[name] = currentInstance;\n });\n\n return Object.values(integrationsByName);\n}\n\n/** Gets integrations to install */\nfunction getIntegrationsToSetup(options) {\n const defaultIntegrations = options.defaultIntegrations || [];\n const userIntegrations = options.integrations;\n\n // We flag default instances, so that later we can tell them apart from any user-created instances of the same class\n defaultIntegrations.forEach(integration => {\n integration.isDefaultInstance = true;\n });\n\n let integrations;\n\n if (Array.isArray(userIntegrations)) {\n integrations = [...defaultIntegrations, ...userIntegrations];\n } else if (typeof userIntegrations === 'function') {\n integrations = arrayify(userIntegrations(defaultIntegrations));\n } else {\n integrations = defaultIntegrations;\n }\n\n const finalIntegrations = filterDuplicates(integrations);\n\n // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or\n // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event\n // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore\n // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.\n const debugIndex = finalIntegrations.findIndex(integration => integration.name === 'Debug');\n if (debugIndex > -1) {\n const [debugInstance] = finalIntegrations.splice(debugIndex, 1) ;\n finalIntegrations.push(debugInstance);\n }\n\n return finalIntegrations;\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nfunction setupIntegrations(client, integrations) {\n const integrationIndex = {};\n\n integrations.forEach(integration => {\n // guard against empty provided integrations\n if (integration) {\n setupIntegration(client, integration, integrationIndex);\n }\n });\n\n return integrationIndex;\n}\n\n/**\n * Execute the `afterAllSetup` hooks of the given integrations.\n */\nfunction afterSetupIntegrations(client, integrations) {\n for (const integration of integrations) {\n // guard against empty provided integrations\n if (integration && integration.afterAllSetup) {\n integration.afterAllSetup(client);\n }\n }\n}\n\n/** Setup a single integration. */\nfunction setupIntegration(client, integration, integrationIndex) {\n if (integrationIndex[integration.name]) {\n DEBUG_BUILD && logger.log(`Integration skipped because it was already installed: ${integration.name}`);\n return;\n }\n integrationIndex[integration.name] = integration;\n\n // `setupOnce` is only called the first time\n if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === 'function') {\n integration.setupOnce();\n installedIntegrations.push(integration.name);\n }\n\n // `setup` is run for each client\n if (integration.setup && typeof integration.setup === 'function') {\n integration.setup(client);\n }\n\n if (typeof integration.preprocessEvent === 'function') {\n const callback = integration.preprocessEvent.bind(integration) ;\n client.on('preprocessEvent', (event, hint) => callback(event, hint, client));\n }\n\n if (typeof integration.processEvent === 'function') {\n const callback = integration.processEvent.bind(integration) ;\n\n const processor = Object.assign((event, hint) => callback(event, hint, client), {\n id: integration.name,\n });\n\n client.addEventProcessor(processor);\n }\n\n DEBUG_BUILD && logger.log(`Integration installed: ${integration.name}`);\n}\n\n/** Add an integration to the current scope's client. */\nfunction addIntegration(integration) {\n const client = getClient();\n\n if (!client) {\n DEBUG_BUILD && logger.warn(`Cannot add integration \"${integration.name}\" because no SDK Client is available.`);\n return;\n }\n\n client.addIntegration(integration);\n}\n\n/**\n * Define an integration function that can be used to create an integration instance.\n * Note that this by design hides the implementation details of the integration, as they are considered internal.\n */\nfunction defineIntegration(fn) {\n return fn;\n}\n\nexport { addIntegration, afterSetupIntegrations, defineIntegration, getIntegrationsToSetup, installedIntegrations, setupIntegration, setupIntegrations };\n//# sourceMappingURL=integration.js.map\n","import { logger, getEventDescription, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { defineIntegration } from '../integration.js';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [\n /^Script error\\.?$/,\n /^Javascript error: Script error\\.? on line 0$/,\n /^ResizeObserver loop completed with undelivered notifications.$/, // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness.\n /^Cannot redefine property: googletag$/, // This is thrown when google tag manager is used in combination with an ad blocker\n \"undefined is not an object (evaluating 'a.L')\", // Random error that happens but not actionable or noticeable to end-users.\n 'can\\'t redefine non-configurable property \"solana\"', // Probably a browser extension or custom browser (Brave) throwing this error\n \"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)\", // Error thrown by GTM, seemingly not affecting end-users\n \"Can't find variable: _AutofillCallbackHandler\", // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/\n];\n\n/** Options for the InboundFilters integration */\n\nconst INTEGRATION_NAME = 'InboundFilters';\nconst _inboundFiltersIntegration = ((options = {}) => {\n return {\n name: INTEGRATION_NAME,\n processEvent(event, _hint, client) {\n const clientOptions = client.getOptions();\n const mergedOptions = _mergeOptions(options, clientOptions);\n return _shouldDropEvent(event, mergedOptions) ? null : event;\n },\n };\n}) ;\n\nconst inboundFiltersIntegration = defineIntegration(_inboundFiltersIntegration);\n\nfunction _mergeOptions(\n internalOptions = {},\n clientOptions = {},\n) {\n return {\n allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],\n denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],\n ignoreErrors: [\n ...(internalOptions.ignoreErrors || []),\n ...(clientOptions.ignoreErrors || []),\n ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS),\n ],\n ignoreTransactions: [...(internalOptions.ignoreTransactions || []), ...(clientOptions.ignoreTransactions || [])],\n ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,\n };\n}\n\nfunction _shouldDropEvent(event, options) {\n if (options.ignoreInternal && _isSentryError(event)) {\n DEBUG_BUILD &&\n logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n return true;\n }\n if (_isIgnoredError(event, options.ignoreErrors)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isUselessError(event)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to not having an error message, error type or stacktrace.\\nEvent: ${getEventDescription(\n event,\n )}`,\n );\n return true;\n }\n if (_isIgnoredTransaction(event, options.ignoreTransactions)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreTransactions\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isDeniedUrl(event, options.denyUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n if (!_isAllowedUrl(event, options.allowUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n return false;\n}\n\nfunction _isIgnoredError(event, ignoreErrors) {\n // If event.type, this is not an error\n if (event.type || !ignoreErrors || !ignoreErrors.length) {\n return false;\n }\n\n return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors));\n}\n\nfunction _isIgnoredTransaction(event, ignoreTransactions) {\n if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {\n return false;\n }\n\n const name = event.transaction;\n return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;\n}\n\nfunction _isDeniedUrl(event, denyUrls) {\n // TODO: Use Glob instead?\n if (!denyUrls || !denyUrls.length) {\n return false;\n }\n const url = _getEventFilterUrl(event);\n return !url ? false : stringMatchesSomePattern(url, denyUrls);\n}\n\nfunction _isAllowedUrl(event, allowUrls) {\n // TODO: Use Glob instead?\n if (!allowUrls || !allowUrls.length) {\n return true;\n }\n const url = _getEventFilterUrl(event);\n return !url ? true : stringMatchesSomePattern(url, allowUrls);\n}\n\nfunction _getPossibleEventMessages(event) {\n const possibleMessages = [];\n\n if (event.message) {\n possibleMessages.push(event.message);\n }\n\n let lastException;\n try {\n // @ts-expect-error Try catching to save bundle size\n lastException = event.exception.values[event.exception.values.length - 1];\n } catch (e) {\n // try catching to save bundle size checking existence of variables\n }\n\n if (lastException) {\n if (lastException.value) {\n possibleMessages.push(lastException.value);\n if (lastException.type) {\n possibleMessages.push(`${lastException.type}: ${lastException.value}`);\n }\n }\n }\n\n return possibleMessages;\n}\n\nfunction _isSentryError(event) {\n try {\n // @ts-expect-error can't be a sentry error if undefined\n return event.exception.values[0].type === 'SentryError';\n } catch (e) {\n // ignore\n }\n return false;\n}\n\nfunction _getLastValidUrl(frames = []) {\n for (let i = frames.length - 1; i >= 0; i--) {\n const frame = frames[i];\n\n if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') {\n return frame.filename || null;\n }\n }\n\n return null;\n}\n\nfunction _getEventFilterUrl(event) {\n try {\n let frames;\n try {\n // @ts-expect-error we only care about frames if the whole thing here is defined\n frames = event.exception.values[0].stacktrace.frames;\n } catch (e) {\n // ignore\n }\n return frames ? _getLastValidUrl(frames) : null;\n } catch (oO) {\n DEBUG_BUILD && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n return null;\n }\n}\n\nfunction _isUselessError(event) {\n if (event.type) {\n // event is not an error\n return false;\n }\n\n // We only want to consider events for dropping that actually have recorded exception values.\n if (!event.exception || !event.exception.values || event.exception.values.length === 0) {\n return false;\n }\n\n return (\n // No top-level message\n !event.message &&\n // There are no exception values that have a stacktrace, a non-generic-Error type or value\n !event.exception.values.some(value => value.stacktrace || (value.type && value.type !== 'Error') || value.value)\n );\n}\n\nexport { inboundFiltersIntegration };\n//# sourceMappingURL=inboundfilters.js.map\n","import { getOriginalFunction } from '@sentry/utils';\nimport { getClient } from '../currentScopes.js';\nimport { defineIntegration } from '../integration.js';\n\nlet originalFunctionToString;\n\nconst INTEGRATION_NAME = 'FunctionToString';\n\nconst SETUP_CLIENTS = new WeakMap();\n\nconst _functionToStringIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString;\n\n // intrinsics (like Function.prototype) might be immutable in some environments\n // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal)\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Function.prototype.toString = function ( ...args) {\n const originalFunction = getOriginalFunction(this);\n const context =\n SETUP_CLIENTS.has(getClient() ) && originalFunction !== undefined ? originalFunction : this;\n return originalFunctionToString.apply(context, args);\n };\n } catch (e) {\n // ignore errors here, just don't patch this\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) ;\n\n/**\n * Patch toString calls to return proper name for wrapped functions.\n *\n * ```js\n * Sentry.init({\n * integrations: [\n * functionToStringIntegration(),\n * ],\n * });\n * ```\n */\nconst functionToStringIntegration = defineIntegration(_functionToStringIntegration);\n\nexport { functionToStringIntegration };\n//# sourceMappingURL=functiontostring.js.map\n","import { logger, getFramesFromEvent } from '@sentry/utils';\nimport { defineIntegration } from '../integration.js';\nimport { DEBUG_BUILD } from '../debug-build.js';\n\nconst INTEGRATION_NAME = 'Dedupe';\n\nconst _dedupeIntegration = (() => {\n let previousEvent;\n\n return {\n name: INTEGRATION_NAME,\n processEvent(currentEvent) {\n // We want to ignore any non-error type events, e.g. transactions or replays\n // These should never be deduped, and also not be compared against as _previousEvent.\n if (currentEvent.type) {\n return currentEvent;\n }\n\n // Juuust in case something goes wrong\n try {\n if (_shouldDropEvent(currentEvent, previousEvent)) {\n DEBUG_BUILD && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n return null;\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n return (previousEvent = currentEvent);\n },\n };\n}) ;\n\n/**\n * Deduplication filter.\n */\nconst dedupeIntegration = defineIntegration(_dedupeIntegration);\n\n/** only exported for tests. */\nfunction _shouldDropEvent(currentEvent, previousEvent) {\n if (!previousEvent) {\n return false;\n }\n\n if (_isSameMessageEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n return false;\n}\n\nfunction _isSameMessageEvent(currentEvent, previousEvent) {\n const currentMessage = currentEvent.message;\n const previousMessage = previousEvent.message;\n\n // If neither event has a message property, they were both exceptions, so bail out\n if (!currentMessage && !previousMessage) {\n return false;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n return false;\n }\n\n if (currentMessage !== previousMessage) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameExceptionEvent(currentEvent, previousEvent) {\n const previousException = _getExceptionFromEvent(previousEvent);\n const currentException = _getExceptionFromEvent(currentEvent);\n\n if (!previousException || !currentException) {\n return false;\n }\n\n if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameStacktrace(currentEvent, previousEvent) {\n let currentFrames = getFramesFromEvent(currentEvent);\n let previousFrames = getFramesFromEvent(previousEvent);\n\n // If neither event has a stacktrace, they are assumed to be the same\n if (!currentFrames && !previousFrames) {\n return true;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n return false;\n }\n\n currentFrames = currentFrames ;\n previousFrames = previousFrames ;\n\n // If number of frames differ, they are not the same\n if (previousFrames.length !== currentFrames.length) {\n return false;\n }\n\n // Otherwise, compare the two\n for (let i = 0; i < previousFrames.length; i++) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const frameA = previousFrames[i];\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const frameB = currentFrames[i];\n\n if (\n frameA.filename !== frameB.filename ||\n frameA.lineno !== frameB.lineno ||\n frameA.colno !== frameB.colno ||\n frameA.function !== frameB.function\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction _isSameFingerprint(currentEvent, previousEvent) {\n let currentFingerprint = currentEvent.fingerprint;\n let previousFingerprint = previousEvent.fingerprint;\n\n // If neither event has a fingerprint, they are assumed to be the same\n if (!currentFingerprint && !previousFingerprint) {\n return true;\n }\n\n // If only one event has a fingerprint, but not the other one, they are not the same\n if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {\n return false;\n }\n\n currentFingerprint = currentFingerprint ;\n previousFingerprint = previousFingerprint ;\n\n // Otherwise, compare the two\n try {\n return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n } catch (_oO) {\n return false;\n }\n}\n\nfunction _getExceptionFromEvent(event) {\n return event.exception && event.exception.values && event.exception.values[0];\n}\n\nexport { _shouldDropEvent, dedupeIntegration };\n//# sourceMappingURL=dedupe.js.map\n","import { logger, consoleSandbox } from '@sentry/utils';\nimport { getCurrentScope } from './currentScopes.js';\nimport { DEBUG_BUILD } from './debug-build.js';\n\n/** A class object that can instantiate Client objects. */\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nfunction initAndBind(\n clientClass,\n options,\n) {\n if (options.debug === true) {\n if (DEBUG_BUILD) {\n logger.enable();\n } else {\n // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n });\n }\n }\n const scope = getCurrentScope();\n scope.update(options.initialScope);\n\n const client = new clientClass(options);\n setCurrentClient(client);\n client.init();\n return client;\n}\n\n/**\n * Make the given client the current client.\n */\nfunction setCurrentClient(client) {\n getCurrentScope().setClient(client);\n}\n\nexport { initAndBind, setCurrentClient };\n//# sourceMappingURL=sdk.js.map\n","/** An error emitted by Sentry SDKs and related utilities. */\nclass SentryError extends Error {\n /** Display name of this error instance. */\n\n constructor( message, logLevel = 'warn') {\n super(message);this.message = message;\n this.name = new.target.prototype.constructor.name;\n // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n // instances of `SentryError` fail `obj instanceof SentryError` checks.\n Object.setPrototypeOf(this, new.target.prototype);\n this.logLevel = logLevel;\n }\n}\n\nexport { SentryError };\n//# sourceMappingURL=error.js.map\n","import { createEnvelope } from './envelope.js';\nimport { dateTimestampInSeconds } from './time.js';\n\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\nfunction createClientReportEnvelope(\n discarded_events,\n dsn,\n timestamp,\n) {\n const clientReportItem = [\n { type: 'client_report' },\n {\n timestamp: timestamp || dateTimestampInSeconds(),\n discarded_events,\n },\n ];\n return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);\n}\n\nexport { createClientReportEnvelope };\n//# sourceMappingURL=clientreport.js.map\n","import { makeDsn, dsnToString, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\nfunction getBaseApiEndpoint(dsn) {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn) {\n return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn, sdkInfo) {\n return urlEncode({\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION,\n ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),\n });\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nfunction getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) {\n return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nfunction getReportDialogEndpoint(\n dsnLike,\n dialogOptions\n\n,\n) {\n const dsn = makeDsn(dsnLike);\n if (!dsn) {\n return '';\n }\n\n const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n let encodedOptions = `dsn=${dsnToString(dsn)}`;\n for (const key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'onClose') {\n continue;\n }\n\n if (key === 'user') {\n const user = dialogOptions.user;\n if (!user) {\n continue;\n }\n if (user.name) {\n encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n }\n if (user.email) {\n encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n }\n } else {\n encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`;\n }\n }\n\n return `${endpoint}?${encodedOptions}`;\n}\n\nexport { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint };\n//# sourceMappingURL=api.js.map\n","import { getSdkMetadataForEnvelopeHeader, dsnToString, createEnvelope, createEventEnvelopeHeaders, createSpanEnvelopeItem } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from './tracing/dynamicSamplingContext.js';\nimport { spanToJSON } from './utils/spanUtils.js';\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event, sdkInfo) {\n if (!sdkInfo) {\n return event;\n }\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || sdkInfo.name;\n event.sdk.version = event.sdk.version || sdkInfo.version;\n event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n return event;\n}\n\n/** Creates an envelope from a Session */\nfunction createSessionEnvelope(\n session,\n dsn,\n metadata,\n tunnel,\n) {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n const envelopeHeaders = {\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n };\n\n const envelopeItem =\n 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()];\n\n return createEnvelope(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n * Create an Envelope from an event.\n */\nfunction createEventEnvelope(\n event,\n dsn,\n metadata,\n tunnel,\n) {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n\n /*\n Note: Due to TS, event.type may be `replay_event`, theoretically.\n In practice, we never call `createEventEnvelope` with `replay_event` type,\n and we'd have to adjut a looot of types to make this work properly.\n We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)\n So the safe choice is to really guard against the replay_event type here.\n */\n const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';\n\n enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n\n const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n\n // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n delete event.sdkProcessingMetadata;\n\n const eventItem = [{ type: eventType }, event];\n return createEnvelope(envelopeHeaders, [eventItem]);\n}\n\n/**\n * Create envelope from Span item.\n *\n * Takes an optional client and runs spans through `beforeSendSpan` if available.\n */\nfunction createSpanEnvelope(spans, client) {\n function dscHasRequiredProps(dsc) {\n return !!dsc.trace_id && !!dsc.public_key;\n }\n\n // For the moment we'll obtain the DSC from the first span in the array\n // This might need to be changed if we permit sending multiple spans from\n // different segments in one envelope\n const dsc = getDynamicSamplingContextFromSpan(spans[0]);\n\n const dsn = client && client.getDsn();\n const tunnel = client && client.getOptions().tunnel;\n\n const headers = {\n sent_at: new Date().toISOString(),\n ...(dscHasRequiredProps(dsc) && { trace: dsc }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n };\n\n const beforeSendSpan = client && client.getOptions().beforeSendSpan;\n const convertToSpanJSON = beforeSendSpan\n ? (span) => beforeSendSpan(spanToJSON(span) )\n : (span) => spanToJSON(span);\n\n const items = [];\n for (const span of spans) {\n const spanJson = convertToSpanJSON(span);\n if (spanJson) {\n items.push(createSpanEnvelopeItem(spanJson));\n }\n }\n\n return createEnvelope(headers, items);\n}\n\nexport { createEventEnvelope, createSessionEnvelope, createSpanEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { makeDsn, logger, uuid4, checkOrSetAlreadyCaught, isParameterizedString, isPrimitive, resolvedSyncPromise, addItemToEnvelope, createAttachmentEnvelopeItem, SyncPromise, dropUndefinedKeys, rejectedSyncPromise, SentryError, createClientReportEnvelope, dsnToString, isThenable, isPlainObject } from '@sentry/utils';\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api.js';\nimport { getIsolationScope } from './currentScopes.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope.js';\nimport { setupIntegration, afterSetupIntegrations, setupIntegrations } from './integration.js';\nimport { updateSession } from './session.js';\nimport { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext.js';\nimport { parseSampleRate } from './utils/parseSampleRate.js';\nimport { prepareEvent } from './utils/prepareEvent.js';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient<NodeOptions> {\n * public constructor(options: NodeOptions) {\n * super(options);\n * }\n *\n * // ...\n * }\n */\nclass BaseClient {\n /** Options passed to the SDK. */\n\n /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n\n /** Array of set up integrations. */\n\n /** Number of calls being processed */\n\n /** Holds flushable */\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n\n /**\n * Initializes this client instance.\n *\n * @param options Options for the client.\n */\n constructor(options) {\n this._options = options;\n this._integrations = {};\n this._numProcessing = 0;\n this._outcomes = {};\n this._hooks = {};\n this._eventProcessors = [];\n\n if (options.dsn) {\n this._dsn = makeDsn(options.dsn);\n } else {\n DEBUG_BUILD && logger.warn('No DSN provided, client will not send events.');\n }\n\n if (this._dsn) {\n const url = getEnvelopeEndpointWithUrlEncodedAuth(\n this._dsn,\n options.tunnel,\n options._metadata ? options._metadata.sdk : undefined,\n );\n this._transport = options.transport({\n tunnel: this._options.tunnel,\n recordDroppedEvent: this.recordDroppedEvent.bind(this),\n ...options.transportOptions,\n url,\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n captureException(exception, hint, scope) {\n const eventId = uuid4();\n\n // ensure we haven't captured this very object before\n if (checkOrSetAlreadyCaught(exception)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return eventId;\n }\n\n const hintWithEventId = {\n event_id: eventId,\n ...hint,\n };\n\n this._process(\n this.eventFromException(exception, hintWithEventId).then(event =>\n this._captureEvent(event, hintWithEventId, scope),\n ),\n );\n\n return hintWithEventId.event_id;\n }\n\n /**\n * @inheritDoc\n */\n captureMessage(\n message,\n level,\n hint,\n currentScope,\n ) {\n const hintWithEventId = {\n event_id: uuid4(),\n ...hint,\n };\n\n const eventMessage = isParameterizedString(message) ? message : String(message);\n\n const promisedEvent = isPrimitive(message)\n ? this.eventFromMessage(eventMessage, level, hintWithEventId)\n : this.eventFromException(message, hintWithEventId);\n\n this._process(promisedEvent.then(event => this._captureEvent(event, hintWithEventId, currentScope)));\n\n return hintWithEventId.event_id;\n }\n\n /**\n * @inheritDoc\n */\n captureEvent(event, hint, currentScope) {\n const eventId = uuid4();\n\n // ensure we haven't captured this very object before\n if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return eventId;\n }\n\n const hintWithEventId = {\n event_id: eventId,\n ...hint,\n };\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope;\n\n this._process(this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope));\n\n return hintWithEventId.event_id;\n }\n\n /**\n * @inheritDoc\n */\n captureSession(session) {\n if (!(typeof session.release === 'string')) {\n DEBUG_BUILD && logger.warn('Discarded session because of missing or non-string release');\n } else {\n this.sendSession(session);\n // After sending, we set init false to indicate it's not the first occurrence\n updateSession(session, { init: false });\n }\n }\n\n /**\n * @inheritDoc\n */\n getDsn() {\n return this._dsn;\n }\n\n /**\n * @inheritDoc\n */\n getOptions() {\n return this._options;\n }\n\n /**\n * @see SdkMetadata in @sentry/types\n *\n * @return The metadata of the SDK\n */\n getSdkMetadata() {\n return this._options._metadata;\n }\n\n /**\n * @inheritDoc\n */\n getTransport() {\n return this._transport;\n }\n\n /**\n * @inheritDoc\n */\n flush(timeout) {\n const transport = this._transport;\n if (transport) {\n this.emit('flush');\n return this._isClientDoneProcessing(timeout).then(clientFinished => {\n return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n });\n } else {\n return resolvedSyncPromise(true);\n }\n }\n\n /**\n * @inheritDoc\n */\n close(timeout) {\n return this.flush(timeout).then(result => {\n this.getOptions().enabled = false;\n this.emit('close');\n return result;\n });\n }\n\n /** Get all installed event processors. */\n getEventProcessors() {\n return this._eventProcessors;\n }\n\n /** @inheritDoc */\n addEventProcessor(eventProcessor) {\n this._eventProcessors.push(eventProcessor);\n }\n\n /** @inheritdoc */\n init() {\n if (\n this._isEnabled() ||\n // Force integrations to be setup even if no DSN was set when we have\n // Spotlight enabled. This is particularly important for browser as we\n // don't support the `spotlight` option there and rely on the users\n // adding the `spotlightBrowserIntegration()` to their integrations which\n // wouldn't get initialized with the check below when there's no DSN set.\n this._options.integrations.some(({ name }) => name.startsWith('Spotlight'))\n ) {\n this._setupIntegrations();\n }\n }\n\n /**\n * Gets an installed integration by its name.\n *\n * @returns The installed integration or `undefined` if no integration with that `name` was installed.\n */\n getIntegrationByName(integrationName) {\n return this._integrations[integrationName] ;\n }\n\n /**\n * @inheritDoc\n */\n addIntegration(integration) {\n const isAlreadyInstalled = this._integrations[integration.name];\n\n // This hook takes care of only installing if not already installed\n setupIntegration(this, integration, this._integrations);\n // Here we need to check manually to make sure to not run this multiple times\n if (!isAlreadyInstalled) {\n afterSetupIntegrations(this, [integration]);\n }\n }\n\n /**\n * @inheritDoc\n */\n sendEvent(event, hint = {}) {\n this.emit('beforeSendEvent', event, hint);\n\n let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n for (const attachment of hint.attachments || []) {\n env = addItemToEnvelope(env, createAttachmentEnvelopeItem(attachment));\n }\n\n const promise = this.sendEnvelope(env);\n if (promise) {\n promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n }\n }\n\n /**\n * @inheritDoc\n */\n sendSession(session) {\n const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n\n // sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(env);\n }\n\n /**\n * @inheritDoc\n */\n recordDroppedEvent(reason, category, eventOrCount) {\n if (this._options.sendClientReports) {\n // TODO v9: We do not need the `event` passed as third argument anymore, and can possibly remove this overload\n // If event is passed as third argument, we assume this is a count of 1\n const count = typeof eventOrCount === 'number' ? eventOrCount : 1;\n\n // We want to track each category (error, transaction, session, replay_event) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`\n // With typescript 4.1 we could even use template literal types\n const key = `${reason}:${category}`;\n DEBUG_BUILD && logger.log(`Recording outcome: \"${key}\"${count > 1 ? ` (${count} times)` : ''}`);\n this._outcomes[key] = (this._outcomes[key] || 0) + count;\n }\n }\n\n // Keep on() & emit() signatures in sync with types' client.ts interface\n /* eslint-disable @typescript-eslint/unified-signatures */\n\n /** @inheritdoc */\n\n /** @inheritdoc */\n on(hook, callback) {\n const hooks = (this._hooks[hook] = this._hooks[hook] || []);\n\n // @ts-expect-error We assue the types are correct\n hooks.push(callback);\n\n // This function returns a callback execution handler that, when invoked,\n // deregisters a callback. This is crucial for managing instances where callbacks\n // need to be unregistered to prevent self-referencing in callback closures,\n // ensuring proper garbage collection.\n return () => {\n // @ts-expect-error We assue the types are correct\n const cbIndex = hooks.indexOf(callback);\n if (cbIndex > -1) {\n hooks.splice(cbIndex, 1);\n }\n };\n }\n\n /** @inheritdoc */\n\n /** @inheritdoc */\n emit(hook, ...rest) {\n const callbacks = this._hooks[hook];\n if (callbacks) {\n callbacks.forEach(callback => callback(...rest));\n }\n }\n\n /**\n * @inheritdoc\n */\n sendEnvelope(envelope) {\n this.emit('beforeEnvelope', envelope);\n\n if (this._isEnabled() && this._transport) {\n return this._transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending event:', reason);\n return reason;\n });\n }\n\n DEBUG_BUILD && logger.error('Transport disabled');\n\n return resolvedSyncPromise({});\n }\n\n /* eslint-enable @typescript-eslint/unified-signatures */\n\n /** Setup integrations for this client. */\n _setupIntegrations() {\n const { integrations } = this._options;\n this._integrations = setupIntegrations(this, integrations);\n afterSetupIntegrations(this, integrations);\n }\n\n /** Updates existing session based on the provided event */\n _updateSessionFromEvent(session, event) {\n let crashed = false;\n let errored = false;\n const exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n for (const ex of exceptions) {\n const mechanism = ex.mechanism;\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n }\n\n // A session is updated and that session update is sent in only one of the two following scenarios:\n // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n const sessionNonTerminal = session.status === 'ok';\n const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\n if (shouldUpdateAndSend) {\n updateSession(session, {\n ...(crashed && { status: 'crashed' }),\n errors: session.errors || Number(errored || crashed),\n });\n this.captureSession(session);\n }\n }\n\n /**\n * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n * `false` otherwise\n */\n _isClientDoneProcessing(timeout) {\n return new SyncPromise(resolve => {\n let ticked = 0;\n const tick = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }\n\n /** Determines whether this SDK is enabled and a transport is present. */\n _isEnabled() {\n return this.getOptions().enabled !== false && this._transport !== undefined;\n }\n\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param currentScope A scope containing event metadata.\n * @returns A new event with more information.\n */\n _prepareEvent(\n event,\n hint,\n currentScope,\n isolationScope = getIsolationScope(),\n ) {\n const options = this.getOptions();\n const integrations = Object.keys(this._integrations);\n if (!hint.integrations && integrations.length > 0) {\n hint.integrations = integrations;\n }\n\n this.emit('preprocessEvent', event, hint);\n\n if (!event.type) {\n isolationScope.setLastEventId(event.event_id || hint.event_id);\n }\n\n return prepareEvent(options, event, hint, currentScope, this, isolationScope).then(evt => {\n if (evt === null) {\n return evt;\n }\n\n const propagationContext = {\n ...isolationScope.getPropagationContext(),\n ...(currentScope ? currentScope.getPropagationContext() : undefined),\n };\n\n const trace = evt.contexts && evt.contexts.trace;\n if (!trace && propagationContext) {\n const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext;\n evt.contexts = {\n trace: dropUndefinedKeys({\n trace_id,\n span_id: spanId,\n parent_span_id: parentSpanId,\n }),\n ...evt.contexts,\n };\n\n const dynamicSamplingContext = dsc ? dsc : getDynamicSamplingContextFromClient(trace_id, this);\n\n evt.sdkProcessingMetadata = {\n dynamicSamplingContext,\n ...evt.sdkProcessingMetadata,\n };\n }\n return evt;\n });\n }\n\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n _captureEvent(event, hint = {}, scope) {\n return this._processEvent(event, hint, scope).then(\n finalEvent => {\n return finalEvent.event_id;\n },\n reason => {\n if (DEBUG_BUILD) {\n // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n // control flow, log just the message (no stack) as a log-level log.\n const sentryError = reason ;\n if (sentryError.logLevel === 'log') {\n logger.log(sentryError.message);\n } else {\n logger.warn(sentryError);\n }\n }\n return undefined;\n },\n );\n }\n\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param currentScope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n _processEvent(event, hint, currentScope) {\n const options = this.getOptions();\n const { sampleRate } = options;\n\n const isTransaction = isTransactionEvent(event);\n const isError = isErrorEvent(event);\n const eventType = event.type || 'error';\n const beforeSendLabel = `before send for type \\`${eventType}\\``;\n\n // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n const parsedSampleRate = typeof sampleRate === 'undefined' ? undefined : parseSampleRate(sampleRate);\n if (isError && typeof parsedSampleRate === 'number' && Math.random() > parsedSampleRate) {\n this.recordDroppedEvent('sample_rate', 'error', event);\n return rejectedSyncPromise(\n new SentryError(\n `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n 'log',\n ),\n );\n }\n\n const dataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope;\n\n return this._prepareEvent(event, hint, currentScope, capturedSpanIsolationScope)\n .then(prepared => {\n if (prepared === null) {\n this.recordDroppedEvent('event_processor', dataCategory, event);\n throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n }\n\n const isInternalException = hint.data && (hint.data ).__sentry__ === true;\n if (isInternalException) {\n return prepared;\n }\n\n const result = processBeforeSend(this, options, prepared, hint);\n return _validateBeforeSendResult(result, beforeSendLabel);\n })\n .then(processedEvent => {\n if (processedEvent === null) {\n this.recordDroppedEvent('before_send', dataCategory, event);\n if (isTransaction) {\n const spans = event.spans || [];\n // the transaction itself counts as one span, plus all the child spans that are added\n const spanCount = 1 + spans.length;\n this.recordDroppedEvent('before_send', 'span', spanCount);\n }\n throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n }\n\n const session = currentScope && currentScope.getSession();\n if (!isTransaction && session) {\n this._updateSessionFromEvent(session, processedEvent);\n }\n\n if (isTransaction) {\n const spanCountBefore =\n (processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing) ||\n 0;\n const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0;\n\n const droppedSpanCount = spanCountBefore - spanCountAfter;\n if (droppedSpanCount > 0) {\n this.recordDroppedEvent('before_send', 'span', droppedSpanCount);\n }\n }\n\n // None of the Sentry built event processor will update transaction name,\n // so if the transaction name has been changed by an event processor, we know\n // it has to come from custom event processor added by a user\n const transactionInfo = processedEvent.transaction_info;\n if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n const source = 'custom';\n processedEvent.transaction_info = {\n ...transactionInfo,\n source,\n };\n }\n\n this.sendEvent(processedEvent, hint);\n return processedEvent;\n })\n .then(null, reason => {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n this.captureException(reason, {\n data: {\n __sentry__: true,\n },\n originalException: reason,\n });\n throw new SentryError(\n `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n );\n });\n }\n\n /**\n * Occupies the client with processing and event\n */\n _process(promise) {\n this._numProcessing++;\n void promise.then(\n value => {\n this._numProcessing--;\n return value;\n },\n reason => {\n this._numProcessing--;\n return reason;\n },\n );\n }\n\n /**\n * Clears outcomes on this client and returns them.\n */\n _clearOutcomes() {\n const outcomes = this._outcomes;\n this._outcomes = {};\n return Object.entries(outcomes).map(([key, quantity]) => {\n const [reason, category] = key.split(':') ;\n return {\n reason,\n category,\n quantity,\n };\n });\n }\n\n /**\n * Sends client reports as an envelope.\n */\n _flushOutcomes() {\n DEBUG_BUILD && logger.log('Flushing outcomes...');\n\n const outcomes = this._clearOutcomes();\n\n if (outcomes.length === 0) {\n DEBUG_BUILD && logger.log('No outcomes to send');\n return;\n }\n\n // This is really the only place where we want to check for a DSN and only send outcomes then\n if (!this._dsn) {\n DEBUG_BUILD && logger.log('No dsn provided, will not send outcomes');\n return;\n }\n\n DEBUG_BUILD && logger.log('Sending outcomes:', outcomes);\n\n const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));\n\n // sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n beforeSendResult,\n beforeSendLabel,\n) {\n const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n if (isThenable(beforeSendResult)) {\n return beforeSendResult.then(\n event => {\n if (!isPlainObject(event) && event !== null) {\n throw new SentryError(invalidValueError);\n }\n return event;\n },\n e => {\n throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n },\n );\n } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n throw new SentryError(invalidValueError);\n }\n return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n client,\n options,\n event,\n hint,\n) {\n const { beforeSend, beforeSendTransaction, beforeSendSpan } = options;\n\n if (isErrorEvent(event) && beforeSend) {\n return beforeSend(event, hint);\n }\n\n if (isTransactionEvent(event)) {\n if (event.spans && beforeSendSpan) {\n const processedSpans = [];\n for (const span of event.spans) {\n const processedSpan = beforeSendSpan(span);\n if (processedSpan) {\n processedSpans.push(processedSpan);\n } else {\n client.recordDroppedEvent('before_send', 'span');\n }\n }\n event.spans = processedSpans;\n }\n\n if (beforeSendTransaction) {\n if (event.spans) {\n // We store the # of spans before processing in SDK metadata,\n // so we can compare it afterwards to determine how many spans were dropped\n const spanCountBefore = event.spans.length;\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n spanCountBeforeProcessing: spanCountBefore,\n };\n }\n return beforeSendTransaction(event, hint);\n }\n }\n\n return event;\n}\n\nfunction isErrorEvent(event) {\n return event.type === undefined;\n}\n\nfunction isTransactionEvent(event) {\n return event.type === 'transaction';\n}\n\nexport { BaseClient };\n//# sourceMappingURL=baseclient.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { getClient } from '@sentry/core';\nimport { addExceptionMechanism, resolvedSyncPromise, isErrorEvent, isDOMError, isDOMException, addExceptionTypeValue, isError, isPlainObject, isEvent, isParameterizedString, normalizeToSize, extractExceptionKeysForMessage } from '@sentry/utils';\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nfunction exceptionFromError(stackParser, ex) {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n const frames = parseStackFrames(stackParser, ex);\n\n const exception = {\n type: extractType(ex),\n value: extractMessage(ex),\n };\n\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\nfunction eventFromPlainObject(\n stackParser,\n exception,\n syntheticException,\n isUnhandledRejection,\n) {\n const client = getClient();\n const normalizeDepth = client && client.getOptions().normalizeDepth;\n\n // If we can, we extract an exception from the object properties\n const errorFromProp = getErrorPropertyFromObject(exception);\n\n const extra = {\n __serialized__: normalizeToSize(exception, normalizeDepth),\n };\n\n if (errorFromProp) {\n return {\n exception: {\n values: [exceptionFromError(stackParser, errorFromProp)],\n },\n extra,\n };\n }\n\n const event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n } ,\n ],\n },\n extra,\n } ;\n\n if (syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n // event.exception.values[0] has been set above\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values[0].stacktrace = { frames };\n }\n }\n\n return event;\n}\n\nfunction eventFromError(stackParser, ex) {\n return {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n}\n\n/** Parses stack frames from an error */\nfunction parseStackFrames(\n stackParser,\n ex,\n) {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace || ex.stack || '';\n\n const skipLines = getSkipFirstStackStringLines(ex);\n const framesToPop = getPopFirstTopFrames(ex);\n\n try {\n return stackParser(stacktrace, skipLines, framesToPop);\n } catch (e) {\n // no-empty\n }\n\n return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\n/**\n * Certain known React errors contain links that would be falsely\n * parsed as frames. This function check for these errors and\n * returns number of the stack string lines to skip.\n */\nfunction getSkipFirstStackStringLines(ex) {\n if (ex && reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n\n return 0;\n}\n\n/**\n * If error has `framesToPop` property, it means that the\n * creator tells us the first x frames will be useless\n * and should be discarded. Typically error from wrapper function\n * which don't point to the actual location in the developer's code.\n *\n * Example: https://github.com/zertosh/invariant/blob/master/invariant.js#L46\n */\nfunction getPopFirstTopFrames(ex) {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n return 0;\n}\n\n// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception\n// @ts-expect-error - WebAssembly.Exception is a valid class\nfunction isWebAssemblyException(exception) {\n // Check for support\n // @ts-expect-error - WebAssembly.Exception is a valid class\n if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') {\n // @ts-expect-error - WebAssembly.Exception is a valid class\n return exception instanceof WebAssembly.Exception;\n } else {\n return false;\n }\n}\n\n/**\n * Extracts from errors what we use as the exception `type` in error events.\n *\n * Usually, this is the `name` property on Error objects but WASM errors need to be treated differently.\n */\nfunction extractType(ex) {\n const name = ex && ex.name;\n\n // The name for WebAssembly.Exception Errors needs to be extracted differently.\n // Context: https://github.com/getsentry/sentry-javascript/issues/13787\n if (!name && isWebAssemblyException(ex)) {\n // Emscripten sets array[type, message] to the \"message\" property on the WebAssembly.Exception object\n const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2;\n return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception';\n }\n\n return name;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex) {\n const message = ex && ex.message;\n\n if (!message) {\n return 'No error message';\n }\n\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n\n // Emscripten sets array[type, message] to the \"message\" property on the WebAssembly.Exception object\n if (isWebAssemblyException(ex) && Array.isArray(ex.message) && ex.message.length == 2) {\n return ex.message[1];\n }\n\n return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nfunction eventFromException(\n stackParser,\n exception,\n hint,\n attachStacktrace,\n) {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nfunction eventFromMessage(\n stackParser,\n message,\n level = 'info',\n hint,\n attachStacktrace,\n) {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n event.level = level;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nfunction eventFromUnknownInput(\n stackParser,\n exception,\n syntheticException,\n attachStacktrace,\n isUnhandledRejection,\n) {\n let event;\n\n if (isErrorEvent(exception ) && (exception ).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception ;\n return eventFromError(stackParser, errorEvent.error );\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception) || isDOMException(exception )) {\n const domException = exception ;\n\n if ('stack' in (exception )) {\n event = eventFromError(stackParser, exception );\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n // eslint-disable-next-line deprecation/deprecation\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(stackParser, exception);\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n const objectException = exception ;\n event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(stackParser, exception , syntheticException, attachStacktrace);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\nfunction eventFromString(\n stackParser,\n message,\n syntheticException,\n attachStacktrace,\n) {\n const event = {};\n\n if (attachStacktrace && syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n event.exception = {\n values: [{ value: message, stacktrace: { frames } }],\n };\n }\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n exception,\n { isUnhandledRejection },\n) {\n const keys = extractExceptionKeysForMessage(exception);\n const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n }\n\n if (isEvent(exception)) {\n const className = getObjectClassName(exception);\n return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n }\n\n return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj) {\n try {\n const prototype = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch (e) {\n // ignore errors here\n }\n}\n\n/** If a plain object has a property that is an `Error`, return this error. */\nfunction getErrorPropertyFromObject(obj) {\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n const value = obj[prop];\n if (value instanceof Error) {\n return value;\n }\n }\n }\n\n return undefined;\n}\n\nexport { eventFromException, eventFromMessage, eventFromUnknownInput, exceptionFromError, extractMessage, extractType };\n//# sourceMappingURL=eventbuilder.js.map\n","import { withScope, captureException } from '@sentry/core';\nimport { GLOBAL_OBJ, getOriginalFunction, markFunctionWrapped, addNonEnumerableProperty, addExceptionTypeValue, addExceptionMechanism } from '@sentry/utils';\n\nconst WINDOW = GLOBAL_OBJ ;\n\nlet ignoreOnError = 0;\n\n/**\n * @hidden\n */\nfunction shouldIgnoreOnError() {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nfunction ignoreNextOnError() {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nfunction wrap(\n fn,\n options\n\n = {},\n before,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = fn.__sentry_wrapped__;\n if (wrapper) {\n if (typeof wrapper === 'function') {\n return wrapper;\n } else {\n // If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means\n // that something messed with it. In that case we want to return the originally passed function.\n return fn;\n }\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n /* eslint-disable prefer-rest-params */\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped = function () {\n const args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const wrappedArguments = args.map((arg) => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') ;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get() {\n return fn.name;\n },\n });\n }\n // eslint-disable-next-line no-empty\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n\nexport { WINDOW, ignoreNextOnError, shouldIgnoreOnError, wrap };\n//# sourceMappingURL=helpers.js.map\n","import { dsnToString, createEnvelope } from '@sentry/utils';\n\n/**\n * Creates an envelope from a user feedback.\n */\nfunction createUserFeedbackEnvelope(\n feedback,\n {\n metadata,\n tunnel,\n dsn,\n }\n\n,\n) {\n const headers = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata &&\n metadata.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback) {\n const feedbackHeaders = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n\nexport { createUserFeedbackEnvelope };\n//# sourceMappingURL=userfeedback.js.map\n","import { BaseClient, applySdkMetadata } from '@sentry/core';\nimport { getSDKSource, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { eventFromException, eventFromMessage } from './eventbuilder.js';\nimport { WINDOW } from './helpers.js';\nimport { createUserFeedbackEnvelope } from './userfeedback.js';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/types Options for more information.\n */\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nclass BrowserClient extends BaseClient {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n constructor(options) {\n const opts = {\n // We default this to true, as it is the safer scenario\n parentSpanIsAlwaysRootSpan: true,\n ...options,\n };\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n super(opts);\n\n if (opts.sendClientReports && WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n this._flushOutcomes();\n }\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n eventFromException(exception, hint) {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n eventFromMessage(\n message,\n level = 'info',\n hint,\n ) {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * Sends user feedback to Sentry.\n *\n * @deprecated Use `captureFeedback` instead.\n */\n captureUserFeedback(feedback) {\n if (!this._isEnabled()) {\n DEBUG_BUILD && logger.warn('SDK not enabled, will not capture user feedback.');\n return;\n }\n\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this.getSdkMetadata(),\n dsn: this.getDsn(),\n tunnel: this.getOptions().tunnel,\n });\n\n // sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n _prepareEvent(event, hint, scope) {\n event.platform = event.platform || 'javascript';\n return super._prepareEvent(event, hint, scope);\n }\n}\n\nexport { BrowserClient };\n//# sourceMappingURL=client.js.map\n","import { CONSOLE_LEVELS, originalConsoleMethods } from '../logger.js';\nimport { fill } from '../object.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';\n\n/**\n * Add an instrumentation handler for when a console.xxx method is called.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addConsoleInstrumentationHandler(handler) {\n const type = 'console';\n addHandler(type, handler);\n maybeInstrument(type, instrumentConsole);\n}\n\nfunction instrumentConsole() {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n CONSOLE_LEVELS.forEach(function (level) {\n if (!(level in GLOBAL_OBJ.console)) {\n return;\n }\n\n fill(GLOBAL_OBJ.console, level, function (originalConsoleMethod) {\n originalConsoleMethods[level] = originalConsoleMethod;\n\n return function (...args) {\n const handlerData = { args, level };\n triggerHandlers('console', handlerData);\n\n const log = originalConsoleMethods[level];\n log && log.apply(GLOBAL_OBJ.console, args);\n };\n });\n });\n}\n\nexport { addConsoleInstrumentationHandler };\n//# sourceMappingURL=console.js.map\n","import { isError } from '../is.js';\nimport { fill, addNonEnumerableProperty } from '../object.js';\nimport { supportsNativeFetch } from '../supports.js';\nimport { timestampInSeconds } from '../time.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addFetchInstrumentationHandler(\n handler,\n skipNativeFetchCheck,\n) {\n const type = 'fetch';\n addHandler(type, handler);\n maybeInstrument(type, () => instrumentFetch(undefined, skipNativeFetchCheck));\n}\n\n/**\n * Add an instrumentation handler for long-lived fetch requests, like consuming server-sent events (SSE) via fetch.\n * The handler will resolve the request body and emit the actual `endTimestamp`, so that the\n * span can be updated accordingly.\n *\n * Only used internally\n * @hidden\n */\nfunction addFetchEndInstrumentationHandler(handler) {\n const type = 'fetch-body-resolved';\n addHandler(type, handler);\n maybeInstrument(type, () => instrumentFetch(streamHandler));\n}\n\nfunction instrumentFetch(onFetchResolved, skipNativeFetchCheck = false) {\n if (skipNativeFetchCheck && !supportsNativeFetch()) {\n return;\n }\n\n fill(GLOBAL_OBJ, 'fetch', function (originalFetch) {\n return function (...args) {\n const { method, url } = parseFetchArgs(args);\n const handlerData = {\n args,\n fetchData: {\n method,\n url,\n },\n startTimestamp: timestampInSeconds() * 1000,\n };\n\n // if there is no callback, fetch is instrumented directly\n if (!onFetchResolved) {\n triggerHandlers('fetch', {\n ...handlerData,\n });\n }\n\n // We capture the stack right here and not in the Promise error callback because Safari (and probably other\n // browsers too) will wipe the stack trace up to this point, only leaving us with this file which is useless.\n\n // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the error, that was caused by your fetch call did not\n // have a stack trace, so the SDK backfilled the stack trace so\n // you can see which fetch call failed.\n const virtualStackTrace = new Error().stack;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalFetch.apply(GLOBAL_OBJ, args).then(\n async (response) => {\n if (onFetchResolved) {\n onFetchResolved(response);\n } else {\n triggerHandlers('fetch', {\n ...handlerData,\n endTimestamp: timestampInSeconds() * 1000,\n response,\n });\n }\n\n return response;\n },\n (error) => {\n triggerHandlers('fetch', {\n ...handlerData,\n endTimestamp: timestampInSeconds() * 1000,\n error,\n });\n\n if (isError(error) && error.stack === undefined) {\n // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the error, that was caused by your fetch call did not\n // have a stack trace, so the SDK backfilled the stack trace so\n // you can see which fetch call failed.\n error.stack = virtualStackTrace;\n addNonEnumerableProperty(error, 'framesToPop', 1);\n }\n\n // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the sentry.javascript SDK caught an error invoking your application code.\n // This is expected behavior and NOT indicative of a bug with sentry.javascript.\n throw error;\n },\n );\n };\n });\n}\n\nasync function resolveResponse(res, onFinishedResolving) {\n if (res && res.body) {\n const body = res.body;\n const responseReader = body.getReader();\n\n // Define a maximum duration after which we just cancel\n const maxFetchDurationTimeout = setTimeout(\n () => {\n body.cancel().then(null, () => {\n // noop\n });\n },\n 90 * 1000, // 90s\n );\n\n let readingActive = true;\n while (readingActive) {\n let chunkTimeout;\n try {\n // abort reading if read op takes more than 5s\n chunkTimeout = setTimeout(() => {\n body.cancel().then(null, () => {\n // noop on error\n });\n }, 5000);\n\n // This .read() call will reject/throw when we abort due to timeouts through `body.cancel()`\n const { done } = await responseReader.read();\n\n clearTimeout(chunkTimeout);\n\n if (done) {\n onFinishedResolving();\n readingActive = false;\n }\n } catch (error) {\n readingActive = false;\n } finally {\n clearTimeout(chunkTimeout);\n }\n }\n\n clearTimeout(maxFetchDurationTimeout);\n\n responseReader.releaseLock();\n body.cancel().then(null, () => {\n // noop on error\n });\n }\n}\n\nfunction streamHandler(response) {\n // clone response for awaiting stream\n let clonedResponseForResolving;\n try {\n clonedResponseForResolving = response.clone();\n } catch (e) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n resolveResponse(clonedResponseForResolving, () => {\n triggerHandlers('fetch-body-resolved', {\n endTimestamp: timestampInSeconds() * 1000,\n response,\n });\n });\n}\n\nfunction hasProp(obj, prop) {\n return !!obj && typeof obj === 'object' && !!(obj )[prop];\n}\n\nfunction getUrlFromResource(resource) {\n if (typeof resource === 'string') {\n return resource;\n }\n\n if (!resource) {\n return '';\n }\n\n if (hasProp(resource, 'url')) {\n return resource.url;\n }\n\n if (resource.toString) {\n return resource.toString();\n }\n\n return '';\n}\n\n/**\n * Parses the fetch arguments to find the used Http method and the url of the request.\n * Exported for tests only.\n */\nfunction parseFetchArgs(fetchArgs) {\n if (fetchArgs.length === 0) {\n return { method: 'GET', url: '' };\n }\n\n if (fetchArgs.length === 2) {\n const [url, options] = fetchArgs ;\n\n return {\n url: getUrlFromResource(url),\n method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',\n };\n }\n\n const arg = fetchArgs[0];\n return {\n url: getUrlFromResource(arg ),\n method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',\n };\n}\n\nexport { addFetchEndInstrumentationHandler, addFetchInstrumentationHandler, parseFetchArgs };\n//# sourceMappingURL=fetch.js.map\n","/**\n * Determine a breadcrumb's log level (only `warning` or `error`) based on an HTTP status code.\n */\nfunction getBreadcrumbLogLevelFromHttpStatusCode(statusCode) {\n // NOTE: undefined defaults to 'info' in Sentry\n if (statusCode === undefined) {\n return undefined;\n } else if (statusCode >= 400 && statusCode < 500) {\n return 'warning';\n } else if (statusCode >= 500) {\n return 'error';\n } else {\n return undefined;\n }\n}\n\nexport { getBreadcrumbLogLevelFromHttpStatusCode };\n//# sourceMappingURL=breadcrumb-log-level.js.map\n","/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not <a/> href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nfunction parseUrl(url) {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n search: query,\n hash: fragment,\n relative: match[5] + query + fragment, // everything minus origin\n };\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nfunction stripUrlQueryAndFragment(urlPath) {\n return (urlPath.split(/[?#]/, 1) )[0];\n}\n\n/**\n * Returns number of URL segments of a passed string URL.\n */\nfunction getNumberOfUrlSegments(url) {\n // split at '/' or at '\\/' to split regex urls correctly\n return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}\n\n/**\n * Takes a URL object and returns a sanitized string which is safe to use as span name\n * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data\n */\nfunction getSanitizedUrlString(url) {\n const { protocol, host, path } = url;\n\n const filteredHost =\n (host &&\n host\n // Always filter out authority\n .replace(/^.*@/, '[filtered]:[filtered]@')\n // Don't show standard :80 (http) and :443 (https) ports to reduce the noise\n // TODO: Use new URL global if it exists\n .replace(/(:80)$/, '')\n .replace(/(:443)$/, '')) ||\n '';\n\n return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;\n}\n\nexport { getNumberOfUrlSegments, getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment };\n//# sourceMappingURL=url.js.map\n","import { addClickKeypressInstrumentationHandler, addXhrInstrumentationHandler, addHistoryInstrumentationHandler, SENTRY_XHR_DATA_KEY } from '@sentry-internal/browser-utils';\nimport { defineIntegration, getClient, addBreadcrumb } from '@sentry/core';\nimport { addConsoleInstrumentationHandler, addFetchInstrumentationHandler, getEventDescription, logger, htmlTreeAsString, getComponentName, severityLevelFromString, safeJoin, getBreadcrumbLogLevelFromHttpStatusCode, parseUrl } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { WINDOW } from '../helpers.js';\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\nconst INTEGRATION_NAME = 'Breadcrumbs';\n\nconst _breadcrumbsIntegration = ((options = {}) => {\n const _options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n if (_options.console) {\n addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));\n }\n if (_options.dom) {\n addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));\n }\n if (_options.xhr) {\n addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));\n }\n if (_options.fetch) {\n addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));\n }\n if (_options.history) {\n addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));\n }\n if (_options.sentry) {\n client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));\n }\n },\n };\n}) ;\n\nconst breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);\n\n/**\n * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n */\nfunction _getSentryBreadcrumbHandler(client) {\n return function addSentryBreadcrumb(event) {\n if (getClient() !== client) {\n return;\n }\n\n addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n };\n}\n\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _getDomBreadcrumbHandler(\n client,\n dom,\n) {\n return function _innerDomBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n let target;\n let componentName;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n let maxStringLength =\n typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n );\n maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n }\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n const event = handlerData.event ;\n const element = _isEvent(event) ? event.target : event;\n\n target = htmlTreeAsString(element, { keyAttrs, maxStringLength });\n componentName = getComponentName(element);\n } catch (e) {\n target = '<unknown>';\n }\n\n if (target.length === 0) {\n return;\n }\n\n const breadcrumb = {\n category: `ui.${handlerData.name}`,\n message: target,\n };\n\n if (componentName) {\n breadcrumb.data = { 'ui.component_name': componentName };\n }\n\n addBreadcrumb(breadcrumb, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _getConsoleBreadcrumbHandler(client) {\n return function _consoleBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: severityLevelFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _getXhrBreadcrumbHandler(client) {\n return function _xhrBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n // We only capture complete, non-sentry requests\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = sentryXhrData;\n\n const data = {\n method,\n url,\n status_code,\n };\n\n const hint = {\n xhr: handlerData.xhr,\n input: body,\n startTimestamp,\n endTimestamp,\n };\n\n const level = getBreadcrumbLogLevelFromHttpStatusCode(status_code);\n\n addBreadcrumb(\n {\n category: 'xhr',\n data,\n type: 'http',\n level,\n },\n hint,\n );\n };\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _getFetchBreadcrumbHandler(client) {\n return function _fetchBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n // We only capture complete fetch requests\n if (!endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n if (handlerData.error) {\n const data = handlerData.fetchData;\n const hint = {\n data: handlerData.error,\n input: handlerData.args,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n level: 'error',\n type: 'http',\n },\n hint,\n );\n } else {\n const response = handlerData.response ;\n const data = {\n ...handlerData.fetchData,\n status_code: response && response.status,\n };\n const hint = {\n input: handlerData.args,\n response,\n startTimestamp,\n endTimestamp,\n };\n const level = getBreadcrumbLogLevelFromHttpStatusCode(data.status_code);\n\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n type: 'http',\n level,\n },\n hint,\n );\n }\n };\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _getHistoryBreadcrumbHandler(client) {\n return function _historyBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n let from = handlerData.from;\n let to = handlerData.to;\n const parsedLoc = parseUrl(WINDOW.location.href);\n let parsedFrom = from ? parseUrl(from) : undefined;\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom || !parsedFrom.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n };\n}\n\nfunction _isEvent(event) {\n return !!event && !!(event ).target;\n}\n\nexport { breadcrumbsIntegration };\n//# sourceMappingURL=breadcrumbs.js.map\n","import { defineIntegration } from '@sentry/core';\nimport { fill, getFunctionName, getOriginalFunction } from '@sentry/utils';\nimport { WINDOW, wrap } from '../helpers.js';\n\nconst DEFAULT_EVENT_TARGET = [\n 'EventTarget',\n 'Window',\n 'Node',\n 'ApplicationCache',\n 'AudioTrackList',\n 'BroadcastChannel',\n 'ChannelMergerNode',\n 'CryptoOperation',\n 'EventSource',\n 'FileReader',\n 'HTMLUnknownElement',\n 'IDBDatabase',\n 'IDBRequest',\n 'IDBTransaction',\n 'KeyOperation',\n 'MediaController',\n 'MessagePort',\n 'ModalWindow',\n 'Notification',\n 'SVGElementInstance',\n 'Screen',\n 'SharedWorker',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebSocket',\n 'WebSocketWorker',\n 'Worker',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload',\n];\n\nconst INTEGRATION_NAME = 'BrowserApiErrors';\n\nconst _browserApiErrorsIntegration = ((options = {}) => {\n const _options = {\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO: This currently only works for the first client this is setup\n // We may want to adjust this to check for client etc.\n setupOnce() {\n if (_options.setTimeout) {\n fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n }\n\n if (_options.setInterval) {\n fill(WINDOW, 'setInterval', _wrapTimeFunction);\n }\n\n if (_options.requestAnimationFrame) {\n fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n }\n\n if (_options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n }\n\n const eventTargetOption = _options.eventTarget;\n if (eventTargetOption) {\n const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(_wrapEventTarget);\n }\n },\n };\n}) ;\n\n/**\n * Wrap timer functions and event targets to catch errors and provide better meta data.\n */\nconst browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration);\n\nfunction _wrapTimeFunction(original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function ( ...args) {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: { function: getFunctionName(original) },\n handled: false,\n type: 'instrument',\n },\n });\n return original.apply(this, args);\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _wrapRAF(original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function ( callback) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return original.apply(this, [\n wrap(callback, {\n mechanism: {\n data: {\n function: 'requestAnimationFrame',\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n }),\n ]);\n };\n}\n\nfunction _wrapXHR(originalSend) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function ( ...args) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const xhr = this;\n const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n xmlHttpRequestProps.forEach(prop => {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fill(xhr, prop, function (original) {\n const wrapOptions = {\n mechanism: {\n data: {\n function: prop,\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n };\n\n // If Instrument integration has been called before BrowserApiErrors, get the name of original function\n const originalFunction = getOriginalFunction(original);\n if (originalFunction) {\n wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n }\n\n // Otherwise wrap directly\n return wrap(original, wrapOptions);\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n}\n\nfunction _wrapEventTarget(target) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const globalObject = WINDOW ;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = globalObject[target] && globalObject[target].prototype;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original,)\n\n {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n eventName,\n fn,\n options,\n ) {\n try {\n if (typeof fn.handleEvent === 'function') {\n // ESlint disable explanation:\n // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n // introduce a bug here, because bind returns a new function that doesn't have our\n // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n // Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n fn.handleEvent = wrap(fn.handleEvent, {\n mechanism: {\n data: {\n function: 'handleEvent',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n });\n }\n } catch (err) {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.apply(this, [\n eventName,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrap(fn , {\n mechanism: {\n data: {\n function: 'addEventListener',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n }),\n options,\n ]);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (\n originalRemoveEventListener,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n eventName,\n fn,\n options,\n ) {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n const wrappedEventHandler = fn ;\n try {\n const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch (e) {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n };\n },\n );\n}\n\nexport { browserApiErrorsIntegration };\n//# sourceMappingURL=browserapierrors.js.map\n","import { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';\n\nlet _oldOnErrorHandler = null;\n\n/**\n * Add an instrumentation handler for when an error is captured by the global error handler.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addGlobalErrorInstrumentationHandler(handler) {\n const type = 'error';\n addHandler(type, handler);\n maybeInstrument(type, instrumentError);\n}\n\nfunction instrumentError() {\n _oldOnErrorHandler = GLOBAL_OBJ.onerror;\n\n GLOBAL_OBJ.onerror = function (\n msg,\n url,\n line,\n column,\n error,\n ) {\n const handlerData = {\n column,\n error,\n line,\n msg,\n url,\n };\n triggerHandlers('error', handlerData);\n\n if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n\n GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;\n}\n\nexport { addGlobalErrorInstrumentationHandler };\n//# sourceMappingURL=globalError.js.map\n","import { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';\n\nlet _oldOnUnhandledRejectionHandler = null;\n\n/**\n * Add an instrumentation handler for when an unhandled promise rejection is captured.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addGlobalUnhandledRejectionInstrumentationHandler(\n handler,\n) {\n const type = 'unhandledrejection';\n addHandler(type, handler);\n maybeInstrument(type, instrumentUnhandledRejection);\n}\n\nfunction instrumentUnhandledRejection() {\n _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection;\n\n GLOBAL_OBJ.onunhandledrejection = function (e) {\n const handlerData = e;\n triggerHandlers('unhandledrejection', handlerData);\n\n if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n\n GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;\n}\n\nexport { addGlobalUnhandledRejectionInstrumentationHandler };\n//# sourceMappingURL=globalUnhandledRejection.js.map\n","import { defineIntegration, getClient, captureEvent } from '@sentry/core';\nimport { addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, isPrimitive, isString, getLocationHref, UNKNOWN_FUNCTION, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { eventFromUnknownInput } from '../eventbuilder.js';\nimport { shouldIgnoreOnError } from '../helpers.js';\n\nconst INTEGRATION_NAME = 'GlobalHandlers';\n\nconst _globalHandlersIntegration = ((options = {}) => {\n const _options = {\n onerror: true,\n onunhandledrejection: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n Error.stackTraceLimit = 50;\n },\n setup(client) {\n if (_options.onerror) {\n _installGlobalOnErrorHandler(client);\n globalHandlerLog('onerror');\n }\n if (_options.onunhandledrejection) {\n _installGlobalOnUnhandledRejectionHandler(client);\n globalHandlerLog('onunhandledrejection');\n }\n },\n };\n}) ;\n\nconst globalHandlersIntegration = defineIntegration(_globalHandlersIntegration);\n\nfunction _installGlobalOnErrorHandler(client) {\n addGlobalErrorInstrumentationHandler(data => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const { msg, url, line, column, error } = data;\n\n const event = _enhanceEventWithInitialFrame(\n eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n url,\n line,\n column,\n );\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onerror',\n },\n });\n });\n}\n\nfunction _installGlobalOnUnhandledRejectionHandler(client) {\n addGlobalUnhandledRejectionInstrumentationHandler(e => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const error = _getUnhandledRejectionError(e );\n\n const event = isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onunhandledrejection',\n },\n });\n });\n}\n\nfunction _getUnhandledRejectionError(error) {\n if (isPrimitive(error)) {\n return error;\n }\n\n // dig the object of the rejection out of known event types\n try {\n\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in (error )) {\n return (error ).reason;\n }\n\n // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n if ('detail' in (error ) && 'reason' in (error ).detail) {\n return (error ).detail.reason;\n }\n } catch (e2) {} // eslint-disable-line no-empty\n\n return error;\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nfunction _eventFromRejectionWithPrimitive(reason) {\n return {\n exception: {\n values: [\n {\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n },\n ],\n },\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _enhanceEventWithInitialFrame(event, url, line, column) {\n // event.exception\n const e = (event.exception = event.exception || {});\n // event.exception.values\n const ev = (e.values = e.values || []);\n // event.exception.values[0]\n const ev0 = (ev[0] = ev[0] || {});\n // event.exception.values[0].stacktrace\n const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n // event.exception.values[0].stacktrace.frames\n const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n // event.exception.values[0].stacktrace.frames\n if (ev0sf.length === 0) {\n ev0sf.push({\n colno,\n filename,\n function: UNKNOWN_FUNCTION,\n in_app: true,\n lineno,\n });\n }\n\n return event;\n}\n\nfunction globalHandlerLog(type) {\n DEBUG_BUILD && logger.log(`Global Handler attached: ${type}`);\n}\n\nfunction getOptions() {\n const client = getClient();\n const options = (client && client.getOptions()) || {\n stackParser: () => [],\n attachStacktrace: false,\n };\n return options;\n}\n\nexport { globalHandlersIntegration };\n//# sourceMappingURL=globalhandlers.js.map\n","import { defineIntegration } from '@sentry/core';\nimport { WINDOW } from '../helpers.js';\n\n/**\n * Collects information about HTTP request headers and\n * attaches them to the event.\n */\nconst httpContextIntegration = defineIntegration(() => {\n return {\n name: 'HttpContext',\n preprocessEvent(event) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n // grab as much info as exists and add it to the event\n const url = (event.request && event.request.url) || (WINDOW.location && WINDOW.location.href);\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(event.request && event.request.headers),\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = { ...event.request, ...(url && { url }), headers };\n\n event.request = request;\n },\n };\n});\n\nexport { httpContextIntegration };\n//# sourceMappingURL=httpcontext.js.map\n","import { isInstanceOf } from './is.js';\nimport { truncate } from './string.js';\n\n/**\n * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter.\n */\nfunction applyAggregateErrorsToEvent(\n exceptionFromErrorImplementation,\n parser,\n maxValueLimit = 250,\n key,\n limit,\n event,\n hint,\n) {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error\n const originalException =\n event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined;\n\n // We only create exception grouping if there is an exception in the event.\n if (originalException) {\n event.exception.values = truncateAggregateExceptions(\n aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n hint.originalException ,\n key,\n event.exception.values,\n originalException,\n 0,\n ),\n maxValueLimit,\n );\n }\n}\n\nfunction aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error,\n key,\n prevExceptions,\n exception,\n exceptionId,\n) {\n if (prevExceptions.length >= limit + 1) {\n return prevExceptions;\n }\n\n let newExceptions = [...prevExceptions];\n\n // Recursively call this function in order to walk down a chain of errors\n if (isInstanceOf(error[key], Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, error[key]);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error[key],\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n\n // This will create exception grouping for AggregateErrors\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n if (Array.isArray(error.errors)) {\n error.errors.forEach((childError, i) => {\n if (isInstanceOf(childError, Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, childError);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n childError,\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n });\n }\n\n return newExceptions;\n}\n\nfunction applyExceptionGroupFieldsForParentException(exception, exceptionId) {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n ...(exception.type === 'AggregateError' && { is_exception_group: true }),\n exception_id: exceptionId,\n };\n}\n\nfunction applyExceptionGroupFieldsForChildException(\n exception,\n source,\n exceptionId,\n parentId,\n) {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n type: 'chained',\n source,\n exception_id: exceptionId,\n parent_id: parentId,\n };\n}\n\n/**\n * Truncate the message (exception.value) of all exceptions in the event.\n * Because this event processor is ran after `applyClientOptions`,\n * we need to truncate the message of the added exceptions here.\n */\nfunction truncateAggregateExceptions(exceptions, maxValueLength) {\n return exceptions.map(exception => {\n if (exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n return exception;\n });\n}\n\nexport { applyAggregateErrorsToEvent };\n//# sourceMappingURL=aggregate-errors.js.map\n","import { defineIntegration } from '@sentry/core';\nimport { applyAggregateErrorsToEvent } from '@sentry/utils';\nimport { exceptionFromError } from '../eventbuilder.js';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\nconst INTEGRATION_NAME = 'LinkedErrors';\n\nconst _linkedErrorsIntegration = ((options = {}) => {\n const limit = options.limit || DEFAULT_LIMIT;\n const key = options.key || DEFAULT_KEY;\n\n return {\n name: INTEGRATION_NAME,\n preprocessEvent(event, hint, client) {\n const options = client.getOptions();\n\n applyAggregateErrorsToEvent(\n // This differs from the LinkedErrors integration in core by using a different exceptionFromError function\n exceptionFromError,\n options.stackParser,\n options.maxValueLength,\n key,\n limit,\n event,\n hint,\n );\n },\n };\n}) ;\n\n/**\n * Aggregrate linked errors in an event.\n */\nconst linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration);\n\nexport { linkedErrorsIntegration };\n//# sourceMappingURL=linkederrors.js.map\n","import { createStackParser, UNKNOWN_FUNCTION } from '@sentry/utils';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename, func, lineno, colno) {\n const frame = {\n filename,\n function: func === '<anonymous>' ? UNKNOWN_FUNCTION : func,\n in_app: true, // All browser frames are considered in_app\n };\n\n if (lineno !== undefined) {\n frame.lineno = lineno;\n }\n\n if (colno !== undefined) {\n frame.colno = colno;\n }\n\n return frame;\n}\n\n// This regex matches frames that have no function name (ie. are at the top level of a module).\n// For example \"at http://localhost:5000//script.js:1:126\"\n// Frames _with_ function names usually look as follows: \"at commitLayoutEffects (react-dom.development.js:23426:1)\"\nconst chromeRegexNoFnName = /^\\s*at (\\S+?)(?::(\\d+))(?::(\\d+))\\s*$/i;\n\n// This regex matches all the frames that have a function name.\nconst chromeRegex =\n /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\n\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\n// We cannot call this variable `chrome` because it can conflict with global `chrome` variable in certain environments\n// See: https://github.com/getsentry/sentry-javascript/issues/6880\nconst chromeStackParserFn = line => {\n // If the stack line has no function name, we need to parse it differently\n const noFnParts = chromeRegexNoFnName.exec(line) ;\n\n if (noFnParts) {\n const [, filename, line, col] = noFnParts;\n return createFrame(filename, UNKNOWN_FUNCTION, +line, +col);\n }\n\n const parts = chromeRegex.exec(line) ;\n\n if (parts) {\n const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n if (isEval) {\n const subMatch = chromeEvalRegex.exec(parts[2]) ;\n\n if (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 }\n\n // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n }\n\n return;\n};\n\nconst chromeStackLineParser = [CHROME_PRIORITY, chromeStackParserFn];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko = line => {\n const parts = geckoREgex.exec(line) ;\n\n if (parts) {\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval) {\n const subMatch = geckoEvalRegex.exec(parts[3]) ;\n\n if (subMatch) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = ''; // no column when eval\n }\n }\n\n let filename = parts[3];\n let func = parts[1] || UNKNOWN_FUNCTION;\n [func, filename] = extractSafariExtensionDetails(func, filename);\n\n return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n }\n\n return;\n};\n\nconst geckoStackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:[-a-z]+):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs = line => {\n const parts = winjsRegex.exec(line) ;\n\n return parts\n ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n : undefined;\n};\n\nconst winjsStackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10 = line => {\n const parts = opera10Regex.exec(line) ;\n return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nconst opera10StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11 = line => {\n const parts = opera11Regex.exec(line) ;\n return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nconst opera11StackLineParser = [OPERA11_PRIORITY, opera11];\n\nconst defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser];\n\nconst defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n * at function@url:row:col\n * at function@url:row:col\n * at function@url:row:col\n *\n * it produces something like:\n *\n * function@url:row:col\n * function@url:row:col\n * function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func, filename) => {\n const isSafariExtension = func.indexOf('safari-extension') !== -1;\n const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n return isSafariExtension || isSafariWebExtension\n ? [\n func.indexOf('@') !== -1 ? (func.split('@')[0] ) : UNKNOWN_FUNCTION,\n isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,\n ]\n : [func, filename];\n};\n\nexport { chromeStackLineParser, defaultStackLineParsers, defaultStackParser, geckoStackLineParser, opera10StackLineParser, opera11StackLineParser, winjsStackLineParser };\n//# sourceMappingURL=stack-parsers.js.map\n","import { SentryError } from './error.js';\nimport { rejectedSyncPromise, SyncPromise, resolvedSyncPromise } from './syncpromise.js';\n\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\nfunction makePromiseBuffer(limit) {\n const buffer = [];\n\n function isReady() {\n return limit === undefined || buffer.length < limit;\n }\n\n /**\n * Remove a promise from the queue.\n *\n * @param task Can be any PromiseLike<T>\n * @returns Removed promise.\n */\n function remove(task) {\n return buffer.splice(buffer.indexOf(task), 1)[0] || Promise.resolve(undefined);\n }\n\n /**\n * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n *\n * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task:\n * PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor\n * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n * limit check.\n * @returns The original promise.\n */\n function add(taskProducer) {\n if (!isReady()) {\n return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));\n }\n\n // start the task and add its promise to the queue\n const task = taskProducer();\n if (buffer.indexOf(task) === -1) {\n buffer.push(task);\n }\n void task\n .then(() => remove(task))\n // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n // have promises, so TS has to polyfill when down-compiling.)\n .then(null, () =>\n remove(task).then(null, () => {\n // We have to add another catch here because `remove()` starts a new promise chain.\n }),\n );\n return task;\n }\n\n /**\n * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n * `false` otherwise\n */\n function drain(timeout) {\n return new SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void resolvedSyncPromise(item).then(() => {\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }\n\n return {\n $: buffer,\n add,\n drain,\n };\n}\n\nexport { makePromiseBuffer };\n//# sourceMappingURL=promisebuffer.js.map\n","import { makePromiseBuffer, forEachEnvelopeItem, envelopeItemTypeToDataCategory, isRateLimited, resolvedSyncPromise, createEnvelope, SentryError, logger, serializeEnvelope, updateRateLimits } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\n\nconst DEFAULT_TRANSPORT_BUFFER_SIZE = 64;\n\n/**\n * Creates an instance of a Sentry `Transport`\n *\n * @param options\n * @param makeRequest\n */\nfunction createTransport(\n options,\n makeRequest,\n buffer = makePromiseBuffer(\n options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,\n ),\n) {\n let rateLimits = {};\n const flush = (timeout) => buffer.drain(timeout);\n\n function send(envelope) {\n const filteredEnvelopeItems = [];\n\n // Drop rate limited items from envelope\n forEachEnvelopeItem(envelope, (item, type) => {\n const dataCategory = envelopeItemTypeToDataCategory(type);\n if (isRateLimited(rateLimits, dataCategory)) {\n const event = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent('ratelimit_backoff', dataCategory, event);\n } else {\n filteredEnvelopeItems.push(item);\n }\n });\n\n // Skip sending if envelope is empty after filtering out rate limited events\n if (filteredEnvelopeItems.length === 0) {\n return resolvedSyncPromise({});\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems );\n\n // Creates client report for each item in an envelope\n const recordEnvelopeLoss = (reason) => {\n forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n const event = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);\n });\n };\n\n const requestTask = () =>\n makeRequest({ body: serializeEnvelope(filteredEnvelope) }).then(\n response => {\n // We don't want to throw on NOK responses, but we want to at least log them\n if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {\n DEBUG_BUILD && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n }\n\n rateLimits = updateRateLimits(rateLimits, response);\n return response;\n },\n error => {\n recordEnvelopeLoss('network_error');\n throw error;\n },\n );\n\n return buffer.add(requestTask).then(\n result => result,\n error => {\n if (error instanceof SentryError) {\n DEBUG_BUILD && logger.error('Skipped sending event because buffer is full.');\n recordEnvelopeLoss('queue_overflow');\n return resolvedSyncPromise({});\n } else {\n throw error;\n }\n },\n );\n }\n\n return {\n send,\n flush,\n };\n}\n\nfunction getEventForEnvelopeItem(item, type) {\n if (type !== 'event' && type !== 'transaction') {\n return undefined;\n }\n\n return Array.isArray(item) ? (item )[1] : undefined;\n}\n\nexport { DEFAULT_TRANSPORT_BUFFER_SIZE, createTransport };\n//# sourceMappingURL=base.js.map\n","import { getNativeImplementation, clearCachedImplementation } from '@sentry-internal/browser-utils';\nimport { createTransport } from '@sentry/core';\nimport { rejectedSyncPromise } from '@sentry/utils';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nfunction makeFetchTransport(\n options,\n nativeFetch = getNativeImplementation('fetch'),\n) {\n let pendingBodySize = 0;\n let pendingCount = 0;\n\n function makeRequest(request) {\n const requestSize = request.body.length;\n pendingBodySize += requestSize;\n pendingCount++;\n\n const requestOptions = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'origin',\n headers: options.headers,\n // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).\n // Gotchas:\n // - `keepalive` isn't supported by Firefox\n // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n // We will therefore only activate the flag when we're below that limit.\n // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n keepalive: pendingBodySize <= 60000 && pendingCount < 15,\n ...options.fetchOptions,\n };\n\n if (!nativeFetch) {\n clearCachedImplementation('fetch');\n return rejectedSyncPromise('No fetch implementation available');\n }\n\n try {\n // TODO: This may need a `suppresTracing` call in the future when we switch the browser SDK to OTEL\n return nativeFetch(options.url, requestOptions).then(response => {\n pendingBodySize -= requestSize;\n pendingCount--;\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n });\n } catch (e) {\n clearCachedImplementation('fetch');\n pendingBodySize -= requestSize;\n pendingCount--;\n return rejectedSyncPromise(e);\n }\n }\n\n return createTransport(options, makeRequest);\n}\n\nexport { makeFetchTransport };\n//# sourceMappingURL=fetch.js.map\n","import { inboundFiltersIntegration, functionToStringIntegration, dedupeIntegration, getIntegrationsToSetup, initAndBind, getCurrentScope, lastEventId, getReportDialogEndpoint, startSession, captureSession, getClient } from '@sentry/core';\nimport { consoleSandbox, supportsFetch, logger, stackParserFromStackParserOptions } from '@sentry/utils';\nimport { addHistoryInstrumentationHandler } from '@sentry-internal/browser-utils';\nimport { BrowserClient } from './client.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { WINDOW } from './helpers.js';\nimport { breadcrumbsIntegration } from './integrations/breadcrumbs.js';\nimport { browserApiErrorsIntegration } from './integrations/browserapierrors.js';\nimport { globalHandlersIntegration } from './integrations/globalhandlers.js';\nimport { httpContextIntegration } from './integrations/httpcontext.js';\nimport { linkedErrorsIntegration } from './integrations/linkederrors.js';\nimport { defaultStackParser } from './stack-parsers.js';\nimport { makeFetchTransport } from './transports/fetch.js';\n\n/** Get the default integrations for the browser SDK. */\nfunction getDefaultIntegrations(_options) {\n /**\n * Note: Please make sure this stays in sync with Angular SDK, which re-exports\n * `getDefaultIntegrations` but with an adjusted set of integrations.\n */\n return [\n inboundFiltersIntegration(),\n functionToStringIntegration(),\n browserApiErrorsIntegration(),\n breadcrumbsIntegration(),\n globalHandlersIntegration(),\n linkedErrorsIntegration(),\n dedupeIntegration(),\n httpContextIntegration(),\n ];\n}\n\nfunction applyDefaultOptions(optionsArg = {}) {\n const defaultOptions = {\n defaultIntegrations: getDefaultIntegrations(),\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE && WINDOW.SENTRY_RELEASE.id // This supports the variable that sentry-webpack-plugin injects\n ? WINDOW.SENTRY_RELEASE.id\n : undefined,\n autoSessionTracking: true,\n sendClientReports: true,\n };\n\n // TODO: Instead of dropping just `defaultIntegrations`, we should simply\n // call `dropUndefinedKeys` on the entire `optionsArg`.\n // However, for this to work we need to adjust the `hasTracingEnabled()` logic\n // first as it differentiates between `undefined` and the key not being in the object.\n if (optionsArg.defaultIntegrations == null) {\n delete optionsArg.defaultIntegrations;\n }\n\n return { ...defaultOptions, ...optionsArg };\n}\n\nfunction shouldShowBrowserExtensionError() {\n const windowWithMaybeExtension =\n typeof WINDOW.window !== 'undefined' && (WINDOW );\n if (!windowWithMaybeExtension) {\n // No need to show the error if we're not in a browser window environment (e.g. service workers)\n return false;\n }\n\n const extensionKey = windowWithMaybeExtension.chrome ? 'chrome' : 'browser';\n const extensionObject = windowWithMaybeExtension[extensionKey];\n\n const runtimeId = extensionObject && extensionObject.runtime && extensionObject.runtime.id;\n const href = (WINDOW.location && WINDOW.location.href) || '';\n\n const extensionProtocols = ['chrome-extension:', 'moz-extension:', 'ms-browser-extension:', 'safari-web-extension:'];\n\n // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage\n const isDedicatedExtensionPage =\n !!runtimeId && WINDOW === WINDOW.top && extensionProtocols.some(protocol => href.startsWith(`${protocol}//`));\n\n // Running the SDK in NW.js, which appears like a browser extension but isn't, is also fine\n // see: https://github.com/getsentry/sentry-javascript/issues/12668\n const isNWjs = typeof windowWithMaybeExtension.nw !== 'undefined';\n\n return !!runtimeId && !isDedicatedExtensionPage && !isNWjs;\n}\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nfunction init(browserOptions = {}) {\n const options = applyDefaultOptions(browserOptions);\n\n if (shouldShowBrowserExtensionError()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(\n '[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',\n );\n });\n return;\n }\n\n if (DEBUG_BUILD) {\n if (!supportsFetch()) {\n logger.warn(\n 'No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill.',\n );\n }\n }\n const clientOptions = {\n ...options,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup(options),\n transport: options.transport || makeFetchTransport,\n };\n\n const client = initAndBind(BrowserClient, clientOptions);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\n\n return client;\n}\n\n/**\n * All properties the report dialog supports\n */\n\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\nfunction showReportDialog(options = {}) {\n // doesn't work without a document (React Native)\n if (!WINDOW.document) {\n DEBUG_BUILD && logger.error('Global document not defined in showReportDialog call');\n return;\n }\n\n const scope = getCurrentScope();\n const client = scope.getClient();\n const dsn = client && client.getDsn();\n\n if (!dsn) {\n DEBUG_BUILD && logger.error('DSN not configured for showReportDialog call');\n return;\n }\n\n if (scope) {\n options.user = {\n ...scope.getUser(),\n ...options.user,\n };\n }\n\n if (!options.eventId) {\n const eventId = lastEventId();\n if (eventId) {\n options.eventId = eventId;\n }\n }\n\n const script = WINDOW.document.createElement('script');\n script.async = true;\n script.crossOrigin = 'anonymous';\n script.src = getReportDialogEndpoint(dsn, options);\n\n if (options.onLoad) {\n script.onload = options.onLoad;\n }\n\n const { onClose } = options;\n if (onClose) {\n const reportDialogClosedMessageHandler = (event) => {\n if (event.data === '__sentry_reportdialog_closed__') {\n try {\n onClose();\n } finally {\n WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);\n }\n }\n };\n WINDOW.addEventListener('message', reportDialogClosedMessageHandler);\n }\n\n const injectionPoint = WINDOW.document.head || WINDOW.document.body;\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n } else {\n DEBUG_BUILD && logger.error('Not injecting report dialog. No injection point found in HTML');\n }\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nfunction forceLoad() {\n // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nfunction onLoad(callback) {\n callback();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking() {\n if (typeof WINDOW.document === 'undefined') {\n DEBUG_BUILD && logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n startSession({ ignoreDuration: true });\n captureSession();\n\n // We want to create a session for every navigation as well\n addHistoryInstrumentationHandler(({ from, to }) => {\n // Don't create an additional session for the initial route or if the location did not change\n if (from !== undefined && from !== to) {\n startSession({ ignoreDuration: true });\n captureSession();\n }\n });\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n *\n * @deprecated Use `captureFeedback` instead.\n */\nfunction captureUserFeedback(feedback) {\n const client = getClient();\n if (client) {\n // eslint-disable-next-line deprecation/deprecation\n client.captureUserFeedback(feedback);\n }\n}\n\nexport { captureUserFeedback, forceLoad, getDefaultIntegrations, init, onLoad, showReportDialog };\n//# sourceMappingURL=sdk.js.map\n","import { setContext, init as init$1 } from '@sentry/browser';\nimport { applySdkMetadata } from '@sentry/core';\nimport { version } from 'react';\n\n/**\n * Inits the React SDK\n */\nfunction init(options) {\n const opts = {\n ...options,\n };\n\n applySdkMetadata(opts, 'react');\n setContext('react', { version });\n return init$1(opts);\n}\n\nexport { init };\n//# sourceMappingURL=sdk.js.map\n","/**\n * Returns an environment setting value determined by Vercel's `VERCEL_ENV` environment variable.\n *\n * @param isClient Flag to indicate whether to use the `NEXT_PUBLIC_` prefixed version of the environment variable.\n */\nfunction getVercelEnv(isClient) {\n const vercelEnvVar = isClient ? process.env.NEXT_PUBLIC_VERCEL_ENV : process.env.VERCEL_ENV;\n return vercelEnvVar ? `vercel-${vercelEnvVar}` : undefined;\n}\n\nexport { getVercelEnv };\n//# sourceMappingURL=getVercelEnv.js.map\n","import { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { spanToJSON, spanIsSampled, getRootSpan } from '../utils/spanUtils.js';\n\n/**\n * Print a log message for a started span.\n */\nfunction logSpanStart(span) {\n if (!DEBUG_BUILD) return;\n\n const { description = '< unknown name >', op = '< unknown op >', parent_span_id: parentSpanId } = spanToJSON(span);\n const { spanId } = span.spanContext();\n\n const sampled = spanIsSampled(span);\n const rootSpan = getRootSpan(span);\n const isRootSpan = rootSpan === span;\n\n const header = `[Tracing] Starting ${sampled ? 'sampled' : 'unsampled'} ${isRootSpan ? 'root ' : ''}span`;\n\n const infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`];\n\n if (parentSpanId) {\n infoParts.push(`parent ID: ${parentSpanId}`);\n }\n\n if (!isRootSpan) {\n const { op, description } = spanToJSON(rootSpan);\n infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`);\n if (op) {\n infoParts.push(`root op: ${op}`);\n }\n if (description) {\n infoParts.push(`root description: ${description}`);\n }\n }\n\n logger.log(`${header}\n ${infoParts.join('\\n ')}`);\n}\n\n/**\n * Print a log message for an ended span.\n */\nfunction logSpanEnd(span) {\n if (!DEBUG_BUILD) return;\n\n const { description = '< unknown name >', op = '< unknown op >' } = spanToJSON(span);\n const { spanId } = span.spanContext();\n const rootSpan = getRootSpan(span);\n const isRootSpan = rootSpan === span;\n\n const msg = `[Tracing] Finishing \"${op}\" ${isRootSpan ? 'root ' : ''}span \"${description}\" with ID ${spanId}`;\n logger.log(msg);\n}\n\nexport { logSpanEnd, logSpanStart };\n//# sourceMappingURL=logSpans.js.map\n","import { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled.js';\nimport { parseSampleRate } from '../utils/parseSampleRate.js';\n\n/**\n * Makes a sampling decision for the given options.\n *\n * Called every time a root span is created. Only root spans which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n */\nfunction sampleSpan(\n options,\n samplingContext,\n) {\n // nothing to do if tracing is not enabled\n if (!hasTracingEnabled(options)) {\n return [false];\n }\n\n // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n // work; prefer the hook if so\n let sampleRate;\n if (typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler(samplingContext);\n } else if (samplingContext.parentSampled !== undefined) {\n sampleRate = samplingContext.parentSampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n } else {\n // When `enableTracing === true`, we use a sample rate of 100%\n sampleRate = 1;\n }\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get.\n // (The only valid values are booleans or numbers between 0 and 1.)\n const parsedSampleRate = parseSampleRate(sampleRate);\n\n if (parsedSampleRate === undefined) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n return [false];\n }\n\n // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n if (!parsedSampleRate) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because ${\n typeof options.tracesSampler === 'function'\n ? 'tracesSampler returned 0 or false'\n : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n }`,\n );\n return [false, parsedSampleRate];\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n const shouldSample = Math.random() < parsedSampleRate;\n\n // if we're not going to keep it, we're done\n if (!shouldSample) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n sampleRate,\n )})`,\n );\n return [false, parsedSampleRate];\n }\n\n return [true, parsedSampleRate];\n}\n\nexport { sampleSpan };\n//# sourceMappingURL=sampling.js.map\n","import { uuid4 } from '@sentry/utils';\nimport { TRACE_FLAG_NONE } from '../utils/spanUtils.js';\n\n/**\n * A Sentry Span that is non-recording, meaning it will not be sent to Sentry.\n */\nclass SentryNonRecordingSpan {\n\n constructor(spanContext = {}) {\n this._traceId = spanContext.traceId || uuid4();\n this._spanId = spanContext.spanId || uuid4().substring(16);\n }\n\n /** @inheritdoc */\n spanContext() {\n return {\n spanId: this._spanId,\n traceId: this._traceId,\n traceFlags: TRACE_FLAG_NONE,\n };\n }\n\n /** @inheritdoc */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n end(_timestamp) {}\n\n /** @inheritdoc */\n setAttribute(_key, _value) {\n return this;\n }\n\n /** @inheritdoc */\n setAttributes(_values) {\n return this;\n }\n\n /** @inheritdoc */\n setStatus(_status) {\n return this;\n }\n\n /** @inheritdoc */\n updateName(_name) {\n return this;\n }\n\n /** @inheritdoc */\n isRecording() {\n return false;\n }\n\n /** @inheritdoc */\n addEvent(\n _name,\n _attributesOrStartTime,\n _startTime,\n ) {\n return this;\n }\n\n /**\n * This should generally not be used,\n * but we need it for being comliant with the OTEL Span interface.\n *\n * @hidden\n * @internal\n */\n addLink(_link) {\n return this;\n }\n\n /**\n * This should generally not be used,\n * but we need it for being comliant with the OTEL Span interface.\n *\n * @hidden\n * @internal\n */\n addLinks(_links) {\n return this;\n }\n\n /**\n * This should generally not be used,\n * but we need it for being comliant with the OTEL Span interface.\n *\n * @hidden\n * @internal\n */\n recordException(_exception, _time) {\n // noop\n }\n}\n\nexport { SentryNonRecordingSpan };\n//# sourceMappingURL=sentryNonRecordingSpan.js.map\n","import { SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT } from '../semanticAttributes.js';\nimport { getRootSpan, getActiveSpan } from '../utils/spanUtils.js';\n\n/**\n * Adds a measurement to the active transaction on the current global scope. You can optionally pass in a different span\n * as the 4th parameter.\n */\nfunction setMeasurement(name, value, unit, activeSpan = getActiveSpan()) {\n const rootSpan = activeSpan && getRootSpan(activeSpan);\n\n if (rootSpan) {\n rootSpan.addEvent(name, {\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value,\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit ,\n });\n }\n}\n\n/**\n * Convert timed events to measurements.\n */\nfunction timedEventsToMeasurements(events) {\n if (!events || events.length === 0) {\n return undefined;\n }\n\n const measurements = {};\n events.forEach(event => {\n const attributes = event.attributes || {};\n const unit = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT] ;\n const value = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE] ;\n\n if (typeof unit === 'string' && typeof value === 'number') {\n measurements[event.name] = { value, unit };\n }\n });\n\n return measurements;\n}\n\nexport { setMeasurement, timedEventsToMeasurements };\n//# sourceMappingURL=measurement.js.map\n","import { addNonEnumerableProperty } from '@sentry/utils';\nexport { stripUrlQueryAndFragment } from '@sentry/utils';\n\nconst SCOPE_ON_START_SPAN_FIELD = '_sentryScope';\nconst ISOLATION_SCOPE_ON_START_SPAN_FIELD = '_sentryIsolationScope';\n\n/** Store the scope & isolation scope for a span, which can the be used when it is finished. */\nfunction setCapturedScopesOnSpan(span, scope, isolationScope) {\n if (span) {\n addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope);\n addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope);\n }\n}\n\n/**\n * Grabs the scope and isolation scope off a span that were active when the span was started.\n */\nfunction getCapturedScopesOnSpan(span) {\n return {\n scope: (span )[SCOPE_ON_START_SPAN_FIELD],\n isolationScope: (span )[ISOLATION_SCOPE_ON_START_SPAN_FIELD],\n };\n}\n\nexport { getCapturedScopesOnSpan, setCapturedScopesOnSpan };\n//# sourceMappingURL=utils.js.map\n","import { uuid4, timestampInSeconds, dropUndefinedKeys, logger } from '@sentry/utils';\nimport { getClient, getCurrentScope } from '../currentScopes.js';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { createSpanEnvelope } from '../envelope.js';\nimport { getMetricSummaryJsonForSpan } from '../metrics/metric-summary.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes.js';\nimport { TRACE_FLAG_SAMPLED, TRACE_FLAG_NONE, spanTimeInputToSeconds, getStatusMessage, getRootSpan, spanToJSON, getSpanDescendants, spanToTransactionTraceContext } from '../utils/spanUtils.js';\nimport { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext.js';\nimport { logSpanEnd } from './logSpans.js';\nimport { timedEventsToMeasurements } from './measurement.js';\nimport { getCapturedScopesOnSpan } from './utils.js';\n\nconst MAX_SPAN_COUNT = 1000;\n\n/**\n * Span contains all data about a span\n */\nclass SentrySpan {\n\n /** Epoch timestamp in seconds when the span started. */\n\n /** Epoch timestamp in seconds when the span ended. */\n\n /** Internal keeper of the status */\n\n /** The timed events added to this span. */\n\n /** if true, treat span as a standalone span (not part of a transaction) */\n\n /**\n * You should never call the constructor manually, always use `Sentry.startSpan()`\n * or other span methods.\n * @internal\n * @hideconstructor\n * @hidden\n */\n constructor(spanContext = {}) {\n this._traceId = spanContext.traceId || uuid4();\n this._spanId = spanContext.spanId || uuid4().substring(16);\n this._startTime = spanContext.startTimestamp || timestampInSeconds();\n\n this._attributes = {};\n this.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'manual',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op,\n ...spanContext.attributes,\n });\n\n this._name = spanContext.name;\n\n if (spanContext.parentSpanId) {\n this._parentSpanId = spanContext.parentSpanId;\n }\n // We want to include booleans as well here\n if ('sampled' in spanContext) {\n this._sampled = spanContext.sampled;\n }\n if (spanContext.endTimestamp) {\n this._endTime = spanContext.endTimestamp;\n }\n\n this._events = [];\n\n this._isStandaloneSpan = spanContext.isStandalone;\n\n // If the span is already ended, ensure we finalize the span immediately\n if (this._endTime) {\n this._onSpanEnded();\n }\n }\n\n /**\n * This should generally not be used,\n * but it is needed for being compliant with the OTEL Span interface.\n *\n * @hidden\n * @internal\n */\n addLink(_link) {\n return this;\n }\n\n /**\n * This should generally not be used,\n * but it is needed for being compliant with the OTEL Span interface.\n *\n * @hidden\n * @internal\n */\n addLinks(_links) {\n return this;\n }\n\n /**\n * This should generally not be used,\n * but it is needed for being compliant with the OTEL Span interface.\n *\n * @hidden\n * @internal\n */\n recordException(_exception, _time) {\n // noop\n }\n\n /** @inheritdoc */\n spanContext() {\n const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this;\n return {\n spanId,\n traceId,\n traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE,\n };\n }\n\n /** @inheritdoc */\n setAttribute(key, value) {\n if (value === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._attributes[key];\n } else {\n this._attributes[key] = value;\n }\n\n return this;\n }\n\n /** @inheritdoc */\n setAttributes(attributes) {\n Object.keys(attributes).forEach(key => this.setAttribute(key, attributes[key]));\n return this;\n }\n\n /**\n * This should generally not be used,\n * but we need it for browser tracing where we want to adjust the start time afterwards.\n * USE THIS WITH CAUTION!\n *\n * @hidden\n * @internal\n */\n updateStartTime(timeInput) {\n this._startTime = spanTimeInputToSeconds(timeInput);\n }\n\n /**\n * @inheritDoc\n */\n setStatus(value) {\n this._status = value;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n updateName(name) {\n this._name = name;\n return this;\n }\n\n /** @inheritdoc */\n end(endTimestamp) {\n // If already ended, skip\n if (this._endTime) {\n return;\n }\n\n this._endTime = spanTimeInputToSeconds(endTimestamp);\n logSpanEnd(this);\n\n this._onSpanEnded();\n }\n\n /**\n * Get JSON representation of this span.\n *\n * @hidden\n * @internal This method is purely for internal purposes and should not be used outside\n * of SDK code. If you need to get a JSON representation of a span,\n * use `spanToJSON(span)` instead.\n */\n getSpanJSON() {\n return dropUndefinedKeys({\n data: this._attributes,\n description: this._name,\n op: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP],\n parent_span_id: this._parentSpanId,\n span_id: this._spanId,\n start_timestamp: this._startTime,\n status: getStatusMessage(this._status),\n timestamp: this._endTime,\n trace_id: this._traceId,\n origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] ,\n _metrics_summary: getMetricSummaryJsonForSpan(this),\n profile_id: this._attributes[SEMANTIC_ATTRIBUTE_PROFILE_ID] ,\n exclusive_time: this._attributes[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME] ,\n measurements: timedEventsToMeasurements(this._events),\n is_segment: (this._isStandaloneSpan && getRootSpan(this) === this) || undefined,\n segment_id: this._isStandaloneSpan ? getRootSpan(this).spanContext().spanId : undefined,\n });\n }\n\n /** @inheritdoc */\n isRecording() {\n return !this._endTime && !!this._sampled;\n }\n\n /**\n * @inheritdoc\n */\n addEvent(\n name,\n attributesOrStartTime,\n startTime,\n ) {\n DEBUG_BUILD && logger.log('[Tracing] Adding an event to span:', name);\n\n const time = isSpanTimeInput(attributesOrStartTime) ? attributesOrStartTime : startTime || timestampInSeconds();\n const attributes = isSpanTimeInput(attributesOrStartTime) ? {} : attributesOrStartTime || {};\n\n const event = {\n name,\n time: spanTimeInputToSeconds(time),\n attributes,\n };\n\n this._events.push(event);\n\n return this;\n }\n\n /**\n * This method should generally not be used,\n * but for now we need a way to publicly check if the `_isStandaloneSpan` flag is set.\n * USE THIS WITH CAUTION!\n * @internal\n * @hidden\n * @experimental\n */\n isStandaloneSpan() {\n return !!this._isStandaloneSpan;\n }\n\n /** Emit `spanEnd` when the span is ended. */\n _onSpanEnded() {\n const client = getClient();\n if (client) {\n client.emit('spanEnd', this);\n }\n\n // A segment span is basically the root span of a local span tree.\n // So for now, this is either what we previously refer to as the root span,\n // or a standalone span.\n const isSegmentSpan = this._isStandaloneSpan || this === getRootSpan(this);\n\n if (!isSegmentSpan) {\n return;\n }\n\n // if this is a standalone span, we send it immediately\n if (this._isStandaloneSpan) {\n if (this._sampled) {\n sendSpanEnvelope(createSpanEnvelope([this], client));\n } else {\n DEBUG_BUILD &&\n logger.log('[Tracing] Discarding standalone span because its trace was not chosen to be sampled.');\n if (client) {\n client.recordDroppedEvent('sample_rate', 'span');\n }\n }\n return;\n }\n\n const transactionEvent = this._convertSpanToTransaction();\n if (transactionEvent) {\n const scope = getCapturedScopesOnSpan(this).scope || getCurrentScope();\n scope.captureEvent(transactionEvent);\n }\n }\n\n /**\n * Finish the transaction & prepare the event to send to Sentry.\n */\n _convertSpanToTransaction() {\n // We can only convert finished spans\n if (!isFullFinishedSpan(spanToJSON(this))) {\n return undefined;\n }\n\n if (!this._name) {\n DEBUG_BUILD && logger.warn('Transaction has no name, falling back to `<unlabeled transaction>`.');\n this._name = '<unlabeled transaction>';\n }\n\n const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = getCapturedScopesOnSpan(this);\n const scope = capturedSpanScope || getCurrentScope();\n const client = scope.getClient() || getClient();\n\n if (this._sampled !== true) {\n // At this point if `sampled !== true` we want to discard the transaction.\n DEBUG_BUILD && logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');\n\n if (client) {\n client.recordDroppedEvent('sample_rate', 'transaction');\n }\n\n return undefined;\n }\n\n // The transaction span itself as well as any potential standalone spans should be filtered out\n const finishedSpans = getSpanDescendants(this).filter(span => span !== this && !isStandaloneSpan(span));\n\n const spans = finishedSpans.map(span => spanToJSON(span)).filter(isFullFinishedSpan);\n\n const source = this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ;\n\n const transaction = {\n contexts: {\n trace: spanToTransactionTraceContext(this),\n },\n spans:\n // spans.sort() mutates the array, but `spans` is already a copy so we can safely do this here\n // we do not use spans anymore after this point\n spans.length > MAX_SPAN_COUNT\n ? spans.sort((a, b) => a.start_timestamp - b.start_timestamp).slice(0, MAX_SPAN_COUNT)\n : spans,\n start_timestamp: this._startTime,\n timestamp: this._endTime,\n transaction: this._name,\n type: 'transaction',\n sdkProcessingMetadata: {\n capturedSpanScope,\n capturedSpanIsolationScope,\n ...dropUndefinedKeys({\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(this),\n }),\n },\n _metrics_summary: getMetricSummaryJsonForSpan(this),\n ...(source && {\n transaction_info: {\n source,\n },\n }),\n };\n\n const measurements = timedEventsToMeasurements(this._events);\n const hasMeasurements = measurements && Object.keys(measurements).length;\n\n if (hasMeasurements) {\n DEBUG_BUILD &&\n logger.log(\n '[Measurements] Adding measurements to transaction event',\n JSON.stringify(measurements, undefined, 2),\n );\n transaction.measurements = measurements;\n }\n\n return transaction;\n }\n}\n\nfunction isSpanTimeInput(value) {\n return (value && typeof value === 'number') || value instanceof Date || Array.isArray(value);\n}\n\n// We want to filter out any incomplete SpanJSON objects\nfunction isFullFinishedSpan(input) {\n return !!input.start_timestamp && !!input.timestamp && !!input.span_id && !!input.trace_id;\n}\n\n/** `SentrySpan`s can be sent as a standalone span rather than belonging to a transaction */\nfunction isStandaloneSpan(span) {\n return span instanceof SentrySpan && span.isStandaloneSpan();\n}\n\n/**\n * Sends a `SpanEnvelope`.\n *\n * Note: If the envelope's spans are dropped, e.g. via `beforeSendSpan`,\n * the envelope will not be sent either.\n */\nfunction sendSpanEnvelope(envelope) {\n const client = getClient();\n if (!client) {\n return;\n }\n\n const spanItems = envelope[1];\n if (!spanItems || spanItems.length === 0) {\n client.recordDroppedEvent('before_send', 'span');\n return;\n }\n\n const transport = client.getTransport();\n if (transport) {\n transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending span:', reason);\n });\n }\n}\n\nexport { SentrySpan };\n//# sourceMappingURL=sentrySpan.js.map\n","import { propagationContextFromHeaders, generatePropagationContext, logger } from '@sentry/utils';\nimport { getMainCarrier } from '../carrier.js';\nimport { withScope, getCurrentScope, getIsolationScope, getClient } from '../currentScopes.js';\nimport { getAsyncContextStrategy } from '../asyncContext/index.js';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes.js';\nimport { handleCallbackErrors } from '../utils/handleCallbackErrors.js';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled.js';\nimport { _setSpanForScope, _getSpanForScope } from '../utils/spanOnScope.js';\nimport { spanToJSON, addChildSpanToSpan, spanIsSampled, spanTimeInputToSeconds, getRootSpan } from '../utils/spanUtils.js';\nimport { getDynamicSamplingContextFromSpan, freezeDscOnSpan } from './dynamicSamplingContext.js';\nimport { logSpanStart } from './logSpans.js';\nimport { sampleSpan } from './sampling.js';\nimport { SentryNonRecordingSpan } from './sentryNonRecordingSpan.js';\nimport { SentrySpan } from './sentrySpan.js';\nimport { SPAN_STATUS_ERROR } from './spanstatus.js';\nimport { setCapturedScopesOnSpan } from './utils.js';\n\nconst SUPPRESS_TRACING_KEY = '__SENTRY_SUPPRESS_TRACING__';\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.\n *\n * If you want to create a span that is not set as active, use {@link startInactiveSpan}.\n *\n * You'll always get a span passed to the callback,\n * it may just be a non-recording span if the span is not sampled or if tracing is disabled.\n */\nfunction startSpan(options, callback) {\n const acs = getAcs();\n if (acs.startSpan) {\n return acs.startSpan(options, callback);\n }\n\n const spanArguments = parseSentrySpanArguments(options);\n const { forceTransaction, parentSpan: customParentSpan } = options;\n\n return withScope(options.scope, () => {\n // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan`\n const wrapper = getActiveSpanWrapper(customParentSpan);\n\n return wrapper(() => {\n const scope = getCurrentScope();\n const parentSpan = getParentSpan(scope);\n\n const shouldSkipSpan = options.onlyIfParent && !parentSpan;\n const activeSpan = shouldSkipSpan\n ? new SentryNonRecordingSpan()\n : createChildOrRootSpan({\n parentSpan,\n spanArguments,\n forceTransaction,\n scope,\n });\n\n _setSpanForScope(scope, activeSpan);\n\n return handleCallbackErrors(\n () => callback(activeSpan),\n () => {\n // Only update the span status if it hasn't been changed yet, and the span is not yet finished\n const { status } = spanToJSON(activeSpan);\n if (activeSpan.isRecording() && (!status || status === 'ok')) {\n activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n }\n },\n () => activeSpan.end(),\n );\n });\n });\n}\n\n/**\n * Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span\n * after the function is done automatically. You'll have to call `span.end()` manually.\n *\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.\n *\n * You'll always get a span passed to the callback,\n * it may just be a non-recording span if the span is not sampled or if tracing is disabled.\n */\nfunction startSpanManual(options, callback) {\n const acs = getAcs();\n if (acs.startSpanManual) {\n return acs.startSpanManual(options, callback);\n }\n\n const spanArguments = parseSentrySpanArguments(options);\n const { forceTransaction, parentSpan: customParentSpan } = options;\n\n return withScope(options.scope, () => {\n // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan`\n const wrapper = getActiveSpanWrapper(customParentSpan);\n\n return wrapper(() => {\n const scope = getCurrentScope();\n const parentSpan = getParentSpan(scope);\n\n const shouldSkipSpan = options.onlyIfParent && !parentSpan;\n const activeSpan = shouldSkipSpan\n ? new SentryNonRecordingSpan()\n : createChildOrRootSpan({\n parentSpan,\n spanArguments,\n forceTransaction,\n scope,\n });\n\n _setSpanForScope(scope, activeSpan);\n\n function finishAndSetSpan() {\n activeSpan.end();\n }\n\n return handleCallbackErrors(\n () => callback(activeSpan, finishAndSetSpan),\n () => {\n // Only update the span status if it hasn't been changed yet, and the span is not yet finished\n const { status } = spanToJSON(activeSpan);\n if (activeSpan.isRecording() && (!status || status === 'ok')) {\n activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n }\n },\n );\n });\n });\n}\n\n/**\n * Creates a span. This span is not set as active, so will not get automatic instrumentation spans\n * as children or be able to be accessed via `Sentry.getActiveSpan()`.\n *\n * If you want to create a span that is set as active, use {@link startSpan}.\n *\n * This function will always return a span,\n * it may just be a non-recording span if the span is not sampled or if tracing is disabled.\n */\nfunction startInactiveSpan(options) {\n const acs = getAcs();\n if (acs.startInactiveSpan) {\n return acs.startInactiveSpan(options);\n }\n\n const spanArguments = parseSentrySpanArguments(options);\n const { forceTransaction, parentSpan: customParentSpan } = options;\n\n // If `options.scope` is defined, we use this as as a wrapper,\n // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan`\n const wrapper = options.scope\n ? (callback) => withScope(options.scope, callback)\n : customParentSpan !== undefined\n ? (callback) => withActiveSpan(customParentSpan, callback)\n : (callback) => callback();\n\n return wrapper(() => {\n const scope = getCurrentScope();\n const parentSpan = getParentSpan(scope);\n\n const shouldSkipSpan = options.onlyIfParent && !parentSpan;\n\n if (shouldSkipSpan) {\n return new SentryNonRecordingSpan();\n }\n\n return createChildOrRootSpan({\n parentSpan,\n spanArguments,\n forceTransaction,\n scope,\n });\n });\n}\n\n/**\n * Continue a trace from `sentry-trace` and `baggage` values.\n * These values can be obtained from incoming request headers, or in the browser from `<meta name=\"sentry-trace\">`\n * and `<meta name=\"baggage\">` HTML tags.\n *\n * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically\n * be attached to the incoming trace.\n */\nconst continueTrace = (\n {\n sentryTrace,\n baggage,\n }\n\n,\n callback,\n) => {\n return withScope(scope => {\n const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);\n scope.setPropagationContext(propagationContext);\n return callback();\n });\n};\n\n/**\n * Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be\n * passed `null` to start an entirely new span tree.\n *\n * @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed,\n * spans started within the callback will not be attached to a parent span.\n * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.\n * @returns the value returned from the provided callback function.\n */\nfunction withActiveSpan(span, callback) {\n const acs = getAcs();\n if (acs.withActiveSpan) {\n return acs.withActiveSpan(span, callback);\n }\n\n return withScope(scope => {\n _setSpanForScope(scope, span || undefined);\n return callback(scope);\n });\n}\n\n/** Suppress tracing in the given callback, ensuring no spans are generated inside of it. */\nfunction suppressTracing(callback) {\n const acs = getAcs();\n\n if (acs.suppressTracing) {\n return acs.suppressTracing(callback);\n }\n\n return withScope(scope => {\n scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: true });\n return callback();\n });\n}\n\n/**\n * Starts a new trace for the duration of the provided callback. Spans started within the\n * callback will be part of the new trace instead of a potentially previously started trace.\n *\n * Important: Only use this function if you want to override the default trace lifetime and\n * propagation mechanism of the SDK for the duration and scope of the provided callback.\n * The newly created trace will also be the root of a new distributed trace, for example if\n * you make http requests within the callback.\n * This function might be useful if the operation you want to instrument should not be part\n * of a potentially ongoing trace.\n *\n * Default behavior:\n * - Server-side: A new trace is started for each incoming request.\n * - Browser: A new trace is started for each page our route. Navigating to a new route\n * or page will automatically create a new trace.\n */\nfunction startNewTrace(callback) {\n return withScope(scope => {\n scope.setPropagationContext(generatePropagationContext());\n DEBUG_BUILD && logger.info(`Starting a new trace with id ${scope.getPropagationContext().traceId}`);\n return withActiveSpan(null, callback);\n });\n}\n\nfunction createChildOrRootSpan({\n parentSpan,\n spanArguments,\n forceTransaction,\n scope,\n}\n\n) {\n if (!hasTracingEnabled()) {\n return new SentryNonRecordingSpan();\n }\n\n const isolationScope = getIsolationScope();\n\n let span;\n if (parentSpan && !forceTransaction) {\n span = _startChildSpan(parentSpan, scope, spanArguments);\n addChildSpanToSpan(parentSpan, span);\n } else if (parentSpan) {\n // If we forced a transaction but have a parent span, make sure to continue from the parent span, not the scope\n const dsc = getDynamicSamplingContextFromSpan(parentSpan);\n const { traceId, spanId: parentSpanId } = parentSpan.spanContext();\n const parentSampled = spanIsSampled(parentSpan);\n\n span = _startRootSpan(\n {\n traceId,\n parentSpanId,\n ...spanArguments,\n },\n scope,\n parentSampled,\n );\n\n freezeDscOnSpan(span, dsc);\n } else {\n const {\n traceId,\n dsc,\n parentSpanId,\n sampled: parentSampled,\n } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n span = _startRootSpan(\n {\n traceId,\n parentSpanId,\n ...spanArguments,\n },\n scope,\n parentSampled,\n );\n\n if (dsc) {\n freezeDscOnSpan(span, dsc);\n }\n }\n\n logSpanStart(span);\n\n setCapturedScopesOnSpan(span, scope, isolationScope);\n\n return span;\n}\n\n/**\n * This converts StartSpanOptions to SentrySpanArguments.\n * For the most part (for now) we accept the same options,\n * but some of them need to be transformed.\n */\nfunction parseSentrySpanArguments(options) {\n const exp = options.experimental || {};\n const initialCtx = {\n isStandalone: exp.standalone,\n ...options,\n };\n\n if (options.startTime) {\n const ctx = { ...initialCtx };\n ctx.startTimestamp = spanTimeInputToSeconds(options.startTime);\n delete ctx.startTime;\n return ctx;\n }\n\n return initialCtx;\n}\n\nfunction getAcs() {\n const carrier = getMainCarrier();\n return getAsyncContextStrategy(carrier);\n}\n\nfunction _startRootSpan(spanArguments, scope, parentSampled) {\n const client = getClient();\n const options = (client && client.getOptions()) || {};\n\n const { name = '', attributes } = spanArguments;\n const [sampled, sampleRate] = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY]\n ? [false]\n : sampleSpan(options, {\n name,\n parentSampled,\n attributes,\n transactionContext: {\n name,\n parentSampled,\n },\n });\n\n const rootSpan = new SentrySpan({\n ...spanArguments,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom',\n ...spanArguments.attributes,\n },\n sampled,\n });\n if (sampleRate !== undefined) {\n rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);\n }\n\n if (client) {\n client.emit('spanStart', rootSpan);\n }\n\n return rootSpan;\n}\n\n/**\n * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.\n * This inherits the sampling decision from the parent span.\n */\nfunction _startChildSpan(parentSpan, scope, spanArguments) {\n const { spanId, traceId } = parentSpan.spanContext();\n const sampled = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? false : spanIsSampled(parentSpan);\n\n const childSpan = sampled\n ? new SentrySpan({\n ...spanArguments,\n parentSpanId: spanId,\n traceId,\n sampled,\n })\n : new SentryNonRecordingSpan({ traceId });\n\n addChildSpanToSpan(parentSpan, childSpan);\n\n const client = getClient();\n if (client) {\n client.emit('spanStart', childSpan);\n // If it has an endTimestamp, it's already ended\n if (spanArguments.endTimestamp) {\n client.emit('spanEnd', childSpan);\n }\n }\n\n return childSpan;\n}\n\nfunction getParentSpan(scope) {\n const span = _getSpanForScope(scope) ;\n\n if (!span) {\n return undefined;\n }\n\n const client = getClient();\n const options = client ? client.getOptions() : {};\n if (options.parentSpanIsAlwaysRootSpan) {\n return getRootSpan(span) ;\n }\n\n return span;\n}\n\nfunction getActiveSpanWrapper(parentSpan) {\n return parentSpan !== undefined\n ? (callback) => {\n return withActiveSpan(parentSpan, callback);\n }\n : (callback) => callback();\n}\n\nexport { continueTrace, startInactiveSpan, startNewTrace, startSpan, startSpanManual, suppressTracing, withActiveSpan };\n//# sourceMappingURL=trace.js.map\n","import { spanToJSON, withActiveSpan, startInactiveSpan, getClient, getCurrentScope } from '@sentry/core';\nimport { WINDOW } from '../types.js';\n\n/**\n * Checks if a given value is a valid measurement value.\n */\nfunction isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Helper function to start child on transactions. This function will make sure that the transaction will\n * use the start timestamp of the created child span if it is earlier than the transactions actual\n * start timestamp.\n */\nfunction startAndEndSpan(\n parentSpan,\n startTimeInSeconds,\n endTime,\n { ...ctx },\n) {\n const parentStartTime = spanToJSON(parentSpan).start_timestamp;\n if (parentStartTime && parentStartTime > startTimeInSeconds) {\n // We can only do this for SentrySpans...\n if (typeof (parentSpan ).updateStartTime === 'function') {\n (parentSpan ).updateStartTime(startTimeInSeconds);\n }\n }\n\n // The return value only exists for tests\n return withActiveSpan(parentSpan, () => {\n const span = startInactiveSpan({\n startTime: startTimeInSeconds,\n ...ctx,\n });\n\n if (span) {\n span.end(endTime);\n }\n\n return span;\n });\n}\n\n/**\n * Starts an inactive, standalone span used to send web vital values to Sentry.\n * DO NOT use this for arbitrary spans, as these spans require special handling\n * during ingestion to extract metrics.\n *\n * This function adds a bunch of attributes and data to the span that's shared\n * by all web vital standalone spans. However, you need to take care of adding\n * the actual web vital value as an event to the span. Also, you need to assign\n * a transaction name and some other values that are specific to the web vital.\n *\n * Ultimately, you also need to take care of ending the span to send it off.\n *\n * @param options\n *\n * @returns an inactive, standalone and NOT YET ended span\n */\nfunction startStandaloneWebVitalSpan(options) {\n const client = getClient();\n if (!client) {\n return;\n }\n\n const { name, transaction, attributes: passedAttributes, startTime } = options;\n\n const { release, environment } = client.getOptions();\n // We need to get the replay, user, and activeTransaction from the current scope\n // so that we can associate replay id, profile id, and a user display to the span\n const replay = client.getIntegrationByName('Replay');\n const replayId = replay && replay.getReplayId();\n\n const scope = getCurrentScope();\n\n const user = scope.getUser();\n const userDisplay = user !== undefined ? user.email || user.id || user.ip_address : undefined;\n\n let profileId;\n try {\n // @ts-expect-error skip optional chaining to save bundle size with try catch\n profileId = scope.getScopeData().contexts.profile.profile_id;\n } catch (e) {\n // do nothing\n }\n\n const attributes = {\n release,\n environment,\n\n user: userDisplay || undefined,\n profile_id: profileId || undefined,\n replay_id: replayId || undefined,\n\n transaction,\n\n // Web vital score calculation relies on the user agent to account for different\n // browsers setting different thresholds for what is considered a good/meh/bad value.\n // For example: Chrome vs. Chrome Mobile\n 'user_agent.original': WINDOW.navigator && WINDOW.navigator.userAgent,\n\n ...passedAttributes,\n };\n\n return startInactiveSpan({\n name,\n attributes,\n startTime,\n experimental: {\n standalone: true,\n },\n });\n}\n\n/** Get the browser performance API. */\nfunction getBrowserPerformanceAPI() {\n // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n return WINDOW && WINDOW.addEventListener && WINDOW.performance;\n}\n\n/**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\nfunction msToSec(time) {\n return time / 1000;\n}\n\nexport { getBrowserPerformanceAPI, isMeasurementValue, msToSec, startAndEndSpan, startStandaloneWebVitalSpan };\n//# sourceMappingURL=utils.js.map\n","import { _optionalChain } from '@sentry/utils';\nimport { getClient, getActiveSpan, getRootSpan, spanToJSON, getCurrentScope, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE } from '@sentry/core';\nimport { logger, browserPerformanceTimeOrigin, htmlTreeAsString, dropUndefinedKeys } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { addClsInstrumentationHandler } from './instrument.js';\nimport { msToSec, startStandaloneWebVitalSpan } from './utils.js';\nimport { onHidden } from './web-vitals/lib/onHidden.js';\n\n/**\n * Starts tracking the Cumulative Layout Shift on the current page and collects the value once\n *\n * - the page visibility is hidden\n * - a navigation span is started (to stop CLS measurement for SPA soft navigations)\n *\n * Once either of these events triggers, the CLS value is sent as a standalone span and we stop\n * measuring CLS.\n */\nfunction trackClsAsStandaloneSpan() {\n let standaloneCLsValue = 0;\n let standaloneClsEntry;\n let pageloadSpanId;\n\n if (!supportsLayoutShift()) {\n return;\n }\n\n let sentSpan = false;\n function _collectClsOnce() {\n if (sentSpan) {\n return;\n }\n sentSpan = true;\n if (pageloadSpanId) {\n sendStandaloneClsSpan(standaloneCLsValue, standaloneClsEntry, pageloadSpanId);\n }\n cleanupClsHandler();\n }\n\n const cleanupClsHandler = addClsInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1] ;\n if (!entry) {\n return;\n }\n standaloneCLsValue = metric.value;\n standaloneClsEntry = entry;\n }, true);\n\n // use pagehide event from web-vitals\n onHidden(() => {\n _collectClsOnce();\n });\n\n // Since the call chain of this function is synchronous and evaluates before the SDK client is created,\n // we need to wait with subscribing to a client hook until the client is created. Therefore, we defer\n // to the next tick after the SDK setup.\n setTimeout(() => {\n const client = getClient();\n\n const unsubscribeStartNavigation = _optionalChain([client, 'optionalAccess', _ => _.on, 'call', _2 => _2('startNavigationSpan', () => {\n _collectClsOnce();\n unsubscribeStartNavigation && unsubscribeStartNavigation();\n })]);\n\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan && getRootSpan(activeSpan);\n const spanJSON = rootSpan && spanToJSON(rootSpan);\n if (spanJSON && spanJSON.op === 'pageload') {\n pageloadSpanId = rootSpan.spanContext().spanId;\n }\n }, 0);\n}\n\nfunction sendStandaloneClsSpan(clsValue, entry, pageloadSpanId) {\n DEBUG_BUILD && logger.log(`Sending CLS span (${clsValue})`);\n\n const startTime = msToSec((browserPerformanceTimeOrigin || 0) + (_optionalChain([entry, 'optionalAccess', _3 => _3.startTime]) || 0));\n const routeName = getCurrentScope().getScopeData().transactionName;\n\n const name = entry ? htmlTreeAsString(_optionalChain([entry, 'access', _4 => _4.sources, 'access', _5 => _5[0], 'optionalAccess', _6 => _6.node])) : 'Layout shift';\n\n const attributes = dropUndefinedKeys({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser.cls',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.webvital.cls',\n [SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: _optionalChain([entry, 'optionalAccess', _7 => _7.duration]) || 0,\n // attach the pageload span id to the CLS span so that we can link them in the UI\n 'sentry.pageload.span_id': pageloadSpanId,\n });\n\n const span = startStandaloneWebVitalSpan({\n name,\n transaction: routeName,\n attributes,\n startTime,\n });\n\n _optionalChain([span, 'optionalAccess', _8 => _8.addEvent, 'call', _9 => _9('cls', {\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: '',\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: clsValue,\n })]);\n\n // LayoutShift performance entries always have a duration of 0, so we don't need to add `entry.duration` here\n // see: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/duration\n _optionalChain([span, 'optionalAccess', _10 => _10.end, 'call', _11 => _11(startTime)]);\n}\n\nfunction supportsLayoutShift() {\n try {\n return _optionalChain([PerformanceObserver, 'access', _12 => _12.supportedEntryTypes, 'optionalAccess', _13 => _13.includes, 'call', _14 => _14('layout-shift')]);\n } catch (e) {\n return false;\n }\n}\n\nexport { trackClsAsStandaloneSpan };\n//# sourceMappingURL=cls.js.map\n","import { getActiveSpan, startInactiveSpan, spanToJSON, setMeasurement, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport { browserPerformanceTimeOrigin, logger, parseUrl, htmlTreeAsString, getComponentName } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { WINDOW } from '../types.js';\nimport { trackClsAsStandaloneSpan } from './cls.js';\nimport { addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addLcpInstrumentationHandler, addFidInstrumentationHandler, addTtfbInstrumentationHandler } from './instrument.js';\nimport { getBrowserPerformanceAPI, msToSec, startAndEndSpan, isMeasurementValue } from './utils.js';\nimport { getActivationStart } from './web-vitals/lib/getActivationStart.js';\nimport { getNavigationEntry } from './web-vitals/lib/getNavigationEntry.js';\nimport { getVisibilityWatcher } from './web-vitals/lib/getVisibilityWatcher.js';\n\n/* eslint-disable max-lines */\n\nconst MAX_INT_AS_BYTES = 2147483647;\n\nlet _performanceCursor = 0;\n\nlet _measurements = {};\nlet _lcpEntry;\nlet _clsEntry;\n\n/**\n * Start tracking web vitals.\n * The callback returned by this function can be used to stop tracking & ensure all measurements are final & captured.\n *\n * @returns A function that forces web vitals collection\n */\nfunction startTrackingWebVitals({ recordClsStandaloneSpans }) {\n const performance = getBrowserPerformanceAPI();\n if (performance && browserPerformanceTimeOrigin) {\n // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n if (performance.mark) {\n WINDOW.performance.mark('sentry-tracing-init');\n }\n const fidCleanupCallback = _trackFID();\n const lcpCleanupCallback = _trackLCP();\n const ttfbCleanupCallback = _trackTtfb();\n const clsCleanupCallback = recordClsStandaloneSpans ? trackClsAsStandaloneSpan() : _trackCLS();\n\n return () => {\n fidCleanupCallback();\n lcpCleanupCallback();\n ttfbCleanupCallback();\n clsCleanupCallback && clsCleanupCallback();\n };\n }\n\n return () => undefined;\n}\n\n/**\n * Start tracking long tasks.\n */\nfunction startTrackingLongTasks() {\n addPerformanceInstrumentationHandler('longtask', ({ entries }) => {\n if (!getActiveSpan()) {\n return;\n }\n for (const entry of entries) {\n const startTime = msToSec((browserPerformanceTimeOrigin ) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n const span = startInactiveSpan({\n name: 'Main UI thread blocked',\n op: 'ui.long-task',\n startTime,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',\n },\n });\n if (span) {\n span.end(startTime + duration);\n }\n }\n });\n}\n\n/**\n * Start tracking long animation frames.\n */\nfunction startTrackingLongAnimationFrames() {\n // NOTE: the current web-vitals version (3.5.2) does not support long-animation-frame, so\n // we directly observe `long-animation-frame` events instead of through the web-vitals\n // `observe` helper function.\n const observer = new PerformanceObserver(list => {\n if (!getActiveSpan()) {\n return;\n }\n for (const entry of list.getEntries() ) {\n if (!entry.scripts[0]) {\n continue;\n }\n\n const startTime = msToSec((browserPerformanceTimeOrigin ) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n const attributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',\n };\n\n const initialScript = entry.scripts[0];\n const { invoker, invokerType, sourceURL, sourceFunctionName, sourceCharPosition } = initialScript;\n attributes['browser.script.invoker'] = invoker;\n attributes['browser.script.invoker_type'] = invokerType;\n if (sourceURL) {\n attributes['code.filepath'] = sourceURL;\n }\n if (sourceFunctionName) {\n attributes['code.function'] = sourceFunctionName;\n }\n if (sourceCharPosition !== -1) {\n attributes['browser.script.source_char_position'] = sourceCharPosition;\n }\n\n const span = startInactiveSpan({\n name: 'Main UI thread blocked',\n op: 'ui.long-animation-frame',\n startTime,\n attributes,\n });\n if (span) {\n span.end(startTime + duration);\n }\n }\n });\n\n observer.observe({ type: 'long-animation-frame', buffered: true });\n}\n\n/**\n * Start tracking interaction events.\n */\nfunction startTrackingInteractions() {\n addPerformanceInstrumentationHandler('event', ({ entries }) => {\n if (!getActiveSpan()) {\n return;\n }\n for (const entry of entries) {\n if (entry.name === 'click') {\n const startTime = msToSec((browserPerformanceTimeOrigin ) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n const spanOptions = {\n name: htmlTreeAsString(entry.target),\n op: `ui.interaction.${entry.name}`,\n startTime: startTime,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',\n },\n };\n\n const componentName = getComponentName(entry.target);\n if (componentName) {\n spanOptions.attributes['ui.component_name'] = componentName;\n }\n\n const span = startInactiveSpan(spanOptions);\n if (span) {\n span.end(startTime + duration);\n }\n }\n }\n });\n}\n\n/**\n * Starts tracking the Cumulative Layout Shift on the current page and collects the value and last entry\n * to the `_measurements` object which ultimately is applied to the pageload span's measurements.\n */\nfunction _trackCLS() {\n return addClsInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1] ;\n if (!entry) {\n return;\n }\n DEBUG_BUILD && logger.log(`[Measurements] Adding CLS ${metric.value}`);\n _measurements['cls'] = { value: metric.value, unit: '' };\n _clsEntry = entry;\n }, true);\n}\n\n/** Starts tracking the Largest Contentful Paint on the current page. */\nfunction _trackLCP() {\n return addLcpInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding LCP');\n _measurements['lcp'] = { value: metric.value, unit: 'millisecond' };\n _lcpEntry = entry ;\n }, true);\n}\n\n/** Starts tracking the First Input Delay on the current page. */\nfunction _trackFID() {\n return addFidInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n const timeOrigin = msToSec(browserPerformanceTimeOrigin );\n const startTime = msToSec(entry.startTime);\n DEBUG_BUILD && logger.log('[Measurements] Adding FID');\n _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n });\n}\n\nfunction _trackTtfb() {\n return addTtfbInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding TTFB');\n _measurements['ttfb'] = { value: metric.value, unit: 'millisecond' };\n });\n}\n\n/** Add performance related spans to a transaction */\nfunction addPerformanceEntries(span, options) {\n const performance = getBrowserPerformanceAPI();\n if (!performance || !WINDOW.performance.getEntries || !browserPerformanceTimeOrigin) {\n // Gatekeeper if performance API not available\n return;\n }\n\n DEBUG_BUILD && logger.log('[Tracing] Adding & adjusting spans using Performance API');\n const timeOrigin = msToSec(browserPerformanceTimeOrigin);\n\n const performanceEntries = performance.getEntries();\n\n const { op, start_timestamp: transactionStartTime } = spanToJSON(span);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n performanceEntries.slice(_performanceCursor).forEach((entry) => {\n const startTime = msToSec(entry.startTime);\n const duration = msToSec(\n // Inexplicably, Chrome sometimes emits a negative duration. We need to work around this.\n // There is a SO post attempting to explain this, but it leaves one with open questions: https://stackoverflow.com/questions/23191918/peformance-getentries-and-negative-duration-display\n // The way we clamp the value is probably not accurate, since we have observed this happen for things that may take a while to load, like for example the replay worker.\n // TODO: Investigate why this happens and how to properly mitigate. For now, this is a workaround to prevent transactions being dropped due to negative duration spans.\n Math.max(0, entry.duration),\n );\n\n if (op === 'navigation' && transactionStartTime && timeOrigin + startTime < transactionStartTime) {\n return;\n }\n\n switch (entry.entryType) {\n case 'navigation': {\n _addNavigationSpans(span, entry, timeOrigin);\n break;\n }\n case 'mark':\n case 'paint':\n case 'measure': {\n _addMeasureSpans(span, entry, startTime, duration, timeOrigin);\n\n // capture web vitals\n const firstHidden = getVisibilityWatcher();\n // Only report if the page wasn't hidden prior to the web vital.\n const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;\n\n if (entry.name === 'first-paint' && shouldRecord) {\n DEBUG_BUILD && logger.log('[Measurements] Adding FP');\n _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };\n }\n if (entry.name === 'first-contentful-paint' && shouldRecord) {\n DEBUG_BUILD && logger.log('[Measurements] Adding FCP');\n _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };\n }\n break;\n }\n case 'resource': {\n _addResourceSpans(span, entry, entry.name , startTime, duration, timeOrigin);\n break;\n }\n // Ignore other entry types.\n }\n });\n\n _performanceCursor = Math.max(performanceEntries.length - 1, 0);\n\n _trackNavigator(span);\n\n // Measurements are only available for pageload transactions\n if (op === 'pageload') {\n _addTtfbRequestTimeToMeasurements(_measurements);\n\n const fidMark = _measurements['mark.fid'];\n if (fidMark && _measurements['fid']) {\n // create span for FID\n startAndEndSpan(span, fidMark.value, fidMark.value + msToSec(_measurements['fid'].value), {\n name: 'first input delay',\n op: 'ui.action',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',\n },\n });\n\n // Delete mark.fid as we don't want it to be part of final payload\n delete _measurements['mark.fid'];\n }\n\n // If FCP is not recorded we should not record the cls value\n // according to the new definition of CLS.\n // TODO: Check if the first condition is still necessary: `onCLS` already only fires once `onFCP` was called.\n if (!('fcp' in _measurements) || !options.recordClsOnPageloadSpan) {\n delete _measurements.cls;\n }\n\n Object.entries(_measurements).forEach(([measurementName, measurement]) => {\n setMeasurement(measurementName, measurement.value, measurement.unit);\n });\n\n // Set timeOrigin which denotes the timestamp which to base the LCP/FCP/FP/TTFB measurements on\n span.setAttribute('performance.timeOrigin', timeOrigin);\n\n // In prerendering scenarios, where a page might be prefetched and pre-rendered before the user clicks the link,\n // the navigation starts earlier than when the user clicks it. Web Vitals should always be based on the\n // user-perceived time, so they are not reported from the actual start of the navigation, but rather from the\n // time where the user actively started the navigation, for example by clicking a link.\n // This is user action is called \"activation\" and the time between navigation and activation is stored in\n // the `activationStart` attribute of the \"navigation\" PerformanceEntry.\n span.setAttribute('performance.activationStart', getActivationStart());\n\n _setWebVitalAttributes(span);\n }\n\n _lcpEntry = undefined;\n _clsEntry = undefined;\n _measurements = {};\n}\n\n/** Create measure related spans */\nfunction _addMeasureSpans(\n span,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n entry,\n startTime,\n duration,\n timeOrigin,\n) {\n const navEntry = getNavigationEntry();\n const requestTime = msToSec(navEntry ? navEntry.requestStart : 0);\n // Because performance.measure accepts arbitrary timestamps it can produce\n // spans that happen before the browser even makes a request for the page.\n //\n // An example of this is the automatically generated Next.js-before-hydration\n // spans created by the Next.js framework.\n //\n // To prevent this we will pin the start timestamp to the request start time\n // This does make duration inaccruate, so if this does happen, we will add\n // an attribute to the span\n const measureStartTimestamp = timeOrigin + Math.max(startTime, requestTime);\n const startTimeStamp = timeOrigin + startTime;\n const measureEndTimestamp = startTimeStamp + duration;\n\n const attributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics',\n };\n\n if (measureStartTimestamp !== startTimeStamp) {\n attributes['sentry.browser.measure_happened_before_request'] = true;\n attributes['sentry.browser.measure_start_time'] = measureStartTimestamp;\n }\n\n startAndEndSpan(span, measureStartTimestamp, measureEndTimestamp, {\n name: entry.name ,\n op: entry.entryType ,\n attributes,\n });\n\n return measureStartTimestamp;\n}\n\n/** Instrument navigation entries */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addNavigationSpans(span, entry, timeOrigin) {\n ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => {\n _addPerformanceNavigationTiming(span, entry, event, timeOrigin);\n });\n _addPerformanceNavigationTiming(span, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd');\n _addPerformanceNavigationTiming(span, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart');\n _addPerformanceNavigationTiming(span, entry, 'domainLookup', timeOrigin, 'DNS');\n _addRequest(span, entry, timeOrigin);\n}\n\n/** Create performance navigation related spans */\nfunction _addPerformanceNavigationTiming(\n span,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n entry,\n event,\n timeOrigin,\n name,\n eventEnd,\n) {\n const end = eventEnd ? (entry[eventEnd] ) : (entry[`${event}End`] );\n const start = entry[`${event}Start`] ;\n if (!start || !end) {\n return;\n }\n startAndEndSpan(span, timeOrigin + msToSec(start), timeOrigin + msToSec(end), {\n op: `browser.${name || event}`,\n name: entry.name,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',\n },\n });\n}\n\n/** Create request and response related spans */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addRequest(span, entry, timeOrigin) {\n const requestStartTimestamp = timeOrigin + msToSec(entry.requestStart );\n const responseEndTimestamp = timeOrigin + msToSec(entry.responseEnd );\n const responseStartTimestamp = timeOrigin + msToSec(entry.responseStart );\n if (entry.responseEnd) {\n // It is possible that we are collecting these metrics when the page hasn't finished loading yet, for example when the HTML slowly streams in.\n // In this case, ie. when the document request hasn't finished yet, `entry.responseEnd` will be 0.\n // In order not to produce faulty spans, where the end timestamp is before the start timestamp, we will only collect\n // these spans when the responseEnd value is available. The backend (Relay) would drop the entire span if it contained faulty spans.\n startAndEndSpan(span, requestStartTimestamp, responseEndTimestamp, {\n op: 'browser.request',\n name: entry.name,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',\n },\n });\n\n startAndEndSpan(span, responseStartTimestamp, responseEndTimestamp, {\n op: 'browser.response',\n name: entry.name,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',\n },\n });\n }\n}\n\n/** Create resource-related spans */\nfunction _addResourceSpans(\n span,\n entry,\n resourceUrl,\n startTime,\n duration,\n timeOrigin,\n) {\n // we already instrument based on fetch and xhr, so we don't need to\n // duplicate spans here.\n if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n return;\n }\n\n const parsedUrl = parseUrl(resourceUrl);\n\n const attributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics',\n };\n setResourceEntrySizeData(attributes, entry, 'transferSize', 'http.response_transfer_size');\n setResourceEntrySizeData(attributes, entry, 'encodedBodySize', 'http.response_content_length');\n setResourceEntrySizeData(attributes, entry, 'decodedBodySize', 'http.decoded_response_content_length');\n\n if ('renderBlockingStatus' in entry) {\n attributes['resource.render_blocking_status'] = entry.renderBlockingStatus;\n }\n if (parsedUrl.protocol) {\n attributes['url.scheme'] = parsedUrl.protocol.split(':').pop(); // the protocol returned by parseUrl includes a :, but OTEL spec does not, so we remove it.\n }\n\n if (parsedUrl.host) {\n attributes['server.address'] = parsedUrl.host;\n }\n\n attributes['url.same_origin'] = resourceUrl.includes(WINDOW.location.origin);\n\n const startTimestamp = timeOrigin + startTime;\n const endTimestamp = startTimestamp + duration;\n\n startAndEndSpan(span, startTimestamp, endTimestamp, {\n name: resourceUrl.replace(WINDOW.location.origin, ''),\n op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',\n attributes,\n });\n}\n\n/**\n * Capture the information of the user agent.\n */\nfunction _trackNavigator(span) {\n const navigator = WINDOW.navigator ;\n if (!navigator) {\n return;\n }\n\n // track network connectivity\n const connection = navigator.connection;\n if (connection) {\n if (connection.effectiveType) {\n span.setAttribute('effectiveConnectionType', connection.effectiveType);\n }\n\n if (connection.type) {\n span.setAttribute('connectionType', connection.type);\n }\n\n if (isMeasurementValue(connection.rtt)) {\n _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };\n }\n }\n\n if (isMeasurementValue(navigator.deviceMemory)) {\n span.setAttribute('deviceMemory', `${navigator.deviceMemory} GB`);\n }\n\n if (isMeasurementValue(navigator.hardwareConcurrency)) {\n span.setAttribute('hardwareConcurrency', String(navigator.hardwareConcurrency));\n }\n}\n\n/** Add LCP / CLS data to span to allow debugging */\nfunction _setWebVitalAttributes(span) {\n if (_lcpEntry) {\n DEBUG_BUILD && logger.log('[Measurements] Adding LCP Data');\n\n // Capture Properties of the LCP element that contributes to the LCP.\n\n if (_lcpEntry.element) {\n span.setAttribute('lcp.element', htmlTreeAsString(_lcpEntry.element));\n }\n\n if (_lcpEntry.id) {\n span.setAttribute('lcp.id', _lcpEntry.id);\n }\n\n if (_lcpEntry.url) {\n // Trim URL to the first 200 characters.\n span.setAttribute('lcp.url', _lcpEntry.url.trim().slice(0, 200));\n }\n\n span.setAttribute('lcp.size', _lcpEntry.size);\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift\n if (_clsEntry && _clsEntry.sources) {\n DEBUG_BUILD && logger.log('[Measurements] Adding CLS Data');\n _clsEntry.sources.forEach((source, index) =>\n span.setAttribute(`cls.source.${index + 1}`, htmlTreeAsString(source.node)),\n );\n }\n}\n\nfunction setResourceEntrySizeData(\n attributes,\n entry,\n key,\n dataKey,\n) {\n const entryVal = entry[key];\n if (entryVal != null && entryVal < MAX_INT_AS_BYTES) {\n attributes[dataKey] = entryVal;\n }\n}\n\n/**\n * Add ttfb request time information to measurements.\n *\n * ttfb information is added via vendored web vitals library.\n */\nfunction _addTtfbRequestTimeToMeasurements(_measurements) {\n const navEntry = getNavigationEntry();\n if (!navEntry) {\n return;\n }\n\n const { responseStart, requestStart } = navEntry;\n\n if (requestStart <= responseStart) {\n DEBUG_BUILD && logger.log('[Measurements] Adding TTFB Request Time');\n _measurements['ttfb.requestTime'] = {\n value: responseStart - requestStart,\n unit: 'millisecond',\n };\n }\n}\n\nexport { _addMeasureSpans, _addResourceSpans, addPerformanceEntries, startTrackingInteractions, startTrackingLongAnimationFrames, startTrackingLongTasks, startTrackingWebVitals };\n//# sourceMappingURL=browserMetrics.js.map\n","import { _optionalChain } from '@sentry/utils';\nimport { getActiveSpan, getRootSpan, spanToJSON, getCurrentScope, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE } from '@sentry/core';\nimport { browserPerformanceTimeOrigin, htmlTreeAsString, dropUndefinedKeys } from '@sentry/utils';\nimport { addInpInstrumentationHandler, addPerformanceInstrumentationHandler, isPerformanceEventTiming } from './instrument.js';\nimport { getBrowserPerformanceAPI, msToSec, startStandaloneWebVitalSpan } from './utils.js';\n\nconst LAST_INTERACTIONS = [];\nconst INTERACTIONS_SPAN_MAP = new Map();\n\n/**\n * Start tracking INP webvital events.\n */\nfunction startTrackingINP() {\n const performance = getBrowserPerformanceAPI();\n if (performance && browserPerformanceTimeOrigin) {\n const inpCallback = _trackINP();\n\n return () => {\n inpCallback();\n };\n }\n\n return () => undefined;\n}\n\nconst INP_ENTRY_MAP = {\n click: 'click',\n pointerdown: 'click',\n pointerup: 'click',\n mousedown: 'click',\n mouseup: 'click',\n touchstart: 'click',\n touchend: 'click',\n mouseover: 'hover',\n mouseout: 'hover',\n mouseenter: 'hover',\n mouseleave: 'hover',\n pointerover: 'hover',\n pointerout: 'hover',\n pointerenter: 'hover',\n pointerleave: 'hover',\n dragstart: 'drag',\n dragend: 'drag',\n drag: 'drag',\n dragenter: 'drag',\n dragleave: 'drag',\n dragover: 'drag',\n drop: 'drag',\n keydown: 'press',\n keyup: 'press',\n keypress: 'press',\n input: 'press',\n};\n\n/** Starts tracking the Interaction to Next Paint on the current page. */\nfunction _trackINP() {\n return addInpInstrumentationHandler(({ metric }) => {\n if (metric.value == undefined) {\n return;\n }\n\n const entry = metric.entries.find(entry => entry.duration === metric.value && INP_ENTRY_MAP[entry.name]);\n\n if (!entry) {\n return;\n }\n\n const { interactionId } = entry;\n const interactionType = INP_ENTRY_MAP[entry.name];\n\n /** Build the INP span, create an envelope from the span, and then send the envelope */\n const startTime = msToSec((browserPerformanceTimeOrigin ) + entry.startTime);\n const duration = msToSec(metric.value);\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan ? getRootSpan(activeSpan) : undefined;\n\n // We first try to lookup the span from our INTERACTIONS_SPAN_MAP,\n // where we cache the route per interactionId\n const cachedSpan = interactionId != null ? INTERACTIONS_SPAN_MAP.get(interactionId) : undefined;\n\n const spanToUse = cachedSpan || rootSpan;\n\n // Else, we try to use the active span.\n // Finally, we fall back to look at the transactionName on the scope\n const routeName = spanToUse ? spanToJSON(spanToUse).description : getCurrentScope().getScopeData().transactionName;\n\n const name = htmlTreeAsString(entry.target);\n const attributes = dropUndefinedKeys({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser.inp',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `ui.interaction.${interactionType}`,\n [SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: entry.duration,\n });\n\n const span = startStandaloneWebVitalSpan({\n name,\n transaction: routeName,\n attributes,\n startTime,\n });\n\n _optionalChain([span, 'optionalAccess', _ => _.addEvent, 'call', _2 => _2('inp', {\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: 'millisecond',\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: metric.value,\n })]);\n\n _optionalChain([span, 'optionalAccess', _3 => _3.end, 'call', _4 => _4(startTime + duration)]);\n });\n}\n\n/**\n * Register a listener to cache route information for INP interactions.\n * TODO(v9): `latestRoute` no longer needs to be passed in and will be removed in v9.\n */\nfunction registerInpInteractionListener(_latestRoute) {\n const handleEntries = ({ entries }) => {\n const activeSpan = getActiveSpan();\n const activeRootSpan = activeSpan && getRootSpan(activeSpan);\n\n entries.forEach(entry => {\n if (!isPerformanceEventTiming(entry) || !activeRootSpan) {\n return;\n }\n\n const interactionId = entry.interactionId;\n if (interactionId == null) {\n return;\n }\n\n // If the interaction was already recorded before, nothing more to do\n if (INTERACTIONS_SPAN_MAP.has(interactionId)) {\n return;\n }\n\n // We keep max. 10 interactions in the list, then remove the oldest one & clean up\n if (LAST_INTERACTIONS.length > 10) {\n const last = LAST_INTERACTIONS.shift() ;\n INTERACTIONS_SPAN_MAP.delete(last);\n }\n\n // We add the interaction to the list of recorded interactions\n // and store the span for this interaction\n LAST_INTERACTIONS.push(interactionId);\n INTERACTIONS_SPAN_MAP.set(interactionId, activeRootSpan);\n });\n };\n\n addPerformanceInstrumentationHandler('event', handleEntries);\n addPerformanceInstrumentationHandler('first-input', handleEntries);\n}\n\nexport { registerInpInteractionListener, startTrackingINP };\n//# sourceMappingURL=inp.js.map\n","import { timestampInSeconds, logger } from '@sentry/utils';\nimport { getClient, getCurrentScope } from '../currentScopes.js';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON } from '../semanticAttributes.js';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled.js';\nimport { _setSpanForScope } from '../utils/spanOnScope.js';\nimport { getActiveSpan, spanTimeInputToSeconds, getSpanDescendants, spanToJSON, removeChildSpanFromSpan } from '../utils/spanUtils.js';\nimport { SentryNonRecordingSpan } from './sentryNonRecordingSpan.js';\nimport { SPAN_STATUS_ERROR } from './spanstatus.js';\nimport { startInactiveSpan } from './trace.js';\n\nconst TRACING_DEFAULTS = {\n idleTimeout: 1000,\n finalTimeout: 30000,\n childSpanTimeout: 15000,\n};\n\nconst FINISH_REASON_HEARTBEAT_FAILED = 'heartbeatFailed';\nconst FINISH_REASON_IDLE_TIMEOUT = 'idleTimeout';\nconst FINISH_REASON_FINAL_TIMEOUT = 'finalTimeout';\nconst FINISH_REASON_EXTERNAL_FINISH = 'externalFinish';\n\n/**\n * An idle span is a span that automatically finishes. It does this by tracking child spans as activities.\n * An idle span is always the active span.\n */\nfunction startIdleSpan(startSpanOptions, options = {}) {\n // Activities store a list of active spans\n const activities = new Map();\n\n // We should not use heartbeat if we finished a span\n let _finished = false;\n\n // Timer that tracks idleTimeout\n let _idleTimeoutID;\n\n // The reason why the span was finished\n let _finishReason = FINISH_REASON_EXTERNAL_FINISH;\n\n let _autoFinishAllowed = !options.disableAutoFinish;\n\n const _cleanupHooks = [];\n\n const {\n idleTimeout = TRACING_DEFAULTS.idleTimeout,\n finalTimeout = TRACING_DEFAULTS.finalTimeout,\n childSpanTimeout = TRACING_DEFAULTS.childSpanTimeout,\n beforeSpanEnd,\n } = options;\n\n const client = getClient();\n\n if (!client || !hasTracingEnabled()) {\n return new SentryNonRecordingSpan();\n }\n\n const scope = getCurrentScope();\n const previousActiveSpan = getActiveSpan();\n const span = _startIdleSpan(startSpanOptions);\n\n // We patch span.end to ensure we can run some things before the span is ended\n // eslint-disable-next-line @typescript-eslint/unbound-method\n span.end = new Proxy(span.end, {\n apply(target, thisArg, args) {\n if (beforeSpanEnd) {\n beforeSpanEnd(span);\n }\n\n // Just ensuring that this keeps working, even if we ever have more arguments here\n const [definedEndTimestamp, ...rest] = args;\n const timestamp = definedEndTimestamp || timestampInSeconds();\n const spanEndTimestamp = spanTimeInputToSeconds(timestamp);\n\n // Ensure we end with the last span timestamp, if possible\n const spans = getSpanDescendants(span).filter(child => child !== span);\n\n // If we have no spans, we just end, nothing else to do here\n if (!spans.length) {\n onIdleSpanEnded(spanEndTimestamp);\n return Reflect.apply(target, thisArg, [spanEndTimestamp, ...rest]);\n }\n\n const childEndTimestamps = spans\n .map(span => spanToJSON(span).timestamp)\n .filter(timestamp => !!timestamp) ;\n const latestSpanEndTimestamp = childEndTimestamps.length ? Math.max(...childEndTimestamps) : undefined;\n\n // In reality this should always exist here, but type-wise it may be undefined...\n const spanStartTimestamp = spanToJSON(span).start_timestamp;\n\n // The final endTimestamp should:\n // * Never be before the span start timestamp\n // * Be the latestSpanEndTimestamp, if there is one, and it is smaller than the passed span end timestamp\n // * Otherwise be the passed end timestamp\n // Final timestamp can never be after finalTimeout\n const endTimestamp = Math.min(\n spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1000 : Infinity,\n Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)),\n );\n\n onIdleSpanEnded(endTimestamp);\n return Reflect.apply(target, thisArg, [endTimestamp, ...rest]);\n },\n });\n\n /**\n * Cancels the existing idle timeout, if there is one.\n */\n function _cancelIdleTimeout() {\n if (_idleTimeoutID) {\n clearTimeout(_idleTimeoutID);\n _idleTimeoutID = undefined;\n }\n }\n\n /**\n * Restarts idle timeout, if there is no running idle timeout it will start one.\n */\n function _restartIdleTimeout(endTimestamp) {\n _cancelIdleTimeout();\n _idleTimeoutID = setTimeout(() => {\n if (!_finished && activities.size === 0 && _autoFinishAllowed) {\n _finishReason = FINISH_REASON_IDLE_TIMEOUT;\n span.end(endTimestamp);\n }\n }, idleTimeout);\n }\n\n /**\n * Restarts child span timeout, if there is none running it will start one.\n */\n function _restartChildSpanTimeout(endTimestamp) {\n _idleTimeoutID = setTimeout(() => {\n if (!_finished && _autoFinishAllowed) {\n _finishReason = FINISH_REASON_HEARTBEAT_FAILED;\n span.end(endTimestamp);\n }\n }, childSpanTimeout);\n }\n\n /**\n * Start tracking a specific activity.\n * @param spanId The span id that represents the activity\n */\n function _pushActivity(spanId) {\n _cancelIdleTimeout();\n activities.set(spanId, true);\n\n const endTimestamp = timestampInSeconds();\n // We need to add the timeout here to have the real endtimestamp of the idle span\n // Remember timestampInSeconds is in seconds, timeout is in ms\n _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1000);\n }\n\n /**\n * Remove an activity from usage\n * @param spanId The span id that represents the activity\n */\n function _popActivity(spanId) {\n if (activities.has(spanId)) {\n activities.delete(spanId);\n }\n\n if (activities.size === 0) {\n const endTimestamp = timestampInSeconds();\n // We need to add the timeout here to have the real endtimestamp of the idle span\n // Remember timestampInSeconds is in seconds, timeout is in ms\n _restartIdleTimeout(endTimestamp + idleTimeout / 1000);\n }\n }\n\n function onIdleSpanEnded(endTimestamp) {\n _finished = true;\n activities.clear();\n\n _cleanupHooks.forEach(cleanup => cleanup());\n\n _setSpanForScope(scope, previousActiveSpan);\n\n const spanJSON = spanToJSON(span);\n\n const { start_timestamp: startTimestamp } = spanJSON;\n // This should never happen, but to make TS happy...\n if (!startTimestamp) {\n return;\n }\n\n const attributes = spanJSON.data || {};\n if (!attributes[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason);\n }\n\n logger.log(`[Tracing] Idle span \"${spanJSON.op}\" finished`);\n\n const childSpans = getSpanDescendants(span).filter(child => child !== span);\n\n let discardedSpans = 0;\n childSpans.forEach(childSpan => {\n // We cancel all pending spans with status \"cancelled\" to indicate the idle span was finished early\n if (childSpan.isRecording()) {\n childSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'cancelled' });\n childSpan.end(endTimestamp);\n DEBUG_BUILD &&\n logger.log('[Tracing] Cancelling span since span ended early', JSON.stringify(childSpan, undefined, 2));\n }\n\n const childSpanJSON = spanToJSON(childSpan);\n const { timestamp: childEndTimestamp = 0, start_timestamp: childStartTimestamp = 0 } = childSpanJSON;\n\n const spanStartedBeforeIdleSpanEnd = childStartTimestamp <= endTimestamp;\n\n // Add a delta with idle timeout so that we prevent false positives\n const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1000;\n const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError;\n\n if (DEBUG_BUILD) {\n const stringifiedSpan = JSON.stringify(childSpan, undefined, 2);\n if (!spanStartedBeforeIdleSpanEnd) {\n logger.log('[Tracing] Discarding span since it happened after idle span was finished', stringifiedSpan);\n } else if (!spanEndedBeforeFinalTimeout) {\n logger.log('[Tracing] Discarding span since it finished after idle span final timeout', stringifiedSpan);\n }\n }\n\n if (!spanEndedBeforeFinalTimeout || !spanStartedBeforeIdleSpanEnd) {\n removeChildSpanFromSpan(span, childSpan);\n discardedSpans++;\n }\n });\n\n if (discardedSpans > 0) {\n span.setAttribute('sentry.idle_span_discarded_spans', discardedSpans);\n }\n }\n\n _cleanupHooks.push(\n client.on('spanStart', startedSpan => {\n // If we already finished the idle span,\n // or if this is the idle span itself being started,\n // or if the started span has already been closed,\n // we don't care about it for activity\n if (_finished || startedSpan === span || !!spanToJSON(startedSpan).timestamp) {\n return;\n }\n\n const allSpans = getSpanDescendants(span);\n\n // If the span that was just started is a child of the idle span, we should track it\n if (allSpans.includes(startedSpan)) {\n _pushActivity(startedSpan.spanContext().spanId);\n }\n }),\n );\n\n _cleanupHooks.push(\n client.on('spanEnd', endedSpan => {\n if (_finished) {\n return;\n }\n\n _popActivity(endedSpan.spanContext().spanId);\n }),\n );\n\n _cleanupHooks.push(\n client.on('idleSpanEnableAutoFinish', spanToAllowAutoFinish => {\n if (spanToAllowAutoFinish === span) {\n _autoFinishAllowed = true;\n _restartIdleTimeout();\n\n if (activities.size) {\n _restartChildSpanTimeout();\n }\n }\n }),\n );\n\n // We only start the initial idle timeout if we are not delaying the auto finish\n if (!options.disableAutoFinish) {\n _restartIdleTimeout();\n }\n\n setTimeout(() => {\n if (!_finished) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' });\n _finishReason = FINISH_REASON_FINAL_TIMEOUT;\n span.end();\n }\n }, finalTimeout);\n\n return span;\n}\n\nfunction _startIdleSpan(options) {\n const span = startInactiveSpan(options);\n\n _setSpanForScope(getCurrentScope(), span);\n\n DEBUG_BUILD && logger.log('[Tracing] Started span is an idle span');\n\n return span;\n}\n\nexport { TRACING_DEFAULTS, startIdleSpan };\n//# sourceMappingURL=idleSpan.js.map\n","import { addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getActiveSpan, getRootSpan } from '../utils/spanUtils.js';\nimport { SPAN_STATUS_ERROR } from './spanstatus.js';\n\nlet errorsInstrumented = false;\n\n/**\n * Ensure that global errors automatically set the active span status.\n */\nfunction registerSpanErrorInstrumentation() {\n if (errorsInstrumented) {\n return;\n }\n\n errorsInstrumented = true;\n addGlobalErrorInstrumentationHandler(errorCallback);\n addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active root span as failed\n */\nfunction errorCallback() {\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan && getRootSpan(activeSpan);\n if (rootSpan) {\n const message = 'internal_error';\n DEBUG_BUILD && logger.log(`[Tracing] Root span: ${message} -> Global error occured`);\n rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message });\n }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n\nexport { registerSpanErrorInstrumentation };\n//# sourceMappingURL=errors.js.map\n","import { getActiveSpan, getRootSpan, spanToJSON, SPAN_STATUS_ERROR } from '@sentry/core';\nimport { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { WINDOW } from '../helpers.js';\n\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\nfunction registerBackgroundTabDetection() {\n if (WINDOW && WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n\n const rootSpan = getRootSpan(activeSpan);\n\n if (WINDOW.document.hidden && rootSpan) {\n const cancelledStatus = 'cancelled';\n\n const { op, status } = spanToJSON(rootSpan);\n\n if (DEBUG_BUILD) {\n logger.log(`[Tracing] Transaction: ${cancelledStatus} -> since tab moved to the background, op: ${op}`);\n }\n\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!status) {\n rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message: cancelledStatus });\n }\n\n rootSpan.setAttribute('sentry.cancellation_reason', 'document.hidden');\n rootSpan.end();\n }\n });\n } else {\n DEBUG_BUILD && logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}\n\nexport { registerBackgroundTabDetection };\n//# sourceMappingURL=backgroundtab.js.map\n","import { parseUrl, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, isInstanceOf, BAGGAGE_HEADER_NAME } from '@sentry/utils';\nimport { getCurrentScope, getClient, getIsolationScope } from './currentScopes.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_OP } from './semanticAttributes.js';\nimport './tracing/errors.js';\nimport './debug-build.js';\nimport { hasTracingEnabled } from './utils/hasTracingEnabled.js';\nimport { getActiveSpan, spanToTraceHeader } from './utils/spanUtils.js';\nimport { SentryNonRecordingSpan } from './tracing/sentryNonRecordingSpan.js';\nimport { setHttpStatus, SPAN_STATUS_ERROR } from './tracing/spanstatus.js';\nimport { startInactiveSpan } from './tracing/trace.js';\nimport { getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext.js';\n\n/**\n * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.\n *\n * @returns Span if a span was created, otherwise void.\n */\nfunction instrumentFetchRequest(\n handlerData,\n shouldCreateSpan,\n shouldAttachHeaders,\n spans,\n spanOrigin = 'auto.http.browser',\n) {\n if (!handlerData.fetchData) {\n return undefined;\n }\n\n const shouldCreateSpanResult = hasTracingEnabled() && shouldCreateSpan(handlerData.fetchData.url);\n\n if (handlerData.endTimestamp && shouldCreateSpanResult) {\n const spanId = handlerData.fetchData.__span;\n if (!spanId) return;\n\n const span = spans[spanId];\n if (span) {\n endSpan(span, handlerData);\n\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n return undefined;\n }\n\n const scope = getCurrentScope();\n const client = getClient();\n\n const { method, url } = handlerData.fetchData;\n\n const fullUrl = getFullURL(url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n\n const hasParent = !!getActiveSpan();\n\n const span =\n shouldCreateSpanResult && hasParent\n ? startInactiveSpan({\n name: `${method} ${url}`,\n attributes: {\n url,\n type: 'fetch',\n 'http.method': method,\n 'http.url': fullUrl,\n 'server.address': host,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client',\n },\n })\n : new SentryNonRecordingSpan();\n\n handlerData.fetchData.__span = span.spanContext().spanId;\n spans[span.spanContext().spanId] = span;\n\n if (shouldAttachHeaders(handlerData.fetchData.url) && client) {\n const request = handlerData.args[0];\n\n // In case the user hasn't set the second argument of a fetch call we default it to `{}`.\n handlerData.args[1] = handlerData.args[1] || {};\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const options = handlerData.args[1];\n\n options.headers = addTracingHeadersToFetchRequest(\n request,\n client,\n scope,\n options,\n // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction),\n // we do not want to use the span as base for the trace headers,\n // which means that the headers will be generated from the scope and the sampling decision is deferred\n hasTracingEnabled() && hasParent ? span : undefined,\n );\n }\n\n return span;\n}\n\n/**\n * Adds sentry-trace and baggage headers to the various forms of fetch headers\n */\nfunction addTracingHeadersToFetchRequest(\n request, // unknown is actually type Request but we can't export DOM types from this package,\n client,\n scope,\n options\n\n,\n span,\n) {\n const isolationScope = getIsolationScope();\n\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = span ? spanToTraceHeader(span) : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc || (span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromClient(traceId, client)),\n );\n\n const headers =\n options.headers ||\n (typeof Request !== 'undefined' && isInstanceOf(request, Request) ? (request ).headers : undefined);\n\n if (!headers) {\n return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };\n } else if (typeof Headers !== 'undefined' && isInstanceOf(headers, Headers)) {\n const newHeaders = new Headers(headers );\n\n newHeaders.append('sentry-trace', sentryTraceHeader);\n\n if (sentryBaggageHeader) {\n // If the same header is appended multiple times the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.append(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n }\n\n return newHeaders ;\n } else if (Array.isArray(headers)) {\n const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];\n\n if (sentryBaggageHeader) {\n // If there are multiple entries with the same key, the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.push([BAGGAGE_HEADER_NAME, sentryBaggageHeader]);\n }\n\n return newHeaders ;\n } else {\n const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;\n const newBaggageHeaders = [];\n\n if (Array.isArray(existingBaggageHeader)) {\n newBaggageHeaders.push(...existingBaggageHeader);\n } else if (existingBaggageHeader) {\n newBaggageHeaders.push(existingBaggageHeader);\n }\n\n if (sentryBaggageHeader) {\n newBaggageHeaders.push(sentryBaggageHeader);\n }\n\n return {\n ...(headers ),\n 'sentry-trace': sentryTraceHeader,\n baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,\n };\n }\n}\n\nfunction getFullURL(url) {\n try {\n const parsed = new URL(url);\n return parsed.href;\n } catch (e) {\n return undefined;\n }\n}\n\nfunction endSpan(span, handlerData) {\n if (handlerData.response) {\n setHttpStatus(span, handlerData.response.status);\n\n const contentLength =\n handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length');\n\n if (contentLength) {\n const contentLengthNum = parseInt(contentLength);\n if (contentLengthNum > 0) {\n span.setAttribute('http.response_content_length', contentLengthNum);\n }\n }\n } else if (handlerData.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n }\n span.end();\n}\n\nexport { addTracingHeadersToFetchRequest, instrumentFetchRequest };\n//# sourceMappingURL=fetch.js.map\n","import { addXhrInstrumentationHandler, addPerformanceInstrumentationHandler, SENTRY_XHR_DATA_KEY } from '@sentry-internal/browser-utils';\nimport { instrumentFetchRequest, spanToJSON, hasTracingEnabled, setHttpStatus, getActiveSpan, startInactiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_OP, SentryNonRecordingSpan, getClient, getCurrentScope, getIsolationScope, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient } from '@sentry/core';\nimport { addFetchEndInstrumentationHandler, addFetchInstrumentationHandler, parseUrl, browserPerformanceTimeOrigin, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, BAGGAGE_HEADER_NAME, stringMatchesSomePattern } from '@sentry/utils';\nimport { WINDOW } from '../helpers.js';\n\n/** Options for Request Instrumentation */\n\nconst responseToSpanId = new WeakMap();\nconst spanIdToEndTimestamp = new Map();\n\nconst defaultRequestInstrumentationOptions = {\n traceFetch: true,\n traceXHR: true,\n enableHTTPTimings: true,\n};\n\n/** Registers span creators for xhr and fetch requests */\nfunction instrumentOutgoingRequests(client, _options) {\n const { traceFetch, traceXHR, shouldCreateSpanForRequest, enableHTTPTimings, tracePropagationTargets } = {\n traceFetch: defaultRequestInstrumentationOptions.traceFetch,\n traceXHR: defaultRequestInstrumentationOptions.traceXHR,\n ..._options,\n };\n\n const shouldCreateSpan =\n typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_) => true;\n\n const shouldAttachHeadersWithTargets = (url) => shouldAttachHeaders(url, tracePropagationTargets);\n\n const spans = {};\n\n if (traceFetch) {\n // Keeping track of http requests, whose body payloads resolved later than the intial resolved request\n // e.g. streaming using server sent events (SSE)\n client.addEventProcessor(event => {\n if (event.type === 'transaction' && event.spans) {\n event.spans.forEach(span => {\n if (span.op === 'http.client') {\n const updatedTimestamp = spanIdToEndTimestamp.get(span.span_id);\n if (updatedTimestamp) {\n span.timestamp = updatedTimestamp / 1000;\n spanIdToEndTimestamp.delete(span.span_id);\n }\n }\n });\n }\n return event;\n });\n\n addFetchEndInstrumentationHandler(handlerData => {\n if (handlerData.response) {\n const span = responseToSpanId.get(handlerData.response);\n if (span && handlerData.endTimestamp) {\n spanIdToEndTimestamp.set(span, handlerData.endTimestamp);\n }\n }\n });\n\n addFetchInstrumentationHandler(handlerData => {\n const createdSpan = instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n\n if (handlerData.response && handlerData.fetchData.__span) {\n responseToSpanId.set(handlerData.response, handlerData.fetchData.__span);\n }\n\n // We cannot use `window.location` in the generic fetch instrumentation,\n // but we need it for reliable `server.address` attribute.\n // so we extend this in here\n if (createdSpan) {\n const fullUrl = getFullURL(handlerData.fetchData.url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n createdSpan.setAttributes({\n 'http.url': fullUrl,\n 'server.address': host,\n });\n }\n\n if (enableHTTPTimings && createdSpan) {\n addHTTPTimings(createdSpan);\n }\n });\n }\n\n if (traceXHR) {\n addXhrInstrumentationHandler(handlerData => {\n const createdSpan = xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n if (enableHTTPTimings && createdSpan) {\n addHTTPTimings(createdSpan);\n }\n });\n }\n}\n\nfunction isPerformanceResourceTiming(entry) {\n return (\n entry.entryType === 'resource' &&\n 'initiatorType' in entry &&\n typeof (entry ).nextHopProtocol === 'string' &&\n (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest')\n );\n}\n\n/**\n * Creates a temporary observer to listen to the next fetch/xhr resourcing timings,\n * so that when timings hit their per-browser limit they don't need to be removed.\n *\n * @param span A span that has yet to be finished, must contain `url` on data.\n */\nfunction addHTTPTimings(span) {\n const { url } = spanToJSON(span).data || {};\n\n if (!url || typeof url !== 'string') {\n return;\n }\n\n const cleanup = addPerformanceInstrumentationHandler('resource', ({ entries }) => {\n entries.forEach(entry => {\n if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) {\n const spanData = resourceTimingEntryToSpanData(entry);\n spanData.forEach(data => span.setAttribute(...data));\n // In the next tick, clean this handler up\n // We have to wait here because otherwise this cleans itself up before it is fully done\n setTimeout(cleanup);\n }\n });\n });\n}\n\n/**\n * Converts ALPN protocol ids to name and version.\n *\n * (https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids)\n * @param nextHopProtocol PerformanceResourceTiming.nextHopProtocol\n */\nfunction extractNetworkProtocol(nextHopProtocol) {\n let name = 'unknown';\n let version = 'unknown';\n let _name = '';\n for (const char of nextHopProtocol) {\n // http/1.1 etc.\n if (char === '/') {\n [name, version] = nextHopProtocol.split('/') ;\n break;\n }\n // h2, h3 etc.\n if (!isNaN(Number(char))) {\n name = _name === 'h' ? 'http' : _name;\n version = nextHopProtocol.split(_name)[1] ;\n break;\n }\n _name += char;\n }\n if (_name === nextHopProtocol) {\n // webrtc, ftp, etc.\n name = _name;\n }\n return { name, version };\n}\n\nfunction getAbsoluteTime(time = 0) {\n return ((browserPerformanceTimeOrigin || performance.timeOrigin) + time) / 1000;\n}\n\nfunction resourceTimingEntryToSpanData(resourceTiming) {\n const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol);\n\n const timingSpanData = [];\n\n timingSpanData.push(['network.protocol.version', version], ['network.protocol.name', name]);\n\n if (!browserPerformanceTimeOrigin) {\n return timingSpanData;\n }\n return [\n ...timingSpanData,\n ['http.request.redirect_start', getAbsoluteTime(resourceTiming.redirectStart)],\n ['http.request.fetch_start', getAbsoluteTime(resourceTiming.fetchStart)],\n ['http.request.domain_lookup_start', getAbsoluteTime(resourceTiming.domainLookupStart)],\n ['http.request.domain_lookup_end', getAbsoluteTime(resourceTiming.domainLookupEnd)],\n ['http.request.connect_start', getAbsoluteTime(resourceTiming.connectStart)],\n ['http.request.secure_connection_start', getAbsoluteTime(resourceTiming.secureConnectionStart)],\n ['http.request.connection_end', getAbsoluteTime(resourceTiming.connectEnd)],\n ['http.request.request_start', getAbsoluteTime(resourceTiming.requestStart)],\n ['http.request.response_start', getAbsoluteTime(resourceTiming.responseStart)],\n ['http.request.response_end', getAbsoluteTime(resourceTiming.responseEnd)],\n ];\n}\n\n/**\n * A function that determines whether to attach tracing headers to a request.\n * We only export this function for testing purposes.\n */\nfunction shouldAttachHeaders(\n targetUrl,\n tracePropagationTargets,\n) {\n // window.location.href not being defined is an edge case in the browser but we need to handle it.\n // Potentially dangerous situations where it may not be defined: Browser Extensions, Web Workers, patching of the location obj\n const href = WINDOW.location && WINDOW.location.href;\n\n if (!href) {\n // If there is no window.location.origin, we default to only attaching tracing headers to relative requests, i.e. ones that start with `/`\n // BIG DISCLAIMER: Users can call URLs with a double slash (fetch(\"//example.com/api\")), this is a shorthand for \"send to the same protocol\",\n // so we need a to exclude those requests, because they might be cross origin.\n const isRelativeSameOriginRequest = !!targetUrl.match(/^\\/(?!\\/)/);\n if (!tracePropagationTargets) {\n return isRelativeSameOriginRequest;\n } else {\n return stringMatchesSomePattern(targetUrl, tracePropagationTargets);\n }\n } else {\n let resolvedUrl;\n let currentOrigin;\n\n // URL parsing may fail, we default to not attaching trace headers in that case.\n try {\n resolvedUrl = new URL(targetUrl, href);\n currentOrigin = new URL(href).origin;\n } catch (e) {\n return false;\n }\n\n const isSameOriginRequest = resolvedUrl.origin === currentOrigin;\n if (!tracePropagationTargets) {\n return isSameOriginRequest;\n } else {\n return (\n stringMatchesSomePattern(resolvedUrl.toString(), tracePropagationTargets) ||\n (isSameOriginRequest && stringMatchesSomePattern(resolvedUrl.pathname, tracePropagationTargets))\n );\n }\n }\n}\n\n/**\n * Create and track xhr request spans\n *\n * @returns Span if a span was created, otherwise void.\n */\nfunction xhrCallback(\n handlerData,\n shouldCreateSpan,\n shouldAttachHeaders,\n spans,\n) {\n const xhr = handlerData.xhr;\n const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY];\n\n if (!xhr || xhr.__sentry_own_request__ || !sentryXhrData) {\n return undefined;\n }\n\n const shouldCreateSpanResult = hasTracingEnabled() && shouldCreateSpan(sentryXhrData.url);\n\n // check first if the request has finished and is tracked by an existing span which should now end\n if (handlerData.endTimestamp && shouldCreateSpanResult) {\n const spanId = xhr.__sentry_xhr_span_id__;\n if (!spanId) return;\n\n const span = spans[spanId];\n if (span && sentryXhrData.status_code !== undefined) {\n setHttpStatus(span, sentryXhrData.status_code);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n return undefined;\n }\n\n const fullUrl = getFullURL(sentryXhrData.url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n\n const hasParent = !!getActiveSpan();\n\n const span =\n shouldCreateSpanResult && hasParent\n ? startInactiveSpan({\n name: `${sentryXhrData.method} ${sentryXhrData.url}`,\n attributes: {\n type: 'xhr',\n 'http.method': sentryXhrData.method,\n 'http.url': fullUrl,\n url: sentryXhrData.url,\n 'server.address': host,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client',\n },\n })\n : new SentryNonRecordingSpan();\n\n xhr.__sentry_xhr_span_id__ = span.spanContext().spanId;\n spans[xhr.__sentry_xhr_span_id__] = span;\n\n const client = getClient();\n\n if (xhr.setRequestHeader && shouldAttachHeaders(sentryXhrData.url) && client) {\n addTracingHeadersToXhrRequest(\n xhr,\n client,\n // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction),\n // we do not want to use the span as base for the trace headers,\n // which means that the headers will be generated from the scope and the sampling decision is deferred\n hasTracingEnabled() && hasParent ? span : undefined,\n );\n }\n\n return span;\n}\n\nfunction addTracingHeadersToXhrRequest(xhr, client, span) {\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader =\n span && hasTracingEnabled() ? spanToTraceHeader(span) : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc || (span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromClient(traceId, client)),\n );\n\n setHeaderOnXhr(xhr, sentryTraceHeader, sentryBaggageHeader);\n}\n\nfunction setHeaderOnXhr(\n xhr,\n sentryTraceHeader,\n sentryBaggageHeader,\n) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n xhr.setRequestHeader('sentry-trace', sentryTraceHeader);\n if (sentryBaggageHeader) {\n // From MDN: \"If this method is called several times with the same header, the values are merged into one single request header.\"\n // We can therefore simply set a baggage header without checking what was there before\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n xhr.setRequestHeader(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n }\n } catch (_) {\n // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.\n }\n}\n\nfunction getFullURL(url) {\n try {\n // By adding a base URL to new URL(), this will also work for relative urls\n // If `url` is a full URL, the base URL is ignored anyhow\n const parsed = new URL(url, WINDOW.location.origin);\n return parsed.href;\n } catch (e2) {\n return undefined;\n }\n}\n\nexport { defaultRequestInstrumentationOptions, extractNetworkProtocol, instrumentOutgoingRequests, shouldAttachHeaders, xhrCallback };\n//# sourceMappingURL=request.js.map\n","import { startTrackingWebVitals, startTrackingINP, startTrackingLongAnimationFrames, startTrackingLongTasks, startTrackingInteractions, addHistoryInstrumentationHandler, registerInpInteractionListener, addPerformanceEntries } from '@sentry-internal/browser-utils';\nimport { TRACING_DEFAULTS, registerSpanErrorInstrumentation, getClient, spanToJSON, getCurrentScope, getRootSpan, spanIsSampled, getDynamicSamplingContextFromSpan, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getActiveSpan, getIsolationScope, startIdleSpan, SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON } from '@sentry/core';\nimport { GLOBAL_OBJ, logger, propagationContextFromHeaders, browserPerformanceTimeOrigin, generatePropagationContext, getDomElement } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { WINDOW } from '../helpers.js';\nimport { registerBackgroundTabDetection } from './backgroundtab.js';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request.js';\n\n/* eslint-disable max-lines */\n\nconst BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';\n\nconst DEFAULT_BROWSER_TRACING_OPTIONS = {\n ...TRACING_DEFAULTS,\n instrumentNavigation: true,\n instrumentPageLoad: true,\n markBackgroundSpan: true,\n enableLongTask: true,\n enableLongAnimationFrame: true,\n enableInp: true,\n _experiments: {},\n ...defaultRequestInstrumentationOptions,\n};\n\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library.\n *\n * We explicitly export the proper type here, as this has to be extended in some cases.\n */\nconst browserTracingIntegration = ((_options = {}) => {\n registerSpanErrorInstrumentation();\n\n const {\n enableInp,\n enableLongTask,\n enableLongAnimationFrame,\n _experiments: { enableInteractions, enableStandaloneClsSpans },\n beforeStartSpan,\n idleTimeout,\n finalTimeout,\n childSpanTimeout,\n markBackgroundSpan,\n traceFetch,\n traceXHR,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n instrumentPageLoad,\n instrumentNavigation,\n } = {\n ...DEFAULT_BROWSER_TRACING_OPTIONS,\n ..._options,\n };\n\n const _collectWebVitals = startTrackingWebVitals({ recordClsStandaloneSpans: enableStandaloneClsSpans || false });\n\n if (enableInp) {\n startTrackingINP();\n }\n\n if (\n enableLongAnimationFrame &&\n GLOBAL_OBJ.PerformanceObserver &&\n PerformanceObserver.supportedEntryTypes &&\n PerformanceObserver.supportedEntryTypes.includes('long-animation-frame')\n ) {\n startTrackingLongAnimationFrames();\n } else if (enableLongTask) {\n startTrackingLongTasks();\n }\n\n if (enableInteractions) {\n startTrackingInteractions();\n }\n\n const latestRoute = {\n name: undefined,\n source: undefined,\n };\n\n /** Create routing idle transaction. */\n function _createRouteSpan(client, startSpanOptions) {\n const isPageloadTransaction = startSpanOptions.op === 'pageload';\n\n const finalStartSpanOptions = beforeStartSpan\n ? beforeStartSpan(startSpanOptions)\n : startSpanOptions;\n\n const attributes = finalStartSpanOptions.attributes || {};\n\n // If `finalStartSpanOptions.name` is different than `startSpanOptions.name`\n // it is because `beforeStartSpan` set a custom name. Therefore we set the source to 'custom'.\n if (startSpanOptions.name !== finalStartSpanOptions.name) {\n attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = 'custom';\n finalStartSpanOptions.attributes = attributes;\n }\n\n latestRoute.name = finalStartSpanOptions.name;\n latestRoute.source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n\n const idleSpan = startIdleSpan(finalStartSpanOptions, {\n idleTimeout,\n finalTimeout,\n childSpanTimeout,\n // should wait for finish signal if it's a pageload transaction\n disableAutoFinish: isPageloadTransaction,\n beforeSpanEnd: span => {\n _collectWebVitals();\n addPerformanceEntries(span, { recordClsOnPageloadSpan: !enableStandaloneClsSpans });\n },\n });\n\n function emitFinish() {\n if (['interactive', 'complete'].includes(WINDOW.document.readyState)) {\n client.emit('idleSpanEnableAutoFinish', idleSpan);\n }\n }\n\n if (isPageloadTransaction && WINDOW.document) {\n WINDOW.document.addEventListener('readystatechange', () => {\n emitFinish();\n });\n\n emitFinish();\n }\n\n return idleSpan;\n }\n\n return {\n name: BROWSER_TRACING_INTEGRATION_ID,\n afterAllSetup(client) {\n let activeSpan;\n let startingUrl = WINDOW.location && WINDOW.location.href;\n\n client.on('startNavigationSpan', startSpanOptions => {\n if (getClient() !== client) {\n return;\n }\n\n if (activeSpan && !spanToJSON(activeSpan).timestamp) {\n DEBUG_BUILD && logger.log(`[Tracing] Finishing current root span with op: ${spanToJSON(activeSpan).op}`);\n // If there's an open transaction on the scope, we need to finish it before creating an new one.\n activeSpan.end();\n }\n\n activeSpan = _createRouteSpan(client, {\n op: 'navigation',\n ...startSpanOptions,\n });\n });\n\n client.on('startPageLoadSpan', (startSpanOptions, traceOptions = {}) => {\n if (getClient() !== client) {\n return;\n }\n\n if (activeSpan && !spanToJSON(activeSpan).timestamp) {\n DEBUG_BUILD && logger.log(`[Tracing] Finishing current root span with op: ${spanToJSON(activeSpan).op}`);\n // If there's an open transaction on the scope, we need to finish it before creating an new one.\n activeSpan.end();\n }\n\n const sentryTrace = traceOptions.sentryTrace || getMetaContent('sentry-trace');\n const baggage = traceOptions.baggage || getMetaContent('baggage');\n\n const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);\n getCurrentScope().setPropagationContext(propagationContext);\n\n activeSpan = _createRouteSpan(client, {\n op: 'pageload',\n ...startSpanOptions,\n });\n });\n\n // A trace should to stay the consistent over the entire time span of one route.\n // Therefore, when the initial pageload or navigation root span ends, we update the\n // scope's propagation context to keep span-specific attributes like the `sampled` decision and\n // the dynamic sampling context valid, even after the root span has ended.\n // This ensures that the trace data is consistent for the entire duration of the route.\n client.on('spanEnd', span => {\n const op = spanToJSON(span).op;\n if (span !== getRootSpan(span) || (op !== 'navigation' && op !== 'pageload')) {\n return;\n }\n\n const scope = getCurrentScope();\n const oldPropagationContext = scope.getPropagationContext();\n\n scope.setPropagationContext({\n ...oldPropagationContext,\n sampled: oldPropagationContext.sampled !== undefined ? oldPropagationContext.sampled : spanIsSampled(span),\n dsc: oldPropagationContext.dsc || getDynamicSamplingContextFromSpan(span),\n });\n });\n\n if (WINDOW.location) {\n if (instrumentPageLoad) {\n startBrowserTracingPageLoadSpan(client, {\n name: WINDOW.location.pathname,\n // pageload should always start at timeOrigin (and needs to be in s, not ms)\n startTime: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',\n },\n });\n }\n\n if (instrumentNavigation) {\n addHistoryInstrumentationHandler(({ to, from }) => {\n /**\n * This early return is there to account for some cases where a navigation transaction starts right after\n * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n * create an uneccessary navigation transaction.\n *\n * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n * only be caused in certain development environments where the usage of a hot module reloader is causing\n * errors.\n */\n if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {\n startingUrl = undefined;\n return;\n }\n\n if (from !== to) {\n startingUrl = undefined;\n startBrowserTracingNavigationSpan(client, {\n name: WINDOW.location.pathname,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser',\n },\n });\n }\n });\n }\n }\n\n if (markBackgroundSpan) {\n registerBackgroundTabDetection();\n }\n\n if (enableInteractions) {\n registerInteractionListener(idleTimeout, finalTimeout, childSpanTimeout, latestRoute);\n }\n\n if (enableInp) {\n registerInpInteractionListener();\n }\n\n instrumentOutgoingRequests(client, {\n traceFetch,\n traceXHR,\n tracePropagationTargets: client.getOptions().tracePropagationTargets,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n });\n },\n };\n}) ;\n\n/**\n * Manually start a page load span.\n * This will only do something if a browser tracing integration integration has been setup.\n *\n * If you provide a custom `traceOptions` object, it will be used to continue the trace\n * instead of the default behavior, which is to look it up on the <meta> tags.\n */\nfunction startBrowserTracingPageLoadSpan(\n client,\n spanOptions,\n traceOptions,\n) {\n client.emit('startPageLoadSpan', spanOptions, traceOptions);\n\n getCurrentScope().setTransactionName(spanOptions.name);\n\n const span = getActiveSpan();\n const op = span && spanToJSON(span).op;\n return op === 'pageload' ? span : undefined;\n}\n\n/**\n * Manually start a navigation span.\n * This will only do something if a browser tracing integration has been setup.\n */\nfunction startBrowserTracingNavigationSpan(client, spanOptions) {\n getIsolationScope().setPropagationContext(generatePropagationContext());\n getCurrentScope().setPropagationContext(generatePropagationContext());\n\n client.emit('startNavigationSpan', spanOptions);\n\n getCurrentScope().setTransactionName(spanOptions.name);\n\n const span = getActiveSpan();\n const op = span && spanToJSON(span).op;\n return op === 'navigation' ? span : undefined;\n}\n\n/** Returns the value of a meta tag */\nfunction getMetaContent(metaName) {\n // Can't specify generic to `getDomElement` because tracing can be used\n // in a variety of environments, have to disable `no-unsafe-member-access`\n // as a result.\n const metaTag = getDomElement(`meta[name=${metaName}]`);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return metaTag ? metaTag.getAttribute('content') : undefined;\n}\n\n/** Start listener for interaction transactions */\nfunction registerInteractionListener(\n idleTimeout,\n finalTimeout,\n childSpanTimeout,\n latestRoute,\n) {\n let inflightInteractionSpan;\n const registerInteractionTransaction = () => {\n const op = 'ui.action.click';\n\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan && getRootSpan(activeSpan);\n if (rootSpan) {\n const currentRootSpanOp = spanToJSON(rootSpan).op;\n if (['navigation', 'pageload'].includes(currentRootSpanOp )) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Did not create ${op} span because a pageload or navigation span is in progress.`);\n return undefined;\n }\n }\n\n if (inflightInteractionSpan) {\n inflightInteractionSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'interactionInterrupted');\n inflightInteractionSpan.end();\n inflightInteractionSpan = undefined;\n }\n\n if (!latestRoute.name) {\n DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);\n return undefined;\n }\n\n inflightInteractionSpan = startIdleSpan(\n {\n name: latestRoute.name,\n op,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || 'url',\n },\n },\n {\n idleTimeout,\n finalTimeout,\n childSpanTimeout,\n },\n );\n };\n\n if (WINDOW.document) {\n addEventListener('click', registerInteractionTransaction, { once: false, capture: true });\n }\n}\n\nexport { BROWSER_TRACING_INTEGRATION_ID, browserTracingIntegration, getMetaContent, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan };\n//# sourceMappingURL=browserTracingIntegration.js.map\n","import { _nullishCoalesce, _optionalChain } from '@sentry/utils';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core';\nimport { startBrowserTracingPageLoadSpan, WINDOW, startBrowserTracingNavigationSpan } from '@sentry/react';\nimport { browserPerformanceTimeOrigin, GLOBAL_OBJ } from '@sentry/utils';\n\nconst INCOMPLETE_APP_ROUTER_INSTRUMENTATION_TRANSACTION_NAME = 'incomplete-app-router-transaction';\n\n/** Instruments the Next.js app router for pageloads. */\nfunction appRouterInstrumentPageLoad(client) {\n startBrowserTracingPageLoadSpan(client, {\n name: WINDOW.location.pathname,\n // pageload should always start at timeOrigin (and needs to be in s, not ms)\n startTime: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.nextjs.app_router_instrumentation',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n },\n });\n}\n\n// Yes, yes, I know we shouldn't depend on these internals. But that's where we are at. We write the ugly code, so you don't have to.\nconst GLOBAL_OBJ_WITH_NEXT_ROUTER = GLOBAL_OBJ\n\n;\n\n/*\n * The routing instrumentation needs to handle a few cases:\n * - Router operations:\n * - router.push() (either explicitly called or implicitly through <Link /> tags)\n * - router.replace() (either explicitly called or implicitly through <Link replace /> tags)\n * - router.back()\n * - router.forward()\n * - Browser operations:\n * - native Browser-back / popstate event (implicitly called by router.back())\n * - native Browser-forward / popstate event (implicitly called by router.forward())\n */\n\n/** Instruments the Next.js app router for navigation. */\nfunction appRouterInstrumentNavigation(client) {\n let currentNavigationSpan = undefined;\n\n WINDOW.addEventListener('popstate', () => {\n if (currentNavigationSpan && currentNavigationSpan.isRecording()) {\n currentNavigationSpan.updateName(WINDOW.location.pathname);\n } else {\n currentNavigationSpan = startBrowserTracingNavigationSpan(client, {\n name: WINDOW.location.pathname,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.nextjs.app_router_instrumentation',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n 'navigation.type': 'browser.popstate',\n },\n });\n }\n });\n\n let routerPatched = false;\n let triesToFindRouter = 0;\n const MAX_TRIES_TO_FIND_ROUTER = 500;\n const ROUTER_AVAILABILITY_CHECK_INTERVAL_MS = 20;\n const checkForRouterAvailabilityInterval = setInterval(() => {\n triesToFindRouter++;\n const router = _nullishCoalesce(_optionalChain([GLOBAL_OBJ_WITH_NEXT_ROUTER, 'optionalAccess', _ => _.next, 'optionalAccess', _2 => _2.router]), () => ( _optionalChain([GLOBAL_OBJ_WITH_NEXT_ROUTER, 'optionalAccess', _3 => _3.nd, 'optionalAccess', _4 => _4.router])));\n\n if (routerPatched || triesToFindRouter > MAX_TRIES_TO_FIND_ROUTER) {\n clearInterval(checkForRouterAvailabilityInterval);\n } else if (router) {\n clearInterval(checkForRouterAvailabilityInterval);\n routerPatched = true;\n (['back', 'forward', 'push', 'replace'] ).forEach(routerFunctionName => {\n if (_optionalChain([router, 'optionalAccess', _5 => _5[routerFunctionName]])) {\n // @ts-expect-error Weird type error related to not knowing how to associate return values with the individual functions - we can just ignore\n router[routerFunctionName] = new Proxy(router[routerFunctionName], {\n apply(target, thisArg, argArray) {\n const span = startBrowserTracingNavigationSpan(client, {\n name: INCOMPLETE_APP_ROUTER_INSTRUMENTATION_TRANSACTION_NAME,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.nextjs.app_router_instrumentation',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n },\n });\n\n currentNavigationSpan = span;\n\n if (routerFunctionName === 'push') {\n _optionalChain([span, 'optionalAccess', _6 => _6.updateName, 'call', _7 => _7(transactionNameifyRouterArgument(argArray[0]))]);\n _optionalChain([span, 'optionalAccess', _8 => _8.setAttribute, 'call', _9 => _9('navigation.type', 'router.push')]);\n } else if (routerFunctionName === 'replace') {\n _optionalChain([span, 'optionalAccess', _10 => _10.updateName, 'call', _11 => _11(transactionNameifyRouterArgument(argArray[0]))]);\n _optionalChain([span, 'optionalAccess', _12 => _12.setAttribute, 'call', _13 => _13('navigation.type', 'router.replace')]);\n } else if (routerFunctionName === 'back') {\n _optionalChain([span, 'optionalAccess', _14 => _14.setAttribute, 'call', _15 => _15('navigation.type', 'router.back')]);\n } else if (routerFunctionName === 'forward') {\n _optionalChain([span, 'optionalAccess', _16 => _16.setAttribute, 'call', _17 => _17('navigation.type', 'router.forward')]);\n }\n\n return target.apply(thisArg, argArray);\n },\n });\n }\n });\n }\n }, ROUTER_AVAILABILITY_CHECK_INTERVAL_MS);\n}\n\nfunction transactionNameifyRouterArgument(target) {\n try {\n return new URL(target, 'http://some-random-base.com/').pathname;\n } catch (e) {\n return '/';\n }\n}\n\nexport { INCOMPLETE_APP_ROUTER_INSTRUMENTATION_TRANSACTION_NAME, appRouterInstrumentNavigation, appRouterInstrumentPageLoad };\n//# sourceMappingURL=appRouterRoutingInstrumentation.js.map\n","export { default } from '../client/router';\nexport * from '../client/router';\n\n//# sourceMappingURL=router.js.map","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { _optionalChain } from '@sentry/utils';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core';\nimport { startBrowserTracingPageLoadSpan, startBrowserTracingNavigationSpan, WINDOW } from '@sentry/react';\nimport { browserPerformanceTimeOrigin, stripUrlQueryAndFragment, logger } from '@sentry/utils';\nimport RouterImport from 'next/router';\nimport { DEBUG_BUILD } from '../../common/debug-build.js';\n\n// next/router v10 is CJS\n//\n// For ESM/CJS interoperability 'reasons', depending on how this file is loaded, Router might be on the default export\n// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\nconst Router = RouterImport.events ? RouterImport : (RouterImport ).default;\n\nconst globalObject = WINDOW\n\n;\n\n/**\n * Describes data located in the __NEXT_DATA__ script tag. This tag is present on every page of a Next.js app.\n */\n\n/**\n * Every Next.js page (static and dynamic ones) comes with a script tag with the id \"__NEXT_DATA__\". This script tag\n * contains a JSON object with data that was either generated at build time for static pages (`getStaticProps`), or at\n * runtime with data fetchers like `getServerSideProps.`.\n *\n * We can use this information to:\n * - Always get the parameterized route we're in when loading a page.\n * - Send trace information (trace-id, baggage) from the server to the client.\n *\n * This function extracts this information.\n */\nfunction extractNextDataTagInformation() {\n let nextData;\n // Let's be on the safe side and actually check first if there is really a __NEXT_DATA__ script tag on the page.\n // Theoretically this should always be the case though.\n const nextDataTag = globalObject.document.getElementById('__NEXT_DATA__');\n if (nextDataTag && nextDataTag.innerHTML) {\n try {\n nextData = JSON.parse(nextDataTag.innerHTML);\n } catch (e) {\n DEBUG_BUILD && logger.warn('Could not extract __NEXT_DATA__');\n }\n }\n\n if (!nextData) {\n return {};\n }\n\n const nextDataTagInfo = {};\n\n const { page, query, props } = nextData;\n\n // `nextData.page` always contains the parameterized route - except for when an error occurs in a data fetching\n // function, then it is \"/_error\", but that isn't a problem since users know which route threw by looking at the\n // parent transaction\n // TODO: Actually this is a problem (even though it is not that big), because the DSC and the transaction payload will contain\n // a different transaction name. Maybe we can fix this. Idea: Also send transaction name via pageProps when available.\n nextDataTagInfo.route = page;\n nextDataTagInfo.params = query;\n\n if (props && props.pageProps) {\n nextDataTagInfo.sentryTrace = props.pageProps._sentryTraceData;\n nextDataTagInfo.baggage = props.pageProps._sentryBaggage;\n }\n\n return nextDataTagInfo;\n}\n\n/**\n * Instruments the Next.js pages router for pageloads.\n * Only supported for client side routing. Works for Next >= 10.\n *\n * Leverages the SingletonRouter from the `next/router` to\n * generate pageload/navigation transactions and parameterize\n * transaction names.\n */\nfunction pagesRouterInstrumentPageLoad(client) {\n const { route, params, sentryTrace, baggage } = extractNextDataTagInformation();\n const name = route || globalObject.location.pathname;\n\n startBrowserTracingPageLoadSpan(\n client,\n {\n name,\n // pageload should always start at timeOrigin (and needs to be in s, not ms)\n startTime: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.nextjs.pages_router_instrumentation',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: route ? 'route' : 'url',\n ...(params && client.getOptions().sendDefaultPii && { ...params }),\n },\n },\n { sentryTrace, baggage },\n );\n}\n\n/**\n * Instruments the Next.js pages router for navigation.\n * Only supported for client side routing. Works for Next >= 10.\n *\n * Leverages the SingletonRouter from the `next/router` to\n * generate pageload/navigation transactions and parameterize\n * transaction names.\n */\nfunction pagesRouterInstrumentNavigation(client) {\n Router.events.on('routeChangeStart', (navigationTarget) => {\n const strippedNavigationTarget = stripUrlQueryAndFragment(navigationTarget);\n const matchedRoute = getNextRouteFromPathname(strippedNavigationTarget);\n\n let newLocation;\n let spanSource;\n\n if (matchedRoute) {\n newLocation = matchedRoute;\n spanSource = 'route';\n } else {\n newLocation = strippedNavigationTarget;\n spanSource = 'url';\n }\n\n startBrowserTracingNavigationSpan(client, {\n name: newLocation,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.nextjs.pages_router_instrumentation',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: spanSource,\n },\n });\n });\n}\n\nfunction getNextRouteFromPathname(pathname) {\n const pageRoutes = (globalObject.__BUILD_MANIFEST || {}).sortedPages;\n\n // Page route should in 99.999% of the cases be defined by now but just to be sure we make a check here\n if (!pageRoutes) {\n return;\n }\n\n return pageRoutes.find(route => {\n const routeRegExp = convertNextRouteToRegExp(route);\n return pathname.match(routeRegExp);\n });\n}\n\n/**\n * Converts a Next.js style route to a regular expression that matches on pathnames (no query params or URL fragments).\n *\n * In general this involves replacing any instances of square brackets in a route with a wildcard:\n * e.g. \"/users/[id]/info\" becomes /\\/users\\/([^/]+?)\\/info/\n *\n * Some additional edgecases need to be considered:\n * - All routes have an optional slash at the end, meaning users can navigate to \"/users/[id]/info\" or\n * \"/users/[id]/info/\" - both will be resolved to \"/users/[id]/info\".\n * - Non-optional \"catchall\"s at the end of a route must be considered when matching (e.g. \"/users/[...params]\").\n * - Optional \"catchall\"s at the end of a route must be considered when matching (e.g. \"/users/[[...params]]\").\n *\n * @param route A Next.js style route as it is found in `global.__BUILD_MANIFEST.sortedPages`\n */\nfunction convertNextRouteToRegExp(route) {\n // We can assume a route is at least \"/\".\n const routeParts = route.split('/');\n\n let optionalCatchallWildcardRegex = '';\n if (_optionalChain([routeParts, 'access', _ => _[routeParts.length - 1], 'optionalAccess', _2 => _2.match, 'call', _3 => _3(/^\\[\\[\\.\\.\\..+\\]\\]$/)])) {\n // If last route part has pattern \"[[...xyz]]\" we pop the latest route part to get rid of the required trailing\n // slash that would come before it if we didn't pop it.\n routeParts.pop();\n optionalCatchallWildcardRegex = '(?:/(.+?))?';\n }\n\n const rejoinedRouteParts = routeParts\n .map(\n routePart =>\n routePart\n .replace(/^\\[\\.\\.\\..+\\]$/, '(.+?)') // Replace catch all wildcard with regex wildcard\n .replace(/^\\[.*\\]$/, '([^/]+?)'), // Replace route wildcards with lazy regex wildcards\n )\n .join('/');\n\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- routeParts are from the build manifest, so no raw user input\n return new RegExp(\n `^${rejoinedRouteParts}${optionalCatchallWildcardRegex}(?:/)?$`, // optional slash at the end\n );\n}\n\nexport { pagesRouterInstrumentNavigation, pagesRouterInstrumentPageLoad };\n//# sourceMappingURL=pagesRouterRoutingInstrumentation.js.map\n","import { WINDOW } from '@sentry/react';\nimport { appRouterInstrumentPageLoad, appRouterInstrumentNavigation } from './appRouterRoutingInstrumentation.js';\nimport { pagesRouterInstrumentPageLoad, pagesRouterInstrumentNavigation } from './pagesRouterRoutingInstrumentation.js';\n\n/**\n * Instruments the Next.js Client Router for page loads.\n */\nfunction nextRouterInstrumentPageLoad(client) {\n const isAppRouter = !WINDOW.document.getElementById('__NEXT_DATA__');\n if (isAppRouter) {\n appRouterInstrumentPageLoad(client);\n } else {\n pagesRouterInstrumentPageLoad(client);\n }\n}\n\n/**\n * Instruments the Next.js Client Router for navigation.\n */\nfunction nextRouterInstrumentNavigation(client) {\n const isAppRouter = !WINDOW.document.getElementById('__NEXT_DATA__');\n if (isAppRouter) {\n appRouterInstrumentNavigation(client);\n } else {\n pagesRouterInstrumentNavigation(client);\n }\n}\n\nexport { nextRouterInstrumentNavigation, nextRouterInstrumentPageLoad };\n//# sourceMappingURL=nextRoutingInstrumentation.js.map\n","import { browserTracingIntegration as browserTracingIntegration$1 } from '@sentry/react';\nimport { nextRouterInstrumentNavigation, nextRouterInstrumentPageLoad } from './routing/nextRoutingInstrumentation.js';\n\n/**\n * A custom browser tracing integration for Next.js.\n */\nfunction browserTracingIntegration(\n options = {},\n) {\n const browserTracingIntegrationInstance = browserTracingIntegration$1({\n ...options,\n instrumentNavigation: false,\n instrumentPageLoad: false,\n });\n\n const { instrumentPageLoad = true, instrumentNavigation = true } = options;\n\n return {\n ...browserTracingIntegrationInstance,\n afterAllSetup(client) {\n // We need to run the navigation span instrumentation before the `afterAllSetup` hook on the normal browser\n // tracing integration because we need to ensure the order of execution is as follows:\n // Instrumentation to start span on RSC fetch request runs -> Instrumentation to put tracing headers from active span on fetch runs\n // If it were the other way around, the RSC fetch request would not receive the tracing headers from the navigation transaction.\n if (instrumentNavigation) {\n nextRouterInstrumentNavigation(client);\n }\n\n browserTracingIntegrationInstance.afterAllSetup(client);\n\n if (instrumentPageLoad) {\n nextRouterInstrumentPageLoad(client);\n }\n },\n };\n}\n\nexport { browserTracingIntegration };\n//# sourceMappingURL=browserTracingIntegration.js.map\n","// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript\n// https://github.com/calvinmetcalf/rollup-plugin-node-builtins/blob/63ab8aacd013767445ca299e468d9a60a95328d7/src/es6/path.js\n//\n// Copyright Joyent, Inc.and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n/** JSDoc */\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n let up = 0;\n for (let i = parts.length - 1; i >= 0; i--) {\n const last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nconst splitPathRe = /^(\\S+:\\\\|\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^/\\\\]+?|)(\\.[^./\\\\]*|))(?:[/\\\\]*)$/;\n/** JSDoc */\nfunction splitPath(filename) {\n // Truncate files names greater than 1024 characters to avoid regex dos\n // https://github.com/getsentry/sentry-javascript/pull/8737#discussion_r1285719172\n const truncated = filename.length > 1024 ? `<truncated>${filename.slice(-1024)}` : filename;\n const parts = splitPathRe.exec(truncated);\n return parts ? parts.slice(1) : [];\n}\n\n// path.resolve([from ...], to)\n// posix version\n/** JSDoc */\nfunction resolve(...args) {\n let resolvedPath = '';\n let resolvedAbsolute = false;\n\n for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n const path = i >= 0 ? args[i] : '/';\n\n // Skip empty entries\n if (!path) {\n continue;\n }\n\n resolvedPath = `${path}/${resolvedPath}`;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(\n resolvedPath.split('/').filter(p => !!p),\n !resolvedAbsolute,\n ).join('/');\n\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}\n\n/** JSDoc */\nfunction trim(arr) {\n let start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') {\n break;\n }\n }\n\n let end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') {\n break;\n }\n }\n\n if (start > end) {\n return [];\n }\n return arr.slice(start, end - start + 1);\n}\n\n// path.relative(from, to)\n// posix version\n/** JSDoc */\nfunction relative(from, to) {\n /* eslint-disable no-param-reassign */\n from = resolve(from).slice(1);\n to = resolve(to).slice(1);\n /* eslint-enable no-param-reassign */\n\n const fromParts = trim(from.split('/'));\n const toParts = trim(to.split('/'));\n\n const length = Math.min(fromParts.length, toParts.length);\n let samePartsLength = length;\n for (let i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n let outputParts = [];\n for (let i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}\n\n// path.normalize(path)\n// posix version\n/** JSDoc */\nfunction normalizePath(path) {\n const isPathAbsolute = isAbsolute(path);\n const trailingSlash = path.slice(-1) === '/';\n\n // Normalize the path\n let normalizedPath = normalizeArray(\n path.split('/').filter(p => !!p),\n !isPathAbsolute,\n ).join('/');\n\n if (!normalizedPath && !isPathAbsolute) {\n normalizedPath = '.';\n }\n if (normalizedPath && trailingSlash) {\n normalizedPath += '/';\n }\n\n return (isPathAbsolute ? '/' : '') + normalizedPath;\n}\n\n// posix version\n/** JSDoc */\nfunction isAbsolute(path) {\n return path.charAt(0) === '/';\n}\n\n// posix version\n/** JSDoc */\nfunction join(...args) {\n return normalizePath(args.join('/'));\n}\n\n/** JSDoc */\nfunction dirname(path) {\n const result = splitPath(path);\n const root = result[0] || '';\n let dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.slice(0, dir.length - 1);\n }\n\n return root + dir;\n}\n\n/** JSDoc */\nfunction basename(path, ext) {\n let f = splitPath(path)[2] || '';\n if (ext && f.slice(ext.length * -1) === ext) {\n f = f.slice(0, f.length - ext.length);\n }\n return f;\n}\n\nexport { basename, dirname, isAbsolute, join, normalizePath, relative, resolve };\n//# sourceMappingURL=path.js.map\n","import { GLOBAL_OBJ, relative, basename } from '@sentry/utils';\nimport { defineIntegration } from '../integration.js';\n\nconst INTEGRATION_NAME = 'RewriteFrames';\n\n/**\n * Rewrite event frames paths.\n */\nconst rewriteFramesIntegration = defineIntegration((options = {}) => {\n const root = options.root;\n const prefix = options.prefix || 'app:///';\n\n const isBrowser = 'window' in GLOBAL_OBJ && GLOBAL_OBJ.window !== undefined;\n\n const iteratee = options.iteratee || generateIteratee({ isBrowser, root, prefix });\n\n /** Process an exception event. */\n function _processExceptionsEvent(event) {\n try {\n return {\n ...event,\n exception: {\n ...event.exception,\n // The check for this is performed inside `process` call itself, safe to skip here\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n values: event.exception.values.map(value => ({\n ...value,\n ...(value.stacktrace && { stacktrace: _processStacktrace(value.stacktrace) }),\n })),\n },\n };\n } catch (_oO) {\n return event;\n }\n }\n\n /** Process a stack trace. */\n function _processStacktrace(stacktrace) {\n return {\n ...stacktrace,\n frames: stacktrace && stacktrace.frames && stacktrace.frames.map(f => iteratee(f)),\n };\n }\n\n return {\n name: INTEGRATION_NAME,\n processEvent(originalEvent) {\n let processedEvent = originalEvent;\n\n if (originalEvent.exception && Array.isArray(originalEvent.exception.values)) {\n processedEvent = _processExceptionsEvent(processedEvent);\n }\n\n return processedEvent;\n },\n };\n});\n\n/**\n * Exported only for tests.\n */\nfunction generateIteratee({\n isBrowser,\n root,\n prefix,\n}\n\n) {\n return (frame) => {\n if (!frame.filename) {\n return frame;\n }\n\n // Determine if this is a Windows frame by checking for a Windows-style prefix such as `C:\\`\n const isWindowsFrame =\n /^[a-zA-Z]:\\\\/.test(frame.filename) ||\n // or the presence of a backslash without a forward slash (which are not allowed on Windows)\n (frame.filename.includes('\\\\') && !frame.filename.includes('/'));\n\n // Check if the frame filename begins with `/`\n const startsWithSlash = /^\\//.test(frame.filename);\n\n if (isBrowser) {\n if (root) {\n const oldFilename = frame.filename;\n if (oldFilename.indexOf(root) === 0) {\n frame.filename = oldFilename.replace(root, prefix);\n }\n }\n } else {\n if (isWindowsFrame || startsWithSlash) {\n const filename = isWindowsFrame\n ? frame.filename\n .replace(/^[a-zA-Z]:/, '') // remove Windows-style prefix\n .replace(/\\\\/g, '/') // replace all `\\\\` instances with `/`\n : frame.filename;\n const base = root ? relative(root, filename) : basename(filename);\n frame.filename = `${prefix}${base}`;\n }\n }\n\n return frame;\n };\n}\n\nexport { generateIteratee, rewriteFramesIntegration };\n//# sourceMappingURL=rewriteframes.js.map\n","import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, rewriteFramesIntegration } from '@sentry/core';\n\nconst nextjsClientStackFrameNormalizationIntegration = defineIntegration(\n ({ assetPrefixPath }) => {\n const rewriteFramesInstance = rewriteFramesIntegration({\n // Turn `<origin>/<path>/_next/static/...` into `app:///_next/static/...`\n iteratee: frame => {\n try {\n const { origin } = new URL(frame.filename );\n frame.filename = _optionalChain([frame, 'access', _ => _.filename, 'optionalAccess', _2 => _2.replace, 'call', _3 => _3(origin, 'app://'), 'access', _4 => _4.replace, 'call', _5 => _5(assetPrefixPath, '')]);\n } catch (err) {\n // Filename wasn't a properly formed URL, so there's nothing we can do\n }\n\n // We need to URI-decode the filename because Next.js has wildcard routes like \"/users/[id].js\" which show up as \"/users/%5id%5.js\" in Error stacktraces.\n // The corresponding sources that Next.js generates have proper brackets so we also need proper brackets in the frame so that source map resolving works.\n if (frame.filename && frame.filename.startsWith('app:///_next')) {\n frame.filename = decodeURI(frame.filename);\n }\n\n if (\n frame.filename &&\n frame.filename.match(\n /^app:\\/\\/\\/_next\\/static\\/chunks\\/(main-|main-app-|polyfills-|webpack-|framework-|framework\\.)[0-9a-f]+\\.js$/,\n )\n ) {\n // We don't care about these frames. It's Next.js internal code.\n frame.in_app = false;\n }\n\n return frame;\n },\n });\n\n return {\n ...rewriteFramesInstance,\n name: 'NextjsClientStackFrameNormalization',\n };\n },\n);\n\nexport { nextjsClientStackFrameNormalizationIntegration };\n//# sourceMappingURL=clientNormalizationIntegration.js.map\n","import { dsnFromString, logger, GLOBAL_OBJ } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../common/debug-build.js';\n\nconst globalWithInjectedValues = GLOBAL_OBJ\n\n;\n\n/**\n * Applies the `tunnel` option to the Next.js SDK options based on `withSentryConfig`'s `tunnelRoute` option.\n */\nfunction applyTunnelRouteOption(options) {\n const tunnelRouteOption = globalWithInjectedValues.__sentryRewritesTunnelPath__;\n if (tunnelRouteOption && options.dsn) {\n const dsnComponents = dsnFromString(options.dsn);\n if (!dsnComponents) {\n return;\n }\n const sentrySaasDsnMatch = dsnComponents.host.match(/^o(\\d+)\\.ingest(?:\\.([a-z]{2}))?\\.sentry\\.io$/);\n if (sentrySaasDsnMatch) {\n const orgId = sentrySaasDsnMatch[1];\n const regionCode = sentrySaasDsnMatch[2];\n let tunnelPath = `${tunnelRouteOption}?o=${orgId}&p=${dsnComponents.projectId}`;\n if (regionCode) {\n tunnelPath += `&r=${regionCode}`;\n }\n options.tunnel = tunnelPath;\n DEBUG_BUILD && logger.info(`Tunneling events to \"${tunnelPath}\"`);\n } else {\n DEBUG_BUILD && logger.warn('Provided DSN is not a Sentry SaaS DSN. Will not tunnel events.');\n }\n }\n}\n\nexport { applyTunnelRouteOption };\n//# sourceMappingURL=tunnelRoute.js.map\n","import { applySdkMetadata, addEventProcessor } from '@sentry/core';\nimport { init as init$1, getDefaultIntegrations as getDefaultIntegrations$1 } from '@sentry/react';\nexport * from '@sentry/react';\nimport { GLOBAL_OBJ } from '@sentry/utils';\nimport { devErrorSymbolicationEventProcessor } from '../common/devErrorSymbolicationEventProcessor.js';\nimport { getVercelEnv } from '../common/getVercelEnv.js';\nimport { browserTracingIntegration } from './browserTracingIntegration.js';\nimport { nextjsClientStackFrameNormalizationIntegration } from './clientNormalizationIntegration.js';\nimport { INCOMPLETE_APP_ROUTER_INSTRUMENTATION_TRANSACTION_NAME } from './routing/appRouterRoutingInstrumentation.js';\nimport { applyTunnelRouteOption } from './tunnelRoute.js';\nexport { captureUnderscoreErrorException } from '../common/_error.js';\nexport { wrapGetStaticPropsWithSentry } from '../common/wrapGetStaticPropsWithSentry.js';\nexport { wrapGetInitialPropsWithSentry } from '../common/wrapGetInitialPropsWithSentry.js';\nexport { wrapAppGetInitialPropsWithSentry } from '../common/wrapAppGetInitialPropsWithSentry.js';\nexport { wrapDocumentGetInitialPropsWithSentry } from '../common/wrapDocumentGetInitialPropsWithSentry.js';\nexport { wrapErrorGetInitialPropsWithSentry } from '../common/wrapErrorGetInitialPropsWithSentry.js';\nexport { wrapGetServerSidePropsWithSentry } from '../common/wrapGetServerSidePropsWithSentry.js';\nexport { wrapServerComponentWithSentry } from '../common/wrapServerComponentWithSentry.js';\nexport { wrapRouteHandlerWithSentry } from '../common/wrapRouteHandlerWithSentry.js';\nexport { wrapApiHandlerWithSentryVercelCrons } from '../common/wrapApiHandlerWithSentryVercelCrons.js';\nexport { wrapMiddlewareWithSentry } from '../common/wrapMiddlewareWithSentry.js';\nexport { wrapPageComponentWithSentry } from '../common/wrapPageComponentWithSentry.js';\nexport { wrapGenerationFunctionWithSentry } from '../common/wrapGenerationFunctionWithSentry.js';\nexport { withServerActionInstrumentation } from '../common/withServerActionInstrumentation.js';\nexport { captureRequestError, experimental_captureRequestError } from '../common/captureRequestError.js';\n\nconst globalWithInjectedValues = GLOBAL_OBJ\n\n;\n\n// Treeshakable guard to remove all code related to tracing\n\n/** Inits the Sentry NextJS SDK on the browser with the React SDK. */\nfunction init(options) {\n const opts = {\n environment: getVercelEnv(true) || process.env.NODE_ENV,\n defaultIntegrations: getDefaultIntegrations(options),\n ...options,\n } ;\n\n applyTunnelRouteOption(opts);\n applySdkMetadata(opts, 'nextjs', ['nextjs', 'react']);\n\n const client = init$1(opts);\n\n const filterTransactions = event =>\n event.type === 'transaction' && event.transaction === '/404' ? null : event;\n filterTransactions.id = 'NextClient404Filter';\n addEventProcessor(filterTransactions);\n\n const filterIncompleteNavigationTransactions = event =>\n event.type === 'transaction' && event.transaction === INCOMPLETE_APP_ROUTER_INSTRUMENTATION_TRANSACTION_NAME\n ? null\n : event;\n filterIncompleteNavigationTransactions.id = 'IncompleteTransactionFilter';\n addEventProcessor(filterIncompleteNavigationTransactions);\n\n if (process.env.NODE_ENV === 'development') {\n addEventProcessor(devErrorSymbolicationEventProcessor);\n }\n\n return client;\n}\n\nfunction getDefaultIntegrations(options) {\n const customDefaultIntegrations = getDefaultIntegrations$1(options);\n // This evaluates to true unless __SENTRY_TRACING__ is text-replaced with \"false\",\n // in which case everything inside will get tree-shaken away\n if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) {\n customDefaultIntegrations.push(browserTracingIntegration());\n }\n\n // This value is injected at build time, based on the output directory specified in the build config. Though a default\n // is set there, we set it here as well, just in case something has gone wrong with the injection.\n const assetPrefixPath = globalWithInjectedValues.__rewriteFramesAssetPrefixPath__ || '';\n customDefaultIntegrations.push(nextjsClientStackFrameNormalizationIntegration({ assetPrefixPath }));\n\n return customDefaultIntegrations;\n}\n\n/**\n * Just a passthrough in case this is imported from the client.\n */\nfunction withSentryConfig(exportedUserNextConfig) {\n return exportedUserNextConfig;\n}\n\nexport { browserTracingIntegration, init, withSentryConfig };\n//# sourceMappingURL=index.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { isString } from './is.js';\nimport { logger } from './logger.js';\n\nconst BAGGAGE_HEADER_NAME = 'baggage';\n\nconst SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';\n\nconst SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\n\n/**\n * Max length of a serialized baggage string\n *\n * https://www.w3.org/TR/baggage/#limits\n */\nconst MAX_BAGGAGE_STRING_LENGTH = 8192;\n\n/**\n * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the \"sentry-\" prefixed values\n * from it.\n *\n * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.\n * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.\n */\nfunction baggageHeaderToDynamicSamplingContext(\n // Very liberal definition of what any incoming header might look like\n baggageHeader,\n) {\n const baggageObject = parseBaggageHeader(baggageHeader);\n\n if (!baggageObject) {\n return undefined;\n }\n\n // Read all \"sentry-\" prefixed values out of the baggage object and put it onto a dynamic sampling context object.\n const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => {\n if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {\n const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n acc[nonPrefixedKey] = value;\n }\n return acc;\n }, {});\n\n // Only return a dynamic sampling context object if there are keys in it.\n // A keyless object means there were no sentry values on the header, which means that there is no DSC.\n if (Object.keys(dynamicSamplingContext).length > 0) {\n return dynamicSamplingContext ;\n } else {\n return undefined;\n }\n}\n\n/**\n * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with \"sentry-\".\n *\n * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility\n * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is\n * `undefined` the function will return `undefined`.\n * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`\n * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.\n */\nfunction dynamicSamplingContextToSentryBaggageHeader(\n // this also takes undefined for convenience and bundle size in other places\n dynamicSamplingContext,\n) {\n if (!dynamicSamplingContext) {\n return undefined;\n }\n\n // Prefix all DSC keys with \"sentry-\" and put them into a new object\n const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce(\n (acc, [dscKey, dscValue]) => {\n if (dscValue) {\n acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n }\n return acc;\n },\n {},\n );\n\n return objectToBaggageHeader(sentryPrefixedDSC);\n}\n\n/**\n * Take a baggage header and parse it into an object.\n */\nfunction parseBaggageHeader(\n baggageHeader,\n) {\n if (!baggageHeader || (!isString(baggageHeader) && !Array.isArray(baggageHeader))) {\n return undefined;\n }\n\n if (Array.isArray(baggageHeader)) {\n // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it\n return baggageHeader.reduce((acc, curr) => {\n const currBaggageObject = baggageHeaderToObject(curr);\n Object.entries(currBaggageObject).forEach(([key, value]) => {\n acc[key] = value;\n });\n return acc;\n }, {});\n }\n\n return baggageHeaderToObject(baggageHeader);\n}\n\n/**\n * Will parse a baggage header, which is a simple key-value map, into a flat object.\n *\n * @param baggageHeader The baggage header to parse.\n * @returns a flat object containing all the key-value pairs from `baggageHeader`.\n */\nfunction baggageHeaderToObject(baggageHeader) {\n return baggageHeader\n .split(',')\n .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim())))\n .reduce((acc, [key, value]) => {\n if (key && value) {\n acc[key] = value;\n }\n return acc;\n }, {});\n}\n\n/**\n * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.\n *\n * @param object The object to turn into a baggage header.\n * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header\n * is not spec compliant.\n */\nfunction objectToBaggageHeader(object) {\n if (Object.keys(object).length === 0) {\n // An empty baggage header is not spec compliant: We return undefined.\n return undefined;\n }\n\n return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,\n );\n return baggageHeader;\n } else {\n return newBaggageHeader;\n }\n }, '');\n}\n\nexport { BAGGAGE_HEADER_NAME, MAX_BAGGAGE_STRING_LENGTH, SENTRY_BAGGAGE_KEY_PREFIX, SENTRY_BAGGAGE_KEY_PREFIX_REGEX, baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader, parseBaggageHeader };\n//# sourceMappingURL=baggage.js.map\n","import { isString } from './is.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nconst WINDOW = GLOBAL_OBJ ;\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction htmlTreeAsString(\n elem,\n options = {},\n) {\n if (!elem) {\n return '<unknown>';\n }\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem ;\n const MAX_TRAVERSE_HEIGHT = 5;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds maxStringLength\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '<unknown>';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el, keyAttrs) {\n const elem = el\n\n;\n\n const out = [];\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n // @ts-expect-error WINDOW has HTMLElement\n if (WINDOW.HTMLElement) {\n // If using the component name annotation plugin, this value may be available on the DOM node\n if (elem instanceof HTMLElement && elem.dataset) {\n if (elem.dataset['sentryComponent']) {\n return elem.dataset['sentryComponent'];\n }\n if (elem.dataset['sentryElement']) {\n return elem.dataset['sentryElement'];\n }\n }\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs =\n keyAttrs && keyAttrs.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n const className = elem.className;\n if (className && isString(className)) {\n const classes = className.split(/\\s+/);\n for (const c of classes) {\n out.push(`.${c}`);\n }\n }\n }\n const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];\n for (const k of allowedAttrs) {\n const attr = elem.getAttribute(k);\n if (attr) {\n out.push(`[${k}=\"${attr}\"]`);\n }\n }\n\n return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nfunction getLocationHref() {\n try {\n return WINDOW.document.location.href;\n } catch (oO) {\n return '';\n }\n}\n\n/**\n * Gets a DOM element by using document.querySelector.\n *\n * This wrapper will first check for the existance of the function before\n * actually calling it so that we don't have to take care of this check,\n * every time we want to access the DOM.\n *\n * Reason: DOM/querySelector is not available in all environments.\n *\n * We have to cast to any because utils can be consumed by a variety of environments,\n * and we don't want to break TS users. If you know what element will be selected by\n * `document.querySelector`, specify it as part of the generic call. For example,\n * `const element = getDomElement<Element>('selector');`\n *\n * @param selector the selector string passed on to document.querySelector\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getDomElement(selector) {\n if (WINDOW.document && WINDOW.document.querySelector) {\n return WINDOW.document.querySelector(selector) ;\n }\n return null;\n}\n\n/**\n * Given a DOM element, traverses up the tree until it finds the first ancestor node\n * that has the `data-sentry-component` or `data-sentry-element` attribute with `data-sentry-component` taking\n * precendence. This attribute is added at build-time by projects that have the component name annotation plugin installed.\n *\n * @returns a string representation of the component for the provided DOM element, or `null` if not found\n */\nfunction getComponentName(elem) {\n // @ts-expect-error WINDOW has HTMLElement\n if (!WINDOW.HTMLElement) {\n return null;\n }\n\n let currentElem = elem ;\n const MAX_TRAVERSE_HEIGHT = 5;\n for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) {\n if (!currentElem) {\n return null;\n }\n\n if (currentElem instanceof HTMLElement) {\n if (currentElem.dataset['sentryComponent']) {\n return currentElem.dataset['sentryComponent'];\n }\n if (currentElem.dataset['sentryElement']) {\n return currentElem.dataset['sentryElement'];\n }\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return null;\n}\n\nexport { getComponentName, getDomElement, getLocationHref, htmlTreeAsString };\n//# sourceMappingURL=browser.js.map\n","// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n/**\n * Polyfill for the nullish coalescing operator (`??`).\n *\n * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the\n * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param lhs The value of the expression to the left of the `??`\n * @param rhsFn A function returning the value of the expression to the right of the `??`\n * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value\n */\nfunction _nullishCoalesce(lhs, rhsFn) {\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n return lhs != null ? lhs : rhsFn();\n}\n\n// Sucrase version:\n// function _nullishCoalesce(lhs, rhsFn) {\n// if (lhs != null) {\n// return lhs;\n// } else {\n// return rhsFn();\n// }\n// }\n\nexport { _nullishCoalesce };\n//# sourceMappingURL=_nullishCoalesce.js.map\n","/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The value of the expression\n */\nfunction _optionalChain(ops) {\n let lastAccessLHS = undefined;\n let value = ops[0];\n let i = 1;\n while (i < ops.length) {\n const op = ops[i] ;\n const fn = ops[i + 1] ;\n i += 2;\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n return;\n }\n if (op === 'access' || op === 'optionalAccess') {\n lastAccessLHS = value;\n value = fn(value);\n } else if (op === 'call' || op === 'optionalCall') {\n value = fn((...args) => (value ).call(lastAccessLHS, ...args));\n lastAccessLHS = undefined;\n }\n }\n return value;\n}\n\n// Sucrase version\n// function _optionalChain(ops) {\n// let lastAccessLHS = undefined;\n// let value = ops[0];\n// let i = 1;\n// while (i < ops.length) {\n// const op = ops[i];\n// const fn = ops[i + 1];\n// i += 2;\n// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n// return undefined;\n// }\n// if (op === 'access' || op === 'optionalAccess') {\n// lastAccessLHS = value;\n// value = fn(value);\n// } else if (op === 'call' || op === 'optionalCall') {\n// value = fn((...args) => value.call(lastAccessLHS, ...args));\n// lastAccessLHS = undefined;\n// }\n// }\n// return value;\n// }\n\nexport { _optionalChain };\n//# sourceMappingURL=_optionalChain.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { consoleSandbox, logger } from './logger.js';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol) {\n return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nfunction dsnToString(dsn, withPassword = false) {\n const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n return (\n `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string\n */\nfunction dsnFromString(str) {\n const match = DSN_REGEX.exec(str);\n\n if (!match) {\n // This should be logged to the console\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(`Invalid Sentry Dsn: ${str}`);\n });\n return undefined;\n }\n\n const [protocol, publicKey, pass = '', host = '', port = '', lastPath = ''] = match.slice(1);\n let path = '';\n let projectId = lastPath;\n\n const split = projectId.split('/');\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop() ;\n }\n\n if (projectId) {\n const projectMatch = projectId.match(/^\\d+/);\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey });\n}\n\nfunction dsnFromComponents(components) {\n return {\n protocol: components.protocol,\n publicKey: components.publicKey || '',\n pass: components.pass || '',\n host: components.host,\n port: components.port || '',\n path: components.path || '',\n projectId: components.projectId,\n };\n}\n\nfunction validateDsn(dsn) {\n if (!DEBUG_BUILD) {\n return true;\n }\n\n const { port, projectId, protocol } = dsn;\n\n const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];\n const hasMissingRequiredComponent = requiredComponents.find(component => {\n if (!dsn[component]) {\n logger.error(`Invalid Sentry Dsn: ${component} missing`);\n return true;\n }\n return false;\n });\n\n if (hasMissingRequiredComponent) {\n return false;\n }\n\n if (!projectId.match(/^\\d+$/)) {\n logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n return false;\n }\n\n if (!isValidProtocol(protocol)) {\n logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n return false;\n }\n\n if (port && isNaN(parseInt(port, 10))) {\n logger.error(`Invalid Sentry Dsn: Invalid port ${port}`);\n return false;\n }\n\n return true;\n}\n\n/**\n * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.\n * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source\n */\nfunction makeDsn(from) {\n const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n if (!components || !validateDsn(components)) {\n return undefined;\n }\n return components;\n}\n\nexport { dsnFromString, dsnToString, makeDsn };\n//# sourceMappingURL=dsn.js.map\n","/*\n * This module exists for optimizations in the build process through rollup and terser. We define some global\n * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these\n * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will\n * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to\n * `logger` and preventing node-related code from appearing in browser bundles.\n *\n * Attention:\n * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by\n * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)\n * having issues tree-shaking these constants across package boundaries.\n * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want\n * users to be able to shake away expressions that it guards.\n */\n\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\nfunction isBrowserBundle() {\n return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}\n\n/**\n * Get source of SDK.\n */\nfunction getSDKSource() {\n // This comment is used to identify this line in the CDN bundle build step and replace this with \"return 'cdn';\"\n /* __SENTRY_SDK_SOURCE__ */ return 'npm';\n}\n\nexport { getSDKSource, isBrowserBundle };\n//# sourceMappingURL=env.js.map\n","import { dsnToString } from './dsn.js';\nimport { normalize } from './normalize.js';\nimport { dropUndefinedKeys } from './object.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/**\n * Creates an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nfunction createEnvelope(headers, items = []) {\n return [headers, items] ;\n}\n\n/**\n * Add an item to an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nfunction addItemToEnvelope(envelope, newItem) {\n const [headers, items] = envelope;\n return [headers, [...items, newItem]] ;\n}\n\n/**\n * Convenience function to loop through the items and item types of an envelope.\n * (This function was mostly created because working with envelope types is painful at the moment)\n *\n * If the callback returns true, the rest of the items will be skipped.\n */\nfunction forEachEnvelopeItem(\n envelope,\n callback,\n) {\n const envelopeItems = envelope[1];\n\n for (const envelopeItem of envelopeItems) {\n const envelopeItemType = envelopeItem[0].type;\n const result = callback(envelopeItem, envelopeItemType);\n\n if (result) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Returns true if the envelope contains any of the given envelope item types\n */\nfunction envelopeContainsItemType(envelope, types) {\n return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));\n}\n\n/**\n * Encode a string to UTF8 array.\n */\nfunction encodeUTF8(input) {\n return GLOBAL_OBJ.__SENTRY__ && GLOBAL_OBJ.__SENTRY__.encodePolyfill\n ? GLOBAL_OBJ.__SENTRY__.encodePolyfill(input)\n : new TextEncoder().encode(input);\n}\n\n/**\n * Decode a UTF8 array to string.\n */\nfunction decodeUTF8(input) {\n return GLOBAL_OBJ.__SENTRY__ && GLOBAL_OBJ.__SENTRY__.decodePolyfill\n ? GLOBAL_OBJ.__SENTRY__.decodePolyfill(input)\n : new TextDecoder().decode(input);\n}\n\n/**\n * Serializes an envelope.\n */\nfunction serializeEnvelope(envelope) {\n const [envHeaders, items] = envelope;\n\n // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data\n let parts = JSON.stringify(envHeaders);\n\n function append(next) {\n if (typeof parts === 'string') {\n parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts), next];\n } else {\n parts.push(typeof next === 'string' ? encodeUTF8(next) : next);\n }\n }\n\n for (const item of items) {\n const [itemHeaders, payload] = item;\n\n append(`\\n${JSON.stringify(itemHeaders)}\\n`);\n\n if (typeof payload === 'string' || payload instanceof Uint8Array) {\n append(payload);\n } else {\n let stringifiedPayload;\n try {\n stringifiedPayload = JSON.stringify(payload);\n } catch (e) {\n // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still\n // fails, we try again after normalizing it again with infinite normalization depth. This of course has a\n // performance impact but in this case a performance hit is better than throwing.\n stringifiedPayload = JSON.stringify(normalize(payload));\n }\n append(stringifiedPayload);\n }\n }\n\n return typeof parts === 'string' ? parts : concatBuffers(parts);\n}\n\nfunction concatBuffers(buffers) {\n const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);\n\n const merged = new Uint8Array(totalLength);\n let offset = 0;\n for (const buffer of buffers) {\n merged.set(buffer, offset);\n offset += buffer.length;\n }\n\n return merged;\n}\n\n/**\n * Parses an envelope\n */\nfunction parseEnvelope(env) {\n let buffer = typeof env === 'string' ? encodeUTF8(env) : env;\n\n function readBinary(length) {\n const bin = buffer.subarray(0, length);\n // Replace the buffer with the remaining data excluding trailing newline\n buffer = buffer.subarray(length + 1);\n return bin;\n }\n\n function readJson() {\n let i = buffer.indexOf(0xa);\n // If we couldn't find a newline, we must have found the end of the buffer\n if (i < 0) {\n i = buffer.length;\n }\n\n return JSON.parse(decodeUTF8(readBinary(i))) ;\n }\n\n const envelopeHeader = readJson();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const items = [];\n\n while (buffer.length) {\n const itemHeader = readJson();\n const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;\n\n items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);\n }\n\n return [envelopeHeader, items];\n}\n\n/**\n * Creates envelope item for a single span\n */\nfunction createSpanEnvelopeItem(spanJson) {\n const spanHeaders = {\n type: 'span',\n };\n\n return [spanHeaders, spanJson];\n}\n\n/**\n * Creates attachment envelope items\n */\nfunction createAttachmentEnvelopeItem(attachment) {\n const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data) : attachment.data;\n\n return [\n dropUndefinedKeys({\n type: 'attachment',\n length: buffer.length,\n filename: attachment.filename,\n content_type: attachment.contentType,\n attachment_type: attachment.attachmentType,\n }),\n buffer,\n ];\n}\n\nconst ITEM_TYPE_TO_DATA_CATEGORY_MAP = {\n session: 'session',\n sessions: 'session',\n attachment: 'attachment',\n transaction: 'transaction',\n event: 'error',\n client_report: 'internal',\n user_report: 'default',\n profile: 'profile',\n profile_chunk: 'profile',\n replay_event: 'replay',\n replay_recording: 'replay',\n check_in: 'monitor',\n feedback: 'feedback',\n span: 'span',\n statsd: 'metric_bucket',\n};\n\n/**\n * Maps the type of an envelope item to a data category.\n */\nfunction envelopeItemTypeToDataCategory(type) {\n return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];\n}\n\n/** Extracts the minimal SDK info from the metadata or an events */\nfunction getSdkMetadataForEnvelopeHeader(metadataOrEvent) {\n if (!metadataOrEvent || !metadataOrEvent.sdk) {\n return;\n }\n const { name, version } = metadataOrEvent.sdk;\n return { name, version };\n}\n\n/**\n * Creates event envelope headers, based on event, sdk info and tunnel\n * Note: This function was extracted from the core package to make it available in Replay\n */\nfunction createEventEnvelopeHeaders(\n event,\n sdkInfo,\n tunnel,\n dsn,\n) {\n const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;\n return {\n event_id: event.event_id ,\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n ...(dynamicSamplingContext && {\n trace: dropUndefinedKeys({ ...dynamicSamplingContext }),\n }),\n };\n}\n\nexport { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, createEventEnvelopeHeaders, createSpanEnvelopeItem, envelopeContainsItemType, envelopeItemTypeToDataCategory, forEachEnvelopeItem, getSdkMetadataForEnvelopeHeader, parseEnvelope, serializeEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { logger } from '../logger.js';\nimport { getFunctionName } from '../stacktrace.js';\n\n// We keep the handlers globally\nconst handlers = {};\nconst instrumented = {};\n\n/** Add a handler function. */\nfunction addHandler(type, handler) {\n handlers[type] = handlers[type] || [];\n (handlers[type] ).push(handler);\n}\n\n/**\n * Reset all instrumentation handlers.\n * This can be used by tests to ensure we have a clean slate of instrumentation handlers.\n */\nfunction resetInstrumentationHandlers() {\n Object.keys(handlers).forEach(key => {\n handlers[key ] = undefined;\n });\n}\n\n/** Maybe run an instrumentation function, unless it was already called. */\nfunction maybeInstrument(type, instrumentFn) {\n if (!instrumented[type]) {\n instrumentFn();\n instrumented[type] = true;\n }\n}\n\n/** Trigger handlers for a given instrumentation type. */\nfunction triggerHandlers(type, data) {\n const typeHandlers = type && handlers[type];\n if (!typeHandlers) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n\nexport { addHandler, maybeInstrument, resetInstrumentationHandlers, triggerHandlers };\n//# sourceMappingURL=handlers.js.map\n","// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isError(wat) {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n case '[object WebAssembly.Exception]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat, className) {\n return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isErrorEvent(wat) {\n return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMError(wat) {\n return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMException(wat) {\n return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isString(wat) {\n return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given string is parameterized\n * {@link isParameterizedString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isParameterizedString(wat) {\n return (\n typeof wat === 'object' &&\n wat !== null &&\n '__sentry_template_string__' in wat &&\n '__sentry_template_values__' in wat\n );\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPrimitive(wat) {\n return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal, or a class instance.\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPlainObject(wat) {\n return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isEvent(wat) {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isElement(wat) {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isRegExp(wat) {\n return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nfunction isThenable(wat) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isSyntheticEvent(wat) {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nfunction isInstanceOf(wat, base) {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n\n/**\n * Checks whether given value's type is a Vue ViewModel.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isVueViewModel(wat) {\n // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.\n return !!(typeof wat === 'object' && wat !== null && ((wat ).__isVue || (wat )._isVue));\n}\n\nexport { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isString, isSyntheticEvent, isThenable, isVueViewModel };\n//# sourceMappingURL=is.js.map\n","import { isBrowserBundle } from './env.js';\n\n/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n */\n\n\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nfunction isNodeEnv() {\n // explicitly check for browser bundles as those can be optimized statically\n // by terser/rollup.\n return (\n !isBrowserBundle() &&\n Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'\n );\n}\n\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction dynamicRequire(mod, request) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return mod.require(request);\n}\n\n/**\n * Helper for dynamically loading module that should work with linked dependencies.\n * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`\n * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during\n * build time. `require.resolve` is also not available in any other way, so we cannot create,\n * a fake helper like we do with `dynamicRequire`.\n *\n * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.\n * That is to mimic the behavior of `require.resolve` exactly.\n *\n * @param moduleName module name to require\n * @returns possibly required module\n */\nfunction loadModule(moduleName) {\n let mod;\n\n try {\n mod = dynamicRequire(module, moduleName);\n } catch (e) {\n // no-empty\n }\n\n try {\n const { cwd } = dynamicRequire(module, 'process');\n mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) ;\n } catch (e) {\n // no-empty\n }\n\n return mod;\n}\n\nexport { dynamicRequire, isNodeEnv, loadModule };\n//# sourceMappingURL=node.js.map\n","import { isNodeEnv } from './node.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/**\n * Returns true if we are in the browser.\n */\nfunction isBrowser() {\n // eslint-disable-next-line no-restricted-globals\n return typeof window !== 'undefined' && (!isNodeEnv() || isElectronNodeRenderer());\n}\n\n// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them\nfunction isElectronNodeRenderer() {\n return (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n (GLOBAL_OBJ ).process !== undefined && ((GLOBAL_OBJ ).process ).type === 'renderer'\n );\n}\n\nexport { isBrowser };\n//# sourceMappingURL=isBrowser.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { getGlobalSingleton, GLOBAL_OBJ } from './worldwide.js';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nconst CONSOLE_LEVELS = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] ;\n\n/** This may be mutated by the console instrumentation. */\nconst originalConsoleMethods\n\n = {};\n\n/** JSDoc */\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nfunction consoleSandbox(callback) {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console ;\n const wrappedFuncs = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) ;\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level] ;\n wrappedFuncs[level] = console[level] ;\n console[level] = originalConsoleMethod;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] ;\n });\n }\n}\n\nfunction makeLogger() {\n let enabled = false;\n const logger = {\n enable: () => {\n enabled = true;\n },\n disable: () => {\n enabled = false;\n },\n isEnabled: () => enabled,\n };\n\n if (DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(name => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n logger[name] = (...args) => {\n if (enabled) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = () => undefined;\n });\n }\n\n return logger ;\n}\n\n/**\n * This is a logger singleton which either logs things or no-ops if logging is not enabled.\n * The logger is a singleton on the carrier, to ensure that a consistent logger is used throughout the SDK.\n */\nconst logger = getGlobalSingleton('logger', makeLogger);\n\nexport { CONSOLE_LEVELS, consoleSandbox, logger, originalConsoleMethods };\n//# sourceMappingURL=logger.js.map\n","import { addNonEnumerableProperty } from './object.js';\nimport { snipLine } from './string.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nfunction uuid4() {\n const gbl = GLOBAL_OBJ ;\n const crypto = gbl.crypto || gbl.msCrypto;\n\n let getRandomByte = () => Math.random() * 16;\n try {\n if (crypto && crypto.randomUUID) {\n return crypto.randomUUID().replace(/-/g, '');\n }\n if (crypto && crypto.getRandomValues) {\n getRandomByte = () => {\n // crypto.getRandomValues might return undefined instead of the typed array\n // in old Chromium versions (e.g. 23.0.1235.0 (151422))\n // However, `typedArray` is still filled in-place.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray\n const typedArray = new Uint8Array(1);\n crypto.getRandomValues(typedArray);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return typedArray[0];\n };\n }\n } catch (_) {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n // eslint-disable-next-line no-bitwise\n ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16),\n );\n}\n\nfunction getFirstException(event) {\n return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nfunction getEventDescription(event) {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\n\n const firstException = getFirstException(event);\n if (firstException) {\n if (firstException.type && firstException.value) {\n return `${firstException.type}: ${firstException.value}`;\n }\n return firstException.type || firstException.value || eventId || '<unknown>';\n }\n return eventId || '<unknown>';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nfunction addExceptionTypeValue(event, value, type) {\n const exception = (event.exception = event.exception || {});\n const values = (exception.values = exception.values || []);\n const firstException = (values[0] = values[0] || {});\n if (!firstException.value) {\n firstException.value = value || '';\n }\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nfunction addExceptionMechanism(event, newMechanism) {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\n\nfunction _parseInt(input) {\n return parseInt(input || '', 10);\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nfunction parseSemver(input) {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = _parseInt(match[1]);\n const minor = _parseInt(match[2]);\n const patch = _parseInt(match[3]);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nfunction addContextToFrame(lines, frame, linesOfContext = 5) {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line) => snipLine(line, 0));\n\n // We guard here to ensure this is not larger than the existing number of lines\n const lineIndex = Math.min(maxLines - 1, sourceLine);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n frame.context_line = snipLine(lines[lineIndex], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nfunction checkOrSetAlreadyCaught(exception) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && (exception ).__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception , '__sentry_captured__', true);\n } catch (err) {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nfunction arrayify(maybeArray) {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n\nexport { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, arrayify, checkOrSetAlreadyCaught, getEventDescription, parseSemver, uuid4 };\n//# sourceMappingURL=misc.js.map\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Helper to decycle json objects\n */\nfunction memoBuilder() {\n const hasWeakSet = typeof WeakSet === 'function';\n const inner = hasWeakSet ? new WeakSet() : [];\n function memoize(obj) {\n if (hasWeakSet) {\n if (inner.has(obj)) {\n return true;\n }\n inner.add(obj);\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < inner.length; i++) {\n const value = inner[i];\n if (value === obj) {\n return true;\n }\n }\n inner.push(obj);\n return false;\n }\n\n function unmemoize(obj) {\n if (hasWeakSet) {\n inner.delete(obj);\n } else {\n for (let i = 0; i < inner.length; i++) {\n if (inner[i] === obj) {\n inner.splice(i, 1);\n break;\n }\n }\n }\n }\n return [memoize, unmemoize];\n}\n\nexport { memoBuilder };\n//# sourceMappingURL=memo.js.map\n","import { isVueViewModel, isSyntheticEvent } from './is.js';\nimport { memoBuilder } from './memo.js';\nimport { convertToPlainObject } from './object.js';\nimport { getFunctionName } from './stacktrace.js';\n\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output.\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction normalize(input, depth = 100, maxProperties = +Infinity) {\n try {\n // since we're at the outermost level, we don't provide a key\n return visit('', input, depth, maxProperties);\n } catch (err) {\n return { ERROR: `**non-serializable** (${err})` };\n }\n}\n\n/** JSDoc */\nfunction normalizeToSize(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n object,\n // Default Node.js REPL depth\n depth = 3,\n // 100kB, as 200kB is max payload size, so half sounds reasonable\n maxSize = 100 * 1024,\n) {\n const normalized = normalize(object, depth);\n\n if (jsonSize(normalized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return normalized ;\n}\n\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\nfunction visit(\n key,\n value,\n depth = +Infinity,\n maxProperties = +Infinity,\n memo = memoBuilder(),\n) {\n const [memoize, unmemoize] = memo;\n\n // Get the simple cases out of the way first\n if (\n value == null || // this matches null and undefined -> eqeq not eqeqeq\n ['boolean', 'string'].includes(typeof value) ||\n (typeof value === 'number' && Number.isFinite(value))\n ) {\n return value ;\n }\n\n const stringified = stringifyValue(key, value);\n\n // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n if (!stringified.startsWith('[object ')) {\n return stringified;\n }\n\n // From here on, we can assert that `value` is either an object or an array.\n\n // Do not normalize objects that we know have already been normalized. As a general rule, the\n // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n // have already been normalized.\n if ((value )['__sentry_skip_normalization__']) {\n return value ;\n }\n\n // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there\n // We keep a certain amount of depth.\n // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state.\n const remainingDepth =\n typeof (value )['__sentry_override_normalization_depth__'] === 'number'\n ? ((value )['__sentry_override_normalization_depth__'] )\n : depth;\n\n // We're also done if we've reached the max depth\n if (remainingDepth === 0) {\n // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n return stringified.replace('object ', '');\n }\n\n // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n if (memoize(value)) {\n return '[Circular ~]';\n }\n\n // If the value has a `toJSON` method, we call it to extract more information\n const valueWithToJSON = value ;\n if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n try {\n const jsonValue = valueWithToJSON.toJSON();\n // We need to normalize the return value of `.toJSON()` in case it has circular references\n return visit('', jsonValue, remainingDepth - 1, maxProperties, memo);\n } catch (err) {\n // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n }\n }\n\n // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n // property/entry, and keep track of the number of items we add to it.\n const normalized = (Array.isArray(value) ? [] : {}) ;\n let numAdded = 0;\n\n // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n // properties are non-enumerable and otherwise would get missed.\n const visitable = convertToPlainObject(value );\n\n for (const visitKey in visitable) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n continue;\n }\n\n if (numAdded >= maxProperties) {\n normalized[visitKey] = '[MaxProperties ~]';\n break;\n }\n\n // Recursively visit all the child nodes\n const visitValue = visitable[visitKey];\n normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);\n\n numAdded++;\n }\n\n // Once we've visited all the branches, remove the parent from memo storage\n unmemoize(value);\n\n // Return accumulated values\n return normalized;\n}\n\n/* eslint-disable complexity */\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\nfunction stringifyValue(\n key,\n // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n // our internal use, it'll do\n value,\n) {\n try {\n if (key === 'domain' && value && typeof value === 'object' && (value )._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n // which won't throw if they are not present.\n\n if (typeof global !== 'undefined' && value === global) {\n return '[Global]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n }\n\n if (isVueViewModel(value)) {\n return '[VueViewModel]';\n }\n\n // React's SyntheticEvent thingy\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && !Number.isFinite(value)) {\n return `[${value}]`;\n }\n\n if (typeof value === 'function') {\n return `[Function: ${getFunctionName(value)}]`;\n }\n\n if (typeof value === 'symbol') {\n return `[${String(value)}]`;\n }\n\n // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n if (typeof value === 'bigint') {\n return `[BigInt: ${String(value)}]`;\n }\n\n // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n // we can make sure that only plain objects come out that way.\n const objName = getConstructorName(value);\n\n // Handle HTML Elements\n if (/^HTML(\\w*)Element$/.test(objName)) {\n return `[HTMLElement: ${objName}]`;\n }\n\n return `[object ${objName}]`;\n } catch (err) {\n return `**non-serializable** (${err})`;\n }\n}\n/* eslint-enable complexity */\n\nfunction getConstructorName(value) {\n const prototype = Object.getPrototypeOf(value);\n\n return prototype ? prototype.constructor.name : 'null prototype';\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value) {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction jsonSize(value) {\n return utf8Length(JSON.stringify(value));\n}\n\n/**\n * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint\n * across platforms and working directory.\n *\n * @param url The URL to be normalized.\n * @param basePath The application base path.\n * @returns The normalized URL.\n */\nfunction normalizeUrlToBase(url, basePath) {\n const escapedBase = basePath\n // Backslash to forward\n .replace(/\\\\/g, '/')\n // Escape RegExp special characters\n .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n\n let newUrl = url;\n try {\n newUrl = decodeURI(url);\n } catch (_Oo) {\n // Sometime this breaks\n }\n return (\n newUrl\n .replace(/\\\\/g, '/')\n .replace(/webpack:\\/?/g, '') // Remove intermediate base path\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///')\n );\n}\n\nexport { normalize, normalizeToSize, normalizeUrlToBase };\n//# sourceMappingURL=normalize.js.map\n","import { htmlTreeAsString } from './browser.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { isError, isEvent, isInstanceOf, isElement, isPlainObject, isPrimitive } from './is.js';\nimport { logger } from './logger.js';\nimport { truncate } from './string.js';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other\n * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nfunction fill(source, name, replacementFactory) {\n if (!(name in source)) {\n return;\n }\n\n const original = source[name] ;\n const wrapped = replacementFactory(original) ;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (typeof wrapped === 'function') {\n markFunctionWrapped(wrapped, original);\n }\n\n source[name] = wrapped;\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nfunction addNonEnumerableProperty(obj, name, value) {\n try {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true,\n });\n } catch (o_O) {\n DEBUG_BUILD && logger.log(`Failed to add non-enumerable property \"${name}\" to object`, obj);\n }\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nfunction markFunctionWrapped(wrapped, original) {\n try {\n const proto = original.prototype || {};\n wrapped.prototype = original.prototype = proto;\n addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n } catch (o_O) {} // eslint-disable-line no-empty\n}\n\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\nfunction getOriginalFunction(func) {\n return func.__sentry_original__;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nfunction urlEncode(object) {\n return Object.keys(object)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n .join('&');\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor\n * an Error.\n */\nfunction convertToPlainObject(\n value,\n)\n\n {\n if (isError(value)) {\n return {\n message: value.message,\n name: value.name,\n stack: value.stack,\n ...getOwnProperties(value),\n };\n } else if (isEvent(value)) {\n const newObj\n\n = {\n type: value.type,\n target: serializeEventTarget(value.target),\n currentTarget: serializeEventTarget(value.currentTarget),\n ...getOwnProperties(value),\n };\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n newObj.detail = value.detail;\n }\n\n return newObj;\n } else {\n return value;\n }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target) {\n try {\n return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n } catch (_oO) {\n return '<unknown>';\n }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj) {\n if (typeof obj === 'object' && obj !== null) {\n const extractedProps = {};\n for (const property in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, property)) {\n extractedProps[property] = (obj )[property];\n }\n }\n return extractedProps;\n } else {\n return {};\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nfunction extractExceptionKeysForMessage(exception, maxLength = 40) {\n const keys = Object.keys(convertToPlainObject(exception));\n keys.sort();\n\n const firstKey = keys[0];\n\n if (!firstKey) {\n return '[object has no keys]';\n }\n\n if (firstKey.length >= maxLength) {\n return truncate(firstKey, maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n */\nfunction dropUndefinedKeys(inputValue) {\n // This map keeps track of what already visited nodes map to.\n // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n // references as the input object.\n const memoizationMap = new Map();\n\n // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys(inputValue, memoizationMap) {\n if (isPojo(inputValue)) {\n // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal ;\n }\n\n const returnValue = {};\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n for (const key of Object.getOwnPropertyNames(inputValue)) {\n if (typeof inputValue[key] !== 'undefined') {\n returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);\n }\n }\n\n return returnValue ;\n }\n\n if (Array.isArray(inputValue)) {\n // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal ;\n }\n\n const returnValue = [];\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n inputValue.forEach((item) => {\n returnValue.push(_dropUndefinedKeys(item, memoizationMap));\n });\n\n return returnValue ;\n }\n\n return inputValue;\n}\n\nfunction isPojo(input) {\n if (!isPlainObject(input)) {\n return false;\n }\n\n try {\n const name = (Object.getPrototypeOf(input) ).constructor.name;\n return !name || name === 'Object';\n } catch (e) {\n return true;\n }\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nfunction objectify(wat) {\n let objectified;\n switch (true) {\n case wat === undefined || wat === null:\n objectified = new String(wat);\n break;\n\n // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n // an object in order to wrap it.\n case typeof wat === 'symbol' || typeof wat === 'bigint':\n objectified = Object(wat);\n break;\n\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new (wat ).constructor(wat);\n break;\n\n // by process of elimination, at this point we know that `wat` must already be an object\n default:\n objectified = wat;\n break;\n }\n return objectified;\n}\n\nexport { addNonEnumerableProperty, convertToPlainObject, dropUndefinedKeys, extractExceptionKeysForMessage, fill, getOriginalFunction, markFunctionWrapped, objectify, urlEncode };\n//# sourceMappingURL=object.js.map\n","import { uuid4 } from './misc.js';\n\n/**\n * Returns a new minimal propagation context\n */\nfunction generatePropagationContext() {\n return {\n traceId: uuid4(),\n spanId: uuid4().substring(16),\n };\n}\n\nexport { generatePropagationContext };\n//# sourceMappingURL=propagationContext.js.map\n","// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend\n\nconst DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\nfunction parseRetryAfterHeader(header, now = Date.now()) {\n const headerDelay = parseInt(`${header}`, 10);\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n const headerDate = Date.parse(`${header}`);\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return DEFAULT_RETRY_AFTER;\n}\n\n/**\n * Gets the time that the given category is disabled until for rate limiting.\n * In case no category-specific limit is set but a general rate limit across all categories is active,\n * that time is returned.\n *\n * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.\n */\nfunction disabledUntil(limits, dataCategory) {\n return limits[dataCategory] || limits.all || 0;\n}\n\n/**\n * Checks if a category is rate limited\n */\nfunction isRateLimited(limits, dataCategory, now = Date.now()) {\n return disabledUntil(limits, dataCategory) > now;\n}\n\n/**\n * Update ratelimits from incoming headers.\n *\n * @return the updated RateLimits object.\n */\nfunction updateRateLimits(\n limits,\n { statusCode, headers },\n now = Date.now(),\n) {\n const updatedRateLimits = {\n ...limits,\n };\n\n // \"The name is case-insensitive.\"\n // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n const rateLimitHeader = headers && headers['x-sentry-rate-limits'];\n const retryAfterHeader = headers && headers['retry-after'];\n\n if (rateLimitHeader) {\n /**\n * rate limit headers are of the form\n * <header>,<header>,..\n * where each <header> is of the form\n * <retry_after>: <categories>: <scope>: <reason_code>: <namespaces>\n * where\n * <retry_after> is a delay in seconds\n * <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form\n * <category>;<category>;...\n * <scope> is what's being limited (org, project, or key) - ignored by SDK\n * <reason_code> is an arbitrary string like \"org_quota\" - ignored by SDK\n * <namespaces> Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected.\n * Only present if rate limit applies to the metric_bucket data category.\n */\n for (const limit of rateLimitHeader.trim().split(',')) {\n const [retryAfter, categories, , , namespaces] = limit.split(':', 5) ;\n const headerDelay = parseInt(retryAfter, 10);\n const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n if (!categories) {\n updatedRateLimits.all = now + delay;\n } else {\n for (const category of categories.split(';')) {\n if (category === 'metric_bucket') {\n // namespaces will be present when category === 'metric_bucket'\n if (!namespaces || namespaces.split(';').includes('custom')) {\n updatedRateLimits[category] = now + delay;\n }\n } else {\n updatedRateLimits[category] = now + delay;\n }\n }\n }\n }\n } else if (retryAfterHeader) {\n updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n } else if (statusCode === 429) {\n updatedRateLimits.all = now + 60 * 1000;\n }\n\n return updatedRateLimits;\n}\n\nexport { DEFAULT_RETRY_AFTER, disabledUntil, isRateLimited, parseRetryAfterHeader, updateRateLimits };\n//# sourceMappingURL=ratelimit.js.map\n","// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either\n//\n// a) moving `validSeverityLevels` to `@sentry/types`,\n// b) moving the`SeverityLevel` type here, or\n// c) importing `validSeverityLevels` from here into `@sentry/types`.\n//\n// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would\n// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the\n// type, reminding anyone who changes it to change this list also, will have to do.\n\nconst validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];\n\n/**\n * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.\n *\n * @param level String representation of desired `SeverityLevel`.\n * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.\n */\nfunction severityLevelFromString(level) {\n return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') ;\n}\n\nexport { severityLevelFromString, validSeverityLevels };\n//# sourceMappingURL=severity.js.map\n","const STACKTRACE_FRAME_LIMIT = 50;\nconst UNKNOWN_FUNCTION = '?';\n// Used to sanitize webpack (error: *) wrapped stack errors\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\nconst STRIP_FRAME_REGEXP = /captureMessage|captureException/;\n\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\nfunction createStackParser(...parsers) {\n const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);\n\n return (stack, skipFirstLines = 0, framesToPop = 0) => {\n const frames = [];\n const lines = stack.split('\\n');\n\n for (let i = skipFirstLines; i < lines.length; i++) {\n const line = lines[i] ;\n // Ignore lines over 1kb as they are unlikely to be stack frames.\n // Many of the regular expressions use backtracking which results in run time that increases exponentially with\n // input size. Huge strings can result in hangs/Denial of Service:\n // https://github.com/getsentry/sentry-javascript/issues/2286\n if (line.length > 1024) {\n continue;\n }\n\n // https://github.com/getsentry/sentry-javascript/issues/5459\n // Remove webpack (error: *) wrappers\n const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n\n // https://github.com/getsentry/sentry-javascript/issues/7813\n // Skip Error: lines\n if (cleanedLine.match(/\\S*Error: /)) {\n continue;\n }\n\n for (const parser of sortedParsers) {\n const frame = parser(cleanedLine);\n\n if (frame) {\n frames.push(frame);\n break;\n }\n }\n\n if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) {\n break;\n }\n }\n\n return stripSentryFramesAndReverse(frames.slice(framesToPop));\n };\n}\n\n/**\n * Gets a stack parser implementation from Options.stackParser\n * @see Options\n *\n * If options contains an array of line parsers, it is converted into a parser\n */\nfunction stackParserFromStackParserOptions(stackParser) {\n if (Array.isArray(stackParser)) {\n return createStackParser(...stackParser);\n }\n return stackParser;\n}\n\n/**\n * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.\n * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the\n * function that caused the crash is the last frame in the array.\n * @hidden\n */\nfunction stripSentryFramesAndReverse(stack) {\n if (!stack.length) {\n return [];\n }\n\n const localStack = Array.from(stack);\n\n // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n if (/sentryWrapped/.test(getLastStackFrame(localStack).function || '')) {\n localStack.pop();\n }\n\n // Reversing in the middle of the procedure allows us to just pop the values off the stack\n localStack.reverse();\n\n // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || '')) {\n localStack.pop();\n\n // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')`\n // is produced within the hub itself, making it:\n //\n // Sentry.captureException()\n // getCurrentHub().captureException()\n //\n // instead of just the top `Sentry` call itself.\n // This forces us to possibly strip an additional frame in the exact same was as above.\n if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || '')) {\n localStack.pop();\n }\n }\n\n return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({\n ...frame,\n filename: frame.filename || getLastStackFrame(localStack).filename,\n function: frame.function || UNKNOWN_FUNCTION,\n }));\n}\n\nfunction getLastStackFrame(arr) {\n return arr[arr.length - 1] || {};\n}\n\nconst defaultFunctionName = '<anonymous>';\n\n/**\n * Safely extract function name from itself\n */\nfunction getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}\n\n/**\n * Get's stack frames from an event without needing to check for undefined properties.\n */\nfunction getFramesFromEvent(event) {\n const exception = event.exception;\n\n if (exception) {\n const frames = [];\n try {\n // @ts-expect-error Object could be undefined\n exception.values.forEach(value => {\n // @ts-expect-error Value could be undefined\n if (value.stacktrace.frames) {\n // @ts-expect-error Value could be undefined\n frames.push(...value.stacktrace.frames);\n }\n });\n return frames;\n } catch (_oO) {\n return undefined;\n }\n }\n return undefined;\n}\n\nexport { UNKNOWN_FUNCTION, createStackParser, getFramesFromEvent, getFunctionName, stackParserFromStackParserOptions, stripSentryFramesAndReverse };\n//# sourceMappingURL=stacktrace.js.map\n","import { isVueViewModel, isString, isRegExp } from './is.js';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nfunction truncate(str, max = 0) {\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nfunction snipLine(line, colno) {\n let newLine = line;\n const lineLength = newLine.length;\n if (lineLength <= 150) {\n return newLine;\n }\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n // console warnings. This happens when a Vue template is rendered with\n // an undeclared variable, which we try to stringify, ultimately causing\n // Vue to issue another warning which repeats indefinitely.\n // see: https://github.com/getsentry/sentry-javascript/pull/8981\n if (isVueViewModel(value)) {\n output.push('[VueViewModel]');\n } else {\n output.push(String(value));\n }\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nfunction isMatchingPattern(\n value,\n pattern,\n requireExactStringMatch = false,\n) {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n if (isString(pattern)) {\n return requireExactStringMatch ? value === pattern : value.includes(pattern);\n }\n\n return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nfunction stringMatchesSomePattern(\n testString,\n patterns = [],\n requireExactStringMatch = false,\n) {\n return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n\nexport { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate };\n//# sourceMappingURL=string.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { logger } from './logger.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nconst WINDOW = GLOBAL_OBJ ;\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsErrorEvent() {\n try {\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsDOMError() {\n try {\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-expect-error It really needs 1 argument, not 0.\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsDOMException() {\n try {\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsFetch() {\n if (!('fetch' in WINDOW)) {\n return false;\n }\n\n try {\n new Headers();\n new Request('http://www.example.com');\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * isNative checks if the given function is a native implementation\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isNativeFunction(func) {\n return func && /^function\\s+\\w+\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nfunction supportsNativeFetch() {\n if (typeof EdgeRuntime === 'string') {\n return true;\n }\n\n if (!supportsFetch()) {\n return false;\n }\n\n // Fast path to avoid DOM I/O\n // eslint-disable-next-line @typescript-eslint/unbound-method\n if (isNativeFunction(WINDOW.fetch)) {\n return true;\n }\n\n // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n let result = false;\n const doc = WINDOW.document;\n // eslint-disable-next-line deprecation/deprecation\n if (doc && typeof (doc.createElement ) === 'function') {\n try {\n const sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n result = isNativeFunction(sandbox.contentWindow.fetch);\n }\n doc.head.removeChild(sandbox);\n } catch (err) {\n DEBUG_BUILD &&\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n\n return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsReportingObserver() {\n return 'ReportingObserver' in WINDOW;\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsReferrerPolicy() {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n // (see https://caniuse.com/#feat=referrer-policy),\n // it doesn't. And it throws an exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n new Request('_', {\n referrerPolicy: 'origin' ,\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n\nexport { isNativeFunction, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver };\n//# sourceMappingURL=supports.js.map\n","import { isThenable } from './is.js';\n\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/** SyncPromise internal states */\nvar States; (function (States) {\n /** Pending */\n const PENDING = 0; States[States[\"PENDING\"] = PENDING] = \"PENDING\";\n /** Resolved / OK */\n const RESOLVED = 1; States[States[\"RESOLVED\"] = RESOLVED] = \"RESOLVED\";\n /** Rejected / Error */\n const REJECTED = 2; States[States[\"REJECTED\"] = REJECTED] = \"REJECTED\";\n})(States || (States = {}));\n\n// Overloads so we can call resolvedSyncPromise without arguments and generic argument\n\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\nfunction resolvedSyncPromise(value) {\n return new SyncPromise(resolve => {\n resolve(value);\n });\n}\n\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\nfunction rejectedSyncPromise(reason) {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise {\n\n constructor(\n executor,\n ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this);\n this._state = States.PENDING;\n this._handlers = [];\n\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n\n /** JSDoc */\n then(\n onfulfilled,\n onrejected,\n ) {\n return new SyncPromise((resolve, reject) => {\n this._handlers.push([\n false,\n result => {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result );\n } else {\n try {\n resolve(onfulfilled(result));\n } catch (e) {\n reject(e);\n }\n }\n },\n reason => {\n if (!onrejected) {\n reject(reason);\n } else {\n try {\n resolve(onrejected(reason));\n } catch (e) {\n reject(e);\n }\n }\n },\n ]);\n this._executeHandlers();\n });\n }\n\n /** JSDoc */\n catch(\n onrejected,\n ) {\n return this.then(val => val, onrejected);\n }\n\n /** JSDoc */\n finally(onfinally) {\n return new SyncPromise((resolve, reject) => {\n let val;\n let isRejected;\n\n return this.then(\n value => {\n isRejected = false;\n val = value;\n if (onfinally) {\n onfinally();\n }\n },\n reason => {\n isRejected = true;\n val = reason;\n if (onfinally) {\n onfinally();\n }\n },\n ).then(() => {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve(val );\n });\n });\n }\n\n /** JSDoc */\n __init() {this._resolve = (value) => {\n this._setResult(States.RESOLVED, value);\n };}\n\n /** JSDoc */\n __init2() {this._reject = (reason) => {\n this._setResult(States.REJECTED, reason);\n };}\n\n /** JSDoc */\n __init3() {this._setResult = (state, value) => {\n if (this._state !== States.PENDING) {\n return;\n }\n\n if (isThenable(value)) {\n void (value ).then(this._resolve, this._reject);\n return;\n }\n\n this._state = state;\n this._value = value;\n\n this._executeHandlers();\n };}\n\n /** JSDoc */\n __init4() {this._executeHandlers = () => {\n if (this._state === States.PENDING) {\n return;\n }\n\n const cachedHandlers = this._handlers.slice();\n this._handlers = [];\n\n cachedHandlers.forEach(handler => {\n if (handler[0]) {\n return;\n }\n\n if (this._state === States.RESOLVED) {\n handler[1](this._value );\n }\n\n if (this._state === States.REJECTED) {\n handler[2](this._value);\n }\n\n handler[0] = true;\n });\n };}\n}\n\nexport { SyncPromise, rejectedSyncPromise, resolvedSyncPromise };\n//# sourceMappingURL=syncpromise.js.map\n","import { GLOBAL_OBJ } from './worldwide.js';\n\nconst ONE_SECOND_IN_MS = 1000;\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n *\n * TODO(v8): Return type should be rounded.\n */\nfunction dateTimestampInSeconds() {\n return Date.now() / ONE_SECOND_IN_MS;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction createUnixTimestampInSecondsFunc() {\n const { performance } = GLOBAL_OBJ ;\n if (!performance || !performance.now) {\n return dateTimestampInSeconds;\n }\n\n // Some browser and environments don't have a timeOrigin, so we fallback to\n // using Date.now() to compute the starting time.\n const approxStartingTimeOrigin = Date.now() - performance.now();\n const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin;\n\n // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current\n // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed.\n //\n // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the\n // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and\n // correct for this.\n // See: https://github.com/getsentry/sentry-javascript/issues/2590\n // See: https://github.com/mdn/content/issues/4713\n // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6\n return () => {\n return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS;\n };\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nconst timestampInSeconds = createUnixTimestampInSecondsFunc();\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nlet _browserPerformanceTimeOriginMode;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nconst browserPerformanceTimeOrigin = (() => {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n\n const { performance } = GLOBAL_OBJ ;\n if (!performance || !performance.now) {\n _browserPerformanceTimeOriginMode = 'none';\n return undefined;\n }\n\n const threshold = 3600 * 1000;\n const performanceNow = performance.now();\n const dateNow = Date.now();\n\n // if timeOrigin isn't available set delta to threshold so it isn't used\n const timeOriginDelta = performance.timeOrigin\n ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n : threshold;\n const timeOriginIsReliable = timeOriginDelta < threshold;\n\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n const navigationStart = performance.timing && performance.timing.navigationStart;\n const hasNavigationStart = typeof navigationStart === 'number';\n // if navigationStart isn't available set delta to threshold so it isn't used\n const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n const navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n _browserPerformanceTimeOriginMode = 'timeOrigin';\n return performance.timeOrigin;\n } else {\n _browserPerformanceTimeOriginMode = 'navigationStart';\n return navigationStart;\n }\n }\n\n // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n _browserPerformanceTimeOriginMode = 'dateNow';\n return dateNow;\n})();\n\nexport { _browserPerformanceTimeOriginMode, browserPerformanceTimeOrigin, dateTimestampInSeconds, timestampInSeconds };\n//# sourceMappingURL=time.js.map\n","import { baggageHeaderToDynamicSamplingContext } from './baggage.js';\nimport { uuid4 } from './misc.js';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- RegExp is used for readability here\nconst TRACEPARENT_REGEXP = new RegExp(\n '^[ \\\\t]*' + // whitespace\n '([0-9a-f]{32})?' + // trace_id\n '-?([0-9a-f]{16})?' + // span_id\n '-?([01])?' + // sampled\n '[ \\\\t]*$', // whitespace\n);\n\n/**\n * Extract transaction context data from a `sentry-trace` header.\n *\n * @param traceparent Traceparent string\n *\n * @returns Object containing data from the header, or undefined if traceparent string is malformed\n */\nfunction extractTraceparentData(traceparent) {\n if (!traceparent) {\n return undefined;\n }\n\n const matches = traceparent.match(TRACEPARENT_REGEXP);\n if (!matches) {\n return undefined;\n }\n\n let parentSampled;\n if (matches[3] === '1') {\n parentSampled = true;\n } else if (matches[3] === '0') {\n parentSampled = false;\n }\n\n return {\n traceId: matches[1],\n parentSampled,\n parentSpanId: matches[2],\n };\n}\n\n/**\n * Create a propagation context from incoming headers or\n * creates a minimal new one if the headers are undefined.\n */\nfunction propagationContextFromHeaders(\n sentryTrace,\n baggage,\n) {\n const traceparentData = extractTraceparentData(sentryTrace);\n const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);\n\n const { traceId, parentSpanId, parentSampled } = traceparentData || {};\n\n if (!traceparentData) {\n return {\n traceId: traceId || uuid4(),\n spanId: uuid4().substring(16),\n };\n } else {\n return {\n traceId: traceId || uuid4(),\n parentSpanId: parentSpanId || uuid4().substring(16),\n spanId: uuid4().substring(16),\n sampled: parentSampled,\n dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n };\n }\n}\n\n/**\n * Create sentry-trace header from span context values.\n */\nfunction generateSentryTraceHeader(\n traceId = uuid4(),\n spanId = uuid4().substring(16),\n sampled,\n) {\n let sampledString = '';\n if (sampled !== undefined) {\n sampledString = sampled ? '-1' : '-0';\n }\n return `${traceId}-${spanId}${sampledString}`;\n}\n\nexport { TRACEPARENT_REGEXP, extractTraceparentData, generateSentryTraceHeader, propagationContextFromHeaders };\n//# sourceMappingURL=tracing.js.map\n","const SDK_VERSION = '8.34.0';\n\nexport { SDK_VERSION };\n//# sourceMappingURL=version.js.map\n","import { SDK_VERSION } from './version.js';\n\n/** Get's the global object for the current JavaScript runtime */\nconst GLOBAL_OBJ = globalThis ;\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__[]` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nfunction getGlobalSingleton(name, creator, obj) {\n const gbl = (obj || GLOBAL_OBJ) ;\n const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});\n const versionedCarrier = (__SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {});\n return versionedCarrier[name] || (versionedCarrier[name] = creator());\n}\n\nexport { GLOBAL_OBJ, getGlobalSingleton };\n//# sourceMappingURL=worldwide.js.map\n","function _class_private_field_loose_base(receiver, privateKey) {\n if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {\n throw new TypeError(\"attempted to use private field on non-instance\");\n }\n\n return receiver;\n}\nexport { _class_private_field_loose_base as _ };\n","var id = 0;\n\nfunction _class_private_field_loose_key(name) {\n return \"__private_\" + id++ + \"_\" + name;\n}\nexport { _class_private_field_loose_key as _ };\n","function _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nexport { _interop_require_default as _ };\n","function _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) return obj;\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") return { default: obj };\n\n var cache = _getRequireWildcardCache(nodeInterop);\n\n if (cache && cache.has(obj)) return cache.get(obj);\n\n var newObj = { __proto__: null };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);\n else newObj[key] = obj[key];\n }\n }\n\n newObj.default = obj;\n\n if (cache) cache.set(obj, newObj);\n\n return newObj;\n}\nexport { _interop_require_wildcard as _ };\n"],"names":["addBasePath","path","required","normalizePathTrailingSlash","process","addPathPrefix","basePath","addLocale","args","appBootstrap","callback","scripts","self","hydrate","length","reduce","promise","src","props","then","Promise","resolve","reject","el","document","createElement","key","setAttribute","onload","onerror","innerHTML","children","setTimeout","head","appendChild","catch","console","error","err","window","next","version","env","appDir","getAppBuildId","setAppBuildId","globalBuildId","buildId","callServer","useServerActionDispatcher","globalServerActionDispatcher","dispatch","useCallback","startTransition","serverActionDispatcher","actionPayload","type","ACTION_SERVER_ACTION","actionId","actionArgs","actionDispatcher","findSourceMapURL","undefined","initialServerDataBuffer","initialServerDataWriter","appElement","encoder","TextEncoder","initialServerDataLoaded","initialServerDataFlushed","initialFormStateData","nextServerDataCallback","seg","Error","enqueue","encode","push","binaryString","atob","decodedChunk","Uint8Array","i","charCodeAt","DOMContentLoaded","close","readyState","addEventListener","nextServerDataLoadingGlobal","__next_f","forEach","readable","ReadableStream","start","controller","ctr","val","desiredSize","initialServerResponse","createFromReadableStream","pendingActionQueue","initialRSCPayload","b","createMutableActionQueue","createInitialRouterState","initialFlightData","f","initialCanonicalUrlParts","c","initialParallelRoutes","Map","location","couldBeIntercepted","postponed","s","prerendered","S","ServerRoot","use","actionQueue","AppRouter","globalErrorComponentAndStyles","G","assetPrefix","p","StrictModeIfEnabled","React","Fragment","Root","reactRootOptions","onRecoverableError","onCaughtError","onUncaughtError","reactEl","HeadManagerContext","Provider","value","rootLayoutMissingTags","__next_root_layout_missing_tags","hasMissingTags","documentElement","id","ReactDOMClient","createRoot","render","hydrateRoot","formState","require","getChunkScriptFilename","__webpack_require__","u","encodeURIPath","assignLocation","url","startsWith","urlBase","origin","pathname","URL","endsWith","href","AppRouterAnnouncer","ANNOUNCER_TYPE","tree","portalNode","setPortalNode","useState","useEffect","getAnnouncerNode","announcer","existingAnnouncer","getElementsByName","shadowRoot","childNodes","container","style","cssText","ariaLive","ANNOUNCER_ID","role","attachShadow","mode","body","getElementsByTagName","isConnected","removeChild","routeAnnouncement","setRouteAnnouncement","previousTitle","useRef","currentTitle","title","pageHeader","querySelector","innerText","textContent","current","createPortal","ACTION_HEADER","FLIGHT_HEADERS","NEXT_DID_POSTPONE_HEADER","NEXT_HMR_REFRESH_HEADER","NEXT_IS_PRERENDER_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_SEGMENT_PREFETCH_HEADER","NEXT_ROUTER_STALE_TIME_HEADER","NEXT_ROUTER_STATE_TREE_HEADER","NEXT_RSC_UNION_QUERY","NEXT_URL","RSC_CONTENT_TYPE_HEADER","RSC_HEADER","createEmptyCacheNode","createPrefetchURL","globalMutable","isExternalURL","isBot","navigator","userAgent","_","HistoryUpdater","appRouterState","useInsertionEffect","pushRef","canonicalUrl","historyState","preserveCustomHistoryState","history","state","__NA","__PRIVATE_NEXTJS_INTERNALS_TREE","pendingPush","createHrefFromUrl","pushState","replaceState","lazyData","rsc","prefetchRsc","prefetchHead","parallelRoutes","loading","copyNextJsInternalHistoryState","data","currentState","Head","headCacheNode","resolvedPrefetchRsc","useDeferredValue","Router","useReducer","useUnwrapState","searchParams","useMemo","hasBasePath","removeBasePath","changeByServerResponse","useChangeByServerResponse","previousTree","serverResponse","ACTION_SERVER_PATCH","navigate","useNavigate","navigateType","shouldScroll","ACTION_NAVIGATE","isExternalUrl","locationSearch","search","allowAliasing","appRouter","back","forward","prefetch","options","ACTION_PREFETCH","kind","PrefetchKind","FULL","replace","scroll","refresh","ACTION_REFRESH","hmrRefresh","router","handlePageShow","event","persisted","pendingMpaPath","ACTION_RESTORE","removeEventListener","handleUnhandledRedirect","reason","isRedirectError","preventDefault","getURLFromRedirectError","redirectType","getRedirectTypeFromError","RedirectType","mpaNavigation","assign","unresolvedThenable","originalPushState","bind","originalReplaceState","applyUrlFromHistoryPushReplace","_unused","_N","onPopState","reload","cache","nextUrl","focusAndScrollRef","matchingHead","findHeadInCache","pathParams","getSelectedParams","layoutRouterContext","globalLayoutRouterContext","headKey","content","RedirectBoundary","RuntimeStyles","PathParamsContext","PathnameContext","SearchParamsContext","GlobalLayoutRouterContext","AppRouterContext","LayoutRouterContext","globalErrorComponent","globalErrorStyles","useNavFailureHandler","ErrorBoundary","errorComponent","errorStyles","runtimeStyles","Set","runtimeStyleChanged","forceUpdate","renderedStylesSize","size","changed","add","delete","map","link","rel","precedence","dplId","globalThis","_N_E_STYLE_LOAD","len","cb","bailoutToClientRendering","workStore","workAsyncStorage","getStore","forceStatic","isStaticGeneration","BailoutToCSRError","ClientPageRoot","Component","params","clientSearchParams","clientParams","store","InvariantError","createSearchParamsFromClient","createParamsFromClient","createRenderSearchParamsFromClient","createRenderParamsFromClient","ClientSegmentRoot","slots","ErrorBoundaryHandler","GlobalError","styles","fontFamily","height","textAlign","display","flexDirection","alignItems","justifyContent","text","fontSize","fontWeight","lineHeight","margin","HandleISRError","isRevalidate","getDerivedStateFromError","isNextRouterError","getDerivedStateFromProps","previousPathname","errorScripts","this","reset","constructor","setState","digest","html","div","h2","useUntrackedPathname","forbidden","HTTP_ERROR_FALLBACK_ERROR_CODE","handleGlobalErrors","originConsoleError","patchConsoleError","maybeError","apply","DynamicServerError","isDynamicServerError","DYNAMIC_ERROR_CODE","description","HTTPAccessFallbackBoundary","HTTPAccessFallbackErrorBoundary","componentDidCatch","isHTTPAccessFallbackError","triggeredStatus","getAccessFallbackHTTPStatus","httpStatus","notFound","unauthorized","errorComponents","HTTPAccessErrorStatus","NOT_FOUND","FORBIDDEN","UNAUTHORIZED","isNotFound","isForbidden","isUnauthorized","meta","name","missingSlots","useContext","MissingSlotContext","hasErrorFallback","getAccessFallbackErrorTypeByStatus","ALLOWED_CODES","Object","values","prefix","split","has","Number","status","getDefaultHydrationErrorMessage","getHydrationErrorStackInfo","isHydrationError","isReactHydrationErrorMessage","hydrationErrorRegex","reactUnifiedMismatchWarning","reactHydrationStartMessages","reactHydrationErrorDocLink","isError","test","message","msg","some","rawMessage","firstLineBreak","indexOf","trailing","slice","trim","trimmedMessage","stack","stacks","diffs","line","diff","join","OuterLayoutRouter","__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","ReactDOM","rectProperties","topOfElementInViewport","element","viewportHeight","rect","getBoundingClientRect","top","InnerScrollAndFocusHandler","componentDidMount","handlePotentialScroll","componentDidUpdate","segmentPath","segmentPaths","every","segment","index","matchSegment","scrollRefSegmentPath","domNode","hashFragment","getElementById","findDOMNode","internal_reactDOMfindDOMNode","instance","Element","HTMLElement","shouldSkipElement","includes","getComputedStyle","position","item","nextElementSibling","handleSmoothScroll","scrollIntoView","htmlElement","clientHeight","scrollTop","dontForceLayout","onlyHashChange","focus","ScrollAndFocusHandler","context","InnerLayoutRouter","parallelRouterKey","cacheKey","fullTree","childNode","get","newLazyCacheNode","set","resolvedRsc","refetchTree","walkAddRefetch","segmentPathToWalk","treeToRecreate","parallelRouteKey","isLast","hasOwnProperty","subTree","includeNextUrl","hasInterceptionRouteInCurrentTree","fetchServerResponse","flightRouterState","LoadingBoundary","loadingModuleData","promiseForLoading","loadingRsc","loadingStyles","loadingScripts","Suspense","fallback","templateStyles","templateScripts","template","childNodesForParallelRouter","treeSegment","currentChildSegmentValue","getSegmentValue","preservedSegments","preservedSegmentValue","preservedSegment","createRouterCacheKey","TemplateContext","isActive","canSegmentBeOverridden","existingSegment","getSegmentParam","Array","isArray","param","handleHardNavError","__pendingUrl","toString","hasFallbackRouteParams","fallbackRouteParams","ReadonlyURLSearchParams","ServerInsertedHTMLContext","permanentRedirect","redirect","unstable_rethrow","useParams","usePathname","useRouter","useSearchParams","useSelectedLayoutSegment","useSelectedLayoutSegments","useServerInsertedHTML","readonlySearchParams","useDynamicRouteParams","getSelectedLayoutSegmentPath","first","node","segmentValue","PAGE_SEGMENT_KEY","selectedLayoutSegments","selectedLayoutSegment","DEFAULT_SEGMENT_KEY","ReadonlyURLSearchParamsError","URLSearchParams","append","sort","DIGEST","PromiseQueue","promiseFn","taskResolve","taskReject","taskPromise","task","result","enqueueResult","bump","findIndex","bumpedItem","splice","unshift","maxConcurrency","forced","shift","attachHydrationErrorState","reactHydrationDiffSegments","getReactHydrationDiffSegments","parsedHydrationErrorState","details","hydrationErrorState","warning","notes","reactOutputComponentDiff","createUnhandledError","getUnhandledErrorType","isUnhandledConsoleOrRejection","digestSym","Symbol","for","consoleTypeSym","enqueueConsecutiveDedupedError","queue","isFront","previousError","getHydrationWarningType","storeHydrationErrorStateFromConsoleArgs","htmlTagsWarnings","textAndTagsMismatchWarnings","normalizedMessage","isHtmlTagsWarning","isTextInTagsMismatchWarning","isTextMismatchWarning","textMismatchWarning","isKnownHydrationWarning","serverContent","clientContent","componentStack","getReactStitchedError","REACT_ERROR_STACK_BOTTOM_FRAME","REACT_ERROR_STACK_BOTTOM_FRAME_REGEX","captureOwnerStack","isErrorInstance","originStack","originMessage","stackLines","indexOfSplit","newStack","newError","appendOwnerStack","ownerStack","handleClientError","useErrorHandler","queueMicroTask","queueMicrotask","errorHandlers","rejectionQueue","rejectionHandlers","originError","consoleErrorArgs","capturedFromConsole","formattedErrorMessage","formatConsoleArgs","handler","errorQueue","handleOnUnhandledError","handleOnUnhandledRejection","onUnhandledError","onUnhandledRejection","ev","stackTraceLimit","RedirectErrorBoundary","HandleRedirect","REDIRECT_ERROR_CODE","errorCode","destination","statusCode","at","isNaN","RedirectStatusCode","getRedirectError","getRedirectStatusCodeFromError","TemporaryRedirect","actionStore","actionAsyncStorage","isAction","PermanentRedirect","RenderFromTemplateContext","addSearchParamsToPageSegments","handleAliasedPrefetchEntry","flightData","mutable","applied","currentTree","currentCache","normalizedFlightData","hasLoadingComponentInSeedData","seedData","treePatch","fromEntries","isRootRender","pathToSegment","flightSegmentPathWithLeadingEmpty","newTree","applyRouterStatePatchToTree","newCache","fillNewTreeWithOnlyLoadingSegments","existingCache","routerState","cacheNodeSeedData","isLastSegment","keys","newCacheNode","parallelRouteState","segmentForParallelRoute","parallelSeedData","existingParallelRoutes","fillCacheWithNewSubTreeDataButOnlyLoading","patchedTree","hash","handleMutable","rest","addSearchParamsIfPageSegment","updatedParallelRoutes","parallelRoute","entries","applyFlightData","prefetchEntry","fillLazyItemsTillLeafWithHead","fillCacheWithNewSubTreeData","flightSegmentPath","parallelRoutePatch","refetch","isRootLayout","applyPatch","addRefreshMarkerToActiveParallelSegments","currentSegment","lastSegment","getNextFlightSegmentPath","initialTree","patchTree","initialSegment","patchSegment","patchParallelRoutes","newParallelRoutes","clearCacheNodeDataForSegmentPath","isLastEntry","existingChildSegmentMap","childSegmentMap","existingChildCacheNode","childCacheNode","computeChangedPath","extractPathFromFlightRouterState","isDynamicParameter","removeLeadingSlash","segmentToPathname","normalizeSegments","segments","acc","isGroupSegment","INTERCEPTION_ROUTE_MARKERS","m","childrenPath","childPath","treeA","treeB","changedPath","computeChangedPathImpl","segmentA","parallelRoutesA","segmentB","parallelRoutesB","normalizedSegmentA","normalizedSegmentB","includeHash","initialSeedData","initialCanonicalUrl","getFlightDataPartsFromPath","initialHead","isServer","prefetchCache","initialState","createSeededPrefetchCacheEntry","staleTime","AUTO","withoutSearchParameters","createFetch","createFromNextReadableStream","urlToUrlWithoutFlightMarker","urlWithoutFlightParameters","doMpaNavigation","prefetchKind","headers","encodeURIComponent","JSON","stringify","res","fetchPriority","TEMPORARY","responseUrl","redirected","contentType","interception","staleTimeHeader","parseInt","isFlightResponse","ok","flightStream","createUnclosingPrefetchStream","reader","originalFlightStream","getReader","pull","done","read","response","normalizeFlightData","fetchUrl","uniqueCacheQuery","hexHash","fetch","credentials","priority","fillCacheHelper","fillLazyItems","existingCacheNode","incomingSegment","invalidateCacheByRouterState","existingParallelRoutesCacheNode","hasReusablePrefetch","PrefetchCacheEntryStatus","reusable","parallelRouteCacheNode","seedNode","isNotUndefined","scrollableSegments","decodeURIComponent","handleSegmentMismatch","action","handleExternalUrl","invalidateCacheBelowFlightSegmentPath","isNavigatingToNewRootLayout","nextTree","currentTreeSegment","nextTreeSegment","currentTreeChild","nextTreeChild","abortTask","listenForDynamicRequest","updateCacheNodeOnNavigation","oldCacheNode","oldRouterState","newRouterState","prefetchData","isPrefetchHeadPartial","oldRouterStateChildren","newRouterStateChildren","prefetchDataChildren","oldParallelRoutes","prefetchParallelRoutes","patchedRouterStateChildren","taskChildren","needsDynamicRequest","taskChild","newRouterStateChild","oldRouterStateChild","oldSegmentMapChild","prefetchDataChild","newSegmentChild","newSegmentKeyChild","oldSegmentChild","oldCacheNodeChild","spawnReusedTask","route","reusedRouterState","createCacheNodeOnNavigation","newCacheNodeChild","newSegmentMapChild","patchRouterStateWithNewChildren","newChildren","clone","baseRouterState","updateCacheNodeOnPopstateRestoration","routerStateChildren","routerStateChild","segmentChild","segmentKeyChild","shouldUsePrefetch","isDeferredRsc","possiblyPartialPrefetchHead","spawnPendingTask","isPrefetchRscPartial","isLeafSegment","cacheNodeChildren","createPendingCacheNode","maybePrefetchRsc","maybePrefetchLoading","createDeferredRsc","responsePromise","serverRouterState","dynamicData","dynamicHead","writeDynamicDataIntoPendingTask","rootTask","taskSegment","finishTaskUsingDynamicDataPayload","taskNode","finishPendingCacheNode","cacheNode","taskState","serverState","taskStateChildren","serverStateChildren","dataChildren","taskStateChild","serverStateChild","dataChild","segmentMapChild","taskSegmentChild","taskSegmentKeyChild","cacheNodeChild","abortPendingCacheNode","dynamicSegmentData","serverChildren","dynamicDataChildren","serverRouterStateChild","dynamicDataChild","DEFERRED","tag","pendingRsc","rej","fulfilledRsc","rejectedRsc","getOrCreatePrefetchCacheEntry","prunePrefetchCache","createPrefetchCacheKeyImpl","includeSearchParams","pathnameFromUrl","INTERCEPTION_CACHE_KEY_MARKER","createPrefetchCacheKey","existingCacheEntry","getExistingCacheEntry","maybeNextUrl","cacheKeyWithParams","cacheKeyWithoutParams","cacheKeyToUse","existingEntry","isAliased","aliased","entryWithoutParams","cacheEntry","getPrefetchEntryCacheStatus","isFullPrefetch","prefetchResponse","createLazyPrefetchEntry","prefetchCacheKey","treeAtTimeOfPrefetch","prefetchTime","Date","now","lastUsedTime","fresh","prefetchQueue","newCacheKey","prefixExistingPrefetchCacheEntry","existingCacheKey","prefetchCacheEntry","expired","DYNAMIC_STALETIME_MS","STATIC_STALETIME_MS","stale","findHeadInCacheImpl","keyPrefix","isLastItem","childParallelRoutes","isInterceptionRouteAppPath","hmrRefreshReducer","hmrRefreshReducerNoop","_action","hmrRefreshReducerImpl","navigateReducer","prefetchValues","canonicalUrlOverride","isFirstRead","updatedCanonicalUrl","isHeadPartial","patchedRouterState","dynamicRequest","appliedPatch","segmentPathsToFill","generateSegmentsFromPatch","shouldHardNavigate","subSegment","scrollableSegmentPath","flightRouterPatch","childSegment","prefetchReducer","prefetchReducerImpl","identityReducerWhenSegmentCacheIsEnabled","refreshReducer","log","canonicalUrlOverrideHref","refreshInactiveParallelSegments","updatedTree","updatedCache","restoreReducer","treeToRestore","oldCache","serverActionReducer","createFromFetch","createTemporaryReferenceSet","encodeReply","fetchServerAction","revalidatedParts","temporaryReferences","info","extractInfoFromServerReferenceId","usedArgs","omitUnusedArgs","method","Accept","redirectHeader","_redirectType","isPrerender","revalidatedHeader","parse","paths","cookie","e","redirectLocation","actionFlightData","actionResult","a","redirectHref","actionRevalidated","Boolean","serverPatchReducer","infoByte","argMask","bit","typeBit","hasRestArgs","restArgs","filteredArgs","refetchMarker","fetchedSegments","refreshInactiveParallelSegmentsImpl","rootTree","refetchPath","fetchPromises","fetchPromise","flightDataPath","parallelFetchPromise","all","ACTION_HMR_REFRESH","reducer","serverReducer","clientReducer","createCacheKey","originalHref","originalUrl","normalizedHref","normalizedNextUrl","EntryStatus","readExactRouteCacheEntry","readRouteCacheEntry","readSegmentCacheEntry","requestRouteCacheEntryFromCache","requestSegmentEntryFromCache","waitForSegmentCacheEntry","routeCacheMap","createTupleMap","routeCacheLru","createLRU","onRouteLRUEviction","entry","keypath","pingBlockedTasks","segmentCacheMap","segmentCacheLru","onSegmentLRUEviction","cancelEntryListeners","staleAt","put","nonInterceptedEntry","pendingEntry","promiseWithResolvers","createPromiseWithResolvers","exactEntry","blockedTasks","prev","spawnPrefetchSubtask","fetchRouteOnCacheMiss","accessToken","isPartial","fetchSegmentEntryOnCacheMiss","pingPrefetchTask","rejectRouteCacheEntry","rejectedEntry","rejectSegmentCacheEntry","fetchSegmentPrefetchResponse","prefetchStream","createPrefetchResponseStream","serverData","varyHeader","fulfilledEntry","currentKeypath","newKeypath","segmentCacheEntry","routeKey","trackPrefetchRequestBandwidth","lru","lruEntry","totalByteLength","byteLength","updateSize","maxLruSize","onEviction","didScheduleCleanup","lruSize","deleteNode","deleted","ensureCleanupIsScheduled","requestCleanupCallback","cleanup","ninetyPercentMax","tail","newNodeSize","prevNodeSize","requestIdleCallback","NavigationResultTag","noOpNavigationResult","currentCacheNode","currentFlightRouterState","Fulfilled","snapshot","readRenderSnapshotFromCache","childRouterStates","childSeedDatas","childResult","childTree","segmentEntry","Pending","promiseForFulfilledEntry","Rejected","extra","flightRouterStateSegment","prefetchFlightRouterState","prefetchSeedData","promiseForDynamicServerResponse","navigationTaskToResult","navigateDynamicallyWithNoPrefetch","newUrl","simulatePrefetchTreeUsingDynamicTreePatch","baseTree","canMutateInPlace","simulatePrefetchTreeUsingDynamicTreePatchImpl","patch","updatedParallelRouteKey","baseChildren","childBaseRouterState","createCanonicalUrl","schedulePrefetchTask","scheduleMicrotask","fn","taskHeap","inProgressRequests","sortIdCounter","didScheduleMicrotask","heapPush","sortId","isBlocked","_heapIndex","ensureWorkIsScheduled","processQueueInMicrotask","hasNetworkBandwidth","promiseForServerData","onPrefetchRequestCompletion","noop","heapPeek","pingRouteTree","MAX_CONCURRENT_PREFETCH_REQUESTS","pingSegmentTree","childToken","token","childExitStatus","heapPop","compareQueuePriority","heap","heapSiftUp","parentIndex","parent","last","pop","heapSiftDown","halfLength","leftIndex","left","rightIndex","right","rootEntry","hasValue","lastAccessedEntry","lastAccessedKeys","getEntryIfExists","getOrCreateEntry","newEntry","deleteEntry","deletedEntry","parentMap","StaticGenBailoutError","isStaticGenBailoutError","NEXT_STATIC_GEN_BAILOUT","code","isBailoutToCSRError","isDynamicUsageError","isPostpone","cause","isThenable","detectDomainLocale","pathHasPrefix","formatObject","arg","depth","prototype","call","desc","getOwnPropertyDescriptor","jsonKey","String","idx","startQuote","char","parseFloat","query","parsePath","removeTrailingSlash","errorInfo","reportGlobalError","reportError","stitchedError","removeLocale","locale","cancelIdleCallback","didTimeout","timeRemaining","Math","max","clearTimeout","resolveHref","resolveAs","base","urlAsString","formatWithValidation","urlProtoMatch","match","urlAsStringNoProto","urlParts","normalizedUrl","normalizeRepeatedSlashes","isLocalURL","asPath","finalUrl","interpolatedAs","isDynamicRoute","searchParamsToUrlQuery","interpolateAs","omit","resolvedHref","createRouteLoader","getClientBuildManifest","isAssetError","markAssetError","withFuture","generator","resolver","future","prom","ASSET_LOAD_ERROR","defineProperty","canPrefetch","hasPrefetch","MSInputMethodContext","documentMode","relList","supports","getAssetQueryString","getDeploymentIdQueryOrEmptyString","resolvePromiseWithTimeout","ms","cancelled","r","__BUILD_MANIFEST","onBuildManifest","__BUILD_MANIFEST_CB","MS_MAX_IDLE_DELAY","getFilesForRoute","manifest","allFiles","filter","v","__unsafeCreateTrustedScriptURL","css","entrypoints","loadedScripts","styleSheets","routes","maybeExecuteScript","script","appendScript","crossOrigin","fetchStyleSheet","whenEntrypoint","onEntrypoint","execute","component","exports","default","input","old","loadRoute","devBuildPromiseResolve","entrypoint","finally","cn","connection","saveData","effectiveType","output","prefetchViaDom","as","selector","createRouter","makePublicRouterInstance","withRouter","singletonRouter","readyCallbacks","ready","urlPropertyFields","coreMethodFields","getRouter","events","field","routerEvents","on","eventField","charAt","toUpperCase","substring","_singletonRouter","RouterContext","property","scopedRouter","handleClientScriptLoad","initScriptLoader","ScriptCache","LoadCache","insertStylesheets","preinit","stylesheets","stylesheet","loadScript","onLoad","onReady","dangerouslySetInnerHTML","strategy","onError","afterLoad","loadPromise","__html","setAttributesFromProps","scriptLoaderItems","querySelectorAll","getAttribute","Script","restProps","updateScripts","getIsSsr","nonce","hasOnReadyEffectCalled","hasLoadScriptEffectCalled","concat","styleSrc","preload","integrity","DOMAttributeNames","acceptCharset","className","htmlFor","httpEquiv","noModule","ignoreProps","isBooleanScriptAttribute","attr","toLowerCase","tagName","removeAttribute","policy","getPolicy","trustedTypes","createPolicy","createHTML","createScript","createScriptURL","ComposedComponent","WithRouterWrapper","getInitialProps","origGetInitialProps","MetadataBoundary","OutletBoundary","ViewportBoundary","NameSpace","METADATA_BOUNDARY_NAME","VIEWPORT_BOUNDARY_NAME","OUTLET_BOUNDARY_NAME","createContext","BloomFilter","from","items","errorRate","DEFAULT_ERROR_RATE","export","numItems","numBits","numHashes","bitArray","import","getHashValues","contains","hashValues","murmurhash2","h","str","imul","ceil","fill","file","escapeStringRegexp","reHasRegExp","reReplaceRegExp","djb2Hash","normalizeLocalePath","locales","detectedLocale","pathnameParts","getObjectClassLabel","isPlainObject","getPrototypeOf","BAILOUT_TO_CSR","mitt","create","off","emit","evts","denormalizePagePath","page","_page","normalizePathSep","ensureLeadingSlash","runRemainingActions","pending","runAction","needsRefresh","prevState","payload","handleResult","nextState","discarded","dispatchAction","resolvers","deferredPromise","newAction","createKey","matchesMiddleware","buildCancellationError","matchers","pageLoader","getMiddleware","asPathname","cleanedAs","asWithBasePathAndLocale","RegExp","regexp","stripOrigin","getLocationOrigin","prepareUrlAs","resolvedAs","hrefWasAbsolute","asWasAbsolute","preparedUrl","preparedAs","resolveDynamicRoute","pages","cleanPathname","getRouteRegex","re","withMiddlewareEffects","fetchData","effect","getMiddlewareData","nextConfig","i18n","trailingSlash","rewriteHeader","rewriteTarget","matchedPath","MATCHED_PATH_HEADER","parsedRewriteTarget","parseRelativeUrl","pathnameInfo","getNextPathnameInfo","parseData","fsPathname","getPageList","__rewrites","rewrites","parsedSource","source","resolvedPathname","matches","getRouteMatcher","parsedAs","formatNextPathnameInfo","defaultLocale","redirectTarget","newAs","dataHref","json","SSG_DATA_NOT_FOUND","tryToParseAsJSON","fetchNextData","inflightCache","isPrefetch","hasMiddleware","isServerRender","parseJSON","persistCache","isBackground","unstable_skipClientCache","getData","fetchRetry","attempts","purpose","NODE_ENV","random","handleHardNavigation","getCancelledHandler","cancel","clc","handleCancelled","change","_bfl","skipNavigate","_bfl_s","_bfl_d","staticFilterData","dynamicFilterData","__routerFilterStatic","__routerFilterDynamic","matchesBflStatic","matchesBflDynamic","curAs","allowMatchCurrent","pathsToCheck","asNoSlash","asNoSlashLocale","normalizedAS","curAsParts","currentPart","forcedScroll","routeInfo","isQueryUpdating","_h","shallow","shouldResolveHref","_shouldResolveHref","readyStateChange","isReady","isSsr","prevLocale","ST","mark","routeProps","_inFlightRoute","localeChange","onlyAHashChange","changeState","components","parsed","urlIsNew","parsedAsPathname","__appRouter","isMiddlewareRewrite","isMiddlewareMatch","routeMatch","routeRegex","shouldInterpolate","missingParams","groups","optional","isErrorRoute","getRouteInfo","isPreview","isFallback","cleanedParsedPathname","rewriteAs","prefixedAs","curRouteMatch","unstable_scriptLoader","__N_SSG","__N_SSP","pageProps","__N_REDIRECT","__N_REDIRECT_BASE_PATH","parsedHref","__N_PREVIEW","notFoundRoute","fetchComponent","__NEXT_DATA__","isValidShallowRoute","upcomingScrollState","x","y","resetScroll","upcomingRouterState","canSkipUpdating","compareRouterStates","hashRegex","scrollToHash","getURL","_shallow","__N","_key","handleRouteInfoError","loadErrorFail","gipErr","routeInfoErr","requestedRoute","existingInfo","cachedRouteInfo","fetchNextDataParams","getDataHref","skipInterpolation","sbc","sdc","resolvedRoute","isAPIRoute","mod","wasBailedPrefetch","shouldFetchData","_getData","fetched","getProperError","sub","beforePopState","_bps","oldUrlNoHash","oldHash","newUrlNoHash","newHash","scrollTo","rawHash","idEl","nameEl","urlPathname","originalPathname","_isSsg","isSsg","componentResult","loadPage","ctx","App","AppTree","_wrapApp","loadGetInitialProps","initialProps","wrapApp","subscription","domainLocales","isFirstPopStateEvent","initial","autoExportDynamic","autoExport","isLocaleDomain","gssp","gip","isExperimentalCompile","appGip","gsp","__NEXT_HAS_REWRITES","_initialMatchesMiddlewarePromise","ignorePrefix","lower","addPathSuffix","suffix","normalizeAppPath","normalizeRscURL","stateKeys","queryKeys","j","queryKey","formatUrl","urlObjectKeys","slashedProtocols","urlObj","auth","hostname","protocol","host","port","querystring","urlQueryToSearchParams","slashes","getAssetPathFromRoute","ext","removePathPrefix","pathnameNoDataPrefix","i18nProvider","analyze","existing","scrollBehavior","getClientRects","getSortedRouteObjects","getSortedRoutes","interpolatedRoute","dynamicRegex","dynamicGroups","dynamicMatches","repeat","replaced","BOT_UA_RE","TEST_ROUTE","extractInterceptionRouteInformation","interceptedRoute","isAbsoluteUrl","locationOrigin","resolved","object","omitted","hashIndex","queryIndex","hasQuery","parseQuery","globalBase","resolvedBase","stringifyUrlQueryParam","urlQuery","target","searchParamsList","withoutPrefix","exec","decode","DecodeError","g","slugName","pos","getNamedMiddlewareRegex","getNamedRouteRegex","parseParameter","PARAMETER_PATTERN","parseMatchedParameter","getParametrizedRoute","groupIndex","parameterizedRoute","markerMatch","find","paramMatches","normalizedRoute","getSafeKeyFromSegment","interceptionMarker","getSafeRouteKey","routeKeys","cleanedKey","invalidKey","interceptionPrefix","getNamedParametrizedRoute","prefixRouteKeys","fromCharCode","floor","namedParameterizedRoute","hasInterceptionMarker","usedMarker","NEXT_INTERCEPTION_MARKER_PREFIX","NEXT_QUERY_PARAM_PREFIX","prefixRouteKey","namedRegex","catchAll","catchAllRegex","catchAllGroupedRegex","UrlNode","insert","urlPath","_insert","smoosh","_smoosh","childrenPaths","restSlugName","optionalRestSlugName","curr","placeholder","urlPaths","slugNames","isCatchAll","nextSegment","segmentName","isOptional","handleSlug","previousSlug","nextSlug","slug","normalizedPages","root","pagePath","objects","getter","indexes","pathnames","isParallelRouteSegment","isPageSegment","stringifiedQuery","addInsertedServerHTMLCallback","MiddlewareNotFoundError","MissingStaticPage","NormalizeError","PageNotFoundError","SP","WEB_VITALS","execOnce","getDisplayName","isResSent","stringifyError","used","ABSOLUTE_URL_REGEX","displayName","finished","headersSent","performance","warnOnce"],"sourceRoot":"","ignoreList":[0,1,110,111,112,113,114,115,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342]}