@mountaya/studio-react 0.0.0-stage → 0.2.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 +98 -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/chunk--VSQcEs_.cjs +26 -0
- package/dist/chunk--VSQcEs_.cjs.map +1 -0
- package/dist/chunk-0qoALFfx.cjs +454 -0
- package/dist/chunk-0qoALFfx.cjs.map +1 -0
- package/dist/chunk-0sHgX8We.cjs +97 -0
- package/dist/chunk-0sHgX8We.cjs.map +1 -0
- package/dist/chunk-4D4as_tP.js +16 -0
- package/dist/chunk-4D4as_tP.js.map +1 -0
- package/dist/chunk-6LM6wuIg.cjs +13 -0
- package/dist/chunk-6LM6wuIg.cjs.map +1 -0
- package/dist/chunk-6VpwF-77.js +7 -0
- package/dist/chunk-6VpwF-77.js.map +1 -0
- package/dist/chunk-6v2fJIDh.cjs +28 -0
- package/dist/chunk-6v2fJIDh.cjs.map +1 -0
- package/dist/chunk-Af0f-OjN.js +71 -0
- package/dist/chunk-Af0f-OjN.js.map +1 -0
- package/dist/chunk-B-QQkaWk.js +91 -0
- package/dist/chunk-B-QQkaWk.js.map +1 -0
- package/dist/chunk-B1lX5w6I.cjs +181 -0
- package/dist/chunk-B1lX5w6I.cjs.map +1 -0
- package/dist/chunk-B2gsz9OJ.js +19 -0
- package/dist/chunk-B2gsz9OJ.js.map +1 -0
- package/dist/chunk-B38srE2R.d.cts +3976 -0
- package/dist/chunk-B3HdxIq7.js +69 -0
- package/dist/chunk-B3HdxIq7.js.map +1 -0
- package/dist/chunk-B3UCX3Wd.js +30 -0
- package/dist/chunk-B3UCX3Wd.js.map +1 -0
- package/dist/chunk-B3mMYMtz.cjs +88 -0
- package/dist/chunk-B3mMYMtz.cjs.map +1 -0
- package/dist/chunk-B7D0neNQ.cjs +47 -0
- package/dist/chunk-B7D0neNQ.cjs.map +1 -0
- package/dist/chunk-B7UzNwmm.cjs +115 -0
- package/dist/chunk-B7UzNwmm.cjs.map +1 -0
- package/dist/chunk-B7d3NIaH.js +55 -0
- package/dist/chunk-B7d3NIaH.js.map +1 -0
- package/dist/chunk-B8ONCPFQ.cjs +70 -0
- package/dist/chunk-B8ONCPFQ.cjs.map +1 -0
- package/dist/chunk-B8QgG-RT.js +2232 -0
- package/dist/chunk-B8QgG-RT.js.map +1 -0
- package/dist/chunk-B8ZpXH0_.cjs +64 -0
- package/dist/chunk-B8ZpXH0_.cjs.map +1 -0
- package/dist/chunk-B8mS5bGc.cjs +112 -0
- package/dist/chunk-B8mS5bGc.cjs.map +1 -0
- package/dist/chunk-B9EkHHSU.js +40 -0
- package/dist/chunk-B9EkHHSU.js.map +1 -0
- package/dist/chunk-BA0PWNyn.js +234 -0
- package/dist/chunk-BA0PWNyn.js.map +1 -0
- package/dist/chunk-BAWE1gqe.js +60 -0
- package/dist/chunk-BAWE1gqe.js.map +1 -0
- package/dist/chunk-BAe9m2Yp.d.cts +963 -0
- package/dist/chunk-BDJCk6ml.js +19 -0
- package/dist/chunk-BDJCk6ml.js.map +1 -0
- package/dist/chunk-BFI2CR6j.cjs +381 -0
- package/dist/chunk-BFI2CR6j.cjs.map +1 -0
- package/dist/chunk-BIIJXiiS.js +40 -0
- package/dist/chunk-BIIJXiiS.js.map +1 -0
- package/dist/chunk-BJAn10wR.js +54 -0
- package/dist/chunk-BJAn10wR.js.map +1 -0
- package/dist/chunk-BLxPxx5p.js +1641 -0
- package/dist/chunk-BLxPxx5p.js.map +1 -0
- package/dist/chunk-BNSJoNwO.cjs +377 -0
- package/dist/chunk-BNSJoNwO.cjs.map +1 -0
- package/dist/chunk-BNTshA5u.js +304 -0
- package/dist/chunk-BNTshA5u.js.map +1 -0
- package/dist/chunk-BO_yHMn2.js +7 -0
- package/dist/chunk-BO_yHMn2.js.map +1 -0
- package/dist/chunk-BOpIVklq.cjs +23 -0
- package/dist/chunk-BOpIVklq.cjs.map +1 -0
- package/dist/chunk-BP8bHGiE.cjs +12 -0
- package/dist/chunk-BP8bHGiE.cjs.map +1 -0
- package/dist/chunk-BPsgx3c7.js +56 -0
- package/dist/chunk-BPsgx3c7.js.map +1 -0
- package/dist/chunk-BQkKY_kf.js +44 -0
- package/dist/chunk-BQkKY_kf.js.map +1 -0
- package/dist/chunk-BQoAEKyJ.js +193 -0
- package/dist/chunk-BQoAEKyJ.js.map +1 -0
- package/dist/chunk-BRuLc45I.cjs +21 -0
- package/dist/chunk-BRuLc45I.cjs.map +1 -0
- package/dist/chunk-BSnrqsA8.cjs +56 -0
- package/dist/chunk-BSnrqsA8.cjs.map +1 -0
- package/dist/chunk-BTDBomKm.cjs +80 -0
- package/dist/chunk-BTDBomKm.cjs.map +1 -0
- package/dist/chunk-BVogYy0R.js +375 -0
- package/dist/chunk-BVogYy0R.js.map +1 -0
- package/dist/chunk-BWITLmlf.js +6 -0
- package/dist/chunk-BWITLmlf.js.map +1 -0
- package/dist/chunk-BXUrvYqd.d.cts +112 -0
- package/dist/chunk-BXUrvYqd.d.ts +112 -0
- package/dist/chunk-BYzQfFFV.js +54 -0
- package/dist/chunk-BYzQfFFV.js.map +1 -0
- package/dist/chunk-BZCKMlN8.js +35 -0
- package/dist/chunk-BZCKMlN8.js.map +1 -0
- package/dist/chunk-BalPERFX.js +13 -0
- package/dist/chunk-BalPERFX.js.map +1 -0
- package/dist/chunk-Bb5SAw6T.cjs +72 -0
- package/dist/chunk-Bb5SAw6T.cjs.map +1 -0
- package/dist/chunk-BbQyoetL.cjs +269 -0
- package/dist/chunk-BbQyoetL.cjs.map +1 -0
- package/dist/chunk-BdepwGey.js +600 -0
- package/dist/chunk-BdepwGey.js.map +1 -0
- package/dist/chunk-BeB57TnZ.js +29 -0
- package/dist/chunk-BeB57TnZ.js.map +1 -0
- package/dist/chunk-BecxET4U.cjs +26 -0
- package/dist/chunk-BecxET4U.cjs.map +1 -0
- package/dist/chunk-Bfuu_B7M.js +16 -0
- package/dist/chunk-Bfuu_B7M.js.map +1 -0
- package/dist/chunk-Bh4xSiDO.js +93 -0
- package/dist/chunk-Bh4xSiDO.js.map +1 -0
- package/dist/chunk-BhLItb06.js +10 -0
- package/dist/chunk-BhLItb06.js.map +1 -0
- package/dist/chunk-BhelUZ4P.js +30 -0
- package/dist/chunk-BhelUZ4P.js.map +1 -0
- package/dist/chunk-BiMRpOwB.cjs +342 -0
- package/dist/chunk-BiMRpOwB.cjs.map +1 -0
- package/dist/chunk-Bj3ium6N.cjs +22 -0
- package/dist/chunk-Bj3ium6N.cjs.map +1 -0
- package/dist/chunk-BjQzK3c3.cjs +59 -0
- package/dist/chunk-BjQzK3c3.cjs.map +1 -0
- package/dist/chunk-BkvNTXo7.cjs +15 -0
- package/dist/chunk-BkvNTXo7.cjs.map +1 -0
- package/dist/chunk-BmJDHIlZ.cjs +50 -0
- package/dist/chunk-BmJDHIlZ.cjs.map +1 -0
- package/dist/chunk-BmztanwN.cjs +13 -0
- package/dist/chunk-BmztanwN.cjs.map +1 -0
- package/dist/chunk-Bnci-ej8.cjs +262 -0
- package/dist/chunk-Bnci-ej8.cjs.map +1 -0
- package/dist/chunk-BoOw05B0.js +24 -0
- package/dist/chunk-BoOw05B0.js.map +1 -0
- package/dist/chunk-BqPxk-8w.cjs +95 -0
- package/dist/chunk-BqPxk-8w.cjs.map +1 -0
- package/dist/chunk-Br_1h4WD.cjs +15 -0
- package/dist/chunk-Br_1h4WD.cjs.map +1 -0
- package/dist/chunk-BtmcBZXU.js +13 -0
- package/dist/chunk-BtmcBZXU.js.map +1 -0
- package/dist/chunk-BvaNI_86.js +11 -0
- package/dist/chunk-BvaNI_86.js.map +1 -0
- package/dist/chunk-BvoYNlF5.js +145 -0
- package/dist/chunk-BvoYNlF5.js.map +1 -0
- package/dist/chunk-BwnCGe7J.js +268 -0
- package/dist/chunk-BwnCGe7J.js.map +1 -0
- package/dist/chunk-BxpaOkyq.cjs +310 -0
- package/dist/chunk-BxpaOkyq.cjs.map +1 -0
- package/dist/chunk-BybRyFen.cjs +65 -0
- package/dist/chunk-BybRyFen.cjs.map +1 -0
- package/dist/chunk-C-9wXKm5.cjs +83 -0
- package/dist/chunk-C-9wXKm5.cjs.map +1 -0
- package/dist/chunk-C-hV-Usi.js +7 -0
- package/dist/chunk-C-hV-Usi.js.map +1 -0
- package/dist/chunk-C06UWdDq.js +100 -0
- package/dist/chunk-C06UWdDq.js.map +1 -0
- package/dist/chunk-C1NzDn7y.cjs +35 -0
- package/dist/chunk-C1NzDn7y.cjs.map +1 -0
- package/dist/chunk-C2zEVNM1.js +20 -0
- package/dist/chunk-C2zEVNM1.js.map +1 -0
- package/dist/chunk-C3ftwoOp.js +6 -0
- package/dist/chunk-C3ftwoOp.js.map +1 -0
- package/dist/chunk-C5ZETobm.js +17 -0
- package/dist/chunk-C5ZETobm.js.map +1 -0
- package/dist/chunk-C5oCIViv.js +98 -0
- package/dist/chunk-C5oCIViv.js.map +1 -0
- package/dist/chunk-C60kC4oZ.cjs +114 -0
- package/dist/chunk-C60kC4oZ.cjs.map +1 -0
- package/dist/chunk-C6Mr3Z8L.js +59 -0
- package/dist/chunk-C6Mr3Z8L.js.map +1 -0
- package/dist/chunk-C6cBmVch.js +119 -0
- package/dist/chunk-C6cBmVch.js.map +1 -0
- package/dist/chunk-C6vKd7KP.cjs +519 -0
- package/dist/chunk-C6vKd7KP.cjs.map +1 -0
- package/dist/chunk-C7NizUxN.js +21 -0
- package/dist/chunk-C7NizUxN.js.map +1 -0
- package/dist/chunk-C93yeTAD.js +91 -0
- package/dist/chunk-C93yeTAD.js.map +1 -0
- package/dist/chunk-CByZU6Hx.cjs +90 -0
- package/dist/chunk-CByZU6Hx.cjs.map +1 -0
- package/dist/chunk-CCNIPIJB.cjs +25 -0
- package/dist/chunk-CCNIPIJB.cjs.map +1 -0
- package/dist/chunk-CEDKBew2.js +15 -0
- package/dist/chunk-CEDKBew2.js.map +1 -0
- package/dist/chunk-CI2PEZIK.js +147 -0
- package/dist/chunk-CI2PEZIK.js.map +1 -0
- package/dist/chunk-CIjPAYuo.cjs +268 -0
- package/dist/chunk-CIjPAYuo.cjs.map +1 -0
- package/dist/chunk-CJyqD6Ib.js +518 -0
- package/dist/chunk-CJyqD6Ib.js.map +1 -0
- package/dist/chunk-CNFF8fiL.js +38 -0
- package/dist/chunk-CNFF8fiL.js.map +1 -0
- package/dist/chunk-CNFoFzhK.cjs +50 -0
- package/dist/chunk-CNFoFzhK.cjs.map +1 -0
- package/dist/chunk-CQAuAPOE.cjs +63 -0
- package/dist/chunk-CQAuAPOE.cjs.map +1 -0
- package/dist/chunk-CR46E73M.js +50 -0
- package/dist/chunk-CR46E73M.js.map +1 -0
- package/dist/chunk-CSq4CbT1.js +86 -0
- package/dist/chunk-CSq4CbT1.js.map +1 -0
- package/dist/chunk-CT6i9_8G.cjs +31 -0
- package/dist/chunk-CT6i9_8G.cjs.map +1 -0
- package/dist/chunk-CUKEOil1.cjs +108 -0
- package/dist/chunk-CUKEOil1.cjs.map +1 -0
- package/dist/chunk-CWxPV2vI.js +111 -0
- package/dist/chunk-CWxPV2vI.js.map +1 -0
- package/dist/chunk-CXap-mFu.js +50 -0
- package/dist/chunk-CXap-mFu.js.map +1 -0
- package/dist/chunk-CYx1vTOG.d.ts +69 -0
- package/dist/chunk-CZOXtOQp.js +261 -0
- package/dist/chunk-CZOXtOQp.js.map +1 -0
- package/dist/chunk-CZSBVyE9.js +68 -0
- package/dist/chunk-CZSBVyE9.js.map +1 -0
- package/dist/chunk-C_NZdnA3.cjs +57 -0
- package/dist/chunk-C_NZdnA3.cjs.map +1 -0
- package/dist/chunk-C_k4SxhD.js +245 -0
- package/dist/chunk-C_k4SxhD.js.map +1 -0
- package/dist/chunk-CaTeIppS.cjs +115 -0
- package/dist/chunk-CaTeIppS.cjs.map +1 -0
- package/dist/chunk-CaUCI-WV.cjs +69 -0
- package/dist/chunk-CaUCI-WV.cjs.map +1 -0
- package/dist/chunk-CblkEI9o.js +19 -0
- package/dist/chunk-CblkEI9o.js.map +1 -0
- package/dist/chunk-CcXeCiEQ.js +70 -0
- package/dist/chunk-CcXeCiEQ.js.map +1 -0
- package/dist/chunk-Ce4D2B8W.cjs +49 -0
- package/dist/chunk-Ce4D2B8W.cjs.map +1 -0
- package/dist/chunk-CetxbYL1.js +66 -0
- package/dist/chunk-CetxbYL1.js.map +1 -0
- package/dist/chunk-ClfU9elo.js +68 -0
- package/dist/chunk-ClfU9elo.js.map +1 -0
- package/dist/chunk-CmNHE_Un.cjs +4 -0
- package/dist/chunk-Cmb_XLfd.js +82 -0
- package/dist/chunk-Cmb_XLfd.js.map +1 -0
- package/dist/chunk-Cp26IdF1.js +72 -0
- package/dist/chunk-Cp26IdF1.js.map +1 -0
- package/dist/chunk-CsBkSCbR.cjs +92 -0
- package/dist/chunk-CsBkSCbR.cjs.map +1 -0
- package/dist/chunk-CsnIpELM.js +31 -0
- package/dist/chunk-CsnIpELM.js.map +1 -0
- package/dist/chunk-CsnJv55G.cjs +36 -0
- package/dist/chunk-CsnJv55G.cjs.map +1 -0
- package/dist/chunk-CsxHDVHF.cjs +68 -0
- package/dist/chunk-CsxHDVHF.cjs.map +1 -0
- package/dist/chunk-Cv1FyWmK.js +670 -0
- package/dist/chunk-Cv1FyWmK.js.map +1 -0
- package/dist/chunk-CwXRQ-3X.cjs +2238 -0
- package/dist/chunk-CwXRQ-3X.cjs.map +1 -0
- package/dist/chunk-CxC9GaSV.js +6 -0
- package/dist/chunk-CxC9GaSV.js.map +1 -0
- package/dist/chunk-CyDQK1JF.js +22 -0
- package/dist/chunk-CyDQK1JF.js.map +1 -0
- package/dist/chunk-CyFo-C-X.js +341 -0
- package/dist/chunk-CyFo-C-X.js.map +1 -0
- package/dist/chunk-CzGWcm8C.cjs +109 -0
- package/dist/chunk-CzGWcm8C.cjs.map +1 -0
- package/dist/chunk-D0Cmheqq.cjs +25 -0
- package/dist/chunk-D0Cmheqq.cjs.map +1 -0
- package/dist/chunk-D0VevtWq.cjs +13 -0
- package/dist/chunk-D0VevtWq.cjs.map +1 -0
- package/dist/chunk-D1HIZ09h.d.cts +22 -0
- package/dist/chunk-D1HIZ09h.d.ts +22 -0
- package/dist/chunk-D1PwxEEq.cjs +281 -0
- package/dist/chunk-D1PwxEEq.cjs.map +1 -0
- package/dist/chunk-D2BipKyx.d.cts +69 -0
- package/dist/chunk-D4g36nrI.d.ts +963 -0
- package/dist/chunk-D5vZKs5k.js +85 -0
- package/dist/chunk-D5vZKs5k.js.map +1 -0
- package/dist/chunk-D7XBi__G.js +17 -0
- package/dist/chunk-D7XBi__G.js.map +1 -0
- package/dist/chunk-D8TsKfym.cjs +35 -0
- package/dist/chunk-D8TsKfym.cjs.map +1 -0
- package/dist/chunk-D8r50zRF.cjs +4 -0
- package/dist/chunk-DAAlHzRS.js +2 -0
- package/dist/chunk-DBY6OSNP.js +13 -0
- package/dist/chunk-DBY6OSNP.js.map +1 -0
- package/dist/chunk-DBfZJAh3.js +146 -0
- package/dist/chunk-DBfZJAh3.js.map +1 -0
- package/dist/chunk-DBpF1Eur.cjs +69 -0
- package/dist/chunk-DBpF1Eur.cjs.map +1 -0
- package/dist/chunk-DCvhBL80.js +9 -0
- package/dist/chunk-DCvhBL80.js.map +1 -0
- package/dist/chunk-DDNoqMiU.cjs +12 -0
- package/dist/chunk-DDNoqMiU.cjs.map +1 -0
- package/dist/chunk-DEpLX45Z.cjs +25 -0
- package/dist/chunk-DEpLX45Z.cjs.map +1 -0
- package/dist/chunk-DFw3I0U0.cjs +19 -0
- package/dist/chunk-DFw3I0U0.cjs.map +1 -0
- package/dist/chunk-DJOkmY4u.cjs +36 -0
- package/dist/chunk-DJOkmY4u.cjs.map +1 -0
- package/dist/chunk-DJQsem2x.js +1128 -0
- package/dist/chunk-DJQsem2x.js.map +1 -0
- package/dist/chunk-DKNcYR4L.cjs +71 -0
- package/dist/chunk-DKNcYR4L.cjs.map +1 -0
- package/dist/chunk-DL4Q5WpP.cjs +19 -0
- package/dist/chunk-DL4Q5WpP.cjs.map +1 -0
- package/dist/chunk-DLt13wEh.js +279 -0
- package/dist/chunk-DLt13wEh.js.map +1 -0
- package/dist/chunk-DPvFDS5n.cjs +31 -0
- package/dist/chunk-DPvFDS5n.cjs.map +1 -0
- package/dist/chunk-DQ4l6EDZ.js +1728 -0
- package/dist/chunk-DQ4l6EDZ.js.map +1 -0
- package/dist/chunk-DQ_X9yhT.cjs +21 -0
- package/dist/chunk-DQ_X9yhT.cjs.map +1 -0
- package/dist/chunk-DQbbL87b.cjs +57 -0
- package/dist/chunk-DQbbL87b.cjs.map +1 -0
- package/dist/chunk-DRphChLx.js +15 -0
- package/dist/chunk-DRphChLx.js.map +1 -0
- package/dist/chunk-DSsTHBp4.js +62 -0
- package/dist/chunk-DSsTHBp4.js.map +1 -0
- package/dist/chunk-DVI59otQ.js +20 -0
- package/dist/chunk-DVI59otQ.js.map +1 -0
- package/dist/chunk-DVN4tYVL.cjs +235 -0
- package/dist/chunk-DVN4tYVL.cjs.map +1 -0
- package/dist/chunk-DWxCDSxn.cjs +36 -0
- package/dist/chunk-DWxCDSxn.cjs.map +1 -0
- package/dist/chunk-DXMaeZs_.cjs +135 -0
- package/dist/chunk-DXMaeZs_.cjs.map +1 -0
- package/dist/chunk-D_dPThBm.js +44 -0
- package/dist/chunk-D_dPThBm.js.map +1 -0
- package/dist/chunk-DbW3lF5Y.cjs +55 -0
- package/dist/chunk-DbW3lF5Y.cjs.map +1 -0
- package/dist/chunk-Dc0Robe4.cjs +254 -0
- package/dist/chunk-Dc0Robe4.cjs.map +1 -0
- package/dist/chunk-DcLLI7B1.cjs +16 -0
- package/dist/chunk-DcLLI7B1.cjs.map +1 -0
- package/dist/chunk-Dd9K8OSs.js +73 -0
- package/dist/chunk-Dd9K8OSs.js.map +1 -0
- package/dist/chunk-DeFJnC-Q.js +52 -0
- package/dist/chunk-DeFJnC-Q.js.map +1 -0
- package/dist/chunk-DeggaLXL.cjs +109 -0
- package/dist/chunk-DeggaLXL.cjs.map +1 -0
- package/dist/chunk-DetGuqR8.cjs +12 -0
- package/dist/chunk-DetGuqR8.cjs.map +1 -0
- package/dist/chunk-Df761BAX.cjs +4 -0
- package/dist/chunk-DfQZch7H.cjs +60 -0
- package/dist/chunk-DfQZch7H.cjs.map +1 -0
- package/dist/chunk-DhwoAmi8.cjs +77 -0
- package/dist/chunk-DhwoAmi8.cjs.map +1 -0
- package/dist/chunk-DkH1DKxi.cjs +66 -0
- package/dist/chunk-DkH1DKxi.cjs.map +1 -0
- package/dist/chunk-DkjkI8F5.cjs +150 -0
- package/dist/chunk-DkjkI8F5.cjs.map +1 -0
- package/dist/chunk-DlaVYkP2.cjs +23 -0
- package/dist/chunk-DlaVYkP2.cjs.map +1 -0
- package/dist/chunk-DlcsA1GQ.js +6 -0
- package/dist/chunk-DlcsA1GQ.js.map +1 -0
- package/dist/chunk-DmBkJhi_.js +8 -0
- package/dist/chunk-DmBkJhi_.js.map +1 -0
- package/dist/chunk-DnXjnOQ1.cjs +42 -0
- package/dist/chunk-DnXjnOQ1.cjs.map +1 -0
- package/dist/chunk-DrG9yz7c.js +509 -0
- package/dist/chunk-DrG9yz7c.js.map +1 -0
- package/dist/chunk-DsTU_5Be.js +96 -0
- package/dist/chunk-DsTU_5Be.js.map +1 -0
- package/dist/chunk-DsXj9iLu.cjs +1827 -0
- package/dist/chunk-DsXj9iLu.cjs.map +1 -0
- package/dist/chunk-DteUy52S.js +45 -0
- package/dist/chunk-DteUy52S.js.map +1 -0
- package/dist/chunk-DtvsE56k.cjs +12 -0
- package/dist/chunk-DtvsE56k.cjs.map +1 -0
- package/dist/chunk-DuD5YqoE.cjs +99 -0
- package/dist/chunk-DuD5YqoE.cjs.map +1 -0
- package/dist/chunk-DvrtQ0Y0.js +51 -0
- package/dist/chunk-DvrtQ0Y0.js.map +1 -0
- package/dist/chunk-DwUFwDV2.js +144 -0
- package/dist/chunk-DwUFwDV2.js.map +1 -0
- package/dist/chunk-Dy59Tdfm.cjs +67 -0
- package/dist/chunk-Dy59Tdfm.cjs.map +1 -0
- package/dist/chunk-DyJupG9U.cjs +74 -0
- package/dist/chunk-DyJupG9U.cjs.map +1 -0
- package/dist/chunk-DzCbinPo.js +9 -0
- package/dist/chunk-DzCbinPo.js.map +1 -0
- package/dist/chunk-GgcOmaXu.cjs +137 -0
- package/dist/chunk-GgcOmaXu.cjs.map +1 -0
- package/dist/chunk-GnVcZTQv.cjs +50 -0
- package/dist/chunk-GnVcZTQv.cjs.map +1 -0
- package/dist/chunk-JDLVWYk5.cjs +22 -0
- package/dist/chunk-JDLVWYk5.cjs.map +1 -0
- package/dist/chunk-NA04sFmY.js +2 -0
- package/dist/chunk-NqIZvB2L.js +44 -0
- package/dist/chunk-NqIZvB2L.js.map +1 -0
- package/dist/chunk-OGNas_Mn.cjs +654 -0
- package/dist/chunk-OGNas_Mn.cjs.map +1 -0
- package/dist/chunk-PeexRooj.cjs +12 -0
- package/dist/chunk-PeexRooj.cjs.map +1 -0
- package/dist/chunk-QUjeQKsz.js +26 -0
- package/dist/chunk-QUjeQKsz.js.map +1 -0
- package/dist/chunk-S0jc_E9W.cjs +62 -0
- package/dist/chunk-S0jc_E9W.cjs.map +1 -0
- package/dist/chunk-TLRG-UaM.js +453 -0
- package/dist/chunk-TLRG-UaM.js.map +1 -0
- package/dist/chunk-TYmd7TzW.cjs +68 -0
- package/dist/chunk-TYmd7TzW.cjs.map +1 -0
- package/dist/chunk-TlHnQSY_.js +250 -0
- package/dist/chunk-TlHnQSY_.js.map +1 -0
- package/dist/chunk-Vba_029j.js +36 -0
- package/dist/chunk-Vba_029j.js.map +1 -0
- package/dist/chunk-Vp0uJb7O.cjs +92 -0
- package/dist/chunk-Vp0uJb7O.cjs.map +1 -0
- package/dist/chunk-WPGdcwtf.cjs +15 -0
- package/dist/chunk-WPGdcwtf.cjs.map +1 -0
- package/dist/chunk-WUipjqNN.cjs +158 -0
- package/dist/chunk-WUipjqNN.cjs.map +1 -0
- package/dist/chunk-Y-zyJ0-m.js +6 -0
- package/dist/chunk-Y-zyJ0-m.js.map +1 -0
- package/dist/chunk-ZIIlDASG.js +94 -0
- package/dist/chunk-ZIIlDASG.js.map +1 -0
- package/dist/chunk-ZLDg2I1Z.js +6 -0
- package/dist/chunk-ZLDg2I1Z.js.map +1 -0
- package/dist/chunk-_jSTl9gW.cjs +1129 -0
- package/dist/chunk-_jSTl9gW.cjs.map +1 -0
- package/dist/chunk-b5CqEoo1.cjs +599 -0
- package/dist/chunk-b5CqEoo1.cjs.map +1 -0
- package/dist/chunk-bA-2OGXv.d.ts +3977 -0
- package/dist/chunk-bvwC3n0z.cjs +12 -0
- package/dist/chunk-bvwC3n0z.cjs.map +1 -0
- package/dist/chunk-cMQzXXQq.js +67 -0
- package/dist/chunk-cMQzXXQq.js.map +1 -0
- package/dist/chunk-cTRnGhbF.cjs +177 -0
- package/dist/chunk-cTRnGhbF.cjs.map +1 -0
- package/dist/chunk-dHKPMJ4D.js +85 -0
- package/dist/chunk-dHKPMJ4D.js.map +1 -0
- package/dist/chunk-d_BOXcT5.js +9 -0
- package/dist/chunk-d_BOXcT5.js.map +1 -0
- package/dist/chunk-ea1IbBcA.js +66 -0
- package/dist/chunk-ea1IbBcA.js.map +1 -0
- package/dist/chunk-f-dHVrF3.js +293 -0
- package/dist/chunk-f-dHVrF3.js.map +1 -0
- package/dist/chunk-h7Z5mAV_.cjs +41 -0
- package/dist/chunk-h7Z5mAV_.cjs.map +1 -0
- package/dist/chunk-jSgMzVr1.js +35 -0
- package/dist/chunk-jSgMzVr1.js.map +1 -0
- package/dist/chunk-kYE5SZgs.cjs +252 -0
- package/dist/chunk-kYE5SZgs.cjs.map +1 -0
- package/dist/chunk-lEnNKG6x.cjs +285 -0
- package/dist/chunk-lEnNKG6x.cjs.map +1 -0
- package/dist/chunk-lcml1N1G.js +11 -0
- package/dist/chunk-lcml1N1G.js.map +1 -0
- package/dist/chunk-nBK0qBXt.js +68 -0
- package/dist/chunk-nBK0qBXt.js.map +1 -0
- package/dist/chunk-njoANlUr.cjs +41 -0
- package/dist/chunk-njoANlUr.cjs.map +1 -0
- package/dist/chunk-nwutfrnH.cjs +430 -0
- package/dist/chunk-nwutfrnH.cjs.map +1 -0
- package/dist/chunk-o1EKuTLo.js +56 -0
- package/dist/chunk-o1EKuTLo.js.map +1 -0
- package/dist/chunk-oMFOZSQM.cjs +52 -0
- package/dist/chunk-oMFOZSQM.cjs.map +1 -0
- package/dist/chunk-pb64dLGD.cjs +682 -0
- package/dist/chunk-pb64dLGD.cjs.map +1 -0
- package/dist/chunk-s7kBzSlt.js +2 -0
- package/dist/chunk-uhXxE8xV.cjs +32 -0
- package/dist/chunk-uhXxE8xV.cjs.map +1 -0
- package/dist/chunk-vGzpsUSM.cjs +110 -0
- package/dist/chunk-vGzpsUSM.cjs.map +1 -0
- package/dist/chunk-vN_Di8Af.cjs +1890 -0
- package/dist/chunk-vN_Di8Af.cjs.map +1 -0
- package/dist/chunk-veLShVmw.js +41 -0
- package/dist/chunk-veLShVmw.js.map +1 -0
- package/dist/chunk-wTf5jOFv.js +253 -0
- package/dist/chunk-wTf5jOFv.js.map +1 -0
- package/dist/chunk-yO-Ek9RH.cjs +17 -0
- package/dist/chunk-yO-Ek9RH.cjs.map +1 -0
- package/dist/chunk-ye5UUSFw.js +280 -0
- package/dist/chunk-ye5UUSFw.js.map +1 -0
- package/dist/copilot/index.cjs +10 -0
- package/dist/copilot/index.d.cts +62 -0
- package/dist/copilot/index.d.ts +62 -0
- package/dist/copilot/index.js +4 -0
- package/dist/embed/index.cjs +1653 -0
- package/dist/embed/index.cjs.map +1 -0
- package/dist/embed/index.d.cts +291 -0
- package/dist/embed/index.d.ts +291 -0
- package/dist/embed/index.js +1643 -0
- package/dist/embed/index.js.map +1 -0
- package/dist/headless/index.cjs +126 -0
- package/dist/headless/index.d.cts +4 -0
- package/dist/headless/index.d.ts +4 -0
- package/dist/headless/index.js +29 -0
- package/dist/import/index.cjs +403 -0
- package/dist/import/index.cjs.map +1 -0
- package/dist/import/index.d.cts +160 -0
- package/dist/import/index.d.ts +160 -0
- package/dist/import/index.js +393 -0
- package/dist/import/index.js.map +1 -0
- package/dist/index.cjs +8991 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4847 -0
- package/dist/index.d.ts +4847 -0
- package/dist/index.js +8768 -0
- package/dist/index.js.map +1 -0
- package/dist/map/index.cjs +36 -0
- package/dist/map/index.d.cts +2 -0
- package/dist/map/index.d.ts +2 -0
- package/dist/map/index.js +2 -0
- package/dist/styles.css +14684 -0
- package/dist/testing/index.cjs +398 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +302 -0
- package/dist/testing/index.d.ts +302 -0
- package/dist/testing/index.js +382 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/video/index.cjs +8 -0
- package/dist/video/index.d.cts +122 -0
- package/dist/video/index.d.ts +122 -0
- package/dist/video/index.js +2 -0
- package/package.json +226 -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 +549 -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 +85 -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 +42 -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 +370 -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 +180 -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 +229 -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 +127 -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 +1296 -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 +594 -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 +312 -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 +104 -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 +233 -0
- package/src/map/components/ContextMenuPopup.tsx +913 -0
- package/src/map/components/MapAnchoredPopup.tsx +285 -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 +271 -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 +110 -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 +176 -0
- package/src/rows/components/WaypointRowLayout.tsx +279 -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 +3994 -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 +827 -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,1643 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { _ as useStudioLanguages, g as useStudioLanguageMark, o as useStudioAppOrigin, p as useStudioFormatters, v as useStudioLayerThumbnail } from "../chunk-TlHnQSY_.js";
|
|
3
|
+
import { a as LanguageSelect, n as GroupLabelledBy, r as PickerCard, t as UnitPickerGrid } from "../chunk-CI2PEZIK.js";
|
|
4
|
+
import { n as useStudioScopedStrings, t as StudioStringsScope } from "../chunk-B7d3NIaH.js";
|
|
5
|
+
import { n as useEmbeddedStudio, r as useLayerCatalogOptions, t as AllowlistField } from "../chunk-BA0PWNyn.js";
|
|
6
|
+
import { a as iconSizes, s as Glyph$1 } from "../chunk-C7NizUxN.js";
|
|
7
|
+
import { n as FullscreenHeader, t as FullscreenModal } from "../chunk-Af0f-OjN.js";
|
|
8
|
+
import { t as WizardLayout } from "../chunk-BQkKY_kf.js";
|
|
9
|
+
import { t as useStudioDispatch } from "../chunk-nBK0qBXt.js";
|
|
10
|
+
import { r as useItinerarySubjectById } from "../chunk-veLShVmw.js";
|
|
11
|
+
import { t as useStudioItinerary } from "../chunk-BhLItb06.js";
|
|
12
|
+
import { t as DialogSubject } from "../chunk-C6Mr3Z8L.js";
|
|
13
|
+
import { n as usePublishableScope, t as UnpublishedPanel } from "../chunk-C06UWdDq.js";
|
|
14
|
+
import { t as SectionNav } from "../chunk-B-QQkaWk.js";
|
|
15
|
+
import { t as WarningAlert } from "../chunk-Bfuu_B7M.js";
|
|
16
|
+
import { n as SectionCard, t as RailSwitcher } from "../chunk-C5oCIViv.js";
|
|
17
|
+
import { t as SectionHead } from "../chunk-CyDQK1JF.js";
|
|
18
|
+
import { t as useEveryPage } from "../chunk-DRphChLx.js";
|
|
19
|
+
import { n as useStudioNotify } from "../chunk-BalPERFX.js";
|
|
20
|
+
import { t as useItineraryEditable } from "../chunk-BoOw05B0.js";
|
|
21
|
+
import { t as ConfirmModal } from "../chunk-CetxbYL1.js";
|
|
22
|
+
import { t as PrivacyControl } from "../chunk-BAWE1gqe.js";
|
|
23
|
+
import { t as EmptyState } from "../chunk-Cmb_XLfd.js";
|
|
24
|
+
import { t as PublicationNotice } from "../chunk-DsTU_5Be.js";
|
|
25
|
+
import { ActionIcon, Alert, Anchor, Box, Button, Center, CloseButton, ColorInput, CopyButton, Divider, Group, Image, Input, Loader, Radio, Select, SimpleGrid, Stack, Switch, Tabs, Text, Tooltip, VisuallyHidden } from "@mantine/core";
|
|
26
|
+
import { EMBED_CONFIG_FIELDS, EMBED_ELEMENTS, EMBED_IFRAME_RADIUS_PX, EMBED_SEGMENT_TABLE_COLUMNS, EMBED_TABLE_INSTALL_COMMAND, EMBED_WAYPOINT_TABLE_COLUMNS, REQUEST_CAMERA_MESSAGE, buildEmbedIframe, buildEmbedSearch, buildEmbedSessionScript, buildEmbedSrc, buildEmbedTableCode, buildEmbedViewHash, cameraMessageSchema, clampConfigToFieldDependencies, clampConfigToSafetyRules, defaultEmbedTableOptions, embedElementSectionFields, embedElementSections, embedFieldDependencies, embedLayerOptions, embedSectionChanges, embedTableChanges, embedTableColumns, enumFieldOptions, fieldDependenciesUnmet, isEmbedTableElement, isFieldRestricted, isLoopbackDomain, overlaysOffered, resolveOrgEmbedDefaults, terrainVariantOptions, toggleEmbedTableColumn, truncateKey } from "@mountaya/studio";
|
|
27
|
+
import { Suspense, lazy, memo, useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
28
|
+
import { failureAlertFor, lengthUnitOptions, paceUnitOptions, publicationStateOf, slopeUnitOptions, temperatureUnitOptions } from "@mountaya/studio/strings";
|
|
29
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
+
import { useLatestRef, useMountayaLanguage, useMountayaScopedStrings } from "@mountaya/elements-react";
|
|
31
|
+
import { useCollection, useCollections, useMountayaQuery } from "@mountaya/client-react";
|
|
32
|
+
import { formatLngLat } from "@mountaya/elements/geo";
|
|
33
|
+
import { useDebouncedValue, useId as useId$1 } from "@mantine/hooks";
|
|
34
|
+
const CARD_THUMB_PX = 52;
|
|
35
|
+
const EmbedBaseMapPicker = ({ description, label, locked, onChange, options, value }) => {
|
|
36
|
+
const layerThumbnail = useStudioLayerThumbnail();
|
|
37
|
+
const labelId = useId();
|
|
38
|
+
return /* @__PURE__ */ jsx(Input.Wrapper, {
|
|
39
|
+
description,
|
|
40
|
+
label,
|
|
41
|
+
labelProps: { id: labelId },
|
|
42
|
+
children: /* @__PURE__ */ jsx(Box, {
|
|
43
|
+
className: "mtya-field-control",
|
|
44
|
+
mod: { described: Boolean(description) },
|
|
45
|
+
children: /* @__PURE__ */ jsx(Radio.Group, {
|
|
46
|
+
inputContainer: (children) => /* @__PURE__ */ jsx(GroupLabelledBy, {
|
|
47
|
+
labelledBy: labelId,
|
|
48
|
+
children
|
|
49
|
+
}),
|
|
50
|
+
onChange: (slug) => {
|
|
51
|
+
if (slug) onChange(slug);
|
|
52
|
+
},
|
|
53
|
+
value,
|
|
54
|
+
children: /* @__PURE__ */ jsx(SimpleGrid, {
|
|
55
|
+
cols: 3,
|
|
56
|
+
spacing: "xs",
|
|
57
|
+
children: options.map((option) => {
|
|
58
|
+
const thumbnail = layerThumbnail("terrain", option.value);
|
|
59
|
+
return /* @__PURE__ */ jsx(PickerCard, {
|
|
60
|
+
imageMedia: thumbnail !== void 0,
|
|
61
|
+
kindSlug: "embed-terrain",
|
|
62
|
+
locked,
|
|
63
|
+
name: option.label,
|
|
64
|
+
value: option.value,
|
|
65
|
+
children: thumbnail === void 0 ? null : /* @__PURE__ */ jsx(Image, {
|
|
66
|
+
alt: option.label,
|
|
67
|
+
h: CARD_THUMB_PX,
|
|
68
|
+
src: thumbnail,
|
|
69
|
+
w: "100%"
|
|
70
|
+
})
|
|
71
|
+
}, option.value);
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
const GlyphPickerGrid = ({ "aria-labelledby": labelledBy, cols, kindSlug, locked, onChange, options, value }) => /* @__PURE__ */ jsx(Radio.Group, {
|
|
79
|
+
inputContainer: labelledBy === void 0 ? void 0 : (children) => /* @__PURE__ */ jsx(GroupLabelledBy, {
|
|
80
|
+
labelledBy,
|
|
81
|
+
children
|
|
82
|
+
}),
|
|
83
|
+
onChange,
|
|
84
|
+
value,
|
|
85
|
+
children: /* @__PURE__ */ jsx(SimpleGrid, {
|
|
86
|
+
cols,
|
|
87
|
+
spacing: "xs",
|
|
88
|
+
children: options.map(({ glyph, label, value: optionValue }) => /* @__PURE__ */ jsx(PickerCard, {
|
|
89
|
+
kindSlug,
|
|
90
|
+
locked,
|
|
91
|
+
name: label,
|
|
92
|
+
value: optionValue,
|
|
93
|
+
children: /* @__PURE__ */ jsx(Glyph$1, {
|
|
94
|
+
name: glyph,
|
|
95
|
+
size: iconSizes.md
|
|
96
|
+
})
|
|
97
|
+
}, optionValue))
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
const themeGlyph = {
|
|
101
|
+
dark: "theme-dark",
|
|
102
|
+
light: "theme-light"
|
|
103
|
+
};
|
|
104
|
+
const EmbedThemePicker = ({ description, label, locked, onChange, options, value }) => {
|
|
105
|
+
const cards = options.map((option) => ({
|
|
106
|
+
glyph: themeGlyph[option.value] ?? "theme-light",
|
|
107
|
+
label: option.label,
|
|
108
|
+
value: option.value
|
|
109
|
+
}));
|
|
110
|
+
const labelId = useId();
|
|
111
|
+
return /* @__PURE__ */ jsx(Input.Wrapper, {
|
|
112
|
+
description,
|
|
113
|
+
label,
|
|
114
|
+
labelProps: { id: labelId },
|
|
115
|
+
children: /* @__PURE__ */ jsx(Box, {
|
|
116
|
+
className: "mtya-field-control",
|
|
117
|
+
mod: { described: Boolean(description) },
|
|
118
|
+
children: /* @__PURE__ */ jsx(GlyphPickerGrid, {
|
|
119
|
+
"aria-labelledby": labelId,
|
|
120
|
+
cols: 2,
|
|
121
|
+
kindSlug: "embed-theme",
|
|
122
|
+
locked,
|
|
123
|
+
onChange,
|
|
124
|
+
options: cards,
|
|
125
|
+
value
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
const tintGlyph = {
|
|
131
|
+
dark: "theme-dark",
|
|
132
|
+
light: "theme-light"
|
|
133
|
+
};
|
|
134
|
+
const EmbedTintPicker = ({ description, label, locked, onChange, options, value }) => {
|
|
135
|
+
const cards = options.map((option) => ({
|
|
136
|
+
glyph: tintGlyph[option.value] ?? "theme-light",
|
|
137
|
+
label: option.label,
|
|
138
|
+
value: option.value
|
|
139
|
+
}));
|
|
140
|
+
const labelId = useId();
|
|
141
|
+
return /* @__PURE__ */ jsx(Input.Wrapper, {
|
|
142
|
+
description,
|
|
143
|
+
label,
|
|
144
|
+
labelProps: { id: labelId },
|
|
145
|
+
children: /* @__PURE__ */ jsx(Box, {
|
|
146
|
+
className: "mtya-field-control",
|
|
147
|
+
mod: { described: Boolean(description) },
|
|
148
|
+
children: /* @__PURE__ */ jsx(GlyphPickerGrid, {
|
|
149
|
+
"aria-labelledby": labelId,
|
|
150
|
+
cols: 2,
|
|
151
|
+
kindSlug: "embed-tint",
|
|
152
|
+
locked,
|
|
153
|
+
onChange,
|
|
154
|
+
options: cards,
|
|
155
|
+
value
|
|
156
|
+
})
|
|
157
|
+
})
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
const SECTIONS$11 = [
|
|
161
|
+
"controls",
|
|
162
|
+
"embed",
|
|
163
|
+
"preferences"
|
|
164
|
+
];
|
|
165
|
+
const dependencyParam = (key) => EMBED_CONFIG_FIELDS.find((candidate) => candidate.key === key)?.param ?? null;
|
|
166
|
+
const EmbedToggleSwitch = ({ checked, description, disabled, label, onChange, tooltip }) => {
|
|
167
|
+
const control = /* @__PURE__ */ jsx(Switch, {
|
|
168
|
+
checked,
|
|
169
|
+
description,
|
|
170
|
+
disabled,
|
|
171
|
+
label,
|
|
172
|
+
onChange: (event) => onChange(event.currentTarget.checked)
|
|
173
|
+
});
|
|
174
|
+
return tooltip ? /* @__PURE__ */ jsx(Tooltip, {
|
|
175
|
+
label: tooltip,
|
|
176
|
+
position: "top-start",
|
|
177
|
+
children: control
|
|
178
|
+
}) : control;
|
|
179
|
+
};
|
|
180
|
+
const unitPickerFields = {
|
|
181
|
+
preferredUnitLength: {
|
|
182
|
+
kindSlug: "embed-length",
|
|
183
|
+
options: lengthUnitOptions
|
|
184
|
+
},
|
|
185
|
+
preferredUnitPace: {
|
|
186
|
+
kindSlug: "embed-pace",
|
|
187
|
+
options: paceUnitOptions
|
|
188
|
+
},
|
|
189
|
+
preferredUnitSlope: {
|
|
190
|
+
kindSlug: "embed-slope",
|
|
191
|
+
options: slopeUnitOptions
|
|
192
|
+
},
|
|
193
|
+
preferredUnitTemperature: {
|
|
194
|
+
kindSlug: "embed-temperature",
|
|
195
|
+
options: temperatureUnitOptions
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
const isUnitPickerKey = (key) => key in unitPickerFields;
|
|
199
|
+
const flagOf = (config, key) => config[key] === true;
|
|
200
|
+
const textOf = (config, key) => {
|
|
201
|
+
const value = config[key];
|
|
202
|
+
return typeof value === "string" ? value : "";
|
|
203
|
+
};
|
|
204
|
+
const listOf = (config, key) => {
|
|
205
|
+
const value = config[key];
|
|
206
|
+
return Array.isArray(value) ? value : [];
|
|
207
|
+
};
|
|
208
|
+
const fieldDependencies = embedFieldDependencies;
|
|
209
|
+
const configKeysRead = (field) => {
|
|
210
|
+
if (field.kind === "boolean") return [field.key, ...fieldDependencies[field.key] ?? []];
|
|
211
|
+
if (field.kind === "enum") return isUnitPickerKey(field.key) ? [field.key, "preferredUnitLength"] : [field.key];
|
|
212
|
+
return [field.key];
|
|
213
|
+
};
|
|
214
|
+
const fieldCopy = (bank, param) => bank[param] ?? param;
|
|
215
|
+
const EmbedFieldControlBase = ({ config, field, layerOptions, onPatch, safetyRules }) => {
|
|
216
|
+
const languageMark = useStudioLanguageMark();
|
|
217
|
+
const languageOptions = useStudioLanguages();
|
|
218
|
+
const words = useStudioScopedStrings(SECTIONS$11);
|
|
219
|
+
const units = useStudioScopedStrings(SECTIONS$11).preferences.units;
|
|
220
|
+
const label = fieldCopy(words.embed.fields, field.param);
|
|
221
|
+
const labelId = useId();
|
|
222
|
+
if (field.kind === "boolean") {
|
|
223
|
+
const restricted = isFieldRestricted(field.key, safetyRules);
|
|
224
|
+
const unmet = fieldDependenciesUnmet(field.key, config);
|
|
225
|
+
const blocked = restricted || unmet.length > 0;
|
|
226
|
+
const blockingLabels = unmet.map((key) => dependencyParam(key)).filter((param) => param !== null).map((param) => `"${fieldCopy(words.embed.fields, param)}"`);
|
|
227
|
+
const dependencyTooltip = blockingLabels.length === 0 ? void 0 : words.embed.requiresField(blockingLabels.join(words.embed.requiresFieldSeparator));
|
|
228
|
+
return /* @__PURE__ */ jsx(EmbedToggleSwitch, {
|
|
229
|
+
checked: flagOf(config, field.key),
|
|
230
|
+
description: fieldCopy(words.embed.fieldsDesc, field.param),
|
|
231
|
+
disabled: blocked,
|
|
232
|
+
label,
|
|
233
|
+
onChange: (checked) => onPatch({ [field.key]: checked }),
|
|
234
|
+
tooltip: restricted ? words.embed.safetyRestricted : dependencyTooltip
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
if (field.kind === "enum") {
|
|
238
|
+
if (field.key === "preferredLanguage") return /* @__PURE__ */ jsx(LanguageSelect, {
|
|
239
|
+
label,
|
|
240
|
+
onChange: (language) => onPatch({ preferredLanguage: language }),
|
|
241
|
+
options: languageOptions,
|
|
242
|
+
renderMark: languageMark,
|
|
243
|
+
value: config.preferredLanguage
|
|
244
|
+
});
|
|
245
|
+
if (field.key === "terrainVariant") return /* @__PURE__ */ jsx(EmbedTintPicker, {
|
|
246
|
+
label,
|
|
247
|
+
onChange: (value) => onPatch({ terrainVariant: value === "dark" ? "dark" : "light" }),
|
|
248
|
+
options: terrainVariantOptions(words),
|
|
249
|
+
value: config.terrainVariant
|
|
250
|
+
});
|
|
251
|
+
if (isUnitPickerKey(field.key)) {
|
|
252
|
+
const picker = unitPickerFields[field.key];
|
|
253
|
+
return /* @__PURE__ */ jsx(Input.Wrapper, {
|
|
254
|
+
label,
|
|
255
|
+
labelProps: { id: labelId },
|
|
256
|
+
children: /* @__PURE__ */ jsx(UnitPickerGrid, {
|
|
257
|
+
"aria-labelledby": labelId,
|
|
258
|
+
kindSlug: picker.kindSlug,
|
|
259
|
+
onChange: (value) => onPatch({ [field.key]: value }),
|
|
260
|
+
options: picker.options(units, config.preferredUnitLength),
|
|
261
|
+
value: textOf(config, field.key)
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
return /* @__PURE__ */ jsx(EmbedThemePicker, {
|
|
266
|
+
label,
|
|
267
|
+
onChange: (value) => onPatch({ [field.key]: value }),
|
|
268
|
+
options: enumFieldOptions(field.key, words),
|
|
269
|
+
value: textOf(config, field.key)
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
if (field.kind === "string") {
|
|
273
|
+
if (field.key === "segmentsColor") {
|
|
274
|
+
const segmentsColor = config.segmentsColor;
|
|
275
|
+
return /* @__PURE__ */ jsx(ColorInput, {
|
|
276
|
+
label,
|
|
277
|
+
onChange: (value) => onPatch({ segmentsColor: value }),
|
|
278
|
+
placeholder: words.embed.fields.segments_color_placeholder,
|
|
279
|
+
rightSection: segmentsColor === "" ? void 0 : /* @__PURE__ */ jsx(CloseButton, {
|
|
280
|
+
"aria-label": words.embed.fields.segments_color_clear,
|
|
281
|
+
onClick: () => onPatch({ segmentsColor: "" })
|
|
282
|
+
}),
|
|
283
|
+
rightSectionPointerEvents: "all",
|
|
284
|
+
value: segmentsColor
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
return /* @__PURE__ */ jsx(EmbedBaseMapPicker, {
|
|
288
|
+
label,
|
|
289
|
+
onChange: (slug) => onPatch({ [field.key]: slug }),
|
|
290
|
+
options: layerOptions.terrains,
|
|
291
|
+
value: textOf(config, field.key)
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
const allowlistModeLabels = {
|
|
295
|
+
all: words.embed.allowlist.all,
|
|
296
|
+
specific: words.embed.allowlist.specific
|
|
297
|
+
};
|
|
298
|
+
if (field.key === "withOverlays") {
|
|
299
|
+
const overlaysWithheld = !overlaysOffered([], safetyRules?.with_overlays);
|
|
300
|
+
return /* @__PURE__ */ jsx(AllowlistField, {
|
|
301
|
+
data: layerOptions.overlayGroups,
|
|
302
|
+
description: overlaysWithheld ? words.embed.safetyRestricted : void 0,
|
|
303
|
+
disabled: overlaysWithheld && layerOptions.overlayGroups.length === 0,
|
|
304
|
+
label,
|
|
305
|
+
modeLabels: allowlistModeLabels,
|
|
306
|
+
nothingFoundMessage: words.controls.layers,
|
|
307
|
+
onChange: (value) => onPatch({ withOverlays: value }),
|
|
308
|
+
placeholder: words.embed.allowlist.overlaysPlaceholder,
|
|
309
|
+
selectionCountLabel: words.embed.allowlist.selectedCount,
|
|
310
|
+
value: config.withOverlays,
|
|
311
|
+
variant: "display"
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
return /* @__PURE__ */ jsx(AllowlistField, {
|
|
315
|
+
data: layerOptions.terrains,
|
|
316
|
+
label,
|
|
317
|
+
modeLabels: allowlistModeLabels,
|
|
318
|
+
nothingFoundMessage: words.controls.layers,
|
|
319
|
+
onChange: (value) => onPatch({ [field.key]: value }),
|
|
320
|
+
placeholder: words.embed.allowlist.terrainsPlaceholder,
|
|
321
|
+
selectionCountLabel: words.embed.allowlist.selectedCount,
|
|
322
|
+
value: listOf(config, field.key),
|
|
323
|
+
variant: "display"
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
const sameFieldProps = (previous, next) => previous.field === next.field && previous.layerOptions === next.layerOptions && previous.onPatch === next.onPatch && previous.safetyRules === next.safetyRules && configKeysRead(next.field).every((key) => previous.config[key] === next.config[key]);
|
|
327
|
+
const EmbedFieldControl = memo(EmbedFieldControlBase, sameFieldProps);
|
|
328
|
+
const SECTIONS$10 = ["embed"];
|
|
329
|
+
const CODE_DEBOUNCE_MS = 300;
|
|
330
|
+
const IFRAME_WIDTH = "100%";
|
|
331
|
+
const IFRAME_HEIGHT = "480";
|
|
332
|
+
const useEmbedCode = ({ collectionId, config, defaultView, defaults, element, itineraryId, name, publishableKey, requireSessionToken, tableItineraryId, tables }) => {
|
|
333
|
+
const appOrigin = useStudioAppOrigin();
|
|
334
|
+
const words = useStudioScopedStrings(SECTIONS$10);
|
|
335
|
+
const [settled] = useDebouncedValue(config, CODE_DEBOUNCE_MS);
|
|
336
|
+
const viewHash = useMemo(() => buildEmbedViewHash(defaultView), [defaultView]);
|
|
337
|
+
const iframeTitle = words.embed.code.iframeTitle(name);
|
|
338
|
+
return useMemo(() => {
|
|
339
|
+
if (!publishableKey) return null;
|
|
340
|
+
if (isEmbedTableElement(element)) return tableItineraryId === null ? null : {
|
|
341
|
+
code: buildEmbedTableCode({
|
|
342
|
+
columns: embedTableColumns(element, tables),
|
|
343
|
+
element,
|
|
344
|
+
itineraryId: tableItineraryId,
|
|
345
|
+
language: settled.preferredLanguage,
|
|
346
|
+
length: settled.preferredUnitLength,
|
|
347
|
+
publishableKey,
|
|
348
|
+
requireSessionToken,
|
|
349
|
+
serviceFilter: tables.serviceFilter
|
|
350
|
+
}),
|
|
351
|
+
language: "tsx"
|
|
352
|
+
};
|
|
353
|
+
const iframe = buildEmbedIframe({
|
|
354
|
+
height: IFRAME_HEIGHT,
|
|
355
|
+
src: buildEmbedSrc(appOrigin, buildEmbedSearch({
|
|
356
|
+
collectionId: collectionId ?? void 0,
|
|
357
|
+
config: settled,
|
|
358
|
+
defaults,
|
|
359
|
+
itineraryId: itineraryId ?? void 0,
|
|
360
|
+
publishableKey
|
|
361
|
+
}), viewHash),
|
|
362
|
+
title: iframeTitle,
|
|
363
|
+
width: IFRAME_WIDTH
|
|
364
|
+
});
|
|
365
|
+
return {
|
|
366
|
+
code: requireSessionToken ? `${iframe}\n${buildEmbedSessionScript({ appOrigin })}` : iframe,
|
|
367
|
+
language: "html"
|
|
368
|
+
};
|
|
369
|
+
}, [
|
|
370
|
+
appOrigin,
|
|
371
|
+
collectionId,
|
|
372
|
+
defaults,
|
|
373
|
+
element,
|
|
374
|
+
iframeTitle,
|
|
375
|
+
itineraryId,
|
|
376
|
+
publishableKey,
|
|
377
|
+
requireSessionToken,
|
|
378
|
+
settled,
|
|
379
|
+
tableItineraryId,
|
|
380
|
+
tables,
|
|
381
|
+
viewHash
|
|
382
|
+
]);
|
|
383
|
+
};
|
|
384
|
+
const PAGE_LIMIT = 100;
|
|
385
|
+
const NO_ITINERARIES = [];
|
|
386
|
+
const useEmbedCollectionItineraries = (collectionId) => {
|
|
387
|
+
const { data, isLoading } = useMountayaQuery("rest", "getCollectionItineraries", {
|
|
388
|
+
collection_id: collectionId ?? "",
|
|
389
|
+
query: { limit: PAGE_LIMIT }
|
|
390
|
+
}, {
|
|
391
|
+
enabled: collectionId !== void 0,
|
|
392
|
+
select: (body) => body.data
|
|
393
|
+
});
|
|
394
|
+
return {
|
|
395
|
+
itineraries: data ?? NO_ITINERARIES,
|
|
396
|
+
pending: isLoading
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
const SECTIONS$9 = ["embed"];
|
|
400
|
+
const useEmbedLayerOptions = (config, safetyRules, organizationId) => {
|
|
401
|
+
const words = useStudioScopedStrings(SECTIONS$9);
|
|
402
|
+
const language = useMountayaLanguage();
|
|
403
|
+
const { overlayGroups, terrainOptions } = useLayerCatalogOptions(language, organizationId);
|
|
404
|
+
const otherLabel = words.embed.overlaysOther;
|
|
405
|
+
const allowedOverlays = safetyRules?.with_overlays;
|
|
406
|
+
return useMemo(() => embedLayerOptions({
|
|
407
|
+
overlayGroups,
|
|
408
|
+
terrains: terrainOptions
|
|
409
|
+
}, {
|
|
410
|
+
terrain: config.terrain,
|
|
411
|
+
withOverlays: config.withOverlays,
|
|
412
|
+
withTerrains: config.withTerrains
|
|
413
|
+
}, allowedOverlays, otherLabel), [
|
|
414
|
+
allowedOverlays,
|
|
415
|
+
config.terrain,
|
|
416
|
+
config.withOverlays,
|
|
417
|
+
config.withTerrains,
|
|
418
|
+
otherLabel,
|
|
419
|
+
overlayGroups,
|
|
420
|
+
terrainOptions
|
|
421
|
+
]);
|
|
422
|
+
};
|
|
423
|
+
const CAMERA_REQUEST_TIMEOUT_MS = 1500;
|
|
424
|
+
const previewOriginOf = (appOrigin) => {
|
|
425
|
+
try {
|
|
426
|
+
return new URL(appOrigin, window.location.href).origin;
|
|
427
|
+
} catch {
|
|
428
|
+
return window.location.origin;
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
const useEmbedPreviewCamera = () => {
|
|
432
|
+
const appOrigin = useStudioAppOrigin();
|
|
433
|
+
const appOriginRef = useLatestRef(appOrigin);
|
|
434
|
+
const previewWindowRef = useRef(null);
|
|
435
|
+
const pendingRef = useRef(null);
|
|
436
|
+
const registerPreviewWindow = useCallback((win) => {
|
|
437
|
+
previewWindowRef.current = win;
|
|
438
|
+
}, []);
|
|
439
|
+
useEffect(() => {
|
|
440
|
+
const onMessage = (event) => {
|
|
441
|
+
if (event.source !== previewWindowRef.current || event.origin !== previewOriginOf(appOriginRef.current)) return;
|
|
442
|
+
const parsed = cameraMessageSchema.safeParse(event.data);
|
|
443
|
+
if (!parsed.success) return;
|
|
444
|
+
const resolve = pendingRef.current;
|
|
445
|
+
if (!resolve) return;
|
|
446
|
+
pendingRef.current = null;
|
|
447
|
+
resolve({
|
|
448
|
+
bearing: parsed.data.bearing,
|
|
449
|
+
center: parsed.data.center,
|
|
450
|
+
pitch: parsed.data.pitch,
|
|
451
|
+
zoom: parsed.data.zoom
|
|
452
|
+
});
|
|
453
|
+
};
|
|
454
|
+
window.addEventListener("message", onMessage);
|
|
455
|
+
return () => {
|
|
456
|
+
window.removeEventListener("message", onMessage);
|
|
457
|
+
};
|
|
458
|
+
}, [appOriginRef]);
|
|
459
|
+
const requestCamera = useCallback(() => {
|
|
460
|
+
const previewWindow = previewWindowRef.current;
|
|
461
|
+
if (!previewWindow) return Promise.resolve(null);
|
|
462
|
+
return new Promise((resolve) => {
|
|
463
|
+
pendingRef.current?.(null);
|
|
464
|
+
const timeout = window.setTimeout(() => {
|
|
465
|
+
if (pendingRef.current === settle) {
|
|
466
|
+
pendingRef.current = null;
|
|
467
|
+
resolve(null);
|
|
468
|
+
}
|
|
469
|
+
}, CAMERA_REQUEST_TIMEOUT_MS);
|
|
470
|
+
const settle = (view) => {
|
|
471
|
+
window.clearTimeout(timeout);
|
|
472
|
+
resolve(view);
|
|
473
|
+
};
|
|
474
|
+
pendingRef.current = settle;
|
|
475
|
+
previewWindow.postMessage({ type: REQUEST_CAMERA_MESSAGE }, previewOriginOf(appOriginRef.current));
|
|
476
|
+
});
|
|
477
|
+
}, [appOriginRef]);
|
|
478
|
+
return useMemo(() => ({
|
|
479
|
+
registerPreviewWindow,
|
|
480
|
+
requestCamera
|
|
481
|
+
}), [registerPreviewWindow, requestCamera]);
|
|
482
|
+
};
|
|
483
|
+
const SECTIONS$8 = ["embed"];
|
|
484
|
+
const emptyDefaultView = {
|
|
485
|
+
bearing: null,
|
|
486
|
+
center: null,
|
|
487
|
+
pitch: null,
|
|
488
|
+
zoom: null
|
|
489
|
+
};
|
|
490
|
+
const UNSET_READOUT = "–";
|
|
491
|
+
const zoomDigits = { maximumFractionDigits: 1 };
|
|
492
|
+
const DefaultViewControl = ({ onCapture, view }) => {
|
|
493
|
+
const words = useStudioScopedStrings(SECTIONS$8);
|
|
494
|
+
const { formatNumber } = useStudioFormatters();
|
|
495
|
+
const [capturing, setCapturing] = useState(false);
|
|
496
|
+
const handleCapture = useCallback(async () => {
|
|
497
|
+
setCapturing(true);
|
|
498
|
+
try {
|
|
499
|
+
await onCapture();
|
|
500
|
+
} finally {
|
|
501
|
+
setCapturing(false);
|
|
502
|
+
}
|
|
503
|
+
}, [onCapture]);
|
|
504
|
+
const hasView = view.zoom !== null || view.bearing !== null || view.pitch !== null || view.center !== null;
|
|
505
|
+
const readouts = [
|
|
506
|
+
{
|
|
507
|
+
label: words.embed.defaultView.zoomLabel,
|
|
508
|
+
value: view.zoom === null ? UNSET_READOUT : formatNumber(view.zoom, zoomDigits)
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
label: words.embed.defaultView.bearingLabel,
|
|
512
|
+
value: view.bearing === null ? UNSET_READOUT : `${Math.round(view.bearing)}°`
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
label: words.embed.defaultView.pitchLabel,
|
|
516
|
+
value: view.pitch === null ? UNSET_READOUT : `${Math.round(view.pitch)}°`
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
label: words.embed.defaultView.centerLabel,
|
|
520
|
+
value: (view.center === null ? null : formatLngLat(view.center)) ?? UNSET_READOUT
|
|
521
|
+
}
|
|
522
|
+
];
|
|
523
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
524
|
+
gap: "sm",
|
|
525
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
526
|
+
leftSection: /* @__PURE__ */ jsx(Glyph$1, {
|
|
527
|
+
name: "action-capture-view",
|
|
528
|
+
size: iconSizes.sm
|
|
529
|
+
}),
|
|
530
|
+
loading: capturing,
|
|
531
|
+
onClick: () => {
|
|
532
|
+
handleCapture();
|
|
533
|
+
},
|
|
534
|
+
variant: "light",
|
|
535
|
+
children: words.embed.defaultView.capture
|
|
536
|
+
}), /* @__PURE__ */ jsx(Stack, {
|
|
537
|
+
gap: "xxs",
|
|
538
|
+
children: readouts.map((readout) => /* @__PURE__ */ jsxs(Group, {
|
|
539
|
+
justify: "space-between",
|
|
540
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
541
|
+
c: "dimmed",
|
|
542
|
+
size: "xs",
|
|
543
|
+
children: readout.label
|
|
544
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
545
|
+
c: hasView ? void 0 : "dimmed",
|
|
546
|
+
fw: 600,
|
|
547
|
+
children: readout.value
|
|
548
|
+
})]
|
|
549
|
+
}, readout.label))
|
|
550
|
+
})]
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
const SECTIONS$7 = ["embed"];
|
|
554
|
+
const EmbedKeyPanel = ({ element, keys, onChange, requireSessionToken, value }) => {
|
|
555
|
+
const words = useStudioScopedStrings(SECTIONS$7);
|
|
556
|
+
const options = useMemo(() => keys.keys.map((key) => ({
|
|
557
|
+
description: truncateKey(key.key),
|
|
558
|
+
label: key.name,
|
|
559
|
+
value: key.key
|
|
560
|
+
})), [keys]);
|
|
561
|
+
return /* @__PURE__ */ jsxs(Stack, { children: [options.length > 0 ? /* @__PURE__ */ jsx(Select, {
|
|
562
|
+
allowDeselect: false,
|
|
563
|
+
data: options,
|
|
564
|
+
description: words.embed.key.description,
|
|
565
|
+
label: words.embed.key.label,
|
|
566
|
+
leftSection: /* @__PURE__ */ jsx(Glyph$1, {
|
|
567
|
+
name: "api-key",
|
|
568
|
+
size: iconSizes.sm
|
|
569
|
+
}),
|
|
570
|
+
onChange,
|
|
571
|
+
placeholder: words.embed.key.placeholder,
|
|
572
|
+
required: true,
|
|
573
|
+
value,
|
|
574
|
+
withAsterisk: true
|
|
575
|
+
}) : /* @__PURE__ */ jsx(WarningAlert, {
|
|
576
|
+
title: words.embed.key.label,
|
|
577
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
578
|
+
gap: "xxs",
|
|
579
|
+
children: [words.embed.key.empty, keys.createKeyHref === void 0 ? null : /* @__PURE__ */ jsx(Anchor, {
|
|
580
|
+
href: keys.createKeyHref,
|
|
581
|
+
rel: "noreferrer",
|
|
582
|
+
target: "_blank",
|
|
583
|
+
children: words.embed.key.createCta
|
|
584
|
+
})]
|
|
585
|
+
})
|
|
586
|
+
}), requireSessionToken ? /* @__PURE__ */ jsx(Alert, {
|
|
587
|
+
color: "blue",
|
|
588
|
+
icon: /* @__PURE__ */ jsx(Glyph$1, {
|
|
589
|
+
name: "info",
|
|
590
|
+
size: iconSizes.md
|
|
591
|
+
}),
|
|
592
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
593
|
+
gap: "xxs",
|
|
594
|
+
children: [isEmbedTableElement(element) ? words.embed.key.sessionTokenTable : words.embed.key.sessionToken, keys.sessionTokenHref === void 0 ? null : /* @__PURE__ */ jsx(Anchor, {
|
|
595
|
+
href: keys.sessionTokenHref,
|
|
596
|
+
rel: "noreferrer",
|
|
597
|
+
target: "_blank",
|
|
598
|
+
children: words.embed.key.sessionTokenLink
|
|
599
|
+
})]
|
|
600
|
+
})
|
|
601
|
+
}) : null] });
|
|
602
|
+
};
|
|
603
|
+
const SECTIONS$6 = ["embed"];
|
|
604
|
+
const EmbedSnippetCode = lazy(() => import("../chunk-BYzQfFFV.js").then((module) => ({ default: module.EmbedSnippetCode })));
|
|
605
|
+
const EmbedCodeStep = ({ children, description, position, title }) => {
|
|
606
|
+
const words = useStudioScopedStrings(SECTIONS$6);
|
|
607
|
+
return /* @__PURE__ */ jsx(SectionCard, { children: /* @__PURE__ */ jsxs(Stack, {
|
|
608
|
+
gap: "md",
|
|
609
|
+
children: [/* @__PURE__ */ jsxs(Group, {
|
|
610
|
+
align: "flex-start",
|
|
611
|
+
gap: "sm",
|
|
612
|
+
wrap: "nowrap",
|
|
613
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
614
|
+
"aria-hidden": true,
|
|
615
|
+
className: "mtya-embed-step-mark",
|
|
616
|
+
children: position
|
|
617
|
+
}), /* @__PURE__ */ jsxs(Stack, {
|
|
618
|
+
gap: "xxs",
|
|
619
|
+
children: [/* @__PURE__ */ jsxs("h4", {
|
|
620
|
+
className: "mtya-section-card-title",
|
|
621
|
+
children: [/* @__PURE__ */ jsxs(VisuallyHidden, { children: [words.embed.code.step(position), " "] }), title]
|
|
622
|
+
}), description === void 0 ? null : /* @__PURE__ */ jsx(Text, {
|
|
623
|
+
c: "dimmed",
|
|
624
|
+
children: description
|
|
625
|
+
})]
|
|
626
|
+
})]
|
|
627
|
+
}), children]
|
|
628
|
+
}) });
|
|
629
|
+
};
|
|
630
|
+
const EmbedCodeBlock = ({ code, copyLabel, language }) => {
|
|
631
|
+
const words = useStudioScopedStrings(SECTIONS$6);
|
|
632
|
+
return /* @__PURE__ */ jsx(Suspense, {
|
|
633
|
+
fallback: /* @__PURE__ */ jsx(Group, {
|
|
634
|
+
justify: "center",
|
|
635
|
+
p: "md",
|
|
636
|
+
children: /* @__PURE__ */ jsx(Loader, { size: "sm" })
|
|
637
|
+
}),
|
|
638
|
+
children: /* @__PURE__ */ jsx(EmbedSnippetCode, {
|
|
639
|
+
ariaLabel: copyLabel,
|
|
640
|
+
code,
|
|
641
|
+
copiedLabel: words.embed.code.copied,
|
|
642
|
+
copyLabel,
|
|
643
|
+
language
|
|
644
|
+
})
|
|
645
|
+
});
|
|
646
|
+
};
|
|
647
|
+
const EmbedDomainsNote = ({ domains, element, href }) => {
|
|
648
|
+
const copy = useStudioScopedStrings(SECTIONS$6).embed.domains;
|
|
649
|
+
const table = isEmbedTableElement(element);
|
|
650
|
+
const link = href === void 0 ? null : /* @__PURE__ */ jsx(Anchor, {
|
|
651
|
+
href,
|
|
652
|
+
rel: "noreferrer",
|
|
653
|
+
target: "_blank",
|
|
654
|
+
children: copy.manage
|
|
655
|
+
});
|
|
656
|
+
if (domains !== void 0 && domains.length > 0 && domains.every((entry) => isLoopbackDomain(entry))) {
|
|
657
|
+
const listedLocal = domains.join(copy.separator);
|
|
658
|
+
const localOnly = table ? {
|
|
659
|
+
body: copy.tableLocalOnly.body(listedLocal),
|
|
660
|
+
title: copy.tableLocalOnly.title
|
|
661
|
+
} : {
|
|
662
|
+
body: copy.embedLocalOnly.body(listedLocal),
|
|
663
|
+
title: copy.embedLocalOnly.title
|
|
664
|
+
};
|
|
665
|
+
return /* @__PURE__ */ jsx(WarningAlert, {
|
|
666
|
+
title: localOnly.title,
|
|
667
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
668
|
+
gap: "xxs",
|
|
669
|
+
children: [localOnly.body, link]
|
|
670
|
+
})
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
if (domains !== void 0 && domains.length === 0) return /* @__PURE__ */ jsx(WarningAlert, {
|
|
674
|
+
title: table ? copy.tableNone.title : copy.embedNone.title,
|
|
675
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
676
|
+
gap: "xxs",
|
|
677
|
+
children: [table ? copy.tableNone.body : copy.embedNone.body, link]
|
|
678
|
+
})
|
|
679
|
+
});
|
|
680
|
+
const listed = domains === void 0 ? "" : domains.join(copy.separator);
|
|
681
|
+
const sentence = domains === void 0 ? table ? copy.tableUnknown : copy.embedUnknown : table ? copy.tableListed(listed) : copy.embedListed(listed);
|
|
682
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
683
|
+
gap: "xxs",
|
|
684
|
+
children: [/* @__PURE__ */ jsx(Text, { children: sentence }), link]
|
|
685
|
+
});
|
|
686
|
+
};
|
|
687
|
+
const EmbedCodeSection = ({ code, domains, element, keys, onPublishableKeyChange, publishableKey, requireSessionToken, withheld }) => {
|
|
688
|
+
const words = useStudioScopedStrings(SECTIONS$6);
|
|
689
|
+
const copy = words.embed.code;
|
|
690
|
+
const table = isEmbedTableElement(element);
|
|
691
|
+
const codeStep = table ? 3 : 2;
|
|
692
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
693
|
+
className: "mtya-wizard-page",
|
|
694
|
+
gap: "lg",
|
|
695
|
+
children: [
|
|
696
|
+
/* @__PURE__ */ jsx(SectionHead, {
|
|
697
|
+
description: table ? words.embed.sectionHelp.codeTable : words.embed.sectionHelp.code,
|
|
698
|
+
title: words.embed.sections.code
|
|
699
|
+
}),
|
|
700
|
+
/* @__PURE__ */ jsx(EmbedCodeStep, {
|
|
701
|
+
position: 1,
|
|
702
|
+
title: copy.keyTitle,
|
|
703
|
+
children: /* @__PURE__ */ jsx(EmbedKeyPanel, {
|
|
704
|
+
element,
|
|
705
|
+
keys,
|
|
706
|
+
onChange: onPublishableKeyChange,
|
|
707
|
+
requireSessionToken,
|
|
708
|
+
value: publishableKey
|
|
709
|
+
})
|
|
710
|
+
}),
|
|
711
|
+
table ? /* @__PURE__ */ jsx(EmbedCodeStep, {
|
|
712
|
+
description: copy.install.description,
|
|
713
|
+
position: 2,
|
|
714
|
+
title: copy.install.title,
|
|
715
|
+
children: /* @__PURE__ */ jsx(EmbedCodeBlock, {
|
|
716
|
+
code: EMBED_TABLE_INSTALL_COMMAND,
|
|
717
|
+
copyLabel: copy.copyCommand,
|
|
718
|
+
language: "text"
|
|
719
|
+
})
|
|
720
|
+
}) : null,
|
|
721
|
+
/* @__PURE__ */ jsxs(EmbedCodeStep, {
|
|
722
|
+
description: table ? copy.component.description : copy.iframe.description,
|
|
723
|
+
position: codeStep,
|
|
724
|
+
title: table ? copy.component.title : copy.iframe.title,
|
|
725
|
+
children: [code === null ? /* @__PURE__ */ jsxs(Group, {
|
|
726
|
+
align: "flex-start",
|
|
727
|
+
gap: "sm",
|
|
728
|
+
wrap: "nowrap",
|
|
729
|
+
children: [/* @__PURE__ */ jsx(Box, {
|
|
730
|
+
c: "dimmed",
|
|
731
|
+
mt: "xxs",
|
|
732
|
+
children: /* @__PURE__ */ jsx(Glyph$1, {
|
|
733
|
+
name: "locked",
|
|
734
|
+
size: iconSizes.md
|
|
735
|
+
})
|
|
736
|
+
}), publishableKey === null ? /* @__PURE__ */ jsxs(Stack, {
|
|
737
|
+
gap: "xxs",
|
|
738
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
739
|
+
fw: 500,
|
|
740
|
+
children: words.embed.gated.noKey.title
|
|
741
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
742
|
+
c: "dimmed",
|
|
743
|
+
children: words.embed.gated.noKey.description
|
|
744
|
+
})]
|
|
745
|
+
}) : /* @__PURE__ */ jsx(Text, {
|
|
746
|
+
c: "dimmed",
|
|
747
|
+
children: withheld
|
|
748
|
+
})]
|
|
749
|
+
}) : /* @__PURE__ */ jsx(EmbedCodeBlock, {
|
|
750
|
+
code: code.code,
|
|
751
|
+
copyLabel: copy.copy,
|
|
752
|
+
language: code.language
|
|
753
|
+
}), table ? /* @__PURE__ */ jsx(Text, {
|
|
754
|
+
c: "dimmed",
|
|
755
|
+
size: "xs",
|
|
756
|
+
children: copy.otherFrameworks
|
|
757
|
+
}) : null]
|
|
758
|
+
}),
|
|
759
|
+
/* @__PURE__ */ jsx(EmbedCodeStep, {
|
|
760
|
+
position: codeStep + 1,
|
|
761
|
+
title: copy.domainsTitle,
|
|
762
|
+
children: /* @__PURE__ */ jsx(EmbedDomainsNote, {
|
|
763
|
+
domains,
|
|
764
|
+
element,
|
|
765
|
+
href: keys.allowedDomainsHref
|
|
766
|
+
})
|
|
767
|
+
})
|
|
768
|
+
]
|
|
769
|
+
});
|
|
770
|
+
};
|
|
771
|
+
const SECTIONS$5 = [
|
|
772
|
+
"controls",
|
|
773
|
+
"embed",
|
|
774
|
+
"preferences"
|
|
775
|
+
];
|
|
776
|
+
const EmbedSectionReset = ({ description, disabled, onClick, title }) => /* @__PURE__ */ jsx(Tooltip, {
|
|
777
|
+
label: /* @__PURE__ */ jsxs(Stack, {
|
|
778
|
+
gap: "xxs",
|
|
779
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
780
|
+
c: "white",
|
|
781
|
+
fw: 600,
|
|
782
|
+
size: "xs",
|
|
783
|
+
children: title
|
|
784
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
785
|
+
c: "dimmed",
|
|
786
|
+
size: "xs",
|
|
787
|
+
children: description
|
|
788
|
+
})]
|
|
789
|
+
}),
|
|
790
|
+
position: "bottom-end",
|
|
791
|
+
withinPortal: true,
|
|
792
|
+
children: /* @__PURE__ */ jsx(ActionIcon, {
|
|
793
|
+
"aria-label": title,
|
|
794
|
+
c: "dimmed",
|
|
795
|
+
disabled,
|
|
796
|
+
onClick,
|
|
797
|
+
variant: "subtle",
|
|
798
|
+
children: /* @__PURE__ */ jsx(Glyph$1, {
|
|
799
|
+
name: "action-reset",
|
|
800
|
+
size: iconSizes.sm
|
|
801
|
+
})
|
|
802
|
+
})
|
|
803
|
+
});
|
|
804
|
+
const assignField = (patch, key, value) => {
|
|
805
|
+
patch[key] = value;
|
|
806
|
+
};
|
|
807
|
+
const EmbedConfigForm = ({ config, defaults, element, layerOptions, onPatch, safetyRules, section }) => {
|
|
808
|
+
const words = useStudioScopedStrings(SECTIONS$5);
|
|
809
|
+
const fields = embedElementSectionFields(element, section);
|
|
810
|
+
const changes = embedSectionChanges(element, section, config, defaults);
|
|
811
|
+
const reset = () => {
|
|
812
|
+
const patch = {};
|
|
813
|
+
for (const field of fields) assignField(patch, field.key, defaults[field.key]);
|
|
814
|
+
onPatch(patch);
|
|
815
|
+
};
|
|
816
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
817
|
+
gap: "lg",
|
|
818
|
+
children: [/* @__PURE__ */ jsx(SectionHead, {
|
|
819
|
+
action: /* @__PURE__ */ jsx(EmbedSectionReset, {
|
|
820
|
+
description: words.embed.reset.section.description,
|
|
821
|
+
disabled: changes === 0,
|
|
822
|
+
onClick: reset,
|
|
823
|
+
title: words.embed.reset.section.title
|
|
824
|
+
}),
|
|
825
|
+
description: section === "appearance" && isEmbedTableElement(element) ? words.embed.sectionHelp.appearanceTable : words.embed.sectionHelp[section],
|
|
826
|
+
title: words.embed.sections[section]
|
|
827
|
+
}), /* @__PURE__ */ jsx(Stack, {
|
|
828
|
+
gap: "sm",
|
|
829
|
+
children: fields.map((field) => /* @__PURE__ */ jsx(EmbedFieldControl, {
|
|
830
|
+
config,
|
|
831
|
+
field,
|
|
832
|
+
layerOptions,
|
|
833
|
+
onPatch,
|
|
834
|
+
safetyRules
|
|
835
|
+
}, field.key))
|
|
836
|
+
})]
|
|
837
|
+
});
|
|
838
|
+
};
|
|
839
|
+
const EmbedDefaultViewSection = ({ defaultView, onCaptureCamera, onDefaultViewReset }) => {
|
|
840
|
+
const words = useStudioScopedStrings(SECTIONS$5);
|
|
841
|
+
const atDefault = defaultView.zoom === null && defaultView.bearing === null && defaultView.pitch === null && defaultView.center === null;
|
|
842
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
843
|
+
gap: "lg",
|
|
844
|
+
children: [/* @__PURE__ */ jsx(SectionHead, {
|
|
845
|
+
action: /* @__PURE__ */ jsx(EmbedSectionReset, {
|
|
846
|
+
description: words.embed.reset.defaultView.description,
|
|
847
|
+
disabled: atDefault,
|
|
848
|
+
onClick: onDefaultViewReset,
|
|
849
|
+
title: words.embed.reset.defaultView.title
|
|
850
|
+
}),
|
|
851
|
+
description: words.embed.defaultView.help,
|
|
852
|
+
title: words.embed.sections.defaultView
|
|
853
|
+
}), /* @__PURE__ */ jsx(DefaultViewControl, {
|
|
854
|
+
onCapture: onCaptureCamera,
|
|
855
|
+
view: defaultView
|
|
856
|
+
})]
|
|
857
|
+
});
|
|
858
|
+
};
|
|
859
|
+
const SECTIONS$4 = [
|
|
860
|
+
"controls",
|
|
861
|
+
"embed",
|
|
862
|
+
"preferences"
|
|
863
|
+
];
|
|
864
|
+
const TABLE_SECTIONS = ["table"];
|
|
865
|
+
const EmbedColumnsSection = ({ element, onChange, options }) => {
|
|
866
|
+
const words = useStudioScopedStrings(SECTIONS$4);
|
|
867
|
+
const { table } = useMountayaScopedStrings(TABLE_SECTIONS);
|
|
868
|
+
const copy = words.embed.columns;
|
|
869
|
+
const toggleSegment = (column, shown) => onChange({
|
|
870
|
+
...options,
|
|
871
|
+
segmentColumns: toggleEmbedTableColumn(EMBED_SEGMENT_TABLE_COLUMNS, options.segmentColumns, column, shown)
|
|
872
|
+
});
|
|
873
|
+
const toggleWaypoint = (column, shown) => onChange({
|
|
874
|
+
...options,
|
|
875
|
+
waypointColumns: toggleEmbedTableColumn(EMBED_WAYPOINT_TABLE_COLUMNS, options.waypointColumns, column, shown)
|
|
876
|
+
});
|
|
877
|
+
const reset = () => onChange(element === "segment-table" ? {
|
|
878
|
+
...options,
|
|
879
|
+
segmentColumns: defaultEmbedTableOptions.segmentColumns
|
|
880
|
+
} : {
|
|
881
|
+
...options,
|
|
882
|
+
serviceFilter: defaultEmbedTableOptions.serviceFilter,
|
|
883
|
+
waypointColumns: defaultEmbedTableOptions.waypointColumns
|
|
884
|
+
});
|
|
885
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
886
|
+
gap: "lg",
|
|
887
|
+
children: [
|
|
888
|
+
/* @__PURE__ */ jsx(SectionHead, {
|
|
889
|
+
action: /* @__PURE__ */ jsx(EmbedSectionReset, {
|
|
890
|
+
description: words.embed.reset.columns.description,
|
|
891
|
+
disabled: embedTableChanges(element, options) === 0,
|
|
892
|
+
onClick: reset,
|
|
893
|
+
title: words.embed.reset.columns.title
|
|
894
|
+
}),
|
|
895
|
+
description: words.embed.sectionHelp.columns,
|
|
896
|
+
title: words.embed.sections.columns
|
|
897
|
+
}),
|
|
898
|
+
/* @__PURE__ */ jsx(Stack, {
|
|
899
|
+
gap: "sm",
|
|
900
|
+
children: element === "segment-table" ? EMBED_SEGMENT_TABLE_COLUMNS.map((column) => column === "segment" ? /* @__PURE__ */ jsx(EmbedToggleSwitch, {
|
|
901
|
+
checked: true,
|
|
902
|
+
description: copy.locked,
|
|
903
|
+
disabled: true,
|
|
904
|
+
label: table[column],
|
|
905
|
+
onChange: () => {}
|
|
906
|
+
}, column) : /* @__PURE__ */ jsx(EmbedToggleSwitch, {
|
|
907
|
+
checked: options.segmentColumns.includes(column),
|
|
908
|
+
description: copy.segment[column],
|
|
909
|
+
label: table[column],
|
|
910
|
+
onChange: (shown) => toggleSegment(column, shown)
|
|
911
|
+
}, column)) : EMBED_WAYPOINT_TABLE_COLUMNS.map((column) => column === "waypoint" ? /* @__PURE__ */ jsx(EmbedToggleSwitch, {
|
|
912
|
+
checked: true,
|
|
913
|
+
description: copy.locked,
|
|
914
|
+
disabled: true,
|
|
915
|
+
label: table[column],
|
|
916
|
+
onChange: () => {}
|
|
917
|
+
}, column) : /* @__PURE__ */ jsx(EmbedToggleSwitch, {
|
|
918
|
+
checked: options.waypointColumns.includes(column),
|
|
919
|
+
description: copy.waypoint[column],
|
|
920
|
+
label: table[column],
|
|
921
|
+
onChange: (shown) => toggleWaypoint(column, shown)
|
|
922
|
+
}, column))
|
|
923
|
+
}),
|
|
924
|
+
element === "waypoint-table" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Divider, {}), /* @__PURE__ */ jsxs(Stack, {
|
|
925
|
+
gap: "sm",
|
|
926
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
927
|
+
variant: "section-label",
|
|
928
|
+
children: copy.filter.heading
|
|
929
|
+
}), /* @__PURE__ */ jsx(EmbedToggleSwitch, {
|
|
930
|
+
checked: options.serviceFilter,
|
|
931
|
+
description: copy.filter.description,
|
|
932
|
+
label: copy.filter.label,
|
|
933
|
+
onChange: (serviceFilter) => onChange({
|
|
934
|
+
...options,
|
|
935
|
+
serviceFilter
|
|
936
|
+
})
|
|
937
|
+
})]
|
|
938
|
+
})] }) : null
|
|
939
|
+
]
|
|
940
|
+
});
|
|
941
|
+
};
|
|
942
|
+
const SECTIONS$3 = ["embed"];
|
|
943
|
+
const elementGlyphs = {
|
|
944
|
+
map: "action-embed",
|
|
945
|
+
"segment-table": "routed",
|
|
946
|
+
"waypoint-table": "pin"
|
|
947
|
+
};
|
|
948
|
+
const LIST_WIDTH = 340;
|
|
949
|
+
const ElementMark = ({ element }) => /* @__PURE__ */ jsx("span", {
|
|
950
|
+
className: "mtya-rail-switcher-mark",
|
|
951
|
+
children: /* @__PURE__ */ jsx(Glyph$1, {
|
|
952
|
+
name: elementGlyphs[element],
|
|
953
|
+
size: iconSizes.xs
|
|
954
|
+
})
|
|
955
|
+
});
|
|
956
|
+
const EmbedElementSwitcher = ({ onChange, value }) => {
|
|
957
|
+
const words = useStudioScopedStrings(SECTIONS$3);
|
|
958
|
+
const options = EMBED_ELEMENTS.map((element) => ({
|
|
959
|
+
description: words.embed.elements[element].description,
|
|
960
|
+
id: element,
|
|
961
|
+
mark: /* @__PURE__ */ jsx(ElementMark, { element }),
|
|
962
|
+
name: words.embed.elements[element].name
|
|
963
|
+
}));
|
|
964
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
965
|
+
gap: "xxs",
|
|
966
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
967
|
+
px: "xxs",
|
|
968
|
+
variant: "section-label",
|
|
969
|
+
children: words.embed.elements.label
|
|
970
|
+
}), /* @__PURE__ */ jsx(RailSwitcher, {
|
|
971
|
+
ariaLabel: words.embed.elements.switcherLabel,
|
|
972
|
+
caption: words.embed.elements[value].caption,
|
|
973
|
+
listLabel: words.embed.elements.label,
|
|
974
|
+
listWidth: LIST_WIDTH,
|
|
975
|
+
mark: /* @__PURE__ */ jsx(ElementMark, { element: value }),
|
|
976
|
+
name: words.embed.elements[value].name,
|
|
977
|
+
onSelect: onChange,
|
|
978
|
+
options,
|
|
979
|
+
overflow: "wrap",
|
|
980
|
+
value
|
|
981
|
+
})]
|
|
982
|
+
});
|
|
983
|
+
};
|
|
984
|
+
const SECTIONS$2 = [
|
|
985
|
+
"actions",
|
|
986
|
+
"embed",
|
|
987
|
+
"privacy"
|
|
988
|
+
];
|
|
989
|
+
const FAILURE_SECTIONS = ["failure"];
|
|
990
|
+
const CollectionSelect = ({ itineraryId, onChange, value }) => {
|
|
991
|
+
const words = useStudioScopedStrings(SECTIONS$2);
|
|
992
|
+
const holding = useCollections({ itinerary_id: itineraryId }, { enabled: itineraryId !== "" });
|
|
993
|
+
useEveryPage(holding);
|
|
994
|
+
const { data, isLoading } = holding;
|
|
995
|
+
const options = useMemo(() => (data ?? []).map((collection) => ({
|
|
996
|
+
label: collection.name,
|
|
997
|
+
value: collection.id
|
|
998
|
+
})), [data]);
|
|
999
|
+
return /* @__PURE__ */ jsx(Select, {
|
|
1000
|
+
clearable: true,
|
|
1001
|
+
data: options,
|
|
1002
|
+
description: words.embed.collection.pickerDescription,
|
|
1003
|
+
disabled: isLoading,
|
|
1004
|
+
label: words.embed.collection.pickerLabel,
|
|
1005
|
+
nothingFoundMessage: words.embed.collection.pickerEmpty,
|
|
1006
|
+
onChange,
|
|
1007
|
+
placeholder: words.embed.collection.pickerPlaceholder,
|
|
1008
|
+
searchable: true,
|
|
1009
|
+
value
|
|
1010
|
+
});
|
|
1011
|
+
};
|
|
1012
|
+
const EmbedVisibility = ({ isPrivate, itineraryId, organizationId }) => {
|
|
1013
|
+
const words = useStudioScopedStrings(SECTIONS$2);
|
|
1014
|
+
const editable = useItineraryEditable({
|
|
1015
|
+
createdById: void 0,
|
|
1016
|
+
organizationId
|
|
1017
|
+
});
|
|
1018
|
+
const { failure } = useStudioScopedStrings(FAILURE_SECTIONS);
|
|
1019
|
+
const notify = useStudioNotify();
|
|
1020
|
+
const { dispatch } = useStudioDispatch();
|
|
1021
|
+
const [pendingPrivate, setPendingPrivate] = useState(null);
|
|
1022
|
+
const visibilityCopy = pendingPrivate === true ? words.privacy.confirm.toPrivate : words.privacy.confirm.toPublic;
|
|
1023
|
+
const onConfirmVisibility = () => {
|
|
1024
|
+
if (pendingPrivate !== null) dispatch("studio.itinerary.update", {
|
|
1025
|
+
isPrivate: pendingPrivate,
|
|
1026
|
+
itineraryId
|
|
1027
|
+
}).then((result) => {
|
|
1028
|
+
const refusal = failureAlertFor(result, "", failure);
|
|
1029
|
+
if (refusal !== null) notify.error(refusal.message.trim());
|
|
1030
|
+
});
|
|
1031
|
+
setPendingPrivate(null);
|
|
1032
|
+
};
|
|
1033
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(PrivacyControl, {
|
|
1034
|
+
caption: words.privacy.embedScope,
|
|
1035
|
+
disabled: !editable,
|
|
1036
|
+
onChange: setPendingPrivate,
|
|
1037
|
+
resource: "itinerary",
|
|
1038
|
+
value: isPrivate
|
|
1039
|
+
}), /* @__PURE__ */ jsx(ConfirmModal, {
|
|
1040
|
+
acknowledgeLabel: visibilityCopy.acknowledge,
|
|
1041
|
+
body: visibilityCopy.body,
|
|
1042
|
+
cancelLabel: words.actions.cancel,
|
|
1043
|
+
closeLabel: words.actions.close,
|
|
1044
|
+
confirmLabel: visibilityCopy.confirm,
|
|
1045
|
+
onCancel: () => setPendingPrivate(null),
|
|
1046
|
+
onConfirm: onConfirmVisibility,
|
|
1047
|
+
opened: pendingPrivate !== null,
|
|
1048
|
+
title: visibilityCopy.title,
|
|
1049
|
+
tone: "cautionary",
|
|
1050
|
+
zIndex: 250
|
|
1051
|
+
})] });
|
|
1052
|
+
};
|
|
1053
|
+
const EmbedGeneralSection = ({ collectionId, element, isPrivate, itineraries, itinerariesPending, itineraryId, onCollectionIdChange, onTableItineraryIdChange, organizationId, tableItineraryId }) => {
|
|
1054
|
+
const words = useStudioScopedStrings(SECTIONS$2);
|
|
1055
|
+
const itineraryOptions = useMemo(() => itineraries.map((itinerary) => ({
|
|
1056
|
+
label: itinerary.name,
|
|
1057
|
+
value: itinerary.id
|
|
1058
|
+
})), [itineraries]);
|
|
1059
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
1060
|
+
gap: "lg",
|
|
1061
|
+
children: [/* @__PURE__ */ jsx(SectionHead, {
|
|
1062
|
+
description: itineraryId === void 0 ? words.embed.sectionHelp.generalCollection : words.embed.sectionHelp.general,
|
|
1063
|
+
title: words.embed.sections.general
|
|
1064
|
+
}), itineraryId === void 0 ? /* @__PURE__ */ jsx(Select, {
|
|
1065
|
+
allowDeselect: false,
|
|
1066
|
+
data: itineraryOptions,
|
|
1067
|
+
description: words.embed.itinerary.pickerDescription,
|
|
1068
|
+
disabled: itinerariesPending,
|
|
1069
|
+
label: words.embed.itinerary.pickerLabel,
|
|
1070
|
+
nothingFoundMessage: words.embed.itinerary.pickerEmpty,
|
|
1071
|
+
onChange: (next) => {
|
|
1072
|
+
if (next !== null) onTableItineraryIdChange(next);
|
|
1073
|
+
},
|
|
1074
|
+
placeholder: words.embed.itinerary.pickerPlaceholder,
|
|
1075
|
+
searchable: true,
|
|
1076
|
+
value: tableItineraryId
|
|
1077
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(EmbedVisibility, {
|
|
1078
|
+
isPrivate,
|
|
1079
|
+
itineraryId,
|
|
1080
|
+
organizationId
|
|
1081
|
+
}), isEmbedTableElement(element) ? null : /* @__PURE__ */ jsx(CollectionSelect, {
|
|
1082
|
+
itineraryId,
|
|
1083
|
+
onChange: onCollectionIdChange,
|
|
1084
|
+
value: collectionId
|
|
1085
|
+
})] })]
|
|
1086
|
+
});
|
|
1087
|
+
};
|
|
1088
|
+
const SECTIONS$1 = ["embed", "publish"];
|
|
1089
|
+
const EmbedTablePreview = lazy(() => import("../chunk-CZSBVyE9.js").then((module) => ({ default: module.EmbedTablePreview })));
|
|
1090
|
+
const PREVIEW_REST_MS = 300;
|
|
1091
|
+
const movedBesideColor = (previous, next) => {
|
|
1092
|
+
const { segmentsColor: _before, ...before } = previous;
|
|
1093
|
+
const { segmentsColor: _after, ...after } = next;
|
|
1094
|
+
const held = new Map(Object.entries(before));
|
|
1095
|
+
const entries = Object.entries(after);
|
|
1096
|
+
return entries.length !== held.size || entries.some(([key, value]) => !held.has(key) || !Object.is(held.get(key), value));
|
|
1097
|
+
};
|
|
1098
|
+
const usePreviewColor = (config) => {
|
|
1099
|
+
const [rested] = useDebouncedValue(config.segmentsColor, PREVIEW_REST_MS);
|
|
1100
|
+
const [shown, setShown] = useState(() => ({
|
|
1101
|
+
color: config.segmentsColor,
|
|
1102
|
+
config,
|
|
1103
|
+
rested
|
|
1104
|
+
}));
|
|
1105
|
+
if (shown.config === config && shown.rested === rested) return shown.color;
|
|
1106
|
+
const color = shown.config !== config && movedBesideColor(shown.config, config) ? config.segmentsColor : shown.rested !== rested ? rested : shown.color;
|
|
1107
|
+
setShown({
|
|
1108
|
+
color,
|
|
1109
|
+
config,
|
|
1110
|
+
rested
|
|
1111
|
+
});
|
|
1112
|
+
return color;
|
|
1113
|
+
};
|
|
1114
|
+
const previewFrameStyle = {
|
|
1115
|
+
display: "flex",
|
|
1116
|
+
justifyContent: "center",
|
|
1117
|
+
overflow: "hidden"
|
|
1118
|
+
};
|
|
1119
|
+
const previewIframeStyle = {
|
|
1120
|
+
border: 0,
|
|
1121
|
+
borderRadius: EMBED_IFRAME_RADIUS_PX,
|
|
1122
|
+
height: "100%",
|
|
1123
|
+
maxHeight: "100%",
|
|
1124
|
+
maxWidth: "100%",
|
|
1125
|
+
width: "100%"
|
|
1126
|
+
};
|
|
1127
|
+
const hiddenStyle = { display: "none" };
|
|
1128
|
+
const EmbedMapPreview = ({ collectionId, config, defaultView, defaults, dirty, itineraryId, name, onPreviewWindow, organizationId, publishableKey, unpublished }) => {
|
|
1129
|
+
const appOrigin = useStudioAppOrigin();
|
|
1130
|
+
const words = useStudioScopedStrings(SECTIONS$1);
|
|
1131
|
+
const viewHash = useMemo(() => buildEmbedViewHash(defaultView), [defaultView]);
|
|
1132
|
+
const previewColor = usePreviewColor(config);
|
|
1133
|
+
const previewConfig = useMemo(() => ({
|
|
1134
|
+
...config,
|
|
1135
|
+
segmentsColor: previewColor
|
|
1136
|
+
}), [config, previewColor]);
|
|
1137
|
+
const previewSearch = useMemo(() => {
|
|
1138
|
+
return [
|
|
1139
|
+
...buildEmbedSearch({
|
|
1140
|
+
collectionId: collectionId ?? void 0,
|
|
1141
|
+
config: previewConfig,
|
|
1142
|
+
defaults,
|
|
1143
|
+
itineraryId: itineraryId ?? void 0,
|
|
1144
|
+
publishableKey: publishableKey ?? ""
|
|
1145
|
+
}),
|
|
1146
|
+
["preview", "true"],
|
|
1147
|
+
["organization_id", organizationId]
|
|
1148
|
+
];
|
|
1149
|
+
}, [
|
|
1150
|
+
collectionId,
|
|
1151
|
+
defaults,
|
|
1152
|
+
itineraryId,
|
|
1153
|
+
organizationId,
|
|
1154
|
+
previewConfig,
|
|
1155
|
+
publishableKey
|
|
1156
|
+
]);
|
|
1157
|
+
const [preview, setPreview] = useState(() => ({
|
|
1158
|
+
appOrigin,
|
|
1159
|
+
search: previewSearch,
|
|
1160
|
+
src: buildEmbedSrc(appOrigin, previewSearch, viewHash)
|
|
1161
|
+
}));
|
|
1162
|
+
let previewSrc = preview.src;
|
|
1163
|
+
if (preview.search !== previewSearch || preview.appOrigin !== appOrigin) {
|
|
1164
|
+
previewSrc = buildEmbedSrc(appOrigin, previewSearch, viewHash);
|
|
1165
|
+
setPreview({
|
|
1166
|
+
appOrigin,
|
|
1167
|
+
search: previewSearch,
|
|
1168
|
+
src: previewSrc
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
if (unpublished && itineraryId !== null) return /* @__PURE__ */ jsx(UnpublishedPanel, {
|
|
1172
|
+
itineraryId,
|
|
1173
|
+
organizationId
|
|
1174
|
+
});
|
|
1175
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [dirty && itineraryId !== null ? /* @__PURE__ */ jsx(PublicationNotice, {
|
|
1176
|
+
itineraryId,
|
|
1177
|
+
organizationId,
|
|
1178
|
+
state: "dirty"
|
|
1179
|
+
}) : null, /* @__PURE__ */ jsx(Box, {
|
|
1180
|
+
flex: 1,
|
|
1181
|
+
mih: 0,
|
|
1182
|
+
pt: dirty && itineraryId !== null ? "sm" : 0,
|
|
1183
|
+
style: previewFrameStyle,
|
|
1184
|
+
children: /* @__PURE__ */ jsx("iframe", {
|
|
1185
|
+
ref: (el) => {
|
|
1186
|
+
onPreviewWindow(el?.contentWindow ?? null);
|
|
1187
|
+
},
|
|
1188
|
+
src: previewSrc,
|
|
1189
|
+
style: previewIframeStyle,
|
|
1190
|
+
title: words.embed.preview.title(name)
|
|
1191
|
+
})
|
|
1192
|
+
})] });
|
|
1193
|
+
};
|
|
1194
|
+
const EmbedTableStage = ({ element, itineraryId, language, length, options, organizationId, publication }) => {
|
|
1195
|
+
const words = useStudioScopedStrings(SECTIONS$1);
|
|
1196
|
+
if (publication === "loading") return /* @__PURE__ */ jsx(Center, {
|
|
1197
|
+
flex: 1,
|
|
1198
|
+
p: "xl",
|
|
1199
|
+
children: /* @__PURE__ */ jsx(Loader, {})
|
|
1200
|
+
});
|
|
1201
|
+
if (itineraryId === null) return /* @__PURE__ */ jsx(Center, {
|
|
1202
|
+
flex: 1,
|
|
1203
|
+
p: "xl",
|
|
1204
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
1205
|
+
icon: /* @__PURE__ */ jsx(Glyph$1, {
|
|
1206
|
+
name: "itinerary",
|
|
1207
|
+
size: iconSizes.lg
|
|
1208
|
+
}),
|
|
1209
|
+
title: words.embed.itinerary.pickerEmpty
|
|
1210
|
+
})
|
|
1211
|
+
});
|
|
1212
|
+
if (publication === "unpublished") return /* @__PURE__ */ jsx(UnpublishedPanel, {
|
|
1213
|
+
itineraryId,
|
|
1214
|
+
organizationId
|
|
1215
|
+
});
|
|
1216
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
1217
|
+
className: "mtya-embed-table-stage",
|
|
1218
|
+
children: /* @__PURE__ */ jsxs(Box, {
|
|
1219
|
+
className: "mtya-embed-table-frame",
|
|
1220
|
+
children: [publication === "dirty" ? /* @__PURE__ */ jsx(Box, {
|
|
1221
|
+
mb: "sm",
|
|
1222
|
+
children: /* @__PURE__ */ jsx(PublicationNotice, {
|
|
1223
|
+
itineraryId,
|
|
1224
|
+
organizationId,
|
|
1225
|
+
state: "dirty"
|
|
1226
|
+
})
|
|
1227
|
+
}) : null, /* @__PURE__ */ jsx(Suspense, {
|
|
1228
|
+
fallback: /* @__PURE__ */ jsx(Center, {
|
|
1229
|
+
flex: 1,
|
|
1230
|
+
p: "xl",
|
|
1231
|
+
children: /* @__PURE__ */ jsx(Loader, {})
|
|
1232
|
+
}),
|
|
1233
|
+
children: /* @__PURE__ */ jsx(EmbedTablePreview, {
|
|
1234
|
+
element,
|
|
1235
|
+
itineraryId,
|
|
1236
|
+
language,
|
|
1237
|
+
length,
|
|
1238
|
+
options
|
|
1239
|
+
})
|
|
1240
|
+
})]
|
|
1241
|
+
})
|
|
1242
|
+
});
|
|
1243
|
+
};
|
|
1244
|
+
const EmbedStage = ({ element, tableItineraryId, tablePublication, tables, ...map }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Box, {
|
|
1245
|
+
className: "mtya-fullscreen-stage",
|
|
1246
|
+
flex: 1,
|
|
1247
|
+
p: "md",
|
|
1248
|
+
style: isEmbedTableElement(element) ? hiddenStyle : void 0,
|
|
1249
|
+
children: /* @__PURE__ */ jsx(EmbedMapPreview, { ...map })
|
|
1250
|
+
}), isEmbedTableElement(element) ? /* @__PURE__ */ jsx(EmbedTableStage, {
|
|
1251
|
+
element,
|
|
1252
|
+
itineraryId: tableItineraryId,
|
|
1253
|
+
language: map.config.preferredLanguage,
|
|
1254
|
+
length: map.config.preferredUnitLength,
|
|
1255
|
+
options: tables,
|
|
1256
|
+
organizationId: map.organizationId,
|
|
1257
|
+
publication: tablePublication
|
|
1258
|
+
}) : null] });
|
|
1259
|
+
const SECTIONS = [
|
|
1260
|
+
"actions",
|
|
1261
|
+
"controls",
|
|
1262
|
+
"embed",
|
|
1263
|
+
"preferences",
|
|
1264
|
+
"privacy",
|
|
1265
|
+
"publish"
|
|
1266
|
+
];
|
|
1267
|
+
const sectionGlyphs = {
|
|
1268
|
+
appearance: "appearance",
|
|
1269
|
+
code: "action-copy",
|
|
1270
|
+
columns: "menu",
|
|
1271
|
+
controls: "controls",
|
|
1272
|
+
defaultView: "default-view",
|
|
1273
|
+
general: "info",
|
|
1274
|
+
layers: "layers",
|
|
1275
|
+
profile: "profile"
|
|
1276
|
+
};
|
|
1277
|
+
const inertEmbedOrganization = {
|
|
1278
|
+
found: true,
|
|
1279
|
+
pending: false
|
|
1280
|
+
};
|
|
1281
|
+
const inertEmbedKeys = { keys: [] };
|
|
1282
|
+
const EmbedWizardBody = ({ defaults, isPrivate, keys, itinerarySubject, name, organizationId, publication, requireSessionToken, safetyRules, target }) => {
|
|
1283
|
+
const itineraryId = target.kind === "itinerary" ? target.id : void 0;
|
|
1284
|
+
const words = useStudioScopedStrings(SECTIONS);
|
|
1285
|
+
const { dispatch } = useStudioDispatch();
|
|
1286
|
+
const sectionsId = useId$1();
|
|
1287
|
+
const clampedDefaults = useMemo(() => clampConfigToFieldDependencies(clampConfigToSafetyRules(defaults, safetyRules)), [defaults, safetyRules]);
|
|
1288
|
+
const [config, setConfig] = useState(clampedDefaults);
|
|
1289
|
+
const [tables, setTables] = useState(defaultEmbedTableOptions);
|
|
1290
|
+
const [element, setElement] = useState("map");
|
|
1291
|
+
const [chosenSection, setChosenSection] = useState(null);
|
|
1292
|
+
const [chosenKey, setChosenKey] = useState(null);
|
|
1293
|
+
const [collectionId, setCollectionId] = useState(null);
|
|
1294
|
+
const [chosenItineraryId, setChosenItineraryId] = useState(null);
|
|
1295
|
+
const [defaultView, setDefaultView] = useState(emptyDefaultView);
|
|
1296
|
+
const publishableKey = keys.keys.find((key) => key.key === chosenKey)?.key ?? keys.keys[0]?.key ?? null;
|
|
1297
|
+
const previewCamera = useEmbedPreviewCamera();
|
|
1298
|
+
const captureDefaultView = useCallback(async () => {
|
|
1299
|
+
const view = await previewCamera.requestCamera();
|
|
1300
|
+
if (view) setDefaultView({
|
|
1301
|
+
bearing: view.bearing ?? null,
|
|
1302
|
+
center: view.center ?? null,
|
|
1303
|
+
pitch: view.pitch ?? null,
|
|
1304
|
+
zoom: view.zoom ?? null
|
|
1305
|
+
});
|
|
1306
|
+
}, [previewCamera]);
|
|
1307
|
+
const layerOptions = useEmbedLayerOptions(config, safetyRules, organizationId);
|
|
1308
|
+
const patchConfig = useCallback((patch) => setConfig((current) => clampConfigToFieldDependencies(clampConfigToSafetyRules({
|
|
1309
|
+
...current,
|
|
1310
|
+
...patch
|
|
1311
|
+
}, safetyRules))), [safetyRules]);
|
|
1312
|
+
const onClose = () => {
|
|
1313
|
+
dispatch("studio.embed.close", {});
|
|
1314
|
+
};
|
|
1315
|
+
const collection = useEmbedCollectionItineraries(itineraryId === void 0 ? target.id : void 0);
|
|
1316
|
+
const tableItineraryId = itineraryId ?? (collection.itineraries.find((itinerary) => itinerary.id === chosenItineraryId) ?? collection.itineraries[0])?.id ?? null;
|
|
1317
|
+
const table = isEmbedTableElement(element);
|
|
1318
|
+
const chosenDraft = useStudioItinerary(itineraryId === void 0 && table ? tableItineraryId ?? void 0 : void 0);
|
|
1319
|
+
const listingPending = itineraryId === void 0 && table && collection.pending;
|
|
1320
|
+
const tablePublication = itineraryId !== void 0 ? publication : listingPending ? "loading" : tableItineraryId === null ? "published" : publicationStateOf(chosenDraft.data, chosenDraft.isError);
|
|
1321
|
+
const sections = useMemo(() => embedElementSections(element, itineraryId !== void 0 || table), [
|
|
1322
|
+
element,
|
|
1323
|
+
itineraryId,
|
|
1324
|
+
table
|
|
1325
|
+
]);
|
|
1326
|
+
const section = sections.find((candidate) => candidate === chosenSection) ?? sections[0] ?? "code";
|
|
1327
|
+
const code = useEmbedCode({
|
|
1328
|
+
collectionId: target.kind === "collection" ? target.id : collectionId,
|
|
1329
|
+
config,
|
|
1330
|
+
defaultView,
|
|
1331
|
+
defaults: clampedDefaults,
|
|
1332
|
+
element,
|
|
1333
|
+
itineraryId: itineraryId ?? null,
|
|
1334
|
+
name,
|
|
1335
|
+
publishableKey,
|
|
1336
|
+
requireSessionToken,
|
|
1337
|
+
tableItineraryId,
|
|
1338
|
+
tables
|
|
1339
|
+
});
|
|
1340
|
+
const unpublished = (table ? tablePublication : publication) === "unpublished";
|
|
1341
|
+
const copyable = unpublished ? null : code;
|
|
1342
|
+
const domains = safetyRules?.domains;
|
|
1343
|
+
const localOnly = domains !== void 0 && domains.length > 0 && domains.every((entry) => isLoopbackDomain(entry));
|
|
1344
|
+
const noSite = domains !== void 0 && (domains.length === 0 || localOnly);
|
|
1345
|
+
const noSiteWords = localOnly ? table ? {
|
|
1346
|
+
status: words.embed.status.tableNoLiveSite,
|
|
1347
|
+
title: words.embed.domains.tableLocalOnly.title
|
|
1348
|
+
} : {
|
|
1349
|
+
status: words.embed.status.noLiveSite,
|
|
1350
|
+
title: words.embed.domains.embedLocalOnly.title
|
|
1351
|
+
} : table ? {
|
|
1352
|
+
status: words.embed.status.tableNoSite,
|
|
1353
|
+
title: words.embed.domains.tableNone.title
|
|
1354
|
+
} : {
|
|
1355
|
+
status: words.embed.status.noSite,
|
|
1356
|
+
title: words.embed.domains.embedNone.title
|
|
1357
|
+
};
|
|
1358
|
+
const withheld = unpublished ? words.embed.status.unpublished : publishableKey === null ? words.embed.gated.noKey.description : copyable === null ? listingPending ? words.publish.loading : words.embed.itinerary.pickerEmpty : null;
|
|
1359
|
+
const standing = withheld ?? (noSite ? noSiteWords.status : table ? words.embed.status.table : words.embed.status.map);
|
|
1360
|
+
const changesIn = (id) => {
|
|
1361
|
+
switch (id) {
|
|
1362
|
+
case "appearance":
|
|
1363
|
+
case "controls":
|
|
1364
|
+
case "layers":
|
|
1365
|
+
case "profile": return embedSectionChanges(element, id, config, clampedDefaults);
|
|
1366
|
+
case "columns": return table ? embedTableChanges(element, tables) : 0;
|
|
1367
|
+
case "defaultView": return defaultView.center === null && defaultView.zoom === null ? 0 : 1;
|
|
1368
|
+
default: return 0;
|
|
1369
|
+
}
|
|
1370
|
+
};
|
|
1371
|
+
const entries = sections.map((id) => {
|
|
1372
|
+
const changes = changesIn(id);
|
|
1373
|
+
const attention = id === "code" && !listingPending ? withheld ?? (noSite ? noSiteWords.title : null) : null;
|
|
1374
|
+
return {
|
|
1375
|
+
glyph: sectionGlyphs[id],
|
|
1376
|
+
id,
|
|
1377
|
+
label: words.embed.sections[id],
|
|
1378
|
+
status: attention !== null ? {
|
|
1379
|
+
description: attention,
|
|
1380
|
+
kind: "attention"
|
|
1381
|
+
} : changes > 0 ? {
|
|
1382
|
+
count: changes,
|
|
1383
|
+
description: words.embed.sectionChanges(changes),
|
|
1384
|
+
kind: "count"
|
|
1385
|
+
} : void 0
|
|
1386
|
+
};
|
|
1387
|
+
});
|
|
1388
|
+
const panelOf = (id) => {
|
|
1389
|
+
switch (id) {
|
|
1390
|
+
case "general": return /* @__PURE__ */ jsx(EmbedGeneralSection, {
|
|
1391
|
+
collectionId,
|
|
1392
|
+
element,
|
|
1393
|
+
isPrivate,
|
|
1394
|
+
itineraries: collection.itineraries,
|
|
1395
|
+
itinerariesPending: collection.pending,
|
|
1396
|
+
itineraryId,
|
|
1397
|
+
onCollectionIdChange: setCollectionId,
|
|
1398
|
+
onTableItineraryIdChange: setChosenItineraryId,
|
|
1399
|
+
organizationId,
|
|
1400
|
+
tableItineraryId
|
|
1401
|
+
});
|
|
1402
|
+
case "defaultView": return /* @__PURE__ */ jsx(EmbedDefaultViewSection, {
|
|
1403
|
+
defaultView,
|
|
1404
|
+
onCaptureCamera: captureDefaultView,
|
|
1405
|
+
onDefaultViewReset: () => setDefaultView(emptyDefaultView)
|
|
1406
|
+
});
|
|
1407
|
+
case "columns": return table ? /* @__PURE__ */ jsx(EmbedColumnsSection, {
|
|
1408
|
+
element,
|
|
1409
|
+
onChange: setTables,
|
|
1410
|
+
options: tables
|
|
1411
|
+
}) : null;
|
|
1412
|
+
case "code": return /* @__PURE__ */ jsx(EmbedCodeSection, {
|
|
1413
|
+
code: copyable,
|
|
1414
|
+
domains,
|
|
1415
|
+
element,
|
|
1416
|
+
keys,
|
|
1417
|
+
onPublishableKeyChange: setChosenKey,
|
|
1418
|
+
publishableKey,
|
|
1419
|
+
requireSessionToken,
|
|
1420
|
+
withheld
|
|
1421
|
+
});
|
|
1422
|
+
default: return /* @__PURE__ */ jsx(EmbedConfigForm, {
|
|
1423
|
+
config,
|
|
1424
|
+
defaults: clampedDefaults,
|
|
1425
|
+
element,
|
|
1426
|
+
layerOptions,
|
|
1427
|
+
onPatch: patchConfig,
|
|
1428
|
+
safetyRules,
|
|
1429
|
+
section: id
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
return /* @__PURE__ */ jsx(WizardLayout, {
|
|
1434
|
+
footer: /* @__PURE__ */ jsx(Box, {
|
|
1435
|
+
className: "mtya-fullscreen-footer",
|
|
1436
|
+
px: "md",
|
|
1437
|
+
py: "sm",
|
|
1438
|
+
children: /* @__PURE__ */ jsxs(Group, {
|
|
1439
|
+
gap: "sm",
|
|
1440
|
+
justify: "space-between",
|
|
1441
|
+
wrap: "nowrap",
|
|
1442
|
+
children: [/* @__PURE__ */ jsxs(Group, {
|
|
1443
|
+
flex: 1,
|
|
1444
|
+
gap: "xs",
|
|
1445
|
+
miw: 0,
|
|
1446
|
+
wrap: "nowrap",
|
|
1447
|
+
children: [withheld === null && noSite ? /* @__PURE__ */ jsx(Box, {
|
|
1448
|
+
c: "orange",
|
|
1449
|
+
className: "mtya-embed-status-mark",
|
|
1450
|
+
children: /* @__PURE__ */ jsx(Glyph$1, {
|
|
1451
|
+
name: "warning",
|
|
1452
|
+
size: iconSizes.sm
|
|
1453
|
+
})
|
|
1454
|
+
}) : null, /* @__PURE__ */ jsx(Text, {
|
|
1455
|
+
"aria-live": "polite",
|
|
1456
|
+
c: "dimmed",
|
|
1457
|
+
flex: 1,
|
|
1458
|
+
lineClamp: 3,
|
|
1459
|
+
miw: 0,
|
|
1460
|
+
size: "xs",
|
|
1461
|
+
children: standing
|
|
1462
|
+
})]
|
|
1463
|
+
}), copyable === null ? /* @__PURE__ */ jsx(Tooltip, {
|
|
1464
|
+
label: withheld,
|
|
1465
|
+
position: "top",
|
|
1466
|
+
withinPortal: true,
|
|
1467
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Button, {
|
|
1468
|
+
disabled: true,
|
|
1469
|
+
leftSection: /* @__PURE__ */ jsx(Glyph$1, {
|
|
1470
|
+
name: "action-copy",
|
|
1471
|
+
size: iconSizes.sm
|
|
1472
|
+
}),
|
|
1473
|
+
children: words.embed.code.copy
|
|
1474
|
+
}) })
|
|
1475
|
+
}) : /* @__PURE__ */ jsx(CopyButton, {
|
|
1476
|
+
value: copyable.code,
|
|
1477
|
+
children: ({ copied, copy }) => /* @__PURE__ */ jsx(Button, {
|
|
1478
|
+
color: copied ? "teal" : void 0,
|
|
1479
|
+
leftSection: copied ? /* @__PURE__ */ jsx(Glyph$1, {
|
|
1480
|
+
name: "check",
|
|
1481
|
+
size: iconSizes.sm
|
|
1482
|
+
}) : /* @__PURE__ */ jsx(Glyph$1, {
|
|
1483
|
+
name: "action-copy",
|
|
1484
|
+
size: iconSizes.sm
|
|
1485
|
+
}),
|
|
1486
|
+
onClick: copy,
|
|
1487
|
+
children: copied ? words.embed.code.copied : words.embed.code.copy
|
|
1488
|
+
})
|
|
1489
|
+
})]
|
|
1490
|
+
})
|
|
1491
|
+
}),
|
|
1492
|
+
header: /* @__PURE__ */ jsx(FullscreenHeader, {
|
|
1493
|
+
closeLabel: words.actions.close,
|
|
1494
|
+
onClose,
|
|
1495
|
+
subject: itinerarySubject ? /* @__PURE__ */ jsx(DialogSubject, { ...itinerarySubject }) : /* @__PURE__ */ jsx(DialogSubject, { name }),
|
|
1496
|
+
title: words.embed.title
|
|
1497
|
+
}),
|
|
1498
|
+
id: sectionsId,
|
|
1499
|
+
onChange: setChosenSection,
|
|
1500
|
+
panel: sections.map((id) => /* @__PURE__ */ jsx(Tabs.Panel, {
|
|
1501
|
+
value: id,
|
|
1502
|
+
children: panelOf(id)
|
|
1503
|
+
}, id)),
|
|
1504
|
+
rail: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(EmbedElementSwitcher, {
|
|
1505
|
+
onChange: setElement,
|
|
1506
|
+
value: element
|
|
1507
|
+
}), /* @__PURE__ */ jsx(SectionNav, {
|
|
1508
|
+
ariaLabel: words.embed.sectionsLabel,
|
|
1509
|
+
entries,
|
|
1510
|
+
id: sectionsId,
|
|
1511
|
+
value: section
|
|
1512
|
+
})] }),
|
|
1513
|
+
sectionLayout: section === "code" ? "page" : "split",
|
|
1514
|
+
sections,
|
|
1515
|
+
stageAriaLabel: words.embed.stageLabel,
|
|
1516
|
+
value: section,
|
|
1517
|
+
children: /* @__PURE__ */ jsx(EmbedStage, {
|
|
1518
|
+
collectionId: target.kind === "collection" ? target.id : collectionId,
|
|
1519
|
+
config,
|
|
1520
|
+
defaults: clampedDefaults,
|
|
1521
|
+
defaultView,
|
|
1522
|
+
dirty: publication === "dirty",
|
|
1523
|
+
element,
|
|
1524
|
+
itineraryId: itineraryId ?? null,
|
|
1525
|
+
name,
|
|
1526
|
+
onPreviewWindow: previewCamera.registerPreviewWindow,
|
|
1527
|
+
organizationId,
|
|
1528
|
+
publishableKey,
|
|
1529
|
+
tableItineraryId,
|
|
1530
|
+
tablePublication,
|
|
1531
|
+
tables,
|
|
1532
|
+
unpublished: publication === "unpublished"
|
|
1533
|
+
})
|
|
1534
|
+
});
|
|
1535
|
+
};
|
|
1536
|
+
const EmbedWizardStatus = ({ children }) => {
|
|
1537
|
+
const words = useStudioScopedStrings(SECTIONS);
|
|
1538
|
+
const { dispatch } = useStudioDispatch();
|
|
1539
|
+
const onClose = () => {
|
|
1540
|
+
dispatch("studio.embed.close", {});
|
|
1541
|
+
};
|
|
1542
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FullscreenHeader, {
|
|
1543
|
+
closeLabel: words.actions.close,
|
|
1544
|
+
onClose,
|
|
1545
|
+
title: words.embed.title
|
|
1546
|
+
}), /* @__PURE__ */ jsx(Center, {
|
|
1547
|
+
flex: 1,
|
|
1548
|
+
p: "xl",
|
|
1549
|
+
children
|
|
1550
|
+
})] });
|
|
1551
|
+
};
|
|
1552
|
+
const EmbedWizardLoader = () => /* @__PURE__ */ jsx(EmbedWizardStatus, { children: /* @__PURE__ */ jsx(Loader, {}) });
|
|
1553
|
+
const EmbedWizardRefusal = ({ target }) => {
|
|
1554
|
+
const words = useStudioScopedStrings(SECTIONS);
|
|
1555
|
+
return /* @__PURE__ */ jsx(EmbedWizardStatus, { children: /* @__PURE__ */ jsx(Alert, {
|
|
1556
|
+
color: "gray",
|
|
1557
|
+
maw: 420,
|
|
1558
|
+
children: target.kind === "collection" ? words.embed.notEmbeddableCollection : words.embed.notEmbeddable
|
|
1559
|
+
}) });
|
|
1560
|
+
};
|
|
1561
|
+
const EmbedWizardNotOffered = () => {
|
|
1562
|
+
const words = useStudioScopedStrings(SECTIONS);
|
|
1563
|
+
return /* @__PURE__ */ jsx(EmbedWizardStatus, { children: /* @__PURE__ */ jsx(Alert, {
|
|
1564
|
+
color: "gray",
|
|
1565
|
+
maw: 420,
|
|
1566
|
+
children: words.embed.notOffered
|
|
1567
|
+
}) });
|
|
1568
|
+
};
|
|
1569
|
+
const EmbedWizardLoadFailure = () => {
|
|
1570
|
+
const words = useStudioScopedStrings(SECTIONS);
|
|
1571
|
+
return /* @__PURE__ */ jsx(EmbedWizardStatus, { children: /* @__PURE__ */ jsx(Alert, {
|
|
1572
|
+
color: "red",
|
|
1573
|
+
maw: 420,
|
|
1574
|
+
children: words.embed.targetLoadFailed
|
|
1575
|
+
}) });
|
|
1576
|
+
};
|
|
1577
|
+
const EmbedWizardOwner = ({ isPrivate, itinerarySubject, name, organizationId, publication, target, useKeys, useOrganization }) => {
|
|
1578
|
+
const org = useOrganization?.(organizationId) ?? inertEmbedOrganization;
|
|
1579
|
+
const embedKeys = useKeys?.(organizationId) ?? inertEmbedKeys;
|
|
1580
|
+
const defaults = useMemo(() => resolveOrgEmbedDefaults(org.defaults), [org.defaults]);
|
|
1581
|
+
if (org.pending) return /* @__PURE__ */ jsx(EmbedWizardLoader, {});
|
|
1582
|
+
if (!org.found) return /* @__PURE__ */ jsx(EmbedWizardRefusal, { target });
|
|
1583
|
+
return /* @__PURE__ */ jsx(EmbedWizardBody, {
|
|
1584
|
+
defaults,
|
|
1585
|
+
isPrivate,
|
|
1586
|
+
itinerarySubject,
|
|
1587
|
+
keys: embedKeys,
|
|
1588
|
+
name,
|
|
1589
|
+
organizationId,
|
|
1590
|
+
publication,
|
|
1591
|
+
requireSessionToken: Boolean(org.safetyRules?.require_session_token),
|
|
1592
|
+
safetyRules: org.safetyRules,
|
|
1593
|
+
target
|
|
1594
|
+
});
|
|
1595
|
+
};
|
|
1596
|
+
const EmbedWizard = ({ strings, target, useKeys, useOrganization }) => {
|
|
1597
|
+
const words = useStudioScopedStrings(SECTIONS, strings);
|
|
1598
|
+
const { dispatch } = useStudioDispatch();
|
|
1599
|
+
const embeddedStudio = useEmbeddedStudio();
|
|
1600
|
+
const itineraryId = !embeddedStudio && target.kind === "itinerary" ? target.id : void 0;
|
|
1601
|
+
const collectionId = !embeddedStudio && target.kind === "collection" ? target.id : void 0;
|
|
1602
|
+
const { data: itinerary, isError: itineraryFailed, isLoading: itineraryLoading } = useStudioItinerary(itineraryId);
|
|
1603
|
+
const { data: collection, isError: collectionFailed, isLoading: collectionLoading } = useCollection(collectionId);
|
|
1604
|
+
const itinerarySubject = useItinerarySubjectById(itineraryId);
|
|
1605
|
+
const resolved = collection ? {
|
|
1606
|
+
isPrivate: collection.is_private,
|
|
1607
|
+
name: collection.name,
|
|
1608
|
+
organizationId: collection.organization_id,
|
|
1609
|
+
publication: "published"
|
|
1610
|
+
} : itinerary ? {
|
|
1611
|
+
isPrivate: itinerary.is_private,
|
|
1612
|
+
name: itinerary.name,
|
|
1613
|
+
organizationId: itinerary.organization_id,
|
|
1614
|
+
publication: publicationStateOf(itinerary)
|
|
1615
|
+
} : null;
|
|
1616
|
+
const ownerId = usePublishableScope(resolved?.organizationId) && resolved?.organizationId ? resolved.organizationId : null;
|
|
1617
|
+
const loading = itineraryLoading || collectionLoading;
|
|
1618
|
+
const loadFailed = resolved === null && (itineraryFailed || collectionFailed);
|
|
1619
|
+
const onClose = () => {
|
|
1620
|
+
dispatch("studio.embed.close", {});
|
|
1621
|
+
};
|
|
1622
|
+
return /* @__PURE__ */ jsx(StudioStringsScope, {
|
|
1623
|
+
sections: SECTIONS,
|
|
1624
|
+
strings,
|
|
1625
|
+
children: /* @__PURE__ */ jsx(FullscreenModal, {
|
|
1626
|
+
ariaLabel: words.embed.title,
|
|
1627
|
+
onClose,
|
|
1628
|
+
children: embeddedStudio ? /* @__PURE__ */ jsx(EmbedWizardNotOffered, {}) : loading ? /* @__PURE__ */ jsx(EmbedWizardLoader, {}) : loadFailed ? /* @__PURE__ */ jsx(EmbedWizardLoadFailure, {}) : !resolved || ownerId === null ? /* @__PURE__ */ jsx(EmbedWizardRefusal, { target }) : /* @__PURE__ */ jsx(EmbedWizardOwner, {
|
|
1629
|
+
isPrivate: resolved.isPrivate,
|
|
1630
|
+
itinerarySubject,
|
|
1631
|
+
name: resolved.name,
|
|
1632
|
+
organizationId: ownerId,
|
|
1633
|
+
publication: resolved.publication,
|
|
1634
|
+
target,
|
|
1635
|
+
useKeys,
|
|
1636
|
+
useOrganization
|
|
1637
|
+
}, `${target.kind}:${target.id}:${ownerId}`)
|
|
1638
|
+
})
|
|
1639
|
+
});
|
|
1640
|
+
};
|
|
1641
|
+
export { EmbedBaseMapPicker, EmbedFieldControl, EmbedThemePicker, EmbedTintPicker, EmbedToggleSwitch, EmbedWizard };
|
|
1642
|
+
|
|
1643
|
+
//# sourceMappingURL=index.js.map
|