@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.
Files changed (976) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/LICENCE.fr.txt +280 -0
  3. package/LICENSE.txt +262 -0
  4. package/README.md +1087 -2
  5. package/THIRD-PARTY-NOTICES.txt +149 -0
  6. package/dist/chunk--VSQcEs_.cjs +26 -0
  7. package/dist/chunk--VSQcEs_.cjs.map +1 -0
  8. package/dist/chunk-0qoALFfx.cjs +454 -0
  9. package/dist/chunk-0qoALFfx.cjs.map +1 -0
  10. package/dist/chunk-0sHgX8We.cjs +97 -0
  11. package/dist/chunk-0sHgX8We.cjs.map +1 -0
  12. package/dist/chunk-4D4as_tP.js +16 -0
  13. package/dist/chunk-4D4as_tP.js.map +1 -0
  14. package/dist/chunk-6LM6wuIg.cjs +13 -0
  15. package/dist/chunk-6LM6wuIg.cjs.map +1 -0
  16. package/dist/chunk-6VpwF-77.js +7 -0
  17. package/dist/chunk-6VpwF-77.js.map +1 -0
  18. package/dist/chunk-6v2fJIDh.cjs +28 -0
  19. package/dist/chunk-6v2fJIDh.cjs.map +1 -0
  20. package/dist/chunk-Af0f-OjN.js +71 -0
  21. package/dist/chunk-Af0f-OjN.js.map +1 -0
  22. package/dist/chunk-B-QQkaWk.js +91 -0
  23. package/dist/chunk-B-QQkaWk.js.map +1 -0
  24. package/dist/chunk-B1lX5w6I.cjs +181 -0
  25. package/dist/chunk-B1lX5w6I.cjs.map +1 -0
  26. package/dist/chunk-B2gsz9OJ.js +19 -0
  27. package/dist/chunk-B2gsz9OJ.js.map +1 -0
  28. package/dist/chunk-B38srE2R.d.cts +3976 -0
  29. package/dist/chunk-B3HdxIq7.js +69 -0
  30. package/dist/chunk-B3HdxIq7.js.map +1 -0
  31. package/dist/chunk-B3UCX3Wd.js +30 -0
  32. package/dist/chunk-B3UCX3Wd.js.map +1 -0
  33. package/dist/chunk-B3mMYMtz.cjs +88 -0
  34. package/dist/chunk-B3mMYMtz.cjs.map +1 -0
  35. package/dist/chunk-B7D0neNQ.cjs +47 -0
  36. package/dist/chunk-B7D0neNQ.cjs.map +1 -0
  37. package/dist/chunk-B7UzNwmm.cjs +115 -0
  38. package/dist/chunk-B7UzNwmm.cjs.map +1 -0
  39. package/dist/chunk-B7d3NIaH.js +55 -0
  40. package/dist/chunk-B7d3NIaH.js.map +1 -0
  41. package/dist/chunk-B8ONCPFQ.cjs +70 -0
  42. package/dist/chunk-B8ONCPFQ.cjs.map +1 -0
  43. package/dist/chunk-B8QgG-RT.js +2232 -0
  44. package/dist/chunk-B8QgG-RT.js.map +1 -0
  45. package/dist/chunk-B8ZpXH0_.cjs +64 -0
  46. package/dist/chunk-B8ZpXH0_.cjs.map +1 -0
  47. package/dist/chunk-B8mS5bGc.cjs +112 -0
  48. package/dist/chunk-B8mS5bGc.cjs.map +1 -0
  49. package/dist/chunk-B9EkHHSU.js +40 -0
  50. package/dist/chunk-B9EkHHSU.js.map +1 -0
  51. package/dist/chunk-BA0PWNyn.js +234 -0
  52. package/dist/chunk-BA0PWNyn.js.map +1 -0
  53. package/dist/chunk-BAWE1gqe.js +60 -0
  54. package/dist/chunk-BAWE1gqe.js.map +1 -0
  55. package/dist/chunk-BAe9m2Yp.d.cts +963 -0
  56. package/dist/chunk-BDJCk6ml.js +19 -0
  57. package/dist/chunk-BDJCk6ml.js.map +1 -0
  58. package/dist/chunk-BFI2CR6j.cjs +381 -0
  59. package/dist/chunk-BFI2CR6j.cjs.map +1 -0
  60. package/dist/chunk-BIIJXiiS.js +40 -0
  61. package/dist/chunk-BIIJXiiS.js.map +1 -0
  62. package/dist/chunk-BJAn10wR.js +54 -0
  63. package/dist/chunk-BJAn10wR.js.map +1 -0
  64. package/dist/chunk-BLxPxx5p.js +1641 -0
  65. package/dist/chunk-BLxPxx5p.js.map +1 -0
  66. package/dist/chunk-BNSJoNwO.cjs +377 -0
  67. package/dist/chunk-BNSJoNwO.cjs.map +1 -0
  68. package/dist/chunk-BNTshA5u.js +304 -0
  69. package/dist/chunk-BNTshA5u.js.map +1 -0
  70. package/dist/chunk-BO_yHMn2.js +7 -0
  71. package/dist/chunk-BO_yHMn2.js.map +1 -0
  72. package/dist/chunk-BOpIVklq.cjs +23 -0
  73. package/dist/chunk-BOpIVklq.cjs.map +1 -0
  74. package/dist/chunk-BP8bHGiE.cjs +12 -0
  75. package/dist/chunk-BP8bHGiE.cjs.map +1 -0
  76. package/dist/chunk-BPsgx3c7.js +56 -0
  77. package/dist/chunk-BPsgx3c7.js.map +1 -0
  78. package/dist/chunk-BQkKY_kf.js +44 -0
  79. package/dist/chunk-BQkKY_kf.js.map +1 -0
  80. package/dist/chunk-BQoAEKyJ.js +193 -0
  81. package/dist/chunk-BQoAEKyJ.js.map +1 -0
  82. package/dist/chunk-BRuLc45I.cjs +21 -0
  83. package/dist/chunk-BRuLc45I.cjs.map +1 -0
  84. package/dist/chunk-BSnrqsA8.cjs +56 -0
  85. package/dist/chunk-BSnrqsA8.cjs.map +1 -0
  86. package/dist/chunk-BTDBomKm.cjs +80 -0
  87. package/dist/chunk-BTDBomKm.cjs.map +1 -0
  88. package/dist/chunk-BVogYy0R.js +375 -0
  89. package/dist/chunk-BVogYy0R.js.map +1 -0
  90. package/dist/chunk-BWITLmlf.js +6 -0
  91. package/dist/chunk-BWITLmlf.js.map +1 -0
  92. package/dist/chunk-BXUrvYqd.d.cts +112 -0
  93. package/dist/chunk-BXUrvYqd.d.ts +112 -0
  94. package/dist/chunk-BYzQfFFV.js +54 -0
  95. package/dist/chunk-BYzQfFFV.js.map +1 -0
  96. package/dist/chunk-BZCKMlN8.js +35 -0
  97. package/dist/chunk-BZCKMlN8.js.map +1 -0
  98. package/dist/chunk-BalPERFX.js +13 -0
  99. package/dist/chunk-BalPERFX.js.map +1 -0
  100. package/dist/chunk-Bb5SAw6T.cjs +72 -0
  101. package/dist/chunk-Bb5SAw6T.cjs.map +1 -0
  102. package/dist/chunk-BbQyoetL.cjs +269 -0
  103. package/dist/chunk-BbQyoetL.cjs.map +1 -0
  104. package/dist/chunk-BdepwGey.js +600 -0
  105. package/dist/chunk-BdepwGey.js.map +1 -0
  106. package/dist/chunk-BeB57TnZ.js +29 -0
  107. package/dist/chunk-BeB57TnZ.js.map +1 -0
  108. package/dist/chunk-BecxET4U.cjs +26 -0
  109. package/dist/chunk-BecxET4U.cjs.map +1 -0
  110. package/dist/chunk-Bfuu_B7M.js +16 -0
  111. package/dist/chunk-Bfuu_B7M.js.map +1 -0
  112. package/dist/chunk-Bh4xSiDO.js +93 -0
  113. package/dist/chunk-Bh4xSiDO.js.map +1 -0
  114. package/dist/chunk-BhLItb06.js +10 -0
  115. package/dist/chunk-BhLItb06.js.map +1 -0
  116. package/dist/chunk-BhelUZ4P.js +30 -0
  117. package/dist/chunk-BhelUZ4P.js.map +1 -0
  118. package/dist/chunk-BiMRpOwB.cjs +342 -0
  119. package/dist/chunk-BiMRpOwB.cjs.map +1 -0
  120. package/dist/chunk-Bj3ium6N.cjs +22 -0
  121. package/dist/chunk-Bj3ium6N.cjs.map +1 -0
  122. package/dist/chunk-BjQzK3c3.cjs +59 -0
  123. package/dist/chunk-BjQzK3c3.cjs.map +1 -0
  124. package/dist/chunk-BkvNTXo7.cjs +15 -0
  125. package/dist/chunk-BkvNTXo7.cjs.map +1 -0
  126. package/dist/chunk-BmJDHIlZ.cjs +50 -0
  127. package/dist/chunk-BmJDHIlZ.cjs.map +1 -0
  128. package/dist/chunk-BmztanwN.cjs +13 -0
  129. package/dist/chunk-BmztanwN.cjs.map +1 -0
  130. package/dist/chunk-Bnci-ej8.cjs +262 -0
  131. package/dist/chunk-Bnci-ej8.cjs.map +1 -0
  132. package/dist/chunk-BoOw05B0.js +24 -0
  133. package/dist/chunk-BoOw05B0.js.map +1 -0
  134. package/dist/chunk-BqPxk-8w.cjs +95 -0
  135. package/dist/chunk-BqPxk-8w.cjs.map +1 -0
  136. package/dist/chunk-Br_1h4WD.cjs +15 -0
  137. package/dist/chunk-Br_1h4WD.cjs.map +1 -0
  138. package/dist/chunk-BtmcBZXU.js +13 -0
  139. package/dist/chunk-BtmcBZXU.js.map +1 -0
  140. package/dist/chunk-BvaNI_86.js +11 -0
  141. package/dist/chunk-BvaNI_86.js.map +1 -0
  142. package/dist/chunk-BvoYNlF5.js +145 -0
  143. package/dist/chunk-BvoYNlF5.js.map +1 -0
  144. package/dist/chunk-BwnCGe7J.js +268 -0
  145. package/dist/chunk-BwnCGe7J.js.map +1 -0
  146. package/dist/chunk-BxpaOkyq.cjs +310 -0
  147. package/dist/chunk-BxpaOkyq.cjs.map +1 -0
  148. package/dist/chunk-BybRyFen.cjs +65 -0
  149. package/dist/chunk-BybRyFen.cjs.map +1 -0
  150. package/dist/chunk-C-9wXKm5.cjs +83 -0
  151. package/dist/chunk-C-9wXKm5.cjs.map +1 -0
  152. package/dist/chunk-C-hV-Usi.js +7 -0
  153. package/dist/chunk-C-hV-Usi.js.map +1 -0
  154. package/dist/chunk-C06UWdDq.js +100 -0
  155. package/dist/chunk-C06UWdDq.js.map +1 -0
  156. package/dist/chunk-C1NzDn7y.cjs +35 -0
  157. package/dist/chunk-C1NzDn7y.cjs.map +1 -0
  158. package/dist/chunk-C2zEVNM1.js +20 -0
  159. package/dist/chunk-C2zEVNM1.js.map +1 -0
  160. package/dist/chunk-C3ftwoOp.js +6 -0
  161. package/dist/chunk-C3ftwoOp.js.map +1 -0
  162. package/dist/chunk-C5ZETobm.js +17 -0
  163. package/dist/chunk-C5ZETobm.js.map +1 -0
  164. package/dist/chunk-C5oCIViv.js +98 -0
  165. package/dist/chunk-C5oCIViv.js.map +1 -0
  166. package/dist/chunk-C60kC4oZ.cjs +114 -0
  167. package/dist/chunk-C60kC4oZ.cjs.map +1 -0
  168. package/dist/chunk-C6Mr3Z8L.js +59 -0
  169. package/dist/chunk-C6Mr3Z8L.js.map +1 -0
  170. package/dist/chunk-C6cBmVch.js +119 -0
  171. package/dist/chunk-C6cBmVch.js.map +1 -0
  172. package/dist/chunk-C6vKd7KP.cjs +519 -0
  173. package/dist/chunk-C6vKd7KP.cjs.map +1 -0
  174. package/dist/chunk-C7NizUxN.js +21 -0
  175. package/dist/chunk-C7NizUxN.js.map +1 -0
  176. package/dist/chunk-C93yeTAD.js +91 -0
  177. package/dist/chunk-C93yeTAD.js.map +1 -0
  178. package/dist/chunk-CByZU6Hx.cjs +90 -0
  179. package/dist/chunk-CByZU6Hx.cjs.map +1 -0
  180. package/dist/chunk-CCNIPIJB.cjs +25 -0
  181. package/dist/chunk-CCNIPIJB.cjs.map +1 -0
  182. package/dist/chunk-CEDKBew2.js +15 -0
  183. package/dist/chunk-CEDKBew2.js.map +1 -0
  184. package/dist/chunk-CI2PEZIK.js +147 -0
  185. package/dist/chunk-CI2PEZIK.js.map +1 -0
  186. package/dist/chunk-CIjPAYuo.cjs +268 -0
  187. package/dist/chunk-CIjPAYuo.cjs.map +1 -0
  188. package/dist/chunk-CJyqD6Ib.js +518 -0
  189. package/dist/chunk-CJyqD6Ib.js.map +1 -0
  190. package/dist/chunk-CNFF8fiL.js +38 -0
  191. package/dist/chunk-CNFF8fiL.js.map +1 -0
  192. package/dist/chunk-CNFoFzhK.cjs +50 -0
  193. package/dist/chunk-CNFoFzhK.cjs.map +1 -0
  194. package/dist/chunk-CQAuAPOE.cjs +63 -0
  195. package/dist/chunk-CQAuAPOE.cjs.map +1 -0
  196. package/dist/chunk-CR46E73M.js +50 -0
  197. package/dist/chunk-CR46E73M.js.map +1 -0
  198. package/dist/chunk-CSq4CbT1.js +86 -0
  199. package/dist/chunk-CSq4CbT1.js.map +1 -0
  200. package/dist/chunk-CT6i9_8G.cjs +31 -0
  201. package/dist/chunk-CT6i9_8G.cjs.map +1 -0
  202. package/dist/chunk-CUKEOil1.cjs +108 -0
  203. package/dist/chunk-CUKEOil1.cjs.map +1 -0
  204. package/dist/chunk-CWxPV2vI.js +111 -0
  205. package/dist/chunk-CWxPV2vI.js.map +1 -0
  206. package/dist/chunk-CXap-mFu.js +50 -0
  207. package/dist/chunk-CXap-mFu.js.map +1 -0
  208. package/dist/chunk-CYx1vTOG.d.ts +69 -0
  209. package/dist/chunk-CZOXtOQp.js +261 -0
  210. package/dist/chunk-CZOXtOQp.js.map +1 -0
  211. package/dist/chunk-CZSBVyE9.js +68 -0
  212. package/dist/chunk-CZSBVyE9.js.map +1 -0
  213. package/dist/chunk-C_NZdnA3.cjs +57 -0
  214. package/dist/chunk-C_NZdnA3.cjs.map +1 -0
  215. package/dist/chunk-C_k4SxhD.js +245 -0
  216. package/dist/chunk-C_k4SxhD.js.map +1 -0
  217. package/dist/chunk-CaTeIppS.cjs +115 -0
  218. package/dist/chunk-CaTeIppS.cjs.map +1 -0
  219. package/dist/chunk-CaUCI-WV.cjs +69 -0
  220. package/dist/chunk-CaUCI-WV.cjs.map +1 -0
  221. package/dist/chunk-CblkEI9o.js +19 -0
  222. package/dist/chunk-CblkEI9o.js.map +1 -0
  223. package/dist/chunk-CcXeCiEQ.js +70 -0
  224. package/dist/chunk-CcXeCiEQ.js.map +1 -0
  225. package/dist/chunk-Ce4D2B8W.cjs +49 -0
  226. package/dist/chunk-Ce4D2B8W.cjs.map +1 -0
  227. package/dist/chunk-CetxbYL1.js +66 -0
  228. package/dist/chunk-CetxbYL1.js.map +1 -0
  229. package/dist/chunk-ClfU9elo.js +68 -0
  230. package/dist/chunk-ClfU9elo.js.map +1 -0
  231. package/dist/chunk-CmNHE_Un.cjs +4 -0
  232. package/dist/chunk-Cmb_XLfd.js +82 -0
  233. package/dist/chunk-Cmb_XLfd.js.map +1 -0
  234. package/dist/chunk-Cp26IdF1.js +72 -0
  235. package/dist/chunk-Cp26IdF1.js.map +1 -0
  236. package/dist/chunk-CsBkSCbR.cjs +92 -0
  237. package/dist/chunk-CsBkSCbR.cjs.map +1 -0
  238. package/dist/chunk-CsnIpELM.js +31 -0
  239. package/dist/chunk-CsnIpELM.js.map +1 -0
  240. package/dist/chunk-CsnJv55G.cjs +36 -0
  241. package/dist/chunk-CsnJv55G.cjs.map +1 -0
  242. package/dist/chunk-CsxHDVHF.cjs +68 -0
  243. package/dist/chunk-CsxHDVHF.cjs.map +1 -0
  244. package/dist/chunk-Cv1FyWmK.js +670 -0
  245. package/dist/chunk-Cv1FyWmK.js.map +1 -0
  246. package/dist/chunk-CwXRQ-3X.cjs +2238 -0
  247. package/dist/chunk-CwXRQ-3X.cjs.map +1 -0
  248. package/dist/chunk-CxC9GaSV.js +6 -0
  249. package/dist/chunk-CxC9GaSV.js.map +1 -0
  250. package/dist/chunk-CyDQK1JF.js +22 -0
  251. package/dist/chunk-CyDQK1JF.js.map +1 -0
  252. package/dist/chunk-CyFo-C-X.js +341 -0
  253. package/dist/chunk-CyFo-C-X.js.map +1 -0
  254. package/dist/chunk-CzGWcm8C.cjs +109 -0
  255. package/dist/chunk-CzGWcm8C.cjs.map +1 -0
  256. package/dist/chunk-D0Cmheqq.cjs +25 -0
  257. package/dist/chunk-D0Cmheqq.cjs.map +1 -0
  258. package/dist/chunk-D0VevtWq.cjs +13 -0
  259. package/dist/chunk-D0VevtWq.cjs.map +1 -0
  260. package/dist/chunk-D1HIZ09h.d.cts +22 -0
  261. package/dist/chunk-D1HIZ09h.d.ts +22 -0
  262. package/dist/chunk-D1PwxEEq.cjs +281 -0
  263. package/dist/chunk-D1PwxEEq.cjs.map +1 -0
  264. package/dist/chunk-D2BipKyx.d.cts +69 -0
  265. package/dist/chunk-D4g36nrI.d.ts +963 -0
  266. package/dist/chunk-D5vZKs5k.js +85 -0
  267. package/dist/chunk-D5vZKs5k.js.map +1 -0
  268. package/dist/chunk-D7XBi__G.js +17 -0
  269. package/dist/chunk-D7XBi__G.js.map +1 -0
  270. package/dist/chunk-D8TsKfym.cjs +35 -0
  271. package/dist/chunk-D8TsKfym.cjs.map +1 -0
  272. package/dist/chunk-D8r50zRF.cjs +4 -0
  273. package/dist/chunk-DAAlHzRS.js +2 -0
  274. package/dist/chunk-DBY6OSNP.js +13 -0
  275. package/dist/chunk-DBY6OSNP.js.map +1 -0
  276. package/dist/chunk-DBfZJAh3.js +146 -0
  277. package/dist/chunk-DBfZJAh3.js.map +1 -0
  278. package/dist/chunk-DBpF1Eur.cjs +69 -0
  279. package/dist/chunk-DBpF1Eur.cjs.map +1 -0
  280. package/dist/chunk-DCvhBL80.js +9 -0
  281. package/dist/chunk-DCvhBL80.js.map +1 -0
  282. package/dist/chunk-DDNoqMiU.cjs +12 -0
  283. package/dist/chunk-DDNoqMiU.cjs.map +1 -0
  284. package/dist/chunk-DEpLX45Z.cjs +25 -0
  285. package/dist/chunk-DEpLX45Z.cjs.map +1 -0
  286. package/dist/chunk-DFw3I0U0.cjs +19 -0
  287. package/dist/chunk-DFw3I0U0.cjs.map +1 -0
  288. package/dist/chunk-DJOkmY4u.cjs +36 -0
  289. package/dist/chunk-DJOkmY4u.cjs.map +1 -0
  290. package/dist/chunk-DJQsem2x.js +1128 -0
  291. package/dist/chunk-DJQsem2x.js.map +1 -0
  292. package/dist/chunk-DKNcYR4L.cjs +71 -0
  293. package/dist/chunk-DKNcYR4L.cjs.map +1 -0
  294. package/dist/chunk-DL4Q5WpP.cjs +19 -0
  295. package/dist/chunk-DL4Q5WpP.cjs.map +1 -0
  296. package/dist/chunk-DLt13wEh.js +279 -0
  297. package/dist/chunk-DLt13wEh.js.map +1 -0
  298. package/dist/chunk-DPvFDS5n.cjs +31 -0
  299. package/dist/chunk-DPvFDS5n.cjs.map +1 -0
  300. package/dist/chunk-DQ4l6EDZ.js +1728 -0
  301. package/dist/chunk-DQ4l6EDZ.js.map +1 -0
  302. package/dist/chunk-DQ_X9yhT.cjs +21 -0
  303. package/dist/chunk-DQ_X9yhT.cjs.map +1 -0
  304. package/dist/chunk-DQbbL87b.cjs +57 -0
  305. package/dist/chunk-DQbbL87b.cjs.map +1 -0
  306. package/dist/chunk-DRphChLx.js +15 -0
  307. package/dist/chunk-DRphChLx.js.map +1 -0
  308. package/dist/chunk-DSsTHBp4.js +62 -0
  309. package/dist/chunk-DSsTHBp4.js.map +1 -0
  310. package/dist/chunk-DVI59otQ.js +20 -0
  311. package/dist/chunk-DVI59otQ.js.map +1 -0
  312. package/dist/chunk-DVN4tYVL.cjs +235 -0
  313. package/dist/chunk-DVN4tYVL.cjs.map +1 -0
  314. package/dist/chunk-DWxCDSxn.cjs +36 -0
  315. package/dist/chunk-DWxCDSxn.cjs.map +1 -0
  316. package/dist/chunk-DXMaeZs_.cjs +135 -0
  317. package/dist/chunk-DXMaeZs_.cjs.map +1 -0
  318. package/dist/chunk-D_dPThBm.js +44 -0
  319. package/dist/chunk-D_dPThBm.js.map +1 -0
  320. package/dist/chunk-DbW3lF5Y.cjs +55 -0
  321. package/dist/chunk-DbW3lF5Y.cjs.map +1 -0
  322. package/dist/chunk-Dc0Robe4.cjs +254 -0
  323. package/dist/chunk-Dc0Robe4.cjs.map +1 -0
  324. package/dist/chunk-DcLLI7B1.cjs +16 -0
  325. package/dist/chunk-DcLLI7B1.cjs.map +1 -0
  326. package/dist/chunk-Dd9K8OSs.js +73 -0
  327. package/dist/chunk-Dd9K8OSs.js.map +1 -0
  328. package/dist/chunk-DeFJnC-Q.js +52 -0
  329. package/dist/chunk-DeFJnC-Q.js.map +1 -0
  330. package/dist/chunk-DeggaLXL.cjs +109 -0
  331. package/dist/chunk-DeggaLXL.cjs.map +1 -0
  332. package/dist/chunk-DetGuqR8.cjs +12 -0
  333. package/dist/chunk-DetGuqR8.cjs.map +1 -0
  334. package/dist/chunk-Df761BAX.cjs +4 -0
  335. package/dist/chunk-DfQZch7H.cjs +60 -0
  336. package/dist/chunk-DfQZch7H.cjs.map +1 -0
  337. package/dist/chunk-DhwoAmi8.cjs +77 -0
  338. package/dist/chunk-DhwoAmi8.cjs.map +1 -0
  339. package/dist/chunk-DkH1DKxi.cjs +66 -0
  340. package/dist/chunk-DkH1DKxi.cjs.map +1 -0
  341. package/dist/chunk-DkjkI8F5.cjs +150 -0
  342. package/dist/chunk-DkjkI8F5.cjs.map +1 -0
  343. package/dist/chunk-DlaVYkP2.cjs +23 -0
  344. package/dist/chunk-DlaVYkP2.cjs.map +1 -0
  345. package/dist/chunk-DlcsA1GQ.js +6 -0
  346. package/dist/chunk-DlcsA1GQ.js.map +1 -0
  347. package/dist/chunk-DmBkJhi_.js +8 -0
  348. package/dist/chunk-DmBkJhi_.js.map +1 -0
  349. package/dist/chunk-DnXjnOQ1.cjs +42 -0
  350. package/dist/chunk-DnXjnOQ1.cjs.map +1 -0
  351. package/dist/chunk-DrG9yz7c.js +509 -0
  352. package/dist/chunk-DrG9yz7c.js.map +1 -0
  353. package/dist/chunk-DsTU_5Be.js +96 -0
  354. package/dist/chunk-DsTU_5Be.js.map +1 -0
  355. package/dist/chunk-DsXj9iLu.cjs +1827 -0
  356. package/dist/chunk-DsXj9iLu.cjs.map +1 -0
  357. package/dist/chunk-DteUy52S.js +45 -0
  358. package/dist/chunk-DteUy52S.js.map +1 -0
  359. package/dist/chunk-DtvsE56k.cjs +12 -0
  360. package/dist/chunk-DtvsE56k.cjs.map +1 -0
  361. package/dist/chunk-DuD5YqoE.cjs +99 -0
  362. package/dist/chunk-DuD5YqoE.cjs.map +1 -0
  363. package/dist/chunk-DvrtQ0Y0.js +51 -0
  364. package/dist/chunk-DvrtQ0Y0.js.map +1 -0
  365. package/dist/chunk-DwUFwDV2.js +144 -0
  366. package/dist/chunk-DwUFwDV2.js.map +1 -0
  367. package/dist/chunk-Dy59Tdfm.cjs +67 -0
  368. package/dist/chunk-Dy59Tdfm.cjs.map +1 -0
  369. package/dist/chunk-DyJupG9U.cjs +74 -0
  370. package/dist/chunk-DyJupG9U.cjs.map +1 -0
  371. package/dist/chunk-DzCbinPo.js +9 -0
  372. package/dist/chunk-DzCbinPo.js.map +1 -0
  373. package/dist/chunk-GgcOmaXu.cjs +137 -0
  374. package/dist/chunk-GgcOmaXu.cjs.map +1 -0
  375. package/dist/chunk-GnVcZTQv.cjs +50 -0
  376. package/dist/chunk-GnVcZTQv.cjs.map +1 -0
  377. package/dist/chunk-JDLVWYk5.cjs +22 -0
  378. package/dist/chunk-JDLVWYk5.cjs.map +1 -0
  379. package/dist/chunk-NA04sFmY.js +2 -0
  380. package/dist/chunk-NqIZvB2L.js +44 -0
  381. package/dist/chunk-NqIZvB2L.js.map +1 -0
  382. package/dist/chunk-OGNas_Mn.cjs +654 -0
  383. package/dist/chunk-OGNas_Mn.cjs.map +1 -0
  384. package/dist/chunk-PeexRooj.cjs +12 -0
  385. package/dist/chunk-PeexRooj.cjs.map +1 -0
  386. package/dist/chunk-QUjeQKsz.js +26 -0
  387. package/dist/chunk-QUjeQKsz.js.map +1 -0
  388. package/dist/chunk-S0jc_E9W.cjs +62 -0
  389. package/dist/chunk-S0jc_E9W.cjs.map +1 -0
  390. package/dist/chunk-TLRG-UaM.js +453 -0
  391. package/dist/chunk-TLRG-UaM.js.map +1 -0
  392. package/dist/chunk-TYmd7TzW.cjs +68 -0
  393. package/dist/chunk-TYmd7TzW.cjs.map +1 -0
  394. package/dist/chunk-TlHnQSY_.js +250 -0
  395. package/dist/chunk-TlHnQSY_.js.map +1 -0
  396. package/dist/chunk-Vba_029j.js +36 -0
  397. package/dist/chunk-Vba_029j.js.map +1 -0
  398. package/dist/chunk-Vp0uJb7O.cjs +92 -0
  399. package/dist/chunk-Vp0uJb7O.cjs.map +1 -0
  400. package/dist/chunk-WPGdcwtf.cjs +15 -0
  401. package/dist/chunk-WPGdcwtf.cjs.map +1 -0
  402. package/dist/chunk-WUipjqNN.cjs +158 -0
  403. package/dist/chunk-WUipjqNN.cjs.map +1 -0
  404. package/dist/chunk-Y-zyJ0-m.js +6 -0
  405. package/dist/chunk-Y-zyJ0-m.js.map +1 -0
  406. package/dist/chunk-ZIIlDASG.js +94 -0
  407. package/dist/chunk-ZIIlDASG.js.map +1 -0
  408. package/dist/chunk-ZLDg2I1Z.js +6 -0
  409. package/dist/chunk-ZLDg2I1Z.js.map +1 -0
  410. package/dist/chunk-_jSTl9gW.cjs +1129 -0
  411. package/dist/chunk-_jSTl9gW.cjs.map +1 -0
  412. package/dist/chunk-b5CqEoo1.cjs +599 -0
  413. package/dist/chunk-b5CqEoo1.cjs.map +1 -0
  414. package/dist/chunk-bA-2OGXv.d.ts +3977 -0
  415. package/dist/chunk-bvwC3n0z.cjs +12 -0
  416. package/dist/chunk-bvwC3n0z.cjs.map +1 -0
  417. package/dist/chunk-cMQzXXQq.js +67 -0
  418. package/dist/chunk-cMQzXXQq.js.map +1 -0
  419. package/dist/chunk-cTRnGhbF.cjs +177 -0
  420. package/dist/chunk-cTRnGhbF.cjs.map +1 -0
  421. package/dist/chunk-dHKPMJ4D.js +85 -0
  422. package/dist/chunk-dHKPMJ4D.js.map +1 -0
  423. package/dist/chunk-d_BOXcT5.js +9 -0
  424. package/dist/chunk-d_BOXcT5.js.map +1 -0
  425. package/dist/chunk-ea1IbBcA.js +66 -0
  426. package/dist/chunk-ea1IbBcA.js.map +1 -0
  427. package/dist/chunk-f-dHVrF3.js +293 -0
  428. package/dist/chunk-f-dHVrF3.js.map +1 -0
  429. package/dist/chunk-h7Z5mAV_.cjs +41 -0
  430. package/dist/chunk-h7Z5mAV_.cjs.map +1 -0
  431. package/dist/chunk-jSgMzVr1.js +35 -0
  432. package/dist/chunk-jSgMzVr1.js.map +1 -0
  433. package/dist/chunk-kYE5SZgs.cjs +252 -0
  434. package/dist/chunk-kYE5SZgs.cjs.map +1 -0
  435. package/dist/chunk-lEnNKG6x.cjs +285 -0
  436. package/dist/chunk-lEnNKG6x.cjs.map +1 -0
  437. package/dist/chunk-lcml1N1G.js +11 -0
  438. package/dist/chunk-lcml1N1G.js.map +1 -0
  439. package/dist/chunk-nBK0qBXt.js +68 -0
  440. package/dist/chunk-nBK0qBXt.js.map +1 -0
  441. package/dist/chunk-njoANlUr.cjs +41 -0
  442. package/dist/chunk-njoANlUr.cjs.map +1 -0
  443. package/dist/chunk-nwutfrnH.cjs +430 -0
  444. package/dist/chunk-nwutfrnH.cjs.map +1 -0
  445. package/dist/chunk-o1EKuTLo.js +56 -0
  446. package/dist/chunk-o1EKuTLo.js.map +1 -0
  447. package/dist/chunk-oMFOZSQM.cjs +52 -0
  448. package/dist/chunk-oMFOZSQM.cjs.map +1 -0
  449. package/dist/chunk-pb64dLGD.cjs +682 -0
  450. package/dist/chunk-pb64dLGD.cjs.map +1 -0
  451. package/dist/chunk-s7kBzSlt.js +2 -0
  452. package/dist/chunk-uhXxE8xV.cjs +32 -0
  453. package/dist/chunk-uhXxE8xV.cjs.map +1 -0
  454. package/dist/chunk-vGzpsUSM.cjs +110 -0
  455. package/dist/chunk-vGzpsUSM.cjs.map +1 -0
  456. package/dist/chunk-vN_Di8Af.cjs +1890 -0
  457. package/dist/chunk-vN_Di8Af.cjs.map +1 -0
  458. package/dist/chunk-veLShVmw.js +41 -0
  459. package/dist/chunk-veLShVmw.js.map +1 -0
  460. package/dist/chunk-wTf5jOFv.js +253 -0
  461. package/dist/chunk-wTf5jOFv.js.map +1 -0
  462. package/dist/chunk-yO-Ek9RH.cjs +17 -0
  463. package/dist/chunk-yO-Ek9RH.cjs.map +1 -0
  464. package/dist/chunk-ye5UUSFw.js +280 -0
  465. package/dist/chunk-ye5UUSFw.js.map +1 -0
  466. package/dist/copilot/index.cjs +10 -0
  467. package/dist/copilot/index.d.cts +62 -0
  468. package/dist/copilot/index.d.ts +62 -0
  469. package/dist/copilot/index.js +4 -0
  470. package/dist/embed/index.cjs +1653 -0
  471. package/dist/embed/index.cjs.map +1 -0
  472. package/dist/embed/index.d.cts +291 -0
  473. package/dist/embed/index.d.ts +291 -0
  474. package/dist/embed/index.js +1643 -0
  475. package/dist/embed/index.js.map +1 -0
  476. package/dist/headless/index.cjs +126 -0
  477. package/dist/headless/index.d.cts +4 -0
  478. package/dist/headless/index.d.ts +4 -0
  479. package/dist/headless/index.js +29 -0
  480. package/dist/import/index.cjs +403 -0
  481. package/dist/import/index.cjs.map +1 -0
  482. package/dist/import/index.d.cts +160 -0
  483. package/dist/import/index.d.ts +160 -0
  484. package/dist/import/index.js +393 -0
  485. package/dist/import/index.js.map +1 -0
  486. package/dist/index.cjs +8991 -0
  487. package/dist/index.cjs.map +1 -0
  488. package/dist/index.d.cts +4847 -0
  489. package/dist/index.d.ts +4847 -0
  490. package/dist/index.js +8768 -0
  491. package/dist/index.js.map +1 -0
  492. package/dist/map/index.cjs +36 -0
  493. package/dist/map/index.d.cts +2 -0
  494. package/dist/map/index.d.ts +2 -0
  495. package/dist/map/index.js +2 -0
  496. package/dist/styles.css +14684 -0
  497. package/dist/testing/index.cjs +398 -0
  498. package/dist/testing/index.cjs.map +1 -0
  499. package/dist/testing/index.d.cts +302 -0
  500. package/dist/testing/index.d.ts +302 -0
  501. package/dist/testing/index.js +382 -0
  502. package/dist/testing/index.js.map +1 -0
  503. package/dist/video/index.cjs +8 -0
  504. package/dist/video/index.d.cts +122 -0
  505. package/dist/video/index.d.ts +122 -0
  506. package/dist/video/index.js +2 -0
  507. package/package.json +226 -4
  508. package/src/agent/components/ActivityRow.tsx +226 -0
  509. package/src/agent/components/AgentEntityIndicator.tsx +67 -0
  510. package/src/agent/components/AgentMarkdown.tsx +530 -0
  511. package/src/agent/components/ChatComposer.tsx +161 -0
  512. package/src/agent/components/ChatTranscript.tsx +1358 -0
  513. package/src/agent/components/CopilotPanel.tsx +415 -0
  514. package/src/agent/components/CopilotStates.tsx +238 -0
  515. package/src/agent/components/CopilotTranscript.tsx +191 -0
  516. package/src/agent/components/MessageFeedback.tsx +100 -0
  517. package/src/agent/hooks/useAgentChatTransport.ts +61 -0
  518. package/src/agent/hooks/useAgentErrorCopy.ts +27 -0
  519. package/src/agent/hooks/useCopilotOpen.ts +68 -0
  520. package/src/agent/providers/AgentThreadsProvider.tsx +360 -0
  521. package/src/agent/providers/PromptPanelConversation.tsx +135 -0
  522. package/src/agent/rules/drawnNode.ts +24 -0
  523. package/src/alerts/components/MapAlerts.tsx +127 -0
  524. package/src/cache/hooks/useStudioCache.ts +40 -0
  525. package/src/cache/rules/studioCache.ts +145 -0
  526. package/src/collab/components/PeerEntityIndicator.tsx +150 -0
  527. package/src/collab/components/PresenceRoster.tsx +113 -0
  528. package/src/collab/components/peerLock.tsx +59 -0
  529. package/src/collab/hooks/useCollabOrganizationId.ts +24 -0
  530. package/src/collab/hooks/usePeerLockLabel.ts +41 -0
  531. package/src/collections/components/CollectionFormModal.tsx +280 -0
  532. package/src/collections/components/CollectionMultiSelect.tsx +640 -0
  533. package/src/collections/components/EditCollectionModal.tsx +114 -0
  534. package/src/collections/components/ManageCollectionsModal.tsx +692 -0
  535. package/src/collections/components/NewCollectionModal.tsx +87 -0
  536. package/src/collections/components/ShareCollectionModal.tsx +150 -0
  537. package/src/collections/hooks/useEntityCollections.ts +126 -0
  538. package/src/collections/hooks/useEveryPage.ts +33 -0
  539. package/src/controls/components/MapControlTooltip.tsx +84 -0
  540. package/src/controls/components/PoiOverlayMenu.tsx +342 -0
  541. package/src/controls/components/StudioControls.tsx +278 -0
  542. package/src/controls/rules/constants.ts +34 -0
  543. package/src/copilot/hooks/useStudioCopilotInset.ts +39 -0
  544. package/src/copilot/index.ts +29 -0
  545. package/src/directions/components/DirectionsModal.tsx +447 -0
  546. package/src/directions/components/directionsPdf.tsx +549 -0
  547. package/src/embed/components/DefaultViewControl.tsx +159 -0
  548. package/src/embed/components/EmbedBaseMapPicker.tsx +107 -0
  549. package/src/embed/components/EmbedCodeSection.tsx +329 -0
  550. package/src/embed/components/EmbedColumnsSection.tsx +167 -0
  551. package/src/embed/components/EmbedConfigForm.tsx +239 -0
  552. package/src/embed/components/EmbedElementSwitcher.tsx +85 -0
  553. package/src/embed/components/EmbedFieldControl.tsx +488 -0
  554. package/src/embed/components/EmbedGeneralSection.tsx +279 -0
  555. package/src/embed/components/EmbedKeyPanel.tsx +138 -0
  556. package/src/embed/components/EmbedSnippetCode.tsx +154 -0
  557. package/src/embed/components/EmbedStage.tsx +505 -0
  558. package/src/embed/components/EmbedTablePreview.tsx +134 -0
  559. package/src/embed/components/EmbedThemePicker.tsx +74 -0
  560. package/src/embed/components/EmbedTintPicker.tsx +76 -0
  561. package/src/embed/components/EmbedWizard.tsx +1031 -0
  562. package/src/embed/hooks/useEmbedCode.ts +170 -0
  563. package/src/embed/hooks/useEmbedCollectionItineraries.ts +42 -0
  564. package/src/embed/hooks/useEmbedLayerOptions.ts +75 -0
  565. package/src/embed/hooks/useEmbedPreviewCamera.ts +169 -0
  566. package/src/embed/index.ts +42 -0
  567. package/src/fullscreen/components/FullscreenHeader.tsx +77 -0
  568. package/src/fullscreen/components/FullscreenModal.tsx +80 -0
  569. package/src/fullscreen/components/WizardLayout.tsx +129 -0
  570. package/src/guards/components/AgentDrivingGuard.tsx +59 -0
  571. package/src/guards/components/UnsavedEditsGuard.tsx +210 -0
  572. package/src/guards/hooks/useReportUnsavedForm.ts +34 -0
  573. package/src/guards/hooks/useUnsavedEditsGuard.ts +44 -0
  574. package/src/headless/hooks/useAgentDriving.ts +21 -0
  575. package/src/headless/hooks/useBeginSegmentEdit.ts +89 -0
  576. package/src/headless/hooks/useBeginWaypointEdit.ts +74 -0
  577. package/src/headless/hooks/useCapabilitySet.ts +65 -0
  578. package/src/headless/hooks/useCollabResources.ts +148 -0
  579. package/src/headless/hooks/useCollectionScope.ts +37 -0
  580. package/src/headless/hooks/useEditActions.ts +250 -0
  581. package/src/headless/hooks/useEscapeKey.ts +43 -0
  582. package/src/headless/hooks/useInlineRename.ts +276 -0
  583. package/src/headless/hooks/useLiveAwareSegments.ts +88 -0
  584. package/src/headless/hooks/useLiveAwareWaypoints.ts +39 -0
  585. package/src/headless/hooks/useMapHoveredRow.ts +76 -0
  586. package/src/headless/hooks/usePlatformViewer.ts +452 -0
  587. package/src/headless/hooks/usePluginSlot.ts +235 -0
  588. package/src/headless/hooks/useRowEmphasis.ts +66 -0
  589. package/src/headless/hooks/useSegmentList.ts +428 -0
  590. package/src/headless/hooks/useSegmentRow.ts +370 -0
  591. package/src/headless/hooks/useSegmentRowActions.ts +267 -0
  592. package/src/headless/hooks/useShallowSelector.ts +145 -0
  593. package/src/headless/hooks/useStableMembers.ts +74 -0
  594. package/src/headless/hooks/useStoreSlice.ts +52 -0
  595. package/src/headless/hooks/useStreetViewCorridor.ts +120 -0
  596. package/src/headless/hooks/useStudioApi.ts +18 -0
  597. package/src/headless/hooks/useStudioDispatch.ts +180 -0
  598. package/src/headless/hooks/useStudioDispatchCount.ts +147 -0
  599. package/src/headless/hooks/useStudioDispatchUnsafe.ts +111 -0
  600. package/src/headless/hooks/useStudioEntitlement.ts +29 -0
  601. package/src/headless/hooks/useStudioFailureAlert.ts +67 -0
  602. package/src/headless/hooks/useStudioObserve.ts +38 -0
  603. package/src/headless/hooks/useStudioPreferences.ts +8 -0
  604. package/src/headless/hooks/useStudioSignedIn.ts +12 -0
  605. package/src/headless/hooks/useStudioStore.ts +72 -0
  606. package/src/headless/hooks/useStudioUnits.ts +23 -0
  607. package/src/headless/hooks/useStudioUrl.ts +24 -0
  608. package/src/headless/hooks/useStudioUserId.ts +5 -0
  609. package/src/headless/hooks/useStudioVerbHeld.ts +43 -0
  610. package/src/headless/hooks/useStudioViewer.ts +19 -0
  611. package/src/headless/hooks/useStudioViewerEntitlement.ts +40 -0
  612. package/src/headless/hooks/useStudioViewerItineraryLimit.ts +34 -0
  613. package/src/headless/hooks/useStudioViewerPreferences.ts +44 -0
  614. package/src/headless/hooks/useStudioViewerUnits.ts +50 -0
  615. package/src/headless/hooks/useStudioViewerUserId.ts +23 -0
  616. package/src/headless/hooks/useUiStore.ts +91 -0
  617. package/src/headless/hooks/useUiStoreShallow.ts +43 -0
  618. package/src/headless/hooks/useWaypointDetailsDialog.ts +52 -0
  619. package/src/headless/hooks/useWaypointList.ts +89 -0
  620. package/src/headless/hooks/useWaypointRow.ts +229 -0
  621. package/src/headless/hooks/useWaypointRowActions.ts +166 -0
  622. package/src/headless/index.ts +287 -0
  623. package/src/headless/providers/billingGate.tsx +129 -0
  624. package/src/headless/providers/copilot.tsx +155 -0
  625. package/src/headless/providers/mountayaStudio.tsx +127 -0
  626. package/src/headless/providers/navigationBlocker.tsx +91 -0
  627. package/src/headless/providers/notify.tsx +36 -0
  628. package/src/headless/providers/organizations.tsx +267 -0
  629. package/src/headless/providers/plugins.tsx +173 -0
  630. package/src/headless/providers/studio.tsx +1296 -0
  631. package/src/headless/providers/studioStrings.tsx +243 -0
  632. package/src/headless/rules/inputMethod.ts +19 -0
  633. package/src/hooks/useAgreementLimits.ts +165 -0
  634. package/src/hooks/useLayerCatalogOptions.ts +106 -0
  635. package/src/host/components/MountayaStudioHost.tsx +1018 -0
  636. package/src/host/hooks/useEmbeddedStudio.ts +24 -0
  637. package/src/host/hooks/useItineraryActivation.ts +126 -0
  638. package/src/host/hooks/useMemberGrants.ts +51 -0
  639. package/src/host/hooks/useStudioHostSurfaces.ts +100 -0
  640. package/src/host/hooks/useStudioPluginBinding.ts +133 -0
  641. package/src/host/hooks/useStudioSessionHeld.ts +111 -0
  642. package/src/host/hooks/useStudioToolBus.ts +127 -0
  643. package/src/host/hooks/useStudioToolContext.ts +175 -0
  644. package/src/host/providers/hostRegistry.tsx +144 -0
  645. package/src/host/providers/hostSurface.tsx +47 -0
  646. package/src/host/providers/hostVideo.tsx +73 -0
  647. package/src/import/components/DraftEntityList.tsx +298 -0
  648. package/src/import/components/FileDropInput.tsx +261 -0
  649. package/src/import/components/FileDropzone.tsx +97 -0
  650. package/src/import/components/ImportItineraryContent.tsx +133 -0
  651. package/src/import/components/ImportPreviewLegend.tsx +50 -0
  652. package/src/import/components/ImportPrimer.tsx +113 -0
  653. package/src/import/index.ts +32 -0
  654. package/src/import/providers/ImportRoutingGuideProvider.tsx +319 -0
  655. package/src/import/rules/routingGuidePictures.ts +20 -0
  656. package/src/index.ts +594 -0
  657. package/src/internal/components/Glyph.tsx +34 -0
  658. package/src/internal/components/MarkerGlyph.tsx +23 -0
  659. package/src/internal/components/MountayaMark.tsx +142 -0
  660. package/src/internal/hooks/useTextOverflow.ts +90 -0
  661. package/src/internal/providers/studioEditorRoot.tsx +42 -0
  662. package/src/internal/rules/editorRoot.ts +9 -0
  663. package/src/internal/rules/missingSeam.ts +32 -0
  664. package/src/itinerary/components/ActivityGuideModal.tsx +345 -0
  665. package/src/itinerary/components/ActivitySelect.tsx +204 -0
  666. package/src/itinerary/components/AddWaypointButton.tsx +151 -0
  667. package/src/itinerary/components/AscentInput.tsx +65 -0
  668. package/src/itinerary/components/Characteristics.tsx +129 -0
  669. package/src/itinerary/components/CursorReadout.tsx +66 -0
  670. package/src/itinerary/components/DistanceInput.tsx +67 -0
  671. package/src/itinerary/components/DraftProvenanceBanner.tsx +79 -0
  672. package/src/itinerary/components/DuplicateItineraryModal.tsx +341 -0
  673. package/src/itinerary/components/EditorSaveFooter.tsx +424 -0
  674. package/src/itinerary/components/ItineraryActionsMenu.tsx +655 -0
  675. package/src/itinerary/components/ItineraryForm.tsx +887 -0
  676. package/src/itinerary/components/ItineraryHeaderIdentity.tsx +121 -0
  677. package/src/itinerary/components/ItineraryHeaderMeta.tsx +68 -0
  678. package/src/itinerary/components/ItineraryHeaderTitle.tsx +88 -0
  679. package/src/itinerary/components/ItineraryIdentityFields.tsx +153 -0
  680. package/src/itinerary/components/ItineraryProfilePanel.tsx +619 -0
  681. package/src/itinerary/components/ItineraryProfileSheet.tsx +219 -0
  682. package/src/itinerary/components/ItinerarySubHeader.tsx +236 -0
  683. package/src/itinerary/components/PendingProfile.tsx +142 -0
  684. package/src/itinerary/components/PlaceCard.tsx +35 -0
  685. package/src/itinerary/components/PlaceMark.tsx +76 -0
  686. package/src/itinerary/components/ProfileAnalysisBars.tsx +84 -0
  687. package/src/itinerary/components/ProfileBar.tsx +215 -0
  688. package/src/itinerary/components/ProfileHeaderControls.tsx +116 -0
  689. package/src/itinerary/components/ProfileHeaderFigures.tsx +119 -0
  690. package/src/itinerary/components/ProfilePaceControl.tsx +97 -0
  691. package/src/itinerary/components/ProfileStat.tsx +76 -0
  692. package/src/itinerary/components/ProfileStatStrip.tsx +38 -0
  693. package/src/itinerary/components/RoadAccessModal.tsx +76 -0
  694. package/src/itinerary/components/RouteTypeControl.tsx +73 -0
  695. package/src/itinerary/components/SegmentGroupModal.tsx +312 -0
  696. package/src/itinerary/components/SegmentGroupRangePicker.tsx +228 -0
  697. package/src/itinerary/components/StagingCreateFooter.tsx +185 -0
  698. package/src/itinerary/components/StudioItineraryProfile.tsx +620 -0
  699. package/src/itinerary/components/SuggestForm.tsx +256 -0
  700. package/src/itinerary/components/SuggestFormActions.tsx +124 -0
  701. package/src/itinerary/components/SuggestionResultRow.tsx +98 -0
  702. package/src/itinerary/components/SuggestionResultsList.tsx +85 -0
  703. package/src/itinerary/components/WaypointAmenityPicker.tsx +105 -0
  704. package/src/itinerary/components/WaypointDetailFields.tsx +604 -0
  705. package/src/itinerary/components/WaypointDetailsModal.tsx +134 -0
  706. package/src/itinerary/components/WaypointDetailsRows.tsx +707 -0
  707. package/src/itinerary/components/WaypointDetailsView.tsx +389 -0
  708. package/src/itinerary/components/WaypointIconCircle.tsx +211 -0
  709. package/src/itinerary/components/WaypointIconPicker.tsx +82 -0
  710. package/src/itinerary/components/WaypointMarkers.tsx +293 -0
  711. package/src/itinerary/components/WaypointPreviewCard.tsx +56 -0
  712. package/src/itinerary/components/WaypointSectionNav.tsx +151 -0
  713. package/src/itinerary/components/WaypointSwitcher.tsx +143 -0
  714. package/src/itinerary/components/WaypointWorkbench.tsx +263 -0
  715. package/src/itinerary/hooks/useDuplicateDraft.ts +205 -0
  716. package/src/itinerary/hooks/useDuplicateSource.ts +69 -0
  717. package/src/itinerary/hooks/useFriendlyNameBanks.ts +26 -0
  718. package/src/itinerary/hooks/useItineraryEditable.ts +89 -0
  719. package/src/itinerary/hooks/useItineraryPace.ts +104 -0
  720. package/src/itinerary/hooks/useItinerarySubject.ts +117 -0
  721. package/src/itinerary/hooks/useOpenItineraryEditable.ts +39 -0
  722. package/src/itinerary/hooks/useProfileOverlay.tsx +61 -0
  723. package/src/itinerary/hooks/useProfileSeries.ts +95 -0
  724. package/src/itinerary/hooks/useProfileVisibility.ts +149 -0
  725. package/src/itinerary/hooks/useSeedDraftOrganization.ts +85 -0
  726. package/src/itinerary/hooks/useSegmentGroupSave.ts +143 -0
  727. package/src/itinerary/hooks/useStartFromSuggestion.ts +63 -0
  728. package/src/itinerary/hooks/useStudioItinerary.ts +35 -0
  729. package/src/itinerary/hooks/useSuggestionPin.ts +36 -0
  730. package/src/itinerary/hooks/useWaypointCardWords.ts +51 -0
  731. package/src/itinerary/hooks/useWaypointCreateFollowUp.ts +158 -0
  732. package/src/itinerary/hooks/useWaypointDetailsEditor.ts +280 -0
  733. package/src/itinerary/hooks/useWaypointSectionEntries.ts +114 -0
  734. package/src/itinerary/providers/ActivityGuideProvider.tsx +113 -0
  735. package/src/itinerary/providers/ItineraryViewProvider.tsx +146 -0
  736. package/src/itinerary/rules/amenityGlyphs.ts +25 -0
  737. package/src/itinerary/rules/cursorReadoutData.ts +34 -0
  738. package/src/itinerary/rules/profileCursor.ts +11 -0
  739. package/src/itinerary/rules/profileModel.ts +98 -0
  740. package/src/itinerary/rules/shownFocus.ts +11 -0
  741. package/src/itinerary/rules/waypointGlyphs.ts +42 -0
  742. package/src/itinerary/stores/profileHover.ts +54 -0
  743. package/src/lists/components/AddSegmentButton.tsx +240 -0
  744. package/src/lists/components/EditActions.tsx +153 -0
  745. package/src/lists/components/EditorListSection.tsx +117 -0
  746. package/src/lists/components/EditorSegmentRow.tsx +458 -0
  747. package/src/lists/components/ItineraryAddSegmentButton.tsx +66 -0
  748. package/src/lists/components/ItinerarySegmentList.tsx +301 -0
  749. package/src/lists/components/ItineraryWaypointList.tsx +257 -0
  750. package/src/lists/components/SegmentList.tsx +549 -0
  751. package/src/lists/components/SegmentSeam.tsx +292 -0
  752. package/src/lists/components/WaypointList.tsx +233 -0
  753. package/src/map/components/ContextMenuPopup.tsx +913 -0
  754. package/src/map/components/MapAnchoredPopup.tsx +285 -0
  755. package/src/map/components/SegmentViaPopup.tsx +133 -0
  756. package/src/map/hooks/useAccessRestrictions.ts +25 -0
  757. package/src/map/hooks/useEmbedConstraints.ts +359 -0
  758. package/src/map/hooks/useEmbedDisplaySeed.ts +61 -0
  759. package/src/map/hooks/useEmbedReady.ts +137 -0
  760. package/src/map/hooks/useHeldTileSources.ts +65 -0
  761. package/src/map/hooks/useSegmentColor.ts +24 -0
  762. package/src/map/hooks/useSpecificationLayers.ts +25 -0
  763. package/src/map/hooks/useStudioConstraints.ts +135 -0
  764. package/src/map/hooks/useStudioContextMenu.ts +34 -0
  765. package/src/map/hooks/useStudioContextMenuWaypoint.ts +119 -0
  766. package/src/map/hooks/useStudioEditCommitReporter.ts +56 -0
  767. package/src/map/hooks/useStudioEditEngine.ts +271 -0
  768. package/src/map/hooks/useStudioEnrichment.ts +117 -0
  769. package/src/map/hooks/useStudioItinerarySelection.ts +484 -0
  770. package/src/map/hooks/useStudioLayersScope.ts +34 -0
  771. package/src/map/hooks/useStudioMapBindings.ts +178 -0
  772. package/src/map/hooks/useStudioMapEditSeams.ts +161 -0
  773. package/src/map/hooks/useStudioMapSync.ts +127 -0
  774. package/src/map/hooks/useStudioOverlay.ts +75 -0
  775. package/src/map/hooks/useStudioOverlayWithdrawal.ts +52 -0
  776. package/src/map/hooks/useStudioOverlaysEntitled.ts +12 -0
  777. package/src/map/hooks/useStudioPeerDrafts.ts +126 -0
  778. package/src/map/hooks/useStudioPoiLayers.ts +110 -0
  779. package/src/map/hooks/useStudioPreviewSync.ts +205 -0
  780. package/src/map/hooks/useStudioSegmentEditing.ts +239 -0
  781. package/src/map/hooks/useStudioSegmentViaPrompt.ts +38 -0
  782. package/src/map/hooks/useStudioSplitPicking.ts +411 -0
  783. package/src/map/hooks/useStudioSuggestionPicking.ts +178 -0
  784. package/src/map/hooks/useStudioTimestamp.ts +226 -0
  785. package/src/map/hooks/useStudioUrlState.ts +340 -0
  786. package/src/map/hooks/useStudioWaypointEditing.ts +251 -0
  787. package/src/map/hooks/useStudioZoneEditing.ts +260 -0
  788. package/src/map/hooks/useStudioZoneOriginPicking.ts +129 -0
  789. package/src/map/hooks/useStudioZoneSelection.ts +240 -0
  790. package/src/map/hooks/useTileLayers.ts +33 -0
  791. package/src/map/index.ts +67 -0
  792. package/src/map/rules/editKeyboard.ts +216 -0
  793. package/src/map/rules/editTooltip.ts +222 -0
  794. package/src/map/rules/nearerEscape.ts +107 -0
  795. package/src/map/rules/poiGlyphs.ts +40 -0
  796. package/src/modals/components/AppModal.tsx +280 -0
  797. package/src/modals/components/ConfirmModal.tsx +223 -0
  798. package/src/modals/components/ExportModal.tsx +538 -0
  799. package/src/modals/components/LocationPermissionModal.tsx +129 -0
  800. package/src/modals/components/ModalFooter.tsx +187 -0
  801. package/src/modals/hooks/useConfirmGate.tsx +209 -0
  802. package/src/modals/hooks/useDiscardGuard.tsx +168 -0
  803. package/src/panels/components/EditShortcutHint.tsx +115 -0
  804. package/src/panels/components/FloatingOverlay.tsx +243 -0
  805. package/src/panels/components/GlyphPickerGrid.tsx +84 -0
  806. package/src/panels/components/PanelRouter.tsx +133 -0
  807. package/src/panels/components/PickerCard.tsx +108 -0
  808. package/src/panels/components/RadioOptionCard.tsx +116 -0
  809. package/src/panels/components/SidenavContentBody.tsx +56 -0
  810. package/src/panels/components/SidenavContentFooter.tsx +27 -0
  811. package/src/panels/components/SidenavContentHeader.tsx +172 -0
  812. package/src/panels/components/SidenavFormActions.tsx +96 -0
  813. package/src/panels/components/StudioFormStack.tsx +44 -0
  814. package/src/panels/components/StudioHeader.tsx +117 -0
  815. package/src/panels/components/StudioLayersPanel.tsx +909 -0
  816. package/src/panels/components/StudioPreferencesPanel.tsx +199 -0
  817. package/src/panels/rules/studioHeader.ts +68 -0
  818. package/src/plugins/components/PluginBoundary.tsx +62 -0
  819. package/src/plugins/components/PluginContextMenuActions.tsx +73 -0
  820. package/src/plugins/components/PluginControls.tsx +101 -0
  821. package/src/plugins/components/PluginHeldView.tsx +77 -0
  822. package/src/plugins/components/PluginMenuItems.tsx +63 -0
  823. package/src/plugins/components/PluginProfileHeader.tsx +71 -0
  824. package/src/plugins/components/PluginProfilePlot.tsx +134 -0
  825. package/src/plugins/components/PluginSlotItems.tsx +55 -0
  826. package/src/primitives/components/ActivityIcon.tsx +106 -0
  827. package/src/primitives/components/AllowlistField.tsx +508 -0
  828. package/src/primitives/components/CopyIconButton.tsx +80 -0
  829. package/src/primitives/components/DateTimeInput.tsx +133 -0
  830. package/src/primitives/components/DateTimePickerField.tsx +110 -0
  831. package/src/primitives/components/DescriptiveMenuItem.tsx +80 -0
  832. package/src/primitives/components/DialogSubject.tsx +102 -0
  833. package/src/primitives/components/DisabledMenuItem.tsx +45 -0
  834. package/src/primitives/components/DisabledReason.tsx +34 -0
  835. package/src/primitives/components/EmptyState.tsx +186 -0
  836. package/src/primitives/components/ErrorAlert.tsx +35 -0
  837. package/src/primitives/components/ErrorBoundary.tsx +55 -0
  838. package/src/primitives/components/FieldLabel.tsx +34 -0
  839. package/src/primitives/components/FormErrorAlert.tsx +33 -0
  840. package/src/primitives/components/GroupLabelledBy.tsx +31 -0
  841. package/src/primitives/components/LanguageSelect.tsx +139 -0
  842. package/src/primitives/components/ListSkeleton.tsx +64 -0
  843. package/src/primitives/components/MarqueeText.tsx +61 -0
  844. package/src/primitives/components/OrganizationScopeItem.tsx +146 -0
  845. package/src/primitives/components/OrganizationSelect.tsx +149 -0
  846. package/src/primitives/components/PointField.tsx +75 -0
  847. package/src/primitives/components/PrivacyControl.tsx +127 -0
  848. package/src/primitives/components/RenameInput.tsx +159 -0
  849. package/src/primitives/components/RequiredLabelWithHelp.tsx +76 -0
  850. package/src/primitives/components/SegmentIcon.tsx +43 -0
  851. package/src/primitives/components/SegmentIconLabel.tsx +37 -0
  852. package/src/primitives/components/SpeedInput.tsx +222 -0
  853. package/src/primitives/components/StudioSectionBoundary.tsx +56 -0
  854. package/src/primitives/components/StudioSegmentedControl.tsx +23 -0
  855. package/src/primitives/components/UnitPickerField.tsx +62 -0
  856. package/src/primitives/components/UnitPickerGrid.tsx +71 -0
  857. package/src/primitives/components/WarningAlert.tsx +34 -0
  858. package/src/primitives/hooks/useCompactLayout.ts +30 -0
  859. package/src/primitives/hooks/useSpeedControlLabel.ts +28 -0
  860. package/src/primitives/rules/activityBadge.ts +87 -0
  861. package/src/publication/components/PublicationBadge.tsx +42 -0
  862. package/src/publication/components/PublicationDot.tsx +31 -0
  863. package/src/publication/components/PublicationNotice.tsx +115 -0
  864. package/src/publication/components/PublicationSettledPill.tsx +43 -0
  865. package/src/publication/components/PublicationStatus.tsx +52 -0
  866. package/src/publication/components/UnpublishedPanel.tsx +133 -0
  867. package/src/publication/hooks/usePublicationHint.ts +235 -0
  868. package/src/publication/hooks/usePublishAct.ts +101 -0
  869. package/src/publication/hooks/usePublishItinerary.ts +27 -0
  870. package/src/publication/hooks/usePublishZone.ts +27 -0
  871. package/src/publication/hooks/usePublishableScope.ts +23 -0
  872. package/src/publication/hooks/usePublishedItinerary.ts +83 -0
  873. package/src/rows/components/ReadOnlySegmentRow.tsx +155 -0
  874. package/src/rows/components/RouteMetricLine.tsx +90 -0
  875. package/src/rows/components/RowMetadata.tsx +92 -0
  876. package/src/rows/components/SegmentRow.tsx +381 -0
  877. package/src/rows/components/SegmentRowActions.tsx +187 -0
  878. package/src/rows/components/SegmentRowBody.tsx +197 -0
  879. package/src/rows/components/StudioToggleRow.tsx +71 -0
  880. package/src/rows/components/SuggestionList.tsx +100 -0
  881. package/src/rows/components/SuggestionRowLayout.tsx +164 -0
  882. package/src/rows/components/WaypointRow.tsx +176 -0
  883. package/src/rows/components/WaypointRowLayout.tsx +279 -0
  884. package/src/rows/components/lockChrome.tsx +106 -0
  885. package/src/rules/menuActions.ts +149 -0
  886. package/src/rules/sizing.ts +127 -0
  887. package/src/rules/studioConfig.ts +719 -0
  888. package/src/search/components/CategoryTabs.tsx +136 -0
  889. package/src/search/components/ResultRow.tsx +242 -0
  890. package/src/search/components/ResultsList.tsx +182 -0
  891. package/src/search/components/SearchInput.tsx +100 -0
  892. package/src/search/components/SearchTab.tsx +614 -0
  893. package/src/sections/components/RailSwitcher.tsx +179 -0
  894. package/src/sections/components/SectionCard.tsx +48 -0
  895. package/src/sections/components/SectionHead.tsx +42 -0
  896. package/src/sections/components/SectionTabs.tsx +231 -0
  897. package/src/segments/components/SegmentColorCircle.tsx +118 -0
  898. package/src/segments/components/SegmentColorPicker.tsx +134 -0
  899. package/src/segments/components/SegmentModeControl.tsx +118 -0
  900. package/src/segments/components/SegmentRowMenu.tsx +449 -0
  901. package/src/segments/components/SegmentRowPopover.tsx +163 -0
  902. package/src/segments/components/SegmentSelect.tsx +116 -0
  903. package/src/segments/components/SegmentSpeedControl.tsx +299 -0
  904. package/src/share/components/ShareLinkManage.tsx +699 -0
  905. package/src/share/components/ShareModal.tsx +182 -0
  906. package/src/share/components/ShareSheet.tsx +178 -0
  907. package/src/share/components/ShareViewModal.tsx +131 -0
  908. package/src/share/hooks/useCanManageShareLink.ts +51 -0
  909. package/src/studio/components/MountayaStudio.tsx +1170 -0
  910. package/src/studio/components/MountayaStudioViewer.tsx +775 -0
  911. package/src/studio/hooks/useEmbeddedStudioConfig.ts +60 -0
  912. package/src/studio/hooks/useViewerActivation.ts +47 -0
  913. package/src/studio/hooks/useViewerCollectionSpecification.ts +58 -0
  914. package/src/studio/hooks/useViewerEmbedConfig.ts +74 -0
  915. package/src/studio/hooks/useViewerFraming.ts +211 -0
  916. package/src/studio/hooks/useViewerMapBindings.ts +109 -0
  917. package/src/styles.css +3994 -0
  918. package/src/testing/collections.ts +40 -0
  919. package/src/testing/hostRegistry.tsx +109 -0
  920. package/src/testing/index.ts +65 -0
  921. package/src/testing/itinerary.ts +297 -0
  922. package/src/testing/mountayaClient.tsx +218 -0
  923. package/src/testing/viewer.tsx +171 -0
  924. package/src/theme/components/StudioPortalScope.tsx +130 -0
  925. package/src/theme/hooks/useResolvedStudioTheme.ts +37 -0
  926. package/src/theme/rules/density.ts +157 -0
  927. package/src/theme/rules/mountayaStudioTheme.ts +114 -0
  928. package/src/theme/rules/passwordManager.ts +20 -0
  929. package/src/theme/rules/tokenStyle.ts +18 -0
  930. package/src/theme/rules/tokens.ts +71 -0
  931. package/src/theme/rules/tone.ts +34 -0
  932. package/src/theme/rules/zIndex.ts +40 -0
  933. package/src/video/components/CameraStep.tsx +82 -0
  934. package/src/video/components/DirectingScrim.tsx +28 -0
  935. package/src/video/components/DirectorChat.tsx +79 -0
  936. package/src/video/components/FormatStep.tsx +487 -0
  937. package/src/video/components/ModeCards.tsx +141 -0
  938. package/src/video/components/PlanNumberField.tsx +54 -0
  939. package/src/video/components/PreviewControls.tsx +212 -0
  940. package/src/video/components/PreviewStage.tsx +319 -0
  941. package/src/video/components/PreviewSurface.tsx +247 -0
  942. package/src/video/components/PreviewWatermark.tsx +77 -0
  943. package/src/video/components/ProfileOverlayCanvas.tsx +195 -0
  944. package/src/video/components/ProfileStep.tsx +254 -0
  945. package/src/video/components/RecordProgress.tsx +117 -0
  946. package/src/video/components/ReviewStep.tsx +244 -0
  947. package/src/video/components/ShotList.tsx +452 -0
  948. package/src/video/components/VideoExportWizard.tsx +827 -0
  949. package/src/video/components/WizardDirectingIndicator.tsx +57 -0
  950. package/src/video/components/WizardFooter.tsx +112 -0
  951. package/src/video/hooks/usePreviewPlanRefresh.ts +91 -0
  952. package/src/video/hooks/useVideoItinerarySubject.ts +18 -0
  953. package/src/video/hooks/useVideoOrganizationId.ts +30 -0
  954. package/src/video/hooks/useVideoPreviewSeed.ts +203 -0
  955. package/src/video/hooks/useVideoProfileSeed.ts +53 -0
  956. package/src/video/hooks/useVideoPublication.ts +29 -0
  957. package/src/video/hooks/useVideoRouteReady.ts +52 -0
  958. package/src/video/hooks/useVideoRouteSync.ts +100 -0
  959. package/src/video/hooks/useVideoTileTransform.ts +88 -0
  960. package/src/video/index.ts +24 -0
  961. package/src/video/providers/DirectorChatProvider.tsx +293 -0
  962. package/src/video/rules/changeTo.ts +20 -0
  963. package/src/zone/components/ZoneActionsMenu.tsx +305 -0
  964. package/src/zone/components/ZoneAvailabilityFields.tsx +98 -0
  965. package/src/zone/components/ZoneForm.tsx +622 -0
  966. package/src/zone/components/ZoneInheritedContext.tsx +70 -0
  967. package/src/zone/components/ZoneLevelSelect.tsx +86 -0
  968. package/src/zone/components/ZoneMetadataFields.tsx +89 -0
  969. package/src/zone/components/ZoneMethodSelect.tsx +90 -0
  970. package/src/zone/components/ZoneModeSelect.tsx +98 -0
  971. package/src/zone/components/ZoneRangeInput.tsx +129 -0
  972. package/src/zone/components/ZoneReachabilityFields.tsx +120 -0
  973. package/src/zone/components/ZoneSubHeader.tsx +188 -0
  974. package/src/zone/components/ZoneVisibility.tsx +94 -0
  975. package/src/zone/hooks/useStudioReachabilityStart.ts +79 -0
  976. package/src/zone/hooks/useStudioZonesBrowsed.ts +32 -0
