@mountaya/elements 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +235 -0
- package/LICENCE.fr.txt +280 -0
- package/LICENSE.txt +262 -0
- package/README.md +1509 -2
- package/THIRD-PARTY-NOTICES.txt +103 -0
- package/dist/accentColor-GNKBD2CW.js +4 -0
- package/dist/accentColor-GNKBD2CW.js.map +1 -0
- package/dist/accentColor-VX2JSMGE.cjs +17 -0
- package/dist/accentColor-VX2JSMGE.cjs.map +1 -0
- package/dist/agent/index.cjs +1964 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +2016 -0
- package/dist/agent/index.d.ts +2016 -0
- package/dist/agent/index.js +1937 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/amenities-B3-qAjxu.d.cts +160 -0
- package/dist/amenities-B3-qAjxu.d.ts +160 -0
- package/dist/bundle-Je5zsRFg.d.cts +222 -0
- package/dist/bundle-xYrrbJTH.d.ts +222 -0
- package/dist/camera/index.cjs +3477 -0
- package/dist/camera/index.cjs.map +1 -0
- package/dist/camera/index.d.cts +1751 -0
- package/dist/camera/index.d.ts +1751 -0
- package/dist/camera/index.js +3328 -0
- package/dist/camera/index.js.map +1 -0
- package/dist/camera-BrFLU1DH.d.cts +549 -0
- package/dist/camera-C48Ykaxv.d.ts +549 -0
- package/dist/chunk-23PFRRB6.js +3 -0
- package/dist/chunk-23PFRRB6.js.map +1 -0
- package/dist/chunk-2GI5SAH2.js +71 -0
- package/dist/chunk-2GI5SAH2.js.map +1 -0
- package/dist/chunk-2MQK6A74.js +39 -0
- package/dist/chunk-2MQK6A74.js.map +1 -0
- package/dist/chunk-2RE7R4LD.js +73 -0
- package/dist/chunk-2RE7R4LD.js.map +1 -0
- package/dist/chunk-3JZQKN4O.js +6 -0
- package/dist/chunk-3JZQKN4O.js.map +1 -0
- package/dist/chunk-3NDXVUUI.js +50 -0
- package/dist/chunk-3NDXVUUI.js.map +1 -0
- package/dist/chunk-3R4GFTUM.cjs +59 -0
- package/dist/chunk-3R4GFTUM.cjs.map +1 -0
- package/dist/chunk-3RVUQ6JN.cjs +22 -0
- package/dist/chunk-3RVUQ6JN.cjs.map +1 -0
- package/dist/chunk-4F6BJMJC.cjs +49 -0
- package/dist/chunk-4F6BJMJC.cjs.map +1 -0
- package/dist/chunk-4NWQD4BX.js +132 -0
- package/dist/chunk-4NWQD4BX.js.map +1 -0
- package/dist/chunk-5K2MH3R6.js +10 -0
- package/dist/chunk-5K2MH3R6.js.map +1 -0
- package/dist/chunk-6ACRNQQQ.cjs +8 -0
- package/dist/chunk-6ACRNQQQ.cjs.map +1 -0
- package/dist/chunk-6D26E3IA.js +66 -0
- package/dist/chunk-6D26E3IA.js.map +1 -0
- package/dist/chunk-6ESAW35P.cjs +80 -0
- package/dist/chunk-6ESAW35P.cjs.map +1 -0
- package/dist/chunk-6LIW2A5M.cjs +1176 -0
- package/dist/chunk-6LIW2A5M.cjs.map +1 -0
- package/dist/chunk-6OTTWVCA.js +57 -0
- package/dist/chunk-6OTTWVCA.js.map +1 -0
- package/dist/chunk-6VROJ4UG.js +862 -0
- package/dist/chunk-6VROJ4UG.js.map +1 -0
- package/dist/chunk-6Y7FTGO4.js +23 -0
- package/dist/chunk-6Y7FTGO4.js.map +1 -0
- package/dist/chunk-75I4CG64.js +104 -0
- package/dist/chunk-75I4CG64.js.map +1 -0
- package/dist/chunk-7CUBXHAH.cjs +14 -0
- package/dist/chunk-7CUBXHAH.cjs.map +1 -0
- package/dist/chunk-7GTCURVY.js +52 -0
- package/dist/chunk-7GTCURVY.js.map +1 -0
- package/dist/chunk-7IWOL6AM.cjs +100 -0
- package/dist/chunk-7IWOL6AM.cjs.map +1 -0
- package/dist/chunk-7QN7M667.cjs +151 -0
- package/dist/chunk-7QN7M667.cjs.map +1 -0
- package/dist/chunk-A6KQDKLM.cjs +1197 -0
- package/dist/chunk-A6KQDKLM.cjs.map +1 -0
- package/dist/chunk-A77EA67G.js +354 -0
- package/dist/chunk-A77EA67G.js.map +1 -0
- package/dist/chunk-AFKOABJ4.cjs +7194 -0
- package/dist/chunk-AFKOABJ4.cjs.map +1 -0
- package/dist/chunk-AG6JV5Z2.cjs +183 -0
- package/dist/chunk-AG6JV5Z2.cjs.map +1 -0
- package/dist/chunk-APBK7NMS.js +30 -0
- package/dist/chunk-APBK7NMS.js.map +1 -0
- package/dist/chunk-AWO5YA7A.cjs +33 -0
- package/dist/chunk-AWO5YA7A.cjs.map +1 -0
- package/dist/chunk-AZATU6QW.js +108 -0
- package/dist/chunk-AZATU6QW.js.map +1 -0
- package/dist/chunk-BD2U3WST.cjs +623 -0
- package/dist/chunk-BD2U3WST.cjs.map +1 -0
- package/dist/chunk-BHBEOU6L.cjs +65 -0
- package/dist/chunk-BHBEOU6L.cjs.map +1 -0
- package/dist/chunk-CNOSNYNE.js +8 -0
- package/dist/chunk-CNOSNYNE.js.map +1 -0
- package/dist/chunk-CW3EFR4O.js +12 -0
- package/dist/chunk-CW3EFR4O.js.map +1 -0
- package/dist/chunk-DASVRNBK.js +7187 -0
- package/dist/chunk-DASVRNBK.js.map +1 -0
- package/dist/chunk-DJ6LCKYP.js +42 -0
- package/dist/chunk-DJ6LCKYP.js.map +1 -0
- package/dist/chunk-E5FHQAIO.cjs +45 -0
- package/dist/chunk-E5FHQAIO.cjs.map +1 -0
- package/dist/chunk-EOML5OTY.cjs +360 -0
- package/dist/chunk-EOML5OTY.cjs.map +1 -0
- package/dist/chunk-EP5CASHL.js +613 -0
- package/dist/chunk-EP5CASHL.js.map +1 -0
- package/dist/chunk-EP5OEEVZ.cjs +14 -0
- package/dist/chunk-EP5OEEVZ.cjs.map +1 -0
- package/dist/chunk-EUXI3FGQ.js +150 -0
- package/dist/chunk-EUXI3FGQ.js.map +1 -0
- package/dist/chunk-EWFSHCOS.js +40 -0
- package/dist/chunk-EWFSHCOS.js.map +1 -0
- package/dist/chunk-EX2C5K2T.cjs +25 -0
- package/dist/chunk-EX2C5K2T.cjs.map +1 -0
- package/dist/chunk-FEXWDQIZ.cjs +8 -0
- package/dist/chunk-FEXWDQIZ.cjs.map +1 -0
- package/dist/chunk-FEYBFY7H.cjs +358 -0
- package/dist/chunk-FEYBFY7H.cjs.map +1 -0
- package/dist/chunk-FRGAV6N6.cjs +34 -0
- package/dist/chunk-FRGAV6N6.cjs.map +1 -0
- package/dist/chunk-G5DHP5VF.js +6 -0
- package/dist/chunk-G5DHP5VF.js.map +1 -0
- package/dist/chunk-G5W2UHV2.js +99 -0
- package/dist/chunk-G5W2UHV2.js.map +1 -0
- package/dist/chunk-G7OP7O2C.cjs +39 -0
- package/dist/chunk-G7OP7O2C.cjs.map +1 -0
- package/dist/chunk-GE6CFCAM.cjs +25 -0
- package/dist/chunk-GE6CFCAM.cjs.map +1 -0
- package/dist/chunk-GIFALLHI.cjs +111 -0
- package/dist/chunk-GIFALLHI.cjs.map +1 -0
- package/dist/chunk-GLFET5GM.js +129 -0
- package/dist/chunk-GLFET5GM.js.map +1 -0
- package/dist/chunk-GQ6UFPFM.js +22 -0
- package/dist/chunk-GQ6UFPFM.js.map +1 -0
- package/dist/chunk-GQJWVMXS.js +129 -0
- package/dist/chunk-GQJWVMXS.js.map +1 -0
- package/dist/chunk-GVVJPUKC.js +80 -0
- package/dist/chunk-GVVJPUKC.js.map +1 -0
- package/dist/chunk-GZ2HOCQ2.cjs +134 -0
- package/dist/chunk-GZ2HOCQ2.cjs.map +1 -0
- package/dist/chunk-HCBOHXWP.js +37 -0
- package/dist/chunk-HCBOHXWP.js.map +1 -0
- package/dist/chunk-IBQJDVHF.cjs +281 -0
- package/dist/chunk-IBQJDVHF.cjs.map +1 -0
- package/dist/chunk-ISLB6Y5Q.cjs +106 -0
- package/dist/chunk-ISLB6Y5Q.cjs.map +1 -0
- package/dist/chunk-J55CRR4F.js +105 -0
- package/dist/chunk-J55CRR4F.js.map +1 -0
- package/dist/chunk-JBG6Z6MQ.cjs +28 -0
- package/dist/chunk-JBG6Z6MQ.cjs.map +1 -0
- package/dist/chunk-K3RQOZRU.js +61 -0
- package/dist/chunk-K3RQOZRU.js.map +1 -0
- package/dist/chunk-KDJYS4GB.cjs +703 -0
- package/dist/chunk-KDJYS4GB.cjs.map +1 -0
- package/dist/chunk-KMCAHUZM.cjs +4 -0
- package/dist/chunk-KMCAHUZM.cjs.map +1 -0
- package/dist/chunk-KUCBNPC6.js +87 -0
- package/dist/chunk-KUCBNPC6.js.map +1 -0
- package/dist/chunk-KV6UE5A4.js +50 -0
- package/dist/chunk-KV6UE5A4.js.map +1 -0
- package/dist/chunk-L6TZ2HQR.cjs +18 -0
- package/dist/chunk-L6TZ2HQR.cjs.map +1 -0
- package/dist/chunk-L7QHHGG2.cjs +141 -0
- package/dist/chunk-L7QHHGG2.cjs.map +1 -0
- package/dist/chunk-LHK3Y2AL.js +271 -0
- package/dist/chunk-LHK3Y2AL.js.map +1 -0
- package/dist/chunk-LO5RYRBH.cjs +6317 -0
- package/dist/chunk-LO5RYRBH.cjs.map +1 -0
- package/dist/chunk-LS5SJMUO.cjs +194 -0
- package/dist/chunk-LS5SJMUO.cjs.map +1 -0
- package/dist/chunk-LUGTMZFN.cjs +42 -0
- package/dist/chunk-LUGTMZFN.cjs.map +1 -0
- package/dist/chunk-LVUQU6D5.js +32 -0
- package/dist/chunk-LVUQU6D5.js.map +1 -0
- package/dist/chunk-M2QRC2GZ.js +166 -0
- package/dist/chunk-M2QRC2GZ.js.map +1 -0
- package/dist/chunk-M6QJYQIM.cjs +53 -0
- package/dist/chunk-M6QJYQIM.cjs.map +1 -0
- package/dist/chunk-MGCPH5EO.js +12 -0
- package/dist/chunk-MGCPH5EO.js.map +1 -0
- package/dist/chunk-MLVUWEZR.cjs +474 -0
- package/dist/chunk-MLVUWEZR.cjs.map +1 -0
- package/dist/chunk-MTAMJMZL.cjs +707 -0
- package/dist/chunk-MTAMJMZL.cjs.map +1 -0
- package/dist/chunk-MXL5AT3N.js +48 -0
- package/dist/chunk-MXL5AT3N.js.map +1 -0
- package/dist/chunk-MYEQSESM.cjs +75 -0
- package/dist/chunk-MYEQSESM.cjs.map +1 -0
- package/dist/chunk-N3VPF6ZD.js +427 -0
- package/dist/chunk-N3VPF6ZD.js.map +1 -0
- package/dist/chunk-N6VUAIGI.js +7 -0
- package/dist/chunk-N6VUAIGI.js.map +1 -0
- package/dist/chunk-N6XRLUN6.js +6286 -0
- package/dist/chunk-N6XRLUN6.js.map +1 -0
- package/dist/chunk-NOGDOZIT.cjs +114 -0
- package/dist/chunk-NOGDOZIT.cjs.map +1 -0
- package/dist/chunk-NUWXEISH.cjs +10 -0
- package/dist/chunk-NUWXEISH.cjs.map +1 -0
- package/dist/chunk-NZCZHXYN.cjs +161 -0
- package/dist/chunk-NZCZHXYN.cjs.map +1 -0
- package/dist/chunk-ODROSWQX.cjs +53 -0
- package/dist/chunk-ODROSWQX.cjs.map +1 -0
- package/dist/chunk-OE36AYKG.cjs +82 -0
- package/dist/chunk-OE36AYKG.cjs.map +1 -0
- package/dist/chunk-OLON7MO6.cjs +437 -0
- package/dist/chunk-OLON7MO6.cjs.map +1 -0
- package/dist/chunk-PBUOR2IT.js +277 -0
- package/dist/chunk-PBUOR2IT.js.map +1 -0
- package/dist/chunk-PC2ELXFF.cjs +225 -0
- package/dist/chunk-PC2ELXFF.cjs.map +1 -0
- package/dist/chunk-PCSGXLOC.js +71 -0
- package/dist/chunk-PCSGXLOC.js.map +1 -0
- package/dist/chunk-PFNMP6FQ.js +56 -0
- package/dist/chunk-PFNMP6FQ.js.map +1 -0
- package/dist/chunk-PIWSZTIP.js +690 -0
- package/dist/chunk-PIWSZTIP.js.map +1 -0
- package/dist/chunk-PKWHJ2GI.js +136 -0
- package/dist/chunk-PKWHJ2GI.js.map +1 -0
- package/dist/chunk-PLMVBX2A.cjs +76 -0
- package/dist/chunk-PLMVBX2A.cjs.map +1 -0
- package/dist/chunk-PM3XCD2G.cjs +113 -0
- package/dist/chunk-PM3XCD2G.cjs.map +1 -0
- package/dist/chunk-QAL4GZO7.cjs +143 -0
- package/dist/chunk-QAL4GZO7.cjs.map +1 -0
- package/dist/chunk-QDB2SEA2.js +74 -0
- package/dist/chunk-QDB2SEA2.js.map +1 -0
- package/dist/chunk-QOV7UNUN.js +25 -0
- package/dist/chunk-QOV7UNUN.js.map +1 -0
- package/dist/chunk-QQUWYLSF.cjs +50 -0
- package/dist/chunk-QQUWYLSF.cjs.map +1 -0
- package/dist/chunk-QUMBH3U4.cjs +9 -0
- package/dist/chunk-QUMBH3U4.cjs.map +1 -0
- package/dist/chunk-R4KA7OFQ.js +12 -0
- package/dist/chunk-R4KA7OFQ.js.map +1 -0
- package/dist/chunk-RBSGAZQQ.js +17 -0
- package/dist/chunk-RBSGAZQQ.js.map +1 -0
- package/dist/chunk-RM5YJWZI.js +46 -0
- package/dist/chunk-RM5YJWZI.js.map +1 -0
- package/dist/chunk-ROKNKXA4.cjs +8 -0
- package/dist/chunk-ROKNKXA4.cjs.map +1 -0
- package/dist/chunk-RQG6D546.cjs +75 -0
- package/dist/chunk-RQG6D546.cjs.map +1 -0
- package/dist/chunk-SG4YDD5L.cjs +74 -0
- package/dist/chunk-SG4YDD5L.cjs.map +1 -0
- package/dist/chunk-SNRCA7EO.js +56 -0
- package/dist/chunk-SNRCA7EO.js.map +1 -0
- package/dist/chunk-SO75R4WW.cjs +22 -0
- package/dist/chunk-SO75R4WW.cjs.map +1 -0
- package/dist/chunk-SP34NHFI.js +45 -0
- package/dist/chunk-SP34NHFI.js.map +1 -0
- package/dist/chunk-SSKSSBWJ.cjs +179 -0
- package/dist/chunk-SSKSSBWJ.cjs.map +1 -0
- package/dist/chunk-TB5663C2.js +1108 -0
- package/dist/chunk-TB5663C2.js.map +1 -0
- package/dist/chunk-TGH4NRES.js +220 -0
- package/dist/chunk-TGH4NRES.js.map +1 -0
- package/dist/chunk-TJ6ZPNID.js +189 -0
- package/dist/chunk-TJ6ZPNID.js.map +1 -0
- package/dist/chunk-U45T35N2.cjs +90 -0
- package/dist/chunk-U45T35N2.cjs.map +1 -0
- package/dist/chunk-UKVOPEZ2.js +442 -0
- package/dist/chunk-UKVOPEZ2.js.map +1 -0
- package/dist/chunk-UTB4NROA.cjs +887 -0
- package/dist/chunk-UTB4NROA.cjs.map +1 -0
- package/dist/chunk-UTW33B5V.js +6 -0
- package/dist/chunk-UTW33B5V.js.map +1 -0
- package/dist/chunk-UYUBSD2V.cjs +33 -0
- package/dist/chunk-UYUBSD2V.cjs.map +1 -0
- package/dist/chunk-V3JEP5AG.cjs +59 -0
- package/dist/chunk-V3JEP5AG.cjs.map +1 -0
- package/dist/chunk-VFAGJXHR.js +18 -0
- package/dist/chunk-VFAGJXHR.js.map +1 -0
- package/dist/chunk-VMEE57E5.cjs +58 -0
- package/dist/chunk-VMEE57E5.cjs.map +1 -0
- package/dist/chunk-VQVBEX3Y.cjs +113 -0
- package/dist/chunk-VQVBEX3Y.cjs.map +1 -0
- package/dist/chunk-VZDXX7TT.cjs +64 -0
- package/dist/chunk-VZDXX7TT.cjs.map +1 -0
- package/dist/chunk-WE5ZTI4D.js +346 -0
- package/dist/chunk-WE5ZTI4D.js.map +1 -0
- package/dist/chunk-WEFUVABP.js +19 -0
- package/dist/chunk-WEFUVABP.js.map +1 -0
- package/dist/chunk-WMU4LRKC.js +28 -0
- package/dist/chunk-WMU4LRKC.js.map +1 -0
- package/dist/chunk-WQ24RRHL.cjs +354 -0
- package/dist/chunk-WQ24RRHL.cjs.map +1 -0
- package/dist/chunk-WW4CGS7G.cjs +26 -0
- package/dist/chunk-WW4CGS7G.cjs.map +1 -0
- package/dist/chunk-WXE5WCTM.js +1144 -0
- package/dist/chunk-WXE5WCTM.js.map +1 -0
- package/dist/chunk-X23BGIYA.cjs +37 -0
- package/dist/chunk-X23BGIYA.cjs.map +1 -0
- package/dist/chunk-XEW4FTR2.js +98 -0
- package/dist/chunk-XEW4FTR2.js.map +1 -0
- package/dist/chunk-XIOI4IYW.js +167 -0
- package/dist/chunk-XIOI4IYW.js.map +1 -0
- package/dist/chunk-XLVPJ37V.cjs +44 -0
- package/dist/chunk-XLVPJ37V.cjs.map +1 -0
- package/dist/chunk-XOHAXXZA.cjs +51 -0
- package/dist/chunk-XOHAXXZA.cjs.map +1 -0
- package/dist/chunk-Y4NRIHK6.cjs +313 -0
- package/dist/chunk-Y4NRIHK6.cjs.map +1 -0
- package/dist/chunk-Y4YMMKL3.js +23 -0
- package/dist/chunk-Y4YMMKL3.js.map +1 -0
- package/dist/chunk-YJNYBVE3.cjs +14 -0
- package/dist/chunk-YJNYBVE3.cjs.map +1 -0
- package/dist/chunk-Z762QNQP.cjs +60 -0
- package/dist/chunk-Z762QNQP.cjs.map +1 -0
- package/dist/chunk-ZG5KMBOF.js +669 -0
- package/dist/chunk-ZG5KMBOF.js.map +1 -0
- package/dist/chunk-ZKONQEFA.js +344 -0
- package/dist/chunk-ZKONQEFA.js.map +1 -0
- package/dist/chunk-ZR5X7QMH.js +39 -0
- package/dist/chunk-ZR5X7QMH.js.map +1 -0
- package/dist/chunk-ZW4BJQ26.js +84 -0
- package/dist/chunk-ZW4BJQ26.js.map +1 -0
- package/dist/climbs-BhlWuu0x.d.ts +70 -0
- package/dist/climbs-DgBFwySV.d.cts +70 -0
- package/dist/collab/index.cjs +1283 -0
- package/dist/collab/index.cjs.map +1 -0
- package/dist/collab/index.d.cts +850 -0
- package/dist/collab/index.d.ts +850 -0
- package/dist/collab/index.js +1274 -0
- package/dist/collab/index.js.map +1 -0
- package/dist/data/index.cjs +132 -0
- package/dist/data/index.cjs.map +1 -0
- package/dist/data/index.d.cts +468 -0
- package/dist/data/index.d.ts +468 -0
- package/dist/data/index.js +15 -0
- package/dist/data/index.js.map +1 -0
- package/dist/editor/index.cjs +4506 -0
- package/dist/editor/index.cjs.map +1 -0
- package/dist/editor/index.d.cts +59 -0
- package/dist/editor/index.d.ts +59 -0
- package/dist/editor/index.js +4486 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/elevationTiles-pmsb9wnU.d.cts +77 -0
- package/dist/elevationTiles-pmsb9wnU.d.ts +77 -0
- package/dist/errors/index.cjs +28 -0
- package/dist/errors/index.cjs.map +1 -0
- package/dist/errors/index.d.cts +125 -0
- package/dist/errors/index.d.ts +125 -0
- package/dist/errors/index.js +3 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/geo/index.cjs +232 -0
- package/dist/geo/index.cjs.map +1 -0
- package/dist/geo/index.d.cts +821 -0
- package/dist/geo/index.d.ts +821 -0
- package/dist/geo/index.js +15 -0
- package/dist/geo/index.js.map +1 -0
- package/dist/geodesy-543qXKtI.d.cts +78 -0
- package/dist/geodesy-543qXKtI.d.ts +78 -0
- package/dist/geolocation-DDkQdWMN.d.cts +106 -0
- package/dist/geolocation-DDkQdWMN.d.ts +106 -0
- package/dist/i18n/fr/index.cjs +338 -0
- package/dist/i18n/fr/index.cjs.map +1 -0
- package/dist/i18n/fr/index.d.cts +25 -0
- package/dist/i18n/fr/index.d.ts +25 -0
- package/dist/i18n/fr/index.js +336 -0
- package/dist/i18n/fr/index.js.map +1 -0
- package/dist/i18n/index.cjs +464 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +227 -0
- package/dist/i18n/index.d.ts +227 -0
- package/dist/i18n/index.js +430 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/icons/index.cjs +116 -0
- package/dist/icons/index.cjs.map +1 -0
- package/dist/icons/index.d.cts +457 -0
- package/dist/icons/index.d.ts +457 -0
- package/dist/icons/index.js +11 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.cjs +1869 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +251 -0
- package/dist/index.d.ts +251 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/itinerary-Dp2ZnqgD.d.cts +178 -0
- package/dist/itinerary-Dp2ZnqgD.d.ts +178 -0
- package/dist/language-CEWQ5uYw.d.cts +69 -0
- package/dist/language-CEWQ5uYw.d.ts +69 -0
- package/dist/layers/index.cjs +318 -0
- package/dist/layers/index.cjs.map +1 -0
- package/dist/layers/index.d.cts +1555 -0
- package/dist/layers/index.d.ts +1555 -0
- package/dist/layers/index.js +17 -0
- package/dist/layers/index.js.map +1 -0
- package/dist/map-client/index.cjs +4 -0
- package/dist/map-client/index.cjs.map +1 -0
- package/dist/map-client/index.d.cts +1856 -0
- package/dist/map-client/index.d.ts +1856 -0
- package/dist/map-client/index.js +3 -0
- package/dist/map-client/index.js.map +1 -0
- package/dist/maplibre-worker.mjs +12 -0
- package/dist/markerSprite-DGBQF6PO.cjs +49 -0
- package/dist/markerSprite-DGBQF6PO.cjs.map +1 -0
- package/dist/markerSprite-DZLTR6F6.js +8 -0
- package/dist/markerSprite-DZLTR6F6.js.map +1 -0
- package/dist/mountayaMap-C9mxRFib.d.cts +3277 -0
- package/dist/mountayaMap-DgnlQ2fE.d.ts +3277 -0
- package/dist/navigation/index.cjs +699 -0
- package/dist/navigation/index.cjs.map +1 -0
- package/dist/navigation/index.d.cts +632 -0
- package/dist/navigation/index.d.ts +632 -0
- package/dist/navigation/index.js +689 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/order-BLhsGsH8.d.ts +132 -0
- package/dist/order-BZkUwMou.d.cts +132 -0
- package/dist/paint-BgUcj8l7.d.cts +118 -0
- package/dist/paint-Dx_qGNE_.d.ts +118 -0
- package/dist/profile/index.cjs +675 -0
- package/dist/profile/index.cjs.map +1 -0
- package/dist/profile/index.d.cts +2086 -0
- package/dist/profile/index.d.ts +2086 -0
- package/dist/profile/index.js +18 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/provider-DM71XnLX.d.cts +121 -0
- package/dist/provider-DM71XnLX.d.ts +121 -0
- package/dist/roadAccess-D_rOE4xW.d.cts +86 -0
- package/dist/roadAccess-D_rOE4xW.d.ts +86 -0
- package/dist/routeProfile-BKfSfxx6.d.ts +210 -0
- package/dist/routeProfile-BsSUABXv.d.cts +210 -0
- package/dist/seams/index.cjs +39 -0
- package/dist/seams/index.cjs.map +1 -0
- package/dist/seams/index.d.cts +254 -0
- package/dist/seams/index.d.ts +254 -0
- package/dist/seams/index.js +6 -0
- package/dist/seams/index.js.map +1 -0
- package/dist/search/index.cjs +147 -0
- package/dist/search/index.cjs.map +1 -0
- package/dist/search/index.d.cts +888 -0
- package/dist/search/index.d.ts +888 -0
- package/dist/search/index.js +14 -0
- package/dist/search/index.js.map +1 -0
- package/dist/searchHighlight-DFE7LVIL.cjs +33 -0
- package/dist/searchHighlight-DFE7LVIL.cjs.map +1 -0
- package/dist/searchHighlight-MHAQZVWG.js +12 -0
- package/dist/searchHighlight-MHAQZVWG.js.map +1 -0
- package/dist/searchLimits-j99-NTXR.d.cts +24 -0
- package/dist/searchLimits-j99-NTXR.d.ts +24 -0
- package/dist/sections-CVlc2Inr.d.cts +953 -0
- package/dist/sections-CmtaduLc.d.ts +953 -0
- package/dist/segmentRoute-C5UL_5bp.d.ts +172 -0
- package/dist/segmentRoute-CIo6dR8Y.d.cts +172 -0
- package/dist/strings-30RSdIat.d.cts +552 -0
- package/dist/strings-DPTIbzT5.d.ts +552 -0
- package/dist/stripeImage-CQUXM2YI.js +14 -0
- package/dist/stripeImage-CQUXM2YI.js.map +1 -0
- package/dist/stripeImage-R43OPA6U.cjs +39 -0
- package/dist/stripeImage-R43OPA6U.cjs.map +1 -0
- package/dist/style/index.cjs +116 -0
- package/dist/style/index.cjs.map +1 -0
- package/dist/style/index.d.cts +538 -0
- package/dist/style/index.d.ts +538 -0
- package/dist/style/index.js +11 -0
- package/dist/style/index.js.map +1 -0
- package/dist/styles.css +11 -0
- package/dist/testing/index.cjs +629 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +265 -0
- package/dist/testing/index.d.ts +265 -0
- package/dist/testing/index.js +623 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/timezone/index.cjs +759 -0
- package/dist/timezone/index.cjs.map +1 -0
- package/dist/timezone/index.d.cts +53 -0
- package/dist/timezone/index.d.ts +53 -0
- package/dist/timezone/index.js +757 -0
- package/dist/timezone/index.js.map +1 -0
- package/dist/types-B034JMjl.d.ts +973 -0
- package/dist/types-B2NDLxQA.d.cts +21 -0
- package/dist/types-B2NDLxQA.d.ts +21 -0
- package/dist/types-BEv8V_8V.d.cts +55 -0
- package/dist/types-BEv8V_8V.d.ts +55 -0
- package/dist/types-C8aX5KMU.d.cts +973 -0
- package/dist/types-CTQwbSdA.d.cts +321 -0
- package/dist/types-nO2joeRk.d.ts +321 -0
- package/dist/units/index.cjs +99 -0
- package/dist/units/index.cjs.map +1 -0
- package/dist/units/index.d.cts +75 -0
- package/dist/units/index.d.ts +75 -0
- package/dist/units/index.js +6 -0
- package/dist/units/index.js.map +1 -0
- package/dist/units-D9mBrusY.d.cts +900 -0
- package/dist/units-D9mBrusY.d.ts +900 -0
- package/dist/video/index.cjs +2198 -0
- package/dist/video/index.cjs.map +1 -0
- package/dist/video/index.d.cts +873 -0
- package/dist/video/index.d.ts +873 -0
- package/dist/video/index.js +2173 -0
- package/dist/video/index.js.map +1 -0
- package/dist/videoOverlay-Dh_D5_Zs.d.cts +44 -0
- package/dist/videoOverlay-Dh_D5_Zs.d.ts +44 -0
- package/dist/view/index.cjs +43 -0
- package/dist/view/index.cjs.map +1 -0
- package/dist/view/index.d.cts +836 -0
- package/dist/view/index.d.ts +836 -0
- package/dist/view/index.js +34 -0
- package/dist/view/index.js.map +1 -0
- package/dist/zones-B05QA8fy.d.cts +75 -0
- package/dist/zones-B05QA8fy.d.ts +75 -0
- package/package.json +433 -4
- package/src/agent/engines/session.ts +2255 -0
- package/src/agent/index.ts +109 -0
- package/src/agent/rules/agentError.ts +128 -0
- package/src/agent/rules/boundedInputJson.ts +53 -0
- package/src/agent/rules/conversation.ts +629 -0
- package/src/agent/rules/conversationFaults.ts +349 -0
- package/src/agent/rules/conversationHost.ts +390 -0
- package/src/agent/rules/dispatcher.ts +102 -0
- package/src/agent/rules/errorCodes.ts +78 -0
- package/src/agent/rules/errorStatus.ts +65 -0
- package/src/agent/rules/scriptedTransport.ts +390 -0
- package/src/agent/rules/stickToBottom.ts +38 -0
- package/src/agent/rules/toolResultPayload.ts +197 -0
- package/src/auth/rules/clientHeader.ts +22 -0
- package/src/auth/rules/sentCredential.ts +76 -0
- package/src/auth/rules/transformRequest.ts +803 -0
- package/src/camera/engines/videoFlight.ts +1758 -0
- package/src/camera/index.ts +157 -0
- package/src/camera/rules/clearance.ts +1099 -0
- package/src/camera/rules/fit.ts +132 -0
- package/src/camera/rules/modes.ts +1023 -0
- package/src/camera/rules/plan.ts +478 -0
- package/src/camera/rules/planner.ts +129 -0
- package/src/camera/rules/poseRanges.ts +38 -0
- package/src/camera/rules/presets.ts +185 -0
- package/src/camera/rules/profileSamples.ts +243 -0
- package/src/camera/rules/route.ts +596 -0
- package/src/camera/rules/routeContent.ts +104 -0
- package/src/camera/rules/spline.ts +765 -0
- package/src/camera/rules/sweptViewports.ts +39 -0
- package/src/camera/rules/track.ts +1412 -0
- package/src/camera/rules/vocabulary.ts +130 -0
- package/src/camera/rules/zoom.ts +216 -0
- package/src/collab/engines/session.ts +1902 -0
- package/src/collab/engines/trailingThrottle.ts +151 -0
- package/src/collab/index.ts +56 -0
- package/src/collab/rules/dispatch.ts +143 -0
- package/src/collab/rules/peerNames.ts +51 -0
- package/src/collab/rules/scriptedTransport.ts +244 -0
- package/src/compose/engines/baseMapSwitch.ts +1136 -0
- package/src/compose/engines/events.ts +962 -0
- package/src/compose/engines/mountayaMap.ts +5674 -0
- package/src/compose/engines/sentCredentials.ts +146 -0
- package/src/compose/engines/slotRequests.ts +413 -0
- package/src/compose/rules/accessRefusal.ts +109 -0
- package/src/compose/rules/accessStanding.ts +75 -0
- package/src/compose/rules/analysisKinds.ts +331 -0
- package/src/compose/rules/analysisLayers.ts +176 -0
- package/src/compose/rules/cameraMoves.ts +38 -0
- package/src/compose/rules/carriedLayers.ts +87 -0
- package/src/compose/rules/developmentWarnings.ts +166 -0
- package/src/compose/rules/fitCamera.ts +54 -0
- package/src/compose/rules/geoJsonSlot.ts +61 -0
- package/src/compose/rules/geometrySlots.ts +155 -0
- package/src/compose/rules/glyphNode.ts +62 -0
- package/src/compose/rules/layerKeys.ts +92 -0
- package/src/compose/rules/layerOrder.ts +85 -0
- package/src/compose/rules/layersManifest.ts +26 -0
- package/src/compose/rules/mapOptions.ts +300 -0
- package/src/compose/rules/maplibreWorkerVersion.gen.ts +8 -0
- package/src/compose/rules/markerPin.ts +122 -0
- package/src/compose/rules/markerRegistry.ts +85 -0
- package/src/compose/rules/markerSprite.ts +382 -0
- package/src/compose/rules/maxBounds.ts +120 -0
- package/src/compose/rules/overlayLookup.ts +49 -0
- package/src/compose/rules/paintDiff.ts +38 -0
- package/src/compose/rules/panLock.ts +77 -0
- package/src/compose/rules/patch.ts +124 -0
- package/src/compose/rules/queriedFeature.ts +55 -0
- package/src/compose/rules/queryLayers.ts +46 -0
- package/src/compose/rules/searchHighlight.ts +313 -0
- package/src/compose/rules/slotNames.ts +19 -0
- package/src/compose/rules/stripeImage.ts +253 -0
- package/src/compose/rules/swapMarker.ts +66 -0
- package/src/compose/rules/terrainVariant.ts +88 -0
- package/src/compose/rules/types.ts +566 -0
- package/src/compose/rules/urlHash.ts +19 -0
- package/src/compose/rules/viewOptions.ts +451 -0
- package/src/compose/rules/workerUrl.ts +96 -0
- package/src/data/engines/itineraryResource.ts +643 -0
- package/src/data/index.ts +78 -0
- package/src/data/rules/adapt.ts +473 -0
- package/src/data/rules/editModes.ts +51 -0
- package/src/data/rules/itinerary.ts +168 -0
- package/src/data/rules/nullable.ts +63 -0
- package/src/data/rules/roadAccess.ts +169 -0
- package/src/data/rules/segmentGroups.ts +309 -0
- package/src/data/rules/selectors.ts +95 -0
- package/src/data/rules/zones.ts +79 -0
- package/src/draw/engines/boundaryEngine.ts +1003 -0
- package/src/draw/engines/framedAdapter.ts +198 -0
- package/src/draw/engines/pointerCursor.ts +205 -0
- package/src/draw/engines/segmentEngine.ts +1405 -0
- package/src/draw/engines/snapIndex.ts +254 -0
- package/src/draw/engines/waypointEngine.ts +574 -0
- package/src/draw/engines/zoneEngine.ts +1137 -0
- package/src/draw/rules/drawFrame.ts +123 -0
- package/src/draw/rules/insertVertex.ts +226 -0
- package/src/draw/rules/screenSpace.ts +62 -0
- package/src/draw/rules/seeds.ts +185 -0
- package/src/draw/rules/snap.ts +115 -0
- package/src/draw/rules/snapCameraKey.ts +50 -0
- package/src/draw/rules/terraDrawShared.ts +214 -0
- package/src/draw/rules/zoneOutline.ts +213 -0
- package/src/editing/engines/cursor.ts +505 -0
- package/src/editing/engines/draftMarker.ts +149 -0
- package/src/editing/rules/accent.ts +11 -0
- package/src/editing/rules/engine.ts +286 -0
- package/src/editing/rules/placement.ts +22 -0
- package/src/editing/rules/positions.ts +89 -0
- package/src/editing/rules/sources.ts +9 -0
- package/src/editing/rules/types.ts +457 -0
- package/src/editing/rules/vocabulary.ts +10 -0
- package/src/editing/rules/waypointCursor.ts +228 -0
- package/src/editor/engines/directionArrows.ts +459 -0
- package/src/editor/engines/directions.ts +1383 -0
- package/src/editor/engines/editorClient.ts +134 -0
- package/src/editor/engines/eventScope.ts +59 -0
- package/src/editor/engines/frameLoop.ts +159 -0
- package/src/editor/engines/itineraryPreview.ts +272 -0
- package/src/editor/engines/mapLockGuard.ts +66 -0
- package/src/editor/engines/overlayRenderer.ts +2696 -0
- package/src/editor/engines/peerDraft.ts +760 -0
- package/src/editor/engines/poiPick.ts +305 -0
- package/src/editor/engines/pointPick.ts +84 -0
- package/src/editor/engines/roadAccessLine.ts +140 -0
- package/src/editor/engines/searchHighlight.ts +183 -0
- package/src/editor/engines/viewClient.ts +4083 -0
- package/src/editor/engines/zoneBadges.ts +503 -0
- package/src/editor/index.ts +97 -0
- package/src/editor/rules/accentColor.ts +116 -0
- package/src/editor/rules/camera.ts +121 -0
- package/src/editor/rules/contract.ts +125 -0
- package/src/editor/rules/icons.ts +825 -0
- package/src/editor/rules/markerElements.ts +244 -0
- package/src/editor/rules/style.ts +51 -0
- package/src/editor/rules/terrain.ts +98 -0
- package/src/editor/rules/tileWarm.ts +191 -0
- package/src/editor/rules/tilesReload.ts +158 -0
- package/src/editor/rules/zoneBadgePlacement.ts +1832 -0
- package/src/editor/rules/zoneTimeStyling.ts +119 -0
- package/src/errors/index.ts +25 -0
- package/src/errors/rules/errors.ts +157 -0
- package/src/errors/rules/print.ts +129 -0
- package/src/geo/index.ts +94 -0
- package/src/geo/rules/boundaries.ts +105 -0
- package/src/geo/rules/camera.ts +496 -0
- package/src/geo/rules/corridor.ts +242 -0
- package/src/geo/rules/elevationTiles.ts +269 -0
- package/src/geo/rules/formatLngLat.ts +63 -0
- package/src/geo/rules/geodesy.ts +125 -0
- package/src/geo/rules/geometry.ts +362 -0
- package/src/geo/rules/lineWalk.ts +77 -0
- package/src/geo/rules/longitude.ts +99 -0
- package/src/geo/rules/searchLimits.ts +22 -0
- package/src/geo/rules/segmentGeometry.ts +80 -0
- package/src/geo/rules/terrain.ts +107 -0
- package/src/geo/rules/tuples.ts +124 -0
- package/src/geo/rules/types.ts +54 -0
- package/src/geo/rules/webMercator.ts +57 -0
- package/src/i18n/fr/index.ts +17 -0
- package/src/i18n/fr/rules/fr.ts +85 -0
- package/src/i18n/fr/rules/words.gen.ts +277 -0
- package/src/i18n/index.ts +81 -0
- package/src/i18n/rules/bundle.ts +378 -0
- package/src/i18n/rules/config.ts +71 -0
- package/src/i18n/rules/endonyms.gen.ts +19 -0
- package/src/i18n/rules/language.ts +92 -0
- package/src/i18n/rules/localizedName.ts +33 -0
- package/src/i18n/rules/merge.ts +106 -0
- package/src/i18n/rules/scope.ts +127 -0
- package/src/i18n/rules/strings.ts +632 -0
- package/src/i18n/rules/videoOverlay.ts +121 -0
- package/src/i18n/rules/wordForms.ts +95 -0
- package/src/i18n/rules/words.gen.ts +277 -0
- package/src/icons/index.ts +54 -0
- package/src/icons/rules/activities.ts +40 -0
- package/src/icons/rules/amenities.ts +250 -0
- package/src/icons/rules/artwork.gen.ts +83 -0
- package/src/icons/rules/artwork.ts +47 -0
- package/src/icons/rules/fallback.ts +21 -0
- package/src/icons/rules/lucideMarkers.gen.ts +112 -0
- package/src/icons/rules/lucideUi.gen.ts +197 -0
- package/src/icons/rules/paint.ts +107 -0
- package/src/icons/rules/parse.ts +475 -0
- package/src/icons/rules/provider.ts +373 -0
- package/src/icons/rules/sprites.ts +54 -0
- package/src/icons/rules/ui.ts +348 -0
- package/src/icons/rules/waypoints.ts +215 -0
- package/src/index.ts +1012 -0
- package/src/layers/engines/layersSelection.ts +515 -0
- package/src/layers/engines/readoutEngine.ts +131 -0
- package/src/layers/index.ts +151 -0
- package/src/layers/rules/analysis.ts +135 -0
- package/src/layers/rules/enrichment.ts +30 -0
- package/src/layers/rules/geoJson.ts +270 -0
- package/src/layers/rules/hover.ts +67 -0
- package/src/layers/rules/itineraries.ts +182 -0
- package/src/layers/rules/layersPanel.ts +237 -0
- package/src/layers/rules/order.ts +194 -0
- package/src/layers/rules/overlayInstant.ts +49 -0
- package/src/layers/rules/overlays.ts +52 -0
- package/src/layers/rules/poiPanel.ts +119 -0
- package/src/layers/rules/pois.ts +114 -0
- package/src/layers/rules/readout.ts +340 -0
- package/src/layers/rules/streetView.ts +16 -0
- package/src/layers/rules/tileTimestamp.ts +146 -0
- package/src/layers/rules/timeSlider.ts +192 -0
- package/src/layers/rules/timeWindow.ts +123 -0
- package/src/layers/rules/zones.ts +43 -0
- package/src/layers/rules/zoom.ts +77 -0
- package/src/map-client/index.ts +71 -0
- package/src/map-client/rules/mapClient.ts +1943 -0
- package/src/navigation/engines/navigation.ts +493 -0
- package/src/navigation/index.ts +51 -0
- package/src/navigation/rules/followedRoute.ts +78 -0
- package/src/navigation/rules/instructions.ts +89 -0
- package/src/navigation/rules/itineraryRoute.ts +232 -0
- package/src/navigation/rules/offRoute.ts +41 -0
- package/src/navigation/rules/progress.ts +230 -0
- package/src/navigation/rules/prompts.ts +217 -0
- package/src/navigation/rules/routeRequest.ts +98 -0
- package/src/navigation/rules/status.ts +142 -0
- package/src/navigation/rules/steps.ts +234 -0
- package/src/navigation/rules/types.ts +83 -0
- package/src/profile/index.ts +307 -0
- package/src/profile/rules/amenityBadge.ts +35 -0
- package/src/profile/rules/amenityFilter.ts +74 -0
- package/src/profile/rules/amenityStacks.ts +66 -0
- package/src/profile/rules/axis.ts +89 -0
- package/src/profile/rules/axisCulling.ts +83 -0
- package/src/profile/rules/axisLookup.ts +180 -0
- package/src/profile/rules/climbs.ts +292 -0
- package/src/profile/rules/cursorMarker.ts +122 -0
- package/src/profile/rules/cursorReadout.ts +104 -0
- package/src/profile/rules/curvePlacement.ts +216 -0
- package/src/profile/rules/dock.ts +293 -0
- package/src/profile/rules/elevation.ts +1263 -0
- package/src/profile/rules/instant.ts +89 -0
- package/src/profile/rules/intl.ts +237 -0
- package/src/profile/rules/legEmphasis.ts +53 -0
- package/src/profile/rules/profileColors.ts +66 -0
- package/src/profile/rules/profileLayout.ts +59 -0
- package/src/profile/rules/profileSlices.ts +55 -0
- package/src/profile/rules/routeProfile.ts +475 -0
- package/src/profile/rules/rowMatch.ts +50 -0
- package/src/profile/rules/scale.ts +650 -0
- package/src/profile/rules/scaleFrame.ts +171 -0
- package/src/profile/rules/sectionChips.ts +83 -0
- package/src/profile/rules/sections.ts +923 -0
- package/src/profile/rules/slopeRamp.ts +160 -0
- package/src/profile/rules/statStrip.ts +103 -0
- package/src/profile/rules/steepness.ts +51 -0
- package/src/profile/rules/tableCells.ts +269 -0
- package/src/profile/rules/tableCursor.ts +87 -0
- package/src/profile/rules/unitPatterns.ts +335 -0
- package/src/profile/rules/units.ts +1025 -0
- package/src/profile/rules/waypointCard.ts +593 -0
- package/src/profile/rules/webAddress.ts +130 -0
- package/src/profile/rules/windowSpans.ts +65 -0
- package/src/rules/asciiFold.ts +17 -0
- package/src/rules/inDevelopment.ts +54 -0
- package/src/rules/listeners.ts +62 -0
- package/src/rules/timers.ts +9 -0
- package/src/rules/types.ts +22 -0
- package/src/rules/uuid.ts +87 -0
- package/src/seams/engines/geolocateControl.ts +286 -0
- package/src/seams/index.ts +50 -0
- package/src/seams/rules/clock.ts +169 -0
- package/src/seams/rules/geolocation.ts +165 -0
- package/src/seams/rules/segmentRoute.ts +187 -0
- package/src/search/engines/search.ts +1093 -0
- package/src/search/index.ts +114 -0
- package/src/search/rules/describe.ts +383 -0
- package/src/search/rules/filters.ts +195 -0
- package/src/search/rules/highlight.ts +270 -0
- package/src/search/rules/pick.ts +90 -0
- package/src/search/rules/rows.ts +258 -0
- package/src/search/rules/searchFocus.ts +27 -0
- package/src/search/rules/searchViewport.ts +44 -0
- package/src/search/rules/shown.ts +77 -0
- package/src/search/rules/types.ts +340 -0
- package/src/stream/rules/reconnectSchedule.ts +83 -0
- package/src/style/engines/organizationRead.ts +80 -0
- package/src/style/index.ts +63 -0
- package/src/style/rules/apply.ts +268 -0
- package/src/style/rules/attribution.ts +119 -0
- package/src/style/rules/itineraryLine.ts +142 -0
- package/src/style/rules/language.ts +668 -0
- package/src/style/rules/layout.gen.ts +27 -0
- package/src/style/rules/organization.ts +96 -0
- package/src/style/rules/paint.ts +143 -0
- package/src/style/rules/panelLayout.ts +51 -0
- package/src/style/rules/roadAccessColors.ts +29 -0
- package/src/style/rules/roadAccessLine.ts +267 -0
- package/src/style/rules/segmentColors.ts +207 -0
- package/src/testing/catalogs.ts +103 -0
- package/src/testing/index.ts +30 -0
- package/src/testing/mapClient.ts +241 -0
- package/src/testing/mountayaMap.ts +741 -0
- package/src/timezone/index.ts +14 -0
- package/src/timezone/rules/viewport.ts +875 -0
- package/src/units/index.ts +55 -0
- package/src/units/rules/conversions.ts +620 -0
- package/src/units/rules/preferenceChoices.ts +124 -0
- package/src/units/rules/preferences.ts +77 -0
- package/src/units/rules/rounding.ts +69 -0
- package/src/video/engines/videoRun.ts +654 -0
- package/src/video/engines/viewClient.ts +6 -0
- package/src/video/index.ts +83 -0
- package/src/video/profileOverlay/rules/contract.ts +212 -0
- package/src/video/profileOverlay/rules/curve.ts +216 -0
- package/src/video/profileOverlay/rules/draw.ts +410 -0
- package/src/video/profileOverlay/rules/fonts.ts +54 -0
- package/src/video/profileOverlay/rules/graphDesign.ts +690 -0
- package/src/video/profileOverlay/rules/minimalDesign.ts +144 -0
- package/src/video/profileOverlay/rules/registry.ts +23 -0
- package/src/video/profileOverlay/rules/staticLayer.ts +582 -0
- package/src/video/profileOverlay/rules/stripDesign.ts +327 -0
- package/src/video/profileOverlay/rules/types.ts +78 -0
- package/src/video/rules/videoConstants.ts +250 -0
- package/src/video/rules/videoEncoder.ts +277 -0
- package/src/video/rules/videoFrames.ts +99 -0
- package/src/video/rules/videoPreview.ts +185 -0
- package/src/video/rules/videoRecorder.ts +746 -0
- package/src/video/rules/videoWatermark.ts +155 -0
- package/src/video/rules/watermarkMark.ts +40 -0
- package/src/view/engines/viewClient.ts +6 -0
- package/src/view/index.ts +20 -0
|
@@ -0,0 +1,1283 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkUYUBSD2V_cjs = require('../chunk-UYUBSD2V.cjs');
|
|
4
|
+
var chunk6ACRNQQQ_cjs = require('../chunk-6ACRNQQQ.cjs');
|
|
5
|
+
var chunkWW4CGS7G_cjs = require('../chunk-WW4CGS7G.cjs');
|
|
6
|
+
var chunkISLB6Y5Q_cjs = require('../chunk-ISLB6Y5Q.cjs');
|
|
7
|
+
|
|
8
|
+
// src/collab/engines/trailingThrottle.ts
|
|
9
|
+
var TrailingThrottle = class {
|
|
10
|
+
/**
|
|
11
|
+
* @param intervalMs The window in milliseconds: a finite number from 0 to 2 ** 31 - 1, the
|
|
12
|
+
* longest delay a timer honours. At 0 a burst flushes on the next turn of the event loop.
|
|
13
|
+
* @param flush Called with the value a window ends on.
|
|
14
|
+
* @param options Whether the first push of a burst flushes at once.
|
|
15
|
+
* @throws {MountayaElementsError} When `intervalMs` is `NaN`, negative, infinite or past that
|
|
16
|
+
* ceiling. A timer handed one fires at once, so the throttle would pace nothing while reading
|
|
17
|
+
* as a setting.
|
|
18
|
+
*/
|
|
19
|
+
constructor(intervalMs, flush, options = {}) {
|
|
20
|
+
this.intervalMs = intervalMs;
|
|
21
|
+
this.flush = flush;
|
|
22
|
+
if (!Number.isFinite(intervalMs) || intervalMs < 0 || intervalMs > chunk6ACRNQQQ_cjs.MAX_TIMER_MS) {
|
|
23
|
+
throw new chunkISLB6Y5Q_cjs.MountayaElementsError(
|
|
24
|
+
`TrailingThrottle: intervalMs is ${String(intervalMs)}; pass a number of milliseconds from 0 to ${chunk6ACRNQQQ_cjs.MAX_TIMER_MS}.`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
this.leading = options.leading ?? false;
|
|
28
|
+
}
|
|
29
|
+
intervalMs;
|
|
30
|
+
flush;
|
|
31
|
+
pending = null;
|
|
32
|
+
// The open window, as the timer that closes it: set from the first push of a burst, or from a
|
|
33
|
+
// leading flush, and cleared as it fires with nothing gathered or by cancel(). A push while it
|
|
34
|
+
// is set lands on the trailing edge.
|
|
35
|
+
timer = null;
|
|
36
|
+
leading;
|
|
37
|
+
/**
|
|
38
|
+
* push records the latest value and opens a window when none is open, so a burst flushes at the
|
|
39
|
+
* end of the window rather than per call.
|
|
40
|
+
*
|
|
41
|
+
* With `leading`, a push into an idle throttle (one that has not flushed within the last
|
|
42
|
+
* interval) flushes at once and opens the window from there. The next push inside that window
|
|
43
|
+
* still lands on the trailing edge, so a two-push burst produces two flushes rather than one.
|
|
44
|
+
*/
|
|
45
|
+
push(value) {
|
|
46
|
+
if (this.timer !== null) {
|
|
47
|
+
this.pending = { value };
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (this.leading) {
|
|
51
|
+
this.open();
|
|
52
|
+
this.flush(value);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.pending = { value };
|
|
56
|
+
this.open();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* cancel drops the open window and any pending value with it.
|
|
60
|
+
*
|
|
61
|
+
* A disposed session or a cleared draft leaves no trailing send to fire after teardown, and
|
|
62
|
+
* the next push starts a fresh burst, which is what makes `cancel()` the right thing to call
|
|
63
|
+
* when the SUBJECT changes rather than when the throttle is being thrown away.
|
|
64
|
+
*/
|
|
65
|
+
cancel() {
|
|
66
|
+
if (this.timer !== null) {
|
|
67
|
+
clearTimeout(this.timer);
|
|
68
|
+
this.timer = null;
|
|
69
|
+
}
|
|
70
|
+
this.pending = null;
|
|
71
|
+
}
|
|
72
|
+
/** open starts a window that ends one interval from now. */
|
|
73
|
+
open() {
|
|
74
|
+
this.timer = setTimeout(() => this.fire(), this.intervalMs);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* fire ends the window, flushing what it gathered. A leading throttle's window runs from a
|
|
78
|
+
* flush, so the flush that ends one window opens the next: a push inside it waits for the rest
|
|
79
|
+
* of that window rather than for a fresh interval on top of the time already spent.
|
|
80
|
+
*/
|
|
81
|
+
fire() {
|
|
82
|
+
this.timer = null;
|
|
83
|
+
const pending = this.pending;
|
|
84
|
+
this.pending = null;
|
|
85
|
+
if (pending === null) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (this.leading) {
|
|
89
|
+
this.open();
|
|
90
|
+
}
|
|
91
|
+
this.flush(pending.value);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/collab/engines/session.ts
|
|
96
|
+
var CHANGE_COALESCE_MS = 200;
|
|
97
|
+
var SELECTION_THROTTLE_MS = 150;
|
|
98
|
+
var LIVE_SEGMENT_THROTTLE_MS = 60;
|
|
99
|
+
var COLLAB_RECONNECT_BASE_MS = 500;
|
|
100
|
+
var RECONNECT_MAX_MS = 15e3;
|
|
101
|
+
var reconnectSchedule = {
|
|
102
|
+
baseMs: COLLAB_RECONNECT_BASE_MS,
|
|
103
|
+
maxMs: RECONNECT_MAX_MS
|
|
104
|
+
};
|
|
105
|
+
var releaseRetrySchedule = { baseMs: 1e3, maxMs: 3e4 };
|
|
106
|
+
var unsettledFailure = (error) => {
|
|
107
|
+
const status = chunkUYUBSD2V_cjs.statusOf(error);
|
|
108
|
+
return status === void 0 || status >= 500 || status === 408 || status === 429;
|
|
109
|
+
};
|
|
110
|
+
var lockKey = (entity) => `${entity.kind}:${entity.id}`;
|
|
111
|
+
var OWED_ECHO_SNAPSHOTS = 2;
|
|
112
|
+
var OPENING_SNAPSHOTS = ["presence.snapshot", "lock.snapshot"];
|
|
113
|
+
var itineraryLessKinds = /* @__PURE__ */ new Set([
|
|
114
|
+
"collection",
|
|
115
|
+
"zone"
|
|
116
|
+
]);
|
|
117
|
+
var changeApplyInput = (event, bustToken) => ({
|
|
118
|
+
action: event.action,
|
|
119
|
+
bustToken,
|
|
120
|
+
id: event.id,
|
|
121
|
+
itineraryId: itineraryLessKinds.has(event.kind) ? null : event.itinerary_id,
|
|
122
|
+
kind: event.kind
|
|
123
|
+
});
|
|
124
|
+
var foldChange = (pending, next) => pending.action === "created" && next.action === "updated" ? { ...next, action: "created" } : next;
|
|
125
|
+
var dispatchContained = (bus, ctx, name, input) => {
|
|
126
|
+
try {
|
|
127
|
+
void Promise.resolve(bus.dispatchUnsafe(ctx, name, input)).catch(chunkWW4CGS7G_cjs.surfaceFault);
|
|
128
|
+
} catch (fault) {
|
|
129
|
+
chunkWW4CGS7G_cjs.surfaceFault(fault);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
var toEpochMs = (connectedAt) => {
|
|
133
|
+
const parsed = connectedAt?.getTime();
|
|
134
|
+
return parsed !== void 0 && !Number.isNaN(parsed) ? parsed : Date.now();
|
|
135
|
+
};
|
|
136
|
+
var isDurableChange = (event) => event.type === "itinerary.changed" || event.type === "segment.changed" || event.type === "waypoint.changed" || event.type === "zone.changed" || event.type === "collection.changed";
|
|
137
|
+
var sleep = (ms, signal) => new Promise((resolve) => {
|
|
138
|
+
if (signal.aborted) {
|
|
139
|
+
resolve();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const onAbort = () => {
|
|
143
|
+
clearTimeout(timer);
|
|
144
|
+
resolve();
|
|
145
|
+
};
|
|
146
|
+
const timer = setTimeout(() => {
|
|
147
|
+
signal.removeEventListener("abort", onAbort);
|
|
148
|
+
resolve();
|
|
149
|
+
}, ms);
|
|
150
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
151
|
+
});
|
|
152
|
+
var Coalescer = class {
|
|
153
|
+
constructor(delayMs, flush, fold = (_pending, next) => next) {
|
|
154
|
+
this.delayMs = delayMs;
|
|
155
|
+
this.flush = flush;
|
|
156
|
+
this.fold = fold;
|
|
157
|
+
}
|
|
158
|
+
delayMs;
|
|
159
|
+
flush;
|
|
160
|
+
fold;
|
|
161
|
+
pending = /* @__PURE__ */ new Map();
|
|
162
|
+
timers = /* @__PURE__ */ new Map();
|
|
163
|
+
/**
|
|
164
|
+
* push folds the value into the key's pending one and arms a single flush timer for it,
|
|
165
|
+
* so a continuing burst keeps folding into the value without resetting the window.
|
|
166
|
+
*/
|
|
167
|
+
push(key, value) {
|
|
168
|
+
const pending = this.pending.get(key);
|
|
169
|
+
this.pending.set(key, pending === void 0 ? value : this.fold(pending, value));
|
|
170
|
+
if (!this.timers.has(key)) {
|
|
171
|
+
this.timers.set(
|
|
172
|
+
key,
|
|
173
|
+
setTimeout(() => this.fire(key), this.delayMs)
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* cancel drops every armed timer and pending value, so a disposed session leaves
|
|
179
|
+
* no coalesced dispatch to fire after teardown.
|
|
180
|
+
*/
|
|
181
|
+
cancel() {
|
|
182
|
+
for (const timer of this.timers.values()) {
|
|
183
|
+
clearTimeout(timer);
|
|
184
|
+
}
|
|
185
|
+
this.timers.clear();
|
|
186
|
+
this.pending.clear();
|
|
187
|
+
}
|
|
188
|
+
fire(key) {
|
|
189
|
+
this.timers.delete(key);
|
|
190
|
+
const value = this.pending.get(key);
|
|
191
|
+
this.pending.delete(key);
|
|
192
|
+
if (value !== void 0) {
|
|
193
|
+
this.flush(value);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
var StreamLoop = class {
|
|
198
|
+
constructor(config) {
|
|
199
|
+
this.config = config;
|
|
200
|
+
}
|
|
201
|
+
config;
|
|
202
|
+
disposed = false;
|
|
203
|
+
// The last position the stream named, sent back as Last-Event-ID so a reconnect resumes
|
|
204
|
+
// after it rather than replaying the whole durable history. A frame advances it only as a
|
|
205
|
+
// durable change (consume gates on isDurableChange), so a spuriously-numbered ephemeral frame
|
|
206
|
+
// never moves it; a record that names a position and carries no frame moves it too, and an
|
|
207
|
+
// empty `id:` clears it.
|
|
208
|
+
lastEventId;
|
|
209
|
+
// Aborts a pending backoff wait on dispose so a torn-down loop never wakes to
|
|
210
|
+
// reconnect. Tripped once, by dispose().
|
|
211
|
+
lifecycle = new AbortController();
|
|
212
|
+
// Aborts the currently-open stream. Replaced each reconnect, tripped by dispose().
|
|
213
|
+
streamAbort = null;
|
|
214
|
+
// Unsubscribes from the open stream. The abort tears a live fetch down; this stops
|
|
215
|
+
// the callback delivery (and the scripted drain, which has no fetch). A settle
|
|
216
|
+
// inside consume clears it; dispose() calls it explicitly.
|
|
217
|
+
unsubscribe = null;
|
|
218
|
+
// Set by the first start(): the loop holds one stream's handles, so it runs once.
|
|
219
|
+
started = false;
|
|
220
|
+
/**
|
|
221
|
+
* start opens the stream and runs the reconnect loop until dispose(). The
|
|
222
|
+
* returned work is fire-and-forget: the loop reacts to frames through the
|
|
223
|
+
* configured onFrame and never resolves to the caller.
|
|
224
|
+
*
|
|
225
|
+
* A second call is a no-op, and so is one after dispose(). A second loop would overwrite the
|
|
226
|
+
* handles of the first, and dispose() would then release the second stream alone.
|
|
227
|
+
*/
|
|
228
|
+
start() {
|
|
229
|
+
if (this.started || this.disposed) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this.started = true;
|
|
233
|
+
void this.run();
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* dispose stops the loop and tears the open stream down: it aborts the lifecycle
|
|
237
|
+
* (waking any backoff wait), then aborts the open stream and unsubscribes so a
|
|
238
|
+
* parked read is released. Idempotent.
|
|
239
|
+
*/
|
|
240
|
+
dispose() {
|
|
241
|
+
if (this.disposed) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this.disposed = true;
|
|
245
|
+
this.lifecycle.abort();
|
|
246
|
+
this.teardownStream();
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* teardownStream releases the open stream from both sides: it captures the
|
|
250
|
+
* unsubscribe BEFORE aborting (the abort's settle nulls the field, so capturing
|
|
251
|
+
* first keeps the scripted drain's teardown reachable), aborts the live fetch,
|
|
252
|
+
* then unsubscribes. The release runs once whichever path reaches it first, the
|
|
253
|
+
* settle or this call. Idempotent.
|
|
254
|
+
*/
|
|
255
|
+
teardownStream() {
|
|
256
|
+
const unsubscribe = this.unsubscribe;
|
|
257
|
+
this.unsubscribe = null;
|
|
258
|
+
this.streamAbort?.abort();
|
|
259
|
+
unsubscribe?.();
|
|
260
|
+
}
|
|
261
|
+
async run() {
|
|
262
|
+
let failures = 0;
|
|
263
|
+
let named;
|
|
264
|
+
while (!this.disposed) {
|
|
265
|
+
if (failures > 0 || named !== void 0) {
|
|
266
|
+
const wait = named === void 0 ? chunkUYUBSD2V_cjs.reconnectDelayMs(failures, reconnectSchedule) : chunkUYUBSD2V_cjs.retryAfterDelayMs(named);
|
|
267
|
+
await sleep(wait, this.lifecycle.signal);
|
|
268
|
+
if (this.disposed) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
const abort = new AbortController();
|
|
273
|
+
this.streamAbort = abort;
|
|
274
|
+
const attempt = await this.consume(abort.signal);
|
|
275
|
+
if (this.disposed || abort.signal.aborted) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
if (attempt.terminal) {
|
|
279
|
+
this.dispose();
|
|
280
|
+
try {
|
|
281
|
+
this.config.onError?.(attempt.error);
|
|
282
|
+
} catch (fault) {
|
|
283
|
+
chunkWW4CGS7G_cjs.surfaceFault(fault);
|
|
284
|
+
}
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
failures = attempt.progressed || attempt.reconnect ? 0 : failures + 1;
|
|
288
|
+
named = attempt.waitMs;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* consume opens one read of the stream and resolves a {@link StreamAttempt}:
|
|
293
|
+
* whether it made progress (so run() chooses a prompt reconnect over a backoff)
|
|
294
|
+
* and whether it failed terminally (so run() stops the loop). It bridges the
|
|
295
|
+
* transport's callbacks to a single promise: onFrame records each DURABLE frame's
|
|
296
|
+
* id as the resume position and routes it; onClose and a transient onError settle
|
|
297
|
+
* the attempt for a reconnect, a close as `reconnect` marking it as the end of the stream's
|
|
298
|
+
* credential, a terminal onError settles it to stop the loop, and so does a
|
|
299
|
+
* subscribe that throws; a dispose abort settles it on its own since the transport fires no
|
|
300
|
+
* callback on a deliberate abort.
|
|
301
|
+
*
|
|
302
|
+
* However the attempt settles, its stream is released as it does, and its listener
|
|
303
|
+
* comes off the attempt's signal. A transport reports a failure through onError with
|
|
304
|
+
* nothing obliging it to have let its connection go first, and each attempt left
|
|
305
|
+
* holding one is a socket: on HTTP/1.1 six of them hold the whole per-origin pool,
|
|
306
|
+
* and every request beside them stalls.
|
|
307
|
+
*/
|
|
308
|
+
consume(signal) {
|
|
309
|
+
return new Promise((resolve) => {
|
|
310
|
+
let progressed = false;
|
|
311
|
+
let settled = false;
|
|
312
|
+
const opening = new Set(OPENING_SNAPSHOTS);
|
|
313
|
+
let member;
|
|
314
|
+
let handle;
|
|
315
|
+
const release = () => {
|
|
316
|
+
const pending = handle;
|
|
317
|
+
handle = void 0;
|
|
318
|
+
pending?.();
|
|
319
|
+
};
|
|
320
|
+
const finish = (failure, reconnect = false, waitMs) => {
|
|
321
|
+
if (settled) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
settled = true;
|
|
325
|
+
signal.removeEventListener("abort", onAbort);
|
|
326
|
+
if (this.unsubscribe === release) {
|
|
327
|
+
this.unsubscribe = null;
|
|
328
|
+
}
|
|
329
|
+
release();
|
|
330
|
+
resolve(
|
|
331
|
+
failure === void 0 ? { progressed, reconnect, terminal: false, waitMs } : { error: failure.error, progressed, terminal: true }
|
|
332
|
+
);
|
|
333
|
+
};
|
|
334
|
+
const onAbort = () => finish();
|
|
335
|
+
if (signal.aborted) {
|
|
336
|
+
finish();
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
340
|
+
const handlers = {
|
|
341
|
+
onClose: (reason) => finish(void 0, reason === "reconnect"),
|
|
342
|
+
// A transient error settles the attempt like a close: run() reopens at once after an
|
|
343
|
+
// attempt that made progress and after a wait otherwise. A terminal error settles it
|
|
344
|
+
// carrying the failure, so run() stops the loop and surfaces it. A transient stream
|
|
345
|
+
// drop is background noise the session recovers from silently.
|
|
346
|
+
onError: (error, options) => options?.terminal === true ? finish({ error }) : finish(void 0, false, chunkUYUBSD2V_cjs.retryAfterMsOf(error)),
|
|
347
|
+
onFrame: (frame) => {
|
|
348
|
+
if (settled) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
if (!opening.delete(frame.event.type) && !this.isOwnArrival(frame.event, member)) {
|
|
352
|
+
progressed = true;
|
|
353
|
+
}
|
|
354
|
+
if (frame.id && isDurableChange(frame.event)) {
|
|
355
|
+
this.lastEventId = frame.id;
|
|
356
|
+
}
|
|
357
|
+
try {
|
|
358
|
+
this.config.onFrame(frame.event, frame.id === "" ? void 0 : frame.id);
|
|
359
|
+
} catch {
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
// A record that names a position and carries no event moves the cursor too. No frame
|
|
363
|
+
// carries that position, so there is no event for the gate above to read, and none that
|
|
364
|
+
// could be an ephemeral one. A settled attempt's report is stale, like its frames.
|
|
365
|
+
onLastEventId: (lastEventId) => {
|
|
366
|
+
if (!settled) {
|
|
367
|
+
this.lastEventId = lastEventId;
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
onOpen: (open) => {
|
|
371
|
+
if (!settled) {
|
|
372
|
+
member = open.userId;
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
// A frame the transport skips, a kind this build does not know or data it cannot read, is
|
|
376
|
+
// none of those every open begins with, so the stream delivered something past them.
|
|
377
|
+
onSkippedFrame: () => {
|
|
378
|
+
if (!settled) {
|
|
379
|
+
progressed = true;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
this.config.onOpen?.();
|
|
384
|
+
try {
|
|
385
|
+
handle = this.config.subscribe(handlers, {
|
|
386
|
+
lastEventId: this.lastEventId,
|
|
387
|
+
signal
|
|
388
|
+
});
|
|
389
|
+
} catch (error) {
|
|
390
|
+
finish({ error });
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
if (settled) {
|
|
394
|
+
release();
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
this.unsubscribe = release;
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* isOwnArrival asks the session whether a frame is its own member's arrival
|
|
402
|
+
* ({@link StreamLoopConfig.isOwnArrival}), and reads an answer that throws as yes: a frame the
|
|
403
|
+
* session cannot attribute is no evidence that the stream stays up. Thrown on, the fault would
|
|
404
|
+
* reach the transport as the subscriber's own, which ends the stream for good, where the same
|
|
405
|
+
* fault met as the frame is applied loses that frame alone.
|
|
406
|
+
*/
|
|
407
|
+
isOwnArrival(event, member) {
|
|
408
|
+
try {
|
|
409
|
+
return this.config.isOwnArrival?.(event, member) === true;
|
|
410
|
+
} catch {
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
var CollabEngine = class {
|
|
416
|
+
constructor(config) {
|
|
417
|
+
this.config = config;
|
|
418
|
+
this.changeCoalescer = new Coalescer(
|
|
419
|
+
CHANGE_COALESCE_MS,
|
|
420
|
+
(input) => this.dispatch(this.config.tools.changeApply, input),
|
|
421
|
+
foldChange
|
|
422
|
+
);
|
|
423
|
+
this.selectionThrottle = new TrailingThrottle(SELECTION_THROTTLE_MS, (selection) => {
|
|
424
|
+
void this.postSignal({ selection, type: "selection" });
|
|
425
|
+
});
|
|
426
|
+
this.draftThrottle = new TrailingThrottle(
|
|
427
|
+
LIVE_SEGMENT_THROTTLE_MS,
|
|
428
|
+
({ draft, entity }) => (
|
|
429
|
+
// A draft is whatever the editing surface is holding mid-gesture (a GeoJSON geometry,
|
|
430
|
+
// a live segment), and the server relays it verbatim, so the contract spells it as an
|
|
431
|
+
// open JSON object. The assertion is where those two meet: every value passed here is
|
|
432
|
+
// one, and TypeScript refuses the assignment only because an interface carries no
|
|
433
|
+
// implicit index signature. Validating it would mean this package deciding what a draft
|
|
434
|
+
// may be, which is the one thing neither end of the relay knows.
|
|
435
|
+
this.postDraftUpdate({ draft, entity, type: "draft.update" })
|
|
436
|
+
)
|
|
437
|
+
);
|
|
438
|
+
this.loop = new StreamLoop({
|
|
439
|
+
// The member the stream is read as is the user its session token names, and the viewer's
|
|
440
|
+
// only where the client is not told that user: the API sends the join of the member the
|
|
441
|
+
// token names, whoever the viewer says is signed in.
|
|
442
|
+
isOwnArrival: (event, member) => event.type === "presence.join" && event.user_id === (member ?? this.config.ctx.viewer.getUserId()),
|
|
443
|
+
onError: (error) => this.config.onError?.(error),
|
|
444
|
+
onFrame: (event, frameId) => this.applyFrame(event, frameId),
|
|
445
|
+
onOpen: () => this.beginOpen(),
|
|
446
|
+
subscribe: (handlers, options) => this.config.transport.subscribeEditor(this.config.resource, handlers, options)
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
config;
|
|
450
|
+
changeCoalescer;
|
|
451
|
+
draftThrottle;
|
|
452
|
+
loop;
|
|
453
|
+
selectionThrottle;
|
|
454
|
+
// The draft updates sent and not yet answered. A clear leaves only once each has been, since
|
|
455
|
+
// two requests in flight at once are answered in whatever order the network delivers them.
|
|
456
|
+
draftUpdatesInFlight = /* @__PURE__ */ new Set();
|
|
457
|
+
// The last clear asked for, until it is answered, whether it is still waiting to leave or on
|
|
458
|
+
// the wire: a draft update sent after it waits for it in turn.
|
|
459
|
+
draftClearInFlight = null;
|
|
460
|
+
// Set by dispose(): a sender called after it is a no-op, and no draft update leaves after it,
|
|
461
|
+
// whenever it was sent.
|
|
462
|
+
disposed = false;
|
|
463
|
+
// Whether the latest edit signal to settle was refused for want of the write role, so a burst
|
|
464
|
+
// of refusals reports one loss: an accepted edit signal clears it.
|
|
465
|
+
editRefused = false;
|
|
466
|
+
// The locks this session holds, or has asked for and not yet been answered on, by lockKey.
|
|
467
|
+
heldLocks = /* @__PURE__ */ new Set();
|
|
468
|
+
// The locks this session gave back that no lock snapshot has yet settled, answered or not, by
|
|
469
|
+
// lockKey: a stream that re-stamps a lock after its release keeps it held, and a snapshot is
|
|
470
|
+
// where that shows. releaseLock says what settles one.
|
|
471
|
+
releasedLocks = /* @__PURE__ */ new Map();
|
|
472
|
+
// The locks a release is on the wire for, asked by releaseLock or by a retry, by lockKey.
|
|
473
|
+
releasesInFlight = /* @__PURE__ */ new Set();
|
|
474
|
+
// The locks a retry loop runs for, one loop per lock.
|
|
475
|
+
releaseRetries = /* @__PURE__ */ new Set();
|
|
476
|
+
// The `lock.acquired` frames this session's own acquires are still owed, by lockKey.
|
|
477
|
+
owedEchoes = /* @__PURE__ */ new Map();
|
|
478
|
+
// The watch over the stream's `lock.acquired` frames (ReleasedLock): minted at the first lock
|
|
479
|
+
// snapshot of each open, and null from the moment an open begins until that snapshot.
|
|
480
|
+
lockWatch = null;
|
|
481
|
+
// The last watch minted, so each is new.
|
|
482
|
+
lockWatches = 0;
|
|
483
|
+
// Aborted by dispose(), which wakes every release retry's wait so none outlives the session.
|
|
484
|
+
lifecycle = new AbortController();
|
|
485
|
+
/**
|
|
486
|
+
* start opens the editor stream and keeps it open until dispose(). One engine follows one
|
|
487
|
+
* stream: a second call, or one after dispose(), is a no-op.
|
|
488
|
+
*/
|
|
489
|
+
start() {
|
|
490
|
+
this.loop.start();
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* dispose tears the stream down and drops every pending coalesced or throttled send, so
|
|
494
|
+
* leaving the resource leaks no connection. No draft update leaves after it, one still waiting
|
|
495
|
+
* on a clear included.
|
|
496
|
+
*
|
|
497
|
+
* A clear asked for before dispose still leaves, once the draft updates sent before it are
|
|
498
|
+
* answered: a clear only removes a draft at peers, and dropping it would leave them the phantom
|
|
499
|
+
* draft {@link clearDraft} exists to prevent.
|
|
500
|
+
*
|
|
501
|
+
* {@link sendSelection}, {@link sendDraft} and {@link clearDraft} called
|
|
502
|
+
* after it send nothing and arm no timer: a signal sent then would announce a member who left.
|
|
503
|
+
*/
|
|
504
|
+
dispose() {
|
|
505
|
+
this.disposed = true;
|
|
506
|
+
this.lifecycle.abort();
|
|
507
|
+
this.loop.dispose();
|
|
508
|
+
this.changeCoalescer.cancel();
|
|
509
|
+
this.selectionThrottle.cancel();
|
|
510
|
+
this.draftThrottle.cancel();
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* sendSelection announces the local user's selection (or its clearing, with
|
|
514
|
+
* null), trailing-throttled so a rapid re-selection sends only the settled target. Nothing is
|
|
515
|
+
* sent while {@link CollabEngineConfig.canEdit} answers false when the selection is due.
|
|
516
|
+
*/
|
|
517
|
+
sendSelection(selection) {
|
|
518
|
+
if (this.disposed) {
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
this.selectionThrottle.push(selection);
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* sendDraft announces the local user's in-progress (uncommitted) geometry for an
|
|
525
|
+
* entity, trailing-throttled at the live-segment cadence so a peer's preview
|
|
526
|
+
* advances smoothly without flooding the endpoint. The throttle is single-slot: a
|
|
527
|
+
* second entity's draft pushed within the window would replace the first. That is
|
|
528
|
+
* correct only because the local user edits one entity at a time (the tool layer's
|
|
529
|
+
* `guardEditBegin` enforces the one-edit-at-a-time invariant), so a refactor that
|
|
530
|
+
* relaxed that mutual exclusion would have to key this throttle per entity.
|
|
531
|
+
*/
|
|
532
|
+
sendDraft(entity, draft) {
|
|
533
|
+
if (this.disposed) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
this.draftThrottle.push({ draft, entity });
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* clearDraft announces that the local user's live draft for an entity is gone (an
|
|
540
|
+
* edit committed or cancelled). It drops any draft update still parked in the
|
|
541
|
+
* throttle first, and leaves only once every draft update already sent has been
|
|
542
|
+
* answered, so a stale update can never land after the clear and resurrect a
|
|
543
|
+
* phantom draft for peers: one no later signal removes while its author stays
|
|
544
|
+
* connected. With nothing unanswered before it, it leaves at once.
|
|
545
|
+
*
|
|
546
|
+
* A draft update sent after the clear leaves only once the clear has been answered, whether
|
|
547
|
+
* the clear left at once or is still waiting, so the clear never wipes the draft of the edit
|
|
548
|
+
* after it. Best-effort, like the other transient senders: a draft signal that failed holds
|
|
549
|
+
* nothing back.
|
|
550
|
+
*/
|
|
551
|
+
clearDraft(entity) {
|
|
552
|
+
if (this.disposed) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
this.draftThrottle.cancel();
|
|
556
|
+
const signal = { entity, type: "draft.clear" };
|
|
557
|
+
const earlier = [...this.draftUpdatesInFlight];
|
|
558
|
+
if (this.draftClearInFlight !== null) {
|
|
559
|
+
earlier.push(this.draftClearInFlight);
|
|
560
|
+
}
|
|
561
|
+
const cleared = earlier.length === 0 ? this.postSignal(signal) : Promise.all(earlier).then(() => this.postSignal(signal));
|
|
562
|
+
this.draftClearInFlight = cleared;
|
|
563
|
+
void cleared.then(() => {
|
|
564
|
+
if (this.draftClearInFlight === cleared) {
|
|
565
|
+
this.draftClearInFlight = null;
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* acquireLock asks the API to grant the local user the entity's soft-lock. It
|
|
571
|
+
* resolves acquired when the lock is the local user's to take, and not-acquired
|
|
572
|
+
* (carrying the id of the peer holding it, when the 409 named one) on a genuine
|
|
573
|
+
* contention.
|
|
574
|
+
*
|
|
575
|
+
* It REJECTS on anything else, and that is the whole point. Swallowing the throw
|
|
576
|
+
* into `{ acquired: false }` would collapse unrelated outcomes onto one answer: a
|
|
577
|
+
* 400 on a malformed or unauthenticated write, a 403, a 404, a 500, a 504, and a
|
|
578
|
+
* dropped socket would all arrive as "not acquired, no holder", which the caller can
|
|
579
|
+
* only report as contention: a lone editor told that somebody else is editing their
|
|
580
|
+
* itinerary, and on the add-segment path (where the lock is taken on a uuid minted a
|
|
581
|
+
* microsecond earlier) a sentence that can never be true.
|
|
582
|
+
* A failure that names itself is a failure somebody can fix; a failure disguised as
|
|
583
|
+
* a peer is one nobody can even look for.
|
|
584
|
+
*
|
|
585
|
+
* A rejection that settles nothing (no answer came, or the server failed: a 5xx, a 408, a 429)
|
|
586
|
+
* may still have left the lock taken, since the API can take a lock and lose its answer. Nobody
|
|
587
|
+
* edits under it, so the session gives it back in the background as it gives back a lock whose
|
|
588
|
+
* release failed ({@link releaseLock}), and the caller hears the rejection all the same.
|
|
589
|
+
*
|
|
590
|
+
* @throws {MountayaElementsForbiddenError} Before anything is sent, while
|
|
591
|
+
* {@link CollabEngineConfig.canEdit} answers false: the API refuses every signal of a member
|
|
592
|
+
* who only watches with a 403, which this stands in for.
|
|
593
|
+
*/
|
|
594
|
+
async acquireLock(entity) {
|
|
595
|
+
if (!this.maySignal()) {
|
|
596
|
+
throw new chunkISLB6Y5Q_cjs.MountayaElementsForbiddenError(
|
|
597
|
+
`CollabEngine.acquireLock: the local user holds no write role on ${this.config.resource.kind} ${this.config.resource.id}, as canEdit answers, so no lock on ${entity.kind} ${entity.id} is asked for: the API refuses every signal of a member who only watches. Begin an edit only where canEdit answers true, and read the member's roles again where it should.`
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
const key = lockKey(entity);
|
|
601
|
+
const givenBack = this.releasedLocks.get(key);
|
|
602
|
+
this.heldLocks.add(key);
|
|
603
|
+
this.releasedLocks.delete(key);
|
|
604
|
+
this.oweEcho(key);
|
|
605
|
+
let result;
|
|
606
|
+
try {
|
|
607
|
+
result = await this.sendEditSignal({ entity, type: "lock.acquire" });
|
|
608
|
+
} catch (error) {
|
|
609
|
+
this.heldLocks.delete(key);
|
|
610
|
+
const unsettled = unsettledFailure(error);
|
|
611
|
+
this.answerEcho(key, unsettled);
|
|
612
|
+
const record = givenBack ?? (unsettled ? { entity, watch: null } : void 0);
|
|
613
|
+
if (record !== void 0 && !this.releasedLocks.has(key)) {
|
|
614
|
+
this.releasedLocks.set(key, record);
|
|
615
|
+
this.retryRelease(key, entity, false, chunkUYUBSD2V_cjs.retryAfterMsOf(error));
|
|
616
|
+
}
|
|
617
|
+
throw error;
|
|
618
|
+
}
|
|
619
|
+
this.answerEcho(key, result.ok);
|
|
620
|
+
if (result.ok) {
|
|
621
|
+
return { acquired: true };
|
|
622
|
+
}
|
|
623
|
+
this.heldLocks.delete(key);
|
|
624
|
+
return result.holderId === void 0 ? { acquired: false } : { acquired: false, holderId: result.holderId };
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* releaseLock relinquishes the local user's soft-lock on an entity. Unlike the
|
|
628
|
+
* best-effort transient senders it surfaces a failure (it rejects), so a caller can react. While
|
|
629
|
+
* {@link CollabEngineConfig.canEdit} answers false it sends nothing and resolves: a member who
|
|
630
|
+
* only watches holds no lock to give back.
|
|
631
|
+
*
|
|
632
|
+
* No TTL frees a lock whose release failed: the editor stream keeps every lock its member holds
|
|
633
|
+
* alive for as long as it stays open. So a release that finds no answer or meets a fault of the
|
|
634
|
+
* server's (a 5xx, a 408, a 429, a dropped socket) is asked again in the background, after a wait
|
|
635
|
+
* that doubles from one second to thirty, or after the wait a 429 or a 503 named, for as long as
|
|
636
|
+
* the session lives and the entity is not armed again by {@link acquireLock}. A caller that
|
|
637
|
+
* repeats a release that rejected asks for it twice: the session is already asking. A refusal no
|
|
638
|
+
* repeat changes (a 403, a 404) forgets it at once. A 409 never rejects: the client's transport
|
|
639
|
+
* answers it as a result, so the release resolves and the lock is kept until a snapshot settles
|
|
640
|
+
* it.
|
|
641
|
+
*
|
|
642
|
+
* Each `lock.snapshot` reconciles the locks this session gave back. One it does not list is
|
|
643
|
+
* forgotten, and a retry still waiting for it stops. One it still lists while a retry waits is
|
|
644
|
+
* left to that retry, which the snapshot wakes no sooner. One it still lists after its release
|
|
645
|
+
* was answered is asked for again at once, where the stream has been read without a break since
|
|
646
|
+
* that release left: the stream re-stamps a lock its member holds on a clock of its own, and a
|
|
647
|
+
* re-stamp that crossed the release is what the snapshot shows.
|
|
648
|
+
*
|
|
649
|
+
* A snapshot names the member and not the connection, so a lock the member holds from another
|
|
650
|
+
* tab is told apart only by that tab's `lock.acquired`, which the stream carries and never
|
|
651
|
+
* replays. A lock this session never took is left alone. One it gave back and another tab took
|
|
652
|
+
* since is forgotten on that frame, and nothing more is asked for it. Where the stream broke
|
|
653
|
+
* between the release and the snapshot (a credential's end, a drop), the frame may have come
|
|
654
|
+
* while no read was open: a lock whose release was answered is then forgotten at the snapshot,
|
|
655
|
+
* whatever it lists, which leaves a re-stamp that crossed that release held. A release that
|
|
656
|
+
* failed is asked for across a break all the same, so a tab that took the lock during it loses
|
|
657
|
+
* it: its acquire refreshed a lock the release never let go of, and no answer the API gives can
|
|
658
|
+
* tell the two tabs apart.
|
|
659
|
+
*/
|
|
660
|
+
async releaseLock(entity) {
|
|
661
|
+
const key = lockKey(entity);
|
|
662
|
+
this.heldLocks.delete(key);
|
|
663
|
+
if (!this.maySignal()) {
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
const record = { entity, watch: this.lockWatch };
|
|
667
|
+
this.releasedLocks.set(key, record);
|
|
668
|
+
this.releasesInFlight.add(key);
|
|
669
|
+
try {
|
|
670
|
+
await this.sendEditSignal({ entity, type: "lock.release" });
|
|
671
|
+
} catch (error) {
|
|
672
|
+
if (unsettledFailure(error)) {
|
|
673
|
+
this.retryRelease(key, entity, false, chunkUYUBSD2V_cjs.retryAfterMsOf(error));
|
|
674
|
+
} else if (this.releasedLocks.get(key) === record) {
|
|
675
|
+
this.releasedLocks.delete(key);
|
|
676
|
+
}
|
|
677
|
+
throw error;
|
|
678
|
+
} finally {
|
|
679
|
+
this.releasesInFlight.delete(key);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* stillToRelease reports whether a lock this session gave back may still be asked for: the
|
|
684
|
+
* session lives, no snapshot has settled it, the entity was not armed again, and the member may
|
|
685
|
+
* still signal.
|
|
686
|
+
*/
|
|
687
|
+
stillToRelease(key) {
|
|
688
|
+
return !this.disposed && this.releasedLocks.has(key) && !this.heldLocks.has(key) && this.maySignal();
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* retryRelease asks again, in the background, for the release of a lock this session gave back,
|
|
692
|
+
* one loop per lock: at once where `immediate` (a snapshot that still lists it), after the wait
|
|
693
|
+
* a 429 or a 503 named where `namedMs` carries one, and after the release schedule's wait
|
|
694
|
+
* otherwise. The loop ends on an answer, which leaves the lock remembered for the next snapshot
|
|
695
|
+
* to settle, on a refusal no repeat can change, which forgets it, and as soon as
|
|
696
|
+
* {@link stillToRelease} answers false.
|
|
697
|
+
*/
|
|
698
|
+
retryRelease(key, entity, immediate = false, namedMs) {
|
|
699
|
+
if (this.releaseRetries.has(key) || !this.stillToRelease(key)) {
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
this.releaseRetries.add(key);
|
|
703
|
+
void this.runReleaseRetries(key, entity, immediate ? 0 : 1, namedMs).finally(() => {
|
|
704
|
+
this.releaseRetries.delete(key);
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
async runReleaseRetries(key, entity, failed, namedMs) {
|
|
708
|
+
let failures = failed;
|
|
709
|
+
let named = namedMs;
|
|
710
|
+
while (this.stillToRelease(key)) {
|
|
711
|
+
if (failures > 0) {
|
|
712
|
+
const wait = named === void 0 ? chunkUYUBSD2V_cjs.reconnectDelayMs(failures, releaseRetrySchedule) : chunkUYUBSD2V_cjs.retryAfterDelayMs(named);
|
|
713
|
+
await sleep(wait, this.lifecycle.signal);
|
|
714
|
+
if (!this.stillToRelease(key)) {
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
const record = this.releasedLocks.get(key);
|
|
719
|
+
if (record !== void 0) {
|
|
720
|
+
record.watch = this.lockWatch;
|
|
721
|
+
}
|
|
722
|
+
this.releasesInFlight.add(key);
|
|
723
|
+
try {
|
|
724
|
+
await this.sendEditSignal({ entity, type: "lock.release" });
|
|
725
|
+
} catch (error) {
|
|
726
|
+
if (!unsettledFailure(error)) {
|
|
727
|
+
if (this.releasedLocks.get(key) === record) {
|
|
728
|
+
this.releasedLocks.delete(key);
|
|
729
|
+
}
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
failures += 1;
|
|
733
|
+
named = chunkUYUBSD2V_cjs.retryAfterMsOf(error);
|
|
734
|
+
continue;
|
|
735
|
+
} finally {
|
|
736
|
+
this.releasesInFlight.delete(key);
|
|
737
|
+
}
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* reconcileReleasedLocks reads a lock snapshot against the locks this session gave back, as
|
|
743
|
+
* {@link releaseLock} states: a release on the wire is left to its answer, which the snapshot may
|
|
744
|
+
* predate; a lock it does not list is forgotten; a lock it lists is left to a retry still
|
|
745
|
+
* waiting for it, asked for again at once where its answered release left under the watch the
|
|
746
|
+
* session still keeps, and forgotten where it did not.
|
|
747
|
+
*/
|
|
748
|
+
reconcileReleasedLocks(locks) {
|
|
749
|
+
if (this.releasedLocks.size === 0) {
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
const listed = new Set(
|
|
753
|
+
locks.filter((lock) => this.isSelf(lock.user_id)).map((lock) => lockKey(lock.entity))
|
|
754
|
+
);
|
|
755
|
+
for (const [key, record] of [...this.releasedLocks]) {
|
|
756
|
+
if (this.releasesInFlight.has(key)) {
|
|
757
|
+
continue;
|
|
758
|
+
}
|
|
759
|
+
if (!listed.has(key)) {
|
|
760
|
+
this.releasedLocks.delete(key);
|
|
761
|
+
continue;
|
|
762
|
+
}
|
|
763
|
+
if (this.releaseRetries.has(key)) {
|
|
764
|
+
continue;
|
|
765
|
+
}
|
|
766
|
+
if (record.watch !== null && record.watch === this.lockWatch) {
|
|
767
|
+
this.retryRelease(key, record.entity, true);
|
|
768
|
+
} else {
|
|
769
|
+
this.releasedLocks.delete(key);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* readOwnLockAcquired reads a `lock.acquired` the stream stamps with the local member. While one
|
|
775
|
+
* of this session's own acquires of the entity is owed a frame ({@link OwedEcho}), the frame is
|
|
776
|
+
* that acquire's and pays the debt. Otherwise it is another of the member's connections taking
|
|
777
|
+
* the lock (a second tab). A lock this session gave back and that connection took is that
|
|
778
|
+
* connection's edit now, and the API releases a lock by member and never by connection, so it is
|
|
779
|
+
* forgotten: no snapshot that lists it and no retry still waiting asks for its release again,
|
|
780
|
+
* which would end that tab's edit. A release already on the wire is left to settle, and nothing
|
|
781
|
+
* follows it.
|
|
782
|
+
*/
|
|
783
|
+
readOwnLockAcquired(entity) {
|
|
784
|
+
const key = lockKey(entity);
|
|
785
|
+
const owed = this.owedEchoes.get(key);
|
|
786
|
+
if (owed !== void 0 && owed.frames > 0) {
|
|
787
|
+
owed.frames -= 1;
|
|
788
|
+
this.dropPaidEcho(key, owed);
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
this.releasedLocks.delete(key);
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* oweEcho records that an acquire of the entity is on its way, and owes the frame its grant
|
|
795
|
+
* would stamp ({@link OwedEcho}).
|
|
796
|
+
*/
|
|
797
|
+
oweEcho(key) {
|
|
798
|
+
const owed = this.owedEchoes.get(key) ?? { asking: 0, frames: 0, snapshots: 0 };
|
|
799
|
+
owed.asking += 1;
|
|
800
|
+
owed.frames += 1;
|
|
801
|
+
owed.snapshots = 0;
|
|
802
|
+
this.owedEchoes.set(key, owed);
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* answerEcho records that an acquire of the entity was answered, and pays the frame it owed
|
|
806
|
+
* unless the API may have granted it (`granted`: an acceptance, or a failure that settled
|
|
807
|
+
* nothing).
|
|
808
|
+
*/
|
|
809
|
+
answerEcho(key, granted) {
|
|
810
|
+
const owed = this.owedEchoes.get(key);
|
|
811
|
+
if (owed === void 0) {
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
owed.asking = Math.max(0, owed.asking - 1);
|
|
815
|
+
if (!granted) {
|
|
816
|
+
owed.frames = Math.max(0, owed.frames - 1);
|
|
817
|
+
}
|
|
818
|
+
this.dropPaidEcho(key, owed);
|
|
819
|
+
}
|
|
820
|
+
/** dropPaidEcho forgets a debt that owes no frame and waits on no acquire. */
|
|
821
|
+
dropPaidEcho(key, owed) {
|
|
822
|
+
if (owed.frames === 0 && owed.asking === 0) {
|
|
823
|
+
this.owedEchoes.delete(key);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* ageOwedEchoes counts one lock snapshot against every debt whose lock the session neither holds
|
|
828
|
+
* nor asks for, and forgets each once its count reaches {@link OWED_ECHO_SNAPSHOTS}. A lock held
|
|
829
|
+
* or asked for starts its count again.
|
|
830
|
+
*/
|
|
831
|
+
ageOwedEchoes() {
|
|
832
|
+
for (const [key, owed] of [...this.owedEchoes]) {
|
|
833
|
+
if (this.heldLocks.has(key) || owed.asking > 0) {
|
|
834
|
+
owed.snapshots = 0;
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
owed.snapshots += 1;
|
|
838
|
+
if (owed.snapshots >= OWED_ECHO_SNAPSHOTS) {
|
|
839
|
+
this.owedEchoes.delete(key);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* beginOpen runs as each open of the stream begins: the watch over the member's `lock.acquired`
|
|
845
|
+
* frames ends, since the frames sent until the new read opens are never delivered, and every
|
|
846
|
+
* debt goes but those of the acquires still on the wire, whose frames may yet come to it.
|
|
847
|
+
*/
|
|
848
|
+
beginOpen() {
|
|
849
|
+
this.lockWatch = null;
|
|
850
|
+
for (const [key, owed] of [...this.owedEchoes]) {
|
|
851
|
+
owed.frames = Math.min(owed.frames, owed.asking);
|
|
852
|
+
owed.snapshots = 0;
|
|
853
|
+
this.dropPaidEcho(key, owed);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* maySignal reports whether the local user may send a signal now, as the host's
|
|
858
|
+
* {@link CollabEngineConfig.canEdit} answers it: every signal where the host states no answer,
|
|
859
|
+
* and none where its answer throws, whose fault reaches the program on a microtask.
|
|
860
|
+
*/
|
|
861
|
+
maySignal() {
|
|
862
|
+
const canEdit = this.config.canEdit;
|
|
863
|
+
if (canEdit === void 0) {
|
|
864
|
+
return true;
|
|
865
|
+
}
|
|
866
|
+
try {
|
|
867
|
+
return canEdit() === true;
|
|
868
|
+
} catch (fault) {
|
|
869
|
+
chunkWW4CGS7G_cjs.surfaceFault(fault);
|
|
870
|
+
return false;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* sendEditSignal sends one of the local user's edit signals (a lock or a draft) and reads its
|
|
875
|
+
* outcome for the write role: an answer clears the refusal latch, a contention included, since
|
|
876
|
+
* the API judges a contention only for a member it lets edit, and a 403 is reported through
|
|
877
|
+
* {@link CollabEngineConfig.onEditRefused}. The outcome is handed back as it came, a rejection
|
|
878
|
+
* included.
|
|
879
|
+
*/
|
|
880
|
+
async sendEditSignal(signal) {
|
|
881
|
+
try {
|
|
882
|
+
const result = await this.config.transport.sendSignal(this.config.resource, signal);
|
|
883
|
+
this.editRefused = false;
|
|
884
|
+
return result;
|
|
885
|
+
} catch (error) {
|
|
886
|
+
if (chunkUYUBSD2V_cjs.statusOf(error) === 403) {
|
|
887
|
+
this.reportEditRefused(error, signal.entity);
|
|
888
|
+
}
|
|
889
|
+
throw error;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* reportEditRefused tells the host that an edit signal was refused for want of the write role,
|
|
894
|
+
* once for a run of refusals. A session the host disposed reports nothing: the edit it would
|
|
895
|
+
* close is gone with it.
|
|
896
|
+
*/
|
|
897
|
+
reportEditRefused(error, entity) {
|
|
898
|
+
if (this.editRefused || this.disposed) {
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
this.editRefused = true;
|
|
902
|
+
try {
|
|
903
|
+
this.config.onEditRefused?.(error, entity);
|
|
904
|
+
} catch (fault) {
|
|
905
|
+
chunkWW4CGS7G_cjs.surfaceFault(fault);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* applyFrame routes one received editor frame to a LOCAL tool dispatch. A durable
|
|
910
|
+
* change is coalesced per entity and reconciled through change.apply (never
|
|
911
|
+
* actor-filtered: a second tab of the SAME user must reconcile too). An ephemeral
|
|
912
|
+
* frame is dropped when it echoes the local user's own signal, and otherwise
|
|
913
|
+
* reflects a peer's transient state through the matching peer tool. An unknown
|
|
914
|
+
* frame type never reaches here: the transport drops it at decode.
|
|
915
|
+
*
|
|
916
|
+
* Each family has its own method: a durable change here, a snapshot in
|
|
917
|
+
* {@link applySnapshot}, and every other frame in {@link applyPeerFrame}, whose parameter is
|
|
918
|
+
* stated by exclusion so that a kind the contract gains has to be given an arm there.
|
|
919
|
+
*/
|
|
920
|
+
applyFrame(event, frameId) {
|
|
921
|
+
if (isDurableChange(event)) {
|
|
922
|
+
this.changeCoalescer.push(`${event.kind}:${event.id}`, changeApplyInput(event, frameId));
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
if (event.type === "presence.snapshot" || event.type === "lock.snapshot") {
|
|
926
|
+
this.applySnapshot(event);
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
if (event.type === "reconnect") {
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
this.applyPeerFrame(event);
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* applySnapshot applies a frame that states a whole set at once, the roster or the held locks,
|
|
936
|
+
* with the local user's own entries left out. The frame is applied whoever is in it: it
|
|
937
|
+
* replaces what the local side holds.
|
|
938
|
+
*/
|
|
939
|
+
applySnapshot(event) {
|
|
940
|
+
if (event.type === "presence.snapshot") {
|
|
941
|
+
const peers = event.members.filter((member) => !this.isSelf(member.user_id)).map((member) => ({
|
|
942
|
+
connectedAt: toEpochMs(member.connected_at),
|
|
943
|
+
userId: member.user_id
|
|
944
|
+
}));
|
|
945
|
+
this.dispatch(this.config.tools.presenceSnapshot, {
|
|
946
|
+
peers,
|
|
947
|
+
resource: this.config.resource
|
|
948
|
+
});
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
this.reconcileReleasedLocks(event.locks);
|
|
952
|
+
this.ageOwedEchoes();
|
|
953
|
+
if (this.lockWatch === null) {
|
|
954
|
+
this.lockWatches += 1;
|
|
955
|
+
this.lockWatch = this.lockWatches;
|
|
956
|
+
}
|
|
957
|
+
const locks = event.locks.filter((lock) => !this.isSelf(lock.user_id)).map((lock) => ({
|
|
958
|
+
id: lock.entity.id,
|
|
959
|
+
kind: lock.entity.kind,
|
|
960
|
+
userId: lock.user_id
|
|
961
|
+
}));
|
|
962
|
+
this.dispatch(this.config.tools.lockSnapshot, { locks, resource: this.config.resource });
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* applyPeerFrame reflects one member's transient state through the matching peer tool, and
|
|
966
|
+
* drops the frame when it echoes the local user's own signal. A `lock.acquired` of the local
|
|
967
|
+
* member is read before it is dropped, by {@link readOwnLockAcquired}.
|
|
968
|
+
*/
|
|
969
|
+
applyPeerFrame(event) {
|
|
970
|
+
if (this.isSelf(event.user_id)) {
|
|
971
|
+
if (event.type === "lock.acquired") {
|
|
972
|
+
this.readOwnLockAcquired(event.entity);
|
|
973
|
+
}
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
switch (event.type) {
|
|
977
|
+
case "presence.join":
|
|
978
|
+
this.dispatch(this.config.tools.presenceSet, {
|
|
979
|
+
connectedAt: toEpochMs(event.connected_at),
|
|
980
|
+
resource: this.config.resource,
|
|
981
|
+
userId: event.user_id
|
|
982
|
+
});
|
|
983
|
+
return;
|
|
984
|
+
case "presence.leave":
|
|
985
|
+
this.dispatch(this.config.tools.presenceClear, {
|
|
986
|
+
resource: this.config.resource,
|
|
987
|
+
userId: event.user_id
|
|
988
|
+
});
|
|
989
|
+
return;
|
|
990
|
+
case "selection":
|
|
991
|
+
this.dispatch(this.config.tools.peerSelectionSet, {
|
|
992
|
+
resource: this.config.resource,
|
|
993
|
+
selection: event.selection,
|
|
994
|
+
userId: event.user_id
|
|
995
|
+
});
|
|
996
|
+
return;
|
|
997
|
+
case "cursor":
|
|
998
|
+
return;
|
|
999
|
+
case "lock.acquired":
|
|
1000
|
+
this.dispatch(this.config.tools.lockSet, {
|
|
1001
|
+
id: event.entity.id,
|
|
1002
|
+
kind: event.entity.kind,
|
|
1003
|
+
resource: this.config.resource,
|
|
1004
|
+
userId: event.user_id
|
|
1005
|
+
});
|
|
1006
|
+
return;
|
|
1007
|
+
case "lock.released":
|
|
1008
|
+
this.dispatch(this.config.tools.lockClear, {
|
|
1009
|
+
id: event.entity.id,
|
|
1010
|
+
kind: event.entity.kind,
|
|
1011
|
+
resource: this.config.resource
|
|
1012
|
+
});
|
|
1013
|
+
return;
|
|
1014
|
+
case "draft.update":
|
|
1015
|
+
this.dispatch(
|
|
1016
|
+
this.config.tools.peerDraftSet,
|
|
1017
|
+
event.entity.kind === "zone" ? {
|
|
1018
|
+
id: event.entity.id,
|
|
1019
|
+
kind: "zone",
|
|
1020
|
+
resource: this.config.resource,
|
|
1021
|
+
userId: event.user_id,
|
|
1022
|
+
zone: event.draft
|
|
1023
|
+
} : {
|
|
1024
|
+
id: event.entity.id,
|
|
1025
|
+
kind: "segment",
|
|
1026
|
+
resource: this.config.resource,
|
|
1027
|
+
segment: event.draft,
|
|
1028
|
+
userId: event.user_id
|
|
1029
|
+
}
|
|
1030
|
+
);
|
|
1031
|
+
return;
|
|
1032
|
+
case "draft.clear":
|
|
1033
|
+
this.dispatch(this.config.tools.peerDraftClear, {
|
|
1034
|
+
id: event.entity.id,
|
|
1035
|
+
kind: event.entity.kind,
|
|
1036
|
+
resource: this.config.resource
|
|
1037
|
+
});
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* isSelf reports whether a frame's user id is the local user's, read live off the
|
|
1043
|
+
* viewer seam so a session built before the viewer hydrates self-filters correctly
|
|
1044
|
+
* once it does.
|
|
1045
|
+
*/
|
|
1046
|
+
isSelf(userId) {
|
|
1047
|
+
return userId === this.config.ctx.viewer.getUserId();
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* dispatch applies a received frame by running a LOCAL tool through the bus, without waiting
|
|
1051
|
+
* and whatever the dispatcher does with it ({@link dispatchContained}).
|
|
1052
|
+
*/
|
|
1053
|
+
dispatch(name, input) {
|
|
1054
|
+
dispatchContained(this.config.bus, this.config.ctx, name, input);
|
|
1055
|
+
}
|
|
1056
|
+
/**
|
|
1057
|
+
* postSignal sends one upstream signal, best-effort: a failed send is swallowed
|
|
1058
|
+
* rather than surfaced, because presence, selection and draft self-heal on the next
|
|
1059
|
+
* movement and a dropped frame is not worth interrupting the user for. It resolves
|
|
1060
|
+
* once the signal has been answered, either way, and never rejects or throws: a
|
|
1061
|
+
* draft signal chained behind it must leave whatever became of this one.
|
|
1062
|
+
*
|
|
1063
|
+
* Nothing is sent while {@link CollabEngineConfig.canEdit} answers false, since the API refuses
|
|
1064
|
+
* every signal of a member who only watches. The swallow stays for the role that changes
|
|
1065
|
+
* between that answer and the API's: a signal on its way when the write role went is refused
|
|
1066
|
+
* and dropped. A draft signal is an edit signal, so a 403 refusing one still reaches the host
|
|
1067
|
+
* through {@link CollabEngineConfig.onEditRefused}: the user lost the write role, which no next
|
|
1068
|
+
* movement heals.
|
|
1069
|
+
*/
|
|
1070
|
+
postSignal(signal) {
|
|
1071
|
+
if (!this.maySignal()) {
|
|
1072
|
+
return Promise.resolve();
|
|
1073
|
+
}
|
|
1074
|
+
try {
|
|
1075
|
+
const sent = signal.type === "draft.update" || signal.type === "draft.clear" ? this.sendEditSignal(signal) : this.config.transport.sendSignal(this.config.resource, signal);
|
|
1076
|
+
return sent.then(
|
|
1077
|
+
() => void 0,
|
|
1078
|
+
() => void 0
|
|
1079
|
+
);
|
|
1080
|
+
} catch {
|
|
1081
|
+
return Promise.resolve();
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* postDraftUpdate sends one draft update, once the last clear has been answered when one has
|
|
1086
|
+
* not been ({@link clearDraft}), and records it as on the wire until it is answered. An update
|
|
1087
|
+
* whose turn comes after dispose() is dropped.
|
|
1088
|
+
*/
|
|
1089
|
+
postDraftUpdate(signal) {
|
|
1090
|
+
const send = () => this.disposed ? Promise.resolve() : this.postSignal(signal);
|
|
1091
|
+
const pendingClear = this.draftClearInFlight;
|
|
1092
|
+
const sent = pendingClear === null ? send() : pendingClear.then(send);
|
|
1093
|
+
this.draftUpdatesInFlight.add(sent);
|
|
1094
|
+
void sent.then(() => {
|
|
1095
|
+
this.draftUpdatesInFlight.delete(sent);
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
var CollabListEngine = class {
|
|
1100
|
+
constructor(config) {
|
|
1101
|
+
this.config = config;
|
|
1102
|
+
this.changeCoalescer = new Coalescer(
|
|
1103
|
+
CHANGE_COALESCE_MS,
|
|
1104
|
+
(input) => this.dispatch(this.config.tools.changeApply, input),
|
|
1105
|
+
foldChange
|
|
1106
|
+
);
|
|
1107
|
+
this.listCoalescer = new Coalescer(
|
|
1108
|
+
CHANGE_COALESCE_MS,
|
|
1109
|
+
() => this.dispatch(this.config.tools.listApply, {})
|
|
1110
|
+
);
|
|
1111
|
+
this.loop = new StreamLoop({
|
|
1112
|
+
onError: (error) => this.config.onError?.(error),
|
|
1113
|
+
onFrame: (event, frameId) => this.applyFrame(event, frameId),
|
|
1114
|
+
subscribe: (handlers, options) => this.config.transport.subscribeList(this.config.organizationId, handlers, options)
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
config;
|
|
1118
|
+
changeCoalescer;
|
|
1119
|
+
listCoalescer;
|
|
1120
|
+
loop;
|
|
1121
|
+
/**
|
|
1122
|
+
* start opens the org list stream and keeps it open until dispose(). One engine follows one
|
|
1123
|
+
* stream: a second call, or one after dispose(), is a no-op.
|
|
1124
|
+
*/
|
|
1125
|
+
start() {
|
|
1126
|
+
this.loop.start();
|
|
1127
|
+
}
|
|
1128
|
+
/** dispose tears the stream down and drops every pending coalesced dispatch. */
|
|
1129
|
+
dispose() {
|
|
1130
|
+
this.loop.dispose();
|
|
1131
|
+
this.changeCoalescer.cancel();
|
|
1132
|
+
this.listCoalescer.cancel();
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* applyFrame routes one received list frame. Only durable changes ride this stream
|
|
1136
|
+
* (it carries no ephemeral peer state), so a non-durable frame is ignored. An
|
|
1137
|
+
* itinerary change coalesces into one grouped-listing invalidation; any other
|
|
1138
|
+
* durable change (a zone, a collection) reconciles through change.apply.
|
|
1139
|
+
*/
|
|
1140
|
+
applyFrame(event, frameId) {
|
|
1141
|
+
if (!isDurableChange(event)) {
|
|
1142
|
+
return;
|
|
1143
|
+
}
|
|
1144
|
+
if (event.kind === "itinerary") {
|
|
1145
|
+
this.listCoalescer.push("list", {});
|
|
1146
|
+
return;
|
|
1147
|
+
}
|
|
1148
|
+
this.changeCoalescer.push(`${event.kind}:${event.id}`, changeApplyInput(event, frameId));
|
|
1149
|
+
}
|
|
1150
|
+
/** dispatch runs one local tool through the bus, as {@link CollabEngine} does. */
|
|
1151
|
+
dispatch(name, input) {
|
|
1152
|
+
dispatchContained(this.config.bus, this.config.ctx, name, input);
|
|
1153
|
+
}
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1156
|
+
// src/collab/rules/dispatch.ts
|
|
1157
|
+
var COLLAB_RESOURCE_KINDS = ["itineraries", "zones"];
|
|
1158
|
+
|
|
1159
|
+
// src/collab/rules/peerNames.ts
|
|
1160
|
+
var emailLocalPart = (email) => {
|
|
1161
|
+
const at = email.indexOf("@");
|
|
1162
|
+
return at === -1 ? email : email.slice(0, at);
|
|
1163
|
+
};
|
|
1164
|
+
var peerLabelSegmentSplit = /[^a-zA-Z0-9]+/;
|
|
1165
|
+
var peerLabelNonAlnum = /[^a-zA-Z0-9]/g;
|
|
1166
|
+
var peerDraftInitials = (userId) => {
|
|
1167
|
+
const initials = userId.split(peerLabelSegmentSplit).filter(Boolean).slice(0, 2).map((segment) => segment.charAt(0)).join("");
|
|
1168
|
+
const source = initials.length >= 2 ? initials : userId.replace(peerLabelNonAlnum, "");
|
|
1169
|
+
return source.slice(0, 2).toUpperCase() || "?";
|
|
1170
|
+
};
|
|
1171
|
+
|
|
1172
|
+
// src/collab/rules/scriptedTransport.ts
|
|
1173
|
+
var resourceKey = (resource) => `${resource.kind}/${resource.id}`;
|
|
1174
|
+
var createScriptedStream = () => {
|
|
1175
|
+
const buffer = [];
|
|
1176
|
+
let closed = false;
|
|
1177
|
+
let wake = null;
|
|
1178
|
+
const bump = () => {
|
|
1179
|
+
const resume = wake;
|
|
1180
|
+
wake = null;
|
|
1181
|
+
resume?.();
|
|
1182
|
+
};
|
|
1183
|
+
return {
|
|
1184
|
+
close: () => {
|
|
1185
|
+
closed = true;
|
|
1186
|
+
bump();
|
|
1187
|
+
},
|
|
1188
|
+
push: (frames) => {
|
|
1189
|
+
buffer.push(...frames);
|
|
1190
|
+
bump();
|
|
1191
|
+
},
|
|
1192
|
+
subscribe: (handlers, signal) => {
|
|
1193
|
+
let active = true;
|
|
1194
|
+
closed = false;
|
|
1195
|
+
const release = () => {
|
|
1196
|
+
signal?.removeEventListener("abort", unsubscribe);
|
|
1197
|
+
};
|
|
1198
|
+
const unsubscribe = () => {
|
|
1199
|
+
active = false;
|
|
1200
|
+
release();
|
|
1201
|
+
bump();
|
|
1202
|
+
};
|
|
1203
|
+
if (signal) {
|
|
1204
|
+
if (signal.aborted) {
|
|
1205
|
+
active = false;
|
|
1206
|
+
} else {
|
|
1207
|
+
signal.addEventListener("abort", unsubscribe, { once: true });
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
void (async () => {
|
|
1211
|
+
while (active) {
|
|
1212
|
+
const frame = buffer.shift();
|
|
1213
|
+
if (frame) {
|
|
1214
|
+
handlers.onFrame(frame);
|
|
1215
|
+
continue;
|
|
1216
|
+
}
|
|
1217
|
+
if (closed) {
|
|
1218
|
+
release();
|
|
1219
|
+
handlers.onClose("ended");
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
await new Promise((resolve) => {
|
|
1223
|
+
wake = resolve;
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1226
|
+
})();
|
|
1227
|
+
return unsubscribe;
|
|
1228
|
+
}
|
|
1229
|
+
};
|
|
1230
|
+
};
|
|
1231
|
+
var createCollabScriptedTransport = () => {
|
|
1232
|
+
const editorStreams = /* @__PURE__ */ new Map();
|
|
1233
|
+
const listStream = createScriptedStream();
|
|
1234
|
+
const signals = [];
|
|
1235
|
+
const editorSubscribes = [];
|
|
1236
|
+
const listSubscribes = [];
|
|
1237
|
+
let responder = () => ({ ok: true });
|
|
1238
|
+
const editorStreamFor = (resource) => {
|
|
1239
|
+
const key = resourceKey(resource);
|
|
1240
|
+
const existing = editorStreams.get(key);
|
|
1241
|
+
if (existing) {
|
|
1242
|
+
return existing;
|
|
1243
|
+
}
|
|
1244
|
+
const stream = createScriptedStream();
|
|
1245
|
+
editorStreams.set(key, stream);
|
|
1246
|
+
return stream;
|
|
1247
|
+
};
|
|
1248
|
+
return {
|
|
1249
|
+
closeEditor: (resource) => editorStreamFor(resource).close(),
|
|
1250
|
+
closeList: () => listStream.close(),
|
|
1251
|
+
editorSubscribes,
|
|
1252
|
+
listSubscribes,
|
|
1253
|
+
pushEditor: (resource, frames) => editorStreamFor(resource).push(frames),
|
|
1254
|
+
pushList: (frames) => listStream.push(frames),
|
|
1255
|
+
sendSignal: async (resource, signal) => {
|
|
1256
|
+
signals.push({ resource, signal });
|
|
1257
|
+
return responder(signal);
|
|
1258
|
+
},
|
|
1259
|
+
setSignalResponder: (next) => {
|
|
1260
|
+
responder = next;
|
|
1261
|
+
},
|
|
1262
|
+
signals,
|
|
1263
|
+
subscribeEditor: (resource, handlers, options) => {
|
|
1264
|
+
editorSubscribes.push({ lastEventId: options?.lastEventId, target: resourceKey(resource) });
|
|
1265
|
+
return editorStreamFor(resource).subscribe(handlers, options?.signal);
|
|
1266
|
+
},
|
|
1267
|
+
subscribeList: (organizationId, handlers, options) => {
|
|
1268
|
+
listSubscribes.push({ lastEventId: options?.lastEventId, target: organizationId });
|
|
1269
|
+
return listStream.subscribe(handlers, options?.signal);
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
|
+
};
|
|
1273
|
+
|
|
1274
|
+
exports.COLLAB_RESOURCE_KINDS = COLLAB_RESOURCE_KINDS;
|
|
1275
|
+
exports.CollabEngine = CollabEngine;
|
|
1276
|
+
exports.CollabListEngine = CollabListEngine;
|
|
1277
|
+
exports.LIVE_SEGMENT_THROTTLE_MS = LIVE_SEGMENT_THROTTLE_MS;
|
|
1278
|
+
exports.TrailingThrottle = TrailingThrottle;
|
|
1279
|
+
exports.createCollabScriptedTransport = createCollabScriptedTransport;
|
|
1280
|
+
exports.emailLocalPart = emailLocalPart;
|
|
1281
|
+
exports.peerDraftInitials = peerDraftInitials;
|
|
1282
|
+
//# sourceMappingURL=index.cjs.map
|
|
1283
|
+
//# sourceMappingURL=index.cjs.map
|