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EA,cACA,MAEA,GAMA,OAJA,0BAEA,SACA,IACA,EAGA,QACA,CAqGA,kBACA,SAWA,OATA,mBAEA,SAEA,OAEA,+BAGA,CACA,CAKA,eACA,4BACA,CC5JA,ICFIC,EDEAC,EAAsB,CAC1B,OACA,MACA,QACA,UACA,UAEA,iBAAAxC,GACA,wEACA,EAmBA,SAASyC,EAAkBjD,EAAQkD,GACnC,qBACA,eACA,CAkHA,oBACA,MAEA,aACA,eAMA,OA3HA,SAAgCC,EAAOb,EAAWY,EAAMV,GAExD,OACA,EACA,KACA,gBACA,WACA,sBAEA,aAEA,WAEA,EACA,gBACA,wBACA,OACA,cAEA,GAGA,KACA,KACA,aACA,IACA,cAEA,cAEA,yBAGA,MAGA,YAIA,OAHA,GACA,SAEA,CACA,CAEA,WACA,gBACA,QACA,IAiEA,sBA/DA,YACA,UACA,iBAEA,wCAEA,IACA,cACA,MAGA,iBACA,KAEA,OAGA,wBACA,gBACA,IAEA,KACA,0BACA,UACA,IAEA,GACA,CACA,SAEA,sCAEA,IACA,CACA,MACA,UAGA,wBAEA,aACA,MAEA,gBACA,WACA,CACA,IAGA,UACA,mBACA,OAEA,yBAGA,IACA,GACA,CAEA,QACA,CACA,GAEA,CAOA,SAMA,CACA,QACA,CACA,oBACA,MAEA,aACA,iBACA,UACA,UACA,UACA,OACA,KACA,KD/EA,YACA,mCACA,IACA,OACA,CACA,SAEA,CAGA,CCuEA,GACA,CACA,SACA,oCACA,CAEA,IAEA,cACA,QACA,CACA,SAEA,iCACA,CACA,CAEA,IACA,WAEA,IACA,WAEA,IACA,eAEA,CACA,QACA,CACA,oBACA,KAEA,0BAEA,UACA,IACA,QAEA,cACA,eACA,aACA,IA3MA,SAAqBW,EAAOnD,EAAQkD,IACpC,cAEA,wBACA,WACA,gBAEA,IADA,SACA,2BACA,kBAEA,sBAGA,OADA,oBACA,CACA,CACA,GAEA,CA4LA,QAEA,CACA,SAEA,2BACA,CACA,QACA,CEhOA,IAAIE,EAAY,QACZC,EAAa,KACjB,cACA,IAOA,EAPA,6BACA,4BACA,4BACA,gCACA,6BACA,OACA,OAEA,gBACA,YACA,IACA,QACA,WAEA,2BACA,QACA,IACA,SAEA,GACA,UACA,kBACA,sBACA,kBACA,yBAEA,CACA,SACA,cAMA,MALA,GAEA,4BAGA,CACA,SAEA,aACA,CACA,CACA,aACA,MACA,QACA,OAEA,aACA,OACA,SAwBA,IAtBA,wBACA,OACA,QACA,2BAEA,QACA,IACA,WAGA,MACA,IACA,SACA,CACA,SAEA,UACA,CAGA,IAEA,EACA,IACA,GACA,CACA,SACA,UACA,CAEA,WD7EA,cACA,IACA,8CACA,YAEA,cAEA,KAEA,wCAIA,MAHA,0BACA,4CACA,IACA,cACA,CCgEA,wBAEA,CACA,CA0CA,OAXA,GACA,OACA,KACA,KACA,SACA,OACA,IApCA,YACA,mBACA,IACA,MAEA,IACA,wBACA,OACA,GACA,OAGA,6BACA,aAEA,wBACA,UAEA,CACA,CACA,EAiBA,SACA,MACA,IAlBA,cACA,MACA,qBACA,oBAEA,UAEA,CACA,EAaA,CCjGA,SAASC,EAAsBC,EAAQvD,EAAQwD,GAC/C,MJSA,YACA,MACA,cACA,oCACA,QAEA,CACA,WACA,CIjBA,IACA,KAEA,SAEA,IAEA,EAFA,uBACA,mBAyDA,OACA,SACA,MACA,SACA,OA3DA,WACA,UACA,EA0DA,IAzDA,gBACA,IACA,YACA,CACA,SAEA,wBACA,CACA,WACA,EAiDA,MAhBA,cAQA,OAPA,IAEA,2BAEA,eACA,IAEA,CACA,EAQA,MAjDA,YACA,OA5CA,SAA8BL,EAAOM,GACrC,OACA,KACA,cAGA,UACA,OACA,MACA,GAIA,OAFA,4EACA,WACA,CACA,CA8BA,KACA,EAgDA,IAjCA,cACA,MAEA,mCACA,EA8BA,OA7BA,cACA,MAEA,mCACA,EA0BA,OAzBA,cACA,MAEA,mCACA,EAsBA,OAlDA,cACA,wBACA,YACA,KACA,cACA,SAEA,IACA,SAEA,OACA,CACA,GACA,GAgDA,OATA,kBACA,KACA,KACA,KACA,MAIA,EAFA,OAEA,uBACA,CACA,CAqBA,oBACA,mBAIA,OAHA,GACA,iBAEA,CACA,CAQA,kBACA,cACA,uCAjCA,SAA2BF,EAAQG,GACnC,GACA,WACA,kBAIA,IAEA,CA2BA,sBACA,sBAHA,UAIA,sEC9JA,QAUA,0DCfIC,qGAWAC,EAAe,YACfC,IAAiBF,EAAK,CAAC,GAC3B,wBACA,GAMIG,EAAoC,WACxC,aACA,IAEA,EACA,EACA,EACA,EACA,EANA,OA6GA,mBACA,gBACA,QACA,OACA,mCAIA,EAFA,QAEA,mBAGA,eAEA,CACA,QACA,CACA,mBAEA,yBACA,OAEA,qBAEA,QACA,UAEA,UAGA,UACA,mBACA,CACA,aACA,KACA,aACA,OACA,OACA,YACA,WACA,CA7IA,KACA,wBACA,0BACA,SACA,IACA,EACA,sBAGA,cACA,2BAIA,MACA,KACA,uCACA,MACA,SACA,YAoBA,OAPA,6BAKA,KAJA,IAMA,CA1BA,CAQA,aACA,IACA,KACA,WACA,kBACA,OACA,WAEA,IAEA,CASA,EACA,sBAGA,cACA,2BAIA,MACA,KACA,uCACA,MACA,UAcA,OANA,qCAIA,KAHA,IAKA,CAnBA,CAOA,aACA,IACA,KACA,iCAEA,CAQA,GACA,wDACA,oDACA,mDACA,IAEA,oBACA,mBACA,EACA,mBACA,QACA,EACA,6BACA,GACA,EAKA,oBACA,GACA,EACA,sBACA,EAEA,WAEA,uBAGA,eAEA,EACA,cAyCA,qBAwCA,CA/LwC,+DCvBpCH,EAAII,EAmBJC,kFAVAC,EAAiB,cACjBC,EAAiB,cACjBC,EAAY,SACZC,EAAa,UACbC,EAAyB,sBACzBC,EAAyB,sBACzBC,EAAqB,SACrBC,EAAmB,KACnBC,EAAmB,KACnBC,EAAqB,KAErBC,EAAe,CAAC,EAChBC,EAAsB,CAAC,EAUvBC,IAAqBlB,EAAK,CAC9B,yBACA,uCACA,oCACA,eACA,qBACA,sBACA,IACA,kBACA,kBAEA,QACA,GACA,SAASmB,KACT,iDACA,CAqBA,SAASC,EAAcC,GACvB,UACA,aAGA,CACA,SAASC,EAAiBC,EAAchC,GACxC,6CACA,gCAGA,CASA,SAASiC,EAAcC,EAAYC,GACnC,cACA,iBAEA,cAEA,iBACA,UAGA,iBACA,SAIA,GACA,CACA,QACA,CAQA,gBACA,MACA,KAEA,wBAEA,MACA,kBAEA,EADA,QACA,KAGA,IAEA,CAKA,OAJA,IAEA,EA1EA,SAAuBC,EAAQ/B,GAE/B,iBAOA,OANA,IAGA,cACA,QAEA,CACA,CAgEA,mBAEA,CACA,CACA,gBACA,MACA,EACA,EACA,EAEA,EACA,EACA,EACA,EAEA,2BAEA,yBAEA,iBAEA,2BACA,eACA,UAEA,cACA,iBACA,iBACA,gBACA,MACA,OACA,qBACA,2BAGA,OAMA,OALA,cAGA,QAEA,CACA,EACA,uBAEA,SACA,SACA,EACA,wBACA,SACA,UArGA,SAA0B2B,EAAchC,GACxC,6CACA,oCAIA,MACA,CA8FA,OACA,SACA,qBACA,mBAOA,IANA,QACA,4BACA,wBAGA,mCACA,aACA,iBACA,oBACA,IAEA,GAFA,WAEA,MAEA,QACA,eACA,cACA,+CACA,CACA,CACA,IAEA,sCAEA,CACA,iBACA,4BACA,oCAEA,WACA,GA4HA,YACA,iBACA,SAOA,iEACA,SASA,+FACA,SASA,0GACA,SAKA,kDACA,SAIA,qDACA,SAKA,0DACA,SAEA,QACA,CA9KA,2BAEA,IACA,0CAGA,gCAEA,YACA,IACA,CACA,QACA,EACA,gBACA,WAIA,OAHA,gBACA,QAEA,CACA,EACA,kBACA,SAKA,OAJA,OAEA,gBAEA,CACA,EACA,oBACA,MACA,KACA,SAEA,cACA,aACA,qCACA,IACA,YAEA,kBAGA,eACA,IACA,CACA,QACA,EACA,mBACA,UACA,MACA,GAIA,OADA,OACA,CACA,CAIA,cACA,aACA,MACA,OACA,IACA,cACA,eACA,CACA,UACA,uFACA,CACA,CACA,QACA,CACA,SAASqC,EAAcnD,GACvB,SACA,eACA,+BACA,wBAEA,GADA,qBACA,CACA,wBACA,MACA,UAGA,wDAEA,CACA,GACA,CACA,QACA,CACA,SAASoD,EAAYC,EAASC,GAC9B,sBACA,OAEA,IACA,CACA,SAASC,EAAmBnD,EAAOoD,GACnC,cAIA,OAHA,0BACA,mCACA,IACA,CACA,CACA,SAASC,EAAgB3C,GACzB,WAEA,IADA,OACA,KACA,mBACA,QACA,OACA,KAEA,uBACA,CACA,QACA,CACA,SAAS4C,EAAgB5C,EAAM6C,IAC/B,OACA,MACA,eAEA,kFCjTA,aAIA,IAHA,IAEA,EAFA,oEAEA,OACA,YAEA,GACA,MAFA,eAGA,WACA,WACA,YACA,YACA,YACA,YACA,YAGA,4BACA,oGACA,mGC5CIC,EAAU,QACVC,EAAe,KAAM,EAAzB,SACIC,EAAW,EAOf,SAASC,EAAenG,GACxB,mDACA,CAmBA,gBAEA,YADA,eACA,+BACA,CACA,cACA,OACA,iCACA,mBACA,WACA,EACA,sBACA,cACA,SAQA,gBAPA,IAEA,EAjCA,SAAmBoG,EAAMpG,GACzB,cACA,OACA,KACA,IACA,OACA,iBACA,KACA,KAGA,CACA,SAEA,CACA,CACA,QACA,CAgBA,MACA,kBAEA,EAGA,EACA,mBACA,WACA,WACA,IACA,CACA,SAEA,CAEA,GAEA,QACA,4DC/DIqG,gCAFAC,EAAgB,CAApB,qBACIC,EAAe,KAEnB,SAASC,EAAmBtD,EAAMoC,GAClC,kBACA,gBACA,OACA,MACA,iBACA,SACA,eAEA,CACA,CACA,CASA,cACA,IAPA,EAOA,IAIA,OAHA,0BACA,OATA,4BAEA,yBAEA,IAOA,qBACA,CACA,cACA,OACA,KACA,0BACA,iBAEA,CACA,QACA,kGCxCI3B,wEAQA8C,EAAsB,gBAatB5C,EAAgB,CACpB,sBACA,wBACA,mBACA,gBAEI6C,IAAa/C,EAAK,CAAC,GACvB,QACA,sBACA,OACA,sBACA,GACA,SAASgD,EAAwBC,GACjC,SACA,4BAEA,IACA,CACA,SAASC,EAAcnB,EAAMhC,GAC7B,iBACA,MACA,YACA,OACA,MAEA,gBACA,OAEA,CACA,CACA,IAAIoD,EAAoC,WACxC,yBACA,cACA,WACA,UACA,SACA,EAzC6B,OAJG,mBA8ChC,EACA,YACA,WACA,2BAEA,iCACA,uBACA,UACA,CAEA,OADA,yBACA,CACA,CAlBwC,GAoBxC,gBACA,6BACA,CACA,IAAIC,EAAiC,WACrC,cACA,mCAIA,cAIA,IAKA,EACA,EACA,EACA,EACA,EATA,IAIA,MAMA,2BA4DA,gBACA,KA6CA,MA7CA,CAIA,SACA,EA5I8B,QA4I9B,QAQA,GANA,KACA,KAGA,QAEA,IAEA,OACA,iBACA,IACA,2BAGA,QACA,0EACA,iBACA,iBACA,MACA,oBAGA,UAEA,CA7BA,CA+BA,CAcA,gBACA,qBACA,YACA,YAEA,CAhHA,EA8FA,YAEA,8CACA,YACA,UACA,0BACA,oBACA,eACA,GACA,CAvGA,QACA,2CAMA,iCACA,cACA,qBACA,KACA,kBAIA,cACA,sBAkBA,8CAlBA,CACA,MAEA,gBACA,aACA,cACA,QAEA,MAGA,MACA,cAGA,MACA,CAKA,EACA,6BACA,aACA,cACA,EACA,oBACA,YACA,cACA,EACA,6BACA,aACA,YACA,EACA,uCACA,IACA,IACA,EACA,uBACA,oBACA,UACA,MACA,CAuDA,GACA,qBAkEA,CAzMqC,GA2MrC,SAASC,EAAWzD,GACpB,eACA,CAUA,6BACA,cACA,qBACA,CAMA,gBACA,aACA,CAOA,kBACA,4BACA,uTC1SA,IAAI0D,EAAkB,eAClBC,EAAc,WACdC,EAAa,UACbC,EAAU,OACVC,EAAY,SACZC,EAAc,WACdC,EAAiB,cACjBC,EAAU,OACVC,EAAa,WACbC,EAAoB,iBACpBC,EAAa,KACbC,EAAqB,KACrBC,GAAe,EACfC,EAAqB,KACrBC,EAAoB,KACxB,SAASC,EAAaC,EAAUC,GAChC,SACA,MACA,IAEA,KADA,UACA,CACA,cACA,IACA,SAEA,CACA,CACA,SAEA,CACA,MACA,IACA,YACA,kBACA,CACA,SAEA,CAEA,CACA,QACA,CAaA,cACA,SACA,kCACA,KACA,QAEA,CACA,8EACA,UAEA,WACA,CAIA,aACA,kEACA,SAEA,WACA,CAQA,aACA,gGACA,CAMA,aACA,WACA,mBAEA,IACA,CAMA,aACA,kBACA,CAMA,aACA,kBACA,CAIA,aAEA,kBACA,yBACA,aAGA,CAIA,aACA,kBACA,+BAGA,QADA,YACA,cACA,8BACA,CACA,QACA,CAIA,cAEA,QADA,iBACA,GACA,sBACA,oCACA,CACA,wBAEA,kBACA,sBACA,gDACA,CACA,kBACA,8BACA,KACA,UAEA,CACA,WACA,CAeA,cAIA,OAHA,mBACA,gDAEA,CACA,CAMA,cACA,SACA,IACA,uBACA,2BACA,UACA,mBAEA,CACA,SAEA,CACA,QACA,CACA,aAOA,OANA,WACA,8EACA,MACA,yCAGA,CACA,CAKA,aACA,SACA,IAEA,KADA,WAEA,CACA,SAEA,CACA,QACA,CA+DA,kBACA,IAvBA,IAuBA,cACA,oBACA,IAEA,OA3BA,EA2BA,EA3BA,EAOA,cACA,WACA,mBACA,0BACA,2BAEA,CACA,kBACA,mBACA,gCACA,0BAEA,CACA,QACA,CAMA,GADA,wCAzBA,yBACA,oBACA,EAyBA,CACA,SAEA,CAEA,QACA,gRC7SIC,EAAa,YACbC,EAAoB,eACpBC,EAAkB,iBACtB,wBAIA,cACA,mBACA,CAQA,cACA,QAWA,OAVA,kBAMA,GADA,GAHA,2BACA,sBACA,KACA,cACA,uBACA,WACA,KAEA,CACA,CAMA,gBACA,kBACA,kBAGA,CAIA,cACA,6BACA,CAKA,cACA,mBACA,QAEA,IACA,CAWA,sBACA,QAQA,OAPA,KACA,UACA,wBACA,IACA,SAGA,CACA,CAOA,kBACA,MAaA,OAZA,IACA,UACA,cAEA,oBACA,QAKA,oBAEA,CACA,CACA,SAASC,EAAqBC,EAAQC,GACtC,WACA,OAOA,OANA,YACA,IAGA,IAEA,WAEA,gBAIA,GAHA,IACA,OAEA,EACA,sBAEA,CACA,CAgBA,kBACA,qCACA,kBACA,iBACA,YACA,YACA,kBAEA,aAGA,mBACA,sBAEA,MAEA,cACA,aACA,WACA,EACA,cACA,MACA,IAGA,CACA,EAEA,eACA,IAEA,CACA,QACA,CAUA,sBACA,WACA,0BACA,YAGA,CASA,oBAQA,OAPA,mCACA,yBACA,aACA,YAEA,IAEA,CACA,CAMA,cACA,OACA,WACA,WACA,IACA,0BACA,MACA,GAEA,CAGA,CAQA,cAMA,OAHA,WACA,6BAEA,CACA,CACA,wBAEA,gBACA,WACA,UACA,KACA,IAYA,IAVA,oBACA,IACA,WACA,MAGA,cACA,MAGA,SACA,WACA,eACA,eACA,gBAEA,GADA,6BACA,CAGA,WACA,SAEA,2CAEA,WACA,GACA,cAEA,OAGA,cAEA,MAGA,UACA,MAEA,QACA,OAtBA,CAwBA,CACA,CACA,QACA,CAEA,gBACA,SACA,uCACA,SACA,aAEA,YACA,CACA,QACA,CACA,cACA,IACA,qBACA,CACA,SAEA,CACA,WACA,CACA,gBACA,SACA,mCAEA,CACA,CACA,gBACA,SACA,sDAEA,CACA,CACA,gBASA,OARA,KACA,YACA,iBAEA,cACA,gBAGA,CACA,CACA,IAAIC,EAA0B,0DAC1BC,EAAqB,kBACrBC,EAAa,UAWjB,wBAGA,kBACA,IACA,MACA,CACA,SAEA,CACA,MATA,mBACA,cASA,yBAwBA,OAvBA,GAIA,SAEA,GAGA,SAEA,eACA,GAGA,UAKA,MACA,SAEA,CACA,CA+BA,kBACA,kCACA,6BACA,IACA,kBAEA,CACA,QACA,CACA,IAAIC,EAA2B,gBAC3BC,EAAmC,wBACnCC,EAAwB,oBAK5B,gBACA,SAcA,OAbA,QAWA,EAtDA,YACA,SACA,iBACA,qCACA,wBACA,MACA,sBACA,WAEA,0CACA,8BACA,MACA,MAEA,iBAEA,CACA,GACA,CACA,QACA,CAkCA,YAPA,IACA,WACA,WACA,YAMA,CACA,qOClcA,aACA,KACA,aACA,SACA,kBACA,aACA,oBACA,eACA,qBACA,aACA,eACA,oBACA,sBACA,cACA,wBACA,qBACA,qBACA,eACA,WACA,SACA,yICnBIC,EAAyB,MACzBC,EAAsB,mBACtBC,EAAwB,qBACxBC,EAAsB,KACtBC,EAA0B,WAC9B,kBACA,IAOA,EAPA,QACA,oBACA,UACA,YACA,8BACA,eAGA,sBACA,aAOA,OALA,kBACA,MAEA,QAEA,CACA,IAGA,oBACA,SAEA,mBACA,MAEA,aAEA,IACA,EACA,sBACA,KAEA,YAEA,OACA,8BAEA,YAEA,YACA,WAEA,EACA,eACA,IACA,CAEA,EACA,sBACA,QACA,gBACA,gBACA,2BACA,WACA,IACA,UAEA,CAEA,2BACA,kBACA,uBACA,CACA,CAGA,OAFA,4BACA,iCACA,CACA,CAtE8B,GAwE1BC,EAA4B,WAChC,cAKA,aACA,2BACA,yBAGA,mBACA,EACA,mBACA,IACA,aACA,uBACA,WAGA,EACA,sBACA,KACA,eACA,KAEA,EACA,oBACA,mBACA,CACA,GACA,qBAmCA,CAlEgC,GAoE5BC,EAAkB,mBAStB,sBACA,MACA,QAKA,GAJA,UAEA,aAEA,GACA,aACA,aACA,IAEA,GADA,oBACA,CACA,gBACA,gBACA,mBACA,oBACA,IACA,KACA,iBAEA,UACA,CAIA,OADA,aACA,IACA,CACA,CACA,SACA,YACA,sBAEA,SAGA,GACA,UAGA,YACA,CACA,CACA,CACA,UACA,CAYA,aACA,QACA,0KC9MIC,EAA0B,uBAC1BC,EAAiB,UACjBC,EAAe,aACfC,EAAW,EAmBf,SAASC,EAAuBC,EAAgBjH,EAAgBkH,EAAMC,GAGtE,WACA,KACA,IACA,4BAEA,WAEA,IA5BA,SAA4BC,EAAOF,EAAMC,GACzC,SACA,iBACA,SAEA,WACA,CAEA,4BACA,CAmBA,WAEA,OACA,MAuCA,WACA,QAGA,GADA,oBACA,GACA,QACA,gBACA,wBACA,IACA,0BACA,CACA,UACA,8EACA,CACA,IACA,KAEA,CACA,QACA,EAzDA,KACA,gBACA,QACA,EACA,mBACA,uBACA,EACA,kBACA,YACA,EACA,UAyEA,cACA,cACA,IAGA,0BAEA,oBACA,gBACA,kBACA,OAEA,EACA,eACA,IAEA,mBACA,EAzFA,UA0FA,qBACA,cACA,MACA,UACA,SACA,2BAGA,wBACA,QAHA,OAKA,2BACA,EArGA,mBACA,SACA,EACA,mBACA,QACA,EACA,oBACA,GACA,EACA,QA6FA,YAEA,MACA,mBACA,gBACA,GAEA,IAEA,CACA,EAtGA,WAGA,cAEA,IADA,SACA,2BACA,oBAEA,GACA,SACA,OACA,0BACA,QAGA,IAqBA,gBACA,WACA,QACA,SACA,eACA,OACA,MAGA,WAEA,qBAEA,SACA,IACA,MAGA,OAEA,aAEA,CACA,QACA,CA2CA,QACA,CAQA,oBACA,iBACA,aACA,QAkBA,OAFA,QAfA,YACA,gBAKA,OAJA,GAEA,cAEA,CACA,EASA,QARA,cAKA,YAJA,iBACA,cACA,kBAEA,yBACA,EAGA,CACA,CAQA,kBACA,wBACA,aACA,QAeA,OAFA,QAZA,YACA,gBAEA,OADA,iBACA,CACA,EASA,QARA,cAKA,YAJA,iBACA,cACA,kBAEA,mBACA,EAGA,CACA,CAQA,kBACA,wBAEA,EADA,WACA,IAiBA,OAFA,QAdA,YACA,+BACA,mBACA,YAEA,GACA,EASA,QARA,cAKA,YAJA,iBACA,cACA,kBAEA,mBACA,EAGA,CACA,CAQA,oBACA,WACA,KACA,4BAEA,YACA,wBAIA,GAHA,WACA,MAEA,0BAEA,MA6BA,gBACA,IAGA,EAHA,OACA,qBACA,qBAGA,EADA,EACA,4BAGA,iBAEA,OACA,qBACA,QACA,EACA,mBACA,QACA,EACA,mBACA,SACA,SACA,MACA,qBACA,GACA,GAEA,aACA,MAUA,OARA,qBAEA,UAEA,IAEA,YAEA,CACA,CACA,sBACA,SACA,cACA,OAiCA,OAhCA,IAEA,WAGA,aACA,IACA,2DAEA,QACA,IAEA,mBACA,IACA,SAEA,MACA,CACA,SACA,mBACA,IAEA,MAEA,OAGA,yGAEA,CACA,QAEA,CACA,CACA,gBAEA,cACA,UACA,SAEA,kBACA,2BAMA,GAEA,WAEA,cAEA,EACA,CACA,EApBA,SAoBA,4DAGA,UAEA,CACA,gBACA,aAEA,SACA,MACA,kBACA,oBAEA,8BAEA,aACA,WACA,WACA,6BAEA,MAGA,CACA,QACA,CACA,0CAEA,UAEA,CACA,gBACA,aAEA,SACA,MACA,kBACA,oBAEA,6BACA,6BAEA,KAGA,CACA,QACA,CACA,mCAEA,UAEA,CACA,kBACA,CAtLA,QACA,IACA,KAEA,GAEA,cAEA,GACA,CACA,GACA,CACA,aAEA,WAEA,CACA,8GCnSIE,EAAa,WACbC,EAAY,WACZC,EAAQ,UACRC,EAAQ,UAERC,GAAa,EACbC,EAAQH,EACRI,EAAQH,EAEZ,SAASI,EAASC,GAClB,MAEA,QAEA,QACA,QACA,IACA,CACA,SAASC,IAGT,IACA,6BACA,wBACA,CACA,SAEA,CACA,CAMA,cACA,YACA,0BAEA,CACA,CAKA,cACA,QACA,yBAuBA,OAtBA,uBAEA,8CAEA,oBAEA,GAEA,IAIA,EA8BA,YAGA,QAFA,8BAEA,YADA,+BACA,IACA,IAEA,QAEA,QACA,CAvCA,MAEA,QAEA,gCAEA,IAEA,QAEA,CACA,CAkCA,mBACA,cAMA,IALA,IAEA,UACA,IACA,OACA,WACA,IACA,GAPA,mEAOA,aACA,OACA,QAGA,8BACA,KAGA,QACA,kICzHIC,GAAkB,EAAtB,eACA,cACA,6BACA,CAQA,gBAMA,IAJA,IAGA,EAHA,KACA,OACA,YAEA,IACA,gBACA,MACA,qBAEA,WAGA,SADA,QACA,MACA,UACA,aAEA,GACA,WAEA,IACA,WACA,CACA,EAEA,wBACA,gBACA,kCACA,OAEA,mBACA,WAEA,kBACA,OACA,GACA,CACA,cAEA,6BACA,QACA,MACA,cACA,QACA,sBAEA,IACA,KAEA,MAEA,SAEA,QACA,GAEA,CAgCA,cACA,SACA,OACA,mBACA,cACA,EACA,oBACA,gBACA,SACA,EACA,sBACA,gBACA,EACA,uBACA,oBACA,aACA,YAEA,EACA,qBACA,eACA,EACA,sBACA,mBACA,aACA,WAEA,EACA,yBACA,cACA,EACA,0BACA,sBACA,SACA,EAEA,kFC3IA,aACA,SAiBA,OACA,IAjBA,YACA,GACA,UAEA,EAcA,IAbA,eACA,wBACA,IACA,MACA,CACA,UACA,iFACA,CACA,IACA,IACA,EAKA,mDCtBIC,EACAC,gCAgBJ,aACA,SA0BA,OACA,IA1BA,YACA,QACA,MAEA,wBAEA,KACA,uBACA,CACA,UACA,yCACA,CACA,IACA,eACA,0HAEA,EAWA,IAVA,YACA,KACA,cACA,eACA,sHAGA,EAKA,uHC9CIC,EAAkB,KAClBC,EAAkB,KAClBC,EAAmB,mCACnBC,EAAkB,mBAEtB,SAASC,EAASxI,EAAOyI,EAAKC,GAC9B,mCACA,sBAGA,CACA,SAASC,EAAa3I,EAAOyI,EAAKG,GAClC,cACA,EAEA,CACA,CACA,SAASC,EAAa7I,IACtB,wBACA,KAGA,IADA,qBACA,WACA,QAEA,QACA,CASA,oBACA,OACA,qBACA,0BACA,uCACA,4BAEA,CA+CA,cACA,gBACA,CAQA,cACA,gBACA,CAoCA,cACA,MAGA,iBACA,SACA,QAEA,gBAMA,MALA,qBAEA,KAGA,6IACA,CACA,QACA,CAmBA,cACA,uCACA,KAwBA,OAvBA,wBACA,qBACA,MACA,6BACA,+BACA,+BACA,4BACA,UACA,IACA,iBAEA,IACA,WAEA,IACA,WAEA,IACA,oBAEA,UACA,CACA,IACA,CACA,sgBCtMA,oBACA,WACA,kBACA,kBACA,UACA,UACA,SACA,WACA,WACA,WACA,eACA,eACA,+BACA,4BACA,kBACA,UACA,iBACA,cACA,SACA,gBACA,yBACA,YACA,4BACA,WACA,eACA,YACA,wBACA,cACA,aACA,cACA,YACA,YACA,gBACA,WACA,YACA,kBACA,cACA,UACA,YACA,SACA,YACA,WACA,0BACA,eACA,SACA,WACA,WACA,kBACA,cACA,YACA,YACA,gBACA,8VCpDI8I,GAA8B,EAAlC,QACA,+BA4IA,QA1IgC,SAAhC,GAEA,aACA,IAGA,EACA,EACA,EACA,EACA,EAPA,qBA4FA,OA3FA,eACA,4BAMA,0BAiDA,aACA,OACA,OACA,OACA,OACA,IACA,CACA,aAIA,OAHA,IACA,yGAEA,CACA,CA5DA,IACA,+BACA,uCACA,kCACA,MAyDA,EACA,EAzDA,iBAOA,GANA,8BACA,4DACA,cACA,IACA,QAEA,YAiDA,EAhDA,UAiDA,cAEA,WAGA,EAFA,eAEA,WAGA,EAGA,yBACA,OACA,uBACA,kBACA,OACA,EACA,eAjEA,IACA,OACA,iCAEA,mBACA,IACA,CAEA,IACA,EACA,0BACA,sBACA,EACA,mBACA,iCACA,kBACA,EACA,+BACA,aACA,IAEA,GACA,gBAEA,GACA,GAEA,aACA,cACA,gBACA,aACA,iBACA,gBAmCA,qDACA,IACA,CACA,QA/FA,0BAwIA,CAzIgC,CAyI9BxH,EAAF,iBC5IIyH,EAAuC,SAA3C,GAEA,kBACA,2BAwBA,OAvBA,oBACA,0BACA,wBACA,yBACA,mBACA,eACA,mBACA,4BAQA,GAPA,6BACA,oCACA,gDAGA,mCAEA,yBACA,mDACA,oBACA,uBACA,CACA,EACA,iBACA,mBACA,CACA,CAsCA,OAjEA,aA4BA,yCACA,WACA,iCACA,6BACA,sBACA,4BACA,2BACA,kBACA,yCACA,0GACA,kCACA,eAEA,OACA,EACA,4CACA,4BACA,2FAKA,GAHA,kBACA,gCAEA,gCAGA,IACA,GACA,QAFA,gCAGA,8CACA,eAEA,yCACA,kCARA,CASA,EACA,gDACA,wGACA,EACA,CACA,CAnE2C,CAmEzC,EAAF,WAWA,oBAUA,OATA,8BACA,eACA,yBACA,8BACA,WAEA,8BACA,MAEA,YAEA,cACA,+BACA,CAKA,OARA,aAIA,8BACA,iOACA,2CACA,EACA,CACA,CAVA,CAUA,EACA,eC9EA,QAzB6C,SAA7C,GAEA,aACA,8CAEA,OADA,sBACA,CACA,CAiBA,OAt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IACA,mBACA,CACA,SACA,MACA,8FACA,CAEA,WACA,CACA,kBACA,UACA,YACA,IAEA,OADA,gBACA,CACA,CACA,SACA,MACA,+FACA,CAEA,QACA,CACA,iBACA,UACA,YACA,IAEA,OADA,SACA,CACA,CACA,SACA,MACA,sGACA,CAEA,QACA,gBCzKA,6DACA,gBACA,mBACA,iBACA,0CACA,eACA,mBACA,qBCXA,mBACA,IAgHA,EAhHA,OACA,EAaA,cACA,MACA,IAEA,2BAEA,SACA,sBACA,2FAGA,WACA,CAzBA,MAEA,aAGA,IAFA,QACA,SACA,UACA,IACA,sBAwGA,gBAxGA,GAyGA,oBAvGA,GACA,CACA,QACA,CAcA,mBAEA,MASA,YAVA,gBAEA,IACA,WACA,2BACA,OACA,oBACA,sGAGA,IACA,CACA,iBACA,sBACA,CACA,iBACA,MAOA,OANA,GACA,aACA,wBACA,kGAGA,IACA,CAaA,iBACA,MACA,UACA,0BACA,4BAEA,IACA,mBACA,CACA,UACA,+DACA,CAEA,eACA,YACA,MACA,IACA,GACA,CACA,QACA,CACA,iBACA,MACA,UACA,0BACA,YACA,MACA,IACA,GACA,CACA,QACA,CAIA,qBACA,MAQA,OAPA,IACA,2BACA,OACA,oBACA,4FAGA,IACA,CCtGA,yBACA,gBACA,cACA,cACA,eACA,qDAEA,SACA,QACA,eACA,OAEA,OACA,OACA,wBACA,OACA,UACA,QACA,QACA,WACA,YAQA,OALA,cACA,0BACA,WACA,IAEA,CACA,EACyC,WACzC,aACA,CAUA,WAEA,CAdyC,GAAzC,ICvCI,GAAJ,WAIA,oBACA,qBACA,MACA,OACA,aACA,gBAEA,WACA,QACA,iBACA,aACA,YACA,CAGA,OAFA,yDACA,uBACA,CACA,CApBA,GCAIC,GAAsB,WAI1B,sBACA,qBACA,MACA,UACA,gBACA,cAEA,WACA,QACA,QACA,aACA,aACA,aACA,IACA,OAEA,CAGA,OAFA,2DACA,yBACA,CACA,CAxB0B,GCHtBC,GACJ,WAIA,qBACA,OACA,OACA,QACA,QACA,MACA,MACA,UAKA,WACA,ECdIC,GAAuB,WAI3B,8BACA,qBACA,MACA,UACA,cAEA,WACA,QACA,aACA,kBACA,kCACA,kCACA,iBACA,UACA,qCACA,cACA,aACA,YACA,CAGA,OAFA,0DACA,wBACA,CACA,CA1B2B,G1BU3B,gBACA,iBACA,KAGA,MAhBA,IAeA,eACA,IACA,EAjBA,IAiBA,mBACA,EAlBA,IAkBA,mBACA,EAnBA,IAmBA,oBACA,qBAKA,OAJA,mCACA,iBACA,kBAEA,UAzBA,KAwBA,kBACA,iBACA,C2BzBA,IAAIC,GAAyB,WAI7B,0BACA,qBACA,MACA,OACA,MACA,WACA,aACA,eACA,MAEA,WACA,QACA,KNiFA,cACA,8BACA,CMnFA,MACA,cACA,iBACA,WACA,YAEA,aACA,YACA,CAGA,OAFA,4DACA,0BACA,CACA,CA5B6B,GCDzBC,GAAoC,WAIxC,0BACA,qBACA,MACA,OACA,MACA,WACA,YACA,iBACA,cACA,mBACA,gBACA,aACA,gBAEA,WACA,QACA,cACA,iBACA,aACA,aACA,IACA,gCACA,UACA,kCACA,wBACA,sCACA,4BAEA,CAGA,OAFA,uEACA,qCACA,CACA,CApCwC,GC+BpCC,GAAW,0GAsGXC,GAA0B,kCAI1BC,GAA2B,yBAC3BC,GAAW,cACXC,GAAW,QACXC,GAAW,QACXC,GAAkB,eAClBC,GAAc,WACdC,GAAa,UACbC,GAAiB,cACjBC,GAAiB,CACrB,IAvGyB,4GAuGzB,2BACA,KAOA,SAAuBC,GACvB,8BACA,EATA,IAIA,SAAyBA,GACzB,iDACA,EANA,GAjFyB,iGAiFzB,qBACA,IA/CyB,wFA+CzB,uBACA,IApBuB,sFAoBvB,oBAQA,SAASC,GAAW1M,EAAO2M,GAC3B,QAiBA,OAhBA,mBACA,eACA,cACA,iBAEA,GADA,eACA,OAGA,OAKA,mCAGA,KACA,CACA,SAASC,GAAeC,EAAUC,GAClC,QAmBA,OAlBA,IACA,mBACA,mBAGA,mBAEA,YAEA,aAEA,mEAIA,sEACA,YAEA,KACA,CAuBA,SAASC,GAAgBC,GACzB,0DACA,CACA,SAASC,GAAiBC,GAC1B,aACA,cAEA,GADA,gBACA,MAGA,MAGA,iBACA,OACA,MACA,MAEA,CAiBA,SAASC,GAAsBC,GAC/B,WACA,KACA,IAGA,SAEA,iBAEA,oBAEA,qBAEA,gCACA,2BAEA,SACA,SAEA,aACA,aAEA,yCAEA,EAzCA,SAAwBC,GAGxB,IAFA,SACA,aACA,gBACA,WACA,SACA,cACA,KAEA,SACA,CACA,OACA,MACA,MAEA,CA0BA,YAEA,0BAEA,wBAEA,gBACA,YAEA,CACA,wBACA,kBACA,IACA,SAEA,mBAEA,IACA,QAEA,CACA,CACA,SAGA,OACA,CAEA,WACA,OACA,SAEA,CAaA,SAASC,GAAYC,GACrB,MACA,QACA,cACA,KACA,QACA,KACA,KACA,wBACA,MA0TA,SAAuBd,GACvB,SACA,oBACA,mBACA,IACA,aAEA,CACA,QACA,CAnUA,KACA,mBAEA,KACA,MAuUA,cACA,MACA,EACA,mCACA,MACA,MACA,UACA,wBACA,YACA,cACA,SACA,gBAPA,EAQA,EAEA,IADA,QACA,UACA,YACA,oBACA,MAEA,QACA,YAGA,iBACA,mBACA,MACA,gCAEA,MAEA,aAEA,OACA,MACA,4BACA,0CAGA,mBAIA,KACA,CACA,GACA,CACA,CACA,YACA,CAvXA,MACA,IACA,QACA,UACA,IAEA,CACA,IAIA,KADA,MAOA,IALA,QACA,SACA,IACA,IACA,IACA,MAKA,IADA,GAFA,QACA,SAVA,MAYA,CAEA,YACA,cACA,KACA,CAEA,IACA,IACA,IACA,GACA,CAEA,CACA,QACA,CACA,SAASe,GAAcV,GAEvB,SACA,QACA,wBAEA,IACA,IACA,EADA,wBACA,yBACA,mBACA,CACA,SAEA,CAGA,QACA,CAKA,eACA,KACA,IACA,kBACA,YACA,WASA,OARA,cACA,QAGA,KADA,UAGA,YAEA,iCACA,QAEA,CACA,CACA,CACA,SAEA,CAGA,gBACA,CACA,IAAIW,GAA0B,WAI9B,wBACA,qBACA,MACA,aACA,gBACA,aACA,gBAEA,WACA,SArOA,SAA8BzN,GAC9B,IACA,gBACA,mDAEA,CACA,SAEA,CACA,QACA,CA4NA,KACA,IACA,MAEA,IACA,QAEA,iBACA,aACA,aACA,IACA,QAEA,IACA,UAIA,cACA,UACA,UACA,OACA,WAEA,OACA,UACA,cAEA,OACA,YAGA,uBACA,uBAGA,CAwDA,OAvDA,gDACA,kBACA,OACA,gBACA,MACA,aACA,eACA,kBACA,aACA,WACA,yBACA,WAEA,EACA,wCACA,aACA,kCAqHA,cACA,wBACA,kCAuGA,SAAkCyM,GAClC,MACA,QACA,QACA,gBACA,kBACA,gBACA,gBACA,YACA,gBACA,GACA,YACA,CAnHA,QACA,KACA,iDACA,QACA,CA3HA,SAEA,OADA,oDAEA,EACA,mCACA,iHAIA,OACA,UACA,WALA,qBACA,wDACA,EAIA,gBACA,aACA,eACA,eACA,KACA,WAEA,EAIA,8CACA,MACA,OACA,aACA,KACA,QACA,YACA,UACA,aACA,IAGA,EACA,6DACA,2BACA,iBACA,CACA,CA3G8B,GA6G1BiB,IAA0B,EAA9B,QACA,KACA,UACA,WACA,UACA,eACA,QACA,gBAEA,SAASC,KACT,WACA,oBACA,kCAiMA,YACA,OACA,cACA,gBACA,cACA,cACA,UAEA,CAzMA,OAUA,MATA,CACA,QACA,kBACA,cACA,aACA,kBACA,YACA,sBAGA,CACA,mBACA,MAGA,EACA,EACA,EACA,EACA,EACA,GAjXA,SAAqC3N,GACrC,IACA,gBACA,wCAEA,CACA,SAEA,CACA,QACA,CAuWA,IAwBA,OACA,OACA,QACA,WACA,WA5BA,CACA,QACA,YACA,cACA,eAEA,kBACA,uBACA,mBACA,SAEA,cACA,wBACA,gBACA,eACA,IAEA,ERnhBA,cACA,MACA,MAEA,WACA,aACA,wBACA,qGAEA,CACA,WACA,CQwgBA,GA/QA,SAA2B4N,GAC3B,SASA,OARA,IAEA,EADA,MACA,iBAGA,WAGA,CACA,CAoQA,KACA,uBACA,IACA,aAEA,CAQA,aACA,MACA,KAvCA,UAwCA,UAvCA,UAwCA,aACA,YACA,OACA,UACA,gBACA,iBACA,CACA,CAQA,SAASC,GAAeC,EAAUC,GAClC,eACA,cACA,UACA,wBAEA,CACA,eACA,YACA,UACA,qBAGA,MAEA,CACA,CACA,SAASC,GAAgBF,EAAUG,EAAUC,GAC7C,WACA,qBACA,iBACA,yBACA,0CAGA,0BAGA,GACA,OAEA,CAWA,IAAIC,IAA2B,EAA/B,QACA,QACA,SACA,WACA,WACA,SAgEA,SAASC,GAA0B3B,GACnC,MAtsB2B,GA+sB3B,OARA,IACA,eACA,iBACA,iBACA,yBACA,wBACA,QAEA,CACA,gBCruBA,YACA,2CACA,oCACA,8CACA,iCACA,oCACA,kCACA,mCACA,yCACA,sDCRI4B,IAAY,EAAhB,aACIC,GAAiB,EAGjBC,GAAqB,CAAzB,0BACA,eACA,SACA,KACA,OAgBA,OAfA,iBAIA,OAEA,8BAJA,kBAMA,WAEA,GACA,OACA,KAEA,KACA,CACA,CAwBA,iBACA,kBACA,MACA,0DACA,+CACA,sBAEA,CACA,QACA,CACA,iBACA,WACA,MACA,2DACA,iDACA,WACA,YACA,sBACA,YAEA,uBAGA,2BAFA,MAKA,IACA,CAEA,CACA,QACA,CC1EA,IAAIC,GAAqB,CACzB,MACA,iDACA,+CAEIC,GAAuB,UAC3B,eACA,+BACA,CAcA,mBACA,sCACA,SAEA,WACA,wDACA,mBACA,SAIA,sBAMA,IALA,uDAGA,yBAEA,uCACA,SAEA,IAEA,EAFA,gCACA,QAEA,wBACA,iGACA,cACA,KACA,GACA,SAGA,4CACA,gBACA,SAEA,oBAEA,GADA,8FACA,QACA,QAEA,CAGA,gBACA,CAIA,eACA,MACA,MASA,cACA,KAEA,IADA,gBACA,gBACA,mBACA,sBACA,WAEA,CAEA,CAnBA,UACA,aACA,QAEA,CACA,CA4CA,cAEA,kBACA,uBACA,uCAEA,OACA,QAEA,CACA,iBACA,CACA,iBACA,WAIA,OAHA,2CACA,OAEA,CACA,CAOA,iBACA,YACA,OACA,mBACA,WACA,EACA,oBACA,gBACA,MACA,EACA,sBACA,gBACA,EACA,uBACA,oBACA,cACA,YAEA,EACA,qBACA,iBACA,EACA,sBACA,mBACA,cACA,aAEA,EACA,yBACA,mBACA,EACA,0BACA,sBACA,cACA,EAEA,CC1LA,IAAIC,GAAqC,WAIzC,yCACA,kBACA,qBACA,KACA,MACA,OACA,aACA,WACA,UACA,OACA,SACA,OACA,aACA,eACA,OACA,QACA,QACA,MACA,MACA,SACA,iBACA,mBACA,cACA,sBAEA,WACA,QACA,OACA,WACA,YACA,kBACA,eACA,MD4DA,kBACA,cACA,cACA,YAEA,GADA,UACA,EACA,eACA,iCACA,oBACA,SAEA,OACA,mBACA,MAEA,SAGA,MAEA,IACA,IAEA,OACA,SACA,OACA,OAEA,CCxFA,UACA,uBACA,wBACA,IACA,8CAEA,gBACA,aACA,YACA,CAGA,OAFA,oEACA,kCACA,CACA,CAjDyC,GCHzC,eACA,WACA,oBACA,mBAEA,CACA,kBACA,mBACA,0BACA,kBAEA,CACA,QACA,4DCRIC,GAAiB,cACjBC,GAAoB,mBACpBC,GAAiB,cACjBC,GAAyB,sBACzBC,GAAY,SACZC,GAAyB,mBACzBC,GAAc,WAEdC,GAAY,SACZC,GAAkB,eAClBC,IAAuB,EAA3B,uBAEIC,KADuB,EAA3B,uBACqB,YACjBC,GAAyB,SACzBC,GAAQ,EACRC,IAAc,EAAlB,gBACIC,GAAiB,sBACrB,SAASC,GAAoBhP,GAC7B,mBACA,+CAEA,CACA,CACA,SAASiP,GAAiBC,EAAWC,GACrC,MACA,aACA,aACA,SACA,yBACA,WAEA,aACA,SAEA,KAEA,KAGA,QAEA,IACA,aACA,SAGA,eAEA,CACA,4BACA,OACA,UACA,gFAEA,CA4BA,SAASC,GAAqBtS,EAAQuS,EAASC,QAC/C,cACA,wBACA,OAIA,OAHA,IACA,WAEA,CACA,CACA,SAASC,GAAU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CAEA,SAASC,GAAaC,EAAOC,EAAaC,EAAQC,EAASC,GAC3D,YACA,oBACA,aACA,WACA,MAEA,iBAEA,OADA,aAEA,EACA,IACA,kBACA,CACA,SACA,YACA,IAEA,eACA,IACA,QACA,mBAEA,CACA,SAEA,SAGA,OACA,CACA,CACA,CACA,GAEA,CAmDA,SAASC,GAAU7T,EAAQkD,EAAM4Q,EAAgBC,GACjD,WASA,OARA,KACA,cACA,IAEA,IACA,2BAGA,CACA,CAyBA,SAASC,GAAsBC,EAAOzL,EAAU8K,EAAIY,GACpD,eACA,OASA,MAhGA,SAA6BC,GAE7B,kBACA,IAEA,YACA,MACA,GACA,SACA,KANA,KAOA,SACA,IAWA,eACA,WACA,KACA,UACA,GAbA,KACA,WAEA,gBAIA,OAHA,kBACA,WACA,IACA,CACA,CANA,yBAaA,cAEA,UACA,KACA,IACA,gBA9BA,KA8BA,EACA,CACA,SAKA,MAHA,QACA,cAEA,CACA,CAIA,OADA,cACA,MACA,CACA,CAiDA,CAPA,GACA,IACA,IACA,IACA,OAIA,QACA,MACA,CACA,OAEA,OACA,OACA,cAGA,cACA,sBACA,YAEA,OADA,gBACA,CAEA,GACA,GAKA,OAFA,MACA,cACA,CACA,CASA,uBAEA,QADA,cACA,SACA,kBACA,MACA,WACA,gHACA,kBAEA,CACA,OACA,WACA,CAgCA,uBACA,YACA,qBACA,KACA,qBAEA,CACA,WACA,2B3BtOA,cACA,0BACA,cACA,UACA,cACA,kBACA,aACA,WACA,mBACA,4BACA,0BACA,eACA,gBACA,cACA,qCACA,sCACA,UACA,2BACA,WACA,gBACA,kBACA,yBACA,6BAEA,+BACA,4BACA,kCACA,YACA,6BACA,6CACA,sCACA,sBACA,kCACA,0BACA,qBACA,2BACA,kCACA,mBAEA,kBACA,iBACA,gB4BxCIC,GAAgC,WACpC,qBACA,2BACA,IAIA,EAJA,OACA,KACA,KACA,KAKA,cACA,GACA,sBAEA,GAEA,CACA,aACA,IACA,wBACA,OACA,iBACA,KACA,MACA,wBACA,IAKA,KAHA,SAKA,IACA,SACA,IAEA,GAEA,KAEA,QAEA,CACA,cACA,UACA,GACA,CAvCA,IACA,YAuCA,oBACA,aACA,qCACA,kBACA,uBACA,CACA,YACA,qCACA,kBACA,oBACA,CACA,OACA,kBAEA,gCAEA,sCAEA,0BACA,8BACA,KACA,CAEA,4BACA,sCACA,CACA,IACA,CAIA,YAOA,OANA,WACA,YACA,aAEA,mMAIA,IACA,EAWA,EAZA,KAGA,cACA,MACA,kBACA,WACA,YAMA,cACA,kBACA,UAEA,cACA,WAEA,IACA,MAEA,SAGA,WACA,MACA,MAIA,IACA,MAGA,cACA,SACA,IACA,YACA,KACA,OACA,OACA,OAEA,SACA,cAOA,IACA,mBACA,YAEA,IACA,WACA,QAVA,QACA,WAYA,MACA,qBAhCA,MAmCA,KACA,IACA,MArCA,IAsCA,YAGA,CACA,UACA,sGACA,CACA,QACA,GACA,EACA,yBACA,MACA,WACA,OACA,iBAEA,MACA,wBACA,MACA,CAEA,GACA,CACA,CACA,GACA,qBAkBA,CAxMoC,GCFhCC,GAAgB,CAApB,kEACA,SAASC,KACT,kBACA,oBACA,CAKA,SAASC,KACT,kBACA,eACA,UACA,uBACA,SACA,SACA,kBACA,SACA,SACA,SACA,cACA,CACA,SAASC,KACT,aACA,kBAEA,IACA,CACA,SAASC,KACT,OAvBA,gBACA,4DAuBA,gCAEA,KA3BA,IACA,CA2BA,CAIA,SAASC,KAET,IADA,SACA,2BACA,kBAEA,IAEA,IAFA,gBAEA,UACA,KACA,KACA,yBACA,2CAGA,KAEA,SAIA,oBACA,iBA3D2B,KA4D3B,SAIA,QACA,CAIA,ICxEI/Q,GDwEAgR,GAA2C,WAC/C,cACA,mBACA,2BACA,kBACA,aAqBA,WACA,OACA,IACA,IACA,IACA,IACA,KACA,QACA,GACA,QAMA,kCACA,2BACA,kBACA,4BAGA,kBACA,kBACA,2BACA,kBACA,2BAEA,OACA,0GAEA,iBAGA,uDAGA,gGAGA,eAEA,wBACA,uBACA,oBACA,yBACA,sBACA,eAfA,oIAkBA,EACA,SACA,SACA,SACA,QACA,GACA,qBAmCA,CApH+C,GElE3CC,GAAqC,WAMzC,gBACA,2BACA,2BACA,oBACA,IAEA,MAeA,cACA,WACA,IAEA,GADA,EAmBA,WACA,WACA,IACA,QAEA,kBAEA,SACA,iBAEA,wBACA,qCAEA,QAEA,CACA,CACA,UACA,yDACA,MACA,CACA,QACA,CAzCA,GACA,KACA,eACA,wFAEA,yCACA,QACA,CACA,CACA,UACA,mDACA,MACA,CACA,QACA,CAhCA,MAEA,GACA,uCAEA,CACA,UACA,2FACA,CACA,GAoDA,gDACA,mEACA,GACA,qBAUA,CAtFyC,GAwFrCC,GACJ,cACA,oCACA,gBACA,cACA,EChGIC,GACJ,cACA,WACA,KACA,yBACA,WACA,yGAEA,cACA,EACA,yBACA,WACA,aACA,uFAEA,CACA,IACA,QADA,UAEA,mBACA,QACA,KACA,WACA,CACA,EF3BA,8FAaA,SAASC,GAAe/U,EAAQgV,GAChC,uBACA,kBAEA,CAYA,IACInR,IAAgB,EAApB,aACA,oCACA,wCACA,uCAEA,gBACA,wCACA,mBACA,UACA,iCAiBA,SAAsBrB,GACtB,4BACA,GAnBA,KACA,mBACA,mBACA,mBACA,0BACA,2BACA,0CACA,mEACA,+DACA,KACA,SAASyS,GAAuBzS,EAAO4I,GAKvC,OAJA,QArBsB,MAuBtB,EAvBsB,MAyBtB,CACA,CAIA,SAAS8J,GAAoBC,IAG7B,kBACA,OpBRA,KACA,OASA,QACA,SoBIA,CACA,IG/DIC,GACAC,GACAC,GH6DAC,GAAgC,SAApC,GAEA,aACA,IAIA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EApBA,qBACA,mBACA,eACA,uBAsBA,IAEA,EACA,EACA,EAEA,EAqlBA,OAplBA,0BACA,YAyiBA,sBACA,gCACA,CACA,aACA,OACA,OACA,OACA,OACA,OACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KAOA,oBACA,eACA,OACA,OACA,OACA,KAEA,qBACA,wBAEA,CA3kBA,IACA,0BACA,sBACA,EACA,iCACA,kBACA,EACA,2BACA,IACA,oCACA,YACA,CACA,SACA,+FACA,CACA,EAKA,8BACA,IACA,UACA,CACA,SACA,oGACA,CACA,EAOA,iCACA,IACA,oBACA,CACA,SACA,mGACA,CACA,EAMA,2BACA,IACA,oCACA,YACA,CACA,SACA,+FACA,CACA,EAWA,4BACA,IACA,oCACA,YACA,CACA,SACA,iGACA,CACA,EAOA,oBACA,IACA,YACA,wEACA,GACA,mBAEA,CACA,SACA,sGACA,CACA,EAOA,sBACA,kBAIA,GAHA,IACA,iDAEA,iBAEA,4BACA,sCACA,CACA,sCACA,YAGA,EAMA,sBACA,sCACA,YACA,EAMA,yCACA,YACA,IACA,SACA,UACA,CACA,SACA,iHACA,CACA,EAOA,6BACA,IACA,uBACA,kBACA,gBACA,CACA,UACA,CACA,SACA,sGACA,CACA,EASA,kCACA,IACA,uBACA,kBACA,gBACA,CACA,uBACA,kBACA,cACA,CACA,gBACA,GACA,UAEA,CACA,SACA,sGACA,CACA,EAOA,sBAGA,gCAEA,gBAGA,uDAEA,QACA,mFACA,cACA,sCACA,mBACA,wCACA,CACA,4BACA,iBACA,+BACA,wDAEA,CACA,sCACA,YACA,EASA,+BACA,yBACA,mBAEA,IACA,UACA,CACA,SACA,uGACA,CACA,EAKA,uBACA,eACA,WACA,IACA,OACA,kBACA,IACA,UAEA,CACA,sCAEA,gEACA,GACA,WACA,MACA,oBACA,sBACA,oBvCrUA,oBACA,iEACA,CuCqUA,qDAIA,aACA,cAEA,mDA+IA,cACA,oCACA,YACA,CAxJA,+LAQA,CACA,SACA,qCACA,sFACA,kDACA,CACA,EACA,kBACA,SAEA,oBAGA,IACA,MAEA,SACA,EACA,+BACA,wBAGA,cACA,8BAEA,sBACA,IACA,8DACA,KACA,wBACA,QACA,IACA,QAsDA,YAEA,mBACA,QACA,6BACA,0BACA,oBAEA,kBACA,WACA,QACA,iBACA,mBAEA,MAEA,QAmBA,WACA,UACA,iDACA,cACA,2BACA,iBACA,KACA,wBACA,yCACA,QAIA,CACA,QACA,EACA,gBACA,IACA,CACA,CArCA,EACA,IACA,CAvEA,IACA,gBACA,+CACA,yCA0EA,gBACA,6BACA,eACA,qBACA,UACA,MACA,MACA,eACA,EACA,CAnFA,YACA,gCACA,OACA,oBACA,IACA,MAEA,IACA,MAEA,mBACA,kDACA,GAEA,mCACA,4BAEA,cACA,MAEA,mBACA,OACA,OACA,MACA,aACA,gBAEA,UACA,GACA,aAgFA,cACA,gBACA,8BACA,+BACA,WAEA,kBACA,KACA,0BACA,gBACA,mCAEA,IACA,IACA,IACA,KAEA,KAkGA,cACA,6BACA,aACA,WACA,QAEA,+BACA,KACA,kBACA,gBACA,kBApnBA,SAAoBC,GACpB,gBACA,eACA,sCACA,SAEA,WACA,CAEA,YACA,CA0mBA,4BAEA,IACA,IACA,IACA,WAEA,IACA,CAnHA,MAEA,WACA,kBACA,gBACA,6BAKA,GAJA,aAIA,uBACA,mBACA,6GA0BA,gBACA,KACA,OAGA,uBACA,aACA,GACA,4BAEA,CACA,aASA,GAPA,GACA,IACA,gBAGA,eAEA,GACA,MAzCA,WACA,WACA,2BACA,yBAEA,OAEA,6BACA,MACA,uBACA,IACA,uBAEA,CACA,CACA,QACA,CAyBA,GACA,MACA,0BACA,kBACA,gBACA,2BAGA,wBACA,EACA,qBAEA,yCACA,+BACA,CACA,CACA,oBACA,KACA,eACA,IACA,wBACA,6BAEA,IACA,IACA,uBACA,KACA,eACA,IACA,2BACA,6BAEA,IACA,IACA,uBACA,6BACA,IACA,CAnFA,OAEA,CACA,IACA,CAjHA,GAEA,CACA,SAGA,MADA,qBACA,CACA,CAsEA,IACA,EACA,CA9HA,CAuDA,EACA,4BACA,mBAEA,uBACA,GACA,EACA,+BACA,WACA,GA6OA,yDACA,oEACA,8DACA,uDACA,IACA,CACA,CA4IA,OAnwBA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A,WACA,aACA,iBACA,UACA,kBACA,mBACA,wBAEA,IAZoB,KAapB,sBAX4B,CAA5B,0DAYA,iBACA,KACIC,GAA8B,SAAlC,GAEA,aACA,IAGA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EAlBA,qBACA,eACA,wCAiBA,IACA,EADA,KA6UA,OA3UA,0BAoCA,aACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,KACA,OACA,OACA,MACA,CA0DA,gBACA,MAEA,GADA,IACA,MACA,WAEA,SAEA,OADA,qBACA,CAEA,CACA,QACA,CACA,aACA,IACA,kBACA,GACA,iBAEA,CACA,SAEA,CACA,CACA,cACA,IACA,uBACA,QAEA,eACA,CACA,SAEA,CACA,QACA,CACA,cACA,IAMA,OALA,IACA,IACA,IA0HA,WACA,MACA,kBACA,KACA,IACA,oBAGA,kBACA,QACA,SAEA,CACA,eACA,wBACA,OACA,CACA,QACA,CACA,SAEA,CAEA,CACA,CAjJA,KAEA,CACA,CACA,SAEA,CACA,QACA,CAaA,kBACA,kBACA,mBACA,sBACA,IACA,OACA,OA3NqB,OA6NrB,IACA,UAEA,uBACA,MACA,IAEA,QACA,CACA,SAGA,CAEA,yBACA,cACA,WAWA,SAVA,KACA,yBACA,uBACA,IAGA,oBAMA,GACA,CACA,SAEA,CAEA,CACA,kBACA,IACA,yBACA,IACA,UAEA,OAvQqB,MAuQrB,GACA,gCACA,oCACA,8BAEA,EACA,qBACA,QACA,EACA,uBACA,QACA,EACA,QACA,CACA,SAEA,CACA,CACA,kBACA,IACA,qBACA,IACA,kBACA,MACA,IACA,KADA,WACA,QACA,wBACA,SAEA,CACA,MAEA,IAEA,KACA,GAEA,CACA,SAEA,CACA,CACA,oBACA,IACA,QACA,CACA,SAEA,CACA,CA2BA,gBACA,WACA,IACA,IACA,cAEA,CACA,SAEA,CACA,QACA,CAIA,cACA,OACA,wBACA,OACA,QACA,OACA,OAEA,CACA,aACA,cACA,OACA,GACA,CArUA,IACA,+BACA,sBACA,8DAiDA,YACA,mBACA,SACA,kCACA,0BACA,oBACA,QACA,gBACA,kBAEA,sBACA,KACA,YAGA,MAGA,cACA,mBAEA,cACA,kBAEA,0BACA,QACA,EACA,MAGA,IACA,OAGA,cACA,YAGA,IACA,IACA,GACA,IAGA,KACA,mBACA,oBACA,uBACA,uBACA,QACA,EAyDA,WACA,SACA,eACA,WACA,KAEA,aACA,MAGA,QACA,CApEA,GACA,IAEA,OACA,WAEA,CAxGA,GACA,EACA,oBACA,QACA,EACA,mBACA,KACA,GACA,EACA,oBACA,KACA,GACA,EAEA,qBACA,WACA,EACA,mBACA,WACA,EACA,sCACA,WACA,EACA,4BACA,IACA,IACA,GACA,EACA,+BACA,iBACA,EAoSA,iCACA,kBACA,CACA,IACA,CACA,QAnWA,0BA6ZA,CA9ZkC,CA8ZhCzY,GAAF,GC5bA,SAAS0Y,GAAexc,EAAQqS,GAChC,iBACA,CCFA,gBACA,OACA,UACA,WACA,WtCFA,6DuCOI,GAAJ,GAEIoK,GAAgB,uBAChBC,GAAkB,OAOlBC,GAAkC,WACtC,aACA,IACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EAdA,KAeA,6BACA,SAsEA,iBACA,wDACA,WACA,CACA,cACA,gDACA,CAiCA,oBACA,IACA,WACA,CACA,SAEA,CACA,CACA,gBACA,kBACA,WACA,MAGA,OAFA,MAEA,EAEA,qBACA,eAKA,sDAGA,OADA,iBAEA,CAQA,kBACA,eACA,IACA,KAEA,UAnFA,EA+FA,EA/FA,OA+FA,QAZA,CACA,yBACA,gBACA,UAGA,uBACA,0FAEA,CAMA,CACA,SACA,iFACA,kBACA,CAEA,CAMA,kBAEA,MACA,EACA,EACA,gBACA,OACA,oBACA,IACA,GACA,KAEA,yBACA,MAGA,eACA,MAGA,OAFA,UACA,UAGA,qCAqBA,cACA,yBAEA,GADA,gBAEA,aAEA,CACA,kBACA,6BACA,CACA,CAUA,OAxCA,GAEA,uDAEA,mCACA,0BACA,IACA,gCACA,IACA,KACA,kBACA,SAGA,EACA,oBACA,GACA,IAEA,EAYA,sBACA,mDACA,OACA,EACA,uBACA,mDACA,QACA,EACA,iBACA,CACA,CAMA,kBACA,MAIA,EACA,EACA,EALA,WACA,WACA,8CAIA,cACA,WACA,KACA,KACA,eAEA,OACA,UACA,SAEA,OAEA,GAEA,4CACA,mCACA,gBACA,IACA,YAEA,EACA,gBAEA,OAEA,yBAEA,IACA,eACA,KACA,EACA,oBAGA,KACA,IACA,QAMA,MAGA,uBACA,IAEA,QACA,CACA,SAGA,CAOA,IANA,OACA,oBACA,IACA,GACA,MAEA,EAGA,OAFA,UACA,UAGA,cAGA,sBACA,CACA,kBACA,eACA,oBACA,gBACA,eAGA,eAEA,CACA,IACA,sCAKA,GAJA,IACA,KACA,MAEA,EAEA,GADA,KACA,WAgCA,6BACA,mBAjCA,CACA,eACA,IAMA,QAMA,YACA,aACA,UAGA,yBACA,gBACA,QACA,KAZA,gBACA,SAcA,CACA,SACA,gBACA,OACA,CACA,CAMA,GACA,CACA,SACA,IACA,gBACA,QAEA,CAkBA,OAjBA,QAEA,KACA,YACA,UAEA,mBAEA,qBACA,IAEA,KACA,YACA,SAEA,aAEA,CACA,CAWA,kBAEA,kBACA,qBACA,WACA,oBACA,kBACA,qBACA,gBACA,SAGA,aAEA,EACA,qBACA,4BACA,EACA,uBACA,WACA,EACA,0BAGA,6CACA,WACA,MAIA,+BACA,wGAGA,OAFA,4BACA,MAEA,CACA,oCACA,aACA,WACA,mBAEA,UACA,KACA,qBACA,SACA,MAGA,SAnBA,MAFA,IAuBA,CACA,aACA,IACA,KACA,KACA,OACA,OACA,OACA,OACA,OACA,OACA,KACA,KACA,KACA,KACA,KACA,MACA,CAheA,IACA,uBACA,IACA,IACA,gDAEA,eACA,IACA,EACA,+BACA,eACA,EAGA,wBACA,IAgBA,GAfA,iCACA,yBACA,qBACA,cACA,wBACA,iBACA,oBACA,wBACA,gBACA,oBACA,4BACA,eACA,IACA,MAEA,GACA,kBACA,+CAEA,KAEA,CACA,QACA,CACA,SAEA,CACA,QACA,EACA,iCACA,QACA,EACA,8BACA,mBA2BA,cACA,QACA,OACA,IACA,0BACA,OACA,SASA,2BAGA,+BACA,KAHA,KATA,WAEA,KAEA,aACA,KASA,IAEA,KACA,OACA,aACA,UACA,YAGA,WACA,CAzDA,MAEA,IACA,EACA,6BACA,QACA,EACA,uBACA,GACA,CAsaA,GACA,qBAqCA,CA1hBsC,GCPtC,iBACA,eACA,kBAEA,CAUA,mBACA,MAcA,OAbA,IACA,kBACA,GACA,KAEA,kBACA,0BACA,sBACA,IAGA,IAEA,CACA,CCjCA,iBACA,IACA,cACA,2BACA,2CACA,kDACA,QAEA,CACA,CACA,UACA,uEACA,YAEA,CACA,WACA,CCtBA,SAASC,GAAYC,GACrB,kBACA,mBACA,UACA,CACA,CACA,IAAIC,GAAiBF,GAAY,eAC7BG,GAAYH,GAAY,UACxBI,GAAcJ,GAAY,YAC1BK,GAAeL,GAAY,aAC3BM,GAAaN,GAAY,WACzBO,GAAUP,GAAY,QACtBQ,GAAWR,GAAY,SACvBS,GAAcT,GAAY,YAC1BU,GAA+B,SAAnC,GAEA,aACA,yBACA,CACA,OAJA,aAIA,CACA,CANmC,EAMjC,EAAF,OACA,6BACA,6BACA,+BACA,kCACA,6BACA,kBACA,kBACA,8BACA,0BACA,wBACA,sCACA,4BACA,oCACA,4BACA,kBACA,gCACA,sCACA,8BACA,8CACA,sBACA,oCACA,0BACA,4BACA,0CACA,oBACA,8BACA,gCACA,wBACA,qBACA,yBACA,iCACA,6BACA,+CACA,mDACA,mBACA,6BACA,yBACA,wDACA,8BACA,0BACA,gBACA,kCACA,gCACA,+DACA,mEACA,qBACA,qBACA,2BACA,qCACA,mCACA,6BACA,yCACA,gCACA,oCACA,wCACA,8BACA,+BChFA,GACA,OADA,GAEA,SAFA,GAGA,QAHA,GAIA,MAJA,GAKA,MALA,GAMA,KAIA,UCLIC,GAIJ,gBACA,WACA,OACA,QACA,iBACA,UACA,iBACA,SACA,0BACA,MACA,OACA,OACA,OACA,sBACA,6BACA,EACA,OACA,OAEA,EC3BIC,GAIJ,cAIA,qBACA,WACA,YAEA,gBACA,eACA,EhETA,cQEA,UACA,gBACA,UACA,UACA,aACA,YACA,eACA,kBACA,cACA,kBACA,cACA,aACA,WACA,UACA,2BACA,WACA,gBACA,eACA,oBACA,gBACA,qBACA,YACA,qBACA,iBACA,aACA,gBACA,aACA,iBACA,wBACA,mBACA,yBACA,2BACA,yBACA,0BACA,gCACA,aACA,0BACA,4BACA,mBACA,cACA,uBACA,gBACA,mBACA,mBACA,cACA,gByDhDIC,GAAc,WACdC,GAAc,WACdC,GAAgB,aAChBC,GAAU,OACd,SAASC,GAAY7d,EAAQkc,EAAO1Z,GACpC,2BACA,CAsFA,SAASsb,GAA6B1X,EAAM2X,EAAYC,IACxD,cACA,2BACA,YACA,QAEA,YACA,QAEA,YACA,wBAEA,GAEA,CACA,SAASC,GAA2CF,EAAYG,IAChE,cACA,0BACA,SACA,GAEA,CAEA,SAASC,GAAgB5a,EAAQ6a,EAAcC,EAAejY,GAC9D,oBACA,0BACA,uBAGA,kCAEA,cACA,8BAMA,OALA,6BAnHA,SAAiC7C,EAAQtF,EAAMqgB,GAE/C,sBACA,kBACA,kBACA,SACA,IACA,iCACA,iCAEA,YACA,GACA,2BAEA,eACA,IACA,kCACA,2BACA,uBACA,6BACA,oBAEA,gBACA,MACA,sCACA,2CACA,iCACA,sBACA,kBACA,kBACA,wBACA,oCACA,8BACA,yCACA,CACA,WACA,IACA,wBACA,kCAGA,cACA,IACA,sCACA,mCACA,4BAmBA,IAFA,SAEA,oBACA,YACA,0BACA,MACA,IACA,aACA,EAEA,0BACA,MACA,IACA,iCACA,2BAEA,oEAEA,iBACA,CAoCA,QAEA,iBACA,UACA,CACA,SAASC,GAAoBhb,EAAQ8a,IACrC,kBACA,wDAEA,CACA,QACA,iBAoBA,mBACA,QACA,SACA,KACA,iBACA,wBAEA,gBACA,gBACA,iBAGA,OACA,cAIA,eACA,aACA,QAEA,gBACA,kBACA,mBACA,uBACA,CCxLA,ICLI,GAAJ,GDKIG,GAA+B,WACnC,gBACA,SACA,KACA,gBACA,qBACA,QACA,EACA,sBAEA,OADA,GAEA,GACA,2BACA,kBACA,4BAEA,KACA,sEACA,OAIA,iBAEA,aACA,SAKA,SAEA,EACA,iBACA,YACA,EACA,kBAEA,IADA,YACA,gBACA,iBAKA,OAHA,QACA,MAEA,CACA,EACA,iBACA,KACA,IACA,EACA,sBACA,iBACA,EACA,4BACA,eACA,SAOA,OANA,wBACA,aACA,IACA,MACA,aACA,mBAEA,CACA,WACA,EACA,4BACA,iBACA,OACA,QACA,gCAIA,OAHA,wBACA,QACA,IACA,CACA,CACA,GACA,qBA4BA,CAzGmC,GA6G/BC,GAAgC,SAApC,GAEA,gBACA,6BASA,OARA,0BACA,kBACA,OACA,EACA,kBAEA,CACA,IACA,CACA,QAZA,0BAoBA,CArBoC,CAqBlCD,IAEEE,GAAgB,CAApB,6BAIIC,GAAyC,SAA7C,GAEA,gBACA,6BACA,KAEA,8BAEA,uDACA,gBA0KA,OAzKA,0BACA,eACA,WACA,EA4HA,WACA,SACA,IAWA,OAVA,yBACA,WAGA,GAFA,WAEA,GACA,IACA,IADA,SAEA,UACA,CACA,IACA,CACA,CACA,UACA,2IACA,CACA,QACA,CA/IA,GACA,WACA,mBAsEA,gBACA,SACA,KASA,OARA,wBACA,aACA,KACA,yBACA,uCACA,QAEA,IACA,CACA,CACA,cACA,QAEA,SADA,cAEA,CACA,cACA,IACA,aACA,MACA,2BAKA,IAJA,cAEA,wBAEA,gBACA,QAEA,CACA,CACA,UACA,4EACA,CACA,QACA,CACA,gBACA,QACA,IACA,cACA,kBACA,QACA,CACA,SAGA,qBACA,+FACA,CACA,CAuBA,cACA,IACA,WACA,KAUA,OATA,wBACA,OACA,OACA,OAEA,QACA,IAEA,QACA,CACA,CACA,SAEA,CACA,QACA,CAhKA,cACA,aAEA,YACA,WACA,kBACA,eAEA,KACA,2DACA,OAIA,iBAEA,aACA,UAKA,SACA,mBACA,EACA,iBACA,QACA,kBACA,YACA,IACA,EACA,kBACA,+BACA,eACA,0CACA,YACA,aAGA,kEACA,aAEA,WAEA,EACA,kBACA,eACA,SACA,UACA,EACA,4BACA,MACA,wBACA,oBACA,OACA,QAEA,QACA,+BAQA,OAPA,wBACA,QACA,IACA,GAEA,SAEA,CACA,CA8FA,IACA,CACA,CAiBA,MAOA,OA3MA,aAqMA,IACA,eACA,mCACA,4CAEA,sBACA,CACA,CA7M6C,CA6M3CH,IEvVEI,GAA2B,WAC/B,eACA,2BAcA,gBACA,6BACA,KACA,MAEA,OADA,sFACA,EAEA,QAEA,OADA,mFACA,EAEA,sBAEA,sBACA,uBAEA,oBACA,uBAEA,cACA,uBAEA,gBACA,aAEA,EACA,uGACA,KAEA,kBACA,GACA,CACA,UAEA,8EACA,CACA,CACA,QACA,CAmCA,OAlCA,SACA,yCACA,6BACA,yBACA,MACA,gBACA,+BACA,aAIA,OACA,kBAgBA,KAZA,EAHA,EACA,EAEA,UAIA,UAKA,QAIA,OAEA,OAvBA,wHAwBA,WACA,KACA,CACA,CACA,gBACA,MACA,KACA,gBAGA,CACA,KACA,yBACA,IACA,IADA,KACA,aACA,QACA,CACA,MATA,qHAWA,QACA,CACA,kBACA,MAoCA,OAnCA,IACA,MACA,0BACA,qBACA,MACA,iBAEA,SACA,YAEA,MAIA,aAHA,sDAMA,gBACA,cACA,sBAEA,YACA,gBAEA,CACA,oBACA,MACA,MAGA,iDACA,yBAEA,KAEA,CACA,CA5IA,wBACA,kBACA,IACA,wBACA,CACA,UAEA,8EACA,CACA,CAoIA,GACA,qBASA,CA7J+B,GCE3BC,GAAuC,WAC3C,aACA,CAwBA,OAvBA,yCAEA,YADA,oCAEA,EACA,oCACA,UACA,SAEA,WAZuB,GAavB,WAIA,IADA,WACA,gBACA,2BAGA,KAEA,kBACA,EAEA,2BACA,CACA,CA3B2C,GCAvCC,GACJ,WACA,IACA,SACA,SAFA,KAGA,6BAkBA,OAhBA,uBACA,oCAEA,iCACA,kCAEA,4BACA,yCAEA,sDACA,6CAIA,iBAGA,CACA,ECxBIC,GAAuB,WAC3B,gBAEA,8BACA,yBACA,cACA,wLACA,OAEA,WACA,kCACA,CAiBA,OAbA,oCACA,eAEA,yBAGA,qBAIA,kDAEA,EACA,CACA,CA7B2B,GJKvBC,QAAkBtR,EAGtB,SAASuR,GAAiBC,GAC1B,IACA,qBACA,CACA,SAEA,CACA,WACA,CAIA,IAAIC,IAAkC,EAAtC,aAEA,qCAEA,gBACA,yBACA,cACA,gCACA,qBACA,+BACA,qBACA,qBACA,0BACA,mBACA,mBACA,UACA,iBACA,iCAWA,YACA,4BACA,GAbA,KACA,UACA,uBACA,wBACA,UACA,0BAzBA,SAAsBC,GACtB,oBACA,EAuBA,MACA,mBACA,iBACA,iBACA,kCACA,KAIA,IAAIC,KAAuBtb,GAAK,CAAC,GACjC,gBACA,gBFmOA,gBACA,QACA,oBACA,sBACA,gBACA,gBACA,eACA,aACA,QAEA,wBACA,mBACA,uBACA,EE/OA,gBF6JA,gBAGA,MAFA,QAGA,aACA,cACA,kBACA,qBAIA,kBACA,sBACA,mBACA,YANA,mBACA,WAOA,IAEA,EAFA,UAGA,4BACA,mBAEA,cACA,QACA,QACA,YACA,YAcA,IAZA,qBACA,oBAGA,uBACA,wBAGA,yBACA,mCAGA,iBACA,aACA,0BACA,MACA,GACA,CACA,eACA,aACA,QAEA,4BACA,mBACA,uBACA,EEjNA,gBFkNA,gBACA,QACA,YACA,QACA,eACA,YACA,YACA,eACA,aACA,QAEA,iCACA,mBACA,uBACA,EE/NA,gBFgIA,gBACA,QAEA,oBACA,gBACA,eACA,aACA,QAEA,YACA,kCACA,mBACA,uBACA,EE5IA,gBF6IA,gBACA,QACA,YACA,YACA,YACA,eACA,aACA,QAEA,uEACA,mBACA,uBACA,EExJA,gBFkFA,gBACA,QACA,oBACA,gBACA,eACA,aACA,QAEA,YACA,gBAEA,OADA,+CACA,KAEA,uCACA,iGACA,mBACA,uBACA,EElGA,IACIub,GAAuB,SAA3B,GAEA,aACA,IAIA,EACA,EAEA,EACA,EACA,EACA,EACA,EAXA,qBACA,gBACA,mBAUA,IACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EA3BA,IA2+BA,OA/8BA,0BAqXA,gBACA,YACA,2BAIA,CACA,YACA,wBACA,EACA,WAGA,oBAEA,MAZA,IACA,UAYA,CAgDA,kBACA,kBACA,4DAEA,CA8CA,cACA,IACA,MACA,IACA,EADA,EACA,WACA,gBACA,EAEA,IACA,CACA,CACA,SAEA,CACA,WACA,CACA,gBACA,WAKA,EAKA,oBACA,2EACA,IAEA,QAEA,mBAGA,OAgFA,EA3EA,EA4EA,0BAtEA,qBAEA,IANA,8FACA,KAPA,kDACA,KAfA,kDACA,IA4FA,KAlEA,CACA,gBAGA,gBACA,+BACA,MAIA,SAkBA,GAhBA,oBACA,gCACA,IACA,eACA,MACA,qDAEA,CACA,UAGA,iIACA,CACA,WACA,YAEA,EAGA,QAtBA,MAFA,0DAyBA,CACA,cACA,MA5pBgB,GA6pBhB,UACA,IACA,aACA,OACA,IACA,UAEA,IACA,iBAEA,CACA,SAEA,CACA,QACA,CACA,cACA,MA9qBgB,GAkrBhB,OAHA,WACA,uBAEA,CACA,CACA,cACA,WACA,OACA,YACA,OACA,UAEA,CAcA,yBACA,cACA,IAGA,OACA,gBACA,aAGA,GACA,iBAEA,KAXA,gBACA,OAbA,kBAGA,WACA,sBAGA,aAEA,CAIA,SACA,IASA,IAEA,IACA,CACA,cACA,0BACA,6BACA,OASA,MARA,CACA,OACA,YACA,UACA,iBACA,yBACA,aAGA,CACA,WACA,CACA,cACA,IACA,YAIA,OAHA,QACA,gBAEA,CACA,CACA,SAEA,CACA,WACA,CACA,eACA,gBACA,0BACA,kBACA,mBAEA,EAGA,CACA,yBACA,WAOA,GANA,WACA,UACA,UACA,mBAGA,uBAGA,iCACA,MAEA,YADA,WAIA,qBAEA,OAEA,KADA,KAEA,2JACA,CACA,MACA,EACA,UACA,OACA,wCACA,4CAGA,UAEA,MAIA,MACA,SACA,IACA,SAEA,MACA,WAGA,aAIA,IACA,WAGA,CACA,eAEA,mBAKA,qBACA,QACA,MACA,GACA,GAIA,CACA,iBACA,MAOA,SADA,iBACA,KALA,OAOA,CA6BA,eACA,IACA,YACA,qBAEA,CACA,SAEA,CACA,WACA,CACA,iBACA,WACA,iBAEA,IADA,YACA,gBACA,iBAgBA,OAdA,wBACA,GAl4BqC,KAm4BrC,KAEA,WAEA,KAIA,KACA,6FAGA,EADA,iBACA,IACA,CACA,WACA,CAKA,iBAEA,QADA,aACA,cAGA,YACA,SACA,IACA,gCACA,WACA,eACA,QACA,QACA,EASA,YACA,IACA,EADA,KAEA,QACA,QAEA,CACA,0BAEA,iCACA,KACA,gCACA,CAEA,wBAEA,GACA,CAxBA,IACA,IAZA,CAaA,CA0BA,cACA,WACA,qCACA,iBACA,wBACA,OACA,gBACA,KACA,CACA,CACA,cACA,cACA,OACA,MACA,CAKA,eAEA,mBAGA,SAGA,SACA,SACA,SACA,SACA,SACA,QAVA,sBAWA,CAmCA,cACA,WACA,WACA,cACA,eACA,KACA,OACA,IACA,OAEA,KACA,OACA,OACA,IACA,IACA,OACA,OACA,OACA,OACA,IACA,KACA,OACA,KACA,OACA,KACA,KACA,OACA,KACA,KACA,KACA,KACA,OACA,OACA,QACA,4BACA,aACA,qBACA,GAEA,CA58BA,KACA,mBACA,KACA,IACA,EACA,oBACA,IACA,KACA,OAEA,KACA,KAEA,EACA,wBAEA,QADA,eACA,GAEA,KACA,IACA,yBACA,CACA,UACA,4GACA,CACA,CACA,EACA,2BACA,MACA,QACA,IACA,qBACA,CACA,UACA,iJACA,MAGA,WAGA,EACA,0BACA,MACA,EACA,wBACA,oBACA,sDAEA,eACA,mBACA,mBACA,IACA,OAEA,WACA,IACA,cACA,0DACA,EXjKA,YACA,kBACA,cACA,KACA,KAGA,KACA,mCACA,KAGA,QAGA,MACA,oCACA,IAIA,GAHA,iBACA,MAEA,GAEA,gBACA,YACA,OACA,KAGA,CACA,CACA,SAEA,IACA,CACA,cACA,SAOA,OANA,IACA,uBAEA,oBAGA,CACA,CAIA,aACA,mBAIA,CACA,aAEA,UACA,QACA,KAEA,wBACA,OACA,WACA,SACA,UAEA,IACA,IACA,CACA,SAEA,CACA,IAEA,CAKA,aACA,IACA,GACA,CACA,aACA,IACA,GACA,CA8BA,OACA,SAxEA,WACA,QACA,EAuEA,iCACA,OAhCA,WACA,kBACA,SAEA,GADA,QACA,GAEA,iBACA,sBACA,OAEA,CACA,IACA,CACA,EAoBA,YAnBA,YAGA,OAFA,UAEA,CACA,cACA,mBACA,YACA,mBAGA,CAEA,EAEA,EAMA,eA9CA,YACA,IACA,GACA,EA6CA,CWsCA,IAEA,mCACA,YACA,iBACA,mBAEA,IAEA,GAFA,mBAEA,gBACA,QAKA,aACA,YAEA,WAEA,QAEA,EACA,kBAEA,cAEA,4BACA,aACA,QACA,IAIA,YAIA,WAGA,8BAGA,UAEA,8BAEA,WAEA,eAEA,+BACA,WACA,IAEA,QACA,wCACA,0BACA,0BACA,QACA,iBACA,eACA,YACA,cACA,QACA,eAGA,SACA,UACA,SACA,UAMA,KACA,IACA,4BACA,CACA,UACA,+IACA,CAEA,IACA,MAEA,QACA,wBAEA,IACA,IACA,IACA,wBACA,UACA,yCACA,SACA,aA6vBA,cACA,4CAEA,KADA,eAEA,SAIA,OADA,WADA,kEAEA,OACA,CAtwBA,QACA,kDAEA,SACA,iCACA,wBACA,6BACA,IAGA,OAEA,sBACA,MA0NA,WACA,IAoCA,MATA,CACA,oBACA,WACA,sBACA,aACA,iBACA,qBACA,yBAjCA,CACA,8BACA,WACA,KAGA,aACA,EACA,kCACA,WACA,KAGA,oDACA,EACA,8BACA,WACA,KAGA,mBACA,EACA,8BACA,OAoVA,gBACA,QACA,kBACA,KAqBA,YACA,oGAtBA,CAGA,IADA,SACA,iBACA,WACA,MAEA,EADA,KACA,GAKA,sBAHA,QAKA,CACA,UACA,YACA,gGAEA,CAKA,CA/WA,OACA,GAYA,CACA,SAEA,CACA,WACA,CArQA,GAEA,EAKA,gBAJA,UACA,SAKA,wBACA,OACA,OAGA,kCACA,kBACA,8BACA,gBACA,gBACA,EACA,gBACA,mBACA,EACA,eACA,oBACA,eACA,EACA,IAEA,MAEA,0CACA,IAEA,2CAEA,kBACA,YACA,gCACA,gBACA,eACA,GAEA,IACA,KAEA,qBACA,yBACA,oBACA,oBACA,IACA,EACA,iCAEA,OADA,mBACA,MACA,IAEA,IADA,OAEA,OAEA,aACA,MACA,OAGA,qBAEA,QACA,MACA,OACA,OACA,OAGA,SAEA,IACA,CACA,UACA,oIACA,CAEA,kBACA,EACA,8BACA,oCACA,EACA,gCACA,QACA,EAIA,uCAEA,UAGA,eACA,EAMA,sBAEA,MACA,QAFA,eAEA,EACA,IACA,YAEA,KAgBA,YAhBA,CACA,cACA,oBA+mBA,cACA,MATA,WACA,qBACA,aACA,mBAGA,kCACA,CAEA,GACA,0BACA,IACA,wBACA,CACA,UACA,+FACA,CAEA,CAxnBA,SAGA,EADA,EACA,cAGA,UAEA,EAEA,QACA,CAIA,IACA,CACA,SAEA,oBACA,UACA,yHAEA,CAEA,QACA,EACA,+BACA,OACA,kBACA,QACA,EACA,gBACA,YACA,QACA,0BACA,YACA,EAEA,EACA,4BACA,kBACA,SACA,IACA,EAIA,sBAEA,UAGA,OAyGA,eACA,8DACA,2BACA,CA5GA,KACA,EAIA,oBAEA,UAGA,OAsGA,cAKA,IAJA,SACA,KAEA,qBACA,wBACA,WACA,yBACA,iBACA,SAIA,QAEA,CACA,SACA,eAEA,SACA,iFAEA,UACA,OACA,oDACA,yBACA,yDAEA,CAlIA,KACA,EAIA,oBAEA,UAGA,OA4HA,YACA,2BACA,CA9HA,GAEA,EAIA,2BAEA,UAGA,aACA,CA0lBA,IACA,CACA,CAsJA,OAhpCA,aA2/BA,sCACA,MAQA,OAHA,EAJA,yBAIA,GAHA,kCAKA,oBACA,MACA,EA2IA,CACA,CAlpC2B,CAkpCzBxb,GAAF,GK7sCA,eACA,MACA,SAEA,WANwB,KAOxB,6BACA,WAPiC,KAQjC,aACA,gBACA,OACA,MACA,CACA,QACA,OACA,sBAEA,qBAEA,mCACA,8CACA,CAEA,eACA,qBACA,sBAEA,CACA,QACA,CACA,cC/BIyb,GACJ,cACA,IACA,EACA,EACA,EACA,EACA,EACA,EACA,EAPA,OAQA,KACA,KAgGA,oBACA,MACA,MA6NA,YACA,IACA,WACA,0CACA,CACA,SAEA,CACA,QACA,CAtOA,IACA,MACA,OAEA,WACA,OACA,WACA,KACA,IACA,OACA,IACA,OACA,0CACA,OACA,KACA,QACA,gBAGA,OACA,SAEA,WACA,SACA,oBACA,UAEA,CACA,SAEA,CACA,OACA,cACA,cAEA,CAWA,OATA,GACA,KACA,MACA,QACA,UACA,aAIA,IACA,CAkBA,cACA,mBACA,CACA,gBACA,QAoBA,EAEA,EACA,EAtBA,IACA,YACA,KACA,wBACA,qBACA,sEACA,YAeA,UADA,GADA,EAbA,IAcA,UACA,6BACA,gCAEA,4BACA,kBACA,IAEA,mBACA,OAGA,GAEA,6CACA,yCACA,2CA7BA,OACA,yEAEA,0EAEA,UACA,MACA,CACA,SAEA,CACA,CAsBA,kBACA,mCACA,UACA,SACA,aACA,IACA,mCACA,iFACA,wBACA,CACA,QACA,KACA,uCAEA,iCACA,iDACA,sBACA,CACA,iBACA,CACA,QACA,CACA,gBACA,uBACA,SApP8B,sBAqP9B,QAEA,IACA,CA2CA,cAEA,IACA,MAQA,gBAPA,kBAEA,uBACA,QAMA,CACA,SAEA,CACA,WACA,CACA,kBACA,IACA,mCACA,CACA,SAEA,CACA,QACA,CACA,kBACA,YACA,EAGA,wCACA,CACA,qBACA,mBACA,CAaA,cACA,IACA,WACA,OACA,aACA,EAjFA,gBACA,IACA,OACA,SACA,SAEA,MACA,oBAMA,MALA,CACA,uBACA,iBACA,+CAGA,CAGA,OADA,SACA,CAEA,CACA,SAEA,CACA,WACA,CAyDA,aACA,MACA,CACA,WACA,CACA,SAEA,CACA,WACA,CACA,cACA,WACA,iBACA,KACA,WACA,IACA,EAhHA,YACA,IACA,MACA,eACA,gDACA,mCACA,eACA,CACA,CACA,SAEA,CACA,QACA,CAmGA,QAEA,MACA,CACA,WACA,CACA,cAKA,OAJA,SACA,iBACA,SAEA,IACA,CAvNA,cACA,KACA,KACA,KACA,KACA,OACA,mBACA,+CACA,YACA,MACA,4BACA,0BACA,gBACA,GACA,KA9JA,+BACA,SACA,EACA,uBACA,QACA,EAOA,0BACA,WAEA,SADA,KACA,IACA,EAMA,0BACA,WACA,EAOA,qBACA,QACA,EAKA,oBACA,IACA,WACA,cACA,iBAKA,OAJA,SACA,wBACA,6BACA,KACA,CACA,CACA,CACA,SAEA,CACA,QACA,EAKA,sBACA,IACA,MACA,SAKA,OAJA,wBACA,2BACA,MACA,IACA,CACA,CACA,CACA,SAEA,CACA,QACA,EAQA,6BAGA,YAFA,eACA,sBACA,EACA,aAEA,IACA,EACA,8BACA,kBACA,CA4QA,aCnXI,GAAJ,CACA,oBAEA,SAASC,GAAuBC,GAChC,SACA,WACA,SACA,yBAEA,sBACA,GACA,CAGA,SAASC,GAAcC,EAAWzc,EAAMuc,EAAoBG,IAC5D,wBACA,UACA,GAEA,aACA,KACA,QAEA,6BAIA,gBAGA,GACA,CAIA,IAAIC,GAAoC,WACxC,cAEA,MACA,EAFA,kBAGA,SACA,GACA,OACA,OAEA,iBACA,wBACA,yBACA,KACA,4BACA,wBACA,yBAEA,qBACA,WACA,EAKA,qBAEA,IADA,qBACA,MACA,cACA,gBAEA,EAKA,qBACA,0BACA,WACA,GACA,EAOA,uBACA,0BACA,aACA,GACA,EAMA,uBACA,iCACA,aACA,GACA,EACA,qBACA,KAEA,eACA,6BACA,WACA,6CAGA,WAEA,IAGA,EACA,qBACA,aACA,0BACA,WACA,GAEA,EACA,qBACA,aACA,0BACA,WACA,GAEA,EACA,uBACA,QACA,WACA,0BACA,aACA,GACA,CACA,EACA,qBACA,IASA,EATA,aACA,UACA,OACA,KAEA,kBACA,SACA,OACA,EAWA,GATA,gCACA,kBACA,IACA,IACA,MAEA,YAEA,IACA,EACA,uBACA,4BACA,IACA,GACA,GACA,IAGA,GAEA,CACA,GACA,qBAkFA,CAtNwC,yBCMxC,IC9CI,GD8CAC,GAA2C,SAA/C,GAEA,aACA,IAIA,EACA,EALA,qBAoBA,aACA,IACA,IACA,CACA,OAvBA,0CACA,eAIA,KACA,0BACA,sCACA,OAnDA,SAAyBC,EAAe1iB,EAAI2iB,GAC5C,OACA,KACA,MAaA,OAXA,cACA,CACA,mBACA,0BACA,eAEA,OADA,eACA,CAEA,GACA,EAGA,CAkCA,SACA,EACA,wBAnCA,SAA0BD,EAAe9hB,EAAMsF,GAG/C,IAFA,SACA,WACA,aACA,WACA,KACA,IACA,+BACA,KACA,KACA,CACA,CACA,UAGA,wFACA,CAEA,CACA,QACA,EAgBA,+BACA,aAEA,EACA,oBACA,GACA,CACA,IAKA,CACA,QA3BA,0BAyCA,CA1C+C,CA0C7CO,GAAF,wBCjEImc,GAAqB,yCAErBC,GAAuB,4BAUvBC,IAAgB,EAApB,aACA,eAEA,+BACA,kCACA,wBACA,gBACA,yBACA,+BACA,KAMA,SAASC,GAAmBxW,EAAMyW,GAClC,mBACA,CAuCA,SAASC,GAAiBC,EAAWC,GACrC,SAOA,OANA,wBACA,SAEA,OADA,MACA,CAEA,IACA,CACA,CACA,SAASC,GAAiBjR,EAASxP,EAAQ0gB,EAAWC,GAEtD,IACA,0BACA,IACA,8BAEA,eAGA,iCAEA,eAIA,YAEA,GAEA,CACA,SAASC,GAAajB,EAAWkB,GACjC,WACA,KAQA,OAPA,0BACA,WAGA,OAFA,IACA,KACA,CAEA,IACA,SACA,CAwDA,IAAIC,GAAgC,WACpC,aAEA,MACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EAKA,EACA,EACA,GACA,2BAkRA,aACA,MACA,aACA,eACA,yDAGA,YAEA,GACA,CACA,aACA,IACA,iBACA,qBAEA,CACA,cACA,iBACA,0BAEA,IACA,KAGA,wBACA,kCACA,SACA,OAEA,SACA,IAEA,WACA,aAGA,kBACA,QAEA,UACA,MAEA,aAGA,QACA,CA6KA,aACA,SACA,KACA,kBACA,IACA,wBACA,wCACA,2BACA,YACA,iBACA,CACA,GAEA,EACA,KACA,IACA,wBACA,IACA,IAEA,IACA,CACA,aACA,MAEA,4BAEA,cAEA,qBACA,2BACA,cACA,iBACA,KAEA,qCACA,aAIA,OAHA,GACA,IAEA,CACA,KAEA,kCACA,aAOA,OANA,IACA,GACA,IAEA,eAEA,QACA,KAEA,qBACA,aAKA,OAJA,IACA,kBACA,YAEA,CACA,EACA,cACA,WACA,QACA,SACA,IAEA,IAEA,yBACA,KACA,0BACA,sBACA,cACA,SACA,KACA,SACA,OACA,OACA,OACA,SACA,OACA,OACA,KACA,OACA,OACA,KACA,OACA,4BACA,aACA,OACA,OACA,aACA,KACA,OACA,OACA,KACA,OACA,KACA,IACA,OACA,OACA,IAEA,CACA,aACA,6BAEA,OADA,YACA,CACA,CAEA,cAEA,MA/wBA,SAA6Bvd,EAAQwd,EAAiBC,GAEtD,SACA,KAGA,KA2BA,OAzBA,0BAEA,oCACA,YAEA,eACA,WACA,QACA,eAKA,QAJA,uEAQA,OAEA,YAGA,WAEA,IACA,CACA,OACA,WAEA,CA0uBA,UzDr0BA,IyDq0BA,GACA,OACA,OACA,OAEA,iBAEA,mCAEA,uCAEA,eAIA,0BACA,sBACA,cACA,UAEA,gBACA,yBAGA,cACA,GACA,IAEA,CACA,cACA,WACA,OACA,KAgDA,OA/CA,wBACA,uBAEA,OADA,KACA,EAEA,cACA,WAEA,KACA,gBACA,wBAEA,KADA,mBAEA,QAEA,IAEA,IACA,GACA,SACA,wBACA,qBACA,EACA,qBACA,mBACA,0BACA,EACA,0BACA,cACA,UAKA,IAJA,CACA,SACA,YAEA,YACA,GAEA,GACA,UACA,YAGA,OACA,GACA,IAGA,CACA,CACA,aACA,OAEA,uBAEA,oBACA,YAEA,iCACA,CACA,QACA,CACA,kBACA,kBACA,2BACA,iBACA,qBACA,SAEA,MACA,0BACA,QAIA,KAHA,WAKA,IACA,IACA,OACA,OAEA,SACA,KACA,0BACA,UACA,wBACA,QAIA,KAHA,WAKA,IACA,WACA,IACA,KAEA,QACA,GACA,IACA,WACA,MAEA,KAEA,CACA,aACA,eACA,uBACA,kBACA,wBACA,OACA,uCACA,OACA,wBACA,uBACA,6BAEA,UACA,GACA,CACA,CACA,oBAEA,QACA,KACA,OAEA,aACA,IACA,WACA,cACA,OACA,QACA,OAEA,EATA,SAUA,gBACA,cACA,qBACA,YACA,IACA,SAEA,sBACA,KACA,GACA,OACA,IAIA,WACA,wBACA,OACA,GACA,MAGA,IAIA,CACA,IAIA,OAFA,KACA,KACA,CACA,CAmCA,cACA,uBACA,YACA,wCACA,WAEA,CACA,cACA,eACA,IAEA,kBACA,MAGA,UAEA,CACA,cACA,iBACA,GACA,eAEA,CACA,cACA,QACA,CAr2BA,IAEA,+BACA,WACA,EACA,8BAEA,oCAGA,+BACA,GACA,EAEA,2BA2xBA,IAEA,EA5xBA,IACA,YAGA,aACA,qDAEA,gCAEA,QAEA,wBACA,YAEA,KADA,OACA,CAIA,uBA5OuB,IA8OvB,2BACA,gBACA,iBACA,OAEA,cACA,2CACA,IAKA,mBACA,MAJA,UAOA,KAdA,CAeA,I1BpI+EnG,EAAUM,E0BoIzF,KAkBA,IAjBA,aACA,YACA,QAIA,KAEA,aACA,YACA,QAIA,IAGA,UAEA,KACA,IACA,4CApRqB,IAqRrB,G1B3J+EN,E0B2J/E,G1B1JKY,KAA2BA,GAAyBV,GAAyBW,KACvED,GAAuB/B,EAAEmB,EAAOM,K0B0J3C,qBAKA,GACA,GAEA,MACA,kBACA,IACA,KAGA,OAEA,gBACA,eACA,gBAEA,WAGA,GAFA,cAEA,YACA,WACA,aACA,CACA,CACA,IAEA,uBACA,gBAEA,CAIA,GACA,CACA,SACA,GACA,GAEA,CACA,GACA,MAGA,IAMA,0BACA,wBACA,UACA,GAlFA,CAnBA,CAsGA,KAGA,EA9MA,SAA4B1X,EAAewd,EAAiBC,EAAqBC,GAcjF,OAZA,4BACA,2BACA,WAEA,YACA,QAEA,gBACA,kBACA,YAEA,KACA,CACA,CA+LA,MAFA,MAEA,cAoqBA,wBAEA,GADA,oBACA,CACA,mBAGA,WACA,IACA,OAGA,uBACA,IAEA,QAGA,sBAEA,kBAEA,MAGA,OAEA,MAEA,KA9rBA,WACA,eASA,IAPA,MACA,iDACA,WACA,QACA,kBACA,kCAEA,eACA,uCACA,cACA,qCAEA,EA1OA,SAAqC7b,EAAQqa,EAAWpc,IACxD,wBACA,+BACA,IAEA,gBACA,MACA,CACA,GACA,CAkOA,QACA,OACA,KACA,eACA,GAEA,EACA,yBACA,SAMA,OALA,IACA,wBACA,WACA,KAEA,WACA,EACA,qBACA,4EACA,WACA,MAEA,oCAGA,gCACA,MACA,oCAGA,iBAEA,kCAEA,oBACA,6BAEA,cAEA,iBAEA,aAEA,WAGA,wCACA,EACA,WACA,oBAMA,OALA,IACA,gBAEA,0BAEA,CACA,EAOA,qBACA,0BACA,EAKA,qBACA,GACA,WAEA,EACA,0BAIA,OAHA,IACA,6BAEA,CACA,EACA,2BACA,QACA,SACA,IAEA,EACA,oBACA,wBACA,EACA,yBACA,GACA,EACA,sBACA,eACA,EACA,0BACA,kBACA,QACA,KACA,OACA,wBACA,iBACA,aACA,KAIA,gDAEA,CACA,EACA,+BAIA,OAHA,UACA,KACA,cACA,KACA,EAiDA,oBACA,KACA,cACA,GACA,GAEA,8DACA,8BACA,cACA,IAEA,QAvhB2B,0BA0hB3B,IAEA,YAEA,IAKA,EALA,GACA,UACA,UACA,kBAGA,QACA,kBAEA,GACA,KAEA,uBASA,cACA,kBACA,KAEA,WAEA,WAEA,WACA,CAKA,OAtBA,qBACA,gBAEA,yBACA,IACA,OACA,GACA,MAWA,IACA,YACA,MAEA,CACA,EACA,WACA,8BACA,MAGA,OAFA,cACA,MAGA,kBACA,SAGA,OAFA,cACA,8CAGA,OACA,WAEA,cACA,YACA,YAEA,KACA,QACA,CACA,MACA,iBAKA,IAJA,CACA,SACA,cAEA,YACA,GAKA,YACA,aACA,KALA,QAOA,GACA,MAEA,GAEA,EACA,0BAEA,MACA,QAFA,cAEA,YACA,GACA,SACA,UACA,2BACA,0BACA,SAEA,cACA,YAIA,kBACA,iBACA,CAGA,sBAEA,YACA,YACA,IAEA,yBACA,eAEA,gBAEA,IAGA,aACA,OAEA,WACA,GACA,IAEA,EACA,0BACA,QACA,EACA,UACA,0BAIA,OAHA,IACA,eAEA,CACA,EACA,0BACA,SACA,EACA,mBAEA,sDACA,0BACA,MAhkBgCoc,EAAWkB,EAC3C,EAskBA,OANA,EAIA,+BApkBA,KADgClB,EAkkBhC,EAlkB2CkB,EAkkB3C,GAjkBA,KAEA,GACA,IACA,cACA,eACA,SACA,eAEA,GAEA,aAsjBA,EApjBA,GA8BA,SAA2BO,GAC3B,iBACA,cACA,MACA,GACA,4EACA,CAqhBA,GACA,EACA,uBACA,0CACA,CA2XA,GACA,qBA2NA,CA3mCoC,G5EzLpC,cACA,gBQCA,gBACA,YACA,aACA,YACA,gBACA,aACA,aACA,cACA,UACA,+BACA,oBACA,aACA,oBACA,sBACA,iCACA,eACA,iBACA,iCACA,+BACA,4BACA,yBACA,4CACA,yBACA,yBACA,0BACA,kCACA,YACA,gBACA,eACA,qBACA,gBACA,mBACA,YACA,qBACA,yBACA,kBACA,0BACA,qBACA,2BACA,mBACA,cACA,gBACA,4BACA,wBACA,uBACA,mBqE7CA,SAASC,GAAkBC,EAAeC,EAAOC,GACjD,QACA,OACA,OAIA,OAHA,OACA,WAEA,CACA,CAEA,SAASC,GAAiBhH,EAAOvX,EAAMoe,EAAeC,EAAOC,GAC7D,QACA,YAIA,OAHA,IACA,iBAEA,CACA,CAEA,SAASE,GAAcjH,EAAOvX,EAAMV,GACpC,iBACA,IACA,WACA,eACA,KACA,KAEA,QACA,CAyGA,IC5II,GD4IAmf,GACJ,WACA,WACA,cACA,0BACA,cACA,eAEA,QACA,EAIIC,GAA2B,WAC/B,oBACA,WACA,IAIA,WACA,eACA,0BACA,WACA,iCACA,wBACA,WACA,QACA,eACA,WACA,gBACA,WACA,WACA,WACA,2BACA,WACA,4BACA,eACA,4BACA,kBACA,QACA,QACA,uCAEA,MADA,EACA,CACA,gBACA,qBACA,oBAIA,MAEA,wBACA,4BACA,c/CvKA,E+CuKA,O/CrKA,WAEA,UAEA,G+CiKA,K/CvKA,MACA,EACA,C+CsKA,EACA,yBACA,mB/C1JA,E+C0JA,M/C1JA,E+C0JA,M/CzJA,EACA,sBAEA,I+CsJA,K/C1JA,O+C2JA,EACA,sBACA,MAGA,GADA,mFACA,QACA,YAEA,WACA,uBACA,eACA,qBACA,OACA,eACA,eACA,gCACA,sBAEA,uBACA,GACA,QAgBA,GAfA,QACA,UAEA,QAEA,eACA,sBA7LA,SAA2BC,EAAUC,GAqBrC,YACA,YACA,IACA,SACA,UACA,QACA,iBACA,YACA,aACA,YACA,aACA,cACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,iBACA,oBACA,oBACA,iBACA,MAEA,iBAEA,iBAEA,iBAEA,iBAEA,iBAEA,gCAEA,6BAEA,YACA,IACA,gBAEA,cACA,uBACA,WACA,MACA,UACA,0BACA,2BACA,YACA,2BACA,qCACA,OACA,eAEA,kBAEA,QAGA,IACA,MACA,IACA,YACA,CACA,gBACA,gBACA,eACA,MAEA,QACA,mCAGA,IACA,QAEA,CA0FA,MACA,IACA,mCACA,aAGA,GACA,UACA,MAEA,YASA,GARA,IACA,wBAEA,QACA,8BACA,yBAGA,MACA,eACA,aACA,qBACA,gEAEA,aACA,uEAEA,MACA,YACA,yBAGA,CACA,CACA,QACA,EACA,iBACA,WACA,QACA,6BAEA,OADA,MACA,KACA,kBACA,oBAEA,kBACA,YAEA,CACA,QACA,CACA,GACA,qBAkBA,CAnJ+B,GC/I/B,IAAIC,GAAa,UACbC,GAAsB,YACtBC,GAAY,QACZC,GAAe,mCACfC,GAAe,wCACfC,GAAgBD,GAAe,oBAC/BE,GAAiBF,GAAe,iBAChCG,GAA2B,gHAC3BC,GAA+B,iGAC/BC,GAAqC,2CAErCC,GAAa,EA8DjB,IAAIC,GAAe,SAAnB,KACA,oBACA,gBAEA,IACA,EAkBIC,GAAe,SAAnB,KACA,SACA,MACA,qBACA,IACA,wBACA,WAEA,OADA,MACA,CAEA,GAEA,CACA,QACA,EAEA,SAASC,GAAiC1D,EAAK2D,GAC/C,SACA,IACA,cACA,WACA,wBAEA,CACA,SAEA,CACA,QACA,CAEA,SAASC,GAAuBC,EAAqBC,EAAOtf,EAASqa,EAAYkF,IACjF,0BACA,CAEA,SAASC,GAAsBH,EAAqBC,EAAOtf,EAASqa,EAAYkF,IAChF,0BACA,CAEA,SAASE,GAAyBJ,EAAqBK,EAAiB1f,GAExE,mBACA,MACA,iBACA,6BACA,6BACA,GACA,CACA,CACA,SAAS2f,GAAS7gB,EAAO8gB,GACzB,aACA,eAEA,CACA,CACA,SAASC,GAAYC,EAAWnmB,EAAIomB,GACpC,OACA,KACA,MAGA,OADA,UACA,CACA,mBACA,0BACA,eAEA,OADA,eACA,CAEA,GACA,EAEA,CACA,SAASC,GAA4B9Z,EAAM4Z,EAAWhU,EAAS9L,GAC/D,SAWA,OAVA,0BACA,KACA,wBACA,KAEA,CACA,UACA,sGACA,CACA,IACA,CACA,CAsBA,IAAIigB,GAAY,eAChB,cACA,iBACA,sBACA,iBACA,yBAEIC,GAA4B,CAChC,uHAEI,IAAJ,kBACA,QACA,UACA,UACA,cACA,gCACA,4BACA,uCACA,mCACA,2CACA,gBACA,4BACA,UACA,UACA,UACA,UACA,+BACA,UACA,kBACA,gBACA,YACA,oBAEA,4BACA,sBACA,KACIC,GAA4B,SAAhC,GAEA,aACA,IAGA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EAhCA,qBA41BA,OA31BA,0BACA,gBA+BA,0BACA,YAsIA,aACA,kBACA,KACA,KACA,KACA,0BACA,OACA,KACA,KACA,IACA,OACA,KACA,KACA,OACA,KACA,IACA,KACA,KACA,KACA,KACA,OACA,OACA,OACA,IACA,KACA,KACA,uBACA,gBACA,OACA,IACA,IACA,IACA,MACA,CAgCA,cACA,SASA,OARA,QACA,wBACA,qBAEA,OADA,MACA,CAEA,IAEA,CACA,CA6FA,kBACA,E3CldA,gBACA,SACA,oBAEA,IACA,C2C6cA,QACA,CAiFA,kBACA,SACA,+CAYA,IAVA,wBACA,SACA,cACA,iBAEA,IACA,YAEA,IAEA,EACA,SAEA,kBACA,YAkCA,QAjCA,sBACA,MAEA,QAEA,qBAGA,aAIA,cAEA,gIACA,eALA,0BAQA,cACA,MAEA,EAEA,OACA,QAKA,OACA,MAGA,CACA,CAIA,kBACA,SACA,IAKA,OAJA,cACA,yBAGA,GAEA,CACA,CACA,aACA,WAQA,OAPA,2BACA,0BAGA,yBACA,wBAEA,CACA,CA2JA,gBACA,gBACA,kBACA,yBACA,KACA,iBACA,UACA,4BACA,eACA,WAEA,CACA,CACA,CACA,oBACA,YACA,cACA,IACA,IACA,QACA,KACA,aACA,IACA,SACA,IAGA,IAFA,WACA,iBACA,oBACA,WACA,MACA,4BACA,sBACA,sCACA,UAGA,0CAEA,QACA,KACA,CACA,mBAEA,KAEA,CACA,CACA,EACA,GACA,OACA,OACA,aACA,4BAEA,qBAEA,iBAEA,MAMA,aAEA,CACA,SACA,IACA,CACA,CAjDA,EAkDA,CA6CA,cACA,SACA,KACA,cAEA,oBADA,mBACA,EAGA,MAHA,MAMA,CACA,SACA,mFACA,CACA,QACA,CACA,0BAIA,kBACA,YACA,+BACA,IACA,0BAEA,4BACA,CAVA,IAWA,WACA,QACA,mBACA,IACA,EADA,qBAEA,IACA,IACA,qCAEA,CACA,SACA,YACA,CACA,WACA,QACA,6CAEA,cACA,qBACA,MAEA,WACA,sBACA,4BAGA,gBACA,YACA,IACA,CAeA,wBACA,SACA,MACA,IAQA,SAPA,CACA,OACA,aACA,gBACA,qBACA,sBAEA,gBAEA,GACA,YAEA,CAvzBA,IACA,+BA8LA,IACA,EA9LA,oBACA,sBACA,2DAmKA,YACA,8BACA,YACA,0BACA,+BACA,2BACA,QACA,QACA,QACA,QACA,oDACA,sBACA,eACA,eACA,IACA,KAEA,UACA,8BACA,QACA,kBACA,SACA,IACA,CAzLA,IA4SA,WACA,IA1iBA,SAAiCd,EAAqBF,GACtD,MACA,KACA,gBACA,4BACA,mBACA,mBACA,mBACA,kBACA,CACA,kBAIA,GAHA,SACA,MAEA,EAEA,IACA,yBACA,GACA,MACA,QACA,QACA,IAEA,QAEA,iCACA,4BACA,CACA,SAEA,KACA,kFACA,wBAEA,CAEA,QACA,CAogBA,MACA,OAEA,6BACA,UACA,QACA,OAEA,yBACA,KACA,sBACA,OACA,aACA,WACA,oBACA,mCAEA,EA6IA,kBACA,MACA,MACA,0BACA,8BACA,4BACA,cACA,sFAQA,OAPA,iBACA,QACA,QACA,iCACA,SACA,UACA,QACA,CACA,CA7JA,WA8JA,cACA,6DACA,MACA,IACA,6BA6BA,YACA,cAGA,gBACA,YACA,iCACA,IACA,0BAEA,4BACA,CATA,WACA,YASA,iCACA,IACA,iCACA,MACA,OACA,iBACA,iBAEA,IAiEA,YACA,MACA,IACA,cACA,YAEA,QADA,kBAGA,UADA,2BAIA,CACA,SACA,mBACA,YACA,yBACA,GACA,CACA,CAnFA,IACA,sBACA,MAnCA,YACA,IACA,qBACA,sBAEA,YAEA,CACA,SAEA,CACA,WACA,CAuBA,IACA,sBACA,GACA,MACA,cACA,MAGA,oCACA,MACA,wBACA,oBACA,YACA,eACA,OACA,OAEA,IACA,OACA,CACA,CACA,QACA,IACA,SACA,IACA,IACA,0BAEA,CACA,SACA,YACA,CACA,WACA,QACA,6CAEA,cACA,qBACA,MAEA,QACA,sBACA,4BAGA,SAGA,IACA,IACA,GADA,eACA,MACA,OACA,UAEA,CACA,SAEA,CACA,CACA,gBACA,SACA,GACA,CAhHA,GAEA,CACA,SACA,mBAEA,gCACA,0DACA,YACA,cACA,GAEA,CACA,KACA,CA9KA,MAEA,CACA,EACA,+BAGA,yBACA,KACA,kBACA,OACA,aACA,UACA,yCACA,WACA,WACA,yBACA,iCAEA,CACA,EACA,uBAGA,0BACA,KACA,gBACA,OACA,aACA,UACA,0CACA,QACA,kCAEA,CACA,EACA,gCAGA,qCACA,KACA,oBACA,OACA,aACA,UACA,aAljB2B,SAA3B,OACA,MACA,qBACA,GACA,QACA,IACA,KAGA,CACA,CAyiBA,QACA,UACA,YAGA,CACA,EACA,2CAEA,KAEA,IACA,CA1XA,GA6MA,WACA,OA1dA,eACA,IACA,sBACA,6BACA,gBACA,KAEA,OARA,IACA,EA2dA,MACA,OAEA,kBACA,aACA,6BACA,UACA,QACA,KA0DA,QAOA,WACA,KACA,oBAEA,WACA,KAEA,OAvEA,WACA,KAEA,oBACA,MACA,WACA,eAEA,QACA,cACA,EA0cA,cACA,MAQA,EAPA,MACA,0BACA,8BACA,2EACA,iBACA,WACA,QAGA,EADA,sBACA,eAGA,EAEA,WACA,kBACA,YACA,2BAEA,CACA,QACA,YACA,SACA,QAEA,0BACA,SAEA,QACA,SACA,MACA,0DACA,uBACA,OACA,OAEA,GACA,CAGA,OAFA,QACA,QACA,CACA,CArfA,MACA,mBACA,OACA,WAEA,QACA,CACA,EACA,kBACA,OACA,mBACA,IAEA,gCAoBA,OAnBA,kCACA,MACA,OACA,uBACA,iBAEA,IA6hBA,YACA,YACA,IAEA,UADA,iBAEA,CACA,SACA,YACA,6BACA,wBAEA,CAEA,CA1iBA,IACA,GACA,SACA,SACA,iCACA,OACA,OAEA,IACA,OACA,CACA,QACA,IACA,CACA,IACA,mBAEA,MADA,qDACA,CACA,IAEA,CACA,EAEA,qDACA,gBACA,KAkBA,KACA,IAGA,iBAEA,CAtSA,IAyLA,4BAEA,gBAxLA,EACA,yBACA,GACA,EACA,oCACA,mBACA,EACA,wBAEA,8BAEA,GApHA,SAAqClD,EAAW/V,EAAMiY,EAAU3C,EAAKrE,EAAOiJ,GAE5E,GADA,MACA,GACA,OACA,OACA,MACA,QACA,OACA,cACA,aACA,iBACA,kBACA,iBAEA,qBACA,gBACA,eACA,YACA,WACA,CACA,CA+FA,kBACA,WACA,oBACA,IACA,MAKA,0DACA,MACA,0BACA,eACA,IACA,eAEA,CAQA,IAPA,qBAEA,qBACA,IACA,uBAGA,GACA,aACA,cACA,KAEA,0CACA,eACA,IACA,eAEA,CACA,OACA,CACA,QACA,CACA,MACA,oBACA,KACA,eAQA,wFARA,CACA,sBACA,eACA,IACA,eAEA,CAKA,MAYA,IAZA,qBAEA,YAOA,qFANA,qBACA,IACA,wBAOA,GACA,QAIA,IAHA,cACA,KAEA,YAQA,wFARA,CACA,sCACA,eACA,IACA,eAEA,CAIA,CACA,CACA,QACA,CAEA,EACA,sBACA,gBAIA,OACA,OACA,gDACA,YAEA,kBACA,gBAEA,oDACA,cACA,MACA,OACA,wMAEA,CACA,EACA,oCACA,kBACA,EACA,uCACA,kBACA,CAorBA,IACA,CACA,CA+CA,OA94BA,aAm2BA,2CACA,qBACA,EA4BA,iDACA,WACA,EAEA,oCASA,CACA,CAh5BgC,CAg5BhC,MCxoCIC,GACJ,WACA,ECFIC,GAIJ,WAEA,kBAGA,0BACA,ECRIC,GAIJ,cACA,WACA,yBACA,qBACA,4CACA,IACA,WACA,ECbIC,GACJ,WACA,E1EKA,aACA,oBACA,qBACA,eACA,iBACA,oBACA,yBACA,6BACA,2BACA,gCACA,0BACA,0BACA,kBACA,0BACA,sBACA,eACA,qBACA,qBACA,iBACA,qBACA,wB2EnBIC,GACJ,WACA,EAIIC,GAAgC,WACpC,kBACA,IACA,EACA,EAGA,EACA,EAHA,cACA,gBAGA,SAPA,MAOA,YACA,IACA,MAEA,8BACA,yBAvBuB,MAwBvB,sBAvBmB,KAyBnB,8BACA,EA5B0B,aA4B1B,CACA,IAsEA,gBACA,SACA,4BACA,eACA,eACA,IACA,eACA,WACA,gBACA,qDAEA,gBACA,iDAEA,OAEA,UACA,QACA,QACA,KAEA,CACA,UACA,0GACA,CAEA,QACA,CAWA,gBACA,YACA,QACA,QAGA,QACA,aACA,IAEA,EADA,IACA,MAGA,MAEA,2BAIA,kCACA,GACA,CAhIA,YACA,aACA,oBAGA,kBACA,KACA,QAIA,GAHA,OACA,GAmCA,YACA,SACA,WACA,yBACA,aAEA,CAKA,aACA,IACA,SAEA,CACA,gBACA,CApDA,MAEA,QACA,cACA,UAGA,GADA,GADA,aACA,MACA,GACA,CAEA,EA8EA,YACA,wBACA,2BACA,YACA,WAEA,MACA,8FAEA,CArFA,MAIA,OApD6B,MAqD7B,MAGA,EAMA,oBACA,IA6FA,MA7FA,QA6FA,EA5FA,KA4FA,EA5FA,MA4FA,EA5FA,MAgGA,wBA/FA,CAiGA,GACA,qBAaA,CAzKoC,GCZhCC,GACJ,kBACA,WACA,yBACA,aACA,mBACA,mBACA,cAEA,cACA,ECPA,SAASC,GAAmBjnB,GAI5B,6BACA,GACA,sBAIA,CACA,IAAIknB,GAAqB,WACzB,kBAIA,kBAIA,wBACA,IAEA,EAFA,cACA,gBAEA,4BAEA,qBACA,yBAEA,6BACA,8BACA,qBAEA,eACA,MACA,SACA,qBACA,aACA,UAEA,aAEA,CACA,UACA,SAEA,EADA,QACA,aAGA,uCnEqDA,cACA,UACA,YACA,IAEA,OADA,SACA,CACA,CACA,SACA,MACA,oGACA,CAGA,CmEjEA,KACA,CAGA,oBAGA,mBACA,MAEA,OADA,gBACA,aACA,OACA,YAEA,mBACA,WAEA,CACA,IAEA,aACA,YAGA,OAFA,mBACA,yBAEA,CACA,cACA,yBAIA,OAHA,2BACA,SACA,KAEA,CACA,cAKA,gBADA,QAEA,CApBA,YAqBA,8CAIA,QAHA,eAEA,kBAEA,+KACA,OAFA,CAMA,QACA,YACA,IACA,QACA,mCAEA,GAGA,yBAXA,CAaA,EAKA,2CACA,WACA,WACA,YACA,EACA,qBAEA,iBAGA,EADA,EADA,QAEA,YAEA,CACA,GACA,CA6BA,OAHA,sBACA,2BACA,mCACA,CACA,CArJyB,GCHrBC,GAAS,MACTC,GAAU,OACd,SAASC,GAAa1kB,EAAQkD,GAC9B,4CACA,IAEA,CACA,SAASyhB,KACT,WACA,CACA,ICrBI,GAQAC,GDaAC,GAAiC,WACrC,oBACA,WACA,YACA,2BAKA,GAJA,WACA,SACA,qBACA,wBACA,YACA,oBACA,gBACA,kBACA,qBACA,IAEA,EAFA,SACA,SAEA,IACA,iBACA,gBACA,eAEA,sBACA,YACA,CACA,iBACA,YACA,OAEA,sBACA,WAEA,CAEA,sBACA,8BACA,CACA,QACA,EACA,qBACA,iDACA,EACA,qBACA,sBACA,EACA,oBACA,oBACA,MAEA,sBACA,8CACA,4CACA,CACA,EACA,mCACA,eACA,MAEA,mCACA,iCACA,4BACA,kCACA,4CACA,CACA,EACA,oBACA,iBACA,MACA,sBACA,yDACA,6DACA,wDACA,kDACA,4CAEA,CACA,EACA,oBACA,iBACA,IACA,mDAEA,EACA,oBACA,YACA,MACA,oEACA,4CACA,sCACA,4CACA,CACA,EACA,gCACA,YACA,IACA,4BAEA,EACA,iCACA,aACA,MACA,yBAEA,wCAEA,mCACA,4BACA,+BACA,CACA,EACA,wBACA,YACA,IACA,SACA,SACA,SACA,SACA,SACA,SAEA,CACA,GACA,qBAgCA,CA1JqC,GCZjCC,GAAY,KACZ,IAAJ,eACA,aACA,sBACA,uBACA,0BACA,gBACA,gBACA,gCACA,WAEA,OACA,iBACA,UACA,wBACA,eACA,eACA,KAgIA,SA/HqC,SAArC,GAEA,aACA,IAGA,EACA,EACA,EACA,EACA,EAPA,qBA8GA,OA7GA,eACA,oBAMA,0BAsDA,aACA,OACA,OACA,OACA,OACA,IACA,CA3DA,KACA,sBACA,aACA,QACA,IAEA,+BACA,sBAqDA,YACA,mBACA,SAEA,kCACA,0BACA,iBACA,mBAEA,gCACA,oBAEA,cACA,KAEA,YACA,+BACA,sBACA,iBACA,2BACA,yBACA,6BACA,CACA,CA3EA,GACA,EAKA,iCACA,kBACA,kBAEA,0BACA,wCAEA,YACA,OAEA,kCACA,eAGA,aAKA,GAJA,WACA,oBAsDA,eAEA,sBACA,oBACA,gBACA,WACA,WACA,0BACA,WACA,wBACA,WACA,uBACA,WACA,WACA,cACA,CAnEA,MACA,WACA,UACA,IACA,oDACA,wBACA,CAEA,kBACA,CACA,EACA,4BACA,qBACA,WACA,YACA,GACA,kBAGA,GACA,CAgDA,IACA,CACA,QAjHA,0BA6HA,CA9HqC,CA8HnChhB,GAAF,GvFtJA,IwFJI,GAAJ,SAaIihB,GxFTJ,8BACA,WAEA,aAIA,WAGA,6BAEA,sBACA,eACA,kBACA,cACA,cACA,eACA,iBACA,kBACA,uBACA,YACA,cQpBA,aACA,WACA,sBACA,wBACA,6BACA,iBACA,mBACA,aACA,iCACA,iBACA,8BgFAIC,GAAiC,CACrC,oFAEIC,GAAa,YACbC,GAAY,WACZC,GAAiB,eACjB,QAAJ,EASIC,GAA0B,CAC9B,YACA,gBAVoB,CACpB,iBACA,kBASA,mBAPuB,CACvB,gBACA,oBASIC,KAAuB,GAA3B,IACA,OACA,kBACA,UACA,UACA,oCAmBA,SAAuB7iB,GAEvB,aACA,GAtBA,KACA,yBACA,aACA,gBACA,gBACA,IACA,qCACA,mBACA,sBACA,sBACA,sBACA,KACA,sCACA,oCACA,OxF9BA,8DwF+BA,aAEA,KACA,IAYA,IAAI8iB,GAA+B,WACnC,cACA,IAEA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EAfA,QAgBA,2BACA,KACA,qBACA,aACA,QACA,KAEA,wEACA,cACA,aACA,SACA,KAEA,IACA,GAEA,IAEA,uBACA,gBACA,eACA,gCA2VA,aACA,oBACA,OACA,OACA,OACA,OACA,OACA,OACA,KACA,KACA,KACA,QACA,CACA,aAEA,ItD3FA,csD4FA,QtDpDA,cAEA,eACA,aACA,eACA,CsDgDA,SAEA,CACA,cACA,kBACA,CAhXA,QACA,UACA,0BACA,aACA,QACA,IAEA,SACA,SACA,SACA,UACA,mBACA,aACA,QACA,IAGA,yBACA,YACA,aACA,yBACA,kBACA,iBACA,QACA,gBAEA,QACA,SAGA,IACA,GACA,GACA,CACA,iBACA,wBACA,sBACA,YACA,6BACA,IACA,uBAGA,OACA,GACA,IACA,SACA,cACA,oBACA,sBACA,YACA,yBAEA,EADA,WAEA,uBAGA,OACA,GACA,KAEA,QACA,OACA,CACA,oBAIA,YACA,sBACA,+BACA,iCACA,CAEA,+BACA,KACA,QACA,oBAEA,MAuBA,YAxBA,eAEA,yDACA,QACA,kBACA,GACA,KAEA,QACA,aAEA,MADA,GAEA,GAEA,GACA,sCACA,IACA,IACA,WAEA,IAEA,GACA,WACA,CACA,EACA,uBACA,eACA,sCACA,MACA,QAGA,QAEA,GACA,EACA,kCAoEA,YAnEA,cACA,IACA,gDAwBA,wEAEA,iCACA,sBACA,6BAEA,IACA,aAEA,MAqgBA,WACA,MAEA,UAEA,WACA,KACA,GACA,2BACA,8BAEA,IAGA,mCACA,IACA,QAQA,CACA,SAEA,CACA,MACA,IACA,sBACA,MACA,UACA,0BACA,uBAWA,OAVA,eACA,gCACA,0BACA,YAEA,4BACA,aAGA,oBACA,CAEA,GACA,CACA,CACA,SAEA,CAEA,IACA,CACA,SACA,CA9jBA,GACA,WACA,yBAjCA,YACA,MACA,UACA,cACA,MAEA,wBACA,mCAGA,2BACA,eACA,aACA,gBACA,qBACA,WACA,OAGA,GACA,CACA,CAcA,QAEA,eACA,QACA,SACA,yBACA,SACA,wBACA,oCAEA,oEAEA,mBAEA,4BACA,mEACA,OAEA,0FACA,0DACA,OAEA,mCACA,uEACA,KAEA,IACA,IACA,CACA,EACA,mBAGA,yBAEA,8BACA,GACA,EACA,wBAEA,IACA,6BAGA,IADA,2BACA,cAEA,EADA,mBAEA,CACA,4BACA,aACA,CACA,CACA,SAEA,0BACA,YAQA,CACA,EACA,kBAEA,6BACA,iBAWA,GAHA,WAGA,sBACA,wBACA,MACA,eACA,iCACA,8BAEA,CACA,CACA,EACA,KACA,IACA,wBAGA,0BACA,YACA,gBAEA,GADA,wBACA,+BAEA,IACA,gCACA,+BAGA,YACA,MAGA,YACA,MAIA,iBACA,8EAGA,2BAEA,SAEA,IACA,CACA,EACA,uBACA,QACA,EACA,yBACA,IACA,EADA,KAkBA,OAhBA,QACA,kBAEA,GACA,KASA,SACA,IACA,sBATA,YACA,IACA,KACA,IACA,QAEA,GAGA,GACA,CACA,GACA,axFzZA,ewF2ZA,GACA,GACA,2BACA,GACA,WACA,GACA,GxFhaA,iBACA,gBAEA,kBACA,oBwFkaA,WAyBA,WACA,QACA,GA3BA,CACA,GACA,wBACA,8BAEA,aACA,GACA,GACA,0BACA,GACA,YACA,GACA,cACA,cACA,YACA,iBAEA,sBACA,YACA,oBACA,IACA,GACA,IA6BA,GACA,QAkRA,iDACA,WACA,GAmBA,CAjsBmC,GCzEnC,IAAIC,GAA6C,WACjD,aACA,CAcA,OAbA,+BACA,gBAKA,QAGA,OAFA,SACA,sBACA,GAEA,uDACA,EACA,CACA,CAjBiD,GCCjD,YACA,WACA,WACA,UACA,gLCUA,IAMMC,EAAc,cAMdC,EAAY,YAMZC,EAAc,WAMdC,EAAmB,gBAMnBC,EAAc,cAMdC,EAAe,YAMfC,EAAqB,WAMrBC,EAAgB,cAMhBC,EAAqBD,EAKrBE,EAAyB,UAMzBC,EAAe,YAMfC,EA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QAA5B5qI,OAAAA,OAAAA,IAAS,OACX6qI,GAA4BC,EAAAA,EAAAA,sBAA+B9qI,EAAQ,CAAC,SAAU,iBAOpF+pI,EAAoBc,EACtB,CDHE55C,CAAO05C,SACT,EARensH,gLAAAA,EAAAA,MAAAA,KAAAA,8BAAAA,EAAAA,MAAAA,KAAAA,YAUfA,GAAOoqB,OAAM,SAAC14B,GACZ,MAAMA,CACR","sources":["webpack://orioutdatedbrowserinfoapp/../../packages/outdated-browser-info/dist/esm/index.css","webpack://orioutdatedbrowserinfoapp/../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://orioutdatedbrowserinfoapp/SeverityLevel.js","webpack://orioutdatedbrowserinfoapp/applicationinsights-common.js","webpack://orioutdatedbrowserinfoapp/ConfigDefaultHelpers.js","webpack://orioutdatedbrowserinfoapp/ConfigDefaults.js","webpack://orioutdatedbrowserinfoapp/DynamicSupport.js","webpack://orioutdatedbrowserinfoapp/DynamicProperty.js","webpack://orioutdatedbrowserinfoapp/AggregationError.js","webpack://orioutdatedbrowserinfoapp/DynamicState.js","webpack://orioutdatedbrowserinfoapp/DynamicConfig.js","webpack://orioutdatedbrowserinfoapp/EnumHelperFuncs.js","webpack://orioutdatedbrowserinfoapp/BaseTelemetryPlugin.js","webpack://orioutdatedbrowserinfoapp/CookieMgr.js","webpack://orioutdatedbrowserinfoapp/CoreUtils.js","webpack://orioutdatedbrowserinfoapp/DataCacheHelper.js","webpack://orioutdatedbrowserinfoapp/DbgExtensionUtils.js","webpack://orioutdatedbrowserinfoapp/DiagnosticLogger.js","webpack://orioutdatedbrowserinfoapp/EnvUtils.js","webpack://orioutdatedbrowserinfoapp/HelperFuncs.js","webpack://orioutdatedbrowserinfoapp/InternalConstants.js","webpack://orioutdatedbrowserinfoapp/PerfManager.js","webpack://orioutdatedbrowserinfoapp/ProcessTelemetryContext.js","webpack://orioutdatedbrowserinfoapp/RandomHelper.js","webpack://orioutdatedbrowserinfoapp/TelemetryHelpers.js","webpack://orioutdatedbrowserinfoapp/UnloadHandlerContainer.js","webpack://orioutdatedbrowserinfoapp/UnloadHookContainer.js","webpack://orioutdatedbrowserinfoapp/W3cTraceParent.js","webpack://orioutdatedbrowserinfoapp/__DynamicConstants.js","webpack://orioutdatedbrowserinfoapp/ReactPlugin.js","webpack://orioutdatedbrowserinfoapp/withAITracking.js","webpack://orioutdatedbrowserinfoapp/AppInsightsErrorBoundary.js","webpack://orioutdatedbrowserinfoapp/AppInsightsContext.js","webpack://orioutdatedbrowserinfoapp/useTrackEvent.js","webpack://orioutdatedbrowserinfoapp/useTrackMetric.js","webpack://orioutdatedbrowserinfoapp/../src/Constants.ts","webpack://orioutdatedbrowserinfoapp/../src/TsLibShims.ts","webpack://orioutdatedbrowserinfoapp/Enums.js","webpack://orioutdatedbrowserinfoapp/StorageHelperFuncs.js","webpack://orioutdatedbrowserinfoapp/Constants.js","webpack://orioutdatedbrowserinfoapp/DataSanitizer.js","webpack://orioutdatedbrowserinfoapp/TelemetryItemCreator.js","webpack://orioutdatedbrowserinfoapp/Event.js","webpack://orioutdatedbrowserinfoapp/Trace.js","webpack://orioutdatedbrowserinfoapp/DataPoint.js","webpack://orioutdatedbrowserinfoapp/Metric.js","webpack://orioutdatedbrowserinfoapp/PageView.js","webpack://orioutdatedbrowserinfoapp/PageViewPerformance.js","webpack://orioutdatedbrowserinfoapp/Exception.js","webpack://orioutdatedbrowserinfoapp/RequestResponseHeaders.js","webpack://orioutdatedbrowserinfoapp/UrlHelperFuncs.js","webpack://orioutdatedbrowserinfoapp/Util.js","webpack://orioutdatedbrowserinfoapp/RemoteDependencyData.js","webpack://orioutdatedbrowserinfoapp/DomHelperFuncs.js","webpack://orioutdatedbrowserinfoapp/EventHelpers.js","webpack://orioutdatedbrowserinfoapp/InstrumentHooks.js","webpack://orioutdatedbrowserinfoapp/PageViewManager.js","webpack://orioutdatedbrowserinfoapp/PageViewPerformanceManager.js","webpack://orioutdatedbrowserinfoapp/AnalyticsPlugin.js","webpack://orioutdatedbrowserinfoapp/PageVisitTimeManager.js","webpack://orioutdatedbrowserinfoapp/Timing.js","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/promise/debug.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/internal/constants.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/promise/await.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/internal/state.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/promise/event.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/promise/base.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/promise/itemProcessor.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/promise/asyncPromise.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/promise/nativePromise.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/promise/syncPromise.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/promise/idlePromise.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/promise/promise.ts","https://raw.githubusercontent.com/nevware21/ts-async/refs/tags/0.5.4/lib/src/polyfills/promise.ts","webpack://orioutdatedbrowserinfoapp/CfgSyncHelperFuncs.js","webpack://orioutdatedbrowserinfoapp/CfgSyncPlugin.js","webpack://orioutdatedbrowserinfoapp/Offline.js","webpack://orioutdatedbrowserinfoapp/InitActiveStatusEnum.js","webpack://orioutdatedbrowserinfoapp/SenderPostManager.js","webpack://orioutdatedbrowserinfoapp/AsyncUtils.js","webpack://orioutdatedbrowserinfoapp/ResponseHelpers.js","webpack://orioutdatedbrowserinfoapp/ContextTagKeys.js","webpack://orioutdatedbrowserinfoapp/PartAExtensions.js","webpack://orioutdatedbrowserinfoapp/Envelope.js","webpack://orioutdatedbrowserinfoapp/Data.js","webpack://orioutdatedbrowserinfoapp/EnvelopeCreator.js","webpack://orioutdatedbrowserinfoapp/SendBuffer.js","webpack://orioutdatedbrowserinfoapp/Sender.js","webpack://orioutdatedbrowserinfoapp/Serializer.js","webpack://orioutdatedbrowserinfoapp/HashCodeScoreGenerator.js","webpack://orioutdatedbrowserinfoapp/SamplingScoreGenerator.js","webpack://orioutdatedbrowserinfoapp/Sample.js","webpack://orioutdatedbrowserinfoapp/ConnectionStringParser.js","webpack://orioutdatedbrowserinfoapp/ThrottleMgr.js","webpack://orioutdatedbrowserinfoapp/NotificationManager.js","webpack://orioutdatedbrowserinfoapp/TelemetryInitializerPlugin.js","webpack://orioutdatedbrowserinfoapp/AppInsightsCore.js","webpack://orioutdatedbrowserinfoapp/ajaxRecord.js","webpack://orioutdatedbrowserinfoapp/ajax.js","webpack://orioutdatedbrowserinfoapp/Application.js","webpack://orioutdatedbrowserinfoapp/Device.js","webpack://orioutdatedbrowserinfoapp/Internal.js","webpack://orioutdatedbrowserinfoapp/Location.js","webpack://orioutdatedbrowserinfoapp/Session.js","webpack://orioutdatedbrowserinfoapp/TelemetryTrace.js","webpack://orioutdatedbrowserinfoapp/User.js","webpack://orioutdatedbrowserinfoapp/TelemetryContext.js","webpack://orioutdatedbrowserinfoapp/PropertiesPlugin.js","webpack://orioutdatedbrowserinfoapp/AISku.js","webpack://orioutdatedbrowserinfoapp/ApplicationInsightsContainer.js","webpack://orioutdatedbrowserinfoapp/LoggingEnums.js","webpack://orioutdatedbrowserinfoapp/../src/DynamicProto.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/internal/treeshake_helpers.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/internal/constants.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/base.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/safe.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/safe_get.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/object/get_own_prop_desc.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/object/has_own_prop.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/object/has_own.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/object/for_each_key.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/object/define.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/internal/map.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/string/as_string.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/diagnostics.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/throw.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/object/object.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/enum.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/symbol/well_known.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/internal/global.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/internal/unwrapFunction.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/math/min_max.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/string/slice.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/string/substring.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/polyfills/symbol.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/lazy.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/cache.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/environment.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/symbol/symbol.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/iterator/forOf.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/iterator/iterator.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/funcs/funcs.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/array/append.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/array/forEach.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/array/indexOf.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/array/map.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/array/slice.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/array/find.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/array/reduce.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/object/set_proto.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/customError.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/object/create.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/date.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/polyfills/trim.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/string/trim.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/math/floor.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/encode.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/object/is_plain_object.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/object/copy.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/extend.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/length.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/perf.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/math/round.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/string/split.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/helpers/get_set_value.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/string/ends_with.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/string/index_of.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/timer/handler.ts","https://raw.githubusercontent.com/nevware21/ts-utils/refs/tags/0.11.8/lib/src/timer/timeout.ts","webpack://orioutdatedbrowserinfoapp/../../src/AuthorizationCodeTokenClient.ts","webpack://orioutdatedbrowserinfoapp/../../src/OidcClient.ts","webpack://orioutdatedbrowserinfoapp/../../src/OidcUrlHelper.ts","webpack://orioutdatedbrowserinfoapp/../../src/TokenClient.ts","webpack://orioutdatedbrowserinfoapp/../../src/TokenEventNames.ts","webpack://orioutdatedbrowserinfoapp/../../src/TokenRoutes.ts","webpack://orioutdatedbrowserinfoapp/../../src/TokenService.ts","webpack://orioutdatedbrowserinfoapp/../../src/TokenSessionStorageKeys.ts","webpack://orioutdatedbrowserinfoapp/../../src/constants-generated.ts","webpack://orioutdatedbrowserinfoapp/../../src/constants.ts","webpack://orioutdatedbrowserinfoapp/../../src/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/AuthCookies.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/PublicTokenClient.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/TokenFetcher.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/UserTokenClient.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/cleanToken.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/getRemainingSeconds.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/getTokenClients.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/validateLoggedInUserCookie.ts","webpack://orioutdatedbrowserinfoapp/../../src/logger.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/IfAnonymousUser.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/IfLoggedInUser.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/LegacyTokenService.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/MockedTokenProvider.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/PrefetchedTokenProvider.tsx","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/StandaloneTokenProvider.tsx","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/UniversalTokenProvider.tsx","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/tokenContext.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/useToken.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react-integration/useUniversalToken.ts","webpack://orioutdatedbrowserinfoapp/../../../src/storage/CombinedSessionItem.ts","webpack://orioutdatedbrowserinfoapp/../../../src/storage/CombinedTokenStorage.ts","webpack://orioutdatedbrowserinfoapp/../../../src/storage/OidcTokenStorage.ts","webpack://orioutdatedbrowserinfoapp/../../../src/storage/SessionStorage.ts","webpack://orioutdatedbrowserinfoapp/../../../src/storage/SessionTokenStorage.ts","webpack://orioutdatedbrowserinfoapp/../../../src/storage/SessionValue.ts","webpack://orioutdatedbrowserinfoapp/../../../src/storage/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/tokens/OidcAccessToken.ts","webpack://orioutdatedbrowserinfoapp/../../../src/tokens/OidcIdToken.ts","webpack://orioutdatedbrowserinfoapp/../../../src/tokens/OidcToken.ts","webpack://orioutdatedbrowserinfoapp/../../../src/tokens/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/CryptoUtils.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/decodeToken.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/doDevelopmentLogin.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/getRandomInt.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/isAuthenticatedCustomer.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/isSessionStorageSupported.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/isTokenValid.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/singleton.ts","webpack://orioutdatedbrowserinfoapp/../../src/SafeURL.ts","webpack://orioutdatedbrowserinfoapp/../../../src/adapters/fetchAdapter.ts","webpack://orioutdatedbrowserinfoapp/../../../src/adapters/index.ts","webpack://orioutdatedbrowserinfoapp/../../src/createAxiosWithCache.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/fixExcessiveSlashing.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/getUrl.ts","webpack://orioutdatedbrowserinfoapp/../../src/joinPathSegments.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/isValidClientAppConfigProperty.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/safeParseJson.ts","webpack://orioutdatedbrowserinfoapp/../../src/parseClientAppConfig.ts","webpack://orioutdatedbrowserinfoapp/../../src/createCustomError.ts","webpack://orioutdatedbrowserinfoapp/../../src/createCustomErrorWithData.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internals/createErrorMessage.ts","webpack://orioutdatedbrowserinfoapp/../../../src/types/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/constants/contentTypes.ts","webpack://orioutdatedbrowserinfoapp/../../../src/constants/headers.ts","webpack://orioutdatedbrowserinfoapp/../../../src/constants/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/constants/statusCodes.ts","webpack://orioutdatedbrowserinfoapp/../../../src/errors/EmptyBodyFetchGraphqlError.ts","webpack://orioutdatedbrowserinfoapp/../../../src/errors/FetchGraphqlError.ts","webpack://orioutdatedbrowserinfoapp/../../../src/errors/NonOkResponseFetchGraphqlError.ts","webpack://orioutdatedbrowserinfoapp/../../../src/errors/index.ts","webpack://orioutdatedbrowserinfoapp/../../src/gql.ts","webpack://orioutdatedbrowserinfoapp/../../../src/hooks/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/hooks/useGraphqlQuery.ts","webpack://orioutdatedbrowserinfoapp/../../../src/middleware/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/middleware/initialDataMiddleware.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/createSimplifiedCacheKey.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/fetchGraphql.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/getHeaders.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/handleResponse.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/isEmptyObject.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/prepareToken.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/validateStatus.ts","webpack://orioutdatedbrowserinfoapp/../../src/Logger.ts","webpack://orioutdatedbrowserinfoapp/../../../src/application-insights/ApplicationInsights.ts","webpack://orioutdatedbrowserinfoapp/../../../src/application-insights/ApplicationInsightsNotInitializedError.ts","webpack://orioutdatedbrowserinfoapp/../../../src/application-insights/getApplicationInsightsReactPlugin.ts","webpack://orioutdatedbrowserinfoapp/../../../src/application-insights/getClientApplicationInsightsConfig.ts","webpack://orioutdatedbrowserinfoapp/../../../src/application-insights/index.ts","webpack://orioutdatedbrowserinfoapp/../../../src/application-insights/isServerApplicationInsightsClient.ts","webpack://orioutdatedbrowserinfoapp/../../src/formatError.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internal/EventEmitter.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internal/LoggerBrowserConfiguration.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internal/isObject.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internal/isPlainObject.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internal/loggerEventEmitter.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/pino-log-handlers/definePinoLogHandlers.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/pino-log-handlers/pinoApplicationInsightsLogHandler.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/pino-log-handlers/pinoConsoleLogHandler.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/pino-log-handlers/pinoGroupedLogHandlers.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/pino-runtime-transports/canRunLogHandler.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/pino-runtime-transports/filterPinoMessage.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/pino-runtime-transports/getEnabledLogHandlersForTransport.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/pino-runtime-transports/pinoBrowserRuntimeTransport.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/pino-runtime-transports/pinoNodeRuntimeTransport.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internal/printWarningWithTrace.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internal/stringifyErrorObject.ts","webpack://orioutdatedbrowserinfoapp/../../../src/internal/stringifyObject.ts","webpack://orioutdatedbrowserinfoapp/../../../../../src/internal/telemetry/browser/createMetadataDependencyInitializer.ts","webpack://orioutdatedbrowserinfoapp/../../../../../src/internal/telemetry/browser/pageViewInitializer.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/telemetry/createFilterTelemetryProcessor.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/internal/telemetry/createFixedRateSampler.ts","webpack://orioutdatedbrowserinfoapp/../../../../../src/internal/telemetry/server/enhanceDependencyDataProcessor.ts","webpack://orioutdatedbrowserinfoapp/../../../../../src/internal/telemetry/server/excludeHealthProbesTelemetryProcessor.ts","webpack://orioutdatedbrowserinfoapp/../../../../../src/internal/telemetry/server/excludeNextjsTelemetryProcessor.ts","webpack://orioutdatedbrowserinfoapp/../../src/loggerConfigurationSchema.ts","webpack://orioutdatedbrowserinfoapp/../../src/measureFunctionDuration.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react/AppInsightsProvider.tsx","webpack://orioutdatedbrowserinfoapp/../../../src/react/ErrorBoundary.tsx","webpack://orioutdatedbrowserinfoapp/../../../src/react/LoggerProvider.tsx","webpack://orioutdatedbrowserinfoapp/../../../src/react/index.ts","webpack://orioutdatedbrowserinfoapp/../../../../src/react/internal/InternalErrorBoundary.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react/loggerContext.ts","webpack://orioutdatedbrowserinfoapp/../../../src/react/useLogger.ts","webpack://orioutdatedbrowserinfoapp/../../../src/server/asyncLocalStorage.ts","webpack://orioutdatedbrowserinfoapp/../../../src/types/LoggerTransportType.ts","webpack://orioutdatedbrowserinfoapp/../../../src/types/SeverityLevels.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/assert.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/is.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/isNonNullable.ts","webpack://orioutdatedbrowserinfoapp/../../node_modules/ansis/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/browser-update/update.npm.full.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/clone-deep/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/clone-deep/node_modules/is-plain-object/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/aes.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/blowfish.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/cipher-core.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/core.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/enc-base64.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/enc-base64url.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/enc-utf16.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/evpkdf.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/format-hex.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/hmac.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/lib-typedarrays.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/md5.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/mode-cfb.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/mode-ctr-gladman.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/mode-ctr.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/mode-ecb.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/mode-ofb.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/pad-ansix923.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/pad-iso10126.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/pad-iso97971.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/pad-nopadding.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/pad-zeropadding.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/pbkdf2.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/rabbit-legacy.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/rabbit.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/rc4.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/ripemd160.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/sha1.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/sha224.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/sha256.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/sha3.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/sha384.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/sha512.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/tripledes.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/crypto-js/x64-core.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/css-loader/dist/runtime/api.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/css-loader/dist/runtime/getUrl.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/deepmerge/dist/cjs.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/dequal/lite/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/events/events.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/isobject/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/js-cookie/dist/js.cookie.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/kind-of/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/quick-format-unescaped/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/react/cjs/react.production.min.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/react/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/react/jsx-runtime.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/shallow-clone/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/swr/dist/_internal/config-context-client-BXAm5QZy.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/swr/dist/_internal/constants.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/swr/dist/_internal/events.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/swr/dist/_internal/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/swr/dist/index/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/swr/dist/mutation/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/use-sync-external-store/shim/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/zod/lib/ZodError.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/zod/lib/errors.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/zod/lib/external.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/zod/lib/helpers/errorUtil.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/zod/lib/helpers/parseUtil.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/zod/lib/helpers/typeAliases.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/zod/lib/helpers/util.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/zod/lib/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/zod/lib/locales/en.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/zod/lib/types.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/axios-cache-interceptor/dist/index.cjs","webpack://orioutdatedbrowserinfoapp/../../node_modules/axios/dist/browser/axios.cjs","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/auth/node_modules/@babel/runtime/helpers/defineProperty.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/auth/node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/auth/node_modules/@babel/runtime/helpers/toPrimitive.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/auth/node_modules/@babel/runtime/helpers/toPropertyKey.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/auth/node_modules/@babel/runtime/helpers/typeof.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/axios/node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/error/node_modules/@babel/runtime/helpers/defineProperty.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/error/node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/error/node_modules/@babel/runtime/helpers/toPrimitive.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/error/node_modules/@babel/runtime/helpers/toPropertyKey.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/error/node_modules/@babel/runtime/helpers/typeof.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/fetching/node_modules/@babel/runtime/helpers/defineProperty.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/fetching/node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/fetching/node_modules/@babel/runtime/helpers/toPrimitive.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/fetching/node_modules/@babel/runtime/helpers/toPropertyKey.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/fetching/node_modules/@babel/runtime/helpers/typeof.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/logger/node_modules/@babel/runtime/helpers/defineProperty.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/logger/node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/logger/node_modules/@babel/runtime/helpers/toPrimitive.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/logger/node_modules/@babel/runtime/helpers/toPropertyKey.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@ori/logger/node_modules/@babel/runtime/helpers/typeof.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/jwt-decode/build/cjs/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/pino-std-serializers/index.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/pino-std-serializers/lib/err-helpers.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/pino-std-serializers/lib/err-proto.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/pino-std-serializers/lib/err-with-cause.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/pino-std-serializers/lib/err.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/pino-std-serializers/lib/req.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/pino-std-serializers/lib/res.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/pino/browser.js","webpack://orioutdatedbrowserinfoapp/../src/internal.ts","webpack://orioutdatedbrowserinfoapp/../src/util.ts","webpack://orioutdatedbrowserinfoapp/../src/parse.ts","webpack://orioutdatedbrowserinfoapp/../src/tokenize.ts","webpack://orioutdatedbrowserinfoapp/../src/index.ts","webpack://orioutdatedbrowserinfoapp/../src/create-deferred.ts","webpack://orioutdatedbrowserinfoapp/../src/is-deferred.ts","webpack://orioutdatedbrowserinfoapp/../src/hash.ts","webpack://orioutdatedbrowserinfoapp/webpack/bootstrap","webpack://orioutdatedbrowserinfoapp/webpack/runtime/compat get default export","webpack://orioutdatedbrowserinfoapp/webpack/runtime/define property getters","webpack://orioutdatedbrowserinfoapp/webpack/runtime/global","webpack://orioutdatedbrowserinfoapp/webpack/runtime/hasOwnProperty shorthand","webpack://orioutdatedbrowserinfoapp/webpack/runtime/make namespace object","webpack://orioutdatedbrowserinfoapp/webpack/runtime/jsonp chunk loading","webpack://orioutdatedbrowserinfoapp/webpack/runtime/nonce","webpack://orioutdatedbrowserinfoapp/../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://orioutdatedbrowserinfoapp/../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://orioutdatedbrowserinfoapp/../../src/getClientQueryParam.ts","webpack://orioutdatedbrowserinfoapp/../../src/isSSR.ts","webpack://orioutdatedbrowserinfoapp/../../src/getCurrentUrl.ts","webpack://orioutdatedbrowserinfoapp/../../node_modules/js-cookie/dist/js.cookie.mjs","webpack://orioutdatedbrowserinfoapp/../../../src/constants/app.ts","webpack://orioutdatedbrowserinfoapp/../../../src/constants/defaultTranslations.ts","webpack://orioutdatedbrowserinfoapp/../../../src/constants/optionsWithoutTranslations.ts","webpack://orioutdatedbrowserinfoapp/../../packages/outdated-browser-info/dist/esm/index.css?b793","webpack://orioutdatedbrowserinfoapp/../../../src/utils/outdatedBrowserInfo.ts","webpack://orioutdatedbrowserinfoapp/../../../src/utils/parseLocalizations.ts","webpack://orioutdatedbrowserinfoapp/./src/appLoader.ts","webpack://orioutdatedbrowserinfoapp/./src/appRender.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 14 14%27%3E%3Cpath fill=%27%23333333%27 d=%27M14 1.4L12.6 0 7 5.6 1.4 0 0 1.4 5.6 7 0 12.6 1.4 14 7 8.4l5.6 5.6 1.4-1.4L8.4 7z%27/%3E%3C/svg%3E\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `#buorg {\n height: 65px;\n background-color: rgba(245, 245, 245, 0.9);\n box-shadow: 0px 3px 6px rgba(0,0,0,0.10196);\n border: none;\n}\n\nbody .buorg-pad {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-wrap: nowrap;\n padding: 0;\n}\n\nbody .buorg-pad .buorg-icon {\n display: none;\n}\n\nbody .buorg-mainmsg,\nbody .buorg-moremsg {\n display: flex;\n flex-basis: 40%;\n flex-grow: 1;\n color: #333333;\n white-space: nowrap;\n letter-spacing: 0px;\n font: normal normal 14px/65px SansOri;\n}\n\nbody .buorg-mainmsg {\n justify-content: flex-end;\n font-weight: bold;\n padding-right: 7px;\n}\n\nbody .buorg-moremsg {\n justify-content: flex-start;\n}\n\nbody .buorg-buttons {\n flex-basis: 254px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\nbody #buorgul {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 128px;\n height: 35px;\n margin: 0;\n background: #68bb93 0% 0% no-repeat padding-box;\n border-radius: 18px;\n box-sizing: border-box;\n box-shadow: none;\n font: normal normal bold 14px/35px SansOri;\n letter-spacing: 0px;\n}\n\nbody #buorgig {\n border: none;\n height: 23px;\n width: 23px;\n padding: 0;\n margin: 0;\n box-shadow: none;\n box-sizing: border-box;\n margin-right: 40px;\n overflow: hidden;\n color: transparent;\n background: url(${___CSS_LOADER_URL_REPLACEMENT_0___})\n no-repeat center center;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\nbody #buorgig > svg {\n padding: 0;\n height: 100%;\n width: 100%;\n}\nbody .buorg-test {\n display: none;\n}\n\n@media (max-width: 900px) {\n body .buorg-pad {\n margin: 15px 45px;\n }\n}\n@media (max-width: 900px) {\n body #buorg {\n height: -moz-fit-content;\n height: fit-content;\n }\n\n body .buorg-pad {\n max-height: 131px;\n flex-direction: column;\n flex-wrap: wrap;\n }\n body .buorg div {\n padding: 0;\n }\n\n body .buorg-mainmsg,\n body .buorg-moremsg {\n padding: 1px 2px;\n white-space: normal;\n font-size: 12px;\n line-height: 17px;\n letter-spacing: 0;\n }\n\n body #buorgig {\n position: fixed;\n margin: 0;\n top: 13px;\n right: 10px;\n }\n\n body .buorg-buttons {\n margin-top: 15px;\n flex-basis: 50%;\n }\n}\n\n/* IE support - Flex box doesn't work properly*/\n@media screen and (min-width: 0\\\\0) and (min-resolution: +72dpi) {\n body .buorg-pad {\n display: block;\n position: relative;\n min-width: 1100px;\n width: 100%;\n height: 100%;\n text-align: right;\n white-space: nowrap;\n }\n\n body .buorg-mainmsg,\n body .buorg-moremsg {\n display: inline-block;\n box-sizing: border-box;\n padding: 0;\n width: 40.7%;\n }\n\n body .buorg-mainmsg {\n text-align: right;\n }\n\n body .buorg-moremsg {\n text-align: left;\n }\n\n body .buorg-buttons {\n position: relative;\n display: inline-block;\n width: 18.59%;\n max-width: 254px;\n min-width: 150px;\n height: 100%;\n text-align: right;\n }\n\n body #buorgul {\n position: absolute;\n display: inline-block;\n margin: 0;\n width: 128px;\n height: 35px;\n padding-top: 2px;\n text-align: center;\n }\n\n body #buorgig {\n display: inline-block;\n height: 23px;\n transform: translateY(30%);\n }\n}\n\n@media screen and (min-width: 0\\\\0) and (min-resolution: +72dpi) and (max-width: 1240px) {\n body .buorg-mainmsg,\n body .buorg-moremsg {\n transform: translateX(-12%);\n }\n}\n\n@media screen and (min-width: 0\\\\0) and (min-resolution: +72dpi) and (max-width: 900px) {\n body .buorg-pad {\n display: relative;\n width: 100%;\n min-width: 444px;\n top: 0;\n left: 0;\n margin: 0;\n padding: 0;\n text-align: center;\n }\n\n body .buorg-mainmsg,\n body .buorg-moremsg {\n display: block;\n width: 100%;\n text-align: center;\n padding-left: 45px;\n padding-right: 45px;\n transform: translateX(0);\n }\n\n body .buorg-mainmsg {\n margin-top: 16px;\n }\n body .buorg-buttons {\n position: absolute;\n display: block;\n top: 0;\n left: 0;\n margin: 0;\n height: 131px;\n width: 100%;\n max-width: 100%;\n }\n\n body #buorgul {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%);\n }\n\n body #buorgig {\n position: absolute;\n top: 0;\n transform: translateY(-10px);\n }\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./../../packages/outdated-browser-info/dist/esm/index.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,YAAY;EACZ,0CAA0C;EAC1C,2CAAiC;EACjC,YAAY;AACd;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,iBAAiB;EACjB,UAAU;AACZ;;AAEA;EACE,aAAa;AACf;;AAEA;;EAEE,aAAa;EACb,eAAe;EACf,YAAY;EACZ,cAAc;EACd,mBAAmB;EACnB,mBAAmB;EACnB,qCAAqC;AACvC;;AAEA;EACE,yBAAyB;EACzB,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE,iBAAiB;EACjB,aAAa;EACb,mBAAmB;EACnB,8BAA8B;AAChC;;AAEA;EACE,aAAa;EACb,uB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YAAY;IACZ,0BAA0B;EAC5B;AACF;;AAEA;EACE;;IAEE,2BAA2B;EAC7B;AACF;;AAEA;EACE;IACE,iBAAiB;IACjB,WAAW;IACX,gBAAgB;IAChB,MAAM;IACN,OAAO;IACP,SAAS;IACT,UAAU;IACV,kBAAkB;EACpB;;EAEA;;IAEE,cAAc;IACd,WAAW;IACX,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,wBAAwB;EAC1B;;EAEA;IACE,gBAAgB;EAClB;EACA;IACE,kBAAkB;IAClB,cAAc;IACd,MAAM;IACN,OAAO;IACP,SAAS;IACT,aAAa;IACb,WAAW;IACX,eAAe;EACjB;;EAEA;IACE,kBAAkB;IAClB,QAAQ;IACR,SAAS;IACT,2BAA2B;EAC7B;;EAEA;IACE,kBAAkB;IAClB,MAAM;IACN,4BAA4B;EAC9B;AACF\",\"sourcesContent\":[\"#buorg {\\n height: 65px;\\n background-color: rgba(245, 245, 245, 0.9);\\n box-shadow: 0px 3px 6px #0000001a;\\n border: none;\\n}\\n\\nbody .buorg-pad {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n flex-wrap: nowrap;\\n padding: 0;\\n}\\n\\nbody .buorg-pad .buorg-icon {\\n display: none;\\n}\\n\\nbody .buorg-mainmsg,\\nbody .buorg-moremsg {\\n display: flex;\\n flex-basis: 40%;\\n flex-grow: 1;\\n color: #333333;\\n white-space: nowrap;\\n letter-spacing: 0px;\\n font: normal normal 14px/65px SansOri;\\n}\\n\\nbody .buorg-mainmsg {\\n justify-content: flex-end;\\n font-weight: bold;\\n padding-right: 7px;\\n}\\n\\nbody .buorg-moremsg {\\n justify-content: flex-start;\\n}\\n\\nbody .buorg-buttons {\\n flex-basis: 254px;\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n}\\n\\nbody #buorgul {\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n width: 128px;\\n height: 35px;\\n margin: 0;\\n background: #68bb93 0% 0% no-repeat padding-box;\\n border-radius: 18px;\\n box-sizing: border-box;\\n box-shadow: none;\\n font: normal normal bold 14px/35px SansOri;\\n letter-spacing: 0px;\\n}\\n\\nbody #buorgig {\\n border: none;\\n height: 23px;\\n width: 23px;\\n padding: 0;\\n margin: 0;\\n box-shadow: none;\\n box-sizing: border-box;\\n margin-right: 40px;\\n overflow: hidden;\\n color: transparent;\\n background: url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='%23333333' d='M14 1.4L12.6 0 7 5.6 1.4 0 0 1.4 5.6 7 0 12.6 1.4 14 7 8.4l5.6 5.6 1.4-1.4L8.4 7z'/%3E%3C/svg%3E\\\")\\n no-repeat center center;\\n user-select: none;\\n}\\n\\nbody #buorgig > svg {\\n padding: 0;\\n height: 100%;\\n width: 100%;\\n}\\nbody .buorg-test {\\n display: none;\\n}\\n\\n@media (max-width: 900px) {\\n body .buorg-pad {\\n margin: 15px 45px;\\n }\\n}\\n@media (max-width: 900px) {\\n body #buorg {\\n height: fit-content;\\n }\\n\\n body .buorg-pad {\\n max-height: 131px;\\n flex-direction: column;\\n flex-wrap: wrap;\\n }\\n body .buorg div {\\n padding: 0;\\n }\\n\\n body .buorg-mainmsg,\\n body .buorg-moremsg {\\n padding: 1px 2px;\\n white-space: normal;\\n font-size: 12px;\\n line-height: 17px;\\n letter-spacing: 0;\\n }\\n\\n body #buorgig {\\n position: fixed;\\n margin: 0;\\n top: 13px;\\n right: 10px;\\n }\\n\\n body .buorg-buttons {\\n margin-top: 15px;\\n flex-basis: 50%;\\n }\\n}\\n\\n/* IE support - Flex box doesn't work properly*/\\n@media screen and (min-width: 0\\\\0) and (min-resolution: +72dpi) {\\n body .buorg-pad {\\n display: block;\\n position: relative;\\n min-width: 1100px;\\n width: 100%;\\n height: 100%;\\n text-align: right;\\n white-space: nowrap;\\n }\\n\\n body .buorg-mainmsg,\\n body .buorg-moremsg {\\n display: inline-block;\\n box-sizing: border-box;\\n padding: 0;\\n width: 40.7%;\\n }\\n\\n body .buorg-mainmsg {\\n text-align: right;\\n }\\n\\n body .buorg-moremsg {\\n text-align: left;\\n }\\n\\n body .buorg-buttons {\\n position: relative;\\n display: inline-block;\\n width: 18.59%;\\n max-width: 254px;\\n min-width: 150px;\\n height: 100%;\\n text-align: right;\\n }\\n\\n body #buorgul {\\n position: absolute;\\n display: inline-block;\\n margin: 0;\\n width: 128px;\\n height: 35px;\\n padding-top: 2px;\\n text-align: center;\\n }\\n\\n body #buorgig {\\n display: inline-block;\\n height: 23px;\\n transform: translateY(30%);\\n }\\n}\\n\\n@media screen and (min-width: 0\\\\0) and (min-resolution: +72dpi) and (max-width: 1240px) {\\n body .buorg-mainmsg,\\n body .buorg-moremsg {\\n transform: translateX(-12%);\\n }\\n}\\n\\n@media screen and (min-width: 0\\\\0) and (min-resolution: +72dpi) and (max-width: 900px) {\\n body .buorg-pad {\\n display: relative;\\n width: 100%;\\n min-width: 444px;\\n top: 0;\\n left: 0;\\n margin: 0;\\n padding: 0;\\n text-align: center;\\n }\\n\\n body .buorg-mainmsg,\\n body .buorg-moremsg {\\n display: block;\\n width: 100%;\\n text-align: center;\\n padding-left: 45px;\\n padding-right: 45px;\\n transform: translateX(0);\\n }\\n\\n body .buorg-mainmsg {\\n margin-top: 16px;\\n }\\n body .buorg-buttons {\\n position: absolute;\\n display: block;\\n top: 0;\\n left: 0;\\n margin: 0;\\n height: 131px;\\n width: 100%;\\n max-width: 100%;\\n }\\n\\n body #buorgul {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n transform: translateX(-50%);\\n }\\n\\n body #buorgig {\\n position: absolute;\\n top: 0;\\n transform: translateY(-10px);\\n }\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { createEnumStyle } from \"@microsoft/applicationinsights-core-js\";\r\n/**\r\n * Defines the level of severity for the event.\r\n */\r\nexport var SeverityLevel = createEnumStyle({\r\n Verbose: 0 /* eSeverityLevel.Verbose */,\r\n Information: 1 /* eSeverityLevel.Information */,\r\n Warning: 2 /* eSeverityLevel.Warning */,\r\n Error: 3 /* eSeverityLevel.Error */,\r\n Critical: 4 /* eSeverityLevel.Critical */\r\n});\r\n//# sourceMappingURL=SeverityLevel.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the\r\nexport { correlationIdSetPrefix, correlationIdGetPrefix, correlationIdCanIncludeCorrelationHeader, correlationIdGetCorrelationContext, correlationIdGetCorrelationContextValue, dateTimeUtilsNow, dateTimeUtilsDuration, isInternalApplicationInsightsEndpoint, createDistributedTraceContextFromTrace } from \"./Util\";\r\nexport { ThrottleMgr } from \"./ThrottleMgr\";\r\nexport { parseConnectionString, ConnectionStringParser } from \"./ConnectionStringParser\";\r\nexport { RequestHeaders } from \"./RequestResponseHeaders\";\r\nexport { DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod, DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, strNotSpecified } from \"./Constants\";\r\nexport { Envelope } from \"./Telemetry/Common/Envelope\";\r\nexport { Event } from \"./Telemetry/Event\";\r\nexport { Exception } from \"./Telemetry/Exception\";\r\nexport { Metric } from \"./Telemetry/Metric\";\r\nexport { PageView } from \"./Telemetry/PageView\";\r\nexport { RemoteDependencyData } from \"./Telemetry/RemoteDependencyData\";\r\nexport { Trace } from \"./Telemetry/Trace\";\r\nexport { PageViewPerformance } from \"./Telemetry/PageViewPerformance\";\r\nexport { Data } from \"./Telemetry/Common/Data\";\r\nexport { SeverityLevel } from \"./Interfaces/Contracts/SeverityLevel\";\r\nexport { ConfigurationManager } from \"./Interfaces/IConfig\";\r\nexport { ContextTagKeys } from \"./Interfaces/Contracts/ContextTagKeys\";\r\nexport { dataSanitizeKeyAndAddUniqueness, dataSanitizeKey, dataSanitizeString, dataSanitizeUrl, dataSanitizeMessage, dataSanitizeException, dataSanitizeProperties, dataSanitizeMeasurements, dataSanitizeId, dataSanitizeInput, dsPadNumber } from \"./Telemetry/Common/DataSanitizer\";\r\nexport { TelemetryItemCreator, createTelemetryItem } from \"./TelemetryItemCreator\";\r\nexport { CtxTagKeys, Extensions } from \"./Interfaces/PartAExtensions\";\r\nexport { DistributedTracingModes, EventPersistence } from \"./Enums\";\r\nexport { stringToBoolOrDefault, msToTimeSpan, getExtensionByName, isCrossOriginError } from \"./HelperFuncs\";\r\nexport { isBeaconsSupported as isBeaconApiSupported, createTraceParent, parseTraceParent, isValidTraceId, isValidSpanId, isValidTraceParent, isSampledFlag, formatTraceParent, findW3cTraceParent, findAllScripts } from \"@microsoft/applicationinsights-core-js\";\r\nexport { createDomEvent } from \"./DomHelperFuncs\";\r\nexport { utlDisableStorage, utlEnableStorage, utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage, utlRemoveStorage, utlCanUseSessionStorage, utlGetSessionStorageKeys, utlGetSessionStorage, utlSetSessionStorage, utlRemoveSessionStorage, utlSetStoragePrefix } from \"./StorageHelperFuncs\";\r\nexport { urlParseUrl, urlGetAbsoluteUrl, urlGetPathName, urlGetCompleteUrl, urlParseHost, urlParseFullHost } from \"./UrlHelperFuncs\";\r\nexport { createOfflineListener } from \"./Offline\";\r\nexport var PropertiesPluginIdentifier = \"AppInsightsPropertiesPlugin\";\r\nexport var BreezeChannelIdentifier = \"AppInsightsChannelPlugin\";\r\nexport var AnalyticsPluginIdentifier = \"ApplicationInsightsAnalytics\";\r\n//# sourceMappingURL=applicationinsights-common.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { asString, isBoolean, isFunction, isNullOrUndefined, isString } from \"@nevware21/ts-utils\";\r\nimport { STR_EMPTY } from \"../JavaScriptSDK/InternalConstants\";\r\nimport { _DYN_TO_LOWER_CASE } from \"../__DynamicConstants\";\r\n/**\r\n * @internal\r\n * @ignore\r\n * @param str\r\n * @param defaultValue\r\n * @returns\r\n */\r\nfunction _stringToBoolOrDefault(theValue, defaultValue, theConfig) {\r\n if (!theValue && isNullOrUndefined(theValue)) {\r\n return defaultValue;\r\n }\r\n if (isBoolean(theValue)) {\r\n return theValue;\r\n }\r\n return asString(theValue)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() === \"true\";\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance with the field defined as an object\r\n * that should be merged\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfMerge(defaultValue) {\r\n return {\r\n mrg: true,\r\n v: defaultValue\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance with the provided field set function\r\n * @param setter - The IConfigCheckFn function to validate the user provided value\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfSet(setter, defaultValue) {\r\n return {\r\n set: setter,\r\n v: defaultValue\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance with the provided field validator\r\n * @param validator - The IConfigCheckFn function to validate the user provided value\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @param fallBackName - The fallback configuration name if the current value is not available\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfValidate(validator, defaultValue, fallBackName) {\r\n return {\r\n fb: fallBackName,\r\n isVal: validator,\r\n v: defaultValue\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance that will validate and convert the user\r\n * provided value to a boolean from a string or boolean value\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @param fallBackName - The fallback configuration name if the current value is not available\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfBoolean(defaultValue, fallBackName) {\r\n return {\r\n fb: fallBackName,\r\n set: _stringToBoolOrDefault,\r\n v: !!defaultValue\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance that will validate that the user\r\n * provided value is a function.\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfFunc(defaultValue) {\r\n return {\r\n isVal: isFunction,\r\n v: defaultValue || null\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance that will validate that the user\r\n * provided value is a function.\r\n * @param defaultValue - The default string value to apply it not provided or it's not valid, defaults to an empty string\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfString(defaultValue) {\r\n return {\r\n isVal: isString,\r\n v: asString(defaultValue || STR_EMPTY)\r\n };\r\n}\r\n/**\r\n * Helper which returns an IConfigDefaultCheck instance identifying that value associated with this property\r\n * should not have it's properties converted into a dynamic config properties.\r\n * @param defaultValue - The default value to apply it not provided or it's not valid\r\n * @returns a new IConfigDefaultCheck structure\r\n */\r\nexport function cfgDfBlockPropValue(defaultValue) {\r\n return {\r\n blkVal: true,\r\n v: defaultValue\r\n };\r\n}\r\n//# sourceMappingURL=ConfigDefaultHelpers.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { asString, isArray, isDefined, isNullOrUndefined, isObject, isPlainObject, isUndefined, objForEachKey, objHasOwn } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nfunction _isConfigDefaults(value) {\r\n return (value && isObject(value) && (value.isVal || value.fb || objHasOwn(value, \"v\") || objHasOwn(value, \"mrg\") || objHasOwn(value, \"ref\") || value.set));\r\n}\r\nfunction _getDefault(dynamicHandler, theConfig, cfgDefaults) {\r\n var defValue;\r\n var isDefaultValid = cfgDefaults.dfVal || isDefined;\r\n // There is a fallback config key so try and grab that first\r\n if (theConfig && cfgDefaults.fb) {\r\n var fallbacks = cfgDefaults.fb;\r\n if (!isArray(fallbacks)) {\r\n fallbacks = [fallbacks];\r\n }\r\n for (var lp = 0; lp < fallbacks[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n var fallback = fallbacks[lp];\r\n var fbValue = theConfig[fallback];\r\n if (isDefaultValid(fbValue)) {\r\n defValue = fbValue;\r\n }\r\n else if (dynamicHandler) {\r\n // Needed to ensure that the fallback value (and potentially) new field is also dynamic even if null/undefined\r\n fbValue = dynamicHandler.cfg[fallback];\r\n if (isDefaultValid(fbValue)) {\r\n defValue = fbValue;\r\n }\r\n // Needed to ensure that the fallback value (and potentially) new field is also dynamic even if null/undefined\r\n dynamicHandler.set(dynamicHandler.cfg, asString(fallback), fbValue);\r\n }\r\n if (isDefaultValid(defValue)) {\r\n // We have a valid default so break out of the look\r\n break;\r\n }\r\n }\r\n }\r\n // If the value is still not defined and we have a default value then use that\r\n if (!isDefaultValid(defValue) && isDefaultValid(cfgDefaults.v)) {\r\n defValue = cfgDefaults.v;\r\n }\r\n return defValue;\r\n}\r\n/**\r\n * Recursively resolve the default value\r\n * @param dynamicHandler\r\n * @param theConfig\r\n * @param cfgDefaults\r\n * @returns\r\n */\r\nfunction _resolveDefaultValue(dynamicHandler, theConfig, cfgDefaults) {\r\n var theValue = cfgDefaults;\r\n if (cfgDefaults && _isConfigDefaults(cfgDefaults)) {\r\n theValue = _getDefault(dynamicHandler, theConfig, cfgDefaults);\r\n }\r\n if (theValue) {\r\n if (_isConfigDefaults(theValue)) {\r\n theValue = _resolveDefaultValue(dynamicHandler, theConfig, theValue);\r\n }\r\n var newValue_1;\r\n if (isArray(theValue)) {\r\n newValue_1 = [];\r\n newValue_1[_DYN_LENGTH /* @min:%2elength */] = theValue[_DYN_LENGTH /* @min:%2elength */];\r\n }\r\n else if (isPlainObject(theValue)) {\r\n newValue_1 = {};\r\n }\r\n if (newValue_1) {\r\n objForEachKey(theValue, function (key, value) {\r\n if (value && _isConfigDefaults(value)) {\r\n value = _resolveDefaultValue(dynamicHandler, theConfig, value);\r\n }\r\n newValue_1[key] = value;\r\n });\r\n theValue = newValue_1;\r\n }\r\n }\r\n return theValue;\r\n}\r\n/**\r\n * Applies the default value on the config property and makes sure that it's dynamic\r\n * @param theConfig\r\n * @param name\r\n * @param defaultValue\r\n */\r\nexport function _applyDefaultValue(dynamicHandler, theConfig, name, defaultValue) {\r\n // Resolve the initial config value from the provided value or use the defined default\r\n var isValid;\r\n var setFn;\r\n var defValue;\r\n var cfgDefaults = defaultValue;\r\n var mergeDf;\r\n var reference;\r\n var readOnly;\r\n var blkDynamicValue;\r\n if (_isConfigDefaults(cfgDefaults)) {\r\n // looks like a IConfigDefault\r\n isValid = cfgDefaults.isVal;\r\n setFn = cfgDefaults.set;\r\n readOnly = cfgDefaults.rdOnly;\r\n blkDynamicValue = cfgDefaults.blkVal;\r\n mergeDf = cfgDefaults.mrg;\r\n reference = cfgDefaults.ref;\r\n if (!reference && isUndefined(reference)) {\r\n reference = !!mergeDf;\r\n }\r\n defValue = _getDefault(dynamicHandler, theConfig, cfgDefaults);\r\n }\r\n else {\r\n defValue = defaultValue;\r\n }\r\n if (blkDynamicValue) {\r\n // Mark the property so that any value assigned will be blocked from conversion, we need to do this\r\n // before assigning or fetching the value to ensure it's not converted\r\n dynamicHandler.blkVal(theConfig, name);\r\n }\r\n // Set the value to the default value;\r\n var theValue;\r\n var usingDefault = true;\r\n var cfgValue = theConfig[name];\r\n // try and get and user provided values\r\n if (cfgValue || !isNullOrUndefined(cfgValue)) {\r\n // Use the defined theConfig[name] value\r\n theValue = cfgValue;\r\n usingDefault = false;\r\n // The values are different and we have a special default value check, which is used to\r\n // override config values like empty strings to continue using the default\r\n if (isValid && theValue !== defValue && !isValid(theValue)) {\r\n theValue = defValue;\r\n usingDefault = true;\r\n }\r\n if (setFn) {\r\n theValue = setFn(theValue, defValue, theConfig);\r\n usingDefault = theValue === defValue;\r\n }\r\n }\r\n if (!usingDefault) {\r\n if (isPlainObject(theValue) || isArray(defValue)) {\r\n // we are using the user supplied value and it's an object\r\n if (mergeDf && defValue && (isPlainObject(defValue) || isArray(defValue))) {\r\n // Resolve/apply the defaults\r\n objForEachKey(defValue, function (dfName, dfValue) {\r\n // Sets the value and makes it dynamic (if it doesn't already exist)\r\n _applyDefaultValue(dynamicHandler, theValue, dfName, dfValue);\r\n });\r\n }\r\n }\r\n }\r\n else if (defValue) {\r\n // Just resolve the default\r\n theValue = _resolveDefaultValue(dynamicHandler, theConfig, defValue);\r\n }\r\n else {\r\n theValue = defValue;\r\n }\r\n // if (theValue && usingDefault && (isPlainObject(theValue) || isArray(theValue))) {\r\n // theValue = _cfgDeepCopy(theValue);\r\n // }\r\n // Needed to ensure that the (potentially) new field is dynamic even if null/undefined\r\n dynamicHandler.set(theConfig, name, theValue);\r\n if (reference) {\r\n dynamicHandler.ref(theConfig, name);\r\n }\r\n if (readOnly) {\r\n dynamicHandler.rdOnly(theConfig, name);\r\n }\r\n}\r\n//# sourceMappingURL=ConfigDefaults.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { isArray, isPlainObject, objForEachKey, symbolFor, throwTypeError } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\n// Using Symbol.for so that if the same symbol was already created it would be returned\r\n// To handle multiple instances using potentially different versions we are not using\r\n// createUniqueNamespace()\r\nexport var CFG_HANDLER_LINK = symbolFor(\"[[ai_dynCfg_1]]\");\r\n/**\r\n * @internal\r\n * @ignore\r\n * The symbol to tag objects / arrays with if they should not be converted\r\n */\r\nvar BLOCK_DYNAMIC = symbolFor(\"[[ai_blkDynCfg_1]]\");\r\n/**\r\n * @internal\r\n * @ignore\r\n * The symbol to tag objects to indicate that when included into the configuration that\r\n * they should be converted into a trackable dynamic object.\r\n */\r\nvar FORCE_DYNAMIC = symbolFor(\"[[ai_frcDynCfg_1]]\");\r\nexport function _cfgDeepCopy(source) {\r\n if (source) {\r\n var target_1;\r\n if (isArray(source)) {\r\n target_1 = [];\r\n target_1[_DYN_LENGTH /* @min:%2elength */] = source[_DYN_LENGTH /* @min:%2elength */];\r\n }\r\n else if (isPlainObject(source)) {\r\n target_1 = {};\r\n }\r\n if (target_1) {\r\n // Copying index values by property name as the extensionConfig can be an array or object\r\n objForEachKey(source, function (key, value) {\r\n // Perform a deep copy of the object\r\n target_1[key] = _cfgDeepCopy(value);\r\n });\r\n return target_1;\r\n }\r\n }\r\n return source;\r\n}\r\n/**\r\n * @internal\r\n * Get the dynamic config handler if the value is already dynamic\r\n * @returns\r\n */\r\nexport function getDynamicConfigHandler(value) {\r\n if (value) {\r\n var handler = value[CFG_HANDLER_LINK] || value;\r\n if (handler.cfg && (handler.cfg === value || handler.cfg[CFG_HANDLER_LINK] === handler)) {\r\n return handler;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Mark the provided value so that if it's included into the configuration it will NOT have\r\n * its properties converted into a dynamic (reactive) object. If the object is not a plain object\r\n * or an array (ie. a class) this function has not affect as only Objects and Arrays are converted\r\n * into dynamic objects in the dynamic configuration.\r\n *\r\n * When you have tagged a value as both {@link forceDynamicConversion} and blocked force will take precedence.\r\n *\r\n * You should only need to use this function, if you are creating dynamic \"classes\" from objects\r\n * which confirm to the require interface. A common case for this is during unit testing where it's\r\n * easier to create mock extensions.\r\n *\r\n * If `value` is falsy (null / undefined / 0 / empty string etc) it will not be tagged and\r\n * if there is an exception adding the property to the value (because its frozen etc) the\r\n * exception will be swallowed\r\n *\r\n * @example\r\n * ```ts\r\n * // This is a valid \"extension\", but it is technically an object\r\n * // So when included in the config.extensions it WILL be cloned and then\r\n * // converted into a dynamic object, where all of its properties will become\r\n * // get/set object properties and will be tracked. While this WILL still\r\n * // function, when attempt to use a mocking framework on top of this the\r\n * // functions are now technically get accessors which return a function\r\n * // and this can cause some mocking frameworks to fail.\r\n * let mockChannel = {\r\n * pause: () => { },\r\n* resume: () => { },\r\n* teardown: () => { },\r\n* flush: (async: any, callBack: any) => { },\r\n* processTelemetry: (env: any) => { },\r\n* setNextPlugin: (next: any) => { },\r\n* initialize: (config: any, core: any, extensions: any) => { },\r\n* identifier: \"testChannel\",\r\n* priority: 1003\r\n* };\r\n * ```\r\n * @param value - The object that you want to block from being converted into a\r\n * trackable dynamic object\r\n * @returns The original value\r\n */\r\nexport function blockDynamicConversion(value) {\r\n if (value && (isPlainObject(value) || isArray(value))) {\r\n try {\r\n value[BLOCK_DYNAMIC] = true;\r\n }\r\n catch (e) {\r\n // Don't throw for this case as it's an ask only\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * This is the reverse case of {@link blockDynamicConversion} in that this will tag an\r\n * object to indicate that it should always be converted into a dynamic trackable object\r\n * even when not an object or array. So all properties of this object will become\r\n * get / set accessor functions.\r\n *\r\n * When you have tagged a value as both {@link forceDynamicConversion} and blocked force will take precedence.\r\n *\r\n * If `value` is falsy (null / undefined / 0 / empty string etc) it will not be tagged and\r\n * if there is an exception adding the property to the value (because its frozen etc) the\r\n * exception will be swallowed.\r\n * @param value - The object that should be tagged and converted if included into a dynamic\r\n * configuration.\r\n * @returns The original value\r\n */\r\nexport function forceDynamicConversion(value) {\r\n if (value) {\r\n try {\r\n value[FORCE_DYNAMIC] = true;\r\n }\r\n catch (e) {\r\n // Don't throw for this case as it's an ask only\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * @internal\r\n * @ignore\r\n * Helper function to check whether an object can or should be converted into a dynamic\r\n * object.\r\n * @param value - The object to check whether it should be converted\r\n * @returns `true` if the value should be converted otherwise `false`.\r\n */\r\nexport function _canMakeDynamic(getFunc, state, value) {\r\n var result = false;\r\n // Object must exist and be truthy\r\n if (value && !getFunc[state.blkVal]) {\r\n // Tagged as always convert\r\n result = value[FORCE_DYNAMIC];\r\n // Check that it's not explicitly tagged as blocked\r\n if (!result && !value[BLOCK_DYNAMIC]) {\r\n // Only convert plain objects or arrays by default\r\n result = isPlainObject(value) || isArray(value);\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Throws an invalid access exception\r\n * @param message - The message to include in the exception\r\n */\r\nexport function throwInvalidAccess(message) {\r\n throwTypeError(\"InvalidAccess:\" + message);\r\n}\r\n//# sourceMappingURL=DynamicSupport.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, arrIndexOf, dumpObj, isArray, objDefine, objDefineProp, objForEachKey, objGetOwnPropertyDescriptor } from \"@nevware21/ts-utils\";\r\nimport { UNDEFINED_VALUE } from \"../JavaScriptSDK/InternalConstants\";\r\nimport { _DYN_APPLY, _DYN_LOGGER, _DYN_PUSH, _DYN_SPLICE, _DYN_THROW_INTERNAL } from \"../__DynamicConstants\";\r\nimport { CFG_HANDLER_LINK, _canMakeDynamic, blockDynamicConversion, throwInvalidAccess } from \"./DynamicSupport\";\r\nvar arrayMethodsToPatch = [\r\n \"push\",\r\n \"pop\",\r\n \"shift\",\r\n \"unshift\",\r\n \"splice\"\r\n];\r\nexport var _throwDynamicError = function (logger, name, desc, e) {\r\n logger && logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](3 /* eLoggingSeverity.DEBUG */, 108 /* _eInternalMessageId.DynamicConfigException */, \"\".concat(desc, \" [\").concat(name, \"] failed - \") + dumpObj(e));\r\n};\r\nfunction _patchArray(state, target, name) {\r\n if (isArray(target)) {\r\n // Monkey Patch the methods that might change the array\r\n arrForEach(arrayMethodsToPatch, function (method) {\r\n var orgMethod = target[method];\r\n target[method] = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var result = orgMethod[_DYN_APPLY /* @min:%2eapply */](this, args);\r\n // items may be added, removed or moved so need to make some new dynamic properties\r\n _makeDynamicObject(state, target, name, \"Patching\");\r\n return result;\r\n };\r\n });\r\n }\r\n}\r\nfunction _getOwnPropGetter(target, name) {\r\n var propDesc = objGetOwnPropertyDescriptor(target, name);\r\n return propDesc && propDesc.get;\r\n}\r\nfunction _createDynamicProperty(state, theConfig, name, value) {\r\n // Does not appear to be dynamic so lets make it so\r\n var detail = {\r\n n: name,\r\n h: [],\r\n trk: function (handler) {\r\n if (handler && handler.fn) {\r\n if (arrIndexOf(detail.h, handler) === -1) {\r\n // Add this handler to the collection that should be notified when the value changes\r\n detail.h[_DYN_PUSH /* @min:%2epush */](handler);\r\n }\r\n state.trk(handler, detail);\r\n }\r\n },\r\n clr: function (handler) {\r\n var idx = arrIndexOf(detail.h, handler);\r\n if (idx !== -1) {\r\n detail.h[_DYN_SPLICE /* @min:%2esplice */](idx, 1);\r\n }\r\n }\r\n };\r\n // Flag to optimize lookup response time by avoiding additional function calls\r\n var checkDynamic = true;\r\n var isObjectOrArray = false;\r\n function _getProperty() {\r\n if (checkDynamic) {\r\n isObjectOrArray = isObjectOrArray || _canMakeDynamic(_getProperty, state, value);\r\n // Make sure that if it's an object that we make it dynamic\r\n if (value && !value[CFG_HANDLER_LINK] && isObjectOrArray) {\r\n // It doesn't look like it's already dynamic so lets make sure it's converted the object into a dynamic Config as well\r\n value = _makeDynamicObject(state, value, name, \"Converting\");\r\n }\r\n // If it needed to be converted it now has been\r\n checkDynamic = false;\r\n }\r\n // If there is an active handler then add it to the tracking set of handlers\r\n var activeHandler = state.act;\r\n if (activeHandler) {\r\n detail.trk(activeHandler);\r\n }\r\n return value;\r\n }\r\n // Tag this getter as our dynamic property and provide shortcut for notifying a change\r\n _getProperty[state.prop] = {\r\n chng: function () {\r\n state.add(detail);\r\n }\r\n };\r\n function _setProperty(newValue) {\r\n if (value !== newValue) {\r\n if (!!_getProperty[state.ro] && !state.upd) {\r\n // field is marked as readonly so return false\r\n throwInvalidAccess(\"[\" + name + \"] is read-only:\" + dumpObj(theConfig));\r\n }\r\n if (checkDynamic) {\r\n isObjectOrArray = isObjectOrArray || _canMakeDynamic(_getProperty, state, value);\r\n checkDynamic = false;\r\n }\r\n // The value must be a plain object or an array to enforce the reference (in-place updates)\r\n var isReferenced = isObjectOrArray && _getProperty[state.rf];\r\n if (isObjectOrArray) {\r\n // We are about to replace a plain object or an array\r\n if (isReferenced) {\r\n // Reassign the properties from the current value to the same properties from the newValue\r\n // This will set properties not in the newValue to undefined\r\n objForEachKey(value, function (key) {\r\n value[key] = newValue ? newValue[key] : UNDEFINED_VALUE;\r\n });\r\n // Now assign / re-assign value with all of the keys from newValue\r\n try {\r\n objForEachKey(newValue, function (key, theValue) {\r\n _setDynamicProperty(state, value, key, theValue);\r\n });\r\n // Now drop newValue so when we assign value later it keeps the existing reference\r\n newValue = value;\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, \"Assigning\", e);\r\n // Mark as not an object or array so we don't try and do this again\r\n isObjectOrArray = false;\r\n }\r\n }\r\n else if (value && value[CFG_HANDLER_LINK]) {\r\n // As we are replacing the value, if it's already dynamic then we need to notify the listeners\r\n // for every property it has already\r\n objForEachKey(value, function (key) {\r\n // Check if the value is dynamic\r\n var getter = _getOwnPropGetter(value, key);\r\n if (getter) {\r\n // And if it is tell it's listeners that the value has changed\r\n var valueState = getter[state.prop];\r\n valueState && valueState.chng();\r\n }\r\n });\r\n }\r\n }\r\n if (newValue !== value) {\r\n var newIsObjectOrArray = newValue && _canMakeDynamic(_getProperty, state, newValue);\r\n if (!isReferenced && newIsObjectOrArray) {\r\n // As the newValue is an object/array lets preemptively make it dynamic\r\n newValue = _makeDynamicObject(state, newValue, name, \"Converting\");\r\n }\r\n // Now assign the internal \"value\" to the newValue\r\n value = newValue;\r\n isObjectOrArray = newIsObjectOrArray;\r\n }\r\n // Cause any listeners to be scheduled for notification\r\n state.add(detail);\r\n }\r\n }\r\n objDefine(theConfig, detail.n, { g: _getProperty, s: _setProperty });\r\n}\r\nexport function _setDynamicProperty(state, target, name, value) {\r\n if (target) {\r\n // To be a dynamic property it needs to have a get function\r\n var getter = _getOwnPropGetter(target, name);\r\n var isDynamic = getter && !!getter[state.prop];\r\n if (!isDynamic) {\r\n _createDynamicProperty(state, target, name, value);\r\n }\r\n else {\r\n // Looks like it's already dynamic just assign the new value\r\n target[name] = value;\r\n }\r\n }\r\n return target;\r\n}\r\nexport function _setDynamicPropertyState(state, target, name, flags) {\r\n if (target) {\r\n // To be a dynamic property it needs to have a get function\r\n var getter = _getOwnPropGetter(target, name);\r\n var isDynamic = getter && !!getter[state.prop];\r\n var inPlace = flags && flags[0 /* _eSetDynamicPropertyFlags.inPlace */];\r\n var rdOnly = flags && flags[1 /* _eSetDynamicPropertyFlags.readOnly */];\r\n var blkProp = flags && flags[2 /* _eSetDynamicPropertyFlags.blockDynamicProperty */];\r\n if (!isDynamic) {\r\n if (blkProp) {\r\n try {\r\n // Attempt to mark the target as blocked from conversion\r\n blockDynamicConversion(target);\r\n }\r\n catch (e) {\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, \"Blocking\", e);\r\n }\r\n }\r\n try {\r\n // Make sure it's dynamic so that we can tag the property as per the state\r\n _setDynamicProperty(state, target, name, target[name]);\r\n getter = _getOwnPropGetter(target, name);\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, \"State\", e);\r\n }\r\n }\r\n // Assign the optional flags if true\r\n if (inPlace) {\r\n getter[state.rf] = inPlace;\r\n }\r\n if (rdOnly) {\r\n getter[state.ro] = rdOnly;\r\n }\r\n if (blkProp) {\r\n getter[state.blkVal] = true;\r\n }\r\n }\r\n return target;\r\n}\r\nexport function _makeDynamicObject(state, target, name, desc) {\r\n try {\r\n // Assign target with new value properties (converting into dynamic properties in the process)\r\n objForEachKey(target, function (key, value) {\r\n // Assign and/or make the property dynamic\r\n _setDynamicProperty(state, target, key, value);\r\n });\r\n if (!target[CFG_HANDLER_LINK]) {\r\n // Link the config back to the dynamic config details\r\n objDefineProp(target, CFG_HANDLER_LINK, {\r\n get: function () {\r\n return state.hdlr;\r\n }\r\n });\r\n _patchArray(state, target, name);\r\n }\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, desc, e);\r\n }\r\n return target;\r\n}\r\n//# sourceMappingURL=DynamicProperty.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, createCustomError, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nvar aggregationErrorType;\r\n/**\r\n * Throws an Aggregation Error which includes all of the errors that led to this error occurring\r\n * @param message - The message describing the aggregation error (the sourceError details are added to this)\r\n * @param sourceErrors - An array of the errors that caused this situation\r\n */\r\nexport function throwAggregationError(message, sourceErrors) {\r\n if (!aggregationErrorType) {\r\n aggregationErrorType = createCustomError(\"AggregationError\", function (self, args) {\r\n if (args[_DYN_LENGTH /* @min:%2elength */] > 1) {\r\n // Save the provided errors\r\n self.errors = args[1];\r\n }\r\n });\r\n }\r\n var theMessage = message || \"One or more errors occurred.\";\r\n arrForEach(sourceErrors, function (srcError, idx) {\r\n theMessage += \"\\n\".concat(idx, \" > \").concat(dumpObj(srcError));\r\n });\r\n throw new aggregationErrorType(theMessage, sourceErrors || []);\r\n}\r\n//# sourceMappingURL=AggregationError.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, arrIndexOf, dumpObj, newSymbol, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { throwAggregationError } from \"../JavaScriptSDK/AggregationError\";\r\nimport { _DYN_CANCEL, _DYN_LENGTH, _DYN_LOGGER, _DYN_PUSH, _DYN_THROW_INTERNAL } from \"../__DynamicConstants\";\r\nvar symPrefix = \"[[ai_\";\r\nvar symPostfix = \"]]\";\r\nexport function _createState(cfgHandler) {\r\n var dynamicPropertySymbol = newSymbol(symPrefix + \"get\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyReadOnly = newSymbol(symPrefix + \"ro\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyReferenced = newSymbol(symPrefix + \"rf\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyBlockValue = newSymbol(symPrefix + \"blkVal\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyDetail = newSymbol(symPrefix + \"dtl\" + cfgHandler.uid + symPostfix);\r\n var _waitingHandlers = null;\r\n var _watcherTimer = null;\r\n var theState;\r\n function _useHandler(activeHandler, callback) {\r\n var prevWatcher = theState.act;\r\n try {\r\n theState.act = activeHandler;\r\n if (activeHandler && activeHandler[dynamicPropertyDetail]) {\r\n // Clear out the previously tracked details for this handler, so that access are re-evaluated\r\n arrForEach(activeHandler[dynamicPropertyDetail], function (detail) {\r\n detail.clr(activeHandler);\r\n });\r\n activeHandler[dynamicPropertyDetail] = [];\r\n }\r\n callback({\r\n cfg: cfgHandler.cfg,\r\n set: cfgHandler.set.bind(cfgHandler),\r\n setDf: cfgHandler.setDf.bind(cfgHandler),\r\n ref: cfgHandler.ref.bind(cfgHandler),\r\n rdOnly: cfgHandler.rdOnly.bind(cfgHandler)\r\n });\r\n }\r\n catch (e) {\r\n var logger = cfgHandler[_DYN_LOGGER /* @min:%2elogger */];\r\n if (logger) {\r\n // Don't let one individual failure break everyone\r\n logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](1 /* eLoggingSeverity.CRITICAL */, 107 /* _eInternalMessageId.ConfigWatcherException */, dumpObj(e));\r\n }\r\n // Re-throw the exception so that any true \"error\" is reported back to the called\r\n throw e;\r\n }\r\n finally {\r\n theState.act = prevWatcher || null;\r\n }\r\n }\r\n function _notifyWatchers() {\r\n if (_waitingHandlers) {\r\n var notifyHandlers = _waitingHandlers;\r\n _waitingHandlers = null;\r\n // Stop any timer as we are running them now anyway\r\n _watcherTimer && _watcherTimer[_DYN_CANCEL /* @min:%2ecancel */]();\r\n _watcherTimer = null;\r\n var watcherFailures_1 = [];\r\n // Now run the handlers\r\n arrForEach(notifyHandlers, function (handler) {\r\n if (handler) {\r\n if (handler[dynamicPropertyDetail]) {\r\n arrForEach(handler[dynamicPropertyDetail], function (detail) {\r\n // Clear out this handler from previously tracked details, so that access are re-evaluated\r\n detail.clr(handler);\r\n });\r\n handler[dynamicPropertyDetail] = null;\r\n }\r\n // The handler may have self removed as part of another handler so re-check\r\n if (handler.fn) {\r\n try {\r\n _useHandler(handler, handler.fn);\r\n }\r\n catch (e) {\r\n // Don't let a single failing watcher cause other watches to fail\r\n watcherFailures_1[_DYN_PUSH /* @min:%2epush */](e);\r\n }\r\n }\r\n }\r\n });\r\n // During notification we may have had additional updates -- so notify those updates as well\r\n if (_waitingHandlers) {\r\n try {\r\n _notifyWatchers();\r\n }\r\n catch (e) {\r\n watcherFailures_1[_DYN_PUSH /* @min:%2epush */](e);\r\n }\r\n }\r\n if (watcherFailures_1[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n throwAggregationError(\"Watcher error(s): \", watcherFailures_1);\r\n }\r\n }\r\n }\r\n function _addWatcher(detail) {\r\n if (detail && detail.h[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n if (!_waitingHandlers) {\r\n _waitingHandlers = [];\r\n }\r\n if (!_watcherTimer) {\r\n _watcherTimer = scheduleTimeout(function () {\r\n _watcherTimer = null;\r\n _notifyWatchers();\r\n }, 0);\r\n }\r\n // Add all of the handlers for this detail (if not already present) - using normal for-loop for performance\r\n for (var idx = 0; idx < detail.h[_DYN_LENGTH /* @min:%2elength */]; idx++) {\r\n var handler = detail.h[idx];\r\n // Add this handler to the collection of handlers to re-execute\r\n if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {\r\n _waitingHandlers[_DYN_PUSH /* @min:%2epush */](handler);\r\n }\r\n }\r\n }\r\n }\r\n function _trackHandler(handler, detail) {\r\n if (handler) {\r\n var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];\r\n if (arrIndexOf(details, detail) === -1) {\r\n // If this detail is not already listed as tracked then add it so that we re-evaluate it's usage\r\n details[_DYN_PUSH /* @min:%2epush */](detail);\r\n }\r\n }\r\n }\r\n theState = {\r\n prop: dynamicPropertySymbol,\r\n ro: dynamicPropertyReadOnly,\r\n rf: dynamicPropertyReferenced,\r\n blkVal: dynamicPropertyBlockValue,\r\n hdlr: cfgHandler,\r\n add: _addWatcher,\r\n notify: _notifyWatchers,\r\n use: _useHandler,\r\n trk: _trackHandler\r\n };\r\n return theState;\r\n}\r\n//# sourceMappingURL=DynamicState.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dumpObj, isUndefined, objDefine, objForEachKey } from \"@nevware21/ts-utils\";\r\nimport { createUniqueNamespace } from \"../JavaScriptSDK/DataCacheHelper\";\r\nimport { STR_NOT_DYNAMIC_ERROR } from \"../JavaScriptSDK/InternalConstants\";\r\nimport { _DYN_THROW_INTERNAL, _DYN_WARN_TO_CONSOLE, _DYN_WATCH } from \"../__DynamicConstants\";\r\nimport { _applyDefaultValue } from \"./ConfigDefaults\";\r\nimport { _makeDynamicObject, _setDynamicProperty, _setDynamicPropertyState, _throwDynamicError } from \"./DynamicProperty\";\r\nimport { _createState } from \"./DynamicState\";\r\nimport { CFG_HANDLER_LINK, _cfgDeepCopy, getDynamicConfigHandler, throwInvalidAccess } from \"./DynamicSupport\";\r\n/**\r\n * Identifies a function which will be re-called whenever any of it's accessed configuration values\r\n * change.\r\n * @param configHandler - The callback that will be called for the initial request and then whenever any\r\n * accessed configuration changes are identified.\r\n */\r\nfunction _createAndUseHandler(state, configHandler) {\r\n var handler = {\r\n fn: configHandler,\r\n rm: function () {\r\n // Clear all references to the handler so it can be garbage collected\r\n // This will also cause this handler to never get called and eventually removed\r\n handler.fn = null;\r\n state = null;\r\n configHandler = null;\r\n }\r\n };\r\n objDefine(handler, \"toJSON\", { v: function () { return \"WatcherHandler\" + (handler.fn ? \"\" : \"[X]\"); } });\r\n state.use(handler, configHandler);\r\n return handler;\r\n}\r\n/**\r\n * Creates the dynamic config handler and associates with the target config as the root object\r\n * @param target - The config that you want to be root of the dynamic config\r\n * @param inPlace - Should the passed config be converted in-place or a new proxy returned\r\n * @returns The existing dynamic handler or a new instance with the provided config values\r\n */\r\nfunction _createDynamicHandler(logger, target, inPlace) {\r\n var dynamicHandler = getDynamicConfigHandler(target);\r\n if (dynamicHandler) {\r\n // The passed config is already dynamic so return it's tracker\r\n return dynamicHandler;\r\n }\r\n var uid = createUniqueNamespace(\"dyncfg\", true);\r\n var newTarget = (target && inPlace !== false) ? target : _cfgDeepCopy(target);\r\n var theState;\r\n function _notifyWatchers() {\r\n theState.notify();\r\n }\r\n function _setValue(target, name, value) {\r\n try {\r\n target = _setDynamicProperty(theState, target, name, value);\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError(logger, name, \"Setting value\", e);\r\n }\r\n return target[name];\r\n }\r\n function _watch(configHandler) {\r\n return _createAndUseHandler(theState, configHandler);\r\n }\r\n function _block(configHandler, allowUpdate) {\r\n theState.use(null, function (details) {\r\n var prevUpd = theState.upd;\r\n try {\r\n if (!isUndefined(allowUpdate)) {\r\n theState.upd = allowUpdate;\r\n }\r\n configHandler(details);\r\n }\r\n finally {\r\n theState.upd = prevUpd;\r\n }\r\n });\r\n }\r\n function _ref(target, name) {\r\n var _a;\r\n // Make sure it's dynamic and mark as referenced with it's current value\r\n return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[0 /* _eSetDynamicPropertyFlags.inPlace */] = true, _a))[name];\r\n }\r\n function _rdOnly(target, name) {\r\n var _a;\r\n // Make sure it's dynamic and mark as readonly with it's current value\r\n return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[1 /* _eSetDynamicPropertyFlags.readOnly */] = true, _a))[name];\r\n }\r\n function _blkPropValue(target, name) {\r\n var _a;\r\n // Make sure it's dynamic and mark as readonly with it's current value\r\n return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[2 /* _eSetDynamicPropertyFlags.blockDynamicProperty */] = true, _a))[name];\r\n }\r\n function _applyDefaults(theConfig, defaultValues) {\r\n if (defaultValues) {\r\n // Resolve/apply the defaults\r\n objForEachKey(defaultValues, function (name, value) {\r\n // Sets the value and makes it dynamic (if it doesn't already exist)\r\n _applyDefaultValue(cfgHandler, theConfig, name, value);\r\n });\r\n }\r\n return theConfig;\r\n }\r\n var cfgHandler = {\r\n uid: null,\r\n cfg: newTarget,\r\n logger: logger,\r\n notify: _notifyWatchers,\r\n set: _setValue,\r\n setDf: _applyDefaults,\r\n watch: _watch,\r\n ref: _ref,\r\n rdOnly: _rdOnly,\r\n blkVal: _blkPropValue,\r\n _block: _block\r\n };\r\n objDefine(cfgHandler, \"uid\", {\r\n c: false,\r\n e: false,\r\n w: false,\r\n v: uid\r\n });\r\n theState = _createState(cfgHandler);\r\n // Setup tracking for all defined default keys\r\n _makeDynamicObject(theState, newTarget, \"config\", \"Creating\");\r\n return cfgHandler;\r\n}\r\n/**\r\n * Log an invalid access message to the console\r\n */\r\nfunction _logInvalidAccess(logger, message) {\r\n if (logger) {\r\n logger[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */](message);\r\n logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](2 /* eLoggingSeverity.WARNING */, 108 /* _eInternalMessageId.DynamicConfigException */, message);\r\n }\r\n else {\r\n // We don't have a logger so just throw an exception\r\n throwInvalidAccess(message);\r\n }\r\n}\r\n/**\r\n * Create or return a dynamic version of the passed config, if it is not already dynamic\r\n * @param config - The config to be converted into a dynamic config\r\n * @param defaultConfig - The default values to apply on the config if the properties don't already exist\r\n * @param inPlace - Should the config be converted in-place into a dynamic config or a new instance returned, defaults to true\r\n * @returns The dynamic config handler for the config (whether new or existing)\r\n */\r\nexport function createDynamicConfig(config, defaultConfig, logger, inPlace) {\r\n var dynamicHandler = _createDynamicHandler(logger, config || {}, inPlace);\r\n if (defaultConfig) {\r\n dynamicHandler.setDf(dynamicHandler.cfg, defaultConfig);\r\n }\r\n return dynamicHandler;\r\n}\r\n/**\r\n * Watch and track changes for accesses to the current config, the provided config MUST already be\r\n * a dynamic config or a child accessed via the dynamic config\r\n * @param logger - The logger instance to use if there is no existing handler\r\n * @returns A watcher handler instance that can be used to remove itself when being unloaded\r\n * @throws TypeError if the provided config is not a dynamic config instance\r\n */\r\nexport function onConfigChange(config, configHandler, logger) {\r\n var handler = config[CFG_HANDLER_LINK] || config;\r\n if (handler.cfg && (handler.cfg === config || handler.cfg[CFG_HANDLER_LINK] === handler)) {\r\n return handler[_DYN_WATCH /* @min:%2ewatch */](configHandler);\r\n }\r\n _logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config));\r\n return createDynamicConfig(config, null, logger)[_DYN_WATCH /* @min:%2ewatch */](configHandler);\r\n}\r\n//# sourceMappingURL=DynamicConfig.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { createEnum, createTypeMap } from \"@nevware21/ts-utils\";\r\n/**\r\n * Create an enum style object which has both the key \\=\\> value and value \\=\\> key mappings\r\n * @param values - The values to populate on the new object\r\n * @returns\r\n */\r\nexport var createEnumStyle = createEnum;\r\n/**\r\n * Create a 2 index map that maps an enum's key and value to the defined map value, X[\"key\"] \\=\\> mapValue and X[0] \\=\\> mapValue.\r\n * Generic values\r\n * - E = the const enum type (typeof eRequestHeaders);\r\n * - V = Identifies the valid values for the keys, this should include both the enum numeric and string key of the type. The\r\n * resulting \"Value\" of each entry identifies the valid values withing the assignments.\r\n * @param values - The values to populate on the new object\r\n * @returns\r\n */\r\nexport var createValueMap = createTypeMap;\r\n//# sourceMappingURL=EnumHelperFuncs.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nvar _a;\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { isFunction, objDefine } from \"@nevware21/ts-utils\";\r\nimport { createDynamicConfig } from \"../Config/DynamicConfig\";\r\nimport { _DYN_CREATE_NEW, _DYN_DIAG_LOG, _DYN_GET_NEXT, _DYN_GET_PROCESS_TEL_CONT2, _DYN_INITIALIZE, _DYN_IS_INITIALIZED, _DYN_PROCESS_NEXT, _DYN_SET_NEXT_PLUGIN, _DYN_TEARDOWN, _DYN_UPDATE, _DYN__DO_TEARDOWN } from \"../__DynamicConstants\";\r\nimport { safeGetLogger } from \"./DiagnosticLogger\";\r\nimport { isNotNullOrUndefined, proxyFunctionAs } from \"./HelperFuncs\";\r\nimport { STR_CORE, STR_EXTENSION_CONFIG, STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nimport { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createProcessTelemetryUpdateContext } from \"./ProcessTelemetryContext\";\r\nimport { createUnloadHandlerContainer } from \"./UnloadHandlerContainer\";\r\nimport { createUnloadHookContainer } from \"./UnloadHookContainer\";\r\nvar strGetPlugin = \"getPlugin\";\r\nvar defaultValues = (_a = {},\r\n _a[STR_EXTENSION_CONFIG] = { isVal: isNotNullOrUndefined, v: {} },\r\n _a);\r\n/**\r\n * BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins\r\n * can avoid implementation the same set of boiler plate code as well as provide a base\r\n * implementation so that new default implementations can be added without breaking all plugins.\r\n */\r\nvar BaseTelemetryPlugin = /** @class */ (function () {\r\n function BaseTelemetryPlugin() {\r\n var _self = this; // Setting _self here as it's used outside of the dynamicProto as well\r\n // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()\r\n var _isinitialized;\r\n var _rootCtx; // Used as the root context, holding the current config and initialized core\r\n var _nextPlugin; // Used for backward compatibility where plugins don't call the main pipeline\r\n var _unloadHandlerContainer;\r\n var _hookContainer;\r\n _initDefaults();\r\n dynamicProto(BaseTelemetryPlugin, _self, function (_self) {\r\n _self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, core, extensions, pluginChain) {\r\n _setDefaults(config, core, pluginChain);\r\n _isinitialized = true;\r\n };\r\n _self[_DYN_TEARDOWN /* @min:%2eteardown */] = function (unloadCtx, unloadState) {\r\n // If this plugin has already been torn down (not operational) or is not initialized (core is not set)\r\n // or the core being used for unload was not the same core used for initialization.\r\n var core = _self[STR_CORE /* @min:%2ecore */];\r\n if (!core || (unloadCtx && core !== unloadCtx[STR_CORE /* @min:%2ecore */]())) {\r\n // Do Nothing as either the plugin is not initialized or was not initialized by the current core\r\n return;\r\n }\r\n var result;\r\n var unloadDone = false;\r\n var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);\r\n var theUnloadState = unloadState || {\r\n reason: 0 /* TelemetryUnloadReason.ManualTeardown */,\r\n isAsync: false\r\n };\r\n function _unloadCallback() {\r\n if (!unloadDone) {\r\n unloadDone = true;\r\n _unloadHandlerContainer.run(theUnloadCtx, unloadState);\r\n _hookContainer.run(theUnloadCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */]());\r\n if (result === true) {\r\n theUnloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);\r\n }\r\n _initDefaults();\r\n }\r\n }\r\n if (!_self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */] || _self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {\r\n _unloadCallback();\r\n }\r\n else {\r\n // Tell the caller that we will be calling processNext()\r\n result = true;\r\n }\r\n return result;\r\n };\r\n _self[_DYN_UPDATE /* @min:%2eupdate */] = function (updateCtx, updateState) {\r\n // If this plugin has already been torn down (not operational) or is not initialized (core is not set)\r\n // or the core being used for unload was not the same core used for initialization.\r\n var core = _self[STR_CORE /* @min:%2ecore */];\r\n if (!core || (updateCtx && core !== updateCtx[STR_CORE /* @min:%2ecore */]())) {\r\n // Do Nothing\r\n return;\r\n }\r\n var result;\r\n var updateDone = false;\r\n var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);\r\n var theUpdateState = updateState || {\r\n reason: 0 /* TelemetryUpdateReason.Unknown */\r\n };\r\n function _updateCallback() {\r\n if (!updateDone) {\r\n updateDone = true;\r\n _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx[_DYN_GET_NEXT /* @min:%2egetNext */]());\r\n }\r\n }\r\n if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {\r\n _updateCallback();\r\n }\r\n else {\r\n result = true;\r\n }\r\n return result;\r\n };\r\n proxyFunctionAs(_self, \"_addUnloadCb\", function () { return _unloadHandlerContainer; }, \"add\");\r\n proxyFunctionAs(_self, \"_addHook\", function () { return _hookContainer; }, \"add\");\r\n objDefine(_self, \"_unloadHooks\", { g: function () { return _hookContainer; } });\r\n });\r\n // These are added after the dynamicProto so that are not moved to the prototype\r\n _self[_DYN_DIAG_LOG /* @min:%2ediagLog */] = function (itemCtx) {\r\n return _getTelCtx(itemCtx)[_DYN_DIAG_LOG /* @min:%2ediagLog */]();\r\n };\r\n _self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = function () {\r\n return _isinitialized;\r\n };\r\n _self.setInitialized = function (isInitialized) {\r\n _isinitialized = isInitialized;\r\n };\r\n // _self.getNextPlugin = () => DO NOT IMPLEMENT\r\n // Sub-classes of this base class *should* not be relying on this value and instead\r\n // should use processNext() function. If you require access to the plugin use the\r\n // IProcessTelemetryContext.getNext().getPlugin() while in the pipeline, Note getNext() may return null.\r\n _self[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */] = function (next) {\r\n _nextPlugin = next;\r\n };\r\n _self[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = function (env, itemCtx) {\r\n if (itemCtx) {\r\n // Normal core execution sequence\r\n itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](env);\r\n }\r\n else if (_nextPlugin && isFunction(_nextPlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */])) {\r\n // Looks like backward compatibility or out of band processing. And as it looks\r\n // like a ITelemetryPlugin or ITelemetryPluginChain, just call processTelemetry\r\n _nextPlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */](env, null);\r\n }\r\n };\r\n _self._getTelCtx = _getTelCtx;\r\n function _getTelCtx(currentCtx) {\r\n if (currentCtx === void 0) { currentCtx = null; }\r\n var itemCtx = currentCtx;\r\n if (!itemCtx) {\r\n var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self[STR_CORE /* @min:%2ecore */]);\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n if (_nextPlugin && _nextPlugin[strGetPlugin]) {\r\n // Looks like a chain object\r\n itemCtx = rootCtx[_DYN_CREATE_NEW /* @min:%2ecreateNew */](null, _nextPlugin[strGetPlugin]);\r\n }\r\n else {\r\n itemCtx = rootCtx[_DYN_CREATE_NEW /* @min:%2ecreateNew */](null, _nextPlugin);\r\n }\r\n }\r\n return itemCtx;\r\n }\r\n function _setDefaults(config, core, pluginChain) {\r\n // Make sure the extensionConfig exists and the config is dynamic\r\n createDynamicConfig(config, defaultValues, safeGetLogger(core));\r\n if (!pluginChain && core) {\r\n // Get the first plugin from the core\r\n pluginChain = core[_DYN_GET_PROCESS_TEL_CONT2 /* @min:%2egetProcessTelContext */]()[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n }\r\n var nextPlugin = _nextPlugin;\r\n if (_nextPlugin && _nextPlugin[strGetPlugin]) {\r\n // If it looks like a proxy/chain then get the plugin\r\n nextPlugin = _nextPlugin[strGetPlugin]();\r\n }\r\n // Support legacy plugins where core was defined as a property\r\n _self[STR_CORE /* @min:%2ecore */] = core;\r\n _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin);\r\n }\r\n function _initDefaults() {\r\n _isinitialized = false;\r\n _self[STR_CORE /* @min:%2ecore */] = null;\r\n _rootCtx = null;\r\n _nextPlugin = null;\r\n _hookContainer = createUnloadHookContainer();\r\n _unloadHandlerContainer = createUnloadHandlerContainer();\r\n }\r\n }\r\n BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and\r\n * therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further\r\n * processTelemetry calls are ignored and it just calls the processNext() with the provided context.\r\n * @param unloadCtx - This is the context that should be used during unloading.\r\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\r\n * @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.\r\n */\r\n BaseTelemetryPlugin.prototype.teardown = function (unloadCtx, unloadState) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return false;\r\n };\r\n /**\r\n * The the plugin should re-evaluate configuration and update any cached configuration settings.\r\n * @param updateCtx - This is the context that should be used during updating.\r\n * @param updateState - The details / state of the update process, it holds details like the current and previous configuration.\r\n * @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.\r\n */\r\n BaseTelemetryPlugin.prototype.update = function (updateCtx, updateState) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Add an unload handler that will be called when the SDK is being unloaded\r\n * @param handler - the handler\r\n */\r\n BaseTelemetryPlugin.prototype._addUnloadCb = function (handler) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Add this hook so that it is automatically removed during unloading\r\n * @param hooks - The single hook or an array of IInstrumentHook objects\r\n */\r\n BaseTelemetryPlugin.prototype._addHook = function (hooks) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return BaseTelemetryPlugin;\r\n}());\r\nexport { BaseTelemetryPlugin };\r\n//# sourceMappingURL=BaseTelemetryPlugin.js.map","var _a, _b;\r\nimport { arrForEach, arrIndexOf, dumpObj, getDocument, getLazy, getNavigator, isArray, isFunction, isNullOrUndefined, isString, isTruthy, isUndefined, objForEachKey, strEndsWith, strIndexOf, strLeft, strSubstring, strTrim, utcNow } from \"@nevware21/ts-utils\";\r\nimport { cfgDfMerge } from \"../Config/ConfigDefaultHelpers\";\r\nimport { createDynamicConfig, onConfigChange } from \"../Config/DynamicConfig\";\r\nimport { _DYN_ENABLED, _DYN_LENGTH, _DYN_LOGGER, _DYN_SPLIT, _DYN_USER_AGENT } from \"../__DynamicConstants\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nimport { getLocation, isIE } from \"./EnvUtils\";\r\nimport { getExceptionName, isNotNullOrUndefined, setValue, strContains } from \"./HelperFuncs\";\r\nimport { STR_DOMAIN, STR_EMPTY, STR_PATH, UNDEFINED_VALUE } from \"./InternalConstants\";\r\nvar strToGMTString = \"toGMTString\";\r\nvar strToUTCString = \"toUTCString\";\r\nvar strCookie = \"cookie\";\r\nvar strExpires = \"expires\";\r\nvar strIsCookieUseDisabled = \"isCookieUseDisabled\";\r\nvar strDisableCookiesUsage = \"disableCookiesUsage\";\r\nvar strConfigCookieMgr = \"_ckMgr\";\r\nvar _supportsCookies = null;\r\nvar _allowUaSameSite = null;\r\nvar _parsedCookieValue = null;\r\nvar _doc;\r\nvar _cookieCache = {};\r\nvar _globalCookieConfig = {};\r\n// // `isCookieUseDisabled` is deprecated, so explicitly casting as a key of IConfiguration to avoid typing error\r\n// // when both isCookieUseDisabled and disableCookiesUsage are used disableCookiesUsage will take precedent, which is\r\n// // why its listed first\r\n/**\r\n * Set the supported dynamic config values as undefined (or an empty object) so that\r\n * any listeners will be informed of any changes.\r\n * Explicitly NOT including the deprecated `isCookieUseDisabled` as we don't want to support\r\n * the v1 deprecated field as dynamic for updates\r\n */\r\nvar rootDefaultConfig = (_a = {\r\n cookieCfg: cfgDfMerge((_b = {},\r\n _b[STR_DOMAIN] = { fb: \"cookieDomain\", dfVal: isNotNullOrUndefined },\r\n _b.path = { fb: \"cookiePath\", dfVal: isNotNullOrUndefined },\r\n _b.enabled = UNDEFINED_VALUE,\r\n _b.ignoreCookies = UNDEFINED_VALUE,\r\n _b.blockedCookies = UNDEFINED_VALUE,\r\n _b)),\r\n cookieDomain: UNDEFINED_VALUE,\r\n cookiePath: UNDEFINED_VALUE\r\n },\r\n _a[strDisableCookiesUsage] = UNDEFINED_VALUE,\r\n _a);\r\nfunction _getDoc() {\r\n !_doc && (_doc = getLazy(function () { return getDocument(); }));\r\n}\r\n/**\r\n * @ignore\r\n * DO NOT USE or export from the module, this is exposed as public to support backward compatibility of previous static utility methods only.\r\n * If you want to manager cookies either use the ICookieMgr available from the core instance via getCookieMgr() or create\r\n * your own instance of the CookieMgr and use that.\r\n * Using this directly for enabling / disabling cookie handling will not only affect your usage but EVERY user of cookies.\r\n * Example, if you are using a shared component that is also using Application Insights you will affect their cookie handling.\r\n * @param logger - The DiagnosticLogger to use for reporting errors.\r\n */\r\nfunction _gblCookieMgr(config, logger) {\r\n // Stash the global instance against the BaseCookieMgr class\r\n var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];\r\n if (!inst) {\r\n // Note: not using the getSetValue() helper as that would require always creating a temporary cookieMgr\r\n // that ultimately is never used\r\n inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);\r\n _globalCookieConfig[strConfigCookieMgr] = inst;\r\n }\r\n return inst;\r\n}\r\nfunction _isMgrEnabled(cookieMgr) {\r\n if (cookieMgr) {\r\n return cookieMgr.isEnabled();\r\n }\r\n return true;\r\n}\r\nfunction _isIgnoredCookie(cookieMgrCfg, name) {\r\n if (name && cookieMgrCfg && isArray(cookieMgrCfg.ignoreCookies)) {\r\n return arrIndexOf(cookieMgrCfg.ignoreCookies, name) !== -1;\r\n }\r\n return false;\r\n}\r\nfunction _isBlockedCookie(cookieMgrCfg, name) {\r\n if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) {\r\n if (arrIndexOf(cookieMgrCfg.blockedCookies, name) !== -1) {\r\n return true;\r\n }\r\n }\r\n return _isIgnoredCookie(cookieMgrCfg, name);\r\n}\r\nfunction _isCfgEnabled(rootConfig, cookieMgrConfig) {\r\n var isCfgEnabled = cookieMgrConfig[_DYN_ENABLED /* @min:%2eenabled */];\r\n if (isNullOrUndefined(isCfgEnabled)) {\r\n // Set the enabled from the provided setting or the legacy root values\r\n var cookieEnabled = void 0;\r\n // This field is deprecated and dynamic updates will not be fully supported\r\n if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {\r\n cookieEnabled = !rootConfig[strIsCookieUseDisabled];\r\n }\r\n // If this value is defined it takes precedent over the above\r\n if (!isUndefined(rootConfig[strDisableCookiesUsage])) {\r\n cookieEnabled = !rootConfig[strDisableCookiesUsage];\r\n }\r\n // Not setting the cookieMgrConfig.enabled as that will update (set) the global dynamic config\r\n // So future \"updates\" then may not be as expected\r\n isCfgEnabled = cookieEnabled;\r\n }\r\n return isCfgEnabled;\r\n}\r\n/**\r\n * Helper to return the ICookieMgr from the core (if not null/undefined) or a default implementation\r\n * associated with the configuration or a legacy default.\r\n * @param core - The AppInsightsCore instance to get the cookie manager from\r\n * @param config - The config to use if the core is not available\r\n * @returns\r\n */\r\nexport function safeGetCookieMgr(core, config) {\r\n var cookieMgr;\r\n if (core) {\r\n // Always returns an instance\r\n cookieMgr = core.getCookieMgr();\r\n }\r\n else if (config) {\r\n var cookieCfg = config.cookieCfg;\r\n if (cookieCfg && cookieCfg[strConfigCookieMgr]) {\r\n cookieMgr = cookieCfg[strConfigCookieMgr];\r\n }\r\n else {\r\n cookieMgr = createCookieMgr(config);\r\n }\r\n }\r\n if (!cookieMgr) {\r\n // Get or initialize the default global (legacy) cookie manager if we couldn't find one\r\n cookieMgr = _gblCookieMgr(config, (core || {})[_DYN_LOGGER /* @min:%2elogger */]);\r\n }\r\n return cookieMgr;\r\n}\r\nexport function createCookieMgr(rootConfig, logger) {\r\n var cookieMgrConfig;\r\n var _path;\r\n var _domain;\r\n var unloadHandler;\r\n // Explicitly checking against false, so that setting to undefined will === true\r\n var _enabled;\r\n var _getCookieFn;\r\n var _setCookieFn;\r\n var _delCookieFn;\r\n // Make sure the root config is dynamic as it may be the global config\r\n rootConfig = createDynamicConfig(rootConfig || _globalCookieConfig, null, logger).cfg;\r\n // Will get recalled if the referenced configuration is changed\r\n unloadHandler = onConfigChange(rootConfig, function (details) {\r\n // Make sure the root config has all of the the defaults to the root config to ensure they are dynamic\r\n details.setDf(details.cfg, rootDefaultConfig);\r\n // Create and apply the defaults to the cookieCfg element\r\n cookieMgrConfig = details.ref(details.cfg, \"cookieCfg\"); // details.setDf(details.cfg.cookieCfg, defaultConfig);\r\n _path = cookieMgrConfig[STR_PATH /* @min:%2epath */] || \"/\";\r\n _domain = cookieMgrConfig[STR_DOMAIN /* @min:%2edomain */];\r\n // Explicitly checking against false, so that setting to undefined will === true\r\n _enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false;\r\n _getCookieFn = cookieMgrConfig.getCookie || _getCookieValue;\r\n _setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;\r\n _delCookieFn = cookieMgrConfig.delCookie || _setCookieValue;\r\n }, logger);\r\n var cookieMgr = {\r\n isEnabled: function () {\r\n var enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false && _enabled && areCookiesSupported(logger);\r\n // Using an indirect lookup for any global cookie manager to support tree shaking for SDK's\r\n // that don't use the \"applicationinsights-core\" version of the default cookie function\r\n var gblManager = _globalCookieConfig[strConfigCookieMgr];\r\n if (enabled && gblManager && cookieMgr !== gblManager) {\r\n // Make sure the GlobalCookie Manager instance (if not this instance) is also enabled.\r\n // As the global (deprecated) functions may have been called (for backward compatibility)\r\n enabled = _isMgrEnabled(gblManager);\r\n }\r\n return enabled;\r\n },\r\n setEnabled: function (value) {\r\n // Explicitly checking against false, so that setting to undefined will === true\r\n _enabled = value !== false;\r\n cookieMgrConfig[_DYN_ENABLED /* @min:%2eenabled */] = value;\r\n },\r\n set: function (name, value, maxAgeSec, domain, path) {\r\n var result = false;\r\n if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) {\r\n var values = {};\r\n var theValue = strTrim(value || STR_EMPTY);\r\n var idx = strIndexOf(theValue, \";\");\r\n if (idx !== -1) {\r\n theValue = strTrim(strLeft(value, idx));\r\n values = _extractParts(strSubstring(value, idx + 1));\r\n }\r\n // Only update domain if not already present (isUndefined) and the value is truthy (not null, undefined or empty string)\r\n setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);\r\n if (!isNullOrUndefined(maxAgeSec)) {\r\n var _isIE = isIE();\r\n if (isUndefined(values[strExpires])) {\r\n var nowMs = utcNow();\r\n // Only add expires if not already present\r\n var expireMs = nowMs + (maxAgeSec * 1000);\r\n // Sanity check, if zero or -ve then ignore\r\n if (expireMs > 0) {\r\n var expiry = new Date();\r\n expiry.setTime(expireMs);\r\n setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);\r\n }\r\n }\r\n if (!_isIE) {\r\n // Only replace if not already present\r\n setValue(values, \"max-age\", STR_EMPTY + maxAgeSec, null, isUndefined);\r\n }\r\n }\r\n var location_1 = getLocation();\r\n if (location_1 && location_1.protocol === \"https:\") {\r\n setValue(values, \"secure\", null, null, isUndefined);\r\n // Only set same site if not also secure\r\n if (_allowUaSameSite === null) {\r\n _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT /* @min:%2euserAgent */]);\r\n }\r\n if (_allowUaSameSite) {\r\n setValue(values, \"SameSite\", \"None\", null, isUndefined);\r\n }\r\n }\r\n setValue(values, STR_PATH, path || _path, null, isUndefined);\r\n //let setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;\r\n _setCookieFn(name, _formatCookieValue(theValue, values));\r\n result = true;\r\n }\r\n return result;\r\n },\r\n get: function (name) {\r\n var value = STR_EMPTY;\r\n if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) {\r\n value = _getCookieFn(name);\r\n }\r\n return value;\r\n },\r\n del: function (name, path) {\r\n var result = false;\r\n if (_isMgrEnabled(cookieMgr)) {\r\n // Only remove the cookie if the manager and cookie support has not been disabled\r\n result = cookieMgr.purge(name, path);\r\n }\r\n return result;\r\n },\r\n purge: function (name, path) {\r\n var _a;\r\n var result = false;\r\n if (areCookiesSupported(logger)) {\r\n // Setting the expiration date in the past immediately removes the cookie\r\n var values = (_a = {},\r\n _a[STR_PATH] = path ? path : \"/\",\r\n _a[strExpires] = \"Thu, 01 Jan 1970 00:00:01 GMT\",\r\n _a);\r\n if (!isIE()) {\r\n // Set max age to expire now\r\n values[\"max-age\"] = \"0\";\r\n }\r\n // let delCookie = cookieMgrConfig.delCookie || _setCookieValue;\r\n _delCookieFn(name, _formatCookieValue(STR_EMPTY, values));\r\n result = true;\r\n }\r\n return result;\r\n },\r\n unload: function (isAsync) {\r\n unloadHandler && unloadHandler.rm();\r\n unloadHandler = null;\r\n }\r\n };\r\n // Associated this cookie manager with the config\r\n cookieMgr[strConfigCookieMgr] = cookieMgr;\r\n return cookieMgr;\r\n}\r\n/*\r\n* Helper method to tell if document.cookie object is supported by the runtime\r\n*/\r\nexport function areCookiesSupported(logger) {\r\n if (_supportsCookies === null) {\r\n _supportsCookies = false;\r\n !_doc && _getDoc();\r\n try {\r\n var doc = _doc.v || {};\r\n _supportsCookies = doc[strCookie] !== undefined;\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 68 /* _eInternalMessageId.CannotAccessCookie */, \"Cannot access document.cookie - \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return _supportsCookies;\r\n}\r\nfunction _extractParts(theValue) {\r\n var values = {};\r\n if (theValue && theValue[_DYN_LENGTH /* @min:%2elength */]) {\r\n var parts = strTrim(theValue)[_DYN_SPLIT /* @min:%2esplit */](\";\");\r\n arrForEach(parts, function (thePart) {\r\n thePart = strTrim(thePart || STR_EMPTY);\r\n if (thePart) {\r\n var idx = strIndexOf(thePart, \"=\");\r\n if (idx === -1) {\r\n values[thePart] = null;\r\n }\r\n else {\r\n values[strTrim(strLeft(thePart, idx))] = strTrim(strSubstring(thePart, idx + 1));\r\n }\r\n }\r\n });\r\n }\r\n return values;\r\n}\r\nfunction _formatDate(theDate, func) {\r\n if (isFunction(theDate[func])) {\r\n return theDate[func]();\r\n }\r\n return null;\r\n}\r\nfunction _formatCookieValue(value, values) {\r\n var cookieValue = value || STR_EMPTY;\r\n objForEachKey(values, function (name, theValue) {\r\n cookieValue += \"; \" + name + (!isNullOrUndefined(theValue) ? \"=\" + theValue : STR_EMPTY);\r\n });\r\n return cookieValue;\r\n}\r\nfunction _getCookieValue(name) {\r\n var cookieValue = STR_EMPTY;\r\n !_doc && _getDoc();\r\n if (_doc.v) {\r\n var theCookie = _doc.v[strCookie] || STR_EMPTY;\r\n if (_parsedCookieValue !== theCookie) {\r\n _cookieCache = _extractParts(theCookie);\r\n _parsedCookieValue = theCookie;\r\n }\r\n cookieValue = strTrim(_cookieCache[name] || STR_EMPTY);\r\n }\r\n return cookieValue;\r\n}\r\nfunction _setCookieValue(name, cookieValue) {\r\n !_doc && _getDoc();\r\n if (_doc.v) {\r\n _doc.v[strCookie] = name + \"=\" + cookieValue;\r\n }\r\n}\r\nexport function uaDisallowsSameSiteNone(userAgent) {\r\n if (!isString(userAgent)) {\r\n return false;\r\n }\r\n // Cover all iOS based browsers here. This includes:\r\n // - Safari on iOS 12 for iPhone, iPod Touch, iPad\r\n // - WkWebview on iOS 12 for iPhone, iPod Touch, iPad\r\n // - Chrome on iOS 12 for iPhone, iPod Touch, iPad\r\n // All of which are broken by SameSite=None, because they use the iOS networking stack\r\n if (strContains(userAgent, \"CPU iPhone OS 12\") || strContains(userAgent, \"iPad; CPU OS 12\")) {\r\n return true;\r\n }\r\n // Cover Mac OS X based browsers that use the Mac OS networking stack. This includes:\r\n // - Safari on Mac OS X\r\n // This does not include:\r\n // - Internal browser on Mac OS X\r\n // - Chrome on Mac OS X\r\n // - Chromium on Mac OS X\r\n // Because they do not use the Mac OS networking stack.\r\n if (strContains(userAgent, \"Macintosh; Intel Mac OS X 10_14\") && strContains(userAgent, \"Version/\") && strContains(userAgent, \"Safari\")) {\r\n return true;\r\n }\r\n // Cover Mac OS X internal browsers that use the Mac OS networking stack. This includes:\r\n // - Internal browser on Mac OS X\r\n // This does not include:\r\n // - Safari on Mac OS X\r\n // - Chrome on Mac OS X\r\n // - Chromium on Mac OS X\r\n // Because they do not use the Mac OS networking stack.\r\n if (strContains(userAgent, \"Macintosh; Intel Mac OS X 10_14\") && strEndsWith(userAgent, \"AppleWebKit/605.1.15 (KHTML, like Gecko)\")) {\r\n return true;\r\n }\r\n // Cover Chrome 50-69, because some versions are broken by SameSite=None, and none in this range require it.\r\n // Note: this covers some pre-Chromium Edge versions, but pre-Chromim Edge does not require SameSite=None, so this is fine.\r\n // Note: this regex applies to Windows, Mac OS X, and Linux, deliberately.\r\n if (strContains(userAgent, \"Chrome/5\") || strContains(userAgent, \"Chrome/6\")) {\r\n return true;\r\n }\r\n // Unreal Engine runs Chromium 59, but does not advertise as Chrome until 4.23. Treat versions of Unreal\r\n // that don't specify their Chrome version as lacking support for SameSite=None.\r\n if (strContains(userAgent, \"UnrealEngine\") && !strContains(userAgent, \"Chrome\")) {\r\n return true;\r\n }\r\n // UCBrowser < 12.13.2 ignores Set-Cookie headers with SameSite=None\r\n // NB: this rule isn't complete - you need regex to make a complete rule.\r\n // See: https://www.chromium.org/updates/same-site/incompatible-clients\r\n if (strContains(userAgent, \"UCBrowser/12\") || strContains(userAgent, \"UCBrowser/11\")) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n//# sourceMappingURL=CookieMgr.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { strShimUndefined } from \"@microsoft/applicationinsights-shims\";\r\nimport { strSubstr, strSubstring } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nimport { random32 } from \"./RandomHelper\";\r\n// Added to help with minfication\r\nexport var Undefined = strShimUndefined;\r\nexport function newGuid() {\r\n var uuid = generateW3CId();\r\n return strSubstring(uuid, 0, 8) + \"-\" + strSubstring(uuid, 8, 12) + \"-\" + strSubstring(uuid, 12, 16) + \"-\" + strSubstring(uuid, 16, 20) + \"-\" + strSubstring(uuid, 20);\r\n}\r\n/**\r\n * The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate.\r\n * @param value - The value to check whether it ends with the search value.\r\n * @param search - The characters to be searched for at the end of the value.\r\n * @returns true if the given search value is found at the end of the string, otherwise false.\r\n */\r\nexport function strEndsWith(value, search) {\r\n if (value && search) {\r\n var len = value[_DYN_LENGTH /* @min:%2elength */];\r\n var start = len - search[_DYN_LENGTH /* @min:%2elength */];\r\n return strSubstring(value, start >= 0 ? start : 0, len) === search;\r\n }\r\n return false;\r\n}\r\n/**\r\n * generate W3C trace id\r\n */\r\nexport function generateW3CId() {\r\n var hexValues = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\r\n // rfc4122 version 4 UUID without dashes and with lowercase letters\r\n var oct = STR_EMPTY, tmp;\r\n for (var a = 0; a < 4; a++) {\r\n tmp = random32();\r\n oct +=\r\n hexValues[tmp & 0xF] +\r\n hexValues[tmp >> 4 & 0xF] +\r\n hexValues[tmp >> 8 & 0xF] +\r\n hexValues[tmp >> 12 & 0xF] +\r\n hexValues[tmp >> 16 & 0xF] +\r\n hexValues[tmp >> 20 & 0xF] +\r\n hexValues[tmp >> 24 & 0xF] +\r\n hexValues[tmp >> 28 & 0xF];\r\n }\r\n // \"Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively\"\r\n var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];\r\n return strSubstr(oct, 0, 8) + strSubstr(oct, 9, 4) + \"4\" + strSubstr(oct, 13, 3) + clockSequenceHi + strSubstr(oct, 16, 3) + strSubstr(oct, 19, 12);\r\n}\r\n//# sourceMappingURL=CoreUtils.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nimport { normalizeJsName } from \"./HelperFuncs\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nimport { newId } from \"./RandomHelper\";\r\nvar version = '3.3.6';\r\nvar instanceName = \".\" + newId(6);\r\nvar _dataUid = 0;\r\n// Accepts only:\r\n// - Node\r\n// - Node.ELEMENT_NODE\r\n// - Node.DOCUMENT_NODE\r\n// - Object\r\n// - Any\r\nfunction _canAcceptData(target) {\r\n return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType);\r\n}\r\nfunction _getCache(data, target) {\r\n var theCache = target[data.id];\r\n if (!theCache) {\r\n theCache = {};\r\n try {\r\n if (_canAcceptData(target)) {\r\n objDefine(target, data.id, {\r\n e: false,\r\n v: theCache\r\n });\r\n }\r\n }\r\n catch (e) {\r\n // Not all environments allow extending all objects, so just ignore the cache in those cases\r\n }\r\n }\r\n return theCache;\r\n}\r\nexport function createUniqueNamespace(name, includeVersion) {\r\n if (includeVersion === void 0) { includeVersion = false; }\r\n return normalizeJsName(name + (_dataUid++) + (includeVersion ? \".\" + version : STR_EMPTY) + instanceName);\r\n}\r\nexport function createElmNodeData(name) {\r\n var data = {\r\n id: createUniqueNamespace(\"_aiData-\" + (name || STR_EMPTY) + \".\" + version),\r\n accept: function (target) {\r\n return _canAcceptData(target);\r\n },\r\n get: function (target, name, defValue, addDefault) {\r\n var theCache = target[data.id];\r\n if (!theCache) {\r\n if (addDefault) {\r\n // Side effect is adds the cache\r\n theCache = _getCache(data, target);\r\n theCache[normalizeJsName(name)] = defValue;\r\n }\r\n return defValue;\r\n }\r\n return theCache[normalizeJsName(name)];\r\n },\r\n kill: function (target, name) {\r\n if (target && target[name]) {\r\n try {\r\n delete target[name];\r\n }\r\n catch (e) {\r\n // Just cleaning up, so if this fails -- ignore\r\n }\r\n }\r\n }\r\n };\r\n return data;\r\n}\r\n//# sourceMappingURL=DataCacheHelper.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { getInst } from \"@nevware21/ts-utils\";\r\nimport { _DYN_APPLY, _DYN_LENGTH } from \"../__DynamicConstants\";\r\nimport { STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_EVENTS_SENT, STR_PERF_EVENT } from \"./InternalConstants\";\r\nvar listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT];\r\nvar _aiNamespace = null;\r\nvar _debugListener;\r\nfunction _listenerProxyFunc(name, config) {\r\n return function () {\r\n var args = arguments;\r\n var dbgExt = getDebugExt(config);\r\n if (dbgExt) {\r\n var listener = dbgExt.listener;\r\n if (listener && listener[name]) {\r\n listener[name][_DYN_APPLY /* @min:%2eapply */](listener, args);\r\n }\r\n }\r\n };\r\n}\r\nfunction _getExtensionNamespace() {\r\n // Cache the lookup of the global namespace object\r\n var target = getInst(\"Microsoft\");\r\n if (target) {\r\n _aiNamespace = target[\"ApplicationInsights\"];\r\n }\r\n return _aiNamespace;\r\n}\r\nexport function getDebugExt(config) {\r\n var ns = _aiNamespace;\r\n if (!ns && config.disableDbgExt !== true) {\r\n ns = _aiNamespace || _getExtensionNamespace();\r\n }\r\n return ns ? ns[\"ChromeDbgExt\"] : null;\r\n}\r\nexport function getDebugListener(config) {\r\n if (!_debugListener) {\r\n _debugListener = {};\r\n for (var lp = 0; lp < listenerFuncs[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config);\r\n }\r\n }\r\n return _debugListener;\r\n}\r\n//# sourceMappingURL=DbgExtensionUtils.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nvar _a;\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dumpObj, isFunction, isUndefined } from \"@nevware21/ts-utils\";\r\nimport { createDynamicConfig, onConfigChange } from \"../Config/DynamicConfig\";\r\nimport { _DYN_DIAG_LOG, _DYN_LOGGER, _DYN_LOGGING_LEVEL_CONSOL4, _DYN_MESSAGE, _DYN_MESSAGE_ID, _DYN_PUSH, _DYN_REPLACE, _DYN_THROW_INTERNAL, _DYN_UNLOAD, _DYN_WARN_TO_CONSOLE } from \"../__DynamicConstants\";\r\nimport { getDebugExt } from \"./DbgExtensionUtils\";\r\nimport { getConsole, getJSON, hasJSON } from \"./EnvUtils\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nvar STR_WARN_TO_CONSOLE = \"warnToConsole\";\r\n/**\r\n * For user non actionable traces use AI Internal prefix.\r\n */\r\nvar AiNonUserActionablePrefix = \"AI (Internal): \";\r\n/**\r\n * Prefix of the traces in portal.\r\n */\r\nvar AiUserActionablePrefix = \"AI: \";\r\n/**\r\n * Session storage key for the prefix for the key indicating message type already logged\r\n */\r\nvar AIInternalMessagePrefix = \"AITR_\";\r\nvar defaultValues = {\r\n loggingLevelConsole: 0,\r\n loggingLevelTelemetry: 1,\r\n maxMessageLimit: 25,\r\n enableDebug: false\r\n};\r\nvar _logFuncs = (_a = {},\r\n _a[0 /* eLoggingSeverity.DISABLED */] = null,\r\n _a[1 /* eLoggingSeverity.CRITICAL */] = \"errorToConsole\",\r\n _a[2 /* eLoggingSeverity.WARNING */] = STR_WARN_TO_CONSOLE,\r\n _a[3 /* eLoggingSeverity.DEBUG */] = \"debugToConsole\",\r\n _a);\r\nfunction _sanitizeDiagnosticText(text) {\r\n if (text) {\r\n return \"\\\"\" + text[_DYN_REPLACE /* @min:%2ereplace */](/\\\"/g, STR_EMPTY) + \"\\\"\";\r\n }\r\n return STR_EMPTY;\r\n}\r\nfunction _logToConsole(func, message) {\r\n var theConsole = getConsole();\r\n if (!!theConsole) {\r\n var logFunc = \"log\";\r\n if (theConsole[func]) {\r\n logFunc = func;\r\n }\r\n if (isFunction(theConsole[logFunc])) {\r\n theConsole[logFunc](message);\r\n }\r\n }\r\n}\r\nvar _InternalLogMessage = /** @class */ (function () {\r\n function _InternalLogMessage(msgId, msg, isUserAct, properties) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var _self = this;\r\n _self[_DYN_MESSAGE_ID /* @min:%2emessageId */] = msgId;\r\n _self[_DYN_MESSAGE /* @min:%2emessage */] =\r\n (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +\r\n msgId;\r\n var strProps = STR_EMPTY;\r\n if (hasJSON()) {\r\n strProps = getJSON().stringify(properties);\r\n }\r\n var diagnosticText = (msg ? \" message:\" + _sanitizeDiagnosticText(msg) : STR_EMPTY) +\r\n (properties ? \" props:\" + _sanitizeDiagnosticText(strProps) : STR_EMPTY);\r\n _self[_DYN_MESSAGE /* @min:%2emessage */] += diagnosticText;\r\n }\r\n _InternalLogMessage.dataType = \"MessageData\";\r\n return _InternalLogMessage;\r\n}());\r\nexport { _InternalLogMessage };\r\nexport function safeGetLogger(core, config) {\r\n return (core || {})[_DYN_LOGGER /* @min:%2elogger */] || new DiagnosticLogger(config);\r\n}\r\nvar DiagnosticLogger = /** @class */ (function () {\r\n function DiagnosticLogger(config) {\r\n this.identifier = \"DiagnosticLogger\";\r\n /**\r\n * The internal logging queue\r\n */\r\n this.queue = [];\r\n /**\r\n * Count of internal messages sent\r\n */\r\n var _messageCount = 0;\r\n /**\r\n * Holds information about what message types were already logged to console or sent to server.\r\n */\r\n var _messageLogged = {};\r\n var _loggingLevelConsole;\r\n var _loggingLevelTelemetry;\r\n var _maxInternalMessageLimit;\r\n var _enableDebug;\r\n var _unloadHandler;\r\n dynamicProto(DiagnosticLogger, this, function (_self) {\r\n _unloadHandler = _setDefaultsFromConfig(config || {});\r\n _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };\r\n /**\r\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\r\n * @param severity - The severity of the log message\r\n * @param message - The log message.\r\n */\r\n _self[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */] = function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);\r\n if (_enableDebug) {\r\n throw dumpObj(message);\r\n }\r\n else {\r\n // Get the logging function and fallback to warnToConsole of for some reason errorToConsole doesn't exist\r\n var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE;\r\n if (!isUndefined(message[_DYN_MESSAGE /* @min:%2emessage */])) {\r\n if (isUserAct) {\r\n // check if this message type was already logged to console for this page view and if so, don't log it again\r\n var messageKey = +message[_DYN_MESSAGE_ID /* @min:%2emessageId */];\r\n if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {\r\n _self[logFunc](message[_DYN_MESSAGE /* @min:%2emessage */]);\r\n _messageLogged[messageKey] = true;\r\n }\r\n }\r\n else {\r\n // Only log traces if the console Logging Level is >= the throwInternal severity level\r\n if (_loggingLevelConsole >= severity) {\r\n _self[logFunc](message[_DYN_MESSAGE /* @min:%2emessage */]);\r\n }\r\n }\r\n _logInternalMessage(severity, message);\r\n }\r\n else {\r\n _debugExtMsg(\"throw\" + (severity === 1 /* eLoggingSeverity.CRITICAL */ ? \"Critical\" : \"Warning\"), message);\r\n }\r\n }\r\n };\r\n _self.debugToConsole = function (message) {\r\n _logToConsole(\"debug\", message);\r\n _debugExtMsg(\"warning\", message);\r\n };\r\n _self[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */] = function (message) {\r\n _logToConsole(\"warn\", message);\r\n _debugExtMsg(\"warning\", message);\r\n };\r\n _self.errorToConsole = function (message) {\r\n _logToConsole(\"error\", message);\r\n _debugExtMsg(\"error\", message);\r\n };\r\n _self.resetInternalMessageCount = function () {\r\n _messageCount = 0;\r\n _messageLogged = {};\r\n };\r\n _self.logInternalMessage = _logInternalMessage;\r\n _self[_DYN_UNLOAD /* @min:%2eunload */] = function (isAsync) {\r\n _unloadHandler && _unloadHandler.rm();\r\n _unloadHandler = null;\r\n };\r\n function _logInternalMessage(severity, message) {\r\n if (_areInternalMessagesThrottled()) {\r\n return;\r\n }\r\n // check if this message type was already logged for this session and if so, don't log it again\r\n var logMessage = true;\r\n var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID /* @min:%2emessageId */];\r\n // if the session storage is not available, limit to only one message type per page view\r\n if (_messageLogged[messageKey]) {\r\n logMessage = false;\r\n }\r\n else {\r\n _messageLogged[messageKey] = true;\r\n }\r\n if (logMessage) {\r\n // Push the event in the internal queue\r\n if (severity <= _loggingLevelTelemetry) {\r\n _self.queue[_DYN_PUSH /* @min:%2epush */](message);\r\n _messageCount++;\r\n _debugExtMsg((severity === 1 /* eLoggingSeverity.CRITICAL */ ? \"error\" : \"warn\"), message);\r\n }\r\n // When throttle limit reached, send a special event\r\n if (_messageCount === _maxInternalMessageLimit) {\r\n var throttleLimitMessage = \"Internal events throttle limit per PageView reached for this app.\";\r\n var throttleMessage = new _InternalLogMessage(23 /* _eInternalMessageId.MessageLimitPerPVExceeded */, throttleLimitMessage, false);\r\n _self.queue[_DYN_PUSH /* @min:%2epush */](throttleMessage);\r\n if (severity === 1 /* eLoggingSeverity.CRITICAL */) {\r\n _self.errorToConsole(throttleLimitMessage);\r\n }\r\n else {\r\n _self[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */](throttleLimitMessage);\r\n }\r\n }\r\n }\r\n }\r\n function _setDefaultsFromConfig(config) {\r\n // make sure the config is dynamic\r\n return onConfigChange(createDynamicConfig(config, defaultValues, _self).cfg, function (details) {\r\n var config = details.cfg;\r\n _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 /* @min:%2eloggingLevelConsole */];\r\n _loggingLevelTelemetry = config.loggingLevelTelemetry;\r\n _maxInternalMessageLimit = config.maxMessageLimit;\r\n _enableDebug = config.enableDebug;\r\n });\r\n }\r\n function _areInternalMessagesThrottled() {\r\n return _messageCount >= _maxInternalMessageLimit;\r\n }\r\n function _debugExtMsg(name, data) {\r\n var dbgExt = getDebugExt(config || {});\r\n if (dbgExt && dbgExt[_DYN_DIAG_LOG /* @min:%2ediagLog */]) {\r\n dbgExt[_DYN_DIAG_LOG /* @min:%2ediagLog */](name, data);\r\n }\r\n }\r\n });\r\n }\r\n /**\r\n * 0: OFF (default)\r\n * 1: CRITICAL\r\n * 2: \\>= WARNING\r\n */\r\n DiagnosticLogger.prototype.consoleLoggingLevel = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return 0;\r\n };\r\n /**\r\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\r\n * @param severity - The severity of the log message\r\n * @param message - The log message.\r\n */\r\n DiagnosticLogger.prototype.throwInternal = function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * This will write a debug message to the console if possible\r\n * @param message - The debug message\r\n */\r\n DiagnosticLogger.prototype.debugToConsole = function (message) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * This will write a warning to the console if possible\r\n * @param message - The warning message\r\n */\r\n DiagnosticLogger.prototype.warnToConsole = function (message) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * This will write an error to the console if possible\r\n * @param message - The warning message\r\n */\r\n DiagnosticLogger.prototype.errorToConsole = function (message) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Resets the internal message count\r\n */\r\n DiagnosticLogger.prototype.resetInternalMessageCount = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Logs a message to the internal queue.\r\n * @param severity - The severity of the log message\r\n * @param message - The message to log.\r\n */\r\n DiagnosticLogger.prototype.logInternalMessage = function (severity, message) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Unload and remove any state that this IDiagnosticLogger may be holding, this is generally called when the\r\n * owning SDK is being unloaded.\r\n * @param isAsync - Can the unload be performed asynchronously (default)\r\n * @returns If the unload occurs synchronously then nothing should be returned, if happening asynchronously then\r\n * the function should return an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * / Promise to allow any listeners to wait for the operation to complete.\r\n */\r\n DiagnosticLogger.prototype.unload = function (isAsync) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return DiagnosticLogger;\r\n}());\r\nexport { DiagnosticLogger };\r\nfunction _getLogger(logger) {\r\n return (logger || new DiagnosticLogger());\r\n}\r\n/**\r\n * This is a helper method which will call throwInternal on the passed logger, will throw exceptions in\r\n * debug mode or attempt to log the error as a console warning. This helper is provided mostly to better\r\n * support minification as logger.throwInternal() will not compress the publish \"throwInternal\" used throughout\r\n * the code.\r\n * @param logger - The Diagnostic Logger instance to use.\r\n * @param severity - The severity of the log message\r\n * @param message - The log message.\r\n */\r\nexport function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n _getLogger(logger)[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](severity, msgId, msg, properties, isUserAct);\r\n}\r\n/**\r\n * This is a helper method which will call warnToConsole on the passed logger with the provided message.\r\n * @param logger - The Diagnostic Logger instance to use.\r\n * @param message - The log message.\r\n */\r\nexport function _warnToConsole(logger, message) {\r\n _getLogger(logger)[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */](message);\r\n}\r\n/**\r\n * Logs a message to the internal queue.\r\n * @param logger - The Diagnostic Logger instance to use.\r\n * @param severity - The severity of the log message\r\n * @param message - The message to log.\r\n */\r\nexport function _logInternalMessage(logger, severity, message) {\r\n _getLogger(logger).logInternalMessage(severity, message);\r\n}\r\n//# sourceMappingURL=DiagnosticLogger.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { getGlobal, strShimObject, strShimPrototype, strShimUndefined } from \"@microsoft/applicationinsights-shims\";\r\nimport { getDocument, getInst, getNavigator, getPerformance, hasNavigator, isFunction, isString, isUndefined, mathMax, strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH, _DYN_NAME, _DYN_SPLIT, _DYN_TO_LOWER_CASE, _DYN_USER_AGENT } from \"../__DynamicConstants\";\r\nimport { strContains } from \"./HelperFuncs\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\n/**\r\n * This file exists to hold environment utilities that are required to check and\r\n * validate the current operating environment. Unless otherwise required, please\r\n * only use defined methods (functions) in this class so that users of these\r\n * functions/properties only need to include those that are used within their own modules.\r\n */\r\nvar strDocumentMode = \"documentMode\";\r\nvar strLocation = \"location\";\r\nvar strConsole = \"console\";\r\nvar strJSON = \"JSON\";\r\nvar strCrypto = \"crypto\";\r\nvar strMsCrypto = \"msCrypto\";\r\nvar strReactNative = \"ReactNative\";\r\nvar strMsie = \"msie\";\r\nvar strTrident = \"trident/\";\r\nvar strXMLHttpRequest = \"XMLHttpRequest\";\r\nvar _isTrident = null;\r\nvar _navUserAgentCheck = null;\r\nvar _enableMocks = false;\r\nvar _useXDomainRequest = null;\r\nvar _beaconsSupported = null;\r\nfunction _hasProperty(theClass, property) {\r\n var supported = false;\r\n if (theClass) {\r\n try {\r\n supported = property in theClass;\r\n if (!supported) {\r\n var proto = theClass[strShimPrototype];\r\n if (proto) {\r\n supported = property in proto;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // Do Nothing\r\n }\r\n if (!supported) {\r\n try {\r\n var tmp = new theClass();\r\n supported = !isUndefined(tmp[property]);\r\n }\r\n catch (e) {\r\n // Do Nothing\r\n }\r\n }\r\n }\r\n return supported;\r\n}\r\n/**\r\n * Enable the lookup of test mock objects if requested\r\n * @param enabled - A flag to enable or disable the mock\r\n */\r\nexport function setEnableEnvMocks(enabled) {\r\n _enableMocks = enabled;\r\n}\r\n/**\r\n * Returns the global location object if it is present otherwise null.\r\n * This helper is used to access the location object without causing an exception\r\n * \"Uncaught ReferenceError: location is not defined\"\r\n */\r\nexport function getLocation(checkForMock) {\r\n if (checkForMock && _enableMocks) {\r\n var mockLocation = getInst(\"__mockLocation\");\r\n if (mockLocation) {\r\n return mockLocation;\r\n }\r\n }\r\n if (typeof location === strShimObject && location) {\r\n return location;\r\n }\r\n return getInst(strLocation);\r\n}\r\n/**\r\n * Returns the global console object\r\n */\r\nexport function getConsole() {\r\n if (typeof console !== strShimUndefined) {\r\n return console;\r\n }\r\n return getInst(strConsole);\r\n}\r\n/**\r\n * Checks if JSON object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: JSON is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasJSON() {\r\n return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);\r\n}\r\n/**\r\n * Returns the global JSON object if it is present otherwise null.\r\n * This helper is used to access the JSON object without causing an exception\r\n * \"Uncaught ReferenceError: JSON is not defined\"\r\n */\r\nexport function getJSON() {\r\n if (hasJSON()) {\r\n return JSON || getInst(strJSON);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getCrypto() {\r\n return getInst(strCrypto);\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getMsCrypto() {\r\n return getInst(strMsCrypto);\r\n}\r\n/**\r\n * Returns whether the environment is reporting that we are running in a React Native Environment\r\n */\r\nexport function isReactNative() {\r\n // If running in React Native, navigator.product will be populated\r\n var nav = getNavigator();\r\n if (nav && nav.product) {\r\n return nav.product === strReactNative;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Identifies whether the current environment appears to be IE\r\n */\r\nexport function isIE() {\r\n var nav = getNavigator();\r\n if (nav && (nav[_DYN_USER_AGENT /* @min:%2euserAgent */] !== _navUserAgentCheck || _isTrident === null)) {\r\n // Added to support test mocking of the user agent\r\n _navUserAgentCheck = nav[_DYN_USER_AGENT /* @min:%2euserAgent */];\r\n var userAgent = (_navUserAgentCheck || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));\r\n }\r\n return _isTrident;\r\n}\r\n/**\r\n * Gets IE version returning the document emulation mode if we are running on IE, or null otherwise\r\n */\r\nexport function getIEVersion(userAgentStr) {\r\n if (userAgentStr === void 0) { userAgentStr = null; }\r\n if (!userAgentStr) {\r\n var navigator_1 = getNavigator() || {};\r\n userAgentStr = navigator_1 ? (navigator_1.userAgent || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() : STR_EMPTY;\r\n }\r\n var ua = (userAgentStr || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n // Also check for documentMode in case X-UA-Compatible meta tag was included in HTML.\r\n if (strContains(ua, strMsie)) {\r\n var doc = getDocument() || {};\r\n return mathMax(parseInt(ua[_DYN_SPLIT /* @min:%2esplit */](strMsie)[1]), (doc[strDocumentMode] || 0));\r\n }\r\n else if (strContains(ua, strTrident)) {\r\n var tridentVer = parseInt(ua[_DYN_SPLIT /* @min:%2esplit */](strTrident)[1]);\r\n if (tridentVer) {\r\n return tridentVer + 4;\r\n }\r\n }\r\n return null;\r\n}\r\nexport function isSafari(userAgentStr) {\r\n if (!userAgentStr || !isString(userAgentStr)) {\r\n var navigator_2 = getNavigator() || {};\r\n userAgentStr = navigator_2 ? (navigator_2.userAgent || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() : STR_EMPTY;\r\n }\r\n var ua = (userAgentStr || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n return (strIndexOf(ua, \"safari\") >= 0);\r\n}\r\n/**\r\n * Checks if HTML5 Beacons are supported in the current environment.\r\n * @param useCached - [Optional] used for testing to bypass the cached lookup, when `true` this will\r\n * cause the cached global to be reset.\r\n * @returns True if supported, false otherwise.\r\n */\r\nexport function isBeaconsSupported(useCached) {\r\n if (_beaconsSupported === null || useCached === false) {\r\n _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);\r\n }\r\n return _beaconsSupported;\r\n}\r\n/**\r\n * Checks if the Fetch API is supported in the current environment.\r\n * @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported\r\n * @returns True if supported, otherwise false\r\n */\r\nexport function isFetchSupported(withKeepAlive) {\r\n var isSupported = false;\r\n try {\r\n isSupported = !!getInst(\"fetch\");\r\n var request = getInst(\"Request\");\r\n if (isSupported && withKeepAlive && request) {\r\n isSupported = _hasProperty(request, \"keepalive\");\r\n }\r\n }\r\n catch (e) {\r\n // Just Swallow any failure during availability checks\r\n }\r\n return isSupported;\r\n}\r\nexport function useXDomainRequest() {\r\n if (_useXDomainRequest === null) {\r\n _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined);\r\n if (_useXDomainRequest && isXhrSupported()) {\r\n _useXDomainRequest = _useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), \"withCredentials\");\r\n }\r\n }\r\n return _useXDomainRequest;\r\n}\r\n/**\r\n * Checks if XMLHttpRequest is supported\r\n * @returns True if supported, otherwise false\r\n */\r\nexport function isXhrSupported() {\r\n var isSupported = false;\r\n try {\r\n var xmlHttpRequest = getInst(strXMLHttpRequest);\r\n isSupported = !!xmlHttpRequest;\r\n }\r\n catch (e) {\r\n // Just Swallow any failure during availability checks\r\n }\r\n return isSupported;\r\n}\r\nfunction _getNamedValue(values, name) {\r\n if (values) {\r\n for (var i = 0; i < values[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n var value = values[i];\r\n if (value[_DYN_NAME /* @min:%2ename */]) {\r\n if (value[_DYN_NAME /* @min:%2ename */] === name) {\r\n return value;\r\n }\r\n }\r\n }\r\n }\r\n return {};\r\n}\r\n/**\r\n * Helper function to fetch the named meta-tag from the page.\r\n * @param name - The name of the meta-tag to find.\r\n */\r\nexport function findMetaTag(name) {\r\n var doc = getDocument();\r\n if (doc && name) {\r\n // Look for a meta-tag\r\n return _getNamedValue(doc.querySelectorAll(\"meta\"), name).content;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Helper function to fetch the named server timing value from the page response (first navigation event).\r\n * @param name - The name of the server timing value to find.\r\n */\r\nexport function findNamedServerTiming(name) {\r\n var value;\r\n var perf = getPerformance();\r\n if (perf) {\r\n // Try looking for a server-timing header\r\n var navPerf = perf.getEntriesByType(\"navigation\") || [];\r\n value = _getNamedValue((navPerf[_DYN_LENGTH /* @min:%2elength */] > 0 ? navPerf[0] : {}).serverTiming, name).description;\r\n }\r\n return value;\r\n}\r\n// TODO: should reuse this method for analytics plugin\r\nexport function dispatchEvent(target, evnt) {\r\n if (target && target.dispatchEvent && evnt) {\r\n target.dispatchEvent(evnt);\r\n return true;\r\n }\r\n return false;\r\n}\r\nexport function createCustomDomEvent(eventName, details) {\r\n var event = null;\r\n var detail = { detail: details || null };\r\n if (isFunction(CustomEvent)) { // Use CustomEvent constructor when available\r\n event = new CustomEvent(eventName, detail);\r\n }\r\n else { // CustomEvent has no constructor in IE\r\n var doc = getDocument();\r\n if (doc && doc.createEvent) {\r\n event = doc.createEvent(\"CustomEvent\");\r\n event.initCustomEvent(eventName, true, true, detail);\r\n }\r\n }\r\n return event;\r\n}\r\nexport function sendCustomEvent(evtName, cfg, customDetails) {\r\n var global = getGlobal();\r\n if (global && global.CustomEvent) {\r\n try {\r\n var details = { cfg: cfg || null, customDetails: customDetails || null };\r\n return dispatchEvent(global, createCustomDomEvent(evtName, details));\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n return false;\r\n}\r\n//# sourceMappingURL=EnvUtils.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { ObjAssign, ObjClass } from \"@microsoft/applicationinsights-shims\";\r\nimport { arrForEach, asString as asString21, isArray, isBoolean, isError, isFunction, isNullOrUndefined, isNumber, isObject, isPlainObject, isString, isUndefined, objDeepFreeze, objDefine, objForEachKey, objHasOwn, strIndexOf, strTrim } from \"@nevware21/ts-utils\";\r\nimport { _DYN_APPLY, _DYN_GET_ALL_RESPONSE_HEA5, _DYN_LENGTH, _DYN_NAME, _DYN_REPLACE, _DYN_SPLIT, _DYN_STATUS, _DYN_TO_LOWER_CASE } from \"../__DynamicConstants\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\n// RESTRICT and AVOID circular dependencies you should not import other contained modules or export the contents of this file directly\r\n// Added to help with minification\r\nvar strGetPrototypeOf = \"getPrototypeOf\";\r\nvar rCamelCase = /-([a-z])/g;\r\nvar rNormalizeInvalid = /([^\\w\\d_$])/g;\r\nvar rLeadingNumeric = /^(\\d+[\\w\\d_$])/;\r\nexport var _getObjProto = Object[strGetPrototypeOf];\r\nexport function isNotUndefined(value) {\r\n return !isUndefined(value);\r\n}\r\nexport function isNotNullOrUndefined(value) {\r\n return !isNullOrUndefined(value);\r\n}\r\n/**\r\n * Validates that the string name conforms to the JS IdentifierName specification and if not\r\n * normalizes the name so that it would. This method does not identify or change any keywords\r\n * meaning that if you pass in a known keyword the same value will be returned.\r\n * This is a simplified version\r\n * @param name - The name to validate\r\n */\r\nexport function normalizeJsName(name) {\r\n var value = name;\r\n if (value && isString(value)) {\r\n // CamelCase everything after the \"-\" and remove the dash\r\n value = value[_DYN_REPLACE /* @min:%2ereplace */](rCamelCase, function (_all, letter) {\r\n return letter.toUpperCase();\r\n });\r\n value = value[_DYN_REPLACE /* @min:%2ereplace */](rNormalizeInvalid, \"_\");\r\n value = value[_DYN_REPLACE /* @min:%2ereplace */](rLeadingNumeric, function (_all, match) {\r\n return \"_\" + match;\r\n });\r\n }\r\n return value;\r\n}\r\n/**\r\n * A simple wrapper (for minification support) to check if the value contains the search string.\r\n * @param value - The string value to check for the existence of the search value\r\n * @param search - The value search within the value\r\n */\r\nexport function strContains(value, search) {\r\n if (value && search) {\r\n return strIndexOf(value, search) !== -1;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Convert a date to I.S.O. format in IE8\r\n */\r\nexport function toISOString(date) {\r\n return date && date.toISOString() || \"\";\r\n}\r\nexport var deepFreeze = objDeepFreeze;\r\n/**\r\n * Returns the name of object if it's an Error. Otherwise, returns empty string.\r\n */\r\nexport function getExceptionName(object) {\r\n if (isError(object)) {\r\n return object[_DYN_NAME /* @min:%2ename */];\r\n }\r\n return STR_EMPTY;\r\n}\r\n/**\r\n * Sets the provided value on the target instance using the field name when the provided chk function returns true, the chk\r\n * function will only be called if the new value is no equal to the original value.\r\n * @param target - The target object\r\n * @param field - The key of the target\r\n * @param value - The value to set\r\n * @param valChk - [Optional] Callback to check the value that if supplied will be called check if the new value can be set\r\n * @param srcChk - [Optional] Callback to check to original value that if supplied will be called if the new value should be set (if allowed)\r\n * @returns The existing or new value, depending what was set\r\n */\r\nexport function setValue(target, field, value, valChk, srcChk) {\r\n var theValue = value;\r\n if (target) {\r\n theValue = target[field];\r\n if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {\r\n theValue = value;\r\n target[field] = theValue;\r\n }\r\n }\r\n return theValue;\r\n}\r\n/**\r\n * Returns the current value from the target object if not null or undefined otherwise sets the new value and returns it\r\n * @param target - The target object to return or set the default value\r\n * @param field - The key for the field to set on the target\r\n * @param defValue - [Optional] The value to set if not already present, when not provided a empty object will be added\r\n */\r\nexport function getSetValue(target, field, defValue) {\r\n var theValue;\r\n if (target) {\r\n theValue = target[field];\r\n if (!theValue && isNullOrUndefined(theValue)) {\r\n // Supports having the default as null\r\n theValue = !isUndefined(defValue) ? defValue : {};\r\n target[field] = theValue;\r\n }\r\n }\r\n else {\r\n // Expanded for performance so we only check defValue if required\r\n theValue = !isUndefined(defValue) ? defValue : {};\r\n }\r\n return theValue;\r\n}\r\nfunction _createProxyFunction(source, funcName) {\r\n var srcFunc = null;\r\n var src = null;\r\n if (isFunction(source)) {\r\n srcFunc = source;\r\n }\r\n else {\r\n src = source;\r\n }\r\n return function () {\r\n // Capture the original arguments passed to the method\r\n var originalArguments = arguments;\r\n if (srcFunc) {\r\n src = srcFunc();\r\n }\r\n if (src) {\r\n return src[funcName][_DYN_APPLY /* @min:%2eapply */](src, originalArguments);\r\n }\r\n };\r\n}\r\n/**\r\n * Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from\r\n * the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential\r\n * implementation issues by assigning prototype functions as instance ones\r\n *\r\n * This method is the primary method used to \"update\" the snippet proxy with the ultimate implementations.\r\n *\r\n * Special ES3 Notes:\r\n * Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the\r\n * properties of \"referenced\" object will work (target.context.newValue = 10 =\\> will be reflected in the source.context as it's the\r\n * same object). ES3 Failures: assigning target.myProp = 3 -\\> Won't change source.myProp = 3, likewise the reverse would also fail.\r\n * @param target - The target object to be assigned with the source properties and functions\r\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\r\n * @param chkSet - An optional callback to determine whether a specific property/function should be proxied\r\n */\r\nexport function proxyAssign(target, source, chkSet) {\r\n if (target && source && isObject(target) && isObject(source)) {\r\n var _loop_1 = function (field) {\r\n if (isString(field)) {\r\n var value = source[field];\r\n if (isFunction(value)) {\r\n if (!chkSet || chkSet(field, true, source, target)) {\r\n // Create a proxy function rather than just copying the (possible) prototype to the new object as an instance function\r\n target[field] = _createProxyFunction(source, field);\r\n }\r\n }\r\n else if (!chkSet || chkSet(field, false, source, target)) {\r\n if (objHasOwn(target, field)) {\r\n // Remove any previous instance property\r\n delete target[field];\r\n }\r\n objDefine(target, field, {\r\n g: function () {\r\n return source[field];\r\n },\r\n s: function (theValue) {\r\n source[field] = theValue;\r\n }\r\n });\r\n }\r\n }\r\n };\r\n // effectively apply/proxy full source to the target instance\r\n for (var field in source) {\r\n _loop_1(field);\r\n }\r\n }\r\n return target;\r\n}\r\n/**\r\n * Creates a proxy function on the target which internally will call the source version with all arguments passed to the target method.\r\n *\r\n * @param target - The target object to be assigned with the source properties and functions\r\n * @param name - The function name that will be added on the target\r\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\r\n * @param theFunc - The function name on the source that will be proxied on the target\r\n * @param overwriteTarget - If `false` this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name\r\n */\r\nexport function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {\r\n if (target && name && source) {\r\n if (overwriteTarget !== false || isUndefined(target[name])) {\r\n target[name] = _createProxyFunction(source, theFunc);\r\n }\r\n }\r\n}\r\n/**\r\n * Creates proxy functions on the target which internally will call the source version with all arguments passed to the target method.\r\n *\r\n * @param target - The target object to be assigned with the source properties and functions\r\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\r\n * @param functionsToProxy - An array of function names that will be proxied on the target\r\n * @param overwriteTarget - If false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name\r\n */\r\nexport function proxyFunctions(target, source, functionsToProxy, overwriteTarget) {\r\n if (target && source && isObject(target) && isArray(functionsToProxy)) {\r\n arrForEach(functionsToProxy, function (theFuncName) {\r\n if (isString(theFuncName)) {\r\n proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget);\r\n }\r\n });\r\n }\r\n return target;\r\n}\r\n/**\r\n * Simpler helper to create a dynamic class that implements the interface and populates the values with the defaults.\r\n * Only instance properties (hasOwnProperty) values are copied from the defaults to the new instance\r\n * @param defaults - Simple helper\r\n */\r\nexport function createClassFromInterface(defaults) {\r\n return /** @class */ (function () {\r\n function class_1() {\r\n var _this = this;\r\n if (defaults) {\r\n objForEachKey(defaults, function (field, value) {\r\n _this[field] = value;\r\n });\r\n }\r\n }\r\n return class_1;\r\n }());\r\n}\r\n/**\r\n * A helper function to assist with JIT performance for objects that have properties added / removed dynamically\r\n * this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this\r\n * function after you have finished \"updating\" the object, calling this within loops reduces or defeats the benefits.\r\n * This helps when iterating using for..in, objKeys() and objForEach()\r\n * @param theObject - The object to be optimized if possible\r\n */\r\nexport function optimizeObject(theObject) {\r\n // V8 Optimization to cause the JIT compiler to create a new optimized object for looking up the own properties\r\n // primarily for object with <= 19 properties for >= 20 the effect is reduced or non-existent\r\n if (theObject && ObjAssign) {\r\n theObject = ObjClass(ObjAssign({}, theObject));\r\n }\r\n return theObject;\r\n}\r\nexport function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {\r\n // Variables\r\n var theArgs = arguments;\r\n var extended = theArgs[0] || {};\r\n var argLen = theArgs[_DYN_LENGTH /* @min:%2elength */];\r\n var deep = false;\r\n var idx = 1;\r\n // Check for \"Deep\" flag\r\n if (argLen > 0 && isBoolean(extended)) {\r\n deep = extended;\r\n extended = theArgs[idx] || {};\r\n idx++;\r\n }\r\n // Handle case when target is a string or something (possible in deep copy)\r\n if (!isObject(extended)) {\r\n extended = {};\r\n }\r\n // Loop through each remaining object and conduct a merge\r\n for (; idx < argLen; idx++) {\r\n var arg = theArgs[idx];\r\n var isArgArray = isArray(arg);\r\n var isArgObj = isObject(arg);\r\n for (var prop in arg) {\r\n var propOk = (isArgArray && (prop in arg)) || (isArgObj && objHasOwn(arg, prop));\r\n if (!propOk) {\r\n continue;\r\n }\r\n var newValue = arg[prop];\r\n var isNewArray = void 0;\r\n // If deep merge and property is an object, merge properties\r\n if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) {\r\n // Grab the current value of the extended object\r\n var clone = extended[prop];\r\n if (isNewArray) {\r\n if (!isArray(clone)) {\r\n // We can't \"merge\" an array with a non-array so overwrite the original\r\n clone = [];\r\n }\r\n }\r\n else if (!isPlainObject(clone)) {\r\n // We can't \"merge\" an object with a non-object\r\n clone = {};\r\n }\r\n // Never move the original objects always clone them\r\n newValue = objExtend(deep, clone, newValue);\r\n }\r\n // Assign the new (or previous) value (unless undefined)\r\n if (newValue !== undefined) {\r\n extended[prop] = newValue;\r\n }\r\n }\r\n }\r\n return extended;\r\n}\r\nexport var asString = asString21;\r\nexport function isFeatureEnabled(feature, cfg) {\r\n var rlt = false;\r\n var ft = cfg && cfg.featureOptIn && cfg.featureOptIn[feature];\r\n if (feature && ft) {\r\n var mode = ft.mode;\r\n // NOTE: None will be considered as true\r\n rlt = (mode == 3 /* FeatureOptInMode.enable */) || (mode == 1 /* FeatureOptInMode.none */);\r\n }\r\n return rlt;\r\n}\r\nexport function getResponseText(xhr) {\r\n try {\r\n return xhr.responseText;\r\n }\r\n catch (e) {\r\n // Best effort, as XHR may throw while XDR wont so just ignore\r\n }\r\n return null;\r\n}\r\nexport function formatErrorMessageXdr(xdr, message) {\r\n if (xdr) {\r\n return \"XDomainRequest,Response:\" + getResponseText(xdr) || \"\";\r\n }\r\n return message;\r\n}\r\nexport function formatErrorMessageXhr(xhr, message) {\r\n if (xhr) {\r\n return \"XMLHttpRequest,Status:\" + xhr[_DYN_STATUS /* @min:%2estatus */] + \",Response:\" + getResponseText(xhr) || xhr.response || \"\";\r\n }\r\n return message;\r\n}\r\nexport function prependTransports(theTransports, newTransports) {\r\n if (newTransports) {\r\n if (isNumber(newTransports)) {\r\n theTransports = [newTransports].concat(theTransports);\r\n }\r\n else if (isArray(newTransports)) {\r\n theTransports = newTransports.concat(theTransports);\r\n }\r\n }\r\n return theTransports;\r\n}\r\nvar strDisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nvar strWithCredentials = \"withCredentials\";\r\nvar strTimeout = \"timeout\";\r\n/**\r\n * Create and open an XMLHttpRequest object\r\n * @param method - The request method\r\n * @param urlString - The url\r\n * @param withCredentials - Option flag indicating that credentials should be sent\r\n * @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)\r\n * @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false)\r\n * @param timeout - Optional value identifying the timeout value that should be assigned to the XHR request\r\n * @returns A new opened XHR request\r\n */\r\nexport function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) {\r\n if (disabled === void 0) { disabled = false; }\r\n if (isSync === void 0) { isSync = false; }\r\n function _wrapSetXhrProp(xhr, prop, value) {\r\n try {\r\n xhr[prop] = value;\r\n }\r\n catch (e) {\r\n // - Wrapping as depending on the environment setting the property may fail (non-terminally)\r\n }\r\n }\r\n var xhr = new XMLHttpRequest();\r\n if (disabled) {\r\n // Tag the instance so it's not tracked (trackDependency)\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled);\r\n }\r\n if (withCredentials) {\r\n // Some libraries require that the withCredentials flag is set \"before\" open and\r\n // - Wrapping as IE 10 has started throwing when setting before open\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n xhr.open(method, urlString, !isSync);\r\n if (withCredentials) {\r\n // withCredentials should be set AFTER open (https://xhr.spec.whatwg.org/#the-withcredentials-attribute)\r\n // And older firefox instances from 11+ will throw for sync events (current versions don't) which happens during unload processing\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n // Only set the timeout for asynchronous requests as\r\n // \"Timeout shouldn't be used for synchronous XMLHttpRequests requests used in a document environment or it will throw an InvalidAccessError exception.\"\"\r\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout\r\n if (!isSync && timeout) {\r\n _wrapSetXhrProp(xhr, strTimeout, timeout);\r\n }\r\n return xhr;\r\n}\r\n/**\r\n* Converts the XHR getAllResponseHeaders to a map containing the header key and value.\r\n* @internal\r\n*/\r\n// tslint:disable-next-line: align\r\nexport function convertAllHeadersToMap(headersString) {\r\n var headers = {};\r\n if (isString(headersString)) {\r\n var headersArray = strTrim(headersString)[_DYN_SPLIT /* @min:%2esplit */](/[\\r\\n]+/);\r\n arrForEach(headersArray, function (headerEntry) {\r\n if (headerEntry) {\r\n var idx = headerEntry.indexOf(\": \");\r\n if (idx !== -1) {\r\n // The new spec has the headers returning all as lowercase -- but not all browsers do this yet\r\n var header = strTrim(headerEntry.substring(0, idx))[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n var value = strTrim(headerEntry.substring(idx + 1));\r\n headers[header] = value;\r\n }\r\n else {\r\n headers[strTrim(headerEntry)] = 1;\r\n }\r\n }\r\n });\r\n }\r\n return headers;\r\n}\r\n/**\r\n* append the XHR headers.\r\n* @internal\r\n*/\r\nexport function _appendHeader(theHeaders, xhr, name) {\r\n if (!theHeaders[name] && xhr && xhr.getResponseHeader) {\r\n var value = xhr.getResponseHeader(name);\r\n if (value) {\r\n theHeaders[name] = strTrim(value);\r\n }\r\n }\r\n return theHeaders;\r\n}\r\nvar STR_KILL_DURATION_HEADER = \"kill-duration\";\r\nvar STR_KILL_DURATION_SECONDS_HEADER = \"kill-duration-seconds\";\r\nvar STR_TIME_DELTA_HEADER = \"time-delta-millis\";\r\n/**\r\n* get the XHR getAllResponseHeaders.\r\n* @internal\r\n*/\r\nexport function _getAllResponseHeaders(xhr, isOneDs) {\r\n var theHeaders = {};\r\n if (!xhr[_DYN_GET_ALL_RESPONSE_HEA5 /* @min:%2egetAllResponseHeaders */]) {\r\n // Firefox 2-63 doesn't have getAllResponseHeaders function but it does have getResponseHeader\r\n // Only call these if getAllResponseHeaders doesn't exist, otherwise we can get invalid response errors\r\n // as collector is not currently returning the correct header to allow JS to access these headers\r\n if (!!isOneDs) {\r\n theHeaders = _appendHeader(theHeaders, xhr, STR_TIME_DELTA_HEADER);\r\n theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_HEADER);\r\n theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_SECONDS_HEADER);\r\n }\r\n }\r\n else {\r\n theHeaders = convertAllHeadersToMap(xhr[_DYN_GET_ALL_RESPONSE_HEA5 /* @min:%2egetAllResponseHeaders */]());\r\n }\r\n return theHeaders;\r\n}\r\n//# sourceMappingURL=HelperFuncs.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// ###################################################################################################################################################\r\n// Note: DON'T Export these const from the package as we are still targeting IE/ES5 this will export a mutable variables that someone could change ###\r\n// ###################################################################################################################################################\r\nexport var UNDEFINED_VALUE = undefined;\r\nexport var STR_EMPTY = \"\";\r\nexport var STR_CHANNELS = \"channels\";\r\nexport var STR_CORE = \"core\";\r\nexport var STR_CREATE_PERF_MGR = \"createPerfMgr\";\r\nexport var STR_DISABLED = \"disabled\";\r\nexport var STR_EXTENSION_CONFIG = \"extensionConfig\";\r\nexport var STR_EXTENSIONS = \"extensions\";\r\nexport var STR_PROCESS_TELEMETRY = \"processTelemetry\";\r\nexport var STR_PRIORITY = \"priority\";\r\nexport var STR_EVENTS_SENT = \"eventsSent\";\r\nexport var STR_EVENTS_DISCARDED = \"eventsDiscarded\";\r\nexport var STR_EVENTS_SEND_REQUEST = \"eventsSendRequest\";\r\nexport var STR_PERF_EVENT = \"perfEvent\";\r\nexport var STR_OFFLINE_STORE = \"offlineEventsStored\";\r\nexport var STR_OFFLINE_SENT = \"offlineBatchSent\";\r\nexport var STR_OFFLINE_DROP = \"offlineBatchDrop\";\r\nexport var STR_GET_PERF_MGR = \"getPerfMgr\";\r\nexport var STR_DOMAIN = \"domain\";\r\nexport var STR_PATH = \"path\";\r\nexport var STR_NOT_DYNAMIC_ERROR = \"Not dynamic - \";\r\n//# sourceMappingURL=InternalConstants.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { isArray, isFunction, objDefine, utcNow } from \"@nevware21/ts-utils\";\r\nimport { _DYN_GET_CTX, _DYN_IS_CHILD_EVT, _DYN_LENGTH, _DYN_NAME, _DYN_PUSH, _DYN_SET_CTX } from \"../__DynamicConstants\";\r\nimport { STR_GET_PERF_MGR, STR_PERF_EVENT } from \"./InternalConstants\";\r\nvar strExecutionContextKey = \"ctx\";\r\nvar strParentContextKey = \"ParentContextKey\";\r\nvar strChildrenContextKey = \"ChildrenContextKey\";\r\nvar _defaultPerfManager = null;\r\nvar PerfEvent = /** @class */ (function () {\r\n function PerfEvent(name, payloadDetails, isAsync) {\r\n var _self = this;\r\n _self.start = utcNow();\r\n _self[_DYN_NAME /* @min:%2ename */] = name;\r\n _self.isAsync = isAsync;\r\n _self[_DYN_IS_CHILD_EVT /* @min:%2eisChildEvt */] = function () { return false; };\r\n if (isFunction(payloadDetails)) {\r\n // Create an accessor to minimize the potential performance impact of executing the payloadDetails callback\r\n var theDetails_1;\r\n objDefine(_self, \"payload\", {\r\n g: function () {\r\n // Delay the execution of the payloadDetails until needed\r\n if (!theDetails_1 && isFunction(payloadDetails)) {\r\n theDetails_1 = payloadDetails();\r\n // clear it out now so the referenced objects can be garbage collected\r\n payloadDetails = null;\r\n }\r\n return theDetails_1;\r\n }\r\n });\r\n }\r\n _self[_DYN_GET_CTX /* @min:%2egetCtx */] = function (key) {\r\n if (key) {\r\n // The parent and child links are located directly on the object (for better viewing in the DebugPlugin)\r\n if (key === PerfEvent[strParentContextKey] || key === PerfEvent[strChildrenContextKey]) {\r\n return _self[key];\r\n }\r\n return (_self[strExecutionContextKey] || {})[key];\r\n }\r\n return null;\r\n };\r\n _self[_DYN_SET_CTX /* @min:%2esetCtx */] = function (key, value) {\r\n if (key) {\r\n // Put the parent and child links directly on the object (for better viewing in the DebugPlugin)\r\n if (key === PerfEvent[strParentContextKey]) {\r\n // Simple assumption, if we are setting a parent then we must be a child\r\n if (!_self[key]) {\r\n _self[_DYN_IS_CHILD_EVT /* @min:%2eisChildEvt */] = function () { return true; };\r\n }\r\n _self[key] = value;\r\n }\r\n else if (key === PerfEvent[strChildrenContextKey]) {\r\n _self[key] = value;\r\n }\r\n else {\r\n var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};\r\n ctx[key] = value;\r\n }\r\n }\r\n };\r\n _self.complete = function () {\r\n var childTime = 0;\r\n var childEvts = _self[_DYN_GET_CTX /* @min:%2egetCtx */](PerfEvent[strChildrenContextKey]);\r\n if (isArray(childEvts)) {\r\n for (var lp = 0; lp < childEvts[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n var childEvt = childEvts[lp];\r\n if (childEvt) {\r\n childTime += childEvt.time;\r\n }\r\n }\r\n }\r\n _self.time = utcNow() - _self.start;\r\n _self.exTime = _self.time - childTime;\r\n _self.complete = function () { };\r\n };\r\n }\r\n PerfEvent.ParentContextKey = \"parent\";\r\n PerfEvent.ChildrenContextKey = \"childEvts\";\r\n return PerfEvent;\r\n}());\r\nexport { PerfEvent };\r\nvar PerfManager = /** @class */ (function () {\r\n function PerfManager(manager) {\r\n /**\r\n * General bucket used for execution context set and retrieved via setCtx() and getCtx.\r\n * Defined as private so it can be visualized via the DebugPlugin\r\n */\r\n this.ctx = {};\r\n dynamicProto(PerfManager, this, function (_self) {\r\n _self.create = function (src, payloadDetails, isAsync) {\r\n // TODO (@MSNev): at some point we will want to add additional configuration to \"select\" which events to instrument\r\n // for now this is just a simple do everything.\r\n return new PerfEvent(src, payloadDetails, isAsync);\r\n };\r\n _self.fire = function (perfEvent) {\r\n if (perfEvent) {\r\n perfEvent.complete();\r\n if (manager && isFunction(manager[STR_PERF_EVENT /* @min:%2eperfEvent */])) {\r\n manager[STR_PERF_EVENT /* @min:%2eperfEvent */](perfEvent);\r\n }\r\n }\r\n };\r\n _self[_DYN_SET_CTX /* @min:%2esetCtx */] = function (key, value) {\r\n if (key) {\r\n var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};\r\n ctx[key] = value;\r\n }\r\n };\r\n _self[_DYN_GET_CTX /* @min:%2egetCtx */] = function (key) {\r\n return (_self[strExecutionContextKey] || {})[key];\r\n };\r\n });\r\n }\r\n /**\r\n * Create a new event and start timing, the manager may return null/undefined to indicate that it does not\r\n * want to monitor this source event.\r\n * @param src - The source name of the event\r\n * @param payloadDetails - An optional callback function to fetch the payload details for the event.\r\n * @param isAsync - Is the event occurring from a async event\r\n */\r\n PerfManager.prototype.create = function (src, payload, isAsync) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Complete the perfEvent and fire any notifications.\r\n * @param perfEvent - Fire the event which will also complete the passed event\r\n */\r\n PerfManager.prototype.fire = function (perfEvent) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Set an execution context value\r\n * @param key - The context key name\r\n * @param value - The value\r\n */\r\n PerfManager.prototype.setCtx = function (key, value) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Get the execution context value\r\n * @param key - The context key\r\n */\r\n PerfManager.prototype.getCtx = function (key) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return PerfManager;\r\n}());\r\nexport { PerfManager };\r\nvar doPerfActiveKey = \"CoreUtils.doPerf\";\r\n/**\r\n * Helper function to wrap a function with a perf event\r\n * @param mgrSource - The Performance Manager or a Performance provider source (may be null)\r\n * @param getSource - The callback to create the source name for the event (if perf monitoring is enabled)\r\n * @param func - The function to call and measure\r\n * @param details - A function to return the payload details\r\n * @param isAsync - Is the event / function being call asynchronously or synchronously\r\n */\r\nexport function doPerf(mgrSource, getSource, func, details, isAsync) {\r\n if (mgrSource) {\r\n var perfMgr = mgrSource;\r\n if (perfMgr[STR_GET_PERF_MGR]) {\r\n // Looks like a perf manager provider object\r\n perfMgr = perfMgr[STR_GET_PERF_MGR]();\r\n }\r\n if (perfMgr) {\r\n var perfEvt = void 0;\r\n var currentActive = perfMgr[_DYN_GET_CTX /* @min:%2egetCtx */](doPerfActiveKey);\r\n try {\r\n perfEvt = perfMgr.create(getSource(), details, isAsync);\r\n if (perfEvt) {\r\n if (currentActive && perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */]) {\r\n perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */](PerfEvent[strParentContextKey], currentActive);\r\n if (currentActive[_DYN_GET_CTX /* @min:%2egetCtx */] && currentActive[_DYN_SET_CTX /* @min:%2esetCtx */]) {\r\n var children = currentActive[_DYN_GET_CTX /* @min:%2egetCtx */](PerfEvent[strChildrenContextKey]);\r\n if (!children) {\r\n children = [];\r\n currentActive[_DYN_SET_CTX /* @min:%2esetCtx */](PerfEvent[strChildrenContextKey], children);\r\n }\r\n children[_DYN_PUSH /* @min:%2epush */](perfEvt);\r\n }\r\n }\r\n // Set this event as the active event now\r\n perfMgr[_DYN_SET_CTX /* @min:%2esetCtx */](doPerfActiveKey, perfEvt);\r\n return func(perfEvt);\r\n }\r\n }\r\n catch (ex) {\r\n if (perfEvt && perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */]) {\r\n perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */](\"exception\", ex);\r\n }\r\n }\r\n finally {\r\n // fire the perf event\r\n if (perfEvt) {\r\n perfMgr.fire(perfEvt);\r\n }\r\n // Reset the active event to the previous value\r\n perfMgr[_DYN_SET_CTX /* @min:%2esetCtx */](doPerfActiveKey, currentActive);\r\n }\r\n }\r\n }\r\n return func();\r\n}\r\n/**\r\n * Set the global performance manager to use when there is no core instance or it has not been initialized yet.\r\n * @param perfManager - The IPerfManager instance to use when no performance manager is supplied.\r\n */\r\nexport function setGblPerfMgr(perfManager) {\r\n _defaultPerfManager = perfManager;\r\n}\r\n/**\r\n * Get the current global performance manager that will be used with no performance manager is supplied.\r\n * @returns - The current default manager\r\n */\r\nexport function getGblPerfMgr() {\r\n return _defaultPerfManager;\r\n}\r\n//# sourceMappingURL=PerfManager.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { arrForEach, dumpObj, isArray, isFunction, isNullOrUndefined, isUndefined, objForEachKey, objFreeze, objKeys } from \"@nevware21/ts-utils\";\r\nimport { _applyDefaultValue } from \"../Config/ConfigDefaults\";\r\nimport { createDynamicConfig } from \"../Config/DynamicConfig\";\r\nimport { _DYN_CREATE_NEW, _DYN_DIAG_LOG, _DYN_GET_NEXT, _DYN_GET_PLUGIN, _DYN_IDENTIFIER, _DYN_IS_INITIALIZED, _DYN_LENGTH, _DYN_LOGGER, _DYN_PROCESS_NEXT, _DYN_PUSH, _DYN_SET_NEXT_PLUGIN, _DYN_TEARDOWN, _DYN_UNLOAD, _DYN_UPDATE } from \"../__DynamicConstants\";\r\nimport { _throwInternal, safeGetLogger } from \"./DiagnosticLogger\";\r\nimport { proxyFunctions } from \"./HelperFuncs\";\r\nimport { STR_CORE, STR_DISABLED, STR_EMPTY, STR_EXTENSION_CONFIG, STR_PRIORITY, STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nimport { doPerf } from \"./PerfManager\";\r\nimport { _getPluginState } from \"./TelemetryHelpers\";\r\nvar strTelemetryPluginChain = \"TelemetryPluginChain\";\r\nvar strHasRunFlags = \"_hasRun\";\r\nvar strGetTelCtx = \"_getTelCtx\";\r\nvar _chainId = 0;\r\nfunction _getNextProxyStart(proxy, core, startAt) {\r\n while (proxy) {\r\n if (proxy[_DYN_GET_PLUGIN /* @min:%2egetPlugin */]() === startAt) {\r\n return proxy;\r\n }\r\n proxy = proxy[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n }\r\n // This wasn't found in the existing chain so create an isolated one with just this plugin\r\n return createTelemetryProxyChain([startAt], core.config || {}, core);\r\n}\r\n/**\r\n * @ignore\r\n * @param telemetryChain\r\n * @param dynamicHandler\r\n * @param core\r\n * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n * @returns\r\n */\r\nfunction _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {\r\n // We have a special case where we want to start execution from this specific plugin\r\n // or we simply reuse the existing telemetry plugin chain (normal execution case)\r\n var _nextProxy = null; // By Default set as no next plugin\r\n var _onComplete = [];\r\n if (!dynamicHandler) {\r\n dynamicHandler = createDynamicConfig({}, null, core[_DYN_LOGGER /* @min:%2elogger */]);\r\n }\r\n if (startAt !== null) {\r\n // There is no next element (null) vs not defined (undefined) so use the full chain\r\n _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain;\r\n }\r\n var context = {\r\n _next: _moveNext,\r\n ctx: {\r\n core: function () {\r\n return core;\r\n },\r\n diagLog: function () {\r\n return safeGetLogger(core, dynamicHandler.cfg);\r\n },\r\n getCfg: function () {\r\n return dynamicHandler.cfg;\r\n },\r\n getExtCfg: _resolveExtCfg,\r\n getConfig: _getConfig,\r\n hasNext: function () {\r\n return !!_nextProxy;\r\n },\r\n getNext: function () {\r\n return _nextProxy;\r\n },\r\n setNext: function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n },\r\n iterate: _iterateChain,\r\n onComplete: _addOnComplete\r\n }\r\n };\r\n function _addOnComplete(onComplete, that) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n if (onComplete) {\r\n _onComplete[_DYN_PUSH /* @min:%2epush */]({\r\n func: onComplete,\r\n self: !isUndefined(that) ? that : context.ctx,\r\n args: args\r\n });\r\n }\r\n }\r\n function _moveNext() {\r\n var nextProxy = _nextProxy;\r\n // Automatically move to the next plugin\r\n _nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT /* @min:%2egetNext */]() : null;\r\n if (!nextProxy) {\r\n var onComplete = _onComplete;\r\n if (onComplete && onComplete[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(onComplete, function (completeDetails) {\r\n try {\r\n completeDetails.func.call(completeDetails.self, completeDetails.args);\r\n }\r\n catch (e) {\r\n _throwInternal(core[_DYN_LOGGER /* @min:%2elogger */], 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, \"Unexpected Exception during onComplete - \" + dumpObj(e));\r\n }\r\n });\r\n _onComplete = [];\r\n }\r\n }\r\n return nextProxy;\r\n }\r\n function _getExtCfg(identifier, createIfMissing) {\r\n var idCfg = null;\r\n var cfg = dynamicHandler.cfg;\r\n if (cfg && identifier) {\r\n var extCfg = cfg[STR_EXTENSION_CONFIG /* @min:%2eextensionConfig */];\r\n if (!extCfg && createIfMissing) {\r\n extCfg = {};\r\n }\r\n // Always set the value so that the property always exists\r\n cfg[STR_EXTENSION_CONFIG] = extCfg; // Note: it is valid for the \"value\" to be undefined\r\n // Calling `ref()` has a side effect of causing the referenced property to become dynamic (if not already)\r\n extCfg = dynamicHandler.ref(cfg, STR_EXTENSION_CONFIG);\r\n if (extCfg) {\r\n idCfg = extCfg[identifier];\r\n if (!idCfg && createIfMissing) {\r\n idCfg = {};\r\n }\r\n // Always set the value so that the property always exists\r\n extCfg[identifier] = idCfg; // Note: it is valid for the \"value\" to be undefined\r\n // Calling `ref()` has a side effect of causing the referenced property to become dynamic (if not already)\r\n idCfg = dynamicHandler.ref(extCfg, identifier);\r\n }\r\n }\r\n return idCfg;\r\n }\r\n function _resolveExtCfg(identifier, defaultValues) {\r\n var newConfig = _getExtCfg(identifier, true);\r\n if (defaultValues) {\r\n // Enumerate over the defaultValues and if not already populated attempt to\r\n // find a value from the root config or use the default value\r\n objForEachKey(defaultValues, function (field, defaultValue) {\r\n // for each unspecified field, set the default value\r\n if (isNullOrUndefined(newConfig[field])) {\r\n var cfgValue = dynamicHandler.cfg[field];\r\n if (cfgValue || !isNullOrUndefined(cfgValue)) {\r\n newConfig[field] = cfgValue;\r\n }\r\n }\r\n _applyDefaultValue(dynamicHandler, newConfig, field, defaultValue);\r\n });\r\n }\r\n return dynamicHandler.setDf(newConfig, defaultValues);\r\n }\r\n function _getConfig(identifier, field, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var theValue;\r\n var extConfig = _getExtCfg(identifier, false);\r\n var rootConfig = dynamicHandler.cfg;\r\n if (extConfig && (extConfig[field] || !isNullOrUndefined(extConfig[field]))) {\r\n theValue = extConfig[field];\r\n }\r\n else if (rootConfig[field] || !isNullOrUndefined(rootConfig[field])) {\r\n theValue = rootConfig[field];\r\n }\r\n return (theValue || !isNullOrUndefined(theValue)) ? theValue : defaultValue;\r\n }\r\n function _iterateChain(cb) {\r\n // Keep processing until we reach the end of the chain\r\n var nextPlugin;\r\n while (!!(nextPlugin = context._next())) {\r\n var plugin = nextPlugin[_DYN_GET_PLUGIN /* @min:%2egetPlugin */]();\r\n if (plugin) {\r\n // callback with the current on\r\n cb(plugin);\r\n }\r\n }\r\n }\r\n return context;\r\n}\r\n/**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n */\r\nexport function createProcessTelemetryContext(telemetryChain, cfg, core, startAt) {\r\n var config = createDynamicConfig(cfg);\r\n var internalContext = _createInternalContext(telemetryChain, config, core, startAt);\r\n var context = internalContext.ctx;\r\n function _processNext(env) {\r\n var nextPlugin = internalContext._next();\r\n if (nextPlugin) {\r\n // Run the next plugin which will call \"processNext()\"\r\n nextPlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */](env, context);\r\n }\r\n return !nextPlugin;\r\n }\r\n function _createNew(plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n if (isArray(plugins)) {\r\n plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);\r\n }\r\n return createProcessTelemetryContext(plugins || context[_DYN_GET_NEXT /* @min:%2egetNext */](), config.cfg, core, startAt);\r\n }\r\n context[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = _processNext;\r\n context[_DYN_CREATE_NEW /* @min:%2ecreateNew */] = _createNew;\r\n return context;\r\n}\r\n/**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain for handling the unloading of the chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n */\r\nexport function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) {\r\n var config = createDynamicConfig(core.config);\r\n var internalContext = _createInternalContext(telemetryChain, config, core, startAt);\r\n var context = internalContext.ctx;\r\n function _processNext(unloadState) {\r\n var nextPlugin = internalContext._next();\r\n nextPlugin && nextPlugin[_DYN_UNLOAD /* @min:%2eunload */](context, unloadState);\r\n return !nextPlugin;\r\n }\r\n function _createNew(plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n if (isArray(plugins)) {\r\n plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);\r\n }\r\n return createProcessTelemetryUnloadContext(plugins || context[_DYN_GET_NEXT /* @min:%2egetNext */](), core, startAt);\r\n }\r\n context[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = _processNext;\r\n context[_DYN_CREATE_NEW /* @min:%2ecreateNew */] = _createNew;\r\n return context;\r\n}\r\n/**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain for updating the configuration\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n */\r\nexport function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) {\r\n var config = createDynamicConfig(core.config);\r\n var internalContext = _createInternalContext(telemetryChain, config, core, startAt);\r\n var context = internalContext.ctx;\r\n function _processNext(updateState) {\r\n return context.iterate(function (plugin) {\r\n if (isFunction(plugin[_DYN_UPDATE /* @min:%2eupdate */])) {\r\n plugin[_DYN_UPDATE /* @min:%2eupdate */](context, updateState);\r\n }\r\n });\r\n }\r\n function _createNew(plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n if (isArray(plugins)) {\r\n plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);\r\n }\r\n return createProcessTelemetryUpdateContext(plugins || context[_DYN_GET_NEXT /* @min:%2egetNext */](), core, startAt);\r\n }\r\n context[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = _processNext;\r\n context[_DYN_CREATE_NEW /* @min:%2ecreateNew */] = _createNew;\r\n return context;\r\n}\r\n/**\r\n * Creates an execution chain from the array of plugins\r\n * @param plugins - The array of plugins that will be executed in this order\r\n * @param defItemCtx - The default execution context to use when no telemetry context is passed to processTelemetry(), this\r\n * should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error\r\n * reporting (hasRun) when errors occur.\r\n */\r\nexport function createTelemetryProxyChain(plugins, config, core, startAt) {\r\n var firstProxy = null;\r\n var add = startAt ? false : true;\r\n if (isArray(plugins) && plugins[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n // Create the proxies and wire up the next plugin chain\r\n var lastProxy_1 = null;\r\n arrForEach(plugins, function (thePlugin) {\r\n if (!add && startAt === thePlugin) {\r\n add = true;\r\n }\r\n if (add && thePlugin && isFunction(thePlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */])) {\r\n // Only add plugins that are processors\r\n var newProxy = createTelemetryPluginProxy(thePlugin, config, core);\r\n if (!firstProxy) {\r\n firstProxy = newProxy;\r\n }\r\n if (lastProxy_1) {\r\n // Set this new proxy as the next for the previous one\r\n lastProxy_1._setNext(newProxy);\r\n }\r\n lastProxy_1 = newProxy;\r\n }\r\n });\r\n }\r\n if (startAt && !firstProxy) {\r\n // Special case where the \"startAt\" was not in the original list of plugins\r\n return createTelemetryProxyChain([startAt], config, core);\r\n }\r\n return firstProxy;\r\n}\r\n/**\r\n * Create the processing telemetry proxy instance, the proxy is used to abstract the current plugin to allow monitoring and\r\n * execution plugins while passing around the dynamic execution state (IProcessTelemetryContext), the proxy instance no longer\r\n * contains any execution state and can be reused between requests (this was not the case for 2.7.2 and earlier with the\r\n * TelemetryPluginChain class).\r\n * @param plugin - The plugin instance to proxy\r\n * @param config - The default execution context to use when no telemetry context is passed to processTelemetry(), this\r\n * should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error\r\n * reporting (hasRun) when errors occur.\r\n * @returns\r\n */\r\nexport function createTelemetryPluginProxy(plugin, config, core) {\r\n var nextProxy = null;\r\n var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */]);\r\n var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */]);\r\n var chainId;\r\n if (plugin) {\r\n chainId = plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] + \"-\" + plugin[STR_PRIORITY /* @min:%2epriority */] + \"-\" + _chainId++;\r\n }\r\n else {\r\n chainId = \"Unknown-0-\" + _chainId++;\r\n }\r\n var proxyChain = {\r\n getPlugin: function () {\r\n return plugin;\r\n },\r\n getNext: function () {\r\n return nextProxy;\r\n },\r\n processTelemetry: _processTelemetry,\r\n unload: _unloadPlugin,\r\n update: _updatePlugin,\r\n _id: chainId,\r\n _setNext: function (nextPlugin) {\r\n nextProxy = nextPlugin;\r\n }\r\n };\r\n function _getTelCtx() {\r\n var itemCtx;\r\n // Looks like a plugin didn't pass the (optional) context, so create a new one\r\n if (plugin && isFunction(plugin[strGetTelCtx])) {\r\n // This plugin extends from the BaseTelemetryPlugin so lets use it\r\n itemCtx = plugin[strGetTelCtx]();\r\n }\r\n if (!itemCtx) {\r\n // Create a temporary one\r\n itemCtx = createProcessTelemetryContext(proxyChain, config, core);\r\n }\r\n return itemCtx;\r\n }\r\n function _processChain(itemCtx, processPluginFn, name, details, isAsync) {\r\n var hasRun = false;\r\n var identifier = plugin ? plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] : strTelemetryPluginChain;\r\n var hasRunContext = itemCtx[strHasRunFlags];\r\n if (!hasRunContext) {\r\n // Assign and populate\r\n hasRunContext = itemCtx[strHasRunFlags] = {};\r\n }\r\n // Ensure that we keep the context in sync\r\n itemCtx.setNext(nextProxy);\r\n if (plugin) {\r\n doPerf(itemCtx[STR_CORE /* @min:%2ecore */](), function () { return identifier + \":\" + name; }, function () {\r\n // Mark this component as having run\r\n hasRunContext[chainId] = true;\r\n try {\r\n // Set a flag on the next plugin so we know if it was attempted to be executed\r\n var nextId = nextProxy ? nextProxy._id : STR_EMPTY;\r\n if (nextId) {\r\n hasRunContext[nextId] = false;\r\n }\r\n hasRun = processPluginFn(itemCtx);\r\n }\r\n catch (error) {\r\n var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true;\r\n if (hasNextRun) {\r\n // The next plugin after us has already run so set this one as complete\r\n hasRun = true;\r\n }\r\n if (!nextProxy || !hasNextRun) {\r\n // Either we have no next plugin or the current one did not attempt to call the next plugin\r\n // Which means the current one is the root of the failure so log/report this failure\r\n _throwInternal(itemCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 73 /* _eInternalMessageId.PluginException */, \"Plugin [\" + identifier + \"] failed during \" + name + \" - \" + dumpObj(error) + \", run flags: \" + dumpObj(hasRunContext));\r\n }\r\n }\r\n }, details, isAsync);\r\n }\r\n return hasRun;\r\n }\r\n function _processTelemetry(env, itemCtx) {\r\n itemCtx = itemCtx || _getTelCtx();\r\n function _callProcessTelemetry(itemCtx) {\r\n if (!plugin || !hasProcessTelemetry) {\r\n return false;\r\n }\r\n var pluginState = _getPluginState(plugin);\r\n if (pluginState[_DYN_TEARDOWN /* @min:%2eteardown */] || pluginState[STR_DISABLED]) {\r\n return false;\r\n }\r\n // Ensure that we keep the context in sync (for processNext()), just in case a plugin\r\n // doesn't calls processTelemetry() instead of itemContext.processNext() or some\r\n // other form of error occurred\r\n if (hasSetNext) {\r\n // Backward compatibility setting the next plugin on the instance\r\n plugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */](nextProxy);\r\n }\r\n plugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */](env, itemCtx);\r\n // Process Telemetry is expected to call itemCtx.processNext() or nextPlugin.processTelemetry()\r\n return true;\r\n }\r\n if (!_processChain(itemCtx, _callProcessTelemetry, \"processTelemetry\", function () { return ({ item: env }); }, !(env.sync))) {\r\n // The underlying plugin is either not defined, not enabled or does not have a processTelemetry implementation\r\n // so we still want the next plugin to be executed.\r\n itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](env);\r\n }\r\n }\r\n function _unloadPlugin(unloadCtx, unloadState) {\r\n function _callTeardown() {\r\n // Setting default of hasRun as false so the proxyProcessFn() is called as teardown() doesn't have to exist or call unloadNext().\r\n var hasRun = false;\r\n if (plugin) {\r\n var pluginState = _getPluginState(plugin);\r\n var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE /* @min:%2ecore */];\r\n // Only teardown the plugin if it was initialized by the current core (i.e. It's not a shared plugin)\r\n if (plugin && (!pluginCore || pluginCore === unloadCtx.core()) && !pluginState[_DYN_TEARDOWN /* @min:%2eteardown */]) {\r\n // Handle plugins that don't extend from the BaseTelemetryPlugin\r\n pluginState[STR_CORE /* @min:%2ecore */] = null;\r\n pluginState[_DYN_TEARDOWN /* @min:%2eteardown */] = true;\r\n pluginState[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = false;\r\n if (plugin[_DYN_TEARDOWN /* @min:%2eteardown */] && plugin[_DYN_TEARDOWN /* @min:%2eteardown */](unloadCtx, unloadState) === true) {\r\n // plugin told us that it was going to (or has) call unloadCtx.processNext()\r\n hasRun = true;\r\n }\r\n }\r\n }\r\n return hasRun;\r\n }\r\n if (!_processChain(unloadCtx, _callTeardown, \"unload\", function () { }, unloadState.isAsync)) {\r\n // Only called if we hasRun was not true\r\n unloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](unloadState);\r\n }\r\n }\r\n function _updatePlugin(updateCtx, updateState) {\r\n function _callUpdate() {\r\n // Setting default of hasRun as false so the proxyProcessFn() is called as teardown() doesn't have to exist or call unloadNext().\r\n var hasRun = false;\r\n if (plugin) {\r\n var pluginState = _getPluginState(plugin);\r\n var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE /* @min:%2ecore */];\r\n // Only update the plugin if it was initialized by the current core (i.e. It's not a shared plugin)\r\n if (plugin && (!pluginCore || pluginCore === updateCtx.core()) && !pluginState[_DYN_TEARDOWN /* @min:%2eteardown */]) {\r\n if (plugin[_DYN_UPDATE /* @min:%2eupdate */] && plugin[_DYN_UPDATE /* @min:%2eupdate */](updateCtx, updateState) === true) {\r\n // plugin told us that it was going to (or has) call unloadCtx.processNext()\r\n hasRun = true;\r\n }\r\n }\r\n }\r\n return hasRun;\r\n }\r\n if (!_processChain(updateCtx, _callUpdate, \"update\", function () { }, false)) {\r\n // Only called if we hasRun was not true\r\n updateCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](updateState);\r\n }\r\n }\r\n return objFreeze(proxyChain);\r\n}\r\n/**\r\n * This class will be removed!\r\n * @deprecated use createProcessTelemetryContext() instead\r\n */\r\nvar ProcessTelemetryContext = /** @class */ (function () {\r\n /**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n */\r\n function ProcessTelemetryContext(pluginChain, config, core, startAt) {\r\n var _self = this;\r\n var context = createProcessTelemetryContext(pluginChain, config, core, startAt);\r\n // Proxy all functions of the context to this object\r\n proxyFunctions(_self, context, objKeys(context));\r\n }\r\n return ProcessTelemetryContext;\r\n}());\r\nexport { ProcessTelemetryContext };\r\n//# sourceMappingURL=ProcessTelemetryContext.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { mathFloor, utcNow } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nimport { getCrypto, getMsCrypto, isIE } from \"./EnvUtils\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nvar UInt32Mask = 0x100000000;\r\nvar MaxUInt32 = 0xffffffff;\r\nvar SEED1 = 123456789;\r\nvar SEED2 = 987654321;\r\n// MWC based Random generator (for IE)\r\nvar _mwcSeeded = false;\r\nvar _mwcW = SEED1;\r\nvar _mwcZ = SEED2;\r\n// Takes any integer\r\nfunction _mwcSeed(seedValue) {\r\n if (seedValue < 0) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n seedValue >>>= 0;\r\n }\r\n _mwcW = (SEED1 + seedValue) & MaxUInt32;\r\n _mwcZ = (SEED2 - seedValue) & MaxUInt32;\r\n _mwcSeeded = true;\r\n}\r\nfunction _autoSeedMwc() {\r\n // Simple initialization using default Math.random() - So we inherit any entropy from the browser\r\n // and bitwise XOR with the current milliseconds\r\n try {\r\n var now = utcNow() & 0x7fffffff;\r\n _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);\r\n }\r\n catch (e) {\r\n // Don't crash if something goes wrong\r\n }\r\n}\r\n/**\r\n * Generate a random value between 0 and maxValue, max value should be limited to a 32-bit maximum.\r\n * So maxValue(16) will produce a number from 0..16 (range of 17)\r\n * @param maxValue - The max value for the range\r\n */\r\nexport function randomValue(maxValue) {\r\n if (maxValue > 0) {\r\n return mathFloor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;\r\n }\r\n return 0;\r\n}\r\n/**\r\n * generate a random 32-bit number (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), defaults un-unsigned.\r\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\r\n */\r\nexport function random32(signed) {\r\n var value = 0;\r\n var c = getCrypto() || getMsCrypto();\r\n if (c && c.getRandomValues) {\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;\r\n }\r\n if (value === 0 && isIE()) {\r\n // For IE 6, 7, 8 (especially on XP) Math.random is not very random\r\n if (!_mwcSeeded) {\r\n // Set the seed for the Mwc algorithm\r\n _autoSeedMwc();\r\n }\r\n // Don't use Math.random for IE\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = mwcRandom32() & MaxUInt32;\r\n }\r\n if (value === 0) {\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = mathFloor((UInt32Mask * Math.random()) | 0);\r\n }\r\n if (!signed) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n value >>>= 0;\r\n }\r\n return value;\r\n}\r\n/**\r\n * Seed the MWC random number generator with the specified seed or a random value\r\n * @param value - optional the number to used as the seed, if undefined, null or zero a random value will be chosen\r\n */\r\nexport function mwcRandomSeed(value) {\r\n if (!value) {\r\n _autoSeedMwc();\r\n }\r\n else {\r\n _mwcSeed(value);\r\n }\r\n}\r\n/**\r\n * Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry)\r\n * instead of Math.random() defaults to un-signed.\r\n * Used as a replacement random generator for IE to avoid issues with older IE instances.\r\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\r\n */\r\nexport function mwcRandom32(signed) {\r\n _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;\r\n _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;\r\n var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;\r\n if (!signed) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n value >>>= 0;\r\n }\r\n return value;\r\n}\r\n/**\r\n * Generate random base64 id string.\r\n * The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)\r\n * @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22\r\n */\r\nexport function newId(maxLength) {\r\n if (maxLength === void 0) { maxLength = 22; }\r\n var base64chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n // Start with an initial random number, consuming the value in reverse byte order\r\n var number = random32() >>> 0; // Make sure it's a +ve number\r\n var chars = 0;\r\n var result = STR_EMPTY;\r\n while (result[_DYN_LENGTH /* @min:%2elength */] < maxLength) {\r\n chars++;\r\n result += base64chars.charAt(number & 0x3F);\r\n number >>>= 6; // Zero fill with right shift\r\n if (chars === 5) {\r\n // 5 base64 characters === 30 bits so we don't have enough bits for another base64 char\r\n // So add on another 30 bits and make sure it's +ve\r\n number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;\r\n chars = 0; // We need to reset the number every 5 chars (30 bits)\r\n }\r\n }\r\n return result;\r\n}\r\n//# sourceMappingURL=RandomHelper.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { arrForEach, isFunction } from \"@nevware21/ts-utils\";\r\nimport { _DYN_GET_NEXT, _DYN_GET_PLUGIN, _DYN_INITIALIZE, _DYN_IS_INITIALIZED, _DYN_LENGTH, _DYN_NAME, _DYN_PUSH, _DYN_SET_NEXT_PLUGIN, _DYN_TEARDOWN, _DYN_TRACE_FLAGS, _DYN__DO_TEARDOWN } from \"../__DynamicConstants\";\r\nimport { createElmNodeData } from \"./DataCacheHelper\";\r\nimport { STR_CORE, STR_PRIORITY, STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nimport { isValidSpanId, isValidTraceId } from \"./W3cTraceParent\";\r\nvar pluginStateData = createElmNodeData(\"plugin\");\r\nexport function _getPluginState(plugin) {\r\n return pluginStateData.get(plugin, \"state\", {}, true);\r\n}\r\n/**\r\n * Initialize the queue of plugins\r\n * @param plugins - The array of plugins to initialize and setting of the next plugin\r\n * @param config - The current config for the instance\r\n * @param core - THe current core instance\r\n * @param extensions - The extensions\r\n */\r\nexport function initializePlugins(processContext, extensions) {\r\n // Set the next plugin and identified the uninitialized plugins\r\n var initPlugins = [];\r\n var lastPlugin = null;\r\n var proxy = processContext[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n var pluginState;\r\n while (proxy) {\r\n var thePlugin = proxy[_DYN_GET_PLUGIN /* @min:%2egetPlugin */]();\r\n if (thePlugin) {\r\n if (lastPlugin && lastPlugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */] && thePlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */]) {\r\n // Set this plugin as the next for the previous one\r\n lastPlugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */](thePlugin);\r\n }\r\n pluginState = _getPluginState(thePlugin);\r\n var isInitialized = !!pluginState[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */];\r\n if (thePlugin[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]) {\r\n isInitialized = thePlugin[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]();\r\n }\r\n if (!isInitialized) {\r\n initPlugins[_DYN_PUSH /* @min:%2epush */](thePlugin);\r\n }\r\n lastPlugin = thePlugin;\r\n proxy = proxy[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n }\r\n }\r\n // Now initialize the plugins\r\n arrForEach(initPlugins, function (thePlugin) {\r\n var core = processContext[STR_CORE /* @min:%2ecore */]();\r\n thePlugin[_DYN_INITIALIZE /* @min:%2einitialize */](processContext.getCfg(), core, extensions, processContext[_DYN_GET_NEXT /* @min:%2egetNext */]());\r\n pluginState = _getPluginState(thePlugin);\r\n // Only add the core to the state if the plugin didn't set it (doesn't extend from BaseTelemetryPlugin)\r\n if (!thePlugin[STR_CORE] && !pluginState[STR_CORE]) {\r\n pluginState[STR_CORE] = core;\r\n }\r\n pluginState[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = true;\r\n delete pluginState[_DYN_TEARDOWN /* @min:%2eteardown */];\r\n });\r\n}\r\nexport function sortPlugins(plugins) {\r\n // Sort by priority\r\n return plugins.sort(function (extA, extB) {\r\n var result = 0;\r\n if (extB) {\r\n var bHasProcess = extB[STR_PROCESS_TELEMETRY];\r\n if (extA[STR_PROCESS_TELEMETRY]) {\r\n result = bHasProcess ? extA[STR_PRIORITY] - extB[STR_PRIORITY] : 1;\r\n }\r\n else if (bHasProcess) {\r\n result = -1;\r\n }\r\n }\r\n else {\r\n result = extA ? 1 : -1;\r\n }\r\n return result;\r\n });\r\n // sort complete\r\n}\r\n/**\r\n * Teardown / Unload helper to perform teardown/unloading operations for the provided components synchronously or asynchronously, this will call any\r\n * _doTeardown() or _doUnload() functions on the provided components to allow them to finish removal.\r\n * @param components - The components you want to unload\r\n * @param unloadCtx - This is the context that should be used during unloading.\r\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\r\n * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.\r\n * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.\r\n */\r\nexport function unloadComponents(components, unloadCtx, unloadState, asyncCallback) {\r\n var idx = 0;\r\n function _doUnload() {\r\n while (idx < components[_DYN_LENGTH /* @min:%2elength */]) {\r\n var component = components[idx++];\r\n if (component) {\r\n var func = component._doUnload || component[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */];\r\n if (isFunction(func)) {\r\n if (func.call(component, unloadCtx, unloadState, _doUnload) === true) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return _doUnload();\r\n}\r\n/**\r\n * Creates a IDistributedTraceContext which optionally also \"sets\" the value on a parent\r\n * @param parentCtx - An optional parent distributed trace instance\r\n * @returns A new IDistributedTraceContext instance that uses an internal temporary object\r\n */\r\nexport function createDistributedTraceContext(parentCtx) {\r\n var trace = {};\r\n return {\r\n getName: function () {\r\n return trace[_DYN_NAME /* @min:%2ename */];\r\n },\r\n setName: function (newValue) {\r\n parentCtx && parentCtx.setName(newValue);\r\n trace[_DYN_NAME /* @min:%2ename */] = newValue;\r\n },\r\n getTraceId: function () {\r\n return trace.traceId;\r\n },\r\n setTraceId: function (newValue) {\r\n parentCtx && parentCtx.setTraceId(newValue);\r\n if (isValidTraceId(newValue)) {\r\n trace.traceId = newValue;\r\n }\r\n },\r\n getSpanId: function () {\r\n return trace.spanId;\r\n },\r\n setSpanId: function (newValue) {\r\n parentCtx && parentCtx.setSpanId(newValue);\r\n if (isValidSpanId(newValue)) {\r\n trace.spanId = newValue;\r\n }\r\n },\r\n getTraceFlags: function () {\r\n return trace[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n },\r\n setTraceFlags: function (newTraceFlags) {\r\n parentCtx && parentCtx.setTraceFlags(newTraceFlags);\r\n trace[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = newTraceFlags;\r\n }\r\n };\r\n}\r\n//# sourceMappingURL=TelemetryHelpers.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_DIAG_LOG, _DYN_PUSH } from \"../__DynamicConstants\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nexport function createUnloadHandlerContainer() {\r\n var handlers = [];\r\n function _addHandler(handler) {\r\n if (handler) {\r\n handlers[_DYN_PUSH /* @min:%2epush */](handler);\r\n }\r\n }\r\n function _runHandlers(unloadCtx, unloadState) {\r\n arrForEach(handlers, function (handler) {\r\n try {\r\n handler(unloadCtx, unloadState);\r\n }\r\n catch (e) {\r\n _throwInternal(unloadCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, \"Unexpected error calling unload handler - \" + dumpObj(e));\r\n }\r\n });\r\n handlers = [];\r\n }\r\n return {\r\n add: _addHandler,\r\n run: _runHandlers\r\n };\r\n}\r\n//# sourceMappingURL=UnloadHandlerContainer.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrAppend, arrForEach, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nvar _maxHooks;\r\nvar _hookAddMonitor;\r\n/**\r\n * Test hook for setting the maximum number of unload hooks and calling a monitor function when the hooks are added or removed\r\n * This allows for automatic test failure when the maximum number of unload hooks is exceeded\r\n * @param maxHooks - The maximum number of unload hooks\r\n * @param addMonitor - The monitor function to call when hooks are added or removed\r\n */\r\nexport function _testHookMaxUnloadHooksCb(maxHooks, addMonitor) {\r\n _maxHooks = maxHooks;\r\n _hookAddMonitor = addMonitor;\r\n}\r\n/**\r\n * Create a IUnloadHookContainer which can be used to remember unload hook functions to be executed during the component unloading\r\n * process.\r\n * @returns A new IUnloadHookContainer instance\r\n */\r\nexport function createUnloadHookContainer() {\r\n var _hooks = [];\r\n function _doUnload(logger) {\r\n var oldHooks = _hooks;\r\n _hooks = [];\r\n // Remove all registered unload hooks\r\n arrForEach(oldHooks, function (fn) {\r\n // allow either rm or remove callback function\r\n try {\r\n (fn.rm || fn.remove).call(fn);\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, \"Unloading:\" + dumpObj(e));\r\n }\r\n });\r\n if (_maxHooks && oldHooks[_DYN_LENGTH /* @min:%2elength */] > _maxHooks) {\r\n _hookAddMonitor ? _hookAddMonitor(\"doUnload\", oldHooks) : _throwInternal(null, 1 /* eLoggingSeverity.CRITICAL */, 48 /* _eInternalMessageId.MaxUnloadHookExceeded */, \"Max unload hooks exceeded. An excessive number of unload hooks has been detected.\");\r\n }\r\n }\r\n function _addHook(hooks) {\r\n if (hooks) {\r\n arrAppend(_hooks, hooks);\r\n if (_maxHooks && _hooks[_DYN_LENGTH /* @min:%2elength */] > _maxHooks) {\r\n _hookAddMonitor ? _hookAddMonitor(\"Add\", _hooks) : _throwInternal(null, 1 /* eLoggingSeverity.CRITICAL */, 48 /* _eInternalMessageId.MaxUnloadHookExceeded */, \"Max unload hooks exceeded. An excessive number of unload hooks has been detected.\");\r\n }\r\n }\r\n }\r\n return {\r\n run: _doUnload,\r\n add: _addHook\r\n };\r\n}\r\n//# sourceMappingURL=UnloadHookContainer.js.map","import { arrForEach, isArray, isString, strLeft, strTrim } from \"@nevware21/ts-utils\";\r\nimport { _DYN_GET_ATTRIBUTE, _DYN_LENGTH, _DYN_PUSH, _DYN_SPLIT, _DYN_TO_LOWER_CASE, _DYN_TRACE_FLAGS, _DYN_VERSION } from \"../__DynamicConstants\";\r\nimport { generateW3CId } from \"./CoreUtils\";\r\nimport { findMetaTag, findNamedServerTiming } from \"./EnvUtils\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\n// using {0,16} for leading and trailing whitespace just to constrain the possible runtime of a random string\r\nvar TRACE_PARENT_REGEX = /^([\\da-f]{2})-([\\da-f]{32})-([\\da-f]{16})-([\\da-f]{2})(-[^\\s]{1,64})?$/i;\r\nvar DEFAULT_VERSION = \"00\";\r\nvar INVALID_VERSION = \"ff\";\r\nvar INVALID_TRACE_ID = \"00000000000000000000000000000000\";\r\nvar INVALID_SPAN_ID = \"0000000000000000\";\r\nvar SAMPLED_FLAG = 0x01;\r\nfunction _isValid(value, len, invalidValue) {\r\n if (value && value[_DYN_LENGTH /* @min:%2elength */] === len && value !== invalidValue) {\r\n return !!value.match(/^[\\da-f]*$/i);\r\n }\r\n return false;\r\n}\r\nfunction _formatValue(value, len, defValue) {\r\n if (_isValid(value, len)) {\r\n return value;\r\n }\r\n return defValue;\r\n}\r\nfunction _formatFlags(value) {\r\n if (isNaN(value) || value < 0 || value > 255) {\r\n value = 0x01;\r\n }\r\n var result = value.toString(16);\r\n while (result[_DYN_LENGTH /* @min:%2elength */] < 2) {\r\n result = \"0\" + result;\r\n }\r\n return result;\r\n}\r\n/**\r\n * Create a new ITraceParent instance using the provided values.\r\n * @param traceId - The traceId to use, when invalid a new random W3C id will be generated.\r\n * @param spanId - The parent/span id to use, a new random value will be generated if it is invalid.\r\n * @param flags - The traceFlags to use, defaults to zero (0) if not supplied or invalid\r\n * @param version - The version to used, defaults to version \"01\" if not supplied or invalid.\r\n * @returns\r\n */\r\nexport function createTraceParent(traceId, spanId, flags, version) {\r\n return {\r\n version: _isValid(version, 2, INVALID_VERSION) ? version : DEFAULT_VERSION,\r\n traceId: isValidTraceId(traceId) ? traceId : generateW3CId(),\r\n spanId: isValidSpanId(spanId) ? spanId : strLeft(generateW3CId(), 16),\r\n traceFlags: flags >= 0 && flags <= 0xFF ? flags : 1\r\n };\r\n}\r\n/**\r\n * Attempt to parse the provided string as a W3C TraceParent header value (https://www.w3.org/TR/trace-context/#traceparent-header)\r\n *\r\n * @param value - The value to be parsed\r\n * @param selectIdx - If the found value is comma separated which is the preferred entry to select, defaults to the first\r\n * @returns\r\n */\r\nexport function parseTraceParent(value, selectIdx) {\r\n if (!value) {\r\n // Don't pass a null/undefined or empty string\r\n return null;\r\n }\r\n if (isArray(value)) {\r\n // The value may have been encoded on the page into an array so handle this automatically\r\n value = value[0] || \"\";\r\n }\r\n if (!value || !isString(value) || value[_DYN_LENGTH /* @min:%2elength */] > 8192) {\r\n // limit potential processing based on total length\r\n return null;\r\n }\r\n if (value.indexOf(\",\") !== -1) {\r\n var values = value[_DYN_SPLIT /* @min:%2esplit */](\",\");\r\n value = values[selectIdx > 0 && values[_DYN_LENGTH /* @min:%2elength */] > selectIdx ? selectIdx : 0];\r\n }\r\n // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent\r\n var match = TRACE_PARENT_REGEX.exec(strTrim(value));\r\n if (!match || // No match\r\n match[1] === INVALID_VERSION || // version ff is forbidden\r\n match[2] === INVALID_TRACE_ID || // All zeros is considered to be invalid\r\n match[3] === INVALID_SPAN_ID) { // All zeros is considered to be invalid\r\n return null;\r\n }\r\n return {\r\n version: (match[1] || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](),\r\n traceId: (match[2] || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](),\r\n spanId: (match[3] || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](),\r\n traceFlags: parseInt(match[4], 16)\r\n };\r\n}\r\n/**\r\n * Is the provided W3c Trace Id a valid string representation, it must be a 32-character string\r\n * of lowercase hexadecimal characters for example, 4bf92f3577b34da6a3ce929d0e0e4736.\r\n * If all characters as zero (00000000000000000000000000000000) it will be considered an invalid value.\r\n * @param value - The W3c trace Id to be validated\r\n * @returns true if valid otherwise false\r\n */\r\nexport function isValidTraceId(value) {\r\n return _isValid(value, 32, INVALID_TRACE_ID);\r\n}\r\n/**\r\n * Is the provided W3c span id (aka. parent id) a valid string representation, it must be a 16-character\r\n * string of lowercase hexadecimal characters, for example, 00f067aa0ba902b7.\r\n * If all characters are zero (0000000000000000) this is considered an invalid value.\r\n * @param value - The W3c span id to be validated\r\n * @returns true if valid otherwise false\r\n */\r\nexport function isValidSpanId(value) {\r\n return _isValid(value, 16, INVALID_SPAN_ID);\r\n}\r\n/**\r\n * Validates that the provided ITraceParent instance conforms to the currently supported specifications\r\n * @param value - The parsed traceParent value\r\n * @returns\r\n */\r\nexport function isValidTraceParent(value) {\r\n if (!value ||\r\n !_isValid(value[_DYN_VERSION /* @min:%2eversion */], 2, INVALID_VERSION) ||\r\n !_isValid(value.traceId, 32, INVALID_TRACE_ID) ||\r\n !_isValid(value.spanId, 16, INVALID_SPAN_ID) ||\r\n !_isValid(_formatFlags(value[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */]), 2)) {\r\n // Each known field must contain a valid value\r\n return false;\r\n }\r\n return true;\r\n}\r\n/**\r\n * Is the parsed traceParent indicating that the trace is currently sampled.\r\n * @param value - The parsed traceParent value\r\n * @returns\r\n */\r\nexport function isSampledFlag(value) {\r\n if (isValidTraceParent(value)) {\r\n return (value[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] & SAMPLED_FLAG) === SAMPLED_FLAG;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Format the ITraceParent value as a string using the supported and know version formats.\r\n * So even if the passed traceParent is a later version the string value returned from this\r\n * function will convert it to only the known version formats.\r\n * This currently only supports version \"00\" and invalid \"ff\"\r\n * @param value - The parsed traceParent value\r\n * @returns\r\n */\r\nexport function formatTraceParent(value) {\r\n if (value) {\r\n // Special Note: This only supports formatting as version 00, future versions should encode any known supported version\r\n // So parsing a future version will populate the correct version value but reformatting will reduce it to version 00.\r\n var flags = _formatFlags(value[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */]);\r\n if (!_isValid(flags, 2)) {\r\n flags = \"01\";\r\n }\r\n var version = value[_DYN_VERSION /* @min:%2eversion */] || DEFAULT_VERSION;\r\n if (version !== \"00\" && version !== \"ff\") {\r\n // Reduce version to \"00\"\r\n version = DEFAULT_VERSION;\r\n }\r\n // Format as version 00\r\n return \"\".concat(version.toLowerCase(), \"-\").concat(_formatValue(value.traceId, 32, INVALID_TRACE_ID).toLowerCase(), \"-\").concat(_formatValue(value.spanId, 16, INVALID_SPAN_ID).toLowerCase(), \"-\").concat(flags.toLowerCase());\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Helper function to fetch the passed traceparent from the page, looking for it as a meta-tag or a Server-Timing header.\r\n * @param selectIdx - If the found value is comma separated which is the preferred entry to select, defaults to the first\r\n * @returns\r\n */\r\nexport function findW3cTraceParent(selectIdx) {\r\n var name = \"traceparent\";\r\n var traceParent = parseTraceParent(findMetaTag(name), selectIdx);\r\n if (!traceParent) {\r\n traceParent = parseTraceParent(findNamedServerTiming(name), selectIdx);\r\n }\r\n return traceParent;\r\n}\r\n/**\r\n * Find all script tags in the provided document and return the information about them.\r\n * @param doc - The document to search for script tags\r\n * @returns\r\n */\r\nexport function findAllScripts(doc) {\r\n var scripts = doc.getElementsByTagName(\"script\");\r\n var result = [];\r\n arrForEach(scripts, function (script) {\r\n var src = script[_DYN_GET_ATTRIBUTE /* @min:%2egetAttribute */](\"src\");\r\n if (src) {\r\n var crossOrigin = script[_DYN_GET_ATTRIBUTE /* @min:%2egetAttribute */](\"crossorigin\");\r\n var async = script.hasAttribute(\"async\") === true;\r\n var defer = script.hasAttribute(\"defer\") === true;\r\n var referrerPolicy = script[_DYN_GET_ATTRIBUTE /* @min:%2egetAttribute */](\"referrerpolicy\");\r\n var info = { url: src };\r\n if (crossOrigin) {\r\n info.crossOrigin = crossOrigin;\r\n }\r\n if (async) {\r\n info.async = async;\r\n }\r\n if (defer) {\r\n info.defer = defer;\r\n }\r\n if (referrerPolicy) {\r\n info.referrerPolicy = referrerPolicy;\r\n }\r\n result[_DYN_PUSH /* @min:%2epush */](info);\r\n }\r\n });\r\n return result;\r\n}\r\n//# sourceMappingURL=W3cTraceParent.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_TO_LOWER_CASE = \"toLowerCase\"; // Count: 11\r\nexport var _DYN_LENGTH = \"length\"; // Count: 55\r\nexport var _DYN_WARN_TO_CONSOLE = \"warnToConsole\"; // Count: 4\r\nexport var _DYN_THROW_INTERNAL = \"throwInternal\"; // Count: 5\r\nexport var _DYN_WATCH = \"watch\"; // Count: 7\r\nexport var _DYN_APPLY = \"apply\"; // Count: 7\r\nexport var _DYN_PUSH = \"push\"; // Count: 35\r\nexport var _DYN_SPLICE = \"splice\"; // Count: 8\r\nexport var _DYN_LOGGER = \"logger\"; // Count: 20\r\nexport var _DYN_CANCEL = \"cancel\"; // Count: 6\r\nexport var _DYN_INITIALIZE = \"initialize\"; // Count: 5\r\nexport var _DYN_IDENTIFIER = \"identifier\"; // Count: 8\r\nexport var _DYN_REMOVE_NOTIFICATION_0 = \"removeNotificationListener\"; // Count: 4\r\nexport var _DYN_ADD_NOTIFICATION_LIS1 = \"addNotificationListener\"; // Count: 4\r\nexport var _DYN_IS_INITIALIZED = \"isInitialized\"; // Count: 10\r\nexport var _DYN_VALUE = \"value\"; // Count: 5\r\nexport var _DYN_GET_NOTIFY_MGR = \"getNotifyMgr\"; // Count: 5\r\nexport var _DYN_GET_PLUGIN = \"getPlugin\"; // Count: 5\r\nexport var _DYN_NAME = \"name\"; // Count: 9\r\nexport var _DYN_PROCESS_NEXT = \"processNext\"; // Count: 15\r\nexport var _DYN_GET_PROCESS_TEL_CONT2 = \"getProcessTelContext\"; // Count: 2\r\nexport var _DYN_ENABLED = \"enabled\"; // Count: 6\r\nexport var _DYN_STOP_POLLING_INTERNA3 = \"stopPollingInternalLogs\"; // Count: 2\r\nexport var _DYN_UNLOAD = \"unload\"; // Count: 7\r\nexport var _DYN_ON_COMPLETE = \"onComplete\"; // Count: 4\r\nexport var _DYN_VERSION = \"version\"; // Count: 4\r\nexport var _DYN_LOGGING_LEVEL_CONSOL4 = \"loggingLevelConsole\"; // Count: 2\r\nexport var _DYN_CREATE_NEW = \"createNew\"; // Count: 7\r\nexport var _DYN_TEARDOWN = \"teardown\"; // Count: 9\r\nexport var _DYN_MESSAGE_ID = \"messageId\"; // Count: 4\r\nexport var _DYN_MESSAGE = \"message\"; // Count: 7\r\nexport var _DYN_DIAG_LOG = \"diagLog\"; // Count: 9\r\nexport var _DYN__DO_TEARDOWN = \"_doTeardown\"; // Count: 5\r\nexport var _DYN_UPDATE = \"update\"; // Count: 5\r\nexport var _DYN_GET_NEXT = \"getNext\"; // Count: 10\r\nexport var _DYN_SET_NEXT_PLUGIN = \"setNextPlugin\"; // Count: 5\r\nexport var _DYN_USER_AGENT = \"userAgent\"; // Count: 5\r\nexport var _DYN_SPLIT = \"split\"; // Count: 7\r\nexport var _DYN_REPLACE = \"replace\"; // Count: 9\r\nexport var _DYN_TYPE = \"type\"; // Count: 13\r\nexport var _DYN_EVT_NAME = \"evtName\"; // Count: 4\r\nexport var _DYN_STATUS = \"status\"; // Count: 5\r\nexport var _DYN_GET_ALL_RESPONSE_HEA5 = \"getAllResponseHeaders\"; // Count: 2\r\nexport var _DYN_IS_CHILD_EVT = \"isChildEvt\"; // Count: 3\r\nexport var _DYN_DATA = \"data\"; // Count: 6\r\nexport var _DYN_GET_CTX = \"getCtx\"; // Count: 6\r\nexport var _DYN_SET_CTX = \"setCtx\"; // Count: 10\r\nexport var _DYN_ITEMS_RECEIVED = \"itemsReceived\"; // Count: 3\r\nexport var _DYN_URL_STRING = \"urlString\"; // Count: 5\r\nexport var _DYN_HEADERS = \"headers\"; // Count: 5\r\nexport var _DYN_TIMEOUT = \"timeout\"; // Count: 6\r\nexport var _DYN_TRACE_FLAGS = \"traceFlags\"; // Count: 5\r\nexport var _DYN_GET_ATTRIBUTE = \"getAttribute\"; // Count: 3\r\n//# sourceMappingURL=__DynamicConstants.js.map","/**\r\n* ReactPlugin.ts\r\n* @copyright Microsoft 2019\r\n*/\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { AnalyticsPluginIdentifier } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, _throwInternal, isFunction, proxyFunctions, safeGetCookieMgr, onConfigChange, objDefineAccessors } from \"@microsoft/applicationinsights-core-js\";\r\nimport { objDeepFreeze } from \"@nevware21/ts-utils\";\r\nvar defaultReactExtensionConfig = objDeepFreeze({\r\n history: { blkVal: true, v: undefined }\r\n});\r\nvar ReactPlugin = /** @class */ (function (_super) {\r\n __extends(ReactPlugin, _super);\r\n function ReactPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.priority = 185;\r\n _this.identifier = 'ReactPlugin';\r\n var _analyticsPlugin;\r\n var _extensionConfig;\r\n var _unlisten;\r\n var _pageViewTimer;\r\n var _pageViewTracked;\r\n dynamicProto(ReactPlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n _super.prototype.initialize.call(_this, config, core, extensions, pluginChain);\r\n _self._addHook(onConfigChange(config, function (details) {\r\n var _a;\r\n var ctx = _self._getTelCtx();\r\n _extensionConfig = ctx.getExtCfg(_this.identifier, defaultReactExtensionConfig);\r\n _analyticsPlugin = (_a = core.getPlugin(AnalyticsPluginIdentifier)) === null || _a === void 0 ? void 0 : _a.plugin;\r\n if (isFunction(_unlisten)) {\r\n _unlisten();\r\n _unlisten = null;\r\n }\r\n if (_extensionConfig.history) {\r\n _addHistoryListener(_extensionConfig.history);\r\n if (!_pageViewTracked) {\r\n var pageViewTelemetry = {\r\n uri: _extensionConfig.history.location.pathname\r\n };\r\n _self.trackPageView(pageViewTelemetry);\r\n _pageViewTracked = true;\r\n }\r\n }\r\n }));\r\n };\r\n _self.getCookieMgr = function () {\r\n return safeGetCookieMgr(_self.core);\r\n };\r\n _self.getAppInsights = _getAnalytics;\r\n _self.processTelemetry = function (event, itemCtx) {\r\n _self.processNext(event, itemCtx);\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState, asyncCallback) {\r\n if (isFunction(_unlisten)) {\r\n _unlisten();\r\n }\r\n if (_pageViewTimer) {\r\n clearTimeout(_pageViewTimer);\r\n }\r\n _initDefaults();\r\n };\r\n // Proxy the analytics functions\r\n proxyFunctions(_self, _getAnalytics, [\r\n \"trackMetric\",\r\n \"trackPageView\",\r\n \"trackEvent\",\r\n \"trackException\",\r\n \"trackTrace\",\r\n ]);\r\n function _initDefaults() {\r\n _analyticsPlugin = null;\r\n _extensionConfig = null;\r\n _unlisten = null;\r\n _pageViewTimer = null;\r\n _pageViewTracked = false;\r\n }\r\n function _getAnalytics() {\r\n if (!_analyticsPlugin) {\r\n _throwInternal(_self.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, 64 /* _eInternalMessageId.TelemetryInitializerFailed */, \"Analytics plugin is not available, React plugin telemetry will not be sent: \");\r\n }\r\n return _analyticsPlugin;\r\n }\r\n function _addHistoryListener(history) {\r\n var locationListener = function (arg) {\r\n // v4 of the history API passes \"location\" as the first argument, while v5 passes an object that contains location and action \r\n var locn = null;\r\n if (\"location\" in arg) {\r\n // Looks like v5\r\n locn = arg[\"location\"];\r\n }\r\n else {\r\n locn = arg;\r\n }\r\n // Timeout to ensure any changes to the DOM made by route changes get included in pageView telemetry\r\n _pageViewTimer = setTimeout(function () {\r\n _pageViewTimer = null;\r\n var pageViewTelemetry = { uri: locn.pathname };\r\n _self.trackPageView(pageViewTelemetry);\r\n }, 500);\r\n };\r\n _unlisten = history.listen(locationListener);\r\n }\r\n objDefineAccessors(_self, \"_extensionConfig\", function () { return _extensionConfig; });\r\n });\r\n return _this;\r\n }\r\n ReactPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Get the current cookie manager for this instance\r\n */\r\n ReactPlugin.prototype.getCookieMgr = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Get application insights instance.\r\n */\r\n ReactPlugin.prototype.getAppInsights = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Add Part A fields to the event\r\n * @param event The event that needs to be processed\r\n */\r\n ReactPlugin.prototype.processTelemetry = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactPlugin.prototype.trackMetric = function (metric, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactPlugin.prototype.trackPageView = function (pageView) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactPlugin.prototype.trackEvent = function (event, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactPlugin.prototype.trackException = function (exception, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactPlugin.prototype.trackTrace = function (trace, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return ReactPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport default ReactPlugin;\r\n//# sourceMappingURL=ReactPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __assign, __extends } from \"tslib\";\r\nimport { dateNow } from '@microsoft/applicationinsights-core-js';\r\nimport * as React from 'react';\r\n/**\r\n * Higher-order component base class to hook Application Insights tracking\r\n * in a React component's lifecycle.\r\n */\r\nvar AITrackedComponentBase = /** @class */ (function (_super) {\r\n __extends(AITrackedComponentBase, _super);\r\n function AITrackedComponentBase(props, reactPlugin, componentName) {\r\n var _this = _super.call(this, props) || this;\r\n _this._mountTimestamp = 0;\r\n _this._firstActiveTimestamp = 0;\r\n _this._idleStartTimestamp = 0;\r\n _this._lastActiveTimestamp = 0;\r\n _this._totalIdleTime = 0;\r\n _this._idleCount = 0;\r\n _this._idleTimeout = 5000;\r\n _this.trackActivity = function (e) {\r\n if (_this._firstActiveTimestamp === 0) {\r\n _this._firstActiveTimestamp = dateNow();\r\n _this._lastActiveTimestamp = _this._firstActiveTimestamp;\r\n }\r\n else {\r\n _this._lastActiveTimestamp = dateNow();\r\n }\r\n if (_this._idleStartTimestamp > 0) {\r\n var lastIdleTime = _this._lastActiveTimestamp - _this._idleStartTimestamp;\r\n _this._totalIdleTime += lastIdleTime;\r\n _this._idleStartTimestamp = 0;\r\n }\r\n };\r\n _this._reactPlugin = reactPlugin;\r\n _this._componentName = componentName;\r\n return _this;\r\n }\r\n AITrackedComponentBase.prototype.componentDidMount = function () {\r\n var _this = this;\r\n this._mountTimestamp = dateNow();\r\n this._firstActiveTimestamp = 0;\r\n this._totalIdleTime = 0;\r\n this._lastActiveTimestamp = 0;\r\n this._idleStartTimestamp = 0;\r\n this._idleCount = 0;\r\n this._intervalId = setInterval(function () {\r\n if (_this._lastActiveTimestamp > 0 && _this._idleStartTimestamp === 0 && dateNow() - _this._lastActiveTimestamp >= _this._idleTimeout) {\r\n _this._idleStartTimestamp = dateNow();\r\n _this._idleCount++;\r\n }\r\n }, 100);\r\n };\r\n AITrackedComponentBase.prototype.componentWillUnmount = function () {\r\n if (this._mountTimestamp === 0) {\r\n throw new Error('withAITracking:componentWillUnmount: mountTimestamp is not initialized.');\r\n }\r\n if (this._intervalId) {\r\n clearInterval(this._intervalId);\r\n }\r\n if (this._firstActiveTimestamp === 0) {\r\n return;\r\n }\r\n var engagementTime = this.getEngagementTimeSeconds();\r\n var metricData = {\r\n average: engagementTime,\r\n name: 'React Component Engaged Time (seconds)',\r\n sampleCount: 1\r\n };\r\n var additionalProperties = { 'Component Name': this._componentName };\r\n this._reactPlugin.trackMetric(metricData, additionalProperties);\r\n };\r\n AITrackedComponentBase.prototype.getEngagementTimeSeconds = function () {\r\n return (dateNow() - this._firstActiveTimestamp - this._totalIdleTime - this._idleCount * this._idleTimeout) / 1000;\r\n };\r\n return AITrackedComponentBase;\r\n}(React.Component));\r\nexport { AITrackedComponentBase };\r\n/**\r\n * Higher-order component function to hook Application Insights tracking\r\n * in a React component's lifecycle.\r\n *\r\n * @param reactPlugin ReactPlugin instance\r\n * @param Component the React component to be instrumented\r\n * @param componentName (optional) component name\r\n * @param className (optional) className of the HOC div\r\n */\r\nexport default function withAITracking(reactPlugin, Component, componentName, className) {\r\n if (componentName === undefined || componentName === null || typeof componentName !== 'string') {\r\n componentName = Component.prototype &&\r\n Component.prototype.constructor &&\r\n Component.prototype.constructor.name ||\r\n 'Unknown';\r\n }\r\n if (className === undefined || className === null || typeof className !== 'string') {\r\n className = '';\r\n }\r\n return /** @class */ (function (_super) {\r\n __extends(class_1, _super);\r\n function class_1(props) {\r\n return _super.call(this, props, reactPlugin, componentName) || this;\r\n }\r\n class_1.prototype.render = function () {\r\n return (React.createElement(\"div\", { onKeyDown: this.trackActivity, onMouseMove: this.trackActivity, onScroll: this.trackActivity, onMouseDown: this.trackActivity, onTouchStart: this.trackActivity, onTouchMove: this.trackActivity, className: className },\r\n React.createElement(Component, __assign({}, this.props))));\r\n };\r\n return class_1;\r\n }(AITrackedComponentBase));\r\n}\r\n//# sourceMappingURL=withAITracking.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __extends } from \"tslib\";\r\nimport React from \"react\";\r\nimport { SeverityLevel } from \"@microsoft/applicationinsights-common\";\r\nvar AppInsightsErrorBoundary = /** @class */ (function (_super) {\r\n __extends(AppInsightsErrorBoundary, _super);\r\n function AppInsightsErrorBoundary() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.state = { hasError: false };\r\n return _this;\r\n }\r\n AppInsightsErrorBoundary.prototype.componentDidCatch = function (error, errorInfo) {\r\n this.setState({ hasError: true });\r\n this.props.appInsights.trackException({\r\n error: error,\r\n exception: error,\r\n severityLevel: SeverityLevel.Error,\r\n properties: errorInfo\r\n });\r\n };\r\n AppInsightsErrorBoundary.prototype.render = function () {\r\n if (this.state.hasError) {\r\n var onError = this.props.onError;\r\n return React.createElement(onError);\r\n }\r\n return this.props.children;\r\n };\r\n return AppInsightsErrorBoundary;\r\n}(React.Component));\r\nexport default AppInsightsErrorBoundary;\r\n//# sourceMappingURL=AppInsightsErrorBoundary.js.map","import { createContext, useContext } from \"react\";\r\nvar AppInsightsContext = createContext(undefined);\r\nvar useAppInsightsContext = function () { return useContext(AppInsightsContext); };\r\nexport { AppInsightsContext, useAppInsightsContext };\r\n//# sourceMappingURL=AppInsightsContext.js.map","import { useEffect, useRef, useState } from \"react\";\r\nexport default function useCustomEvent(reactPlugin, eventName, eventData, skipFirstRun) {\r\n if (skipFirstRun === void 0) { skipFirstRun = true; }\r\n var _a = useState(eventData), data = _a[0], setData = _a[1];\r\n var firstRun = useRef(skipFirstRun);\r\n var savedSkipFirstRun = useRef(skipFirstRun);\r\n useEffect(function () {\r\n if (firstRun.current) {\r\n firstRun.current = false;\r\n return;\r\n }\r\n reactPlugin.trackEvent({ name: eventName }, data);\r\n }, [reactPlugin, data, eventName]);\r\n useEffect(function () {\r\n return function () {\r\n firstRun.current = savedSkipFirstRun.current;\r\n };\r\n }, []);\r\n return setData;\r\n}\r\n//# sourceMappingURL=useTrackEvent.js.map","import { __assign } from \"tslib\";\r\nimport { dateNow } from \"@microsoft/applicationinsights-core-js\";\r\nimport { useEffect, useRef } from \"react\";\r\nfunction getEngagementTimeSeconds(trackedData) {\r\n return ((dateNow() -\r\n trackedData.firstActiveTimestamp -\r\n trackedData.totalIdleTime -\r\n trackedData.idleCount * trackedData.idleTimeout) /\r\n 1000);\r\n}\r\nvar useComponentTracking = function (reactPlugin, componentName, customProperties) {\r\n var tracking = useRef({\r\n hookTimestamp: dateNow(),\r\n firstActiveTimestamp: 0,\r\n totalIdleTime: 0,\r\n lastActiveTimestamp: 0,\r\n idleStartTimestamp: 0,\r\n idleCount: 0,\r\n idleTimeout: 5000\r\n });\r\n var savedCallback = useRef();\r\n var callback = function () {\r\n var trackedData = tracking.current;\r\n if (trackedData.lastActiveTimestamp > 0 &&\r\n trackedData.idleStartTimestamp === 0 &&\r\n dateNow() - trackedData.lastActiveTimestamp >= trackedData.idleTimeout) {\r\n trackedData.idleStartTimestamp = dateNow();\r\n trackedData.idleCount++;\r\n }\r\n };\r\n var delay = 100;\r\n savedCallback.current = callback;\r\n // Set up the interval.\r\n useEffect(function () {\r\n var id = setInterval(savedCallback.current, delay);\r\n return function () {\r\n clearInterval(id);\r\n var trackedData = tracking.current;\r\n if (trackedData.hookTimestamp === 0) {\r\n throw new Error(\"useAppInsights:unload hook: hookTimestamp is not initialized.\");\r\n }\r\n if (trackedData.firstActiveTimestamp === 0) {\r\n return;\r\n }\r\n var engagementTime = getEngagementTimeSeconds(trackedData);\r\n var metricData = {\r\n average: engagementTime,\r\n name: \"React Component Engaged Time (seconds)\",\r\n sampleCount: 1\r\n };\r\n var additionalProperties = __assign({ \"Component Name\": componentName }, customProperties);\r\n reactPlugin.trackMetric(metricData, additionalProperties);\r\n };\r\n }, []);\r\n var trackActivity = function () {\r\n var trackedData = tracking.current;\r\n if (trackedData.firstActiveTimestamp === 0) {\r\n trackedData.firstActiveTimestamp = dateNow();\r\n trackedData.lastActiveTimestamp = trackedData.firstActiveTimestamp;\r\n }\r\n else {\r\n trackedData.lastActiveTimestamp = dateNow();\r\n }\r\n if (trackedData.idleStartTimestamp > 0) {\r\n var lastIdleTime = trackedData.lastActiveTimestamp - trackedData.idleStartTimestamp;\r\n trackedData.totalIdleTime += lastIdleTime;\r\n trackedData.idleStartTimestamp = 0;\r\n }\r\n };\r\n return trackActivity;\r\n};\r\nexport default useComponentTracking;\r\n//# sourceMappingURL=useTrackMetric.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nexport const strShimFunction = \"function\";\r\nexport const strShimObject = \"object\";\r\nexport const strShimUndefined = \"undefined\";\r\nexport const strShimPrototype = \"prototype\";\r\nexport const strDefault = \"default\";\r\n\r\nexport const ObjClass = Object;\r\nexport const ObjProto = ObjClass[strShimPrototype];\r\n","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { getGlobal, objAssign, objCreate, objDefineProp, objHasOwnProperty, throwTypeError } from \"@nevware21/ts-utils\";\r\nimport {\r\n ObjClass, ObjProto,\r\n strDefault, strShimFunction, strShimPrototype\r\n} from \"./Constants\";\r\n\r\n// Most of these functions have been directly shamelessly \"lifted\" from the https://github.com/@microsoft/tslib and\r\n// modified to be ES5 compatible and applying several minification and tree-shaking techniques so that Application Insights\r\n// can successfully use TypeScript \"importHelpers\" which imports tslib during compilation but it will use these at runtime\r\n// Which is also why all of the functions have not been included as Application Insights currently doesn't use or require\r\n// them.\r\n\r\nexport const SymbolObj = (getGlobal()||{})[\"Symbol\"];\r\nexport const ReflectObj = (getGlobal()||{})[\"Reflect\"];\r\nexport const __hasReflect = !!ReflectObj;\r\n\r\nconst strDecorate = \"decorate\";\r\nconst strMetadata = \"metadata\";\r\nconst strGetOwnPropertySymbols = \"getOwnPropertySymbols\";\r\nconst strIterator = \"iterator\";\r\nconst strHasOwnProperty = \"hasOwnProperty\";\r\n\r\nexport declare type ObjAssignFunc = (t: any, ...sources:any[]) => any;\r\n\r\nexport var __objAssignFnImpl: ObjAssignFunc = function(t: any): any {\r\n // tslint:disable-next-line: ban-comma-operator\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) {\r\n if (ObjProto[strHasOwnProperty].call(s, p)) {\r\n (t as any)[p] = s[p];\r\n }\r\n }\r\n }\r\n return t;\r\n};\r\n\r\nexport var __assignFn: ObjAssignFunc = objAssign || __objAssignFnImpl;\r\n\r\n// tslint:disable-next-line: only-arrow-functions\r\nvar extendStaticsFn = function(d: any, b: any): any {\r\n extendStaticsFn = ObjClass[\"setPrototypeOf\"] ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n ({ __proto__: [] } instanceof Array && function (d: any, b: any) {\r\n d.__proto__ = b;\r\n }) ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n function (d: any, b: any) {\r\n for (var p in b) {\r\n if (b[strHasOwnProperty](p)) {\r\n d[p] = b[p];\r\n }\r\n }\r\n };\r\n return extendStaticsFn(d, b);\r\n};\r\n\r\nexport function __extendsFn(d: any, b: any) {\r\n if (typeof b !== strShimFunction && b !== null) {\r\n throwTypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n }\r\n extendStaticsFn(d, b);\r\n function __(this: any) {\r\n this.constructor = d;\r\n }\r\n // tslint:disable-next-line: ban-comma-operator\r\n d[strShimPrototype] = b === null ? objCreate(b) : (__[strShimPrototype] = b[strShimPrototype], new (__ as any)());\r\n}\r\n\r\nexport function __restFn(s: any, e: any) {\r\n var t = {};\r\n for (var k in s) {\r\n if (objHasOwnProperty(s, k) && e.indexOf(k) < 0) {\r\n t[k] = s[k];\r\n }\r\n }\r\n if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) {\r\n for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && ObjProto[\"propertyIsEnumerable\"].call(s, p[i])) {\r\n t[p[i]] = s[p[i]];\r\n }\r\n }\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorateFn(decorators: any, target: any, key: any, desc: any) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass[\"getOwnPropertyDescriptor\"](target, key) : desc, d;\r\n if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) {\r\n r = ReflectObj[strDecorate](decorators, target, key, desc);\r\n } else {\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n // eslint-disable-next-line no-cond-assign\r\n if (d = decorators[i]) {\r\n r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n }\r\n }\r\n }\r\n\r\n // tslint:disable-next-line:ban-comma-operator\r\n return c > 3 && r && objDefineProp(target, key, r), r;\r\n}\r\n\r\nexport function __paramFn(paramIndex: number, decorator: Function) {\r\n return function (target: any, key: any) {\r\n decorator(target, key, paramIndex);\r\n }\r\n}\r\n\r\nexport function __metadataFn(metadataKey: any, metadataValue: any) {\r\n if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) {\r\n return ReflectObj[strMetadata](metadataKey, metadataValue);\r\n }\r\n}\r\n\r\nexport function __exportStarFn(m: any, o: any) {\r\n for (var p in m) {\r\n if (p !== strDefault && !objHasOwnProperty(o, p)) {\r\n __createBindingFn(o, m, p);\r\n }\r\n }\r\n}\r\n\r\nexport function __createBindingFn(o: any, m: any, k: any, k2?: any) {\r\n if (k2 === undefined) {\r\n k2 = k;\r\n }\r\n \r\n if (!!objDefineProp) {\r\n objDefineProp(o, k2, {\r\n enumerable: true,\r\n get() {\r\n return m[k];\r\n }\r\n });\r\n } else {\r\n o[k2] = m[k];\r\n }\r\n}\r\n\r\nexport function __valuesFn(o: any) {\r\n var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0;\r\n if (m) {\r\n return m.call(o);\r\n }\r\n\r\n if (o && typeof o.length === \"number\") {\r\n return {\r\n next () {\r\n if (o && i >= o.length) {\r\n o = void 0;\r\n }\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n }\r\n\r\n throwTypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __readFn(o: any, n: any) {\r\n var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]];\r\n if (!m) {\r\n return o;\r\n }\r\n\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {\r\n ar.push(r.value);\r\n }\r\n } catch (error) {\r\n e = {\r\n error\r\n };\r\n } finally {\r\n try {\r\n // tslint:disable-next-line:no-conditional-assignment\r\n if (r && !r.done && (m = i[\"return\"])) {\r\n m.call(i);\r\n }\r\n } finally {\r\n if (e) {\r\n // eslint-disable-next-line no-unsafe-finally\r\n throw e.error;\r\n }\r\n }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArraysFn() {\r\n var theArgs = arguments;\r\n // Calculate new total size\r\n for (var s = 0, i = 0, il = theArgs.length; i < il; i++) {\r\n s += theArgs[i].length;\r\n }\r\n\r\n // Create new full array\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++) {\r\n for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) {\r\n r[k] = a[j];\r\n }\r\n }\r\n\r\n return r;\r\n}\r\n\r\nexport function __spreadArrayFn(to: any, from: any) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {\r\n to[j] = from[i];\r\n }\r\n\r\n return to;\r\n}\r\n\r\nexport function __makeTemplateObjectFn(cooked: any, raw: any) {\r\n if (objDefineProp) {\r\n objDefineProp(cooked, \"raw\", { value: raw });\r\n } else {\r\n cooked.raw = raw;\r\n }\r\n\r\n return cooked;\r\n}\r\n\r\nexport function __importStarFn(mod: any) {\r\n if (mod && mod.__esModule) {\r\n return mod;\r\n }\r\n\r\n var result = {};\r\n if (mod != null) {\r\n for (var k in mod) {\r\n if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) {\r\n __createBindingFn(result, mod, k);\r\n }\r\n }\r\n }\r\n\r\n // Set default module\r\n if (!!objDefineProp) {\r\n objDefineProp( result, strDefault, { enumerable: true, value: mod });\r\n } else {\r\n result[strDefault] = mod;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nexport function __importDefaultFn(mod:any) {\r\n return (mod && mod.__esModule) ? mod : { strDefault: mod };\r\n}\r\n","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { createEnumStyle } from \"@microsoft/applicationinsights-core-js\";\r\nexport var StorageType = createEnumStyle({\r\n LocalStorage: 0 /* eStorageType.LocalStorage */,\r\n SessionStorage: 1 /* eStorageType.SessionStorage */\r\n});\r\nexport var DistributedTracingModes = createEnumStyle({\r\n AI: 0 /* eDistributedTracingModes.AI */,\r\n AI_AND_W3C: 1 /* eDistributedTracingModes.AI_AND_W3C */,\r\n W3C: 2 /* eDistributedTracingModes.W3C */\r\n});\r\n/**\r\n * The EventPersistence contains a set of values that specify the event's persistence.\r\n */\r\nexport var EventPersistence = createEnumStyle({\r\n /**\r\n * Normal persistence.\r\n */\r\n Normal: 1 /* EventPersistenceValue.Normal */,\r\n /**\r\n * Critical persistence.\r\n */\r\n Critical: 2 /* EventPersistenceValue.Critical */\r\n});\r\n//# sourceMappingURL=Enums.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { _throwInternal, dumpObj, getExceptionName, getGlobal, getGlobalInst, isNullOrUndefined, objForEachKey } from \"@microsoft/applicationinsights-core-js\";\r\nimport { StorageType } from \"./Enums\";\r\nimport { _DYN_REMOVE_ITEM, _DYN_TO_STRING } from \"./__DynamicConstants\";\r\nvar _canUseLocalStorage = undefined;\r\nvar _canUseSessionStorage = undefined;\r\nvar _storagePrefix = \"\";\r\n/**\r\n * Gets the localStorage object if available\r\n * @returns {Storage} - Returns the storage object if available else returns null\r\n */\r\nfunction _getLocalStorageObject() {\r\n if (utlCanUseLocalStorage()) {\r\n return _getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Tests storage object (localStorage or sessionStorage) to verify that it is usable\r\n * More details here: https://mathiasbynens.be/notes/localstorage-pattern\r\n * @param storageType - Type of storage\r\n * @returns {Storage} Returns storage object verified that it is usable\r\n */\r\nfunction _getVerifiedStorageObject(storageType) {\r\n try {\r\n if (isNullOrUndefined(getGlobal())) {\r\n return null;\r\n }\r\n var uid = (new Date)[_DYN_TO_STRING /* @min:%2etoString */]();\r\n var storage = getGlobalInst(storageType === StorageType.LocalStorage ? \"localStorage\" : \"sessionStorage\");\r\n var name_1 = _storagePrefix + uid;\r\n storage.setItem(name_1, uid);\r\n var fail = storage.getItem(name_1) !== uid;\r\n storage[_DYN_REMOVE_ITEM /* @min:%2eremoveItem */](name_1);\r\n if (!fail) {\r\n return storage;\r\n }\r\n }\r\n catch (exception) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n}\r\n/**\r\n * Gets the sessionStorage object if available\r\n * @returns {Storage} - Returns the storage object if available else returns null\r\n */\r\nfunction _getSessionStorageObject() {\r\n if (utlCanUseSessionStorage()) {\r\n return _getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Disables the global SDK usage of local or session storage if available\r\n */\r\nexport function utlDisableStorage() {\r\n _canUseLocalStorage = false;\r\n _canUseSessionStorage = false;\r\n}\r\nexport function utlSetStoragePrefix(storagePrefix) {\r\n _storagePrefix = storagePrefix || \"\";\r\n}\r\n/**\r\n * Re-enables the global SDK usage of local or session storage if available\r\n */\r\nexport function utlEnableStorage() {\r\n _canUseLocalStorage = utlCanUseLocalStorage(true);\r\n _canUseSessionStorage = utlCanUseSessionStorage(true);\r\n}\r\n/**\r\n * Returns whether LocalStorage can be used, if the reset parameter is passed a true this will override\r\n * any previous disable calls.\r\n * @param reset - Should the usage be reset and determined only based on whether LocalStorage is available\r\n */\r\nexport function utlCanUseLocalStorage(reset) {\r\n if (reset || _canUseLocalStorage === undefined) {\r\n _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return _canUseLocalStorage;\r\n}\r\nexport function utlGetLocalStorage(logger, name) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 1 /* _eInternalMessageId.BrowserCannotReadLocalStorage */, \"Browser failed read of local storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return null;\r\n}\r\nexport function utlSetLocalStorage(logger, name, data) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 3 /* _eInternalMessageId.BrowserCannotWriteLocalStorage */, \"Browser failed write to local storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlRemoveStorage(logger, name) {\r\n var storage = _getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage[_DYN_REMOVE_ITEM /* @min:%2eremoveItem */](name);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseLocalStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 5 /* _eInternalMessageId.BrowserFailedRemovalFromLocalStorage */, \"Browser failed removal of local storage item. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlCanUseSessionStorage(reset) {\r\n if (reset || _canUseSessionStorage === undefined) {\r\n _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return _canUseSessionStorage;\r\n}\r\nexport function utlGetSessionStorageKeys() {\r\n var keys = [];\r\n if (utlCanUseSessionStorage()) {\r\n objForEachKey(getGlobalInst(\"sessionStorage\"), function (key) {\r\n keys.push(key);\r\n });\r\n }\r\n return keys;\r\n}\r\nexport function utlGetSessionStorage(logger, name) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 2 /* _eInternalMessageId.BrowserCannotReadSessionStorage */, \"Browser failed read of session storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return null;\r\n}\r\nexport function utlSetSessionStorage(logger, name, data) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 4 /* _eInternalMessageId.BrowserCannotWriteSessionStorage */, \"Browser failed write to session storage. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\nexport function utlRemoveSessionStorage(logger, name) {\r\n var storage = _getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage[_DYN_REMOVE_ITEM /* @min:%2eremoveItem */](name);\r\n return true;\r\n }\r\n catch (e) {\r\n _canUseSessionStorage = false;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 6 /* _eInternalMessageId.BrowserFailedRemovalFromSessionStorage */, \"Browser failed removal of session storage item. \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return false;\r\n}\r\n//# sourceMappingURL=StorageHelperFuncs.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * This is an internal property used to cause internal (reporting) requests to be ignored from reporting\r\n * additional telemetry, to handle polyfil implementations ALL urls used with a disabled request will\r\n * also be ignored for future requests even when this property is not provided.\r\n * Tagging as Ignore as this is an internal value and is not expected to be used outside of the SDK\r\n * @ignore\r\n */\r\nexport var DisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nexport var SampleRate = \"sampleRate\";\r\nexport var ProcessLegacy = \"ProcessLegacy\";\r\nexport var HttpMethod = \"http.method\";\r\nexport var DEFAULT_BREEZE_ENDPOINT = \"https://dc.services.visualstudio.com\";\r\nexport var DEFAULT_BREEZE_PATH = \"/v2/track\";\r\nexport var strNotSpecified = \"not_specified\";\r\nexport var strIkey = \"iKey\";\r\n//# sourceMappingURL=Constants.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { _throwInternal, getJSON, hasJSON, isObject, objForEachKey, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nimport { asString, strSubstr, strSubstring } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH, _DYN_STRINGIFY, _DYN_TO_STRING } from \"../../__DynamicConstants\";\r\nexport function dataSanitizeKeyAndAddUniqueness(logger, key, map) {\r\n var origLength = key[_DYN_LENGTH /* @min:%2elength */];\r\n var field = dataSanitizeKey(logger, key);\r\n // validation truncated the length. We need to add uniqueness\r\n if (field[_DYN_LENGTH /* @min:%2elength */] !== origLength) {\r\n var i = 0;\r\n var uniqueField = field;\r\n while (map[uniqueField] !== undefined) {\r\n i++;\r\n uniqueField = strSubstring(field, 0, 150 /* DataSanitizerValues.MAX_NAME_LENGTH */ - 3) + dsPadNumber(i);\r\n }\r\n field = uniqueField;\r\n }\r\n return field;\r\n}\r\nexport function dataSanitizeKey(logger, name) {\r\n var nameTrunc;\r\n if (name) {\r\n // Remove any leading or trailing whitespace\r\n name = strTrim(asString(name));\r\n // truncate the string to 150 chars\r\n if (name[_DYN_LENGTH /* @min:%2elength */] > 150 /* DataSanitizerValues.MAX_NAME_LENGTH */) {\r\n nameTrunc = strSubstring(name, 0, 150 /* DataSanitizerValues.MAX_NAME_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 57 /* _eInternalMessageId.NameTooLong */, \"name is too long. It has been truncated to \" + 150 /* DataSanitizerValues.MAX_NAME_LENGTH */ + \" characters.\", { name: name }, true);\r\n }\r\n }\r\n return nameTrunc || name;\r\n}\r\nexport function dataSanitizeString(logger, value, maxLength) {\r\n if (maxLength === void 0) { maxLength = 1024 /* DataSanitizerValues.MAX_STRING_LENGTH */; }\r\n var valueTrunc;\r\n if (value) {\r\n maxLength = maxLength ? maxLength : 1024 /* DataSanitizerValues.MAX_STRING_LENGTH */; // in case default parameters dont work\r\n value = strTrim(asString(value));\r\n if (value[_DYN_LENGTH /* @min:%2elength */] > maxLength) {\r\n valueTrunc = strSubstring(value, 0, maxLength);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 61 /* _eInternalMessageId.StringValueTooLong */, \"string value is too long. It has been truncated to \" + maxLength + \" characters.\", { value: value }, true);\r\n }\r\n }\r\n return valueTrunc || value;\r\n}\r\nexport function dataSanitizeUrl(logger, url) {\r\n return dataSanitizeInput(logger, url, 2048 /* DataSanitizerValues.MAX_URL_LENGTH */, 66 /* _eInternalMessageId.UrlTooLong */);\r\n}\r\nexport function dataSanitizeMessage(logger, message) {\r\n var messageTrunc;\r\n if (message) {\r\n if (message[_DYN_LENGTH /* @min:%2elength */] > 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */) {\r\n messageTrunc = strSubstring(message, 0, 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 56 /* _eInternalMessageId.MessageTruncated */, \"message is too long, it has been truncated to \" + 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */ + \" characters.\", { message: message }, true);\r\n }\r\n }\r\n return messageTrunc || message;\r\n}\r\nexport function dataSanitizeException(logger, exception) {\r\n var exceptionTrunc;\r\n if (exception) {\r\n // Make surte its a string\r\n var value = \"\" + exception;\r\n if (value[_DYN_LENGTH /* @min:%2elength */] > 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */) {\r\n exceptionTrunc = strSubstring(value, 0, 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 52 /* _eInternalMessageId.ExceptionTruncated */, \"exception is too long, it has been truncated to \" + 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */ + \" characters.\", { exception: exception }, true);\r\n }\r\n }\r\n return exceptionTrunc || exception;\r\n}\r\nexport function dataSanitizeProperties(logger, properties) {\r\n if (properties) {\r\n var tempProps_1 = {};\r\n objForEachKey(properties, function (prop, value) {\r\n if (isObject(value) && hasJSON()) {\r\n // Stringify any part C properties\r\n try {\r\n value = getJSON()[_DYN_STRINGIFY /* @min:%2estringify */](value);\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 49 /* _eInternalMessageId.CannotSerializeObjectNonSerializable */, \"custom property is not valid\", { exception: e }, true);\r\n }\r\n }\r\n value = dataSanitizeString(logger, value, 8192 /* DataSanitizerValues.MAX_PROPERTY_LENGTH */);\r\n prop = dataSanitizeKeyAndAddUniqueness(logger, prop, tempProps_1);\r\n tempProps_1[prop] = value;\r\n });\r\n properties = tempProps_1;\r\n }\r\n return properties;\r\n}\r\nexport function dataSanitizeMeasurements(logger, measurements) {\r\n if (measurements) {\r\n var tempMeasurements_1 = {};\r\n objForEachKey(measurements, function (measure, value) {\r\n measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements_1);\r\n tempMeasurements_1[measure] = value;\r\n });\r\n measurements = tempMeasurements_1;\r\n }\r\n return measurements;\r\n}\r\nexport function dataSanitizeId(logger, id) {\r\n return id ? dataSanitizeInput(logger, id, 128 /* DataSanitizerValues.MAX_ID_LENGTH */, 69 /* _eInternalMessageId.IdTooLong */)[_DYN_TO_STRING /* @min:%2etoString */]() : id;\r\n}\r\nexport function dataSanitizeInput(logger, input, maxLength, _msgId) {\r\n var inputTrunc;\r\n if (input) {\r\n input = strTrim(asString(input));\r\n if (input[_DYN_LENGTH /* @min:%2elength */] > maxLength) {\r\n inputTrunc = strSubstring(input, 0, maxLength);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, _msgId, \"input is too long, it has been truncated to \" + maxLength + \" characters.\", { data: input }, true);\r\n }\r\n }\r\n return inputTrunc || input;\r\n}\r\nexport function dsPadNumber(num) {\r\n var s = \"00\" + num;\r\n return strSubstr(s, s[_DYN_LENGTH /* @min:%2elength */] - 3);\r\n}\r\n//# sourceMappingURL=DataSanitizer.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { isNullOrUndefined, objForEachKey, throwError, toISOString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strIkey, strNotSpecified } from \"./Constants\";\r\nimport { dataSanitizeString } from \"./Telemetry/Common/DataSanitizer\";\r\n/**\r\n * Create a telemetry item that the 1DS channel understands\r\n * @param item - domain specific properties; part B\r\n * @param baseType - telemetry item type. ie PageViewData\r\n * @param envelopeName - Name of the envelope, e.g., `Microsoft.ApplicationInsights.\\.PageView`.\r\n * @param customProperties - user defined custom properties; part C\r\n * @param systemProperties - system properties that are added to the context; part A\r\n * @returns ITelemetryItem that is sent to channel\r\n */\r\nexport function createTelemetryItem(item, baseType, envelopeName, logger, customProperties, systemProperties) {\r\n envelopeName = dataSanitizeString(logger, envelopeName) || strNotSpecified;\r\n if (isNullOrUndefined(item) ||\r\n isNullOrUndefined(baseType) ||\r\n isNullOrUndefined(envelopeName)) {\r\n throwError(\"Input doesn't contain all required fields\");\r\n }\r\n var iKey = \"\";\r\n if (item[strIkey]) {\r\n iKey = item[strIkey];\r\n delete item[strIkey];\r\n }\r\n var telemetryItem = {\r\n name: envelopeName,\r\n time: toISOString(new Date()),\r\n iKey: iKey,\r\n ext: systemProperties ? systemProperties : {},\r\n tags: [],\r\n data: {},\r\n baseType: baseType,\r\n baseData: item // Part B\r\n };\r\n // Part C\r\n if (!isNullOrUndefined(customProperties)) {\r\n objForEachKey(customProperties, function (prop, value) {\r\n telemetryItem.data[prop] = value;\r\n });\r\n }\r\n return telemetryItem;\r\n}\r\nvar TelemetryItemCreator = /** @class */ (function () {\r\n function TelemetryItemCreator() {\r\n }\r\n /**\r\n * Create a telemetry item that the 1DS channel understands\r\n * @param item - domain specific properties; part B\r\n * @param baseType - telemetry item type. ie PageViewData\r\n * @param envelopeName - Name of the envelope (e.g., Microsoft.ApplicationInsights.[instrumentationKey].PageView).\r\n * @param customProperties - user defined custom properties; part C\r\n * @param systemProperties - system properties that are added to the context; part A\r\n * @returns ITelemetryItem that is sent to channel\r\n */\r\n TelemetryItemCreator.create = createTelemetryItem;\r\n return TelemetryItemCreator;\r\n}());\r\nexport { TelemetryItemCreator };\r\n//# sourceMappingURL=TelemetryItemCreator.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { _DYN_MEASUREMENTS, _DYN_NAME, _DYN_PROPERTIES } from \"../__DynamicConstants\";\r\nimport { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString } from \"./Common/DataSanitizer\";\r\nvar Event = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the EventTelemetry object\r\n */\r\n function Event(logger, name, properties, measurements) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n name: 1 /* FieldType.Required */,\r\n properties: 0 /* FieldType.Default */,\r\n measurements: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n _self[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, name) || strNotSpecified;\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n Event.envelopeType = \"Microsoft.ApplicationInsights.{0}.Event\";\r\n Event.dataType = \"EventData\";\r\n return Event;\r\n}());\r\nexport { Event };\r\n//# sourceMappingURL=Event.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { _DYN_MEASUREMENTS, _DYN_MESSAGE, _DYN_PROPERTIES, _DYN_SEVERITY_LEVEL } from \"../__DynamicConstants\";\r\nimport { dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties } from \"./Common/DataSanitizer\";\r\nvar Trace = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the TraceTelemetry object\r\n */\r\n function Trace(logger, message, severityLevel, properties, measurements) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n message: 1 /* FieldType.Required */,\r\n severityLevel: 0 /* FieldType.Default */,\r\n properties: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n message = message || strNotSpecified;\r\n _self[_DYN_MESSAGE /* @min:%2emessage */] = dataSanitizeMessage(logger, message);\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n if (severityLevel) {\r\n _self[_DYN_SEVERITY_LEVEL /* @min:%2eseverityLevel */] = severityLevel;\r\n }\r\n }\r\n Trace.envelopeType = \"Microsoft.ApplicationInsights.{0}.Message\";\r\n Trace.dataType = \"MessageData\";\r\n return Trace;\r\n}());\r\nexport { Trace };\r\n//# sourceMappingURL=Trace.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar DataPoint = /** @class */ (function () {\r\n function DataPoint() {\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n this.aiDataContract = {\r\n name: 1 /* FieldType.Required */,\r\n kind: 0 /* FieldType.Default */,\r\n value: 1 /* FieldType.Required */,\r\n count: 0 /* FieldType.Default */,\r\n min: 0 /* FieldType.Default */,\r\n max: 0 /* FieldType.Default */,\r\n stdDev: 0 /* FieldType.Default */\r\n };\r\n /**\r\n * Metric type. Single measurement or the aggregated value.\r\n */\r\n this.kind = 0 /* DataPointType.Measurement */;\r\n }\r\n return DataPoint;\r\n}());\r\nexport { DataPoint };\r\n//# sourceMappingURL=DataPoint.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { _DYN_COUNT, _DYN_MEASUREMENTS, _DYN_NAME, _DYN_PROPERTIES } from \"../__DynamicConstants\";\r\nimport { DataPoint } from \"./Common/DataPoint\";\r\nimport { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString } from \"./Common/DataSanitizer\";\r\nvar Metric = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the MetricTelemetry object\r\n */\r\n function Metric(logger, name, value, count, min, max, stdDev, properties, measurements) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n metrics: 1 /* FieldType.Required */,\r\n properties: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n var dataPoint = new DataPoint();\r\n dataPoint[_DYN_COUNT /* @min:%2ecount */] = count > 0 ? count : undefined;\r\n dataPoint.max = isNaN(max) || max === null ? undefined : max;\r\n dataPoint.min = isNaN(min) || min === null ? undefined : min;\r\n dataPoint[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, name) || strNotSpecified;\r\n dataPoint.value = value;\r\n dataPoint.stdDev = isNaN(stdDev) || stdDev === null ? undefined : stdDev;\r\n _self.metrics = [dataPoint];\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n Metric.envelopeType = \"Microsoft.ApplicationInsights.{0}.Metric\";\r\n Metric.dataType = \"MetricData\";\r\n return Metric;\r\n}());\r\nexport { Metric };\r\n//# sourceMappingURL=Metric.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { msToTimeSpan } from \"../HelperFuncs\";\r\nimport { _DYN_DURATION, _DYN_MEASUREMENTS, _DYN_NAME, _DYN_PROPERTIES } from \"../__DynamicConstants\";\r\nimport { dataSanitizeId, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from \"./Common/DataSanitizer\";\r\nvar PageView = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the PageEventTelemetry object\r\n */\r\n function PageView(logger, name, url, durationMs, properties, measurements, id) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n name: 0 /* FieldType.Default */,\r\n url: 0 /* FieldType.Default */,\r\n duration: 0 /* FieldType.Default */,\r\n properties: 0 /* FieldType.Default */,\r\n measurements: 0 /* FieldType.Default */,\r\n id: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n _self.id = dataSanitizeId(logger, id);\r\n _self.url = dataSanitizeUrl(logger, url);\r\n _self[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, name) || strNotSpecified;\r\n if (!isNaN(durationMs)) {\r\n _self[_DYN_DURATION /* @min:%2eduration */] = msToTimeSpan(durationMs);\r\n }\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n PageView.envelopeType = \"Microsoft.ApplicationInsights.{0}.Pageview\";\r\n PageView.dataType = \"PageviewData\";\r\n return PageView;\r\n}());\r\nexport { PageView };\r\n//# sourceMappingURL=PageView.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { _DYN_DURATION, _DYN_MEASUREMENTS, _DYN_NAME, _DYN_PROPERTIES } from \"../__DynamicConstants\";\r\nimport { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from \"./Common/DataSanitizer\";\r\nvar PageViewPerformance = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the PageEventTelemetry object\r\n */\r\n function PageViewPerformance(logger, name, url, unused, properties, measurements, cs4BaseData) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n name: 0 /* FieldType.Default */,\r\n url: 0 /* FieldType.Default */,\r\n duration: 0 /* FieldType.Default */,\r\n perfTotal: 0 /* FieldType.Default */,\r\n networkConnect: 0 /* FieldType.Default */,\r\n sentRequest: 0 /* FieldType.Default */,\r\n receivedResponse: 0 /* FieldType.Default */,\r\n domProcessing: 0 /* FieldType.Default */,\r\n properties: 0 /* FieldType.Default */,\r\n measurements: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n _self.url = dataSanitizeUrl(logger, url);\r\n _self[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, name) || strNotSpecified;\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n if (cs4BaseData) {\r\n _self.domProcessing = cs4BaseData.domProcessing;\r\n _self[_DYN_DURATION /* @min:%2eduration */] = cs4BaseData[_DYN_DURATION /* @min:%2eduration */];\r\n _self.networkConnect = cs4BaseData.networkConnect;\r\n _self.perfTotal = cs4BaseData.perfTotal;\r\n _self.receivedResponse = cs4BaseData.receivedResponse;\r\n _self.sentRequest = cs4BaseData.sentRequest;\r\n }\r\n }\r\n PageViewPerformance.envelopeType = \"Microsoft.ApplicationInsights.{0}.PageviewPerformance\";\r\n PageViewPerformance.dataType = \"PageviewPerformanceData\";\r\n return PageViewPerformance;\r\n}());\r\nexport { PageViewPerformance };\r\n//# sourceMappingURL=PageViewPerformance.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __assign } from \"tslib\";\r\nimport { arrForEach, arrMap, isArray, isError, isFunction, isNullOrUndefined, isObject, isString, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nimport { asString, getWindow, objFreeze, strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { strNotSpecified } from \"../Constants\";\r\nimport { _DYN_AI_DATA_CONTRACT, _DYN_ASSEMBLY, _DYN_EXCEPTIONS, _DYN_FILE_NAME, _DYN_HAS_FULL_STACK, _DYN_LENGTH, _DYN_LINE, _DYN_MATCH, _DYN_MEASUREMENTS, _DYN_MESSAGE, _DYN_NAME, _DYN_PARSED_STACK, _DYN_PROBLEM_GROUP, _DYN_PROPERTIES, _DYN_SEVERITY_LEVEL, _DYN_SIZE_IN_BYTES, _DYN_SPLIT, _DYN_STRINGIFY, _DYN_TO_STRING, _DYN_TYPE_NAME } from \"../__DynamicConstants\";\r\nimport { dataSanitizeException, dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties, dataSanitizeString } from \"./Common/DataSanitizer\";\r\n// These Regex covers the following patterns\r\n// 1. Chrome/Firefox/IE/Edge:\r\n// at functionName (filename:lineNumber:columnNumber)\r\n// at functionName (filename:lineNumber)\r\n// at filename:lineNumber:columnNumber\r\n// at filename:lineNumber\r\n// at functionName@filename:lineNumber:columnNumber\r\n// 2. Safari / Opera:\r\n// functionName@filename:lineNumber:columnNumber\r\n// functionName@filename:lineNumber\r\n// filename:lineNumber:columnNumber\r\n// filename:lineNumber\r\n// Line ## of scriptname script filename:lineNumber:columnNumber\r\n// Line ## of scriptname script filename\r\n// 3. IE/Edge (Additional formats)\r\n// at functionName@filename:lineNumber\r\nvar STACKFRAME_BASE_SIZE = 58; // '{\"method\":\"\",\"level\":,\"assembly\":\"\",\"fileName\":\"\",\"line\":}'.length\r\n/**\r\n * Check if the string conforms to what looks like a stack frame line and not just a general message\r\n * comment or other non-stack related info.\r\n *\r\n * This should be used to filter out any leading \"message\" lines from a stack trace, before attempting to parse\r\n * the individual stack frames. Once you have estabilsted the start of the stack frames you can then use the\r\n * FULL_STACK_FRAME_1, FULL_STACK_FRAME_2, FULL_STACK_FRAME_3, and EXTRACT_FILENAME to parse the individual\r\n * stack frames to extract the method, filename, line number, and column number.\r\n * These may still provide invalid matches, so the sequence of execution is important to avoid providing\r\n * an invalid parsed stack.\r\n */\r\nvar IS_FRAME = /^\\s{0,50}(from\\s|at\\s|Line\\s{1,5}\\d{1,10}\\s{1,5}of|\\w{1,50}@\\w{1,80}|[^\\(\\s\\n]+:[0-9\\?]+(?::[0-9\\?]+)?)/;\r\n/**\r\n * Parse a well formed stack frame with both the line and column numbers\r\n * ----------------------------------\r\n * **Primary focus of the matching**\r\n * - at functionName (filename:lineNumber:columnNumber)\r\n * - at filename:lineNumber:columnNumber\r\n * - at functionName@filename:lineNumber:columnNumber\r\n * - functionName (filename:lineNumber:columnNumber)\r\n * - filename:lineNumber:columnNumber\r\n * - functionName@filename:lineNumber:columnNumber\r\n */\r\nvar FULL_STACK_FRAME_1 = /^(?:\\s{0,50}at)?\\s{0,50}([^\\@\\()\\s]+)?\\s{0,50}(?:\\s|\\@|\\()\\s{0,5}([^\\(\\s\\n\\]]+):([0-9\\?]+):([0-9\\?]+)\\)?$/;\r\n/**\r\n * Parse a well formed stack frame with only a line number.\r\n * ----------------------------------\r\n * > Note: this WILL also match with line and column number, but the line number is included with the filename\r\n * > you should attempt to match with FULL_STACK_FRAME_1 first.\r\n *\r\n * **Primary focus of the matching (run FULL_STACK_FRAME_1 first)**\r\n * - at functionName (filename:lineNumber)\r\n * - at filename:lineNumber\r\n * - at functionName@filename:lineNumber\r\n * - functionName (filename:lineNumber)\r\n * - filename:lineNumber\r\n * - functionName@filename:lineNumber\r\n *\r\n * **Secondary matches**\r\n * - at functionName (filename:lineNumber:columnNumber)\r\n * - at filename:lineNumber:columnNumber\r\n * - at functionName@filename:lineNumber:columnNumber\r\n * - functionName (filename:lineNumber:columnNumber)\r\n * - filename:lineNumber:columnNumber\r\n * - functionName@filename:lineNumber:columnNumber\r\n */\r\nvar FULL_STACK_FRAME_2 = /^(?:\\s{0,50}at)?\\s{0,50}([^\\@\\()\\s]+)?\\s{0,50}(?:\\s|\\@|\\()\\s{0,5}([^\\(\\s\\n\\]]+):([0-9\\?]+)\\)?$/;\r\n/**\r\n * Attempt to Parse a frame that doesn't include a line or column number.\r\n * ----------------------------------\r\n * > Note: this WILL also match lines with a line or line and column number, you should attempt to match with\r\n * both FULL_STACK_FRAME_1 and FULL_STACK_FRAME_2 first to avoid false positives.\r\n *\r\n * **Unexpected Invalid Matches** (Matches that should be avoided -- by using the FULL_STACK_FRAME_1 and FULL_STACK_FRAME_2 first)\r\n * - at https://localhost:44365/static/node_bundles/@microsoft/blah/js/bundle.js:144112:27\r\n * - at https://localhost:44365/static/node_bundles/@microsoft/blah/js/bundle.js:144112:27\r\n *\r\n * **Primary focus of the matching (run FULL_STACK_FRAME_1 first)**\r\n * - at functionName@filename\r\n * - at functionName (filename)\r\n * - at functionName filename\r\n * - at filename <- Will actuall match this as the \"method\" and not the filename (care should be taken to avoid this)\r\n * - functionName@filename\r\n * - functionName (filename)\r\n * - functionName filename\r\n * - functionName\r\n *\r\n * **Secondary matches** (The line and column numbers will be included with the matched filename)\r\n * - at functionName (filename:lineNumber:columnNumber)\r\n * - at functionName (filename:lineNumber)\r\n * - at filename:lineNumber:columnNumber\r\n * - at filename:lineNumber\r\n * - at functionName@filename:lineNumber:columnNumber\r\n * - at functionName@filename:lineNumber\r\n * - functionName (filename:lineNumber:columnNumber)\r\n * - functionName (filename:lineNumber)\r\n * - filename:lineNumber:columnNumber\r\n * - filename:lineNumber\r\n * - functionName@filename:lineNumber:columnNumber\r\n * - functionName@filename:lineNumber\r\n */\r\nvar FULL_STACK_FRAME_3 = /^(?:\\s{0,50}at)?\\s{0,50}([^\\@\\()\\s]+)?\\s{0,50}(?:\\s|\\@|\\()\\s{0,5}([^\\(\\s\\n\\)\\]]+)\\)?$/;\r\n/**\r\n * Attempt to extract the filename (with or without line and column numbers) from a string.\r\n * ----------------------------------\r\n * > Note: this will only match the filename (with any line or column numbers) and will\r\n * > return what looks like the filename, however, it will also match random strings that\r\n * > look like a filename, so care should be taken to ensure that the filename is actually\r\n * > a filename before using it.\r\n * >\r\n * > It is recommended to use this in conjunction with the FULL_STACK_FRAME_1, FULL_STACK_FRAME_2, and FULL_STACK_FRAME_3\r\n * > to ensure first to reduce false matches, if all of these fail then you can use this to extract the filename from a random\r\n * > strings to identify any potential filename from a known stack frame line.\r\n *\r\n * **Known Invalid matching**\r\n *\r\n * This regex will basically match any \"final\" string of a line or one that is trailed by a comma, so this should not\r\n * be used as the \"only\" matching regex, but rather as a final fallback to extract the filename from a string.\r\n * If you are certain that the string line is a stack frame and not part of the exception message (lines before the stack)\r\n * or trailing comments, then you can use this to extract the filename and then further parse with PARSE_FILENAME_LINE_COL\r\n * and PARSE_FILENAME_LINE_ONLY to extract any potential the line and column numbers.\r\n *\r\n * **Primary focus of the matching**\r\n * - at (anonymous) @ VM60:1\r\n * - Line 21 of linked script file://localhost/C:/Temp/stacktrace.js\r\n * - Line 11 of inline#1 script in http://localhost:3000/static/js/main.206f4846.js:2:296748\r\n * - Line 68 of inline#2 script in file://localhost/teststack.html\r\n * - at Global code (http://example.com/stacktrace.js:11:1)\r\n */\r\nvar EXTRACT_FILENAME = /(?:^|\\(|\\s{0,10}[\\w\\)]+\\@)?([^\\(\\n\\s\\]\\)]+)(?:\\:([0-9]+)(?:\\:([0-9]+))?)?\\)?(?:,|$)/;\r\n/**\r\n * Attempt to extract the filename, line number, and column number from a string.\r\n */\r\nvar PARSE_FILENAME_LINE_COL = /([^\\(\\s\\n]+):([0-9]+):([0-9]+)$/;\r\n/**\r\n * Attempt to extract the filename and line number from a string.\r\n */\r\nvar PARSE_FILENAME_LINE_ONLY = /([^\\(\\s\\n]+):([0-9]+)$/;\r\nvar NoMethod = \"\";\r\nvar strError = \"error\";\r\nvar strStack = \"stack\";\r\nvar strStackDetails = \"stackDetails\";\r\nvar strErrorSrc = \"errorSrc\";\r\nvar strMessage = \"message\";\r\nvar strDescription = \"description\";\r\nvar _parseSequence = [\r\n { re: FULL_STACK_FRAME_1, len: 5, m: 1, fn: 2, ln: 3, col: 4 },\r\n { chk: _ignoreNative, pre: _scrubAnonymous, re: FULL_STACK_FRAME_2, len: 4, m: 1, fn: 2, ln: 3 },\r\n { re: FULL_STACK_FRAME_3, len: 3, m: 1, fn: 2, hdl: _handleFilename },\r\n { re: EXTRACT_FILENAME, len: 2, fn: 1, hdl: _handleFilename }\r\n];\r\nfunction _scrubAnonymous(frame) {\r\n return frame.replace(/(\\(anonymous\\))/, \"\");\r\n}\r\nfunction _ignoreNative(frame) {\r\n return strIndexOf(frame, \"[native\") < 0;\r\n}\r\nfunction _stringify(value, convertToString) {\r\n var result = value;\r\n if (result && !isString(result)) {\r\n if (JSON && JSON[_DYN_STRINGIFY /* @min:%2estringify */]) {\r\n result = JSON[_DYN_STRINGIFY /* @min:%2estringify */](value);\r\n if (convertToString && (!result || result === \"{}\")) {\r\n if (isFunction(value[_DYN_TO_STRING /* @min:%2etoString */])) {\r\n result = value[_DYN_TO_STRING /* @min:%2etoString */]();\r\n }\r\n else {\r\n result = \"\" + value;\r\n }\r\n }\r\n }\r\n else {\r\n result = \"\" + value + \" - (Missing JSON.stringify)\";\r\n }\r\n }\r\n return result || \"\";\r\n}\r\nfunction _formatMessage(theEvent, errorType) {\r\n var evtMessage = theEvent;\r\n if (theEvent) {\r\n if (evtMessage && !isString(evtMessage)) {\r\n evtMessage = theEvent[strMessage] || theEvent[strDescription] || evtMessage;\r\n }\r\n // Make sure the message is a string\r\n if (evtMessage && !isString(evtMessage)) {\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n evtMessage = _stringify(evtMessage, true);\r\n }\r\n if (theEvent[\"filename\"]) {\r\n // Looks like an event object with filename\r\n evtMessage = evtMessage + \" @\" + (theEvent[\"filename\"] || \"\") + \":\" + (theEvent[\"lineno\"] || \"?\") + \":\" + (theEvent[\"colno\"] || \"?\");\r\n }\r\n }\r\n // Automatically add the error type to the message if it does already appear to be present\r\n if (errorType && errorType !== \"String\" && errorType !== \"Object\" && errorType !== \"Error\" && strIndexOf(evtMessage || \"\", errorType) === -1) {\r\n evtMessage = errorType + \": \" + evtMessage;\r\n }\r\n return evtMessage || \"\";\r\n}\r\nfunction _isExceptionDetailsInternal(value) {\r\n try {\r\n if (isObject(value)) {\r\n return \"hasFullStack\" in value && \"typeName\" in value;\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n return false;\r\n}\r\nfunction _isExceptionInternal(value) {\r\n try {\r\n if (isObject(value)) {\r\n return (\"ver\" in value && \"exceptions\" in value && \"properties\" in value);\r\n }\r\n }\r\n catch (e) {\r\n // This can happen with some native browser objects, but should not happen for the type we are checking for\r\n }\r\n return false;\r\n}\r\nfunction _isStackDetails(details) {\r\n return details && details.src && isString(details.src) && details.obj && isArray(details.obj);\r\n}\r\nfunction _convertStackObj(errorStack) {\r\n var src = errorStack || \"\";\r\n if (!isString(src)) {\r\n if (isString(src[strStack])) {\r\n src = src[strStack];\r\n }\r\n else {\r\n src = \"\" + src;\r\n }\r\n }\r\n var items = src[_DYN_SPLIT /* @min:%2esplit */](\"\\n\");\r\n return {\r\n src: src,\r\n obj: items\r\n };\r\n}\r\nfunction _getOperaStack(errorMessage) {\r\n var stack = [];\r\n var lines = errorMessage[_DYN_SPLIT /* @min:%2esplit */](\"\\n\");\r\n for (var lp = 0; lp < lines[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n var entry = lines[lp];\r\n if (lines[lp + 1]) {\r\n entry += \"@\" + lines[lp + 1];\r\n lp++;\r\n }\r\n stack.push(entry);\r\n }\r\n return {\r\n src: errorMessage,\r\n obj: stack\r\n };\r\n}\r\nfunction _getStackFromErrorObj(errorObj) {\r\n var details = null;\r\n if (errorObj) {\r\n try {\r\n /* Using bracket notation is support older browsers (IE 7/8 -- dont remember the version) that throw when using dot\r\n notation for undefined objects and we don't want to loose the error from being reported */\r\n if (errorObj[strStack]) {\r\n // Chrome/Firefox\r\n details = _convertStackObj(errorObj[strStack]);\r\n }\r\n else if (errorObj[strError] && errorObj[strError][strStack]) {\r\n // Edge error event provides the stack and error object\r\n details = _convertStackObj(errorObj[strError][strStack]);\r\n }\r\n else if (errorObj[\"exception\"] && errorObj.exception[strStack]) {\r\n details = _convertStackObj(errorObj.exception[strStack]);\r\n }\r\n else if (_isStackDetails(errorObj)) {\r\n details = errorObj;\r\n }\r\n else if (_isStackDetails(errorObj[strStackDetails])) {\r\n details = errorObj[strStackDetails];\r\n }\r\n else if (getWindow() && getWindow()[\"opera\"] && errorObj[strMessage]) {\r\n // Opera\r\n details = _getOperaStack(errorObj[_DYN_MESSAGE /* @min:%2emessage */]);\r\n }\r\n else if (errorObj[\"reason\"] && errorObj.reason[strStack]) {\r\n // UnhandledPromiseRejection\r\n details = _convertStackObj(errorObj.reason[strStack]);\r\n }\r\n else if (isString(errorObj)) {\r\n details = _convertStackObj(errorObj);\r\n }\r\n else {\r\n var evtMessage = errorObj[strMessage] || errorObj[strDescription] || \"\";\r\n if (isString(errorObj[strErrorSrc])) {\r\n if (evtMessage) {\r\n evtMessage += \"\\n\";\r\n }\r\n evtMessage += \" from \" + errorObj[strErrorSrc];\r\n }\r\n if (evtMessage) {\r\n details = _convertStackObj(evtMessage);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // something unexpected happened so to avoid failing to report any error lets swallow the exception\r\n // and fallback to the callee/caller method\r\n details = _convertStackObj(e);\r\n }\r\n }\r\n return details || {\r\n src: \"\",\r\n obj: null\r\n };\r\n}\r\nfunction _formatStackTrace(stackDetails) {\r\n var stack = \"\";\r\n if (stackDetails) {\r\n if (stackDetails.obj) {\r\n stack = stackDetails.obj.join(\"\\n\");\r\n }\r\n else {\r\n stack = stackDetails.src || \"\";\r\n }\r\n }\r\n return stack;\r\n}\r\nfunction _parseStack(stack) {\r\n var parsedStack;\r\n var frames = stack.obj;\r\n if (frames && frames[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n parsedStack = [];\r\n var level_1 = 0;\r\n var foundStackStart_1 = false;\r\n var totalSizeInBytes_1 = 0;\r\n arrForEach(frames, function (frame) {\r\n if (foundStackStart_1 || _isStackFrame(frame)) {\r\n var theFrame = asString(frame);\r\n // Once we have found the first stack frame we treat the rest of the lines as part of the stack\r\n foundStackStart_1 = true;\r\n var parsedFrame = _extractStackFrame(theFrame, level_1);\r\n if (parsedFrame) {\r\n totalSizeInBytes_1 += parsedFrame[_DYN_SIZE_IN_BYTES /* @min:%2esizeInBytes */];\r\n parsedStack.push(parsedFrame);\r\n level_1++;\r\n }\r\n }\r\n });\r\n // DP Constraint - exception parsed stack must be < 32KB\r\n // remove frames from the middle to meet the threshold\r\n var exceptionParsedStackThreshold = 32 * 1024;\r\n if (totalSizeInBytes_1 > exceptionParsedStackThreshold) {\r\n var left = 0;\r\n var right = parsedStack[_DYN_LENGTH /* @min:%2elength */] - 1;\r\n var size = 0;\r\n var acceptedLeft = left;\r\n var acceptedRight = right;\r\n while (left < right) {\r\n // check size\r\n var lSize = parsedStack[left][_DYN_SIZE_IN_BYTES /* @min:%2esizeInBytes */];\r\n var rSize = parsedStack[right][_DYN_SIZE_IN_BYTES /* @min:%2esizeInBytes */];\r\n size += lSize + rSize;\r\n if (size > exceptionParsedStackThreshold) {\r\n // remove extra frames from the middle\r\n var howMany = acceptedRight - acceptedLeft + 1;\r\n parsedStack.splice(acceptedLeft, howMany);\r\n break;\r\n }\r\n // update pointers\r\n acceptedLeft = left;\r\n acceptedRight = right;\r\n left++;\r\n right--;\r\n }\r\n }\r\n }\r\n return parsedStack;\r\n}\r\nfunction _getErrorType(errorType) {\r\n // Gets the Error Type by passing the constructor (used to get the true type of native error object).\r\n var typeName = \"\";\r\n if (errorType) {\r\n typeName = errorType.typeName || errorType[_DYN_NAME /* @min:%2ename */] || \"\";\r\n if (!typeName) {\r\n try {\r\n var funcNameRegex = /function (.{1,200})\\(/;\r\n var results = (funcNameRegex).exec((errorType).constructor[_DYN_TO_STRING /* @min:%2etoString */]());\r\n typeName = (results && results[_DYN_LENGTH /* @min:%2elength */] > 1) ? results[1] : \"\";\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty -- Ignoring any failures as nothing we can do\r\n }\r\n }\r\n }\r\n return typeName;\r\n}\r\n/**\r\n * Formats the provided errorObj for display and reporting, it may be a String, Object, integer or undefined depending on the browser.\r\n * @param errorObj - The supplied errorObj\r\n */\r\nexport function _formatErrorCode(errorObj) {\r\n if (errorObj) {\r\n try {\r\n if (!isString(errorObj)) {\r\n var errorType = _getErrorType(errorObj);\r\n var result = _stringify(errorObj, false);\r\n if (!result || result === \"{}\") {\r\n if (errorObj[strError]) {\r\n // Looks like an MS Error Event\r\n errorObj = errorObj[strError];\r\n errorType = _getErrorType(errorObj);\r\n }\r\n result = _stringify(errorObj, true);\r\n }\r\n if (strIndexOf(result, errorType) !== 0 && errorType !== \"String\") {\r\n return errorType + \":\" + result;\r\n }\r\n return result;\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty -- Ignoring any failures as nothing we can do\r\n }\r\n }\r\n // Fallback to just letting the object format itself into a string\r\n return \"\" + (errorObj || \"\");\r\n}\r\nvar Exception = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the ExceptionTelemetry object\r\n */\r\n function Exception(logger, exception, properties, measurements, severityLevel, id) {\r\n this.aiDataContract = {\r\n ver: 1 /* FieldType.Required */,\r\n exceptions: 1 /* FieldType.Required */,\r\n severityLevel: 0 /* FieldType.Default */,\r\n properties: 0 /* FieldType.Default */,\r\n measurements: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2; // TODO: handle the CS\"4.0\" ==> breeze 2 conversion in a better way\r\n if (!_isExceptionInternal(exception)) {\r\n if (!properties) {\r\n properties = {};\r\n }\r\n if (id) {\r\n properties.id = id;\r\n }\r\n _self[_DYN_EXCEPTIONS /* @min:%2eexceptions */] = [_createExceptionDetails(logger, exception, properties)];\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n if (severityLevel) {\r\n _self[_DYN_SEVERITY_LEVEL /* @min:%2eseverityLevel */] = severityLevel;\r\n }\r\n if (id) {\r\n _self.id = id;\r\n }\r\n }\r\n else {\r\n _self[_DYN_EXCEPTIONS /* @min:%2eexceptions */] = exception[_DYN_EXCEPTIONS /* @min:%2eexceptions */] || [];\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = exception[_DYN_PROPERTIES /* @min:%2eproperties */];\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = exception[_DYN_MEASUREMENTS /* @min:%2emeasurements */];\r\n if (exception[_DYN_SEVERITY_LEVEL /* @min:%2eseverityLevel */]) {\r\n _self[_DYN_SEVERITY_LEVEL /* @min:%2eseverityLevel */] = exception[_DYN_SEVERITY_LEVEL /* @min:%2eseverityLevel */];\r\n }\r\n if (exception.id) {\r\n _self.id = exception.id;\r\n exception[_DYN_PROPERTIES /* @min:%2eproperties */].id = exception.id;\r\n }\r\n if (exception[_DYN_PROBLEM_GROUP /* @min:%2eproblemGroup */]) {\r\n _self[_DYN_PROBLEM_GROUP /* @min:%2eproblemGroup */] = exception[_DYN_PROBLEM_GROUP /* @min:%2eproblemGroup */];\r\n }\r\n // bool/int types, use isNullOrUndefined\r\n if (!isNullOrUndefined(exception.isManual)) {\r\n _self.isManual = exception.isManual;\r\n }\r\n }\r\n }\r\n Exception.CreateAutoException = function (message, url, lineNumber, columnNumber, error, evt, stack, errorSrc) {\r\n var errorType = _getErrorType(error || evt || message);\r\n return {\r\n message: _formatMessage(message, errorType),\r\n url: url,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber,\r\n error: _formatErrorCode(error || evt || message),\r\n evt: _formatErrorCode(evt || message),\r\n typeName: errorType,\r\n stackDetails: _getStackFromErrorObj(stack || error || evt),\r\n errorSrc: errorSrc\r\n };\r\n };\r\n Exception.CreateFromInterface = function (logger, exception, properties, measurements) {\r\n var exceptions = exception[_DYN_EXCEPTIONS /* @min:%2eexceptions */]\r\n && arrMap(exception[_DYN_EXCEPTIONS /* @min:%2eexceptions */], function (ex) { return _createExDetailsFromInterface(logger, ex); });\r\n var exceptionData = new Exception(logger, __assign(__assign({}, exception), { exceptions: exceptions }), properties, measurements);\r\n return exceptionData;\r\n };\r\n Exception.prototype.toInterface = function () {\r\n var _a = this, exceptions = _a.exceptions, properties = _a.properties, measurements = _a.measurements, severityLevel = _a.severityLevel, problemGroup = _a.problemGroup, id = _a.id, isManual = _a.isManual;\r\n var exceptionDetailsInterface = exceptions instanceof Array\r\n && arrMap(exceptions, function (exception) { return exception.toInterface(); })\r\n || undefined;\r\n return {\r\n ver: \"4.0\",\r\n exceptions: exceptionDetailsInterface,\r\n severityLevel: severityLevel,\r\n properties: properties,\r\n measurements: measurements,\r\n problemGroup: problemGroup,\r\n id: id,\r\n isManual: isManual\r\n };\r\n };\r\n /**\r\n * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception.\r\n */\r\n Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) {\r\n var _a;\r\n return {\r\n exceptions: [\r\n (_a = {},\r\n _a[_DYN_HAS_FULL_STACK /* @min:hasFullStack */] = true,\r\n _a.message = message,\r\n _a.stack = details,\r\n _a.typeName = typeName,\r\n _a)\r\n ]\r\n };\r\n };\r\n Exception.envelopeType = \"Microsoft.ApplicationInsights.{0}.Exception\";\r\n Exception.dataType = \"ExceptionData\";\r\n Exception.formatError = _formatErrorCode;\r\n return Exception;\r\n}());\r\nexport { Exception };\r\nvar exDetailsAiDataContract = objFreeze({\r\n id: 0 /* FieldType.Default */,\r\n outerId: 0 /* FieldType.Default */,\r\n typeName: 1 /* FieldType.Required */,\r\n message: 1 /* FieldType.Required */,\r\n hasFullStack: 0 /* FieldType.Default */,\r\n stack: 0 /* FieldType.Default */,\r\n parsedStack: 2 /* FieldType.Array */\r\n});\r\nfunction _toInterface() {\r\n var _self = this;\r\n var parsedStack = isArray(_self[_DYN_PARSED_STACK /* @min:%2eparsedStack */])\r\n && arrMap(_self[_DYN_PARSED_STACK /* @min:%2eparsedStack */], function (frame) { return _parsedFrameToInterface(frame); });\r\n var exceptionDetailsInterface = {\r\n id: _self.id,\r\n outerId: _self.outerId,\r\n typeName: _self[_DYN_TYPE_NAME /* @min:%2etypeName */],\r\n message: _self[_DYN_MESSAGE /* @min:%2emessage */],\r\n hasFullStack: _self[_DYN_HAS_FULL_STACK /* @min:%2ehasFullStack */],\r\n stack: _self[strStack],\r\n parsedStack: parsedStack || undefined\r\n };\r\n return exceptionDetailsInterface;\r\n}\r\nexport function _createExceptionDetails(logger, exception, properties) {\r\n var _a;\r\n var id;\r\n var outerId;\r\n var typeName;\r\n var message;\r\n var hasFullStack;\r\n var theStack;\r\n var parsedStack;\r\n if (!_isExceptionDetailsInternal(exception)) {\r\n var error = exception;\r\n var evt = error && error.evt;\r\n if (!isError(error)) {\r\n error = error[strError] || evt || error;\r\n }\r\n typeName = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified;\r\n message = dataSanitizeMessage(logger, _formatMessage(exception || error, typeName)) || strNotSpecified;\r\n var stack = exception[strStackDetails] || _getStackFromErrorObj(exception);\r\n parsedStack = _parseStack(stack);\r\n // after parsedStack is inited, iterate over each frame object, sanitize its assembly field\r\n if (isArray(parsedStack)) {\r\n arrMap(parsedStack, function (frame) {\r\n frame[_DYN_ASSEMBLY /* @min:%2eassembly */] = dataSanitizeString(logger, frame[_DYN_ASSEMBLY /* @min:%2eassembly */]);\r\n frame[_DYN_FILE_NAME /* @min:%2efileName */] = dataSanitizeString(logger, frame[_DYN_FILE_NAME /* @min:%2efileName */]);\r\n });\r\n }\r\n theStack = dataSanitizeException(logger, _formatStackTrace(stack));\r\n hasFullStack = isArray(parsedStack) && parsedStack[_DYN_LENGTH /* @min:%2elength */] > 0;\r\n if (properties) {\r\n properties[_DYN_TYPE_NAME /* @min:%2etypeName */] = properties[_DYN_TYPE_NAME /* @min:%2etypeName */] || typeName;\r\n }\r\n }\r\n else {\r\n typeName = exception[_DYN_TYPE_NAME /* @min:%2etypeName */];\r\n message = exception[_DYN_MESSAGE /* @min:%2emessage */];\r\n theStack = exception[strStack];\r\n parsedStack = exception[_DYN_PARSED_STACK /* @min:%2eparsedStack */] || [];\r\n hasFullStack = exception[_DYN_HAS_FULL_STACK /* @min:%2ehasFullStack */];\r\n }\r\n return _a = {},\r\n _a[_DYN_AI_DATA_CONTRACT /* @min:aiDataContract */] = exDetailsAiDataContract,\r\n _a.id = id,\r\n _a.outerId = outerId,\r\n _a.typeName = typeName,\r\n _a.message = message,\r\n _a[_DYN_HAS_FULL_STACK /* @min:hasFullStack */] = hasFullStack,\r\n _a.stack = theStack,\r\n _a.parsedStack = parsedStack,\r\n _a.toInterface = _toInterface,\r\n _a;\r\n}\r\nexport function _createExDetailsFromInterface(logger, exception) {\r\n var parsedStack = (isArray(exception[_DYN_PARSED_STACK /* @min:%2eparsedStack */])\r\n && arrMap(exception[_DYN_PARSED_STACK /* @min:%2eparsedStack */], function (frame) { return _stackFrameFromInterface(frame); }))\r\n || exception[_DYN_PARSED_STACK /* @min:%2eparsedStack */];\r\n var exceptionDetails = _createExceptionDetails(logger, __assign(__assign({}, exception), { parsedStack: parsedStack }));\r\n return exceptionDetails;\r\n}\r\nfunction _parseFilename(theFrame, fileName) {\r\n var lineCol = fileName[_DYN_MATCH /* @min:%2ematch */](PARSE_FILENAME_LINE_COL);\r\n if (lineCol && lineCol[_DYN_LENGTH /* @min:%2elength */] >= 4) {\r\n theFrame[_DYN_FILE_NAME /* @min:%2efileName */] = lineCol[1];\r\n theFrame[_DYN_LINE /* @min:%2eline */] = parseInt(lineCol[2]);\r\n }\r\n else {\r\n var lineNo = fileName[_DYN_MATCH /* @min:%2ematch */](PARSE_FILENAME_LINE_ONLY);\r\n if (lineNo && lineNo[_DYN_LENGTH /* @min:%2elength */] >= 3) {\r\n theFrame[_DYN_FILE_NAME /* @min:%2efileName */] = lineNo[1];\r\n theFrame[_DYN_LINE /* @min:%2eline */] = parseInt(lineNo[2]);\r\n }\r\n else {\r\n theFrame[_DYN_FILE_NAME /* @min:%2efileName */] = fileName;\r\n }\r\n }\r\n}\r\nfunction _handleFilename(theFrame, sequence, matches) {\r\n var filename = theFrame[_DYN_FILE_NAME /* @min:%2efileName */];\r\n if (sequence.fn && matches && matches[_DYN_LENGTH /* @min:%2elength */] > sequence.fn) {\r\n if (sequence.ln && matches[_DYN_LENGTH /* @min:%2elength */] > sequence.ln) {\r\n filename = strTrim(matches[sequence.fn] || \"\");\r\n theFrame[_DYN_LINE /* @min:%2eline */] = parseInt(strTrim(matches[sequence.ln] || \"\")) || 0;\r\n }\r\n else {\r\n filename = strTrim(matches[sequence.fn] || \"\");\r\n }\r\n }\r\n if (filename) {\r\n _parseFilename(theFrame, filename);\r\n }\r\n}\r\nfunction _isStackFrame(frame) {\r\n var result = false;\r\n if (frame && isString(frame)) {\r\n var trimmedFrame = strTrim(frame);\r\n if (trimmedFrame) {\r\n result = IS_FRAME.test(trimmedFrame);\r\n }\r\n }\r\n return result;\r\n}\r\nvar stackFrameAiDataContract = objFreeze({\r\n level: 1 /* FieldType.Required */,\r\n method: 1 /* FieldType.Required */,\r\n assembly: 0 /* FieldType.Default */,\r\n fileName: 0 /* FieldType.Default */,\r\n line: 0 /* FieldType.Default */\r\n});\r\nexport function _extractStackFrame(frame, level) {\r\n var _a;\r\n var theFrame;\r\n if (frame && isString(frame) && strTrim(frame)) {\r\n theFrame = (_a = {},\r\n _a[_DYN_AI_DATA_CONTRACT /* @min:aiDataContract */] = stackFrameAiDataContract,\r\n _a.level = level,\r\n _a.assembly = strTrim(frame),\r\n _a.method = NoMethod,\r\n _a.fileName = \"\",\r\n _a.line = 0,\r\n _a.sizeInBytes = 0,\r\n _a);\r\n var idx = 0;\r\n while (idx < _parseSequence[_DYN_LENGTH /* @min:%2elength */]) {\r\n var sequence = _parseSequence[idx];\r\n if (sequence.chk && !sequence.chk(frame)) {\r\n break;\r\n }\r\n if (sequence.pre) {\r\n frame = sequence.pre(frame);\r\n }\r\n // Attempt to \"parse\" the stack frame\r\n var matches = frame[_DYN_MATCH /* @min:%2ematch */](sequence.re);\r\n if (matches && matches[_DYN_LENGTH /* @min:%2elength */] >= sequence.len) {\r\n if (sequence.m) {\r\n theFrame.method = strTrim(matches[sequence.m] || NoMethod);\r\n }\r\n if (sequence.hdl) {\r\n // Run any custom handler\r\n sequence.hdl(theFrame, sequence, matches);\r\n }\r\n else if (sequence.fn) {\r\n if (sequence.ln) {\r\n theFrame[_DYN_FILE_NAME /* @min:%2efileName */] = strTrim(matches[sequence.fn] || \"\");\r\n theFrame[_DYN_LINE /* @min:%2eline */] = parseInt(strTrim(matches[sequence.ln] || \"\")) || 0;\r\n }\r\n else {\r\n _parseFilename(theFrame, matches[sequence.fn] || \"\");\r\n }\r\n }\r\n // We found a match so stop looking\r\n break;\r\n }\r\n idx++;\r\n }\r\n }\r\n return _populateFrameSizeInBytes(theFrame);\r\n}\r\nfunction _stackFrameFromInterface(frame) {\r\n var _a;\r\n var parsedFrame = (_a = {},\r\n _a[_DYN_AI_DATA_CONTRACT /* @min:aiDataContract */] = stackFrameAiDataContract,\r\n _a.level = frame.level,\r\n _a.method = frame.method,\r\n _a.assembly = frame[_DYN_ASSEMBLY /* @min:%2eassembly */],\r\n _a.fileName = frame[_DYN_FILE_NAME /* @min:%2efileName */],\r\n _a.line = frame[_DYN_LINE /* @min:%2eline */],\r\n _a.sizeInBytes = 0,\r\n _a);\r\n return _populateFrameSizeInBytes(parsedFrame);\r\n}\r\nfunction _populateFrameSizeInBytes(frame) {\r\n var sizeInBytes = STACKFRAME_BASE_SIZE;\r\n if (frame) {\r\n sizeInBytes += frame.method[_DYN_LENGTH /* @min:%2elength */];\r\n sizeInBytes += frame.assembly[_DYN_LENGTH /* @min:%2elength */];\r\n sizeInBytes += frame.fileName[_DYN_LENGTH /* @min:%2elength */];\r\n sizeInBytes += frame.level.toString()[_DYN_LENGTH /* @min:%2elength */];\r\n sizeInBytes += frame.line.toString()[_DYN_LENGTH /* @min:%2elength */];\r\n frame[_DYN_SIZE_IN_BYTES /* @min:%2esizeInBytes */] = sizeInBytes;\r\n }\r\n return frame;\r\n}\r\nexport function _parsedFrameToInterface(frame) {\r\n return {\r\n level: frame.level,\r\n method: frame.method,\r\n assembly: frame[_DYN_ASSEMBLY /* @min:%2eassembly */],\r\n fileName: frame[_DYN_FILE_NAME /* @min:%2efileName */],\r\n line: frame[_DYN_LINE /* @min:%2eline */]\r\n };\r\n}\r\n//# sourceMappingURL=Exception.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { createValueMap } from \"@microsoft/applicationinsights-core-js\";\r\nexport var RequestHeaders = createValueMap({\r\n requestContextHeader: [0 /* eRequestHeaders.requestContextHeader */, \"Request-Context\"],\r\n requestContextTargetKey: [1 /* eRequestHeaders.requestContextTargetKey */, \"appId\"],\r\n requestContextAppIdFormat: [2 /* eRequestHeaders.requestContextAppIdFormat */, \"appId=cid-v1:\"],\r\n requestIdHeader: [3 /* eRequestHeaders.requestIdHeader */, \"Request-Id\"],\r\n traceParentHeader: [4 /* eRequestHeaders.traceParentHeader */, \"traceparent\"],\r\n traceStateHeader: [5 /* eRequestHeaders.traceStateHeader */, \"tracestate\"],\r\n sdkContextHeader: [6 /* eRequestHeaders.sdkContextHeader */, \"Sdk-Context\"],\r\n sdkContextHeaderAppIdRequest: [7 /* eRequestHeaders.sdkContextHeaderAppIdRequest */, \"appId\"],\r\n requestContextHeaderLowerCase: [8 /* eRequestHeaders.requestContextHeaderLowerCase */, \"request-context\"]\r\n});\r\n//# sourceMappingURL=RequestResponseHeaders.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { getDocument, isString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_LENGTH, _DYN_MATCH, _DYN_PATHNAME, _DYN_TO_LOWER_CASE } from \"./__DynamicConstants\";\r\nvar _document = getDocument() || {};\r\nvar _htmlAnchorIdx = 0;\r\n// Use an array of temporary values as it's possible for multiple calls to parseUrl() will be called with different URLs\r\n// Using a cache size of 5 for now as it current depth usage is at least 2, so adding a minor buffer to handle future updates\r\nvar _htmlAnchorElement = [null, null, null, null, null];\r\nexport function urlParseUrl(url) {\r\n var anchorIdx = _htmlAnchorIdx;\r\n var anchorCache = _htmlAnchorElement;\r\n var tempAnchor = anchorCache[anchorIdx];\r\n if (!_document.createElement) {\r\n // Always create the temp instance if createElement is not available\r\n tempAnchor = { host: urlParseHost(url, true) };\r\n }\r\n else if (!anchorCache[anchorIdx]) {\r\n // Create and cache the unattached anchor instance\r\n tempAnchor = anchorCache[anchorIdx] = _document.createElement(\"a\");\r\n }\r\n tempAnchor.href = url;\r\n // Move the cache index forward\r\n anchorIdx++;\r\n if (anchorIdx >= anchorCache[_DYN_LENGTH /* @min:%2elength */]) {\r\n anchorIdx = 0;\r\n }\r\n _htmlAnchorIdx = anchorIdx;\r\n return tempAnchor;\r\n}\r\nexport function urlGetAbsoluteUrl(url) {\r\n var result;\r\n var a = urlParseUrl(url);\r\n if (a) {\r\n result = a.href;\r\n }\r\n return result;\r\n}\r\nexport function urlGetPathName(url) {\r\n var result;\r\n var a = urlParseUrl(url);\r\n if (a) {\r\n result = a[_DYN_PATHNAME /* @min:%2epathname */];\r\n }\r\n return result;\r\n}\r\nexport function urlGetCompleteUrl(method, absoluteUrl) {\r\n if (method) {\r\n return method.toUpperCase() + \" \" + absoluteUrl;\r\n }\r\n return absoluteUrl;\r\n}\r\n// Fallback method to grab host from url if document.createElement method is not available\r\nexport function urlParseHost(url, inclPort) {\r\n var fullHost = urlParseFullHost(url, inclPort) || \"\";\r\n if (fullHost) {\r\n var match = fullHost[_DYN_MATCH /* @min:%2ematch */](/(www\\d{0,5}\\.)?([^\\/:]{1,256})(:\\d{1,20})?/i);\r\n if (match != null && match[_DYN_LENGTH /* @min:%2elength */] > 3 && isString(match[2]) && match[2][_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n return match[2] + (match[3] || \"\");\r\n }\r\n }\r\n return fullHost;\r\n}\r\nexport function urlParseFullHost(url, inclPort) {\r\n var result = null;\r\n if (url) {\r\n var match = url[_DYN_MATCH /* @min:%2ematch */](/(\\w{1,150}):\\/\\/([^\\/:]{1,256})(:\\d{1,20})?/i);\r\n if (match != null && match[_DYN_LENGTH /* @min:%2elength */] > 2 && isString(match[2]) && match[2][_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n result = match[2] || \"\";\r\n if (inclPort && match[_DYN_LENGTH /* @min:%2elength */] > 2) {\r\n var protocol = (match[1] || \"\")[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n var port = match[3] || \"\";\r\n // IE includes the standard port so pass it off if it's the same as the protocol\r\n if (protocol === \"http\" && port === \":80\") {\r\n port = \"\";\r\n }\r\n else if (protocol === \"https\" && port === \":443\") {\r\n port = \"\";\r\n }\r\n result += port;\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\n//# sourceMappingURL=UrlHelperFuncs.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, arrIndexOf, dateNow, getPerformance, isNullOrUndefined, isValidSpanId, isValidTraceId } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH } from \"./Constants\";\r\nimport { RequestHeaders } from \"./RequestResponseHeaders\";\r\nimport { dataSanitizeString } from \"./Telemetry/Common/DataSanitizer\";\r\nimport { urlParseFullHost, urlParseUrl } from \"./UrlHelperFuncs\";\r\nimport { _DYN_CORRELATION_HEADER_E0, _DYN_LENGTH, _DYN_NAME, _DYN_PATHNAME, _DYN_SPLIT, _DYN_TO_LOWER_CASE } from \"./__DynamicConstants\";\r\n// listing only non-geo specific locations\r\nvar _internalEndpoints = [\r\n DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH,\r\n \"https://breeze.aimon.applicationinsights.io\" + DEFAULT_BREEZE_PATH,\r\n \"https://dc-int.services.visualstudio.com\" + DEFAULT_BREEZE_PATH\r\n];\r\nvar _correlationIdPrefix = \"cid-v1:\";\r\nexport function isInternalApplicationInsightsEndpoint(endpointUrl) {\r\n return arrIndexOf(_internalEndpoints, endpointUrl[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]()) !== -1;\r\n}\r\nexport function correlationIdSetPrefix(prefix) {\r\n _correlationIdPrefix = prefix;\r\n}\r\nexport function correlationIdGetPrefix() {\r\n return _correlationIdPrefix;\r\n}\r\n/**\r\n * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers.\r\n * Headers are always included if the current domain matches the request domain. If they do not match (CORS),\r\n * they are regex-ed across correlationHeaderDomains and correlationHeaderExcludedDomains to determine if headers are included.\r\n * Some environments don't give information on currentHost via window.location.host (e.g. Cordova). In these cases, the user must\r\n * manually supply domains to include correlation headers on. Else, no headers will be included at all.\r\n */\r\nexport function correlationIdCanIncludeCorrelationHeader(config, requestUrl, currentHost) {\r\n if (!requestUrl || (config && config.disableCorrelationHeaders)) {\r\n return false;\r\n }\r\n if (config && config[_DYN_CORRELATION_HEADER_E0 /* @min:%2ecorrelationHeaderExcludePatterns */]) {\r\n for (var i = 0; i < config.correlationHeaderExcludePatterns[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n if (config[_DYN_CORRELATION_HEADER_E0 /* @min:%2ecorrelationHeaderExcludePatterns */][i].test(requestUrl)) {\r\n return false;\r\n }\r\n }\r\n }\r\n var requestHost = urlParseUrl(requestUrl).host[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n if (requestHost && (strIndexOf(requestHost, \":443\") !== -1 || strIndexOf(requestHost, \":80\") !== -1)) {\r\n // [Bug #1260] IE can include the port even for http and https URLs so if present\r\n // try and parse it to remove if it matches the default protocol port\r\n requestHost = (urlParseFullHost(requestUrl, true) || \"\")[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n }\r\n if ((!config || !config.enableCorsCorrelation) && (requestHost && requestHost !== currentHost)) {\r\n return false;\r\n }\r\n var includedDomains = config && config.correlationHeaderDomains;\r\n if (includedDomains) {\r\n var matchExists_1;\r\n arrForEach(includedDomains, function (domain) {\r\n var regex = new RegExp(domain.toLowerCase().replace(/\\\\/g, \"\\\\\\\\\").replace(/\\./g, \"\\\\.\").replace(/\\*/g, \".*\"));\r\n matchExists_1 = matchExists_1 || regex.test(requestHost);\r\n });\r\n if (!matchExists_1) {\r\n return false;\r\n }\r\n }\r\n var excludedDomains = config && config.correlationHeaderExcludedDomains;\r\n if (!excludedDomains || excludedDomains[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n return true;\r\n }\r\n for (var i = 0; i < excludedDomains[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\\\\/g, \"\\\\\\\\\").replace(/\\./g, \"\\\\.\").replace(/\\*/g, \".*\"));\r\n if (regex.test(requestHost)) {\r\n return false;\r\n }\r\n }\r\n // if we don't know anything about the requestHost, require the user to use included/excludedDomains.\r\n // Previously we always returned false for a falsy requestHost\r\n return requestHost && requestHost[_DYN_LENGTH /* @min:%2elength */] > 0;\r\n}\r\n/**\r\n * Combines target appId and target role name from response header.\r\n */\r\nexport function correlationIdGetCorrelationContext(responseHeader) {\r\n if (responseHeader) {\r\n var correlationId = correlationIdGetCorrelationContextValue(responseHeader, RequestHeaders[1 /* eRequestHeaders.requestContextTargetKey */]);\r\n if (correlationId && correlationId !== _correlationIdPrefix) {\r\n return correlationId;\r\n }\r\n }\r\n}\r\n/**\r\n * Gets key from correlation response header\r\n */\r\nexport function correlationIdGetCorrelationContextValue(responseHeader, key) {\r\n if (responseHeader) {\r\n var keyValues = responseHeader[_DYN_SPLIT /* @min:%2esplit */](\",\");\r\n for (var i = 0; i < keyValues[_DYN_LENGTH /* @min:%2elength */]; ++i) {\r\n var keyValue = keyValues[i][_DYN_SPLIT /* @min:%2esplit */](\"=\");\r\n if (keyValue[_DYN_LENGTH /* @min:%2elength */] === 2 && keyValue[0] === key) {\r\n return keyValue[1];\r\n }\r\n }\r\n }\r\n}\r\nexport function AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName) {\r\n var target, name = commandName, data = commandName;\r\n if (absoluteUrl && absoluteUrl[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var parsedUrl = urlParseUrl(absoluteUrl);\r\n target = parsedUrl.host;\r\n if (!name) {\r\n if (parsedUrl[_DYN_PATHNAME /* @min:%2epathname */] != null) {\r\n var pathName = (parsedUrl.pathname[_DYN_LENGTH /* @min:%2elength */] === 0) ? \"/\" : parsedUrl[_DYN_PATHNAME /* @min:%2epathname */];\r\n if (pathName.charAt(0) !== \"/\") {\r\n pathName = \"/\" + pathName;\r\n }\r\n data = parsedUrl[_DYN_PATHNAME /* @min:%2epathname */];\r\n name = dataSanitizeString(logger, method ? method + \" \" + pathName : pathName);\r\n }\r\n else {\r\n name = dataSanitizeString(logger, absoluteUrl);\r\n }\r\n }\r\n }\r\n else {\r\n target = commandName;\r\n name = commandName;\r\n }\r\n return {\r\n target: target,\r\n name: name,\r\n data: data\r\n };\r\n}\r\nexport function dateTimeUtilsNow() {\r\n // returns the window or webworker performance object\r\n var perf = getPerformance();\r\n if (perf && perf.now && perf.timing) {\r\n var now = perf.now() + perf.timing.navigationStart;\r\n // Known issue with IE where this calculation can be negative, so if it is then ignore and fallback\r\n if (now > 0) {\r\n return now;\r\n }\r\n }\r\n return dateNow();\r\n}\r\nexport function dateTimeUtilsDuration(start, end) {\r\n var result = null;\r\n if (start !== 0 && end !== 0 && !isNullOrUndefined(start) && !isNullOrUndefined(end)) {\r\n result = end - start;\r\n }\r\n return result;\r\n}\r\n/**\r\n * Creates a IDistributedTraceContext from an optional telemetryTrace\r\n * @param telemetryTrace - The telemetryTrace instance that is being wrapped\r\n * @param parentCtx - An optional parent distributed trace instance, almost always undefined as this scenario is only used in the case of multiple property handlers.\r\n * @returns A new IDistributedTraceContext instance that is backed by the telemetryTrace or temporary object\r\n */\r\nexport function createDistributedTraceContextFromTrace(telemetryTrace, parentCtx) {\r\n var trace = telemetryTrace || {};\r\n return {\r\n getName: function () {\r\n return trace[_DYN_NAME /* @min:%2ename */];\r\n },\r\n setName: function (newValue) {\r\n parentCtx && parentCtx.setName(newValue);\r\n trace[_DYN_NAME /* @min:%2ename */] = newValue;\r\n },\r\n getTraceId: function () {\r\n return trace.traceID;\r\n },\r\n setTraceId: function (newValue) {\r\n parentCtx && parentCtx.setTraceId(newValue);\r\n if (isValidTraceId(newValue)) {\r\n trace.traceID = newValue;\r\n }\r\n },\r\n getSpanId: function () {\r\n return trace.parentID;\r\n },\r\n setSpanId: function (newValue) {\r\n parentCtx && parentCtx.setSpanId(newValue);\r\n if (isValidSpanId(newValue)) {\r\n trace.parentID = newValue;\r\n }\r\n },\r\n getTraceFlags: function () {\r\n return trace.traceFlags;\r\n },\r\n setTraceFlags: function (newTraceFlags) {\r\n parentCtx && parentCtx.setTraceFlags(newTraceFlags);\r\n trace.traceFlags = newTraceFlags;\r\n }\r\n };\r\n}\r\n//# sourceMappingURL=Util.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { msToTimeSpan } from \"../HelperFuncs\";\r\nimport { AjaxHelperParseDependencyPath } from \"../Util\";\r\nimport { _DYN_DURATION, _DYN_MEASUREMENTS, _DYN_NAME, _DYN_PROPERTIES } from \"../__DynamicConstants\";\r\nimport { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from \"./Common/DataSanitizer\";\r\nvar RemoteDependencyData = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the RemoteDependencyData object\r\n */\r\n function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, requestAPI, correlationContext, properties, measurements) {\r\n if (requestAPI === void 0) { requestAPI = \"Ajax\"; }\r\n this.aiDataContract = {\r\n id: 1 /* FieldType.Required */,\r\n ver: 1 /* FieldType.Required */,\r\n name: 0 /* FieldType.Default */,\r\n resultCode: 0 /* FieldType.Default */,\r\n duration: 0 /* FieldType.Default */,\r\n success: 0 /* FieldType.Default */,\r\n data: 0 /* FieldType.Default */,\r\n target: 0 /* FieldType.Default */,\r\n type: 0 /* FieldType.Default */,\r\n properties: 0 /* FieldType.Default */,\r\n measurements: 0 /* FieldType.Default */,\r\n kind: 0 /* FieldType.Default */,\r\n value: 0 /* FieldType.Default */,\r\n count: 0 /* FieldType.Default */,\r\n min: 0 /* FieldType.Default */,\r\n max: 0 /* FieldType.Default */,\r\n stdDev: 0 /* FieldType.Default */,\r\n dependencyKind: 0 /* FieldType.Default */,\r\n dependencySource: 0 /* FieldType.Default */,\r\n commandName: 0 /* FieldType.Default */,\r\n dependencyTypeName: 0 /* FieldType.Default */\r\n };\r\n var _self = this;\r\n _self.ver = 2;\r\n _self.id = id;\r\n _self[_DYN_DURATION /* @min:%2eduration */] = msToTimeSpan(value);\r\n _self.success = success;\r\n _self.resultCode = resultCode + \"\";\r\n _self.type = dataSanitizeString(logger, requestAPI);\r\n var dependencyFields = AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName);\r\n _self.data = dataSanitizeUrl(logger, commandName) || dependencyFields.data; // get a value from hosturl if commandName not available\r\n _self.target = dataSanitizeString(logger, dependencyFields.target);\r\n if (correlationContext) {\r\n _self.target = \"\".concat(_self.target, \" | \").concat(correlationContext);\r\n }\r\n _self[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, dependencyFields[_DYN_NAME /* @min:%2ename */]);\r\n _self[_DYN_PROPERTIES /* @min:%2eproperties */] = dataSanitizeProperties(logger, properties);\r\n _self[_DYN_MEASUREMENTS /* @min:%2emeasurements */] = dataSanitizeMeasurements(logger, measurements);\r\n }\r\n RemoteDependencyData.envelopeType = \"Microsoft.ApplicationInsights.{0}.RemoteDependency\";\r\n RemoteDependencyData.dataType = \"RemoteDependencyData\";\r\n return RemoteDependencyData;\r\n}());\r\nexport { RemoteDependencyData };\r\n//# sourceMappingURL=RemoteDependencyData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { getDocument, isFunction } from \"@microsoft/applicationinsights-core-js\";\r\nexport function createDomEvent(eventName) {\r\n var event = null;\r\n if (isFunction(Event)) { // Use Event constructor when available\r\n event = new Event(eventName);\r\n }\r\n else { // Event has no constructor in IE\r\n var doc = getDocument();\r\n if (doc && doc.createEvent) {\r\n event = doc.createEvent(\"Event\");\r\n event.initEvent(eventName, true, true);\r\n }\r\n }\r\n return event;\r\n}\r\n//# sourceMappingURL=DomHelperFuncs.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, arrIndexOf, getDocument, getWindow, isArray, objForEachKey, objKeys } from \"@nevware21/ts-utils\";\r\nimport { _DYN_EVT_NAME, _DYN_LENGTH, _DYN_PUSH, _DYN_REPLACE, _DYN_SPLICE, _DYN_SPLIT, _DYN_TYPE } from \"../__DynamicConstants\";\r\nimport { createElmNodeData, createUniqueNamespace } from \"./DataCacheHelper\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\n// Added to help with minfication\r\nvar strOnPrefix = \"on\";\r\nvar strAttachEvent = \"attachEvent\";\r\nvar strAddEventHelper = \"addEventListener\";\r\nvar strDetachEvent = \"detachEvent\";\r\nvar strRemoveEventListener = \"removeEventListener\";\r\nvar strEvents = \"events\";\r\nvar strVisibilityChangeEvt = \"visibilitychange\";\r\nvar strPageHide = \"pagehide\";\r\nvar strPageShow = \"pageshow\";\r\nvar strUnload = \"unload\";\r\nvar strBeforeUnload = \"beforeunload\";\r\nvar strPageHideNamespace = createUniqueNamespace(\"aiEvtPageHide\");\r\nvar strPageShowNamespace = createUniqueNamespace(\"aiEvtPageShow\");\r\nvar rRemoveEmptyNs = /\\.[\\.]+/g;\r\nvar rRemoveTrailingEmptyNs = /[\\.]+$/;\r\nvar _guid = 1;\r\nvar elmNodeData = createElmNodeData(\"events\");\r\nvar eventNamespace = /^([^.]*)(?:\\.(.+)|)/;\r\nfunction _normalizeNamespace(name) {\r\n if (name && name[_DYN_REPLACE /* @min:%2ereplace */]) {\r\n return name[_DYN_REPLACE /* @min:%2ereplace */](/^[\\s\\.]+|(?=[\\s\\.])[\\.\\s]+$/g, STR_EMPTY);\r\n }\r\n return name;\r\n}\r\nfunction _getEvtNamespace(eventName, evtNamespace) {\r\n if (evtNamespace) {\r\n var theNamespace_1 = STR_EMPTY;\r\n if (isArray(evtNamespace)) {\r\n theNamespace_1 = STR_EMPTY;\r\n arrForEach(evtNamespace, function (name) {\r\n name = _normalizeNamespace(name);\r\n if (name) {\r\n if (name[0] !== \".\") {\r\n name = \".\" + name;\r\n }\r\n theNamespace_1 += name;\r\n }\r\n });\r\n }\r\n else {\r\n theNamespace_1 = _normalizeNamespace(evtNamespace);\r\n }\r\n if (theNamespace_1) {\r\n if (theNamespace_1[0] !== \".\") {\r\n theNamespace_1 = \".\" + theNamespace_1;\r\n }\r\n // We may only have the namespace and not an eventName\r\n eventName = (eventName || STR_EMPTY) + theNamespace_1;\r\n }\r\n }\r\n var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY) || []);\r\n return {\r\n type: parsedEvent[1],\r\n ns: ((parsedEvent[2] || STR_EMPTY).replace(rRemoveEmptyNs, \".\").replace(rRemoveTrailingEmptyNs, STR_EMPTY)[_DYN_SPLIT /* @min:%2esplit */](\".\").sort()).join(\".\")\r\n };\r\n}\r\n/**\r\n * Get all of the registered events on the target object, this is primarily used for testing cleanup but may also be used by\r\n * applications to remove their own events\r\n * @param target - The EventTarget that has registered events\r\n * @param eventName - [Optional] The name of the event to return the registered handlers and full name (with namespaces)\r\n * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,\r\n * if the eventName also includes a namespace the namespace(s) are merged into a single namespace\r\n */\r\nexport function __getRegisteredEvents(target, eventName, evtNamespace) {\r\n var theEvents = [];\r\n var eventCache = elmNodeData.get(target, strEvents, {}, false);\r\n var evtName = _getEvtNamespace(eventName, evtNamespace);\r\n objForEachKey(eventCache, function (evtType, registeredEvents) {\r\n arrForEach(registeredEvents, function (value) {\r\n if (!evtName[_DYN_TYPE /* @min:%2etype */] || evtName[_DYN_TYPE /* @min:%2etype */] === value[_DYN_EVT_NAME /* @min:%2eevtName */][_DYN_TYPE /* @min:%2etype */]) {\r\n if (!evtName.ns || evtName.ns === evtName.ns) {\r\n theEvents[_DYN_PUSH /* @min:%2epush */]({\r\n name: value.evtName[_DYN_TYPE /* @min:%2etype */] + (value[_DYN_EVT_NAME /* @min:%2eevtName */].ns ? \".\" + value[_DYN_EVT_NAME /* @min:%2eevtName */].ns : STR_EMPTY),\r\n handler: value.handler\r\n });\r\n }\r\n }\r\n });\r\n });\r\n return theEvents;\r\n}\r\n// Exported for internal unit testing only\r\nfunction _getRegisteredEvents(target, evtName, addDefault) {\r\n if (addDefault === void 0) { addDefault = true; }\r\n var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);\r\n var registeredEvents = aiEvts[evtName];\r\n if (!registeredEvents) {\r\n registeredEvents = aiEvts[evtName] = [];\r\n }\r\n return registeredEvents;\r\n}\r\nfunction _doDetach(obj, evtName, handlerRef, useCapture) {\r\n if (obj && evtName && evtName[_DYN_TYPE /* @min:%2etype */]) {\r\n if (obj[strRemoveEventListener]) {\r\n obj[strRemoveEventListener](evtName[_DYN_TYPE /* @min:%2etype */], handlerRef, useCapture);\r\n }\r\n else if (obj[strDetachEvent]) {\r\n obj[strDetachEvent](strOnPrefix + evtName[_DYN_TYPE /* @min:%2etype */], handlerRef);\r\n }\r\n }\r\n}\r\nfunction _doAttach(obj, evtName, handlerRef, useCapture) {\r\n var result = false;\r\n if (obj && evtName && evtName[_DYN_TYPE /* @min:%2etype */] && handlerRef) {\r\n if (obj[strAddEventHelper]) {\r\n // all browsers except IE before version 9\r\n obj[strAddEventHelper](evtName[_DYN_TYPE /* @min:%2etype */], handlerRef, useCapture);\r\n result = true;\r\n }\r\n else if (obj[strAttachEvent]) {\r\n // IE before version 9\r\n obj[strAttachEvent](strOnPrefix + evtName[_DYN_TYPE /* @min:%2etype */], handlerRef);\r\n result = true;\r\n }\r\n }\r\n return result;\r\n}\r\nfunction _doUnregister(target, events, evtName, unRegFn) {\r\n var idx = events[_DYN_LENGTH /* @min:%2elength */];\r\n while (idx--) {\r\n var theEvent = events[idx];\r\n if (theEvent) {\r\n if (!evtName.ns || evtName.ns === theEvent[_DYN_EVT_NAME /* @min:%2eevtName */].ns) {\r\n if (!unRegFn || unRegFn(theEvent)) {\r\n _doDetach(target, theEvent[_DYN_EVT_NAME /* @min:%2eevtName */], theEvent.handler, theEvent.capture);\r\n // Remove the registered event\r\n events[_DYN_SPLICE /* @min:%2esplice */](idx, 1);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction _unregisterEvents(target, evtName, unRegFn) {\r\n if (evtName[_DYN_TYPE /* @min:%2etype */]) {\r\n _doUnregister(target, _getRegisteredEvents(target, evtName[_DYN_TYPE /* @min:%2etype */]), evtName, unRegFn);\r\n }\r\n else {\r\n var eventCache = elmNodeData.get(target, strEvents, {});\r\n objForEachKey(eventCache, function (evtType, events) {\r\n _doUnregister(target, events, evtName, unRegFn);\r\n });\r\n // Cleanup\r\n if (objKeys(eventCache)[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n elmNodeData.kill(target, strEvents);\r\n }\r\n }\r\n}\r\nexport function mergeEvtNamespace(theNamespace, namespaces) {\r\n var newNamespaces;\r\n if (namespaces) {\r\n if (isArray(namespaces)) {\r\n newNamespaces = [theNamespace].concat(namespaces);\r\n }\r\n else {\r\n newNamespaces = [theNamespace, namespaces];\r\n }\r\n // resort the namespaces so they are always in order\r\n newNamespaces = (_getEvtNamespace(\"xx\", newNamespaces).ns)[_DYN_SPLIT /* @min:%2esplit */](\".\");\r\n }\r\n else {\r\n newNamespaces = theNamespace;\r\n }\r\n return newNamespaces;\r\n}\r\n/**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj - Object to add the event too.\r\n * @param eventName - String that specifies any of the standard DHTML Events without \"on\" prefix, if may also include an optional (dot \".\" prefixed)\r\n * namespaces \"click\" \"click.mynamespace\" in addition to specific namespaces.\r\n * @param handlerRef - Pointer that specifies the function to call when event fires\r\n * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,\r\n * if the eventName also includes a namespace the namespace(s) are merged into a single namespace\r\n * @param useCapture - [Optional] Defaults to false\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\nexport function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n var result = false;\r\n if (target) {\r\n try {\r\n var evtName = _getEvtNamespace(eventName, evtNamespace);\r\n result = _doAttach(target, evtName, handlerRef, useCapture);\r\n if (result && elmNodeData.accept(target)) {\r\n var registeredEvent = {\r\n guid: _guid++,\r\n evtName: evtName,\r\n handler: handlerRef,\r\n capture: useCapture\r\n };\r\n _getRegisteredEvents(target, evtName.type)[_DYN_PUSH /* @min:%2epush */](registeredEvent);\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Removes an event handler for the specified event\r\n * @param Object - to remove the event from\r\n * @param eventName - The name of the event, with optional namespaces or just the namespaces,\r\n * such as \"click\", \"click.mynamespace\" or \".mynamespace\"\r\n * @param handlerRef - The callback function that needs to be removed from the given event, when using a\r\n * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers\r\n * otherwise this will only remove events with this specific handler.\r\n * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,\r\n * if the eventName also includes a namespace the namespace(s) are merged into a single namespace\r\n * @param useCapture - [Optional] Defaults to false\r\n */\r\nexport function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n if (target) {\r\n try {\r\n var evtName_1 = _getEvtNamespace(eventName, evtNamespace);\r\n var found_1 = false;\r\n _unregisterEvents(target, evtName_1, function (regEvent) {\r\n if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) {\r\n found_1 = true;\r\n return true;\r\n }\r\n return false;\r\n });\r\n if (!found_1) {\r\n // fallback to try and remove as requested\r\n _doDetach(target, evtName_1, handlerRef, useCapture);\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n}\r\n/**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj - Object to add the event too.\r\n * @param eventNameWithoutOn - String that specifies any of the standard DHTML Events without \"on\" prefix and optional (dot \".\" prefixed) namespaces \"click\" \"click.mynamespace\".\r\n * @param handlerRef - Pointer that specifies the function to call when event fires\r\n * @param useCapture - [Optional] Defaults to false\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\nexport function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);\r\n}\r\n/**\r\n * Removes an event handler for the specified event\r\n * @param Object - to remove the event from\r\n * @param eventNameWithoutOn - The name of the event, with optional namespaces or just the namespaces,\r\n * such as \"click\", \"click.mynamespace\" or \".mynamespace\"\r\n * @param handlerRef - The callback function that needs to be removed from the given event, when using a\r\n * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers\r\n * otherwise this will only remove events with this specific handler.\r\n * @param useCapture - [Optional] Defaults to false\r\n */\r\nexport function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture);\r\n}\r\n/**\r\n * Trys to add an event handler for the specified event to the window, body and document\r\n * @param eventName - The name of the event\r\n * @param callback - The callback function that needs to be executed for the given event\r\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n * @returns - true if the handler was successfully added\r\n */\r\nexport function addEventHandler(eventName, callback, evtNamespace) {\r\n var result = false;\r\n var w = getWindow();\r\n if (w) {\r\n result = eventOn(w, eventName, callback, evtNamespace);\r\n result = eventOn(w[\"body\"], eventName, callback, evtNamespace) || result;\r\n }\r\n var doc = getDocument();\r\n if (doc) {\r\n result = eventOn(doc, eventName, callback, evtNamespace) || result;\r\n }\r\n return result;\r\n}\r\n/**\r\n * Trys to remove event handler(s) for the specified event/namespace to the window, body and document\r\n * @param eventName - The name of the event, with optional namespaces or just the namespaces,\r\n * such as \"click\", \"click.mynamespace\" or \".mynamespace\"\r\n * @param callback - The callback function that needs to be removed from the given event, when using a\r\n * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers\r\n * otherwise this will only remove events with this specific handler.\r\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n */\r\nexport function removeEventHandler(eventName, callback, evtNamespace) {\r\n var w = getWindow();\r\n if (w) {\r\n eventOff(w, eventName, callback, evtNamespace);\r\n eventOff(w[\"body\"], eventName, callback, evtNamespace);\r\n }\r\n var doc = getDocument();\r\n if (doc) {\r\n eventOff(doc, eventName, callback, evtNamespace);\r\n }\r\n}\r\n/**\r\n * Bind the listener to the array of events\r\n * @param events - An string array of event names to bind the listener to\r\n * @param listener - The event callback to call when the event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\r\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nfunction _addEventListeners(events, listener, excludeEvents, evtNamespace) {\r\n var added = false;\r\n if (listener && events && events[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(events, function (name) {\r\n if (name) {\r\n if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) {\r\n added = addEventHandler(name, listener, evtNamespace) || added;\r\n }\r\n }\r\n });\r\n }\r\n return added;\r\n}\r\n/**\r\n * Bind the listener to the array of events\r\n * @param events - An string array of event names to bind the listener to\r\n * @param listener - The event callback to call when the event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\r\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addEventListeners(events, listener, excludeEvents, evtNamespace) {\r\n var added = false;\r\n if (listener && events && isArray(events)) {\r\n added = _addEventListeners(events, listener, excludeEvents, evtNamespace);\r\n if (!added && excludeEvents && excludeEvents[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n // Failed to add any listeners and we excluded some, so just attempt to add the excluded events\r\n added = _addEventListeners(events, listener, null, evtNamespace);\r\n }\r\n }\r\n return added;\r\n}\r\n/**\r\n * Remove the listener from the array of events\r\n * @param events - An string array of event names to bind the listener to\r\n * @param listener - The event callback to call when the event is triggered\r\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n */\r\nexport function removeEventListeners(events, listener, evtNamespace) {\r\n if (events && isArray(events)) {\r\n arrForEach(events, function (name) {\r\n if (name) {\r\n removeEventHandler(name, listener, evtNamespace);\r\n }\r\n });\r\n }\r\n}\r\n/**\r\n * Listen to the 'beforeunload', 'unload' and 'pagehide' events which indicates a page unload is occurring,\r\n * this does NOT listen to the 'visibilitychange' event as while it does indicate that the page is being hidden\r\n * it does not *necessarily* mean that the page is being completely unloaded, it can mean that the user is\r\n * just navigating to a different Tab and may come back (without unloading the page). As such you may also\r\n * need to listen to the 'addPageHideEventListener' and 'addPageShowEventListener' events.\r\n * @param listener - The event callback to call when a page unload event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked, unless no other events can be.\r\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) {\r\n // Hook the unload event for the document, window and body to ensure that the client events are flushed to the server\r\n // As just hooking the window does not always fire (on chrome) for page navigation's.\r\n return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace);\r\n}\r\n/**\r\n * Remove any matching 'beforeunload', 'unload' and 'pagehide' events that may have been added via addEventListener,\r\n * addEventListeners, addPageUnloadEventListener or addPageHideEventListener.\r\n * @param listener - The specific event callback to to be removed\r\n * @param evtNamespace - [Optional] Namespace(s) uniquely identified and removed based on this namespace.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function removePageUnloadEventListener(listener, evtNamespace) {\r\n removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace);\r\n}\r\n/**\r\n * Listen to the pagehide and visibility changing to 'hidden' events, because the 'visibilitychange' uses\r\n * an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call\r\n * removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.\r\n * @param listener - The event callback to call when a page hide event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\r\n * @param evtNamespace - [Optional] A Namespace to append to the event listeners so they can be uniquely identified and removed\r\n * based on this namespace. This call also adds an additional unique \"pageshow\" namespace to the events\r\n * so that only the matching \"removePageHideEventListener\" can remove these events.\r\n * Suggestion: pass as true if you are also calling addPageUnloadEventListener as that also hooks pagehide\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageHideEventListener(listener, excludeEvents, evtNamespace) {\r\n function _handlePageVisibility(evt) {\r\n var doc = getDocument();\r\n if (listener && doc && doc.visibilityState === \"hidden\") {\r\n listener(evt);\r\n }\r\n }\r\n // add the unique page show namespace to any provided namespace so we can only remove the ones added by \"pagehide\"\r\n var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace);\r\n var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces);\r\n if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) {\r\n pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded;\r\n }\r\n if (!pageUnloadAdded && excludeEvents) {\r\n // Failed to add any listeners and we where requested to exclude some, so just call again without excluding anything\r\n pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace);\r\n }\r\n return pageUnloadAdded;\r\n}\r\n/**\r\n * Removes the pageHide event listeners added by addPageHideEventListener, because the 'visibilitychange' uses\r\n * an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageHideEventListener\r\n * as the remove ignores the listener argument for the 'visibilitychange' event.\r\n * @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')\r\n * @param evtNamespace - The unique namespace used when calling addPageShowEventListener\r\n */\r\nexport function removePageHideEventListener(listener, evtNamespace) {\r\n // add the unique page show namespace to any provided namespace so we only remove the ones added by \"pagehide\"\r\n var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace);\r\n removeEventListeners([strPageHide], listener, newNamespaces);\r\n removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);\r\n}\r\n/**\r\n * Listen to the pageshow and visibility changing to 'visible' events, because the 'visibilitychange' uses\r\n * an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call\r\n * removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.\r\n * @param listener - The event callback to call when a page is show event is triggered\r\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\r\n * @param evtNamespace - [Optional/Recommended] A Namespace to append to the event listeners so they can be uniquely\r\n * identified and removed based on this namespace. This call also adds an additional unique \"pageshow\" namespace to the events\r\n * so that only the matching \"removePageShowEventListener\" can remove these events.\r\n * @returns true - when at least one of the events was registered otherwise false\r\n */\r\nexport function addPageShowEventListener(listener, excludeEvents, evtNamespace) {\r\n function _handlePageVisibility(evt) {\r\n var doc = getDocument();\r\n if (listener && doc && doc.visibilityState === \"visible\") {\r\n listener(evt);\r\n }\r\n }\r\n // add the unique page show namespace to any provided namespace so we can only remove the ones added by \"pageshow\"\r\n var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace);\r\n var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces);\r\n pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded;\r\n if (!pageShowAdded && excludeEvents) {\r\n // Failed to add any listeners and we where requested to exclude some, so just call again without excluding anything\r\n pageShowAdded = addPageShowEventListener(listener, null, evtNamespace);\r\n }\r\n return pageShowAdded;\r\n}\r\n/**\r\n * Removes the pageShow event listeners added by addPageShowEventListener, because the 'visibilitychange' uses\r\n * an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageShowEventListener\r\n * as the remove ignores the listener argument for the 'visibilitychange' event.\r\n * @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')\r\n * @param evtNamespace - The unique namespace used when calling addPageShowEventListener\r\n */\r\nexport function removePageShowEventListener(listener, evtNamespace) {\r\n // add the unique page show namespace to any provided namespace so we only remove the ones added by \"pageshow\"\r\n var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace);\r\n removeEventListeners([strPageShow], listener, newNamespaces);\r\n removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);\r\n}\r\n//# sourceMappingURL=EventHelpers.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { strShimFunction, strShimPrototype } from \"@microsoft/applicationinsights-shims\";\r\nimport { getInst, objHasOwnProperty } from \"@nevware21/ts-utils\";\r\nimport { _DYN_APPLY, _DYN_LENGTH, _DYN_PUSH, _DYN_SPLICE } from \"../__DynamicConstants\";\r\nimport { _getObjProto } from \"./HelperFuncs\";\r\nvar aiInstrumentHooks = \"_aiHooks\";\r\nvar cbNames = [\r\n \"req\", \"rsp\", \"hkErr\", \"fnErr\"\r\n];\r\n/** @ignore */\r\nfunction _arrLoop(arr, fn) {\r\n if (arr) {\r\n for (var lp = 0; lp < arr[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n if (fn(arr[lp], lp)) {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n/** @ignore */\r\nfunction _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) {\r\n if (type >= 0 /* CallbackType.Request */ && type <= 2 /* CallbackType.HookError */) {\r\n _arrLoop(hooks, function (hook, idx) {\r\n var cbks = hook.cbks;\r\n var cb = cbks[cbNames[type]];\r\n if (cb) {\r\n // Set the specific hook context implementation using a lazy creation pattern\r\n callDetails.ctx = function () {\r\n var ctx = hookCtx[idx] = (hookCtx[idx] || {});\r\n return ctx;\r\n };\r\n try {\r\n cb[_DYN_APPLY /* @min:%2eapply */](callDetails.inst, cbArgs);\r\n }\r\n catch (err) {\r\n var orgEx = callDetails.err;\r\n try {\r\n // Report Hook error via the callback\r\n var hookErrorCb = cbks[cbNames[2 /* CallbackType.HookError */]];\r\n if (hookErrorCb) {\r\n callDetails.err = err;\r\n hookErrorCb[_DYN_APPLY /* @min:%2eapply */](callDetails.inst, cbArgs);\r\n }\r\n }\r\n catch (e) {\r\n // Not much we can do here -- swallowing the exception to avoid crashing the hosting app\r\n }\r\n finally {\r\n // restore the original exception (if any)\r\n callDetails.err = orgEx;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n}\r\n/** @ignore */\r\nfunction _createFunctionHook(aiHook) {\r\n // Define a temporary method that queues-up a the real method call\r\n return function () {\r\n var funcThis = this;\r\n // Capture the original arguments passed to the method\r\n var orgArgs = arguments;\r\n var hooks = aiHook.h;\r\n var funcArgs = {\r\n name: aiHook.n,\r\n inst: funcThis,\r\n ctx: null,\r\n set: _replaceArg\r\n };\r\n var hookCtx = [];\r\n var cbArgs = _createArgs([funcArgs], orgArgs);\r\n funcArgs.evt = getInst(\"event\");\r\n function _createArgs(target, theArgs) {\r\n _arrLoop(theArgs, function (arg) {\r\n target[_DYN_PUSH /* @min:%2epush */](arg);\r\n });\r\n return target;\r\n }\r\n function _replaceArg(idx, value) {\r\n orgArgs = _createArgs([], orgArgs);\r\n orgArgs[idx] = value;\r\n cbArgs = _createArgs([funcArgs], orgArgs);\r\n }\r\n // Call the pre-request hooks\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 /* CallbackType.Request */);\r\n // Call the original function was called\r\n var theFunc = aiHook.f;\r\n if (theFunc) {\r\n try {\r\n funcArgs.rslt = theFunc[_DYN_APPLY /* @min:%2eapply */](funcThis, orgArgs);\r\n }\r\n catch (err) {\r\n // Report the request callback\r\n funcArgs.err = err;\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 /* CallbackType.FunctionError */);\r\n // rethrow the original exception so anyone listening for it can catch the exception\r\n throw err;\r\n }\r\n }\r\n // Call the post-request hooks\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 /* CallbackType.Response */);\r\n return funcArgs.rslt;\r\n };\r\n}\r\n/** @ignore */\r\nfunction _getOwner(target, name, checkPrototype, checkParentProto) {\r\n var owner = null;\r\n if (target) {\r\n if (objHasOwnProperty(target, name)) {\r\n owner = target;\r\n }\r\n else if (checkPrototype) {\r\n owner = _getOwner(_getObjProto(target), name, checkParentProto, false);\r\n }\r\n }\r\n return owner;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcName - The function name\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n */\r\nexport function InstrumentProto(target, funcName, callbacks) {\r\n if (target) {\r\n return InstrumentFunc(target[strShimPrototype], funcName, callbacks, false);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcNames - The function names to intercept and call\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n */\r\nexport function InstrumentProtos(target, funcNames, callbacks) {\r\n if (target) {\r\n return InstrumentFuncs(target[strShimPrototype], funcNames, callbacks, false);\r\n }\r\n return null;\r\n}\r\nfunction _createInstrumentHook(owner, funcName, fn, callbacks) {\r\n var aiHook = fn && fn[aiInstrumentHooks];\r\n if (!aiHook) {\r\n // Only hook the function once\r\n aiHook = {\r\n i: 0,\r\n n: funcName,\r\n f: fn,\r\n h: []\r\n };\r\n // Override (hook) the original function\r\n var newFunc = _createFunctionHook(aiHook);\r\n newFunc[aiInstrumentHooks] = aiHook; // Tag and store the function hooks\r\n owner[funcName] = newFunc;\r\n }\r\n var theHook = {\r\n // tslint:disable:object-literal-shorthand\r\n id: aiHook.i,\r\n cbks: callbacks,\r\n rm: function () {\r\n // DO NOT Use () => { shorthand for the function as the this gets replaced\r\n // with the outer this and not the this for theHook instance.\r\n var id = this.id;\r\n _arrLoop(aiHook.h, function (hook, idx) {\r\n if (hook.id === id) {\r\n aiHook.h[_DYN_SPLICE /* @min:%2esplice */](idx, 1);\r\n return 1;\r\n }\r\n });\r\n }\r\n // tslint:enable:object-literal-shorthand\r\n };\r\n aiHook.i++;\r\n aiHook.h[_DYN_PUSH /* @min:%2epush */](theHook);\r\n return theHook;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcName - The function name\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n * @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype\r\n */\r\nexport function InstrumentFunc(target, funcName, callbacks, checkPrototype, checkParentProto) {\r\n if (checkPrototype === void 0) { checkPrototype = true; }\r\n if (target && funcName && callbacks) {\r\n var owner = _getOwner(target, funcName, checkPrototype, checkParentProto);\r\n if (owner) {\r\n var fn = owner[funcName];\r\n if (typeof fn === strShimFunction) {\r\n return _createInstrumentHook(owner, funcName, fn, callbacks);\r\n }\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named functions for the target class / object\r\n * @param target - The target object\r\n * @param funcNames - The function names to intercept and call\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n * @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype\r\n */\r\nexport function InstrumentFuncs(target, funcNames, callbacks, checkPrototype, checkParentProto) {\r\n if (checkPrototype === void 0) { checkPrototype = true; }\r\n var hooks = null;\r\n _arrLoop(funcNames, function (funcName) {\r\n var hook = InstrumentFunc(target, funcName, callbacks, checkPrototype, checkParentProto);\r\n if (hook) {\r\n if (!hooks) {\r\n hooks = [];\r\n }\r\n hooks[_DYN_PUSH /* @min:%2epush */](hook);\r\n }\r\n });\r\n return hooks;\r\n}\r\n/**\r\n * Add an instrumentation hook to the provided named \"event\" for the target class / object, this doesn't check whether the\r\n * named \"event\" is in fact a function and just assigns the instrumentation hook to the target[evtName]\r\n * @param target - The target object\r\n * @param evtName - The name of the event\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n * @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype\r\n */\r\nexport function InstrumentEvent(target, evtName, callbacks, checkPrototype, checkParentProto) {\r\n if (target && evtName && callbacks) {\r\n var owner = _getOwner(target, evtName, checkPrototype, checkParentProto) || target;\r\n if (owner) {\r\n return _createInstrumentHook(owner, evtName, owner[evtName], callbacks);\r\n }\r\n }\r\n return null;\r\n}\r\n//# sourceMappingURL=InstrumentHooks.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dateTimeUtilsDuration } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, arrForEach, dumpObj, getDocument, getExceptionName, getLocation, isNullOrUndefined } from \"@microsoft/applicationinsights-core-js\";\r\nimport { getPerformance, isUndefined, isWebWorker, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { _DYN_DURATION, _DYN_GET_ENTRIES_BY_TYPE, _DYN_GET_PERFORMANCE_TIMI16, _DYN_HREF, _DYN_IS_PERFORMANCE_TIMIN15, _DYN_IS_PERFORMANCE_TIMIN18, _DYN_LENGTH, _DYN_NAVIGATION_START, _DYN_POPULATE_PAGE_VIEW_P4, _DYN_PROPERTIES, _DYN_SEND_PAGE_VIEW_INTER2, _DYN_SEND_PAGE_VIEW_PERFO3, _DYN_SHOULD_COLLECT_DURAT17, _DYN_START_TIME, _DYN_TRACK_PAGE_VIEW } from \"../../__DynamicConstants\";\r\n/**\r\n * Class encapsulates sending page views and page view performance telemetry.\r\n */\r\nvar PageViewManager = /** @class */ (function () {\r\n function PageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) {\r\n dynamicProto(PageViewManager, this, function (_self) {\r\n var queueTimer = null;\r\n var itemQueue = [];\r\n var pageViewPerformanceSent = false;\r\n var firstPageViewSent = false;\r\n var _logger;\r\n if (core) {\r\n _logger = core.logger;\r\n }\r\n function _flushChannels(isAsync) {\r\n if (core) {\r\n core.flush(isAsync, function () {\r\n // Event flushed, callback added to prevent promise creation\r\n });\r\n }\r\n }\r\n function _startTimer() {\r\n if (!queueTimer) {\r\n queueTimer = scheduleTimeout((function () {\r\n queueTimer = null;\r\n var allItems = itemQueue.slice(0);\r\n var doFlush = false;\r\n itemQueue = [];\r\n arrForEach(allItems, function (item) {\r\n if (!item()) {\r\n // Not processed so rescheduled\r\n itemQueue.push(item);\r\n }\r\n else {\r\n doFlush = true;\r\n }\r\n });\r\n if (itemQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _startTimer();\r\n }\r\n if (doFlush) {\r\n // We process at least one item so flush the queue\r\n _flushChannels(true);\r\n }\r\n }), 100);\r\n }\r\n }\r\n function _addQueue(cb) {\r\n itemQueue.push(cb);\r\n _startTimer();\r\n }\r\n _self[_DYN_TRACK_PAGE_VIEW /* @min:%2etrackPageView */] = function (pageView, customProperties) {\r\n var name = pageView.name;\r\n if (isNullOrUndefined(name) || typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = pageView.name = doc && doc.title || \"\";\r\n }\r\n var uri = pageView.uri;\r\n if (isNullOrUndefined(uri) || typeof uri !== \"string\") {\r\n var location_1 = getLocation();\r\n uri = pageView.uri = location_1 && location_1[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n }\r\n if (!firstPageViewSent) {\r\n var perf = getPerformance();\r\n // Access the performance timing object\r\n var navigationEntries = (perf && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */] && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */](\"navigation\"));\r\n // Edge Case the navigation Entries may return an empty array and the timeOrigin is not supported on IE\r\n if (navigationEntries && navigationEntries[0] && !isUndefined(perf.timeOrigin)) {\r\n // Get the value of loadEventStart\r\n var loadEventStart = navigationEntries[0].loadEventStart;\r\n pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(perf.timeOrigin + loadEventStart);\r\n }\r\n else {\r\n // calculate the start time manually\r\n var duration_1 = ((customProperties || pageView[_DYN_PROPERTIES /* @min:%2eproperties */] || {})[_DYN_DURATION /* @min:%2eduration */] || 0);\r\n pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(new Date().getTime() - duration_1);\r\n }\r\n firstPageViewSent = true;\r\n }\r\n // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user\r\n // do not provide the duration, set duration to undefined\r\n // Also this is case 4\r\n if (!pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN15 /* @min:%2eisPerformanceTimingSupported */]()) {\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n _flushChannels(true);\r\n if (!isWebWorker()) {\r\n // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing)\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 25 /* _eInternalMessageId.NavigationTimingNotSupported */, \"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.\");\r\n }\r\n return;\r\n }\r\n var pageViewSent = false;\r\n var customDuration;\r\n // if the performance timing is supported by the browser, calculate the custom duration\r\n var start = pageViewPerformanceManager[_DYN_GET_PERFORMANCE_TIMI16 /* @min:%2egetPerformanceTiming */]()[_DYN_NAVIGATION_START /* @min:%2enavigationStart */];\r\n if (start > 0) {\r\n customDuration = dateTimeUtilsDuration(start, +new Date);\r\n if (!pageViewPerformanceManager[_DYN_SHOULD_COLLECT_DURAT17 /* @min:%2eshouldCollectDuration */](customDuration)) {\r\n customDuration = undefined;\r\n }\r\n }\r\n // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if\r\n // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier\r\n var duration;\r\n if (!isNullOrUndefined(customProperties) &&\r\n !isNullOrUndefined(customProperties[_DYN_DURATION /* @min:%2eduration */])) {\r\n duration = customProperties[_DYN_DURATION /* @min:%2eduration */];\r\n }\r\n if (overridePageViewDuration || !isNaN(duration)) {\r\n if (isNaN(duration)) {\r\n // case 3\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;\r\n }\r\n // case 2\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n _flushChannels(true);\r\n pageViewSent = true;\r\n }\r\n // now try to send the page view performance telemetry\r\n var maxDurationLimit = 60000;\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n // Queue the event for processing\r\n _addQueue(function () {\r\n var processed = false;\r\n try {\r\n if (pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN18 /* @min:%2eisPerformanceTimingDataReady */]()) {\r\n processed = true;\r\n var pageViewPerformance = {\r\n name: name,\r\n uri: uri\r\n };\r\n pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 /* @min:%2epopulatePageViewPerformanceEvent */](pageViewPerformance);\r\n if (!pageViewPerformance.isValid && !pageViewSent) {\r\n // If navigation timing gives invalid numbers, then go back to \"override page view duration\" mode.\r\n // That's the best value we can get that makes sense.\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n else {\r\n if (!pageViewSent) {\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = pageViewPerformance.durationMs;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n if (!pageViewPerformanceSent) {\r\n appInsights[_DYN_SEND_PAGE_VIEW_PERFO3 /* @min:%2esendPageViewPerformanceInternal */](pageViewPerformance, customProperties);\r\n pageViewPerformanceSent = true;\r\n }\r\n }\r\n }\r\n else if (start > 0 && dateTimeUtilsDuration(start, +new Date) > maxDurationLimit) {\r\n // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry\r\n // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready\r\n processed = true;\r\n if (!pageViewSent) {\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = maxDurationLimit;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 38 /* _eInternalMessageId.TrackPVFailedCalc */, \"trackPageView failed on page load calculation: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n return processed;\r\n });\r\n };\r\n _self.teardown = function (unloadCtx, unloadState) {\r\n if (queueTimer) {\r\n queueTimer.cancel();\r\n queueTimer = null;\r\n var allItems = itemQueue.slice(0);\r\n var doFlush_1 = false;\r\n itemQueue = [];\r\n arrForEach(allItems, function (item) {\r\n if (item()) {\r\n doFlush_1 = true;\r\n }\r\n });\r\n }\r\n };\r\n });\r\n }\r\n /**\r\n * Currently supported cases:\r\n * 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available.\r\n * a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent.\r\n * 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away.\r\n * 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported).\r\n * 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration.\r\n *\r\n * In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported.\r\n */\r\n PageViewManager.prototype.trackPageView = function (pageView, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n PageViewManager.prototype.teardown = function (unloadCtx, unloadState) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return PageViewManager;\r\n}());\r\nexport { PageViewManager };\r\n//# sourceMappingURL=PageViewManager.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dateTimeUtilsDuration, msToTimeSpan } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, getNavigator, getPerformance, safeGetLogger } from \"@microsoft/applicationinsights-core-js\";\r\nimport { mathFloor, strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { _DYN_CONNECT_END, _DYN_DURATION, _DYN_GET_ENTRIES_BY_TYPE, _DYN_GET_PERFORMANCE_TIMI16, _DYN_IS_PERFORMANCE_TIMIN15, _DYN_IS_PERFORMANCE_TIMIN18, _DYN_LENGTH, _DYN_LOAD_EVENT_END, _DYN_NAVIGATION_START, _DYN_POPULATE_PAGE_VIEW_P4, _DYN_REQUEST_START, _DYN_RESPONSE_END, _DYN_RESPONSE_START, _DYN_SHOULD_COLLECT_DURAT17, _DYN_START_TIME } from \"../../__DynamicConstants\";\r\nvar MAX_DURATION_ALLOWED = 3600000; // 1h\r\nvar botAgentNames = [\"googlebot\", \"adsbot-google\", \"apis-google\", \"mediapartners-google\"];\r\nfunction _isPerformanceTimingSupported() {\r\n var perf = getPerformance();\r\n return perf && !!perf.timing;\r\n}\r\nfunction _isPerformanceNavigationTimingSupported() {\r\n var perf = getPerformance();\r\n return perf && perf.getEntriesByType && perf.getEntriesByType(\"navigation\")[_DYN_LENGTH /* @min:%2elength */] > 0;\r\n}\r\nfunction _isPerformanceTimingDataReady() {\r\n var perf = getPerformance();\r\n var timing = perf ? perf.timing : 0;\r\n return timing\r\n && timing.domainLookupStart > 0\r\n && timing[_DYN_NAVIGATION_START /* @min:%2enavigationStart */] > 0\r\n && timing[_DYN_RESPONSE_START /* @min:%2eresponseStart */] > 0\r\n && timing[_DYN_REQUEST_START /* @min:%2erequestStart */] > 0\r\n && timing[_DYN_LOAD_EVENT_END /* @min:%2eloadEventEnd */] > 0\r\n && timing[_DYN_RESPONSE_END /* @min:%2eresponseEnd */] > 0\r\n && timing[_DYN_CONNECT_END /* @min:%2econnectEnd */] > 0\r\n && timing.domLoading > 0;\r\n}\r\nfunction _getPerformanceTiming() {\r\n if (_isPerformanceTimingSupported()) {\r\n return getPerformance().timing;\r\n }\r\n return null;\r\n}\r\nfunction _getPerformanceNavigationTiming() {\r\n if (_isPerformanceNavigationTimingSupported()) {\r\n return getPerformance()[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */](\"navigation\")[0];\r\n }\r\n return null;\r\n}\r\n/**\r\n* This method tells if given durations should be excluded from collection.\r\n*/\r\nfunction _shouldCollectDuration() {\r\n var durations = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n durations[_i] = arguments[_i];\r\n }\r\n var _navigator = getNavigator() || {};\r\n // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en\r\n var userAgent = _navigator.userAgent;\r\n var isGoogleBot = false;\r\n if (userAgent) {\r\n for (var i = 0; i < botAgentNames[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n isGoogleBot = isGoogleBot || strIndexOf(userAgent.toLowerCase(), botAgentNames[i]) !== -1;\r\n }\r\n }\r\n if (isGoogleBot) {\r\n // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API.\r\n return false;\r\n }\r\n else {\r\n // for other page views, don't report if it's outside of a reasonable range\r\n for (var i = 0; i < durations[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n if (durations[i] < 0 || durations[i] >= MAX_DURATION_ALLOWED) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n}\r\n/**\r\n * Class encapsulates sending page view performance telemetry.\r\n */\r\nvar PageViewPerformanceManager = /** @class */ (function () {\r\n function PageViewPerformanceManager(core) {\r\n var _logger = safeGetLogger(core);\r\n dynamicProto(PageViewPerformanceManager, this, function (_self) {\r\n _self[_DYN_POPULATE_PAGE_VIEW_P4 /* @min:%2epopulatePageViewPerformanceEvent */] = function (pageViewPerformance) {\r\n pageViewPerformance.isValid = false;\r\n /*\r\n * http://www.w3.org/TR/navigation-timing/#processing-model\r\n * |-navigationStart\r\n * | |-connectEnd\r\n * | ||-requestStart\r\n * | || |-responseStart\r\n * | || | |-responseEnd\r\n * | || | |\r\n * | || | | |-loadEventEnd\r\n * |---network---||---request---|---response---|---dom---|\r\n * |--------------------------total----------------------|\r\n *\r\n * total = The difference between the load event of the current document is completed and the first recorded timestamp of the performance entry : https://developer.mozilla.org/en-US/docs/Web/Performance/Navigation_and_resource_timings#duration\r\n * network = Redirect time + App Cache + DNS lookup time + TCP connection time\r\n * request = Request time : https://developer.mozilla.org/en-US/docs/Web/Performance/Navigation_and_resource_timings#request_time\r\n * response = Response time\r\n * dom = Document load time : https://html.spec.whatwg.org/multipage/dom.html#document-load-timing-info\r\n * = Document processing time : https://developers.google.com/web/fundamentals/performance/navigation-and-resource-timing/#document_processing\r\n * + Loading time : https://developers.google.com/web/fundamentals/performance/navigation-and-resource-timing/#loading\r\n */\r\n var navigationTiming = _getPerformanceNavigationTiming();\r\n var timing = _getPerformanceTiming();\r\n var total = 0;\r\n var network = 0;\r\n var request = 0;\r\n var response = 0;\r\n var dom = 0;\r\n if (navigationTiming || timing) {\r\n if (navigationTiming) {\r\n total = navigationTiming[_DYN_DURATION /* @min:%2eduration */];\r\n /**\r\n * support both cases:\r\n * - startTime is always zero: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming\r\n * - for older browsers where the startTime is not zero\r\n */\r\n network = navigationTiming[_DYN_START_TIME /* @min:%2estartTime */] === 0 ? navigationTiming[_DYN_CONNECT_END /* @min:%2econnectEnd */] : dateTimeUtilsDuration(navigationTiming[_DYN_START_TIME /* @min:%2estartTime */], navigationTiming[_DYN_CONNECT_END /* @min:%2econnectEnd */]);\r\n request = dateTimeUtilsDuration(navigationTiming.requestStart, navigationTiming[_DYN_RESPONSE_START /* @min:%2eresponseStart */]);\r\n response = dateTimeUtilsDuration(navigationTiming[_DYN_RESPONSE_START /* @min:%2eresponseStart */], navigationTiming[_DYN_RESPONSE_END /* @min:%2eresponseEnd */]);\r\n dom = dateTimeUtilsDuration(navigationTiming.responseEnd, navigationTiming[_DYN_LOAD_EVENT_END /* @min:%2eloadEventEnd */]);\r\n }\r\n else {\r\n total = dateTimeUtilsDuration(timing[_DYN_NAVIGATION_START /* @min:%2enavigationStart */], timing[_DYN_LOAD_EVENT_END /* @min:%2eloadEventEnd */]);\r\n network = dateTimeUtilsDuration(timing[_DYN_NAVIGATION_START /* @min:%2enavigationStart */], timing[_DYN_CONNECT_END /* @min:%2econnectEnd */]);\r\n request = dateTimeUtilsDuration(timing.requestStart, timing[_DYN_RESPONSE_START /* @min:%2eresponseStart */]);\r\n response = dateTimeUtilsDuration(timing[_DYN_RESPONSE_START /* @min:%2eresponseStart */], timing[_DYN_RESPONSE_END /* @min:%2eresponseEnd */]);\r\n dom = dateTimeUtilsDuration(timing.responseEnd, timing[_DYN_LOAD_EVENT_END /* @min:%2eloadEventEnd */]);\r\n }\r\n if (total === 0) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 10 /* _eInternalMessageId.ErrorPVCalc */, \"error calculating page view performance.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else if (!_self[_DYN_SHOULD_COLLECT_DURAT17 /* @min:%2eshouldCollectDuration */](total, network, request, response, dom)) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 45 /* _eInternalMessageId.InvalidDurationValue */, \"Invalid page load duration value. Browser perf data won't be sent.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else if (total < mathFloor(network) + mathFloor(request) + mathFloor(response) + mathFloor(dom)) {\r\n // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT\r\n // in this case, don't report client performance from this page\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 8 /* _eInternalMessageId.ClientPerformanceMathError */, \"client performance math error.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else {\r\n pageViewPerformance.durationMs = total;\r\n // // convert to timespans\r\n pageViewPerformance.perfTotal = pageViewPerformance[_DYN_DURATION /* @min:%2eduration */] = msToTimeSpan(total);\r\n pageViewPerformance.networkConnect = msToTimeSpan(network);\r\n pageViewPerformance.sentRequest = msToTimeSpan(request);\r\n pageViewPerformance.receivedResponse = msToTimeSpan(response);\r\n pageViewPerformance.domProcessing = msToTimeSpan(dom);\r\n pageViewPerformance.isValid = true;\r\n }\r\n }\r\n };\r\n _self[_DYN_GET_PERFORMANCE_TIMI16 /* @min:%2egetPerformanceTiming */] = _getPerformanceTiming;\r\n _self[_DYN_IS_PERFORMANCE_TIMIN15 /* @min:%2eisPerformanceTimingSupported */] = _isPerformanceTimingSupported;\r\n _self[_DYN_IS_PERFORMANCE_TIMIN18 /* @min:%2eisPerformanceTimingDataReady */] = _isPerformanceTimingDataReady;\r\n _self[_DYN_SHOULD_COLLECT_DURAT17 /* @min:%2eshouldCollectDuration */] = _shouldCollectDuration;\r\n });\r\n }\r\n PageViewPerformanceManager.prototype.populatePageViewPerformanceEvent = function (pageViewPerformance) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n PageViewPerformanceManager.prototype.getPerformanceTiming = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Returns true is window performance timing API is supported, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceTimingSupported = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return true;\r\n };\r\n /**\r\n * As page loads different parts of performance timing numbers get set. When all of them are set we can report it.\r\n * Returns true if ready, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceTimingDataReady = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return true;\r\n };\r\n /**\r\n * This method tells if given durations should be excluded from collection.\r\n */\r\n PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\r\n var durations = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n durations[_i] = arguments[_i];\r\n }\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return true;\r\n };\r\n return PageViewPerformanceManager;\r\n}());\r\nexport { PageViewPerformanceManager };\r\n//# sourceMappingURL=PageViewPerformanceManager.js.map","/**\r\n* ApplicationInsights.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nvar _a;\r\nimport { __assign, __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { AnalyticsPluginIdentifier, Event as EventTelemetry, Exception, Metric, PageView, PageViewPerformance, PropertiesPluginIdentifier, RemoteDependencyData, Trace, createDistributedTraceContextFromTrace, createDomEvent, createTelemetryItem, dataSanitizeString, isCrossOriginError, strNotSpecified, utlDisableStorage, utlEnableStorage, utlSetStoragePrefix } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, InstrumentEvent, arrForEach, cfgDfBoolean, cfgDfMerge, cfgDfSet, cfgDfString, cfgDfValidate, createProcessTelemetryContext, createUniqueNamespace, dumpObj, eventOff, eventOn, findAllScripts, generateW3CId, getDocument, getExceptionName, getHistory, getLocation, getWindow, hasHistory, hasWindow, isFunction, isNullOrUndefined, isString, isUndefined, mergeEvtNamespace, onConfigChange, safeGetCookieMgr, strUndefined, throwError } from \"@microsoft/applicationinsights-core-js\";\r\nimport { isArray, isError, objDeepFreeze, objDefine, scheduleTimeout, strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { _DYN_ADD_TELEMETRY_INITIA7, _DYN_AUTO_EXCEPTION_INSTR9, _DYN_AUTO_TRACK_PAGE_VISI10, _DYN_AUTO_UNHANDLED_PROMI14, _DYN_COLUMN_NUMBER, _DYN_CORE, _DYN_DATA_TYPE, _DYN_DIAG_LOG, _DYN_DURATION, _DYN_ENABLE_AUTO_ROUTE_TR12, _DYN_ENABLE_UNHANDLED_PRO13, _DYN_ENVELOPE_TYPE, _DYN_ERROR, _DYN_HREF, _DYN_IS_BROWSER_LINK_TRAC11, _DYN_IS_STORAGE_USE_DISAB0, _DYN_LENGTH, _DYN_LINE_NUMBER, _DYN_OVERRIDE_PAGE_VIEW_D8, _DYN_POPULATE_PAGE_VIEW_P4, _DYN_PROPERTIES, _DYN_SEND_EXCEPTION_INTER5, _DYN_SEND_PAGE_VIEW_INTER2, _DYN_SEND_PAGE_VIEW_PERFO3, _DYN_START_TIME, _DYN_TO_STRING, _DYN_TRACK, _DYN_TRACK_PAGE_VIEW, _DYN_TRACK_PREVIOUS_PAGE_1, _DYN__ADD_HOOK, _DYN__CREATE_AUTO_EXCEPTI6 } from \"../__DynamicConstants\";\r\nimport { PageViewManager } from \"./Telemetry/PageViewManager\";\r\nimport { PageViewPerformanceManager } from \"./Telemetry/PageViewPerformanceManager\";\r\nimport { PageVisitTimeManager } from \"./Telemetry/PageVisitTimeManager\";\r\nimport { Timing } from \"./Timing\";\r\nvar strEvent = \"event\";\r\nfunction _dispatchEvent(target, evnt) {\r\n if (target && target.dispatchEvent && evnt) {\r\n target.dispatchEvent(evnt);\r\n }\r\n}\r\nfunction _getReason(error) {\r\n if (error && error.reason) {\r\n var reason = error.reason;\r\n if (!isString(reason) && isFunction(reason[_DYN_TO_STRING /* @min:%2etoString */])) {\r\n return reason[_DYN_TO_STRING /* @min:%2etoString */]();\r\n }\r\n return dumpObj(reason);\r\n }\r\n // Pass the original object down which will eventually get evaluated for any message or description\r\n return error || \"\";\r\n}\r\nvar MinMilliSeconds = 60000;\r\nvar defaultValues = objDeepFreeze((_a = {\r\n sessionRenewalMs: cfgDfSet(_chkConfigMilliseconds, 30 * 60 * 1000),\r\n sessionExpirationMs: cfgDfSet(_chkConfigMilliseconds, 24 * 60 * 60 * 1000),\r\n disableExceptionTracking: cfgDfBoolean()\r\n },\r\n _a[_DYN_AUTO_TRACK_PAGE_VISI10 /* @min:autoTrackPageVisitTime */] = cfgDfBoolean(),\r\n _a[_DYN_OVERRIDE_PAGE_VIEW_D8 /* @min:overridePageViewDuration */] = cfgDfBoolean(),\r\n _a[_DYN_ENABLE_UNHANDLED_PRO13 /* @min:enableUnhandledPromiseRejectionTracking */] = cfgDfBoolean(),\r\n _a[_DYN_AUTO_UNHANDLED_PROMI14 /* @min:autoUnhandledPromiseInstrumented */] = false,\r\n _a.samplingPercentage = cfgDfValidate(_chkSampling, 100),\r\n _a[_DYN_IS_STORAGE_USE_DISAB0 /* @min:isStorageUseDisabled */] = cfgDfBoolean(),\r\n _a[_DYN_IS_BROWSER_LINK_TRAC11 /* @min:isBrowserLinkTrackingEnabled */] = cfgDfBoolean(),\r\n _a[_DYN_ENABLE_AUTO_ROUTE_TR12 /* @min:enableAutoRouteTracking */] = cfgDfBoolean(),\r\n _a.namePrefix = cfgDfString(),\r\n _a.enableDebug = cfgDfBoolean(),\r\n _a.disableFlushOnBeforeUnload = cfgDfBoolean(),\r\n _a.disableFlushOnUnload = cfgDfBoolean(false, \"disableFlushOnBeforeUnload\"),\r\n _a.expCfg = cfgDfMerge({ inclScripts: false, expLog: undefined, maxLogs: 50 }),\r\n _a));\r\nfunction _chkConfigMilliseconds(value, defValue) {\r\n value = value || defValue;\r\n if (value < MinMilliSeconds) {\r\n value = MinMilliSeconds;\r\n }\r\n return +value;\r\n}\r\nfunction _chkSampling(value) {\r\n return !isNaN(value) && value > 0 && value <= 100;\r\n}\r\nfunction _updateStorageUsage(extConfig) {\r\n // Not resetting the storage usage as someone may have manually called utlDisableStorage, so this will only\r\n // reset based if the configuration option is provided\r\n if (!isUndefined(extConfig[_DYN_IS_STORAGE_USE_DISAB0 /* @min:%2eisStorageUseDisabled */])) {\r\n if (extConfig[_DYN_IS_STORAGE_USE_DISAB0 /* @min:%2eisStorageUseDisabled */]) {\r\n utlDisableStorage();\r\n }\r\n else {\r\n utlEnableStorage();\r\n }\r\n }\r\n}\r\nvar AnalyticsPlugin = /** @class */ (function (_super) {\r\n __extends(AnalyticsPlugin, _super);\r\n function AnalyticsPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = AnalyticsPluginIdentifier; // do not change name or priority\r\n _this.priority = 180; // take from reserved priority range 100- 200\r\n _this.autoRoutePVDelay = 500; // ms; Time to wait after a route change before triggering a pageview to allow DOM changes to take place\r\n var _eventTracking;\r\n var _pageTracking;\r\n var _pageViewManager;\r\n var _pageViewPerformanceManager;\r\n var _pageVisitTimeManager;\r\n var _preInitTelemetryInitializers;\r\n var _isBrowserLinkTrackingEnabled;\r\n var _browserLinkInitializerAdded;\r\n var _enableAutoRouteTracking;\r\n var _historyListenerAdded;\r\n var _disableExceptionTracking;\r\n var _autoExceptionInstrumented;\r\n var _enableUnhandledPromiseRejectionTracking;\r\n var _autoUnhandledPromiseInstrumented;\r\n var _extConfig;\r\n var _autoTrackPageVisitTime;\r\n var _expCfg;\r\n // Counts number of trackAjax invocations.\r\n // By default we only monitor X ajax call per view to avoid too much load.\r\n // Default value is set in config.\r\n // This counter keeps increasing even after the limit is reached.\r\n var _trackAjaxAttempts = 0;\r\n // array with max length of 2 that store current url and previous url for SPA page route change trackPageview use.\r\n var _prevUri; // Assigned in the constructor\r\n var _currUri;\r\n var _evtNamespace;\r\n // For testing error hooks only\r\n var _errorHookCnt;\r\n dynamicProto(AnalyticsPlugin, _this, function (_self, _base) {\r\n var _addHook = _base[_DYN__ADD_HOOK /* @min:%2e_addHook */];\r\n _initDefaults();\r\n _self.getCookieMgr = function () {\r\n return safeGetCookieMgr(_self[_DYN_CORE /* @min:%2ecore */]);\r\n };\r\n _self.processTelemetry = function (env, itemCtx) {\r\n _self.processNext(env, itemCtx);\r\n };\r\n _self.trackEvent = function (event, customProperties) {\r\n try {\r\n var telemetryItem = createTelemetryItem(event, EventTelemetry[_DYN_DATA_TYPE /* @min:%2edataType */], EventTelemetry[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), customProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n }\r\n catch (e) {\r\n _throwInternal(2 /* eLoggingSeverity.WARNING */, 39 /* _eInternalMessageId.TrackTraceFailed */, \"trackTrace failed, trace will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Start timing an extended event. Call `stopTrackEvent` to log the event when it ends.\r\n * @param name - A string that identifies this event uniquely within the document.\r\n */\r\n _self.startTrackEvent = function (name) {\r\n try {\r\n _eventTracking.start(name);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 29 /* _eInternalMessageId.StartTrackEventFailed */, \"startTrackEvent failed, event will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Log an extended event that you started timing with `startTrackEvent`.\r\n * @param name - The string you used to identify this event in `startTrackEvent`.\r\n * @param properties - map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.\r\n * @param measurements - map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n _self.stopTrackEvent = function (name, properties, measurements) {\r\n try {\r\n _eventTracking.stop(name, undefined, properties, measurements);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 30 /* _eInternalMessageId.StopTrackEventFailed */, \"stopTrackEvent failed, event will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * @description Log a diagnostic message\r\n * @param trace - the trace message\r\n * @param customProperties - Additional custom properties to include in the event\r\n */\r\n _self.trackTrace = function (trace, customProperties) {\r\n try {\r\n var telemetryItem = createTelemetryItem(trace, Trace[_DYN_DATA_TYPE /* @min:%2edataType */], Trace[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), customProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n }\r\n catch (e) {\r\n _throwInternal(2 /* eLoggingSeverity.WARNING */, 39 /* _eInternalMessageId.TrackTraceFailed */, \"trackTrace failed, trace will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * @description Log a numeric value that is not associated with a specific event. Typically\r\n * used to send regular reports of performance indicators. To send single measurement, just\r\n * use the name and average fields of {@link IMetricTelemetry}. If you take measurements\r\n * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements\r\n * and sending the resulting average at intervals\r\n * @param metric - input object argument. Only name and average are mandatory.\r\n * @param } customProperties additional data used to filter metrics in the\r\n * portal. Defaults to empty.\r\n */\r\n _self.trackMetric = function (metric, customProperties) {\r\n try {\r\n var telemetryItem = createTelemetryItem(metric, Metric[_DYN_DATA_TYPE /* @min:%2edataType */], Metric[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), customProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 36 /* _eInternalMessageId.TrackMetricFailed */, \"trackMetric failed, metric will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Logs that a page or other item was viewed.\r\n * @param IPageViewTelemetry - The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param customProperties - Additional data used to filter events and metrics. Defaults to empty.\r\n * If a user wants to provide duration for pageLoad, it'll have to be in pageView.properties.duration\r\n */\r\n _self[_DYN_TRACK_PAGE_VIEW /* @min:%2etrackPageView */] = function (pageView, customProperties) {\r\n try {\r\n var inPv = pageView || {};\r\n _pageViewManager[_DYN_TRACK_PAGE_VIEW /* @min:%2etrackPageView */](inPv, __assign(__assign(__assign({}, inPv.properties), inPv.measurements), customProperties));\r\n if (_autoTrackPageVisitTime) {\r\n _pageVisitTimeManager[_DYN_TRACK_PREVIOUS_PAGE_1 /* @min:%2etrackPreviousPageVisit */](inPv.name, inPv.uri);\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 37 /* _eInternalMessageId.TrackPVFailed */, \"trackPageView failed, page view will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Create a page view telemetry item and send it to the SDK pipeline through the core.track API\r\n * @param pageView - Page view item to be sent\r\n * @param properties - Custom properties (Part C) that a user can add to the telemetry item\r\n * @param systemProperties - System level properties (Part A) that a user can add to the telemetry item\r\n */\r\n _self[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */] = function (pageView, properties, systemProperties) {\r\n var doc = getDocument();\r\n if (doc) {\r\n pageView.refUri = pageView.refUri === undefined ? doc.referrer : pageView.refUri;\r\n }\r\n if (isNullOrUndefined(pageView[_DYN_START_TIME /* @min:%2estartTime */])) {\r\n // calculate the start time manually\r\n var duration = ((properties || pageView[_DYN_PROPERTIES /* @min:%2eproperties */] || {})[_DYN_DURATION /* @min:%2eduration */] || 0);\r\n pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(new Date().getTime() - duration);\r\n }\r\n var telemetryItem = createTelemetryItem(pageView, PageView[_DYN_DATA_TYPE /* @min:%2edataType */], PageView[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), properties, systemProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n // reset ajaxes counter\r\n _trackAjaxAttempts = 0;\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param pageViewPerformance\r\n * @param properties\r\n */\r\n _self[_DYN_SEND_PAGE_VIEW_PERFO3 /* @min:%2esendPageViewPerformanceInternal */] = function (pageViewPerformance, properties, systemProperties) {\r\n var telemetryItem = createTelemetryItem(pageViewPerformance, PageViewPerformance[_DYN_DATA_TYPE /* @min:%2edataType */], PageViewPerformance[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), properties, systemProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n };\r\n /**\r\n * Send browser performance metrics.\r\n * @param pageViewPerformance\r\n * @param customProperties\r\n */\r\n _self.trackPageViewPerformance = function (pageViewPerformance, customProperties) {\r\n var inPvp = pageViewPerformance || {};\r\n try {\r\n _pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 /* @min:%2epopulatePageViewPerformanceEvent */](inPvp);\r\n _self[_DYN_SEND_PAGE_VIEW_PERFO3 /* @min:%2esendPageViewPerformanceInternal */](inPvp, customProperties);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 37 /* _eInternalMessageId.TrackPVFailed */, \"trackPageViewPerformance failed, page view will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops,\r\n * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view\r\n * and send the event.\r\n * @param name - A string that idenfities this item, unique within this HTML document. Defaults to the document title.\r\n */\r\n _self.startTrackPage = function (name) {\r\n try {\r\n if (typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = doc && doc.title || \"\";\r\n }\r\n _pageTracking.start(name);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 31 /* _eInternalMessageId.StartTrackFailed */, \"startTrackPage failed, page view may not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements.\r\n * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`.\r\n * @param name - The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param url - String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.\r\n * @param properties - map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n * @param measurements - map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n _self.stopTrackPage = function (name, url, properties, measurement) {\r\n try {\r\n if (typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = doc && doc.title || \"\";\r\n }\r\n if (typeof url !== \"string\") {\r\n var loc = getLocation();\r\n url = loc && loc[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n }\r\n _pageTracking.stop(name, url, properties, measurement);\r\n if (_autoTrackPageVisitTime) {\r\n _pageVisitTimeManager[_DYN_TRACK_PREVIOUS_PAGE_1 /* @min:%2etrackPreviousPageVisit */](name, url);\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 32 /* _eInternalMessageId.StopTrackFailed */, \"stopTrackPage failed, page view will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param exception\r\n * @param properties\r\n * @param systemProperties\r\n */\r\n _self[_DYN_SEND_EXCEPTION_INTER5 /* @min:%2esendExceptionInternal */] = function (exception, customProperties, systemProperties) {\r\n // Adding additional edge cases to handle\r\n // - Not passing anything (null / undefined)\r\n var theError = (exception && (exception.exception || exception[_DYN_ERROR /* @min:%2eerror */])) ||\r\n // - Handle someone calling trackException based of v1 API where the exception was the Error\r\n isError(exception) && exception ||\r\n // - Handles no error being defined and instead of creating a new Error() instance attempt to map so any stacktrace\r\n // is preserved and does not list ApplicationInsights code as the source\r\n { name: (exception && typeof exception), message: exception || strNotSpecified };\r\n // If no exception object was passed assign to an empty object to avoid internal exceptions\r\n exception = exception || {};\r\n var exceptionPartB = new Exception(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), theError, exception[_DYN_PROPERTIES /* @min:%2eproperties */] || customProperties, exception.measurements, exception.severityLevel, exception.id).toInterface();\r\n var doc = getDocument();\r\n if (doc && (_expCfg === null || _expCfg === void 0 ? void 0 : _expCfg.inclScripts)) {\r\n var scriptsInfo = findAllScripts(doc);\r\n exceptionPartB[_DYN_PROPERTIES /* @min:%2eproperties */][\"exceptionScripts\"] = JSON.stringify(scriptsInfo);\r\n }\r\n if (_expCfg === null || _expCfg === void 0 ? void 0 : _expCfg.expLog) {\r\n var logs = _expCfg.expLog();\r\n if (logs && logs.logs && isArray(logs.logs)) {\r\n exceptionPartB[_DYN_PROPERTIES /* @min:%2eproperties */][\"exceptionLog\"] = logs.logs.slice(0, _expCfg.maxLogs).join(\"\\n\");\r\n }\r\n }\r\n var telemetryItem = createTelemetryItem(exceptionPartB, Exception[_DYN_DATA_TYPE /* @min:%2edataType */], Exception[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), customProperties, systemProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n };\r\n /**\r\n * Log an exception you have caught.\r\n *\r\n * @param exception - Object which contains exception to be sent\r\n * @param } customProperties Additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n *\r\n * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric.\r\n */\r\n _self.trackException = function (exception, customProperties) {\r\n if (exception && !exception.exception && exception[_DYN_ERROR /* @min:%2eerror */]) {\r\n exception.exception = exception[_DYN_ERROR /* @min:%2eerror */];\r\n }\r\n try {\r\n _self[_DYN_SEND_EXCEPTION_INTER5 /* @min:%2esendExceptionInternal */](exception, customProperties);\r\n }\r\n catch (e) {\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 35 /* _eInternalMessageId.TrackExceptionFailed */, \"trackException failed, exception will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n /**\r\n * @description Custom error handler for Application Insights Analytics\r\n * @param exception\r\n */\r\n _self._onerror = function (exception) {\r\n var error = exception && exception[_DYN_ERROR /* @min:%2eerror */];\r\n var evt = exception && exception.evt;\r\n try {\r\n if (!evt) {\r\n var _window = getWindow();\r\n if (_window) {\r\n evt = _window[strEvent];\r\n }\r\n }\r\n var url = (exception && exception.url) || (getDocument() || {}).URL;\r\n // If no error source is provided assume the default window.onerror handler\r\n var errorSrc = exception.errorSrc || \"window.onerror@\" + url + \":\" + (exception[_DYN_LINE_NUMBER /* @min:%2elineNumber */] || 0) + \":\" + (exception[_DYN_COLUMN_NUMBER /* @min:%2ecolumnNumber */] || 0);\r\n var properties = {\r\n errorSrc: errorSrc,\r\n url: url,\r\n lineNumber: exception[_DYN_LINE_NUMBER /* @min:%2elineNumber */] || 0,\r\n columnNumber: exception[_DYN_COLUMN_NUMBER /* @min:%2ecolumnNumber */] || 0,\r\n message: exception.message\r\n };\r\n if (isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception[_DYN_ERROR /* @min:%2eerror */])) {\r\n _sendCORSException(Exception[_DYN__CREATE_AUTO_EXCEPTI6 /* @min:%2eCreateAutoException */](\"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.\", url, exception[_DYN_LINE_NUMBER /* @min:%2elineNumber */] || 0, exception[_DYN_COLUMN_NUMBER /* @min:%2ecolumnNumber */] || 0, error, evt, null, errorSrc), properties);\r\n }\r\n else {\r\n if (!exception.errorSrc) {\r\n exception.errorSrc = errorSrc;\r\n }\r\n _self.trackException({ exception: exception, severityLevel: 3 /* eSeverityLevel.Error */ }, properties);\r\n }\r\n }\r\n catch (e) {\r\n var errorString = error ? (error.name + \", \" + error.message) : \"null\";\r\n _throwInternal(1 /* eLoggingSeverity.CRITICAL */, 11 /* _eInternalMessageId.ExceptionWhileLoggingError */, \"_onError threw exception while logging error, error will not be collected: \"\r\n + getExceptionName(e), { exception: dumpObj(e), errorString: errorString });\r\n }\r\n };\r\n _self[_DYN_ADD_TELEMETRY_INITIA7 /* @min:%2eaddTelemetryInitializer */] = function (telemetryInitializer) {\r\n if (_self[_DYN_CORE /* @min:%2ecore */]) {\r\n // Just add to the core\r\n return _self[_DYN_CORE /* @min:%2ecore */][_DYN_ADD_TELEMETRY_INITIA7 /* @min:%2eaddTelemetryInitializer */](telemetryInitializer);\r\n }\r\n // Handle \"pre-initialization\" telemetry initializers (for backward compatibility)\r\n if (!_preInitTelemetryInitializers) {\r\n _preInitTelemetryInitializers = [];\r\n }\r\n _preInitTelemetryInitializers.push(telemetryInitializer);\r\n };\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n if (_self.isInitialized()) {\r\n return;\r\n }\r\n if (isNullOrUndefined(core)) {\r\n throwError(\"Error initializing\");\r\n }\r\n _base.initialize(config, core, extensions, pluginChain);\r\n try {\r\n _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace());\r\n if (_preInitTelemetryInitializers) {\r\n arrForEach(_preInitTelemetryInitializers, function (initializer) {\r\n core[_DYN_ADD_TELEMETRY_INITIA7 /* @min:%2eaddTelemetryInitializer */](initializer);\r\n });\r\n _preInitTelemetryInitializers = null;\r\n }\r\n _populateDefaults(config);\r\n _pageViewPerformanceManager = new PageViewPerformanceManager(_self[_DYN_CORE /* @min:%2ecore */]);\r\n _pageViewManager = new PageViewManager(_self, _extConfig.overridePageViewDuration, _self[_DYN_CORE /* @min:%2ecore */], _pageViewPerformanceManager);\r\n _pageVisitTimeManager = new PageVisitTimeManager(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), function (pageName, pageUrl, pageVisitTime) { return trackPageVisitTime(pageName, pageUrl, pageVisitTime); });\r\n _eventTracking = new Timing(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), \"trackEvent\");\r\n _eventTracking.action =\r\n function (name, url, duration, properties, measurements) {\r\n if (!properties) {\r\n properties = {};\r\n }\r\n if (!measurements) {\r\n measurements = {};\r\n }\r\n properties.duration = duration[_DYN_TO_STRING /* @min:%2etoString */]();\r\n _self.trackEvent({ name: name, properties: properties, measurements: measurements });\r\n };\r\n // initialize page view timing\r\n _pageTracking = new Timing(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), \"trackPageView\");\r\n _pageTracking.action = function (name, url, duration, properties, measurements) {\r\n // duration must be a custom property in order for the collector to extract it\r\n if (isNullOrUndefined(properties)) {\r\n properties = {};\r\n }\r\n properties.duration = duration[_DYN_TO_STRING /* @min:%2etoString */]();\r\n var pageViewItem = {\r\n name: name,\r\n uri: url,\r\n properties: properties,\r\n measurements: measurements\r\n };\r\n _self[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageViewItem, properties);\r\n };\r\n if (hasWindow()) {\r\n _updateExceptionTracking();\r\n _updateLocationChange();\r\n }\r\n }\r\n catch (e) {\r\n // resetting the initialized state because of failure\r\n _self.setInitialized(false);\r\n throw e;\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n _pageViewManager && _pageViewManager.teardown(unloadCtx, unloadState);\r\n // Just register to remove all events associated with this namespace\r\n eventOff(window, null, null, _evtNamespace);\r\n _initDefaults();\r\n };\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_errorHookCnt, _autoExceptionInstrumented];\r\n };\r\n function _populateDefaults(config) {\r\n // it is used for 1DS as well, so config type should be IConfiguration only\r\n var identifier = _self.identifier;\r\n var core = _self[_DYN_CORE /* @min:%2ecore */];\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(config, function () {\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n _extConfig = ctx.getExtCfg(identifier, defaultValues);\r\n // make sure auto exception is instrumented only once and it won't be overriden by the following config changes\r\n _autoExceptionInstrumented = _autoExceptionInstrumented || config[_DYN_AUTO_EXCEPTION_INSTR9 /* @min:%2eautoExceptionInstrumented */] || _extConfig[_DYN_AUTO_EXCEPTION_INSTR9 /* @min:%2eautoExceptionInstrumented */];\r\n _expCfg = _extConfig.expCfg;\r\n _autoTrackPageVisitTime = _extConfig[_DYN_AUTO_TRACK_PAGE_VISI10 /* @min:%2eautoTrackPageVisitTime */];\r\n if (config.storagePrefix) {\r\n utlSetStoragePrefix(config.storagePrefix);\r\n }\r\n _updateStorageUsage(_extConfig);\r\n // _updateBrowserLinkTracking\r\n _isBrowserLinkTrackingEnabled = _extConfig[_DYN_IS_BROWSER_LINK_TRAC11 /* @min:%2eisBrowserLinkTrackingEnabled */];\r\n _addDefaultTelemetryInitializers();\r\n }));\r\n }\r\n /**\r\n * Log a page visit time\r\n * @param pageName - Name of page\r\n * @param pageVisitDuration - Duration of visit to the page in milliseconds\r\n */\r\n function trackPageVisitTime(pageName, pageUrl, pageVisitTime) {\r\n var properties = { PageName: pageName, PageUrl: pageUrl };\r\n _self.trackMetric({\r\n name: \"PageVisitTime\",\r\n average: pageVisitTime,\r\n max: pageVisitTime,\r\n min: pageVisitTime,\r\n sampleCount: 1\r\n }, properties);\r\n }\r\n function _addDefaultTelemetryInitializers() {\r\n if (!_browserLinkInitializerAdded && _isBrowserLinkTrackingEnabled) {\r\n var browserLinkPaths_1 = [\"/browserLinkSignalR/\", \"/__browserLink/\"];\r\n var dropBrowserLinkRequests = function (envelope) {\r\n if (_isBrowserLinkTrackingEnabled && envelope.baseType === RemoteDependencyData[_DYN_DATA_TYPE /* @min:%2edataType */]) {\r\n var remoteData = envelope.baseData;\r\n if (remoteData) {\r\n for (var i = 0; i < browserLinkPaths_1[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n if (remoteData.target && strIndexOf(remoteData.target, browserLinkPaths_1[i]) >= 0) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](_self[_DYN_ADD_TELEMETRY_INITIA7 /* @min:%2eaddTelemetryInitializer */](dropBrowserLinkRequests));\r\n _browserLinkInitializerAdded = true;\r\n }\r\n }\r\n function _sendCORSException(exception, properties) {\r\n var telemetryItem = createTelemetryItem(exception, Exception[_DYN_DATA_TYPE /* @min:%2edataType */], Exception[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], _self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), properties);\r\n _self[_DYN_CORE /* @min:%2ecore */][_DYN_TRACK /* @min:%2etrack */](telemetryItem);\r\n }\r\n function _updateExceptionTracking() {\r\n var _window = getWindow();\r\n var locn = getLocation(true);\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(_extConfig, function () {\r\n _disableExceptionTracking = _extConfig.disableExceptionTracking;\r\n if (!_disableExceptionTracking && !_autoExceptionInstrumented && !_extConfig[_DYN_AUTO_EXCEPTION_INSTR9 /* @min:%2eautoExceptionInstrumented */]) {\r\n // We want to enable exception auto collection and it has not been done so yet\r\n _addHook(InstrumentEvent(_window, \"onerror\", {\r\n ns: _evtNamespace,\r\n rsp: function (callDetails, message, url, lineNumber, columnNumber, error) {\r\n if (!_disableExceptionTracking && callDetails.rslt !== true) {\r\n _self._onerror(Exception[_DYN__CREATE_AUTO_EXCEPTI6 /* @min:%2eCreateAutoException */](message, url, lineNumber, columnNumber, error, callDetails.evt));\r\n }\r\n }\r\n }, false));\r\n _errorHookCnt++;\r\n _autoExceptionInstrumented = true;\r\n }\r\n }));\r\n _addUnhandledPromiseRejectionTracking(_window, locn);\r\n }\r\n function _updateLocationChange() {\r\n var win = getWindow();\r\n var locn = getLocation(true);\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(_extConfig, function () {\r\n _enableAutoRouteTracking = _extConfig[_DYN_ENABLE_AUTO_ROUTE_TR12 /* @min:%2eenableAutoRouteTracking */] === true;\r\n /**\r\n * Create a custom \"locationchange\" event which is triggered each time the history object is changed\r\n */\r\n if (win && _enableAutoRouteTracking && !_historyListenerAdded && hasHistory()) {\r\n var _history = getHistory();\r\n if (isFunction(_history.pushState) && isFunction(_history.replaceState) && typeof Event !== strUndefined) {\r\n _addHistoryListener(win, _history, locn);\r\n }\r\n }\r\n }));\r\n }\r\n function _getDistributedTraceCtx() {\r\n var distributedTraceCtx = null;\r\n if (_self[_DYN_CORE /* @min:%2ecore */] && _self[_DYN_CORE /* @min:%2ecore */].getTraceCtx) {\r\n distributedTraceCtx = _self[_DYN_CORE /* @min:%2ecore */].getTraceCtx(false);\r\n }\r\n if (!distributedTraceCtx) {\r\n // Fallback when using an older Core and PropertiesPlugin\r\n var properties = _self[_DYN_CORE /* @min:%2ecore */].getPlugin(PropertiesPluginIdentifier);\r\n if (properties) {\r\n var context = properties.plugin.context;\r\n if (context) {\r\n distributedTraceCtx = createDistributedTraceContextFromTrace(context.telemetryTrace);\r\n }\r\n }\r\n }\r\n return distributedTraceCtx;\r\n }\r\n /**\r\n * Create a custom \"locationchange\" event which is triggered each time the history object is changed\r\n */\r\n function _addHistoryListener(win, history, locn) {\r\n if (_historyListenerAdded) {\r\n return;\r\n }\r\n // Name Prefix is only referenced during the initial initialization and cannot be changed afterwards\r\n var namePrefix = _extConfig.namePrefix || \"\";\r\n function _popstateHandler() {\r\n if (_enableAutoRouteTracking) {\r\n _dispatchEvent(win, createDomEvent(namePrefix + \"locationchange\"));\r\n }\r\n }\r\n function _locationChangeHandler() {\r\n // We always track the changes (if the handler is installed) to handle the feature being disabled between location changes\r\n if (_currUri) {\r\n _prevUri = _currUri;\r\n _currUri = locn && locn[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n }\r\n else {\r\n _currUri = locn && locn[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n }\r\n if (_enableAutoRouteTracking) {\r\n var distributedTraceCtx = _getDistributedTraceCtx();\r\n if (distributedTraceCtx) {\r\n distributedTraceCtx.setTraceId(generateW3CId());\r\n var traceLocationName = \"_unknown_\";\r\n if (locn && locn.pathname) {\r\n traceLocationName = locn.pathname + (locn.hash || \"\");\r\n }\r\n // This populates the ai.operation.name which has a maximum size of 1024 so we need to sanitize it\r\n distributedTraceCtx.setName(dataSanitizeString(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), traceLocationName));\r\n }\r\n scheduleTimeout((function (uri) {\r\n // todo: override start time so that it is not affected by autoRoutePVDelay\r\n _self[_DYN_TRACK_PAGE_VIEW /* @min:%2etrackPageView */]({ refUri: uri, properties: { duration: 0 } }); // SPA route change loading durations are undefined, so send 0\r\n }).bind(_self, _prevUri), _self.autoRoutePVDelay);\r\n }\r\n }\r\n _addHook(InstrumentEvent(history, \"pushState\", {\r\n ns: _evtNamespace,\r\n rsp: function () {\r\n if (_enableAutoRouteTracking) {\r\n _dispatchEvent(win, createDomEvent(namePrefix + \"pushState\"));\r\n _dispatchEvent(win, createDomEvent(namePrefix + \"locationchange\"));\r\n }\r\n }\r\n }, true));\r\n _addHook(InstrumentEvent(history, \"replaceState\", {\r\n ns: _evtNamespace,\r\n rsp: function () {\r\n if (_enableAutoRouteTracking) {\r\n _dispatchEvent(win, createDomEvent(namePrefix + \"replaceState\"));\r\n _dispatchEvent(win, createDomEvent(namePrefix + \"locationchange\"));\r\n }\r\n }\r\n }, true));\r\n eventOn(win, namePrefix + \"popstate\", _popstateHandler, _evtNamespace);\r\n eventOn(win, namePrefix + \"locationchange\", _locationChangeHandler, _evtNamespace);\r\n _historyListenerAdded = true;\r\n }\r\n function _addUnhandledPromiseRejectionTracking(_window, _location) {\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(_extConfig, function () {\r\n _enableUnhandledPromiseRejectionTracking = _extConfig[_DYN_ENABLE_UNHANDLED_PRO13 /* @min:%2eenableUnhandledPromiseRejectionTracking */] === true;\r\n _autoExceptionInstrumented = _autoExceptionInstrumented || _extConfig[_DYN_AUTO_UNHANDLED_PROMI14 /* @min:%2eautoUnhandledPromiseInstrumented */];\r\n if (_enableUnhandledPromiseRejectionTracking && !_autoUnhandledPromiseInstrumented) {\r\n // We want to enable exception auto collection and it has not been done so yet\r\n _addHook(InstrumentEvent(_window, \"onunhandledrejection\", {\r\n ns: _evtNamespace,\r\n rsp: function (callDetails, error) {\r\n if (_enableUnhandledPromiseRejectionTracking && callDetails.rslt !== true) { // handled could be typeof function\r\n _self._onerror(Exception[_DYN__CREATE_AUTO_EXCEPTI6 /* @min:%2eCreateAutoException */](_getReason(error), _location ? _location[_DYN_HREF /* @min:%2ehref */] : \"\", 0, 0, error, callDetails.evt));\r\n }\r\n }\r\n }, false));\r\n _errorHookCnt++;\r\n _extConfig[_DYN_AUTO_UNHANDLED_PROMI14 /* @min:%2eautoUnhandledPromiseInstrumented */] = _autoUnhandledPromiseInstrumented = true;\r\n }\r\n }));\r\n }\r\n /**\r\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\r\n * @param severity - The severity of the log message\r\n * @param msgId - The log message.\r\n */\r\n function _throwInternal(severity, msgId, msg, properties, isUserAct) {\r\n _self[_DYN_DIAG_LOG /* @min:%2ediagLog */]().throwInternal(severity, msgId, msg, properties, isUserAct);\r\n }\r\n function _initDefaults() {\r\n _eventTracking = null;\r\n _pageTracking = null;\r\n _pageViewManager = null;\r\n _pageViewPerformanceManager = null;\r\n _pageVisitTimeManager = null;\r\n _preInitTelemetryInitializers = null;\r\n _isBrowserLinkTrackingEnabled = false;\r\n _browserLinkInitializerAdded = false;\r\n _enableAutoRouteTracking = false;\r\n _historyListenerAdded = false;\r\n _disableExceptionTracking = false;\r\n _autoExceptionInstrumented = false;\r\n _enableUnhandledPromiseRejectionTracking = false;\r\n _autoUnhandledPromiseInstrumented = false;\r\n _autoTrackPageVisitTime = false;\r\n // Counts number of trackAjax invocations.\r\n // By default we only monitor X ajax call per view to avoid too much load.\r\n // Default value is set in config.\r\n // This counter keeps increasing even after the limit is reached.\r\n _trackAjaxAttempts = 0;\r\n // array with max length of 2 that store current url and previous url for SPA page route change trackPageview use.\r\n var location = getLocation(true);\r\n _prevUri = location && location[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n _currUri = null;\r\n _evtNamespace = null;\r\n _extConfig = null;\r\n _errorHookCnt = 0;\r\n // Define _self.config\r\n objDefine(_self, \"config\", {\r\n g: function () { return _extConfig; }\r\n });\r\n }\r\n // For backward compatibility\r\n objDefine(_self, \"_pageViewManager\", { g: function () { return _pageViewManager; } });\r\n objDefine(_self, \"_pageViewPerformanceManager\", { g: function () { return _pageViewPerformanceManager; } });\r\n objDefine(_self, \"_pageVisitTimeManager\", { g: function () { return _pageVisitTimeManager; } });\r\n objDefine(_self, \"_evtNamespace\", { g: function () { return \".\" + _evtNamespace; } });\r\n });\r\n return _this;\r\n }\r\n /**\r\n * Get the current cookie manager for this instance\r\n */\r\n AnalyticsPlugin.prototype.getCookieMgr = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n AnalyticsPlugin.prototype.processTelemetry = function (env, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AnalyticsPlugin.prototype.trackEvent = function (event, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Start timing an extended event. Call `stopTrackEvent` to log the event when it ends.\r\n * @param name - A string that identifies this event uniquely within the document.\r\n */\r\n AnalyticsPlugin.prototype.startTrackEvent = function (name) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Log an extended event that you started timing with `startTrackEvent`.\r\n * @param name - The string you used to identify this event in `startTrackEvent`.\r\n * @param properties - map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.\r\n * @param measurements - map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n AnalyticsPlugin.prototype.stopTrackEvent = function (name, properties, measurements) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * @description Log a diagnostic message\r\n * @param trace - the trace message\r\n * @param customProperties - Additional custom properties to include in the event\r\n */\r\n AnalyticsPlugin.prototype.trackTrace = function (trace, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * @description Log a numeric value that is not associated with a specific event. Typically\r\n * used to send regular reports of performance indicators. To send single measurement, just\r\n * use the name and average fields of {@link IMetricTelemetry}. If you take measurements\r\n * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements\r\n * and sending the resulting average at intervals\r\n * @param metric - input object argument. Only name and average are mandatory.\r\n * @param customProperties - additional data used to filter metrics in the\r\n * portal. Defaults to empty.\r\n */\r\n AnalyticsPlugin.prototype.trackMetric = function (metric, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Logs that a page or other item was viewed.\r\n * @param IPageViewTelemetry - The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param customProperties - Additional data used to filter events and metrics. Defaults to empty.\r\n * If a user wants to provide duration for pageLoad, it'll have to be in pageView.properties.duration\r\n */\r\n AnalyticsPlugin.prototype.trackPageView = function (pageView, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Create a page view telemetry item and send it to the SDK pipeline through the core.track API\r\n * @param pageView - Page view item to be sent\r\n * @param properties - Custom properties (Part C) that a user can add to the telemetry item\r\n * @param systemProperties - System level properties (Part A) that a user can add to the telemetry item\r\n */\r\n AnalyticsPlugin.prototype.sendPageViewInternal = function (pageView, properties, systemProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param pageViewPerformance - The page view performance item to be sent\r\n * @param properties - Custom properties (Part C) that a user can add to the telemetry item\r\n */\r\n AnalyticsPlugin.prototype.sendPageViewPerformanceInternal = function (pageViewPerformance, properties, systemProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Send browser performance metrics.\r\n * @param pageViewPerformance - The page view performance item to be sent\r\n * @param customProperties - Additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n */\r\n AnalyticsPlugin.prototype.trackPageViewPerformance = function (pageViewPerformance, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops,\r\n * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view\r\n * and send the event.\r\n * @param name - A string that idenfities this item, unique within this HTML document. Defaults to the document title.\r\n */\r\n AnalyticsPlugin.prototype.startTrackPage = function (name) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements.\r\n * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`.\r\n * @param name - The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param url - String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.\r\n * @param properties - map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n * @param measurements - map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n AnalyticsPlugin.prototype.stopTrackPage = function (name, url, properties, measurement) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param exception - The exception item to be sent\r\n * @param properties - Custom properties (Part C) that a user can add to the telemetry item\r\n * @param systemProperties - System level properties (Part A) that a user can add to the telemetry item\r\n */\r\n AnalyticsPlugin.prototype.sendExceptionInternal = function (exception, customProperties, systemProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Log an exception you have caught.\r\n *\r\n * @param exception - Object which contains exception to be sent\r\n * @param customProperties - Additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n *\r\n * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric.\r\n */\r\n AnalyticsPlugin.prototype.trackException = function (exception, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * @description Custom error handler for Application Insights Analytics\r\n * @param exception - The exception item to be sent\r\n */\r\n AnalyticsPlugin.prototype._onerror = function (exception) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AnalyticsPlugin.prototype.addTelemetryInitializer = function (telemetryInitializer) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n AnalyticsPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AnalyticsPlugin.Version = '3.3.6'; // Not currently used anywhere\r\n return AnalyticsPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { AnalyticsPlugin };\r\n//# sourceMappingURL=AnalyticsPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { utlCanUseSessionStorage, utlGetSessionStorage, utlRemoveSessionStorage, utlSetSessionStorage } from \"@microsoft/applicationinsights-common\";\r\nimport { _warnToConsole, dateNow, dumpObj, getJSON, hasJSON, throwError } from \"@microsoft/applicationinsights-core-js\";\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nimport { _DYN_TRACK_PREVIOUS_PAGE_1 } from \"../../__DynamicConstants\";\r\n/**\r\n * Used to track page visit durations\r\n */\r\nvar PageVisitTimeManager = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of PageVisitTimeManager\r\n * @param pageVisitTimeTrackingHandler - Delegate that will be called to send telemetry data to AI (when trackPreviousPageVisit is called)\r\n * @returns {}\r\n */\r\n function PageVisitTimeManager(logger, pageVisitTimeTrackingHandler) {\r\n var prevPageVisitDataKeyName = \"prevPageVisitData\";\r\n dynamicProto(PageVisitTimeManager, this, function (_self) {\r\n _self[_DYN_TRACK_PREVIOUS_PAGE_1 /* @min:%2etrackPreviousPageVisit */] = function (currentPageName, currentPageUrl) {\r\n try {\r\n // Restart timer for new page view\r\n var prevPageVisitTimeData = restartPageVisitTimer(currentPageName, currentPageUrl);\r\n // If there was a page already being timed, track the visit time for it now.\r\n if (prevPageVisitTimeData) {\r\n pageVisitTimeTrackingHandler(prevPageVisitTimeData.pageName, prevPageVisitTimeData.pageUrl, prevPageVisitTimeData.pageVisitTime);\r\n }\r\n }\r\n catch (e) {\r\n _warnToConsole(logger, \"Auto track page visit time failed, metric will not be collected: \" + dumpObj(e));\r\n }\r\n };\r\n /**\r\n * Stops timing of current page (if exists) and starts timing for duration of visit to pageName\r\n * @param pageName - Name of page to begin timing visit duration\r\n * @returns {PageVisitData} Page visit data (including duration) of pageName from last call to start or restart, if exists. Null if not.\r\n */\r\n function restartPageVisitTimer(pageName, pageUrl) {\r\n var prevPageVisitData = null;\r\n try {\r\n prevPageVisitData = stopPageVisitTimer();\r\n if (utlCanUseSessionStorage()) {\r\n if (utlGetSessionStorage(logger, prevPageVisitDataKeyName) != null) {\r\n throwError(\"Cannot call startPageVisit consecutively without first calling stopPageVisit\");\r\n }\r\n var currPageVisitDataStr = getJSON().stringify(new PageVisitData(pageName, pageUrl));\r\n utlSetSessionStorage(logger, prevPageVisitDataKeyName, currPageVisitDataStr);\r\n }\r\n }\r\n catch (e) {\r\n _warnToConsole(logger, \"Call to restart failed: \" + dumpObj(e));\r\n prevPageVisitData = null;\r\n }\r\n return prevPageVisitData;\r\n }\r\n /**\r\n * Stops timing of current page, if exists.\r\n * @returns {PageVisitData} Page visit data (including duration) of pageName from call to start, if exists. Null if not.\r\n */\r\n function stopPageVisitTimer() {\r\n var prevPageVisitData = null;\r\n try {\r\n if (utlCanUseSessionStorage()) {\r\n // Define end time of page's visit\r\n var pageVisitEndTime = dateNow();\r\n // Try to retrieve page name and start time from session storage\r\n var pageVisitDataJsonStr = utlGetSessionStorage(logger, prevPageVisitDataKeyName);\r\n if (pageVisitDataJsonStr && hasJSON()) {\r\n // if previous page data exists, set end time of visit\r\n prevPageVisitData = getJSON().parse(pageVisitDataJsonStr);\r\n prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData.pageVisitStartTime;\r\n // Remove data from storage since we already used it\r\n utlRemoveSessionStorage(logger, prevPageVisitDataKeyName);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _warnToConsole(logger, \"Stop page visit timer failed: \" + dumpObj(e));\r\n prevPageVisitData = null;\r\n }\r\n return prevPageVisitData;\r\n }\r\n // For backward compatibility\r\n objDefine(_self, \"_logger\", { g: function () { return logger; } });\r\n objDefine(_self, \"pageVisitTimeTrackingHandler\", { g: function () { return pageVisitTimeTrackingHandler; } });\r\n });\r\n }\r\n /**\r\n * Tracks the previous page visit time telemetry (if exists) and starts timing of new page visit time\r\n * @param currentPageName - Name of page to begin timing for visit duration\r\n * @param currentPageUrl - Url of page to begin timing for visit duration\r\n */\r\n PageVisitTimeManager.prototype.trackPreviousPageVisit = function (currentPageName, currentPageUrl) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return PageVisitTimeManager;\r\n}());\r\nexport { PageVisitTimeManager };\r\nvar PageVisitData = /** @class */ (function () {\r\n function PageVisitData(pageName, pageUrl) {\r\n this.pageVisitStartTime = dateNow();\r\n this.pageName = pageName;\r\n this.pageUrl = pageUrl;\r\n }\r\n return PageVisitData;\r\n}());\r\nexport { PageVisitData };\r\n//# sourceMappingURL=PageVisitTimeManager.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dateTimeUtilsDuration } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal } from \"@microsoft/applicationinsights-core-js\";\r\n/**\r\n * Used to record timed events and page views.\r\n */\r\nvar Timing = /** @class */ (function () {\r\n function Timing(logger, name) {\r\n var _self = this;\r\n var _events = {};\r\n _self.start = function (name) {\r\n if (typeof _events[name] !== \"undefined\") {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 62 /* _eInternalMessageId.StartCalledMoreThanOnce */, \"start was called more than once for this event without calling stop.\", { name: name, key: name }, true);\r\n }\r\n _events[name] = +new Date;\r\n };\r\n _self.stop = function (name, url, properties, measurements) {\r\n var start = _events[name];\r\n if (isNaN(start)) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 63 /* _eInternalMessageId.StopCalledWithoutStart */, \"stop was called without a corresponding start.\", { name: name, key: name }, true);\r\n }\r\n else {\r\n var end = +new Date;\r\n var duration = dateTimeUtilsDuration(start, end);\r\n _self.action(name, url, duration, properties, measurements);\r\n }\r\n delete _events[name];\r\n _events[name] = undefined;\r\n };\r\n }\r\n return Timing;\r\n}());\r\nexport { Timing };\r\n//# sourceMappingURL=Timing.js.map","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { objDefineProperties } from \"@nevware21/ts-utils\";\r\nimport { _pureAssign } from \"../internal/treeshake_helpers\";\r\n\r\nlet _debugState: any;\r\nlet _debugResult: any;\r\nlet _debugHandled: any;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n */\r\nexport let _promiseDebugEnabled = false;\r\n\r\n//#ifdef DEBUG\r\n//#:(!DEBUG) let _theLogger: (id: string, message: string) => void = null;\r\n//#endif\r\n\r\n/**\r\n * @internal\r\n * @ignore Internal function enable logging the internal state of the promise during execution, this code and references are\r\n * removed from the production artifacts\r\n */\r\nexport const _debugLog = (/*#__PURE__*/_pureAssign((id: string, message: string) => {\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) if (_theLogger) {\r\n //#:(!DEBUG) _theLogger(id, message);\r\n //#:(!DEBUG) }\r\n //#endif\r\n}));\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal function to add the debug state to the promise so that it provides simular visibility as you would\r\n * see from native promises\r\n * @param thePromise - The Promise implementation\r\n * @param stateFn - The function to return the state of the promise\r\n * @param resultFn - The function to return the result (settled value) of the promise\r\n * @param handledFn - The function to return whether the promise has been handled (used for throwing\r\n * unhandled rejection events)\r\n */\r\nexport function _addDebugState(thePromise: any, stateFn: () => string, resultFn: () => string, handledFn: () => boolean) {\r\n // While the IPromise implementations provide a `state` property, keeping the `[[PromiseState]]`\r\n // as native promises also have a non-enumerable property of the same name\r\n _debugState = _debugState || { toString: () => \"[[PromiseState]]\" };\r\n _debugResult = _debugResult || { toString: () => \"[[PromiseResult]]\" };\r\n _debugHandled = _debugHandled || { toString: () => \"[[PromiseIsHandled]]\" };\r\n \r\n let props: PropertyDescriptorMap = {};\r\n props[_debugState] = { get: stateFn };\r\n props[_debugResult] = { get: resultFn };\r\n props[_debugHandled] = { get: handledFn };\r\n\r\n objDefineProperties(thePromise, props);\r\n}\r\n\r\n/**\r\n * Debug helper to enable internal debugging of the promise implementations. Disabled by default.\r\n * For the generated packages included in the npm package the `logger` will not be called as the\r\n * `_debugLog` function that uses this logger is removed during packaging.\r\n *\r\n * It is available directly from the repository for unit testing.\r\n *\r\n * @group Debug\r\n * @param enabled - Should debugging be enabled (defaults `false`, when `true` promises will have\r\n * additional debug properties and the `toString` will include extra details.\r\n * @param logger - Optional logger that will log internal state changes, only called in debug\r\n * builds as the calling function is removed is the production artifacts.\r\n * @example\r\n * ```ts\r\n * // The Id is the id of the promise\r\n * // The message is the internal debug message\r\n * function promiseDebugLogger(id: string, message: string) {\r\n * if (console && console.log) {\r\n * console.log(id, message);\r\n * }\r\n * }\r\n *\r\n * setPromiseDebugState(true, promiseDebugLogger);\r\n *\r\n * // While the logger will not be called for the production packages\r\n * // Setting the `enabled` flag to tru will cause each promise to have\r\n * // the following additional properties added\r\n * // [[PromiseState]]; => Same as the `state` property\r\n * // [[PromiseResult]]; => The settled value\r\n * // [[PromiseIsHandled]] => Identifies if the promise has been handled\r\n * // It will also cause the `toString` for the promise to include additional\r\n * // debugging information\r\n * ```\r\n */\r\nexport function setPromiseDebugState(enabled: boolean, logger?: (id: string, message: string) => void) {\r\n _promiseDebugEnabled = enabled;\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _theLogger = logger;\r\n //#endif\r\n}","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2023 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nexport const STR_PROMISE = \"Promise\";\r\nexport const DONE = \"done\";\r\nexport const VALUE = \"value\";\r\nexport const ITERATOR = \"iterator\";\r\nexport const RETURN = \"return\";\r\nexport const REJECTED = \"rejected\";","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { isPromiseLike } from \"@nevware21/ts-utils\";\r\nimport { AwaitResponse } from \"../interfaces/await-response\";\r\nimport { IPromise } from \"../interfaces/IPromise\";\r\nimport { FinallyPromiseHandler, RejectedPromiseHandler, ResolvedPromiseHandler } from \"../interfaces/types\";\r\nimport { REJECTED } from \"../internal/constants\";\r\n\r\n/**\r\n * Helper to coallesce the promise resolved / reject into a single callback to simplify error handling.\r\n * @group Await Helper\r\n * @param value - The value or promise like value to wait\r\n * @param cb - The callback function to call with the resulting value, if the value is not a\r\n * promise like value then the callback is called synchronously, if the value is a promise then\r\n * the callback will be called once the promise completes the resulting value will be passed as an\r\n * IAwaitResponse instance, it will be called whether any promise resolves or rejects.\r\n * @returns The value returned by the `cb` callback function, if the value is a promise then the return value\r\n * of the callback will be returned as a promise whether the callback returns a promise or not.\r\n * @example\r\n * ```ts\r\n * let promise = createPromise((resolve, reject) => {\r\n * resolve(42);\r\n * });\r\n *\r\n * // Handle via doAwaitResponse\r\n * doAwaitResponse(promise, (value) => {\r\n * if (!value.rejected) {\r\n * // Do something with the value\r\n * } else {\r\n * // Do something with the reason\r\n * }\r\n * });\r\n *\r\n * // It can also handle the raw value, so you could process the result of either a\r\n * // synchrounous return of the value or a Promise\r\n * doAwaitResponse(42, (value) => {\r\n * if (!value.rejected) {\r\n * // Do something with the value\r\n * } else {\r\n * // This will never be true as the value is not a promise\r\n * }\r\n * });\r\n * ```\r\n */\r\nexport function doAwaitResponse(value: T | Promise, cb: (response: AwaitResponse) => T | TResult1 | TResult2 | Promise): T | TResult1 | TResult2 | Promise;\r\n\r\n/**\r\n * Helper to coallesce the promise resolved / reject into a single callback to simplify error handling.\r\n * @group Await Helper\r\n * @param value - The value or promise like value to wait for\r\n * @param cb - The callback function to call with the resulting value, if the value is not a\r\n * promise like value then the callback is called synchronously, if the value is a promise then\r\n * the callback will be called once the promise completes the resulting value will be passed as an\r\n * IAwaitResponse instance, it will be called whether any promise resolves or rejects.\r\n * @returns The value returned by the `cb` callback function, if the value is a promise then the return value\r\n * of the callback will be returned as a promise whether the callback returns a promise or not.\r\n * @example\r\n * ```ts\r\n * let promise = createPromise((resolve, reject) => {\r\n * resolve(42);\r\n * });\r\n *\r\n * // Handle via doAwaitResponse\r\n * doAwaitResponse(promise, (value) => {\r\n * if (!value.rejected) {\r\n * // Do something with the value\r\n * } else {\r\n * // Do something with the reason\r\n * }\r\n * });\r\n *\r\n * // It can also handle the raw value, so you could process the result of either a\r\n * // synchrounous return of the value or a Promise\r\n * doAwaitResponse(42, (value) => {\r\n * if (!value.rejected) {\r\n * // Do something with the value\r\n * } else {\r\n * // This will never be true as the value is not a promise\r\n * }\r\n * });\r\n * ```\r\n */\r\nexport function doAwaitResponse(value: T | PromiseLike, cb: (response: AwaitResponse) => T | TResult1 | TResult2 | PromiseLike): T | TResult1 | TResult2 | PromiseLike;\r\n\r\n/**\r\n * Helper to coallesce the promise resolved / reject into a single callback to simplify error handling.\r\n * @group Await Helper\r\n * @param value - The value or promise like value to wait to be resolved or rejected.\r\n * @param cb - The callback function to call with the resulting value, if the value is not a\r\n * promise like value then the callback is called synchronously, if the value is a promise then\r\n * the callback will be called once the promise completes the resulting value will be passed as an\r\n * IAwaitResponse instance, it will be called whether any promise resolves or rejects.\r\n * @returns The value returned by the `cb` callback function, if the value is a promise then the return value\r\n * of the callback will be returned as a promise whether the callback returns a promise or not.\r\n * @example\r\n * ```ts\r\n * let promise = createPromise((resolve, reject) => {\r\n * resolve(42);\r\n * });\r\n *\r\n * // Handle via doAwaitResponse\r\n * doAwaitResponse(promise, (value) => {\r\n * if (!value.rejected) {\r\n * // Do something with the value\r\n * } else {\r\n * // Do something with the reason\r\n * }\r\n * });\r\n *\r\n * // It can also handle the raw value, so you could process the result of either a\r\n * // synchrounous return of the value or a Promise\r\n * doAwaitResponse(42, (value) => {\r\n * if (!value.rejected) {\r\n * // Do something with the value\r\n * } else {\r\n * // This will never be true as the value is not a promise\r\n * }\r\n * });\r\n * ```\r\n */\r\nexport function doAwaitResponse(value: T | IPromise, cb: (response: AwaitResponse) => T | TResult1 | TResult2 | IPromise): T | TResult1 | TResult2 | IPromise {\r\n return doAwait(value as T, (value) => {\r\n return cb ? cb({\r\n status: \"fulfilled\",\r\n rejected: false,\r\n value: value\r\n }) : value;\r\n },\r\n (reason) => {\r\n return cb ? cb({\r\n status: REJECTED,\r\n rejected: true,\r\n reason: reason\r\n }) : reason;\r\n });\r\n}\r\n\r\n/**\r\n * Wait for the promise to resolve or reject, if resolved the callback function will be called with it's value and if\r\n * rejected the rejectFn will be called with the reason. If the passed promise argument is not a promise the callback\r\n * will be called synchronously with the value.\r\n * @group Await Helper\r\n * @param value - The value or promise like value to wait for\r\n * @param resolveFn - The callback to call on the promise successful resolving.\r\n * @param rejectFn - The callback to call when the promise rejects\r\n * @param finallyFn - The callback to call once the promise has resolved or rejected\r\n * @returns The passed value, if it is a promise and there is either a resolve or reject handler\r\n * then it will return a chained promise with the value from the resolve or reject handler (depending\r\n * whether it resolve or rejects)\r\n * @example\r\n * ```ts\r\n * let promise = createPromise((resolve, reject) => {\r\n * resolve(42);\r\n * });\r\n *\r\n * // Handle via a chained promise\r\n * let chainedPromise = promise.then((value) => {\r\n * // Do something with the value\r\n * });\r\n *\r\n * // Handle via doAwait\r\n * doAwait(promise, (value) => {\r\n * // Do something with the value\r\n * });\r\n *\r\n * // It can also handle the raw value, so you could process the result of either a\r\n * // synchrounous return of the value or a Promise\r\n * doAwait(42, (value) => {\r\n * // Do something with the value\r\n * });\r\n * ```\r\n */\r\nexport function doAwait(value: T | Promise, resolveFn: ResolvedPromiseHandler, rejectFn?: RejectedPromiseHandler, finallyFn?: FinallyPromiseHandler): TResult1 | TResult2 | Promise;\r\n\r\n/**\r\n * Wait for the promise to resolve or reject, if resolved the callback function will be called with it's value and if\r\n * rejected the rejectFn will be called with the reason. If the passed promise argument is not a promise the callback\r\n * will be called synchronously with the value.\r\n * @group Await Helper\r\n * @param value - The value or promise like value to wait for\r\n * @param resolveFn - The callback to call on the promise successful resolving.\r\n * @param rejectFn - The callback to call when the promise rejects\r\n * @param finallyFn - The callback to call once the promise has resolved or rejected\r\n * @returns The passed value, if it is a promise and there is either a resolve or reject handler\r\n * then it will return a chained promise with the value from the resolve or reject handler (depending\r\n * whether it resolve or rejects)\r\n * @example\r\n * ```ts\r\n * let promise = createPromise((resolve, reject) => {\r\n * resolve(42);\r\n * });\r\n *\r\n * // Handle via a chained promise\r\n * let chainedPromise = promise.then((value) => {\r\n * // Do something with the value\r\n * });\r\n *\r\n * // Handle via doAwait\r\n * doAwait(promise, (value) => {\r\n * // Do something with the value\r\n * });\r\n *\r\n * // It can also handle the raw value, so you could process the result of either a\r\n * // synchrounous return of the value or a Promise\r\n * doAwait(42, (value) => {\r\n * // Do something with the value\r\n * });\r\n * ```\r\n */\r\nexport function doAwait(value: T | PromiseLike, resolveFn: ResolvedPromiseHandler, rejectFn?: RejectedPromiseHandler, finallyFn?: FinallyPromiseHandler): TResult1 | TResult2 | PromiseLike;\r\n\r\n/**\r\n * Wait for the promise to resolve or reject, if resolved the callback function will be called with it's value and if\r\n * rejected the rejectFn will be called with the reason. If the passed promise argument is not a promise the callback\r\n * will be called synchronously with the value.\r\n * @group Await Helper\r\n * @param value - The value or promise like value to wait for\r\n * @param resolveFn - The callback to call on the promise successful resolving.\r\n * @param rejectFn - The callback to call when the promise rejects\r\n * @param finallyFn - The callback to call once the promise has resolved or rejected\r\n * @returns The passed value, if it is a promise and there is either a resolve or reject handler\r\n * then it will return a chained promise with the value from the resolve or reject handler (depending\r\n * whether it resolve or rejects)\r\n * @example\r\n * ```ts\r\n * let promise = createPromise((resolve, reject) => {\r\n * resolve(42);\r\n * });\r\n *\r\n * // Handle via a chained promise\r\n * let chainedPromise = promise.then((value) => {\r\n * // Do something with the value\r\n * });\r\n *\r\n * // Handle via doAwait\r\n * doAwait(promise, (value) => {\r\n * // Do something with the value\r\n * });\r\n *\r\n * // It can also handle the raw value, so you could process the result of either a\r\n * // synchrounous return of the value or a Promise\r\n * doAwait(42, (value) => {\r\n * // Do something with the value\r\n * });\r\n * ```\r\n */\r\nexport function doAwait(value: T | IPromise, resolveFn: ResolvedPromiseHandler, rejectFn?: RejectedPromiseHandler, finallyFn?: FinallyPromiseHandler): TResult1 | TResult2 | IPromise {\r\n let result: T | TResult1 | TResult2 | IPromise | PromiseLike = value;\r\n \r\n try {\r\n if (isPromiseLike(value)) {\r\n if (resolveFn || rejectFn) {\r\n result = value.then(resolveFn, rejectFn) as any;\r\n }\r\n } else {\r\n try {\r\n if (resolveFn) {\r\n result = resolveFn(value);\r\n }\r\n } catch (err) {\r\n if (rejectFn) {\r\n result = rejectFn(err);\r\n } else {\r\n throw err;\r\n }\r\n }\r\n }\r\n } finally {\r\n if (finallyFn) {\r\n doFinally(result as any, finallyFn);\r\n }\r\n }\r\n\r\n return result as any;\r\n}\r\n\r\n/**\r\n * Wait for the promise to resolve or reject and then call the finallyFn. If the passed promise argument is not a promise the callback\r\n * will be called synchronously with the value. If the passed promise doesn't implement finally then a finally implementation will be\r\n * simulated using then(..., ...).\r\n * @group Await Helper\r\n * @param value - The value or promise like value to wait for\r\n * @param finallyFn - The finally function to call once the promise has resolved or rejected\r\n */\r\nexport function doFinally(value: T | Promise, finallyFn: FinallyPromiseHandler): T | Promise;\r\n\r\n/**\r\n * Wait for the promise to resolve or reject and then call the finallyFn. If the passed promise argument is not a promise the callback\r\n * will be called synchronously with the value. If the passed promise doesn't implement finally then a finally implementation will be\r\n * simulated using then(..., ...).\r\n * @group Await Helper\r\n * @param value - The value or promise like value to wait for\r\n * @param finallyFn - The finally function to call once the promise has resolved or rejected\r\n */\r\nexport function doFinally(value: T | PromiseLike, finallyFn: FinallyPromiseHandler): T | PromiseLike;\r\n\r\n/**\r\n * Wait for the promise to resolve or reject and then call the finallyFn. If the passed promise argument is not a promise the callback\r\n * will be called synchronously with the value. If the passed promise doesn't implement finally then a finally implementation will be\r\n * simulated using then(..., ...).\r\n * @group Await Helper\r\n * @param value - The value or promise like value to wait for\r\n * @param finallyFn - The finally function to call once the promise has resolved or rejected\r\n */\r\nexport function doFinally(value: T | IPromise, finallyFn: FinallyPromiseHandler): T | IPromise {\r\n let result = value;\r\n if (finallyFn) {\r\n if (isPromiseLike(value)) {\r\n if ((value as IPromise).finally) {\r\n result = (value as IPromise).finally(finallyFn);\r\n } else {\r\n // Simulate finally if not available\r\n result = value.then(\r\n function(value) {\r\n finallyFn();\r\n return value;\r\n }, function(reason: any) {\r\n finallyFn();\r\n throw reason;\r\n });\r\n }\r\n } else {\r\n finallyFn();\r\n }\r\n }\r\n\r\n return result;\r\n}","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { REJECTED } from \"./constants\";\r\n\r\n/**\r\n * @ignore -- Don't include in the generated documentation\r\n * @internal\r\n */\r\nexport const enum ePromiseState {\r\n Pending = 0,\r\n Resolving = 1,\r\n Resolved = 2,\r\n Rejected = 3\r\n}\r\n\r\n/**\r\n * @ignore -- Don't include in the generated documentation\r\n * @internal\r\n */\r\nexport const STRING_STATES: string[] = /*#__PURE__*/[\r\n \"pending\", \"resolving\", \"resolved\", REJECTED\r\n];\r\n","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { dumpObj, getDocument, getInst, ICachedValue, createCachedValue, safe } from \"@nevware21/ts-utils\";\r\n\r\nconst DISPATCH_EVENT = \"dispatchEvent\";\r\nlet _hasInitEvent: ICachedValue;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Helper function to determine if the document has the `initEvent` function\r\n * @param doc - The document to check\r\n * @returns\r\n */\r\nfunction _hasInitEventFn(doc: Document) {\r\n let evt: any;\r\n if (doc && doc.createEvent) {\r\n evt = doc.createEvent(\"Event\");\r\n }\r\n \r\n return (!!evt && evt.initEvent);\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * @param target\r\n * @param evtName\r\n * @param populateEvent\r\n * @param useNewEvent\r\n */\r\nexport function emitEvent(target: any, evtName: string, populateEvent: (theEvt: Event | any) => Event | any, useNewEvent: boolean) {\r\n\r\n let doc = getDocument();\r\n !_hasInitEvent && (_hasInitEvent = createCachedValue(!!safe(_hasInitEventFn, [ doc ]).v));\r\n\r\n let theEvt: Event = _hasInitEvent.v ? doc.createEvent(\"Event\") : (useNewEvent ? new Event(evtName) : {} as Event);\r\n populateEvent && populateEvent(theEvt);\r\n\r\n if (_hasInitEvent.v) {\r\n theEvt.initEvent(evtName, false, true);\r\n }\r\n\r\n if (theEvt && target[DISPATCH_EVENT]) {\r\n target[DISPATCH_EVENT](theEvt);\r\n } else {\r\n let handler = target[\"on\" + evtName];\r\n if (handler) {\r\n handler(theEvt);\r\n } else {\r\n let theConsole = getInst(\"console\");\r\n theConsole && (theConsole[\"error\"] || theConsole[\"log\"])(evtName, dumpObj(theEvt));\r\n }\r\n }\r\n}\r\n","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport {\r\n arrSlice, dumpObj, getKnownSymbol, hasSymbol, isFunction, isPromiseLike, isUndefined,\r\n throwTypeError, WellKnownSymbols, objToString, scheduleTimeout, ITimerHandler, getWindow, isNode,\r\n getGlobal, objDefine, objDefineProp, iterForOf, isIterable, isArray, arrForEach, createCachedValue,\r\n ICachedValue, safe, getInst, createCustomError\r\n} from \"@nevware21/ts-utils\";\r\nimport { doAwait, doAwaitResponse } from \"./await\";\r\nimport { _addDebugState, _promiseDebugEnabled } from \"./debug\";\r\nimport { IPromise } from \"../interfaces/IPromise\";\r\nimport { PromisePendingProcessor } from \"./itemProcessor\";\r\nimport {\r\n FinallyPromiseHandler, PromiseCreatorFn, PromiseExecutor, RejectedPromiseHandler, ResolvedPromiseHandler\r\n} from \"../interfaces/types\";\r\nimport { ePromiseState, STRING_STATES } from \"../internal/state\";\r\nimport { emitEvent } from \"./event\";\r\nimport { REJECTED, STR_PROMISE } from \"../internal/constants\";\r\nimport { IPromiseResult } from \"../interfaces/IPromiseResult\";\r\n\r\n//#ifdef DEBUG\r\n//#:(!DEBUG) import { _debugLog } from \"./debug\";\r\n//#endif\r\n\r\nconst NODE_UNHANDLED_REJECTION = \"unhandledRejection\";\r\nconst UNHANDLED_REJECTION = NODE_UNHANDLED_REJECTION.toLowerCase();\r\n\r\nlet _currentPromiseId: number[] = [];\r\nlet _uniquePromiseId = 0;\r\nlet _unhandledRejectionTimeout = 10;\r\nlet _aggregationError: ICachedValue;\r\n\r\n/**\r\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)\r\n */\r\ninterface _PromiseRejectionEvent extends Event {\r\n /**\r\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)\r\n */\r\n readonly promise: IPromise;\r\n\r\n /**\r\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)\r\n */\r\n readonly reason: any;\r\n}\r\n\r\nlet _hasPromiseRejectionEvent: ICachedValue<_PromiseRejectionEvent>;\r\n\r\nfunction dumpFnObj(value: any) {\r\n if (isFunction(value)) {\r\n return value.toString();\r\n }\r\n\r\n return dumpObj(value);\r\n}\r\n\r\n//#ifdef DEBUG\r\n//#:(!DEBUG) function _getCaller(prefix: string, start: number) {\r\n//#:(!DEBUG) let stack = new Error().stack;\r\n//#:(!DEBUG) if (stack) {\r\n//#:(!DEBUG) let lines = stack.split(\"\\n\");\r\n//#:(!DEBUG) if (lines.length > start) {\r\n//#:(!DEBUG) return prefix + \":\" + arrSlice(lines, start, start + 5).join(\"\\n\") + \"\\n...\";\r\n//#:(!DEBUG) }\r\n//#:(!DEBUG) }\r\n//#:(!DEBUG) return null;\r\n//#:(!DEBUG) }\r\n//#endif\r\n\r\n/*#__NO_SIDE_EFFECTS__*/\r\nfunction _createAggregationError(values: any[]) {\r\n !_aggregationError && (_aggregationError = createCachedValue(safe(getInst, [\"AggregationError\"]).v || createCustomError(\"AggregationError\", (self, args) => {\r\n self.errors = args[0];\r\n })));\r\n\r\n return new _aggregationError.v(values);\r\n}\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n *\r\n * Implementing a simple synchronous promise interface for support within any environment that\r\n * doesn't support the Promise API\r\n * @param newPromise - The delegate function used to create a new promise object\r\n * @param processor - The function to use to process the pending\r\n * @param executor - The resolve function\r\n * @param additionalArgs - [Optional] Additional arguments that will be passed to the PromiseCreatorFn\r\n */\r\nexport function _createPromise(newPromise: PromiseCreatorFn, processor: PromisePendingProcessor, executor: PromiseExecutor, ...additionalArgs: any): IPromise;\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n *\r\n * Implementing a simple synchronous promise interface for support within any environment that\r\n * doesn't support the Promise API\r\n * @param newPromise - The delegate function used to create a new promise object\r\n * @param processor - The function to use to process the pending\r\n * @param executor - The resolve function\r\n * @param additionalArgs - [Optional] Additional arguments that will be passed to the PromiseCreatorFn\r\n */\r\nexport function _createPromise(newPromise: PromiseCreatorFn, processor: PromisePendingProcessor, executor: PromiseExecutor): IPromise {\r\n let additionalArgs = arrSlice(arguments, 3);\r\n let _state = ePromiseState.Pending;\r\n let _hasResolved = false;\r\n let _settledValue: T;\r\n let _queue: (() => void)[] = [];\r\n let _id = _uniquePromiseId++;\r\n let _parentId = _currentPromiseId.length > 0 ? _currentPromiseId[_currentPromiseId.length - 1] : undefined;\r\n let _handled = false;\r\n let _unHandledRejectionHandler: ITimerHandler = null;\r\n let _thePromise: IPromise;\r\n \r\n // https://tc39.es/ecma262/#sec-promise.prototype.then\r\n function _then(onResolved?: ResolvedPromiseHandler, onRejected?: RejectedPromiseHandler): IPromise {\r\n try {\r\n _currentPromiseId.push(_id);\r\n _handled = true;\r\n _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();\r\n _unHandledRejectionHandler = null;\r\n\r\n let thenPromise = newPromise(function (resolve, reject) {\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), _getCaller(\"_then\", 7));\r\n //#endif\r\n\r\n // Queue the new promise returned to be resolved or rejected\r\n // when this promise settles.\r\n _queue.push(function () {\r\n // https://tc39.es/ecma262/#sec-newpromisereactionjob\r\n //let value: any;\r\n try {\r\n // First call the onFulfilled or onRejected handler, on the settled value\r\n // of this promise. If the corresponding `handler` does not exist, simply\r\n // pass through the settled value.\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Handling settled value \" + dumpFnObj(_settledValue));\r\n //#endif\r\n let handler = _state === ePromiseState.Resolved ? onResolved : onRejected;\r\n let value = isUndefined(handler) ? _settledValue : (isFunction(handler) ? handler(_settledValue) : handler);\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Handling Result \" + dumpFnObj(value));\r\n //#endif\r\n \r\n if (isPromiseLike(value)) {\r\n // The called handlers returned a new promise, so the chained promise\r\n // will follow the state of this promise.\r\n value.then(resolve as any, reject);\r\n } else if (handler) {\r\n // If we have a handler then chained promises are always \"resolved\" with the result returned\r\n resolve(value as any);\r\n } else if (_state === ePromiseState.Rejected) {\r\n // If this promise is rejected then the chained promise should be rejected\r\n // with either the settled value of this promise or the return value of the handler.\r\n reject(value);\r\n } else {\r\n // If this promise is fulfilled, then the chained promise is also fulfilled\r\n // with either the settled value of this promise or the return value of the handler.\r\n resolve(value as any);\r\n }\r\n } catch (e) {\r\n reject(e);\r\n }\r\n });\r\n \r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Added to Queue \" + _queue.length);\r\n //#endif\r\n \r\n // If this promise is already settled, then immediately process the callback we\r\n // just added to the queue.\r\n if (_hasResolved) {\r\n _processQueue();\r\n }\r\n }, additionalArgs);\r\n \r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Created -> \" + thenPromise.toString());\r\n //#endif\r\n \r\n return thenPromise;\r\n \r\n } finally {\r\n _currentPromiseId.pop();\r\n }\r\n }\r\n\r\n // https://tc39.es/ecma262/#sec-promise.prototype.catch\r\n function _catch(onRejected: RejectedPromiseHandler) {\r\n // Reuse then onRejected to support rejection\r\n return _then(undefined, onRejected);\r\n }\r\n\r\n // https://tc39.es/ecma262/#sec-promise.prototype.finally\r\n function _finally(onFinally: FinallyPromiseHandler): IPromise {\r\n let thenFinally: any = onFinally;\r\n let catchFinally: any = onFinally;\r\n if (isFunction(onFinally)) {\r\n thenFinally = function(value: TResult1 | TResult2) {\r\n onFinally && onFinally();\r\n return value;\r\n }\r\n \r\n catchFinally = function(reason: any) {\r\n onFinally && onFinally();\r\n throw reason;\r\n }\r\n }\r\n\r\n return _then(thenFinally as any, catchFinally as any);\r\n }\r\n\r\n function _strState() {\r\n return STRING_STATES[_state];\r\n }\r\n\r\n function _processQueue() {\r\n if (_queue.length > 0) {\r\n // The onFulfilled and onRejected handlers must be called asynchronously. Thus,\r\n // we make a copy of the queue and work on it once the current call stack unwinds.\r\n let pending = _queue.slice();\r\n _queue = [];\r\n\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Processing queue \" + pending.length);\r\n //#endif\r\n\r\n _handled = true;\r\n _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();\r\n _unHandledRejectionHandler = null;\r\n processor(pending);\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Processing done\");\r\n //#endif\r\n\r\n } else {\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Empty Processing queue \");\r\n //#endif\r\n }\r\n }\r\n\r\n function _createSettleIfFn(newState: ePromiseState, allowState: ePromiseState) {\r\n return (theValue: T) => {\r\n if (_state === allowState) {\r\n if (newState === ePromiseState.Resolved && isPromiseLike(theValue)) {\r\n _state = ePromiseState.Resolving;\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Resolving\");\r\n //#endif\r\n theValue.then(\r\n _createSettleIfFn(ePromiseState.Resolved, ePromiseState.Resolving),\r\n _createSettleIfFn(ePromiseState.Rejected, ePromiseState.Resolving));\r\n return;\r\n }\r\n\r\n _state = newState;\r\n _hasResolved = true;\r\n _settledValue = theValue;\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), _strState());\r\n //#endif\r\n _processQueue();\r\n if (!_handled && newState === ePromiseState.Rejected && !_unHandledRejectionHandler) {\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Setting up unhandled rejection\");\r\n //#endif\r\n _unHandledRejectionHandler = scheduleTimeout(_notifyUnhandledRejection, _unhandledRejectionTimeout)\r\n }\r\n } else {\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Already \" + _strState());\r\n //#endif\r\n }\r\n };\r\n }\r\n\r\n function _notifyUnhandledRejection() {\r\n if (!_handled) {\r\n // Mark as handled so we don't keep notifying\r\n _handled = true;\r\n if (isNode()) {\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Emitting \" + NODE_UNHANDLED_REJECTION);\r\n //#endif\r\n process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise);\r\n } else {\r\n let gbl = getWindow() || getGlobal();\r\n \r\n !_hasPromiseRejectionEvent && (_hasPromiseRejectionEvent = createCachedValue(safe(getInst<_PromiseRejectionEvent>, [STR_PROMISE + \"RejectionEvent\"]).v));\r\n\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Emitting \" + UNHANDLED_REJECTION);\r\n //#endif\r\n emitEvent(gbl, UNHANDLED_REJECTION, (theEvt: any) => {\r\n objDefine(theEvt, \"promise\", { g: () => _thePromise });\r\n theEvt.reason = _settledValue;\r\n return theEvt;\r\n }, !!_hasPromiseRejectionEvent.v);\r\n }\r\n }\r\n }\r\n\r\n _thePromise = {\r\n then: _then,\r\n \"catch\": _catch,\r\n finally: _finally\r\n } as any;\r\n\r\n objDefineProp(_thePromise, \"state\", {\r\n get: _strState\r\n });\r\n\r\n if (_promiseDebugEnabled) {\r\n // eslint-disable-next-line brace-style\r\n _addDebugState(_thePromise, _strState, () => { return objToString(_settledValue); }, () => _handled);\r\n }\r\n\r\n if (hasSymbol()) {\r\n _thePromise[getKnownSymbol(WellKnownSymbols.toStringTag)] = \"IPromise\";\r\n }\r\n\r\n let createStack: string;\r\n //#if DEBUG\r\n //#:(!{DEBUG}) createStack = _getCaller(\"Created\", 5);\r\n //#endif\r\n function _toString() {\r\n return \"IPromise\" + (_promiseDebugEnabled ? \"[\" + _id + (!isUndefined(_parentId) ? (\":\" + _parentId) : \"\") + \"]\" : \"\") + \" \" + _strState() + (_hasResolved ? (\" - \" + dumpFnObj(_settledValue)) : \"\") + (createStack ? \" @ \" + createStack : \"\");\r\n }\r\n\r\n _thePromise.toString = _toString;\r\n\r\n (function _initialize() {\r\n if (!isFunction(executor)) {\r\n throwTypeError(STR_PROMISE + \": executor is not a function - \" + dumpFnObj(executor));\r\n }\r\n\r\n const _rejectFn = _createSettleIfFn(ePromiseState.Rejected, ePromiseState.Pending);\r\n try {\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Executing\");\r\n //#endif\r\n executor.call(\r\n _thePromise,\r\n _createSettleIfFn(ePromiseState.Resolved, ePromiseState.Pending),\r\n _rejectFn);\r\n } catch (e) {\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Exception thrown: \" + dumpFnObj(e));\r\n //#endif\r\n _rejectFn(e);\r\n }\r\n\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"~Executing\");\r\n //#endif\r\n })();\r\n\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(_toString(), \"Returning\");\r\n //#endif\r\n return _thePromise;\r\n}\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n * Returns a function which when called will return a new Promise object that resolves to an array of the\r\n * results from the input promises. The returned promise will resolve when all of the inputs' promises have\r\n * resolved, or if the input contains no promises. It rejects immediately upon any of the input promises\r\n * rejected or non-promises throwing an error, and will reject with this first rejection message / error.\r\n * @param newPromise - The delegate function used to create a new promise object the new promise instance.\r\n * @returns A function to create a promise that will be resolved when all arguments are resolved.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createAllPromise(newPromise: PromiseCreatorFn): (input: Iterable>, ...additionalArgs: any) => IPromise[]> {\r\n return function (input: Iterable>): IPromise[]> {\r\n let additionalArgs = arrSlice(arguments, 1);\r\n return newPromise[]>((resolve, reject) => {\r\n try {\r\n let values = [] as any;\r\n let pending = 1; // Prefix to 1 so we finish iterating over all of the input promises first\r\n\r\n iterForOf(input, (item, idx) => {\r\n if (item) {\r\n pending++;\r\n doAwait(item, (value) => {\r\n // Set the result values\r\n values[idx] = value;\r\n if (--pending === 0) {\r\n resolve(values);\r\n }\r\n }, reject);\r\n }\r\n });\r\n\r\n // Now decrement the pending so that we finish correctly\r\n pending--;\r\n if (pending === 0) {\r\n // All promises were either resolved or where not a promise\r\n resolve(values);\r\n }\r\n } catch (e) {\r\n reject(e);\r\n }\r\n }, additionalArgs);\r\n };\r\n}\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n * The createResolvedPromise returns a PromiseLike object that is resolved with a given value. If the value is\r\n * PromiseLike (i.e. has a \"then\" method), the returned promise will \"follow\" that thenable, adopting its eventual\r\n * state; otherwise the returned promise will be fulfilled with the value. This function flattens nested layers\r\n * of promise-like objects (e.g. a promise that resolves to a promise that resolves to something) into a single layer.\r\n * @param newPromise - The delegate function used to create a new promise object\r\n * @param value - Argument to be resolved by this Promise. Can also be a Promise or a thenable to resolve.\r\n * @param additionalArgs - Any additional arguments that should be passed to the delegate to assist with the creation of\r\n * the new promise instance.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createResolvedPromise(newPromise: PromiseCreatorFn): (value: T, ...additionalArgs: any) => IPromise {\r\n return function (value: T): IPromise {\r\n let additionalArgs = arrSlice(arguments, 1);\r\n if (isPromiseLike(value)) {\r\n return value as unknown as IPromise;\r\n }\r\n \r\n return newPromise((resolve) => {\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(String(this), \"Resolving Promise\");\r\n //#endif\r\n resolve(value);\r\n }, additionalArgs);\r\n };\r\n}\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n * Return a promise like object that is rejected with the given reason.\r\n * @param newPromise - The delegate function used to create a new promise object\r\n * @param reason - The rejection reason\r\n * @param additionalArgs - Any additional arguments that should be passed to the delegate to assist with the creation of\r\n * the new promise instance.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createRejectedPromise(newPromise: PromiseCreatorFn): (reason: any, ...additionalArgs: any) => IPromise {\r\n return function (reason: any): IPromise {\r\n let additionalArgs = arrSlice(arguments, 1);\r\n return newPromise((_resolve, reject) => {\r\n //#ifdef DEBUG\r\n //#:(!DEBUG) _debugLog(String(this), \"Rejecting Promise\");\r\n //#endif\r\n reject(reason);\r\n }, additionalArgs);\r\n };\r\n}\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n * @since 0.5.0\r\n * Returns a function which when called will return a new Promise object that resolves to an array of\r\n * IPromiseResults from the input promises. The returned promise will resolve when all of the inputs'\r\n * promises have resolved or rejected, or if the input contains no promises. It will resolve only after\r\n * all input promises have been fulfilled (resolve or rejected).\r\n * @param newPromise - The delegate function used to create a new promise object the new promise instance.\r\n * @returns A function to create a promise that will be resolved when all arguments are resolved.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createAllSettledPromise(newPromise: PromiseCreatorFn, ..._args: any[]): ICachedValue<(input: T, timeout?: number) => IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }>> {\r\n return createCachedValue(function (input: T, ..._args: any[]): IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }> {\r\n let additionalArgs = arrSlice(arguments, 1);\r\n return newPromise<{ -readonly [P in keyof T]: IPromiseResult>; }>((resolve, reject) => {\r\n let values: { -readonly [P in keyof T]: IPromiseResult>; } = [] as any;\r\n let pending = 1; // Prefix to 1 so we finish iterating over all of the input promises first\r\n\r\n function processItem(item: any, idx: number) {\r\n pending++;\r\n doAwaitResponse(item, (value) => {\r\n if (value.rejected) {\r\n values[idx] = {\r\n status: REJECTED,\r\n reason: value.reason\r\n };\r\n } else {\r\n values[idx] = {\r\n status: \"fulfilled\",\r\n value: value.value\r\n };\r\n }\r\n \r\n if (--pending === 0) {\r\n resolve(values);\r\n }\r\n });\r\n }\r\n\r\n try {\r\n\r\n if (isArray(input)) {\r\n arrForEach(input, processItem);\r\n } else if (isIterable(input)) {\r\n iterForOf(input, processItem);\r\n } else {\r\n throwTypeError(\"Input is not an iterable\");\r\n }\r\n\r\n // Now decrement the pending so that we finish correctly\r\n pending--;\r\n if (pending === 0) {\r\n // All promises were either resolved or where not a promise\r\n resolve(values);\r\n }\r\n } catch (e) {\r\n reject(e);\r\n }\r\n }, additionalArgs);\r\n });\r\n}\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n * @since 0.5.0\r\n * Returns a function takes an iterable of promises as input and returns a single Promise.\r\n * This returned promise settles with the eventual state of the first promise that settles.\r\n * @description The returned promise is one of the promise concurrency methods. It's useful when you want\r\n * the first async task to complete, but do not care about its eventual state (i.e. it can either succeed\r\n * or fail).\r\n * @param newPromise - The delegate function used to create a new promise object the new promise instance.\r\n * @returns A function to create a promise that will resolve when the first promise to settle is fulfilled,\r\n * and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises,\r\n * the returned promise is still settled.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createRacePromise(newPromise: PromiseCreatorFn, ..._args: any[]): ICachedValue<(values: T, timeout?: number) => IPromise>> {\r\n return createCachedValue(function (input: T, ..._args: any[]): IPromise> {\r\n let additionalArgs = arrSlice(arguments, 1);\r\n return newPromise>((resolve, reject) => {\r\n let isDone = false;\r\n\r\n function processItem(item: any) {\r\n doAwaitResponse(item, (value) => {\r\n if (!isDone) {\r\n isDone = true;\r\n if (value.rejected) {\r\n reject(value.reason);\r\n } else {\r\n resolve(value.value);\r\n }\r\n }\r\n });\r\n }\r\n\r\n try {\r\n if (isArray(input)) {\r\n arrForEach(input, processItem);\r\n } else if (isIterable(input)) {\r\n iterForOf(input, processItem);\r\n } else {\r\n throwTypeError(\"Input is not an iterable\");\r\n }\r\n\r\n } catch (e) {\r\n reject(e);\r\n }\r\n }, additionalArgs);\r\n });\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * @since 0.5.0\r\n * Returns a function takes an iterable of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment\r\n * value. It rejects when all of the input's promises reject (including when an empty iterable is passed),\r\n * with an AggregateError containing an array of rejection reasons.\r\n * @param newPromise - The delegate function used to create a new promise object the new promise instance.\r\n * @returns A function to create a promise that will resolve when the any of the input's promises fulfills,\r\n * with this first fulfillment value. It rejects when all of the input's promises reject (including when\r\n * an empty iterable is passed), with an AggregateError containing an array of rejection reasons.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createAnyPromise(newPromise: PromiseCreatorFn, ..._args: any[]): ICachedValue<(values: T) => IPromise>> {\r\n return createCachedValue(function (input: T, ..._args: any[]): IPromise> {\r\n let additionalArgs = arrSlice(arguments, 1);\r\n return newPromise>((resolve, reject) => {\r\n let theErros: Array = [] as any;\r\n let pending = 1; // Prefix to 1 so we finish iterating over all of the input promises first\r\n let isDone = false;\r\n\r\n function processItem(item: any, idx: number) {\r\n pending++;\r\n doAwaitResponse(item, (value ) => {\r\n if (!value.rejected) {\r\n isDone = true;\r\n resolve(value.value);\r\n return;\r\n } else {\r\n theErros[idx] = value.reason;\r\n }\r\n\r\n if (--pending === 0 && !isDone) {\r\n reject(_createAggregationError(theErros));\r\n }\r\n });\r\n }\r\n\r\n try {\r\n if (isArray(input)) {\r\n arrForEach(input, processItem);\r\n } else if (isIterable(input)) {\r\n iterForOf(input, processItem);\r\n } else {\r\n throwTypeError(\"Input is not an iterable\");\r\n }\r\n\r\n // Now decrement the pending so that we finish correctly\r\n pending--;\r\n if (pending === 0 && !isDone) {\r\n // All promises were either resolved or where not a promise\r\n reject(_createAggregationError(theErros));\r\n }\r\n } catch (e) {\r\n reject(e);\r\n }\r\n }, additionalArgs);\r\n });\r\n}\r\n","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { arrForEach, isNumber, scheduleIdleCallback, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { IPromise } from \"../interfaces/IPromise\";\r\nimport { PromiseExecutor } from \"../interfaces/types\";\r\n\r\nexport type PromisePendingProcessor = (pending: PromisePendingFn[]) => void;\r\nexport type PromisePendingFn = () => void;\r\nexport type PromiseCreatorFn = (newExecutor: PromiseExecutor, ...extraArgs: any) => IPromise;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Return an item processor that processes all of the pending items synchronously\r\n * @return An item processor\r\n */\r\nexport function syncItemProcessor(pending: PromisePendingFn[]): void {\r\n arrForEach(pending, (fn: PromisePendingFn) => {\r\n try {\r\n fn();\r\n } catch (e) {\r\n // Don't let 1 failing handler break all others\r\n // TODO: Add some form of error reporting (i.e. Call any registered JS error handler so the error is reported)\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Return an item processor that processes all of the pending items asynchronously using the optional timeout.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n * @return An item processor\r\n */\r\nexport function timeoutItemProcessor(timeout?: number): (pending: PromisePendingFn[]) => void {\r\n let callbackTimeout = isNumber(timeout) ? timeout : 0;\r\n\r\n return (pending: PromisePendingFn[]) => {\r\n scheduleTimeout(() => {\r\n syncItemProcessor(pending);\r\n }, callbackTimeout);\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Return an item processor that processes all of the pending items using an idle callback (if available) or based on\r\n * a timeout (when `requestIdenCallback` is not supported) using the optional timeout.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n * @return An item processor\r\n */\r\nexport function idleItemProcessor(timeout?: number): (pending: PromisePendingFn[]) => void {\r\n let options: any;\r\n if (timeout >= 0) {\r\n options = {\r\n timeout: +timeout\r\n };\r\n }\r\n\r\n return (pending: PromisePendingFn[]) => {\r\n scheduleIdleCallback((deadline: IdleDeadline) => {\r\n syncItemProcessor(pending);\r\n }, options);\r\n };\r\n}","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport {\r\n _createAllPromise, _createAllSettledPromise, _createAnyPromise, _createPromise, _createRacePromise,\r\n _createRejectedPromise, _createResolvedPromise\r\n} from \"./base\";\r\nimport { IPromise } from \"../interfaces/IPromise\";\r\nimport { timeoutItemProcessor } from \"./itemProcessor\";\r\nimport { PromiseExecutor } from \"../interfaces/types\";\r\nimport { IPromiseResult } from \"../interfaces/IPromiseResult\";\r\nimport { ICachedValue } from \"@nevware21/ts-utils\";\r\n\r\nlet _allAsyncSettledCreator: ICachedValue<(input: T, timeout?: number) => IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }>>;\r\nlet _raceAsyncCreator: ICachedValue<(values: T, timeout?: number) => IPromise>>;\r\nlet _anyAsyncCreator: ICachedValue<(values: T, timeout?: number) => IPromise>>;\r\n\r\n/**\r\n * Creates an asynchronous Promise instance that when resolved or rejected will execute it's pending chained operations\r\n * __asynchronously__ using the optional provided timeout value to schedule when the chained items will be ececuted.\r\n * @group Async\r\n * @group Promise\r\n * @param executor - The function to be executed during the creation of the promise. Any errors thrown in the executor will\r\n * cause the promise to be rejected. The return value of the executor is always ignored\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport function createAsyncPromise(executor: PromiseExecutor, timeout?: number): IPromise {\r\n return _createPromise(createAsyncPromise, timeoutItemProcessor(timeout), executor, timeout);\r\n}\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations __asynchronously__ using the optional\r\n * provided timeout value to schedule when the chained items will be executed, or if the input contains no promises.\r\n * It rejects immediately upon any of the input promises rejected or non-promises throwing an error,\r\n * and will reject with this first rejection message / error.\r\n * When resolved or rejected any additional chained operations will execute __asynchronously__ using the optional\r\n * timeout value to schedul when the chained item will be executed (eg. `then()`; `catch()`; `finally()`).\r\n * @group Async\r\n * @group Promise\r\n * @group All\r\n * @param input - The array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n * @returns\r\n *
    \r\n *
  • An already resolved `Promise`, if the input passed is empty.\r\n *
  • A pending `Promise` in all other cases. This returned promise is then resolved/rejected __synchronously__\r\n * (as soon as the pending items is empty) when all the promises in the given input have resolved, or if any of the\r\n * promises reject.\r\n *
\r\n */\r\nexport const createAsyncAllPromise: (input: Iterable>, timeout?: number) => IPromise = /*#__PURE__*/_createAllPromise(createAsyncPromise);\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that is already resolved with the given value. If the value passed is\r\n * a promise then that promise is returned instead of creating a new asynchronous promise instance.\r\n * If a new instance is returned then any chained operations will execute __asynchronously__ using the optional\r\n * timeout value to schedule when the chained items will be executed.(eg. `then()`; `finally()`).\r\n * @group Async\r\n * @group Promise\r\n * @group Resolved\r\n * @param value - The value to be used by this `Promise`. Can also be a `Promise` or a thenable to resolve.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport const createAsyncResolvedPromise: (value: T, timeout?: number) => IPromise = /*#__PURE__*/_createResolvedPromise(createAsyncPromise);\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that is already rejected with the given reason.\r\n * Any chained operations will execute __asynchronously__ using the optional timeout value to schedule\r\n * when then chained items will be executed. (eg. `catch()`; `finally()`).\r\n * @group Async\r\n * @group Promise\r\n * @group Rejected\r\n * @param reason - The rejection reason\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport const createAsyncRejectedPromise: (reason: any, timeout?: number) => IPromise = /*#__PURE__*/_createRejectedPromise(createAsyncPromise);\r\n\r\n/**\r\n * Returns a single Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations based on the\r\n * {@link createAsyncPromise | Asynchronous} promise implementation. Any chained operations will execute\r\n * __asynchronously__ when the final operation pending promises have resolved, or if the input contains\r\n * no promises. It will resolve only after all of the input promises have either resolved or rejected,\r\n * and will resolve with an array of {@link IPromiseResult } objects that each describe the outcome of\r\n * each promise.\r\n * @since 0.5.0\r\n * @group Async\r\n * @group Promise\r\n * @group AllSettled\r\n * @param values - The iterator of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n *\r\n * @example\r\n * ```ts\r\n * const promises = [\r\n * createResolvedPromise(1),\r\n * createResolvedPromise(2),\r\n * createResolvedPromise(3),\r\n * createRejectedPromise(\"error\"),\r\n * ];\r\n *\r\n * const results = await createAllSettledPromise(promises);\r\n *\r\n * // results is:\r\n * // [\r\n * // { status: \"fulfilled\", value: 1 },\r\n * // { status: \"fulfilled\", value: 2 },\r\n * // { status: \"fulfilled\", value: 3 },\r\n * // { status: \"rejected\", reason: \"error\" }\r\n * // ]\r\n * ```\r\n */\r\nexport function createAsyncAllSettledPromise(values: Iterable>, timeout?: number): IPromise>[]>;\r\n\r\n/**\r\n * Returns a single Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations based on the\r\n * {@link createAsyncPromise | Asynchronous} promise implementation. Any chained operations will execute\r\n * __asynchronously__ when the final operation pending promises have resolved, or if the input contains\r\n * no promises. It will resolve only after all of the input promises have either resolved or rejected,\r\n * and will resolve with an array of {@link IPromiseResult } objects that each describe the outcome of\r\n * each promise.\r\n * @since 0.5.0\r\n * @group Async\r\n * @group Promise\r\n * @group AllSettled\r\n * @param input - An array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n *\r\n * @example\r\n * ```ts\r\n * const promises = [\r\n * createResolvedPromise(1),\r\n * createResolvedPromise(2),\r\n * createResolvedPromise(3),\r\n * createRejectedPromise(\"error\"),\r\n * ];\r\n *\r\n * const results = await createAllSettledPromise(promises);\r\n *\r\n * // results is:\r\n * // [\r\n * // { status: \"fulfilled\", value: 1 },\r\n * // { status: \"fulfilled\", value: 2 },\r\n * // { status: \"fulfilled\", value: 3 },\r\n * // { status: \"rejected\", reason: \"error\" }\r\n * // ]\r\n * ```\r\n */\r\nexport function createAsyncAllSettledPromise(input: T, timeout?: number): IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }> {\r\n !_allAsyncSettledCreator && (_allAsyncSettledCreator = _createAllSettledPromise(createAsyncPromise));\r\n return _allAsyncSettledCreator.v(input, timeout);\r\n}\r\n\r\n/**\r\n * The `createAsyncRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createAsyncRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Async\r\n * @group Promise\r\n * @group Race\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise is still\r\n * asynchronously settled.\r\n */\r\nexport function createAsyncRacePromise(values: Iterable>, timeout?: number): IPromise>;\r\n\r\n/**\r\n * The `createAsyncRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createAsyncRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Async\r\n * @group Promise\r\n * @group Race\r\n * @param values - An the array of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise is still\r\n * asynchronously settled.\r\n */\r\nexport function createAsyncRacePromise(values: T, timeout?: number): IPromise> {\r\n !_raceAsyncCreator && (_raceAsyncCreator = _createRacePromise(createAsyncPromise));\r\n return _raceAsyncCreator.v(values, timeout);\r\n}\r\n\r\n/**\r\n * The `createAsyncAnyPromise` method takes an iterable of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Async\r\n * @group Promise\r\n * @group Any\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\nexport function createAsyncAnyPromise(values: Iterable>, timeout?: number): IPromise>;\r\n \r\n/**\r\n * The `createAsyncAnyPromise` method takes an array of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Async\r\n * @group Promise\r\n * @group Any\r\n * @param values - An Array promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\nexport function createAsyncAnyPromise(values: T, timeout?: number): IPromise> {\r\n !_anyAsyncCreator && (_anyAsyncCreator = _createAnyPromise(createAsyncPromise));\r\n return _anyAsyncCreator.v(values, timeout);\r\n}","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { createAsyncPromise } from \"./asyncPromise\";\r\nimport { _createAllPromise, _createAllSettledPromise, _createAnyPromise, _createRacePromise, _createRejectedPromise, _createResolvedPromise } from \"./base\";\r\nimport { IPromise } from \"../interfaces/IPromise\";\r\nimport { ePromiseState, STRING_STATES } from \"../internal/state\";\r\nimport { PromiseExecutor } from \"../interfaces/types\";\r\nimport { dumpObj, isFunction, objDefineProp, throwTypeError, getInst, ICachedValue, createCachedValue, safe } from \"@nevware21/ts-utils\";\r\nimport { STR_PROMISE } from \"../internal/constants\";\r\nimport { IPromiseResult } from \"../interfaces/IPromiseResult\";\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Flag to determine if the native Promise class should be used if available, used for testing purposes.\r\n */\r\nlet _useNative: boolean = true;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Cached value for the native Promise class\r\n */\r\nlet _promiseCls: ICachedValue;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Cached value for the `Promise.all` method\r\n */\r\nlet _allCreator: ICachedValue<(input: Iterable>, ...additionalArgs: any) => IPromise[]>>;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Cached value for the `Promise.allSettled` method\r\n */\r\nlet _allNativeSettledCreator: ICachedValue<(input: T, timeout?: number) => IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }>>;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Cached value for the `Promise.race` method\r\n */\r\nlet _raceNativeCreator: ICachedValue<(values: T, timeout?: number) => IPromise>>;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Cached value for the `Promise.any` method\r\n */\r\nlet _anyNativeCreator: ICachedValue<(values: T, timeout?: number) => IPromise>>;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Test Hook function to clear the cached values and set whether to use the native Promise class\r\n * @param useNative - Flag to determine if the native Promise class should be used if available\r\n */\r\nexport function _clearPromiseCache(useNative: boolean) {\r\n//#ifdef _DEBUG\r\n//#:(!_DEBUG) _useNative = !!useNative;\r\n//#:(!_DEBUG) _promiseCls = null as any;\r\n//#:(!_DEBUG) _allCreator = null as any;\r\n//#:(!_DEBUG) _allNativeSettledCreator = null as any;\r\n//#:(!_DEBUG) _raceNativeCreator = null as any;\r\n//#:(!_DEBUG) _anyNativeCreator = null as any;\r\n//#endif\r\n}\r\n\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createNativePromiseHelper(name: string, func: () => ICachedValue): ICachedValue {\r\n !_promiseCls && (_promiseCls = createCachedValue((_useNative && safe(getInst, [STR_PROMISE]).v) || null as any));\r\n if (_promiseCls.v && _promiseCls.v[name]) {\r\n return createCachedValue(function(input: T, timeout?: number) {\r\n return createNativePromise((resolve, reject) => {\r\n _promiseCls.v[name](input).then(resolve, reject);\r\n });\r\n } as F);\r\n }\r\n \r\n return func();\r\n}\r\n\r\n/**\r\n * Creates a Promise instance that when resolved or rejected will execute it's pending chained operations using the\r\n * available native Promise implementation.\r\n * If runtime does not support native `Promise` class (or no polyfill is available) this function will fallback to using\r\n * `createAsyncPromise` which will resolve them __asynchronously__ using the optional provided timeout value to\r\n * schedule when the chained items will be executed.\r\n * @group Alias\r\n * @group Promise\r\n * @group Native\r\n * @param executor - The function to be executed during the creation of the promise. Any errors thrown in the executor will\r\n * cause the promise to be rejected. The return value of the executor is always ignored\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport function createNativePromise(executor: PromiseExecutor, timeout?: number): IPromise {\r\n !_promiseCls && (_promiseCls = createCachedValue((_useNative && safe(getInst, [STR_PROMISE]).v) || null as any));\r\n const PrmCls = _promiseCls.v;\r\n if (!PrmCls) {\r\n return createAsyncPromise(executor);\r\n }\r\n\r\n if (!isFunction(executor)) {\r\n throwTypeError(STR_PROMISE + \": executor is not a function - \" + dumpObj(executor));\r\n }\r\n\r\n let _state = ePromiseState.Pending;\r\n\r\n function _strState() {\r\n return STRING_STATES[_state];\r\n }\r\n\r\n let thePromise = new PrmCls((resolve, reject) => {\r\n function _resolve(value: T) {\r\n _state = ePromiseState.Resolved;\r\n resolve(value);\r\n }\r\n\r\n function _reject(reason: any) {\r\n _state = ePromiseState.Rejected;\r\n reject(reason);\r\n }\r\n\r\n executor(_resolve, _reject);\r\n\r\n }) as IPromise;\r\n\r\n objDefineProp(thePromise, \"state\", {\r\n get: _strState\r\n });\r\n\r\n return thePromise;\r\n}\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations __asynchronously__ using the optional\r\n * provided timeout value to schedule when the chained items will be executed, or if the input contains no promises.\r\n * It rejects immediately upon any of the input promises rejected or non-promises throwing an error,\r\n * and will reject with this first rejection message / error.\r\n * If the runtime doesn't support the Promise.all it will fallback back to an asynchronous Promise implementation.\r\n * @group Alias\r\n * @group Promise\r\n * @group All\r\n * @group Native\r\n * @param input - The array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n * @returns\r\n *
    \r\n *
  • An already resolved `Promise`, if the input passed is empty.\r\n *
  • A pending `Promise` in all other cases. This returned promise is then resolved/rejected __synchronously__\r\n * (as soon as the pending items is empty) when all the promises in the given input have resolved, or if any of the\r\n * promises reject.\r\n *
\r\n */\r\nexport function createNativeAllPromise(input: Iterable>, timeout?: number): IPromise {\r\n !_allCreator && (_allCreator = _createNativePromiseHelper(\"all\", () => createCachedValue(_createAllPromise(createNativePromise))));\r\n return _allCreator.v(input, timeout);\r\n}\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that is already resolved with the given value. If the value passed is\r\n * a promise then that promise is returned instead of creating a new asynchronous promise instance.\r\n * If a new instance is returned then any chained operations will execute __asynchronously__ using the optional\r\n * timeout value to schedule when the chained items will be executed.(eg. `then()`; `finally()`).\r\n * @group Alias\r\n * @group Promise\r\n * @group Resolved\r\n * @group Native\r\n * @param value - The value to be used by this `Promise`. Can also be a `Promise` or a thenable to resolve.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport const createNativeResolvedPromise: (value: T, timeout?: number) => Promise = /*#__PURE__*/_createResolvedPromise(createNativePromise);\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that is already rejected with the given reason.\r\n * Any chained operations will execute __asynchronously__ using the optional timeout value to schedule\r\n * when then chained items will be executed. (eg. `catch()`; `finally()`).\r\n * @group Alias\r\n * @group Promise\r\n * @group Rejected\r\n * @group Native\r\n * @param reason - The rejection reason\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport const createNativeRejectedPromise: (reason: any, timeout?: number) => Promise = /*#__PURE__*/_createRejectedPromise(createNativePromise);\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations using {@link createNativePromise | native}\r\n * environment promise implementation, if the runtime does not provide any native then the optional provided\r\n * timeout value will be used to schedule when the chained items will be executed or if the input contains no promises.\r\n * It will resolve only after all of the input promises have either resolved or rejected, and will resolve with an array\r\n * of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group AllSettled\r\n * @group Native\r\n * @param values - The iterator of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n *\r\n * @example\r\n * ```ts\r\n * const promises = [\r\n * createNativeResolvedPromise(1),\r\n * createNativeResolvedPromise(2),\r\n * createNativeResolvedPromise(3),\r\n * createNativeRejectedPromise(\"error\"),\r\n * ];\r\n *\r\n * const results = await createNativeAllSettledPromise(promises);\r\n *\r\n * // results is:\r\n * // [\r\n * // { status: \"fulfilled\", value: 1 },\r\n * // { status: \"fulfilled\", value: 2 },\r\n * // { status: \"fulfilled\", value: 3 },\r\n * // { status: \"rejected\", reason: \"error\" }\r\n * // ]\r\n * ```\r\n */\r\nexport function createNativeAllSettledPromise(values: Iterable>, timeout?: number): IPromise>[]>;\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations using {@link createNativePromise | native}\r\n * environment promise implementation, if the runtime does not provide any native then the optional provided\r\n * timeout value will be used to schedule when the chained items will be executed or if the input contains no promises.\r\n * It will resolve only after all of the input promises have either resolved or rejected, and will resolve with an array\r\n * of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group AllSettled\r\n * @group Native\r\n * @param input - An array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n *\r\n * @example\r\n * ```ts\r\n * const promises = [\r\n * createNativeResolvedPromise(1),\r\n * createNativeResolvedPromise(2),\r\n * createNativeResolvedPromise(3),\r\n * createNativeRejectedPromise(\"error\"),\r\n * ];\r\n *\r\n * const results = await createNativeAllSettledPromise(promises);\r\n *\r\n * // results is:\r\n * // [\r\n * // { status: \"fulfilled\", value: 1 },\r\n * // { status: \"fulfilled\", value: 2 },\r\n * // { status: \"fulfilled\", value: 3 },\r\n * // { status: \"rejected\", reason: \"error\" }\r\n * // ]\r\n * ```\r\n */\r\nexport function createNativeAllSettledPromise(input: T, timeout?: number): IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }> {\r\n !_allNativeSettledCreator && (_allNativeSettledCreator = _createNativePromiseHelper(\"allSettled\", () => _createAllSettledPromise(createNativePromise)));\r\n return _allNativeSettledCreator.v(input, timeout);\r\n}\r\n\r\n/**\r\n * The `createNativeRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createNativeRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group Race\r\n * @group Native\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise will settle\r\n * asynchronously.\r\n */\r\nexport function createNativeRacePromise(values: Iterable>, timeout?: number): IPromise>;\r\n\r\n/**\r\n * The `createNativeRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createNativeRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group Race\r\n * @group Native\r\n * @param values - An the array of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise will settle\r\n * asynchronously.\r\n */\r\nexport function createNativeRacePromise(values: T, timeout?: number): IPromise> {\r\n !_raceNativeCreator && (_raceNativeCreator = _createNativePromiseHelper(\"race\", () => _createRacePromise(createNativePromise)));\r\n return _raceNativeCreator.v(values, timeout);\r\n}\r\n\r\n/**\r\n * The `createNativeAnyPromise` method takes an iterable of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group Any\r\n * @group Native\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\nexport function createNativeAnyPromise(values: Iterable>, timeout?: number): IPromise>;\r\n \r\n/**\r\n * The `createNativeAnyPromise` method takes an array of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group Any\r\n * @group Native\r\n * @param values - An Array promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\nexport function createNativeAnyPromise(values: T, timeout?: number): IPromise> {\r\n !_anyNativeCreator && (_anyNativeCreator = _createNativePromiseHelper(\"any\", () => _createAnyPromise(createNativePromise)));\r\n return _anyNativeCreator.v(values, timeout);\r\n}\r\n","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport {\r\n _createAllPromise, _createAllSettledPromise, _createAnyPromise, _createPromise, _createRacePromise,\r\n _createRejectedPromise, _createResolvedPromise\r\n} from \"./base\";\r\nimport { IPromise } from \"../interfaces/IPromise\";\r\nimport { syncItemProcessor } from \"./itemProcessor\";\r\nimport { PromiseExecutor } from \"../interfaces/types\";\r\nimport { IPromiseResult } from \"../interfaces/IPromiseResult\";\r\nimport { ICachedValue } from \"@nevware21/ts-utils\";\r\n\r\nlet _allSyncSettledCreator: ICachedValue<(input: T, timeout?: number) => IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }>>;\r\nlet _raceSyncCreator: ICachedValue<(values: T, timeout?: number) => IPromise>>;\r\nlet _anySyncCreator: ICachedValue<(values: T, timeout?: number) => IPromise>>;\r\n\r\n/**\r\n * Creates a synchronous Promise instance that when resolved or rejected will execute it's pending chained operations\r\n * __synchronously__ in the same execution cycle as the operation that calls the `executors`, `resolve` or `reject` functions.\r\n *\r\n * @group Synchronous\r\n * @group Promise\r\n * @param executor - The function to be executed during the creation of the promise. Any errors thrown in the executor will\r\n * cause the promise to be rejected. The return value of the executor is always ignored\r\n */\r\nexport function createSyncPromise(executor: PromiseExecutor): IPromise {\r\n return _createPromise(createSyncPromise, syncItemProcessor, executor);\r\n}\r\n\r\n/**\r\n * Returns a single synchronous Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations __synchronously__ in the same\r\n * execution cycle as the final operation pending promises have resolved, or if the input contains no promises.\r\n * It rejects immediately upon any of the input promises rejected or non-promises throwing an error,\r\n * and will reject with this first rejection message / error.\r\n * When resolved or rejected any additional chained operations will execute __synchronously__ at the point of\r\n * being added (eg. `then()`; `catch()`; `finally()`).\r\n * @group Synchronous\r\n * @group Promise\r\n * @group All\r\n * @param input - The array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @returns\r\n *
    \r\n *
  • An already resolved `Promise`, if the input passed is empty.\r\n *
  • A pending `Promise` in all other cases. This returned promise is then resolved/rejected __synchronously__\r\n * (as soon as the pending items is empty) when all the promises in the given input have resolved, or if any of the\r\n * promises reject.\r\n *
\r\n */\r\nexport const createSyncAllPromise: (input: Iterable>) => IPromise = /*#__PURE__*/_createAllPromise(createSyncPromise);\r\n\r\n/**\r\n * Returns a single synchronous Promise instance that is already resolved with the given value. If the value passed is\r\n * a promise then that promise is returned instead of creating a new synchronous promise instance.\r\n * If a new instance is returned then any chained operations will execute __synchronously__ at the point of being\r\n * added (calling `then()`).\r\n * @group Synchronous\r\n * @group Promise\r\n * @group Resolved\r\n * @param value - The value to be used by this `Promise`. Can also be a `Promise` or a thenable to resolve.\r\n */\r\nexport const createSyncResolvedPromise: (value: T) => IPromise = /*#__PURE__*/_createResolvedPromise(createSyncPromise);\r\n\r\n/**\r\n * Returns a single synchronous Promise instance that is already rejected with the given reason.\r\n * Any chained operations will execute __synchronously__ at the point of being added (eg. `catch()`; `finally()`).\r\n * @group Synchronous\r\n * @group Promise\r\n * @group Rejected\r\n * @param reason - The rejection reason\r\n */\r\nexport const createSyncRejectedPromise: (reason: any) => IPromise = /*#__PURE__*/_createRejectedPromise(createSyncPromise);\r\n\r\n/**\r\n * Returns a single Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations based on the\r\n * {@link createSyncPromise | synchronous} promise implementation. Any chained operations will execute\r\n * __synchronously__ in the same execution cycle as the final operation pending promises have resolved,\r\n * or if the input contains no promises. It will resolve only after all of the input promises have either\r\n * resolved or rejected, and will resolve with an array of {@link IPromiseResult } objects that each describe\r\n * the outcome of each promise.\r\n * @since 0.5.0\r\n * @group Synchronous\r\n * @group Promise\r\n * @group AllSettled\r\n * @param values - The iterator of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n *\r\n * @example\r\n * ```ts\r\n * const promises = [\r\n * createResolvedPromise(1),\r\n * createResolvedPromise(2),\r\n * createResolvedPromise(3),\r\n * createRejectedPromise(\"error\"),\r\n * ];\r\n *\r\n * const results = await createAllSettledPromise(promises);\r\n *\r\n * // results is:\r\n * // [\r\n * // { status: \"fulfilled\", value: 1 },\r\n * // { status: \"fulfilled\", value: 2 },\r\n * // { status: \"fulfilled\", value: 3 },\r\n * // { status: \"rejected\", reason: \"error\" }\r\n * // ]\r\n * ```\r\n */\r\nexport function createSyncAllSettledPromise(values: Iterable>, timeout?: number): IPromise>[]>;\r\n\r\n/**\r\n * Returns a single Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations based on the\r\n * {@link createSyncPromise | synchronous} promise implementation. Any chained operations will execute\r\n * __synchronously__ in the same execution cycle as the final operation pending promises have resolved,\r\n * or if the input contains no promises. It will resolve only after all of the input promises have either\r\n * resolved or rejected, and will resolve with an array of {@link IPromiseResult } objects that each describe\r\n * the outcome of each promise.\r\n * @since 0.5.0\r\n * @group Synchronous\r\n * @group Promise\r\n * @group AllSettled\r\n * @param input - An array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n *\r\n * @example\r\n * ```ts\r\n * const promises = [\r\n * createResolvedPromise(1),\r\n * createResolvedPromise(2),\r\n * createResolvedPromise(3),\r\n * createRejectedPromise(\"error\"),\r\n * ];\r\n *\r\n * const results = await createAllSettledPromise(promises);\r\n *\r\n * // results is:\r\n * // [\r\n * // { status: \"fulfilled\", value: 1 },\r\n * // { status: \"fulfilled\", value: 2 },\r\n * // { status: \"fulfilled\", value: 3 },\r\n * // { status: \"rejected\", reason: \"error\" }\r\n * // ]\r\n * ```\r\n */\r\nexport function createSyncAllSettledPromise(input: T, timeout?: number): IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }> {\r\n !_allSyncSettledCreator && (_allSyncSettledCreator = _createAllSettledPromise(createSyncPromise));\r\n return _allSyncSettledCreator.v(input, timeout);\r\n}\r\n\r\n/**\r\n * The `createSyncRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createSyncRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Synchronous\r\n * @group Promise\r\n * @group Race\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise will settle\r\n * synchronously.\r\n */\r\nexport function createSyncRacePromise(values: Iterable>, timeout?: number): IPromise>;\r\n\r\n/**\r\n * The `createSyncRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createSyncRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Synchronous\r\n * @group Promise\r\n * @group Race\r\n * @param values - An the array of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise will settle\r\n * synchronously.\r\n */\r\nexport function createSyncRacePromise(values: T, timeout?: number): IPromise> {\r\n !_raceSyncCreator && (_raceSyncCreator = _createRacePromise(createSyncPromise));\r\n return _raceSyncCreator.v(values, timeout);\r\n}\r\n\r\n/**\r\n * The `createSyncAnyPromise` method takes an iterable of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Synchronous\r\n * @group Promise\r\n * @group Any\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\nexport function createSyncAnyPromise(values: Iterable>, timeout?: number): IPromise>;\r\n \r\n/**\r\n * The `createSyncAnyPromise` method takes an array of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Synchronous\r\n * @group Promise\r\n * @group Any\r\n * @param values - An Array promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\nexport function createSyncAnyPromise(values: T, timeout?: number): IPromise> {\r\n !_anySyncCreator && (_anySyncCreator = _createAnyPromise(createSyncPromise));\r\n return _anySyncCreator.v(values, timeout);\r\n}","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ICachedValue, isUndefined } from \"@nevware21/ts-utils\";\r\nimport { _createAllPromise, _createAllSettledPromise, _createAnyPromise, _createPromise, _createRacePromise, _createRejectedPromise, _createResolvedPromise } from \"./base\";\r\nimport { IPromise } from \"../interfaces/IPromise\";\r\nimport { idleItemProcessor } from \"./itemProcessor\";\r\nimport { PromiseExecutor } from \"../interfaces/types\";\r\nimport { IPromiseResult } from \"../interfaces/IPromiseResult\";\r\nimport { _pureAssign } from \"../internal/treeshake_helpers\";\r\n\r\nlet _defaultIdleTimeout: number | undefined;\r\n\r\nlet _allIdleSettledCreator: ICachedValue<(input: T, timeout?: number) => IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }>>;\r\nlet _raceIdleCreator: ICachedValue<(values: T, timeout?: number) => IPromise>>;\r\nlet _anyIdleCreator: ICachedValue<(values: T, timeout?: number) => IPromise>>;\r\n\r\n/**\r\n * Sets the global default idle timeout / deadline to use when no timeout is passed during promise creation.\r\n * @param idleDeadline - Specifies the time in milliseconds to use as the idle timeout / deadline by when any\r\n * outstanding chained items should be executed.\r\n * @group Idle\r\n */\r\nexport function setDefaultIdlePromiseTimeout(idleDeadline?: number | undefined) {\r\n _defaultIdleTimeout = idleDeadline;\r\n}\r\n\r\n/**\r\n * @deprecated Use `setDefaultIdlePromiseTimeout` instead\r\n * Sets the global default idle timeout / deadline to use when no timeout is passed during promise creation.\r\n * @param idleDeadline - Specifies the time in milliseconds to use as the idle timeout / deadline by when any\r\n * outstanding chained items should be executed.\r\n * @group Idle\r\n */\r\nexport const setDefaultIdleTimeout = (/*#__PURE__*/_pureAssign(setDefaultIdlePromiseTimeout));\r\n\r\n/**\r\n * Creates an idle Promise instance that when resolved or rejected will execute it's pending chained operations\r\n * __asynchronously__ using the `requestIdleCallback` API (if available) with the optional provided timeout value to\r\n * schedule when the chained items will be executed. When `requestIdleCallback` is not available this becomes the same as\r\n * `createAsyncPromise` which uses `setTimeout` to schedule executions.\r\n * @group Idle\r\n * @group Promise\r\n * @param executor - The function to be executed during the creation of the promise. Any errors thrown in the executor will\r\n * cause the promise to be rejected. The return value of the executor is always ignored\r\n * @param timeout - Optional deadline timeout to wait before processing the items, defaults to undefined. If the number of\r\n * milliseconds represented by this parameter has elapsed and the callback has not already been called, then a task to execute\r\n * the callback is queued in the event loop (even if doing so risks causing a negative performance impact). timeout must be a\r\n * positive value or it is ignored.\r\n */\r\nexport function createIdlePromise(executor: PromiseExecutor, timeout?: number): IPromise {\r\n let theTimeout = isUndefined(timeout) ? _defaultIdleTimeout : timeout;\r\n return _createPromise(createIdlePromise, idleItemProcessor(theTimeout), executor, theTimeout);\r\n}\r\n\r\n/**\r\n * Returns an idle Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations __asynchronously__\r\n * using the `requestIdleCallback` API (if available) with the optional provided timeout value to\r\n * schedule when the chained items will be executed.\r\n * It rejects immediately upon any of the input promises rejected or non-promises throwing an error,\r\n * and will reject with this first rejection message / error.\r\n * When resolved or rejected any additional chained operations will execute __asynchronously__ using\r\n * the `requestIdleCallback` API (if available) with the optional provided timeout value to schedule\r\n * when the chained items will be executed. (eg. `then()`; `catch()`; `finally()`).\r\n * @group Idle\r\n * @group Promise\r\n * @group All\r\n * @param input - The array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional deadline timeout to wait before processing the items, defaults to undefined. If the number of\r\n * milliseconds represented by this parameter has elapsed and the callback has not already been called, then a task to execute\r\n * the callback is queued in the event loop (even if doing so risks causing a negative performance impact). timeout must be a\r\n * positive value or it is ignored.\r\n * @returns\r\n *
    \r\n *
  • An already resolved `Promise`, if the input passed is empty.\r\n *
  • A pending `Promise` in all other cases. This returned promise is then resolved/rejected __synchronously__\r\n * (as soon as the pending items is empty) when all the promises in the given input have resolved, or if any of the\r\n * promises reject.\r\n *
\r\n */\r\nexport const createIdleAllPromise: (input: Iterable>, timeout?: number) => IPromise = /*#__PURE__*/_createAllPromise(createIdlePromise);\r\n\r\n/**\r\n * Returns an idle Promise instance that is already resolved with the given value. If the value passed is\r\n * a promise then that promise is returned instead of creating a new asynchronous promise instance.\r\n * If a new instance is returned then any chained operations will execute __asynchronously__ using the\r\n * `requestIdleCallback` API (if available) with the optional provided timeout value to schedule when\r\n * the chained items will be executed. (eg. `then()`; `finally()`).\r\n * @group Idle\r\n * @group Promise\r\n * @group Resolved\r\n * @param value - The value to be used by this `Promise`. Can also be a `Promise` or a thenable to resolve.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport const createIdleResolvedPromise: (value: T, timeout?: number) => IPromise = /*#__PURE__*/_createResolvedPromise(createIdlePromise);\r\n\r\n/**\r\n * Returns an idle Promise instance that is already rejected with the given reason.\r\n * Any chained operations will execute __asynchronously__ using the o`requestIdleCallback` API\r\n * (if available) with the optional provided timeout value to schedule when the chained items will\r\n * be executed. (eg. `catch()`; `finally()`).\r\n * @group Idle\r\n * @group Promise\r\n * @group Rejected\r\n * @param reason - The rejection reason\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport const createIdleRejectedPromise: (reason: any, timeout?: number) => IPromise = /*#__PURE__*/_createRejectedPromise(createIdlePromise);\r\n\r\n/**\r\n * Returns a single Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations based on the\r\n * {@link createIdlePromise | idle} promise implementation. Any chained operations will execute\r\n * __asynchronously__ when the environment is idle as the final operation pending promises have resolved,\r\n * or if the input contains no promises. It will resolve only after all of the input promises have either\r\n * resolved or rejected, and will resolve with an array of {@link IPromiseResult } objects that each describe\r\n * the outcome of each promise.\r\n * @since 0.5.0\r\n * @group Idle\r\n * @group Promise\r\n * @group AllSettled\r\n * @param values - The iterator of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n *\r\n * @example\r\n * ```ts\r\n * const promises = [\r\n * createResolvedPromise(1),\r\n * createResolvedPromise(2),\r\n * createResolvedPromise(3),\r\n * createRejectedPromise(\"error\"),\r\n * ];\r\n *\r\n * const results = await createAllSettledPromise(promises);\r\n *\r\n * // results is:\r\n * // [\r\n * // { status: \"fulfilled\", value: 1 },\r\n * // { status: \"fulfilled\", value: 2 },\r\n * // { status: \"fulfilled\", value: 3 },\r\n * // { status: \"rejected\", reason: \"error\" }\r\n * // ]\r\n * ```\r\n */\r\nexport function createIdleAllSettledPromise(values: Iterable>, timeout?: number): IPromise>[]>;\r\n\r\n/**\r\n * Returns a single Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations based on the\r\n * {@link createIdlePromise | idle} promise implementation. Any chained operations will execute\r\n * __asynchronously__ when the environment is idle as the final operation pending promises have resolved,\r\n * or if the input contains no promises. It will resolve only after all of the input promises have either\r\n * resolved or rejected, and will resolve with an array of {@link IPromiseResult } objects that each describe\r\n * the outcome of each promise.\r\n * @since 0.5.0\r\n * @group Idle\r\n * @group Promise\r\n * @group AllSettled\r\n * @param input - An array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n *\r\n * @example\r\n * ```ts\r\n * const promises = [\r\n * createResolvedPromise(1),\r\n * createResolvedPromise(2),\r\n * createResolvedPromise(3),\r\n * createRejectedPromise(\"error\"),\r\n * ];\r\n *\r\n * const results = await createAllSettledPromise(promises);\r\n *\r\n * // results is:\r\n * // [\r\n * // { status: \"fulfilled\", value: 1 },\r\n * // { status: \"fulfilled\", value: 2 },\r\n * // { status: \"fulfilled\", value: 3 },\r\n * // { status: \"rejected\", reason: \"error\" }\r\n * // ]\r\n * ```\r\n */\r\nexport function createIdleAllSettledPromise(input: T, timeout?: number): IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }> {\r\n !_allIdleSettledCreator && (_allIdleSettledCreator = _createAllSettledPromise(createIdlePromise));\r\n return _allIdleSettledCreator.v(input, timeout);\r\n}\r\n\r\n/**\r\n * The `createIdleRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createIdleRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Idle\r\n * @group Promise\r\n * @group Race\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise will settle\r\n * asynchronously when the system detects that the runtime is idle.\r\n */\r\nexport function createIdleRacePromise(values: Iterable>, timeout?: number): IPromise>;\r\n\r\n/**\r\n * The `createIdleRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createIdleRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Idle\r\n * @group Promise\r\n * @group Race\r\n * @param values - An the array of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise will settle\r\n * asynchronously when the system detects that the runtime is idle.\r\n */\r\nexport function createIdleRacePromise(values: T, timeout?: number): IPromise> {\r\n !_raceIdleCreator && (_raceIdleCreator = _createRacePromise(createIdlePromise));\r\n return _raceIdleCreator.v(values, timeout);\r\n}\r\n\r\n/**\r\n * The `createIdleAnyPromise` method takes an iterable of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Idle\r\n * @group Promise\r\n * @group Any\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\nexport function createIdleAnyPromise(values: Iterable>, timeout?: number): IPromise>;\r\n \r\n/**\r\n * The `createIdleAnyPromise` method takes an array of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Idle\r\n * @group Promise\r\n * @group Any\r\n * @param values - An Array promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\nexport function createIdleAnyPromise(values: T, timeout?: number): IPromise> {\r\n !_anyIdleCreator && (_anyIdleCreator = _createAnyPromise(createIdlePromise));\r\n return _anyIdleCreator.v(values, timeout);\r\n}","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { createCachedValue, ICachedValue } from \"@nevware21/ts-utils\";\r\nimport { _createAllPromise, _createAllSettledPromise, _createAnyPromise, _createRacePromise, _createRejectedPromise, _createResolvedPromise } from \"./base\";\r\nimport { IPromise } from \"../interfaces/IPromise\";\r\nimport { createNativePromise } from \"./nativePromise\";\r\nimport { PromiseExecutor } from \"../interfaces/types\";\r\nimport { IPromiseResult } from \"../interfaces/IPromiseResult\";\r\n\r\nlet _promiseCreator: ICachedValue<(executor: PromiseExecutor, timeout?: number) => IPromise>;\r\nlet _allSettledCreator: ICachedValue<(input: T, timeout?: number) => IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }>>;\r\nlet _raceCreator: ICachedValue<(values: T, timeout?: number) => IPromise>>;\r\nlet _anyCreator: ICachedValue<(values: T, timeout?: number) => IPromise>>;\r\n\r\n/**\r\n * Set the default promise implementation to use when calling `createPromise`; `createAllPromise`; `createResolvedPromise`\r\n * and `createRejectedPromise`. This is effective a global value and changing this will affect ALL callers of these\r\n * functions, as such these functions should only be used when switching implementations would have not unexpected\r\n * consequences like switching from a `createSyncPromise` to `createIdlePromise` where idle promises have a possibility\r\n * of never getting called during application shutdown or during an expected timeframe.\r\n * @group Alias\r\n * @group Promise\r\n * @param creator - The creator function to call when a new promise is required.\r\n */\r\nexport function setCreatePromiseImpl(\r\n creator: (executor: PromiseExecutor, timeout?: number) => IPromise\r\n) {\r\n _promiseCreator = creator ? createCachedValue(creator) : null;\r\n}\r\n\r\n/**\r\n * Creates a Promise instance using the current default promise creator that when resolved or rejected will execute\r\n * it's pending chained operations.\r\n * @group Alias\r\n * @group Promise\r\n * @param executor - The function to be executed during the creation of the promise. Any errors thrown in the executor will\r\n * cause the promise to be rejected. The return value of the executor is always ignored\r\n * @param timeout - [Optional] timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport function createPromise(executor: PromiseExecutor, timeout?: number): IPromise {\r\n !_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));\r\n\r\n return _promiseCreator.v.call(this, executor, timeout);\r\n}\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations __asynchronously__ using the optional\r\n * provided timeout value to schedule when the chained items will be executed, or if the input contains no promises.\r\n * It rejects immediately upon any of the input promises rejected or non-promises throwing an error,\r\n * and will reject with this first rejection message / error.\r\n * If the runtime doesn't support the Promise.all it will fallback back to an asynchronous Promise implementation.\r\n * @group Alias\r\n * @group Promise\r\n * @group All\r\n * @param input - The array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n * @returns\r\n *
    \r\n *
  • An already resolved `Promise`, if the input passed is empty.\r\n *
  • A pending `Promise` in all other cases. This returned promise is then resolved/rejected __synchronously__\r\n * (as soon as the pending items is empty) when all the promises in the given input have resolved, or if any of the\r\n * promises reject.\r\n *
\r\n */\r\nexport const createAllPromise: (input: Iterable>, timeout?: number) => IPromise = /*#__PURE__*/_createAllPromise(createPromise);\r\n\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that is already resolved with the given value. If the value passed is\r\n * a promise then that promise is returned instead of creating a new asynchronous promise instance.\r\n * If a new instance is returned then any chained operations will execute __asynchronously__ using the optional\r\n * timeout value to schedule when the chained items will be executed.(eg. `then()`; `finally()`).\r\n * @group Alias\r\n * @group Promise\r\n * @group Resolved\r\n * @param value - The value to be used by this `Promise`. Can also be a `Promise` or a thenable to resolve.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport const createResolvedPromise: (value: T, timeout?: number) => IPromise = /*#__PURE__*/_createResolvedPromise(createPromise);\r\n\r\n/**\r\n * Returns a single asynchronous Promise instance that is already rejected with the given reason.\r\n * Any chained operations will execute __asynchronously__ using the optional timeout value to schedule\r\n * when then chained items will be executed. (eg. `catch()`; `finally()`).\r\n * @group Alias\r\n * @group Promise\r\n * @group Rejected\r\n * @param reason - The rejection reason\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n */\r\nexport const createRejectedPromise: (reason: any, timeout?: number) => IPromise = /*#__PURE__*/_createRejectedPromise(createPromise);\r\n\r\n/**\r\n * Returns a single Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations based on the current\r\n * promise implementation. If the current implementation is synchronous then the chained operations will\r\n * execute __synchronously__ in the same execution cycle as the final operation pending promises have resolved,\r\n * or if the input contains no promises. If the current implementation is asynchronous then the chained\r\n * operations will execute __asynchronously__ using the optional provided timeout value to schedule when the\r\n * chained items will be executed or if the input contains no promises.\r\n * It will resolve only after all of the input promises have either resolved or rejected, and will resolve with an array\r\n * of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group AllSettled\r\n * @param values - The iterator of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n *\r\n * @example\r\n * ```ts\r\n * const promises = [\r\n * createResolvedPromise(1),\r\n * createResolvedPromise(2),\r\n * createResolvedPromise(3),\r\n * createRejectedPromise(\"error\"),\r\n * ];\r\n *\r\n * const results = await createAllSettledPromise(promises);\r\n *\r\n * // results is:\r\n * // [\r\n * // { status: \"fulfilled\", value: 1 },\r\n * // { status: \"fulfilled\", value: 2 },\r\n * // { status: \"fulfilled\", value: 3 },\r\n * // { status: \"rejected\", reason: \"error\" }\r\n * // ]\r\n * ```\r\n */\r\nexport function createAllSettledPromise(values: Iterable>, timeout?: number): IPromise>[]>;\r\n\r\n/**\r\n * Returns a single Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations based on the current\r\n * promise implementation. If the current implementation is synchronous then the chained operations will\r\n * execute __synchronously__ in the same execution cycle as the final operation pending promises have resolved,\r\n * or if the input contains no promises. If the current implementation is asynchronous then the chained\r\n * operations will execute __asynchronously__ using the optional provided timeout value to schedule when the\r\n * chained items will be executed or if the input contains no promises.\r\n * It will resolve only after all of the input promises have either resolved or rejected, and will resolve with an array\r\n * of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group AllSettled\r\n * @param input - An array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n *\r\n * @example\r\n * ```ts\r\n * const promises = [\r\n * createResolvedPromise(1),\r\n * createResolvedPromise(2),\r\n * createResolvedPromise(3),\r\n * createRejectedPromise(\"error\"),\r\n * ];\r\n *\r\n * const results = await createAllSettledPromise(promises);\r\n *\r\n * // results is:\r\n * // [\r\n * // { status: \"fulfilled\", value: 1 },\r\n * // { status: \"fulfilled\", value: 2 },\r\n * // { status: \"fulfilled\", value: 3 },\r\n * // { status: \"rejected\", reason: \"error\" }\r\n * // ]\r\n * ```\r\n */\r\nexport function createAllSettledPromise(input: T, timeout?: number): IPromise<{ -readonly [P in keyof T]: IPromiseResult>; }> {\r\n !_allSettledCreator && (_allSettledCreator = _createAllSettledPromise(createPromise));\r\n return _allSettledCreator.v(input, timeout);\r\n}\r\n\r\n/**\r\n * The `createRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group Race\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise will settle\r\n * based on the current promise implementation.\r\n */\r\nexport function createRacePromise(values: Iterable>, timeout?: number): IPromise>;\r\n\r\n/**\r\n * The `createRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group Race\r\n * @param values - An the array of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise will settle\r\n * based on the current promise implementation.\r\n */\r\nexport function createRacePromise(values: T, timeout?: number): IPromise> {\r\n !_raceCreator && (_raceCreator = _createRacePromise(createPromise));\r\n return _raceCreator.v(values, timeout);\r\n}\r\n\r\n/**\r\n * The `createAnyPromise` method takes an iterable of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group Any\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\nexport function createAnyPromise(values: Iterable>, timeout?: number): IPromise>;\r\n \r\n/**\r\n * The `createAnyPromise` method takes an array of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Alias\r\n * @group Promise\r\n * @group Any\r\n * @param values - An Array promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\nexport function createAnyPromise(values: T, timeout?: number): IPromise> {\r\n !_anyCreator && (_anyCreator = _createAnyPromise(createPromise));\r\n return _anyCreator.v(values, timeout);\r\n}","/*\r\n * @nevware21/ts-async\r\n * https://github.com/nevware21/ts-async\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { getKnownSymbol, objDefineProp, WellKnownSymbols } from \"@nevware21/ts-utils\";\r\nimport { createAsyncAllPromise, createAsyncAllSettledPromise, createAsyncAnyPromise, createAsyncPromise, createAsyncRacePromise, createAsyncRejectedPromise, createAsyncResolvedPromise } from \"../promise/asyncPromise\";\r\nimport { IPromise } from \"../interfaces/IPromise\";\r\nimport { PromiseExecutor } from \"../interfaces/types\";\r\nimport { IPromiseResult } from \"../interfaces/IPromiseResult\";\r\n\r\nconst toStringTagSymbol: symbol = getKnownSymbol(WellKnownSymbols.toStringTag) as typeof Symbol.toStringTag;\r\n\r\n/**\r\n * The PolyPromiseConstructor interface represents the constructor for the polyfill Promise object.\r\n * @since 0.5.0\r\n * @group Polyfill\r\n */\r\nexport interface PolyPromiseConstructor {\r\n /**\r\n * Creates a new Promise.\r\n * @constructor\r\n * @param executor - A callback used to initialize the promise. This callback is passed two arguments:\r\n * a resolve callback used to resolve the promise with a value or the result of another promise,\r\n * and a reject callback used to reject the promise with a provided reason or error.\r\n */\r\n new (executor: PromiseExecutor): IPromise;\r\n\r\n /**\r\n * Returns a single asynchronous Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations __asynchronously__ using the optional\r\n * provided timeout value to schedule when the chained items will be executed, or if the input contains no promises.\r\n * It rejects immediately upon any of the input promises rejected or non-promises throwing an error,\r\n * and will reject with this first rejection message / error.\r\n * When resolved or rejected any additional chained operations will execute __asynchronously__ using the optional\r\n * timeout value to schedul when the chained item will be executed (eg. `then()`; `catch()`; `finally()`).\r\n * @group Polyfill\r\n * @param input - The array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n * @returns\r\n *
    \r\n *
  • An already resolved `Promise`, if the input passed is empty.\r\n *
  • A pending `Promise` in all other cases. This returned promise is then resolved/rejected __synchronously__\r\n * (as soon as the pending items is empty) when all the promises in the given input have resolved, or if any of the\r\n * promises reject.\r\n *
\r\n */\r\n all(input: Iterable>, timeout?: number): IPromise;\r\n\r\n /**\r\n * The `createAsyncRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createAsyncRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Polyfill\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise is still\r\n * asynchronously settled.\r\n */\r\n race(values: Iterable>, timeout?: number): IPromise>;\r\n\r\n /**\r\n * The `createAsyncRacePromise` method takes an array of promises as input and returns a single Promise. This returned promise\r\n * settles with the eventual state of the first promise that settles.\r\n * @description The `createAsyncRacePromise` method is one of the promise concurrency methods. It's useful when you want the first\r\n * async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail).\r\n * If the iterable contains one or more non-promise values and/or an already settled promise, then Promise.race() will settle to\r\n * the first of these values found in the iterable.\r\n * @since 0.5.0\r\n * @group Polyfill\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A Promise that settles with the eventual state of the first promise in the iterable to settle. In other words, it fulfills if the\r\n * first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever\r\n * if the iterable passed is empty. If the iterable passed is non-empty but contains no pending promises, the returned promise is still\r\n * asynchronously settled.\r\n */\r\n race(values: T, timeout?: number): IPromise>;\r\n\r\n /**\r\n * The `createAsyncAnyPromise` method takes an iterable of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Polyfill\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\n any(values: Iterable>, timeout?: number): IPromise>;\r\n \r\n /**\r\n * The `createAsyncAnyPromise` method takes an iterable of promises as input and returns a single Promise.\r\n * This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.\r\n * It rejects when all of the input's promises reject (including when an empty iterable is passed), with an\r\n * AggregateError containing an array of rejection reasons.\r\n * @since 0.5.0\r\n * @group Polyfill\r\n * @param values - An iterable object of promises.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A new Promise that is:\r\n * - Already rejected, if the iterable passed is empty.\r\n * - Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value\r\n * is the fulfillment value of the first promise that was fulfilled.\r\n * - Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is\r\n * an AggregateError containing an array of rejection reasons in its errors property. The errors are in the\r\n * order of the promises passed, regardless of completion order. If the iterable passed is non-empty but\r\n * contains no pending promises, the returned promise is still asynchronously (instead of synchronously)\r\n * rejected.\r\n */\r\n any(values: T, timeout?: number): IPromise>;\r\n\r\n /**\r\n * Returns a single asynchronous Promise instance that is already rejected with the given reason.\r\n * Any chained operations will execute __asynchronously__ using the optional timeout value to schedule\r\n * when then chained items will be executed. (eg. `catch()`; `finally()`).\r\n * @group Polyfill\r\n * @param reason - The rejection reason\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n * @returns A rejected promise.\r\n */\r\n reject(reason?: any, timeout?: number): IPromise;\r\n \r\n /**\r\n * Returns a single asynchronous Promise instance that is already resolved with the given value. If the value passed is\r\n * a promise then that promise is returned instead of creating a new asynchronous promise instance.\r\n * If a new instance is returned then any chained operations will execute __asynchronously__ using the optional\r\n * timeout value to schedule when the chained items will be executed.(eg. `then()`; `finally()`).\r\n * @group Polyfill\r\n * @returns A resolved promise.\r\n */\r\n resolve(): IPromise;\r\n \r\n /**\r\n * Returns a single asynchronous Promise instance that is already resolved with the given value. If the value passed is\r\n * a promise then that promise is returned instead of creating a new asynchronous promise instance.\r\n * If a new instance is returned then any chained operations will execute __asynchronously__ using the optional\r\n * timeout value to schedule when the chained items will be executed.(eg. `then()`; `finally()`).\r\n * @group Polyfill\r\n * @param value - The value to be used by this `Promise`. Can also be a `Promise` or a thenable to resolve.\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero.\r\n * @returns A resolved promise.\r\n */\r\n resolve(value: T | PromiseLike, timeout?: number): IPromise;\r\n\r\n /**\r\n * Returns a single Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations based on the\r\n * {@link createAsyncPromise | Asynchronous} promise implementation. Any chained operations will execute\r\n * __asynchronously__ when the final operation pending promises have resolved, or if the input contains\r\n * no promises. It will resolve only after all of the input promises have either resolved or rejected,\r\n * and will resolve with an array of {@link IPromiseResult } objects that each describe the outcome of\r\n * each promise.\r\n * @since 0.5.0\r\n * @group Polyfill\r\n * @param values - An array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n */\r\n allSettled(values: T, timeout?: number): Promise<{ -readonly [P in keyof T]: IPromiseResult>; }>;\r\n\r\n /**\r\n * Returns a single Promise instance that resolves to an array of the results from the input promises.\r\n * This returned promise will resolve and execute it's pending chained operations based on the\r\n * {@link createAsyncPromise | Asynchronous} promise implementation. Any chained operations will execute\r\n * __asynchronously__ when the final operation pending promises have resolved, or if the input contains\r\n * no promises. It will resolve only after all of the input promises have either resolved or rejected,\r\n * and will resolve with an array of {@link IPromiseResult } objects that each describe the outcome of\r\n * each promise.\r\n * @since 0.5.0\r\n * @group Polyfill\r\n * @param values - An array of promises to wait to be resolved / rejected before resolving or rejecting the new promise\r\n * @param timeout - Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.\r\n * @returns A pending `Promise` that will resolve to an array of {@link IPromiseResult } objects that each describe the outcome of each promise.\r\n */\r\n allSettled(values: Iterable>, timeout?: number): IPromise>[]>;\r\n}\r\n\r\n/**\r\n * A full polyfill for the Promise class.\r\n * Represents the completion of an asynchronous operation, and its resulting value.\r\n * @since 0.5.0\r\n * @class\r\n * @group Polyfill\r\n * @group Promise\r\n */\r\nexport let PolyPromise = /*#__PURE__*/(function () {\r\n /**\r\n * Creates a new Promise.\r\n * @constructor\r\n * @param executor - A callback used to initialize the promise. This callback is passed two arguments:\r\n * a resolve callback used to resolve the promise with a value or the result of another promise,\r\n * and a reject callback used to reject the promise with a provided reason or error.\r\n */\r\n function PolyPromiseImpl(executor: PromiseExecutor) {\r\n this._$ = createAsyncPromise(executor);\r\n if (toStringTagSymbol) {\r\n this[toStringTagSymbol] = \"Promise\";\r\n }\r\n // Re-Expose the state of the underlying promise\r\n objDefineProp(this, \"state\", {\r\n get: function() {\r\n return this._$.state;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n */\r\n PolyPromiseImpl.all = createAsyncAllPromise;\r\n PolyPromiseImpl.race = createAsyncRacePromise;\r\n PolyPromiseImpl.any = createAsyncAnyPromise;\r\n PolyPromiseImpl.reject = createAsyncRejectedPromise;\r\n PolyPromiseImpl.resolve = createAsyncResolvedPromise;\r\n PolyPromiseImpl.allSettled = createAsyncAllSettledPromise;\r\n let theProto = PolyPromiseImpl.prototype;\r\n theProto.then = function (onResolved: any, onRejected: any) {\r\n return this._$.then(onResolved, onRejected);\r\n };\r\n theProto.catch = function (onRejected: any) {\r\n return this._$.catch(onRejected);\r\n };\r\n theProto.finally = function (onfinally: any) {\r\n return this._$.finally(onfinally);\r\n };\r\n return PolyPromiseImpl as unknown as PolyPromiseConstructor;\r\n}());","import { isNullOrUndefined, isObject, objExtend, objForEachKey, setValueByKey } from \"@nevware21/ts-utils\";\r\nimport { _DYN_FEATURE_OPT_IN } from \"./__DynamicConstants\";\r\n/**\r\n * Delete a config key in the given cfg, if the config key exists in nonOverrideConfigs and its value is set to true\r\n * @param cfg - cfg to modify\r\n * @param nonOverrideConfigs - nonOverrideConfigs\r\n * @param curLevel - cur config level, starting at 0\r\n * @param maxLevel - max config level\r\n * @returns new copy of modified configs\r\n */\r\nexport function replaceByNonOverrideCfg(cfg, nonOverrideConfigs, curLevel, maxLevel) {\r\n try {\r\n var exceedMaxLevel = curLevel > maxLevel;\r\n if (exceedMaxLevel) {\r\n cfg = null;\r\n }\r\n var curCfg_1 = curLevel == 0 ? objExtend({}, cfg) : cfg; // only copy cfg at the begining level\r\n if (curCfg_1 && nonOverrideConfigs && !exceedMaxLevel) {\r\n objForEachKey(curCfg_1, function (key) {\r\n var nonOverrideVal = nonOverrideConfigs[key];\r\n if (!!nonOverrideVal) {\r\n if (isObject(curCfg_1[key]) && isObject(nonOverrideVal)) {\r\n curCfg_1[key] = replaceByNonOverrideCfg(curCfg_1[key], nonOverrideVal, ++curLevel, maxLevel);\r\n }\r\n else {\r\n delete curCfg_1[key];\r\n }\r\n }\r\n });\r\n }\r\n return curCfg_1;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n // if errors happen, do nothing\r\n return cfg;\r\n}\r\n// CDN Mode, value = B (CDN value = B)\r\n// |--------------------------------------------------------------------------|-----------|\r\n// | | none | disabled | enabled | forceOn | forceOff |\r\n// | ------------------ | ----------- | ----------- | ----------- | --------- | --------- |\r\n// | User Mode, value = A | none | none | disabled | enabled | enabled | disabled |\r\n// (user Value = A) | disabled | disabled | disabled | disabled | enabled | disabled |\r\n// | enabled | enabled | disabled | enabled | enabled | disabled |\r\n// | none(blockCdn) | none | none | none | none | none |\r\n// | disabled(blockCdn) | disabled | disabled | disabled | disabled | disabled |\r\n// | enabled(blockCdn) | enabled | enabled | enabled | enabled | enabled |\r\n// This matrix identifies how feature based overrides are selected (if present)\r\n// cdn Mode (cdn Value = B)\r\n// |---------------------------------------------------------------------------|\r\n// | | none | disabled | enabled | forceOn | forceOff |\r\n// | ------------------ | ---------| ---------| ---------| ---------|----------|\r\n// | User Mode | none | A | A | A || B | B || A | B || A |\r\n// (user Value = A) | disabled | A | A | A | B || A | B || A |\r\n// | enabled | A | A | A || B | B || A | B || A |\r\n// | none(blockCdn) | A | A | A | A | A |\r\n// | disabled(blockCdn) | A | A | A | A | A |\r\n// | enabled(blockCdn) | A | A | A | A | A |\r\n// Note:\r\n// Where the \"value\" is an object (map) of encoded key/values which will be used to override the real configuration\r\n// A = either the user supplied enable/disable value (via the `config.featureOptIn[name]`) or if not defined by the user the SDK defaults of the same.\r\n// B = The enable/disable value obtained from the CDN for the named feature\r\n// These are evaluated based on the above matrix to either\r\n// - A (Always the user/sdk value)\r\n// - B (Always the value from the CDN)\r\n// - A || B (If A is null or undefined use the value from the CDN (B) otherwise A)\r\n// - B || A (If B is null or undefined use the user/SDK value otherwise use the value from the CDN)\r\n//\r\n// The result of the value may also be null / undefined, which means there are no overrides to apply when the feature is enabled\r\nvar F = \"featureOptIn.\";\r\nvar M = \".mode\";\r\nvar ON = \".onCfg\";\r\nvar OFF = \".offCfg\";\r\nexport function resolveCdnFeatureCfg(field, cdnCfg, userOptInDetails) {\r\n var _a;\r\n // cdn conifg value\r\n if (!cdnCfg || !cdnCfg.enabled) {\r\n return null;\r\n }\r\n var cdnFt = (cdnCfg[_DYN_FEATURE_OPT_IN /* @min:%2efeatureOptIn */] || {})[field] || { mode: 1 /* CdnFeatureMode.none */ };\r\n var cdnM = cdnFt.mode;\r\n var cdnOnV = cdnFt.onCfg;\r\n var cdnOffV = cdnFt.offCfg;\r\n var userFt = (userOptInDetails || {})[field] || { mode: 2 /* FeatureOptInMode.disable */ }; // default user mode is disable\r\n var userM = userFt.mode;\r\n var userOnV = userFt.onCfg;\r\n var userOffV = userFt.offCfg;\r\n var blockCdn = !!userFt.blockCdnCfg;\r\n var mFld = F + field + M;\r\n var onFld = F + field + ON;\r\n var offFld = F + field + OFF;\r\n var mode = userM;\r\n var onV = userOnV;\r\n var offV = userOffV;\r\n if (!blockCdn) {\r\n if (cdnM === 4 /* CdnFeatureMode.forceOn */ || cdnM === 5 /* CdnFeatureMode.forceOff */) {\r\n mode = (cdnM == 4 /* CdnFeatureMode.forceOn */ ? 3 /* FeatureOptInMode.enable */ : 2 /* FeatureOptInMode.disable */);\r\n onV = cdnOnV || userOnV;\r\n offV = cdnOffV || userOffV;\r\n }\r\n else if (cdnM === 2 /* CdnFeatureMode.disable */ || userM === 2 /* FeatureOptInMode.disable */) {\r\n mode = 2 /* FeatureOptInMode.disable */;\r\n onV = userOnV || cdnOnV;\r\n offV = userOffV || cdnOffV;\r\n }\r\n else if (cdnM === 3 /* CdnFeatureMode.enable */) {\r\n mode = 3 /* FeatureOptInMode.enable */;\r\n onV = userOnV || cdnOnV;\r\n offV = userOffV || cdnOffV;\r\n }\r\n else if (cdnM === 1 /* CdnFeatureMode.none */ && userM === 1 /* FeatureOptInMode.none */) {\r\n mode = 1 /* FeatureOptInMode.none */;\r\n }\r\n }\r\n return _a = {},\r\n _a[mFld] = mode,\r\n _a[onFld] = onV,\r\n _a[offFld] = offV,\r\n _a;\r\n}\r\n// helper function to get cdn config with opt-in features\r\nexport function applyCdnfeatureCfg(cdnCfg, core) {\r\n try {\r\n if (!cdnCfg || !cdnCfg.enabled) {\r\n return null;\r\n }\r\n if (!cdnCfg[_DYN_FEATURE_OPT_IN /* @min:%2efeatureOptIn */]) {\r\n return cdnCfg.config;\r\n }\r\n var optInMap = cdnCfg[_DYN_FEATURE_OPT_IN /* @min:%2efeatureOptIn */];\r\n var cdnConfig_1 = cdnCfg.config || {};\r\n objForEachKey(optInMap, function (key) {\r\n var featureVal = resolveCdnFeatureCfg(key, cdnCfg, core.config[_DYN_FEATURE_OPT_IN /* @min:%2efeatureOptIn */]);\r\n if (!isNullOrUndefined(featureVal)) {\r\n objForEachKey(featureVal, function (config, val) {\r\n setValueByKey(cdnConfig_1, config, val);\r\n });\r\n _overrideCdnCfgByFeature(key, featureVal, cdnConfig_1);\r\n }\r\n });\r\n return cdnConfig_1;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n}\r\nfunction _overrideCdnCfgByFeature(field, ftVal, config) {\r\n var mode = ftVal[F + field + M];\r\n var val = ftVal[F + field + ON];\r\n var dVal = ftVal[F + field + OFF];\r\n var target = null;\r\n if (mode === 3 /* FeatureOptInMode.enable */) {\r\n target = val;\r\n }\r\n if (mode === 2 /* FeatureOptInMode.disable */) {\r\n target = dVal;\r\n }\r\n if (target) {\r\n objForEachKey(target, function (key, cfg) {\r\n setValueByKey(config, key, cfg);\r\n });\r\n }\r\n}\r\n//# sourceMappingURL=CfgSyncHelperFuncs.js.map","/**\r\n* CfgSyncPlugin.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nvar _a;\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { DisabledPropertyName } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, createProcessTelemetryContext, createUniqueNamespace, eventOff, eventOn, getGlobal, getJSON, isFetchSupported, isXhrSupported, mergeEvtNamespace, onConfigChange, sendCustomEvent } from \"@microsoft/applicationinsights-core-js\";\r\nimport { doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { isFunction, isNullOrUndefined, isPlainObject, objDeepFreeze, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { applyCdnfeatureCfg, replaceByNonOverrideCfg } from \"./CfgSyncHelperFuncs\";\r\nimport { _DYN_SCHEDULE_FETCH_TIMEO0 } from \"./__DynamicConstants\";\r\nvar EVENT_NAME = \"ai_cfgsync\";\r\nvar STR_GET_METHOD = \"GET\";\r\nvar FETCH_TIMEOUT = 1800000; // 30 minutes\r\nvar udfVal = undefined;\r\nvar defaultNonOverrideCfg = { instrumentationKey: true, connectionString: true, endpointUrl: true };\r\nvar _defaultConfig = objDeepFreeze((_a = {\r\n syncMode: 1 /* ICfgSyncMode.Broadcast */,\r\n blkCdnCfg: udfVal,\r\n customEvtName: udfVal,\r\n cfgUrl: udfVal,\r\n overrideSyncFn: udfVal,\r\n overrideFetchFn: udfVal,\r\n onCfgChangeReceive: udfVal\r\n },\r\n _a[_DYN_SCHEDULE_FETCH_TIMEO0 /* @min:scheduleFetchTimeout */] = FETCH_TIMEOUT,\r\n _a.nonOverrideConfigs = defaultNonOverrideCfg,\r\n _a.enableAjax = false,\r\n _a));\r\nvar CfgSyncPlugin = /** @class */ (function (_super) {\r\n __extends(CfgSyncPlugin, _super);\r\n function CfgSyncPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.priority = 198;\r\n _this.identifier = \"AppInsightsCfgSyncPlugin\";\r\n var _extensionConfig;\r\n var _mainConfig; // throttle config should be wrapped in IConfiguration\r\n var _evtName;\r\n var _evtNamespace;\r\n var _cfgUrl;\r\n var _timeoutHandle;\r\n var _receiveChanges;\r\n var _broadcastChanges;\r\n var _blkCdnCfg;\r\n var _fetchTimeout;\r\n var _retryCnt;\r\n var _onCfgChangeReceive;\r\n var _nonOverrideConfigs;\r\n var _fetchFn;\r\n var _overrideFetchFn;\r\n var _overrideSyncFn;\r\n var _paused = false;\r\n var _enableAjax;\r\n dynamicProto(CfgSyncPlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n _base.initialize(config, core, extensions, pluginChain);\r\n _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace());\r\n _populateDefaults(config);\r\n };\r\n _self.getCfg = function () {\r\n return _mainConfig;\r\n };\r\n _self.pause = function () {\r\n _paused = true;\r\n _clearScheduledTimer();\r\n };\r\n _self.resume = function () {\r\n _paused = false;\r\n _setupTimer();\r\n };\r\n // used for V2 to manaully trigger config udpate\r\n _self.setCfg = function (config) {\r\n return _setCfg(config);\r\n };\r\n _self.sync = function (customDetails) {\r\n return _sendCfgsyncEvents(customDetails);\r\n };\r\n _self.updateEventListenerName = function (eventName) {\r\n return _updateEventListenerName(eventName);\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n _eventOff();\r\n _clearScheduledTimer();\r\n _initDefaults();\r\n };\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_broadcastChanges, _receiveChanges, _evtName, _blkCdnCfg, _nonOverrideConfigs];\r\n };\r\n function _initDefaults() {\r\n _mainConfig = null;\r\n _evtName = null;\r\n _evtNamespace = null;\r\n _cfgUrl = null;\r\n _receiveChanges = null;\r\n _broadcastChanges = null;\r\n _nonOverrideConfigs = null;\r\n _timeoutHandle = null;\r\n _fetchTimeout = null;\r\n _retryCnt = null;\r\n _blkCdnCfg = null;\r\n _enableAjax = false;\r\n _overrideFetchFn = null;\r\n _overrideSyncFn = null;\r\n _onCfgChangeReceive = null;\r\n }\r\n function _populateDefaults(config) {\r\n var identifier = _self.identifier;\r\n var core = _self.core;\r\n _self._addHook(onConfigChange(config, function () {\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n _extensionConfig = ctx.getExtCfg(identifier, _defaultConfig);\r\n var preBlkCdn = _blkCdnCfg;\r\n _blkCdnCfg = !!_extensionConfig.blkCdnCfg;\r\n _enableAjax = !!_extensionConfig.enableAjax;\r\n // avoid initial call\r\n if (!isNullOrUndefined(preBlkCdn) && preBlkCdn !== _blkCdnCfg) {\r\n if (!_blkCdnCfg && _cfgUrl) {\r\n _fetchFn && _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges);\r\n }\r\n else {\r\n _clearScheduledTimer();\r\n }\r\n }\r\n if (isNullOrUndefined(_receiveChanges)) {\r\n _receiveChanges = _extensionConfig.syncMode === 2 /* ICfgSyncMode.Receive */;\r\n }\r\n if (isNullOrUndefined(_broadcastChanges)) {\r\n _broadcastChanges = _extensionConfig.syncMode === 1 /* ICfgSyncMode.Broadcast */;\r\n }\r\n var newEvtName = _extensionConfig.customEvtName || EVENT_NAME;\r\n if (_evtName !== newEvtName) {\r\n if (_receiveChanges) {\r\n _updateEventListenerName(newEvtName);\r\n }\r\n else {\r\n _eventOff();\r\n _evtName = newEvtName;\r\n }\r\n }\r\n if (isNullOrUndefined(_cfgUrl)) {\r\n _cfgUrl = _extensionConfig.cfgUrl;\r\n }\r\n // if cfgUrl is set, we will ignore core config change\r\n if (!_cfgUrl) {\r\n _mainConfig = config;\r\n if (_broadcastChanges) {\r\n _sendCfgsyncEvents();\r\n }\r\n }\r\n }));\r\n _overrideSyncFn = _extensionConfig.overrideSyncFn;\r\n _overrideFetchFn = _extensionConfig.overrideFetchFn;\r\n _onCfgChangeReceive = _extensionConfig.onCfgChangeReceive;\r\n _nonOverrideConfigs = _extensionConfig.nonOverrideConfigs; // override values should not be changed\r\n _fetchTimeout = _extensionConfig[_DYN_SCHEDULE_FETCH_TIMEO0 /* @min:%2escheduleFetchTimeout */];\r\n _fetchFn = _getFetchFnInterface();\r\n _retryCnt = 0;\r\n // NOT support cfgURL change to avoid mutiple fetch calls\r\n if (_cfgUrl && !_blkCdnCfg) {\r\n _fetchFn && _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges);\r\n }\r\n }\r\n function _setCfg(config, isAutoSync) {\r\n if (config) {\r\n _mainConfig = config;\r\n if (!!isAutoSync && !_paused) {\r\n return _sendCfgsyncEvents();\r\n }\r\n if (_receiveChanges && !_paused) {\r\n _self.core.updateCfg(config);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function _eventOff() {\r\n try {\r\n var global_1 = getGlobal();\r\n if (global_1) {\r\n eventOff(global_1, null, null, _evtNamespace);\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _sendCfgsyncEvents(customDetails) {\r\n try {\r\n if (!!_overrideSyncFn && isFunction(_overrideSyncFn)) {\r\n return _overrideSyncFn(_mainConfig, customDetails);\r\n }\r\n return sendCustomEvent(_evtName, _mainConfig, customDetails);\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n }\r\n function _updateEventListenerName(name) {\r\n try {\r\n _eventOff();\r\n if (name) {\r\n _evtName = name;\r\n _addEventListener();\r\n }\r\n return true;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n }\r\n function _getFetchFnInterface() {\r\n var _fetchFn = _overrideFetchFn;\r\n if (isNullOrUndefined(_fetchFn)) {\r\n if (isFetchSupported()) {\r\n _fetchFn = _fetchSender;\r\n }\r\n else if (isXhrSupported()) {\r\n _fetchFn = _xhrSender;\r\n }\r\n }\r\n return _fetchFn;\r\n }\r\n function _fetchSender(url, oncomplete, isAutoSync) {\r\n var global = getGlobal();\r\n var fetchFn = (global && global.fetch) || null;\r\n if (url && fetchFn && isFunction(fetchFn)) {\r\n try {\r\n var init = {\r\n method: STR_GET_METHOD\r\n };\r\n if (!_enableAjax) {\r\n init[DisabledPropertyName] = true;\r\n }\r\n var request = new Request(url, init);\r\n if (!_enableAjax) {\r\n try {\r\n // Also try and tag the request (just in case the value in init is not copied over)\r\n request[DisabledPropertyName] = true;\r\n }\r\n catch (e) {\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n }\r\n }\r\n doAwaitResponse(fetch(request), function (result) {\r\n var response = result.value;\r\n if (!result.rejected) {\r\n if (response.ok) {\r\n doAwaitResponse(response.text(), function (res) {\r\n _doOnComplete(oncomplete, response.status, res.value, isAutoSync);\r\n });\r\n }\r\n else {\r\n _doOnComplete(oncomplete, response.status, null, isAutoSync);\r\n }\r\n }\r\n else {\r\n _doOnComplete(oncomplete, 400);\r\n }\r\n });\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n }\r\n function _xhrSender(url, oncomplete, isAutoSync) {\r\n try {\r\n var xhr_1 = new XMLHttpRequest();\r\n if (!_enableAjax) {\r\n xhr_1[DisabledPropertyName] = true;\r\n }\r\n xhr_1.open(STR_GET_METHOD, url);\r\n xhr_1.onreadystatechange = function () {\r\n if (xhr_1.readyState === XMLHttpRequest.DONE) {\r\n _doOnComplete(oncomplete, xhr_1.status, xhr_1.responseText, isAutoSync);\r\n }\r\n };\r\n xhr_1.onerror = function () {\r\n _doOnComplete(oncomplete, 400);\r\n };\r\n xhr_1.ontimeout = function () {\r\n _doOnComplete(oncomplete, 400);\r\n };\r\n xhr_1.send();\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _onFetchComplete(status, response, isAutoSync) {\r\n try {\r\n if (status >= 200 && status < 400 && response) {\r\n _retryCnt = 0; // any successful response will reset retry count to 0\r\n var JSON_1 = getJSON();\r\n if (JSON_1) {\r\n var cdnCfg = JSON_1.parse(response); //comments are not allowed\r\n var cfg = applyCdnfeatureCfg(cdnCfg, _self.core);\r\n var newCfg = cfg && isPlainObject(cfg) && _replaceTartgetByKeys(cfg);\r\n newCfg && _setCfg(newCfg, isAutoSync);\r\n //cfg && _setCfg(cfg, isAutoSync);\r\n }\r\n }\r\n else {\r\n _retryCnt++;\r\n }\r\n if (_retryCnt < 3) {\r\n _setupTimer();\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _doOnComplete(oncomplete, status, response, isAutoSync) {\r\n try {\r\n oncomplete(status, response, isAutoSync);\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _addEventListener() {\r\n if (_receiveChanges) {\r\n var global_2 = getGlobal();\r\n if (global_2) {\r\n try {\r\n eventOn(global_2, _evtName, function (event) {\r\n // TODO: add more validation here\r\n // may include a \"name\" or some other features to check\r\n var cfgEvent = event && event.detail;\r\n if (_onCfgChangeReceive && cfgEvent) {\r\n _onCfgChangeReceive(cfgEvent);\r\n }\r\n else {\r\n var cfg = cfgEvent && cfgEvent.cfg;\r\n var newCfg = cfg && isPlainObject(cfg) && _replaceTartgetByKeys(cfg);\r\n newCfg && _setCfg(newCfg);\r\n }\r\n }, _evtNamespace, true);\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n }\r\n }\r\n // 4 levels\r\n function _replaceTartgetByKeys(cfg, level) {\r\n var _cfg = null;\r\n try {\r\n if (cfg) {\r\n _cfg = replaceByNonOverrideCfg(cfg, _nonOverrideConfigs, 0, 5);\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return _cfg;\r\n }\r\n /**\r\n * Sets up the timer which triggers fetching cdn every 30mins after inital call\r\n */\r\n function _setupTimer() {\r\n if (!_timeoutHandle && _fetchTimeout) {\r\n _timeoutHandle = scheduleTimeout(function () {\r\n _timeoutHandle = null;\r\n _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges);\r\n }, _fetchTimeout);\r\n _timeoutHandle.unref();\r\n }\r\n }\r\n function _clearScheduledTimer() {\r\n _timeoutHandle && _timeoutHandle.cancel();\r\n _timeoutHandle = null;\r\n _retryCnt = 0;\r\n }\r\n _self.processTelemetry = function (env, itemCtx) {\r\n _self.processNext(env, itemCtx);\r\n };\r\n });\r\n return _this;\r\n }\r\n CfgSyncPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Get current configs of current instance.\r\n * @param config - current configs\r\n */\r\n CfgSyncPlugin.prototype.getCfg = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Manually set configs of current instance.\r\n * @param config - new configs\r\n */\r\n CfgSyncPlugin.prototype.setCfg = function (config) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Manually broadcast configs of current instance to all other instances.\r\n * @param customDetails - additional details should also be sent out to other instances\r\n */\r\n CfgSyncPlugin.prototype.sync = function (customDetails) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Manually update event name.\r\n * If current instance is the main instance, then following config changes will be sent out under this new event name.\r\n * If current instance is listener instances, it will listen to event details under this new name.\r\n * @param eventName - new event name\r\n */\r\n CfgSyncPlugin.prototype.updateEventListenerName = function (eventName) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Pause the sending/receiving of events\r\n */\r\n CfgSyncPlugin.prototype.pause = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Resume the sending/receiving of events\r\n */\r\n CfgSyncPlugin.prototype.resume = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n // /**\r\n // * Add Part A fields to the event\r\n // * @param event - The event that needs to be processed\r\n // */\r\n CfgSyncPlugin.prototype.processTelemetry = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return CfgSyncPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { CfgSyncPlugin };\r\n//# sourceMappingURL=CfgSyncPlugin.js.map","import { arrForEach, createUniqueNamespace, eventOff, eventOn, getDocument, getNavigator, getWindow, isNullOrUndefined, isUndefined, mergeEvtNamespace } from \"@microsoft/applicationinsights-core-js\";\r\nfunction _disableEvents(target, evtNamespace) {\r\n eventOff(target, null, null, evtNamespace);\r\n}\r\n/**\r\n * Create a new OfflineListener instance to monitor browser online / offline events\r\n * @param parentEvtNamespace - The parent event namespace to append to any specific events for this instance\r\n */\r\nexport function createOfflineListener(parentEvtNamespace) {\r\n var _document = getDocument();\r\n var _navigator = getNavigator(); // Gets the window.navigator or workerNavigator depending on the global\r\n var _isListening = false;\r\n var listenerList = [];\r\n // Set the initial state\r\n // rState is changed by the browser, both via events and when we check the navigator.onLine property\r\n var rState = 1 /* eOfflineValue.Online */;\r\n if (_navigator && !isNullOrUndefined(_navigator.onLine) && !_navigator.onLine) { // navigator.onLine is undefined in react-native\r\n rState = 2 /* eOfflineValue.Offline */;\r\n }\r\n // ustate is changed by the user calling setOnlineState\r\n var uState = 0 /* eOfflineValue.Unknown */;\r\n // current state would be updated each time rState or uState is changed\r\n // it is a resolved value of rState and uState\r\n var _currentState = calCurrentState();\r\n var _evtNamespace = mergeEvtNamespace(createUniqueNamespace(\"OfflineListener\"), parentEvtNamespace);\r\n try {\r\n if (_enableEvents(getWindow())) {\r\n _isListening = true;\r\n }\r\n if (_document) {\r\n // Also attach to the document.body or document\r\n var target = _document.body || _document;\r\n if (target.ononline) {\r\n if (_enableEvents(target)) {\r\n _isListening = true;\r\n }\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // this makes react-native less angry\r\n _isListening = false;\r\n }\r\n function _enableEvents(target) {\r\n var enabled = false;\r\n if (target) {\r\n enabled = eventOn(target, \"online\", _setOnline, _evtNamespace);\r\n if (enabled) {\r\n eventOn(target, \"offline\", _setOffline, _evtNamespace);\r\n }\r\n }\r\n return enabled;\r\n }\r\n function _isOnline() {\r\n return _currentState;\r\n }\r\n function calCurrentState() {\r\n if (uState === 2 /* eOfflineValue.Offline */ || rState === 2 /* eOfflineValue.Offline */) {\r\n return false;\r\n }\r\n return true; // if both unknown, then we assume the network is good\r\n }\r\n function listnerNoticeCheck() {\r\n // we were offline and are now online or we were online and now offline\r\n var newState = calCurrentState();\r\n if (_currentState !== newState) {\r\n _currentState = newState; // use the resolved state to update\r\n // send all the callbacks with the current state\r\n arrForEach(listenerList, function (callback) {\r\n var offlineState = {\r\n isOnline: _currentState,\r\n rState: rState,\r\n uState: uState\r\n };\r\n try {\r\n callback(offlineState);\r\n }\r\n catch (e) {\r\n // Do nothing, just making sure we run all of the callbacks\r\n }\r\n });\r\n }\r\n }\r\n function setOnlineState(newState) {\r\n uState = newState;\r\n listnerNoticeCheck();\r\n }\r\n function _setOnline() {\r\n rState = 1 /* eOfflineValue.Online */;\r\n listnerNoticeCheck();\r\n }\r\n function _setOffline() {\r\n rState = 2 /* eOfflineValue.Offline */;\r\n listnerNoticeCheck();\r\n }\r\n function _unload() {\r\n var win = getWindow();\r\n if (win && _isListening) {\r\n _disableEvents(win, _evtNamespace);\r\n if (_document) {\r\n // Also attach to the document.body or document\r\n var target = _document.body || _document;\r\n if (!isUndefined(target.ononline)) {\r\n _disableEvents(target, _evtNamespace);\r\n }\r\n }\r\n _isListening = false;\r\n }\r\n }\r\n function addListener(callback) {\r\n listenerList.push(callback);\r\n // Define rm as an instance of IUnloadHook\r\n return {\r\n rm: function () {\r\n var index = listenerList.indexOf(callback);\r\n if (index > -1) {\r\n return listenerList.splice(index, 1);\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n };\r\n }\r\n return {\r\n isOnline: _isOnline,\r\n isListening: function () { return _isListening; },\r\n unload: _unload,\r\n addListener: addListener,\r\n setOnlineState: setOnlineState\r\n };\r\n}\r\n//# sourceMappingURL=Offline.js.map","import { createEnumStyle } from \"./EnumHelperFuncs\";\r\nexport var ActiveStatus = createEnumStyle({\r\n NONE: 0 /* eActiveStatus.NONE */,\r\n PENDING: 3 /* eActiveStatus.PENDING */,\r\n INACTIVE: 1 /* eActiveStatus.INACTIVE */,\r\n ACTIVE: 2 /* eActiveStatus.ACTIVE */\r\n});\r\n//# sourceMappingURL=InitActiveStatusEnum.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { createPromise, doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { arrForEach, dumpObj, getNavigator, getWindow, isFunction, objKeys } from \"@nevware21/ts-utils\";\r\nimport { _DYN_DATA, _DYN_HEADERS, _DYN_INITIALIZE, _DYN_LENGTH, _DYN_MESSAGE, _DYN_REPLACE, _DYN_STATUS, _DYN_TIMEOUT, _DYN_TO_LOWER_CASE, _DYN_URL_STRING, _DYN_VALUE, _DYN__DO_TEARDOWN } from \"../__DynamicConstants\";\r\nimport { DisabledPropertyName } from \"./Constants\";\r\nimport { _throwInternal, _warnToConsole } from \"./DiagnosticLogger\";\r\nimport { getLocation, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest } from \"./EnvUtils\";\r\nimport { _getAllResponseHeaders, formatErrorMessageXdr, formatErrorMessageXhr, getResponseText, openXhr } from \"./HelperFuncs\";\r\nvar STR_EMPTY = \"\";\r\nvar STR_NO_RESPONSE_BODY = \"NoResponseBody\";\r\nvar _noResponseQs = \"&\" + STR_NO_RESPONSE_BODY + \"=true\";\r\nvar STR_POST_METHOD = \"POST\";\r\n/**\r\n * This Internal component\r\n * Manager SendPost functions\r\n * SendPostManger\r\n * @internal for internal use only\r\n */\r\nvar SenderPostManager = /** @class */ (function () {\r\n function SenderPostManager() {\r\n var _syncFetchPayload = 0; // Keep track of the outstanding sync fetch payload total (as sync fetch has limits)\r\n var _enableSendPromise;\r\n var _isInitialized;\r\n var _diagLog;\r\n var _isOneDs;\r\n var _onCompleteFuncs;\r\n var _disableCredentials;\r\n var _fetchCredentials;\r\n var _fallbackInst;\r\n var _disableXhr;\r\n var _disableBeacon;\r\n var _disableBeaconSync;\r\n var _disableFetchKeepAlive;\r\n var _addNoResponse;\r\n var _timeoutWrapper;\r\n dynamicProto(SenderPostManager, this, function (_self, _base) {\r\n var _sendCredentials = true; // for 1ds\r\n _initDefaults();\r\n _self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, diagLog) {\r\n _diagLog = diagLog;\r\n if (_isInitialized) {\r\n _throwInternal(_diagLog, 1 /* eLoggingSeverity.CRITICAL */, 28 /* _eInternalMessageId.SenderNotInitialized */, \"Sender is already initialized\");\r\n }\r\n _self.SetConfig(config);\r\n _isInitialized = true;\r\n };\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_isInitialized, _isOneDs, _disableCredentials, _enableSendPromise];\r\n };\r\n // This componet might get its config from sender, offline sender, 1ds post\r\n // so set this function to mock dynamic changes\r\n _self.SetConfig = function (config) {\r\n try {\r\n _onCompleteFuncs = config.senderOnCompleteCallBack || {};\r\n _disableCredentials = !!config.disableCredentials;\r\n _fetchCredentials = config.fetchCredentials;\r\n _isOneDs = !!config.isOneDs;\r\n _enableSendPromise = !!config.enableSendPromise;\r\n _disableXhr = !!config.disableXhr;\r\n _disableBeacon = !!config.disableBeacon;\r\n _disableBeaconSync = !!config.disableBeaconSync;\r\n _timeoutWrapper = config.timeWrapper;\r\n _addNoResponse = !!config.addNoResponse;\r\n _disableFetchKeepAlive = !!config.disableFetchKeepAlive;\r\n _fallbackInst = { sendPOST: _xhrSender };\r\n if (!_isOneDs) {\r\n _sendCredentials = false; // for appInsights, set it to false always\r\n }\r\n if (_disableCredentials) {\r\n var location_1 = getLocation();\r\n if (location_1 && location_1.protocol && location_1.protocol[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() === \"file:\") {\r\n // Special case where a local html file fails with a CORS error on Chromium browsers\r\n _sendCredentials = false;\r\n }\r\n }\r\n return true;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n };\r\n _self.getSyncFetchPayload = function () {\r\n return _syncFetchPayload;\r\n };\r\n _self.getSenderInst = function (transports, sync) {\r\n if (transports && transports[_DYN_LENGTH /* @min:%2elength */]) {\r\n return _getSenderInterface(transports, sync);\r\n }\r\n return null;\r\n };\r\n _self.getFallbackInst = function () {\r\n return _fallbackInst;\r\n };\r\n _self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */] = function (unloadCtx, unloadState) {\r\n _initDefaults();\r\n };\r\n /**\r\n * success handler\r\n */\r\n function _onSuccess(res, onComplete) {\r\n _doOnComplete(onComplete, 200, {}, res);\r\n }\r\n /**\r\n * error handler\r\n */\r\n function _onError(message, onComplete) {\r\n _throwInternal(_diagLog, 2 /* eLoggingSeverity.WARNING */, 26 /* _eInternalMessageId.OnError */, \"Failed to send telemetry.\", { message: message });\r\n _doOnComplete(onComplete, 400, {});\r\n }\r\n function _onNoPayloadUrl(onComplete) {\r\n _onError(\"No endpoint url is provided for the batch\", onComplete);\r\n }\r\n function _getSenderInterface(transports, syncSupport) {\r\n var transportType = 0 /* TransportType.NotSet */;\r\n var sendPostFunc = null;\r\n var lp = 0;\r\n while (sendPostFunc == null && lp < transports[_DYN_LENGTH /* @min:%2elength */]) {\r\n transportType = transports[lp];\r\n if (!_disableXhr && transportType === 1 /* TransportType.Xhr */) {\r\n if (useXDomainRequest()) {\r\n // IE 8 and 9\r\n sendPostFunc = _xdrSender;\r\n }\r\n else if (isXhrSupported()) {\r\n sendPostFunc = _xhrSender;\r\n }\r\n }\r\n else if (transportType === 2 /* TransportType.Fetch */ && isFetchSupported(syncSupport) && (!syncSupport || !_disableFetchKeepAlive)) {\r\n sendPostFunc = _doFetchSender;\r\n }\r\n else if (transportType === 3 /* TransportType.Beacon */ && isBeaconsSupported() && (syncSupport ? !_disableBeaconSync : !_disableBeacon)) {\r\n sendPostFunc = _beaconSender;\r\n }\r\n lp++;\r\n }\r\n if (sendPostFunc) {\r\n return {\r\n _transport: transportType,\r\n _isSync: syncSupport,\r\n sendPOST: sendPostFunc\r\n };\r\n }\r\n return null;\r\n }\r\n function _doOnComplete(oncomplete, status, headers, response) {\r\n try {\r\n oncomplete && oncomplete(status, headers, response);\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _doBeaconSend(payload, oncomplete) {\r\n var nav = getNavigator();\r\n var url = payload[_DYN_URL_STRING /* @min:%2eurlString */];\r\n if (!url) {\r\n _onNoPayloadUrl(oncomplete);\r\n // return true here, because we don't want to retry it with fallback sender\r\n return true;\r\n }\r\n url = payload[_DYN_URL_STRING /* @min:%2eurlString */] + (_addNoResponse ? _noResponseQs : STR_EMPTY);\r\n var data = payload[_DYN_DATA /* @min:%2edata */];\r\n // Chrome only allows CORS-safelisted values for the sendBeacon data argument\r\n // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283\r\n // Chrome only allows CORS-safelisted values for the sendBeacon data argument\r\n // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283\r\n var plainTextBatch = _isOneDs ? data : new Blob([data], { type: \"text/plain;charset=UTF-8\" });\r\n // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false.\r\n var queued = nav.sendBeacon(url, plainTextBatch);\r\n return queued;\r\n }\r\n /**\r\n * Send Beacon API request\r\n * @param payload - The data payload to be sent.\r\n * @param sync - not used\r\n * Note: Beacon API does not support custom headers and we are not able to get\r\n * appId from the backend for the correct correlation.\r\n */\r\n function _beaconSender(payload, oncomplete, sync) {\r\n var data = payload[_DYN_DATA /* @min:%2edata */];\r\n try {\r\n if (data) {\r\n // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false.\r\n if (!_doBeaconSend(payload, oncomplete)) {\r\n var onRetry = _onCompleteFuncs && _onCompleteFuncs.beaconOnRetry;\r\n if (onRetry && isFunction(onRetry)) {\r\n onRetry(payload, oncomplete, _doBeaconSend);\r\n }\r\n else {\r\n _fallbackInst && _fallbackInst.sendPOST(payload, oncomplete, true);\r\n _throwInternal(_diagLog, 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" + \"Failed to send telemetry with Beacon API, retried with normal sender.\");\r\n }\r\n }\r\n else {\r\n // if can send\r\n _onSuccess(STR_EMPTY, oncomplete);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _isOneDs && _warnToConsole(_diagLog, \"Failed to send telemetry using sendBeacon API. Ex:\" + dumpObj(e));\r\n _doOnComplete(oncomplete, _isOneDs ? 0 : 400, {}, STR_EMPTY);\r\n }\r\n return;\r\n }\r\n /**\r\n * Send XMLHttpRequest\r\n * @param payload - The data payload to be sent.\r\n * @param sync - Indicates if the request should be sent synchronously\r\n */\r\n function _xhrSender(payload, oncomplete, sync) {\r\n //let internalPayload = payload as IInternalPayloadData;\r\n var thePromise;\r\n var resolveFunc;\r\n var rejectFunc;\r\n var headers = payload[_DYN_HEADERS /* @min:%2eheaders */] || {};\r\n if (!sync && _enableSendPromise) {\r\n thePromise = createPromise(function (resolve, reject) {\r\n resolveFunc = resolve;\r\n rejectFunc = reject;\r\n });\r\n }\r\n if (_isOneDs && sync && payload.disableXhrSync) {\r\n sync = false;\r\n }\r\n //const xhr = new XMLHttpRequest();\r\n var endPointUrl = payload[_DYN_URL_STRING /* @min:%2eurlString */];\r\n if (!endPointUrl) {\r\n _onNoPayloadUrl(oncomplete);\r\n resolveFunc && resolveFunc(false);\r\n return;\r\n }\r\n var xhr = openXhr(STR_POST_METHOD, endPointUrl, _sendCredentials, true, sync, payload[_DYN_TIMEOUT /* @min:%2etimeout */]);\r\n if (!_isOneDs) {\r\n // application/json should NOT add to 1ds post by default\r\n xhr.setRequestHeader(\"Content-type\", \"application/json\");\r\n }\r\n arrForEach(objKeys(headers), function (headerName) {\r\n xhr.setRequestHeader(headerName, headers[headerName]);\r\n });\r\n xhr.onreadystatechange = function () {\r\n if (!_isOneDs) {\r\n _doOnReadyFunc(xhr);\r\n if (xhr.readyState === 4) {\r\n resolveFunc && resolveFunc(true);\r\n }\r\n }\r\n };\r\n xhr.onload = function () {\r\n if (_isOneDs) {\r\n _doOnReadyFunc(xhr);\r\n }\r\n };\r\n function _doOnReadyFunc(xhr) {\r\n var onReadyFunc = _onCompleteFuncs && _onCompleteFuncs.xhrOnComplete;\r\n var onReadyFuncExist = onReadyFunc && isFunction(onReadyFunc);\r\n if (onReadyFuncExist) {\r\n onReadyFunc(xhr, oncomplete, payload);\r\n }\r\n else {\r\n var response = getResponseText(xhr);\r\n _doOnComplete(oncomplete, xhr[_DYN_STATUS /* @min:%2estatus */], _getAllResponseHeaders(xhr, _isOneDs), response);\r\n }\r\n }\r\n xhr.onerror = function (event) {\r\n _doOnComplete(oncomplete, _isOneDs ? xhr[_DYN_STATUS /* @min:%2estatus */] : 400, _getAllResponseHeaders(xhr, _isOneDs), _isOneDs ? STR_EMPTY : formatErrorMessageXhr(xhr));\r\n rejectFunc && rejectFunc(event);\r\n };\r\n xhr.ontimeout = function () {\r\n _doOnComplete(oncomplete, _isOneDs ? xhr[_DYN_STATUS /* @min:%2estatus */] : 500, _getAllResponseHeaders(xhr, _isOneDs), _isOneDs ? STR_EMPTY : formatErrorMessageXhr(xhr));\r\n resolveFunc && resolveFunc(false);\r\n };\r\n xhr.send(payload[_DYN_DATA /* @min:%2edata */]);\r\n return thePromise;\r\n }\r\n /**\r\n * Send fetch API request\r\n * @param payload - The data payload to be sent.\r\n * @param sync - For fetch this identifies whether we are \"unloading\" (false) or a normal request\r\n */\r\n function _doFetchSender(payload, oncomplete, sync) {\r\n var _a;\r\n var endPointUrl = payload[_DYN_URL_STRING /* @min:%2eurlString */];\r\n var batch = payload[_DYN_DATA /* @min:%2edata */];\r\n var plainTextBatch = _isOneDs ? batch : new Blob([batch], { type: \"application/json\" });\r\n var thePromise;\r\n var resolveFunc;\r\n var rejectFunc;\r\n var requestHeaders = new Headers();\r\n var batchLength = batch[_DYN_LENGTH /* @min:%2elength */];\r\n var ignoreResponse = false;\r\n var responseHandled = false;\r\n var headers = payload[_DYN_HEADERS /* @min:%2eheaders */] || {};\r\n //TODO: handle time out for 1ds\r\n var init = (_a = {\r\n method: STR_POST_METHOD,\r\n body: plainTextBatch\r\n },\r\n _a[DisabledPropertyName] = true // Mark so we don't attempt to track this request\r\n ,\r\n _a);\r\n // Only add headers if there are headers to add, due to issue with some polyfills\r\n if (payload.headers && objKeys(payload.headers)[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(objKeys(headers), function (headerName) {\r\n requestHeaders.append(headerName, headers[headerName]);\r\n });\r\n init[_DYN_HEADERS /* @min:%2eheaders */] = requestHeaders;\r\n }\r\n if (_fetchCredentials) { // if user passed in this value via post channel (1ds), then use it\r\n init.credentials = _fetchCredentials;\r\n }\r\n else if (_sendCredentials && _isOneDs) {\r\n // for 1ds, Don't send credentials when URL is file://\r\n init.credentials = \"include\";\r\n }\r\n if (sync) {\r\n init.keepalive = true;\r\n _syncFetchPayload += batchLength;\r\n if (_isOneDs) {\r\n if (payload[\"_sendReason\"] === 2 /* SendRequestReason.Unload */) {\r\n // As a sync request (during unload), it is unlikely that we will get a chance to process the response so\r\n // just like beacon send assume that the events have been accepted and processed\r\n ignoreResponse = true;\r\n if (_addNoResponse) {\r\n endPointUrl += _noResponseQs;\r\n }\r\n }\r\n }\r\n else {\r\n // for appinsights, set to true for all sync request\r\n ignoreResponse = true;\r\n }\r\n }\r\n var request = new Request(endPointUrl, init);\r\n try {\r\n // Also try and tag the request (just in case the value in init is not copied over)\r\n request[DisabledPropertyName] = true;\r\n }\r\n catch (e) {\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n }\r\n if (!sync && _enableSendPromise) {\r\n thePromise = createPromise(function (resolve, reject) {\r\n resolveFunc = resolve;\r\n rejectFunc = reject;\r\n });\r\n }\r\n if (!endPointUrl) {\r\n _onNoPayloadUrl(oncomplete);\r\n resolveFunc && resolveFunc(false);\r\n return;\r\n }\r\n function _handleError(res) {\r\n // In case there is an error in the request. Set the status to 0 for 1ds and 400 for appInsights\r\n // so that the events can be retried later.\r\n _doOnComplete(oncomplete, _isOneDs ? 0 : 400, {}, _isOneDs ? STR_EMPTY : res);\r\n }\r\n function _onFetchComplete(response, payload, value) {\r\n var status = response[_DYN_STATUS /* @min:%2estatus */];\r\n var onCompleteFunc = _onCompleteFuncs.fetchOnComplete;\r\n if (onCompleteFunc && isFunction(onCompleteFunc)) {\r\n onCompleteFunc(response, oncomplete, value || STR_EMPTY, payload);\r\n }\r\n else {\r\n _doOnComplete(oncomplete, status, {}, value || STR_EMPTY);\r\n }\r\n }\r\n try {\r\n doAwaitResponse(fetch(_isOneDs ? endPointUrl : request, _isOneDs ? init : null), function (result) {\r\n if (sync) {\r\n _syncFetchPayload -= batchLength;\r\n batchLength = 0;\r\n }\r\n if (!responseHandled) {\r\n responseHandled = true;\r\n if (!result.rejected) {\r\n var response_1 = result[_DYN_VALUE /* @min:%2evalue */];\r\n try {\r\n /**\r\n * The Promise returned from fetch() won’t reject on HTTP error status even if the response is an HTTP 404 or 500.\r\n * Instead, it will resolve normally (with ok status set to false), and it will only reject on network failure\r\n * or if anything prevented the request from completing.\r\n */\r\n if (!_isOneDs && !response_1.ok) {\r\n // this is for appInsights only\r\n _handleError(response_1.statusText);\r\n resolveFunc && resolveFunc(false);\r\n }\r\n else {\r\n if (_isOneDs && !response_1.body) {\r\n _onFetchComplete(response_1, null, STR_EMPTY);\r\n resolveFunc && resolveFunc(true);\r\n }\r\n else {\r\n doAwaitResponse(response_1.text(), function (resp) {\r\n _onFetchComplete(response_1, payload, resp[_DYN_VALUE /* @min:%2evalue */]);\r\n resolveFunc && resolveFunc(true);\r\n });\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _handleError(dumpObj(e));\r\n rejectFunc && rejectFunc(e);\r\n }\r\n }\r\n else {\r\n _handleError(result.reason && result.reason[_DYN_MESSAGE /* @min:%2emessage */]);\r\n rejectFunc && rejectFunc(result.reason);\r\n }\r\n }\r\n });\r\n }\r\n catch (e) {\r\n if (!responseHandled) {\r\n _handleError(dumpObj(e));\r\n rejectFunc && rejectFunc(e);\r\n }\r\n }\r\n if (ignoreResponse && !responseHandled) {\r\n // Assume success during unload processing as we most likely won't get the response\r\n responseHandled = true;\r\n _doOnComplete(oncomplete, 200, {});\r\n resolveFunc && resolveFunc(true);\r\n }\r\n if (_isOneDs && !responseHandled && payload[_DYN_TIMEOUT /* @min:%2etimeout */] > 0) {\r\n // Simulate timeout\r\n _timeoutWrapper && _timeoutWrapper.set(function () {\r\n if (!responseHandled) {\r\n // Assume a 500 response (which will cause a retry)\r\n responseHandled = true;\r\n _doOnComplete(oncomplete, 500, {});\r\n resolveFunc && resolveFunc(true);\r\n }\r\n }, payload[_DYN_TIMEOUT /* @min:%2etimeout */]);\r\n }\r\n return thePromise;\r\n }\r\n /**\r\n * Send XDomainRequest\r\n * @param payload - The data payload to be sent.\r\n * @param sync - Indicates if the request should be sent synchronously\r\n *\r\n * Note: XDomainRequest does not support sync requests. This 'isAsync' parameter is added\r\n * to maintain consistency with the xhrSender's contract\r\n * Note: XDomainRequest does not support custom headers and we are not able to get\r\n * appId from the backend for the correct correlation.\r\n */\r\n function _xdrSender(payload, oncomplete, sync) {\r\n // It doesn't support custom headers, so no action is taken with current requestHeaders\r\n var _window = getWindow();\r\n var xdr = new XDomainRequest();\r\n var data = payload[_DYN_DATA /* @min:%2edata */];\r\n xdr.onload = function () {\r\n var response = getResponseText(xdr);\r\n var onloadFunc = _onCompleteFuncs && _onCompleteFuncs.xdrOnComplete;\r\n if (onloadFunc && isFunction(onloadFunc)) {\r\n onloadFunc(xdr, oncomplete, payload);\r\n }\r\n else {\r\n _doOnComplete(oncomplete, 200, {}, response);\r\n }\r\n };\r\n xdr.onerror = function () {\r\n _doOnComplete(oncomplete, 400, {}, _isOneDs ? STR_EMPTY : formatErrorMessageXdr(xdr));\r\n };\r\n xdr.ontimeout = function () {\r\n _doOnComplete(oncomplete, 500, {});\r\n };\r\n xdr.onprogress = function () { };\r\n // XDomainRequest requires the same protocol as the hosting page.\r\n // If the protocol doesn't match, we can't send the telemetry :(.\r\n var hostingProtocol = _window && _window.location && _window.location.protocol || \"\";\r\n var endpoint = payload[_DYN_URL_STRING /* @min:%2eurlString */];\r\n if (!endpoint) {\r\n _onNoPayloadUrl(oncomplete);\r\n return;\r\n }\r\n if (!_isOneDs && endpoint.lastIndexOf(hostingProtocol, 0) !== 0) {\r\n var msg = \"Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.\";\r\n _throwInternal(_diagLog, 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" + msg);\r\n _onError(msg, oncomplete);\r\n return;\r\n }\r\n var endpointUrl = _isOneDs ? endpoint : endpoint[_DYN_REPLACE /* @min:%2ereplace */](/^(https?:)/, \"\");\r\n xdr.open(STR_POST_METHOD, endpointUrl);\r\n if (payload[_DYN_TIMEOUT /* @min:%2etimeout */]) {\r\n xdr[_DYN_TIMEOUT /* @min:%2etimeout */] = payload[_DYN_TIMEOUT /* @min:%2etimeout */];\r\n }\r\n xdr.send(data);\r\n if (_isOneDs && sync) {\r\n _timeoutWrapper && _timeoutWrapper.set(function () {\r\n xdr.send(data);\r\n }, 0);\r\n }\r\n else {\r\n xdr.send(data);\r\n }\r\n }\r\n function _initDefaults() {\r\n _syncFetchPayload = 0;\r\n _isInitialized = false;\r\n _enableSendPromise = false;\r\n _diagLog = null;\r\n _isOneDs = null;\r\n _onCompleteFuncs = null;\r\n _disableCredentials = null;\r\n _fetchCredentials = null;\r\n _fallbackInst = null;\r\n _disableXhr = false;\r\n _disableBeacon = false;\r\n _disableBeaconSync = false;\r\n _disableFetchKeepAlive = false;\r\n _addNoResponse = false;\r\n _timeoutWrapper = null;\r\n }\r\n });\r\n }\r\n SenderPostManager.prototype.initialize = function (config, diagLog) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Get size of current sync fetch payload\r\n */\r\n SenderPostManager.prototype.getSyncFetchPayload = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * reset Config\r\n * @returns True if set is successfully\r\n */\r\n SenderPostManager.prototype.SetConfig = function (config) {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Get current xhr instance\r\n */\r\n SenderPostManager.prototype.getSenderInst = function (transports, sync) {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Get current fallback sender instance\r\n */\r\n SenderPostManager.prototype.getFallbackInst = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n SenderPostManager.prototype._doTeardown = function (unloadCtx, unloadState) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return SenderPostManager;\r\n}());\r\nexport { SenderPostManager };\r\n//# sourceMappingURL=SenderPostManager.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { createPromise, doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { arrSlice, getLength } from \"@nevware21/ts-utils\";\r\nimport { _DYN_UNLOAD } from \"../__DynamicConstants\";\r\n/**\r\n * Run the unload function of the target object if it exists\r\n * @param target - The target object that contains the unload function\r\n * @param isAsync - The caller identifies whether it is expecting the operation to complete synchronously or asynchronously. Even\r\n * if the caller is not waiting the operation may still be performed asynchronously depending on the component and the reverse is\r\n * also true.\r\n * @returns The result of the target function\r\n */\r\nexport function runTargetUnload(target, isAsync) {\r\n if (target && target[_DYN_UNLOAD /* @min:%2eunload */]) {\r\n return target[_DYN_UNLOAD /* @min:%2eunload */](isAsync);\r\n }\r\n}\r\n/**\r\n * Call the unload function on all targets handling any returned [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * / Promise before calling the next targets unload\r\n * @param targets - An array of the targets to unload\r\n * @param isAsync - The caller identifies whether it is expecting the operations to complete synchronously or asynchronously. Even\r\n * if the caller is not waiting the operation may still be performed asynchronously depending on the component and the reverse is\r\n * also true.\r\n * @param done - Optional callback function to call once all of the unload functions have been called.\r\n */\r\nexport function doUnloadAll(targets, isAsync, done) {\r\n var result;\r\n if (!done) {\r\n result = createPromise(function (resolved) {\r\n done = resolved;\r\n });\r\n }\r\n if (targets && getLength(targets) > 0) {\r\n doAwaitResponse(runTargetUnload(targets[0], isAsync), function () {\r\n doUnloadAll(arrSlice(targets, 1), isAsync, done);\r\n });\r\n }\r\n else {\r\n done();\r\n }\r\n return result;\r\n}\r\n//# sourceMappingURL=AsyncUtils.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_ITEMS_RECEIVED, _DYN_LENGTH, _DYN_NAME } from \"../__DynamicConstants\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nimport { getJSON } from \"./EnvUtils\";\r\n/**\r\n * Parses the response from the backend.\r\n * @param response - XMLHttpRequest or XDomainRequest response\r\n */\r\nexport function parseResponse(response, diagLog) {\r\n try {\r\n if (response && response !== \"\") {\r\n var result = getJSON().parse(response);\r\n if (result && result[_DYN_ITEMS_RECEIVED /* @min:%2eitemsReceived */] && result[_DYN_ITEMS_RECEIVED /* @min:%2eitemsReceived */] >= result.itemsAccepted &&\r\n result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH /* @min:%2elength */]) {\r\n return result;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(diagLog, 1 /* eLoggingSeverity.CRITICAL */, 43 /* _eInternalMessageId.InvalidBackendResponse */, \"Cannot parse the response. \" + (e[_DYN_NAME /* @min:%2ename */] || dumpObj(e)), {\r\n response: response\r\n });\r\n }\r\n return null;\r\n}\r\n//# sourceMappingURL=ResponseHelpers.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { __extends } from \"tslib\";\r\nimport { createClassFromInterface } from \"@microsoft/applicationinsights-core-js\";\r\nfunction _aiNameFunc(baseName) {\r\n var aiName = \"ai.\" + baseName + \".\";\r\n return function (name) {\r\n return aiName + name;\r\n };\r\n}\r\nvar _aiApplication = _aiNameFunc(\"application\");\r\nvar _aiDevice = _aiNameFunc(\"device\");\r\nvar _aiLocation = _aiNameFunc(\"location\");\r\nvar _aiOperation = _aiNameFunc(\"operation\");\r\nvar _aiSession = _aiNameFunc(\"session\");\r\nvar _aiUser = _aiNameFunc(\"user\");\r\nvar _aiCloud = _aiNameFunc(\"cloud\");\r\nvar _aiInternal = _aiNameFunc(\"internal\");\r\nvar ContextTagKeys = /** @class */ (function (_super) {\r\n __extends(ContextTagKeys, _super);\r\n function ContextTagKeys() {\r\n return _super.call(this) || this;\r\n }\r\n return ContextTagKeys;\r\n}(createClassFromInterface({\r\n applicationVersion: _aiApplication(\"ver\"),\r\n applicationBuild: _aiApplication(\"build\"),\r\n applicationTypeId: _aiApplication(\"typeId\"),\r\n applicationId: _aiApplication(\"applicationId\"),\r\n applicationLayer: _aiApplication(\"layer\"),\r\n deviceId: _aiDevice(\"id\"),\r\n deviceIp: _aiDevice(\"ip\"),\r\n deviceLanguage: _aiDevice(\"language\"),\r\n deviceLocale: _aiDevice(\"locale\"),\r\n deviceModel: _aiDevice(\"model\"),\r\n deviceFriendlyName: _aiDevice(\"friendlyName\"),\r\n deviceNetwork: _aiDevice(\"network\"),\r\n deviceNetworkName: _aiDevice(\"networkName\"),\r\n deviceOEMName: _aiDevice(\"oemName\"),\r\n deviceOS: _aiDevice(\"os\"),\r\n deviceOSVersion: _aiDevice(\"osVersion\"),\r\n deviceRoleInstance: _aiDevice(\"roleInstance\"),\r\n deviceRoleName: _aiDevice(\"roleName\"),\r\n deviceScreenResolution: _aiDevice(\"screenResolution\"),\r\n deviceType: _aiDevice(\"type\"),\r\n deviceMachineName: _aiDevice(\"machineName\"),\r\n deviceVMName: _aiDevice(\"vmName\"),\r\n deviceBrowser: _aiDevice(\"browser\"),\r\n deviceBrowserVersion: _aiDevice(\"browserVersion\"),\r\n locationIp: _aiLocation(\"ip\"),\r\n locationCountry: _aiLocation(\"country\"),\r\n locationProvince: _aiLocation(\"province\"),\r\n locationCity: _aiLocation(\"city\"),\r\n operationId: _aiOperation(\"id\"),\r\n operationName: _aiOperation(\"name\"),\r\n operationParentId: _aiOperation(\"parentId\"),\r\n operationRootId: _aiOperation(\"rootId\"),\r\n operationSyntheticSource: _aiOperation(\"syntheticSource\"),\r\n operationCorrelationVector: _aiOperation(\"correlationVector\"),\r\n sessionId: _aiSession(\"id\"),\r\n sessionIsFirst: _aiSession(\"isFirst\"),\r\n sessionIsNew: _aiSession(\"isNew\"),\r\n userAccountAcquisitionDate: _aiUser(\"accountAcquisitionDate\"),\r\n userAccountId: _aiUser(\"accountId\"),\r\n userAgent: _aiUser(\"userAgent\"),\r\n userId: _aiUser(\"id\"),\r\n userStoreRegion: _aiUser(\"storeRegion\"),\r\n userAuthUserId: _aiUser(\"authUserId\"),\r\n userAnonymousUserAcquisitionDate: _aiUser(\"anonUserAcquisitionDate\"),\r\n userAuthenticatedUserAcquisitionDate: _aiUser(\"authUserAcquisitionDate\"),\r\n cloudName: _aiCloud(\"name\"),\r\n cloudRole: _aiCloud(\"role\"),\r\n cloudRoleVer: _aiCloud(\"roleVer\"),\r\n cloudRoleInstance: _aiCloud(\"roleInstance\"),\r\n cloudEnvironment: _aiCloud(\"environment\"),\r\n cloudLocation: _aiCloud(\"location\"),\r\n cloudDeploymentUnit: _aiCloud(\"deploymentUnit\"),\r\n internalNodeName: _aiInternal(\"nodeName\"),\r\n internalSdkVersion: _aiInternal(\"sdkVersion\"),\r\n internalAgentVersion: _aiInternal(\"agentVersion\"),\r\n internalSnippet: _aiInternal(\"snippet\"),\r\n internalSdkSrc: _aiInternal(\"sdkSrc\")\r\n})));\r\nexport { ContextTagKeys };\r\n//# sourceMappingURL=ContextTagKeys.js.map","import { ContextTagKeys } from \"./Contracts/ContextTagKeys\";\r\nexport var Extensions = {\r\n UserExt: \"user\",\r\n DeviceExt: \"device\",\r\n TraceExt: \"trace\",\r\n WebExt: \"web\",\r\n AppExt: \"app\",\r\n OSExt: \"os\",\r\n SessionExt: \"ses\",\r\n SDKExt: \"sdk\"\r\n};\r\nexport var CtxTagKeys = new ContextTagKeys();\r\n//# sourceMappingURL=PartAExtensions.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { toISOString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strNotSpecified } from \"../../Constants\";\r\nimport { _DYN_AI_DATA_CONTRACT, _DYN_NAME } from \"../../__DynamicConstants\";\r\nimport { dataSanitizeString } from \"./DataSanitizer\";\r\nvar Envelope = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Envelope(logger, data, name) {\r\n var _this = this;\r\n var _self = this;\r\n _self.ver = 1;\r\n _self.sampleRate = 100.0;\r\n _self.tags = {};\r\n _self[_DYN_NAME /* @min:%2ename */] = dataSanitizeString(logger, name) || strNotSpecified;\r\n _self.data = data;\r\n _self.time = toISOString(new Date());\r\n _self[_DYN_AI_DATA_CONTRACT /* @min:%2eaiDataContract */] = {\r\n time: 1 /* FieldType.Required */,\r\n iKey: 1 /* FieldType.Required */,\r\n name: 1 /* FieldType.Required */,\r\n sampleRate: function () {\r\n return (_this.sampleRate === 100) ? 4 /* FieldType.Hidden */ : 1 /* FieldType.Required */;\r\n },\r\n tags: 1 /* FieldType.Required */,\r\n data: 1 /* FieldType.Required */\r\n };\r\n }\r\n return Envelope;\r\n}());\r\nexport { Envelope };\r\n//# sourceMappingURL=Envelope.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Data = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Data(baseType, data) {\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n this.aiDataContract = {\r\n baseType: 1 /* FieldType.Required */,\r\n baseData: 1 /* FieldType.Required */\r\n };\r\n this.baseType = baseType;\r\n this.baseData = data;\r\n }\r\n return Data;\r\n}());\r\nexport { Data };\r\n//# sourceMappingURL=Data.js.map","import { __assign } from \"tslib\";\r\nimport { CtxTagKeys, Data, Envelope, Event, Exception, HttpMethod, Metric, PageView, PageViewPerformance, RemoteDependencyData, SampleRate, Trace, dataSanitizeString } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, _warnToConsole, getJSON, hasJSON, isNullOrUndefined, isNumber, isString, isTruthy, objForEachKey, optimizeObject, setValue, toISOString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { STR_DURATION } from \"./InternalConstants\";\r\nimport { _DYN_DATA, _DYN_DATA_TYPE, _DYN_DEVICE_TYPE, _DYN_ENVELOPE_TYPE, _DYN_LENGTH, _DYN_MEASUREMENTS, _DYN_NAME, _DYN_STRINGIFY, _DYN_TAGS, _DYN_TO_STRING, _DYN_TRACE_ID } from \"./__DynamicConstants\";\r\n// these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload\r\nvar strBaseType = \"baseType\";\r\nvar strBaseData = \"baseData\";\r\nvar strProperties = \"properties\";\r\nvar strTrue = \"true\";\r\nfunction _setValueIf(target, field, value) {\r\n return setValue(target, field, value, isTruthy);\r\n}\r\n/*\r\n * Maps Part A data from CS 4.0\r\n */\r\nfunction _extractPartAExtensions(logger, item, env) {\r\n // todo: switch to keys from common in this method\r\n var envTags = env[_DYN_TAGS /* @min:%2etags */] = env[_DYN_TAGS /* @min:%2etags */] || {};\r\n var itmExt = item.ext = item.ext || {};\r\n var itmTags = item[_DYN_TAGS /* @min:%2etags */] = item[_DYN_TAGS /* @min:%2etags */] || [];\r\n var extUser = itmExt.user;\r\n if (extUser) {\r\n _setValueIf(envTags, CtxTagKeys.userAuthUserId, extUser.authId);\r\n _setValueIf(envTags, CtxTagKeys.userId, extUser.id || extUser.localId);\r\n }\r\n var extApp = itmExt.app;\r\n if (extApp) {\r\n _setValueIf(envTags, CtxTagKeys.sessionId, extApp.sesId);\r\n }\r\n var extDevice = itmExt.device;\r\n if (extDevice) {\r\n _setValueIf(envTags, CtxTagKeys.deviceId, extDevice.id || extDevice.localId);\r\n _setValueIf(envTags, CtxTagKeys[_DYN_DEVICE_TYPE /* @min:%2edeviceType */], extDevice.deviceClass);\r\n _setValueIf(envTags, CtxTagKeys.deviceIp, extDevice.ip);\r\n _setValueIf(envTags, CtxTagKeys.deviceModel, extDevice.model);\r\n _setValueIf(envTags, CtxTagKeys[_DYN_DEVICE_TYPE /* @min:%2edeviceType */], extDevice[_DYN_DEVICE_TYPE /* @min:%2edeviceType */]);\r\n }\r\n var web = item.ext.web;\r\n if (web) {\r\n _setValueIf(envTags, CtxTagKeys.deviceLanguage, web.browserLang);\r\n _setValueIf(envTags, CtxTagKeys.deviceBrowserVersion, web.browserVer);\r\n _setValueIf(envTags, CtxTagKeys.deviceBrowser, web.browser);\r\n var envData = env[_DYN_DATA /* @min:%2edata */] = env[_DYN_DATA /* @min:%2edata */] || {};\r\n var envBaseData = envData[strBaseData] = envData[strBaseData] || {};\r\n var envProps = envBaseData[strProperties] = envBaseData[strProperties] || {};\r\n _setValueIf(envProps, \"domain\", web.domain);\r\n _setValueIf(envProps, \"isManual\", web.isManual ? strTrue : null);\r\n _setValueIf(envProps, \"screenRes\", web.screenRes);\r\n _setValueIf(envProps, \"userConsent\", web.userConsent ? strTrue : null);\r\n }\r\n var extOs = itmExt.os;\r\n if (extOs) {\r\n _setValueIf(envTags, CtxTagKeys.deviceOS, extOs[_DYN_NAME /* @min:%2ename */]);\r\n _setValueIf(envTags, CtxTagKeys.deviceOSVersion, extOs.osVer);\r\n }\r\n // No support for mapping Trace.traceState to 2.0 as it is currently empty\r\n var extTrace = itmExt.trace;\r\n if (extTrace) {\r\n _setValueIf(envTags, CtxTagKeys.operationParentId, extTrace.parentID);\r\n _setValueIf(envTags, CtxTagKeys.operationName, dataSanitizeString(logger, extTrace[_DYN_NAME /* @min:%2ename */]));\r\n _setValueIf(envTags, CtxTagKeys.operationId, extTrace[_DYN_TRACE_ID /* @min:%2etraceID */]);\r\n }\r\n // Sample 4.0 schema\r\n // {\r\n // \"time\" : \"2018-09-05T22:51:22.4936Z\",\r\n // \"name\" : \"MetricWithNamespace\",\r\n // \"iKey\" : \"ABC-5a4cbd20-e601-4ef5-a3c6-5d6577e4398e\",\r\n // \"ext\": { \"cloud\": {\r\n // \"role\": \"WATSON3\",\r\n // \"roleInstance\": \"CO4AEAP00000260\"\r\n // },\r\n // \"device\": {}, \"correlation\": {} },\r\n // \"tags\": [\r\n // { \"amazon.region\" : \"east2\" },\r\n // { \"os.expid\" : \"wp:02df239\" }\r\n // ]\r\n // }\r\n var tgs = {};\r\n // deals with tags.push({object})\r\n for (var i = itmTags[_DYN_LENGTH /* @min:%2elength */] - 1; i >= 0; i--) {\r\n var tg = itmTags[i];\r\n objForEachKey(tg, function (key, value) {\r\n tgs[key] = value;\r\n });\r\n itmTags.splice(i, 1);\r\n }\r\n // deals with tags[key]=value (and handles hasOwnProperty)\r\n objForEachKey(itmTags, function (tg, value) {\r\n tgs[tg] = value;\r\n });\r\n var theTags = __assign(__assign({}, envTags), tgs);\r\n if (!theTags[CtxTagKeys.internalSdkVersion]) {\r\n // Append a version in case it is not already set\r\n theTags[CtxTagKeys.internalSdkVersion] = dataSanitizeString(logger, \"javascript:\".concat(EnvelopeCreator.Version), 64);\r\n }\r\n env[_DYN_TAGS /* @min:%2etags */] = optimizeObject(theTags);\r\n}\r\nfunction _extractPropsAndMeasurements(data, properties, measurements) {\r\n if (!isNullOrUndefined(data)) {\r\n objForEachKey(data, function (key, value) {\r\n if (isNumber(value)) {\r\n measurements[key] = value;\r\n }\r\n else if (isString(value)) {\r\n properties[key] = value;\r\n }\r\n else if (hasJSON()) {\r\n properties[key] = getJSON()[_DYN_STRINGIFY /* @min:%2estringify */](value);\r\n }\r\n });\r\n }\r\n}\r\nfunction _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue) {\r\n if (!isNullOrUndefined(properties)) {\r\n objForEachKey(properties, function (key, value) {\r\n properties[key] = value || customUndefinedValue;\r\n });\r\n }\r\n}\r\n// TODO: Do we want this to take logger as arg or use this._logger as nonstatic?\r\nfunction _createEnvelope(logger, envelopeType, telemetryItem, data) {\r\n var envelope = new Envelope(logger, data, envelopeType);\r\n _setValueIf(envelope, \"sampleRate\", telemetryItem[SampleRate]);\r\n if ((telemetryItem[strBaseData] || {}).startTime) {\r\n // Starting from Version 3.0.3, the time property will be assigned by the startTime value,\r\n // which records the loadEvent time for the pageView event.\r\n envelope.time = toISOString(telemetryItem[strBaseData].startTime);\r\n }\r\n envelope.iKey = telemetryItem.iKey;\r\n var iKeyNoDashes = telemetryItem.iKey.replace(/-/g, \"\");\r\n envelope[_DYN_NAME /* @min:%2ename */] = envelope[_DYN_NAME /* @min:%2ename */].replace(\"{0}\", iKeyNoDashes);\r\n // extract all extensions from ctx\r\n _extractPartAExtensions(logger, telemetryItem, envelope);\r\n // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags\r\n telemetryItem[_DYN_TAGS /* @min:%2etags */] = telemetryItem[_DYN_TAGS /* @min:%2etags */] || [];\r\n return optimizeObject(envelope);\r\n}\r\nfunction EnvelopeCreatorInit(logger, telemetryItem) {\r\n if (isNullOrUndefined(telemetryItem[strBaseData])) {\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 46 /* _eInternalMessageId.TelemetryEnvelopeInvalid */, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n}\r\nexport var EnvelopeCreator = {\r\n Version: '3.3.6'\r\n};\r\nexport function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n var customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n var customProperties = telemetryItem[strBaseData][strProperties] || {};\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], customProperties, customMeasurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue);\r\n }\r\n var bd = telemetryItem[strBaseData];\r\n if (isNullOrUndefined(bd)) {\r\n _warnToConsole(logger, \"Invalid input for dependency data\");\r\n return null;\r\n }\r\n var method = bd[strProperties] && bd[strProperties][HttpMethod] ? bd[strProperties][HttpMethod] : \"GET\";\r\n var remoteDepData = new RemoteDependencyData(logger, bd.id, bd.target, bd[_DYN_NAME /* @min:%2ename */], bd[STR_DURATION /* @min:%2eduration */], bd.success, bd.responseCode, method, bd.type, bd.correlationContext, customProperties, customMeasurements);\r\n var data = new Data(RemoteDependencyData[_DYN_DATA_TYPE /* @min:%2edataType */], remoteDepData);\r\n return _createEnvelope(logger, RemoteDependencyData[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function EventEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n var customProperties = {};\r\n var customMeasurements = {};\r\n if (telemetryItem[strBaseType] !== Event[_DYN_DATA_TYPE /* @min:%2edataType */]) {\r\n customProperties[\"baseTypeSource\"] = telemetryItem[strBaseType]; // save the passed in base type as a property\r\n }\r\n if (telemetryItem[strBaseType] === Event[_DYN_DATA_TYPE /* @min:%2edataType */]) { // take collection\r\n customProperties = telemetryItem[strBaseData][strProperties] || {};\r\n customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n }\r\n else { // if its not a known type, convert to custom event\r\n if (telemetryItem[strBaseData]) {\r\n _extractPropsAndMeasurements(telemetryItem[strBaseData], customProperties, customMeasurements);\r\n }\r\n }\r\n // Extract root level properties from part C telemetryItem.data\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], customProperties, customMeasurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue);\r\n }\r\n var eventName = telemetryItem[strBaseData][_DYN_NAME /* @min:%2ename */];\r\n var eventData = new Event(logger, eventName, customProperties, customMeasurements);\r\n var data = new Data(Event[_DYN_DATA_TYPE /* @min:%2edataType */], eventData);\r\n return _createEnvelope(logger, Event[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function ExceptionEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n // Extract root level properties from part C telemetryItem.data\r\n var customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n var customProperties = telemetryItem[strBaseData][strProperties] || {};\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], customProperties, customMeasurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue);\r\n }\r\n var bd = telemetryItem[strBaseData];\r\n var exData = Exception.CreateFromInterface(logger, bd, customProperties, customMeasurements);\r\n var data = new Data(Exception[_DYN_DATA_TYPE /* @min:%2edataType */], exData);\r\n return _createEnvelope(logger, Exception[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function MetricEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n var baseData = telemetryItem[strBaseData];\r\n var props = baseData[strProperties] || {};\r\n var measurements = baseData[_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], props, measurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue);\r\n }\r\n var baseMetricData = new Metric(logger, baseData[_DYN_NAME /* @min:%2ename */], baseData.average, baseData.sampleCount, baseData.min, baseData.max, baseData.stdDev, props, measurements);\r\n var data = new Data(Metric[_DYN_DATA_TYPE /* @min:%2edataType */], baseMetricData);\r\n return _createEnvelope(logger, Metric[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function PageViewEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n // Since duration is not part of the domain properties in Common Schema, extract it from part C\r\n var duration;\r\n var baseData = telemetryItem[strBaseData];\r\n if (!isNullOrUndefined(baseData) &&\r\n !isNullOrUndefined(baseData[strProperties]) &&\r\n !isNullOrUndefined(baseData[strProperties][STR_DURATION])) { // from part B properties\r\n duration = baseData[strProperties][STR_DURATION];\r\n delete baseData[strProperties][STR_DURATION];\r\n }\r\n else if (!isNullOrUndefined(telemetryItem[_DYN_DATA /* @min:%2edata */]) &&\r\n !isNullOrUndefined(telemetryItem[_DYN_DATA /* @min:%2edata */][STR_DURATION])) { // from custom properties\r\n duration = telemetryItem[_DYN_DATA /* @min:%2edata */][STR_DURATION];\r\n delete telemetryItem[_DYN_DATA /* @min:%2edata */][STR_DURATION];\r\n }\r\n var bd = telemetryItem[strBaseData];\r\n // special case: pageview.id is grabbed from current operation id. Analytics plugin is decoupled from properties plugin, so this is done here instead. This can be made a default telemetry intializer instead if needed to be decoupled from channel\r\n var currentContextId;\r\n if (((telemetryItem.ext || {}).trace || {})[_DYN_TRACE_ID /* @min:%2etraceID */]) {\r\n currentContextId = telemetryItem.ext.trace[_DYN_TRACE_ID /* @min:%2etraceID */];\r\n }\r\n var id = bd.id || currentContextId;\r\n var name = bd[_DYN_NAME /* @min:%2ename */];\r\n var url = bd.uri;\r\n var properties = bd[strProperties] || {};\r\n var measurements = bd[_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!isNullOrUndefined(bd.refUri)) {\r\n properties[\"refUri\"] = bd.refUri;\r\n }\r\n // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!isNullOrUndefined(bd.pageType)) {\r\n properties[\"pageType\"] = bd.pageType;\r\n }\r\n // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!isNullOrUndefined(bd.isLoggedIn)) {\r\n properties[\"isLoggedIn\"] = bd.isLoggedIn[_DYN_TO_STRING /* @min:%2etoString */]();\r\n }\r\n // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!isNullOrUndefined(bd[strProperties])) {\r\n var pageTags = bd[strProperties];\r\n objForEachKey(pageTags, function (key, value) {\r\n properties[key] = value;\r\n });\r\n }\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], properties, measurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue);\r\n }\r\n var pageViewData = new PageView(logger, name, url, duration, properties, measurements, id);\r\n var data = new Data(PageView[_DYN_DATA_TYPE /* @min:%2edataType */], pageViewData);\r\n return _createEnvelope(logger, PageView[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function PageViewPerformanceEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n var bd = telemetryItem[strBaseData];\r\n var name = bd[_DYN_NAME /* @min:%2ename */];\r\n var url = bd.uri || bd.url;\r\n var properties = bd[strProperties] || {};\r\n var measurements = bd[_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], properties, measurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue);\r\n }\r\n var baseData = new PageViewPerformance(logger, name, url, undefined, properties, measurements, bd);\r\n var data = new Data(PageViewPerformance[_DYN_DATA_TYPE /* @min:%2edataType */], baseData);\r\n return _createEnvelope(logger, PageViewPerformance[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\nexport function TraceEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {\r\n EnvelopeCreatorInit(logger, telemetryItem);\r\n var message = telemetryItem[strBaseData].message;\r\n var severityLevel = telemetryItem[strBaseData].severityLevel;\r\n var props = telemetryItem[strBaseData][strProperties] || {};\r\n var measurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS /* @min:%2emeasurements */] || {};\r\n _extractPropsAndMeasurements(telemetryItem[_DYN_DATA /* @min:%2edata */], props, measurements);\r\n if (!isNullOrUndefined(customUndefinedValue)) {\r\n _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue);\r\n }\r\n var baseData = new Trace(logger, message, severityLevel, props, measurements);\r\n var data = new Data(Trace[_DYN_DATA_TYPE /* @min:%2edataType */], baseData);\r\n return _createEnvelope(logger, Trace[_DYN_ENVELOPE_TYPE /* @min:%2eenvelopeType */], telemetryItem, data);\r\n}\r\n//# sourceMappingURL=EnvelopeCreator.js.map","import { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { utlGetSessionStorage, utlRemoveSessionStorage, utlSetSessionStorage } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, arrForEach, arrIndexOf, dumpObj, getExceptionName, getJSON, isArray, isFunction, isNullOrUndefined, isString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_BUFFER_OVERRIDE, _DYN_CLEAR, _DYN_CLEAR_SENT, _DYN_CONCAT, _DYN_COUNT, _DYN_EMIT_LINE_DELIMITED_0, _DYN_ENQUEUE, _DYN_LENGTH, _DYN_MARK_AS_SENT, _DYN_PUSH, _DYN_STRINGIFY, _DYN__BUFFER__KEY, _DYN__MAX__BUFFER__SIZE, _DYN__SENT__BUFFER__KEY } from \"./__DynamicConstants\";\r\nvar BaseSendBuffer = /** @class */ (function () {\r\n function BaseSendBuffer(logger, config) {\r\n var _buffer = [];\r\n var _bufferFullMessageSent = false;\r\n var _maxRetryCnt = config.maxRetryCnt;\r\n this._get = function () {\r\n return _buffer;\r\n };\r\n this._set = function (buffer) {\r\n _buffer = buffer;\r\n return _buffer;\r\n };\r\n dynamicProto(BaseSendBuffer, this, function (_self) {\r\n _self[_DYN_ENQUEUE /* @min:%2eenqueue */] = function (payload) {\r\n if (_self[_DYN_COUNT /* @min:%2ecount */]() >= config.eventsLimitInMem) {\r\n // sent internal log only once per page view\r\n if (!_bufferFullMessageSent) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 105 /* _eInternalMessageId.InMemoryStorageBufferFull */, \"Maximum in-memory buffer size reached: \" + _self[_DYN_COUNT /* @min:%2ecount */](), true);\r\n _bufferFullMessageSent = true;\r\n }\r\n return;\r\n }\r\n payload.cnt = payload.cnt || 0;\r\n // max retry is defined, and max retry is reached, do not add the payload to buffer\r\n if (!isNullOrUndefined(_maxRetryCnt)) {\r\n if (payload.cnt > _maxRetryCnt) {\r\n // TODO: add log here on dropping payloads\r\n return;\r\n }\r\n }\r\n _buffer[_DYN_PUSH /* @min:%2epush */](payload);\r\n return;\r\n };\r\n _self[_DYN_COUNT /* @min:%2ecount */] = function () {\r\n return _buffer[_DYN_LENGTH /* @min:%2elength */];\r\n };\r\n _self.size = function () {\r\n var size = _buffer[_DYN_LENGTH /* @min:%2elength */];\r\n for (var lp = 0; lp < _buffer[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n size += (_buffer[lp].item)[_DYN_LENGTH /* @min:%2elength */];\r\n }\r\n if (!config[_DYN_EMIT_LINE_DELIMITED_0 /* @min:%2eemitLineDelimitedJson */]) {\r\n size += 2;\r\n }\r\n return size;\r\n };\r\n _self[_DYN_CLEAR /* @min:%2eclear */] = function () {\r\n _buffer = [];\r\n _bufferFullMessageSent = false;\r\n };\r\n _self.getItems = function () {\r\n return _buffer.slice(0);\r\n };\r\n _self.batchPayloads = function (payloads) {\r\n if (payloads && payloads[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var payloadStr_1 = [];\r\n arrForEach(payloads, function (payload) {\r\n payloadStr_1[_DYN_PUSH /* @min:%2epush */](payload.item);\r\n });\r\n var batch = config[_DYN_EMIT_LINE_DELIMITED_0 /* @min:%2eemitLineDelimitedJson */] ?\r\n payloadStr_1.join(\"\\n\") :\r\n \"[\" + payloadStr_1.join(\",\") + \"]\";\r\n return batch;\r\n }\r\n return null;\r\n };\r\n _self.createNew = function (newLogger, newConfig, canUseSessionStorage) {\r\n var items = _buffer.slice(0);\r\n newLogger = newLogger || logger;\r\n newConfig = newConfig || {};\r\n var newBuffer = !!canUseSessionStorage ? new SessionStorageSendBuffer(newLogger, newConfig) : new ArraySendBuffer(newLogger, newConfig);\r\n arrForEach(items, function (payload) {\r\n newBuffer[_DYN_ENQUEUE /* @min:%2eenqueue */](payload);\r\n });\r\n return newBuffer;\r\n };\r\n });\r\n }\r\n BaseSendBuffer.prototype.enqueue = function (payload) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n BaseSendBuffer.prototype.count = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return 0;\r\n };\r\n BaseSendBuffer.prototype.size = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return 0;\r\n };\r\n BaseSendBuffer.prototype.clear = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n BaseSendBuffer.prototype.getItems = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n BaseSendBuffer.prototype.batchPayloads = function (payload) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n BaseSendBuffer.prototype.createNew = function (newLogger, newConfig, canUseSessionStorage) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return BaseSendBuffer;\r\n}());\r\n/*\r\n * An array based send buffer.\r\n */\r\nvar ArraySendBuffer = /** @class */ (function (_super) {\r\n __extends(ArraySendBuffer, _super);\r\n function ArraySendBuffer(logger, config) {\r\n var _this = _super.call(this, logger, config) || this;\r\n dynamicProto(ArraySendBuffer, _this, function (_self, _base) {\r\n _self[_DYN_MARK_AS_SENT /* @min:%2emarkAsSent */] = function (payload) {\r\n _base[_DYN_CLEAR /* @min:%2eclear */]();\r\n };\r\n _self[_DYN_CLEAR_SENT /* @min:%2eclearSent */] = function (payload) {\r\n // not supported\r\n };\r\n });\r\n return _this;\r\n }\r\n ArraySendBuffer.prototype.markAsSent = function (payload) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ArraySendBuffer.prototype.clearSent = function (payload) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return ArraySendBuffer;\r\n}(BaseSendBuffer));\r\nexport { ArraySendBuffer };\r\nvar PREVIOUS_KEYS = [\"AI_buffer\", \"AI_sentBuffer\"];\r\n/*\r\n * Session storage buffer holds a copy of all unsent items in the browser session storage.\r\n */\r\nvar SessionStorageSendBuffer = /** @class */ (function (_super) {\r\n __extends(SessionStorageSendBuffer, _super);\r\n function SessionStorageSendBuffer(logger, config) {\r\n var _this = _super.call(this, logger, config) || this;\r\n var _bufferFullMessageSent = false;\r\n //Note: should not use config.namePrefix directly, because it will always refers to the latest namePrefix\r\n var _namePrefix = config === null || config === void 0 ? void 0 : config.namePrefix;\r\n // TODO: add remove buffer override as well\r\n var _b = config[_DYN_BUFFER_OVERRIDE /* @min:%2ebufferOverride */] || { getItem: utlGetSessionStorage, setItem: utlSetSessionStorage }, getItem = _b.getItem, setItem = _b.setItem;\r\n var _maxRetryCnt = config.maxRetryCnt;\r\n dynamicProto(SessionStorageSendBuffer, _this, function (_self, _base) {\r\n var bufferItems = _getBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY /* @min:%2eBUFFER_KEY */]);\r\n var itemsInSentBuffer = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */]);\r\n var previousItems = _getPreviousEvents();\r\n var notDeliveredItems = itemsInSentBuffer[_DYN_CONCAT /* @min:%2econcat */](previousItems);\r\n var buffer = _self._set(bufferItems[_DYN_CONCAT /* @min:%2econcat */](notDeliveredItems));\r\n // If the buffer has too many items, drop items from the end.\r\n if (buffer[_DYN_LENGTH /* @min:%2elength */] > SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE /* @min:%2eMAX_BUFFER_SIZE */]) {\r\n buffer[_DYN_LENGTH /* @min:%2elength */] = SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE /* @min:%2eMAX_BUFFER_SIZE */];\r\n }\r\n _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */], []);\r\n _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY /* @min:%2eBUFFER_KEY */], buffer);\r\n _self[_DYN_ENQUEUE /* @min:%2eenqueue */] = function (payload) {\r\n if (_self[_DYN_COUNT /* @min:%2ecount */]() >= SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE /* @min:%2eMAX_BUFFER_SIZE */]) {\r\n // sent internal log only once per page view\r\n if (!_bufferFullMessageSent) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 67 /* _eInternalMessageId.SessionStorageBufferFull */, \"Maximum buffer size reached: \" + _self[_DYN_COUNT /* @min:%2ecount */](), true);\r\n _bufferFullMessageSent = true;\r\n }\r\n return;\r\n }\r\n payload.cnt = payload.cnt || 0;\r\n // max retry is defined, and max retry is reached, do not add the payload to buffer\r\n if (!isNullOrUndefined(_maxRetryCnt)) {\r\n if (payload.cnt > _maxRetryCnt) {\r\n // TODO: add log here on dropping payloads\r\n return;\r\n }\r\n }\r\n _base[_DYN_ENQUEUE /* @min:%2eenqueue */](payload);\r\n _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY /* @min:%2eBUFFER_KEY */], _self._get());\r\n };\r\n _self[_DYN_CLEAR /* @min:%2eclear */] = function () {\r\n _base[_DYN_CLEAR /* @min:%2eclear */]();\r\n _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY /* @min:%2eBUFFER_KEY */], _self._get());\r\n _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */], []);\r\n _bufferFullMessageSent = false;\r\n };\r\n _self[_DYN_MARK_AS_SENT /* @min:%2emarkAsSent */] = function (payload) {\r\n _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY /* @min:%2eBUFFER_KEY */], _self._set(_removePayloadsFromBuffer(payload, _self._get())));\r\n var sentElements = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */]);\r\n if (sentElements instanceof Array && payload instanceof Array) {\r\n sentElements = sentElements[_DYN_CONCAT /* @min:%2econcat */](payload);\r\n if (sentElements[_DYN_LENGTH /* @min:%2elength */] > SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE /* @min:%2eMAX_BUFFER_SIZE */]) {\r\n // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements\r\n // until we receive a response from the backend and the buffer has free space again (see clearSent method)\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 67 /* _eInternalMessageId.SessionStorageBufferFull */, \"Sent buffer reached its maximum size: \" + sentElements[_DYN_LENGTH /* @min:%2elength */], true);\r\n sentElements[_DYN_LENGTH /* @min:%2elength */] = SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE /* @min:%2eMAX_BUFFER_SIZE */];\r\n }\r\n _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */], sentElements);\r\n }\r\n };\r\n _self[_DYN_CLEAR_SENT /* @min:%2eclearSent */] = function (payload) {\r\n var sentElements = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */]);\r\n sentElements = _removePayloadsFromBuffer(payload, sentElements);\r\n _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */], sentElements);\r\n };\r\n _self.createNew = function (newLogger, newConfig, canUseSessionStorage) {\r\n canUseSessionStorage = !!canUseSessionStorage;\r\n var unsentItems = _self._get().slice(0);\r\n var sentItems = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY /* @min:%2eSENT_BUFFER_KEY */]).slice(0);\r\n newLogger = newLogger || logger;\r\n newConfig = newConfig || {};\r\n // to make sure that we do not send duplicated payloads when it is switched back to previous one\r\n _self[_DYN_CLEAR /* @min:%2eclear */]();\r\n var newBuffer = canUseSessionStorage ? new SessionStorageSendBuffer(newLogger, newConfig) : new ArraySendBuffer(newLogger, newConfig);\r\n arrForEach(unsentItems, function (payload) {\r\n newBuffer[_DYN_ENQUEUE /* @min:%2eenqueue */](payload);\r\n });\r\n if (canUseSessionStorage) {\r\n // arr buffer will clear all payloads if markAsSent() is called\r\n newBuffer[_DYN_MARK_AS_SENT /* @min:%2emarkAsSent */](sentItems);\r\n }\r\n return newBuffer;\r\n };\r\n function _removePayloadsFromBuffer(payloads, buffer) {\r\n var remaining = [];\r\n var payloadStr = [];\r\n arrForEach(payloads, function (payload) {\r\n payloadStr[_DYN_PUSH /* @min:%2epush */](payload.item);\r\n });\r\n arrForEach(buffer, function (value) {\r\n if (!isFunction(value) && arrIndexOf(payloadStr, value.item) === -1) {\r\n remaining[_DYN_PUSH /* @min:%2epush */](value);\r\n }\r\n });\r\n return remaining;\r\n }\r\n function _getBuffer(key) {\r\n var prefixedKey = key;\r\n prefixedKey = _namePrefix ? _namePrefix + \"_\" + prefixedKey : prefixedKey;\r\n return _getBufferBase(prefixedKey);\r\n }\r\n function _getBufferBase(key) {\r\n try {\r\n var bufferJson = getItem(logger, key);\r\n if (bufferJson) {\r\n var buffer_1 = getJSON().parse(bufferJson);\r\n if (isString(buffer_1)) {\r\n // When using some version prototype.js the stringify / parse cycle does not decode array's correctly\r\n buffer_1 = getJSON().parse(buffer_1);\r\n }\r\n if (buffer_1 && isArray(buffer_1)) {\r\n return buffer_1;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 42 /* _eInternalMessageId.FailedToRestoreStorageBuffer */, \" storage key: \" + key + \", \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n return [];\r\n }\r\n function _setBuffer(key, buffer) {\r\n var prefixedKey = key;\r\n try {\r\n prefixedKey = _namePrefix ? _namePrefix + \"_\" + prefixedKey : prefixedKey;\r\n var bufferJson = JSON[_DYN_STRINGIFY /* @min:%2estringify */](buffer);\r\n setItem(logger, prefixedKey, bufferJson);\r\n }\r\n catch (e) {\r\n // if there was an error, clear the buffer\r\n // telemetry is stored in the _buffer array so we won't loose any items\r\n setItem(logger, prefixedKey, JSON[_DYN_STRINGIFY /* @min:%2estringify */]([]));\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 41 /* _eInternalMessageId.FailedToSetStorageBuffer */, \" storage key: \" + prefixedKey + \", \" + getExceptionName(e) + \". Buffer cleared\", { exception: dumpObj(e) });\r\n }\r\n }\r\n // this removes buffer with prefix+key\r\n function _getPreviousEvents() {\r\n var items = [];\r\n try {\r\n arrForEach(PREVIOUS_KEYS, function (key) {\r\n var events = _getItemsFromPreviousKey(key);\r\n items = items[_DYN_CONCAT /* @min:%2econcat */](events);\r\n // to make sure that we also transfer items from old prefixed + key buffer\r\n if (_namePrefix) {\r\n var prefixedKey = _namePrefix + \"_\" + key;\r\n var prefixEvents = _getItemsFromPreviousKey(prefixedKey);\r\n items = items[_DYN_CONCAT /* @min:%2econcat */](prefixEvents);\r\n }\r\n });\r\n return items;\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 41 /* _eInternalMessageId.FailedToSetStorageBuffer */, \"Transfer events from previous buffers: \" + getExceptionName(e) + \". previous Buffer items can not be removed\", { exception: dumpObj(e) });\r\n }\r\n return [];\r\n }\r\n // transform string[] to IInternalStorageItem[]\r\n function _getItemsFromPreviousKey(key) {\r\n try {\r\n var items = _getBufferBase(key);\r\n var transFormedItems_1 = [];\r\n arrForEach(items, function (item) {\r\n var internalItem = {\r\n item: item,\r\n cnt: 0 // previous events will be default to 0 count\r\n };\r\n transFormedItems_1[_DYN_PUSH /* @min:%2epush */](internalItem);\r\n });\r\n // remove the session storage if we can add events back\r\n utlRemoveSessionStorage(logger, key);\r\n return transFormedItems_1;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return [];\r\n }\r\n });\r\n return _this;\r\n }\r\n SessionStorageSendBuffer.prototype.enqueue = function (payload) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n SessionStorageSendBuffer.prototype.clear = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n SessionStorageSendBuffer.prototype.markAsSent = function (payload) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n SessionStorageSendBuffer.prototype.clearSent = function (payload) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n SessionStorageSendBuffer.prototype.createNew = function (newLogger, newConfig, canUseSessionStorage) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n var _a;\r\n _a = SessionStorageSendBuffer;\r\n SessionStorageSendBuffer.VERSION = \"_1\";\r\n SessionStorageSendBuffer.BUFFER_KEY = \"AI_buffer\" + _a.VERSION;\r\n SessionStorageSendBuffer.SENT_BUFFER_KEY = \"AI_sentBuffer\" + _a.VERSION;\r\n // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped.\r\n SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000;\r\n return SessionStorageSendBuffer;\r\n}(BaseSendBuffer));\r\nexport { SessionStorageSendBuffer };\r\n//# sourceMappingURL=SendBuffer.js.map","var _a, _b;\r\nimport { __assign, __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { BreezeChannelIdentifier, DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, Event, Exception, Metric, PageView, PageViewPerformance, ProcessLegacy, RemoteDependencyData, RequestHeaders, SampleRate, Trace, createOfflineListener, isInternalApplicationInsightsEndpoint, utlCanUseSessionStorage, utlSetStoragePrefix } from \"@microsoft/applicationinsights-common\";\r\nimport { ActiveStatus, BaseTelemetryPlugin, SenderPostManager, _throwInternal, _warnToConsole, arrForEach, cfgDfBoolean, cfgDfValidate, createProcessTelemetryContext, createUniqueNamespace, dateNow, dumpObj, formatErrorMessageXdr, formatErrorMessageXhr, getExceptionName, getIEVersion, isArray, isBeaconsSupported, isFetchSupported, isNullOrUndefined, mergeEvtNamespace, objExtend, onConfigChange, parseResponse, prependTransports, runTargetUnload } from \"@microsoft/applicationinsights-core-js\";\r\nimport { isNumber, isPromiseLike, isString, isTruthy, mathFloor, mathMax, mathMin, objDeepFreeze, objDefine, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { DependencyEnvelopeCreator, EventEnvelopeCreator, ExceptionEnvelopeCreator, MetricEnvelopeCreator, PageViewEnvelopeCreator, PageViewPerformanceEnvelopeCreator, TraceEnvelopeCreator } from \"./EnvelopeCreator\";\r\nimport { ArraySendBuffer, SessionStorageSendBuffer } from \"./SendBuffer\";\r\nimport { Serializer } from \"./Serializer\";\r\nimport { Sample } from \"./TelemetryProcessors/Sample\";\r\nimport { _DYN_ALWAYS_USE_XHR_OVERR4, _DYN_BASE_TYPE, _DYN_BUFFER_OVERRIDE, _DYN_CLEAR, _DYN_CLEAR_SENT, _DYN_COUNT, _DYN_CUSTOM_HEADERS, _DYN_DIAG_LOG, _DYN_DISABLE_SEND_BEACON_7, _DYN_EMIT_LINE_DELIMITED_0, _DYN_ENABLE_SESSION_STORA5, _DYN_ENDPOINT_URL, _DYN_ENQUEUE, _DYN_GET_SENDER_INST, _DYN_INITIALIZE, _DYN_INSTRUMENTATION_KEY, _DYN_IS_BEACON_API_DISABL3, _DYN_ITEMS_ACCEPTED, _DYN_ITEMS_RECEIVED, _DYN_LENGTH, _DYN_MARK_AS_SENT, _DYN_MAX_BATCH_SIZE_IN_BY1, _DYN_ONUNLOAD_DISABLE_BEA2, _DYN_ONUNLOAD_DISABLE_FET6, _DYN_PUSH, _DYN_SAMPLE_RATE, _DYN_TAGS, _DYN_TRIGGER_SEND, _DYN__BUFFER, _DYN__ON_ERROR, _DYN__ON_PARTIAL_SUCCESS, _DYN__ON_SUCCESS, _DYN__SENDER } from \"./__DynamicConstants\";\r\nvar UNDEFINED_VALUE = undefined;\r\nvar EMPTY_STR = \"\";\r\nvar FetchSyncRequestSizeLimitBytes = 65000; // approx 64kb (the current Edge, Firefox and Chrome max limit)\r\nfunction _getResponseText(xhr) {\r\n try {\r\n return xhr.responseText;\r\n }\r\n catch (e) {\r\n // Best effort, as XHR may throw while XDR wont so just ignore\r\n }\r\n return null;\r\n}\r\nfunction isOverrideFn(httpXHROverride) {\r\n return httpXHROverride && httpXHROverride.sendPOST;\r\n}\r\nvar defaultAppInsightsChannelConfig = objDeepFreeze((_a = {\r\n // Use the default value (handles empty string in the configuration)\r\n endpointUrl: cfgDfValidate(isTruthy, DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH)\r\n },\r\n _a[_DYN_EMIT_LINE_DELIMITED_0 /* @min:emitLineDelimitedJson */] = cfgDfBoolean(),\r\n _a.maxBatchInterval = 15000,\r\n _a[_DYN_MAX_BATCH_SIZE_IN_BY1 /* @min:maxBatchSizeInBytes */] = 102400,\r\n _a.disableTelemetry = cfgDfBoolean(),\r\n _a[_DYN_ENABLE_SESSION_STORA5 /* @min:enableSessionStorageBuffer */] = cfgDfBoolean(true),\r\n _a.isRetryDisabled = cfgDfBoolean(),\r\n _a[_DYN_IS_BEACON_API_DISABL3 /* @min:isBeaconApiDisabled */] = cfgDfBoolean(true),\r\n _a[_DYN_DISABLE_SEND_BEACON_7 /* @min:disableSendBeaconSplit */] = cfgDfBoolean(true),\r\n _a.disableXhr = cfgDfBoolean(),\r\n _a[_DYN_ONUNLOAD_DISABLE_FET6 /* @min:onunloadDisableFetch */] = cfgDfBoolean(),\r\n _a[_DYN_ONUNLOAD_DISABLE_BEA2 /* @min:onunloadDisableBeacon */] = cfgDfBoolean(),\r\n _a[_DYN_INSTRUMENTATION_KEY /* @min:instrumentationKey */] = UNDEFINED_VALUE,\r\n _a.namePrefix = UNDEFINED_VALUE,\r\n _a.samplingPercentage = cfgDfValidate(_chkSampling, 100),\r\n _a[_DYN_CUSTOM_HEADERS /* @min:customHeaders */] = UNDEFINED_VALUE,\r\n _a.convertUndefined = UNDEFINED_VALUE,\r\n _a.eventsLimitInMem = 10000,\r\n _a[_DYN_BUFFER_OVERRIDE /* @min:bufferOverride */] = false,\r\n _a.httpXHROverride = { isVal: isOverrideFn, v: UNDEFINED_VALUE },\r\n _a[_DYN_ALWAYS_USE_XHR_OVERR4 /* @min:alwaysUseXhrOverride */] = cfgDfBoolean(),\r\n _a.transports = UNDEFINED_VALUE,\r\n _a.retryCodes = UNDEFINED_VALUE,\r\n _a.maxRetryCnt = { isVal: isNumber, v: 10 },\r\n _a));\r\nfunction _chkSampling(value) {\r\n return !isNaN(value) && value > 0 && value <= 100;\r\n}\r\nvar EnvelopeTypeCreator = (_b = {},\r\n _b[Event.dataType] = EventEnvelopeCreator,\r\n _b[Trace.dataType] = TraceEnvelopeCreator,\r\n _b[PageView.dataType] = PageViewEnvelopeCreator,\r\n _b[PageViewPerformance.dataType] = PageViewPerformanceEnvelopeCreator,\r\n _b[Exception.dataType] = ExceptionEnvelopeCreator,\r\n _b[Metric.dataType] = MetricEnvelopeCreator,\r\n _b[RemoteDependencyData.dataType] = DependencyEnvelopeCreator,\r\n _b);\r\nvar Sender = /** @class */ (function (_super) {\r\n __extends(Sender, _super);\r\n function Sender() {\r\n var _this = _super.call(this) || this;\r\n _this.priority = 1001;\r\n _this.identifier = BreezeChannelIdentifier;\r\n // Don't set the defaults here, set them in the _initDefaults() as this is also called during unload\r\n var _consecutiveErrors; // How many times in a row a retryable error condition has occurred.\r\n var _retryAt; // The time to retry at in milliseconds from 1970/01/01 (this makes the timer calculation easy).\r\n var _lastSend; // The time of the last send operation.\r\n var _paused; // Flag indicating that the sending should be paused\r\n var _timeoutHandle; // Handle to the timer for delayed sending of batches of data.\r\n var _serializer;\r\n var _stamp_specific_redirects;\r\n var _headers;\r\n var _syncFetchPayload = 0; // Keep track of the outstanding sync fetch payload total (as sync fetch has limits)\r\n var _syncUnloadSender; // The identified sender to use for the synchronous unload stage\r\n var _offlineListener;\r\n var _evtNamespace;\r\n var _endpointUrl;\r\n var _orgEndpointUrl;\r\n var _maxBatchSizeInBytes;\r\n var _beaconSupported;\r\n var _beaconOnUnloadSupported;\r\n var _beaconNormalSupported;\r\n var _customHeaders;\r\n var _disableTelemetry;\r\n var _instrumentationKey;\r\n var _convertUndefined;\r\n var _isRetryDisabled;\r\n var _maxBatchInterval;\r\n var _sessionStorageUsed;\r\n var _bufferOverrideUsed;\r\n var _namePrefix;\r\n var _enableSendPromise;\r\n var _alwaysUseCustomSend;\r\n var _disableXhr;\r\n var _fetchKeepAlive;\r\n var _xhrSend;\r\n var _fallbackSend;\r\n var _disableBeaconSplit;\r\n var _sendPostMgr;\r\n var _retryCodes;\r\n dynamicProto(Sender, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.pause = function () {\r\n _clearScheduledTimer();\r\n _paused = true;\r\n };\r\n _self.resume = function () {\r\n if (_paused) {\r\n _paused = false;\r\n _retryAt = null;\r\n // flush if we have exceeded the max-size already\r\n _checkMaxSize();\r\n _setupTimer();\r\n }\r\n };\r\n _self.flush = function (isAsync, callBack, sendReason) {\r\n if (isAsync === void 0) { isAsync = true; }\r\n if (!_paused) {\r\n // Clear the normal schedule timer as we are going to try and flush ASAP\r\n _clearScheduledTimer();\r\n try {\r\n return _self[_DYN_TRIGGER_SEND /* @min:%2etriggerSend */](isAsync, null, sendReason || 1 /* SendRequestReason.ManualFlush */);\r\n }\r\n catch (e) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 22 /* _eInternalMessageId.FlushFailed */, \"flush failed, telemetry will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n };\r\n _self.onunloadFlush = function () {\r\n if (!_paused) {\r\n if (_beaconSupported || _alwaysUseCustomSend) {\r\n try {\r\n return _self[_DYN_TRIGGER_SEND /* @min:%2etriggerSend */](true, _doUnloadSend, 2 /* SendRequestReason.Unload */);\r\n }\r\n catch (e) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 20 /* _eInternalMessageId.FailedToSendQueuedTelemetry */, \"failed to flush with beacon sender on page unload, telemetry will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n else {\r\n _self.flush(false);\r\n }\r\n }\r\n };\r\n _self.addHeader = function (name, value) {\r\n _headers[name] = value;\r\n };\r\n _self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, core, extensions, pluginChain) {\r\n if (_self.isInitialized()) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 28 /* _eInternalMessageId.SenderNotInitialized */, \"Sender is already initialized\");\r\n }\r\n _base[_DYN_INITIALIZE /* @min:%2einitialize */](config, core, extensions, pluginChain);\r\n var identifier = _self.identifier;\r\n _serializer = new Serializer(core.logger);\r\n _consecutiveErrors = 0;\r\n _retryAt = null;\r\n _lastSend = 0;\r\n _self[_DYN__SENDER /* @min:%2e_sender */] = null;\r\n _stamp_specific_redirects = 0;\r\n var diagLog = _self[_DYN_DIAG_LOG /* @min:%2ediagLog */]();\r\n _evtNamespace = mergeEvtNamespace(createUniqueNamespace(\"Sender\"), core.evtNamespace && core.evtNamespace());\r\n _offlineListener = createOfflineListener(_evtNamespace);\r\n // This function will be re-called whenever any referenced configuration is changed\r\n _self._addHook(onConfigChange(config, function (details) {\r\n var config = details.cfg;\r\n if (config.storagePrefix) {\r\n utlSetStoragePrefix(config.storagePrefix);\r\n }\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n // getExtCfg only finds undefined values from core\r\n var senderConfig = ctx.getExtCfg(identifier, defaultAppInsightsChannelConfig);\r\n var curExtUrl = senderConfig[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */];\r\n // if it is not inital change (_endpointUrl has value)\r\n // if current sender endpoint url is not changed directly\r\n // means ExtCfg is not changed directly\r\n // then we need to monitor endpoint url changes from core\r\n if (_endpointUrl && curExtUrl === _endpointUrl) {\r\n var coreUrl = config[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */];\r\n // if core endpoint url is changed\r\n if (coreUrl && coreUrl !== curExtUrl) {\r\n // and endpoint promise changes is handled by this as well\r\n senderConfig[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */] = coreUrl;\r\n }\r\n }\r\n if (isPromiseLike(senderConfig[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */])) {\r\n // if it is promise, means the endpoint url is from core.endpointurl\r\n senderConfig[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */] = config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];\r\n }\r\n objDefine(_self, \"_senderConfig\", {\r\n g: function () {\r\n return senderConfig;\r\n }\r\n });\r\n // Only update the endpoint if the original config !== the current config\r\n // This is so any redirect endpointUrl is not overwritten\r\n if (_orgEndpointUrl !== senderConfig[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */]) {\r\n if (_orgEndpointUrl) {\r\n // TODO: add doc to remind users to flush before changing endpoint, otherwise all unsent payload will be sent to new endpoint\r\n }\r\n _endpointUrl = _orgEndpointUrl = senderConfig[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */];\r\n }\r\n // or is not string\r\n if (core.activeStatus() === ActiveStatus.PENDING) {\r\n // waiting for core promises to be resolved\r\n // NOTE: if active status is set to pending, stop sending, clear timer here\r\n _self.pause();\r\n }\r\n else if (core.activeStatus() === ActiveStatus.ACTIVE) {\r\n // core status changed from pending to other status\r\n _self.resume();\r\n }\r\n if (_customHeaders && _customHeaders !== senderConfig[_DYN_CUSTOM_HEADERS /* @min:%2ecustomHeaders */]) {\r\n // Removing any previously defined custom headers as they have changed\r\n arrForEach(_customHeaders, function (customHeader) {\r\n delete _headers[customHeader.header];\r\n });\r\n }\r\n _maxBatchSizeInBytes = senderConfig[_DYN_MAX_BATCH_SIZE_IN_BY1 /* @min:%2emaxBatchSizeInBytes */];\r\n _beaconSupported = (senderConfig[_DYN_ONUNLOAD_DISABLE_BEA2 /* @min:%2eonunloadDisableBeacon */] === false || senderConfig[_DYN_IS_BEACON_API_DISABL3 /* @min:%2eisBeaconApiDisabled */] === false) && isBeaconsSupported();\r\n _beaconOnUnloadSupported = senderConfig[_DYN_ONUNLOAD_DISABLE_BEA2 /* @min:%2eonunloadDisableBeacon */] === false && isBeaconsSupported();\r\n _beaconNormalSupported = senderConfig[_DYN_IS_BEACON_API_DISABL3 /* @min:%2eisBeaconApiDisabled */] === false && isBeaconsSupported();\r\n _alwaysUseCustomSend = senderConfig[_DYN_ALWAYS_USE_XHR_OVERR4 /* @min:%2ealwaysUseXhrOverride */];\r\n _disableXhr = !!senderConfig.disableXhr;\r\n _retryCodes = senderConfig.retryCodes;\r\n var bufferOverride = senderConfig[_DYN_BUFFER_OVERRIDE /* @min:%2ebufferOverride */];\r\n var canUseSessionStorage = !!senderConfig[_DYN_ENABLE_SESSION_STORA5 /* @min:%2eenableSessionStorageBuffer */] &&\r\n (!!bufferOverride || utlCanUseSessionStorage());\r\n var namePrefix = senderConfig.namePrefix;\r\n //Note: emitLineDelimitedJson and eventsLimitInMem is directly accessed via config in senderBuffer\r\n //Therefore, if canUseSessionStorage is not changed, we do not need to re initialize a new one\r\n var shouldUpdate = (canUseSessionStorage !== _sessionStorageUsed)\r\n || (canUseSessionStorage && (_namePrefix !== namePrefix)) // prefixName is only used in session storage\r\n || (canUseSessionStorage && (_bufferOverrideUsed !== bufferOverride));\r\n if (_self[_DYN__BUFFER /* @min:%2e_buffer */]) {\r\n // case1 (Pre and Now enableSessionStorageBuffer settings are same)\r\n // if namePrefix changes, transfer current buffer to new buffer\r\n // else no action needed\r\n //case2 (Pre and Now enableSessionStorageBuffer settings are changed)\r\n // transfer current buffer to new buffer\r\n if (shouldUpdate) {\r\n try {\r\n _self[_DYN__BUFFER /* @min:%2e_buffer */] = _self[_DYN__BUFFER /* @min:%2e_buffer */].createNew(diagLog, senderConfig, canUseSessionStorage);\r\n }\r\n catch (e) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 12 /* _eInternalMessageId.FailedAddingTelemetryToBuffer */, \"failed to transfer telemetry to different buffer storage, telemetry will be lost: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n _checkMaxSize();\r\n }\r\n else {\r\n _self[_DYN__BUFFER /* @min:%2e_buffer */] = canUseSessionStorage\r\n ? new SessionStorageSendBuffer(diagLog, senderConfig) : new ArraySendBuffer(diagLog, senderConfig);\r\n }\r\n _namePrefix = namePrefix;\r\n _sessionStorageUsed = canUseSessionStorage;\r\n _bufferOverrideUsed = bufferOverride;\r\n _fetchKeepAlive = !senderConfig[_DYN_ONUNLOAD_DISABLE_FET6 /* @min:%2eonunloadDisableFetch */] && isFetchSupported(true);\r\n _disableBeaconSplit = !!senderConfig[_DYN_DISABLE_SEND_BEACON_7 /* @min:%2edisableSendBeaconSplit */];\r\n _self._sample = new Sample(senderConfig.samplingPercentage, diagLog);\r\n _instrumentationKey = senderConfig[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];\r\n if (!isPromiseLike(_instrumentationKey) && !_validateInstrumentationKey(_instrumentationKey, config)) {\r\n _throwInternal(diagLog, 1 /* eLoggingSeverity.CRITICAL */, 100 /* _eInternalMessageId.InvalidInstrumentationKey */, \"Invalid Instrumentation key \" + _instrumentationKey);\r\n }\r\n _customHeaders = senderConfig[_DYN_CUSTOM_HEADERS /* @min:%2ecustomHeaders */];\r\n if (isString(_endpointUrl) && !isInternalApplicationInsightsEndpoint(_endpointUrl) && _customHeaders && _customHeaders[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(_customHeaders, function (customHeader) {\r\n _this.addHeader(customHeader.header, customHeader.value);\r\n });\r\n }\r\n else {\r\n _customHeaders = null;\r\n }\r\n _enableSendPromise = senderConfig.enableSendPromise;\r\n var sendPostConfig = _getSendPostMgrConfig();\r\n // only init it once\r\n if (!_sendPostMgr) {\r\n _sendPostMgr = new SenderPostManager();\r\n _sendPostMgr[_DYN_INITIALIZE /* @min:%2einitialize */](sendPostConfig, diagLog);\r\n }\r\n else {\r\n _sendPostMgr.SetConfig(sendPostConfig);\r\n }\r\n var customInterface = senderConfig.httpXHROverride;\r\n var httpInterface = null;\r\n var syncInterface = null;\r\n // User requested transport(s) values > Beacon > Fetch > XHR\r\n // Beacon would be filtered out if user has set disableBeaconApi to true at _getSenderInterface\r\n var theTransports = prependTransports([3 /* TransportType.Beacon */, 1 /* TransportType.Xhr */, 2 /* TransportType.Fetch */], senderConfig.transports);\r\n httpInterface = _sendPostMgr && _sendPostMgr[_DYN_GET_SENDER_INST /* @min:%2egetSenderInst */](theTransports, false);\r\n var xhrInterface = _sendPostMgr && _sendPostMgr.getFallbackInst();\r\n _xhrSend = function (payload, isAsync) {\r\n return _doSend(xhrInterface, payload, isAsync);\r\n };\r\n _fallbackSend = function (payload, isAsync) {\r\n return _doSend(xhrInterface, payload, isAsync, false);\r\n };\r\n httpInterface = _alwaysUseCustomSend ? customInterface : (httpInterface || customInterface || xhrInterface);\r\n _self[_DYN__SENDER /* @min:%2e_sender */] = function (payload, isAsync) {\r\n return _doSend(httpInterface, payload, isAsync);\r\n };\r\n if (_fetchKeepAlive) {\r\n // Try and use the fetch with keepalive\r\n _syncUnloadSender = _fetchKeepAliveSender;\r\n }\r\n var syncTransports = prependTransports([3 /* TransportType.Beacon */, 1 /* TransportType.Xhr */], senderConfig.unloadTransports);\r\n if (!_fetchKeepAlive) {\r\n // remove fetch from theTransports\r\n syncTransports = syncTransports.filter(function (transport) { return transport !== 2 /* TransportType.Fetch */; });\r\n }\r\n syncInterface = _sendPostMgr && _sendPostMgr[_DYN_GET_SENDER_INST /* @min:%2egetSenderInst */](syncTransports, true);\r\n syncInterface = _alwaysUseCustomSend ? customInterface : (syncInterface || customInterface);\r\n if ((_alwaysUseCustomSend || senderConfig.unloadTransports || !_syncUnloadSender) && syncInterface) {\r\n _syncUnloadSender = function (payload, isAsync) {\r\n return _doSend(syncInterface, payload, isAsync);\r\n };\r\n }\r\n if (!_syncUnloadSender) {\r\n _syncUnloadSender = _xhrSend;\r\n }\r\n _disableTelemetry = senderConfig.disableTelemetry;\r\n _convertUndefined = senderConfig.convertUndefined || UNDEFINED_VALUE;\r\n _isRetryDisabled = senderConfig.isRetryDisabled;\r\n _maxBatchInterval = senderConfig.maxBatchInterval;\r\n }));\r\n };\r\n _self.processTelemetry = function (telemetryItem, itemCtx) {\r\n itemCtx = _self._getTelCtx(itemCtx);\r\n var diagLogger = itemCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */]();\r\n try {\r\n var isValidate = _validate(telemetryItem, diagLogger);\r\n if (!isValidate) {\r\n return;\r\n }\r\n var aiEnvelope = _getEnvelope(telemetryItem, diagLogger);\r\n if (!aiEnvelope) {\r\n return;\r\n }\r\n // check if the incoming payload is too large, truncate if necessary\r\n var payload = _serializer.serialize(aiEnvelope);\r\n // flush if we would exceed the max-size limit by adding this item\r\n var buffer = _self[_DYN__BUFFER /* @min:%2e_buffer */];\r\n _checkMaxSize(payload);\r\n var payloadItem = {\r\n item: payload,\r\n cnt: 0 // inital cnt will always be 0\r\n };\r\n // enqueue the payload\r\n buffer[_DYN_ENQUEUE /* @min:%2eenqueue */](payloadItem);\r\n // ensure an invocation timeout is set\r\n _setupTimer();\r\n }\r\n catch (e) {\r\n _throwInternal(diagLogger, 2 /* eLoggingSeverity.WARNING */, 12 /* _eInternalMessageId.FailedAddingTelemetryToBuffer */, \"Failed adding telemetry to the sender's buffer, some telemetry will be lost: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n // hand off the telemetry item to the next plugin\r\n _self.processNext(telemetryItem, itemCtx);\r\n };\r\n _self.isCompletelyIdle = function () {\r\n return !_paused && _syncFetchPayload === 0 && _self._buffer[_DYN_COUNT /* @min:%2ecount */]() === 0;\r\n };\r\n _self.getOfflineListener = function () {\r\n return _offlineListener;\r\n };\r\n /**\r\n * xhr state changes\r\n */\r\n _self._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) {\r\n // since version 3.2.0, this function is no-op\r\n if (_isStringArr(payload)) {\r\n return;\r\n }\r\n return _xhrReadyStateChange(xhr, payload, countOfItemsInPayload);\r\n };\r\n /**\r\n * Immediately send buffered data\r\n * @param async - Indicates if the events should be sent asynchronously\r\n * @param forcedSender - Indicates the forcedSender, undefined if not passed\r\n */\r\n _self[_DYN_TRIGGER_SEND /* @min:%2etriggerSend */] = function (async, forcedSender, sendReason) {\r\n if (async === void 0) { async = true; }\r\n var result;\r\n if (!_paused) {\r\n try {\r\n var buffer = _self[_DYN__BUFFER /* @min:%2e_buffer */];\r\n // Send data only if disableTelemetry is false\r\n if (!_disableTelemetry) {\r\n if (buffer[_DYN_COUNT /* @min:%2ecount */]() > 0) {\r\n var payload = buffer.getItems();\r\n _notifySendRequest(sendReason || 0 /* SendRequestReason.Undefined */, async);\r\n // invoke send\r\n if (forcedSender) {\r\n result = forcedSender.call(_self, payload, async);\r\n }\r\n else {\r\n result = _self[_DYN__SENDER /* @min:%2e_sender */](payload, async);\r\n }\r\n }\r\n // update lastSend time to enable throttling\r\n _lastSend = +new Date;\r\n }\r\n else {\r\n buffer[_DYN_CLEAR /* @min:%2eclear */]();\r\n }\r\n _clearScheduledTimer();\r\n }\r\n catch (e) {\r\n /* Ignore this error for IE under v10 */\r\n var ieVer = getIEVersion();\r\n if (!ieVer || ieVer > 9) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 40 /* _eInternalMessageId.TransmissionFailed */, \"Telemetry transmission failed, some telemetry will be lost: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n }\r\n return result;\r\n };\r\n _self.getOfflineSupport = function () {\r\n return {\r\n getUrl: function () {\r\n return _endpointUrl;\r\n },\r\n createPayload: _createPayload,\r\n serialize: _serialize,\r\n batch: _batch,\r\n shouldProcess: function (evt) {\r\n return !!_validate(evt);\r\n }\r\n };\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n _self.onunloadFlush();\r\n runTargetUnload(_offlineListener, false);\r\n _initDefaults();\r\n };\r\n /**\r\n * error handler\r\n */\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */] = function (payload, message, event) {\r\n // since version 3.1.3, string[] is no-op\r\n if (_isStringArr(payload)) {\r\n return;\r\n }\r\n return _onError(payload, message, event);\r\n };\r\n /**\r\n * partial success handler\r\n */\r\n _self[_DYN__ON_PARTIAL_SUCCESS /* @min:%2e_onPartialSuccess */] = function (payload, results) {\r\n // since version 3.1.3, string[] is no-op\r\n if (_isStringArr(payload)) {\r\n return;\r\n }\r\n return _onPartialSuccess(payload, results);\r\n };\r\n /**\r\n * success handler\r\n */\r\n _self[_DYN__ON_SUCCESS /* @min:%2e_onSuccess */] = function (payload, countOfItemsInPayload) {\r\n // since version 3.1.3, string[] is no-op\r\n if (_isStringArr(payload)) {\r\n return;\r\n }\r\n return _onSuccess(payload, countOfItemsInPayload);\r\n //_self._buffer && _self._buffer.clearSent(payload);\r\n };\r\n /**\r\n * xdr state changes\r\n */\r\n _self._xdrOnLoad = function (xdr, payload) {\r\n // since version 3.1.3, string[] is no-op\r\n if (_isStringArr(payload)) {\r\n return;\r\n }\r\n return _xdrOnLoad(xdr, payload);\r\n };\r\n function _xdrOnLoad(xdr, payload) {\r\n var responseText = _getResponseText(xdr);\r\n if (xdr && (responseText + \"\" === \"200\" || responseText === \"\")) {\r\n _consecutiveErrors = 0;\r\n _self[_DYN__ON_SUCCESS /* @min:%2e_onSuccess */](payload, 0);\r\n }\r\n else {\r\n var results = parseResponse(responseText);\r\n if (results && results[_DYN_ITEMS_RECEIVED /* @min:%2eitemsReceived */] && results[_DYN_ITEMS_RECEIVED /* @min:%2eitemsReceived */] > results[_DYN_ITEMS_ACCEPTED /* @min:%2eitemsAccepted */]\r\n && !_isRetryDisabled) {\r\n _self[_DYN__ON_PARTIAL_SUCCESS /* @min:%2e_onPartialSuccess */](payload, results);\r\n }\r\n else {\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */](payload, formatErrorMessageXdr(xdr));\r\n }\r\n }\r\n }\r\n function _getSendPostMgrConfig() {\r\n try {\r\n var onCompleteFuncs = {\r\n xdrOnComplete: function (xdr, oncomplete, payload) {\r\n var data = _getPayloadArr(payload);\r\n if (!data) {\r\n return;\r\n }\r\n return _xdrOnLoad(xdr, data);\r\n },\r\n fetchOnComplete: function (response, onComplete, resValue, payload) {\r\n var data = _getPayloadArr(payload);\r\n if (!data) {\r\n return;\r\n }\r\n return _checkResponsStatus(response.status, data, response.url, data[_DYN_LENGTH /* @min:%2elength */], response.statusText, resValue || \"\");\r\n },\r\n xhrOnComplete: function (request, oncomplete, payload) {\r\n var data = _getPayloadArr(payload);\r\n if (!data) {\r\n return;\r\n }\r\n return _xhrReadyStateChange(request, data, data[_DYN_LENGTH /* @min:%2elength */]);\r\n },\r\n beaconOnRetry: function (data, onComplete, canSend) {\r\n return _onBeaconRetry(data, onComplete, canSend);\r\n }\r\n };\r\n var config = {\r\n enableSendPromise: _enableSendPromise,\r\n isOneDs: false,\r\n disableCredentials: false,\r\n disableXhr: _disableXhr,\r\n disableBeacon: !_beaconNormalSupported,\r\n disableBeaconSync: !_beaconOnUnloadSupported,\r\n senderOnCompleteCallBack: onCompleteFuncs\r\n };\r\n return config;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n /**\r\n * xhr state changes\r\n */\r\n function _xhrReadyStateChange(xhr, payload, countOfItemsInPayload) {\r\n if (xhr.readyState === 4) {\r\n _checkResponsStatus(xhr.status, payload, xhr.responseURL, countOfItemsInPayload, formatErrorMessageXhr(xhr), _getResponseText(xhr) || xhr.response);\r\n }\r\n }\r\n /**\r\n * error handler\r\n */\r\n function _onError(payload, message, event) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 26 /* _eInternalMessageId.OnError */, \"Failed to send telemetry.\", { message: message });\r\n _self._buffer && _self._buffer[_DYN_CLEAR_SENT /* @min:%2eclearSent */](payload);\r\n }\r\n /**\r\n * partial success handler\r\n */\r\n function _onPartialSuccess(payload, results) {\r\n var failed = [];\r\n var retry = [];\r\n // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item.\r\n var errors = results.errors.reverse();\r\n for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) {\r\n var error = errors_1[_i];\r\n var extracted = payload.splice(error.index, 1)[0];\r\n if (_isRetriable(error.statusCode)) {\r\n retry[_DYN_PUSH /* @min:%2epush */](extracted);\r\n }\r\n else {\r\n // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache).\r\n failed[_DYN_PUSH /* @min:%2epush */](extracted);\r\n }\r\n }\r\n if (payload[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _self[_DYN__ON_SUCCESS /* @min:%2e_onSuccess */](payload, results[_DYN_ITEMS_ACCEPTED /* @min:%2eitemsAccepted */]);\r\n }\r\n if (failed[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */](failed, formatErrorMessageXhr(null, [\"partial success\", results[_DYN_ITEMS_ACCEPTED /* @min:%2eitemsAccepted */], \"of\", results.itemsReceived].join(\" \")));\r\n }\r\n if (retry[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _resendPayload(retry);\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \"Partial success. \" +\r\n \"Delivered: \" + payload[_DYN_LENGTH /* @min:%2elength */] + \", Failed: \" + failed[_DYN_LENGTH /* @min:%2elength */] +\r\n \". Will retry to send \" + retry[_DYN_LENGTH /* @min:%2elength */] + \" our of \" + results[_DYN_ITEMS_RECEIVED /* @min:%2eitemsReceived */] + \" items\");\r\n }\r\n }\r\n /**\r\n * success handler\r\n */\r\n function _onSuccess(payload, countOfItemsInPayload) {\r\n _self._buffer && _self._buffer[_DYN_CLEAR_SENT /* @min:%2eclearSent */](payload);\r\n }\r\n function _getPayloadArr(payload) {\r\n try {\r\n if (payload) {\r\n var internalPayload = payload;\r\n var arr = internalPayload.oriPayload;\r\n if (arr && arr[_DYN_LENGTH /* @min:%2elength */]) {\r\n return arr;\r\n }\r\n return null;\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n function _validate(telemetryItem, diagLogger) {\r\n if (_disableTelemetry) {\r\n // Do not send/save data\r\n return false;\r\n }\r\n // validate input\r\n if (!telemetryItem) {\r\n diagLogger && _throwInternal(diagLogger, 1 /* eLoggingSeverity.CRITICAL */, 7 /* _eInternalMessageId.CannotSendEmptyTelemetry */, \"Cannot send empty telemetry\");\r\n return false;\r\n }\r\n // validate event\r\n if (telemetryItem.baseData && !telemetryItem[_DYN_BASE_TYPE /* @min:%2ebaseType */]) {\r\n diagLogger && _throwInternal(diagLogger, 1 /* eLoggingSeverity.CRITICAL */, 70 /* _eInternalMessageId.InvalidEvent */, \"Cannot send telemetry without baseData and baseType\");\r\n return false;\r\n }\r\n if (!telemetryItem[_DYN_BASE_TYPE /* @min:%2ebaseType */]) {\r\n // Default\r\n telemetryItem[_DYN_BASE_TYPE /* @min:%2ebaseType */] = \"EventData\";\r\n }\r\n // ensure a sender was constructed\r\n if (!_self[_DYN__SENDER /* @min:%2e_sender */]) {\r\n diagLogger && _throwInternal(diagLogger, 1 /* eLoggingSeverity.CRITICAL */, 28 /* _eInternalMessageId.SenderNotInitialized */, \"Sender was not initialized\");\r\n return false;\r\n }\r\n // check if this item should be sampled in, else add sampleRate tag\r\n if (!_isSampledIn(telemetryItem)) {\r\n // Item is sampled out, do not send it\r\n diagLogger && _throwInternal(diagLogger, 2 /* eLoggingSeverity.WARNING */, 33 /* _eInternalMessageId.TelemetrySampledAndNotSent */, \"Telemetry item was sampled out and not sent\", { SampleRate: _self._sample[_DYN_SAMPLE_RATE /* @min:%2esampleRate */] });\r\n return false;\r\n }\r\n else {\r\n telemetryItem[SampleRate] = _self._sample[_DYN_SAMPLE_RATE /* @min:%2esampleRate */];\r\n }\r\n return true;\r\n }\r\n function _getEnvelope(telemetryItem, diagLogger) {\r\n // construct an envelope that Application Insights endpoint can understand\r\n // if ikey of telemetry is provided and not empty, envelope will use this iKey instead of senderConfig iKey\r\n var defaultEnvelopeIkey = telemetryItem.iKey || _instrumentationKey;\r\n var aiEnvelope = Sender.constructEnvelope(telemetryItem, defaultEnvelopeIkey, diagLogger, _convertUndefined);\r\n if (!aiEnvelope) {\r\n _throwInternal(diagLogger, 1 /* eLoggingSeverity.CRITICAL */, 47 /* _eInternalMessageId.CreateEnvelopeError */, \"Unable to create an AppInsights envelope\");\r\n return;\r\n }\r\n var doNotSendItem = false;\r\n // this is for running in legacy mode, where customer may already have a custom initializer present\r\n if (telemetryItem[_DYN_TAGS /* @min:%2etags */] && telemetryItem[_DYN_TAGS /* @min:%2etags */][ProcessLegacy]) {\r\n arrForEach(telemetryItem[_DYN_TAGS /* @min:%2etags */][ProcessLegacy], function (callBack) {\r\n try {\r\n if (callBack && callBack(aiEnvelope) === false) {\r\n doNotSendItem = true;\r\n _warnToConsole(diagLogger, \"Telemetry processor check returns false\");\r\n }\r\n }\r\n catch (e) {\r\n // log error but dont stop executing rest of the telemetry initializers\r\n // doNotSendItem = true;\r\n _throwInternal(diagLogger, 1 /* eLoggingSeverity.CRITICAL */, 64 /* _eInternalMessageId.TelemetryInitializerFailed */, \"One of telemetry initializers failed, telemetry item will not be sent: \" + getExceptionName(e), { exception: dumpObj(e) }, true);\r\n }\r\n });\r\n delete telemetryItem[_DYN_TAGS /* @min:%2etags */][ProcessLegacy];\r\n }\r\n if (doNotSendItem) {\r\n return; // do not send, no need to execute next plugin\r\n }\r\n return aiEnvelope;\r\n }\r\n function _serialize(item) {\r\n var rlt = EMPTY_STR;\r\n var diagLogger = _self[_DYN_DIAG_LOG /* @min:%2ediagLog */]();\r\n try {\r\n var valid = _validate(item, diagLogger);\r\n var envelope = null;\r\n if (valid) {\r\n envelope = _getEnvelope(item, diagLogger);\r\n }\r\n if (envelope) {\r\n rlt = _serializer.serialize(envelope);\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return rlt;\r\n }\r\n function _batch(arr) {\r\n var rlt = EMPTY_STR;\r\n if (arr && arr[_DYN_LENGTH /* @min:%2elength */]) {\r\n rlt = \"[\" + arr.join(\",\") + \"]\";\r\n }\r\n return rlt;\r\n }\r\n function _createPayload(data) {\r\n var headers = _getHeaders();\r\n return {\r\n urlString: _endpointUrl,\r\n data: data,\r\n headers: headers\r\n };\r\n }\r\n function _isSampledIn(envelope) {\r\n return _self._sample.isSampledIn(envelope);\r\n }\r\n function _getOnComplete(payload, status, headers, response) {\r\n // ***********************************************************************************************\r\n //TODO: handle other status codes\r\n if (status === 200 && payload) {\r\n _self._onSuccess(payload, payload[_DYN_LENGTH /* @min:%2elength */]);\r\n }\r\n else {\r\n response && _self[_DYN__ON_ERROR /* @min:%2e_onError */](payload, response);\r\n }\r\n }\r\n function _doSend(sendInterface, payload, isAsync, markAsSent) {\r\n if (markAsSent === void 0) { markAsSent = true; }\r\n var onComplete = function (status, headers, response) {\r\n return _getOnComplete(payload, status, headers, response);\r\n };\r\n var payloadData = _getPayload(payload);\r\n var sendPostFunc = sendInterface && sendInterface.sendPOST;\r\n if (sendPostFunc && payloadData) {\r\n // ***********************************************************************************************\r\n // mark payload as sent at the beginning of calling each send function\r\n if (markAsSent) {\r\n _self._buffer[_DYN_MARK_AS_SENT /* @min:%2emarkAsSent */](payload);\r\n }\r\n return sendPostFunc(payloadData, onComplete, !isAsync);\r\n }\r\n return null;\r\n }\r\n function _getPayload(payload) {\r\n if (isArray(payload) && payload[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var batch = _self[_DYN__BUFFER /* @min:%2e_buffer */].batchPayloads(payload);\r\n var headers = _getHeaders();\r\n var payloadData = {\r\n data: batch,\r\n urlString: _endpointUrl,\r\n headers: headers,\r\n disableXhrSync: _disableXhr,\r\n disableFetchKeepAlive: !_fetchKeepAlive,\r\n oriPayload: payload\r\n };\r\n return payloadData;\r\n }\r\n return null;\r\n }\r\n function _getHeaders() {\r\n try {\r\n var headers = _headers || {};\r\n if (isInternalApplicationInsightsEndpoint(_endpointUrl)) {\r\n headers[RequestHeaders[6 /* eRequestHeaders.sdkContextHeader */]] = RequestHeaders[7 /* eRequestHeaders.sdkContextHeaderAppIdRequest */];\r\n }\r\n return headers;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n function _checkMaxSize(incomingPayload) {\r\n var incomingSize = incomingPayload ? incomingPayload[_DYN_LENGTH /* @min:%2elength */] : 0;\r\n if ((_self[_DYN__BUFFER /* @min:%2e_buffer */].size() + incomingSize) > _maxBatchSizeInBytes) {\r\n if (!_offlineListener || _offlineListener.isOnline()) { // only trigger send when currently online\r\n _self[_DYN_TRIGGER_SEND /* @min:%2etriggerSend */](true, null, 10 /* SendRequestReason.MaxBatchSize */);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n function _checkResponsStatus(status, payload, responseUrl, countOfItemsInPayload, errorMessage, res) {\r\n var response = null;\r\n if (!_self._appId) {\r\n response = parseResponse(res);\r\n if (response && response.appId) {\r\n _self._appId = response.appId;\r\n }\r\n }\r\n if ((status < 200 || status >= 300) && status !== 0) {\r\n // Update End Point url if permanent redirect or moved permanently\r\n // Updates the end point url before retry\r\n if (status === 301 || status === 307 || status === 308) {\r\n if (!_checkAndUpdateEndPointUrl(responseUrl)) {\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */](payload, errorMessage);\r\n return;\r\n }\r\n }\r\n if (_offlineListener && !_offlineListener.isOnline()) { // offline\r\n // Note: Don't check for status == 0, since adblock gives this code\r\n if (!_isRetryDisabled) {\r\n var offlineBackOffMultiplier = 10; // arbritrary number\r\n _resendPayload(payload, offlineBackOffMultiplier);\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". Offline - Response Code: \".concat(status, \". Offline status: \").concat(!_offlineListener.isOnline(), \". Will retry to send \").concat(payload.length, \" items.\"));\r\n }\r\n return;\r\n }\r\n if (!_isRetryDisabled && _isRetriable(status)) {\r\n _resendPayload(payload);\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" +\r\n \"Response code \" + status + \". Will retry to send \" + payload[_DYN_LENGTH /* @min:%2elength */] + \" items.\");\r\n }\r\n else {\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */](payload, errorMessage);\r\n }\r\n }\r\n else {\r\n // check if the xhr's responseURL or fetch's response.url is same as endpoint url\r\n // TODO after 10 redirects force send telemetry with 'redirect=false' as query parameter.\r\n _checkAndUpdateEndPointUrl(responseUrl);\r\n if (status === 206) {\r\n if (!response) {\r\n response = parseResponse(res);\r\n }\r\n if (response && !_isRetryDisabled) {\r\n _self[_DYN__ON_PARTIAL_SUCCESS /* @min:%2e_onPartialSuccess */](payload, response);\r\n }\r\n else {\r\n _self[_DYN__ON_ERROR /* @min:%2e_onError */](payload, errorMessage);\r\n }\r\n }\r\n else {\r\n _consecutiveErrors = 0;\r\n _self[_DYN__ON_SUCCESS /* @min:%2e_onSuccess */](payload, countOfItemsInPayload);\r\n }\r\n }\r\n }\r\n function _checkAndUpdateEndPointUrl(responseUrl) {\r\n // Maximum stamp specific redirects allowed(uncomment this when breeze is ready with not allowing redirects feature)\r\n if (_stamp_specific_redirects >= 10) {\r\n // _self._senderConfig.endpointUrl = () => Sender._getDefaultAppInsightsChannelConfig().endpointUrl()+\"/?redirect=false\";\r\n // _stamp_specific_redirects = 0;\r\n return false;\r\n }\r\n if (!isNullOrUndefined(responseUrl) && responseUrl !== \"\") {\r\n if (responseUrl !== _endpointUrl) {\r\n _endpointUrl = responseUrl;\r\n ++_stamp_specific_redirects;\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function _doUnloadSend(payload, isAsync) {\r\n if (_syncUnloadSender) {\r\n // We are unloading so always call the sender with sync set to false\r\n _syncUnloadSender(payload, false);\r\n }\r\n else {\r\n // Fallback to the previous beacon Sender (which causes a CORB warning on chrome now)\r\n var beaconInst = _sendPostMgr && _sendPostMgr[_DYN_GET_SENDER_INST /* @min:%2egetSenderInst */]([3 /* TransportType.Beacon */], true);\r\n return _doSend(beaconInst, payload, isAsync);\r\n }\r\n }\r\n function _onBeaconRetry(payload, onComplete, canSend) {\r\n var internalPayload = payload;\r\n var data = internalPayload && internalPayload.oriPayload;\r\n if (!_disableBeaconSplit) {\r\n // Failed to send entire payload so try and split data and try to send as much events as possible\r\n var droppedPayload = [];\r\n for (var lp = 0; lp < data[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n var thePayload = data[lp];\r\n var arr = [thePayload];\r\n var item = _getPayload(arr);\r\n if (!canSend(item, onComplete)) {\r\n // Can't send anymore, so split the batch and drop the rest\r\n droppedPayload[_DYN_PUSH /* @min:%2epush */](thePayload);\r\n }\r\n else {\r\n _self._onSuccess(arr, arr[_DYN_LENGTH /* @min:%2elength */]);\r\n }\r\n }\r\n if (droppedPayload[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _fallbackSend && _fallbackSend(droppedPayload, true);\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" + \"Failed to send telemetry with Beacon API, retried with normal sender.\");\r\n }\r\n }\r\n else {\r\n _fallbackSend && _fallbackSend(data, true);\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" + \"Failed to send telemetry with Beacon API, retried with normal sender.\");\r\n }\r\n }\r\n function _isStringArr(arr) {\r\n try {\r\n if (arr && arr[_DYN_LENGTH /* @min:%2elength */]) {\r\n return (isString(arr[0]));\r\n }\r\n }\r\n catch (e) {\r\n //TODO: log, sender use IInternalStorageItem instead of string since 3.1.3\r\n }\r\n return null;\r\n }\r\n function _fetchKeepAliveSender(payload, isAsync) {\r\n var transport = null;\r\n if (isArray(payload)) {\r\n var payloadSize = payload[_DYN_LENGTH /* @min:%2elength */];\r\n for (var lp = 0; lp < payload[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n payloadSize += payload[lp].item[_DYN_LENGTH /* @min:%2elength */];\r\n }\r\n var syncFetchPayload = _sendPostMgr.getSyncFetchPayload();\r\n if ((syncFetchPayload + payloadSize) <= FetchSyncRequestSizeLimitBytes) {\r\n transport = 2 /* TransportType.Fetch */;\r\n }\r\n else if (isBeaconsSupported()) {\r\n // Fallback to beacon sender as we at least get told which events can't be scheduled\r\n transport = 3 /* TransportType.Beacon */;\r\n }\r\n else {\r\n // Payload is going to be too big so just try and send via XHR\r\n transport = 1 /* TransportType.Xhr */;\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 40 /* _eInternalMessageId.TransmissionFailed */, \". \" + \"Failed to send telemetry with Beacon API, retried with xhrSender.\");\r\n }\r\n var inst = _sendPostMgr && _sendPostMgr[_DYN_GET_SENDER_INST /* @min:%2egetSenderInst */]([transport], true);\r\n return _doSend(inst, payload, isAsync);\r\n }\r\n return null;\r\n }\r\n /**\r\n * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff).\r\n * @param payload\r\n */\r\n function _resendPayload(payload, linearFactor) {\r\n if (linearFactor === void 0) { linearFactor = 1; }\r\n if (!payload || payload[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n return;\r\n }\r\n var buffer = _self[_DYN__BUFFER /* @min:%2e_buffer */];\r\n buffer[_DYN_CLEAR_SENT /* @min:%2eclearSent */](payload);\r\n _consecutiveErrors++;\r\n for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) {\r\n var item = payload_1[_i];\r\n item.cnt = item.cnt || 0; // to make sure we have cnt for each payload\r\n item.cnt++; // when resend, increase cnt\r\n buffer[_DYN_ENQUEUE /* @min:%2eenqueue */](item);\r\n }\r\n // setup timer\r\n _setRetryTime(linearFactor);\r\n _setupTimer();\r\n }\r\n /**\r\n * Calculates the time to wait before retrying in case of an error based on\r\n * http://en.wikipedia.org/wiki/Exponential_backoff\r\n */\r\n function _setRetryTime(linearFactor) {\r\n var SlotDelayInSeconds = 10;\r\n var delayInSeconds;\r\n if (_consecutiveErrors <= 1) {\r\n delayInSeconds = SlotDelayInSeconds;\r\n }\r\n else {\r\n var backOffSlot = (Math.pow(2, _consecutiveErrors) - 1) / 2;\r\n // tslint:disable-next-line:insecure-random\r\n var backOffDelay = mathFloor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1;\r\n backOffDelay = linearFactor * backOffDelay;\r\n delayInSeconds = mathMax(mathMin(backOffDelay, 3600), SlotDelayInSeconds);\r\n }\r\n // TODO: Log the backoff time like the C# version does.\r\n var retryAfterTimeSpan = dateNow() + (delayInSeconds * 1000);\r\n // TODO: Log the retry at time like the C# version does.\r\n _retryAt = retryAfterTimeSpan;\r\n }\r\n /**\r\n * Sets up the timer which triggers actually sending the data.\r\n */\r\n function _setupTimer() {\r\n if (!_timeoutHandle && !_paused) {\r\n var retryInterval = _retryAt ? mathMax(0, _retryAt - dateNow()) : 0;\r\n var timerValue = mathMax(_maxBatchInterval, retryInterval);\r\n _timeoutHandle = scheduleTimeout(function () {\r\n _timeoutHandle = null;\r\n _self[_DYN_TRIGGER_SEND /* @min:%2etriggerSend */](true, null, 1 /* SendRequestReason.NormalSchedule */);\r\n }, timerValue);\r\n }\r\n }\r\n function _clearScheduledTimer() {\r\n _timeoutHandle && _timeoutHandle.cancel();\r\n _timeoutHandle = null;\r\n _retryAt = null;\r\n }\r\n /**\r\n * Checks if the SDK should resend the payload after receiving this status code from the backend.\r\n * @param statusCode\r\n */\r\n function _isRetriable(statusCode) {\r\n // retryCodes = [] means should not retry\r\n if (!isNullOrUndefined(_retryCodes)) {\r\n return _retryCodes[_DYN_LENGTH /* @min:%2elength */] && _retryCodes.indexOf(statusCode) > -1;\r\n }\r\n return statusCode === 401 // Unauthorized\r\n // Removing as private links can return a 403 which causes excessive retries and session storage usage\r\n // || statusCode === 403 // Forbidden\r\n || statusCode === 408 // Timeout\r\n || statusCode === 429 // Too many requests.\r\n || statusCode === 500 // Internal server error.\r\n || statusCode === 502 // Bad Gateway.\r\n || statusCode === 503 // Service unavailable.\r\n || statusCode === 504; // Gateway timeout.\r\n }\r\n // Using function lookups for backward compatibility as the getNotifyMgr() did not exist until after v2.5.6\r\n function _getNotifyMgr() {\r\n var func = \"getNotifyMgr\";\r\n if (_self.core[func]) {\r\n return _self.core[func]();\r\n }\r\n // using _self.core['_notificationManager'] for backward compatibility\r\n return _self.core[\"_notificationManager\"];\r\n }\r\n function _notifySendRequest(sendRequest, isAsync) {\r\n var manager = _getNotifyMgr();\r\n if (manager && manager.eventsSendRequest) {\r\n try {\r\n manager.eventsSendRequest(sendRequest, isAsync);\r\n }\r\n catch (e) {\r\n _throwInternal(_self[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 74 /* _eInternalMessageId.NotificationException */, \"send request notification failed: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n }\r\n /**\r\n * Validate UUID Format\r\n * Specs taken from https://tools.ietf.org/html/rfc4122 and breeze repo\r\n */\r\n function _validateInstrumentationKey(instrumentationKey, config) {\r\n var disableValidation = config.disableInstrumentationKeyValidation;\r\n var disableIKeyValidationFlag = isNullOrUndefined(disableValidation) ? false : disableValidation;\r\n if (disableIKeyValidationFlag) {\r\n return true;\r\n }\r\n var UUID_Regex = \"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$\";\r\n var regexp = new RegExp(UUID_Regex);\r\n return regexp.test(instrumentationKey);\r\n }\r\n function _initDefaults() {\r\n _self[_DYN__SENDER /* @min:%2e_sender */] = null;\r\n _self[_DYN__BUFFER /* @min:%2e_buffer */] = null;\r\n _self._appId = null;\r\n _self._sample = null;\r\n _headers = {};\r\n _offlineListener = null;\r\n _consecutiveErrors = 0;\r\n _retryAt = null;\r\n _lastSend = null;\r\n _paused = false;\r\n _timeoutHandle = null;\r\n _serializer = null;\r\n _stamp_specific_redirects = 0;\r\n _syncFetchPayload = 0;\r\n _syncUnloadSender = null;\r\n _evtNamespace = null;\r\n _endpointUrl = null;\r\n _orgEndpointUrl = null;\r\n _maxBatchSizeInBytes = 0;\r\n _beaconSupported = false;\r\n _customHeaders = null;\r\n _disableTelemetry = false;\r\n _instrumentationKey = null;\r\n _convertUndefined = UNDEFINED_VALUE;\r\n _isRetryDisabled = false;\r\n _sessionStorageUsed = null;\r\n _namePrefix = UNDEFINED_VALUE;\r\n _disableXhr = false;\r\n _fetchKeepAlive = false;\r\n _disableBeaconSplit = false;\r\n _xhrSend = null;\r\n _fallbackSend = null;\r\n _sendPostMgr = null;\r\n objDefine(_self, \"_senderConfig\", {\r\n g: function () {\r\n return objExtend({}, defaultAppInsightsChannelConfig);\r\n }\r\n });\r\n }\r\n });\r\n return _this;\r\n }\r\n Sender.constructEnvelope = function (orig, iKey, logger, convertUndefined) {\r\n var envelope;\r\n if (iKey !== orig.iKey && !isNullOrUndefined(iKey)) {\r\n envelope = __assign(__assign({}, orig), { iKey: iKey });\r\n }\r\n else {\r\n envelope = orig;\r\n }\r\n var creator = EnvelopeTypeCreator[envelope.baseType] || EventEnvelopeCreator;\r\n return creator(logger, envelope, convertUndefined);\r\n };\r\n /**\r\n * Pause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are\r\n * hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage\r\n * is disabled events will be lost.\r\n * SessionStorage Limit is 2000 events, In-Memory (Array) Storage is 10,000 events (can be configured via the eventsLimitInMem).\r\n */\r\n Sender.prototype.pause = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Resume the sending (transmission) of events, this will restart the timer and any batched events will be sent using the normal\r\n * send interval.\r\n */\r\n Sender.prototype.resume = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Flush to send data immediately; channel should default to sending data asynchronously. If executing asynchronously (the default) and\r\n * you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise`\r\n * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async)\r\n * @param async - send data asynchronously when true\r\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.\r\n * If the caller doesn't return true the caller should assume that it may never be called.\r\n * @param sendReason - specify the reason that you are calling \"flush\" defaults to ManualFlush (1) if not specified\r\n * @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller\r\n * should assume that any provided callback will never be called, Nothing or if occurring asynchronously a\r\n * [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete,\r\n * the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided\r\n * and async is true.\r\n */\r\n Sender.prototype.flush = function (async, callBack) {\r\n if (async === void 0) { async = true; }\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Flush the batched events synchronously (if possible -- based on configuration).\r\n * Will not flush if the Send has been paused.\r\n */\r\n Sender.prototype.onunloadFlush = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n Sender.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n Sender.prototype.processTelemetry = function (telemetryItem, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * xhr state changes\r\n * @deprecated\r\n * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility)\r\n */\r\n Sender.prototype._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n // TODO: no-op\r\n // add note to users, this will be removed\r\n };\r\n /**\r\n * Trigger the immediate send of buffered data; If executing asynchronously (the default) this may (not required) return\r\n * an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) that will resolve once the\r\n * send is complete. The actual implementation of the `IPromise` will be a native Promise (if supported) or the default\r\n * as supplied by [ts-async library](https://github.com/nevware21/ts-async)\r\n * @param async - Indicates if the events should be sent asynchronously\r\n * @param forcedSender - Indicates the forcedSender, undefined if not passed\r\n * @returns - Nothing or optionally, if occurring asynchronously a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * which will be resolved (or reject) once the send is complete, the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * should only be returned when async is true.\r\n */\r\n Sender.prototype.triggerSend = function (async, forcedSender, sendReason) {\r\n if (async === void 0) { async = true; }\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * error handler\r\n * @Internal\r\n * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility)\r\n */\r\n Sender.prototype._onError = function (payload, message, event) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * partial success handler\r\n * @Internal\r\n * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility)\r\n */\r\n Sender.prototype._onPartialSuccess = function (payload, results) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * success handler\r\n * @Internal\r\n * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility)\r\n */\r\n Sender.prototype._onSuccess = function (payload, countOfItemsInPayload) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * xdr state changes\r\n * @deprecated\r\n * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility)\r\n */\r\n Sender.prototype._xdrOnLoad = function (xdr, payload) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Add header to request\r\n * @param name - Header name.\r\n * @param value - Header value.\r\n */\r\n Sender.prototype.addHeader = function (name, value) {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Check if there are no active requests being sent.\r\n * @returns True if idle, false otherwise.\r\n */\r\n Sender.prototype.isCompletelyIdle = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return false;\r\n };\r\n /**\r\n * Get Offline Serializer support\r\n * @returns internal Offline Serializer object\r\n */\r\n Sender.prototype.getOfflineSupport = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Get Offline listener\r\n * @returns offlineListener\r\n * @since 3.3.4\r\n */\r\n Sender.prototype.getOfflineListener = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return Sender;\r\n}(BaseTelemetryPlugin));\r\nexport { Sender };\r\n//# sourceMappingURL=Sender.js.map","import dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { _throwInternal, getJSON, isArray, isFunction, isObject, objForEachKey } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_LENGTH, _DYN_PUSH, _DYN_STRINGIFY, _DYN_TO_STRING } from \"./__DynamicConstants\";\r\nvar Serializer = /** @class */ (function () {\r\n function Serializer(logger) {\r\n dynamicProto(Serializer, this, function (_self) {\r\n /**\r\n * Serializes the current object to a JSON string.\r\n */\r\n _self.serialize = function (input) {\r\n var output = _serializeObject(input, \"root\");\r\n try {\r\n return getJSON()[_DYN_STRINGIFY /* @min:%2estringify */](output);\r\n }\r\n catch (e) {\r\n // if serialization fails return an empty string\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 48 /* _eInternalMessageId.CannotSerializeObject */, (e && isFunction(e[_DYN_TO_STRING /* @min:%2etoString */])) ? e[_DYN_TO_STRING /* @min:%2etoString */]() : \"Error serializing object\", null, true);\r\n }\r\n };\r\n function _serializeObject(source, name) {\r\n var circularReferenceCheck = \"__aiCircularRefCheck\";\r\n var output = {};\r\n if (!source) {\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 48 /* _eInternalMessageId.CannotSerializeObject */, \"cannot serialize object because it is null or undefined\", { name: name }, true);\r\n return output;\r\n }\r\n if (source[circularReferenceCheck]) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 50 /* _eInternalMessageId.CircularReferenceDetected */, \"Circular reference detected while serializing object\", { name: name }, true);\r\n return output;\r\n }\r\n if (!source.aiDataContract) {\r\n // special case for measurements/properties/tags\r\n if (name === \"measurements\") {\r\n output = _serializeStringMap(source, \"number\", name);\r\n }\r\n else if (name === \"properties\") {\r\n output = _serializeStringMap(source, \"string\", name);\r\n }\r\n else if (name === \"tags\") {\r\n output = _serializeStringMap(source, \"string\", name);\r\n }\r\n else if (isArray(source)) {\r\n output = _serializeArray(source, name);\r\n }\r\n else {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 49 /* _eInternalMessageId.CannotSerializeObjectNonSerializable */, \"Attempting to serialize an object which does not implement ISerializable\", { name: name }, true);\r\n try {\r\n // verify that the object can be stringified\r\n getJSON()[_DYN_STRINGIFY /* @min:%2estringify */](source);\r\n output = source;\r\n }\r\n catch (e) {\r\n // if serialization fails return an empty string\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 48 /* _eInternalMessageId.CannotSerializeObject */, (e && isFunction(e[_DYN_TO_STRING /* @min:%2etoString */])) ? e[_DYN_TO_STRING /* @min:%2etoString */]() : \"Error serializing object\", null, true);\r\n }\r\n }\r\n return output;\r\n }\r\n source[circularReferenceCheck] = true;\r\n objForEachKey(source.aiDataContract, function (field, contract) {\r\n var isRequired = (isFunction(contract)) ? (contract() & 1 /* FieldType.Required */) : (contract & 1 /* FieldType.Required */);\r\n var isHidden = (isFunction(contract)) ? (contract() & 4 /* FieldType.Hidden */) : (contract & 4 /* FieldType.Hidden */);\r\n var isArray = contract & 2 /* FieldType.Array */;\r\n var isPresent = source[field] !== undefined;\r\n var isObj = isObject(source[field]) && source[field] !== null;\r\n if (isRequired && !isPresent && !isArray) {\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 24 /* _eInternalMessageId.MissingRequiredFieldSpecification */, \"Missing required field specification. The field is required but not present on source\", { field: field, name: name });\r\n // If not in debug mode, continue and hope the error is permissible\r\n }\r\n else if (!isHidden) { // Don't serialize hidden fields\r\n var value = void 0;\r\n if (isObj) {\r\n if (isArray) {\r\n // special case; recurse on each object in the source array\r\n value = _serializeArray(source[field], field);\r\n }\r\n else {\r\n // recurse on the source object in this field\r\n value = _serializeObject(source[field], field);\r\n }\r\n }\r\n else {\r\n // assign the source field to the output even if undefined or required\r\n value = source[field];\r\n }\r\n // only emit this field if the value is defined\r\n if (value !== undefined) {\r\n output[field] = value;\r\n }\r\n }\r\n });\r\n delete source[circularReferenceCheck];\r\n return output;\r\n }\r\n function _serializeArray(sources, name) {\r\n var output;\r\n if (!!sources) {\r\n if (!isArray(sources)) {\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, 54 /* _eInternalMessageId.ItemNotInArray */, \"This field was specified as an array in the contract but the item is not an array.\\r\\n\", { name: name }, true);\r\n }\r\n else {\r\n output = [];\r\n for (var i = 0; i < sources[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n var source = sources[i];\r\n var item = _serializeObject(source, name + \"[\" + i + \"]\");\r\n output[_DYN_PUSH /* @min:%2epush */](item);\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n function _serializeStringMap(map, expectedType, name) {\r\n var output;\r\n if (map) {\r\n output = {};\r\n objForEachKey(map, function (field, value) {\r\n if (expectedType === \"string\") {\r\n if (value === undefined) {\r\n output[field] = \"undefined\";\r\n }\r\n else if (value === null) {\r\n output[field] = \"null\";\r\n }\r\n else if (!value[_DYN_TO_STRING /* @min:%2etoString */]) {\r\n output[field] = \"invalid field: toString() is not defined.\";\r\n }\r\n else {\r\n output[field] = value[_DYN_TO_STRING /* @min:%2etoString */]();\r\n }\r\n }\r\n else if (expectedType === \"number\") {\r\n if (value === undefined) {\r\n output[field] = \"undefined\";\r\n }\r\n else if (value === null) {\r\n output[field] = \"null\";\r\n }\r\n else {\r\n var num = parseFloat(value);\r\n output[field] = num;\r\n }\r\n }\r\n else {\r\n output[field] = \"invalid field: \" + name + \" is of unknown type.\";\r\n _throwInternal(logger, 1 /* eLoggingSeverity.CRITICAL */, output[field], null, true);\r\n }\r\n });\r\n }\r\n return output;\r\n }\r\n });\r\n }\r\n /**\r\n * Serializes the current object to a JSON string.\r\n */\r\n Serializer.prototype.serialize = function (input) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return Serializer;\r\n}());\r\nexport { Serializer };\r\n//# sourceMappingURL=Serializer.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { _DYN_CONCAT, _DYN_LENGTH } from \"../../__DynamicConstants\";\r\n// (Magic number) DJB algorithm can't work on shorter strings (results in poor distribution\r\nvar MIN_INPUT_LENGTH = 8;\r\nvar HashCodeScoreGenerator = /** @class */ (function () {\r\n function HashCodeScoreGenerator() {\r\n }\r\n HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) {\r\n var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE;\r\n return score * 100;\r\n };\r\n HashCodeScoreGenerator.prototype.getHashCode = function (input) {\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n while (input[_DYN_LENGTH /* @min:%2elength */] < MIN_INPUT_LENGTH) {\r\n input = input[_DYN_CONCAT /* @min:%2econcat */](input);\r\n }\r\n // 5381 is a magic number: http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function\r\n var hash = 5381;\r\n for (var i = 0; i < input[_DYN_LENGTH /* @min:%2elength */]; ++i) {\r\n hash = ((hash << 5) + hash) + input.charCodeAt(i);\r\n // 'hash' is of number type which means 53 bit integer (http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type)\r\n // 'hash & hash' will keep it 32 bit integer - just to make it clearer what the result is.\r\n hash = hash & hash;\r\n }\r\n return Math.abs(hash);\r\n };\r\n // We're using 32 bit math, hence max value is (2^31 - 1)\r\n HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647;\r\n return HashCodeScoreGenerator;\r\n}());\r\nexport { HashCodeScoreGenerator };\r\n//# sourceMappingURL=HashCodeScoreGenerator.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { ContextTagKeys } from \"@microsoft/applicationinsights-common\";\r\nimport { _DYN_GET_HASH_CODE_SCORE, _DYN_TAGS, _DYN_TRACE_ID } from \"../../__DynamicConstants\";\r\nimport { HashCodeScoreGenerator } from \"./HashCodeScoreGenerator\";\r\nvar SamplingScoreGenerator = /** @class */ (function () {\r\n function SamplingScoreGenerator() {\r\n var _self = this;\r\n var hashCodeGenerator = new HashCodeScoreGenerator();\r\n var keys = new ContextTagKeys();\r\n _self.getSamplingScore = function (item) {\r\n var score = 0;\r\n if (item[_DYN_TAGS /* @min:%2etags */] && item[_DYN_TAGS /* @min:%2etags */][keys.userId]) { // search in tags first, then ext\r\n score = hashCodeGenerator.getHashCodeScore(item[_DYN_TAGS /* @min:%2etags */][keys.userId]);\r\n }\r\n else if (item.ext && item.ext.user && item.ext.user.id) {\r\n score = hashCodeGenerator[_DYN_GET_HASH_CODE_SCORE /* @min:%2egetHashCodeScore */](item.ext.user.id);\r\n }\r\n else if (item[_DYN_TAGS /* @min:%2etags */] && item[_DYN_TAGS /* @min:%2etags */][keys.operationId]) { // search in tags first, then ext\r\n score = hashCodeGenerator.getHashCodeScore(item[_DYN_TAGS /* @min:%2etags */][keys.operationId]);\r\n }\r\n else if (item.ext && item.ext.telemetryTrace && item.ext.telemetryTrace[_DYN_TRACE_ID /* @min:%2etraceID */]) {\r\n score = hashCodeGenerator.getHashCodeScore(item.ext.telemetryTrace[_DYN_TRACE_ID /* @min:%2etraceID */]);\r\n }\r\n else {\r\n // tslint:disable-next-line:insecure-random\r\n score = (Math.random() * 100);\r\n }\r\n return score;\r\n };\r\n }\r\n return SamplingScoreGenerator;\r\n}());\r\nexport { SamplingScoreGenerator };\r\n//# sourceMappingURL=SamplingScoreGenerator.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Metric } from \"@microsoft/applicationinsights-common\";\r\nimport { safeGetLogger } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_DATA_TYPE, _DYN_SAMPLE_RATE } from \"../__DynamicConstants\";\r\nimport { SamplingScoreGenerator } from \"./SamplingScoreGenerators/SamplingScoreGenerator\";\r\nvar Sample = /** @class */ (function () {\r\n function Sample(sampleRate, logger) {\r\n // We're using 32 bit math, hence max value is (2^31 - 1)\r\n this.INT_MAX_VALUE = 2147483647;\r\n var _logger = logger || safeGetLogger(null);\r\n if (sampleRate > 100 || sampleRate < 0) {\r\n _logger.throwInternal(2 /* eLoggingSeverity.WARNING */, 58 /* _eInternalMessageId.SampleRateOutOfRange */, \"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.\", { samplingRate: sampleRate }, true);\r\n sampleRate = 100;\r\n }\r\n this[_DYN_SAMPLE_RATE /* @min:%2esampleRate */] = sampleRate;\r\n this.samplingScoreGenerator = new SamplingScoreGenerator();\r\n }\r\n /**\r\n * Determines if an envelope is sampled in (i.e. will be sent) or not (i.e. will be dropped).\r\n */\r\n Sample.prototype.isSampledIn = function (envelope) {\r\n var samplingPercentage = this[_DYN_SAMPLE_RATE /* @min:%2esampleRate */]; // 0 - 100\r\n var isSampledIn = false;\r\n if (samplingPercentage === null || samplingPercentage === undefined || samplingPercentage >= 100) {\r\n return true;\r\n }\r\n else if (envelope.baseType === Metric[_DYN_DATA_TYPE /* @min:%2edataType */]) {\r\n // exclude MetricData telemetry from sampling\r\n return true;\r\n }\r\n isSampledIn = this.samplingScoreGenerator.getSamplingScore(envelope) < samplingPercentage;\r\n return isSampledIn;\r\n };\r\n return Sample;\r\n}());\r\nexport { Sample };\r\n//# sourceMappingURL=Sample.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrReduce, objKeys, strEndsWith } from \"@microsoft/applicationinsights-core-js\";\r\nimport { DEFAULT_BREEZE_ENDPOINT } from \"./Constants\";\r\nimport { _DYN_INGESTIONENDPOINT, _DYN_LENGTH, _DYN_SPLIT, _DYN_TO_LOWER_CASE } from \"./__DynamicConstants\";\r\nvar _FIELDS_SEPARATOR = \";\";\r\nvar _FIELD_KEY_VALUE_SEPARATOR = \"=\";\r\nexport function parseConnectionString(connectionString) {\r\n if (!connectionString) {\r\n return {};\r\n }\r\n var kvPairs = connectionString[_DYN_SPLIT /* @min:%2esplit */](_FIELDS_SEPARATOR);\r\n var result = arrReduce(kvPairs, function (fields, kv) {\r\n var kvParts = kv[_DYN_SPLIT /* @min:%2esplit */](_FIELD_KEY_VALUE_SEPARATOR);\r\n if (kvParts[_DYN_LENGTH /* @min:%2elength */] === 2) { // only save fields with valid formats\r\n var key = kvParts[0][_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n var value = kvParts[1];\r\n fields[key] = value;\r\n }\r\n return fields;\r\n }, {});\r\n if (objKeys(result)[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n // this is a valid connection string, so parse the results\r\n if (result.endpointsuffix) {\r\n // apply the default endpoints\r\n var locationPrefix = result.location ? result.location + \".\" : \"\";\r\n result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */] = result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */] || (\"https://\" + locationPrefix + \"dc.\" + result.endpointsuffix);\r\n }\r\n // apply user override endpoint or the default endpoints\r\n result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */] = result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */] || DEFAULT_BREEZE_ENDPOINT;\r\n if (strEndsWith(result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */], \"/\")) {\r\n result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */] = result[_DYN_INGESTIONENDPOINT /* @min:%2eingestionendpoint */].slice(0, -1);\r\n }\r\n }\r\n return result;\r\n}\r\nexport var ConnectionStringParser = {\r\n parse: parseConnectionString\r\n};\r\n//# sourceMappingURL=ConnectionStringParser.js.map","import { _throwInternal, arrIndexOf, isNotNullOrUndefined, isNullOrUndefined, onConfigChange, randomValue, safeGetLogger, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nimport { arrForEach, mathFloor, mathMin, objForEachKey } from \"@nevware21/ts-utils\";\r\nimport { utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage } from \"./StorageHelperFuncs\";\r\nimport { _DYN_COUNT, _DYN_GET_UTCDATE, _DYN_LENGTH, _DYN_MESSAGE, _DYN_PRE_TRIGGER_DATE, _DYN_STRINGIFY } from \"./__DynamicConstants\";\r\nvar THROTTLE_STORAGE_PREFIX = \"appInsightsThrottle\";\r\nvar ThrottleMgr = /** @class */ (function () {\r\n function ThrottleMgr(core, namePrefix) {\r\n var _self = this;\r\n var _canUseLocalStorage;\r\n var _logger;\r\n var _config;\r\n var _localStorageObj;\r\n var _isTriggered; //_isTriggered is to make sure that we only trigger throttle once a day\r\n var _namePrefix;\r\n var _queue;\r\n var _isReady = false;\r\n var _isSpecificDaysGiven = false;\r\n _initConfig();\r\n // Special internal method to allow the unit tests and DebugPlugin to hook embedded objects\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_queue];\r\n };\r\n _self.getConfig = function () {\r\n return _config;\r\n };\r\n /**\r\n * Check if it is the correct day to send message.\r\n * If _isTriggered is true, even if canThrottle returns true, message will not be sent,\r\n * because we only allow triggering sendMessage() once a day.\r\n * @returns if the current date is the valid date to send message\r\n */\r\n _self.canThrottle = function (msgId) {\r\n var localObj = _getLocalStorageObjByKey(msgId);\r\n var cfg = _getCfgByKey(msgId);\r\n return _canThrottle(cfg, _canUseLocalStorage, localObj);\r\n };\r\n /**\r\n * Check if throttle is triggered on current day(UTC)\r\n * if canThrottle returns false, isTriggered will return false\r\n * @returns if throttle is triggered on current day(UTC)\r\n */\r\n _self.isTriggered = function (msgId) {\r\n return _isTrigger(msgId);\r\n };\r\n /**\r\n * Before isReady set to true, all message will be stored in queue.\r\n * Message will only be sent out after isReady set to true.\r\n * Initial and default value: false\r\n * @returns isReady state\r\n */\r\n _self.isReady = function () {\r\n return _isReady;\r\n };\r\n /**\r\n * Flush all message with given message key in queue with isReady state set to true.\r\n * @returns if message queue is flushed\r\n */\r\n _self.flush = function (msgId) {\r\n try {\r\n var queue = _getQueueByKey(msgId);\r\n if (queue && queue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var items = queue.slice(0);\r\n _queue[msgId] = [];\r\n arrForEach(items, function (item) {\r\n _flushMessage(item.msgID, item[_DYN_MESSAGE /* @min:%2emessage */], item.severity, false);\r\n });\r\n return true;\r\n }\r\n }\r\n catch (err) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n };\r\n /**\r\n * Flush all message in queue with isReady state set to true.\r\n * @returns if message queue is flushed\r\n */\r\n _self.flushAll = function () {\r\n try {\r\n if (_queue) {\r\n var result_1 = true;\r\n objForEachKey(_queue, function (key) {\r\n var isFlushed = _self.flush(parseInt(key));\r\n result_1 = result_1 && isFlushed;\r\n });\r\n return result_1;\r\n }\r\n }\r\n catch (err) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n };\r\n /**\r\n * Set isReady State\r\n * if isReady set to true, message queue will be flushed automatically.\r\n * @param isReady - isReady State\r\n * @pa\r\n * @returns if message queue is flushed\r\n */\r\n _self.onReadyState = function (isReady, flushAll) {\r\n if (flushAll === void 0) { flushAll = true; }\r\n _isReady = isNullOrUndefined(isReady) ? true : isReady;\r\n if (_isReady && flushAll) {\r\n return _self.flushAll();\r\n }\r\n return null;\r\n };\r\n _self.sendMessage = function (msgID, message, severity) {\r\n return _flushMessage(msgID, message, severity, true);\r\n };\r\n function _flushMessage(msgID, message, severity, saveUnsentMsg) {\r\n if (_isReady) {\r\n var isSampledIn = _canSampledIn(msgID);\r\n if (!isSampledIn) {\r\n return;\r\n }\r\n var cfg = _getCfgByKey(msgID);\r\n var localStorageObj = _getLocalStorageObjByKey(msgID);\r\n var canThrottle = _canThrottle(cfg, _canUseLocalStorage, localStorageObj);\r\n var throttled = false;\r\n var number = 0;\r\n var isTriggered = _isTrigger(msgID);\r\n try {\r\n if (canThrottle && !isTriggered) {\r\n number = mathMin(cfg.limit.maxSendNumber, localStorageObj[_DYN_COUNT /* @min:%2ecount */] + 1);\r\n localStorageObj[_DYN_COUNT /* @min:%2ecount */] = 0;\r\n throttled = true;\r\n _isTriggered[msgID] = true;\r\n localStorageObj[_DYN_PRE_TRIGGER_DATE /* @min:%2epreTriggerDate */] = new Date();\r\n }\r\n else {\r\n _isTriggered[msgID] = canThrottle;\r\n localStorageObj[_DYN_COUNT /* @min:%2ecount */] += 1;\r\n }\r\n var localStorageName = _getLocalStorageName(msgID);\r\n _resetLocalStorage(_logger, localStorageName, localStorageObj);\r\n for (var i = 0; i < number; i++) {\r\n _sendMessage(msgID, _logger, message, severity);\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return {\r\n isThrottled: throttled,\r\n throttleNum: number\r\n };\r\n }\r\n else {\r\n if (!!saveUnsentMsg) {\r\n var queue = _getQueueByKey(msgID);\r\n queue.push({\r\n msgID: msgID,\r\n message: message,\r\n severity: severity\r\n });\r\n }\r\n }\r\n return null;\r\n }\r\n function _initConfig() {\r\n _logger = safeGetLogger(core);\r\n _isTriggered = {};\r\n _localStorageObj = {};\r\n _queue = {};\r\n _config = {};\r\n _setCfgByKey(109 /* _eInternalMessageId.DefaultThrottleMsgKey */);\r\n _namePrefix = isNotNullOrUndefined(namePrefix) ? namePrefix : \"\";\r\n core.addUnloadHook(onConfigChange(core.config, function (details) {\r\n var coreConfig = details.cfg;\r\n _canUseLocalStorage = utlCanUseLocalStorage();\r\n var configMgr = coreConfig.throttleMgrCfg || {};\r\n objForEachKey(configMgr, function (key, cfg) {\r\n _setCfgByKey(parseInt(key), cfg);\r\n });\r\n }));\r\n }\r\n function _getCfgByKey(msgID) {\r\n return _config[msgID] || _config[109 /* _eInternalMessageId.DefaultThrottleMsgKey */];\r\n }\r\n function _setCfgByKey(msgID, config) {\r\n var _a, _b;\r\n try {\r\n var cfg = config || {};\r\n var curCfg = {};\r\n curCfg.disabled = !!cfg.disabled;\r\n var configInterval = cfg.interval || {};\r\n _isSpecificDaysGiven = (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth) && (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth[_DYN_LENGTH /* @min:%2elength */]) > 0;\r\n curCfg.interval = _getIntervalConfig(configInterval);\r\n var limit = {\r\n samplingRate: ((_a = cfg.limit) === null || _a === void 0 ? void 0 : _a.samplingRate) || 100,\r\n // dafault: every time sent only 1 event\r\n maxSendNumber: ((_b = cfg.limit) === null || _b === void 0 ? void 0 : _b.maxSendNumber) || 1\r\n };\r\n curCfg.limit = limit;\r\n _config[msgID] = curCfg;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n function _getIntervalConfig(interval) {\r\n interval = interval || {};\r\n var monthInterval = interval === null || interval === void 0 ? void 0 : interval.monthInterval;\r\n var dayInterval = interval === null || interval === void 0 ? void 0 : interval.dayInterval;\r\n // default: send data every 3 month each year\r\n if (isNullOrUndefined(monthInterval) && isNullOrUndefined(dayInterval)) {\r\n interval.monthInterval = 3;\r\n if (!_isSpecificDaysGiven) {\r\n // default: send data on 28th\r\n interval.daysOfMonth = [28];\r\n _isSpecificDaysGiven = true;\r\n }\r\n }\r\n interval = {\r\n // dafault: sent every three months\r\n monthInterval: interval === null || interval === void 0 ? void 0 : interval.monthInterval,\r\n dayInterval: interval === null || interval === void 0 ? void 0 : interval.dayInterval,\r\n daysOfMonth: interval === null || interval === void 0 ? void 0 : interval.daysOfMonth\r\n };\r\n return interval;\r\n }\r\n function _canThrottle(config, canUseLocalStorage, localStorageObj) {\r\n if (config && !config.disabled && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {\r\n var curDate = _getThrottleDate();\r\n var date = localStorageObj.date;\r\n var interval = config.interval;\r\n var monthCheck = 1;\r\n if (interval === null || interval === void 0 ? void 0 : interval.monthInterval) {\r\n var monthExpand = (curDate.getUTCFullYear() - date.getUTCFullYear()) * 12 + curDate.getUTCMonth() - date.getUTCMonth();\r\n monthCheck = _checkInterval(interval.monthInterval, 0, monthExpand);\r\n }\r\n var dayCheck = 1;\r\n if (_isSpecificDaysGiven) {\r\n dayCheck = arrIndexOf(interval.daysOfMonth, curDate[_DYN_GET_UTCDATE /* @min:%2egetUTCDate */]());\r\n }\r\n else if (interval === null || interval === void 0 ? void 0 : interval.dayInterval) {\r\n var daySpan = mathFloor((curDate.getTime() - date.getTime()) / 86400000);\r\n dayCheck = _checkInterval(interval.dayInterval, 0, daySpan);\r\n }\r\n return monthCheck >= 0 && dayCheck >= 0;\r\n }\r\n return false;\r\n }\r\n function _getLocalStorageName(msgKey, prefix) {\r\n var fix = isNotNullOrUndefined(prefix) ? prefix : \"\";\r\n if (msgKey) {\r\n return THROTTLE_STORAGE_PREFIX + fix + \"-\" + msgKey;\r\n }\r\n return null;\r\n }\r\n // returns if throttle is triggered on current Date\r\n function _isTriggeredOnCurDate(preTriggerDate) {\r\n try {\r\n if (preTriggerDate) {\r\n var curDate = new Date();\r\n return preTriggerDate.getUTCFullYear() === curDate.getUTCFullYear() &&\r\n preTriggerDate.getUTCMonth() === curDate.getUTCMonth() &&\r\n preTriggerDate[_DYN_GET_UTCDATE /* @min:%2egetUTCDate */]() === curDate[_DYN_GET_UTCDATE /* @min:%2egetUTCDate */]();\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n }\r\n // transfer local storage string value to object that identifies start date, current count and preTriggerDate\r\n function _getLocalStorageObj(value, logger, storageName) {\r\n try {\r\n var storageObj = {\r\n date: _getThrottleDate(),\r\n count: 0\r\n };\r\n if (value) {\r\n var obj = JSON.parse(value);\r\n var curObj = {\r\n date: _getThrottleDate(obj.date) || storageObj.date,\r\n count: obj[_DYN_COUNT /* @min:%2ecount */] || storageObj[_DYN_COUNT /* @min:%2ecount */],\r\n preTriggerDate: obj.preTriggerDate ? _getThrottleDate(obj[_DYN_PRE_TRIGGER_DATE /* @min:%2epreTriggerDate */]) : undefined\r\n };\r\n return curObj;\r\n }\r\n else {\r\n _resetLocalStorage(logger, storageName, storageObj);\r\n return storageObj;\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n // if datestr is not defined, current date will be returned\r\n function _getThrottleDate(dateStr) {\r\n // if new Date() can't be created through the provided dateStr, null will be returned.\r\n try {\r\n if (dateStr) {\r\n var date = new Date(dateStr);\r\n //make sure it is a valid Date Object\r\n if (!isNaN(date.getDate())) {\r\n return date;\r\n }\r\n }\r\n else {\r\n return new Date();\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n function _resetLocalStorage(logger, storageName, obj) {\r\n try {\r\n return utlSetLocalStorage(logger, storageName, strTrim(JSON[_DYN_STRINGIFY /* @min:%2estringify */](obj)));\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n }\r\n function _checkInterval(interval, start, current) {\r\n if (interval <= 0) {\r\n return 1;\r\n }\r\n // count from start year\r\n return (current >= start) && (current - start) % interval == 0 ? mathFloor((current - start) / interval) + 1 : -1;\r\n }\r\n function _sendMessage(msgID, logger, message, severity) {\r\n _throwInternal(logger, severity || 1 /* eLoggingSeverity.CRITICAL */, msgID, message);\r\n }\r\n // NOTE: config.limit.samplingRate is set to 4 decimal places,\r\n // so config.limit.samplingRate = 1 means 0.0001%\r\n function _canSampledIn(msgID) {\r\n try {\r\n var cfg = _getCfgByKey(msgID);\r\n return randomValue(1000000) <= cfg.limit.samplingRate;\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return false;\r\n }\r\n function _getLocalStorageObjByKey(key) {\r\n try {\r\n var curObj = _localStorageObj[key];\r\n if (!curObj) {\r\n var localStorageName = _getLocalStorageName(key, _namePrefix);\r\n curObj = _getLocalStorageObj(utlGetLocalStorage(_logger, localStorageName), _logger, localStorageName);\r\n _localStorageObj[key] = curObj;\r\n }\r\n return _localStorageObj[key];\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return null;\r\n }\r\n function _isTrigger(key) {\r\n var isTrigger = _isTriggered[key];\r\n if (isNullOrUndefined(isTrigger)) {\r\n isTrigger = false;\r\n var localStorageObj = _getLocalStorageObjByKey(key);\r\n if (localStorageObj) {\r\n isTrigger = _isTriggeredOnCurDate(localStorageObj[_DYN_PRE_TRIGGER_DATE /* @min:%2epreTriggerDate */]);\r\n }\r\n _isTriggered[key] = isTrigger;\r\n }\r\n return _isTriggered[key];\r\n }\r\n function _getQueueByKey(key) {\r\n _queue = _queue || {};\r\n if (isNullOrUndefined(_queue[key])) {\r\n _queue[key] = [];\r\n }\r\n return _queue[key];\r\n }\r\n }\r\n return ThrottleMgr;\r\n}());\r\nexport { ThrottleMgr };\r\n//# sourceMappingURL=ThrottleMgr.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { createAllPromise, createPromise, doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { arrForEach, arrIndexOf, objDefine, safe, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { createDynamicConfig } from \"../Config/DynamicConfig\";\r\nimport { _DYN_ADD_NOTIFICATION_LIS1, _DYN_CANCEL, _DYN_DATA, _DYN_IS_CHILD_EVT, _DYN_LENGTH, _DYN_PUSH, _DYN_REMOVE_NOTIFICATION_0, _DYN_SPLICE, _DYN_UNLOAD, _DYN_WATCH } from \"../__DynamicConstants\";\r\nimport { STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_EVENTS_SENT, STR_OFFLINE_DROP, STR_OFFLINE_SENT, STR_OFFLINE_STORE, STR_PERF_EVENT } from \"./InternalConstants\";\r\nvar defaultValues = {\r\n perfEvtsSendAll: false\r\n};\r\nfunction _runScheduledListeners(asyncNotifications) {\r\n asyncNotifications.h = null;\r\n var callbacks = asyncNotifications.cb;\r\n asyncNotifications.cb = [];\r\n arrForEach(callbacks, function (cb) {\r\n // Run the listener in a try-catch to ensure that a single listener failing doesn't prevent the others from running\r\n safe(cb.fn, [cb.arg]);\r\n });\r\n}\r\n// This function is used to combine the logic of running the listeners and handling the async notifications so that they don't\r\n// create multiple timers if there are multiple async listeners.\r\nfunction _runListeners(listeners, name, asyncNotifications, callback) {\r\n arrForEach(listeners, function (listener) {\r\n if (listener && listener[name]) {\r\n if (asyncNotifications) {\r\n // Schedule the callback to be called after the current call stack has cleared.\r\n asyncNotifications.cb[_DYN_PUSH /* @min:%2epush */]({\r\n fn: callback,\r\n arg: listener\r\n });\r\n asyncNotifications.h = asyncNotifications.h || scheduleTimeout(_runScheduledListeners, 0, asyncNotifications);\r\n }\r\n else {\r\n // Run the listener in a try-catch to ensure that a single listener failing doesn't prevent the others from running\r\n safe(callback, [listener]);\r\n }\r\n }\r\n });\r\n}\r\n/**\r\n * Class to manage sending notifications to all the listeners.\r\n */\r\nvar NotificationManager = /** @class */ (function () {\r\n function NotificationManager(config) {\r\n this.listeners = [];\r\n var perfEvtsSendAll;\r\n var unloadHandler;\r\n var _listeners = [];\r\n var _asyncNotifications = {\r\n h: null,\r\n cb: []\r\n };\r\n var cfgHandler = createDynamicConfig(config, defaultValues);\r\n unloadHandler = cfgHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {\r\n perfEvtsSendAll = !!details.cfg.perfEvtsSendAll;\r\n });\r\n dynamicProto(NotificationManager, this, function (_self) {\r\n objDefine(_self, \"listeners\", {\r\n g: function () { return _listeners; }\r\n });\r\n _self[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */] = function (listener) {\r\n _listeners[_DYN_PUSH /* @min:%2epush */](listener);\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param listener - AWTNotificationListener to remove.\r\n */\r\n _self[_DYN_REMOVE_NOTIFICATION_0 /* @min:%2eremoveNotificationListener */] = function (listener) {\r\n var index = arrIndexOf(_listeners, listener);\r\n while (index > -1) {\r\n _listeners[_DYN_SPLICE /* @min:%2esplice */](index, 1);\r\n index = arrIndexOf(_listeners, listener);\r\n }\r\n };\r\n /**\r\n * Notification for events sent.\r\n * @param events - The array of events that have been sent.\r\n */\r\n _self[STR_EVENTS_SENT /* @min:%2eeventsSent */] = function (events) {\r\n _runListeners(_listeners, STR_EVENTS_SENT, _asyncNotifications, function (listener) {\r\n listener[STR_EVENTS_SENT /* @min:%2eeventsSent */](events);\r\n });\r\n };\r\n /**\r\n * Notification for events being discarded.\r\n * @param events - The array of events that have been discarded by the SDK.\r\n * @param reason - The reason for which the SDK discarded the events. The EventsDiscardedReason\r\n * constant should be used to check the different values.\r\n */\r\n _self[STR_EVENTS_DISCARDED /* @min:%2eeventsDiscarded */] = function (events, reason) {\r\n _runListeners(_listeners, STR_EVENTS_DISCARDED, _asyncNotifications, function (listener) {\r\n listener[STR_EVENTS_DISCARDED /* @min:%2eeventsDiscarded */](events, reason);\r\n });\r\n };\r\n /**\r\n * [Optional] A function called when the events have been requested to be sent to the sever.\r\n * @param sendReason - The reason why the event batch is being sent.\r\n * @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.\r\n */\r\n _self[STR_EVENTS_SEND_REQUEST /* @min:%2eeventsSendRequest */] = function (sendReason, isAsync) {\r\n _runListeners(_listeners, STR_EVENTS_SEND_REQUEST, isAsync ? _asyncNotifications : null, function (listener) {\r\n listener[STR_EVENTS_SEND_REQUEST /* @min:%2eeventsSendRequest */](sendReason, isAsync);\r\n });\r\n };\r\n _self[STR_PERF_EVENT /* @min:%2eperfEvent */] = function (perfEvent) {\r\n if (perfEvent) {\r\n // Send all events or only parent events\r\n if (perfEvtsSendAll || !perfEvent[_DYN_IS_CHILD_EVT /* @min:%2eisChildEvt */]()) {\r\n _runListeners(_listeners, STR_PERF_EVENT, null, function (listener) {\r\n if (perfEvent.isAsync) {\r\n scheduleTimeout(function () { return listener[STR_PERF_EVENT /* @min:%2eperfEvent */](perfEvent); }, 0);\r\n }\r\n else {\r\n listener[STR_PERF_EVENT /* @min:%2eperfEvent */](perfEvent);\r\n }\r\n });\r\n }\r\n }\r\n };\r\n _self[STR_OFFLINE_STORE /* @min:%2eofflineEventsStored */] = function (events) {\r\n if (events && events[_DYN_LENGTH /* @min:%2elength */]) {\r\n _runListeners(_listeners, STR_OFFLINE_STORE, _asyncNotifications, function (listener) {\r\n listener[STR_OFFLINE_STORE /* @min:%2eofflineEventsStored */](events);\r\n });\r\n }\r\n };\r\n _self[STR_OFFLINE_SENT /* @min:%2eofflineBatchSent */] = function (batch) {\r\n if (batch && batch[_DYN_DATA /* @min:%2edata */]) {\r\n _runListeners(_listeners, STR_OFFLINE_SENT, _asyncNotifications, function (listener) {\r\n listener[STR_OFFLINE_SENT /* @min:%2eofflineBatchSent */](batch);\r\n });\r\n }\r\n };\r\n _self[STR_OFFLINE_DROP /* @min:%2eofflineBatchDrop */] = function (cnt, reason) {\r\n if (cnt > 0) {\r\n var rn_1 = reason || 0; // default is unknown\r\n _runListeners(_listeners, STR_OFFLINE_DROP, _asyncNotifications, function (listener) {\r\n listener[STR_OFFLINE_DROP /* @min:%2eofflineBatchDrop */](cnt, rn_1);\r\n });\r\n }\r\n };\r\n _self[_DYN_UNLOAD /* @min:%2eunload */] = function (isAsync) {\r\n var _finishUnload = function () {\r\n unloadHandler && unloadHandler.rm();\r\n unloadHandler = null;\r\n _listeners = [];\r\n // Clear any async listener\r\n _asyncNotifications.h && _asyncNotifications.h[_DYN_CANCEL /* @min:%2ecancel */]();\r\n _asyncNotifications.h = null;\r\n _asyncNotifications.cb = [];\r\n };\r\n var waiting;\r\n _runListeners(_listeners, \"unload\", null, function (listener) {\r\n var asyncUnload = listener[_DYN_UNLOAD /* @min:%2eunload */](isAsync);\r\n if (asyncUnload) {\r\n if (!waiting) {\r\n waiting = [];\r\n }\r\n waiting[_DYN_PUSH /* @min:%2epush */](asyncUnload);\r\n }\r\n });\r\n if (waiting) {\r\n return createPromise(function (resolve) {\r\n return doAwaitResponse(createAllPromise(waiting), function () {\r\n _finishUnload();\r\n resolve();\r\n });\r\n });\r\n }\r\n else {\r\n _finishUnload();\r\n }\r\n };\r\n });\r\n }\r\n /**\r\n * Adds a notification listener.\r\n * @param listener - The notification listener to be added.\r\n */\r\n NotificationManager.prototype.addNotificationListener = function (listener) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param listener - AWTNotificationListener to remove.\r\n */\r\n NotificationManager.prototype.removeNotificationListener = function (listener) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Notification for events sent.\r\n * @param events - The array of events that have been sent.\r\n */\r\n NotificationManager.prototype.eventsSent = function (events) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Notification for events being discarded.\r\n * @param events - The array of events that have been discarded by the SDK.\r\n * @param reason - The reason for which the SDK discarded the events. The EventsDiscardedReason\r\n * constant should be used to check the different values.\r\n */\r\n NotificationManager.prototype.eventsDiscarded = function (events, reason) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * [Optional] A function called when the events have been requested to be sent to the sever.\r\n * @param sendReason - The reason why the event batch is being sent.\r\n * @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.\r\n */\r\n NotificationManager.prototype.eventsSendRequest = function (sendReason, isAsync) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging\r\n * the event can be displayed via the debug plugin extension.\r\n * @param perfEvent - The performance event object containing relevant performance data.\r\n */\r\n NotificationManager.prototype.perfEvent = function (perfEvent) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Unload and remove any state that this INotificationManager may be holding, this is generally called when the\r\n * owning SDK is being unloaded.\r\n * @param isAsync - Can the unload be performed asynchronously (default)\r\n * @returns If the unload occurs synchronously then nothing should be returned, if happening asynchronously then\r\n * the function should return an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * / Promise to allow any listeners to wait for the operation to complete.\r\n */\r\n NotificationManager.prototype.unload = function (isAsync) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * [Optional] A function called when the offline events have been stored to the persistent storage\r\n * @param events - events that are stored in the persistent storage\r\n */\r\n NotificationManager.prototype.offlineEventsStored = function (events) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * [Optional] A function called when the offline events have been sent from the persistent storage\r\n * @param batch - payload data that is sent from the persistent storage\r\n */\r\n NotificationManager.prototype.offlineBatchSent = function (batch) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * [Optional] A function called when the offline events have been dropped from the persistent storage\r\n * @param cnt - count of batches dropped\r\n * @param reason - the reason why the batches is dropped\r\n * @since v3.1.1\r\n */\r\n NotificationManager.prototype.offlineBatchDrop = function (cnt, reason) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return NotificationManager;\r\n}());\r\nexport { NotificationManager };\r\n//# sourceMappingURL=NotificationManager.js.map","// // Copyright (c) Microsoft Corporation. All rights reserved.\r\n// // Licensed under the MIT License.\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { arrAppend, arrForEach, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_APPLY, _DYN_DIAG_LOG, _DYN_LENGTH, _DYN_PROCESS_NEXT, _DYN_SPLICE, _DYN__DO_TEARDOWN } from \"../__DynamicConstants\";\r\nimport { BaseTelemetryPlugin } from \"./BaseTelemetryPlugin\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nimport { getExceptionName } from \"./HelperFuncs\";\r\nimport { STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nfunction _addInitializer(_initializers, id, telemetryInitializer) {\r\n var theInitializer = {\r\n id: id,\r\n fn: telemetryInitializer\r\n };\r\n arrAppend(_initializers, theInitializer);\r\n var handler = {\r\n remove: function () {\r\n arrForEach(_initializers, function (initializer, idx) {\r\n if (initializer.id === theInitializer.id) {\r\n _initializers[_DYN_SPLICE /* @min:%2esplice */](idx, 1);\r\n return -1;\r\n }\r\n });\r\n }\r\n };\r\n return handler;\r\n}\r\nfunction _runInitializers(_initializers, item, logger) {\r\n var doNotSendItem = false;\r\n var telemetryInitializersCount = _initializers[_DYN_LENGTH /* @min:%2elength */];\r\n for (var i = 0; i < telemetryInitializersCount; ++i) {\r\n var telemetryInitializer = _initializers[i];\r\n if (telemetryInitializer) {\r\n try {\r\n if (telemetryInitializer.fn[_DYN_APPLY /* @min:%2eapply */](null, [item]) === false) {\r\n doNotSendItem = true;\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n // log error but dont stop executing rest of the telemetry initializers\r\n // doNotSendItem = true;\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 64 /* _eInternalMessageId.TelemetryInitializerFailed */, \"Telemetry initializer failed: \" + getExceptionName(e), { exception: dumpObj(e) }, true);\r\n }\r\n }\r\n }\r\n return !doNotSendItem;\r\n}\r\nvar TelemetryInitializerPlugin = /** @class */ (function (_super) {\r\n __extends(TelemetryInitializerPlugin, _super);\r\n function TelemetryInitializerPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"TelemetryInitializerPlugin\";\r\n _this.priority = 199;\r\n // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()\r\n var _id;\r\n var _initializers;\r\n _initDefaults();\r\n dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) {\r\n _self.addTelemetryInitializer = function (telemetryInitializer) {\r\n return _addInitializer(_initializers, _id++, telemetryInitializer);\r\n };\r\n _self[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */] = function (item, itemCtx) {\r\n if (_runInitializers(_initializers, item, itemCtx ? itemCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */]() : _self[_DYN_DIAG_LOG /* @min:%2ediagLog */]())) {\r\n _self[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](item, itemCtx);\r\n }\r\n };\r\n _self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */] = function () {\r\n _initDefaults();\r\n };\r\n });\r\n function _initDefaults() {\r\n _id = 0;\r\n _initializers = [];\r\n }\r\n return _this;\r\n }\r\n /**\r\n * Add a telemetry processor to decorate or drop telemetry events.\r\n * @param telemetryInitializer - The Telemetry Initializer function\r\n * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed\r\n */\r\n TelemetryInitializerPlugin.prototype.addTelemetryInitializer = function (telemetryInitializer) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n TelemetryInitializerPlugin.prototype.processTelemetry = function (env, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return TelemetryInitializerPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { TelemetryInitializerPlugin };\r\n//# sourceMappingURL=TelemetryInitializerPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nvar _a;\r\nimport { __spreadArray } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { createPromise, createSyncAllSettledPromise, doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { arrAppend, arrForEach, arrIndexOf, createTimeout, deepExtend, hasDocument, isFunction, isNullOrUndefined, isPlainObject, isPromiseLike, objDeepFreeze, objDefine, objForEachKey, objFreeze, objHasOwn, scheduleTimeout, throwError } from \"@nevware21/ts-utils\";\r\nimport { createDynamicConfig, onConfigChange } from \"../Config/DynamicConfig\";\r\nimport { ActiveStatus } from \"../JavaScriptSDK.Enums/InitActiveStatusEnum\";\r\nimport { _DYN_ADD_NOTIFICATION_LIS1, _DYN_CANCEL, _DYN_CREATE_NEW, _DYN_ENABLED, _DYN_GET_NOTIFY_MGR, _DYN_GET_PLUGIN, _DYN_GET_PROCESS_TEL_CONT2, _DYN_IDENTIFIER, _DYN_INITIALIZE, _DYN_IS_INITIALIZED, _DYN_LENGTH, _DYN_LOGGER, _DYN_LOGGING_LEVEL_CONSOL4, _DYN_MESSAGE, _DYN_MESSAGE_ID, _DYN_NAME, _DYN_ON_COMPLETE, _DYN_PROCESS_NEXT, _DYN_PUSH, _DYN_REMOVE_NOTIFICATION_0, _DYN_SPLICE, _DYN_STOP_POLLING_INTERNA3, _DYN_TEARDOWN, _DYN_UNLOAD, _DYN_VALUE, _DYN_VERSION, _DYN_WATCH } from \"../__DynamicConstants\";\r\nimport { doUnloadAll, runTargetUnload } from \"./AsyncUtils\";\r\nimport { ChannelControllerPriority } from \"./Constants\";\r\nimport { createCookieMgr } from \"./CookieMgr\";\r\nimport { createUniqueNamespace } from \"./DataCacheHelper\";\r\nimport { getDebugListener } from \"./DbgExtensionUtils\";\r\nimport { DiagnosticLogger, _InternalLogMessage, _throwInternal, _warnToConsole } from \"./DiagnosticLogger\";\r\nimport { getSetValue, isNotNullOrUndefined, proxyFunctionAs, proxyFunctions, toISOString } from \"./HelperFuncs\";\r\nimport { STR_CHANNELS, STR_CORE, STR_CREATE_PERF_MGR, STR_DISABLED, STR_EMPTY, STR_EVENTS_DISCARDED, STR_EXTENSIONS, STR_EXTENSION_CONFIG, STR_GET_PERF_MGR, STR_PRIORITY, UNDEFINED_VALUE } from \"./InternalConstants\";\r\nimport { NotificationManager } from \"./NotificationManager\";\r\nimport { PerfManager, doPerf, getGblPerfMgr } from \"./PerfManager\";\r\nimport { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createProcessTelemetryUpdateContext, createTelemetryProxyChain } from \"./ProcessTelemetryContext\";\r\nimport { _getPluginState, createDistributedTraceContext, initializePlugins, sortPlugins } from \"./TelemetryHelpers\";\r\nimport { TelemetryInitializerPlugin } from \"./TelemetryInitializerPlugin\";\r\nimport { createUnloadHandlerContainer } from \"./UnloadHandlerContainer\";\r\nimport { createUnloadHookContainer } from \"./UnloadHookContainer\";\r\nvar strValidationError = \"Plugins must provide initialize method\";\r\nvar strNotificationManager = \"_notificationManager\";\r\nvar strSdkUnloadingError = \"SDK is still unloading...\";\r\nvar strSdkNotInitialized = \"SDK is not initialized\";\r\nvar maxInitQueueSize = 100;\r\nvar maxInitTimeout = 50000;\r\n// const strPluginUnloadFailed = \"Failed to unload plugin\";\r\n/**\r\n * The default settings for the config.\r\n * WE MUST include all defaults here to ensure that the config is created with all of the properties\r\n * defined as dynamic.\r\n */\r\nvar defaultConfig = objDeepFreeze((_a = {\r\n cookieCfg: {}\r\n },\r\n _a[STR_EXTENSIONS] = { rdOnly: true, ref: true, v: [] },\r\n _a[STR_CHANNELS] = { rdOnly: true, ref: true, v: [] },\r\n _a[STR_EXTENSION_CONFIG] = { ref: true, v: {} },\r\n _a[STR_CREATE_PERF_MGR] = UNDEFINED_VALUE,\r\n _a.loggingLevelConsole = 0 /* eLoggingSeverity.DISABLED */,\r\n _a.diagnosticLogInterval = UNDEFINED_VALUE,\r\n _a));\r\n/**\r\n * Helper to create the default performance manager\r\n * @param core - The AppInsightsCore instance\r\n * @param notificationMgr - The notification manager\r\n */\r\nfunction _createPerfManager(core, notificationMgr) {\r\n return new PerfManager(notificationMgr);\r\n}\r\nfunction _validateExtensions(logger, channelPriority, allExtensions) {\r\n // Concat all available extensions\r\n var coreExtensions = [];\r\n var channels = [];\r\n // Check if any two extensions have the same priority, then warn to console\r\n // And extract the local extensions from the\r\n var extPriorities = {};\r\n // Extension validation\r\n arrForEach(allExtensions, function (ext) {\r\n // Check for ext.initialize\r\n if (isNullOrUndefined(ext) || isNullOrUndefined(ext[_DYN_INITIALIZE /* @min:%2einitialize */])) {\r\n throwError(strValidationError);\r\n }\r\n var extPriority = ext[STR_PRIORITY /* @min:%2epriority */];\r\n var identifier = ext[_DYN_IDENTIFIER /* @min:%2eidentifier */];\r\n if (ext && extPriority) {\r\n if (!isNullOrUndefined(extPriorities[extPriority])) {\r\n _warnToConsole(logger, \"Two extensions have same priority #\" + extPriority + \" - \" + extPriorities[extPriority] + \", \" + identifier);\r\n }\r\n else {\r\n // set a value\r\n extPriorities[extPriority] = identifier;\r\n }\r\n }\r\n // Split extensions to core and channels\r\n if (!extPriority || extPriority < channelPriority) {\r\n // Add to core extension that will be managed by AppInsightsCore\r\n coreExtensions[_DYN_PUSH /* @min:%2epush */](ext);\r\n }\r\n else {\r\n channels[_DYN_PUSH /* @min:%2epush */](ext);\r\n }\r\n });\r\n return {\r\n core: coreExtensions,\r\n channels: channels\r\n };\r\n}\r\nfunction _isPluginPresent(thePlugin, plugins) {\r\n var exists = false;\r\n arrForEach(plugins, function (plugin) {\r\n if (plugin === thePlugin) {\r\n exists = true;\r\n return -1;\r\n }\r\n });\r\n return exists;\r\n}\r\nfunction _deepMergeConfig(details, target, newValues, merge) {\r\n // Lets assign the new values to the existing config\r\n if (newValues) {\r\n objForEachKey(newValues, function (key, value) {\r\n if (merge) {\r\n if (isPlainObject(value) && isPlainObject(target[key])) {\r\n // The target is an object and it has a value\r\n _deepMergeConfig(details, target[key], value, merge);\r\n }\r\n }\r\n if (merge && isPlainObject(value) && isPlainObject(target[key])) {\r\n // The target is an object and it has a value\r\n _deepMergeConfig(details, target[key], value, merge);\r\n }\r\n else {\r\n // Just Assign (replace) and/or make the property dynamic\r\n details.set(target, key, value);\r\n }\r\n });\r\n }\r\n}\r\nfunction _findWatcher(listeners, newWatcher) {\r\n var theListener = null;\r\n var idx = -1;\r\n arrForEach(listeners, function (listener, lp) {\r\n if (listener.w === newWatcher) {\r\n theListener = listener;\r\n idx = lp;\r\n return -1;\r\n }\r\n });\r\n return { i: idx, l: theListener };\r\n}\r\nfunction _addDelayedCfgListener(listeners, newWatcher) {\r\n var theListener = _findWatcher(listeners, newWatcher).l;\r\n if (!theListener) {\r\n theListener = {\r\n w: newWatcher,\r\n rm: function () {\r\n var fnd = _findWatcher(listeners, newWatcher);\r\n if (fnd.i !== -1) {\r\n listeners[_DYN_SPLICE /* @min:%2esplice */](fnd.i, 1);\r\n }\r\n }\r\n };\r\n listeners[_DYN_PUSH /* @min:%2epush */](theListener);\r\n }\r\n return theListener;\r\n}\r\nfunction _registerDelayedCfgListener(config, listeners, logger) {\r\n arrForEach(listeners, function (listener) {\r\n var unloadHdl = onConfigChange(config, listener.w, logger);\r\n delete listener.w; // Clear the listener reference so it will get garbage collected.\r\n // replace the remove function\r\n listener.rm = function () {\r\n unloadHdl.rm();\r\n };\r\n });\r\n}\r\n// Moved this outside of the closure to reduce the retained memory footprint\r\nfunction _initDebugListener(configHandler, unloadContainer, notificationManager, debugListener) {\r\n // Will get recalled if any referenced config values are changed\r\n unloadContainer.add(configHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {\r\n var disableDbgExt = details.cfg.disableDbgExt;\r\n if (disableDbgExt === true && debugListener) {\r\n // Remove any previously loaded debug listener\r\n notificationManager[_DYN_REMOVE_NOTIFICATION_0 /* @min:%2eremoveNotificationListener */](debugListener);\r\n debugListener = null;\r\n }\r\n if (notificationManager && !debugListener && disableDbgExt !== true) {\r\n debugListener = getDebugListener(details.cfg);\r\n notificationManager[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */](debugListener);\r\n }\r\n }));\r\n return debugListener;\r\n}\r\n// Moved this outside of the closure to reduce the retained memory footprint\r\nfunction _createUnloadHook(unloadHook) {\r\n return objDefine({\r\n rm: function () {\r\n unloadHook.rm();\r\n }\r\n }, \"toJSON\", { v: function () { return \"aicore::onCfgChange<\" + JSON.stringify(unloadHook) + \">\"; } });\r\n}\r\n/**\r\n * @group Classes\r\n * @group Entrypoint\r\n */\r\nvar AppInsightsCore = /** @class */ (function () {\r\n function AppInsightsCore() {\r\n // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()\r\n var _configHandler;\r\n var _isInitialized;\r\n var _logger;\r\n var _eventQueue;\r\n var _notificationManager;\r\n var _perfManager;\r\n var _cfgPerfManager;\r\n var _cookieManager;\r\n var _pluginChain;\r\n var _configExtensions;\r\n var _channelConfig;\r\n var _channels;\r\n var _isUnloading;\r\n var _telemetryInitializerPlugin;\r\n var _internalLogsEventName;\r\n var _evtNamespace;\r\n var _unloadHandlers;\r\n var _hookContainer;\r\n var _debugListener;\r\n var _traceCtx;\r\n var _instrumentationKey;\r\n var _cfgListeners;\r\n var _extensions;\r\n var _pluginVersionStringArr;\r\n var _pluginVersionString;\r\n var _activeStatus; // to indicate if ikey or endpoint url promised is resolved or not\r\n var _endpoint;\r\n var _initInMemoMaxSize; // max event count limit during wait for init promises to be resolved\r\n var _isStatusSet; // track if active status is set in case of init timeout and init promises setting the status twice\r\n var _initTimer;\r\n /**\r\n * Internal log poller\r\n */\r\n var _internalLogPoller;\r\n var _internalLogPollerListening;\r\n var _forceStopInternalLogPoller;\r\n dynamicProto(AppInsightsCore, this, function (_self) {\r\n // Set the default values (also called during teardown)\r\n _initDefaults();\r\n // Special internal method to allow the unit tests and DebugPlugin to hook embedded objects\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_extensions, _eventQueue];\r\n };\r\n _self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = function () { return _isInitialized; };\r\n // since version 3.3.0\r\n _self.activeStatus = function () { return _activeStatus; };\r\n // since version 3.3.0\r\n // internal\r\n _self._setPendingStatus = function () {\r\n _activeStatus = 3 /* eActiveStatus.PENDING */;\r\n };\r\n // Creating the self.initialize = ()\r\n _self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, extensions, logger, notificationManager) {\r\n if (_isUnloading) {\r\n throwError(strSdkUnloadingError);\r\n }\r\n // Make sure core is only initialized once\r\n if (_self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]()) {\r\n throwError(\"Core cannot be initialized more than once\");\r\n }\r\n _configHandler = createDynamicConfig(config, defaultConfig, logger || _self[_DYN_LOGGER /* @min:%2elogger */], false);\r\n // Re-assigning the local config property so we don't have any references to the passed value and it can be garbage collected\r\n config = _configHandler.cfg;\r\n // This will be \"re-run\" if the referenced config properties are changed\r\n _addUnloadHook(_configHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {\r\n var rootCfg = details.cfg;\r\n var isPending = _activeStatus === 3 /* eActiveStatus.PENDING */;\r\n if (isPending) {\r\n // means waiting for previous promises to be resolved, won't apply new changes\r\n return;\r\n }\r\n _initInMemoMaxSize = rootCfg.initInMemoMaxSize || maxInitQueueSize;\r\n // app Insights core only handle ikey and endpointurl, aisku will handle cs\r\n var ikey = rootCfg.instrumentationKey;\r\n var endpointUrl = rootCfg.endpointUrl; // do not need to validate endpoint url, if it is null, default one will be set by sender\r\n if (isNullOrUndefined(ikey)) {\r\n _instrumentationKey = null;\r\n // if new ikey is null, set status to be inactive, all new events will be saved in memory or dropped\r\n _activeStatus = ActiveStatus.INACTIVE;\r\n var msg = \"Please provide instrumentation key\";\r\n if (!_isInitialized) {\r\n // only throw error during initialization\r\n throwError(msg);\r\n }\r\n else {\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 100 /* _eInternalMessageId.InvalidInstrumentationKey */, msg);\r\n _releaseQueues();\r\n }\r\n return;\r\n }\r\n var promises = [];\r\n if (isPromiseLike(ikey)) {\r\n promises[_DYN_PUSH /* @min:%2epush */](ikey);\r\n _instrumentationKey = null; // reset current local ikey variable (otherwise it will always be the previous ikeys if timeout is called before promise cb)\r\n }\r\n else {\r\n // string\r\n _instrumentationKey = ikey;\r\n }\r\n if (isPromiseLike(endpointUrl)) {\r\n promises[_DYN_PUSH /* @min:%2epush */](endpointUrl);\r\n _endpoint = null; // reset current local endpoint variable (otherwise it will always be the previous urls if timeout is called before promise cb)\r\n }\r\n else {\r\n // string or null\r\n _endpoint = endpointUrl;\r\n }\r\n // at least have one promise\r\n if (promises[_DYN_LENGTH /* @min:%2elength */]) {\r\n // reset to false for new dynamic changes\r\n _isStatusSet = false;\r\n _activeStatus = 3 /* eActiveStatus.PENDING */;\r\n var initTimeout = isNotNullOrUndefined(rootCfg.initTimeOut) ? rootCfg.initTimeOut : maxInitTimeout; // rootCfg.initTimeOut could be 0\r\n var allPromises = createSyncAllSettledPromise(promises);\r\n _initTimer = scheduleTimeout(function () {\r\n // set _isStatusSet to true\r\n // set active status\r\n // release queues\r\n _initTimer = null;\r\n if (!_isStatusSet) {\r\n _setStatus();\r\n }\r\n }, initTimeout);\r\n doAwaitResponse(allPromises, function (response) {\r\n try {\r\n if (_isStatusSet) {\r\n // promises take too long to resolve, ignore them\r\n // active status should be set by timeout already\r\n return;\r\n }\r\n if (!response.rejected) {\r\n var values = response[_DYN_VALUE /* @min:%2evalue */];\r\n if (values && values[_DYN_LENGTH /* @min:%2elength */]) {\r\n // ikey\r\n var ikeyRes = values[0];\r\n _instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE /* @min:%2evalue */];\r\n // endpoint\r\n if (values[_DYN_LENGTH /* @min:%2elength */] > 1) {\r\n var endpointRes = values[1];\r\n _endpoint = endpointRes && endpointRes[_DYN_VALUE /* @min:%2evalue */];\r\n }\r\n }\r\n if (_instrumentationKey) {\r\n // if ikey is null, no need to trigger extra dynamic changes for extensions\r\n config.instrumentationKey = _instrumentationKey; // set config.instrumentationKey for extensions to consume\r\n config.endpointUrl = _endpoint; // set config.endpointUrl for extensions to consume\r\n }\r\n }\r\n // set _isStatusSet to true\r\n // set active status\r\n // release queues\r\n _setStatus();\r\n }\r\n catch (e) {\r\n if (!_isStatusSet) {\r\n _setStatus();\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n // means no promises\r\n _setStatus();\r\n }\r\n //_instrumentationKey = details.cfg.instrumentationKey;\r\n // Mark the extensionConfig and all first level keys as referenced\r\n // This is so that calls to getExtCfg() will always return the same object\r\n // Even when a user may \"re-assign\" the plugin properties (or it's unloaded/reloaded)\r\n var extCfg = details.ref(details.cfg, STR_EXTENSION_CONFIG);\r\n objForEachKey(extCfg, function (key) {\r\n details.ref(extCfg, key);\r\n });\r\n }));\r\n _notificationManager = notificationManager;\r\n // Initialize the debug listener outside of the closure to reduce the retained memory footprint\r\n _debugListener = _initDebugListener(_configHandler, _hookContainer, _notificationManager && _self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */](), _debugListener);\r\n _initPerfManager();\r\n _self[_DYN_LOGGER /* @min:%2elogger */] = logger;\r\n var cfgExtensions = config[STR_EXTENSIONS /* @min:%2eextensions */];\r\n // Extension validation\r\n _configExtensions = [];\r\n _configExtensions[_DYN_PUSH /* @min:%2epush */].apply(_configExtensions, __spreadArray(__spreadArray([], extensions, false), cfgExtensions, false));\r\n _channelConfig = config[STR_CHANNELS /* @min:%2echannels */];\r\n _initPluginChain(null);\r\n if (!_channels || _channels[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n throwError(\"No \" + STR_CHANNELS + \" available\");\r\n }\r\n if (_channelConfig && _channelConfig[_DYN_LENGTH /* @min:%2elength */] > 1) {\r\n var teeController = _self[_DYN_GET_PLUGIN /* @min:%2egetPlugin */](\"TeeChannelController\");\r\n if (!teeController || !teeController.plugin) {\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 28 /* _eInternalMessageId.SenderNotInitialized */, \"TeeChannel required\");\r\n }\r\n }\r\n _registerDelayedCfgListener(config, _cfgListeners, _logger);\r\n _cfgListeners = null;\r\n _isInitialized = true;\r\n if (_activeStatus === ActiveStatus.ACTIVE) {\r\n _releaseQueues();\r\n }\r\n };\r\n _self.getChannels = function () {\r\n var controls = [];\r\n if (_channels) {\r\n arrForEach(_channels, function (channel) {\r\n controls[_DYN_PUSH /* @min:%2epush */](channel);\r\n });\r\n }\r\n return objFreeze(controls);\r\n };\r\n _self.track = function (telemetryItem) {\r\n doPerf(_self[STR_GET_PERF_MGR /* @min:%2egetPerfMgr */](), function () { return \"AppInsightsCore:track\"; }, function () {\r\n if (telemetryItem === null) {\r\n _notifyInvalidEvent(telemetryItem);\r\n // throw error\r\n throwError(\"Invalid telemetry item\");\r\n }\r\n // do basic validation before sending it through the pipeline\r\n if (!telemetryItem[_DYN_NAME /* @min:%2ename */] && isNullOrUndefined(telemetryItem[_DYN_NAME /* @min:%2ename */])) {\r\n _notifyInvalidEvent(telemetryItem);\r\n throwError(\"telemetry name required\");\r\n }\r\n // setup default iKey if not passed in\r\n telemetryItem.iKey = telemetryItem.iKey || _instrumentationKey;\r\n // add default timestamp if not passed in\r\n telemetryItem.time = telemetryItem.time || toISOString(new Date());\r\n // Common Schema 4.0\r\n telemetryItem.ver = telemetryItem.ver || \"4.0\";\r\n if (!_isUnloading && _self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]() && _activeStatus === ActiveStatus.ACTIVE) {\r\n // Process the telemetry plugin chain\r\n _createTelCtx()[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](telemetryItem);\r\n }\r\n else if (_activeStatus !== ActiveStatus.INACTIVE) {\r\n // Queue events until all extensions are initialized\r\n if (_eventQueue[_DYN_LENGTH /* @min:%2elength */] <= _initInMemoMaxSize) {\r\n // set limit, if full, stop adding new events\r\n _eventQueue[_DYN_PUSH /* @min:%2epush */](telemetryItem);\r\n }\r\n }\r\n }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));\r\n };\r\n _self[_DYN_GET_PROCESS_TEL_CONT2 /* @min:%2egetProcessTelContext */] = _createTelCtx;\r\n _self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */] = function () {\r\n if (!_notificationManager) {\r\n _notificationManager = new NotificationManager(_configHandler.cfg);\r\n // For backward compatibility only\r\n _self[strNotificationManager] = _notificationManager;\r\n }\r\n return _notificationManager;\r\n };\r\n /**\r\n * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.\r\n * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be\r\n * called.\r\n * @param listener - An INotificationListener object.\r\n */\r\n _self[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */] = function (listener) {\r\n _self.getNotifyMgr()[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */](listener);\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param listener - INotificationListener to remove.\r\n */\r\n _self[_DYN_REMOVE_NOTIFICATION_0 /* @min:%2eremoveNotificationListener */] = function (listener) {\r\n if (_notificationManager) {\r\n _notificationManager[_DYN_REMOVE_NOTIFICATION_0 /* @min:%2eremoveNotificationListener */](listener);\r\n }\r\n };\r\n _self.getCookieMgr = function () {\r\n if (!_cookieManager) {\r\n _cookieManager = createCookieMgr(_configHandler.cfg, _self[_DYN_LOGGER /* @min:%2elogger */]);\r\n }\r\n return _cookieManager;\r\n };\r\n _self.setCookieMgr = function (cookieMgr) {\r\n if (_cookieManager !== cookieMgr) {\r\n runTargetUnload(_cookieManager, false);\r\n _cookieManager = cookieMgr;\r\n }\r\n };\r\n _self[STR_GET_PERF_MGR /* @min:%2egetPerfMgr */] = function () {\r\n return _perfManager || _cfgPerfManager || getGblPerfMgr();\r\n };\r\n _self.setPerfMgr = function (perfMgr) {\r\n _perfManager = perfMgr;\r\n };\r\n _self.eventCnt = function () {\r\n return _eventQueue[_DYN_LENGTH /* @min:%2elength */];\r\n };\r\n _self.releaseQueue = function () {\r\n if (_isInitialized && _eventQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var eventQueue = _eventQueue;\r\n _eventQueue = [];\r\n if (_activeStatus === 2 /* eActiveStatus.ACTIVE */) {\r\n arrForEach(eventQueue, function (event) {\r\n event.iKey = event.iKey || _instrumentationKey;\r\n _createTelCtx()[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](event);\r\n });\r\n }\r\n else {\r\n // new one for msg ikey\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 20 /* _eInternalMessageId.FailedToSendQueuedTelemetry */, \"core init status is not active\");\r\n }\r\n }\r\n };\r\n _self.pollInternalLogs = function (eventName) {\r\n _internalLogsEventName = eventName || null;\r\n _forceStopInternalLogPoller = false;\r\n _internalLogPoller && _internalLogPoller[_DYN_CANCEL /* @min:%2ecancel */]();\r\n return _startLogPoller(true);\r\n };\r\n function _setStatus() {\r\n _isStatusSet = true;\r\n if (isNullOrUndefined(_instrumentationKey)) {\r\n _activeStatus = ActiveStatus.INACTIVE;\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 112 /* _eInternalMessageId.InitPromiseException */, \"ikey can't be resolved from promises\");\r\n }\r\n else {\r\n _activeStatus = ActiveStatus.ACTIVE;\r\n }\r\n _releaseQueues();\r\n }\r\n function _releaseQueues() {\r\n if (_isInitialized) {\r\n _self.releaseQueue();\r\n _self.pollInternalLogs();\r\n }\r\n }\r\n function _startLogPoller(alwaysStart) {\r\n if ((!_internalLogPoller || !_internalLogPoller[_DYN_ENABLED /* @min:%2eenabled */]) && !_forceStopInternalLogPoller) {\r\n var shouldStart = alwaysStart || (_logger && _logger.queue[_DYN_LENGTH /* @min:%2elength */] > 0);\r\n if (shouldStart) {\r\n if (!_internalLogPollerListening) {\r\n _internalLogPollerListening = true;\r\n // listen for any configuration changes so that changes to the\r\n // interval will cause the timer to be re-initialized\r\n _addUnloadHook(_configHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {\r\n var interval = details.cfg.diagnosticLogInterval;\r\n if (!interval || !(interval > 0)) {\r\n interval = 10000;\r\n }\r\n var isRunning = false;\r\n if (_internalLogPoller) {\r\n // It was already created so remember it's running and cancel\r\n isRunning = _internalLogPoller[_DYN_ENABLED /* @min:%2eenabled */];\r\n _internalLogPoller[_DYN_CANCEL /* @min:%2ecancel */]();\r\n }\r\n // Create / reconfigure\r\n _internalLogPoller = createTimeout(_flushInternalLogs, interval);\r\n _internalLogPoller.unref();\r\n // Restart if previously running\r\n _internalLogPoller[_DYN_ENABLED /* @min:%2eenabled */] = isRunning;\r\n }));\r\n }\r\n _internalLogPoller[_DYN_ENABLED /* @min:%2eenabled */] = true;\r\n }\r\n }\r\n return _internalLogPoller;\r\n }\r\n _self[_DYN_STOP_POLLING_INTERNA3 /* @min:%2estopPollingInternalLogs */] = function () {\r\n _forceStopInternalLogPoller = true;\r\n _internalLogPoller && _internalLogPoller[_DYN_CANCEL /* @min:%2ecancel */]();\r\n _flushInternalLogs();\r\n };\r\n // Add addTelemetryInitializer\r\n proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, [\"addTelemetryInitializer\"]);\r\n _self[_DYN_UNLOAD /* @min:%2eunload */] = function (isAsync, unloadComplete, cbTimeout) {\r\n if (isAsync === void 0) { isAsync = true; }\r\n if (!_isInitialized) {\r\n // The SDK is not initialized\r\n throwError(strSdkNotInitialized);\r\n }\r\n // Check if the SDK still unloading so throw\r\n if (_isUnloading) {\r\n // The SDK is already unloading\r\n throwError(strSdkUnloadingError);\r\n }\r\n var unloadState = {\r\n reason: 50 /* TelemetryUnloadReason.SdkUnload */,\r\n isAsync: isAsync,\r\n flushComplete: false\r\n };\r\n var result;\r\n if (isAsync && !unloadComplete) {\r\n result = createPromise(function (resolve) {\r\n // Set the callback to the promise resolve callback\r\n unloadComplete = resolve;\r\n });\r\n }\r\n var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self);\r\n processUnloadCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](function () {\r\n _hookContainer.run(_self[_DYN_LOGGER /* @min:%2elogger */]);\r\n // Run any \"unload\" functions for the _cookieManager, _notificationManager and _logger\r\n doUnloadAll([_cookieManager, _notificationManager, _logger], isAsync, function () {\r\n _initDefaults();\r\n unloadComplete && unloadComplete(unloadState);\r\n });\r\n }, _self);\r\n function _doUnload(flushComplete) {\r\n unloadState.flushComplete = flushComplete;\r\n _isUnloading = true;\r\n // Run all of the unload handlers first (before unloading the plugins)\r\n _unloadHandlers.run(processUnloadCtx, unloadState);\r\n // Stop polling the internal logs\r\n _self[_DYN_STOP_POLLING_INTERNA3 /* @min:%2estopPollingInternalLogs */]();\r\n // Start unloading the components, from this point onwards the SDK should be considered to be in an unstable state\r\n processUnloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](unloadState);\r\n }\r\n _flushInternalLogs();\r\n if (!_flushChannels(isAsync, _doUnload, 6 /* SendRequestReason.SdkUnload */, cbTimeout)) {\r\n _doUnload(false);\r\n }\r\n return result;\r\n };\r\n _self[_DYN_GET_PLUGIN /* @min:%2egetPlugin */] = _getPlugin;\r\n _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) {\r\n if (!plugin) {\r\n addCb && addCb(false);\r\n _logOrThrowError(strValidationError);\r\n return;\r\n }\r\n var existingPlugin = _getPlugin(plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */]);\r\n if (existingPlugin && !replaceExisting) {\r\n addCb && addCb(false);\r\n _logOrThrowError(\"Plugin [\" + plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] + \"] is already loaded!\");\r\n return;\r\n }\r\n var updateState = {\r\n reason: 16 /* TelemetryUpdateReason.PluginAdded */\r\n };\r\n function _addPlugin(removed) {\r\n _configExtensions[_DYN_PUSH /* @min:%2epush */](plugin);\r\n updateState.added = [plugin];\r\n // Re-Initialize the plugin chain\r\n _initPluginChain(updateState);\r\n addCb && addCb(true);\r\n }\r\n if (existingPlugin) {\r\n var removedPlugins_1 = [existingPlugin.plugin];\r\n var unloadState = {\r\n reason: 2 /* TelemetryUnloadReason.PluginReplace */,\r\n isAsync: !!isAsync\r\n };\r\n _removePlugins(removedPlugins_1, unloadState, function (removed) {\r\n if (!removed) {\r\n // Previous plugin was successfully removed or was not installed\r\n addCb && addCb(false);\r\n }\r\n else {\r\n updateState.removed = removedPlugins_1;\r\n updateState.reason |= 32 /* TelemetryUpdateReason.PluginRemoved */;\r\n _addPlugin(true);\r\n }\r\n });\r\n }\r\n else {\r\n _addPlugin(false);\r\n }\r\n };\r\n _self.updateCfg = function (newConfig, mergeExisting) {\r\n if (mergeExisting === void 0) { mergeExisting = true; }\r\n var updateState;\r\n if (_self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]()) {\r\n updateState = {\r\n reason: 1 /* TelemetryUpdateReason.ConfigurationChanged */,\r\n cfg: _configHandler.cfg,\r\n oldCfg: deepExtend({}, _configHandler.cfg),\r\n newConfig: deepExtend({}, newConfig),\r\n merge: mergeExisting\r\n };\r\n newConfig = updateState.newConfig;\r\n var cfg = _configHandler.cfg;\r\n // replace the immutable (if initialized) values\r\n // We don't currently allow updating the extensions and channels via the update config\r\n // So overwriting any user provided values to reuse the existing values\r\n newConfig[STR_EXTENSIONS /* @min:%2eextensions */] = cfg[STR_EXTENSIONS /* @min:%2eextensions */];\r\n newConfig[STR_CHANNELS /* @min:%2echannels */] = cfg[STR_CHANNELS /* @min:%2echannels */];\r\n }\r\n // Explicitly blocking any previous config watchers so that they don't get called because\r\n // of this bulk update (Probably not necessary)\r\n _configHandler._block(function (details) {\r\n // Lets assign the new values to the existing config either overwriting or re-assigning\r\n var theConfig = details.cfg;\r\n _deepMergeConfig(details, theConfig, newConfig, mergeExisting);\r\n if (!mergeExisting) {\r\n // Remove (unassign) the values \"missing\" from the newConfig and also not in the default config\r\n objForEachKey(theConfig, function (key) {\r\n if (!objHasOwn(newConfig, key)) {\r\n // Set the value to undefined\r\n details.set(theConfig, key, UNDEFINED_VALUE);\r\n }\r\n });\r\n }\r\n // Apply defaults to the new config\r\n details.setDf(theConfig, defaultConfig);\r\n }, true);\r\n // Now execute all of the listeners (synchronously) so they update their values immediately\r\n _configHandler.notify();\r\n if (updateState) {\r\n _doUpdate(updateState);\r\n }\r\n };\r\n _self.evtNamespace = function () {\r\n return _evtNamespace;\r\n };\r\n _self.flush = _flushChannels;\r\n _self.getTraceCtx = function (createNew) {\r\n if (!_traceCtx) {\r\n _traceCtx = createDistributedTraceContext();\r\n }\r\n return _traceCtx;\r\n };\r\n _self.setTraceCtx = function (traceCtx) {\r\n _traceCtx = traceCtx || null;\r\n };\r\n _self.addUnloadHook = _addUnloadHook;\r\n // Create the addUnloadCb\r\n proxyFunctionAs(_self, \"addUnloadCb\", function () { return _unloadHandlers; }, \"add\");\r\n _self.onCfgChange = function (handler) {\r\n var unloadHook;\r\n if (!_isInitialized) {\r\n unloadHook = _addDelayedCfgListener(_cfgListeners, handler);\r\n }\r\n else {\r\n unloadHook = onConfigChange(_configHandler.cfg, handler, _self[_DYN_LOGGER /* @min:%2elogger */]);\r\n }\r\n return _createUnloadHook(unloadHook);\r\n };\r\n _self.getWParam = function () {\r\n return (hasDocument() || !!_configHandler.cfg.enableWParam) ? 0 : -1;\r\n };\r\n function _setPluginVersions() {\r\n var thePlugins = {};\r\n _pluginVersionStringArr = [];\r\n var _addPluginVersions = function (plugins) {\r\n if (plugins) {\r\n arrForEach(plugins, function (plugin) {\r\n if (plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] && plugin[_DYN_VERSION /* @min:%2eversion */] && !thePlugins[plugin.identifier]) {\r\n var ver = plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] + \"=\" + plugin[_DYN_VERSION /* @min:%2eversion */];\r\n _pluginVersionStringArr[_DYN_PUSH /* @min:%2epush */](ver);\r\n thePlugins[plugin.identifier] = plugin;\r\n }\r\n });\r\n }\r\n };\r\n _addPluginVersions(_channels);\r\n if (_channelConfig) {\r\n arrForEach(_channelConfig, function (channels) {\r\n _addPluginVersions(channels);\r\n });\r\n }\r\n _addPluginVersions(_configExtensions);\r\n }\r\n function _initDefaults() {\r\n _isInitialized = false;\r\n // Use a default logger so initialization errors are not dropped on the floor with full logging\r\n _configHandler = createDynamicConfig({}, defaultConfig, _self[_DYN_LOGGER /* @min:%2elogger */]);\r\n // Set the logging level to critical so that any critical initialization failures are displayed on the console\r\n _configHandler.cfg[_DYN_LOGGING_LEVEL_CONSOL4 /* @min:%2eloggingLevelConsole */] = 1 /* eLoggingSeverity.CRITICAL */;\r\n // Define _self.config\r\n objDefine(_self, \"config\", {\r\n g: function () { return _configHandler.cfg; },\r\n s: function (newValue) {\r\n _self.updateCfg(newValue, false);\r\n }\r\n });\r\n objDefine(_self, \"pluginVersionStringArr\", {\r\n g: function () {\r\n if (!_pluginVersionStringArr) {\r\n _setPluginVersions();\r\n }\r\n return _pluginVersionStringArr;\r\n }\r\n });\r\n objDefine(_self, \"pluginVersionString\", {\r\n g: function () {\r\n if (!_pluginVersionString) {\r\n if (!_pluginVersionStringArr) {\r\n _setPluginVersions();\r\n }\r\n _pluginVersionString = _pluginVersionStringArr.join(\";\");\r\n }\r\n return _pluginVersionString || STR_EMPTY;\r\n }\r\n });\r\n objDefine(_self, \"logger\", {\r\n g: function () {\r\n if (!_logger) {\r\n _logger = new DiagnosticLogger(_configHandler.cfg);\r\n _configHandler[_DYN_LOGGER /* @min:%2elogger */] = _logger;\r\n }\r\n return _logger;\r\n },\r\n s: function (newLogger) {\r\n _configHandler[_DYN_LOGGER /* @min:%2elogger */] = newLogger;\r\n if (_logger !== newLogger) {\r\n runTargetUnload(_logger, false);\r\n _logger = newLogger;\r\n }\r\n }\r\n });\r\n _self[_DYN_LOGGER /* @min:%2elogger */] = new DiagnosticLogger(_configHandler.cfg);\r\n _extensions = [];\r\n var cfgExtensions = _self.config[STR_EXTENSIONS /* @min:%2eextensions */] || [];\r\n cfgExtensions.splice(0, cfgExtensions[_DYN_LENGTH /* @min:%2elength */]);\r\n arrAppend(cfgExtensions, _extensions);\r\n _telemetryInitializerPlugin = new TelemetryInitializerPlugin();\r\n _eventQueue = [];\r\n runTargetUnload(_notificationManager, false);\r\n _notificationManager = null;\r\n _perfManager = null;\r\n _cfgPerfManager = null;\r\n runTargetUnload(_cookieManager, false);\r\n _cookieManager = null;\r\n _pluginChain = null;\r\n _configExtensions = [];\r\n _channelConfig = null;\r\n _channels = null;\r\n _isUnloading = false;\r\n _internalLogsEventName = null;\r\n _evtNamespace = createUniqueNamespace(\"AIBaseCore\", true);\r\n _unloadHandlers = createUnloadHandlerContainer();\r\n _traceCtx = null;\r\n _instrumentationKey = null;\r\n _hookContainer = createUnloadHookContainer();\r\n _cfgListeners = [];\r\n _pluginVersionString = null;\r\n _pluginVersionStringArr = null;\r\n _forceStopInternalLogPoller = false;\r\n _internalLogPoller = null;\r\n _internalLogPollerListening = false;\r\n _activeStatus = 0 /* eActiveStatus.NONE */; // default is None\r\n _endpoint = null;\r\n _initInMemoMaxSize = null;\r\n _isStatusSet = false;\r\n _initTimer = null;\r\n }\r\n function _createTelCtx() {\r\n var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);\r\n theCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](_startLogPoller);\r\n return theCtx;\r\n }\r\n // Initialize or Re-initialize the plugins\r\n function _initPluginChain(updateState) {\r\n // Extension validation\r\n var theExtensions = _validateExtensions(_self[_DYN_LOGGER /* @min:%2elogger */], ChannelControllerPriority, _configExtensions);\r\n _pluginChain = null;\r\n _pluginVersionString = null;\r\n _pluginVersionStringArr = null;\r\n // Get the primary channel queue and include as part of the normal extensions\r\n _channels = (_channelConfig || [])[0] || [];\r\n // Add any channels provided in the extensions and sort them\r\n _channels = sortPlugins(arrAppend(_channels, theExtensions[STR_CHANNELS /* @min:%2echannels */]));\r\n // Create an array of all extensions, including the _channels\r\n var allExtensions = arrAppend(sortPlugins(theExtensions[STR_CORE /* @min:%2ecore */]), _channels);\r\n // Required to allow plugins to call core.getPlugin() during their own initialization\r\n _extensions = objFreeze(allExtensions);\r\n // This has a side effect of adding the extensions passed during initialization\r\n // into the config.extensions, so you can see all of the extensions loaded.\r\n // This will also get updated by the addPlugin() and remove plugin code.\r\n var cfgExtensions = _self.config[STR_EXTENSIONS /* @min:%2eextensions */] || [];\r\n cfgExtensions.splice(0, cfgExtensions[_DYN_LENGTH /* @min:%2elength */]);\r\n arrAppend(cfgExtensions, _extensions);\r\n var rootCtx = _createTelCtx();\r\n // Initializing the channels first\r\n if (_channels && _channels[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n initializePlugins(rootCtx[_DYN_CREATE_NEW /* @min:%2ecreateNew */](_channels), allExtensions);\r\n }\r\n // Now initialize the normal extensions (explicitly not including the _channels as this can cause duplicate initialization)\r\n initializePlugins(rootCtx, allExtensions);\r\n if (updateState) {\r\n _doUpdate(updateState);\r\n }\r\n }\r\n function _getPlugin(pluginIdentifier) {\r\n var theExt = null;\r\n var thePlugin = null;\r\n var channelHosts = [];\r\n arrForEach(_extensions, function (ext) {\r\n if (ext[_DYN_IDENTIFIER /* @min:%2eidentifier */] === pluginIdentifier && ext !== _telemetryInitializerPlugin) {\r\n thePlugin = ext;\r\n return -1;\r\n }\r\n if (ext.getChannel) {\r\n channelHosts[_DYN_PUSH /* @min:%2epush */](ext);\r\n }\r\n });\r\n if (!thePlugin && channelHosts[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(channelHosts, function (host) {\r\n thePlugin = host.getChannel(pluginIdentifier);\r\n if (!thePlugin) {\r\n return -1;\r\n }\r\n });\r\n }\r\n if (thePlugin) {\r\n theExt = {\r\n plugin: thePlugin,\r\n setEnabled: function (enabled) {\r\n _getPluginState(thePlugin)[STR_DISABLED] = !enabled;\r\n },\r\n isEnabled: function () {\r\n var pluginState = _getPluginState(thePlugin);\r\n return !pluginState[_DYN_TEARDOWN /* @min:%2eteardown */] && !pluginState[STR_DISABLED];\r\n },\r\n remove: function (isAsync, removeCb) {\r\n if (isAsync === void 0) { isAsync = true; }\r\n var pluginsToRemove = [thePlugin];\r\n var unloadState = {\r\n reason: 1 /* TelemetryUnloadReason.PluginUnload */,\r\n isAsync: isAsync\r\n };\r\n _removePlugins(pluginsToRemove, unloadState, function (removed) {\r\n if (removed) {\r\n // Re-Initialize the plugin chain\r\n _initPluginChain({\r\n reason: 32 /* TelemetryUpdateReason.PluginRemoved */,\r\n removed: pluginsToRemove\r\n });\r\n }\r\n removeCb && removeCb(removed);\r\n });\r\n }\r\n };\r\n }\r\n return theExt;\r\n }\r\n function _getPluginChain() {\r\n if (!_pluginChain) {\r\n // copy the collection of extensions\r\n var extensions = (_extensions || []).slice();\r\n // During add / remove this may get called again, so don't read if already present\r\n if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) {\r\n extensions[_DYN_PUSH /* @min:%2epush */](_telemetryInitializerPlugin);\r\n }\r\n _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _configHandler.cfg, _self);\r\n }\r\n return _pluginChain;\r\n }\r\n function _removePlugins(thePlugins, unloadState, removeComplete) {\r\n if (thePlugins && thePlugins[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var unloadChain = createTelemetryProxyChain(thePlugins, _configHandler.cfg, _self);\r\n var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self);\r\n unloadCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](function () {\r\n var removed = false;\r\n // Remove the listed config extensions\r\n var newConfigExtensions = [];\r\n arrForEach(_configExtensions, function (plugin, idx) {\r\n if (!_isPluginPresent(plugin, thePlugins)) {\r\n newConfigExtensions[_DYN_PUSH /* @min:%2epush */](plugin);\r\n }\r\n else {\r\n removed = true;\r\n }\r\n });\r\n _configExtensions = newConfigExtensions;\r\n _pluginVersionString = null;\r\n _pluginVersionStringArr = null;\r\n // Re-Create the channel config\r\n var newChannelConfig = [];\r\n if (_channelConfig) {\r\n arrForEach(_channelConfig, function (queue, idx) {\r\n var newQueue = [];\r\n arrForEach(queue, function (channel) {\r\n if (!_isPluginPresent(channel, thePlugins)) {\r\n newQueue[_DYN_PUSH /* @min:%2epush */](channel);\r\n }\r\n else {\r\n removed = true;\r\n }\r\n });\r\n newChannelConfig[_DYN_PUSH /* @min:%2epush */](newQueue);\r\n });\r\n _channelConfig = newChannelConfig;\r\n }\r\n removeComplete && removeComplete(removed);\r\n _startLogPoller();\r\n });\r\n unloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](unloadState);\r\n }\r\n else {\r\n removeComplete(false);\r\n }\r\n }\r\n function _flushInternalLogs() {\r\n if (_logger && _logger.queue) {\r\n var queue = _logger.queue.slice(0);\r\n _logger.queue[_DYN_LENGTH /* @min:%2elength */] = 0;\r\n arrForEach(queue, function (logMessage) {\r\n var item = {\r\n name: _internalLogsEventName ? _internalLogsEventName : \"InternalMessageId: \" + logMessage[_DYN_MESSAGE_ID /* @min:%2emessageId */],\r\n iKey: _instrumentationKey,\r\n time: toISOString(new Date()),\r\n baseType: _InternalLogMessage.dataType,\r\n baseData: { message: logMessage[_DYN_MESSAGE /* @min:%2emessage */] }\r\n };\r\n _self.track(item);\r\n });\r\n }\r\n }\r\n function _flushChannels(isAsync, callBack, sendReason, cbTimeout) {\r\n // Setting waiting to one so that we don't call the callBack until we finish iterating\r\n var waiting = 1;\r\n var doneIterating = false;\r\n var cbTimer = null;\r\n cbTimeout = cbTimeout || 5000;\r\n function doCallback() {\r\n waiting--;\r\n if (doneIterating && waiting === 0) {\r\n cbTimer && cbTimer[_DYN_CANCEL /* @min:%2ecancel */]();\r\n cbTimer = null;\r\n callBack && callBack(doneIterating);\r\n callBack = null;\r\n }\r\n }\r\n if (_channels && _channels[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var flushCtx = _createTelCtx()[_DYN_CREATE_NEW /* @min:%2ecreateNew */](_channels);\r\n flushCtx.iterate(function (plugin) {\r\n if (plugin.flush) {\r\n waiting++;\r\n var handled_1 = false;\r\n // Not all channels will call this callback for every scenario\r\n if (!plugin.flush(isAsync, function () {\r\n handled_1 = true;\r\n doCallback();\r\n }, sendReason)) {\r\n if (!handled_1) {\r\n // If any channel doesn't return true and it didn't call the callback, then we should assume that the callback\r\n // will never be called, so use a timeout to allow the channel(s) some time to \"finish\" before triggering any\r\n // followup function (such as unloading)\r\n if (isAsync && cbTimer == null) {\r\n cbTimer = scheduleTimeout(function () {\r\n cbTimer = null;\r\n doCallback();\r\n }, cbTimeout);\r\n }\r\n else {\r\n doCallback();\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n doneIterating = true;\r\n doCallback();\r\n return true;\r\n }\r\n function _initPerfManager() {\r\n // Save the previous config based performance manager creator to avoid creating new perf manager instances if unchanged\r\n var prevCfgPerfMgr;\r\n // Will get recalled if any referenced config values are changed\r\n _addUnloadHook(_configHandler[_DYN_WATCH /* @min:%2ewatch */](function (details) {\r\n var enablePerfMgr = details.cfg.enablePerfMgr;\r\n if (enablePerfMgr) {\r\n var createPerfMgr = details.cfg[STR_CREATE_PERF_MGR /* @min:%2ecreatePerfMgr */];\r\n // for preCfgPerfMgr = createPerfMgr = null\r\n // initial createPerfMgr function should be _createPerfManager\r\n if ((prevCfgPerfMgr !== createPerfMgr) || !prevCfgPerfMgr) {\r\n if (!createPerfMgr) {\r\n createPerfMgr = _createPerfManager;\r\n }\r\n // Set the performance manager creation function if not defined\r\n getSetValue(details.cfg, STR_CREATE_PERF_MGR, createPerfMgr);\r\n prevCfgPerfMgr = createPerfMgr;\r\n // Remove any existing config based performance manager\r\n _cfgPerfManager = null;\r\n }\r\n // Only create the performance manager if it's not already created or manually set\r\n if (!_perfManager && !_cfgPerfManager && isFunction(createPerfMgr)) {\r\n // Create a new config based performance manager\r\n _cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */]());\r\n }\r\n }\r\n else {\r\n // Remove any existing config based performance manager\r\n _cfgPerfManager = null;\r\n // Clear the previous cached value so it can be GC'd\r\n prevCfgPerfMgr = null;\r\n }\r\n }));\r\n }\r\n function _doUpdate(updateState) {\r\n var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self);\r\n updateCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](_startLogPoller);\r\n if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) {\r\n updateCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](updateState);\r\n }\r\n }\r\n function _logOrThrowError(message) {\r\n var logger = _self[_DYN_LOGGER /* @min:%2elogger */];\r\n if (logger) {\r\n // there should always be a logger\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, message);\r\n _startLogPoller();\r\n }\r\n else {\r\n throwError(message);\r\n }\r\n }\r\n function _notifyInvalidEvent(telemetryItem) {\r\n var manager = _self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */]();\r\n if (manager) {\r\n manager[STR_EVENTS_DISCARDED /* @min:%2eeventsDiscarded */]([telemetryItem], 2 /* eEventsDiscardedReason.InvalidEvent */);\r\n }\r\n }\r\n function _addUnloadHook(hooks) {\r\n _hookContainer.add(hooks);\r\n }\r\n });\r\n }\r\n AppInsightsCore.prototype.initialize = function (config, extensions, logger, notificationManager) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsCore.prototype.getChannels = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n AppInsightsCore.prototype.track = function (telemetryItem) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsCore.prototype.getProcessTelContext = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n AppInsightsCore.prototype.getNotifyMgr = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.\r\n * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be\r\n * called.\r\n * @param listener - An INotificationListener object.\r\n */\r\n AppInsightsCore.prototype.addNotificationListener = function (listener) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param listener - INotificationListener to remove.\r\n */\r\n AppInsightsCore.prototype.removeNotificationListener = function (listener) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Get the current cookie manager for this instance\r\n */\r\n AppInsightsCore.prototype.getCookieMgr = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Set the current cookie manager for this instance\r\n * @param cookieMgr - The manager, if set to null/undefined will cause the default to be created\r\n */\r\n AppInsightsCore.prototype.setCookieMgr = function (cookieMgr) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsCore.prototype.getPerfMgr = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n AppInsightsCore.prototype.setPerfMgr = function (perfMgr) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsCore.prototype.eventCnt = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return 0;\r\n };\r\n /**\r\n * Enable the timer that checks the logger.queue for log messages to be flushed.\r\n * Note: Since 3.0.1 and 2.8.13 this is no longer an interval timer but is a normal\r\n * timer that is only started when this function is called and then subsequently\r\n * only _if_ there are any logger.queue messages to be sent.\r\n */\r\n AppInsightsCore.prototype.pollInternalLogs = function (eventName) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Stop the timer that log messages from logger.queue when available\r\n */\r\n AppInsightsCore.prototype.stopPollingInternalLogs = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Add a telemetry processor to decorate or drop telemetry events.\r\n * @param telemetryInitializer - The Telemetry Initializer function\r\n * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed\r\n */\r\n AppInsightsCore.prototype.addTelemetryInitializer = function (telemetryInitializer) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered\r\n * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous\r\n * unload call return `true` stating that all plugins reported that they also unloaded, the recommended\r\n * approach is to create a new instance and initialize that instance.\r\n * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable\r\n * to successfully remove any global references or they may just be completing the unload process asynchronously.\r\n * If you pass isAsync as `true` (also the default) and DO NOT pass a callback function then an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * will be returned which will resolve once the unload is complete. The actual implementation of the `IPromise`\r\n * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async)\r\n * @param isAsync - Can the unload be performed asynchronously (default)\r\n * @param unloadComplete - An optional callback that will be called once the unload has completed\r\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the\r\n * unload. Defaults to 5 seconds.\r\n * @returns Nothing or if occurring asynchronously a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * which will be resolved once the unload is complete, the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * will only be returned when no callback is provided and isAsync is true\r\n */\r\n AppInsightsCore.prototype.unload = function (isAsync, unloadComplete, cbTimeout) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsCore.prototype.getPlugin = function (pluginIdentifier) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Add a new plugin to the installation\r\n * @param plugin - The new plugin to add\r\n * @param replaceExisting - should any existing plugin be replaced, default is false\r\n * @param doAsync - Should the add be performed asynchronously\r\n * @param addCb - [Optional] callback to call after the plugin has been added\r\n */\r\n AppInsightsCore.prototype.addPlugin = function (plugin, replaceExisting, doAsync, addCb) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Update the configuration used and broadcast the changes to all loaded plugins\r\n * @param newConfig - The new configuration is apply\r\n * @param mergeExisting - Should the new configuration merge with the existing or just replace it. Default is to true.\r\n */\r\n AppInsightsCore.prototype.updateCfg = function (newConfig, mergeExisting) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Returns the unique event namespace that should be used\r\n */\r\n AppInsightsCore.prototype.evtNamespace = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Add an unload handler that will be called when the SDK is being unloaded\r\n * @param handler - the handler\r\n */\r\n AppInsightsCore.prototype.addUnloadCb = function (handler) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Flush and send any batched / cached data immediately\r\n * @param async - send data asynchronously when true (defaults to true)\r\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.\r\n * If the caller doesn't return true the caller should assume that it may never be called.\r\n * @param sendReason - specify the reason that you are calling \"flush\" defaults to ManualFlush (1) if not specified\r\n * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called\r\n */\r\n AppInsightsCore.prototype.flush = function (isAsync, callBack, sendReason) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Gets the current distributed trace context for this instance if available\r\n * @param createNew - Optional flag to create a new instance if one doesn't currently exist, defaults to true\r\n */\r\n AppInsightsCore.prototype.getTraceCtx = function (createNew) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Sets the current distributed trace context for this instance if available\r\n */\r\n AppInsightsCore.prototype.setTraceCtx = function (newTracectx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Add this hook so that it is automatically removed during unloading\r\n * @param hooks - The single hook or an array of IInstrumentHook objects\r\n */\r\n AppInsightsCore.prototype.addUnloadHook = function (hooks) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Watches and tracks changes for accesses to the current config, and if the accessed config changes the\r\n * handler will be recalled.\r\n * @param handler - The watcher handler to call when the config changes\r\n * @returns A watcher handler instance that can be used to remove itself when being unloaded\r\n */\r\n AppInsightsCore.prototype.onCfgChange = function (handler) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Watches and tracks status of initialization process\r\n * @returns ActiveStatus\r\n * @since 3.3.0\r\n * If returned status is active, it means initialization process is completed.\r\n * If returned status is pending, it means the initialization process is waiting for promieses to be resolved.\r\n * If returned status is inactive, it means ikey is invalid or can 't get ikey or enpoint url from promsises.\r\n */\r\n AppInsightsCore.prototype.activeStatus = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Set Active Status to pending, which will block the incoming changes until internal promises are resolved\r\n * @internal Internal use\r\n * @since 3.3.0\r\n */\r\n AppInsightsCore.prototype._setPendingStatus = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n AppInsightsCore.prototype.releaseQueue = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.\r\n * @param updateCtx - The plugin update context\r\n * @param updateState - The Update State\r\n * @returns boolean - True means the extension class will call updateState otherwise the Core will\r\n */\r\n AppInsightsCore.prototype._updateHook = function (updateCtx, updateState) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return false;\r\n };\r\n return AppInsightsCore;\r\n}());\r\nexport { AppInsightsCore };\r\n//# sourceMappingURL=AppInsightsCore.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { Extensions, dataSanitizeUrl, dateTimeUtilsDuration, msToTimeSpan, urlGetAbsoluteUrl, urlGetCompleteUrl } from \"@microsoft/applicationinsights-common\";\r\nimport { arrForEach, isNullOrUndefined, isNumber, isString, normalizeJsName, objForEachKey, objKeys } from \"@microsoft/applicationinsights-core-js\";\r\nimport { mathRound } from \"@nevware21/ts-utils\";\r\nimport { STR_DURATION, STR_PROPERTIES } from \"./InternalConstants\";\r\nimport { _DYN_ABORTED, _DYN_AJAX_TOTAL_DURATION, _DYN_CORRELATION_CONTEXT, _DYN_ERROR_STATUS_TEXT, _DYN_EVENT_TRACE_CTX, _DYN_GET_ABSOLUTE_URL, _DYN_GET_PART_APROPS, _DYN_GET_TRACE_FLAGS, _DYN_GET_TRACE_ID, _DYN_HEADER_MAP, _DYN_LENGTH, _DYN_METHOD, _DYN_PERF_MARK, _DYN_PERF_TIMING, _DYN_REQUEST_HEADERS, _DYN_REQUEST_SENT_TIME, _DYN_REQUEST_URL, _DYN_RESPONSE_FINISHED_TI12, _DYN_SPAN_ID, _DYN_START_TIME, _DYN_STATE_CHANGE_ATTACHE11, _DYN_STATUS, _DYN_STATUS_TEXT, _DYN_TRACE_FLAGS, _DYN_TRACE_ID, _DYN__CREATE_TRACK_ITEM } from \"./__DynamicConstants\";\r\n/** @ignore */\r\nfunction _calcPerfDuration(resourceEntry, start, end) {\r\n var result = 0;\r\n var from = resourceEntry[start];\r\n var to = resourceEntry[end];\r\n if (from && to) {\r\n result = dateTimeUtilsDuration(from, to);\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfDuration(props, name, resourceEntry, start, end) {\r\n var result = 0;\r\n var value = _calcPerfDuration(resourceEntry, start, end);\r\n if (value) {\r\n result = _setPerfValue(props, name, msToTimeSpan(value));\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfValue(props, name, value) {\r\n var strPerf = \"ajaxPerf\";\r\n var result = 0;\r\n if (props && name && value) {\r\n var perfData = props[strPerf] = (props[strPerf] || {});\r\n perfData[name] = value;\r\n result = 1;\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _populatePerfData(ajaxData, dependency) {\r\n /*\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API\r\n * | -startTime\r\n * | -redirectStart\r\n * | | -redirectEnd\r\n * | | | -fetchStart\r\n * | | | | -domainLookupStart\r\n * | | | | |- domainLookupEnd\r\n * | | | | | | -connectStart\r\n * | | | | | | | -secureConnectionStart\r\n * | | | | | | | | -connectEnd\r\n * | | | | | | | | | -requestStart\r\n * | | | | | | | | | | | -responseStart\r\n * | | | | | | | | | | | | | -responseEnd\r\n * +------------+-+---+----------------+-+--+--------+-+-----------+-+------------+-+\r\n * |--redirect--| |---|--domainLookup--| |--connect--| |--request--| |--response--| |\r\n * |-------------------networkConnect----------------|\r\n * | |---------sentRequest--------|\r\n * |------------------------------------perfTotal-----------------------------------|\r\n */\r\n var resourceEntry = ajaxData[_DYN_PERF_TIMING /* @min:%2eperfTiming */];\r\n var props = dependency[STR_PROPERTIES /* @min:%2eproperties */] || {};\r\n var propsSet = 0;\r\n var strName = \"name\";\r\n var strStart = \"Start\";\r\n var strEnd = \"End\";\r\n var strDomainLookup = \"domainLookup\";\r\n var strConnect = \"connect\";\r\n var strRedirect = \"redirect\";\r\n var strRequest = \"request\";\r\n var strResponse = \"response\";\r\n var strStartTime = \"startTime\";\r\n var strDomainLookupStart = strDomainLookup + strStart;\r\n var strDomainLookupEnd = strDomainLookup + strEnd;\r\n var strConnectStart = strConnect + strStart;\r\n var strConnectEnd = strConnect + strEnd;\r\n var strRequestStart = strRequest + strStart;\r\n var strRequestEnd = strRequest + strEnd;\r\n var strResponseStart = strResponse + strStart;\r\n var strResponseEnd = strResponse + strEnd;\r\n var strRedirectStart = strRedirect + strStart;\r\n var strRedirectEnd = strRedirect = strEnd;\r\n var strTransferSize = \"transferSize\";\r\n var strEncodedBodySize = \"encodedBodySize\";\r\n var strDecodedBodySize = \"decodedBodySize\";\r\n var strServerTiming = \"serverTiming\";\r\n if (resourceEntry) {\r\n // redirect\r\n propsSet |= _setPerfDuration(props, strRedirect, resourceEntry, strRedirectStart, strRedirectEnd);\r\n // domainLookup\r\n propsSet |= _setPerfDuration(props, strDomainLookup, resourceEntry, strDomainLookupStart, strDomainLookupEnd);\r\n // connect\r\n propsSet |= _setPerfDuration(props, strConnect, resourceEntry, strConnectStart, strConnectEnd);\r\n // request\r\n propsSet |= _setPerfDuration(props, strRequest, resourceEntry, strRequestStart, strRequestEnd);\r\n // response\r\n propsSet |= _setPerfDuration(props, strResponse, resourceEntry, strResponseStart, strResponseEnd);\r\n // Network connection time\r\n propsSet |= _setPerfDuration(props, \"networkConnect\", resourceEntry, strStartTime, strConnectEnd);\r\n // Sent Request\r\n propsSet |= _setPerfDuration(props, \"sentRequest\", resourceEntry, strRequestStart, strResponseEnd);\r\n // PerfTotal / Duration\r\n var duration = resourceEntry[STR_DURATION /* @min:%2eduration */];\r\n if (!duration) {\r\n duration = _calcPerfDuration(resourceEntry, strStartTime, strResponseEnd) || 0;\r\n }\r\n propsSet |= _setPerfValue(props, STR_DURATION, duration);\r\n propsSet |= _setPerfValue(props, \"perfTotal\", duration);\r\n var serverTiming = resourceEntry[strServerTiming];\r\n if (serverTiming) {\r\n var server_1 = {};\r\n arrForEach(serverTiming, function (value, idx) {\r\n var name = normalizeJsName(value[strName] || \"\" + idx);\r\n var newValue = server_1[name] || {};\r\n objForEachKey(value, function (key, val) {\r\n if (key !== strName && isString(val) || isNumber(val)) {\r\n if (newValue[key]) {\r\n val = newValue[key] + \";\" + val;\r\n }\r\n if (val || !isString(val)) {\r\n // Only set the value if it has a value and it's not an empty string\r\n newValue[key] = val;\r\n }\r\n }\r\n });\r\n server_1[name] = newValue;\r\n });\r\n propsSet |= _setPerfValue(props, strServerTiming, server_1);\r\n }\r\n propsSet |= _setPerfValue(props, strTransferSize, resourceEntry[strTransferSize]);\r\n propsSet |= _setPerfValue(props, strEncodedBodySize, resourceEntry[strEncodedBodySize]);\r\n propsSet |= _setPerfValue(props, strDecodedBodySize, resourceEntry[strDecodedBodySize]);\r\n }\r\n else {\r\n if (ajaxData[_DYN_PERF_MARK /* @min:%2eperfMark */]) {\r\n propsSet |= _setPerfValue(props, \"missing\", ajaxData.perfAttempts);\r\n }\r\n }\r\n if (propsSet) {\r\n dependency[STR_PROPERTIES /* @min:%2eproperties */] = props;\r\n }\r\n}\r\nvar XHRMonitoringState = /** @class */ (function () {\r\n function XHRMonitoringState() {\r\n var self = this;\r\n self.openDone = false;\r\n self.setRequestHeaderDone = false;\r\n self.sendDone = false;\r\n self.abortDone = false;\r\n // True, if onreadyStateChangeCallback function attached to xhr, otherwise false\r\n self[_DYN_STATE_CHANGE_ATTACHE11 /* @min:%2estateChangeAttached */] = false;\r\n }\r\n return XHRMonitoringState;\r\n}());\r\nexport { XHRMonitoringState };\r\nvar ajaxRecord = /** @class */ (function () {\r\n function ajaxRecord(traceId, spanId, logger, traceCtx) {\r\n var self = this;\r\n var _logger = logger;\r\n var strResponseText = \"responseText\";\r\n // Assigning the initial/default values within the constructor to avoid typescript from creating a bunch of\r\n // this.XXXX = null\r\n self[_DYN_PERF_MARK /* @min:%2eperfMark */] = null;\r\n self.completed = false;\r\n self.requestHeadersSize = null;\r\n self[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */] = null;\r\n self.responseReceivingDuration = null;\r\n self.callbackDuration = null;\r\n self[_DYN_AJAX_TOTAL_DURATION /* @min:%2eajaxTotalDuration */] = null;\r\n self[_DYN_ABORTED /* @min:%2eaborted */] = 0;\r\n self.pageUrl = null;\r\n self[_DYN_REQUEST_URL /* @min:%2erequestUrl */] = null;\r\n self.requestSize = 0;\r\n self[_DYN_METHOD /* @min:%2emethod */] = null;\r\n self[_DYN_STATUS /* @min:%2estatus */] = null;\r\n self[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */] = null;\r\n self.responseStartedTime = null;\r\n self[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */] = null;\r\n self.callbackFinishedTime = null;\r\n self.endTime = null;\r\n self.xhrMonitoringState = new XHRMonitoringState();\r\n self.clientFailure = 0;\r\n self[_DYN_TRACE_ID /* @min:%2etraceID */] = traceId;\r\n self[_DYN_SPAN_ID /* @min:%2espanID */] = spanId;\r\n self[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = traceCtx === null || traceCtx === void 0 ? void 0 : traceCtx.getTraceFlags();\r\n if (traceCtx) {\r\n self[_DYN_EVENT_TRACE_CTX /* @min:%2eeventTraceCtx */] = {\r\n traceId: traceCtx[_DYN_GET_TRACE_ID /* @min:%2egetTraceId */](),\r\n spanId: traceCtx.getSpanId(),\r\n traceFlags: traceCtx[_DYN_GET_TRACE_FLAGS /* @min:%2egetTraceFlags */]()\r\n };\r\n }\r\n else {\r\n self[_DYN_EVENT_TRACE_CTX /* @min:%2eeventTraceCtx */] = null;\r\n }\r\n dynamicProto(ajaxRecord, self, function (self) {\r\n self.getAbsoluteUrl = function () {\r\n return self[_DYN_REQUEST_URL /* @min:%2erequestUrl */] ? urlGetAbsoluteUrl(self[_DYN_REQUEST_URL /* @min:%2erequestUrl */]) : null;\r\n };\r\n self.getPathName = function () {\r\n return self[_DYN_REQUEST_URL /* @min:%2erequestUrl */] ? dataSanitizeUrl(_logger, urlGetCompleteUrl(self[_DYN_METHOD /* @min:%2emethod */], self[_DYN_REQUEST_URL /* @min:%2erequestUrl */])) : null;\r\n };\r\n self[_DYN__CREATE_TRACK_ITEM /* @min:%2eCreateTrackItem */] = function (ajaxType, enableRequestHeaderTracking, getResponse) {\r\n var _a;\r\n // round to 3 decimal points\r\n self.ajaxTotalDuration = mathRound(dateTimeUtilsDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000;\r\n if (self[_DYN_AJAX_TOTAL_DURATION /* @min:%2eajaxTotalDuration */] < 0) {\r\n return null;\r\n }\r\n var dependency = (_a = {\r\n id: \"|\" + self[_DYN_TRACE_ID /* @min:%2etraceID */] + \".\" + self[_DYN_SPAN_ID /* @min:%2espanID */],\r\n target: self[_DYN_GET_ABSOLUTE_URL /* @min:%2egetAbsoluteUrl */](),\r\n name: self.getPathName(),\r\n type: ajaxType,\r\n startTime: null,\r\n duration: self[_DYN_AJAX_TOTAL_DURATION /* @min:%2eajaxTotalDuration */],\r\n success: (+(self[_DYN_STATUS /* @min:%2estatus */])) >= 200 && (+(self[_DYN_STATUS /* @min:%2estatus */])) < 400,\r\n responseCode: (+(self[_DYN_STATUS /* @min:%2estatus */]))\r\n },\r\n _a[STR_PROPERTIES] = { HttpMethod: self[_DYN_METHOD /* @min:%2emethod */] },\r\n _a);\r\n var props = dependency[STR_PROPERTIES];\r\n if (self[_DYN_ABORTED /* @min:%2eaborted */]) {\r\n props[_DYN_ABORTED /* @min:%2eaborted */] = true;\r\n }\r\n if (self[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */]) {\r\n // Set the correct dependency start time\r\n dependency[_DYN_START_TIME /* @min:%2estartTime */] = new Date();\r\n dependency[_DYN_START_TIME /* @min:%2estartTime */].setTime(self[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */]);\r\n }\r\n // Add Ajax perf details if available\r\n _populatePerfData(self, dependency);\r\n if (enableRequestHeaderTracking) {\r\n if (objKeys(self.requestHeaders)[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n props[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */] = self[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */];\r\n }\r\n }\r\n if (getResponse) {\r\n var response = getResponse();\r\n if (response) {\r\n // enrich dependency target with correlation context from the server\r\n var correlationContext = response[_DYN_CORRELATION_CONTEXT /* @min:%2ecorrelationContext */];\r\n if (correlationContext) {\r\n dependency.correlationContext = /* dependency.target + \" | \" + */ correlationContext;\r\n }\r\n if (response[_DYN_HEADER_MAP /* @min:%2eheaderMap */]) {\r\n if (objKeys(response.headerMap)[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n props.responseHeaders = response[_DYN_HEADER_MAP /* @min:%2eheaderMap */];\r\n }\r\n }\r\n if (self[_DYN_ERROR_STATUS_TEXT /* @min:%2eerrorStatusText */]) {\r\n if (self[_DYN_STATUS /* @min:%2estatus */] >= 400) {\r\n var responseType = response.type;\r\n if (responseType === \"\" || responseType === \"text\") {\r\n props.responseText = response.responseText ? response[_DYN_STATUS_TEXT /* @min:%2estatusText */] + \" - \" + response[strResponseText] : response[_DYN_STATUS_TEXT /* @min:%2estatusText */];\r\n }\r\n if (responseType === \"json\") {\r\n props.responseText = response.response ? response[_DYN_STATUS_TEXT /* @min:%2estatusText */] + \" - \" + JSON.stringify(response.response) : response[_DYN_STATUS_TEXT /* @min:%2estatusText */];\r\n }\r\n }\r\n else if (self[_DYN_STATUS /* @min:%2estatus */] === 0) {\r\n props.responseText = response[_DYN_STATUS_TEXT /* @min:%2estatusText */] || \"\";\r\n }\r\n }\r\n }\r\n }\r\n return dependency;\r\n };\r\n self[_DYN_GET_PART_APROPS /* @min:%2egetPartAProps */] = function () {\r\n var partA = null;\r\n var traceCtx = self[_DYN_EVENT_TRACE_CTX /* @min:%2eeventTraceCtx */];\r\n if (traceCtx && (traceCtx.traceId || traceCtx.spanId)) {\r\n partA = {};\r\n var traceExt = partA[Extensions.TraceExt] = {\r\n traceID: traceCtx.traceId,\r\n parentID: traceCtx.spanId\r\n };\r\n if (!isNullOrUndefined(traceCtx[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */])) {\r\n traceExt[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = traceCtx[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n }\r\n }\r\n return partA;\r\n };\r\n });\r\n }\r\n ajaxRecord.prototype.getAbsoluteUrl = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n ajaxRecord.prototype.getPathName = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n ajaxRecord.prototype.CreateTrackItem = function (ajaxType, enableRequestHeaderTracking, getResponse) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n ajaxRecord.prototype.getPartAProps = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return ajaxRecord;\r\n}());\r\nexport { ajaxRecord };\r\n//# sourceMappingURL=ajaxRecord.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar _a;\r\nimport { __assign, __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { DisabledPropertyName, PropertiesPluginIdentifier, RemoteDependencyData, RequestHeaders, correlationIdCanIncludeCorrelationHeader, correlationIdGetCorrelationContext, createDistributedTraceContextFromTrace, createTelemetryItem, createTraceParent, dateTimeUtilsNow, formatTraceParent, isInternalApplicationInsightsEndpoint } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, InstrumentFunc, InstrumentProto, _throwInternal, arrForEach, createProcessTelemetryContext, createUniqueNamespace, dumpObj, eventOn, generateW3CId, getExceptionName, getGlobal, getIEVersion, getLocation, getPerformance, isFunction, isNullOrUndefined, isString, isXhrSupported, mergeEvtNamespace, onConfigChange, strPrototype, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nimport { isWebWorker, objFreeze, scheduleTimeout, strIndexOf, strSplit, strSubstr } from \"@nevware21/ts-utils\";\r\nimport { STR_PROPERTIES } from \"./InternalConstants\";\r\nimport { _DYN_ABORTED, _DYN_AJAX_DIAGNOSTICS_MES14, _DYN_AJAX_PERF_LOOKUP_DEL8, _DYN_CONTEXT, _DYN_CORE, _DYN_CORRELATION_CONTEXT, _DYN_DISABLE_AJAX_TRACKIN7, _DYN_DISABLE_FETCH_TRACKI9, _DYN_ENABLE_AJAX_ERROR_ST3, _DYN_ENABLE_AJAX_PERF_TRA4, _DYN_ENABLE_REQUEST_HEADE2, _DYN_ENABLE_RESPONSE_HEAD10, _DYN_ERROR_STATUS_TEXT, _DYN_EXCLUDE_REQUEST_FROM6, _DYN_GET_ABSOLUTE_URL, _DYN_GET_ALL_RESPONSE_HEA13, _DYN_GET_PART_APROPS, _DYN_GET_TRACE_FLAGS, _DYN_GET_TRACE_ID, _DYN_HEADERS, _DYN_HEADER_MAP, _DYN_INCLUDE_CORRELATION_0, _DYN_LENGTH, _DYN_MAX_AJAX_CALLS_PER_V5, _DYN_METHOD, _DYN_PERF_MARK, _DYN_PERF_TIMING, _DYN_REQUEST_HEADERS, _DYN_REQUEST_SENT_TIME, _DYN_REQUEST_URL, _DYN_RESPONSE_FINISHED_TI12, _DYN_RESPONSE_TEXT, _DYN_SET_REQUEST_HEADER, _DYN_SPAN_ID, _DYN_START_TIME, _DYN_STATE_CHANGE_ATTACHE11, _DYN_STATUS, _DYN_STATUS_TEXT, _DYN_TO_LOWER_CASE, _DYN_TRACE_FLAGS, _DYN_TRACE_ID, _DYN_TRACK_DEPENDENCY_DAT1, _DYN__ADD_HOOK, _DYN__CREATE_TRACK_ITEM } from \"./__DynamicConstants\";\r\nimport { ajaxRecord } from \"./ajaxRecord\";\r\n// const AJAX_MONITOR_PREFIX = \"ai.ajxmn.\";\r\nvar strDiagLog = \"diagLog\";\r\nvar AJAX_DATA_CONTAINER = \"_ajaxData\";\r\nvar STR_FETCH = \"fetch\";\r\nvar ERROR_HEADER = \"Failed to monitor XMLHttpRequest\";\r\nvar ERROR_PREFIX = \", monitoring data for this ajax call \";\r\nvar ERROR_POSTFIX = ERROR_PREFIX + \"may be incorrect.\";\r\nvar ERROR_NOT_SENT = ERROR_PREFIX + \"won't be sent.\";\r\nvar CORRELATION_HEADER_ERROR = \"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.\";\r\nvar CUSTOM_REQUEST_CONTEXT_ERROR = \"Failed to add custom defined request context as configured call back may missing a null check.\";\r\nvar FAILED_TO_CALCULATE_DURATION_ERROR = \"Failed to calculate the duration of the \";\r\n// Using a global value so that to handle same iKey with multiple app insights instances (mostly for testing)\r\nvar _markCount = 0;\r\n/** @Ignore */\r\nfunction _supportsFetch() {\r\n var _global = getGlobal();\r\n if (!_global ||\r\n isNullOrUndefined(_global.Request) ||\r\n isNullOrUndefined(_global.Request[strPrototype]) ||\r\n isNullOrUndefined(_global[STR_FETCH])) {\r\n return null;\r\n }\r\n return _global[STR_FETCH];\r\n}\r\n/**\r\n * Determines whether ajax monitoring can be enabled on this document\r\n * @returns True if Ajax monitoring is supported on this page, otherwise false\r\n * @ignore\r\n */\r\nfunction _supportsAjaxMonitoring(ajaxMonitorInstance, ajaxDataId) {\r\n var _a;\r\n var result = false;\r\n if (isXhrSupported()) {\r\n var proto = XMLHttpRequest[strPrototype];\r\n result = !isNullOrUndefined(proto) &&\r\n !isNullOrUndefined(proto.open) && // eslint-disable-line security/detect-non-literal-fs-filename -- false positive\r\n !isNullOrUndefined(proto.send) &&\r\n !isNullOrUndefined(proto.abort);\r\n }\r\n var ieVer = getIEVersion();\r\n if (ieVer && ieVer < 9) {\r\n result = false;\r\n }\r\n if (result) {\r\n // Disable if the XmlHttpRequest can't be extended or hooked\r\n try {\r\n var xhr = new XMLHttpRequest();\r\n var xhrData = {\r\n xh: [],\r\n i: (_a = {},\r\n _a[ajaxDataId] = {},\r\n _a)\r\n };\r\n xhr[AJAX_DATA_CONTAINER] = xhrData;\r\n // Check that we can update the prototype\r\n var theOpen = XMLHttpRequest[strPrototype].open;\r\n XMLHttpRequest[strPrototype].open = theOpen;\r\n }\r\n catch (e) {\r\n // We can't decorate the xhr object so disable monitoring\r\n result = false;\r\n _throwInternalCritical(ajaxMonitorInstance, 15 /* _eInternalMessageId.FailedMonitorAjaxOpen */, \"Failed to enable XMLHttpRequest monitoring, extension is not supported\", {\r\n exception: dumpObj(e)\r\n });\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Internal helper to fetch the SDK instance tracking data for this XHR request\r\n * @param xhr\r\n * @param ajaxDataId\r\n * @returns\r\n */\r\nvar _getAjaxData = function (xhr, ajaxDataId) {\r\n if (xhr && ajaxDataId && xhr[AJAX_DATA_CONTAINER]) {\r\n return (xhr[AJAX_DATA_CONTAINER].i || {})[ajaxDataId];\r\n }\r\n return null;\r\n};\r\n/**\r\n * @ignore\r\n * Internal helper to track the singleton shared tracking headers, so we can attempt to not create headers\r\n * that might cause an issue if multiple values are populated.\r\n * @param xhr - The instrumented XHR instance\r\n */\r\nvar _addSharedXhrHeaders = function (xhr, name, value) {\r\n if (xhr) {\r\n var headers = (xhr[AJAX_DATA_CONTAINER] || {}).xh;\r\n if (headers) {\r\n headers.push({\r\n n: name,\r\n v: value\r\n });\r\n }\r\n }\r\n};\r\nvar _isHeaderSet = function (xhr, name) {\r\n var isPresent = false;\r\n if (xhr) {\r\n var headers = (xhr[AJAX_DATA_CONTAINER] || {}).xh;\r\n if (headers) {\r\n arrForEach(headers, function (header) {\r\n if (header.n === name) {\r\n isPresent = true;\r\n return -1;\r\n }\r\n });\r\n }\r\n }\r\n return isPresent;\r\n};\r\n/** @Ignore */\r\nfunction _getFailedAjaxDiagnosticsMessage(xhr, ajaxDataId) {\r\n var result = \"\";\r\n try {\r\n var ajaxData = _getAjaxData(xhr, ajaxDataId);\r\n if (ajaxData && ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */]) {\r\n result += \"(url: '\" + ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */] + \"')\";\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _throwInternalCritical(ajaxMonitorInstance, msgId, message, properties, isUserAct) {\r\n _throwInternal(ajaxMonitorInstance[strDiagLog](), 1 /* eLoggingSeverity.CRITICAL */, msgId, message, properties, isUserAct);\r\n}\r\n/** @ignore */\r\nfunction _throwInternalWarning(ajaxMonitorInstance, msgId, message, properties, isUserAct) {\r\n _throwInternal(ajaxMonitorInstance[strDiagLog](), 2 /* eLoggingSeverity.WARNING */, msgId, message, properties, isUserAct);\r\n}\r\n/** @Ignore */\r\nfunction _createErrorCallbackFunc(ajaxMonitorInstance, internalMessage, message) {\r\n // tslint:disable-next-line\r\n return function (callDetails) {\r\n var _a;\r\n _throwInternalCritical(ajaxMonitorInstance, internalMessage, message, (_a = {},\r\n _a[_DYN_AJAX_DIAGNOSTICS_MES14 /* @min:ajaxDiagnosticsMessage */] = _getFailedAjaxDiagnosticsMessage(callDetails.inst, ajaxMonitorInstance._ajaxDataId),\r\n _a.exception = dumpObj(callDetails.err),\r\n _a));\r\n };\r\n}\r\nfunction _indexOf(value, match) {\r\n if (value && match) {\r\n return strIndexOf(value, match);\r\n }\r\n return -1;\r\n}\r\nfunction _addHandler(container, id, theFunc) {\r\n var theHandler = {\r\n id: id,\r\n fn: theFunc\r\n };\r\n container.push(theHandler);\r\n return {\r\n remove: function () {\r\n arrForEach(container, function (initializer, idx) {\r\n if (initializer.id === theHandler.id) {\r\n container.splice(idx, 1);\r\n return -1;\r\n }\r\n });\r\n }\r\n };\r\n}\r\nfunction _processDependencyContainer(core, container, details, message) {\r\n var result = true;\r\n arrForEach(container, function (theFunc, idx) {\r\n try {\r\n if (theFunc.fn.call(null, details) === false) {\r\n result = false;\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(core && core.logger, 1 /* eLoggingSeverity.CRITICAL */, 64 /* _eInternalMessageId.TelemetryInitializerFailed */, \"Dependency \" + message + \" [#\" + idx + \"] failed: \" + getExceptionName(e), { exception: dumpObj(e) }, true);\r\n }\r\n });\r\n return result;\r\n}\r\nfunction _processDependencyListeners(listeners, core, ajaxData, xhr, input, init) {\r\n var initializersCount = listeners[_DYN_LENGTH /* @min:%2elength */];\r\n if (initializersCount > 0) {\r\n var details = {\r\n core: core,\r\n xhr: xhr,\r\n input: input,\r\n init: init,\r\n traceId: ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */],\r\n spanId: ajaxData[_DYN_SPAN_ID /* @min:%2espanID */],\r\n traceFlags: ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */],\r\n context: ajaxData[_DYN_CONTEXT /* @min:%2econtext */] || {},\r\n aborted: !!ajaxData[_DYN_ABORTED /* @min:%2eaborted */]\r\n };\r\n _processDependencyContainer(core, listeners, details, \"listener\");\r\n ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */] = details.traceId;\r\n ajaxData[_DYN_SPAN_ID /* @min:%2espanID */] = details.spanId;\r\n ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = details[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n ajaxData[_DYN_CONTEXT /* @min:%2econtext */] = details[_DYN_CONTEXT /* @min:%2econtext */];\r\n }\r\n}\r\nvar BLOB_CORE = \"*.blob.core.\";\r\nexport var DfltAjaxCorrelationHeaderExDomains = objFreeze([\r\n BLOB_CORE + \"windows.net\",\r\n BLOB_CORE + \"chinacloudapi.cn\",\r\n BLOB_CORE + \"cloudapi.de\",\r\n BLOB_CORE + \"usgovcloudapi.net\"\r\n]);\r\nvar _internalExcludeEndpoints = [\r\n /https:\\/\\/[^\\/]*(\\.pipe\\.aria|aria\\.pipe|events\\.data|collector\\.azure)\\.[^\\/]+\\/(OneCollector\\/1|Collector\\/3)\\.0/i\r\n];\r\nvar _defaultConfig = objFreeze((_a = {},\r\n _a[_DYN_MAX_AJAX_CALLS_PER_V5 /* @min:maxAjaxCallsPerView */] = 500,\r\n _a[_DYN_DISABLE_AJAX_TRACKIN7 /* @min:disableAjaxTracking */] = false,\r\n _a[_DYN_DISABLE_FETCH_TRACKI9 /* @min:disableFetchTracking */] = false,\r\n _a[_DYN_EXCLUDE_REQUEST_FROM6 /* @min:excludeRequestFromAutoTrackingPatterns */] = undefined,\r\n _a.disableCorrelationHeaders = false,\r\n _a.distributedTracingMode = 1 /* eDistributedTracingModes.AI_AND_W3C */,\r\n _a.correlationHeaderExcludedDomains = DfltAjaxCorrelationHeaderExDomains,\r\n _a.correlationHeaderDomains = undefined,\r\n _a.correlationHeaderExcludePatterns = undefined,\r\n _a.appId = undefined,\r\n _a.enableCorsCorrelation = false,\r\n _a[_DYN_ENABLE_REQUEST_HEADE2 /* @min:enableRequestHeaderTracking */] = false,\r\n _a[_DYN_ENABLE_RESPONSE_HEAD10 /* @min:enableResponseHeaderTracking */] = false,\r\n _a[_DYN_ENABLE_AJAX_ERROR_ST3 /* @min:enableAjaxErrorStatusText */] = false,\r\n _a[_DYN_ENABLE_AJAX_PERF_TRA4 /* @min:enableAjaxPerfTracking */] = false,\r\n _a.maxAjaxPerfLookupAttempts = 3,\r\n _a[_DYN_AJAX_PERF_LOOKUP_DEL8 /* @min:ajaxPerfLookupDelay */] = 25,\r\n _a.ignoreHeaders = [\r\n \"Authorization\",\r\n \"X-API-Key\",\r\n \"WWW-Authenticate\"\r\n ],\r\n _a.addRequestContext = undefined,\r\n _a.addIntEndpoints = true,\r\n _a));\r\nvar AjaxMonitor = /** @class */ (function (_super) {\r\n __extends(AjaxMonitor, _super);\r\n function AjaxMonitor() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = AjaxMonitor.identifier;\r\n _this.priority = 120;\r\n var _fetchInitialized; // fetch monitoring initialized\r\n var _xhrInitialized; // XHR monitoring initialized\r\n var _currentWindowHost;\r\n var _extensionConfig;\r\n var _enableRequestHeaderTracking;\r\n var _enableAjaxErrorStatusText;\r\n var _trackAjaxAttempts;\r\n var _context;\r\n var _isUsingW3CHeaders;\r\n var _isUsingAIHeaders;\r\n var _markPrefix;\r\n var _enableAjaxPerfTracking;\r\n var _maxAjaxCallsPerView;\r\n var _enableResponseHeaderTracking;\r\n var _disabledUrls;\r\n var _disableAjaxTracking;\r\n var _disableFetchTracking;\r\n var _excludeRequestFromAutoTrackingPatterns;\r\n var _addRequestContext;\r\n var _evtNamespace;\r\n var _ajaxDataId;\r\n var _dependencyHandlerId;\r\n var _dependencyListeners;\r\n var _dependencyInitializers;\r\n var _ignoreHeaders;\r\n var _maxAjaxPerfLookupAttempts;\r\n var _ajaxPerfLookupDelay;\r\n var _distributedTracingMode;\r\n var _appId;\r\n var _polyfillInitialized;\r\n dynamicProto(AjaxMonitor, _this, function (_self, _base) {\r\n var _addHook = _base[_DYN__ADD_HOOK /* @min:%2e_addHook */];\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n if (!_self.isInitialized()) {\r\n _base.initialize(config, core, extensions, pluginChain);\r\n _evtNamespace = mergeEvtNamespace(createUniqueNamespace(\"ajax\"), core && core.evtNamespace && core.evtNamespace());\r\n _populateDefaults(config);\r\n _instrumentXhr();\r\n _instrumentFetch();\r\n _populateContext();\r\n }\r\n };\r\n _self._doTeardown = function () {\r\n _initDefaults();\r\n };\r\n _self.trackDependencyData = function (dependency, properties) {\r\n _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE /* @min:%2ecore */], null, dependency, properties);\r\n };\r\n _self[_DYN_INCLUDE_CORRELATION_0 /* @min:%2eincludeCorrelationHeaders */] = function (ajaxData, input, init, xhr) {\r\n // Test Hook to allow the overriding of the location host\r\n var currentWindowHost = _self[\"_currentWindowHost\"] || _currentWindowHost;\r\n _processDependencyListeners(_dependencyListeners, _self[_DYN_CORE /* @min:%2ecore */], ajaxData, xhr, input, init);\r\n if (input || input === \"\") { // Fetch\r\n if (correlationIdCanIncludeCorrelationHeader(_extensionConfig, ajaxData[_DYN_GET_ABSOLUTE_URL /* @min:%2egetAbsoluteUrl */](), currentWindowHost)) {\r\n if (!init) {\r\n init = {};\r\n }\r\n // init headers override original request headers\r\n // so, if they exist use only them, otherwise use request's because they should have been applied in the first place\r\n // not using original request headers will result in them being lost\r\n var headers = new Headers(init[_DYN_HEADERS /* @min:%2eheaders */] || (input instanceof Request ? (input[_DYN_HEADERS /* @min:%2eheaders */] || {}) : {}));\r\n if (_isUsingAIHeaders) {\r\n var id = \"|\" + ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */] + \".\" + ajaxData[_DYN_SPAN_ID /* @min:%2espanID */];\r\n headers.set(RequestHeaders[3 /* eRequestHeaders.requestIdHeader */], id);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[3 /* eRequestHeaders.requestIdHeader */]] = id;\r\n }\r\n }\r\n var appId = _appId || (_context && _context.appId());\r\n if (appId) {\r\n headers.set(RequestHeaders[0 /* eRequestHeaders.requestContextHeader */], RequestHeaders[2 /* eRequestHeaders.requestContextAppIdFormat */] + appId);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[0 /* eRequestHeaders.requestContextHeader */]] = RequestHeaders[2 /* eRequestHeaders.requestContextAppIdFormat */] + appId;\r\n }\r\n }\r\n if (_isUsingW3CHeaders) {\r\n var traceFlags = ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n if (isNullOrUndefined(traceFlags)) {\r\n traceFlags = 0x01;\r\n }\r\n var traceParent = formatTraceParent(createTraceParent(ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */], ajaxData[_DYN_SPAN_ID /* @min:%2espanID */], traceFlags));\r\n headers.set(RequestHeaders[4 /* eRequestHeaders.traceParentHeader */], traceParent);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[4 /* eRequestHeaders.traceParentHeader */]] = traceParent;\r\n }\r\n }\r\n init[_DYN_HEADERS /* @min:%2eheaders */] = headers;\r\n }\r\n return init;\r\n }\r\n else if (xhr) { // XHR\r\n if (correlationIdCanIncludeCorrelationHeader(_extensionConfig, ajaxData[_DYN_GET_ABSOLUTE_URL /* @min:%2egetAbsoluteUrl */](), currentWindowHost)) {\r\n if (_isUsingAIHeaders) {\r\n if (!_isHeaderSet(xhr, RequestHeaders[3 /* eRequestHeaders.requestIdHeader */])) {\r\n var id = \"|\" + ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */] + \".\" + ajaxData[_DYN_SPAN_ID /* @min:%2espanID */];\r\n xhr[_DYN_SET_REQUEST_HEADER /* @min:%2esetRequestHeader */](RequestHeaders[3 /* eRequestHeaders.requestIdHeader */], id);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[3 /* eRequestHeaders.requestIdHeader */]] = id;\r\n }\r\n }\r\n else {\r\n _throwInternalWarning(_self, 71 /* _eInternalMessageId.FailedMonitorAjaxSetRequestHeader */, \"Unable to set [\" + RequestHeaders[3 /* eRequestHeaders.requestIdHeader */] + \"] as it has already been set by another instance\");\r\n }\r\n }\r\n var appId = _appId || (_context && _context.appId());\r\n if (appId) {\r\n if (!_isHeaderSet(xhr, RequestHeaders[0 /* eRequestHeaders.requestContextHeader */])) {\r\n xhr[_DYN_SET_REQUEST_HEADER /* @min:%2esetRequestHeader */](RequestHeaders[0 /* eRequestHeaders.requestContextHeader */], RequestHeaders[2 /* eRequestHeaders.requestContextAppIdFormat */] + appId);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[0 /* eRequestHeaders.requestContextHeader */]] = RequestHeaders[2 /* eRequestHeaders.requestContextAppIdFormat */] + appId;\r\n }\r\n }\r\n else {\r\n _throwInternalWarning(_self, 71 /* _eInternalMessageId.FailedMonitorAjaxSetRequestHeader */, \"Unable to set [\" + RequestHeaders[0 /* eRequestHeaders.requestContextHeader */] + \"] as it has already been set by another instance\");\r\n }\r\n }\r\n if (_isUsingW3CHeaders) {\r\n var traceFlags = ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n if (isNullOrUndefined(traceFlags)) {\r\n traceFlags = 0x01;\r\n }\r\n if (!_isHeaderSet(xhr, RequestHeaders[4 /* eRequestHeaders.traceParentHeader */])) {\r\n var traceParent = formatTraceParent(createTraceParent(ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */], ajaxData[_DYN_SPAN_ID /* @min:%2espanID */], traceFlags));\r\n xhr[_DYN_SET_REQUEST_HEADER /* @min:%2esetRequestHeader */](RequestHeaders[4 /* eRequestHeaders.traceParentHeader */], traceParent);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][RequestHeaders[4 /* eRequestHeaders.traceParentHeader */]] = traceParent;\r\n }\r\n }\r\n else {\r\n _throwInternalWarning(_self, 71 /* _eInternalMessageId.FailedMonitorAjaxSetRequestHeader */, \"Unable to set [\" + RequestHeaders[4 /* eRequestHeaders.traceParentHeader */] + \"] as it has already been set by another instance\");\r\n }\r\n }\r\n }\r\n return xhr;\r\n }\r\n return undefined;\r\n };\r\n _self[_DYN_TRACK_DEPENDENCY_DAT1 /* @min:%2etrackDependencyDataInternal */] = function (dependency, properties, systemProperties) {\r\n if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) {\r\n // Hack since expected format in w3c mode is |abc.def.\r\n // Non-w3c format is |abc.def\r\n // @todo Remove if better solution is available, e.g. handle in portal\r\n if ((_distributedTracingMode === 2 /* eDistributedTracingModes.W3C */\r\n || _distributedTracingMode === 1 /* eDistributedTracingModes.AI_AND_W3C */)\r\n && typeof dependency.id === \"string\" && dependency.id[dependency.id[_DYN_LENGTH /* @min:%2elength */] - 1] !== \".\") {\r\n dependency.id += \".\";\r\n }\r\n if (isNullOrUndefined(dependency[_DYN_START_TIME /* @min:%2estartTime */])) {\r\n dependency[_DYN_START_TIME /* @min:%2estartTime */] = new Date();\r\n }\r\n var item = createTelemetryItem(dependency, RemoteDependencyData.dataType, RemoteDependencyData.envelopeType, _self[strDiagLog](), properties, systemProperties);\r\n _self[_DYN_CORE /* @min:%2ecore */].track(item);\r\n }\r\n else if (_trackAjaxAttempts === _maxAjaxCallsPerView) {\r\n _throwInternalCritical(_self, 55 /* _eInternalMessageId.MaxAjaxPerPVExceeded */, \"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.\", true);\r\n }\r\n ++_trackAjaxAttempts;\r\n };\r\n _self.addDependencyListener = function (dependencyListener) {\r\n return _addHandler(_dependencyListeners, _dependencyHandlerId++, dependencyListener);\r\n };\r\n _self.addDependencyInitializer = function (dependencyInitializer) {\r\n return _addHandler(_dependencyInitializers, _dependencyHandlerId++, dependencyInitializer);\r\n };\r\n function _initDefaults() {\r\n var location = getLocation();\r\n _fetchInitialized = false; // fetch monitoring initialized\r\n _xhrInitialized = false; // XHR monitoring initialized\r\n _polyfillInitialized = false; // polyfill monitoring initialized\r\n _currentWindowHost = location && location.host && location.host[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n _extensionConfig = null;\r\n _enableRequestHeaderTracking = false;\r\n _enableAjaxErrorStatusText = false;\r\n _trackAjaxAttempts = 0;\r\n _context = null;\r\n _isUsingW3CHeaders = false;\r\n _isUsingAIHeaders = false;\r\n _markPrefix = null;\r\n _enableAjaxPerfTracking = false;\r\n _maxAjaxCallsPerView = 0;\r\n _enableResponseHeaderTracking = false;\r\n _disabledUrls = {};\r\n _disableAjaxTracking = false;\r\n _disableFetchTracking = false;\r\n _excludeRequestFromAutoTrackingPatterns = null;\r\n _addRequestContext = null;\r\n _evtNamespace = null;\r\n _dependencyHandlerId = 0;\r\n _dependencyListeners = [];\r\n _dependencyInitializers = [];\r\n _ajaxDataId = createUniqueNamespace(\"ajaxData\");\r\n _self._ajaxDataId = _ajaxDataId;\r\n _ignoreHeaders = null;\r\n _maxAjaxPerfLookupAttempts = 1;\r\n _ajaxPerfLookupDelay = 1;\r\n _distributedTracingMode = 1 /* eDistributedTracingModes.AI_AND_W3C */;\r\n _appId = null;\r\n }\r\n function _populateDefaults(config) {\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(config, function (details) {\r\n var config = details.cfg;\r\n var ctx = createProcessTelemetryContext(null, config, _self[_DYN_CORE /* @min:%2ecore */]);\r\n _extensionConfig = ctx.getExtCfg(AjaxMonitor.identifier, _defaultConfig);\r\n _distributedTracingMode = _extensionConfig.distributedTracingMode;\r\n _enableRequestHeaderTracking = _extensionConfig[_DYN_ENABLE_REQUEST_HEADE2 /* @min:%2eenableRequestHeaderTracking */];\r\n _enableAjaxErrorStatusText = _extensionConfig[_DYN_ENABLE_AJAX_ERROR_ST3 /* @min:%2eenableAjaxErrorStatusText */];\r\n _enableAjaxPerfTracking = _extensionConfig[_DYN_ENABLE_AJAX_PERF_TRA4 /* @min:%2eenableAjaxPerfTracking */];\r\n _maxAjaxCallsPerView = _extensionConfig[_DYN_MAX_AJAX_CALLS_PER_V5 /* @min:%2emaxAjaxCallsPerView */];\r\n _excludeRequestFromAutoTrackingPatterns = [].concat(_extensionConfig[_DYN_EXCLUDE_REQUEST_FROM6 /* @min:%2eexcludeRequestFromAutoTrackingPatterns */] || [], _extensionConfig.addIntEndpoints !== false ? _internalExcludeEndpoints : []);\r\n _addRequestContext = _extensionConfig.addRequestContext;\r\n _isUsingAIHeaders = _distributedTracingMode === 0 /* eDistributedTracingModes.AI */ || _distributedTracingMode === 1 /* eDistributedTracingModes.AI_AND_W3C */;\r\n _isUsingW3CHeaders = _distributedTracingMode === 1 /* eDistributedTracingModes.AI_AND_W3C */ || _distributedTracingMode === 2 /* eDistributedTracingModes.W3C */;\r\n if (_enableAjaxPerfTracking) {\r\n _markPrefix = _ajaxDataId;\r\n }\r\n _disableAjaxTracking = !!_extensionConfig[_DYN_DISABLE_AJAX_TRACKIN7 /* @min:%2edisableAjaxTracking */];\r\n _maxAjaxPerfLookupAttempts = _extensionConfig.maxAjaxPerfLookupAttempts;\r\n _ajaxPerfLookupDelay = _extensionConfig[_DYN_AJAX_PERF_LOOKUP_DEL8 /* @min:%2eajaxPerfLookupDelay */];\r\n _ignoreHeaders = _extensionConfig.ignoreHeaders;\r\n _appId = _extensionConfig.appId;\r\n }));\r\n }\r\n function _populateContext() {\r\n var propExt = _self[_DYN_CORE /* @min:%2ecore */].getPlugin(PropertiesPluginIdentifier);\r\n if (propExt) {\r\n _context = propExt.plugin[_DYN_CONTEXT /* @min:%2econtext */]; // we could move IPropertiesPlugin to common as well\r\n }\r\n }\r\n // discard the header if it's defined as ignoreHeaders in ICorrelationConfig\r\n function _canIncludeHeaders(header) {\r\n var rlt = true;\r\n if (header || _ignoreHeaders) {\r\n arrForEach(_ignoreHeaders, (function (key) {\r\n if (key[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() === header[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]()) {\r\n rlt = false;\r\n return -1;\r\n }\r\n }));\r\n }\r\n return rlt;\r\n }\r\n // Fetch Stuff\r\n function _instrumentFetch() {\r\n var fetch = _supportsFetch();\r\n if (!fetch) {\r\n return;\r\n }\r\n var global = getGlobal();\r\n var isPolyfill = fetch.polyfill;\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(_extensionConfig, function () {\r\n _disableFetchTracking = !!_extensionConfig[_DYN_DISABLE_FETCH_TRACKI9 /* @min:%2edisableFetchTracking */];\r\n _enableResponseHeaderTracking = _extensionConfig[_DYN_ENABLE_RESPONSE_HEAD10 /* @min:%2eenableResponseHeaderTracking */];\r\n if (!_disableFetchTracking && !_fetchInitialized) {\r\n _addHook(InstrumentFunc(global, STR_FETCH, {\r\n ns: _evtNamespace,\r\n // Add request hook\r\n req: function (callDetails, input, init) {\r\n var fetchData;\r\n if (!_disableFetchTracking && _fetchInitialized &&\r\n !_isDisabledRequest(null, input, init) &&\r\n // If we have a polyfil and XHR instrumented then let XHR report otherwise we get duplicates\r\n !(isPolyfill && _xhrInitialized)) {\r\n var ctx = callDetails.ctx();\r\n fetchData = _createFetchRecord(input, init);\r\n var newInit = _self[_DYN_INCLUDE_CORRELATION_0 /* @min:%2eincludeCorrelationHeaders */](fetchData, input, init);\r\n if (newInit !== init) {\r\n callDetails.set(1, newInit);\r\n }\r\n ctx.data = fetchData;\r\n }\r\n },\r\n rsp: function (callDetails, input) {\r\n if (!_disableFetchTracking) {\r\n var fetchData_1 = callDetails.ctx().data;\r\n if (fetchData_1) {\r\n // Replace the result with the new promise from this code\r\n callDetails.rslt = callDetails.rslt.then(function (response) {\r\n _reportFetchMetrics(callDetails, (response || {})[_DYN_STATUS /* @min:%2estatus */], input, response, fetchData_1, function () {\r\n var _a;\r\n var ajaxResponse = (_a = {\r\n statusText: (response || {})[_DYN_STATUS_TEXT /* @min:%2estatusText */],\r\n headerMap: null\r\n },\r\n _a[_DYN_CORRELATION_CONTEXT /* @min:correlationContext */] = _getFetchCorrelationContext(response),\r\n _a);\r\n if (_enableResponseHeaderTracking && response) {\r\n var responseHeaderMap_1 = {};\r\n response.headers.forEach(function (value, name) {\r\n if (_canIncludeHeaders(name)) {\r\n responseHeaderMap_1[name] = value;\r\n }\r\n });\r\n ajaxResponse[_DYN_HEADER_MAP /* @min:%2eheaderMap */] = responseHeaderMap_1;\r\n }\r\n return ajaxResponse;\r\n });\r\n return response;\r\n })\r\n .catch(function (reason) {\r\n _reportFetchMetrics(callDetails, 0, input, null, fetchData_1, null, { error: reason.message || dumpObj(reason) });\r\n throw reason;\r\n });\r\n }\r\n }\r\n },\r\n // Create an error callback to report any hook errors\r\n hkErr: _createErrorCallbackFunc(_self, 15 /* _eInternalMessageId.FailedMonitorAjaxOpen */, \"Failed to monitor Window.fetch\" + ERROR_POSTFIX)\r\n }, true, isWebWorker()));\r\n _fetchInitialized = true;\r\n }\r\n else if (isPolyfill && !_polyfillInitialized) {\r\n // If fetch is a polyfill we need to capture the request to ensure that we correctly track\r\n // disabled request URLS (i.e. internal urls) to ensure we don't end up in a constant loop\r\n // of reporting ourselves, for example React Native uses a polyfill for fetch\r\n // Note: Polyfill implementations that don't support the \"polyfill\" tag are not supported\r\n // the workaround is to add a polyfill property to your fetch implementation before initializing\r\n // App Insights\r\n _addHook(InstrumentFunc(global, STR_FETCH, {\r\n ns: _evtNamespace,\r\n req: function (callDetails, input, init) {\r\n // Just call so that we record any disabled URL\r\n _isDisabledRequest(null, input, init);\r\n }\r\n }));\r\n _polyfillInitialized = true;\r\n }\r\n }));\r\n if (isPolyfill) {\r\n // retag the instrumented fetch with the same polyfill settings this is mostly for testing\r\n // But also supports multiple App Insights usages\r\n global[STR_FETCH].polyfill = isPolyfill;\r\n }\r\n }\r\n function _hookProto(target, funcName, callbacks) {\r\n _addHook(InstrumentProto(target, funcName, callbacks));\r\n }\r\n function _instrumentXhr() {\r\n if (!_supportsAjaxMonitoring(_self, _ajaxDataId)) {\r\n return;\r\n }\r\n _self[_DYN__ADD_HOOK /* @min:%2e_addHook */](onConfigChange(_extensionConfig, function () {\r\n _disableAjaxTracking = !!_extensionConfig[_DYN_DISABLE_AJAX_TRACKIN7 /* @min:%2edisableAjaxTracking */];\r\n _enableRequestHeaderTracking = _extensionConfig[_DYN_ENABLE_REQUEST_HEADE2 /* @min:%2eenableRequestHeaderTracking */];\r\n if (!_disableAjaxTracking && !_xhrInitialized) {\r\n // Instrument open\r\n _hookProto(XMLHttpRequest, \"open\", {\r\n ns: _evtNamespace,\r\n req: function (callDetails, method, url, async) {\r\n if (!_disableAjaxTracking) {\r\n var xhr = callDetails.inst;\r\n var ajaxData = _getAjaxData(xhr, _ajaxDataId);\r\n if (!_isDisabledRequest(xhr, url) && _isMonitoredXhrInstance(xhr, ajaxData, true)) {\r\n if (!ajaxData || !ajaxData.xhrMonitoringState.openDone) {\r\n // Only create a single ajaxData (even when multiple AI instances are running)\r\n ajaxData = _openHandler(xhr, method, url, async);\r\n }\r\n // always attach to the on ready state change (required for handling multiple instances)\r\n _attachToOnReadyStateChange(xhr, ajaxData);\r\n }\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, 15 /* _eInternalMessageId.FailedMonitorAjaxOpen */, ERROR_HEADER + \".open\" + ERROR_POSTFIX)\r\n });\r\n // Instrument send\r\n _hookProto(XMLHttpRequest, \"send\", {\r\n ns: _evtNamespace,\r\n req: function (callDetails, context) {\r\n if (!_disableAjaxTracking) {\r\n var xhr = callDetails.inst;\r\n var ajaxData = _getAjaxData(xhr, _ajaxDataId);\r\n if (_isMonitoredXhrInstance(xhr, ajaxData) && !ajaxData.xhrMonitoringState.sendDone) {\r\n _createMarkId(\"xhr\", ajaxData);\r\n ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */] = dateTimeUtilsNow();\r\n _self[_DYN_INCLUDE_CORRELATION_0 /* @min:%2eincludeCorrelationHeaders */](ajaxData, undefined, undefined, xhr);\r\n ajaxData.xhrMonitoringState.sendDone = true;\r\n }\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, 17 /* _eInternalMessageId.FailedMonitorAjaxSend */, ERROR_HEADER + ERROR_POSTFIX)\r\n });\r\n // Instrument abort\r\n _hookProto(XMLHttpRequest, \"abort\", {\r\n ns: _evtNamespace,\r\n req: function (callDetails) {\r\n if (!_disableAjaxTracking) {\r\n var xhr = callDetails.inst;\r\n var ajaxData = _getAjaxData(xhr, _ajaxDataId);\r\n if (_isMonitoredXhrInstance(xhr, ajaxData) && !ajaxData.xhrMonitoringState.abortDone) {\r\n ajaxData[_DYN_ABORTED /* @min:%2eaborted */] = 1;\r\n ajaxData.xhrMonitoringState.abortDone = true;\r\n }\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, 13 /* _eInternalMessageId.FailedMonitorAjaxAbort */, ERROR_HEADER + \".abort\" + ERROR_POSTFIX)\r\n });\r\n // Instrument setRequestHeader\r\n _hookProto(XMLHttpRequest, \"setRequestHeader\", {\r\n ns: _evtNamespace,\r\n req: function (callDetails, header, value) {\r\n if (!_disableAjaxTracking) {\r\n var xhr = callDetails.inst;\r\n var ajaxData = _getAjaxData(xhr, _ajaxDataId);\r\n if (ajaxData && _isMonitoredXhrInstance(xhr, ajaxData)) {\r\n _addSharedXhrHeaders(xhr, header, value);\r\n if (_enableRequestHeaderTracking && _canIncludeHeaders(header)) {\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */][header] = value;\r\n }\r\n }\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, 71 /* _eInternalMessageId.FailedMonitorAjaxSetRequestHeader */, ERROR_HEADER + \".setRequestHeader\" + ERROR_POSTFIX)\r\n });\r\n _xhrInitialized = true;\r\n }\r\n }));\r\n }\r\n function _isDisabledRequest(xhr, request, init) {\r\n var isDisabled = false;\r\n var theUrl = ((!isString(request) ? (request || {}).url || \"\" : request) || \"\")[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n // check excludeRequestFromAutoTrackingPatterns before stripping off any query string\r\n arrForEach(_excludeRequestFromAutoTrackingPatterns, function (regex) {\r\n var theRegex = regex;\r\n if (isString(regex)) {\r\n theRegex = new RegExp(regex);\r\n }\r\n if (!isDisabled) {\r\n isDisabled = theRegex.test(theUrl);\r\n }\r\n });\r\n // if request url matches with exclude regex pattern, return true and no need to check for headers\r\n if (isDisabled) {\r\n return isDisabled;\r\n }\r\n var idx = _indexOf(theUrl, \"?\");\r\n var idx2 = _indexOf(theUrl, \"#\");\r\n if (idx === -1 || (idx2 !== -1 && idx2 < idx)) {\r\n idx = idx2;\r\n }\r\n if (idx !== -1) {\r\n // Strip off any Query string\r\n theUrl = theUrl.substring(0, idx);\r\n }\r\n // check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector\r\n if (!isNullOrUndefined(xhr)) {\r\n // Look on the XMLHttpRequest of the URL string value\r\n isDisabled = xhr[DisabledPropertyName] === true || theUrl[DisabledPropertyName] === true;\r\n }\r\n else if (!isNullOrUndefined(request)) { // fetch\r\n // Look for DisabledPropertyName in either Request or RequestInit\r\n isDisabled = (typeof request === \"object\" ? request[DisabledPropertyName] === true : false) ||\r\n (init ? init[DisabledPropertyName] === true : false);\r\n }\r\n // Also add extra check just in case the XHR or fetch objects where not decorated with the DisableProperty due to sealing or freezing\r\n if (!isDisabled && theUrl && isInternalApplicationInsightsEndpoint(theUrl)) {\r\n isDisabled = true;\r\n }\r\n if (isDisabled) {\r\n // Add the disabled url if not present\r\n if (!_disabledUrls[theUrl]) {\r\n _disabledUrls[theUrl] = 1;\r\n }\r\n }\r\n else {\r\n // Check to see if the url is listed as disabled\r\n if (_disabledUrls[theUrl]) {\r\n isDisabled = true;\r\n }\r\n }\r\n return isDisabled;\r\n }\r\n /// Verifies that particular instance of XMLHttpRequest needs to be monitored\r\n /// Optional parameter. True if ajaxData must be excluded from verification\r\n /// True if instance needs to be monitored, otherwise false\r\n function _isMonitoredXhrInstance(xhr, ajaxData, excludeAjaxDataValidation) {\r\n var ajaxValidation = true;\r\n var initialized = _xhrInitialized;\r\n if (!isNullOrUndefined(xhr)) {\r\n ajaxValidation = excludeAjaxDataValidation === true || !isNullOrUndefined(ajaxData);\r\n }\r\n // checking to see that all interested functions on xhr were instrumented\r\n return initialized\r\n // checking on ajaxData to see that it was not removed in user code\r\n && ajaxValidation;\r\n }\r\n function _getDistributedTraceCtx() {\r\n var distributedTraceCtx = null;\r\n if (_self[_DYN_CORE /* @min:%2ecore */] && _self[_DYN_CORE /* @min:%2ecore */].getTraceCtx) {\r\n distributedTraceCtx = _self[_DYN_CORE /* @min:%2ecore */].getTraceCtx(false);\r\n }\r\n // Fall back\r\n if (!distributedTraceCtx && _context && _context.telemetryTrace) {\r\n distributedTraceCtx = createDistributedTraceContextFromTrace(_context.telemetryTrace);\r\n }\r\n return distributedTraceCtx;\r\n }\r\n function _openHandler(xhr, method, url, async) {\r\n var _a;\r\n var distributedTraceCtx = _getDistributedTraceCtx();\r\n var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID /* @min:%2egetTraceId */]()) || generateW3CId();\r\n var spanID = strSubstr(generateW3CId(), 0, 16);\r\n var xhrRequestData = xhr[AJAX_DATA_CONTAINER] = (xhr[AJAX_DATA_CONTAINER] || { xh: [], i: {} });\r\n var ajaxDataCntr = xhrRequestData.i = (xhrRequestData.i || {});\r\n var ajaxData = ajaxDataCntr[_ajaxDataId] = (ajaxDataCntr[_ajaxDataId] || new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx()));\r\n ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS /* @min:%2egetTraceFlags */]();\r\n ajaxData[_DYN_METHOD /* @min:%2emethod */] = method;\r\n ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */] = url;\r\n ajaxData.xhrMonitoringState.openDone = true;\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */] = {};\r\n ajaxData.async = async;\r\n ajaxData[_DYN_ERROR_STATUS_TEXT /* @min:%2eerrorStatusText */] = _enableAjaxErrorStatusText;\r\n return ajaxData;\r\n }\r\n function _attachToOnReadyStateChange(xhr, ajaxData) {\r\n ajaxData.xhrMonitoringState[_DYN_STATE_CHANGE_ATTACHE11 /* @min:%2estateChangeAttached */] = eventOn(xhr, \"readystatechange\", function () {\r\n var _a;\r\n try {\r\n if (xhr && xhr.readyState === 4 && _isMonitoredXhrInstance(xhr, ajaxData)) {\r\n _onAjaxComplete(xhr);\r\n }\r\n }\r\n catch (e) {\r\n var exceptionText = dumpObj(e);\r\n // ignore messages with c00c023f, as this a known IE9 XHR abort issue\r\n if (!exceptionText || _indexOf(exceptionText[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](), \"c00c023f\") === -1) {\r\n _throwInternalCritical(_self, 16 /* _eInternalMessageId.FailedMonitorAjaxRSC */, ERROR_HEADER + \" 'readystatechange' event handler\" + ERROR_POSTFIX, (_a = {},\r\n _a[_DYN_AJAX_DIAGNOSTICS_MES14 /* @min:ajaxDiagnosticsMessage */] = _getFailedAjaxDiagnosticsMessage(xhr, _ajaxDataId),\r\n _a.exception = exceptionText,\r\n _a));\r\n }\r\n }\r\n }, _evtNamespace);\r\n }\r\n function _getResponseText(xhr) {\r\n try {\r\n var responseType = xhr.responseType;\r\n if (responseType === \"\" || responseType === \"text\") {\r\n // As per the specification responseText is only valid if the type is an empty string or \"text\"\r\n return xhr[_DYN_RESPONSE_TEXT /* @min:%2eresponseText */];\r\n }\r\n }\r\n catch (e) {\r\n // This shouldn't happen because of the above check -- but just in case, so just ignore\r\n }\r\n return null;\r\n }\r\n function _onAjaxComplete(xhr) {\r\n var ajaxData = _getAjaxData(xhr, _ajaxDataId);\r\n ajaxData[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */] = dateTimeUtilsNow();\r\n ajaxData[_DYN_STATUS /* @min:%2estatus */] = xhr[_DYN_STATUS /* @min:%2estatus */];\r\n function _reportXhrError(e, failedProps) {\r\n var errorProps = failedProps || {};\r\n errorProps[\"ajaxDiagnosticsMessage\"] = _getFailedAjaxDiagnosticsMessage(xhr, _ajaxDataId);\r\n if (e) {\r\n errorProps[\"exception\"] = dumpObj(e);\r\n }\r\n _throwInternalWarning(_self, 14 /* _eInternalMessageId.FailedMonitorAjaxDur */, FAILED_TO_CALCULATE_DURATION_ERROR + \"ajax call\" + ERROR_NOT_SENT, errorProps);\r\n }\r\n _findPerfResourceEntry(\"xmlhttprequest\", ajaxData, function () {\r\n try {\r\n var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM /* @min:%2eCreateTrackItem */](\"Ajax\", _enableRequestHeaderTracking, function () {\r\n var _a;\r\n var ajaxResponse = (_a = {\r\n statusText: xhr[_DYN_STATUS_TEXT /* @min:%2estatusText */],\r\n headerMap: null\r\n },\r\n _a[_DYN_CORRELATION_CONTEXT /* @min:correlationContext */] = _getAjaxCorrelationContext(xhr),\r\n _a.type = xhr.responseType,\r\n _a[_DYN_RESPONSE_TEXT /* @min:responseText */] = _getResponseText(xhr),\r\n _a.response = xhr.response,\r\n _a);\r\n if (_enableResponseHeaderTracking) {\r\n var headers = xhr[_DYN_GET_ALL_RESPONSE_HEA13 /* @min:%2egetAllResponseHeaders */]();\r\n if (headers) {\r\n // xhr.getAllResponseHeaders() method returns all the response headers, separated by CRLF, as a string or null\r\n // the regex converts the header string into an array of individual headers\r\n var arr = strTrim(headers).split(/[\\r\\n]+/);\r\n var responseHeaderMap_2 = {};\r\n arrForEach(arr, function (line) {\r\n var parts = line.split(\": \");\r\n var header = parts.shift();\r\n var value = parts.join(\": \");\r\n if (_canIncludeHeaders(header)) {\r\n responseHeaderMap_2[header] = value;\r\n }\r\n });\r\n ajaxResponse[_DYN_HEADER_MAP /* @min:%2eheaderMap */] = responseHeaderMap_2;\r\n }\r\n }\r\n return ajaxResponse;\r\n });\r\n var properties = void 0;\r\n try {\r\n if (!!_addRequestContext) {\r\n properties = _addRequestContext({ status: xhr[_DYN_STATUS /* @min:%2estatus */], xhr: xhr });\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, 104 /* _eInternalMessageId.FailedAddingCustomDefinedRequestContext */, CUSTOM_REQUEST_CONTEXT_ERROR);\r\n }\r\n if (dependency) {\r\n if (properties !== undefined) {\r\n dependency[STR_PROPERTIES /* @min:%2eproperties */] = __assign(__assign({}, dependency.properties), properties);\r\n }\r\n var sysProperties = ajaxData[_DYN_GET_PART_APROPS /* @min:%2egetPartAProps */]();\r\n _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE /* @min:%2ecore */], ajaxData, dependency, null, sysProperties);\r\n }\r\n else {\r\n _reportXhrError(null, {\r\n requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */],\r\n responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */]\r\n });\r\n }\r\n }\r\n finally {\r\n // cleanup telemetry data\r\n try {\r\n var xhrRequestData = (xhr[AJAX_DATA_CONTAINER] || { i: {} });\r\n var ajaxDataCntr = (xhrRequestData.i || {});\r\n if (ajaxDataCntr[_ajaxDataId]) {\r\n ajaxDataCntr[_ajaxDataId] = null;\r\n }\r\n }\r\n catch (e) {\r\n // May throw in environments that prevent extension or freeze xhr\r\n }\r\n }\r\n }, function (e) {\r\n _reportXhrError(e, null);\r\n });\r\n }\r\n function _getAjaxCorrelationContext(xhr) {\r\n var _a;\r\n try {\r\n var responseHeadersString = xhr[_DYN_GET_ALL_RESPONSE_HEA13 /* @min:%2egetAllResponseHeaders */]();\r\n if (responseHeadersString !== null) {\r\n var index = _indexOf(responseHeadersString[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](), RequestHeaders[8 /* eRequestHeaders.requestContextHeaderLowerCase */]);\r\n if (index !== -1) {\r\n var responseHeader = xhr.getResponseHeader(RequestHeaders[0 /* eRequestHeaders.requestContextHeader */]);\r\n return correlationIdGetCorrelationContext(responseHeader);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, 18 /* _eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader */, CORRELATION_HEADER_ERROR, (_a = {},\r\n _a[_DYN_AJAX_DIAGNOSTICS_MES14 /* @min:ajaxDiagnosticsMessage */] = _getFailedAjaxDiagnosticsMessage(xhr, _ajaxDataId),\r\n _a.exception = dumpObj(e),\r\n _a));\r\n }\r\n }\r\n function _createMarkId(type, ajaxData) {\r\n if (ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */] && _markPrefix && _enableAjaxPerfTracking) {\r\n var performance_1 = getPerformance();\r\n if (performance_1 && isFunction(performance_1.mark)) {\r\n _markCount++;\r\n var markId = _markPrefix + type + \"#\" + _markCount;\r\n performance_1.mark(markId);\r\n var entries = performance_1.getEntriesByName(markId);\r\n if (entries && entries[_DYN_LENGTH /* @min:%2elength */] === 1) {\r\n ajaxData[_DYN_PERF_MARK /* @min:%2eperfMark */] = entries[0];\r\n }\r\n }\r\n }\r\n }\r\n function _findPerfResourceEntry(initiatorType, ajaxData, trackCallback, reportError) {\r\n var perfMark = ajaxData[_DYN_PERF_MARK /* @min:%2eperfMark */];\r\n var performance = getPerformance();\r\n var maxAttempts = _maxAjaxPerfLookupAttempts;\r\n var retryDelay = _ajaxPerfLookupDelay;\r\n var requestUrl = ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */];\r\n var attempt = 0;\r\n (function locateResourceTiming() {\r\n try {\r\n if (performance && perfMark) {\r\n attempt++;\r\n var perfTiming = null;\r\n var entries = performance.getEntries();\r\n for (var lp = entries[_DYN_LENGTH /* @min:%2elength */] - 1; lp >= 0; lp--) {\r\n var entry = entries[lp];\r\n if (entry) {\r\n if (entry.entryType === \"resource\") {\r\n if (entry.initiatorType === initiatorType &&\r\n (_indexOf(entry.name, requestUrl) !== -1 || _indexOf(requestUrl, entry.name) !== -1)) {\r\n perfTiming = entry;\r\n }\r\n }\r\n else if (entry.entryType === \"mark\" && entry.name === perfMark.name) {\r\n // We hit the start event\r\n ajaxData[_DYN_PERF_TIMING /* @min:%2eperfTiming */] = perfTiming;\r\n break;\r\n }\r\n if (entry[_DYN_START_TIME /* @min:%2estartTime */] < perfMark[_DYN_START_TIME /* @min:%2estartTime */] - 1000) {\r\n // Fallback to try and reduce the time spent looking for the perf entry\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!perfMark || // - we don't have a perfMark or\r\n ajaxData[_DYN_PERF_TIMING /* @min:%2eperfTiming */] || // - we have not found the perf entry or\r\n attempt >= maxAttempts || // - we have tried too many attempts or\r\n ajaxData.async === false) { // - this is a sync request\r\n if (perfMark && isFunction(performance.clearMarks)) {\r\n // Remove the mark so we don't fill up the performance resources too much\r\n performance.clearMarks(perfMark.name);\r\n }\r\n ajaxData.perfAttempts = attempt;\r\n // just continue and report the track event\r\n trackCallback();\r\n }\r\n else {\r\n // We need to wait for the browser to populate the window.performance entry\r\n // This needs to be at least 1ms as waiting <= 1 (on firefox) is not enough time for fetch or xhr,\r\n // this is a scheduling issue for the browser implementation\r\n scheduleTimeout(locateResourceTiming, retryDelay);\r\n }\r\n }\r\n catch (e) {\r\n reportError(e);\r\n }\r\n })();\r\n }\r\n function _createFetchRecord(input, init) {\r\n var _a;\r\n var distributedTraceCtx = _getDistributedTraceCtx();\r\n var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID /* @min:%2egetTraceId */]()) || generateW3CId();\r\n var spanID = strSubstr(generateW3CId(), 0, 16);\r\n var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx());\r\n ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS /* @min:%2egetTraceFlags */]();\r\n ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */] = dateTimeUtilsNow();\r\n ajaxData[_DYN_ERROR_STATUS_TEXT /* @min:%2eerrorStatusText */] = _enableAjaxErrorStatusText;\r\n var requestUrl;\r\n if (input instanceof Request) {\r\n requestUrl = (input || {}).url || \"\";\r\n }\r\n else {\r\n requestUrl = input;\r\n }\r\n if (requestUrl === \"\") {\r\n var location_1 = getLocation();\r\n if (location_1 && location_1.href) {\r\n requestUrl = strSplit(location_1.href, \"#\")[0];\r\n }\r\n }\r\n ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */] = requestUrl;\r\n var method = \"GET\";\r\n if (init && init[_DYN_METHOD /* @min:%2emethod */]) {\r\n method = init[_DYN_METHOD /* @min:%2emethod */];\r\n }\r\n else if (input && input instanceof Request) {\r\n method = input[_DYN_METHOD /* @min:%2emethod */];\r\n }\r\n ajaxData[_DYN_METHOD /* @min:%2emethod */] = method;\r\n var requestHeaders = {};\r\n if (_enableRequestHeaderTracking) {\r\n var headers = new Headers((init ? init[_DYN_HEADERS /* @min:%2eheaders */] : 0) || (input instanceof Request ? (input[_DYN_HEADERS /* @min:%2eheaders */] || {}) : {}));\r\n headers.forEach(function (value, key) {\r\n if (_canIncludeHeaders(key)) {\r\n requestHeaders[key] = value;\r\n }\r\n });\r\n }\r\n ajaxData[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */] = requestHeaders;\r\n _createMarkId(STR_FETCH, ajaxData);\r\n return ajaxData;\r\n }\r\n function _getFailedFetchDiagnosticsMessage(input) {\r\n var result = \"\";\r\n try {\r\n if (!isNullOrUndefined(input)) {\r\n if (typeof (input) === \"string\") {\r\n result += \"(url: '\".concat(input, \"')\");\r\n }\r\n else {\r\n result += \"(url: '\".concat(input.url, \"')\");\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalCritical(_self, 15 /* _eInternalMessageId.FailedMonitorAjaxOpen */, \"Failed to grab failed fetch diagnostics message\", { exception: dumpObj(e) });\r\n }\r\n return result;\r\n }\r\n function _reportFetchMetrics(callDetails, status, input, response, ajaxData, getResponse, properties) {\r\n if (!ajaxData) {\r\n return;\r\n }\r\n function _reportFetchError(msgId, e, failedProps) {\r\n var errorProps = failedProps || {};\r\n errorProps[\"fetchDiagnosticsMessage\"] = _getFailedFetchDiagnosticsMessage(input);\r\n if (e) {\r\n errorProps[\"exception\"] = dumpObj(e);\r\n }\r\n _throwInternalWarning(_self, msgId, FAILED_TO_CALCULATE_DURATION_ERROR + \"fetch call\" + ERROR_NOT_SENT, errorProps);\r\n }\r\n ajaxData[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */] = dateTimeUtilsNow();\r\n ajaxData[_DYN_STATUS /* @min:%2estatus */] = status;\r\n _findPerfResourceEntry(STR_FETCH, ajaxData, function () {\r\n var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM /* @min:%2eCreateTrackItem */](\"Fetch\", _enableRequestHeaderTracking, getResponse);\r\n var properties;\r\n try {\r\n if (!!_addRequestContext) {\r\n properties = _addRequestContext({ status: status, request: input, response: response });\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, 104 /* _eInternalMessageId.FailedAddingCustomDefinedRequestContext */, CUSTOM_REQUEST_CONTEXT_ERROR);\r\n }\r\n if (dependency) {\r\n if (properties !== undefined) {\r\n dependency[STR_PROPERTIES /* @min:%2eproperties */] = __assign(__assign({}, dependency.properties), properties);\r\n }\r\n var sysProperties = ajaxData[_DYN_GET_PART_APROPS /* @min:%2egetPartAProps */]();\r\n _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE /* @min:%2ecore */], ajaxData, dependency, null, sysProperties);\r\n }\r\n else {\r\n _reportFetchError(14 /* _eInternalMessageId.FailedMonitorAjaxDur */, null, {\r\n requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */],\r\n responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */]\r\n });\r\n }\r\n }, function (e) {\r\n _reportFetchError(18 /* _eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader */, e, null);\r\n });\r\n }\r\n function _getFetchCorrelationContext(response) {\r\n if (response && response[_DYN_HEADERS /* @min:%2eheaders */]) {\r\n try {\r\n var responseHeader = response[_DYN_HEADERS /* @min:%2eheaders */].get(RequestHeaders[0 /* eRequestHeaders.requestContextHeader */]);\r\n return correlationIdGetCorrelationContext(responseHeader);\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, 18 /* _eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader */, CORRELATION_HEADER_ERROR, {\r\n fetchDiagnosticsMessage: _getFailedFetchDiagnosticsMessage(response),\r\n exception: dumpObj(e)\r\n });\r\n }\r\n }\r\n }\r\n function _reportDependencyInternal(initializers, core, ajaxData, dependency, properties, systemProperties) {\r\n var result = true;\r\n var initializersCount = initializers[_DYN_LENGTH /* @min:%2elength */];\r\n if (initializersCount > 0) {\r\n var details = {\r\n item: dependency,\r\n properties: properties,\r\n sysProperties: systemProperties,\r\n context: ajaxData ? ajaxData[_DYN_CONTEXT /* @min:%2econtext */] : null,\r\n aborted: ajaxData ? !!ajaxData[_DYN_ABORTED /* @min:%2eaborted */] : false\r\n };\r\n result = _processDependencyContainer(core, initializers, details, \"initializer\");\r\n }\r\n if (result) {\r\n _self[_DYN_TRACK_DEPENDENCY_DAT1 /* @min:%2etrackDependencyDataInternal */](dependency, properties, systemProperties);\r\n }\r\n }\r\n });\r\n return _this;\r\n }\r\n AjaxMonitor.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AjaxMonitor.prototype.processTelemetry = function (item, itemCtx) {\r\n this.processNext(item, itemCtx);\r\n };\r\n /**\r\n * Logs dependency call\r\n * @param dependencyData - dependency data object\r\n */\r\n AjaxMonitor.prototype.trackDependencyData = function (dependency, properties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AjaxMonitor.prototype.includeCorrelationHeaders = function (ajaxData, input, init, xhr) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you\r\n * to access the headers and modify the values used to generate the distributed tracing correlation headers.\r\n * @param dependencyListener - The Telemetry Initializer function\r\n * @returns - A IDependencyListenerHandler to enable the initializer to be removed\r\n */\r\n AjaxMonitor.prototype.addDependencyListener = function (dependencyListener) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Add an dependency telemetry initializer callback function to allow populating additional properties or drop the request.\r\n * It is called after the dependency call has completed and any available performance details are available. A dependency\r\n * initializer is similar to the TelemetryInitializer function but it allows you to block the reporting of the dependency\r\n * request so that it doesn't count against the `maxAjaxCallsPerView`.\r\n * @param dependencyInitializer - The Dependency Telemetry Initializer function\r\n * @returns - A IDependencyInitializerHandler to enable the initializer to be removed\r\n */\r\n AjaxMonitor.prototype.addDependencyInitializer = function (dependencyInitializer) {\r\n return null;\r\n };\r\n /**\r\n * Protected function to allow sub classes the chance to add additional properties to the dependency event\r\n * before it's sent. This function calls track, so sub-classes must call this function after they have\r\n * populated their properties.\r\n * @param dependencyData - dependency data object\r\n */\r\n AjaxMonitor.prototype.trackDependencyDataInternal = function (dependency, properties, systemProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AjaxMonitor.identifier = \"AjaxDependencyPlugin\";\r\n return AjaxMonitor;\r\n}(BaseTelemetryPlugin));\r\nexport { AjaxMonitor };\r\n//# sourceMappingURL=ajax.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Application = /** @class */ (function () {\r\n function Application() {\r\n }\r\n return Application;\r\n}());\r\nexport { Application };\r\n//# sourceMappingURL=Application.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Device = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the Device class\r\n */\r\n function Device() {\r\n // don't attempt to fingerprint browsers\r\n this.id = \"browser\";\r\n // Device type is a dimension in our data platform\r\n // Setting it to 'Browser' allows to separate client and server dependencies/exceptions\r\n this.deviceClass = \"Browser\";\r\n }\r\n return Device;\r\n}());\r\nexport { Device };\r\n//# sourceMappingURL=Device.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { onConfigChange } from \"@microsoft/applicationinsights-core-js\";\r\nvar Version = '3.3.6';\r\nvar Internal = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the internal telemetry data class.\r\n */\r\n function Internal(config, unloadHookContainer) {\r\n var _this = this;\r\n var unloadHook = onConfigChange((config), function () {\r\n var prefix = config.sdkExtension;\r\n _this.sdkVersion = (prefix ? prefix + \"_\" : \"\") + \"javascript:\" + Version;\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n }\r\n return Internal;\r\n}());\r\nexport { Internal };\r\n//# sourceMappingURL=Internal.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Location = /** @class */ (function () {\r\n function Location() {\r\n }\r\n return Location;\r\n}());\r\nexport { Location };\r\n//# sourceMappingURL=Location.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, dateNow, dumpObj, getExceptionName, isFunction, newId, onConfigChange, safeGetCookieMgr, safeGetLogger } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_ACQUISITION_DATE, _DYN_AUTOMATIC_SESSION, _DYN_RENEWAL_DATE, _DYN_SESSION_COOKIE_POSTF6 } from \"../__DynamicConstants\";\r\nvar SESSION_COOKIE_NAME = \"ai_session\";\r\nvar ACQUISITION_SPAN = 86400000; // 24 hours in ms\r\nvar RENEWAL_SPAN = 1800000; // 30 minutes in ms\r\nvar COOKIE_UPDATE_INTERVAL = 60000; // 1 minute in ms\r\nvar Session = /** @class */ (function () {\r\n function Session() {\r\n }\r\n return Session;\r\n}());\r\nexport { Session };\r\nvar _SessionManager = /** @class */ (function () {\r\n function _SessionManager(config, core, unloadHookContainer) {\r\n var self = this;\r\n var _storageNamePrefix;\r\n var _cookieUpdatedTimestamp;\r\n var _logger = safeGetLogger(core);\r\n var _cookieManager = safeGetCookieMgr(core);\r\n var _sessionExpirationMs;\r\n var _sessionRenewalMs;\r\n dynamicProto(_SessionManager, self, function (_self) {\r\n if (!config) {\r\n config = {};\r\n }\r\n var unloadHook = onConfigChange(config, function (details) {\r\n _sessionExpirationMs = config.sessionExpirationMs || ACQUISITION_SPAN;\r\n _sessionRenewalMs = config.sessionRenewalMs || RENEWAL_SPAN;\r\n // sessionCookiePostfix takes the preference if it is configured, otherwise takes namePrefix if configured.\r\n var sessionCookiePostfix = config[_DYN_SESSION_COOKIE_POSTF6 /* @min:%2esessionCookiePostfix */] || config.namePrefix || \"\";\r\n _storageNamePrefix = SESSION_COOKIE_NAME + sessionCookiePostfix;\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n _self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */] = new Session();\r\n _self.update = function () {\r\n // Always using Date getTime() as there is a bug in older IE instances that causes the performance timings to have the hi-bit set eg 0x800000000 causing\r\n // the number to be incorrect.\r\n var nowMs = dateNow();\r\n var isExpired = false;\r\n var session = _self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */];\r\n if (!session.id) {\r\n isExpired = !_initializeAutomaticSession(session, nowMs);\r\n }\r\n if (!isExpired && _sessionExpirationMs > 0) {\r\n var timeSinceAcqMs = nowMs - session[_DYN_ACQUISITION_DATE /* @min:%2eacquisitionDate */];\r\n var timeSinceRenewalMs = nowMs - session[_DYN_RENEWAL_DATE /* @min:%2erenewalDate */];\r\n isExpired = timeSinceAcqMs < 0 || timeSinceRenewalMs < 0; // expired if the acquisition or last renewal are in the future\r\n isExpired = isExpired || timeSinceAcqMs > _sessionExpirationMs; // expired if the time since acquisition is more than session Expiration\r\n isExpired = isExpired || timeSinceRenewalMs > _sessionRenewalMs; // expired if the time since last renewal is more than renewal period\r\n }\r\n // renew if acquisitionSpan or renewalSpan has elapsed\r\n if (isExpired) {\r\n // update automaticSession so session state has correct id\r\n _renew(nowMs);\r\n }\r\n else {\r\n // do not update the cookie more often than cookieUpdateInterval\r\n if (!_cookieUpdatedTimestamp || nowMs - _cookieUpdatedTimestamp > COOKIE_UPDATE_INTERVAL) {\r\n _setCookie(session, nowMs);\r\n }\r\n }\r\n };\r\n /**\r\n * Record the current state of the automatic session and store it in our cookie string format\r\n * into the browser's local storage. This is used to restore the session data when the cookie\r\n * expires.\r\n */\r\n _self.backup = function () {\r\n var session = _self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */];\r\n _setStorage(session.id, session[_DYN_ACQUISITION_DATE /* @min:%2eacquisitionDate */], session[_DYN_RENEWAL_DATE /* @min:%2erenewalDate */]);\r\n };\r\n /**\r\n * Use config.namePrefix + ai_session cookie data or local storage data (when the cookie is unavailable) to\r\n * initialize the automatic session.\r\n * @returns true if values set otherwise false\r\n */\r\n function _initializeAutomaticSession(session, now) {\r\n var isValid = false;\r\n var cookieValue = _cookieManager.get(_storageNamePrefix);\r\n if (cookieValue && isFunction(cookieValue.split)) {\r\n isValid = _initializeAutomaticSessionWithData(session, cookieValue);\r\n }\r\n else {\r\n // There's no cookie, but we might have session data in local storage\r\n // This can happen if the session expired or the user actively deleted the cookie\r\n // We only want to recover data if the cookie is missing from expiry. We should respect the user's wishes if the cookie was deleted actively.\r\n // The User class handles this for us and deletes our local storage object if the persistent user cookie was removed.\r\n var storageValue = utlGetLocalStorage(_logger, _storageNamePrefix);\r\n if (storageValue) {\r\n isValid = _initializeAutomaticSessionWithData(session, storageValue);\r\n }\r\n }\r\n return isValid || !!session.id;\r\n }\r\n /**\r\n * Extract id, acquisitionDate, and renewalDate from an ai_session payload string and\r\n * use this data to initialize automaticSession.\r\n *\r\n * @param sessionData - The string stored in an ai_session cookie or local storage backup\r\n * @returns true if values set otherwise false\r\n */\r\n function _initializeAutomaticSessionWithData(session, sessionData) {\r\n var isValid = false;\r\n var sessionReset = \", session will be reset\";\r\n var tokens = sessionData.split(\"|\");\r\n if (tokens.length >= 2) {\r\n try {\r\n var acqMs = +tokens[1] || 0;\r\n var renewalMs = +tokens[2] || 0;\r\n if (isNaN(acqMs) || acqMs <= 0) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 27 /* _eInternalMessageId.SessionRenewalDateIsZero */, \"AI session acquisition date is 0\" + sessionReset);\r\n }\r\n else if (isNaN(renewalMs) || renewalMs <= 0) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 27 /* _eInternalMessageId.SessionRenewalDateIsZero */, \"AI session renewal date is 0\" + sessionReset);\r\n }\r\n else if (tokens[0]) {\r\n // Everything looks valid so set the values\r\n session.id = tokens[0];\r\n session[_DYN_ACQUISITION_DATE /* @min:%2eacquisitionDate */] = acqMs;\r\n session[_DYN_RENEWAL_DATE /* @min:%2erenewalDate */] = renewalMs;\r\n isValid = true;\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 9 /* _eInternalMessageId.ErrorParsingAISessionCookie */, \"Error parsing ai_session value [\" + (sessionData || \"\") + \"]\" + sessionReset + \" - \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n }\r\n return isValid;\r\n }\r\n function _renew(nowMs) {\r\n var getNewId = config.getNewId || newId;\r\n _self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */].id = getNewId(config.idLength || 22);\r\n _self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */][_DYN_ACQUISITION_DATE /* @min:%2eacquisitionDate */] = nowMs;\r\n _setCookie(_self[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */], nowMs);\r\n // If this browser does not support local storage, fire an internal log to keep track of it at this point\r\n if (!utlCanUseLocalStorage()) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 0 /* _eInternalMessageId.BrowserDoesNotSupportLocalStorage */, \"Browser does not support local storage. Session durations will be inaccurate.\");\r\n }\r\n }\r\n function _setCookie(session, nowMs) {\r\n var acq = session[_DYN_ACQUISITION_DATE /* @min:%2eacquisitionDate */];\r\n session[_DYN_RENEWAL_DATE /* @min:%2erenewalDate */] = nowMs;\r\n var renewalPeriodMs = _sessionRenewalMs;\r\n // Set cookie to expire after the session expiry time passes or the session renewal deadline, whichever is sooner\r\n // Expiring the cookie will cause the session to expire even if the user isn't on the page\r\n var acqTimeLeftMs = (acq + _sessionExpirationMs) - nowMs;\r\n var cookie = [session.id, acq, nowMs];\r\n var maxAgeSec = 0;\r\n if (acqTimeLeftMs < renewalPeriodMs) {\r\n maxAgeSec = acqTimeLeftMs / 1000;\r\n }\r\n else {\r\n maxAgeSec = renewalPeriodMs / 1000;\r\n }\r\n var cookieDomain = config.cookieDomain || null;\r\n // if sessionExpirationMs is set to 0, it means the expiry is set to 0 for this session cookie\r\n // A cookie with 0 expiry in the session cookie will never expire for that browser session. If the browser is closed the cookie expires.\r\n // Depending on the browser, another instance does not inherit this cookie, however, another tab will\r\n _cookieManager.set(_storageNamePrefix, cookie.join(\"|\"), _sessionExpirationMs > 0 ? maxAgeSec : null, cookieDomain);\r\n _cookieUpdatedTimestamp = nowMs;\r\n }\r\n function _setStorage(guid, acq, renewal) {\r\n // Keep data in local storage to retain the last session id, allowing us to cleanly end the session when it expires\r\n // Browsers that don't support local storage won't be able to end sessions cleanly from the client\r\n // The server will notice this and end the sessions itself, with loss of accurate session duration\r\n utlSetLocalStorage(_logger, _storageNamePrefix, [guid, acq, renewal].join(\"|\"));\r\n }\r\n });\r\n }\r\n _SessionManager.prototype.update = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Record the current state of the automatic session and store it in our cookie string format\r\n * into the browser's local storage. This is used to restore the session data when the cookie\r\n * expires.\r\n */\r\n _SessionManager.prototype.backup = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return _SessionManager;\r\n}());\r\nexport { _SessionManager };\r\n//# sourceMappingURL=Session.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dataSanitizeString } from \"@microsoft/applicationinsights-common\";\r\nimport { generateW3CId, getLocation } from \"@microsoft/applicationinsights-core-js\";\r\nvar TelemetryTrace = /** @class */ (function () {\r\n function TelemetryTrace(id, parentId, name, logger) {\r\n var _self = this;\r\n _self.traceID = id || generateW3CId();\r\n _self.parentID = parentId;\r\n var location = getLocation();\r\n if (!name && location && location.pathname) {\r\n name = location.pathname;\r\n }\r\n _self.name = dataSanitizeString(logger, name);\r\n }\r\n return TelemetryTrace;\r\n}());\r\nexport { TelemetryTrace };\r\n//# sourceMappingURL=TelemetryTrace.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { utlRemoveStorage } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, newId, onConfigChange, safeGetCookieMgr, safeGetLogger, toISOString } from \"@microsoft/applicationinsights-core-js\";\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nimport { _DYN_ACCOUNT_ID, _DYN_AUTHENTICATED_ID, _DYN_AUTH_USER_COOKIE_NAM7, _DYN_COOKIE_SEPARATOR, _DYN_IS_NEW_USER, _DYN_IS_USER_COOKIE_SET } from \"../__DynamicConstants\";\r\nfunction _validateUserInput(id) {\r\n // Validate:\r\n // 1. Id is a non-empty string.\r\n // 2. It does not contain special characters for cookies.\r\n if (typeof id !== \"string\" ||\r\n !id ||\r\n id.match(/,|;|=| |\\|/)) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nvar User = /** @class */ (function () {\r\n function User(config, core, unloadHookContainer) {\r\n /**\r\n * A flag indicating whether this represents a new user\r\n */\r\n this.isNewUser = false;\r\n /**\r\n * A flag indicating whether the user cookie has been set\r\n */\r\n this.isUserCookieSet = false;\r\n var _logger = safeGetLogger(core);\r\n var _cookieManager = safeGetCookieMgr(core);\r\n var _storageNamePrefix;\r\n dynamicProto(User, this, function (_self) {\r\n // Define _self.config\r\n objDefine(_self, \"config\", {\r\n g: function () { return config; }\r\n });\r\n var unloadHook = onConfigChange(config, function () {\r\n var userCookiePostfix = config.userCookiePostfix || \"\";\r\n _storageNamePrefix = User.userCookieName + userCookiePostfix;\r\n // get userId or create new one if none exists\r\n var cookie = _cookieManager.get(_storageNamePrefix);\r\n if (cookie) {\r\n _self[_DYN_IS_NEW_USER /* @min:%2eisNewUser */] = false;\r\n var params = cookie.split(User[_DYN_COOKIE_SEPARATOR /* @min:%2ecookieSeparator */]);\r\n if (params.length > 0) {\r\n _self.id = params[0];\r\n // we already have a cookie\r\n _self[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */] = !!_self.id;\r\n }\r\n }\r\n if (!_self.id) {\r\n _self.id = _generateNewId();\r\n var newCookie = _generateNewCookie(_self.id);\r\n _setUserCookie(newCookie.join(User[_DYN_COOKIE_SEPARATOR /* @min:%2ecookieSeparator */]));\r\n // If we have an config.namePrefix() + ai_session in local storage this means the user actively removed our cookies.\r\n // We should respect their wishes and clear ourselves from local storage\r\n var name_1 = (config.namePrefix || \"\") + \"ai_session\";\r\n utlRemoveStorage(_logger, name_1);\r\n }\r\n // We still take the account id from the ctor param for backward compatibility.\r\n // But if the the customer set the accountId through the newer setAuthenticatedUserContext API, we will override it.\r\n _self[_DYN_ACCOUNT_ID /* @min:%2eaccountId */] = config[_DYN_ACCOUNT_ID /* @min:%2eaccountId */] || undefined;\r\n // Get the auth user id and account id from the cookie if exists\r\n // Cookie is in the pattern: |\r\n var authCookie = _cookieManager.get(User[_DYN_AUTH_USER_COOKIE_NAM7 /* @min:%2eauthUserCookieName */]);\r\n if (authCookie) {\r\n authCookie = decodeURI(authCookie);\r\n var authCookieString = authCookie.split(User[_DYN_COOKIE_SEPARATOR /* @min:%2ecookieSeparator */]);\r\n if (authCookieString[0]) {\r\n _self[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */] = authCookieString[0];\r\n }\r\n if (authCookieString.length > 1 && authCookieString[1]) {\r\n _self[_DYN_ACCOUNT_ID /* @min:%2eaccountId */] = authCookieString[1];\r\n }\r\n }\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n function _generateNewId() {\r\n var theConfig = (config || {});\r\n var getNewId = theConfig.getNewId || newId;\r\n var id = getNewId(theConfig.idLength ? config.idLength : 22);\r\n return id;\r\n }\r\n function _generateNewCookie(userId) {\r\n var acqStr = toISOString(new Date());\r\n _self.accountAcquisitionDate = acqStr;\r\n _self[_DYN_IS_NEW_USER /* @min:%2eisNewUser */] = true;\r\n var newCookie = [userId, acqStr];\r\n return newCookie;\r\n }\r\n function _setUserCookie(cookie) {\r\n // without expiration, cookies expire at the end of the session\r\n // set it to 365 days from now\r\n // 365 * 24 * 60 * 60 = 31536000\r\n var oneYear = 31536000;\r\n _self[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */] = _cookieManager.set(_storageNamePrefix, cookie, oneYear);\r\n }\r\n _self.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) {\r\n if (storeInCookie === void 0) { storeInCookie = false; }\r\n // Validate inputs to ensure no cookie control characters.\r\n var isInvalidInput = !_validateUserInput(authenticatedUserId) || (accountId && !_validateUserInput(accountId));\r\n if (isInvalidInput) {\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 60 /* _eInternalMessageId.SetAuthContextFailedAccountName */, \"Setting auth user context failed. \" +\r\n \"User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.\", true);\r\n return;\r\n }\r\n // Create cookie string.\r\n _self[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */] = authenticatedUserId;\r\n var authCookie = _self[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */];\r\n if (accountId) {\r\n _self[_DYN_ACCOUNT_ID /* @min:%2eaccountId */] = accountId;\r\n authCookie = [_self[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */], _self.accountId].join(User[_DYN_COOKIE_SEPARATOR /* @min:%2ecookieSeparator */]);\r\n }\r\n if (storeInCookie) {\r\n // Set the cookie. No expiration date because this is a session cookie (expires when browser closed).\r\n // Encoding the cookie to handle unexpected unicode characters.\r\n _cookieManager.set(User[_DYN_AUTH_USER_COOKIE_NAM7 /* @min:%2eauthUserCookieName */], encodeURI(authCookie));\r\n }\r\n };\r\n /**\r\n * Clears the authenticated user id and the account id from the user context.\r\n * @returns {}\r\n */\r\n _self.clearAuthenticatedUserContext = function () {\r\n _self[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */] = null;\r\n _self[_DYN_ACCOUNT_ID /* @min:%2eaccountId */] = null;\r\n _cookieManager.del(User[_DYN_AUTH_USER_COOKIE_NAM7 /* @min:%2eauthUserCookieName */]);\r\n };\r\n _self.update = function (userId) {\r\n // Optimizations to avoid setting and processing the cookie when not needed\r\n if (_self.id !== userId || !_self[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */]) {\r\n var user_id = userId ? userId : _generateNewId();\r\n var user_cookie = _generateNewCookie(user_id);\r\n _setUserCookie(user_cookie.join(User[_DYN_COOKIE_SEPARATOR /* @min:%2ecookieSeparator */]));\r\n }\r\n };\r\n });\r\n }\r\n /**\r\n * Sets the authenticated user id and the account id in this session.\r\n *\r\n * @param authenticatedUserId - The authenticated user id. A unique and persistent string that represents each authenticated user in the service.\r\n * @param accountId - An optional string to represent the account associated with the authenticated user.\r\n */\r\n User.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) {\r\n if (storeInCookie === void 0) { storeInCookie = false; }\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Clears the authenticated user id and the account id from the user context.\r\n * @returns {}\r\n */\r\n User.prototype.clearAuthenticatedUserContext = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Update or create the user cookie if cookies where previously disabled or the new userId does not match the existing value.\r\n * If you pass nothing a new random user id will be created.\r\n * @param userId - Specific either the current (via appInsights.context.user.id) or new id that you want to set\r\n */\r\n User.prototype.update = function (userId) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n User.cookieSeparator = \"|\";\r\n User.userCookieName = \"ai_user\";\r\n User.authUserCookieName = \"ai_authUser\";\r\n return User;\r\n}());\r\nexport { User };\r\n//# sourceMappingURL=User.js.map","/**\r\n* TelemetryContext.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { CtxTagKeys, Extensions, PageView, dataSanitizeString } from \"@microsoft/applicationinsights-common\";\r\nimport { _InternalLogMessage, getSetValue, hasWindow, isNullOrUndefined, isString, objKeys, setValue } from \"@microsoft/applicationinsights-core-js\";\r\nimport { Application } from \"./Context/Application\";\r\nimport { Device } from \"./Context/Device\";\r\nimport { Internal } from \"./Context/Internal\";\r\nimport { Location } from \"./Context/Location\";\r\nimport { Session, _SessionManager } from \"./Context/Session\";\r\nimport { TelemetryTrace } from \"./Context/TelemetryTrace\";\r\nimport { User } from \"./Context/User\";\r\nimport { _DYN_ACCOUNT_ID, _DYN_APPLY_APPLICATION_CO1, _DYN_APPLY_INTERNAL_CONTE5, _DYN_APPLY_LOCATION_CONTE4, _DYN_APPLY_OPERATING_SYST3, _DYN_APPLY_OPERATION_CONT2, _DYN_APPLY_SESSION_CONTEX0, _DYN_AUTHENTICATED_ID, _DYN_AUTOMATIC_SESSION, _DYN_GET_SESSION_ID, _DYN_SESSION, _DYN_SESSION_MANAGER, _DYN_TELEMETRY_TRACE } from \"./__DynamicConstants\";\r\nvar strExt = \"ext\";\r\nvar strTags = \"tags\";\r\nfunction _removeEmpty(target, name) {\r\n if (target && target[name] && objKeys(target[name]).length === 0) {\r\n delete target[name];\r\n }\r\n}\r\nfunction _nullResult() {\r\n return null;\r\n}\r\nvar TelemetryContext = /** @class */ (function () {\r\n function TelemetryContext(core, defaultConfig, previousTraceCtx, unloadHookContainer) {\r\n var _this = this;\r\n var logger = core.logger;\r\n dynamicProto(TelemetryContext, this, function (_self) {\r\n _self.appId = _nullResult;\r\n _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */] = _nullResult;\r\n _self.application = new Application();\r\n _self.internal = new Internal(defaultConfig, unloadHookContainer);\r\n if (hasWindow()) {\r\n _self[_DYN_SESSION_MANAGER /* @min:%2esessionManager */] = new _SessionManager(defaultConfig, core, unloadHookContainer);\r\n _self.device = new Device();\r\n _self.location = new Location();\r\n _self.user = new User(defaultConfig, core, unloadHookContainer);\r\n var traceId = void 0;\r\n var parentId = void 0;\r\n var name_1;\r\n if (previousTraceCtx) {\r\n traceId = previousTraceCtx.getTraceId();\r\n parentId = previousTraceCtx.getSpanId();\r\n name_1 = previousTraceCtx.getName();\r\n }\r\n _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */] = new TelemetryTrace(traceId, parentId, name_1, logger);\r\n _self[_DYN_SESSION /* @min:%2esession */] = new Session();\r\n }\r\n _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */] = function () {\r\n var session = _self[_DYN_SESSION /* @min:%2esession */];\r\n var sesId = null;\r\n // If customer set session info, apply their context; otherwise apply context automatically generated\r\n if (session && isString(session.id)) {\r\n sesId = session.id;\r\n }\r\n else {\r\n // Gets the automatic session if it exists or an empty object\r\n var autoSession = (_self[_DYN_SESSION_MANAGER /* @min:%2esessionManager */] || {})[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */];\r\n sesId = autoSession && isString(autoSession.id) ? autoSession.id : null;\r\n }\r\n return sesId;\r\n };\r\n _self[_DYN_APPLY_SESSION_CONTEX0 /* @min:%2eapplySessionContext */] = function (evt, itemCtx) {\r\n setValue(getSetValue(evt.ext, Extensions.AppExt), \"sesId\", _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */](), isString);\r\n };\r\n _self[_DYN_APPLY_OPERATING_SYST3 /* @min:%2eapplyOperatingSystemContxt */] = function (evt, itemCtx) {\r\n setValue(evt.ext, Extensions.OSExt, _self.os);\r\n };\r\n _self[_DYN_APPLY_APPLICATION_CO1 /* @min:%2eapplyApplicationContext */] = function (evt, itemCtx) {\r\n var application = _self.application;\r\n if (application) {\r\n // evt.ext.app\r\n var tags = getSetValue(evt, strTags);\r\n setValue(tags, CtxTagKeys.applicationVersion, application.ver, isString);\r\n setValue(tags, CtxTagKeys.applicationBuild, application.build, isString);\r\n }\r\n };\r\n _self.applyDeviceContext = function (evt, itemCtx) {\r\n var device = _self.device;\r\n if (device) {\r\n // evt.ext.device\r\n var extDevice = getSetValue(getSetValue(evt, strExt), Extensions.DeviceExt);\r\n setValue(extDevice, \"localId\", device.id, isString);\r\n setValue(extDevice, \"ip\", device.ip, isString);\r\n setValue(extDevice, \"model\", device.model, isString);\r\n setValue(extDevice, \"deviceClass\", device.deviceClass, isString);\r\n }\r\n };\r\n _self[_DYN_APPLY_INTERNAL_CONTE5 /* @min:%2eapplyInternalContext */] = function (evt, itemCtx) {\r\n var internal = _self.internal;\r\n if (internal) {\r\n var tags = getSetValue(evt, strTags);\r\n setValue(tags, CtxTagKeys.internalAgentVersion, internal.agentVersion, isString); // not mapped in CS 4.0\r\n setValue(tags, CtxTagKeys.internalSdkVersion, dataSanitizeString(logger, internal.sdkVersion, 64), isString);\r\n if (evt.baseType === _InternalLogMessage.dataType || evt.baseType === PageView.dataType) {\r\n setValue(tags, CtxTagKeys.internalSnippet, internal.snippetVer, isString);\r\n setValue(tags, CtxTagKeys.internalSdkSrc, internal.sdkSrc, isString);\r\n }\r\n }\r\n };\r\n _self[_DYN_APPLY_LOCATION_CONTE4 /* @min:%2eapplyLocationContext */] = function (evt, itemCtx) {\r\n var location = _this.location;\r\n if (location) {\r\n setValue(getSetValue(evt, strTags, []), CtxTagKeys.locationIp, location.ip, isString);\r\n }\r\n };\r\n _self[_DYN_APPLY_OPERATION_CONT2 /* @min:%2eapplyOperationContext */] = function (evt, itemCtx) {\r\n var telemetryTrace = _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */];\r\n if (telemetryTrace) {\r\n var extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined });\r\n setValue(extTrace, \"traceID\", telemetryTrace.traceID, isString, isNullOrUndefined);\r\n setValue(extTrace, \"name\", telemetryTrace.name, isString, isNullOrUndefined);\r\n setValue(extTrace, \"parentID\", telemetryTrace.parentID, isString, isNullOrUndefined);\r\n }\r\n };\r\n _self.applyWebContext = function (evt, itemCtx) {\r\n var web = _this.web;\r\n if (web) {\r\n setValue(getSetValue(evt, strExt), Extensions.WebExt, web);\r\n }\r\n };\r\n _self.applyUserContext = function (evt, itemCtx) {\r\n var user = _self.user;\r\n if (user) {\r\n var tags = getSetValue(evt, strTags, []);\r\n // stays in tags\r\n setValue(tags, CtxTagKeys.userAccountId, user[_DYN_ACCOUNT_ID /* @min:%2eaccountId */], isString);\r\n // CS 4.0\r\n var extUser = getSetValue(getSetValue(evt, strExt), Extensions.UserExt);\r\n setValue(extUser, \"id\", user.id, isString);\r\n setValue(extUser, \"authId\", user[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */], isString);\r\n }\r\n };\r\n _self.cleanUp = function (evt, itemCtx) {\r\n var ext = evt.ext;\r\n if (ext) {\r\n _removeEmpty(ext, Extensions.DeviceExt);\r\n _removeEmpty(ext, Extensions.UserExt);\r\n _removeEmpty(ext, Extensions.WebExt);\r\n _removeEmpty(ext, Extensions.OSExt);\r\n _removeEmpty(ext, Extensions.AppExt);\r\n _removeEmpty(ext, Extensions.TraceExt);\r\n }\r\n };\r\n });\r\n }\r\n TelemetryContext.prototype.applySessionContext = function (evt, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyOperatingSystemContxt = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyApplicationContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyDeviceContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyInternalContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyLocationContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyOperationContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyWebContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyUserContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.cleanUp = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return TelemetryContext;\r\n}());\r\nexport { TelemetryContext };\r\n//# sourceMappingURL=TelemetryContext.js.map","/**\r\n* PropertiesPlugin.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nvar _a;\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { BreezeChannelIdentifier, PageView, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace, utlSetStoragePrefix } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, _InternalLogMessage, _logInternalMessage, createProcessTelemetryContext, getNavigator, getSetValue, isNullOrUndefined, onConfigChange } from \"@microsoft/applicationinsights-core-js\";\r\nimport { objDeepFreeze, objDefine } from \"@nevware21/ts-utils\";\r\nimport { TelemetryContext } from \"./TelemetryContext\";\r\nimport { _DYN_APPLY_APPLICATION_CO1, _DYN_APPLY_INTERNAL_CONTE5, _DYN_APPLY_LOCATION_CONTE4, _DYN_APPLY_OPERATING_SYST3, _DYN_APPLY_OPERATION_CONT2, _DYN_APPLY_SESSION_CONTEX0, _DYN_GET_SESSION_ID, _DYN_GET_TRACE_CTX, _DYN_IS_NEW_USER, _DYN_IS_USER_COOKIE_SET, _DYN_SESSION, _DYN_SESSION_COOKIE_POSTF6, _DYN_SESSION_MANAGER, _DYN_TELEMETRY_TRACE } from \"./__DynamicConstants\";\r\nvar undefString;\r\nvar nullValue = null;\r\nvar _defaultConfig = objDeepFreeze((_a = {\r\n accountId: nullValue,\r\n sessionRenewalMs: 30 * 60 * 1000,\r\n samplingPercentage: 100,\r\n sessionExpirationMs: 24 * 60 * 60 * 1000,\r\n cookieDomain: nullValue,\r\n sdkExtension: nullValue,\r\n isBrowserLinkTrackingEnabled: false,\r\n appId: nullValue\r\n },\r\n _a[_DYN_GET_SESSION_ID /* @min:getSessionId */] = nullValue,\r\n _a.namePrefix = undefString,\r\n _a[_DYN_SESSION_COOKIE_POSTF6 /* @min:sessionCookiePostfix */] = undefString,\r\n _a.userCookiePostfix = undefString,\r\n _a.idLength = 22,\r\n _a.getNewId = nullValue,\r\n _a));\r\nvar PropertiesPlugin = /** @class */ (function (_super) {\r\n __extends(PropertiesPlugin, _super);\r\n function PropertiesPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.priority = 110;\r\n _this.identifier = PropertiesPluginIdentifier;\r\n var _extensionConfig;\r\n var _distributedTraceCtx;\r\n var _previousTraceCtx;\r\n var _context;\r\n var _disableUserInitMessage;\r\n dynamicProto(PropertiesPlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n objDefine(_self, \"context\", {\r\n g: function () {\r\n return _context;\r\n }\r\n });\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n _base.initialize(config, core, extensions, pluginChain);\r\n _populateDefaults(config);\r\n };\r\n /**\r\n * Add Part A fields to the event\r\n * @param event - The event that needs to be processed\r\n */\r\n _self.processTelemetry = function (event, itemCtx) {\r\n if (!isNullOrUndefined(event)) {\r\n itemCtx = _self._getTelCtx(itemCtx);\r\n // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page.\r\n if (event.name === PageView.envelopeType) {\r\n itemCtx.diagLog().resetInternalMessageCount();\r\n }\r\n var theContext = (_context || {});\r\n if (theContext[_DYN_SESSION /* @min:%2esession */]) {\r\n // If customer did not provide custom session id update the session manager\r\n if (typeof _context[_DYN_SESSION /* @min:%2esession */].id !== \"string\" && theContext[_DYN_SESSION_MANAGER /* @min:%2esessionManager */]) {\r\n theContext[_DYN_SESSION_MANAGER /* @min:%2esessionManager */].update();\r\n }\r\n }\r\n var userCtx = theContext.user;\r\n if (userCtx && !userCtx[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */]) {\r\n userCtx.update(theContext.user.id);\r\n }\r\n _processTelemetryInternal(event, itemCtx);\r\n if (userCtx && userCtx[_DYN_IS_NEW_USER /* @min:%2eisNewUser */]) {\r\n userCtx[_DYN_IS_NEW_USER /* @min:%2eisNewUser */] = false;\r\n if (!_disableUserInitMessage) {\r\n var message = new _InternalLogMessage(72 /* _eInternalMessageId.SendBrowserInfoOnUserInit */, ((getNavigator() || {}).userAgent || \"\"));\r\n _logInternalMessage(itemCtx.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, message);\r\n }\r\n }\r\n _self.processNext(event, itemCtx);\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n var core = (unloadCtx || {}).core();\r\n if (core && core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */]) {\r\n var traceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);\r\n if (traceCtx === _distributedTraceCtx) {\r\n core.setTraceCtx(_previousTraceCtx);\r\n }\r\n }\r\n _initDefaults();\r\n };\r\n function _initDefaults() {\r\n _extensionConfig = null;\r\n _distributedTraceCtx = null;\r\n _previousTraceCtx = null;\r\n _context = null;\r\n _disableUserInitMessage = true;\r\n }\r\n function _populateDefaults(config) {\r\n var identifier = _self.identifier;\r\n var core = _self.core;\r\n // This function will be re-called whenever any referenced configuration is changed\r\n _self._addHook(onConfigChange(config, function () {\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n if (config.storagePrefix) {\r\n utlSetStoragePrefix(config.storagePrefix);\r\n }\r\n _disableUserInitMessage = config.disableUserInitMessage === false ? false : true;\r\n _extensionConfig = ctx.getExtCfg(identifier, _defaultConfig);\r\n // Test hook to allow accessing the internal values -- explicitly not defined as an available property on the class\r\n _self[\"_extConfig\"] = _extensionConfig;\r\n }));\r\n // This is outside of the onConfigChange as we don't want to update (replace) these values whenever a referenced config item changes\r\n _previousTraceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);\r\n _context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx, _self._unloadHooks);\r\n _distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */], _previousTraceCtx);\r\n core.setTraceCtx(_distributedTraceCtx);\r\n _self.context.appId = function () {\r\n var breezeChannel = core.getPlugin(BreezeChannelIdentifier);\r\n return breezeChannel ? breezeChannel.plugin[\"_appId\"] : null;\r\n };\r\n }\r\n function _processTelemetryInternal(evt, itemCtx) {\r\n // Set Part A fields\r\n getSetValue(evt, \"tags\", []);\r\n getSetValue(evt, \"ext\", {});\r\n var ctx = _self.context;\r\n ctx[_DYN_APPLY_SESSION_CONTEX0 /* @min:%2eapplySessionContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_APPLICATION_CO1 /* @min:%2eapplyApplicationContext */](evt, itemCtx);\r\n ctx.applyDeviceContext(evt, itemCtx);\r\n ctx[_DYN_APPLY_OPERATION_CONT2 /* @min:%2eapplyOperationContext */](evt, itemCtx);\r\n ctx.applyUserContext(evt, itemCtx);\r\n ctx[_DYN_APPLY_OPERATING_SYST3 /* @min:%2eapplyOperatingSystemContxt */](evt, itemCtx);\r\n ctx.applyWebContext(evt, itemCtx);\r\n ctx[_DYN_APPLY_LOCATION_CONTE4 /* @min:%2eapplyLocationContext */](evt, itemCtx); // legacy tags\r\n ctx[_DYN_APPLY_INTERNAL_CONTE5 /* @min:%2eapplyInternalContext */](evt, itemCtx); // legacy tags\r\n ctx.cleanUp(evt, itemCtx);\r\n }\r\n });\r\n return _this;\r\n }\r\n PropertiesPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Add Part A fields to the event\r\n * @param event - The event that needs to be processed\r\n */\r\n PropertiesPlugin.prototype.processTelemetry = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return PropertiesPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport default PropertiesPlugin;\r\n//# sourceMappingURL=PropertiesPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nvar _a, _b, _c, _d;\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { AnalyticsPlugin } from \"@microsoft/applicationinsights-analytics-js\";\r\nimport { CfgSyncPlugin } from \"@microsoft/applicationinsights-cfgsync-js\";\r\nimport { Sender } from \"@microsoft/applicationinsights-channel-js\";\r\nimport { AnalyticsPluginIdentifier, DEFAULT_BREEZE_PATH, PropertiesPluginIdentifier, ThrottleMgr, parseConnectionString } from \"@microsoft/applicationinsights-common\";\r\nimport { AppInsightsCore, _throwInternal, addPageHideEventListener, addPageUnloadEventListener, cfgDfMerge, cfgDfValidate, createDynamicConfig, createProcessTelemetryContext, createUniqueNamespace, doPerf, hasDocument, hasWindow, isArray, isFeatureEnabled, isFunction, isNullOrUndefined, isReactNative, isString, mergeEvtNamespace, onConfigChange, proxyAssign, proxyFunctions, removePageHideEventListener, removePageUnloadEventListener } from \"@microsoft/applicationinsights-core-js\";\r\nimport { AjaxPlugin as DependenciesPlugin } from \"@microsoft/applicationinsights-dependencies-js\";\r\nimport { PropertiesPlugin } from \"@microsoft/applicationinsights-properties-js\";\r\nimport { createPromise, createSyncPromise, doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { arrForEach, arrIndexOf, isPromiseLike, objDefine, objForEachKey, strIndexOf, throwUnsupported } from \"@nevware21/ts-utils\";\r\nimport { CONFIG_ENDPOINT_URL, STR_ADD_TELEMETRY_INITIALIZER, STR_CLEAR_AUTHENTICATED_USER_CONTEXT, STR_EVT_NAMESPACE, STR_FLUSH, STR_GET_COOKIE_MGR, STR_GET_PLUGIN, STR_POLL_INTERNAL_LOGS, STR_SET_AUTHENTICATED_USER_CONTEXT, STR_SNIPPET, STR_START_TRACK_EVENT, STR_START_TRACK_PAGE, STR_STOP_TRACK_EVENT, STR_STOP_TRACK_PAGE, STR_TRACK_DEPENDENCY_DATA, STR_TRACK_EVENT, STR_TRACK_EXCEPTION, STR_TRACK_METRIC, STR_TRACK_PAGE_VIEW, STR_TRACK_TRACE } from \"./InternalConstants\";\r\nimport { _DYN_ADD_HOUSEKEEPING_BEF1, _DYN_CONNECTION_STRING, _DYN_CONTEXT, _DYN_ENDPOINT_URL, _DYN_INSTRUMENTATION_KEY, _DYN_ONUNLOAD_FLUSH, _DYN_QUEUE, _DYN_SEND_MESSAGE, _DYN_UPDATE_SNIPPET_DEFIN2, _DYN_USER_OVERRIDE_ENDPOI0, _DYN_VERSION } from \"./__DynamicConstants\";\r\nvar _internalSdkSrc;\r\n// This is an exclude list of properties that should not be updated during initialization\r\n// They include a combination of private and internal property names\r\nvar _ignoreUpdateSnippetProperties = [\r\n STR_SNIPPET, \"dependencies\", \"properties\", \"_snippetVersion\", \"appInsightsNew\", \"getSKUDefaults\"\r\n];\r\nvar IKEY_USAGE = \"iKeyUsage\";\r\nvar CDN_USAGE = \"CdnUsage\";\r\nvar SDK_LOADER_VER = \"SdkLoaderVer\";\r\nvar UNDEFINED_VALUE = undefined;\r\nvar default_limit = {\r\n samplingRate: 100,\r\n maxSendNumber: 1\r\n};\r\nvar default_interval = {\r\n monthInterval: 3,\r\n daysOfMonth: [28]\r\n};\r\nvar default_throttle_config = {\r\n disabled: true,\r\n limit: cfgDfMerge(default_limit),\r\n interval: cfgDfMerge(default_interval)\r\n};\r\n// We need to include all properties that we only reference that we want to be dynamically updatable here\r\n// So they are converted even when not specified in the passed configuration\r\nvar defaultConfigValues = (_a = {},\r\n _a[_DYN_CONNECTION_STRING /* @min:connectionString */] = UNDEFINED_VALUE,\r\n _a.endpointUrl = UNDEFINED_VALUE,\r\n _a[_DYN_INSTRUMENTATION_KEY /* @min:instrumentationKey */] = UNDEFINED_VALUE,\r\n _a[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:userOverrideEndpointUrl */] = UNDEFINED_VALUE,\r\n _a.diagnosticLogInterval = cfgDfValidate(_chkDiagLevel, 10000),\r\n _a.featureOptIn = (_b = {},\r\n _b[IKEY_USAGE] = { mode: 3 /* FeatureOptInMode.enable */ },\r\n _b[CDN_USAGE] = { mode: 2 /* FeatureOptInMode.disable */ },\r\n _b[SDK_LOADER_VER] = { mode: 2 /* FeatureOptInMode.disable */ },\r\n _b),\r\n _a.throttleMgrCfg = cfgDfMerge((_c = {},\r\n _c[109 /* _eInternalMessageId.DefaultThrottleMsgKey */] = cfgDfMerge(default_throttle_config),\r\n _c[106 /* _eInternalMessageId.InstrumentationKeyDeprecation */] = cfgDfMerge(default_throttle_config),\r\n _c[111 /* _eInternalMessageId.SdkLdrUpdate */] = cfgDfMerge(default_throttle_config),\r\n _c[110 /* _eInternalMessageId.CdnDeprecation */] = cfgDfMerge(default_throttle_config),\r\n _c)),\r\n _a.extensionConfig = cfgDfMerge((_d = {},\r\n _d[\"AppInsightsCfgSyncPlugin\"] = cfgDfMerge({\r\n cfgUrl: CONFIG_ENDPOINT_URL,\r\n syncMode: 2 /* ICfgSyncMode.Receive */\r\n }),\r\n _d)),\r\n _a);\r\nfunction _chkDiagLevel(value) {\r\n // Make sure we have a value > 0\r\n return value && value > 0;\r\n}\r\n/**\r\n * Application Insights API\r\n * @group Entrypoint\r\n * @group Classes\r\n * @class Initialization\r\n * @implements {IApplicationInsights}\r\n */\r\nvar AppInsightsSku = /** @class */ (function () {\r\n function AppInsightsSku(snippet) {\r\n var _this = this;\r\n // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()\r\n var dependencies;\r\n var properties;\r\n var _sender;\r\n var _snippetVersion;\r\n var _evtNamespace;\r\n var _houseKeepingNamespace;\r\n var _core;\r\n var _config;\r\n var _analyticsPlugin;\r\n var _cfgSyncPlugin;\r\n var _throttleMgr;\r\n var _iKeySentMessage;\r\n var _cdnSentMessage;\r\n var _sdkVerSentMessage;\r\n dynamicProto(AppInsightsSku, this, function (_self) {\r\n _initDefaults();\r\n objDefine(_self, \"config\", {\r\n g: function () {\r\n return _config;\r\n }\r\n });\r\n arrForEach([\"pluginVersionStringArr\", \"pluginVersionString\"], function (key) {\r\n objDefine(_self, key, {\r\n g: function () {\r\n if (_core) {\r\n return _core[key];\r\n }\r\n return null;\r\n }\r\n });\r\n });\r\n // initialize the queue and config in case they are undefined\r\n _snippetVersion = \"\" + (snippet.sv || snippet[_DYN_VERSION /* @min:%2eversion */] || \"\");\r\n snippet[_DYN_QUEUE /* @min:%2equeue */] = snippet[_DYN_QUEUE /* @min:%2equeue */] || [];\r\n snippet[_DYN_VERSION /* @min:%2eversion */] = snippet[_DYN_VERSION /* @min:%2eversion */] || 2.0; // Default to new version\r\n var cfgHandler = createDynamicConfig(snippet.config || {}, defaultConfigValues);\r\n _config = cfgHandler.cfg;\r\n _analyticsPlugin = new AnalyticsPlugin();\r\n objDefine(_self, \"appInsights\", {\r\n g: function () {\r\n return _analyticsPlugin;\r\n }\r\n });\r\n properties = new PropertiesPlugin();\r\n dependencies = new DependenciesPlugin();\r\n _sender = new Sender();\r\n _core = new AppInsightsCore();\r\n objDefine(_self, \"core\", {\r\n g: function () {\r\n return _core;\r\n }\r\n });\r\n // Will get recalled if any referenced values are changed\r\n _addUnloadHook(onConfigChange(cfgHandler, function () {\r\n var configCs = _config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */];\r\n function _parseCs() {\r\n return createSyncPromise(function (resolve, reject) {\r\n doAwaitResponse(configCs, function (res) {\r\n var curCs = res && res.value;\r\n var parsedCs = null;\r\n if (!res.rejected && curCs) {\r\n // replace cs with resolved values in case of circular promises\r\n _config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */] = curCs;\r\n parsedCs = parseConnectionString(curCs);\r\n }\r\n // if can't resolve cs promise, null will be returned\r\n resolve(parsedCs);\r\n });\r\n });\r\n }\r\n if (isPromiseLike(configCs)) {\r\n var ikeyPromise = createSyncPromise(function (resolve, reject) {\r\n _parseCs().then(function (cs) {\r\n var ikey = _config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];\r\n ikey = cs && cs.instrumentationkey || ikey;\r\n resolve(ikey);\r\n }).catch(function (e) {\r\n // parseCs will always resolve(unless timeout)\r\n // return null in case any error happens\r\n resolve(null);\r\n });\r\n });\r\n var url = _config[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:%2euserOverrideEndpointUrl */];\r\n if (isNullOrUndefined(url)) {\r\n url = createSyncPromise(function (resolve, reject) {\r\n _parseCs().then(function (cs) {\r\n var url = _config[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */];\r\n var ingest = cs && cs.ingestionendpoint;\r\n url = ingest ? ingest + DEFAULT_BREEZE_PATH : url;\r\n resolve(url);\r\n }).catch(function (e) {\r\n // parseCs will always resolve(unless timeout)\r\n // return null in case any error happens\r\n resolve(null);\r\n });\r\n });\r\n }\r\n _config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */] = ikeyPromise;\r\n _config[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */] = url;\r\n }\r\n if (isString(configCs) && configCs) {\r\n // confirm if promiselike function present\r\n // handle cs promise here\r\n // add cases to oneNote\r\n var cs = parseConnectionString(configCs);\r\n var ingest = cs.ingestionendpoint;\r\n _config.endpointUrl = _config[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:%2euserOverrideEndpointUrl */] ? _config[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:%2euserOverrideEndpointUrl */] : ingest + DEFAULT_BREEZE_PATH; // add /v2/track\r\n _config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */] = cs.instrumentationkey || _config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];\r\n }\r\n // userOverrideEndpointUrl have the highest priority\r\n _config.endpointUrl = _config[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:%2euserOverrideEndpointUrl */] ? _config[_DYN_USER_OVERRIDE_ENDPOI0 /* @min:%2euserOverrideEndpointUrl */] : _config[_DYN_ENDPOINT_URL /* @min:%2eendpointUrl */];\r\n }));\r\n _self[STR_SNIPPET /* @min:%2esnippet */] = snippet;\r\n _self[STR_FLUSH /* @min:%2eflush */] = function (async, callBack) {\r\n if (async === void 0) { async = true; }\r\n var result;\r\n doPerf(_core, function () { return \"AISKU.flush\"; }, function () {\r\n if (async && !callBack) {\r\n result = createPromise(function (resolve) {\r\n callBack = resolve;\r\n });\r\n }\r\n var waiting = 1;\r\n var flushDone = function () {\r\n waiting--;\r\n if (waiting === 0) {\r\n callBack();\r\n }\r\n };\r\n arrForEach(_core.getChannels(), function (channel) {\r\n if (channel) {\r\n waiting++;\r\n channel[STR_FLUSH /* @min:%2eflush */](async, flushDone);\r\n }\r\n });\r\n // decrement the initial \"waiting\"\r\n flushDone();\r\n }, null, async);\r\n return result;\r\n };\r\n _self[_DYN_ONUNLOAD_FLUSH /* @min:%2eonunloadFlush */] = function (async) {\r\n if (async === void 0) { async = true; }\r\n arrForEach(_core.getChannels(), function (channel) {\r\n if (channel[_DYN_ONUNLOAD_FLUSH /* @min:%2eonunloadFlush */]) {\r\n channel[_DYN_ONUNLOAD_FLUSH /* @min:%2eonunloadFlush */]();\r\n }\r\n else {\r\n channel[STR_FLUSH /* @min:%2eflush */](async);\r\n }\r\n });\r\n };\r\n _self.loadAppInsights = function (legacyMode, logger, notificationManager) {\r\n if (legacyMode === void 0) { legacyMode = false; }\r\n if (legacyMode) {\r\n throwUnsupported(\"Legacy Mode is no longer supported\");\r\n }\r\n function _updateSnippetProperties(snippet) {\r\n if (snippet) {\r\n var snippetVer = \"\";\r\n if (!isNullOrUndefined(_snippetVersion)) {\r\n snippetVer += _snippetVersion;\r\n }\r\n if (_self[_DYN_CONTEXT /* @min:%2econtext */] && _self[_DYN_CONTEXT /* @min:%2econtext */].internal) {\r\n _self[_DYN_CONTEXT /* @min:%2econtext */].internal.snippetVer = snippetVer || \"-\";\r\n }\r\n // apply updated properties to the global instance (snippet)\r\n objForEachKey(_self, function (field, value) {\r\n if (isString(field) &&\r\n !isFunction(value) &&\r\n field && field[0] !== \"_\" && // Don't copy \"internal\" values\r\n arrIndexOf(_ignoreUpdateSnippetProperties, field) === -1) {\r\n if (snippet[field] !== value) {\r\n snippet[field] = value;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n doPerf(_self.core, function () { return \"AISKU.loadAppInsights\"; }, function () {\r\n // initialize core\r\n _core.initialize(_config, [_sender, properties, dependencies, _analyticsPlugin, _cfgSyncPlugin], logger, notificationManager);\r\n objDefine(_self, \"context\", {\r\n g: function () { return properties[_DYN_CONTEXT /* @min:%2econtext */]; }\r\n });\r\n if (!_throttleMgr) {\r\n _throttleMgr = new ThrottleMgr(_core);\r\n }\r\n var sdkSrc = _findSdkSourceFile();\r\n if (sdkSrc && _self[_DYN_CONTEXT /* @min:%2econtext */]) {\r\n _self[_DYN_CONTEXT /* @min:%2econtext */].internal.sdkSrc = sdkSrc;\r\n }\r\n _updateSnippetProperties(_self[STR_SNIPPET /* @min:%2esnippet */]);\r\n // Empty queue of all api calls logged prior to sdk download\r\n _self.emptyQueue();\r\n _self[STR_POLL_INTERNAL_LOGS /* @min:%2epollInternalLogs */]();\r\n _self[_DYN_ADD_HOUSEKEEPING_BEF1 /* @min:%2eaddHousekeepingBeforeUnload */](_self);\r\n _addUnloadHook(onConfigChange(cfgHandler, function () {\r\n var defaultEnable = false;\r\n if (_config.throttleMgrCfg[109 /* _eInternalMessageId.DefaultThrottleMsgKey */]) {\r\n defaultEnable = !_config.throttleMgrCfg[109 /* _eInternalMessageId.DefaultThrottleMsgKey */].disabled;\r\n }\r\n if (!_throttleMgr.isReady() && _config.extensionConfig && _config.extensionConfig[_cfgSyncPlugin.identifier] && defaultEnable) {\r\n // set ready state to true will automatically trigger flush()\r\n _throttleMgr.onReadyState(true);\r\n }\r\n if (!_iKeySentMessage && !_config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */] && isFeatureEnabled(IKEY_USAGE, _config)) {\r\n _throttleMgr[_DYN_SEND_MESSAGE /* @min:%2esendMessage */](106 /* _eInternalMessageId.InstrumentationKeyDeprecation */, \"See Instrumentation key support at aka.ms/IkeyMigrate\");\r\n _iKeySentMessage = true;\r\n }\r\n if (!_cdnSentMessage && _self[_DYN_CONTEXT /* @min:%2econtext */].internal.sdkSrc && _self[_DYN_CONTEXT /* @min:%2econtext */].internal.sdkSrc.indexOf(\"az416426\") != -1 && isFeatureEnabled(CDN_USAGE, _config)) {\r\n _throttleMgr[_DYN_SEND_MESSAGE /* @min:%2esendMessage */](110 /* _eInternalMessageId.CdnDeprecation */, \"See Cdn support notice at aka.ms/JsActiveCdn\");\r\n _cdnSentMessage = true;\r\n }\r\n if (!_sdkVerSentMessage && parseInt(_snippetVersion) < 6 && isFeatureEnabled(SDK_LOADER_VER, _config)) {\r\n _throttleMgr[_DYN_SEND_MESSAGE /* @min:%2esendMessage */](111 /* _eInternalMessageId.SdkLdrUpdate */, \"An updated Sdk Loader is available, see aka.ms/SnippetVer\");\r\n _sdkVerSentMessage = true;\r\n }\r\n }));\r\n });\r\n return _self;\r\n };\r\n _self[_DYN_UPDATE_SNIPPET_DEFIN2 /* @min:%2eupdateSnippetDefinitions */] = function (snippet) {\r\n // apply full appInsights to the global instance\r\n // Note: This must be called before loadAppInsights is called\r\n proxyAssign(snippet, _self, function (name) {\r\n // Not excluding names prefixed with \"_\" as we need to proxy some functions like _onError\r\n return name && arrIndexOf(_ignoreUpdateSnippetProperties, name) === -1;\r\n });\r\n };\r\n _self.emptyQueue = function () {\r\n // call functions that were queued before the main script was loaded\r\n try {\r\n if (isArray(_self.snippet[_DYN_QUEUE /* @min:%2equeue */])) {\r\n // note: do not check length in the for-loop conditional in case something goes wrong and the stub methods are not overridden.\r\n var length_1 = _self.snippet[_DYN_QUEUE /* @min:%2equeue */].length;\r\n for (var i = 0; i < length_1; i++) {\r\n var call = _self.snippet[_DYN_QUEUE /* @min:%2equeue */][i];\r\n call();\r\n }\r\n _self.snippet[_DYN_QUEUE /* @min:%2equeue */] = undefined;\r\n delete _self.snippet[_DYN_QUEUE /* @min:%2equeue */];\r\n }\r\n }\r\n catch (exception) {\r\n var properties_1 = {};\r\n if (exception && isFunction(exception.toString)) {\r\n properties_1.exception = exception.toString();\r\n }\r\n // need from core\r\n // Microsoft.ApplicationInsights._InternalLogging.throwInternal(\r\n // eLoggingSeverity.WARNING,\r\n // _eInternalMessageId.FailedToSendQueuedTelemetry,\r\n // \"Failed to send queued telemetry\",\r\n // properties);\r\n }\r\n };\r\n _self[_DYN_ADD_HOUSEKEEPING_BEF1 /* @min:%2eaddHousekeepingBeforeUnload */] = function (appInsightsInstance) {\r\n // Add callback to push events when the user navigates away\r\n if (hasWindow() || hasDocument()) {\r\n var performHousekeeping_1 = function () {\r\n // Adds the ability to flush all data before the page unloads.\r\n // Note: This approach tries to push a sync request with all the pending events onbeforeunload.\r\n // Firefox does not respect this.Other browsers DO push out the call with < 100% hit rate.\r\n // Telemetry here will help us analyze how effective this approach is.\r\n // Another approach would be to make this call sync with a acceptable timeout to reduce the\r\n // impact on user experience.\r\n // appInsightsInstance.context._sender.triggerSend();\r\n appInsightsInstance[_DYN_ONUNLOAD_FLUSH /* @min:%2eonunloadFlush */](false);\r\n // Back up the current session to local storage\r\n // This lets us close expired sessions after the cookies themselves expire\r\n if (isFunction(_self.core[STR_GET_PLUGIN /* @min:%2egetPlugin */])) {\r\n var loadedPlugin = _this.core[STR_GET_PLUGIN /* @min:%2egetPlugin */](PropertiesPluginIdentifier);\r\n if (loadedPlugin) {\r\n var propertiesPlugin = loadedPlugin.plugin;\r\n if (propertiesPlugin && propertiesPlugin[_DYN_CONTEXT /* @min:%2econtext */] && propertiesPlugin[_DYN_CONTEXT /* @min:%2econtext */]._sessionManager) {\r\n propertiesPlugin[_DYN_CONTEXT /* @min:%2econtext */]._sessionManager.backup();\r\n }\r\n }\r\n }\r\n };\r\n var added_1 = false;\r\n if (!_houseKeepingNamespace) {\r\n _houseKeepingNamespace = mergeEvtNamespace(_evtNamespace, _core[STR_EVT_NAMESPACE /* @min:%2eevtNamespace */] && _core[STR_EVT_NAMESPACE /* @min:%2eevtNamespace */]());\r\n }\r\n // Will be recalled if any referenced config properties change\r\n _addUnloadHook(onConfigChange(_config, function (details) {\r\n var coreConfig = details.cfg;\r\n var analyticsPlugin = appInsightsInstance.appInsights;\r\n var ctx = createProcessTelemetryContext(null, coreConfig, analyticsPlugin.core);\r\n var extConfig = ctx.getExtCfg(analyticsPlugin.identifier || AnalyticsPluginIdentifier);\r\n // As we could get recalled, remove any previously registered event handlers first\r\n _removePageEventHandlers();\r\n var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents;\r\n if (!extConfig.disableFlushOnBeforeUnload) {\r\n // Hook the unload event for the document, window and body to ensure that the client events are flushed to the server\r\n // As just hooking the window does not always fire (on chrome) for page navigation's.\r\n if (addPageUnloadEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace)) {\r\n added_1 = true;\r\n }\r\n // We also need to hook the pagehide and visibilitychange events as not all versions of Safari support load/unload events.\r\n if (addPageHideEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace)) {\r\n added_1 = true;\r\n }\r\n // A reactNative app may not have a window and therefore the beforeunload/pagehide events -- so don't\r\n // log the failure in this case\r\n if (!added_1 && !isReactNative()) {\r\n _throwInternal(_core.logger, 1 /* eLoggingSeverity.CRITICAL */, 19 /* _eInternalMessageId.FailedToAddHandlerForOnBeforeUnload */, \"Could not add handler for beforeunload and pagehide\");\r\n }\r\n }\r\n if (!added_1 && !extConfig.disableFlushOnUnload) {\r\n // If we didn't add the normal set then attempt to add the pagehide and visibilitychange only\r\n addPageHideEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace);\r\n }\r\n }));\r\n }\r\n };\r\n _self.getSender = function () {\r\n return _sender;\r\n };\r\n _self.unload = function (isAsync, unloadComplete, cbTimeout) {\r\n var unloadDone = false;\r\n var result;\r\n if (isAsync && !unloadComplete) {\r\n result = createPromise(function (resolve) {\r\n // Set the callback to the promise resolve callback\r\n unloadComplete = resolve;\r\n });\r\n }\r\n function _unloadCallback(unloadState) {\r\n if (!unloadDone) {\r\n unloadDone = true;\r\n _initDefaults();\r\n unloadComplete && unloadComplete(unloadState);\r\n }\r\n }\r\n _self[_DYN_ONUNLOAD_FLUSH /* @min:%2eonunloadFlush */](isAsync);\r\n _removePageEventHandlers();\r\n _core.unload && _core.unload(isAsync, _unloadCallback, cbTimeout);\r\n return result;\r\n };\r\n proxyFunctions(_self, _analyticsPlugin, [\r\n STR_GET_COOKIE_MGR,\r\n STR_TRACK_EVENT,\r\n STR_TRACK_PAGE_VIEW,\r\n \"trackPageViewPerformance\",\r\n STR_TRACK_EXCEPTION,\r\n \"_onerror\",\r\n STR_TRACK_TRACE,\r\n STR_TRACK_METRIC,\r\n STR_START_TRACK_PAGE,\r\n STR_STOP_TRACK_PAGE,\r\n STR_START_TRACK_EVENT,\r\n STR_STOP_TRACK_EVENT\r\n ]);\r\n proxyFunctions(_self, _getCurrentDependencies, [\r\n STR_TRACK_DEPENDENCY_DATA,\r\n \"addDependencyListener\",\r\n \"addDependencyInitializer\"\r\n ]);\r\n proxyFunctions(_self, _core, [\r\n STR_ADD_TELEMETRY_INITIALIZER,\r\n STR_POLL_INTERNAL_LOGS,\r\n \"stopPollingInternalLogs\",\r\n STR_GET_PLUGIN,\r\n \"addPlugin\",\r\n STR_EVT_NAMESPACE,\r\n \"addUnloadCb\",\r\n \"getTraceCtx\",\r\n \"updateCfg\",\r\n \"onCfgChange\"\r\n ]);\r\n proxyFunctions(_self, function () {\r\n var context = properties[_DYN_CONTEXT /* @min:%2econtext */];\r\n return context ? context.user : null;\r\n }, [\r\n STR_SET_AUTHENTICATED_USER_CONTEXT,\r\n STR_CLEAR_AUTHENTICATED_USER_CONTEXT\r\n ]);\r\n // Using a function to support the dynamic adding / removal of plugins, so this will always return the current value\r\n function _getCurrentDependencies() {\r\n return dependencies;\r\n }\r\n function _initDefaults() {\r\n _evtNamespace = createUniqueNamespace(\"AISKU\");\r\n _houseKeepingNamespace = null;\r\n dependencies = null;\r\n properties = null;\r\n _sender = null;\r\n _snippetVersion = null;\r\n _throttleMgr = null;\r\n _iKeySentMessage = false;\r\n _cdnSentMessage = false;\r\n _sdkVerSentMessage = false;\r\n _cfgSyncPlugin = new CfgSyncPlugin();\r\n }\r\n function _removePageEventHandlers() {\r\n // Remove any registered event handlers\r\n if (_houseKeepingNamespace) {\r\n removePageUnloadEventListener(null, _houseKeepingNamespace);\r\n removePageHideEventListener(null, _houseKeepingNamespace);\r\n }\r\n }\r\n function _addUnloadHook(hooks) {\r\n _core.addUnloadHook(hooks);\r\n }\r\n });\r\n }\r\n // Analytics Plugin\r\n /**\r\n * Get the current cookie manager for this instance\r\n */\r\n AppInsightsSku.prototype.getCookieMgr = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Log a user action or other occurrence.\r\n * @param event - event to be sent\r\n * @param customProperties - properties that would be included as part of the event\r\n */\r\n AppInsightsSku.prototype.trackEvent = function (event, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Logs that a page, or similar container was displayed to the user.\r\n * @param pageView - page view to be sent\r\n */\r\n AppInsightsSku.prototype.trackPageView = function (pageView) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Log a bag of performance information via the customProperties field.\r\n * @param pageViewPerformance - performance information to be sent\r\n */\r\n AppInsightsSku.prototype.trackPageViewPerformance = function (pageViewPerformance) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Log an exception that you have caught.\r\n * @param exception - exception to be sent\r\n * @param customProperties - Additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n */\r\n AppInsightsSku.prototype.trackException = function (exception, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Manually send uncaught exception telemetry. This method is automatically triggered\r\n * on a window.onerror event.\r\n * @param exception - The exception to be sent.\r\n */\r\n AppInsightsSku.prototype._onerror = function (exception) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Log a diagnostic scenario such entering or leaving a function.\r\n * @param trace - trace to be sent\r\n * @param customProperties - Additional custom properties to include in the event.\r\n */\r\n AppInsightsSku.prototype.trackTrace = function (trace, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Log a numeric value that is not associated with a specific event. Typically used\r\n * to send regular reports of performance indicators.\r\n *\r\n * To send a single measurement, just use the `name` and `average` fields\r\n * of {@link IMetricTelemetry}.\r\n *\r\n * If you take measurements frequently, you can reduce the telemetry bandwidth by\r\n * aggregating multiple measurements and sending the resulting average and modifying\r\n * the `sampleCount` field of {@link IMetricTelemetry}.\r\n * @param metric - input object argument. Only `name` and `average` are mandatory.\r\n * @param customProperties - Additional custom properties to include in the event.\r\n */\r\n AppInsightsSku.prototype.trackMetric = function (metric, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops,\r\n * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view\r\n * and send the event.\r\n * @param name - A string that idenfities this item, unique within this HTML document. Defaults to the document title.\r\n */\r\n AppInsightsSku.prototype.startTrackPage = function (name) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements.\r\n * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`.\r\n * @param name - The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param url - a relative or absolute URL that identifies the page or other item. Defaults to the window location.\r\n * @param properties - additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n * @param measurements - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n AppInsightsSku.prototype.stopTrackPage = function (name, url, properties, measurements) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsSku.prototype.startTrackEvent = function (name) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Log an extended event that you started timing with `startTrackEvent`.\r\n * @param name - The string you used to identify this event in `startTrackEvent`.\r\n * @param properties - map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.\r\n * @param measurements - map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n AppInsightsSku.prototype.stopTrackEvent = function (name, properties, measurements) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsSku.prototype.addTelemetryInitializer = function (telemetryInitializer) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n // Properties Plugin\r\n /**\r\n * Set the authenticated user id and the account id. Used for identifying a specific signed-in user. Parameters must not contain whitespace or ,;=|\r\n *\r\n * The method will only set the `authenticatedUserId` and `accountId` in the current page view. To set them for the whole session, you should set `storeInCookie = true`\r\n * @param authenticatedUserId - The account ID to set\r\n * @param accountId - The account ID to set\r\n * @param storeInCookie - Whether the values should be set for the whole session\r\n */\r\n AppInsightsSku.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) {\r\n if (storeInCookie === void 0) { storeInCookie = false; }\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Clears the authenticated user id and account id. The associated cookie is cleared, if present.\r\n */\r\n AppInsightsSku.prototype.clearAuthenticatedUserContext = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n // Dependencies Plugin\r\n /**\r\n * Log a dependency call (e.g. ajax)\r\n * @param dependencyData - dependency data object\r\n */\r\n AppInsightsSku.prototype.trackDependencyData = function (dependency) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n // Misc\r\n /**\r\n * Attempt to flush data immediately; If executing asynchronously (the default) and\r\n * you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise`\r\n * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async)\r\n * @param async - send data asynchronously when true\r\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.\r\n * If the caller doesn't return true the caller should assume that it may never be called.\r\n * @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller\r\n * should assume that any provided callback will never be called, Nothing or if occurring asynchronously a\r\n * [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete,\r\n * the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided\r\n * and async is true.\r\n */\r\n AppInsightsSku.prototype.flush = function (async, callBack) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\r\n * Fall back to xhr sender if beacon is not supported.\r\n * @param [async=true]\r\n */\r\n AppInsightsSku.prototype.onunloadFlush = function (async) {\r\n if (async === void 0) { async = true; }\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Initialize this instance of ApplicationInsights\r\n * @returns {IApplicationInsights}\r\n * @param legacyMode - MUST always be false, it is no longer supported from v3.x onwards\r\n */\r\n AppInsightsSku.prototype.loadAppInsights = function (legacyMode, logger, notificationManager) {\r\n if (legacyMode === void 0) { legacyMode = false; }\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Overwrite the lazy loaded fields of global window snippet to contain the\r\n * actual initialized API methods\r\n * @param snippet - The global snippet\r\n */\r\n AppInsightsSku.prototype.updateSnippetDefinitions = function (snippet) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Call any functions that were queued before the main script was loaded\r\n */\r\n AppInsightsSku.prototype.emptyQueue = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsSku.prototype.pollInternalLogs = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsSku.prototype.stopPollingInternalLogs = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsSku.prototype.addHousekeepingBeforeUnload = function (appInsightsInstance) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsSku.prototype.getSender = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered\r\n * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous\r\n * unload call return `true` stating that all plugins reported that they also unloaded, the recommended\r\n * approach is to create a new instance and initialize that instance.\r\n * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable\r\n * to successfully remove any global references or they may just be completing the unload process asynchronously.\r\n * If you pass isAsync as true and do not provide\r\n * If you pass isAsync as `true` (also the default) and DO NOT pass a callback function then an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * will be returned which will resolve once the unload is complete. The actual implementation of the `IPromise`\r\n * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async)\r\n * @param isAsync - Can the unload be performed asynchronously (default)\r\n * @param unloadComplete - An optional callback that will be called once the unload has completed\r\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the\r\n * unload. Defaults to 5 seconds.\r\n * @returns Nothing or if occurring asynchronously a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * which will be resolved once the unload is complete, the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * will only be returned when no callback is provided and isAsync is true\r\n */\r\n AppInsightsSku.prototype.unload = function (isAsync, unloadComplete, cbTimeout) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n AppInsightsSku.prototype.getPlugin = function (pluginIdentifier) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Add a new plugin to the installation\r\n * @param plugin - The new plugin to add\r\n * @param replaceExisting - should any existing plugin be replaced, default is false\r\n * @param doAsync - Should the add be performed asynchronously\r\n * @param addCb - [Optional] callback to call after the plugin has been added\r\n */\r\n AppInsightsSku.prototype.addPlugin = function (plugin, replaceExisting, doAsync, addCb) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Update the configuration used and broadcast the changes to all loaded plugins\r\n * @param newConfig - The new configuration is apply\r\n * @param mergeExisting - Should the new configuration merge with the existing or just replace it. Default is to merge.\r\n */\r\n AppInsightsSku.prototype.updateCfg = function (newConfig, mergeExisting) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Returns the unique event namespace that should be used\r\n */\r\n AppInsightsSku.prototype.evtNamespace = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Add an unload handler that will be called when the SDK is being unloaded\r\n * @param handler - the handler\r\n */\r\n AppInsightsSku.prototype.addUnloadCb = function (handler) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you\r\n * to access the headers and modify the values used to generate the distributed tracing correlation headers. (added in v2.8.4)\r\n * @param dependencyListener - The Telemetry Initializer function\r\n * @returns - A IDependencyListenerHandler to enable the initializer to be removed\r\n */\r\n AppInsightsSku.prototype.addDependencyListener = function (dependencyListener) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Add an dependency telemetry initializer callback function to allow populating additional properties or drop the request.\r\n * It is called after the dependency call has completed and any available performance details are available. A dependency\r\n * initializer is similar to the TelemetryInitializer function but it allows you to block the reporting of the dependency\r\n * request so that it doesn't count against the `maxAjaxCallsPerView`.\r\n * @param dependencyInitializer - The Dependency Telemetry Initializer function\r\n * @returns - A IDependencyInitializerHandler to enable the initializer to be removed\r\n */\r\n AppInsightsSku.prototype.addDependencyInitializer = function (dependencyInitializer) {\r\n return null;\r\n };\r\n /**\r\n * Gets the current distributed trace context for this instance if available\r\n */\r\n AppInsightsSku.prototype.getTraceCtx = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Watches and tracks changes for accesses to the current config, and if the accessed config changes the\r\n * handler will be recalled.\r\n * @param handler - The handler to call when the config changes\r\n * @returns A watcher handler instance that can be used to remove itself when being unloaded\r\n */\r\n AppInsightsSku.prototype.onCfgChange = function (handler) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return AppInsightsSku;\r\n}());\r\nexport { AppInsightsSku };\r\n// tslint:disable-next-line\r\nexport function _findSdkSourceFile() {\r\n if (_internalSdkSrc) {\r\n // Use the cached value\r\n return _internalSdkSrc;\r\n }\r\n var sdkSrc = null;\r\n var isModule = false;\r\n var cdns = [\r\n \"://js.monitor.azure.com/\",\r\n \"://az416426.vo.msecnd.net/\"\r\n ];\r\n try {\r\n // Try and determine whether the sdk is being loaded from the CDN\r\n // currentScript is only valid during initial processing\r\n var scrpt = (document || {}).currentScript;\r\n if (scrpt) {\r\n sdkSrc = scrpt.src;\r\n // } else {\r\n // // We need to update to at least typescript 2.9 for this to work :-(\r\n // // Leaving as a stub for now so after we upgrade this breadcrumb is available\r\n // let meta = import.meta;\r\n // sdkSrc = (meta || {}).url;\r\n // isModule = true;\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n if (sdkSrc) {\r\n try {\r\n var url_1 = sdkSrc.toLowerCase();\r\n if (url_1) {\r\n var src_1 = \"\";\r\n arrForEach(cdns, function (value, idx) {\r\n if (strIndexOf(url_1, value) !== -1) {\r\n src_1 = \"cdn\" + (idx + 1);\r\n if (strIndexOf(url_1, \"/scripts/\") === -1) {\r\n if (strIndexOf(url_1, \"/next/\") !== -1) {\r\n src_1 += \"-next\";\r\n }\r\n else if (strIndexOf(url_1, \"/beta/\") !== -1) {\r\n src_1 += \"-beta\";\r\n }\r\n }\r\n _internalSdkSrc = src_1 + (isModule ? \".mod\" : \"\");\r\n return -1;\r\n }\r\n });\r\n }\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n // Cache the found value so we don't have to look it up again\r\n _internalSdkSrc = sdkSrc;\r\n }\r\n return _internalSdkSrc;\r\n}\r\n//# sourceMappingURL=AISku.js.map","import { throwUnsupported } from \"@nevware21/ts-utils\";\r\nimport { AppInsightsSku } from \"./AISku\";\r\nimport { _DYN_UPDATE_SNIPPET_DEFIN2 } from \"./__DynamicConstants\";\r\nvar ApplicationInsightsContainer = /** @class */ (function () {\r\n function ApplicationInsightsContainer() {\r\n }\r\n ApplicationInsightsContainer.getAppInsights = function (snippet, version) {\r\n var theSku = new AppInsightsSku(snippet);\r\n // Two target scenarios:\r\n // Removed: 1. Customer runs v1 snippet + runtime. If customer updates just cdn location to new SDK, it will run in compat mode so old apis work\r\n // 2. Customer updates to new snippet (that uses cdn location to new SDK. This is same as a new customer onboarding\r\n // and all api signatures are expected to map to new SDK. Note new snippet specifies version\r\n if (version >= 2.0) {\r\n theSku[_DYN_UPDATE_SNIPPET_DEFIN2 /* @min:%2eupdateSnippetDefinitions */](snippet);\r\n theSku.loadAppInsights(false);\r\n return theSku; // default behavior with new snippet\r\n }\r\n throwUnsupported(\"V1 API compatibility is no longer supported\");\r\n };\r\n return ApplicationInsightsContainer;\r\n}());\r\nexport { ApplicationInsightsContainer };\r\n//# sourceMappingURL=ApplicationInsightsContainer.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\nimport { createEnumStyle } from \"../JavaScriptSDK.Enums/EnumHelperFuncs\";\r\nexport var LoggingSeverity = createEnumStyle({\r\n DISABLED: 0 /* eLoggingSeverity.DISABLED */,\r\n CRITICAL: 1 /* eLoggingSeverity.CRITICAL */,\r\n WARNING: 2 /* eLoggingSeverity.WARNING */,\r\n DEBUG: 3 /* eLoggingSeverity.DEBUG */\r\n});\r\n//# sourceMappingURL=LoggingEnums.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { getGlobal, objCreate, objHasOwnProperty, throwTypeError } from \"@nevware21/ts-utils\";\r\n\r\ninterface DynamicGlobalSettings {\r\n /**\r\n * Stores the global options which will also be exposed on the runtime global\r\n */\r\n o: IDynamicProtoOpts,\r\n\r\n /**\r\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\r\n * @ignore\r\n */ \r\n n: number\r\n};\r\n\r\nconst UNDEFINED = \"undefined\";\r\n\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */ \r\nconst Constructor = 'constructor';\r\n\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */ \r\nconst Prototype = 'prototype';\r\n \r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nconst strFunction = 'function';\r\n\r\n/**\r\n * Used to define the name of the instance function lookup table\r\n * @ignore\r\n */ \r\nconst DynInstFuncTable = '_dynInstFuncs';\r\n \r\n/**\r\n * Name used to tag the dynamic prototype function\r\n * @ignore\r\n */ \r\nconst DynProxyTag = '_isDynProxy';\r\n \r\n/**\r\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\r\n * @ignore\r\n */ \r\nconst DynClassName = '_dynClass';\r\n \r\n/**\r\n * Prefix added to the classname to avoid any name clashes with other instance level properties\r\n * @ignore\r\n */ \r\nconst DynClassNamePrefix = '_dynCls$';\r\n \r\n/**\r\n * A tag which is used to check if we have already to attempted to set the instance function if one is not present\r\n * @ignore\r\n */\r\nconst DynInstChkTag = '_dynInstChk';\r\n \r\n/**\r\n * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same \r\n * tag name as the function level but a different const name for readability only.\r\n */\r\nconst DynAllowInstChkTag = DynInstChkTag;\r\n \r\n/**\r\n * The global (imported) instances where the global performance options are stored\r\n */\r\nconst DynProtoDefaultOptions = '_dfOpts';\r\n \r\n/**\r\n * Value used as the name of a class when it cannot be determined\r\n * @ignore\r\n */ \r\nconst UnknownValue = '_unknown_';\r\n \r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nconst str__Proto = \"__proto__\";\r\n \r\n/**\r\n * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist\r\n */\r\nconst DynProtoBaseProto = \"_dyn\" + str__Proto;\r\n\r\n/**\r\n * Runtime Global holder for dynamicProto settings\r\n */\r\nconst DynProtoGlobalSettings = \"__dynProto$Gbl\";\r\n\r\n/**\r\n * Track the current prototype for IE8 as you can't look back to get the prototype\r\n */\r\nconst DynProtoCurrent = \"_dynInstProto\";\r\n \r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nconst strUseBaseInst = 'useBaseInst';\r\n \r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nconst strSetInstFuncs = 'setInstFuncs';\r\n \r\nconst Obj = Object;\r\n\r\n/**\r\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\r\n * @ignore\r\n */\r\nlet _objGetPrototypeOf = Obj[\"getPrototypeOf\"];\r\n\r\n/**\r\n * Pre-lookup to check for the existence of this function\r\n */\r\nlet _objGetOwnProps = Obj[\"getOwnPropertyNames\"];\r\n\r\n// Since 1.1.7 moving these to the runtime global to work around mixed version and module issues\r\n// See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details\r\nlet _gbl = getGlobal();\r\nlet _gblInst: DynamicGlobalSettings = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = {\r\n o: {\r\n [strSetInstFuncs]: true,\r\n [strUseBaseInst]: true\r\n },\r\n n: 1000 // Start new global index @ 1000 so we \"fix\" some cases when mixed with 1.1.6 or earlier\r\n});\r\n\r\n/**\r\n * Helper used to check whether the target is an Object prototype or Array prototype\r\n * @ignore\r\n */ \r\nfunction _isObjectOrArrayPrototype(target:any) {\r\n return target && (target === Obj[Prototype] || target === Array[Prototype]);\r\n}\r\n\r\n/**\r\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\r\n * @ignore\r\n */ \r\nfunction _isObjectArrayOrFunctionPrototype(target:any) {\r\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\r\n}\r\n\r\n/**\r\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\r\n * @ignore\r\n */ \r\nfunction _getObjProto(target:any) {\r\n let newProto;\r\n\r\n if (target) {\r\n // This method doesn't exist in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n return _objGetPrototypeOf(target);\r\n }\r\n\r\n let curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);\r\n\r\n // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class\r\n newProto = target[DynProtoBaseProto] || curProto;\r\n if (!objHasOwnProperty(target, DynProtoBaseProto)) {\r\n // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it\r\n // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class)\r\n delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy\r\n newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];\r\n target[DynProtoCurrent] = curProto;\r\n }\r\n }\r\n\r\n return newProto;\r\n}\r\n\r\n/**\r\n * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6\r\n * are not enumerable.\r\n * @param target \r\n */\r\nfunction _forEachProp(target: any, func: (name: string) => void) {\r\n let props: string[] = [];\r\n if (_objGetOwnProps) {\r\n props = _objGetOwnProps(target);\r\n } else {\r\n for (let name in target) {\r\n if (typeof name === \"string\" && objHasOwnProperty(target, name)) {\r\n props.push(name);\r\n }\r\n }\r\n }\r\n\r\n if (props && props.length > 0) {\r\n for (let lp = 0; lp < props.length; lp++) {\r\n func(props[lp]);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Helper function to check whether the provided function name is a potential candidate for dynamic\r\n * callback and prototype generation.\r\n * @param target The target object, may be a prototype or class object\r\n * @param funcName The function name\r\n * @param skipOwn Skips the check for own property\r\n * @ignore\r\n */\r\nfunction _isDynamicCandidate(target:any, funcName:string, skipOwn:boolean) {\r\n return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName)) && funcName !== str__Proto && funcName !== Prototype);\r\n}\r\n\r\n/**\r\n * Helper to throw a TypeError exception\r\n * @param message the message\r\n * @ignore\r\n */\r\nfunction _throwTypeError(message:string) {\r\n throwTypeError(\"DynamicProto: \" + message);\r\n}\r\n\r\n/**\r\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does \r\n * not return any inherited functions\r\n * @param thisTarget The object to get the instance functions from\r\n * @ignore\r\n */\r\nfunction _getInstanceFuncs(thisTarget:any): any {\r\n // Get the base proto\r\n var instFuncs = objCreate(null);\r\n\r\n // Save any existing instance functions\r\n _forEachProp(thisTarget, (name) => {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\r\n // Create an instance callback for passing the base function to the caller\r\n instFuncs[name] = thisTarget[name];\r\n }\r\n });\r\n\r\n return instFuncs;\r\n}\r\n\r\n/**\r\n * Returns whether the value is included in the array\r\n * @param values The array of values\r\n * @param value The value\r\n */\r\nfunction _hasVisited(values:any[], value:any) {\r\n for (let lp = values.length - 1; lp >= 0; lp--) {\r\n if (values[lp] === value) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\r\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\r\n * @param target The current instance\r\n * @ignore\r\n */\r\nfunction _getBaseFuncs(classProto:any, thisTarget:any, instFuncs:any, useBaseInst:boolean): any {\r\n function _instFuncProxy(target:any, funcHost: any, funcName: string) {\r\n let theFunc = funcHost[funcName];\r\n if (theFunc[DynProxyTag] && useBaseInst) {\r\n // grab and reuse the hosted looking function (if available) otherwise the original passed function\r\n let instFuncTable = target[DynInstFuncTable] || {};\r\n if (instFuncTable[DynAllowInstChkTag] !== false) {\r\n theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;\r\n }\r\n }\r\n\r\n return function() {\r\n // eslint-disable-next-line prefer-rest-params\r\n return theFunc.apply(target, arguments);\r\n };\r\n }\r\n\r\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\r\n var baseFuncs = objCreate(null);\r\n _forEachProp(instFuncs, (name) => {\r\n // Create an instance callback for passing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);\r\n });\r\n \r\n // Get the base prototype functions\r\n var baseProto = _getObjProto(classProto);\r\n let visited:any[] = [];\r\n\r\n // Don't include base object functions for Object, Array or Function\r\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\r\n // look for prototype functions\r\n _forEachProp(baseProto, (name) => {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \r\n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\r\n // the Object prototype methods while bypassing the check\r\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\r\n // Create an instance callback for passing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);\r\n }\r\n });\r\n\r\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(baseProto);\r\n baseProto = _getObjProto(baseProto);\r\n }\r\n\r\n return baseFuncs;\r\n}\r\n\r\nfunction _getInstFunc(target: any, funcName: string, proto: any, currentDynProtoProxy: any) {\r\n let instFunc = null;\r\n\r\n // We need to check whether the class name is defined directly on this prototype otherwise\r\n // it will walk the proto chain and return any parent proto classname.\r\n if (target && objHasOwnProperty(proto, DynClassName)) {\r\n\r\n let instFuncTable = target[DynInstFuncTable] || objCreate(null);\r\n instFunc = (instFuncTable[proto[DynClassName]] || objCreate(null))[funcName];\r\n\r\n if (!instFunc) {\r\n // Avoid stack overflow from recursive calling the same function\r\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\r\n }\r\n\r\n // We have the instance function, lets check it we can speed up further calls\r\n // by adding the instance function back directly on the instance (avoiding the dynamic func lookup)\r\n if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {\r\n // If the instance already has an instance function we can't replace it\r\n let canAddInst = !objHasOwnProperty(target, funcName);\r\n\r\n // Get current prototype\r\n let objProto = _getObjProto(target);\r\n let visited:any[] = [];\r\n\r\n // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function\r\n // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut\r\n while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {\r\n let protoFunc = objProto[funcName];\r\n if (protoFunc) {\r\n canAddInst = (protoFunc === currentDynProtoProxy);\r\n break;\r\n }\r\n\r\n // We need to find all possible initial functions to ensure that we don't bypass a valid override function\r\n visited.push(objProto);\r\n objProto = _getObjProto(objProto);\r\n }\r\n\r\n try {\r\n if (canAddInst) {\r\n // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version\r\n // so it's safe to directly assign for any subsequent calls (for better performance)\r\n target[funcName] = instFunc;\r\n }\r\n\r\n // Block further attempts to set the instance function for any\r\n instFunc[DynInstChkTag] = 1;\r\n } catch (e) {\r\n // Don't crash if the object is readonly or the runtime doesn't allow changing this\r\n // And set a flag so we don't try again for any function\r\n instFuncTable[DynAllowInstChkTag] = false;\r\n }\r\n }\r\n }\r\n\r\n return instFunc;\r\n}\r\n\r\nfunction _getProtoFunc(funcName: string, proto: any, currentDynProtoProxy: any) {\r\n let protoFunc = proto[funcName];\r\n\r\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\r\n if (protoFunc === currentDynProtoProxy) {\r\n // It is so lookup the base prototype\r\n protoFunc = _getObjProto(proto)[funcName];\r\n }\r\n\r\n if (typeof protoFunc !== strFunction) {\r\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\r\n }\r\n\r\n return protoFunc;\r\n}\r\n\r\n/**\r\n * Add the required dynamic prototype methods to the the class prototype\r\n * @param proto - The class prototype\r\n * @param className - The instance classname \r\n * @param target - The target instance\r\n * @param baseInstFuncs - The base instance functions\r\n * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist\r\n * @ignore\r\n */\r\nfunction _populatePrototype(proto:any, className:string, target:any, baseInstFuncs:any, setInstanceFunc:boolean) {\r\n function _createDynamicPrototype(proto:any, funcName:string) {\r\n let dynProtoProxy = function() {\r\n // Use the instance or prototype function\r\n let instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);\r\n // eslint-disable-next-line prefer-rest-params\r\n return instFunc.apply(this, arguments);\r\n };\r\n \r\n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\r\n // via which can dynamically replace the prototype function reference)\r\n (dynProtoProxy as any)[DynProxyTag] = 1;\r\n return dynProtoProxy;\r\n }\r\n \r\n if (!_isObjectOrArrayPrototype(proto)) {\r\n let instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || objCreate(null);\r\n if (!_isObjectOrArrayPrototype(instFuncTable)) {\r\n let instFuncs = instFuncTable[className] = (instFuncTable[className] || objCreate(null)); // fetch and assign if as it may not exist yet\r\n\r\n // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable\r\n if (instFuncTable[DynAllowInstChkTag] !== false) {\r\n instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;\r\n }\r\n\r\n if (!_isObjectOrArrayPrototype(instFuncs)) {\r\n _forEachProp(target, (name) => {\r\n // Only add overridden functions\r\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name] ) {\r\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\r\n instFuncs[name] = target[name];\r\n delete target[name];\r\n \r\n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\r\n if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\r\n proto[name] = _createDynamicPrototype(proto, name);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance\r\n * @param classProto The class prototype instance\r\n * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy\r\n * @ignore\r\n */\r\nfunction _checkPrototype(classProto:any, thisTarget:any) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n // As this is primarily a coding time check, don't bother checking if running in IE8 or lower\r\n let visited:any[] = [];\r\n let thisProto = _getObjProto(thisTarget);\r\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {\r\n if (thisProto === classProto) {\r\n return true;\r\n }\r\n\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(thisProto);\r\n thisProto = _getObjProto(thisProto);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n // If objGetPrototypeOf doesn't exist then just assume everything is ok.\r\n return true;\r\n}\r\n\r\n/**\r\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\r\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\r\n * @param target \r\n * @param unknownValue \r\n * @ignore\r\n */\r\nfunction _getObjName(target:any, unknownValue?:string) {\r\n if (objHasOwnProperty(target, Prototype)) {\r\n // Look like a prototype\r\n return target.name || unknownValue || UnknownValue\r\n }\r\n\r\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\r\n}\r\n\r\n/**\r\n * Interface to define additional configuration options to control how the dynamic prototype functions operate.\r\n */\r\nexport interface IDynamicProtoOpts {\r\n\r\n /**\r\n * Should the dynamic prototype attempt to set an instance function for instances that do not already have an\r\n * function of the same name or have been extended by a class with a (non-dynamic proto) prototype function.\r\n */\r\n setInstFuncs: boolean,\r\n\r\n /**\r\n * When looking for base (super) functions if it finds a dynamic proto instances can it use the instance functions\r\n * and bypass the prototype lookups. Defaults to true.\r\n */\r\n useBaseInst?: boolean\r\n}\r\n\r\n/**\r\n * The delegate signature for the function used as the callback for dynamicProto() \r\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid for the proxy instance, even \r\n * though it is only a proxy that only contains the functions \r\n * @param theTarget This is the real \"this\" of the current target object\r\n * @param baseFuncProxy The is a proxy object which ONLY contains this function that existed on the \"this\" instance before\r\n * calling dynamicProto, it does NOT contain properties of this. This is basically equivalent to using the \"super\" keyword.\r\n */\r\nexport type DynamicProtoDelegate = (theTarget:DPType, baseFuncProxy?:DPType) => void;\r\n\r\n/**\r\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\r\n * - Saves references to all defined base class functions\r\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\r\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\r\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is \r\n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\r\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\r\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\r\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\r\n * ### Usage\r\n * ```typescript\r\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\r\n * class ExampleClass extends BaseClass {\r\n * constructor() {\r\n * dynamicProto(ExampleClass, this, (_self, base) => {\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.newFunc = () => {\r\n * // Access any \"this\" instance property \r\n * if (_self.someProperty) {\r\n * ...\r\n * }\r\n * }\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.myFunction = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * // Call the base version of the function that we are overriding\r\n * base.myFunction();\r\n * }\r\n * ...\r\n * }\r\n * _self.initialize = () => {\r\n * ...\r\n * }\r\n * // Warnings: While the following will work as _self is simply a reference to\r\n * // this, if anyone overrides myFunction() the overridden will be called first\r\n * // as the normal JavaScript method resolution will occur and the defined\r\n * // _self.initialize() function is actually gets removed from the instance and\r\n * // a proxy prototype version is created to reference the created method.\r\n * _self.initialize();\r\n * });\r\n * }\r\n * }\r\n * ```\r\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\r\n * @typeparam DPCls The type that contains the prototype of the current class\r\n * @param theClass - This is the current class instance which contains the prototype for the current class\r\n * @param target - The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\r\n * @param delegateFunc - The callback function (closure) that will create the dynamic function\r\n * @param options - Additional options to configure how the dynamic prototype operates\r\n */\r\nexport default function dynamicProto(theClass:DPCls, target:DPType, delegateFunc: DynamicProtoDelegate, options?:IDynamicProtoOpts): void {\r\n // Make sure that the passed theClass argument looks correct\r\n if (!objHasOwnProperty(theClass, Prototype)) {\r\n _throwTypeError(\"theClass is an invalid class definition.\");\r\n }\r\n\r\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\r\n let classProto = theClass[Prototype];\r\n if (!_checkPrototype(classProto, target)) {\r\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] not in hierarchy of [\" + _getObjName(target) + \"]\");\r\n }\r\n\r\n let className = null;\r\n if (objHasOwnProperty(classProto, DynClassName)) {\r\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\r\n className = classProto[DynClassName];\r\n } else {\r\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\r\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\r\n // function table lookup.\r\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _gblInst.n ;\r\n _gblInst.n++;\r\n classProto[DynClassName] = className;\r\n }\r\n\r\n let perfOptions = dynamicProto[DynProtoDefaultOptions];\r\n let useBaseInst = !!perfOptions[strUseBaseInst];\r\n if (useBaseInst && options && options[strUseBaseInst] !== undefined) {\r\n useBaseInst = !!options[strUseBaseInst];\r\n }\r\n\r\n // Get the current instance functions\r\n let instFuncs = _getInstanceFuncs(target);\r\n\r\n // Get all of the functions for any base instance (before they are potentially overridden)\r\n let baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);\r\n\r\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\r\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\r\n delegateFunc(target, baseFuncs as DPType);\r\n\r\n // Don't allow setting instance functions for older IE instances\r\n let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];\r\n if (setInstanceFunc && options) {\r\n setInstanceFunc = !!options[strSetInstFuncs];\r\n }\r\n\r\n // Populate the Prototype for any overridden instance functions\r\n _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);\r\n}\r\n\r\n/**\r\n * Exposes the default global options to allow global configuration, if the global values are disabled these will override\r\n * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose\r\n * their internal usage of dynamic proto.\r\n */\r\ndynamicProto[DynProtoDefaultOptions] = _gblInst.o;\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2024 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal tree shaking helper to return the first available function from the two provided.\r\n * This is required to ensure that tree-shaking can remove any unused functions as this ensures\r\n * that the alias assignments are not considered side-effects and are tagged correctly as pure.\r\n * @param func1 - The system function to use if available\r\n * @param func2 - The polyfill function to use if the static function is not available\r\n * @returns The first available function from the two provided\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _pureAssign(func1: F, func2?: F): F {\r\n return func1 || func2;\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal tree shaking helper to return the value of the named property from the provided object.\r\n * By using this helper, we can explicitly tell the tree-shaking tool that this function is pure and\r\n * has no side effects. As some tree-shaking tools may not be able to determine this automatically.\r\n * @param value - The object to get the property value from\r\n * @param name - The name of the property to get the value of\r\n * @returns The value of the named property from the provided object\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _pureRef(value: T, name: keyof T): R {\r\n return value[name] as R;\r\n}","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { _pureAssign, _pureRef } from \"./treeshake_helpers\";\r\n\r\n// These constants are currently NOT exported directly, we may export them later associated with a frozen namespace (maybe)\r\n// For now do NOT expect that we will export these values.\r\n\r\nexport const UNDEF_VALUE: undefined = undefined;\r\nexport const NULL_VALUE: null = null;\r\n\r\nexport const EMPTY = \"\";\r\nexport const FUNCTION = \"function\";\r\nexport const OBJECT = \"object\";\r\nexport const PROTOTYPE = \"prototype\";\r\nexport const __PROTO__ = \"__proto__\";\r\nexport const UNDEFINED = \"undefined\";\r\nexport const CONSTRUCTOR = \"constructor\";\r\nexport const SYMBOL = \"Symbol\";\r\nexport const POLYFILL_TAG = \"_polyfill\";\r\nexport const LENGTH = \"length\";\r\nexport const NAME = \"name\";\r\nexport const CALL = \"call\";\r\nexport const TO_STRING = \"toString\";\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport const ObjClass = (/*#__PURE__*/_pureAssign(Object));\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport const ObjProto = (/*#__PURE__*/_pureRef(ObjClass, PROTOTYPE));\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport const StrCls = (/*#__PURE__*/_pureAssign(String));\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport const StrProto = (/*#__PURE__*/_pureRef(StrCls, PROTOTYPE)) as String;\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport const MathCls = (/*#__PURE__*/_pureAssign(Math)) as Math;\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport const ArrCls = (/*#__PURE__*/_pureAssign(Array));\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport const ArrProto = (/*#__PURE__*/_pureRef(ArrCls, PROTOTYPE));\r\n\r\n/**\r\n * @ignore\r\n *\r\n */\r\nexport const ArrSlice = (/*#__PURE__*/_pureRef(ArrProto, \"slice\"));","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ArrCls, FUNCTION, NULL_VALUE, OBJECT, ObjProto, TO_STRING, UNDEFINED, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { _pureRef } from \"../internal/treeshake_helpers\";\r\nimport { safeGet } from \"./safe_get\";\r\n\r\nlet _primitiveTypes: string[];\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n * Create and returns a function that will return `true` if the argument passed\r\n * to it matches the provided type.\r\n * @param theType - The type to match against the `typeof value`\r\n * @returns A function which takes a single argument and returns a boolean\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createIs(theType: string): (value: any) => value is T {\r\n return function (value: any): value is T {\r\n return typeof value === theType;\r\n }\r\n}\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n * Create and returns a function that will return `true` if the argument passed\r\n * to it matches the object type specified based on {@link objToString}.\r\n * @param - The object name to match for the `objToString(value)`\r\n * @returns A function which takes a single argument and returns a boolean\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createObjIs(theName: string): (value: any) => value is T {\r\n const theType = \"[object \" + theName + \"]\";\r\n return function (value: any): value is T {\r\n return !!(value && objToString(value) === theType);\r\n }\r\n}\r\n\r\n/**\r\n * The `objToString()` method returns a string representing the object. This explicitly\r\n * always calls the `Object.prototype.toString()` method.\r\n *\r\n * An object's toString() method is most commonly invoked when that object undergoes:\r\n * - explicit type conversion to a string (for example, String(myObject))\r\n * - implicit type coercion into a string (for example, myObject + \"hello world\")\r\n *\r\n * @group Object\r\n * @param value - The object to be converted into a string\r\n * @returns A string representation of the object\r\n * @example\r\n * ```ts\r\n * objToString(new Date()); // [object Date]\r\n * objToString(new String()); // [object String]\r\n *\r\n * // Math has its Symbol.toStringTag\r\n * objToString(Math); // [object Math]\r\n *\r\n * objToString(undefined); // [object Undefined]\r\n * objToString(null); // [object Null]\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function objToString(value: any): string {\r\n return ObjProto[TO_STRING].call(value);\r\n}\r\n\r\n/**\r\n * Validate if the provided value object is of the expected type\r\n * @group Type Identity\r\n * @param value - The value to check\r\n * @param theType - The expected type name as a string\r\n * @returns `true` if the value matches the provided type\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isTypeof(value: any, theType: string): boolean {\r\n return typeof value === theType;\r\n}\r\n\r\n/**\r\n * Checks if the provided value is undefined or contains the string value \"undefined\",\r\n * if you want to consider the string value as undefined see {@link isStrictUndefined}\r\n * @group Type Identity\r\n * @group Value Check\r\n * @param value - The value to check\r\n * @returns true if the value is undefined or \"undefined\", otherwise false\r\n * @example\r\n * ```ts\r\n * isUndefined(undefined); // true\r\n * isUndefined(\"undefined\"); // true\r\n *\r\n * isUndefined(null); // false\r\n * isUndefined(\"null\"); // false\r\n * isUndefined(\"1\"); // false\r\n * isUndefined(\"aa\"); // false\r\n * isUndefined(new Date()); // false\r\n * isUndefined(1); // false\r\n * isUndefined(\"\"); // false\r\n * isUndefined(_dummyFunction); // false\r\n * isUndefined([]); // false\r\n * isUndefined(new Array(1)); // false\r\n * isUndefined(true); // false\r\n * isUndefined(false); // false\r\n * isUndefined(\"true\"); // false\r\n * isUndefined(\"false\"); // false\r\n * isUndefined(new Boolean(true)); // false\r\n * isUndefined(new Boolean(false)); // false\r\n * isUndefined(new Boolean(\"true\")); // false\r\n * isUndefined(new Boolean(\"false\")); // false\r\n * isUndefined(Boolean(true)); // false\r\n * isUndefined(Boolean(false)); // false\r\n * isUndefined(Boolean(\"true\")); // false\r\n * isUndefined(Boolean(\"false\")); // false\r\n * isUndefined(new RegExp(\"\")); // false\r\n * isUndefined(new ArrayBuffer(0)); // false\r\n * isUndefined(new Error(\"Test Error\"));// false\r\n * isUndefined(new TypeError(\"Test TypeError\")); // false\r\n * isUndefined(new TestError(\"Test TestError\")); // false\r\n * isUndefined(_dummyError()); // false\r\n * isUndefined(Promise.reject()); // false\r\n * isUndefined(Promise.resolve()); // false\r\n * isUndefined(new Promise(() => {})); // false\r\n * isUndefined(_simplePromise()); // false\r\n * isUndefined(_simplePromiseLike()); // false\r\n * isUndefined(Object.create(null)); // false\r\n * isUndefined(polyObjCreate(null)); // false\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isUndefined(value: any) {\r\n return typeof value === UNDEFINED || value === UNDEFINED;\r\n}\r\n\r\n/**\r\n * Checks if the provided value is undefined, a string value of \"undefined\" is NOT considered\r\n * to be undefined.\r\n * @group Type Identity\r\n * @group Value Check\r\n * @param arg - The value to check\r\n * @returns true if the typeof value === UNDEFINED\r\n * @example\r\n * ```ts\r\n * isStrictUndefined(undefined); // true\r\n *\r\n * isStrictUndefined(null); // false\r\n * isStrictUndefined(\"null\"); // false\r\n * isStrictUndefined(\"undefined\"); // false\r\n * isStrictUndefined(\"1\"); // false\r\n * isStrictUndefined(\"aa\"); // false\r\n * isStrictUndefined(new Date()); // false\r\n * isStrictUndefined(0); // false\r\n * isStrictUndefined(1); // false\r\n * isStrictUndefined(\"\"); // false\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isStrictUndefined(arg: any): arg is undefined {\r\n return !isDefined(arg);\r\n}\r\n\r\n/**\r\n * Checks if the provided value is null, undefined or contains the string value of \"undefined\".\r\n * @group Type Identity\r\n * @group Value Check\r\n * @param value - The value to check\r\n * @returns `true` if the value is `null` or `undefined`\r\n * @example\r\n * ```ts\r\n * isNullOrUndefined(null); // true\r\n * isNullOrUndefined(undefined); // true\r\n * isNullOrUndefined(\"undefined\"); // true\r\n *\r\n * let value = null;\r\n * isNullOrUndefined(value); // true\r\n * let value = undefined;\r\n * isNullOrUndefined(value); // true\r\n *\r\n * isNullOrUndefined(\"\"); // false\r\n * isNullOrUndefined(0); // false\r\n * isNullOrUndefined(new Date()); // false\r\n * isNullOrUndefined(true); // false\r\n * isNullOrUndefined(false); // false\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isNullOrUndefined(value: any): boolean {\r\n return value === NULL_VALUE || isUndefined(value);\r\n}\r\n\r\n/**\r\n * Checks if the provided value is null, undefined only, a string value of \"undefined\" is NOT considered\r\n * to be undefined.\r\n * @group Type Identity\r\n * @group Value Check\r\n * @param value - The value to check\r\n * @returns\r\n * @example\r\n * ```ts\r\n * isStrictNullOrUndefined(null); // true\r\n * isStrictNullOrUndefined(undefined); // true\r\n * isStrictNullOrUndefined(\"undefined\"); // false\r\n *\r\n * let value = null;\r\n * isStrictNullOrUndefined(value); // true\r\n * let value = undefined;\r\n * isStrictNullOrUndefined(value); // true\r\n *\r\n * isStrictNullOrUndefined(\"\"); // false\r\n * isStrictNullOrUndefined(0); // false\r\n * isStrictNullOrUndefined(new Date()); // false\r\n * isStrictNullOrUndefined(true); // false\r\n * isStrictNullOrUndefined(false); // false\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isStrictNullOrUndefined(value: any): boolean {\r\n return value === NULL_VALUE || !isDefined(value);\r\n}\r\n\r\n/**\r\n * Checks if the passed value is defined, which means it has any value and is not undefined.\r\n * A string value of \"undefined\" is considered to be defined.\r\n * @group Value Check\r\n * @param arg - The value to check\r\n * @returns true if arg has a value (is not === undefined)\r\n * @example\r\n * ```ts\r\n * isDefined(null); // false\r\n * isDefined(undefined); // false\r\n * isDefined(\"undefined\"); // true\r\n *\r\n * let value = null;\r\n * isDefined(value); // false\r\n * let value = undefined;\r\n * isDefined(value); // false\r\n *\r\n * isDefined(\"\"); // true\r\n * isDefined(0); // true\r\n * isDefined(new Date()); // true\r\n * isDefined(true); // true\r\n * isDefined(false); // true\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isDefined(arg: any): boolean {\r\n return !!arg || arg !== UNDEF_VALUE;\r\n}\r\n\r\n/**\r\n * Identifies whether the provided value is a JavaScript [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive)\r\n * which is when is it not an object and has no methods or properties. There are 7 primitive data types:\r\n * - string\r\n * - number\r\n * - bigint\r\n * - boolean\r\n * - undefined\r\n * - null\r\n * - symbol\r\n *\r\n * Most of the time, a primitive value is represented directly at the lowest level of the language implementation.\r\n *\r\n * All primitives are immutable; that is, they cannot be altered. It is important not to confuse a primitive itself\r\n * with a variable assigned a primitive value. The variable may be reassigned to a new value, but the existing value\r\n * can not be changed in the ways that objects, arrays, and functions can be altered. The language does not offer\r\n * utilities to mutate primitive values.\r\n * @since 0.4.4\r\n * @group Type Identity\r\n * @param value - The value to check whether it's a primitive value\r\n * @example\r\n * ```ts\r\n * isPrimitive(null); // true\r\n * isPrimitive(undefined); // true\r\n * isPrimitive(\"null\"); // true\r\n * isPrimitive(\"undefined\"); // true\r\n * isPrimitive(\"1\"); // true\r\n * isPrimitive(\"aa\"); // true\r\n * isPrimitive(1); // true\r\n * isPrimitive(Number(2)); // true\r\n * isPrimitive(\"\"); // true\r\n * isPrimitive(String(\"\")); // true\r\n * isPrimitive(true); // true\r\n * isPrimitive(false); // true\r\n * isPrimitive(\"true\"); // true\r\n * isPrimitive(\"false\"); // true\r\n * isPrimitive(BigInt(42)); // true\r\n * isPrimitive(Symbol.for(\"Hello\")); // true\r\n *\r\n * isPrimitive(new String(\"aa\")); // false\r\n * isPrimitive(new Date()); // false\r\n * isPrimitive(_dummyFunction); // false\r\n * isPrimitive([]); // false\r\n * isPrimitive(new Array(1)); // false\r\n * isPrimitive(new Boolean(true)); // false\r\n * isPrimitive(new Boolean(false)); // false\r\n * isPrimitive(new Boolean(\"true\")); // false\r\n * isPrimitive(new Boolean(\"false\")); // false\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isPrimitive(value: any): value is string | number | bigint | boolean | undefined | symbol | null {\r\n return value === NULL_VALUE || isPrimitiveType(typeof value);\r\n}\r\n\r\n/**\r\n * Identifies whether the provided value is a JavaScript [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive)\r\n * which is when is it not an object and has no methods or properties. There are 6 primitive data types:\r\n * - string\r\n * - number\r\n * - bigint\r\n * - boolean\r\n * - undefined\r\n * - symbol\r\n *\r\n * Most of the time, a primitive value is represented directly at the lowest level of the language implementation.\r\n *\r\n * All primitives are immutable; that is, they cannot be altered. It is important not to confuse a primitive itself\r\n * with a variable assigned a primitive value. The variable may be reassigned to a new value, but the existing value\r\n * can not be changed in the ways that objects, arrays, and functions can be altered. The language does not offer\r\n * utilities to mutate primitive values.\r\n * @since 0.9.6\r\n * @group Type Identity\r\n * @param theType - The type as a string value to be checked whther it's a primitive type, this should be the value\r\n * returned from `typeof value`.\r\n * @example\r\n * ```ts\r\n * isPrimitiveType(null); // false\r\n * isPrimitiveType(undefined); // false\r\n * isPrimitiveType(\"null\"); // false\r\n * isPrimitiveType(\"undefined\"); // false\r\n * isPrimitiveType(\"1\"); // false\r\n * isPrimitiveType(\"aa\"); // false\r\n * isPrimitiveType(1); // false\r\n * isPrimitiveType(Number(2)); // false\r\n * isPrimitiveType(\"\"); // false\r\n * isPrimitiveType(String(\"\")); // false\r\n * isPrimitiveType(true); // false\r\n * isPrimitiveType(false); // false\r\n * isPrimitiveType(\"true\"); // false\r\n * isPrimitiveType(\"false\"); // false\r\n * isPrimitiveType(BigInt(42)); // false\r\n * isPrimitiveType(Symbol.for(\"Hello\")); // false\r\n *\r\n * isPrimitiveType(\"string\"); // true\r\n * isPrimitiveType(\"number\"); // true\r\n * isPrimitiveType(\"boolean\"); // true\r\n * isPrimitiveType(\"undefined\"); // true\r\n * isPrimitiveType(\"symbol\"); // true\r\n * isPrimitiveType(\"bigint\"); // true\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isPrimitiveType(theType: string): boolean {\r\n !_primitiveTypes && (_primitiveTypes = [ \"string\", \"number\", \"boolean\", UNDEFINED, \"symbol\", \"bigint\" ]);\r\n\r\n return !!(theType !== OBJECT && _primitiveTypes.indexOf(theType) !== -1);\r\n}\r\n\r\n/**\r\n * Checks to see if the past value is a string value\r\n * @group Type Identity\r\n * @group String\r\n * @param value - The value to check\r\n * @returns\r\n * @example\r\n * ```ts\r\n * isString(\"\"); // true\r\n * isString(\"null\"); // true\r\n * isString(\"undefined\"); // true\r\n * isString(String(\"\")); // true\r\n *\r\n * isString(null); // false\r\n * isString(undefined); // false\r\n * isString(0); // false\r\n * ```\r\n */\r\nexport const isString: (value: any) => value is string = (/*#__PURE__*/_createIs(\"string\"));\r\n\r\n/**\r\n * Checks to see if the past value is a function value\r\n * @group Type Identity\r\n * @param value - The value to check\r\n * @returns\r\n * @example\r\n * ```ts\r\n * function myFunction() { }\r\n * isFunction(null); // false\r\n * isFunction(undefined); // false\r\n * isFunction(\"null\"); // false\r\n * isFunction(\"undefined\"); // false\r\n * isFunction(\"1\"); // false\r\n * isFunction(\"aa\"); // false\r\n * isFunction(new Date()); // false\r\n * isFunction(1); // false\r\n * isFunction(\"\"); // false\r\n * isFunction(myFunction); // true\r\n * isFunction([]); // false\r\n * isFunction(new Array(1)); // false\r\n * ```\r\n */\r\nexport const isFunction: (value: any) => value is Function = (/*#__PURE__*/_createIs(FUNCTION));\r\n\r\n/**\r\n * Checks to see if the past value is an object value\r\n * @group Type Identity\r\n * @group Object\r\n * @typeParam T - The object type, defaults to any\r\n * @param value - The value to check\r\n * @returns\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isObject(value: T): value is T {\r\n if (!value && isNullOrUndefined(value)) {\r\n return false;\r\n }\r\n\r\n return !!value && typeof value === OBJECT;\r\n}\r\n\r\n/**\r\n * Checks if the type of value is an Array.\r\n *\r\n * @group Type Identity\r\n * @group Array\r\n * @param arg - Value to be checked.\r\n * @return True if the value is a Array, false otherwise.\r\n * @example\r\n * ```ts\r\n * import { isArray, isObject } from \"@nevware21/ts-utils\";\r\n *\r\n * function performAction(value: any) {\r\n * if (isArray(value) || isObject(value)) {\r\n * // Do something\r\n * } else {\r\n * // Do something else\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport const isArray: (arg: any) => arg is Array = (/* #__PURE__*/_pureRef(ArrCls as any, \"isArray\"));\r\n\r\n/**\r\n * Check if an object is of type Date\r\n * @group Type Identity\r\n * @example\r\n * ```ts\r\n * import { isDate } from \"@nevware21/ts-utils\";\r\n *\r\n * let _theDate = null;\r\n *\r\n * function getSetDate(newDate?: any) {\r\n * _theDate = isDate(newDate) ? newDate : new Date();\r\n *\r\n * return _theDate;\r\n * }\r\n * ```\r\n */\r\nexport const isDate: (value: any) => value is Date = (/*#__PURE__*/_createObjIs(\"Date\"));\r\n\r\n/**\r\n * Checks if the type of value is a number.\r\n * @group Type Identity\r\n * @param value - Value to be checked.\r\n * @return True if the value is a number, false otherwise.\r\n */\r\nexport const isNumber: (value: any) => value is number = (/*#__PURE__*/_createIs(\"number\"));\r\n\r\n/**\r\n * Checks if the type of value is a boolean.\r\n * @group Type Identity\r\n * @param value - Value to be checked.\r\n * @return True if the value is a boolean, false otherwise.\r\n */\r\nexport const isBoolean: (value: any) => value is boolean = (/*#__PURE__*/_createIs(\"boolean\"));\r\n\r\n/**\r\n * Determines if a value is a regular expression object.\r\n * @group Type Identity\r\n * @param value - Reference to check.\r\n * @returns True if `value` is a `RegExp`.\r\n */\r\nexport const isRegExp: (value: any) => value is RegExp = (/*#__PURE__*/_createObjIs(\"RegExp\"));\r\n\r\n/**\r\n * Checks if the type of value is a File object.\r\n * @group Type Identity\r\n * @param value - Value to be checked.\r\n * @return True if the value is a File, false otherwise.\r\n */\r\nexport const isFile: (value: any) => value is File = (/*#__PURE__*/_createObjIs(\"File\"));\r\n\r\n/**\r\n * Checks if the type of value is a FormData object.\r\n * @group Type Identity\r\n * @param value - Value to be checked.\r\n * @return True if the value is a FormData, false otherwise.\r\n */\r\nexport const isFormData: (value: any) => value is FormData = (/*#__PURE__*/_createObjIs(\"FormData\"));\r\n\r\n/**\r\n * Checks if the type of value is a Blob object.\r\n * @group Type Identity\r\n * @param value - Value to be checked.\r\n * @return True if the value is a Blob, false otherwise.\r\n */\r\nexport const isBlob: (value: any) => value is Blob = (/*#__PURE__*/_createObjIs(\"Blob\"));\r\n\r\n/**\r\n * Checks if the type of value is a ArrayBuffer object.\r\n * @group Type Identity\r\n * @param value - Value to be checked.\r\n * @return True if the value is a ArrayBuffer, false otherwise.\r\n */\r\nexport const isArrayBuffer: (value: any) => value is ArrayBuffer = (/*#__PURE__*/_createObjIs(\"ArrayBuffer\"));\r\n\r\n/**\r\n * Checks if the type of value is a Error object.\r\n * @group Type Identity\r\n * @group Error\r\n * @param value - Value to be checked.\r\n * @return True if the value is a Error, false otherwise.\r\n */\r\nexport const isError: (value: any) => value is Error = (/*#__PURE__*/_createObjIs(\"Error\"));\r\n\r\n/**\r\n * Checks if the type of value is a PromiseLike instance (contains a then function).\r\n * @group Type Identity\r\n * @param value - Value to be checked.\r\n * @return True if the value is a PromiseLike, false otherwise.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isPromiseLike(value: any): value is PromiseLike {\r\n return !!(value && value.then && isFunction(value.then));\r\n}\r\n\r\n/**\r\n * Checks if the type of value is a PromiseLike instance (contains a then function).\r\n * This is an alias for {@link isPromiseLike}.\r\n * @group Type Identity\r\n * @param value - Value to be checked.\r\n * @return True if the value is a PromiseLike, false otherwise.\r\n */\r\nexport const isThenable: (value: any) => value is PromiseLike = isPromiseLike;\r\n\r\n/**\r\n * Checks if the type of value is a Promise instance (contains then and catch functions).\r\n * @group Type Identity\r\n * @param value - Value to be checked.\r\n * @return True if the value is a Promise, false otherwise.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isPromise(value: any): value is Promise {\r\n return !!(value && value.then && value.catch && isFunction(value.then) && isFunction((value as any).catch));\r\n}\r\n\r\n/**\r\n * Checks if the type of value does not evaluate to true value, handling some special\r\n * case usages of Boolean(true/false) and new Boolean(true/false).\r\n * @group Value Check\r\n * @param value - Value to be checked.\r\n * @return True if the value is not truthy, false otherwise.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isNotTruthy(value: any) {\r\n return !value || !isTruthy(value);\r\n}\r\n\r\n/**\r\n * Checks if the type of value evaluates to true value, handling some special\r\n * case usages of Boolean(true/false) and new Boolean(true/false).\r\n * @group Value Check\r\n * @param value - Value to be checked.\r\n * @return True if the value is not truthy, false otherwise.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isTruthy(value: any) {\r\n // Objects created with no prototype (Object.create(null)) cannot be converted to primitives\r\n // Which causes this code to throw, additionally just using !! also fails for Boolean objects\r\n // !!(new Boolean(false)) evaluates to true\r\n return !(!value || safeGet(() => !(value && (0 + value)), !value));\r\n //return !(!value || !(value && (0 + value)));\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\n/**\r\n * Infers the return type of the specified function\r\n * @since 0.10.5\r\n * @group Safe\r\n * @typeParam T - The type of the function which to infer the return type\r\n */\r\nexport type SafeReturnType any> = T extends (...args: any) => infer R ? R : any\r\n\r\n/**\r\n * Defines the return value of the {@link safe} function, which is an object with either a value or an error\r\n * @since 0.10.5\r\n * @group Safe\r\n * @typeParam T - The type of the function to call\r\n * @typeParam R - The return type of the function\r\n */\r\nexport interface ISafeReturn any> {\r\n /**\r\n * The value returned by the function call\r\n */\r\n v?: SafeReturnType;\r\n\r\n /**\r\n * The error thrown by the function call\r\n */\r\n e?: Error;\r\n}\r\n\r\n/**\r\n * Call the specified function with zero or more individual arguments, the call will be wrapped in a try / catch\r\n * block and the result returned wrapped in an {@link ISafeReturn} instance. If the function call throws an\r\n * exception the {@link ISafeReturn.e | error} property will contain the exception otherwise the {@link ISafeReturn.v | value}\r\n * property will contain the value returned from the function.\r\n * @since 0.10.5\r\n * @group Safe\r\n * @param func - The function to call\r\n * @param argArray - An array of the arguments to pass to the function\r\n * @returns The return value of the function or undefined if an exception is thrown\r\n * @example\r\n * ```ts\r\n * let result = safe((value: string) => {\r\n * return JSON.parse(value);\r\n * }, [\"{ invalid: json value\"]);\r\n *\r\n * // result.e instanceof SyntaxError\r\n *\r\n * let result2 = safe((value: string) => {\r\n * return JSON.parse(value);\r\n * }, [\"{ valid: 'json value' }\"]);\r\n *\r\n * // result2.v === { valid: \"json value\" }\r\n * ```\r\n */\r\nexport function safe any>(func: F, argArray?: any[]): ISafeReturn {\r\n try {\r\n return {\r\n v: func.apply(this, argArray)\r\n };\r\n } catch (e) {\r\n return { e };\r\n }\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { safe } from \"./safe\";\r\n\r\n/**\r\n * Function to safely execute a callback function, if the function throws the provided default\r\n * value will be returned.\r\n * @since 0.9.5\r\n * @group Safe\r\n * @param cb - Callback function be wrapped with an exception\r\n * @param defValue - The default value to return when an exception is thrown\r\n * @returns The result of the callback function or the default if an exception occurred calling the callback\r\n * function.\r\n * @example\r\n * ```ts\r\n * let theExpression = \"{ invalid: json value\";\r\n *\r\n * let result = safeGet(() => {\r\n * return JSON.parse(theExpression);\r\n * }, {});\r\n *\r\n * // result === {};\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function safeGet(cb: () => T, defValue: T): T {\r\n let result = safe(cb);\r\n \r\n return result.e ? defValue : result.v;\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ObjClass } from \"../internal/constants\";\r\nimport { _pureRef } from \"../internal/treeshake_helpers\";\r\n\r\n/**\r\n * The objGetOwnPropertyDescriptor() method returns an object describing the configuration of a specific property on\r\n * a given object (that is, one directly present on an object and not in the object's prototype chain). The object\r\n * returned is mutable but mutating it has no effect on the original property's configuration.\r\n * @since 0.4.3\r\n * @group Object\r\n * @param target - Object that contains the property.\r\n * @param prop - Name of the property.\r\n * @returns A property descriptor of the given property if it exists on the object, otherwise undefined.\r\n *\r\n * @example\r\n * ```ts\r\n * o = {};\r\n * objDefineProp(o, 'qux', {\r\n * value: 8675309,\r\n * writable: false,\r\n * enumerable: false\r\n * });\r\n * d = objGetOwnPropertyDescriptor(o, 'qux');\r\n * // d is {\r\n * // value: 8675309,\r\n * // writable: false,\r\n * // enumerable: false,\r\n * // configurable: false\r\n * // }\r\n *\r\n * objGetOwnPropertyDescriptor('foo', 0);\r\n * // TypeError: \"foo\" is not an object // ES5 code\r\n *\r\n * objGetOwnPropertyDescriptor('foo', 0);\r\n * // Object returned by ES2015 code: {\r\n * // configurable: false,\r\n * // enumerable: true,\r\n * // value: \"f\",\r\n * // writable: false\r\n * // }\r\n * ```\r\n * Note: In ES5, if the first argument to this method is not an object (a primitive), then it will cause a TypeError. In ES2015, a non-object first argument will be coerced to an object at first.\r\n */\r\nexport const objGetOwnPropertyDescriptor: (target: any, prop: PropertyKey) => PropertyDescriptor | undefined = (/* #__PURE__ */_pureRef(ObjClass as any, \"getOwnPropertyDescriptor\"));","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { CALL, ObjProto } from \"../internal/constants\";\r\n\r\n/**\r\n * The objHasOwnProperty() method returns a boolean indicating whether the object\r\n * has the specified property as its own property (as opposed to inheriting it).\r\n *\r\n * The objHasOwnProperty() method returns true if the specified property is a direct\r\n * property of the object — even if the value is null or undefined. The method returns\r\n * false if the property is inherited, or has not been declared at all. Unlike the in\r\n * operator, this method does not check for the specified property in the object's\r\n * prototype chain.\r\n *\r\n * The method can be called on most JavaScript objects, because most objects descend\r\n * from Object, and hence inherit its methods. For example Array is an Object, so you\r\n * can use objHasOwnProperty() method to check whether an index exists:\r\n * @group Object\r\n * @param obj - The object being evaluated\r\n * @param prop - The String or Symbol of the property to test\r\n * @returns `true` if the object has the specified property as own property; otherwise `false`\r\n * @example\r\n * ```ts\r\n * let example = {};\r\n * objHasOwnProperty(example, 'prop'); // false\r\n *\r\n * example.prop = 'exists';\r\n * objHasOwnProperty(example, 'prop'); // true - 'prop' has been defined\r\n *\r\n * example.prop = null;\r\n * objHasOwnProperty(example, 'prop'); // true - own property exists with value of null\r\n *\r\n * example.prop = undefined;\r\n * objHasOwnProperty(example, 'prop'); // true - own property exists with value of undefined\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function objHasOwnProperty(obj: T, prop: PropertyKey): boolean {\r\n return !!obj && ObjProto.hasOwnProperty[CALL](obj, prop);\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ObjClass } from \"../internal/constants\";\r\nimport { _pureAssign, _pureRef } from \"../internal/treeshake_helpers\";\r\nimport { objGetOwnPropertyDescriptor } from \"./get_own_prop_desc\";\r\nimport { objHasOwnProperty } from \"./has_own_prop\";\r\n\r\n/**\r\n * The objHasOwn() method returns a boolean indicating whether the object\r\n * has the specified property as its own property (as opposed to inheriting it).\r\n * If the property is inherited, or does not exist, the method returns false.\r\n *\r\n * The objHasOwn() method returns true if the specified property is a direct property\r\n * of the object — even if the property value is null or undefined. The method returns\r\n * false if the property is inherited, or has not been declared at all. Unlike the in operator,\r\n * this method does not check for the specified property in the object's prototype chain.\r\n *\r\n * It is recommended over {@link objHasOwnProperty} () because it works for objects created using\r\n * objCreate(null) and with objects that have overridden the inherited hasOwnProperty() method.\r\n * While it is possible to workaround these problems by calling Object.prototype.hasOwnProperty()\r\n * on an external object, Object.hasOwn() is more intuitive.\r\n *\r\n * @since 0.4.3\r\n * @group Object\r\n * @param obj - The object being evaluated\r\n * @param prop - The String or Symbol of the property to test\r\n * @returns `true` if the object has the specified property as own property; otherwise `false`\r\n * @example\r\n * ```ts\r\n * let example = {};\r\n * objHasOwn(example, 'prop'); // false\r\n *\r\n * example.prop = 'exists';\r\n * objHasOwn(example, 'prop'); // true - 'prop' has been defined\r\n *\r\n * example.prop = null;\r\n * objHasOwn(example, 'prop'); // true - own property exists with value of null\r\n *\r\n * example.prop = undefined;\r\n * objHasOwn(example, 'prop'); // true - own property exists with value of undefined\r\n * ```\r\n */\r\nexport const objHasOwn: (obj: T, prop: PropertyKey) => boolean = (/*#__PURE__*/_pureAssign((/* #__PURE__ */_pureRef(ObjClass as any, \"hasOwn\")), polyObjHasOwn));\r\n\r\n/**\r\n * The polyObjHasOwn() method is a polyfill for {@link objHasOwn} when the native\r\n * [Object.hasOwnreturns](https://caniuse.com/?search=hasOwn) is not supported, it returns a\r\n * boolean indicating whether the object has the specified property as its own property (as\r\n * opposed to inheriting it). If the property is inherited, or does not exist, the method\r\n * returns false.\r\n *\r\n * The objHasOwn() method returns true if the specified property is a direct property\r\n * of the object — even if the property value is null or undefined. The method returns\r\n * false if the property is inherited, or has not been declared at all. Unlike the in operator,\r\n * this method does not check for the specified property in the object's prototype chain.\r\n *\r\n * It is recommended over objHasOwnProperty() because it works for objects created using\r\n * objCreate(null) and with objects that have overridden the inherited hasOwnProperty() method.\r\n * While it is possible to workaround these problems by calling Object.prototype.hasOwnProperty()\r\n * on an external object, Object.hasOwn() is more intuitive.\r\n *\r\n * @since 0.4.3\r\n * @group Object\r\n * @group Polyfill\r\n * @param obj - The object being evaluated\r\n * @param prop - The String or Symbol of the property to test\r\n * @returns `true` if the object has the specified property as own property; otherwise `false`\r\n * @example\r\n * ```ts\r\n * let example = {};\r\n * polyObjHasOwn(example, 'prop'); // false\r\n *\r\n * example.prop = 'exists';\r\n * polyObjHasOwn(example, 'prop'); // true - 'prop' has been defined\r\n *\r\n * example.prop = null;\r\n * polyObjHasOwn(example, 'prop'); // true - own property exists with value of null\r\n *\r\n * example.prop = undefined;\r\n * polyObjHasOwn(example, 'prop'); // true - own property exists with value of undefined\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function polyObjHasOwn(obj: T, prop: PropertyKey): boolean {\r\n return objHasOwnProperty(obj, prop) || !!objGetOwnPropertyDescriptor(obj, prop)\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { isObject } from \"../helpers/base\";\r\nimport { CALL } from \"../internal/constants\";\r\nimport { objHasOwn } from \"./has_own\";\r\n\r\n/**\r\n * Calls the provided `callbackFn` function once for each key in an object. This is equivelent to `arrForEach(Object.keys(theObject), callbackFn)` or\r\n * if not using the array helper `Object.keys(theObject).forEach(callbackFn)` except that this helper avoid creating a temporary of the object\r\n * keys before iterating over them and like the `arrForEach` helper you CAN stop or break the iteration by returning -1 from the `callbackFn` function.\r\n * @group Object\r\n * @typeParam T - The object type\r\n * @param callbackfn - A function that accepts up to two arguments, the key name and the current value of the property represented by the key.\r\n * @param thisArg - [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, null or undefined\r\n * the object will be used as the this value.\r\n * @example\r\n * ```ts\r\n * function performAction(target: T, source: any) {\r\n * if (!isNullOrUndefined(source)) {\r\n * objForEachKey(source, (key, value) => {\r\n * // Set the target with a reference to the same value with the same name\r\n * target[key] = value;\r\n * });\r\n * }\r\n *\r\n * return target;\r\n * }\r\n * ```\r\n */\r\nexport function objForEachKey(theObject: T, callbackfn: (key: string, value: T[keyof T]) => void | number, thisArg?: any): void {\r\n if (theObject && isObject(theObject)) {\r\n for (const prop in theObject) {\r\n if (objHasOwn(theObject, prop)) {\r\n if (callbackfn[CALL](thisArg || theObject, prop, theObject[prop]) === -1) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ObjClass } from \"../internal/constants\";\r\nimport { isFunction, isStrictUndefined } from \"../helpers/base\";\r\nimport { objForEachKey } from \"./for_each_key\";\r\nimport { ILazyValue } from \"../helpers/lazy\";\r\nimport { objGetOwnPropertyDescriptor } from \"./get_own_prop_desc\";\r\nimport { _pureRef } from \"../internal/treeshake_helpers\";\r\n\r\n/**\r\n * Definition of the Property Descriptor mappings for the objDefine functions.\r\n * If a descriptor has neither of value, writable, get and set keys, it is treated as a data descriptor.\r\n * If a descriptor has both [value or writable] and [get or set] keys, an exception is thrown.\r\n * Bear in mind that these attributes are not necessarily the descriptor's own properties. Inherited\r\n * properties will be considered as well. In order to ensure these defaults are preserved, you might\r\n * freeze existing objects in the descriptor object's prototype chain upfront, specify all options\r\n * explicitly, or point to null with {@link objCreate}(null).\r\n * @since 0.6.0\r\n * @group Object\r\n */\r\nexport interface ObjDefinePropDescriptor {\r\n /**\r\n * Identifies if this property should be configurable (true) when this value is set to false,\r\n * - the type of this property cannot be changed between data property and accessor property, and\r\n * - the property may not be deleted, and\r\n * - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with writable: true,\r\n * the value can be changed, and writable can be changed to false).\r\n * Defaults to true.\r\n */\r\n c?: boolean;\r\n\r\n /**\r\n * Identifies if this property will be visible during enumeration of the properties on the corresponding object.\r\n * Defaults to true.\r\n */\r\n e?: boolean;\r\n\r\n /**\r\n * __data descriptor__\r\n * The value associated with the property. Can be any valid JavaScript value (number, object, function, etc.).\r\n * Defaults to undefined.\r\n */\r\n v?: V;\r\n\r\n /**\r\n * A Lazy value instance which will be used to return the value, this will be wrapped in a getter function.\r\n * @since 0.9.4\r\n */\r\n l?: ILazyValue;\r\n\r\n /**\r\n * true if the value associated with the property may be changed with an assignment operator. Defaults to false.\r\n */\r\n w?: boolean;\r\n\r\n /**\r\n * A function which serves as a getter for the property, or undefined if there is no getter. When the property\r\n * is accessed, this function is called without arguments and with this set to the object through which the\r\n * property is accessed (this may not be the object on which the property is defined due to inheritance). The\r\n * return value will be used as the value of the property. Defaults to undefined.\r\n */\r\n g?(): V;\r\n\r\n /**\r\n * A function which serves as a setter for the property, or undefined if there is no setter. When the property\r\n * is assigned, this function is called with one argument (the value being assigned to the property) and with\r\n * this set to the object through which the property is assigned. Defaults to undefined.\r\n * @param value - The value to set the property to.\r\n */\r\n s?(value: V): void;\r\n}\r\n\r\n/**\r\n * An object whose keys represent the names of properties to be defined or modified and whose values are objects\r\n * describing those properties. Each value in props must be either a data descriptor or an accessor descriptor;\r\n * it cannot be both (see {@link ObjDefinePropDescriptor} for more details).\r\n * @since 0.6.0\r\n * @group Object\r\n */\r\nexport type ObjDefinePropDescriptorMap = {\r\n [key: PropertyKey]: ObjDefinePropDescriptor\r\n};\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Mapping from ObjDefinePropDescriptor key to PropertyDescriptor key\r\n */\r\nconst propMap: { [key in keyof ObjDefinePropDescriptor]: keyof PropertyDescriptor } = {\r\n e: \"enumerable\",\r\n c: \"configurable\",\r\n v: \"value\",\r\n w: \"writable\",\r\n g: \"get\",\r\n s: \"set\"\r\n};\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Helper to convert ObjDefinePropDescriptor into PropertyDescriptor\r\n * @param value - The prop descriptor to convert\r\n * @returns\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nfunction _createProp(value: ObjDefinePropDescriptor): PropertyDescriptor {\r\n let prop: PropertyDescriptor = {};\r\n prop[propMap[\"c\"]] = true;\r\n prop[propMap[\"e\"]] = true;\r\n\r\n if (value.l) {\r\n // Asign a getter function to return the value when requested\r\n prop.get = () => value.l.v;\r\n\r\n // If it has a setter then expose it as well\r\n let desc = objGetOwnPropertyDescriptor(value.l, \"v\");\r\n if (desc && desc.set) {\r\n prop.set = (newValue: any) => {\r\n value.l.v = newValue;\r\n };\r\n }\r\n }\r\n\r\n objForEachKey(value, (key: keyof ObjDefinePropDescriptor, value) => {\r\n prop[propMap[key]] = isStrictUndefined(value) ? prop[propMap[key]] : value;\r\n });\r\n\r\n return prop;\r\n}\r\n\r\n/**\r\n * Defines a new property directly on an object, or modifies an existing property on an object, and returns the object.\r\n * This is a wrapper for [Object.defineProperty](https://developer.mozilla.org/en-US/docs/web/javascript/reference/global_objects/object/defineproperty)\r\n *\r\n * This method allows a precise addition to or modification of a property on an object. Normal property addition through\r\n * assignment creates properties which show up during property enumeration (for...in loop or objKeys method), whose\r\n * values may be changed, and which may be deleted. This method allows these extra details to be changed from their\r\n * defaults. By default, properties added using objDefineProp() are not writable, not enumerable, and not configurable.\r\n *\r\n * Property descriptors present in objects come in two main flavors: data descriptors and accessor descriptors. A data\r\n * descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property\r\n * described by a getter-setter pair of functions. A descriptor must be one of these two flavors; it cannot be both.\r\n *\r\n * This is an alias for Object.defineProperty\r\n * @group Object\r\n * @param target - The object on which to define the property.\r\n * @param key - The name or Symbol of the property to be defined or modified.\r\n * @param descriptor - The descriptor for the property being defined or modified.\r\n * @returns The object that was passed to the function with the new or updated property.\r\n */\r\nexport const objDefineProp: (target: T, key: PropertyKey, descriptor: PropertyDescriptor & ThisType) => T = (/*#__PURE__*/_pureRef(ObjClass as any, \"defineProperty\"));\r\n\r\n/**\r\n * The objDefineProperties() method defines new or modifies existing properties directly on an object, returning the object.\r\n * This is a wrapper for [Object.defineProperties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties)\r\n * @since 0.6.0\r\n * @group Object\r\n * @param target - The object on which to define or modify properties.\r\n * @param props - An object whose keys represent the names of properties to be defined or modified and whose values are\r\n * objects describing those properties. Each value in props must be either a data descriptor or an accessor descriptor;\r\n * it cannot be both (see {@link ObjDefinePropDescriptorMap} for more details).\r\n * @returns\r\n */\r\nexport const objDefineProperties: (target: T, props: PropertyDescriptorMap & ThisType) => T = (/*#__PURE__*/_pureRef(ObjClass as any, \"defineProperties\"));\r\n\r\n/**\r\n * Try to define a get object property accessor for the target object, if a function is past as the value this will\r\n * be assumed to be a getter function and NOT the value.\r\n * @deprecated It is recommended that you use {@link objDefine} instead {@link objDefineGet} or {@link objDefineAccessors}\r\n * as it provides a deterministic way for identifying whether the value is a value or a function rather than wrapping any\r\n * function value in another function.\r\n * @group Object\r\n * @param target - The object on which to define the property.\r\n * @param key - The name of the property to be defined or modified\r\n * @param value - The value or a function that returns the value\r\n * @param configurable - Can the value be changed, defaults to true.\r\n * @param enumerable - Should this get property be enumerable, defaults to true.\r\n * @returns The object that was passed to the function\r\n */\r\nexport function objDefineGet(target: T, key: PropertyKey, value: (() => V) | V, configurable?: boolean, enumerable?: boolean): T {\r\n return objDefineProp(target, key, _createProp({\r\n e: enumerable,\r\n c: configurable,\r\n [isFunction(value) ? \"g\" : \"v\"]: value\r\n }));\r\n}\r\n\r\n/**\r\n * Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with\r\n * existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded\r\n * and executed in an ES3 container, providing basic IE8 compatibility.\r\n * @deprecated It is recommended that you use {@link objDefine} instead {@link objDefineAccessors} as this internally creates\r\n * the {@link ObjDefinePropDescriptor} definition based on your provided arguments. And only using a minimum set of functions\r\n * reduces your overall bundle size.\r\n * @group Object\r\n * @param target - The object on which to define the property.\r\n * @param prop - The name of the property to be defined or modified.\r\n * @param getProp - The getter function to wire against the getter.\r\n * @param setProp - The setter function to wire against the setter.\r\n * @param configurable - Can the value be changed, defaults to true\r\n * @param enumerable - Should this get property be enumerable, defaults to true.\r\n * @returns The object that was passed to the function\r\n */\r\nexport function objDefineAccessors(target: T, prop: PropertyKey, getProp?: (() => V) | null, setProp?: ((v: V) => void) | null, configurable?: boolean, enumerable?: boolean): T {\r\n let desc: ObjDefinePropDescriptor = {\r\n e: enumerable,\r\n c: configurable\r\n };\r\n\r\n if (getProp) {\r\n desc.g = getProp;\r\n }\r\n\r\n if (setProp) {\r\n desc.s = setProp;\r\n }\r\n \r\n return objDefineProp(target, prop, _createProp(desc));\r\n}\r\n\r\n/**\r\n * The objDefine() method defines a new or modifies an existing single property accessors for the target object based\r\n * on the configuration defined for the propDesc argument of type {@link ObjDefinePropDescriptor}. This will call\r\n * {@link objDefineProp} after creating the required PropertyDescriptor populating defaults for the propDesc values.\r\n * Note, the default values (true) for `configurable` and `enumerable` are different from the defaults provided by objDefineProp.\r\n * @since 0.6.0\r\n * @group Object\r\n * @param target - The object on which to define the property.\r\n * @param key - The name of the property to be defined or modified\r\n * @param propDesc - An object which defines the Property Descriptor mappings for the mapping.\r\n * @returns The target object.\r\n */\r\nexport function objDefine(target: T, key: keyof T, propDesc: ObjDefinePropDescriptor): T {\r\n return objDefineProp(target, key, _createProp(propDesc));\r\n}\r\n\r\n/**\r\n * The objDefineProps() method defines new or modifies existing properties directly for the target object using the keys\r\n * and configuration from the propDescMap argument. This will call {@link objDefineProperties} after creating the required\r\n * PropertyDescriptorMap from the propDescMap values.\r\n * Note, the default values (true) for `configurable` and `enumerable` are different from the defaults provided by objDefineProperties.\r\n * @since 0.6.0\r\n * @group Object\r\n * @param target - The object on which to define or modify properties.\r\n * @param propDescMap - An object whose keys represent the names of properties to be defined or modified and whose values are\r\n * objects describing those properties. Each value in props must be either a data descriptor or an accessor descriptor;\r\n * it cannot be both (see {@link ObjDefinePropDescriptorMap} for more details).\r\n * @returns The target object.\r\n */\r\nexport function objDefineProps(target: T, propDescMap: ObjDefinePropDescriptorMap) {\r\n let props: PropertyDescriptorMap = {};\r\n\r\n objForEachKey(propDescMap, (key, value: ObjDefinePropDescriptor) => {\r\n props[key] = _createProp(value);\r\n });\r\n\r\n return objDefineProperties(target, props);\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { objDefineProp } from \"../object/define\";\r\nimport { objForEachKey } from \"../object/for_each_key\";\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal constant enum used to identify the mapping values for the _createMap function\r\n */\r\nexport const enum eMapValues {\r\n Key = 0,\r\n Value = 1\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal Helper function to create a key and value mapped representation of the values\r\n * @param values - The source values\r\n * @param keyType - Identifies the value to populate against the key\r\n * @param valueType - Identifies the value to populate against the value\r\n * @param completeFn - The function to call to complete the map (used to freeze the instance)\r\n * @param writable - Flag to indicate if the map should be writable\r\n * @returns\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createKeyValueMap(values: any, keyType: eMapValues, valueType: eMapValues, completeFn?: (value: T) => T, writable?: boolean) {\r\n let theMap: any = {};\r\n objForEachKey(values, (key, value) => {\r\n _assignMapValue(theMap, key, keyType ? value : key, writable);\r\n _assignMapValue(theMap, value, valueType ? value : key, writable);\r\n });\r\n\r\n return completeFn ? completeFn(theMap) : theMap;\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal Helper function to assign a key and value to the map\r\n * @param theMap - The map to assign the key and value to\r\n * @param key - The key to assign\r\n * @param value - The value to assign\r\n * @param writable - Flag to indicate if the map should be writable\r\n */\r\nexport function _assignMapValue(theMap: any, key: any, value: any, writable?: boolean) {\r\n objDefineProp(theMap, key, {\r\n value: value,\r\n enumerable: true,\r\n writable: !!writable\r\n });\r\n}","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { StrCls } from \"../internal/constants\";\r\nimport { _pureAssign } from \"../internal/treeshake_helpers\";\r\n\r\n/**\r\n * The asString() method returns a string representing the value by\r\n * explicitly using `String(`value`)`.\r\n *\r\n * @since 0.4.3\r\n * @group String\r\n * @group Conversion\r\n * @group Value\r\n * @param value - The value to get a string representation of\r\n * @example\r\n * ```ts\r\n * const arr = [ 1, 2, 3];\r\n * asString(arr); // \"1,2,3\"\r\n * asString(null); // \"null\"\r\n * asString(undefined); // \"undefined\"\r\n * asString(42); // \"42\"\r\n * asString(Symbol.for(\"Hello\")); // \"Symbol(Hello)\"\r\n * ```\r\n */\r\nexport const asString: (value: any) => string = (/* #__PURE__ */_pureAssign(StrCls));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { CALL, EMPTY, NULL_VALUE, ObjProto, TO_STRING, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { asString } from \"../string/as_string\";\r\n\r\nconst ERROR_TYPE = \"[object Error]\";\r\n\r\n/**\r\n * Returns string representation of an object suitable for diagnostics logging.\r\n * @group Error\r\n * @group Diagnostic\r\n * @param object - The object to be converted to a diagnostic string value\r\n * @param format - Identifies whether the JSON value should be formated\r\n * - `true` - Format with 4 spaces\r\n * - 'number' - The number of spaces to format with\r\n * - `false` (or not Truthy) - Do not format\r\n * @returns A string representation of the object suitable for diagnostics logging\r\n * @example\r\n * ```ts\r\n * let obj = { a: 1, b: \"Hello\", c: { d: 2, e: \"Darkness\" } };\r\n *\r\n * let objStr = dumpObj(obj);\r\n * // objStr === \"[object Object]: { a: 1, b: \"Hello\", c: { d: 2, e: \"Darkness\" } }\"\r\n *\r\n * let objStrFmt = dumpObj(obj, true);\r\n * // objStrFmt === \"[object Object]: {\\n a: 1,\\n b: \"Hello\",\\n c: {\\n d: 2,\\n e: \"Darkness\"\\n }\\n}\"\r\n *\r\n * let objStrFmt2 = dumpObj(obj, 2);\r\n * // objStrFmt2 === \"[object Object]: {\\n a: 1,\\n b: \"Hello\",\\n c: {\\n d: 2,\\n e: \"Darkness\"\\n }\\n}\"\r\n *\r\n * let objStrFmt3 = dumpObj(obj, 0);\r\n * // objStrFmt3 === \"[object Object]: { a: 1, b: \"Hello\", c: { d: 2, e: \"Darkness\" } }\"\r\n *\r\n * let objStrFmt4 = dumpObj(obj, false);\r\n * // objStrFmt4 === \"[object Object]: { a: 1, b: \"Hello\", c: { d: 2, e: \"Darkness\" } }\"\r\n *\r\n * let objStrFmt5 = dumpObj(obj, null);\r\n * // objStrFmt5 === \"[object Object]: { a: 1, b: \"Hello\", c: { d: 2, e: \"Darkness\" } }\"\r\n *\r\n * let objStrFmt6 = dumpObj(obj, undefined);\r\n * // objStrFmt6 === \"[object Object]: { a: 1, b: \"Hello\", c: { d: 2, e: \"Darkness\" } }\"\r\n *\r\n * let objStrFmt7 = dumpObj(obj, \"\");\r\n * // objStrFmt7 === \"[object Object]: { a: 1, b: \"Hello\", c: { d: 2, e: \"Darkness\" } }\"\r\n *\r\n * let err = new Error(\"Hello Darkness\");\r\n * let errStr = dumpObj(err);\r\n * // errStr === \"[object Error]: { stack: 'Error: Hello Darkness\\n at :1:13', message: 'Hello Darkness', name: 'Error'\"\r\n *\r\n * let errStrFmt = dumpObj(err, true);\r\n * // errStrFmt === \"[object Error]: {\\n stack: \"Error: Hello Darkness\\n at :1:13\",\\n message: \"Hello Darkness\",\\n name: \"Error\"\\n}\"\r\n *\r\n * let errStrFmt2 = dumpObj(err, 2);\r\n * // errStrFmt2 === \"[object Error]: {\\n stack: \"Error: Hello Darkness\\n at :1:13\",\\n message: \"Hello Darkness\",\\n name: \"Error\"\\n}\"\r\n *\r\n * let errStrFmt3 = dumpObj(err, 0);\r\n * // errStrFmt3 === \"[object Error]: { stack: \"Error: Hello Darkness\\n at :1:13\", message: \"Hello Darkness\", name: \"Error\" }\"\r\n *\r\n * ```\r\n * @see {@link dumpObj}\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function dumpObj(object: any, format?: boolean | number): string {\r\n let propertyValueDump = EMPTY;\r\n const objType = ObjProto[TO_STRING][CALL](object);\r\n if (objType === ERROR_TYPE) {\r\n object = { stack: asString(object.stack), message: asString(object.message), name: asString(object.name) };\r\n }\r\n\r\n try {\r\n propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? (((typeof format as unknown) === \"number\") ? format as number : 4) : UNDEF_VALUE);\r\n propertyValueDump = (propertyValueDump ? propertyValueDump.replace(/\"(\\w+)\"\\s*:\\s{0,1}/g, \"$1: \") : NULL_VALUE) || asString(object);\r\n } catch(e) {\r\n // Unable to convert object (probably circular)\r\n propertyValueDump = \" - \" + dumpObj(e, format);\r\n }\r\n\r\n return objType + \": \" + propertyValueDump;\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\n/**\r\n * Throw an error exception with the specified optional message\r\n * @group Error\r\n * @param message - The optional message to include in the error\r\n */\r\nexport function throwError(message?: string): never {\r\n throw new Error(message);\r\n}\r\n\r\n/**\r\n * Throw a type error with the specified optional message\r\n * @group Error\r\n * @param message - The optional message to include in the error\r\n */\r\nexport function throwTypeError(message?: string): never {\r\n throw new TypeError(message);\r\n}\r\n\r\n/**\r\n * Throw a RangeError with the specified optional message\r\n * @group Error\r\n * @param message - The optional message to include in the error\r\n */\r\nexport function throwRangeError(message?: string): never {\r\n throw new RangeError(message);\r\n}","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { NULL_VALUE, ObjClass, __PROTO__ } from \"../internal/constants\";\r\nimport { isArray, isObject } from \"../helpers/base\";\r\nimport { objForEachKey } from \"./for_each_key\";\r\nimport { polyObjEntries, polyObjValues } from \"../polyfills/object\";\r\nimport { _pureAssign, _pureRef } from \"../internal/treeshake_helpers\";\r\n\r\nconst _objFreeze = (/* #__PURE__ */_pureRef(ObjClass, \"freeze\"));\r\n\r\nfunction _doNothing(value: T) {\r\n return value;\r\n}\r\n\r\n/*#__NO_SIDE_EFFECTS__*/\r\nfunction _getProto(value: any) {\r\n return value[__PROTO__] || NULL_VALUE;\r\n}\r\n\r\n/**\r\n * The `objAssign()` method copies all enumerable own properties from one or more source objects\r\n * to a target object. It returns the modified target object.\r\n *\r\n * Properties in the target object are overwritten by properties in the sources if they have the\r\n * same key. Later sources' properties overwrite earlier ones.\r\n *\r\n * The objAssign() method only copies enumerable and own properties from a source object to a\r\n * target object. It uses `Get` on the source and `Set` on the target, so it will invoke\r\n * [getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) and\r\n * [setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set).\r\n * Therefore it assigns properties, versus copying or defining new properties. This may make it\r\n * unsuitable for merging new properties into a prototype if the merge sources contain getters.\r\n *\r\n * For copying property definitions (including their enumerability) into prototypes, use\r\n * {@link objGetOwnPropertyDescriptor} and {@link objDefineProp} instead.\r\n *\r\n * Both String and Symbol properties are copied.\r\n *\r\n * In case of an error, for example if a property is non-writable, a TypeError is raised, and\r\n * the target object is changed if any properties are added before the error is raised.\r\n * @group Object\r\n * @example\r\n * ```ts\r\n * const obj = { a: 1 };\r\n * const copy = objAssign({}, obj);\r\n * console.log(copy); // { a: 1 }\r\n *\r\n * const o1 = { a: 1 };\r\n * const o2 = { b: 2 };\r\n * const o3 = { c: 3 };\r\n *\r\n * const obj = objAssign(o1, o2, o3);\r\n * console.log(obj); // { a: 1, b: 2, c: 3 }\r\n * console.log(o1); // { a: 1, b: 2, c: 3 }, target object itself is changed.\r\n * ```\r\n */\r\nexport const objAssign = (/*#__PURE__*/_pureRef(ObjClass, \"assign\"));\r\n\r\n/**\r\n * The `objKeys()` method returns an array of a given object's own enumerable property names, iterated in\r\n * the same order that a normal loop would.\r\n *\r\n * objKeys() returns an array whose elements are strings corresponding to the enumerable properties found\r\n * directly upon object. The ordering of the properties is the same as that given by looping over the\r\n * properties of the object manually.\r\n * @group Object\r\n * @param value - The object to obtain a copy of the keys from\r\n * @returns An array of the properties names for the value object.\r\n * @example\r\n * ```ts\r\n * // simple array\r\n * const arr = ['a', 'b', 'c'];\r\n * console.log(objKeys(arr)); // console: ['0', '1', '2']\r\n *\r\n * // array-like object\r\n * const obj = { 0: 'a', 1: 'b', 2: 'c' };\r\n * console.log(objKeys(obj)); // console: ['0', '1', '2']\r\n *\r\n * // array-like object with random key ordering\r\n * const anObj = { 100: 'a', 2: 'b', 7: 'c' };\r\n * console.log(objKeys(anObj)); // console: ['2', '7', '100']\r\n *\r\n * // getFoo is a property which isn't enumerable\r\n * const myObj = objCreate({}, {\r\n * getFoo: {\r\n * value() { return this.foo; }\r\n * }\r\n * });\r\n * myObj.foo = 1;\r\n * console.log(objKeys(myObj)); // console: ['foo']\r\n * ```\r\n */\r\nexport const objKeys: (value: any) => string[] = (/*#__PURE__*/_pureRef(ObjClass, \"keys\"));\r\n\r\n/**\r\n * Perform a deep freeze on the object and all of it's contained values / properties by recursively calling\r\n * `objFreeze()` on all enumerable properties of the object and on each property returned.\r\n * @group Object\r\n * @param value - the object to be completly frozen.\r\n * @returns The originally passed in object.\r\n */\r\nexport function objDeepFreeze(value: T): T {\r\n if (_objFreeze) {\r\n objForEachKey(value, (key, value) => {\r\n if (isArray(value) || isObject(value)) {\r\n objDeepFreeze(value);\r\n }\r\n });\r\n }\r\n\r\n return objFreeze(value);\r\n}\r\n\r\n/**\r\n * The `objFreeze()` method freezes an object. A frozen object can no longer be changed; freezing an object\r\n * prevents new properties from being added to it, existing properties from being removed, prevents changing the\r\n * enumerability, configurability, or writability of existing properties, and prevents the values of existing\r\n * properties from being changed. In addition, freezing an object also prevents its prototype from being changed.\r\n * `objFreeze()` returns the same object that was passed in.\r\n *\r\n * Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail,\r\n * either silently or by throwing a TypeError exception (most commonly, but not exclusively, when in strict mode).\r\n *\r\n * For data properties of a frozen object, values cannot be changed, the writable and configurable attributes are\r\n * set to false. Accessor properties (getters and setters) work the same (and still give the illusion that you are\r\n * changing the value). Note that values that are objects can still be modified, unless they are also frozen. As\r\n * an object, an array can be frozen; after doing so, its elements cannot be altered and no elements can be added\r\n * to or removed from the array.\r\n *\r\n * `objFreeze()` returns the same object that was passed into the function. It does not create a frozen copy.\r\n * @group Object\r\n * @param value - The object to freeze.\r\n * @returns The object that was passed to the function.\r\n */\r\nexport const objFreeze: (value: T) => T = (/* #__PURE__*/_pureAssign(_objFreeze, _doNothing));\r\n\r\n/**\r\n * The `objSeal()` method seals an object, preventing new properties from being added to it and marking all\r\n * existing properties as non-configurable. Values of present properties can still be changed as long as they\r\n * are writable.\r\n * @group Object\r\n * @param value - The object which should be sealed.\r\n * @returns The object being sealed.\r\n */\r\nexport const objSeal: (value: T) => T = (/* #__PURE__*/_pureAssign((/* #__PURE__*/_pureRef(ObjClass, \"seal\")), _doNothing));\r\n\r\n/**\r\n * The objGetPrototypeOf() method returns the prototype (i.e. the value of the internal `Prototype` property)\r\n * of the specified value.\r\n * @since 0.4.4\r\n * @group Object\r\n * @param value - The object whose prototype is to be returned, which may be null.\r\n */\r\nexport const objGetPrototypeOf: (value: any) => any = (/* #__PURE__*/_pureAssign((/* #__PURE__*/_pureRef(ObjClass, \"getPrototypeOf\")), _getProto));\r\n\r\n/**\r\n * Returns an array of key/values of the enumerable properties of an object\r\n * @since 0.9.7\r\n * @group Object\r\n * @group ArrayLike\r\n * @param value - Object that contains the properties and methods.\r\n * @example\r\n * ```ts\r\n * objEntries({ Hello: \"Darkness\", my: \"old\", friend: \".\" });\r\n * // [ [ \"Hello\", \"Darkness\" ], [ \"my\", \"old\"], [ \"friend\", \".\" ] ]\r\n *\r\n * // Array-like object\r\n * objEntries({ 0: \"a\", 1: \"b\", 2: \"c\" }));\r\n * // [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ]\r\n *\r\n * // Array-like object with random key ordering\r\n * objEntries({ 100: \"a\", 2: \"b\", 7: \"c\" });\r\n * // [ ['2', 'b'], ['7', 'c'], ['100', 'a'] ]*\r\n * ```\r\n */\r\nexport const objEntries: (value: {} | { [s: string]: T } | ArrayLike) => [string, T][] = (/* #__PURE__*/_pureAssign((/* #__PURE__*/_pureRef(ObjClass, \"entries\")), polyObjEntries));\r\n\r\n/**\r\n * The objValues() returns an array whose elements are values of enumerable string-keyed properties found\r\n * directly upon object. This is the same as iterating with a for...in loop, except that a for...in loop\r\n * enumerates properties in the prototype chain as well. The order of the array returned by objValues()\r\n * is the same as that provided by a for...in loop.\r\n *\r\n * If you need the property keys, use objKeys() instead. If you need both the property keys and values, use objEntries() instead.\r\n * @since 0.9.7\r\n * @group Object\r\n * @group ArrayLike\r\n * @param value - The object that contains the properties and methods.\r\n * @returns An array containing the given object's own enumerable string-keyed property values.\r\n * @example\r\n * ```ts\r\n * objValues({ Hello: \"Darkness\", my: \"old\", friend: \".\" });\r\n * // [ \"Darkness\", \"old\", \".\" ]\r\n *\r\n * // Array-like object\r\n * objValues({ 0: \"a\", 1: \"b\", 2: \"c\" }));\r\n * // [ 'a', 'b', 'c']\r\n *\r\n * // Array-like object with random key ordering\r\n * objValues({ 100: \"a\", 2: \"b\", 7: \"c\" });\r\n * // [ 'b', 'c', 'a']\r\n * ```\r\n */\r\nexport const objValues: (value: {} | { [s: string]: T } | ArrayLike) => T[] = (/* #__PURE__*/_pureAssign((/* #__PURE__*/_pureRef(ObjClass, \"values\")), polyObjValues));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { eMapValues, _createKeyValueMap, _assignMapValue } from \"../internal/map\";\r\nimport { objForEachKey } from \"../object/for_each_key\";\r\nimport { objFreeze } from \"../object/object\";\r\n\r\n/**\r\n * A type that identifies an enum class generated from a constant enum.\r\n * @group Enum\r\n * @typeParam E - The constant enum type\r\n *\r\n * Returned from {@link createEnum}\r\n */\r\nexport declare type EnumCls = {\r\n readonly [key in keyof E extends string | number | symbol ? keyof E : never]: key extends string ? E[key] : key\r\n} & { readonly [key in keyof E]: E[key] };\r\n\r\n/**\r\n * A type that identifies an object whose property values are generally mapped to the key of the source type.\r\n * @group Enum\r\n * @typeParam E - The source constant enum type which identifies the keys and values\r\n * @typeParam T - The resulting type with the keys from the source type.\r\n *\r\n * Returned from {@link createEnumKeyMap}\r\n */\r\nexport declare type EnumNameMap = {\r\n readonly [key in keyof E extends string | number | symbol ? keyof E : never]: key extends string ? key : keyof E\r\n} & T;\r\n\r\n/**\r\n * A type that identifies an object whose property values are mapped to the resulting values of the source objects keys.\r\n * @group Enum\r\n * @typeParam E - The source type which identifies the keys.\r\n * @typeParam T - The resulting type with the keys from the source type.\r\n *\r\n * Returned from {@link createEnumValueMap}\r\n */\r\nexport declare type EnumValueMap = {\r\n readonly [key in keyof E extends string | number | symbol ? keyof E : never]: key extends string ? E[key] : E[key]\r\n} & T;\r\n\r\n/**\r\n * A type that maps the keys of E to the type of V.\r\n * @group Enum\r\n * @typeParam E - The type of object that defines the Key (typically a constant enum)\r\n * @typeParam V - The value type, typically `string`, `number` but may also be a complex type.\r\n * @typeParam T - The resulting type with the keys from the source type.\r\n *\r\n * Returned from {@link createSimpleMap}\r\n */\r\nexport declare type EnumTypeMap = {\r\n readonly [key in keyof E extends string ? keyof E : never]: V\r\n} & T;\r\n\r\n/**\r\n * Create a TypeScript style enum class which is a mapping that maps from the key -\\> value and the value -\\> key.\r\n * This is effectively the same as defining a non-constant enum, but this only repeats the \"Name\" of the enum value once.\r\n * @group Enum\r\n * @example\r\n * ```ts\r\n * const enum Animal {\r\n * Dog = 0,\r\n * Cat = 1,\r\n * Butterfly = 2,\r\n * Bear = 3\r\n * }\r\n * const Animals = createEnum({\r\n * Dog: Animal.Dog,\r\n * Cat: Animal.Cat,\r\n * Butterfly: Animal.Butterfly,\r\n * Bear: Animal.Bear\r\n * });\r\n * // You end up with an object that maps everything to the name\r\n * Animals.Dog === 0; // true\r\n * Animals[0] === \"Dog\"; // true\r\n * Animals[\"Dog\"] === 0; // true\r\n * Animals.Cat === 1; // true\r\n * Animals[1] === \"Cat\"; // true\r\n * Animals[\"Cat\"] === 1; // true\r\n * ```\r\n\r\n * @param values - The values to populate on the new object\r\n * @typeParam E - Identifies the const enum type being mapped\r\n * @returns A new frozen (immutable) object which looks and acts like a TypeScript Enum class.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function createEnum(values: { [key in keyof E]: E[keyof E] }): EnumCls {\r\n return _createKeyValueMap(values, eMapValues.Value, eMapValues.Key, objFreeze);\r\n}\r\n\r\n/**\r\n * Create a map object which contains both the property key and value which both map to the key,\r\n * E[key] =\\> key and E[value] =\\> key.\r\n * @group Enum\r\n * @example\r\n * ```ts\r\n * const enum Animal {\r\n * Dog = 0,\r\n * Cat = 1,\r\n * Butterfly = 2,\r\n * Bear = 3\r\n * }\r\n * const animalMap = createEnumKeyMap({\r\n * Dog: Animal.Dog,\r\n * Cat: Animal.Cat,\r\n * Butterfly: Animal.Butterfly,\r\n * Bear: Animal.Bear\r\n * });\r\n * // You end up with an object that maps everything to the name\r\n * animalMap.Dog === \"Dog\"; // true\r\n * animalMap[0] === \"Dog\"; // true\r\n * animalMap[\"Dog\"] === \"Dog\"; // true\r\n * animalMap.Cat === \"Cat\"; // true\r\n * animalMap[1] === \"Cat\"; // true\r\n * animalMap[\"Cat\"] === \"Cat\"; // true\r\n * // Helper function to always return the \"Name\" of the type of animal\r\n * function getAnimalType(type: string | number | Animal) {\r\n * return animalMap[type];\r\n * }\r\n * ```\r\n * @param values - The values to populate on the new object\r\n * @typeParam E - Identifies the const enum type being mapped\r\n * @returns A new frozen (immutable) object which contains a property for each key and value that returns the value.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function createEnumKeyMap(values: { [key in keyof E]: E[keyof E] }): EnumNameMap {\r\n return _createKeyValueMap(values, eMapValues.Key, eMapValues.Key, objFreeze);\r\n}\r\n\r\n/**\r\n * Create a map object which contains both the perperty key and value which both map to the resulting value,\r\n * E[key] =\\> value and E[value] =\\> value.\r\n * @group Enum\r\n * @example\r\n * ```ts\r\n * const enum Animal {\r\n * Dog = 0,\r\n * Cat = 1,\r\n * Butterfly = 2,\r\n * Bear = 3\r\n * }\r\n * const animalMap = createEnumValueMap({\r\n * Dog: Animal.Dog,\r\n * Cat: Animal.Cat,\r\n * Butterfly: Animal.Butterfly,\r\n * Bear: Animal.Bear\r\n * });\r\n * // You end up with an object that maps everything to the name\r\n * animalMap.Dog === 0; // true\r\n * animalMap[0] === 0; // true\r\n * animalMap[\"Dog\"] === 0; // true\r\n * animalMap.Cat === 1; // true\r\n * animalMap[1] === 1; // true\r\n * animalMap[\"Cat\"] === 1; // true\r\n *\r\n * // Helper function to always return the \"Name\" of the type of animal\r\n * function getAnimalValue(type: string | number | Animal) {\r\n * return animalMap[type];\r\n * }\r\n * ```\r\n\r\n * @param values - The values to populate on the new object\r\n * @typeParam E - Identifies the const enum type being mapped\r\n * @returns A new frozen (immutable) object which contains a property for each key and value that returns the value.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function createEnumValueMap(values: { [key in keyof E]: E[keyof E] }): EnumValueMap {\r\n return _createKeyValueMap(values, eMapValues.Value, eMapValues.Value, objFreeze);\r\n}\r\n\r\n/**\r\n * Create a map object which contains both the perperty key and value which both map to the requested\r\n * generic mapValue with a type of V, E[key] =\\> mapValue and E[value] =\\> mapValue.\r\n * @group Enum\r\n * @example\r\n * ```ts\r\n * const enum Animal {\r\n * Dog = 0,\r\n * Cat = 1,\r\n * Butterfly = 2,\r\n * Bear = 3\r\n * };\r\n * // Creates a simple mapping to a string value\r\n * const animalFamilyMap = createValueMap({\r\n * Dog: [ Animal.Dog, \"Canidae\"],\r\n * Cat: [ Animal.Cat, \"Felidae\"],\r\n * Butterfly: [ Animal.Butterfly, \"Papilionidae\"],\r\n * Bear: [ Animal.Bear, \"Ursidae\"]\r\n * });\r\n * // You end up with an object that maps everything to the name\r\n * animalMap.Dog === \"Canidae\"; // true with typeof animalMap.Dog is \"string\"\r\n * animalMap[0] === \"Canidae\"; // true with typeof animalMap[0] is \"string\"\r\n * animalMap[\"Dog\"] === \"Canidae\"; // true with typeof animalMap[\"Dog\"] is \"string\"\r\n * animalMap.Cat === \"Felidae\"; // true with typeof animalMap.Cat is \"string\"\r\n * animalMap[1] === \"Felidae\"; // true with typeof animalMap[1] is \"string\"\r\n * animalMap[\"Cat\"] === \"Felidae\"; // true with typeof animalMap[\"Cat\"] is \"string\"\r\n * ```\r\n * @param values - The values to populate on the new object\r\n * @typeParam E - Identifies the const enum type (eg. typeof Animal);\r\n * @typeParam V - Identifies the type of the mapping `string`; `number`; etc is not restructed to primitive types.\r\n * @returns A new frozen (immutable) object which contains a property for each key and value that returns the defiend mapped value.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function createSimpleMap(values: { [key in keyof E]: [ E[keyof E], V] }): EnumTypeMap {\r\n let mapClass: any = {};\r\n objForEachKey(values, (key, value) => {\r\n _assignMapValue(mapClass, key, value[1]);\r\n _assignMapValue(mapClass, value[0], value[1]);\r\n });\r\n\r\n return objFreeze(mapClass);\r\n}\r\n\r\n/**\r\n * Create a strongly types map object which contains both the perperty key and value which both map\r\n * to the requested mapValue,\r\n * E[key] =\\> mapValue and E[value] =\\> mapValue.\r\n * - E = the const enum type (typeof Animal);\r\n * - V = Identifies the valid values for the keys, this should include both the enum numeric and string key of the type. The\r\n * resulting \"Value\" of each entry identifies the valid values withing the assignments.\r\n * @group Enum\r\n * @example\r\n * ```ts\r\n * // Create a strongly types map\r\n * const animalFamilyMap = createTypeMap({\r\n * Dog: [ Animal.Dog, \"Canidae\"],\r\n * Cat: [ Animal.Cat, \"Felidae\"],\r\n * Butterfly: [ Animal.Butterfly, \"Papilionidae\"],\r\n * Bear: [ Animal.Bear, \"Ursidae\"]\r\n * });\r\n * // You end up with a strongly types result for each value\r\n * animalMap.Dog === \"Canidae\"; // true with typeof animalMap.Dog is (const) \"Canidae\"\r\n * animalMap[0] === \"Canidae\"; // true with typeof animalMap[0] is \"Canidae\"\r\n * animalMap[\"Dog\"] === \"Canidae\"; // true with typeof animalMap[\"Dog\"] is \"Canidae\"\r\n * animalMap.Cat === \"Felidae\"; // true with typeof animalMap.Cat is \"Felidae\"\r\n * animalMap[1] === \"Felidae\"; // true with typeof animalMap[1] is \"Felidae\"\r\n * animalMap[\"Cat\"] === \"Felidae\"; // true with typeof animalMap[\"Cat\"] is \"Felidae\"\r\n *\r\n * or using an interface to define the direct string mappings\r\n *\r\n * interface IAnimalFamilyMap {\r\n * Dog: \"Canidae\",\r\n * Cat: \"Felidae\",\r\n * Butterfly: \"Papilionidae\",\r\n * Bear: \"Ursidae\"\r\n * }\r\n *\r\n * // Create a strongly types map\r\n * const animalFamilyMap = createTypeMap({\r\n * Dog: [ Animal.Dog, \"Canidae\"],\r\n * Cat: [ Animal.Cat, \"Felidae\"],\r\n * Butterfly: [ Animal.Butterfly, \"Papilionidae\"],\r\n * Bear: [ Animal.Bear, \"Ursidae\"]\r\n * });\r\n *\r\n * // You also end up with a strongly types result for each value\r\n * animalMap.Dog === \"Canidae\"; // true with typeof animalMap.Dog is (const) \"Canidae\"\r\n * animalMap[0] === \"Canidae\"; // true with typeof animalMap[0] is \"Canidae\"\r\n * animalMap[\"Dog\"] === \"Canidae\"; // true with typeof animalMap[\"Dog\"] is \"Canidae\"\r\n * animalMap.Cat === \"Felidae\"; // true with typeof animalMap.Cat is \"Felidae\"\r\n * animalMap[1] === \"Felidae\"; // true with typeof animalMap[1] is \"Felidae\"\r\n * animalMap[\"Cat\"] === \"Felidae\"; // true with typeof animalMap[\"Cat\"] is \"Felidae\"\r\n * ```\r\n * @param values - The values to populate on the new object\r\n * @typeParam E - Identifies the enum type\r\n * @typeParam T - Identifies the return type that is being created via the mapping.\r\n * @returns A new frozen (immutable) object which contains a property for each key and value that returns the defined mapped value.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function createTypeMap(values: { [key in keyof E]: [ E[keyof E], T[keyof T] ] }): T {\r\n return createSimpleMap(values as any) as unknown as T;\r\n}","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\nimport { createEnumKeyMap } from \"../helpers/enum\";\r\n\r\n/**\r\n * Identifies the Symbol static properties which are symbols themselves as a constant\r\n * enum to aid in minification when fetching them from the global symbol implementation.\r\n *\r\n * See: [Well Known Symbols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#well-known_symbols)\r\n * @group Symbol\r\n */\r\nexport const enum WellKnownSymbols {\r\n /**\r\n * The Symbol.asyncIterator symbol is a builtin symbol that is used to access an\r\n * object's `Symbol.asyncIterator` method. In order for an object to be async iterable,\r\n * it must have a Symbol.asyncIterator key.\r\n *\r\n * See: [Symbol.asyncIterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator)\r\n */\r\n asyncIterator = 0,\r\n\r\n /**\r\n * The `Symbol.hasInstance` well-known symbol is used to determine if a constructor\r\n * object recognizes an object as its instance. The instanceof operator's behavior\r\n * can be customized by this symbol.\r\n *\r\n * See: [Symbol.hasInstance](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance)\r\n */\r\n hasInstance = 1,\r\n\r\n /**\r\n * The `Symbol.isConcatSpreadable` symbol (Symbol.isConcatSpreadable) can be defined as an\r\n * own or inherited property and its value is a boolean. It can control behavior for\r\n * arrays and array-like objects:\r\n * - For array objects, the default behavior is to spread (flatten) elements.\r\n * Symbol.isConcatSpreadable can avoid flattening in these cases.\r\n * - For array-like objects, the default behavior is no spreading or flattening.\r\n * Symbol.isConcatSpreadable can force flattening in these cases.\r\n *\r\n * See: [Symbol.isConcatSpreadable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/isConcatSpreadable)\r\n */\r\n isConcatSpreadable = 2,\r\n\r\n /**\r\n * Whenever an object needs to be iterated (such as at the beginning of a for..of loop),\r\n * its `Symbol.iterator` method is called with no arguments, and the returned iterator is used\r\n * to obtain the values to be iterated.\r\n *\r\n * See: [Symbol.iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator)\r\n */\r\n iterator = 3,\r\n\r\n /**\r\n * This function is also used to identify if objects have the behavior of regular expressions.\r\n * For example, the methods String.prototype.startsWith(), String.prototype.endsWith() and\r\n * String.prototype.includes(), check if their first argument is a regular expression and\r\n * will throw a TypeError if they are. Now, if the match symbol is set to false (or a Falsy\r\n * value), it indicates that the object is not intended to be used as a regular expression object.\r\n *\r\n * See: [Symbol.match](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match)\r\n */\r\n match = 4,\r\n\r\n /**\r\n * The `Symbol.matchAll` well-known symbol returns an iterator, that yields matches of the regular\r\n * expression against a string. This function is called by the String.prototype.matchAll() method.\r\n *\r\n * See: [Symbol.matchAll](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/matchAll)\r\n */\r\n matchAll = 5,\r\n\r\n /**\r\n * The `Symbol.replace` well-known symbol specifies the method that replaces matched substrings\r\n * of a string. This function is called by the String.prototype.replace() method.\r\n *\r\n * For more information, [RegExp.prototype[Symbol.replace]](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/\\@\\@replace)()\r\n * and [String.prototype.replace](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replace)().\r\n *\r\n * See: [Symbol.replace](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/replace)\r\n */\r\n replace = 6,\r\n\r\n /**\r\n * The `Symbol.search` well-known symbol specifies the method that returns the index within a\r\n * string that matches the regular expression. This function is called by the\r\n * [String.prototype.search()](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/search)\r\n * method.\r\n *\r\n * For more information, see [RegExp.prototype[\\@\\@search]](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/\\@\\@search)()\r\n * and [String.prototype.search()](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/search).\r\n *\r\n * See: [Symbol.species](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species)\r\n */\r\n search = 7,\r\n\r\n /**\r\n * The well-known symbol `Symbol.species` specifies a function-valued property that the constructor\r\n * function uses to create derived objects.\r\n * See: [Symbol.species](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species)\r\n */\r\n species = 8,\r\n\r\n /**\r\n * The `Symbol.split` well-known symbol specifies the method that splits a string at the indices\r\n * that match a regular expression. This function is called by the String.prototype.split() method.\r\n *\r\n * For more information, see [RegExp.prototype[\\@\\@split]](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/\\@\\@split)()\r\n * and [String.prototype.split()](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/split).\r\n * See: [Symbol.split](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split)\r\n */\r\n split = 9,\r\n\r\n /**\r\n * With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be\r\n * converted to a primitive value. The function is called with a string argument hint, which\r\n * specifies the preferred type of the result primitive value. The hint argument can be one of\r\n * \"number\", \"string\", and \"default\".\r\n *\r\n * See: [Symbol.toPrimitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive)\r\n */\r\n toPrimitive = 10,\r\n\r\n /**\r\n * The `Symbol.toStringTag` well-known symbol is a string valued property that is used in the\r\n * creation of the default string description of an object. It is accessed internally by the\r\n * [Object.prototype.toString](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/toString)()\r\n * method.\r\n *\r\n * See: [Symbol.toStringTag](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)\r\n */\r\n toStringTag = 11,\r\n\r\n /**\r\n * The `Symbol.unscopables` well-known symbol is used to specify an object value of whose own\r\n * and inherited property names are excluded from the with environment bindings of the associated\r\n * object.\r\n *\r\n * See: [Symbol.unscopables](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/unscopables)\r\n */\r\n unscopables = 12\r\n}\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n */\r\nexport const _wellKnownSymbolMap = /*#__PURE__*/createEnumKeyMap({\r\n asyncIterator: WellKnownSymbols.asyncIterator,\r\n hasInstance: WellKnownSymbols.hasInstance,\r\n isConcatSpreadable: WellKnownSymbols.isConcatSpreadable,\r\n iterator: WellKnownSymbols.iterator,\r\n match: WellKnownSymbols.match,\r\n matchAll: WellKnownSymbols.matchAll,\r\n replace: WellKnownSymbols.replace,\r\n search: WellKnownSymbols.search,\r\n species: WellKnownSymbols.species,\r\n split: WellKnownSymbols.split,\r\n toPrimitive: WellKnownSymbols.toPrimitive,\r\n toStringTag: WellKnownSymbols.toStringTag,\r\n unscopables: WellKnownSymbols.unscopables\r\n});\r\n\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { safe } from \"../helpers/safe\";\r\nimport { UNDEFINED } from \"./constants\";\r\n\r\nconst GLOBAL_CONFIG_KEY = \"__tsUtils$gblCfg\";\r\n\r\ndeclare let globalThis: Window;\r\ndeclare let global: Window;\r\ndeclare let self: any;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal interface for holding the global polyfill symbols\r\n */\r\nexport interface _GlobalPolySymbols {\r\n k: { [key: string ]: symbol },\r\n s: { [sym: symbol ]: string },\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal interface for defining global test hooks\r\n */\r\nexport interface _GlobalTestHooks {\r\n lzy?: boolean;\r\n}\r\n\r\nexport interface TsUtilsGlobalConfig extends _GlobalTestHooks {\r\n gblSym?: _GlobalPolySymbols,\r\n}\r\n\r\nlet _globalCfg: { [key: string ]: any };\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Helper to get the current global value\r\n * @returns\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _getGlobalValue(): Window {\r\n var result: Window;\r\n\r\n if (typeof globalThis !== UNDEFINED) {\r\n result = globalThis;\r\n }\r\n\r\n if (!result && typeof self !== UNDEFINED) {\r\n result = self;\r\n }\r\n\r\n if (!result && typeof window !== UNDEFINED) {\r\n result = window;\r\n }\r\n\r\n if (!result && typeof global !== UNDEFINED) {\r\n result = global;\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Gets/Sets the named value from the global config store, this is used to share configuration across\r\n * multiple modules. Primarily used for poly symbol and test hooks.\r\n * @returns The globally registered value.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _getGlobalConfig(): TsUtilsGlobalConfig {\r\n if (!_globalCfg) {\r\n let gbl = safe(_getGlobalValue).v || {};\r\n _globalCfg = gbl[GLOBAL_CONFIG_KEY] = gbl[GLOBAL_CONFIG_KEY] || {};\r\n }\r\n\r\n return _globalCfg;\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { dumpObj } from \"../helpers/diagnostics\";\r\nimport { throwTypeError } from \"../helpers/throw\";\r\nimport { asString } from \"../string/as_string\";\r\nimport { ArrSlice, CALL, NULL_VALUE } from \"./constants\";\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal helper to run the named function on the passed first argument, this does not support polyfill\r\n * or prototype fallback, so the function must exist on the provided first argument.\r\n * If the first argument is null, undefined or the function does not exist an exception will be thrown\r\n * by the runtime\r\n * @param funcName - The function name to call on the first argument passed to the wrapped function\r\n * @returns A function which will call the funcName against the first passed argument and pass on the remaining arguments\r\n */\r\nexport const _unwrapInstFunction:(funcName: keyof T) => (this: T, ..._args:any) => R = (/*__PURE__*/_unwrapFunctionWithPoly);\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal helper to convert an expanded function back into an instance `this` function call\r\n * @param funcName - The function name to call on the first argument passed to the wrapped function\r\n * @param clsProto - The Class or class prototype to fallback to if the instance doesn't have the function.\r\n * @returns A function which will call the funcName against the first passed argument and pass on the remaining arguments\r\n */\r\nexport const _unwrapFunction:(funcName: keyof T, clsProto: T) => (this: T, ..._args:any) => R = (/*__PURE__*/_unwrapFunctionWithPoly);\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal helper to convert an expanded function back into an instance `this` function call\r\n * @param funcName - The function name to call on the first argument passed to the wrapped function\r\n * @param clsProto - The Class or class prototype to fallback to if the instance doesn't have the function.\r\n * @param polyFunc - The function to call if not available on the thisArg, act like the polyfill\r\n * @returns A function which will call the funcName against the first passed argument and pass on the remaining arguments\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _unwrapFunctionWithPoly any>(funcName: keyof T, clsProto?: T, polyFunc?: P) {\r\n let clsFn = clsProto ? clsProto[funcName] : NULL_VALUE;\r\n\r\n return function(thisArg: any): ReturnType

{\r\n let theFunc = (thisArg ? thisArg[funcName] : NULL_VALUE) || clsFn;\r\n if (theFunc || polyFunc) {\r\n let theArgs = arguments;\r\n return ((theFunc || polyFunc) as Function).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);\r\n }\r\n\r\n throwTypeError(\"\\\"\" + asString(funcName) + \"\\\" not defined for \" + dumpObj(thisArg));\r\n };\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal helper to lookup and return the named property from the first argument (which becomes the this)\r\n *\r\n * @since 0.4.2\r\n * @typeParam T - The type of the object which contains the propName\r\n * @param propName - The property name\r\n * @returns The value of the property\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _unwrapProp(propName: keyof T) {\r\n return function (thisArg: T) {\r\n return thisArg[propName];\r\n };\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { MathCls } from \"../internal/constants\";\r\nimport { _pureRef } from \"../internal/treeshake_helpers\";\r\n\r\n/**\r\n * The mathMin() function returns the lowest-valued number passed into it, or NaN if any\r\n * parameter isn't a number and can't be converted into one.\r\n *\r\n * If no arguments are given, the result is Infinity.\r\n *\r\n * If at least one of arguments cannot be converted to a number, the result is NaN.\r\n *\r\n * @since 0.4.2\r\n * @group Math\r\n * @param values - Zero or more numbers among which the lowest value will be selected and returned.\r\n * @returns The smallest of the given numbers. If any one or more of the parameters cannot\r\n * be converted into a number, NaN is returned. The result is Infinity if no parameters are provided.\r\n * @example\r\n * ```ts\r\n * const x = 10, y = -20;\r\n * const z = Math.min(x, y); // -20\r\n * ```\r\n */\r\nexport const mathMin: (...values: number[]) => number = (/*#__PURE__*/_pureRef(MathCls, \"min\"));\r\n\r\n/**\r\n * The `mathMax()` function returns the largest of the zero or more numbers given as input\r\n * parameters, or NaN if any parameter isn't a number and can't be converted into one.\r\n *\r\n * If no arguments are given, the result is -Infinity.\r\n *\r\n * If at least one of arguments cannot be converted to a number, the result is NaN.\r\n *\r\n * @since 0.4.2\r\n * @group Math\r\n * @param values - Zero or more numbers among which the largest value will be selected and returned.\r\n * @returns The largest of the given numbers. If any one or more of the parameters cannot be\r\n * converted into a number, NaN is returned. The result is -Infinity if no parameters are provided.\r\n * @example\r\n * ```ts\r\n * mathMax(10, 20); // 20\r\n * mathMax(-10, -20); // -10\r\n * mathMax(-10, 20); // 20\r\n * ```\r\n */\r\nexport const mathMax: (...values: number[]) => number = (/*#__PURE__*/_pureRef(MathCls, \"max\"));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { StrProto } from \"../internal/constants\";\r\nimport { _unwrapFunction } from \"../internal/unwrapFunction\";\r\n\r\n/**\r\n * The `strSlice()` method extracts a section of a string and returns it as a new string, without\r\n * modifying the original string.\r\n * `strSlice()` extracts the text from one string and returns a new string. Changes to the text in one\r\n * string do not affect the other string.\r\n * `strSlice()` extracts up to but not including endIndex. str.slice(1, 4) extracts the second character\r\n * through the fourth character (characters indexed 1, 2, and 3).\r\n * As an example, strSlice(2, -1) extracts the third character through the second to last character\r\n * in the string.\r\n * @group String\r\n * @param value - The value to haveextract a number\r\n * @param beginIndex - The zero-based index at which to begin extraction.\r\n * If `beginIndex` is negative, `strSlice()` begins extraction from `value.length + beginIndex`.\r\n * (E.g. `strSlice(\"test\", -2)` returns \"st\")\r\n * If `beginIndex` is omitted, undefined, or cannot be converted to a number (using Number(`beginIndex`)),\r\n * strSlice() begins extraction from the beginning of the string. (E.g. `strSlice(\"test\")` returns \"test\")\r\n * If `beginIndex` is greater than or equal to `value.length`, an empty string is returned.\r\n * (E.g. `strSlice(\"test\", 4)` returns \"\")\r\n * @param endIndex - The index of the first character to exclude from the returned substring.\r\n * If `endIndex` is omitted, undefined, or cannot be converted to a number (using Number(`endIndex`))\r\n * strSlice() extracts to the end of the string. (E.g. `strSlice(\"test\", 2)` returns \"st\")\r\n * If `endIndex` is greater than `value.length`, strSlice() also extracts to the end of the string.\r\n * (E.g. `strSlice(\"test\", 2, 10)` returns \"st\")\r\n * If `endIndex` is negative, `strSlice()` treats it as `value.length + endIndex`. (E.g, if `endIndex`\r\n * is -2, it is treated as `value.length - 2` and `strSlice(\"test\", 1, -2)` returns \"e\") .\r\n * If `endIndex` represents a position that is before the one represented by startIndex, `strSlice()`\r\n * returns \"\". (E.g `strSlice(\"test\", 2, -10)`, `strSlice(\"test\", -1, -2)` or `strSlice(\"test\", 3, 2)`).\r\n * @returns A new string containing the extracted section of the string.\r\n */\r\nexport const strSlice: (value: string, beginIndex: number, endIndex?: number) => string = (/*#__PURE__*/_unwrapFunction(\"slice\", StrProto));\r\n\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { isNullOrUndefined, isUndefined } from \"../helpers/base\";\r\nimport { dumpObj } from \"../helpers/diagnostics\";\r\nimport { throwTypeError } from \"../helpers/throw\";\r\nimport { EMPTY, LENGTH, StrProto } from \"../internal/constants\";\r\nimport { _unwrapFunction, _unwrapFunctionWithPoly } from \"../internal/unwrapFunction\";\r\nimport { mathMax } from \"../math/min_max\";\r\nimport { strSlice } from \"./slice\";\r\n\r\n/**\r\n * The `strSubstring()` method returns the part of the string between the start and end indexes, or to the end of the string.\r\n *\r\n * `strSubstring()` extracts characters from indexStart up to but not including indexEnd. In particular:\r\n * - If `indexEnd` is omitted, strSubstring() extracts characters to the end of the string.\r\n * - If `indexStart` is equal to indexEnd, strSubstring() returns an empty string.\r\n * - If `indexStart` is greater than indexEnd, then the effect of strSubstring() is as if the two arguments were swapped; see example below.\r\n *\r\n * Any argument value that is less than 0 or greater than `value.length` is treated as if it were 0 and `value.length`, respectively.\r\n *\r\n * Any argument value that is NaN is treated as if it were 0.\r\n * @group String\r\n * @param value - The string value to return the substring from.\r\n * @param indexStart - The index of the first character to include in the returned substring.\r\n * @param indexEnd - The index of the first character to exclude from the returned substring.\r\n * @return A new string containing the specified part of the given string\r\n * @example\r\n * ```ts\r\n * const anyString = 'Nevware21';\r\n * // Displays 'N'\r\n * console.log(strSubstring(anyString, 0, 1));\r\n * console.log(strSubstring(anyString, 1, 0));\r\n *\r\n * // Displays 'Nevwar'\r\n * console.log(strSubstring(anyString, 0, 6));\r\n *\r\n * // Displays 'are21'\r\n * console.log(strSubstring(anyString, 4));\r\n *\r\n * // Displays 'are'\r\n * console.log(strSubstring(anyString, 4, 7));\r\n *\r\n * // Displays '21'\r\n * console.log(strSubstring(anyString, 7, 4));\r\n *\r\n * // Displays 'Nevware'\r\n * console.log(strSubstring(anyString, 0, 7));\r\n *\r\n * // Displays 'Nevware21'\r\n * console.log(strSubstring(anyString, 0, 10));\r\n * ```\r\n */\r\nexport const strSubstring: (value: string, indexStart: number, indexEnd?: number) => string = (/*#__PURE__*/_unwrapFunction(\"substring\", StrProto));\r\n\r\n/**\r\n * The strSubstr() method returns a portion of the string, starting at the specified index and extending for a given\r\n * number of characters afterwards.\r\n *\r\n * @since 0.4.2\r\n * @group String\r\n * @param value - The string value to return the substring from.\r\n * @param start - The index of the first character to include in the returned substring.\r\n * @param length - The number of characters to extract.\r\n * @returns A new string containing the specified part of the given string.\r\n */\r\nexport const strSubstr: (value: string, start: number, length?: number) => string = (/*#__PURE__*/_unwrapFunctionWithPoly(\"substr\", StrProto, polyStrSubstr));\r\n\r\n/**\r\n * The polyStrSubstr() method returns a portion of the string, starting at the specified index and extending for a given\r\n * number of characters afterwards.\r\n *\r\n * @since 0.4.2\r\n * @group String\r\n * @group Polyfill\r\n * @param value - The string value to return the substring from.\r\n * @param start - The index of the first character to include in the returned substring.\r\n * @param length - The number of characters to extract.\r\n * @returns A new string containing the specified part of the given string.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function polyStrSubstr(value: string, start: number, length?: number): string {\r\n if (isNullOrUndefined(value)) {\r\n throwTypeError(\"Invalid \" + dumpObj(value));\r\n }\r\n\r\n if (length < 0) {\r\n return EMPTY;\r\n }\r\n\r\n // If start is omitted or undefined, its treated as zero\r\n start = start || 0;\r\n\r\n if (start < 0) {\r\n start = mathMax(start + value[LENGTH], 0);\r\n }\r\n\r\n if (isUndefined(length)) {\r\n return strSlice(value, start);\r\n }\r\n\r\n return strSlice(value, start, start + length);\r\n}\r\n\r\n/**\r\n * Returns a substring of the string starting from the left.\r\n *\r\n * `strLeft()` extracts the number of characters from left of the string up to the count. In particular:\r\n * - If `count` is less than zero, strLeft() returns an empty string.\r\n * - If `count` is less than `value.length`, strLeft() returns a new string with the `count` number of characters from the left of the string.\r\n * - If `count` is greater than `value.length`, then the value original value is returned.\r\n *\r\n * Any argument value that is NaN is treated as if it were 0.\r\n *\r\n * @since 0.4.2\r\n * @group String\r\n * @param value - The string value to return the substring from.\r\n * @param count - The number of characters to extract\r\n * @returns The substring based on the count number of characters from the right\r\n * @example\r\n * ```ts\r\n * strLeft(\"Nevware21\", -1); // \"\"\r\n * strLeft(\"Nevware21\", 0); // \"\"\r\n * strLeft(\"Nevware21\", 1); // \"N\"\r\n * strLeft(\"Nevware21\", 3); // \"Nev\"\r\n * strLeft(\"Nevware21\", 21); // \"Nevware21\"\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function strLeft(value: string, count: number): string {\r\n return strSubstring(value, 0, count);\r\n}\r\n\r\n/**\r\n * Returns a substring of the string starting from the right.\r\n *\r\n * `strRight()` extracts the number of characters from right of the string up to the count. In particular:\r\n * - If `count` is less than zero, strRight() returns an empty string.\r\n * - If `count` is less than `value.length`, strRight() returns a new string with the `count` number of characters from the right of the string.\r\n * - If `count` is greater than `value.length`, then the value original value is returned.\r\n *\r\n * Any argument value that is NaN is treated as if it were 0.\r\n *\r\n * @since 0.4.2\r\n * @group String\r\n * @param value - The string value to return the substring from.\r\n * @param count - The number of characters to extract\r\n * @returns The substring based on the count number of characters from the right\r\n * @example\r\n * ```ts\r\n * strRight(\"Nevware21\", -1); // \"\"\r\n * strRight(\"Nevware21\", 0); // \"\"\r\n * strRight(\"Nevware21\", 1); // \"1\"\r\n * strRight(\"Nevware21\", 3); // \"e21\"\r\n * strRight(\"Nevware21\", 21); // \"Nevware21\"\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function strRight(value: string, count: number): string {\r\n return count <= 0 ? EMPTY : (value[LENGTH] > count ? strSlice(value, -count) : value);\r\n}","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { WellKnownSymbols, _wellKnownSymbolMap } from \"../symbol/well_known\";\r\nimport { throwTypeError } from \"../helpers/throw\";\r\nimport { POLYFILL_TAG, SYMBOL, TO_STRING } from \"../internal/constants\";\r\nimport { objHasOwn } from \"../object/has_own\";\r\nimport { asString } from \"../string/as_string\";\r\nimport { _GlobalPolySymbols, _getGlobalConfig } from \"../internal/global\";\r\nimport { strSubstring } from \"../string/substring\";\r\nimport { objKeys } from \"../object/object\";\r\n\r\nconst UNIQUE_REGISTRY_ID = \"_urid\";\r\nlet _polySymbols: _GlobalPolySymbols;\r\n\r\n/*#__NO_SIDE_EFFECTS__*/\r\nfunction _globalSymbolRegistry(): _GlobalPolySymbols {\r\n if (!_polySymbols) {\r\n let gblCfg = _getGlobalConfig();\r\n _polySymbols = gblCfg.gblSym = gblCfg.gblSym || { k: {}, s:{} };\r\n }\r\n\r\n return _polySymbols;\r\n}\r\n\r\nlet _wellKnownSymbolCache: { [key in keyof typeof WellKnownSymbols ]: symbol };\r\n\r\n/**\r\n * Returns a new (polyfill) Symbol object for the provided description that's guaranteed to be unique.\r\n * Symbols are often used to add unique property keys to an object that won't collide with keys any\r\n * other code might add to the object, and which are hidden from any mechanisms other code will\r\n * typically use to access the object. That enables a form of weak encapsulation, or a weak form of\r\n * information hiding.\r\n * @group Polyfill\r\n * @group Symbol\r\n * @param description - The description of the symbol\r\n * @returns A new polyfill version of a Symbol object\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function polyNewSymbol(description?: string | number): symbol {\r\n let theSymbol: symbol = {\r\n description: asString(description),\r\n toString: () => SYMBOL + \"(\" + description + \")\"\r\n } as symbol;\r\n \r\n // Tag the symbol so we know it a polyfill\r\n theSymbol[POLYFILL_TAG] = true;\r\n\r\n return theSymbol;\r\n}\r\n\r\n/**\r\n * Returns a Symbol object from the global symbol registry matching the given key if found.\r\n * Otherwise, returns a new symbol with this key.\r\n * @group Polyfill\r\n * @group Symbol\r\n * @param key - key to search for.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function polySymbolFor(key: string): symbol {\r\n let registry = _globalSymbolRegistry();\r\n if (!objHasOwn(registry.k, key)) {\r\n let newSymbol = polyNewSymbol(key);\r\n let regId = objKeys(registry.s).length;\r\n newSymbol[UNIQUE_REGISTRY_ID] = () => regId + \"_\" + newSymbol[TO_STRING]();\r\n registry.k[key] = newSymbol;\r\n registry.s[newSymbol[UNIQUE_REGISTRY_ID]()] = asString(key);\r\n }\r\n\r\n return registry.k[key];\r\n}\r\n\r\n/**\r\n * Returns a key from the global symbol registry matching the given Symbol if found.\r\n * Otherwise, returns a undefined.\r\n * @group Polyfill\r\n * @group Symbol\r\n * @param sym - Symbol to find the key for.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function polySymbolKeyFor(sym: symbol): string | undefined {\r\n if (!sym || !sym[TO_STRING] || strSubstring(sym[TO_STRING](), 0, 6) != SYMBOL) {\r\n throwTypeError((sym as any) + \" is not a symbol\");\r\n }\r\n\r\n const regId = sym[POLYFILL_TAG] && sym[UNIQUE_REGISTRY_ID] && sym[UNIQUE_REGISTRY_ID]();\r\n\r\n return regId ? _globalSymbolRegistry().s[regId] : undefined;\r\n}\r\n\r\n/**\r\n * Returns the polyfill version of a well-known global symbol, this will only return\r\n * known values.\r\n * @example\r\n * ```ts\r\n * // Always returns the polyfill version, even if Symbols are supported in the runtime\r\n * polyGetKnownSymbol(\"toStringTag\") === polyGetKnownSymbol(\"toStringTag\"); // true\r\n * polyGetKnownSymbol(WellKnownSymbols.toStringTag) === polyGetKnownSymbol(\"toStringTag\"); // true\r\n * polyGetKnownSymbol(\"toStringTag\") !== Symbol.toStringTag; // true\r\n * polyGetKnownSymbol(WellKnownSymbols.toStringTag) !== Symbol.toStringTag; // true\r\n * polyGetKnownSymbol(\"toStringTag\") !== polySymbolFor(\"toStringTag\"); // true\r\n * polyGetKnownSymbol(WellKnownSymbols.toStringTag) !== polySymbolFor(\"toStringTag\"); // true\r\n * polyGetKnownSymbol(\"toStringTag\") !== polyNewSymbol(\"toStringTag\"); // true\r\n * polyGetKnownSymbol(WellKnownSymbols.toStringTag) !== polyNewSymbol(\"toStringTag\"); // true\r\n * ```\r\n * @group Polyfill\r\n * @group Symbol\r\n * @param name - The property name to return (if it exists) for Symbol\r\n * @returns The value of the property if present\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function polyGetKnownSymbol(name: string | WellKnownSymbols): symbol {\r\n !_wellKnownSymbolCache && (_wellKnownSymbolCache = {} as any);\r\n let result: symbol;\r\n let knownName: WellKnownSymbols = _wellKnownSymbolMap[name];\r\n if (knownName) {\r\n result = _wellKnownSymbolCache[knownName] = _wellKnownSymbolCache[knownName] || polyNewSymbol(SYMBOL + \".\" + knownName);\r\n }\r\n\r\n return result\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { _GlobalTestHooks, _getGlobalConfig } from \"../internal/global\";\r\nimport { objDefineProp } from \"../object/define\";\r\nimport { ICachedValue } from \"./cache\";\r\n\r\n/**\r\n * @internal\r\n * Internal flag which is set by the public {@link setBypassLazyCache}, should not be externally exported\r\n */\r\nexport let _globalLazyTestHooks: _GlobalTestHooks;\r\n\r\nexport function _initTestHooks() {\r\n _globalLazyTestHooks = _getGlobalConfig();\r\n}\r\n\r\n/**\r\n * Interface of the object returned by the {@link getLazy} instance\r\n * @since 0.4.5\r\n * @group Lazy\r\n */\r\nexport interface ILazyValue extends ICachedValue {\r\n /**\r\n * Returns the current cached value from the lazy lookup, if the callback function has not yet occurred\r\n * accessing the value will cause the lazy evaluation to occur and the result will be returned.\r\n */\r\n v: T,\r\n\r\n /**\r\n * Identifies if this instance is bypassing the internal caching mechanism which is used for testing\r\n */\r\n b?: boolean\r\n}\r\n\r\n/**\r\n * Create and return an readonly {@link ILazyValue} instance which will cache and return the value returned\r\n * by the callback function. The callback function will only be called once, multiple access of the value\r\n * does not cause re-execution of the callback as the result from the first call is cached internally.\r\n * @since 0.4.5\r\n * @group Lazy\r\n * @param cb - The callback function to fetch the value to be lazily evaluated and cached\r\n * @returns A new readonly {@link ILazyValue} instance which wraps the callback and will be used to cache\r\n * the result of the callback\r\n * @example\r\n * ```ts\r\n * // This does not cause the evaluation to occur\r\n * let cachedValue = getLazy(() => callSomeExpensiveFunction());\r\n * let theValue;\r\n *\r\n * // Just checking if there is an object still does not cause the evaluation\r\n * if (cachedValue) {\r\n * // This will cause the evaluation to occur and the result will be cached\r\n * theValue = cachedValue.v;\r\n * }\r\n *\r\n * // Accessing the value again will not cause the re-evaluation to occur, it will just return the same\r\n * // result value again.\r\n * theValue === cachedValue.v; // true\r\n *\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function getLazy(cb: () => T): ILazyValue {\r\n let lazyValue = { } as ILazyValue;\r\n !_globalLazyTestHooks && _initTestHooks();\r\n lazyValue.b = _globalLazyTestHooks.lzy;\r\n\r\n objDefineProp(lazyValue, \"v\", {\r\n configurable: true,\r\n get: function () {\r\n let result = cb();\r\n if (!_globalLazyTestHooks.lzy) {\r\n // Just replace the value\r\n objDefineProp(lazyValue, \"v\", {\r\n value: result\r\n });\r\n }\r\n\r\n lazyValue.b = _globalLazyTestHooks.lzy;\r\n\r\n return result;\r\n }\r\n });\r\n\r\n return lazyValue;\r\n}\r\n\r\n/**\r\n * Test Hook function used to cause the internal caching of objects to be bypassed, this should never\r\n * be enabled for production as it has additional performance impact caused by the repetitive creation\r\n * of the lazy wrappers.\r\n * @group Lazy\r\n * @since 0.5.0\r\n * @param newValue - When `true` will cause all new lazy implementations to bypass the cached lookup.\r\n */\r\nexport function setBypassLazyCache(newValue: boolean) {\r\n !_globalLazyTestHooks && _initTestHooks();\r\n _globalLazyTestHooks.lzy = newValue;\r\n}\r\n\r\n/**\r\n * Create and return a writable {@link ILazyValue} instance which will cache and return the value returned\r\n * by the callback function. The callback function will only be called once, multiple access of the value\r\n * does not cause re-execution of the callback as the result from the first call is cached internally. The\r\n * value may be set as many times as required, if the callback has not been called when you set the value\r\n * it will never get called.\r\n * @since 0.11.7\r\n * @group Lazy\r\n * @param cb - The callback function to fetch the value to be lazily evaluated and cached\r\n * @returns A new writable {@link ILazyValue} instance which wraps the callback and will be used to cache\r\n * the result of the callback\r\n * @example\r\n * ```ts\r\n * // This does not cause the evaluation to occur\r\n * let cachedValue = getWritableLazy(() => callSomeExpensiveFunction());\r\n * let theValue;\r\n *\r\n * // Just checking if there is an object still does not cause the evaluation\r\n * if (cachedValue) {\r\n * // This will cause the evaluation to occur and the result will be cached\r\n * theValue = cachedValue.v;\r\n * }\r\n *\r\n * // Accessing the value again will not cause the re-evaluation to occur, it will just return the same\r\n * // result value again.\r\n * theValue === cachedValue.v; // true\r\n *\r\n * // Setting the value\r\n * let cachedValue = getWritableLazy(() => callSomeExpensiveFunction());\r\n * let theValue = \"new Value\";\r\n *\r\n * // Just checking if there is an object still does not cause the evaluation\r\n * if (cachedValue) {\r\n * // This will set the value to be set explicitly and the callback\r\n * // will now never occur and the result will be cached\r\n * cachedValue.v = theValue;\r\n * }\r\n *\r\n * // Accessing the value again will cause the previously set value to be returned.\r\n * theValue === cachedValue.v; // true\r\n * ```\r\n */\r\nexport function getWritableLazy(cb: () => T): ILazyValue {\r\n let lazyValue = { } as ILazyValue;\r\n !_globalLazyTestHooks && _initTestHooks();\r\n lazyValue.b = _globalLazyTestHooks.lzy;\r\n\r\n let _setValue = (newValue: T) => {\r\n // Just replace the value\r\n objDefineProp(lazyValue, \"v\", {\r\n value: newValue,\r\n writable: true\r\n });\r\n\r\n if (lazyValue.b) {\r\n delete lazyValue.b;\r\n }\r\n };\r\n\r\n objDefineProp(lazyValue, \"v\", {\r\n configurable: true,\r\n get: function () {\r\n let result = cb();\r\n if (!_globalLazyTestHooks.lzy) {\r\n // Just replace the value\r\n _setValue(result);\r\n }\r\n \r\n if (_globalLazyTestHooks.lzy && lazyValue.b !== _globalLazyTestHooks.lzy) {\r\n lazyValue.b = _globalLazyTestHooks.lzy;\r\n }\r\n\r\n return result;\r\n },\r\n set: _setValue\r\n });\r\n\r\n return lazyValue;\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2024 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { NULL_VALUE } from \"../internal/constants\";\r\nimport { objDefineProp } from \"../object/define\";\r\n\r\n/**\r\n * A generic interface for holding a cached value\r\n * @since 0.10.5\r\n * @group Helpers\r\n * @group Cache\r\n * @typeParam T - The type of the value to be cached\r\n * @example\r\n * ```ts\r\n * let cachedValue: ICachedValue = {\r\n * v: \"some value\"\r\n * };\r\n * ```\r\n */\r\nexport interface ICachedValue {\r\n /**\r\n * Returns the current cached value\r\n */\r\n v: T,\r\n\r\n /**\r\n * Returns the current cached value\r\n */\r\n toJSON(): T;\r\n}\r\n\r\n/**\r\n * Create and return a readonly {@link ICachedValue} instance that is populated with the provided value.\r\n * This is useful when you want to cache a previously fetched value and return it without having to re-fetch\r\n * it again.\r\n * This is a lightweight version of {@link getLazy} which does not support any expiration or invalidation,\r\n * it also will not honor the {@link setBypassLazyCache} setting and will always return the provided value.\r\n * @since 0.10.5\r\n * @group Helpers\r\n * @group Cache\r\n * @typeParam T - The type of the value to be cached\r\n * @param value - The value to cache\r\n * @returns A new {@link ICachedValue} instance which wraps the provided value\r\n * @example\r\n * ```ts\r\n * let cachedValue = createCachedValue(\"some value\");\r\n * // cachedValue.v === \"some value\"\r\n *\r\n * JSON.stringify(cachedValue) === '{\"v\":\"some value\"}';\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function createCachedValue(value: T): ICachedValue {\r\n return objDefineProp({\r\n toJSON: () => value\r\n }, \"v\", { value }) as ICachedValue;\r\n}\r\n\r\n/**\r\n * Create and return a readonly {@link ICachedValue} instance which will cache and return the value returned\r\n * by the callback function. The callback function will only be called once, multiple access of the value\r\n * will not cause re-execution of the callback as the result from the first call is cached internally.\r\n * This is a lightweight version of {@link getLazy} which does not support any expiration or invalidation,\r\n * it also will not honor the {@link setBypassLazyCache} setting and will always return the provided value.\r\n * @since 0.10.5\r\n * @group Helpers\r\n * @group Cache\r\n * @typeParam T - The type of the value to be cached\r\n * @param cb - The callback function to fetch the value to be lazily evaluated and cached\r\n * @returns\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function createDeferredCachedValue(cb: () => T): ICachedValue {\r\n let theValue: any = {\r\n toJSON: () => theValue.v\r\n };\r\n\r\n return objDefineProp(theValue as ICachedValue, \"v\", {\r\n get: () => {\r\n let result = cb();\r\n cb = NULL_VALUE;\r\n objDefineProp(theValue, \"v\", { value: result });\r\n return result;\r\n },\r\n configurable: true\r\n });\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { NULL_VALUE, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { _getGlobalValue } from \"../internal/global\";\r\nimport { ILazyValue, _globalLazyTestHooks, _initTestHooks, getLazy } from \"./lazy\";\r\nimport { ICachedValue, createCachedValue } from \"./cache\";\r\nimport { safe } from \"./safe\";\r\n\r\nconst WINDOW = \"window\";\r\n\r\ndeclare let WorkerGlobalScope: any;\r\ndeclare let self: any;\r\n\r\nlet _cachedGlobal: ICachedValue;\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Returns a function which will return the named global object if available, will return `null` if the object is not available.\r\n * @param getFn - The function to use to get the global object\r\n * @param instName - The name of the global object to get, may be any valid PropertyKey (string, number or symbol)\r\n * @returns A function which will return the named global object if available, the funcion will return `null` if the object is not available.\r\n */\r\nexport function _getGlobalInstFn(getFn: (...args: unknown[]) => T, theArgs?: unknown[]): () => T | null | undefined {\r\n let cachedValue: ICachedValue;\r\n return function() {\r\n !_globalLazyTestHooks && _initTestHooks();\r\n if (!cachedValue || _globalLazyTestHooks.lzy) {\r\n cachedValue = createCachedValue(safe(getFn, theArgs).v);\r\n }\r\n \r\n return cachedValue.v;\r\n }\r\n}\r\n\r\n/**\r\n * Create and return an readonly {@link ILazyValue} instance which will cache and return the named global\r\n * value if available, will return `null` if the named global object is not available or if the runtime\r\n * throws an exception when attempting to access the global object.\r\n * Unlike {@link getInst} the value is cached after the first access, so if the global value changes after\r\n * the initial fetch the original cached value is still returned.\r\n * @since 0.9.5\r\n * @group Environment\r\n * @group Lazy\r\n * @group Safe\r\n * @param name - The name of the global object to get, may be any valid PropertyKey (string, number or symbol)\r\n * @returns A new readonly {@link ILazyValue} instance which will lazily attempt to return the globally\r\n * available named instance.\r\n * @example\r\n * ```ts\r\n * // This does not cause the evaluation to occur\r\n * window.myGlobal = \"Hello\";\r\n * let cachedValue = lazySafeGetInst(\"myGlobal\");\r\n * // cachedValue.v === \"Hello\"\r\n *\r\n * window.myGlobal = \"Darkness\";\r\n * // cachedValue.v === \"Hello\"\r\n *\r\n * let promiseCls = lazySafeGetInst(\"Promise\");\r\n * // null if Promise is not supported in the runtime\r\n * // otherwise the Promise class.\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function lazySafeGetInst(name: string | number | symbol) : ILazyValue {\r\n return getLazy(() => safe(getInst, [name]).v || UNDEF_VALUE);\r\n}\r\n\r\n/**\r\n * Returns the current global scope object, for a normal web page this will be the current\r\n * window, for a Web Worker this will be current worker global scope via \"self\". The internal\r\n * implementation returns the first available instance object in the following order\r\n * - globalThis (New standard)\r\n * - self (Will return the current window instance for supported browsers)\r\n * - window (fallback for older browser implementations)\r\n * - global (NodeJS standard)\r\n * - (When all else fails)\r\n * While the return type is a Window for the normal case, not all environments will support all\r\n * of the properties or functions. And this caches the lookup of the global as in some environments\r\n * this can be an expensive operation.\r\n * @group Environment\r\n * @param useCached - [Optional] used for testing to bypass the cached lookup, when `true` this will\r\n * cause the cached global to be reset.\r\n */\r\nexport function getGlobal(useCached?: boolean): Window {\r\n !_globalLazyTestHooks && _initTestHooks();\r\n if (!_cachedGlobal || useCached === false || _globalLazyTestHooks.lzy) {\r\n _cachedGlobal = createCachedValue(safe(_getGlobalValue).v || NULL_VALUE);\r\n }\r\n\r\n return _cachedGlobal.v;\r\n}\r\n\r\n/**\r\n * Return the named global object if available, will return null if the object is not available.\r\n * @group Environment\r\n * @param name - The globally named object, may be any valid property key (string, number or symbol)\r\n * @param useCached - [Optional] used for testing to bypass the cached lookup, when `true` this will\r\n * cause the cached global to be reset.\r\n * @example\r\n * ```ts\r\n * // This does not cause the evaluation to occur\r\n * window.myGlobal = \"Hello\";\r\n * let cachedValue = getInst(\"myGlobal\");\r\n * // cachedValue === \"Hello\"\r\n *\r\n * window.myGlobal = \"Darkness\";\r\n * // getInst(\"myGlobal\") === \"Darkness\"\r\n *\r\n * let promiseCls = getInst(\"Promise\");\r\n * // May throw if the global is not supported by the runtime\r\n * // otherwise the Promise class.\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function getInst(name: string | number | symbol, useCached?: boolean): T | null {\r\n let gbl: any;\r\n if (!_cachedGlobal || useCached === false) {\r\n gbl = getGlobal(useCached);\r\n } else {\r\n gbl = _cachedGlobal.v;\r\n }\r\n\r\n if (gbl && gbl[name]) {\r\n return gbl[name] as T;\r\n }\r\n\r\n // Test workaround, for environments where .window (when global == window) doesn't return the base window\r\n if (name === WINDOW) {\r\n // tslint:disable-next-line: no-angle-bracket-type-assertion\r\n try {\r\n return window as T;\r\n } catch (e) {\r\n // Ignore\r\n }\r\n }\r\n\r\n return NULL_VALUE;\r\n}\r\n\r\n/**\r\n * Identify whether the runtime contains a `document` object\r\n * @group Environment\r\n * @returns - True if a `document` exists\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function hasDocument(): boolean {\r\n return !!( /*#__PURE__*/getDocument());\r\n}\r\n\r\n/**\r\n * Return the global `document` instance.\r\n * @group Environment\r\n * @returns\r\n */\r\nexport const getDocument = (/*#__PURE__*/_getGlobalInstFn(getInst, [\"document\"]));\r\n\r\n/**\r\n * Identify whether the runtime contains a `window` object\r\n * @group Environment\r\n * @returns\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function hasWindow(): boolean {\r\n return !!( /*#__PURE__*/getWindow());\r\n}\r\n\r\n/**\r\n * Return the global `window` instance.\r\n * @group Environment\r\n * @returns\r\n */\r\nexport const getWindow = (/*#__PURE__*/_getGlobalInstFn(getInst, [WINDOW]));\r\n\r\n/**\r\n * Identify whether the runtimne contains a `navigator` object\r\n * @group Environment\r\n * @returns\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function hasNavigator(): boolean {\r\n return !!( /*#__PURE__*/getNavigator());\r\n}\r\n\r\n/**\r\n * Returns the global `navigator` instance\r\n * @group Environment\r\n * @returns\r\n */\r\nexport const getNavigator = (/*#__PURE__*/_getGlobalInstFn(getInst, [\"navigator\"]));\r\n\r\n/**\r\n * Identifies whether the runtime contains a `history` object\r\n * @group Environment\r\n * @returns\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function hasHistory(): boolean {\r\n return !!( /*#__PURE__*/getHistory());\r\n}\r\n\r\n/**\r\n * Returns the global `history` instance\r\n * @group Environment\r\n * @returns\r\n */\r\nexport const getHistory = (/*#__PURE__*/_getGlobalInstFn(getInst, [\"history\"]));\r\n\r\n/**\r\n * Simple method to determine if we are running in a node environment\r\n * @group Environment\r\n * @returns True if you are\r\n */\r\nexport const isNode = (/*#__PURE__*/_getGlobalInstFn(() => {\r\n return !!( /*#__PURE__*/safe(() => (process && (process.versions||{}).node)).v);\r\n}));\r\n\r\n/**\r\n * Helper to identify if you are running as a Dedicated, Shared or Service worker\r\n * @group Environment\r\n * @returns True if the environment you are in looks like a Web Worker\r\n */\r\nexport const isWebWorker = (/*#__PURE__*/_getGlobalInstFn(() => {\r\n return !!( /*#__PURE__*/safe(() => self && self instanceof WorkerGlobalScope).v);\r\n}));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { NULL_VALUE, SYMBOL, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { polyGetKnownSymbol, polyNewSymbol, polySymbolFor, polySymbolKeyFor } from \"../polyfills/symbol\";\r\nimport { WellKnownSymbols, _wellKnownSymbolMap } from \"./well_known\";\r\nimport { _createIs } from \"../helpers/base\";\r\nimport { _globalLazyTestHooks, _initTestHooks } from \"../helpers/lazy\";\r\nimport { ICachedValue, createCachedValue } from \"../helpers/cache\";\r\nimport { safe } from \"../helpers/safe\";\r\nimport { getInst } from \"../helpers/environment\";\r\n\r\nlet _symbol: ICachedValue;\r\nlet _symbolFor: ICachedValue<(key: string) => symbol>;\r\nlet _symbolKeyFor: ICachedValue<(sym: symbol) => string | undefined>;\r\n\r\n/*#__NO_SIDE_EFFECTS__*/\r\nfunction _initSymbol() {\r\n _symbol = (/*#__PURE__*/createCachedValue(safe(getInst, [SYMBOL]).v));\r\n\r\n return _symbol;\r\n}\r\n\r\nfunction _getSymbolKey(key: string) {\r\n let gblSym = ((!_globalLazyTestHooks.lzy ? _symbol : 0) || _initSymbol());\r\n\r\n return (gblSym.v ? gblSym.v[key] : UNDEF_VALUE) as R;\r\n}\r\n\r\n/**\r\n * Checks if the type of value is a symbol.\r\n * @group Symbol\r\n * @param value - Value to be checked.\r\n * @return True if the value is a symbol, false otherwise.\r\n */\r\nexport const isSymbol: (value: any) => value is symbol = (/*#__PURE__*/_createIs(\"symbol\"));\r\n\r\n/**\r\n * Helper to identify whether the runtime support the Symbols either via native or an installed polyfill\r\n * @group Symbol\r\n * @returns true if Symbol's are support otherwise false\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function hasSymbol(): boolean {\r\n return !!( /*#__PURE__*/getSymbol());\r\n}\r\n\r\n/**\r\n * If Symbols are supported then attempt to return the named Symbol\r\n * @group Symbol\r\n * @returns The value of the named Symbol (if available)\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function getSymbol(): Symbol {\r\n !_globalLazyTestHooks && _initTestHooks();\r\n \r\n // Get the current lazy symbol or cause it to get initialized\r\n return ((!_globalLazyTestHooks.lzy ? _symbol : 0) || _initSymbol()).v;\r\n}\r\n\r\n/**\r\n * If Symbols are supported then get the property of the global Symbol, if Symbol's are\r\n * not supported and noPoly is true it returns null. Used to access the well known symbols.\r\n * @group Symbol\r\n * @param name - The property name to return (if it exists) for Symbol\r\n * @param noPoly - Flag indicating whether to return a polyfill if symbols are not supported.\r\n * @returns The value of the property if present\r\n * @example\r\n * ```ts\r\n * // If Symbol is supported in the runtime\r\n * getKnownSymbol(\"toStringTag\") === Symbol.toStringTag; // true\r\n * getKnownSymbol(WellKnownSymbols.toStringTag) === Symbol.toStringTag; // true\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function getKnownSymbol(name: string | WellKnownSymbols, noPoly?: boolean): T {\r\n let knownName = _wellKnownSymbolMap[name];\r\n !_globalLazyTestHooks && _initTestHooks();\r\n\r\n // Get the current lazy symbol or cause it to get initialized\r\n let sym = ((!_globalLazyTestHooks.lzy ? _symbol : 0) || _initSymbol());\r\n \r\n return sym.v ? sym.v[knownName || name] : (!noPoly ? polyGetKnownSymbol(name) : UNDEF_VALUE);\r\n}\r\n\r\n/**\r\n * Returns a new unique Symbol value. If noPoly is true and symbols are not supported\r\n * then this will return null.\r\n * @group Symbol\r\n * @param description - Description of the new Symbol object.\r\n * @param noPoly - Flag indicating whether to return a polyfil if symbols are not supported.\r\n * @returns The new symbol\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function newSymbol(description?: string | number, noPoly?: boolean): symbol {\r\n !_globalLazyTestHooks && _initTestHooks();\r\n\r\n // Get the current lazy symbol or cause it to get initialized\r\n let sym = ((!_globalLazyTestHooks.lzy ? _symbol : 0) || _initSymbol());\r\n\r\n return sym.v ? (sym.v as any)(description) : (!noPoly ? polyNewSymbol(description) : NULL_VALUE);\r\n}\r\n\r\n/**\r\n * Returns a Symbol object from the global symbol registry matching the given key if found.\r\n * Otherwise, returns a new symbol with this key. This will always return a polyfill if symbols\r\n * are not supported.\r\n * @group Symbol\r\n * @param key - key to search for.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function symbolFor(key: string): symbol {\r\n !_globalLazyTestHooks && _initTestHooks();\r\n\r\n // Cause lazy symbol to get initialized\r\n _symbolFor = ((!_globalLazyTestHooks.lzy ? _symbolFor : 0) || (/*#__PURE__*/createCachedValue(safe(_getSymbolKey, [\"for\"]).v)));\r\n\r\n return (_symbolFor.v || polySymbolFor)(key);\r\n}\r\n\r\n/**\r\n * Returns a key from the global symbol registry matching the given Symbol if found.\r\n * Otherwise, returns a undefined. This will always attempt to lookup the polyfill\r\n * implementation if symbols are not supported\r\n * @group Symbol\r\n * @param sym - Symbol to find the key for.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function symbolKeyFor(sym: symbol): string | undefined {\r\n !_globalLazyTestHooks && _initTestHooks();\r\n\r\n // Cause lazy symbol to get initialized\r\n _symbolKeyFor = ((!_globalLazyTestHooks.lzy ? _symbolKeyFor : 0) || (/*#__PURE__*/createCachedValue(safe(_getSymbolKey, [\"keyFor\"]).v)));\r\n\r\n return (_symbolKeyFor.v || polySymbolKeyFor)(sym);\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ICachedValue, createCachedValue } from \"../helpers/cache\";\r\nimport { CALL, NULL_VALUE, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { getKnownSymbol } from \"../symbol/symbol\";\r\nimport { WellKnownSymbols } from \"../symbol/well_known\";\r\nimport { isIterator } from \"./iterator\";\r\n\r\nlet _iterSymbol: ICachedValue;\r\n\r\n/**\r\n * Calls the provided `callbackFn` function once for each element in the iterator or iterator returned by\r\n * the iterable and processed in the same order as returned by the iterator. As with the {@link arrForEach}\r\n * you CAN stop / break the iteration by returning -1 from the`callbackFn` function.\r\n *\r\n * The order of processing is not reset if you add or remove elements to the iterator, the actual behavior\r\n * will depend on the iterator imeplementation.\r\n *\r\n * If the passed `iter` is both an Iterable and Iterator the Iterator interface takes preceedence.\r\n * @remarks\r\n * If Symbols are NOT supported then the iterable MUST be using the same polyFill for the well know symbols,\r\n * if you are targetting a mixed environment you SHOULD either\r\n * - only use the polyfill Symbol's provided by this library\r\n * - ensure that you add any symbol polyfills BEFORE these utilities\r\n * iterForOf expects a `synchronous` function.\r\n * iterForOf does not wait for promises. Make sure you are aware of the implications while using\r\n * promises (or async functions) as forEach callback.\r\n *\r\n * @since 0.4.2\r\n * @group Iterator\r\n * @typeParam T - Identifies the element type of the iterator\r\n * @param callbackfn - A `synchronous` function that accepts up to three arguments. iterForOf calls the\r\n * callbackfn function one time for each element returned by the iterator.\r\n * @param thisArg - An object to which the this keyword can refer in the callbackfn function. If thisArg is\r\n * omitted, null or undefined the iterator will be used as the this value.\r\n * @throws Any exception thrown while processing the iterator\r\n * @example\r\n * ```ts\r\n * const items = {\r\n * 'item1': 'value1',\r\n * 'item2': 'value2',\r\n * 'item3': 'value3\r\n * };\r\n * const copyItems = [];\r\n *\r\n * iterForOf(items, (item) => {\r\n * copyItems.push(item);\r\n * // May return -1 to abort the iteration\r\n * });\r\n * ```\r\n */\r\nexport function iterForOf(iter: Iterator | Iterable, callbackfn: (value: T, count?: number, iter?: Iterator) => void | number, thisArg?: any): void {\r\n if (iter) {\r\n if (!isIterator(iter)) {\r\n !_iterSymbol && (_iterSymbol = createCachedValue(getKnownSymbol(WellKnownSymbols.iterator)));\r\n iter = iter[_iterSymbol.v] ? iter[_iterSymbol.v]() : NULL_VALUE;\r\n }\r\n \r\n if (isIterator(iter)) {\r\n let err: { e: any } = UNDEF_VALUE;\r\n let iterResult: IteratorResult = UNDEF_VALUE;\r\n try {\r\n let count = 0;\r\n while(!(iterResult = iter.next()).done) {\r\n if (callbackfn[CALL](thisArg || iter, iterResult.value, count, iter) === -1) {\r\n break;\r\n }\r\n \r\n count++;\r\n }\r\n } catch (failed) {\r\n err = { e: failed };\r\n if (iter.throw) {\r\n iterResult = NULL_VALUE;\r\n iter.throw(err);\r\n }\r\n } finally {\r\n try {\r\n if (iterResult && !iterResult.done) {\r\n iter.return && iter.return(iterResult);\r\n }\r\n } finally {\r\n if (err) {\r\n // eslint-disable-next-line no-unsafe-finally\r\n throw err.e;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { getKnownSymbol } from \"../symbol/symbol\";\r\nimport { WellKnownSymbols } from \"../symbol/well_known\";\r\nimport { isFunction, isStrictNullOrUndefined } from \"../helpers/base\";\r\n\r\n/**\r\n * Checks if the type of value looks like an iterator instance (contains a next function).\r\n *\r\n * @since 0.4.0\r\n * @group Type Identity\r\n * @group Iterator\r\n * @typeParam T - Identifies the return type of the iterator defaults to any\r\n * @param value - The value to be checked\r\n * @returns True if the value is an Iterator, otherwise false\r\n * @example\r\n * ```ts\r\n * isIterator(null); // false\r\n * isIterator(undefined); // false\r\n * isIterator(\"null\"); // false (Strings are iterable but not iterators)\r\n * isIterator([]); // false (Arrays are iterable but not iterators)\r\n * isIterator({\r\n * next: function() { return true }\r\n * }); // true, iterators must contain a \"next\" function\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isIterator(value: any): value is Iterator {\r\n return !!value && isFunction(value.next);\r\n}\r\n\r\n/**\r\n * Checks if the value looks like it is iterable, contains a [symbol.iterator].\r\n *\r\n * @since 0.4.0\r\n * @group Type Identity\r\n * @group Iterator\r\n * @typeParam T - Identifies the return type of the iterator\r\n * @param value - The value to be checked\r\n * @returns True if the value is an Iterable, otherwise false\r\n * @example\r\n * ```ts\r\n * isIterable(null); // false\r\n * isIterable(undefined); // false\r\n * isIterable(\"null\"); // true (Strings are iterable)\r\n * isIterable([]); // true (Arrays are iterable)\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isIterable(value: any): value is Iterable {\r\n return !isStrictNullOrUndefined(value) && isFunction(value[getKnownSymbol(WellKnownSymbols.iterator)]);\r\n}","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2023 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ArrSlice, CALL } from \"../internal/constants\";\r\n\r\n/**\r\n * The `fnApply` function calls the specified `fn` function with the given `thisArg` as the `this` value,\r\n * and the optional `argArray` arguments provided as an array (or an Array-Like Object).\r\n *\r\n * Normally, when calling a function, the value of `this` inside the function is the object that the\r\n * function was accessed on. With `fnApply()`, you can assign an arbitrary value as this when calling an\r\n * existing function, without first attaching the function to the object as a property. This allows you\r\n * to use methods of one object as generic utility functions.\r\n *\r\n * You can also use any kind of object which is ArrayLike as the second parameter. In practice, this means\r\n * that it needs to have a length property, and integer (\"index\") properties in the range (0..length - 1).\r\n * For example, you could use a NodeList, or a custom object like `{ 'length': 2, '0': 'eat', '1': 'bananas' }`.\r\n * You can also use `arguments`.\r\n *\r\n * @since 0.9.8\r\n * @group Function\r\n *\r\n * @param fn - The function to be called\r\n * @param thisArg - The value of `this` provided for the call to `fn`. If the function is not in strict mode,\r\n * `null` and `undefined` will be replaced with the global object, and primitive values will be converted to objects.\r\n * @param argArray - An array-like object, specifying the arguments with which `fn` should be called, or `null` or\r\n * `undefined` if no arguments should be provided to the function.\r\n * @returns The result of calling the function with the specified `this` value and arguments.\r\n * @example\r\n * ```ts\r\n * // min / max number in an array\r\n * let max = fnApply(Math.max, null, [ 21, 42, 84, 168, 7, 3 ]);\r\n * // 168\r\n *\r\n * let min = fnApply(Math.min, null, [ 21, 42, 84, 168, 7, 3 ]);\r\n * // 3\r\n *\r\n * const module1 = {\r\n * prefix: \"Hello\",\r\n * x: 21,\r\n * getX() {\r\n * return this.x;\r\n * },\r\n * log(value: string) {\r\n * return this.prefix + \" \" + value + \" : \" + this.x\r\n * }\r\n * };\r\n *\r\n * // The 'this' parameter of 'getX' is bound to 'module'.\r\n * module1.getX(); // 21\r\n * module1.log(\"Darkness\"); // Hello Darkness : 21\r\n *\r\n * // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.\r\n * let module2 = {\r\n * prefix: \"my\",\r\n * x: 42\r\n * };\r\n *\r\n * // Call the function of module1 with module2 as it's this\r\n * fnApply(module1.getX, module2); // 42\r\n * fnApply(module1.log, module2, [ \"friend\" ]); // my friend : 42\r\n * ```\r\n */\r\nexport function fnApply any, T>(fn: F, thisArg: T, argArray?: ArrayLike): ReturnType {\r\n return fn.apply(thisArg, argArray);\r\n}\r\n\r\n/**\r\n * The `fnCall` function calls the function with the given `thisArg` as the `this` value and with\r\n * al of the `_args` provided as it's `arguments`.\r\n *\r\n * Note: This is almost identical to `fnApply`, except that the function arguments are passed to `fnCall`\r\n * individually as a list, while with `fnApply` that are combined into a single array argument.\r\n *\r\n * Normally, when calling a function, the value of `this` inside the function is the object that the\r\n * function was accessed on. With `fnCall()`, you can pass an arbitrary value as the `this` when calling an\r\n * existing function, without first attaching the function to the object as a property. This allows you\r\n * to use methods of one object as generic utility functions.\r\n *\r\n * @since 0.9.8\r\n * @group Function\r\n *\r\n * @param fn - The function to be called\r\n * @param thisArg - The value of `this` provided for the call to `fn`. If the function is not in strict mode,\r\n * `null` and `undefined` will be replaced with the global object, and primitive values will be converted to objects.\r\n * @param _args - The zero or more arguments to be passed to the `fn` function.\r\n * @returns The result of calling the function with the specified `this` value and arguments.\r\n * @example\r\n * ```ts\r\n * // min / max number in an array\r\n * let max = fnCall(Math.max, null, 21, 42, 84, 168, 7, 3);\r\n * // 168\r\n *\r\n * let min = fnCall(Math.min, null, 21, 42, 84, 168, 7, 3);\r\n * // 3\r\n *\r\n * const module1 = {\r\n * prefix: \"Hello\",\r\n * x: 21,\r\n * getX() {\r\n * return this.x;\r\n * },\r\n * log(value: string) {\r\n * return this.prefix + \" \" + value + \" : \" + this.x\r\n * }\r\n * };\r\n *\r\n * // The 'this' parameter of 'getX' is bound to 'module'.\r\n * module1.getX(); // 21\r\n * module1.log(\"Darkness\"); // Hello Darkness : 21\r\n *\r\n * // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.\r\n * let module2 = {\r\n * prefix: \"my\",\r\n * x: 42\r\n * };\r\n *\r\n * // Call the function of module1 with module2 as it's this\r\n * fnCall(module1.getX, module2); // 42\r\n * fnCall(module1.log, module2, \"friend\"); // my friend : 42\r\n * ```\r\n */\r\nexport function fnCall any, T>(fn: F, thisArg: T, ...argArray: any[]): ReturnType;\r\n\r\n/**\r\n * The `fnCall` function calls the function with the given `thisArg` as the `this` value and with\r\n * al of the `_args` provided as it's `arguments.\r\n *\r\n * > This is almost identical to `fnApply`, except that the function arguments are passed to `fnCall`\r\n * individually as a list, while with `fnApply` that are combined into a single array argument.\r\n *\r\n * Normally, when calling a function, the value of `this` inside the function is the object that the\r\n * function was accessed on. With `fnCall()`, you can pass an arbitrary value as the `this` when calling an\r\n * existing function, without first attaching the function to the object as a property. This allows you\r\n * to use methods of one object as generic utility functions.\r\n *\r\n * @since 0.9.8\r\n * @group Function\r\n *\r\n * @param fn - The function to be called\r\n * @param thisArg - The value of `this` provided for the call to `fn`. If the function is not in strict mode,\r\n * `null` and `undefined` will be replaced with the global object, and primitive values will be converted to objects.\r\n * @param _args - The zero or more arguments to be passed to the `fn` function.\r\n * @returns The result of calling the function with the specified `this` value and arguments.\r\n * @example\r\n * ```ts\r\n * const module1 = {\r\n * prefix: \"Hello\",\r\n * x: 21,\r\n * getX() {\r\n * return this.x;\r\n * },\r\n * log(value: string) {\r\n * return this.prefix + \" \" + value + \" : \" + this.x\r\n * }\r\n * };\r\n *\r\n * // The 'this' parameter of 'getX' is bound to 'module'.\r\n * module1.getX(); // 21\r\n * module1.log(\"Darkness\"); // Hello Darkness : 21\r\n *\r\n * // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.\r\n * let module2 = {\r\n * prefix: \"my\",\r\n * x: 42\r\n * };\r\n *\r\n * // Call the function of module1 with module2 as it's this\r\n * fnCall(module1.getX, module2); // 42\r\n * fnCall(module1.log, module2, \"friend\"); // my friend : 42\r\n * ```\r\n */\r\nexport function fnCall any, T>(fn: F, thisArg: T): ReturnType {\r\n return fn.apply(thisArg, ArrSlice[CALL](arguments, 2));\r\n}\r\n\r\n/**\r\n * Creates a new function that when called will set the value of `thisArg` as the `this` keyword\r\n * value whrn calling the provided `fn` instance, and all of the arguments passed to the new\r\n * function will be passed along to the original provided instance.\r\n * @param fn - The function instance to be called\r\n * @param thisArg - The value to be used as the `this` when calling the `fn`\r\n * @returns The value returned by the original `fn` after executing with the provided `thisArg`.\r\n * @since 0.9.8\r\n * @group Function\r\n * @example\r\n * ```ts\r\n * const module1 = {\r\n * x: 21,\r\n * getX() {\r\n * return this.x;\r\n * },\r\n * };\r\n *\r\n * // The 'this' parameter of 'getX' is bound to 'module'.\r\n * console.log(module1.getX()); // 21\r\n *\r\n * // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.\r\n * let module2 = {\r\n * x: 42\r\n * };\r\n *\r\n * module2.getX = fnBind(module1.getX, module2);\r\n * module2.getX(); // 42\r\n *\r\n * // It can also be used to proxy to the original function from the new one\r\n * module2.getX = fnBind(module1.getX, module1);\r\n * module2.getX(); // 21\r\n * ```\r\n */\r\nexport function fnBind(fn: F, thisArg: T, ...argArray: any[]): F;\r\n\r\n/**\r\n * Creates a new function that when called will set the value of `thisArg` as the `this` keyword\r\n * value whrn calling the provided `fn` instance, and all of the arguments passed to the new\r\n * function will be passed along to the original provided instance.\r\n * @param fn - The function instance to be called\r\n * @param thisArg - The value to be used as the `this` when calling the `fn`\r\n * @returns The value returned by the original `fn` after executing with the provided `thisArg`.\r\n * @since 0.9.8\r\n * @group Function\r\n * @example\r\n * ```ts\r\n * const module1 = {\r\n * x: 21,\r\n * getX() {\r\n * return this.x;\r\n * },\r\n * };\r\n *\r\n * // The 'this' parameter of 'getX' is bound to 'module'.\r\n * console.log(module1.getX()); // 21\r\n *\r\n * // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.\r\n * let module2 = {\r\n * x: 42\r\n * };\r\n *\r\n * module2.getX = fnBind(module1.getX, module2);\r\n * module2.getX(); // 42\r\n *\r\n * // It can also be used to proxy to the original function from the new one\r\n * module2.getX = fnBind(module1.getX, module1);\r\n * module2.getX(); // 21\r\n * ```\r\n */\r\nexport function fnBind(fn: F, thisArg: T): F {\r\n return fn.bind.apply(fn, ArrSlice[CALL](arguments, 1));\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { isArray, isUndefined } from \"../helpers/base\";\r\nimport { isIterable, isIterator } from \"../iterator/iterator\";\r\nimport { iterForOf } from \"../iterator/forOf\";\r\nimport { fnApply } from \"../funcs/funcs\";\r\n\r\n/**\r\n * Appends the `elms` to the `target` where the elms may be an array, a single object\r\n * or an iterator object\r\n * @group Array\r\n * @group Iterator\r\n * @example\r\n * ```ts\r\n * let theArray = arrAppend([], 1);\r\n * arrAppend(theArray, [ 2, 3, 4 ]);\r\n * arrAppend(theArray, [ \"a\", \"b\", \"c\" ]);\r\n * // theArray is now [ 1, 2, 3, 4, \"a\", \"b\", \"c\" ]\r\n * ```\r\n * @param target - The target array\r\n * @param elms - The item, array of items an iterable or iterator object of items to add to the target\r\n * @returns The passed in target array\r\n * @example\r\n * ```ts\r\n * // Adding a single value\r\n * arrAppend([], undefined); // []\r\n * arrAppend([], 0); // [ 0 ]\r\n * arrAppend([1], undefined); // [ 1 ]\r\n * arrAppend([1], 2); // [ 1, 2 ]\r\n *\r\n * // Adding an array\r\n * arrAppend([], [] as number[]); // []\r\n * arrAppend([], [0]); // [ 0 ]\r\n * arrAppend([1], []); // [ 1 ]\r\n * arrAppend([1], [2]); // [ 1, 2 ]\r\n *\r\n * // Adding with an iterator\r\n * arrAppend([], ([] as number[]).values()); // []\r\n * arrAppend([], [0].values()); // [ 0 ]\r\n * arrAppend([1], [].keys()); // [ 1 ]\r\n * arrAppend([1], [2].values()); // [ 1, 2 ]\r\n * arrAppend([1], [2].keys()); // [ 1, 0 ] - 0 is from the index from the first element\r\n * ```\r\n */\r\nexport function arrAppend(target: T[], elms: T | T[] | Iterator): T[] {\r\n if (!isUndefined(elms) && target) {\r\n if (isArray(elms)) {\r\n // This is not just \"target.push(elms)\" but becomes effectively \"target.push(elms[0], elms[1], ...)\"\r\n fnApply(target.push, target, elms);\r\n } else if (isIterator(elms) || isIterable(elms)) {\r\n iterForOf(elms, (elm) => {\r\n target.push(elm);\r\n });\r\n } else {\r\n target.push(elms);\r\n }\r\n }\r\n\r\n return target;\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { CALL, LENGTH } from \"../internal/constants\";\r\n\r\n/**\r\n * Calls the provided `callbackFn` function once for each element in an array in ascending index order. It is not invoked for index properties\r\n * that have been deleted or are uninitialized. And unlike the ES6 forEach() you CAN stop or break the iteration by returning -1 from the\r\n * `callbackFn` function.\r\n *\r\n * The range (number of elements) processed by arrForEach() is set before the first call to the `callbackFn`. Any elements added beyond the range\r\n * or elements which as assigned to indexes already processed will not be visited by the `callbackFn`.\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the element type of the array\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param callbackfn - A `synchronous` function that accepts up to three arguments. arrForEach calls the callbackfn function one time for each element in the array.\r\n * @param thisArg - An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, null or undefined\r\n * the array will be used as the this value.\r\n * @remarks\r\n * arrForEach expects a `synchronous` function.\r\n * arrForEach does not wait for promises. Make sure you are aware of the implications while using promises (or async functions) as forEach callback.\r\n * @example\r\n * ```ts\r\n * const items = ['item1', 'item2', 'item3'];\r\n * const copyItems = [];\r\n *\r\n * // before using for loop\r\n * for (let i = 0; i < items.length; i++) {\r\n * copyItems.push(items[i]);\r\n * }\r\n *\r\n * // before using forEach()\r\n * items.forEach((item) => {\r\n * copyItems.push(item);\r\n * });\r\n *\r\n * // after\r\n * arrForEach(items, (item) => {\r\n * copyItems.push(item);\r\n * // May return -1 to abort the iteration\r\n * });\r\n *\r\n * // Also supports input as an array like object\r\n * const items = { length: 3, 0: 'item1', 1: 'item2', 2: 'item3' };\r\n * ```\r\n */\r\nexport function arrForEach(theArray: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => void | number, thisArg?: any): void {\r\n if (theArray) {\r\n const len = theArray[LENGTH] >>> 0;\r\n for (let idx = 0; idx < len; idx++) {\r\n if (idx in theArray) {\r\n if (callbackfn[CALL](thisArg || theArray, theArray[idx], idx, theArray) === -1) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ArrProto } from \"../internal/constants\";\r\nimport { _unwrapFunction } from \"../internal/unwrapFunction\";\r\n\r\n/**\r\n * The arrIndexOf() method returns the first index at which a given element can be found in the array,\r\n * or -1 if it is not present.\r\n * `arrIndexOf()` compares searchElement to elements of the Array using strict equality (the same\r\n * method used by the === or triple-equals operator).\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the type of array elements\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param searchElement - The element to locate in the array.\r\n * @param fromIndex - The index to start the search at. If the index is greater than or equal to\r\n * the array's length, -1 is returned, which means the array will not be searched. If the provided\r\n * index value is a negative number, it is taken as the offset from the end of the array.\r\n * Note: if the provided index is negative, the array is still searched from front to back. If the\r\n * provided index is 0, then the whole array will be searched. Default: 0 (entire array is searched).\r\n * @return The first index of the element in the array; -1 if not found.\r\n * @example\r\n * ```ts\r\n * const array = [2, 9, 9];\r\n * arrIndexOf(array, 2); // 0\r\n * arrIndexOf(array, 7); // -1\r\n * arrIndexOf(array, 9, 2); // 2\r\n * arrIndexOf(array, 2, -1); // -1\r\n * arrIndexOf(array, 2, -3); // 0\r\n *\r\n * let indices: number[] = [];\r\n * const array = ['a', 'b', 'a', 'c', 'a', 'd'];\r\n * const element = 'a';\r\n * let idx = arrIndexOf(array, element);\r\n * while (idx !== -1) {\r\n * indices.push(idx);\r\n * idx = arrIndexOf(array, element, idx + 1);\r\n * }\r\n * console.log(indices);\r\n * // [0, 2, 4]\r\n *\r\n * function updateVegetablesCollection (veggies, veggie) {\r\n * if (arrIndexOf(veggies, veggie) === -1) {\r\n * veggies.push(veggie);\r\n * console.log('New veggies collection is : ' + veggies);\r\n * } else {\r\n * console.log(veggie + ' already exists in the veggies collection.');\r\n * }\r\n * }\r\n *\r\n * let veggies = ['potato', 'tomato', 'chillies', 'green-pepper'];\r\n *\r\n * updateVegetablesCollection(veggies, 'spinach');\r\n * // New veggies collection is : potato,tomato,chillies,green-pepper,spinach\r\n * updateVegetablesCollection(veggies, 'spinach');\r\n * // spinach already exists in the veggies collection.\r\n *\r\n * // Array Like\r\n * let arrayLike = {\r\n * length: 3,\r\n * 0: \"potato\",\r\n * 1: \"tomato\",\r\n * 2: \"chillies\",\r\n * 3: \"green-pepper\" // Not checked as index is > length\r\n * };\r\n *\r\n * arrIndexOf(arrayLike, \"potato\"); // 0\r\n * arrIndexOf(arrayLike, \"tomato\"); // 1\r\n * arrIndexOf(arrayLike, \"chillies\"); 2\r\n * arrIndexOf(arrayLike, \"green-pepper\"); // -1\r\n * ```\r\n */\r\nexport const arrIndexOf: (theArray: ArrayLike, searchElement: T, fromIndex?: number) => number = (/*#__PURE__*/_unwrapFunction(\"indexOf\", ArrProto));\r\n\r\n/**\r\n * The arrLastIndexOf() method returns the last index at which a given element can be found in the array,\r\n * or -1 if it is not present.\r\n * `arrLastIndexOf()` compares searchElement to elements of the Array using strict equality (the same\r\n * method used by the === or triple-equals operator). [NaN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN)\r\n * values are never compared as equal, so arrLastIndexOf() always returns -1 when searchElement is NaN.\r\n *\r\n * The arrLastIndexOf() method skips empty slots in sparse arrays.\r\n *\r\n * The arrLastIndexOf() method is generic. It only expects the this value to have a length property and integer-keyed properties.\r\n *\r\n * @since 0.8.0\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the type of array elements\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param searchElement - The element to locate in the array.\r\n * @param fromIndex - Zero-based index at which to start searching backwards, converted to an integer.\r\n * - Negative index counts back from the end of the array — if fromIndex \\< 0, fromIndex + array.length is used.\r\n * - If fromIndex \\< -array.length, the array is not searched and -1 is returned. You can think of it conceptually\r\n * as starting at a nonexistent position before the beginning of the array and going backwards from there. There\r\n * are no array elements on the way, so searchElement is never found.\r\n * - If fromIndex \\>= array.length or fromIndex is omitted, array.length - 1 is used, causing the entire array to\r\n * be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements.\r\n * @return The first index of the element in the array; -1 if not found.\r\n * @example\r\n * ```ts\r\n * const numbers = [2, 5, 9, 2];\r\n * arrLastIndexOf(numbers, 2); // 3\r\n * arrLastIndexOf(numbers, 7); // -1\r\n * arrLastIndexOf(numbers, 2, 3); // 3\r\n * arrLastIndexOf(numbers, 2, 2); // 0\r\n * arrLastIndexOf(numbers, 2, -2); // 0\r\n * arrLastIndexOf(numbers, 2, -1); // 3\r\n *\r\n * let indices: number[] = [];\r\n * const array = [\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"];\r\n * const element = \"a\";\r\n * let idx = arrLastIndexOf(array, element);\r\n * while (idx !== -1) {\r\n * indices.push(idx);\r\n * idx = arrLastIndexOf(array, element, idx ? idx - 1 : -(array.length + 1));\r\n * }\r\n * console.log(indices);\r\n * // [4, 2, 0]\r\n *\r\n * function updateVegetablesCollection (veggies, veggie) {\r\n * if (arrLastIndexOf(veggies, veggie) === -1) {\r\n * veggies.push(veggie);\r\n * console.log('New veggies collection is : ' + veggies);\r\n * } else {\r\n * console.log(veggie + ' already exists in the veggies collection.');\r\n * }\r\n * }\r\n *\r\n * let veggies = ['potato', 'tomato', 'chillies', 'green-pepper'];\r\n *\r\n * updateVegetablesCollection(veggies, 'spinach');\r\n * // New veggies collection is : potato,tomato,chillies,green-pepper,spinach\r\n * updateVegetablesCollection(veggies, 'spinach');\r\n * // spinach already exists in the veggies collection.\r\n *\r\n * // Array Like\r\n * let arrayLike = {\r\n * length: 3,\r\n * 0: \"potato\",\r\n * 1: \"tomato\",\r\n * 2: \"chillies\",\r\n * 3: \"green-pepper\" // Not checked as index is > length\r\n * };\r\n *\r\n * arrLastIndexOf(arrayLike, \"potato\"); // 0\r\n * arrLastIndexOf(arrayLike, \"tomato\"); // 1\r\n * arrLastIndexOf(arrayLike, \"chillies\"); 2\r\n * arrLastIndexOf(arrayLike, \"green-pepper\"); // -1\r\n * ```\r\n */\r\nexport const arrLastIndexOf: (theArray: ArrayLike, searchElement: T, fromIndex?: number) => number = (/*#__PURE__*/_unwrapFunction(\"lastIndexOf\", ArrProto));","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ArrProto } from \"../internal/constants\";\r\nimport { _unwrapFunction } from \"../internal/unwrapFunction\";\r\nimport { ArrMapCallbackFn } from \"./callbacks\";\r\n\r\n/**\r\n * The arrMap() method creates a new array populated with the results of calling a provided function on every\r\n * element in the calling array.\r\n *\r\n * `arrMap` calls a provided callbackFn function once for each element in an array, in order, and constructs\r\n * a new array from the results. callbackFn is invoked only for indexes of the array which have assigned\r\n * values (including undefined).\r\n *\r\n * It is not called for missing elements of the array; that is:\r\n * - indexes that have never been set;\r\n * - indexes which have been deleted.\r\n *\r\n * @since 0.3.3\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the type of the array elements\r\n * @typeParam R - Identifies the type of the elements returned by the callback function, defaults to T.\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param callbackFn - The function that is called for evetn element of `theArray`.\r\n * @param thisArg - The value to use as the `this` when executing the `callbackFn`.\r\n * @example\r\n * ```ts\r\n * const numbers = [1, 4, 9];\r\n * const roots = arrMap(numbers, (num) => Math.sqrt(num));\r\n *\r\n * // roots is now [1, 2, 3]\r\n * // numbers is still [1, 4, 9]\r\n *\r\n * const kvArray = [{ key: 1, value: 10 },\r\n * { key: 2, value: 20 },\r\n * { key: 3, value: 30 }];\r\n *\r\n * const reformattedArray = arrMap(kvArray, ({ key, value}) => ({ [key]: value }));\r\n *\r\n * // reformattedArray is now [{1: 10}, {2: 20}, {3: 30}],\r\n *\r\n * // kvArray is still:\r\n * // [{key: 1, value: 10},\r\n * // {key: 2, value: 20},\r\n * // {key: 3, value: 30}]\r\n *\r\n * // Also supports Array Like objects with same output\r\n * const kvArray = {\r\n * length: 3,\r\n * 0: { key: 1, value: 10 },\r\n * 1: { key: 2, value: 20 },\r\n * 2: { key: 3, value: 30 }\r\n * };\r\n * ```\r\n */\r\nexport const arrMap: (theArray: ArrayLike, callbackFn: ArrMapCallbackFn, thisArg?: any) => R[] = (/*#__PURE__*/_unwrapFunction(\"map\", ArrProto));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ArrSlice, CALL, NULL_VALUE } from \"../internal/constants\";\r\n\r\n/**\r\n * The arrSlice() method returns a shallow copy of a portion of an array into a new array object\r\n * selected from start to end (end not included) where start and end represent the index of items\r\n * in that array. The original array will not be modified.\r\n *\r\n * The `arrSlice()` method is a copying method. It does not alter this but instead returns a shallow\r\n * copy that contains some of the same elements as the ones from the original array.\r\n *\r\n * The `arrSlice()` method preserves empty slots. If the sliced portion is sparse, the returned arra\r\n * is sparse as well.\r\n *\r\n * The `arrSlice()` method is generic. It only expects the this value to have a length property and\r\n * integer-keyed properties.\r\n *\r\n * For both start and end, a negative index can be used to indicate an offset from the end of the array.\r\n * For example, -2 refers to the second to last element of the array.\r\n * @since 0.9.3\r\n * @group Array\r\n * @group ArrayLike\r\n * @param start - Zero-based index at which to start extraction, converted to an integer.\r\n * - Negative index counts back from the end of the array — if start \\< 0, start + array.length is used.\r\n * - If start \\< -array.length or start is omitted, 0 is used.\r\n * - If start \\>= array.length, nothing is extracted.\r\n * @param end - Zero-based index at which to end extraction, converted to an integer. slice() extracts\r\n * up to but not including end.\r\n * - Negative index counts back from the end of the array — if end \\< 0, end + array.length is used.\r\n * - If end \\< -array.length, 0 is used.\r\n * - If end \\>= array.length or end is omitted, array.length is used, causing all elements until the\r\n * end to be extracted.\r\n * - If end is positioned before or at start after normalization, nothing is extracted.\r\n * @example\r\n * ```ts\r\n * const lyrics = [\"Hello\", \"Darkness\", \"my\", \"old\", \"friend.\", \"I've\", \"come\", \"to\", \"talk\" ];\r\n *\r\n * arrSlice(lyrics); // [ \"Hello\", \"Darkness\", \"my\", \"old\", \"friend.\", \"I've\", \"come\", \"to\", \"talk\" ]\r\n * arrSlice(lyrics, 1, 3); // [ \"Darkness\", \"my\" ]\r\n * arrSlicw(lyrics, 2); // [ \"my\", \"old\", \"friend.\", \"I've\", \"come\", \"to\", \"talk\" ]\r\n * arrSlice(lyrics, 2, 4); // [ \"my\", \"old\" ]\r\n * arrSlice(lyrics, 1, 5); // [ \"Darkness\", \"my\", \"old\", \"friend.\" ]\r\n * arrSlice(lyrics, -2); // [ \"to\", \"talk\" ]\r\n * arrSlice(lyrics, 2, -1); // [ \"my\", \"old\", \"friend.\", \"I've\", \"come\", \"to\" ]\r\n * ```\r\n */\r\nexport function arrSlice(theArray: ArrayLike, start?: number, end?: number): T[] {\r\n return ((theArray ? theArray[\"slice\"] : NULL_VALUE) || ArrSlice).apply(theArray, ArrSlice[CALL](arguments, 1));\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ArrProto } from \"../internal/constants\";\r\nimport { _unwrapFunctionWithPoly } from \"../internal/unwrapFunction\";\r\nimport { polyArrFind, polyArrFindIndex, polyArrFindLast, polyArrFindLastIndex } from \"../polyfills/array\";\r\nimport { ArrPredicateCallbackFn, ArrPredicateCallbackFn2 } from \"./callbacks\";\r\n\r\n/**\r\n * The arrFind() method returns the first element in the provided array that satisfies\r\n * the provided testing function. If no values satisfy the testing function, undefined\r\n * is returned.\r\n * - If you need the index of the found element in the array, use {@link arrFindIndex}.\r\n * - If you need to find the index of a value, use arrIndexOf(). (It's similar to {@link arrFindIndex}, but\r\n * checks each element for equality with the value instead of using a testing function.)\r\n * - If you need to find if a value exists in an array, use {@link arrIncludes}. Again, it checks each element for\r\n * equality with the value instead of using a testing function.\r\n * - If you need to find if any element satisfies the provided testing function, use {@link arrSome}.\r\n *\r\n * The arrFind() method is an iterative method. It calls a provided `callbackFn` function once for each element\r\n * in an array in ascending-index order, until `callbackFn` returns a truthy value. arrFind() then returns that\r\n * element and stops iterating through the array. If callbackFn never returns a truthy value, arrFind() returns\r\n * undefined.\r\n *\r\n * `callbackFn` is invoked for every index of the array, not just those with assigned values. Empty slots in\r\n * sparse arrays behave the same as undefined.\r\n *\r\n * arrFind() does not mutate the array on which it is called, but the function provided as callbackFn can.\r\n * Note, however, that the length of the array is saved before the first invocation of `callbackFn`. Therefore:\r\n * - `callbackFn` will not visit any elements added beyond the array's initial length when the call to arrFind() began.\r\n * - Changes to already-visited indexes do not cause callbackFn to be invoked on them again.\r\n * - If an existing, yet-unvisited element of the array is changed by callbackFn, its value passed to the\r\n * `callbackFn` will be the value at the time that element gets visited. Deleted elements are visited as if they\r\n * were undefined.\r\n * @since 0.8.0\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the base type of array elements\r\n * @typeParam E - Identifies a more specific instance of the base array type\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param callbackFn - A function that accepts up to three arguments of type {@link ArrPredicateCallbackFn} or\r\n * {@link ArrPredicateCallbackFn2}. The predicate function is called for each element in the thArray until\r\n * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.\r\n * @param thisArg - A value to use as this when executing callbackFn. Defaults to the array if not provided.\r\n * @return The first element in the array that satisfies the provided testing function. Otherwise, undefined\r\n * is returned.\r\n * @example\r\n * ```ts\r\n * const inventory = [\r\n * { name: \"apples\", quantity: 2 },\r\n * { name: \"bananas\", quantity: 0 },\r\n * { name: \"cherries\", quantity: 5 },\r\n * ];\r\n *\r\n * function isCherries(fruit) {\r\n * return fruit.name === \"cherries\";\r\n * }\r\n *\r\n * console.log(arrFind(inventory, isCherries));\r\n * // { name: 'cherries', quantity: 5 }\r\n *\r\n * function isPrime(element, index, array) {\r\n * let start = 2;\r\n * while (start <= Math.sqrt(element)) {\r\n * if (element % start++ < 1) {\r\n * return false;\r\n * }\r\n * }\r\n * return element > 1;\r\n * }\r\n *\r\n * console.log(arrFind([4, 6, 8, 12], isPrime)); // undefined, not found\r\n * console.log(arrFind([4, 5, 8, 12], isPrime)); // 5\r\n *\r\n * // Array Like\r\n * console.log(arrFind({ length: 4, 0: 4, 1: 6, 2: 8, 3: 12 }, isPrime)); // undefined, not found\r\n * console.log(arrFind({ length: 4:, 0: 4, 1: 5, 2: 8, 3: 12 }, isPrime)); // 5\r\n * ```\r\n */\r\nexport const arrFind = (/*#__PURE__*/_unwrapFunctionWithPoly(\"find\", ArrProto, polyArrFind) as (theArray: ArrayLike, callbackFn: ArrPredicateCallbackFn | ArrPredicateCallbackFn2, thisArg?: any) => T | E | undefined);\r\n\r\n/**\r\n * The arrFindIndex() method returns the index of the first element in an array that satisfies the provided testing\r\n * function. If no elements satisfy the testing function, -1 is returned.\r\n *\r\n * The arrFindIndex() is an iterative method. It calls a provided callbackFn function once for each element in an\r\n * array in ascending-index order, until callbackFn returns a truthy value. arrFindIndex() then returns the index\r\n * of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, arrFindIndex()\r\n * returns -1.\r\n *\r\n * `callbackFn` is invoked for every index of the array, not just those with assigned values. Empty slots in sparse\r\n * arrays behave the same as undefined.\r\n *\r\n * arrFindIndex() does not mutate the array on which it is called, but the function provided as `callbackFn` can.\r\n * Note, however, that the length of the array is saved before the first invocation of callbackFn. Therefore:\r\n * - `callbackFn` will not visit any elements added beyond the array's initial length when the call to arrFindIndex() began.\r\n * - Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again.\r\n * If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn`\r\n * will be the value at the time that element gets visited. Deleted elements are visited as if they were undefined.\r\n * @since 0.8.0\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the base type of array elements\r\n * @typeParam E - Identifies a more specific instance of the base array type\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param callbackFn - A function that accepts up to three arguments of type {@link ArrPredicateCallbackFn} or\r\n * {@link ArrPredicateCallbackFn2}. The predicate function is called for each element in the thArray until\r\n * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.\r\n * @param thisArg - A value to use as this when executing callbackFn. Defaults to the array if not provided.\r\n * @return The index of the first element in the array that passes the test. Otherwise, -1.\r\n * @example\r\n * ```ts\r\n * const inventory: Array<{ name: string, quantity: number}> = [\r\n * { name: \"apples\", quantity: 2 },\r\n * { name: \"bananas\", quantity: 0 },\r\n * { name: \"cherries\", quantity: 5 }\r\n * ];\r\n *\r\n * function isCherries(fruit: { name: string, quantity: number}) {\r\n * return fruit.name === \"cherries\";\r\n * }\r\n *\r\n * arrFindIndex(inventory, isCherries); // 2\r\n *\r\n * function isPrime(element: number) {\r\n * if (element % 2 === 0 || element < 2) {\r\n * return false;\r\n * }\r\n *\r\n * for (let factor = 3; factor <= Math.sqrt(element); factor += 2) {\r\n * if (element % factor === 0) {\r\n * return false;\r\n * }\r\n * }\r\n * return true;\r\n * }\r\n *\r\n * arrFindIndex([4, 6, 8, 9, 12], isPrime) // -1\r\n * arrFindIndex([4, 6, 7, 9, 12], isPrime) // 2\r\n *\r\n * // Array Like\r\n * arrFindIndex({ length: 5, 0: 4, 1: 6, 2: 8, 3: 9, 4: 12 }, isPrime) // -1\r\n * arrFindIndex({ length: 5:, 0: 4, 1: 6, 2: 7, 3: 9, 4: 12 }, isPrime) // 2\r\n * ```\r\n */\r\nexport const arrFindIndex = (/*#__PURE__*/_unwrapFunctionWithPoly(\"findIndex\", ArrProto, polyArrFindIndex) as (theArray: ArrayLike, callbackFn: ArrPredicateCallbackFn | ArrPredicateCallbackFn2, thisArg?: any) => number);\r\n\r\n/**\r\n * The arrFindLast() method iterates the array in reverse order and returns the value of the first element that\r\n * satisfies the provided testing function. If no elements satisfy the testing function, undefined is returned.\r\n * - If you need the index of the found element in the array, use arrFindLastIndex().\r\n * - If you need to find the index of a value, use arrLastIndexOf(). (It's similar to arrFindLastIndex(), but checks\r\n * each element for equality with the value instead of using a testing function.)\r\n * - If you need to find if a value exists in an array, use {@link arrIncludes}. Again, it checks each element for\r\n * equality with the value instead of using a testing function.\r\n * - If you need to find if any element satisfies the provided testing function, use {@link arrSome}.\r\n *\r\n * The arrFindLast() method is an iterative method. It calls a provided callbackFn function once for each element\r\n * in an array in descending-index order, until callbackFn returns a truthy value. arrFindLast() then returns that\r\n * element and stops iterating through the array. If `callbackFn` never returns a truthy value, arrFindLast() returns\r\n * undefined.\r\n *\r\n * `callbackFn` is invoked for every index of the array, not just those with assigned values. Empty slots in sparse\r\n * arrays behave the same as undefined.\r\n *\r\n * arrFindLast() does not mutate the array on which it is called, but the function provided as `callbackFn` can.\r\n * Note, however, that the length of the array is saved before the first invocation of `callbackFn`. Therefore:\r\n * - `callbackFn` will not visit any elements added beyond the array's initial length when the call to arrFindLast() began.\r\n * - Changes to already-visited indexes do not cause callbackFn to be invoked on them again.\r\n * - If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn`\r\n * will be the value at the time that element gets visited. Deleted elements are visited as if they were undefined.\r\n * @since 0.8.0\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the base type of array elements\r\n * @typeParam E - Identifies a more specific instance of the base array type\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param callbackFn - A function that accepts up to three arguments of type {@link ArrPredicateCallbackFn} or\r\n * {@link ArrPredicateCallbackFn2}. The predicate function is called for each element in the thArray until\r\n * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.\r\n * @param thisArg - A value to use as this when executing callbackFn. Defaults to the array if not provided.\r\n * @return The last element in the array that satisfies the provided testing function. Otherwise, undefined\r\n * is returned.\r\n * @example\r\n * ```ts\r\n * const inventory = [\r\n * { name: \"apples\", quantity: 2 },\r\n * { name: \"bananas\", quantity: 0 },\r\n * { name: \"cherries\", quantity: 5 },\r\n * ];\r\n *\r\n * function isCherries(fruit) {\r\n * return fruit.name === \"cherries\";\r\n * }\r\n *\r\n * console.log(arrFindLast(inventory, isCherries));\r\n * // { name: 'cherries', quantity: 5 }\r\n *\r\n * function isPrime(element, index, array) {\r\n * let start = 2;\r\n * while (start <= Math.sqrt(element)) {\r\n * if (element % start++ < 1) {\r\n * return false;\r\n * }\r\n * }\r\n * return element > 1;\r\n * }\r\n *\r\n * console.log(arrFindLast([4, 6, 8, 12], isPrime)); // undefined, not found\r\n * console.log(arrFindLast([4, 5, 7, 12], isPrime)); // 7\r\n *\r\n * // Array Like\r\n * console.log(arrFindLast({ length: 4, 0: 4, 1: 6, 2: 8, 3: 12 }, isPrime)); // undefined, not found\r\n * console.log(arrFindLast({ length: 4, 0: 4, 1: 5, 2: 7, 3: 12 }, isPrime)); // 7\r\n * ```\r\n */\r\nexport const arrFindLast = (/*#__PURE__*/_unwrapFunctionWithPoly(\"findLast\", ArrProto as any, polyArrFindLast) as (theArray: ArrayLike, callbackFn: ArrPredicateCallbackFn | ArrPredicateCallbackFn2, thisArg?: any) => T | E | undefined);\r\n\r\n/**\r\n * The arrFindLastIndex() method iterates the array in reverse order and returns the index of the first element that\r\n * satisfies the provided testing function. If no elements satisfy the testing function, -1 is returned.\r\n *\r\n * The arrFindLastIndex() method is an iterative method. It calls a provided `callbackFn` function once for each element\r\n * in an array in descending-index order, until callbackFn returns a truthy value. arrFindLastIndex() then returns the\r\n * index of that element and stops iterating through the array. If callbackFn never returns a truthy value, returns -1.\r\n *\r\n * `callbackFn` is invoked for every index of the array, not just those with assigned values. Empty slots in sparse arrays\r\n * behave the same as undefined.\r\n *\r\n * arrFindLastIndex() does not mutate the array on which it is called, but the function provided as callbackFn can.\r\n * Note, however, that the length of the array is saved before the first invocation of callbackFn. Therefore:\r\n * - `callbackFn` will not visit any elements added beyond the array's initial length when the call to arrFindLastIndex() began.\r\n * - Changes to already-visited indexes do not cause callbackFn to be invoked on them again.\r\n * - If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the callbackFn\r\n * will be the value at the time that element gets visited. Deleted elements are visited as if they were undefined.\r\n * @since 0.8.0\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the base type of array elements\r\n * @typeParam E - Identifies a more specific instance of the base array type\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param callbackFn - A function that accepts up to three arguments of type {@link ArrPredicateCallbackFn} or\r\n * {@link ArrPredicateCallbackFn2}. The predicate function is called for each element in the thArray until\r\n * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.\r\n * @param thisArg - A value to use as this when executing callbackFn. Defaults to the array if not provided.\r\n * @return The index of the last (highest-index) element in the array that passes the test. Otherwise -1 if\r\n * no matching element is found.\r\n * @example\r\n * ```ts\r\n * const inventory: Array<{ name: string, quantity: number}> = [\r\n * { name: \"apples\", quantity: 2 },\r\n * { name: \"bananas\", quantity: 0 },\r\n * { name: \"cherries\", quantity: 5 }\r\n * ];\r\n *\r\n * let called = 0;\r\n * function isCherries(fruit: { name: string, quantity: number}) {\r\n * called++;\r\n * return fruit.name === \"cherries\";\r\n * }\r\n *\r\n * arrFindLastIndex(inventory, isCherries)' // 2\r\n * // called === 1\r\n *\r\n * called = 0;\r\n * function isPrime(element: number) {\r\n * called++;\r\n * if (element % 2 === 0 || element < 2) {\r\n * return false;\r\n * }\r\n * for (let factor = 3; factor <= Math.sqrt(element); factor += 2) {\r\n * if (element % factor === 0) {\r\n * return false;\r\n * }\r\n * }\r\n * return true;\r\n * }\r\n *\r\n * arrFindLastIndex([4, 6, 8, 9, 12], isPrime); // -1\r\n * // called === 5\r\n *\r\n * called = 0;\r\n * arrFindLastIndex([4, 6, 7, 9, 12], isPrime); // 2\r\n * // called === 3\r\n *\r\n * // Array Like\r\n * called = 0;\r\n * arrFindLastIndex({ length: 5: 0: 4, 1: 6, 2: 8, 3: 9, 4: 12 }, isPrime); // -1\r\n * // called === 5\r\n *\r\n * called = 0;\r\n * arrFindLastIndex({ length: 5: 0: 4, 1: 6, 2: 7, 3: 9, 4: 12 }, isPrime); // 2\r\n * // called === 3\r\n\r\n * ```\r\n */\r\nexport const arrFindLastIndex = (/*#__PURE__*/_unwrapFunctionWithPoly(\"findLastIndex\", ArrProto as any, polyArrFindLastIndex) as (theArray: ArrayLike, callbackFn: ArrPredicateCallbackFn | ArrPredicateCallbackFn2, thisArg?: any) => number);\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ArrProto } from \"../internal/constants\";\r\nimport { _unwrapFunction } from \"../internal/unwrapFunction\";\r\n\r\n/**\r\n * The `reducer` function called for {@link arrReduce}.\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the type of array elements\r\n * @typeParam R - Identifies the type of the return array elements (defaults to T)\r\n * @param previousValue - The value resulting from the previous call to callbackFn. On first call, initialValue if\r\n * specified, otherwise the value of array[0].\r\n * @param currentValue - The value of the current element. On first call, the value of array[0] if an initialValue\r\n * was specified, otherwise the value of array[1].\r\n * @param currentIndex - The index position of currentValue in the array. On first call, 0 if initialValue was\r\n * specified, otherwise 1.\r\n * @param array -The array being traversed.\r\n */\r\nexport type ArrReduceCallbackFn = (previousValue: T | R, currentValue: T, currentIndex: number, array: T[]) => R;\r\n\r\n/**\r\n * The arrReduce() method executes a user-supplied \"reducer\" callback function on each element of the array,\r\n * in order, passing in the return value from the calculation on the preceding element. The final result of\r\n * running the reducer across all elements of the array is a single value.\r\n *\r\n * The first time that the callback is run there is no \"return value of the previous calculation\". If supplied,\r\n * an initial value may be used in its place. Otherwise the array element at index 0 is used as the initial\r\n * value and iteration starts from the next element (index 1 instead of index 0).\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the type of array elements\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param callbackfn - A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r\n * @param initialValue - If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r\n * @returns The value that results from running the \"reducer\" callback function to completion over the entire array.\r\n * @example\r\n * ```ts\r\n * const getMax = (a: number, b: number) => Math.max(a, b);\r\n *\r\n * // callback is invoked for each element in the array starting at index 0\r\n * arrReduce([1, 100], getMax, 50); // 100\r\n * arrReduce([ 50], getMax, 10); // 50\r\n *\r\n * // callback is invoked once for element at index 1\r\n * arrReduce([1, 100], getMax); // 100\r\n *\r\n * // callback is not invoked\r\n * arrReduce([ 50], getMax); // 50\r\n * arrReduce([ ], getMax, 1); // 1\r\n *\r\n * arrReduce([ ], getMax); // throws TypeError\r\n *\r\n * // Also supports Array like objects\r\n * arrReduce({ length: 2, 0: 1, 1: 100 }, getMax, 50); // 100\r\n * arrReduce({ length: 1, 0: 50 }, getMax, 10); // 50\r\n *\r\n * // callback is invoked once for element at index 1\r\n * arrReduce({ length: 2, 0: 1, 1: 100 }, getMax); // 100\r\n *\r\n * // callback is not invoked\r\n * arrReduce({ length: 1, 0: 50 }, getMax); // 50\r\n * arrReduce({ length: 0 }, getMax, 1); // 1\r\n * ```\r\n */\r\nexport const arrReduce: (theArray: ArrayLike, callbackfn: ArrReduceCallbackFn, initialValue?: T | R) => R = (/*#__PURE__*/_unwrapFunction(\"reduce\", ArrProto));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ICachedValue, createCachedValue } from \"../helpers/cache\";\r\nimport { ObjClass, __PROTO__ } from \"../internal/constants\";\r\nimport { objForEachKey } from \"./for_each_key\";\r\n\r\nlet _isProtoArray: ICachedValue;\r\n\r\n/**\r\n * The objSetPrototypeOf() method sets the prototype (i.e., the internal [Prototype] property) of a specified\r\n * object to another object or null.\r\n * @group Object\r\n * @param obj - The object which is to have it's prototype set.\r\n * @param proto - The object's new prototype (an object or null)\r\n * @returns The specified object.\r\n */\r\nexport function objSetPrototypeOf(obj: any, proto: object) {\r\n let fn = ObjClass[\"setPrototypeOf\"] ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n function (d: any, b: any) {\r\n !_isProtoArray && (_isProtoArray = createCachedValue({ [__PROTO__]: [] } instanceof Array));\r\n _isProtoArray.v ? d[__PROTO__] = b : objForEachKey(b, (key: any, value: any) => d[key] = value );\r\n };\r\n\r\n return fn(obj, proto);\r\n}","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { fnApply } from \"../funcs/funcs\";\r\nimport { ArrSlice, CALL, CONSTRUCTOR, NAME, NULL_VALUE, PROTOTYPE } from \"../internal/constants\";\r\nimport { objCreate } from \"../object/create\";\r\nimport { objDefine } from \"../object/define\";\r\nimport { objGetPrototypeOf } from \"../object/object\";\r\nimport { objSetPrototypeOf } from \"../object/set_proto\";\r\nimport { safe } from \"./safe\";\r\n\r\n/**\r\n * Defines the definition of the custom error constructor\r\n * Used by: {@link createCustomError}\r\n * @group Error\r\n */\r\nexport interface CustomErrorConstructor extends ErrorConstructor {\r\n new(message?: string): T;\r\n (message?: string): T;\r\n readonly prototype: T;\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nfunction _createCustomError(name: string, d: any, b: any): T {\r\n safe(objDefine, [ d, NAME, { v: name, c: true, e: false }]);\r\n d = objSetPrototypeOf(d, b);\r\n function __() {\r\n this[CONSTRUCTOR] = d;\r\n safe(objDefine, [this, NAME, { v: name, c: true, e: false }]);\r\n }\r\n\r\n d[PROTOTYPE] = b === NULL_VALUE ? objCreate(b) : ((__ as any)[PROTOTYPE] = b[PROTOTYPE], new (__ as any)());\r\n\r\n return d;\r\n}\r\n\r\nfunction _setName(baseClass: any, name: string) {\r\n name && (baseClass[NAME] = name);\r\n //name && (baseClass[PROTOTYPE][NAME] = name);\r\n}\r\n\r\n/**\r\n * Create a Custom Error class which may be used to throw custom errors.\r\n * @group Error\r\n * @param name - The name of the Custom Error\r\n * @param constructCb - [Optional] An optional callback function to call when a\r\n * new Customer Error instance is being created.\r\n * @param errorBase - [Optional] (since v0.9.6) The error class to extend for this class, defaults to Error.\r\n * @returns A new Error `class`\r\n * @example\r\n * ```ts\r\n * import { createCustomError, isError } from \"@nevware21/ts-utils\";\r\n *\r\n * // For an error that just contains a message\r\n * let myCustomErrorError = createCustomError(\"MessageError\");\r\n *\r\n * try {\r\n * throw new myCustomErrorError(\"Error Message!\");\r\n * } catch(e) {\r\n * // e.name === MessageError\r\n * // isError(e) === true;\r\n * // Object.prototype.toString.call(e) === \"[object Error]\";\r\n * }\r\n *\r\n * // Or a more complex error object\r\n * interface MyCriticalErrorConstructor extends CustomErrorConstructor {\r\n * new(message: string, file: string, line: number, col: number): MyCriticalError;\r\n * (message: string, file: string, line: number, col: number): MyCriticalError;\r\n * }\r\n *\r\n * interface MyCriticalError extends Error {\r\n * readonly errorId: number;\r\n * readonly args: any[]; // Holds all of the arguments passed during construction\r\n * }\r\n *\r\n * let _totalErrors = 0;\r\n * let myCustomError = createCustomError(\"CriticalError\", (self, args) => {\r\n * _totalErrors++;\r\n * self.errorId = _totalErrors;\r\n * self.args = args;\r\n * });\r\n *\r\n * try {\r\n * throw new myCustomError(\"Not Again!\");\r\n * } catch(e) {\r\n * // e.name === CriticalError\r\n * // isError(e) === true;\r\n * // Object.prototype.toString.call(e) === \"[object Error]\";\r\n * }\r\n *\r\n * // ----------------------------------------------------------\r\n * // Extending another custom error class\r\n * // ----------------------------------------------------------\r\n *\r\n * let AppError = createCustomError(\"ApplicationError\");\r\n * let theAppError = new appError();\r\n *\r\n * isError(theAppError); // true\r\n * theAppError instanceof Error; // true\r\n * theAppError instanceof AppError; // true\r\n *\r\n * let StartupError = createCustomError(\"StartupError\", null, AppError);\r\n * let theStartupError = new StartupError();\r\n *\r\n * isError(theStartupError); // true\r\n * theStartupError instanceof Error; // true\r\n * theStartupError instanceof AppError; // true\r\n * theStartupError instanceof StartupError; // true\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function createCustomError(\r\n name: string,\r\n constructCb?: ((self: any, args: IArguments) => void) | null,\r\n errorBase?: B): T {\r\n\r\n let theBaseClass = errorBase || Error;\r\n let orgName = theBaseClass[PROTOTYPE][NAME];\r\n let captureFn = Error.captureStackTrace;\r\n return _createCustomError(name, function (this: any) {\r\n let _this = this;\r\n let theArgs = arguments;\r\n try {\r\n safe(_setName, [theBaseClass, name]);\r\n let _self = fnApply(theBaseClass, _this, ArrSlice[CALL](theArgs)) || _this;\r\n if (_self !== _this) {\r\n // Looks like runtime error constructor reset the prototype chain, so restore it\r\n let orgProto = objGetPrototypeOf(_this);\r\n if (orgProto !== objGetPrototypeOf(_self)) {\r\n objSetPrototypeOf(_self, orgProto);\r\n }\r\n }\r\n\r\n // Make sure we only capture our stack details\r\n captureFn && captureFn(_self, _this[CONSTRUCTOR]);\r\n \r\n // Run the provided construction function\r\n constructCb && constructCb(_self, theArgs);\r\n \r\n return _self;\r\n } finally {\r\n safe(_setName, [theBaseClass, orgName]);\r\n }\r\n }, theBaseClass);\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n */\r\nlet _unsupportedError: CustomErrorConstructor;\r\n\r\n/**\r\n * Throw a custom `UnsupportedError` Error instance with the given message.\r\n * @group Error\r\n * @param message - The message to include in the exception\r\n * @example\r\n * ```ts\r\n * import { throwUnsupported } from \"@nevware21/ts-utils\";\r\n *\r\n * if (!window) {\r\n * throwUnsupported(\"A window is needed for this operation\");\r\n * }\r\n * ```\r\n */\r\nexport function throwUnsupported(message?: string): never {\r\n if (!_unsupportedError) {\r\n // Lazily create the class\r\n _unsupportedError = createCustomError(\"UnsupportedError\");\r\n }\r\n\r\n throw new _unsupportedError(message);\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { FUNCTION, ObjClass, OBJECT, PROTOTYPE } from \"../internal/constants\";\r\nimport { dumpObj } from \"../helpers/diagnostics\";\r\nimport { throwTypeError } from \"../helpers/throw\";\r\nimport { _pureAssign, _pureRef } from \"../internal/treeshake_helpers\";\r\n\r\n/**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @group Object\r\n * @param obj - Object to use as a prototype. May be null\r\n */\r\nexport const objCreate: (obj: any) => any = (/* #__PURE__*/_pureAssign((/* #__PURE__*/_pureRef(ObjClass as any, \"create\")), polyObjCreate));\r\n\r\n/**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @group Polyfill\r\n * @group Object\r\n * @param obj - Object to use as a prototype. May be null\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function polyObjCreate(obj: any): any {\r\n if (!obj) {\r\n return {};\r\n }\r\n\r\n let type = typeof obj;\r\n if (type !== OBJECT && type !== FUNCTION) {\r\n throwTypeError(\"Prototype must be an Object or function: \" + dumpObj(obj));\r\n }\r\n\r\n function tempFunc() {}\r\n tempFunc[PROTOTYPE] = obj;\r\n\r\n return new (tempFunc as any)();\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\n/**\r\n * Return the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.\r\n *\r\n * To offer protection against timing attacks and fingerprinting, the precision of utcNow()\r\n * might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision\r\n * preference is enabled by default and defaults to 20µs in Firefox 59; in 60 it will be 2ms.\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n *\r\n * @returns A Number representing the milliseconds elapsed since the UNIX epoch.\r\n * @example\r\n * ```ts\r\n * let now = utcNow();\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function utcNow() {\r\n return (Date.now || polyUtcNow)();\r\n}\r\n\r\n/**\r\n * Polyfill fallback to return the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.\r\n *\r\n * To offer protection against timing attacks and fingerprinting, the precision of utcNow()\r\n * might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision\r\n * preference is enabled by default and defaults to 20µs in Firefox 59; in 60 it will be 2ms.\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n * @group Polyfill\r\n *\r\n * @returns A Number representing the milliseconds elapsed since the UNIX epoch.\r\n * @example\r\n * ```ts\r\n * let now = polyUtcNow();\r\n * ```\r\n*/\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function polyUtcNow() {\r\n return new Date().getTime();\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { isNullOrUndefined } from \"../helpers/base\";\r\nimport { dumpObj } from \"../helpers/diagnostics\";\r\nimport { throwTypeError } from \"../helpers/throw\";\r\nimport { EMPTY } from \"../internal/constants\";\r\n\r\n/*#__NO_SIDE_EFFECTS__*/\r\nfunction _createTrimFn(exp: RegExp): (value: string) => string {\r\n return function _doTrim(value: string): string {\r\n if (isNullOrUndefined(value)) {\r\n throwTypeError(\"strTrim called [\" + dumpObj(value) + \"]\")\r\n }\r\n \r\n if (value && value.replace) {\r\n value = value.replace(exp, EMPTY);\r\n }\r\n \r\n return value;\r\n }\r\n}\r\n\r\n/**\r\n * The trim() method removes whitespace from both ends of a string and returns a new string,\r\n * without modifying the original string. Whitespace in this context is all the whitespace\r\n * characters (space, tab, no-break space, etc.) and all the line terminator characters\r\n * (LF, CR, etc.).\r\n * @group Polyfill\r\n * @group String\r\n * @param value - The string value to be trimmed.\r\n * @returns A new string representing str stripped of whitespace from both its beginning and end.\r\n * If neither the beginning or end of str has any whitespace, a new string is still returned (essentially\r\n * a copy of str), with no exception being thrown.\r\n * To return a new string with whitespace trimmed from just one end, use `strTrimStart()` or `strTrimEnd()`.\r\n */\r\nexport const polyStrTrim = (/*#__PURE__*/_createTrimFn(/^\\s+|(?=\\s)\\s+$/g));\r\n\r\n/**\r\n * The `polyStrTrimStart()` method removes whitespace from the beginning of a string.\r\n * @group Polyfill\r\n * @group String\r\n * @param value - The value to be trimmed.\r\n * @returns A new string representing str stripped of whitespace from its beginning (left side).\r\n * If the beginning of str has no whitespace, a new string is still returned (essentially a copy of str),\r\n * with no exception being thrown.\r\n */\r\nexport const polyStrTrimStart = (/*#__PURE__*/_createTrimFn(/^\\s+/g));\r\n \r\n/**\r\n * The `polyStrTrimEnd()` method removes whitespace from the end of a string.\r\n * @group Polyfill\r\n * @group String\r\n * @param value - The value to be trimmed.\r\n * @returns A new string representing str stripped of whitespace from its end (right side).\r\n * If the end of str has no whitespace, a new string is still returned (essentially a copy of str),\r\n * with no exception being thrown.\r\n */\r\nexport const polyStrTrimEnd = (/*#__PURE__*/_createTrimFn(/(?=\\s)\\s+$/g));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { StrProto } from \"../internal/constants\";\r\nimport { _pureAssign } from \"../internal/treeshake_helpers\";\r\nimport { _unwrapFunctionWithPoly } from \"../internal/unwrapFunction\";\r\nimport { polyStrTrim, polyStrTrimEnd, polyStrTrimStart } from \"../polyfills/trim\";\r\n\r\n/**\r\n * The trim() method removes whitespace from both ends of a string and returns a new string,\r\n * without modifying the original string. Whitespace in this context is all the whitespace\r\n * characters (space, tab, no-break space, etc.) and all the line terminator characters\r\n * (LF, CR, etc.).\r\n * @group String\r\n * @param value - The string value to be trimmed.\r\n * @returns A new string representing str stripped of whitespace from both its beginning and end.\r\n * If neither the beginning or end of str has any whitespace, a new string is still returned (essentially\r\n * a copy of str), with no exception being thrown.\r\n * To return a new string with whitespace trimmed from just one end, use `strTrimStart()` or `strTrimEnd()`.\r\n */\r\nexport const strTrim: (value: string) => string = (/*#__PURE__*/_unwrapFunctionWithPoly(\"trim\", StrProto, polyStrTrim));\r\n\r\n/**\r\n * The `strTrimStart()` method removes whitespace from the beginning of a string.\r\n * @group String\r\n * @param value - The value to be trimmed.\r\n * @returns A new string representing str stripped of whitespace from its beginning (left side).\r\n * If the beginning of str has no whitespace, a new string is still returned (essentially a copy of str),\r\n * with no exception being thrown.\r\n */\r\nexport const strTrimStart: (value: string) => string = (/*#__PURE__*/_unwrapFunctionWithPoly(\"trimStart\", StrProto, polyStrTrimStart));\r\n\r\n/**\r\n * Alias for `strTrimStart()` method removes whitespace from the beginning of a string.\r\n * @group String\r\n * @param value - The value to be trimmed.\r\n * @returns A new string representing str stripped of whitespace from its beginning (left side).\r\n * If the beginning of str has no whitespace, a new string is still returned (essentially a copy of str),\r\n * with no exception being thrown.\r\n */\r\nexport const strTrimLeft = (/*#__PURE__*/_pureAssign(strTrimStart));\r\n\r\n/**\r\n * The `strTrimEnd()` method removes whitespace from the end of a string.\r\n * @group String\r\n * @param value - The value to be trimmed.\r\n * @returns A new string representing str stripped of whitespace from its end (right side).\r\n * If the end of str has no whitespace, a new string is still returned (essentially a copy of str),\r\n * with no exception being thrown.\r\n */\r\nexport const strTrimEnd: (value: string) => string = (/*#__PURE__*/_unwrapFunctionWithPoly(\"trimEnd\", StrProto, polyStrTrimEnd));\r\n\r\n/**\r\n * Alias for `strTrimEnd()` method removes whitespace from the end of a string.\r\n * @group String\r\n * @param value - The value to be trimmed.\r\n * @returns A new string representing str stripped of whitespace from its end (right side).\r\n * If the end of str has no whitespace, a new string is still returned (essentially a copy of str),\r\n * with no exception being thrown.\r\n */\r\nexport const strTrimRight = (/*#__PURE__*/_pureAssign(strTrimEnd));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { MathCls } from \"../internal/constants\";\r\nimport { _pureRef } from \"../internal/treeshake_helpers\";\r\n\r\n/**\r\n * The `mathFloor()` function returns the largest integer less than or equal to a given number.\r\n * @group Math\r\n * @param x - A number\r\n * @returns A number representing the largest integer less than or equal to the specified number.\r\n */\r\nexport const mathFloor = (/*#__PURE__*/_pureRef(MathCls, \"floor\"));\r\n\r\n/**\r\n * The `mathCeil()` function always rounds a number up to the next largest integer.\r\n * @group Math\r\n * @param x - A number\r\n * @returns The smallest integer greater than or equal to the given number.\r\n */\r\nexport const mathCeil = (/*#__PURE__*/_pureRef(MathCls, \"ceil\"));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { NULL_VALUE, TO_STRING, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { asString } from \"../string/as_string\";\r\nimport { strCamelCase } from \"../string/conversion\";\r\nimport { strPadStart } from \"../string/pad\";\r\nimport { strUpper } from \"../string/upper_lower\";\r\nimport { isNumber, isString, isUndefined } from \"./base\";\r\nimport { dumpObj } from \"./diagnostics\";\r\n\r\nconst DBL_QUOTE = \"\\\"\";\r\nconst INVALID_JS_NAME = /([^\\w\\d_$])/g;\r\nlet _htmlEntityCache: { [key: string]: string};\r\n\r\n/**\r\n * Validates that the string name conforms to the JS IdentifierName specification and if not\r\n * normalizes the name so that it would. This method does not identify or change any keywords\r\n * meaning that if you pass in a known keyword the same value will be returned.\r\n * @since 0.9.0\r\n * @group Conversion\r\n * @group Value\r\n * @param jsName - The string value to validate\r\n * @param camelCase - Optionally (see [1]) convert into CamelCase with the leading character either\r\n * - `true` =\\> lowercase\r\n * - 'false' =\\> uppercase\r\n * - undefined =\\> not converted\r\n * @return The original string name, if it conforms to the JS naming convention otherwise an encoded version.\r\n *\r\n * **[1]**: Camel casing the name will remove all non-word characters from the result\r\n * so you will NOT end up with any leading, embedded or trailing `_` characters which may cause\r\n * duplicate results for different string values.\r\n * @example\r\n * ```ts\r\n * normalizeJsName(\"HelloDarkness\"); // \"HelloDarkness\"\r\n * normalizeJsName(\"Hello Darkness\"); // \"Hello_Darkness\"\r\n * normalizeJsName(\"hello Darkness\"); // \"hello_Darkness\"\r\n * normalizeJsName(\"hello Darkness\"); // \"hello_Darkness\"\r\n * normalizeJsName(\"hello.Darkness\"); // \"hello_Darkness\"\r\n * normalizeJsName(\"hello-Darkness\"); // \"hello_Darkness\"\r\n * normalizeJsName(\"hello_Darkness\"); // \"hello_Darkness\"\r\n * normalizeJsName(\"abc-123\"); // \"abc_123\"\r\n * normalizeJsName(\"0abc0\"); // \"0abc0\"\r\n * normalizeJsName(\"\\\"HelloDarkness\\\"\"); // \"_HelloDarkness_\"\r\n * normalizeJsName(\"\\\"Hello Darkness\\\"\"); // \"_Hello_Darkness_\"\r\n * normalizeJsName(\"\\\"hello Darkness\\\"\"); // \"_hello_Darkness_\"\r\n * normalizeJsName(\"\\\"hello Darkness\\\"\"); // \"_hello_Darkness_\"\r\n * normalizeJsName(\"\\\"hello .,#[]Darkness\\\"\"); // \"_hello______Darkness_\"\r\n *\r\n * normalizeJsName(\"HelloDarkness\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"Hello Darkness\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"hello Darkness\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"hello Darkness\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"hello.Darkness\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"hello-Darkness\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"hello_Darkness\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"abc-123\", true); // \"abc123\"\r\n * normalizeJsName(\"0abc0\", true); // \"0abc0\"\r\n * normalizeJsName(\"\\\"HelloDarkness\\\"\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"\\\"Hello Darkness\\\"\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"hello \\\"Darkness\\\"\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"hello \\\"Darkness\\\"\", true); // \"helloDarkness\"\r\n * normalizeJsName(\"\\\"hello .,#[]Darkness\\\"\", true); // \"helloDarkness\"\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function normalizeJsName(jsName: string, camelCase?: boolean): string {\r\n let result = asString(jsName).replace(INVALID_JS_NAME, \"_\");\r\n\r\n return !isUndefined(camelCase) ? strCamelCase(result, !camelCase) : result;\r\n}\r\n\r\n/**\r\n * Encode the value into a JSON string, if the provided value is a string this will encode\r\n * any character that is not an alpha, numeric, space or some special characters as `\\uXXXX`\r\n * and will always be returned wrapped in double quotes `\"xxx\"`, if the value is any other\r\n * object it will be encoded using JSON.stringify() and if there is an exception encoding\r\n * with JSON.stringify() it will return the exception as a string using {@link dumpObj}().\r\n * @since 0.9.0\r\n * @group Conversion\r\n * @group Value\r\n * @param value - The value to be encoded as JSON\r\n * @param format - Identifies whether the JSON value should be formatted when an object\r\n * - `true` - Format with 4 spaces\r\n * - 'number' - The number of spaces to format with\r\n * - `false` (or not Truthy) - Do not format*\r\n * @returns A JSON encoded string representation of the value.\r\n * @example\r\n * ```ts\r\n * // String values\r\n * encodeAsJson(\"abc.123\"); // \"\\\"abc.123\\\"\"\r\n * encodeAsJson(\"321-abc\"); // \"\\\"321-abc\\\"\"\r\n * encodeAsJson(\"Hello darkness, my \\\"old\\\" friend...\"); // \"\\\"Hello darkness, my \\\\\\\"old\\\\\\\" friend...\\\"\"\r\n * encodeAsJson(\"Hello: Darkness\"); // \"\\\"Hello: Darkness\\\"\"\r\n * encodeAsJson(\"Hello\\\\u003A Darkness\"); // \"\\\"Hello\\\\\\\\u003A Darkness\\\"\"\r\n * encodeAsJson(\"`!@#$%^&*()_-+=[]{}:;'<>?\"); // \"\\\"\\\\u0060!@#$%^&*()_-+=[]{}:;\\\\u0027<>?\\\"\"\r\n * encodeAsJson(\"0\"); // \"\\\"0\\\"\"\r\n * encodeAsJson(\"1\"); // \"\\\"1\\\"\"\r\n *\r\n * encodeAsJson([]); // \"[]\"\r\n * encodeAsJson([\"A\"]); // \"[\\\"A\\\"]\"\r\n * encodeAsJson([0]); // \"[0]\"\r\n * encodeAsJson([false]); // \"[false]\"\r\n * encodeAsJson(new Array(1)); // \"[null]\"\r\n * encodeAsJson(true); // \"true\",\r\n * encodeAsJson(false); // \"false\"\r\n *\r\n * encodeAsJson({}); // \"{}\"\r\n * encodeAsJson({ Hello: \"Darkness\" }); // \"{\\\"Hello\\\":\\\"Darkness\\\"}\");\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function encodeAsJson(value: T, format?: boolean | number): string {\r\n let result: string;\r\n\r\n if (isString(value)) {\r\n // encode if a character is not an alpha, numeric, space or some special characters\r\n result = DBL_QUOTE + value.replace(/[^\\w .,\\-!@#$%\\^&*\\(\\)_+={}\\[\\]:;|<>?]/g, (match) => {\r\n if(match === DBL_QUOTE || match === \"\\\\\") {\r\n return \"\\\\\" + match;\r\n }\r\n\r\n var hex = match.charCodeAt(0)[TO_STRING](16);\r\n return \"\\\\u\" + strPadStart(strUpper(hex), 4, \"0\");\r\n }) + DBL_QUOTE;\r\n } else {\r\n try {\r\n result = JSON.stringify(value, NULL_VALUE, format ? (isNumber(format) ? format : 4) : UNDEF_VALUE);\r\n } catch (e) {\r\n // Unable to convert to JSON\r\n result = DBL_QUOTE + dumpObj(e) + DBL_QUOTE;\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Encode the provided string to a safe HTML form, converting the base `&`, `<`, `>`, `\\\"` and `'`\r\n * characters into their HTML encoded representations\r\n * @since 0.9.0\r\n * @group Conversion\r\n * @group Value\r\n * @param value - The string value to be converted into a HTML safe form\r\n * @returns The converted string as HTML\r\n * @example\r\n * ```ts\r\n * encodeAsHtml(\"HelloDarkness\"); // \"HelloDarkness\"\r\n * encodeAsHtml(\"Hello Darkness\"); // \"Hello Darkness\"\r\n * encodeAsHtml(\"hello.Darkness\"); // \"hello.Darkness\"\r\n * encodeAsHtml(\"hello-Darkness\"); // \"hello-Darkness\"\r\n * encodeAsHtml(\"hello_Darkness\"); // \"hello_Darkness\"\r\n * encodeAsHtml(\"abc-123\"); // \"abc-123\"\r\n * encodeAsHtml(\"0abc0\"); // \"0abc0\"\r\n * encodeAsHtml(\"\\\"HelloDarkness\\\"\"); // \""HelloDarkness"\"\r\n * encodeAsHtml(\"\\\"Hello Darkness\\\"\"); // \""Hello Darkness"\"\r\n * encodeAsHtml(\"\\\"hello Darkness\\\"\"); // \""hello Darkness"\"\r\n * encodeAsHtml(\"\\\"hello Darkness\\\"\"); // \""hello Darkness"\"\r\n * encodeAsHtml(\"\\\"hello .,#<[]>Darkness\\\"\"); // \""hello .,#<[]>Darkness"\"\r\n * encodeAsHtml(\"\"); // \"<script src="javascript:alert('Hello');"></script>\"\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function encodeAsHtml(value: string) {\r\n !_htmlEntityCache && (_htmlEntityCache = {\r\n \"&\": \"amp\",\r\n \"<\": \"lt\",\r\n \">\": \"gt\",\r\n \"\\\"\": \"quot\",\r\n \"'\": \"#39\"\r\n });\r\n \r\n return asString(value).replace(/[&<>\"']/g, match => \"&\" + _htmlEntityCache[match] + \";\");\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { getWindow, hasWindow } from \"../helpers/environment\";\r\nimport { CALL, CONSTRUCTOR, FUNCTION, ObjClass, OBJECT, PROTOTYPE, TO_STRING } from \"../internal/constants\";\r\nimport { objHasOwnProperty } from \"./has_own_prop\";\r\nimport { objGetPrototypeOf } from \"./object\";\r\n\r\n// Use to cache the result of Object.cont\r\nlet _fnToString: () => string;\r\nlet _objCtrFnString: string;\r\nlet _gblWindow: Window;\r\n\r\n/**\r\n * Checks to see if the past value is a plain object (not a class/array) value.\r\n * Object are considered to be \"plain\" if they are created with no prototype `Object.create(null)`\r\n * or by using the Object global (native) function, all other \"objects\" ar\r\n * @since 0.4.4\r\n * @group Type Identity\r\n * @group Object\r\n * @param value - The value to check\r\n * @returns true if `value` is a normal plain object\r\n * @example\r\n * ```ts\r\n * console.log(isPlainObject({ 0: 'a', 1: 'b', 2: 'c' })); // true\r\n * console.log(isPlainObject({ 100: 'a', 2: 'b', 7: 'c' })); // true\r\n * console.log(isPlainObject(objCreate(null))); // true\r\n *\r\n * const myObj = objCreate({}, {\r\n * getFoo: {\r\n * value() { return this.foo; }\r\n * }\r\n * });\r\n * myObj.foo = 1;\r\n * console.log(isPlainObject(myObj)); // true\r\n *\r\n * console.log(isPlainObject(['a', 'b', 'c'])); // false\r\n * console.log(isPlainObject(new Date())); // false\r\n * console.log(isPlainObject(new Error(\"An Error\"))); // false\r\n * console.log(isPlainObject(null)); // false\r\n * console.log(isPlainObject(undefined)); // false\r\n * console.log(isPlainObject(\"null\")); // false\r\n * console.log(isPlainObject(\"undefined\")); // false\r\n * console.log(isPlainObject(\"1\")); // false\r\n * console.log(isPlainObject(\"aa\")); // false\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function isPlainObject(value: any): value is object {\r\n if (!value || typeof value !== OBJECT) {\r\n return false;\r\n }\r\n\r\n if (!_gblWindow) {\r\n // Lazily cache the current global window value and default it to \"true\" (so we bypass this check in the future)\r\n _gblWindow = hasWindow() ? getWindow() : (true as any);\r\n }\r\n\r\n let result = false;\r\n if (value !== _gblWindow) {\r\n\r\n if (!_objCtrFnString) {\r\n // Lazily caching what the runtime reports as the object function constructor (as a string)\r\n // Using an current function lookup to find what this runtime calls a \"native\" function\r\n _fnToString = Function[PROTOTYPE][TO_STRING];\r\n _objCtrFnString = _fnToString[CALL](ObjClass);\r\n }\r\n\r\n try {\r\n let proto = objGetPrototypeOf(value);\r\n\r\n // No prototype so looks like an object created with Object.create(null)\r\n result = !proto;\r\n if (!result) {\r\n if (objHasOwnProperty(proto, CONSTRUCTOR)) {\r\n proto = proto[CONSTRUCTOR]\r\n }\r\n \r\n result = !!(proto && typeof proto === FUNCTION && _fnToString[CALL](proto) === _objCtrFnString);\r\n }\r\n } catch (ex) {\r\n // Something went wrong, so it's not an object we are playing with\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { arrForEach } from \"../array/forEach\";\r\nimport { isArray, isDate, isNullOrUndefined, isPrimitiveType } from \"../helpers/base\";\r\nimport { CALL, FUNCTION, NULL_VALUE, OBJECT } from \"../internal/constants\";\r\nimport { objDefine } from \"./define\";\r\nimport { isPlainObject } from \"./is_plain_object\";\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Provides the current context while performing a deep copy\r\n */\r\ninterface _DeepCopyContext {\r\n handler: ObjDeepCopyHandler;\r\n src: any;\r\n path?: Array;\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Defines the type used for tracking visited objects during deep copy to identify recursive\r\n * objects.\r\n */\r\ninterface _RecursiveVisitMap {\r\n k: any;\r\n v: any;\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Generic Object deep copy handler which creates a new plain object and copies enumerable properties from\r\n * the source to the new target plain object. The source object does not have to be a plain object.\r\n * @param details - The details object for the current property being copied\r\n * @returns true if the handler processed the field.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nfunction _defaultDeepCopyHandler(details: IObjDeepCopyHandlerDetails): boolean {\r\n // Make sure we at least copy plain objects\r\n details.value && plainObjDeepCopyHandler(details);\r\n\r\n // Always return true so that the iteration completes\r\n return true;\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * The ordered default deep copy handlers\r\n */\r\nconst defaultDeepCopyHandlers: ObjDeepCopyHandler[] = [\r\n arrayDeepCopyHandler,\r\n plainObjDeepCopyHandler,\r\n functionDeepCopyHandler,\r\n dateDeepCopyHandler\r\n];\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Helper function used for detecting and handling recursive properties\r\n * @param visitMap - The current map of objects that have been visited\r\n * @param source - The value (object) to be copied\r\n * @param newPath - The new access path from the origin to the current property\r\n * @param cb - The callback function to call if the current object has not already been processed.\r\n * @returns The new deep copied property, may be incomplete as the object is recursive and is still in the process of being copied\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nfunction _getSetVisited(visitMap: _RecursiveVisitMap[], source: any, newPath: Array, cb: (newEntry: _RecursiveVisitMap) => void) {\r\n let theEntry: _RecursiveVisitMap;\r\n arrForEach(visitMap, (entry) => {\r\n if (entry.k === source) {\r\n theEntry = entry;\r\n return -1;\r\n }\r\n });\r\n\r\n if (!theEntry) {\r\n // Add the target to the visit map so that deep nested objects refer to the single instance\r\n // Even if we have not finished processing it yet.\r\n theEntry = { k: source, v: source };\r\n visitMap.push(theEntry);\r\n\r\n // Now call the copy callback so that it populates the target\r\n cb(theEntry);\r\n }\r\n\r\n return theEntry.v;\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal helper which performs the recursive deep copy\r\n * @param visitMap - The current map of objects that have been visited\r\n * @param value - The value being copied\r\n * @param ctx - The current copy context\r\n * @param key - [Optional] the current `key` for the value from the source object\r\n * @returns The new deep copied instance of the value.\r\n */\r\nfunction _deepCopy(visitMap: _RecursiveVisitMap[], value: T, ctx: _DeepCopyContext, key?: string | number | symbol): T {\r\n let userHandler = ctx.handler;\r\n let newPath = ctx.path ? (key ? ctx.path.concat(key) : ctx.path) : [];\r\n\r\n let newCtx: _DeepCopyContext = {\r\n handler: ctx.handler,\r\n src: ctx.src,\r\n path: newPath\r\n };\r\n\r\n const theType = typeof value;\r\n let isPlain = false;\r\n let isPrim = value === NULL_VALUE;\r\n if (!isPrim) {\r\n if (value && theType === OBJECT) {\r\n isPlain = isPlainObject(value);\r\n } else {\r\n isPrim = isPrimitiveType(theType);\r\n }\r\n }\r\n\r\n let details: IObjDeepCopyHandlerDetails = {\r\n type: theType,\r\n isPrim: isPrim,\r\n isPlain: isPlain,\r\n value: value,\r\n result: value,\r\n path: newPath,\r\n origin: ctx.src,\r\n copy: (source: T, newKey?: string | number | symbol): T => {\r\n return _deepCopy(visitMap, source, newKey ? newCtx : ctx, newKey);\r\n },\r\n copyTo: (target: T, source: T): T => {\r\n return _copyProps(visitMap, target, source, newCtx);\r\n }\r\n };\r\n\r\n if (!details.isPrim) {\r\n return _getSetVisited(visitMap, value, newPath, (newEntry) => {\r\n\r\n // Use an accessor to set the new value onto the new entry\r\n objDefine(details, \"result\", {\r\n g: function () {\r\n return newEntry.v;\r\n },\r\n s: function (newValue: any) {\r\n newEntry.v = newValue;\r\n }\r\n });\r\n\r\n let idx = 0;\r\n let handler = userHandler;\r\n while (!(handler || (idx < defaultDeepCopyHandlers.length ? defaultDeepCopyHandlers[idx++] : _defaultDeepCopyHandler))[CALL](ctx, details)) {\r\n handler = NULL_VALUE;\r\n }\r\n });\r\n }\r\n\r\n // Allow the user handler to override the provided value\r\n if (userHandler && userHandler[CALL](ctx, details)) {\r\n return details.result;\r\n }\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal helper to copy all of the enumerable properties from the source object to the new target object\r\n * @param visitMap - The current map of objects that have been visited\r\n * @param target - The target object to copy the properties to.\r\n * @param source - The source object to copy the properties from.\r\n * @param ctx - The current deep copy context\r\n * @returns The populated target object\r\n */\r\nfunction _copyProps(visitMap: _RecursiveVisitMap[], target: T, source: T, ctx: _DeepCopyContext) {\r\n if (!isNullOrUndefined(source)) {\r\n // Copy all properties (not just own properties)\r\n for (const key in source) {\r\n // Perform a deep copy of the object\r\n target[key] = _deepCopy(visitMap, source[key], ctx, key);\r\n }\r\n }\r\n\r\n return target;\r\n}\r\n\r\n/**\r\n * Object helper to copy all of the enumerable properties from the source object to the target, the\r\n * properties are copied via {@link objDeepCopy}. Automatic handling of recursive properties was added in v0.4.4\r\n * @group Object\r\n * @param target - The target object to populated\r\n * @param source - The source object to copy the properties from\r\n * @param handler - An optional callback that lets you provide / overide the deep cloning (Since 0.4.4)\r\n * @returns The target object\r\n * @example\r\n * ```ts\r\n * let a: any = { a: 1 };\r\n * let b: any = { b: 2, d: new Date(), e: new TestClass(\"Hello Darkness\") };\r\n * a.b = b; // { a: 1, b: { b: 2} }\r\n * b.a = a; // { a: 1, b: { b: 2, a: { a: 1, { b: 2, a: ... }}}}\r\n *\r\n * function copyHandler(details: IObjDeepCopyHandlerDetails) {\r\n * // details.origin === a\r\n * // details.path[] is the path to the current value\r\n * if (details.value && isDate(details.value)) {\r\n * // So for the date path === [ \"b\", \"d\" ] which represents\r\n * // details.origin[\"b\"][\"d\"] === The Date\r\n *\r\n * // Create a clone the Date object and set as the \"newValue\"\r\n * details.value = new Date(details.value.getTime());\r\n *\r\n * // Return true to indicate that we have \"handled\" the conversion\r\n * // See objDeepCopy example for just reusing the original value (just don't replace details.value)\r\n * return true;\r\n * }\r\n *\r\n * return false;\r\n * }\r\n *\r\n * let c: any = objCopyProps({}, a, copyHandler);\r\n *\r\n * assert.notEqual(a, c, \"check a and c are not the same\");\r\n * assert.ok(c !== c.b.a, \"The root object won't be the same for the target reference as are are copying properties to our target\");\r\n * assert.ok(c.b === c.b.a.b, \"Check that the 2 'b' references are the same object\");\r\n * assert.ok(c.b.a === c.b.a.b.a, \"Check that the 2 'a' references are the same object\");\r\n * assert.ok(c.b.d === c.b.a.b.d, \"Check that the 2 'd' references are the same object\");\r\n * assert.ok(isDate(c.b.d), \"The copied date is still real 'Date' instance\");\r\n * assert.notEqual(c.b.d, a.b.d, \"And the copied date is not the same as the original\");\r\n * assert.equal(c.b.d.getTime(), a.b.d.getTime(), \"But the dates are the same\");\r\n *\r\n * assert.ok(isObject(c.b.d), \"The copied date is now an object\");\r\n * ```\r\n */\r\nexport function objCopyProps(target: T, source: any, handler?: ObjDeepCopyHandler) {\r\n let ctx: _DeepCopyContext = {\r\n handler: handler,\r\n src: source,\r\n path: []\r\n };\r\n\r\n return _copyProps([], target, source, ctx);\r\n}\r\n\r\n/**\r\n * Context details passed to the deep copy handler to allow it parse the current value based on the original source\r\n * and path to reach the current value. The provided value should be updated with the value to by copied into the\r\n * new deep copy and will be used when the handler returns true.\r\n * @since 0.4.4\r\n * @group Object - Deep Copy\r\n */\r\nexport interface IObjDeepCopyHandlerDetails {\r\n /**\r\n * Identifies the type of the value as per `typeof value`, saves each check having to process this value.\r\n */\r\n type: string;\r\n\r\n /**\r\n * Identifies whether the type of the value is considered to be a primitive value\r\n */\r\n isPrim: boolean;\r\n\r\n /**\r\n * Identifies whether the type is a plain object or not, this also saves each handler from checking\r\n * the `type`, currently the type will also be \"object\" if this is `true`.\r\n * @since 0.9.6\r\n */\r\n isPlain: boolean;\r\n\r\n /**\r\n * The current value to be processed, replace this value with the new deep copied value to use when returning\r\n * true from the handler. Ignored when the handler returns false.\r\n */\r\n readonly value: any;\r\n\r\n /**\r\n * Replace this value with the new deep copied value (defaults to the same as the value property) this value will be\r\n * used when returning true from the handler. Ignored when the handler returns false.\r\n */\r\n result: any;\r\n\r\n /**\r\n * A array of keys from the orginal source (origin) object which lead to the current value\r\n */\r\n path: Array;\r\n\r\n /**\r\n * The original source object passed into the `objDeepCopy()` or `objCopyProps()` functions.\r\n */\r\n origin?: any;\r\n\r\n /**\r\n * Continue the deep copy with the current context and recursive checks, effectively calls {@link objDeepCopy}\r\n * but keeps the current context and recursive references.\r\n * @param source - The source object to be copied\r\n */\r\n copy(source: T, key?: string | number | symbol): T;\r\n\r\n /**\r\n * Continue the deep copy with the current context and recursive checks by copying all of the properties\r\n * from the source to the target instance, effectively calls {@link objCopyProps} but keeps the current context\r\n * and recursive references.\r\n * @param target - The target object to populated\r\n * @param source - The source object to copy the properties from\r\n */\r\n copyTo(target: T, source: T): T;\r\n}\r\n\r\n/**\r\n * An optional deep copy handler that lets you provide your own logic for deep copying objects, will\r\n * only be called once per object/property combination, so if an object is recursively included it\r\n * will only get called for the first instance.\r\n * Handlers SHOULD assign the \"result\" value with the new target instance BEFORE performing any additional deep copying,\r\n * so any recursive objects will get a reference to the new instance and not keep attempting to create new copies.\r\n * @since 0.4.4\r\n * @group Object - Deep Copy\r\n * @return true if handled and the value in details should be used otherwise false to continue with the default handling\r\n * The library includes several helpers which can be reused by any user provided handler\r\n * - {@link functionDeepCopyHandler} - Used to copy functions\r\n * - {@link arrayDeepCopyHandler} - Used to copy arrays\r\n * - {@link plainObjDeepCopyHandler} - Used to copy plain objects\r\n * - {@link dateDeepCopyHandler} - Used to copy date instances\r\n */\r\nexport type ObjDeepCopyHandler = (details: IObjDeepCopyHandlerDetails) => boolean;\r\n\r\n/**\r\n * Performs a deep copy of the source object, this is designed to work with base (plain) objects, arrays and primitives\r\n * if the source object contains class objects they will either be not cloned or may be considered non-operational after\r\n * performing a deep copy. ie. This is performing a deep copy of the objects properties so that altering the copy will\r\n * not mutate the source object hierarchy.\r\n * Automatic handling of recursive properties was added in v0.4.4.\r\n * @group Object\r\n * @group Object - Deep Copy\r\n * @param source - The source object to be copied\r\n * @param handler - An optional callback that lets you provide / overide the deep cloning (Since 0.4.4)\r\n * @return A new object which contains a deep copy of the source properties\r\n * @example\r\n * ```ts\r\n * let a: any = { a: 1 };\r\n * let b: any = { b: 2, d: new Date(), e: new TestClass(\"Hello Darkness\") };\r\n * a.b = b; // { a: 1, b: { b: 2} }\r\n * b.a = a; // { a: 1, b: { b: 2, a: { a: 1, { b: 2, a: ... }}}}\r\n *\r\n * function copyHandler(details: IObjDeepCopyHandlerDetails) {\r\n * // details.origin === a\r\n * // details.path[] is the path to the current value\r\n * if (details.value && isDate(details.value)) {\r\n * // So for the date path === [ \"b\", \"d\" ] which represents\r\n * // details.origin[\"b\"][\"d\"] === The Date\r\n *\r\n * // Return true to indicate that we have \"handled\" the conversion\r\n * // Which in this case will reuse the existing instance (as we didn't replace details.value)\r\n * // See objCopyProps example for replacing the Date instance\r\n * return true;\r\n * }\r\n *\r\n * return false;\r\n * }\r\n *\r\n * let c: any = objDeepCopy(a, copyHandler);\r\n *\r\n * assert.notEqual(a, c, \"check a and c are not the same\");\r\n * assert.ok(c === c.b.a, \"The root object won't be the same for the target reference\");\r\n * assert.ok(c.b === c.b.a.b, \"Check that the 2 'b' references are the same object\");\r\n * assert.ok(c.b.a === c.b.a.b.a, \"Check that the 2 'a' references are the same object\");\r\n * assert.ok(c.b.d === c.b.a.b.d, \"Check that the 2 'd' references are the same object\");\r\n * assert.ok(isDate(c.b.d), \"The copied date is still real 'Date' instance\");\r\n * assert.equal(c.b.d, a.b.d, \"And the copied date is the original date\");\r\n * assert.equal(c.b.d.getTime(), a.b.d.getTime(), \"But the dates are the same\");\r\n * assert.ok(isObject(c.b.d), \"The copied date is now an object\");\r\n * assert.ok(!isError(c.b.e), \"The copied error is no longer a real 'Error' instance\");\r\n * assert.ok(isObject(c.b.e), \"The copied error is now an object\");\r\n * assert.equal(42, c.b.e.value, \"Expect that the local property was copied\");\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function objDeepCopy(source: T, handler?: ObjDeepCopyHandler): T {\r\n let ctx: _DeepCopyContext = {\r\n handler: handler,\r\n src: source\r\n };\r\n\r\n return _deepCopy([], source, ctx);\r\n}\r\n\r\n/**\r\n * Deep copy handler to identify and copy arrays.\r\n * @since 0.4.4\r\n * @group Object - Deep Copy\r\n * @param details - The details object for the current property being copied\r\n * @returns `true` if the current value is a function otherwise `false`\r\n */\r\nexport function arrayDeepCopyHandler(details: IObjDeepCopyHandlerDetails): boolean {\r\n let value = details.value;\r\n if (isArray(value)) {\r\n // Assign the \"result\" value before performing any additional deep Copying, so any recursive object get a reference to this instance\r\n let target: any[] = details.result = [];\r\n target.length = value.length;\r\n\r\n // Copying all properties as arrays can contain non-indexed based properties\r\n details.copyTo(target, value);\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Deep copy handler to identify and copy Date instances.\r\n * @since 0.4.4\r\n * @group Object - Deep Copy\r\n * @param details - The details object for the current property being copied\r\n * @returns `true` if the current value is a function otherwise `false`\r\n */\r\nexport function dateDeepCopyHandler(details: IObjDeepCopyHandlerDetails) {\r\n let value = details.value;\r\n if (isDate(value)) {\r\n details.result = new Date(value.getTime());\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Deep copy handler to identify and copy functions. This handler just returns the original\r\n * function so the original function will be assigned to any new deep copied instance.\r\n * @since 0.4.4\r\n * @group Object - Deep Copy\r\n * @param details - The details object for the current property being copied\r\n * @returns `true` if the current value is a function otherwise `false`\r\n */\r\nexport function functionDeepCopyHandler(details: IObjDeepCopyHandlerDetails): boolean {\r\n if (details.type === FUNCTION) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Deep copy handler to identify and copy plain objects.\r\n * @since 0.4.4\r\n * @group Object - Deep Copy\r\n * @param details - The details object for the current property being copied\r\n * @returns `true` if the current value is a function otherwise `false`\r\n */\r\nexport function plainObjDeepCopyHandler(details: IObjDeepCopyHandlerDetails): boolean {\r\n let value = details.value;\r\n if (value && details.isPlain) {\r\n // Assign the \"result\" value before performing any additional deep Copying, so any recursive object get a reference to this instance\r\n let target = details.result = {};\r\n details.copyTo(target, value);\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { arrForEach } from \"../array/forEach\";\r\nimport { ArrSlice, CALL } from \"../internal/constants\";\r\nimport { objCopyProps, objDeepCopy } from \"../object/copy\";\r\n\r\n/**\r\n * @internal\r\n * @ignore\r\n */\r\nfunction _doExtend(target: T, theArgs: any[]): any {\r\n arrForEach(theArgs, (theArg) => {\r\n objCopyProps(target, theArg);\r\n });\r\n\r\n return target;\r\n}\r\n\r\n/**\r\n * Create a new object by merging the passed arguments, this is effectively the same as calling `objExtend({}, ...theArgs)` where\r\n * all of the arguments are added to a new object that is returned.\r\n * @group Object\r\n * @param target - The original object to be extended.\r\n * @param theArgs - The optional number of arguments to be copied\r\n * @returns - A new object or the original\r\n */\r\nexport function deepExtend(target: T, ...theArgs: any): T & any;\r\n\r\n/**\r\n * Create a new object by merging the passed arguments, this is effectively the same as calling `objExtend({}, ...theArgs)` where\r\n * all of the arguments are added to a new object that is returned.\r\n * @group Object\r\n * @param target - The original object to be extended.\r\n * @param objN - The optional number of arguments to be copied\r\n * @returns - A new object or the original\r\n */\r\nexport function deepExtend(target: T, obj1?: T1, obj2?: T2, obj3?: T3, obj4?: T4, obj5?: T5, obj6?: T6): T & T1 & T2 & T3 & T4 & T5 & T6 {\r\n return _doExtend(objDeepCopy(target) || {}, ArrSlice[CALL](arguments));\r\n}\r\n \r\n/**\r\n * Extend the target object by merging the passed arguments into it\r\n * @group Object\r\n * @param target - The object to be extended or overwritten\r\n * @param theArgs - The optional number of arguments to be copied\r\n * @returns - A new object or the original\r\n */\r\nexport function objExtend(target: T, ...theArgs: any): T & any;\r\n\r\n/**\r\n * Extend the target object by merging the passed arguments into it\r\n * @group Object\r\n * @param target - The object to be extended or overwritten\r\n * @param objN - The optional number of arguments to be copied\r\n * @returns - A new object or the original\r\n */\r\nexport function objExtend(target: T, obj1?: T1, obj2?: T2, obj3?: T3, obj4?: T4, obj5?: T5, obj6?: T6): T & T1 & T2 & T3 & T4 & T5 & T6 {\r\n return _doExtend(target || {}, ArrSlice[CALL](arguments));\r\n}\r\n\r\n ","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { LENGTH } from \"../internal/constants\";\r\nimport { _unwrapProp } from \"../internal/unwrapFunction\";\r\n\r\n/**\r\n * Interface to identify that an object contains the length property used as a type\r\n * constraint for {@link getLength}\r\n *\r\n * @since 0.4.2\r\n * @group String\r\n * @group Array\r\n * @group Object\r\n */\r\nexport interface IGetLength {\r\n\r\n /**\r\n * Identifies the property that returns the length of the instance\r\n */\r\n length: unknown;\r\n}\r\n\r\n/**\r\n * Helper to return the length value of an object, this will return the value\r\n * of the \"length\" property. Generally used to return the length of a string or array.\r\n *\r\n * @since 0.4.2\r\n * @group Array\r\n * @group String\r\n * @group String\r\n * @group Array\r\n * @group Object\r\n * @param value - The value to return the length property from, must contain a `length` property\r\n * @example\r\n * ```ts\r\n * getLength(\"\"); // returns 0\r\n * getLength(\"Hello World\"); // returns 11\r\n * getLength([]); // returns 0;\r\n * getLength([0, 1, 2, 3]); // returns 4;\r\n * getLength({ length: 42}); // returns 42\r\n * getLength({ length: () => 53; }); // returns the function that if called would return 53\r\n * ```\r\n */\r\nexport const getLength: (value: T) => T[\"length\"] = (/*#__PURE__*/_unwrapProp(LENGTH));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { ICachedValue, createCachedValue } from \"./cache\";\r\nimport { utcNow } from \"./date\";\r\nimport { getInst } from \"./environment\";\r\nimport { _globalLazyTestHooks, _initTestHooks } from \"./lazy\";\r\nimport { safe } from \"./safe\";\r\n\r\nlet _perf: ICachedValue\r\n\r\n/**\r\n * Identify whether the runtimne contains a `performance` object\r\n *\r\n * @since 0.4.4\r\n * @group Environment\r\n * @returns\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function hasPerformance(): boolean {\r\n return !!getPerformance();\r\n}\r\n\r\n/**\r\n * Returns the global `performance` Object if available, which can be used to\r\n * gather performance information about the current document. It serves as the\r\n * point of exposure for the Performance Timeline API, the High Resolution Time\r\n * API, the Navigation Timing API, the User Timing API, and the Resource Timing API.\r\n *\r\n * @since 0.4.4\r\n * @group Environment\r\n * @returns The global performance object if available.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function getPerformance(): Performance {\r\n !_globalLazyTestHooks && _initTestHooks();\r\n if (!_perf || _globalLazyTestHooks.lzy) {\r\n _perf = createCachedValue(safe(getInst, [\"performance\"]).v);\r\n }\r\n \r\n return _perf.v;\r\n}\r\n\r\n/**\r\n * Returns the number of milliseconds that has elapsed since the time origin, if\r\n * the runtime does not support the `performance` API it will fallback to return\r\n * the number of milliseconds since the unix epoch.\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n *\r\n * @returns The number of milliseconds as a `DOMHighResTimeStamp` double value or\r\n * an integer depending on the runtime.\r\n * @example\r\n * ```ts\r\n * let now = perfNow();\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function perfNow(): number {\r\n let perf = getPerformance();\r\n if (perf && perf.now) {\r\n return perf.now();\r\n }\r\n\r\n return utcNow();\r\n}\r\n\r\n/**\r\n * Return the number of milliseconds that have elapsed since the provided `startTime`\r\n * the `startTime` MUST be obtained from {@link perfNow} to ensure the correct elapsed\r\n * value is returned.\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n *\r\n * @param startTime - The startTime obtained from `perfNow`\r\n * @returns The number of milliseconds that have elapsed since the startTime.\r\n * @example\r\n * ```ts\r\n * let start = perfNow();\r\n * // Do some work\r\n * let totalTime = elapsedTime(start);\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function elapsedTime(startTime: number): number {\r\n return perfNow() - startTime;\r\n}","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { MathCls } from \"../internal/constants\";\r\nimport { _pureRef } from \"../internal/treeshake_helpers\";\r\n\r\n/**\r\n * The `mathRound()` function returns the value of a number rounded to the nearest integer.\r\n *\r\n * If the fractional portion of the argument is greater than 0.5, the argument is rounded to the\r\n * integer with the next higher absolute value. If it is less than 0.5, the argument is rounded\r\n * to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the\r\n * argument is rounded to the next integer in the direction of +∞.\r\n *\r\n * > Note: This differs from many languages' round() functions, which often round half-increments\r\n * > away from zero, giving a different result in the case of negative numbers with a fractional part of exactly 0.5.\r\n *\r\n * `mathRound(x)` is not exactly the same as `mathFloor(x + 0.5)`. When `x` is -0, or -0.5 ≤ x < 0, `mathRound(x)`\r\n * returns -0, while `mathFloor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors,\r\n * `mathRound(x)` and `mathFloor(x + 0.5)` are generally equivalent.\r\n * @group Math\r\n * @since 0.11.8\r\n * @param x - A number\r\n * @returns A value of `x` rounded to the nearest integer.\r\n * @example\r\n * ```ts\r\n * mathRound(0.9); // 1\r\n * mathRound(5.95); // 6\r\n * mathRound(5.5); // 6\r\n * mathRound(5.05); // 5\r\n * mathRound(-5.05); // -5\r\n * mathRound(-5.5); // -5\r\n * mathRound(-5.95); // -6\r\n * mathRound(-0.9); // -1\r\n * ```\r\n */\r\nexport const mathRound = (/*#__PURE__*/_pureRef(MathCls, \"round\"));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2023 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { NULL_VALUE, StrProto } from \"../internal/constants\";\r\nimport { _unwrapFunction, _unwrapFunctionWithPoly } from \"../internal/unwrapFunction\";\r\nimport { polyStrSymSplit } from \"../polyfills/split\";\r\nimport { hasSymbol } from \"../symbol/symbol\";\r\n\r\n/**\r\n * The `strSplit()` splits a string into substrings using the pattern and divides a String\r\n * into an ordered list of substrings by searching for the pattern, puts these substrings\r\n * into an array, and returns the array.\r\n * @since 0.9.1\r\n * @group String\r\n * @param value - The string value to be split into substrings.\r\n * @param separator - The pattern describing where each split should occur. Can be undefined, a\r\n * string, or an object with a [`Symbol.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split)\r\n * method (if supported) — the typical example being a regular expression. Omitting separator or\r\n * passing undefined causes strSplit() to return an array with the calling string as a single\r\n * element. All values that are not undefined or objects with a `@@split` method are coerced to strings.\r\n * @param limit - A non-negative integer specifying a limit on the number of substrings to be\r\n * included in the array. If provided, splits the string at each occurrence of the specified\r\n * separator, but stops when limit entries have been placed in the array. Any leftover text is\r\n * not included in the array at all.\r\n * - The array may contain fewer entries than limit if the end of the string is reached before\r\n * the limit is reached.\r\n * - If limit is 0, [] is returned.\r\n * @return An Array of strings, split at each point where the separator occurs in the given string.\r\n * @example\r\n * ```ts\r\n * strSplit(\"Oh brave new world that has such people in it.\", \" \");\r\n * // [ \"Oh\", \"brave\", \"new\", \"world\", \"that\", \"has\", \"such\", \"people\", \"in\", \"it.\" ]\r\n *\r\n * strSplit(\"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec\", \",\");\r\n * // [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ]\r\n * ```\r\n */\r\nexport const strSplit: (value: string, separator: string | RegExp, limit?: number) => string[] = (/*#__PURE__*/_unwrapFunction(\"split\", StrProto));\r\n\r\n/**\r\n * The `strSymSplit()` splits a string into substrings using the [`Symbol.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split)\r\n * method from the splitter object to provide custom behavior. If the runtime supports symbols\r\n * then the default runtime `split` method will be called, It will use {@link getKnownSymbol}\r\n * to get the {@link WellKnownSymbols.split} symbol which will return the runtime symbol or the\r\n * polyfill symbol when not supported by the runtime.\r\n * @since 0.9.1\r\n * @group String\r\n * @param value - The string value to be split into substrings.\r\n * @param splitter - The object which contains a Symbol.split method, Omitting splitter or passing\r\n * an object that doesn't contain a Symbol.split causes it to return an array with the calling\r\n * string as a single element.\r\n * @param limit - A non-negative integer specifying a limit on the number of substrings to be\r\n * included in the array. If provided, splits the string at each occurrence of the specified\r\n * separator, but stops when limit entries have been placed in the array. Any leftover text is\r\n * not included in the array at all.\r\n * - The array may contain fewer entries than limit if the end of the string is reached before\r\n * the limit is reached.\r\n * - If limit is 0, [] is returned.\r\n * @return An Array of strings, split at each point where the separator occurs in the given string.\r\n * @example\r\n * ```ts\r\n * const splitByNumber = {\r\n * [Symbol.split]: (str: string) => {\r\n * let num = 1;\r\n * let pos = 0;\r\n * const result = [];\r\n * while (pos < str.length) {\r\n * const matchPos = strIndexOf(str, asString(num), pos);\r\n * if (matchPos === -1) {\r\n * result.push(strSubstring(str, pos));\r\n * break;\r\n * }\r\n * result.push(strSubstring(str, pos, matchPos));\r\n * pos = matchPos + asString(num).length;\r\n * num++;\r\n * }\r\n * return result;\r\n * }\r\n * };\r\n *\r\n * const myString = \"a1bc2c5d3e4f\";\r\n * console.log(strSymSplit(myString, splitByNumber)); // [ \"a\", \"bc\", \"c5d\", \"e\", \"f\" ]\r\n * ```\r\n */\r\nexport const strSymSplit: (value: string, splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number) => string[] = (/*#__PURE__*/_unwrapFunctionWithPoly(\"split\", StrProto, !hasSymbol() ? polyStrSymSplit : NULL_VALUE));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { arrForEach } from \"../array/forEach\";\r\nimport { isNullOrUndefined } from \"./base\";\r\nimport { strSplit } from \"../string/split\";\r\nimport { iterForOf } from \"../iterator/forOf\";\r\n\r\n/**\r\n * Get the named value from the target object where the path may be presented by a string which\r\n * contains \".\" characters to separate the nested objects of the heirarchy / path to the value.\r\n * @since 0.9.1\r\n * @group Value\r\n * @param target - The source object that contains the value\r\n * @param path - The path identifing the location where the value should be located\r\n * @param defValue - If the final value or any intervening object in the heirarchy is not present\r\n * the default value will be returned\r\n * @returns The value located based on the path or the defaule value\r\n * @example\r\n * ```ts\r\n * let theValue = {\r\n * Hello: {\r\n * Darkness: {\r\n * my: \"old\"\r\n * }\r\n * },\r\n * friend: \"I've\",\r\n * come: {\r\n * to: {\r\n * see: \"you\"\r\n * }\r\n * }\r\n * };\r\n *\r\n * let value = getValueByKey(theValue, \"Hello.Darkness.my\", \"friend\");\r\n * // value === \"my\"\r\n *\r\n * let value = getValueByKey(theValue, \"My.Old\", \"friend\");\r\n * // value === \"friend\"\r\n *\r\n * let value = getValueByKey(theValue, \"come.to\", \"friend\");\r\n * // value === { see: \"you\" }\r\n *\r\n * let value = getValueByKey(theValue, \"friend\", \"friend\");\r\n * // value === \"I've\"\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function getValueByKey(target: T, path: string, defValue?: V): V {\r\n if (!path || !target) {\r\n return defValue;\r\n }\r\n\r\n let parts = strSplit(path, \".\");\r\n let cnt = parts.length;\r\n\r\n for (let lp = 0; lp < cnt && !isNullOrUndefined(target); lp++) {\r\n target = target[parts[lp]];\r\n }\r\n\r\n return (!isNullOrUndefined(target) ? target : defValue) as V;\r\n}\r\n\r\n/**\r\n * Get the named value from the target object where the path is represented by the string iterator\r\n * or iterable to separate the nested objects of the heirarchy / path to the value. If the target\r\n * does not contain the full path the iterator will not be completed.\r\n *\r\n * The order of processing of the iterator is not reset if you add or remove elements to the iterator,\r\n * the actual behavior will depend on the iterator imeplementation.\r\n *\r\n * If the passed `iter` is both an Iterable and Iterator the Iterator interface takes preceedence.\r\n * @since 0.9.1\r\n * @group Value\r\n * @param target - The source object that contains the value\r\n * @param iter - The iter identifying the path of the final key value\r\n * @param defValue - If the final value or any intervening object in the heirarchy is not present\r\n * the default value will be returned\r\n * @returns The value located based on the path or the defaule value\r\n * @example\r\n * ```ts\r\n * let theValue = {\r\n * Hello: {\r\n * Darkness: {\r\n * my: \"old\"\r\n * }\r\n * },\r\n * friend: \"I've\",\r\n * come: {\r\n * to: {\r\n * see: \"you\"\r\n * }\r\n * }\r\n * };\r\n *\r\n * let value = getValueByKey(theValue, [\"Hello\", \"Darkness\", \"my\"], \"friend\");\r\n * // value === \"my\"\r\n *\r\n * let value = getValueByKey(theValue, [\"My\", \"Old\"], \"friend\");\r\n * // value === \"friend\"\r\n *\r\n * let value = getValueByKey(theValue, [\"come\", \"to\"], \"friend\");\r\n * // value === { see: \"you\" }\r\n *\r\n * let value = getValueByKey(theValue, [\"friend\"], \"friend\");\r\n * // value === \"I've\"\r\n * ```\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function getValueByIter(target: T, iter: Iterator | Iterable, defValue?: V): V {\r\n if (!iter || !target) {\r\n return defValue;\r\n }\r\n\r\n iterForOf(iter, (value) => {\r\n if (isNullOrUndefined(target)) {\r\n return -1;\r\n }\r\n\r\n target = target[value];\r\n });\r\n\r\n return (!isNullOrUndefined(target) ? target : defValue) as V;\r\n}\r\n\r\n/**\r\n * Set the named value on the target object where the path may be presented by a string which\r\n * contains \".\" characters to separate the nested objects of the heirarchy / path to the value.\r\n * @since 0.9.1\r\n * @group Value\r\n * @param target - The target object\r\n * @param path - The path identifying the location of the final key value\r\n * @param value - The value to set\r\n * @example\r\n * ```ts\r\n * let theValue = { };\r\n * setValueByKey(theValue, \"Hello.Darkness.my\", \"old\");\r\n * // Resulting Object: { Hello: { Darkness: { my: \"old\" } } }\r\n * setValueByKey(theValue, \"friend\", \"I've\");\r\n * // Resulting Object: { Hello: { Darkness: { my: \"old\" } }, friend: \"I've\" }\r\n * setValueByKey(theValue, \"come.to.see\", \"you\");\r\n * // Resulting Object: { Hello: { Darkness: { my: \"old\" } }, friend: \"I've\", come: { to : { see: \"you\" } } }\r\n * ```\r\n */\r\nexport function setValueByKey(target: any, path: string, value: T) {\r\n if (target && path) {\r\n let parts = strSplit(path, \".\");\r\n let lastKey = parts.pop();\r\n \r\n arrForEach(parts, (key) => {\r\n if (isNullOrUndefined(target[key])) {\r\n // Add an empty object / map\r\n target[key] = {};\r\n }\r\n \r\n target = target[key];\r\n });\r\n \r\n target[lastKey] = value;\r\n }\r\n}\r\n\r\n/**\r\n * Set the named value on the target object where the path is represented by the string iterator\r\n * or iterable to separate the nested objects of the heirarchy / path to the value.\r\n *\r\n * The order of processing of the iterator is not reset if you add or remove elements to the iterator,\r\n * the actual behavior will depend on the iterator imeplementation.\r\n *\r\n * If the passed `iter` is both an Iterable and Iterator the Iterator interface takes preceedence.\r\n * @since 0.9.1\r\n * @group Value\r\n * @param target - The target object\r\n * @param iter - The iter identifying the path of the final key value\r\n * @param value - The value to set\r\n * @example\r\n * ```ts\r\n * let theValue = { };\r\n * setValueByIter(theValue, [\"Hello\", \"Darkness\", \"my\"], \"old\");\r\n * // Resulting Object: { Hello: { Darkness: { my: \"old\" } } }\r\n * setValueByIter(theValue, [\"friend\"], \"I've\");\r\n * // Resulting Object: { Hello: { Darkness: { my: \"old\" } }, friend: \"I've\" }\r\n * setValueByIter(theValue, [\"come\", \"to\", \"see\"], \"you\");\r\n * // Resulting Object: { Hello: { Darkness: { my: \"old\" } }, friend: \"I've\", come: { to : { see: \"you\" } } }\r\n * ```\r\n */\r\nexport function setValueByIter(target: any, iter: Iterator | Iterable, value: T) {\r\n if (target && iter) {\r\n let lastKey: string;\r\n \r\n iterForOf(iter, (key: string) => {\r\n if (lastKey) {\r\n if (isNullOrUndefined(target[lastKey])) {\r\n // Add an empty object / map\r\n target[lastKey] = {};\r\n }\r\n \r\n target = target[lastKey];\r\n }\r\n\r\n lastKey = key;\r\n });\r\n \r\n target[lastKey] = value;\r\n }\r\n}","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { isString, isUndefined } from \"../helpers/base\";\r\nimport { dumpObj } from \"../helpers/diagnostics\";\r\nimport { throwTypeError } from \"../helpers/throw\";\r\nimport { LENGTH, StrProto } from \"../internal/constants\";\r\nimport { _unwrapFunctionWithPoly } from \"../internal/unwrapFunction\";\r\nimport { asString } from \"./as_string\";\r\nimport { strSubstring } from \"./substring\";\r\n\r\n/**\r\n * This method lets you determine whether or not a string ends with another string. This method is case-sensitive.\r\n * @group String\r\n * @param value - The value to be checked\r\n * @param searchString - The characters to be searched for at the end of `value` string.\r\n * @param length - If provided, it is used as the length of `value`. Defaults to value.length.\r\n */\r\nexport const strEndsWith: (value: string, searchString: string, length?: number) => boolean = (/*#__PURE__*/_unwrapFunctionWithPoly(\"endsWith\", StrProto, polyStrEndsWith));\r\n\r\n/**\r\n * This method lets you determine whether or not a string ends with another string. This method is case-sensitive.\r\n * @group Polyfill\r\n * @group String\r\n * @param value - The value to be checked\r\n * @param searchString - The characters to be searched for at the end of `value` string.\r\n * @param length - If provided, it is used as the length of `value`. Defaults to value.length.\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function polyStrEndsWith(value: string, searchString: string, length?: number): boolean {\r\n if (!isString(value)) {\r\n throwTypeError(\"'\" + dumpObj(value) + \"' is not a string\");\r\n }\r\n\r\n let searchValue = isString(searchString) ? searchString : asString(searchString);\r\n let end = (!isUndefined(length) && length < value[LENGTH]) ? length : value[LENGTH];\r\n\r\n return strSubstring(value, end - searchValue[LENGTH], end) === searchValue;\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { StrProto } from \"../internal/constants\";\r\nimport { _unwrapFunction } from \"../internal/unwrapFunction\";\r\n\r\n/**\r\n * The `strIndexOf()` method, given two arguments: the string and a substring to search for, searches\r\n * the entire calling string, and returns the index of the first occurrence of the specified substring.\r\n * Given a thrid argument: a number, the method returns the first occurrence of the specified substring\r\n * at an index greater than or equal to the specified number.\r\n * @group String\r\n * @param value - The value to be checked for the seeach string\r\n * @param searchString - The substring to search for in the value\r\n * @param position - The starting position to search from\r\n * @example\r\n * ```ts\r\n * strIndexOf('hello world', '') // returns 0\r\n * strIndexOf('hello world', '', 0) // returns 0\r\n * strIndexOf('hello world', '', 3) // returns 3\r\n * strIndexOf('hello world', '', 8) // returns 8\r\n *\r\n * // However, if the thrid argument is greater than the length of the string\r\n * strIndexOf('hello world', '', 11) // returns 11\r\n * strIndexOf('hello world', '', 13) // returns 11\r\n * strIndexOf('hello world', '', 22) // returns 11\r\n *\r\n * strIndexOf('Blue Whale', 'Blue') // returns 0\r\n * strIndexOf('Blue Whale', 'Blute') // returns -1\r\n * strIndexOf('Blue Whale', 'Whale', 0) // returns 5\r\n * strIndexOf('Blue Whale', 'Whale', 5) // returns 5\r\n * strIndexOf('Blue Whale', 'Whale', 7) // returns -1\r\n * strIndexOf('Blue Whale', '') // returns 0\r\n * strIndexOf('Blue Whale', '', 9) // returns 9\r\n * strIndexOf('Blue Whale', '', 10) // returns 10\r\n * strIndexOf('Blue Whale', '', 11) // returns 10\r\n * ```\r\n */\r\nexport const strIndexOf: (value: string, searchString: string, position?: number) => number = (/*#__PURE__*/_unwrapFunction(\"indexOf\", StrProto));\r\n\r\n/**\r\n * The `strLastIndexOf()` method, given two arguments: the string and a substring to search for, searches\r\n * the entire calling string, and returns the index of the last occurrence of the specified substring.\r\n * Given a third argument: a number, the method returns the last occurrence of the specified substring\r\n * at an index less than or equal to the specified number.\r\n * @group String\r\n * @param value - The value to be checked for the seeach string\r\n * @param searchString - The substring to search for in the value\r\n * @param position - The starting position to search from\r\n * @example\r\n * ```ts\r\n * strLastIndexOf('canal', 'a'); // returns 3\r\n * strLastIndexOf('canal', 'a', 2); // returns 1\r\n * strLastIndexOf('canal', 'a', 0); // returns -1\r\n * strLastIndexOf('canal', 'x'); // returns -1\r\n * strLastIndexOf('canal', 'c', -5); // returns 0\r\n * strLastIndexOf('canal', 'c', 0); // returns 0\r\n * strLastIndexOf('canal', ''); // returns 5\r\n * strLastIndexOf('canal', '', 2); // returns 2\r\n * ```\r\n */\r\nexport const strLastIndexOf: (value: string, searchString: string, position?: number) => number = (/*#__PURE__*/_unwrapFunction(\"lastIndexOf\", StrProto));\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { NULL_VALUE } from \"../internal/constants\";\r\nimport { objDefineProp } from \"../object/define\";\r\n\r\nconst REF = \"ref\";\r\nconst UNREF = \"unref\";\r\nconst HAS_REF = \"hasRef\";\r\nconst ENABLED = \"enabled\";\r\n\r\n/**\r\n * A Timer handler which is returned from {@link scheduleTimeout} which contains functions to\r\n * cancel or restart (refresh) the timeout function.\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n */\r\nexport interface ITimerHandler {\r\n /**\r\n * Cancels a timeout that was previously scheduled, after calling this function any previously\r\n * scheduled timer will not execute.\r\n * @example\r\n * ```ts\r\n * let theTimer = scheduleTimeout(...);\r\n * theTimer.cancel();\r\n * ```\r\n */\r\n cancel(): void;\r\n\r\n /**\r\n * Reschedules the timer to call its callback at the previously specified duration\r\n * adjusted to the current time. This is useful for refreshing a timer without allocating\r\n * a new JavaScript object.\r\n *\r\n * Using this on a timer that has already called its callback will reactivate the timer.\r\n * Calling on a timer that has not yet executed will just reschedule the current timer.\r\n * @example\r\n * ```ts\r\n * let theTimer = scheduleTimeout(...);\r\n * // The timer will be restarted (if already executed) or rescheduled (if it has not yet executed)\r\n * theTimer.refresh();\r\n * ```\r\n */\r\n refresh(): ITimerHandler;\r\n\r\n /**\r\n * When called, requests that the event loop not exit so long when the ITimerHandler is active.\r\n * Calling timer.ref() multiple times will have no effect. By default, all ITimerHandler objects\r\n * will create \"ref'ed\" instances, making it normally unnecessary to call timer.ref() unless\r\n * timer.unref() had been called previously.\r\n * @since 0.7.0\r\n * @returns the ITimerHandler instance\r\n * @example\r\n * ```ts\r\n * let theTimer = createTimeout(...);\r\n *\r\n * // Make sure the timer is referenced (the default) so that the runtime (Node) does not terminate\r\n * // if there is a waiting referenced timer.\r\n * theTimer.ref();\r\n * ```\r\n */\r\n ref(): this;\r\n\r\n /**\r\n * When called, the any active ITimerHandler instance will not require the event loop to remain\r\n * active (Node.js). If there is no other activity keeping the event loop running, the process may\r\n * exit before the ITimerHandler instance callback is invoked. Calling timer.unref() multiple times\r\n * will have no effect.\r\n * @since 0.7.0\r\n * @returns the ITimerHandler instance\r\n * @example\r\n * ```ts\r\n * let theTimer = createTimeout(...);\r\n *\r\n * // Unreference the timer so that the runtime (Node) may terminate if nothing else is running.\r\n * theTimer.unref();\r\n * ```\r\n */\r\n unref(): this;\r\n\r\n /**\r\n * If true, any running referenced `ITimerHandler` instance will keep the Node.js event loop active.\r\n * @since 0.7.0\r\n * @example\r\n * ```ts\r\n * let theTimer = createTimeout(...);\r\n *\r\n * // Unreference the timer so that the runtime (Node) may terminate if nothing else is running.\r\n * theTimer.unref();\r\n * let hasRef = theTimer.hasRef(); // false\r\n *\r\n * theTimer.ref();\r\n * hasRef = theTimer.hasRef(); // true\r\n * ```\r\n */\r\n hasRef(): boolean;\r\n\r\n /**\r\n * Gets or Sets a flag indicating if the underlying timer is currently enabled and running.\r\n * Setting the enabled flag to the same as it's current value has no effect, setting to `true`\r\n * when already `true` will not {@link ITimerHandler.refresh | refresh}() the timer.\r\n * And setting to `false` will {@link ITimerHandler.cancel | cancel}() the timer.\r\n * @since 0.8.1\r\n * @example\r\n * ```ts\r\n * let theTimer = createTimeout(...);\r\n *\r\n * // Check if enabled\r\n * theTimer.enabled; // false\r\n *\r\n * // Start the timer\r\n * theTimer.enabled = true; // Same as calling refresh()\r\n * theTimer.enabled; //true\r\n *\r\n * // Has no effect as it's already running\r\n * theTimer.enabled = true;\r\n *\r\n * // Will refresh / restart the time\r\n * theTimer.refresh()\r\n *\r\n * let theTimer = scheduleTimeout(...);\r\n *\r\n * // Check if enabled\r\n * theTimer.enabled; // true\r\n * ```\r\n */\r\n enabled: boolean;\r\n}\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n */\r\nexport interface _TimerHandler {\r\n /**\r\n * The public handler to return to the caller\r\n */\r\n h: ITimerHandler,\r\n\r\n /**\r\n * The callback function that should be called when the timer operation\r\n * has completed and will not automatically rescheduled\r\n * @returns\r\n */\r\n dn: () => void\r\n}\r\n\r\n/**\r\n * @ignore\r\n * @internal\r\n * Internal function to create and manage an ITimerHandler implementation, the object returned from this function\r\n * it directly used / returned by the pulic functions used to create timers (idle, interval and timeout)\r\n * @param startTimer - Should the timer be started as part of creating the handler\r\n * @param refreshFn - The function used to create/start or refresh the timer\r\n * @param cancelFn - The function used to cancel the timer.\r\n * @returns The new ITimerHandler instance\r\n */\r\n/*#__NO_SIDE_EFFECTS__*/\r\nexport function _createTimerHandler(startTimer: boolean, refreshFn: (timerId: T) => T, cancelFn: (timerId: T) => void): _TimerHandler {\r\n let ref = true;\r\n let timerId: T = startTimer ? refreshFn(NULL_VALUE) : NULL_VALUE;\r\n let theTimerHandler: ITimerHandler;\r\n\r\n function _unref() {\r\n ref = false;\r\n timerId && timerId[UNREF] && timerId[UNREF]();\r\n return theTimerHandler;\r\n }\r\n\r\n function _cancel() {\r\n timerId && cancelFn(timerId);\r\n timerId = NULL_VALUE;\r\n }\r\n\r\n function _refresh() {\r\n timerId = refreshFn(timerId);\r\n if (!ref) {\r\n _unref();\r\n }\r\n\r\n return theTimerHandler;\r\n }\r\n\r\n function _setEnabled(value: boolean) {\r\n !value && timerId && _cancel();\r\n value && !timerId && _refresh();\r\n }\r\n\r\n theTimerHandler = {\r\n cancel: _cancel,\r\n refresh: _refresh\r\n } as any;\r\n\r\n theTimerHandler[HAS_REF] = () => {\r\n if (timerId && timerId[HAS_REF]) {\r\n return timerId[HAS_REF]();\r\n }\r\n\r\n return ref;\r\n };\r\n\r\n theTimerHandler[REF] = () => {\r\n ref = true;\r\n timerId && timerId[REF] && timerId[REF]();\r\n return theTimerHandler;\r\n };\r\n\r\n theTimerHandler[UNREF] = _unref;\r\n\r\n theTimerHandler = objDefineProp(theTimerHandler, ENABLED, {\r\n get: () => !!timerId,\r\n set: _setEnabled\r\n });\r\n\r\n return {\r\n h: theTimerHandler,\r\n dn: () => {\r\n timerId = NULL_VALUE;\r\n }\r\n };\r\n}\r\n","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 NevWare21 Solutions LLC\r\n * Licensed under the MIT license.\r\n */\r\n\r\nimport { fnApply } from \"../funcs/funcs\";\r\nimport { isArray } from \"../helpers/base\";\r\nimport { ArrSlice, CALL, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { ITimerHandler, _createTimerHandler } from \"./handler\";\r\n\r\nfunction _createTimeoutWith(startTimer: boolean, overrideFn: TimeoutOverrideFn | TimeoutOverrideFuncs, theArgs: any[]): ITimerHandler {\r\n let isArr = isArray(overrideFn);\r\n let len = isArr ? overrideFn.length : 0;\r\n let setFn: TimeoutOverrideFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;\r\n let clearFn: ClearTimeoutOverrideFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;\r\n\r\n let timerFn = theArgs[0];\r\n theArgs[0] = function () {\r\n handler.dn();\r\n fnApply(timerFn, UNDEF_VALUE, ArrSlice[CALL](arguments));\r\n };\r\n \r\n let handler = _createTimerHandler(startTimer, (timerId?: any) => {\r\n if (timerId) {\r\n if (timerId.refresh) {\r\n timerId.refresh();\r\n return timerId;\r\n }\r\n\r\n fnApply(clearFn, UNDEF_VALUE, [ timerId ]);\r\n }\r\n\r\n return fnApply(setFn, UNDEF_VALUE, theArgs);\r\n }, function (timerId: any) {\r\n fnApply(clearFn, UNDEF_VALUE, [ timerId ]);\r\n });\r\n\r\n return handler.h;\r\n}\r\n\r\n/**\r\n * The signature of the override timeout function used to create a new timeout instance, it follows the same signature as\r\n * the native `setTimeout` API.\r\n * @since 0.4.4\r\n * @group Timer\r\n * @param callback - A function to be executed after the timer expires.\r\n * @param ms - The time, in milliseconds that the timer should wait before the specified function or code is executed.\r\n * If this parameter is omitted, a value of 0 is used, meaning execute \"immediately\", or more accurately, the next event cycle.\r\n * @param args - Additional arguments which are passed through to the function specified by callback.\r\n * @return The returned timeoutID is a positive integer value which identifies the timer created by the call to setTimeout().\r\n * This value can be passed to clearTimeout() to cancel the timeout.\r\n */\r\nexport type TimeoutOverrideFn = (callback: (...args: TArgs) => void, ms?: number, ...args: TArgs) => number | any;\r\n\r\n/**\r\n * The signatire of the function to override clearing a previous timeout created with the {@link TimeoutOverrideFn}, it will be passed\r\n * the result returned from the {@link TimeoutOverrideFn} call.\r\n * @since 0.4.5\r\n * @group Timer\r\n * @param timeoutId - The value returned from the previous {@link TimeoutOverrideFn}.\r\n */\r\nexport type ClearTimeoutOverrideFn = (timeoutId: number | any) => void;\r\n\r\n/**\r\n * Defines the array signature used to pass the override set and clean functions for creating a timeout.\r\n * The first index [0] is the set function to be used and the second index [1] is the clear function to be used.\r\n * @since 0.4.5\r\n * @group Timer\r\n */\r\nexport type TimeoutOverrideFuncs = [ TimeoutOverrideFn | null, ClearTimeoutOverrideFn | null ];\r\n\r\n/**\r\n * Creates and starts a timer which executes a function or specified piece of code once the timer expires, this is simular\r\n * to using `setTimeout` but provides a return object for cancelling and restarting (refresh) the timer.\r\n *\r\n * The timer may be cancelled (cleared) by calling the `cancel()` function on the returned {@link ITimerHandler}, or\r\n * you can \"reschedule\" and/or \"restart\" the timer by calling the `refresh()` function on the returned {@link ITimerHandler}\r\n * instance\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n *\r\n * @param callback - The function to be executed after the timer expires.\r\n * @param timeout - The time, in milliseconds that the timer should wait before the specified\r\n * function or code is executed. If this parameter is omitted, a value of 0 is used, meaning\r\n * execute \"immediately\", or more accurately, the next event cycle.\r\n * @param args - Additional arguments which are passed through to the function specified by `callback`.\r\n * @returns A {@link ITimerHandler} instance which can be used to cancel the timeout.\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * let theTimeout = scheduleTimeout(() => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // Instead of calling clearTimeout() with the returned value from setTimeout() the returned\r\n * // handler instance can be used instead to cancel the timer\r\n * theTimeout.cancel();\r\n * theTimeout.enabled; // false\r\n *\r\n * // You can start the timer via enabled\r\n * theTimeout.enabled = true;\r\n *\r\n * // You can also \"restart\" the timer, whether it has previously triggered not not via the `refresh()`\r\n * theTimeout.refresh();\r\n * ```\r\n */\r\nexport function scheduleTimeout(callback: (...args: A) => void, timeout: number, ...args: A): ITimerHandler;\r\n\r\n/**\r\n * Creates and starts a timer which executes a function or specified piece of code once the timer expires, this is simular\r\n * to using `setTimeout` but provides a return object for cancelling and restarting (refresh) the timer.\r\n *\r\n * The timer may be cancelled (cleared) by calling the `cancel()` function on the returned {@link ITimerHandler}, or\r\n * you can \"reschedule\" and/or \"restart\" the timer by calling the `refresh()` function on the returned {@link ITimerHandler}\r\n * instance\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n *\r\n * @param callback - The function to be executed after the timer expires.\r\n * @param timeout - The time, in milliseconds that the timer should wait before the specified\r\n * function or code is executed. If this parameter is omitted, a value of 0 is used, meaning\r\n * execute \"immediately\", or more accurately, the next event cycle.\r\n * @param args - Additional arguments which are passed through to the function specified by `callback`.\r\n * @returns A {@link ITimerHandler} instance which can be used to cancel the timeout.\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * let theTimeout = scheduleTimeout(() => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // Instead of calling clearTimeout() with the returned value from setTimeout() the returned\r\n * // handler instance can be used instead to cancel the timer\r\n * theTimeout.cancel();\r\n * theTimeout.enabled; // false\r\n *\r\n * // You can start the timer via enabled\r\n * theTimeout.enabled = true;\r\n *\r\n * // You can also \"restart\" the timer, whether it has previously triggered not not via the `refresh()`\r\n * theTimeout.refresh();\r\n * ```\r\n */\r\nexport function scheduleTimeout(callback: (...args: A) => void, timeout: number): ITimerHandler {\r\n return _createTimeoutWith(true, UNDEF_VALUE, ArrSlice[CALL](arguments));\r\n}\r\n\r\n/**\r\n * Creates and starts a timer which executes a function or specified piece of code once the timer expires. The overrideFn will be\r\n * used to create the timer, this is simular to using `setTimeout` but provides a return object for cancelling and restarting\r\n * (refresh) the timer.\r\n *\r\n * The timer may be cancelled (cleared) by calling the `cancel()` function on the returned {@link ITimerHandler}, or\r\n * you can \"reschedule\" and/or \"restart\" the timer by calling the `refresh()` function on the returned {@link ITimerHandler}\r\n * instance\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n *\r\n * @param overrideFn - setTimeout override function this will be called instead of the `setTimeout`, if the value\r\n * of `overrideFn` is null or undefined it will revert back to the native `setTimeout`. May also be an array with contains\r\n * both the setTimeout and clearTimeout override functions, if either is not provided the default native functions will be used\r\n * @param callback - The function to be executed after the timer expires.\r\n * @param timeout - The time, in milliseconds that the timer should wait before the specified\r\n * function or code is executed. If this parameter is omitted, a value of 0 is used, meaning\r\n * execute \"immediately\", or more accurately, the next event cycle.\r\n * @param args - Additional arguments which are passed through to the function specified by `callback`.\r\n * @returns A {@link ITimerHandler} instance which can be used to cancel the timeout.\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * // Your own \"setTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newSetTimeoutFn(callback: TimeoutOverrideFn) {\r\n * overrideCalled ++;\r\n * return setTimeout(callback, timeout);\r\n * }\r\n *\r\n * let theTimeout = scheduleTimeoutWith(newSetTimeoutFn, () => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // Instead of calling clearTimeout() with the returned value from setTimeout() the returned\r\n * // handler instance can be used instead to cancel the timer\r\n * theTimeout.cancel();\r\n * theTimeout.enabled; // false\r\n *\r\n * // You can start the timer via enabled\r\n * theTimeout.enabled = true;\r\n *\r\n * // You can also \"restart\" the timer, whether it has previously triggered not not via the `refresh()`\r\n * theTimeout.refresh();\r\n * ```\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * // Your own \"setTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newSetTimeoutFn(callback: TimeoutOverrideFn) {\r\n * overrideCalled ++;\r\n * return setTimeout(callback, timeout);\r\n * }\r\n *\r\n * // Your own \"clearTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newClearTimeoutFn(timeoutId: number) {\r\n * overrideCalled ++;\r\n * return clearTimeout( timeout);\r\n * }\r\n *\r\n * let theTimeout = scheduleTimeoutWith([newSetTimeoutFn, newClearTimeoutFn], () => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // Instead of calling clearTimeout() with the returned value from setTimeout() the returned\r\n * // handler instance can be used instead to cancel the timer, internally this will call the newClearTimeoutFn\r\n * theTimeout.cancel();\r\n * theTimeout.enabled; // false\r\n *\r\n * // You can start the timer via enabled\r\n * theTimeout.enabled = true;\r\n *\r\n * // You can also \"restart\" the timer, whether it has previously triggered not not via the `refresh()`\r\n * theTimeout.refresh();\r\n * ```\r\n */\r\nexport function scheduleTimeoutWith(overrideFn: TimeoutOverrideFn | TimeoutOverrideFuncs, callback: (...args: A) => void, timeout: number, ...args: A): ITimerHandler;\r\n\r\n/**\r\n * Creates and starts a timer which executes a function or specified piece of code once the timer expires. The overrideFn will be\r\n * used to create the timer, this is simular to using `setTimeout` but provides a return object for cancelling and restarting\r\n * (refresh) the timer.\r\n *\r\n * The timer may be cancelled (cleared) by calling the `cancel()` function on the returned {@link ITimerHandler}, or\r\n * you can \"reschedule\" and/or \"restart\" the timer by calling the `refresh()` function on the returned {@link ITimerHandler}\r\n * instance\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n *\r\n * @param overrideFn - setTimeout override function this will be called instead of the `setTimeout`, if the value\r\n * of `overrideFn` is null or undefined it will revert back to the native `setTimeout`. May also be an array with contains\r\n * both the setTimeout and clearTimeout override functions, if either is not provided the default native functions will be used\r\n * @param callback - The function to be executed after the timer expires.\r\n * @param timeout - The time, in milliseconds that the timer should wait before the specified\r\n * function or code is executed. If this parameter is omitted, a value of 0 is used, meaning\r\n * execute \"immediately\", or more accurately, the next event cycle.\r\n * @param args - Additional arguments which are passed through to the function specified by `callback`.\r\n * @returns A {@link ITimerHandler} instance which can be used to cancel the timeout.\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * // Your own \"setTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newSetTimeoutFn(callback: TimeoutOverrideFn) {\r\n * overrideCalled ++;\r\n * return setTimeout(callback, timeout);\r\n * }\r\n *\r\n * let theTimeout = scheduleTimeoutWith(newSetTimeoutFn, () => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // Instead of calling clearTimeout() with the returned value from setTimeout() the returned\r\n * // handler instance can be used instead to cancel the timer\r\n * theTimeout.cancel();\r\n * theTimeout.enabled; // false\r\n *\r\n * // You can start the timer via enabled\r\n * theTimeout.enabled = true;\r\n *\r\n * // You can also \"restart\" the timer, whether it has previously triggered not not via the `refresh()`\r\n * theTimeout.refresh();\r\n * ```\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * // Your own \"setTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newSetTimeoutFn(callback: TimeoutOverrideFn) {\r\n * overrideCalled ++;\r\n * return setTimeout(callback, timeout);\r\n * }\r\n *\r\n * // Your own \"clearTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newClearTimeoutFn(timeoutId: number) {\r\n * overrideCalled ++;\r\n * return clearTimeout( timeout);\r\n * }\r\n *\r\n * let theTimeout = scheduleTimeoutWith([newSetTimeoutFn, newClearTimeoutFn], () => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // Instead of calling clearTimeout() with the returned value from setTimeout() the returned\r\n * // handler instance can be used instead to cancel the timer, internally this will call the newClearTimeoutFn\r\n * theTimeout.cancel();\r\n * theTimeout.enabled; // false\r\n *\r\n * // You can start the timer via enabled\r\n * theTimeout.enabled = true;\r\n *\r\n * // You can also \"restart\" the timer, whether it has previously triggered not not via the `refresh()`\r\n * theTimeout.refresh();\r\n * ```\r\n */\r\nexport function scheduleTimeoutWith(overrideFn: TimeoutOverrideFn | TimeoutOverrideFuncs, callback: (...args: A) => void, timeout: number): ITimerHandler {\r\n return _createTimeoutWith(true, overrideFn, ArrSlice[CALL](arguments, 1));\r\n}\r\n\r\n/**\r\n * Creates a non-running (paused) timer which will execute a function or specified piece of code when enabled and the timer expires,\r\n * this is simular to using `scheduleTimeout` but the timer is not enabled (running) and you MUST call `refresh` to start the timer.\r\n *\r\n * The timer may be cancelled (cleared) by calling the `cancel()` function on the returned {@link ITimerHandler}, or\r\n * you can \"reschedule\" and/or \"restart\" the timer by calling the `refresh()` function on the returned {@link ITimerHandler}\r\n * instance\r\n *\r\n * @since 0.7.0\r\n * @group Timer\r\n *\r\n * @param callback - The function to be executed after the timer expires.\r\n * @param timeout - The time, in milliseconds that the timer should wait before the specified\r\n * function or code is executed. If this parameter is omitted, a value of 0 is used, meaning\r\n * execute \"immediately\", or more accurately, the next event cycle.\r\n * @param args - Additional arguments which are passed through to the function specified by `callback`.\r\n * @returns A {@link ITimerHandler} instance which can be used to cancel the timeout.\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * let theTimeout = createTimeout(() => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // As the timer is not started you will need to call \"refresh\" to start the timer\r\n * theTimeout.refresh();\r\n *\r\n * // or set enabled to true\r\n * theTimeout.enabled = true;\r\n * ```\r\n */\r\nexport function createTimeout(callback: (...args: A) => void, timeout: number, ...args: A): ITimerHandler;\r\n\r\n/**\r\n * Creates a non-running (paused) timer which will execute a function or specified piece of code when enabled and the timer expires,\r\n * this is simular to using `scheduleTimeout` but the timer is not enabled (running) and you MUST call `refresh` to start the timer.\r\n *\r\n * The timer may be cancelled (cleared) by calling the `cancel()` function on the returned {@link ITimerHandler}, or\r\n * you can \"reschedule\" and/or \"restart\" the timer by calling the `refresh()` function on the returned {@link ITimerHandler}\r\n * instance\r\n *\r\n * @since 0.7.0\r\n * @group Timer\r\n *\r\n * @param callback - The function to be executed after the timer expires.\r\n * @param timeout - The time, in milliseconds that the timer should wait before the specified\r\n * function or code is executed. If this parameter is omitted, a value of 0 is used, meaning\r\n * execute \"immediately\", or more accurately, the next event cycle.\r\n * @param args - Additional arguments which are passed through to the function specified by `callback`.\r\n * @returns A {@link ITimerHandler} instance which can be used to cancel the timeout.\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * let theTimeout = createTimeout(() => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // As the timer is not started you will need to call \"refresh\" to start the timer\r\n * theTimeout.refresh();\r\n *\r\n * // or set enabled to true\r\n * theTimeout.enabled = true;\r\n * ```\r\n */\r\nexport function createTimeout(callback: (...args: A) => void, timeout: number): ITimerHandler {\r\n return _createTimeoutWith(false, UNDEF_VALUE, ArrSlice[CALL](arguments));\r\n}\r\n\r\n/**\r\n * Creates a non-running (paused) timer which will execute a function or specified piece of code when enabled once the timer expires.\r\n * The overrideFn will be used to create the timer, this is simular to using `scheduleTimeoutWith` but the timer is not enabled (running)\r\n * and you MUST call `refresh` to start the timer.\r\n *\r\n * The timer may be cancelled (cleared) by calling the `cancel()` function on the returned {@link ITimerHandler}, or\r\n * you can \"reschedule\" and/or \"restart\" the timer by calling the `refresh()` function on the returned {@link ITimerHandler}\r\n * instance\r\n *\r\n * @since 0.7.0\r\n * @group Timer\r\n *\r\n * @param overrideFn - setTimeout override function this will be called instead of the `setTimeout`, if the value\r\n * of `overrideFn` is null or undefined it will revert back to the native `setTimeout`. May also be an array with contains\r\n * both the setTimeout and clearTimeout override functions, if either is not provided the default native functions will be used\r\n * @param callback - The function to be executed after the timer expires.\r\n * @param timeout - The time, in milliseconds that the timer should wait before the specified\r\n * function or code is executed. If this parameter is omitted, a value of 0 is used, meaning\r\n * execute \"immediately\", or more accurately, the next event cycle.\r\n * @param args - Additional arguments which are passed through to the function specified by `callback`.\r\n * @returns A {@link ITimerHandler} instance which can be used to cancel the timeout.\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * // Your own \"setTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newSetTimeoutFn(callback: TimeoutOverrideFn) {\r\n * overrideCalled ++;\r\n * return setTimeout(callback, timeout);\r\n * }\r\n *\r\n * let theTimeout = createTimeoutWith(newSetTimeoutFn, () => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // As the timer is not started you will need to call \"refresh\" to start the timer\r\n * theTimeout.refresh();\r\n *\r\n * // or set enabled to true\r\n * theTimeout.enabled = true;\r\n * ```\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * // Your own \"setTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newSetTimeoutFn(callback: TimeoutOverrideFn) {\r\n * overrideCalled ++;\r\n * return setTimeout(callback, timeout);\r\n * }\r\n *\r\n * // Your own \"clearTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newClearTimeoutFn(timeoutId: number) {\r\n * overrideCalled ++;\r\n * return clearTimeout( timeout);\r\n * }\r\n *\r\n * let theTimeout = createTimeoutWith([newSetTimeoutFn, newClearTimeoutFn], () => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // As the timer is not started you will need to call \"refresh\" to start the timer\r\n * theTimeout.refresh();\r\n *\r\n * // or set enabled to true\r\n * theTimeout.enabled = true;\r\n * ```\r\n */\r\nexport function createTimeoutWith(overrideFn: TimeoutOverrideFn | TimeoutOverrideFuncs, callback: (...args: A) => void, timeout: number, ...args: A): ITimerHandler;\r\n\r\n/**\r\n * Creates a non-running (paused) timer which will execute a function or specified piece of code when enabled once the timer expires.\r\n * The overrideFn will be used to create the timer, this is simular to using `scheduleTimeoutWith` but the timer is not enabled (running)\r\n * and you MUST call `refresh` to start the timer.\r\n *\r\n * The timer may be cancelled (cleared) by calling the `cancel()` function on the returned {@link ITimerHandler}, or\r\n * you can \"reschedule\" and/or \"restart\" the timer by calling the `refresh()` function on the returned {@link ITimerHandler}\r\n * instance\r\n *\r\n * @since 0.7.0\r\n * @group Timer\r\n *\r\n * @param overrideFn - setTimeout override function this will be called instead of the `setTimeout`, if the value\r\n * of `overrideFn` is null or undefined it will revert back to the native `setTimeout`. May also be an array with contains\r\n * both the setTimeout and clearTimeout override functions, if either is not provided the default native functions will be used\r\n * @param callback - The function to be executed after the timer expires.\r\n * @param timeout - The time, in milliseconds that the timer should wait before the specified\r\n * function or code is executed. If this parameter is omitted, a value of 0 is used, meaning\r\n * execute \"immediately\", or more accurately, the next event cycle.\r\n * @param args - Additional arguments which are passed through to the function specified by `callback`.\r\n * @returns A {@link ITimerHandler} instance which can be used to cancel the timeout.\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * // Your own \"setTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newSetTimeoutFn(callback: TimeoutOverrideFn) {\r\n * overrideCalled ++;\r\n * return setTimeout(callback, timeout);\r\n * }\r\n *\r\n * let theTimeout = createTimeoutWith(newSetTimeoutFn, () => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // As the timer is not started you will need to call \"refresh\" to start the timer\r\n * theTimeout.refresh();\r\n *\r\n * // or set enabled to true\r\n * theTimeout.enabled = true;\r\n * ```\r\n * @example\r\n * ```ts\r\n * let timeoutCalled = false;\r\n * // Your own \"setTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newSetTimeoutFn(callback: TimeoutOverrideFn) {\r\n * overrideCalled ++;\r\n * return setTimeout(callback, timeout);\r\n * }\r\n *\r\n * // Your own \"clearTimeout\" implementation to allow you to perform additional operations or possible wrap\r\n * // the callback to add timings.\r\n * function newClearTimeoutFn(timeoutId: number) {\r\n * overrideCalled ++;\r\n * return clearTimeout( timeout);\r\n * }\r\n *\r\n * let theTimeout = createTimeoutWith([newSetTimeoutFn, newClearTimeoutFn], () => {\r\n * // This callback will be called after 100ms as this uses setTimeout()\r\n * timeoutCalled = true;\r\n * }, 100);\r\n *\r\n * // As the timer is not started you will need to call \"refresh\" to start the timer\r\n * theTimeout.refresh();\r\n *\r\n * // or set enabled to true\r\n * theTimeout.enabled = true;\r\n * ```\r\n */\r\nexport function createTimeoutWith(overrideFn: TimeoutOverrideFn | TimeoutOverrideFuncs, callback: (...args: A) => void, timeout: number): ITimerHandler {\r\n return _createTimeoutWith(false, overrideFn, ArrSlice[CALL](arguments, 1));\r\n}\r\n","import { SafeURL } from '@ori/axios';\nimport Cookies from 'js-cookie';\n\nimport { LOGGED_IN_USER_COOKIE, UNKNOWN_USER } from './constants';\nimport { OidcTokenStorage } from './storage/OidcTokenStorage';\nimport { type AuthCodeTokenData } from './tokens/AuthCodeTokenData';\nimport { OidcIdToken } from './tokens/OidcIdToken';\nimport { OidcToken } from './tokens/OidcToken';\nimport { singleton } from './utils/singleton';\n\nexport type AuthorizationCodeTokenClientOptions = {\n clientId: string;\n identityUrl: string;\n requestOptions?: RequestInit;\n storage?: OidcTokenStorage;\n};\n\n@singleton\nexport class AuthorizationCodeTokenClient {\n static readonly REQUEST_OPTIONS: RequestInit = {\n credentials: 'same-origin',\n headers: {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- HTTP header name\n 'X-Fetch-Api': '1',\n // eslint-disable-next-line @typescript-eslint/naming-convention -- HTTP header name\n 'X-Requested-With': 'XMLHttpRequest',\n // eslint-disable-next-line @typescript-eslint/naming-convention -- HTTP header name\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n method: 'POST',\n };\n\n private readonly options: AuthorizationCodeTokenClientOptions;\n private readonly storage: OidcTokenStorage;\n\n constructor(options: AuthorizationCodeTokenClientOptions);\n constructor(options: AuthorizationCodeTokenClientOptions) {\n this.options = options;\n this.storage = this.options.storage ?? new OidcTokenStorage();\n }\n\n async initializeTokenFromAuthorizationCode(): Promise {\n const authCode = this.storage.authorizationCode.get();\n if (!authCode) {\n throw new Error(`Auth - missing authorization code`);\n }\n const authCodeTokenData = await this.requestToken(authCode);\n\n const accessToken = new OidcToken(authCodeTokenData.access_token);\n\n const user =\n accessToken.getClaim('consultant_number') ?? accessToken.getClaim('preferred_username') ?? UNKNOWN_USER;\n\n this.storage.setAccessToken({\n // Create expiration date manually,\n // because we wont get exact time that token expires,\n // but just only expires_in\n ExpirationDate: new Date(Date.now() + authCodeTokenData.expires_in * 1000).toString(),\n Token: authCodeTokenData.access_token,\n User: user,\n });\n\n // Simulate the same behavior as Online login.\n Cookies.set(LOGGED_IN_USER_COOKIE, user);\n\n const idToken = new OidcIdToken(authCodeTokenData.id_token);\n this.storage.setIdToken(idToken);\n\n this.storage.authorizationCode.remove();\n\n return true;\n }\n\n private async requestToken(authCode: string): Promise {\n try {\n const redirectUri = this.storage.redirectUri.get();\n\n if (!redirectUri) {\n throw new Error(`Redirect URI is missing`);\n }\n\n const codeVerifier = this.storage.codeVerifier.get();\n\n if (!codeVerifier) {\n throw new Error(`Code verifier is missing`);\n }\n\n const tokenRequest = fetch(new SafeURL('/connect/token', this.options.identityUrl || window.location.origin), {\n ...AuthorizationCodeTokenClient.REQUEST_OPTIONS,\n body: new URLSearchParams({\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Identity server contract\n client_id: this.options.clientId,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Identity server contract\n grant_type: 'authorization_code',\n code: authCode,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Identity server contract\n redirect_uri: redirectUri,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Identity server contract\n code_verifier: codeVerifier,\n }),\n });\n\n const response = await tokenRequest;\n\n if (!response.ok) {\n throw new Error(`${response.status} ${response.statusText}`);\n }\n\n const result = response.json() as unknown;\n\n return result as AuthCodeTokenData;\n } catch (error: unknown) {\n throw new Error(`Token request has failed: ${error}`);\n }\n }\n}\n","/* eslint-disable no-restricted-globals -- needed */\nimport { SafeURL } from '@ori/axios';\n\nimport { OidcTokenStorage } from './storage/OidcTokenStorage';\nimport { CryptoUtils } from './utils/CryptoUtils';\nimport { getRandomInt } from './utils/getRandomInt';\nimport { singleton } from './utils/singleton';\n\nconst RANDOM_NUMBER_LOWER_BOUND = 1;\nconst RANDOM_NUMBER_UPPER_BOUND = 2 ** 32;\n\nexport type OauthOptions = {\n clientId: string;\n acrValues: string;\n scope: string;\n identityUrl: string;\n};\n\nexport type OidcClientOptions = {\n callbackUrl: string;\n redirectUrl: string;\n};\n\n@singleton\nexport class OidcClient {\n private readonly options: OidcClientOptions;\n private readonly oauthOptions: OauthOptions;\n private readonly storage: OidcTokenStorage = new OidcTokenStorage();\n\n constructor(options: OidcClientOptions, oauthOptions: OauthOptions);\n constructor(options: OidcClientOptions, oauthOptions: OauthOptions) {\n this.options = options;\n this.oauthOptions = oauthOptions;\n }\n\n readonly doLogin = (): void => {\n const state = `S${getRandomInt(RANDOM_NUMBER_LOWER_BOUND, RANDOM_NUMBER_UPPER_BOUND)}${Date.now()}`;\n const nonce = `N${getRandomInt(RANDOM_NUMBER_LOWER_BOUND, RANDOM_NUMBER_UPPER_BOUND)}${Date.now()}`;\n const redirectUri = new URL(this.options.callbackUrl, location.origin).toString();\n const codeVerifier = CryptoUtils.generateCodeVerifier();\n const codeChallenge = CryptoUtils.generateCodeChallenge(codeVerifier);\n\n this.storage.state.set(state);\n this.storage.nonce.set(nonce);\n this.storage.redirectUri.set(redirectUri);\n this.storage.redirectUrl.set(this.options.redirectUrl);\n this.storage.codeVerifier.set(codeVerifier);\n\n const url = new SafeURL(`/identity/connect/authorize`, this.oauthOptions.identityUrl || location.origin);\n\n /* eslint-disable @typescript-eslint/naming-convention -- Query params have different style */\n url.search = new URLSearchParams({\n nonce,\n state,\n\n acr_values: this.oauthOptions.acrValues,\n client_id: this.oauthOptions.clientId,\n prompt: 'login',\n redirect_uri: redirectUri,\n response_type: 'code',\n scope: this.oauthOptions.scope,\n code_challenge_method: 'S256',\n code_challenge: codeChallenge,\n }).toString();\n /* eslint-enable @typescript-eslint/naming-convention */\n\n window.location.href = url.href;\n };\n}\n","import { OidcTokenStorage } from './storage/OidcTokenStorage';\n\nexport class OidcUrlHelper {\n static readonly AUTH_CODE: string = 'code';\n\n private readonly storage: OidcTokenStorage = new OidcTokenStorage();\n\n readonly storeAuthCodeFromParams = (params: URLSearchParams): void => {\n this.validateParams(params);\n\n const authCode = params.get(OidcUrlHelper.AUTH_CODE);\n if (authCode === null) {\n throw new Error(`Auth - missing authorization code`);\n }\n\n this.storage.authorizationCode.set(authCode);\n\n this.storage.state.remove();\n this.storage.nonce.remove();\n };\n\n readonly handleRedirectAfterLogin = (): void => {\n const redirectUrl = this.storage.redirectUrl.get();\n this.storage.redirectUrl.remove();\n\n if (typeof redirectUrl === 'string') {\n window.location.href = redirectUrl;\n }\n };\n\n private readonly validateParams = (params: URLSearchParams): void => {\n const errorParam = params.get('error');\n const stateParam = params.get('state');\n\n if (errorParam !== null) {\n throw new Error(`Auth - ${errorParam}`);\n }\n\n if (stateParam !== this.storage.state.get()) {\n throw new Error(`Auth - incorrect state`);\n }\n };\n}\n","import { TokenRoutes } from './TokenRoutes';\nimport { tokenConfigurationForTokenRoutes } from './constants';\nimport { AuthCookies } from './internals/AuthCookies';\nimport { TokenFetcher } from './internals/TokenFetcher';\nimport { mainLogger } from './logger';\nimport { SessionTokenStorage } from './storage/SessionTokenStorage';\nimport { type TokenData } from './tokens/TokenData';\n\nexport type TokenUpdatedEvent = CustomEvent<{ tokenData: TokenData }>;\nexport declare type TokenUpdateEventHandler = (event: TokenUpdatedEvent) => void;\n\nexport type TokenClientOptions = {\n // TODO: Use TokenRoutes type instead of this in the next release\n url: string;\n requestOptions?: RequestInit;\n /**\n * This is an override which is highly discouraged. Each token is fetched and stored in its respective storage\n */\n storage?: SessionTokenStorage;\n};\n\nconst logger = mainLogger.createChild('TokenClient');\n\nexport class TokenClient {\n private static readonly TOKEN_REQUEST_INTERVAL: number = 30000;\n\n private readonly options: TokenClientOptions & { url: TokenRoutes };\n private readonly storage: SessionTokenStorage;\n private readonly tokenConfiguration: (typeof tokenConfigurationForTokenRoutes)[TokenRoutes];\n private timeout: number | null = null;\n private isTimeoutSet = false;\n /**\n * Stored token in memory, access value from this.getTokenData()\n */\n private _tokenData: TokenData | null = null;\n\n constructor(options: TokenClientOptions) {\n // This is for backward compatibility\n // TODO: This is kind of sketchy - lets TokenClientOptions.url be a enum instead of plain string in next major release\n const providedUrlIsValid = (Object.values(TokenRoutes) as string[]).includes(options.url);\n\n if (!providedUrlIsValid) {\n logger.warn(\n `Provided options.url ${options.url} is not valid and will be deprecated in the next release of @ori/auth`,\n );\n // eslint-disable-next-line no-param-reassign -- okay for this case\n options.url = TokenRoutes.PUBLIC_ACCESS;\n }\n\n this.options = options as typeof this.options;\n this.tokenConfiguration = providedUrlIsValid\n ? tokenConfigurationForTokenRoutes[this.options.url as TokenRoutes]\n : tokenConfigurationForTokenRoutes[TokenRoutes.PUBLIC_ACCESS];\n\n // TODO: in the future we probably will not support adding custom storage\n this.storage = this.options.storage ?? new SessionTokenStorage(this.tokenConfiguration.sessionStorageKey);\n }\n\n bindTokenUpdated(handler: TokenUpdateEventHandler): this {\n document.addEventListener(this.tokenConfiguration.eventName, handler as EventListener);\n\n return this;\n }\n\n unbindTokenUpdated(handler: TokenUpdateEventHandler): this {\n document.removeEventListener(this.tokenConfiguration.eventName, handler as EventListener);\n\n return this;\n }\n\n async getToken(): Promise {\n const isTokenRefreshed = await this.refreshToken();\n\n return isTokenRefreshed ? this.getTokenData() : null;\n }\n\n async refreshToken(): Promise {\n // Get real stored token data, lifetime of token is managed there (it won't return token even if it's expired)\n const storageTokenData = this.storage.getToken();\n\n if (!storageTokenData) {\n // Clearing token data inside is necessary since storage returned empty and this instance should reflect that\n this.clearTokenData();\n let newTokenData = null;\n\n // If this token client is configured for user token and\n // user is not logged in then there is no need to fetch at all\n if (this.storage.isForUserToken() && !AuthCookies.hasAuthorizedUserValue()) {\n throw new Error('User is not logged so we cannot retrieve user token, skipping');\n }\n\n try {\n newTokenData = await this.requestToken();\n } catch (error) {\n throw new Error(`Refreshing token failed, requesting token was not successful: ${(error as Error).message}`);\n }\n\n if (newTokenData) {\n this.setTokenData(newTokenData);\n } else {\n throw new Error('Could not obtain user or public token at all');\n }\n }\n\n this.setRefreshTimeout(this.getTokenData());\n\n return true;\n }\n\n private async requestToken() {\n try {\n return await TokenFetcher.fetch({ ...this.options.requestOptions, url: this.options.url });\n } catch (error: unknown) {\n throw new Error(`Token request has failed: ${error}`);\n }\n }\n\n private setRefreshTimeout(tokenData: TokenData | null): void {\n if (this.isTimeoutSet || !tokenData) {\n return;\n }\n\n this.isTimeoutSet = true;\n\n if (this.timeout !== null) {\n window.clearTimeout(this.timeout);\n }\n\n this.timeout = window.setTimeout(() => {\n this.isTimeoutSet = false;\n\n void this.refreshToken();\n }, this.getTokenRefreshTime(tokenData));\n }\n\n /**\n * Dispatches custom event with current token data on this instance, if no token data are present then its skipped\n */\n private dispatchTokenUpdated() {\n const tokenData = this.getTokenData();\n if (!tokenData) {\n return;\n }\n\n const event: TokenUpdatedEvent = new CustomEvent(this.tokenConfiguration.eventName, {\n detail: {\n tokenData,\n },\n });\n\n document.dispatchEvent(event);\n }\n\n /**\n * Loads token onto instance\n */\n private getTokenData(): typeof this._tokenData {\n this._tokenData ??= this.storage.getToken();\n\n return this._tokenData;\n }\n\n /**\n * Clears token from instance and storage\n */\n private clearTokenData(): this {\n this._tokenData = null;\n this.storage.token.remove();\n\n return this;\n }\n\n /**\n * Sets new token data on instance and saves it to storage\n */\n private setTokenData(tokenData: TokenData): this {\n this._tokenData = tokenData;\n this.storage.token.set(tokenData);\n this.dispatchTokenUpdated();\n\n return this;\n }\n\n private getTokenRefreshTime(tokenData: TokenData): number {\n const expirationDate = Date.parse(tokenData.ExpirationDate);\n const currentDate = Date.now();\n let timeToRefresh = expirationDate - currentDate;\n\n if (timeToRefresh <= TokenClient.TOKEN_REQUEST_INTERVAL) {\n timeToRefresh = 0;\n }\n\n return timeToRefresh;\n }\n}\n","/**\n * Token events dictionary\n */\nexport enum TokenEventNames {\n /**\n * Event name for public token\n */\n PUBLIC_ACCESS = 'publicTokenUpdated',\n /**\n * Event name for user token\n */\n USER_ACCESS = 'tokenUpdated',\n}\n","/**\n * An Online token routes dictionary\n */\nexport enum TokenRoutes {\n /**\n * Online route that returns public token when user is not logged in\n */\n PUBLIC_ACCESS = '/system/ajax/ApiGateway/GetSpaTokenAsync',\n /**\n * Online route that returns user token when user is logged in, otherwise the request ends with http status code `403`\n */\n USER_ACCESS = '/system/ajax/ApiGateway/GetUserAccessTokenAsync',\n}\n","import { NOT_LOGGED_IN_USER_ID } from './constants';\nimport { PublicTokenClient, UserTokenClient } from './internals';\nimport { OidcTokenStorage } from './storage';\nimport { type TokenData, type Token } from './tokens';\n\ndeclare global {\n interface OriTokenService {\n /**\n * @deprecated Use TokenService instead from @ori/auth\n */\n getToken: () => Promise;\n /**\n * @deprecated Use TokenService instead from @ori/auth\n */\n getPublicToken: () => Promise;\n }\n\n interface Ori {\n tokenService?: OriTokenService;\n }\n\n interface Window {\n ori?: Ori;\n }\n}\n\nexport class TokenService {\n private static instance?: TokenService;\n private readonly oidcTokenStorage = new OidcTokenStorage();\n\n // Create token clients just once - no need to create them every time TokenService is created\n static userTokenClient = new UserTokenClient();\n static publicTokenClient = new PublicTokenClient();\n\n private constructor() {\n // TODO: remove when this is fixed: https://github.com/microsoft/TypeScript/issues/53305\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- false positive\n TokenService.instance ??= this;\n\n // eslint-disable-next-line no-constructor-return -- needed for the singleton pattern\n return TokenService.instance;\n }\n\n static getInstance() {\n return new this();\n }\n\n // TODO: This is kind of weird flow. customerId is not always known, but could be available inside cookies. Should we somehow provide a way to get userId from that?\n async getAuthorizationToken(customerId: number | string): Promise {\n let token: Token | null = null;\n const userId = typeof customerId === 'string' ? Number(customerId) : customerId;\n\n if (userId !== NOT_LOGGED_IN_USER_ID) {\n token = await this.getTokenServiceUserToken();\n\n if (!token) {\n token = this.getSessionStorageToken();\n }\n }\n\n if (!token) {\n token = await this.getTokenServicePublicToken();\n }\n\n if (!token) {\n throw new Error('Token is missing!');\n }\n\n return token;\n }\n\n private getSessionStorageToken(): Token | null {\n const token = this.oidcTokenStorage.getAccessToken();\n\n if (token) {\n return token.toString();\n }\n\n return null;\n }\n\n private async getTokenServiceUserToken() {\n const result = await TokenService.userTokenClient.getToken();\n\n return result?.Token ?? null;\n }\n\n private async getTokenServicePublicToken() {\n const result = await TokenService.publicTokenClient.getToken();\n\n return result?.Token ?? null;\n }\n}\n","/**\n * Token session storage dictionary\n */\nexport enum TokenSessionStorageKeys {\n /**\n * Public access session storage key\n */\n PUBLIC_ACCESS = 'PublicToken',\n /**\n * User access session storage key\n */\n USER_ACCESS = 'AuthToken',\n}\n","/* istanbul ignore file */\n//\n// DO NOT EDIT!\n// This file was autogenerated by Eddie.\n// Changes may cause incorrect behavior and will be lost when the file is regenerated.\n//\n// Run `npx eddie update workspace` to regenerate.\n//\n\nexport const LIBRARY_NAME = 'auth';\nexport const PACKAGE_NAME = '@ori/auth';\nexport const TEAM_NAME = 'Frontend Platform';\n\nexport const EMOTION_CACHE_KEY = `${LIBRARY_NAME}-emotion-cache-key`;\n","import { TokenEventNames } from './TokenEventNames';\nimport { TokenRoutes } from './TokenRoutes';\nimport { TokenSessionStorageKeys } from './TokenSessionStorageKeys';\n\nexport const AUTHORIZATION_CODE_STORAGE_KEY = 'AuthCode';\n// TODO: remove during refactor or major release\n/**\n * @deprecated use TokenSessionStorageKeys instead\n */\nexport const ANONYMOUS_TOKEN_STORAGE_KEY = 'PublicToken';\n// TODO: remove during refactor or major release\n/**\n * @deprecated use TokenSessionStorageKeys instead\n */\nexport const USER_TOKEN_STORAGE_KEY = 'AuthToken';\nexport const ID_TOKEN_STORAGE_KEY = 'AuthIdToken';\nexport const AUTH_REDIRECT_URL_STORAGE_KEY = 'AuthRedirectUrl';\nexport const AUTH_REDIRECT_URI_STORAGE_KEY = 'AuthRedirectUri';\nexport const CODE_VERIFIER_STORAGE_KEY = 'AuthCodeVerifier';\nexport const AUTH_STATE_STORAGE_KEY = 'AuthState';\nexport const NONCE_STORAGE_KEY = 'AuthNonce';\n\n/** User ID for user that is not logged in */\nexport const NOT_LOGGED_IN_USER_ID = -1;\n\n/** The name of the cookie that contains the logged in user. Coookie is used for the token validation. */\nexport const LOGGED_IN_USER_COOKIE = 'OriLoggedUser';\n\n/** The `User` key value for the public token. */\nexport const PUBLIC_TOKEN_USER = 'anonymous';\n\n/** The `User` key value if the user is unknown. */\nexport const UNKNOWN_USER = 'unknown';\n\n/**\n * Identity server client ID for authentication.\n */\nexport const IDENTITY_CLIENT_ID = 'SPADev';\n\n/**\n * Token configuration under token routes. This is mainly used in TokenClient to differentiate configuration between instances by route\n */\nexport const tokenConfigurationForTokenRoutes: {\n [key in TokenRoutes]: {\n eventName: TokenEventNames;\n sessionStorageKey: TokenSessionStorageKeys;\n };\n} = {\n [TokenRoutes.PUBLIC_ACCESS]: {\n eventName: TokenEventNames.PUBLIC_ACCESS,\n sessionStorageKey: TokenSessionStorageKeys.PUBLIC_ACCESS,\n },\n [TokenRoutes.USER_ACCESS]: {\n eventName: TokenEventNames.USER_ACCESS,\n sessionStorageKey: TokenSessionStorageKeys.USER_ACCESS,\n },\n};\n","export * from './AuthorizationCodeTokenClient';\nexport * from './OidcClient';\nexport * from './OidcUrlHelper';\nexport * from './TokenClient';\nexport * from './TokenEventNames';\nexport * from './TokenRoutes';\nexport * from './TokenService';\nexport * from './TokenSessionStorageKeys';\n\nexport * from './constants';\nexport * from './react-integration';\nexport * from './storage';\nexport * from './tokens';\n\nexport * from './utils/decodeToken';\nexport * from './utils/isTokenValid';\nexport * from './utils/doDevelopmentLogin';\nexport * from './utils/isAuthenticatedCustomer';\n","import Cookies from 'js-cookie';\n\nimport { LOGGED_IN_USER_COOKIE } from '../constants';\nimport { validateLoggedInUserCookie } from './validateLoggedInUserCookie';\n\nexport const AuthCookies = {\n /**\n * Gets authorized user cookie value. Usually they take this signature: \\\n */\n getAuthorizedUserValue() {\n const loggedInUserCookie = Cookies.get(LOGGED_IN_USER_COOKIE);\n\n return validateLoggedInUserCookie(loggedInUserCookie);\n },\n\n hasAuthorizedUserValue() {\n return !!this.getAuthorizedUserValue();\n },\n};\n","import { TokenClient } from '../TokenClient';\nimport { TokenRoutes } from '../TokenRoutes';\n\n/**\n * Shorthand to TokenClient({ url: TokenRoutes.PUBLIC_ACCESS })\n */\nexport class PublicTokenClient extends TokenClient {\n constructor() {\n super({\n url: TokenRoutes.PUBLIC_ACCESS,\n });\n }\n}\n","import type { TokenRoutes } from '../TokenRoutes';\nimport { mainLogger } from '../logger';\nimport type { TokenData } from '../tokens';\n\ntype FetchTokenOptions = RequestInit & {\n url: TokenRoutes;\n};\n\ntype RequestStorageKey = string;\ntype RequestStorageValue = Promise;\n\nconst hashFromKeys: Array = ['method', 'headers', 'url'];\n\ndeclare global {\n // eslint-disable-next-line vars-on-top, no-var -- just a declaration which must be done this way\n var ori: Ori | undefined;\n\n interface Ori {\n /**\n * Token requests created by \\@ori/auth. Key is hashed options\n */\n _tokenRequestsStorage?: Map | undefined;\n }\n}\n\nconst logger = mainLogger.createChild('TokenFetcher');\n\n/**\n * Token fetching implementation. Handles multiple active requests\n */\nexport class TokenFetcher {\n static readonly DEFAULT_REQUEST_OPTIONS: Partial = {\n credentials: 'same-origin',\n headers: {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- HTTP header name\n 'X-Fetch-Api': '1',\n // eslint-disable-next-line @typescript-eslint/naming-convention -- HTTP header name\n 'X-Requested-With': 'XMLHttpRequest',\n },\n method: 'GET',\n };\n\n /**\n * Gets current request storage\n */\n private static getStorage() {\n // Check build out\n const storageSpace = globalThis;\n\n if (!storageSpace.ori?._tokenRequestsStorage) {\n if (!storageSpace.ori) {\n storageSpace.ori = {};\n }\n\n storageSpace.ori._tokenRequestsStorage = new Map();\n }\n\n return storageSpace.ori._tokenRequestsStorage;\n }\n\n // NOTICE - making changes to output of this function may result in breaking change!\n /**\n * Hashes request options into storage key\n */\n private static createStorageKey(options: FetchTokenOptions): RequestStorageKey {\n const objectToHash: Record = {};\n\n for (const key of hashFromKeys) {\n if (key in options) {\n objectToHash[key] = options[key];\n }\n }\n\n return JSON.stringify(objectToHash).toLowerCase();\n }\n\n private static isStorageItemMissing(key: RequestStorageKey) {\n const storage = this.getStorage();\n const itemResolved = storage.get(key);\n\n return itemResolved === undefined;\n }\n\n /**\n * Checks if existing is valid, if not found then returns true\n */\n private static async isStorageItemExpired(key: RequestStorageKey) {\n const storage = this.getStorage();\n const itemResolved = await storage.get(key);\n\n // This could happen if request is not successful\n if (itemResolved === null) {\n return false;\n }\n\n // item is missing in storage\n if (!itemResolved) {\n return true;\n }\n\n return Date.parse(itemResolved.ExpirationDate) <= Date.now();\n }\n\n /**\n * Gets existing item or creates a new from factory\n */\n private static async upsertStorageItem RequestStorageValue>(\n key: RequestStorageKey,\n factory: T,\n ): RequestStorageValue {\n const storage = this.getStorage();\n\n // We have to check for missing as fast possible(not async),\n // Having await before initial set to storage will result in multiple promises created\n if (this.isStorageItemMissing(key) || (await this.isStorageItemExpired(key))) {\n storage.set(key, factory());\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- it's definitelly there since we checked :)\n return storage.get(key)!;\n }\n\n /**\n * Deletes item from storage by key. Returns true if it was found and deleted, false othervise\n */\n private static removeStorageItem(key: RequestStorageKey) {\n const storage = this.getStorage();\n\n return storage.delete(key);\n }\n\n /**\n * clears storage from all promises\n */\n static clearStorage() {\n if (globalThis.ori?._tokenRequestsStorage) {\n globalThis.ori._tokenRequestsStorage = undefined;\n }\n }\n\n /**\n * Fetches token with provided options. It keeps track of already made requests and does not try to fetch again\n */\n static readonly fetch = async (options: FetchTokenOptions): RequestStorageValue => {\n const { url, ...requestOptions } = options;\n const key = this.createStorageKey(options);\n\n return this.upsertStorageItem(key, async () => {\n // TODO - what about retries in case of network errors?\n const response = await fetch(url, requestOptions);\n\n if (response.status >= 500) {\n this.removeStorageItem(key);\n\n throw new Error(\n `Token request ${url} failed on server or network error with status ${response.statusText}(${response.status})`,\n );\n }\n\n if (!response.ok) {\n logger.warn(`Token request ${url} failed with status ${response.statusText}(${response.status})`);\n\n return null;\n }\n\n type TokenResponse = TokenData & { ExpirationSeconds?: number };\n const result = (await response.json()) as TokenResponse;\n\n if (result.ExpirationSeconds !== undefined) {\n const expirationDate = new Date();\n expirationDate.setSeconds(expirationDate.getSeconds() + result.ExpirationSeconds);\n\n return {\n ...result,\n ExpirationDate: expirationDate.toISOString(),\n };\n }\n return result;\n });\n };\n}\n","import { TokenClient } from '../TokenClient';\nimport { TokenRoutes } from '../TokenRoutes';\n\n/**\n * Shorthand to TokenClient({ url: TokenRoutes.USER_ACCESS })\n */\nexport class UserTokenClient extends TokenClient {\n constructor() {\n super({\n url: TokenRoutes.USER_ACCESS,\n });\n }\n}\n","export function cleanToken(token: string) {\n return token.replaceAll(/bearer /gi, '');\n}\n","import { type Token } from '../tokens';\nimport { decodeToken } from '../utils/decodeToken';\n\nexport function getRemainingSeconds(token: Token): number {\n if (!token) {\n return 0;\n }\n\n const decoded = decodeToken(token);\n\n if (!decoded) {\n return 0;\n }\n\n const { exp } = decoded;\n\n const remaining = Math.floor(exp - Date.now() / 1000);\n\n return remaining < 0 ? 0 : remaining;\n}\n","import { PublicTokenClient } from './PublicTokenClient';\nimport { UserTokenClient } from './UserTokenClient';\n\nlet userTokenClient: UserTokenClient | undefined;\nlet publicTokenClient: PublicTokenClient | undefined;\n\n/**\n * Gets token clients for this package, this keeps client instances to minimal\n */\nexport const getTokenClients = () => {\n userTokenClient ??= new UserTokenClient();\n publicTokenClient ??= new PublicTokenClient();\n\n return {\n userTokenClient,\n publicTokenClient,\n };\n};\n","export * from './cleanToken';\nexport * from './getRemainingSeconds';\nexport * from './getTokenClients';\nexport * from './PublicTokenClient';\nexport * from './TokenFetcher';\nexport * from './UserTokenClient';\nexport * from './validateLoggedInUserCookie';\n","import * as zod from 'zod';\n\n// This schema validates a string that fullfills this format: \\\nconst loggedInUserCookieSchema = zod.string().regex(/^[A-Za-z]{2}\\\\\\d+$/);\n\n/**\n * Validates the provided string against the loggedInUserCookie schema.\n *\n * @param cookieContent - The content of the logged-in user cookie to validate. It can be undefined.\n * @returns The validated logged-in user data if the validation is successful, otherwise `undefined`.\n */\nexport const validateLoggedInUserCookie = (cookieContent: string | undefined) => {\n const result = loggedInUserCookieSchema.safeParse(cookieContent);\n if (result.success) {\n return result.data;\n }\n\n return undefined;\n};\n","import { Logger } from '@ori/logger';\n\nimport { PACKAGE_NAME, TEAM_NAME } from './constants-generated';\n\nexport const mainLogger = new Logger(PACKAGE_NAME, { teamName: TEAM_NAME });\n","import { type FC, type ReactElement } from 'react';\n\nimport { useToken } from './useToken';\n\nexport type IfAnonymousUserProps = {\n children: ReactElement;\n};\n\nexport const IfAnonymousUser: FC = ({ children }) => {\n const { isAnonymousUser } = useToken();\n\n if (isAnonymousUser) {\n return children;\n }\n\n return null;\n};\n","import { type FC, type ReactElement } from 'react';\n\nimport { useToken } from './useToken';\n\nexport type IfLoggedInUserProps = {\n children: ReactElement;\n};\n\nexport const IfLoggedInUser: FC = ({ children }) => {\n const { isAnonymousUser } = useToken();\n\n if (isAnonymousUser) {\n return null;\n }\n\n return children;\n};\n","import { getTokenClients } from '../internals/getTokenClients';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- this is for TSDoc\nimport type { UniversalTokenProvider } from './UniversalTokenProvider';\n\nconst getUserAccessToken = async () => getTokenClients().userTokenClient.getToken();\nconst getPublicAccessToken = async () => getTokenClients().publicTokenClient.getToken();\n\n/**\n * This component adds compatibility layer to old SPAs taking token from object on window provided by Online layout.\n * We shouldn't need this in the future, SPAs should use dedicated react token providers.\n *\n * @deprecated Use {@link UniversalTokenProvider | `UniversalTokenProvider`}/`PrefetchedTokenProvider`/`StandaloneTokenProvider` with `useToken` hook\n */\nexport const LegacyTokenService = () => {\n if (typeof window !== 'undefined' && !window.ori?.tokenService) {\n window.ori = {\n ...window.ori,\n tokenService: {\n getToken: getUserAccessToken,\n getPublicToken: getPublicAccessToken,\n },\n };\n }\n\n return null;\n};\n","import type { FC, PropsWithChildren } from 'react';\n\nimport type { MockedTokenProviderProps } from '../mocked';\n\n/** @deprecated Please import from @ori/auth/mocked */\nexport const MockedTokenProvider: FC> = ({ children }) => children;\n","import { useMemo, type FC, type PropsWithChildren } from 'react';\n\nimport { NOT_LOGGED_IN_USER_ID } from '../constants';\nimport { cleanToken } from '../internals';\nimport { isTokenValid } from '../utils/isTokenValid';\nimport { tokenContext } from './tokenContext';\n\n/** @deprecated Use `UniversalTokenProvider` instead */\nexport type PrefetchedTokenProviderProps = {\n token: string;\n customerId: number;\n};\n\nexport const PrefetchedTokenProvider: FC> = ({\n token: initialToken,\n customerId,\n children,\n}) => {\n const token = initialToken ? cleanToken(initialToken) : undefined;\n\n if (!token || !isTokenValid(token)) {\n throw new Error('Received an invalid token. It is either malformed or expired');\n }\n\n const contextValue = useMemo(\n () => ({\n token,\n formattedToken: `Bearer ${token}`,\n customerId,\n isAnonymousUser: customerId === NOT_LOGGED_IN_USER_ID,\n isUserVerified: false,\n }),\n [customerId, token],\n );\n\n return {children};\n};\n","import { useEffect, useMemo, useState, type FC, type PropsWithChildren } from 'react';\n\nimport { TokenService } from '../TokenService';\nimport { NOT_LOGGED_IN_USER_ID } from '../constants';\nimport { cleanToken, getRemainingSeconds } from '../internals';\nimport { mainLogger } from '../logger';\nimport { type Token } from '../tokens';\nimport { tokenContext } from './tokenContext';\n\nexport type StandaloneTokenProviderProps = {\n token?: Token;\n customerId: number;\n};\n\nconst logger = mainLogger.createChild('StandaloneTokenProvider');\n\n// TODO: true customerId, when logged in, is not always known at the start of application that uses this provider (case of SSG)\n// This opts user out of their true user token since this provider does not try to fetch it and just fetches/returns public token when unathorized customerId is provided\n/** @deprecated Use `UniversalTokenProvider` instead */\nexport const StandaloneTokenProvider: FC> = ({\n children,\n token,\n customerId,\n}) => {\n const [clientToken, setClientToken] = useState(token ? cleanToken(token) : undefined);\n const [isAnonymous, setIsAnonymous] = useState(true);\n const [isUserVerified, setIsUserVerified] = useState(false);\n\n useEffect(() => {\n if (token) {\n setClientToken(token);\n } else {\n const fetchToken = async () => {\n const fetchedToken = await TokenService.getInstance().getAuthorizationToken(customerId);\n\n setClientToken(fetchedToken);\n };\n\n fetchToken()\n .catch((error: unknown) => {\n logger.error(new Error('Fetching token failed', { cause: error }));\n setClientToken('');\n })\n .finally(() => setIsUserVerified(true));\n }\n }, [customerId, token]);\n\n useEffect(() => {\n if (customerId === NOT_LOGGED_IN_USER_ID) {\n setIsAnonymous(true);\n } else {\n setIsAnonymous(false);\n }\n }, [customerId]);\n\n useEffect(() => {\n const remainder = getRemainingSeconds(clientToken ?? '');\n\n // in the future, we will want to refresh the token here when the token is about to expire; for now, we are just writing a warning to the console.\n const timer = setTimeout(() => {\n logger.info('Your access token has expired. Please reload the page to acquire a new one.');\n }, remainder * 1000);\n\n return () => clearTimeout(timer);\n }, [clientToken]);\n\n const tokenValue = cleanToken(clientToken ?? '');\n const contextValue = useMemo(\n () => ({\n token: tokenValue,\n customerId,\n formattedToken: tokenValue ? `Bearer ${tokenValue}` : '',\n isAnonymousUser: isAnonymous,\n isUserVerified,\n }),\n [customerId, isAnonymous, isUserVerified, tokenValue],\n );\n\n return {children};\n};\n","import { type FC, type PropsWithChildren } from 'react';\n\nimport { tokenContext } from './tokenContext';\nimport { useUniversalToken } from './useUniversalToken';\n\nexport type UniversalTokenProviderProps = {\n initialToken: string;\n customerId: number;\n};\n\nexport const UniversalTokenProvider: FC> = ({\n children,\n customerId,\n initialToken,\n}) => {\n const contextValue = useUniversalToken({\n customerId,\n initialToken,\n });\n\n return {children};\n};\n","export * from './IfAnonymousUser';\nexport * from './IfLoggedInUser';\nexport * from './LegacyTokenService';\nexport * from './MockedTokenProvider';\nexport * from './PrefetchedTokenProvider';\nexport * from './StandaloneTokenProvider';\nexport * from './tokenContext';\nexport * from './UniversalTokenProvider';\nexport * from './useToken';\nexport * from './useUniversalToken';\n","import React from 'react';\n\nimport { NOT_LOGGED_IN_USER_ID } from '../constants';\n\nexport type TokenContext = {\n token: string;\n customerId: number;\n formattedToken: string;\n isAnonymousUser: boolean;\n /** Indicates that user verification with a token has been completed.*/\n isUserVerified: boolean;\n};\n\nexport const tokenContext = React.createContext({\n token: '',\n customerId: NOT_LOGGED_IN_USER_ID,\n formattedToken: '',\n isAnonymousUser: true,\n isUserVerified: false,\n});\n","import { useContext } from 'react';\n\nimport { tokenContext } from './tokenContext';\n\nexport function useToken() {\n return useContext(tokenContext);\n}\n","import { useEffect, useState, useMemo } from 'react';\n\nimport { NOT_LOGGED_IN_USER_ID } from '../constants';\nimport { cleanToken } from '../internals';\nimport { getTokenClients } from '../internals/getTokenClients';\nimport { mainLogger } from '../logger';\nimport { type TokenData } from '../tokens';\nimport { decodeToken } from '../utils/decodeToken';\nimport { isTokenValid } from '../utils/isTokenValid';\n\nexport type UseUniversalTokenOptions = {\n initialToken: string;\n customerId: number;\n};\n\nexport type TokenState = {\n // TODO: deprecate this and use customerId from token instead\n customerId: number;\n cleanToken: string | undefined;\n};\n\nconst logger = mainLogger.createChild('useUniversalToken');\n\nexport function useUniversalToken({ customerId, initialToken }: UseUniversalTokenOptions) {\n const cleanInitialToken = initialToken ? cleanToken(initialToken) : undefined;\n const validInitialToken = cleanInitialToken && isTokenValid(cleanInitialToken) ? cleanInitialToken : undefined;\n const [tokenData, setTokenData] = useState(\n // Take customerId from props only when initial token is valid, otherwise just set the default (not logged in)\n validInitialToken\n ? { customerId, cleanToken: validInitialToken }\n : { customerId: NOT_LOGGED_IN_USER_ID, cleanToken: undefined },\n );\n const [isUserVerified, setIsUserVerified] = useState(false);\n\n const updateTokenData = (newTokenData: TokenData | null) => {\n const newToken = newTokenData?.Token ? cleanToken(newTokenData.Token) : undefined;\n const decodedToken = newToken ? decodeToken(newToken) : null;\n\n setTokenData({\n customerId: decodedToken?.customer_id ? decodedToken.customer_id : NOT_LOGGED_IN_USER_ID,\n cleanToken: newToken,\n });\n };\n\n // try to fetch new token if available on the first render (this will result in loading of the token and customerId of signed-in user)\n useEffect(() => {\n const { publicTokenClient, userTokenClient } = getTokenClients();\n const tokenChangedListener = (event: CustomEvent<{ tokenData: TokenData }>) =>\n updateTokenData(event.detail.tokenData);\n\n const fetchToken = async () => {\n try {\n updateTokenData(await userTokenClient.getToken());\n userTokenClient.bindTokenUpdated(tokenChangedListener);\n } catch (error) {\n updateTokenData(await publicTokenClient.getToken());\n publicTokenClient.bindTokenUpdated(tokenChangedListener);\n }\n };\n\n // TODO(OL): There should be an abort controller\n fetchToken()\n .catch((error: unknown) => {\n logger.error(new Error(`Some error occurred while getting token`, { cause: error }));\n setTokenData(null);\n })\n .finally(() => setIsUserVerified(true));\n\n return () => {\n publicTokenClient.unbindTokenUpdated(tokenChangedListener);\n userTokenClient.unbindTokenUpdated(tokenChangedListener);\n };\n }, []);\n\n return useMemo(\n () => ({\n token: tokenData?.cleanToken ?? '', // TODO (JN): This should be nullable to reflect the real state of the app. Consumers then may decide what to do when token is not available. But it is going to be a breaking change.\n customerId: tokenData?.customerId ?? NOT_LOGGED_IN_USER_ID,\n formattedToken: tokenData?.cleanToken ? `Bearer ${tokenData.cleanToken}` : '',\n isAnonymousUser: tokenData?.customerId === NOT_LOGGED_IN_USER_ID,\n isUserVerified,\n }),\n [tokenData?.customerId, tokenData?.cleanToken, isUserVerified],\n );\n}\n","import { USER_TOKEN_STORAGE_KEY, ANONYMOUS_TOKEN_STORAGE_KEY } from '../constants';\nimport { OidcToken, type TokenData } from '../tokens';\nimport { SessionStorage } from './SessionStorage';\nimport { type StorageItem } from './StorageItem';\n\nexport class CombinedSessionItem implements StorageItem {\n private readonly storage: SessionStorage = new SessionStorage();\n\n remove(): this {\n this.storage.removeItem(USER_TOKEN_STORAGE_KEY);\n this.storage.removeItem(ANONYMOUS_TOKEN_STORAGE_KEY);\n\n return this;\n }\n\n get(): TokenData | null {\n const userToken = this.storage.getItem(USER_TOKEN_STORAGE_KEY) as TokenData | null;\n const anonymousToken = this.storage.getItem(ANONYMOUS_TOKEN_STORAGE_KEY) as TokenData | null;\n\n // If user token is present then user was probably logged in already\n if (userToken) {\n return userToken;\n }\n\n if (anonymousToken) {\n return anonymousToken;\n }\n\n return null;\n }\n\n set(value: TokenData): this {\n this.remove();\n\n const parsedToken = new OidcToken(value.Token);\n const customerId = parsedToken.getClaim('customer_id');\n const isUserSignedIn = typeof customerId === 'number' && customerId > 0;\n const key = isUserSignedIn ? USER_TOKEN_STORAGE_KEY : ANONYMOUS_TOKEN_STORAGE_KEY;\n\n this.storage.setItem(key, value);\n\n return this;\n }\n}\n","import { type TokenData } from '../tokens';\nimport { CombinedSessionItem } from './CombinedSessionItem';\nimport { SessionTokenStorage } from './SessionTokenStorage';\nimport { type StorageItem } from './StorageItem';\n\n/**\n * TODO: Deprecate or think of a way to differentiate between requested tokens - application may want to get user token,\n * but upon returning null it should try to get a new token instead of returning user token right away\n */\nexport class CombinedTokenStorage extends SessionTokenStorage {\n protected override createStorageItem(): StorageItem {\n return new CombinedSessionItem();\n }\n}\n","import {\n AUTHORIZATION_CODE_STORAGE_KEY,\n AUTH_REDIRECT_URL_STORAGE_KEY,\n AUTH_REDIRECT_URI_STORAGE_KEY,\n CODE_VERIFIER_STORAGE_KEY,\n AUTH_STATE_STORAGE_KEY,\n ID_TOKEN_STORAGE_KEY,\n NONCE_STORAGE_KEY,\n USER_TOKEN_STORAGE_KEY,\n} from '../constants';\nimport type { TokenData } from '../tokens';\nimport { OidcAccessToken } from '../tokens/OidcAccessToken';\nimport { OidcIdToken } from '../tokens/OidcIdToken';\nimport { type Token } from '../tokens/Token';\nimport { singleton } from '../utils/singleton';\nimport { SessionValue } from './SessionValue';\n\n@singleton\nexport class OidcTokenStorage {\n authorizationCode: SessionValue = new SessionValue(AUTHORIZATION_CODE_STORAGE_KEY);\n\n accessToken: SessionValue = new SessionValue(USER_TOKEN_STORAGE_KEY);\n\n idToken: SessionValue = new SessionValue(ID_TOKEN_STORAGE_KEY);\n\n redirectUrl: SessionValue = new SessionValue(AUTH_REDIRECT_URL_STORAGE_KEY);\n\n redirectUri: SessionValue = new SessionValue(AUTH_REDIRECT_URI_STORAGE_KEY);\n\n codeVerifier: SessionValue = new SessionValue(CODE_VERIFIER_STORAGE_KEY);\n\n state: SessionValue = new SessionValue(AUTH_STATE_STORAGE_KEY);\n\n nonce: SessionValue = new SessionValue(NONCE_STORAGE_KEY);\n\n readonly getAccessToken = (): OidcAccessToken | null => {\n const token = this.accessToken.get();\n\n if (token !== null) {\n return new OidcAccessToken(token.Token);\n }\n\n return null;\n };\n\n readonly setAccessToken = (tokenData: TokenData): this => {\n this.accessToken.set(tokenData);\n\n return this;\n };\n\n readonly getIdToken = (): OidcIdToken | null => {\n const token = this.idToken.get();\n\n if (token !== null) {\n return new OidcIdToken(token);\n }\n\n return null;\n };\n\n readonly setIdToken = (oidcIdToken: OidcIdToken): this => {\n this.idToken.set(oidcIdToken.toString());\n\n return this;\n };\n}\n","import { isSessionStorageSupported } from '../utils/isSessionStorageSupported';\nimport { singleton } from '../utils/singleton';\n\nconst isSessionStorageAvailable = isSessionStorageSupported();\n\n@singleton\nexport class SessionStorage {\n getItem(key: string): unknown {\n if (!(key !== '' && isSessionStorageAvailable)) {\n return null;\n }\n\n const value = sessionStorage.getItem(key);\n\n if (value === null) {\n return null;\n }\n\n try {\n return JSON.parse(value) as object;\n } catch (error: unknown) {\n // NOOP\n }\n\n return value;\n }\n\n setItem(key: string, value: unknown): this {\n if (key !== '' && isSessionStorageAvailable) {\n sessionStorage.setItem(key, JSON.stringify(value));\n }\n\n return this;\n }\n\n removeItem(key: string): this {\n if (key !== '' && isSessionStorageAvailable) {\n sessionStorage.removeItem(key);\n }\n\n return this;\n }\n\n clearItems(prefix: string): void {\n if (prefix !== '' && isSessionStorageAvailable) {\n Object.keys(sessionStorage)\n .filter((keyName) => keyName.indexOf(prefix, 0) === 0)\n .forEach((key) => sessionStorage.removeItem(key));\n }\n }\n}\n","import { TokenSessionStorageKeys } from '../TokenSessionStorageKeys';\nimport { PUBLIC_TOKEN_USER } from '../constants';\nimport { AuthCookies } from '../internals/AuthCookies';\nimport { type TokenData } from '../tokens/TokenData';\nimport { SessionValue } from './SessionValue';\nimport { type StorageItem } from './StorageItem';\nimport { type TokenStorage } from './TokenStorage';\n\n// Checks if auth cookie value satisfies new cookie value format as previously auth cookie included only date of expiration instead of new tenant\\consultant-number format\nconst isNewAuthCookie = (cookieValue: string) => /[a-z]{2,}\\\\\\d+/i.test(cookieValue);\n\nexport class SessionTokenStorage implements TokenStorage {\n // FIXME: Mark as private!\n readonly token: StorageItem;\n protected readonly tokenStorageKey: string;\n\n constructor(tokenStorageKey = TokenSessionStorageKeys.USER_ACCESS) {\n this.tokenStorageKey = tokenStorageKey;\n this.token = this.createStorageItem();\n }\n\n /**\n * Returns true is token storage is for user token\n */\n isForUserToken() {\n return this.tokenStorageKey === TokenSessionStorageKeys.USER_ACCESS;\n }\n\n /**\n * Gets token user which is stored alongside token in storage.\n * If current instance of storage handles user token then this falls back to value inside cookie.\n * Othervise it falls back to default anonymous value\n */\n private getTokenUser() {\n const existingUserInsideToken = this.token.get()?.User;\n\n if (this.isForUserToken()) {\n return AuthCookies.getAuthorizedUserValue() ?? existingUserInsideToken;\n }\n\n return existingUserInsideToken ?? PUBLIC_TOKEN_USER;\n }\n\n /**\n * Check for compatibility between whats stored in cookies and whats stored in token\n * These two should be the same\n * This check should also happen when both properties are set (Cookie and .User)\n */\n private validateStored(): void {\n const storedData = this.token.get();\n if (!storedData) {\n return;\n }\n\n let cleanStored = false;\n const cookieValue = AuthCookies.getAuthorizedUserValue();\n\n // Checking for presence both cookie and storedData.User is for backward compatibility with older versions of the @ori/auth package that does not set key User into token storage.\n // Or the user is not logged in or cookies are not supported, e.g. in appshell.\n const isCookieAndStoredUserInTokenPresent = !!cookieValue && !!storedData.User;\n if (\n isCookieAndStoredUserInTokenPresent &&\n // Backward compatibility of old cookie value, in which case we wont check for validity between cookie value and storedData.User\n isNewAuthCookie(cookieValue) &&\n this.isForUserToken() &&\n cookieValue !== storedData.User\n ) {\n cleanStored = true;\n }\n // Token has expired then remove it nontheless of key\n else if (Date.parse(storedData.ExpirationDate) <= Date.now()) {\n cleanStored = true;\n }\n // Logged out user should not have user token stored\n else if (this.isForUserToken() && !cookieValue) {\n cleanStored = true;\n }\n\n if (cleanStored) {\n this.token.remove();\n }\n }\n\n protected createStorageItem(): StorageItem {\n return new SessionValue(this.tokenStorageKey);\n }\n\n /**\n * Returns valid token. If token in session storage is not valid then it is removed and function returns null\n */\n readonly getToken = (): TokenData | null => {\n this.validateStored();\n\n return this.token.get();\n };\n\n readonly setToken = (tokenData: TokenData): this => {\n const newStorageValue = { ...tokenData };\n\n // Make sure that inserted items have user value present\n if (!newStorageValue.User) {\n newStorageValue.User = this.getTokenUser();\n }\n\n this.token.set(newStorageValue);\n\n return this;\n };\n}\n","import { SessionStorage } from './SessionStorage';\nimport { type StorageItem } from './StorageItem';\n\nexport class SessionValue implements StorageItem {\n private readonly key: string;\n\n private readonly storage: SessionStorage = new SessionStorage();\n\n constructor(key: string) {\n this.key = key;\n }\n\n readonly remove = (): this => {\n this.storage.removeItem(this.key);\n\n return this;\n };\n\n readonly get = (): T | null => this.storage.getItem(this.key) as T | null;\n\n readonly set = (value: T): this => {\n this.storage.setItem(this.key, value);\n\n return this;\n };\n}\n","export * from './CombinedSessionItem';\nexport * from './CombinedTokenStorage';\nexport * from './OidcTokenStorage';\nexport * from './SessionStorage';\nexport * from './SessionTokenStorage';\nexport * from './SessionValue';\nexport * from './StorageItem';\nexport * from './TokenStorage';\n","import { OidcToken } from './OidcToken';\nimport { type Token } from './Token';\n\nexport class OidcAccessToken extends OidcToken {\n constructor(token: Token) {\n super(typeof token === 'string' ? token.replace(/^Bearer /, '') : token);\n }\n\n override readonly toString = (): string => `Bearer ${this.token}`;\n}\n","import { OidcToken } from './OidcToken';\n\nexport class OidcIdToken extends OidcToken {\n readonly preferredUsername: string = this.getClaim('urn:oriflame:activeDirectory:preferred_username') as string;\n\n readonly name: string = this.getClaim('name') as string;\n}\n","/* eslint-disable @typescript-eslint/naming-convention -- Token properties don't follow our rules */\nimport { type LiteralUnion } from '@ori/ts-utils';\nimport { jwtDecode } from 'jwt-decode';\n\nimport { type Token } from './Token';\nimport { type TokenData } from './TokenData';\n\ntype TokenClaims = {\n iat: number;\n nbf: number;\n exp: number;\n jti: string;\n iss: string;\n aud?: string;\n client_id?: string;\n sub?: string;\n auth_time?: number;\n idp?: string;\n preferred_username?: string;\n tenant?: string;\n customer_id?: number;\n consultant_number?: string;\n scope?: string[] | string;\n amr?: string[];\n act?: {\n sub?: string;\n preferred_username?: string;\n customer_id?: number;\n client_id?: string;\n };\n};\n\nexport type TokenPayload = Record & TokenClaims;\n\nexport class OidcToken {\n protected readonly token: Token;\n protected readonly payload: Readonly;\n\n constructor(token: Token | TokenData) {\n if (typeof token === 'string') {\n this.token = token;\n } else {\n this.token = token.Token;\n }\n this.payload = jwtDecode(this.token);\n }\n\n readonly toString = (): string => this.token;\n\n readonly getClaim = >(claim: T) => this.payload[claim];\n}\n","export * from './OidcAccessToken';\nexport * from './OidcIdToken';\nexport * from './OidcToken';\nexport * from './Token';\nexport * from './TokenData';\n","import CryptoJS from 'crypto-js/core';\nimport Base64 from 'crypto-js/enc-base64';\nimport sha256 from 'crypto-js/sha256';\n\nconst UUID_V4_TEMPLATE = '10000000-1000-4000-8000-100000000000';\n\nexport class CryptoUtils {\n private static _randomWord(): number {\n return CryptoJS.lib.WordArray.random(1).words[0] ?? 0;\n }\n\n private static generateUUIDv4(): string {\n const uuid = UUID_V4_TEMPLATE.replace(/[018]/g, (c) =>\n // eslint-disable-next-line no-bitwise -- Crypto utility\n (+c ^ (CryptoUtils._randomWord() & (15 >> (+c / 4)))).toString(16),\n );\n\n return uuid.replaceAll(/-/g, '');\n }\n\n static generateCodeVerifier(): string {\n return CryptoUtils.generateUUIDv4() + CryptoUtils.generateUUIDv4() + CryptoUtils.generateUUIDv4();\n }\n\n static generateCodeChallenge(codeVerifier: string): string {\n const hashed = sha256(codeVerifier);\n\n return (\n Base64.stringify(hashed)\n .replaceAll(/\\+/g, '-')\n .replaceAll(/\\//g, '_')\n // eslint-disable-next-line no-div-regex -- Crypto utility\n .replaceAll(/=+$/g, '')\n );\n }\n}\n","import { jwtDecode } from 'jwt-decode';\n\nimport { mainLogger } from '../logger';\nimport type { Token, TokenPayload } from '../tokens';\n\nconst logger = mainLogger.createChild('decodeToken');\n\nexport function decodeToken(token: Token): T | null {\n if (!token) {\n return null;\n }\n\n try {\n return jwtDecode(token);\n } catch (error: unknown) {\n logger.error(new Error('Error happened during token decode', { cause: error }));\n\n return null;\n }\n}\n","import { AuthorizationCodeTokenClient } from '../AuthorizationCodeTokenClient';\nimport { OidcClient } from '../OidcClient';\nimport { OidcUrlHelper } from '../OidcUrlHelper';\nimport { IDENTITY_CLIENT_ID } from '../constants';\nimport { OidcTokenStorage } from '../storage';\n\nexport interface DoDevelopmentLoginOptions {\n identityUrl: string;\n tenant: string;\n}\n\n/**\n * Extracts token from current URL.\n * If token is not present in URL and app is without token then this will redirect to identity.\n * Identity on successful login redirects back to app with token in URL.\n */\nexport const doDevelopmentLogin = async ({ identityUrl, tenant }: DoDevelopmentLoginOptions) => {\n const searchParams = new URLSearchParams(window.location.hash.split('?')[1] ?? window.location.search);\n\n if (searchParams.has(OidcUrlHelper.AUTH_CODE)) {\n const oidcUrlHelper = new OidcUrlHelper();\n\n const tokenClient = new AuthorizationCodeTokenClient({\n clientId: IDENTITY_CLIENT_ID,\n identityUrl,\n });\n\n oidcUrlHelper.storeAuthCodeFromParams(searchParams);\n\n await tokenClient.initializeTokenFromAuthorizationCode();\n\n oidcUrlHelper.handleRedirectAfterLogin();\n }\n\n const oidcTokenStorage = new OidcTokenStorage();\n const token = oidcTokenStorage.getAccessToken();\n\n if (!token) {\n const oidcClient = new OidcClient(\n {\n callbackUrl: '#/',\n redirectUrl: window.location.href,\n },\n {\n clientId: IDENTITY_CLIENT_ID,\n identityUrl,\n acrValues: `tenant:${tenant}`,\n scope: 'all',\n },\n );\n oidcClient.doLogin();\n }\n};\n","const MAX_VALUE = 4294967295;\n\nlet getRandomNumber = (): number => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/strict-boolean-expressions -- needed\n if (window.crypto?.getRandomValues && window.Uint32Array) {\n getRandomNumber = (): number => {\n const value = window.crypto.getRandomValues(new Uint32Array(1))[0];\n\n if (typeof value === 'undefined') {\n return Math.random();\n }\n\n return value / MAX_VALUE;\n };\n } else {\n getRandomNumber = (): number => Math.random();\n }\n\n return getRandomNumber();\n};\n\nexport function getRandomInt(min: number, max: number): number {\n const ceiledMin = Math.ceil(min);\n const flooredMax = Math.floor(max);\n\n return Math.floor(getRandomNumber() * (flooredMax - ceiledMin + 1)) + ceiledMin;\n}\n","import { NOT_LOGGED_IN_USER_ID } from '../constants';\n\nexport const isAuthenticatedCustomer = (customerId?: number | null | undefined): customerId is number =>\n customerId != null && customerId !== NOT_LOGGED_IN_USER_ID;\n","const TEST = 'test';\n\n// eslint-disable-next-line import/no-mutable-exports -- needed\nexport let isSessionStorageSupported = (): boolean => {\n try {\n sessionStorage.setItem(TEST, TEST);\n sessionStorage.removeItem(TEST);\n\n isSessionStorageSupported = (): boolean => true;\n\n return isSessionStorageSupported();\n } catch (error: unknown) {\n isSessionStorageSupported = (): boolean => false;\n\n return isSessionStorageSupported();\n }\n};\n","import { type Token } from '../tokens';\nimport { decodeToken } from './decodeToken';\n\nexport function isTokenValid(token: Token): boolean {\n const tokenPayload = decodeToken(token);\n\n if (!tokenPayload) {\n return false;\n }\n\n const { exp } = tokenPayload;\n const expirationDate = new Date(exp * 1000);\n\n return expirationDate >= new Date();\n}\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/prefer-function-type -- needed\nexport function singleton(Constructor: T): T {\n return class Singleton extends Constructor {\n private static instance: Singleton;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- needed\n constructor(...args: any[]) {\n if (Singleton.instance instanceof Singleton) {\n // eslint-disable-next-line no-constructor-return -- needed\n return Singleton.instance;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- needed\n super(...args);\n\n Singleton.instance = this;\n\n // eslint-disable-next-line no-constructor-return -- needed\n return this;\n }\n };\n}\n","import { joinPathSegments } from './joinPathSegments';\n\n/**\n * Wrapper around URL that takes into account full path of base URL (which normally URL doesn't do)\n */\nexport class SafeURL extends URL {\n constructor(pathname: string, base?: string | URL) {\n let baseAsURL: URL | undefined;\n if (base) {\n baseAsURL = new URL(base);\n }\n\n super(joinPathSegments(baseAsURL?.pathname, pathname), baseAsURL);\n }\n}\n","import type {\n AxiosAdapter,\n AxiosRequestHeaders,\n InternalAxiosRequestConfig,\n AxiosResponse,\n AxiosHeaderValue,\n} from 'axios';\nimport axios, { AxiosError } from 'axios';\n\nimport { getUrl } from '../internals';\n\nexport default function settle(\n resolve: (response: AxiosResponse) => void,\n reject: (error: AxiosError) => void,\n response: AxiosResponse,\n) {\n const { validateStatus } = response.config;\n\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(\n new AxiosError(\n `Request failed with status code ${response.status}`,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response,\n ),\n );\n }\n}\n\n/**\n * Normalizes the given value to a string or an array of strings.\n * This function is stolen from axios and we hope it will work for us too. - https://github.com/axios/axios/blob/v1.x/lib/core/AxiosHeaders.js#L12\n * If the value is false or null, it is returned as is.\n * If the value is an array, each element is recursively normalized.\n * @param value The value to normalize.\n * @returns The normalized value.\n */\n// @ts-expect-error -- TS does not like the recursive type\nfunction normalizeValue(value: AxiosHeaderValue) {\n if (value === false || value == null) {\n return value;\n }\n\n return Array.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\n/**\n * Converts axios headers to native headers\n */\nconst constructHeaders = (headers: AxiosRequestHeaders): Headers =>\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return -- We are sure that the headers are of type Headers\n new Headers(Object.entries(headers.toJSON()).map(([key, value]): [string, string] => [key, normalizeValue(value)]));\n\nasync function getRequest(config: InternalAxiosRequestConfig) {\n let response: Response | undefined;\n const rawHeaders = constructHeaders(config.headers);\n\n const request = new Request(getUrl(config), {\n headers: rawHeaders,\n keepalive: true,\n });\n\n try {\n response = await fetch(request);\n } catch (error) {\n return new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request);\n }\n\n const axiosResponse: AxiosResponse = {\n status: response.status,\n statusText: response.statusText,\n config,\n request,\n headers: Object.fromEntries(Object.entries(new Headers(response.headers))), // Make a copy of headers\n // We will set data after\n data: undefined,\n };\n\n if (response.status >= 200 && response.status !== 204) {\n switch (config.responseType ?? response.headers.get('content-type')) {\n case 'arraybuffer':\n axiosResponse.data = await response.arrayBuffer();\n break;\n case 'blob':\n axiosResponse.data = await response.blob();\n break;\n case 'json':\n case 'application/json':\n axiosResponse.data = (await response.json()) as Record;\n break;\n default:\n axiosResponse.data = await response.text();\n break;\n }\n }\n\n return axiosResponse;\n}\n\n/**\n * Custom implementation around fetch for axios. This is useful for environments where axios own adapters does not suffice (eg. edge runtime).\n * This custom adapter could be removed when axios introduces its own fetch adapter.\n *\n * https://github.com/axios/axios/issues/5523\n * https://github.com/axios/axios/pull/5146\n * @deprecated Use native axios 'fetch' adapter\n */\nexport const fetchAdapter: AxiosAdapter = async (config) => {\n const request = getRequest(config);\n const promiseChain = [request];\n\n if (config.timeout != null && config.timeout > 0) {\n promiseChain.push(\n new Promise((resolve) => {\n setTimeout(() => {\n const message = config.timeoutErrorMessage\n ? config.timeoutErrorMessage\n : `timeout of ${config.timeout}ms exceeded`;\n resolve(new axios.AxiosError(message, AxiosError.ECONNABORTED, config, request));\n }, config.timeout);\n }),\n );\n }\n\n const data = await Promise.race(promiseChain);\n\n return new Promise((resolve, reject) => {\n if (data instanceof Error) {\n reject(data);\n } else {\n settle(resolve, reject, data);\n }\n });\n};\n","export * from './fetchAdapter';\n","import axios, { type AxiosRequestConfig } from 'axios';\nimport { buildKeyGenerator, setupCache, type AxiosCacheInstance, type CacheOptions } from 'axios-cache-interceptor';\n\nexport type CreateAxiosWithCacheOptions = {\n /**\n * Cache max-age in minutes\n */\n maxAge: number;\n\n /**\n * Custom cache key factory\n */\n key?: (request: AxiosRequestConfig) => string;\n};\n\n/**\n * Creates Axios instance pre-configured with cache (using axios-cache-adapter).\n * @param options Configuration options object\n * @returns Pre-configured Axios instance with cache\n */\nexport function createAxiosWithCache({ key, maxAge }: CreateAxiosWithCacheOptions): AxiosCacheInstance {\n const options: CacheOptions = {\n ttl: maxAge * 60 * 1000,\n };\n\n if (key) {\n options.generateKey = buildKeyGenerator(key);\n }\n\n return setupCache(axios.create(), options);\n}\n","export const fixExcessiveSlashing = (input: string) => input.replace(/\\/+/g, '/');\n","import type { InternalAxiosRequestConfig } from 'axios';\n\nimport { fixExcessiveSlashing } from './fixExcessiveSlashing';\n\ntype ValueType = boolean | number | string | null | undefined;\nconst queryParamsSerializer = (params: Record | null | undefined): string => {\n const searchParams = new URLSearchParams();\n\n Object.entries(params ?? {}).forEach(([key, value]) => {\n if (Array.isArray(value)) {\n value.forEach((v) => {\n if (v != null) {\n searchParams.append(key, encodeURIComponent(v.toString()));\n }\n });\n } else if (value != null) {\n searchParams.append(key, encodeURIComponent(value.toString()));\n }\n });\n\n return searchParams.toString();\n};\n\nexport const getUrl = (config: InternalAxiosRequestConfig): string => {\n let requestUrl: URL;\n\n if (config.url?.startsWith('http')) {\n requestUrl = new URL(config.url);\n } else if (config.baseURL?.startsWith('http')) {\n const baseURLObject = new URL(config.baseURL);\n requestUrl = new URL(fixExcessiveSlashing(`/${baseURLObject.pathname}/${config.url}`), baseURLObject.origin);\n } else {\n if (typeof window === 'undefined') {\n throw new TypeError(\n 'fetchAdapter - cannot construct URL, because request url does not have origin and no origin has been set in baseURL either',\n );\n }\n\n requestUrl = new URL(fixExcessiveSlashing(`/${config.baseURL}/${config.url ?? ''}`), window.location.origin);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- okay here\n requestUrl.search = queryParamsSerializer(config.params);\n\n return requestUrl.toString();\n};\n","const PATH_SEGMENT_DIVIDER = '/';\n\n/**\n * Joins path segments and ensures that there are no duplicated double slashes between them\n */\nexport const joinPathSegments = (...pathnames: Array) =>\n pathnames\n .filter(Boolean)\n .join(PATH_SEGMENT_DIVIDER)\n .replaceAll(/\\/+/g, PATH_SEGMENT_DIVIDER)\n // Siple preserve of protocols as double slashes were deleted previously\n .replace('https:/', 'https://')\n .replace('http:/', 'http://');\n","/**\n * Verifies that a property exists in client app config and has a valid value.\n */\nexport function isValidClientAppConfigProperty(config: Record, property: keyof typeof config) {\n if (property in config) {\n return config[property] !== undefined && config[property] !== null && config[property] !== '';\n }\n\n return false;\n}\n","import { createCustomError } from '@ori/error';\n\nimport { JSON_NOT_PROVIDED, JSON_NOT_VALID } from '../constants';\n\nexport const SafeParseJsonError = createCustomError('SafeParseJsonError', {\n JSON_NOT_PROVIDED,\n JSON_NOT_VALID: `${JSON_NOT_VALID}\n {0}: {1}\n {2}\n `,\n});\n\n/**\n * Safely converts a JSON string into an object.\n * Throws error if providen string is empty (error: JSON_NOT_PROVIDED) or contains invalid JSON (error: JSON_NOT_VALID).\n * @param jsonString A JSON string.\n * @returns Converted a JSON string into an object.\n */\nexport function safeParseJson(jsonString: string) {\n if (!jsonString) {\n throw new SafeParseJsonError('JSON_NOT_PROVIDED');\n }\n\n try {\n return JSON.parse(jsonString) as T;\n } catch (error) {\n const { name, message } = error as Error;\n\n throw new SafeParseJsonError('JSON_NOT_VALID', { messageParameters: [name, message, jsonString] });\n }\n}\n","import { createCustomError } from '@ori/error';\nimport type { NonOptionalKeys } from '@ori/ts-utils';\n\nimport { MISSING_PROPERTY } from './constants';\nimport { isValidClientAppConfigProperty, safeParseJson } from './internals';\n\nexport const ParseClientAppConfigError = createCustomError('ParseClientAppConfigError', {\n MISSING_PROPERTY,\n});\n\n/**\n * Parses and validates a JSON string into an object typed by provided type as client application configuration.\n * JSON string can be obtained e.g. from HTML attribute `data-config` of the client application root element.\n * @param config A JSON string. Preferably valid. Invalid JSON string throws an error.\n * @param requiredProperties Properties required by the client application. Properties are validated if exist in client application configuration and have a valid value. Otherwise an error is thrown.\n * @returns Valid client application configuration.\n */\nexport function parseClientAppConfig(config: string, requiredProperties: Array> = []) {\n const parsedClientAppConfig = safeParseJson(config);\n\n requiredProperties.forEach((property) => {\n if (!isValidClientAppConfigProperty(parsedClientAppConfig as Record, String(property))) {\n throw new ParseClientAppConfigError('MISSING_PROPERTY', { messageParameters: [String(property)] });\n }\n });\n\n return parsedClientAppConfig;\n}\n","import { INTERNAL_ERROR_MESSAGES, UNKNOWN_ERROR } from './constants';\nimport { createErrorMessage } from './internals';\nimport { type CustomError, type CustomErrorOptions, type ErrorMessages } from './types';\n\n/**\n * Function for creating custom error classes. Such custom error class properly subclasses built-in `Error` and simplifies\n * generating error messages via predefined error codes.\n *\n * @param errorName Error name.\n * @param errorMessages Object containing all possible error messages.\n * @return Class that implements {@linkcode CustomError}.\n */\nexport function createCustomError(\n errorName: string,\n errorMessages: ErrorMessages,\n): new (code: ErrorCode, options?: CustomErrorOptions) => CustomError {\n return class InternalCustomError extends Error implements CustomError {\n code: ErrorCode | typeof UNKNOWN_ERROR;\n\n constructor(errorCode: ErrorCode, options?: CustomErrorOptions) {\n const errorMessage = createErrorMessage(errorCode, errorMessages, options?.messageParameters);\n const errorOptions: ErrorOptions = {};\n\n if (typeof options?.cause !== 'undefined') {\n errorOptions.cause = options.cause;\n }\n\n super(errorMessage, errorOptions);\n\n this.code = errorCode;\n this.name = errorName;\n\n // if the message is empty, we are making this an unknown error\n if (!this.message) {\n this.code = UNKNOWN_ERROR;\n this.message = createErrorMessage(UNKNOWN_ERROR, INTERNAL_ERROR_MESSAGES);\n }\n }\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any -- needed */\nimport { type z, type AnyZodObject } from 'zod';\n\nimport { INTERNAL_ERROR_MESSAGES, UNKNOWN_ERROR } from './constants';\nimport { createErrorMessage } from './internals';\nimport { type CustomErrorWithData, type CustomErrorWithDataOptions, type ErrorMessages } from './types';\n\n/**\n * Function for creating custom error classes. Such custom error class properly subclasses built-in `Error`, simplifies\n * generating error messages via predefined error codes and allows attaching custom data to the error instance.\n *\n * @param errorName Error name.\n * @param errorMessages Object containing all possible error messages.\n * @param errorData Runtime representation of the `ErrorData` type parameter; can be either a class expression, or a Zod schema.\n * @return Class that implements {@linkcode CustomErrorWithData}.\n */\nexport function createCustomErrorWithData(\n errorName: string,\n errorMessages: ErrorMessages,\n errorData: ErrorData,\n): new (\n code: ErrorCode,\n options?: CustomErrorWithDataOptions>,\n) => CustomErrorWithData>;\nexport function createCustomErrorWithData<\n ErrorCode extends string,\n ErrorData extends abstract new (...args: any) => any,\n>(\n errorName: string,\n errorMessages: ErrorMessages,\n errorData: ErrorData,\n): new (\n code: ErrorCode,\n options?: CustomErrorWithDataOptions>,\n) => CustomErrorWithData>;\nexport function createCustomErrorWithData(\n errorName: string,\n errorMessages: ErrorMessages,\n errorData: ErrorData,\n): new (\n code: ErrorCode,\n options?: CustomErrorWithDataOptions,\n) => CustomErrorWithData {\n return class InternalCustomError extends Error implements CustomErrorWithData {\n code: ErrorCode | typeof UNKNOWN_ERROR;\n data?: ErrorData;\n\n constructor(errorCode: ErrorCode, options?: CustomErrorWithDataOptions) {\n const errorMessage = createErrorMessage(errorCode, errorMessages, options?.messageParameters);\n const errorOptions: ErrorOptions = {};\n\n if (typeof options?.cause !== 'undefined') {\n errorOptions.cause = options.cause;\n }\n\n super(errorMessage, errorOptions);\n\n this.code = errorCode;\n this.name = errorName;\n\n if (typeof options?.data !== 'undefined') {\n this.data = options.data;\n }\n\n // if the message is empty, we are making this an unknown error\n if (!this.message) {\n this.code = UNKNOWN_ERROR;\n this.message = createErrorMessage(UNKNOWN_ERROR, INTERNAL_ERROR_MESSAGES);\n }\n }\n };\n}\n","import { ERROR_MESSAGE_TOKEN_PATTERN } from '../constants';\nimport { type ErrorMessages } from '../types';\n\n/**\n * A function that generates an error message based on provided error code and message parameters. It is used only internally.\n *\n * @param errorCode Error code.\n * @param errorMessages Object containing all possible error messages.\n * @param messageParameters Array of values that are used as message parameters.\n * @return Error message.\n */\nexport function createErrorMessage(\n errorCode: T,\n errorMessages: ErrorMessages,\n messageParameters: unknown[] = [],\n): string {\n const errorMessage = errorMessages[errorCode];\n\n if (!errorMessage) {\n return '';\n }\n\n return `${errorCode}: ${errorMessage.replace(ERROR_MESSAGE_TOKEN_PATTERN, (match: string, index: number) =>\n String(messageParameters[index]),\n )}`;\n}\n","export * from './CustomError';\nexport * from './CustomErrorOptions';\nexport * from './CustomErrorWithData';\nexport * from './CustomErrorWithDataOptions';\nexport * from './ErrorMessages';\n","export const JSON_CONTENT = 'application/json';\n","export const ACCEPT_LANGUAGE = 'accept-language';\nexport const ATP_CLUSTER_ID = 'x-atp-cluster-id';\nexport const AUTHORIZATION = 'authorization';\nexport const CHANNEL_TYPE = 'x-client-channel';\nexport const CLIENT_APPLICATION = 'x-client-application';\nexport const CONTENT_TYPE = 'content-type';\nexport const CUSTOMER_CONTEXT = 'x-customer-context';\nexport const CUSTOMER_TYPE_ID = 'x-customer-type-id';\nexport const PLACEMENT = 'x-placement';\nexport const PREVIEW_MODE = 'x-preview-mode';\nexport const REGISTRATION_ID = 'x-registration-id';\nexport const TENANT_CONTEXT = 'x-tenant-context';\nexport const USE_PRODUCT_DATA_CACHING = 'x-use-product-data-caching';\nexport const USE_PRODUCTS_SERVICE = 'x-use-products-service';\nexport const VISITOR_SEGMENT = 'x-visitor-segment';\n","export * from './contentTypes';\nexport * from './headers';\nexport * from './statusCodes';\nexport const DEFAULT_TIMEOUT = 5000;\n","export const STATUS_OK = 200;\nexport const STATUS_NOT_FOUND = 404;\nexport const STATUS_INTERNAL_SERVER_ERROR = 500;\n","import type { AxiosResponse } from '@ori/axios';\nimport { AxiosError } from '@ori/axios';\n\nimport { FetchGraphqlError } from './FetchGraphqlError';\n\n/**\n * Error that indicates that fetch to graphql server was successful, but had empty response\n */\nexport class EmptyBodyFetchGraphqlError extends FetchGraphqlError {\n constructor(response: AxiosResponse, query: string) {\n const message = 'Empty body returned from GraphQl server';\n // eslint-disable-next-line unicorn/custom-error-definition -- okay in this case\n super(new AxiosError(message, AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response), query);\n this.name = 'EmptyBodyFetchGraphqlError';\n this.message = message;\n }\n}\n","import type { AxiosError } from '@ori/axios';\nimport { FormattedAxiosError } from '@ori/logger';\n\n/**\n * The `trimString` function takes a GraphQL query as input and returns a trimmed version of it if its\n * length exceeds 255 characters.\n * @param {string} graphqlQuery - The `trimString` function takes a `graphqlQuery` parameter, which is\n * expected to be a string. The function checks if the length of the `graphqlQuery` is greater than 255\n * characters. If it is, the function returns the first 255 characters of the `graphqlQuery`, otherwise\n * @returns If the length of the `graphqlQuery` is greater than 255 characters, the function will\n * return the first 255 characters of the `graphqlQuery`. Otherwise, it will return the original\n * `graphqlQuery` unchanged.\n */\nconst trimGraphqlQuery = (graphqlQuery: string) => {\n if (graphqlQuery.length > 255) {\n return graphqlQuery.slice(0, 255);\n }\n\n return graphqlQuery;\n};\n\n/**\n * Generic error caused by failed fetch to the graphql server\n */\nexport class FetchGraphqlError extends FormattedAxiosError {\n readonly variables: object | null;\n readonly graphqlQuery: string;\n\n constructor(axiosError: AxiosError, graphqlQuery: string) {\n super(axiosError);\n this.name = 'FetchGraphqlError';\n\n const { config } = axiosError;\n\n this.variables =\n typeof config?.data === 'object' && 'variables' in config.data\n ? (config.data as { variables: object }).variables\n : null;\n\n this.graphqlQuery = trimGraphqlQuery(graphqlQuery);\n }\n}\n","import { AxiosError, type AxiosResponse } from '@ori/axios';\n\nimport { FetchGraphqlError } from './FetchGraphqlError';\n\n/**\n * Error that indicates that fetch to graphql server was returned with status code that\n * it is not 200, but also lower than 500 HTTP status code\n */\nexport class NonOkResponseFetchGraphqlError extends FetchGraphqlError {\n constructor(response: AxiosResponse, query: string) {\n const message = 'Non OK response has been returned from GraphQl server';\n // eslint-disable-next-line unicorn/custom-error-definition -- okay in this case\n super(new AxiosError(message, AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response), query);\n this.name = 'NonOkResponseFetchGraphqlError';\n this.message = message;\n }\n}\n","export * from './EmptyBodyFetchGraphqlError';\nexport * from './FetchGraphqlError';\nexport * from './NonOkResponseFetchGraphqlError';\n","/**\n * Custom GQL template literal tag for syntax highlighting and auto-complete of GQL operations in IDEs.\n */\nexport const gql = String.raw;\n","export * from './useGraphqlQuery';\n","import { useMemo } from 'react';\nimport useSWR, { unstable_serialize, useSWRConfig } from 'swr';\nimport type { SWRConfiguration, SWRResponse } from 'swr';\n\nimport { initialDataMiddleware } from '../middleware';\nimport { createSimplifiedCacheKey, fetchGraphql } from '../utils';\nimport type { CacheKey, CreateSimplifiedCacheKeyProps, FetchGraphqlOptions } from '../utils';\n\ntype UseGraphqlQueryOptions =\n | (FetchGraphqlOptions & {\n createCacheKey?: (options: CreateSimplifiedCacheKeyProps) => CacheKey;\n skip?: boolean;\n swrConfig?: SWRConfiguration;\n })\n | null;\n\n/**\n * It takes a GraphQL query, variables, and a url, and returns a SWR response\n * @param {QueryOptions} [options] - The parameters represents an object which contains properties for the Graphql fetcher function\n */\nexport function useGraphqlQuery(\n options: UseGraphqlQueryOptions,\n): SWRResponse {\n const { url, skip, swrConfig, createCacheKey, onError, timeout, ...fetcherOptions } = options ?? { skip: true };\n const { cache } = useSWRConfig();\n const cacheKey = useMemo(\n () =>\n createCacheKey\n ? createCacheKey({ url, ...fetcherOptions })\n : createSimplifiedCacheKey({ url, ...fetcherOptions }),\n [createCacheKey, url, fetcherOptions],\n );\n\n const configForSWR = useMemo(\n () =>\n swrConfig\n ? {\n ...swrConfig,\n use: [...(swrConfig.use ?? []), ...(swrConfig.fallbackData ? [initialDataMiddleware] : [])],\n revalidateOnMount: !cache.get(unstable_serialize(cacheKey)),\n }\n : {\n revalidateOnMount: !cache.get(unstable_serialize(cacheKey)),\n },\n [swrConfig, cache, cacheKey],\n );\n\n return useSWR(\n skip ? null : cacheKey,\n async () => fetchGraphql({ url, onError, timeout, ...fetcherOptions } as FetchGraphqlOptions),\n configForSWR,\n );\n}\n","export * from './initialDataMiddleware';\n","import { useEffect, useRef } from 'react';\nimport type { Middleware, SWRConfiguration } from 'swr';\n\nexport const initialDataMiddleware: Middleware = (useSWRNext) => (key, fetcher, config) => {\n const hasMounted = useRef(false);\n\n const fallbackConfig: SWRConfiguration = {\n ...config,\n fallbackData: hasMounted.current ? undefined : config.fallbackData,\n revalidateOnMount: config.revalidateOnMount ?? !config.fallbackData,\n };\n\n const swr = useSWRNext(key, fetcher, fallbackConfig);\n const { mutate } = swr;\n\n useEffect(() => {\n if (config.fallbackData && !hasMounted.current) {\n // Populate the cache with the initial data\n mutate(config.fallbackData, false);\n }\n }, [mutate, config.fallbackData, key]);\n\n useEffect(() => {\n hasMounted.current = true;\n\n return () => {\n hasMounted.current = false;\n };\n }, []);\n\n return swr;\n};\n","import { AUTHORIZATION } from '../constants';\nimport type { Headers } from '../types';\nimport { isEmptyObject } from './isEmptyObject';\n\nexport type CreateSimplifiedCacheKeyProps = {\n url?: string | undefined;\n query?: string | undefined;\n variables?: Variables | undefined;\n headers?: Headers | undefined;\n};\n\nexport type CacheKey = CreateSimplifiedCacheKeyProps | null;\n\nexport const createSimplifiedCacheKey = (options: CreateSimplifiedCacheKeyProps | null) => {\n if (!options) {\n return null;\n }\n\n const { url, query, headers, variables } = options;\n const headersForCacheKey: Headers = { ...headers };\n if (Object.hasOwn(headersForCacheKey, AUTHORIZATION)) {\n delete headersForCacheKey[AUTHORIZATION]; // We do not wan't to store token in cache as it differs on server and client.\n }\n // Return a cache key object with non-empty properties\n const cacheKey: CacheKey = {\n ...(url && { url }),\n ...(query && { query }),\n ...(variables && !isEmptyObject(variables) && { variables }),\n ...(headers && !isEmptyObject(headersForCacheKey) && { headers: headersForCacheKey }),\n };\n\n return cacheKey;\n};\n","import type { AxiosRequestConfig, AxiosResponse } from '@ori/axios';\nimport { axios, AxiosError } from '@ori/axios';\nimport { isNonNullable } from '@ori/ts-utils';\n\nimport { DEFAULT_TIMEOUT } from '../constants';\nimport { EmptyBodyFetchGraphqlError } from '../errors/EmptyBodyFetchGraphqlError';\nimport { FetchGraphqlError } from '../errors/FetchGraphqlError';\nimport { NonOkResponseFetchGraphqlError } from '../errors/NonOkResponseFetchGraphqlError';\nimport type { Headers } from '../types';\nimport { handleResponse } from './handleResponse';\nimport { isEmptyObject } from './isEmptyObject';\n\ntype GraphqlData = {\n data: Data;\n};\n\nexport interface FetchGraphqlOptions {\n /**\n * The GraphQL query to be sent to the server.\n */\n query: string;\n /**\n * The variables used in the GraphQL query.\n */\n variables?: Variables;\n /**\n * The URL of the GraphQL server.\n */\n url: string;\n /**\n * Bonus request headers for graphql request\n */\n headers?: Headers;\n /**\n * A timeout for the HTTP request, If the request takes longer than the specified timeout, it will be aborted\n * @default 5000 ms\n */\n timeout?: number;\n /**\n * A axios request config for HTTP request.\n * @default {}\n */\n requestConfig?: AxiosRequestConfig;\n /**\n * A callback function to handle errors.\n * @default (error) => console.error(error)\n */\n onError?: (error: Error | FetchGraphqlError | EmptyBodyFetchGraphqlError | NonOkResponseFetchGraphqlError) => void;\n}\n\n/**\n * Fetches data from a GraphQL server using axios library.\n *\n * @typeParam Data The expected data type returned from the GraphQL server.\n * @typeParam Variables The type of variables that the GraphQL query takes.\n * @param options Request options object.\n * @returns A promise that resolves to the requested data or rejects with an error.\n * @throws Error When unknown error happens\n * @throws {FetchGraphqlError} When unknown graphql error happens\n * @throws {EmptyBodyFetchGraphqlError} When graphql server ends request with empty response\n * @throws {NonOkResponseFetchGraphqlError} When graphql server ends request with anything than 200 HTTP status code\n */\nexport async function fetchGraphql({\n query,\n variables,\n url,\n headers,\n timeout = DEFAULT_TIMEOUT,\n requestConfig = {},\n // eslint-disable-next-line no-console -- default error handler\n onError = (error) => console.error(error),\n}: FetchGraphqlOptions): Promise {\n const requestData = {\n query,\n ...(variables && !isEmptyObject(variables) && { variables }),\n };\n\n try {\n const response = await axios.post>>('/graphql', requestData, {\n ...requestConfig,\n baseURL: new URL(url).origin,\n headers,\n timeout,\n });\n\n return handleResponse(response, {\n onSuccess: ({ data: { data } }) => {\n if (isNonNullable(data)) {\n return data;\n }\n\n throw new EmptyBodyFetchGraphqlError(response, query);\n },\n onError: () => {\n throw new NonOkResponseFetchGraphqlError(response, query);\n },\n });\n } catch (error_) {\n const error = error_ instanceof Error ? error_ : new Error(String(error_));\n let rethrowError = error as Error | AxiosError | EmptyBodyFetchGraphqlError | NonOkResponseFetchGraphqlError;\n\n // We need to parse that error as it would be unreadable in Application Inisights this way\n // And also would include too much info\n if (error instanceof AxiosError) {\n rethrowError = new FetchGraphqlError(error, query);\n }\n\n onError(rethrowError);\n throw rethrowError;\n }\n}\n","import { isAuthenticatedCustomer } from '@ori/auth';\n\nimport {\n ACCEPT_LANGUAGE,\n AUTHORIZATION,\n CLIENT_APPLICATION,\n CONTENT_TYPE,\n CUSTOMER_CONTEXT,\n JSON_CONTENT,\n TENANT_CONTEXT,\n} from '../constants';\nimport type { DefaultHeaders, Headers } from '../types';\nimport { formatToken } from './prepareToken';\n\n/**\n * Utility function for generating core headers for HTTP requests. Returns object with headers.\n * @example\n *\n * const headers = getHeaders({\n * sourceAppName: 'app',\n * language: 'cs',\n * customerId: 1,\n * tenant: 'cz',\n * token: 'some-token',\n * }),\n *\n * useGraphqlQuery({query, url, headers: headers})\n */\nexport const getHeaders = ({ sourceAppName, language, customerId, tenant, token }: DefaultHeaders = {}) => {\n const headers: Headers = {\n [CONTENT_TYPE]: JSON_CONTENT,\n };\n\n const formattedToken = formatToken(token);\n\n if (formattedToken) {\n headers[AUTHORIZATION] = formattedToken;\n }\n if (sourceAppName) {\n headers[CLIENT_APPLICATION] = sourceAppName;\n }\n if (language) {\n headers[ACCEPT_LANGUAGE] = language;\n }\n if (isAuthenticatedCustomer(customerId)) {\n headers[CUSTOMER_CONTEXT] = customerId.toString();\n }\n if (tenant) {\n headers[TENANT_CONTEXT] = tenant;\n }\n\n return headers;\n};\n","import type { AxiosResponse } from '@ori/axios';\n\nimport { STATUS_OK } from '../constants';\n\n/**\n * Safely handle and return data on Axios response based on its status.\n */\nexport const handleResponse = (\n response: Response,\n {\n onError,\n onSuccess,\n }: {\n onError: (response: Omit) => ErrorReturn;\n onSuccess: (response: Response) => SuccessReturn;\n },\n) => (response.status === STATUS_OK ? onSuccess(response) : onError(response));\n","export * from './createSimplifiedCacheKey';\nexport * from './fetchGraphql';\nexport * from './getHeaders';\nexport * from './handleResponse';\nexport * from './prepareToken';\nexport * from './validateStatus';\n","/**\n * The function checks if an object is empty by checking if it has no keys.\n * @param {object} obj - The parameter \"obj\" is of type \"object\", which means it can accept any\n * JavaScript object as an argument.\n */\nexport const isEmptyObject = (obj: object) => Object.keys(obj).length === 0;\n","const BEARER = 'Bearer ';\n\n/**\n * Composes a token string with a \"Bearer\" prefix if it doesn't already have one.\n * @param {string} token - The `token` parameter is a string representing an authentication token.\n */\nexport const composeToken = (token: string): string => (token.includes(BEARER) ? token : `${BEARER}${token}`);\n\n/**\n * Formats a token string if it exists, otherwise it returns undefined.\n * @param {string | null | undefined} token - The `token` parameter is a string that can also be `null`\n * or `undefined`.\n */\nexport const formatToken = (token: string | null | undefined): string | undefined =>\n token ? composeToken(token) : undefined;\n","import { STATUS_OK, STATUS_INTERNAL_SERVER_ERROR } from '../constants';\n\n/**\n * Default value for `validateStatus` option to prevent Axios from throwing non-5xx errors.\n */\nexport const validateStatus = (status: number) => status >= STATUS_OK && status < STATUS_INTERNAL_SERVER_ERROR;\n","/* eslint-disable new-cap -- this is kind of enforced by Pino with the enum we have */\nimport cloneDeep from 'clone-deep';\nimport deepmerge from 'deepmerge';\nimport { type LoggerOptions, pino } from 'pino';\nimport pinoSerializers from 'pino-std-serializers';\n\nimport { ApplicationInsights, isServerApplicationInsightsClient } from './application-insights';\nimport { defaultLoggerConfiguration, TRACK_THIS_PAGE_VIEW } from './constants';\nimport { formatError } from './formatError';\nimport { LoggerBrowserConfiguration } from './internal/LoggerBrowserConfiguration';\nimport type { PinoMessage } from './internal/PinoMessage';\nimport { isPlainObject } from './internal/isPlainObject';\nimport { loggerEventEmitter } from './internal/loggerEventEmitter';\nimport type { PinoRuntimeTransportOptions } from './internal/pino-runtime-transports/PinoRuntimeTransportOptions';\nimport { pinoBrowserRuntimeTransport } from './internal/pino-runtime-transports/pinoBrowserRuntimeTransport';\nimport { printWarningWithTrace } from './internal/printWarningWithTrace';\nimport { createMetadataDependencyInitializer } from './internal/telemetry/browser/createMetadataDependencyInitializer';\nimport { type LoggerConfiguration } from './loggerConfigurationSchema';\nimport type * as asyncLocalStorageModule from './server/asyncLocalStorage';\nimport { LoggerTransportType } from './types';\nimport type { ChildLogger } from './types/ChildLogger';\nimport type { LoggerMetadata } from './types/LoggerMetadata';\nimport type { MessageMetadata } from './types/MessageMetadata';\nimport { SeverityLevels } from './types/SeverityLevels';\n\nconst isInBrowserRuntime = typeof window !== 'undefined';\nconst isInNodeRuntime = !isInBrowserRuntime;\nconst loggerDebugIsEnabled = process.env.DEBUG_LOGGER === 'true';\nconst isTestingLogger = process.env.LOGGER_TEST === 'true';\nconst isDevelopment = process.env.NODE_ENV !== 'production';\n\ntype PinoLoggerOptions = LoggerOptions;\ntype PinoChildLoggerOptions = pino.ChildLoggerOptions;\ntype PinoLogger = pino.Logger;\n\nexport type ChildLoggerConstructorOptions = ConstructorParameters;\nexport type LoggerConstructorOptions = [ChildLoggerConstructorOptions[0], ChildLoggerConstructorOptions[2]];\n\nconst parentLoggerDefaultMessageMetadata: LoggerMetadata = {};\nconst childLoggerDefaultMessageMetadata: LoggerMetadata = {};\n\n/**\n * Logger for Oriflame applications.\n *\n * @example\n *\n * #### Simple\n *\n * This will only print info to console:\n *\n * ```ts\n * // Setup should occur before any logging is done, but can be called after to update metadata globally\n * Logger.configure({\n * // ...setup properties\n * });\n * // Create instance with desired name or any other configuration...\n * const myLogger = new Logger({ name: 'application' });\n * // ...and do the logging 🎉\n * myLogger.info('This is just info'); // => [application]: This is just info\n * // You can even attach useful information in object as a second parameter\n * myLogger.info('This is info with other information', { weather: '🌤️' }); // => [application]: This is info with other information { metadata: { weather: '🌤️' } }\n * ```\n *\n * #### With metadata\n *\n * You can add something whats called 'metadata'. Either globally during setup or locally for Logger instance.\n * These metadata properties are added to each log output (formatting may differr)\n *\n * ```ts\n * // Add filters for your logging\n * Logger.updateConfiguration({\n * filters: [\n * forName: 'my-component',\n * forSeverityLevel: SeverityLevels.DEBUG,\n * // Let debug be always enabled for Logger with name 'my-component'\n * enabled: true\n * ]\n * })\n * // Create your instance\n * const myLogger = new Logger('my-component', { weather: '🌤️' });\n * // And log it to see the results\n * myLogger.info('Hello there'); // => [my-component]: Hello there { language: 'dk-DK', myProperty: { other: false }, metadata: { weather: '🌤️' } }\n * ```\n */\nexport class Logger {\n readonly name: string;\n readonly areaName: string | undefined;\n private pinoChild: PinoLogger | null = null;\n private messageMetadata: LoggerMetadata = cloneDeep(childLoggerDefaultMessageMetadata);\n\n private static pinoParent: PinoLogger | null = null;\n private static isPageViewTracked = false;\n private static configuration: LoggerConfiguration = cloneDeep(defaultLoggerConfiguration);\n private static metadataDependencyInitializer: ReturnType | null = null;\n\n // backing field for globalMetadata, do not access directly\n private static _globalMetadata: LoggerMetadata = cloneDeep(parentLoggerDefaultMessageMetadata);\n\n constructor(\n /**\n * The Logger instance name. Usually a package name.\n * Is prefixed to the start of message when in development.\n * @example\n * #### Example when provided value is string:\n * ```\n * // create logger\n * const logger = new Logger('bob');\n * // Print something\n * logger.info('This is info') // Prints: [bob] This is info\n * ```\n */\n name: string,\n /**\n * This let's you define your own metadata for this logger\n */\n loggerMetadata?: LoggerMetadata & { teamName?: string },\n );\n constructor(\n /**\n * The Logger instance name. Usually a package name.\n * Is prefixed to the start of message when in development.\n */\n name: string,\n /**\n * A name of an area this Logger handles under provided name.\n * Can be the name of a component or a short description.\n */\n areaName: string,\n /**\n * This let's you define your own metadata for this logger\n */\n loggerMetadata?: LoggerMetadata,\n );\n constructor(name: string, loggerMetadataOrAreaName?: LoggerMetadata | string, loggerMetadata?: LoggerMetadata) {\n this.name = name;\n this.areaName = typeof loggerMetadataOrAreaName === 'string' ? loggerMetadataOrAreaName : undefined;\n\n this.messageMetadata =\n (typeof loggerMetadataOrAreaName === 'object' ? loggerMetadataOrAreaName : undefined) ??\n loggerMetadata ??\n childLoggerDefaultMessageMetadata;\n }\n\n // listen for localstorage updates without the need to reload the whole page\n /** Global logger localstorage listener */\n private static readonly localStorageListener = () => {\n const currentBrowserConfiguration = LoggerBrowserConfiguration.get();\n\n if (currentBrowserConfiguration) {\n this.setConfiguration(currentBrowserConfiguration);\n }\n };\n\n /**\n * Creates child Logger instance that describes more specific area\n * Is equivalent of `new Logger('', , ...)`\n */\n createChild(areaName: string, incommingChildMetadata: LoggerMetadata = {}) {\n return new Logger(\n this.name,\n areaName,\n // Copy parent metadata\n deepmerge(childLoggerDefaultMessageMetadata, incommingChildMetadata),\n ) as ChildLogger;\n }\n\n /**\n * Gets global metadata. If executed in Node.js environment, it will also include metadata from AsyncLocalStorage.\n * @returns Global metadata\n */\n static get globalMetadata() {\n if (isInNodeRuntime) {\n // eslint-disable-next-line node/global-require, @typescript-eslint/no-require-imports -- caller is not async\n const { asyncLocalStorage } = require('./server/asyncLocalStorage') as typeof asyncLocalStorageModule;\n const storedMetadata = asyncLocalStorage.getStore();\n if (storedMetadata) {\n // if false, we have no defined store\n this._globalMetadata = storedMetadata;\n }\n }\n\n return deepmerge(parentLoggerDefaultMessageMetadata, this._globalMetadata, {\n isMergeableObject: isPlainObject,\n });\n }\n\n /**\n * Overrides global metadata with new set of metadata\n */\n static set globalMetadata(metadata: LoggerMetadata) {\n this._globalMetadata = metadata;\n\n // If we are in Node.js environment we need to update AsyncLocalStorage as well\n if (isInNodeRuntime) {\n // eslint-disable-next-line node/global-require, @typescript-eslint/no-require-imports -- caller is not async\n const { asyncLocalStorage } = require('./server/asyncLocalStorage') as typeof asyncLocalStorageModule;\n const storedMetadata = asyncLocalStorage.getStore();\n\n if (storedMetadata) {\n // Assign metadata without changing the reference of the store object\n Object.assign(storedMetadata, this._globalMetadata);\n }\n }\n\n // If we are in browser and Application Insights is initialized, we need to update the metadata for dependencies\n if (isInBrowserRuntime && ApplicationInsights.isInitialized()) {\n this.metadataDependencyInitializer ??= createMetadataDependencyInitializer(ApplicationInsights.getForClient());\n this.metadataDependencyInitializer(this._globalMetadata);\n }\n }\n\n static setGlobalMetadata(metadata: LoggerMetadata) {\n this.globalMetadata = metadata;\n }\n\n /**\n * Updates global metadata with provided metadata. Metadata that are provided will just be merged with already set metadata\n */\n static updateGlobalMetadata(metadata: LoggerMetadata) {\n this.globalMetadata = deepmerge(this.globalMetadata, cloneDeep(metadata), {\n isMergeableObject: isPlainObject,\n });\n }\n\n static isInitialized() {\n return !!this.pinoParent;\n }\n\n /**\n * Tracks `pageView` manually.\n * Automatic `pageView` tracking in Application Insights is disabled to prevent `pageView` from being sent multiple times.\n * Can be called on the client and Application Insights must be already initialized.\n */\n static trackPageView() {\n if (isInBrowserRuntime && !this.isPageViewTracked && ApplicationInsights.isInitialized()) {\n ApplicationInsights.getForClient().trackPageView({ properties: { TRACK_THIS_PAGE_VIEW } });\n this.isPageViewTracked = true;\n }\n }\n\n /** Initializes configuration */\n private static initializeConfiguration() {\n // Initialize configuration for browser\n if (isInBrowserRuntime) {\n // Read initial configuration\n const currentBrowserConfiguration = LoggerBrowserConfiguration.get();\n if (currentBrowserConfiguration) {\n // Set here is kind of intentional. This is so the localStorage is last to be applied\n this.setConfiguration(currentBrowserConfiguration);\n }\n\n window.addEventListener('storage', this.localStorageListener);\n }\n }\n\n private static withPinoConfigurationNodeTransports(options: PinoLoggerOptions): typeof options {\n // eslint-disable-next-line no-param-reassign -- no need to clone that\n options.transport = {\n pipeline: [\n {\n target: require.resolve('./internal/pino-runtime-transports/pinoNodeRuntimeTransport'),\n options: {\n loggerConfiguration: this.getConfiguration(),\n applicationInsightsConfiguration: global.oriAppInsightsSettings,\n } satisfies PinoRuntimeTransportOptions,\n },\n ],\n };\n\n return options;\n }\n\n private static withPinoConfigurationBrowserTransports(options: PinoLoggerOptions): typeof options {\n const handler = pinoBrowserRuntimeTransport({\n loggerConfiguration: this.getConfiguration(),\n applicationInsightsConfiguration: global.oriAppInsightsSettings,\n });\n\n // eslint-disable-next-line no-param-reassign -- no need to clone that\n options.browser = {\n write: (pinoMessage) => handler(pinoMessage as PinoMessage),\n };\n\n return options;\n }\n\n /** Initilizes Pino */\n private static initializeParent() {\n this.initializeConfiguration();\n\n let pinoOptions: PinoLoggerOptions = {\n useOnlyCustomLevels: true,\n customLevels: SeverityLevels,\n // IMPORTANT: This has to remain as the lowest possible level in the SeverityLevels enum\n level: 'DEBUG',\n serializers: {\n // This is for environments that uses worker threads - currently only Node.js\n // Worker threads are known to not retain original prototypes and\n // only copies serializable values (anything that is enurable)\n error: pinoSerializers.errWithCause,\n },\n };\n\n if (isInNodeRuntime) {\n pinoOptions = this.withPinoConfigurationNodeTransports(pinoOptions);\n } else {\n pinoOptions = this.withPinoConfigurationBrowserTransports(pinoOptions);\n }\n\n this.pinoParent = pino(pinoOptions);\n\n if (loggerDebugIsEnabled) {\n printWarningWithTrace('Logger was initialized!');\n }\n\n // Logger reset for tests\n if (isTestingLogger) {\n loggerEventEmitter.addListener('reset', () => {\n this.pinoParent = null;\n this._globalMetadata = cloneDeep(parentLoggerDefaultMessageMetadata);\n });\n }\n }\n\n private initializeChild() {\n const parent = Logger.getPinoParent();\n const setupOptions: PinoChildLoggerOptions = {};\n\n // Name should not part of message during production\n if (isDevelopment) {\n const name = [this.name, this.areaName].filter(Boolean).join(' > ');\n setupOptions.msgPrefix = `[${name}] `;\n }\n\n this.pinoChild = parent.child(\n // due to internal logic we have set this as empty object\n // as we create custom message with properties on each message\n // This is so that we can change properties\n {},\n setupOptions,\n );\n\n // Logger reset for tests\n if (isTestingLogger) {\n loggerEventEmitter.addListener('reset', () => {\n this.pinoChild = null;\n // This is so that reset works correctly, normally this.childSetupOptions.bindings won't be used anymore\n // after Logger was initialized\n this.messageMetadata = cloneDeep(childLoggerDefaultMessageMetadata);\n });\n }\n }\n\n private static getPinoParent(): NonNullable {\n if (!this.isInitialized()) {\n this.initializeParent();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- should be initialized by now\n return this.pinoParent!;\n }\n\n private getPinoChild(): PinoLogger {\n if (!this.pinoChild) {\n this.initializeChild();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- should be initialized by now\n return this.pinoChild!;\n }\n\n private createPinoMessage(message: T, additionalMeta?: A) {\n const metadata = deepmerge(this.messageMetadata, additionalMeta ?? {}, {\n isMergeableObject: isPlainObject,\n });\n const { teamName, ...metadataWithoutTeamName } = metadata;\n\n // Ordering matters!\n let result = {\n ...message,\n ...Logger.globalMetadata,\n name: this.name,\n ...(this.areaName && { areaName: this.areaName }),\n ...(teamName !== undefined && { teamName }),\n ...(Object.keys(metadataWithoutTeamName).length && { metadata: metadataWithoutTeamName }),\n };\n\n if (ApplicationInsights.isInitialized() && isServerApplicationInsightsClient(ApplicationInsights.get())) {\n const ai = ApplicationInsights.getForServer();\n // What a weird typing they have!\n const context = ai.getCorrelationContext() as null | ReturnType;\n const { operation } = context ?? {};\n const { id, name, parentId } = operation ?? {};\n\n if (operation) {\n result = {\n ...result,\n applicationInsightsOperation: {\n id,\n name,\n parentId,\n },\n };\n }\n }\n\n return result;\n }\n\n /**\n * Method for logging error\n *\n * @example\n *\n * #### Usage if you want to log error as is\n * ```js\n * const error = new Error('Some error message');\n * new Logger('@ori/awesome').error(error);\n * ```\n *\n * #### Usage if you want to give error additional description\n * ```js\n * const someOtherError = new Error('This is some specific error');\n * const error = new Error(\n * // Here describe someOtherError in more detail\n * 'Some error message',\n * {\n * // You give previous error here\n * cause: someOtherError,\n * }\n * );\n * new Logger('@ori/awesome').error(error);\n * ```\n */\n error(error: Error, metadata: MessageMetadata = {}) {\n const { message, cause } = error;\n const causeMessage =\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions -- we need to verify runtime value first\n cause && (typeof cause === 'string' || cause instanceof Error)\n ? cause instanceof Error\n ? cause.message\n : cause\n : undefined;\n\n const pinoMessage = this.createPinoMessage(\n {\n error: formatError(error),\n },\n metadata,\n );\n\n this.getPinoChild().ERROR(\n pinoMessage,\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- we need to use || for empty strings\n message || causeMessage || 'An error happened',\n );\n }\n\n /**\n * Method for logging metric\n *\n * @example Logging the speed of a function call\n * ```js\n *\n * ```\n */\n metric(name: string, value: number, metadata: MessageMetadata = {}) {\n const pinoMessage = this.createPinoMessage(\n {\n metricName: name,\n metricValue: value,\n },\n metadata,\n );\n\n this.getPinoChild().METRIC(pinoMessage, `Collected metric with the name \"${name}\" and value \"${value}\"`);\n }\n\n /**\n * Logs info\n */\n info(message: string, metadata: MessageMetadata = {}) {\n const pinoMessage = this.createPinoMessage({}, metadata);\n\n this.getPinoChild().INFO(pinoMessage, message);\n }\n\n /**\n * Logs debug and is ommited in production mode\n */\n debug(message: string, metadata: MessageMetadata = {}) {\n const pinoMessage = this.createPinoMessage({}, metadata);\n\n this.getPinoChild().DEBUG(pinoMessage, message);\n }\n\n /**\n * Logs warning\n */\n warn(message: string, metadata: MessageMetadata = {}) {\n const pinoMessage = this.createPinoMessage({}, metadata);\n\n this.getPinoChild().WARN(pinoMessage, message);\n }\n\n /**\n * Sets new metadata object to this Logger instance.\n */\n setMetadata(metadata: LoggerMetadata) {\n this.getPinoChild().setBindings(metadata);\n\n return this;\n }\n\n /**\n * Takes newly provided metadata and merges it with previously defined metadata on this Logger instance\n */\n updateMetadata(metadata: Partial) {\n const child = this.getPinoChild();\n this.setMetadata(\n deepmerge(child.bindings(), metadata, {\n isMergeableObject: isPlainObject,\n }),\n );\n\n return this;\n }\n\n /** Sets configuration for logger */\n static setConfiguration(nextConfiguration: Partial) {\n // Merge with default, because the defaults must be always present\n this.configuration = deepmerge(defaultLoggerConfiguration, nextConfiguration);\n\n loggerEventEmitter.emit('configurationUpdated', this.configuration);\n }\n\n /** takes new configuration and merges it with existing */\n static updateConfiguration(nextConfiguration: Partial) {\n this.setConfiguration(deepmerge(this.configuration, nextConfiguration));\n }\n\n /** Gets current configuration for logger */\n static getConfiguration(): LoggerConfiguration {\n return this.configuration;\n }\n\n static isTransportConfigured(transportType: LoggerTransportType) {\n if (!this.configuration) {\n throw new Error('Logger configuration is not initialized');\n }\n\n return (\n this.configuration.enabled &&\n this.configuration.filters.some((filter) => filter.enabled && filter.byTransportType === transportType)\n );\n }\n}\n\n// Setup helper Logger methods for browser\n\ndeclare global {\n interface OriLoggerMethods {\n setConfiguration: (typeof Logger)['setConfiguration'];\n getConfiguration: (typeof Logger)['getConfiguration'];\n updateConfiguration: (typeof Logger)['updateConfiguration'];\n }\n\n interface Ori {\n logger?: OriLoggerMethods;\n }\n\n interface Window {\n ori?: Ori;\n }\n}\n\nif (isInBrowserRuntime) {\n window.ori ??= {};\n window.ori.logger ??= {\n getConfiguration: Logger.getConfiguration,\n setConfiguration: LoggerBrowserConfiguration.set,\n updateConfiguration: LoggerBrowserConfiguration.update,\n };\n}\n","import { ReactPlugin } from '@microsoft/applicationinsights-react-js';\nimport { ApplicationInsights as ClientApplicationInsights } from '@microsoft/applicationinsights-web';\nimport type * as workerThreadsModule from 'node:worker_threads';\n\nimport { EventEmitter } from '../internal/EventEmitter';\nimport { printWarningWithTrace } from '../internal/printWarningWithTrace';\nimport { pageViewInitializer } from '../internal/telemetry/browser/pageViewInitializer';\nimport { createFilterTelemetryProcessor } from '../internal/telemetry/createFilterTelemetryProcessor';\nimport { createFixedRateSampler } from '../internal/telemetry/createFixedRateSampler';\nimport { enhanceDependencyDataProcessor } from '../internal/telemetry/server/enhanceDependencyDataProcessor';\nimport { excludeHealthProbesTelemetryProcessor } from '../internal/telemetry/server/excludeHealthProbesTelemetryProcessor';\nimport { excludeNextjsTelemetryProcessor } from '../internal/telemetry/server/excludeNextjsTelemetryProcessor';\nimport type { LoggerApplicationInsightsConfig } from '../types';\nimport type { ApplicationInsightsLike } from './ApplicationInsightsLike';\nimport { ApplicationInsightsNotInitializedError } from './ApplicationInsightsNotInitializedError';\nimport type { ServerApplicationInsights } from './ServerApplicationInsights';\nimport { isServerApplicationInsightsClient } from './isServerApplicationInsightsClient';\n\nexport class ApplicationInsights {\n private static realApplicationInsights: ApplicationInsightsLike | null = null;\n private static readonly eventEmitter = new EventEmitter<{\n created: {\n instance: ApplicationInsightsLike;\n };\n }>();\n\n /**\n * Destroys internal Application Insights, DO NOT USE OUTSIDE OF @ori/logger\n *\n * @internal\n */\n static _reset() {\n this.realApplicationInsights = null;\n }\n\n /**\n * Returns Application Insights if its initialized, othervise throws\n *\n * @throws ApplicationInsightsNotInitializedError Application Insights must be initialized\n */\n static get() {\n const value = this.realApplicationInsights;\n\n if (!value) {\n throw new ApplicationInsightsNotInitializedError();\n }\n\n return value;\n }\n\n /**\n * Gets you typed client-side Application Insights\n */\n static getForClient(): ClientApplicationInsights {\n const value = this.get();\n\n if (isServerApplicationInsightsClient(value)) {\n throw new Error('Cannot get Application Insights for client, because getForClient was probably called on server');\n }\n\n return value;\n }\n\n /**\n * Gets you typed server-side Application Insights\n */\n static getForServer(): ServerApplicationInsights {\n const value = this.get();\n\n if (!isServerApplicationInsightsClient(value)) {\n throw new Error('Cannot get Application Insights for server, because getForServer was probably called on client');\n }\n\n return value;\n }\n\n /**\n * Attaches listener that lets you listen for event when application insights was created for environment.\n *\n * This allows you to make changes on application insights before first log is send to application insights itself\n *\n * @param listener\n */\n static onInitialized(listener: (ai: ApplicationInsightsLike) => void) {\n type ApplicationInsightsEventEmitterListener = Parameters[1];\n\n const eventListener: ApplicationInsightsEventEmitterListener = ({ instance }): void => {\n listener(instance);\n };\n\n // If its initialized already then we need invoke listener rightaway\n if (this.isInitialized()) {\n eventListener({ instance: this.get() });\n }\n\n this.eventEmitter.addListener('created', eventListener);\n\n return {\n /**\n * Removes listener\n */\n remove: () => this.eventEmitter.removeListener('created', eventListener),\n };\n }\n\n /**\n * Checks if Application Insights is initialized\n */\n static isInitialized() {\n return !!this.realApplicationInsights;\n }\n\n /**\n * Initializes application insights for current environment and attaches it to this.\n * If it is already initialized then in will just return without doing anything.\n *\n * Automatic `pageView` tracking is disabled to prevent `pageView` from being sent multiple times.\n * See the example how to track `pageView`:\n * @example\n * import { ApplicationInsights } from '@ori/logger';\n * ApplicationInsights.trackPageView();\n */\n static initialize(input?: LoggerApplicationInsightsConfig) {\n if (this.isInitialized()) {\n return;\n }\n const fallbackOptions = global.oriAppInsightsSettings;\n const options = input ?? fallbackOptions ?? {};\n\n const { connectionString, samplingPercentage = 100 } = options;\n\n if (!connectionString) {\n // TODO (OL): Should we do some checking to hide this warning when certain environment variable is provided?\n // eslint-disable-next-line no-console -- we want to use native console instead\n console.warn('Could not initialize Application Insights due to missing connectionString');\n\n return;\n }\n\n // @ts-expect-error -- okay for here\n const isInEdgeRuntime = typeof EdgeRuntime === 'string';\n\n if (typeof window === 'undefined' && !isInEdgeRuntime) {\n const { isMainThread } =\n // eslint-disable-next-line node/global-require, @typescript-eslint/no-require-imports -- caller is not async\n require('node:worker_threads') as typeof workerThreadsModule;\n\n const serverApplicationInsights =\n // This is manily for edge where edge will throw that it cannot find application insights\n // and it will keep the sync import of module on server where we should no await import of application insights\n // eslint-disable-next-line node/global-require, @typescript-eslint/no-require-imports -- Explanation on the previous line\n require('applicationinsights') as ServerApplicationInsights;\n\n serverApplicationInsights\n .setup(connectionString)\n .setAutoCollectExceptions(isMainThread)\n .setSendLiveMetrics(isMainThread)\n .setAutoCollectConsole(false)\n .setAutoCollectRequests(false) // is handled by our appshell-server\n .setAutoCollectPerformance(isMainThread)\n .setAutoDependencyCorrelation(isMainThread)\n .setAutoCollectIncomingRequestAzureFunctions(isMainThread);\n\n serverApplicationInsights.start();\n serverApplicationInsights.defaultClient.addTelemetryProcessor(excludeHealthProbesTelemetryProcessor);\n serverApplicationInsights.defaultClient.addTelemetryProcessor(excludeNextjsTelemetryProcessor);\n serverApplicationInsights.defaultClient.addTelemetryProcessor(enhanceDependencyDataProcessor);\n serverApplicationInsights.defaultClient.config.samplingPercentage = samplingPercentage;\n\n this.realApplicationInsights = serverApplicationInsights;\n } else {\n // browserHistory.location.pathname = browserHistory.state.url\n const config = {\n ...options,\n samplingPercentage,\n extensions: [] as NonNullable,\n extensionConfig: {} as NonNullable,\n } satisfies LoggerApplicationInsightsConfig;\n\n if (!isInEdgeRuntime) {\n const browserHistory = { url: '', location: { pathname: '' }, listen: () => {}, ...window.history };\n const reactPlugin = new ReactPlugin();\n config.extensions.push(reactPlugin);\n config.extensionConfig[reactPlugin.identifier] = { history: browserHistory };\n }\n\n const applicationInsights = new ClientApplicationInsights({\n config,\n });\n\n applicationInsights.loadAppInsights();\n applicationInsights.addTelemetryInitializer(pageViewInitializer);\n applicationInsights.addTelemetryInitializer(\n createFilterTelemetryProcessor(\n (envelope) => envelope.data?.baseType === 'MetricData' && ['LCP', 'CLS', 'INP'].includes(envelope.name),\n createFixedRateSampler(10),\n ),\n );\n\n if (!isInEdgeRuntime) {\n window.appInsights = applicationInsights;\n }\n this.realApplicationInsights = applicationInsights;\n }\n\n const loggerDebugIsEnabled = process.env.DEBUG_LOGGER === 'true';\n\n if (loggerDebugIsEnabled) {\n printWarningWithTrace('AppInsights initialized');\n }\n\n this.eventEmitter.emit('created', { instance: this.realApplicationInsights });\n }\n}\n","export class ApplicationInsightsNotInitializedError extends Error {\n constructor() {\n super('Application Insights not yet initialized');\n this.name = 'ApplicationInsightsNotInitializedError';\n }\n}\n","import { ReactPlugin } from '@microsoft/applicationinsights-react-js';\n\nimport { ApplicationInsights } from './ApplicationInsights';\nimport { isServerApplicationInsightsClient } from './isServerApplicationInsightsClient';\n\nexport const getApplicationInsightsReactPlugin = (): ReactPlugin => {\n const ai = ApplicationInsights.get();\n\n if (isServerApplicationInsightsClient(ai)) {\n throw new Error('There is no react plugin on server for application insights');\n }\n\n const plugin = ai.config.extensions?.find((extension) => extension instanceof ReactPlugin) as ReactPlugin;\n\n return plugin;\n};\n","import type { LoggerApplicationInsightsConfig } from '../types';\n\ndeclare global {\n // eslint-disable-next-line vars-on-top, no-var -- just a declaration which must be done this way\n var oriAppInsightsSettings: LoggerApplicationInsightsConfig | undefined;\n}\n\n/**\n * Lets you retrieve configuration for application insights on the client.\n *\n * @example\n * ```js\n * // appRender.ts\n * import { Logger, ApplicationInsights, getClientApplicationInsightsConfig } from '@ori/logger';\n * export const render = (rootEl) => {\n * ApplicationInsights.initialize(getClientApplicationInsightsConfig())\n *\n * Logger.configure({\n * metadata: {\n * myMeta: '🎉'\n * },\n * ...\n * });\n * };\n * ```\n */\nexport const getClientApplicationInsightsConfig = (): LoggerApplicationInsightsConfig | undefined =>\n typeof window === 'undefined' ? undefined : window.oriAppInsightsSettings;\n","export * from './ApplicationInsightsNotInitializedError';\nexport * from './ApplicationInsights';\nexport * from './ApplicationInsightsLike';\nexport * from './getApplicationInsightsReactPlugin';\nexport * from './getClientApplicationInsightsConfig';\nexport * from './isServerApplicationInsightsClient';\nexport * from './ServerApplicationInsights';\n","import type { ApplicationInsightsLike } from './ApplicationInsightsLike';\nimport type { ServerApplicationInsights } from './ServerApplicationInsights';\n\nexport const isServerApplicationInsightsClient = (item: ApplicationInsightsLike): item is ServerApplicationInsights =>\n 'defaultClient' in item &&\n 'constructor' in item.defaultClient &&\n 'name' in item.defaultClient.constructor &&\n // TODO: After applicationisights@3 is introduced this check must be udated\n item.defaultClient.constructor.name === 'NodeClient';\n","import { isAxiosError, type AxiosError } from '@ori/axios';\n\nconst MAX_BODY_LENGTH = 200;\n/**\n * Represents a status code of `0` to indicate that no response was received from the server.\n *\n * @remarks\n * This constant is used in scenarios where the HTTP request did not reach the server or the server\n * did not provide a valid response, such as when the network is unavailable, the request times out,\n * or there's a CORS error. Since `0` is not a valid HTTP status code, it serves as a special\n * placeholder to signal the absence of any server response.\n */\nexport const NO_RESPONSE_STATUS_CODE = 0;\n\n/**\n * This formats AxiosError into more readable object not only for user but also for Application Insights\n */\nexport class FormattedAxiosError extends Error {\n readonly baseUrl: string | null;\n readonly pathname: string | null;\n readonly method: string | null;\n readonly statusCode: number | null;\n readonly statusText: string | null;\n readonly responseBody: string | null = null;\n readonly innerCallstack: string | null;\n\n constructor(axiosError: AxiosError) {\n super(`Axios Error: ${axiosError.message}`);\n this.name = 'FormattedAxiosError';\n const { response, stack, code, config, status } = axiosError;\n // Response could be undefined on timeout for example\n this.baseUrl = response?.config.baseURL ?? config?.baseURL ?? null;\n this.pathname = response?.config.url ?? config?.url ?? null;\n this.method = (response?.config.method ?? config?.method)?.toUpperCase() ?? null;\n this.statusCode = response?.status ?? status ?? NO_RESPONSE_STATUS_CODE;\n this.statusText = response?.statusText ?? code ?? null;\n\n // No need to pass body on 404 and empty body\n if (this.statusCode !== 404 && response?.data !== undefined && response.data !== null) {\n if (process.env.NODE_ENV === 'production') {\n const dataAsJson = JSON.stringify(response.data);\n const numberOfChars = dataAsJson.length;\n // Make sure that body is trimmed so we wont overfill Application Insights\n this.responseBody = dataAsJson.slice(0, MAX_BODY_LENGTH);\n\n if (numberOfChars > MAX_BODY_LENGTH) {\n // And still show how many chars are actually there\n this.responseBody += `... (+${numberOfChars - MAX_BODY_LENGTH})`;\n }\n } else {\n this.responseBody = JSON.stringify(response.data, null, 2);\n }\n }\n\n this.innerCallstack = stack ?? null;\n }\n}\n\n/**\n * Formats the given error to ensure consistent error handling.\n *\n * If the error is an Axios error, it is wrapped in a FormattedAxiosError.\n * The function recursively formats any `cause` property that is also an error.\n *\n * @param providedError - The error object to be formatted. Can be any unknown type.\n * @returns A properly formatted error object.\n */\nexport function formatError(providedError: unknown): Error {\n if (!(typeof providedError === 'object') || !(providedError instanceof Error)) {\n return new Error((providedError as boolean | number | string | symbol).toString());\n }\n\n let error = providedError;\n\n // Check if the error is an AxiosError and format it\n if (isAxiosError(error)) {\n error = new FormattedAxiosError(error);\n }\n\n // If the error has a cause, recursively format it\n if (error.cause instanceof Error) {\n error.cause = formatError(error.cause);\n }\n\n return error;\n}\n","import { EventEmitter as NodeEventEmitter } from 'node:events';\n\nconst isBrowser = typeof window !== 'undefined';\nconst isEventTarget = (manager: EventTarget | NodeEventEmitter): manager is EventTarget =>\n manager instanceof EventTarget;\n\ntype NodeEventListener = (...args: unknown[]) => void;\ntype EventDispatcherListener = (value: Events[Key]) => void;\n\n/**\n * Event dispatcher for both browser and server\n */\nexport class EventEmitter = Record> {\n private readonly manager: EventTarget | NodeEventEmitter;\n /**\n * This mapper serves as a helper to match the bevior of event emmiters on server to client\n */\n private readonly listenerToBrowserEventListeners: Map<(options: Events[keyof Events]) => void, EventListener> =\n new Map();\n\n constructor() {\n this.manager = isBrowser ? new EventTarget() : new NodeEventEmitter();\n }\n\n /**\n * Adds listener to instance\n */\n addListener(eventName: T, listener: EventDispatcherListener) {\n if (isEventTarget(this.manager)) {\n const customEventListener: (evt: CustomEvent) => void = (event) => {\n listener(event.detail);\n };\n const eventListener = customEventListener as EventListener;\n\n this.listenerToBrowserEventListeners.set(listener as EventDispatcherListener, eventListener);\n this.manager.addEventListener(eventName as string, eventListener);\n } else {\n // We need to override type this way\n this.manager.addListener(eventName as string, listener as NodeEventListener);\n }\n }\n\n /**\n * Removes listener from disaptcher instance\n */\n removeListener(eventName: T, listenerReference: EventDispatcherListener) {\n if (isEventTarget(this.manager)) {\n const eventListenerUnderReference = this.listenerToBrowserEventListeners.get(\n listenerReference as EventDispatcherListener,\n );\n\n if (eventListenerUnderReference) {\n this.manager.removeEventListener(eventName as string, eventListenerUnderReference);\n }\n } else {\n this.manager.removeListener(eventName as string, listenerReference as NodeEventListener);\n }\n }\n\n /**\n * Emit event on dispatcher instance\n */\n emit(eventName: T, data?: Events[T]) {\n if (isEventTarget(this.manager)) {\n this.manager.dispatchEvent(new CustomEvent(eventName as string, { detail: data }));\n } else {\n this.manager.emit(eventName as string, data);\n }\n }\n}\n","import deepmerge from 'deepmerge';\n\nimport { type LoggerConfiguration, loggerConfigurationSchema } from '../loggerConfigurationSchema';\n\nconst LOCAL_STORAGE_KEY = 'ori-logger-configuration';\n\nexport const LoggerBrowserConfiguration = {\n get() {\n const localStorageValue = window.localStorage.getItem(LOCAL_STORAGE_KEY);\n\n if (!localStorageValue) {\n return null;\n }\n\n try {\n const parsed = loggerConfigurationSchema.partial().safeParse(JSON.parse(localStorageValue));\n\n return parsed.data ?? null;\n } catch {\n return null;\n }\n },\n\n set(input: Partial) {\n const validated = loggerConfigurationSchema.parse(input);\n\n window.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(validated));\n },\n\n update(input: Partial) {\n const validated = loggerConfigurationSchema.partial().parse(input);\n const current = this.get();\n\n const mergedWithCurrent = current ? deepmerge(current, validated) : validated;\n\n window.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(mergedWithCurrent));\n },\n};\n","export function isObject(value: unknown): value is object {\n const type = typeof value;\n\n return value !== null && (type === 'object' || type === 'function');\n}\n","/* !\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(o: object) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nexport function isPlainObject(obj: object) {\n if (!isObject(obj)) {\n return false;\n }\n\n // If has modified constructor\n const { constructor } = obj;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- we want to check this\n if (constructor === undefined) {\n return true;\n }\n\n // If has modified prototype\n const prototype = constructor.prototype as object;\n if (!isObject(prototype)) {\n return false;\n }\n\n // If constructor does not have an Object-specific method\n // eslint-disable-next-line no-prototype-builtins -- we have to access isPrototypeOf with hasOwnProperty\n if (!prototype.hasOwnProperty('isPrototypeOf')) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n","import type { LoggerConfiguration } from '../loggerConfigurationSchema';\nimport { EventEmitter } from './EventEmitter';\n\n/**\n * Custom event emitter for Logger\n */\nexport const loggerEventEmitter = new EventEmitter<{\n /**\n * Event for cases when Logger global configuration is updated\n */\n configurationUpdated: LoggerConfiguration;\n /**\n * Event for cases when Logger instances should reset its internal states\n */\n reset: object;\n}>();\n","import { SeverityLevels } from '../../types/SeverityLevels';\nimport type { PinoMessage } from '../PinoMessage';\nimport type { PinoMessageWithError } from '../PinoMessageWithError';\nimport type { PinoMessageWithMetric } from '../PinoMessageWithMetric';\n\nexport type LogHandler = (message: T) => void;\n\nexport type DefinePinoLogHandlersOptions = {\n onInfo?: LogHandler;\n onWarn?: LogHandler;\n onDebug?: LogHandler;\n onMetric?: LogHandler;\n onError?: LogHandler;\n};\n\nexport const definePinoLogHandlers =\n (handlers: DefinePinoLogHandlersOptions): LogHandler =>\n (message) => {\n switch (message.level) {\n case SeverityLevels.INFO:\n handlers.onInfo?.(message);\n break;\n case SeverityLevels.METRIC:\n handlers.onMetric?.(message as PinoMessageWithMetric);\n break;\n case SeverityLevels.ERROR:\n handlers.onError?.(message as PinoMessageWithError);\n break;\n case SeverityLevels.WARN:\n handlers.onWarn?.(message);\n break;\n case SeverityLevels.DEBUG:\n handlers.onDebug?.(message);\n break;\n default:\n // eslint-disable-next-line no-console -- it's okay here\n console.warn(`Unknown message level: ${message.level}`);\n }\n };\n","/* eslint-disable @typescript-eslint/naming-convention -- thats how AI defines it */\nimport { SeverityLevel } from '@microsoft/applicationinsights-web';\nimport pinoSerializers from 'pino-std-serializers';\n\nimport { ApplicationInsights, isServerApplicationInsightsClient } from '../../application-insights';\nimport type { PinoMessage } from '../PinoMessage';\nimport { definePinoLogHandlers } from './definePinoLogHandlers';\n\n/**\n * This is error that acts as a \"copy\" of the original error as it overrides\n * its own properties with the original values\n */\nclass DeserializedError extends Error {\n constructor(name: string, message: string, stack: string) {\n super(message);\n // eslint-disable-next-line unicorn/custom-error-definition -- we want everything from the original error, including name\n this.name = name;\n this.stack = stack;\n }\n}\n\nconst getServerApplicationInsightsTagOverrides = (operation: PinoMessage['applicationInsightsOperation']) =>\n operation\n ? {\n 'ai.operation.id': operation.id,\n 'ai.operation.name': operation.name,\n 'ai.operation.parentId': operation.parentId,\n }\n : undefined;\n\nexport const pinoApplicationInsightsLogHandler = definePinoLogHandlers({\n onError(message) {\n const {\n error: serializedOrNormalError,\n time,\n msg,\n applicationInsightsOperation,\n ...otherMessageProperties\n } = message;\n const ai = ApplicationInsights.get();\n // First we need to make sure that every error is first serialized into object\n // In environment with workers this is usually done through pino, but in browser the error is as is\n const {\n type: errorName,\n message: errorMessage,\n stack: errorStack,\n cause: errorCause,\n ...otherProperties\n } = serializedOrNormalError instanceof Error\n ? pinoSerializers.errWithCause(serializedOrNormalError)\n : serializedOrNormalError;\n\n const properties = otherMessageProperties;\n\n if (Object.keys(otherProperties).length > 0) {\n // Attach otherProperties (anything than normal Error.prototype fields) as customDimensions\n // as those would be destroyed in application insights library\n properties.errorProperties = otherProperties;\n }\n\n // If error has cause we need to prepare it also. We cannot reasonably do this anything than\n // setting that cause as customDimensions data, because Application Insights do not support that\n if (errorCause) {\n const { type: causeName, message: causeMessage, stack: causeStack, ...otherCauseProperties } = errorCause;\n\n properties.cause = {\n name: causeName,\n message: causeMessage,\n // This could be enhanced with further parsing\n // just do it like in application insights library https://github.com/microsoft/ApplicationInsights-node.js/blob/b5b173648f095c8cea7dcf414521ab5b9fe12ab6/src/logs/exceptions.ts#L127\n stack: causeStack,\n ...(Object.keys(otherCauseProperties).length > 0\n ? {\n errorProperties: otherCauseProperties,\n }\n : null),\n };\n }\n\n // Lastly we create a \"copy\" of the original error for application insights\n const exception = new DeserializedError(errorName, errorMessage, errorStack);\n\n if (isServerApplicationInsightsClient(ai)) {\n ai.defaultClient.trackException({\n exception,\n time: new Date(time),\n severity: ai.Contracts.SeverityLevel.Error,\n properties,\n tagOverrides: getServerApplicationInsightsTagOverrides(applicationInsightsOperation),\n });\n } else {\n ai.trackException({\n exception,\n properties,\n });\n }\n },\n // Lets leave this on here for the future\n // onInfo(message) {\n // const ai = getApplicationInsights();\n // const { msg, time, ...otherProperties } = message;\n // const params = {\n // message: `${msg} ${Object.entries(otherProperties)\n // .map(([key, value]) => `${key}: ${JSON.stringify(value)}`)\n // .join(', ')}`,\n // properties: otherProperties,\n // };\n\n // if (isServerApplicationInsightsClient(ai)) {\n // ai.defaultClient.trackTrace({\n // ...params,\n // time: new Date(time),\n // severity: ai.Contracts.SeverityLevel.Information,\n // });\n // } else {\n // ai.trackTrace({\n // ...params,\n // severityLevel: SeverityLevel.Information,\n // });\n // }\n // },\n onMetric(message) {\n const { metricName, metricValue, time, applicationInsightsOperation, ...otherMesageProperties } = message;\n const ai = ApplicationInsights.get();\n\n if (isServerApplicationInsightsClient(ai)) {\n ai.defaultClient.trackMetric({\n name: metricName,\n value: metricValue,\n time: new Date(time),\n properties: otherMesageProperties,\n tagOverrides: getServerApplicationInsightsTagOverrides(applicationInsightsOperation),\n });\n } else {\n ai.trackMetric({\n name: metricName,\n average: metricValue,\n properties: otherMesageProperties,\n });\n }\n },\n onWarn(message) {\n const { msg = '', time, applicationInsightsOperation, ...otherProperties } = message;\n const ai = ApplicationInsights.get();\n\n if (isServerApplicationInsightsClient(ai)) {\n ai.defaultClient.trackTrace({\n message: msg,\n time: new Date(time),\n severity: ai.Contracts.SeverityLevel.Warning,\n properties: otherProperties,\n tagOverrides: getServerApplicationInsightsTagOverrides(applicationInsightsOperation),\n });\n } else {\n ai.trackTrace({\n message: msg,\n severityLevel: SeverityLevel.Warning,\n properties: otherProperties,\n });\n }\n },\n});\n","/* eslint-disable no-console -- this is console transport handler which is designed to use console */\nimport ansis, { type Ansis } from 'ansis';\n\nimport { SeverityLevels } from '../../types/SeverityLevels';\nimport { isObject } from '../isObject';\nimport { stringifyErrorObject } from '../stringifyErrorObject';\nimport { stringifyObject } from '../stringifyObject';\nimport type { LogHandler } from './definePinoLogHandlers';\n\nconst NEWLINE_CHAR = '\\r\\n';\n// @ts-expect-error -- this won't fail anything, but will be defined when on edge\nconst isInEdgeRuntime = typeof EdgeRuntime === 'string';\nconst isInNodeRuntime = !isInEdgeRuntime && typeof window === 'undefined';\nconst levelToColoretteFunctionName: Record = {\n [SeverityLevels.INFO]: ansis.blue,\n [SeverityLevels.METRIC]: ansis.green,\n [SeverityLevels.ERROR]: ansis.red,\n [SeverityLevels.WARN]: ansis.yellow,\n [SeverityLevels.DEBUG]: ansis.gray.bgWhite,\n};\n\nlet levelToConsoleMethod: Record<\n SeverityLevels,\n (typeof console)[keyof Pick]\n>;\n\nconst formatTime = (time: number) =>\n new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n fractionalSecondDigits: 3,\n hour12: false,\n }).format(new Date(time));\n\nconst logLevelToLabel = Object.fromEntries(Object.entries(SeverityLevels));\n\nexport const pinoConsoleLogHandler: LogHandler = ({ time, msg: userMessage, level, ...properties }) => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- initialized here because of tests and mocking of console methods would not apply when defined globally\n levelToConsoleMethod ??= {\n [SeverityLevels.INFO]: console.info,\n [SeverityLevels.METRIC]: console.debug,\n [SeverityLevels.ERROR]: console.error,\n [SeverityLevels.WARN]: console.warn,\n [SeverityLevels.DEBUG]: console.debug,\n };\n\n // console.log({ time, userMessage, level, properties });\n const formattedTime = `[${formatTime(time)}]`;\n let logLinePrefix = `${formattedTime} (${logLevelToLabel[level]}):`;\n\n if (isInEdgeRuntime || isInNodeRuntime) {\n logLinePrefix = levelToColoretteFunctionName[level](logLinePrefix);\n }\n\n let logLine = `${logLinePrefix} ${userMessage}`;\n\n if (Object.keys(properties).length) {\n if (isInNodeRuntime) {\n // Space to divide the metadata from the message\n logLine += ' ';\n\n // Checking that property \"error\" is an object should be enough - when copying to worker thread the error prototype is lost\n if (isObject(properties.error)) {\n const { error, ...propertiesWithoutError } = properties;\n\n logLine += ansis.dim(stringifyObject(propertiesWithoutError, undefined, true));\n logLine += NEWLINE_CHAR;\n logLine += stringifyErrorObject(error as Error);\n } else {\n // Dim metadata a little bit for the user to easily search in the logs\n logLine += ansis.dim(stringifyObject(properties, undefined, true));\n }\n } else {\n // Add newline for browser only, because of readability\n logLine += NEWLINE_CHAR;\n }\n }\n\n const logParams: unknown[] = [logLine];\n\n // In browser we want to leverage native object searching\n // which is better than printing object itself\n if (!isInEdgeRuntime && !isInNodeRuntime) {\n logParams.push(properties);\n }\n\n // Use only console.log for node, because node could create trace for that log if specific method is used.\n const logMethodForLevel = isInNodeRuntime ? console.log : levelToConsoleMethod[level];\n logMethodForLevel(...logParams);\n};\n","import { LoggerTransportType } from '../../types';\nimport type { LogHandler } from './definePinoLogHandlers';\nimport { pinoApplicationInsightsLogHandler } from './pinoApplicationInsightsLogHandler';\nimport { pinoConsoleLogHandler } from './pinoConsoleLogHandler';\n\n/** Collection of log handlers for each transport type */\nexport const pinoGroupedLogHandlers: Record = {\n [LoggerTransportType.APPLICATION_INSIGHTS]: pinoApplicationInsightsLogHandler,\n [LoggerTransportType.CONSOLE]: pinoConsoleLogHandler,\n};\n","import type { LoggerConfiguration } from '../../loggerConfigurationSchema';\nimport type { LoggerTransportType } from '../../types';\nimport type { PinoMessage } from '../PinoMessage';\n\nexport type CanRunLogHandlerOptions = {\n loggerConfiguration: LoggerConfiguration;\n pinoMessage: PinoMessage;\n transportType: LoggerTransportType;\n};\n\nexport const canRunLogHandler = ({\n loggerConfiguration,\n pinoMessage,\n transportType,\n}: CanRunLogHandlerOptions): boolean => {\n const { minimalSeverityLevel, enabled: loggingEnabled, filters = [] } = loggerConfiguration;\n\n // Entire logging disabled then just return right away\n if (!loggingEnabled) {\n return false;\n }\n\n let canRunHandler = true;\n\n for (const filter of filters) {\n const {\n enabled: shouldRunForRule,\n byName,\n byAreaName,\n byNameRegExp,\n byAreaNameRegExp,\n byMinimalSeverityLevel,\n byTransportType,\n } = filter;\n\n if (byTransportType !== undefined && byTransportType !== transportType) {\n continue;\n }\n\n const minimalSeverityLevelWithDefault = byMinimalSeverityLevel ?? minimalSeverityLevel;\n if (minimalSeverityLevelWithDefault > pinoMessage.level) {\n continue;\n }\n\n if (byName !== undefined && byName !== pinoMessage.name) {\n continue;\n }\n if (byNameRegExp !== undefined && pinoMessage.name && !byNameRegExp.test(pinoMessage.name)) {\n continue;\n }\n\n if (byAreaName !== undefined && pinoMessage.areaName && byAreaName !== pinoMessage.areaName) {\n continue;\n }\n if (byAreaNameRegExp !== undefined && pinoMessage.areaName && !byAreaNameRegExp.test(pinoMessage.areaName)) {\n continue;\n }\n\n // If some filter passes then inherit the configuration from that filter\n canRunHandler = shouldRunForRule;\n }\n\n return canRunHandler;\n};\n","import type { PinoMessage } from '../PinoMessage';\n\nexport const filterPinoMessage = (pinoMessage: PinoMessage): PinoMessage => {\n const { pid, hostname, ...otherProperties } = pinoMessage;\n\n return otherProperties;\n};\n","import { ApplicationInsights } from '../../application-insights';\nimport type { LoggerConfiguration } from '../../loggerConfigurationSchema';\nimport { LoggerTransportType } from '../../types';\nimport type { LogHandler } from '../pino-log-handlers/definePinoLogHandlers';\nimport { pinoGroupedLogHandlers } from '../pino-log-handlers/pinoGroupedLogHandlers';\nimport type { PinoRuntimeTransportOptions } from './PinoRuntimeTransportOptions';\n\n// Just checking if it could be somewhere enabled is enough to determine its usage<\nconst isTransportTypeEnabled = (transportType: LoggerTransportType, configuration: LoggerConfiguration) =>\n configuration.filters.some((filter) => filter.enabled && filter.byTransportType === transportType);\n\nexport const getEnabledLogHandlersForTransport = ({\n loggerConfiguration,\n applicationInsightsConfiguration,\n}: PinoRuntimeTransportOptions) => {\n const enabledLogHandlers = new Map();\n\n const isApplicationInsightsTransportEnabled = isTransportTypeEnabled(\n LoggerTransportType.APPLICATION_INSIGHTS,\n loggerConfiguration,\n );\n const isConsoleTransportEnabled = isTransportTypeEnabled(LoggerTransportType.CONSOLE, loggerConfiguration);\n\n // Ensure that application insights is initialized on the other worker thread as pino does not log on the main thread\n if (\n isApplicationInsightsTransportEnabled &&\n applicationInsightsConfiguration &&\n !ApplicationInsights.isInitialized()\n ) {\n global.oriAppInsightsSettings = applicationInsightsConfiguration;\n ApplicationInsights.initialize(applicationInsightsConfiguration);\n }\n\n if (isApplicationInsightsTransportEnabled && ApplicationInsights.isInitialized()) {\n enabledLogHandlers.set(\n LoggerTransportType.APPLICATION_INSIGHTS,\n pinoGroupedLogHandlers[LoggerTransportType.APPLICATION_INSIGHTS],\n );\n }\n\n // Add console log handler as fallback\n if (isConsoleTransportEnabled || enabledLogHandlers.size === 0) {\n enabledLogHandlers.set(LoggerTransportType.CONSOLE, pinoGroupedLogHandlers[LoggerTransportType.CONSOLE]);\n }\n\n return enabledLogHandlers;\n};\n","import deepmerge from 'deepmerge';\n\nimport { defaultLoggerConfiguration } from '../../constants';\nimport type { PinoMessage } from '../PinoMessage';\nimport { loggerEventEmitter } from '../loggerEventEmitter';\nimport type { PinoRuntimeTransportOptions } from './PinoRuntimeTransportOptions';\nimport { canRunLogHandler } from './canRunLogHandler';\nimport { filterPinoMessage } from './filterPinoMessage';\nimport { getEnabledLogHandlersForTransport } from './getEnabledLogHandlersForTransport';\n\nexport const pinoBrowserRuntimeTransport = (options: PinoRuntimeTransportOptions): ((message: PinoMessage) => void) => {\n let { loggerConfiguration } = options;\n let enabledLogHandlers = getEnabledLogHandlersForTransport(options);\n\n // When settings in browser change we can just reinitialize transports during runtime\n loggerEventEmitter.addListener('configurationUpdated', (updatedLoggerConfiguration) => {\n loggerConfiguration = deepmerge(defaultLoggerConfiguration, updatedLoggerConfiguration);\n\n enabledLogHandlers = getEnabledLogHandlersForTransport({\n ...options,\n loggerConfiguration,\n });\n });\n\n return (pinoMessage) => {\n // Run all enabled log handlers\n for (const [transportType, logHandler] of enabledLogHandlers) {\n const shouldSkip = !canRunLogHandler({ loggerConfiguration, pinoMessage, transportType });\n\n if (shouldSkip) {\n continue;\n }\n\n logHandler(filterPinoMessage(pinoMessage));\n }\n };\n};\n","import type { Transform } from 'node:stream';\nimport build from 'pino-abstract-transport';\n\nimport type { PinoMessage } from '../PinoMessage';\nimport type { PinoRuntimeTransportOptions } from './PinoRuntimeTransportOptions';\nimport { canRunLogHandler } from './canRunLogHandler';\nimport { filterPinoMessage } from './filterPinoMessage';\nimport { getEnabledLogHandlersForTransport } from './getEnabledLogHandlersForTransport';\n\nexport const pinoNodeRuntimeTransport = (options: PinoRuntimeTransportOptions) => {\n const enabledLogHandlers = getEnabledLogHandlersForTransport(options);\n\n // Let's just override transform for the sake of typescript\n return build(async (transform: Transform) => {\n try {\n for await (const obj of transform) {\n const pinoMessage = obj as PinoMessage;\n\n // Run all enabled log handlers\n for (const [transportType, logHandler] of enabledLogHandlers) {\n const shouldSkip = !canRunLogHandler({\n loggerConfiguration: options.loggerConfiguration,\n pinoMessage,\n transportType,\n });\n\n if (shouldSkip) {\n continue;\n }\n\n logHandler(filterPinoMessage(pinoMessage));\n }\n }\n } catch (error) {\n // eslint-disable-next-line no-console -- we cannot use\n console.error('Failed to execute log handler in defined Node.js transport', { error });\n\n throw error;\n }\n });\n};\n\nexport default pinoNodeRuntimeTransport;\n","export const printWarningWithTrace = (message: string) =>\n // eslint-disable-next-line no-console -- appropriate here\n console.trace(`☢️ WARNING:\n${message}`);\n","import ansis from 'ansis';\n\nimport { isObject } from './isObject';\n\nconst NEWLINE_CHAR = '\\r\\n';\n\nexport const stringifyErrorObject = (error: Error, leftPad = '') => {\n let result = leftPad;\n\n if (error.stack) {\n const stackLinesAsArray = error.stack.split('\\n').map((line) => ansis.dim(`${leftPad}${line}`));\n\n result += stackLinesAsArray.join(NEWLINE_CHAR);\n } else {\n // When stack is not defined then just simulate atleast its first line from name and message\n result += ansis.bold(`${error.name || 'Error'}: ${error.message}`);\n }\n\n if (isObject(error.cause)) {\n result += `${NEWLINE_CHAR}${leftPad}Cause:${NEWLINE_CHAR}`;\n result += stringifyErrorObject(error.cause as Error, leftPad);\n }\n\n return result;\n};\n","import { isObject } from './isObject';\n\n/**\n * This is just copied https://www.npmjs.com/package/stringify-object and slightly modified. All props to them.\n */\nconst { propertyIsEnumerable } = Object.prototype;\n\nconst { toString } = Object.prototype;\n\nfunction isRegexp(value: unknown): value is RegExp {\n return toString.call(value) === '[object RegExp]';\n}\n\nfunction getOwnEnumerableKeys(object: object) {\n return [\n ...Object.keys(object),\n ...Object.getOwnPropertySymbols(object).filter((key) => propertyIsEnumerable.call(object, key)),\n ];\n}\n\ntype InputValue = object | Array | string | undefined | null | symbol;\n\nexport function stringifyObject(inputValue: InputValue, leftPad = '', oneLineOnly?: boolean): string {\n const seen: InputValue[] = [];\n const indent = ' ';\n\n // eslint-disable-next-line complexity -- copied from other library\n return (function stringify(input: InputValue, pad = ''): string {\n const tokens = {\n newline: oneLineOnly ? ' ' : '\\n',\n newlineOrSpace: oneLineOnly ? ' ' : '\\n',\n pad,\n indent: oneLineOnly ? '' : pad + indent,\n };\n\n if (seen.includes(input)) {\n return '\"[Circular]\"';\n }\n\n if (typeof input === 'function') {\n return `\"[Function ${input.name || 'anonymous'}]\"`;\n }\n\n if (typeof Buffer !== 'undefined' && input instanceof Buffer) {\n return '\"[Buffer]\"';\n }\n\n if (\n input === null ||\n input === undefined ||\n typeof input === 'number' ||\n typeof input === 'boolean' ||\n typeof input === 'symbol' ||\n isRegexp(input)\n ) {\n return String(input);\n }\n\n if (input instanceof Date) {\n return `new Date('${input.toISOString()}')`;\n }\n\n if (Array.isArray(input)) {\n if (input.length === 0) {\n return '[]';\n }\n\n seen.push(input);\n\n const returnValue = `[${tokens.newline}${input\n .map((element: unknown, i: number, elements: unknown[]) => {\n const eol = elements.length - 1 === i ? tokens.newline : `,${tokens.newlineOrSpace}`;\n\n const value = stringify(element as InputValue, pad + indent);\n\n return tokens.indent + value + eol;\n })\n .join('')}${tokens.pad}]`;\n\n seen.pop();\n\n return returnValue;\n }\n\n if (isObject(input)) {\n const objectKeys = input instanceof Error ? Object.getOwnPropertyNames(input) : getOwnEnumerableKeys(input);\n\n if (objectKeys.length === 0) {\n return '{}';\n }\n\n seen.push(input);\n\n const returnValue = `{${tokens.newline}${objectKeys\n .map((element, index) => {\n const eol = objectKeys.length - 1 === index ? tokens.newline : `,${tokens.newlineOrSpace}`;\n const isSymbol = typeof element === 'symbol';\n const isClassic = !isSymbol && /^[a-z$_][$\\w]*$/i.test(element);\n const key = isSymbol || isClassic ? element : stringify(element, undefined);\n\n const value = stringify(input[element as keyof typeof input], pad + indent);\n\n return `${tokens.indent + String(key)}: ${value}${eol}`;\n })\n .join('')}${tokens.pad}}`;\n\n seen.pop();\n\n return returnValue;\n }\n\n let output: string = input.replace(/\\\\/g, '\\\\\\\\');\n output = String(output).replace(/[\\r\\n]/g, (x) => (x === '\\n' ? '\\\\n' : '\\\\r'));\n\n return `\"${output.replace(/\"/g, '\\\\\"')}\"`;\n })(inputValue, leftPad);\n}\n","import type { ApplicationInsights as ClientApplicationInsights } from '@microsoft/applicationinsights-web';\n\nimport type { LoggerMetadata } from '../../../types';\nimport type { DependencyEnvelope } from '../../../types/application-insights/DependencyEnvelope';\n\n/**\n * Creates an initializer for adding metadata to dependency telemetry events.\n *\n * @param ai - The Application Insights client instance to attach the dependency initializer to\n * @returns A function that can be called to update the metadata\n *\n * @example\n * ```typescript\n * const ai = new ApplicationInsights();\n * const updateMetadata = createMetadataDependencyInitializer(ai);\n *\n * // Later, update metadata\n * updateMetadata({ userId: '123', environment: 'prod' });\n * ```\n */\nexport const createMetadataDependencyInitializer = (ai: ClientApplicationInsights) => {\n let currentMetadata = {}; // initial metadata\n\n ai.addDependencyInitializer((envelope: DependencyEnvelope) => {\n // eslint-disable-next-line no-param-reassign -- we need to modify the envelope\n envelope.item.properties = {\n ...envelope.item.properties,\n ...currentMetadata,\n };\n\n return true;\n });\n\n // Return function to update metadata\n return (newMetadata: LoggerMetadata) => {\n currentMetadata = newMetadata;\n };\n};\n","import type { ITelemetryItem } from '@microsoft/applicationinsights-web';\n\nimport { TRACK_THIS_PAGE_VIEW } from '../../../constants';\n\nexport const pageViewInitializer = (item: ITelemetryItem) => {\n // Disable automatic `pageView` tracking to prevent `pageView` from being sent multiple times\n // when using @ori/logger multiple times on the same page, e.g. in Client Apps.\n if (item.baseType === 'PageviewData' && !item.data?.[TRACK_THIS_PAGE_VIEW]) {\n return false;\n }\n\n return true;\n};\n","import type { ITelemetryItem } from '@microsoft/applicationinsights-web';\nimport type { Contracts } from 'applicationinsights';\n\n/**\n * Creates a filter telemetry processor function that determines whether to include telemetry data\n * based on a provided filter function and a sampling function.\n *\n * @param filterFn - A function that filters telemetry envelopes based on custom criteria.\n * It should return `true` for envelopes to be sampled and `false` otherwise.\n * @param sampler - A function that determines whether to keep telemetry based on its ID.\n * It should return `true` to include telemetry and `false` to exclude it.\n * @returns A telemetry processor function that evaluates both the filter and sampling criteria.\n * @example\n * ```typescript\n * const telemetryProcessor = createFilterTelemetryProcessor(\n * (envelope) => envelope.data.baseType === 'MetricData' && ['LCP', 'CLS', 'INP'].includes(envelope.name),\n * createFixedRateSampler(10) // 10% sampling\n * );\n *\n * const shouldInclude = telemetryProcessor(envelope);\n * console.log(shouldInclude); // Logs true or false based on filter and sampling logic\n * ```\n */\nexport const createFilterTelemetryProcessor =\n (\n filterFn: (telemetryRecord: Contracts.EnvelopeTelemetry | ITelemetryItem) => boolean,\n sampler: (id: string | undefined) => boolean,\n ): ((telemetryRecord: Contracts.EnvelopeTelemetry | ITelemetryItem) => boolean) =>\n (telemetryRecord: Contracts.EnvelopeTelemetry | ITelemetryItem): boolean => {\n if (!filterFn(telemetryRecord)) {\n return true; // Keep if filter condition is not met\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- exists\n const telemetryId: string | undefined = telemetryRecord.tags?.['ai.operation.id'];\n\n return sampler(telemetryId); // Pass to the sampler\n };\n","import * as CryptoJS from 'crypto-js';\n\n/**\n * Hashes a telemetry ID and maps it to a value between 0 and 1.\n *\n * @param id - The telemetry ID to hash.\n * @returns A number between 0 and 1 based on the hash value.\n */\nconst hashTelemetryId = (id: string): number => {\n const hash = CryptoJS.SHA256(id).toString(CryptoJS.enc.Hex);\n\n return Number.parseInt(hash.slice(0, 8), 16) / 0xffffffff;\n};\n/**\n * Creates a fixed-rate sampler function to determine if telemetry should be kept\n * based on a hash of its ID and a specified sampling rate.\n *\n * @param samplingRate - Sampling rate as a percentage (e.g., 10 for 10%, 1 for 1%).\n * @returns A sampler function that takes an optional telemetry ID and returns `true` if the telemetry is kept, `false` otherwise.\n */\nexport const createFixedRateSampler = (percentage: number): ((id: string | undefined) => boolean) => {\n // Convert percentage to a decimal sampling rate\n const samplingRate = percentage / 100;\n\n /**\n * Sampler function to decide whether to include telemetry based on its ID.\n *\n * @param id - The telemetry ID (e.g., operation ID or custom data ID). If `undefined`, a random fallback is used.\n * @returns `true` if the telemetry should be kept, `false` otherwise.\n */\n return (id: string | undefined): boolean => {\n if (!id) {\n return Math.random() < samplingRate; // Fallback for missing IDs\n }\n\n const hashValue = hashTelemetryId(id);\n\n return hashValue < samplingRate; // Include if hash value is within the sampling rate\n };\n};\n","/* eslint-disable no-param-reassign -- We want to adress envelope directly, because it is a reference to data sent to AI */\nimport type { TelemetryContext } from '../../../types/application-insights/TelemetryContext';\nimport type { TelemetryEnvelope } from '../../../types/application-insights/TelemetryEnvelope';\n\nexport const enhanceDependencyDataProcessor = (envelope: TelemetryEnvelope, context?: TelemetryContext) => {\n if (envelope.data.baseType !== 'RemoteDependencyData') {\n return true;\n }\n\n const customProps = context?.correlationContext?.customProperties.props;\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- Optional chaining is not equevalent to the check below\n if (!customProps || !customProps.length) {\n return true;\n }\n\n // Transform array of key-value pairs into a flat object\n const flattenedProps = Object.fromEntries(customProps.map((property) => [property.key, property.value]));\n\n // Add to dependency properties\n if (Object.keys(flattenedProps).length === 0) {\n return true;\n }\n\n envelope.data.baseData = {\n ...envelope.data.baseData,\n properties: {\n ...envelope.data.baseData?.properties,\n ...flattenedProps,\n },\n };\n\n return true;\n};\n","import type { Contracts } from 'applicationinsights';\n\ninterface CustomBase {\n baseType: string;\n baseData?: {\n name: string;\n properties?: {\n url?: string;\n };\n };\n}\n\nexport const excludeHealthProbesTelemetryProcessor = (envelope: Contracts.Envelope) => {\n const data = envelope.data as CustomBase;\n\n if (data.baseType === 'RequestData' && data.baseData?.name.startsWith('GET /health/')) {\n return false;\n }\n\n if (data.baseType === 'RemoteDependencyData' && data.baseData?.properties?.url?.startsWith('/health/')) {\n return false;\n }\n\n return true;\n};\n","import type { Contracts } from 'applicationinsights';\n\n/**\n * Excludes Next.js telemetry from the given envelope.\n *\n * @param envelope The telemetry envelope to process.\n * @returns A boolean indicating whether the telemetry should be excluded.\n */\nexport const excludeNextjsTelemetryProcessor = (envelope: Contracts.EnvelopeTelemetry) => {\n // Next.js telemetry always contains this property\n if ('next.span_type' in (envelope.data.baseData?.properties as { [key: string]: string })) {\n return false;\n }\n\n return true;\n};\n","import { z } from 'zod';\n\nimport { LoggerTransportType } from './types/LoggerTransportType';\nimport { SeverityLevels } from './types/SeverityLevels';\n\nconst zodRegexOrRegexpLikeString = z\n .custom((data) => {\n if (!data) {\n return false;\n }\n\n const hasValidData = data instanceof RegExp || typeof data === 'string';\n\n return hasValidData ? data : undefined;\n })\n .transform((value) => (typeof value === 'string' ? new RegExp(value, 'i') : value));\n\nconst severityLevelKeys = Object.keys(SeverityLevels).filter((value) => !/\\d+/.test(value));\nconst severityLevelValues = Object.values(SeverityLevels).filter((value) => typeof value === 'number');\n\nconst allowedSeverityOptions = new Set([\n ...severityLevelValues,\n ...severityLevelKeys,\n ...severityLevelKeys.map((value) => value.toLowerCase()),\n]);\n/** This allows severityLevel to be either in number, UPPER_CASE or lowercase */\nconst zodCoerceSeverityLevel = z\n .custom((value) => {\n if (!value) {\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- type is not important here\n return allowedSeverityOptions.has(value);\n })\n .transform((value) =>\n typeof value === 'number' ? value : SeverityLevels[value.toUpperCase() as keyof typeof SeverityLevels],\n );\n\nexport type RegExpLikeString = z.input;\n\nconst loggerConfigurationFilterSchema = z.object({\n /**\n * Logger name exact match filter\n */\n byName: z.string().optional(),\n /**\n * Logger area name exact match filter\n */\n byAreaName: z.string().optional(),\n /**\n * Logger regexp name filter. It can be RegExp or string that will be converted to RegExp\n */\n byNameRegExp: zodRegexOrRegexpLikeString.optional(),\n /**\n * Logger regexp area name filter. It can be RegExp or string that will be converted to RegExp\n */\n byAreaNameRegExp: zodRegexOrRegexpLikeString.optional(),\n /**\n * Logger transport type filter\n */\n byTransportType: z.nativeEnum(LoggerTransportType).optional(),\n /** Minimal severity level type filter */\n byMinimalSeverityLevel: zodCoerceSeverityLevel.optional(),\n /** If current group has enabled logging, if false then logging is disabled for matches */\n enabled: z.coerce.boolean(),\n});\n\n// IMPORTANT: Default values are defined in constants.ts, this schema does not enforce it.\n// Enforcing is crutial for merging configurations (Node.js->browser for example)\nexport const loggerConfigurationSchema = z.object({\n /**\n * Controls if logging is enabled globally. If false then nothing is logged and filters are ignored!\n * @default true\n */\n enabled: z.coerce.boolean().optional(),\n\n /**\n * Controls default minimal severity levels for logging. Can be overriden with filters array\n * @default process.env.NODE_ENV === 'production' ? SeverityLevels.METRIC : SeverityLevels.DEBUG\n */\n minimalSeverityLevel: zodCoerceSeverityLevel.optional(),\n\n /** Rule groups. These groups have their own filters and if they match then specific configurations are applied. Last to match is applied */\n filters: z.array(loggerConfigurationFilterSchema).optional().default([]),\n});\n\nexport type LoggerConfiguration = Required>;\n/** Input type for the {@link LoggerConfiguration} type */\nexport type LoggerConfigurationInput = z.input;\n","/**\n * This function allows to decorate an arbitrary function and measure its execution time.\n *\n * @example\n *\n * #### With promise as function to be measured\n *\n * ```js\n * const fnc = async () => fetch('https://dk.oriflame.com')\n * .then((res) => res.json())\n * const { result, duration } = await measureFunctionDuration(fnc)()\n * ```\n *\n * #### Without promise as function to be measured\n * ```js\n * const fnc = () => {\n * console.log('Doing something that may take a lot of resources!');\n * }\n * const { result, duration } = await measureFunctionDuration(fnc)()\n * ```\n */\nexport function measureFunctionDuration<\n FN extends (...args: unknown[]) => Promise | unknown,\n Result = Awaited>,\n>(\n /**\n * Function to be measured, can be sync or async\n */\n fn: FN,\n) {\n return async (\n ...args: Parameters\n ): Promise<{\n result: Result;\n duration: number;\n }> => {\n const t0 = performance.now();\n const result = (await Promise.resolve(fn(...args))) as Result;\n const t1 = performance.now();\n\n return {\n result,\n duration: t1 - t0,\n };\n };\n}\n","import { AppInsightsContext, ReactPlugin } from '@microsoft/applicationinsights-react-js';\nimport { useEffect, useState, type FC, type PropsWithChildren } from 'react';\n\nimport { getApplicationInsightsReactPlugin, ApplicationInsights } from '../application-insights';\n\n// TODO: Do not expose this and instead call this inside logger context?\nexport const AppInsightsProvider: FC = ({ children }) => {\n const [appInsights, setAppInsights] = useState<{ reactPlugin: ReactPlugin }>({ reactPlugin: new ReactPlugin() });\n\n useEffect(() => {\n if (ApplicationInsights.isInitialized()) {\n setAppInsights({ reactPlugin: getApplicationInsightsReactPlugin() });\n } else {\n // This could happen and we want to cover this case\n const { remove: removeListener } = ApplicationInsights.onInitialized(() => {\n setAppInsights({ reactPlugin: getApplicationInsightsReactPlugin() });\n });\n\n return () => {\n removeListener();\n };\n }\n\n return () => {};\n }, []);\n\n return {children};\n};\n","import type { FC, ReactNode } from 'react';\nimport { useContext, useMemo } from 'react';\n\nimport type { ChildLogger } from '../types';\nimport type { InternalErrorBoundaryFallback } from './internal/InternalErrorBoundary';\nimport { InternalErrorBoundary } from './internal/InternalErrorBoundary';\nimport { loggerContext } from './loggerContext';\n\nexport interface ErrorBoundaryPropsWithLogger {\n children?: ReactNode;\n logger: ChildLogger;\n fallback?: InternalErrorBoundaryFallback;\n}\nexport interface ErrorBoundaryPropsWithName {\n children?: ReactNode;\n areaName: string;\n fallback?: InternalErrorBoundaryFallback;\n}\nexport type ErrorBoundaryProps = ErrorBoundaryPropsWithLogger | ErrorBoundaryPropsWithName;\n\n/**\n * ErrorBoundary component that wraps around the provided children and handles any errors that occur within it.\n * It uses a logger to log the errors to Application Insights and provides a fallback UI in case of an error.\n * It will try to detect the logger from the context if no logger is provided in the parameters.\n *\n * @param {ReactNode} fallback The fallback to be displayed in case of an error - can be a component, or a function returning a component.\n * @param {string} areaName The name of the area for which the logger is created.\n * @param {ChildLogger} logger The logger instance to be used for logging errors.\n * @returns {JSX.Element} The rendered ErrorBoundary component.\n * @throws If no logger was provided in the parameters or detected in the context.\n */\n\nexport const ErrorBoundary: FC = ({ children, fallback, ...rest }) => {\n const areaName = 'areaName' in rest ? rest.areaName : undefined;\n const paramLogger = 'logger' in rest ? rest.logger : undefined;\n const parentLogger = useContext(loggerContext);\n\n const logger = useMemo(() => {\n if (paramLogger) {\n return paramLogger;\n }\n\n if (areaName && parentLogger) {\n return parentLogger.createChild(areaName);\n }\n\n throw new Error('No logger was provided in the parameters or detected in the context');\n }, [paramLogger, areaName, parentLogger]);\n\n return (\n \n {children}\n \n );\n};\n","import type { PropsWithChildren, FC } from 'react';\n\nimport type { Logger } from '../Logger';\nimport { loggerContext } from './loggerContext';\n\nexport interface LoggerContextProviderProps {\n logger: Logger | null;\n}\n\n/**\n * Provides a logger instance to React components.\n *\n * @param props LoggerContextProviderProps\n */\nexport const LoggerProvider: FC> = ({ children, logger }) => (\n {children}\n);\n","export * from './AppInsightsProvider';\nexport * from './ErrorBoundary';\nexport * from './LoggerProvider';\nexport * from './useLogger';\n","import type { ErrorInfo, ReactNode } from 'react';\nimport { Component } from 'react';\n\nimport type { ChildLogger } from '../../types';\n\nexport type InternalErrorBoundaryFallback =\n | ReactNode\n | ((props: InternalErrorBoundaryLogProps) => ReactNode);\n\nexport interface InternalErrorBoundaryLogProps {\n error?: E | undefined;\n errorInfo?: ErrorInfo | undefined;\n}\n\nexport interface InternalErrorBoundaryProps {\n children: ReactNode;\n fallback?: InternalErrorBoundaryFallback;\n logger: ChildLogger;\n}\n\nexport type InternalErrorBoundaryState = Partial>;\n\n/**\n * Represents an internal error boundary component.\n *\n */\nexport class InternalErrorBoundary extends Component<\n InternalErrorBoundaryProps,\n InternalErrorBoundaryState\n> {\n override state: InternalErrorBoundaryState = { error: undefined, errorInfo: undefined };\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n override componentDidCatch(error: E, errorInfo: ErrorInfo) {\n const { logger } = this.props;\n this.setState({ errorInfo });\n\n logger.error(new Error('ErrorBoundary', { cause: error }), {\n ...errorInfo,\n });\n }\n\n override render() {\n const { error, errorInfo } = this.state;\n const { children, fallback } = this.props;\n\n if (error) {\n if (typeof fallback === 'function') {\n return fallback({ error, errorInfo }) ?? null;\n }\n\n return fallback ?? null;\n }\n\n return children;\n }\n}\n","import React from 'react';\n\nimport type { Logger } from '../Logger';\n\nexport const loggerContext = React.createContext(null);\n","import { useContext, useMemo } from 'react';\n\nimport { type LoggerConstructorOptions } from '../Logger';\nimport type { ChildLogger } from '../types/ChildLogger';\nimport { loggerContext } from './loggerContext';\n\n/**\n * Creates a child Logger from parent logger and lets you use it\n *\n * @example\n *\n * #### Use just parent Logger\n * ```js\n * import { Logger, LoggerProvider, useLogger } from '@ori/logger';\n *\n * const appLogger = new Logger('@ori/custom');\n *\n * // Provide Logger with provider\n * const ParentComponent = () => \n *\n * const Component = () => {\n * // This lets you subscribe to logger in React world\n * const myLogger = useLogger()\n * // ...\n * }\n * ```\n *\n * #### Use child Logger from parent logger in React world\n * ```js\n * import { Logger, LoggerProvider, useLogger } from '@ori/logger';\n *\n * const appLogger = new Logger('@ori/custom');\n *\n * // Provide Logger with provider\n * const ParentComponent = () => \n *\n * const Component = () => {\n * // This lets you create child logger which just lives in this component\n * const myLogger = useLogger('my part')\n * // ...\n * }\n * ```\n */\nexport const useLogger = (\n /**\n * Area name that this logger logs for\n */\n areaName: LoggerConstructorOptions[0],\n /**\n * Provided metadata that are included in each logged message\n */\n metadata?: LoggerConstructorOptions[1],\n): ChildLogger => {\n const parentLogger = useContext(loggerContext);\n\n if (!parentLogger) {\n throw new Error('No logger has been provided with LoggerProvider in react tree');\n }\n\n const childLogger = useMemo(() => parentLogger.createChild(areaName, metadata), [parentLogger, areaName, metadata]);\n\n return childLogger;\n};\n","import { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { LoggerMetadata } from '../types/LoggerMetadata';\n\n/**\n * Instance of AsyncLocalStorage for usage with LoggerMetadata.\n */\nexport const asyncLocalStorage = new AsyncLocalStorage();\n","export enum LoggerTransportType {\n CONSOLE = 'console',\n APPLICATION_INSIGHTS = 'applicationInsights',\n}\n","/**\n * Custom set of severity levels that fits our implementation. Based on PINOs underlying logic\n *\n * See more at https://github.com/pinojs/pino/blob/master/docs/api.md#loggerlevel-string-gettersetter\n */\nexport enum SeverityLevels {\n /**\n * The least important of all message levels. Will be ommited during production\n */\n DEBUG = 5,\n /**\n * Serves as a proxy to debug level and behaves the same\n */\n INFO = 10,\n /**\n * Serves as tracking level for application events and their time to finish\n */\n METRIC = 15,\n /**\n * Warns about non breaking important events\n */\n WARN = 40,\n /**\n * Serves as level that notifies about critial events that\n * happened in application and most likely broke something\n */\n ERROR = 50,\n}\n","/**\n * A subclass of `Error` that indicates the failure of an assertion.\n */\nexport class AssertionError extends Error {\n /**\n * @param message Message added to the default error message\n */\n constructor(message?: string) {\n super(`Wrong assertion encountered${message ? `: \"${message}\"` : ''}!`);\n\n this.name = 'AssertionError';\n }\n}\n\n/**\n * Function that throws {@linkcode AssertionError} (with optional message defined with `errorMessage`) if\n * `condition` is falsy.\n * You can use it to narrow types:\n *\n * ```TypeScript\n * interface Foo {\n * kind: 'Foo';\n * }\n *\n * interface Bar {\n * kind: 'Bar';\n * }\n *\n * declare const foobar: Foo | Bar;\n *\n * assert(is(foobar, foobar.kind === 'Foo'));\n *\n * // `typeof foobar` is now `Foo`\n * ```\n *\n * @param condition Condition we're asserting isn't falsy\n * @param errorMessage Message for the `AssertionError`\n */\nexport function assert(condition: unknown, errorMessage?: string): asserts condition {\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions -- we don't mind here\n if (!condition) {\n throw new AssertionError(errorMessage);\n }\n}\n","/**\n * Generic type guard. If `isMatched` is `true`, TypeScript assumes `value` is of type `T`.\n * You can use it to narrow types:\n *\n * ```TypeScript\n * interface Foo {\n * kind: 'Foo';\n * }\n *\n * interface Bar {\n * kind: 'Bar';\n * }\n *\n * declare const foobar: Foo | Bar;\n *\n * if (is(foobar, foobar.kind === 'Foo')) {\n * // `typeof foobar` is now `Foo`\n * } else {\n * // `typeof foobar` is now `Bar`\n * }\n * ```\n *\n * @typeParam T Potential type of `value`\n * @param value Value being checked\n * @param isMatched Specifies if `value` is of type `T`\n * @return Value of `isMatched`\n */\nexport function is(value: unknown, isMatched: boolean): value is T {\n return isMatched;\n}\n","/**\n * Type guard that checks if variable isn't `null` or `undefined`:\n *\n * ```TypeScript\n * declare const foobar: string | null;\n *\n * if (isNonNullable(foobar)) {\n * // `typeof foobar` is now `string`\n * } else {\n * // `typeof foobar` is now `null`\n * }\n * ```\n *\n * @typeParam T Type of `value`\n * @param value Value being checked\n * @return `true` if `value` is non-nullable\n */\nexport function isNonNullable(value: T): value is NonNullable {\n return value !== undefined && value !== null;\n}\n","let{defineProperty:e,setPrototypeOf:t,create:r,keys:n}=Object,l=\"\",{round:s,max:i}=Math,o=e=>{let[,t]=/([a-f\\d]{3,6})/i.exec(e)||[],r=t?t.length:0;if(3===r)t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2];else if(6^r)return[0,0,0];let n=parseInt(t,16);return[n>>16&255,n>>8&255,255&n]},a=(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:s((e-8)/247*24)+232:16+36*s(e/51)+6*s(t/51)+s(r/51),c=e=>{let t,r,n,l,o;return e<8?30+e:e<16?e-8+90:(e>=232?t=r=n=(10*(e-232)+8)/255:(o=(e-=16)%36,t=(e/36|0)/5,r=(o/6|0)/5,n=o%6/5),l=2*i(t,r,n),l?30+(s(n)<<2|s(r)<<1|s(t))+(2^l?0:60):30)},u=(()=>{let e=e=>i.some((t=>e.test(t))),t=globalThis,r=t.Deno,l=!!r,s=t.process||r||{},i=s.argv||s.args||[],o=s.env||{},a=-1;if(l)try{o=o.toObject()}catch(e){a=0}let c=!!o.PM2_HOME&&!!o.pm_id||o.NEXT_RUNTIME?.includes(\"edge\")||(l?r.isatty(1):!!s.stdout?.isTTY),u=\"FORCE_COLOR\",p=o[u],g=parseInt(p),d=isNaN(g)?\"false\"===p?0:-1:g,f=u in o&&d||e(/^-{1,2}color=?(true|always)?$/);return f&&(a=d),a<0&&(a=((e,t,r)=>{let l=e.TERM,s=\",\"+n(e).join(\",\");return{\"24bit\":3,truecolor:3,ansi256:2,ansi:1}[e.COLORTERM]||(e.TF_BUILD?1:/,TEAMCI/.test(s)?2:e.CI?/,GIT(HUB|EA)/.test(s)?3:1:!t||/-mono|dumb/i.test(l)?0:r||/term-(kit|dir)/.test(l)?3:/-256/.test(l)?2:/scr|xterm|tty|ansi|color|[nm]ux|vt|cyg/.test(l)?1:3)})(o,c,\"win32\"===(l?r.build.os:s.platform))),!d||o.NO_COLOR||e(/^-{1,2}(no-color|color=(false|never))$/)?0:f&&!a||t.window?.chrome?3:a})(),p=u>0,g={open:l,close:l},d=p?(e,t)=>({open:`\u001b[${e}m`,close:`\u001b[${t}m`}):()=>g,f=39,b=49,_=(e,t)=>(r,n,l)=>d(((e,t,r)=>c(a(e,t,r)))(r,n,l)+e,t),m=e=>(t,r,n)=>e(a(t,r,n)),y=e=>t=>e(...o(t)),h=(e,t,r)=>d(`38;2;${e};${t};${r}`,f),O=(e,t,r)=>d(`48;2;${e};${t};${r}`,b),$=e=>d(`38;5;${e}`,f),x=e=>d(`48;5;${e}`,b);2===u?(h=m($),O=m(x)):1===u&&(h=_(0,f),O=_(10,b),$=e=>d(c(e),f),x=e=>d(c(e)+10,b));let T,w={ansi256:$,bgAnsi256:x,fg:$,bg:x,rgb:h,bgRgb:O,hex:y(h),bgHex:y(O),visible:g,reset:d(0,0),bold:d(1,22),dim:d(2,22),italic:d(3,23),underline:d(4,24),inverse:d(7,27),hidden:d(8,28)},R=\"Bright\",E=30;\"black,red,green,yellow,blue,magenta,cyan,white\".split(\",\").map((e=>{T=\"bg\"+e[0].toUpperCase()+e.slice(1),w[e]=d(E,f),w[e+R]=d(60+E,f),w[T]=d(E+10,b),w[T+R]=d(70+E++,b)})),w.grey=w.gray=d(90,f),w.bgGrey=w.bgGray=d(100,b),w.strikethrough=w.strike=d(9,29);let v,C={},I=({_p:e},{open:r,close:n})=>{let s=(e,...t)=>{if(!e){if(r&&r===n)return r;if(null==e||l===e)return l}let i=e.raw?String.raw(e,...t).replace(/\\\\n/g,\"\\n\"):l+e,o=s._p,{_a:a,_b:c}=o;if(i.includes(\"\u001b\"))for(;o;){let e,t=o.close,r=o.open,n=t.length,s=l,a=0;if(n){for(;~(e=i.indexOf(t,a));a=e+n)s+=i.slice(a,e)+r;i=s+i.slice(a)}o=o._p}return i.includes(\"\\n\")&&(i=i.replace(/(\\r?\\n)/g,c+\"$1\"+a)),a+i+c},i=r,o=n;return e&&(i=e._a+r,o=n+e._b),t(s,v),s._p={open:r,close:n,_a:i,_b:o,_p:e},s.open=i,s.close=o,s};const M=function(){let n={Ansis:M,isSupported:()=>p,strip:e=>e.replace(/[\u001b›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,l),extend(l){for(let t in l){let r=l[t],n=(typeof r)[0],s=\"s\"===n?h(...o(r)):r;C[t]=\"f\"===n?{get(){return(...e)=>I(this,r(...e))}}:{get(){let r=I(this,s);return e(this,t,{value:r}),r}}}return v=r({},C),t(n,v),n}};return n.extend(w)},k=new M;module.exports=k,k.default=k;\n","//(c)2024, MIT Style License \r\n//it is recommended to directly link to this file because we update the detection code\r\n\"use strict\";\r\n\r\nvar $bu_= new function() {\r\n var s=this;\r\n this.version=\"3.3.55npm\";\r\n this.vsakt = {c:\"130\",f:\"131\",s:\"17.6\",e:\"130\",i:\"12\",ios:\"17.6\",samsung:\"27\",o:\"114\",e_a:\"129\",o_a:\"84\",y:\"24.7.8\",v:\"6.9\",uc:\"13.7.8\"};\r\n //severely insecure below(!) this version, insecure means remote code execution that is actively being exploited\r\n this.vsinsecure_below = {c:\"126\",f:\"126\",s:\"11.1.1\",e:\"119\",i:11,ios:\"16.5\",samsung:12.0,o:62,o_a:78,y:\"20\",v:\"6.0\",uc:\"13.4\"};\r\n this.vsdefault = {c:-3,f:-3,s:-2,e:17,i:11,ios:12,samsung:-3,o:-3,o_a:-3,y:-1,v:-1,uc:-0.2,a:535};\r\n this.names={c:\"Chrome\",f:'Firefox',s:'Safari',e:\"Edge\",i:'Internet Explorer',ios:\"iOS\",samsung:\"Samsung Internet\",o:'Opera',o_a:'Opera', e_a:\"Edge\", y:\"Yandex Browser\",v:\"Vivaldi\",uc:\"UC Browser\",a:\"Android Browser\",x:\"Other\",silk:\"Silk\"};\r\n\r\n this.get_browser = function(ua) {\r\n var n,ua=(ua||navigator.userAgent).replace(\"_\",\".\"),r={n:\"x\",v:0,t:\"other browser\",age_years:undefined,no_device_update:false,available:s.vsakt};\r\n function ignore(reason,pattern){if (new RegExp(pattern,\"i\").test(ua)) return reason;return false}\r\n r.other=ignore(\"bot\",\"Pagespeed|pingdom|Preview|ktxn|dynatrace|Ruxit|PhantomJS|Headless|Lighthouse|bot|spider|archiver|transcoder|crawl|checker|monitoring|prerender|screenshot|python-|php|uptime|validator|fetcher|facebook|slurp|google|yahoo|node|mail.ru|github|cloudflare|addthis|thumb|proxy|feed|fetch|favicon|link|http|scrape|seo|page|search console|AOLBuild|Teoma|Expeditor\")||\r\n ignore(\"TV\",\"SMART-TV|SmartTV\") ||\r\n ignore(\"niche browser\",\"motorola edge|Comodo.Dragon|OculusBrowser|Falkon|Brave|Classic Browser|Dorado|LBBROWSER|Focus|waterfox|Firefox/56.2|Firefox/56.3|Whale|MIDP|k-meleon|sparrow|wii|Chromium|Puffin|Opera Mini|maxthon|maxton|dolfin|dolphin|seamonkey|opera mini|netfront|moblin|maemo|arora|kazehakase|epiphany|konqueror|rekonq|symbian|webos|PaleMoon|Basilisk|QupZilla|Otter|Midori|qutebrowser|slimjet\") ||\r\n ignore(\"mobile without upgrade path or landing page\",\"OPR/44.12.2246|cros|kindle|tizen|silk|blackberry|bb10|RIM|PlayBook|meego|nokia|ucweb|ZuneWP7|537.85.10\");\r\n// ignore(\"android(chrome) web view\",\"; wv\");\r\n r.embedded=/\"QtWebEngine|Teams|Electron/i.test(ua);\r\n r.mobile=(/iphone|ipod|ipad|android|mobile|phone|ios|iemobile/i.test(ua));\r\n r.discontinued=(/netscape|greenbrowser|camino|flot|fennec|galeon|coolnovo/i.test(ua));\r\n\r\n var pats=[\r\n [\"CriOS.VV\",\"c\",'ios'],\r\n [\"FxiOS.VV\",\"f\",'ios'],\r\n [\"Trident.*rv:VV\",\"i\",'i'],\r\n [\"Trident.VV\",\"i\",'i'],\r\n [\"UCBrowser.VV\",\"uc\",'c'],\r\n [\"MSIE.VV\",\"i\",'i'],\r\n [\"Edge.VV\",\"e\",'e'],\r\n [\"Edg.VV\",\"e\",'c'],\r\n [\"EdgA.VV\",\"e_a\",'c'],\r\n [\"Vivaldi.VV\",\"v\",'c'],\r\n [\"Android.*OPR.VV\",\"o_a\",'c'],\r\n [\"OPR.VV\",\"o\",'c'],\r\n [\"YaBrowser.VV\",\"y\",'c'],\r\n [\"SamsungBrowser.VV\",\"samsung\",'c'],\r\n [\"Silk.VV\",\"silk\",'c'],\r\n [\"Chrome.VV\",\"c\",'c'],\r\n [\"Firefox.VV\",\"f\",'f'],\r\n [\" OS.VV.*Safari\",\"ios\",'ios'],\r\n [\"Version.VV.*Safari\",\"s\",'s'],\r\n [\"Safari.VV\",\"s\",'s'],\r\n [\"Opera.*Version.VV\",\"o\"],\r\n [\"Opera.VV\",\"o\"]\r\n ];\r\n var VV=\"(\\\\d+\\\\.?\\\\d+\\\\.?\\\\d*\\\\.?\\\\d*)\";\r\n for (var i=0; i < pats.length; i++) {\r\n if (ua.match(new RegExp(pats[i][0].replace(\"VV\",VV),\"i\"))) {\r\n r.n=pats[i][1];\r\n r.engine=pats[i][2];\r\n break;\r\n } \r\n }\r\n r.fullv=RegExp.$1;\r\n r.v=parseFloat(r.fullv);\r\n\r\n // Special treatment of some systems\r\n //do not notify old systems since there is no up-to-date browser available\r\n if (/windows.nt.5|windows.nt.4|windows.nt.6.0|windows.95|windows.98|os x 10.2|os x 10.3|os x 10.4|os x 10.5/i.test(ua)) {\r\n r.no_device_update=true;\r\n r.available={}\r\n }\r\n //Safari on iOS 13 in Desktop mode\r\n if (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) {\r\n r.n=\"ios\";\r\n r.engine='ios';\r\n r.fullv=r.v=13;\r\n r.no_device_update=true;//For now, never show a message, TODO!\r\n }\r\n //iOS\r\n if (/iphone|ipod|ipad|ios/i.test(ua)) {\r\n ua.match(new RegExp(\"OS.\"+VV,\"i\"));\r\n r.n=\"ios\";\r\n r.fullv=RegExp.$1;\r\n r.v=parseFloat(r.fullv);\r\n r.engine='ios';\r\n var av=s.available_ios(ua,r.v);\r\n /*\r\n var newmap={10:\"10.3.4\",11:\"12.4.3\",12:\"12.4.3\",13:s.vsakt[\"ios\"]};\r\n if (av in newmap)\r\n av=newmap[av];\r\n */\r\n if (av < 12 && Math.round(r.v)===11)// all devices with ios 11 support ios 12\r\n av=12\r\n r.available = {\"ios\": av};\r\n if (parseFloat(r.available.ios)<15)\r\n r.no_device_update=true;\r\n }\r\n //winxp/vista/2003\r\n if (/windows.nt.5.1|windows.nt.5.2|windows.nt.6.0/i.test(ua)) {\r\n r.available={\"c\":49.9,\"f\":52.9}\r\n r.no_device_update=true;\r\n }\r\n //old mac\r\n if (/os x 10.6/i.test(ua)) {\r\n r.available = {\"s\": \"5.1.10\", \"c\": 49.9, \"f\": 48}\r\n r.no_device_update=true;\r\n }\r\n\r\n if (/os x 10.7|os x 10.8/i.test(ua)) {\r\n r.available = {\"s\": \"6.2.8\", \"c\": 49.9, \"f\": 48}\r\n r.no_device_update=true;\r\n }\r\n if (/os x 10.9/i.test(ua))\r\n r.available.s=\"9.1.3\"\r\n\r\n if (/os x 10.10/i.test(ua))\r\n r.available.s=\"10.1.2\"\r\n\r\n //check for android stock browser\r\n if (ua.indexOf('Android')>-1 && r.n===\"s\") {\r\n var v=parseInt((/WebKit\\/([0-9]+)/i.exec(ua) || 0)[1],10) || 2000;\r\n if (v <= 534) {\r\n r.n=\"a\";\r\n r.fullv=r.v=v;\r\n r.is_insecure=true;\r\n }\r\n }\r\n\r\n r.t=s.names[r.n]+\" \"+r.v;\r\n r.is_supported=r.is_latest= !s.vsakt[r.n] ? undefined : s.less(r.fullv,s.vsakt[r.n])<=0;\r\n \r\n r.vmaj=Math.round(r.v);\r\n\r\n r.is_insecure= r.is_insecure|| !s.vsinsecure_below[r.n] ? undefined : s.less(r.fullv,s.vsinsecure_below[r.n])===1;\r\n \r\n if ((r.n===\"f\" && (r.vmaj===115 || r.vmaj===128)) || (r.n===\"c\" && (r.vmaj===120))) {\r\n r.is_supported=true;\r\n r.is_insecure=false;\r\n if (r.n===\"f\")\r\n r.esr=true;\r\n }\r\n \r\n if (r.n===\"ios\" && r.v>=15)\r\n r.is_supported=true;\r\n if (r.n===\"a\" || r.n===\"x\")\r\n r.t=s.names[r.n];\r\n if (r.n===\"e\") {\r\n r.t = s.names[r.n] + \" \" + r.vmaj;\r\n r.is_supported = s.less(r.fullv, \"18.15063\") != 1\r\n }\r\n if (r.n in [\"c\",\"f\",\"o\",\"e\"] && s.less(r.fullv,parseFloat(s.vsakt[r.n])-1)<=0)\r\n r.is_supported=true; //mark also the version before the current version as supported to make the transitions smoother\r\n\r\n var releases_per_year={'f':7,'c':8,'o':8,'i':1,'e':1,'s':1}//,'v':1}\r\n if (releases_per_year[r.n]) {\r\n r.age_years=Math.round(((s.vsakt[r.n]-r.v)/releases_per_year[r.n])*10)/10 || 0\r\n }\r\n var engines={e:\"Edge.VV\",c:\"Chrome.VV\",f:\"Firefox.VV\",s:\"Version.VV\",i:\"MSIE.VV\",\"ios\":\" OS.VV\"}\r\n if (r.engine) {\r\n ua.match(new RegExp(engines[r.engine].replace(\"VV\",VV),\"i\"))\r\n r.engine_version=parseFloat(RegExp.$1)\r\n } \r\n return r\r\n}\r\nthis.semver = function(vstr) {\r\n if (vstr instanceof Array)\r\n return vstr\r\n var x = (vstr+(\".0.0.0\")).split('.')\r\n return [parseInt(x[0]) || 0, parseInt(x[1]) || 0, parseInt(x[2]) || 0, parseInt(x[3]) || 0]\r\n}\r\nthis.less= function(v1,v2) {\r\n //semantic version comparison: returns 1 if v1v2\r\n v1=s.semver(v1)\r\n v2=s.semver(v2)\r\n for (var i=0; ;i++) {\r\n if (i>=v1.length) return i>=v2.length ? 0 : 1;\r\n if (i>=v2.length) return -1;\r\n var diff = v2[i]-v1[i]\r\n if (diff) return diff>0 ? 1 : -1;\r\n }\r\n}\r\nthis.available_ios=function(ua,v) {\r\n //https://support.apple.com/de-de/guide/iphone/iphe3fa5df43/ios\r\n var h = Math.max(window.screen.height, window.screen.width),pr = window.devicePixelRatio\r\n if (/ipad/i.test(ua)) {\r\n if (h == 1024 && pr == 2) // iPad 3 (iOS 9), 4, 5, Mini 2, Mini 3, Mini 4, Air, Air 2, Pro 9.7\r\n return 10//? only ipad 4 has ios 10, all other can have ios 11\r\n if (h == 1112)// iPad Pro 10.5\r\n return 15;\r\n if (h == 1366)//iPad Pro 12.9, Pro 12.9 (2nd Gen)\r\n return 15\r\n if (h == 1024 && v < 6)\r\n return 5 // iPad\r\n return 9 // iPad 2, iPad Mini\r\n }\r\n if (pr == 1)// 1/3G/3GS\r\n return 6//for 3GS\r\n if (pr == 3)\r\n return 15\r\n if (h == 812)// X\r\n return 15\r\n if ((h == 736 || h == 667))// && pr == 3)// 6+/6s+/7+ and 8+ or // 6+/6s+/7+ and 8+ in zoom mode + // 6/6s/7 and 8\r\n return 15//slightly wrong as latest version for iphone 6 is 12\r\n if (h == 568) // 5/5C/5s/SE or 6/6s/7 and 8 in zoom mode\r\n return 10\r\n if (h == 480) // i4/4s\r\n return 7\r\n return 6\r\n}\r\n/*\r\nthis.sub= function(v,minus) {\r\n //semantic version subtraction\r\n v=s.semver(v)\r\n minus=s.semver(minus)\r\n for (var i=0; ;i++) {\r\n if (i>=v.length||i>minus.length) break;\r\n v[i]-=v[minus];\r\n }\r\n return v.join('.')\r\n}\r\n*/\r\n}\r\n\r\nwindow.$bu_getBrowser=$bu_.get_browser;\r\n\r\nvar $buo = function(op,test) {\r\nvar n = window.navigator,b;\r\nop=window._buorgres=op||{};\r\nvar ll = op.l||(n.languages ? n.languages[0] : null) || n.language || n.browserLanguage || n.userLanguage||document.documentElement.getAttribute(\"lang\")||\"en\";\r\nop.llfull=ll.replace(\"_\",\"-\").toLowerCase().substr(0,5);\r\nop.ll=op.llfull.substr(0,2);\r\nop.domain=op.domain!==undefined?op.domain:(/file:/.test(location.href)?\"https:\":\"\")+\"//browser-update.org\";\r\nop.apiver=op.api||op.c||-1;\r\nop.jsv=$bu_.version;\r\n\r\nvar required_min=(op.apiver<2018&&{i:10,f:11,o:21,s:8,c:30})||{};\r\n\r\nvar vs=op.notify||op.vs||{};//legacy config: maximum version to notify\r\nif (vs.e!==0)\r\n vs.e=vs.e||vs.i;\r\nvs.i=vs.i||vs.e;\r\nvar required=op.required||{};//minimum browser versions needed\r\nif (required.e!==0)\r\n required.e=required.e||required.i;\r\nif (!required.i) {\r\n required.i=required.e;\r\n $bu_.vsakt.i=$bu_.vsakt.e;\r\n}\r\n\r\nfor (b in $bu_.vsdefault) {\r\n if (vs[b]) {//legacy style config: browsers to notify\r\n if ($bu_.less(vs[b],0)>=0) // required <= 0\r\n required[b]= parseFloat($bu_.vsakt[b])+parseFloat(vs[b])+0.01\r\n else\r\n required[b] = parseFloat(vs[b]) + 0.01\r\n }\r\n if (!(b in required) || required[b]==null)\r\n required[b]=$bu_.vsdefault[b]\r\n if ($bu_.less(required[b],0)>=0) // case for required <= 0 --> relative to latest version\r\n required[b]=parseFloat($bu_.vsakt[b])+parseFloat(required[b]) // TODO: make it work for string version\r\n if (required_min[b] && $bu_.less(required[b],required_min[b])===1) // required < required_min\r\n required[b]=required_min[b]\r\n}\r\nrequired.ios=required.ios||required.s;\r\n\r\nif (required.i<79 && required.i>65)\r\n required.i=required.i-60\r\nif (required.e<79 && required.e>65)\r\n required.e=required.e-60\r\nop.required=required;\r\nop.reminder=op.reminder<0.1 ? 0 : op.reminder||(24*7);\r\nop.reminderClosed=op.reminderClosed<1 ? 0 : op.reminderClosed||(24*7);\r\nop.onshow = op.onshow||function(o){};\r\nop.onclick = op.onclick||function(o){};\r\nop.onclose = op.onclose||function(o){};\r\nop.pageurl = op.pageurl || location.hostname || \"x\";\r\nop.newwindow=(op.newwindow!==false);\r\n\r\nop.test=test||op.test||(location.hash===\"#test-bu\")||false;\r\nop.ignorecookie=op.ignorecookie||location.hash===\"#ignorecookie-bu\";\r\n\r\nop.reasons=[];\r\nop.hide_reasons=[];\r\nfunction check_show(op) {\r\n var bb=op.browser=$bu_.get_browser(op.override_ua);\r\n op.is_below_required = required[bb.n] && $bu_.less(bb.fullv,required[bb.n])===1; //bb.fullv0)\r\n return false\r\n if (op.reasons.length>0)\r\n return true\r\n return false\r\n }\r\n\r\nop.notified=check_show(op);\r\n\r\nop.already_shown=document.cookie.indexOf(\"browserupdateorg=pause\")>-1 && !op.ignorecookie;\r\n\r\nif (!op.test && (!op.notified || op.already_shown))\r\n return;\r\n\r\nop.setCookie=function(hours) { //sets a cookie that the user has already seen the notification, closed it or permanently wants to hide it. No information on the user is stored.\r\n document.cookie = 'browserupdateorg=pause; expires='+(new Date(new Date().getTime()+3600000*hours)).toGMTString()+'; path=/; SameSite=Lax'+(/https:/.test(location.href)?'; Secure':'')\r\n}\r\n\r\nif (op.already_shown && (op.ignorecookie || op.test))\r\n op.setCookie(-10)// remove old cookies if in test mode\r\n\r\nif (op.reminder>0)\r\n op.setCookie(op.reminder);\r\n\r\nif (op.nomessage) {\r\n op.onshow(op);\r\n return;\r\n}\r\n\r\n$buo_show();\r\n};\r\n\r\n\r\nif( typeof( module ) !== 'undefined' ) {\r\n module.exports = $buo;\r\n}\r\n\r\n\r\n\r\n\"use strict\";\r\nvar $buo_show = function () {\r\n var op = window._buorgres;\r\n var bb = $bu_getBrowser();\r\n var burl = op.burl || (\"http\" + (/MSIE/i.test(navigator.userAgent) ? \"\" : \"s\") + \"://browser-update.org/\");\r\n if (!op.url) {\r\n op.url = burl + ((op.l && (op.l + \"/\")) || \"\") + \"update-browser.html\" + (op.test ? \"?force_outdated=true\" : \"\") + \"#\" + op.jsv + \":\" + op.pageurl;\r\n }\r\n op.url_permanent_hide=op.url_permanent_hide || (burl + \"block-ignore-browser-update-warning.html\");\r\n /*\r\n if (Math.random()*1000<1 && !op.test && !op.betatest) {\r\n var i = new Image();\r\n var txt=op[\"text_\"+ll]||op.text||\"\";\r\n var extra=encodeURIComponent(\"frac=\"+frac+\"&txt=\"+txt+\"&apiver=\"+op.apiver);\r\n i.src=\"https://browser-update.org/cnt?what=noti&from=\"+bb.n+\"&fromv=\"+bb.v + \"&ref=\"+ escape(op.pageurl) + \"&jsv=\"+op.jsv+\"&tv=\"+op.style+\"&extra=\"+extra;\r\n }\r\n */\r\n function busprintf() {\r\n var args = arguments;\r\n var data = args[0];\r\n for (var k = 1; k < args.length; ++k) {\r\n data = data.replace(/%s/, args[k]);\r\n }\r\n return data;\r\n }\r\n\r\n\r\nvar t = {}, ta;\r\nt.en= {'msg': 'Your web browser ({brow_name}) is out of date.', 'msgmore': 'Update your browser for more security, speed and the best experience on this site.', 'bupdate': 'Update browser', 'bignore': 'Ignore','remind': 'You will be reminded in {days} days.','bnever': 'Never show again','insecure':'Your web browser ({brow_name}) has a serious security vulnerability!'}\r\nt.ar= {'msg': 'متصفح الإنترنت الخاص بك ({brow_name}) غير مُحدّث.','msgmore': 'قم بتحديث المتصفح الخاص بك لمزيد من الأمان والسرعة ولأفضل تجربة على هذا الموقع.','bupdate': 'تحديث المتصفح','bignore': 'تجاهل', 'remind': 'سيتم تذكيرك في غضون {days} أيام.', 'bnever': 'لا تظهر مرة أخرى'}\r\nt.bg= {'msg': 'Вашият уеб браузър ({brow_name}) е остарял.','msgmore': 'Актуализирайте браузъра си за повече сигурност, бързина и най-доброто изживяване на този сайт.','bupdate': 'Актуализиране на браузъра','bignore': 'игнорирай', 'remind': 'Ще ви бъде напомнено след {days} дни.', 'bnever': 'Никога повече да не се показва'}\r\nt.ca= {'msg': 'El teu navegador ({brow_name}) està desactualitzat.','msgmore': 'Actualitzeu el vostre navegador per obtenir més seguretat, velocitat i una millor experiència en aquest lloc.','bupdate': 'Actualitza el navegador','bignore': 'Ignorar', 'remind': 'T\\'ho recordarem d\\'aquí a {days} dies.', 'bnever': 'No ho tornis a mostrar'}\r\nt.cs= {'msg': 'Váš prohlížeč ({brow_name}) je zastaralý.','msgmore': 'Aktualizujte prohlížeč pro lepší zabezpečení, rychlost a nejlepší zážitek z tohoto webu.','bupdate': 'Aktualizovat prohlížeč','bignore': 'Ignorovat', 'remind': 'Znovu budete upozorněni za {days} dnů.', 'bnever': 'Již nezobrazovat'}\r\nt.cy= {'msg': 'Mae eich porwr gwe ({brow_name}) angen ei ddiweddaru.','msgmore': 'Diweddarwch eich porwr i gael mwy o ddiogelwch, cyflymder a\\'r profiad gorau ar y safle hwn.','bupdate': 'Diweddaru porwr','bignore': 'Anwybyddu', 'remind': 'Byddwn yn eich atgoffa mewn {days} diwrnod.', 'bnever': 'Peidiwch â dangos eto'}\r\nt.da= {'msg': 'Din web browser ({brow_name}) er forældet','msgmore': 'Opdater din browser for mere sikkerhed, hastighed og den bedste oplevelse på denne side.','bupdate': 'Opdater browser','bignore': 'Ignorer', 'remind': 'Du vil blive påmindet om {days} dage.', 'bnever': 'Vis aldrig igen'}\r\nt.de= {'msg': 'Ihr Webbrowser ({brow_name}) ist veraltet.','msgmore': 'Aktualisieren Sie Ihren Browser für mehr Sicherheit, Geschwindigkeit und den besten Komfort auf dieser Seite.','bupdate': 'Browser aktualisieren','bignore': 'Ignorieren', 'remind': 'Sie werden in {days} Tagen wieder erinnert.', 'bnever': 'Nie wieder anzeigen','insecure':'Ihr Webbrowser ({brow_name}) hat eine ernsthafte Sicherheitslücke!'}\r\nt.el= {'msg': 'Το πρόγραμμα περιήγησής σας ({brow_name}) είναι απαρχαιωμένο.','msgmore': 'Ενημερώστε το πρόγραμμα περιήγησής σας για περισσότερη ασφάλεια, ταχύτητα και την καλύτερη εμπειρία σ\\' αυτόν τον ιστότοπο.','bupdate': 'Ενημερώστε το πρόγραμμα περιήγησης','bignore': 'Αγνοήστε', 'remind': 'Θα σας το υπενθυμίσουμε σε {days} ημέρες.', 'bnever': 'Να μην εμφανιστεί ξανά'}\r\nt.es= {'msg': 'Su navegador web ({brow_name}) está desactualizado.','msgmore': 'Actualice su navegador para obtener más seguridad, velocidad y para disfrutar de la mejor experiencia en este sitio.','bupdate': 'Actualizar navegador','bignore': 'Ignorar', 'remind': 'Se le recordará en {days} días.', 'bnever': 'No mostrar de nuevo'}\r\nt.et= {'msg': 'Teie veebilehitseja ({brow_name}) on vananenud.','msgmore': 'Veebilehitseja uuendamisega kaasneb nii parem turvalisus, kiirus kui ka kasutusmugavus.','bupdate': 'Uuenda veebilehitsejat','bignore': 'Eira', 'remind': 'Uus meeldetuletus {days} päeva pärast.', 'bnever': 'Ära kunagi enam näita'}\r\nt.fa= {'msg': 'مرورگر شما ({brow_name}) قدیمی است.','msgmore': 'برای ایمنی، سرعت و تجربه بهتر مرورگر خود را به‌روز کنید.','bupdate': 'به‌روزرسانی مرورگر','bignore': 'نادیده گرفتن', 'remind': 'به شما تا {days} روز دیگر دوباره یاد‌آوری خواهد شد.', 'bnever': 'هرگز نمایش نده'}\r\nt.fi= {'msg': 'Selaimesi ({brow_name}) on vanhentunut.','msgmore': 'Päivitä selaimesi saadaksesi tietoturvapäivityksiä, nopeutta sekä parhaan käyttökokemuksen sivustolla.','bupdate': 'Päivitä selain','bignore': 'Ohita', 'remind': 'Saat uuden muistutuksen {days} päivän päästä.', 'bnever': 'Älä näytä uudestaan'}\r\nt.fr= {'msg': 'Votre navigateur Web ({brow_name}) n\\'est pas à jour.','msgmore': 'Mettez à jour votre navigateur pour plus de sécurité et de rapidité et une meilleure expérience sur ce site.','bupdate': 'Mettre à jour le navigateur','bignore': 'Ignorer', 'remind': 'Vous serez rappelé dans {days} jours.', 'bnever': 'Ne plus afficher'}\r\nt.gl= {'msg': 'Tá an líonléitheoir agat ({brow_name}) as dáta.','msgmore': 'Actualiza o teu navegador para obter máis seguridade, rapidez e mellor experiencia neste sitio.','bupdate': 'Actualizar navegador web','bignore': 'Ignorar', 'remind': 'Lembraralle en {days} días.', 'bnever': 'Non volver mostrar máis'}\r\nt.he= {'msg': 'דפדפן ({brow_name}) שלך אינו מעודכן.','msgmore': 'עדכן/י את הדפדפן שלך לשיפור האבטחה והמהירות וכדי ליהנות מהחוויה הטובה ביותר באתר זה.','bupdate': 'עדכן דפדפן','bignore': 'התעלם', 'remind': 'תקבל/י תזכורת בעוד {days} ימים.', 'bnever': 'אל תציג שוב'}\r\nt.hi= {'msg': 'आपका वेब ब्राउज़र ({brow_name}) पुराना है।','msgmore': 'इस साइट पर अधिक सुरक्षा, गति और सर्वोत्तम अनुभव करने के लिए अपने ब्राउज़र को अपडेट करें ।','bupdate': 'ब्राउज़र अपडेट करें','bignore': 'नजरअंदाज करें', 'remind': 'आपको {days} दिनों में याद दिलाया जाएगा।', 'bnever': 'फिर कभी मत दिखाना'}\r\nt.hu= {'msg': 'Az Ön webböngészője ({brow_name}) elavult.','msgmore': 'Frissítse böngészőjét a nagyobb biztonság, sebesség és élmény érdekében!','bupdate': 'Böngésző frissítése','bignore': 'Mellőzés', 'remind': 'Újra emlékeztetünk {days} napon belül.', 'bnever': 'Ne mutassa többet'}\r\nt.id= {'msg': 'Peramban web ({brow_name}) Anda sudah usang.','msgmore': 'Perbarui peramban Anda untuk pengalaman terbaik, lebih aman, dan cepat di situs ini.','bupdate': 'Perbarui peramban','bignore': 'Abaikan', 'remind': 'Anda akan diingatkan kembali dalam {days} hari.', 'bnever': 'Jangan pernah tampilkan lagi'}\r\nt.it= {'msg': 'Il tuo browser ({brow_name}) non è aggiornato.','msgmore': 'Aggiorna il browser per una maggiore sicurezza, velocità e la migliore esperienza su questo sito.','bupdate': 'Aggiorna browser','bignore': 'Ignora', 'remind': 'Riceverai un promemoria tra {days} giorni.', 'bnever': 'Non mostrare di nuovo'}\r\nt.ja= {'msg': 'お使いのブラウザ({brow_name})は最新版ではありません。','msgmore': 'セキュリティ、スピード、そしてこのサイトでの最良の体験のためにお使いのブラウザを更新してください。','bupdate': 'ブラウザを更新する','bignore': '無視する', 'remind': '{days} 日後にもう一度お知らせします。', 'bnever': '次回から表示しない'}\r\nt.ko= {'msg': '귀하의 웹 브라우저({brow_name})는 오래되었습니다.','msgmore': '이 사이트에서 보안, 속도와 최상의 경험을 얻으려면 브라우저를 업데이트하십시오.','bupdate': '브라우저 업데이트하기','bignore': '무시하기', 'remind': '{days}일 후에 알려 드립니다.', 'bnever': '다시 표시하지 않기'}\r\nt.lt= {'msg': 'Jūsų naršyklė ({brow_name}) yra pasenusi.','msgmore': 'Atsinaujinkite savo naršyklę norėdami gauti daugiau saugumo, greičio ir pačių geriausių patirčių šioje svetainėje.','bupdate': 'Atnaujinti naršyklę','bignore': 'Nepaisyti', 'remind': 'Jums bus priminta po {days} dienų.', 'bnever': 'Daugiau niekada nerodyti'}\r\nt.lv= {'msg': 'Jūsu pārlūkprogramma ({brow_name}) ir novecojusi.','msgmore': 'Atjaunojiet savu pārlūkprogrammu lielākai drošībai, ātrumam un labākai pieredzei ar šo vietni.','bupdate': 'Atjaunināt pārlūkprogrammu','bignore': 'Ignorēt', 'remind': 'Jums tiks parādīts atgādinājums pēc {days} dienām.', 'bnever': 'Vairs nerādīt'}\r\nt.ms= {'msg': 'Pelayar web anda ({brow_name}) sudah lapuk.','msgmore': 'Kemas kini pelayar anda untuk lebih keselamatan, kelajuan dan pengalaman terbaik di laman web ini.','bupdate': 'Kemas kini pelayar','bignore': 'Abaikan', 'remind': 'Anda akan diingatkan dalam {days} hari.', 'bnever': 'Jangan tunjukkan lagi'}\r\nt.nl= {'msg': 'Uw webbrowser ({brow_name}) is verouderd.','msgmore': 'Update uw browser voor meer veiligheid, snelheid en om deze site optimaal te kunnen gebruiken.','bupdate': 'Browser updaten','bignore': 'Negeren', 'remind': 'We zullen u er in {days} dagen aan herinneren.', 'bnever': 'Nooit meer tonen'}\r\nt.no=t.nn=t.nb= {'msg': 'Nettleseren din ({brow_name}) er utdatert.','msgmore': 'Oppdater nettleseren din for økt sikkerhet, hastighet og den beste opplevelsen på dette nettstedet.','bupdate': 'Oppdater nettleser','bignore': 'Ignorer', 'remind': 'Du vil få en påminnelse om {days} dager.', 'bnever': 'Aldri vis igjen'}\r\nt.pl= {'msg': 'Twoja przeglądarka ({brow_name}) jest nieaktualna.','msgmore': 'Zaktualizuj przeglądarkę, by korzystać z tej strony bezpieczniej, szybciej i po prostu sprawniej.','bupdate': 'Aktualizuj przeglądarkę','bignore': 'Ignoruj', 'remind': 'Przypomnimy o tym za {days} dni.', 'bnever': 'Nie pokazuj więcej'}\r\nt.pt= {'msg': 'Seu navegador da web ({brow_name}) está desatualizado.','msgmore': 'Atualize seu navegador para ter mais segurança e velocidade, além da melhor experiência neste site.','bupdate': 'Atualizar navegador','bignore': 'Ignorar', 'remind': 'Você será relembrado em {days} dias.', 'bnever': 'Não mostrar novamente'}\r\nt.ro= {'msg': 'Browserul tău ({brow_name}) nu este actualizat.','msgmore': 'Actualizează browserul pentru o mai mare siguranță, viteză și cea mai bună experiență pe acest site.','bupdate': 'Actualizează browser','bignore': 'Ignoră', 'remind': 'Ți se va reaminti peste {days} zile.', 'bnever': 'Nu mai arăta'}\r\nt.ru= {'msg': 'Ваш браузер ({brow_name}) устарел.','msgmore': 'Обновите ваш браузер для повышения уровня безопасности, скорости и комфорта использования этого сайта.','bupdate': 'Обновить браузер','bignore': 'Игнорировать', 'remind': 'Вы получите напоминание через {days} дней.', 'bnever': 'Больше не показывать '}\r\nt.sk= {'msg': 'Váš internetový prehliadač ({brow_name}) je zastaraný.','msgmore': 'Pre väčšiu bezpečnosť, rýchlosť a lepšiu skúsenosť s touto stránkou si aktualizujte svoj prehliadač.','bupdate': 'Aktualizovať prehliadač','bignore': 'Ignorovať', 'remind': 'Bude vám to pripomenuté o {days} dní.', 'bnever': 'Už nikdy viac neukazovať'}\r\nt.sl= {'msg': 'Vaš spletni brskalnik ({brow_name}) je zastarel.','msgmore': 'Posodobite svoj brskalnik za dodatno varnost, hitrost in najboljšo izkušnjo na tem spletnem mestu.','bupdate': 'Posodobi brskalnik','bignore': 'Prezri', 'remind': 'Opomnik boste prejeli čez toliko dni: {days}.', 'bnever': 'Ne prikaži več'}\r\nt.sq= {'msg': 'Shfletuesi juaj ({brow_name}) është i vjetruar.','msgmore': 'Përditësoni shfletuesin tuaj për më tepër siguri, shpejtësi dhe për më të mirin e funksionimeve në këtë sajt.','bupdate': 'Përditëso shfletuesin','bignore': 'Shpërfille', 'remind': 'Do t’ju rikujtohet pas {days} ditësh.', 'bnever': 'Mos e shfaq kurrë më'}\r\nt.sr= {'msg': 'Vaš pretraživač ({brow_name}) je zastareo.','msgmore': 'Ima poznate sigurnosne probleme i najverovatnije neće prikazati sve funkcionalnisti ovog i drugih sajtova.','bupdate': 'Nadogradi pretraživač','bignore': 'Ignorisi', 'remind': 'Zaboravićete za {days} dana.', 'bnever': 'Ne prikazuj opet'}\r\nt.sv= {'msg': 'Din webbläsare ({brow_name}) är föråldrad. ','msgmore': 'Uppdatera din webbläsare för mer säkerhet, hastighet och den bästa upplevelsen på den här sajten. ','bupdate': 'Uppdatera webbläsaren','bignore': 'Ignorera', 'remind': 'Du får en påminnelse om {days} dagar.', 'bnever': 'Visa aldrig igen'}\r\nt.th= {'msg': 'เว็บเบราว์เซอร์ของคุณ ({brow_name}) ล้าสมัยแล้ว','msgmore': 'อัปเดทเบราว์เซอร์เพื่อเพิ่มความปลอดภัย, ความเร็ว และประสบการณ์ที่ดีที่สุดบนเว็บไซต์นี้','bupdate': 'อัปเดทเบราว์เซอร์','bignore': 'ข้าม', 'remind': 'คุณจะได้รับการแจ้งเตือนใน {days} วัน', 'bnever': 'ไม่ต้องแสดงอีก'}\r\nt.tr= {'msg': 'Web tarayıcınız ({brow_name}) güncel değil.','msgmore': 'Daha fazla güvenlik ve hız ile bu sitede en iyi deneyim için tarayıcınızı güncelleyin.','bupdate': 'Tarayıcıyı güncelle','bignore': 'Yok say', 'remind': '{days} gün sonra bir hatırlatma alacaksınız.', 'bnever': 'Bir daha gösterme'}\r\nt.uk= {'msg': 'Ваш браузер ({brow_name}) застарілий.','msgmore': 'Оновіть свій браузер для більшої безпеки, швидкості та повноцінної роботи цього сайту.','bupdate': 'Оновити браузер','bignore': 'Пропустити', 'remind': 'Ви отримаєте нагадування через {days} днів.', 'bnever': 'Більше не показувати'}\r\nt.uz= {'msg': 'Sizning ({brow_name}) veb-brauzeringiz eskirgan','msgmore': 'Xavfsizlik, tezkorlik va ushbu sayt imkoniyatlaridan to`liq foydalanish uchun brauzeringizni yangilang.','bupdate': 'Brauzeringizni yangilang','bignore': 'E’tibor bermaslik', 'remind': 'Sizga {days} kundan so`ng eslatammiz.', 'bnever': 'Hech qachon qayta ko\\'rsatmang'}\r\nt.vi= {'msg': 'Trình duyệt web của bạn ({brow_name}) đã lỗi thời.','msgmore': 'Cập nhật trình duyệt của bạn để có thêm bảo mật, tốc độ và trải nghiệm tốt nhất trên trang web này.','bupdate': 'Cập nhật trình duyệt','bignore': 'Bỏ qua', 'remind': 'Bạn sẽ được nhắc nhở sau {days} ngày.', 'bnever': 'Không bao giờ hiển thị lại'}\r\nt.zh= {'msg': '您的网页浏览器({brow_name})已过期。','msgmore': '更新您的浏览器,以便在该网站上获得更安全、更快速和最好的体验。','bupdate': '更新浏览器','bignore': '忽略', 'remind': '会在{days}天后提醒您。', 'bnever': '不再显示'}\r\nt[\"zh-tw\"]= t[\"zh-hans-cn\"] ={'msg': '您的網路瀏覽器({brow_name})已過舊。','msgmore': '更新您的瀏覽器以獲得更佳的安全性、速度以及在此網站的最佳體驗。','bupdate': '更新瀏覽器','bignore': '忽略', 'remind': '您將在 {days} 天後收到提醒。', 'bnever': '不要再顯示'}\r\n\r\nvar custom_text = op[\"text_for_\" + bb.n + \"_in_\" + op.ll] || op[\"text_for_\" + bb.n] || op[\"text_\" + op.llfull] || op[\"text_in_\" + op.ll] || op[\"text_\" + op.ll] || op.text\r\n\r\n\r\n\r\nt = ta = t[op.llfull] || t[op.ll] || t.en;\r\nif (custom_text) {\r\n if (typeof custom_text === 'string')\r\n t=ta=custom_text;\r\n else {\r\n for (var i in custom_text) {\r\n ta[i] = custom_text[i]\r\n }\r\n }\r\n}\r\nif (op.browser.is_insecure && ta.insecure) {\r\n ta.msg=ta.insecure\r\n}\r\nif (ta.msg)\r\n t = '' + t.msg + ' ' + t.msgmore + ' ' + t.bupdate + ' ' + t.bignore + ''\r\n\r\nvar tar = \"\";\r\nif (op.newwindow)\r\n tar = ' target=\"_blank\" rel=\"noopener\"';\r\n\r\nvar div = op.div = document.createElement(\"div\");\r\ndiv.id = div.className= \"buorg\";\r\n\r\nvar style = '';\r\nvar style2 = '';\r\nif (ta.msg && (op.ll==\"ar\"||op.ll==\"he\"||op.ll==\"fa\"))\r\n style2+='';\r\nif (!ta.msg && t.indexOf && t.indexOf(\"%s\") !== -1) {//legacy style\r\n t = busprintf(t, bb.t, ' id=\"buorgul\" href=\"' + op.url + '\"' + tar);\r\n\r\n style += '';\r\n div.innerHTML = '

' + t + '
' + style;\r\n op.addmargin = true;\r\n}\r\nelse {\r\n if (op.style === \"bottom\") {\r\n style2 += '';\r\n }\r\n else if (op.style === \"corner\") {\r\n style2 += '';\r\n }\r\n else {\r\n op.addmargin = true;\r\n }\r\n t = t.replace(\"{brow_name}\", bb.t).replace(\"{up_but}\", ' id=\"buorgul\" href=\"' + op.url + '\"' + tar).replace(\"{ignore_but}\", ' id=\"buorgig\" role=\"button\" tabindex=\"0\"');\r\n div.innerHTML = '
' + t + '
' + style + style2;\r\n}\r\n\r\nop.text = t;\r\nif (op.container) {\r\n op.container.appendChild(div);\r\n op.addmargin = false;\r\n}\r\nelse\r\n document.body.insertBefore(div, document.body.firstChild);\r\n\r\nvar updatebutton=document.getElementById(\"buorgul\");\r\nif (updatebutton) {\r\n updatebutton.onclick = function (e) {\r\n div.onclick = null;\r\n op.onclick(op);\r\n if (op.noclose)\r\n return\r\n op.setCookie(op.reminderClosed);\r\n if (!op.noclose) {\r\n div.style.display = \"none\";\r\n if (op.addmargin && op.shift_page_down !== false)\r\n hm.style.marginTop = op.bodymt;\r\n }\r\n };\r\n}\r\nif (!custom_text) {//make whole bar clickable except if custom text is set\r\n div.style.cursor=\"pointer\";\r\n div.onclick = function () {\r\n if (op.newwindow)\r\n window.open(op.url, \"_blank\");\r\n else\r\n window.location.href = op.url;\r\n op.setCookie(op.reminderClosed);\r\n op.onclick(op);\r\n };\r\n}\r\n\r\nif (op.addmargin && op.shift_page_down !== false) {\r\n var hm = document.getElementsByTagName(\"html\")[0] || document.body;\r\n op.bodymt = hm.style.marginTop;\r\n hm.style.marginTop = (div.clientHeight) + \"px\";\r\n}\r\nvar ignorebutton = document.getElementById(\"buorga\") || document.getElementById(\"buorgig\");\r\nif (ignorebutton) {\r\n ignorebutton.onclick = function (e) {\r\n div.onclick = null;\r\n op.onclose(op);\r\n if (op.addmargin && op.shift_page_down !== false)\r\n hm.style.marginTop = op.bodymt;\r\n op.setCookie(op.reminderClosed);\r\n if (!op.no_permanent_hide && ta.bnever && ta.remind) {\r\n op.div.innerHTML = '
' + (op.reminderClosed > 24 ? ta.remind.replace(\"{days}\", Math.round(op.reminderClosed/24)):\"\") + ' ' + ta.bnever + '
' + style + style2;\r\n div.className = \"buorg buorg-fadeout\";\r\n document.getElementById(\"buorgpermanent\").onclick = function (e) {\r\n op.setCookie(24 * 365);\r\n op.div.style.display = \"none\";\r\n }\r\n op.div.style.opacity = 0;\r\n op.div.style.visibility = \"hidden\";\r\n return false;\r\n }\r\n op.div.style.display = \"none\";\r\n return false;\r\n }\r\n if (op.noclose || op.reminderClosed==0) {\r\n ignorebutton.parentNode.removeChild(ignorebutton)\r\n }\r\n}\r\n\r\n\r\nop.onshow(op);\r\n\r\nif (op.test && !op.dont_show_debuginfo) {\r\n var e = document.createElement(\"script\");\r\n e.src = op.domain + \"/update.test.js\";\r\n document.body.appendChild(e);\r\n}\r\n\r\n};\r\n\r\n\r\n","'use strict';\n\n/**\n * Module dependenices\n */\n\nconst clone = require('shallow-clone');\nconst typeOf = require('kind-of');\nconst isPlainObject = require('is-plain-object');\n\nfunction cloneDeep(val, instanceClone) {\n switch (typeOf(val)) {\n case 'object':\n return cloneObjectDeep(val, instanceClone);\n case 'array':\n return cloneArrayDeep(val, instanceClone);\n default: {\n return clone(val);\n }\n }\n}\n\nfunction cloneObjectDeep(val, instanceClone) {\n if (typeof instanceClone === 'function') {\n return instanceClone(val);\n }\n if (instanceClone || isPlainObject(val)) {\n const res = new val.constructor();\n for (let key in val) {\n res[key] = cloneDeep(val[key], instanceClone);\n }\n return res;\n }\n return val;\n}\n\nfunction cloneArrayDeep(val, instanceClone) {\n const res = new val.constructor(val.length);\n for (let i = 0; i < val.length; i++) {\n res[i] = cloneDeep(val[i], instanceClone);\n }\n return res;\n}\n\n/**\n * Expose `cloneDeep`\n */\n\nmodule.exports = cloneDeep;\n","/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\n'use strict';\n\nvar isObject = require('isobject');\n\nfunction isObjectObject(o) {\n return isObject(o) === true\n && Object.prototype.toString.call(o) === '[object Object]';\n}\n\nmodule.exports = function isPlainObject(o) {\n var ctor,prot;\n\n if (isObjectObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (typeof ctor !== 'function') return false;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObjectObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n};\n",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var BlockCipher = C_lib.BlockCipher;\n\t var C_algo = C.algo;\n\n\t // Lookup tables\n\t var SBOX = [];\n\t var INV_SBOX = [];\n\t var SUB_MIX_0 = [];\n\t var SUB_MIX_1 = [];\n\t var SUB_MIX_2 = [];\n\t var SUB_MIX_3 = [];\n\t var INV_SUB_MIX_0 = [];\n\t var INV_SUB_MIX_1 = [];\n\t var INV_SUB_MIX_2 = [];\n\t var INV_SUB_MIX_3 = [];\n\n\t // Compute lookup tables\n\t (function () {\n\t // Compute double table\n\t var d = [];\n\t for (var i = 0; i < 256; i++) {\n\t if (i < 128) {\n\t d[i] = i << 1;\n\t } else {\n\t d[i] = (i << 1) ^ 0x11b;\n\t }\n\t }\n\n\t // Walk GF(2^8)\n\t var x = 0;\n\t var xi = 0;\n\t for (var i = 0; i < 256; i++) {\n\t // Compute sbox\n\t var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);\n\t sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;\n\t SBOX[x] = sx;\n\t INV_SBOX[sx] = x;\n\n\t // Compute multiplication\n\t var x2 = d[x];\n\t var x4 = d[x2];\n\t var x8 = d[x4];\n\n\t // Compute sub bytes, mix columns tables\n\t var t = (d[sx] * 0x101) ^ (sx * 0x1010100);\n\t SUB_MIX_0[x] = (t << 24) | (t >>> 8);\n\t SUB_MIX_1[x] = (t << 16) | (t >>> 16);\n\t SUB_MIX_2[x] = (t << 8) | (t >>> 24);\n\t SUB_MIX_3[x] = t;\n\n\t // Compute inv sub bytes, inv mix columns tables\n\t var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);\n\t INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);\n\t INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);\n\t INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);\n\t INV_SUB_MIX_3[sx] = t;\n\n\t // Compute next counter\n\t if (!x) {\n\t x = xi = 1;\n\t } else {\n\t x = x2 ^ d[d[d[x8 ^ x2]]];\n\t xi ^= d[d[xi]];\n\t }\n\t }\n\t }());\n\n\t // Precomputed Rcon lookup\n\t var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\n\t /**\n\t * AES block cipher algorithm.\n\t */\n\t var AES = C_algo.AES = BlockCipher.extend({\n\t _doReset: function () {\n\t var t;\n\n\t // Skip reset of nRounds has been set before and key did not change\n\t if (this._nRounds && this._keyPriorReset === this._key) {\n\t return;\n\t }\n\n\t // Shortcuts\n\t var key = this._keyPriorReset = this._key;\n\t var keyWords = key.words;\n\t var keySize = key.sigBytes / 4;\n\n\t // Compute number of rounds\n\t var nRounds = this._nRounds = keySize + 6;\n\n\t // Compute number of key schedule rows\n\t var ksRows = (nRounds + 1) * 4;\n\n\t // Compute key schedule\n\t var keySchedule = this._keySchedule = [];\n\t for (var ksRow = 0; ksRow < ksRows; ksRow++) {\n\t if (ksRow < keySize) {\n\t keySchedule[ksRow] = keyWords[ksRow];\n\t } else {\n\t t = keySchedule[ksRow - 1];\n\n\t if (!(ksRow % keySize)) {\n\t // Rot word\n\t t = (t << 8) | (t >>> 24);\n\n\t // Sub word\n\t t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];\n\n\t // Mix Rcon\n\t t ^= RCON[(ksRow / keySize) | 0] << 24;\n\t } else if (keySize > 6 && ksRow % keySize == 4) {\n\t // Sub word\n\t t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];\n\t }\n\n\t keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;\n\t }\n\t }\n\n\t // Compute inv key schedule\n\t var invKeySchedule = this._invKeySchedule = [];\n\t for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n\t var ksRow = ksRows - invKsRow;\n\n\t if (invKsRow % 4) {\n\t var t = keySchedule[ksRow];\n\t } else {\n\t var t = keySchedule[ksRow - 4];\n\t }\n\n\t if (invKsRow < 4 || ksRow <= 4) {\n\t invKeySchedule[invKsRow] = t;\n\t } else {\n\t invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^\n\t INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];\n\t }\n\t }\n\t },\n\n\t encryptBlock: function (M, offset) {\n\t this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);\n\t },\n\n\t decryptBlock: function (M, offset) {\n\t // Swap 2nd and 4th rows\n\t var t = M[offset + 1];\n\t M[offset + 1] = M[offset + 3];\n\t M[offset + 3] = t;\n\n\t this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);\n\n\t // Inv swap 2nd and 4th rows\n\t var t = M[offset + 1];\n\t M[offset + 1] = M[offset + 3];\n\t M[offset + 3] = t;\n\t },\n\n\t _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {\n\t // Shortcut\n\t var nRounds = this._nRounds;\n\n\t // Get input, add round key\n\t var s0 = M[offset] ^ keySchedule[0];\n\t var s1 = M[offset + 1] ^ keySchedule[1];\n\t var s2 = M[offset + 2] ^ keySchedule[2];\n\t var s3 = M[offset + 3] ^ keySchedule[3];\n\n\t // Key schedule row counter\n\t var ksRow = 4;\n\n\t // Rounds\n\t for (var round = 1; round < nRounds; round++) {\n\t // Shift rows, sub bytes, mix columns, add round key\n\t var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];\n\t var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];\n\t var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];\n\t var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];\n\n\t // Update state\n\t s0 = t0;\n\t s1 = t1;\n\t s2 = t2;\n\t s3 = t3;\n\t }\n\n\t // Shift rows, sub bytes, add round key\n\t var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];\n\t var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];\n\t var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];\n\t var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];\n\n\t // Set output\n\t M[offset] = t0;\n\t M[offset + 1] = t1;\n\t M[offset + 2] = t2;\n\t M[offset + 3] = t3;\n\t },\n\n\t keySize: 256/32\n\t });\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);\n\t */\n\t C.AES = BlockCipher._createHelper(AES);\n\t}());\n\n\n\treturn CryptoJS.AES;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var BlockCipher = C_lib.BlockCipher;\n\t var C_algo = C.algo;\n\n\t const N = 16;\n\n\t //Origin pbox and sbox, derived from PI\n\t const ORIG_P = [\n\t 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344,\n\t 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,\n\t 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C,\n\t 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917,\n\t 0x9216D5D9, 0x8979FB1B\n\t ];\n\n\t const ORIG_S = [\n\t [ 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7,\n\t 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99,\n\t 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16,\n\t 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E,\n\t 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE,\n\t 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013,\n\t 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF,\n\t 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E,\n\t 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60,\n\t 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440,\n\t 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE,\n\t 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A,\n\t 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E,\n\t 0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677,\n\t 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193,\n\t 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032,\n\t 0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88,\n\t 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239,\n\t 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E,\n\t 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0,\n\t 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3,\n\t 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98,\n\t 0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88,\n\t 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE,\n\t 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6,\n\t 0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D,\n\t 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B,\n\t 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7,\n\t 0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA,\n\t 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463,\n\t 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F,\n\t 0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09,\n\t 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3,\n\t 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB,\n\t 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279,\n\t 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8,\n\t 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB,\n\t 0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82,\n\t 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB,\n\t 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573,\n\t 0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0,\n\t 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B,\n\t 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790,\n\t 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8,\n\t 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4,\n\t 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0,\n\t 0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7,\n\t 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C,\n\t 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD,\n\t 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1,\n\t 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299,\n\t 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9,\n\t 0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477,\n\t 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF,\n\t 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49,\n\t 0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF,\n\t 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA,\n\t 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5,\n\t 0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41,\n\t 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915,\n\t 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400,\n\t 0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915,\n\t 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664,\n\t 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A ],\n\t [ 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623,\n\t 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266,\n\t 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1,\n\t 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E,\n\t 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6,\n\t 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1,\n\t 0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E,\n\t 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1,\n\t 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737,\n\t 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8,\n\t 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF,\n\t 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD,\n\t 0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701,\n\t 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7,\n\t 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41,\n\t 0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331,\n\t 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF,\n\t 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF,\n\t 0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E,\n\t 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87,\n\t 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C,\n\t 0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2,\n\t 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16,\n\t 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD,\n\t 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B,\n\t 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509,\n\t 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E,\n\t 0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3,\n\t 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F,\n\t 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A,\n\t 0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4,\n\t 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960,\n\t 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66,\n\t 0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28,\n\t 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802,\n\t 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84,\n\t 0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510,\n\t 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF,\n\t 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14,\n\t 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E,\n\t 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50,\n\t 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7,\n\t 0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8,\n\t 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281,\n\t 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99,\n\t 0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696,\n\t 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128,\n\t 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73,\n\t 0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0,\n\t 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0,\n\t 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105,\n\t 0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250,\n\t 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3,\n\t 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285,\n\t 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00,\n\t 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061,\n\t 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB,\n\t 0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E,\n\t 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735,\n\t 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC,\n\t 0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9,\n\t 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340,\n\t 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20,\n\t 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7 ],\n\t [ 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934,\n\t 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068,\n\t 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF,\n\t 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840,\n\t 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45,\n\t 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504,\n\t 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A,\n\t 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB,\n\t 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE,\n\t 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6,\n\t 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42,\n\t 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B,\n\t 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2,\n\t 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB,\n\t 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527,\n\t 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B,\n\t 0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33,\n\t 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C,\n\t 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3,\n\t 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC,\n\t 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17,\n\t 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564,\n\t 0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B,\n\t 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115,\n\t 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922,\n\t 0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728,\n\t 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0,\n\t 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E,\n\t 0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37,\n\t 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D,\n\t 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804,\n\t 0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B,\n\t 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3,\n\t 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB,\n\t 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D,\n\t 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C,\n\t 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350,\n\t 0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9,\n\t 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A,\n\t 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE,\n\t 0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D,\n\t 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC,\n\t 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F,\n\t 0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61,\n\t 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2,\n\t 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9,\n\t 0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2,\n\t 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C,\n\t 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E,\n\t 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633,\n\t 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10,\n\t 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169,\n\t 0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52,\n\t 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027,\n\t 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5,\n\t 0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62,\n\t 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634,\n\t 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76,\n\t 0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24,\n\t 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC,\n\t 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4,\n\t 0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C,\n\t 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837,\n\t 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0 ],\n\t [ 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B,\n\t 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE,\n\t 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B,\n\t 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4,\n\t 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8,\n\t 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6,\n\t 0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304,\n\t 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22,\n\t 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4,\n\t 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6,\n\t 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9,\n\t 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59,\n\t 0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593,\n\t 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51,\n\t 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28,\n\t 0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C,\n\t 0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B,\n\t 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28,\n\t 0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C,\n\t 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD,\n\t 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A,\n\t 0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319,\n\t 0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB,\n\t 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F,\n\t 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991,\n\t 0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32,\n\t 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680,\n\t 0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166,\n\t 0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE,\n\t 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB,\n\t 0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5,\n\t 0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47,\n\t 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370,\n\t 0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D,\n\t 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84,\n\t 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048,\n\t 0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8,\n\t 0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD,\n\t 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9,\n\t 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7,\n\t 0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38,\n\t 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F,\n\t 0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C,\n\t 0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525,\n\t 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1,\n\t 0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442,\n\t 0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964,\n\t 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E,\n\t 0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8,\n\t 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D,\n\t 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F,\n\t 0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299,\n\t 0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02,\n\t 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC,\n\t 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614,\n\t 0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A,\n\t 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6,\n\t 0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B,\n\t 0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0,\n\t 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060,\n\t 0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E,\n\t 0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9,\n\t 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F,\n\t 0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 ]\n\t ];\n\n\t var BLOWFISH_CTX = {\n\t pbox: [],\n\t sbox: []\n\t }\n\n\t function F(ctx, x){\n\t let a = (x >> 24) & 0xFF;\n\t let b = (x >> 16) & 0xFF;\n\t let c = (x >> 8) & 0xFF;\n\t let d = x & 0xFF;\n\n\t let y = ctx.sbox[0][a] + ctx.sbox[1][b];\n\t y = y ^ ctx.sbox[2][c];\n\t y = y + ctx.sbox[3][d];\n\n\t return y;\n\t }\n\n\t function BlowFish_Encrypt(ctx, left, right){\n\t let Xl = left;\n\t let Xr = right;\n\t let temp;\n\n\t for(let i = 0; i < N; ++i){\n\t Xl = Xl ^ ctx.pbox[i];\n\t Xr = F(ctx, Xl) ^ Xr;\n\n\t temp = Xl;\n\t Xl = Xr;\n\t Xr = temp;\n\t }\n\n\t temp = Xl;\n\t Xl = Xr;\n\t Xr = temp;\n\n\t Xr = Xr ^ ctx.pbox[N];\n\t Xl = Xl ^ ctx.pbox[N + 1];\n\n\t return {left: Xl, right: Xr};\n\t }\n\n\t function BlowFish_Decrypt(ctx, left, right){\n\t let Xl = left;\n\t let Xr = right;\n\t let temp;\n\n\t for(let i = N + 1; i > 1; --i){\n\t Xl = Xl ^ ctx.pbox[i];\n\t Xr = F(ctx, Xl) ^ Xr;\n\n\t temp = Xl;\n\t Xl = Xr;\n\t Xr = temp;\n\t }\n\n\t temp = Xl;\n\t Xl = Xr;\n\t Xr = temp;\n\n\t Xr = Xr ^ ctx.pbox[1];\n\t Xl = Xl ^ ctx.pbox[0];\n\n\t return {left: Xl, right: Xr};\n\t }\n\n\t /**\n\t * Initialization ctx's pbox and sbox.\n\t *\n\t * @param {Object} ctx The object has pbox and sbox.\n\t * @param {Array} key An array of 32-bit words.\n\t * @param {int} keysize The length of the key.\n\t *\n\t * @example\n\t *\n\t * BlowFishInit(BLOWFISH_CTX, key, 128/32);\n\t */\n\t function BlowFishInit(ctx, key, keysize)\n\t {\n\t for(let Row = 0; Row < 4; Row++)\n\t {\n\t ctx.sbox[Row] = [];\n\t for(let Col = 0; Col < 256; Col++)\n\t {\n\t ctx.sbox[Row][Col] = ORIG_S[Row][Col];\n\t }\n\t }\n\n\t let keyIndex = 0;\n\t for(let index = 0; index < N + 2; index++)\n\t {\n\t ctx.pbox[index] = ORIG_P[index] ^ key[keyIndex];\n\t keyIndex++;\n\t if(keyIndex >= keysize)\n\t {\n\t keyIndex = 0;\n\t }\n\t }\n\n\t let Data1 = 0;\n\t let Data2 = 0;\n\t let res = 0;\n\t for(let i = 0; i < N + 2; i += 2)\n\t {\n\t res = BlowFish_Encrypt(ctx, Data1, Data2);\n\t Data1 = res.left;\n\t Data2 = res.right;\n\t ctx.pbox[i] = Data1;\n\t ctx.pbox[i + 1] = Data2;\n\t }\n\n\t for(let i = 0; i < 4; i++)\n\t {\n\t for(let j = 0; j < 256; j += 2)\n\t {\n\t res = BlowFish_Encrypt(ctx, Data1, Data2);\n\t Data1 = res.left;\n\t Data2 = res.right;\n\t ctx.sbox[i][j] = Data1;\n\t ctx.sbox[i][j + 1] = Data2;\n\t }\n\t }\n\n\t return true;\n\t }\n\n\t /**\n\t * Blowfish block cipher algorithm.\n\t */\n\t var Blowfish = C_algo.Blowfish = BlockCipher.extend({\n\t _doReset: function () {\n\t // Skip reset of nRounds has been set before and key did not change\n\t if (this._keyPriorReset === this._key) {\n\t return;\n\t }\n\n\t // Shortcuts\n\t var key = this._keyPriorReset = this._key;\n\t var keyWords = key.words;\n\t var keySize = key.sigBytes / 4;\n\n\t //Initialization pbox and sbox\n\t BlowFishInit(BLOWFISH_CTX, keyWords, keySize);\n\t },\n\n\t encryptBlock: function (M, offset) {\n\t var res = BlowFish_Encrypt(BLOWFISH_CTX, M[offset], M[offset + 1]);\n\t M[offset] = res.left;\n\t M[offset + 1] = res.right;\n\t },\n\n\t decryptBlock: function (M, offset) {\n\t var res = BlowFish_Decrypt(BLOWFISH_CTX, M[offset], M[offset + 1]);\n\t M[offset] = res.left;\n\t M[offset + 1] = res.right;\n\t },\n\n\t blockSize: 64/32,\n\n\t keySize: 128/32,\n\n\t ivSize: 64/32\n\t });\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.Blowfish.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.Blowfish.decrypt(ciphertext, key, cfg);\n\t */\n\t C.Blowfish = BlockCipher._createHelper(Blowfish);\n\t}());\n\n\n\treturn CryptoJS.Blowfish;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./evpkdf\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./evpkdf\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Cipher core components.\n\t */\n\tCryptoJS.lib.Cipher || (function (undefined) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var WordArray = C_lib.WordArray;\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;\n\t var C_enc = C.enc;\n\t var Utf8 = C_enc.Utf8;\n\t var Base64 = C_enc.Base64;\n\t var C_algo = C.algo;\n\t var EvpKDF = C_algo.EvpKDF;\n\n\t /**\n\t * Abstract base cipher template.\n\t *\n\t * @property {number} keySize This cipher's key size. Default: 4 (128 bits)\n\t * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)\n\t * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.\n\t * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.\n\t */\n\t var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {WordArray} iv The IV to use for this operation.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Creates this cipher in encryption mode.\n\t *\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {Cipher} A cipher instance.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });\n\t */\n\t createEncryptor: function (key, cfg) {\n\t return this.create(this._ENC_XFORM_MODE, key, cfg);\n\t },\n\n\t /**\n\t * Creates this cipher in decryption mode.\n\t *\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {Cipher} A cipher instance.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });\n\t */\n\t createDecryptor: function (key, cfg) {\n\t return this.create(this._DEC_XFORM_MODE, key, cfg);\n\t },\n\n\t /**\n\t * Initializes a newly created cipher.\n\t *\n\t * @param {number} xformMode Either the encryption or decryption transormation mode constant.\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @example\n\t *\n\t * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });\n\t */\n\t init: function (xformMode, key, cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Store transform mode and key\n\t this._xformMode = xformMode;\n\t this._key = key;\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this cipher to its initial state.\n\t *\n\t * @example\n\t *\n\t * cipher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-cipher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Adds data to be encrypted or decrypted.\n\t *\n\t * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.\n\t *\n\t * @return {WordArray} The data after processing.\n\t *\n\t * @example\n\t *\n\t * var encrypted = cipher.process('data');\n\t * var encrypted = cipher.process(wordArray);\n\t */\n\t process: function (dataUpdate) {\n\t // Append\n\t this._append(dataUpdate);\n\n\t // Process available blocks\n\t return this._process();\n\t },\n\n\t /**\n\t * Finalizes the encryption or decryption process.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.\n\t *\n\t * @return {WordArray} The data after final processing.\n\t *\n\t * @example\n\t *\n\t * var encrypted = cipher.finalize();\n\t * var encrypted = cipher.finalize('data');\n\t * var encrypted = cipher.finalize(wordArray);\n\t */\n\t finalize: function (dataUpdate) {\n\t // Final data update\n\t if (dataUpdate) {\n\t this._append(dataUpdate);\n\t }\n\n\t // Perform concrete-cipher logic\n\t var finalProcessedData = this._doFinalize();\n\n\t return finalProcessedData;\n\t },\n\n\t keySize: 128/32,\n\n\t ivSize: 128/32,\n\n\t _ENC_XFORM_MODE: 1,\n\n\t _DEC_XFORM_MODE: 2,\n\n\t /**\n\t * Creates shortcut functions to a cipher's object interface.\n\t *\n\t * @param {Cipher} cipher The cipher to create a helper for.\n\t *\n\t * @return {Object} An object with encrypt and decrypt shortcut functions.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);\n\t */\n\t _createHelper: (function () {\n\t function selectCipherStrategy(key) {\n\t if (typeof key == 'string') {\n\t return PasswordBasedCipher;\n\t } else {\n\t return SerializableCipher;\n\t }\n\t }\n\n\t return function (cipher) {\n\t return {\n\t encrypt: function (message, key, cfg) {\n\t return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);\n\t },\n\n\t decrypt: function (ciphertext, key, cfg) {\n\t return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);\n\t }\n\t };\n\t };\n\t }())\n\t });\n\n\t /**\n\t * Abstract base stream cipher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)\n\t */\n\t var StreamCipher = C_lib.StreamCipher = Cipher.extend({\n\t _doFinalize: function () {\n\t // Process partial blocks\n\t var finalProcessedBlocks = this._process(!!'flush');\n\n\t return finalProcessedBlocks;\n\t },\n\n\t blockSize: 1\n\t });\n\n\t /**\n\t * Mode namespace.\n\t */\n\t var C_mode = C.mode = {};\n\n\t /**\n\t * Abstract base block cipher mode template.\n\t */\n\t var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({\n\t /**\n\t * Creates this mode for encryption.\n\t *\n\t * @param {Cipher} cipher A block cipher instance.\n\t * @param {Array} iv The IV words.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);\n\t */\n\t createEncryptor: function (cipher, iv) {\n\t return this.Encryptor.create(cipher, iv);\n\t },\n\n\t /**\n\t * Creates this mode for decryption.\n\t *\n\t * @param {Cipher} cipher A block cipher instance.\n\t * @param {Array} iv The IV words.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);\n\t */\n\t createDecryptor: function (cipher, iv) {\n\t return this.Decryptor.create(cipher, iv);\n\t },\n\n\t /**\n\t * Initializes a newly created mode.\n\t *\n\t * @param {Cipher} cipher A block cipher instance.\n\t * @param {Array} iv The IV words.\n\t *\n\t * @example\n\t *\n\t * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);\n\t */\n\t init: function (cipher, iv) {\n\t this._cipher = cipher;\n\t this._iv = iv;\n\t }\n\t });\n\n\t /**\n\t * Cipher Block Chaining mode.\n\t */\n\t var CBC = C_mode.CBC = (function () {\n\t /**\n\t * Abstract base CBC mode.\n\t */\n\t var CBC = BlockCipherMode.extend();\n\n\t /**\n\t * CBC encryptor.\n\t */\n\t CBC.Encryptor = CBC.extend({\n\t /**\n\t * Processes the data block at offset.\n\t *\n\t * @param {Array} words The data words to operate on.\n\t * @param {number} offset The offset where the block starts.\n\t *\n\t * @example\n\t *\n\t * mode.processBlock(data.words, offset);\n\t */\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher;\n\t var blockSize = cipher.blockSize;\n\n\t // XOR and encrypt\n\t xorBlock.call(this, words, offset, blockSize);\n\t cipher.encryptBlock(words, offset);\n\n\t // Remember this block to use with next block\n\t this._prevBlock = words.slice(offset, offset + blockSize);\n\t }\n\t });\n\n\t /**\n\t * CBC decryptor.\n\t */\n\t CBC.Decryptor = CBC.extend({\n\t /**\n\t * Processes the data block at offset.\n\t *\n\t * @param {Array} words The data words to operate on.\n\t * @param {number} offset The offset where the block starts.\n\t *\n\t * @example\n\t *\n\t * mode.processBlock(data.words, offset);\n\t */\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher;\n\t var blockSize = cipher.blockSize;\n\n\t // Remember this block to use with next block\n\t var thisBlock = words.slice(offset, offset + blockSize);\n\n\t // Decrypt and XOR\n\t cipher.decryptBlock(words, offset);\n\t xorBlock.call(this, words, offset, blockSize);\n\n\t // This block becomes the previous block\n\t this._prevBlock = thisBlock;\n\t }\n\t });\n\n\t function xorBlock(words, offset, blockSize) {\n\t var block;\n\n\t // Shortcut\n\t var iv = this._iv;\n\n\t // Choose mixing block\n\t if (iv) {\n\t block = iv;\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t } else {\n\t block = this._prevBlock;\n\t }\n\n\t // XOR blocks\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= block[i];\n\t }\n\t }\n\n\t return CBC;\n\t }());\n\n\t /**\n\t * Padding namespace.\n\t */\n\t var C_pad = C.pad = {};\n\n\t /**\n\t * PKCS #5/7 padding strategy.\n\t */\n\t var Pkcs7 = C_pad.Pkcs7 = {\n\t /**\n\t * Pads data using the algorithm defined in PKCS #5/7.\n\t *\n\t * @param {WordArray} data The data to pad.\n\t * @param {number} blockSize The multiple that the data should be padded to.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * CryptoJS.pad.Pkcs7.pad(wordArray, 4);\n\t */\n\t pad: function (data, blockSize) {\n\t // Shortcut\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count padding bytes\n\t var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;\n\n\t // Create padding word\n\t var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;\n\n\t // Create padding\n\t var paddingWords = [];\n\t for (var i = 0; i < nPaddingBytes; i += 4) {\n\t paddingWords.push(paddingWord);\n\t }\n\t var padding = WordArray.create(paddingWords, nPaddingBytes);\n\n\t // Add padding\n\t data.concat(padding);\n\t },\n\n\t /**\n\t * Unpads data that had been padded using the algorithm defined in PKCS #5/7.\n\t *\n\t * @param {WordArray} data The data to unpad.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * CryptoJS.pad.Pkcs7.unpad(wordArray);\n\t */\n\t unpad: function (data) {\n\t // Get number of padding bytes from last byte\n\t var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;\n\n\t // Remove padding\n\t data.sigBytes -= nPaddingBytes;\n\t }\n\t };\n\n\t /**\n\t * Abstract base block cipher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)\n\t */\n\t var BlockCipher = C_lib.BlockCipher = Cipher.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {Mode} mode The block mode to use. Default: CBC\n\t * @property {Padding} padding The padding strategy to use. Default: Pkcs7\n\t */\n\t cfg: Cipher.cfg.extend({\n\t mode: CBC,\n\t padding: Pkcs7\n\t }),\n\n\t reset: function () {\n\t var modeCreator;\n\n\t // Reset cipher\n\t Cipher.reset.call(this);\n\n\t // Shortcuts\n\t var cfg = this.cfg;\n\t var iv = cfg.iv;\n\t var mode = cfg.mode;\n\n\t // Reset block mode\n\t if (this._xformMode == this._ENC_XFORM_MODE) {\n\t modeCreator = mode.createEncryptor;\n\t } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {\n\t modeCreator = mode.createDecryptor;\n\t // Keep at least one block in the buffer for unpadding\n\t this._minBufferSize = 1;\n\t }\n\n\t if (this._mode && this._mode.__creator == modeCreator) {\n\t this._mode.init(this, iv && iv.words);\n\t } else {\n\t this._mode = modeCreator.call(mode, this, iv && iv.words);\n\t this._mode.__creator = modeCreator;\n\t }\n\t },\n\n\t _doProcessBlock: function (words, offset) {\n\t this._mode.processBlock(words, offset);\n\t },\n\n\t _doFinalize: function () {\n\t var finalProcessedBlocks;\n\n\t // Shortcut\n\t var padding = this.cfg.padding;\n\n\t // Finalize\n\t if (this._xformMode == this._ENC_XFORM_MODE) {\n\t // Pad data\n\t padding.pad(this._data, this.blockSize);\n\n\t // Process final blocks\n\t finalProcessedBlocks = this._process(!!'flush');\n\t } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {\n\t // Process final blocks\n\t finalProcessedBlocks = this._process(!!'flush');\n\n\t // Unpad data\n\t padding.unpad(finalProcessedBlocks);\n\t }\n\n\t return finalProcessedBlocks;\n\t },\n\n\t blockSize: 128/32\n\t });\n\n\t /**\n\t * A collection of cipher parameters.\n\t *\n\t * @property {WordArray} ciphertext The raw ciphertext.\n\t * @property {WordArray} key The key to this ciphertext.\n\t * @property {WordArray} iv The IV used in the ciphering operation.\n\t * @property {WordArray} salt The salt used with a key derivation function.\n\t * @property {Cipher} algorithm The cipher algorithm.\n\t * @property {Mode} mode The block mode used in the ciphering operation.\n\t * @property {Padding} padding The padding scheme used in the ciphering operation.\n\t * @property {number} blockSize The block size of the cipher.\n\t * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.\n\t */\n\t var CipherParams = C_lib.CipherParams = Base.extend({\n\t /**\n\t * Initializes a newly created cipher params object.\n\t *\n\t * @param {Object} cipherParams An object with any of the possible cipher parameters.\n\t *\n\t * @example\n\t *\n\t * var cipherParams = CryptoJS.lib.CipherParams.create({\n\t * ciphertext: ciphertextWordArray,\n\t * key: keyWordArray,\n\t * iv: ivWordArray,\n\t * salt: saltWordArray,\n\t * algorithm: CryptoJS.algo.AES,\n\t * mode: CryptoJS.mode.CBC,\n\t * padding: CryptoJS.pad.PKCS7,\n\t * blockSize: 4,\n\t * formatter: CryptoJS.format.OpenSSL\n\t * });\n\t */\n\t init: function (cipherParams) {\n\t this.mixIn(cipherParams);\n\t },\n\n\t /**\n\t * Converts this cipher params object to a string.\n\t *\n\t * @param {Format} formatter (Optional) The formatting strategy to use.\n\t *\n\t * @return {string} The stringified cipher params.\n\t *\n\t * @throws Error If neither the formatter nor the default formatter is set.\n\t *\n\t * @example\n\t *\n\t * var string = cipherParams + '';\n\t * var string = cipherParams.toString();\n\t * var string = cipherParams.toString(CryptoJS.format.OpenSSL);\n\t */\n\t toString: function (formatter) {\n\t return (formatter || this.formatter).stringify(this);\n\t }\n\t });\n\n\t /**\n\t * Format namespace.\n\t */\n\t var C_format = C.format = {};\n\n\t /**\n\t * OpenSSL formatting strategy.\n\t */\n\t var OpenSSLFormatter = C_format.OpenSSL = {\n\t /**\n\t * Converts a cipher params object to an OpenSSL-compatible string.\n\t *\n\t * @param {CipherParams} cipherParams The cipher params object.\n\t *\n\t * @return {string} The OpenSSL-compatible string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);\n\t */\n\t stringify: function (cipherParams) {\n\t var wordArray;\n\n\t // Shortcuts\n\t var ciphertext = cipherParams.ciphertext;\n\t var salt = cipherParams.salt;\n\n\t // Format\n\t if (salt) {\n\t wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);\n\t } else {\n\t wordArray = ciphertext;\n\t }\n\n\t return wordArray.toString(Base64);\n\t },\n\n\t /**\n\t * Converts an OpenSSL-compatible string to a cipher params object.\n\t *\n\t * @param {string} openSSLStr The OpenSSL-compatible string.\n\t *\n\t * @return {CipherParams} The cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);\n\t */\n\t parse: function (openSSLStr) {\n\t var salt;\n\n\t // Parse base64\n\t var ciphertext = Base64.parse(openSSLStr);\n\n\t // Shortcut\n\t var ciphertextWords = ciphertext.words;\n\n\t // Test for salt\n\t if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {\n\t // Extract salt\n\t salt = WordArray.create(ciphertextWords.slice(2, 4));\n\n\t // Remove salt from ciphertext\n\t ciphertextWords.splice(0, 4);\n\t ciphertext.sigBytes -= 16;\n\t }\n\n\t return CipherParams.create({ ciphertext: ciphertext, salt: salt });\n\t }\n\t };\n\n\t /**\n\t * A cipher wrapper that returns ciphertext as a serializable cipher params object.\n\t */\n\t var SerializableCipher = C_lib.SerializableCipher = Base.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL\n\t */\n\t cfg: Base.extend({\n\t format: OpenSSLFormatter\n\t }),\n\n\t /**\n\t * Encrypts a message.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {WordArray|string} message The message to encrypt.\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {CipherParams} A cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n\t */\n\t encrypt: function (cipher, message, key, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Encrypt\n\t var encryptor = cipher.createEncryptor(key, cfg);\n\t var ciphertext = encryptor.finalize(message);\n\n\t // Shortcut\n\t var cipherCfg = encryptor.cfg;\n\n\t // Create and return serializable cipher params\n\t return CipherParams.create({\n\t ciphertext: ciphertext,\n\t key: key,\n\t iv: cipherCfg.iv,\n\t algorithm: cipher,\n\t mode: cipherCfg.mode,\n\t padding: cipherCfg.padding,\n\t blockSize: cipher.blockSize,\n\t formatter: cfg.format\n\t });\n\t },\n\n\t /**\n\t * Decrypts serialized ciphertext.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {WordArray} The plaintext.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n\t * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n\t */\n\t decrypt: function (cipher, ciphertext, key, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Convert string to CipherParams\n\t ciphertext = this._parse(ciphertext, cfg.format);\n\n\t // Decrypt\n\t var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);\n\n\t return plaintext;\n\t },\n\n\t /**\n\t * Converts serialized ciphertext to CipherParams,\n\t * else assumed CipherParams already and returns ciphertext unchanged.\n\t *\n\t * @param {CipherParams|string} ciphertext The ciphertext.\n\t * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.\n\t *\n\t * @return {CipherParams} The unserialized ciphertext.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);\n\t */\n\t _parse: function (ciphertext, format) {\n\t if (typeof ciphertext == 'string') {\n\t return format.parse(ciphertext, this);\n\t } else {\n\t return ciphertext;\n\t }\n\t }\n\t });\n\n\t /**\n\t * Key derivation function namespace.\n\t */\n\t var C_kdf = C.kdf = {};\n\n\t /**\n\t * OpenSSL key derivation function.\n\t */\n\t var OpenSSLKdf = C_kdf.OpenSSL = {\n\t /**\n\t * Derives a key and IV from a password.\n\t *\n\t * @param {string} password The password to derive from.\n\t * @param {number} keySize The size in words of the key to generate.\n\t * @param {number} ivSize The size in words of the IV to generate.\n\t * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.\n\t *\n\t * @return {CipherParams} A cipher params object with the key, IV, and salt.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);\n\t * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');\n\t */\n\t execute: function (password, keySize, ivSize, salt, hasher) {\n\t // Generate random salt\n\t if (!salt) {\n\t salt = WordArray.random(64/8);\n\t }\n\n\t // Derive key and IV\n\t if (!hasher) {\n\t var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);\n\t } else {\n\t var key = EvpKDF.create({ keySize: keySize + ivSize, hasher: hasher }).compute(password, salt);\n\t }\n\n\n\t // Separate key and IV\n\t var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);\n\t key.sigBytes = keySize * 4;\n\n\t // Return params\n\t return CipherParams.create({ key: key, iv: iv, salt: salt });\n\t }\n\t };\n\n\t /**\n\t * A serializable cipher wrapper that derives the key from a password,\n\t * and returns ciphertext as a serializable cipher params object.\n\t */\n\t var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL\n\t */\n\t cfg: SerializableCipher.cfg.extend({\n\t kdf: OpenSSLKdf\n\t }),\n\n\t /**\n\t * Encrypts a message using a password.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {WordArray|string} message The message to encrypt.\n\t * @param {string} password The password.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {CipherParams} A cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');\n\t * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });\n\t */\n\t encrypt: function (cipher, message, password, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Derive key and other params\n\t var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher);\n\n\t // Add IV to config\n\t cfg.iv = derivedParams.iv;\n\n\t // Encrypt\n\t var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);\n\n\t // Mix in derived params\n\t ciphertext.mixIn(derivedParams);\n\n\t return ciphertext;\n\t },\n\n\t /**\n\t * Decrypts serialized ciphertext using a password.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n\t * @param {string} password The password.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {WordArray} The plaintext.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });\n\t * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });\n\t */\n\t decrypt: function (cipher, ciphertext, password, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Convert string to CipherParams\n\t ciphertext = this._parse(ciphertext, cfg.format);\n\n\t // Derive key and other params\n\t var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher);\n\n\t // Add IV to config\n\t cfg.iv = derivedParams.iv;\n\n\t // Decrypt\n\t var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);\n\n\t return plaintext;\n\t }\n\t });\n\t}());\n\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/*globals window, global, require*/\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\n\t var crypto;\n\n\t // Native crypto from window (Browser)\n\t if (typeof window !== 'undefined' && window.crypto) {\n\t crypto = window.crypto;\n\t }\n\n\t // Native crypto in web worker (Browser)\n\t if (typeof self !== 'undefined' && self.crypto) {\n\t crypto = self.crypto;\n\t }\n\n\t // Native crypto from worker\n\t if (typeof globalThis !== 'undefined' && globalThis.crypto) {\n\t crypto = globalThis.crypto;\n\t }\n\n\t // Native (experimental IE 11) crypto from window (Browser)\n\t if (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n\t crypto = window.msCrypto;\n\t }\n\n\t // Native crypto from global (NodeJS)\n\t if (!crypto && typeof global !== 'undefined' && global.crypto) {\n\t crypto = global.crypto;\n\t }\n\n\t // Native crypto import via require (NodeJS)\n\t if (!crypto && typeof require === 'function') {\n\t try {\n\t crypto = require('crypto');\n\t } catch (err) {}\n\t }\n\n\t /*\n\t * Cryptographically secure pseudorandom number generator\n\t *\n\t * As Math.random() is cryptographically not safe to use\n\t */\n\t var cryptoSecureRandomInt = function () {\n\t if (crypto) {\n\t // Use getRandomValues method (Browser)\n\t if (typeof crypto.getRandomValues === 'function') {\n\t try {\n\t return crypto.getRandomValues(new Uint32Array(1))[0];\n\t } catch (err) {}\n\t }\n\n\t // Use randomBytes method (NodeJS)\n\t if (typeof crypto.randomBytes === 'function') {\n\t try {\n\t return crypto.randomBytes(4).readInt32LE();\n\t } catch (err) {}\n\t }\n\t }\n\n\t throw new Error('Native crypto module could not be used to get secure random number.');\n\t };\n\n\t /*\n\t * Local polyfill of Object.create\n\n\t */\n\t var create = Object.create || (function () {\n\t function F() {}\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }());\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var j = 0; j < thatSigBytes; j += 4) {\n\t thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t for (var i = 0; i < nBytes; i += 4) {\n\t words.push(cryptoSecureRandomInt());\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t var processedWords;\n\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64 encoding strategy.\n\t */\n\t var Base64 = C_enc.Base64 = {\n\t /**\n\t * Converts a word array to a Base64 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Base64 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64 string to a word array.\n\t *\n\t * @param {string} base64Str The Base64 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64.parse(base64String);\n\t */\n\t parse: function (base64Str) {\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t var bitsCombined = bits1 | bits2;\n\t words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\n\treturn CryptoJS.enc.Base64;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64url encoding strategy.\n\t */\n\t var Base64url = C_enc.Base64url = {\n\t /**\n\t * Converts a word array to a Base64url string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {string} The Base64url string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);\n\t */\n\t stringify: function (wordArray, urlSafe) {\n\t if (urlSafe === undefined) {\n\t urlSafe = true\n\t }\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = urlSafe ? this._safe_map : this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64url string to a word array.\n\t *\n\t * @param {string} base64Str The Base64url string.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64url.parse(base64String);\n\t */\n\t parse: function (base64Str, urlSafe) {\n\t if (urlSafe === undefined) {\n\t urlSafe = true\n\t }\n\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = urlSafe ? this._safe_map : this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n\t _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t var bitsCombined = bits1 | bits2;\n\t words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\n\treturn CryptoJS.enc.Base64url;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * UTF-16 BE encoding strategy.\n\t */\n\t var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {\n\t /**\n\t * Converts a word array to a UTF-16 BE string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-16 BE string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var utf16Chars = [];\n\t for (var i = 0; i < sigBytes; i += 2) {\n\t var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;\n\t utf16Chars.push(String.fromCharCode(codePoint));\n\t }\n\n\t return utf16Chars.join('');\n\t },\n\n\t /**\n\t * Converts a UTF-16 BE string to a word array.\n\t *\n\t * @param {string} utf16Str The UTF-16 BE string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);\n\t */\n\t parse: function (utf16Str) {\n\t // Shortcut\n\t var utf16StrLength = utf16Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < utf16StrLength; i++) {\n\t words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);\n\t }\n\n\t return WordArray.create(words, utf16StrLength * 2);\n\t }\n\t };\n\n\t /**\n\t * UTF-16 LE encoding strategy.\n\t */\n\t C_enc.Utf16LE = {\n\t /**\n\t * Converts a word array to a UTF-16 LE string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-16 LE string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var utf16Chars = [];\n\t for (var i = 0; i < sigBytes; i += 2) {\n\t var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);\n\t utf16Chars.push(String.fromCharCode(codePoint));\n\t }\n\n\t return utf16Chars.join('');\n\t },\n\n\t /**\n\t * Converts a UTF-16 LE string to a word array.\n\t *\n\t * @param {string} utf16Str The UTF-16 LE string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);\n\t */\n\t parse: function (utf16Str) {\n\t // Shortcut\n\t var utf16StrLength = utf16Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < utf16StrLength; i++) {\n\t words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));\n\t }\n\n\t return WordArray.create(words, utf16StrLength * 2);\n\t }\n\t };\n\n\t function swapEndian(word) {\n\t return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);\n\t }\n\t}());\n\n\n\treturn CryptoJS.enc.Utf16;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./sha1\"), require(\"./hmac\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./sha1\", \"./hmac\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var WordArray = C_lib.WordArray;\n\t var C_algo = C.algo;\n\t var MD5 = C_algo.MD5;\n\n\t /**\n\t * This key derivation function is meant to conform with EVP_BytesToKey.\n\t * www.openssl.org/docs/crypto/EVP_BytesToKey.html\n\t */\n\t var EvpKDF = C_algo.EvpKDF = Base.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n\t * @property {Hasher} hasher The hash algorithm to use. Default: MD5\n\t * @property {number} iterations The number of iterations to perform. Default: 1\n\t */\n\t cfg: Base.extend({\n\t keySize: 128/32,\n\t hasher: MD5,\n\t iterations: 1\n\t }),\n\n\t /**\n\t * Initializes a newly created key derivation function.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n\t *\n\t * @example\n\t *\n\t * var kdf = CryptoJS.algo.EvpKDF.create();\n\t * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });\n\t * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });\n\t */\n\t init: function (cfg) {\n\t this.cfg = this.cfg.extend(cfg);\n\t },\n\n\t /**\n\t * Derives a key from a password.\n\t *\n\t * @param {WordArray|string} password The password.\n\t * @param {WordArray|string} salt A salt.\n\t *\n\t * @return {WordArray} The derived key.\n\t *\n\t * @example\n\t *\n\t * var key = kdf.compute(password, salt);\n\t */\n\t compute: function (password, salt) {\n\t var block;\n\n\t // Shortcut\n\t var cfg = this.cfg;\n\n\t // Init hasher\n\t var hasher = cfg.hasher.create();\n\n\t // Initial values\n\t var derivedKey = WordArray.create();\n\n\t // Shortcuts\n\t var derivedKeyWords = derivedKey.words;\n\t var keySize = cfg.keySize;\n\t var iterations = cfg.iterations;\n\n\t // Generate key\n\t while (derivedKeyWords.length < keySize) {\n\t if (block) {\n\t hasher.update(block);\n\t }\n\t block = hasher.update(password).finalize(salt);\n\t hasher.reset();\n\n\t // Iterations\n\t for (var i = 1; i < iterations; i++) {\n\t block = hasher.finalize(block);\n\t hasher.reset();\n\t }\n\n\t derivedKey.concat(block);\n\t }\n\t derivedKey.sigBytes = keySize * 4;\n\n\t return derivedKey;\n\t }\n\t });\n\n\t /**\n\t * Derives a key from a password.\n\t *\n\t * @param {WordArray|string} password The password.\n\t * @param {WordArray|string} salt A salt.\n\t * @param {Object} cfg (Optional) The configuration options to use for this computation.\n\t *\n\t * @return {WordArray} The derived key.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var key = CryptoJS.EvpKDF(password, salt);\n\t * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });\n\t * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });\n\t */\n\t C.EvpKDF = function (password, salt, cfg) {\n\t return EvpKDF.create(cfg).compute(password, salt);\n\t };\n\t}());\n\n\n\treturn CryptoJS.EvpKDF;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (undefined) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var CipherParams = C_lib.CipherParams;\n\t var C_enc = C.enc;\n\t var Hex = C_enc.Hex;\n\t var C_format = C.format;\n\n\t var HexFormatter = C_format.Hex = {\n\t /**\n\t * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.\n\t *\n\t * @param {CipherParams} cipherParams The cipher params object.\n\t *\n\t * @return {string} The hexadecimally encoded string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.format.Hex.stringify(cipherParams);\n\t */\n\t stringify: function (cipherParams) {\n\t return cipherParams.ciphertext.toString(Hex);\n\t },\n\n\t /**\n\t * Converts a hexadecimally encoded ciphertext string to a cipher params object.\n\t *\n\t * @param {string} input The hexadecimally encoded string.\n\t *\n\t * @return {CipherParams} The cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipherParams = CryptoJS.format.Hex.parse(hexString);\n\t */\n\t parse: function (input) {\n\t var ciphertext = Hex.parse(input);\n\t return CipherParams.create({ ciphertext: ciphertext });\n\t }\n\t };\n\t}());\n\n\n\treturn CryptoJS.format.Hex;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var C_enc = C.enc;\n\t var Utf8 = C_enc.Utf8;\n\t var C_algo = C.algo;\n\n\t /**\n\t * HMAC algorithm.\n\t */\n\t var HMAC = C_algo.HMAC = Base.extend({\n\t /**\n\t * Initializes a newly created HMAC.\n\t *\n\t * @param {Hasher} hasher The hash algorithm to use.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @example\n\t *\n\t * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);\n\t */\n\t init: function (hasher, key) {\n\t // Init hasher\n\t hasher = this._hasher = new hasher.init();\n\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof key == 'string') {\n\t key = Utf8.parse(key);\n\t }\n\n\t // Shortcuts\n\t var hasherBlockSize = hasher.blockSize;\n\t var hasherBlockSizeBytes = hasherBlockSize * 4;\n\n\t // Allow arbitrary length keys\n\t if (key.sigBytes > hasherBlockSizeBytes) {\n\t key = hasher.finalize(key);\n\t }\n\n\t // Clamp excess bits\n\t key.clamp();\n\n\t // Clone key for inner and outer pads\n\t var oKey = this._oKey = key.clone();\n\t var iKey = this._iKey = key.clone();\n\n\t // Shortcuts\n\t var oKeyWords = oKey.words;\n\t var iKeyWords = iKey.words;\n\n\t // XOR keys with pad constants\n\t for (var i = 0; i < hasherBlockSize; i++) {\n\t oKeyWords[i] ^= 0x5c5c5c5c;\n\t iKeyWords[i] ^= 0x36363636;\n\t }\n\t oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this HMAC to its initial state.\n\t *\n\t * @example\n\t *\n\t * hmacHasher.reset();\n\t */\n\t reset: function () {\n\t // Shortcut\n\t var hasher = this._hasher;\n\n\t // Reset\n\t hasher.reset();\n\t hasher.update(this._iKey);\n\t },\n\n\t /**\n\t * Updates this HMAC with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {HMAC} This HMAC instance.\n\t *\n\t * @example\n\t *\n\t * hmacHasher.update('message');\n\t * hmacHasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t this._hasher.update(messageUpdate);\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the HMAC computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @example\n\t *\n\t * var hmac = hmacHasher.finalize();\n\t * var hmac = hmacHasher.finalize('message');\n\t * var hmac = hmacHasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Shortcut\n\t var hasher = this._hasher;\n\n\t // Compute HMAC\n\t var innerHash = hasher.finalize(messageUpdate);\n\t hasher.reset();\n\t var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));\n\n\t return hmac;\n\t }\n\t });\n\t}());\n\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./x64-core\"), require(\"./lib-typedarrays\"), require(\"./enc-utf16\"), require(\"./enc-base64\"), require(\"./enc-base64url\"), require(\"./md5\"), require(\"./sha1\"), require(\"./sha256\"), require(\"./sha224\"), require(\"./sha512\"), require(\"./sha384\"), require(\"./sha3\"), require(\"./ripemd160\"), require(\"./hmac\"), require(\"./pbkdf2\"), require(\"./evpkdf\"), require(\"./cipher-core\"), require(\"./mode-cfb\"), require(\"./mode-ctr\"), require(\"./mode-ctr-gladman\"), require(\"./mode-ofb\"), require(\"./mode-ecb\"), require(\"./pad-ansix923\"), require(\"./pad-iso10126\"), require(\"./pad-iso97971\"), require(\"./pad-zeropadding\"), require(\"./pad-nopadding\"), require(\"./format-hex\"), require(\"./aes\"), require(\"./tripledes\"), require(\"./rc4\"), require(\"./rabbit\"), require(\"./rabbit-legacy\"), require(\"./blowfish\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./x64-core\", \"./lib-typedarrays\", \"./enc-utf16\", \"./enc-base64\", \"./enc-base64url\", \"./md5\", \"./sha1\", \"./sha256\", \"./sha224\", \"./sha512\", \"./sha384\", \"./sha3\", \"./ripemd160\", \"./hmac\", \"./pbkdf2\", \"./evpkdf\", \"./cipher-core\", \"./mode-cfb\", \"./mode-ctr\", \"./mode-ctr-gladman\", \"./mode-ofb\", \"./mode-ecb\", \"./pad-ansix923\", \"./pad-iso10126\", \"./pad-iso97971\", \"./pad-zeropadding\", \"./pad-nopadding\", \"./format-hex\", \"./aes\", \"./tripledes\", \"./rc4\", \"./rabbit\", \"./rabbit-legacy\", \"./blowfish\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Check if typed arrays are supported\n\t if (typeof ArrayBuffer != 'function') {\n\t return;\n\t }\n\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\n\t // Reference original init\n\t var superInit = WordArray.init;\n\n\t // Augment WordArray.init to handle typed arrays\n\t var subInit = WordArray.init = function (typedArray) {\n\t // Convert buffers to uint8\n\t if (typedArray instanceof ArrayBuffer) {\n\t typedArray = new Uint8Array(typedArray);\n\t }\n\n\t // Convert other array views to uint8\n\t if (\n\t typedArray instanceof Int8Array ||\n\t (typeof Uint8ClampedArray !== \"undefined\" && typedArray instanceof Uint8ClampedArray) ||\n\t typedArray instanceof Int16Array ||\n\t typedArray instanceof Uint16Array ||\n\t typedArray instanceof Int32Array ||\n\t typedArray instanceof Uint32Array ||\n\t typedArray instanceof Float32Array ||\n\t typedArray instanceof Float64Array\n\t ) {\n\t typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);\n\t }\n\n\t // Handle Uint8Array\n\t if (typedArray instanceof Uint8Array) {\n\t // Shortcut\n\t var typedArrayByteLength = typedArray.byteLength;\n\n\t // Extract bytes\n\t var words = [];\n\t for (var i = 0; i < typedArrayByteLength; i++) {\n\t words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);\n\t }\n\n\t // Initialize this word array\n\t superInit.call(this, words, typedArrayByteLength);\n\t } else {\n\t // Else call normal init\n\t superInit.apply(this, arguments);\n\t }\n\t };\n\n\t subInit.prototype = WordArray;\n\t}());\n\n\n\treturn CryptoJS.lib.WordArray;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Constants table\n\t var T = [];\n\n\t // Compute constants\n\t (function () {\n\t for (var i = 0; i < 64; i++) {\n\t T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;\n\t }\n\t }());\n\n\t /**\n\t * MD5 hash algorithm.\n\t */\n\t var MD5 = C_algo.MD5 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0x67452301, 0xefcdab89,\n\t 0x98badcfe, 0x10325476\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Swap endian\n\t for (var i = 0; i < 16; i++) {\n\t // Shortcuts\n\t var offset_i = offset + i;\n\t var M_offset_i = M[offset_i];\n\n\t M[offset_i] = (\n\t (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |\n\t (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)\n\t );\n\t }\n\n\t // Shortcuts\n\t var H = this._hash.words;\n\n\t var M_offset_0 = M[offset + 0];\n\t var M_offset_1 = M[offset + 1];\n\t var M_offset_2 = M[offset + 2];\n\t var M_offset_3 = M[offset + 3];\n\t var M_offset_4 = M[offset + 4];\n\t var M_offset_5 = M[offset + 5];\n\t var M_offset_6 = M[offset + 6];\n\t var M_offset_7 = M[offset + 7];\n\t var M_offset_8 = M[offset + 8];\n\t var M_offset_9 = M[offset + 9];\n\t var M_offset_10 = M[offset + 10];\n\t var M_offset_11 = M[offset + 11];\n\t var M_offset_12 = M[offset + 12];\n\t var M_offset_13 = M[offset + 13];\n\t var M_offset_14 = M[offset + 14];\n\t var M_offset_15 = M[offset + 15];\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\n\t // Computation\n\t a = FF(a, b, c, d, M_offset_0, 7, T[0]);\n\t d = FF(d, a, b, c, M_offset_1, 12, T[1]);\n\t c = FF(c, d, a, b, M_offset_2, 17, T[2]);\n\t b = FF(b, c, d, a, M_offset_3, 22, T[3]);\n\t a = FF(a, b, c, d, M_offset_4, 7, T[4]);\n\t d = FF(d, a, b, c, M_offset_5, 12, T[5]);\n\t c = FF(c, d, a, b, M_offset_6, 17, T[6]);\n\t b = FF(b, c, d, a, M_offset_7, 22, T[7]);\n\t a = FF(a, b, c, d, M_offset_8, 7, T[8]);\n\t d = FF(d, a, b, c, M_offset_9, 12, T[9]);\n\t c = FF(c, d, a, b, M_offset_10, 17, T[10]);\n\t b = FF(b, c, d, a, M_offset_11, 22, T[11]);\n\t a = FF(a, b, c, d, M_offset_12, 7, T[12]);\n\t d = FF(d, a, b, c, M_offset_13, 12, T[13]);\n\t c = FF(c, d, a, b, M_offset_14, 17, T[14]);\n\t b = FF(b, c, d, a, M_offset_15, 22, T[15]);\n\n\t a = GG(a, b, c, d, M_offset_1, 5, T[16]);\n\t d = GG(d, a, b, c, M_offset_6, 9, T[17]);\n\t c = GG(c, d, a, b, M_offset_11, 14, T[18]);\n\t b = GG(b, c, d, a, M_offset_0, 20, T[19]);\n\t a = GG(a, b, c, d, M_offset_5, 5, T[20]);\n\t d = GG(d, a, b, c, M_offset_10, 9, T[21]);\n\t c = GG(c, d, a, b, M_offset_15, 14, T[22]);\n\t b = GG(b, c, d, a, M_offset_4, 20, T[23]);\n\t a = GG(a, b, c, d, M_offset_9, 5, T[24]);\n\t d = GG(d, a, b, c, M_offset_14, 9, T[25]);\n\t c = GG(c, d, a, b, M_offset_3, 14, T[26]);\n\t b = GG(b, c, d, a, M_offset_8, 20, T[27]);\n\t a = GG(a, b, c, d, M_offset_13, 5, T[28]);\n\t d = GG(d, a, b, c, M_offset_2, 9, T[29]);\n\t c = GG(c, d, a, b, M_offset_7, 14, T[30]);\n\t b = GG(b, c, d, a, M_offset_12, 20, T[31]);\n\n\t a = HH(a, b, c, d, M_offset_5, 4, T[32]);\n\t d = HH(d, a, b, c, M_offset_8, 11, T[33]);\n\t c = HH(c, d, a, b, M_offset_11, 16, T[34]);\n\t b = HH(b, c, d, a, M_offset_14, 23, T[35]);\n\t a = HH(a, b, c, d, M_offset_1, 4, T[36]);\n\t d = HH(d, a, b, c, M_offset_4, 11, T[37]);\n\t c = HH(c, d, a, b, M_offset_7, 16, T[38]);\n\t b = HH(b, c, d, a, M_offset_10, 23, T[39]);\n\t a = HH(a, b, c, d, M_offset_13, 4, T[40]);\n\t d = HH(d, a, b, c, M_offset_0, 11, T[41]);\n\t c = HH(c, d, a, b, M_offset_3, 16, T[42]);\n\t b = HH(b, c, d, a, M_offset_6, 23, T[43]);\n\t a = HH(a, b, c, d, M_offset_9, 4, T[44]);\n\t d = HH(d, a, b, c, M_offset_12, 11, T[45]);\n\t c = HH(c, d, a, b, M_offset_15, 16, T[46]);\n\t b = HH(b, c, d, a, M_offset_2, 23, T[47]);\n\n\t a = II(a, b, c, d, M_offset_0, 6, T[48]);\n\t d = II(d, a, b, c, M_offset_7, 10, T[49]);\n\t c = II(c, d, a, b, M_offset_14, 15, T[50]);\n\t b = II(b, c, d, a, M_offset_5, 21, T[51]);\n\t a = II(a, b, c, d, M_offset_12, 6, T[52]);\n\t d = II(d, a, b, c, M_offset_3, 10, T[53]);\n\t c = II(c, d, a, b, M_offset_10, 15, T[54]);\n\t b = II(b, c, d, a, M_offset_1, 21, T[55]);\n\t a = II(a, b, c, d, M_offset_8, 6, T[56]);\n\t d = II(d, a, b, c, M_offset_15, 10, T[57]);\n\t c = II(c, d, a, b, M_offset_6, 15, T[58]);\n\t b = II(b, c, d, a, M_offset_13, 21, T[59]);\n\t a = II(a, b, c, d, M_offset_4, 6, T[60]);\n\t d = II(d, a, b, c, M_offset_11, 10, T[61]);\n\t c = II(c, d, a, b, M_offset_2, 15, T[62]);\n\t b = II(b, c, d, a, M_offset_9, 21, T[63]);\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\n\t var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);\n\t var nBitsTotalL = nBitsTotal;\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (\n\t (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)\n\t );\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (\n\t (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)\n\t );\n\n\t data.sigBytes = (dataWords.length + 1) * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Shortcuts\n\t var hash = this._hash;\n\t var H = hash.words;\n\n\t // Swap endian\n\t for (var i = 0; i < 4; i++) {\n\t // Shortcut\n\t var H_i = H[i];\n\n\t H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |\n\t (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);\n\t }\n\n\t // Return final computed hash\n\t return hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t function FF(a, b, c, d, x, s, t) {\n\t var n = a + ((b & c) | (~b & d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function GG(a, b, c, d, x, s, t) {\n\t var n = a + ((b & d) | (c & ~d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function HH(a, b, c, d, x, s, t) {\n\t var n = a + (b ^ c ^ d) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function II(a, b, c, d, x, s, t) {\n\t var n = a + (c ^ (b | ~d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.MD5('message');\n\t * var hash = CryptoJS.MD5(wordArray);\n\t */\n\t C.MD5 = Hasher._createHelper(MD5);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacMD5(message, key);\n\t */\n\t C.HmacMD5 = Hasher._createHmacHelper(MD5);\n\t}(Math));\n\n\n\treturn CryptoJS.MD5;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Cipher Feedback block mode.\n\t */\n\tCryptoJS.mode.CFB = (function () {\n\t var CFB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t CFB.Encryptor = CFB.extend({\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher;\n\t var blockSize = cipher.blockSize;\n\n\t generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);\n\n\t // Remember this block to use with next block\n\t this._prevBlock = words.slice(offset, offset + blockSize);\n\t }\n\t });\n\n\t CFB.Decryptor = CFB.extend({\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher;\n\t var blockSize = cipher.blockSize;\n\n\t // Remember this block to use with next block\n\t var thisBlock = words.slice(offset, offset + blockSize);\n\n\t generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);\n\n\t // This block becomes the previous block\n\t this._prevBlock = thisBlock;\n\t }\n\t });\n\n\t function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {\n\t var keystream;\n\n\t // Shortcut\n\t var iv = this._iv;\n\n\t // Generate keystream\n\t if (iv) {\n\t keystream = iv.slice(0);\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t } else {\n\t keystream = this._prevBlock;\n\t }\n\t cipher.encryptBlock(keystream, 0);\n\n\t // Encrypt\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= keystream[i];\n\t }\n\t }\n\n\t return CFB;\n\t}());\n\n\n\treturn CryptoJS.mode.CFB;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/** @preserve\n\t * Counter block mode compatible with Dr Brian Gladman fileenc.c\n\t * derived from CryptoJS.mode.CTR\n\t * Jan Hruby jhruby.web@gmail.com\n\t */\n\tCryptoJS.mode.CTRGladman = (function () {\n\t var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\tfunction incWord(word)\n\t\t{\n\t\t\tif (((word >> 24) & 0xff) === 0xff) { //overflow\n\t\t\tvar b1 = (word >> 16)&0xff;\n\t\t\tvar b2 = (word >> 8)&0xff;\n\t\t\tvar b3 = word & 0xff;\n\n\t\t\tif (b1 === 0xff) // overflow b1\n\t\t\t{\n\t\t\tb1 = 0;\n\t\t\tif (b2 === 0xff)\n\t\t\t{\n\t\t\t\tb2 = 0;\n\t\t\t\tif (b3 === 0xff)\n\t\t\t\t{\n\t\t\t\t\tb3 = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t++b3;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t++b2;\n\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t++b1;\n\t\t\t}\n\n\t\t\tword = 0;\n\t\t\tword += (b1 << 16);\n\t\t\tword += (b2 << 8);\n\t\t\tword += b3;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\tword += (0x01 << 24);\n\t\t\t}\n\t\t\treturn word;\n\t\t}\n\n\t\tfunction incCounter(counter)\n\t\t{\n\t\t\tif ((counter[0] = incWord(counter[0])) === 0)\n\t\t\t{\n\t\t\t\t// encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8\n\t\t\t\tcounter[1] = incWord(counter[1]);\n\t\t\t}\n\t\t\treturn counter;\n\t\t}\n\n\t var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher\n\t var blockSize = cipher.blockSize;\n\t var iv = this._iv;\n\t var counter = this._counter;\n\n\t // Generate keystream\n\t if (iv) {\n\t counter = this._counter = iv.slice(0);\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t }\n\n\t\t\t\tincCounter(counter);\n\n\t\t\t\tvar keystream = counter.slice(0);\n\t cipher.encryptBlock(keystream, 0);\n\n\t // Encrypt\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= keystream[i];\n\t }\n\t }\n\t });\n\n\t CTRGladman.Decryptor = Encryptor;\n\n\t return CTRGladman;\n\t}());\n\n\n\n\n\treturn CryptoJS.mode.CTRGladman;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Counter block mode.\n\t */\n\tCryptoJS.mode.CTR = (function () {\n\t var CTR = CryptoJS.lib.BlockCipherMode.extend();\n\n\t var Encryptor = CTR.Encryptor = CTR.extend({\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher\n\t var blockSize = cipher.blockSize;\n\t var iv = this._iv;\n\t var counter = this._counter;\n\n\t // Generate keystream\n\t if (iv) {\n\t counter = this._counter = iv.slice(0);\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t }\n\t var keystream = counter.slice(0);\n\t cipher.encryptBlock(keystream, 0);\n\n\t // Increment counter\n\t counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0\n\n\t // Encrypt\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= keystream[i];\n\t }\n\t }\n\t });\n\n\t CTR.Decryptor = Encryptor;\n\n\t return CTR;\n\t}());\n\n\n\treturn CryptoJS.mode.CTR;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Electronic Codebook block mode.\n\t */\n\tCryptoJS.mode.ECB = (function () {\n\t var ECB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t ECB.Encryptor = ECB.extend({\n\t processBlock: function (words, offset) {\n\t this._cipher.encryptBlock(words, offset);\n\t }\n\t });\n\n\t ECB.Decryptor = ECB.extend({\n\t processBlock: function (words, offset) {\n\t this._cipher.decryptBlock(words, offset);\n\t }\n\t });\n\n\t return ECB;\n\t}());\n\n\n\treturn CryptoJS.mode.ECB;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Output Feedback block mode.\n\t */\n\tCryptoJS.mode.OFB = (function () {\n\t var OFB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t var Encryptor = OFB.Encryptor = OFB.extend({\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher\n\t var blockSize = cipher.blockSize;\n\t var iv = this._iv;\n\t var keystream = this._keystream;\n\n\t // Generate keystream\n\t if (iv) {\n\t keystream = this._keystream = iv.slice(0);\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t }\n\t cipher.encryptBlock(keystream, 0);\n\n\t // Encrypt\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= keystream[i];\n\t }\n\t }\n\t });\n\n\t OFB.Decryptor = Encryptor;\n\n\t return OFB;\n\t}());\n\n\n\treturn CryptoJS.mode.OFB;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * ANSI X.923 padding strategy.\n\t */\n\tCryptoJS.pad.AnsiX923 = {\n\t pad: function (data, blockSize) {\n\t // Shortcuts\n\t var dataSigBytes = data.sigBytes;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count padding bytes\n\t var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;\n\n\t // Compute last byte position\n\t var lastBytePos = dataSigBytes + nPaddingBytes - 1;\n\n\t // Pad\n\t data.clamp();\n\t data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);\n\t data.sigBytes += nPaddingBytes;\n\t },\n\n\t unpad: function (data) {\n\t // Get number of padding bytes from last byte\n\t var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;\n\n\t // Remove padding\n\t data.sigBytes -= nPaddingBytes;\n\t }\n\t};\n\n\n\treturn CryptoJS.pad.Ansix923;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * ISO 10126 padding strategy.\n\t */\n\tCryptoJS.pad.Iso10126 = {\n\t pad: function (data, blockSize) {\n\t // Shortcut\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count padding bytes\n\t var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;\n\n\t // Pad\n\t data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).\n\t concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));\n\t },\n\n\t unpad: function (data) {\n\t // Get number of padding bytes from last byte\n\t var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;\n\n\t // Remove padding\n\t data.sigBytes -= nPaddingBytes;\n\t }\n\t};\n\n\n\treturn CryptoJS.pad.Iso10126;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * ISO/IEC 9797-1 Padding Method 2.\n\t */\n\tCryptoJS.pad.Iso97971 = {\n\t pad: function (data, blockSize) {\n\t // Add 0x80 byte\n\t data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));\n\n\t // Zero pad the rest\n\t CryptoJS.pad.ZeroPadding.pad(data, blockSize);\n\t },\n\n\t unpad: function (data) {\n\t // Remove zero padding\n\t CryptoJS.pad.ZeroPadding.unpad(data);\n\n\t // Remove one more byte -- the 0x80 byte\n\t data.sigBytes--;\n\t }\n\t};\n\n\n\treturn CryptoJS.pad.Iso97971;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * A noop padding strategy.\n\t */\n\tCryptoJS.pad.NoPadding = {\n\t pad: function () {\n\t },\n\n\t unpad: function () {\n\t }\n\t};\n\n\n\treturn CryptoJS.pad.NoPadding;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Zero padding strategy.\n\t */\n\tCryptoJS.pad.ZeroPadding = {\n\t pad: function (data, blockSize) {\n\t // Shortcut\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Pad\n\t data.clamp();\n\t data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);\n\t },\n\n\t unpad: function (data) {\n\t // Shortcut\n\t var dataWords = data.words;\n\n\t // Unpad\n\t var i = data.sigBytes - 1;\n\t for (var i = data.sigBytes - 1; i >= 0; i--) {\n\t if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {\n\t data.sigBytes = i + 1;\n\t break;\n\t }\n\t }\n\t }\n\t};\n\n\n\treturn CryptoJS.pad.ZeroPadding;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./sha256\"), require(\"./hmac\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./sha256\", \"./hmac\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var WordArray = C_lib.WordArray;\n\t var C_algo = C.algo;\n\t var SHA256 = C_algo.SHA256;\n\t var HMAC = C_algo.HMAC;\n\n\t /**\n\t * Password-Based Key Derivation Function 2 algorithm.\n\t */\n\t var PBKDF2 = C_algo.PBKDF2 = Base.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n\t * @property {Hasher} hasher The hasher to use. Default: SHA256\n\t * @property {number} iterations The number of iterations to perform. Default: 250000\n\t */\n\t cfg: Base.extend({\n\t keySize: 128/32,\n\t hasher: SHA256,\n\t iterations: 250000\n\t }),\n\n\t /**\n\t * Initializes a newly created key derivation function.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n\t *\n\t * @example\n\t *\n\t * var kdf = CryptoJS.algo.PBKDF2.create();\n\t * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });\n\t * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });\n\t */\n\t init: function (cfg) {\n\t this.cfg = this.cfg.extend(cfg);\n\t },\n\n\t /**\n\t * Computes the Password-Based Key Derivation Function 2.\n\t *\n\t * @param {WordArray|string} password The password.\n\t * @param {WordArray|string} salt A salt.\n\t *\n\t * @return {WordArray} The derived key.\n\t *\n\t * @example\n\t *\n\t * var key = kdf.compute(password, salt);\n\t */\n\t compute: function (password, salt) {\n\t // Shortcut\n\t var cfg = this.cfg;\n\n\t // Init HMAC\n\t var hmac = HMAC.create(cfg.hasher, password);\n\n\t // Initial values\n\t var derivedKey = WordArray.create();\n\t var blockIndex = WordArray.create([0x00000001]);\n\n\t // Shortcuts\n\t var derivedKeyWords = derivedKey.words;\n\t var blockIndexWords = blockIndex.words;\n\t var keySize = cfg.keySize;\n\t var iterations = cfg.iterations;\n\n\t // Generate key\n\t while (derivedKeyWords.length < keySize) {\n\t var block = hmac.update(salt).finalize(blockIndex);\n\t hmac.reset();\n\n\t // Shortcuts\n\t var blockWords = block.words;\n\t var blockWordsLength = blockWords.length;\n\n\t // Iterations\n\t var intermediate = block;\n\t for (var i = 1; i < iterations; i++) {\n\t intermediate = hmac.finalize(intermediate);\n\t hmac.reset();\n\n\t // Shortcut\n\t var intermediateWords = intermediate.words;\n\n\t // XOR intermediate with block\n\t for (var j = 0; j < blockWordsLength; j++) {\n\t blockWords[j] ^= intermediateWords[j];\n\t }\n\t }\n\n\t derivedKey.concat(block);\n\t blockIndexWords[0]++;\n\t }\n\t derivedKey.sigBytes = keySize * 4;\n\n\t return derivedKey;\n\t }\n\t });\n\n\t /**\n\t * Computes the Password-Based Key Derivation Function 2.\n\t *\n\t * @param {WordArray|string} password The password.\n\t * @param {WordArray|string} salt A salt.\n\t * @param {Object} cfg (Optional) The configuration options to use for this computation.\n\t *\n\t * @return {WordArray} The derived key.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var key = CryptoJS.PBKDF2(password, salt);\n\t * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });\n\t * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });\n\t */\n\t C.PBKDF2 = function (password, salt, cfg) {\n\t return PBKDF2.create(cfg).compute(password, salt);\n\t };\n\t}());\n\n\n\treturn CryptoJS.PBKDF2;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var StreamCipher = C_lib.StreamCipher;\n\t var C_algo = C.algo;\n\n\t // Reusable objects\n\t var S = [];\n\t var C_ = [];\n\t var G = [];\n\n\t /**\n\t * Rabbit stream cipher algorithm.\n\t *\n\t * This is a legacy version that neglected to convert the key to little-endian.\n\t * This error doesn't affect the cipher's security,\n\t * but it does affect its compatibility with other implementations.\n\t */\n\t var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({\n\t _doReset: function () {\n\t // Shortcuts\n\t var K = this._key.words;\n\t var iv = this.cfg.iv;\n\n\t // Generate initial state values\n\t var X = this._X = [\n\t K[0], (K[3] << 16) | (K[2] >>> 16),\n\t K[1], (K[0] << 16) | (K[3] >>> 16),\n\t K[2], (K[1] << 16) | (K[0] >>> 16),\n\t K[3], (K[2] << 16) | (K[1] >>> 16)\n\t ];\n\n\t // Generate initial counter values\n\t var C = this._C = [\n\t (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),\n\t (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),\n\t (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),\n\t (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)\n\t ];\n\n\t // Carry bit\n\t this._b = 0;\n\n\t // Iterate the system four times\n\t for (var i = 0; i < 4; i++) {\n\t nextState.call(this);\n\t }\n\n\t // Modify the counters\n\t for (var i = 0; i < 8; i++) {\n\t C[i] ^= X[(i + 4) & 7];\n\t }\n\n\t // IV setup\n\t if (iv) {\n\t // Shortcuts\n\t var IV = iv.words;\n\t var IV_0 = IV[0];\n\t var IV_1 = IV[1];\n\n\t // Generate four subvectors\n\t var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);\n\t var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);\n\t var i1 = (i0 >>> 16) | (i2 & 0xffff0000);\n\t var i3 = (i2 << 16) | (i0 & 0x0000ffff);\n\n\t // Modify counter values\n\t C[0] ^= i0;\n\t C[1] ^= i1;\n\t C[2] ^= i2;\n\t C[3] ^= i3;\n\t C[4] ^= i0;\n\t C[5] ^= i1;\n\t C[6] ^= i2;\n\t C[7] ^= i3;\n\n\t // Iterate the system four times\n\t for (var i = 0; i < 4; i++) {\n\t nextState.call(this);\n\t }\n\t }\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var X = this._X;\n\n\t // Iterate the system\n\t nextState.call(this);\n\n\t // Generate four keystream words\n\t S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);\n\t S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);\n\t S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);\n\t S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);\n\n\t for (var i = 0; i < 4; i++) {\n\t // Swap endian\n\t S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |\n\t (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);\n\n\t // Encrypt\n\t M[offset + i] ^= S[i];\n\t }\n\t },\n\n\t blockSize: 128/32,\n\n\t ivSize: 64/32\n\t });\n\n\t function nextState() {\n\t // Shortcuts\n\t var X = this._X;\n\t var C = this._C;\n\n\t // Save old counter values\n\t for (var i = 0; i < 8; i++) {\n\t C_[i] = C[i];\n\t }\n\n\t // Calculate new counter values\n\t C[0] = (C[0] + 0x4d34d34d + this._b) | 0;\n\t C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;\n\t C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;\n\t C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;\n\t C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;\n\t C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;\n\t C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;\n\t C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;\n\t this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;\n\n\t // Calculate the g-values\n\t for (var i = 0; i < 8; i++) {\n\t var gx = X[i] + C[i];\n\n\t // Construct high and low argument for squaring\n\t var ga = gx & 0xffff;\n\t var gb = gx >>> 16;\n\n\t // Calculate high and low result of squaring\n\t var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;\n\t var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);\n\n\t // High XOR low\n\t G[i] = gh ^ gl;\n\t }\n\n\t // Calculate new state values\n\t X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;\n\t X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;\n\t X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;\n\t X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;\n\t X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;\n\t X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;\n\t X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;\n\t X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;\n\t }\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);\n\t */\n\t C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);\n\t}());\n\n\n\treturn CryptoJS.RabbitLegacy;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var StreamCipher = C_lib.StreamCipher;\n\t var C_algo = C.algo;\n\n\t // Reusable objects\n\t var S = [];\n\t var C_ = [];\n\t var G = [];\n\n\t /**\n\t * Rabbit stream cipher algorithm\n\t */\n\t var Rabbit = C_algo.Rabbit = StreamCipher.extend({\n\t _doReset: function () {\n\t // Shortcuts\n\t var K = this._key.words;\n\t var iv = this.cfg.iv;\n\n\t // Swap endian\n\t for (var i = 0; i < 4; i++) {\n\t K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) |\n\t (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);\n\t }\n\n\t // Generate initial state values\n\t var X = this._X = [\n\t K[0], (K[3] << 16) | (K[2] >>> 16),\n\t K[1], (K[0] << 16) | (K[3] >>> 16),\n\t K[2], (K[1] << 16) | (K[0] >>> 16),\n\t K[3], (K[2] << 16) | (K[1] >>> 16)\n\t ];\n\n\t // Generate initial counter values\n\t var C = this._C = [\n\t (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),\n\t (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),\n\t (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),\n\t (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)\n\t ];\n\n\t // Carry bit\n\t this._b = 0;\n\n\t // Iterate the system four times\n\t for (var i = 0; i < 4; i++) {\n\t nextState.call(this);\n\t }\n\n\t // Modify the counters\n\t for (var i = 0; i < 8; i++) {\n\t C[i] ^= X[(i + 4) & 7];\n\t }\n\n\t // IV setup\n\t if (iv) {\n\t // Shortcuts\n\t var IV = iv.words;\n\t var IV_0 = IV[0];\n\t var IV_1 = IV[1];\n\n\t // Generate four subvectors\n\t var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);\n\t var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);\n\t var i1 = (i0 >>> 16) | (i2 & 0xffff0000);\n\t var i3 = (i2 << 16) | (i0 & 0x0000ffff);\n\n\t // Modify counter values\n\t C[0] ^= i0;\n\t C[1] ^= i1;\n\t C[2] ^= i2;\n\t C[3] ^= i3;\n\t C[4] ^= i0;\n\t C[5] ^= i1;\n\t C[6] ^= i2;\n\t C[7] ^= i3;\n\n\t // Iterate the system four times\n\t for (var i = 0; i < 4; i++) {\n\t nextState.call(this);\n\t }\n\t }\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var X = this._X;\n\n\t // Iterate the system\n\t nextState.call(this);\n\n\t // Generate four keystream words\n\t S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);\n\t S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);\n\t S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);\n\t S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);\n\n\t for (var i = 0; i < 4; i++) {\n\t // Swap endian\n\t S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |\n\t (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);\n\n\t // Encrypt\n\t M[offset + i] ^= S[i];\n\t }\n\t },\n\n\t blockSize: 128/32,\n\n\t ivSize: 64/32\n\t });\n\n\t function nextState() {\n\t // Shortcuts\n\t var X = this._X;\n\t var C = this._C;\n\n\t // Save old counter values\n\t for (var i = 0; i < 8; i++) {\n\t C_[i] = C[i];\n\t }\n\n\t // Calculate new counter values\n\t C[0] = (C[0] + 0x4d34d34d + this._b) | 0;\n\t C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;\n\t C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;\n\t C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;\n\t C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;\n\t C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;\n\t C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;\n\t C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;\n\t this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;\n\n\t // Calculate the g-values\n\t for (var i = 0; i < 8; i++) {\n\t var gx = X[i] + C[i];\n\n\t // Construct high and low argument for squaring\n\t var ga = gx & 0xffff;\n\t var gb = gx >>> 16;\n\n\t // Calculate high and low result of squaring\n\t var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;\n\t var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);\n\n\t // High XOR low\n\t G[i] = gh ^ gl;\n\t }\n\n\t // Calculate new state values\n\t X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;\n\t X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;\n\t X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;\n\t X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;\n\t X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;\n\t X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;\n\t X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;\n\t X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;\n\t }\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);\n\t */\n\t C.Rabbit = StreamCipher._createHelper(Rabbit);\n\t}());\n\n\n\treturn CryptoJS.Rabbit;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var StreamCipher = C_lib.StreamCipher;\n\t var C_algo = C.algo;\n\n\t /**\n\t * RC4 stream cipher algorithm.\n\t */\n\t var RC4 = C_algo.RC4 = StreamCipher.extend({\n\t _doReset: function () {\n\t // Shortcuts\n\t var key = this._key;\n\t var keyWords = key.words;\n\t var keySigBytes = key.sigBytes;\n\n\t // Init sbox\n\t var S = this._S = [];\n\t for (var i = 0; i < 256; i++) {\n\t S[i] = i;\n\t }\n\n\t // Key setup\n\t for (var i = 0, j = 0; i < 256; i++) {\n\t var keyByteIndex = i % keySigBytes;\n\t var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;\n\n\t j = (j + S[i] + keyByte) % 256;\n\n\t // Swap\n\t var t = S[i];\n\t S[i] = S[j];\n\t S[j] = t;\n\t }\n\n\t // Counters\n\t this._i = this._j = 0;\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t M[offset] ^= generateKeystreamWord.call(this);\n\t },\n\n\t keySize: 256/32,\n\n\t ivSize: 0\n\t });\n\n\t function generateKeystreamWord() {\n\t // Shortcuts\n\t var S = this._S;\n\t var i = this._i;\n\t var j = this._j;\n\n\t // Generate keystream word\n\t var keystreamWord = 0;\n\t for (var n = 0; n < 4; n++) {\n\t i = (i + 1) % 256;\n\t j = (j + S[i]) % 256;\n\n\t // Swap\n\t var t = S[i];\n\t S[i] = S[j];\n\t S[j] = t;\n\n\t keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);\n\t }\n\n\t // Update counters\n\t this._i = i;\n\t this._j = j;\n\n\t return keystreamWord;\n\t }\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);\n\t */\n\t C.RC4 = StreamCipher._createHelper(RC4);\n\n\t /**\n\t * Modified RC4 stream cipher algorithm.\n\t */\n\t var RC4Drop = C_algo.RC4Drop = RC4.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {number} drop The number of keystream words to drop. Default 192\n\t */\n\t cfg: RC4.cfg.extend({\n\t drop: 192\n\t }),\n\n\t _doReset: function () {\n\t RC4._doReset.call(this);\n\n\t // Drop\n\t for (var i = this.cfg.drop; i > 0; i--) {\n\t generateKeystreamWord.call(this);\n\t }\n\t }\n\t });\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);\n\t */\n\t C.RC4Drop = StreamCipher._createHelper(RC4Drop);\n\t}());\n\n\n\treturn CryptoJS.RC4;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/** @preserve\n\t(c) 2012 by Cédric Mesnil. All rights reserved.\n\n\tRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n\t - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\t - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n\tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t*/\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Constants table\n\t var _zl = WordArray.create([\n\t 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n\t 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n\t 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n\t 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n\t 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);\n\t var _zr = WordArray.create([\n\t 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n\t 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n\t 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n\t 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n\t 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);\n\t var _sl = WordArray.create([\n\t 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n\t 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n\t 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n\t 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n\t 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]);\n\t var _sr = WordArray.create([\n\t 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n\t 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n\t 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n\t 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n\t 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]);\n\n\t var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);\n\t var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);\n\n\t /**\n\t * RIPEMD160 hash algorithm.\n\t */\n\t var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\n\t // Swap endian\n\t for (var i = 0; i < 16; i++) {\n\t // Shortcuts\n\t var offset_i = offset + i;\n\t var M_offset_i = M[offset_i];\n\n\t // Swap\n\t M[offset_i] = (\n\t (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |\n\t (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)\n\t );\n\t }\n\t // Shortcut\n\t var H = this._hash.words;\n\t var hl = _hl.words;\n\t var hr = _hr.words;\n\t var zl = _zl.words;\n\t var zr = _zr.words;\n\t var sl = _sl.words;\n\t var sr = _sr.words;\n\n\t // Working variables\n\t var al, bl, cl, dl, el;\n\t var ar, br, cr, dr, er;\n\n\t ar = al = H[0];\n\t br = bl = H[1];\n\t cr = cl = H[2];\n\t dr = dl = H[3];\n\t er = el = H[4];\n\t // Computation\n\t var t;\n\t for (var i = 0; i < 80; i += 1) {\n\t t = (al + M[offset+zl[i]])|0;\n\t if (i<16){\n\t\t t += f1(bl,cl,dl) + hl[0];\n\t } else if (i<32) {\n\t\t t += f2(bl,cl,dl) + hl[1];\n\t } else if (i<48) {\n\t\t t += f3(bl,cl,dl) + hl[2];\n\t } else if (i<64) {\n\t\t t += f4(bl,cl,dl) + hl[3];\n\t } else {// if (i<80) {\n\t\t t += f5(bl,cl,dl) + hl[4];\n\t }\n\t t = t|0;\n\t t = rotl(t,sl[i]);\n\t t = (t+el)|0;\n\t al = el;\n\t el = dl;\n\t dl = rotl(cl, 10);\n\t cl = bl;\n\t bl = t;\n\n\t t = (ar + M[offset+zr[i]])|0;\n\t if (i<16){\n\t\t t += f5(br,cr,dr) + hr[0];\n\t } else if (i<32) {\n\t\t t += f4(br,cr,dr) + hr[1];\n\t } else if (i<48) {\n\t\t t += f3(br,cr,dr) + hr[2];\n\t } else if (i<64) {\n\t\t t += f2(br,cr,dr) + hr[3];\n\t } else {// if (i<80) {\n\t\t t += f1(br,cr,dr) + hr[4];\n\t }\n\t t = t|0;\n\t t = rotl(t,sr[i]) ;\n\t t = (t+er)|0;\n\t ar = er;\n\t er = dr;\n\t dr = rotl(cr, 10);\n\t cr = br;\n\t br = t;\n\t }\n\t // Intermediate hash value\n\t t = (H[1] + cl + dr)|0;\n\t H[1] = (H[2] + dl + er)|0;\n\t H[2] = (H[3] + el + ar)|0;\n\t H[3] = (H[4] + al + br)|0;\n\t H[4] = (H[0] + bl + cr)|0;\n\t H[0] = t;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (\n\t (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)\n\t );\n\t data.sigBytes = (dataWords.length + 1) * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Shortcuts\n\t var hash = this._hash;\n\t var H = hash.words;\n\n\t // Swap endian\n\t for (var i = 0; i < 5; i++) {\n\t // Shortcut\n\t var H_i = H[i];\n\n\t // Swap\n\t H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |\n\t (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);\n\t }\n\n\t // Return final computed hash\n\t return hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\n\t function f1(x, y, z) {\n\t return ((x) ^ (y) ^ (z));\n\n\t }\n\n\t function f2(x, y, z) {\n\t return (((x)&(y)) | ((~x)&(z)));\n\t }\n\n\t function f3(x, y, z) {\n\t return (((x) | (~(y))) ^ (z));\n\t }\n\n\t function f4(x, y, z) {\n\t return (((x) & (z)) | ((y)&(~(z))));\n\t }\n\n\t function f5(x, y, z) {\n\t return ((x) ^ ((y) |(~(z))));\n\n\t }\n\n\t function rotl(x,n) {\n\t return (x<>>(32-n));\n\t }\n\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.RIPEMD160('message');\n\t * var hash = CryptoJS.RIPEMD160(wordArray);\n\t */\n\t C.RIPEMD160 = Hasher._createHelper(RIPEMD160);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacRIPEMD160(message, key);\n\t */\n\t C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);\n\t}(Math));\n\n\n\treturn CryptoJS.RIPEMD160;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-1 hash algorithm.\n\t */\n\t var SHA1 = C_algo.SHA1 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0x67452301, 0xefcdab89,\n\t 0x98badcfe, 0x10325476,\n\t 0xc3d2e1f0\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\n\t // Computation\n\t for (var i = 0; i < 80; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n\t W[i] = (n << 1) | (n >>> 31);\n\t }\n\n\t var t = ((a << 5) | (a >>> 27)) + e + W[i];\n\t if (i < 20) {\n\t t += ((b & c) | (~b & d)) + 0x5a827999;\n\t } else if (i < 40) {\n\t t += (b ^ c ^ d) + 0x6ed9eba1;\n\t } else if (i < 60) {\n\t t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;\n\t } else /* if (i < 80) */ {\n\t t += (b ^ c ^ d) - 0x359d3e2a;\n\t }\n\n\t e = d;\n\t d = c;\n\t c = (b << 30) | (b >>> 2);\n\t b = a;\n\t a = t;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA1('message');\n\t * var hash = CryptoJS.SHA1(wordArray);\n\t */\n\t C.SHA1 = Hasher._createHelper(SHA1);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA1(message, key);\n\t */\n\t C.HmacSHA1 = Hasher._createHmacHelper(SHA1);\n\t}());\n\n\n\treturn CryptoJS.SHA1;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./sha256\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./sha256\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_algo = C.algo;\n\t var SHA256 = C_algo.SHA256;\n\n\t /**\n\t * SHA-224 hash algorithm.\n\t */\n\t var SHA224 = C_algo.SHA224 = SHA256.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n\t 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4\n\t ]);\n\t },\n\n\t _doFinalize: function () {\n\t var hash = SHA256._doFinalize.call(this);\n\n\t hash.sigBytes -= 4;\n\n\t return hash;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA224('message');\n\t * var hash = CryptoJS.SHA224(wordArray);\n\t */\n\t C.SHA224 = SHA256._createHelper(SHA224);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA224(message, key);\n\t */\n\t C.HmacSHA224 = SHA256._createHmacHelper(SHA224);\n\t}());\n\n\n\treturn CryptoJS.SHA224;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Initialization and round constants tables\n\t var H = [];\n\t var K = [];\n\n\t // Compute constants\n\t (function () {\n\t function isPrime(n) {\n\t var sqrtN = Math.sqrt(n);\n\t for (var factor = 2; factor <= sqrtN; factor++) {\n\t if (!(n % factor)) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t }\n\n\t function getFractionalBits(n) {\n\t return ((n - (n | 0)) * 0x100000000) | 0;\n\t }\n\n\t var n = 2;\n\t var nPrime = 0;\n\t while (nPrime < 64) {\n\t if (isPrime(n)) {\n\t if (nPrime < 8) {\n\t H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n\t }\n\t K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n\n\t nPrime++;\n\t }\n\n\t n++;\n\t }\n\t }());\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-256 hash algorithm.\n\t */\n\t var SHA256 = C_algo.SHA256 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init(H.slice(0));\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\t var f = H[5];\n\t var g = H[6];\n\t var h = H[7];\n\n\t // Computation\n\t for (var i = 0; i < 64; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var gamma0x = W[i - 15];\n\t var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\n\t ((gamma0x << 14) | (gamma0x >>> 18)) ^\n\t (gamma0x >>> 3);\n\n\t var gamma1x = W[i - 2];\n\t var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\n\t ((gamma1x << 13) | (gamma1x >>> 19)) ^\n\t (gamma1x >>> 10);\n\n\t W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t }\n\n\t var ch = (e & f) ^ (~e & g);\n\t var maj = (a & b) ^ (a & c) ^ (b & c);\n\n\t var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\n\t var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\n\n\t var t1 = h + sigma1 + ch + K[i] + W[i];\n\t var t2 = sigma0 + maj;\n\n\t h = g;\n\t g = f;\n\t f = e;\n\t e = (d + t1) | 0;\n\t d = c;\n\t c = b;\n\t b = a;\n\t a = (t1 + t2) | 0;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t H[5] = (H[5] + f) | 0;\n\t H[6] = (H[6] + g) | 0;\n\t H[7] = (H[7] + h) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA256('message');\n\t * var hash = CryptoJS.SHA256(wordArray);\n\t */\n\t C.SHA256 = Hasher._createHelper(SHA256);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA256(message, key);\n\t */\n\t C.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA256;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./x64-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./x64-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_x64 = C.x64;\n\t var X64Word = C_x64.Word;\n\t var C_algo = C.algo;\n\n\t // Constants tables\n\t var RHO_OFFSETS = [];\n\t var PI_INDEXES = [];\n\t var ROUND_CONSTANTS = [];\n\n\t // Compute Constants\n\t (function () {\n\t // Compute rho offset constants\n\t var x = 1, y = 0;\n\t for (var t = 0; t < 24; t++) {\n\t RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;\n\n\t var newX = y % 5;\n\t var newY = (2 * x + 3 * y) % 5;\n\t x = newX;\n\t y = newY;\n\t }\n\n\t // Compute pi index constants\n\t for (var x = 0; x < 5; x++) {\n\t for (var y = 0; y < 5; y++) {\n\t PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;\n\t }\n\t }\n\n\t // Compute round constants\n\t var LFSR = 0x01;\n\t for (var i = 0; i < 24; i++) {\n\t var roundConstantMsw = 0;\n\t var roundConstantLsw = 0;\n\n\t for (var j = 0; j < 7; j++) {\n\t if (LFSR & 0x01) {\n\t var bitPosition = (1 << j) - 1;\n\t if (bitPosition < 32) {\n\t roundConstantLsw ^= 1 << bitPosition;\n\t } else /* if (bitPosition >= 32) */ {\n\t roundConstantMsw ^= 1 << (bitPosition - 32);\n\t }\n\t }\n\n\t // Compute next LFSR\n\t if (LFSR & 0x80) {\n\t // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1\n\t LFSR = (LFSR << 1) ^ 0x71;\n\t } else {\n\t LFSR <<= 1;\n\t }\n\t }\n\n\t ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);\n\t }\n\t }());\n\n\t // Reusable objects for temporary values\n\t var T = [];\n\t (function () {\n\t for (var i = 0; i < 25; i++) {\n\t T[i] = X64Word.create();\n\t }\n\t }());\n\n\t /**\n\t * SHA-3 hash algorithm.\n\t */\n\t var SHA3 = C_algo.SHA3 = Hasher.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {number} outputLength\n\t * The desired number of bits in the output hash.\n\t * Only values permitted are: 224, 256, 384, 512.\n\t * Default: 512\n\t */\n\t cfg: Hasher.cfg.extend({\n\t outputLength: 512\n\t }),\n\n\t _doReset: function () {\n\t var state = this._state = []\n\t for (var i = 0; i < 25; i++) {\n\t state[i] = new X64Word.init();\n\t }\n\n\t this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcuts\n\t var state = this._state;\n\t var nBlockSizeLanes = this.blockSize / 2;\n\n\t // Absorb\n\t for (var i = 0; i < nBlockSizeLanes; i++) {\n\t // Shortcuts\n\t var M2i = M[offset + 2 * i];\n\t var M2i1 = M[offset + 2 * i + 1];\n\n\t // Swap endian\n\t M2i = (\n\t (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) |\n\t (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)\n\t );\n\t M2i1 = (\n\t (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) |\n\t (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)\n\t );\n\n\t // Absorb message into state\n\t var lane = state[i];\n\t lane.high ^= M2i1;\n\t lane.low ^= M2i;\n\t }\n\n\t // Rounds\n\t for (var round = 0; round < 24; round++) {\n\t // Theta\n\t for (var x = 0; x < 5; x++) {\n\t // Mix column lanes\n\t var tMsw = 0, tLsw = 0;\n\t for (var y = 0; y < 5; y++) {\n\t var lane = state[x + 5 * y];\n\t tMsw ^= lane.high;\n\t tLsw ^= lane.low;\n\t }\n\n\t // Temporary values\n\t var Tx = T[x];\n\t Tx.high = tMsw;\n\t Tx.low = tLsw;\n\t }\n\t for (var x = 0; x < 5; x++) {\n\t // Shortcuts\n\t var Tx4 = T[(x + 4) % 5];\n\t var Tx1 = T[(x + 1) % 5];\n\t var Tx1Msw = Tx1.high;\n\t var Tx1Lsw = Tx1.low;\n\n\t // Mix surrounding columns\n\t var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));\n\t var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));\n\t for (var y = 0; y < 5; y++) {\n\t var lane = state[x + 5 * y];\n\t lane.high ^= tMsw;\n\t lane.low ^= tLsw;\n\t }\n\t }\n\n\t // Rho Pi\n\t for (var laneIndex = 1; laneIndex < 25; laneIndex++) {\n\t var tMsw;\n\t var tLsw;\n\n\t // Shortcuts\n\t var lane = state[laneIndex];\n\t var laneMsw = lane.high;\n\t var laneLsw = lane.low;\n\t var rhoOffset = RHO_OFFSETS[laneIndex];\n\n\t // Rotate lanes\n\t if (rhoOffset < 32) {\n\t tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));\n\t tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));\n\t } else /* if (rhoOffset >= 32) */ {\n\t tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));\n\t tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));\n\t }\n\n\t // Transpose lanes\n\t var TPiLane = T[PI_INDEXES[laneIndex]];\n\t TPiLane.high = tMsw;\n\t TPiLane.low = tLsw;\n\t }\n\n\t // Rho pi at x = y = 0\n\t var T0 = T[0];\n\t var state0 = state[0];\n\t T0.high = state0.high;\n\t T0.low = state0.low;\n\n\t // Chi\n\t for (var x = 0; x < 5; x++) {\n\t for (var y = 0; y < 5; y++) {\n\t // Shortcuts\n\t var laneIndex = x + 5 * y;\n\t var lane = state[laneIndex];\n\t var TLane = T[laneIndex];\n\t var Tx1Lane = T[((x + 1) % 5) + 5 * y];\n\t var Tx2Lane = T[((x + 2) % 5) + 5 * y];\n\n\t // Mix rows\n\t lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);\n\t lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);\n\t }\n\t }\n\n\t // Iota\n\t var lane = state[0];\n\t var roundConstant = ROUND_CONSTANTS[round];\n\t lane.high ^= roundConstant.high;\n\t lane.low ^= roundConstant.low;\n\t }\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\t var blockSizeBits = this.blockSize * 32;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);\n\t dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Shortcuts\n\t var state = this._state;\n\t var outputLengthBytes = this.cfg.outputLength / 8;\n\t var outputLengthLanes = outputLengthBytes / 8;\n\n\t // Squeeze\n\t var hashWords = [];\n\t for (var i = 0; i < outputLengthLanes; i++) {\n\t // Shortcuts\n\t var lane = state[i];\n\t var laneMsw = lane.high;\n\t var laneLsw = lane.low;\n\n\t // Swap endian\n\t laneMsw = (\n\t (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) |\n\t (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)\n\t );\n\t laneLsw = (\n\t (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) |\n\t (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)\n\t );\n\n\t // Squeeze state to retrieve hash\n\t hashWords.push(laneLsw);\n\t hashWords.push(laneMsw);\n\t }\n\n\t // Return final computed hash\n\t return new WordArray.init(hashWords, outputLengthBytes);\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\n\t var state = clone._state = this._state.slice(0);\n\t for (var i = 0; i < 25; i++) {\n\t state[i] = state[i].clone();\n\t }\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA3('message');\n\t * var hash = CryptoJS.SHA3(wordArray);\n\t */\n\t C.SHA3 = Hasher._createHelper(SHA3);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA3(message, key);\n\t */\n\t C.HmacSHA3 = Hasher._createHmacHelper(SHA3);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA3;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./x64-core\"), require(\"./sha512\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./x64-core\", \"./sha512\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_x64 = C.x64;\n\t var X64Word = C_x64.Word;\n\t var X64WordArray = C_x64.WordArray;\n\t var C_algo = C.algo;\n\t var SHA512 = C_algo.SHA512;\n\n\t /**\n\t * SHA-384 hash algorithm.\n\t */\n\t var SHA384 = C_algo.SHA384 = SHA512.extend({\n\t _doReset: function () {\n\t this._hash = new X64WordArray.init([\n\t new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),\n\t new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),\n\t new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),\n\t new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)\n\t ]);\n\t },\n\n\t _doFinalize: function () {\n\t var hash = SHA512._doFinalize.call(this);\n\n\t hash.sigBytes -= 16;\n\n\t return hash;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA384('message');\n\t * var hash = CryptoJS.SHA384(wordArray);\n\t */\n\t C.SHA384 = SHA512._createHelper(SHA384);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA384(message, key);\n\t */\n\t C.HmacSHA384 = SHA512._createHmacHelper(SHA384);\n\t}());\n\n\n\treturn CryptoJS.SHA384;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./x64-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./x64-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Hasher = C_lib.Hasher;\n\t var C_x64 = C.x64;\n\t var X64Word = C_x64.Word;\n\t var X64WordArray = C_x64.WordArray;\n\t var C_algo = C.algo;\n\n\t function X64Word_create() {\n\t return X64Word.create.apply(X64Word, arguments);\n\t }\n\n\t // Constants\n\t var K = [\n\t X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),\n\t X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),\n\t X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),\n\t X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),\n\t X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),\n\t X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),\n\t X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),\n\t X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),\n\t X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),\n\t X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),\n\t X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),\n\t X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),\n\t X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),\n\t X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),\n\t X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),\n\t X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),\n\t X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),\n\t X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),\n\t X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),\n\t X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),\n\t X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),\n\t X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),\n\t X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),\n\t X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),\n\t X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),\n\t X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),\n\t X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),\n\t X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),\n\t X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),\n\t X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),\n\t X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),\n\t X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),\n\t X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),\n\t X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),\n\t X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),\n\t X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),\n\t X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),\n\t X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),\n\t X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),\n\t X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)\n\t ];\n\n\t // Reusable objects\n\t var W = [];\n\t (function () {\n\t for (var i = 0; i < 80; i++) {\n\t W[i] = X64Word_create();\n\t }\n\t }());\n\n\t /**\n\t * SHA-512 hash algorithm.\n\t */\n\t var SHA512 = C_algo.SHA512 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new X64WordArray.init([\n\t new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),\n\t new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),\n\t new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),\n\t new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcuts\n\t var H = this._hash.words;\n\n\t var H0 = H[0];\n\t var H1 = H[1];\n\t var H2 = H[2];\n\t var H3 = H[3];\n\t var H4 = H[4];\n\t var H5 = H[5];\n\t var H6 = H[6];\n\t var H7 = H[7];\n\n\t var H0h = H0.high;\n\t var H0l = H0.low;\n\t var H1h = H1.high;\n\t var H1l = H1.low;\n\t var H2h = H2.high;\n\t var H2l = H2.low;\n\t var H3h = H3.high;\n\t var H3l = H3.low;\n\t var H4h = H4.high;\n\t var H4l = H4.low;\n\t var H5h = H5.high;\n\t var H5l = H5.low;\n\t var H6h = H6.high;\n\t var H6l = H6.low;\n\t var H7h = H7.high;\n\t var H7l = H7.low;\n\n\t // Working variables\n\t var ah = H0h;\n\t var al = H0l;\n\t var bh = H1h;\n\t var bl = H1l;\n\t var ch = H2h;\n\t var cl = H2l;\n\t var dh = H3h;\n\t var dl = H3l;\n\t var eh = H4h;\n\t var el = H4l;\n\t var fh = H5h;\n\t var fl = H5l;\n\t var gh = H6h;\n\t var gl = H6l;\n\t var hh = H7h;\n\t var hl = H7l;\n\n\t // Rounds\n\t for (var i = 0; i < 80; i++) {\n\t var Wil;\n\t var Wih;\n\n\t // Shortcut\n\t var Wi = W[i];\n\n\t // Extend message\n\t if (i < 16) {\n\t Wih = Wi.high = M[offset + i * 2] | 0;\n\t Wil = Wi.low = M[offset + i * 2 + 1] | 0;\n\t } else {\n\t // Gamma0\n\t var gamma0x = W[i - 15];\n\t var gamma0xh = gamma0x.high;\n\t var gamma0xl = gamma0x.low;\n\t var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);\n\t var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));\n\n\t // Gamma1\n\t var gamma1x = W[i - 2];\n\t var gamma1xh = gamma1x.high;\n\t var gamma1xl = gamma1x.low;\n\t var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);\n\t var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));\n\n\t // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n\t var Wi7 = W[i - 7];\n\t var Wi7h = Wi7.high;\n\t var Wi7l = Wi7.low;\n\n\t var Wi16 = W[i - 16];\n\t var Wi16h = Wi16.high;\n\t var Wi16l = Wi16.low;\n\n\t Wil = gamma0l + Wi7l;\n\t Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);\n\t Wil = Wil + gamma1l;\n\t Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);\n\t Wil = Wil + Wi16l;\n\t Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);\n\n\t Wi.high = Wih;\n\t Wi.low = Wil;\n\t }\n\n\t var chh = (eh & fh) ^ (~eh & gh);\n\t var chl = (el & fl) ^ (~el & gl);\n\t var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);\n\t var majl = (al & bl) ^ (al & cl) ^ (bl & cl);\n\n\t var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));\n\t var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));\n\t var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));\n\t var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));\n\n\t // t1 = h + sigma1 + ch + K[i] + W[i]\n\t var Ki = K[i];\n\t var Kih = Ki.high;\n\t var Kil = Ki.low;\n\n\t var t1l = hl + sigma1l;\n\t var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);\n\t var t1l = t1l + chl;\n\t var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);\n\t var t1l = t1l + Kil;\n\t var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);\n\t var t1l = t1l + Wil;\n\t var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);\n\n\t // t2 = sigma0 + maj\n\t var t2l = sigma0l + majl;\n\t var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);\n\n\t // Update working variables\n\t hh = gh;\n\t hl = gl;\n\t gh = fh;\n\t gl = fl;\n\t fh = eh;\n\t fl = el;\n\t el = (dl + t1l) | 0;\n\t eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;\n\t dh = ch;\n\t dl = cl;\n\t ch = bh;\n\t cl = bl;\n\t bh = ah;\n\t bl = al;\n\t al = (t1l + t2l) | 0;\n\t ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;\n\t }\n\n\t // Intermediate hash value\n\t H0l = H0.low = (H0l + al);\n\t H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));\n\t H1l = H1.low = (H1l + bl);\n\t H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));\n\t H2l = H2.low = (H2l + cl);\n\t H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));\n\t H3l = H3.low = (H3l + dl);\n\t H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));\n\t H4l = H4.low = (H4l + el);\n\t H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));\n\t H5l = H5.low = (H5l + fl);\n\t H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));\n\t H6l = H6.low = (H6l + gl);\n\t H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));\n\t H7l = H7.low = (H7l + hl);\n\t H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Convert hash to 32-bit word array before returning\n\t var hash = this._hash.toX32();\n\n\t // Return final computed hash\n\t return hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t },\n\n\t blockSize: 1024/32\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA512('message');\n\t * var hash = CryptoJS.SHA512(wordArray);\n\t */\n\t C.SHA512 = Hasher._createHelper(SHA512);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA512(message, key);\n\t */\n\t C.HmacSHA512 = Hasher._createHmacHelper(SHA512);\n\t}());\n\n\n\treturn CryptoJS.SHA512;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var BlockCipher = C_lib.BlockCipher;\n\t var C_algo = C.algo;\n\n\t // Permuted Choice 1 constants\n\t var PC1 = [\n\t 57, 49, 41, 33, 25, 17, 9, 1,\n\t 58, 50, 42, 34, 26, 18, 10, 2,\n\t 59, 51, 43, 35, 27, 19, 11, 3,\n\t 60, 52, 44, 36, 63, 55, 47, 39,\n\t 31, 23, 15, 7, 62, 54, 46, 38,\n\t 30, 22, 14, 6, 61, 53, 45, 37,\n\t 29, 21, 13, 5, 28, 20, 12, 4\n\t ];\n\n\t // Permuted Choice 2 constants\n\t var PC2 = [\n\t 14, 17, 11, 24, 1, 5,\n\t 3, 28, 15, 6, 21, 10,\n\t 23, 19, 12, 4, 26, 8,\n\t 16, 7, 27, 20, 13, 2,\n\t 41, 52, 31, 37, 47, 55,\n\t 30, 40, 51, 45, 33, 48,\n\t 44, 49, 39, 56, 34, 53,\n\t 46, 42, 50, 36, 29, 32\n\t ];\n\n\t // Cumulative bit shift constants\n\t var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];\n\n\t // SBOXes and round permutation constants\n\t var SBOX_P = [\n\t {\n\t 0x0: 0x808200,\n\t 0x10000000: 0x8000,\n\t 0x20000000: 0x808002,\n\t 0x30000000: 0x2,\n\t 0x40000000: 0x200,\n\t 0x50000000: 0x808202,\n\t 0x60000000: 0x800202,\n\t 0x70000000: 0x800000,\n\t 0x80000000: 0x202,\n\t 0x90000000: 0x800200,\n\t 0xa0000000: 0x8200,\n\t 0xb0000000: 0x808000,\n\t 0xc0000000: 0x8002,\n\t 0xd0000000: 0x800002,\n\t 0xe0000000: 0x0,\n\t 0xf0000000: 0x8202,\n\t 0x8000000: 0x0,\n\t 0x18000000: 0x808202,\n\t 0x28000000: 0x8202,\n\t 0x38000000: 0x8000,\n\t 0x48000000: 0x808200,\n\t 0x58000000: 0x200,\n\t 0x68000000: 0x808002,\n\t 0x78000000: 0x2,\n\t 0x88000000: 0x800200,\n\t 0x98000000: 0x8200,\n\t 0xa8000000: 0x808000,\n\t 0xb8000000: 0x800202,\n\t 0xc8000000: 0x800002,\n\t 0xd8000000: 0x8002,\n\t 0xe8000000: 0x202,\n\t 0xf8000000: 0x800000,\n\t 0x1: 0x8000,\n\t 0x10000001: 0x2,\n\t 0x20000001: 0x808200,\n\t 0x30000001: 0x800000,\n\t 0x40000001: 0x808002,\n\t 0x50000001: 0x8200,\n\t 0x60000001: 0x200,\n\t 0x70000001: 0x800202,\n\t 0x80000001: 0x808202,\n\t 0x90000001: 0x808000,\n\t 0xa0000001: 0x800002,\n\t 0xb0000001: 0x8202,\n\t 0xc0000001: 0x202,\n\t 0xd0000001: 0x800200,\n\t 0xe0000001: 0x8002,\n\t 0xf0000001: 0x0,\n\t 0x8000001: 0x808202,\n\t 0x18000001: 0x808000,\n\t 0x28000001: 0x800000,\n\t 0x38000001: 0x200,\n\t 0x48000001: 0x8000,\n\t 0x58000001: 0x800002,\n\t 0x68000001: 0x2,\n\t 0x78000001: 0x8202,\n\t 0x88000001: 0x8002,\n\t 0x98000001: 0x800202,\n\t 0xa8000001: 0x202,\n\t 0xb8000001: 0x808200,\n\t 0xc8000001: 0x800200,\n\t 0xd8000001: 0x0,\n\t 0xe8000001: 0x8200,\n\t 0xf8000001: 0x808002\n\t },\n\t {\n\t 0x0: 0x40084010,\n\t 0x1000000: 0x4000,\n\t 0x2000000: 0x80000,\n\t 0x3000000: 0x40080010,\n\t 0x4000000: 0x40000010,\n\t 0x5000000: 0x40084000,\n\t 0x6000000: 0x40004000,\n\t 0x7000000: 0x10,\n\t 0x8000000: 0x84000,\n\t 0x9000000: 0x40004010,\n\t 0xa000000: 0x40000000,\n\t 0xb000000: 0x84010,\n\t 0xc000000: 0x80010,\n\t 0xd000000: 0x0,\n\t 0xe000000: 0x4010,\n\t 0xf000000: 0x40080000,\n\t 0x800000: 0x40004000,\n\t 0x1800000: 0x84010,\n\t 0x2800000: 0x10,\n\t 0x3800000: 0x40004010,\n\t 0x4800000: 0x40084010,\n\t 0x5800000: 0x40000000,\n\t 0x6800000: 0x80000,\n\t 0x7800000: 0x40080010,\n\t 0x8800000: 0x80010,\n\t 0x9800000: 0x0,\n\t 0xa800000: 0x4000,\n\t 0xb800000: 0x40080000,\n\t 0xc800000: 0x40000010,\n\t 0xd800000: 0x84000,\n\t 0xe800000: 0x40084000,\n\t 0xf800000: 0x4010,\n\t 0x10000000: 0x0,\n\t 0x11000000: 0x40080010,\n\t 0x12000000: 0x40004010,\n\t 0x13000000: 0x40084000,\n\t 0x14000000: 0x40080000,\n\t 0x15000000: 0x10,\n\t 0x16000000: 0x84010,\n\t 0x17000000: 0x4000,\n\t 0x18000000: 0x4010,\n\t 0x19000000: 0x80000,\n\t 0x1a000000: 0x80010,\n\t 0x1b000000: 0x40000010,\n\t 0x1c000000: 0x84000,\n\t 0x1d000000: 0x40004000,\n\t 0x1e000000: 0x40000000,\n\t 0x1f000000: 0x40084010,\n\t 0x10800000: 0x84010,\n\t 0x11800000: 0x80000,\n\t 0x12800000: 0x40080000,\n\t 0x13800000: 0x4000,\n\t 0x14800000: 0x40004000,\n\t 0x15800000: 0x40084010,\n\t 0x16800000: 0x10,\n\t 0x17800000: 0x40000000,\n\t 0x18800000: 0x40084000,\n\t 0x19800000: 0x40000010,\n\t 0x1a800000: 0x40004010,\n\t 0x1b800000: 0x80010,\n\t 0x1c800000: 0x0,\n\t 0x1d800000: 0x4010,\n\t 0x1e800000: 0x40080010,\n\t 0x1f800000: 0x84000\n\t },\n\t {\n\t 0x0: 0x104,\n\t 0x100000: 0x0,\n\t 0x200000: 0x4000100,\n\t 0x300000: 0x10104,\n\t 0x400000: 0x10004,\n\t 0x500000: 0x4000004,\n\t 0x600000: 0x4010104,\n\t 0x700000: 0x4010000,\n\t 0x800000: 0x4000000,\n\t 0x900000: 0x4010100,\n\t 0xa00000: 0x10100,\n\t 0xb00000: 0x4010004,\n\t 0xc00000: 0x4000104,\n\t 0xd00000: 0x10000,\n\t 0xe00000: 0x4,\n\t 0xf00000: 0x100,\n\t 0x80000: 0x4010100,\n\t 0x180000: 0x4010004,\n\t 0x280000: 0x0,\n\t 0x380000: 0x4000100,\n\t 0x480000: 0x4000004,\n\t 0x580000: 0x10000,\n\t 0x680000: 0x10004,\n\t 0x780000: 0x104,\n\t 0x880000: 0x4,\n\t 0x980000: 0x100,\n\t 0xa80000: 0x4010000,\n\t 0xb80000: 0x10104,\n\t 0xc80000: 0x10100,\n\t 0xd80000: 0x4000104,\n\t 0xe80000: 0x4010104,\n\t 0xf80000: 0x4000000,\n\t 0x1000000: 0x4010100,\n\t 0x1100000: 0x10004,\n\t 0x1200000: 0x10000,\n\t 0x1300000: 0x4000100,\n\t 0x1400000: 0x100,\n\t 0x1500000: 0x4010104,\n\t 0x1600000: 0x4000004,\n\t 0x1700000: 0x0,\n\t 0x1800000: 0x4000104,\n\t 0x1900000: 0x4000000,\n\t 0x1a00000: 0x4,\n\t 0x1b00000: 0x10100,\n\t 0x1c00000: 0x4010000,\n\t 0x1d00000: 0x104,\n\t 0x1e00000: 0x10104,\n\t 0x1f00000: 0x4010004,\n\t 0x1080000: 0x4000000,\n\t 0x1180000: 0x104,\n\t 0x1280000: 0x4010100,\n\t 0x1380000: 0x0,\n\t 0x1480000: 0x10004,\n\t 0x1580000: 0x4000100,\n\t 0x1680000: 0x100,\n\t 0x1780000: 0x4010004,\n\t 0x1880000: 0x10000,\n\t 0x1980000: 0x4010104,\n\t 0x1a80000: 0x10104,\n\t 0x1b80000: 0x4000004,\n\t 0x1c80000: 0x4000104,\n\t 0x1d80000: 0x4010000,\n\t 0x1e80000: 0x4,\n\t 0x1f80000: 0x10100\n\t },\n\t {\n\t 0x0: 0x80401000,\n\t 0x10000: 0x80001040,\n\t 0x20000: 0x401040,\n\t 0x30000: 0x80400000,\n\t 0x40000: 0x0,\n\t 0x50000: 0x401000,\n\t 0x60000: 0x80000040,\n\t 0x70000: 0x400040,\n\t 0x80000: 0x80000000,\n\t 0x90000: 0x400000,\n\t 0xa0000: 0x40,\n\t 0xb0000: 0x80001000,\n\t 0xc0000: 0x80400040,\n\t 0xd0000: 0x1040,\n\t 0xe0000: 0x1000,\n\t 0xf0000: 0x80401040,\n\t 0x8000: 0x80001040,\n\t 0x18000: 0x40,\n\t 0x28000: 0x80400040,\n\t 0x38000: 0x80001000,\n\t 0x48000: 0x401000,\n\t 0x58000: 0x80401040,\n\t 0x68000: 0x0,\n\t 0x78000: 0x80400000,\n\t 0x88000: 0x1000,\n\t 0x98000: 0x80401000,\n\t 0xa8000: 0x400000,\n\t 0xb8000: 0x1040,\n\t 0xc8000: 0x80000000,\n\t 0xd8000: 0x400040,\n\t 0xe8000: 0x401040,\n\t 0xf8000: 0x80000040,\n\t 0x100000: 0x400040,\n\t 0x110000: 0x401000,\n\t 0x120000: 0x80000040,\n\t 0x130000: 0x0,\n\t 0x140000: 0x1040,\n\t 0x150000: 0x80400040,\n\t 0x160000: 0x80401000,\n\t 0x170000: 0x80001040,\n\t 0x180000: 0x80401040,\n\t 0x190000: 0x80000000,\n\t 0x1a0000: 0x80400000,\n\t 0x1b0000: 0x401040,\n\t 0x1c0000: 0x80001000,\n\t 0x1d0000: 0x400000,\n\t 0x1e0000: 0x40,\n\t 0x1f0000: 0x1000,\n\t 0x108000: 0x80400000,\n\t 0x118000: 0x80401040,\n\t 0x128000: 0x0,\n\t 0x138000: 0x401000,\n\t 0x148000: 0x400040,\n\t 0x158000: 0x80000000,\n\t 0x168000: 0x80001040,\n\t 0x178000: 0x40,\n\t 0x188000: 0x80000040,\n\t 0x198000: 0x1000,\n\t 0x1a8000: 0x80001000,\n\t 0x1b8000: 0x80400040,\n\t 0x1c8000: 0x1040,\n\t 0x1d8000: 0x80401000,\n\t 0x1e8000: 0x400000,\n\t 0x1f8000: 0x401040\n\t },\n\t {\n\t 0x0: 0x80,\n\t 0x1000: 0x1040000,\n\t 0x2000: 0x40000,\n\t 0x3000: 0x20000000,\n\t 0x4000: 0x20040080,\n\t 0x5000: 0x1000080,\n\t 0x6000: 0x21000080,\n\t 0x7000: 0x40080,\n\t 0x8000: 0x1000000,\n\t 0x9000: 0x20040000,\n\t 0xa000: 0x20000080,\n\t 0xb000: 0x21040080,\n\t 0xc000: 0x21040000,\n\t 0xd000: 0x0,\n\t 0xe000: 0x1040080,\n\t 0xf000: 0x21000000,\n\t 0x800: 0x1040080,\n\t 0x1800: 0x21000080,\n\t 0x2800: 0x80,\n\t 0x3800: 0x1040000,\n\t 0x4800: 0x40000,\n\t 0x5800: 0x20040080,\n\t 0x6800: 0x21040000,\n\t 0x7800: 0x20000000,\n\t 0x8800: 0x20040000,\n\t 0x9800: 0x0,\n\t 0xa800: 0x21040080,\n\t 0xb800: 0x1000080,\n\t 0xc800: 0x20000080,\n\t 0xd800: 0x21000000,\n\t 0xe800: 0x1000000,\n\t 0xf800: 0x40080,\n\t 0x10000: 0x40000,\n\t 0x11000: 0x80,\n\t 0x12000: 0x20000000,\n\t 0x13000: 0x21000080,\n\t 0x14000: 0x1000080,\n\t 0x15000: 0x21040000,\n\t 0x16000: 0x20040080,\n\t 0x17000: 0x1000000,\n\t 0x18000: 0x21040080,\n\t 0x19000: 0x21000000,\n\t 0x1a000: 0x1040000,\n\t 0x1b000: 0x20040000,\n\t 0x1c000: 0x40080,\n\t 0x1d000: 0x20000080,\n\t 0x1e000: 0x0,\n\t 0x1f000: 0x1040080,\n\t 0x10800: 0x21000080,\n\t 0x11800: 0x1000000,\n\t 0x12800: 0x1040000,\n\t 0x13800: 0x20040080,\n\t 0x14800: 0x20000000,\n\t 0x15800: 0x1040080,\n\t 0x16800: 0x80,\n\t 0x17800: 0x21040000,\n\t 0x18800: 0x40080,\n\t 0x19800: 0x21040080,\n\t 0x1a800: 0x0,\n\t 0x1b800: 0x21000000,\n\t 0x1c800: 0x1000080,\n\t 0x1d800: 0x40000,\n\t 0x1e800: 0x20040000,\n\t 0x1f800: 0x20000080\n\t },\n\t {\n\t 0x0: 0x10000008,\n\t 0x100: 0x2000,\n\t 0x200: 0x10200000,\n\t 0x300: 0x10202008,\n\t 0x400: 0x10002000,\n\t 0x500: 0x200000,\n\t 0x600: 0x200008,\n\t 0x700: 0x10000000,\n\t 0x800: 0x0,\n\t 0x900: 0x10002008,\n\t 0xa00: 0x202000,\n\t 0xb00: 0x8,\n\t 0xc00: 0x10200008,\n\t 0xd00: 0x202008,\n\t 0xe00: 0x2008,\n\t 0xf00: 0x10202000,\n\t 0x80: 0x10200000,\n\t 0x180: 0x10202008,\n\t 0x280: 0x8,\n\t 0x380: 0x200000,\n\t 0x480: 0x202008,\n\t 0x580: 0x10000008,\n\t 0x680: 0x10002000,\n\t 0x780: 0x2008,\n\t 0x880: 0x200008,\n\t 0x980: 0x2000,\n\t 0xa80: 0x10002008,\n\t 0xb80: 0x10200008,\n\t 0xc80: 0x0,\n\t 0xd80: 0x10202000,\n\t 0xe80: 0x202000,\n\t 0xf80: 0x10000000,\n\t 0x1000: 0x10002000,\n\t 0x1100: 0x10200008,\n\t 0x1200: 0x10202008,\n\t 0x1300: 0x2008,\n\t 0x1400: 0x200000,\n\t 0x1500: 0x10000000,\n\t 0x1600: 0x10000008,\n\t 0x1700: 0x202000,\n\t 0x1800: 0x202008,\n\t 0x1900: 0x0,\n\t 0x1a00: 0x8,\n\t 0x1b00: 0x10200000,\n\t 0x1c00: 0x2000,\n\t 0x1d00: 0x10002008,\n\t 0x1e00: 0x10202000,\n\t 0x1f00: 0x200008,\n\t 0x1080: 0x8,\n\t 0x1180: 0x202000,\n\t 0x1280: 0x200000,\n\t 0x1380: 0x10000008,\n\t 0x1480: 0x10002000,\n\t 0x1580: 0x2008,\n\t 0x1680: 0x10202008,\n\t 0x1780: 0x10200000,\n\t 0x1880: 0x10202000,\n\t 0x1980: 0x10200008,\n\t 0x1a80: 0x2000,\n\t 0x1b80: 0x202008,\n\t 0x1c80: 0x200008,\n\t 0x1d80: 0x0,\n\t 0x1e80: 0x10000000,\n\t 0x1f80: 0x10002008\n\t },\n\t {\n\t 0x0: 0x100000,\n\t 0x10: 0x2000401,\n\t 0x20: 0x400,\n\t 0x30: 0x100401,\n\t 0x40: 0x2100401,\n\t 0x50: 0x0,\n\t 0x60: 0x1,\n\t 0x70: 0x2100001,\n\t 0x80: 0x2000400,\n\t 0x90: 0x100001,\n\t 0xa0: 0x2000001,\n\t 0xb0: 0x2100400,\n\t 0xc0: 0x2100000,\n\t 0xd0: 0x401,\n\t 0xe0: 0x100400,\n\t 0xf0: 0x2000000,\n\t 0x8: 0x2100001,\n\t 0x18: 0x0,\n\t 0x28: 0x2000401,\n\t 0x38: 0x2100400,\n\t 0x48: 0x100000,\n\t 0x58: 0x2000001,\n\t 0x68: 0x2000000,\n\t 0x78: 0x401,\n\t 0x88: 0x100401,\n\t 0x98: 0x2000400,\n\t 0xa8: 0x2100000,\n\t 0xb8: 0x100001,\n\t 0xc8: 0x400,\n\t 0xd8: 0x2100401,\n\t 0xe8: 0x1,\n\t 0xf8: 0x100400,\n\t 0x100: 0x2000000,\n\t 0x110: 0x100000,\n\t 0x120: 0x2000401,\n\t 0x130: 0x2100001,\n\t 0x140: 0x100001,\n\t 0x150: 0x2000400,\n\t 0x160: 0x2100400,\n\t 0x170: 0x100401,\n\t 0x180: 0x401,\n\t 0x190: 0x2100401,\n\t 0x1a0: 0x100400,\n\t 0x1b0: 0x1,\n\t 0x1c0: 0x0,\n\t 0x1d0: 0x2100000,\n\t 0x1e0: 0x2000001,\n\t 0x1f0: 0x400,\n\t 0x108: 0x100400,\n\t 0x118: 0x2000401,\n\t 0x128: 0x2100001,\n\t 0x138: 0x1,\n\t 0x148: 0x2000000,\n\t 0x158: 0x100000,\n\t 0x168: 0x401,\n\t 0x178: 0x2100400,\n\t 0x188: 0x2000001,\n\t 0x198: 0x2100000,\n\t 0x1a8: 0x0,\n\t 0x1b8: 0x2100401,\n\t 0x1c8: 0x100401,\n\t 0x1d8: 0x400,\n\t 0x1e8: 0x2000400,\n\t 0x1f8: 0x100001\n\t },\n\t {\n\t 0x0: 0x8000820,\n\t 0x1: 0x20000,\n\t 0x2: 0x8000000,\n\t 0x3: 0x20,\n\t 0x4: 0x20020,\n\t 0x5: 0x8020820,\n\t 0x6: 0x8020800,\n\t 0x7: 0x800,\n\t 0x8: 0x8020000,\n\t 0x9: 0x8000800,\n\t 0xa: 0x20800,\n\t 0xb: 0x8020020,\n\t 0xc: 0x820,\n\t 0xd: 0x0,\n\t 0xe: 0x8000020,\n\t 0xf: 0x20820,\n\t 0x80000000: 0x800,\n\t 0x80000001: 0x8020820,\n\t 0x80000002: 0x8000820,\n\t 0x80000003: 0x8000000,\n\t 0x80000004: 0x8020000,\n\t 0x80000005: 0x20800,\n\t 0x80000006: 0x20820,\n\t 0x80000007: 0x20,\n\t 0x80000008: 0x8000020,\n\t 0x80000009: 0x820,\n\t 0x8000000a: 0x20020,\n\t 0x8000000b: 0x8020800,\n\t 0x8000000c: 0x0,\n\t 0x8000000d: 0x8020020,\n\t 0x8000000e: 0x8000800,\n\t 0x8000000f: 0x20000,\n\t 0x10: 0x20820,\n\t 0x11: 0x8020800,\n\t 0x12: 0x20,\n\t 0x13: 0x800,\n\t 0x14: 0x8000800,\n\t 0x15: 0x8000020,\n\t 0x16: 0x8020020,\n\t 0x17: 0x20000,\n\t 0x18: 0x0,\n\t 0x19: 0x20020,\n\t 0x1a: 0x8020000,\n\t 0x1b: 0x8000820,\n\t 0x1c: 0x8020820,\n\t 0x1d: 0x20800,\n\t 0x1e: 0x820,\n\t 0x1f: 0x8000000,\n\t 0x80000010: 0x20000,\n\t 0x80000011: 0x800,\n\t 0x80000012: 0x8020020,\n\t 0x80000013: 0x20820,\n\t 0x80000014: 0x20,\n\t 0x80000015: 0x8020000,\n\t 0x80000016: 0x8000000,\n\t 0x80000017: 0x8000820,\n\t 0x80000018: 0x8020820,\n\t 0x80000019: 0x8000020,\n\t 0x8000001a: 0x8000800,\n\t 0x8000001b: 0x0,\n\t 0x8000001c: 0x20800,\n\t 0x8000001d: 0x820,\n\t 0x8000001e: 0x20020,\n\t 0x8000001f: 0x8020800\n\t }\n\t ];\n\n\t // Masks that select the SBOX input\n\t var SBOX_MASK = [\n\t 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,\n\t 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f\n\t ];\n\n\t /**\n\t * DES block cipher algorithm.\n\t */\n\t var DES = C_algo.DES = BlockCipher.extend({\n\t _doReset: function () {\n\t // Shortcuts\n\t var key = this._key;\n\t var keyWords = key.words;\n\n\t // Select 56 bits according to PC1\n\t var keyBits = [];\n\t for (var i = 0; i < 56; i++) {\n\t var keyBitPos = PC1[i] - 1;\n\t keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;\n\t }\n\n\t // Assemble 16 subkeys\n\t var subKeys = this._subKeys = [];\n\t for (var nSubKey = 0; nSubKey < 16; nSubKey++) {\n\t // Create subkey\n\t var subKey = subKeys[nSubKey] = [];\n\n\t // Shortcut\n\t var bitShift = BIT_SHIFTS[nSubKey];\n\n\t // Select 48 bits according to PC2\n\t for (var i = 0; i < 24; i++) {\n\t // Select from the left 28 key bits\n\t subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);\n\n\t // Select from the right 28 key bits\n\t subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);\n\t }\n\n\t // Since each subkey is applied to an expanded 32-bit input,\n\t // the subkey can be broken into 8 values scaled to 32-bits,\n\t // which allows the key to be used without expansion\n\t subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);\n\t for (var i = 1; i < 7; i++) {\n\t subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);\n\t }\n\t subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);\n\t }\n\n\t // Compute inverse subkeys\n\t var invSubKeys = this._invSubKeys = [];\n\t for (var i = 0; i < 16; i++) {\n\t invSubKeys[i] = subKeys[15 - i];\n\t }\n\t },\n\n\t encryptBlock: function (M, offset) {\n\t this._doCryptBlock(M, offset, this._subKeys);\n\t },\n\n\t decryptBlock: function (M, offset) {\n\t this._doCryptBlock(M, offset, this._invSubKeys);\n\t },\n\n\t _doCryptBlock: function (M, offset, subKeys) {\n\t // Get input\n\t this._lBlock = M[offset];\n\t this._rBlock = M[offset + 1];\n\n\t // Initial permutation\n\t exchangeLR.call(this, 4, 0x0f0f0f0f);\n\t exchangeLR.call(this, 16, 0x0000ffff);\n\t exchangeRL.call(this, 2, 0x33333333);\n\t exchangeRL.call(this, 8, 0x00ff00ff);\n\t exchangeLR.call(this, 1, 0x55555555);\n\n\t // Rounds\n\t for (var round = 0; round < 16; round++) {\n\t // Shortcuts\n\t var subKey = subKeys[round];\n\t var lBlock = this._lBlock;\n\t var rBlock = this._rBlock;\n\n\t // Feistel function\n\t var f = 0;\n\t for (var i = 0; i < 8; i++) {\n\t f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];\n\t }\n\t this._lBlock = rBlock;\n\t this._rBlock = lBlock ^ f;\n\t }\n\n\t // Undo swap from last round\n\t var t = this._lBlock;\n\t this._lBlock = this._rBlock;\n\t this._rBlock = t;\n\n\t // Final permutation\n\t exchangeLR.call(this, 1, 0x55555555);\n\t exchangeRL.call(this, 8, 0x00ff00ff);\n\t exchangeRL.call(this, 2, 0x33333333);\n\t exchangeLR.call(this, 16, 0x0000ffff);\n\t exchangeLR.call(this, 4, 0x0f0f0f0f);\n\n\t // Set output\n\t M[offset] = this._lBlock;\n\t M[offset + 1] = this._rBlock;\n\t },\n\n\t keySize: 64/32,\n\n\t ivSize: 64/32,\n\n\t blockSize: 64/32\n\t });\n\n\t // Swap bits across the left and right words\n\t function exchangeLR(offset, mask) {\n\t var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;\n\t this._rBlock ^= t;\n\t this._lBlock ^= t << offset;\n\t }\n\n\t function exchangeRL(offset, mask) {\n\t var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;\n\t this._lBlock ^= t;\n\t this._rBlock ^= t << offset;\n\t }\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);\n\t */\n\t C.DES = BlockCipher._createHelper(DES);\n\n\t /**\n\t * Triple-DES block cipher algorithm.\n\t */\n\t var TripleDES = C_algo.TripleDES = BlockCipher.extend({\n\t _doReset: function () {\n\t // Shortcuts\n\t var key = this._key;\n\t var keyWords = key.words;\n\t // Make sure the key length is valid (64, 128 or >= 192 bit)\n\t if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) {\n\t throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.');\n\t }\n\n\t // Extend the key according to the keying options defined in 3DES standard\n\t var key1 = keyWords.slice(0, 2);\n\t var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4);\n\t var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6);\n\n\t // Create DES instances\n\t this._des1 = DES.createEncryptor(WordArray.create(key1));\n\t this._des2 = DES.createEncryptor(WordArray.create(key2));\n\t this._des3 = DES.createEncryptor(WordArray.create(key3));\n\t },\n\n\t encryptBlock: function (M, offset) {\n\t this._des1.encryptBlock(M, offset);\n\t this._des2.decryptBlock(M, offset);\n\t this._des3.encryptBlock(M, offset);\n\t },\n\n\t decryptBlock: function (M, offset) {\n\t this._des3.decryptBlock(M, offset);\n\t this._des2.encryptBlock(M, offset);\n\t this._des1.decryptBlock(M, offset);\n\t },\n\n\t keySize: 192/32,\n\n\t ivSize: 64/32,\n\n\t blockSize: 64/32\n\t });\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);\n\t */\n\t C.TripleDES = BlockCipher._createHelper(TripleDES);\n\t}());\n\n\n\treturn CryptoJS.TripleDES;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (undefined) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var X32WordArray = C_lib.WordArray;\n\n\t /**\n\t * x64 namespace.\n\t */\n\t var C_x64 = C.x64 = {};\n\n\t /**\n\t * A 64-bit word.\n\t */\n\t var X64Word = C_x64.Word = Base.extend({\n\t /**\n\t * Initializes a newly created 64-bit word.\n\t *\n\t * @param {number} high The high 32 bits.\n\t * @param {number} low The low 32 bits.\n\t *\n\t * @example\n\t *\n\t * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);\n\t */\n\t init: function (high, low) {\n\t this.high = high;\n\t this.low = low;\n\t }\n\n\t /**\n\t * Bitwise NOTs this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after negating.\n\t *\n\t * @example\n\t *\n\t * var negated = x64Word.not();\n\t */\n\t // not: function () {\n\t // var high = ~this.high;\n\t // var low = ~this.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Bitwise ANDs this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to AND with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after ANDing.\n\t *\n\t * @example\n\t *\n\t * var anded = x64Word.and(anotherX64Word);\n\t */\n\t // and: function (word) {\n\t // var high = this.high & word.high;\n\t // var low = this.low & word.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Bitwise ORs this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to OR with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after ORing.\n\t *\n\t * @example\n\t *\n\t * var ored = x64Word.or(anotherX64Word);\n\t */\n\t // or: function (word) {\n\t // var high = this.high | word.high;\n\t // var low = this.low | word.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Bitwise XORs this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to XOR with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after XORing.\n\t *\n\t * @example\n\t *\n\t * var xored = x64Word.xor(anotherX64Word);\n\t */\n\t // xor: function (word) {\n\t // var high = this.high ^ word.high;\n\t // var low = this.low ^ word.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Shifts this word n bits to the left.\n\t *\n\t * @param {number} n The number of bits to shift.\n\t *\n\t * @return {X64Word} A new x64-Word object after shifting.\n\t *\n\t * @example\n\t *\n\t * var shifted = x64Word.shiftL(25);\n\t */\n\t // shiftL: function (n) {\n\t // if (n < 32) {\n\t // var high = (this.high << n) | (this.low >>> (32 - n));\n\t // var low = this.low << n;\n\t // } else {\n\t // var high = this.low << (n - 32);\n\t // var low = 0;\n\t // }\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Shifts this word n bits to the right.\n\t *\n\t * @param {number} n The number of bits to shift.\n\t *\n\t * @return {X64Word} A new x64-Word object after shifting.\n\t *\n\t * @example\n\t *\n\t * var shifted = x64Word.shiftR(7);\n\t */\n\t // shiftR: function (n) {\n\t // if (n < 32) {\n\t // var low = (this.low >>> n) | (this.high << (32 - n));\n\t // var high = this.high >>> n;\n\t // } else {\n\t // var low = this.high >>> (n - 32);\n\t // var high = 0;\n\t // }\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Rotates this word n bits to the left.\n\t *\n\t * @param {number} n The number of bits to rotate.\n\t *\n\t * @return {X64Word} A new x64-Word object after rotating.\n\t *\n\t * @example\n\t *\n\t * var rotated = x64Word.rotL(25);\n\t */\n\t // rotL: function (n) {\n\t // return this.shiftL(n).or(this.shiftR(64 - n));\n\t // },\n\n\t /**\n\t * Rotates this word n bits to the right.\n\t *\n\t * @param {number} n The number of bits to rotate.\n\t *\n\t * @return {X64Word} A new x64-Word object after rotating.\n\t *\n\t * @example\n\t *\n\t * var rotated = x64Word.rotR(7);\n\t */\n\t // rotR: function (n) {\n\t // return this.shiftR(n).or(this.shiftL(64 - n));\n\t // },\n\n\t /**\n\t * Adds this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to add with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after adding.\n\t *\n\t * @example\n\t *\n\t * var added = x64Word.add(anotherX64Word);\n\t */\n\t // add: function (word) {\n\t // var low = (this.low + word.low) | 0;\n\t // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;\n\t // var high = (this.high + word.high + carry) | 0;\n\n\t // return X64Word.create(high, low);\n\t // }\n\t });\n\n\t /**\n\t * An array of 64-bit words.\n\t *\n\t * @property {Array} words The array of CryptoJS.x64.Word objects.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var X64WordArray = C_x64.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.x64.WordArray.create();\n\t *\n\t * var wordArray = CryptoJS.x64.WordArray.create([\n\t * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n\t * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n\t * ]);\n\t *\n\t * var wordArray = CryptoJS.x64.WordArray.create([\n\t * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n\t * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n\t * ], 10);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 8;\n\t }\n\t },\n\n\t /**\n\t * Converts this 64-bit word array to a 32-bit word array.\n\t *\n\t * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.\n\t *\n\t * @example\n\t *\n\t * var x32WordArray = x64WordArray.toX32();\n\t */\n\t toX32: function () {\n\t // Shortcuts\n\t var x64Words = this.words;\n\t var x64WordsLength = x64Words.length;\n\n\t // Convert\n\t var x32Words = [];\n\t for (var i = 0; i < x64WordsLength; i++) {\n\t var x64Word = x64Words[i];\n\t x32Words.push(x64Word.high);\n\t x32Words.push(x64Word.low);\n\t }\n\n\t return X32WordArray.create(x32Words, this.sigBytes);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {X64WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = x64WordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\n\t // Clone \"words\" array\n\t var words = clone.words = this.words.slice(0);\n\n\t // Clone each X64Word object\n\t var wordsLength = words.length;\n\t for (var i = 0; i < wordsLength; i++) {\n\t words[i] = words[i].clone();\n\t }\n\n\t return clone;\n\t }\n\t });\n\t}());\n\n\n\treturn CryptoJS;\n\n}));","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","\"use strict\";\n\nmodule.exports = function (url, options) {\n if (!options) {\n options = {};\n }\n if (!url) {\n return url;\n }\n url = String(url.__esModule ? url.default : url);\n\n // If url is already wrapped in quotes, remove them\n if (/^['\"].*['\"]$/.test(url)) {\n url = url.slice(1, -1);\n }\n if (options.hash) {\n url += options.hash;\n }\n\n // Should url be wrapped?\n // See https://drafts.csswg.org/css-values-3/#urls\n if (/[\"'() \\t\\n]|(%20)/.test(url) || options.needQuotes) {\n return \"\\\"\".concat(url.replace(/\"/g, '\\\\\"').replace(/\\n/g, \"\\\\n\"), \"\\\"\");\n }\n return url;\n};","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","var has = Object.prototype.hasOwnProperty;\n\nfunction dequal(foo, bar) {\n\tvar ctor, len;\n\tif (foo === bar) return true;\n\n\tif (foo && bar && (ctor=foo.constructor) === bar.constructor) {\n\t\tif (ctor === Date) return foo.getTime() === bar.getTime();\n\t\tif (ctor === RegExp) return foo.toString() === bar.toString();\n\n\t\tif (ctor === Array) {\n\t\t\tif ((len=foo.length) === bar.length) {\n\t\t\t\twhile (len-- && dequal(foo[len], bar[len]));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (!ctor || typeof foo === 'object') {\n\t\t\tlen = 0;\n\t\t\tfor (ctor in foo) {\n\t\t\t\tif (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;\n\t\t\t\tif (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n\t\t\t}\n\t\t\treturn Object.keys(bar).length === len;\n\t\t}\n\t}\n\n\treturn foo !== foo && bar !== bar;\n}\n\nexports.dequal = dequal;","// 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'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","/*!\n * isobject \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\n'use strict';\n\nmodule.exports = function isObject(val) {\n return val != null && typeof val === 'object' && Array.isArray(val) === false;\n};\n","/*! js-cookie v3.0.5 | MIT */\n;\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () {\n var current = global.Cookies;\n var exports = global.Cookies = factory();\n exports.noConflict = function () { global.Cookies = current; return exports; };\n })());\n})(this, (function () { 'use strict';\n\n /* eslint-disable no-var */\n function assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target\n }\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n var defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n };\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n\n function init (converter, defaultAttributes) {\n function set (name, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n name = encodeURIComponent(name)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n name + '=' + converter.write(value, name) + stringifiedAttributes)\n }\n\n function get (name) {\n if (typeof document === 'undefined' || (arguments.length && !name)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var found = decodeURIComponent(parts[0]);\n jar[found] = converter.read(value, found);\n\n if (name === found) {\n break\n }\n } catch (e) {}\n }\n\n return name ? jar[name] : jar\n }\n\n return Object.create(\n {\n set,\n get,\n remove: function (name, attributes) {\n set(\n name,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n }\n\n var api = init(defaultConverter, { path: '/' });\n /* eslint-enable no-var */\n\n return api;\n\n}));\n","var toString = Object.prototype.toString;\n\nmodule.exports = function kindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n\n var type = typeof val;\n if (type === 'boolean') return 'boolean';\n if (type === 'string') return 'string';\n if (type === 'number') return 'number';\n if (type === 'symbol') return 'symbol';\n if (type === 'function') {\n return isGeneratorFn(val) ? 'generatorfunction' : 'function';\n }\n\n if (isArray(val)) return 'array';\n if (isBuffer(val)) return 'buffer';\n if (isArguments(val)) return 'arguments';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n if (isRegexp(val)) return 'regexp';\n\n switch (ctorName(val)) {\n case 'Symbol': return 'symbol';\n case 'Promise': return 'promise';\n\n // Set, Map, WeakSet, WeakMap\n case 'WeakMap': return 'weakmap';\n case 'WeakSet': return 'weakset';\n case 'Map': return 'map';\n case 'Set': return 'set';\n\n // 8-bit typed arrays\n case 'Int8Array': return 'int8array';\n case 'Uint8Array': return 'uint8array';\n case 'Uint8ClampedArray': return 'uint8clampedarray';\n\n // 16-bit typed arrays\n case 'Int16Array': return 'int16array';\n case 'Uint16Array': return 'uint16array';\n\n // 32-bit typed arrays\n case 'Int32Array': return 'int32array';\n case 'Uint32Array': return 'uint32array';\n case 'Float32Array': return 'float32array';\n case 'Float64Array': return 'float64array';\n }\n\n if (isGeneratorObj(val)) {\n return 'generator';\n }\n\n // Non-plain objects\n type = toString.call(val);\n switch (type) {\n case '[object Object]': return 'object';\n // iterators\n case '[object Map Iterator]': return 'mapiterator';\n case '[object Set Iterator]': return 'setiterator';\n case '[object String Iterator]': return 'stringiterator';\n case '[object Array Iterator]': return 'arrayiterator';\n }\n\n // other\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n};\n\nfunction ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\n\nfunction isArray(val) {\n if (Array.isArray) return Array.isArray(val);\n return val instanceof Array;\n}\n\nfunction isError(val) {\n return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number');\n}\n\nfunction isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function'\n && typeof val.getDate === 'function'\n && typeof val.setDate === 'function';\n}\n\nfunction isRegexp(val) {\n if (val instanceof RegExp) return true;\n return typeof val.flags === 'string'\n && typeof val.ignoreCase === 'boolean'\n && typeof val.multiline === 'boolean'\n && typeof val.global === 'boolean';\n}\n\nfunction isGeneratorFn(name, val) {\n return ctorName(name) === 'GeneratorFunction';\n}\n\nfunction isGeneratorObj(val) {\n return typeof val.throw === 'function'\n && typeof val.return === 'function'\n && typeof val.next === 'function';\n}\n\nfunction isArguments(val) {\n try {\n if (typeof val.length === 'number' && typeof val.callee === 'function') {\n return true;\n }\n } catch (err) {\n if (err.message.indexOf('callee') !== -1) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * If you need to support Safari 5-7 (8-10 yr-old browser),\n * take a look at https://github.com/feross/is-buffer\n */\n\nfunction isBuffer(val) {\n if (val.constructor && typeof val.constructor.isBuffer === 'function') {\n return val.constructor.isBuffer(val);\n }\n return false;\n}\n","'use strict'\nfunction tryStringify (o) {\n try { return JSON.stringify(o) } catch(e) { return '\"[Circular]\"' }\n}\n\nmodule.exports = format\n\nfunction format(f, args, opts) {\n var ss = (opts && opts.stringify) || tryStringify\n var offset = 1\n if (typeof f === 'object' && f !== null) {\n var len = args.length + offset\n if (len === 1) return f\n var objects = new Array(len)\n objects[0] = ss(f)\n for (var index = 1; index < len; index++) {\n objects[index] = ss(args[index])\n }\n return objects.join(' ')\n }\n if (typeof f !== 'string') {\n return f\n }\n var argLen = args.length\n if (argLen === 0) return f\n var str = ''\n var a = 1 - offset\n var lastPos = -1\n var flen = (f && f.length) || 0\n for (var i = 0; i < flen;) {\n if (f.charCodeAt(i) === 37 && i + 1 < flen) {\n lastPos = lastPos > -1 ? lastPos : 0\n switch (f.charCodeAt(i + 1)) {\n case 100: // 'd'\n case 102: // 'f'\n if (a >= argLen)\n break\n if (args[a] == null) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += Number(args[a])\n lastPos = i + 2\n i++\n break\n case 105: // 'i'\n if (a >= argLen)\n break\n if (args[a] == null) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += Math.floor(Number(args[a]))\n lastPos = i + 2\n i++\n break\n case 79: // 'O'\n case 111: // 'o'\n case 106: // 'j'\n if (a >= argLen)\n break\n if (args[a] === undefined) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n var type = typeof args[a]\n if (type === 'string') {\n str += '\\'' + args[a] + '\\''\n lastPos = i + 2\n i++\n break\n }\n if (type === 'function') {\n str += args[a].name || ''\n lastPos = i + 2\n i++\n break\n }\n str += ss(args[a])\n lastPos = i + 2\n i++\n break\n case 115: // 's'\n if (a >= argLen)\n break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += String(args[a])\n lastPos = i + 2\n i++\n break\n case 37: // '%'\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += '%'\n lastPos = i + 2\n i++\n a--\n break\n }\n ++a\n }\n ++i\n }\n if (lastPos === -1)\n return f\n else if (lastPos < flen) {\n str += f.slice(lastPos)\n }\n\n return str\n}\n","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its 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'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its 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'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1\n *\n * Copyright (c) 2015-present, Jon Schlinkert.\n * Released under the MIT License.\n */\n\n'use strict';\n\nconst valueOf = Symbol.prototype.valueOf;\nconst typeOf = require('kind-of');\n\nfunction clone(val, deep) {\n switch (typeOf(val)) {\n case 'array':\n return val.slice();\n case 'object':\n return Object.assign({}, val);\n case 'date':\n return new val.constructor(Number(val));\n case 'map':\n return new Map(val);\n case 'set':\n return new Set(val);\n case 'buffer':\n return cloneBuffer(val);\n case 'symbol':\n return cloneSymbol(val);\n case 'arraybuffer':\n return cloneArrayBuffer(val);\n case 'float32array':\n case 'float64array':\n case 'int16array':\n case 'int32array':\n case 'int8array':\n case 'uint16array':\n case 'uint32array':\n case 'uint8clampedarray':\n case 'uint8array':\n return cloneTypedArray(val);\n case 'regexp':\n return cloneRegExp(val);\n case 'error':\n return Object.create(val);\n default: {\n return val;\n }\n }\n}\n\nfunction cloneRegExp(val) {\n const flags = val.flags !== void 0 ? val.flags : (/\\w+$/.exec(val) || void 0);\n const re = new val.constructor(val.source, flags);\n re.lastIndex = val.lastIndex;\n return re;\n}\n\nfunction cloneArrayBuffer(val) {\n const res = new val.constructor(val.byteLength);\n new Uint8Array(res).set(new Uint8Array(val));\n return res;\n}\n\nfunction cloneTypedArray(val, deep) {\n return new val.constructor(val.buffer, val.byteOffset, val.length);\n}\n\nfunction cloneBuffer(val) {\n const len = val.length;\n const buf = Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : Buffer.from(len);\n val.copy(buf);\n return buf;\n}\n\nfunction cloneSymbol(val) {\n return valueOf ? Object(valueOf.call(val)) : {};\n}\n\n/**\n * Expose `clone`\n */\n\nmodule.exports = clone;\n","'use client';\nvar React = require('react');\nvar revalidateEvents = require('./events.js');\nvar lite = require('dequal/lite');\n\nfunction _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n.default = e;\n return n;\n}\n\nvar React__default = /*#__PURE__*/_interopDefault(React);\nvar revalidateEvents__namespace = /*#__PURE__*/_interopNamespace(revalidateEvents);\n\n// Global state used to deduplicate requests and store listeners\nconst SWRGlobalState = new WeakMap();\n\n// Shared state between server components and client components\nconst noop = ()=>{};\n// Using noop() as the undefined value as undefined can be replaced\n// by something else. Prettier ignore and extra parentheses are necessary here\n// to ensure that tsc doesn't remove the __NOINLINE__ comment.\n// prettier-ignore\nconst UNDEFINED = /*#__NOINLINE__*/ noop();\nconst OBJECT = Object;\nconst isUndefined = (v)=>v === UNDEFINED;\nconst isFunction = (v)=>typeof v == 'function';\nconst mergeObjects = (a, b)=>({\n ...a,\n ...b\n });\nconst isPromiseLike = (x)=>isFunction(x.then);\n\nconst EMPTY_CACHE = {};\nconst INITIAL_CACHE = {};\nconst STR_UNDEFINED = 'undefined';\n// NOTE: Use the function to guarantee it's re-evaluated between jsdom and node runtime for tests.\nconst isWindowDefined = typeof window != STR_UNDEFINED;\nconst isDocumentDefined = typeof document != STR_UNDEFINED;\nconst isLegacyDeno = isWindowDefined && 'Deno' in window;\nconst hasRequestAnimationFrame = ()=>isWindowDefined && typeof window['requestAnimationFrame'] != STR_UNDEFINED;\nconst createCacheHelper = (cache, key)=>{\n const state = SWRGlobalState.get(cache);\n return [\n // Getter\n ()=>!isUndefined(key) && cache.get(key) || EMPTY_CACHE,\n // Setter\n (info)=>{\n if (!isUndefined(key)) {\n const prev = cache.get(key);\n // Before writing to the store, we keep the value in the initial cache\n // if it's not there yet.\n if (!(key in INITIAL_CACHE)) {\n INITIAL_CACHE[key] = prev;\n }\n state[5](key, mergeObjects(prev, info), prev || EMPTY_CACHE);\n }\n },\n // Subscriber\n state[6],\n // Get server cache snapshot\n ()=>{\n if (!isUndefined(key)) {\n // If the cache was updated on the client, we return the stored initial value.\n if (key in INITIAL_CACHE) return INITIAL_CACHE[key];\n }\n // If we haven't done any client-side updates, we return the current value.\n return !isUndefined(key) && cache.get(key) || EMPTY_CACHE;\n }\n ];\n} // export { UNDEFINED, OBJECT, isUndefined, isFunction, mergeObjects, isPromiseLike }\n;\n\n/**\n * Due to the bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,\n * it's not reliable to detect if the browser is currently online or offline\n * based on `navigator.onLine`.\n * As a workaround, we always assume it's online on the first load, and change\n * the status upon `online` or `offline` events.\n */ let online = true;\nconst isOnline = ()=>online;\n// For node and React Native, `add/removeEventListener` doesn't exist on window.\nconst [onWindowEvent, offWindowEvent] = isWindowDefined && window.addEventListener ? [\n window.addEventListener.bind(window),\n window.removeEventListener.bind(window)\n] : [\n noop,\n noop\n];\nconst isVisible = ()=>{\n const visibilityState = isDocumentDefined && document.visibilityState;\n return isUndefined(visibilityState) || visibilityState !== 'hidden';\n};\nconst initFocus = (callback)=>{\n // focus revalidate\n if (isDocumentDefined) {\n document.addEventListener('visibilitychange', callback);\n }\n onWindowEvent('focus', callback);\n return ()=>{\n if (isDocumentDefined) {\n document.removeEventListener('visibilitychange', callback);\n }\n offWindowEvent('focus', callback);\n };\n};\nconst initReconnect = (callback)=>{\n // revalidate on reconnected\n const onOnline = ()=>{\n online = true;\n callback();\n };\n // nothing to revalidate, just update the status\n const onOffline = ()=>{\n online = false;\n };\n onWindowEvent('online', onOnline);\n onWindowEvent('offline', onOffline);\n return ()=>{\n offWindowEvent('online', onOnline);\n offWindowEvent('offline', onOffline);\n };\n};\nconst preset = {\n isOnline,\n isVisible\n};\nconst defaultConfigOptions = {\n initFocus,\n initReconnect\n};\n\nconst IS_REACT_LEGACY = !React__default.default.useId;\nconst IS_SERVER = !isWindowDefined || isLegacyDeno;\n// Polyfill requestAnimationFrame\nconst rAF = (f)=>hasRequestAnimationFrame() ? window['requestAnimationFrame'](f) : setTimeout(f, 1);\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\nconst useIsomorphicLayoutEffect = IS_SERVER ? React.useEffect : React.useLayoutEffect;\n// This assignment is to extend the Navigator type to use effectiveType.\nconst navigatorConnection = typeof navigator !== 'undefined' && navigator.connection;\n// Adjust the config based on slow connection status (<= 70Kbps).\nconst slowConnection = !IS_SERVER && navigatorConnection && ([\n 'slow-2g',\n '2g'\n].includes(navigatorConnection.effectiveType) || navigatorConnection.saveData);\n\n// use WeakMap to store the object->key mapping\n// so the objects can be garbage collected.\n// WeakMap uses a hashtable under the hood, so the lookup\n// complexity is almost O(1).\nconst table = new WeakMap();\nconst isObjectType = (value, type)=>OBJECT.prototype.toString.call(value) === `[object ${type}]`;\n// counter of the key\nlet counter = 0;\n// A stable hash implementation that supports:\n// - Fast and ensures unique hash properties\n// - Handles unserializable values\n// - Handles object key ordering\n// - Generates short results\n//\n// This is not a serialization function, and the result is not guaranteed to be\n// parsable.\nconst stableHash = (arg)=>{\n const type = typeof arg;\n const isDate = isObjectType(arg, 'Date');\n const isRegex = isObjectType(arg, 'RegExp');\n const isPlainObject = isObjectType(arg, 'Object');\n let result;\n let index;\n if (OBJECT(arg) === arg && !isDate && !isRegex) {\n // Object/function, not null/date/regexp. Use WeakMap to store the id first.\n // If it's already hashed, directly return the result.\n result = table.get(arg);\n if (result) return result;\n // Store the hash first for circular reference detection before entering the\n // recursive `stableHash` calls.\n // For other objects like set and map, we use this id directly as the hash.\n result = ++counter + '~';\n table.set(arg, result);\n if (Array.isArray(arg)) {\n // Array.\n result = '@';\n for(index = 0; index < arg.length; index++){\n result += stableHash(arg[index]) + ',';\n }\n table.set(arg, result);\n }\n if (isPlainObject) {\n // Object, sort keys.\n result = '#';\n const keys = OBJECT.keys(arg).sort();\n while(!isUndefined(index = keys.pop())){\n if (!isUndefined(arg[index])) {\n result += index + ':' + stableHash(arg[index]) + ',';\n }\n }\n table.set(arg, result);\n }\n } else {\n result = isDate ? arg.toJSON() : type == 'symbol' ? arg.toString() : type == 'string' ? JSON.stringify(arg) : '' + arg;\n }\n return result;\n};\n\nconst serialize = (key)=>{\n if (isFunction(key)) {\n try {\n key = key();\n } catch (err) {\n // dependencies not ready\n key = '';\n }\n }\n // Use the original key as the argument of fetcher. This can be a string or an\n // array of values.\n const args = key;\n // If key is not falsy, or not an empty array, hash it.\n key = typeof key == 'string' ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : '';\n return [\n key,\n args\n ];\n};\n\n// Global timestamp.\nlet __timestamp = 0;\nconst getTimestamp = ()=>++__timestamp;\n\nasync function internalMutate(...args) {\n const [cache, _key, _data, _opts] = args;\n // When passing as a boolean, it's explicitly used to disable/enable\n // revalidation.\n const options = mergeObjects({\n populateCache: true,\n throwOnError: true\n }, typeof _opts === 'boolean' ? {\n revalidate: _opts\n } : _opts || {});\n let populateCache = options.populateCache;\n const rollbackOnErrorOption = options.rollbackOnError;\n let optimisticData = options.optimisticData;\n const rollbackOnError = (error)=>{\n return typeof rollbackOnErrorOption === 'function' ? rollbackOnErrorOption(error) : rollbackOnErrorOption !== false;\n };\n const throwOnError = options.throwOnError;\n // If the second argument is a key filter, return the mutation results for all\n // filtered keys.\n if (isFunction(_key)) {\n const keyFilter = _key;\n const matchedKeys = [];\n const it = cache.keys();\n for (const key of it){\n if (// Skip the special useSWRInfinite and useSWRSubscription keys.\n !/^\\$(inf|sub)\\$/.test(key) && keyFilter(cache.get(key)._k)) {\n matchedKeys.push(key);\n }\n }\n return Promise.all(matchedKeys.map(mutateByKey));\n }\n return mutateByKey(_key);\n async function mutateByKey(_k) {\n // Serialize key\n const [key] = serialize(_k);\n if (!key) return;\n const [get, set] = createCacheHelper(cache, key);\n const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache);\n const startRevalidate = ()=>{\n const revalidators = EVENT_REVALIDATORS[key];\n const revalidate = isFunction(options.revalidate) ? options.revalidate(get().data, _k) : options.revalidate !== false;\n if (revalidate) {\n // Invalidate the key by deleting the concurrent request markers so new\n // requests will not be deduped.\n delete FETCH[key];\n delete PRELOAD[key];\n if (revalidators && revalidators[0]) {\n return revalidators[0](revalidateEvents__namespace.MUTATE_EVENT).then(()=>get().data);\n }\n }\n return get().data;\n };\n // If there is no new data provided, revalidate the key with current state.\n if (args.length < 3) {\n // Revalidate and broadcast state.\n return startRevalidate();\n }\n let data = _data;\n let error;\n // Update global timestamps.\n const beforeMutationTs = getTimestamp();\n MUTATION[key] = [\n beforeMutationTs,\n 0\n ];\n const hasOptimisticData = !isUndefined(optimisticData);\n const state = get();\n // `displayedData` is the current value on screen. It could be the optimistic value\n // that is going to be overridden by a `committedData`, or get reverted back.\n // `committedData` is the validated value that comes from a fetch or mutation.\n const displayedData = state.data;\n const currentData = state._c;\n const committedData = isUndefined(currentData) ? displayedData : currentData;\n // Do optimistic data update.\n if (hasOptimisticData) {\n optimisticData = isFunction(optimisticData) ? optimisticData(committedData, displayedData) : optimisticData;\n // When we set optimistic data, backup the current committedData data in `_c`.\n set({\n data: optimisticData,\n _c: committedData\n });\n }\n if (isFunction(data)) {\n // `data` is a function, call it passing current cache value.\n try {\n data = data(committedData);\n } catch (err) {\n // If it throws an error synchronously, we shouldn't update the cache.\n error = err;\n }\n }\n // `data` is a promise/thenable, resolve the final data first.\n if (data && isPromiseLike(data)) {\n // This means that the mutation is async, we need to check timestamps to\n // avoid race conditions.\n data = await data.catch((err)=>{\n error = err;\n });\n // Check if other mutations have occurred since we've started this mutation.\n // If there's a race we don't update cache or broadcast the change,\n // just return the data.\n if (beforeMutationTs !== MUTATION[key][0]) {\n if (error) throw error;\n return data;\n } else if (error && hasOptimisticData && rollbackOnError(error)) {\n // Rollback. Always populate the cache in this case but without\n // transforming the data.\n populateCache = true;\n // Reset data to be the latest committed data, and clear the `_c` value.\n set({\n data: committedData,\n _c: UNDEFINED\n });\n }\n }\n // If we should write back the cache after request.\n if (populateCache) {\n if (!error) {\n // Transform the result into data.\n if (isFunction(populateCache)) {\n const populateCachedData = populateCache(data, committedData);\n set({\n data: populateCachedData,\n error: UNDEFINED,\n _c: UNDEFINED\n });\n } else {\n // Only update cached data and reset the error if there's no error. Data can be `undefined` here.\n set({\n data,\n error: UNDEFINED,\n _c: UNDEFINED\n });\n }\n }\n }\n // Reset the timestamp to mark the mutation has ended.\n MUTATION[key][1] = getTimestamp();\n // Update existing SWR Hooks' internal states:\n Promise.resolve(startRevalidate()).then(()=>{\n // The mutation and revalidation are ended, we can clear it since the data is\n // not an optimistic value anymore.\n set({\n _c: UNDEFINED\n });\n });\n // Throw error or return data\n if (error) {\n if (throwOnError) throw error;\n return;\n }\n return data;\n }\n}\n\nconst revalidateAllKeys = (revalidators, type)=>{\n for(const key in revalidators){\n if (revalidators[key][0]) revalidators[key][0](type);\n }\n};\nconst initCache = (provider, options)=>{\n // The global state for a specific provider will be used to deduplicate\n // requests and store listeners. As well as a mutate function that is bound to\n // the cache.\n // The provider's global state might be already initialized. Let's try to get the\n // global state associated with the provider first.\n if (!SWRGlobalState.has(provider)) {\n const opts = mergeObjects(defaultConfigOptions, options);\n // If there's no global state bound to the provider, create a new one with the\n // new mutate function.\n const EVENT_REVALIDATORS = Object.create(null);\n const mutate = internalMutate.bind(UNDEFINED, provider);\n let unmount = noop;\n const subscriptions = Object.create(null);\n const subscribe = (key, callback)=>{\n const subs = subscriptions[key] || [];\n subscriptions[key] = subs;\n subs.push(callback);\n return ()=>subs.splice(subs.indexOf(callback), 1);\n };\n const setter = (key, value, prev)=>{\n provider.set(key, value);\n const subs = subscriptions[key];\n if (subs) {\n for (const fn of subs){\n fn(value, prev);\n }\n }\n };\n const initProvider = ()=>{\n if (!SWRGlobalState.has(provider)) {\n // Update the state if it's new, or if the provider has been extended.\n SWRGlobalState.set(provider, [\n EVENT_REVALIDATORS,\n Object.create(null),\n Object.create(null),\n Object.create(null),\n mutate,\n setter,\n subscribe\n ]);\n if (!IS_SERVER) {\n // When listening to the native events for auto revalidations,\n // we intentionally put a delay (setTimeout) here to make sure they are\n // fired after immediate JavaScript executions, which can be\n // React's state updates.\n // This avoids some unnecessary revalidations such as\n // https://github.com/vercel/swr/issues/1680.\n const releaseFocus = opts.initFocus(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, revalidateEvents__namespace.FOCUS_EVENT)));\n const releaseReconnect = opts.initReconnect(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, revalidateEvents__namespace.RECONNECT_EVENT)));\n unmount = ()=>{\n releaseFocus && releaseFocus();\n releaseReconnect && releaseReconnect();\n // When un-mounting, we need to remove the cache provider from the state\n // storage too because it's a side-effect. Otherwise, when re-mounting we\n // will not re-register those event listeners.\n SWRGlobalState.delete(provider);\n };\n }\n }\n };\n initProvider();\n // This is a new provider, we need to initialize it and setup DOM events\n // listeners for `focus` and `reconnect` actions.\n // We might want to inject an extra layer on top of `provider` in the future,\n // such as key serialization, auto GC, etc.\n // For now, it's just a `Map` interface without any modifications.\n return [\n provider,\n mutate,\n initProvider,\n unmount\n ];\n }\n return [\n provider,\n SWRGlobalState.get(provider)[4]\n ];\n};\n\n// error retry\nconst onErrorRetry = (_, __, config, revalidate, opts)=>{\n const maxRetryCount = config.errorRetryCount;\n const currentRetryCount = opts.retryCount;\n // Exponential backoff\n const timeout = ~~((Math.random() + 0.5) * (1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;\n if (!isUndefined(maxRetryCount) && currentRetryCount > maxRetryCount) {\n return;\n }\n setTimeout(revalidate, timeout, opts);\n};\nconst compare = lite.dequal;\n// Default cache provider\nconst [cache, mutate] = initCache(new Map());\n// Default config\nconst defaultConfig = mergeObjects({\n // events\n onLoadingSlow: noop,\n onSuccess: noop,\n onError: noop,\n onErrorRetry,\n onDiscarded: noop,\n // switches\n revalidateOnFocus: true,\n revalidateOnReconnect: true,\n revalidateIfStale: true,\n shouldRetryOnError: true,\n // timeouts\n errorRetryInterval: slowConnection ? 10000 : 5000,\n focusThrottleInterval: 5 * 1000,\n dedupingInterval: 2 * 1000,\n loadingTimeout: slowConnection ? 5000 : 3000,\n // providers\n compare,\n isPaused: ()=>false,\n cache,\n mutate,\n fallback: {}\n}, // use web preset by default\npreset);\n\nconst mergeConfigs = (a, b)=>{\n // Need to create a new object to avoid mutating the original here.\n const v = mergeObjects(a, b);\n // If two configs are provided, merge their `use` and `fallback` options.\n if (b) {\n const { use: u1, fallback: f1 } = a;\n const { use: u2, fallback: f2 } = b;\n if (u1 && u2) {\n v.use = u1.concat(u2);\n }\n if (f1 && f2) {\n v.fallback = mergeObjects(f1, f2);\n }\n }\n return v;\n};\n\nconst SWRConfigContext = React.createContext({});\nconst SWRConfig = (props)=>{\n const { value } = props;\n const parentConfig = React.useContext(SWRConfigContext);\n const isFunctionalConfig = isFunction(value);\n const config = React.useMemo(()=>isFunctionalConfig ? value(parentConfig) : value, [\n isFunctionalConfig,\n parentConfig,\n value\n ]);\n // Extend parent context values and middleware.\n const extendedConfig = React.useMemo(()=>isFunctionalConfig ? config : mergeConfigs(parentConfig, config), [\n isFunctionalConfig,\n parentConfig,\n config\n ]);\n // Should not use the inherited provider.\n const provider = config && config.provider;\n // initialize the cache only on first access.\n const cacheContextRef = React.useRef(UNDEFINED);\n if (provider && !cacheContextRef.current) {\n cacheContextRef.current = initCache(provider(extendedConfig.cache || cache), config);\n }\n const cacheContext = cacheContextRef.current;\n // Override the cache if a new provider is given.\n if (cacheContext) {\n extendedConfig.cache = cacheContext[0];\n extendedConfig.mutate = cacheContext[1];\n }\n // Unsubscribe events.\n useIsomorphicLayoutEffect(()=>{\n if (cacheContext) {\n cacheContext[2] && cacheContext[2]();\n return cacheContext[3];\n }\n }, []);\n return React.createElement(SWRConfigContext.Provider, mergeObjects(props, {\n value: extendedConfig\n }));\n};\n\nexports.IS_REACT_LEGACY = IS_REACT_LEGACY;\nexports.IS_SERVER = IS_SERVER;\nexports.OBJECT = OBJECT;\nexports.SWRConfig = SWRConfig;\nexports.SWRConfigContext = SWRConfigContext;\nexports.SWRGlobalState = SWRGlobalState;\nexports.UNDEFINED = UNDEFINED;\nexports.cache = cache;\nexports.compare = compare;\nexports.createCacheHelper = createCacheHelper;\nexports.defaultConfig = defaultConfig;\nexports.defaultConfigOptions = defaultConfigOptions;\nexports.getTimestamp = getTimestamp;\nexports.hasRequestAnimationFrame = hasRequestAnimationFrame;\nexports.initCache = initCache;\nexports.internalMutate = internalMutate;\nexports.isDocumentDefined = isDocumentDefined;\nexports.isFunction = isFunction;\nexports.isLegacyDeno = isLegacyDeno;\nexports.isPromiseLike = isPromiseLike;\nexports.isUndefined = isUndefined;\nexports.isWindowDefined = isWindowDefined;\nexports.mergeConfigs = mergeConfigs;\nexports.mergeObjects = mergeObjects;\nexports.mutate = mutate;\nexports.noop = noop;\nexports.preset = preset;\nexports.rAF = rAF;\nexports.serialize = serialize;\nexports.slowConnection = slowConnection;\nexports.stableHash = stableHash;\nexports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;\n","Object.defineProperty(exports, '__esModule', { value: true });\n\nconst INFINITE_PREFIX = '$inf$';\n\nexports.INFINITE_PREFIX = INFINITE_PREFIX;\n","Object.defineProperty(exports, '__esModule', { value: true });\n\nconst FOCUS_EVENT = 0;\nconst RECONNECT_EVENT = 1;\nconst MUTATE_EVENT = 2;\nconst ERROR_REVALIDATE_EVENT = 3;\n\nexports.ERROR_REVALIDATE_EVENT = ERROR_REVALIDATE_EVENT;\nexports.FOCUS_EVENT = FOCUS_EVENT;\nexports.MUTATE_EVENT = MUTATE_EVENT;\nexports.RECONNECT_EVENT = RECONNECT_EVENT;\n","Object.defineProperty(exports, '__esModule', { value: true });\n\nvar configContextClient = require('./config-context-client-BXAm5QZy.js');\nvar revalidateEvents = require('./events.js');\nvar constants_js = require('./constants.js');\nvar React = require('react');\nvar types_js = require('./types.js');\n\nfunction _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n.default = e;\n return n;\n}\n\nvar revalidateEvents__namespace = /*#__PURE__*/_interopNamespace(revalidateEvents);\nvar React__default = /*#__PURE__*/_interopDefault(React);\n\n// @ts-expect-error\nconst enableDevtools = configContextClient.isWindowDefined && window.__SWR_DEVTOOLS_USE__;\nconst use = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];\nconst setupDevTools = ()=>{\n if (enableDevtools) {\n // @ts-expect-error\n window.__SWR_DEVTOOLS_REACT__ = React__default.default;\n }\n};\n\nconst normalize = (args)=>{\n return configContextClient.isFunction(args[1]) ? [\n args[0],\n args[1],\n args[2] || {}\n ] : [\n args[0],\n null,\n (args[1] === null ? args[2] : args[1]) || {}\n ];\n};\n\nconst useSWRConfig = ()=>{\n return configContextClient.mergeObjects(configContextClient.defaultConfig, React.useContext(configContextClient.SWRConfigContext));\n};\n\nconst preload = (key_, fetcher)=>{\n const [key, fnArg] = configContextClient.serialize(key_);\n const [, , , PRELOAD] = configContextClient.SWRGlobalState.get(configContextClient.cache);\n // Prevent preload to be called multiple times before used.\n if (PRELOAD[key]) return PRELOAD[key];\n const req = fetcher(fnArg);\n PRELOAD[key] = req;\n return req;\n};\nconst middleware = (useSWRNext)=>(key_, fetcher_, config)=>{\n // fetcher might be a sync function, so this should not be an async function\n const fetcher = fetcher_ && ((...args)=>{\n const [key] = configContextClient.serialize(key_);\n const [, , , PRELOAD] = configContextClient.SWRGlobalState.get(configContextClient.cache);\n if (key.startsWith(constants_js.INFINITE_PREFIX)) {\n // we want the infinite fetcher to be called.\n // handling of the PRELOAD cache happens there.\n return fetcher_(...args);\n }\n const req = PRELOAD[key];\n if (configContextClient.isUndefined(req)) return fetcher_(...args);\n delete PRELOAD[key];\n return req;\n });\n return useSWRNext(key_, fetcher, config);\n };\n\nconst BUILT_IN_MIDDLEWARE = use.concat(middleware);\n\n// It's tricky to pass generic types as parameters, so we just directly override\n// the types here.\nconst withArgs = (hook)=>{\n return function useSWRArgs(...args) {\n // Get the default and inherited configuration.\n const fallbackConfig = useSWRConfig();\n // Normalize arguments.\n const [key, fn, _config] = normalize(args);\n // Merge configurations.\n const config = configContextClient.mergeConfigs(fallbackConfig, _config);\n // Apply middleware\n let next = hook;\n const { use } = config;\n const middleware = (use || []).concat(BUILT_IN_MIDDLEWARE);\n for(let i = middleware.length; i--;){\n next = middleware[i](next);\n }\n return next(key, fn || config.fetcher || null, config);\n };\n};\n\n// Add a callback function to a list of keyed callback functions and return\n// the unsubscribe function.\nconst subscribeCallback = (key, callbacks, callback)=>{\n const keyedRevalidators = callbacks[key] || (callbacks[key] = []);\n keyedRevalidators.push(callback);\n return ()=>{\n const index = keyedRevalidators.indexOf(callback);\n if (index >= 0) {\n // O(1): faster than splice\n keyedRevalidators[index] = keyedRevalidators[keyedRevalidators.length - 1];\n keyedRevalidators.pop();\n }\n };\n};\n\n// Create a custom hook with a middleware\nconst withMiddleware = (useSWR, middleware)=>{\n return (...args)=>{\n const [key, fn, config] = normalize(args);\n const uses = (config.use || []).concat(middleware);\n return useSWR(key, fn, {\n ...config,\n use: uses\n });\n };\n};\n\nsetupDevTools();\n\nexports.IS_REACT_LEGACY = configContextClient.IS_REACT_LEGACY;\nexports.IS_SERVER = configContextClient.IS_SERVER;\nexports.OBJECT = configContextClient.OBJECT;\nexports.SWRConfig = configContextClient.SWRConfig;\nexports.SWRGlobalState = configContextClient.SWRGlobalState;\nexports.UNDEFINED = configContextClient.UNDEFINED;\nexports.cache = configContextClient.cache;\nexports.compare = configContextClient.compare;\nexports.createCacheHelper = configContextClient.createCacheHelper;\nexports.defaultConfig = configContextClient.defaultConfig;\nexports.defaultConfigOptions = configContextClient.defaultConfigOptions;\nexports.getTimestamp = configContextClient.getTimestamp;\nexports.hasRequestAnimationFrame = configContextClient.hasRequestAnimationFrame;\nexports.initCache = configContextClient.initCache;\nexports.internalMutate = configContextClient.internalMutate;\nexports.isDocumentDefined = configContextClient.isDocumentDefined;\nexports.isFunction = configContextClient.isFunction;\nexports.isLegacyDeno = configContextClient.isLegacyDeno;\nexports.isPromiseLike = configContextClient.isPromiseLike;\nexports.isUndefined = configContextClient.isUndefined;\nexports.isWindowDefined = configContextClient.isWindowDefined;\nexports.mergeConfigs = configContextClient.mergeConfigs;\nexports.mergeObjects = configContextClient.mergeObjects;\nexports.mutate = configContextClient.mutate;\nexports.noop = configContextClient.noop;\nexports.preset = configContextClient.preset;\nexports.rAF = configContextClient.rAF;\nexports.serialize = configContextClient.serialize;\nexports.slowConnection = configContextClient.slowConnection;\nexports.stableHash = configContextClient.stableHash;\nexports.useIsomorphicLayoutEffect = configContextClient.useIsomorphicLayoutEffect;\nexports.revalidateEvents = revalidateEvents__namespace;\nObject.defineProperty(exports, \"INFINITE_PREFIX\", {\n enumerable: true,\n get: function () { return constants_js.INFINITE_PREFIX; }\n});\nexports.normalize = normalize;\nexports.preload = preload;\nexports.subscribeCallback = subscribeCallback;\nexports.useSWRConfig = useSWRConfig;\nexports.withArgs = withArgs;\nexports.withMiddleware = withMiddleware;\nObject.keys(types_js).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {\n enumerable: true,\n get: function () { return types_js[k]; }\n });\n});\n","Object.defineProperty(exports, '__esModule', { value: true });\n\nvar React = require('react');\nvar index_js$1 = require('use-sync-external-store/shim/index.js');\nvar index_js = require('../_internal/index.js');\n\nfunction _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }\n\nvar React__default = /*#__PURE__*/_interopDefault(React);\n\n// Shared state between server components and client components\nconst noop = ()=>{};\n// Using noop() as the undefined value as undefined can be replaced\n// by something else. Prettier ignore and extra parentheses are necessary here\n// to ensure that tsc doesn't remove the __NOINLINE__ comment.\n// prettier-ignore\nconst UNDEFINED = /*#__NOINLINE__*/ noop();\nconst OBJECT = Object;\nconst isUndefined = (v)=>v === UNDEFINED;\nconst isFunction = (v)=>typeof v == 'function';\n\n// use WeakMap to store the object->key mapping\n// so the objects can be garbage collected.\n// WeakMap uses a hashtable under the hood, so the lookup\n// complexity is almost O(1).\nconst table = new WeakMap();\nconst isObjectType = (value, type)=>OBJECT.prototype.toString.call(value) === `[object ${type}]`;\n// counter of the key\nlet counter = 0;\n// A stable hash implementation that supports:\n// - Fast and ensures unique hash properties\n// - Handles unserializable values\n// - Handles object key ordering\n// - Generates short results\n//\n// This is not a serialization function, and the result is not guaranteed to be\n// parsable.\nconst stableHash = (arg)=>{\n const type = typeof arg;\n const isDate = isObjectType(arg, 'Date');\n const isRegex = isObjectType(arg, 'RegExp');\n const isPlainObject = isObjectType(arg, 'Object');\n let result;\n let index;\n if (OBJECT(arg) === arg && !isDate && !isRegex) {\n // Object/function, not null/date/regexp. Use WeakMap to store the id first.\n // If it's already hashed, directly return the result.\n result = table.get(arg);\n if (result) return result;\n // Store the hash first for circular reference detection before entering the\n // recursive `stableHash` calls.\n // For other objects like set and map, we use this id directly as the hash.\n result = ++counter + '~';\n table.set(arg, result);\n if (Array.isArray(arg)) {\n // Array.\n result = '@';\n for(index = 0; index < arg.length; index++){\n result += stableHash(arg[index]) + ',';\n }\n table.set(arg, result);\n }\n if (isPlainObject) {\n // Object, sort keys.\n result = '#';\n const keys = OBJECT.keys(arg).sort();\n while(!isUndefined(index = keys.pop())){\n if (!isUndefined(arg[index])) {\n result += index + ':' + stableHash(arg[index]) + ',';\n }\n }\n table.set(arg, result);\n }\n } else {\n result = isDate ? arg.toJSON() : type == 'symbol' ? arg.toString() : type == 'string' ? JSON.stringify(arg) : '' + arg;\n }\n return result;\n};\n\nconst serialize = (key)=>{\n if (isFunction(key)) {\n try {\n key = key();\n } catch (err) {\n // dependencies not ready\n key = '';\n }\n }\n // Use the original key as the argument of fetcher. This can be a string or an\n // array of values.\n const args = key;\n // If key is not falsy, or not an empty array, hash it.\n key = typeof key == 'string' ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : '';\n return [\n key,\n args\n ];\n};\n\nconst unstable_serialize = (key)=>serialize(key)[0];\n\n/// \nconst use = React__default.default.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax\n// and emitting an error.\n// We assume that this is only for the `use(thenable)` case, not `use(context)`.\n// https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45\n((thenable)=>{\n switch(thenable.status){\n case 'pending':\n throw thenable;\n case 'fulfilled':\n return thenable.value;\n case 'rejected':\n throw thenable.reason;\n default:\n thenable.status = 'pending';\n thenable.then((v)=>{\n thenable.status = 'fulfilled';\n thenable.value = v;\n }, (e)=>{\n thenable.status = 'rejected';\n thenable.reason = e;\n });\n throw thenable;\n }\n});\nconst WITH_DEDUPE = {\n dedupe: true\n};\nconst useSWRHandler = (_key, fetcher, config)=>{\n const { cache, compare, suspense, fallbackData, revalidateOnMount, revalidateIfStale, refreshInterval, refreshWhenHidden, refreshWhenOffline, keepPreviousData } = config;\n const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = index_js.SWRGlobalState.get(cache);\n // `key` is the identifier of the SWR internal state,\n // `fnArg` is the argument/arguments parsed from the key, which will be passed\n // to the fetcher.\n // All of them are derived from `_key`.\n const [key, fnArg] = index_js.serialize(_key);\n // If it's the initial render of this hook.\n const initialMountedRef = React.useRef(false);\n // If the hook is unmounted already. This will be used to prevent some effects\n // to be called after unmounting.\n const unmountedRef = React.useRef(false);\n // Refs to keep the key and config.\n const keyRef = React.useRef(key);\n const fetcherRef = React.useRef(fetcher);\n const configRef = React.useRef(config);\n const getConfig = ()=>configRef.current;\n const isActive = ()=>getConfig().isVisible() && getConfig().isOnline();\n const [getCache, setCache, subscribeCache, getInitialCache] = index_js.createCacheHelper(cache, key);\n const stateDependencies = React.useRef({}).current;\n // Resolve the fallback data from either the inline option, or the global provider.\n // If it's a promise, we simply let React suspend and resolve it for us.\n const fallback = index_js.isUndefined(fallbackData) ? index_js.isUndefined(config.fallback) ? index_js.UNDEFINED : config.fallback[key] : fallbackData;\n const isEqual = (prev, current)=>{\n for(const _ in stateDependencies){\n const t = _;\n if (t === 'data') {\n if (!compare(prev[t], current[t])) {\n if (!index_js.isUndefined(prev[t])) {\n return false;\n }\n if (!compare(returnedData, current[t])) {\n return false;\n }\n }\n } else {\n if (current[t] !== prev[t]) {\n return false;\n }\n }\n }\n return true;\n };\n const getSnapshot = React.useMemo(()=>{\n const shouldStartRequest = (()=>{\n if (!key) return false;\n if (!fetcher) return false;\n // If `revalidateOnMount` is set, we take the value directly.\n if (!index_js.isUndefined(revalidateOnMount)) return revalidateOnMount;\n // If it's paused, we skip revalidation.\n if (getConfig().isPaused()) return false;\n if (suspense) return false;\n return revalidateIfStale !== false;\n })();\n // Get the cache and merge it with expected states.\n const getSelectedCache = (state)=>{\n // We only select the needed fields from the state.\n const snapshot = index_js.mergeObjects(state);\n delete snapshot._k;\n if (!shouldStartRequest) {\n return snapshot;\n }\n return {\n isValidating: true,\n isLoading: true,\n ...snapshot\n };\n };\n const cachedData = getCache();\n const initialData = getInitialCache();\n const clientSnapshot = getSelectedCache(cachedData);\n const serverSnapshot = cachedData === initialData ? clientSnapshot : getSelectedCache(initialData);\n // To make sure that we are returning the same object reference to avoid\n // unnecessary re-renders, we keep the previous snapshot and use deep\n // comparison to check if we need to return a new one.\n let memorizedSnapshot = clientSnapshot;\n return [\n ()=>{\n const newSnapshot = getSelectedCache(getCache());\n const compareResult = isEqual(newSnapshot, memorizedSnapshot);\n if (compareResult) {\n // Mentally, we should always return the `memorizedSnapshot` here\n // as there's no change between the new and old snapshots.\n // However, since the `isEqual` function only compares selected fields,\n // the values of the unselected fields might be changed. That's\n // simply because we didn't track them.\n // To support the case in https://github.com/vercel/swr/pull/2576,\n // we need to update these fields in the `memorizedSnapshot` too\n // with direct mutations to ensure the snapshot is always up-to-date\n // even for the unselected fields, but only trigger re-renders when\n // the selected fields are changed.\n memorizedSnapshot.data = newSnapshot.data;\n memorizedSnapshot.isLoading = newSnapshot.isLoading;\n memorizedSnapshot.isValidating = newSnapshot.isValidating;\n memorizedSnapshot.error = newSnapshot.error;\n return memorizedSnapshot;\n } else {\n memorizedSnapshot = newSnapshot;\n return newSnapshot;\n }\n },\n ()=>serverSnapshot\n ];\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n cache,\n key\n ]);\n // Get the current state that SWR should return.\n const cached = index_js$1.useSyncExternalStore(React.useCallback((callback)=>subscribeCache(key, (current, prev)=>{\n if (!isEqual(prev, current)) callback();\n }), // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n cache,\n key\n ]), getSnapshot[0], getSnapshot[1]);\n const isInitialMount = !initialMountedRef.current;\n const hasRevalidator = EVENT_REVALIDATORS[key] && EVENT_REVALIDATORS[key].length > 0;\n const cachedData = cached.data;\n const data = index_js.isUndefined(cachedData) ? fallback && index_js.isPromiseLike(fallback) ? use(fallback) : fallback : cachedData;\n const error = cached.error;\n // Use a ref to store previously returned data. Use the initial data as its initial value.\n const laggyDataRef = React.useRef(data);\n const returnedData = keepPreviousData ? index_js.isUndefined(cachedData) ? index_js.isUndefined(laggyDataRef.current) ? data : laggyDataRef.current : cachedData : data;\n // - Suspense mode and there's stale data for the initial render.\n // - Not suspense mode and there is no fallback data and `revalidateIfStale` is enabled.\n // - `revalidateIfStale` is enabled but `data` is not defined.\n const shouldDoInitialRevalidation = (()=>{\n // if a key already has revalidators and also has error, we should not trigger revalidation\n if (hasRevalidator && !index_js.isUndefined(error)) return false;\n // If `revalidateOnMount` is set, we take the value directly.\n if (isInitialMount && !index_js.isUndefined(revalidateOnMount)) return revalidateOnMount;\n // If it's paused, we skip revalidation.\n if (getConfig().isPaused()) return false;\n // Under suspense mode, it will always fetch on render if there is no\n // stale data so no need to revalidate immediately mount it again.\n // If data exists, only revalidate if `revalidateIfStale` is true.\n if (suspense) return index_js.isUndefined(data) ? false : revalidateIfStale;\n // If there is no stale data, we need to revalidate when mount;\n // If `revalidateIfStale` is set to true, we will always revalidate.\n return index_js.isUndefined(data) || revalidateIfStale;\n })();\n // Resolve the default validating state:\n // If it's able to validate, and it should revalidate when mount, this will be true.\n const defaultValidatingState = !!(key && fetcher && isInitialMount && shouldDoInitialRevalidation);\n const isValidating = index_js.isUndefined(cached.isValidating) ? defaultValidatingState : cached.isValidating;\n const isLoading = index_js.isUndefined(cached.isLoading) ? defaultValidatingState : cached.isLoading;\n // The revalidation function is a carefully crafted wrapper of the original\n // `fetcher`, to correctly handle the many edge cases.\n const revalidate = React.useCallback(async (revalidateOpts)=>{\n const currentFetcher = fetcherRef.current;\n if (!key || !currentFetcher || unmountedRef.current || getConfig().isPaused()) {\n return false;\n }\n let newData;\n let startAt;\n let loading = true;\n const opts = revalidateOpts || {};\n // If there is no ongoing concurrent request, or `dedupe` is not set, a\n // new request should be initiated.\n const shouldStartNewRequest = !FETCH[key] || !opts.dedupe;\n /*\n For React 17\n Do unmount check for calls:\n If key has changed during the revalidation, or the component has been\n unmounted, old dispatch and old event callbacks should not take any\n effect\n\n For React 18\n only check if key has changed\n https://github.com/reactwg/react-18/discussions/82\n */ const callbackSafeguard = ()=>{\n if (index_js.IS_REACT_LEGACY) {\n return !unmountedRef.current && key === keyRef.current && initialMountedRef.current;\n }\n return key === keyRef.current;\n };\n // The final state object when the request finishes.\n const finalState = {\n isValidating: false,\n isLoading: false\n };\n const finishRequestAndUpdateState = ()=>{\n setCache(finalState);\n };\n const cleanupState = ()=>{\n // Check if it's still the same request before deleting it.\n const requestInfo = FETCH[key];\n if (requestInfo && requestInfo[1] === startAt) {\n delete FETCH[key];\n }\n };\n // Start fetching. Change the `isValidating` state, update the cache.\n const initialState = {\n isValidating: true\n };\n // It is in the `isLoading` state, if and only if there is no cached data.\n // This bypasses fallback data and laggy data.\n if (index_js.isUndefined(getCache().data)) {\n initialState.isLoading = true;\n }\n try {\n if (shouldStartNewRequest) {\n setCache(initialState);\n // If no cache is being rendered currently (it shows a blank page),\n // we trigger the loading slow event.\n if (config.loadingTimeout && index_js.isUndefined(getCache().data)) {\n setTimeout(()=>{\n if (loading && callbackSafeguard()) {\n getConfig().onLoadingSlow(key, config);\n }\n }, config.loadingTimeout);\n }\n // Start the request and save the timestamp.\n // Key must be truthy if entering here.\n FETCH[key] = [\n currentFetcher(fnArg),\n index_js.getTimestamp()\n ];\n }\n // Wait until the ongoing request is done. Deduplication is also\n // considered here.\n ;\n [newData, startAt] = FETCH[key];\n newData = await newData;\n if (shouldStartNewRequest) {\n // If the request isn't interrupted, clean it up after the\n // deduplication interval.\n setTimeout(cleanupState, config.dedupingInterval);\n }\n // If there're other ongoing request(s), started after the current one,\n // we need to ignore the current one to avoid possible race conditions:\n // req1------------------>res1 (current one)\n // req2---------------->res2\n // the request that fired later will always be kept.\n // The timestamp maybe be `undefined` or a number\n if (!FETCH[key] || FETCH[key][1] !== startAt) {\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onDiscarded(key);\n }\n }\n return false;\n }\n // Clear error.\n finalState.error = index_js.UNDEFINED;\n // If there're other mutations(s), that overlapped with the current revalidation:\n // case 1:\n // req------------------>res\n // mutate------>end\n // case 2:\n // req------------>res\n // mutate------>end\n // case 3:\n // req------------------>res\n // mutate-------...---------->\n // we have to ignore the revalidation result (res) because it's no longer fresh.\n // meanwhile, a new revalidation should be triggered when the mutation ends.\n const mutationInfo = MUTATION[key];\n if (!index_js.isUndefined(mutationInfo) && // case 1\n (startAt <= mutationInfo[0] || // case 2\n startAt <= mutationInfo[1] || // case 3\n mutationInfo[1] === 0)) {\n finishRequestAndUpdateState();\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onDiscarded(key);\n }\n }\n return false;\n }\n // Deep compare with the latest state to avoid extra re-renders.\n // For local state, compare and assign.\n const cacheData = getCache().data;\n // Since the compare fn could be custom fn\n // cacheData might be different from newData even when compare fn returns True\n finalState.data = compare(cacheData, newData) ? cacheData : newData;\n // Trigger the successful callback if it's the original request.\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onSuccess(newData, key, config);\n }\n }\n } catch (err) {\n cleanupState();\n const currentConfig = getConfig();\n const { shouldRetryOnError } = currentConfig;\n // Not paused, we continue handling the error. Otherwise, discard it.\n if (!currentConfig.isPaused()) {\n // Get a new error, don't use deep comparison for errors.\n finalState.error = err;\n // Error event and retry logic. Only for the actual request, not\n // deduped ones.\n if (shouldStartNewRequest && callbackSafeguard()) {\n currentConfig.onError(err, key, currentConfig);\n if (shouldRetryOnError === true || index_js.isFunction(shouldRetryOnError) && shouldRetryOnError(err)) {\n if (!getConfig().revalidateOnFocus || !getConfig().revalidateOnReconnect || isActive()) {\n // If it's inactive, stop. It will auto-revalidate when\n // refocusing or reconnecting.\n // When retrying, deduplication is always enabled.\n currentConfig.onErrorRetry(err, key, currentConfig, (_opts)=>{\n const revalidators = EVENT_REVALIDATORS[key];\n if (revalidators && revalidators[0]) {\n revalidators[0](index_js.revalidateEvents.ERROR_REVALIDATE_EVENT, _opts);\n }\n }, {\n retryCount: (opts.retryCount || 0) + 1,\n dedupe: true\n });\n }\n }\n }\n }\n }\n // Mark loading as stopped.\n loading = false;\n // Update the current hook's state.\n finishRequestAndUpdateState();\n return true;\n }, // `setState` is immutable, and `eventsCallback`, `fnArg`, and\n // `keyValidating` are depending on `key`, so we can exclude them from\n // the deps array.\n //\n // FIXME:\n // `fn` and `config` might be changed during the lifecycle,\n // but they might be changed every render like this.\n // `useSWR('key', () => fetch('/api/'), { suspense: true })`\n // So we omit the values from the deps array\n // even though it might cause unexpected behaviors.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n key,\n cache\n ]);\n // Similar to the global mutate but bound to the current cache and key.\n // `cache` isn't allowed to change during the lifecycle.\n const boundMutate = React.useCallback(// Use callback to make sure `keyRef.current` returns latest result every time\n (...args)=>{\n return index_js.internalMutate(cache, keyRef.current, ...args);\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n // The logic for updating refs.\n index_js.useIsomorphicLayoutEffect(()=>{\n fetcherRef.current = fetcher;\n configRef.current = config;\n // Handle laggy data updates. If there's cached data of the current key,\n // it'll be the correct reference.\n if (!index_js.isUndefined(cachedData)) {\n laggyDataRef.current = cachedData;\n }\n });\n // After mounted or key changed.\n index_js.useIsomorphicLayoutEffect(()=>{\n if (!key) return;\n const softRevalidate = revalidate.bind(index_js.UNDEFINED, WITH_DEDUPE);\n let nextFocusRevalidatedAt = 0;\n if (getConfig().revalidateOnFocus) {\n const initNow = Date.now();\n nextFocusRevalidatedAt = initNow + getConfig().focusThrottleInterval;\n }\n // Expose revalidators to global event listeners. So we can trigger\n // revalidation from the outside.\n const onRevalidate = (type, opts = {})=>{\n if (type == index_js.revalidateEvents.FOCUS_EVENT) {\n const now = Date.now();\n if (getConfig().revalidateOnFocus && now > nextFocusRevalidatedAt && isActive()) {\n nextFocusRevalidatedAt = now + getConfig().focusThrottleInterval;\n softRevalidate();\n }\n } else if (type == index_js.revalidateEvents.RECONNECT_EVENT) {\n if (getConfig().revalidateOnReconnect && isActive()) {\n softRevalidate();\n }\n } else if (type == index_js.revalidateEvents.MUTATE_EVENT) {\n return revalidate();\n } else if (type == index_js.revalidateEvents.ERROR_REVALIDATE_EVENT) {\n return revalidate(opts);\n }\n return;\n };\n const unsubEvents = index_js.subscribeCallback(key, EVENT_REVALIDATORS, onRevalidate);\n // Mark the component as mounted and update corresponding refs.\n unmountedRef.current = false;\n keyRef.current = key;\n initialMountedRef.current = true;\n // Keep the original key in the cache.\n setCache({\n _k: fnArg\n });\n // Trigger a revalidation\n if (shouldDoInitialRevalidation) {\n if (index_js.isUndefined(data) || index_js.IS_SERVER) {\n // Revalidate immediately.\n softRevalidate();\n } else {\n // Delay the revalidate if we have data to return so we won't block\n // rendering.\n index_js.rAF(softRevalidate);\n }\n }\n return ()=>{\n // Mark it as unmounted.\n unmountedRef.current = true;\n unsubEvents();\n };\n }, [\n key\n ]);\n // Polling\n index_js.useIsomorphicLayoutEffect(()=>{\n let timer;\n function next() {\n // Use the passed interval\n // ...or invoke the function with the updated data to get the interval\n const interval = index_js.isFunction(refreshInterval) ? refreshInterval(getCache().data) : refreshInterval;\n // We only start the next interval if `refreshInterval` is not 0, and:\n // - `force` is true, which is the start of polling\n // - or `timer` is not 0, which means the effect wasn't canceled\n if (interval && timer !== -1) {\n timer = setTimeout(execute, interval);\n }\n }\n function execute() {\n // Check if it's OK to execute:\n // Only revalidate when the page is visible, online, and not errored.\n if (!getCache().error && (refreshWhenHidden || getConfig().isVisible()) && (refreshWhenOffline || getConfig().isOnline())) {\n revalidate(WITH_DEDUPE).then(next);\n } else {\n // Schedule the next interval to check again.\n next();\n }\n }\n next();\n return ()=>{\n if (timer) {\n clearTimeout(timer);\n timer = -1;\n }\n };\n }, [\n refreshInterval,\n refreshWhenHidden,\n refreshWhenOffline,\n key\n ]);\n // Display debug info in React DevTools.\n React.useDebugValue(returnedData);\n // In Suspense mode, we can't return the empty `data` state.\n // If there is an `error`, the `error` needs to be thrown to the error boundary.\n // If there is no `error`, the `revalidation` promise needs to be thrown to\n // the suspense boundary.\n if (suspense && index_js.isUndefined(data) && key) {\n // SWR should throw when trying to use Suspense on the server with React 18,\n // without providing any fallback data. This causes hydration errors. See:\n // https://github.com/vercel/swr/issues/1832\n if (!index_js.IS_REACT_LEGACY && index_js.IS_SERVER) {\n throw new Error('Fallback data is required when using Suspense in SSR.');\n }\n // Always update fetcher and config refs even with the Suspense mode.\n fetcherRef.current = fetcher;\n configRef.current = config;\n unmountedRef.current = false;\n const req = PRELOAD[key];\n if (!index_js.isUndefined(req)) {\n const promise = boundMutate(req);\n use(promise);\n }\n if (index_js.isUndefined(error)) {\n const promise = revalidate(WITH_DEDUPE);\n if (!index_js.isUndefined(returnedData)) {\n promise.status = 'fulfilled';\n promise.value = true;\n }\n use(promise);\n } else {\n throw error;\n }\n }\n const swrResponse = {\n mutate: boundMutate,\n get data () {\n stateDependencies.data = true;\n return returnedData;\n },\n get error () {\n stateDependencies.error = true;\n return error;\n },\n get isValidating () {\n stateDependencies.isValidating = true;\n return isValidating;\n },\n get isLoading () {\n stateDependencies.isLoading = true;\n return isLoading;\n }\n };\n return swrResponse;\n};\nconst SWRConfig = index_js.OBJECT.defineProperty(index_js.SWRConfig, 'defaultValue', {\n value: index_js.defaultConfig\n});\n/**\n * A hook to fetch data.\n *\n * @link https://swr.vercel.app\n * @example\n * ```jsx\n * import useSWR from 'swr'\n * function Profile() {\n * const { data, error, isLoading } = useSWR('/api/user', fetcher)\n * if (error) return
failed to load
\n * if (isLoading) return
loading...
\n * return
hello {data.name}!
\n * }\n * ```\n */ const useSWR = index_js.withArgs(useSWRHandler);\n\n// useSWR\n\nObject.defineProperty(exports, \"mutate\", {\n enumerable: true,\n get: function () { return index_js.mutate; }\n});\nObject.defineProperty(exports, \"preload\", {\n enumerable: true,\n get: function () { return index_js.preload; }\n});\nObject.defineProperty(exports, \"useSWRConfig\", {\n enumerable: true,\n get: function () { return index_js.useSWRConfig; }\n});\nexports.SWRConfig = SWRConfig;\nexports.default = useSWR;\nexports.unstable_serialize = unstable_serialize;\n","Object.defineProperty(exports, '__esModule', { value: true });\n\nvar React = require('react');\nvar useSWR = require('../index/index.js');\nvar index_js = require('../_internal/index.js');\n\nfunction _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }\n\nvar React__default = /*#__PURE__*/_interopDefault(React);\nvar useSWR__default = /*#__PURE__*/_interopDefault(useSWR);\n\nconst startTransition = index_js.IS_REACT_LEGACY ? (cb)=>{\n cb();\n} : React__default.default.startTransition;\n/**\n * An implementation of state with dependency-tracking.\n * @param initialState - The initial state object.\n */ const useStateWithDeps = (initialState)=>{\n const [, rerender] = React.useState({});\n const unmountedRef = React.useRef(false);\n const stateRef = React.useRef(initialState);\n // If a state property (data, error, or isValidating) is accessed by the render\n // function, we mark the property as a dependency so if it is updated again\n // in the future, we trigger a rerender.\n // This is also known as dependency-tracking.\n const stateDependenciesRef = React.useRef({\n data: false,\n error: false,\n isValidating: false\n });\n /**\n * Updates state and triggers re-render if necessary.\n * @param payload To change stateRef, pass the values explicitly to setState:\n * @example\n * ```js\n * setState({\n * isValidating: false\n * data: newData // set data to newData\n * error: undefined // set error to undefined\n * })\n *\n * setState({\n * isValidating: false\n * data: undefined // set data to undefined\n * error: err // set error to err\n * })\n * ```\n */ const setState = React.useCallback((payload)=>{\n let shouldRerender = false;\n const currentState = stateRef.current;\n for(const key in payload){\n if (Object.prototype.hasOwnProperty.call(payload, key)) {\n const k = key;\n // If the property has changed, update the state and mark rerender as\n // needed.\n if (currentState[k] !== payload[k]) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n currentState[k] = payload[k];\n // If the property is accessed by the component, a rerender should be\n // triggered.\n if (stateDependenciesRef.current[k]) {\n shouldRerender = true;\n }\n }\n }\n }\n if (shouldRerender && !unmountedRef.current) {\n rerender({});\n }\n }, []);\n index_js.useIsomorphicLayoutEffect(()=>{\n unmountedRef.current = false;\n return ()=>{\n unmountedRef.current = true;\n };\n });\n return [\n stateRef,\n stateDependenciesRef.current,\n setState\n ];\n};\n\nconst mutation = ()=>(key, fetcher, config = {})=>{\n const { mutate } = useSWR.useSWRConfig();\n const keyRef = React.useRef(key);\n const fetcherRef = React.useRef(fetcher);\n const configRef = React.useRef(config);\n // Ditch all mutation results that happened earlier than this timestamp.\n const ditchMutationsUntilRef = React.useRef(0);\n const [stateRef, stateDependencies, setState] = useStateWithDeps({\n data: index_js.UNDEFINED,\n error: index_js.UNDEFINED,\n isMutating: false\n });\n const currentState = stateRef.current;\n const trigger = React.useCallback(async (arg, opts)=>{\n const [serializedKey, resolvedKey] = index_js.serialize(keyRef.current);\n if (!fetcherRef.current) {\n throw new Error('Can’t trigger the mutation: missing fetcher.');\n }\n if (!serializedKey) {\n throw new Error('Can’t trigger the mutation: missing key.');\n }\n // Disable cache population by default.\n const options = index_js.mergeObjects(index_js.mergeObjects({\n populateCache: false,\n throwOnError: true\n }, configRef.current), opts);\n // Trigger a mutation, and also track the timestamp. Any mutation that happened\n // earlier this timestamp should be ignored.\n const mutationStartedAt = index_js.getTimestamp();\n ditchMutationsUntilRef.current = mutationStartedAt;\n setState({\n isMutating: true\n });\n try {\n const data = await mutate(serializedKey, fetcherRef.current(resolvedKey, {\n arg\n }), // We must throw the error here so we can catch and update the states.\n index_js.mergeObjects(options, {\n throwOnError: true\n }));\n // If it's reset after the mutation, we don't broadcast any state change.\n if (ditchMutationsUntilRef.current <= mutationStartedAt) {\n startTransition(()=>setState({\n data,\n isMutating: false,\n error: undefined\n }));\n options.onSuccess == null ? void 0 : options.onSuccess.call(options, data, serializedKey, options);\n }\n return data;\n } catch (error) {\n // If it's reset after the mutation, we don't broadcast any state change\n // or throw because it's discarded.\n if (ditchMutationsUntilRef.current <= mutationStartedAt) {\n startTransition(()=>setState({\n error: error,\n isMutating: false\n }));\n options.onError == null ? undefined : options.onError.call(options, error, serializedKey, options);\n if (options.throwOnError) {\n throw error;\n }\n }\n }\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n const reset = React.useCallback(()=>{\n ditchMutationsUntilRef.current = index_js.getTimestamp();\n setState({\n data: index_js.UNDEFINED,\n error: index_js.UNDEFINED,\n isMutating: false\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n index_js.useIsomorphicLayoutEffect(()=>{\n keyRef.current = key;\n fetcherRef.current = fetcher;\n configRef.current = config;\n });\n // We don't return `mutate` here as it can be pretty confusing (e.g. people\n // calling `mutate` but they actually mean `trigger`).\n // And also, `mutate` relies on the useSWR hook to exist too.\n return {\n trigger,\n reset,\n get data () {\n stateDependencies.data = true;\n return currentState.data;\n },\n get error () {\n stateDependencies.error = true;\n return currentState.error;\n },\n get isMutating () {\n stateDependencies.isMutating = true;\n return currentState.isMutating;\n }\n };\n };\n/**\n * A hook to define and manually trigger remote mutations like POST, PUT, DELETE and PATCH use cases.\n *\n * @link https://swr.vercel.app/docs/mutation\n * @example\n * ```jsx\n * import useSWRMutation from 'swr/mutation'\n *\n * const {\n * data,\n * error,\n * trigger,\n * reset,\n * isMutating\n * } = useSWRMutation(key, fetcher, options?)\n * ```\n */ const useSWRMutation = index_js.withMiddleware(useSWR__default.default, mutation);\n\nexports.default = useSWRMutation;\n","/**\n * @license React\n * use-sync-external-store-shim.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(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;\nconst util_1 = require(\"./helpers/util\");\nexports.ZodIssueCode = util_1.util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nconst quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexports.quotelessJson = quotelessJson;\nclass ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nexports.ZodError = ZodError;\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0;\nconst en_1 = __importDefault(require(\"./locales/en\"));\nexports.defaultErrorMap = en_1.default;\nlet overrideErrorMap = en_1.default;\nfunction setErrorMap(map) {\n overrideErrorMap = map;\n}\nexports.setErrorMap = setErrorMap;\nfunction getErrorMap() {\n return overrideErrorMap;\n}\nexports.getErrorMap = getErrorMap;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./errors\"), exports);\n__exportStar(require(\"./helpers/parseUtil\"), exports);\n__exportStar(require(\"./helpers/typeAliases\"), exports);\n__exportStar(require(\"./helpers/util\"), exports);\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./ZodError\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.errorUtil = void 0;\nvar errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message === null || message === void 0 ? void 0 : message.message;\n})(errorUtil || (exports.errorUtil = errorUtil = {}));\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0;\nconst errors_1 = require(\"../errors\");\nconst en_1 = __importDefault(require(\"../locales/en\"));\nconst makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexports.makeIssue = makeIssue;\nexports.EMPTY_PATH = [];\nfunction addIssueToContext(ctx, issueData) {\n const overrideMap = (0, errors_1.getErrorMap)();\n const issue = (0, exports.makeIssue)({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === en_1.default ? undefined : en_1.default, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nexports.addIssueToContext = addIssueToContext;\nclass ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return exports.INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return exports.INVALID;\n if (value.status === \"aborted\")\n return exports.INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" &&\n (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexports.ParseStatus = ParseStatus;\nexports.INVALID = Object.freeze({\n status: \"aborted\",\n});\nconst DIRTY = (value) => ({ status: \"dirty\", value });\nexports.DIRTY = DIRTY;\nconst OK = (value) => ({ status: \"valid\", value });\nexports.OK = OK;\nconst isAborted = (x) => x.status === \"aborted\";\nexports.isAborted = isAborted;\nconst isDirty = (x) => x.status === \"dirty\";\nexports.isDirty = isDirty;\nconst isValid = (x) => x.status === \"valid\";\nexports.isValid = isValid;\nconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\nexports.isAsync = isAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getParsedType = exports.ZodParsedType = exports.objectUtil = exports.util = void 0;\nvar util;\n(function (util) {\n util.assertEqual = (val) => val;\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array\n .map((val) => (typeof val === \"string\" ? `'${val}'` : val))\n .join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (exports.util = util = {}));\nvar objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (exports.objectUtil = objectUtil = {}));\nexports.ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nconst getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return exports.ZodParsedType.undefined;\n case \"string\":\n return exports.ZodParsedType.string;\n case \"number\":\n return isNaN(data) ? exports.ZodParsedType.nan : exports.ZodParsedType.number;\n case \"boolean\":\n return exports.ZodParsedType.boolean;\n case \"function\":\n return exports.ZodParsedType.function;\n case \"bigint\":\n return exports.ZodParsedType.bigint;\n case \"symbol\":\n return exports.ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return exports.ZodParsedType.array;\n }\n if (data === null) {\n return exports.ZodParsedType.null;\n }\n if (data.then &&\n typeof data.then === \"function\" &&\n data.catch &&\n typeof data.catch === \"function\") {\n return exports.ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return exports.ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return exports.ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return exports.ZodParsedType.date;\n }\n return exports.ZodParsedType.object;\n default:\n return exports.ZodParsedType.unknown;\n }\n};\nexports.getParsedType = getParsedType;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.z = void 0;\nconst z = __importStar(require(\"./external\"));\nexports.z = z;\n__exportStar(require(\"./external\"), exports);\nexports.default = z;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../helpers/util\");\nconst ZodError_1 = require(\"../ZodError\");\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodError_1.ZodIssueCode.invalid_type:\n if (issue.received === util_1.ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodError_1.ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_1.util.jsonStringifyReplacer)}`;\n break;\n case ZodError_1.ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodError_1.ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodError_1.ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;\n break;\n case ZodError_1.ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodError_1.ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodError_1.ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodError_1.ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodError_1.ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util_1.util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodError_1.ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodError_1.ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `smaller than or equal to`\n : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodError_1.ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodError_1.ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodError_1.ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodError_1.ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util_1.util.assertNever(issue);\n }\n return { message };\n};\nexports.default = errorMap;\n","\"use strict\";\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _ZodEnum_cache, _ZodNativeEnum_cache;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.datetimeRegex = exports.ZodType = void 0;\nexports.NEVER = exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = exports.discriminatedUnion = exports.date = void 0;\nconst errors_1 = require(\"./errors\");\nconst errorUtil_1 = require(\"./helpers/errorUtil\");\nconst parseUtil_1 = require(\"./helpers/parseUtil\");\nconst util_1 = require(\"./helpers/util\");\nconst ZodError_1 = require(\"./ZodError\");\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (this._key instanceof Array) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if ((0, parseUtil_1.isValid)(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError_1.ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n var _a, _b;\n const { message } = params;\n if (iss.code === \"invalid_enum_value\") {\n return { message: message !== null && message !== void 0 ? message : ctx.defaultError };\n }\n if (typeof ctx.data === \"undefined\") {\n return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };\n }\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nclass ZodType {\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return (0, util_1.getParsedType)(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: (0, util_1.getParsedType)(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new parseUtil_1.ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: (0, util_1.getParsedType)(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if ((0, parseUtil_1.isAsync)(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n var _a;\n const ctx = {\n common: {\n issues: [],\n async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: (0, util_1.getParsedType)(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n \"~validate\"(data) {\n var _a, _b;\n const ctx = {\n common: {\n issues: [],\n async: !!this[\"~standard\"].async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: (0, util_1.getParsedType)(data),\n };\n if (!this[\"~standard\"].async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return (0, parseUtil_1.isValid)(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n }\n catch (err) {\n if ((_b = (_a = err === null || err === void 0 ? void 0 : err.message) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(\"encountered\")) {\n this[\"~standard\"].async = true;\n }\n ctx.common = {\n issues: [],\n async: true,\n };\n }\n }\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) => (0, parseUtil_1.isValid)(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n });\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n async: true,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: (0, util_1.getParsedType)(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult)\n ? maybeAsyncResult\n : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodError_1.ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\"\n ? refinementData(val, ctx)\n : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n this[\"~standard\"] = {\n version: 1,\n vendor: \"zod\",\n validate: (data) => this[\"~validate\"](data),\n };\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nexports.ZodType = ZodType;\nexports.Schema = ZodType;\nexports.ZodSchema = ZodType;\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[0-9a-z]+$/;\nconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i;\nconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\nconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\nconst durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nlet emojiRegex;\n// faster, simpler, safer\nconst ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nconst ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/;\n// const ipv6Regex =\n// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}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0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n// https://base64.guru/standards/base64url\nconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n// simple\n// const dateRegexSource = `\\\\d{4}-\\\\d{2}-\\\\d{2}`;\n// no leap year validation\n// const dateRegexSource = `\\\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\\\d|2\\\\d))`;\n// with leap year validation\nconst dateRegexSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateRegex = new RegExp(`^${dateRegexSource}$`);\nfunction timeRegexSource(args) {\n // let regex = `\\\\d{2}:\\\\d{2}:\\\\d{2}`;\n let regex = `([01]\\\\d|2[0-3]):[0-5]\\\\d:[0-5]\\\\d`;\n if (args.precision) {\n regex = `${regex}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n regex = `${regex}(\\\\.\\\\d+)?`;\n }\n return regex;\n}\nfunction timeRegex(args) {\n return new RegExp(`^${timeRegexSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nfunction datetimeRegex(args) {\n let regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nexports.datetimeRegex = datetimeRegex;\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nfunction isValidJWT(jwt, alg) {\n if (!jwtRegex.test(jwt))\n return false;\n try {\n const [header] = jwt.split(\".\");\n // Convert base64url to base64\n const base64 = header\n .replace(/-/g, \"+\")\n .replace(/_/g, \"/\")\n .padEnd(header.length + ((4 - (header.length % 4)) % 4), \"=\");\n const decoded = JSON.parse(atob(base64));\n if (typeof decoded !== \"object\" || decoded === null)\n return false;\n if (!decoded.typ || !decoded.alg)\n return false;\n if (alg && decoded.alg !== alg)\n return false;\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nfunction isValidCidr(ip, version) {\n if ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) {\n return true;\n }\n return false;\n}\nclass ZodString extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.string,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n const status = new parseUtil_1.ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"email\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"emoji\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"uuid\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"nanoid\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"cuid\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"cuid2\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"ulid\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch (_a) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"url\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"regex\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"date\") {\n const regex = dateRegex;\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"duration\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"ip\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"jwt\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"cidr\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"base64\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n validation: \"base64url\",\n code: ZodError_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util_1.util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _regex(regex, validation, message) {\n return this.refinement((data) => regex.test(data), {\n validation,\n code: ZodError_1.ZodIssueCode.invalid_string,\n ...errorUtil_1.errorUtil.errToObj(message),\n });\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil_1.errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil_1.errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil_1.errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil_1.errorUtil.errToObj(message) });\n }\n nanoid(message) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil_1.errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil_1.errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil_1.errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil_1.errorUtil.errToObj(message) });\n }\n base64(message) {\n return this._addCheck({ kind: \"base64\", ...errorUtil_1.errorUtil.errToObj(message) });\n }\n base64url(message) {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return this._addCheck({\n kind: \"base64url\",\n ...errorUtil_1.errorUtil.errToObj(message),\n });\n }\n jwt(options) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil_1.errorUtil.errToObj(options) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil_1.errorUtil.errToObj(options) });\n }\n cidr(options) {\n return this._addCheck({ kind: \"cidr\", ...errorUtil_1.errorUtil.errToObj(options) });\n }\n datetime(options) {\n var _a, _b;\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n local: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,\n local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,\n ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n date(message) {\n return this._addCheck({ kind: \"date\", message });\n }\n time(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n duration(message) {\n return this._addCheck({ kind: \"duration\", ...errorUtil_1.errorUtil.errToObj(message) });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil_1.errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options === null || options === void 0 ? void 0 : options.position,\n ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil_1.errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil_1.errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil_1.errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil_1.errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil_1.errorUtil.errToObj(message),\n });\n }\n /**\n * Equivalent to `.min(1)`\n */\n nonempty(message) {\n return this.min(1, errorUtil_1.errorUtil.errToObj(message));\n }\n trim() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n }\n toLowerCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n }\n toUpperCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isDate() {\n return !!this._def.checks.find((ch) => ch.kind === \"date\");\n }\n get isTime() {\n return !!this._def.checks.find((ch) => ch.kind === \"time\");\n }\n get isDuration() {\n return !!this._def.checks.find((ch) => ch.kind === \"duration\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isNANOID() {\n return !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get isCIDR() {\n return !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n }\n get isBase64() {\n return !!this._def.checks.find((ch) => ch.kind === \"base64\");\n }\n get isBase64url() {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nexports.ZodString = ZodString;\nZodString.create = (params) => {\n var _a;\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / Math.pow(10, decCount);\n}\nclass ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.number,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n let ctx = undefined;\n const status = new parseUtil_1.ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util_1.util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util_1.util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil_1.errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil_1.errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil_1.errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil_1.errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil_1.errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil_1.errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" ||\n (ch.kind === \"multipleOf\" && util_1.util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null, min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" ||\n ch.kind === \"int\" ||\n ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nexports.ZodNumber = ZodNumber;\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n }\n catch (_a) {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n let ctx = undefined;\n const status = new parseUtil_1.ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util_1.util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _getInvalidInput(input) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil_1.errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil_1.errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil_1.errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil_1.errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil_1.errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nexports.ZodBigInt = ZodBigInt;\nZodBigInt.create = (params) => {\n var _a;\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\nclass ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n return (0, parseUtil_1.OK)(input.data);\n }\n}\nexports.ZodBoolean = ZodBoolean;\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.date,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n if (isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_date,\n });\n return parseUtil_1.INVALID;\n }\n const status = new parseUtil_1.ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util_1.util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil_1.errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nexports.ZodDate = ZodDate;\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nclass ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n return (0, parseUtil_1.OK)(input.data);\n }\n}\nexports.ZodSymbol = ZodSymbol;\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nclass ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n return (0, parseUtil_1.OK)(input.data);\n }\n}\nexports.ZodUndefined = ZodUndefined;\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nclass ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.null,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n return (0, parseUtil_1.OK)(input.data);\n }\n}\nexports.ZodNull = ZodNull;\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nclass ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return (0, parseUtil_1.OK)(input.data);\n }\n}\nexports.ZodAny = ZodAny;\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nclass ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return (0, parseUtil_1.OK)(input.data);\n }\n}\nexports.ZodUnknown = ZodUnknown;\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nclass ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.never,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n}\nexports.ZodNever = ZodNever;\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nclass ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.void,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n return (0, parseUtil_1.OK)(input.data);\n }\n}\nexports.ZodVoid = ZodVoid;\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nclass ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== util_1.ZodParsedType.array) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.array,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return parseUtil_1.ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return parseUtil_1.ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil_1.errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil_1.errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil_1.errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nexports.ZodArray = ZodArray;\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nclass ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util_1.util.objectKeys(shape);\n return (this._cached = { shape, keys });\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.object,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever &&\n this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") {\n }\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return parseUtil_1.ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil_1.errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n var _a, _b, _c, _d;\n const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: (_d = errorUtil_1.errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // (def: Def) =>\n // (\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge(\n // merging: Incoming\n // ): //ZodObject = (merging) => {\n // ZodObject<\n // extendShape>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n util_1.util.objectKeys(mask).forEach((key) => {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n util_1.util.objectKeys(this.shape).forEach((key) => {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n util_1.util.objectKeys(this.shape).forEach((key) => {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n util_1.util.objectKeys(this.shape).forEach((key) => {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util_1.util.objectKeys(this.shape));\n }\n}\nexports.ZodObject = ZodObject;\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nclass ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError_1.ZodError(result.ctx.common.issues));\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_union,\n unionErrors,\n });\n return parseUtil_1.INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError_1.ZodError(issues));\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_union,\n unionErrors,\n });\n return parseUtil_1.INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nexports.ZodUnion = ZodUnion;\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return util_1.util.objectValues(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else if (type instanceof ZodOptional) {\n return [undefined, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodNullable) {\n return [null, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodBranded) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodReadonly) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodCatch) {\n return getDiscriminator(type._def.innerType);\n }\n else {\n return [];\n }\n};\nclass ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_1.ZodParsedType.object) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.object,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return parseUtil_1.INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues.length) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nexports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;\nfunction mergeValues(a, b) {\n const aType = (0, util_1.getParsedType)(a);\n const bType = (0, util_1.getParsedType)(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === util_1.ZodParsedType.object && bType === util_1.ZodParsedType.object) {\n const bKeys = util_1.util.objectKeys(b);\n const sharedKeys = util_1.util\n .objectKeys(a)\n .filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === util_1.ZodParsedType.array && bType === util_1.ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === util_1.ZodParsedType.date &&\n bType === util_1.ZodParsedType.date &&\n +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nclass ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) {\n return parseUtil_1.INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_intersection_types,\n });\n return parseUtil_1.INVALID;\n }\n if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nexports.ZodIntersection = ZodIntersection;\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\nclass ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_1.ZodParsedType.array) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.array,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return parseUtil_1.INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return parseUtil_1.ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return parseUtil_1.ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nexports.ZodTuple = ZodTuple;\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nclass ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_1.ZodParsedType.object) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.object,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (ctx.common.async) {\n return parseUtil_1.ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nexports.ZodRecord = ZodRecord;\nclass ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_1.ZodParsedType.map) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.map,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return parseUtil_1.INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return parseUtil_1.INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nexports.ZodMap = ZodMap;\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nclass ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_1.ZodParsedType.set) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.set,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return parseUtil_1.INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil_1.errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil_1.errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nexports.ZodSet = ZodSet;\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nclass ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_1.ZodParsedType.function) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.function,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n function makeArgsIssue(args, error) {\n return (0, parseUtil_1.makeIssue)({\n data: args,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n (0, errors_1.getErrorMap)(),\n errors_1.defaultErrorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodError_1.ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return (0, parseUtil_1.makeIssue)({\n data: returns,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n (0, errors_1.getErrorMap)(),\n errors_1.defaultErrorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodError_1.ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return (0, parseUtil_1.OK)(async function (...args) {\n const error = new ZodError_1.ZodError([]);\n const parsedArgs = await me._def.args\n .parseAsync(args, params)\n .catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return (0, parseUtil_1.OK)(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError_1.ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args\n ? args\n : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nexports.ZodFunction = ZodFunction;\nclass ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nexports.ZodLazy = ZodLazy;\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nclass ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n received: ctx.data,\n code: ZodError_1.ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return parseUtil_1.INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nexports.ZodLiteral = ZodLiteral;\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nclass ZodEnum extends ZodType {\n constructor() {\n super(...arguments);\n _ZodEnum_cache.set(this, void 0);\n }\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n (0, parseUtil_1.addIssueToContext)(ctx, {\n expected: util_1.util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodError_1.ZodIssueCode.invalid_type,\n });\n return parseUtil_1.INVALID;\n }\n if (!__classPrivateFieldGet(this, _ZodEnum_cache, \"f\")) {\n __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), \"f\");\n }\n if (!__classPrivateFieldGet(this, _ZodEnum_cache, \"f\").has(input.data)) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n (0, parseUtil_1.addIssueToContext)(ctx, {\n received: ctx.data,\n code: ZodError_1.ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return parseUtil_1.INVALID;\n }\n return (0, parseUtil_1.OK)(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values, newDef = this._def) {\n return ZodEnum.create(values, {\n ...this._def,\n ...newDef,\n });\n }\n exclude(values, newDef = this._def) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n ...this._def,\n ...newDef,\n });\n }\n}\nexports.ZodEnum = ZodEnum;\n_ZodEnum_cache = new WeakMap();\nZodEnum.create = createZodEnum;\nclass ZodNativeEnum extends ZodType {\n constructor() {\n super(...arguments);\n _ZodNativeEnum_cache.set(this, void 0);\n }\n _parse(input) {\n const nativeEnumValues = util_1.util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== util_1.ZodParsedType.string &&\n ctx.parsedType !== util_1.ZodParsedType.number) {\n const expectedValues = util_1.util.objectValues(nativeEnumValues);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n expected: util_1.util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodError_1.ZodIssueCode.invalid_type,\n });\n return parseUtil_1.INVALID;\n }\n if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, \"f\")) {\n __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util_1.util.getValidEnumValues(this._def.values)), \"f\");\n }\n if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, \"f\").has(input.data)) {\n const expectedValues = util_1.util.objectValues(nativeEnumValues);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n received: ctx.data,\n code: ZodError_1.ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return parseUtil_1.INVALID;\n }\n return (0, parseUtil_1.OK)(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nexports.ZodNativeEnum = ZodNativeEnum;\n_ZodNativeEnum_cache = new WeakMap();\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nclass ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_1.ZodParsedType.promise &&\n ctx.common.async === false) {\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n const promisified = ctx.parsedType === util_1.ZodParsedType.promise\n ? ctx.data\n : Promise.resolve(ctx.data);\n return (0, parseUtil_1.OK)(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nexports.ZodPromise = ZodPromise;\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nclass ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n (0, parseUtil_1.addIssueToContext)(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(processed).then(async (processed) => {\n if (status.value === \"aborted\")\n return parseUtil_1.INVALID;\n const result = await this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return parseUtil_1.INVALID;\n if (result.status === \"dirty\")\n return (0, parseUtil_1.DIRTY)(result.value);\n if (status.value === \"dirty\")\n return (0, parseUtil_1.DIRTY)(result.value);\n return result;\n });\n }\n else {\n if (status.value === \"aborted\")\n return parseUtil_1.INVALID;\n const result = this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return parseUtil_1.INVALID;\n if (result.status === \"dirty\")\n return (0, parseUtil_1.DIRTY)(result.value);\n if (status.value === \"dirty\")\n return (0, parseUtil_1.DIRTY)(result.value);\n return result;\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return parseUtil_1.INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((inner) => {\n if (inner.status === \"aborted\")\n return parseUtil_1.INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!(0, parseUtil_1.isValid)(base))\n return base;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((base) => {\n if (!(0, parseUtil_1.isValid)(base))\n return base;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));\n });\n }\n }\n util_1.util.assertNever(effect);\n }\n}\nexports.ZodEffects = ZodEffects;\nexports.ZodTransformer = ZodEffects;\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nclass ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === util_1.ZodParsedType.undefined) {\n return (0, parseUtil_1.OK)(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nexports.ZodOptional = ZodOptional;\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nclass ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === util_1.ZodParsedType.null) {\n return (0, parseUtil_1.OK)(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nexports.ZodNullable = ZodNullable;\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nclass ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === util_1.ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nexports.ZodDefault = ZodDefault;\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\"\n ? params.default\n : () => params.default,\n ...processCreateParams(params),\n });\n};\nclass ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if ((0, parseUtil_1.isAsync)(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError_1.ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError_1.ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nexports.ZodCatch = ZodCatch;\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nclass ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_1.ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_1.addIssueToContext)(ctx, {\n code: ZodError_1.ZodIssueCode.invalid_type,\n expected: util_1.ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return parseUtil_1.INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nexports.ZodNaN = ZodNaN;\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nexports.BRAND = Symbol(\"zod_brand\");\nclass ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nexports.ZodBranded = ZodBranded;\nclass ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return parseUtil_1.INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return (0, parseUtil_1.DIRTY)(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return parseUtil_1.INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nexports.ZodPipeline = ZodPipeline;\nclass ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n const freeze = (data) => {\n if ((0, parseUtil_1.isValid)(data)) {\n data.value = Object.freeze(data.value);\n }\n return data;\n };\n return (0, parseUtil_1.isAsync)(result)\n ? result.then((data) => freeze(data))\n : freeze(result);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nexports.ZodReadonly = ZodReadonly;\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\n////////////////////////////////////////\n////////////////////////////////////////\n////////// //////////\n////////// z.custom //////////\n////////// //////////\n////////////////////////////////////////\n////////////////////////////////////////\nfunction cleanParams(params, data) {\n const p = typeof params === \"function\"\n ? params(data)\n : typeof params === \"string\"\n ? { message: params }\n : params;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n return p2;\n}\nfunction custom(check, _params = {}, \n/**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n var _a, _b;\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n var _a, _b;\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}\nexports.custom = custom;\nexports.late = {\n object: ZodObject.lazycreate,\n};\nvar ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = ZodFirstPartyTypeKind = {}));\n// requires TS 4.4+\nclass Class {\n constructor(..._) { }\n}\nconst instanceOfType = (\n// const instanceOfType = any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nexports.instanceof = instanceOfType;\nconst stringType = ZodString.create;\nexports.string = stringType;\nconst numberType = ZodNumber.create;\nexports.number = numberType;\nconst nanType = ZodNaN.create;\nexports.nan = nanType;\nconst bigIntType = ZodBigInt.create;\nexports.bigint = bigIntType;\nconst booleanType = ZodBoolean.create;\nexports.boolean = booleanType;\nconst dateType = ZodDate.create;\nexports.date = dateType;\nconst symbolType = ZodSymbol.create;\nexports.symbol = symbolType;\nconst undefinedType = ZodUndefined.create;\nexports.undefined = undefinedType;\nconst nullType = ZodNull.create;\nexports.null = nullType;\nconst anyType = ZodAny.create;\nexports.any = anyType;\nconst unknownType = ZodUnknown.create;\nexports.unknown = unknownType;\nconst neverType = ZodNever.create;\nexports.never = neverType;\nconst voidType = ZodVoid.create;\nexports.void = voidType;\nconst arrayType = ZodArray.create;\nexports.array = arrayType;\nconst objectType = ZodObject.create;\nexports.object = objectType;\nconst strictObjectType = ZodObject.strictCreate;\nexports.strictObject = strictObjectType;\nconst unionType = ZodUnion.create;\nexports.union = unionType;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nexports.discriminatedUnion = discriminatedUnionType;\nconst intersectionType = ZodIntersection.create;\nexports.intersection = intersectionType;\nconst tupleType = ZodTuple.create;\nexports.tuple = tupleType;\nconst recordType = ZodRecord.create;\nexports.record = recordType;\nconst mapType = ZodMap.create;\nexports.map = mapType;\nconst setType = ZodSet.create;\nexports.set = setType;\nconst functionType = ZodFunction.create;\nexports.function = functionType;\nconst lazyType = ZodLazy.create;\nexports.lazy = lazyType;\nconst literalType = ZodLiteral.create;\nexports.literal = literalType;\nconst enumType = ZodEnum.create;\nexports.enum = enumType;\nconst nativeEnumType = ZodNativeEnum.create;\nexports.nativeEnum = nativeEnumType;\nconst promiseType = ZodPromise.create;\nexports.promise = promiseType;\nconst effectsType = ZodEffects.create;\nexports.effect = effectsType;\nexports.transformer = effectsType;\nconst optionalType = ZodOptional.create;\nexports.optional = optionalType;\nconst nullableType = ZodNullable.create;\nexports.nullable = nullableType;\nconst preprocessType = ZodEffects.createWithPreprocess;\nexports.preprocess = preprocessType;\nconst pipelineType = ZodPipeline.create;\nexports.pipeline = pipelineType;\nconst ostring = () => stringType().optional();\nexports.ostring = ostring;\nconst onumber = () => numberType().optional();\nexports.onumber = onumber;\nconst oboolean = () => booleanType().optional();\nexports.oboolean = oboolean;\nexports.coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nexports.NEVER = parseUtil_1.INVALID;\n","/*!\n * Axios Cache Interceptor 1.6.2\n * (c) 2021-present Arthur Fiorette & Contributors\n * Released under the MIT License.\n */\nvar cacheParser = require('cache-parser');\nvar fastDefer = require('fast-defer');\nvar objectCode = require('object-code');\n\nconst Header = Object.freeze({\n /**\n * ```txt\n * If-Modified-Since: , :: GMT\n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since\n */\n IfModifiedSince: 'if-modified-since',\n /**\n * ```txt\n * Last-Modified: , :: GMT\n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified\n */\n LastModified: 'last-modified',\n /**\n * ```txt\n * If-None-Match: \"\"\n * If-None-Match: \"\", \"\", …\n * If-None-Match: *\n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match\n */\n IfNoneMatch: 'if-none-match',\n /**\n * ```txt\n * Cache-Control: max-age=604800\n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control\n */\n CacheControl: 'cache-control',\n /**\n * ```txt\n * Pragma: no - cache;\n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Pragma\n */\n Pragma: 'pragma',\n /**\n * ```txt\n * ETag: W / '';\n * ETag: '';\n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag\n */\n ETag: 'etag',\n /**\n * ```txt\n * Expires: \n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires\n */\n Expires: 'expires',\n /**\n * ```txt\n * Age: \n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age\n */\n Age: 'age',\n /**\n * Used internally as metadata to mark the cache item as revalidatable and enabling\n * stale cache state Contains a string of ASCII characters that can be used as ETag for\n * `If-Match` header Provided by user using `cache.etag` value.\n *\n * ```txt\n * X-Axios-Cache-Etag: \"\"\n * ```\n */\n XAxiosCacheEtag: 'x-axios-cache-etag',\n /**\n * Used internally as metadata to mark the cache item as revalidatable and enabling\n * stale cache state may contain `'use-cache-timestamp'` if `cache.modifiedSince` is\n * `true`, otherwise will contain a date from `cache.modifiedSince`. If a date is\n * provided, it can be used for `If-Modified-Since` header, otherwise the cache\n * timestamp can be used for `If-Modified-Since` header.\n *\n * ```txt\n * X-Axios-Cache-Last-Modified: , :: GMT\n * X-Axios-Cache-Last-Modified: use-cache-timestamp\n * ```\n */\n XAxiosCacheLastModified: 'x-axios-cache-last-modified',\n /**\n * Used internally as metadata to mark the cache item able to be used if the server\n * returns an error. The stale-if-error response directive indicates that the cache can\n * reuse a stale response when any error occurs.\n *\n * ```txt\n * XAxiosCacheStaleIfError: \n * ```\n */\n XAxiosCacheStaleIfError: 'x-axios-cache-stale-if-error'\n});\n\nconst defaultHeaderInterpreter = headers => {\n if (!headers) return 'not enough headers';\n const cacheControl = headers[Header.CacheControl];\n if (cacheControl) {\n const {\n noCache,\n noStore,\n maxAge,\n maxStale,\n immutable,\n staleWhileRevalidate\n } = cacheParser.parse(String(cacheControl));\n // Header told that this response should not be cached.\n if (noCache || noStore) {\n return 'dont cache';\n }\n if (immutable) {\n // 1 year is sufficient, as Infinity may cause problems with certain storages.\n // It might not be the best way, but a year is better than none. Facebook shows\n // that a browser session stays at the most 1 month.\n return {\n cache: 1000 * 60 * 60 * 24 * 365\n };\n }\n if (maxAge !== undefined) {\n const age = headers[Header.Age];\n return {\n cache: age ?\n // If age is present, we must subtract it from maxAge\n (maxAge - Number(age)) * 1000 : maxAge * 1000,\n // Already out of date, must be requested again\n stale:\n // I couldn't find any documentation about who should be used, as they\n // are not meant to overlap each other. But, as we cannot request in the\n // background, as the stale-while-revalidate says, and we just increase\n // its staleTtl when its present, max-stale is being preferred over\n // stale-while-revalidate.\n maxStale !== undefined ? maxStale * 1000 : staleWhileRevalidate !== undefined ? staleWhileRevalidate * 1000 : undefined\n };\n }\n }\n const expires = headers[Header.Expires];\n if (expires) {\n const milliseconds = Date.parse(String(expires)) - Date.now();\n return milliseconds >= 0 ? {\n cache: milliseconds\n } : 'dont cache';\n }\n return 'not enough headers';\n};\n\n/**\n * Creates a new validateStatus function that will use the one already used and also\n * accept status code 304.\n */\nfunction createValidateStatus(oldValidate) {\n return oldValidate ? status => oldValidate(status) || status === 304 : status => status >= 200 && status < 300 || status === 304;\n}\n/** Checks if the given method is in the methods array */\nfunction isMethodIn(requestMethod = 'get', methodList = []) {\n requestMethod = requestMethod.toLowerCase();\n return methodList.some(method => method === requestMethod);\n}\n/**\n * This function updates the cache when the request is stale. So, the next request to the\n * server will be made with proper header / settings.\n */\nfunction updateStaleRequest(cache, config) {\n config.headers || (config.headers = {});\n const {\n etag,\n modifiedSince\n } = config.cache;\n if (etag) {\n var _cache$data;\n const etagValue = etag === true ? (_cache$data = cache.data) == null ? void 0 : _cache$data.headers[Header.ETag] : etag;\n if (etagValue) {\n config.headers[Header.IfNoneMatch] = etagValue;\n }\n }\n if (modifiedSince) {\n config.headers[Header.IfModifiedSince] = modifiedSince === true ?\n // If last-modified is not present, use the createdAt timestamp\n cache.data.headers[Header.LastModified] || new Date(cache.createdAt).toUTCString() : modifiedSince.toUTCString();\n }\n}\n/**\n * Creates the new date to the cache by the provided response. Also handles possible 304\n * Not Modified by updating response properties.\n */\nfunction createCacheResponse(response, previousCache) {\n if (response.status === 304 && previousCache) {\n // Set the cache information into the response object\n response.cached = true;\n response.data = previousCache.data;\n response.status = previousCache.status;\n response.statusText = previousCache.statusText;\n // Update possible new headers\n response.headers = {\n ...previousCache.headers,\n ...response.headers\n };\n // return the old cache\n return previousCache;\n }\n // New Response\n return {\n data: response.data,\n status: response.status,\n statusText: response.statusText,\n headers: response.headers\n };\n}\n\nfunction defaultRequestInterceptor(axios) {\n const onFulfilled = async config => {\n config.id = axios.generateKey(config);\n if (config.cache === false) {\n return config;\n }\n // merge defaults with per request configuration\n config.cache = {\n ...axios.defaults.cache,\n ...config.cache\n };\n if (typeof config.cache.cachePredicate === 'object' && config.cache.cachePredicate.ignoreUrls && config.url) {\n for (const url of config.cache.cachePredicate.ignoreUrls) {\n if (url instanceof RegExp ? (\n // Handles stateful regexes\n // biome-ignore lint: reduces the number of checks\n url.lastIndex = 0, url.test(config.url)) : config.url.includes(url)) {\n return config;\n }\n }\n }\n // Applies sufficient headers to prevent other cache systems to work along with this one\n //\n // Its currently used before isMethodIn because if the isMethodIn returns false, the request\n // shouldn't be cached an therefore neither in the browser.\n if (config.cache.cacheTakeover) {\n var _config$headers, _Header$CacheControl, _config$headers$_Head, _config$headers2, _Header$Pragma, _config$headers2$_Hea, _config$headers3, _Header$Expires, _config$headers3$_Hea;\n (_config$headers$_Head = (_config$headers = config.headers)[_Header$CacheControl = Header.CacheControl]) != null ? _config$headers$_Head : _config$headers[_Header$CacheControl] = 'no-cache';\n (_config$headers2$_Hea = (_config$headers2 = config.headers)[_Header$Pragma = Header.Pragma]) != null ? _config$headers2$_Hea : _config$headers2[_Header$Pragma] = 'no-cache';\n (_config$headers3$_Hea = (_config$headers3 = config.headers)[_Header$Expires = Header.Expires]) != null ? _config$headers3$_Hea : _config$headers3[_Header$Expires] = '0';\n }\n if (!isMethodIn(config.method, config.cache.methods)) {\n return config;\n }\n // Assumes that the storage handled staled responses\n let cache = await axios.storage.get(config.id, config);\n const overrideCache = config.cache.override;\n // Not cached, continue the request, and mark it as fetching\n // biome-ignore lint/suspicious/noConfusingLabels: required to break condition in simultaneous accesses\n ignoreAndRequest: if (cache.state === 'empty' || cache.state === 'stale' || cache.state === 'must-revalidate' || overrideCache) {\n // This checks for simultaneous access to a new key. The js event loop jumps on the\n // first await statement, so the second (asynchronous call) request may have already\n // started executing.\n if (axios.waiting.has(config.id) && !overrideCache) {\n cache = await axios.storage.get(config.id, config);\n // @ts-expect-error This check is required when a request has it own cache deleted manually, lets\n // say by a `axios.storage.delete(key)` and has a concurrent loading request.\n // Because in this case, the cache will be empty and may still has a pending key\n // on waiting map.\n if (cache.state !== 'empty' && cache.state !== 'must-revalidate') {\n break ignoreAndRequest;\n }\n }\n // Create a deferred to resolve other requests for the same key when it's completed\n const def = fastDefer.deferred();\n axios.waiting.set(config.id, def);\n // Adds a default reject handler to catch when the request gets aborted without\n // others waiting for it.\n def.catch(() => undefined);\n await axios.storage.set(config.id, {\n state: 'loading',\n previous: overrideCache ?\n // Simply determine if the request is stale or not\n // based if it had previous data or not\n cache.data ? 'stale' : 'empty' :\n // Typescript doesn't know that cache.state here can only be 'empty' or 'stale'\n cache.state,\n data: cache.data,\n // If the cache is empty and asked to override it, use the current timestamp\n createdAt: overrideCache && !cache.createdAt ? Date.now() : cache.createdAt\n }, config);\n if (cache.state === 'stale' || cache.state === 'must-revalidate') {\n updateStaleRequest(cache, config);\n }\n config.validateStatus = createValidateStatus(config.validateStatus);\n // Hydrates any UI temporarily, if cache is available\n if (cache.state === 'stale' || cache.data && cache.state !== 'must-revalidate') {\n await (config.cache.hydrate == null ? void 0 : config.cache.hydrate(cache));\n }\n return config;\n }\n let cachedResponse;\n if (cache.state === 'loading') {\n const deferred = axios.waiting.get(config.id);\n // The deferred may not exists when the process is using a persistent\n // storage and cancelled in the middle of a request, this would result in\n // a pending loading state in the storage but no current promises to resolve\n if (!deferred) {\n // Hydrates any UI temporarily, if cache is available\n if (cache.data) {\n await (config.cache.hydrate == null ? void 0 : config.cache.hydrate(cache));\n }\n return config;\n }\n try {\n // Deferred can't reuse the value because the user's storage might clone\n // or mutate the value, so we need to ask it again.\n // For example with memoryStorage + cloneData\n await deferred;\n const state = await axios.storage.get(config.id, config);\n // This is a cache mismatch and should never happen, but in case it does,\n // we need to redo the request all over again.\n /* c8 ignore start */\n if (!state.data) {\n if (false) ;\n return onFulfilled(config);\n }\n /* c8 ignore end */\n cachedResponse = state.data;\n } catch (err) {\n // Hydrates any UI temporarily, if cache is available\n /* c8 ignore start */\n if (cache.data) {\n await (config.cache.hydrate == null ? void 0 : config.cache.hydrate(cache));\n }\n /* c8 ignore end */\n // The deferred is rejected when the request that we are waiting rejects its cache.\n // In this case, we need to redo the request all over again.\n return onFulfilled(config);\n }\n } else {\n cachedResponse = cache.data;\n }\n // The cached data is already transformed after receiving the response from the server.\n // Reapplying the transformation on the transformed data will have an unintended effect.\n // Since the cached data is already in the desired format, there is no need to apply the transformation function again.\n config.transformResponse = undefined;\n // Even though the response interceptor receives this one from here,\n // it has been configured to ignore cached responses = true\n config.adapter = function cachedAdapter() {\n return Promise.resolve({\n config,\n data: cachedResponse.data,\n headers: cachedResponse.headers,\n status: cachedResponse.status,\n statusText: cachedResponse.statusText,\n cached: true,\n stale: cache.previous === 'stale',\n id: config.id\n });\n };\n return config;\n };\n return {\n onFulfilled,\n apply: () => axios.interceptors.request.use(onFulfilled)\n };\n}\n\n/** Tests an response against a {@link CachePredicateObject}. */\nasync function testCachePredicate(response, predicate) {\n if (typeof predicate === 'function') {\n return predicate(response);\n }\n const {\n statusCheck,\n responseMatch,\n containsHeaders\n } = predicate;\n if (statusCheck && !(await statusCheck(response.status)) || responseMatch && !(await responseMatch(response))) {\n return false;\n }\n if (containsHeaders) {\n for (const [header, predicate] of Object.entries(containsHeaders)) {\n var _response$headers$hea;\n if (!(await predicate( // Avoid bugs in case the header is not in lower case\n (_response$headers$hea = response.headers[header.toLowerCase()]) != null ? _response$headers$hea : response.headers[header]))) {\n return false;\n }\n }\n }\n return true;\n}\n\n/** Function to update all caches, from CacheProperties.update, with the new data. */\nasync function updateCache(storage, data, cacheUpdater) {\n // Global cache update function.\n if (typeof cacheUpdater === 'function') {\n return cacheUpdater(data);\n }\n for (const [cacheKey, updater] of Object.entries(cacheUpdater)) {\n if (updater === 'delete') {\n await storage.remove(cacheKey, data.config);\n continue;\n }\n const value = await storage.get(cacheKey, data.config);\n if (value.state === 'loading') {\n continue;\n }\n const newValue = await updater(value, data);\n if (newValue === 'delete') {\n await storage.remove(cacheKey, data.config);\n continue;\n }\n if (newValue !== 'ignore') {\n await storage.set(cacheKey, newValue, data.config);\n }\n }\n}\n\nfunction defaultResponseInterceptor(axios) {\n /**\n * Rejects cache for an response response.\n *\n * Also update the waiting list for this key by rejecting it.\n */\n const rejectResponse = async (responseId, config, clearCache) => {\n // Updates the cache to empty to prevent infinite loading state\n if (clearCache) {\n await axios.storage.remove(responseId, config);\n }\n // Rejects the deferred, if present\n const deferred = axios.waiting.get(responseId);\n if (deferred) {\n deferred.reject();\n axios.waiting.delete(responseId);\n }\n };\n const onFulfilled = async response => {\n var _response$cached;\n // When response.config is not present, the response is indeed a error.\n if (!(response != null && response.config)) {\n // Re-throws the error\n throw response;\n }\n response.id = response.config.id;\n (_response$cached = response.cached) != null ? _response$cached : response.cached = false;\n const config = response.config;\n // Request interceptor merges defaults with per request configuration\n const cacheConfig = config.cache;\n // Response is already cached\n if (response.cached) {\n return response;\n }\n // Skip cache: either false or weird behavior\n // config.cache should always exists, at least from global config merge.\n if (!cacheConfig) {\n response.cached = false;\n return response;\n }\n // Update other entries before updating himself\n if (cacheConfig.update) {\n await updateCache(axios.storage, response, cacheConfig.update);\n }\n if (!isMethodIn(config.method, cacheConfig.methods)) {\n return response;\n }\n const cache = await axios.storage.get(response.id, config);\n if (\n // If the request interceptor had a problem or it wasn't cached\n cache.state !== 'loading') {\n return response;\n }\n // Config told that this response should be cached.\n if (\n // For 'loading' values (previous: stale), this check already ran in the past.\n !cache.data && !(await testCachePredicate(response, cacheConfig.cachePredicate))) {\n await rejectResponse(response.id, config, true);\n return response;\n }\n // Avoid remnant headers from remote server to break implementation\n for (const header of Object.keys(response.headers)) {\n if (header.startsWith('x-axios-cache')) {\n delete response.headers[header];\n }\n }\n if (cacheConfig.etag && cacheConfig.etag !== true) {\n response.headers[Header.XAxiosCacheEtag] = cacheConfig.etag;\n }\n if (cacheConfig.modifiedSince) {\n response.headers[Header.XAxiosCacheLastModified] = cacheConfig.modifiedSince === true ? 'use-cache-timestamp' : cacheConfig.modifiedSince.toUTCString();\n }\n let ttl = cacheConfig.ttl || -1; // always set from global config\n let staleTtl;\n if (cacheConfig.interpretHeader) {\n const expirationTime = axios.headerInterpreter(response.headers);\n // Cache should not be used\n if (expirationTime === 'dont cache') {\n await rejectResponse(response.id, config, true);\n return response;\n }\n if (expirationTime !== 'not enough headers') {\n if (typeof expirationTime === 'number') {\n ttl = expirationTime;\n } else {\n ttl = expirationTime.cache;\n staleTtl = expirationTime.stale;\n }\n }\n }\n const data = createCacheResponse(response, cache.data);\n if (typeof ttl === 'function') {\n ttl = await ttl(response);\n }\n if (cacheConfig.staleIfError) {\n response.headers[Header.XAxiosCacheStaleIfError] = String(ttl);\n }\n const newCache = {\n state: 'cached',\n ttl,\n staleTtl,\n createdAt: Date.now(),\n data\n };\n // Define this key as cache on the storage\n await axios.storage.set(response.id, newCache, config);\n // Resolve all other requests waiting for this response\n const waiting = axios.waiting.get(response.id);\n if (waiting) {\n waiting.resolve();\n axios.waiting.delete(response.id);\n }\n // Return the response with cached as false, because it was not cached at all\n return response;\n };\n const onRejected = async error => {\n // When response.config is not present, the response is indeed a error.\n if (!error.isAxiosError || !error.config) {\n // We should probably re-request the response to avoid an infinite loading state here\n // but, since this is an unknown error, we cannot figure out what request ID to use.\n // And the only solution is to let the storage actively reject the current loading state.\n throw error;\n }\n const config = error.config;\n const id = config.id;\n const cacheConfig = config.cache;\n const response = error.response;\n // config.cache should always exist, at least from global config merge.\n if (!cacheConfig || !id) {\n throw error;\n }\n if (!isMethodIn(config.method, cacheConfig.methods)) {\n // Rejects all other requests waiting for this response\n await rejectResponse(id, config, true);\n throw error;\n }\n const cache = await axios.storage.get(id, config);\n if (\n // This will only not be loading if the interceptor broke\n cache.state !== 'loading' || cache.previous !== 'stale') {\n // Rejects all other requests waiting for this response\n await rejectResponse(id, config,\n // Do not clear cache if this request is cached, but the request was cancelled before returning the cached response\n error.code !== 'ERR_CANCELED' || error.code === 'ERR_CANCELED' && cache.state !== 'cached');\n throw error;\n }\n if (cacheConfig.staleIfError) {\n const cacheControl = String(response == null ? void 0 : response.headers[Header.CacheControl]);\n const staleHeader = cacheControl && cacheParser.parse(cacheControl).staleIfError;\n const staleIfError = typeof cacheConfig.staleIfError === 'function' ? await cacheConfig.staleIfError(response, cache, error) : cacheConfig.staleIfError === true && staleHeader ? staleHeader * 1000 //staleIfError is in seconds\n : cacheConfig.staleIfError;\n if (staleIfError === true ||\n // staleIfError is the number of seconds that stale is allowed to be used\n typeof staleIfError === 'number' && cache.createdAt + staleIfError > Date.now()) {\n // re-mark the cache as stale\n await axios.storage.set(id, {\n state: 'stale',\n createdAt: Date.now(),\n data: cache.data\n }, config);\n // Resolve all other requests waiting for this response\n const waiting = axios.waiting.get(id);\n if (waiting) {\n waiting.resolve();\n axios.waiting.delete(id);\n }\n return {\n cached: true,\n stale: true,\n config,\n id,\n data: cache.data.data,\n headers: cache.data.headers,\n status: cache.data.status,\n statusText: cache.data.statusText\n };\n }\n }\n // Rejects all other requests waiting for this response\n await rejectResponse(id, config, true);\n throw error;\n };\n return {\n onFulfilled,\n onRejected,\n apply: () => axios.interceptors.response.use(onFulfilled, onRejected)\n };\n}\n\n/** Returns true if the provided object was created from {@link buildStorage} function. */\nconst isStorage = obj => !!obj && !!obj['is-storage'];\nfunction hasUniqueIdentifierHeader(value) {\n const headers = value.data.headers;\n return Header.ETag in headers || Header.LastModified in headers || Header.XAxiosCacheEtag in headers || Header.XAxiosCacheLastModified in headers;\n}\n/** Returns true if value must be revalidated */\nfunction mustRevalidate(value) {\n // Must revalidate is a special case and should not serve stale values\n // We could use cache-control's parse function, but this is way faster and simpler\n return String(value.data.headers[Header.CacheControl]).includes('must-revalidate');\n}\n/** Returns true if this has sufficient properties to stale instead of expire. */\nfunction canStale(value) {\n if (hasUniqueIdentifierHeader(value)) {\n return true;\n }\n return value.state === 'cached' && value.staleTtl !== undefined &&\n // Only allow stale values after the ttl is already in the past and the staleTtl is in the future.\n // In cases that just createdAt + ttl > Date.now(), isn't enough because the staleTtl could be <= 0.\n // This logic only returns true when Date.now() is between the (createdAt + ttl) and (createdAt + ttl + staleTtl).\n // Following the example below:\n // |--createdAt--:--ttl--:---staleTtl--->\n // [ past ][now is in here]\n Math.abs(Date.now() - (value.createdAt + value.ttl)) <= value.staleTtl;\n}\n/**\n * Checks if the provided cache is expired. You should also check if the cache\n * {@link canStale} and {@link mayUseStale}\n */\nfunction isExpired(value) {\n return value.ttl !== undefined && value.createdAt + value.ttl <= Date.now();\n}\n/**\n * All integrated storages are wrappers around the `buildStorage` function. External\n * libraries use it and if you want to build your own, `buildStorage` is the way to go!\n *\n * The exported `buildStorage` function abstracts the storage interface and requires a\n * super simple object to build the storage.\n *\n * **Note**: You can only create an custom storage with this function.\n *\n * @example\n *\n * ```js\n * const myStorage = buildStorage({\n * find: () => {...},\n * set: () => {...},\n * remove: () => {...},\n * clear: () => {...}\n * });\n *\n * const axios = setupCache(axios, { storage: myStorage });\n * ```\n *\n * @see https://axios-cache-interceptor.js.org/guide/storages#buildstorage\n */\nfunction buildStorage({\n set,\n find,\n remove,\n clear\n}) {\n return {\n //@ts-expect-error - we don't want to expose this\n 'is-storage': 1,\n set,\n remove,\n clear,\n get: async (key, config) => {\n let value = await find(key, config);\n if (!value) {\n return {\n state: 'empty'\n };\n }\n if (value.state === 'empty' || value.state === 'loading' || value.state === 'must-revalidate') {\n return value;\n }\n // Handle cached values\n if (value.state === 'cached') {\n if (!isExpired(value)) {\n return value;\n }\n // Tries to stale expired value\n if (!canStale(value)) {\n await remove(key, config);\n return {\n state: 'empty'\n };\n }\n value = {\n state: 'stale',\n createdAt: value.createdAt,\n data: value.data,\n ttl: value.staleTtl !== undefined ? value.staleTtl + value.ttl : undefined\n };\n await set(key, value, config);\n // Must revalidate is a special case and should not serve stale values\n if (mustRevalidate(value)) {\n return {\n ...value,\n state: 'must-revalidate'\n };\n }\n }\n // A second check in case the new stale value was created already expired.\n if (!isExpired(value)) {\n return value;\n }\n if (hasUniqueIdentifierHeader(value)) {\n return value;\n }\n await remove(key, config);\n return {\n state: 'empty'\n };\n }\n };\n}\n\n/* c8 ignore start */\n/**\n * Clones an object using the structured clone algorithm if available, otherwise\n * it uses JSON.parse(JSON.stringify(value)).\n */\nconst clone =\n// https://caniuse.com/mdn-api_structuredclone (10/18/2023 92.51%)\ntypeof structuredClone === 'function' ? structuredClone : value => JSON.parse(JSON.stringify(value));\n/* c8 ignore stop */\n/**\n * Creates a simple in-memory storage. This means that if you need to persist data between\n * page or server reloads, this will not help.\n *\n * This is the storage used by default.\n *\n * If you need to modify it's data, you can do by the `data` property.\n *\n * @example\n *\n * ```js\n * const memoryStorage = buildMemoryStorage();\n *\n * setupCache(axios, { storage: memoryStorage });\n *\n * // Simple example to force delete the request cache\n *\n * const { id } = axios.get('url');\n *\n * delete memoryStorage.data[id];\n * ```\n *\n * @param {boolean | 'double'} cloneData Use `true` if the data returned by `find()`\n * should be cloned to avoid mutating the original data outside the `set()` method. Use\n * `'double'` to also clone before saving value in storage using `set()`. Disabled is\n * default\n * @param {number | false} cleanupInterval The interval in milliseconds to run a\n * setInterval job of cleaning old entries. If false, the job will not be created.\n * Disabled is default\n * @param {number | false} maxEntries The maximum number of entries to keep in the\n * storage. Its hard to determine the size of the entries, so a smart FIFO order is used\n * to determine eviction. If false, no check will be done and you may grow up memory\n * usage. Disabled is default\n */\nfunction buildMemoryStorage(cloneData = false, cleanupInterval = false, maxEntries = false) {\n const storage = buildStorage({\n set: (key, value) => {\n if (maxEntries) {\n let keys = Object.keys(storage.data);\n // Tries to cleanup first\n if (keys.length >= maxEntries) {\n storage.cleanup();\n // Recalculates the keys\n keys = Object.keys(storage.data);\n // Keeps deleting until there's space\n while (keys.length >= maxEntries) {\n // There's always at least one key here, otherwise it would not be\n // in the loop.\n delete storage.data[keys.shift()];\n }\n }\n }\n // Clone the value before storing to prevent future mutations\n // from affecting cached data.\n storage.data[key] = cloneData === 'double' ? clone(value) : value;\n },\n remove: key => {\n delete storage.data[key];\n },\n find: key => {\n const value = storage.data[key];\n return cloneData && value !== undefined ? clone(value) : value;\n },\n clear: () => {\n storage.data = Object.create(null);\n }\n });\n storage.data = Object.create(null);\n // When this program gets running for more than the specified interval, there's a good\n // chance of it being a long-running process or at least have a lot of entries. Therefore,\n // \"faster\" loop is more important than code readability.\n storage.cleanup = () => {\n const keys = Object.keys(storage.data);\n let i = -1;\n let value;\n let key;\n // Looping forward, as older entries are more likely to be expired\n // than newer ones.\n while (++i < keys.length) {\n key = keys[i];\n value = storage.data[key];\n if (value.state === 'empty') {\n storage.remove(key);\n continue;\n }\n // If the value is expired and can't be stale, remove it\n if (value.state === 'cached' && isExpired(value) && !canStale(value)) {\n // this storage returns void.\n storage.remove(key);\n }\n }\n };\n if (cleanupInterval) {\n storage.cleaner = setInterval(storage.cleanup, cleanupInterval);\n }\n return storage;\n}\n\n// Remove first and last '/' char, if present\nconst SLASHES_REGEX = /^\\/|\\/$/g;\n/**\n * Builds an generator that receives a {@link CacheRequestConfig} and returns a value\n * hashed by {@link hash}.\n *\n * The value is hashed into a signed integer when the returned value from the provided\n * generator is not a `string` or a `number`.\n *\n * You can return any type of data structure.\n *\n * @example\n *\n * ```js\n * // This generator will return a hash code.\n * // The code will only be the same if url, method and data are the same.\n * const generator = buildKeyGenerator(({ url, method, data }) => ({\n * url,\n * method,\n * data\n * }));\n * ```\n */\nfunction buildKeyGenerator(generator) {\n return request => {\n if (request.id) {\n return request.id;\n }\n const key = generator(request);\n if (typeof key === 'string' || typeof key === 'number') {\n return `${key}`;\n }\n return `${objectCode.hash(key)}`;\n };\n}\nconst defaultKeyGenerator = buildKeyGenerator(({\n baseURL,\n url,\n method,\n params,\n data\n}) => {\n // Remove trailing slashes to avoid generating different keys for the \"same\" final url.\n if (baseURL !== undefined) {\n baseURL = baseURL.replace(SLASHES_REGEX, '');\n } else {\n // just to have a consistent hash\n baseURL = '';\n }\n if (url !== undefined) {\n url = url.replace(SLASHES_REGEX, '');\n } else {\n // just to have a consistent hash\n url = '';\n }\n if (method !== undefined) {\n method = method.toLowerCase();\n } else {\n // just to have a consistent hash\n method = 'get';\n }\n return {\n url: baseURL + (baseURL && url ? '/' : '') + url,\n params: params,\n method: method,\n data: data\n };\n});\n\n/**\n * Apply the caching interceptors for a already created axios instance.\n *\n * ```ts\n * const axios = setupCache(axios, OPTIONS);\n * ```\n *\n * The `setupCache` function receives global options and all [request\n * specifics](https://axios-cache-interceptor.js.org/config/request-specifics) ones too.\n * This way, you can customize the defaults for all requests.\n *\n * @param axios The already created axios instance\n * @param config The config for the caching interceptors\n * @returns The same instance with extended typescript types.\n * @see https://axios-cache-interceptor.js.org/config\n */\nfunction setupCache(axios, options = {}) {\n var _options$ttl, _options$etag, _options$modifiedSinc, _options$interpretHea, _options$cacheTakeove, _options$staleIfError, _options$override, _options$hydrate;\n const axiosCache = axios;\n if (axiosCache.defaults.cache) {\n throw new Error('setupCache() should be called only once');\n }\n axiosCache.storage = options.storage || buildMemoryStorage();\n if (!isStorage(axiosCache.storage)) {\n throw new Error('Use buildStorage() function');\n }\n axiosCache.waiting = options.waiting || new Map();\n axiosCache.generateKey = options.generateKey || defaultKeyGenerator;\n axiosCache.headerInterpreter = options.headerInterpreter || defaultHeaderInterpreter;\n axiosCache.requestInterceptor = options.requestInterceptor || defaultRequestInterceptor(axiosCache);\n axiosCache.responseInterceptor = options.responseInterceptor || defaultResponseInterceptor(axiosCache);\n axiosCache.debug = options.debug || function noop() {};\n // CacheRequestConfig values\n axiosCache.defaults.cache = {\n update: options.update || {},\n ttl: (_options$ttl = options.ttl) != null ? _options$ttl : 1000 * 60 * 5,\n // Although RFC 7231 also marks POST as cacheable, most users don't know that\n // and may have problems about why their \"create X\" route not working.\n methods: options.methods || ['get', 'head'],\n cachePredicate: options.cachePredicate || {\n // All cacheable status codes defined in RFC 7231\n statusCheck: status => [200, 203, 300, 301, 302, 404, 405, 410, 414, 501].includes(status)\n },\n etag: (_options$etag = options.etag) != null ? _options$etag : true,\n // This option is going to be ignored by servers when ETag is enabled\n // Checks strict equality to false to avoid undefined-ish values\n modifiedSince: (_options$modifiedSinc = options.modifiedSince) != null ? _options$modifiedSinc : options.etag === false,\n interpretHeader: (_options$interpretHea = options.interpretHeader) != null ? _options$interpretHea : true,\n cacheTakeover: (_options$cacheTakeove = options.cacheTakeover) != null ? _options$cacheTakeove : true,\n staleIfError: (_options$staleIfError = options.staleIfError) != null ? _options$staleIfError : true,\n override: (_options$override = options.override) != null ? _options$override : false,\n hydrate: (_options$hydrate = options.hydrate) != null ? _options$hydrate : undefined\n };\n // Apply interceptors\n axiosCache.requestInterceptor.apply();\n axiosCache.responseInterceptor.apply();\n return axiosCache;\n}\n\n/**\n * Creates a simple storage. You can persist his data by using `sessionStorage` or\n * `localStorage` with it.\n *\n * **ImplNote**: Without polyfill, this storage only works on browser environments.\n *\n * @example\n *\n * ```js\n * const fromLocalStorage = buildWebStorage(localStorage);\n * const fromSessionStorage = buildWebStorage(sessionStorage);\n *\n * const myStorage = new Storage();\n * const fromMyStorage = buildWebStorage(myStorage);\n * ```\n *\n * @param storage The type of web storage to use. localStorage or sessionStorage.\n * @param prefix The prefix to index the storage. Useful to prevent collision between\n * multiple places using the same storage.\n */\nfunction buildWebStorage(storage, prefix = 'axios-cache-') {\n return buildStorage({\n clear: () => {\n for (const key in storage) {\n if (key.startsWith(prefix)) {\n storage.removeItem(key);\n }\n }\n },\n find: key => {\n const json = storage.getItem(prefix + key);\n return json ? JSON.parse(json) : undefined;\n },\n remove: key => {\n storage.removeItem(prefix + key);\n },\n set: (key, value) => {\n const save = () => storage.setItem(prefix + key, JSON.stringify(value));\n try {\n return save();\n } catch (error) {\n const allValues = Object.entries(storage).filter(item => item[0].startsWith(prefix)).map(item => [item[0], JSON.parse(item[1])]);\n // Remove all expired values\n for (const value of allValues) {\n if (value[1].state === 'cached' && isExpired(value[1]) && !canStale(value[1])) {\n storage.removeItem(value[0]);\n }\n }\n // Try save again after removing expired values\n try {\n return save();\n } catch {\n // Storage still full, try removing the oldest value until it can be saved\n // Descending sort by createdAt\n const sortedItems = allValues.sort((a, b) => (a[1].createdAt || 0) - (b[1].createdAt || 0));\n for (const item of sortedItems) {\n storage.removeItem(item[0]);\n try {\n return save();\n } catch {\n // This key didn't free all the required space\n }\n }\n }\n // Clear the cache for the specified key\n storage.removeItem(prefix + key);\n }\n }\n });\n}\n\nexports.Header = Header;\nexports.buildKeyGenerator = buildKeyGenerator;\nexports.buildMemoryStorage = buildMemoryStorage;\nexports.buildStorage = buildStorage;\nexports.buildWebStorage = buildWebStorage;\nexports.canStale = canStale;\nexports.createCacheResponse = createCacheResponse;\nexports.createValidateStatus = createValidateStatus;\nexports.defaultHeaderInterpreter = defaultHeaderInterpreter;\nexports.defaultKeyGenerator = defaultKeyGenerator;\nexports.defaultRequestInterceptor = defaultRequestInterceptor;\nexports.defaultResponseInterceptor = defaultResponseInterceptor;\nexports.isExpired = isExpired;\nexports.isMethodIn = isMethodIn;\nexports.isStorage = isStorage;\nexports.mustRevalidate = mustRevalidate;\nexports.setupCache = setupCache;\nexports.testCachePredicate = testCachePredicate;\nexports.updateCache = updateCache;\nexports.updateStaleRequest = updateStaleRequest;\n//# sourceMappingURL=index.cjs.map","/*! Axios v1.8.3 Copyright (c) 2025 Matt Zabriskie and contributors */\n'use strict';\n\nfunction bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n};\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n};\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n};\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n };\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n};\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n};\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n};\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n};\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n};\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n};\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n};\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n};\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n};\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n};\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n };\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n};\n\nconst noop = () => {};\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n};\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n };\n\n return visit(obj, 0);\n};\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\nvar utils$1 = {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap\n};\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils$1.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils$1.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype$1 = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype$1, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype$1);\n\n utils$1.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\n// eslint-disable-next-line strict\nvar httpAdapter = null;\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils$1.isPlainObject(thing) || utils$1.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils$1.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils$1.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils$1.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils$1.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);\n\n if (!utils$1.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils$1.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils$1.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils$1.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils$1.isArray(value) && isFlatArray(value)) ||\n ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils$1.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils$1.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils$1.forEach(value, function each(el, key) {\n const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils$1.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode$1(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode$1);\n } : encode$1;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nfunction buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils$1.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils$1.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils$1.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nvar InterceptorManager$1 = InterceptorManager;\n\nvar transitionalDefaults = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n\nvar URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n\nvar FormData$1 = typeof FormData !== 'undefined' ? FormData : null;\n\nvar Blob$1 = typeof Blob !== 'undefined' ? Blob : null;\n\nvar platform$1 = {\n isBrowser: true,\n classes: {\n URLSearchParams: URLSearchParams$1,\n FormData: FormData$1,\n Blob: Blob$1\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n\nconst hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nvar utils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n hasBrowserEnv: hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv: hasStandardBrowserEnv,\n navigator: _navigator,\n origin: origin\n});\n\nvar platform = {\n ...utils,\n ...platform$1\n};\n\nfunction toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils$1.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils$1.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils$1.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils$1.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils$1.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils$1.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {\n const obj = {};\n\n utils$1.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils$1.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils$1.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils$1.isObject(data);\n\n if (isObjectPayload && utils$1.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils$1.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils$1.isArrayBuffer(data) ||\n utils$1.isBuffer(data) ||\n utils$1.isStream(data) ||\n utils$1.isFile(data) ||\n utils$1.isBlob(data) ||\n utils$1.isReadableStream(data)\n ) {\n return data;\n }\n if (utils$1.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils$1.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nvar defaults$1 = defaults;\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils$1.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nvar parseHeaders = rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils$1.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils$1.isString(value)) return;\n\n if (utils$1.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils$1.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils$1.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils$1.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils$1.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite);\n } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils$1.isHeaders(header)) {\n for (const [key, value] of header.entries()) {\n setHeader(value, key, rewrite);\n }\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils$1.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils$1.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils$1.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils$1.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils$1.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils$1.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils$1.forEach(this, (value, header) => {\n const key = utils$1.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils$1.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils$1.freezeMethods(AxiosHeaders);\n\nvar AxiosHeaders$1 = AxiosHeaders;\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nfunction transformData(fns, response) {\n const config = this || defaults$1;\n const context = response || config;\n const headers = AxiosHeaders$1.from(context.headers);\n let data = context.data;\n\n utils$1.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n\nfunction isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils$1.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nfunction settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n\nfunction parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\n/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn.apply(null, args);\n };\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs);\n }, threshold - passed);\n }\n }\n };\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nconst progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n};\n\nconst progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n};\n\nconst asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));\n\nvar isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n\nvar cookies = platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils$1.isString(path) && cookie.push('path=' + path);\n\n utils$1.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nfunction isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nfunction combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nfunction buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nfunction mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {\n return utils$1.merge.call({caseless}, target, source);\n } else if (utils$1.isPlainObject(source)) {\n return utils$1.merge({}, source);\n } else if (utils$1.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop , caseless) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(a, b, prop , caseless);\n } else if (!utils$1.isUndefined(a)) {\n return getMergedValue(undefined, a, prop , caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils$1.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)\n };\n\n utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n\nvar resolveConfig = (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders$1.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils$1.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n};\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nvar xhrAdapter = isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders$1.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils$1.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n};\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n };\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));\n }, timeout);\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n };\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils$1.asap(unsubscribe);\n\n return signal;\n }\n};\n\nvar composeSignals$1 = composeSignals;\n\nconst streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n};\n\nconst readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n};\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n};\n\nconst trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n };\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n};\n\nconst isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';\nconst isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';\n\n// used only inside the fetch adapter\nconst encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Response(str).arrayBuffer())\n);\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n};\n\nconst supportsRequestStream = isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n});\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst supportsResponseStream = isReadableStreamSupported &&\n test(() => utils$1.isReadableStream(new Response('').body));\n\n\nconst resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n};\n\nisFetchSupported && (((res) => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :\n (_, config) => {\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n });\n });\n})(new Response));\n\nconst getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if(utils$1.isBlob(body)) {\n return body.size;\n }\n\n if(utils$1.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if(utils$1.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if(utils$1.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n};\n\nconst resolveBodyLength = async (headers, body) => {\n const length = utils$1.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n};\n\nvar fetchAdapter = isFetchSupported && (async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader);\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils$1.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = \"credentials\" in Request.prototype;\n request = new Request(url, {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n });\n\n let response = await fetch(request);\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders$1.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n });\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n});\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: fetchAdapter\n};\n\nutils$1.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;\n\nvar adapters = {\n getAdapter: (adapters) => {\n adapters = utils$1.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n};\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nfunction dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders$1.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders$1.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders$1.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n\nconst VERSION = \"1.8.3\";\n\nconst validators$1 = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators$1[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators$1.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators$1.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nvar validator = {\n assertOptions,\n validators: validators$1\n};\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager$1(),\n response: new InterceptorManager$1()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack;\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils$1.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n };\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils$1.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils$1.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders$1.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nvar Axios$1 = Axios;\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nvar CancelToken$1 = CancelToken;\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nfunction spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nfunction isAxiosError(payload) {\n return utils$1.isObject(payload) && (payload.isAxiosError === true);\n}\n\nconst HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nvar HttpStatusCode$1 = HttpStatusCode;\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios$1(defaultConfig);\n const instance = bind(Axios$1.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils$1.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults$1);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios$1;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken$1;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders$1;\n\naxios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode$1;\n\naxios.default = axios;\n\nmodule.exports = axios;\n//# sourceMappingURL=axios.cjs.map\n","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(e) {\n return e && e.__esModule ? e : {\n \"default\": e\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(e) {\n return e && e.__esModule ? e : {\n \"default\": e\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(e) {\n return e && e.__esModule ? e : {\n \"default\": e\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(e) {\n return e && e.__esModule ? e : {\n \"default\": e\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(e) {\n return e && e.__esModule ? e : {\n \"default\": e\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.jwtDecode = exports.InvalidTokenError = void 0;\nclass InvalidTokenError extends Error {\n}\nexports.InvalidTokenError = InvalidTokenError;\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n let code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n }));\n}\nfunction base64UrlDecode(str) {\n let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw new Error(\"base64 string is not of the correct length\");\n }\n try {\n return b64DecodeUnicode(output);\n }\n catch (err) {\n return atob(output);\n }\n}\nfunction jwtDecode(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n }\n options || (options = {});\n const pos = options.header === true ? 0 : 1;\n const part = token.split(\".\")[pos];\n if (typeof part !== \"string\") {\n throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n }\n let decoded;\n try {\n decoded = base64UrlDecode(part);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n }\n try {\n return JSON.parse(decoded);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}\nexports.jwtDecode = jwtDecode;\n","'use strict'\n\nconst errSerializer = require('./lib/err')\nconst errWithCauseSerializer = require('./lib/err-with-cause')\nconst reqSerializers = require('./lib/req')\nconst resSerializers = require('./lib/res')\n\nmodule.exports = {\n err: errSerializer,\n errWithCause: errWithCauseSerializer,\n mapHttpRequest: reqSerializers.mapHttpRequest,\n mapHttpResponse: resSerializers.mapHttpResponse,\n req: reqSerializers.reqSerializer,\n res: resSerializers.resSerializer,\n\n wrapErrorSerializer: function wrapErrorSerializer (customSerializer) {\n if (customSerializer === errSerializer) return customSerializer\n return function wrapErrSerializer (err) {\n return customSerializer(errSerializer(err))\n }\n },\n\n wrapRequestSerializer: function wrapRequestSerializer (customSerializer) {\n if (customSerializer === reqSerializers.reqSerializer) return customSerializer\n return function wrappedReqSerializer (req) {\n return customSerializer(reqSerializers.reqSerializer(req))\n }\n },\n\n wrapResponseSerializer: function wrapResponseSerializer (customSerializer) {\n if (customSerializer === resSerializers.resSerializer) return customSerializer\n return function wrappedResSerializer (res) {\n return customSerializer(resSerializers.resSerializer(res))\n }\n }\n}\n","'use strict'\n\n// **************************************************************\n// * Code initially copied/adapted from \"pony-cause\" npm module *\n// * Please upstream improvements there *\n// **************************************************************\n\nconst isErrorLike = (err) => {\n return err && typeof err.message === 'string'\n}\n\n/**\n * @param {Error|{ cause?: unknown|(()=>err)}} err\n * @returns {Error|Object|undefined}\n */\nconst getErrorCause = (err) => {\n if (!err) return\n\n /** @type {unknown} */\n // @ts-ignore\n const cause = err.cause\n\n // VError / NError style causes\n if (typeof cause === 'function') {\n // @ts-ignore\n const causeResult = err.cause()\n\n return isErrorLike(causeResult)\n ? causeResult\n : undefined\n } else {\n return isErrorLike(cause)\n ? cause\n : undefined\n }\n}\n\n/**\n * Internal method that keeps a track of which error we have already added, to avoid circular recursion\n *\n * @private\n * @param {Error} err\n * @param {Set} seen\n * @returns {string}\n */\nconst _stackWithCauses = (err, seen) => {\n if (!isErrorLike(err)) return ''\n\n const stack = err.stack || ''\n\n // Ensure we don't go circular or crazily deep\n if (seen.has(err)) {\n return stack + '\\ncauses have become circular...'\n }\n\n const cause = getErrorCause(err)\n\n if (cause) {\n seen.add(err)\n return (stack + '\\ncaused by: ' + _stackWithCauses(cause, seen))\n } else {\n return stack\n }\n}\n\n/**\n * @param {Error} err\n * @returns {string}\n */\nconst stackWithCauses = (err) => _stackWithCauses(err, new Set())\n\n/**\n * Internal method that keeps a track of which error we have already added, to avoid circular recursion\n *\n * @private\n * @param {Error} err\n * @param {Set} seen\n * @param {boolean} [skip]\n * @returns {string}\n */\nconst _messageWithCauses = (err, seen, skip) => {\n if (!isErrorLike(err)) return ''\n\n const message = skip ? '' : (err.message || '')\n\n // Ensure we don't go circular or crazily deep\n if (seen.has(err)) {\n return message + ': ...'\n }\n\n const cause = getErrorCause(err)\n\n if (cause) {\n seen.add(err)\n\n // @ts-ignore\n const skipIfVErrorStyleCause = typeof err.cause === 'function'\n\n return (message +\n (skipIfVErrorStyleCause ? '' : ': ') +\n _messageWithCauses(cause, seen, skipIfVErrorStyleCause))\n } else {\n return message\n }\n}\n\n/**\n * @param {Error} err\n * @returns {string}\n */\nconst messageWithCauses = (err) => _messageWithCauses(err, new Set())\n\nmodule.exports = {\n isErrorLike,\n getErrorCause,\n stackWithCauses,\n messageWithCauses\n}\n","'use strict'\n\nconst seen = Symbol('circular-ref-tag')\nconst rawSymbol = Symbol('pino-raw-err-ref')\n\nconst pinoErrProto = Object.create({}, {\n type: {\n enumerable: true,\n writable: true,\n value: undefined\n },\n message: {\n enumerable: true,\n writable: true,\n value: undefined\n },\n stack: {\n enumerable: true,\n writable: true,\n value: undefined\n },\n aggregateErrors: {\n enumerable: true,\n writable: true,\n value: undefined\n },\n raw: {\n enumerable: false,\n get: function () {\n return this[rawSymbol]\n },\n set: function (val) {\n this[rawSymbol] = val\n }\n }\n})\nObject.defineProperty(pinoErrProto, rawSymbol, {\n writable: true,\n value: {}\n})\n\nmodule.exports = {\n pinoErrProto,\n pinoErrorSymbols: {\n seen,\n rawSymbol\n }\n}\n","'use strict'\n\nmodule.exports = errWithCauseSerializer\n\nconst { isErrorLike } = require('./err-helpers')\nconst { pinoErrProto, pinoErrorSymbols } = require('./err-proto')\nconst { seen } = pinoErrorSymbols\n\nconst { toString } = Object.prototype\n\nfunction errWithCauseSerializer (err) {\n if (!isErrorLike(err)) {\n return err\n }\n\n err[seen] = undefined // tag to prevent re-looking at this\n const _err = Object.create(pinoErrProto)\n _err.type = toString.call(err.constructor) === '[object Function]'\n ? err.constructor.name\n : err.name\n _err.message = err.message\n _err.stack = err.stack\n\n if (Array.isArray(err.errors)) {\n _err.aggregateErrors = err.errors.map(err => errWithCauseSerializer(err))\n }\n\n if (isErrorLike(err.cause) && !Object.prototype.hasOwnProperty.call(err.cause, seen)) {\n _err.cause = errWithCauseSerializer(err.cause)\n }\n\n for (const key in err) {\n if (_err[key] === undefined) {\n const val = err[key]\n if (isErrorLike(val)) {\n if (!Object.prototype.hasOwnProperty.call(val, seen)) {\n _err[key] = errWithCauseSerializer(val)\n }\n } else {\n _err[key] = val\n }\n }\n }\n\n delete err[seen] // clean up tag in case err is serialized again later\n _err.raw = err\n return _err\n}\n","'use strict'\n\nmodule.exports = errSerializer\n\nconst { messageWithCauses, stackWithCauses, isErrorLike } = require('./err-helpers')\nconst { pinoErrProto, pinoErrorSymbols } = require('./err-proto')\nconst { seen } = pinoErrorSymbols\n\nconst { toString } = Object.prototype\n\nfunction errSerializer (err) {\n if (!isErrorLike(err)) {\n return err\n }\n\n err[seen] = undefined // tag to prevent re-looking at this\n const _err = Object.create(pinoErrProto)\n _err.type = toString.call(err.constructor) === '[object Function]'\n ? err.constructor.name\n : err.name\n _err.message = messageWithCauses(err)\n _err.stack = stackWithCauses(err)\n\n if (Array.isArray(err.errors)) {\n _err.aggregateErrors = err.errors.map(err => errSerializer(err))\n }\n\n for (const key in err) {\n if (_err[key] === undefined) {\n const val = err[key]\n if (isErrorLike(val)) {\n // We append cause messages and stacks to _err, therefore skipping causes here\n if (key !== 'cause' && !Object.prototype.hasOwnProperty.call(val, seen)) {\n _err[key] = errSerializer(val)\n }\n } else {\n _err[key] = val\n }\n }\n }\n\n delete err[seen] // clean up tag in case err is serialized again later\n _err.raw = err\n return _err\n}\n","'use strict'\n\nmodule.exports = {\n mapHttpRequest,\n reqSerializer\n}\n\nconst rawSymbol = Symbol('pino-raw-req-ref')\nconst pinoReqProto = Object.create({}, {\n id: {\n enumerable: true,\n writable: true,\n value: ''\n },\n method: {\n enumerable: true,\n writable: true,\n value: ''\n },\n url: {\n enumerable: true,\n writable: true,\n value: ''\n },\n query: {\n enumerable: true,\n writable: true,\n value: ''\n },\n params: {\n enumerable: true,\n writable: true,\n value: ''\n },\n headers: {\n enumerable: true,\n writable: true,\n value: {}\n },\n remoteAddress: {\n enumerable: true,\n writable: true,\n value: ''\n },\n remotePort: {\n enumerable: true,\n writable: true,\n value: ''\n },\n raw: {\n enumerable: false,\n get: function () {\n return this[rawSymbol]\n },\n set: function (val) {\n this[rawSymbol] = val\n }\n }\n})\nObject.defineProperty(pinoReqProto, rawSymbol, {\n writable: true,\n value: {}\n})\n\nfunction reqSerializer (req) {\n // req.info is for hapi compat.\n const connection = req.info || req.socket\n const _req = Object.create(pinoReqProto)\n _req.id = (typeof req.id === 'function' ? req.id() : (req.id || (req.info ? req.info.id : undefined)))\n _req.method = req.method\n // req.originalUrl is for expressjs compat.\n if (req.originalUrl) {\n _req.url = req.originalUrl\n } else {\n const path = req.path\n // path for safe hapi compat.\n _req.url = typeof path === 'string' ? path : (req.url ? req.url.path || req.url : undefined)\n }\n\n if (req.query) {\n _req.query = req.query\n }\n\n if (req.params) {\n _req.params = req.params\n }\n\n _req.headers = req.headers\n _req.remoteAddress = connection && connection.remoteAddress\n _req.remotePort = connection && connection.remotePort\n // req.raw is for hapi compat/equivalence\n _req.raw = req.raw || req\n return _req\n}\n\nfunction mapHttpRequest (req) {\n return {\n req: reqSerializer(req)\n }\n}\n","'use strict'\n\nmodule.exports = {\n mapHttpResponse,\n resSerializer\n}\n\nconst rawSymbol = Symbol('pino-raw-res-ref')\nconst pinoResProto = Object.create({}, {\n statusCode: {\n enumerable: true,\n writable: true,\n value: 0\n },\n headers: {\n enumerable: true,\n writable: true,\n value: ''\n },\n raw: {\n enumerable: false,\n get: function () {\n return this[rawSymbol]\n },\n set: function (val) {\n this[rawSymbol] = val\n }\n }\n})\nObject.defineProperty(pinoResProto, rawSymbol, {\n writable: true,\n value: {}\n})\n\nfunction resSerializer (res) {\n const _res = Object.create(pinoResProto)\n _res.statusCode = res.headersSent ? res.statusCode : null\n _res.headers = res.getHeaders ? res.getHeaders() : res._headers\n _res.raw = res\n return _res\n}\n\nfunction mapHttpResponse (res) {\n return {\n res: resSerializer(res)\n }\n}\n","'use strict'\n\nconst format = require('quick-format-unescaped')\n\nmodule.exports = pino\n\nconst _console = pfGlobalThisOrFallback().console || {}\nconst stdSerializers = {\n mapHttpRequest: mock,\n mapHttpResponse: mock,\n wrapRequestSerializer: passthrough,\n wrapResponseSerializer: passthrough,\n wrapErrorSerializer: passthrough,\n req: mock,\n res: mock,\n err: asErrValue,\n errWithCause: asErrValue\n}\nfunction levelToValue (level, logger) {\n return level === 'silent'\n ? Infinity\n : logger.levels.values[level]\n}\nconst baseLogFunctionSymbol = Symbol('pino.logFuncs')\nconst hierarchySymbol = Symbol('pino.hierarchy')\n\nconst logFallbackMap = {\n error: 'log',\n fatal: 'error',\n warn: 'error',\n info: 'log',\n debug: 'log',\n trace: 'log'\n}\n\nfunction appendChildLogger (parentLogger, childLogger) {\n const newEntry = {\n logger: childLogger,\n parent: parentLogger[hierarchySymbol]\n }\n childLogger[hierarchySymbol] = newEntry\n}\n\nfunction setupBaseLogFunctions (logger, levels, proto) {\n const logFunctions = {}\n levels.forEach(level => {\n logFunctions[level] = proto[level] ? proto[level] : (_console[level] || _console[logFallbackMap[level] || 'log'] || noop)\n })\n logger[baseLogFunctionSymbol] = logFunctions\n}\n\nfunction shouldSerialize (serialize, serializers) {\n if (Array.isArray(serialize)) {\n const hasToFilter = serialize.filter(function (k) {\n return k !== '!stdSerializers.err'\n })\n return hasToFilter\n } else if (serialize === true) {\n return Object.keys(serializers)\n }\n\n return false\n}\n\nfunction pino (opts) {\n opts = opts || {}\n opts.browser = opts.browser || {}\n\n const transmit = opts.browser.transmit\n if (transmit && typeof transmit.send !== 'function') { throw Error('pino: transmit option must have a send function') }\n\n const proto = opts.browser.write || _console\n if (opts.browser.write) opts.browser.asObject = true\n const serializers = opts.serializers || {}\n const serialize = shouldSerialize(opts.browser.serialize, serializers)\n let stdErrSerialize = opts.browser.serialize\n\n if (\n Array.isArray(opts.browser.serialize) &&\n opts.browser.serialize.indexOf('!stdSerializers.err') > -1\n ) stdErrSerialize = false\n\n const customLevels = Object.keys(opts.customLevels || {})\n const levels = ['error', 'fatal', 'warn', 'info', 'debug', 'trace'].concat(customLevels)\n\n if (typeof proto === 'function') {\n levels.forEach(function (level) {\n proto[level] = proto\n })\n }\n if (opts.enabled === false || opts.browser.disabled) opts.level = 'silent'\n const level = opts.level || 'info'\n const logger = Object.create(proto)\n if (!logger.log) logger.log = noop\n\n setupBaseLogFunctions(logger, levels, proto)\n // setup root hierarchy entry\n appendChildLogger({}, logger)\n\n Object.defineProperty(logger, 'levelVal', {\n get: getLevelVal\n })\n Object.defineProperty(logger, 'level', {\n get: getLevel,\n set: setLevel\n })\n\n const setOpts = {\n transmit,\n serialize,\n asObject: opts.browser.asObject,\n formatters: opts.browser.formatters,\n levels,\n timestamp: getTimeFunction(opts),\n messageKey: opts.messageKey || 'msg',\n onChild: opts.onChild || noop\n }\n logger.levels = getLevels(opts)\n logger.level = level\n\n logger.setMaxListeners = logger.getMaxListeners =\n logger.emit = logger.addListener = logger.on =\n logger.prependListener = logger.once =\n logger.prependOnceListener = logger.removeListener =\n logger.removeAllListeners = logger.listeners =\n logger.listenerCount = logger.eventNames =\n logger.write = logger.flush = noop\n logger.serializers = serializers\n logger._serialize = serialize\n logger._stdErrSerialize = stdErrSerialize\n logger.child = function (...args) { return child.call(this, setOpts, ...args) }\n\n if (transmit) logger._logEvent = createLogEventShape()\n\n function getLevelVal () {\n return levelToValue(this.level, this)\n }\n\n function getLevel () {\n return this._level\n }\n function setLevel (level) {\n if (level !== 'silent' && !this.levels.values[level]) {\n throw Error('unknown level ' + level)\n }\n this._level = level\n\n set(this, setOpts, logger, 'error') // <-- must stay first\n set(this, setOpts, logger, 'fatal')\n set(this, setOpts, logger, 'warn')\n set(this, setOpts, logger, 'info')\n set(this, setOpts, logger, 'debug')\n set(this, setOpts, logger, 'trace')\n\n customLevels.forEach((level) => {\n set(this, setOpts, logger, level)\n })\n }\n\n function child (setOpts, bindings, childOptions) {\n if (!bindings) {\n throw new Error('missing bindings for child Pino')\n }\n childOptions = childOptions || {}\n if (serialize && bindings.serializers) {\n childOptions.serializers = bindings.serializers\n }\n const childOptionsSerializers = childOptions.serializers\n if (serialize && childOptionsSerializers) {\n var childSerializers = Object.assign({}, serializers, childOptionsSerializers)\n var childSerialize = opts.browser.serialize === true\n ? Object.keys(childSerializers)\n : serialize\n delete bindings.serializers\n applySerializers([bindings], childSerialize, childSerializers, this._stdErrSerialize)\n }\n function Child (parent) {\n this._childLevel = (parent._childLevel | 0) + 1\n\n // make sure bindings are available in the `set` function\n this.bindings = bindings\n\n if (childSerializers) {\n this.serializers = childSerializers\n this._serialize = childSerialize\n }\n if (transmit) {\n this._logEvent = createLogEventShape(\n [].concat(parent._logEvent.bindings, bindings)\n )\n }\n }\n Child.prototype = this\n const newLogger = new Child(this)\n\n // must happen before the level is assigned\n appendChildLogger(this, newLogger)\n newLogger.child = function (...args) { return child.call(this, setOpts, ...args) }\n // required to actually initialize the logger functions for any given child\n newLogger.level = childOptions.level || this.level // allow level to be set by childOptions\n setOpts.onChild(newLogger)\n\n return newLogger\n }\n return logger\n}\n\nfunction getLevels (opts) {\n const customLevels = opts.customLevels || {}\n\n const values = Object.assign({}, pino.levels.values, customLevels)\n const labels = Object.assign({}, pino.levels.labels, invertObject(customLevels))\n\n return {\n values,\n labels\n }\n}\n\nfunction invertObject (obj) {\n const inverted = {}\n Object.keys(obj).forEach(function (key) {\n inverted[obj[key]] = key\n })\n return inverted\n}\n\npino.levels = {\n values: {\n fatal: 60,\n error: 50,\n warn: 40,\n info: 30,\n debug: 20,\n trace: 10\n },\n labels: {\n 10: 'trace',\n 20: 'debug',\n 30: 'info',\n 40: 'warn',\n 50: 'error',\n 60: 'fatal'\n }\n}\n\npino.stdSerializers = stdSerializers\npino.stdTimeFunctions = Object.assign({}, { nullTime, epochTime, unixTime, isoTime })\n\nfunction getBindingChain (logger) {\n const bindings = []\n if (logger.bindings) {\n bindings.push(logger.bindings)\n }\n\n // traverse up the tree to get all bindings\n let hierarchy = logger[hierarchySymbol]\n while (hierarchy.parent) {\n hierarchy = hierarchy.parent\n if (hierarchy.logger.bindings) {\n bindings.push(hierarchy.logger.bindings)\n }\n }\n\n return bindings.reverse()\n}\n\nfunction set (self, opts, rootLogger, level) {\n // override the current log functions with either `noop` or the base log function\n Object.defineProperty(self, level, {\n value: (levelToValue(self.level, rootLogger) > levelToValue(level, rootLogger)\n ? noop\n : rootLogger[baseLogFunctionSymbol][level]),\n writable: true,\n enumerable: true,\n configurable: true\n })\n\n if (self[level] === noop) {\n if (!opts.transmit) return\n\n const transmitLevel = opts.transmit.level || self.level\n const transmitValue = rootLogger.levels.values[transmitLevel]\n const methodValue = rootLogger.levels.values[level]\n if (methodValue < transmitValue) return\n }\n\n // make sure the log format is correct\n self[level] = createWrap(self, opts, rootLogger, level)\n\n // prepend bindings if it is not the root logger\n const bindings = getBindingChain(self)\n if (bindings.length === 0) {\n // early exit in case for rootLogger\n return\n }\n self[level] = prependBindingsInArguments(bindings, self[level])\n}\n\nfunction prependBindingsInArguments (bindings, logFunc) {\n return function () {\n return logFunc.apply(this, [...bindings, ...arguments])\n }\n}\n\nfunction createWrap (self, opts, rootLogger, level) {\n return (function (write) {\n return function LOG () {\n const ts = opts.timestamp()\n const args = new Array(arguments.length)\n const proto = (Object.getPrototypeOf && Object.getPrototypeOf(this) === _console) ? _console : this\n for (var i = 0; i < args.length; i++) args[i] = arguments[i]\n\n var argsIsSerialized = false\n if (opts.serialize) {\n applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize)\n argsIsSerialized = true\n }\n if (opts.asObject || opts.formatters) {\n write.call(proto, asObject(this, level, args, ts, opts))\n } else write.apply(proto, args)\n\n if (opts.transmit) {\n const transmitLevel = opts.transmit.level || self._level\n const transmitValue = rootLogger.levels.values[transmitLevel]\n const methodValue = rootLogger.levels.values[level]\n if (methodValue < transmitValue) return\n transmit(this, {\n ts,\n methodLevel: level,\n methodValue,\n transmitLevel,\n transmitValue: rootLogger.levels.values[opts.transmit.level || self._level],\n send: opts.transmit.send,\n val: levelToValue(self._level, rootLogger)\n }, args, argsIsSerialized)\n }\n }\n })(self[baseLogFunctionSymbol][level])\n}\n\nfunction asObject (logger, level, args, ts, opts) {\n const {\n level: levelFormatter,\n log: logObjectFormatter = (obj) => obj\n } = opts.formatters || {}\n const argsCloned = args.slice()\n let msg = argsCloned[0]\n const logObject = {}\n if (ts) {\n logObject.time = ts\n }\n\n if (levelFormatter) {\n const formattedLevel = levelFormatter(level, logger.levels.values[level])\n Object.assign(logObject, formattedLevel)\n } else {\n logObject.level = logger.levels.values[level]\n }\n\n let lvl = (logger._childLevel | 0) + 1\n if (lvl < 1) lvl = 1\n // deliberate, catching objects, arrays\n if (msg !== null && typeof msg === 'object') {\n while (lvl-- && typeof argsCloned[0] === 'object') {\n Object.assign(logObject, argsCloned.shift())\n }\n msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : undefined\n } else if (typeof msg === 'string') msg = format(argsCloned.shift(), argsCloned)\n if (msg !== undefined) logObject[opts.messageKey] = msg\n\n const formattedLogObject = logObjectFormatter(logObject)\n return formattedLogObject\n}\n\nfunction applySerializers (args, serialize, serializers, stdErrSerialize) {\n for (const i in args) {\n if (stdErrSerialize && args[i] instanceof Error) {\n args[i] = pino.stdSerializers.err(args[i])\n } else if (typeof args[i] === 'object' && !Array.isArray(args[i]) && serialize) {\n for (const k in args[i]) {\n if (serialize.indexOf(k) > -1 && k in serializers) {\n args[i][k] = serializers[k](args[i][k])\n }\n }\n }\n }\n}\n\nfunction transmit (logger, opts, args, argsIsSerialized = false) {\n const send = opts.send\n const ts = opts.ts\n const methodLevel = opts.methodLevel\n const methodValue = opts.methodValue\n const val = opts.val\n const bindings = logger._logEvent.bindings\n\n if (!argsIsSerialized) {\n applySerializers(\n args,\n logger._serialize || Object.keys(logger.serializers),\n logger.serializers,\n logger._stdErrSerialize === undefined ? true : logger._stdErrSerialize\n )\n }\n\n logger._logEvent.ts = ts\n logger._logEvent.messages = args.filter(function (arg) {\n // bindings can only be objects, so reference equality check via indexOf is fine\n return bindings.indexOf(arg) === -1\n })\n\n logger._logEvent.level.label = methodLevel\n logger._logEvent.level.value = methodValue\n\n send(methodLevel, logger._logEvent, val)\n\n logger._logEvent = createLogEventShape(bindings)\n}\n\nfunction createLogEventShape (bindings) {\n return {\n ts: 0,\n messages: [],\n bindings: bindings || [],\n level: { label: '', value: 0 }\n }\n}\n\nfunction asErrValue (err) {\n const obj = {\n type: err.constructor.name,\n msg: err.message,\n stack: err.stack\n }\n for (const key in err) {\n if (obj[key] === undefined) {\n obj[key] = err[key]\n }\n }\n return obj\n}\n\nfunction getTimeFunction (opts) {\n if (typeof opts.timestamp === 'function') {\n return opts.timestamp\n }\n if (opts.timestamp === false) {\n return nullTime\n }\n return epochTime\n}\n\nfunction mock () { return {} }\nfunction passthrough (a) { return a }\nfunction noop () {}\n\nfunction nullTime () { return false }\nfunction epochTime () { return Date.now() }\nfunction unixTime () { return Math.round(Date.now() / 1000.0) }\nfunction isoTime () { return new Date(Date.now()).toISOString() } // using Date.now() for testability\n\n/* eslint-disable */\n/* istanbul ignore next */\nfunction pfGlobalThisOrFallback () {\n function defd (o) { return typeof o !== 'undefined' && o }\n try {\n if (typeof globalThis !== 'undefined') return globalThis\n Object.defineProperty(Object.prototype, 'globalThis', {\n get: function () {\n delete Object.prototype.globalThis\n return (this.globalThis = this)\n },\n configurable: true\n })\n return globalThis\n } catch (e) {\n return defd(self) || defd(window) || defd(this) || {}\n }\n}\n/* eslint-enable */\n\nmodule.exports.default = pino\nmodule.exports.pino = pino\n","/** @internal */\nexport const cacheControlSymbol = Symbol('cache-parser');\n","export function isDuration(val: unknown): boolean {\n return (\n (typeof val === 'string' || typeof val === 'number') &&\n (val = Number(val)) >= 0 &&\n (val as number) < Infinity\n );\n}\n\nexport function isTruthy(val: unknown): boolean {\n return (\n val === true ||\n typeof val === 'number' ||\n (typeof val === 'string' && val !== 'false')\n );\n}\n\nexport function parseRawHeaders(headerStr: string): Record {\n const headers: Record = {};\n const tokens = headerStr.toLowerCase().replace(/\\s+/g, '').split(',');\n\n for (const token of tokens) {\n const split = token.split('=', 2) as [string, string];\n headers[split[0]] = split[1] ?? true;\n }\n\n return headers;\n}\n","import type { CacheControl } from './index';\nimport { cacheControlSymbol } from './internal';\nimport { isDuration, isTruthy, parseRawHeaders } from './util';\n\nconst number = Number;\n\n/**\n * Parses the Cache-Control header.\n *\n * You can check if a object was returned by this function with {@link isCacheControl} .\n *\n * @param {string} Header The header to parse\n * @returns {CacheControl} The parsed cache control header\n */\nexport function parse(headerStr?: string): CacheControl {\n const header: CacheControl = Object.defineProperty({}, cacheControlSymbol, {\n enumerable: false,\n value: 1\n });\n\n if (!headerStr || typeof headerStr !== 'string') {\n return header;\n }\n\n const headers = parseRawHeaders(headerStr);\n\n const maxAge = headers['max-age'];\n const maxStale = headers['max-stale'];\n const minFresh = headers['min-fresh'];\n const sMaxAge = headers['s-maxage'];\n const staleIfError = headers['stale-if-error'];\n const staleWhileRevalidate = headers['stale-while-revalidate'];\n\n if (isTruthy(headers['immutable'])) {\n header.immutable = true;\n }\n\n if (isDuration(maxAge)) {\n header.maxAge = number(maxAge);\n }\n\n if (isDuration(maxStale)) {\n header.maxStale = number(maxStale);\n }\n\n if (isDuration(minFresh)) {\n header.minFresh = number(minFresh);\n }\n\n if (isTruthy(headers['must-revalidate'])) {\n header.mustRevalidate = true;\n }\n\n if (isTruthy(headers['must-understand'])) {\n header.mustUnderstand = true;\n }\n\n if (isTruthy(headers['no-cache'])) {\n header.noCache = true;\n }\n\n if (isTruthy(headers['no-store'])) {\n header.noStore = true;\n }\n\n if (isTruthy(headers['no-transform'])) {\n header.noTransform = true;\n }\n\n if (isTruthy(headers['only-if-cached'])) {\n header.onlyIfCached = true;\n }\n\n if (isTruthy(headers['private'])) {\n header.private = true;\n }\n\n if (isTruthy(headers['proxy-revalidate'])) {\n header.proxyRevalidate = true;\n }\n\n if (isTruthy(headers['public'])) {\n header.public = true;\n }\n\n if (isDuration(sMaxAge)) {\n header.sMaxAge = number(sMaxAge);\n }\n\n if (isDuration(staleIfError)) {\n header.staleIfError = number(staleIfError);\n }\n\n if (isDuration(staleWhileRevalidate)) {\n header.staleWhileRevalidate = number(staleWhileRevalidate);\n }\n\n return header;\n}\n","/* eslint-disable @typescript-eslint/restrict-template-expressions */\nimport type { CacheControl } from './index';\nimport { isDuration, isTruthy } from './util';\n\n/**\n * Return an array of tokens from the header object.\n *\n * #### The output is sorted by alphabetical order\n *\n * The cache control object does not need to be a CacheControl object from the\n * {@link CacheControl}.This means that the parameter do not have to pass in the\n * {@link isCacheControl} function.\n *\n * You can build a string with `.join(', ')` method.\n *\n * @example\n *\n * ```js\n * const tokens = tokenize({ maxAge: 3600, noCache: true }); // ['max-age=3600',\n * 'no-cache']\n *\n * const header = tokens.join(', '); // 'max-age=3600, no-cache'\n * ```\n *\n * @param header The cache control object\n * @returns An array of directives an their respective values.\n */\nexport function tokenize(header?: CacheControl): string[] {\n if (!header || typeof header !== 'object') {\n return [];\n }\n\n const tokens: string[] = [];\n\n if (isTruthy(header.immutable)) {\n tokens.push('immutable');\n }\n\n if (isDuration(header.maxAge)) {\n tokens.push(`max-age=${header.maxAge}`);\n }\n\n if (isDuration(header.maxStale)) {\n tokens.push(`max-stale=${header.maxStale}`);\n }\n\n if (isDuration(header.minFresh)) {\n tokens.push(`min-fresh=${header.minFresh}`);\n }\n\n if (isTruthy(header.mustRevalidate)) {\n tokens.push('must-revalidate');\n }\n\n if (isTruthy(header.mustUnderstand)) {\n tokens.push('must-understand');\n }\n\n if (isTruthy(header.noCache)) {\n tokens.push('no-cache');\n }\n\n if (isTruthy(header.noStore)) {\n tokens.push('no-store');\n }\n\n if (isTruthy(header.noTransform)) {\n tokens.push('no-transform');\n }\n\n if (isTruthy(header.onlyIfCached)) {\n tokens.push('only-if-cached');\n }\n\n if (isTruthy(header.private)) {\n tokens.push('private');\n }\n\n if (isTruthy(header.proxyRevalidate)) {\n tokens.push('proxy-revalidate');\n }\n\n if (isTruthy(header.public)) {\n tokens.push('public');\n }\n\n if (isDuration(header.sMaxAge)) {\n tokens.push(`s-maxage=${header.sMaxAge}`);\n }\n\n if (isDuration(header.staleIfError)) {\n tokens.push(`stale-if-error=${header.staleIfError}`);\n }\n\n if (isDuration(header.staleWhileRevalidate)) {\n tokens.push(`stale-while-revalidate=${header.staleWhileRevalidate}`);\n }\n\n return tokens;\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { cacheControlSymbol } from './internal';\n\nexport * from './parse';\nexport * from './tokenize';\n\n/**\n * Detects if the given parameter is a {@link CacheControl} object.\n *\n * @param {any} obj The object to test\n * @returns {boolean} True if the parameter was created by the {@link parse} function\n */\nexport function isCacheControl(obj?: unknown): obj is CacheControl {\n return !!obj && !!(obj as Record)[cacheControlSymbol];\n}\n\n/**\n * The Cache-Control HTTP header field holds directives (instructions) — in both requests\n * and responses — that control caching in browsers and shared caches (e.g. Proxies,\n * CDNs).\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control\n */\nexport declare type CacheControl = {\n /**\n * The immutable response directive indicates that the response will not be updated\n * while it's fresh.\n *\n * ```txt\n * Cache-Control: public, max-age=604800, immutable\n * ```\n *\n * A modern best practice for static resources is to include version/hashes in their\n * URLs, while never modifying the resources — but instead, when necessary, updating the\n * resources with newer versions that have new version-numbers/hashes, so that their\n * URLs are different. That’s called the cache-busting pattern.\n *\n * ```html\n * \n * ```\n *\n * When a user reloads the browser, the browser will send conditional requests for\n * validating to the origin server. But it's not necessary to revalidate those kinds of\n * static resources even when a user reloads the browser, because they're never\n * modified. immutable tells a cache that the response is immutable while it's fresh,\n * and avoids those kinds of unnecessary conditional requests to the server.\n *\n * When you use a cache-busting pattern for resources and apply them to a long max-age,\n * you can also add immutable to avoid revalidation.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#immutable\n */\n immutable?: true;\n /**\n * The max-age=N response directive indicates that the response remains fresh until N\n * seconds after the response is generated.\n *\n * ```txt\n * Cache-Control: max-age=604800\n * ```\n *\n * Indicates that caches can store this response and reuse it for subsequent requests\n * while it's fresh.\n *\n * Note that max-age is not the elapsed time since the response was received, but\n * instead the elapsed time since the response was generated on the origin server. So if\n * the other cache(s) on the path the response takes store it for 100 seconds (indicated\n * using the Age response header field), the browser cache would deduct 100 seconds from\n * its freshness lifetime.\n *\n * ```txt\n * Cache-Control: max-age=604800\n * Age: 100\n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#max-age\n */\n maxAge?: number;\n /**\n * The max-stale=N request directive indicates that the client allows a stored response\n * that is stale within N seconds.\n *\n * ```txt\n * Cache-Control: max-stale=3600\n * ```\n *\n * In the case above, if the response with Cache-Control: max-age=604800 was stored on\n * caches 3 hours ago, the cache couldn't reuse that response.\n *\n * Clients can use this header when the origin server is down or too slow and can accept\n * cached responses from caches even if they are a bit old.\n *\n * Note that the major browsers do not support requests with max-stale.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#max-stale\n */\n maxStale?: number;\n /**\n * The min-fresh=N request directive indicates that the client allows a stored response\n * that is fresh for at least N seconds.\n *\n * ```txt\n * Cache-Control: min-fresh=600\n * ```\n *\n * In the case above, if the response with Cache-Control: max-age=3600 was stored in\n * caches 51 minutes ago, the cache couldn't reuse that response.\n *\n * Clients can use this header when the user requires the response to not only be fresh,\n * but also requires that it won't be updated for a period of time.\n *\n * Note that the major browsers do not support requests with min-fresh.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#min-fresh\n */\n minFresh?: number;\n /**\n * The must-revalidate response directive indicates that the response can be stored in\n * caches and can be reused while fresh. Once it becomes stale, it must be validated\n * with the origin server before reuse.\n *\n * Typically, must-revalidate is used with max-age.\n *\n * ```txt\n * Cache-Control: max-age=604800, must-revalidate\n * ```\n *\n * HTTP allows caches to reuse stale responses when they are disconnected from the\n * origin server. must-revalidate is a way to prevent that, so that the cache either\n * revalidates the stored response with the origin server, or if that's not possible it\n * generates a 504 (Gateway Timeout) response.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#must-revalidate\n */\n mustRevalidate?: true;\n\n mustUnderstand?: true;\n /**\n * The no-cache response directive indicates that the response can be stored in caches,\n * but must be validated with the origin server before each reuse — even when the cache\n * is disconnected from the origin server.\n *\n * ```txt\n * Cache-Control: no-cache\n * ```\n *\n * If you want caches to always check for content updates while reusing stored content\n * when it hasn't changed, no-cache is the directive to use. It does this by requiring\n * caches to revalidate each request with the origin server.\n *\n * Note that no-cache does not mean \"don't cache\". no-cache allows caches to store a\n * response, but requires them to revalidate it before reuse. If the sense of \"don't\n * cache\" that you want is actually \"don't store\", then no-store is the directive to\n * use.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#no-cache\n */\n noCache?: true;\n /**\n * The no-store response directive indicates that any caches of any kind (private or\n * shared) should not store this response.\n *\n * ```txt\n * Cache-Control: no-store\n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#no-store\n */\n noStore?: true;\n /**\n * Some intermediaries transform content for various reasons. For example, some convert\n * images to reduce transfer size. In some cases, this is undesirable for the content\n * provider.\n *\n * No-transform indicates that any intermediary (regardless of whether it implements a\n * cache) shouldn't transform the response contents.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#no-transform\n */\n noTransform?: true;\n /**\n * The client indicates that cache should obtain an already-cached response. If a cache\n * has stored a response, it’s reused.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#only-if-cached\n */\n onlyIfCached?: true;\n /**\n * The private response directive indicates that the response can be stored only in a\n * private cache (e.g. local caches in browsers).\n *\n * ```txt\n * Cache-Control: private\n * ```\n *\n * You should add the private directive for user-personalized content — in particular,\n * responses received after login, and sessions managed via cookies.\n *\n * If you forget to add private to a response with personalized content, then that\n * response can be stored in a shared cache and end up being used by multiple users,\n * which can cause personal information to leak.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#private\n */\n private?: true;\n /**\n * The proxy-revalidate response directive is the equivalent of must-revalidate, but\n * specifically for shared caches only.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#proxy-revalidate\n */\n proxyRevalidate?: true;\n /**\n * Responses for requests with Authorization header fields must not be stored in a\n * shared cache. But the public directive will cause such responses to be stored in a\n * shared cache.\n *\n * ```txt\n * Cache-Control: public\n * ```\n *\n * In general, when pages are under Basic Auth or Digest Auth, the browser sends\n * requests with the Authorization header. That means the response is access-controlled\n * for restricted users (who have accounts), and it's fundamentally not\n * shared-cacheable, even if it has max-age.\n *\n * You can use the public directive to unlock that restriction.\n *\n * ```txt\n * Cache-Control: public, max-age=604800\n * ```\n *\n * Note that, s-maxage or must-revalidate also unlock that restriction.\n *\n * If a request doesn’t have an Authorization header, or you are already using s-maxage\n * or must-revalidate in the response, then you don't need to use public.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#public\n */\n public?: true;\n /**\n * The s-maxage response directive also indicates how long the response is fresh for\n * (similar to max-age) — but it is specific to shared caches, and they will ignore\n * max-age when it is present.\n *\n * ```txt\n * Cache-Control: s-maxage=604800\n * ```\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage\n */\n sMaxAge?: number;\n /**\n * The stale-if-error response directive indicates that the cache can reuse a stale\n * response when an origin server responds with an error (500, 502, 503, or 504).\n *\n * ```txt\n * Cache-Control: max-age=604800, stale-if-error=86400\n * ```\n *\n * In the example above, the response is fresh for 7 days (604800s). After 7 days it\n * becomes stale, but it can be used for an extra 1 day (86400s) if the server responds\n * with an error.\n *\n * After a period of time, the stored response became stale normally. That means the\n * client will receive an error response as-is if the origin server sends it.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error\n */\n staleIfError?: number;\n /**\n * The stale-while-revalidate response directive indicates that the cache could reuse a\n * stale response while it revalidates it to a cache.\n *\n * ```txt\n * Cache-Control: max-age=604800, stale-while-revalidate=86400\n * ```\n *\n * In the example above, the response is fresh for 7 days (604800s). After 7 days, it\n * becomes stale but the cache is allowed to reuse it for any requests that are made in\n * the following day (86400s) — provided that they revalidate the response in the\n * background.\n *\n * Revalidation will make the cache be fresh again, so it appears to clients that it was\n * always fresh during that period — effectively hiding the latency penalty of\n * revalidation from them.\n *\n * If no request happened during that period, the cache became stale and the next\n * request will revalidate normally.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate\n */\n staleWhileRevalidate?: number;\n};\n","import type { Deferred } from './deferred';\nimport { fastDeferSymbol } from './internal';\n\n/** @returns A new {@link Deferred} object */\nexport function deferred() {\n let resolve!: Deferred['resolve'];\n let reject!: Deferred['reject'];\n\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n }) as Deferred;\n\n promise.resolve = resolve;\n promise.reject = reject;\n promise[fastDeferSymbol] = 1;\n\n return promise;\n}\n","import type { Deferred } from './deferred';\nimport { fastDeferSymbol } from './internal';\n\n/**\n * Detects if the given parameter is a {@link Deferred}\n *\n * @param {any} value The promise to validate\n * @returns True if the given promise is a deferred, false otherwise\n */\nexport function isDeferred(value?: unknown): value is Deferred {\n return !!value && !!(value as Deferred)[fastDeferSymbol];\n}\n","import { sortNumbers } from './util';\n\n/**\n * Hashes a given value into a unique number.\n *\n * This function accepts **ANY** kind of value, like `functions`, `classes`, `objects` and\n * so on.\n *\n * **Note**: Symbols uniqueness are not guaranteed, as they are transformed to strings.\n *\n * @example\n *\n * ```ts\n * class B {}\n *\n * const bHash = hash(B);\n * const bInstanceHash = hash(new B());\n * const bArrayHash = hash([B, new B(), new B(), { b: new B() }]);\n * const bBuilderHash = hash(() => B);\n * const bFactoryHash = hash(() => new B());\n * ```\n *\n * @param val The value to be hashed\n * @returns The signed integer result from the provided value\n * @see https://tinylibs.js.org/packages/object-code/\n */\nexport function hash(val: unknown, seen?: WeakSet): number {\n let h = 5381;\n\n // Objects should be recursively hashed\n if (\n typeof val === 'object' &&\n val !== null &&\n (val.toString === Object.prototype.toString ||\n val.toString === Array.prototype.toString)\n ) {\n if (!seen) {\n seen = new WeakSet();\n }\n\n // Sort keys to keep the hash consistent\n const keys = Object.keys(val).sort(sortNumbers);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = val[key as keyof typeof val] as object;\n\n h = (h * 33) ^ hash(key, seen);\n\n // Uses an internal WeakMap to keep track of previous seen values\n // and avoid circular references serializations which would cause\n // an infinite loop.\n if (\n typeof value === 'object' &&\n value !== null &&\n (val.toString === Object.prototype.toString ||\n val.toString === Array.prototype.toString)\n ) {\n if (seen.has(value)) {\n continue;\n }\n\n seen.add(value);\n }\n\n // Hashes the value\n h = (h * 33) ^ hash(value, seen);\n }\n\n // Also hashes the constructor\n h = (h * 33) ^ hash(val.constructor, seen);\n\n return h;\n }\n\n let toHash = typeof val;\n\n try {\n if (val instanceof Date) {\n toHash += val.getTime();\n } else {\n toHash += String(val);\n }\n } catch (error) {\n toHash += String(Object.assign({}, val));\n }\n\n for (let i = 0; i < toHash.length; i++) {\n h = (h * 33) ^ toHash.charCodeAt(i);\n }\n\n return h;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t57: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// no jsonp function","__webpack_require__.nc = undefined;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import { getCurrentUrl } from './getCurrentUrl';\nimport { isSSR } from './isSSR';\n\nexport const getClientQueryParam = (queryParam: string): string | null =>\n isSSR() ? null : getCurrentUrl().searchParams.get(queryParam);\n","export const isSSR = () => typeof window === 'undefined';\n","export const getCurrentUrl = () => new URL(window.location.href);\n","/*! js-cookie v3.0.5 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n function set (name, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n name = encodeURIComponent(name)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n name + '=' + converter.write(value, name) + stringifiedAttributes)\n }\n\n function get (name) {\n if (typeof document === 'undefined' || (arguments.length && !name)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var found = decodeURIComponent(parts[0]);\n jar[found] = converter.read(value, found);\n\n if (name === found) {\n break\n }\n } catch (e) {}\n }\n\n return name ? jar[name] : jar\n }\n\n return Object.create(\n {\n set,\n get,\n remove: function (name, attributes) {\n set(\n name,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\nexport { api as default };\n","export const SHOULD_BE_CLOSED_COOKIE = 'outdatedBrowserClosed';\nexport const TEST_OUTDATED_BROWSER_INFO_QUERY_PARAM = 'testOutdatedBrowserInfo';\n","/* istanbul ignore file */\n\n/**\n * DO NOT EDIT!\n * This file was autogenerated by npm script `localizations-codegen`.\n * Changes may cause incorrect behavior and will be lost when the file is regenerated.\n *\n * Run `npx localizations-codegen` to regenerate.\n */\nimport type { TranslationKey } from '../models/TranslationKey';\n\nexport type DefaultTranslations = Record;\n\nexport const defaultTranslations: DefaultTranslations = {\n update: 'Update',\n updateYourBrowser: 'Update your browser for more security, speed and the best experience on this site.',\n yourBrowserIsOutdated: 'Your web browser ({brow_name}) is out of date.',\n};\n\nexport const translationsNamespace = 'outdated-browser-info';\n","import type { Options } from 'browser-update/update.npm';\nimport Cookies from 'js-cookie';\n\nimport { SHOULD_BE_CLOSED_COOKIE } from './app';\n\n/* istanbul ignore next -- we don't need to test external package functionality. */\nconst onclose = () => {\n Cookies.set(SHOULD_BE_CLOSED_COOKIE, 'true');\n};\n\n/**\n * Configuration is described here https://github.com/browser-update/browser-update/wiki/Details-on-configuration\n */\nexport const optionsWithoutTranslations: Options = {\n /**\n * This number doesn't say how many versions are supported but how many **older** versions are supported.\n * So as we are generally supporting the 3 latest versions (https://oriflame.visualstudio.com/FrontendPlatform/_wiki/wikis/Front-end/7315/Supported-Browsers),\n * it translates to -2 in this configuration (meaning 1 latest version + 2 older versions).\n *\n * This behavior can be tested here https://browser-update.org/#install.\n *\n * Defaults are defined here https://github.com/browser-update/browser-update/blob/f99dac1461eebf82167e1dddedc58b76fb219097/scripts/update.js#L11C5-L11C107\n * {c:-3,f:-3,s:-1,e:17,i:11,ios:10,samsung:9.9,o:-3,o_a:-3,y:20.4,v:2.6,uc:13.0,a:535};\n */\n required: { e: -2, f: -2, o: -2, s: -2, ios: -2, c: -2, i: 0 },\n reminder: 24,\n reminderClosed: 150,\n l: false,\n test: false,\n\n /* eslint-disable-next-line @typescript-eslint/naming-convention -- browser-update naming convention */\n text_in_xx: '',\n newwindow: true,\n noclose: false,\n nomessage: false,\n jsshowurl: '//browser-update.org/update.show.min.js',\n container: document.body,\n\n /* eslint-disable-next-line @typescript-eslint/naming-convention -- browser-update naming convention */\n no_permanent_hide: true,\n onclose,\n};\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./index.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./index.css\";\n export default content && content.locals ? content.locals : undefined;\n","import { axios } from '@ori/axios';\nimport type { PickClientAppDataConfigProps } from '@ori/client-app-config';\nimport { handleResponse, validateStatus } from '@ori/fetching';\nimport { getClientQueryParam } from '@ori/presentation-utils';\nimport type { StaticLocalizationsSingleLanguageLocalizationsDtoLocalizations } from '@ori/static-api-client-react';\nimport browserUpdate from 'browser-update';\nimport Cookies from 'js-cookie';\n\nimport {\n defaultTranslations,\n optionsWithoutTranslations,\n SHOULD_BE_CLOSED_COOKIE,\n TEST_OUTDATED_BROWSER_INFO_QUERY_PARAM,\n translationsNamespace,\n} from '../constants';\nimport '../index.css';\nimport { parseLocalizations } from './parseLocalizations';\n\nexport type AppProps = PickClientAppDataConfigProps<'currentLanguage' | 'tenant' | 'staticApiUrl'>;\n\nexport const outdatedBrowserInfo = ({ currentLanguage, staticApiUrl, tenant }: AppProps): void => {\n if (Cookies.get(SHOULD_BE_CLOSED_COOKIE)) {\n return;\n }\n const test = getClientQueryParam(TEST_OUTDATED_BROWSER_INFO_QUERY_PARAM) === 'true';\n\n axios<{ Localizations: StaticLocalizationsSingleLanguageLocalizationsDtoLocalizations }>(\n `/tenants/${tenant}/localizations/${translationsNamespace}`,\n {\n baseURL: staticApiUrl,\n method: 'GET',\n params: { lang: currentLanguage },\n validateStatus,\n },\n )\n .then((response) => {\n const localizations = handleResponse(response, {\n onSuccess: ({ data }) => parseLocalizations(data.Localizations),\n onError: () => defaultTranslations,\n });\n\n browserUpdate({\n ...optionsWithoutTranslations,\n test,\n text: {\n msg: localizations.yourBrowserIsOutdated,\n msgmore: localizations.updateYourBrowser,\n bupdate: localizations.update.toUpperCase(),\n },\n });\n })\n .catch((error) => {\n console.warn('Cannot start outdated browser info', { error: error as Error });\n });\n};\n","import type { StaticLocalizationsSingleLanguageLocalizationsDtoLocalizations } from '@ori/static-api-client-react';\n\nimport type { DefaultTranslations } from '../constants';\nimport { defaultTranslations } from '../constants';\n\nexport const parseLocalizations = (\n localizations: StaticLocalizationsSingleLanguageLocalizationsDtoLocalizations & Partial,\n): DefaultTranslations => ({\n update: localizations.update ? localizations.update : defaultTranslations.update,\n updateYourBrowser: localizations.updateYourBrowser\n ? localizations.updateYourBrowser\n : defaultTranslations.updateYourBrowser,\n yourBrowserIsOutdated: localizations.yourBrowserIsOutdated\n ? localizations.yourBrowserIsOutdated\n : defaultTranslations.yourBrowserIsOutdated,\n});\n","import { render } from './appRender';\n\n/* istanbul ignore file -- client app file does not need to be tested. */\nconst APP_ROOT_ELEMENT_ID = 'outdated-browser-info-root';\n\nasync function init() {\n const rootElement = document.getElementById(APP_ROOT_ELEMENT_ID);\n\n if (!rootElement) {\n throw new Error(`Element #${APP_ROOT_ELEMENT_ID} was not found!`);\n }\n\n render(rootElement);\n}\n\ninit().catch((error) => {\n throw error;\n});\n","/* istanbul ignore file -- client app file does not need to be tested. */\nimport { parseClientAppConfig } from '@ori/client-app-config';\nimport type { AppProps } from '@ori/outdated-browser-info';\nimport { outdatedBrowserInfo } from '@ori/outdated-browser-info';\n\nexport const render = (rootElement: HTMLElement) => {\n const { config = '' } = rootElement.dataset;\n const outdatedBrowserInfoConfig = parseClientAppConfig(config, ['tenant', 'staticApiUrl']);\n\n if (process.env.NODE_ENV !== 'production' && process.env.REACT_APP_USE_REQUESTLY === '1') {\n // eslint-disable-next-line no-console -- we need to log this info\n console.log('USING REQUESTLY');\n }\n\n outdatedBrowserInfo(outdatedBrowserInfoConfig);\n};\n"],"names":["___CSS_LOADER_URL_IMPORT_0___","URL","___CSS_LOADER_EXPORT___","___CSS_LOADER_URL_REPLACEMENT_0___","push","module","id","stylesInDOM","getIndexByIdentifier","identifier","result","i","length","modulesToDom","list","options","idCountMap","identifiers","item","base","count","concat","indexByIdentifier","obj","css","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","splice","api","domAPI","update","newObj","remove","exports","lastIdentifiers","newList","index","newLastIdentifiers","_i","_index","memo","insert","style","target","styleTarget","document","querySelector","window","HTMLIFrameElement","contentDocument","head","e","getTarget","Error","appendChild","element","createElement","setAttributes","attributes","styleElement","nonce","setAttribute","insertStyleElement","needLayer","btoa","unescape","encodeURIComponent","JSON","stringify","styleTagTransform","apply","parentNode","removeChild","removeStyleElement","styleSheet","cssText","firstChild","createTextNode","_stringToBoolOrDefault","theValue","defaultValue","theConfig","_isConfigDefaults","value","_getDefault","dynamicHandler","cfgDefaults","_resolveDefaultValue","BLOCK_DYNAMIC","FORCE_DYNAMIC","aggregationErrorType","arrayMethodsToPatch","_getOwnPropGetter","name","state","symPrefix","symPostfix","_createDynamicHandler","logger","inPlace","configHandler","message","_a","strGetPlugin","defaultValues","BaseTelemetryPlugin","_b","_doc","strToGMTString","strToUTCString","strCookie","strExpires","strIsCookieUseDisabled","strDisableCookiesUsage","strConfigCookieMgr","_supportsCookies","_allowUaSameSite","_parsedCookieValue","_cookieCache","_globalCookieConfig","rootDefaultConfig","_getDoc","_isMgrEnabled","cookieMgr","_isIgnoredCookie","cookieMgrCfg","_isCfgEnabled","rootConfig","cookieMgrConfig","config","_extractParts","_formatDate","theDate","func","_formatCookieValue","values","_getCookieValue","_setCookieValue","cookieValue","version","instanceName","_dataUid","_canAcceptData","data","_debugListener","listenerFuncs","_aiNamespace","_listenerProxyFunc","STR_WARN_TO_CONSOLE","_logFuncs","_sanitizeDiagnosticText","text","_logToConsole","_InternalLogMessage","DiagnosticLogger","_getLogger","strDocumentMode","strLocation","strConsole","strJSON","strCrypto","strMsCrypto","strReactNative","strMsie","strTrident","strXMLHttpRequest","_isTrident","_navUserAgentCheck","_enableMocks","_useXDomainRequest","_beaconsSupported","_hasProperty","theClass","property","rCamelCase","rNormalizeInvalid","rLeadingNumeric","_createProxyFunction","source","funcName","strDisabledPropertyName","strWithCredentials","strTimeout","STR_KILL_DURATION_HEADER","STR_KILL_DURATION_SECONDS_HEADER","STR_TIME_DELTA_HEADER","strExecutionContextKey","strParentContextKey","strChildrenContextKey","_defaultPerfManager","PerfEvent","PerfManager","doPerfActiveKey","strTelemetryPluginChain","strHasRunFlags","strGetTelCtx","_chainId","_createInternalContext","telemetryChain","core","startAt","proxy","UInt32Mask","MaxUInt32","SEED1","SEED2","_mwcSeeded","_mwcW","_mwcZ","_mwcSeed","seedValue","_autoSeedMwc","pluginStateData","_maxHooks","_hookAddMonitor","DEFAULT_VERSION","INVALID_VERSION","INVALID_TRACE_ID","INVALID_SPAN_ID","_isValid","len","invalidValue","_formatValue","defValue","_formatFlags","defaultReactExtensionConfig","AITrackedComponentBase","AppInsightsContext","useAppInsightsContext","trackedData","strShimFunction","strShimObject","strShimUndefined","strShimPrototype","ObjClass","Object","ObjProto","strHasOwnProperty","__assignFn","t","s","n","arguments","p","call","extendStaticsFn","d","b","__proto__","Array","__extendsFn","__","this","constructor","String","__spreadArrayFn","to","from","il","j","_canUseLocalStorage","undefined","_canUseSessionStorage","_storagePrefix","_getLocalStorageObject","_getVerifiedStorageObject","storageType","_getSessionStorageObject","Trace","DataPoint","Metric","PageView","PageViewPerformance","IS_FRAME","PARSE_FILENAME_LINE_COL","PARSE_FILENAME_LINE_ONLY","NoMethod","strError","strStack","strStackDetails","strErrorSrc","strMessage","strDescription","_parseSequence","frame","_stringify","convertToString","_formatMessage","theEvent","errorType","_isStackDetails","details","_convertStackObj","errorStack","_getStackFromErrorObj","errorObj","errorMessage","_parseStack","stack","_getErrorType","Exception","exDetailsAiDataContract","_toInterface","stackDetails","_parseFilename","theFrame","fileName","_handleFilename","sequence","matches","stackFrameAiDataContract","_populateFrameSizeInBytes","_document","_htmlAnchorIdx","_htmlAnchorElement","_internalEndpoints","_correlationIdPrefix","RemoteDependencyData","strAttachEvent","strAddEventHelper","strDetachEvent","strRemoveEventListener","strEvents","strVisibilityChangeEvt","strPageHide","strUnload","strBeforeUnload","strPageHideNamespace","rRemoveEmptyNs","rRemoveTrailingEmptyNs","_guid","elmNodeData","eventNamespace","_normalizeNamespace","_getEvtNamespace","eventName","evtNamespace","_getRegisteredEvents","evtName","addDefault","_doDetach","handlerRef","useCapture","_doUnregister","events","unRegFn","_addEventListeners","listener","excludeEvents","aiInstrumentHooks","cbNames","_arrLoop","arr","fn","_doCallbacks","hooks","callDetails","cbArgs","hookCtx","type","_getOwner","checkPrototype","checkParentProto","_createInstrumentHook","owner","callbacks","aiHook","PageViewManager","botAgentNames","_isPerformanceTimingSupported","_isPerformanceTimingDataReady","_getPerformanceTiming","_getPerformanceNavigationTiming","_shouldCollectDuration","PageViewPerformanceManager","PageVisitTimeManager","PageVisitData","Timing","_dispatchEvent","evnt","_chkConfigMilliseconds","_updateStorageUsage","extConfig","_debugState","_debugResult","_debugHandled","AnalyticsPlugin","error","STR_PROMISE","REJECTED","doAwaitResponse","cb","doAwait","status","rejected","reason","resolveFn","rejectFn","finallyFn","then","err","doFinally","finally","_promiseDebugEnabled","_hasInitEvent","STRING_STATES","DISPATCH_EVENT","_hasInitEventFn","doc","evt","createEvent","initEvent","_hasPromiseRejectionEvent","NODE_UNHANDLED_REJECTION","UNHANDLED_REJECTION","toLowerCase","_currentPromiseId","_uniquePromiseId","dumpFnObj","toString","_createPromise","newPromise","processor","executor","_settledValue","_thePromise","additionalArgs","_state","_hasResolved","_queue","_id","_parentId","_handled","_unHandledRejectionHandler","_then","onResolved","onRejected","cancel","resolve","reject","handler","_processQueue","pop","_strState","pending","slice","_createSettleIfFn","newState","allowState","_notifyUnhandledRejection","process","emit","gbl","v","populateEvent","useNewEvent","theEvt","Event","theConsole","emitEvent","onFinally","thenFinally","catchFinally","get","thePromise","stateFn","resultFn","handledFn","props","_addDebugState","_rejectFn","_createAllPromise","input","idx","_createAllSettledPromise","processItem","syncItemProcessor","createAsyncPromise","timeout","callbackTimeout","timeoutItemProcessor","_promiseCls","createNativePromise","PrmCls","_allSyncSettledCreator","createSyncPromise","_promiseCreator","createPromise","createAllPromise","F","M","ON","OFF","field","ftVal","EVENT_NAME","udfVal","_defaultConfig","CfgSyncPlugin","_disableEvents","_noResponseQs","STR_POST_METHOD","SenderPostManager","_aiNameFunc","baseName","_aiApplication","_aiDevice","_aiLocation","_aiOperation","_aiSession","_aiUser","_aiCloud","_aiInternal","ContextTagKeys","Envelope","Data","strBaseType","strBaseData","strProperties","strTrue","_setValueIf","_extractPropsAndMeasurements","properties","measurements","_convertPropsUndefinedToCustomDefinedValue","customUndefinedValue","_createEnvelope","envelopeType","telemetryItem","env","EnvelopeCreatorInit","BaseSendBuffer","ArraySendBuffer","PREVIOUS_KEYS","SessionStorageSendBuffer","Serializer","HashCodeScoreGenerator","SamplingScoreGenerator","Sample","UNDEFINED_VALUE","_getResponseText","xhr","defaultAppInsightsChannelConfig","httpXHROverride","EnvelopeTypeCreator","Sender","ThrottleMgr","_runScheduledListeners","asyncNotifications","_runListeners","listeners","callback","NotificationManager","TelemetryInitializerPlugin","_initializers","telemetryInitializer","strValidationError","strSdkUnloadingError","defaultConfig","_createPerfManager","notificationMgr","_isPluginPresent","thePlugin","plugins","_deepMergeConfig","newValues","merge","_findWatcher","newWatcher","AppInsightsCore","channelPriority","allExtensions","unloadContainer","notificationManager","debugListener","unloadHook","_calcPerfDuration","resourceEntry","start","end","_setPerfDuration","_setPerfValue","XHRMonitoringState","ajaxRecord","ajaxData","dependency","strDiagLog","AJAX_DATA_CONTAINER","STR_FETCH","ERROR_HEADER","ERROR_PREFIX","ERROR_POSTFIX","ERROR_NOT_SENT","CORRELATION_HEADER_ERROR","CUSTOM_REQUEST_CONTEXT_ERROR","FAILED_TO_CALCULATE_DURATION_ERROR","_markCount","_getAjaxData","_isHeaderSet","_getFailedAjaxDiagnosticsMessage","ajaxDataId","_throwInternalCritical","ajaxMonitorInstance","msgId","isUserAct","_throwInternalWarning","_createErrorCallbackFunc","internalMessage","_indexOf","match","_addHandler","container","theFunc","_processDependencyContainer","BLOB_CORE","_internalExcludeEndpoints","AjaxMonitor","init","Application","Device","Internal","Location","Session","_SessionManager","TelemetryTrace","_validateUserInput","User","strExt","strTags","_removeEmpty","_nullResult","undefString","TelemetryContext","nullValue","_internalSdkSrc","_ignoreUpdateSnippetProperties","IKEY_USAGE","CDN_USAGE","SDK_LOADER_VER","default_throttle_config","defaultConfigValues","AppInsightsSku","ApplicationInsightsContainer","Constructor","Prototype","strFunction","DynInstFuncTable","DynProxyTag","DynClassName","DynClassNamePrefix","DynInstChkTag","DynAllowInstChkTag","DynProtoDefaultOptions","UnknownValue","str__Proto","DynProtoBaseProto","DynProtoGlobalSettings","DynProtoCurrent","strUseBaseInst","strSetInstFuncs","Obj","_objGetPrototypeOf","_objGetOwnProps","_gbl","_gblInst","o","_isObjectOrArrayPrototype","_isObjectArrayOrFunctionPrototype","Function","_getObjProto","newProto","curProto","_forEachProp","lp","_isDynamicCandidate","skipOwn","_throwTypeError","_hasVisited","_populatePrototype","proto","className","baseInstFuncs","setInstanceFunc","_createDynamicPrototype","dynProtoProxy","instFunc","currentDynProtoProxy","instFuncTable","canAddInst","objProto","visited","protoFunc","_getInstFunc","_getProtoFunc","_getObjName","unknownValue","dynamicProto","delegateFunc","classProto","thisTarget","thisProto","_checkPrototype","perfOptions","useBaseInst","instFuncs","_getInstanceFuncs","baseFuncs","_instFuncProxy","funcHost","baseProto","_getBaseFuncs","_pureAssign","func1","func2","_pureRef","_primitiveTypes","UNDEF_VALUE","NULL_VALUE","EMPTY","FUNCTION","OBJECT","PROTOTYPE","__PROTO__","UNDEFINED","CONSTRUCTOR","SYMBOL","POLYFILL_TAG","LENGTH","NAME","CALL","TO_STRING","StrCls","StrProto","MathCls","Math","ArrCls","ArrProto","ArrSlice","safe","argArray","_createIs","theType","_createObjIs","theName","objToString","isUndefined","isNullOrUndefined","isDefined","arg","isPrimitiveType","indexOf","isString","isFunction","isObject","isArray","isDate","isNumber","isBoolean","isError","isPromiseLike","isTruthy","objGetOwnPropertyDescriptor","objHasOwnProperty","prop","hasOwnProperty","objHasOwn","polyObjHasOwn","objForEachKey","theObject","callbackfn","thisArg","propMap","c","w","g","_createProp","l","desc","set","newValue","key","objDefineProp","objDefineProperties","objDefineAccessors","getProp","setProp","configurable","enumerable","objDefine","propDesc","_createKeyValueMap","keyType","valueType","completeFn","writable","theMap","_assignMapValue","asString","ERROR_TYPE","dumpObj","object","format","propertyValueDump","objType","replace","throwError","throwTypeError","TypeError","_objFreeze","_doNothing","_getProto","objAssign","objKeys","objDeepFreeze","objFreeze","objGetPrototypeOf","createEnum","createEnumKeyMap","createTypeMap","mapClass","createSimpleMap","_globalCfg","_wellKnownSymbolMap","asyncIterator","hasInstance","isConcatSpreadable","iterator","matchAll","search","species","split","toPrimitive","toStringTag","unscopables","GLOBAL_CONFIG_KEY","_getGlobalValue","globalThis","self","_getGlobalConfig","_unwrapFunction","_unwrapFunctionWithPoly","clsProto","polyFunc","clsFn","theArgs","_unwrapProp","propName","mathMin","mathMax","strSlice","strSubstring","strSubstr","polyStrSubstr","strLeft","_polySymbols","_wellKnownSymbolCache","_globalLazyTestHooks","UNIQUE_REGISTRY_ID","_globalSymbolRegistry","gblCfg","gblSym","k","polyNewSymbol","description","theSymbol","polySymbolFor","registry","_initTestHooks","getLazy","lazyValue","lzy","createCachedValue","toJSON","_cachedGlobal","WINDOW","_getGlobalInstFn","getFn","cachedValue","getGlobal","useCached","getInst","hasDocument","getDocument","hasWindow","getWindow","hasNavigator","getNavigator","hasHistory","getHistory","_symbol","_symbolFor","isNode","versions","node","isWebWorker","WorkerGlobalScope","_initSymbol","_getSymbolKey","_iterSymbol","hasSymbol","getSymbol","getKnownSymbol","noPoly","knownName","sym","polyGetKnownSymbol","newSymbol","symbolFor","isIterator","next","isIterable","isStrictNullOrUndefined","iterForOf","iter","iterResult","done","failed","throw","return","fnApply","arrAppend","elms","elm","arrForEach","theArray","arrIndexOf","arrMap","arrSlice","arrReduce","_isProtoArray","_unsupportedError","objCreate","polyObjCreate","tempFunc","objSetPrototypeOf","_setName","baseClass","createCustomError","constructCb","errorBase","theBaseClass","orgName","captureFn","captureStackTrace","_createCustomError","_this","_self","orgProto","throwUnsupported","utcNow","Date","now","polyUtcNow","getTime","_createTrimFn","exp","strTrim","mathFloor","_fnToString","_objCtrFnString","_gblWindow","isPlainObject","ex","_defaultDeepCopyHandler","plainObjDeepCopyHandler","defaultDeepCopyHandlers","copyTo","_deepCopy","visitMap","ctx","userHandler","newPath","path","newCtx","src","isPlain","isPrim","origin","newKey","_copyProps","theEntry","entry","_getSetVisited","newEntry","_doExtend","theArg","objCopyProps","deepExtend","obj1","obj2","obj3","obj4","obj5","obj6","objExtend","_perf","getLength","getPerformance","mathRound","strSplit","setValueByKey","parts","lastKey","strEndsWith","polyStrEndsWith","searchString","searchValue","strIndexOf","REF","UNREF","HAS_REF","ENABLED","_createTimerHandler","startTimer","refreshFn","cancelFn","theTimerHandler","ref","timerId","_unref","_cancel","_refresh","refresh","h","_createTimeoutWith","overrideFn","isArr","setFn","setTimeout","clearFn","clearTimeout","timerFn","dn","scheduleTimeout","createTimeout","_class","_AuthorizationCodeTokenClient","_axios","require","_jsCookie","_interopRequireDefault","_constants","_OidcTokenStorage","_OidcIdToken","_OidcToken","_singleton","singleton","AuthorizationCodeTokenClient","_defineProperty2","default","storage","OidcTokenStorage","accessToken","user","idToken","authCode","authorizationCode","requestToken","authCodeTokenData","OidcToken","access_token","getClaim","UNKNOWN_USER","setAccessToken","ExpirationDate","expires_in","Token","Cookies","LOGGED_IN_USER_COOKIE","OidcIdToken","id_token","setIdToken","redirectUri","codeVerifier","tokenRequest","fetch","SafeURL","identityUrl","location","REQUEST_OPTIONS","body","URLSearchParams","client_id","clientId","grant_type","code","redirect_uri","code_verifier","response","ok","statusText","json","credentials","headers","method","_CryptoUtils","_getRandomInt","RANDOM_NUMBER_UPPER_BOUND","oauthOptions","OidcClient","getRandomInt","callbackUrl","CryptoUtils","generateCodeVerifier","codeChallenge","generateCodeChallenge","redirectUrl","url","acr_values","acrValues","prompt","response_type","scope","code_challenge_method","code_challenge","href","OidcUrlHelper","params","validateParams","AUTH_CODE","errorParam","stateParam","_TokenRoutes","_AuthCookies","_TokenFetcher","_logger","_SessionTokenStorage","mainLogger","createChild","providedUrlIsValid","TokenRoutes","includes","warn","PUBLIC_ACCESS","tokenConfiguration","tokenConfigurationForTokenRoutes","SessionTokenStorage","sessionStorageKey","addEventListener","removeEventListener","refreshToken","getTokenData","getToken","clearTokenData","newTokenData","isForUserToken","AuthCookies","hasAuthorizedUserValue","setTokenData","setRefreshTimeout","TokenFetcher","requestOptions","tokenData","isTimeoutSet","getTokenRefreshTime","event","CustomEvent","detail","dispatchEvent","_tokenData","token","dispatchTokenUpdated","timeToRefresh","parse","TokenClient","TokenEventNames","_internals","_storage","TokenService","instance","getInstance","customerId","Number","NOT_LOGGED_IN_USER_ID","getTokenServiceUserToken","getSessionStorageToken","getTokenServicePublicToken","oidcTokenStorage","getAccessToken","userTokenClient","publicTokenClient","UserTokenClient","PublicTokenClient","TokenSessionStorageKeys","LIBRARY_NAME","_TokenEventNames","_TokenSessionStorageKeys","USER_ACCESS","keys","forEach","defineProperty","_OidcClient","_OidcUrlHelper","_TokenClient","_TokenService","_reactIntegration","_tokens","_decodeToken","_isTokenValid","_doDevelopmentLogin","_isAuthenticatedCustomer","_validateLoggedInUserCookie","getAuthorizedUserValue","loggedInUserCookie","validateLoggedInUserCookie","hashFromKeys","storageSpace","ori","_tokenRequestsStorage","Map","objectToHash","getStorage","isStorageItemExpired","itemResolved","upsertStorageItem","factory","isStorageItemMissing","delete","createStorageKey","removeStorageItem","ExpirationSeconds","expirationDate","setSeconds","getSeconds","toISOString","replaceAll","decoded","decodeToken","remaining","floor","_PublicTokenClient","_UserTokenClient","getTokenClients","_cleanToken","_getRemainingSeconds","_getTokenClients","_getRequireWildcardCache","WeakMap","r","loggedInUserCookieSchema","__esModule","has","a","getOwnPropertyDescriptor","u","_interopRequireWildcard","string","regex","cookieContent","safeParse","success","_constantsGenerated","Logger","PACKAGE_NAME","teamName","TEAM_NAME","_useToken","IfAnonymousUser","children","useToken","isAnonymousUser","IfLoggedInUser","LegacyTokenService","tokenService","getUserAccessToken","getPublicToken","getPublicAccessToken","MockedTokenProvider","_react","_tokenContext","_jsxRuntime","PrefetchedTokenProvider","initialToken","cleanToken","isTokenValid","contextValue","useMemo","formattedToken","isUserVerified","jsx","tokenContext","Provider","StandaloneTokenProvider","useState","clientToken","setClientToken","isAnonymous","setIsAnonymous","setIsUserVerified","useEffect","getAuthorizationToken","fetchedToken","fetchToken","catch","cause","remainder","getRemainingSeconds","timer","info","tokenValue","_useUniversalToken","UniversalTokenProvider","useUniversalToken","_IfAnonymousUser","_IfLoggedInUser","_LegacyTokenService","_MockedTokenProvider","_PrefetchedTokenProvider","_StandaloneTokenProvider","_UniversalTokenProvider","React","createContext","useContext","cleanInitialToken","validInitialToken","updateTokenData","newToken","decodedToken","customer_id","tokenChangedListener","bindTokenUpdated","unbindTokenUpdated","_SessionStorage","SessionStorage","removeItem","USER_TOKEN_STORAGE_KEY","ANONYMOUS_TOKEN_STORAGE_KEY","userToken","getItem","anonymousToken","setItem","CombinedSessionItem","_CombinedSessionItem","CombinedTokenStorage","_OidcAccessToken","_SessionValue","SessionValue","AUTHORIZATION_CODE_STORAGE_KEY","ID_TOKEN_STORAGE_KEY","AUTH_REDIRECT_URL_STORAGE_KEY","AUTH_REDIRECT_URI_STORAGE_KEY","CODE_VERIFIER_STORAGE_KEY","AUTH_STATE_STORAGE_KEY","NONCE_STORAGE_KEY","OidcAccessToken","oidcIdToken","_isSessionStorageSupported","isSessionStorageAvailable","isSessionStorageSupported","sessionStorage","prefix","filter","keyName","tokenStorageKey","validateStored","newStorageValue","getTokenUser","createStorageItem","existingUserInsideToken","PUBLIC_TOKEN_USER","storedData","cleanStored","test","isNewAuthCookie","_CombinedTokenStorage","_StorageItem","_TokenStorage","args","_jwtDecode","claim","payload","jwtDecode","_Token","_TokenData","_core","_encBase","_sha","CryptoJS","lib","WordArray","random","words","_randomWord","generateUUIDv4","hashed","sha256","Base64","oidcUrlHelper","tenant","searchParams","hash","tokenClient","IDENTITY_CLIENT_ID","storeAuthCodeFromParams","initializeTokenFromAuthorizationCode","handleRedirectAfterLogin","doLogin","doDevelopmentLogin","min","max","ceiledMin","ceil","flooredMax","getRandomNumber","crypto","getRandomValues","Uint32Array","TEST","tokenPayload","_Singleton","Singleton","_joinPathSegments","pathname","baseAsURL","joinPathSegments","settle","validateStatus","AxiosError","ERR_BAD_REQUEST","ERR_BAD_RESPONSE","request","normalizeValue","map","rawHeaders","Headers","entries","Request","getUrl","keepalive","ERR_NETWORK","fromEntries","responseType","arrayBuffer","axiosResponse","blob","getRequest","promiseChain","Promise","timeoutErrorMessage","axios","ECONNABORTED","race","fetchAdapter","_fetchAdapter","ttl","maxAge","generateKey","buildKeyGenerator","setupCache","create","_axiosCacheInterceptor","prototype","_exportNames","_adapters","_createAxiosWithCache","_SafeURL","_fixExcessiveSlashing","requestUrl","startsWith","baseURL","baseURLObject","fixExcessiveSlashing","append","_getUrl","pathnames","Boolean","join","_ClientAppDataConfig","_parseClientAppConfig","_isValidClientAppConfigProperty","_safeParseJson","jsonString","SafeParseJsonError","messageParameters","_error","JSON_NOT_PROVIDED","JSON_NOT_VALID","requiredProperties","parsedClientAppConfig","safeParseJson","isValidClientAppConfigProperty","ParseClientAppConfigError","MISSING_PROPERTY","UNKNOWN_ERROR","errorName","errorMessages","errorCode","createErrorMessage","errorOptions","InternalCustomError","INTERNAL_ERROR_MESSAGES","errorData","_createCustomErrorWithData","_types","ERROR_MESSAGE_TOKEN_PATTERN","_createErrorMessage","_CustomError","_CustomErrorOptions","_CustomErrorWithData","_CustomErrorWithDataOptions","_ErrorMessages","_contentTypes","_headers","_statusCodes","query","EmptyBodyFetchGraphqlError","FetchGraphqlError","axiosError","graphqlQuery","variables","trimGraphqlQuery","FormattedAxiosError","NonOkResponseFetchGraphqlError","_EmptyBodyFetchGraphqlError","_FetchGraphqlError","_NonOkResponseFetchGraphqlError","raw","_useGraphqlQuery","skip","fetcherOptions","swrConfig","createCacheKey","onError","useSWRConfig","cache","cacheKey","createSimplifiedCacheKey","configForSWR","use","fallbackData","initialDataMiddleware","revalidateOnMount","unstable_serialize","useSWR","fetchGraphql","_swr","_middleware","_utils","_errors","_hooks","_gql","_mutation","_initialDataMiddleware","useSWRNext","fetcher","hasMounted","useRef","fallbackConfig","current","swr","mutate","_defaultHeaders","_isEmptyObject","headersForCacheKey","hasOwn","AUTHORIZATION","isEmptyObject","_tsUtils","_handleResponse","requestConfig","DEFAULT_TIMEOUT","console","requestData","post","handleResponse","onSuccess","isNonNullable","error_","rethrowError","_auth","_prepareToken","getHeaders","sourceAppName","language","CONTENT_TYPE","JSON_CONTENT","formatToken","CLIENT_APPLICATION","ACCEPT_LANGUAGE","isAuthenticatedCustomer","CUSTOMER_CONTEXT","TENANT_CONTEXT","STATUS_OK","_createSimplifiedCacheKey","_fetchGraphql","_getHeaders","_validateStatus","BEARER","composeToken","STATUS_INTERNAL_SERVER_ERROR","_Logger","_cloneDeep","_deepmerge","_pino","_pinoStdSerializers","_applicationInsights","_formatError","_LoggerBrowserConfiguration","_isPlainObject","_loggerEventEmitter","_pinoBrowserRuntimeTransport","_createMetadataDependencyInitializer","_SeverityLevels","isInBrowserRuntime","isInNodeRuntime","parentLoggerDefaultMessageMetadata","childLoggerDefaultMessageMetadata","loggerMetadataOrAreaName","loggerMetadata","cloneDeep","areaName","messageMetadata","incommingChildMetadata","deepmerge","initializeChild","parent","getPinoParent","setupOptions","pinoChild","child","getPinoChild","createPinoMessage","additionalMeta","metadata","isMergeableObject","metadataWithoutTeamName","globalMetadata","ApplicationInsights","isInitialized","isServerApplicationInsightsClient","context","getForServer","getCorrelationContext","operation","parentId","applicationInsightsOperation","causeMessage","pinoMessage","formatError","ERROR","metricName","metricValue","METRIC","INFO","debug","DEBUG","WARN","setBindings","setMetadata","bindings","storedMetadata","getStore","_globalMetadata","assign","metadataDependencyInitializer","createMetadataDependencyInitializer","getForClient","updateGlobalMetadata","pinoParent","trackPageView","isPageViewTracked","TRACK_THIS_PAGE_VIEW","initializeConfiguration","currentBrowserConfiguration","LoggerBrowserConfiguration","setConfiguration","localStorageListener","withPinoConfigurationNodeTransports","transport","pipeline","loggerConfiguration","getConfiguration","applicationInsightsConfiguration","global","oriAppInsightsSettings","withPinoConfigurationBrowserTransports","pinoBrowserRuntimeTransport","browser","write","pinoOptions","useOnlyCustomLevels","customLevels","SeverityLevels","level","serializers","pinoSerializers","errWithCause","pino","initializeParent","nextConfiguration","configuration","defaultLoggerConfiguration","loggerEventEmitter","transportType","enabled","filters","some","byTransportType","updateConfiguration","_applicationinsightsReactJs","_applicationinsightsWeb","_EventEmitter","_pageViewInitializer","_createFilterTelemetryProcessor","_createFixedRateSampler","_enhanceDependencyDataProcessor","_excludeHealthProbesTelemetryProcessor","_excludeNextjsTelemetryProcessor","_ApplicationInsightsNotInitializedError","_isServerApplicationInsightsClient","realApplicationInsights","ApplicationInsightsNotInitializedError","eventListener","eventEmitter","addListener","removeListener","initialize","fallbackOptions","connectionString","samplingPercentage","isInEdgeRuntime","EdgeRuntime","extensions","extensionConfig","browserHistory","listen","history","reactPlugin","ReactPlugin","applicationInsights","ClientApplicationInsights","loadAppInsights","addTelemetryInitializer","pageViewInitializer","createFilterTelemetryProcessor","envelope","baseType","createFixedRateSampler","appInsights","serverApplicationInsights","setup","setAutoCollectExceptions","isMainThread","setSendLiveMetrics","setAutoCollectConsole","setAutoCollectRequests","setAutoCollectPerformance","setAutoDependencyCorrelation","setAutoCollectIncomingRequestAzureFunctions","defaultClient","addTelemetryProcessor","excludeHealthProbesTelemetryProcessor","excludeNextjsTelemetryProcessor","enhanceDependencyDataProcessor","EventEmitter","_ApplicationInsights","getApplicationInsightsReactPlugin","ai","find","extension","getClientApplicationInsightsConfig","_ApplicationInsightsLike","_getApplicationInsightsReactPlugin","_getClientApplicationInsightsConfig","_ServerApplicationInsights","minimalSeverityLevel","LoggerTransportType","APPLICATION_INSIGHTS","providedError","isAxiosError","NO_RESPONSE_STATUS_CODE","baseUrl","toUpperCase","statusCode","dataAsJson","numberOfChars","responseBody","innerCallstack","_measureFunctionDuration","_loggerConfigurationSchema","_nodeEvents","isBrowser","isEventTarget","manager","EventTarget","NodeEventEmitter","listenerToBrowserEventListeners","listenerReference","eventListenerUnderReference","LOCAL_STORAGE_KEY","localStorageValue","localStorage","loggerConfigurationSchema","partial","parsed","validated","mergedWithCurrent","handlers","onInfo","onMetric","onWarn","onDebug","_definePinoLogHandlers","DeserializedError","getServerApplicationInsightsTagOverrides","definePinoLogHandlers","serializedOrNormalError","otherMessageProperties","time","msg","errorCause","otherProperties","errorProperties","causeName","causeStack","otherCauseProperties","exception","trackException","severity","Contracts","SeverityLevel","tagOverrides","otherMesageProperties","trackMetric","average","trackTrace","Warning","severityLevel","levelToConsoleMethod","_ansis","_isObject","_stringifyErrorObject","_stringifyObject","levelToColoretteFunctionName","ansis","blue","green","red","yellow","gray","bgWhite","logLevelToLabel","pinoConsoleLogHandler","userMessage","formattedTime","Intl","DateTimeFormat","hour","minute","second","fractionalSecondDigits","hour12","formatTime","logLinePrefix","logLine","propertiesWithoutError","dim","stringifyObject","stringifyErrorObject","logParams","log","_pinoApplicationInsightsLogHandler","_pinoConsoleLogHandler","pinoApplicationInsightsLogHandler","CONSOLE","canRunLogHandler","loggingEnabled","canRunHandler","shouldRunForRule","byName","byAreaName","byNameRegExp","byAreaNameRegExp","byMinimalSeverityLevel","pid","hostname","_pinoGroupedLogHandlers","isTransportTypeEnabled","getEnabledLogHandlersForTransport","enabledLogHandlers","isApplicationInsightsTransportEnabled","isConsoleTransportEnabled","pinoGroupedLogHandlers","size","_canRunLogHandler","_filterPinoMessage","_getEnabledLogHandlersForTransport","updatedLoggerConfiguration","logHandler","filterPinoMessage","_pinoAbstractTransport","pinoNodeRuntimeTransport","build","transform","trace","NEWLINE_CHAR","leftPad","line","bold","inputValue","oneLineOnly","seen","indent","pad","tokens","newline","newlineOrSpace","Buffer","returnValue","elements","eol","objectKeys","getOwnPropertyNames","getOwnPropertySymbols","propertyIsEnumerable","isSymbol","isClassic","output","x","currentMetadata","addDependencyInitializer","newMetadata","filterFn","sampler","telemetryRecord","telemetryId","tags","percentage","samplingRate","hashValue","SHA256","enc","Hex","parseInt","hashTelemetryId","customProps","correlationContext","customProperties","flattenedProps","baseData","_zod","_LoggerTransportType","zodRegexOrRegexpLikeString","z","custom","RegExp","severityLevelKeys","severityLevelValues","allowedSeverityOptions","Set","zodCoerceSeverityLevel","loggerConfigurationFilterSchema","optional","nativeEnum","coerce","boolean","array","t0","performance","t1","duration","AppInsightsProvider","setAppInsights","onInitialized","_InternalErrorBoundary","_loggerContext","ErrorBoundary","fallback","rest","paramLogger","parentLogger","loggerContext","InternalErrorBoundary","LoggerProvider","_AppInsightsProvider","_ErrorBoundary","_LoggerProvider","_useLogger","errorInfo","setState","Component","useLogger","_nodeAsync_hooks","AsyncLocalStorage","_ChildLogger","_LoggerApplicationInsightsConfig","_LoggerLike","_LoggerMetadata","_LoggerMetadataPrimitiveValue","_MessageMetadata","_AtLeastOneRequired","_DeepMutable","_DeepPartial","_DeepReadonly","_Equals","_If","_IsEqual","_LiteralUnion","_NonArray","_NonArrayLike","_NonOptionalKeys","_OptionalKeys","_Parameters","_Primitive","_ReturnType","_Simplify","_TupleToUnion","_UncapitalizeKeys","_UncapitalizeObjectKeys","_UnionToIntersection","_UnpackPromise","condition","AssertionError","_assert","_is","_isNonNullable","isMatched","setPrototypeOf","round","exec","Deno","argv","toObject","PM2_HOME","pm_id","NEXT_RUNTIME","isatty","stdout","isTTY","isNaN","f","TERM","truecolor","ansi256","ansi","COLORTERM","TF_BUILD","CI","os","platform","NO_COLOR","chrome","open","close","_","m","y","O","$","T","bgAnsi256","fg","bg","rgb","bgRgb","hex","bgHex","visible","reset","italic","underline","inverse","hidden","R","E","grey","bgGrey","bgGray","strikethrough","strike","C","I","_p","Ansis","isSupported","strip","extend","$bu_","vsakt","ios","samsung","e_a","o_a","uc","vsinsecure_below","vsdefault","names","silk","get_browser","ua","navigator","userAgent","age_years","no_device_update","available","ignore","pattern","other","embedded","mobile","discontinued","pats","VV","engine","fullv","$1","parseFloat","maxTouchPoints","av","available_ios","is_insecure","is_supported","is_latest","less","vmaj","esr","releases_per_year","engine_version","semver","vstr","v1","v2","diff","screen","height","width","pr","devicePixelRatio","$bu_getBrowser","op","ll","_buorgres","languages","browserLanguage","userLanguage","documentElement","getAttribute","llfull","substr","domain","apiver","jsv","required_min","vs","notify","required","reminder","reminderClosed","onshow","onclick","onclose","pageurl","newwindow","ignorecookie","reasons","hide_reasons","notified","bb","override_ua","is_below_required","notify_esr","insecure","unsecure","unsupported","check_show","already_shown","cookie","setCookie","hours","toGMTString","nomessage","$buo_show","burl","url_permanent_hide","ta","en","ar","ca","cs","cy","da","de","el","es","et","fa","fi","fr","gl","he","hi","hu","it","ja","ko","lt","lv","ms","nl","no","nn","nb","pl","pt","ro","ru","sk","sl","sq","sr","sv","th","tr","uk","uz","vi","zh","custom_text","msgmore","bupdate","bignore","tar","div","style2","busprintf","innerHTML","addmargin","insertBefore","updatebutton","getElementById","noclose","display","shift_page_down","hm","marginTop","bodymt","cursor","getElementsByTagName","clientHeight","ignorebutton","no_permanent_hide","bnever","remind","opacity","visibility","dont_show_debuginfo","clone","typeOf","val","instanceClone","res","cloneObjectDeep","cloneArrayDeep","isObjectObject","ctor","prot","BlockCipher","C_algo","algo","SBOX","INV_SBOX","SUB_MIX_0","SUB_MIX_1","SUB_MIX_2","SUB_MIX_3","INV_SUB_MIX_0","INV_SUB_MIX_1","INV_SUB_MIX_2","INV_SUB_MIX_3","xi","sx","x2","x4","x8","RCON","AES","_doReset","_nRounds","_keyPriorReset","_key","keyWords","keySize","sigBytes","ksRows","keySchedule","_keySchedule","ksRow","invKeySchedule","_invKeySchedule","invKsRow","encryptBlock","offset","_doCryptBlock","decryptBlock","nRounds","s0","s1","s2","s3","t2","t3","_createHelper","define","N","ORIG_P","ORIG_S","BLOWFISH_CTX","pbox","sbox","BlowFish_Encrypt","left","right","temp","Xl","Xr","Blowfish","keysize","Row","Col","keyIndex","Data1","Data2","BlowFishInit","BlowFish_Decrypt","blockSize","ivSize","C_lib","Base","BufferedBlockAlgorithm","C_enc","EvpKDF","Cipher","C_mode","BlockCipherMode","CBC","Pkcs7","CipherParams","OpenSSLFormatter","SerializableCipher","OpenSSLKdf","PasswordBasedCipher","Utf8","cfg","createEncryptor","_ENC_XFORM_MODE","createDecryptor","_DEC_XFORM_MODE","xformMode","_xformMode","dataUpdate","_append","_process","finalize","_doFinalize","selectCipherStrategy","cipher","encrypt","decrypt","ciphertext","StreamCipher","mode","iv","Encryptor","Decryptor","_cipher","_iv","xorBlock","block","_prevBlock","processBlock","thisBlock","blockSizeBytes","nPaddingBytes","paddingWord","paddingWords","padding","unpad","modeCreator","_minBufferSize","_mode","__creator","_doProcessBlock","finalProcessedBlocks","_data","cipherParams","mixIn","formatter","OpenSSL","salt","openSSLStr","ciphertextWords","encryptor","cipherCfg","algorithm","_parse","kdf","execute","password","hasher","compute","derivedParams","msCrypto","cryptoSecureRandomInt","randomBytes","readInt32LE","subtype","overrides","$super","propertyName","encoder","wordArray","thisWords","thatWords","thisSigBytes","thatSigBytes","clamp","thatByte","nBytes","hexChars","bite","hexStr","hexStrLength","Latin1","latin1Chars","fromCharCode","latin1Str","latin1StrLength","charCodeAt","decodeURIComponent","escape","utf8Str","_nDataBytes","doFlush","processedWords","dataWords","dataSigBytes","nBlocksReady","nWordsReady","nBytesReady","Hasher","messageUpdate","_createHmacHelper","HMAC","_map","base64Chars","triplet","charAt","paddingChar","base64Str","base64StrLength","reverseMap","_reverseMap","paddingIndex","bitsCombined","parseLoop","Base64url","urlSafe","_safe_map","swapEndian","word","Utf16","Utf16BE","utf16Chars","codePoint","utf16Str","utf16StrLength","Utf16LE","MD5","iterations","derivedKey","derivedKeyWords","_hasher","hasherBlockSize","hasherBlockSizeBytes","oKey","_oKey","iKey","_iKey","oKeyWords","iKeyWords","innerHash","ArrayBuffer","superInit","subInit","typedArray","Uint8Array","Int8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Float32Array","Float64Array","buffer","byteOffset","byteLength","typedArrayByteLength","abs","sin","_hash","offset_i","M_offset_i","H","M_offset_0","M_offset_1","M_offset_2","M_offset_3","M_offset_4","M_offset_5","M_offset_6","M_offset_7","M_offset_8","M_offset_9","M_offset_10","M_offset_11","M_offset_12","M_offset_13","M_offset_14","M_offset_15","FF","GG","HH","II","nBitsTotal","nBitsLeft","nBitsTotalH","nBitsTotalL","H_i","HmacMD5","CFB","generateKeystreamAndEncrypt","keystream","CTRGladman","incWord","b1","b2","b3","counter","_counter","incCounter","CTR","ECB","OFB","_keystream","AnsiX923","lastBytePos","Ansix923","Iso10126","Iso97971","ZeroPadding","NoPadding","PBKDF2","hmac","blockIndex","blockIndexWords","blockWords","blockWordsLength","intermediate","intermediateWords","S","C_","G","RabbitLegacy","K","X","_X","_C","nextState","IV","IV_0","IV_1","i0","i2","i1","i3","gx","ga","gb","gh","Rabbit","RC4","keySigBytes","_S","keyByteIndex","keyByte","_j","generateKeystreamWord","keystreamWord","RC4Drop","drop","_zl","_zr","_sl","_sr","_hl","_hr","RIPEMD160","al","bl","cl","dl","br","cr","dr","er","hl","hr","zl","zr","f1","f2","f3","f4","f5","rotl","HmacRIPEMD160","W","SHA1","HmacSHA1","SHA224","HmacSHA224","isPrime","sqrtN","sqrt","factor","getFractionalBits","nPrime","pow","gamma0x","gamma0","gamma1x","gamma1","maj","sigma0","HmacSHA256","X64Word","x64","Word","RHO_OFFSETS","PI_INDEXES","ROUND_CONSTANTS","newY","LFSR","roundConstantMsw","roundConstantLsw","bitPosition","SHA3","outputLength","nBlockSizeLanes","M2i","M2i1","lane","high","low","tMsw","tLsw","Tx","Tx4","Tx1","Tx1Msw","Tx1Lsw","laneIndex","laneMsw","laneLsw","rhoOffset","TPiLane","T0","state0","TLane","Tx1Lane","Tx2Lane","roundConstant","blockSizeBits","outputLengthBytes","outputLengthLanes","hashWords","HmacSHA3","C_x64","X64WordArray","SHA512","SHA384","HmacSHA384","X64Word_create","H0","H1","H2","H3","H4","H5","H6","H7","H0h","H0l","H1h","H1l","H2h","H2l","H3h","H3l","H4h","H4l","H5h","H5l","H6h","H6l","H7h","H7l","ah","bh","ch","dh","eh","fh","fl","hh","Wil","Wih","Wi","gamma0xh","gamma0xl","gamma0h","gamma0l","gamma1xh","gamma1xl","gamma1h","gamma1l","Wi7","Wi7h","Wi7l","Wi16","Wi16h","Wi16l","t1l","chh","chl","majh","majl","sigma0h","sigma0l","sigma1h","sigma1l","Ki","Kih","Kil","t1h","t2l","toX32","HmacSHA512","PC1","PC2","BIT_SHIFTS","SBOX_P","SBOX_MASK","DES","keyBits","keyBitPos","subKeys","_subKeys","nSubKey","subKey","bitShift","invSubKeys","_invSubKeys","_lBlock","_rBlock","exchangeLR","exchangeRL","lBlock","rBlock","mask","TripleDES","key1","key2","key3","_des1","_des2","_des3","X32WordArray","x64Words","x64WordsLength","x32Words","x64Word","wordsLength","cssWithMappingToString","content","modules","dedupe","alreadyImportedModules","_k","needQuotes","cssMapping","base64","sourceMapping","isNonNullObject","stringValue","$$typeof","REACT_ELEMENT_TYPE","isReactElement","isSpecial","Symbol","for","cloneUnlessOtherwiseSpecified","defaultArrayMerge","getKeys","symbol","getEnumerableOwnPropertySymbols","propertyIsOnObject","mergeObject","destination","propertyIsUnsafe","customMerge","getMergeFunction","arrayMerge","sourceIsArray","all","reduce","prev","deepmerge_1","dequal","foo","bar","ReflectOwnKeys","Reflect","ReflectApply","receiver","ownKeys","NumberIsNaN","once","emitter","errorListener","resolver","eventTargetAgnosticAddListener","flags","on","addErrorHandlerIfEventEmitter","_events","_eventsCount","_maxListeners","defaultMaxListeners","checkListener","_getMaxListeners","that","_addListener","prepend","existing","warning","newListener","unshift","warned","onceWrapper","fired","wrapFn","_onceWrap","wrapped","bind","_listeners","unwrap","evlistener","ret","unwrapListeners","arrayClone","listenerCount","copy","wrapListener","RangeError","getPrototypeOf","setMaxListeners","getMaxListeners","doError","prependListener","prependOnceListener","position","originalListener","shift","spliceOne","off","removeAllListeners","rawListeners","eventNames","converter","defaultAttributes","expires","toUTCString","stringifiedAttributes","attributeName","cookies","jar","found","read","withAttributes","withConverter","freeze","ctorName","isBuffer","callee","isArguments","toDateString","getDate","setDate","stackTraceLimit","ignoreCase","multiline","isRegexp","isGeneratorObj","tryStringify","opts","ss","objects","argLen","str","lastPos","flen","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","__self","__source","q","defaultProps","_owner","Fragment","jsxs","B","isMounted","enqueueForceUpdate","enqueueReplaceState","enqueueSetState","D","refs","isReactComponent","forceUpdate","isPureReactComponent","J","L","P","Q","A","_status","_result","U","V","transition","ReactCurrentDispatcher","ReactCurrentBatchConfig","Children","toArray","only","Profiler","PureComponent","StrictMode","Suspense","act","cloneElement","_currentValue","_currentValue2","_threadCount","Consumer","_defaultValue","_globalName","_context","createFactory","createRef","forwardRef","render","isValidElement","lazy","_payload","_init","compare","startTransition","unstable_act","useCallback","useDebugValue","useDeferredValue","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useReducer","useSyncExternalStore","useTransition","valueOf","deep","buf","allocUnsafe","cloneBuffer","cloneSymbol","cloneArrayBuffer","cloneTypedArray","re","lastIndex","cloneRegExp","revalidateEvents","lite","_interopDefault","_interopNamespace","React__default","revalidateEvents__namespace","SWRGlobalState","noop","mergeObjects","EMPTY_CACHE","INITIAL_CACHE","STR_UNDEFINED","isWindowDefined","isDocumentDefined","isLegacyDeno","hasRequestAnimationFrame","createCacheHelper","online","onWindowEvent","offWindowEvent","preset","isOnline","isVisible","visibilityState","defaultConfigOptions","initFocus","initReconnect","onOnline","onOffline","IS_REACT_LEGACY","IS_SERVER","useIsomorphicLayoutEffect","navigatorConnection","connection","slowConnection","effectiveType","saveData","table","isObjectType","stableHash","isRegex","sort","serialize","__timestamp","getTimestamp","internalMutate","_opts","populateCache","rollbackOnErrorOption","optimisticData","rollbackOnError","throwOnError","keyFilter","matchedKeys","mutateByKey","EVENT_REVALIDATORS","MUTATION","FETCH","PRELOAD","startRevalidate","beforeMutationTs","hasOptimisticData","displayedData","currentData","committedData","populateCachedData","revalidators","revalidate","MUTATE_EVENT","_c","revalidateAllKeys","initCache","provider","unmount","subscriptions","subscribe","subs","setter","initProvider","releaseFocus","FOCUS_EVENT","releaseReconnect","RECONNECT_EVENT","onLoadingSlow","onErrorRetry","maxRetryCount","errorRetryCount","currentRetryCount","retryCount","errorRetryInterval","onDiscarded","revalidateOnFocus","revalidateOnReconnect","revalidateIfStale","shouldRetryOnError","focusThrottleInterval","dedupingInterval","loadingTimeout","isPaused","mergeConfigs","u1","u2","SWRConfigContext","SWRConfig","parentConfig","isFunctionalConfig","extendedConfig","cacheContextRef","cacheContext","rAF","INFINITE_PREFIX","ERROR_REVALIDATE_EVENT","configContextClient","constants_js","types_js","enableDevtools","__SWR_DEVTOOLS_USE__","normalize","BUILT_IN_MIDDLEWARE","key_","fetcher_","req","__SWR_DEVTOOLS_REACT__","preload","fnArg","subscribeCallback","keyedRevalidators","withArgs","hook","_config","middleware","withMiddleware","uses","index_js$1","index_js","thenable","WITH_DEDUPE","suspense","refreshInterval","refreshWhenHidden","refreshWhenOffline","keepPreviousData","initialMountedRef","unmountedRef","keyRef","fetcherRef","configRef","getConfig","isActive","getCache","setCache","subscribeCache","getInitialCache","stateDependencies","isEqual","returnedData","getSnapshot","shouldStartRequest","getSelectedCache","snapshot","isValidating","isLoading","cachedData","initialData","clientSnapshot","serverSnapshot","memorizedSnapshot","newSnapshot","cached","isInitialMount","hasRevalidator","laggyDataRef","shouldDoInitialRevalidation","defaultValidatingState","revalidateOpts","currentFetcher","newData","loading","shouldStartNewRequest","callbackSafeguard","finalState","finishRequestAndUpdateState","cleanupState","initialState","mutationInfo","cacheData","currentConfig","requestInfo","boundMutate","softRevalidate","nextFocusRevalidatedAt","initNow","unsubEvents","interval","promise","useSWR__default","useSWRMutation","ditchMutationsUntilRef","useStateWithDeps","rerender","stateRef","stateDependenciesRef","shouldRerender","currentState","isMutating","trigger","serializedKey","resolvedKey","mutationStartedAt","objectIs","is","checkIfSnapshotChanged","inst","latestGetSnapshot","nextValue","shim","_useState","ZodError","quotelessJson","ZodIssueCode","util_1","util","arrayToEnum","issues","addIssue","sub","addIssues","actualProto","errors","_mapper","mapper","issue","fieldErrors","processError","unionErrors","returnTypeError","argumentsError","curr","jsonStringifyReplacer","isEmpty","flatten","formErrors","assert","__importDefault","mod","getErrorMap","setErrorMap","defaultErrorMap","en_1","overrideErrorMap","__createBinding","k2","__exportStar","errorUtil","errToObj","isAsync","isValid","isDirty","isAborted","OK","DIRTY","INVALID","ParseStatus","addIssueToContext","EMPTY_PATH","makeIssue","errors_1","errorMaps","issueData","fullPath","fullIssue","maps","reverse","defaultError","overrideMap","common","contextualErrorMap","schemaErrorMap","mergeArray","results","arrayValue","dirty","mergeObjectAsync","pairs","syncPairs","pair","mergeObjectSync","finalObject","alwaysSet","abort","objectUtil","getParsedType","ZodParsedType","assertEqual","assertIs","_arg","assertNever","_x","items","getValidEnumValues","validKeys","filtered","objectValues","checker","isInteger","isFinite","joinValues","separator","mergeShapes","first","nan","number","function","bigint","null","date","unknown","__setModuleDefault","__importStar","ZodError_1","_ctx","invalid_type","received","expected","invalid_literal","unrecognized_keys","invalid_union","invalid_union_discriminator","invalid_enum_value","invalid_arguments","invalid_return_type","invalid_date","invalid_string","validation","endsWith","too_small","exact","inclusive","minimum","too_big","maximum","invalid_intersection_types","not_multiple_of","multipleOf","not_finite","_ZodEnum_cache","_ZodNativeEnum_cache","__classPrivateFieldGet","kind","__classPrivateFieldSet","any","ZodFirstPartyTypeKind","late","ZodSchema","Schema","ZodReadonly","ZodPipeline","ZodBranded","BRAND","ZodNaN","ZodCatch","ZodDefault","ZodNullable","ZodOptional","ZodTransformer","ZodEffects","ZodPromise","ZodNativeEnum","ZodEnum","ZodLiteral","ZodLazy","ZodFunction","ZodSet","ZodMap","ZodRecord","ZodTuple","ZodIntersection","ZodDiscriminatedUnion","ZodUnion","ZodObject","ZodArray","ZodVoid","ZodNever","ZodUnknown","ZodAny","ZodNull","ZodUndefined","ZodSymbol","ZodDate","ZodBoolean","ZodBigInt","ZodNumber","ZodString","datetimeRegex","ZodType","NEVER","union","tuple","transformer","strictObject","record","preprocess","ostring","onumber","oboolean","nullable","never","literal","intersection","effect","discriminatedUnion","errorUtil_1","parseUtil_1","ParseInputLazyPath","_cachedPath","_path","handleResult","processCreateParams","errorMap","invalid_type_error","required_error","iss","def","spa","safeParseAsync","_def","parseAsync","refine","refinement","superRefine","nullish","or","and","brand","describe","pipe","readonly","isNullable","isOptional","vendor","validate","_getType","_getOrReturnCtx","parsedType","_processInputParams","_parseSync","_parseAsync","async","maybeAsyncResult","check","_refinement","setError","getIssueProperties","refinementData","schema","typeName","option","incoming","defaultValueFunc","innerType","catchValueFunc","catchValue","This","emojiRegex","cuidRegex","cuid2Regex","ulidRegex","uuidRegex","nanoidRegex","jwtRegex","durationRegex","emailRegex","ipv4Regex","ipv4CidrRegex","ipv6Regex","ipv6CidrRegex","base64Regex","base64urlRegex","dateRegexSource","dateRegex","timeRegexSource","precision","local","isValidJWT","jwt","alg","header","padEnd","atob","typ","isValidCidr","ip","checks","tooBig","tooSmall","trim","_regex","_addCheck","email","emoji","uuid","nanoid","cuid","cuid2","ulid","base64url","cidr","datetime","minLength","maxLength","nonempty","isDatetime","isTime","isDuration","isEmail","isURL","isEmoji","isUUID","isNANOID","isCUID","isCUID2","isULID","isIP","isCIDR","isBase64","isBase64url","gte","lte","step","valDecCount","stepDecCount","decCount","toFixed","setLimit","gt","int","positive","negative","nonpositive","nonnegative","finite","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","minValue","maxValue","isInt","BigInt","_getInvalidInput","minDate","maxDate","_any","_unknown","void","exactLength","deepPartialify","newShape","shape","fieldSchema","_cached","nonstrict","passthrough","augment","_getCached","extraKeys","catchall","unknownKeys","shapeKeys","keyValidator","strict","_d","augmentation","merging","setKey","pick","omit","deepPartial","newField","keyof","createZodEnum","strictCreate","lazycreate","childCtx","types","getDiscriminator","enum","discriminator","discriminatorValue","optionsMap","discriminatorValues","mergeValues","aType","bType","valid","bKeys","sharedKeys","sharedValue","newArray","handleParsed","parsedLeft","parsedRight","merged","itemIndex","schemas","keySchema","valueSchema","third","finalMap","minSize","maxSize","finalizeSet","parsedSet","add","implement","makeArgsIssue","makeReturnsIssue","returns","me","parsedArgs","parsedReturns","parameters","returnType","strictImplement","getter","expectedValues","enumValues","Values","Enum","extract","newDef","exclude","opt","nativeEnumValues","promisified","sourceType","checkCtx","fatal","processed","executeRefinement","acc","inner","createWithPreprocess","removeDefault","removeCatch","handleAsync","inResult","in","out","cleanParams","_params","_fatal","cls","stringType","numberType","nanType","bigIntType","booleanType","dateType","symbolType","undefinedType","nullType","anyType","unknownType","neverType","voidType","arrayType","objectType","strictObjectType","unionType","discriminatedUnionType","intersectionType","tupleType","recordType","mapType","setType","functionType","lazyType","literalType","enumType","nativeEnumType","promiseType","effectsType","optionalType","nullableType","preprocessType","pipelineType","cacheParser","fastDefer","objectCode","Header","IfModifiedSince","LastModified","IfNoneMatch","CacheControl","Pragma","ETag","Expires","Age","XAxiosCacheEtag","XAxiosCacheLastModified","XAxiosCacheStaleIfError","defaultHeaderInterpreter","cacheControl","noCache","noStore","maxStale","immutable","staleWhileRevalidate","age","stale","milliseconds","createValidateStatus","oldValidate","isMethodIn","requestMethod","methodList","updateStaleRequest","etag","modifiedSince","_cache$data","etagValue","createdAt","createCacheResponse","previousCache","defaultRequestInterceptor","onFulfilled","defaults","cachePredicate","ignoreUrls","_config$headers","_Header$CacheControl","_config$headers2","_Header$Pragma","_config$headers3","_Header$Expires","cacheTakeover","methods","overrideCache","override","ignoreAndRequest","waiting","deferred","previous","hydrate","cachedResponse","transformResponse","adapter","interceptors","testCachePredicate","predicate","statusCheck","responseMatch","containsHeaders","_response$headers$hea","updateCache","cacheUpdater","defaultResponseInterceptor","rejectResponse","responseId","clearCache","cacheConfig","staleTtl","interpretHeader","expirationTime","headerInterpreter","staleIfError","newCache","staleHeader","isStorage","hasUniqueIdentifierHeader","mustRevalidate","canStale","isExpired","buildStorage","clear","structuredClone","buildMemoryStorage","cloneData","cleanupInterval","maxEntries","cleanup","cleaner","setInterval","SLASHES_REGEX","generator","defaultKeyGenerator","buildWebStorage","save","allValues","sortedItems","_options$ttl","_options$etag","_options$modifiedSinc","_options$interpretHea","_options$cacheTakeove","_options$staleIfError","_options$override","_options$hydrate","axiosCache","requestInterceptor","responseInterceptor","kindOf","thing","kindOfTest","typeOfTest","isArrayBuffer","isFile","isBlob","isFileList","isURLSearchParams","isReadableStream","isRequest","isResponse","isHeaders","allOwnKeys","findKey","_global","isContextDefined","isTypedArray","TypedArray","isHTMLForm","isRegExp","reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","defineProperties","isAsyncFn","_setImmediate","setImmediateSupported","setImmediate","postMessageSupported","postMessage","asap","queueMicrotask","nextTick","utils$1","isFormData","FormData","isArrayBufferView","isView","isStream","caseless","assignValue","targetKey","stripBOM","inherits","superConstructor","toFlatObject","sourceObj","destObj","propFilter","forEachEntry","regExp","hasOwnProp","freezeMethods","toObjectSet","arrayOrString","delimiter","toCamelCase","p1","p2","toFiniteNumber","isSpecCompliantForm","toJSONObject","visit","reducedValue","isThenable","lineNumber","columnNumber","prototype$1","isVisitable","removeBrackets","renderKey","dots","predicates","toFormData","formData","metaTokens","indexes","visitor","defaultVisitor","useBlob","Blob","convertValue","isFlatArray","exposedHelpers","encode$1","charMap","AxiosURLSearchParams","_pairs","encode","buildURL","_encode","serializeFn","serializedParams","hashmarkIndex","InterceptorManager$1","fulfilled","synchronous","runWhen","eject","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","platform$1","classes","protocols","hasBrowserEnv","_navigator","hasStandardBrowserEnv","product","hasStandardBrowserWebWorkerEnv","importScripts","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","parsePropPath","transitional","transformRequest","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","helpers","toURLEncodedForm","formSerializer","_FormData","rawValue","parser","stringifySafely","JSONRequested","strictJSONParsing","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","defaults$1","ignoreDuplicateOf","$internals","normalizeHeader","matchHeaderValue","isHeaderNameFilter","AxiosHeaders","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","substring","parseHeaders","tokensRE","parseTokens","matcher","deleted","deleteHeader","normalized","char","formatHeader","targets","asStrings","computed","accessor","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","buildAccessors","mapped","headerValue","AxiosHeaders$1","transformData","fns","isCancel","__CANCEL__","CanceledError","ERR_CANCELED","progressEventReducer","isDownloadStream","freq","bytesNotified","_speedometer","samplesCount","bytes","timestamps","firstSampleTS","tail","chunkLength","startedAt","bytesCount","passed","speedometer","lastArgs","timestamp","threshold","invoke","throttle","loaded","total","lengthComputable","progressBytes","rate","progress","estimated","progressEventDecorator","throttled","asyncDecorator","isURLSameOrigin","isMSIE","protocol","host","port","secure","buildFullPath","requestedURL","allowAbsoluteUrls","isRelativeUrl","relativeURL","combineURLs","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","paramsSerializer","timeoutMessage","withCredentials","withXSRFToken","onUploadProgress","onDownloadProgress","decompress","beforeRedirect","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding","configValue","resolveConfig","newConfig","auth","username","xsrfValue","xhrAdapter","XMLHttpRequest","requestHeaders","onCanceled","uploadThrottled","downloadThrottled","flushUpload","flushDownload","unsubscribe","signal","onloadend","responseHeaders","getAllResponseHeaders","responseText","onreadystatechange","readyState","responseURL","onabort","onerror","ontimeout","ETIMEDOUT","setRequestHeader","upload","aborted","parseProtocol","send","composeSignals$1","signals","controller","AbortController","streamChunk","chunk","chunkSize","pos","readStream","stream","reader","getReader","trackStream","onProgress","onFinish","iterable","readBytes","_onFinish","ReadableStream","pull","loadedBytes","enqueue","highWaterMark","isFetchSupported","Response","isReadableStreamSupported","encodeText","TextEncoder","supportsRequestStream","duplexAccessed","hasContentType","duplex","supportsResponseStream","resolvers","ERR_NOT_SUPPORT","resolveBodyLength","getContentLength","_request","getBodyLength","knownAdapters","http","fetchOptions","composedSignal","toAbortSignal","requestContentLength","contentTypeHeader","flush","isCredentialsSupported","isStreamResponse","responseContentLength","responseData","renderReason","isResolvedHandle","adapters","nameOrAdapter","rejectedReasons","throwIfCancellationRequested","throwIfRequested","dispatchRequest","VERSION","validators$1","deprecatedWarnings","validator","formatMessage","ERR_DEPRECATED","spelling","correctSpelling","assertOptions","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","validators","Axios","instanceConfig","configOrUrl","dummy","withXsrfToken","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","responseInterceptorChain","chain","getUri","generateHTTPMethod","isForm","Axios$1","CancelToken","resolvePromise","onfulfilled","_resolve","CancelToken$1","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","HttpStatusCode$1","createInstance","Cancel","promises","spread","formToJSON","getAdapter","toPropertyKey","_typeof","InvalidTokenError","base64UrlDecode","b64DecodeUnicode","part","errSerializer","errWithCauseSerializer","reqSerializers","resSerializers","mapHttpRequest","mapHttpResponse","reqSerializer","resSerializer","wrapErrorSerializer","customSerializer","wrapRequestSerializer","wrapResponseSerializer","isErrorLike","getErrorCause","causeResult","_stackWithCauses","_messageWithCauses","skipIfVErrorStyleCause","stackWithCauses","messageWithCauses","rawSymbol","pinoErrProto","aggregateErrors","pinoErrorSymbols","_err","pinoReqProto","remoteAddress","remotePort","socket","_req","originalUrl","pinoResProto","_res","headersSent","_console","defd","pfGlobalThisOrFallback","stdSerializers","mock","asErrValue","levelToValue","Infinity","levels","baseLogFunctionSymbol","hierarchySymbol","logFallbackMap","appendChildLogger","childLogger","transmit","asObject","shouldSerialize","stdErrSerialize","disabled","logFunctions","setupBaseLogFunctions","_level","setOpts","formatters","getTimeFunction","messageKey","onChild","childOptions","childOptionsSerializers","childSerializers","childSerialize","applySerializers","_stdErrSerialize","Child","_childLevel","_serialize","_logEvent","createLogEventShape","newLogger","labels","inverted","getLevels","rootLogger","transmitLevel","transmitValue","ts","argsIsSerialized","logObjectFormatter","argsCloned","logObject","levelFormatter","formattedLevel","lvl","methodValue","methodLevel","messages","label","createWrap","hierarchy","getBindingChain","logFunc","prependBindingsInArguments","nullTime","epochTime","stdTimeFunctions","unixTime","isoTime","cacheControlSymbol","headerStr","_step","_iterator","_split$","minFresh","sMaxAge","mustUnderstand","noTransform","onlyIfCached","proxyRevalidate","tokenize","isCacheControl","fastDeferSymbol","rej","isDeferred","sortNumbers","WeakSet","toHash","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","definition","baseURI","nc","_defineProperty","getClientQueryParam","queryParam","SHOULD_BE_CLOSED_COOKIE","defaultTranslations","updateYourBrowser","yourBrowserIsOutdated","optionsWithoutTranslations","text_in_xx","jsshowurl","locals","outdatedBrowserInfo","_ref","currentLanguage","staticApiUrl","lang","localizations","_ref2","parseLocalizations","Localizations","browserUpdate","_objectSpread","APP_ROOT_ELEMENT_ID","rootElement","dataset","outdatedBrowserInfoConfig","parseClientAppConfig"],"sourceRoot":""}