@mountaya/studio-react 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 +54 -0
- package/LICENCE.fr.txt +280 -0
- package/LICENSE.txt +262 -0
- package/README.md +1087 -2
- package/THIRD-PARTY-NOTICES.txt +149 -0
- package/dist/AgentMarkdown-RNLATZYN.cjs +213 -0
- package/dist/AgentMarkdown-RNLATZYN.cjs.map +1 -0
- package/dist/AgentMarkdown-TMN6E2XC.js +206 -0
- package/dist/AgentMarkdown-TMN6E2XC.js.map +1 -0
- package/dist/ContextMenuPopup-EOYN42YZ.js +468 -0
- package/dist/ContextMenuPopup-EOYN42YZ.js.map +1 -0
- package/dist/ContextMenuPopup-VQLAYYYZ.cjs +470 -0
- package/dist/ContextMenuPopup-VQLAYYYZ.cjs.map +1 -0
- package/dist/CopilotPanel-CCLEYZUN.js +29 -0
- package/dist/CopilotPanel-CCLEYZUN.js.map +1 -0
- package/dist/CopilotPanel-LYPMTDKX.cjs +38 -0
- package/dist/CopilotPanel-LYPMTDKX.cjs.map +1 -0
- package/dist/DateTimePickerField-FZRKJ2SU.js +53 -0
- package/dist/DateTimePickerField-FZRKJ2SU.js.map +1 -0
- package/dist/DateTimePickerField-NB456C6F.cjs +55 -0
- package/dist/DateTimePickerField-NB456C6F.cjs.map +1 -0
- package/dist/DirectionsModal-4Y346QFU.cjs +291 -0
- package/dist/DirectionsModal-4Y346QFU.cjs.map +1 -0
- package/dist/DirectionsModal-DRPO2654.js +289 -0
- package/dist/DirectionsModal-DRPO2654.js.map +1 -0
- package/dist/DuplicateItineraryModal-2QGWI7E7.js +321 -0
- package/dist/DuplicateItineraryModal-2QGWI7E7.js.map +1 -0
- package/dist/DuplicateItineraryModal-WFGMU6JL.cjs +323 -0
- package/dist/DuplicateItineraryModal-WFGMU6JL.cjs.map +1 -0
- package/dist/EditCollectionModal-4QYP53SX.js +90 -0
- package/dist/EditCollectionModal-4QYP53SX.js.map +1 -0
- package/dist/EditCollectionModal-T2TMAO53.cjs +92 -0
- package/dist/EditCollectionModal-T2TMAO53.cjs.map +1 -0
- package/dist/EmbedSnippetCode-NMFCQ7TF.cjs +62 -0
- package/dist/EmbedSnippetCode-NMFCQ7TF.cjs.map +1 -0
- package/dist/EmbedSnippetCode-TGBSWDMD.js +60 -0
- package/dist/EmbedSnippetCode-TGBSWDMD.js.map +1 -0
- package/dist/EmbedTablePreview-3RRHM63Q.js +72 -0
- package/dist/EmbedTablePreview-3RRHM63Q.js.map +1 -0
- package/dist/EmbedTablePreview-Z3W62MRV.cjs +74 -0
- package/dist/EmbedTablePreview-Z3W62MRV.cjs.map +1 -0
- package/dist/ExportModal-5NUZZPXN.cjs +267 -0
- package/dist/ExportModal-5NUZZPXN.cjs.map +1 -0
- package/dist/ExportModal-H7OYP6CK.js +265 -0
- package/dist/ExportModal-H7OYP6CK.js.map +1 -0
- package/dist/FileDropzone-GKPMAZF5.cjs +41 -0
- package/dist/FileDropzone-GKPMAZF5.cjs.map +1 -0
- package/dist/FileDropzone-GRXY4FXR.js +39 -0
- package/dist/FileDropzone-GRXY4FXR.js.map +1 -0
- package/dist/LocationPermissionModal-AFHI5J4S.cjs +92 -0
- package/dist/LocationPermissionModal-AFHI5J4S.cjs.map +1 -0
- package/dist/LocationPermissionModal-MURJ5DDB.js +90 -0
- package/dist/LocationPermissionModal-MURJ5DDB.js.map +1 -0
- package/dist/ManageCollectionsModal-E3IUHUTO.cjs +402 -0
- package/dist/ManageCollectionsModal-E3IUHUTO.cjs.map +1 -0
- package/dist/ManageCollectionsModal-FIHSZXSR.js +400 -0
- package/dist/ManageCollectionsModal-FIHSZXSR.js.map +1 -0
- package/dist/NewCollectionModal-7TBWVA3G.js +75 -0
- package/dist/NewCollectionModal-7TBWVA3G.js.map +1 -0
- package/dist/NewCollectionModal-QFQYCKCG.cjs +77 -0
- package/dist/NewCollectionModal-QFQYCKCG.cjs.map +1 -0
- package/dist/RoadAccessModal-DNUJV5PC.js +57 -0
- package/dist/RoadAccessModal-DNUJV5PC.js.map +1 -0
- package/dist/RoadAccessModal-WLLL2ASZ.cjs +59 -0
- package/dist/RoadAccessModal-WLLL2ASZ.cjs.map +1 -0
- package/dist/SegmentColorPicker-7Y4JEPFC.cjs +81 -0
- package/dist/SegmentColorPicker-7Y4JEPFC.cjs.map +1 -0
- package/dist/SegmentColorPicker-UNLPITUA.js +79 -0
- package/dist/SegmentColorPicker-UNLPITUA.js.map +1 -0
- package/dist/SegmentGroupModal-F54FZUR2.cjs +32 -0
- package/dist/SegmentGroupModal-F54FZUR2.cjs.map +1 -0
- package/dist/SegmentGroupModal-KBU7OPNJ.js +23 -0
- package/dist/SegmentGroupModal-KBU7OPNJ.js.map +1 -0
- package/dist/ShareCollectionModal-TWYE6JJ4.cjs +82 -0
- package/dist/ShareCollectionModal-TWYE6JJ4.cjs.map +1 -0
- package/dist/ShareCollectionModal-VXSRHX4S.js +80 -0
- package/dist/ShareCollectionModal-VXSRHX4S.js.map +1 -0
- package/dist/ShareModal-HLYNE7OL.js +115 -0
- package/dist/ShareModal-HLYNE7OL.js.map +1 -0
- package/dist/ShareModal-WISND27S.cjs +117 -0
- package/dist/ShareModal-WISND27S.cjs.map +1 -0
- package/dist/VideoExportWizard-BSDWA3B5.js +44 -0
- package/dist/VideoExportWizard-BSDWA3B5.js.map +1 -0
- package/dist/VideoExportWizard-UOHR4MNS.cjs +53 -0
- package/dist/VideoExportWizard-UOHR4MNS.cjs.map +1 -0
- package/dist/WaypointDetailsModal-LK5LBK6S.js +270 -0
- package/dist/WaypointDetailsModal-LK5LBK6S.js.map +1 -0
- package/dist/WaypointDetailsModal-MEMOLLUY.cjs +272 -0
- package/dist/WaypointDetailsModal-MEMOLLUY.cjs.map +1 -0
- package/dist/WaypointWorkbench-DCCLBURG.cjs +1204 -0
- package/dist/WaypointWorkbench-DCCLBURG.cjs.map +1 -0
- package/dist/WaypointWorkbench-NRCLGU23.js +1202 -0
- package/dist/WaypointWorkbench-NRCLGU23.js.map +1 -0
- package/dist/chunk-22BNE3YV.js +13 -0
- package/dist/chunk-22BNE3YV.js.map +1 -0
- package/dist/chunk-24RNBTO2.cjs +154 -0
- package/dist/chunk-24RNBTO2.cjs.map +1 -0
- package/dist/chunk-2DDL2LIJ.cjs +65 -0
- package/dist/chunk-2DDL2LIJ.cjs.map +1 -0
- package/dist/chunk-2GAMKPS2.cjs +16 -0
- package/dist/chunk-2GAMKPS2.cjs.map +1 -0
- package/dist/chunk-2K4HCCZJ.cjs +51 -0
- package/dist/chunk-2K4HCCZJ.cjs.map +1 -0
- package/dist/chunk-2MHWH3TS.cjs +119 -0
- package/dist/chunk-2MHWH3TS.cjs.map +1 -0
- package/dist/chunk-2MQBPZNR.cjs +12 -0
- package/dist/chunk-2MQBPZNR.cjs.map +1 -0
- package/dist/chunk-2QSPCXLM.js +84 -0
- package/dist/chunk-2QSPCXLM.js.map +1 -0
- package/dist/chunk-32WRG44G.js +66 -0
- package/dist/chunk-32WRG44G.js.map +1 -0
- package/dist/chunk-32XMYLEB.js +9 -0
- package/dist/chunk-32XMYLEB.js.map +1 -0
- package/dist/chunk-3BEHHSVE.cjs +790 -0
- package/dist/chunk-3BEHHSVE.cjs.map +1 -0
- package/dist/chunk-3HF2XZKQ.js +8 -0
- package/dist/chunk-3HF2XZKQ.js.map +1 -0
- package/dist/chunk-3K2NX5FH.js +51 -0
- package/dist/chunk-3K2NX5FH.js.map +1 -0
- package/dist/chunk-3Q23QKNI.cjs +26 -0
- package/dist/chunk-3Q23QKNI.cjs.map +1 -0
- package/dist/chunk-3TQV2M4C.cjs +16 -0
- package/dist/chunk-3TQV2M4C.cjs.map +1 -0
- package/dist/chunk-3XDKDTE6.js +16 -0
- package/dist/chunk-3XDKDTE6.js.map +1 -0
- package/dist/chunk-46EARJWC.js +288 -0
- package/dist/chunk-46EARJWC.js.map +1 -0
- package/dist/chunk-4DQOJIUV.js +96 -0
- package/dist/chunk-4DQOJIUV.js.map +1 -0
- package/dist/chunk-4T52NAVT.js +10 -0
- package/dist/chunk-4T52NAVT.js.map +1 -0
- package/dist/chunk-4TPRVQGY.js +12 -0
- package/dist/chunk-4TPRVQGY.js.map +1 -0
- package/dist/chunk-4TX5E63A.cjs +12 -0
- package/dist/chunk-4TX5E63A.cjs.map +1 -0
- package/dist/chunk-4VKJF24B.js +22 -0
- package/dist/chunk-4VKJF24B.js.map +1 -0
- package/dist/chunk-4Z734K3L.js +15 -0
- package/dist/chunk-4Z734K3L.js.map +1 -0
- package/dist/chunk-4ZRSEOZM.js +629 -0
- package/dist/chunk-4ZRSEOZM.js.map +1 -0
- package/dist/chunk-52T3VZR5.js +55 -0
- package/dist/chunk-52T3VZR5.js.map +1 -0
- package/dist/chunk-56DP2X7U.js +15 -0
- package/dist/chunk-56DP2X7U.js.map +1 -0
- package/dist/chunk-5AHT62LO.js +24 -0
- package/dist/chunk-5AHT62LO.js.map +1 -0
- package/dist/chunk-5BR4CTVV.cjs +17 -0
- package/dist/chunk-5BR4CTVV.cjs.map +1 -0
- package/dist/chunk-5CTZOFDV.cjs +17 -0
- package/dist/chunk-5CTZOFDV.cjs.map +1 -0
- package/dist/chunk-5F55MFIX.cjs +45 -0
- package/dist/chunk-5F55MFIX.cjs.map +1 -0
- package/dist/chunk-5FMQJ4A4.cjs +362 -0
- package/dist/chunk-5FMQJ4A4.cjs.map +1 -0
- package/dist/chunk-5PMEAMHS.js +82 -0
- package/dist/chunk-5PMEAMHS.js.map +1 -0
- package/dist/chunk-676DNRSN.js +85 -0
- package/dist/chunk-676DNRSN.js.map +1 -0
- package/dist/chunk-6H2F7JKL.js +179 -0
- package/dist/chunk-6H2F7JKL.js.map +1 -0
- package/dist/chunk-6HMRMON7.js +10 -0
- package/dist/chunk-6HMRMON7.js.map +1 -0
- package/dist/chunk-6NKPZ3LT.cjs +14 -0
- package/dist/chunk-6NKPZ3LT.cjs.map +1 -0
- package/dist/chunk-6TG2HZDG.js +75 -0
- package/dist/chunk-6TG2HZDG.js.map +1 -0
- package/dist/chunk-6WU7XEQA.cjs +103 -0
- package/dist/chunk-6WU7XEQA.cjs.map +1 -0
- package/dist/chunk-6YD325QI.cjs +90 -0
- package/dist/chunk-6YD325QI.cjs.map +1 -0
- package/dist/chunk-7B6TUEL5.js +20 -0
- package/dist/chunk-7B6TUEL5.js.map +1 -0
- package/dist/chunk-7KS5F27H.js +33 -0
- package/dist/chunk-7KS5F27H.js.map +1 -0
- package/dist/chunk-A2N6553V.cjs +295 -0
- package/dist/chunk-A2N6553V.cjs.map +1 -0
- package/dist/chunk-A66FJAVG.js +44 -0
- package/dist/chunk-A66FJAVG.js.map +1 -0
- package/dist/chunk-AF43JU4W.js +27 -0
- package/dist/chunk-AF43JU4W.js.map +1 -0
- package/dist/chunk-AHGHAWYR.js +99 -0
- package/dist/chunk-AHGHAWYR.js.map +1 -0
- package/dist/chunk-AKN5KIZT.js +1969 -0
- package/dist/chunk-AKN5KIZT.js.map +1 -0
- package/dist/chunk-ANTDR5MJ.cjs +12 -0
- package/dist/chunk-ANTDR5MJ.cjs.map +1 -0
- package/dist/chunk-AQ5JIIAE.js +26 -0
- package/dist/chunk-AQ5JIIAE.js.map +1 -0
- package/dist/chunk-ARHO5MLJ.js +10 -0
- package/dist/chunk-ARHO5MLJ.js.map +1 -0
- package/dist/chunk-BAYGKSWY.cjs +26 -0
- package/dist/chunk-BAYGKSWY.cjs.map +1 -0
- package/dist/chunk-BEJ5I724.js +8 -0
- package/dist/chunk-BEJ5I724.js.map +1 -0
- package/dist/chunk-BFNXXLVV.cjs +34 -0
- package/dist/chunk-BFNXXLVV.cjs.map +1 -0
- package/dist/chunk-BFQJDFGB.js +57 -0
- package/dist/chunk-BFQJDFGB.js.map +1 -0
- package/dist/chunk-CHEQJ6N7.cjs +2214 -0
- package/dist/chunk-CHEQJ6N7.cjs.map +1 -0
- package/dist/chunk-CJOJWZM7.js +92 -0
- package/dist/chunk-CJOJWZM7.js.map +1 -0
- package/dist/chunk-CJRSFC45.cjs +578 -0
- package/dist/chunk-CJRSFC45.cjs.map +1 -0
- package/dist/chunk-CWQ4WHPI.cjs +46 -0
- package/dist/chunk-CWQ4WHPI.cjs.map +1 -0
- package/dist/chunk-D3INXUFT.js +360 -0
- package/dist/chunk-D3INXUFT.js.map +1 -0
- package/dist/chunk-D6CDAYZ6.cjs +18 -0
- package/dist/chunk-D6CDAYZ6.cjs.map +1 -0
- package/dist/chunk-DDPXRXRD.cjs +23 -0
- package/dist/chunk-DDPXRXRD.cjs.map +1 -0
- package/dist/chunk-DUUPWSOZ.cjs +14 -0
- package/dist/chunk-DUUPWSOZ.cjs.map +1 -0
- package/dist/chunk-DVWYOHOB.cjs +43 -0
- package/dist/chunk-DVWYOHOB.cjs.map +1 -0
- package/dist/chunk-DZPHWBMC.cjs +11 -0
- package/dist/chunk-DZPHWBMC.cjs.map +1 -0
- package/dist/chunk-E26FROI3.js +68 -0
- package/dist/chunk-E26FROI3.js.map +1 -0
- package/dist/chunk-E7ZTDAQW.cjs +37 -0
- package/dist/chunk-E7ZTDAQW.cjs.map +1 -0
- package/dist/chunk-ECI4EKIV.cjs +94 -0
- package/dist/chunk-ECI4EKIV.cjs.map +1 -0
- package/dist/chunk-EN5RWYHP.cjs +28 -0
- package/dist/chunk-EN5RWYHP.cjs.map +1 -0
- package/dist/chunk-ET3UASEF.cjs +91 -0
- package/dist/chunk-ET3UASEF.cjs.map +1 -0
- package/dist/chunk-EW5SY246.cjs +97 -0
- package/dist/chunk-EW5SY246.cjs.map +1 -0
- package/dist/chunk-EWWHVV7R.cjs +18 -0
- package/dist/chunk-EWWHVV7R.cjs.map +1 -0
- package/dist/chunk-F2LZZC6X.js +90 -0
- package/dist/chunk-F2LZZC6X.js.map +1 -0
- package/dist/chunk-F6VFOI4U.cjs +12 -0
- package/dist/chunk-F6VFOI4U.cjs.map +1 -0
- package/dist/chunk-FGX3TEU4.cjs +12 -0
- package/dist/chunk-FGX3TEU4.cjs.map +1 -0
- package/dist/chunk-FK4F24KE.js +10 -0
- package/dist/chunk-FK4F24KE.js.map +1 -0
- package/dist/chunk-FLIGKB6K.js +313 -0
- package/dist/chunk-FLIGKB6K.js.map +1 -0
- package/dist/chunk-G2NDWNFB.cjs +185 -0
- package/dist/chunk-G2NDWNFB.cjs.map +1 -0
- package/dist/chunk-G2XORRLH.js +15 -0
- package/dist/chunk-G2XORRLH.js.map +1 -0
- package/dist/chunk-GIZN7NX5.cjs +25 -0
- package/dist/chunk-GIZN7NX5.cjs.map +1 -0
- package/dist/chunk-GM2BQ24D.js +47 -0
- package/dist/chunk-GM2BQ24D.js.map +1 -0
- package/dist/chunk-GMQJZ5N7.cjs +50 -0
- package/dist/chunk-GMQJZ5N7.cjs.map +1 -0
- package/dist/chunk-GT7RJOAA.cjs +315 -0
- package/dist/chunk-GT7RJOAA.cjs.map +1 -0
- package/dist/chunk-GWGUMPOL.js +9 -0
- package/dist/chunk-GWGUMPOL.js.map +1 -0
- package/dist/chunk-GWVKSSE3.cjs +154 -0
- package/dist/chunk-GWVKSSE3.cjs.map +1 -0
- package/dist/chunk-GY7UMPHT.cjs +99 -0
- package/dist/chunk-GY7UMPHT.cjs.map +1 -0
- package/dist/chunk-HMVBS5DU.js +150 -0
- package/dist/chunk-HMVBS5DU.js.map +1 -0
- package/dist/chunk-HXHA2C7C.js +169 -0
- package/dist/chunk-HXHA2C7C.js.map +1 -0
- package/dist/chunk-IHMOFX2A.js +208 -0
- package/dist/chunk-IHMOFX2A.js.map +1 -0
- package/dist/chunk-II6C3LU2.cjs +49 -0
- package/dist/chunk-II6C3LU2.cjs.map +1 -0
- package/dist/chunk-IOOAFCSR.cjs +58 -0
- package/dist/chunk-IOOAFCSR.cjs.map +1 -0
- package/dist/chunk-IQZSIOMM.js +10 -0
- package/dist/chunk-IQZSIOMM.js.map +1 -0
- package/dist/chunk-J2H3WIUM.cjs +12 -0
- package/dist/chunk-J2H3WIUM.cjs.map +1 -0
- package/dist/chunk-J62OBSUE.cjs +54 -0
- package/dist/chunk-J62OBSUE.cjs.map +1 -0
- package/dist/chunk-JFJVSJUX.cjs +16 -0
- package/dist/chunk-JFJVSJUX.cjs.map +1 -0
- package/dist/chunk-JI2M77Y7.cjs +68 -0
- package/dist/chunk-JI2M77Y7.cjs.map +1 -0
- package/dist/chunk-JLSOLL3C.js +31 -0
- package/dist/chunk-JLSOLL3C.js.map +1 -0
- package/dist/chunk-JRME3LCP.cjs +41 -0
- package/dist/chunk-JRME3LCP.cjs.map +1 -0
- package/dist/chunk-JUD3CWTI.cjs +2005 -0
- package/dist/chunk-JUD3CWTI.cjs.map +1 -0
- package/dist/chunk-JVFHF3LE.cjs +11 -0
- package/dist/chunk-JVFHF3LE.cjs.map +1 -0
- package/dist/chunk-JVS2WNKQ.js +26 -0
- package/dist/chunk-JVS2WNKQ.js.map +1 -0
- package/dist/chunk-JXAFIYLV.js +94 -0
- package/dist/chunk-JXAFIYLV.js.map +1 -0
- package/dist/chunk-K2E744ST.cjs +18 -0
- package/dist/chunk-K2E744ST.cjs.map +1 -0
- package/dist/chunk-K2ZEMBJ7.js +56 -0
- package/dist/chunk-K2ZEMBJ7.js.map +1 -0
- package/dist/chunk-KCXNMLKB.js +22 -0
- package/dist/chunk-KCXNMLKB.js.map +1 -0
- package/dist/chunk-KMMDPXY4.js +35 -0
- package/dist/chunk-KMMDPXY4.js.map +1 -0
- package/dist/chunk-KMSGFBAJ.cjs +78 -0
- package/dist/chunk-KMSGFBAJ.cjs.map +1 -0
- package/dist/chunk-KPD7K4XQ.cjs +11 -0
- package/dist/chunk-KPD7K4XQ.cjs.map +1 -0
- package/dist/chunk-KUD3B3BA.js +12 -0
- package/dist/chunk-KUD3B3BA.js.map +1 -0
- package/dist/chunk-L62LSMJ5.js +9 -0
- package/dist/chunk-L62LSMJ5.js.map +1 -0
- package/dist/chunk-LB57H6LF.cjs +261 -0
- package/dist/chunk-LB57H6LF.cjs.map +1 -0
- package/dist/chunk-LCPKNSC4.cjs +48 -0
- package/dist/chunk-LCPKNSC4.cjs.map +1 -0
- package/dist/chunk-LE3W2CSF.cjs +84 -0
- package/dist/chunk-LE3W2CSF.cjs.map +1 -0
- package/dist/chunk-LG736CNC.js +13 -0
- package/dist/chunk-LG736CNC.js.map +1 -0
- package/dist/chunk-LGNTAZ3L.cjs +33 -0
- package/dist/chunk-LGNTAZ3L.cjs.map +1 -0
- package/dist/chunk-LHXINV6N.cjs +47 -0
- package/dist/chunk-LHXINV6N.cjs.map +1 -0
- package/dist/chunk-LLZUTIQB.cjs +24 -0
- package/dist/chunk-LLZUTIQB.cjs.map +1 -0
- package/dist/chunk-LPGXRU7R.cjs +12 -0
- package/dist/chunk-LPGXRU7R.cjs.map +1 -0
- package/dist/chunk-MA2BBWF5.cjs +96 -0
- package/dist/chunk-MA2BBWF5.cjs.map +1 -0
- package/dist/chunk-MLGORMWF.js +23 -0
- package/dist/chunk-MLGORMWF.js.map +1 -0
- package/dist/chunk-MO7XCKLA.js +62 -0
- package/dist/chunk-MO7XCKLA.js.map +1 -0
- package/dist/chunk-N37UE6RQ.cjs +1797 -0
- package/dist/chunk-N37UE6RQ.cjs.map +1 -0
- package/dist/chunk-N6NWKUOR.cjs +60 -0
- package/dist/chunk-N6NWKUOR.cjs.map +1 -0
- package/dist/chunk-NI5CAMFC.js +568 -0
- package/dist/chunk-NI5CAMFC.js.map +1 -0
- package/dist/chunk-NNLCZGZK.js +21 -0
- package/dist/chunk-NNLCZGZK.js.map +1 -0
- package/dist/chunk-NWHFUVYX.js +97 -0
- package/dist/chunk-NWHFUVYX.js.map +1 -0
- package/dist/chunk-OMDB6ZB2.cjs +176 -0
- package/dist/chunk-OMDB6ZB2.cjs.map +1 -0
- package/dist/chunk-P5W4TRJO.cjs +33 -0
- package/dist/chunk-P5W4TRJO.cjs.map +1 -0
- package/dist/chunk-PADS6TDO.js +89 -0
- package/dist/chunk-PADS6TDO.js.map +1 -0
- package/dist/chunk-PFLNOHBT.js +92 -0
- package/dist/chunk-PFLNOHBT.js.map +1 -0
- package/dist/chunk-PTLYNDZS.cjs +13 -0
- package/dist/chunk-PTLYNDZS.cjs.map +1 -0
- package/dist/chunk-QC3X4DAW.cjs +71 -0
- package/dist/chunk-QC3X4DAW.cjs.map +1 -0
- package/dist/chunk-QPTICYGD.cjs +272 -0
- package/dist/chunk-QPTICYGD.cjs.map +1 -0
- package/dist/chunk-QZ7W2E4U.cjs +319 -0
- package/dist/chunk-QZ7W2E4U.cjs.map +1 -0
- package/dist/chunk-RJJPUPOY.cjs +97 -0
- package/dist/chunk-RJJPUPOY.cjs.map +1 -0
- package/dist/chunk-RRSMCCFS.js +43 -0
- package/dist/chunk-RRSMCCFS.js.map +1 -0
- package/dist/chunk-S6VCR6F5.js +91 -0
- package/dist/chunk-S6VCR6F5.js.map +1 -0
- package/dist/chunk-S7Y2GMYJ.cjs +89 -0
- package/dist/chunk-S7Y2GMYJ.cjs.map +1 -0
- package/dist/chunk-SIMEDLX3.cjs +645 -0
- package/dist/chunk-SIMEDLX3.cjs.map +1 -0
- package/dist/chunk-SQYF7HKF.cjs +59 -0
- package/dist/chunk-SQYF7HKF.cjs.map +1 -0
- package/dist/chunk-ST7BNVC2.cjs +13 -0
- package/dist/chunk-ST7BNVC2.cjs.map +1 -0
- package/dist/chunk-SZVRMMLS.js +16 -0
- package/dist/chunk-SZVRMMLS.js.map +1 -0
- package/dist/chunk-T27LICRD.js +2212 -0
- package/dist/chunk-T27LICRD.js.map +1 -0
- package/dist/chunk-TAU5HGJ3.cjs +11 -0
- package/dist/chunk-TAU5HGJ3.cjs.map +1 -0
- package/dist/chunk-TOM7TV5E.js +25 -0
- package/dist/chunk-TOM7TV5E.js.map +1 -0
- package/dist/chunk-TSRUDRT3.js +59 -0
- package/dist/chunk-TSRUDRT3.js.map +1 -0
- package/dist/chunk-U4FX33MW.js +257 -0
- package/dist/chunk-U4FX33MW.js.map +1 -0
- package/dist/chunk-UBOPWQWC.cjs +28 -0
- package/dist/chunk-UBOPWQWC.cjs.map +1 -0
- package/dist/chunk-UFE26GNF.js +42 -0
- package/dist/chunk-UFE26GNF.js.map +1 -0
- package/dist/chunk-UMQQVTEO.js +257 -0
- package/dist/chunk-UMQQVTEO.js.map +1 -0
- package/dist/chunk-UWY3SFAS.js +10 -0
- package/dist/chunk-UWY3SFAS.js.map +1 -0
- package/dist/chunk-V6EIIZPJ.js +57 -0
- package/dist/chunk-V6EIIZPJ.js.map +1 -0
- package/dist/chunk-V6G6W5CF.cjs +61 -0
- package/dist/chunk-V6G6W5CF.cjs.map +1 -0
- package/dist/chunk-VC4ZBWOK.js +152 -0
- package/dist/chunk-VC4ZBWOK.js.map +1 -0
- package/dist/chunk-VJRF6ILX.js +35 -0
- package/dist/chunk-VJRF6ILX.js.map +1 -0
- package/dist/chunk-VNSLCFO4.js +787 -0
- package/dist/chunk-VNSLCFO4.js.map +1 -0
- package/dist/chunk-W7GAP7ST.js +21 -0
- package/dist/chunk-W7GAP7ST.js.map +1 -0
- package/dist/chunk-WFUASJHS.js +64 -0
- package/dist/chunk-WFUASJHS.js.map +1 -0
- package/dist/chunk-WIKSIT3M.js +46 -0
- package/dist/chunk-WIKSIT3M.js.map +1 -0
- package/dist/chunk-WKLZLFLY.cjs +32 -0
- package/dist/chunk-WKLZLFLY.cjs.map +1 -0
- package/dist/chunk-WNB5HYON.cjs +10 -0
- package/dist/chunk-WNB5HYON.cjs.map +1 -0
- package/dist/chunk-WO5P2XBP.js +86 -0
- package/dist/chunk-WO5P2XBP.js.map +1 -0
- package/dist/chunk-WPYC4NGZ.cjs +46 -0
- package/dist/chunk-WPYC4NGZ.cjs.map +1 -0
- package/dist/chunk-WQRYZY67.cjs +89 -0
- package/dist/chunk-WQRYZY67.cjs.map +1 -0
- package/dist/chunk-WVCYVMJU.js +11 -0
- package/dist/chunk-WVCYVMJU.js.map +1 -0
- package/dist/chunk-WX25G2S3.js +116 -0
- package/dist/chunk-WX25G2S3.js.map +1 -0
- package/dist/chunk-X4FE7RRQ.js +23 -0
- package/dist/chunk-X4FE7RRQ.js.map +1 -0
- package/dist/chunk-X6EIJNOQ.cjs +67 -0
- package/dist/chunk-X6EIJNOQ.cjs.map +1 -0
- package/dist/chunk-XUBATJH6.js +1769 -0
- package/dist/chunk-XUBATJH6.js.map +1 -0
- package/dist/chunk-XUMREYMG.js +293 -0
- package/dist/chunk-XUMREYMG.js.map +1 -0
- package/dist/chunk-XYAJ2FS2.js +31 -0
- package/dist/chunk-XYAJ2FS2.js.map +1 -0
- package/dist/chunk-YKES5P4H.cjs +58 -0
- package/dist/chunk-YKES5P4H.cjs.map +1 -0
- package/dist/chunk-YYAQ75AV.cjs +216 -0
- package/dist/chunk-YYAQ75AV.cjs.map +1 -0
- package/dist/chunk-YZ3NJKVV.js +42 -0
- package/dist/chunk-YZ3NJKVV.js.map +1 -0
- package/dist/chunk-Z5ECTUMN.cjs +104 -0
- package/dist/chunk-Z5ECTUMN.cjs.map +1 -0
- package/dist/chunk-ZAKVHYDL.cjs +28 -0
- package/dist/chunk-ZAKVHYDL.cjs.map +1 -0
- package/dist/chunk-ZF34JXGU.js +39 -0
- package/dist/chunk-ZF34JXGU.js.map +1 -0
- package/dist/chunk-ZHGWDP2M.cjs +101 -0
- package/dist/chunk-ZHGWDP2M.cjs.map +1 -0
- package/dist/chunk-ZLHTQQLT.js +13 -0
- package/dist/chunk-ZLHTQQLT.js.map +1 -0
- package/dist/chunk-ZPAMY3IZ.cjs +25 -0
- package/dist/chunk-ZPAMY3IZ.cjs.map +1 -0
- package/dist/chunk-ZR63UB4V.js +42 -0
- package/dist/chunk-ZR63UB4V.js.map +1 -0
- package/dist/chunk-ZRCEB3KL.js +11 -0
- package/dist/chunk-ZRCEB3KL.js.map +1 -0
- package/dist/chunk-ZRGQNRQI.cjs +36 -0
- package/dist/chunk-ZRGQNRQI.cjs.map +1 -0
- package/dist/chunk-ZVY4IL7O.cjs +22 -0
- package/dist/chunk-ZVY4IL7O.cjs.map +1 -0
- package/dist/chunk-ZWIVKODQ.js +49 -0
- package/dist/chunk-ZWIVKODQ.js.map +1 -0
- package/dist/chunk-ZYF2HNMZ.js +10 -0
- package/dist/chunk-ZYF2HNMZ.js.map +1 -0
- package/dist/copilot/index.cjs +43 -0
- package/dist/copilot/index.cjs.map +1 -0
- package/dist/copilot/index.d.cts +66 -0
- package/dist/copilot/index.d.ts +66 -0
- package/dist/copilot/index.js +30 -0
- package/dist/copilot/index.js.map +1 -0
- package/dist/directionsPdf-GITP3SCP.cjs +274 -0
- package/dist/directionsPdf-GITP3SCP.cjs.map +1 -0
- package/dist/directionsPdf-TDKVUBCU.js +272 -0
- package/dist/directionsPdf-TDKVUBCU.js.map +1 -0
- package/dist/embed/index.cjs +1816 -0
- package/dist/embed/index.cjs.map +1 -0
- package/dist/embed/index.d.cts +300 -0
- package/dist/embed/index.d.ts +300 -0
- package/dist/embed/index.js +1809 -0
- package/dist/embed/index.js.map +1 -0
- package/dist/headless/index.cjs +408 -0
- package/dist/headless/index.cjs.map +1 -0
- package/dist/headless/index.d.cts +23 -0
- package/dist/headless/index.d.ts +23 -0
- package/dist/headless/index.js +31 -0
- package/dist/headless/index.js.map +1 -0
- package/dist/hostRegistry-BTG-KkRY.d.cts +115 -0
- package/dist/hostRegistry-BTG-KkRY.d.ts +115 -0
- package/dist/import/index.cjs +433 -0
- package/dist/import/index.cjs.map +1 -0
- package/dist/import/index.d.cts +169 -0
- package/dist/import/index.d.ts +169 -0
- package/dist/import/index.js +421 -0
- package/dist/import/index.js.map +1 -0
- package/dist/index-CELBpE13.d.cts +4198 -0
- package/dist/index-nqc3A-ty.d.ts +4198 -0
- package/dist/index.cjs +10597 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4949 -0
- package/dist/index.d.ts +4949 -0
- package/dist/index.js +9907 -0
- package/dist/index.js.map +1 -0
- package/dist/map/index.cjs +122 -0
- package/dist/map/index.cjs.map +1 -0
- package/dist/map/index.d.cts +988 -0
- package/dist/map/index.d.ts +988 -0
- package/dist/map/index.js +25 -0
- package/dist/map/index.js.map +1 -0
- package/dist/routingGuidePictures-CxgXiuNd.d.cts +22 -0
- package/dist/routingGuidePictures-CxgXiuNd.d.ts +22 -0
- package/dist/studioStrings-lNvOeC1g.d.cts +72 -0
- package/dist/studioStrings-lNvOeC1g.d.ts +72 -0
- package/dist/styles.css +14677 -0
- package/dist/testing/index.cjs +357 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +319 -0
- package/dist/testing/index.d.ts +319 -0
- package/dist/testing/index.js +344 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/video/index.cjs +53 -0
- package/dist/video/index.cjs.map +1 -0
- package/dist/video/index.d.cts +127 -0
- package/dist/video/index.d.ts +127 -0
- package/dist/video/index.js +44 -0
- package/dist/video/index.js.map +1 -0
- package/package.json +227 -4
- package/src/agent/components/ActivityRow.tsx +226 -0
- package/src/agent/components/AgentEntityIndicator.tsx +67 -0
- package/src/agent/components/AgentMarkdown.tsx +530 -0
- package/src/agent/components/ChatComposer.tsx +161 -0
- package/src/agent/components/ChatTranscript.tsx +1358 -0
- package/src/agent/components/CopilotPanel.tsx +415 -0
- package/src/agent/components/CopilotStates.tsx +238 -0
- package/src/agent/components/CopilotTranscript.tsx +191 -0
- package/src/agent/components/MessageFeedback.tsx +100 -0
- package/src/agent/hooks/useAgentChatTransport.ts +61 -0
- package/src/agent/hooks/useAgentErrorCopy.ts +27 -0
- package/src/agent/hooks/useCopilotOpen.ts +68 -0
- package/src/agent/providers/AgentThreadsProvider.tsx +360 -0
- package/src/agent/providers/PromptPanelConversation.tsx +135 -0
- package/src/agent/rules/drawnNode.ts +24 -0
- package/src/alerts/components/MapAlerts.tsx +127 -0
- package/src/cache/hooks/useStudioCache.ts +40 -0
- package/src/cache/rules/studioCache.ts +145 -0
- package/src/collab/components/PeerEntityIndicator.tsx +150 -0
- package/src/collab/components/PresenceRoster.tsx +113 -0
- package/src/collab/components/peerLock.tsx +59 -0
- package/src/collab/hooks/useCollabOrganizationId.ts +24 -0
- package/src/collab/hooks/usePeerLockLabel.ts +41 -0
- package/src/collections/components/CollectionFormModal.tsx +280 -0
- package/src/collections/components/CollectionMultiSelect.tsx +640 -0
- package/src/collections/components/EditCollectionModal.tsx +114 -0
- package/src/collections/components/ManageCollectionsModal.tsx +692 -0
- package/src/collections/components/NewCollectionModal.tsx +87 -0
- package/src/collections/components/ShareCollectionModal.tsx +150 -0
- package/src/collections/hooks/useEntityCollections.ts +126 -0
- package/src/collections/hooks/useEveryPage.ts +33 -0
- package/src/controls/components/MapControlTooltip.tsx +84 -0
- package/src/controls/components/PoiOverlayMenu.tsx +342 -0
- package/src/controls/components/StudioControls.tsx +278 -0
- package/src/controls/rules/constants.ts +34 -0
- package/src/copilot/hooks/useStudioCopilotInset.ts +39 -0
- package/src/copilot/index.ts +29 -0
- package/src/directions/components/DirectionsModal.tsx +447 -0
- package/src/directions/components/directionsPdf.tsx +557 -0
- package/src/embed/components/DefaultViewControl.tsx +159 -0
- package/src/embed/components/EmbedBaseMapPicker.tsx +107 -0
- package/src/embed/components/EmbedCodeSection.tsx +329 -0
- package/src/embed/components/EmbedColumnsSection.tsx +167 -0
- package/src/embed/components/EmbedConfigForm.tsx +239 -0
- package/src/embed/components/EmbedElementSwitcher.tsx +87 -0
- package/src/embed/components/EmbedFieldControl.tsx +488 -0
- package/src/embed/components/EmbedGeneralSection.tsx +279 -0
- package/src/embed/components/EmbedKeyPanel.tsx +138 -0
- package/src/embed/components/EmbedSnippetCode.tsx +154 -0
- package/src/embed/components/EmbedStage.tsx +505 -0
- package/src/embed/components/EmbedTablePreview.tsx +134 -0
- package/src/embed/components/EmbedThemePicker.tsx +74 -0
- package/src/embed/components/EmbedTintPicker.tsx +76 -0
- package/src/embed/components/EmbedWizard.tsx +1031 -0
- package/src/embed/hooks/useEmbedCode.ts +170 -0
- package/src/embed/hooks/useEmbedCollectionItineraries.ts +42 -0
- package/src/embed/hooks/useEmbedLayerOptions.ts +75 -0
- package/src/embed/hooks/useEmbedPreviewCamera.ts +169 -0
- package/src/embed/index.ts +48 -0
- package/src/fullscreen/components/FullscreenHeader.tsx +77 -0
- package/src/fullscreen/components/FullscreenModal.tsx +80 -0
- package/src/fullscreen/components/WizardLayout.tsx +129 -0
- package/src/guards/components/AgentDrivingGuard.tsx +59 -0
- package/src/guards/components/UnsavedEditsGuard.tsx +210 -0
- package/src/guards/hooks/useReportUnsavedForm.ts +34 -0
- package/src/guards/hooks/useUnsavedEditsGuard.ts +44 -0
- package/src/headless/hooks/useAgentDriving.ts +21 -0
- package/src/headless/hooks/useBeginSegmentEdit.ts +89 -0
- package/src/headless/hooks/useBeginWaypointEdit.ts +74 -0
- package/src/headless/hooks/useCapabilitySet.ts +65 -0
- package/src/headless/hooks/useCollabResources.ts +148 -0
- package/src/headless/hooks/useCollectionScope.ts +37 -0
- package/src/headless/hooks/useEditActions.ts +250 -0
- package/src/headless/hooks/useEscapeKey.ts +43 -0
- package/src/headless/hooks/useInlineRename.ts +276 -0
- package/src/headless/hooks/useLiveAwareSegments.ts +88 -0
- package/src/headless/hooks/useLiveAwareWaypoints.ts +39 -0
- package/src/headless/hooks/useMapHoveredRow.ts +76 -0
- package/src/headless/hooks/usePlatformViewer.ts +452 -0
- package/src/headless/hooks/usePluginSlot.ts +235 -0
- package/src/headless/hooks/useRowEmphasis.ts +66 -0
- package/src/headless/hooks/useSegmentList.ts +428 -0
- package/src/headless/hooks/useSegmentRow.ts +366 -0
- package/src/headless/hooks/useSegmentRowActions.ts +267 -0
- package/src/headless/hooks/useShallowSelector.ts +145 -0
- package/src/headless/hooks/useStableMembers.ts +74 -0
- package/src/headless/hooks/useStoreSlice.ts +52 -0
- package/src/headless/hooks/useStreetViewCorridor.ts +120 -0
- package/src/headless/hooks/useStudioApi.ts +18 -0
- package/src/headless/hooks/useStudioDispatch.ts +181 -0
- package/src/headless/hooks/useStudioDispatchCount.ts +147 -0
- package/src/headless/hooks/useStudioDispatchUnsafe.ts +111 -0
- package/src/headless/hooks/useStudioEntitlement.ts +29 -0
- package/src/headless/hooks/useStudioFailureAlert.ts +67 -0
- package/src/headless/hooks/useStudioObserve.ts +38 -0
- package/src/headless/hooks/useStudioPreferences.ts +8 -0
- package/src/headless/hooks/useStudioSignedIn.ts +12 -0
- package/src/headless/hooks/useStudioStore.ts +72 -0
- package/src/headless/hooks/useStudioUnits.ts +23 -0
- package/src/headless/hooks/useStudioUrl.ts +24 -0
- package/src/headless/hooks/useStudioUserId.ts +5 -0
- package/src/headless/hooks/useStudioVerbHeld.ts +43 -0
- package/src/headless/hooks/useStudioViewer.ts +19 -0
- package/src/headless/hooks/useStudioViewerEntitlement.ts +40 -0
- package/src/headless/hooks/useStudioViewerItineraryLimit.ts +34 -0
- package/src/headless/hooks/useStudioViewerPreferences.ts +44 -0
- package/src/headless/hooks/useStudioViewerUnits.ts +50 -0
- package/src/headless/hooks/useStudioViewerUserId.ts +23 -0
- package/src/headless/hooks/useUiStore.ts +91 -0
- package/src/headless/hooks/useUiStoreShallow.ts +43 -0
- package/src/headless/hooks/useWaypointDetailsDialog.ts +52 -0
- package/src/headless/hooks/useWaypointList.ts +89 -0
- package/src/headless/hooks/useWaypointRow.ts +227 -0
- package/src/headless/hooks/useWaypointRowActions.ts +166 -0
- package/src/headless/index.ts +287 -0
- package/src/headless/providers/billingGate.tsx +129 -0
- package/src/headless/providers/copilot.tsx +155 -0
- package/src/headless/providers/mountayaStudio.tsx +126 -0
- package/src/headless/providers/navigationBlocker.tsx +91 -0
- package/src/headless/providers/notify.tsx +36 -0
- package/src/headless/providers/organizations.tsx +267 -0
- package/src/headless/providers/plugins.tsx +173 -0
- package/src/headless/providers/studio.tsx +1295 -0
- package/src/headless/providers/studioStrings.tsx +243 -0
- package/src/headless/rules/inputMethod.ts +19 -0
- package/src/hooks/useAgreementLimits.ts +165 -0
- package/src/hooks/useLayerCatalogOptions.ts +106 -0
- package/src/host/components/MountayaStudioHost.tsx +1018 -0
- package/src/host/hooks/useEmbeddedStudio.ts +24 -0
- package/src/host/hooks/useItineraryActivation.ts +126 -0
- package/src/host/hooks/useMemberGrants.ts +51 -0
- package/src/host/hooks/useStudioHostSurfaces.ts +100 -0
- package/src/host/hooks/useStudioPluginBinding.ts +133 -0
- package/src/host/hooks/useStudioSessionHeld.ts +111 -0
- package/src/host/hooks/useStudioToolBus.ts +127 -0
- package/src/host/hooks/useStudioToolContext.ts +175 -0
- package/src/host/providers/hostRegistry.tsx +144 -0
- package/src/host/providers/hostSurface.tsx +47 -0
- package/src/host/providers/hostVideo.tsx +73 -0
- package/src/import/components/DraftEntityList.tsx +298 -0
- package/src/import/components/FileDropInput.tsx +261 -0
- package/src/import/components/FileDropzone.tsx +97 -0
- package/src/import/components/ImportItineraryContent.tsx +133 -0
- package/src/import/components/ImportPreviewLegend.tsx +50 -0
- package/src/import/components/ImportPrimer.tsx +113 -0
- package/src/import/index.ts +32 -0
- package/src/import/providers/ImportRoutingGuideProvider.tsx +319 -0
- package/src/import/rules/routingGuidePictures.ts +20 -0
- package/src/index.ts +633 -0
- package/src/internal/components/Glyph.tsx +34 -0
- package/src/internal/components/MarkerGlyph.tsx +23 -0
- package/src/internal/components/MountayaMark.tsx +142 -0
- package/src/internal/hooks/useTextOverflow.ts +90 -0
- package/src/internal/providers/studioEditorRoot.tsx +42 -0
- package/src/internal/rules/editorRoot.ts +9 -0
- package/src/internal/rules/missingSeam.ts +32 -0
- package/src/itinerary/components/ActivityGuideModal.tsx +345 -0
- package/src/itinerary/components/ActivitySelect.tsx +204 -0
- package/src/itinerary/components/AddWaypointButton.tsx +151 -0
- package/src/itinerary/components/AscentInput.tsx +65 -0
- package/src/itinerary/components/Characteristics.tsx +129 -0
- package/src/itinerary/components/CursorReadout.tsx +66 -0
- package/src/itinerary/components/DistanceInput.tsx +67 -0
- package/src/itinerary/components/DraftProvenanceBanner.tsx +79 -0
- package/src/itinerary/components/DuplicateItineraryModal.tsx +341 -0
- package/src/itinerary/components/EditorSaveFooter.tsx +424 -0
- package/src/itinerary/components/ItineraryActionsMenu.tsx +655 -0
- package/src/itinerary/components/ItineraryForm.tsx +887 -0
- package/src/itinerary/components/ItineraryHeaderIdentity.tsx +121 -0
- package/src/itinerary/components/ItineraryHeaderMeta.tsx +68 -0
- package/src/itinerary/components/ItineraryHeaderTitle.tsx +88 -0
- package/src/itinerary/components/ItineraryIdentityFields.tsx +153 -0
- package/src/itinerary/components/ItineraryProfilePanel.tsx +619 -0
- package/src/itinerary/components/ItineraryProfileSheet.tsx +219 -0
- package/src/itinerary/components/ItinerarySubHeader.tsx +236 -0
- package/src/itinerary/components/PendingProfile.tsx +142 -0
- package/src/itinerary/components/PlaceCard.tsx +35 -0
- package/src/itinerary/components/PlaceMark.tsx +76 -0
- package/src/itinerary/components/ProfileAnalysisBars.tsx +84 -0
- package/src/itinerary/components/ProfileBar.tsx +215 -0
- package/src/itinerary/components/ProfileHeaderControls.tsx +116 -0
- package/src/itinerary/components/ProfileHeaderFigures.tsx +119 -0
- package/src/itinerary/components/ProfilePaceControl.tsx +97 -0
- package/src/itinerary/components/ProfileStat.tsx +76 -0
- package/src/itinerary/components/ProfileStatStrip.tsx +38 -0
- package/src/itinerary/components/RoadAccessModal.tsx +76 -0
- package/src/itinerary/components/RouteTypeControl.tsx +73 -0
- package/src/itinerary/components/SegmentGroupModal.tsx +311 -0
- package/src/itinerary/components/SegmentGroupRangePicker.tsx +228 -0
- package/src/itinerary/components/StagingCreateFooter.tsx +185 -0
- package/src/itinerary/components/StudioItineraryProfile.tsx +620 -0
- package/src/itinerary/components/SuggestForm.tsx +256 -0
- package/src/itinerary/components/SuggestFormActions.tsx +124 -0
- package/src/itinerary/components/SuggestionResultRow.tsx +98 -0
- package/src/itinerary/components/SuggestionResultsList.tsx +85 -0
- package/src/itinerary/components/WaypointAmenityPicker.tsx +105 -0
- package/src/itinerary/components/WaypointDetailFields.tsx +604 -0
- package/src/itinerary/components/WaypointDetailsModal.tsx +134 -0
- package/src/itinerary/components/WaypointDetailsRows.tsx +707 -0
- package/src/itinerary/components/WaypointDetailsView.tsx +389 -0
- package/src/itinerary/components/WaypointIconCircle.tsx +211 -0
- package/src/itinerary/components/WaypointIconPicker.tsx +82 -0
- package/src/itinerary/components/WaypointMarkers.tsx +293 -0
- package/src/itinerary/components/WaypointPreviewCard.tsx +56 -0
- package/src/itinerary/components/WaypointSectionNav.tsx +151 -0
- package/src/itinerary/components/WaypointSwitcher.tsx +143 -0
- package/src/itinerary/components/WaypointWorkbench.tsx +263 -0
- package/src/itinerary/hooks/useDuplicateDraft.ts +205 -0
- package/src/itinerary/hooks/useDuplicateSource.ts +69 -0
- package/src/itinerary/hooks/useFriendlyNameBanks.ts +26 -0
- package/src/itinerary/hooks/useItineraryEditable.ts +89 -0
- package/src/itinerary/hooks/useItineraryPace.ts +103 -0
- package/src/itinerary/hooks/useItinerarySubject.ts +117 -0
- package/src/itinerary/hooks/useOpenItineraryEditable.ts +39 -0
- package/src/itinerary/hooks/useProfileOverlay.tsx +61 -0
- package/src/itinerary/hooks/useProfileSeries.ts +95 -0
- package/src/itinerary/hooks/useProfileVisibility.ts +149 -0
- package/src/itinerary/hooks/useSeedDraftOrganization.ts +85 -0
- package/src/itinerary/hooks/useSegmentGroupSave.ts +143 -0
- package/src/itinerary/hooks/useStartFromSuggestion.ts +63 -0
- package/src/itinerary/hooks/useStudioItinerary.ts +35 -0
- package/src/itinerary/hooks/useSuggestionPin.ts +36 -0
- package/src/itinerary/hooks/useWaypointCardWords.ts +51 -0
- package/src/itinerary/hooks/useWaypointCreateFollowUp.ts +158 -0
- package/src/itinerary/hooks/useWaypointDetailsEditor.ts +280 -0
- package/src/itinerary/hooks/useWaypointSectionEntries.ts +114 -0
- package/src/itinerary/providers/ActivityGuideProvider.tsx +113 -0
- package/src/itinerary/providers/ItineraryViewProvider.tsx +146 -0
- package/src/itinerary/rules/amenityGlyphs.ts +25 -0
- package/src/itinerary/rules/cursorReadoutData.ts +34 -0
- package/src/itinerary/rules/profileCursor.ts +11 -0
- package/src/itinerary/rules/profileModel.ts +98 -0
- package/src/itinerary/rules/shownFocus.ts +11 -0
- package/src/itinerary/rules/waypointGlyphs.ts +42 -0
- package/src/itinerary/stores/profileHover.ts +54 -0
- package/src/lists/components/AddSegmentButton.tsx +240 -0
- package/src/lists/components/EditActions.tsx +153 -0
- package/src/lists/components/EditorListSection.tsx +117 -0
- package/src/lists/components/EditorSegmentRow.tsx +458 -0
- package/src/lists/components/ItineraryAddSegmentButton.tsx +66 -0
- package/src/lists/components/ItinerarySegmentList.tsx +301 -0
- package/src/lists/components/ItineraryWaypointList.tsx +257 -0
- package/src/lists/components/SegmentList.tsx +549 -0
- package/src/lists/components/SegmentSeam.tsx +292 -0
- package/src/lists/components/WaypointList.tsx +232 -0
- package/src/map/components/ContextMenuPopup.tsx +913 -0
- package/src/map/components/MapAnchoredPopup.tsx +284 -0
- package/src/map/components/SegmentViaPopup.tsx +133 -0
- package/src/map/hooks/useAccessRestrictions.ts +25 -0
- package/src/map/hooks/useEmbedConstraints.ts +359 -0
- package/src/map/hooks/useEmbedDisplaySeed.ts +61 -0
- package/src/map/hooks/useEmbedReady.ts +137 -0
- package/src/map/hooks/useHeldTileSources.ts +65 -0
- package/src/map/hooks/useSegmentColor.ts +24 -0
- package/src/map/hooks/useSpecificationLayers.ts +25 -0
- package/src/map/hooks/useStudioConstraints.ts +135 -0
- package/src/map/hooks/useStudioContextMenu.ts +34 -0
- package/src/map/hooks/useStudioContextMenuWaypoint.ts +119 -0
- package/src/map/hooks/useStudioEditCommitReporter.ts +56 -0
- package/src/map/hooks/useStudioEditEngine.ts +270 -0
- package/src/map/hooks/useStudioEnrichment.ts +117 -0
- package/src/map/hooks/useStudioItinerarySelection.ts +484 -0
- package/src/map/hooks/useStudioLayersScope.ts +34 -0
- package/src/map/hooks/useStudioMapBindings.ts +178 -0
- package/src/map/hooks/useStudioMapEditSeams.ts +161 -0
- package/src/map/hooks/useStudioMapSync.ts +127 -0
- package/src/map/hooks/useStudioOverlay.ts +75 -0
- package/src/map/hooks/useStudioOverlayWithdrawal.ts +52 -0
- package/src/map/hooks/useStudioOverlaysEntitled.ts +12 -0
- package/src/map/hooks/useStudioPeerDrafts.ts +126 -0
- package/src/map/hooks/useStudioPoiLayers.ts +110 -0
- package/src/map/hooks/useStudioPreviewSync.ts +205 -0
- package/src/map/hooks/useStudioSegmentEditing.ts +239 -0
- package/src/map/hooks/useStudioSegmentViaPrompt.ts +38 -0
- package/src/map/hooks/useStudioSplitPicking.ts +411 -0
- package/src/map/hooks/useStudioSuggestionPicking.ts +178 -0
- package/src/map/hooks/useStudioTimestamp.ts +226 -0
- package/src/map/hooks/useStudioUrlState.ts +340 -0
- package/src/map/hooks/useStudioWaypointEditing.ts +251 -0
- package/src/map/hooks/useStudioZoneEditing.ts +260 -0
- package/src/map/hooks/useStudioZoneOriginPicking.ts +129 -0
- package/src/map/hooks/useStudioZoneSelection.ts +240 -0
- package/src/map/hooks/useTileLayers.ts +33 -0
- package/src/map/index.ts +67 -0
- package/src/map/rules/editKeyboard.ts +216 -0
- package/src/map/rules/editTooltip.ts +222 -0
- package/src/map/rules/nearerEscape.ts +107 -0
- package/src/map/rules/poiGlyphs.ts +40 -0
- package/src/modals/components/AppModal.tsx +280 -0
- package/src/modals/components/ConfirmModal.tsx +223 -0
- package/src/modals/components/ExportModal.tsx +538 -0
- package/src/modals/components/LocationPermissionModal.tsx +129 -0
- package/src/modals/components/ModalFooter.tsx +187 -0
- package/src/modals/hooks/useConfirmGate.tsx +209 -0
- package/src/modals/hooks/useDiscardGuard.tsx +168 -0
- package/src/panels/components/EditShortcutHint.tsx +115 -0
- package/src/panels/components/FloatingOverlay.tsx +243 -0
- package/src/panels/components/GlyphPickerGrid.tsx +84 -0
- package/src/panels/components/PanelRouter.tsx +133 -0
- package/src/panels/components/PickerCard.tsx +108 -0
- package/src/panels/components/RadioOptionCard.tsx +116 -0
- package/src/panels/components/SidenavContentBody.tsx +56 -0
- package/src/panels/components/SidenavContentFooter.tsx +27 -0
- package/src/panels/components/SidenavContentHeader.tsx +172 -0
- package/src/panels/components/SidenavFormActions.tsx +96 -0
- package/src/panels/components/StudioFormStack.tsx +44 -0
- package/src/panels/components/StudioHeader.tsx +117 -0
- package/src/panels/components/StudioLayersPanel.tsx +909 -0
- package/src/panels/components/StudioPreferencesPanel.tsx +199 -0
- package/src/panels/rules/studioHeader.ts +68 -0
- package/src/plugins/components/PluginBoundary.tsx +62 -0
- package/src/plugins/components/PluginContextMenuActions.tsx +73 -0
- package/src/plugins/components/PluginControls.tsx +101 -0
- package/src/plugins/components/PluginHeldView.tsx +77 -0
- package/src/plugins/components/PluginMenuItems.tsx +63 -0
- package/src/plugins/components/PluginProfileHeader.tsx +71 -0
- package/src/plugins/components/PluginProfilePlot.tsx +134 -0
- package/src/plugins/components/PluginSlotItems.tsx +55 -0
- package/src/primitives/components/ActivityIcon.tsx +106 -0
- package/src/primitives/components/AllowlistField.tsx +508 -0
- package/src/primitives/components/CopyIconButton.tsx +80 -0
- package/src/primitives/components/DateTimeInput.tsx +133 -0
- package/src/primitives/components/DateTimePickerField.tsx +101 -0
- package/src/primitives/components/DescriptiveMenuItem.tsx +80 -0
- package/src/primitives/components/DialogSubject.tsx +102 -0
- package/src/primitives/components/DisabledMenuItem.tsx +45 -0
- package/src/primitives/components/DisabledReason.tsx +34 -0
- package/src/primitives/components/EmptyState.tsx +186 -0
- package/src/primitives/components/ErrorAlert.tsx +35 -0
- package/src/primitives/components/ErrorBoundary.tsx +55 -0
- package/src/primitives/components/FieldLabel.tsx +34 -0
- package/src/primitives/components/FormErrorAlert.tsx +33 -0
- package/src/primitives/components/GroupLabelledBy.tsx +31 -0
- package/src/primitives/components/LanguageSelect.tsx +139 -0
- package/src/primitives/components/ListSkeleton.tsx +64 -0
- package/src/primitives/components/MarqueeText.tsx +61 -0
- package/src/primitives/components/OrganizationScopeItem.tsx +146 -0
- package/src/primitives/components/OrganizationSelect.tsx +149 -0
- package/src/primitives/components/PointField.tsx +75 -0
- package/src/primitives/components/PrivacyControl.tsx +127 -0
- package/src/primitives/components/RenameInput.tsx +159 -0
- package/src/primitives/components/RequiredLabelWithHelp.tsx +76 -0
- package/src/primitives/components/SegmentIcon.tsx +43 -0
- package/src/primitives/components/SegmentIconLabel.tsx +37 -0
- package/src/primitives/components/SpeedInput.tsx +222 -0
- package/src/primitives/components/StudioSectionBoundary.tsx +56 -0
- package/src/primitives/components/StudioSegmentedControl.tsx +23 -0
- package/src/primitives/components/UnitPickerField.tsx +62 -0
- package/src/primitives/components/UnitPickerGrid.tsx +71 -0
- package/src/primitives/components/WarningAlert.tsx +34 -0
- package/src/primitives/hooks/useCompactLayout.ts +30 -0
- package/src/primitives/hooks/useSpeedControlLabel.ts +28 -0
- package/src/primitives/rules/activityBadge.ts +87 -0
- package/src/publication/components/PublicationBadge.tsx +42 -0
- package/src/publication/components/PublicationDot.tsx +31 -0
- package/src/publication/components/PublicationNotice.tsx +115 -0
- package/src/publication/components/PublicationSettledPill.tsx +43 -0
- package/src/publication/components/PublicationStatus.tsx +52 -0
- package/src/publication/components/UnpublishedPanel.tsx +133 -0
- package/src/publication/hooks/usePublicationHint.ts +235 -0
- package/src/publication/hooks/usePublishAct.ts +101 -0
- package/src/publication/hooks/usePublishItinerary.ts +27 -0
- package/src/publication/hooks/usePublishZone.ts +27 -0
- package/src/publication/hooks/usePublishableScope.ts +23 -0
- package/src/publication/hooks/usePublishedItinerary.ts +83 -0
- package/src/rows/components/ReadOnlySegmentRow.tsx +155 -0
- package/src/rows/components/RouteMetricLine.tsx +90 -0
- package/src/rows/components/RowMetadata.tsx +92 -0
- package/src/rows/components/SegmentRow.tsx +381 -0
- package/src/rows/components/SegmentRowActions.tsx +187 -0
- package/src/rows/components/SegmentRowBody.tsx +197 -0
- package/src/rows/components/StudioToggleRow.tsx +71 -0
- package/src/rows/components/SuggestionList.tsx +100 -0
- package/src/rows/components/SuggestionRowLayout.tsx +164 -0
- package/src/rows/components/WaypointRow.tsx +175 -0
- package/src/rows/components/WaypointRowLayout.tsx +278 -0
- package/src/rows/components/lockChrome.tsx +106 -0
- package/src/rules/menuActions.ts +149 -0
- package/src/rules/sizing.ts +127 -0
- package/src/rules/studioConfig.ts +719 -0
- package/src/search/components/CategoryTabs.tsx +136 -0
- package/src/search/components/ResultRow.tsx +242 -0
- package/src/search/components/ResultsList.tsx +182 -0
- package/src/search/components/SearchInput.tsx +100 -0
- package/src/search/components/SearchTab.tsx +614 -0
- package/src/sections/components/RailSwitcher.tsx +179 -0
- package/src/sections/components/SectionCard.tsx +48 -0
- package/src/sections/components/SectionHead.tsx +42 -0
- package/src/sections/components/SectionTabs.tsx +231 -0
- package/src/segments/components/SegmentColorCircle.tsx +118 -0
- package/src/segments/components/SegmentColorPicker.tsx +134 -0
- package/src/segments/components/SegmentModeControl.tsx +118 -0
- package/src/segments/components/SegmentRowMenu.tsx +449 -0
- package/src/segments/components/SegmentRowPopover.tsx +163 -0
- package/src/segments/components/SegmentSelect.tsx +116 -0
- package/src/segments/components/SegmentSpeedControl.tsx +299 -0
- package/src/share/components/ShareLinkManage.tsx +699 -0
- package/src/share/components/ShareModal.tsx +182 -0
- package/src/share/components/ShareSheet.tsx +178 -0
- package/src/share/components/ShareViewModal.tsx +131 -0
- package/src/share/hooks/useCanManageShareLink.ts +51 -0
- package/src/studio/components/MountayaStudio.tsx +1170 -0
- package/src/studio/components/MountayaStudioViewer.tsx +775 -0
- package/src/studio/hooks/useEmbeddedStudioConfig.ts +60 -0
- package/src/studio/hooks/useViewerActivation.ts +47 -0
- package/src/studio/hooks/useViewerCollectionSpecification.ts +58 -0
- package/src/studio/hooks/useViewerEmbedConfig.ts +74 -0
- package/src/studio/hooks/useViewerFraming.ts +211 -0
- package/src/studio/hooks/useViewerMapBindings.ts +109 -0
- package/src/styles.css +3993 -0
- package/src/testing/collections.ts +40 -0
- package/src/testing/hostRegistry.tsx +109 -0
- package/src/testing/index.ts +65 -0
- package/src/testing/itinerary.ts +297 -0
- package/src/testing/mountayaClient.tsx +218 -0
- package/src/testing/viewer.tsx +171 -0
- package/src/theme/components/StudioPortalScope.tsx +130 -0
- package/src/theme/hooks/useResolvedStudioTheme.ts +37 -0
- package/src/theme/rules/density.ts +157 -0
- package/src/theme/rules/mountayaStudioTheme.ts +114 -0
- package/src/theme/rules/passwordManager.ts +20 -0
- package/src/theme/rules/tokenStyle.ts +18 -0
- package/src/theme/rules/tokens.ts +71 -0
- package/src/theme/rules/tone.ts +34 -0
- package/src/theme/rules/zIndex.ts +40 -0
- package/src/video/components/CameraStep.tsx +82 -0
- package/src/video/components/DirectingScrim.tsx +28 -0
- package/src/video/components/DirectorChat.tsx +79 -0
- package/src/video/components/FormatStep.tsx +487 -0
- package/src/video/components/ModeCards.tsx +141 -0
- package/src/video/components/PlanNumberField.tsx +54 -0
- package/src/video/components/PreviewControls.tsx +212 -0
- package/src/video/components/PreviewStage.tsx +319 -0
- package/src/video/components/PreviewSurface.tsx +247 -0
- package/src/video/components/PreviewWatermark.tsx +77 -0
- package/src/video/components/ProfileOverlayCanvas.tsx +195 -0
- package/src/video/components/ProfileStep.tsx +254 -0
- package/src/video/components/RecordProgress.tsx +117 -0
- package/src/video/components/ReviewStep.tsx +244 -0
- package/src/video/components/ShotList.tsx +452 -0
- package/src/video/components/VideoExportWizard.tsx +829 -0
- package/src/video/components/WizardDirectingIndicator.tsx +57 -0
- package/src/video/components/WizardFooter.tsx +112 -0
- package/src/video/hooks/usePreviewPlanRefresh.ts +91 -0
- package/src/video/hooks/useVideoItinerarySubject.ts +18 -0
- package/src/video/hooks/useVideoOrganizationId.ts +30 -0
- package/src/video/hooks/useVideoPreviewSeed.ts +203 -0
- package/src/video/hooks/useVideoProfileSeed.ts +53 -0
- package/src/video/hooks/useVideoPublication.ts +29 -0
- package/src/video/hooks/useVideoRouteReady.ts +52 -0
- package/src/video/hooks/useVideoRouteSync.ts +100 -0
- package/src/video/hooks/useVideoTileTransform.ts +88 -0
- package/src/video/index.ts +24 -0
- package/src/video/providers/DirectorChatProvider.tsx +293 -0
- package/src/video/rules/changeTo.ts +20 -0
- package/src/zone/components/ZoneActionsMenu.tsx +305 -0
- package/src/zone/components/ZoneAvailabilityFields.tsx +98 -0
- package/src/zone/components/ZoneForm.tsx +622 -0
- package/src/zone/components/ZoneInheritedContext.tsx +70 -0
- package/src/zone/components/ZoneLevelSelect.tsx +86 -0
- package/src/zone/components/ZoneMetadataFields.tsx +89 -0
- package/src/zone/components/ZoneMethodSelect.tsx +90 -0
- package/src/zone/components/ZoneModeSelect.tsx +98 -0
- package/src/zone/components/ZoneRangeInput.tsx +129 -0
- package/src/zone/components/ZoneReachabilityFields.tsx +120 -0
- package/src/zone/components/ZoneSubHeader.tsx +188 -0
- package/src/zone/components/ZoneVisibility.tsx +94 -0
- package/src/zone/hooks/useStudioReachabilityStart.ts +79 -0
- package/src/zone/hooks/useStudioZonesBrowsed.ts +32 -0
|
@@ -0,0 +1,2005 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunk5CTZOFDV_cjs = require('./chunk-5CTZOFDV.cjs');
|
|
5
|
+
var chunkST7BNVC2_cjs = require('./chunk-ST7BNVC2.cjs');
|
|
6
|
+
var chunk3TQV2M4C_cjs = require('./chunk-3TQV2M4C.cjs');
|
|
7
|
+
var chunkEW5SY246_cjs = require('./chunk-EW5SY246.cjs');
|
|
8
|
+
var chunkEN5RWYHP_cjs = require('./chunk-EN5RWYHP.cjs');
|
|
9
|
+
var chunkZRGQNRQI_cjs = require('./chunk-ZRGQNRQI.cjs');
|
|
10
|
+
var chunkZAKVHYDL_cjs = require('./chunk-ZAKVHYDL.cjs');
|
|
11
|
+
var chunkEWWHVV7R_cjs = require('./chunk-EWWHVV7R.cjs');
|
|
12
|
+
var chunkDUUPWSOZ_cjs = require('./chunk-DUUPWSOZ.cjs');
|
|
13
|
+
var chunk4TX5E63A_cjs = require('./chunk-4TX5E63A.cjs');
|
|
14
|
+
var chunkCWQ4WHPI_cjs = require('./chunk-CWQ4WHPI.cjs');
|
|
15
|
+
var chunk3Q23QKNI_cjs = require('./chunk-3Q23QKNI.cjs');
|
|
16
|
+
var chunkJVFHF3LE_cjs = require('./chunk-JVFHF3LE.cjs');
|
|
17
|
+
var chunkII6C3LU2_cjs = require('./chunk-II6C3LU2.cjs');
|
|
18
|
+
var chunkBAYGKSWY_cjs = require('./chunk-BAYGKSWY.cjs');
|
|
19
|
+
var chunk2DDL2LIJ_cjs = require('./chunk-2DDL2LIJ.cjs');
|
|
20
|
+
var chunkPTLYNDZS_cjs = require('./chunk-PTLYNDZS.cjs');
|
|
21
|
+
var chunkQZ7W2E4U_cjs = require('./chunk-QZ7W2E4U.cjs');
|
|
22
|
+
var react = require('react');
|
|
23
|
+
var elementsReact = require('@mountaya/elements-react');
|
|
24
|
+
var studio = require('@mountaya/studio');
|
|
25
|
+
var icons = require('@mountaya/elements/icons');
|
|
26
|
+
var editor = require('@mountaya/elements-react/editor');
|
|
27
|
+
var geo = require('@mountaya/elements/geo');
|
|
28
|
+
var elements = require('@mountaya/elements');
|
|
29
|
+
var collab = require('@mountaya/elements/collab');
|
|
30
|
+
var engines = require('@mountaya/studio/engines');
|
|
31
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
32
|
+
var camera = require('@mountaya/elements/camera');
|
|
33
|
+
var profile = require('@mountaya/elements/profile');
|
|
34
|
+
var units = require('@mountaya/elements/units');
|
|
35
|
+
var time = require('@mountaya/studio/time');
|
|
36
|
+
var layers = require('@mountaya/elements/layers');
|
|
37
|
+
|
|
38
|
+
var sameConstraints = (left, right) => left.minZoom === right.minZoom && left.maxZoom === right.maxZoom && (left.maxBounds === null || right.maxBounds === null ? left.maxBounds === right.maxBounds : left.maxBounds.every((edge, index) => edge === right.maxBounds?.[index]));
|
|
39
|
+
var raiseRefusal = (refusal) => {
|
|
40
|
+
queueMicrotask(() => {
|
|
41
|
+
throw refusal;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var tellMap = (applied, client, resolver) => {
|
|
45
|
+
const held = applied.current?.client === client ? applied.current.constraints : null;
|
|
46
|
+
const answer = resolver?.(client.getViewport().center) ?? null;
|
|
47
|
+
applied.current = { client, constraints: answer };
|
|
48
|
+
try {
|
|
49
|
+
if (answer === null) {
|
|
50
|
+
if (held !== null && held.maxBounds !== null) {
|
|
51
|
+
client.setConstraints({ maxBounds: null });
|
|
52
|
+
}
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (held === null || !sameConstraints(held, answer)) {
|
|
56
|
+
client.setConstraints(answer);
|
|
57
|
+
}
|
|
58
|
+
} catch (refusal) {
|
|
59
|
+
raiseRefusal(refusal);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var useStudioConstraints = (client, resolveConstraints) => {
|
|
63
|
+
const resolverRef = elementsReact.useLatestRef(resolveConstraints);
|
|
64
|
+
const appliedRef = react.useRef(null);
|
|
65
|
+
react.useEffect(() => {
|
|
66
|
+
if (client) {
|
|
67
|
+
tellMap(appliedRef, client, resolveConstraints);
|
|
68
|
+
}
|
|
69
|
+
}, [client, resolveConstraints]);
|
|
70
|
+
react.useEffect(() => {
|
|
71
|
+
if (!client) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
return client.onViewportSettle(() => {
|
|
75
|
+
tellMap(appliedRef, client, resolverRef.current);
|
|
76
|
+
});
|
|
77
|
+
}, [client, resolverRef]);
|
|
78
|
+
};
|
|
79
|
+
var useStudioMapEditSeams = () => {
|
|
80
|
+
const { bus: slice, context } = chunkQZ7W2E4U_cjs.useStudioContext();
|
|
81
|
+
const bus = react.useMemo(() => slice ? heldDispatch(slice) : null, [slice]);
|
|
82
|
+
if (!bus || !context) {
|
|
83
|
+
throw chunkPTLYNDZS_cjs.missingSeam("the studio map hooks", { component: "MountayaStudioHost" });
|
|
84
|
+
}
|
|
85
|
+
return { bus, context };
|
|
86
|
+
};
|
|
87
|
+
var rejectedDispatch = (name, reason) => ({
|
|
88
|
+
code: "internal",
|
|
89
|
+
error: `${name} was rejected by the tool bus: ${reason instanceof Error ? reason.message : String(reason)}`,
|
|
90
|
+
ok: false
|
|
91
|
+
});
|
|
92
|
+
var heldDispatch = (slice) => ({
|
|
93
|
+
dispatch: (ctx, name, input) => {
|
|
94
|
+
try {
|
|
95
|
+
return Promise.resolve(slice.dispatch(ctx, name, input)).catch(
|
|
96
|
+
(reason) => rejectedDispatch(name, reason)
|
|
97
|
+
);
|
|
98
|
+
} catch (reason) {
|
|
99
|
+
return Promise.resolve(rejectedDispatch(name, reason));
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
dispatchUnsafe: (ctx, name, input) => {
|
|
103
|
+
try {
|
|
104
|
+
return Promise.resolve(slice.dispatchUnsafe(ctx, name, input)).catch(
|
|
105
|
+
(reason) => rejectedDispatch(name, reason)
|
|
106
|
+
);
|
|
107
|
+
} catch (reason) {
|
|
108
|
+
return Promise.resolve(rejectedDispatch(name, reason));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// src/map/hooks/useStudioContextMenu.ts
|
|
114
|
+
var useStudioContextMenu = (client) => {
|
|
115
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
116
|
+
react.useEffect(() => {
|
|
117
|
+
if (!client) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
return client.onContextMenu((event) => {
|
|
121
|
+
void bus.dispatch(context, "studio.contextmenu.open", { lngLat: event.lngLat });
|
|
122
|
+
});
|
|
123
|
+
}, [bus, client, context]);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// src/map/hooks/useStudioOverlaysEntitled.ts
|
|
127
|
+
var useStudioOverlaysEntitled = () => chunkDUUPWSOZ_cjs.useStudioViewerEntitlement(chunkJVFHF3LE_cjs.useStudioViewer(), "map-overlays");
|
|
128
|
+
|
|
129
|
+
// src/map/hooks/useStudioEnrichment.ts
|
|
130
|
+
var useStudioEnrichment = (client) => {
|
|
131
|
+
const overlaysEntitled = useStudioOverlaysEntitled();
|
|
132
|
+
const poisEntitled = chunkDUUPWSOZ_cjs.useStudioViewerEntitlement(chunkJVFHF3LE_cjs.useStudioViewer(), "map-pois");
|
|
133
|
+
const { manifest: layers } = elementsReact.useMountayaLayersManifest();
|
|
134
|
+
const activeEnrichments = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeEnrichments);
|
|
135
|
+
const drawnSlugsRef = react.useRef(/* @__PURE__ */ new Set());
|
|
136
|
+
const drawnFromRef = react.useRef(null);
|
|
137
|
+
react.useEffect(() => {
|
|
138
|
+
if (!client || !layers) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (drawnFromRef.current !== null && drawnFromRef.current !== layers) {
|
|
142
|
+
for (const slug of drawnSlugsRef.current) {
|
|
143
|
+
client.removeEnrichmentOverlay(slug);
|
|
144
|
+
}
|
|
145
|
+
drawnSlugsRef.current = /* @__PURE__ */ new Set();
|
|
146
|
+
}
|
|
147
|
+
drawnFromRef.current = layers;
|
|
148
|
+
const permitted = studio.permittedEnrichmentOverlays(
|
|
149
|
+
layers,
|
|
150
|
+
activeEnrichments,
|
|
151
|
+
overlaysEntitled,
|
|
152
|
+
poisEntitled
|
|
153
|
+
);
|
|
154
|
+
const next = new Set(permitted.map((overlay) => overlay.slug));
|
|
155
|
+
const drawn = drawnSlugsRef.current;
|
|
156
|
+
for (const slug of drawn) {
|
|
157
|
+
if (!next.has(slug)) {
|
|
158
|
+
client.removeEnrichmentOverlay(slug);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
for (const overlay of permitted) {
|
|
162
|
+
if (!drawn.has(overlay.slug)) {
|
|
163
|
+
client.addEnrichmentOverlay(overlay);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
drawnSlugsRef.current = next;
|
|
167
|
+
}, [client, layers, activeEnrichments, overlaysEntitled, poisEntitled]);
|
|
168
|
+
react.useEffect(() => {
|
|
169
|
+
if (!client) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
return () => {
|
|
173
|
+
for (const slug of drawnSlugsRef.current) {
|
|
174
|
+
client.removeEnrichmentOverlay(slug);
|
|
175
|
+
}
|
|
176
|
+
drawnSlugsRef.current = /* @__PURE__ */ new Set();
|
|
177
|
+
drawnFromRef.current = null;
|
|
178
|
+
};
|
|
179
|
+
}, [client]);
|
|
180
|
+
};
|
|
181
|
+
var SECTIONS = ["segmentEditor"];
|
|
182
|
+
var dispatchItineraryClick = (hit, {
|
|
183
|
+
beginSegmentEdit,
|
|
184
|
+
bus,
|
|
185
|
+
context,
|
|
186
|
+
editable,
|
|
187
|
+
gesture,
|
|
188
|
+
readOnly,
|
|
189
|
+
reportBeginRefusal
|
|
190
|
+
}) => {
|
|
191
|
+
if ((hit.clickCount ?? 1) > 1) {
|
|
192
|
+
if (gesture.opened !== null && hit.properties.itinerary_id === gesture.opened) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
} else {
|
|
196
|
+
gesture.opened = null;
|
|
197
|
+
}
|
|
198
|
+
const state = context.ui.getState();
|
|
199
|
+
const feature = studio.itineraryTileFeature(hit);
|
|
200
|
+
if (feature?.kind === "segment") {
|
|
201
|
+
const target = studio.itineraryClickTarget("segment", hit, state, readOnly);
|
|
202
|
+
if (target?.kind === "segment") {
|
|
203
|
+
void bus.dispatch(context, "studio.itinerary.segment.select", {
|
|
204
|
+
segmentId: target.segmentId
|
|
205
|
+
});
|
|
206
|
+
if (target.edit && editable) {
|
|
207
|
+
void beginSegmentEdit(target.segmentId).then(reportBeginRefusal);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const restricted = studio.itineraryClickTarget("roadAccess", hit, state, readOnly);
|
|
212
|
+
if (restricted?.kind === "roadAccess") {
|
|
213
|
+
void bus.dispatch(context, "studio.itinerary.segment.roadAccessOpen", restricted.stretch);
|
|
214
|
+
}
|
|
215
|
+
if (feature?.kind === "waypoint") {
|
|
216
|
+
const target = studio.itineraryClickTarget("waypoint", hit, state, readOnly);
|
|
217
|
+
if (target?.kind === "waypoint") {
|
|
218
|
+
void bus.dispatch(context, "studio.itinerary.waypoint.select", {
|
|
219
|
+
waypointId: target.waypointId
|
|
220
|
+
});
|
|
221
|
+
if (target.details) {
|
|
222
|
+
void bus.dispatch(context, "studio.itinerary.waypoint.detailsOpen", {
|
|
223
|
+
waypointId: target.waypointId
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
const opened = studio.itineraryClickTarget("itinerary", hit, state, readOnly);
|
|
229
|
+
if (opened?.kind === "itinerary") {
|
|
230
|
+
gesture.opened = opened.itineraryId;
|
|
231
|
+
void bus.dispatch(context, "studio.itinerary.openForEdit", {
|
|
232
|
+
itineraryId: opened.itineraryId
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
var followItineraryHover = (client, layerIds, { bus, context }, options) => {
|
|
237
|
+
let hovered = null;
|
|
238
|
+
const setHovered = (next) => {
|
|
239
|
+
const key = next ? `${next.kind}:${next.id}` : null;
|
|
240
|
+
if (key === hovered) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
hovered = key;
|
|
244
|
+
void bus.dispatch(context, "studio.itinerary.hover.set", { hovered: next });
|
|
245
|
+
};
|
|
246
|
+
const detach = client.onFeatureHover(
|
|
247
|
+
layerIds,
|
|
248
|
+
{
|
|
249
|
+
onEnter: (hit) => {
|
|
250
|
+
const feature = studio.itineraryTileFeature(hit);
|
|
251
|
+
const open = context.ui.getState().activeItinerary;
|
|
252
|
+
if (feature === null || open === null || hit.properties.itinerary_id !== open.id) {
|
|
253
|
+
setHovered(null);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
setHovered(feature);
|
|
257
|
+
},
|
|
258
|
+
onLeave: () => {
|
|
259
|
+
setHovered(null);
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
options
|
|
263
|
+
);
|
|
264
|
+
return () => {
|
|
265
|
+
setHovered(null);
|
|
266
|
+
detach();
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
var useStudioItinerarySelection = (client, options) => {
|
|
270
|
+
const activitySlug = options?.activitySlug;
|
|
271
|
+
const readOnly = options?.readOnly ?? false;
|
|
272
|
+
const drawnSources = options?.sources;
|
|
273
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
274
|
+
const grantsEditor = chunkQZ7W2E4U_cjs.useCapability("editor");
|
|
275
|
+
const opened = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeItinerary !== null);
|
|
276
|
+
const createdById = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeItinerary?.created_by.id);
|
|
277
|
+
const organizationId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeItinerary?.organization_id);
|
|
278
|
+
const granted = chunkZRGQNRQI_cjs.useItineraryEditable(opened ? { createdById, organizationId } : null);
|
|
279
|
+
const editable = grantsEditor && granted;
|
|
280
|
+
const { manifest: layers } = elementsReact.useMountayaLayersManifest();
|
|
281
|
+
const scope = chunkCWQ4WHPI_cjs.useUiStore(studio.mapInteractionScope);
|
|
282
|
+
const openId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeItinerary?.id ?? null);
|
|
283
|
+
const beginSegmentEdit = chunkEW5SY246_cjs.useBeginSegmentEdit(activitySlug);
|
|
284
|
+
const gesture = react.useRef({ opened: null }).current;
|
|
285
|
+
const reportFailure = chunk3Q23QKNI_cjs.useStudioFailureAlert();
|
|
286
|
+
const beginFailed = chunk2DDL2LIJ_cjs.useStudioScopedStrings(SECTIONS).segmentEditor.editGeometryFailed;
|
|
287
|
+
const reportBeginRefusal = react.useCallback(
|
|
288
|
+
(result) => {
|
|
289
|
+
if (result === null || !result.ok && result.code === "capability-denied") {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
reportFailure(result, beginFailed);
|
|
293
|
+
},
|
|
294
|
+
[beginFailed, reportFailure]
|
|
295
|
+
);
|
|
296
|
+
const itineraryLayerIds = react.useMemo(
|
|
297
|
+
() => studio.itineraryLayerIdsOf(drawnSources ?? layers?.itineraries?.sources ?? []),
|
|
298
|
+
[drawnSources, layers]
|
|
299
|
+
);
|
|
300
|
+
react.useEffect(() => {
|
|
301
|
+
if (!client || scope === "locked" || !readOnly && scope === "zone") {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
const options2 = !readOnly && scope === "itinerary" ? {
|
|
305
|
+
accepts: (hit) => hit.properties.itinerary_id === context.ui.getState().activeItinerary?.id
|
|
306
|
+
} : {};
|
|
307
|
+
const detachClick = client.onFeatureClick(
|
|
308
|
+
itineraryLayerIds,
|
|
309
|
+
(hit) => {
|
|
310
|
+
dispatchItineraryClick(hit, {
|
|
311
|
+
beginSegmentEdit,
|
|
312
|
+
bus,
|
|
313
|
+
context,
|
|
314
|
+
editable,
|
|
315
|
+
gesture,
|
|
316
|
+
readOnly,
|
|
317
|
+
reportBeginRefusal
|
|
318
|
+
});
|
|
319
|
+
},
|
|
320
|
+
options2
|
|
321
|
+
);
|
|
322
|
+
const releaseHover = followItineraryHover(client, itineraryLayerIds, { bus, context }, options2);
|
|
323
|
+
return () => {
|
|
324
|
+
releaseHover();
|
|
325
|
+
detachClick();
|
|
326
|
+
};
|
|
327
|
+
}, [
|
|
328
|
+
beginSegmentEdit,
|
|
329
|
+
client,
|
|
330
|
+
bus,
|
|
331
|
+
context,
|
|
332
|
+
editable,
|
|
333
|
+
gesture,
|
|
334
|
+
itineraryLayerIds,
|
|
335
|
+
readOnly,
|
|
336
|
+
reportBeginRefusal,
|
|
337
|
+
openId,
|
|
338
|
+
scope
|
|
339
|
+
]);
|
|
340
|
+
};
|
|
341
|
+
var useStudioLayersScope = () => {
|
|
342
|
+
const map = elementsReact.useMountayaMap();
|
|
343
|
+
const scope = chunk5CTZOFDV_cjs.useCollectionScope();
|
|
344
|
+
react.useEffect(() => {
|
|
345
|
+
map?.setLayersOrganization(scope ?? null);
|
|
346
|
+
}, [map, scope]);
|
|
347
|
+
};
|
|
348
|
+
var useStudioMapSync = (client, demUrl) => {
|
|
349
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
350
|
+
const { manifest: layers } = elementsReact.useMountayaLayersManifest();
|
|
351
|
+
const { terrain, terrainVariant } = chunk4TX5E63A_cjs.useUiStoreShallow((state) => ({
|
|
352
|
+
terrain: state.terrain,
|
|
353
|
+
terrainVariant: state.terrainVariant
|
|
354
|
+
}));
|
|
355
|
+
const activeItinerary = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeItinerary);
|
|
356
|
+
const activeItineraryId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeItinerary?.id ?? null);
|
|
357
|
+
const selection = chunkCWQ4WHPI_cjs.useUiStore((state) => state.selection);
|
|
358
|
+
const appliedTerrainRef = react.useRef(null);
|
|
359
|
+
const dem = studio.resolveDemUrl(layers, demUrl);
|
|
360
|
+
const baseTerrain = react.useMemo(
|
|
361
|
+
() => studio.resolveBaseTerrain(layers?.terrains ?? [], terrain, terrainVariant, dem),
|
|
362
|
+
[dem, layers, terrain, terrainVariant]
|
|
363
|
+
);
|
|
364
|
+
const terrainKey = baseTerrain ? `${terrain}|${terrainVariant}|${dem ?? ""}` : null;
|
|
365
|
+
react.useEffect(() => {
|
|
366
|
+
if (!client) {
|
|
367
|
+
appliedTerrainRef.current = null;
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
const applied = appliedTerrainRef.current;
|
|
371
|
+
if (baseTerrain && terrainKey && (applied?.client !== client || applied.key !== terrainKey)) {
|
|
372
|
+
client.setBaseTerrain(baseTerrain);
|
|
373
|
+
appliedTerrainRef.current = { client, key: terrainKey };
|
|
374
|
+
}
|
|
375
|
+
}, [baseTerrain, client, terrainKey]);
|
|
376
|
+
react.useEffect(() => {
|
|
377
|
+
if (!client || !activeItinerary) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
const icons = studio.itinerarySpriteIcons(activeItinerary);
|
|
381
|
+
if (icons.length > 0) {
|
|
382
|
+
client.prewarmItineraryIcons(icons);
|
|
383
|
+
}
|
|
384
|
+
}, [client, activeItinerary, terrainKey]);
|
|
385
|
+
react.useEffect(() => {
|
|
386
|
+
if (!client) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
client.setActiveItinerarySegments(studio.activeSegmentLines(activeItinerary));
|
|
390
|
+
}, [client, activeItinerary]);
|
|
391
|
+
react.useEffect(() => {
|
|
392
|
+
if (!client) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
void bus.dispatch(
|
|
396
|
+
context,
|
|
397
|
+
"studio.itinerary.emphasis.set",
|
|
398
|
+
studio.itineraryEmphasisFor(
|
|
399
|
+
selection,
|
|
400
|
+
activeItineraryId === null ? null : { id: activeItineraryId }
|
|
401
|
+
)
|
|
402
|
+
);
|
|
403
|
+
}, [client, bus, context, selection, activeItineraryId]);
|
|
404
|
+
};
|
|
405
|
+
var useStudioOverlay = (client) => {
|
|
406
|
+
const overlaysEntitled = useStudioOverlaysEntitled();
|
|
407
|
+
const { manifest: layers } = elementsReact.useMountayaLayersManifest();
|
|
408
|
+
const activeOverlay = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeOverlay);
|
|
409
|
+
react.useEffect(() => {
|
|
410
|
+
if (!client) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
const overlay = layers ? studio.permittedClassicOverlay(layers, activeOverlay, overlaysEntitled) : null;
|
|
414
|
+
const vectorLayerIds = (overlay?.sources ?? []).filter((source) => source.type === "vector").flatMap((source) => source.layers.map((layer) => layer.id));
|
|
415
|
+
client.setOverlayQueryLayers(vectorLayerIds);
|
|
416
|
+
client.setCategoryOverlay(overlay);
|
|
417
|
+
return () => {
|
|
418
|
+
client.setCategoryOverlay(null);
|
|
419
|
+
client.setOverlayQueryLayers([]);
|
|
420
|
+
};
|
|
421
|
+
}, [client, layers, activeOverlay, overlaysEntitled]);
|
|
422
|
+
};
|
|
423
|
+
var useStudioOverlayWithdrawal = () => {
|
|
424
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
425
|
+
const entitled = useStudioOverlaysEntitled();
|
|
426
|
+
const heldRef = react.useRef(entitled);
|
|
427
|
+
react.useEffect(() => {
|
|
428
|
+
const held = heldRef.current;
|
|
429
|
+
heldRef.current = entitled;
|
|
430
|
+
if (!held || entitled) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
const { activeEnrichments, activeOverlay } = context.ui.getState();
|
|
434
|
+
if (activeOverlay !== null) {
|
|
435
|
+
void bus.dispatch(context, "studio.overlay.set", { overlay: null });
|
|
436
|
+
}
|
|
437
|
+
for (const slug of activeEnrichments) {
|
|
438
|
+
if (slug !== studio.POIS_OVERLAY_SLUG) {
|
|
439
|
+
void bus.dispatch(context, "studio.overlay.enrichment.set", {
|
|
440
|
+
enabled: false,
|
|
441
|
+
overlay: slug
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}, [bus, context, entitled]);
|
|
446
|
+
};
|
|
447
|
+
var useStudioPeerDrafts = (client, resolveName) => {
|
|
448
|
+
const resources = chunkEW5SY246_cjs.useActiveCollabResources();
|
|
449
|
+
const drafts = chunk4TX5E63A_cjs.useUiStoreShallow((state) => {
|
|
450
|
+
const merged = {};
|
|
451
|
+
for (const resource of resources) {
|
|
452
|
+
Object.assign(merged, studio.selectCollabPeerDrafts(resource)(state));
|
|
453
|
+
}
|
|
454
|
+
return merged;
|
|
455
|
+
});
|
|
456
|
+
const peerIds = chunk4TX5E63A_cjs.useUiStoreShallow((state) => {
|
|
457
|
+
const ids = [];
|
|
458
|
+
for (const resource of resources) {
|
|
459
|
+
ids.push(...Object.keys(studio.selectCollabPeers(resource)(state)));
|
|
460
|
+
}
|
|
461
|
+
return ids;
|
|
462
|
+
});
|
|
463
|
+
const localSegmentEditId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.segmentEditSession?.segmentId ?? null);
|
|
464
|
+
const localZoneEditId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.zoneEditSession?.zoneId ?? null);
|
|
465
|
+
const paintedRef = react.useRef(/* @__PURE__ */ new Map());
|
|
466
|
+
const clientRef = elementsReact.useLatestRef(client);
|
|
467
|
+
react.useEffect(() => {
|
|
468
|
+
if (!client) {
|
|
469
|
+
paintedRef.current = /* @__PURE__ */ new Map();
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
const ghosts = studio.peerDraftGhosts({
|
|
473
|
+
drafts,
|
|
474
|
+
localSegmentEditId,
|
|
475
|
+
localZoneEditId,
|
|
476
|
+
presentPeerIds: peerIds,
|
|
477
|
+
resolveName
|
|
478
|
+
});
|
|
479
|
+
const wanted = new Map(ghosts.map((ghost) => [ghost.key, ghost.entity]));
|
|
480
|
+
for (const [key, entity] of paintedRef.current) {
|
|
481
|
+
if (!wanted.has(key)) {
|
|
482
|
+
client.clearPeerDraft(entity);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
for (const ghost of ghosts) {
|
|
486
|
+
client.setPeerDraft(ghost.entity, ghost.geometry, ghost.color, ghost.label);
|
|
487
|
+
}
|
|
488
|
+
paintedRef.current = wanted;
|
|
489
|
+
}, [client, drafts, peerIds, localSegmentEditId, localZoneEditId, resolveName]);
|
|
490
|
+
react.useEffect(
|
|
491
|
+
() => () => {
|
|
492
|
+
const mounted = clientRef.current;
|
|
493
|
+
if (mounted) {
|
|
494
|
+
for (const entity of paintedRef.current.values()) {
|
|
495
|
+
mounted.clearPeerDraft(entity);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
paintedRef.current = /* @__PURE__ */ new Map();
|
|
499
|
+
},
|
|
500
|
+
[clientRef]
|
|
501
|
+
);
|
|
502
|
+
};
|
|
503
|
+
var useStudioPoiLayers = (client) => {
|
|
504
|
+
const { manifest: layers } = elementsReact.useMountayaLayersManifest();
|
|
505
|
+
const activePoiGroups = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activePoiGroups);
|
|
506
|
+
const poisActive = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeEnrichments.includes(studio.POIS_OVERLAY_SLUG));
|
|
507
|
+
const overlaysEntitled = useStudioOverlaysEntitled();
|
|
508
|
+
const poisEntitled = chunkDUUPWSOZ_cjs.useStudioViewerEntitlement(chunkJVFHF3LE_cjs.useStudioViewer(), "map-pois");
|
|
509
|
+
const written = react.useRef({
|
|
510
|
+
drawing: null,
|
|
511
|
+
visibility: /* @__PURE__ */ new Map()
|
|
512
|
+
});
|
|
513
|
+
react.useEffect(() => {
|
|
514
|
+
if (!client || !layers) {
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
const wanted = studio.poiLayerVisibility(layers, activePoiGroups);
|
|
518
|
+
if (wanted.length === 0) {
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
const drawn = studio.permittedEnrichmentOverlays(
|
|
522
|
+
layers,
|
|
523
|
+
poisActive ? [studio.POIS_OVERLAY_SLUG] : [],
|
|
524
|
+
overlaysEntitled,
|
|
525
|
+
poisEntitled
|
|
526
|
+
).length > 0;
|
|
527
|
+
const held = written.current.drawing;
|
|
528
|
+
if (held === null || held.client !== client || held.layers !== layers || held.drawn !== drawn) {
|
|
529
|
+
written.current = { drawing: { client, drawn, layers }, visibility: /* @__PURE__ */ new Map() };
|
|
530
|
+
}
|
|
531
|
+
const { visibility } = written.current;
|
|
532
|
+
for (const { layerId, visible } of wanted) {
|
|
533
|
+
if (visibility.get(layerId) === visible) {
|
|
534
|
+
continue;
|
|
535
|
+
}
|
|
536
|
+
visibility.set(layerId, visible);
|
|
537
|
+
client.setTileLayerVisibility(layerId, visible);
|
|
538
|
+
}
|
|
539
|
+
}, [client, activePoiGroups, layers, overlaysEntitled, poisActive, poisEntitled]);
|
|
540
|
+
};
|
|
541
|
+
var EMPTY_CANDIDATES = [];
|
|
542
|
+
var useStudioPreviewSync = (client, glyphs) => {
|
|
543
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
544
|
+
const {
|
|
545
|
+
activeItinerary,
|
|
546
|
+
candidates,
|
|
547
|
+
draft,
|
|
548
|
+
draftId,
|
|
549
|
+
editSegmentId,
|
|
550
|
+
editWaypointId,
|
|
551
|
+
end,
|
|
552
|
+
hasSession,
|
|
553
|
+
routeType,
|
|
554
|
+
selectedSeed,
|
|
555
|
+
start,
|
|
556
|
+
zonePreview
|
|
557
|
+
} = chunk4TX5E63A_cjs.useUiStoreShallow((state) => {
|
|
558
|
+
const session = studio.selectSuggestionSession(state);
|
|
559
|
+
const drafting = studio.selectActiveDraftSession(state);
|
|
560
|
+
return {
|
|
561
|
+
activeItinerary: state.activeItinerary,
|
|
562
|
+
candidates: session?.candidates ?? EMPTY_CANDIDATES,
|
|
563
|
+
draft: drafting?.draft ?? null,
|
|
564
|
+
draftId: drafting?.draftId ?? null,
|
|
565
|
+
editSegmentId: state.segmentEditSession?.segmentId ?? null,
|
|
566
|
+
editWaypointId: state.waypointEditSession?.waypointId ?? null,
|
|
567
|
+
end: session?.end ?? null,
|
|
568
|
+
hasSession: session !== null,
|
|
569
|
+
routeType: session?.routeType ?? "loop",
|
|
570
|
+
selectedSeed: session?.selectedSeed ?? null,
|
|
571
|
+
start: session?.start ?? null,
|
|
572
|
+
zonePreview: state.zonePreview
|
|
573
|
+
};
|
|
574
|
+
});
|
|
575
|
+
const framedDraftIdRef = react.useRef(null);
|
|
576
|
+
const tiled = context.api?.persistence.tiled !== false;
|
|
577
|
+
react.useEffect(() => {
|
|
578
|
+
const suggestion = hasSession ? { candidates, end, routeType, selectedSeed, start } : null;
|
|
579
|
+
if (!client) {
|
|
580
|
+
framedDraftIdRef.current = null;
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
const projection = studio.previewProjection(glyphs, {
|
|
584
|
+
activeItinerary,
|
|
585
|
+
draft,
|
|
586
|
+
editSegmentId,
|
|
587
|
+
editWaypointId,
|
|
588
|
+
suggestion,
|
|
589
|
+
tiled,
|
|
590
|
+
zonePreview
|
|
591
|
+
});
|
|
592
|
+
if (projection.exclusions) {
|
|
593
|
+
client.setItineraryExclusions(projection.exclusions);
|
|
594
|
+
}
|
|
595
|
+
client.setItineraryPreview(projection.render);
|
|
596
|
+
if (projection.draft === null) {
|
|
597
|
+
framedDraftIdRef.current = null;
|
|
598
|
+
} else if (framedDraftIdRef.current !== draftId) {
|
|
599
|
+
framedDraftIdRef.current = draftId;
|
|
600
|
+
const bounds = geo.boundsOf(studio.draftGeometries(projection.draft));
|
|
601
|
+
if (bounds) {
|
|
602
|
+
void bus.dispatch(context, "studio.map.fitBounds", { bounds });
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
if (projection.render === null) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
return () => {
|
|
609
|
+
if (projection.exclusions) {
|
|
610
|
+
client.setItineraryExclusions({ segmentIds: [], waypointIds: [] });
|
|
611
|
+
}
|
|
612
|
+
client.setItineraryPreview(null);
|
|
613
|
+
};
|
|
614
|
+
}, [
|
|
615
|
+
activeItinerary,
|
|
616
|
+
bus,
|
|
617
|
+
candidates,
|
|
618
|
+
client,
|
|
619
|
+
context,
|
|
620
|
+
draft,
|
|
621
|
+
draftId,
|
|
622
|
+
editSegmentId,
|
|
623
|
+
editWaypointId,
|
|
624
|
+
end,
|
|
625
|
+
glyphs,
|
|
626
|
+
hasSession,
|
|
627
|
+
routeType,
|
|
628
|
+
selectedSeed,
|
|
629
|
+
start,
|
|
630
|
+
tiled,
|
|
631
|
+
zonePreview
|
|
632
|
+
]);
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
// src/internal/rules/editorRoot.ts
|
|
636
|
+
var EDITOR_ROOT_ATTRIBUTE = "data-studio-root";
|
|
637
|
+
|
|
638
|
+
// src/map/rules/nearerEscape.ts
|
|
639
|
+
var DIALOG_SELECTOR = 'dialog, [role="dialog"], [role="alertdialog"]';
|
|
640
|
+
var OPEN_LIST_SELECTOR = '[aria-expanded="true"][aria-haspopup]:not([aria-haspopup="false"]), [role="menu"], [role="listbox"]';
|
|
641
|
+
var STUDIO_ROOT_SELECTOR = `[${EDITOR_ROOT_ATTRIBUTE}], .mtya-studio`;
|
|
642
|
+
var nearerPathHolds = (event, selector) => {
|
|
643
|
+
for (const node of event.composedPath()) {
|
|
644
|
+
if (!(node instanceof Element)) {
|
|
645
|
+
continue;
|
|
646
|
+
}
|
|
647
|
+
if (node.matches(selector)) {
|
|
648
|
+
return true;
|
|
649
|
+
}
|
|
650
|
+
if (node.matches(STUDIO_ROOT_SELECTOR)) {
|
|
651
|
+
return false;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
return false;
|
|
655
|
+
};
|
|
656
|
+
var closedOnList = /* @__PURE__ */ new WeakSet();
|
|
657
|
+
var watched = /* @__PURE__ */ new WeakSet();
|
|
658
|
+
var markListClose = (event) => {
|
|
659
|
+
if (event.key === "Escape" && nearerPathHolds(event, OPEN_LIST_SELECTOR)) {
|
|
660
|
+
closedOnList.add(event);
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
var watchNearerEscape = () => {
|
|
664
|
+
if (typeof window === "undefined" || watched.has(window)) {
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
watched.add(window);
|
|
668
|
+
window.addEventListener("keydown", markListClose, true);
|
|
669
|
+
};
|
|
670
|
+
var keyTakenNearer = (event) => {
|
|
671
|
+
if (event.defaultPrevented) {
|
|
672
|
+
return true;
|
|
673
|
+
}
|
|
674
|
+
if (event.key !== "Escape") {
|
|
675
|
+
return false;
|
|
676
|
+
}
|
|
677
|
+
return closedOnList.has(event) || nearerPathHolds(event, DIALOG_SELECTOR) || nearerPathHolds(event, OPEN_LIST_SELECTOR);
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
// src/map/rules/editKeyboard.ts
|
|
681
|
+
var strokeOf = (event) => ({
|
|
682
|
+
code: event.code,
|
|
683
|
+
key: event.key,
|
|
684
|
+
meta: event.metaKey || event.ctrlKey,
|
|
685
|
+
shift: event.shiftKey
|
|
686
|
+
});
|
|
687
|
+
var statesClosed = (data) => typeof data === "object" && data !== null && "closed" in data && typeof data.closed === "boolean";
|
|
688
|
+
var editCommitKept = (result) => result.ok && statesClosed(result.data) && !result.data.closed;
|
|
689
|
+
var shouldIgnoreEditingKey = (event) => {
|
|
690
|
+
const target = document.activeElement;
|
|
691
|
+
if (!target) {
|
|
692
|
+
return false;
|
|
693
|
+
}
|
|
694
|
+
const isEditable = target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
695
|
+
if (!isEditable) {
|
|
696
|
+
return false;
|
|
697
|
+
}
|
|
698
|
+
return studio.editHijacksNativeShortcut(strokeOf(event));
|
|
699
|
+
};
|
|
700
|
+
var buildEditKeydownHandler = (options) => {
|
|
701
|
+
const { bus, buildCommitInput, ctx, family, onCommitResult } = options;
|
|
702
|
+
return (event) => {
|
|
703
|
+
const state = ctx.ui.getState();
|
|
704
|
+
if (state.agentDriving && !studio.selectAgentHandoffArmed(state)) {
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
if (keyTakenNearer(event) || shouldIgnoreEditingKey(event)) {
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
const intent = studio.editKeyIntent(strokeOf(event), {
|
|
711
|
+
escapeCancels: family !== "zone" || state.activeZone === null
|
|
712
|
+
});
|
|
713
|
+
if (intent === null) {
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
event.preventDefault();
|
|
717
|
+
const name = studio.editToolName(family, intent);
|
|
718
|
+
if (intent === "commit") {
|
|
719
|
+
void bus.dispatchUnsafe(ctx, name, buildCommitInput()).then(onCommitResult);
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
void bus.dispatchUnsafe(ctx, name, {});
|
|
723
|
+
};
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
// src/map/hooks/useStudioEditCommitReporter.ts
|
|
727
|
+
var SECTIONS2 = ["editing"];
|
|
728
|
+
var useStudioEditCommitReporter = (failed) => {
|
|
729
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
730
|
+
const reportFailure = chunk3Q23QKNI_cjs.useStudioFailureAlert();
|
|
731
|
+
const { editing } = chunk2DDL2LIJ_cjs.useStudioScopedStrings(SECTIONS2);
|
|
732
|
+
return react.useCallback(
|
|
733
|
+
(result) => {
|
|
734
|
+
if (editCommitKept(result)) {
|
|
735
|
+
void bus.dispatch(context, "studio.alert.show", {
|
|
736
|
+
level: "warning",
|
|
737
|
+
message: editing.changedWhileSaving
|
|
738
|
+
});
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
if (failed !== null) {
|
|
742
|
+
reportFailure(result, failed);
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
[bus, context, editing, failed, reportFailure]
|
|
746
|
+
);
|
|
747
|
+
};
|
|
748
|
+
var StudioEditorRootContext = react.createContext(null);
|
|
749
|
+
var StudioEditorRootProvider = ({
|
|
750
|
+
children,
|
|
751
|
+
rootRef
|
|
752
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(StudioEditorRootContext, { value: rootRef, children });
|
|
753
|
+
var useStudioEditorRoot = () => react.use(StudioEditorRootContext);
|
|
754
|
+
|
|
755
|
+
// src/map/rules/editTooltip.ts
|
|
756
|
+
var TOOLTIP_OFFSET_PX = 12;
|
|
757
|
+
var tooltipToneBackground = {
|
|
758
|
+
info: "var(--mantine-color-blue-6, #228be6)",
|
|
759
|
+
limit: "var(--mantine-color-red-6, #fa5252)",
|
|
760
|
+
warning: "var(--mantine-color-orange-6, #fd7e14)"
|
|
761
|
+
};
|
|
762
|
+
var attachEditTooltip = (options) => {
|
|
763
|
+
const { client, getText, getTone, hintText, root } = options;
|
|
764
|
+
const tooltip = document.createElement("div");
|
|
765
|
+
tooltip.dataset.editTooltip = "";
|
|
766
|
+
tooltip.style.position = "absolute";
|
|
767
|
+
tooltip.style.pointerEvents = "none";
|
|
768
|
+
tooltip.style.zIndex = "3";
|
|
769
|
+
tooltip.style.display = "none";
|
|
770
|
+
tooltip.style.padding = "var(--mantine-spacing-xxs, 0.25rem) var(--mantine-spacing-xs, 0.625rem)";
|
|
771
|
+
tooltip.style.borderRadius = "var(--mantine-radius-sm, 0.25rem)";
|
|
772
|
+
tooltip.style.background = tooltipToneBackground.info;
|
|
773
|
+
tooltip.style.color = "var(--mantine-color-white, #fff)";
|
|
774
|
+
tooltip.style.fontSize = "var(--mantine-font-size-xs, 0.75rem)";
|
|
775
|
+
tooltip.style.boxShadow = "var(--mantine-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05), 0 10px 15px -5px rgba(0, 0, 0, 0.05))";
|
|
776
|
+
tooltip.style.whiteSpace = "nowrap";
|
|
777
|
+
const primary = document.createElement("div");
|
|
778
|
+
const hint = document.createElement("div");
|
|
779
|
+
hint.dataset.editTooltipHint = "";
|
|
780
|
+
hint.style.opacity = "0.85";
|
|
781
|
+
if (hintText === null) {
|
|
782
|
+
hint.style.display = "none";
|
|
783
|
+
} else {
|
|
784
|
+
hint.textContent = hintText;
|
|
785
|
+
}
|
|
786
|
+
tooltip.append(primary, hint);
|
|
787
|
+
root.append(tooltip);
|
|
788
|
+
let lastPoint = null;
|
|
789
|
+
let frame = null;
|
|
790
|
+
let lastTone = "info";
|
|
791
|
+
let lastText = null;
|
|
792
|
+
let measuredWidth = null;
|
|
793
|
+
const writeTooltip = () => {
|
|
794
|
+
frame = null;
|
|
795
|
+
if (!lastPoint) {
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
const rootWidth = root.clientWidth;
|
|
799
|
+
const text = getText();
|
|
800
|
+
if (text !== lastText) {
|
|
801
|
+
lastText = text;
|
|
802
|
+
primary.textContent = text;
|
|
803
|
+
measuredWidth = null;
|
|
804
|
+
}
|
|
805
|
+
const tone = getTone?.() ?? "info";
|
|
806
|
+
if (tone !== lastTone) {
|
|
807
|
+
lastTone = tone;
|
|
808
|
+
tooltip.style.background = tooltipToneBackground[tone];
|
|
809
|
+
}
|
|
810
|
+
if (tooltip.style.display !== "block") {
|
|
811
|
+
tooltip.style.display = "block";
|
|
812
|
+
}
|
|
813
|
+
measuredWidth ??= tooltip.offsetWidth;
|
|
814
|
+
const flipLeft = lastPoint[0] + TOOLTIP_OFFSET_PX + measuredWidth > rootWidth;
|
|
815
|
+
tooltip.style.transform = flipLeft ? `translate(calc(-100% - ${TOOLTIP_OFFSET_PX}px), ${TOOLTIP_OFFSET_PX}px)` : `translate(${TOOLTIP_OFFSET_PX}px, ${TOOLTIP_OFFSET_PX}px)`;
|
|
816
|
+
tooltip.style.left = `${lastPoint[0]}px`;
|
|
817
|
+
tooltip.style.top = `${lastPoint[1]}px`;
|
|
818
|
+
};
|
|
819
|
+
const detachPointer = client.onPointerMove((move) => {
|
|
820
|
+
lastPoint = move.point;
|
|
821
|
+
if (frame === null) {
|
|
822
|
+
frame = requestAnimationFrame(writeTooltip);
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
const detachPointerLeave = client.onPointerLeave(() => {
|
|
826
|
+
tooltip.style.display = "none";
|
|
827
|
+
lastPoint = null;
|
|
828
|
+
});
|
|
829
|
+
return {
|
|
830
|
+
detach: () => {
|
|
831
|
+
detachPointer();
|
|
832
|
+
detachPointerLeave();
|
|
833
|
+
if (frame !== null) {
|
|
834
|
+
cancelAnimationFrame(frame);
|
|
835
|
+
frame = null;
|
|
836
|
+
}
|
|
837
|
+
tooltip.remove();
|
|
838
|
+
},
|
|
839
|
+
setHintText: (text) => {
|
|
840
|
+
measuredWidth = null;
|
|
841
|
+
if (text === null) {
|
|
842
|
+
hint.style.display = "none";
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
hint.style.display = "";
|
|
846
|
+
hint.textContent = text;
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
// src/map/hooks/useStudioEditEngine.ts
|
|
852
|
+
var useStudioEditEngine = (client, enabled, config, deps) => {
|
|
853
|
+
const configRef = elementsReact.useLatestRef(config);
|
|
854
|
+
const studioRootRef = useStudioEditorRoot();
|
|
855
|
+
react.useEffect(() => {
|
|
856
|
+
if (!client || !enabled) {
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
const { cursor, disarm, family, subscribeDraft, tooltipHint, tooltipHintRef } = configRef.current;
|
|
860
|
+
client.lockCursor(cursor);
|
|
861
|
+
watchNearerEscape();
|
|
862
|
+
const root = studioRootRef?.current ?? document.querySelector(`[${EDITOR_ROOT_ATTRIBUTE}]`);
|
|
863
|
+
const tooltipController = root ? attachEditTooltip({
|
|
864
|
+
client,
|
|
865
|
+
getText: () => configRef.current.tooltipPrimaryText(),
|
|
866
|
+
getTone: () => configRef.current.tooltipTone?.() ?? "info",
|
|
867
|
+
hintText: tooltipHint?.() ?? null,
|
|
868
|
+
root
|
|
869
|
+
}) : null;
|
|
870
|
+
tooltipHintRef.current = tooltipController?.setHintText ?? null;
|
|
871
|
+
const detachDraft = subscribeDraft(client);
|
|
872
|
+
const onKeyDown = family ? buildEditKeydownHandler({
|
|
873
|
+
buildCommitInput: () => configRef.current.buildCommitInput?.() ?? {},
|
|
874
|
+
bus: configRef.current.bus,
|
|
875
|
+
ctx: configRef.current.ctx,
|
|
876
|
+
family,
|
|
877
|
+
onCommitResult: (result) => configRef.current.onCommitResult?.(result)
|
|
878
|
+
}) : null;
|
|
879
|
+
if (onKeyDown) {
|
|
880
|
+
window.addEventListener("keydown", onKeyDown);
|
|
881
|
+
}
|
|
882
|
+
return () => {
|
|
883
|
+
if (onKeyDown) {
|
|
884
|
+
window.removeEventListener("keydown", onKeyDown);
|
|
885
|
+
}
|
|
886
|
+
detachDraft();
|
|
887
|
+
tooltipController?.detach();
|
|
888
|
+
tooltipHintRef.current = null;
|
|
889
|
+
client.unlockCursor();
|
|
890
|
+
disarm?.(client);
|
|
891
|
+
};
|
|
892
|
+
}, [client, configRef, enabled, studioRootRef, ...deps]);
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
// src/map/hooks/useStudioSegmentEditing.ts
|
|
896
|
+
var SECTIONS3 = ["editing"];
|
|
897
|
+
var inertListener = () => {
|
|
898
|
+
};
|
|
899
|
+
var useStudioSegmentEditing = (client, collabEngine) => {
|
|
900
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
901
|
+
const words = chunk2DDL2LIJ_cjs.useStudioScopedStrings(SECTIONS3);
|
|
902
|
+
const reportCommit = useStudioEditCommitReporter(words.editing.segmentSaveFailed);
|
|
903
|
+
const [engine] = react.useState(
|
|
904
|
+
() => new engines.SegmentDraftEngine({ bus, client, collab: collabEngine, context, strings: words })
|
|
905
|
+
);
|
|
906
|
+
react.useEffect(() => {
|
|
907
|
+
engine.configure({ bus, client, collab: collabEngine, context, strings: words });
|
|
908
|
+
});
|
|
909
|
+
react.useEffect(() => engine.subscribe(inertListener), [engine]);
|
|
910
|
+
const editActive = chunkCWQ4WHPI_cjs.useUiStore(studio.selectBaseMapLocked);
|
|
911
|
+
const segmentId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.segmentEditSession?.segmentId ?? null);
|
|
912
|
+
const mode = chunkCWQ4WHPI_cjs.useUiStore((state) => state.segmentEditSession?.mode ?? null);
|
|
913
|
+
const itineraryId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeItinerary?.id ?? null);
|
|
914
|
+
const editColor = chunkCWQ4WHPI_cjs.useUiStore((state) => state.segmentEditSession?.draftColor ?? null);
|
|
915
|
+
const draftName = chunkCWQ4WHPI_cjs.useUiStore((state) => state.segmentEditSession?.draftName ?? null);
|
|
916
|
+
const textsRef = react.useRef({
|
|
917
|
+
addPoint: "",
|
|
918
|
+
finishHint: "",
|
|
919
|
+
reshape: "",
|
|
920
|
+
viaCapCounter: () => "",
|
|
921
|
+
viaCapReached: ""
|
|
922
|
+
});
|
|
923
|
+
const tooltipSetHintRef = react.useRef(null);
|
|
924
|
+
const tooltipContent = react.useCallback(() => {
|
|
925
|
+
const { mode: armedMode, viaCount } = engine.getSnapshot();
|
|
926
|
+
return studio.segmentEditTooltipContent(textsRef.current, viaCount, armedMode ?? "directions");
|
|
927
|
+
}, [engine]);
|
|
928
|
+
const syncTooltipHint = react.useCallback(() => {
|
|
929
|
+
tooltipSetHintRef.current?.(tooltipContent().hint);
|
|
930
|
+
}, [tooltipContent]);
|
|
931
|
+
react.useEffect(() => {
|
|
932
|
+
let lastCount = -1;
|
|
933
|
+
let lastCounterText = "";
|
|
934
|
+
const viaCapCounter = (count) => {
|
|
935
|
+
if (count !== lastCount) {
|
|
936
|
+
lastCount = count;
|
|
937
|
+
lastCounterText = words.editing.segmentViaCapCounter(count, geo.DIRECTIONS_VIA_MAX);
|
|
938
|
+
}
|
|
939
|
+
return lastCounterText;
|
|
940
|
+
};
|
|
941
|
+
textsRef.current = {
|
|
942
|
+
addPoint: words.editing.segmentAddPoint,
|
|
943
|
+
finishHint: words.editing.segmentFinishHint,
|
|
944
|
+
reshape: words.editing.segmentReshape,
|
|
945
|
+
viaCapCounter,
|
|
946
|
+
viaCapReached: words.editing.segmentViaCapReached(geo.DIRECTIONS_VIA_MAX)
|
|
947
|
+
};
|
|
948
|
+
syncTooltipHint();
|
|
949
|
+
}, [words, syncTooltipHint]);
|
|
950
|
+
const config = react.useMemo(
|
|
951
|
+
() => ({
|
|
952
|
+
// Reads the current draft off the map and shapes the commit input through the shared
|
|
953
|
+
// builder: a from-scratch segment (a draft name is set) commits as a create, an existing
|
|
954
|
+
// one as an update, the shape the on-map Save cluster builds, so a key press and a click
|
|
955
|
+
// cannot diverge.
|
|
956
|
+
buildCommitInput: () => {
|
|
957
|
+
const coordinates = [];
|
|
958
|
+
for (const [lng, lat] of client?.getSegmentDraft() ?? []) {
|
|
959
|
+
if (lng !== void 0 && lat !== void 0) {
|
|
960
|
+
coordinates.push([lng, lat]);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
if (!mode || !segmentId) {
|
|
964
|
+
return {};
|
|
965
|
+
}
|
|
966
|
+
return studio.buildSegmentEditCommitInput({
|
|
967
|
+
coordinates,
|
|
968
|
+
draftColor: editColor,
|
|
969
|
+
draftName,
|
|
970
|
+
itineraryId,
|
|
971
|
+
mode,
|
|
972
|
+
segmentId
|
|
973
|
+
});
|
|
974
|
+
},
|
|
975
|
+
bus,
|
|
976
|
+
ctx: context,
|
|
977
|
+
cursor: elements.EDIT_CROSS_CURSOR,
|
|
978
|
+
family: "segment",
|
|
979
|
+
// Enter-to-save reports its refusal exactly as the sidenav's Save button does, and a save
|
|
980
|
+
// that left the edit open as its footer does, so the two commit paths stay
|
|
981
|
+
// indistinguishable to the user.
|
|
982
|
+
onCommitResult: reportCommit,
|
|
983
|
+
// The map's drafts are the engine's, read from the moment it arms the session. What the
|
|
984
|
+
// tooltip follows is the engine's count, for as long as the tooltip is up.
|
|
985
|
+
subscribeDraft: () => engine.subscribe(syncTooltipHint),
|
|
986
|
+
tooltipHint: () => textsRef.current.finishHint,
|
|
987
|
+
tooltipHintRef: tooltipSetHintRef,
|
|
988
|
+
tooltipPrimaryText: () => tooltipContent().primary,
|
|
989
|
+
tooltipTone: () => tooltipContent().tone
|
|
990
|
+
}),
|
|
991
|
+
[
|
|
992
|
+
bus,
|
|
993
|
+
context,
|
|
994
|
+
client,
|
|
995
|
+
draftName,
|
|
996
|
+
editColor,
|
|
997
|
+
engine,
|
|
998
|
+
itineraryId,
|
|
999
|
+
mode,
|
|
1000
|
+
reportCommit,
|
|
1001
|
+
segmentId,
|
|
1002
|
+
syncTooltipHint,
|
|
1003
|
+
tooltipContent
|
|
1004
|
+
]
|
|
1005
|
+
);
|
|
1006
|
+
const enabled = client !== null && editActive && segmentId !== null && mode !== null;
|
|
1007
|
+
useStudioEditEngine(client, enabled, config, [
|
|
1008
|
+
editActive,
|
|
1009
|
+
segmentId,
|
|
1010
|
+
mode,
|
|
1011
|
+
itineraryId,
|
|
1012
|
+
bus,
|
|
1013
|
+
context
|
|
1014
|
+
]);
|
|
1015
|
+
};
|
|
1016
|
+
var useStudioSegmentViaPrompt = (client) => {
|
|
1017
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
1018
|
+
react.useEffect(() => {
|
|
1019
|
+
if (!client) {
|
|
1020
|
+
return;
|
|
1021
|
+
}
|
|
1022
|
+
return client.onSegmentViaPrompt((prompt) => {
|
|
1023
|
+
void bus.dispatch(context, "studio.itinerary.segment.via.promptOpen", {
|
|
1024
|
+
index: prompt.index,
|
|
1025
|
+
lngLat: prompt.lngLat
|
|
1026
|
+
});
|
|
1027
|
+
});
|
|
1028
|
+
}, [bus, client, context]);
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
// src/primitives/rules/activityBadge.ts
|
|
1032
|
+
var ACTIVITY_BADGE_BACKGROUND = "rgba(0, 0, 0, 0.04)";
|
|
1033
|
+
var ACTIVITY_GLYPH_COLOR = "rgb(100, 116, 139)";
|
|
1034
|
+
var lightBadge = {
|
|
1035
|
+
background: ACTIVITY_BADGE_BACKGROUND,
|
|
1036
|
+
color: ACTIVITY_GLYPH_COLOR
|
|
1037
|
+
};
|
|
1038
|
+
var BADGE_BACKGROUND_TOKEN = "--mtya-activity-badge-bg";
|
|
1039
|
+
var GLYPH_COLOR_TOKEN = "--mtya-activity-glyph-color";
|
|
1040
|
+
var badgesRead = /* @__PURE__ */ new Map();
|
|
1041
|
+
var activityBadgeOf = (studioRoot) => {
|
|
1042
|
+
const root = studioRoot?.current ?? (typeof document === "undefined" ? null : document.querySelector(`[${EDITOR_ROOT_ATTRIBUTE}]`));
|
|
1043
|
+
if (root === null || typeof getComputedStyle !== "function") {
|
|
1044
|
+
return lightBadge;
|
|
1045
|
+
}
|
|
1046
|
+
const computed = getComputedStyle(root);
|
|
1047
|
+
const background = computed.getPropertyValue(BADGE_BACKGROUND_TOKEN).trim() || lightBadge.background;
|
|
1048
|
+
const color = computed.getPropertyValue(GLYPH_COLOR_TOKEN).trim() || lightBadge.color;
|
|
1049
|
+
if (background === lightBadge.background && color === lightBadge.color) {
|
|
1050
|
+
return lightBadge;
|
|
1051
|
+
}
|
|
1052
|
+
const key = `${background}|${color}`;
|
|
1053
|
+
const held = badgesRead.get(key);
|
|
1054
|
+
if (held !== void 0) {
|
|
1055
|
+
return held;
|
|
1056
|
+
}
|
|
1057
|
+
const badge = { background, color };
|
|
1058
|
+
badgesRead.set(key, badge);
|
|
1059
|
+
return badge;
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
// src/map/hooks/useStudioSplitPicking.ts
|
|
1063
|
+
var SECTIONS4 = ["editing"];
|
|
1064
|
+
var splitPinOf = (badge) => ({
|
|
1065
|
+
background: badge.background,
|
|
1066
|
+
color: badge.color,
|
|
1067
|
+
glyph: "split",
|
|
1068
|
+
rotate: 90
|
|
1069
|
+
});
|
|
1070
|
+
var useStudioSplitPicking = (client, options) => {
|
|
1071
|
+
const statedPin = options?.splitPinIcon;
|
|
1072
|
+
const viewerUnits = chunkBAYGKSWY_cjs.useStudioUnits();
|
|
1073
|
+
const unitFormat = options?.units ?? viewerUnits;
|
|
1074
|
+
const studioRootRef = useStudioEditorRoot();
|
|
1075
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
1076
|
+
const words = chunk2DDL2LIJ_cjs.useStudioScopedStrings(SECTIONS4);
|
|
1077
|
+
const reportFailure = chunk3Q23QKNI_cjs.useStudioFailureAlert();
|
|
1078
|
+
const segmentId = chunkCWQ4WHPI_cjs.useUiStore((state) => studio.selectSegmentSplitPick(state)?.segmentId ?? null);
|
|
1079
|
+
const segment = chunkCWQ4WHPI_cjs.useUiStore(
|
|
1080
|
+
(state) => state.activeItinerary?.segments.find((entry) => entry.id === segmentId) ?? null
|
|
1081
|
+
);
|
|
1082
|
+
const armed = react.useMemo(
|
|
1083
|
+
() => segment === null ? null : { geojson: segment.geojson, lengthMeters: studio.segmentLengthMeters(segment.geojson) },
|
|
1084
|
+
[segment]
|
|
1085
|
+
);
|
|
1086
|
+
const armedRef = react.useRef(armed);
|
|
1087
|
+
react.useEffect(() => {
|
|
1088
|
+
armedRef.current = armed;
|
|
1089
|
+
}, [armed]);
|
|
1090
|
+
const hintRef = react.useRef("");
|
|
1091
|
+
const pointerRef = react.useRef(null);
|
|
1092
|
+
const inReachRef = react.useRef(true);
|
|
1093
|
+
const pinnedRef = react.useRef(void 0);
|
|
1094
|
+
const schemePinRef = react.useRef(null);
|
|
1095
|
+
const tooltipHintRef = react.useRef(null);
|
|
1096
|
+
react.useEffect(() => {
|
|
1097
|
+
hintRef.current = words.editing.splitPickHint;
|
|
1098
|
+
}, [words]);
|
|
1099
|
+
react.useEffect(() => {
|
|
1100
|
+
if (!client || segmentId === null) {
|
|
1101
|
+
return;
|
|
1102
|
+
}
|
|
1103
|
+
schemePinRef.current = splitPinOf(activityBadgeOf(studioRootRef));
|
|
1104
|
+
client.beginPointPick({ target: "split" });
|
|
1105
|
+
void bus.dispatch(context, "studio.itinerary.emphasis.set", { id: segmentId, mode: "segment" });
|
|
1106
|
+
}, [bus, client, context, segmentId, studioRootRef]);
|
|
1107
|
+
chunkEN5RWYHP_cjs.useEscapeKey(
|
|
1108
|
+
(event) => {
|
|
1109
|
+
if (keyTakenNearer(event)) {
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
event.preventDefault();
|
|
1113
|
+
void bus.dispatch(context, "studio.itinerary.segment.splitPickCancel", {});
|
|
1114
|
+
},
|
|
1115
|
+
client !== null && segmentId !== null
|
|
1116
|
+
);
|
|
1117
|
+
const setPin = react.useCallback(
|
|
1118
|
+
(lngLat) => {
|
|
1119
|
+
const previous = pinnedRef.current;
|
|
1120
|
+
if (previous !== void 0 && (previous === null ? lngLat === null : lngLat !== null && previous[0] === lngLat[0] && previous[1] === lngLat[1])) {
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
pinnedRef.current = lngLat;
|
|
1124
|
+
const icon = statedPin ?? schemePinRef.current ?? splitPinOf(activityBadgeOf(studioRootRef));
|
|
1125
|
+
void bus.dispatch(context, "studio.itinerary.profileMarker.set", {
|
|
1126
|
+
icon: lngLat ? icon : null,
|
|
1127
|
+
lngLat
|
|
1128
|
+
});
|
|
1129
|
+
},
|
|
1130
|
+
[bus, context, statedPin, studioRootRef]
|
|
1131
|
+
);
|
|
1132
|
+
const resolveReadout = react.useCallback(() => {
|
|
1133
|
+
const point = pointerRef.current;
|
|
1134
|
+
const target = armedRef.current;
|
|
1135
|
+
const viewport = context.map?.getViewport();
|
|
1136
|
+
if (!point || !target || !viewport) {
|
|
1137
|
+
return hintRef.current;
|
|
1138
|
+
}
|
|
1139
|
+
const verdict = studio.splitPickVerdict(
|
|
1140
|
+
target.geojson,
|
|
1141
|
+
point,
|
|
1142
|
+
studio.SPLIT_PICK_TOLERANCE_PX * camera.groundMetersPerPixel(viewport.zoom, point[1])
|
|
1143
|
+
);
|
|
1144
|
+
if (verdict.ok === false && verdict.code === "invalid-input") {
|
|
1145
|
+
return hintRef.current;
|
|
1146
|
+
}
|
|
1147
|
+
inReachRef.current = verdict.ok;
|
|
1148
|
+
const withinReach = verdict.ok || verdict.code === "split-on-end";
|
|
1149
|
+
setPin(withinReach ? verdict.projection.point : null);
|
|
1150
|
+
tooltipHintRef.current?.(hintRef.current);
|
|
1151
|
+
if (verdict.ok === false) {
|
|
1152
|
+
return verdict.code === "split-too-far" ? words.editing.splitPickTooFar : words.editing.splitPickOnEnd;
|
|
1153
|
+
}
|
|
1154
|
+
const headMeters = target.lengthMeters * verdict.fraction;
|
|
1155
|
+
return words.editing.splitPickAt(profile.formatDistance(headMeters, unitFormat));
|
|
1156
|
+
}, [context, setPin, words, unitFormat]);
|
|
1157
|
+
const config = react.useMemo(
|
|
1158
|
+
() => ({
|
|
1159
|
+
// bus/ctx ride for the config shape; the driver only reads them to bind the
|
|
1160
|
+
// editing keyboard, which this surface omits (no `family`).
|
|
1161
|
+
bus,
|
|
1162
|
+
ctx: context,
|
|
1163
|
+
// The shared editing cross (the same cursor a segment edit locks) reads as
|
|
1164
|
+
// "click the map to place a point".
|
|
1165
|
+
cursor: elements.EDIT_CROSS_CURSOR,
|
|
1166
|
+
// disarm disposes the engine THIS hook armed, as the driver's last teardown
|
|
1167
|
+
// step, so the cursor, the tooltip, and the engine come off together. The two
|
|
1168
|
+
// paints the gesture owns go with it: the preview pin comes off, and the emphasis
|
|
1169
|
+
// that singled the target line out is handed back.
|
|
1170
|
+
disarm: (mapClient) => {
|
|
1171
|
+
mapClient.endPointPick();
|
|
1172
|
+
void bus.dispatch(context, "studio.itinerary.profileMarker.set", { lngLat: null });
|
|
1173
|
+
const state = context.ui.getState();
|
|
1174
|
+
void bus.dispatch(
|
|
1175
|
+
context,
|
|
1176
|
+
"studio.itinerary.emphasis.set",
|
|
1177
|
+
studio.itineraryEmphasisFor(state.selection, state.activeItinerary)
|
|
1178
|
+
);
|
|
1179
|
+
pointerRef.current = null;
|
|
1180
|
+
inReachRef.current = true;
|
|
1181
|
+
pinnedRef.current = void 0;
|
|
1182
|
+
},
|
|
1183
|
+
// Three subscriptions, torn down together by the composed unsubscribe.
|
|
1184
|
+
//
|
|
1185
|
+
// The click seam: each click emits a [lng, lat] the pick tool projects onto the
|
|
1186
|
+
// armed segment's line and converts into a fraction. The coordinate is handed
|
|
1187
|
+
// over verbatim (the projection is the tool's), so a human click and an
|
|
1188
|
+
// agent-supplied fraction land on the same split. The result is awaited and
|
|
1189
|
+
// reported because this dispatch CHAINS: the pick tool resolves the fraction and
|
|
1190
|
+
// then dispatches the split itself, so the server's refusal comes back through
|
|
1191
|
+
// here. It is the only place the gesture can be answered: the confirm modal it
|
|
1192
|
+
// raised is gone by the time the write returns.
|
|
1193
|
+
//
|
|
1194
|
+
// The move seam: the same projection the click will make, run ahead of it, so the
|
|
1195
|
+
// user reads WHERE the cut lands before spending the click and sees the pin sit
|
|
1196
|
+
// on the line rather than under the cursor. Each move only stores the coordinate;
|
|
1197
|
+
// the projection itself runs at most once per frame, inside the tooltip's own
|
|
1198
|
+
// text callback, because a routed segment carries thousands of coordinates and a
|
|
1199
|
+
// raw mousemove fires far more often than the screen updates.
|
|
1200
|
+
//
|
|
1201
|
+
// The leave seam: the pin is painted from the frame loop, and the tooltip
|
|
1202
|
+
// controller stops that loop the moment the pointer leaves the canvas (it nulls
|
|
1203
|
+
// its own last point). Nothing would then take the pin off, so it would sit on
|
|
1204
|
+
// the route while the pointer is over a panel, reading as a placed cut rather
|
|
1205
|
+
// than a preview of one. The pin, the cursor, and the tooltip come off together
|
|
1206
|
+
// in `disarm`; this is the same rule applied to the pointer merely leaving.
|
|
1207
|
+
subscribeDraft: (mapClient) => {
|
|
1208
|
+
const detachClick = mapClient.onPointPickChange(async (change) => {
|
|
1209
|
+
const result = await bus.dispatch(context, "studio.itinerary.segment.splitPickSet", {
|
|
1210
|
+
lngLat: change.lngLat
|
|
1211
|
+
});
|
|
1212
|
+
reportFailure(result, words.editing.segmentSplitFailed);
|
|
1213
|
+
});
|
|
1214
|
+
const detachMove = mapClient.onPointerMove((move) => {
|
|
1215
|
+
pointerRef.current = move.lngLat;
|
|
1216
|
+
});
|
|
1217
|
+
const detachLeave = mapClient.onPointerLeave(() => {
|
|
1218
|
+
pointerRef.current = null;
|
|
1219
|
+
setPin(null);
|
|
1220
|
+
});
|
|
1221
|
+
return () => {
|
|
1222
|
+
detachClick();
|
|
1223
|
+
detachMove();
|
|
1224
|
+
detachLeave();
|
|
1225
|
+
};
|
|
1226
|
+
},
|
|
1227
|
+
// The instruction stays put on the secondary line while the primary one carries
|
|
1228
|
+
// the live measurement, so the gesture never loses its own explanation.
|
|
1229
|
+
tooltipHintRef,
|
|
1230
|
+
tooltipPrimaryText: () => resolveReadout(),
|
|
1231
|
+
// Out of reach reads as a warning: the click is about to be refused, and saying
|
|
1232
|
+
// so before it is spent is the whole point of the preview.
|
|
1233
|
+
tooltipTone: () => inReachRef.current ? "info" : "warning"
|
|
1234
|
+
}),
|
|
1235
|
+
[bus, context, reportFailure, resolveReadout, setPin, words]
|
|
1236
|
+
);
|
|
1237
|
+
const enabled = client !== null && segmentId !== null;
|
|
1238
|
+
useStudioEditEngine(client, enabled, config, [bus, context, segmentId]);
|
|
1239
|
+
};
|
|
1240
|
+
var SECTIONS5 = ["editing"];
|
|
1241
|
+
var useStudioSuggestionPicking = (client) => {
|
|
1242
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
1243
|
+
const words = chunk2DDL2LIJ_cjs.useStudioScopedStrings(SECTIONS5);
|
|
1244
|
+
const picking = chunkCWQ4WHPI_cjs.useUiStore((state) => studio.selectSuggestionSession(state)?.picking ?? null);
|
|
1245
|
+
const textsRef = react.useRef({ setEnd: "", setStart: "" });
|
|
1246
|
+
const pickingRef = elementsReact.useLatestRef(picking);
|
|
1247
|
+
const tooltipHintRef = react.useRef(null);
|
|
1248
|
+
react.useEffect(() => {
|
|
1249
|
+
textsRef.current = {
|
|
1250
|
+
setEnd: words.editing.suggestPickEnd,
|
|
1251
|
+
setStart: words.editing.suggestPickStart
|
|
1252
|
+
};
|
|
1253
|
+
}, [words]);
|
|
1254
|
+
react.useEffect(() => {
|
|
1255
|
+
if (!client || picking === null) {
|
|
1256
|
+
return;
|
|
1257
|
+
}
|
|
1258
|
+
client.beginPointPick({ target: picking });
|
|
1259
|
+
}, [client, picking]);
|
|
1260
|
+
chunkEN5RWYHP_cjs.useEscapeKey(
|
|
1261
|
+
(event) => {
|
|
1262
|
+
if (keyTakenNearer(event)) {
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1265
|
+
event.preventDefault();
|
|
1266
|
+
void bus.dispatch(context, "studio.itinerary.suggest.cancelPick", {});
|
|
1267
|
+
},
|
|
1268
|
+
client !== null && picking !== null
|
|
1269
|
+
);
|
|
1270
|
+
const config = react.useMemo(
|
|
1271
|
+
() => ({
|
|
1272
|
+
// bus/ctx ride for the config shape; the driver only reads them to bind the
|
|
1273
|
+
// editing keyboard, which this surface omits (no `family`).
|
|
1274
|
+
bus,
|
|
1275
|
+
ctx: context,
|
|
1276
|
+
// The shared editing cross (the same cursor a segment edit locks) reads as
|
|
1277
|
+
// "click the map to place a point".
|
|
1278
|
+
cursor: elements.EDIT_CROSS_CURSOR,
|
|
1279
|
+
// disarm disposes the engine THIS hook armed. The authoring families leave
|
|
1280
|
+
// disposal to the tool path; the point-pick engine has no tool that disposes
|
|
1281
|
+
// it, so the hook that began it tears it down here, as the driver's last
|
|
1282
|
+
// teardown step.
|
|
1283
|
+
disarm: (mapClient) => {
|
|
1284
|
+
mapClient.endPointPick();
|
|
1285
|
+
},
|
|
1286
|
+
// The engine → session seam: each click emits a [lng, lat]; dispatch the
|
|
1287
|
+
// setter for the endpoint the pick is arming, read through the ref so a
|
|
1288
|
+
// start↔end flip routes the next click without re-attaching. The setter
|
|
1289
|
+
// clears the picking slot (one-shot), which disarms the whole lifecycle.
|
|
1290
|
+
subscribeDraft: (mapClient) => mapClient.onPointPickChange((change) => {
|
|
1291
|
+
void bus.dispatch(
|
|
1292
|
+
context,
|
|
1293
|
+
pickingRef.current === "end" ? "studio.itinerary.suggest.setEnd" : "studio.itinerary.suggest.setStart",
|
|
1294
|
+
{ lngLat: change.lngLat }
|
|
1295
|
+
);
|
|
1296
|
+
}),
|
|
1297
|
+
// Single-line tooltip: no secondary hint.
|
|
1298
|
+
tooltipHintRef,
|
|
1299
|
+
tooltipPrimaryText: () => pickingRef.current === "end" ? textsRef.current.setEnd : textsRef.current.setStart
|
|
1300
|
+
}),
|
|
1301
|
+
[bus, context, pickingRef]
|
|
1302
|
+
);
|
|
1303
|
+
const enabled = client !== null && picking !== null;
|
|
1304
|
+
useStudioEditEngine(client, enabled, config, [bus, context, picking]);
|
|
1305
|
+
};
|
|
1306
|
+
var useStudioTimestamp = (client) => {
|
|
1307
|
+
const overlaysEntitled = useStudioOverlaysEntitled();
|
|
1308
|
+
const clock = chunkQZ7W2E4U_cjs.useStudioClock();
|
|
1309
|
+
const { manifest: layers } = elementsReact.useMountayaLayersManifest();
|
|
1310
|
+
const { activeEnrichments, activeOverlay, overlayTimestamp } = chunk4TX5E63A_cjs.useUiStoreShallow((state) => ({
|
|
1311
|
+
activeEnrichments: state.activeEnrichments,
|
|
1312
|
+
activeOverlay: state.activeOverlay,
|
|
1313
|
+
overlayTimestamp: state.overlayTimestamp
|
|
1314
|
+
}));
|
|
1315
|
+
const hillshadeActive = activeEnrichments.includes(studio.HILLSHADE_OVERLAY_SLUG);
|
|
1316
|
+
const stampedRef = react.useRef(null);
|
|
1317
|
+
react.useEffect(() => {
|
|
1318
|
+
if (!client || !layers) {
|
|
1319
|
+
return;
|
|
1320
|
+
}
|
|
1321
|
+
const instant = studio.overlayInstant(
|
|
1322
|
+
overlayTimestamp === null ? null : new Date(overlayTimestamp),
|
|
1323
|
+
clock.now()
|
|
1324
|
+
);
|
|
1325
|
+
if (instant === null) {
|
|
1326
|
+
return;
|
|
1327
|
+
}
|
|
1328
|
+
if (stampedRef.current?.client !== client || stampedRef.current.overlay !== activeOverlay) {
|
|
1329
|
+
stampedRef.current = { client, overlay: activeOverlay, urls: /* @__PURE__ */ new Map() };
|
|
1330
|
+
}
|
|
1331
|
+
const stamped = stampedRef.current.urls;
|
|
1332
|
+
for (const source of studio.timestampedSources(
|
|
1333
|
+
layers,
|
|
1334
|
+
overlaysEntitled ? activeOverlay : null,
|
|
1335
|
+
instant
|
|
1336
|
+
)) {
|
|
1337
|
+
const urls = source.tiles.join("\n");
|
|
1338
|
+
if (stamped.get(source.sourceId) !== urls) {
|
|
1339
|
+
stamped.set(source.sourceId, urls);
|
|
1340
|
+
client.setSourceTiles(source.sourceId, source.tiles);
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
if (!hillshadeActive) {
|
|
1344
|
+
return;
|
|
1345
|
+
}
|
|
1346
|
+
let litFrom = null;
|
|
1347
|
+
const applyIllumination = () => {
|
|
1348
|
+
const { azimuth } = time.solarPosition(instant, client.getViewport().center);
|
|
1349
|
+
const direction = Math.round(azimuth) % units.DEGREES_PER_TURN;
|
|
1350
|
+
if (direction === litFrom) {
|
|
1351
|
+
return;
|
|
1352
|
+
}
|
|
1353
|
+
litFrom = direction;
|
|
1354
|
+
client.setHillshadeIllumination(direction);
|
|
1355
|
+
};
|
|
1356
|
+
applyIllumination();
|
|
1357
|
+
return client.onViewportChange(applyIllumination);
|
|
1358
|
+
}, [clock, client, layers, activeOverlay, overlayTimestamp, hillshadeActive, overlaysEntitled]);
|
|
1359
|
+
react.useEffect(() => {
|
|
1360
|
+
if (!client) {
|
|
1361
|
+
return;
|
|
1362
|
+
}
|
|
1363
|
+
let written = null;
|
|
1364
|
+
const apply = () => {
|
|
1365
|
+
const reference = studio.zoneTimeReferenceSeconds(overlayTimestamp, clock.now());
|
|
1366
|
+
if (Object.is(reference, written)) {
|
|
1367
|
+
return;
|
|
1368
|
+
}
|
|
1369
|
+
written = reference;
|
|
1370
|
+
client.setZoneTimeReference(reference);
|
|
1371
|
+
};
|
|
1372
|
+
apply();
|
|
1373
|
+
if (overlayTimestamp) {
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1376
|
+
const untilTurn = () => {
|
|
1377
|
+
const sinceTurn = clock.now() % studio.ZONE_TIME_REFERENCE_INTERVAL_MS;
|
|
1378
|
+
return Number.isFinite(sinceTurn) ? studio.ZONE_TIME_REFERENCE_INTERVAL_MS - sinceTurn : studio.ZONE_TIME_REFERENCE_INTERVAL_MS;
|
|
1379
|
+
};
|
|
1380
|
+
let cancelTick = () => void 0;
|
|
1381
|
+
let stopped = false;
|
|
1382
|
+
const armTick = (delayMs) => {
|
|
1383
|
+
const armedAt = clock.now();
|
|
1384
|
+
cancelTick = clock.after(delayMs, () => {
|
|
1385
|
+
if (stopped) {
|
|
1386
|
+
return;
|
|
1387
|
+
}
|
|
1388
|
+
apply();
|
|
1389
|
+
const stoodStill = clock.now() === armedAt;
|
|
1390
|
+
armTick(stoodStill ? Math.min(delayMs * 2, studio.ZONE_TIME_REFERENCE_INTERVAL_MS) : untilTurn());
|
|
1391
|
+
});
|
|
1392
|
+
};
|
|
1393
|
+
armTick(untilTurn());
|
|
1394
|
+
const detachMove = client.onViewportChange(apply);
|
|
1395
|
+
return () => {
|
|
1396
|
+
stopped = true;
|
|
1397
|
+
cancelTick();
|
|
1398
|
+
detachMove();
|
|
1399
|
+
};
|
|
1400
|
+
}, [clock, client, overlayTimestamp]);
|
|
1401
|
+
};
|
|
1402
|
+
var hasNow = (nowMs) => studio.timeSliderWindow(nowMs).startMs !== null;
|
|
1403
|
+
var minutesFromNow = (iso, nowMs) => {
|
|
1404
|
+
if (iso === null || !hasNow(nowMs)) {
|
|
1405
|
+
return void 0;
|
|
1406
|
+
}
|
|
1407
|
+
const minutes = Math.round(
|
|
1408
|
+
units.convertDuration(new Date(iso).getTime() - nowMs, "millisecond", "minute")
|
|
1409
|
+
);
|
|
1410
|
+
if (Number.isNaN(minutes)) {
|
|
1411
|
+
return void 0;
|
|
1412
|
+
}
|
|
1413
|
+
return Math.min(Math.max(minutes, studio.TIME_OFFSET_MIN_MINUTES), studio.TIME_OFFSET_MAX_MINUTES);
|
|
1414
|
+
};
|
|
1415
|
+
var instantFromNow = (minutes, nowMs) => {
|
|
1416
|
+
if (!hasNow(nowMs)) {
|
|
1417
|
+
return null;
|
|
1418
|
+
}
|
|
1419
|
+
const instant = new Date(nowMs + units.convertDuration(minutes, "minute", "millisecond"));
|
|
1420
|
+
return Number.isNaN(instant.getTime()) ? null : instant.toISOString();
|
|
1421
|
+
};
|
|
1422
|
+
var seedMapFromSearch = (search, { bus, context }, nowMs, holds2) => {
|
|
1423
|
+
if (search.terrain !== void 0) {
|
|
1424
|
+
void bus.dispatch(context, "studio.terrain.set", { terrain: search.terrain });
|
|
1425
|
+
}
|
|
1426
|
+
const overlaysHeld = holds2("map-overlays");
|
|
1427
|
+
if (search.overlay !== void 0 && overlaysHeld) {
|
|
1428
|
+
void bus.dispatch(context, "studio.overlay.set", { overlay: search.overlay });
|
|
1429
|
+
}
|
|
1430
|
+
if (search.enrichments !== void 0 && overlaysHeld) {
|
|
1431
|
+
for (const slug of search.enrichments) {
|
|
1432
|
+
if (slug === studio.POIS_OVERLAY_SLUG) {
|
|
1433
|
+
continue;
|
|
1434
|
+
}
|
|
1435
|
+
void bus.dispatch(context, "studio.overlay.enrichment.set", {
|
|
1436
|
+
enabled: true,
|
|
1437
|
+
overlay: slug
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
if (search.time_offset !== void 0) {
|
|
1442
|
+
const timestamp = instantFromNow(search.time_offset, nowMs);
|
|
1443
|
+
if (timestamp !== null) {
|
|
1444
|
+
void bus.dispatch(context, "studio.overlay.timestamp.set", { timestamp });
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
};
|
|
1448
|
+
var useStudioItineraryUrlMirror = (urlItineraryId, writeRef) => {
|
|
1449
|
+
const activeItineraryId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeItinerary?.id ?? null);
|
|
1450
|
+
const mirroredItineraryRef = react.useRef(void 0);
|
|
1451
|
+
react.useEffect(() => {
|
|
1452
|
+
const previous = mirroredItineraryRef.current;
|
|
1453
|
+
mirroredItineraryRef.current = activeItineraryId;
|
|
1454
|
+
if (activeItineraryId === null || activeItineraryId === previous || urlItineraryId === activeItineraryId) {
|
|
1455
|
+
return;
|
|
1456
|
+
}
|
|
1457
|
+
writeRef.current({ itinerary_id: activeItineraryId }, { hash: elements.currentMapHash() });
|
|
1458
|
+
}, [activeItineraryId, urlItineraryId, writeRef]);
|
|
1459
|
+
};
|
|
1460
|
+
var useStudioUrlState = (url) => {
|
|
1461
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
1462
|
+
const viewer = chunkJVFHF3LE_cjs.useStudioViewer();
|
|
1463
|
+
const viewerRef = elementsReact.useLatestRef(viewer);
|
|
1464
|
+
const clock = chunkQZ7W2E4U_cjs.useStudioClock();
|
|
1465
|
+
const clockRef = elementsReact.useLatestRef(clock);
|
|
1466
|
+
const initialSearch = url.readOnce();
|
|
1467
|
+
const urlState = react.useSyncExternalStore(url.subscribe, url.read, url.read);
|
|
1468
|
+
const { activeEnrichments, activeOverlay, overlayTimestamp, terrain } = chunk4TX5E63A_cjs.useUiStoreShallow(
|
|
1469
|
+
(state) => ({
|
|
1470
|
+
activeEnrichments: state.activeEnrichments,
|
|
1471
|
+
activeOverlay: state.activeOverlay,
|
|
1472
|
+
overlayTimestamp: state.overlayTimestamp,
|
|
1473
|
+
terrain: state.terrain
|
|
1474
|
+
})
|
|
1475
|
+
);
|
|
1476
|
+
const writeRef = elementsReact.useLatestRef(url.write);
|
|
1477
|
+
const initialSearchRef = elementsReact.useLatestRef(initialSearch);
|
|
1478
|
+
const initializedRef = react.useRef(false);
|
|
1479
|
+
react.useEffect(() => {
|
|
1480
|
+
if (initializedRef.current) {
|
|
1481
|
+
return;
|
|
1482
|
+
}
|
|
1483
|
+
initializedRef.current = true;
|
|
1484
|
+
seedMapFromSearch(
|
|
1485
|
+
initialSearchRef.current,
|
|
1486
|
+
{ bus, context },
|
|
1487
|
+
clockRef.current.now(),
|
|
1488
|
+
(entitlement) => viewerRef.current.hasEntitlement(entitlement)
|
|
1489
|
+
);
|
|
1490
|
+
}, [bus, clockRef, context, initialSearchRef, viewerRef]);
|
|
1491
|
+
const urlEnrichmentsKey = (urlState.enrichments ?? []).join("\0");
|
|
1492
|
+
react.useEffect(() => {
|
|
1493
|
+
const manualEnrichments = activeEnrichments.filter((slug) => slug !== studio.POIS_OVERLAY_SLUG);
|
|
1494
|
+
const mapStatePatch = {
|
|
1495
|
+
enrichments: manualEnrichments.length > 0 ? manualEnrichments : void 0,
|
|
1496
|
+
overlay: activeOverlay ?? void 0,
|
|
1497
|
+
terrain,
|
|
1498
|
+
time_offset: minutesFromNow(overlayTimestamp, clockRef.current.now())
|
|
1499
|
+
};
|
|
1500
|
+
const unchanged = urlState.overlay === mapStatePatch.overlay && urlState.terrain === mapStatePatch.terrain && urlEnrichmentsKey === manualEnrichments.join("\0") && urlState.time_offset === mapStatePatch.time_offset;
|
|
1501
|
+
if (unchanged) {
|
|
1502
|
+
return;
|
|
1503
|
+
}
|
|
1504
|
+
writeRef.current(mapStatePatch, { hash: elements.currentMapHash() });
|
|
1505
|
+
}, [
|
|
1506
|
+
activeEnrichments,
|
|
1507
|
+
activeOverlay,
|
|
1508
|
+
clockRef,
|
|
1509
|
+
overlayTimestamp,
|
|
1510
|
+
terrain,
|
|
1511
|
+
urlEnrichmentsKey,
|
|
1512
|
+
urlState.overlay,
|
|
1513
|
+
urlState.terrain,
|
|
1514
|
+
urlState.time_offset,
|
|
1515
|
+
writeRef
|
|
1516
|
+
]);
|
|
1517
|
+
useStudioItineraryUrlMirror(urlState.itinerary_id, writeRef);
|
|
1518
|
+
};
|
|
1519
|
+
var SECTIONS6 = ["editing"];
|
|
1520
|
+
var useStudioWaypointEditing = (client) => {
|
|
1521
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
1522
|
+
const words = chunk2DDL2LIJ_cjs.useStudioScopedStrings(SECTIONS6);
|
|
1523
|
+
const reportCommit = useStudioEditCommitReporter(null);
|
|
1524
|
+
const { manifest: layers$1 } = elementsReact.useMountayaLayersManifest();
|
|
1525
|
+
const waypointId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.waypointEditSession?.waypointId ?? null);
|
|
1526
|
+
const intent = chunkCWQ4WHPI_cjs.useUiStore((state) => state.waypointEditSession?.intent ?? null);
|
|
1527
|
+
const mode = chunkCWQ4WHPI_cjs.useUiStore((state) => state.waypointEditSession?.mode ?? null);
|
|
1528
|
+
const itineraryId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeItinerary?.id ?? null);
|
|
1529
|
+
const layersRef = elementsReact.useLatestRef(layers$1);
|
|
1530
|
+
const hasLayers = layers$1 !== null && layers$1 !== void 0;
|
|
1531
|
+
const textsRef = react.useRef({
|
|
1532
|
+
clickAPoi: "",
|
|
1533
|
+
clickToCapture: "",
|
|
1534
|
+
clickToDrop: "",
|
|
1535
|
+
clickToMove: ""
|
|
1536
|
+
});
|
|
1537
|
+
const modeRef = react.useRef("point");
|
|
1538
|
+
const poiHoverRef = react.useRef(false);
|
|
1539
|
+
const tooltipHintRef = react.useRef(null);
|
|
1540
|
+
react.useEffect(() => {
|
|
1541
|
+
textsRef.current = {
|
|
1542
|
+
clickAPoi: words.editing.waypointClickAPoi,
|
|
1543
|
+
clickToCapture: words.editing.waypointClickToCapture,
|
|
1544
|
+
clickToDrop: words.editing.waypointClickToDrop,
|
|
1545
|
+
clickToMove: words.editing.waypointClickToMove
|
|
1546
|
+
};
|
|
1547
|
+
}, [words]);
|
|
1548
|
+
react.useEffect(() => {
|
|
1549
|
+
const draft = context.ui.getState().waypointEditSession?.draft ?? null;
|
|
1550
|
+
modeRef.current = mode ?? "point";
|
|
1551
|
+
poiHoverRef.current = false;
|
|
1552
|
+
if (!client || mode === null || intent === null || itineraryId === null || waypointId === null || draft === null) {
|
|
1553
|
+
return;
|
|
1554
|
+
}
|
|
1555
|
+
client.beginWaypointEdit({
|
|
1556
|
+
initialColor: draft.color,
|
|
1557
|
+
initialIcon: draft.icon,
|
|
1558
|
+
initialLngLat: draft.lngLat,
|
|
1559
|
+
mode,
|
|
1560
|
+
waypointId,
|
|
1561
|
+
// The hover seam is a `poi-pick` edit's alone: a point edit reads no POI under its pointer.
|
|
1562
|
+
...mode === "poi-pick" ? {
|
|
1563
|
+
onPoiHoverChange: (isOverPoi) => {
|
|
1564
|
+
poiHoverRef.current = isOverPoi;
|
|
1565
|
+
}
|
|
1566
|
+
} : {}
|
|
1567
|
+
});
|
|
1568
|
+
const layers2 = layersRef.current;
|
|
1569
|
+
if (mode === "poi-pick" && hasLayers && layers2) {
|
|
1570
|
+
const overlay = layers.findOverlay({ overlays: layers2.overlays ?? [] }, studio.POIS_OVERLAY_SLUG);
|
|
1571
|
+
const range = overlay ? layers.paintZoomRange(overlay.sources) : null;
|
|
1572
|
+
if (overlay && range !== null && range.minzoom <= range.maxzoom) {
|
|
1573
|
+
client.ensureOverlayInZoomRange({ ...range, slug: overlay.slug });
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
}, [client, context, hasLayers, intent, itineraryId, layersRef, mode, waypointId]);
|
|
1577
|
+
const config = react.useMemo(
|
|
1578
|
+
() => ({
|
|
1579
|
+
// buildCommitInput shapes the editCommit tool input from the session
|
|
1580
|
+
// identity. The store is the source of truth for the draft attributes the
|
|
1581
|
+
// tool handler reads off the session: the input stays narrow so a
|
|
1582
|
+
// malicious caller cannot inject draft data that bypasses the recorded
|
|
1583
|
+
// history.
|
|
1584
|
+
buildCommitInput: () => ({ itineraryId, waypointId }),
|
|
1585
|
+
bus,
|
|
1586
|
+
ctx: context,
|
|
1587
|
+
// The locked cursor differs by mode. A `point` edit hides the OS cursor
|
|
1588
|
+
// (`"none"`): its engine paints its own DOM cursor (the icon-in-circle
|
|
1589
|
+
// magnet), so the visible cursor is the draft itself, and the side panel's
|
|
1590
|
+
// icon/color flips reach that DOM cursor through setWaypointDraftStyle. A
|
|
1591
|
+
// `poi-pick` edit is a select-an-existing-POI action, not a drop-a-point
|
|
1592
|
+
// one, so it shows the native `"pointer"`: its engine paints no DOM cursor,
|
|
1593
|
+
// and the draft marker only lands once a POI is clicked.
|
|
1594
|
+
cursor: mode === "poi-pick" ? "pointer" : "none",
|
|
1595
|
+
// disarm is the waypoint family's teardown that does NOT touch the engine (the tool path
|
|
1596
|
+
// owns disposal), and it holds nothing of its own to reset.
|
|
1597
|
+
disarm: () => {
|
|
1598
|
+
},
|
|
1599
|
+
family: "waypoint",
|
|
1600
|
+
// A save that left the session open says so, as the segment family's does. The family
|
|
1601
|
+
// states no sentence for a refused save, so that press stays silent.
|
|
1602
|
+
onCommitResult: reportCommit,
|
|
1603
|
+
// The engine-to-session seam: `recordWaypointDraftChange` moves the session's draft to
|
|
1604
|
+
// each placement through editSetPosition (which, when a POI seed rides through, re-seeds
|
|
1605
|
+
// the icon, colour and name from its category), and drops a person's placement while the
|
|
1606
|
+
// co-pilot drives. The bus is the sole mutation surface; the hook never writes the store.
|
|
1607
|
+
subscribeDraft: (mapClient) => mapClient.onWaypointDraftChange((change) => {
|
|
1608
|
+
studio.recordWaypointDraftChange(bus, context, change);
|
|
1609
|
+
}),
|
|
1610
|
+
// The waypoint tooltip is single-line: no secondary hint.
|
|
1611
|
+
tooltipHintRef,
|
|
1612
|
+
tooltipPrimaryText: () => studio.waypointEditTooltipText(
|
|
1613
|
+
textsRef.current,
|
|
1614
|
+
modeRef.current,
|
|
1615
|
+
(context.ui.getState().waypointEditSession?.draft.lngLat ?? null) !== null,
|
|
1616
|
+
poiHoverRef.current
|
|
1617
|
+
)
|
|
1618
|
+
}),
|
|
1619
|
+
[bus, context, itineraryId, mode, reportCommit, waypointId]
|
|
1620
|
+
);
|
|
1621
|
+
const enabled = client !== null && waypointId !== null && mode !== null && intent !== null && itineraryId !== null;
|
|
1622
|
+
useStudioEditEngine(client, enabled, config, [
|
|
1623
|
+
bus,
|
|
1624
|
+
context,
|
|
1625
|
+
intent,
|
|
1626
|
+
itineraryId,
|
|
1627
|
+
mode,
|
|
1628
|
+
waypointId
|
|
1629
|
+
]);
|
|
1630
|
+
};
|
|
1631
|
+
var SECTIONS7 = ["editing"];
|
|
1632
|
+
var useStudioZoneEditing = (client, collabEngine) => {
|
|
1633
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
1634
|
+
const words = chunk2DDL2LIJ_cjs.useStudioScopedStrings(SECTIONS7);
|
|
1635
|
+
const collabEngineRef = elementsReact.useLatestRef(collabEngine);
|
|
1636
|
+
const editActive = chunkCWQ4WHPI_cjs.useUiStore(studio.selectBaseMapLocked);
|
|
1637
|
+
const zoneId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.zoneEditSession?.zoneId ?? null);
|
|
1638
|
+
const mode = chunkCWQ4WHPI_cjs.useUiStore((state) => state.zoneEditSession?.mode ?? null);
|
|
1639
|
+
const intent = chunkCWQ4WHPI_cjs.useUiStore((state) => state.zoneEditSession?.intent ?? null);
|
|
1640
|
+
const level = chunkCWQ4WHPI_cjs.useUiStore((state) => state.zoneEditSession?.level ?? null);
|
|
1641
|
+
const textsRef = react.useRef({ draw: "", finishHint: "", reshape: "" });
|
|
1642
|
+
const hasShapeRef = react.useRef(false);
|
|
1643
|
+
const tooltipSetHintRef = react.useRef(null);
|
|
1644
|
+
const refusedRef = react.useRef(false);
|
|
1645
|
+
const crossingTextRef = react.useRef("");
|
|
1646
|
+
const onOutlineRefusedChange = react.useCallback((refused) => {
|
|
1647
|
+
refusedRef.current = refused;
|
|
1648
|
+
tooltipSetHintRef.current?.(refused ? crossingTextRef.current : textsRef.current.finishHint);
|
|
1649
|
+
}, []);
|
|
1650
|
+
react.useEffect(() => {
|
|
1651
|
+
textsRef.current = {
|
|
1652
|
+
draw: words.editing.zoneDraw,
|
|
1653
|
+
finishHint: words.editing.zoneFinishHint,
|
|
1654
|
+
reshape: words.editing.zoneReshape
|
|
1655
|
+
};
|
|
1656
|
+
crossingTextRef.current = words.editing.zoneOutlineCrossing;
|
|
1657
|
+
tooltipSetHintRef.current?.(
|
|
1658
|
+
refusedRef.current ? crossingTextRef.current : textsRef.current.finishHint
|
|
1659
|
+
);
|
|
1660
|
+
}, [words]);
|
|
1661
|
+
react.useEffect(() => {
|
|
1662
|
+
const session = context.ui.getState().zoneEditSession;
|
|
1663
|
+
const seedGeometry = session?.draft ?? null;
|
|
1664
|
+
hasShapeRef.current = seedGeometry !== null;
|
|
1665
|
+
if (!client || !editActive || zoneId === null || mode === null) {
|
|
1666
|
+
return;
|
|
1667
|
+
}
|
|
1668
|
+
client.beginZoneEdit({
|
|
1669
|
+
color: layers.zoneLevelColors[session?.level ?? studio.DEFAULT_ZONE_LEVEL],
|
|
1670
|
+
featureId: zoneId,
|
|
1671
|
+
mode,
|
|
1672
|
+
onOutlineRefusedChange,
|
|
1673
|
+
seedGeometry: seedGeometry ?? void 0
|
|
1674
|
+
});
|
|
1675
|
+
}, [client, context, editActive, mode, onOutlineRefusedChange, zoneId]);
|
|
1676
|
+
react.useEffect(() => {
|
|
1677
|
+
if (!client || !editActive || level === null) {
|
|
1678
|
+
return;
|
|
1679
|
+
}
|
|
1680
|
+
client.setZoneDraftStyle({ color: layers.zoneLevelColors[level] });
|
|
1681
|
+
}, [client, editActive, level]);
|
|
1682
|
+
const config = react.useMemo(
|
|
1683
|
+
() => ({
|
|
1684
|
+
// buildCommitInput shapes the editCommit tool input the keyboard dispatches.
|
|
1685
|
+
// It carries the session intent + zone id; a reshape commits fully from this
|
|
1686
|
+
// (the geometry is read off the map, the level off the session). A create's
|
|
1687
|
+
// form metadata (description / window / organization) is layered on by the
|
|
1688
|
+
// zone panel's own Save dispatch: the keyboard Enter is the parallel
|
|
1689
|
+
// affordance, so this stays the minimal session-identity input.
|
|
1690
|
+
buildCommitInput: () => {
|
|
1691
|
+
if (zoneId === null || intent === null) {
|
|
1692
|
+
return {};
|
|
1693
|
+
}
|
|
1694
|
+
return { intent, zoneId };
|
|
1695
|
+
},
|
|
1696
|
+
bus,
|
|
1697
|
+
ctx: context,
|
|
1698
|
+
cursor: elements.ZONE_CREATE_CURSOR,
|
|
1699
|
+
// disarm is the zone family's teardown that does NOT touch the engine (the
|
|
1700
|
+
// tool path owns disposal): it only resets the per-frame shape flag so a
|
|
1701
|
+
// re-open of the panel reads a clean state.
|
|
1702
|
+
disarm: () => {
|
|
1703
|
+
hasShapeRef.current = false;
|
|
1704
|
+
refusedRef.current = false;
|
|
1705
|
+
},
|
|
1706
|
+
// The keymap reads the bound zone at key time: Escape is the panel's while a saved zone
|
|
1707
|
+
// is bound, and cancels the draw while one is being created.
|
|
1708
|
+
family: "zone",
|
|
1709
|
+
// The draft seam: `recordZoneDraftChange` writes each change into the store's edit
|
|
1710
|
+
// session by its disposition and phase (a person's reshape while the co-pilot drives is
|
|
1711
|
+
// dropped, a programmatic echo is never recorded, a live frame moves the draft and the
|
|
1712
|
+
// settled draft records one undo step). The engine renders its own drawn shape, so what
|
|
1713
|
+
// stays here is the shape flag the tooltip reads and the forward to collaborators.
|
|
1714
|
+
subscribeDraft: (mapClient) => mapClient.onZoneDraftChange((draft) => {
|
|
1715
|
+
if (studio.recordZoneDraftChange(context.ui, draft) === "drop") {
|
|
1716
|
+
const held = context.ui.getState().zoneEditSession?.draft ?? null;
|
|
1717
|
+
if (draft.phase === "settled" && held !== null) {
|
|
1718
|
+
mapClient.applyZoneDraft(held);
|
|
1719
|
+
}
|
|
1720
|
+
return;
|
|
1721
|
+
}
|
|
1722
|
+
hasShapeRef.current = true;
|
|
1723
|
+
if (zoneId) {
|
|
1724
|
+
collabEngineRef.current?.sendDraft({ id: zoneId, kind: "zone" }, draft.geometry);
|
|
1725
|
+
}
|
|
1726
|
+
}),
|
|
1727
|
+
// The zone tooltip carries the Enter-to-finish hint, refreshed live by the
|
|
1728
|
+
// locale effect, or why the gesture under the pointer is refused.
|
|
1729
|
+
tooltipHint: () => refusedRef.current ? crossingTextRef.current : textsRef.current.finishHint,
|
|
1730
|
+
tooltipHintRef: tooltipSetHintRef,
|
|
1731
|
+
tooltipPrimaryText: () => studio.zoneEditTooltipText(textsRef.current, hasShapeRef.current)
|
|
1732
|
+
}),
|
|
1733
|
+
[bus, collabEngineRef, context, intent, zoneId]
|
|
1734
|
+
);
|
|
1735
|
+
const enabled = client !== null && editActive && zoneId !== null && mode !== null;
|
|
1736
|
+
useStudioEditEngine(client, enabled, config, [editActive, zoneId, mode, bus, context]);
|
|
1737
|
+
};
|
|
1738
|
+
var SECTIONS8 = ["editing"];
|
|
1739
|
+
var useStudioZoneOriginPicking = (client) => {
|
|
1740
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
1741
|
+
const words = chunk2DDL2LIJ_cjs.useStudioScopedStrings(SECTIONS8);
|
|
1742
|
+
const picking = chunkCWQ4WHPI_cjs.useUiStore((state) => state.zoneOriginPicking);
|
|
1743
|
+
const tooltipTextRef = react.useRef("");
|
|
1744
|
+
const tooltipHintRef = react.useRef(null);
|
|
1745
|
+
react.useEffect(() => {
|
|
1746
|
+
tooltipTextRef.current = words.editing.zonePickOrigin;
|
|
1747
|
+
}, [words]);
|
|
1748
|
+
react.useEffect(() => {
|
|
1749
|
+
if (!client || !picking) {
|
|
1750
|
+
return;
|
|
1751
|
+
}
|
|
1752
|
+
client.beginPointPick({ target: "origin" });
|
|
1753
|
+
}, [client, picking]);
|
|
1754
|
+
chunkEN5RWYHP_cjs.useEscapeKey(
|
|
1755
|
+
(event) => {
|
|
1756
|
+
if (keyTakenNearer(event)) {
|
|
1757
|
+
return;
|
|
1758
|
+
}
|
|
1759
|
+
event.preventDefault();
|
|
1760
|
+
void bus.dispatch(context, "studio.zone.cancelOriginPick", {});
|
|
1761
|
+
},
|
|
1762
|
+
client !== null && picking
|
|
1763
|
+
);
|
|
1764
|
+
const config = react.useMemo(
|
|
1765
|
+
() => ({
|
|
1766
|
+
// bus/ctx ride for the config shape; the driver only reads them to bind the
|
|
1767
|
+
// editing keyboard, which this surface omits (no `family`).
|
|
1768
|
+
bus,
|
|
1769
|
+
ctx: context,
|
|
1770
|
+
// The shared editing cross (the same cursor a segment edit locks) reads as
|
|
1771
|
+
// "click the map to place a point".
|
|
1772
|
+
cursor: elements.EDIT_CROSS_CURSOR,
|
|
1773
|
+
// disarm disposes the engine THIS hook armed, as the driver's last teardown
|
|
1774
|
+
// step, so the engine comes off in lockstep with the cursor + tooltip.
|
|
1775
|
+
disarm: (mapClient) => {
|
|
1776
|
+
mapClient.endPointPick();
|
|
1777
|
+
},
|
|
1778
|
+
// The engine → store seam: each click emits a [lng, lat] the setOrigin tool
|
|
1779
|
+
// writes. That tool also clears the picking flag, which disarms the whole
|
|
1780
|
+
// lifecycle: the placement and the teardown are one event.
|
|
1781
|
+
subscribeDraft: (mapClient) => mapClient.onPointPickChange((change) => {
|
|
1782
|
+
void bus.dispatch(context, "studio.zone.setOrigin", { lngLat: change.lngLat });
|
|
1783
|
+
}),
|
|
1784
|
+
// Single-line tooltip: no secondary hint.
|
|
1785
|
+
tooltipHintRef,
|
|
1786
|
+
tooltipPrimaryText: () => tooltipTextRef.current
|
|
1787
|
+
}),
|
|
1788
|
+
[bus, context]
|
|
1789
|
+
);
|
|
1790
|
+
const enabled = client !== null && picking;
|
|
1791
|
+
useStudioEditEngine(client, enabled, config, [bus, context, picking]);
|
|
1792
|
+
};
|
|
1793
|
+
var tileOrganizationId = (value) => typeof value === "string" && value !== "" ? value : null;
|
|
1794
|
+
var useStudioZoneSelection = (client, options) => {
|
|
1795
|
+
const { bus, context } = useStudioMapEditSeams();
|
|
1796
|
+
const { manifest: layers$1 } = elementsReact.useMountayaLayersManifest();
|
|
1797
|
+
const currentUserId = chunkEWWHVV7R_cjs.useStudioUserId();
|
|
1798
|
+
const { writable, writeRefusal } = chunkII6C3LU2_cjs.useStudioOrganizations();
|
|
1799
|
+
const { writableOrgIds } = writable;
|
|
1800
|
+
const itinerarySources = options?.itinerarySources;
|
|
1801
|
+
const scope = chunkCWQ4WHPI_cjs.useUiStore(studio.mapInteractionScope);
|
|
1802
|
+
const openId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeZone?.id ?? null);
|
|
1803
|
+
const zoneLayerIds = react.useMemo(() => {
|
|
1804
|
+
const sources = layers$1?.zones?.sources ?? [];
|
|
1805
|
+
const ids = [];
|
|
1806
|
+
for (const source of sources) {
|
|
1807
|
+
for (const layer of source.layers) {
|
|
1808
|
+
if (layer.source_layer === layers.ZONE_FILL_SOURCE_LAYER) {
|
|
1809
|
+
ids.push(layer.id);
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
return ids;
|
|
1814
|
+
}, [layers$1]);
|
|
1815
|
+
const itineraryLayerIds = react.useMemo(
|
|
1816
|
+
() => studio.itineraryLayerIdsOf(itinerarySources ?? layers$1?.itineraries?.sources ?? []),
|
|
1817
|
+
[itinerarySources, layers$1]
|
|
1818
|
+
);
|
|
1819
|
+
react.useEffect(() => {
|
|
1820
|
+
if (!client || scope === "locked" || scope === "itinerary" || zoneLayerIds.length === 0) {
|
|
1821
|
+
return;
|
|
1822
|
+
}
|
|
1823
|
+
const resumable = (hit) => {
|
|
1824
|
+
const activeZone = context.ui.getState().activeZone;
|
|
1825
|
+
return studio.zoneClickTarget(hit, activeZone, currentUserId, writableOrgIds)?.kind === "reshape" && writeRefusal?.("zone", activeZone?.organization_id) == null;
|
|
1826
|
+
};
|
|
1827
|
+
const zoneOpen = scope === "zone";
|
|
1828
|
+
const options2 = zoneOpen ? { accepts: resumable } : {};
|
|
1829
|
+
const detachZoneClick = client.onFeatureClick(
|
|
1830
|
+
zoneOpen ? zoneLayerIds : [...zoneLayerIds, ...itineraryLayerIds],
|
|
1831
|
+
(hit) => {
|
|
1832
|
+
if (studio.drawnByItinerary(hit)) {
|
|
1833
|
+
return;
|
|
1834
|
+
}
|
|
1835
|
+
const target = studio.zoneClickTarget(
|
|
1836
|
+
hit,
|
|
1837
|
+
context.ui.getState().activeZone,
|
|
1838
|
+
currentUserId,
|
|
1839
|
+
writableOrgIds
|
|
1840
|
+
);
|
|
1841
|
+
if (target === null) {
|
|
1842
|
+
return;
|
|
1843
|
+
}
|
|
1844
|
+
const owner = target.kind === "reshape" ? context.ui.getState().activeZone?.organization_id : tileOrganizationId(hit.properties.organization_id);
|
|
1845
|
+
const scopeRefused = target.kind !== "view" && writeRefusal?.("zone", owner) != null;
|
|
1846
|
+
if (scopeRefused && target.kind === "reshape") {
|
|
1847
|
+
return;
|
|
1848
|
+
}
|
|
1849
|
+
if (target.kind === "reshape") {
|
|
1850
|
+
void bus.dispatch(context, "studio.zone.editBegin", target.input);
|
|
1851
|
+
return;
|
|
1852
|
+
}
|
|
1853
|
+
void bus.dispatch(
|
|
1854
|
+
context,
|
|
1855
|
+
target.kind === "edit" && !scopeRefused ? "studio.zone.openForEdit" : "studio.zone.openForView",
|
|
1856
|
+
{ zoneId: target.zoneId }
|
|
1857
|
+
);
|
|
1858
|
+
},
|
|
1859
|
+
options2
|
|
1860
|
+
);
|
|
1861
|
+
const detachZoneHover = client.onFeatureHover(
|
|
1862
|
+
zoneLayerIds,
|
|
1863
|
+
{
|
|
1864
|
+
onEnter: () => {
|
|
1865
|
+
},
|
|
1866
|
+
onLeave: () => {
|
|
1867
|
+
}
|
|
1868
|
+
},
|
|
1869
|
+
options2
|
|
1870
|
+
);
|
|
1871
|
+
return () => {
|
|
1872
|
+
detachZoneClick();
|
|
1873
|
+
detachZoneHover();
|
|
1874
|
+
};
|
|
1875
|
+
}, [
|
|
1876
|
+
client,
|
|
1877
|
+
bus,
|
|
1878
|
+
context,
|
|
1879
|
+
currentUserId,
|
|
1880
|
+
itineraryLayerIds,
|
|
1881
|
+
openId,
|
|
1882
|
+
scope,
|
|
1883
|
+
writableOrgIds,
|
|
1884
|
+
writeRefusal,
|
|
1885
|
+
zoneLayerIds
|
|
1886
|
+
]);
|
|
1887
|
+
};
|
|
1888
|
+
var holds = /* @__PURE__ */ new WeakMap();
|
|
1889
|
+
var useHeldTileSources = (client, sources) => {
|
|
1890
|
+
react.useEffect(() => {
|
|
1891
|
+
if (client === null || sources === void 0 || sources.length === 0) {
|
|
1892
|
+
return;
|
|
1893
|
+
}
|
|
1894
|
+
const held = holds.get(client) ?? /* @__PURE__ */ new Map();
|
|
1895
|
+
holds.set(client, held);
|
|
1896
|
+
for (const { id } of sources) {
|
|
1897
|
+
held.set(id, (held.get(id) ?? 0) + 1);
|
|
1898
|
+
}
|
|
1899
|
+
client.addTileSources([...sources]);
|
|
1900
|
+
return () => {
|
|
1901
|
+
const released = [];
|
|
1902
|
+
for (const { id } of sources) {
|
|
1903
|
+
const remaining = (held.get(id) ?? 1) - 1;
|
|
1904
|
+
if (remaining > 0) {
|
|
1905
|
+
held.set(id, remaining);
|
|
1906
|
+
} else if (held.delete(id)) {
|
|
1907
|
+
released.push(id);
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
if (released.length > 0) {
|
|
1911
|
+
client.removeTileSources(released);
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
}, [client, sources]);
|
|
1915
|
+
};
|
|
1916
|
+
|
|
1917
|
+
// src/map/hooks/useTileLayers.ts
|
|
1918
|
+
var useTileLayers = (client) => {
|
|
1919
|
+
const { manifest: layers } = elementsReact.useMountayaLayersManifest();
|
|
1920
|
+
const sources = react.useMemo(
|
|
1921
|
+
() => layers === null ? void 0 : [...layers.itineraries?.sources ?? [], ...layers.zones?.sources ?? []],
|
|
1922
|
+
[layers]
|
|
1923
|
+
);
|
|
1924
|
+
useHeldTileSources(client, sources);
|
|
1925
|
+
};
|
|
1926
|
+
|
|
1927
|
+
// src/map/hooks/useStudioMapBindings.ts
|
|
1928
|
+
var useStudioMapBindings = (client, options = {}) => {
|
|
1929
|
+
const { collabEngine = null, constraints, demTilesUrl, url, zoneCollabEngine = null } = options;
|
|
1930
|
+
const ctx = chunkQZ7W2E4U_cjs.useStudioToolContext();
|
|
1931
|
+
const hostDemUrl = chunkQZ7W2E4U_cjs.useStudioDemUrl();
|
|
1932
|
+
useStudioMapSync(client, demTilesUrl ?? hostDemUrl);
|
|
1933
|
+
const markerIcons = elementsReact.useMountayaMarkerIcons();
|
|
1934
|
+
const previewGlyphs = react.useMemo(
|
|
1935
|
+
() => ({
|
|
1936
|
+
activityMarkerIcon: (activity) => icons.activityMarkerIcon(markerIcons, activity),
|
|
1937
|
+
WAYPOINT_FALLBACK_ICON: chunk3TQV2M4C_cjs.WAYPOINT_FALLBACK_ICON
|
|
1938
|
+
}),
|
|
1939
|
+
[markerIcons]
|
|
1940
|
+
);
|
|
1941
|
+
useStudioPreviewSync(client, previewGlyphs);
|
|
1942
|
+
const resolvePeerName = chunkQZ7W2E4U_cjs.useStudioPeerName(chunkST7BNVC2_cjs.useCollabOrganizationId());
|
|
1943
|
+
editor.useMapLanguage(client, chunkZAKVHYDL_cjs.useStudioPreferences()?.language);
|
|
1944
|
+
useStudioContextMenu(client);
|
|
1945
|
+
useStudioConstraints(client, constraints);
|
|
1946
|
+
useStudioLayersScope();
|
|
1947
|
+
useTileLayers(client);
|
|
1948
|
+
useStudioOverlay(client);
|
|
1949
|
+
useStudioOverlayWithdrawal();
|
|
1950
|
+
const activityCategories = chunkQZ7W2E4U_cjs.useStudioActivities();
|
|
1951
|
+
const activityId = chunkCWQ4WHPI_cjs.useUiStore((state) => state.activeItinerary?.activity_id);
|
|
1952
|
+
const activitySlug = activityId === void 0 ? void 0 : studio.activityForId(activityCategories ?? [], activityId)?.slug ?? void 0;
|
|
1953
|
+
useStudioItinerarySelection(client, { activitySlug });
|
|
1954
|
+
useStudioZoneSelection(client);
|
|
1955
|
+
useStudioSegmentEditing(client, collabEngine);
|
|
1956
|
+
useStudioSegmentViaPrompt(client);
|
|
1957
|
+
useStudioWaypointEditing(client);
|
|
1958
|
+
useStudioZoneEditing(client, zoneCollabEngine);
|
|
1959
|
+
useStudioPeerDrafts(client, resolvePeerName);
|
|
1960
|
+
useStudioSplitPicking(client);
|
|
1961
|
+
useStudioSuggestionPicking(client);
|
|
1962
|
+
useStudioZoneOriginPicking(client);
|
|
1963
|
+
useStudioEnrichment(client);
|
|
1964
|
+
useStudioPoiLayers(client);
|
|
1965
|
+
useStudioTimestamp(client);
|
|
1966
|
+
useStudioUrlState(url ?? ctx.url ?? studio.inertStudioUrlSeam);
|
|
1967
|
+
};
|
|
1968
|
+
|
|
1969
|
+
Object.defineProperty(exports, "LIVE_SEGMENT_THROTTLE_MS", {
|
|
1970
|
+
enumerable: true,
|
|
1971
|
+
get: function () { return collab.LIVE_SEGMENT_THROTTLE_MS; }
|
|
1972
|
+
});
|
|
1973
|
+
exports.ACTIVITY_BADGE_BACKGROUND = ACTIVITY_BADGE_BACKGROUND;
|
|
1974
|
+
exports.ACTIVITY_GLYPH_COLOR = ACTIVITY_GLYPH_COLOR;
|
|
1975
|
+
exports.EDITOR_ROOT_ATTRIBUTE = EDITOR_ROOT_ATTRIBUTE;
|
|
1976
|
+
exports.StudioEditorRootProvider = StudioEditorRootProvider;
|
|
1977
|
+
exports.activityBadgeOf = activityBadgeOf;
|
|
1978
|
+
exports.keyTakenNearer = keyTakenNearer;
|
|
1979
|
+
exports.useHeldTileSources = useHeldTileSources;
|
|
1980
|
+
exports.useStudioConstraints = useStudioConstraints;
|
|
1981
|
+
exports.useStudioContextMenu = useStudioContextMenu;
|
|
1982
|
+
exports.useStudioEditorRoot = useStudioEditorRoot;
|
|
1983
|
+
exports.useStudioEnrichment = useStudioEnrichment;
|
|
1984
|
+
exports.useStudioItinerarySelection = useStudioItinerarySelection;
|
|
1985
|
+
exports.useStudioLayersScope = useStudioLayersScope;
|
|
1986
|
+
exports.useStudioMapBindings = useStudioMapBindings;
|
|
1987
|
+
exports.useStudioMapSync = useStudioMapSync;
|
|
1988
|
+
exports.useStudioOverlay = useStudioOverlay;
|
|
1989
|
+
exports.useStudioOverlayWithdrawal = useStudioOverlayWithdrawal;
|
|
1990
|
+
exports.useStudioPeerDrafts = useStudioPeerDrafts;
|
|
1991
|
+
exports.useStudioPoiLayers = useStudioPoiLayers;
|
|
1992
|
+
exports.useStudioPreviewSync = useStudioPreviewSync;
|
|
1993
|
+
exports.useStudioSegmentEditing = useStudioSegmentEditing;
|
|
1994
|
+
exports.useStudioSegmentViaPrompt = useStudioSegmentViaPrompt;
|
|
1995
|
+
exports.useStudioSplitPicking = useStudioSplitPicking;
|
|
1996
|
+
exports.useStudioSuggestionPicking = useStudioSuggestionPicking;
|
|
1997
|
+
exports.useStudioTimestamp = useStudioTimestamp;
|
|
1998
|
+
exports.useStudioUrlState = useStudioUrlState;
|
|
1999
|
+
exports.useStudioWaypointEditing = useStudioWaypointEditing;
|
|
2000
|
+
exports.useStudioZoneEditing = useStudioZoneEditing;
|
|
2001
|
+
exports.useStudioZoneOriginPicking = useStudioZoneOriginPicking;
|
|
2002
|
+
exports.useStudioZoneSelection = useStudioZoneSelection;
|
|
2003
|
+
exports.watchNearerEscape = watchNearerEscape;
|
|
2004
|
+
//# sourceMappingURL=chunk-JUD3CWTI.cjs.map
|
|
2005
|
+
//# sourceMappingURL=chunk-JUD3CWTI.cjs.map
|