@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,2198 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../chunk-KMCAHUZM.cjs');
|
|
4
|
+
var chunkPLMVBX2A_cjs = require('../chunk-PLMVBX2A.cjs');
|
|
5
|
+
var chunkU45T35N2_cjs = require('../chunk-U45T35N2.cjs');
|
|
6
|
+
var chunkMLVUWEZR_cjs = require('../chunk-MLVUWEZR.cjs');
|
|
7
|
+
var chunkSG4YDD5L_cjs = require('../chunk-SG4YDD5L.cjs');
|
|
8
|
+
require('../chunk-X23BGIYA.cjs');
|
|
9
|
+
var chunkFRGAV6N6_cjs = require('../chunk-FRGAV6N6.cjs');
|
|
10
|
+
var chunkAFKOABJ4_cjs = require('../chunk-AFKOABJ4.cjs');
|
|
11
|
+
require('../chunk-LS5SJMUO.cjs');
|
|
12
|
+
require('../chunk-SSKSSBWJ.cjs');
|
|
13
|
+
require('../chunk-VZDXX7TT.cjs');
|
|
14
|
+
require('../chunk-NOGDOZIT.cjs');
|
|
15
|
+
require('../chunk-IBQJDVHF.cjs');
|
|
16
|
+
require('../chunk-UTB4NROA.cjs');
|
|
17
|
+
require('../chunk-JBG6Z6MQ.cjs');
|
|
18
|
+
require('../chunk-FEXWDQIZ.cjs');
|
|
19
|
+
require('../chunk-VQVBEX3Y.cjs');
|
|
20
|
+
require('../chunk-QAL4GZO7.cjs');
|
|
21
|
+
require('../chunk-WQ24RRHL.cjs');
|
|
22
|
+
require('../chunk-7CUBXHAH.cjs');
|
|
23
|
+
require('../chunk-LUGTMZFN.cjs');
|
|
24
|
+
require('../chunk-V3JEP5AG.cjs');
|
|
25
|
+
require('../chunk-PM3XCD2G.cjs');
|
|
26
|
+
require('../chunk-QUMBH3U4.cjs');
|
|
27
|
+
require('../chunk-GIFALLHI.cjs');
|
|
28
|
+
var chunkXOHAXXZA_cjs = require('../chunk-XOHAXXZA.cjs');
|
|
29
|
+
require('../chunk-G7OP7O2C.cjs');
|
|
30
|
+
require('../chunk-GE6CFCAM.cjs');
|
|
31
|
+
require('../chunk-MYEQSESM.cjs');
|
|
32
|
+
require('../chunk-WW4CGS7G.cjs');
|
|
33
|
+
require('../chunk-7QN7M667.cjs');
|
|
34
|
+
require('../chunk-AWO5YA7A.cjs');
|
|
35
|
+
require('../chunk-3RVUQ6JN.cjs');
|
|
36
|
+
require('../chunk-NZCZHXYN.cjs');
|
|
37
|
+
require('../chunk-VMEE57E5.cjs');
|
|
38
|
+
require('../chunk-L6TZ2HQR.cjs');
|
|
39
|
+
var chunkAG6JV5Z2_cjs = require('../chunk-AG6JV5Z2.cjs');
|
|
40
|
+
var chunkISLB6Y5Q_cjs = require('../chunk-ISLB6Y5Q.cjs');
|
|
41
|
+
var maplibreGl = require('maplibre-gl');
|
|
42
|
+
|
|
43
|
+
// src/video/rules/videoConstants.ts
|
|
44
|
+
var MIN_CANVAS_DIMENSION = 100;
|
|
45
|
+
var BLACK_FRAME_EXTRA_SETTLE_MS = 400;
|
|
46
|
+
var BLACK_FRAME_MAX_RETRIES = 2;
|
|
47
|
+
var MAX_TILE_CACHE_SIZE = 2048;
|
|
48
|
+
var VIDEO_FOCUS_MARKER_RADIUS_PX = 15;
|
|
49
|
+
var VIDEO_FOCUS_MARKER_FILL = "#ffffff";
|
|
50
|
+
var VIDEO_FOCUS_MARKER_STROKE = "#1a1a1a";
|
|
51
|
+
var VIDEO_FOCUS_MARKER_STROKE_WIDTH = 2;
|
|
52
|
+
var VIDEO_FOCUS_MARKER_GLYPH_COLOR = "#334155";
|
|
53
|
+
var VIDEO_FOCUS_MARKER_GLYPH_RATIO = 0.62;
|
|
54
|
+
var VIDEO_FOCUS_MARKER_HALO_MAX_RADIUS_PX = 34;
|
|
55
|
+
var VIDEO_FOCUS_MARKER_HALO_OPACITY = 0.35;
|
|
56
|
+
var VIDEO_FOCUS_MARKER_PULSE_PERIOD_MS = 1600;
|
|
57
|
+
var WATERMARK_INSET_PX = 20;
|
|
58
|
+
var WATERMARK_WIDTH_PX = 480;
|
|
59
|
+
var WATERMARK_REFERENCE_SHORT_SIDE = 1080;
|
|
60
|
+
var WATERMARK_MIN_SCALE = 0.5;
|
|
61
|
+
var resolutionShortSidePx = {
|
|
62
|
+
"720p": 720,
|
|
63
|
+
"1080p": 1080,
|
|
64
|
+
"1440p": 1440,
|
|
65
|
+
"2160p": 2160
|
|
66
|
+
};
|
|
67
|
+
var toEven = (value) => {
|
|
68
|
+
const rounded = Math.round(value);
|
|
69
|
+
return Math.max(2, rounded % 2 === 0 ? rounded : rounded + 1);
|
|
70
|
+
};
|
|
71
|
+
var resolveDimensions = (output) => {
|
|
72
|
+
const shortSide = resolutionShortSidePx[output.resolution];
|
|
73
|
+
const ratio = chunkXOHAXXZA_cjs.aspectRatio(output.aspect);
|
|
74
|
+
if (ratio >= 1) {
|
|
75
|
+
return { height: toEven(shortSide), width: toEven(shortSide * ratio) };
|
|
76
|
+
}
|
|
77
|
+
return { height: toEven(shortSide / ratio), width: toEven(shortSide) };
|
|
78
|
+
};
|
|
79
|
+
var resolveBitrateBps = (output) => {
|
|
80
|
+
const requested = output.bitrateMbps ?? chunkXOHAXXZA_cjs.bitrateForOutput(output.resolution, output.fps, "high");
|
|
81
|
+
const clamped = Math.min(chunkXOHAXXZA_cjs.BITRATE_MBPS_MAX, Math.max(chunkXOHAXXZA_cjs.BITRATE_MBPS_MIN, requested));
|
|
82
|
+
return Math.round(chunkAG6JV5Z2_cjs.convertDataSize(clamped, "megabit", "bit"));
|
|
83
|
+
};
|
|
84
|
+
var watermarkScale = (width, height) => Math.max(WATERMARK_MIN_SCALE, Math.min(width, height) / WATERMARK_REFERENCE_SHORT_SIDE);
|
|
85
|
+
|
|
86
|
+
// src/video/rules/videoFrames.ts
|
|
87
|
+
var flipRowsInPlace = (pixels, width, height, rowScratch) => {
|
|
88
|
+
const rowBytes = width * 4;
|
|
89
|
+
const half = Math.floor(height / 2);
|
|
90
|
+
for (let row = 0; row < half; row += 1) {
|
|
91
|
+
const topStart = row * rowBytes;
|
|
92
|
+
const bottomStart = (height - 1 - row) * rowBytes;
|
|
93
|
+
rowScratch.set(pixels.subarray(topStart, topStart + rowBytes));
|
|
94
|
+
pixels.copyWithin(topStart, bottomStart, bottomStart + rowBytes);
|
|
95
|
+
pixels.set(rowScratch, bottomStart);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
var isBufferAllBlack = (buffer) => {
|
|
99
|
+
for (let index = 0; index < buffer.length; index += 4) {
|
|
100
|
+
if (buffer[index] !== 0 || buffer[index + 1] !== 0 || buffer[index + 2] !== 0) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return true;
|
|
105
|
+
};
|
|
106
|
+
var createCanvasFrameCapture = (canvas) => {
|
|
107
|
+
const gl = canvas.getContext("webgl2") ?? canvas.getContext("webgl");
|
|
108
|
+
if (!gl) {
|
|
109
|
+
throw new chunkISLB6Y5Q_cjs.MountayaElementsError(
|
|
110
|
+
"Video recorder: the map canvas exposes no WebGL context to read frames from."
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
let scratchRow = new Uint8Array(0);
|
|
114
|
+
return {
|
|
115
|
+
capture: (out, width, height) => {
|
|
116
|
+
gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, out);
|
|
117
|
+
const rowBytes = width * 4;
|
|
118
|
+
if (scratchRow.length !== rowBytes) {
|
|
119
|
+
scratchRow = new Uint8Array(rowBytes);
|
|
120
|
+
}
|
|
121
|
+
flipRowsInPlace(out, width, height, scratchRow);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// src/video/rules/videoPreview.ts
|
|
127
|
+
var PREVIEW_FALLBACK_FPS = 60;
|
|
128
|
+
var previewPoses = (args) => {
|
|
129
|
+
const { cancelFrame, map, markers, onProgress, planDurationMs, poses, requestFrame, signal } = args;
|
|
130
|
+
const schedule = requestFrame ?? ((callback) => requestAnimationFrame(callback));
|
|
131
|
+
const unschedule = cancelFrame ?? ((handle) => cancelAnimationFrame(handle));
|
|
132
|
+
return new Promise((resolve, reject) => {
|
|
133
|
+
if (poses.length === 0 || signal.aborted) {
|
|
134
|
+
resolve();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const lastIndex = poses.length - 1;
|
|
138
|
+
const totalMs = planDurationMs && planDurationMs > 0 ? planDurationMs : poses.length / PREVIEW_FALLBACK_FPS * chunkAG6JV5Z2_cjs.MILLISECONDS_PER_SECOND;
|
|
139
|
+
let startMs = null;
|
|
140
|
+
let frameHandle = 0;
|
|
141
|
+
let settled = false;
|
|
142
|
+
const finish = (failure) => {
|
|
143
|
+
if (settled) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
settled = true;
|
|
147
|
+
signal.removeEventListener("abort", onAbort);
|
|
148
|
+
let thrown = failure;
|
|
149
|
+
try {
|
|
150
|
+
map.setMarker(null);
|
|
151
|
+
} catch (cause) {
|
|
152
|
+
thrown ??= { cause };
|
|
153
|
+
}
|
|
154
|
+
if (thrown) {
|
|
155
|
+
reject(thrown.cause);
|
|
156
|
+
} else {
|
|
157
|
+
resolve();
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const onAbort = () => {
|
|
161
|
+
unschedule(frameHandle);
|
|
162
|
+
finish();
|
|
163
|
+
};
|
|
164
|
+
const step = (timeMs) => {
|
|
165
|
+
try {
|
|
166
|
+
advance(timeMs);
|
|
167
|
+
} catch (cause) {
|
|
168
|
+
finish({ cause });
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const advance = (timeMs) => {
|
|
172
|
+
if (signal.aborted) {
|
|
173
|
+
finish();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (startMs === null) {
|
|
177
|
+
startMs = timeMs;
|
|
178
|
+
}
|
|
179
|
+
const elapsed = timeMs - startMs;
|
|
180
|
+
const fraction = totalMs <= 0 ? 1 : Math.min(1, elapsed / totalMs);
|
|
181
|
+
const index = Math.round(fraction * lastIndex);
|
|
182
|
+
const pose = poses[index] ?? poses[lastIndex];
|
|
183
|
+
if (pose) {
|
|
184
|
+
map.jumpTo(pose);
|
|
185
|
+
}
|
|
186
|
+
const marker = markers?.[index] ?? markers?.[lastIndex];
|
|
187
|
+
if (marker) {
|
|
188
|
+
map.setMarker(marker);
|
|
189
|
+
}
|
|
190
|
+
onProgress?.({ fraction, phase: "recording" });
|
|
191
|
+
if (fraction >= 1) {
|
|
192
|
+
finish();
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
frameHandle = schedule(step);
|
|
196
|
+
};
|
|
197
|
+
signal.addEventListener("abort", onAbort);
|
|
198
|
+
try {
|
|
199
|
+
frameHandle = schedule(step);
|
|
200
|
+
} catch (cause) {
|
|
201
|
+
finish({ cause });
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// src/video/profileOverlay/rules/contract.ts
|
|
207
|
+
var speedKilometersPerHour = (metersPerSecond) => metersPerSecond != null && Number.isFinite(metersPerSecond) ? chunkAG6JV5Z2_cjs.convertSpeed(metersPerSecond, "meter-per-second", "kilometer-per-hour") : null;
|
|
208
|
+
var formatClimbBadge = (category, avgGradePercent, options) => {
|
|
209
|
+
const label = category === "hc" ? "HC" : `CAT ${category}`;
|
|
210
|
+
if (avgGradePercent === null || !Number.isFinite(avgGradePercent)) {
|
|
211
|
+
return label;
|
|
212
|
+
}
|
|
213
|
+
const grade = chunkMLVUWEZR_cjs.formatProportion(chunkAG6JV5Z2_cjs.convertProportion(avgGradePercent, "percent", "ratio"), options, {
|
|
214
|
+
maximumFractionDigits: 1
|
|
215
|
+
});
|
|
216
|
+
return `${label} \xB7 ${grade}`;
|
|
217
|
+
};
|
|
218
|
+
var titleCase = (value) => value.charAt(0).toUpperCase() + value.slice(1);
|
|
219
|
+
var humanizeCategory = (value) => {
|
|
220
|
+
if (value === null) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
const spaced = value.replace(/[_-]+/g, " ").trim();
|
|
224
|
+
return spaced.length > 0 ? titleCase(spaced) : null;
|
|
225
|
+
};
|
|
226
|
+
var joinCategories = (surface, waytype) => {
|
|
227
|
+
const left = humanizeCategory(surface);
|
|
228
|
+
const right = humanizeCategory(waytype);
|
|
229
|
+
if (left && right) {
|
|
230
|
+
return `${left} \xB7 ${right}`;
|
|
231
|
+
}
|
|
232
|
+
return left ?? right;
|
|
233
|
+
};
|
|
234
|
+
var AXIS_MAX_TICKS = 6;
|
|
235
|
+
var axisDistanceTicks = (totalMeters, length) => {
|
|
236
|
+
if (!Number.isFinite(totalMeters) || totalMeters <= 0) {
|
|
237
|
+
return [];
|
|
238
|
+
}
|
|
239
|
+
const totalUnits = chunkAG6JV5Z2_cjs.convertLength(totalMeters, "meter", chunkMLVUWEZR_cjs.distanceUnitFor(length));
|
|
240
|
+
return chunkU45T35N2_cjs.distanceTicks(
|
|
241
|
+
{ from: 0, to: totalMeters },
|
|
242
|
+
{ length },
|
|
243
|
+
Math.min(AXIS_MAX_TICKS + 1, totalUnits)
|
|
244
|
+
).filter((tick) => tick.value > 0 && tick.value < totalUnits * 0.97).map((tick) => tick.meters);
|
|
245
|
+
};
|
|
246
|
+
var formatAxisDistance = (meters, options, withUnit) => chunkMLVUWEZR_cjs.formatDistance(meters, options, { maximumFractionDigits: 0, withUnit });
|
|
247
|
+
|
|
248
|
+
// src/video/profileOverlay/rules/curve.ts
|
|
249
|
+
var elevationDomainFor = (minElevation, maxElevation) => chunkU45T35N2_cjs.extentDomain(minElevation, maxElevation);
|
|
250
|
+
var emptyCurve = () => ({
|
|
251
|
+
hasMultipleSegments: false,
|
|
252
|
+
highPointX: null,
|
|
253
|
+
maxElevation: null,
|
|
254
|
+
minElevation: null,
|
|
255
|
+
points: [],
|
|
256
|
+
totalAscentM: null,
|
|
257
|
+
totalKm: null
|
|
258
|
+
});
|
|
259
|
+
var alongFlight = (sample, totalKm) => totalKm !== null && totalKm > 0 ? sample.distanceKm / totalKm : sample.progress;
|
|
260
|
+
var buildProfileCurve = (samples) => {
|
|
261
|
+
if (samples.length === 0) {
|
|
262
|
+
return emptyCurve();
|
|
263
|
+
}
|
|
264
|
+
let minElevation = Number.POSITIVE_INFINITY;
|
|
265
|
+
let maxElevation = Number.NEGATIVE_INFINITY;
|
|
266
|
+
let totalKm = 0;
|
|
267
|
+
let summit = null;
|
|
268
|
+
let totalAscentM = null;
|
|
269
|
+
const names = /* @__PURE__ */ new Set();
|
|
270
|
+
for (const sample of samples) {
|
|
271
|
+
if (sample.elevation !== null) {
|
|
272
|
+
if (sample.elevation < minElevation) {
|
|
273
|
+
minElevation = sample.elevation;
|
|
274
|
+
}
|
|
275
|
+
if (sample.elevation > maxElevation) {
|
|
276
|
+
maxElevation = sample.elevation;
|
|
277
|
+
summit = sample;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
if (sample.ascentM !== null && (totalAscentM === null || sample.ascentM > totalAscentM)) {
|
|
281
|
+
totalAscentM = sample.ascentM;
|
|
282
|
+
}
|
|
283
|
+
if (sample.distanceKm > totalKm) {
|
|
284
|
+
totalKm = sample.distanceKm;
|
|
285
|
+
}
|
|
286
|
+
if (sample.segmentName !== null) {
|
|
287
|
+
names.add(sample.segmentName);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const hasMultipleSegments = names.size > 1;
|
|
291
|
+
if (!Number.isFinite(minElevation) || !Number.isFinite(maxElevation)) {
|
|
292
|
+
return {
|
|
293
|
+
hasMultipleSegments,
|
|
294
|
+
highPointX: null,
|
|
295
|
+
maxElevation: null,
|
|
296
|
+
minElevation: null,
|
|
297
|
+
points: [],
|
|
298
|
+
totalAscentM,
|
|
299
|
+
totalKm
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
const domain = elevationDomainFor(minElevation, maxElevation);
|
|
303
|
+
const span = domain.max - domain.min;
|
|
304
|
+
const points = [];
|
|
305
|
+
for (const sample of samples) {
|
|
306
|
+
if (sample.elevation === null) {
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
const y = (sample.elevation - domain.min) / span;
|
|
310
|
+
points.push({ slopeDeg: sample.slopeDeg, x: alongFlight(sample, totalKm), y });
|
|
311
|
+
}
|
|
312
|
+
return {
|
|
313
|
+
hasMultipleSegments,
|
|
314
|
+
// Placed once the walk is over: the extent it is read against is the walk's own result.
|
|
315
|
+
highPointX: summit ? alongFlight(summit, totalKm) : null,
|
|
316
|
+
maxElevation,
|
|
317
|
+
minElevation,
|
|
318
|
+
points,
|
|
319
|
+
totalAscentM,
|
|
320
|
+
totalKm
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
// src/video/profileOverlay/rules/fonts.ts
|
|
325
|
+
var OVERLAY_FONT_FAMILY = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
|
|
326
|
+
var OVERLAY_FONT_FACES = [];
|
|
327
|
+
var ensureOverlayFonts = async () => {
|
|
328
|
+
if (typeof document === "undefined") {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const fonts = document.fonts;
|
|
332
|
+
if (typeof fonts?.load !== "function") {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
await Promise.all(OVERLAY_FONT_FACES.map((face) => fonts.load(face))).catch(() => {
|
|
336
|
+
});
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
// src/video/profileOverlay/rules/draw.ts
|
|
340
|
+
var OVERLAY_REFERENCE_SHORT_SIDE = 1080;
|
|
341
|
+
var overlayScale = (width, height) => Math.max(0.5, Math.min(width, height) / OVERLAY_REFERENCE_SHORT_SIDE);
|
|
342
|
+
var overlayPalette = {
|
|
343
|
+
accent: "#3b82f6",
|
|
344
|
+
accentDim: "rgba(59, 130, 246, 0.35)",
|
|
345
|
+
accentHalo: "rgba(59, 130, 246, 0.22)",
|
|
346
|
+
axisText: "rgba(245, 247, 250, 0.45)",
|
|
347
|
+
badgeCat: "#f5f7fa",
|
|
348
|
+
badgeDarkText: "#0b0e11",
|
|
349
|
+
badgeHc: "#dc2626",
|
|
350
|
+
hairline: "rgba(255, 255, 255, 0.18)",
|
|
351
|
+
hairlineStrong: "rgba(255, 255, 255, 0.35)",
|
|
352
|
+
labelText: "rgba(245, 247, 250, 0.55)",
|
|
353
|
+
panel: "rgba(15, 18, 22, 0.72)",
|
|
354
|
+
primaryText: "#f5f7fa",
|
|
355
|
+
secondaryText: "rgba(245, 247, 250, 0.66)"
|
|
356
|
+
};
|
|
357
|
+
var CURVE_COVERED_FILL_ALPHA = 0.55;
|
|
358
|
+
var CURVE_AHEAD_FILL_ALPHA = 0.18;
|
|
359
|
+
var steepnessBandColors = {
|
|
360
|
+
"25-30": "#f97316",
|
|
361
|
+
"30-35": "#ea580c",
|
|
362
|
+
"35-40": "#dc2626",
|
|
363
|
+
"40-45": "#b91c1c",
|
|
364
|
+
"45+": "#7f1d1d",
|
|
365
|
+
gentle: "#22c55e",
|
|
366
|
+
moderate: "#eab308"
|
|
367
|
+
};
|
|
368
|
+
var GENTLE_SLOPE_DEGREES = 12;
|
|
369
|
+
var slopeBandColor = (degrees) => {
|
|
370
|
+
if (degrees === null || !Number.isFinite(degrees)) {
|
|
371
|
+
return overlayPalette.secondaryText;
|
|
372
|
+
}
|
|
373
|
+
const magnitude = Math.abs(degrees);
|
|
374
|
+
if (magnitude < GENTLE_SLOPE_DEGREES) {
|
|
375
|
+
return steepnessBandColors.gentle;
|
|
376
|
+
}
|
|
377
|
+
if (magnitude < chunkU45T35N2_cjs.STEEPNESS_THRESHOLDS[0]) {
|
|
378
|
+
return steepnessBandColors.moderate;
|
|
379
|
+
}
|
|
380
|
+
const band = chunkU45T35N2_cjs.classifySteepness(magnitude);
|
|
381
|
+
return band ? steepnessBandColors[band] : steepnessBandColors.gentle;
|
|
382
|
+
};
|
|
383
|
+
var slopeBandTextColor = (degrees) => {
|
|
384
|
+
if (degrees === null || !Number.isFinite(degrees)) {
|
|
385
|
+
return overlayPalette.badgeDarkText;
|
|
386
|
+
}
|
|
387
|
+
return Math.abs(degrees) < chunkU45T35N2_cjs.STEEPNESS_THRESHOLDS[0] ? overlayPalette.badgeDarkText : overlayPalette.primaryText;
|
|
388
|
+
};
|
|
389
|
+
var drawChip = (ctx, text, x, topY, scale, spec, align = "left") => {
|
|
390
|
+
const font = overlayFont(700, spec.fontPx, scale);
|
|
391
|
+
const pad = spec.padPx * scale;
|
|
392
|
+
const height = spec.heightPx * scale;
|
|
393
|
+
const width = measureTextWidth(ctx, text, font) + pad * 2;
|
|
394
|
+
const left = align === "left" ? x : x - width;
|
|
395
|
+
fillRoundedRect(ctx, left, topY, width, height, height / 2, spec.bg);
|
|
396
|
+
drawText(ctx, text, left + pad, topY + height * 0.7, {
|
|
397
|
+
align: "left",
|
|
398
|
+
color: spec.fg,
|
|
399
|
+
font
|
|
400
|
+
});
|
|
401
|
+
return width;
|
|
402
|
+
};
|
|
403
|
+
var roundedRectPath = (ctx, x, y, width, height, radius) => {
|
|
404
|
+
const r = Math.max(0, Math.min(radius, width / 2, height / 2));
|
|
405
|
+
ctx.beginPath();
|
|
406
|
+
ctx.moveTo(x + r, y);
|
|
407
|
+
ctx.arcTo(x + width, y, x + width, y + height, r);
|
|
408
|
+
ctx.arcTo(x + width, y + height, x, y + height, r);
|
|
409
|
+
ctx.arcTo(x, y + height, x, y, r);
|
|
410
|
+
ctx.arcTo(x, y, x + width, y, r);
|
|
411
|
+
ctx.closePath();
|
|
412
|
+
};
|
|
413
|
+
var fillRoundedRect = (ctx, x, y, width, height, radius, color) => {
|
|
414
|
+
roundedRectPath(ctx, x, y, width, height, radius);
|
|
415
|
+
ctx.fillStyle = color;
|
|
416
|
+
ctx.fill();
|
|
417
|
+
};
|
|
418
|
+
var drawText = (ctx, text, x, y, style) => {
|
|
419
|
+
ctx.font = style.font;
|
|
420
|
+
ctx.fillStyle = style.color;
|
|
421
|
+
ctx.textAlign = style.align;
|
|
422
|
+
ctx.textBaseline = "alphabetic";
|
|
423
|
+
ctx.fillText(text, x, y);
|
|
424
|
+
};
|
|
425
|
+
var measureTextWidth = (ctx, text, font) => {
|
|
426
|
+
ctx.font = font;
|
|
427
|
+
return ctx.measureText(text).width;
|
|
428
|
+
};
|
|
429
|
+
var overlayFont = (weight, px, scale) => `${weight} ${Math.round(px * scale)}px ${OVERLAY_FONT_FAMILY}`;
|
|
430
|
+
var MICRO_LABEL_TRACKING_PX = 1.4;
|
|
431
|
+
var microLabelFont = (scale) => overlayFont(700, 12, scale);
|
|
432
|
+
var trackMicroLabel = (ctx, scale, on) => {
|
|
433
|
+
if ("letterSpacing" in ctx) {
|
|
434
|
+
ctx.letterSpacing = on ? `${(MICRO_LABEL_TRACKING_PX * scale).toFixed(2)}px` : "0px";
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
var microLabelText = (text, language) => language === void 0 ? text.toUpperCase() : chunkSG4YDD5L_cjs.upperCase(text, language);
|
|
438
|
+
var measureMicroLabel = (ctx, text, scale, language) => {
|
|
439
|
+
trackMicroLabel(ctx, scale, true);
|
|
440
|
+
const width = measureTextWidth(ctx, microLabelText(text, language), microLabelFont(scale));
|
|
441
|
+
trackMicroLabel(ctx, scale, false);
|
|
442
|
+
return width;
|
|
443
|
+
};
|
|
444
|
+
var drawMicroLabel = (ctx, text, x, y, scale, color, align = "left", language) => {
|
|
445
|
+
trackMicroLabel(ctx, scale, true);
|
|
446
|
+
drawText(ctx, microLabelText(text, language), x, y, {
|
|
447
|
+
align,
|
|
448
|
+
color,
|
|
449
|
+
font: microLabelFont(scale)
|
|
450
|
+
});
|
|
451
|
+
trackMicroLabel(ctx, scale, false);
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
// src/video/profileOverlay/rules/staticLayer.ts
|
|
455
|
+
var CURVE_STROKE_BLEED_PX = 6;
|
|
456
|
+
var AXIS_STRIP_PX = 24;
|
|
457
|
+
var REFERENCE_CURVE_HEIGHT = 108;
|
|
458
|
+
var BAND_BAR_DIM_ALPHA = 0.35;
|
|
459
|
+
var defaultCanvasFactory = () => document.createElement("canvas");
|
|
460
|
+
var traceCurvePath = (ctx, points, rect, originX = 0, originY = 0) => {
|
|
461
|
+
const toX = (fraction) => originX + fraction * rect.w;
|
|
462
|
+
const toY = (normalized) => originY + rect.h - normalized * rect.h;
|
|
463
|
+
ctx.beginPath();
|
|
464
|
+
ctx.moveTo(toX(points[0]?.x ?? 0), originY + rect.h);
|
|
465
|
+
for (const point of points) {
|
|
466
|
+
ctx.lineTo(toX(point.x), toY(point.y));
|
|
467
|
+
}
|
|
468
|
+
ctx.lineTo(toX(points[points.length - 1]?.x ?? 1), originY + rect.h);
|
|
469
|
+
ctx.closePath();
|
|
470
|
+
};
|
|
471
|
+
var traceRidgePath = (ctx, points, rect, originX, originY) => {
|
|
472
|
+
const toX = (fraction) => originX + fraction * rect.w;
|
|
473
|
+
const toY = (normalized) => originY + rect.h - normalized * rect.h;
|
|
474
|
+
ctx.beginPath();
|
|
475
|
+
ctx.moveTo(toX(points[0]?.x ?? 0), toY(points[0]?.y ?? 0));
|
|
476
|
+
for (const point of points) {
|
|
477
|
+
ctx.lineTo(toX(point.x), toY(point.y));
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
var paintCurveLayer = (ctx, points, rect, originX, originY, fillAlpha, ridgeColor, ridgeWidth) => {
|
|
481
|
+
ctx.save();
|
|
482
|
+
traceCurvePath(ctx, points, rect, originX, originY);
|
|
483
|
+
ctx.clip();
|
|
484
|
+
ctx.globalAlpha = fillAlpha;
|
|
485
|
+
for (let index = 0; index < points.length - 1; index += 1) {
|
|
486
|
+
const point = points[index];
|
|
487
|
+
const next = points[index + 1];
|
|
488
|
+
if (!point || !next) {
|
|
489
|
+
continue;
|
|
490
|
+
}
|
|
491
|
+
const x0 = originX + point.x * rect.w;
|
|
492
|
+
const x1 = originX + next.x * rect.w;
|
|
493
|
+
if (x1 <= x0) {
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
ctx.fillStyle = slopeBandColor(point.slopeDeg);
|
|
497
|
+
ctx.fillRect(x0, originY, x1 - x0 + 0.5, rect.h);
|
|
498
|
+
}
|
|
499
|
+
ctx.restore();
|
|
500
|
+
traceRidgePath(ctx, points, rect, originX, originY);
|
|
501
|
+
ctx.lineJoin = "round";
|
|
502
|
+
ctx.lineWidth = ridgeWidth;
|
|
503
|
+
ctx.strokeStyle = ridgeColor;
|
|
504
|
+
ctx.stroke();
|
|
505
|
+
};
|
|
506
|
+
var paintAxisStrip = (ctx, curve, rect, originX, baselineY, format, palette, scale) => {
|
|
507
|
+
if (curve.totalKm === null || curve.totalKm <= 0) {
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
const totalMeters = curve.totalKm * chunkAG6JV5Z2_cjs.METERS_PER_KILOMETER;
|
|
511
|
+
const ticks = axisDistanceTicks(totalMeters, format.length);
|
|
512
|
+
const labelFont = overlayFont(400, 11, scale);
|
|
513
|
+
for (let index = 0; index < ticks.length; index += 1) {
|
|
514
|
+
const meters = ticks[index] ?? 0;
|
|
515
|
+
const x = originX + meters / totalMeters * rect.w;
|
|
516
|
+
ctx.fillStyle = palette.hairline;
|
|
517
|
+
ctx.fillRect(x - Math.max(0.5, 0.5 * scale), baselineY, Math.max(1, 1 * scale), 6 * scale);
|
|
518
|
+
ctx.font = labelFont;
|
|
519
|
+
ctx.fillStyle = palette.axisText;
|
|
520
|
+
ctx.textAlign = "center";
|
|
521
|
+
ctx.textBaseline = "alphabetic";
|
|
522
|
+
ctx.fillText(
|
|
523
|
+
formatAxisDistance(meters, format, index === ticks.length - 1),
|
|
524
|
+
x,
|
|
525
|
+
baselineY + 18 * scale
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
var paintSummitMarker = (ctx, curve, rect, originX, originY, palette, scale, summitLabel) => {
|
|
530
|
+
if (curve.highPointX === null || summitLabel.length === 0) {
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
const x = originX + curve.highPointX * rect.w;
|
|
534
|
+
let summitY = curve.points.length === 0 ? 1 : 0;
|
|
535
|
+
for (const point of curve.points) {
|
|
536
|
+
summitY = Math.max(summitY, point.y);
|
|
537
|
+
}
|
|
538
|
+
const ridgeY = originY + rect.h - summitY * rect.h;
|
|
539
|
+
ctx.fillStyle = palette.primaryText;
|
|
540
|
+
ctx.fillRect(x - Math.max(0.5, 1 * scale), ridgeY, Math.max(1, 2 * scale), 10 * scale);
|
|
541
|
+
const flip = curve.highPointX > 0.82;
|
|
542
|
+
ctx.font = overlayFont(700, 13, scale);
|
|
543
|
+
ctx.fillStyle = palette.primaryText;
|
|
544
|
+
ctx.textAlign = flip ? "right" : "left";
|
|
545
|
+
ctx.textBaseline = "alphabetic";
|
|
546
|
+
ctx.fillText(summitLabel, x + (flip ? -8 : 8) * scale, ridgeY + 16 * scale);
|
|
547
|
+
};
|
|
548
|
+
var bakeCurveLayers = (curve, rect, palette, format, scale, summitLabel, createCanvas = defaultCanvasFactory) => {
|
|
549
|
+
if (typeof document === "undefined") {
|
|
550
|
+
return null;
|
|
551
|
+
}
|
|
552
|
+
const strokeScale = rect.h > 0 ? rect.h / REFERENCE_CURVE_HEIGHT : 1;
|
|
553
|
+
const bleed = Math.ceil(CURVE_STROKE_BLEED_PX * strokeScale);
|
|
554
|
+
const axisStrip = Math.ceil(AXIS_STRIP_PX * scale);
|
|
555
|
+
const layerHeight = Math.max(1, Math.ceil(rect.h + bleed + axisStrip));
|
|
556
|
+
const layerWidth = Math.max(1, Math.ceil(rect.w));
|
|
557
|
+
const dim = createCanvas();
|
|
558
|
+
dim.width = layerWidth;
|
|
559
|
+
dim.height = layerHeight;
|
|
560
|
+
const dimContext = dim.getContext("2d");
|
|
561
|
+
const bright = createCanvas();
|
|
562
|
+
bright.width = layerWidth;
|
|
563
|
+
bright.height = layerHeight;
|
|
564
|
+
const brightContext = bright.getContext("2d");
|
|
565
|
+
if (!dimContext || !brightContext) {
|
|
566
|
+
return null;
|
|
567
|
+
}
|
|
568
|
+
const ridgeWidth = Math.max(1, 3 * strokeScale);
|
|
569
|
+
const brightRidgeWidth = Math.max(1, 3.5 * strokeScale);
|
|
570
|
+
paintCurveLayer(
|
|
571
|
+
dimContext,
|
|
572
|
+
curve.points,
|
|
573
|
+
rect,
|
|
574
|
+
0,
|
|
575
|
+
bleed,
|
|
576
|
+
CURVE_AHEAD_FILL_ALPHA,
|
|
577
|
+
palette.accentDim,
|
|
578
|
+
ridgeWidth
|
|
579
|
+
);
|
|
580
|
+
paintAxisStrip(dimContext, curve, rect, 0, bleed + rect.h, format, palette, scale);
|
|
581
|
+
paintSummitMarker(dimContext, curve, rect, 0, bleed, palette, scale, summitLabel);
|
|
582
|
+
paintCurveLayer(
|
|
583
|
+
brightContext,
|
|
584
|
+
curve.points,
|
|
585
|
+
rect,
|
|
586
|
+
0,
|
|
587
|
+
bleed,
|
|
588
|
+
CURVE_COVERED_FILL_ALPHA,
|
|
589
|
+
palette.accent,
|
|
590
|
+
brightRidgeWidth
|
|
591
|
+
);
|
|
592
|
+
return { axisStrip, bleed, bright, dim };
|
|
593
|
+
};
|
|
594
|
+
var coloursOf = (palette) => Object.entries(palette).sort(([left], [right]) => left < right ? -1 : 1).join("|");
|
|
595
|
+
var paintedWith = (baked, palette) => baked.palette === palette || baked.colours === coloursOf(palette);
|
|
596
|
+
var layerCache = /* @__PURE__ */ new WeakMap();
|
|
597
|
+
var layersKey = (rect, format) => `${rect.x}x${rect.y}x${rect.w}x${rect.h}|${format.length}|${format.slope}|${format.language}`;
|
|
598
|
+
var acquireCurveLayers = (curve, rect, palette, format, scale, summitLabel) => {
|
|
599
|
+
const key = layersKey(rect, format);
|
|
600
|
+
const cached = layerCache.get(curve);
|
|
601
|
+
if (cached && cached.key === key && paintedWith(cached, palette)) {
|
|
602
|
+
return cached.layers;
|
|
603
|
+
}
|
|
604
|
+
const layers = bakeCurveLayers(curve, rect, palette, format, scale, summitLabel);
|
|
605
|
+
layerCache.set(curve, { colours: coloursOf(palette), key, layers, palette });
|
|
606
|
+
return layers;
|
|
607
|
+
};
|
|
608
|
+
var paintBandBar = (ctx, curve, x, y, width, height, alpha, palette) => {
|
|
609
|
+
ctx.save();
|
|
610
|
+
const r = height / 2;
|
|
611
|
+
ctx.beginPath();
|
|
612
|
+
ctx.moveTo(x + r, y);
|
|
613
|
+
ctx.arcTo(x + width, y, x + width, y + height, r);
|
|
614
|
+
ctx.arcTo(x + width, y + height, x, y + height, r);
|
|
615
|
+
ctx.arcTo(x, y + height, x, y, r);
|
|
616
|
+
ctx.arcTo(x, y, x + width, y, r);
|
|
617
|
+
ctx.closePath();
|
|
618
|
+
ctx.clip();
|
|
619
|
+
ctx.globalAlpha = alpha;
|
|
620
|
+
const points = curve.points;
|
|
621
|
+
if (points.length >= 2) {
|
|
622
|
+
for (let index = 0; index < points.length - 1; index += 1) {
|
|
623
|
+
const point = points[index];
|
|
624
|
+
const next = points[index + 1];
|
|
625
|
+
if (!point || !next) {
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
const x0 = x + point.x * width;
|
|
629
|
+
const x1 = x + next.x * width;
|
|
630
|
+
if (x1 <= x0) {
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
ctx.fillStyle = slopeBandColor(point.slopeDeg);
|
|
634
|
+
ctx.fillRect(x0, y, x1 - x0 + 0.5, height);
|
|
635
|
+
}
|
|
636
|
+
} else {
|
|
637
|
+
ctx.fillStyle = palette.hairline;
|
|
638
|
+
ctx.fillRect(x, y, width, height);
|
|
639
|
+
}
|
|
640
|
+
ctx.globalAlpha = 1;
|
|
641
|
+
if (curve.highPointX !== null) {
|
|
642
|
+
ctx.fillStyle = palette.primaryText;
|
|
643
|
+
ctx.fillRect(x + curve.highPointX * width - 1, y, 2, height);
|
|
644
|
+
}
|
|
645
|
+
ctx.restore();
|
|
646
|
+
};
|
|
647
|
+
var bandBarCache = /* @__PURE__ */ new WeakMap();
|
|
648
|
+
var acquireBandBar = (curve, widthPx, heightPx, palette, createCanvas = defaultCanvasFactory) => {
|
|
649
|
+
if (typeof document === "undefined") {
|
|
650
|
+
return null;
|
|
651
|
+
}
|
|
652
|
+
const key = `${Math.ceil(widthPx)}x${Math.ceil(heightPx)}`;
|
|
653
|
+
const cached = bandBarCache.get(curve);
|
|
654
|
+
if (cached && cached.key === key && paintedWith(cached, palette)) {
|
|
655
|
+
return cached.layers;
|
|
656
|
+
}
|
|
657
|
+
const width = Math.max(1, Math.ceil(widthPx));
|
|
658
|
+
const height = Math.max(1, Math.ceil(heightPx));
|
|
659
|
+
const build = (alpha) => {
|
|
660
|
+
const canvas = createCanvas();
|
|
661
|
+
canvas.width = width;
|
|
662
|
+
canvas.height = height;
|
|
663
|
+
const ctx = canvas.getContext("2d");
|
|
664
|
+
if (!ctx) {
|
|
665
|
+
return null;
|
|
666
|
+
}
|
|
667
|
+
paintBandBar(ctx, curve, 0, 0, width, height, alpha, palette);
|
|
668
|
+
return canvas;
|
|
669
|
+
};
|
|
670
|
+
const dim = build(BAND_BAR_DIM_ALPHA);
|
|
671
|
+
const bright = build(1);
|
|
672
|
+
const layers = dim && bright ? { bright, dim } : null;
|
|
673
|
+
bandBarCache.set(curve, { colours: coloursOf(palette), key, layers, palette });
|
|
674
|
+
return layers;
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
// src/video/profileOverlay/rules/types.ts
|
|
678
|
+
var clamp01 = (value) => Math.max(0, Math.min(1, value));
|
|
679
|
+
|
|
680
|
+
// src/video/profileOverlay/rules/graphDesign.ts
|
|
681
|
+
var ridgeYAt = (points, fraction) => {
|
|
682
|
+
if (points.length === 0) {
|
|
683
|
+
return 0;
|
|
684
|
+
}
|
|
685
|
+
let low = 0;
|
|
686
|
+
let high = points.length - 1;
|
|
687
|
+
while (low < high) {
|
|
688
|
+
const mid = low + high >> 1;
|
|
689
|
+
if ((points[mid]?.x ?? 0) < fraction) {
|
|
690
|
+
low = mid + 1;
|
|
691
|
+
} else {
|
|
692
|
+
high = mid;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
const after = low;
|
|
696
|
+
const before = low > 0 ? low - 1 : 0;
|
|
697
|
+
const afterGap = Math.abs((points[after]?.x ?? 0) - fraction);
|
|
698
|
+
const beforeGap = Math.abs((points[before]?.x ?? 0) - fraction);
|
|
699
|
+
return (beforeGap <= afterGap ? points[before]?.y : points[after]?.y) ?? 0;
|
|
700
|
+
};
|
|
701
|
+
var ZERO_WIDTH_JOINER = "\u200D";
|
|
702
|
+
var ellipsize = (ctx, text, font, maxWidth) => {
|
|
703
|
+
if (maxWidth <= 0) {
|
|
704
|
+
return "";
|
|
705
|
+
}
|
|
706
|
+
let cuts = ellipsizedCuts.get(ctx);
|
|
707
|
+
if (cuts === void 0) {
|
|
708
|
+
cuts = /* @__PURE__ */ new Map();
|
|
709
|
+
ellipsizedCuts.set(ctx, cuts);
|
|
710
|
+
}
|
|
711
|
+
const key = `${font}\0${maxWidth}\0${text}`;
|
|
712
|
+
const known = cuts.get(key);
|
|
713
|
+
if (known !== void 0) {
|
|
714
|
+
return known;
|
|
715
|
+
}
|
|
716
|
+
if (cuts.size >= ELLIPSIZED_CUTS_MAX) {
|
|
717
|
+
cuts.clear();
|
|
718
|
+
}
|
|
719
|
+
const cut = cutToFit(ctx, text, font, maxWidth);
|
|
720
|
+
cuts.set(key, cut);
|
|
721
|
+
return cut;
|
|
722
|
+
};
|
|
723
|
+
var ELLIPSIZED_CUTS_MAX = 256;
|
|
724
|
+
var ellipsizedCuts = /* @__PURE__ */ new WeakMap();
|
|
725
|
+
var cutToFit = (ctx, text, font, maxWidth) => {
|
|
726
|
+
if (measureTextWidth(ctx, text, font) <= maxWidth) {
|
|
727
|
+
return text;
|
|
728
|
+
}
|
|
729
|
+
const ellipsis = "\u2026";
|
|
730
|
+
const characters = Array.from(text);
|
|
731
|
+
let trimmed = text;
|
|
732
|
+
while (characters.length > 1 && measureTextWidth(ctx, `${trimmed}${ellipsis}`, font) > maxWidth) {
|
|
733
|
+
characters.pop();
|
|
734
|
+
while (characters.length > 1 && characters.at(-1) === ZERO_WIDTH_JOINER) {
|
|
735
|
+
characters.pop();
|
|
736
|
+
}
|
|
737
|
+
trimmed = characters.join("");
|
|
738
|
+
}
|
|
739
|
+
return `${trimmed}${ellipsis}`;
|
|
740
|
+
};
|
|
741
|
+
var BADGE_CHIP_HEIGHT_PX = 24;
|
|
742
|
+
var GRADIENT_CHIP_HEIGHT_PX = 34;
|
|
743
|
+
var climbBadgeSpec = (category) => {
|
|
744
|
+
const severe = category === "hc" || category === "1";
|
|
745
|
+
return {
|
|
746
|
+
bg: severe ? overlayPalette.badgeHc : overlayPalette.badgeCat,
|
|
747
|
+
fg: severe ? overlayPalette.primaryText : overlayPalette.badgeDarkText,
|
|
748
|
+
fontPx: 13,
|
|
749
|
+
heightPx: BADGE_CHIP_HEIGHT_PX,
|
|
750
|
+
padPx: 10
|
|
751
|
+
};
|
|
752
|
+
};
|
|
753
|
+
var drawCurve = (ctx, covered, curve, rect, format, scale) => {
|
|
754
|
+
const points = curve.points;
|
|
755
|
+
const coveredWidth = covered * rect.w;
|
|
756
|
+
const summitLabel = chunkMLVUWEZR_cjs.formatElevation(curve.maxElevation, format);
|
|
757
|
+
const layers = acquireCurveLayers(curve, rect, overlayPalette, format, scale, summitLabel);
|
|
758
|
+
if (layers) {
|
|
759
|
+
const top = rect.y - layers.bleed;
|
|
760
|
+
ctx.drawImage(layers.dim, rect.x, top);
|
|
761
|
+
ctx.save();
|
|
762
|
+
ctx.beginPath();
|
|
763
|
+
ctx.rect(rect.x, rect.y - 6 * scale, coveredWidth, rect.h + 12 * scale);
|
|
764
|
+
ctx.clip();
|
|
765
|
+
ctx.drawImage(layers.bright, rect.x, top);
|
|
766
|
+
ctx.restore();
|
|
767
|
+
} else {
|
|
768
|
+
paintCurveLayer(
|
|
769
|
+
ctx,
|
|
770
|
+
points,
|
|
771
|
+
rect,
|
|
772
|
+
rect.x,
|
|
773
|
+
rect.y,
|
|
774
|
+
CURVE_AHEAD_FILL_ALPHA,
|
|
775
|
+
overlayPalette.accentDim,
|
|
776
|
+
Math.max(1, 3 * scale)
|
|
777
|
+
);
|
|
778
|
+
paintAxisStrip(ctx, curve, rect, rect.x, rect.y + rect.h, format, overlayPalette, scale);
|
|
779
|
+
paintSummitMarker(ctx, curve, rect, rect.x, rect.y, overlayPalette, scale, summitLabel);
|
|
780
|
+
ctx.save();
|
|
781
|
+
ctx.beginPath();
|
|
782
|
+
ctx.rect(rect.x, rect.y - 6 * scale, coveredWidth, rect.h + 12 * scale);
|
|
783
|
+
ctx.clip();
|
|
784
|
+
paintCurveLayer(
|
|
785
|
+
ctx,
|
|
786
|
+
points,
|
|
787
|
+
rect,
|
|
788
|
+
rect.x,
|
|
789
|
+
rect.y,
|
|
790
|
+
CURVE_COVERED_FILL_ALPHA,
|
|
791
|
+
overlayPalette.accent,
|
|
792
|
+
Math.max(1, 3.5 * scale)
|
|
793
|
+
);
|
|
794
|
+
ctx.restore();
|
|
795
|
+
}
|
|
796
|
+
ctx.beginPath();
|
|
797
|
+
ctx.moveTo(rect.x, rect.y + rect.h);
|
|
798
|
+
ctx.lineTo(rect.x + rect.w, rect.y + rect.h);
|
|
799
|
+
ctx.lineWidth = Math.max(1, 1 * scale);
|
|
800
|
+
ctx.strokeStyle = overlayPalette.hairlineStrong;
|
|
801
|
+
ctx.stroke();
|
|
802
|
+
const dotX = rect.x + covered * rect.w;
|
|
803
|
+
const dotY = rect.y + rect.h - ridgeYAt(points, covered) * rect.h;
|
|
804
|
+
ctx.beginPath();
|
|
805
|
+
ctx.arc(dotX, dotY, Math.max(2, 11 * scale), 0, Math.PI * 2);
|
|
806
|
+
ctx.fillStyle = overlayPalette.accentHalo;
|
|
807
|
+
ctx.fill();
|
|
808
|
+
ctx.beginPath();
|
|
809
|
+
ctx.arc(dotX, dotY, Math.max(1.5, 5.5 * scale), 0, Math.PI * 2);
|
|
810
|
+
ctx.fillStyle = overlayPalette.accent;
|
|
811
|
+
ctx.fill();
|
|
812
|
+
ctx.lineWidth = Math.max(1, 2 * scale);
|
|
813
|
+
ctx.strokeStyle = overlayPalette.primaryText;
|
|
814
|
+
ctx.stroke();
|
|
815
|
+
};
|
|
816
|
+
var graphReadouts = (sample, curve, format) => ({
|
|
817
|
+
ascent: chunkMLVUWEZR_cjs.formatElevation(sample.ascentM, format),
|
|
818
|
+
category: joinCategories(sample.surface, sample.waytype),
|
|
819
|
+
distance: chunkMLVUWEZR_cjs.formatDistance(sample.distanceKm * chunkAG6JV5Z2_cjs.METERS_PER_KILOMETER, format),
|
|
820
|
+
elevation: chunkMLVUWEZR_cjs.formatElevation(sample.elevation, format),
|
|
821
|
+
remaining: curve.totalKm !== null ? chunkMLVUWEZR_cjs.formatDistance(
|
|
822
|
+
Math.max(0, curve.totalKm - sample.distanceKm) * chunkAG6JV5Z2_cjs.METERS_PER_KILOMETER,
|
|
823
|
+
format
|
|
824
|
+
) : "",
|
|
825
|
+
slope: chunkMLVUWEZR_cjs.formatSlope(sample.slopeDeg, format),
|
|
826
|
+
speed: chunkMLVUWEZR_cjs.formatSpeed(speedKilometersPerHour(sample.speed), format),
|
|
827
|
+
toSummit: sample.climbEndKm !== null ? chunkMLVUWEZR_cjs.formatDistance(
|
|
828
|
+
Math.max(0, sample.climbEndKm - sample.distanceKm) * chunkAG6JV5Z2_cjs.METERS_PER_KILOMETER,
|
|
829
|
+
format
|
|
830
|
+
) : "",
|
|
831
|
+
totalAscent: chunkMLVUWEZR_cjs.formatElevation(curve.totalAscentM, format)
|
|
832
|
+
});
|
|
833
|
+
var gridLabel = (grid, text, x, baseline, align = "left") => {
|
|
834
|
+
drawMicroLabel(grid.ctx, text, x, baseline, grid.scale, overlayPalette.labelText, align);
|
|
835
|
+
};
|
|
836
|
+
var gridValue = (grid, text, x, baseline, align, px = 22) => {
|
|
837
|
+
drawText(grid.ctx, text, x, baseline, {
|
|
838
|
+
align,
|
|
839
|
+
color: overlayPalette.primaryText,
|
|
840
|
+
font: overlayFont(700, px, grid.scale)
|
|
841
|
+
});
|
|
842
|
+
};
|
|
843
|
+
var gradientChip = (grid, x, valueBaseline) => {
|
|
844
|
+
const { ctx, scale, slopeDeg, texts } = grid;
|
|
845
|
+
drawChip(ctx, texts.slope, x, valueBaseline - GRADIENT_CHIP_HEIGHT_PX * 0.7 * scale, scale, {
|
|
846
|
+
bg: slopeBandColor(slopeDeg),
|
|
847
|
+
fg: slopeBandTextColor(slopeDeg),
|
|
848
|
+
fontPx: 20,
|
|
849
|
+
heightPx: GRADIENT_CHIP_HEIGHT_PX,
|
|
850
|
+
padPx: 12
|
|
851
|
+
});
|
|
852
|
+
};
|
|
853
|
+
var dPlusValue = (grid, x, baseline) => {
|
|
854
|
+
const { ctx, scale, texts } = grid;
|
|
855
|
+
const runFont = overlayFont(700, 20, scale);
|
|
856
|
+
const run = `+${texts.ascent}`;
|
|
857
|
+
drawText(ctx, run, x, baseline, {
|
|
858
|
+
align: "left",
|
|
859
|
+
color: overlayPalette.primaryText,
|
|
860
|
+
font: runFont
|
|
861
|
+
});
|
|
862
|
+
if (texts.totalAscent.length > 0) {
|
|
863
|
+
drawText(ctx, ` / ${texts.totalAscent}`, x + measureTextWidth(ctx, run, runFont), baseline, {
|
|
864
|
+
align: "left",
|
|
865
|
+
color: overlayPalette.secondaryText,
|
|
866
|
+
font: overlayFont(400, 15, scale)
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
var drawOverline = (ctx, sample, curve, format, row) => {
|
|
871
|
+
const { baseline, covered, left, panelW, rightEdge, scale } = row;
|
|
872
|
+
const chipTop = baseline - 17 * scale;
|
|
873
|
+
if (curve.hasMultipleSegments && sample.segmentName !== null) {
|
|
874
|
+
const pillFont = overlayFont(700, 13, scale);
|
|
875
|
+
const pillPad = 10 * scale;
|
|
876
|
+
const label = ellipsize(ctx, sample.segmentName, pillFont, panelW / 2 - pillPad * 2);
|
|
877
|
+
drawChip(ctx, label, left, chipTop, scale, {
|
|
878
|
+
bg: overlayPalette.hairline,
|
|
879
|
+
fg: overlayPalette.primaryText,
|
|
880
|
+
fontPx: 13,
|
|
881
|
+
heightPx: BADGE_CHIP_HEIGHT_PX,
|
|
882
|
+
padPx: 10
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
const percentFont = overlayFont(700, 14, scale);
|
|
886
|
+
const percentText = chunkMLVUWEZR_cjs.formatProportion(covered, format);
|
|
887
|
+
drawText(ctx, percentText, rightEdge, baseline, {
|
|
888
|
+
align: "right",
|
|
889
|
+
color: overlayPalette.accent,
|
|
890
|
+
font: percentFont
|
|
891
|
+
});
|
|
892
|
+
if (sample.climbCategory !== null) {
|
|
893
|
+
drawChip(
|
|
894
|
+
ctx,
|
|
895
|
+
formatClimbBadge(sample.climbCategory, sample.climbAvgGradePercent, format),
|
|
896
|
+
rightEdge - measureTextWidth(ctx, percentText, percentFont) - 14 * scale,
|
|
897
|
+
chipTop,
|
|
898
|
+
scale,
|
|
899
|
+
climbBadgeSpec(sample.climbCategory),
|
|
900
|
+
"right"
|
|
901
|
+
);
|
|
902
|
+
}
|
|
903
|
+
};
|
|
904
|
+
var drawLandscapeGrid = (grid) => {
|
|
905
|
+
const { ctx, gridTop, innerW, labels, left, rightEdge, scale, texts } = grid;
|
|
906
|
+
const slot2 = left + 0.34 * innerW;
|
|
907
|
+
const slot3 = left + 0.6 * innerW;
|
|
908
|
+
const labelRow1 = gridTop + 12 * scale;
|
|
909
|
+
const valueRow1 = gridTop + 44 * scale;
|
|
910
|
+
const labelRow2 = gridTop + 72 * scale;
|
|
911
|
+
const valueRow2 = gridTop + 98 * scale;
|
|
912
|
+
if (texts.elevation.length > 0) {
|
|
913
|
+
gridLabel(grid, labels.altitude, left, labelRow1);
|
|
914
|
+
gridValue(grid, texts.elevation, left, valueRow1, "left", 30);
|
|
915
|
+
}
|
|
916
|
+
if (texts.slope.length > 0) {
|
|
917
|
+
gridLabel(grid, labels.gradient, slot2, labelRow1);
|
|
918
|
+
gradientChip(grid, slot2, valueRow1);
|
|
919
|
+
}
|
|
920
|
+
if (texts.speed.length > 0) {
|
|
921
|
+
gridLabel(grid, labels.speed, slot3, labelRow1);
|
|
922
|
+
gridValue(grid, texts.speed, slot3, valueRow1, "left");
|
|
923
|
+
}
|
|
924
|
+
if (texts.remaining.length > 0) {
|
|
925
|
+
gridLabel(grid, labels.toGo, rightEdge, labelRow1, "right");
|
|
926
|
+
gridValue(grid, texts.remaining, rightEdge, valueRow1, "right");
|
|
927
|
+
}
|
|
928
|
+
if (texts.ascent.length > 0) {
|
|
929
|
+
gridLabel(grid, labels.dPlus, left, labelRow2);
|
|
930
|
+
dPlusValue(grid, left, valueRow2);
|
|
931
|
+
}
|
|
932
|
+
if (texts.distance.length > 0) {
|
|
933
|
+
gridLabel(grid, labels.distance, rightEdge, labelRow2, "right");
|
|
934
|
+
gridValue(grid, texts.distance, rightEdge, valueRow2, "right", 20);
|
|
935
|
+
}
|
|
936
|
+
if (texts.toSummit.length > 0) {
|
|
937
|
+
gridLabel(grid, labels.toSummit, slot2, labelRow2);
|
|
938
|
+
gridValue(grid, texts.toSummit, slot2, valueRow2, "left", 20);
|
|
939
|
+
} else if (texts.category) {
|
|
940
|
+
const captionFont = overlayFont(400, 15, scale);
|
|
941
|
+
const reserved = texts.distance.length > 0 ? measureTextWidth(ctx, texts.distance, overlayFont(700, 20, scale)) : 0;
|
|
942
|
+
const captionMax = rightEdge - reserved - 16 * scale - slot2;
|
|
943
|
+
drawText(ctx, ellipsize(ctx, texts.category, captionFont, captionMax), slot2, valueRow2, {
|
|
944
|
+
align: "left",
|
|
945
|
+
color: overlayPalette.secondaryText,
|
|
946
|
+
font: captionFont
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
var drawPortraitGrid = (grid) => {
|
|
951
|
+
const { ctx, gridTop, innerW, labels, left, rightEdge, scale, texts } = grid;
|
|
952
|
+
const slot2 = left + 0.42 * innerW;
|
|
953
|
+
const labelRow1 = gridTop + 12 * scale;
|
|
954
|
+
const valueRow1 = gridTop + 44 * scale;
|
|
955
|
+
const labelRow2 = gridTop + 72 * scale;
|
|
956
|
+
const valueRow2 = gridTop + 98 * scale;
|
|
957
|
+
const captionRow = gridTop + 126 * scale;
|
|
958
|
+
if (texts.elevation.length > 0) {
|
|
959
|
+
gridLabel(grid, labels.altitude, left, labelRow1);
|
|
960
|
+
gridValue(grid, texts.elevation, left, valueRow1, "left", 30);
|
|
961
|
+
}
|
|
962
|
+
if (texts.slope.length > 0) {
|
|
963
|
+
gridLabel(grid, labels.gradient, slot2, labelRow1);
|
|
964
|
+
gradientChip(grid, slot2, valueRow1);
|
|
965
|
+
}
|
|
966
|
+
if (texts.remaining.length > 0) {
|
|
967
|
+
gridLabel(grid, labels.toGo, rightEdge, labelRow1, "right");
|
|
968
|
+
gridValue(grid, texts.remaining, rightEdge, valueRow1, "right");
|
|
969
|
+
}
|
|
970
|
+
if (texts.ascent.length > 0) {
|
|
971
|
+
gridLabel(grid, labels.dPlus, left, labelRow2);
|
|
972
|
+
dPlusValue(grid, left, valueRow2);
|
|
973
|
+
}
|
|
974
|
+
if (texts.speed.length > 0) {
|
|
975
|
+
gridLabel(grid, labels.speed, slot2, labelRow2);
|
|
976
|
+
gridValue(grid, texts.speed, slot2, valueRow2, "left", 20);
|
|
977
|
+
}
|
|
978
|
+
if (texts.distance.length > 0) {
|
|
979
|
+
gridLabel(grid, labels.distance, rightEdge, labelRow2, "right");
|
|
980
|
+
gridValue(grid, texts.distance, rightEdge, valueRow2, "right", 20);
|
|
981
|
+
}
|
|
982
|
+
if (texts.toSummit.length > 0) {
|
|
983
|
+
gridLabel(grid, labels.toSummit, left, captionRow);
|
|
984
|
+
gridValue(
|
|
985
|
+
grid,
|
|
986
|
+
texts.toSummit,
|
|
987
|
+
left + measureMicroLabel(ctx, labels.toSummit, scale) + 12 * scale,
|
|
988
|
+
captionRow,
|
|
989
|
+
"left",
|
|
990
|
+
16
|
|
991
|
+
);
|
|
992
|
+
} else if (texts.category) {
|
|
993
|
+
const captionFont = overlayFont(400, 14, scale);
|
|
994
|
+
drawText(ctx, ellipsize(ctx, texts.category, captionFont, rightEdge - left), left, captionRow, {
|
|
995
|
+
align: "left",
|
|
996
|
+
color: overlayPalette.secondaryText,
|
|
997
|
+
font: captionFont
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
var graph = (ctx, sample, curve, dims, format) => {
|
|
1002
|
+
const scale = overlayScale(dims.width, dims.height);
|
|
1003
|
+
const portrait = dims.height > dims.width;
|
|
1004
|
+
const square = dims.width === dims.height;
|
|
1005
|
+
const covered = clamp01(alongFlight(sample, curve.totalKm));
|
|
1006
|
+
const marginX = 28 * scale;
|
|
1007
|
+
const marginBottom = (portrait ? 72 : square ? 40 : 28) * scale;
|
|
1008
|
+
const panelW = dims.width - marginX * 2;
|
|
1009
|
+
const panelH = (portrait ? 326 : 300) * scale;
|
|
1010
|
+
const panelX = marginX;
|
|
1011
|
+
const panelY = dims.height - marginBottom - panelH;
|
|
1012
|
+
const radius = 20 * scale;
|
|
1013
|
+
const pad = 24 * scale;
|
|
1014
|
+
ctx.save();
|
|
1015
|
+
fillRoundedRect(ctx, panelX, panelY, panelW, panelH, radius, overlayPalette.panel);
|
|
1016
|
+
roundedRectPath(ctx, panelX, panelY, panelW, panelH, radius);
|
|
1017
|
+
ctx.lineWidth = Math.max(1, 1.5 * scale);
|
|
1018
|
+
ctx.strokeStyle = overlayPalette.hairline;
|
|
1019
|
+
ctx.stroke();
|
|
1020
|
+
const left = panelX + pad;
|
|
1021
|
+
const rightEdge = panelX + panelW - pad;
|
|
1022
|
+
drawOverline(ctx, sample, curve, format, {
|
|
1023
|
+
baseline: panelY + pad + 14 * scale,
|
|
1024
|
+
covered,
|
|
1025
|
+
left,
|
|
1026
|
+
panelW,
|
|
1027
|
+
rightEdge,
|
|
1028
|
+
scale
|
|
1029
|
+
});
|
|
1030
|
+
const curveTop = panelY + pad + 26 * scale;
|
|
1031
|
+
const curveH = 108 * scale;
|
|
1032
|
+
const curveRect = {
|
|
1033
|
+
h: curveH,
|
|
1034
|
+
w: panelW - pad * 2,
|
|
1035
|
+
x: panelX + pad,
|
|
1036
|
+
y: curveTop
|
|
1037
|
+
};
|
|
1038
|
+
if (curve.points.length >= 2) {
|
|
1039
|
+
drawCurve(ctx, covered, curve, curveRect, format, scale);
|
|
1040
|
+
}
|
|
1041
|
+
const grid = {
|
|
1042
|
+
ctx,
|
|
1043
|
+
// The axis strip (baked under the curve) pushes the readout grid down by its
|
|
1044
|
+
// height, so the rows clear the tick labels at every scale.
|
|
1045
|
+
gridTop: curveTop + curveH + 24 * scale,
|
|
1046
|
+
innerW: panelW - pad * 2,
|
|
1047
|
+
labels: chunkPLMVBX2A_cjs.videoOverlayStringsFor(format.language),
|
|
1048
|
+
left,
|
|
1049
|
+
rightEdge,
|
|
1050
|
+
scale,
|
|
1051
|
+
slopeDeg: sample.slopeDeg,
|
|
1052
|
+
texts: graphReadouts(sample, curve, format)
|
|
1053
|
+
};
|
|
1054
|
+
if (portrait) {
|
|
1055
|
+
drawPortraitGrid(grid);
|
|
1056
|
+
} else {
|
|
1057
|
+
drawLandscapeGrid(grid);
|
|
1058
|
+
}
|
|
1059
|
+
ctx.restore();
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
// src/video/profileOverlay/rules/minimalDesign.ts
|
|
1063
|
+
var MINIMAL_PANEL_HEIGHT_PX = 56;
|
|
1064
|
+
var minimal = (ctx, sample, curve, dims, format) => {
|
|
1065
|
+
const scale = overlayScale(dims.width, dims.height);
|
|
1066
|
+
const portrait = dims.height > dims.width;
|
|
1067
|
+
const square = dims.width === dims.height;
|
|
1068
|
+
const labels = chunkPLMVBX2A_cjs.videoOverlayStringsFor(format.language);
|
|
1069
|
+
const marginX = 28 * scale;
|
|
1070
|
+
const marginBottom = (portrait ? 64 : square ? 36 : 24) * scale;
|
|
1071
|
+
const panelH = MINIMAL_PANEL_HEIGHT_PX * scale;
|
|
1072
|
+
const panelY = dims.height - marginBottom - panelH;
|
|
1073
|
+
const pad = 16 * scale;
|
|
1074
|
+
const gap = 12 * scale;
|
|
1075
|
+
const remaining = curve.totalKm !== null ? chunkMLVUWEZR_cjs.formatDistance(
|
|
1076
|
+
Math.max(0, curve.totalKm - sample.distanceKm) * chunkAG6JV5Z2_cjs.METERS_PER_KILOMETER,
|
|
1077
|
+
format
|
|
1078
|
+
) : "";
|
|
1079
|
+
const valueText = remaining.length > 0 ? remaining : chunkMLVUWEZR_cjs.formatDistance(sample.distanceKm * chunkAG6JV5Z2_cjs.METERS_PER_KILOMETER, format);
|
|
1080
|
+
const valueLabel = remaining.length > 0 ? labels.toGo : labels.distance;
|
|
1081
|
+
const valueFont = overlayFont(700, 24, scale);
|
|
1082
|
+
const slopeText = chunkMLVUWEZR_cjs.formatSlope(sample.slopeDeg, format);
|
|
1083
|
+
const badgeText = sample.climbCategory !== null ? formatClimbBadge(sample.climbCategory, sample.climbAvgGradePercent, format) : "";
|
|
1084
|
+
const chipFont = overlayFont(700, 16, scale);
|
|
1085
|
+
const chipWidth = slopeText.length > 0 ? measureTextWidth(ctx, slopeText, chipFont) + 2 * 10 * scale : 0;
|
|
1086
|
+
const badgeFont = overlayFont(700, 12, scale);
|
|
1087
|
+
const badgeWidth = badgeText.length > 0 ? measureTextWidth(ctx, badgeText, badgeFont) + 2 * 8 * scale : 0;
|
|
1088
|
+
const valueWidth = measureTextWidth(ctx, valueText, valueFont);
|
|
1089
|
+
const labelWidth = measureMicroLabel(ctx, valueLabel, scale);
|
|
1090
|
+
let contentWidth = valueWidth + gap * 0.7 + labelWidth;
|
|
1091
|
+
if (chipWidth > 0) {
|
|
1092
|
+
contentWidth += chipWidth + gap;
|
|
1093
|
+
}
|
|
1094
|
+
if (badgeWidth > 0) {
|
|
1095
|
+
contentWidth += badgeWidth + gap;
|
|
1096
|
+
}
|
|
1097
|
+
const panelW = contentWidth + pad * 2;
|
|
1098
|
+
const panelX = marginX;
|
|
1099
|
+
const radius = panelH / 2;
|
|
1100
|
+
ctx.save();
|
|
1101
|
+
fillRoundedRect(ctx, panelX, panelY, panelW, panelH, radius, overlayPalette.panel);
|
|
1102
|
+
roundedRectPath(ctx, panelX, panelY, panelW, panelH, radius);
|
|
1103
|
+
ctx.lineWidth = Math.max(1, 1.5 * scale);
|
|
1104
|
+
ctx.strokeStyle = overlayPalette.hairline;
|
|
1105
|
+
ctx.stroke();
|
|
1106
|
+
const baseline = panelY + panelH * 0.66;
|
|
1107
|
+
let cursor = panelX + pad;
|
|
1108
|
+
if (slopeText.length > 0) {
|
|
1109
|
+
cursor += drawChip(ctx, slopeText, cursor, panelY + (panelH - 28 * scale) / 2, scale, {
|
|
1110
|
+
bg: slopeBandColor(sample.slopeDeg),
|
|
1111
|
+
fg: slopeBandTextColor(sample.slopeDeg),
|
|
1112
|
+
fontPx: 16,
|
|
1113
|
+
heightPx: 28,
|
|
1114
|
+
padPx: 10
|
|
1115
|
+
}) + gap;
|
|
1116
|
+
}
|
|
1117
|
+
drawText(ctx, valueText, cursor, baseline, {
|
|
1118
|
+
align: "left",
|
|
1119
|
+
color: overlayPalette.primaryText,
|
|
1120
|
+
font: valueFont
|
|
1121
|
+
});
|
|
1122
|
+
cursor += valueWidth + gap * 0.7;
|
|
1123
|
+
drawMicroLabel(ctx, valueLabel, cursor, baseline, scale, overlayPalette.labelText);
|
|
1124
|
+
cursor += labelWidth + gap;
|
|
1125
|
+
if (badgeText.length > 0) {
|
|
1126
|
+
const severe = sample.climbCategory === "hc" || sample.climbCategory === "1";
|
|
1127
|
+
drawChip(ctx, badgeText, cursor, panelY + (panelH - 20 * scale) / 2, scale, {
|
|
1128
|
+
bg: severe ? overlayPalette.badgeHc : overlayPalette.badgeCat,
|
|
1129
|
+
fg: severe ? overlayPalette.primaryText : overlayPalette.badgeDarkText,
|
|
1130
|
+
fontPx: 12,
|
|
1131
|
+
heightPx: 20,
|
|
1132
|
+
padPx: 8
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
ctx.restore();
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
// src/video/profileOverlay/rules/stripDesign.ts
|
|
1139
|
+
var drawValueRow = (band) => {
|
|
1140
|
+
const { bandY, ctx, format, innerW, labels, left, right, sample, scale } = band;
|
|
1141
|
+
const labelRow = bandY + 26 * scale;
|
|
1142
|
+
const valueRow = bandY + 56 * scale;
|
|
1143
|
+
const valueFont = overlayFont(700, 22, scale);
|
|
1144
|
+
const cell = (label, value, x, align) => {
|
|
1145
|
+
if (value.length === 0) {
|
|
1146
|
+
return;
|
|
1147
|
+
}
|
|
1148
|
+
drawMicroLabel(ctx, label, x, labelRow, scale, overlayPalette.labelText, align);
|
|
1149
|
+
drawText(ctx, value, x, valueRow, {
|
|
1150
|
+
align,
|
|
1151
|
+
color: overlayPalette.primaryText,
|
|
1152
|
+
font: valueFont
|
|
1153
|
+
});
|
|
1154
|
+
};
|
|
1155
|
+
const ascentText = chunkMLVUWEZR_cjs.formatElevation(sample.ascentM, format);
|
|
1156
|
+
cell(
|
|
1157
|
+
labels.distance,
|
|
1158
|
+
chunkMLVUWEZR_cjs.formatDistance(sample.distanceKm * chunkAG6JV5Z2_cjs.METERS_PER_KILOMETER, format),
|
|
1159
|
+
left,
|
|
1160
|
+
"left"
|
|
1161
|
+
);
|
|
1162
|
+
cell(labels.dPlus, ascentText.length > 0 ? `+${ascentText}` : "", left + 0.22 * innerW, "left");
|
|
1163
|
+
cell(labels.altitude, chunkMLVUWEZR_cjs.formatElevation(sample.elevation, format), left + 0.42 * innerW, "left");
|
|
1164
|
+
const slopeText = chunkMLVUWEZR_cjs.formatSlope(sample.slopeDeg, format);
|
|
1165
|
+
if (slopeText.length > 0) {
|
|
1166
|
+
const slotSlope = left + 0.62 * innerW;
|
|
1167
|
+
drawMicroLabel(ctx, labels.gradient, slotSlope, labelRow, scale, overlayPalette.labelText);
|
|
1168
|
+
drawChip(ctx, slopeText, slotSlope, valueRow - 19 * scale, scale, {
|
|
1169
|
+
bg: slopeBandColor(sample.slopeDeg),
|
|
1170
|
+
fg: slopeBandTextColor(sample.slopeDeg),
|
|
1171
|
+
fontPx: 16,
|
|
1172
|
+
heightPx: 28,
|
|
1173
|
+
padPx: 10
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
cell(labels.speed, chunkMLVUWEZR_cjs.formatSpeed(speedKilometersPerHour(sample.speed), format), right, "right");
|
|
1177
|
+
};
|
|
1178
|
+
var drawProgressBar = (band, covered) => {
|
|
1179
|
+
const { bandY, ctx, curve, innerW, left, scale } = band;
|
|
1180
|
+
const barY = bandY + 76 * scale;
|
|
1181
|
+
const barH = 6 * scale;
|
|
1182
|
+
const barW = innerW;
|
|
1183
|
+
const fillWidth = barW * covered;
|
|
1184
|
+
const bar = acquireBandBar(curve, barW, barH, overlayPalette);
|
|
1185
|
+
if (bar) {
|
|
1186
|
+
ctx.drawImage(bar.dim, left, barY);
|
|
1187
|
+
if (fillWidth > 0) {
|
|
1188
|
+
ctx.save();
|
|
1189
|
+
ctx.beginPath();
|
|
1190
|
+
ctx.rect(left, barY, fillWidth, barH);
|
|
1191
|
+
ctx.clip();
|
|
1192
|
+
ctx.drawImage(bar.bright, left, barY);
|
|
1193
|
+
ctx.restore();
|
|
1194
|
+
}
|
|
1195
|
+
} else {
|
|
1196
|
+
paintBandBar(ctx, curve, left, barY, barW, barH, BAND_BAR_DIM_ALPHA, overlayPalette);
|
|
1197
|
+
if (fillWidth > 0) {
|
|
1198
|
+
ctx.save();
|
|
1199
|
+
ctx.beginPath();
|
|
1200
|
+
ctx.rect(left, barY, fillWidth, barH);
|
|
1201
|
+
ctx.clip();
|
|
1202
|
+
paintBandBar(ctx, curve, left, barY, barW, barH, 1, overlayPalette);
|
|
1203
|
+
ctx.restore();
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
const tickHeight = 12 * scale;
|
|
1207
|
+
const tickWidth = 2 * scale;
|
|
1208
|
+
const tickY = barY + barH / 2 - tickHeight / 2;
|
|
1209
|
+
for (const tickX of [left, left + barW]) {
|
|
1210
|
+
fillRoundedRect(
|
|
1211
|
+
ctx,
|
|
1212
|
+
tickX - tickWidth / 2,
|
|
1213
|
+
tickY,
|
|
1214
|
+
tickWidth,
|
|
1215
|
+
tickHeight,
|
|
1216
|
+
0,
|
|
1217
|
+
overlayPalette.hairlineStrong
|
|
1218
|
+
);
|
|
1219
|
+
}
|
|
1220
|
+
const riderX = left + fillWidth;
|
|
1221
|
+
const riderY = barY + barH / 2;
|
|
1222
|
+
ctx.beginPath();
|
|
1223
|
+
ctx.arc(riderX, riderY, Math.max(2, 9 * scale), 0, Math.PI * 2);
|
|
1224
|
+
ctx.fillStyle = overlayPalette.accentHalo;
|
|
1225
|
+
ctx.fill();
|
|
1226
|
+
ctx.beginPath();
|
|
1227
|
+
ctx.arc(riderX, riderY, Math.max(1.5, 5 * scale), 0, Math.PI * 2);
|
|
1228
|
+
ctx.fillStyle = overlayPalette.accent;
|
|
1229
|
+
ctx.fill();
|
|
1230
|
+
ctx.lineWidth = Math.max(1, 1.5 * scale);
|
|
1231
|
+
ctx.strokeStyle = overlayPalette.primaryText;
|
|
1232
|
+
ctx.stroke();
|
|
1233
|
+
};
|
|
1234
|
+
var drawCaptionRow = (band, covered) => {
|
|
1235
|
+
const { bandY, ctx, curve, format, labels, left, right, sample, scale } = band;
|
|
1236
|
+
const captionRow = bandY + 114 * scale;
|
|
1237
|
+
const captionFont = overlayFont(400, 14, scale);
|
|
1238
|
+
const labelGap = 6 * scale;
|
|
1239
|
+
if (sample.climbCategory !== null) {
|
|
1240
|
+
const severe = sample.climbCategory === "hc" || sample.climbCategory === "1";
|
|
1241
|
+
const badgeWidth = drawChip(
|
|
1242
|
+
ctx,
|
|
1243
|
+
formatClimbBadge(sample.climbCategory, sample.climbAvgGradePercent, format),
|
|
1244
|
+
left,
|
|
1245
|
+
captionRow - 15 * scale,
|
|
1246
|
+
scale,
|
|
1247
|
+
{
|
|
1248
|
+
bg: severe ? overlayPalette.badgeHc : overlayPalette.badgeCat,
|
|
1249
|
+
fg: severe ? overlayPalette.primaryText : overlayPalette.badgeDarkText,
|
|
1250
|
+
fontPx: 12,
|
|
1251
|
+
heightPx: 20,
|
|
1252
|
+
padPx: 8
|
|
1253
|
+
}
|
|
1254
|
+
);
|
|
1255
|
+
if (sample.climbEndKm !== null) {
|
|
1256
|
+
const labelX = left + badgeWidth + 10 * scale;
|
|
1257
|
+
drawMicroLabel(ctx, labels.toSummit, labelX, captionRow, scale, overlayPalette.labelText);
|
|
1258
|
+
drawText(
|
|
1259
|
+
ctx,
|
|
1260
|
+
chunkMLVUWEZR_cjs.formatDistance(
|
|
1261
|
+
Math.max(0, sample.climbEndKm - sample.distanceKm) * chunkAG6JV5Z2_cjs.METERS_PER_KILOMETER,
|
|
1262
|
+
format
|
|
1263
|
+
),
|
|
1264
|
+
labelX + measureMicroLabel(ctx, labels.toSummit, scale) + labelGap,
|
|
1265
|
+
captionRow,
|
|
1266
|
+
{ align: "left", color: overlayPalette.secondaryText, font: captionFont }
|
|
1267
|
+
);
|
|
1268
|
+
}
|
|
1269
|
+
} else {
|
|
1270
|
+
const categoryText = joinCategories(sample.surface, sample.waytype);
|
|
1271
|
+
if (categoryText) {
|
|
1272
|
+
drawText(ctx, categoryText, left, captionRow, {
|
|
1273
|
+
align: "left",
|
|
1274
|
+
color: overlayPalette.secondaryText,
|
|
1275
|
+
font: captionFont
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
const accentFont = overlayFont(700, 14, scale);
|
|
1280
|
+
let cursor = right;
|
|
1281
|
+
if (curve.totalKm !== null) {
|
|
1282
|
+
const remainingText = chunkMLVUWEZR_cjs.formatDistance(
|
|
1283
|
+
Math.max(0, curve.totalKm - sample.distanceKm) * chunkAG6JV5Z2_cjs.METERS_PER_KILOMETER,
|
|
1284
|
+
format
|
|
1285
|
+
);
|
|
1286
|
+
drawText(ctx, remainingText, cursor, captionRow, {
|
|
1287
|
+
align: "right",
|
|
1288
|
+
color: overlayPalette.primaryText,
|
|
1289
|
+
font: accentFont
|
|
1290
|
+
});
|
|
1291
|
+
cursor -= measureTextWidth(ctx, remainingText, accentFont) + labelGap;
|
|
1292
|
+
drawMicroLabel(ctx, labels.toGo, cursor, captionRow, scale, overlayPalette.labelText, "right");
|
|
1293
|
+
cursor -= measureMicroLabel(ctx, labels.toGo, scale);
|
|
1294
|
+
const middot = " \xB7 ";
|
|
1295
|
+
drawText(ctx, middot, cursor, captionRow, {
|
|
1296
|
+
align: "right",
|
|
1297
|
+
color: overlayPalette.secondaryText,
|
|
1298
|
+
font: accentFont
|
|
1299
|
+
});
|
|
1300
|
+
cursor -= measureTextWidth(ctx, middot, accentFont);
|
|
1301
|
+
}
|
|
1302
|
+
drawText(ctx, chunkMLVUWEZR_cjs.formatProportion(covered, format), cursor, captionRow, {
|
|
1303
|
+
align: "right",
|
|
1304
|
+
color: overlayPalette.accent,
|
|
1305
|
+
font: accentFont
|
|
1306
|
+
});
|
|
1307
|
+
};
|
|
1308
|
+
var strip = (ctx, sample, curve, dims, format) => {
|
|
1309
|
+
const scale = overlayScale(dims.width, dims.height);
|
|
1310
|
+
const portrait = dims.height > dims.width;
|
|
1311
|
+
const square = dims.width === dims.height;
|
|
1312
|
+
const marginX = 24 * scale;
|
|
1313
|
+
const marginBottom = (portrait ? 64 : square ? 36 : 24) * scale;
|
|
1314
|
+
const bandW = dims.width - marginX * 2;
|
|
1315
|
+
const bandH = 132 * scale;
|
|
1316
|
+
const bandX = marginX;
|
|
1317
|
+
const bandY = dims.height - marginBottom - bandH;
|
|
1318
|
+
const radius = 16 * scale;
|
|
1319
|
+
const pad = 22 * scale;
|
|
1320
|
+
const covered = clamp01(alongFlight(sample, curve.totalKm));
|
|
1321
|
+
ctx.save();
|
|
1322
|
+
fillRoundedRect(ctx, bandX, bandY, bandW, bandH, radius, overlayPalette.panel);
|
|
1323
|
+
const band = {
|
|
1324
|
+
bandY,
|
|
1325
|
+
ctx,
|
|
1326
|
+
curve,
|
|
1327
|
+
format,
|
|
1328
|
+
innerW: bandW - pad * 2,
|
|
1329
|
+
labels: chunkPLMVBX2A_cjs.videoOverlayStringsFor(format.language),
|
|
1330
|
+
left: bandX + pad,
|
|
1331
|
+
right: bandX + bandW - pad,
|
|
1332
|
+
sample,
|
|
1333
|
+
scale
|
|
1334
|
+
};
|
|
1335
|
+
drawValueRow(band);
|
|
1336
|
+
drawProgressBar(band, covered);
|
|
1337
|
+
drawCaptionRow(band, covered);
|
|
1338
|
+
roundedRectPath(ctx, bandX, bandY, bandW, bandH, radius);
|
|
1339
|
+
ctx.lineWidth = Math.max(1, 1.5 * scale);
|
|
1340
|
+
ctx.strokeStyle = overlayPalette.hairline;
|
|
1341
|
+
ctx.stroke();
|
|
1342
|
+
ctx.restore();
|
|
1343
|
+
};
|
|
1344
|
+
|
|
1345
|
+
// src/video/profileOverlay/rules/registry.ts
|
|
1346
|
+
var profileOverlayDesigns = {
|
|
1347
|
+
graph,
|
|
1348
|
+
minimal,
|
|
1349
|
+
strip
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1352
|
+
// src/video/rules/videoEncoder.ts
|
|
1353
|
+
var loadMediabunny = async () => {
|
|
1354
|
+
try {
|
|
1355
|
+
return await import('mediabunny');
|
|
1356
|
+
} catch (cause) {
|
|
1357
|
+
throw new chunkISLB6Y5Q_cjs.MountayaElementsError(
|
|
1358
|
+
"Recording needs the optional peer mediabunny, and it did not load. Install it if it is missing, or pass your own encoderFactory to the recorder. What the import threw is this error's cause.",
|
|
1359
|
+
{ cause }
|
|
1360
|
+
);
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
var codecFor = (format) => {
|
|
1364
|
+
switch (format) {
|
|
1365
|
+
case "webm-vp9":
|
|
1366
|
+
return "vp9";
|
|
1367
|
+
case "webm-vp8":
|
|
1368
|
+
return "vp8";
|
|
1369
|
+
default:
|
|
1370
|
+
return "avc";
|
|
1371
|
+
}
|
|
1372
|
+
};
|
|
1373
|
+
var containerFor = async (format) => {
|
|
1374
|
+
const { Mp4OutputFormat, WebMOutputFormat } = await loadMediabunny();
|
|
1375
|
+
const extension = chunkXOHAXXZA_cjs.containerExtension(format);
|
|
1376
|
+
return {
|
|
1377
|
+
extension,
|
|
1378
|
+
format: extension === "webm" ? new WebMOutputFormat() : new Mp4OutputFormat()
|
|
1379
|
+
};
|
|
1380
|
+
};
|
|
1381
|
+
var AVC_MACROBLOCK_PX = 16;
|
|
1382
|
+
var AVC_PROBE_FPS = Math.max(...chunkFRGAV6N6_cjs.CAMERA_FPS);
|
|
1383
|
+
var AVC_HIGH_LEVELS = [
|
|
1384
|
+
{ codec: "avc1.64002a", macroblocksPerSecond: 522240 },
|
|
1385
|
+
{ codec: "avc1.640033", macroblocksPerSecond: 983040 },
|
|
1386
|
+
{ codec: "avc1.640034", macroblocksPerSecond: 2073600 }
|
|
1387
|
+
];
|
|
1388
|
+
var avcProbeCodec = (dimensions) => {
|
|
1389
|
+
const macroblocks = Math.ceil(dimensions.width / AVC_MACROBLOCK_PX) * Math.ceil(dimensions.height / AVC_MACROBLOCK_PX);
|
|
1390
|
+
const level = AVC_HIGH_LEVELS.find(
|
|
1391
|
+
({ macroblocksPerSecond }) => macroblocks * AVC_PROBE_FPS <= macroblocksPerSecond
|
|
1392
|
+
) ?? AVC_HIGH_LEVELS.at(-1);
|
|
1393
|
+
return level?.codec ?? "avc1.640034";
|
|
1394
|
+
};
|
|
1395
|
+
var resolveHardwareAcceleration = async (format, dimensions) => {
|
|
1396
|
+
if (typeof VideoEncoder === "undefined" || codecFor(format) !== "avc") {
|
|
1397
|
+
return "no-preference";
|
|
1398
|
+
}
|
|
1399
|
+
try {
|
|
1400
|
+
const support = await VideoEncoder.isConfigSupported({
|
|
1401
|
+
// The level that holds this frame: the probe asks whether the hardware path is offered
|
|
1402
|
+
// for the recording's own size.
|
|
1403
|
+
codec: avcProbeCodec(dimensions),
|
|
1404
|
+
hardwareAcceleration: "prefer-hardware",
|
|
1405
|
+
height: dimensions.height,
|
|
1406
|
+
width: dimensions.width
|
|
1407
|
+
});
|
|
1408
|
+
return support.supported === true ? "prefer-hardware" : "no-preference";
|
|
1409
|
+
} catch {
|
|
1410
|
+
return "no-preference";
|
|
1411
|
+
}
|
|
1412
|
+
};
|
|
1413
|
+
var createVideoEncoder = async (canvas, dimensions, output) => {
|
|
1414
|
+
const { BufferTarget, CanvasSource, Output } = await loadMediabunny();
|
|
1415
|
+
const container = await containerFor(output.format);
|
|
1416
|
+
const target = new BufferTarget();
|
|
1417
|
+
const muxer = new Output({ format: container.format, target });
|
|
1418
|
+
const hardwareAcceleration = await resolveHardwareAcceleration(output.format, dimensions);
|
|
1419
|
+
const source = new CanvasSource(canvas, {
|
|
1420
|
+
bitrate: resolveBitrateBps(output),
|
|
1421
|
+
bitrateMode: "variable",
|
|
1422
|
+
codec: codecFor(output.format),
|
|
1423
|
+
hardwareAcceleration,
|
|
1424
|
+
latencyMode: "quality"
|
|
1425
|
+
});
|
|
1426
|
+
muxer.addVideoTrack(source, { frameRate: output.fps });
|
|
1427
|
+
await muxer.start();
|
|
1428
|
+
return {
|
|
1429
|
+
addFrame: (timestampSeconds, durationSeconds) => source.add(timestampSeconds, durationSeconds),
|
|
1430
|
+
cancel: () => muxer.cancel(),
|
|
1431
|
+
extension: container.extension,
|
|
1432
|
+
finalize: async () => {
|
|
1433
|
+
await muxer.finalize();
|
|
1434
|
+
const buffer = target.buffer ?? new ArrayBuffer(0);
|
|
1435
|
+
const mimeType = await muxer.getMimeType();
|
|
1436
|
+
return new Blob([buffer], { type: mimeType });
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1439
|
+
};
|
|
1440
|
+
|
|
1441
|
+
// src/video/rules/watermarkMark.ts
|
|
1442
|
+
var WATERMARK_URL = "data:image/svg+xml,%3Csvg fill='none' height='58' viewBox='0 0 138 58' width='138' xmlns='http://www.w3.org/2000/svg'%3E%3Cg filter='url(%23filter0_d_2_311)' opacity='0.9'%3E%3Cpath d='M22.6748 16.2338C26.3612 16.2338 29.3494 19.2222 29.3496 22.9086C29.3496 24.3563 28.9225 25.509 28.168 26.6127L22.6973 21.0385L17.2021 26.6361C16.4372 25.5235 16 24.3614 16 22.9086C16.0002 19.2223 18.9885 16.2339 22.6748 16.2338Z' fill='url(%23paint0_linear_2_311)'/%3E%3Cpath d='M22.7593 21.1075L28.1636 26.6134C26.9967 28.3197 25.0463 29.9084 22.6714 32.2833C22.5466 32.1585 22.4219 32.0368 22.2993 31.9161C21.9246 31.4137 21.522 30.5283 21.522 29.1368C21.5224 27.0753 23.9446 26.2887 23.9448 24.0782C23.9448 22.3917 23.1936 21.5524 22.7593 21.1075Z' fill='url(%23paint1_linear_2_311)'/%3E%3Cpath d='M49.5544 30H47.2489L46.2159 23.1734L43.0871 29.985H42.5331L39.4043 23.1734L38.3713 30H36.0658L37.7126 19.5205H39.9732L42.8176 25.9579L45.662 19.5205H47.9376L49.5544 30ZM54.8955 30.2395C52.3954 30.2395 50.5241 28.3981 50.5241 25.9579C50.5241 23.5177 52.3954 21.6913 54.8955 21.6913C57.3957 21.6913 59.267 23.5177 59.267 25.9579C59.267 28.3981 57.3957 30.2395 54.8955 30.2395ZM54.8955 28.1736C56.1531 28.1736 57.0513 27.2753 57.0513 25.9579C57.0513 24.6555 56.1531 23.7422 54.8955 23.7422C53.638 23.7422 52.7398 24.6555 52.7398 25.9579C52.7398 27.2753 53.638 28.1736 54.8955 28.1736ZM64.5265 30.2395C62.251 30.2395 60.7239 28.7724 60.7239 26.5867V21.9158H62.9097V26.3471C62.9097 27.4999 63.5235 28.1736 64.5265 28.1736C65.5445 28.1736 66.1433 27.4849 66.1433 26.3471V21.9158H68.3291V26.5867C68.3291 28.7724 66.817 30.2395 64.5265 30.2395ZM74.9134 21.7362C76.7547 21.7362 77.9075 23.0536 77.9075 25.1046V30H75.7218V25.4639C75.7218 24.2363 75.2577 23.6524 74.3145 23.6524C73.1917 23.6524 72.5031 24.4608 72.5031 25.7633V30H70.3174V21.9158H71.8144L72.2336 22.9189C72.8474 22.2003 73.8205 21.7362 74.9134 21.7362ZM83.8017 28.0538H84.7898V30H83.2329C81.4513 30 80.3585 28.9071 80.3585 27.1256V23.6824H78.9063V23.2033L82.0951 19.8199H82.5143V21.9158H84.7449V23.6824H82.5442V26.8262C82.5442 27.6047 82.9933 28.0538 83.8017 28.0538ZM92.7962 21.9158H94.428V30H92.7213L92.5267 29.2664C91.8381 29.8802 90.9398 30.2395 89.9069 30.2395C87.4816 30.2395 85.6702 28.3981 85.6702 25.9579C85.6702 23.5177 87.4816 21.6913 89.9069 21.6913C90.9548 21.6913 91.868 22.0655 92.5716 22.6793L92.7962 21.9158ZM90.0865 28.1736C91.359 28.1736 92.2872 27.2304 92.2872 25.9579C92.2872 24.6854 91.359 23.7422 90.0865 23.7422C88.814 23.7422 87.8858 24.6854 87.8858 25.9579C87.8858 27.2155 88.814 28.1736 90.0865 28.1736ZM102.129 21.9158H104.45L100.932 29.8952C99.9586 32.0959 99.1053 32.9193 97.2938 32.9193H96.3956V30.9581H97.1441C98.2071 30.9581 98.4765 30.6737 98.9706 29.4461L99.0005 29.3862L95.5722 21.9158H97.9526L100.108 26.9011L102.129 21.9158ZM111.802 21.9158H113.434V30H111.727L111.532 29.2664C110.844 29.8802 109.946 30.2395 108.913 30.2395C106.487 30.2395 104.676 28.3981 104.676 25.9579C104.676 23.5177 106.487 21.6913 108.913 21.6913C109.961 21.6913 110.874 22.0655 111.577 22.6793L111.802 21.9158ZM109.092 28.1736C110.365 28.1736 111.293 27.2304 111.293 25.9579C111.293 24.6854 110.365 23.7422 109.092 23.7422C107.82 23.7422 106.892 24.6854 106.892 25.9579C106.892 27.2155 107.82 28.1736 109.092 28.1736Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3Cfilter color-interpolation-filters='sRGB' filterUnits='userSpaceOnUse' height='66.6055' id='filter0_d_2_311' width='148.581' x='-8.2904' y='-8.2904'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix'/%3E%3CfeColorMatrix in='SourceAlpha' result='hardAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' /%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation='12.1452'/%3E%3CfeComposite in2='hardAlpha' operator='out'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.55 0'/%3E%3CfeBlend in2='BackgroundImageFix' mode='normal' result='effect1_dropShadow_2_311'/%3E%3CfeBlend in='SourceGraphic' in2='effect1_dropShadow_2_311' mode='normal' result='shape'/%3E%3C/filter%3E%3ClinearGradient gradientUnits='userSpaceOnUse' id='paint0_linear_2_311' x1='23.7246' x2='22.8662' y1='40.8919' y2='18.575'%3E%3Cstop stop-color='%23090B0E'/%3E%3Cstop offset='1' stop-color='white'/%3E%3C/linearGradient%3E%3ClinearGradient gradientUnits='userSpaceOnUse' id='paint1_linear_2_311' x1='25.8586' x2='22.8826' y1='24.4393' y2='33.6651'%3E%3Cstop stop-color='white'/%3E%3Cstop offset='1' stop-color='%23DDDBDC' stop-opacity='0.6'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E";
|
|
1443
|
+
|
|
1444
|
+
// src/video/rules/videoWatermark.ts
|
|
1445
|
+
var WATERMARK_INTRINSIC_WIDTH = 138;
|
|
1446
|
+
var WATERMARK_INTRINSIC_HEIGHT = 58;
|
|
1447
|
+
var loadWatermarkCanvas = async (shortSidePx, url = WATERMARK_URL) => {
|
|
1448
|
+
try {
|
|
1449
|
+
const image = new Image();
|
|
1450
|
+
image.crossOrigin = "anonymous";
|
|
1451
|
+
await new Promise((resolve, reject) => {
|
|
1452
|
+
image.onload = () => resolve();
|
|
1453
|
+
image.onerror = () => reject(new Error("watermark load failed"));
|
|
1454
|
+
image.src = url;
|
|
1455
|
+
});
|
|
1456
|
+
const intrinsicWidth = image.naturalWidth > 0 ? image.naturalWidth : WATERMARK_INTRINSIC_WIDTH;
|
|
1457
|
+
const intrinsicHeight = image.naturalHeight > 0 ? image.naturalHeight : WATERMARK_INTRINSIC_HEIGHT;
|
|
1458
|
+
const displayWidth = WATERMARK_WIDTH_PX * watermarkScale(shortSidePx, shortSidePx);
|
|
1459
|
+
const scale = displayWidth / intrinsicWidth;
|
|
1460
|
+
const width = Math.max(1, Math.round(intrinsicWidth * scale));
|
|
1461
|
+
const height = Math.max(1, Math.round(intrinsicHeight * scale));
|
|
1462
|
+
const canvas = document.createElement("canvas");
|
|
1463
|
+
canvas.width = width;
|
|
1464
|
+
canvas.height = height;
|
|
1465
|
+
const context = canvas.getContext("2d", { alpha: true });
|
|
1466
|
+
if (!context) {
|
|
1467
|
+
return null;
|
|
1468
|
+
}
|
|
1469
|
+
context.drawImage(image, 0, 0, width, height);
|
|
1470
|
+
return canvas;
|
|
1471
|
+
} catch {
|
|
1472
|
+
return null;
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
var loadFocusGlyphCanvas = async (url, sizePx) => {
|
|
1476
|
+
try {
|
|
1477
|
+
const image = new Image();
|
|
1478
|
+
image.crossOrigin = "anonymous";
|
|
1479
|
+
await new Promise((resolve, reject) => {
|
|
1480
|
+
image.onload = () => resolve();
|
|
1481
|
+
image.onerror = () => reject(new Error("focus glyph load failed"));
|
|
1482
|
+
image.src = url;
|
|
1483
|
+
});
|
|
1484
|
+
const side = Math.max(1, Math.round(sizePx));
|
|
1485
|
+
const canvas = document.createElement("canvas");
|
|
1486
|
+
canvas.width = side;
|
|
1487
|
+
canvas.height = side;
|
|
1488
|
+
const context = canvas.getContext("2d", { alpha: true });
|
|
1489
|
+
if (!context) {
|
|
1490
|
+
return null;
|
|
1491
|
+
}
|
|
1492
|
+
const intrinsicWidth = image.naturalWidth > 0 ? image.naturalWidth : side;
|
|
1493
|
+
const intrinsicHeight = image.naturalHeight > 0 ? image.naturalHeight : side;
|
|
1494
|
+
const scale = Math.min(side / intrinsicWidth, side / intrinsicHeight);
|
|
1495
|
+
const drawWidth = intrinsicWidth * scale;
|
|
1496
|
+
const drawHeight = intrinsicHeight * scale;
|
|
1497
|
+
context.drawImage(
|
|
1498
|
+
image,
|
|
1499
|
+
(side - drawWidth) / 2,
|
|
1500
|
+
(side - drawHeight) / 2,
|
|
1501
|
+
drawWidth,
|
|
1502
|
+
drawHeight
|
|
1503
|
+
);
|
|
1504
|
+
context.globalCompositeOperation = "source-in";
|
|
1505
|
+
context.fillStyle = VIDEO_FOCUS_MARKER_GLYPH_COLOR;
|
|
1506
|
+
context.fillRect(0, 0, side, side);
|
|
1507
|
+
return canvas;
|
|
1508
|
+
} catch {
|
|
1509
|
+
return null;
|
|
1510
|
+
}
|
|
1511
|
+
};
|
|
1512
|
+
var compositeWatermark = (context, watermark, frameWidth, frameHeight) => {
|
|
1513
|
+
if (!watermark) {
|
|
1514
|
+
return;
|
|
1515
|
+
}
|
|
1516
|
+
const inset = WATERMARK_INSET_PX * watermarkScale(frameWidth, frameHeight);
|
|
1517
|
+
context.drawImage(watermark, inset, inset);
|
|
1518
|
+
};
|
|
1519
|
+
|
|
1520
|
+
// src/video/rules/videoRecorder.ts
|
|
1521
|
+
var cancelledResult = (extension) => ({
|
|
1522
|
+
blob: null,
|
|
1523
|
+
cancelled: true,
|
|
1524
|
+
extension
|
|
1525
|
+
});
|
|
1526
|
+
var cancelledRecording = (output) => cancelledResult(chunkXOHAXXZA_cjs.containerExtension(output.format));
|
|
1527
|
+
var unavailableResult = (extension) => ({
|
|
1528
|
+
blob: null,
|
|
1529
|
+
cancelled: true,
|
|
1530
|
+
extension,
|
|
1531
|
+
reason: "unavailable"
|
|
1532
|
+
});
|
|
1533
|
+
var failedResult = (extension, cause) => ({
|
|
1534
|
+
blob: null,
|
|
1535
|
+
cancelled: false,
|
|
1536
|
+
error: chunkISLB6Y5Q_cjs.errorFrom(cause, "Recording failed."),
|
|
1537
|
+
extension
|
|
1538
|
+
});
|
|
1539
|
+
var discardPartial = async (encoder) => {
|
|
1540
|
+
try {
|
|
1541
|
+
await encoder?.cancel();
|
|
1542
|
+
} catch {
|
|
1543
|
+
}
|
|
1544
|
+
};
|
|
1545
|
+
var assertPixelCount = (member, pixels) => {
|
|
1546
|
+
if (!Number.isInteger(pixels) || pixels < 1) {
|
|
1547
|
+
throw new chunkISLB6Y5Q_cjs.MountayaElementsError(
|
|
1548
|
+
`createCanvasSurface: ${member} is ${String(pixels)}; pass a whole number of pixels, 1 or more.`
|
|
1549
|
+
);
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
var createCanvasSurface = async (options) => {
|
|
1553
|
+
const { captureSize, dimensions, focusGlyphUrl, fps, profile, watermark = true } = options;
|
|
1554
|
+
assertPixelCount("dimensions.width", dimensions.width);
|
|
1555
|
+
assertPixelCount("dimensions.height", dimensions.height);
|
|
1556
|
+
assertPixelCount("captureSize.width", captureSize.width);
|
|
1557
|
+
assertPixelCount("captureSize.height", captureSize.height);
|
|
1558
|
+
if (fps !== void 0 && (!Number.isFinite(fps) || fps <= 0)) {
|
|
1559
|
+
throw new chunkISLB6Y5Q_cjs.MountayaElementsError(
|
|
1560
|
+
`createCanvasSurface: fps is ${String(fps)}; pass a number of frames per second above 0, or omit it for a halo that holds still.`
|
|
1561
|
+
);
|
|
1562
|
+
}
|
|
1563
|
+
const canvas = document.createElement("canvas");
|
|
1564
|
+
canvas.width = dimensions.width;
|
|
1565
|
+
canvas.height = dimensions.height;
|
|
1566
|
+
const context = canvas.getContext("2d", { alpha: true });
|
|
1567
|
+
if (!context) {
|
|
1568
|
+
return null;
|
|
1569
|
+
}
|
|
1570
|
+
context.fillStyle = "#000000";
|
|
1571
|
+
context.fillRect(0, 0, dimensions.width, dimensions.height);
|
|
1572
|
+
const blit = document.createElement("canvas");
|
|
1573
|
+
blit.width = captureSize.width;
|
|
1574
|
+
blit.height = captureSize.height;
|
|
1575
|
+
const blitContext = blit.getContext("2d", { alpha: true });
|
|
1576
|
+
if (!blitContext) {
|
|
1577
|
+
return null;
|
|
1578
|
+
}
|
|
1579
|
+
const frameImage = blitContext.createImageData(captureSize.width, captureSize.height);
|
|
1580
|
+
const watermarkCanvas = watermark ? await loadWatermarkCanvas(Math.min(dimensions.width, dimensions.height), WATERMARK_URL) : null;
|
|
1581
|
+
const profileRenderer = profile ? profileOverlayDesigns[profile.design] : null;
|
|
1582
|
+
const profileCurve = profile ? buildProfileCurve(profile.samples) : null;
|
|
1583
|
+
if (profile) {
|
|
1584
|
+
await ensureOverlayFonts();
|
|
1585
|
+
}
|
|
1586
|
+
const scaleX = dimensions.width / captureSize.width;
|
|
1587
|
+
const scaleY = dimensions.height / captureSize.height;
|
|
1588
|
+
const dotScale = watermarkScale(dimensions.width, dimensions.height);
|
|
1589
|
+
const dotRadius = VIDEO_FOCUS_MARKER_RADIUS_PX * dotScale;
|
|
1590
|
+
const dotStrokeWidth = VIDEO_FOCUS_MARKER_STROKE_WIDTH * dotScale;
|
|
1591
|
+
const haloMaxRadius = VIDEO_FOCUS_MARKER_HALO_MAX_RADIUS_PX * dotScale;
|
|
1592
|
+
const focusGlyphSize = Math.max(1, Math.round(dotRadius * 2 * VIDEO_FOCUS_MARKER_GLYPH_RATIO));
|
|
1593
|
+
const focusGlyph = focusGlyphUrl ? await loadFocusGlyphCanvas(focusGlyphUrl, focusGlyphSize) : null;
|
|
1594
|
+
const frameMs = fps === void 0 ? 0 : chunkAG6JV5Z2_cjs.MILLISECONDS_PER_SECOND / fps;
|
|
1595
|
+
return {
|
|
1596
|
+
canvas,
|
|
1597
|
+
paintFrame: (pixels, marker, index) => {
|
|
1598
|
+
frameImage.data.set(pixels);
|
|
1599
|
+
blitContext.putImageData(frameImage, 0, 0);
|
|
1600
|
+
context.drawImage(blit, 0, 0, dimensions.width, dimensions.height);
|
|
1601
|
+
if (marker) {
|
|
1602
|
+
const x = marker.x * scaleX;
|
|
1603
|
+
const y = marker.y * scaleY;
|
|
1604
|
+
const phase = index * frameMs % VIDEO_FOCUS_MARKER_PULSE_PERIOD_MS / VIDEO_FOCUS_MARKER_PULSE_PERIOD_MS;
|
|
1605
|
+
const haloRadius = dotRadius + (haloMaxRadius - dotRadius) * phase;
|
|
1606
|
+
const haloAlpha = VIDEO_FOCUS_MARKER_HALO_OPACITY * (1 - phase);
|
|
1607
|
+
context.save();
|
|
1608
|
+
context.globalAlpha = haloAlpha;
|
|
1609
|
+
context.beginPath();
|
|
1610
|
+
context.arc(x, y, haloRadius, 0, Math.PI * 2);
|
|
1611
|
+
context.fillStyle = VIDEO_FOCUS_MARKER_FILL;
|
|
1612
|
+
context.fill();
|
|
1613
|
+
context.restore();
|
|
1614
|
+
context.beginPath();
|
|
1615
|
+
context.arc(x, y, dotRadius, 0, Math.PI * 2);
|
|
1616
|
+
context.fillStyle = VIDEO_FOCUS_MARKER_FILL;
|
|
1617
|
+
context.fill();
|
|
1618
|
+
context.lineWidth = dotStrokeWidth;
|
|
1619
|
+
context.strokeStyle = VIDEO_FOCUS_MARKER_STROKE;
|
|
1620
|
+
context.stroke();
|
|
1621
|
+
if (focusGlyph) {
|
|
1622
|
+
context.drawImage(focusGlyph, x - focusGlyph.width / 2, y - focusGlyph.height / 2);
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
if (profile && profileRenderer && profileCurve) {
|
|
1626
|
+
const sample = profile.samples[index];
|
|
1627
|
+
if (sample) {
|
|
1628
|
+
profileRenderer(context, sample, profileCurve, dimensions, profile.format);
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
compositeWatermark(context, watermarkCanvas, dimensions.width, dimensions.height);
|
|
1632
|
+
}
|
|
1633
|
+
};
|
|
1634
|
+
};
|
|
1635
|
+
var settleDelay = (ms, signal) => new Promise((resolve) => {
|
|
1636
|
+
if (signal.aborted || ms <= 0) {
|
|
1637
|
+
resolve();
|
|
1638
|
+
return;
|
|
1639
|
+
}
|
|
1640
|
+
const onAbort = () => {
|
|
1641
|
+
clearTimeout(timeout);
|
|
1642
|
+
resolve();
|
|
1643
|
+
};
|
|
1644
|
+
const timeout = setTimeout(() => {
|
|
1645
|
+
signal.removeEventListener("abort", onAbort);
|
|
1646
|
+
resolve();
|
|
1647
|
+
}, ms);
|
|
1648
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
1649
|
+
});
|
|
1650
|
+
var captureSettledFrame = async (map, capture, pixels, width, height, signal) => {
|
|
1651
|
+
await map.waitForFrame(signal);
|
|
1652
|
+
capture.capture(pixels, width, height);
|
|
1653
|
+
let isBlack = isBufferAllBlack(pixels);
|
|
1654
|
+
for (let retry = 0; isBlack && retry < BLACK_FRAME_MAX_RETRIES && !signal.aborted; retry += 1) {
|
|
1655
|
+
await settleDelay(BLACK_FRAME_EXTRA_SETTLE_MS, signal);
|
|
1656
|
+
await map.waitForFrame(signal);
|
|
1657
|
+
capture.capture(pixels, width, height);
|
|
1658
|
+
isBlack = isBufferAllBlack(pixels);
|
|
1659
|
+
}
|
|
1660
|
+
return isBlack;
|
|
1661
|
+
};
|
|
1662
|
+
var recordPoses = async (args) => {
|
|
1663
|
+
const { map, markers, onProgress, output, poses, profile, seams, signal } = args;
|
|
1664
|
+
const extension = chunkXOHAXXZA_cjs.containerExtension(output.format);
|
|
1665
|
+
let encoder = null;
|
|
1666
|
+
let clockFrozen = false;
|
|
1667
|
+
try {
|
|
1668
|
+
const dimensions = resolveDimensions(output);
|
|
1669
|
+
if (signal.aborted) {
|
|
1670
|
+
return cancelledResult(extension);
|
|
1671
|
+
}
|
|
1672
|
+
if (poses.length === 0) {
|
|
1673
|
+
return unavailableResult(extension);
|
|
1674
|
+
}
|
|
1675
|
+
if (!map.isDrawingBufferPreserved()) {
|
|
1676
|
+
return unavailableResult(extension);
|
|
1677
|
+
}
|
|
1678
|
+
const captureSize = map.captureCanvasSize();
|
|
1679
|
+
if (captureSize.width < MIN_CANVAS_DIMENSION || captureSize.height < MIN_CANVAS_DIMENSION) {
|
|
1680
|
+
return unavailableResult(extension);
|
|
1681
|
+
}
|
|
1682
|
+
onProgress?.({ fraction: 0, phase: "preparing" });
|
|
1683
|
+
const watermark = await args.organization().then(
|
|
1684
|
+
(organization) => organization.white_label !== true,
|
|
1685
|
+
() => true
|
|
1686
|
+
);
|
|
1687
|
+
const createSurface = seams.createSurface ?? createCanvasSurface;
|
|
1688
|
+
const surface = await createSurface({
|
|
1689
|
+
captureSize,
|
|
1690
|
+
dimensions,
|
|
1691
|
+
focusGlyphUrl: args.focusGlyphUrl,
|
|
1692
|
+
fps: output.fps,
|
|
1693
|
+
profile,
|
|
1694
|
+
watermark
|
|
1695
|
+
});
|
|
1696
|
+
if (!surface) {
|
|
1697
|
+
return unavailableResult(extension);
|
|
1698
|
+
}
|
|
1699
|
+
const capture = seams.createCapture();
|
|
1700
|
+
const pixels = new Uint8Array(captureSize.width * captureSize.height * 4);
|
|
1701
|
+
const encoderFactory = seams.encoderFactory ?? createVideoEncoder;
|
|
1702
|
+
encoder = await encoderFactory(surface.canvas, dimensions, output);
|
|
1703
|
+
map.freezeClock(0);
|
|
1704
|
+
clockFrozen = true;
|
|
1705
|
+
const frameDurationSeconds = 1 / output.fps;
|
|
1706
|
+
const frameDurationMs = chunkAG6JV5Z2_cjs.MILLISECONDS_PER_SECOND / output.fps;
|
|
1707
|
+
for (let index = 0; index < poses.length; index += 1) {
|
|
1708
|
+
if (signal.aborted) {
|
|
1709
|
+
await discardPartial(encoder);
|
|
1710
|
+
return cancelledResult(extension);
|
|
1711
|
+
}
|
|
1712
|
+
const pose = poses[index];
|
|
1713
|
+
if (!pose) {
|
|
1714
|
+
continue;
|
|
1715
|
+
}
|
|
1716
|
+
map.freezeClock(index * frameDurationMs);
|
|
1717
|
+
map.jumpTo(pose);
|
|
1718
|
+
const markerLngLat = markers?.[index];
|
|
1719
|
+
let marker = null;
|
|
1720
|
+
if (markerLngLat) {
|
|
1721
|
+
const [x, y] = map.project(markerLngLat);
|
|
1722
|
+
marker = { x, y };
|
|
1723
|
+
}
|
|
1724
|
+
const isBlack = await captureSettledFrame(
|
|
1725
|
+
map,
|
|
1726
|
+
capture,
|
|
1727
|
+
pixels,
|
|
1728
|
+
captureSize.width,
|
|
1729
|
+
captureSize.height,
|
|
1730
|
+
signal
|
|
1731
|
+
);
|
|
1732
|
+
if (index === 0 && isBlack) {
|
|
1733
|
+
await discardPartial(encoder);
|
|
1734
|
+
return unavailableResult(extension);
|
|
1735
|
+
}
|
|
1736
|
+
surface.paintFrame(pixels, marker, index);
|
|
1737
|
+
await encoder.addFrame(index * frameDurationSeconds, frameDurationSeconds);
|
|
1738
|
+
onProgress?.({ fraction: (index + 1) / poses.length, phase: "recording" });
|
|
1739
|
+
}
|
|
1740
|
+
onProgress?.({ fraction: 1, phase: "encoding" });
|
|
1741
|
+
const blob = await encoder.finalize();
|
|
1742
|
+
return { blob, cancelled: false, extension: encoder.extension };
|
|
1743
|
+
} catch (cause) {
|
|
1744
|
+
await discardPartial(encoder);
|
|
1745
|
+
return failedResult(encoder?.extension ?? extension, cause);
|
|
1746
|
+
} finally {
|
|
1747
|
+
if (clockFrozen) {
|
|
1748
|
+
map.restoreClock();
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
};
|
|
1752
|
+
|
|
1753
|
+
// src/video/engines/videoRun.ts
|
|
1754
|
+
var buildVideoFocusMarkerElement = (glyphUrl) => {
|
|
1755
|
+
const dotDiameter = VIDEO_FOCUS_MARKER_RADIUS_PX * 2;
|
|
1756
|
+
const haloDiameter = VIDEO_FOCUS_MARKER_HALO_MAX_RADIUS_PX * 2;
|
|
1757
|
+
const container = document.createElement("div");
|
|
1758
|
+
container.setAttribute("data-mountaya-video-focus-marker", "");
|
|
1759
|
+
container.setAttribute("aria-hidden", "true");
|
|
1760
|
+
container.style.alignItems = "center";
|
|
1761
|
+
container.style.display = "flex";
|
|
1762
|
+
container.style.height = `${dotDiameter}px`;
|
|
1763
|
+
container.style.justifyContent = "center";
|
|
1764
|
+
container.style.pointerEvents = "none";
|
|
1765
|
+
container.style.position = "relative";
|
|
1766
|
+
container.style.width = `${dotDiameter}px`;
|
|
1767
|
+
const halo = document.createElement("div");
|
|
1768
|
+
halo.style.backgroundColor = VIDEO_FOCUS_MARKER_FILL;
|
|
1769
|
+
halo.style.borderRadius = "50%";
|
|
1770
|
+
halo.style.height = `${haloDiameter}px`;
|
|
1771
|
+
halo.style.left = "50%";
|
|
1772
|
+
halo.style.marginLeft = `${-VIDEO_FOCUS_MARKER_HALO_MAX_RADIUS_PX}px`;
|
|
1773
|
+
halo.style.marginTop = `${-VIDEO_FOCUS_MARKER_HALO_MAX_RADIUS_PX}px`;
|
|
1774
|
+
halo.style.position = "absolute";
|
|
1775
|
+
halo.style.top = "50%";
|
|
1776
|
+
halo.style.width = `${haloDiameter}px`;
|
|
1777
|
+
const startScale = VIDEO_FOCUS_MARKER_RADIUS_PX / VIDEO_FOCUS_MARKER_HALO_MAX_RADIUS_PX;
|
|
1778
|
+
if (typeof halo.animate === "function") {
|
|
1779
|
+
halo.animate(
|
|
1780
|
+
[
|
|
1781
|
+
{ opacity: VIDEO_FOCUS_MARKER_HALO_OPACITY, transform: `scale(${startScale})` },
|
|
1782
|
+
{ opacity: 0, transform: "scale(1)" }
|
|
1783
|
+
],
|
|
1784
|
+
{
|
|
1785
|
+
duration: VIDEO_FOCUS_MARKER_PULSE_PERIOD_MS,
|
|
1786
|
+
easing: "ease-out",
|
|
1787
|
+
iterations: Number.POSITIVE_INFINITY
|
|
1788
|
+
}
|
|
1789
|
+
);
|
|
1790
|
+
}
|
|
1791
|
+
const dot = document.createElement("div");
|
|
1792
|
+
dot.style.backgroundColor = VIDEO_FOCUS_MARKER_FILL;
|
|
1793
|
+
dot.style.border = `${VIDEO_FOCUS_MARKER_STROKE_WIDTH}px solid ${VIDEO_FOCUS_MARKER_STROKE}`;
|
|
1794
|
+
dot.style.borderRadius = "50%";
|
|
1795
|
+
dot.style.boxSizing = "content-box";
|
|
1796
|
+
dot.style.height = `${dotDiameter}px`;
|
|
1797
|
+
dot.style.position = "relative";
|
|
1798
|
+
dot.style.width = `${dotDiameter}px`;
|
|
1799
|
+
container.append(halo, dot);
|
|
1800
|
+
if (glyphUrl) {
|
|
1801
|
+
const glyphSize = dotDiameter * VIDEO_FOCUS_MARKER_GLYPH_RATIO;
|
|
1802
|
+
const glyph = document.createElement("div");
|
|
1803
|
+
glyph.style.backgroundColor = VIDEO_FOCUS_MARKER_GLYPH_COLOR;
|
|
1804
|
+
glyph.style.height = `${glyphSize}px`;
|
|
1805
|
+
glyph.style.left = "50%";
|
|
1806
|
+
glyph.style.marginLeft = `${-glyphSize / 2}px`;
|
|
1807
|
+
glyph.style.marginTop = `${-glyphSize / 2}px`;
|
|
1808
|
+
glyph.style.position = "absolute";
|
|
1809
|
+
glyph.style.top = "50%";
|
|
1810
|
+
glyph.style.width = `${glyphSize}px`;
|
|
1811
|
+
const maskUrl = `url("${glyphUrl}")`;
|
|
1812
|
+
glyph.style.maskImage = maskUrl;
|
|
1813
|
+
glyph.style.webkitMaskImage = maskUrl;
|
|
1814
|
+
glyph.style.maskRepeat = "no-repeat";
|
|
1815
|
+
glyph.style.webkitMaskRepeat = "no-repeat";
|
|
1816
|
+
glyph.style.maskPosition = "center";
|
|
1817
|
+
glyph.style.webkitMaskPosition = "center";
|
|
1818
|
+
glyph.style.maskSize = "contain";
|
|
1819
|
+
glyph.style.webkitMaskSize = "contain";
|
|
1820
|
+
container.append(glyph);
|
|
1821
|
+
}
|
|
1822
|
+
return container;
|
|
1823
|
+
};
|
|
1824
|
+
var VideoRunEngine = class {
|
|
1825
|
+
/**
|
|
1826
|
+
* @param map The MapLibre map a run flies and captures.
|
|
1827
|
+
* @param events The map's events (`MountayaMap.events`), which the recorder's render waits
|
|
1828
|
+
* listen through.
|
|
1829
|
+
* @param organization The map's organization, as `MountayaMap.loadOrganization` reads it: a
|
|
1830
|
+
* recording carries the Mountaya watermark unless it answers white label, and a read that fails
|
|
1831
|
+
* leaves the mark on (`geo.organization.watermark`). Read once a recording starts.
|
|
1832
|
+
*/
|
|
1833
|
+
constructor(map, events, organization) {
|
|
1834
|
+
this.map = map;
|
|
1835
|
+
this.events = events;
|
|
1836
|
+
this.organization = organization;
|
|
1837
|
+
}
|
|
1838
|
+
map;
|
|
1839
|
+
events;
|
|
1840
|
+
organization;
|
|
1841
|
+
// The in-flight video run (preview or record): its AbortController, the camera
|
|
1842
|
+
// pose the user left before it (or before the run it superseded) started, and
|
|
1843
|
+
// the release for its listener on the caller's signal, so a new run, a dispose,
|
|
1844
|
+
// or an external abort can stop the loop and restore the pre-run view. Only one
|
|
1845
|
+
// run is ever active at a time (previewPoses and recordPoses abort any prior run
|
|
1846
|
+
// before starting), so a single field holds it. Null when no run is active.
|
|
1847
|
+
videoRun = null;
|
|
1848
|
+
// The moving "you are here" dot the live preview shows, a DOM Marker positioned at
|
|
1849
|
+
// the route point under the camera each frame. Held so a per-frame move reuses the
|
|
1850
|
+
// one marker (setLngLat, GPU-composited, smooth) rather than stacking, and a null
|
|
1851
|
+
// frame or dispose removes it. Null between flights. The recorder does NOT use this
|
|
1852
|
+
// marker (a DOM overlay is outside gl.readPixels): it composites its own dot onto
|
|
1853
|
+
// each output frame instead.
|
|
1854
|
+
videoFocusMarker = null;
|
|
1855
|
+
// The activity glyph URL the moving dot masks over its white disc, set from the
|
|
1856
|
+
// preview/record options at the start of a run and read when setVideoFocusMarker
|
|
1857
|
+
// builds the marker element (preview) and forwarded into the recorder (record). Null
|
|
1858
|
+
// when the itinerary carries no activity, which reproduces the plain-disc marker.
|
|
1859
|
+
focusGlyphUrl = null;
|
|
1860
|
+
// Whether dispose has run. The engine was handed its map and let go of it then, so every entry
|
|
1861
|
+
// point reads this before it touches the map.
|
|
1862
|
+
disposed = false;
|
|
1863
|
+
/**
|
|
1864
|
+
* getCameraPose reads the map's current camera as a fully-resolved pose, the snapshot
|
|
1865
|
+
* a run restores to when its loop settles or aborts.
|
|
1866
|
+
*/
|
|
1867
|
+
getCameraPose() {
|
|
1868
|
+
const center = this.map.getCenter();
|
|
1869
|
+
return {
|
|
1870
|
+
bearing: this.map.getBearing(),
|
|
1871
|
+
center: [center.lng, center.lat],
|
|
1872
|
+
pitch: this.map.getPitch(),
|
|
1873
|
+
zoom: this.map.getZoom()
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* previewPoses flies the camera along the given fully-resolved poses on the map
|
|
1878
|
+
* with no frame capture: the live rehearsal of a recording. It snapshots the
|
|
1879
|
+
* camera and opens a run linked to the caller's signal, steps the poses through
|
|
1880
|
+
* the videoPreview loop, and restores the pre-preview camera when the fly
|
|
1881
|
+
* settles. A cancelled preview resolves cleanly. A preview that fails inside a frame,
|
|
1882
|
+
* on a throw of the map or of the progress callback, rejects with what was thrown,
|
|
1883
|
+
* once the camera is restored.
|
|
1884
|
+
*
|
|
1885
|
+
* `options.planDurationMs`, when supplied, is the plan's wall-clock length (its
|
|
1886
|
+
* base duration plus every hold), so the rehearsal lasts the same time as the
|
|
1887
|
+
* recording and dwells correctly on holds: the pose count alone undercounts the
|
|
1888
|
+
* holds, which extend the wall-clock the frames span but not their number. Absent,
|
|
1889
|
+
* the preview falls back to pacing the grid at its own fixed cadence.
|
|
1890
|
+
*/
|
|
1891
|
+
async previewPoses(poses, options) {
|
|
1892
|
+
if (this.disposed) {
|
|
1893
|
+
return;
|
|
1894
|
+
}
|
|
1895
|
+
this.focusGlyphUrl = options.focusGlyphUrl ?? null;
|
|
1896
|
+
const run = this.beginVideoRun(options.signal);
|
|
1897
|
+
try {
|
|
1898
|
+
await previewPoses({
|
|
1899
|
+
map: {
|
|
1900
|
+
jumpTo: (pose) => this.map.jumpTo(pose),
|
|
1901
|
+
setMarker: (lngLat) => this.setVideoFocusMarker(lngLat)
|
|
1902
|
+
},
|
|
1903
|
+
markers: options.markers,
|
|
1904
|
+
onProgress: options.onProgress,
|
|
1905
|
+
planDurationMs: options.planDurationMs,
|
|
1906
|
+
poses,
|
|
1907
|
+
signal: run.controller.signal
|
|
1908
|
+
});
|
|
1909
|
+
} finally {
|
|
1910
|
+
this.endVideoRun(run);
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
/**
|
|
1914
|
+
* recordPoses captures and encodes the given fully-resolved poses into a video
|
|
1915
|
+
* on the map, one frame per pose, through the videoRecorder loop. Same run
|
|
1916
|
+
* lifecycle as previewPoses; the recorder asserts preserveDrawingBuffer and
|
|
1917
|
+
* resolves a structured result rather than throwing, so this never rejects.
|
|
1918
|
+
*
|
|
1919
|
+
* Before the capture loop it runs a pre-flight warm pass over the poses (a
|
|
1920
|
+
* strided jump through the flight viewports, awaiting tile-idle at each stop) so
|
|
1921
|
+
* the flight-zoom basemap, itinerary, and DEM tiles are loaded and resident
|
|
1922
|
+
* before any frame is captured. Without it the loop captures empty/black tiles
|
|
1923
|
+
* for the closer flight zoom, whose tiles prewarmTerrain (which warms only the
|
|
1924
|
+
* fit zoom) never requested. The enlarged map tile cache keeps the warmed tiles
|
|
1925
|
+
* from being evicted as the camera flies on. A caller that has just swept these very
|
|
1926
|
+
* poses, every frame's zoom and pitch included, passes `warmed: true`, and the capture
|
|
1927
|
+
* loop starts with no warm pass.
|
|
1928
|
+
*/
|
|
1929
|
+
async recordPoses(poses, output, options) {
|
|
1930
|
+
if (this.disposed) {
|
|
1931
|
+
return cancelledRecording(output);
|
|
1932
|
+
}
|
|
1933
|
+
this.focusGlyphUrl = options.focusGlyphUrl ?? null;
|
|
1934
|
+
const run = this.beginVideoRun(options.signal);
|
|
1935
|
+
try {
|
|
1936
|
+
if (options.warmed !== true) {
|
|
1937
|
+
await this.warmPosesForRecording(poses, run.controller.signal);
|
|
1938
|
+
}
|
|
1939
|
+
return await recordPoses({
|
|
1940
|
+
focusGlyphUrl: this.focusGlyphUrl ?? void 0,
|
|
1941
|
+
map: this.buildRecordingMap(),
|
|
1942
|
+
markers: options.markers,
|
|
1943
|
+
onProgress: options.onProgress,
|
|
1944
|
+
output,
|
|
1945
|
+
poses,
|
|
1946
|
+
profile: options.profile,
|
|
1947
|
+
organization: this.organization,
|
|
1948
|
+
seams: {
|
|
1949
|
+
createCapture: () => createCanvasFrameCapture(this.map.getCanvas()),
|
|
1950
|
+
createSurface: createCanvasSurface
|
|
1951
|
+
},
|
|
1952
|
+
signal: run.controller.signal
|
|
1953
|
+
});
|
|
1954
|
+
} finally {
|
|
1955
|
+
this.endVideoRun(run);
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
/**
|
|
1959
|
+
* setVideoFocusMarker drops (or, with null, clears) the moving "you are here" dot
|
|
1960
|
+
* the video preview/record drives along the route: the point on the trail under
|
|
1961
|
+
* the camera for the current frame.
|
|
1962
|
+
*/
|
|
1963
|
+
setVideoFocusMarker(lngLat) {
|
|
1964
|
+
if (this.disposed) {
|
|
1965
|
+
return;
|
|
1966
|
+
}
|
|
1967
|
+
if (!lngLat) {
|
|
1968
|
+
this.videoFocusMarker?.remove();
|
|
1969
|
+
this.videoFocusMarker = null;
|
|
1970
|
+
return;
|
|
1971
|
+
}
|
|
1972
|
+
const center = new maplibreGl.LngLat(lngLat[0], lngLat[1]);
|
|
1973
|
+
if (this.videoFocusMarker) {
|
|
1974
|
+
this.videoFocusMarker.setLngLat(center);
|
|
1975
|
+
return;
|
|
1976
|
+
}
|
|
1977
|
+
this.videoFocusMarker = new maplibreGl.Marker({
|
|
1978
|
+
anchor: "center",
|
|
1979
|
+
element: buildVideoFocusMarkerElement(this.focusGlyphUrl)
|
|
1980
|
+
}).setLngLat(center).addTo(this.map);
|
|
1981
|
+
}
|
|
1982
|
+
/**
|
|
1983
|
+
* dispose aborts an in-flight video run and restores its pre-run camera and clock,
|
|
1984
|
+
* then sweeps a lingering focus dot. The run teardown runs in one fixed order
|
|
1985
|
+
* (abort, endVideoRun, restoreNow), and the client
|
|
1986
|
+
* calls this BEFORE the event engine's own dispose so the recorder's render-wait
|
|
1987
|
+
* listener (held by the event engine) lets its loop bail and its finally restore
|
|
1988
|
+
* the clock before the listener is detached. restoreNow is a no-op when the clock
|
|
1989
|
+
* was never frozen (a preview, or a record already past its finally).
|
|
1990
|
+
*/
|
|
1991
|
+
dispose() {
|
|
1992
|
+
if (this.videoRun) {
|
|
1993
|
+
const run = this.videoRun;
|
|
1994
|
+
run.controller.abort();
|
|
1995
|
+
this.endVideoRun(run);
|
|
1996
|
+
maplibreGl.restoreNow();
|
|
1997
|
+
}
|
|
1998
|
+
this.videoFocusMarker?.remove();
|
|
1999
|
+
this.videoFocusMarker = null;
|
|
2000
|
+
this.disposed = true;
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* beginVideoRun opens a video run (preview or record): it aborts any run
|
|
2004
|
+
* already in flight, takes the pose to restore, and returns the run, whose
|
|
2005
|
+
* controller aborts when the caller's signal does (so one signal drives both the
|
|
2006
|
+
* caller's cancel and the internal teardown). The run's controller signal is the
|
|
2007
|
+
* one the pipeline honors.
|
|
2008
|
+
*
|
|
2009
|
+
* The pose to restore is the camera the user left, which is not always the camera
|
|
2010
|
+
* now. A run that supersedes one still in flight finds the camera on a pose of that
|
|
2011
|
+
* flight, and the superseded run hands its restore over rather than performing it,
|
|
2012
|
+
* so the new run inherits the pose the superseded one took. Snapshotting the camera
|
|
2013
|
+
* here instead would park the map on a frame of a flight nobody is watching once
|
|
2014
|
+
* the new run settles.
|
|
2015
|
+
*
|
|
2016
|
+
* The listener on the caller's signal leaves with the run ({@link endVideoRun}
|
|
2017
|
+
* releases it). A caller that keeps one signal for a whole session would otherwise
|
|
2018
|
+
* hold a closure per run it ever started, each keeping its controller alive.
|
|
2019
|
+
*/
|
|
2020
|
+
beginVideoRun(signal) {
|
|
2021
|
+
const superseded = this.videoRun;
|
|
2022
|
+
superseded?.controller.abort();
|
|
2023
|
+
const controller = new AbortController();
|
|
2024
|
+
const abort = () => {
|
|
2025
|
+
controller.abort();
|
|
2026
|
+
};
|
|
2027
|
+
if (signal.aborted) {
|
|
2028
|
+
controller.abort();
|
|
2029
|
+
} else {
|
|
2030
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
2031
|
+
}
|
|
2032
|
+
const run = {
|
|
2033
|
+
controller,
|
|
2034
|
+
release: () => {
|
|
2035
|
+
signal.removeEventListener("abort", abort);
|
|
2036
|
+
},
|
|
2037
|
+
restorePose: superseded?.restorePose ?? this.getCameraPose()
|
|
2038
|
+
};
|
|
2039
|
+
this.videoRun = run;
|
|
2040
|
+
return run;
|
|
2041
|
+
}
|
|
2042
|
+
/**
|
|
2043
|
+
* endVideoRun closes a video run started by beginVideoRun: it releases the run's
|
|
2044
|
+
* listener on the caller's signal whatever else happens, then restores the pre-run
|
|
2045
|
+
* camera and clears the session field, but only when the field still points at
|
|
2046
|
+
* this run. A superseding run already took the field and the pose to restore, so a
|
|
2047
|
+
* late teardown must not clobber it. Restoring through jumpTo lands the camera
|
|
2048
|
+
* exactly where the run began. Idempotent: dispose and the run's own settle may
|
|
2049
|
+
* both reach it.
|
|
2050
|
+
*/
|
|
2051
|
+
endVideoRun(run) {
|
|
2052
|
+
run.release();
|
|
2053
|
+
if (this.videoRun !== run) {
|
|
2054
|
+
return;
|
|
2055
|
+
}
|
|
2056
|
+
this.map.jumpTo({
|
|
2057
|
+
bearing: run.restorePose.bearing,
|
|
2058
|
+
center: run.restorePose.center,
|
|
2059
|
+
pitch: run.restorePose.pitch,
|
|
2060
|
+
zoom: run.restorePose.zoom
|
|
2061
|
+
});
|
|
2062
|
+
this.videoRun = null;
|
|
2063
|
+
}
|
|
2064
|
+
/**
|
|
2065
|
+
* buildRecordingMap adapts this MapLibre map to the RecordingMap the recorder
|
|
2066
|
+
* drives: the clock freeze/restore map onto maplibre's setNow/restoreNow, the
|
|
2067
|
+
* camera jump onto jumpTo, the canvas size onto the drawing buffer dimensions,
|
|
2068
|
+
* the preserve-buffer probe onto the WebGL context attribute, the coordinate→pixel
|
|
2069
|
+
* projection (so the recorder can composite the focus dot onto each frame after
|
|
2070
|
+
* the jump), and the per-frame wait onto waitForRecorderFrame. Built per record
|
|
2071
|
+
* call so it always reads the live map. There is no setMarker: the recorder draws
|
|
2072
|
+
* the dot into each output frame itself (a DOM marker is outside gl.readPixels), so
|
|
2073
|
+
* the map is never asked to place one during a record.
|
|
2074
|
+
*/
|
|
2075
|
+
buildRecordingMap() {
|
|
2076
|
+
return {
|
|
2077
|
+
captureCanvasSize: () => {
|
|
2078
|
+
const canvas = this.map.getCanvas();
|
|
2079
|
+
return { height: canvas.height, width: canvas.width };
|
|
2080
|
+
},
|
|
2081
|
+
freezeClock: (timeMs) => maplibreGl.setNow(timeMs),
|
|
2082
|
+
isDrawingBufferPreserved: () => {
|
|
2083
|
+
const context = this.map.getCanvas().getContext("webgl2") ?? this.map.getCanvas().getContext("webgl");
|
|
2084
|
+
return context?.getContextAttributes()?.preserveDrawingBuffer === true;
|
|
2085
|
+
},
|
|
2086
|
+
jumpTo: (pose) => this.map.jumpTo(pose),
|
|
2087
|
+
project: (lngLat) => this.projectToCaptureBuffer(lngLat),
|
|
2088
|
+
restoreClock: () => maplibreGl.restoreNow(),
|
|
2089
|
+
waitForFrame: (signal) => this.waitForRecorderFrame(signal)
|
|
2090
|
+
};
|
|
2091
|
+
}
|
|
2092
|
+
/**
|
|
2093
|
+
* projectToCaptureBuffer projects a [lng, lat] to its pixel in the WebGL CAPTURE
|
|
2094
|
+
* buffer's coordinate space (canvas.width/height, the device-pixel back buffer the
|
|
2095
|
+
* recorder reads), so the recorder can scale it onto the output frame the same way
|
|
2096
|
+
* it scales the captured pixels (captureSize → output dimensions). map.project
|
|
2097
|
+
* returns CSS container pixels, so the result is multiplied by the buffer/CSS ratio
|
|
2098
|
+
* (the device-pixel ratio the renderer drew at) on each axis. The recorder needs
|
|
2099
|
+
* capture-space pixels because the dot is a 2D-canvas composite, not a map marker:
|
|
2100
|
+
* there is no DOM marker in the frame the recorder reads.
|
|
2101
|
+
*/
|
|
2102
|
+
projectToCaptureBuffer(lngLat) {
|
|
2103
|
+
const point = this.map.project(lngLat);
|
|
2104
|
+
const canvas = this.map.getCanvas();
|
|
2105
|
+
const scaleX = canvas.clientWidth > 0 ? canvas.width / canvas.clientWidth : 1;
|
|
2106
|
+
const scaleY = canvas.clientHeight > 0 ? canvas.height / canvas.clientHeight : 1;
|
|
2107
|
+
return [point.x * scaleX, point.y * scaleY];
|
|
2108
|
+
}
|
|
2109
|
+
/**
|
|
2110
|
+
* waitForRecorderFrame triggers a repaint and resolves once the renderer has
|
|
2111
|
+
* reached tile-idle (every requested tile for this frame's viewport painted), so
|
|
2112
|
+
* the back buffer holds a complete frame before the recorder reads it, not a
|
|
2113
|
+
* partial frame with empty/black tiles still in flight. It is the per-frame
|
|
2114
|
+
* counterpart to waitForRender's idle gate: it resolves immediately when the map
|
|
2115
|
+
* already reports loaded() (the warm-tile fast path, and most frames take it, since the
|
|
2116
|
+
* pre-flight warm pass loaded the flight-zoom tiles and the enlarged cache keeps
|
|
2117
|
+
* them resident), else on the next "idle", else after PER_FRAME_IDLE_TIMEOUT_MS
|
|
2118
|
+
* so a stalled tile fetch cannot hang the run (a frame with a few late tiles
|
|
2119
|
+
* beats no recording). It resolves immediately if the signal is already aborted, and
|
|
2120
|
+
* at once on an abort made while it waits.
|
|
2121
|
+
* The idle listener is registered through the event engine (so dispose sweeps
|
|
2122
|
+
* it) and self-detaches on the first of idle/timeout; the wait never rejects.
|
|
2123
|
+
*/
|
|
2124
|
+
waitForRecorderFrame(signal) {
|
|
2125
|
+
return new Promise((resolve) => {
|
|
2126
|
+
if (signal.aborted) {
|
|
2127
|
+
resolve();
|
|
2128
|
+
return;
|
|
2129
|
+
}
|
|
2130
|
+
this.map.triggerRepaint();
|
|
2131
|
+
if (this.map.loaded()) {
|
|
2132
|
+
resolve();
|
|
2133
|
+
return;
|
|
2134
|
+
}
|
|
2135
|
+
let settled = false;
|
|
2136
|
+
let detach = () => {
|
|
2137
|
+
};
|
|
2138
|
+
const finish = () => {
|
|
2139
|
+
if (settled) {
|
|
2140
|
+
return;
|
|
2141
|
+
}
|
|
2142
|
+
settled = true;
|
|
2143
|
+
clearTimeout(timeout);
|
|
2144
|
+
detach();
|
|
2145
|
+
signal.removeEventListener("abort", finish);
|
|
2146
|
+
resolve();
|
|
2147
|
+
};
|
|
2148
|
+
const timeout = setTimeout(finish, chunkAFKOABJ4_cjs.PER_FRAME_IDLE_TIMEOUT_MS);
|
|
2149
|
+
signal.addEventListener("abort", finish, { once: true });
|
|
2150
|
+
detach = this.events.on("idle", finish);
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
* warmPosesForRecording jumps the camera through a STRIDED subset of the flight
|
|
2155
|
+
* poses before the capture loop, awaiting tile readiness at each stop, so the
|
|
2156
|
+
* flight-zoom basemap, itinerary-vector, and DEM tiles every frame will need are
|
|
2157
|
+
* loaded (and, with the enlarged map tile cache, resident) before the first
|
|
2158
|
+
* capture. It is the run engine's twin of MapLibreClient.warmPoses, working
|
|
2159
|
+
* over the live map the run owns: it strides the poses (every Nth, capped so a
|
|
2160
|
+
* long route warms at most PREFLIGHT_WARM_MAX_STOPS viewports) and waits for the
|
|
2161
|
+
* renderer to settle at each stop, bounded per stop so a stalled tile fetch
|
|
2162
|
+
* cannot hang the warm pass. It honors `signal`: an abort stops the pass at the
|
|
2163
|
+
* next stop and resolves. Best-effort: it never rejects, so a warm that cannot
|
|
2164
|
+
* complete still lets the capture loop run.
|
|
2165
|
+
*/
|
|
2166
|
+
async warmPosesForRecording(poses, signal) {
|
|
2167
|
+
return chunkAFKOABJ4_cjs.warmPosesThrough(this.map, this.events, poses, signal);
|
|
2168
|
+
}
|
|
2169
|
+
};
|
|
2170
|
+
|
|
2171
|
+
Object.defineProperty(exports, "videoOverlayStringsFor", {
|
|
2172
|
+
enumerable: true,
|
|
2173
|
+
get: function () { return chunkPLMVBX2A_cjs.videoOverlayStringsFor; }
|
|
2174
|
+
});
|
|
2175
|
+
Object.defineProperty(exports, "MapLibreViewClient", {
|
|
2176
|
+
enumerable: true,
|
|
2177
|
+
get: function () { return chunkAFKOABJ4_cjs.MapLibreViewClient; }
|
|
2178
|
+
});
|
|
2179
|
+
exports.MAX_TILE_CACHE_SIZE = MAX_TILE_CACHE_SIZE;
|
|
2180
|
+
exports.OVERLAY_FONT_FAMILY = OVERLAY_FONT_FAMILY;
|
|
2181
|
+
exports.VideoRunEngine = VideoRunEngine;
|
|
2182
|
+
exports.WATERMARK_INSET_PX = WATERMARK_INSET_PX;
|
|
2183
|
+
exports.WATERMARK_REFERENCE_SHORT_SIDE = WATERMARK_REFERENCE_SHORT_SIDE;
|
|
2184
|
+
exports.WATERMARK_URL = WATERMARK_URL;
|
|
2185
|
+
exports.WATERMARK_WIDTH_PX = WATERMARK_WIDTH_PX;
|
|
2186
|
+
exports.alongFlight = alongFlight;
|
|
2187
|
+
exports.buildProfileCurve = buildProfileCurve;
|
|
2188
|
+
exports.buildVideoFocusMarkerElement = buildVideoFocusMarkerElement;
|
|
2189
|
+
exports.createCanvasFrameCapture = createCanvasFrameCapture;
|
|
2190
|
+
exports.createCanvasSurface = createCanvasSurface;
|
|
2191
|
+
exports.ensureOverlayFonts = ensureOverlayFonts;
|
|
2192
|
+
exports.previewPoses = previewPoses;
|
|
2193
|
+
exports.profileOverlayDesigns = profileOverlayDesigns;
|
|
2194
|
+
exports.recordPoses = recordPoses;
|
|
2195
|
+
exports.resolveBitrateBps = resolveBitrateBps;
|
|
2196
|
+
exports.resolveDimensions = resolveDimensions;
|
|
2197
|
+
//# sourceMappingURL=index.cjs.map
|
|
2198
|
+
//# sourceMappingURL=index.cjs.map
|