{"version":3,"file":"static/chunks/136-cd8f96a26d22cefd.js","mappings":"4HAQA,EAAY,eAAE,EACd,OACA,2CACA,OACA,OACA,OACA,YACA,WACA,aACA,eACA,oBACA,uBACA,gBACA,eACA,eACA,cACA,eACA,YACA,cACA,uBACA,gCACA,kCACA,CACG,CACH,UACA,SACA,QAAe,CACf,OAAc,CACd,OACA,qBACA,CAAO,CACP,SACA,CAAK,CACL,OACA,UAAiB,CACjB,UAAiB,CACjB,YAAmB,CACnB,UAAiB,CACjB,UAAiB,CACjB,SACA,CAAK,CACL,MACA,IACA,sBACA,CAAO,CACP,IACA,uBACA,CAAO,CACP,IACA,uBACA,CACA,CAAK,CACL,WACA,cAAqB,CACrB,aAAoB,CACpB,iBAAwB,CACxB,gBACA,CAAK,CACL,OACA,SAAgB,CAChB,YACA,CAAK,CACL,aACA,OACA,CAAK,CACL,WACA,MACA,YACA,CACA,CAAK,CACL,OACA,OACA,CAAK,CACL,kBACA,MACA,uBACA,CAAO,CACP,OACA,oEACA,CACA,CAAK,CACL,aACA,MACA,kCACA,CAAO,CACP,OACA,mCACA,CACA,CACA,CAAG,CACH,iBACA,gBACA,gBACA,UACA,kBACA,sBACA,eACA,cACA,CAAG,CACH,kBACA,CACA,gBACA,gBACA,OACA,MAAe,GAAa,cAC5B,CACA,CAAK,CACL,CACA,gBACA,gBACA,OACA,MAAe,GAAa,eAE5B,CAAK,CACL,CACA,gBACA,kBACA,OACA,MAAe,GAAa,iBAE5B,CAAK,CACL,CACA,gBACA,gBACA,OACA,MAAe,GAAa,eAE5B,CAAK,CACL,CACA,gBACA,gBACA,OACA,MAAe,GAAa,eAE5B,CAAK,CACL,CACA,gBACA,eACA,OACA,MAAe,GAAa,cAE5B,CAAK,CACL,CACA,iBACA,gBACA,OACA,MAAe,GAAa,gBAE5B,CAAK,CACL,CACA,iBACA,gBACA,OACA,MAAe,GAAa,gBAE5B,CAAK,CACL,CACA,iBACA,kBACA,OACA,MAAe,GAAa,kBAE5B,CAAK,CACL,CACA,iBACA,gBACA,OACA,MAAe,GAAa,gBAE5B,CAAK,CACL,CACA,iBACA,gBACA,OACA,MAAe,GAAa,gBAE5B,CAAK,CACL,CACA,iBACA,eACA,OACA,MAAe,GAAa,eAE5B,CAAK,CACL,CACA,eACA,gBACA,OACA,MAAe,GAAa,cAE5B,CAAK,CACL,CACA,eACA,gBACA,OACA,MAAe,GAAa,cAE5B,CAAK,CACL,CACA,eACA,kBACA,OACA,MAAe,GAAa,gBAE5B,CAAK,CACL,CACA,eACA,gBACA,OACA,MAAe,GAAa,cAE5B,CAAK,CACL,CACA,eACA,gBACA,OACA,MAAe,GAAa,cAE5B,CAAK,CACL,CACA,eACA,eACA,OACA,MAAe,GAAa,aAE5B,CAAK,CACL,CACA,gBACA,gBACA,OACA,MAAe,GAAa,eAE5B,CAAK,CACL,CACA,gBACA,gBACA,OACA,MAAe,GAAa,eAE5B,CAAK,CACL,CACA,gBACA,kBACA,OACA,MAAe,GAAa,iBAE5B,CAAK,CACL,CACA,gBACA,gBACA,OACA,MAAe,GAAa,eAE5B,CAAK,CACL,CACA,gBACA,gBACA,OACA,MAAe,GAAa,eAE5B,CAAK,CACL,CACA,gBACA,eACA,OACA,MAAe,GAAa,cAE5B,CAAK,CACL,CACA,aACA,UACA,OACA,+BACA,CACA,CAAK,CACL,CACA,aACA,UACA,OACA,+BACA,CACA,CAAK,CACL,CACA,aACA,UACA,OACA,+BACA,CACA,CAAK,CACL,CACA,SACA,UACA,OACA,+BACA,CACA,CAAK,CACL,CACA,SACA,UACA,OACA,uCACA,CACA,CAAK,CACL,CACA,SACA,UACA,OACA,+BACA,CACA,CAAK,CACL,CACA,sBACA,kBACA,OACA,4DACA,CACA,CAAK,CACL,CACA,qBACA,kBACA,OACA,4DACA,CACA,CAAK,CACL,CACA,yBACA,kBACA,OACA,8DACA,CACA,CAAK,CACL,CACA,wBACA,kBACA,OACA,8DACA,CACA,CAAK,CACL,CACA,sBACA,eACA,OACA,8DACA,CACA,CAAK,CACL,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1E,CACA,gBACA,OAAa,oBACb,CACA,kBAAsB,EAAO,IAC7B,OACA,QACA,gBACA,YAKA,KAJA,kBASA,KACA,cACA,OAAiB,SAEjB,iBACA,OACA,OACA,KAEA,GAFA,IACA,QACA,yBACY,OAAqB,CAnBjC,GAmBiC,IAGjC,IAEA,MACA,OAAiB,SAEjB,MAAiB,OAAqB,0BACtC,SACA,OAAiB,SAEjB,OACA,cACA,aACA,EAOA,OANA,WACA,QAEA,WACA,QAEA,CACA,EA1CA,IACA,CACA,CAIA,cACA,0DC9GA,cACA,mBAKA,uBACA,WACA,cAAwB,OAAS,uBACjC,kBACA,YACQ,OAAS,qCACjB,UAjBA,OAiBA,SAhBA,QAiBA,iBACA,YAEA,cAlBA,MAmBA,aAlBA,KAmBA,qBACA,eAEA,CACA,oBACA,kCACA,iCACA,CACA,kBACA,kBACA,gBACA,CAKA,kBACA,kBACA,gBACA,CACA,kBACA,eACA,cACA,gBCnBA,kBACA,OACA,8BACA,eACA,sBACA,MACA,CACA,CAcA,iBACA,kBACA,cAOA,OAJA,YACA,aACA,cAEA,KAAa,QACb,CAuDA,mBACA,OACA,YACA,WACA,CACA,CACA,iBACA,yBACA,EACA,OACA,iBC9HA,eACA,0ECAA,iBAA4B,EAAS,GACrC,mDCkBA,kBAKA,UACA,eACA,uBACA,mBACA,2BACA,kBAA6B,SAI7B,oBACA,8BAIA,aAAuB,SAAS,GAChC,oBACA,CACA,sBAAyB,MAAuB,EAAI,EAIpD,oBAAgB,GAAkB,mBAClC,uBACA,OA8FA,IAAgB,oBAAmB,eACnC,qBAA8B,EAAU,GACxC,KADwC,UA9FxC,IACA,qBAAoB,GAAmB,eAGvC,8CACA,GACA,kBAAkC,OAAgB,UAElD,EAwFA,QAvFA,QAEA,SAAoB,mCAAqC,gBACzD,WACA,mBACA,oBACA,kBAAoC,QAAW,IAE/C,oBACA,MAEA,oBACA,2BACA,0BACA,gCACA,oDACA,6CAKY,GAAQ,IACpB,CADoB,GACpB,sCAIA,GA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O,UAE9B,cACA,OAJA,EAKA,MAAyB,IAAO,sBAChC,4BAEA,gBACA,gBACA,UACA,UAOA,MAA6B,OAAS,SAOtC,MALA,yBACA,YAEA,yBACA,YACA,IACA,CACA,CCmGA,kEGnIA,oCCGA,GACA,cACA,iBACA,eACA,CACA,OACQ,SAAa,kBACrB,eACA,CACA,UACQ,SAAU,kBAClB,eACA,CACA,WACA,iCAA2C,IAC3C,UADyD,EACzD,IACA,wBACA,CACA,yCEhBA,yDACA,aACA,yCACA,0BAAqD,KAAE,SA0CvD,iBACA,qBACA,KACA,eAyBA,eAAuD,KAAO,EAC9D,aAA2D,GAAI,EAC/D,mBACA,UAEA,IACA,EACA,IACA,EACA,EAAsB,OAAQ,QAE9B,CCpFA,iBACA,YACA,YAOA,iBACA,YACA,WACA,CAMA,iBACA,wBACA,gBACA,4BACA,iCCpBA,uBAMA,OALA,KACA,EAAY,SAAU,UACtB,YACA,GAAgB,SAAU,WAE1B,CACA,CAsBA,8BACA,SAnBA,0BAMA,GALQ,KAAO,WACf,gBAEA,GADiC,MAAS,oBAC1C,OAEA,mBACA,OACA,MAAsB,OAAS,gBAC/B,OACA,OACA,wBACA,uBACA,EAMA,6BACA,CAIA,gCACA,4BAKA,qBACA,uCACA,sCACA,CCjDA,eACA,oCAEA,eACA,uBACA,CACA,iBACA,oCAKA,iBACA,8CACA,qCACA,CACA,iBACA,+BACA,CACA,eACA,OAAW,EAAU,KAAU,EAAU,CAApB,CAAoB,EACzC,CACA,GAFyC,MAEzC,QACA,kCACA,mBACA,8BCzBA,SACA,cACA,gBAEA,OACQ,SAAa,iBACrB,kBACA,CACA,UAKA,GAJQ,SAAU,iBAClB,mBACA,uBAEA,eACA,0CACA,GACA,eAEA,CACA,CACA,gBAOA,EANA,uCACA,SACA,SAKA,YAAkC,KAAQ,KAC1C,sBACA,qBACA,IACA,KACA,CACA,OACA,MACA,gBACA,GAKA,CACA,aACA,gBACA,WAEA,gBACA,YACA,SACA,IACA,+BACA,mBACA,eACA,GACA,kCAEA,aACA,sBACA,wBACA,mCAEA,2BACA,qBAEA,cAAoB,GAAY,WAChC,OACA,QAcA,CACA,CACA,wBACA,yBACA,YAAoB,kBAAwB,CAC5C,sCACA,GACA,0BACA,0BAEA,CAAS,CACT,CACA,iBACA,yBACA,gCACA,CAAS,CACT,CAKA,qBACA,+BACA,2BAEA,CACA,iBEjFA,QACA,uBACA,aACA,uBACA,wBACA,EACA,2DACA,oBACA,IAA2B,qBAM3B,KACA,qBACA,iBAAY,GAAe,CAE3B,QACA,UACA,sBACA,GACA,SAGA,CAkBA,kCAAgC,uEAAwF,EACxH,aACA,gBAAqC,uBAIrC,aAIA,mBAOA,sBAKA,gBAMA,wBACA,2BAOA,sBAKA,0BAKA,gCAKA,yBAIA,8BACA,8BAKA,mBAIA,cAKA,mBAIA,6BAOA,kCASA,gBAA+B,SAI/B,2BACA,wBAEA,wBACA,sCACA,kCACA,4BACA,kBACA,mBACA,yBAEA,EAMA,2BACA,kCAKA,IACA,eACA,wBACA,0BACA,GAEA,uBACA,uBACA,uBACA,uBACA,IACA,6BAEA,EAIA,gCACA,qBACA,kBACA,yBAKA,yBACA,oBACA,2BACA,6BACA,cACA,yBACA,YAA4B,mBAAsB,IAClD,oCAEA,mBACA,gBAAiC,EAAQ,CACzC,CACA,IAFyC,aAEzC,KAIA,OAHA,2BACA,6BAAiD,IAAmB,EAEpE,gCACA,CACA,wBACA,+BACA,kBACA,CACA,gBACA,gCACA,CAIA,qCACA,iBACA,MACA,YVnPA,EUmPyB,WVnPzB,CUmPqC,WVnPrC,QUmPqC,EVnPrC,QUoPA,gBACA,aAAoB,4BAAkC,aAStD,GARA,eACA,WAEA,0BACA,4CACA,WACA,wBAEA,OACA,EACA,6CACA,SACA,mCACA,OACA,EP9PA,KO8PuC,IP9PvC,KACA,MAAkB,IAAI,OACtB,cAA4B,EAAW,IACvC,UACA,GO0PuC,MPzP3B,QAAW,IACvB,IOwPuC,KPtPvC,EAEA,OADI,IAAK,YACT,IAAiB,QAAW,GAC5B,EOmPuC,OACf,GAAqB,yBACrB,GAAqB,0BAC7C,uBAEA,CAAiB,CACjB,CACA,GACA,qCAGA,2BACA,GACA,QACA,0CAAsD,yDAAuE,IAC7H,kCACA,mBACA,2BACA,MACA,CAEA,+BACA,0BACA,GACA,wBAA4B,+BAAqD,aAKjF,sBACA,CAAyB,GAAgB,sBACzC,EAMA,QACA,4BACA,2CACA,GACA,GACA,6BACA,kBACA,kCACA,uCAEA,6BACA,OACA,GAA+B,QAAkB,aACjD,SACA,YACA,EACA,uBACA,2BACA,UACA,WAEA,sBACA,MAOA,GACA,SAEA,4CACA,6BAGA,oBACA,CAAiB,CAEjB,CACA,UACA,yCACA,6BACA,qBACA,mBACA,+CACA,qBACY,QAAW,uBACvB,CAEA,cACA,6BACA,CACA,gBACA,6BACA,CACA,kBACA,8DAEA,yBACA,gCACA,mDACA,EACA,CAEA,eACA,yBAEA,mBACA,mCACA,mBACA,CACA,uBACA,IAAoB,iBAAgB,aACpC,wCACA,CACA,iBAEA,GADA,6BACA,6BACA,2DACA,MACA,CAkBA,GALA,uCACA,iCAnVA,cAEA,GADA,+BACA,WACA,OACA,kBAAY,GAAgB,UAC5B,MACA,OACA,MAAqB,QAAoB,IACzC,sDACA,WAAgB,cAAmB,UACnC,oDAAqE,IAAK,SAC1E,CACA,WAAY,GAAS,EACrB,iCACA,IAEA,EAoUA,MAEA,8CACA,mBACA,MACA,uBACA,YAA4B,mBAAsB,KAClD,mBACA,0BACA,2BACA,sBACA,gBAEA,CACA,aAAoB,YAAmB,aACvC,kBACA,OACA,iCACA,mCACA,wBACA,OACA,sBACA,qCACA,CACA,SAMA,GALA,wBACA,uBAIA,CACA,qBACA,yBACA,uBACA,MACA,CACA,iBACA,uBAEA,mBAIA,uBAKA,uBAKA,uBACA,yBAMA,MAAwB,IAAI,OAChB,IAAS,OAAS,OAAK,YAAqB,IAAS,YACrD,IAAS,aACT,IAAS,iBACT,IAAU,gBAAgB,IAAS,EACnC,IAAU,mBAAmB,IAAS,EACtC,IAAU,gBAAgB,IAAS,EACnC,IAAS,gBACrB,CACA,YACA,uBACA,wBACgB,IAAS,2BAEzB,CACA,oBACA,uBACA,4BACA,CACA,2BACA,iCACA,kCACgB,IAAK,wCAErB,CACA,4BAMY,IAAK,iBACjB,mBACA,sBAGA,6BAEA,CAAa,CACb,CAIA,kBACA,8BAEA,8BACA,CACA,eACA,oBAGA,oBACA,oDACA,qBAJA,OAcA,8CACA,YAAgC,mBAAsB,IACtD,aACA,eAGA,kBACA,6BACA,qBAAmC,SAAS,GAC5C,sBACA,4BACA,sDACA,kBAAoB,GAAgB,aACpC,GACA,oEACA,CACA,0BACA,mDAMA,GALA,aACA,iDACA,uBACA,OAEA,GACA,sBACA,cACA,kCACA,QACA,SACA,wBACA,wCACA,CACA,CACA,CACA,iBACA,MACA,OACA,0BACA,2BACA,iCACA,yBAA2D,GAAW,sBACtE,8BACA,IACA,wBACA,OACA,sCACA,GACA,IACoB,SAAY,qBAChC,KACA,mBACA,6BACA,sBAEA,CACA,kBAm+BA,EAl+BA,4BACA,8BAUA,OAJA,GACA,4BA29BA,IADA,EAx9BA,GAy9BA,GACA,QAz9BA,CACA,kCACA,cACA,YACA,eAAgC,CAChC,eAEA,CACA,iBACA,MACA,kBAAoB,GAAgB,aACpC,MACA,MAAuB,SAAS,GAChC,6BAEA,IADA,4EACA,CAEA,WAAwB,GAAS,UACjC,IACoB,SAAa,iBACb,SAAa,iBAEjC,CACA,QACA,CACA,uBACA,MACA,MAAqC,SAAS,GAE9C,GADY,GAAW,KACvB,GADuB,IACvB,6CACA,SAMA,YAA4B,mBAAsB,KAClD,mBACA,QAAwB,aAAkB,EAC1C,mCAKA,WACwB,GAAW,KAEf,SAAa,iBACb,SAAa,iBAEjC,CACA,QACA,CACA,uBACA,MAAmC,SAAS,GAChC,GAAW,KACvB,GADuB,CACvB,QAA4B,mBAAsB,KAClD,oBACA,GACA,wBACA,UACA,YACoB,SAAY,IAChC,qBACA,qB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B,OAAS,mEAKlC,YAAoB,KAAgB,KACpC,eAAqC,MAAW,QAChD,UACA,UACA,2BAEA,SACA,SACA,OACA,OACA,eAEA,cAA2C,OAAS,oBACpC,KAAO,UAAqB,KAAO,WACnD,aAIA,OAEA,CAIA,sBACA,UAAwB,OAAS,4BAEjC,EMo+B6B,8BAE7B,qCACA,sBACA,wBACA,EACA,kDACA,CACA,kBACA,uCACA,oDACA,uDACA,0CAEA,wBACgB,QAAW,wBAC3B,8BAOA,sBAAoC,IAAK,aACzB,GAAqB,0BACrC,sBAAwC,SX1iCxC,OACA,EWyiC0D,EXziC1D,EAA0B,QAAa,CWyiCmB,KXziCD,SAAW,CWyiCV,GXviC1D,OADA,QAAwB,QAAkB,MWmC1C,IXnC0C,IAC1C,WACA,EWsiC0D,EArgC1D,EAqgC0D,CAC1D,KACA,aACA,uBACA,yBACA,CAAqB,CACrB,gBACA,6BACA,wBACA,CAAqB,CACJ,EACjB,mBACA,2DAEA,4BACA,CAAa,CACb,CACA,oBACA,oBACA,0CACA,0CAEA,qBACA,8BACA,kBACA,sBACA,qBACA,OACA,yCACA,CACA,kBACA,wBACA,yCAriCA,KAsiCA,8BAEA,wBACA,CACA,0BACA,qBACA,sBAAkB,oCAAqD,EACvE,YAOA,aACA,aACA,GACA,kEACA,eAAwC,SAAS,GACjD,MAAgC,EAAU,wBAC1C,wBACA,kBACA,MAAgC,EAAU,wBAC1C,wBACA,iBACA,CACY,GAAW,KAMX,GANW,GAMX,GAAY,MAOZ,EAAY,4DACxB,CACA,wBACA,yBACA,2BAAmD,IAEnD,KAF4D,WAE5D,QACA,OACA,uCACA,WACA,iCACA,uDACA,iCACA,MACA,CAAa,CACb,CACA,SACA,sBACA,wBAEA,UACA,MACA,aAAoB,GAAW,aAC/B,uEAEA,cACA,MACA,aAAoB,GAAW,aAC/B,wEACA,CACA,WACA,aAAoB,GAAW,aAC/B,KACA,mCACA,CACA,oBAAkB,wCAAiD,EAAI,EACvE,sBACA,GACA,kBACA,IAC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IAO5D,uBACA,KACA,UACA,MACA,eACA,YAAoC,IAAS,IAC7C,SAEA,MAEA,MAEA,CAYA,OANA,uBACA,iBACA,SAC0B,QAAkB,qCAC5C,QAEA,CACA,CACA,gBACA,oCACA,CAEA,YACA,4BAAgD,MAAQ,iEAAqF,EAC7I,4BACA,6BACA,CACA,CACA,CACA,eACA,gBACA,CACA,eACA,MACA,0EACA,eACA,UACA,GACA,6BACA,IAAgB,2BAAiD,SACjE,eAAgB,GAAgB,UAChC,6BAGA,WACY,GAAQ,IACpB,CADoB,GACpB,IACA,iBACA,eACA,EAA+B,EAAU,EACzC,MADyC,CACzC,SACA,aACA,CAAa,EAEb,qBACY,GAAQ,IACpB,CADoB,GACpB,IACA,iBACA,eACA,EAA+B,EAAU,KACzC,GADyC,GACzC,SAIA,wCACA,uBACA,wBACA,0BAEA,CAAa,EAEb,MAA4B,SAAW,GAC/B,EAAY,iBACpB,MAA4B,SAAW,GACvC,EACY,EAAY,wCAGZ,EAAY,iBAExB,OAAkC,GAAW,GAC7C,KAD6C,GAE7C,eACA,qCAKA,qBACA,IAAwB,qBAAiD,EACzE,SACA,MAA6C,SAAS,GAClC,EAAoB,2BACxC,MAA2C,SAAS,GAChC,EAAoB,iBACf,CADe,EACC,MACzC,OADyC,EAGzC,qBACA,mBACA,yBACA,mBAEA,CACA,CACA,CACA,+BACA,SACA,WACA,QACA,cACA,mBACA,0BACA,CAAS,CACT,MACA,eACA,mBAAgB,GAAiB,UACjC,MACA,CAMA,2BACA,CACA,eAIA,IACA,gBAEA,WAQA,kBACA,iDAOA,8EACA,4BACA,mCACA,mEACA,CACA,eACA,oBACA,0BACA,mBACA,EACA,CACA,eACA,iBACA,CACA,eACA,qBACA,CACA,eACA,kBACA,CACA,eACA,kBAAY,GAAgB,UAC5B,uCACA,gCAEA,kBACA,CACA,eACA,oBACA,+CACA,sBACA,CACA,eACA,sBACA,CACA,eACA,kBACA,CACA,eACA,wBACA,CACA,eACA,sBACA,CACA,mBACA,YAAu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A,mDACS,KAAuB,CAChC,CACA,YACA,WACA,OACA,eACA,oBACA,oBACA,mBACA,6CACA,CACA,qCACA,OACA,OACA,OACA,eACA,8BACS,KAAuB,CAChC,CACA,WACG,CACH,UACA,SACA,OACA,gBACA,CAAO,CACP,OACA,6CACA,gBACA,CAAO,CACP,YACA,6CACA,uEACA,CAAO,CACP,UACA,wFACA,gBACA,CACA,CAAK,CACL,OACA,UAAiB,CACjB,UAAiB,CACjB,YAAmB,CACnB,UAAiB,CACjB,UAAiB,CACjB,SACA,CAAK,CACL,MACA,IACA,yBACA,kCACA,sBACA,CAAO,CACP,IACA,yBACA,mCACA,sBACA,CAAO,CACP,IACA,wBACA,qCACA,uBACA,CACA,CAAK,CACL,QACA,MACA,uBACA,mBACA,qBACA,CAAO,CACP,IACA,yBACA,oBACA,sBACA,CAAO,CACP,IACA,yBACA,oBACA,sBACA,CAAO,CACP,IACA,wBACA,qBACA,uBACA,CAAO,CACP,MACA,uBACA,mBACA,qBACA,CACA,CAAK,CACL,WACA,MACA,cACA,gBACA,CACA,CAAK,CACL,YACA,MACA,8CACA,CACA,CAAK,CACL,kBACA,MACA,sBACA,4BACA,CACA,CAAK,CACL,WACA,MAAa,CACb,OACA,mBACA,kBACA,cACA,CAAO,CACP,KACA,mBACA,kBACA,+BACA,CAAO,CACP,QACA,+BACA,CACA,CACA,CAAG,CACH,iBACA,gBACA,gBACA,UACA,aACA,aACA,CAAG,CACH,kBACA,CACA,qCACA,gBACA,OACA,0DACA,+DACA,CACA,CAAK,CACL,CACA,qCACA,gBACA,OACA,OAAgB,IAAa,eAC7B,+DACA,CACA,CAAK,CACL,CACA,qCACA,kBACA,OACA,OAAgB,IAAa,iBAC7B,iEACA,CACA,CAAK,CACL,CACA,qCACA,gBACA,OACA,OAAgB,IAAa,eAC7B,+DACA,CACA,CAAK,CACL,CACA,qCACA,gBACA,OACA,OAAgB,IAAa,eAC7B,+DACA,CACA,CAAK,CACL,CACA,qCACA,eACA,OACA,OAAgB,IAAa,cAC7B,8DACA,CACA,CAAK,CACL,CACA,qBACA,gBACA,OACA,uBACA,uDACA,CACA,CAAK,CACL,CACA,qBACA,gBACA,OACA,oBACA,oDACA,CACA,CAAK,CACL,CACA,qBACA,kBACA,OACA,sBACA,sDACA,CACA,CAAK,CACL,CACA,qBACA,gBACA,OACA,oBACA,oDACA,CACA,CAAK,CACL,CACA,qBACA,gBACA,OACA,oBACA,oDACA,CACA,CAAK,CACL,CACA,qBACA,eACA,OACA,mBACA,mDACA,CACA,CAAK,CACL,CACA,oBACA,qBACA,OACA,KACA,qBACA,iBACA,iBACA,gBACA,gBACA,kBACA,8CACA,yCACA,CAEA,CAAK,CACL,CACA,oBACA,gBACA,qCACA,OACA,kFACA,CACA,CAAK,CACL,CACA,oBACA,gBACA,qCACA,OACA,kFACA,CACA,CAAK,CACL,CACA,oBACA,kBACA,qCACA,OACA,sFACA,CACA,CAAK,CACL,CACA,oBACA,gBACA,qCACA,OACA,kFACA,CACA,CAAK,CACL,CACA,oBACA,gBACA,qCACA,OACA,kFACA,CACA,CAAK,CACL,CACA,oBACA,eACA,qCACA,OACA,gFACA,CACA,CAAK,CACL,CACA,oBACA,gBACA,qBACA,OACA,8CACA,CACA,CAAK,CACL,CACA,oBACA,gBACA,qBACA,OACA,2CACA,CACA,CAAK,CACL,CACA,oBACA,kBACA,qBACA,OACA,6CACA,CACA,CAAK,CACL,CACA,oBACA,gBACA,qBACA,OACA,2CACA,CACA,CAAK,CACL,CACA,oBACA,gBACA,qBACA,OACA,2CACA,CACA,CAAK,CACL,CACA,oBACA,eACA,qBACA,OACA,0CACA,CACA,EACA,CACA,eACA,CACA,qBACA,iCACA,wBAEA,CACC,yBE5VD,iBACA,WACA,MACA,YAGA,IAFA,kBAEA,4JAEA,8JACA,CACA,QACA,CC5CA,SACA,uBACA,sCACA,sBACA,CACA,wBACA,0CACA,kBACA,CACA,cACA,QACA,gJACA,CACA,cACA,oCAEA,OADA,oDACA,CACA,CACA,aACA,mCAEA,OADA,wDACA,CACA,CACA,sBACA,uBACA,sBACA,CACA,sBACA,uBACA,kBACA,CACA,cACA,GAEA,MADA,oCACA,wCACS,oBACT,QACA,CACA,kBACA,GAEA,MADA,qCACA,uCACS,oBACT,QACA,CACA,6BACA,kBACA,+CACA,oBACA,kCACA,CACA,qDGGA,GAhDW,QAAU,eACrB,IACA,YACA,SACA,QACA,0BACA,eACA,kBACA,kBACA,CDbA,OCaa,EDbb,GACA,UACA,MAAwB,QAAkB,GAC1C,MAAgC,QAAgB,GAAgB,GAAI,aACpE,CACA,MACA,KACA,YACA,aACA,WACA,yBACA,cACA,gBACA,2BACA,6BACA,KACA,CAAI,EACJ,WACA,qBACA,EAAiB,QAAS,IAC1B,+FACA,EHlBA,YACA,QACA,SAAoB,MDApB,GACA,CIe+B,GJf/B,EACA,YAA4C,MAAyB,QCFlB,KDEkB,yEACrE,KAA2B,WAAc,aACzC,EACA,KACA,EACA,EACA,CAAU,gDAAyF,GAAM,MAAyC,CAClJ,KACA,uBACA,0BACA,iCACA,eACA,0BAGA,EADA,oBAEA,4DAGA,mDACA,IACA,CACA,CAAK,EACL,4BACA,OACA,aACA,eACA,mBACA,cACA,iBACA,cACA,CACA,EClCmD,CACnD,KACA,4BACA,gKACA,CAAK,EACL,CAAU,+CAA8F,EACxG,KAA8B,UAAa,GAe3C,MAdA,GAAQ,aAAgB,KAExB,QACA,qCAEA,MADA,0BAEA,mBACA,EACA,EAGA,gFACA,WACA,CAAK,EACL,CACA,KACA,2BACA,CACA,EGT+B,CAC/B,WACA,KACG,EACH,cAAU,GAAe,SDdzB,OACA,IAAU,qBCa2B,KDb3B,mCAAgG,EAC1G,CAAU,gDAAgF,EAC1F,CAAU,aAAuB,GAAM,QACvC,KAAuB,WAAc,QAAc,GAAyC,UAC5F,EACA,EACA,EACA,EACA,EACA,CAAU,iBANkF,CAMlF,CAAmC,GAAM,MAA8B,CACjF,MACA,mBACA,mBACA,8BACA,0BACA,YACA,wBACA,CAAK,EAEL,KAAqB,SACrB,EAAiD,CAAzC,EAAyC,MACjD,SAAgC,KAAgB,CAChD,KACA,IACA,CAAK,EACL,MALiD,CAMjD,cACA,MAAmB,KAAiB,KACpC,eACA,qBACA,eACA,CACA,CACA,ECpBqC,OACrC,EAAgB,aAAO,CACvB,IAAU,GAAI,IACd,EACA,YACA,mBACA,MAAwB,mBAAqB,GACxC,EACL,CAAK,QAAY,YAEjB,EAAqB,OAAI,0BACzB,EAAiB,aAAO,CACxB,MACA,QACA,QACA,aACA,cACA,mBACA,UACA,wBACA,yBACA,sCACA,EAAK,CACL,CACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,4BACA,EACA,EAEA,EAAuB,iBAAW,CAClC,KACA,mBACA,kBAA8B,MAAO,OAAI,+BAA0D,EACnG,GAAS,OAAU,CACX,OAAc,IACtB,SACA,CAAS,EACT,EACA,CACA,CAAK,CACL,SAEA,0CACA,EAA0B,iBAAW,CACrC,KACA,yBACA,qBAAiC,MAAO,OAAI,sDAAgG,EAC5I,mBACA,iEACA,EAAK,CACL,WAEA,EAA0B,iBAAW,CACrC,KACA,MACA,sBACA,qBAAiC,MAAO,OAAI,sDAAgG,EAC5I,GAAS,OAAU,MACnB,CAAK,CACL,WAEA,OACA,YACA,SACA,QACA,SACA,0BACA,eACA,kBACA,iBACA,CACA,ECzFa,CACb,KACA,KACA,CAAG,EACH,EAAmB,WAAK,GACxB,iDACA,GACA,QACA,kBACA,cACA,wBACA,wBACA,0BACA,oCACA,8CACA,iDAEA,2BAAmE,SAAG,CAAC,GAAW,MAAI,EAAJ,GAAI,aAAmC,SACzH,EAAqC,UAAI,CAAC,UAAQ,EAAI,UAClC,SAAG,QAAU,gBAA6C,SAAG,IAAc,kBAAqE,SAAG,CAAC,IAAW,EAAI,gBAA8B,IAAU,EAAG,EAClO,yBAC6B,SAAG,CxCNhC,EwCQA,CACA,wBACA,0BACA,cACA,cACA,aACS,CACT,QAGA,CAAK,QACL,kCAC2B,SAAG,QAAU,kBAA4C,EAEpF,CACA,CAAC","sources":["webpack://_N_E/./node_modules/@heroui/theme/dist/chunk-XQI5RD6S.mjs","webpack://_N_E/./node_modules/@heroui/badge/dist/chunk-ESVUYDZQ.mjs","webpack://_N_E/./node_modules/@heroui/badge/dist/chunk-TLGNVWIG.mjs","webpack://_N_E/./node_modules/@heroui/tabs/dist/chunk-ML27DD5T.mjs","webpack://_N_E/./node_modules/@react-aria/tabs/dist/utils.mjs","webpack://_N_E/./node_modules/@react-aria/focus/dist/useHasTabbableChild.mjs","webpack://_N_E/./node_modules/@react-aria/tabs/dist/useTabPanel.mjs","webpack://_N_E/./node_modules/@heroui/tabs/dist/chunk-7ARJTFQR.mjs","webpack://_N_E/./node_modules/@react-aria/tabs/dist/useTab.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/events/add-pointer-event.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/utils/distance.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/utils/get-context-window.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/gestures/drag/index.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/gestures/pan/index.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/node/state.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/animate/single-value.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/utils/delay.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/geometry/copy.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/geometry/utils.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/shared/stack.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/styles/transform.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/motion/features/drag.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/motion/features/layout.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/render/dom/features-max.mjs","webpack://_N_E/./node_modules/@heroui/tabs/dist/chunk-TTZQXKQZ.mjs","webpack://_N_E/./node_modules/@heroui/theme/dist/chunk-TYZBTYGB.mjs","webpack://_N_E/./node_modules/@react-stately/list/dist/useSingleSelectListState.mjs","webpack://_N_E/./node_modules/@react-stately/tabs/dist/useTabListState.mjs","webpack://_N_E/./node_modules/@react-aria/tabs/dist/TabsKeyboardDelegate.mjs","webpack://_N_E/./node_modules/@react-aria/tabs/dist/useTabList.mjs","webpack://_N_E/./node_modules/@heroui/tabs/dist/chunk-IUT6HU4S.mjs","webpack://_N_E/./node_modules/@heroui/tabs/dist/chunk-XHIAUY5J.mjs"],"sourcesContent":["import {\n colorVariants\n} from \"./chunk-GQT3YUX3.mjs\";\nimport {\n tv\n} from \"./chunk-UWE6H66T.mjs\";\n\n// src/components/badge.ts\nvar badge = tv({\n slots: {\n base: [\"relative\", \"inline-flex\", \"shrink-0\"],\n badge: [\n \"flex\",\n \"z-10\",\n \"flex-wrap\",\n \"absolute\",\n \"box-border\",\n \"rounded-full\",\n \"whitespace-nowrap\",\n \"place-content-center\",\n \"origin-center\",\n \"items-center\",\n \"text-inherit\",\n \"select-none\",\n \"font-regular\",\n \"scale-100\",\n \"opacity-100\",\n \"subpixel-antialiased\",\n \"data-[invisible=true]:scale-0\",\n \"data-[invisible=true]:opacity-0\"\n ]\n },\n variants: {\n variant: {\n solid: {},\n flat: {},\n faded: {\n badge: \"border-medium\"\n },\n shadow: {}\n },\n color: {\n default: {},\n primary: {},\n secondary: {},\n success: {},\n warning: {},\n danger: {}\n },\n size: {\n sm: {\n badge: \"px-1 text-tiny\"\n },\n md: {\n badge: \"px-1 text-small\"\n },\n lg: {\n badge: \"px-1 text-small\"\n }\n },\n placement: {\n \"top-right\": {},\n \"top-left\": {},\n \"bottom-right\": {},\n \"bottom-left\": {}\n },\n shape: {\n circle: {},\n rectangle: {}\n },\n isInvisible: {\n true: {}\n },\n isOneChar: {\n true: {\n badge: \"px-0\"\n }\n },\n isDot: {\n true: {}\n },\n disableAnimation: {\n true: {\n badge: \"transition-none\"\n },\n false: {\n badge: \"transition-transform-opacity !ease-soft-spring !duration-300\"\n }\n },\n showOutline: {\n true: {\n badge: \"border-2 border-background\"\n },\n false: {\n badge: \"border-transparent border-0\"\n }\n }\n },\n defaultVariants: {\n variant: \"solid\",\n color: \"default\",\n size: \"md\",\n shape: \"rectangle\",\n placement: \"top-right\",\n showOutline: true,\n isInvisible: false\n },\n compoundVariants: [\n {\n variant: \"solid\",\n color: \"default\",\n class: {\n badge: colorVariants.solid.default\n }\n },\n {\n variant: \"solid\",\n color: \"primary\",\n class: {\n badge: colorVariants.solid.primary\n }\n },\n {\n variant: \"solid\",\n color: \"secondary\",\n class: {\n badge: colorVariants.solid.secondary\n }\n },\n {\n variant: \"solid\",\n color: \"success\",\n class: {\n badge: colorVariants.solid.success\n }\n },\n {\n variant: \"solid\",\n color: \"warning\",\n class: {\n badge: colorVariants.solid.warning\n }\n },\n {\n variant: \"solid\",\n color: \"danger\",\n class: {\n badge: colorVariants.solid.danger\n }\n },\n {\n variant: \"shadow\",\n color: \"default\",\n class: {\n badge: colorVariants.shadow.default\n }\n },\n {\n variant: \"shadow\",\n color: \"primary\",\n class: {\n badge: colorVariants.shadow.primary\n }\n },\n {\n variant: \"shadow\",\n color: \"secondary\",\n class: {\n badge: colorVariants.shadow.secondary\n }\n },\n {\n variant: \"shadow\",\n color: \"success\",\n class: {\n badge: colorVariants.shadow.success\n }\n },\n {\n variant: \"shadow\",\n color: \"warning\",\n class: {\n badge: colorVariants.shadow.warning\n }\n },\n {\n variant: \"shadow\",\n color: \"danger\",\n class: {\n badge: colorVariants.shadow.danger\n }\n },\n {\n variant: \"flat\",\n color: \"default\",\n class: {\n badge: colorVariants.flat.default\n }\n },\n {\n variant: \"flat\",\n color: \"primary\",\n class: {\n badge: colorVariants.flat.primary\n }\n },\n {\n variant: \"flat\",\n color: \"secondary\",\n class: {\n badge: colorVariants.flat.secondary\n }\n },\n {\n variant: \"flat\",\n color: \"success\",\n class: {\n badge: colorVariants.flat.success\n }\n },\n {\n variant: \"flat\",\n color: \"warning\",\n class: {\n badge: colorVariants.flat.warning\n }\n },\n {\n variant: \"flat\",\n color: \"danger\",\n class: {\n badge: colorVariants.flat.danger\n }\n },\n {\n variant: \"faded\",\n color: \"default\",\n class: {\n badge: colorVariants.faded.default\n }\n },\n {\n variant: \"faded\",\n color: \"primary\",\n class: {\n badge: colorVariants.faded.primary\n }\n },\n {\n variant: \"faded\",\n color: \"secondary\",\n class: {\n badge: colorVariants.faded.secondary\n }\n },\n {\n variant: \"faded\",\n color: \"success\",\n class: {\n badge: colorVariants.faded.success\n }\n },\n {\n variant: \"faded\",\n color: \"warning\",\n class: {\n badge: colorVariants.faded.warning\n }\n },\n {\n variant: \"faded\",\n color: \"danger\",\n class: {\n badge: colorVariants.faded.danger\n }\n },\n {\n isOneChar: true,\n size: \"sm\",\n class: {\n badge: \"w-4 h-4 min-w-4 min-h-4\"\n }\n },\n {\n isOneChar: true,\n size: \"md\",\n class: {\n badge: \"w-5 h-5 min-w-5 min-h-5\"\n }\n },\n {\n isOneChar: true,\n size: \"lg\",\n class: {\n badge: \"w-6 h-6 min-w-6 min-h-6\"\n }\n },\n {\n isDot: true,\n size: \"sm\",\n class: {\n badge: \"w-3 h-3 min-w-3 min-h-3\"\n }\n },\n {\n isDot: true,\n size: \"md\",\n class: {\n badge: \"w-3.5 h-3.5 min-w-3.5 min-h-3.5\"\n }\n },\n {\n isDot: true,\n size: \"lg\",\n class: {\n badge: \"w-4 h-4 min-w-4 min-h-4\"\n }\n },\n {\n placement: \"top-right\",\n shape: \"rectangle\",\n class: {\n badge: \"top-[5%] right-[5%] translate-x-1/2 -translate-y-1/2\"\n }\n },\n {\n placement: \"top-left\",\n shape: \"rectangle\",\n class: {\n badge: \"top-[5%] left-[5%] -translate-x-1/2 -translate-y-1/2\"\n }\n },\n {\n placement: \"bottom-right\",\n shape: \"rectangle\",\n class: {\n badge: \"bottom-[5%] right-[5%] translate-x-1/2 translate-y-1/2\"\n }\n },\n {\n placement: \"bottom-left\",\n shape: \"rectangle\",\n class: {\n badge: \"bottom-[5%] left-[5%] -translate-x-1/2 translate-y-1/2\"\n }\n },\n {\n placement: \"top-right\",\n shape: \"circle\",\n class: {\n badge: \"top-[10%] right-[10%] translate-x-1/2 -translate-y-1/2\"\n }\n },\n {\n placement: \"top-left\",\n shape: \"circle\",\n class: {\n badge: \"top-[10%] left-[10%] -translate-x-1/2 -translate-y-1/2\"\n }\n },\n {\n placement: \"bottom-right\",\n shape: \"circle\",\n class: {\n badge: \"bottom-[10%] right-[10%] translate-x-1/2 translate-y-1/2\"\n }\n },\n {\n placement: \"bottom-left\",\n shape: \"circle\",\n class: {\n badge: \"bottom-[10%] left-[10%] -translate-x-1/2 translate-y-1/2\"\n }\n }\n ]\n});\n\nexport {\n badge\n};\n","\"use client\";\n\n// src/use-badge.ts\nimport { badge } from \"@heroui/theme\";\nimport { mapPropsVariants, useProviderContext } from \"@heroui/system\";\nimport { clsx, objectToDeps } from \"@heroui/shared-utils\";\nimport { useMemo } from \"react\";\nfunction useBadge(originalProps) {\n var _a, _b;\n const globalContext = useProviderContext();\n const disableAnimation = (_b = (_a = originalProps == null ? void 0 : originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;\n const [props, variantProps] = mapPropsVariants(originalProps, badge.variantKeys);\n const { as, children, className, content, classNames, ...otherProps } = props;\n const Component = as || \"span\";\n const isOneChar = useMemo(\n () => {\n var _a2;\n return ((_a2 = String(content)) == null ? void 0 : _a2.length) === 1 || (originalProps == null ? void 0 : originalProps.isOneChar);\n },\n [content, originalProps == null ? void 0 : originalProps.isOneChar]\n );\n const isDot = useMemo(() => {\n var _a2;\n return ((_a2 = String(content)) == null ? void 0 : _a2.length) === 0;\n }, [content]);\n const baseStyles = clsx(classNames == null ? void 0 : classNames.badge, className);\n const slots = useMemo(\n () => badge({\n ...variantProps,\n showOutline: !!(originalProps == null ? void 0 : originalProps.disableOutline) ? !(originalProps == null ? void 0 : originalProps.disableOutline) : originalProps == null ? void 0 : originalProps.showOutline,\n isOneChar,\n isDot\n }),\n [objectToDeps(variantProps), isOneChar, isDot]\n );\n const getBadgeProps = () => {\n return {\n className: slots.badge({ class: baseStyles }),\n \"data-invisible\": originalProps.isInvisible,\n ...otherProps\n };\n };\n return {\n Component,\n children,\n content,\n slots,\n classNames,\n disableAnimation,\n isInvisible: originalProps == null ? void 0 : originalProps.isInvisible,\n getBadgeProps\n };\n}\n\nexport {\n useBadge\n};\n","\"use client\";\nimport {\n useBadge\n} from \"./chunk-ESVUYDZQ.mjs\";\n\n// src/badge.tsx\nimport { forwardRef } from \"@heroui/system\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar Badge = forwardRef((props, ref) => {\n const { Component, children, content, slots, classNames, getBadgeProps } = useBadge({\n ...props\n });\n return /* @__PURE__ */ jsxs(\"div\", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [\n children,\n /* @__PURE__ */ jsx(Component, { ref, ...getBadgeProps(), children: content })\n ] });\n});\nBadge.displayName = \"HeroUI.Badge\";\nvar badge_default = Badge;\n\nexport {\n badge_default\n};\n","\"use client\";\n\n// src/base/tab-item-base.ts\nimport { BaseItem } from \"@heroui/aria-utils\";\nvar TabItemBase = BaseItem;\nvar tab_item_base_default = TabItemBase;\n\nexport {\n tab_item_base_default\n};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ const $99b62ae3ff97ec45$export$c5f62239608282b6 = new WeakMap();\nfunction $99b62ae3ff97ec45$export$567fc7097e064344(state, key, role) {\n if (!state) // this case should only happen in the first render before the tabs are registered\n return '';\n if (typeof key === 'string') key = key.replace(/\\s+/g, '');\n let baseId = $99b62ae3ff97ec45$export$c5f62239608282b6.get(state);\n return `${baseId}-${role}-${key}`;\n}\n\n\nexport {$99b62ae3ff97ec45$export$c5f62239608282b6 as tabsIds, $99b62ae3ff97ec45$export$567fc7097e064344 as generateId};\n//# sourceMappingURL=utils.module.js.map\n","import {getFocusableTreeWalker as $9bf71ea28793e738$export$2d6ec8fc375ceafa} from \"./FocusScope.mjs\";\nimport {useLayoutEffect as $hGAaG$useLayoutEffect} from \"@react-aria/utils\";\nimport {useState as $hGAaG$useState} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\nfunction $83013635b024ae3d$export$eac1895992b9f3d6(ref, options) {\n let isDisabled = options === null || options === void 0 ? void 0 : options.isDisabled;\n let [hasTabbableChild, setHasTabbableChild] = (0, $hGAaG$useState)(false);\n (0, $hGAaG$useLayoutEffect)(()=>{\n if ((ref === null || ref === void 0 ? void 0 : ref.current) && !isDisabled) {\n let update = ()=>{\n if (ref.current) {\n let walker = (0, $9bf71ea28793e738$export$2d6ec8fc375ceafa)(ref.current, {\n tabbable: true\n });\n setHasTabbableChild(!!walker.nextNode());\n }\n };\n update();\n // Update when new elements are inserted, or the tabIndex/disabled attribute updates.\n let observer = new MutationObserver(update);\n observer.observe(ref.current, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\n 'tabIndex',\n 'disabled'\n ]\n });\n return ()=>{\n // Disconnect mutation observer when a React update occurs on the top-level component\n // so we update synchronously after re-rendering. Otherwise React will emit act warnings\n // in tests since mutation observers fire asynchronously. The mutation observer is necessary\n // so we also update if a child component re-renders and adds/removes something tabbable.\n observer.disconnect();\n };\n }\n });\n return isDisabled ? false : hasTabbableChild;\n}\n\n\nexport {$83013635b024ae3d$export$eac1895992b9f3d6 as useHasTabbableChild};\n//# sourceMappingURL=useHasTabbableChild.module.js.map\n","import {generateId as $99b62ae3ff97ec45$export$567fc7097e064344} from \"./utils.mjs\";\nimport {useLabels as $jik2T$useLabels, mergeProps as $jik2T$mergeProps} from \"@react-aria/utils\";\nimport {useHasTabbableChild as $jik2T$useHasTabbableChild} from \"@react-aria/focus\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\nfunction $34bce698202e07cb$export$fae0121b5afe572d(props, state, ref) {\n // The tabpanel should have tabIndex=0 when there are no tabbable elements within it.\n // Otherwise, tabbing from the focused tab should go directly to the first tabbable element\n // within the tabpanel.\n let tabIndex = (0, $jik2T$useHasTabbableChild)(ref) ? undefined : 0;\n var _props_id;\n const id = (0, $99b62ae3ff97ec45$export$567fc7097e064344)(state, (_props_id = props.id) !== null && _props_id !== void 0 ? _props_id : state === null || state === void 0 ? void 0 : state.selectedKey, 'tabpanel');\n const tabPanelProps = (0, $jik2T$useLabels)({\n ...props,\n id: id,\n 'aria-labelledby': (0, $99b62ae3ff97ec45$export$567fc7097e064344)(state, state === null || state === void 0 ? void 0 : state.selectedKey, 'tab')\n });\n return {\n tabPanelProps: (0, $jik2T$mergeProps)(tabPanelProps, {\n tabIndex: tabIndex,\n role: 'tabpanel',\n 'aria-describedby': props['aria-describedby'],\n 'aria-details': props['aria-details']\n })\n };\n}\n\n\nexport {$34bce698202e07cb$export$fae0121b5afe572d as useTabPanel};\n//# sourceMappingURL=useTabPanel.module.js.map\n","\"use client\";\n\n// src/tab-panel.tsx\nimport { forwardRef } from \"@heroui/system\";\nimport { useDOMRef } from \"@heroui/react-utils\";\nimport { clsx, getInertValue } from \"@heroui/shared-utils\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport { useTabPanel } from \"@react-aria/tabs\";\nimport { useFocusRing } from \"@react-aria/focus\";\nimport { jsx } from \"react/jsx-runtime\";\nvar TabPanel = forwardRef((props, ref) => {\n var _a, _b;\n const { as, tabKey, destroyInactiveTabPanel, state, className, slots, classNames, ...otherProps } = props;\n const Component = as || \"div\";\n const domRef = useDOMRef(ref);\n const { tabPanelProps } = useTabPanel({ ...props, id: String(tabKey) }, state, domRef);\n const { focusProps, isFocused, isFocusVisible } = useFocusRing();\n const selectedItem = state.selectedItem;\n const content = state.collection.getItem(tabKey).props.children;\n const tabPanelStyles = clsx(classNames == null ? void 0 : classNames.panel, className, (_a = selectedItem == null ? void 0 : selectedItem.props) == null ? void 0 : _a.className);\n const isSelected = tabKey === (selectedItem == null ? void 0 : selectedItem.key);\n if (!content || !isSelected && destroyInactiveTabPanel) {\n return null;\n }\n return /* @__PURE__ */ jsx(\n Component,\n {\n ref: domRef,\n \"data-focus\": isFocused,\n \"data-focus-visible\": isFocusVisible,\n \"data-inert\": !isSelected ? \"true\" : void 0,\n inert: getInertValue(!isSelected),\n ...isSelected && mergeProps(tabPanelProps, focusProps, otherProps),\n className: (_b = slots.panel) == null ? void 0 : _b.call(slots, { class: tabPanelStyles }),\n \"data-slot\": \"panel\",\n children: content\n }\n );\n});\nTabPanel.displayName = \"HeroUI.TabPanel\";\nvar tab_panel_default = TabPanel;\n\nexport {\n tab_panel_default\n};\n","import {generateId as $99b62ae3ff97ec45$export$567fc7097e064344} from \"./utils.mjs\";\nimport {filterDOMProps as $dObGJ$filterDOMProps, useLinkProps as $dObGJ$useLinkProps, mergeProps as $dObGJ$mergeProps} from \"@react-aria/utils\";\nimport {useSelectableItem as $dObGJ$useSelectableItem} from \"@react-aria/selection\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\nfunction $0175d55c2a017ebc$export$fdf4756d5b8ef90a(props, state, ref) {\n let { key: key, isDisabled: propsDisabled, shouldSelectOnPressUp: shouldSelectOnPressUp } = props;\n let { selectionManager: manager, selectedKey: selectedKey } = state;\n let isSelected = key === selectedKey;\n let isDisabled = propsDisabled || state.isDisabled || state.selectionManager.isDisabled(key);\n let { itemProps: itemProps, isPressed: isPressed } = (0, $dObGJ$useSelectableItem)({\n selectionManager: manager,\n key: key,\n ref: ref,\n isDisabled: isDisabled,\n shouldSelectOnPressUp: shouldSelectOnPressUp,\n linkBehavior: 'selection'\n });\n let tabId = (0, $99b62ae3ff97ec45$export$567fc7097e064344)(state, key, 'tab');\n let tabPanelId = (0, $99b62ae3ff97ec45$export$567fc7097e064344)(state, key, 'tabpanel');\n let { tabIndex: tabIndex } = itemProps;\n let item = state.collection.getItem(key);\n let domProps = (0, $dObGJ$filterDOMProps)(item === null || item === void 0 ? void 0 : item.props, {\n labelable: true\n });\n delete domProps.id;\n let linkProps = (0, $dObGJ$useLinkProps)(item === null || item === void 0 ? void 0 : item.props);\n return {\n tabProps: (0, $dObGJ$mergeProps)(domProps, linkProps, itemProps, {\n id: tabId,\n 'aria-selected': isSelected,\n 'aria-disabled': isDisabled || undefined,\n 'aria-controls': isSelected ? tabPanelId : undefined,\n tabIndex: isDisabled ? undefined : tabIndex,\n role: 'tab'\n }),\n isSelected: isSelected,\n isDisabled: isDisabled,\n isPressed: isPressed\n };\n}\n\n\nexport {$0175d55c2a017ebc$export$fdf4756d5b8ef90a as useTab};\n//# sourceMappingURL=useTab.module.js.map\n","import { addDomEvent } from './add-dom-event.mjs';\nimport { addPointerInfo } from './event-info.mjs';\n\nfunction addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options);\n}\n\nexport { addPointerEvent };\n","const distance = (a, b) => Math.abs(a - b);\nfunction distance2D(a, b) {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x);\n const yDelta = distance(a.y, b.y);\n return Math.sqrt(xDelta ** 2 + yDelta ** 2);\n}\n\nexport { distance, distance2D };\n","import { isPrimaryPointer } from 'motion-dom';\nimport { secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\nimport { pipe } from '../../utils/pipe.mjs';\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\n\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursoe.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= 3;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n if (this.dragSnapToOrigin)\n resumeAnimation && resumeAnimation();\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp));\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n","import { mixNumber } from '../../utils/mix/number.mjs';\n\nconst SCALE_PRECISION = 0.0001;\nconst SCALE_MIN = 1 - SCALE_PRECISION;\nconst SCALE_MAX = 1 + SCALE_PRECISION;\nconst TRANSLATE_PRECISION = 0.01;\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION;\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION;\nfunction calcLength(axis) {\n return axis.max - axis.min;\n}\nfunction isNear(value, target, maxDistance) {\n return Math.abs(value - target) <= maxDistance;\n}\nfunction calcAxisDelta(delta, source, target, origin = 0.5) {\n delta.origin = origin;\n delta.originPoint = mixNumber(source.min, source.max, delta.origin);\n delta.scale = calcLength(target) / calcLength(source);\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint;\n if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)) {\n delta.scale = 1.0;\n }\n if ((delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)) {\n delta.translate = 0.0;\n }\n}\nfunction calcBoxDelta(delta, source, target, origin) {\n calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);\n calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);\n}\nfunction calcRelativeAxis(target, relative, parent) {\n target.min = parent.min + relative.min;\n target.max = target.min + calcLength(relative);\n}\nfunction calcRelativeBox(target, relative, parent) {\n calcRelativeAxis(target.x, relative.x, parent.x);\n calcRelativeAxis(target.y, relative.y, parent.y);\n}\nfunction calcRelativeAxisPosition(target, layout, parent) {\n target.min = layout.min - parent.min;\n target.max = target.min + calcLength(layout);\n}\nfunction calcRelativePosition(target, layout, parent) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x);\n calcRelativeAxisPosition(target.y, layout.y, parent.y);\n}\n\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };\n","import { progress } from 'motion-utils';\nimport { calcLength } from '../../../projection/geometry/delta-calc.mjs';\nimport { clamp } from '../../../utils/clamp.mjs';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nfunction applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nfunction calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nfunction calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = progress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nfunction rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nconst defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nfunction resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nfunction resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\n","function eachAxis(callback) {\n return [callback(\"x\"), callback(\"y\")];\n}\n\nexport { eachAxis };\n","// Fixes https://github.com/motiondivision/motion/issues/2270\nconst getContextWindow = ({ current }) => {\n return current ? current.ownerDocument.defaultView : null;\n};\n\nexport { getContextWindow };\n","import { invariant } from 'motion-utils';\nimport { setDragLock } from 'motion-dom';\nimport { PanSession } from '../pan/PanSession.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { eachAxis } from '../../projection/utils/each-axis.mjs';\nimport { measurePageBox } from '../../projection/utils/measure.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { convertBoxToBoundingBox, convertBoundingBoxToBox } from '../../projection/geometry/conversion.mjs';\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\nimport { calcLength } from '../../projection/geometry/delta-calc.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent } from '../../value/types/numbers/units.mjs';\nimport { animateMotionValue } from '../../animation/interfaces/motion-value.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst elementDragControls = new WeakMap();\n/**\n *\n */\n// let latestPointerEvent: PointerEvent\nclass VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n const { dragSnapToOrigin } = this.getProps();\n // Stop or pause any animations on both axis values immediately. This allows the user to throw and catch\n // the component.\n dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.postRender(() => onDragStart(event, info));\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n // latestPointerEvent = event\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n onDrag && onDrag(event, info);\n };\n const onSessionEnd = (event, info) => this.stop(event, info);\n const resumeAnimation = () => eachAxis((axis) => {\n var _a;\n return this.getAnimationState(axis) === \"paused\" &&\n ((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play());\n });\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n contextWindow: getContextWindow(this.visualElement),\n });\n }\n stop(event, info) {\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging)\n return;\n const { velocity } = info;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(event, info));\n }\n }\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n var _a;\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative.\n */\n if (prevConstraints !== this.constraints &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n pauseAnimation() {\n eachAxis((axis) => { var _a; return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); });\n }\n getAnimationState(axis) {\n var _a;\n return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state;\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, (props.initial\n ? props.initial[axis]\n : undefined) || 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n axisValue.set(point[axis] - mixNumber(min, max, 0.5));\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n drag && dragListener && this.start(event);\n });\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\n\nexport { VisualElementDragControls, elementDragControls };\n","import { Feature } from '../../motion/features/Feature.mjs';\nimport { noop } from 'motion-utils';\nimport { VisualElementDragControls } from './VisualElementDragControls.mjs';\n\nclass DragGesture extends Feature {\n constructor(node) {\n super(node);\n this.removeGroupControls = noop;\n this.removeListeners = noop;\n this.controls = new VisualElementDragControls(node);\n }\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n this.removeListeners = this.controls.addListeners() || noop;\n }\n unmount() {\n this.removeGroupControls();\n this.removeListeners();\n }\n}\n\nexport { DragGesture };\n","import { PanSession } from './PanSession.mjs';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { Feature } from '../../motion/features/Feature.mjs';\nimport { noop } from 'motion-utils';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst asyncHandler = (handler) => (event, info) => {\n if (handler) {\n frame.postRender(() => handler(event, info));\n }\n};\nclass PanGesture extends Feature {\n constructor() {\n super(...arguments);\n this.removePointerDownListener = noop;\n }\n onPointerDown(pointerDownEvent) {\n this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n });\n }\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: onPan,\n onEnd: (event, info) => {\n delete this.session;\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info));\n }\n },\n };\n }\n mount() {\n this.removePointerDownListener = addPointerEvent(this.node.current, \"pointerdown\", (event) => this.onPointerDown(event));\n }\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers());\n }\n unmount() {\n this.removePointerDownListener();\n this.session && this.session.end();\n }\n}\n\nexport { PanGesture };\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nconst globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n};\n\nexport { globalProjectionState };\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { complex } from '../../value/types/complex/index.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { useContext, Component } from 'react';\nimport { usePresence } from '../../../components/AnimatePresence/use-presence.mjs';\nimport { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs';\nimport { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs';\nimport { globalProjectionState } from '../../../projection/node/state.mjs';\nimport { correctBorderRadius } from '../../../projection/styles/scale-border-radius.mjs';\nimport { correctBoxShadow } from '../../../projection/styles/scale-box-shadow.mjs';\nimport { addScaleCorrector } from '../../../projection/styles/scale-correction.mjs';\nimport { microtask } from '../../../frameloop/microtask.mjs';\nimport { frame } from '../../../frameloop/frame.mjs';\n\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;\n const { projection } = visualElement;\n addScaleCorrector(defaultScaleCorrectors);\n if (projection) {\n if (layoutGroup.group)\n layoutGroup.group.add(projection);\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection);\n }\n projection.root.didUpdate();\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove();\n });\n projection.setOptions({\n ...projection.options,\n onExitComplete: () => this.safeToRemove(),\n });\n }\n globalProjectionState.hasEverUpdated = true;\n }\n getSnapshotBeforeUpdate(prevProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props;\n const projection = visualElement.projection;\n if (!projection)\n return null;\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent;\n if (drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined) {\n projection.willUpdate();\n }\n else {\n this.safeToRemove();\n }\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote();\n }\n else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack();\n if (!stack || !stack.members.length) {\n this.safeToRemove();\n }\n });\n }\n }\n return null;\n }\n componentDidUpdate() {\n const { projection } = this.props.visualElement;\n if (projection) {\n projection.root.didUpdate();\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove();\n }\n });\n }\n }\n componentWillUnmount() {\n const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;\n const { projection } = visualElement;\n if (projection) {\n projection.scheduleCheckAfterUnmount();\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection);\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection);\n }\n }\n safeToRemove() {\n const { safeToRemove } = this.props;\n safeToRemove && safeToRemove();\n }\n render() {\n return null;\n }\n}\nfunction MeasureLayout(props) {\n const [isPresent, safeToRemove] = usePresence();\n const layoutGroup = useContext(LayoutGroupContext);\n return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));\n}\nconst defaultScaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\n\nexport { MeasureLayout };\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { animateMotionValue } from '../interfaces/motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n","function isSVGElement(element) {\n return element instanceof SVGElement && element.tagName !== \"svg\";\n}\n\nexport { isSVGElement };\n","const compareByDepth = (a, b) => a.depth - b.depth;\n\nexport { compareByDepth };\n","import { addUniqueItem, removeItem } from '../../utils/array.mjs';\nimport { compareByDepth } from './compare-by-depth.mjs';\n\nclass FlatTree {\n constructor() {\n this.children = [];\n this.isDirty = false;\n }\n add(child) {\n addUniqueItem(this.children, child);\n this.isDirty = true;\n }\n remove(child) {\n removeItem(this.children, child);\n this.isDirty = true;\n }\n forEach(callback) {\n this.isDirty && this.children.sort(compareByDepth);\n this.isDirty = false;\n this.children.forEach(callback);\n }\n}\n\nexport { FlatTree };\n","import { secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\n/**\n * Timeout defined in ms\n */\nfunction delay(callback, timeout) {\n const start = time.now();\n const checkElapsed = ({ timestamp }) => {\n const elapsed = timestamp - start;\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed);\n callback(elapsed - timeout);\n }\n };\n frame.read(checkElapsed, true);\n return () => cancelFrame(checkElapsed);\n}\nfunction delayInSeconds(callback, timeout) {\n return delay(callback, secondsToMilliseconds(timeout));\n}\n\nexport { delay, delayInSeconds };\n","import { progress, noop } from 'motion-utils';\nimport { circOut } from '../../easing/circ.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent, px } from '../../value/types/numbers/units.mjs';\n\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"];\nconst numBorders = borders.length;\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(0, \n // TODO Reinstate this if only child\n lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress));\n target.opacityExit = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress));\n }\n else if (isOnlyMember) {\n target.opacity = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress);\n }\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = `border${borders[i]}Radius`;\n let followRadius = getRadius(follow, borderLabel);\n let leadRadius = getRadius(lead, borderLabel);\n if (followRadius === undefined && leadRadius === undefined)\n continue;\n followRadius || (followRadius = 0);\n leadRadius || (leadRadius = 0);\n const canMix = followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius);\n if (canMix) {\n target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\";\n }\n }\n else {\n target[borderLabel] = leadRadius;\n }\n }\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);\n }\n}\nfunction getRadius(values, radiusName) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius;\n}\n// /**\n// * We only want to mix the background color if there's a follow element\n// * that we're not crossfading opacity between. For instance with switch\n// * AnimateSharedLayout animations, this helps the illusion of a continuous\n// * element being animated but also cuts down on the number of paints triggered\n// * for elements where opacity is doing that work for us.\n// */\n// if (\n// !hasFollowElement &&\n// latestLeadValues.backgroundColor &&\n// latestFollowValues.backgroundColor\n// ) {\n// /**\n// * This isn't ideal performance-wise as mixColor is creating a new function every frame.\n// * We could probably create a mixer that runs at the start of the animation but\n// * the idea behind the crossfader is that it runs dynamically between two potentially\n// * changing targets (ie opacity or borderRadius may be animating independently via variants)\n// */\n// leadState.backgroundColor = followState.backgroundColor = mixColor(\n// latestFollowValues.backgroundColor as string,\n// latestLeadValues.backgroundColor as string\n// )(p)\n// }\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop);\nfunction compress(min, max, easing) {\n return (p) => {\n // Could replace ifs with clamp\n if (p < min)\n return 0;\n if (p > max)\n return 1;\n return easing(progress(min, max, p));\n };\n}\n\nexport { mixValues };\n","/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisInto(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyBoxInto(box, originBox) {\n copyAxisInto(box.x, originBox.x);\n copyAxisInto(box.y, originBox.y);\n}\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisDeltaInto(delta, originDelta) {\n delta.translate = originDelta.translate;\n delta.scale = originDelta.scale;\n delta.originPoint = originDelta.originPoint;\n delta.origin = originDelta.origin;\n}\n\nexport { copyAxisDeltaInto, copyAxisInto, copyBoxInto };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent } from '../../value/types/numbers/units.mjs';\nimport { scalePoint } from './delta-apply.mjs';\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\n point -= translate;\n point = scalePoint(point, 1 / scale, originPoint);\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint);\n }\n return point;\n}\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nfunction removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {\n if (percent.test(translate)) {\n translate = parseFloat(translate);\n const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);\n translate = relativeProgress - sourceAxis.min;\n }\n if (typeof translate !== \"number\")\n return;\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin);\n if (axis === originAxis)\n originPoint -= translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\n}\n\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };\n","import { calcLength } from './delta-calc.mjs';\n\nfunction isAxisDeltaZero(delta) {\n return delta.translate === 0 && delta.scale === 1;\n}\nfunction isDeltaZero(delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);\n}\nfunction axisEquals(a, b) {\n return a.min === b.min && a.max === b.max;\n}\nfunction boxEquals(a, b) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);\n}\nfunction axisEqualsRounded(a, b) {\n return (Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max));\n}\nfunction boxEqualsRounded(a, b) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);\n}\nfunction aspectRatio(box) {\n return calcLength(box.x) / calcLength(box.y);\n}\nfunction axisDeltaEquals(a, b) {\n return (a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint);\n}\n\nexport { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero };\n","import { addUniqueItem, removeItem } from '../../utils/array.mjs';\n\nclass NodeStack {\n constructor() {\n this.members = [];\n }\n add(node) {\n addUniqueItem(this.members, node);\n node.scheduleRender();\n }\n remove(node) {\n removeItem(this.members, node);\n if (node === this.prevLead) {\n this.prevLead = undefined;\n }\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1];\n if (prevLead) {\n this.promote(prevLead);\n }\n }\n }\n relegate(node) {\n const indexOfNode = this.members.findIndex((member) => node === member);\n if (indexOfNode === 0)\n return false;\n /**\n * Find the next projection node that is present\n */\n let prevLead;\n for (let i = indexOfNode; i >= 0; i--) {\n const member = this.members[i];\n if (member.isPresent !== false) {\n prevLead = member;\n break;\n }\n }\n if (prevLead) {\n this.promote(prevLead);\n return true;\n }\n else {\n return false;\n }\n }\n promote(node, preserveFollowOpacity) {\n const prevLead = this.lead;\n if (node === prevLead)\n return;\n this.prevLead = prevLead;\n this.lead = node;\n node.show();\n if (prevLead) {\n prevLead.instance && prevLead.scheduleRender();\n node.scheduleRender();\n node.resumeFrom = prevLead;\n if (preserveFollowOpacity) {\n node.resumeFrom.preserveOpacity = true;\n }\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot;\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues;\n }\n if (node.root && node.root.isUpdating) {\n node.isLayoutDirty = true;\n }\n const { crossfade } = node.options;\n if (crossfade === false) {\n prevLead.hide();\n }\n /**\n * TODO:\n * - Test border radius when previous node was deleted\n * - boxShadow mixing\n * - Shared between element A in scrolled container and element B (scroll stays the same or changes)\n * - Shared between element A in transformed container and element B (transform stays the same or changes)\n * - Shared between element A in scrolled page and element B (scroll stays the same or changes)\n * ---\n * - Crossfade opacity of root nodes\n * - layoutId changes after animation\n * - layoutId changes mid animation\n */\n }\n }\n exitAnimationComplete() {\n this.members.forEach((node) => {\n const { options, resumingFrom } = node;\n options.onExitComplete && options.onExitComplete();\n if (resumingFrom) {\n resumingFrom.options.onExitComplete &&\n resumingFrom.options.onExitComplete();\n }\n });\n }\n scheduleRender() {\n this.members.forEach((node) => {\n node.instance && node.scheduleRender(false);\n });\n }\n /**\n * Clear any leads that have been removed this render to prevent them from being\n * used in future animations and to prevent memory leaks\n */\n removeLeadSnapshot() {\n if (this.lead && this.lead.snapshot) {\n this.lead.snapshot = undefined;\n }\n }\n}\n\nexport { NodeStack };\n","function buildProjectionTransform(delta, treeScale, latestTransform) {\n let transform = \"\";\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x;\n const yTranslate = delta.y.translate / treeScale.y;\n const zTranslate = (latestTransform === null || latestTransform === void 0 ? void 0 : latestTransform.z) || 0;\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;\n }\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;\n }\n if (latestTransform) {\n const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform;\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`;\n if (rotate)\n transform += `rotate(${rotate}deg) `;\n if (rotateX)\n transform += `rotateX(${rotateX}deg) `;\n if (rotateY)\n transform += `rotateY(${rotateY}deg) `;\n if (skewX)\n transform += `skewX(${skewX}deg) `;\n if (skewY)\n transform += `skewY(${skewY}deg) `;\n }\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x;\n const elementScaleY = delta.y.scale * treeScale.y;\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`;\n }\n return transform || \"none\";\n}\n\nexport { buildProjectionTransform };\n","import { getValueTransition } from 'motion-dom';\nimport { noop } from 'motion-utils';\nimport { animateSingleValue } from '../../animation/animate/single-value.mjs';\nimport { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';\nimport { cancelFrame, frameData, frameSteps, frame } from '../../frameloop/frame.mjs';\nimport { microtask } from '../../frameloop/microtask.mjs';\nimport { time } from '../../frameloop/sync-time.mjs';\nimport { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';\nimport { FlatTree } from '../../render/utils/flat-tree.mjs';\nimport { clamp } from '../../utils/clamp.mjs';\nimport { delay } from '../../utils/delay.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { SubscriptionManager } from '../../utils/subscription-manager.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\nimport { mixValues } from '../animation/mix-values.mjs';\nimport { copyBoxInto, copyAxisDeltaInto } from '../geometry/copy.mjs';\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\nimport { calcRelativePosition, calcRelativeBox, calcBoxDelta, calcLength, isNear } from '../geometry/delta-calc.mjs';\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\nimport { createBox, createDelta } from '../geometry/models.mjs';\nimport { boxEqualsRounded, isDeltaZero, axisDeltaEquals, aspectRatio, boxEquals } from '../geometry/utils.mjs';\nimport { NodeStack } from '../shared/stack.mjs';\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\nimport { buildProjectionTransform } from '../styles/transform.mjs';\nimport { eachAxis } from '../utils/each-axis.mjs';\nimport { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';\nimport { globalProjectionState } from './state.mjs';\n\nconst metrics = {\n type: \"projectionFrame\",\n totalNodes: 0,\n resolvedTargetDeltas: 0,\n recalculatedProjection: 0,\n};\nconst isDebug = typeof window !== \"undefined\" && window.MotionDebug !== undefined;\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\nconst hiddenVisibility = { visibility: \"hidden\" };\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000;\nlet id = 0;\nfunction resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {\n const { latestValues } = visualElement;\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key];\n visualElement.setStaticValue(key, 0);\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0;\n }\n }\n}\nfunction cancelTreeOptimisedTransformAnimations(projectionNode) {\n projectionNode.hasCheckedOptimisedAppear = true;\n if (projectionNode.root === projectionNode)\n return;\n const { visualElement } = projectionNode.options;\n if (!visualElement)\n return;\n const appearId = getOptimisedAppearId(visualElement);\n if (window.MotionHasOptimisedAnimation(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options;\n window.MotionCancelOptimisedAnimation(appearId, \"transform\", frame, !(layout || layoutId));\n }\n const { parent } = projectionNode;\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent);\n }\n}\nfunction createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {\n return class ProjectionNode {\n constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {\n /**\n * A unique ID generated for every projection node.\n */\n this.id = id++;\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n this.animationId = 0;\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n this.children = new Set();\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n this.options = {};\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n this.isTreeAnimating = false;\n this.isAnimationBlocked = false;\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n this.isLayoutDirty = false;\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n this.isProjectionDirty = false;\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n this.isSharedProjectionDirty = false;\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n this.isTransformDirty = false;\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n this.updateManuallyBlocked = false;\n this.updateBlockedByResize = false;\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n this.isUpdating = false;\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n this.isSVG = false;\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n this.needsReset = false;\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n this.shouldResetTransform = false;\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n this.hasCheckedOptimisedAppear = false;\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n this.treeScale = { x: 1, y: 1 };\n /**\n *\n */\n this.eventHandlers = new Map();\n this.hasTreeAnimated = false;\n // Note: Currently only running on root node\n this.updateScheduled = false;\n this.scheduleUpdate = () => this.update();\n this.projectionUpdateScheduled = false;\n this.checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false;\n this.clearAllSnapshots();\n }\n };\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n this.updateProjection = () => {\n this.projectionUpdateScheduled = false;\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (isDebug) {\n metrics.totalNodes =\n metrics.resolvedTargetDeltas =\n metrics.recalculatedProjection =\n 0;\n }\n this.nodes.forEach(propagateDirtyNodes);\n this.nodes.forEach(resolveTargetDelta);\n this.nodes.forEach(calcProjection);\n this.nodes.forEach(cleanDirtyNodes);\n if (isDebug) {\n window.MotionDebug.record(metrics);\n }\n };\n /**\n * Frame calculations\n */\n this.resolvedRelativeTargetAt = 0.0;\n this.hasProjected = false;\n this.isVisible = true;\n this.animationProgress = 0;\n /**\n * Shared layout\n */\n // TODO Only running on root node\n this.sharedNodes = new Map();\n this.latestValues = latestValues;\n this.root = parent ? parent.root || parent : this;\n this.path = parent ? [...parent.path, parent] : [];\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true;\n }\n if (this.root === this)\n this.nodes = new FlatTree();\n }\n addEventListener(name, handler) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager());\n }\n return this.eventHandlers.get(name).add(handler);\n }\n notifyListeners(name, ...args) {\n const subscriptionManager = this.eventHandlers.get(name);\n subscriptionManager && subscriptionManager.notify(...args);\n }\n hasListeners(name) {\n return this.eventHandlers.has(name);\n }\n /**\n * Lifecycles\n */\n mount(instance, isLayoutDirty = this.root.hasTreeAnimated) {\n if (this.instance)\n return;\n this.isSVG = isSVGElement(instance);\n this.instance = instance;\n const { layoutId, layout, visualElement } = this.options;\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance);\n }\n this.root.nodes.add(this);\n this.parent && this.parent.children.add(this);\n if (isLayoutDirty && (layout || layoutId)) {\n this.isLayoutDirty = true;\n }\n if (attachResizeListener) {\n let cancelDelay;\n const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);\n attachResizeListener(instance, () => {\n this.root.updateBlockedByResize = true;\n cancelDelay && cancelDelay();\n cancelDelay = delay(resizeUnblockUpdate, 250);\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false;\n this.nodes.forEach(finishAnimation);\n }\n });\n }\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this);\n }\n // Only register the handler if it requires layout animation\n if (this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)) {\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout, }) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined;\n this.relativeTarget = undefined;\n return;\n }\n // TODO: Check here if an animation exists\n const layoutTransition = this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition;\n const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const targetChanged = !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout) ||\n hasRelativeTargetChanged;\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged;\n if (this.options.layoutRoot ||\n (this.resumeFrom && this.resumeFrom.instance) ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (targetChanged || !this.currentAnimation))) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom;\n this.resumingFrom.resumingFrom = undefined;\n }\n this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);\n const animationOptions = {\n ...getValueTransition(layoutTransition, \"layout\"),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n };\n if (visualElement.shouldReduceMotion ||\n this.options.layoutRoot) {\n animationOptions.delay = 0;\n animationOptions.type = false;\n }\n this.startAnimation(animationOptions);\n }\n else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never commited to screen and look like a jumpy box.\n */\n if (!hasLayoutChanged) {\n finishAnimation(this);\n }\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete();\n }\n }\n this.targetLayout = newLayout;\n });\n }\n }\n unmount() {\n this.options.layoutId && this.willUpdate();\n this.root.nodes.remove(this);\n const stack = this.getStack();\n stack && stack.remove(this);\n this.parent && this.parent.children.delete(this);\n this.instance = undefined;\n cancelFrame(this.updateProjection);\n }\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true;\n }\n unblockUpdate() {\n this.updateManuallyBlocked = false;\n }\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize;\n }\n isTreeAnimationBlocked() {\n return (this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false);\n }\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked())\n return;\n this.isUpdating = true;\n this.nodes && this.nodes.forEach(resetSkewAndRotation);\n this.animationId++;\n }\n getTransformTemplate() {\n const { visualElement } = this.options;\n return visualElement && visualElement.getProps().transformTemplate;\n }\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true;\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete();\n return;\n }\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(this);\n }\n !this.root.isUpdating && this.root.startUpdate();\n if (this.isLayoutDirty)\n return;\n this.isLayoutDirty = true;\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.shouldResetTransform = true;\n node.updateScroll(\"snapshot\");\n if (node.options.layoutRoot) {\n node.willUpdate(false);\n }\n }\n const { layoutId, layout } = this.options;\n if (layoutId === undefined && !layout)\n return;\n const transformTemplate = this.getTransformTemplate();\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n this.updateSnapshot();\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\n }\n update() {\n this.updateScheduled = false;\n const updateWasBlocked = this.isUpdateBlocked();\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n this.unblockUpdate();\n this.clearAllSnapshots();\n this.nodes.forEach(clearMeasurements);\n return;\n }\n if (!this.isUpdating) {\n this.nodes.forEach(clearIsLayoutDirty);\n }\n this.isUpdating = false;\n /**\n * Write\n */\n this.nodes.forEach(resetTransformStyle);\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes.forEach(updateLayout);\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes.forEach(notifyLayoutUpdate);\n this.clearAllSnapshots();\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now();\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);\n frameData.timestamp = now;\n frameData.isProcessing = true;\n frameSteps.update.process(frameData);\n frameSteps.preRender.process(frameData);\n frameSteps.render.process(frameData);\n frameData.isProcessing = false;\n }\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true;\n microtask.read(this.scheduleUpdate);\n }\n }\n clearAllSnapshots() {\n this.nodes.forEach(clearSnapshot);\n this.sharedNodes.forEach(removeLeadSnapshots);\n }\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true;\n frame.preRender(this.updateProjection, false, true);\n }\n }\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate();\n }\n else {\n this.root.checkUpdateFailed();\n }\n });\n }\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance)\n return;\n this.snapshot = this.measure();\n }\n updateLayout() {\n if (!this.instance)\n return;\n // TODO: Incorporate into a forwarded scroll offset\n this.updateScroll();\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty) {\n return;\n }\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.updateScroll();\n }\n }\n const prevLayout = this.layout;\n this.layout = this.measure(false);\n this.layoutCorrected = createBox();\n this.isLayoutDirty = false;\n this.projectionDelta = undefined;\n this.notifyListeners(\"measure\", this.layout.layoutBox);\n const { visualElement } = this.options;\n visualElement &&\n visualElement.notify(\"LayoutMeasure\", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);\n }\n updateScroll(phase = \"measure\") {\n let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);\n if (this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase) {\n needsMeasurement = false;\n }\n if (needsMeasurement) {\n const isRoot = checkIsScrollRoot(this.instance);\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n };\n }\n }\n resetTransform() {\n if (!resetTransform)\n return;\n const isResetRequested = this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout;\n const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\n const transformTemplate = this.getTransformTemplate();\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\n if (isResetRequested &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)) {\n resetTransform(this.instance, transformTemplateValue);\n this.shouldResetTransform = false;\n this.scheduleRender();\n }\n }\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox();\n let layoutBox = this.removeElementScroll(pageBox);\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox);\n }\n roundBox(layoutBox);\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n };\n }\n measurePageBox() {\n var _a;\n const { visualElement } = this.options;\n if (!visualElement)\n return createBox();\n const box = visualElement.measureViewportBox();\n const wasInScrollRoot = ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) || this.path.some(checkNodeWasScrollRoot);\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root;\n if (scroll) {\n translateAxis(box.x, scroll.offset.x);\n translateAxis(box.y, scroll.offset.y);\n }\n }\n return box;\n }\n removeElementScroll(box) {\n var _a;\n const boxWithoutScroll = createBox();\n copyBoxInto(boxWithoutScroll, box);\n if ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) {\n return boxWithoutScroll;\n }\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n const { scroll, options } = node;\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box);\n }\n translateAxis(boxWithoutScroll.x, scroll.offset.x);\n translateAxis(boxWithoutScroll.y, scroll.offset.y);\n }\n }\n return boxWithoutScroll;\n }\n applyTransform(box, transformOnly = false) {\n const withTransforms = createBox();\n copyBoxInto(withTransforms, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(withTransforms, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (!hasTransform(node.latestValues))\n continue;\n transformBox(withTransforms, node.latestValues);\n }\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues);\n }\n return withTransforms;\n }\n removeTransform(box) {\n const boxWithoutTransform = createBox();\n copyBoxInto(boxWithoutTransform, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!node.instance)\n continue;\n if (!hasTransform(node.latestValues))\n continue;\n hasScale(node.latestValues) && node.updateSnapshot();\n const sourceBox = createBox();\n const nodeBox = node.measurePageBox();\n copyBoxInto(sourceBox, nodeBox);\n removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);\n }\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\n }\n return boxWithoutTransform;\n }\n setTargetDelta(delta) {\n this.targetDelta = delta;\n this.root.scheduleUpdateProjection();\n this.isProjectionDirty = true;\n }\n setOptions(options) {\n this.options = {\n ...this.options,\n ...options,\n crossfade: options.crossfade !== undefined ? options.crossfade : true,\n };\n }\n clearMeasurements() {\n this.scroll = undefined;\n this.layout = undefined;\n this.snapshot = undefined;\n this.prevTransformTemplateValue = undefined;\n this.targetDelta = undefined;\n this.target = undefined;\n this.isLayoutDirty = false;\n }\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent)\n return;\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp) {\n this.relativeParent.resolveTargetDelta(true);\n }\n }\n resolveTargetDelta(forceRecalculation = false) {\n var _a;\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead();\n this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);\n this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);\n this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize);\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId))\n return;\n this.resolvedRelativeTargetAt = frameData.timestamp;\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n relativeParent.layout &&\n this.animationProgress !== 1) {\n this.relativeParent = relativeParent;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta)\n return;\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox();\n this.targetWithTransforms = createBox();\n }\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target) {\n this.forceRelativeParentToResolveTarget();\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n }\n else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n // TODO: This is creating a new object every frame\n this.target = this.applyTransform(this.layout.layoutBox);\n }\n else {\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n applyBoxDelta(this.target, this.targetDelta);\n }\n else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false;\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1) {\n this.relativeParent = relativeParent;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * Increase debug counter for resolved target deltas\n */\n if (isDebug) {\n metrics.resolvedTargetDeltas++;\n }\n }\n getClosestProjectingParent() {\n if (!this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)) {\n return undefined;\n }\n if (this.parent.isProjecting()) {\n return this.parent;\n }\n else {\n return this.parent.getClosestProjectingParent();\n }\n }\n isProjecting() {\n return Boolean((this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout);\n }\n calcProjection() {\n var _a;\n const lead = this.getLead();\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n let canSkip = true;\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) {\n canSkip = false;\n }\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)) {\n canSkip = false;\n }\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false;\n }\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation);\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined;\n }\n if (!this.layout || !(layout || layoutId))\n return;\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox);\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x;\n const prevTreeScaleY = this.treeScale.y;\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {\n lead.target = lead.layout.layoutBox;\n lead.targetWithTransforms = createBox();\n }\n const { target } = lead;\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas();\n this.scheduleRender();\n }\n return;\n }\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas();\n }\n else {\n copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x);\n copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y);\n }\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\n if (this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) ||\n !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) {\n this.hasProjected = true;\n this.scheduleRender();\n this.notifyListeners(\"projectionUpdate\", target);\n }\n /**\n * Increase debug counter for recalculated projections\n */\n if (isDebug) {\n metrics.recalculatedProjection++;\n }\n }\n hide() {\n this.isVisible = false;\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true;\n // TODO: Schedule render\n }\n scheduleRender(notifyAll = true) {\n var _a;\n (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.scheduleRender();\n if (notifyAll) {\n const stack = this.getStack();\n stack && stack.scheduleRender();\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined;\n }\n }\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta();\n this.projectionDelta = createDelta();\n this.projectionDeltaWithTransform = createDelta();\n }\n setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {\n const snapshot = this.snapshot;\n const snapshotLatestValues = snapshot\n ? snapshot.latestValues\n : {};\n const mixedValues = { ...this.latestValues };\n const targetDelta = createDelta();\n if (!this.relativeParent ||\n !this.relativeParent.options.layoutRoot) {\n this.relativeTarget = this.relativeTargetOrigin = undefined;\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\n const relativeLayout = createBox();\n const snapshotSource = snapshot ? snapshot.source : undefined;\n const layoutSource = this.layout ? this.layout.source : undefined;\n const isSharedLayoutAnimation = snapshotSource !== layoutSource;\n const stack = this.getStack();\n const isOnlyMember = !stack || stack.members.length <= 1;\n const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade));\n this.animationProgress = 0;\n let prevRelativeTarget;\n this.mixTargetDelta = (latest) => {\n const progress = latest / 1000;\n mixAxisDelta(targetDelta.x, delta.x, progress);\n mixAxisDelta(targetDelta.y, delta.y, progress);\n this.setTargetDelta(targetDelta);\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout) {\n calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);\n mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)) {\n this.isProjectionDirty = false;\n }\n if (!prevRelativeTarget)\n prevRelativeTarget = createBox();\n copyBoxInto(prevRelativeTarget, this.relativeTarget);\n }\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues;\n mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\n }\n this.root.scheduleUpdateProjection();\n this.scheduleRender();\n this.animationProgress = progress;\n };\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);\n }\n startAnimation(options) {\n this.notifyListeners(\"animationStart\");\n this.currentAnimation && this.currentAnimation.stop();\n if (this.resumingFrom && this.resumingFrom.currentAnimation) {\n this.resumingFrom.currentAnimation.stop();\n }\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation);\n this.pendingAnimation = undefined;\n }\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true;\n this.currentAnimation = animateSingleValue(0, animationTarget, {\n ...options,\n onUpdate: (latest) => {\n this.mixTargetDelta(latest);\n options.onUpdate && options.onUpdate(latest);\n },\n onComplete: () => {\n options.onComplete && options.onComplete();\n this.completeAnimation();\n },\n });\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation;\n }\n this.pendingAnimation = undefined;\n });\n }\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined;\n this.resumingFrom.preserveOpacity = undefined;\n }\n const stack = this.getStack();\n stack && stack.exitAnimationComplete();\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined;\n this.notifyListeners(\"animationComplete\");\n }\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget);\n this.currentAnimation.stop();\n }\n this.completeAnimation();\n }\n applyTransformsToTarget() {\n const lead = this.getLead();\n let { targetWithTransforms, target, layout, latestValues } = lead;\n if (!targetWithTransforms || !target || !layout)\n return;\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {\n target = this.target || createBox();\n const xLength = calcLength(this.layout.layoutBox.x);\n target.x.min = lead.target.x.min;\n target.x.max = target.x.min + xLength;\n const yLength = calcLength(this.layout.layoutBox.y);\n target.y.min = lead.target.y.min;\n target.y.max = target.y.min + yLength;\n }\n copyBoxInto(targetWithTransforms, target);\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues);\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\n }\n registerSharedNode(layoutId, node) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack());\n }\n const stack = this.sharedNodes.get(layoutId);\n stack.add(node);\n const config = node.options.initialPromotionConfig;\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity: config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n });\n }\n isLead() {\n const stack = this.getStack();\n return stack ? stack.lead === this : true;\n }\n getLead() {\n var _a;\n const { layoutId } = this.options;\n return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this;\n }\n getPrevLead() {\n var _a;\n const { layoutId } = this.options;\n return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined;\n }\n getStack() {\n const { layoutId } = this.options;\n if (layoutId)\n return this.root.sharedNodes.get(layoutId);\n }\n promote({ needsReset, transition, preserveFollowOpacity, } = {}) {\n const stack = this.getStack();\n if (stack)\n stack.promote(this, preserveFollowOpacity);\n if (needsReset) {\n this.projectionDelta = undefined;\n this.needsReset = true;\n }\n if (transition)\n this.setOptions({ transition });\n }\n relegate() {\n const stack = this.getStack();\n if (stack) {\n return stack.relegate(this);\n }\n else {\n return false;\n }\n }\n resetSkewAndRotation() {\n const { visualElement } = this.options;\n if (!visualElement)\n return;\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false;\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement;\n if (latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY) {\n hasDistortingTransform = true;\n }\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform)\n return;\n const resetValues = {};\n if (latestValues.z) {\n resetDistortingTransform(\"z\", visualElement, resetValues, this.animationValues);\n }\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n }\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render();\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key]);\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key];\n }\n }\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender();\n }\n getProjectionStyles(styleProp) {\n var _a, _b;\n if (!this.instance || this.isSVG)\n return undefined;\n if (!this.isVisible) {\n return hiddenVisibility;\n }\n const styles = {\n visibility: \"\",\n };\n const transformTemplate = this.getTransformTemplate();\n if (this.needsReset) {\n this.needsReset = false;\n styles.opacity = \"\";\n styles.pointerEvents =\n resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\";\n styles.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\";\n return styles;\n }\n const lead = this.getLead();\n if (!this.projectionDelta || !this.layout || !lead.target) {\n const emptyStyles = {};\n if (this.options.layoutId) {\n emptyStyles.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1;\n emptyStyles.pointerEvents =\n resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\";\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n emptyStyles.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n this.hasProjected = false;\n }\n return emptyStyles;\n }\n const valuesToRender = lead.animationValues || lead.latestValues;\n this.applyTransformsToTarget();\n styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\n if (transformTemplate) {\n styles.transform = transformTemplate(valuesToRender, styles.transform);\n }\n const { x, y } = this.projectionDelta;\n styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n styles.opacity =\n lead === this\n ? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit;\n }\n else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n styles.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0;\n }\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined)\n continue;\n const { correct, applyTo } = scaleCorrectors[key];\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected = styles.transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead);\n if (applyTo) {\n const num = applyTo.length;\n for (let i = 0; i < num; i++) {\n styles[applyTo[i]] = corrected;\n }\n }\n else {\n styles[key] = corrected;\n }\n }\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n styles.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\"\n : \"none\";\n }\n return styles;\n }\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined;\n }\n // Only run on root\n resetTree() {\n this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }\n };\n}\nfunction updateLayout(node) {\n node.updateLayout();\n}\nfunction notifyLayoutUpdate(node) {\n var _a;\n const snapshot = ((_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node.snapshot;\n if (node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;\n const { animationType } = node.options;\n const isShared = snapshot.source !== node.layout.source;\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(axisSnapshot);\n axisSnapshot.min = layout[axis].min;\n axisSnapshot.max = axisSnapshot.min + length;\n });\n }\n else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(layout[axis]);\n axisSnapshot.max = axisSnapshot.min + length;\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true;\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length;\n }\n });\n }\n const layoutDelta = createDelta();\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);\n const visualDelta = createDelta();\n if (isShared) {\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);\n }\n else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox);\n }\n const hasLayoutChanged = !isDeltaZero(layoutDelta);\n let hasRelativeTargetChanged = false;\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent();\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;\n if (parentSnapshot && parentLayout) {\n const relativeSnapshot = createBox();\n calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);\n const relativeLayout = createBox();\n calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeTargetChanged = true;\n }\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout;\n node.relativeTargetOrigin = relativeSnapshot;\n node.relativeParent = relativeParent;\n }\n }\n }\n }\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeTargetChanged,\n });\n }\n else if (node.isLead()) {\n const { onExitComplete } = node.options;\n onExitComplete && onExitComplete();\n }\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined;\n}\nfunction propagateDirtyNodes(node) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (isDebug) {\n metrics.totalNodes++;\n }\n if (!node.parent)\n return;\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty;\n }\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty));\n node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);\n}\nfunction cleanDirtyNodes(node) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false;\n}\nfunction clearSnapshot(node) {\n node.clearSnapshot();\n}\nfunction clearMeasurements(node) {\n node.clearMeasurements();\n}\nfunction clearIsLayoutDirty(node) {\n node.isLayoutDirty = false;\n}\nfunction resetTransformStyle(node) {\n const { visualElement } = node.options;\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\");\n }\n node.resetTransform();\n}\nfunction finishAnimation(node) {\n node.finishAnimation();\n node.targetDelta = node.relativeTarget = node.target = undefined;\n node.isProjectionDirty = true;\n}\nfunction resolveTargetDelta(node) {\n node.resolveTargetDelta();\n}\nfunction calcProjection(node) {\n node.calcProjection();\n}\nfunction resetSkewAndRotation(node) {\n node.resetSkewAndRotation();\n}\nfunction removeLeadSnapshots(stack) {\n stack.removeLeadSnapshot();\n}\nfunction mixAxisDelta(output, delta, p) {\n output.translate = mixNumber(delta.translate, 0, p);\n output.scale = mixNumber(delta.scale, 1, p);\n output.origin = delta.origin;\n output.originPoint = delta.originPoint;\n}\nfunction mixAxis(output, from, to, p) {\n output.min = mixNumber(from.min, to.min, p);\n output.max = mixNumber(from.max, to.max, p);\n}\nfunction mixBox(output, from, to, p) {\n mixAxis(output.x, from.x, to.x, p);\n mixAxis(output.y, from.y, to.y, p);\n}\nfunction hasOpacityCrossfade(node) {\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\n}\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n};\nconst userAgentContains = (string) => typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string);\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint = userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop;\nfunction roundAxis(axis) {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min);\n axis.max = roundPoint(axis.max);\n}\nfunction roundBox(box) {\n roundAxis(box.x);\n roundAxis(box.y);\n}\nfunction shouldAnimatePositionOnly(animationType, snapshot, layout) {\n return (animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));\n}\nfunction checkNodeWasScrollRoot(node) {\n var _a;\n return node !== node.root && ((_a = node.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot);\n}\n\nexport { cleanDirtyNodes, createProjectionNode, mixAxis, mixAxisDelta, mixBox, propagateDirtyNodes };\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\n\nconst DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (ref, notify) => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body.scrollLeft,\n y: document.documentElement.scrollTop || document.body.scrollTop,\n }),\n checkIsScrollRoot: () => true,\n});\n\nexport { DocumentProjectionNode };\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { DocumentProjectionNode } from './DocumentProjectionNode.mjs';\n\nconst rootProjectionNode = {\n current: undefined,\n};\nconst HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({});\n documentNode.mount(window);\n documentNode.setOptions({ layoutScroll: true });\n rootProjectionNode.current = documentNode;\n }\n return rootProjectionNode.current;\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\";\n },\n checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n});\n\nexport { HTMLProjectionNode, rootProjectionNode };\n","import { DragGesture } from '../../gestures/drag/index.mjs';\nimport { PanGesture } from '../../gestures/pan/index.mjs';\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\nimport { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\n\nconst drag = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n\nexport { drag };\n","import { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\n\nconst layout = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n\nexport { layout };\n","import { drag } from '../../motion/features/drag.mjs';\nimport { layout } from '../../motion/features/layout.mjs';\nimport { domAnimation } from './features-animation.mjs';\n\n/**\n * @public\n */\nconst domMax = {\n ...domAnimation,\n ...drag,\n ...layout,\n};\n\nexport { domMax };\n","\"use client\";\n\n// src/tab.tsx\nimport { forwardRef } from \"@heroui/system\";\nimport { useDOMRef, filterDOMProps, mergeRefs } from \"@heroui/react-utils\";\nimport { clsx, dataAttr } from \"@heroui/shared-utils\";\nimport { chain, mergeProps } from \"@react-aria/utils\";\nimport scrollIntoView from \"scroll-into-view-if-needed\";\nimport { useFocusRing } from \"@react-aria/focus\";\nimport { useTab } from \"@react-aria/tabs\";\nimport { useHover } from \"@react-aria/interactions\";\nimport { m, domMax, LazyMotion } from \"framer-motion\";\nimport { useIsMounted } from \"@heroui/use-is-mounted\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar Tab = forwardRef((props, ref) => {\n var _a;\n const {\n className,\n as,\n item,\n state,\n classNames,\n isDisabled: isDisabledProp,\n listRef,\n slots,\n motionProps,\n disableAnimation,\n disableCursorAnimation,\n shouldSelectOnPressUp,\n onClick,\n tabRef,\n ...otherProps\n } = props;\n const { key } = item;\n const domRef = useDOMRef(ref);\n const Component = as || (props.href ? \"a\" : \"button\");\n const shouldFilterDOMProps = typeof Component === \"string\";\n const {\n tabProps,\n isSelected,\n isDisabled: isDisabledItem,\n isPressed\n } = useTab({ key, isDisabled: isDisabledProp, shouldSelectOnPressUp }, state, domRef);\n if (props.children == null) {\n delete tabProps[\"aria-controls\"];\n }\n const isDisabled = isDisabledProp || isDisabledItem;\n const { focusProps, isFocused, isFocusVisible } = useFocusRing();\n const { hoverProps, isHovered } = useHover({\n isDisabled\n });\n const tabStyles = clsx(classNames == null ? void 0 : classNames.tab, className);\n const [, isMounted] = useIsMounted({\n rerender: true\n });\n const handleClick = () => {\n chain(onClick, tabProps.onClick);\n if (!(domRef == null ? void 0 : domRef.current) || !(listRef == null ? void 0 : listRef.current))\n return;\n scrollIntoView(domRef.current, {\n scrollMode: \"if-needed\",\n behavior: \"smooth\",\n block: \"end\",\n inline: \"end\",\n boundary: listRef == null ? void 0 : listRef.current\n });\n };\n return /* @__PURE__ */ jsxs(\n Component,\n {\n ref: mergeRefs(domRef, tabRef),\n \"data-disabled\": dataAttr(isDisabledItem),\n \"data-focus\": dataAttr(isFocused),\n \"data-focus-visible\": dataAttr(isFocusVisible),\n \"data-hover\": dataAttr(isHovered),\n \"data-hover-unselected\": dataAttr((isHovered || isPressed) && !isSelected),\n \"data-pressed\": dataAttr(isPressed),\n \"data-selected\": dataAttr(isSelected),\n \"data-slot\": \"tab\",\n ...mergeProps(\n tabProps,\n !isDisabled ? {\n ...focusProps,\n ...hoverProps\n } : {},\n filterDOMProps(otherProps, {\n enabled: shouldFilterDOMProps,\n omitPropNames: /* @__PURE__ */ new Set([\"title\"])\n }),\n { onClick: handleClick }\n ),\n className: (_a = slots.tab) == null ? void 0 : _a.call(slots, { class: tabStyles }),\n title: otherProps == null ? void 0 : otherProps.titleValue,\n type: Component === \"button\" ? \"button\" : void 0,\n children: [\n isSelected && !disableAnimation && !disableCursorAnimation && isMounted ? /* @__PURE__ */ jsx(LazyMotion, { features: domMax, children: /* @__PURE__ */ jsx(\n m.span,\n {\n className: slots.cursor({ class: classNames == null ? void 0 : classNames.cursor }),\n \"data-slot\": \"cursor\",\n layoutDependency: false,\n layoutId: \"cursor\",\n transition: {\n type: \"spring\",\n bounce: 0.15,\n duration: 0.5\n },\n ...motionProps\n }\n ) }) : null,\n /* @__PURE__ */ jsx(\n \"div\",\n {\n className: slots.tabContent({\n class: classNames == null ? void 0 : classNames.tabContent\n }),\n \"data-slot\": \"tabContent\",\n children: item.rendered\n }\n )\n ]\n }\n );\n});\nTab.displayName = \"HeroUI.Tab\";\nvar tab_default = Tab;\n\nexport {\n tab_default\n};\n","import {\n colorVariants\n} from \"./chunk-GQT3YUX3.mjs\";\nimport {\n tv\n} from \"./chunk-UWE6H66T.mjs\";\nimport {\n dataFocusVisibleClasses\n} from \"./chunk-GH5E4FQB.mjs\";\n\n// src/components/tabs.ts\nvar tabs = tv({\n slots: {\n base: \"inline-flex\",\n tabList: [\n \"flex\",\n \"p-1\",\n \"h-fit\",\n \"gap-2\",\n \"items-center\",\n \"flex-nowrap\",\n \"overflow-x-scroll\",\n \"scrollbar-hide\",\n \"bg-default-100\"\n ],\n tab: [\n \"z-0\",\n \"w-full\",\n \"px-3\",\n \"py-1\",\n \"flex\",\n \"group\",\n \"relative\",\n \"justify-center\",\n \"items-center\",\n \"outline-none\",\n \"cursor-pointer\",\n \"transition-opacity\",\n \"tap-highlight-transparent\",\n \"data-[disabled=true]:cursor-not-allowed\",\n \"data-[disabled=true]:opacity-30\",\n \"data-[hover-unselected=true]:opacity-disabled\",\n ...dataFocusVisibleClasses\n ],\n tabContent: [\n \"relative\",\n \"z-10\",\n \"text-inherit\",\n \"whitespace-nowrap\",\n \"transition-colors\",\n \"text-default-500\",\n \"group-data-[selected=true]:text-foreground\"\n ],\n cursor: [\"absolute\", \"z-0\", \"bg-white\"],\n panel: [\n \"py-3\",\n \"px-1\",\n \"outline-none\",\n \"data-[inert=true]:hidden\",\n ...dataFocusVisibleClasses\n ],\n wrapper: []\n },\n variants: {\n variant: {\n solid: {\n cursor: \"inset-0\"\n },\n light: {\n tabList: \"bg-transparent dark:bg-transparent\",\n cursor: \"inset-0\"\n },\n underlined: {\n tabList: \"bg-transparent dark:bg-transparent\",\n cursor: \"h-[2px] w-[80%] bottom-0 shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]\"\n },\n bordered: {\n tabList: \"bg-transparent dark:bg-transparent border-medium border-default-200 shadow-sm\",\n cursor: \"inset-0\"\n }\n },\n color: {\n default: {},\n primary: {},\n secondary: {},\n success: {},\n warning: {},\n danger: {}\n },\n size: {\n sm: {\n tabList: \"rounded-medium\",\n tab: \"h-7 text-tiny rounded-small\",\n cursor: \"rounded-small\"\n },\n md: {\n tabList: \"rounded-medium\",\n tab: \"h-8 text-small rounded-small\",\n cursor: \"rounded-small\"\n },\n lg: {\n tabList: \"rounded-large\",\n tab: \"h-9 text-medium rounded-medium\",\n cursor: \"rounded-medium\"\n }\n },\n radius: {\n none: {\n tabList: \"rounded-none\",\n tab: \"rounded-none\",\n cursor: \"rounded-none\"\n },\n sm: {\n tabList: \"rounded-medium\",\n tab: \"rounded-small\",\n cursor: \"rounded-small\"\n },\n md: {\n tabList: \"rounded-medium\",\n tab: \"rounded-small\",\n cursor: \"rounded-small\"\n },\n lg: {\n tabList: \"rounded-large\",\n tab: \"rounded-medium\",\n cursor: \"rounded-medium\"\n },\n full: {\n tabList: \"rounded-full\",\n tab: \"rounded-full\",\n cursor: \"rounded-full\"\n }\n },\n fullWidth: {\n true: {\n base: \"w-full\",\n tabList: \"w-full\"\n }\n },\n isDisabled: {\n true: {\n tabList: \"opacity-disabled pointer-events-none\"\n }\n },\n disableAnimation: {\n true: {\n tab: \"transition-none\",\n tabContent: \"transition-none\"\n }\n },\n placement: {\n top: {},\n start: {\n tabList: \"flex-col\",\n panel: \"py-0 px-3\",\n wrapper: \"flex\"\n },\n end: {\n tabList: \"flex-col\",\n panel: \"py-0 px-3\",\n wrapper: \"flex flex-row-reverse\"\n },\n bottom: {\n wrapper: \"flex flex-col-reverse\"\n }\n }\n },\n defaultVariants: {\n color: \"default\",\n variant: \"solid\",\n size: \"md\",\n fullWidth: false,\n isDisabled: false\n },\n compoundVariants: [\n {\n variant: [\"solid\", \"bordered\", \"light\"],\n color: \"default\",\n class: {\n cursor: [\"bg-background\", \"dark:bg-default\", \"shadow-small\"],\n tabContent: \"group-data-[selected=true]:text-default-foreground\"\n }\n },\n {\n variant: [\"solid\", \"bordered\", \"light\"],\n color: \"primary\",\n class: {\n cursor: colorVariants.solid.primary,\n tabContent: \"group-data-[selected=true]:text-primary-foreground\"\n }\n },\n {\n variant: [\"solid\", \"bordered\", \"light\"],\n color: \"secondary\",\n class: {\n cursor: colorVariants.solid.secondary,\n tabContent: \"group-data-[selected=true]:text-secondary-foreground\"\n }\n },\n {\n variant: [\"solid\", \"bordered\", \"light\"],\n color: \"success\",\n class: {\n cursor: colorVariants.solid.success,\n tabContent: \"group-data-[selected=true]:text-success-foreground\"\n }\n },\n {\n variant: [\"solid\", \"bordered\", \"light\"],\n color: \"warning\",\n class: {\n cursor: colorVariants.solid.warning,\n tabContent: \"group-data-[selected=true]:text-warning-foreground\"\n }\n },\n {\n variant: [\"solid\", \"bordered\", \"light\"],\n color: \"danger\",\n class: {\n cursor: colorVariants.solid.danger,\n tabContent: \"group-data-[selected=true]:text-danger-foreground\"\n }\n },\n {\n variant: \"underlined\",\n color: \"default\",\n class: {\n cursor: \"bg-foreground\",\n tabContent: \"group-data-[selected=true]:text-foreground\"\n }\n },\n {\n variant: \"underlined\",\n color: \"primary\",\n class: {\n cursor: \"bg-primary\",\n tabContent: \"group-data-[selected=true]:text-primary\"\n }\n },\n {\n variant: \"underlined\",\n color: \"secondary\",\n class: {\n cursor: \"bg-secondary\",\n tabContent: \"group-data-[selected=true]:text-secondary\"\n }\n },\n {\n variant: \"underlined\",\n color: \"success\",\n class: {\n cursor: \"bg-success\",\n tabContent: \"group-data-[selected=true]:text-success\"\n }\n },\n {\n variant: \"underlined\",\n color: \"warning\",\n class: {\n cursor: \"bg-warning\",\n tabContent: \"group-data-[selected=true]:text-warning\"\n }\n },\n {\n variant: \"underlined\",\n color: \"danger\",\n class: {\n cursor: \"bg-danger\",\n tabContent: \"group-data-[selected=true]:text-danger\"\n }\n },\n {\n disableAnimation: true,\n variant: \"underlined\",\n class: {\n tab: [\n \"after:content-['']\",\n \"after:absolute\",\n \"after:bottom-0\",\n \"after:h-[2px]\",\n \"after:w-[80%]\",\n \"after:opacity-0\",\n \"after:shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]\",\n \"data-[selected=true]:after:opacity-100\"\n ]\n }\n },\n {\n disableAnimation: true,\n color: \"default\",\n variant: [\"solid\", \"bordered\", \"light\"],\n class: {\n tab: \"data-[selected=true]:bg-default data-[selected=true]:text-default-foreground\"\n }\n },\n {\n disableAnimation: true,\n color: \"primary\",\n variant: [\"solid\", \"bordered\", \"light\"],\n class: {\n tab: \"data-[selected=true]:bg-primary data-[selected=true]:text-primary-foreground\"\n }\n },\n {\n disableAnimation: true,\n color: \"secondary\",\n variant: [\"solid\", \"bordered\", \"light\"],\n class: {\n tab: \"data-[selected=true]:bg-secondary data-[selected=true]:text-secondary-foreground\"\n }\n },\n {\n disableAnimation: true,\n color: \"success\",\n variant: [\"solid\", \"bordered\", \"light\"],\n class: {\n tab: \"data-[selected=true]:bg-success data-[selected=true]:text-success-foreground\"\n }\n },\n {\n disableAnimation: true,\n color: \"warning\",\n variant: [\"solid\", \"bordered\", \"light\"],\n class: {\n tab: \"data-[selected=true]:bg-warning data-[selected=true]:text-warning-foreground\"\n }\n },\n {\n disableAnimation: true,\n color: \"danger\",\n variant: [\"solid\", \"bordered\", \"light\"],\n class: {\n tab: \"data-[selected=true]:bg-danger data-[selected=true]:text-danger-foreground\"\n }\n },\n {\n disableAnimation: true,\n color: \"default\",\n variant: \"underlined\",\n class: {\n tab: \"data-[selected=true]:after:bg-foreground\"\n }\n },\n {\n disableAnimation: true,\n color: \"primary\",\n variant: \"underlined\",\n class: {\n tab: \"data-[selected=true]:after:bg-primary\"\n }\n },\n {\n disableAnimation: true,\n color: \"secondary\",\n variant: \"underlined\",\n class: {\n tab: \"data-[selected=true]:after:bg-secondary\"\n }\n },\n {\n disableAnimation: true,\n color: \"success\",\n variant: \"underlined\",\n class: {\n tab: \"data-[selected=true]:after:bg-success\"\n }\n },\n {\n disableAnimation: true,\n color: \"warning\",\n variant: \"underlined\",\n class: {\n tab: \"data-[selected=true]:after:bg-warning\"\n }\n },\n {\n disableAnimation: true,\n color: \"danger\",\n variant: \"underlined\",\n class: {\n tab: \"data-[selected=true]:after:bg-danger\"\n }\n }\n ],\n compoundSlots: [\n {\n variant: \"underlined\",\n slots: [\"tab\", \"tabList\", \"cursor\"],\n class: [\"rounded-none\"]\n }\n ]\n});\n\nexport {\n tabs\n};\n","import {useListState as $e72dd72e1c76a225$export$2f645645f7bca764} from \"./useListState.mjs\";\nimport {useControlledState as $eBozH$useControlledState} from \"@react-stately/utils\";\nimport {useMemo as $eBozH$useMemo} from \"react\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\nfunction $a0d645289fe9b86b$export$e7f05e985daf4b5f(props) {\n var _props_defaultSelectedKey;\n let [selectedKey, setSelectedKey] = (0, $eBozH$useControlledState)(props.selectedKey, (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : null, props.onSelectionChange);\n let selectedKeys = (0, $eBozH$useMemo)(()=>selectedKey != null ? [\n selectedKey\n ] : [], [\n selectedKey\n ]);\n let { collection: collection, disabledKeys: disabledKeys, selectionManager: selectionManager } = (0, $e72dd72e1c76a225$export$2f645645f7bca764)({\n ...props,\n selectionMode: 'single',\n disallowEmptySelection: true,\n allowDuplicateSelectionEvents: true,\n selectedKeys: selectedKeys,\n onSelectionChange: (keys)=>{\n // impossible, but TS doesn't know that\n if (keys === 'all') return;\n var _keys_values_next_value;\n let key = (_keys_values_next_value = keys.values().next().value) !== null && _keys_values_next_value !== void 0 ? _keys_values_next_value : null;\n // Always fire onSelectionChange, even if the key is the same\n // as the current key (useControlledState does not).\n if (key === selectedKey && props.onSelectionChange) props.onSelectionChange(key);\n setSelectedKey(key);\n }\n });\n let selectedItem = selectedKey != null ? collection.getItem(selectedKey) : null;\n return {\n collection: collection,\n disabledKeys: disabledKeys,\n selectionManager: selectionManager,\n selectedKey: selectedKey,\n setSelectedKey: setSelectedKey,\n selectedItem: selectedItem\n };\n}\n\n\nexport {$a0d645289fe9b86b$export$e7f05e985daf4b5f as useSingleSelectListState};\n//# sourceMappingURL=useSingleSelectListState.module.js.map\n","import {useSingleSelectListState as $fgY1A$useSingleSelectListState} from \"@react-stately/list\";\nimport {useRef as $fgY1A$useRef, useEffect as $fgY1A$useEffect} from \"react\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\nfunction $76f919a04c5a7d14$export$4ba071daf4e486(props) {\n var _props_defaultSelectedKey, _ref;\n let state = (0, $fgY1A$useSingleSelectListState)({\n ...props,\n suppressTextValueWarning: true,\n defaultSelectedKey: (_ref = (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : $76f919a04c5a7d14$var$findDefaultSelectedKey(props.collection, props.disabledKeys ? new Set(props.disabledKeys) : new Set())) !== null && _ref !== void 0 ? _ref : undefined\n });\n let { selectionManager: selectionManager, collection: collection, selectedKey: currentSelectedKey } = state;\n let lastSelectedKey = (0, $fgY1A$useRef)(currentSelectedKey);\n (0, $fgY1A$useEffect)(()=>{\n // Ensure a tab is always selected (in case no selected key was specified or if selected item was deleted from collection)\n let selectedKey = currentSelectedKey;\n if (selectionManager.isEmpty || selectedKey == null || !collection.getItem(selectedKey)) {\n selectedKey = $76f919a04c5a7d14$var$findDefaultSelectedKey(collection, state.disabledKeys);\n if (selectedKey != null) // directly set selection because replace/toggle selection won't consider disabled keys\n selectionManager.setSelectedKeys([\n selectedKey\n ]);\n }\n // If the tablist doesn't have focus and the selected key changes or if there isn't a focused key yet, change focused key to the selected key if it exists.\n if (selectedKey != null && selectionManager.focusedKey == null || !selectionManager.isFocused && selectedKey !== lastSelectedKey.current) selectionManager.setFocusedKey(selectedKey);\n lastSelectedKey.current = selectedKey;\n });\n return {\n ...state,\n isDisabled: props.isDisabled || false\n };\n}\nfunction $76f919a04c5a7d14$var$findDefaultSelectedKey(collection, disabledKeys) {\n let selectedKey = null;\n if (collection) {\n var _collection_getItem_props, _collection_getItem, _collection_getItem_props1, _collection_getItem1;\n selectedKey = collection.getFirstKey();\n // loop over tabs until we find one that isn't disabled and select that\n while(selectedKey != null && (disabledKeys.has(selectedKey) || ((_collection_getItem = collection.getItem(selectedKey)) === null || _collection_getItem === void 0 ? void 0 : (_collection_getItem_props = _collection_getItem.props) === null || _collection_getItem_props === void 0 ? void 0 : _collection_getItem_props.isDisabled)) && selectedKey !== collection.getLastKey())selectedKey = collection.getKeyAfter(selectedKey);\n // if this check is true, then every item is disabled, it makes more sense to default to the first key than the last\n if (selectedKey != null && (disabledKeys.has(selectedKey) || ((_collection_getItem1 = collection.getItem(selectedKey)) === null || _collection_getItem1 === void 0 ? void 0 : (_collection_getItem_props1 = _collection_getItem1.props) === null || _collection_getItem_props1 === void 0 ? void 0 : _collection_getItem_props1.isDisabled)) && selectedKey === collection.getLastKey()) selectedKey = collection.getFirstKey();\n }\n return selectedKey;\n}\n\n\nexport {$76f919a04c5a7d14$export$4ba071daf4e486 as useTabListState};\n//# sourceMappingURL=useTabListState.module.js.map\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ class $bfc6f2d60b8a4c40$export$15010ca3c1abe90b {\n getKeyLeftOf(key) {\n if (this.flipDirection) return this.getNextKey(key);\n return this.getPreviousKey(key);\n }\n getKeyRightOf(key) {\n if (this.flipDirection) return this.getPreviousKey(key);\n return this.getNextKey(key);\n }\n isDisabled(key) {\n var _this_collection_getItem_props, _this_collection_getItem;\n return this.disabledKeys.has(key) || !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : (_this_collection_getItem_props = _this_collection_getItem.props) === null || _this_collection_getItem_props === void 0 ? void 0 : _this_collection_getItem_props.isDisabled);\n }\n getFirstKey() {\n let key = this.collection.getFirstKey();\n if (key != null && this.isDisabled(key)) key = this.getNextKey(key);\n return key;\n }\n getLastKey() {\n let key = this.collection.getLastKey();\n if (key != null && this.isDisabled(key)) key = this.getPreviousKey(key);\n return key;\n }\n getKeyAbove(key) {\n if (this.tabDirection) return null;\n return this.getPreviousKey(key);\n }\n getKeyBelow(key) {\n if (this.tabDirection) return null;\n return this.getNextKey(key);\n }\n getNextKey(key) {\n do {\n key = this.collection.getKeyAfter(key);\n if (key == null) key = this.collection.getFirstKey();\n }while (this.isDisabled(key));\n return key;\n }\n getPreviousKey(key) {\n do {\n key = this.collection.getKeyBefore(key);\n if (key == null) key = this.collection.getLastKey();\n }while (this.isDisabled(key));\n return key;\n }\n constructor(collection, direction, orientation, disabledKeys = new Set()){\n this.collection = collection;\n this.flipDirection = direction === 'rtl' && orientation === 'horizontal';\n this.disabledKeys = disabledKeys;\n this.tabDirection = orientation === 'horizontal';\n }\n}\n\n\nexport {$bfc6f2d60b8a4c40$export$15010ca3c1abe90b as TabsKeyboardDelegate};\n//# sourceMappingURL=TabsKeyboardDelegate.module.js.map\n","import {tabsIds as $99b62ae3ff97ec45$export$c5f62239608282b6} from \"./utils.mjs\";\nimport {TabsKeyboardDelegate as $bfc6f2d60b8a4c40$export$15010ca3c1abe90b} from \"./TabsKeyboardDelegate.mjs\";\nimport {useId as $bQNZs$useId, useLabels as $bQNZs$useLabels, mergeProps as $bQNZs$mergeProps} from \"@react-aria/utils\";\nimport {useLocale as $bQNZs$useLocale} from \"@react-aria/i18n\";\nimport {useMemo as $bQNZs$useMemo} from \"react\";\nimport {useSelectableCollection as $bQNZs$useSelectableCollection} from \"@react-aria/selection\";\n\n/*\n* Copyright 2020 Adobe. All rights reserved.\n* This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License. You may obtain a copy\n* of the License at http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software distributed under\n* the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n* OF ANY KIND, either express or implied. See the License for the specific language\n* governing permissions and limitations under the License.\n*/ \n\n\n\n\n\nfunction $58d314389b21fa3f$export$773e389e644c5874(props, state, ref) {\n let { orientation: orientation = 'horizontal', keyboardActivation: keyboardActivation = 'automatic' } = props;\n let { collection: collection, selectionManager: manager, disabledKeys: disabledKeys } = state;\n let { direction: direction } = (0, $bQNZs$useLocale)();\n let delegate = (0, $bQNZs$useMemo)(()=>new (0, $bfc6f2d60b8a4c40$export$15010ca3c1abe90b)(collection, direction, orientation, disabledKeys), [\n collection,\n disabledKeys,\n orientation,\n direction\n ]);\n let { collectionProps: collectionProps } = (0, $bQNZs$useSelectableCollection)({\n ref: ref,\n selectionManager: manager,\n keyboardDelegate: delegate,\n selectOnFocus: keyboardActivation === 'automatic',\n disallowEmptySelection: true,\n scrollRef: ref,\n linkBehavior: 'selection'\n });\n // Compute base id for all tabs\n let tabsId = (0, $bQNZs$useId)();\n (0, $99b62ae3ff97ec45$export$c5f62239608282b6).set(state, tabsId);\n let tabListLabelProps = (0, $bQNZs$useLabels)({\n ...props,\n id: tabsId\n });\n return {\n tabListProps: {\n ...(0, $bQNZs$mergeProps)(collectionProps, tabListLabelProps),\n role: 'tablist',\n 'aria-orientation': orientation,\n tabIndex: undefined\n }\n };\n}\n\n\nexport {$58d314389b21fa3f$export$773e389e644c5874 as useTabList};\n//# sourceMappingURL=useTabList.module.js.map\n","\"use client\";\n\n// src/use-tabs.ts\nimport { mapPropsVariants, useProviderContext } from \"@heroui/system\";\nimport { tabs } from \"@heroui/theme\";\nimport { useDOMRef } from \"@heroui/react-utils\";\nimport { clsx, objectToDeps } from \"@heroui/shared-utils\";\nimport { filterDOMProps } from \"@heroui/react-utils\";\nimport { useMemo, useCallback } from \"react\";\nimport { useTabListState } from \"@react-stately/tabs\";\nimport { useTabList } from \"@react-aria/tabs\";\nimport { mergeProps } from \"@react-aria/utils\";\nfunction useTabs(originalProps) {\n var _a, _b, _c;\n const globalContext = useProviderContext();\n const [props, variantProps] = mapPropsVariants(originalProps, tabs.variantKeys);\n const {\n ref,\n as,\n className,\n classNames,\n children,\n disableCursorAnimation,\n motionProps,\n isVertical = false,\n shouldSelectOnPressUp = true,\n destroyInactiveTabPanel = true,\n ...otherProps\n } = props;\n const Component = as || \"div\";\n const shouldFilterDOMProps = typeof Component === \"string\";\n const domRef = useDOMRef(ref);\n const disableAnimation = (_b = (_a = originalProps == null ? void 0 : originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;\n const state = useTabListState({\n children,\n ...otherProps\n });\n const { tabListProps } = useTabList(otherProps, state, domRef);\n const slots = useMemo(\n () => tabs({\n ...variantProps,\n className,\n disableAnimation,\n ...isVertical ? { placement: \"start\" } : {}\n }),\n [objectToDeps(variantProps), className, disableAnimation, isVertical]\n );\n const baseStyles = clsx(classNames == null ? void 0 : classNames.base, className);\n const values = useMemo(\n () => ({\n state,\n slots,\n classNames,\n motionProps,\n disableAnimation,\n listRef: domRef,\n shouldSelectOnPressUp,\n disableCursorAnimation,\n isDisabled: originalProps == null ? void 0 : originalProps.isDisabled\n }),\n [\n state,\n slots,\n domRef,\n motionProps,\n disableAnimation,\n disableCursorAnimation,\n shouldSelectOnPressUp,\n originalProps == null ? void 0 : originalProps.isDisabled,\n classNames\n ]\n );\n const getBaseProps = useCallback(\n (props2) => ({\n \"data-slot\": \"base\",\n className: slots.base({ class: clsx(baseStyles, props2 == null ? void 0 : props2.className) }),\n ...mergeProps(\n filterDOMProps(otherProps, {\n enabled: shouldFilterDOMProps\n }),\n props2\n )\n }),\n [baseStyles, otherProps, slots]\n );\n const placement = (_c = variantProps.placement) != null ? _c : isVertical ? \"start\" : \"top\";\n const getWrapperProps = useCallback(\n (props2) => ({\n \"data-slot\": \"tabWrapper\",\n className: slots.wrapper({ class: clsx(classNames == null ? void 0 : classNames.wrapper, props2 == null ? void 0 : props2.className) }),\n \"data-placement\": placement,\n \"data-vertical\": isVertical || placement === \"start\" || placement === \"end\" ? \"vertical\" : \"horizontal\"\n }),\n [classNames, slots, placement, isVertical]\n );\n const getTabListProps = useCallback(\n (props2) => ({\n ref: domRef,\n \"data-slot\": \"tabList\",\n className: slots.tabList({ class: clsx(classNames == null ? void 0 : classNames.tabList, props2 == null ? void 0 : props2.className) }),\n ...mergeProps(tabListProps, props2)\n }),\n [domRef, tabListProps, classNames, slots]\n );\n return {\n Component,\n domRef,\n state,\n values,\n destroyInactiveTabPanel,\n getBaseProps,\n getTabListProps,\n getWrapperProps\n };\n}\n\nexport {\n useTabs\n};\n","\"use client\";\nimport {\n tab_panel_default\n} from \"./chunk-7ARJTFQR.mjs\";\nimport {\n tab_default\n} from \"./chunk-TTZQXKQZ.mjs\";\nimport {\n useTabs\n} from \"./chunk-IUT6HU4S.mjs\";\n\n// src/tabs.tsx\nimport { useId } from \"react\";\nimport { LayoutGroup } from \"framer-motion\";\nimport { forwardRef } from \"@heroui/system\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar Tabs = forwardRef(function Tabs2(props, ref) {\n const {\n Component,\n values,\n state,\n destroyInactiveTabPanel,\n getBaseProps,\n getTabListProps,\n getWrapperProps\n } = useTabs({\n ...props,\n ref\n });\n const layoutId = useId();\n const layoutGroupEnabled = !props.disableAnimation && !props.disableCursorAnimation;\n const tabsProps = {\n state,\n listRef: values.listRef,\n slots: values.slots,\n classNames: values.classNames,\n isDisabled: values.isDisabled,\n motionProps: values.motionProps,\n disableAnimation: values.disableAnimation,\n shouldSelectOnPressUp: values.shouldSelectOnPressUp,\n disableCursorAnimation: values.disableCursorAnimation\n };\n const tabs = [...state.collection].map((item) => /* @__PURE__ */ jsx(tab_default, { item, ...tabsProps, ...item.props }, item.key));\n const renderTabs = /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\"div\", { ...getBaseProps(), children: /* @__PURE__ */ jsx(Component, { ...getTabListProps(), children: layoutGroupEnabled ? /* @__PURE__ */ jsx(LayoutGroup, { id: layoutId, children: tabs }) : tabs }) }),\n [...state.collection].map((item) => {\n return /* @__PURE__ */ jsx(\n tab_panel_default,\n {\n classNames: values.classNames,\n destroyInactiveTabPanel,\n slots: values.slots,\n state: values.state,\n tabKey: item.key\n },\n item.key\n );\n })\n ] });\n if (\"placement\" in props || \"isVertical\" in props) {\n return /* @__PURE__ */ jsx(\"div\", { ...getWrapperProps(), children: renderTabs });\n }\n return renderTabs;\n});\nvar tabs_default = Tabs;\n\nexport {\n tabs_default\n};\n"],"names":[],"sourceRoot":"","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47]}