@@ -0,0 +1,2238 @@
1
+ "use client";
2
+ "use strict";
3
+ const require_SuggestionRowLayout = require("./chunk-BNSJoNwO.cjs");
4
+ const require_FullscreenModal = require("./chunk-C-9wXKm5.cjs");
5
+ const require_WizardLayout = require("./chunk-BmJDHIlZ.cjs");
6
+ const require_useStudioDispatch = require("./chunk-Vp0uJb7O.cjs");
7
+ const require_useStudioEntitlement = require("./chunk-yO-Ek9RH.cjs");
8
+ const require_useUiStore = require("./chunk-Ce4D2B8W.cjs");
9
+ const require_copilot = require("./chunk-DhwoAmi8.cjs");
10
+ const require_studio = require("./chunk-nwutfrnH.cjs");
11
+ const require_studioStrings = require("./chunk-Dy59Tdfm.cjs");
12
+ const require_DialogSubject = require("./chunk-BybRyFen.cjs");
13
+ const require_PublicationNotice = require("./chunk-C60kC4oZ.cjs");
14
+ const require_SectionHead = require("./chunk-6v2fJIDh.cjs");
15
+ const require_SectionTabs = require("./chunk-CaTeIppS.cjs");
16
+ const require_useItinerarySubject = require("./chunk-BjQzK3c3.cjs");
17
+ const require_useStudioItinerary = require("./chunk-DcLLI7B1.cjs");
18
+ const require_useStudioPreferences = require("./chunk-CT6i9_8G.cjs");
19
+ const require_useUiStoreShallow = require("./chunk-D0VevtWq.cjs");
20
+ const require_missingSeam = require("./chunk-DetGuqR8.cjs");
21
+ const require_RadioOptionCard = require("./chunk-DfQZch7H.cjs");
22
+ const require_sizing = require("./chunk-CQAuAPOE.cjs");
23
+ const require_ChatTranscript = require("./chunk-pb64dLGD.cjs");
24
+ const require_useShallowSelector = require("./chunk-DWxCDSxn.cjs");
25
+ const require_UnpublishedPanel = require("./chunk-B8mS5bGc.cjs");
26
+ const require_hostRegistry = require("./chunk-C1NzDn7y.cjs");
27
+ const require_UnitPickerGrid = require("./chunk-cTRnGhbF.cjs");
28
+ const require_ErrorAlert = require("./chunk-JDLVWYk5.cjs");
29
+ let _mantine_core = require("@mantine/core");
30
+ let _mountaya_studio = require("@mountaya/studio");
31
+ let react = require("react");
32
+ let _mountaya_elements_style = require("@mountaya/elements/style");
33
+ let _mountaya_studio_strings = require("@mountaya/studio/strings");
34
+ let react_jsx_runtime = require("react/jsx-runtime");
35
+ let _mountaya_elements_i18n = require("@mountaya/elements/i18n");
36
+ let _mountaya_elements_react = require("@mountaya/elements-react");
37
+ let _mountaya_studio_agent = require("@mountaya/studio/agent");
38
+ let _mountaya_elements_geo = require("@mountaya/elements/geo");
39
+ let _mantine_hooks = require("@mantine/hooks");
40
+ let _mountaya_studio_handlers = require("@mountaya/studio/handlers");
41
+ let _mountaya_elements_profile = require("@mountaya/elements/profile");
42
+ let _mountaya_elements_data = require("@mountaya/elements/data");
43
+ let _mountaya_elements_units = require("@mountaya/elements/units");
44
+ let _mountaya_elements_react_editor = require("@mountaya/elements-react/editor");
45
+ let _mountaya_elements = require("@mountaya/elements");
46
+ let _mountaya_elements_camera = require("@mountaya/elements/camera");
47
+ let _mountaya_elements_video = require("@mountaya/elements/video");
48
+ const useVideoItinerarySubject = (itineraryId) => require_useItinerarySubject.useItinerarySubjectById(itineraryId ?? void 0);
49
+ const useVideoOrganizationId = () => {
50
+ const itineraryId = require_useUiStore.useUiStore((state) => state.videoExport?.itineraryId ?? null);
51
+ const { data } = require_useStudioItinerary.useStudioItinerary(itineraryId ?? void 0);
52
+ return data?.organization_id;
53
+ };
54
+ const useVideoProfileSeed = () => {
55
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
56
+ const preferencesRef = (0, _mountaya_elements_react.useLatestRef)(require_useStudioPreferences.useStudioPreferences());
57
+ (0, react.useEffect)(() => {
58
+ const preferences = preferencesRef.current;
59
+ const length = _mountaya_studio.unitLengthSchema.catch("metric").parse(preferences?.length);
60
+ const pace = _mountaya_studio.unitPaceSchema.catch("per-time").parse(preferences?.pace);
61
+ const slope = _mountaya_studio.unitSlopeSchema.catch("degrees").parse(preferences?.slope);
62
+ const language = _mountaya_studio.languageSchema.catch("en").parse(preferences?.language);
63
+ dispatch("studio.video.profile.units.set", {
64
+ length,
65
+ pace,
66
+ slope
67
+ });
68
+ dispatch("studio.video.profile.language.set", { language });
69
+ }, [dispatch, preferencesRef]);
70
+ };
71
+ const useVideoPublication = (itineraryId) => {
72
+ const { data, isError } = require_useStudioItinerary.useStudioItinerary(itineraryId ?? void 0);
73
+ return (0, _mountaya_studio_strings.publicationStateOf)(data, isError);
74
+ };
75
+ const useVideoRouteReady = () => {
76
+ const { itineraryId, segmentId } = require_useUiStoreShallow.useUiStoreShallow((state) => ({
77
+ itineraryId: state.videoExport?.itineraryId ?? null,
78
+ segmentId: state.videoExport?.segmentId ?? null
79
+ }));
80
+ const { data, isError } = require_useStudioItinerary.useStudioItinerary(itineraryId ?? void 0, "published");
81
+ return (0, react.useMemo)(() => {
82
+ if (!data) return isError ? "error" : "loading";
83
+ return (0, _mountaya_elements_camera.itineraryToRouteGeometry)(data, segmentId) ? "ready" : "empty";
84
+ }, [
85
+ data,
86
+ isError,
87
+ segmentId
88
+ ]);
89
+ };
90
+ const useVideoRouteSync = () => {
91
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
92
+ const { itineraryId, segmentId } = require_useUiStoreShallow.useUiStoreShallow((state) => ({
93
+ itineraryId: state.videoExport?.itineraryId ?? null,
94
+ segmentId: state.videoExport?.segmentId ?? null
95
+ }));
96
+ const { data } = require_useStudioItinerary.useStudioItinerary(itineraryId ?? void 0, "published");
97
+ const categories = require_studio.useStudioActivities();
98
+ const activityIconUrl = require_studio.useStudioActivityIconUrl();
99
+ const activity = data ? (0, _mountaya_studio.activityForId)(categories, data.activity_id ?? "") : null;
100
+ const activityGlyphUrl = (activity ? activityIconUrl(activity.slug) : null) ?? null;
101
+ (0, react.useEffect)(() => {
102
+ if (!itineraryId || !data) return;
103
+ const route = (0, _mountaya_elements_camera.itineraryToRouteGeometry)(data, segmentId);
104
+ if (!route) {
105
+ dispatch("studio.video.route.set", {
106
+ activityGlyphUrl: null,
107
+ profileSource: null,
108
+ route: null
109
+ });
110
+ return;
111
+ }
112
+ const segments = (0, _mountaya_elements_data.segmentsForSelection)(data, segmentId);
113
+ const profileSource = {
114
+ elevationPoints: (0, _mountaya_elements_profile.buildElevationPoints)(segments),
115
+ segmentSpans: (0, _mountaya_studio.videoRouteSpans)(data, segmentId),
116
+ slopeBands: (0, _mountaya_elements_profile.buildInfoBands)(segments, (segment) => segment.slope_info),
117
+ surfaceBands: (0, _mountaya_elements_profile.buildInfoBands)(segments, (segment) => segment.surface_info),
118
+ waytypeBands: (0, _mountaya_elements_profile.buildInfoBands)(segments, (segment) => segment.way_type_info)
119
+ };
120
+ dispatch("studio.video.route.set", {
121
+ activityGlyphUrl,
122
+ profileSource,
123
+ route
124
+ });
125
+ }, [
126
+ activityGlyphUrl,
127
+ dispatch,
128
+ data,
129
+ itineraryId,
130
+ segmentId
131
+ ]);
132
+ };
133
+ const SECTIONS$12 = [
134
+ "confirm",
135
+ "copilot",
136
+ "director",
137
+ "prompt"
138
+ ];
139
+ const DirectorChatContext = (0, react.createContext)(null);
140
+ const useDirectorChat = () => {
141
+ const value = (0, react.use)(DirectorChatContext);
142
+ if (!value) throw require_missingSeam.missingSeam("useDirectorChat", { component: "DirectorChatProvider" });
143
+ return value;
144
+ };
145
+ const useDirectorChatSurface = () => (0, react.use)(DirectorChatContext);
146
+ const useDirectorStore = (selector) => {
147
+ const { store } = useDirectorChat();
148
+ return require_copilot.useStoreSlice(store, selector);
149
+ };
150
+ const hold = () => {};
151
+ const directorPair = (config) => {
152
+ const store = (0, _mountaya_studio.createVideoDirectorStore)();
153
+ return {
154
+ engine: new _mountaya_studio_agent.DirectorChatEngine({
155
+ ...config,
156
+ store
157
+ }),
158
+ store
159
+ };
160
+ };
161
+ const DirectorChatSession = ({ ctx, invalidateAiConfig, publish, recoveryAddendum }) => {
162
+ const strings = require_studioStrings.useStudioScopedStrings(SECTIONS$12);
163
+ const [bus] = (0, react.useState)(_mountaya_studio_handlers.createVideoDirectorBus);
164
+ const organizationId = useVideoOrganizationId() ?? null;
165
+ const transport = require_SuggestionRowLayout.useAgentChatTransport();
166
+ const config = {
167
+ bus,
168
+ context: ctx,
169
+ errorCopy: require_SuggestionRowLayout.useAgentErrorCopy(),
170
+ invalidateAiConfig,
171
+ organizationId,
172
+ recoveryAddendum,
173
+ strings,
174
+ transport
175
+ };
176
+ const [{ engine, store }, setHeld] = (0, react.useState)(() => directorPair(config));
177
+ const latestConfig = (0, react.useRef)(config);
178
+ (0, react.useEffect)(() => {
179
+ latestConfig.current = config;
180
+ engine.configure(config);
181
+ });
182
+ const setups = (0, react.useRef)(0);
183
+ const ended = (0, react.useRef)(null);
184
+ (0, react.useEffect)(() => {
185
+ if (ended.current === engine) {
186
+ setHeld(directorPair(latestConfig.current));
187
+ return;
188
+ }
189
+ setups.current += 1;
190
+ const setup = setups.current;
191
+ const release = engine.subscribe(hold);
192
+ return () => {
193
+ release();
194
+ queueMicrotask(() => {
195
+ if (setups.current === setup) {
196
+ ended.current = engine;
197
+ engine.dispose();
198
+ }
199
+ });
200
+ };
201
+ }, [engine]);
202
+ const stop = (0, react.useCallback)(() => engine.stop(), [engine]);
203
+ const submit = (0, react.useCallback)((message) => engine.submit(message), [engine]);
204
+ const directing = require_copilot.useStoreSlice(store, _mountaya_studio.selectDirecting);
205
+ const value = (0, react.useMemo)(() => ({
206
+ directing,
207
+ stop,
208
+ store,
209
+ submit
210
+ }), [
211
+ directing,
212
+ stop,
213
+ store,
214
+ submit
215
+ ]);
216
+ (0, react.useLayoutEffect)(() => {
217
+ publish(value);
218
+ }, [publish, value]);
219
+ (0, react.useLayoutEffect)(() => () => publish(null), [publish]);
220
+ return null;
221
+ };
222
+ const DirectorChatProvider = ({ children, ctx, enabled = true, invalidateAiConfig, recoveryAddendum }) => {
223
+ const [surface, setSurface] = (0, react.useState)(null);
224
+ const stated = (0, react.useMemo)(() => enabled ? surface : null, [enabled, surface]);
225
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DirectorChatContext, {
226
+ value: stated,
227
+ children: [enabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DirectorChatSession, {
228
+ ctx,
229
+ invalidateAiConfig,
230
+ publish: setSurface,
231
+ recoveryAddendum
232
+ }) : null, children]
233
+ });
234
+ };
235
+ const changeTo = (options, apply) => (reported) => {
236
+ const value = options.find((option) => String(option) === reported);
237
+ if (value !== void 0) apply(value);
238
+ };
239
+ const SECTIONS$11 = ["video"];
240
+ const videoModeChrome = {
241
+ chase: {
242
+ glyph: "camera-mode-chase",
243
+ orgOnly: false
244
+ },
245
+ cinematic: {
246
+ glyph: "camera-mode-cinematic",
247
+ orgOnly: false
248
+ },
249
+ director: {
250
+ glyph: "camera-mode-director",
251
+ orgOnly: true
252
+ },
253
+ drone: {
254
+ glyph: "camera-mode-drone",
255
+ orgOnly: false
256
+ },
257
+ helicopter: {
258
+ glyph: "camera-mode-helicopter",
259
+ orgOnly: false
260
+ },
261
+ overview: {
262
+ glyph: "camera-mode-overview",
263
+ orgOnly: false
264
+ },
265
+ smart: {
266
+ glyph: "camera-mode-smart",
267
+ orgOnly: false
268
+ }
269
+ };
270
+ const VIDEO_MODES = _mountaya_studio.cameraModeSchema.options.map((mode) => ({
271
+ ...videoModeChrome[mode],
272
+ mode
273
+ }));
274
+ const ModeCards = ({ disabled, mode }) => {
275
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$11);
276
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
277
+ const withOrgModes = require_useStudioEntitlement.useStudioEntitlement("video-organization-modes");
278
+ const onChange = (0, react.useMemo)(() => changeTo(_mountaya_studio.cameraModeSchema.options, (next) => {
279
+ dispatch("studio.video.mode.set", { mode: next });
280
+ }), [dispatch]);
281
+ const presets = VIDEO_MODES.filter((entry) => !entry.orgOnly);
282
+ const director = withOrgModes ? VIDEO_MODES.find((entry) => entry.orgOnly) : void 0;
283
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
284
+ gap: "xxs",
285
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
286
+ variant: "section-label",
287
+ children: words.video.mode.groupLabel
288
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Radio.Group, {
289
+ "aria-label": words.video.mode.groupLabel,
290
+ onChange,
291
+ value: mode,
292
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
293
+ gap: "xs",
294
+ children: [presets.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RadioOptionCard.RadioOptionCard, {
295
+ checked: entry.mode === mode,
296
+ description: words.video.mode[entry.mode].description,
297
+ disabled,
298
+ glyph: entry.glyph,
299
+ title: words.video.mode[entry.mode].title,
300
+ value: entry.mode
301
+ }, entry.mode)), director ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RadioOptionCard.RadioOptionCard, {
302
+ checked: director.mode === mode,
303
+ description: words.video.mode[director.mode].description,
304
+ disabled,
305
+ glyph: director.glyph,
306
+ title: words.video.mode[director.mode].title,
307
+ value: director.mode
308
+ }) : null]
309
+ }), director ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
310
+ c: "dimmed",
311
+ mt: "xs",
312
+ size: "xs",
313
+ children: words.video.mode.directorHint
314
+ }) : null]
315
+ })]
316
+ });
317
+ };
318
+ const PlanNumberField = ({ floor, onSend, value, ...field }) => {
319
+ const [typed, setTyped] = (0, react.useState)();
320
+ const shown = typed !== void 0 && typed.over === value ? typed.text : value;
321
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.NumberInput, {
322
+ ...field,
323
+ onBlur: () => setTyped(void 0),
324
+ onChange: (next) => {
325
+ setTyped({
326
+ over: value,
327
+ text: next
328
+ });
329
+ if (typeof next === "number" && Number.isFinite(next) && (floor ?? next) <= next) onSend(next);
330
+ },
331
+ value: shown
332
+ });
333
+ };
334
+ const SECTIONS$10 = ["video"];
335
+ const zoomDigits = { maximumFractionDigits: 1 };
336
+ const shotFields = _mountaya_studio.cameraShotBaseSchema.shape;
337
+ const boundsOf$1 = (field, toField = (value) => value) => {
338
+ const bound = (value) => value !== null && Number.isFinite(value) ? toField(value) : void 0;
339
+ return {
340
+ max: bound(field.maxValue),
341
+ min: bound(field.minValue)
342
+ };
343
+ };
344
+ const positionBounds = boundsOf$1(shotFields.at, (ratio) => (0, _mountaya_elements_units.convertProportion)(ratio, "ratio", "percent"));
345
+ const zoomBounds = boundsOf$1(shotFields.zoom);
346
+ const pitchBounds = boundsOf$1(shotFields.pitchDeg);
347
+ const holdBounds = boundsOf$1(shotFields.holdMs, (milliseconds) => (0, _mountaya_elements_units.convertDuration)(milliseconds, "millisecond", "second"));
348
+ const speedBounds = boundsOf$1(shotFields.speedScale);
349
+ const rowButtonStyle = {
350
+ flex: 1,
351
+ minWidth: 0,
352
+ overflow: "hidden",
353
+ textOverflow: "ellipsis",
354
+ whiteSpace: "nowrap"
355
+ };
356
+ const ShotEditor = ({ onChange, shot }) => {
357
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$10);
358
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
359
+ gap: "xs",
360
+ w: 240,
361
+ children: [
362
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlanNumberField, {
363
+ clampBehavior: "strict",
364
+ label: words.video.shots.at,
365
+ max: positionBounds.max,
366
+ min: positionBounds.min,
367
+ onSend: (value) => onChange({ at: (0, _mountaya_elements_units.convertProportion)(value, "percent", "ratio") }),
368
+ size: "xs",
369
+ step: 1,
370
+ suffix: "%",
371
+ value: Math.round((0, _mountaya_elements_units.convertProportion)(shot.at, "ratio", "percent"))
372
+ }),
373
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlanNumberField, {
374
+ clampBehavior: "strict",
375
+ label: words.video.shots.zoom,
376
+ max: zoomBounds.max,
377
+ min: zoomBounds.min,
378
+ onSend: (value) => onChange({ zoom: value }),
379
+ size: "xs",
380
+ step: .5,
381
+ value: shot.zoom
382
+ }),
383
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlanNumberField, {
384
+ clampBehavior: "strict",
385
+ label: words.video.shots.pitch,
386
+ max: pitchBounds.max,
387
+ min: pitchBounds.min,
388
+ onSend: (value) => onChange({ pitchDeg: value }),
389
+ size: "xs",
390
+ step: 1,
391
+ suffix: "°",
392
+ value: Math.round(shot.pitchDeg)
393
+ }),
394
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
395
+ gap: 0,
396
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
397
+ component: "label",
398
+ fz: "xs",
399
+ children: words.video.shots.bearingLabel
400
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.SegmentedControl, {
401
+ data: _mountaya_studio.cameraBearingModeSchema.options.map((mode) => ({
402
+ label: words.video.shots.bearing[mode],
403
+ value: mode
404
+ })),
405
+ onChange: (value) => onChange({ bearingMode: _mountaya_studio.cameraBearingModeSchema.parse(value) }),
406
+ value: shot.bearingMode
407
+ })]
408
+ }),
409
+ shot.bearingMode === "value" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlanNumberField, {
410
+ clampBehavior: "strict",
411
+ label: words.video.shots.bearingDeg,
412
+ max: _mountaya_elements_units.DEGREES_PER_TURN,
413
+ min: 0,
414
+ onSend: (value) => onChange({ bearingDeg: value }),
415
+ size: "xs",
416
+ step: 5,
417
+ suffix: "°",
418
+ value: Math.round(shot.bearingDeg ?? 0)
419
+ }) : null,
420
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlanNumberField, {
421
+ clampBehavior: "strict",
422
+ decimalScale: 1,
423
+ label: words.video.shots.hold,
424
+ max: holdBounds.max,
425
+ min: holdBounds.min,
426
+ onSend: (value) => onChange({ holdMs: value * _mountaya_elements_units.MILLISECONDS_PER_SECOND }),
427
+ size: "xs",
428
+ step: .5,
429
+ suffix: " s",
430
+ value: shot.holdMs / _mountaya_elements_units.MILLISECONDS_PER_SECOND
431
+ }),
432
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlanNumberField, {
433
+ clampBehavior: "none",
434
+ decimalScale: 1,
435
+ floor: speedBounds.min,
436
+ isAllowed: ({ floatValue }) => floatValue === void 0 || speedBounds.max === void 0 || floatValue <= speedBounds.max,
437
+ label: words.video.shots.speed,
438
+ max: speedBounds.max,
439
+ min: speedBounds.min,
440
+ onSend: (value) => onChange({ speedScale: value }),
441
+ size: "xs",
442
+ step: .1,
443
+ suffix: "×",
444
+ value: shot.speedScale
445
+ })
446
+ ]
447
+ });
448
+ };
449
+ const ShotRowBase = ({ directing, index, shot, totalMs }) => {
450
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$10);
451
+ const { formatClock, formatNumber } = require_studio.useStudioFormatters();
452
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
453
+ const onSeek = (0, react.useCallback)(() => {
454
+ dispatch("studio.video.preview.seek", { fraction: shot.at });
455
+ }, [dispatch, shot.at]);
456
+ const onRemove = (0, react.useCallback)(() => {
457
+ dispatch("studio.video.shot.remove", { id: shot.id });
458
+ }, [dispatch, shot.id]);
459
+ const setField = (0, react.useCallback)((changes) => {
460
+ dispatch("studio.video.shot.set", {
461
+ id: shot.id,
462
+ ...changes
463
+ });
464
+ }, [dispatch, shot.id]);
465
+ const summary = [
466
+ `z${formatNumber(shot.zoom, zoomDigits)}`,
467
+ `${Math.round(shot.pitchDeg)}°`,
468
+ words.video.shots.bearing[shot.bearingMode],
469
+ shot.holdMs > 0 ? words.video.shots.holdSummary(shot.holdMs / _mountaya_elements_units.MILLISECONDS_PER_SECOND) : null
470
+ ].filter((part) => part !== null).join(" · ");
471
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
472
+ gap: "xs",
473
+ wrap: "nowrap",
474
+ children: [
475
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.UnstyledButton, {
476
+ "aria-label": words.video.shots.jumpTo(index + 1),
477
+ disabled: directing,
478
+ fz: "xs",
479
+ onClick: onSeek,
480
+ style: rowButtonStyle,
481
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
482
+ component: "span",
483
+ fw: 600,
484
+ fz: "xs",
485
+ children: `${index + 1} · ${formatClock(shot.at * totalMs)}`
486
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
487
+ c: "dimmed",
488
+ component: "span",
489
+ fz: "xs",
490
+ ml: "xs",
491
+ children: summary
492
+ })]
493
+ }),
494
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Popover, {
495
+ position: "bottom-end",
496
+ shadow: "md",
497
+ trapFocus: true,
498
+ withinPortal: true,
499
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Popover.Target, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
500
+ "aria-label": words.video.shots.editShot(index + 1),
501
+ disabled: directing,
502
+ variant: "default",
503
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
504
+ name: "action-configure",
505
+ size: require_sizing.iconSizes.sm
506
+ })
507
+ }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Popover.Dropdown, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShotEditor, {
508
+ onChange: setField,
509
+ shot
510
+ }) })]
511
+ }),
512
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
513
+ "aria-label": words.video.shots.remove(index + 1),
514
+ disabled: directing,
515
+ onClick: onRemove,
516
+ variant: "default",
517
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
518
+ name: "action-delete",
519
+ size: require_sizing.iconSizes.sm
520
+ })
521
+ })
522
+ ]
523
+ });
524
+ };
525
+ const ShotRow = (0, react.memo)(ShotRowBase);
526
+ const ShotList = ({ directing, plan }) => {
527
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$10);
528
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
529
+ const uiStore = require_useUiStore.useUiStoreApi();
530
+ const totalMs = (0, _mountaya_elements_camera.planDurationMs)(plan);
531
+ const playheadFraction = (0, react.useCallback)(() => {
532
+ const status = uiStore.getState().videoExport?.status;
533
+ return status && status.kind !== "idle" ? status.fraction : 0;
534
+ }, [uiStore]);
535
+ const onAddShot = (0, react.useCallback)(() => {
536
+ dispatch("studio.video.shot.add", {
537
+ at: playheadFraction(),
538
+ pitchDeg: _mountaya_studio.DEFAULT_SHOT_PITCH_DEG,
539
+ zoom: _mountaya_studio.DEFAULT_SHOT_ZOOM
540
+ });
541
+ }, [dispatch, playheadFraction]);
542
+ const onAddHold = (0, react.useCallback)(() => {
543
+ dispatch("studio.video.shot.addHold", {
544
+ at: playheadFraction(),
545
+ holdMs: _mountaya_studio.DEFAULT_HOLD_MS,
546
+ pitchDeg: _mountaya_studio.DEFAULT_SHOT_PITCH_DEG,
547
+ zoom: _mountaya_studio.DEFAULT_SHOT_ZOOM
548
+ });
549
+ }, [dispatch, playheadFraction]);
550
+ const onAddOrbit = (0, react.useCallback)(() => {
551
+ dispatch("studio.video.orbit", {
552
+ at: playheadFraction(),
553
+ pitchDeg: _mountaya_studio.DEFAULT_SHOT_PITCH_DEG,
554
+ zoom: _mountaya_studio.DEFAULT_SHOT_ZOOM
555
+ });
556
+ }, [dispatch, playheadFraction]);
557
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
558
+ gap: "xs",
559
+ mt: "md",
560
+ children: [
561
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
562
+ variant: "section-label",
563
+ children: words.video.shots.title
564
+ }),
565
+ plan.shots.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
566
+ c: "dimmed",
567
+ size: "xs",
568
+ children: words.video.shots.empty
569
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Stack, {
570
+ gap: "xxs",
571
+ children: plan.shots.map((shot, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShotRow, {
572
+ directing,
573
+ index,
574
+ shot,
575
+ totalMs
576
+ }, shot.id))
577
+ }),
578
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
579
+ gap: "xs",
580
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
581
+ disabled: directing,
582
+ leftSection: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
583
+ name: "action-add",
584
+ size: require_sizing.iconSizes.sm
585
+ }),
586
+ onClick: onAddShot,
587
+ variant: "default",
588
+ children: words.video.shots.add
589
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Menu, {
590
+ position: "bottom-end",
591
+ withinPortal: true,
592
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Target, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
593
+ "aria-label": words.video.shots.more,
594
+ disabled: directing,
595
+ size: "lg",
596
+ variant: "default",
597
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
598
+ name: "more",
599
+ size: require_sizing.iconSizes.sm
600
+ })
601
+ }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Menu.Dropdown, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Item, {
602
+ fz: "xs",
603
+ leftSection: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
604
+ name: "shot-hold",
605
+ size: require_sizing.iconSizes.sm
606
+ }),
607
+ onClick: onAddHold,
608
+ children: words.video.shots.addHold
609
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Item, {
610
+ fz: "xs",
611
+ leftSection: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
612
+ name: "shot-orbit",
613
+ size: require_sizing.iconSizes.sm
614
+ }),
615
+ onClick: onAddOrbit,
616
+ children: words.video.shots.addOrbit
617
+ })] })]
618
+ })]
619
+ })
620
+ ]
621
+ });
622
+ };
623
+ const DIRECTOR_SLOT_REGION_ID = "video-director-slot";
624
+ const CameraStepDirectorSlot = ({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
625
+ id: DIRECTOR_SLOT_REGION_ID,
626
+ children
627
+ });
628
+ const CameraStep = ({ directing, director, plan, scrim }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Box, {
629
+ pos: "relative",
630
+ children: [
631
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModeCards, {
632
+ disabled: directing,
633
+ mode: plan.mode
634
+ }),
635
+ plan.mode === "director" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShotList, {
636
+ directing,
637
+ plan
638
+ }) : null,
639
+ scrim
640
+ ]
641
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CameraStepDirectorSlot, { children: director })] });
642
+ const DirectingScrim = () => {
643
+ const { directing } = useDirectorChat();
644
+ if (!directing) return null;
645
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Overlay, {
646
+ backgroundOpacity: .35,
647
+ blur: 1
648
+ });
649
+ };
650
+ const SECTIONS$9 = ["director", "prompt"];
651
+ const DirectorComposer = () => {
652
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$9);
653
+ const { directing, stop, submit } = useDirectorChat();
654
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatTranscript.ChatComposer, {
655
+ onSend: submit,
656
+ onStop: stop,
657
+ placeholder: words.director.placeholder,
658
+ running: directing,
659
+ stopLabel: words.director.stop
660
+ });
661
+ };
662
+ const TRANSCRIPT_MAX_HEIGHT = 240;
663
+ const DirectorChat = () => {
664
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$9);
665
+ const { directing } = useDirectorChat();
666
+ const transcript = useDirectorStore(require_useShallowSelector.useShallowSelector((store) => store.transcript));
667
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
668
+ gap: "sm",
669
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatTranscript.ChatTranscript, {
670
+ emptyHint: words.director.emptyHint,
671
+ entries: transcript,
672
+ maxHeight: TRANSCRIPT_MAX_HEIGHT,
673
+ running: directing
674
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DirectorComposer, {})]
675
+ });
676
+ };
677
+ const SECTIONS$8 = ["video"];
678
+ const GLYPH_BOX_SIZE = 34;
679
+ const FRAME_MAX_DIM = 22;
680
+ const innerFrameBaseStyle = {
681
+ border: "1.5px solid currentColor",
682
+ borderRadius: "var(--mantine-radius-xxs)"
683
+ };
684
+ const frameDimensions = (aspect) => {
685
+ const [w, h] = aspect.split(":").map(Number);
686
+ if (!w || !h) return {
687
+ height: FRAME_MAX_DIM,
688
+ width: FRAME_MAX_DIM
689
+ };
690
+ const scale = FRAME_MAX_DIM / Math.max(w, h);
691
+ return {
692
+ height: h * scale,
693
+ width: w * scale
694
+ };
695
+ };
696
+ const AspectGlyph = ({ aspect, checked }) => {
697
+ const frameStyle = {
698
+ ...innerFrameBaseStyle,
699
+ ...frameDimensions(aspect)
700
+ };
701
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ThemeIcon, {
702
+ size: GLYPH_BOX_SIZE,
703
+ variant: checked ? "filled" : "light",
704
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: frameStyle })
705
+ });
706
+ };
707
+ const lengthBounds = ((field) => {
708
+ const seconds = (value) => value !== null && Number.isFinite(value) ? (0, _mountaya_elements_units.convertDuration)(value, "millisecond", "second") : void 0;
709
+ return {
710
+ max: seconds(field.maxValue),
711
+ min: seconds(field.minValue)
712
+ };
713
+ })(_mountaya_studio.cameraPlanSchema.shape.targetDurationMs.unwrap());
714
+ const LENGTH_STEP_SECONDS = 5;
715
+ const FORMAT_VALUES = _mountaya_studio_strings.FORMAT_OPTIONS.map((option) => option.value);
716
+ const FPS_VALUES = _mountaya_studio_strings.FPS_OPTIONS.map((option) => option.value);
717
+ const QUALITY_VALUES = _mountaya_studio_strings.QUALITY_OPTIONS.map((option) => option.value);
718
+ const PRESET_DESCRIPTORS = [
719
+ {
720
+ glyph: "frame-vertical",
721
+ orgOnly: false,
722
+ preset: "vertical",
723
+ template: _mountaya_elements_camera.videoPresets.vertical
724
+ },
725
+ {
726
+ glyph: "frame-widescreen",
727
+ orgOnly: false,
728
+ preset: "widescreen",
729
+ template: _mountaya_elements_camera.videoPresets.widescreen
730
+ },
731
+ {
732
+ glyph: "frame-square",
733
+ orgOnly: false,
734
+ preset: "square",
735
+ template: _mountaya_elements_camera.videoPresets.square
736
+ },
737
+ {
738
+ glyph: "frame-custom",
739
+ orgOnly: true,
740
+ preset: "custom",
741
+ template: null
742
+ }
743
+ ];
744
+ const PRESET_VALUES = PRESET_DESCRIPTORS.map((entry) => entry.preset);
745
+ const suggestedSeconds = (route) => {
746
+ if (!route) return null;
747
+ return Math.round((0, _mountaya_elements_camera.suggestVideoLengthMs)((0, _mountaya_elements_camera.routeLengthMeters)(route.line)) / _mountaya_elements_units.MILLISECONDS_PER_SECOND);
748
+ };
749
+ const PlanLengthField = ({ plan, route }) => {
750
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$8);
751
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
752
+ const lengthSeconds = Math.round(plan.targetDurationMs / _mountaya_elements_units.MILLISECONDS_PER_SECOND);
753
+ const suggestion = suggestedSeconds(route);
754
+ const onLengthChange = (0, react.useCallback)((seconds) => {
755
+ dispatch("studio.video.duration.set", { targetDurationMs: seconds * _mountaya_elements_units.MILLISECONDS_PER_SECOND });
756
+ }, [dispatch]);
757
+ const onUseSuggested = (0, react.useCallback)(() => {
758
+ if (suggestion !== null) onLengthChange(suggestion);
759
+ }, [onLengthChange, suggestion]);
760
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
761
+ gap: "xxs",
762
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlanNumberField, {
763
+ clampBehavior: "none",
764
+ floor: lengthBounds.min,
765
+ isAllowed: ({ floatValue }) => floatValue === void 0 || lengthBounds.max === void 0 || floatValue <= lengthBounds.max,
766
+ label: words.video.format.length.label,
767
+ max: lengthBounds.max,
768
+ min: lengthBounds.min,
769
+ onSend: onLengthChange,
770
+ startValue: suggestion ?? void 0,
771
+ step: LENGTH_STEP_SECONDS,
772
+ suffix: ` ${words.video.format.length.unit}`,
773
+ value: lengthSeconds
774
+ }), suggestion !== null && suggestion !== lengthSeconds ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Anchor, {
775
+ component: "button",
776
+ onClick: onUseSuggested,
777
+ size: "xs",
778
+ type: "button",
779
+ children: words.video.format.length.suggested(suggestion)
780
+ }) : null]
781
+ });
782
+ };
783
+ const FormatStep = ({ plan, route }) => {
784
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$8);
785
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
786
+ const withOrgModes = require_useStudioEntitlement.useStudioEntitlement("video-organization-modes");
787
+ const output = plan.output;
788
+ const custom = output.preset === "custom";
789
+ const presets = (0, react.useMemo)(() => withOrgModes ? PRESET_DESCRIPTORS : PRESET_DESCRIPTORS.filter((entry) => !entry.orgOnly), [withOrgModes]);
790
+ const derivedBitrate = (0, _mountaya_elements_camera.bitrateForOutput)(output.resolution, output.fps, output.quality);
791
+ const applyCustom = (0, react.useCallback)((change) => {
792
+ const next = {
793
+ ...output,
794
+ ...change,
795
+ preset: "custom"
796
+ };
797
+ dispatch("studio.video.output.set", {
798
+ ...next,
799
+ bitrateMbps: (0, _mountaya_elements_camera.bitrateForOutput)(next.resolution, next.fps, next.quality)
800
+ });
801
+ }, [dispatch, output]);
802
+ const onPresetChange = (0, react.useMemo)(() => changeTo(PRESET_VALUES, (preset) => {
803
+ if (preset === "custom") {
804
+ applyCustom({});
805
+ return;
806
+ }
807
+ dispatch("studio.video.preset.set", { preset });
808
+ }), [applyCustom, dispatch]);
809
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
810
+ gap: "lg",
811
+ children: [
812
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
813
+ gap: "xxs",
814
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
815
+ variant: "section-label",
816
+ children: words.video.format.preset.groupLabel
817
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Radio.Group, {
818
+ "aria-label": words.video.format.preset.groupLabel,
819
+ onChange: onPresetChange,
820
+ value: output.preset,
821
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Stack, { children: presets.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RadioOptionCard.RadioOptionCard, {
822
+ checked: entry.preset === output.preset,
823
+ description: words.video.format.preset[entry.preset].description,
824
+ glyph: entry.glyph,
825
+ media: entry.template ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AspectGlyph, {
826
+ aspect: entry.template.aspect,
827
+ checked: entry.preset === output.preset
828
+ }) : void 0,
829
+ specs: entry.template ? words.video.format.preset.specs(entry.template.resolution, entry.template.aspect, entry.template.fps, entry.template.bitrateMbps) : void 0,
830
+ title: words.video.format.preset[entry.preset].title,
831
+ value: entry.preset
832
+ }, entry.preset)) })
833
+ })]
834
+ }),
835
+ custom ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
836
+ gap: "md",
837
+ children: [
838
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Input.Wrapper, {
839
+ label: words.video.format.matrix.formatLabel,
840
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.SegmentedControl, {
841
+ data: _mountaya_studio_strings.FORMAT_OPTIONS.map((option) => ({
842
+ label: words.video.format.matrix[option.labelKey],
843
+ value: option.value
844
+ })),
845
+ onChange: changeTo(FORMAT_VALUES, (format) => applyCustom({ format })),
846
+ value: output.format
847
+ })
848
+ }),
849
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Input.Wrapper, {
850
+ label: words.video.format.matrix.resolutionLabel,
851
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.SegmentedControl, {
852
+ data: [..._mountaya_studio_strings.RESOLUTION_OPTIONS],
853
+ onChange: changeTo(_mountaya_studio_strings.RESOLUTION_OPTIONS, (resolution) => applyCustom({ resolution })),
854
+ value: output.resolution
855
+ })
856
+ }),
857
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Input.Wrapper, {
858
+ label: words.video.format.matrix.fpsLabel,
859
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.SegmentedControl, {
860
+ data: _mountaya_studio_strings.FPS_OPTIONS.map((option) => ({
861
+ label: words.video.format.matrix[option.labelKey],
862
+ value: String(option.value)
863
+ })),
864
+ onChange: changeTo(FPS_VALUES, (fps) => applyCustom({ fps })),
865
+ value: String(output.fps)
866
+ })
867
+ }),
868
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Input.Wrapper, {
869
+ label: words.video.format.matrix.qualityLabel,
870
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.SegmentedControl, {
871
+ data: _mountaya_studio_strings.QUALITY_OPTIONS.map((option) => ({
872
+ label: words.video.format.matrix[option.labelKey],
873
+ value: option.value
874
+ })),
875
+ onChange: changeTo(QUALITY_VALUES, (quality) => applyCustom({ quality })),
876
+ value: output.quality
877
+ })
878
+ }),
879
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Input.Wrapper, {
880
+ label: words.video.format.matrix.aspectLabel,
881
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.SegmentedControl, {
882
+ data: [..._mountaya_studio_strings.ASPECT_OPTIONS],
883
+ onChange: changeTo(_mountaya_studio_strings.ASPECT_OPTIONS, (aspect) => applyCustom({ aspect })),
884
+ value: output.aspect
885
+ })
886
+ }),
887
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
888
+ justify: "space-between",
889
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
890
+ c: "dimmed",
891
+ children: words.video.format.matrix.bitrateLabel
892
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, { children: words.video.format.matrix.bitrateValue(derivedBitrate) })]
893
+ })
894
+ ]
895
+ }) : null,
896
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlanLengthField, {
897
+ plan,
898
+ route
899
+ })
900
+ ]
901
+ });
902
+ };
903
+ const SECTIONS$7 = ["video"];
904
+ const SCRUB_STEPS = 1e3;
905
+ const scrubStyle = { flex: 1 };
906
+ const readoutStyle = {
907
+ fontVariantNumeric: "tabular-nums",
908
+ whiteSpace: "nowrap"
909
+ };
910
+ const progressOf = (status) => status?.kind === "previewing" || status?.kind === "parked" ? status.fraction : 0;
911
+ const PreviewControls = ({ disabled, plan }) => {
912
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$7);
913
+ const { formatClock } = require_studio.useStudioFormatters();
914
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
915
+ const uiStore = require_useUiStore.useUiStoreApi();
916
+ const status = require_useUiStore.useUiStore(_mountaya_studio.selectVideoExportStatus);
917
+ const playing = status?.kind === "previewing";
918
+ const fraction = progressOf(status);
919
+ const [loop, setLoop] = (0, react.useState)(false);
920
+ const [dragValue, setDragValue] = (0, react.useState)(null);
921
+ const onPlayPause = (0, react.useCallback)(() => {
922
+ dispatch(playing ? "studio.video.preview.pause" : "studio.video.preview.play", {});
923
+ }, [dispatch, playing]);
924
+ const onStop = (0, react.useCallback)(() => {
925
+ dispatch("studio.video.preview.stop", {});
926
+ }, [dispatch]);
927
+ const onScrub = (0, react.useCallback)((value) => {
928
+ setDragValue(value);
929
+ }, []);
930
+ const onScrubCommit = (0, react.useCallback)((value) => {
931
+ dispatch("studio.video.preview.seek", { fraction: value / SCRUB_STEPS });
932
+ setDragValue(null);
933
+ }, [dispatch]);
934
+ const onToggleLoop = (0, react.useCallback)(() => {
935
+ setLoop((current) => !current);
936
+ }, []);
937
+ const shotMarks = (0, react.useMemo)(() => plan.mode === "director" ? plan.shots.map((shot) => ({ value: Math.round(shot.at * SCRUB_STEPS) })) : void 0, [plan]);
938
+ const totalMs = (0, react.useMemo)(() => (0, _mountaya_elements_camera.planDurationMs)(plan), [plan]);
939
+ (0, react.useEffect)(() => {
940
+ if (!loop || disabled) return;
941
+ return uiStore.subscribe((state, previous) => {
942
+ const before = previous.videoExport?.status;
943
+ const after = state.videoExport?.status;
944
+ if (before?.kind === "previewing" && before.fraction >= 1 && after?.kind === "idle") dispatch("studio.video.preview.start", {});
945
+ });
946
+ }, [
947
+ dispatch,
948
+ disabled,
949
+ loop,
950
+ uiStore
951
+ ]);
952
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
953
+ gap: "sm",
954
+ children: [
955
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
956
+ "aria-keyshortcuts": "Space",
957
+ "aria-label": playing ? words.video.preview.pause : words.video.preview.play,
958
+ disabled,
959
+ onClick: onPlayPause,
960
+ children: playing ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
961
+ name: "media-pause",
962
+ size: require_sizing.iconSizes.sm
963
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
964
+ name: "media-play",
965
+ size: require_sizing.iconSizes.sm
966
+ })
967
+ }),
968
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
969
+ "aria-label": words.video.preview.stop,
970
+ disabled,
971
+ onClick: onStop,
972
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
973
+ name: "media-stop",
974
+ size: require_sizing.iconSizes.sm
975
+ })
976
+ }),
977
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Slider, {
978
+ "aria-label": words.video.preview.scrub,
979
+ disabled,
980
+ label: null,
981
+ marks: shotMarks,
982
+ max: SCRUB_STEPS,
983
+ min: 0,
984
+ onChange: onScrub,
985
+ onChangeEnd: onScrubCommit,
986
+ style: scrubStyle,
987
+ value: dragValue ?? Math.round(fraction * SCRUB_STEPS)
988
+ }),
989
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
990
+ c: "dimmed",
991
+ className: "mtya-studio-visible-from-xs",
992
+ size: "xs",
993
+ style: readoutStyle,
994
+ children: `${formatClock(fraction * totalMs)} / ${formatClock(totalMs)}`
995
+ }),
996
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
997
+ "aria-label": words.video.preview.loop,
998
+ "aria-pressed": loop,
999
+ disabled,
1000
+ onClick: onToggleLoop,
1001
+ variant: loop ? "filled" : "default",
1002
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
1003
+ name: "media-loop",
1004
+ size: require_sizing.iconSizes.sm
1005
+ })
1006
+ })
1007
+ ]
1008
+ });
1009
+ };
1010
+ const parkPreview = async (dispatch, fraction) => {
1011
+ const seek = await dispatch("studio.video.preview.seek", { fraction });
1012
+ if (seek.ok && seek.data.parked) await dispatch("studio.video.preview.pause", {});
1013
+ };
1014
+ const usePreviewPlanRefresh = (client, plan) => {
1015
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
1016
+ const uiStore = require_useUiStore.useUiStoreApi();
1017
+ const lastPlanRef = (0, react.useRef)(null);
1018
+ (0, react.useEffect)(() => {
1019
+ if (!client) {
1020
+ lastPlanRef.current = plan;
1021
+ return;
1022
+ }
1023
+ if (lastPlanRef.current === null || lastPlanRef.current === plan) {
1024
+ lastPlanRef.current = plan;
1025
+ return;
1026
+ }
1027
+ lastPlanRef.current = plan;
1028
+ const timer = setTimeout(() => {
1029
+ const status = uiStore.getState().videoExport?.status ?? null;
1030
+ const disposition = (0, _mountaya_studio.previewRefreshDisposition)(status, plan);
1031
+ if (disposition.kind === "restart") dispatch("studio.video.preview.start", {});
1032
+ else if (disposition.kind === "park") parkPreview(dispatch, disposition.fraction);
1033
+ }, _mountaya_studio.PREVIEW_PLAN_REFRESH_DEBOUNCE_MS);
1034
+ return () => clearTimeout(timer);
1035
+ }, [
1036
+ client,
1037
+ dispatch,
1038
+ plan,
1039
+ uiStore
1040
+ ]);
1041
+ };
1042
+ const itineraryIcons = (segments, waypoints) => {
1043
+ const icons = [];
1044
+ for (const waypoint of waypoints) if (waypoint.icon && waypoint.color) icons.push({
1045
+ color: waypoint.color,
1046
+ icon: waypoint.icon
1047
+ });
1048
+ for (const segment of segments) if (segment.color) {
1049
+ icons.push({
1050
+ color: segment.color,
1051
+ icon: "flag-start"
1052
+ });
1053
+ icons.push({
1054
+ color: segment.color,
1055
+ icon: "flag-end"
1056
+ });
1057
+ }
1058
+ return icons;
1059
+ };
1060
+ const useVideoPreviewSeed = (client) => {
1061
+ const { manifest: layers } = (0, _mountaya_elements_react.useMountayaLayersManifest)();
1062
+ const demUrl = require_studio.useStudioDemUrl();
1063
+ const language = require_useStudioPreferences.useStudioPreferences()?.language;
1064
+ const route = require_useUiStore.useUiStore(_mountaya_studio.selectVideoExportRoute);
1065
+ const itineraryId = require_useUiStore.useUiStore((state) => state.videoExport?.itineraryId ?? null);
1066
+ const { terrain, terrainVariant } = require_useUiStoreShallow.useUiStoreShallow((state) => ({
1067
+ terrain: state.terrain,
1068
+ terrainVariant: state.terrainVariant
1069
+ }));
1070
+ const { data: detail } = require_useStudioItinerary.useStudioItinerary(itineraryId ?? void 0, "published");
1071
+ const baseTerrain = (0, react.useMemo)(() => layers ? (0, _mountaya_studio.resolveBaseTerrain)(layers.terrains ?? [], terrain, terrainVariant, (0, _mountaya_studio.resolveDemUrl)(layers, demUrl)) : null, [
1072
+ demUrl,
1073
+ layers,
1074
+ terrain,
1075
+ terrainVariant
1076
+ ]);
1077
+ const styleUrl = baseTerrain?.styleUrl;
1078
+ const terrainDemUrl = baseTerrain?.demUrl;
1079
+ (0, react.useEffect)(() => {
1080
+ if (!client || styleUrl === void 0) return;
1081
+ client.setBaseTerrain(terrainDemUrl ? {
1082
+ demUrl: terrainDemUrl,
1083
+ styleUrl
1084
+ } : { styleUrl });
1085
+ }, [
1086
+ client,
1087
+ styleUrl,
1088
+ terrainDemUrl
1089
+ ]);
1090
+ (0, react.useEffect)(() => {
1091
+ if (!client || !layers) return;
1092
+ const sources = [...layers.itineraries?.sources ?? [], ...layers.zones?.sources ?? []];
1093
+ if (sources.length > 0) client.addTileSources(sources);
1094
+ }, [client, layers]);
1095
+ const seeded = layers !== void 0 && layers !== null;
1096
+ (0, react.useEffect)(() => {
1097
+ if (!client || !seeded) return;
1098
+ client.setMapLanguage((0, _mountaya_elements_style.clampMapLanguage)(language));
1099
+ }, [
1100
+ client,
1101
+ language,
1102
+ seeded
1103
+ ]);
1104
+ (0, react.useEffect)(() => {
1105
+ if (!client || !seeded || !detail || !itineraryId) return;
1106
+ const icons = itineraryIcons(detail.segments ?? [], detail.waypoints ?? []);
1107
+ if (icons.length > 0) client.prewarmItineraryIcons(icons);
1108
+ }, [
1109
+ client,
1110
+ detail,
1111
+ itineraryId,
1112
+ seeded,
1113
+ styleUrl,
1114
+ terrainDemUrl
1115
+ ]);
1116
+ (0, react.useEffect)(() => {
1117
+ if (!client || !seeded || !detail || !itineraryId) return;
1118
+ client.setItineraryEmphasis({
1119
+ id: itineraryId,
1120
+ mode: "itinerary"
1121
+ });
1122
+ }, [
1123
+ client,
1124
+ detail,
1125
+ itineraryId,
1126
+ seeded
1127
+ ]);
1128
+ (0, react.useEffect)(() => {
1129
+ if (!client || !seeded || !route) return;
1130
+ const bounds = (0, _mountaya_elements_geo.boundsOf)([{
1131
+ coordinates: route.line,
1132
+ type: "LineString"
1133
+ }]);
1134
+ if (bounds) client.fitBounds(bounds);
1135
+ }, [
1136
+ client,
1137
+ route,
1138
+ seeded
1139
+ ]);
1140
+ };
1141
+ const withPublishedSurface = (url) => `${url}${url.includes("?") ? "&" : "?"}surface=published`;
1142
+ const publishedTileTransform = (client) => {
1143
+ const transport = client.transport;
1144
+ let claim;
1145
+ try {
1146
+ claim = (0, _mountaya_elements.createTransformRequest)({
1147
+ ...transport.mapCredential,
1148
+ language: transport.requestLanguage ?? "*",
1149
+ origins: [transport.tilesBaseUrl],
1150
+ sessionToken: () => transport.mapCredential.sessionToken
1151
+ });
1152
+ } catch {
1153
+ return;
1154
+ }
1155
+ return (url) => {
1156
+ const request = claim(url);
1157
+ return request.credentials === void 0 ? void 0 : {
1158
+ ...request,
1159
+ url: withPublishedSurface(request.url)
1160
+ };
1161
+ };
1162
+ };
1163
+ const useVideoTileTransform = (mapClient, transformRequest) => {
1164
+ const stated = transformRequest !== void 0;
1165
+ const derived = (0, react.useMemo)(() => stated ? void 0 : publishedTileTransform(mapClient), [mapClient, stated]);
1166
+ return transformRequest ?? derived;
1167
+ };
1168
+ const previewWatermarkAnchorStyle = {
1169
+ left: `calc(100cqmin * ${_mountaya_elements_video.WATERMARK_INSET_PX} / ${_mountaya_elements_video.WATERMARK_REFERENCE_SHORT_SIDE})`,
1170
+ pointerEvents: "none",
1171
+ position: "absolute",
1172
+ top: `calc(100cqmin * ${_mountaya_elements_video.WATERMARK_INSET_PX} / ${_mountaya_elements_video.WATERMARK_REFERENCE_SHORT_SIDE})`,
1173
+ zIndex: 2
1174
+ };
1175
+ const previewWatermarkImageStyle = {
1176
+ display: "block",
1177
+ height: "auto",
1178
+ width: `calc(100cqmin * ${_mountaya_elements_video.WATERMARK_WIDTH_PX} / ${_mountaya_elements_video.WATERMARK_REFERENCE_SHORT_SIDE})`
1179
+ };
1180
+ const PreviewWatermark = () => {
1181
+ if (require_useStudioEntitlement.useStudioEntitlement("white-label")) return null;
1182
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
1183
+ "aria-hidden": true,
1184
+ style: previewWatermarkAnchorStyle,
1185
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
1186
+ alt: "",
1187
+ "aria-hidden": true,
1188
+ src: _mountaya_elements_video.WATERMARK_URL,
1189
+ style: previewWatermarkImageStyle
1190
+ })
1191
+ });
1192
+ };
1193
+ const overlayStyle = {
1194
+ height: "100%",
1195
+ inset: 0,
1196
+ pointerEvents: "none",
1197
+ position: "absolute",
1198
+ width: "100%"
1199
+ };
1200
+ const fractionOf = (state) => {
1201
+ const status = (0, _mountaya_studio.selectVideoExportStatus)(state);
1202
+ return status && status.kind !== "idle" ? status.fraction : 0;
1203
+ };
1204
+ const ProfileOverlayCanvas = () => {
1205
+ const canvasRef = (0, react.useRef)(null);
1206
+ const store = require_useUiStore.useUiStoreApi();
1207
+ const plan = require_useUiStore.useUiStore(_mountaya_studio.selectVideoExportPlan);
1208
+ const route = require_useUiStore.useUiStore(_mountaya_studio.selectVideoExportRoute);
1209
+ const profileSource = require_useUiStore.useUiStore((state) => state.videoExport?.profileSource ?? null);
1210
+ const design = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.design ?? "graph");
1211
+ const length = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.length ?? "metric");
1212
+ const pace = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.pace ?? "per-time");
1213
+ const slope = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.slope ?? "degrees");
1214
+ const language = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.language ?? "en");
1215
+ const samples = (0, react.useMemo)(() => {
1216
+ if (!plan || !route || !profileSource) return [];
1217
+ return (0, _mountaya_elements_camera.resolveProfileSamples)(plan, route, profileSource);
1218
+ }, [
1219
+ plan,
1220
+ route,
1221
+ profileSource
1222
+ ]);
1223
+ const curve = (0, react.useMemo)(() => (0, _mountaya_elements_video.buildProfileCurve)(samples), [samples]);
1224
+ (0, react.useEffect)(() => {
1225
+ const canvas = canvasRef.current;
1226
+ if (!canvas) return;
1227
+ const context = canvas.getContext("2d");
1228
+ if (!context) return;
1229
+ const draw = () => {
1230
+ const ratio = window.devicePixelRatio || 1;
1231
+ const cssWidth = canvas.clientWidth;
1232
+ const cssHeight = canvas.clientHeight;
1233
+ const pixelWidth = Math.max(1, Math.round(cssWidth * ratio));
1234
+ const pixelHeight = Math.max(1, Math.round(cssHeight * ratio));
1235
+ if (canvas.width !== pixelWidth || canvas.height !== pixelHeight) {
1236
+ canvas.width = pixelWidth;
1237
+ canvas.height = pixelHeight;
1238
+ }
1239
+ context.clearRect(0, 0, canvas.width, canvas.height);
1240
+ if (samples.length === 0) return;
1241
+ const fraction = fractionOf(store.getState());
1242
+ const lastIndex = samples.length - 1;
1243
+ const index = Math.min(lastIndex, Math.max(0, Math.round(fraction * lastIndex)));
1244
+ const sample = samples[index];
1245
+ if (!sample) return;
1246
+ _mountaya_elements_video.profileOverlayDesigns[design](context, sample, curve, {
1247
+ height: canvas.height,
1248
+ width: canvas.width
1249
+ }, {
1250
+ language,
1251
+ length,
1252
+ pace,
1253
+ slope,
1254
+ temperature: "celsius"
1255
+ });
1256
+ };
1257
+ draw();
1258
+ let disposed = false;
1259
+ (0, _mountaya_elements_video.ensureOverlayFonts)().then(() => {
1260
+ if (!disposed) draw();
1261
+ });
1262
+ const observer = new ResizeObserver(() => draw());
1263
+ observer.observe(canvas);
1264
+ const unsubscribe = store.subscribe((state, previous) => {
1265
+ if (fractionOf(state) !== fractionOf(previous)) draw();
1266
+ });
1267
+ return () => {
1268
+ disposed = true;
1269
+ observer.disconnect();
1270
+ unsubscribe();
1271
+ };
1272
+ }, [
1273
+ store,
1274
+ samples,
1275
+ curve,
1276
+ design,
1277
+ length,
1278
+ pace,
1279
+ slope,
1280
+ language
1281
+ ]);
1282
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("canvas", {
1283
+ ref: canvasRef,
1284
+ style: overlayStyle
1285
+ });
1286
+ };
1287
+ const previewFrameStyle = {
1288
+ borderRadius: "var(--mantine-radius-md)",
1289
+ containerType: "size",
1290
+ height: "100%",
1291
+ overflow: "hidden",
1292
+ position: "relative",
1293
+ width: "100%"
1294
+ };
1295
+ const buildVideoRun = (map) => new _mountaya_elements_video.VideoRunEngine(map.raw, map.events, () => map.loadOrganization());
1296
+ const PreviewMap = ({ client, mapClient, onClient, plan, transformRequest }) => {
1297
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
1298
+ const { registerVideoMap, unregisterVideoMap } = require_hostRegistry.useStudioHostRegistry();
1299
+ useVideoPreviewSeed(client);
1300
+ const tileTransform = useVideoTileTransform(mapClient, transformRequest);
1301
+ const planRef = (0, _mountaya_elements_react.useLatestRef)(plan);
1302
+ const onClientReady = (0, react.useCallback)((next) => {
1303
+ registerVideoMap(next);
1304
+ onClient(next);
1305
+ }, [registerVideoMap, onClient]);
1306
+ const onClientDestroy = (0, react.useCallback)(() => {
1307
+ unregisterVideoMap();
1308
+ onClient(null);
1309
+ }, [unregisterVideoMap, onClient]);
1310
+ (0, react.useEffect)(() => {
1311
+ if (!client) return;
1312
+ parkPreview(dispatch, (0, _mountaya_elements_camera.representativeStillFraction)(planRef.current));
1313
+ return () => {
1314
+ dispatch("studio.video.preview.stop", {});
1315
+ };
1316
+ }, [
1317
+ dispatch,
1318
+ client,
1319
+ planRef
1320
+ ]);
1321
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mountaya_elements_react_editor.ViewerMapView, {
1322
+ client: mapClient,
1323
+ interactive: false,
1324
+ maxTileCacheSize: _mountaya_elements_video.MAX_TILE_CACHE_SIZE,
1325
+ onClientDestroy,
1326
+ onClientReady,
1327
+ preserveDrawingBuffer: true,
1328
+ transformRequest: tileTransform,
1329
+ video: buildVideoRun,
1330
+ withUrlHash: false
1331
+ });
1332
+ };
1333
+ const PreviewSurface = ({ client, mapClient, onClient, plan, transformRequest }) => {
1334
+ usePreviewPlanRefresh(client, plan);
1335
+ const profileEnabled = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.enabled ?? false);
1336
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1337
+ className: "ph-no-capture",
1338
+ style: previewFrameStyle,
1339
+ children: [
1340
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewMap, {
1341
+ client,
1342
+ mapClient,
1343
+ onClient,
1344
+ plan,
1345
+ transformRequest
1346
+ }),
1347
+ profileEnabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfileOverlayCanvas, {}) : null,
1348
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewWatermark, {})
1349
+ ]
1350
+ });
1351
+ };
1352
+ const SECTIONS$6 = ["publish", "video"];
1353
+ const stageBackdropStyle = {
1354
+ display: "flex",
1355
+ flexDirection: "column"
1356
+ };
1357
+ const frameBackdropStyle = {
1358
+ alignItems: "center",
1359
+ display: "flex",
1360
+ flex: 1,
1361
+ justifyContent: "center",
1362
+ minHeight: 0,
1363
+ overflow: "hidden"
1364
+ };
1365
+ const frameBaseStyle = {
1366
+ height: "100%",
1367
+ maxWidth: "100%",
1368
+ width: "auto"
1369
+ };
1370
+ const containedFrameSize = (outerWidth, outerHeight, ratio) => {
1371
+ if (![
1372
+ outerWidth,
1373
+ outerHeight,
1374
+ ratio
1375
+ ].every((value) => Number.isFinite(value) && value > 0)) return null;
1376
+ if (outerWidth / outerHeight > ratio) return {
1377
+ height: outerHeight,
1378
+ width: outerHeight * ratio
1379
+ };
1380
+ const width = outerWidth;
1381
+ return {
1382
+ height: width / ratio,
1383
+ width
1384
+ };
1385
+ };
1386
+ const routeStateCoverStyle = {
1387
+ alignItems: "center",
1388
+ display: "flex",
1389
+ inset: 0,
1390
+ justifyContent: "center",
1391
+ pointerEvents: "none",
1392
+ position: "absolute"
1393
+ };
1394
+ const UnpublishedStage = ({ itineraryId, organizationId }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
1395
+ className: "mtya-preview-stage",
1396
+ miw: 0,
1397
+ pos: "relative",
1398
+ style: stageBackdropStyle,
1399
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UnpublishedPanel.UnpublishedPanel, {
1400
+ itineraryId,
1401
+ organizationId
1402
+ })
1403
+ });
1404
+ const PreviewStage = ({ client, directing, indicator, mapClient, notice, onClient, plan, recording, routeState = "ready", transformRequest }) => {
1405
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$6);
1406
+ const ratio = (0, _mountaya_elements_camera.aspectRatio)(plan.output.aspect);
1407
+ const backdropRef = (0, react.useRef)(null);
1408
+ const [frameSize, setFrameSize] = (0, react.useState)(null);
1409
+ (0, react.useLayoutEffect)(() => {
1410
+ const backdrop = backdropRef.current;
1411
+ if (!backdrop) return;
1412
+ const measure = () => {
1413
+ const rect = backdrop.getBoundingClientRect();
1414
+ setFrameSize(containedFrameSize(rect.width, rect.height, ratio));
1415
+ };
1416
+ measure();
1417
+ if (typeof ResizeObserver === "undefined") return;
1418
+ const observer = new ResizeObserver(measure);
1419
+ observer.observe(backdrop);
1420
+ return () => observer.disconnect();
1421
+ }, [ratio]);
1422
+ const frameStyle = (0, react.useMemo)(() => frameSize ? {
1423
+ height: frameSize.height,
1424
+ width: frameSize.width
1425
+ } : {
1426
+ ...frameBaseStyle,
1427
+ aspectRatio: ratio
1428
+ }, [frameSize, ratio]);
1429
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Box, {
1430
+ bg: "dark.8",
1431
+ className: "mtya-preview-stage",
1432
+ miw: 0,
1433
+ pos: "relative",
1434
+ style: stageBackdropStyle,
1435
+ children: [
1436
+ notice === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
1437
+ p: "xs",
1438
+ pb: 0,
1439
+ children: notice
1440
+ }),
1441
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Box, {
1442
+ ref: backdropRef,
1443
+ style: frameBackdropStyle,
1444
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
1445
+ "data-testid": "preview-frame",
1446
+ style: frameStyle,
1447
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewSurface, {
1448
+ client,
1449
+ mapClient,
1450
+ onClient,
1451
+ plan,
1452
+ transformRequest
1453
+ })
1454
+ }), routeState === "ready" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Stack, {
1455
+ align: "center",
1456
+ gap: "xs",
1457
+ style: routeStateCoverStyle,
1458
+ children: routeState === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Loader, { size: "sm" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1459
+ c: "dimmed",
1460
+ size: "sm",
1461
+ children: words.video.preview.loading
1462
+ })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1463
+ c: "dimmed",
1464
+ size: "sm",
1465
+ children: routeState === "error" ? words.video.preview.error : words.video.preview.empty
1466
+ })
1467
+ })]
1468
+ }),
1469
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
1470
+ bg: "var(--mantine-color-body)",
1471
+ px: "md",
1472
+ py: "xs",
1473
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewControls, {
1474
+ disabled: directing || recording || routeState !== "ready",
1475
+ plan
1476
+ })
1477
+ }),
1478
+ indicator
1479
+ ]
1480
+ });
1481
+ };
1482
+ const SECTIONS$5 = ["preferences", "video"];
1483
+ const DESIGN_OPTIONS = [
1484
+ {
1485
+ glyph: "profile-graph",
1486
+ value: "graph"
1487
+ },
1488
+ {
1489
+ glyph: "profile-strip",
1490
+ value: "strip"
1491
+ },
1492
+ {
1493
+ glyph: "profile-minimal",
1494
+ value: "minimal"
1495
+ }
1496
+ ];
1497
+ const LANGUAGE_OPTIONS = _mountaya_studio.languageSchema.options.map((value) => ({
1498
+ label: _mountaya_elements_i18n.languageEndonym[value],
1499
+ value
1500
+ }));
1501
+ const ProfileStep = () => {
1502
+ const languageMark = require_studio.useStudioLanguageMark();
1503
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$5);
1504
+ const headingId = (0, react.useId)();
1505
+ const units = require_studioStrings.useStudioScopedStrings(SECTIONS$5).preferences.units;
1506
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
1507
+ const enabled = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.enabled ?? false);
1508
+ const design = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.design ?? "graph");
1509
+ const length = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.length ?? "metric");
1510
+ const pace = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.pace ?? "per-time");
1511
+ const slope = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.slope ?? "degrees");
1512
+ const language = require_useUiStore.useUiStore((state) => state.videoExport?.profile?.language ?? "en");
1513
+ const onToggle = (0, react.useCallback)((next) => {
1514
+ dispatch("studio.video.profile.toggle", { enabled: next });
1515
+ }, [dispatch]);
1516
+ const onDesignChange = (0, react.useCallback)((value) => {
1517
+ dispatch("studio.video.profile.design.set", { design: _mountaya_studio.profileDesignSchema.parse(value) });
1518
+ }, [dispatch]);
1519
+ const onLengthChange = (0, react.useCallback)((value) => {
1520
+ dispatch("studio.video.profile.units.set", {
1521
+ length: _mountaya_studio.unitLengthSchema.parse(value),
1522
+ pace,
1523
+ slope
1524
+ });
1525
+ }, [
1526
+ dispatch,
1527
+ pace,
1528
+ slope
1529
+ ]);
1530
+ const onPaceChange = (0, react.useCallback)((value) => {
1531
+ dispatch("studio.video.profile.units.set", {
1532
+ length,
1533
+ pace: _mountaya_studio.unitPaceSchema.parse(value),
1534
+ slope
1535
+ });
1536
+ }, [
1537
+ dispatch,
1538
+ length,
1539
+ slope
1540
+ ]);
1541
+ const onSlopeChange = (0, react.useCallback)((value) => {
1542
+ dispatch("studio.video.profile.units.set", {
1543
+ length,
1544
+ pace,
1545
+ slope: _mountaya_studio.unitSlopeSchema.parse(value)
1546
+ });
1547
+ }, [
1548
+ dispatch,
1549
+ length,
1550
+ pace
1551
+ ]);
1552
+ const onLanguageChange = (0, react.useCallback)((value) => {
1553
+ dispatch("studio.video.profile.language.set", { language: value });
1554
+ }, [dispatch]);
1555
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
1556
+ gap: "lg",
1557
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
1558
+ gap: "xxs",
1559
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Switch, {
1560
+ checked: enabled,
1561
+ label: words.video.profile.enable,
1562
+ onChange: (event) => onToggle(event.currentTarget.checked)
1563
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1564
+ c: "dimmed",
1565
+ size: "xs",
1566
+ children: words.video.profile.hint
1567
+ })]
1568
+ }), enabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1569
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
1570
+ gap: "xxs",
1571
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1572
+ variant: "section-label",
1573
+ children: words.video.profile.designLabel
1574
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Radio.Group, {
1575
+ "aria-label": words.video.profile.designLabel,
1576
+ onChange: onDesignChange,
1577
+ value: design,
1578
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Stack, {
1579
+ gap: "xs",
1580
+ children: DESIGN_OPTIONS.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RadioOptionCard.RadioOptionCard, {
1581
+ checked: option.value === design,
1582
+ description: words.video.profile.design[option.value].description,
1583
+ glyph: option.glyph,
1584
+ title: words.video.profile.design[option.value].title,
1585
+ value: option.value
1586
+ }, option.value))
1587
+ })
1588
+ })]
1589
+ }),
1590
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
1591
+ gap: "xxs",
1592
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1593
+ id: `${headingId}-length`,
1594
+ variant: "section-label",
1595
+ children: words.video.profile.lengthLabel
1596
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UnitPickerGrid.UnitPickerGrid, {
1597
+ "aria-labelledby": `${headingId}-length`,
1598
+ kindSlug: "video-length",
1599
+ onChange: onLengthChange,
1600
+ options: (0, _mountaya_studio_strings.lengthUnitOptions)(units),
1601
+ value: length
1602
+ })]
1603
+ }),
1604
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
1605
+ gap: "xxs",
1606
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1607
+ id: `${headingId}-pace`,
1608
+ variant: "section-label",
1609
+ children: words.video.profile.paceLabel
1610
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UnitPickerGrid.UnitPickerGrid, {
1611
+ "aria-labelledby": `${headingId}-pace`,
1612
+ kindSlug: "video-pace",
1613
+ onChange: onPaceChange,
1614
+ options: (0, _mountaya_studio_strings.paceUnitOptions)(units, length),
1615
+ value: pace
1616
+ })]
1617
+ }),
1618
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
1619
+ gap: "xxs",
1620
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1621
+ id: `${headingId}-slope`,
1622
+ variant: "section-label",
1623
+ children: words.video.profile.slopeLabel
1624
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UnitPickerGrid.UnitPickerGrid, {
1625
+ "aria-labelledby": `${headingId}-slope`,
1626
+ kindSlug: "video-slope",
1627
+ onChange: onSlopeChange,
1628
+ options: (0, _mountaya_studio_strings.slopeUnitOptions)(units),
1629
+ value: slope
1630
+ })]
1631
+ }),
1632
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
1633
+ gap: "xxs",
1634
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1635
+ variant: "section-label",
1636
+ children: words.video.profile.languageLabel
1637
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UnitPickerGrid.LanguageSelect, {
1638
+ "aria-label": words.video.profile.languageLabel,
1639
+ onChange: onLanguageChange,
1640
+ options: LANGUAGE_OPTIONS,
1641
+ renderMark: languageMark,
1642
+ value: language
1643
+ })]
1644
+ })
1645
+ ] }) : null]
1646
+ });
1647
+ };
1648
+ const SECTIONS$4 = ["video"];
1649
+ const RecordProgressBar = () => {
1650
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$4);
1651
+ const recording = require_useUiStore.useUiStore((state) => {
1652
+ const status = (0, _mountaya_studio.selectVideoExportStatus)(state);
1653
+ return status?.kind === "recording" ? status : null;
1654
+ });
1655
+ if (!recording) return null;
1656
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
1657
+ align: "center",
1658
+ flex: 1,
1659
+ gap: "sm",
1660
+ role: "status",
1661
+ wrap: "nowrap",
1662
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1663
+ c: "dimmed",
1664
+ size: "xs",
1665
+ children: words.video.record.phase[recording.phase]
1666
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Progress, {
1667
+ flex: 1,
1668
+ value: (0, _mountaya_elements_units.convertProportion)(recording.fraction, "ratio", "percent")
1669
+ })]
1670
+ });
1671
+ };
1672
+ const RecordProgress = ({ outcome }) => {
1673
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$4);
1674
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
1675
+ const onDownload = (0, react.useCallback)(() => {
1676
+ dispatch("studio.video.download", {});
1677
+ }, [dispatch]);
1678
+ if (outcome.kind === "error") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ErrorAlert.ErrorAlert, {
1679
+ title: words.video.record.errorTitle,
1680
+ children: outcome.message
1681
+ });
1682
+ if (outcome.kind === "done") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Alert, {
1683
+ color: "teal",
1684
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
1685
+ name: "success",
1686
+ size: require_sizing.iconSizes.md
1687
+ }),
1688
+ title: words.video.record.doneTitle,
1689
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
1690
+ align: "flex-start",
1691
+ gap: "xs",
1692
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1693
+ size: "sm",
1694
+ children: words.video.record.done
1695
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
1696
+ leftSection: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
1697
+ name: "download",
1698
+ size: require_sizing.iconSizes.sm
1699
+ }),
1700
+ onClick: onDownload,
1701
+ children: words.video.record.download
1702
+ })]
1703
+ })
1704
+ });
1705
+ return null;
1706
+ };
1707
+ const SECTIONS$3 = ["preferences", "video"];
1708
+ const SummaryRow = ({ label, value }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
1709
+ justify: "space-between",
1710
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1711
+ c: "dimmed",
1712
+ children: label
1713
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, { children: value })]
1714
+ });
1715
+ const ReviewSection = ({ children, editLabel, onEdit, title }) => {
1716
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$3);
1717
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
1718
+ gap: "sm",
1719
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
1720
+ justify: "space-between",
1721
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1722
+ variant: "section-label",
1723
+ children: title
1724
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Anchor, {
1725
+ "aria-label": editLabel,
1726
+ component: "button",
1727
+ onClick: onEdit,
1728
+ size: "xs",
1729
+ type: "button",
1730
+ children: words.video.review.edit
1731
+ })]
1732
+ }), children]
1733
+ });
1734
+ };
1735
+ const ReviewStep = ({ outcome, plan }) => {
1736
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$3);
1737
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
1738
+ const profile = require_useUiStore.useUiStore((state) => state.videoExport?.profile ?? _mountaya_studio.defaultVideoExportProfile);
1739
+ const output = plan.output;
1740
+ const editStep = (step) => () => {
1741
+ dispatch("studio.video.step.set", { step });
1742
+ };
1743
+ const bitrate = output.bitrateMbps ?? (0, _mountaya_elements_camera.bitrateForOutput)(output.resolution, output.fps, output.quality);
1744
+ const formatEntry = _mountaya_studio_strings.FORMAT_OPTIONS.find((option) => option.value === output.format);
1745
+ const containerLabel = formatEntry ? words.video.format.matrix[formatEntry.labelKey] : output.format;
1746
+ const qualityEntry = _mountaya_studio_strings.QUALITY_OPTIONS.find((option) => option.value === output.quality);
1747
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
1748
+ gap: "xl",
1749
+ children: [
1750
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ReviewSection, {
1751
+ editLabel: words.video.review.editSection(words.video.review.sections.format),
1752
+ onEdit: editStep("format"),
1753
+ title: words.video.review.sections.format,
1754
+ children: [
1755
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1756
+ label: words.video.review.preset,
1757
+ value: words.video.format.preset[output.preset].title
1758
+ }),
1759
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1760
+ label: words.video.review.length,
1761
+ value: words.video.format.lengthSeconds(Math.round((0, _mountaya_elements_camera.planDurationMs)(plan) / _mountaya_elements_units.MILLISECONDS_PER_SECOND))
1762
+ }),
1763
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1764
+ label: words.video.format.matrix.aspectLabel,
1765
+ value: output.aspect
1766
+ }),
1767
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1768
+ label: words.video.format.matrix.resolutionLabel,
1769
+ value: output.resolution
1770
+ }),
1771
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1772
+ label: words.video.format.matrix.fpsLabel,
1773
+ value: words.video.review.fpsValue(output.fps)
1774
+ }),
1775
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1776
+ label: words.video.format.matrix.formatLabel,
1777
+ value: containerLabel
1778
+ }),
1779
+ output.preset === "custom" && qualityEntry ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1780
+ label: words.video.format.matrix.qualityLabel,
1781
+ value: words.video.format.matrix[qualityEntry.labelKey]
1782
+ }) : null,
1783
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1784
+ label: words.video.format.matrix.bitrateLabel,
1785
+ value: words.video.format.matrix.bitrateValue(bitrate)
1786
+ }),
1787
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1788
+ label: words.video.review.estimatedSize,
1789
+ value: words.video.review.estimatedSizeValue(Math.round((0, _mountaya_elements_camera.estimatedVideoSizeMb)(bitrate, (0, _mountaya_elements_camera.planDurationMs)(plan))))
1790
+ })
1791
+ ]
1792
+ }),
1793
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ReviewSection, {
1794
+ editLabel: words.video.review.editSection(words.video.review.sections.camera),
1795
+ onEdit: editStep("camera"),
1796
+ title: words.video.review.sections.camera,
1797
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1798
+ label: words.video.review.mode,
1799
+ value: words.video.mode[plan.mode].title
1800
+ }), plan.mode === "director" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1801
+ label: words.video.review.shotsLabel,
1802
+ value: words.video.review.shots(plan.shots.length)
1803
+ }) : null]
1804
+ }),
1805
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ReviewSection, {
1806
+ editLabel: words.video.review.editSection(words.video.review.sections.overlay),
1807
+ onEdit: editStep("profile"),
1808
+ title: words.video.review.sections.overlay,
1809
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1810
+ label: words.video.review.overlay,
1811
+ value: profile.enabled ? words.video.review.on : words.video.review.off
1812
+ }), profile.enabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1813
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1814
+ label: words.video.profile.designLabel,
1815
+ value: words.video.profile.design[profile.design].title
1816
+ }),
1817
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1818
+ label: words.video.profile.lengthLabel,
1819
+ value: words.preferences.units[profile.length].name
1820
+ }),
1821
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1822
+ label: words.video.profile.slopeLabel,
1823
+ value: words.preferences.units[profile.slope].name
1824
+ }),
1825
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryRow, {
1826
+ label: words.video.profile.languageLabel,
1827
+ value: _mountaya_elements_i18n.languageEndonym[profile.language]
1828
+ })
1829
+ ] }) : null]
1830
+ }),
1831
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RecordProgress, { outcome })
1832
+ ]
1833
+ });
1834
+ };
1835
+ const SECTIONS$2 = ["director"];
1836
+ const WizardDirectingIndicator = () => {
1837
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$2);
1838
+ const { directing, stop } = useDirectorChat();
1839
+ const activeTool = useDirectorStore((store) => store.activeTool);
1840
+ if (!directing) return null;
1841
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Overlay, {
1842
+ backgroundOpacity: .35,
1843
+ blur: 1,
1844
+ center: true,
1845
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Paper, {
1846
+ p: "md",
1847
+ shadow: "md",
1848
+ withBorder: true,
1849
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, { children: [
1850
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1851
+ fw: 500,
1852
+ children: words.director.directing
1853
+ }),
1854
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
1855
+ c: "dimmed",
1856
+ children: activeTool ?? words.director.activity
1857
+ }),
1858
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
1859
+ justify: "flex-end",
1860
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
1861
+ color: "red",
1862
+ leftSection: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
1863
+ name: "action-stop",
1864
+ size: require_sizing.iconSizes.sm
1865
+ }),
1866
+ onClick: stop,
1867
+ variant: "light",
1868
+ children: words.director.stop
1869
+ })
1870
+ })
1871
+ ] })
1872
+ })
1873
+ });
1874
+ };
1875
+ const SECTIONS$1 = ["publish", "video"];
1876
+ const WizardFooter = ({ activeIndex, directing, onBack, onNext, onRecord, recordDisabled, recording, stepCount }) => {
1877
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS$1);
1878
+ const onReview = activeIndex === stepCount - 1;
1879
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
1880
+ className: "mtya-fullscreen-footer",
1881
+ px: "md",
1882
+ py: "sm",
1883
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
1884
+ justify: "space-between",
1885
+ wrap: "nowrap",
1886
+ children: [
1887
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
1888
+ disabled: activeIndex === 0 || directing || recording,
1889
+ onClick: onBack,
1890
+ variant: "default",
1891
+ children: words.video.footer.back
1892
+ }),
1893
+ onReview ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RecordProgressBar, {}) : null,
1894
+ onReview ? recordDisabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Tooltip, {
1895
+ label: words.publish.blockedByUnpublished,
1896
+ position: "top",
1897
+ withinPortal: true,
1898
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
1899
+ disabled: true,
1900
+ leftSection: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
1901
+ name: "video",
1902
+ size: require_sizing.iconSizes.sm
1903
+ }),
1904
+ children: words.video.record.start
1905
+ }) })
1906
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
1907
+ disabled: directing,
1908
+ leftSection: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sizing.Glyph, {
1909
+ name: "video",
1910
+ size: require_sizing.iconSizes.sm
1911
+ }),
1912
+ loading: recording,
1913
+ onClick: onRecord,
1914
+ children: words.video.record.start
1915
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
1916
+ disabled: directing,
1917
+ onClick: onNext,
1918
+ children: words.video.footer.next
1919
+ })
1920
+ ]
1921
+ })
1922
+ });
1923
+ };
1924
+ const SECTIONS = [
1925
+ "actions",
1926
+ "confirm",
1927
+ "copilot",
1928
+ "director",
1929
+ "failure",
1930
+ "itineraryActions",
1931
+ "preferences",
1932
+ "prompt",
1933
+ "publish",
1934
+ "video"
1935
+ ];
1936
+ const stepGlyphs = {
1937
+ camera: "action-capture-view",
1938
+ format: "frame-widescreen",
1939
+ profile: "profile-graph",
1940
+ review: "check"
1941
+ };
1942
+ const VIDEO_WIZARD_CLASS = "mtya-video-wizard";
1943
+ const SEEK_STEP_FRACTION = .05;
1944
+ const INTERACTIVE_SELECTOR = "input, textarea, select, button, a, [contenteditable], [role='slider'], [role='menuitem']";
1945
+ const recordingStepStyle = { opacity: .5 };
1946
+ const MemoFormatStep = (0, react.memo)(FormatStep);
1947
+ const MemoCameraStep = (0, react.memo)(CameraStep);
1948
+ const MemoProfileStep = (0, react.memo)(ProfileStep);
1949
+ const MemoReviewStep = (0, react.memo)(ReviewStep);
1950
+ const idleOutcome = { kind: "idle" };
1951
+ const doneOutcome = { kind: "done" };
1952
+ const useRecordOutcome = () => {
1953
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS);
1954
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
1955
+ const [outcome, setOutcome] = (0, react.useState)(idleOutcome);
1956
+ const plan = require_useUiStore.useUiStore(_mountaya_studio.selectVideoExportPlan);
1957
+ const profile = require_useUiStore.useUiStore((state) => state.videoExport?.profile ?? null);
1958
+ const seenPlan = (0, react.useRef)(plan);
1959
+ const seenProfile = (0, react.useRef)(profile);
1960
+ (0, react.useEffect)(() => {
1961
+ if (seenPlan.current === plan && seenProfile.current === profile) return;
1962
+ seenPlan.current = plan;
1963
+ seenProfile.current = profile;
1964
+ setOutcome(idleOutcome);
1965
+ }, [plan, profile]);
1966
+ return {
1967
+ onRecord: (0, react.useCallback)(() => {
1968
+ setOutcome(idleOutcome);
1969
+ dispatch("studio.video.record", {}).then((result) => {
1970
+ if (result.ok) {
1971
+ setOutcome(doneOutcome);
1972
+ return;
1973
+ }
1974
+ const refusal = result.code === "canceled" ? null : (0, _mountaya_studio_strings.failureAlertFor)(result, words.video.record.error, words.failure);
1975
+ setOutcome(refusal === null ? idleOutcome : {
1976
+ kind: "error",
1977
+ message: refusal.message
1978
+ });
1979
+ });
1980
+ }, [dispatch, words]),
1981
+ outcome
1982
+ };
1983
+ };
1984
+ const useWizardSteps = (step) => {
1985
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
1986
+ const activeIndex = _mountaya_studio.VIDEO_STEP_ORDER.indexOf(step);
1987
+ const goToStep = (0, react.useCallback)((next) => {
1988
+ dispatch("studio.video.step.set", { step: next });
1989
+ }, [dispatch]);
1990
+ return {
1991
+ activeIndex,
1992
+ goToStep,
1993
+ onBack: (0, react.useCallback)(() => {
1994
+ const previous = _mountaya_studio.VIDEO_STEP_ORDER[activeIndex - 1];
1995
+ if (previous) goToStep(previous);
1996
+ }, [activeIndex, goToStep]),
1997
+ onNext: (0, react.useCallback)(() => {
1998
+ const next = _mountaya_studio.VIDEO_STEP_ORDER[activeIndex + 1];
1999
+ if (next) goToStep(next);
2000
+ }, [activeIndex, goToStep])
2001
+ };
2002
+ };
2003
+ const usePreviewShortcuts = (inert) => {
2004
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
2005
+ const uiStore = require_useUiStore.useUiStoreApi();
2006
+ (0, _mantine_hooks.useWindowEvent)("keydown", (event) => {
2007
+ if (inert) return;
2008
+ if (event.composedPath().some((node) => node instanceof Element && node.matches(INTERACTIVE_SELECTOR))) return;
2009
+ if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
2010
+ if (event.code === "Space") {
2011
+ event.preventDefault();
2012
+ const playing = uiStore.getState().videoExport?.status.kind === "previewing";
2013
+ dispatch(playing ? "studio.video.preview.pause" : "studio.video.preview.play", {});
2014
+ return;
2015
+ }
2016
+ if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
2017
+ event.preventDefault();
2018
+ const status = uiStore.getState().videoExport?.status;
2019
+ const fraction = status && status.kind !== "idle" ? status.fraction : 0;
2020
+ const delta = event.key === "ArrowLeft" ? -.05 : SEEK_STEP_FRACTION;
2021
+ dispatch("studio.video.preview.seek", { fraction: Math.min(1, Math.max(0, fraction + delta)) });
2022
+ }
2023
+ });
2024
+ };
2025
+ const WizardShell = ({ director, directing, indicator, itineraryId, mapClient, scrim, transformRequest }) => {
2026
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS);
2027
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
2028
+ const stepsId = (0, _mantine_hooks.useId)();
2029
+ const plan = require_useUiStore.useUiStore(_mountaya_studio.selectVideoExportPlan);
2030
+ const route = require_useUiStore.useUiStore(_mountaya_studio.selectVideoExportRoute);
2031
+ const step = require_useUiStore.useUiStore((state) => state.videoExport?.step ?? "format");
2032
+ const recording = require_useUiStore.useUiStore((state) => (0, _mountaya_studio.selectVideoExportStatus)(state)?.kind === "recording");
2033
+ const itinerarySubject = useVideoItinerarySubject(itineraryId);
2034
+ const publication = useVideoPublication(itineraryId);
2035
+ const unpublished = publication === "unpublished";
2036
+ const organizationId = useVideoOrganizationId();
2037
+ const routeReady = useVideoRouteReady();
2038
+ const routeState = publication === "error" ? "error" : routeReady;
2039
+ const flyable = routeState === "ready";
2040
+ const [client, setClient] = (0, react.useState)(null);
2041
+ const { onRecord, outcome } = useRecordOutcome();
2042
+ const { activeIndex, goToStep, onBack, onNext } = useWizardSteps(step);
2043
+ usePreviewShortcuts(Boolean(directing) || recording || !flyable);
2044
+ const close = (0, react.useCallback)(() => {
2045
+ dispatch("studio.video.close", {});
2046
+ }, [dispatch]);
2047
+ const held = Boolean(directing) || recording;
2048
+ const entries = (0, react.useMemo)(() => _mountaya_studio.VIDEO_STEP_ORDER.map((id) => ({
2049
+ disabled: held && id !== step,
2050
+ glyph: stepGlyphs[id],
2051
+ id,
2052
+ label: words.video.steps[id].label
2053
+ })), [
2054
+ held,
2055
+ step,
2056
+ words
2057
+ ]);
2058
+ if (!plan) return null;
2059
+ const stepBody = {
2060
+ camera: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemoCameraStep, {
2061
+ directing,
2062
+ director,
2063
+ plan,
2064
+ scrim
2065
+ }),
2066
+ format: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemoFormatStep, {
2067
+ plan,
2068
+ route
2069
+ }),
2070
+ profile: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemoProfileStep, {}),
2071
+ review: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemoReviewStep, {
2072
+ outcome,
2073
+ plan
2074
+ })
2075
+ };
2076
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FullscreenModal.FullscreenModal, {
2077
+ ariaLabel: words.video.title,
2078
+ onClose: close,
2079
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WizardLayout.WizardLayout, {
2080
+ className: VIDEO_WIZARD_CLASS,
2081
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WizardFooter, {
2082
+ activeIndex,
2083
+ directing,
2084
+ onBack,
2085
+ onNext,
2086
+ onRecord,
2087
+ recordDisabled: unpublished || !flyable,
2088
+ recording,
2089
+ stepCount: _mountaya_studio.VIDEO_STEP_ORDER.length
2090
+ }),
2091
+ header: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FullscreenModal.FullscreenHeader, {
2092
+ closeLabel: words.actions.close,
2093
+ onClose: close,
2094
+ subject: itinerarySubject ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DialogSubject.DialogSubject, { ...itinerarySubject }) : void 0,
2095
+ title: words.video.title
2096
+ }),
2097
+ id: stepsId,
2098
+ onChange: goToStep,
2099
+ panel: _mountaya_studio.VIDEO_STEP_ORDER.map((id) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Tabs.Panel, {
2100
+ keepMounted: true,
2101
+ value: id,
2102
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
2103
+ gap: "lg",
2104
+ inert: recording,
2105
+ style: recording ? recordingStepStyle : void 0,
2106
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SectionHead.SectionHead, {
2107
+ description: words.video.steps[id].description,
2108
+ title: words.video.steps[id].label
2109
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, { children: stepBody[id] })]
2110
+ })
2111
+ }, id)),
2112
+ rail: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
2113
+ gap: "xxs",
2114
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
2115
+ className: "mtya-studio-visible-from-md",
2116
+ px: "xxs",
2117
+ variant: "section-label",
2118
+ children: words.video.stepsHeading
2119
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SectionTabs.SectionNav, {
2120
+ ariaLabel: words.video.stepsLabel,
2121
+ entries,
2122
+ id: stepsId,
2123
+ value: step
2124
+ })]
2125
+ }),
2126
+ sections: _mountaya_studio.VIDEO_STEP_ORDER,
2127
+ stageAriaLabel: words.video.preview.label,
2128
+ value: step,
2129
+ children: unpublished ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnpublishedStage, {
2130
+ itineraryId,
2131
+ organizationId
2132
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewStage, {
2133
+ client,
2134
+ directing,
2135
+ indicator,
2136
+ mapClient,
2137
+ notice: publication === "dirty" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PublicationNotice.PublicationNotice, {
2138
+ itineraryId,
2139
+ organizationId,
2140
+ state: "dirty"
2141
+ }) : void 0,
2142
+ onClient: setClient,
2143
+ plan,
2144
+ recording,
2145
+ routeState,
2146
+ transformRequest
2147
+ })
2148
+ })
2149
+ });
2150
+ };
2151
+ const DirectorRegion = ({ children }) => {
2152
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS);
2153
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
2154
+ gap: "xs",
2155
+ mt: "lg",
2156
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
2157
+ variant: "section-label",
2158
+ children: words.director.heading
2159
+ }), children]
2160
+ });
2161
+ };
2162
+ const DirectorSlot = () => {
2163
+ const organizationId = useVideoOrganizationId() ?? void 0;
2164
+ const availability = require_copilot.useCopilotAvailability(organizationId);
2165
+ const setupAction = require_copilot.useCopilotSetupAction(organizationId);
2166
+ if (organizationId === void 0 || availability.loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DirectorRegion, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
2167
+ justify: "center",
2168
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Loader, { size: "sm" })
2169
+ }) });
2170
+ if (!availability.writable) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DirectorRegion, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SuggestionRowLayout.CopilotNoAccessNotice, {}) });
2171
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DirectorRegion, { children: availability.notConfigured ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SuggestionRowLayout.CopilotSetupNotice, { action: setupAction }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DirectorChat, {}) });
2172
+ };
2173
+ const DirectedShell = ({ itineraryId, mapClient, transformRequest }) => {
2174
+ const director = useDirectorChatSurface();
2175
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WizardShell, {
2176
+ directing: director?.directing,
2177
+ director: director ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DirectorSlot, {}) : void 0,
2178
+ indicator: director ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WizardDirectingIndicator, {}) : void 0,
2179
+ itineraryId,
2180
+ mapClient,
2181
+ scrim: director ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DirectingScrim, {}) : void 0,
2182
+ transformRequest
2183
+ });
2184
+ };
2185
+ const PersonalItineraryNotice = () => {
2186
+ const words = require_studioStrings.useStudioScopedStrings(SECTIONS);
2187
+ const { dispatch } = require_useStudioDispatch.useStudioDispatch();
2188
+ const close = (0, react.useCallback)(() => {
2189
+ dispatch("studio.video.close", {});
2190
+ }, [dispatch]);
2191
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_FullscreenModal.FullscreenModal, {
2192
+ ariaLabel: words.video.title,
2193
+ onClose: close,
2194
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FullscreenModal.FullscreenHeader, {
2195
+ closeLabel: words.actions.close,
2196
+ onClose: close,
2197
+ title: words.video.title
2198
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Center, {
2199
+ flex: 1,
2200
+ p: "xl",
2201
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Alert, {
2202
+ color: "gray",
2203
+ maw: 420,
2204
+ children: words.itineraryActions.exportAsVideoPersonalHint
2205
+ })
2206
+ })]
2207
+ });
2208
+ };
2209
+ const VideoExportWizard = ({ invalidateAiConfig, itineraryId, mapClient, recoveryAddendum, strings, transformRequest }) => {
2210
+ const ctx = require_studio.useStudioToolContext();
2211
+ useVideoRouteSync();
2212
+ useVideoProfileSeed();
2213
+ const withOrgModes = require_useStudioEntitlement.useStudioEntitlement("video-organization-modes");
2214
+ const personal = useVideoOrganizationId() === null;
2215
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_studioStrings.StudioStringsScope, {
2216
+ sections: SECTIONS,
2217
+ strings,
2218
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DirectorChatProvider, {
2219
+ ctx,
2220
+ enabled: withOrgModes && !personal,
2221
+ invalidateAiConfig,
2222
+ recoveryAddendum,
2223
+ children: personal ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PersonalItineraryNotice, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DirectedShell, {
2224
+ itineraryId,
2225
+ mapClient,
2226
+ transformRequest
2227
+ })
2228
+ })
2229
+ });
2230
+ };
2231
+ Object.defineProperty(exports, "VideoExportWizard", {
2232
+ enumerable: true,
2233
+ get: function() {
2234
+ return VideoExportWizard;
2235
+ }
2236
+ });
2237
+
2238
+ //# sourceMappingURL=chunk-CwXRQ-3X.cjs.map