@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,3976 @@
1
+ import { t as ImportRoutingGuidePictures } from "./chunk-D1HIZ09h.cjs";
2
+ import { CategoryActivities, CollabLockKind, CollabResource, ItinerarySelection, ItineraryViewSource, OrganizationRole, PlatformScopeAnswer, SegmentChainEnds, SegmentChainMerge, SegmentChainMerges, SegmentGroupRun, StudioApi, StudioCache, StudioEntitlement, StudioHandlers, StudioPersistence, StudioScopeSeam, StudioToolContext, StudioToolInputs, StudioToolOutputs, StudioUrlSeam, StudioViewer, StudioWriteRefusal, StudioWriteResource, ThrownRecognizer, ToolBusContext, ToolBusDispatch, ToolBusObserveOverrides, ToolCapability, ToolDispatchObserver, ToolDispatchRegistry, ToolOutputRegistry, ToolResult, ToolResultOf, UiStore, UiStoreApi, ViewerPreferences, ViewerSeam } from "@mountaya/studio";
3
+ import { ErrorInfo, FocusEvent, KeyboardEvent as KeyboardEvent$1, ReactNode, RefObject } from "react";
4
+ import { MountayaI18n, Translations } from "@mountaya/elements/i18n";
5
+ import { StudioStrings, StudioStringsOverrides } from "@mountaya/studio/strings";
6
+ import { QueryClient, QueryKey } from "@tanstack/react-query";
7
+ import { Mountaya, MountayaError, ResourceRef } from "@mountaya/client";
8
+ import { MantineThemeOverride } from "@mantine/core";
9
+ import { ElementStyle, MountayaElementsProviderProps, StreetViewBounds } from "@mountaya/elements-react";
10
+ import { TileRequestTransform } from "@mountaya/elements/map-client";
11
+ import { MapLanguage as MapLanguage$1, MapPaintOverrides } from "@mountaya/elements/style";
12
+ import { AgentThreadsUrlSeam, RecoveryAddendum } from "@mountaya/studio/agent";
13
+ import { StudioPlugin, StudioPluginContribution, StudioPluginEngine, StudioPluginEntry, StudioPluginSlot, StudioPluginSubject, StudioPluginTarget, StudioSlotEntry } from "@mountaya/studio/plugins";
14
+ import { Clock, StudioFormatters, StudioLinks, StudioNavigationAttempt, StudioNavigationBlocker, StudioNavigationHold, StudioNotify, StudioSeams, StudioStorage } from "@mountaya/studio/seams";
15
+ import { PeerNameResolver } from "@mountaya/elements/collab";
16
+ import { GeolocationSeam } from "@mountaya/elements/seams";
17
+ import { Position } from "geojson";
18
+ import { SegmentEditMode } from "@mountaya/elements/data";
19
+ import { UnitFormatOptions } from "@mountaya/elements/profile";
20
+ import { UserWaypointIcon } from "@mountaya/elements/icons";
21
+ import { MountayaElementsProviderProps as MountayaElementsProviderProps$1 } from "@mountaya/elements-react/headless";
22
+ /**
23
+ * useStudioCache is {@link createStudioCache} with the provider's credential already bound.
24
+ *
25
+ * Memoized on the client and the scope, because the value is threaded into a tool context that
26
+ * a host builds once: a fresh object each render would rebuild it on every pass.
27
+ */
28
+ declare const useStudioCache: (queryClient: QueryClient) => StudioCache;
29
+ /**
30
+ * useStudioResourceKey resolves a resource to its cache key under the provider's credential.
31
+ *
32
+ * The read-side twin of {@link useStudioCache}: a hook writes under it, a tool invalidates
33
+ * through the cache, and both land on the same entry. A caller reaching past the hooks for an
34
+ * entry (reading one a surface already holds, watching or removing it) wants this rather than a
35
+ * key spelled at the call site, because `getQueryData` answers `undefined` to a near miss instead
36
+ * of failing.
37
+ *
38
+ * Not for SEEDING a record. An entry holds the operation's body, with the record under `data`,
39
+ * so a bare record written under this key is an entry the cache reads as empty, and
40
+ * `studio.itinerary.activate` answers that it is not loaded. A host that holds a record already
41
+ * seeds it through {@link useStudioCache}'s `set`, which writes that shape.
42
+ */
43
+ declare const useStudioResourceKey: () => ((key: ResourceRef) => QueryKey);
44
+ /**
45
+ * createStudioCache binds a resource-named cache to a QueryClient under one credential.
46
+ *
47
+ * The `scope` is the credential's, and it is not optional for the same reason `mountayaKeys` of
48
+ * `@mountaya/client-react` makes it the second segment: one cache serves the whole application, so
49
+ * a write made under a session token must not drop, or worse seed, the entry a share link read
50
+ * under its own. `useStudioCache` binds it from the provider and is what a React caller should
51
+ * reach for.
52
+ *
53
+ * `get` and `set` read and write this credential's entry. `invalidate` and `evict` reach every
54
+ * credential's: `invalidate` marks each entry stale and leaves it answering until a read replaces
55
+ * it, and `evict` removes each, so a later `get` of a deleted resource answers `undefined`.
56
+ *
57
+ * @param queryClient - The application's query cache, the one its hooks read through.
58
+ * @param scope - The client's `credentialScope`, which `get` and `set` key every entry under.
59
+ * @returns The cache seam a tool context's `api.cache` takes, with `evict` stated.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * import type { ItineraryWithDetails } from "@mountaya/client";
64
+ * import type { QueryClient } from "@tanstack/react-query";
65
+ *
66
+ * declare const queryClient: QueryClient;
67
+ * declare const mountaya: Mountaya;
68
+ * declare const itinerary: ItineraryWithDetails;
69
+ *
70
+ * const cache = createStudioCache(queryClient, mountaya.transport.credentialScope);
71
+ *
72
+ * cache.set({ id: "itin_1", kind: "itinerary" }, itinerary);
73
+ * await cache.invalidate({ id: "itin_1", kind: "itinerary" }, { kind: "itineraries" });
74
+ * cache.evict?.({ id: "itin_1", kind: "itinerary" });
75
+ * ```
76
+ */
77
+ declare const createStudioCache: (queryClient: QueryClient, scope: string) => StudioCache;
78
+ /**
79
+ * A brand stated as its parts, for a host that wants the studio's own treatment of them.
80
+ *
81
+ * `title` is required and the other two are not, which is the shape of the thing: a product has
82
+ * a name, and the mark and the second line are both things a product may or may not have. The
83
+ * default lockup is exactly one of these (the Mountaya mark, "Mountaya", "Map Studio"), so the
84
+ * override and the default are the same component rendering the same stack, and there is no
85
+ * second layout for a consumer to fall out of step with.
86
+ */
87
+ interface StudioHeaderBrand {
88
+ /** The dimmed second line under the title. Omitted, the title stands alone. */
89
+ readonly baseline?: string | undefined;
90
+ /** The mark beside the title: a logo, a monogram, a glyph. Omitted, the title stands alone. */
91
+ readonly icon?: ReactNode;
92
+ /** The name this studio is published under, in the package's own wordmark treatment. */
93
+ readonly title: string;
94
+ }
95
+ /**
96
+ * What a host sets on `appearance.header`, and what {@link useStudioHeader} answers.
97
+ *
98
+ * `null` is a MEANING here rather than an absence: it hides the header entirely, for a host
99
+ * whose own chrome already says whose studio this is. "Not configured" is `undefined`, which is
100
+ * what keeps the two apart: a seam that spelled both `null` would make "no header" and "the
101
+ * Mountaya header" the same value.
102
+ */
103
+ type StudioHeaderOverride = ReactNode | StudioHeaderBrand;
104
+ /**
105
+ * isStudioHeaderBrand narrows an override to the composed form.
106
+ *
107
+ * The one thing this union costs, and it has to be a RUNTIME check: `ReactNode` admits objects
108
+ * (an element, a portal, an array, a promise), so there is no discriminant to switch on and no
109
+ * way for the type system to tell a brand from a node a host built.
110
+ *
111
+ * So it asks what each of those is not. Not a valid element and not a portal (`isValidElement`
112
+ * answers for both), not an array or any other iterable, not a promise: every one of them
113
+ * would otherwise satisfy "an object carrying a `title`" if a host happened to hang one on it.
114
+ * What is left is an object with a string `title`, which is this interface and nothing else
115
+ * React can render.
116
+ *
117
+ * @returns True when `header` is a {@link StudioHeaderBrand}.
118
+ */
119
+ declare const isStudioHeaderBrand: (header: StudioHeaderOverride) => header is StudioHeaderBrand;
120
+ /**
121
+ * StudioBillingSubject names WHAT a refused dispatch was trying to make.
122
+ *
123
+ * A closed studio vocabulary rather than a sentence, and the direction is why. The prompts travel
124
+ * the other way, host to studio, so they arrive as nodes in the host's own billing words. This
125
+ * travels studio to host, and the studio has no billing bundle to resolve anything in: a sentence
126
+ * here would be a string only the host reads, resolved through a bundle a licensee does not have.
127
+ *
128
+ * Its one member is what every surface that hands a refusal on is making: an itinerary.
129
+ */
130
+ type StudioBillingSubject = "itinerary";
131
+ /**
132
+ * StudioBillingGate is what one surface needs to know about paying for what it is about to do.
133
+ *
134
+ * Its members answer different moments. The prompts are BEFORE: nodes the host words and the
135
+ * studio places beside the act they concern, while the studio's own reading of the viewer says
136
+ * they apply. `handleRefusal` is AFTER: a dispatch that came back refused for a reason the host
137
+ * can fix, replayed verbatim once it is fixed.
138
+ *
139
+ * Whether an act is held before it is attempted is the studio's own reading of what the viewer
140
+ * seam answers for the resource's scope. The gate words what is said where an act is held, and
141
+ * holds nothing back itself.
142
+ */
143
+ interface StudioBillingGate {
144
+ /**
145
+ * What the host wants to say where a create would exceed the itinerary ceiling of its scope, or
146
+ * undefined. On Mountaya's platform that ceiling is the personal space's, which no agreement
147
+ * changes.
148
+ *
149
+ * The studio decides WHERE and WHEN: a surface places it beside the create it belongs to, and
150
+ * only while `useItineraryUsage` reports the ceiling reached, which is a viewer-seam fact the
151
+ * studio already gates several other affordances on. What it says, and any action beside it,
152
+ * is entirely the host's: the studio places the node and links nowhere.
153
+ *
154
+ * Undefined is the answer for every consumer whose scopes carry no ceiling, and their readers
155
+ * meet nothing.
156
+ */
157
+ readonly limitPrompt?: ReactNode;
158
+ /**
159
+ * What the host wants to say where a resource has NO ORGANIZATION to bill at all, or
160
+ * undefined.
161
+ *
162
+ * Separate from {@link limitPrompt} because it answers another question, and a permanent one.
163
+ * That one is about a reader at a scope's itinerary ceiling; this is about a personal resource,
164
+ * which produces no billed output under any agreement. The studio decides WHERE and WHEN: a
165
+ * surface places it where it withheld the act, and only for a resource `usePublishableScope`
166
+ * refuses. What it says, and any action beside it, is entirely the host's: the studio places
167
+ * the node and links nowhere.
168
+ *
169
+ * It is deliberately NOT a {@link StudioBillingSubject} on `handleRefusal`: that is the AFTER
170
+ * path for a refusal the reader can recover from, and this is BEFORE and permanent.
171
+ *
172
+ * Undefined is the answer for every consumer with no organizations, and their readers meet
173
+ * nothing.
174
+ */
175
+ readonly publicationPrompt?: ReactNode;
176
+ /**
177
+ * handleRefusal takes a finished dispatch the host may be able to recover.
178
+ *
179
+ * It answers whether it took it: true means the host has opened its own resolution and will
180
+ * replay `retry`, so the surface shows no inline error; false means the surface reports the
181
+ * failure the way it reports every other one. Returning true and doing nothing would leave a
182
+ * form that swallowed a refusal, which is why the contract is an answer rather than a void.
183
+ *
184
+ * `subject` names what was being made, so the host can say so in its own words.
185
+ */
186
+ handleRefusal(result: ToolResult, retry: () => void, subject: StudioBillingSubject): boolean;
187
+ }
188
+ /**
189
+ * StudioBillingGateSeam answers the gate for ONE organization.
190
+ *
191
+ * A function rather than a value, because the organization is chosen at render time: a create
192
+ * form's target organization is whatever its picker currently holds, and a gate resolved once
193
+ * at the host would answer for a different one.
194
+ *
195
+ * The host's implementation may call hooks (an agreement read, a store of its own), so the seam is
196
+ * called unconditionally in a component body, exactly like a hook. Its identity is the host's to
197
+ * keep: {@link StudioBillingGateProvider} hands on the function it is given, and every surface that
198
+ * reads the gate renders again for a new one. That is how a seam written over the host's own state
199
+ * answers anew, and what a seam written inline costs at each render of the host.
200
+ */
201
+ type StudioBillingGateSeam = (organizationId: string | null) => StudioBillingGate;
202
+ /** The props of {@link StudioBillingGateProvider}. */
203
+ interface StudioBillingGateProviderProps {
204
+ /** The surfaces that read the gate. */
205
+ readonly children: ReactNode;
206
+ /** The host's answer per organization, handed on as it is given. */
207
+ readonly seam: StudioBillingGateSeam;
208
+ }
209
+ /**
210
+ * StudioBillingGateProvider supplies the host's billing binding to every surface beneath it.
211
+ *
212
+ * `seam` is handed on as it is given, and held by nothing here: a surface reads the gate again
213
+ * whenever the function is a new one. A seam declared once, at module scope or under
214
+ * `useCallback`, renders no surface of its own accord.
215
+ */
216
+ declare const StudioBillingGateProvider: ({ children, seam }: StudioBillingGateProviderProps) => import("react").JSX.Element;
217
+ /**
218
+ * useStudioBillingGate resolves the gate for the organization a surface is acting on.
219
+ *
220
+ * @param organizationId - The organization the surface acts on, or null for a personal resource.
221
+ * @returns The host's gate for it, or a gate that places no prompt and takes no refusal where no
222
+ * host binding is mounted.
223
+ */
224
+ declare const useStudioBillingGate: (organizationId: string | null) => StudioBillingGate;
225
+ /**
226
+ * CopilotAvailability is what a surface needs to know before offering the co-pilot.
227
+ *
228
+ * Several flags rather than one, because "unavailable" says different things: the viewer may
229
+ * not write here, nobody has configured a provider, they could configure one themselves, or the
230
+ * answer has not arrived yet. A single boolean would collapse the setup card, the no-access card
231
+ * and the cold reload into one blank.
232
+ */
233
+ interface CopilotAvailability {
234
+ /** Whether the viewer may configure a provider themselves: an owner or an admin. */
235
+ readonly canConfigure: boolean;
236
+ /** A provider is configured for this organization. */
237
+ readonly configured: boolean;
238
+ /** Neither answer has arrived; every flag above defaults false while this is true. */
239
+ readonly loading: boolean;
240
+ /** A provider is definitively NOT configured, which is not the same as not yet knowing. */
241
+ readonly notConfigured: boolean;
242
+ /** The viewer may write to this organization. */
243
+ readonly writable: boolean;
244
+ }
245
+ /**
246
+ * StudioCopilotSeam answers availability, and the model line to show, for ONE organization.
247
+ *
248
+ * The whole rule is the host's, and every part of it is something a licensee spells differently:
249
+ * which roles may configure a provider, whether a credential is on file, and what the resulting
250
+ * model is called. None of it is in the public contract, so the studio receives the answer
251
+ * rather than the fields it was derived from.
252
+ *
253
+ * A function per organization, like the billing gate, because the resource an operator is
254
+ * looking at decides which organization pays for the run. Its identity must be stable: it is
255
+ * called unconditionally in a surface's body and the host's implementation calls hooks.
256
+ */
257
+ type StudioCopilotSeam = (organizationId: string | undefined) => {
258
+ /** Whether the co-pilot may run for the organization, and why not. */
259
+ readonly availability: CopilotAvailability;
260
+ /** The provider and model a configured co-pilot runs on, for the panel's footer. */
261
+ readonly modelLine: string | null;
262
+ /**
263
+ * What the panel shows INSTEAD of the conversation when the host withholds the co-pilot from
264
+ * this organization, or null when nothing is withheld: for example "The co-pilot is not part
265
+ * of this organization's agreement."
266
+ *
267
+ * A ReactNode rather than a flag, because the words and any action beside them are the
268
+ * host's: the studio places the node and links nowhere, and the host attaches what its own
269
+ * product offers. And a node rather than a boolean beside it, because the two questions
270
+ * collapse: a host that withholds nothing has nothing to show, and null says both at once.
271
+ */
272
+ readonly withheldNotice: ReactNode | null;
273
+ /**
274
+ * The control that sends a reader who may configure a provider to wherever that is done, or
275
+ * null when this reader may not, or when the host has nowhere to send them.
276
+ *
277
+ * A ReactNode for the same reason the withheld notice is one, and one step further: not only the
278
+ * destination but the ROUTER that reaches it is the host's (an in-app link, a new tab, a modal
279
+ * over the studio are all reasonable and none is a studio's call). The setup card places
280
+ * whatever arrives and falls back to "ask an admin" when nothing does, which is also the
281
+ * right sentence for a reader whose role cannot configure anything.
282
+ */
283
+ readonly setupAction: ReactNode | null;
284
+ };
285
+ /** The props of {@link StudioCopilotProvider}. */
286
+ interface StudioCopilotProviderProps {
287
+ /** The surfaces that read the co-pilot's availability. */
288
+ readonly children: ReactNode;
289
+ /** The host's answer per organization. Its identity must be stable across renders. */
290
+ readonly seam: StudioCopilotSeam;
291
+ }
292
+ /** StudioCopilotProvider supplies the host's co-pilot binding to every surface beneath it. */
293
+ declare const StudioCopilotProvider: ({ children, seam }: StudioCopilotProviderProps) => import("react").JSX.Element;
294
+ /**
295
+ * useCopilotAvailability reports whether the co-pilot may run for a resource's organization.
296
+ *
297
+ * Like the zone edit gate and the share-link gate, an organization's resource is answered by a
298
+ * write role there, whoever created it. Unlike them, it has NO personal arm: the other two let
299
+ * the creator of a personal resource edit it, and this one is unavailable on personal content
300
+ * for everyone, its creator included. That is on purpose: the co-pilot spends an organization's
301
+ * own provider credential, and a personal resource has no organization to bill or to hold one.
302
+ * The asymmetry is the point: do not "fix" it by adding the personal arm the other two use.
303
+ *
304
+ * @param organizationId - The resource's organization, or undefined for a personal resource.
305
+ * @returns The host's {@link CopilotAvailability} for it, or one unavailable and settled where
306
+ * no host binding is mounted.
307
+ */
308
+ declare const useCopilotAvailability: (organizationId: string | undefined) => CopilotAvailability;
309
+ /** useCopilotModelLine names the provider and model a configured co-pilot runs on. */
310
+ declare const useCopilotModelLine: (organizationId: string | undefined) => string | null;
311
+ /**
312
+ * useCopilotWithheldNotice reads what the host shows in place of the conversation where it
313
+ * withholds the co-pilot from this organization, or null where it withholds nothing.
314
+ *
315
+ * The panel branches on the NODE rather than on an entitlement, because what an organization's
316
+ * agreement covers is the host's to know and to word: an entitlement read as "show a notice"
317
+ * would put the studio's words where the host's belong.
318
+ */
319
+ declare const useCopilotWithheldNotice: (organizationId: string | undefined) => ReactNode;
320
+ /**
321
+ * useCopilotSetupAction reads the control that opens the host's provider configuration.
322
+ *
323
+ * Null covers every way of having nothing to offer (this reader may not configure, the host
324
+ * has no configuration surface, or there is no organization in scope), and the setup card
325
+ * treats them identically, because the sentence a reader needs is the same in each: someone
326
+ * else has to set this up.
327
+ */
328
+ declare const useCopilotSetupAction: (organizationId: string | undefined) => ReactNode;
329
+ /**
330
+ * OrganizationScopeOption is one selectable scope in the sidenav's collections switcher: the
331
+ * organization id the listing is read for (null for the caller's personal scope), the human
332
+ * label the option renders, and the role the user holds there (also null for the personal
333
+ * scope, which is nobody's organization and so has no role). Derived rather than a wire type
334
+ * (the personal option carries a localized label rather than an organization name), so it is
335
+ * a plain hand-written interface.
336
+ */
337
+ interface OrganizationScopeOption {
338
+ /** The organization the listing is read for, or null for the personal scope. */
339
+ id: string | null;
340
+ /** What the option says. */
341
+ label: string;
342
+ /** The viewer's role in the organization, or null for the personal scope. */
343
+ role: OrganizationRole | null;
344
+ /**
345
+ * Why the scope offers its folders and nothing more, in the reader's words, such as an
346
+ * organization whose agreement does not include Map Studio. A switcher still offers the scope,
347
+ * so a reader can look at what is kept there, and shows the reason beside it. Absent for a
348
+ * scope that takes the studio's writes.
349
+ */
350
+ unavailableReason?: string | undefined;
351
+ }
352
+ /**
353
+ * WritableOrganizationOption is one selectable organization in the OrganizationSelect: its id
354
+ * (the wire `organization_id` a create forwards), the human label the option renders, and the
355
+ * role the user holds there, null for the personal space, which is nobody's organization and
356
+ * so has no role. That null is the single spelling of "this is the personal space": it drives
357
+ * both the option's glyph and its caption. Derived rather than a wire type (the personal
358
+ * option carries a localized label in place of the root organization's own name), so it is a
359
+ * plain hand-written interface.
360
+ */
361
+ interface WritableOrganizationOption {
362
+ /** The organization a create forwards as `organization_id`. */
363
+ id: string;
364
+ /** What the option says. */
365
+ label: string;
366
+ /** The viewer's role in the organization, or null for the personal space. */
367
+ role: OrganizationRole | null;
368
+ }
369
+ /**
370
+ * StudioOrganizations is the roster a studio's pickers and permission gates read.
371
+ *
372
+ * DATA rather than a hook, and already filtered rather than raw, for the reason
373
+ * `PublishableKeySeam` is: which organizations a viewer may write to is the host's rule, read off
374
+ * the role each membership `getMyOrganizations` answers carries. So the host applies the rule and
375
+ * hands back what survives, exactly as it hands back the keys an embed may use.
376
+ *
377
+ * Two halves because they answer different questions. `readable` is "whose folders may I look
378
+ * at" (the sidenav's scope switcher), and a viewer-role member belongs in it. `writable` is
379
+ * "where may I create things", and the same member does not.
380
+ */
381
+ interface StudioOrganizations extends StudioScopeSeam {
382
+ /**
383
+ * isPersonalScope answers whether an organization id means "the viewer's own", rather than a
384
+ * real organization.
385
+ *
386
+ * Restated here rather than only inherited from {@link StudioScopeSeam}: this is where the
387
+ * roster's readers meet it, and the extends clause is what lets the SAME object satisfy the
388
+ * handlers' scope seam so a host wires one thing and both layers ask one question.
389
+ *
390
+ * A PREDICATE rather than the root organization's id, because that is the only question its
391
+ * callers ask, and because personal scope has more than one spelling. The API says `null`,
392
+ * since a personal resource belongs to no organization; a form that has not picked one holds
393
+ * `undefined`; and a host whose own data names a shared root organization spells it with that
394
+ * UUID. Each is what some layer sends for the same thing, all three compile wherever one is
395
+ * expected, and picking the wrong one produces a listing scoped to nothing rather than an
396
+ * error. One predicate collapses them.
397
+ *
398
+ * A host with no notion of a shared root (every consumer's case) answers false for a real id
399
+ * and true for an absent one, which is the reading a personal-content model already has.
400
+ */
401
+ isPersonalScope(organizationId: string | null | undefined): boolean;
402
+ /**
403
+ * writeRefusal answers why the scope `organizationId` names refuses a write of `resource`, or
404
+ * null where it takes it: `personal` where the viewer's own space holds no such resource, and
405
+ * `agreement` where the organization's agreement does not include what the write needs.
406
+ *
407
+ * Restated from {@link StudioScopeSeam} for the reason {@link isPersonalScope} is: the handlers
408
+ * refuse the write by it, and every picker that offers a scope for a write reads it through
409
+ * {@link useStudioWritableOrganizations}, so a reader is never offered a scope the write is
410
+ * refused in. Left out, every scope takes every write.
411
+ */
412
+ writeRefusal?: ((resource: StudioWriteResource, organizationId: string | null | undefined) => StudioWriteRefusal | null) | undefined;
413
+ /** The scopes whose folders the viewer may look at, viewer-role memberships included. */
414
+ readonly readable: {
415
+ /** Whether the roster is still loading, which is not the same as holding no option. */
416
+ readonly isPending: boolean;
417
+ /** The scopes, as the switcher offers them. */
418
+ readonly options: readonly OrganizationScopeOption[];
419
+ };
420
+ /**
421
+ * The organizations the viewer may create in, and the write roles that decide who edits an
422
+ * itinerary or a zone: `writableOrgIds` is the set the editor's edits and the editing verbs
423
+ * read (`StudioScopeSeam.writable` of `@mountaya/studio`).
424
+ */
425
+ readonly writable: {
426
+ /** The organization a create preselects, or null for the personal space. */
427
+ readonly defaultOrganizationId: string | null;
428
+ /** The organizations a create may target, as the picker offers them. */
429
+ readonly options: readonly WritableOrganizationOption[];
430
+ /**
431
+ * Every organization id the viewer may write to: those in which they hold a write role (an
432
+ * owner, an admin or a contributor). A member whose role there reads only is not offered
433
+ * the edits of that organization's itineraries and zones.
434
+ *
435
+ * Never a shared root organization, where a host has one: it is shared by every user, so
436
+ * including it would grant an edit affordance to anyone rather than to a real membership. A
437
+ * consumer with no such organization has nothing to exclude.
438
+ */
439
+ readonly writableOrgIds: ReadonlySet<string>;
440
+ };
441
+ }
442
+ /** The props of {@link StudioOrganizationsProvider}. */
443
+ interface StudioOrganizationsProviderProps {
444
+ /** The surfaces that read the roster. */
445
+ readonly children: ReactNode;
446
+ /** The host's roster: the organizations the viewer reads and writes. */
447
+ readonly organizations: StudioOrganizations;
448
+ }
449
+ /** StudioOrganizationsProvider supplies the host's roster to every surface beneath it. */
450
+ declare const StudioOrganizationsProvider: ({ children, organizations }: StudioOrganizationsProviderProps) => import("react").JSX.Element;
451
+ /** useStudioOrganizations reads the roster the host supplied, or the inert one where it states none. */
452
+ declare const useStudioOrganizations: () => StudioOrganizations;
453
+ /**
454
+ * StudioWritableOrganizations is what {@link useStudioWritableOrganizations} resolves for one
455
+ * resource: the organizations a write of it may target, the one a form preselects, and whether
456
+ * it has any target at all.
457
+ */
458
+ interface StudioWritableOrganizations {
459
+ /**
460
+ * Whether a write of the resource has anywhere to go: an organization to target, or the
461
+ * viewer's own space where it takes the resource. False where every scope refuses it, which is
462
+ * the reader's cue to say why rather than offer a form.
463
+ */
464
+ readonly available: boolean;
465
+ /**
466
+ * The organization a create preselects, or null for the viewer's own space: the scope the
467
+ * reader is browsing where the resource can be created there, then the roster's own default
468
+ * where it takes the resource, and otherwise the first option that does.
469
+ */
470
+ readonly defaultOrganizationId: string | null;
471
+ /** The organizations a write of the resource may target, as a picker offers them. */
472
+ readonly options: readonly WritableOrganizationOption[];
473
+ }
474
+ /**
475
+ * useStudioWritableOrganizations resolves the writable roster for one resource: the options a
476
+ * write of `resource` may target, each one the host's {@link StudioOrganizations.writeRefusal}
477
+ * takes it in, and the default a form preselects among them.
478
+ *
479
+ * The default is the scope the reader is browsing, as the studio's URL names it
480
+ * (`organization_id`, the personal space where it names none), wherever the picker offers it:
481
+ * a reader who switched to an organization creates there unless they pick another, as a
482
+ * collection created from the sidenav lands in the scope it lists. A scope the picker does not
483
+ * offer (one the reader only reads in, or the personal space for a resource it does not keep),
484
+ * and a studio whose host mirrors no URL, preselect the roster's own default.
485
+ *
486
+ * A roster whose host states no `writeRefusal` answers its writable half as it stands, and the
487
+ * viewer's own space as a target, which is the reading for a consumer whose every scope writes.
488
+ *
489
+ * @param resource - The resource the write creates.
490
+ * @returns The targets, the default and whether there is any.
491
+ */
492
+ declare const useStudioWritableOrganizations: (resource: StudioWriteResource) => StudioWritableOrganizations;
493
+ /**
494
+ * The React delivery of the plugin engine.
495
+ *
496
+ * The contract and the machine are `@mountaya/studio/plugins`', framework-free, so a Dart or
497
+ * Swift studio reimplements one vocabulary rather than inventing three. What is here is the
498
+ * binding: the view type bound to `ReactNode`, and the context that carries the engine down to
499
+ * the menus and rails that render out of it.
500
+ */
501
+ /**
502
+ * StudioReactPlugin is a plugin whose views are React nodes.
503
+ *
504
+ * One alias rather than a generic argument at every call site, which is the same treatment
505
+ * `StudioTool` gets one package down. `StudioPlugin` (with its `never` default) is exactly the
506
+ * tools-only plugin and stays assignable to this, because `TView` appears only in output
507
+ * position, so a render-free plugin written against the base type installs here unchanged.
508
+ */
509
+ type StudioReactPlugin = StudioPlugin<ReactNode>;
510
+ /** StudioReactPluginContribution is one contribution to one slot, with React as the view type. */
511
+ type StudioReactPluginContribution = StudioPluginContribution<ReactNode>;
512
+ /** StudioReactPluginEntry is a contribution as the registry holds it: plus its plugin and rank. */
513
+ type StudioReactPluginEntry = StudioPluginEntry<ReactNode>;
514
+ /**
515
+ * StudioReactPluginSubject is WHICH contribution a report is about: everything that identifies
516
+ * one, with the verb left off. See {@link StudioPluginSubject} for why the verb is not here.
517
+ */
518
+ type StudioReactPluginSubject = StudioPluginSubject<ReactNode>;
519
+ /**
520
+ * StudioPluginFailure is one way a plugin failed, with everything that failure has to say about
521
+ * itself and nothing it does not.
522
+ *
523
+ * A DISCRIMINATED UNION on `kind`, and one object rather than a list of positional arguments:
524
+ * the shape `StudioPluginRunEvent` already uses one package down, for the same reason. The
525
+ * kinds carry genuinely different things, and the alternative spellings both leak: a union in
526
+ * an argument position makes a host write `"qualifiedId" in subject`, and a flat object with
527
+ * optional members makes them check for a value that is always there for the kind they are
528
+ * handling.
529
+ *
530
+ * - `install`: the registry REFUSED a declaration. There is no resolved contribution to name,
531
+ * because producing one is exactly what the refusal prevented, so the declaration comes instead.
532
+ * `isStudioPluginError(failure.error)` narrows it and gives you every `defect`.
533
+ * - `run`: a contribution's verb threw or rejected. The registry caught it; the outcome was
534
+ * reported to any observer as `threw`.
535
+ * - `view`: a contribution's `view` threw during render, and its boundary drew nothing in its
536
+ * place. `info` is React's own, and its component stack says where INSIDE the plugin's view it
537
+ * broke, the one question `contribution` cannot answer.
538
+ *
539
+ * `error` is always the value the plugin actually threw. Nothing here wraps it, so whatever a host
540
+ * narrows on still works.
541
+ */
542
+ type StudioPluginFailure = {
543
+ readonly error: unknown;
544
+ readonly kind: "install";
545
+ readonly plugin: StudioReactPlugin;
546
+ } | {
547
+ /** The contribution whose verb failed. */
548
+ readonly contribution: StudioReactPluginSubject;
549
+ /** What the verb threw or rejected with. */
550
+ readonly error: unknown;
551
+ readonly kind: "run";
552
+ } | {
553
+ /** The contribution whose view failed. */
554
+ readonly contribution: StudioReactPluginSubject;
555
+ /** What the view threw. */
556
+ readonly error: unknown;
557
+ /** React's own report, whose component stack says where inside the view it broke. */
558
+ readonly info: ErrorInfo;
559
+ readonly kind: "view";
560
+ };
561
+ /**
562
+ * StudioPluginErrorReporter is how a host hears that a plugin failed.
563
+ *
564
+ * One parameter, so the simplest useful handler is `({ error }) => log(error)` and the complete
565
+ * one is a `switch` on `kind` that the compiler checks for exhaustiveness. See
566
+ * {@link StudioPluginFailure} for what each kind carries.
567
+ */
568
+ type StudioPluginErrorReporter = (failure: StudioPluginFailure) => void;
569
+ /**
570
+ * StudioPluginsBinding is what the context carries: the plugin engine, and where a failure goes.
571
+ *
572
+ * One object rather than two contexts, because the two are always supplied together and always
573
+ * read together: a renderer that resolves a slot is the same renderer that reports a throw out
574
+ * of it.
575
+ *
576
+ * Both members are REQUIRED and both are stable for the life of the mount, which is what lets
577
+ * every renderer beneath take `onError` out of its dependency arrays. "The host supplied none" is
578
+ * a no-op inside the dispatcher rather than an absent member: the difference between the two is
579
+ * a context value whose identity changes on every host render and one that never changes at all.
580
+ */
581
+ interface StudioPluginsBinding {
582
+ /** Where a failed plugin is reported. A host that supplied none gets a dispatcher that does nothing. */
583
+ readonly onError: StudioPluginErrorReporter;
584
+ /** The registry the host installs plugins into. */
585
+ readonly engine: StudioPluginEngine<ReactNode>;
586
+ }
587
+ /** The props of {@link StudioPluginsProvider}. */
588
+ interface StudioPluginsProviderProps {
589
+ /** The surfaces that read the registry. */
590
+ readonly children: ReactNode;
591
+ /** The registry the host installs plugins into, and how it reports a refused one. */
592
+ readonly plugins: StudioPluginsBinding;
593
+ }
594
+ /**
595
+ * StudioPluginsProvider supplies the registry to everything beneath it.
596
+ *
597
+ * `MountayaStudioHost` mounts this UNCONDITIONALLY, which is the deliberate difference from the
598
+ * seam providers beside it. Those mount only when given a value so a nested host inherits an
599
+ * enclosing ANSWER (a notifier, a router), and that is right for an answer and wrong for a
600
+ * REGISTER TARGET: inheriting one would make `plugins={{ install: [] }}` indistinguishable from
601
+ * omitting it, and would let an install under a nested host escape into the enclosing one. It is
602
+ * the same argument `StudioHostContext` already makes for the bus.
603
+ */
604
+ declare const StudioPluginsProvider: ({ children, plugins }: StudioPluginsProviderProps) => import("react").JSX.Element;
605
+ /**
606
+ * useStudioPlugins reads the host's plugin engine, for installing and uninstalling at runtime.
607
+ *
608
+ * It THROWS outside a host, which is the rule the other host-shaped hooks here follow and the
609
+ * opposite of {@link usePluginSlot}'s, and names both remedies: `MountayaStudioHost`, which mounts
610
+ * the registry, and a {@link StudioPluginsProvider} handed one. A register call that goes nowhere
611
+ * has NO SYMPTOM: it succeeds, nothing is installed, and the menu item the consumer was adding is
612
+ * simply missing, which reads as the studio being broken rather than as a provider being absent. A
613
+ * menu, by contrast, still has to render inside a story or a test, so the read is inert and this
614
+ * one is not.
615
+ *
616
+ * @returns The engine the host installs plugins into.
617
+ * @throws {MountayaElementsError} When no host or {@link StudioPluginsProvider} is mounted above
618
+ * the caller.
619
+ */
620
+ declare const useStudioPlugins: () => StudioPluginEngine<ReactNode>;
621
+ /**
622
+ * StudioDensity is how tightly the studio draws its own regions.
623
+ *
624
+ * `compact` is the default: a map studio is chrome over a map, and its panels, forms and
625
+ * conversation are read at a glance beside the thing they act on rather than filled in like a
626
+ * page. `comfortable` steps every region up to Mantine's own baseline, which is the right answer
627
+ * for a consumer embedding the studio in an application whose forms are all full-page.
628
+ */
629
+ type StudioDensity = "comfortable" | "compact";
630
+ /**
631
+ * studioTokens is every `--mtya-*` custom property the studio and the elements beneath it read,
632
+ * with the value each one falls back to.
633
+ *
634
+ * The elements' half is SPREAD rather than restated. `elementsTokens` in
635
+ * `@mountaya/elements-react` is the declaration of the names the element roots assign; this file
636
+ * adds the studio's own on top, and the result is the complete list a consumer of an assembled
637
+ * studio overrides against. `theme/rules/tokens.test.ts` holds this list against the studio's
638
+ * sheet in both directions: every token declared here is assigned, and every token read is
639
+ * declared.
640
+ *
641
+ * **They are a second seam beside the Mantine theme, not a duplicate of it.** A theme is how a
642
+ * consumer states a brand to Mantine's own components; these are how the studio's hand-written
643
+ * surfaces and every element it mounts are drawn, and those surfaces render no Mantine component
644
+ * at all: a map control is a `<button>` on a canvas, and a theme has nothing to say about it.
645
+ *
646
+ * The values are the studio's LIGHT scheme. The dark scheme is a small override the sheet
647
+ * applies under `[data-mtya-color-scheme="dark"]` rather than a second map here, because the
648
+ * tokens that differ are a handful and a second full copy is two lists to keep in step.
649
+ */
650
+ declare const studioTokens: {
651
+ readonly "--mtya-activity-badge-bg": "rgba(0, 0, 0, 0.04)";
652
+ readonly "--mtya-activity-badge-size": "1.75rem";
653
+ readonly "--mtya-activity-glyph-color": "rgb(100, 116, 139)";
654
+ readonly "--mtya-activity-glyph-size": "1rem";
655
+ readonly "--mtya-brand-font": "inherit";
656
+ readonly "--mtya-focus-ring-color": "#339af0";
657
+ readonly "--mtya-focus-ring-offset": "2px";
658
+ readonly "--mtya-focus-ring-width": "2px";
659
+ readonly "--mtya-layer-thumb-height": "52px";
660
+ readonly "--mtya-layer-thumb-height-sm": "40px";
661
+ readonly "--mtya-place-mark-color": "#3b82f6";
662
+ readonly "--mtya-place-mark-size": "28px";
663
+ readonly "--mtya-search-input-color": "#404040";
664
+ readonly "--mtya-search-input-color-dark": "var(--mantine-color-dark-0)";
665
+ readonly "--mtya-search-input-held-bg": "var(--mantine-color-gray-1)";
666
+ readonly "--mtya-search-input-held-bg-dark": "var(--mantine-color-dark-5)";
667
+ readonly "--mtya-search-row-hover-bg": "var(--mantine-color-gray-1)";
668
+ readonly "--mtya-search-row-selected-bg": "var(--mantine-color-blue-light)";
669
+ readonly "--mtya-segment-swatch-radius": "50%";
670
+ readonly "--mtya-accent": "#1c7ed6";
671
+ readonly "--mtya-control-bg": "#ffffff";
672
+ readonly "--mtya-control-bg-hover": "#f1f3f5";
673
+ readonly "--mtya-control-fg": "#212529";
674
+ readonly "--mtya-control-fg-disabled": "#adb5bd";
675
+ readonly "--mtya-control-gap": "4px";
676
+ readonly "--mtya-control-radius": "8px";
677
+ readonly "--mtya-control-shadow": "0 1px 3px rgb(0 0 0 / 5%), 0 1px 2px rgb(0 0 0 / 10%)";
678
+ readonly "--mtya-control-size": "36px";
679
+ readonly "--mtya-dimmed": "#868e96";
680
+ readonly "--mtya-edge-inset": "16px";
681
+ readonly "--mtya-focus-ring": "#1c7ed6";
682
+ readonly "--mtya-font": "system-ui, -apple-system, \"Segoe UI\", roboto, sans-serif";
683
+ readonly "--mtya-panel-bg": "#ffffff";
684
+ readonly "--mtya-panel-border": "#dee2e6";
685
+ readonly "--mtya-panel-fg": "#212529";
686
+ readonly "--mtya-panel-radius": "12px";
687
+ readonly "--mtya-panel-width": "340px";
688
+ readonly "--mtya-profile-axis-font-size": "11px";
689
+ readonly "--mtya-profile-axis-size": "68px";
690
+ readonly "--mtya-profile-band-size": "8px";
691
+ readonly "--mtya-profile-chart-size": "120px";
692
+ readonly "--mtya-profile-cursor": "#212529";
693
+ readonly "--mtya-profile-cursor-dash": "3 3";
694
+ readonly "--mtya-profile-grid-color": "#dee2e6";
695
+ readonly "--mtya-profile-lit-fill": "rgb(233 80 30 / 12%)";
696
+ readonly "--mtya-profile-navigator-handle": "#212529";
697
+ readonly "--mtya-profile-navigator-size": "36px";
698
+ readonly "--mtya-profile-navigator-veil": "rgb(255 255 255 / 62%)";
699
+ readonly "--mtya-profile-padding": "12px 16px";
700
+ readonly "--mtya-profile-section-gap": "4px";
701
+ readonly "--mtya-profile-tooltip-bg": "#ffffff";
702
+ readonly "--mtya-profile-tooltip-fg": "#212529";
703
+ readonly "--mtya-profile-tooltip-shadow": "0 2px 8px rgb(0 0 0 / 12%)";
704
+ readonly "--mtya-profile-waypoint-color": "#868e96";
705
+ readonly "--mtya-profile-waypoint-line": "1px dashed #adb5bd";
706
+ readonly "--mtya-profile-waypoint-open-size": "24px";
707
+ readonly "--mtya-profile-waypoint-size": "8px";
708
+ readonly "--mtya-profile-xaxis-size": "34px";
709
+ readonly "--mtya-table-border": "#dee2e6";
710
+ readonly "--mtya-table-card-gap": "8px";
711
+ readonly "--mtya-table-cell-padding": "8px 12px";
712
+ readonly "--mtya-table-font-size": "13px";
713
+ readonly "--mtya-table-header-font-size": "11px";
714
+ readonly "--mtya-table-padding": "12px 16px";
715
+ readonly "--mtya-table-row-hover": "#f1f3f5";
716
+ readonly "--mtya-table-spark-base": "#dee2e6";
717
+ readonly "--mtya-table-spark-inline-size": "140px";
718
+ readonly "--mtya-table-spark-size": "28px";
719
+ readonly "--mtya-tooltip-bg": "#212529";
720
+ readonly "--mtya-tooltip-fg": "#ffffff";
721
+ readonly "--mtya-waypoint-card-gap": "16px";
722
+ readonly "--mtya-waypoint-card-mark-color": "#3b82f6";
723
+ readonly "--mtya-waypoint-card-mark-fg": "#ffffff";
724
+ readonly "--mtya-waypoint-card-mark-size": "36px";
725
+ };
726
+ /**
727
+ * One token name, derived from {@link studioTokens} so the two cannot drift, which means it
728
+ * covers the elements' names too, because the map spreads them.
729
+ *
730
+ * A closed union rather than `string`, which is what makes a typo a compile error: a `tokens`
731
+ * prop carrying `--mtya-panel-raduis` is otherwise a declaration that lands, inherits, and
732
+ * paints nothing, with no failure anywhere.
733
+ */
734
+ type StudioTokenName = keyof typeof studioTokens;
735
+ /**
736
+ * StudioTokens is a consumer's overrides, at whatever subset they care to state.
737
+ *
738
+ * Values stay STRINGS even where the default is a length: they land in a `style` object as CSS
739
+ * custom properties, and a number there is written with no unit (`--mtya-control-size: 36`
740
+ * paints nothing and reports nothing).
741
+ */
742
+ type StudioTokens = Partial<Record<StudioTokenName, string>>;
743
+ /**
744
+ * StudioLayerKind names which catalogue a slug belongs to.
745
+ *
746
+ * Two kinds, because they are two lists a reader chooses from separately (a base map is
747
+ * exclusive and an overlay is not), and their slugs share a namespace with nothing keeping them
748
+ * apart. A host serving both from one directory would silently answer a terrain's picture for
749
+ * an overlay of the same name.
750
+ */
751
+ type StudioLayerKind = "overlay" | "terrain";
752
+ /**
753
+ * NavigationSeam is how a studio surface moves, without naming a router.
754
+ *
755
+ * `navigate` takes a path the surface built and a `replace` flag, because a studio
756
+ * distinguishes a step the user should be able to go back through (opening an itinerary) from
757
+ * one they should not (normalising a URL after a rename). `location` reads the current path,
758
+ * which is what a surface highlighting its own row needs.
759
+ *
760
+ * A path rather than a route object: a route object is a router's vocabulary, and adopting one
761
+ * would make this seam a re-export of somebody's types rather than a seam.
762
+ */
763
+ interface NavigationSeam {
764
+ /** Reads the current path. */
765
+ readonly location: () => string;
766
+ /** Moves to `path`, replacing the current entry where `replace` is true. */
767
+ readonly navigate: (path: string, options?: {
768
+ readonly replace?: boolean | undefined;
769
+ }) => void;
770
+ }
771
+ /**
772
+ * StudioControlKind names a control the studio's panels have to point back at.
773
+ *
774
+ * Closed rather than a string, because the register and the read are written in two different
775
+ * files and a typo in either is silent: the panel exempts nothing, the toggle closes it, and the
776
+ * button's own handler reopens it a frame later, which reads as a panel that flickers rather
777
+ * than as a name that did not match.
778
+ */
779
+ type StudioControlKind = "layers" | "preferences";
780
+ /**
781
+ * StudioControlAnchors is where a floating panel finds the toggle that opened it.
782
+ *
783
+ * A panel positioned somewhere ELSE on the page has to exempt its own toggle from its
784
+ * outside-click handler, or a press closes the panel and the button's handler immediately
785
+ * reopens it. Not a `document.querySelector` on the toggle's `data-mtya-control`, which looks
786
+ * equivalent and is not: it finds the FIRST match in the document, so two studios on one page
787
+ * would exempt each other's button, and it finds nothing at all across a shadow root.
788
+ *
789
+ * Backed by a ref rather than by state, because registering is not a render: a control mounting
790
+ * must not render every surface under the provider again, and the panel reads the anchor during
791
+ * its own render, which always happens after the toggle that opened it mounted.
792
+ */
793
+ interface StudioControlAnchors {
794
+ /** The element a panel's outside-click must not treat as outside, or null. */
795
+ readonly anchorFor: (kind: StudioControlKind) => HTMLElement | null;
796
+ /** Records the element a control occupies, or clears it with null on teardown. */
797
+ readonly register: (kind: StudioControlKind, element: HTMLElement | null) => void;
798
+ }
799
+ /**
800
+ * StudioContextValue is what {@link useStudioContext} resolves: the bus, the tool context, the
801
+ * store and every seam a studio surface reads.
802
+ *
803
+ * `TCtx` is the host's own tool context, the object its handlers receive and the one part of a
804
+ * bus this package cannot know.
805
+ *
806
+ * `TInputs` is the name-to-input map `bus.dispatch` is checked against. It defaults to
807
+ * `ToolDispatchRegistry`, the empty interface a host augments, which fits a host that registered
808
+ * its own tools. A caller that knows the tools it dispatches names that map instead
809
+ * (`StudioToolInputs` for the studio's own) and gets a checked `dispatch` with no global
810
+ * augmented on anyone's behalf.
811
+ *
812
+ * `TOutputs` is the name-to-data map `bus.dispatch` answers by. It defaults to
813
+ * `ToolOutputRegistry`, the second interface a host augments, under which every answer's `data`
814
+ * reads `unknown` until the host merges its outputs. A caller that names a map
815
+ * (`StudioToolOutputs` for the studio's own) takes a member of `result.data` after `result.ok`
816
+ * with no narrowing of its own. The map is a way of reading the bus and no part of its identity:
817
+ * the provider holds one dispatch slice, and each reader types the answers it reads.
818
+ */
819
+ interface StudioContextValue<TCtx extends ToolBusContext = ToolBusContext, TInputs extends object = ToolDispatchRegistry, TOutputs extends object = ToolOutputRegistry> {
820
+ /** The activity catalog, empty where the host supplied none. */
821
+ readonly activities: readonly CategoryActivities[];
822
+ /** Where an activity's silhouette is fetched as an image, or null where the host said none. */
823
+ readonly activityIconUrl: ((slug: string) => string | undefined) | null;
824
+ /** The picture of a map layer, or null where the host said none. */
825
+ readonly layerThumbnail: ((kind: StudioLayerKind, slug: string) => string | undefined) | null;
826
+ /** The origin a link that leaves the tab is built from, or null for the page's own. */
827
+ readonly appOrigin: string | null;
828
+ /** The bus every dispatch runs through, or null where none is mounted. */
829
+ readonly bus: (ToolBusDispatch<TCtx, TInputs, TOutputs> & ToolBusObserveOverrides) | null;
830
+ /** What this studio grants. */
831
+ readonly capabilities: ReadonlySet<ToolCapability>;
832
+ /** The tool context each verb is handed, or null where none is mounted. */
833
+ readonly context: TCtx | null;
834
+ /** The elevation raster the maps bake their relief from, or undefined for flat relief. */
835
+ readonly demUrl: string | undefined;
836
+ /**
837
+ * What the host put in place of the studio's lockup: `undefined` where nothing is configured,
838
+ * unlike every other member here, because `null` is a VALUE on this seam (it hides the
839
+ * header), and folding the two together would make "no header" and "the Mountaya header" the
840
+ * same read.
841
+ */
842
+ readonly header: StudioHeaderOverride | undefined;
843
+ /** The mark a language picker draws beside each language, or null for none. */
844
+ readonly languageMark: ((language: MapLanguage$1) => ReactNode) | null;
845
+ /** The languages the studio's pickers offer, each labelled by its endonym. */
846
+ readonly languages: readonly {
847
+ label: string;
848
+ value: MapLanguage$1;
849
+ }[];
850
+ /** How a surface moves, or null where the host supplied no router. */
851
+ readonly navigation: NavigationSeam | null;
852
+ /** How a collaborator's id becomes a name, or null where the host supplied no directory. */
853
+ readonly resolvePeerName: StudioPeerNameSeam | null;
854
+ /** Where a floating panel finds the toggle that opened it. */
855
+ readonly controlAnchors: StudioControlAnchors;
856
+ /** How tightly the studio draws its own regions. */
857
+ readonly density: StudioDensity;
858
+ /** The `--mtya-*` overrides the host declared, or null for none. */
859
+ readonly tokens: StudioTokens | null;
860
+ /** The capabilities the studio takes from the world around it, folded onto the defaults. */
861
+ readonly seams: StudioSeams;
862
+ /** The studio's state, or null where no store is mounted. */
863
+ readonly store: UiStoreApi | null;
864
+ /** The studio's own words, in the selected language with every override merged. */
865
+ readonly strings: StudioStrings;
866
+ }
867
+ /**
868
+ * StudioSeamOverrides is the `seams` a host states: any of {@link StudioSeams}' members, each
869
+ * present, left out, or written as `undefined`.
870
+ *
871
+ * A member left out or written as `undefined` keeps the default seam of
872
+ * `createDefaultStudioSeams`, so a host forwards a seam it may not hold
873
+ * (`storage: remember ? accountStorage : undefined`) and the studio still has one. Each member
874
+ * states `undefined`, so that line compiles under `exactOptionalPropertyTypes`, which
875
+ * `Partial<StudioSeams>` refuses.
876
+ *
877
+ * The whole set is assignable to it: `createInertStudioSeams()` switches every capability off
878
+ * at once.
879
+ *
880
+ * A provider holds the object for as long as its own members are the ones the render before
881
+ * stated, compared one level deep by `Object.is`. So the object may be written inline, and a
882
+ * member is declared once: a seam built inline is a new one at every render, and the set is
883
+ * folded again for it.
884
+ */
885
+ interface StudioSeamOverrides {
886
+ /**
887
+ * Where a Camera Plan is resolved into per-frame poses, and therefore on which thread.
888
+ *
889
+ * @default `synchronousCameraPlanner()`
890
+ */
891
+ readonly cameraPlanner?: StudioSeams["cameraPlanner"] | undefined;
892
+ /**
893
+ * Where a product-meaningful moment or delay comes from.
894
+ *
895
+ * @default `systemClock()`
896
+ */
897
+ readonly clock?: StudioSeams["clock"] | undefined;
898
+ /**
899
+ * How a number, a date and a relative moment reach a screen.
900
+ *
901
+ * @default `createIntlFormatters(locale)`, in the provider's locale
902
+ */
903
+ readonly formatters?: StudioSeams["formatters"] | undefined;
904
+ /**
905
+ * Where a device fix comes from, and whether asking would prompt.
906
+ *
907
+ * @default `browserGeolocation()`
908
+ */
909
+ readonly geolocation?: StudioSeams["geolocation"] | undefined;
910
+ /**
911
+ * Where a client-side id comes from, for a draft that has no resource to name yet.
912
+ *
913
+ * @default `systemStudioIds`
914
+ */
915
+ readonly ids?: StudioSeams["ids"] | undefined;
916
+ /**
917
+ * Where a link to somewhere outside the product goes, or that there is none.
918
+ *
919
+ * @default `googleMapsLinks`
920
+ */
921
+ readonly links?: StudioSeams["links"] | undefined;
922
+ /**
923
+ * Where a file the studio produced goes: a disk, a share sheet, or nowhere.
924
+ *
925
+ * @default `browserSaveFile`
926
+ */
927
+ readonly saveFile?: StudioSeams["saveFile"] | undefined;
928
+ /**
929
+ * Where a preference that outlives a session is kept.
930
+ *
931
+ * @default `localStudioStorage()`
932
+ */
933
+ readonly storage?: StudioSeams["storage"] | undefined;
934
+ }
935
+ /**
936
+ * StudioProviderProps is what a consumer configures the headless studio through.
937
+ *
938
+ * The SAME groups `MountayaStudioHost` takes, out of the same types, which is the point rather
939
+ * than a tidiness: `@mountaya/studio-react/headless` is offered as "our verbs, your design
940
+ * system", and a second spelling here would have a consumer moving over from the assembled
941
+ * studio learn again every decision they have already made. A Dart or Swift port declares one
942
+ * set of structs and both of its surfaces take them.
943
+ *
944
+ * The groups are the SHARED halves rather than the host's. `appearance` carries no Mantine
945
+ * theme, because this path brings no design system; `behavior` carries no handlers or
946
+ * recognizers, because this path brings its own bus. Those are the two things that genuinely
947
+ * differ between the surfaces, and the type difference says so rather than a paragraph.
948
+ *
949
+ * `bus`, `context` and `store` stay on `data` beside the catalog and the grants: they are what
950
+ * this provider is HANDED rather than what it builds, which is the whole of what "headless"
951
+ * means here.
952
+ */
953
+ interface StudioProviderProps<TCtx extends ToolBusContext = ToolBusContext> {
954
+ /** What it looks like: the scheme, the density, the tokens, the canvas paint. */
955
+ readonly appearance?: StudioAppearanceConfig | undefined;
956
+ /** Where the pictures come from: the glyph tables, the relief raster, the activity artwork. */
957
+ readonly assets?: StudioAssetsConfig | undefined;
958
+ /** What the studio does, and what you do instead: `seams`, the router, the peer names. */
959
+ readonly behavior?: StudioBehaviorConfig | undefined;
960
+ /** The surfaces that read the studio. */
961
+ readonly children: ReactNode;
962
+ /** What the studio is showing and to whom, plus the bus, the context and the store. */
963
+ readonly data?: StudioProviderDataConfig<TCtx> | undefined;
964
+ /** Which words, and which regional conventions: the language, the locale, both bundles. */
965
+ readonly i18n?: StudioI18nConfig | undefined;
966
+ }
967
+ /**
968
+ * What the headless provider is SHOWN, plus what it is handed rather than builds.
969
+ *
970
+ * `bus` and `context` have no counterpart on the host's `data`, and that asymmetry is the
971
+ * difference between the two surfaces stated in a type: the host builds a bus out of the
972
+ * handlers and recognizers it was given, and this provider takes one.
973
+ *
974
+ * `capabilities` is read as the host hands it. An array or a set is read at every render of the
975
+ * provider, so one a host mutates in place is followed from the next render. An iterator (what
976
+ * `grants.values()` hands over) yields its members once: the provider reads it once and holds
977
+ * its members for as long as the host hands the same object.
978
+ */
979
+ interface StudioProviderDataConfig<TCtx extends ToolBusContext = ToolBusContext> extends StudioDataConfig {
980
+ /** The tool bus every dispatch beneath this provider runs through. */
981
+ readonly bus?: (ToolBusDispatch<TCtx> & ToolBusObserveOverrides) | null | undefined;
982
+ /** The tool context handlers receive. Omit it and every action becomes a no-op. */
983
+ readonly context?: TCtx | null | undefined;
984
+ }
985
+ /**
986
+ * StudioProvider supplies the studio's bus, store, tool context and settings to everything under
987
+ * it.
988
+ *
989
+ * It composes WITH `MountayaElementsProvider` rather than replacing it: a studio needs a map,
990
+ * glyphs and copy too, and duplicating those here would give a consumer two places to set an
991
+ * icon table. Mount both; order does not matter.
992
+ */
993
+ declare const StudioProvider: <TCtx extends ToolBusContext = ToolBusContext>(grouped: StudioProviderProps<TCtx>) => ReactNode;
994
+ /**
995
+ * useStudioToolContext reads the host's own tool context: the seam bag a handler receives.
996
+ *
997
+ * It THROWS outside a provider carrying one, as `useStudioHostRegistry` does and for the same
998
+ * reason: this is host-shaped WIRING rather than an affordance. A surface reaching for the raw
999
+ * context is passing it somewhere (an agent session, a bridge, a chained dispatch), and a null
1000
+ * threaded into one of those has no symptom: the call succeeds, does nothing, and the studio
1001
+ * quietly stops responding. A read whose absence degrades into something visible answers inertly
1002
+ * instead.
1003
+ *
1004
+ * Reach for it only when nothing narrower will do. `useStudioDispatch` runs a verb,
1005
+ * `useUiStoreApi` reads the store at call time, `useCapability` answers a grant: each of those
1006
+ * is the same question asked in a way that cannot be threaded somewhere wrong.
1007
+ *
1008
+ * @returns The tool context, typed as the caller names it.
1009
+ * @throws {MountayaElementsError} When no provider above the caller carries a tool context.
1010
+ */
1011
+ declare const useStudioToolContext: <TCtx extends ToolBusContext = ToolBusContext>() => TCtx;
1012
+ /**
1013
+ * useStudioContext reads everything the nearest {@link StudioProvider} holds: the bus, the tool
1014
+ * context, the store and the seams. Outside a provider it answers the inert default and never
1015
+ * throws.
1016
+ *
1017
+ * It renders its caller whenever any of those moves. A reader of one part takes the hook that
1018
+ * reads it ({@link useCapability}, {@link useStudioStrings}, `useUiStore`, `useStudioDispatch`),
1019
+ * which renders it for that part alone.
1020
+ *
1021
+ * The three type arguments are the reader's, as {@link StudioContextValue} describes them: the
1022
+ * host's tool context, the inputs `bus.dispatch` is checked against and the outputs it answers
1023
+ * by. A reader of the studio's own verbs names `StudioToolInputs` and `StudioToolOutputs`, and
1024
+ * `useStudioDispatch` is that reader already written.
1025
+ *
1026
+ * @example
1027
+ * ```tsx
1028
+ * declare const itineraryId: string;
1029
+ *
1030
+ * const { bus, context } = useStudioContext<
1031
+ * StudioToolContext,
1032
+ * StudioToolInputs,
1033
+ * StudioToolOutputs
1034
+ * >();
1035
+ *
1036
+ * const rename = async (name: string) => {
1037
+ * if (bus === null || context === null) {
1038
+ * return;
1039
+ * }
1040
+ *
1041
+ * const result = await bus.dispatch(context, "studio.itinerary.rename", { itineraryId, name });
1042
+ * console.log(result.ok ? result.summary : result.error);
1043
+ * };
1044
+ * ```
1045
+ */
1046
+ declare const useStudioContext: <TCtx extends ToolBusContext = ToolBusContext, TInputs extends object = ToolDispatchRegistry, TOutputs extends object = ToolOutputRegistry>() => StudioContextValue<TCtx, TInputs, TOutputs>;
1047
+ /**
1048
+ * useStudioActivities reads the activity catalog the host resolved.
1049
+ *
1050
+ * Every surface that names an activity (the picker, the segment list's engine hint, the
1051
+ * elevation panel's speed default, the suggest form's seed) reads it here rather than fetching
1052
+ * one. The catalog is the same for the whole tree and changes about as often as a deploy, so a
1053
+ * component reaching for it independently would be the same request repeated behind a cache
1054
+ * whose absence nothing would notice.
1055
+ *
1056
+ * Always an array, never undefined: a surface outside a provider gets an empty catalog, which
1057
+ * is what an activity picker with no options and a row naming its activity by id already do.
1058
+ * The distinction between "loading" and "loaded empty" belongs to whoever holds the query, and
1059
+ * no surface here branches on it.
1060
+ */
1061
+ declare const useStudioActivities: () => readonly CategoryActivities[];
1062
+ /**
1063
+ * useStudioDemUrl reads the elevation raster the host supplied, for a surface that seeds its own
1064
+ * map rather than going through {@link useStudioMapSync}.
1065
+ *
1066
+ * `undefined` outside a provider and inside one that supplied none: the same answer, because
1067
+ * they mean the same thing: render the relief flat.
1068
+ */
1069
+ declare const useStudioDemUrl: () => string | undefined;
1070
+ /**
1071
+ * useStudioHeader reads what the host put in place of the studio's own brand lockup.
1072
+ *
1073
+ * Three answers rather than two, and keeping them apart is the whole reason this hook does not
1074
+ * collapse to `?? null` the way its neighbours do:
1075
+ *
1076
+ * - `undefined`, "not configured": the Mountaya lockup stands. Outside a provider too,
1077
+ * which is the same answer for the same reason: a header rendered in a story or a print view
1078
+ * is still this package's header.
1079
+ * - `null`: the host asked for NO header.
1080
+ * - anything else: the host's own node, or a `{ icon, title, baseline }` to draw.
1081
+ *
1082
+ * It answers what was SET, not what will be drawn. `StudioHeader` is where the `white-label`
1083
+ * entitlement is read, because that answer moves after the studio mounts and this one does not.
1084
+ */
1085
+ declare const useStudioHeader: () => StudioHeaderOverride | undefined;
1086
+ /**
1087
+ * useStudioLanguageMark reads the mark a language picker draws beside each language.
1088
+ *
1089
+ * `undefined` outside a provider, and `undefined` inside one that supplied none: the same
1090
+ * answer, because they mean the same thing: draw the names alone. `LanguageSelect` takes this
1091
+ * shape directly as its `renderMark`, so a picker inside a studio needs no prop at all.
1092
+ */
1093
+ declare const useStudioLanguageMark: () => ((language: MapLanguage$1) => ReactNode) | undefined;
1094
+ /**
1095
+ * useStudioLanguages reads which languages this studio's pickers offer, already labelled.
1096
+ *
1097
+ * Every picker in the studio reads it rather than building its own list, which is the property
1098
+ * worth having: "which languages is this product available in" is one answer, and a surface that
1099
+ * derives it separately is a surface that can offer a different set. Outside a provider it is
1100
+ * English alone, the one language built in.
1101
+ */
1102
+ declare const useStudioLanguages: () => readonly {
1103
+ label: string;
1104
+ value: MapLanguage$1;
1105
+ }[];
1106
+ /**
1107
+ * useStudioDensity reads which tier the studio's own regions draw at.
1108
+ *
1109
+ * Every surface that mounts a scoped theme reads it rather than importing a constant, so a
1110
+ * host's `density` reaches them all at once, and a surface added later inherits the tier
1111
+ * instead of shipping at whichever one its author happened to copy.
1112
+ */
1113
+ declare const useStudioDensity: () => StudioDensity;
1114
+ /**
1115
+ * useStudioTokens reads the `--mtya-*` overrides the host declared, as a `style` object.
1116
+ *
1117
+ * The studio mounts elements from `@mountaya/elements-react`, and each of those ASSIGNS its own
1118
+ * token block on its root rather than inheriting one, so a token set on the studio root is
1119
+ * shadowed by the element and never reaches it. Handing the same object down as an inline
1120
+ * `style` is what closes that: an inline declaration outranks a class rule, so the element
1121
+ * reads the host's value and falls back to its own block for everything unstated.
1122
+ *
1123
+ * @returns One object per token set the provider holds.
1124
+ */
1125
+ declare const useStudioTokens: () => Record<string, string>;
1126
+ /**
1127
+ * StudioPeerNameSeam answers who a collaborator IS, for one organization.
1128
+ *
1129
+ * A factory rather than a resolver, because the organization is chosen at render time (the
1130
+ * active zone's, else the active itinerary's), and that lives in the studio's own store, which
1131
+ * the host creates. A seam bound above the host therefore cannot read it.
1132
+ */
1133
+ type StudioPeerNameSeam = (organizationId: string | null) => PeerNameResolver;
1134
+ /**
1135
+ * useStudioPeerName reads how a collaborator's id becomes a name, for ONE organization.
1136
+ *
1137
+ * The seam is the host's because a directory of people is: who may be named, and by what, is an
1138
+ * account question with no public read behind it. Every surface that names a peer (a lock
1139
+ * badge, a ghost label, a roster row) reads THIS one, so the studio never shows an id beside
1140
+ * one row and a name beside another.
1141
+ *
1142
+ * It takes the organization rather than resolving one, for the same reason the billing gate
1143
+ * does: the answer is per-organization and the host cannot know which one in advance. It also
1144
+ * cannot find out: the active resource lives in the studio's STORE, which the host CREATES, so
1145
+ * a binding that read it would be reading a context that does not exist yet where it is bound.
1146
+ *
1147
+ * The host's implementation calls hooks, so this is called unconditionally in a component body
1148
+ * exactly like one, and the seam's identity must be stable across renders.
1149
+ *
1150
+ * @param organizationId - The organization of the resource the surface shows, or null.
1151
+ * @returns The resolver, or one that resolves no name where the host supplied no seam.
1152
+ */
1153
+ declare const useStudioPeerName: (organizationId: string | null) => PeerNameResolver;
1154
+ /**
1155
+ * useStudioActivityIconUrl resolves an activity's silhouette to an image URL.
1156
+ *
1157
+ * For the surfaces that composite rather than render: the video recorder's focus marker and
1158
+ * the elevation profile's follow-marker. Everything that draws a badge in a DOM goes through
1159
+ * `<ActivityIcon>` and the marker seam instead.
1160
+ *
1161
+ * Outside a provider, and inside one that supplied no resolver, it answers undefined for every
1162
+ * slug, which both callers already read as "no silhouette", so neither grows a branch.
1163
+ */
1164
+ declare const useStudioActivityIconUrl: () => ((slug: string) => string | undefined);
1165
+ /**
1166
+ * useStudioLayerThumbnail resolves a map layer's slug to a picture of it.
1167
+ *
1168
+ * Every card grid that offers a layer reads it, so one layer cannot show two different
1169
+ * pictures in two places.
1170
+ *
1171
+ * Outside a provider, and inside one that supplied no resolver, it answers undefined for every
1172
+ * slug, and the grids render their cards with no media.
1173
+ */
1174
+ declare const useStudioLayerThumbnail: () => ((kind: StudioLayerKind, slug: string) => string | undefined);
1175
+ /**
1176
+ * useCapability answers whether the surface may perform a class of action.
1177
+ *
1178
+ * The question a component asks to decide whether to render a control at all. It is not a
1179
+ * substitute for the bus's own gate (dispatch checks again, because a surface that hid a
1180
+ * button has not stopped an agent from asking for the same verb), but rendering a control that
1181
+ * would be refused is its own bug.
1182
+ *
1183
+ * @param capability - The class of action asked about.
1184
+ * @returns Whether the studio above grants it; false outside a provider.
1185
+ */
1186
+ declare const useCapability: (capability: ToolCapability) => boolean;
1187
+ /**
1188
+ * useStudioAppOrigin answers the origin a link that leaves this tab is built from.
1189
+ *
1190
+ * The provider's own value when it carries one, else `window.location.origin`: right wherever
1191
+ * the studio and the viewer are served together, which is every deployment that has not split
1192
+ * them. Empty outside a browser, so a snippet built server-side yields a relative URL rather
1193
+ * than one naming a host that does not exist.
1194
+ *
1195
+ * NOT `window.location.origin` at the call site, which is the mistake this hook exists to make
1196
+ * unnecessary: a development server answers on a port the published viewer never uses, so a
1197
+ * snippet built from it carries `localhost` into a publisher's page and fails there, silently,
1198
+ * after the paste.
1199
+ */
1200
+ declare const useStudioAppOrigin: () => string;
1201
+ /**
1202
+ * The studio's own sentences, in the language the provider selected and with any overrides
1203
+ * merged.
1204
+ *
1205
+ * Beside `useMountayaStrings` rather than folded into it: a control reads the elements' words
1206
+ * and a studio surface reads these, and a consumer who mounts controls and no studio never has
1207
+ * to learn this one exists.
1208
+ *
1209
+ * The whole bundle, formatters included, so it follows each formatter a host restates: a
1210
+ * formatter written inline in `i18n.studioStrings` renders the caller at every render of the
1211
+ * host. A surface that reads some sections takes `useStudioScopedStrings`, which renders it for
1212
+ * no restated formatter where those sections hold none.
1213
+ */
1214
+ declare const useStudioStrings: () => StudioStrings;
1215
+ /**
1216
+ * The capabilities the studio takes from the world around it, as this tree was wired with them.
1217
+ *
1218
+ * Published as one object AND as one hook per seam, and neither is redundant. A surface reads
1219
+ * the one it needs (a panel reaching for `useStudioLinks()` names what it uses and reads
1220
+ * nothing else again), and a host wiring their own composition takes the whole set through
1221
+ * `useStudioMapSeams()` to hand on.
1222
+ *
1223
+ * There is no throwing variant. Every seam has a working default, so the default context
1224
+ * carries a working set and a surface outside a provider degrades to the browser's own
1225
+ * behaviour rather than to a blank screen.
1226
+ */
1227
+ declare const useStudioMapSeams: () => StudioSeams;
1228
+ /** Where a product-meaningful moment or delay comes from. */
1229
+ declare const useStudioClock: () => Clock;
1230
+ /** How a number, a date and a relative moment reach a screen, in this studio's locale. */
1231
+ declare const useStudioFormatters: () => StudioFormatters;
1232
+ /** Where a device fix comes from, and whether asking would prompt. */
1233
+ declare const useStudioGeolocation: () => GeolocationSeam;
1234
+ /** Where a link to somewhere outside the product goes, or that there is none. */
1235
+ declare const useStudioLinks: () => StudioLinks;
1236
+ /** Where a preference that outlives a session is kept. */
1237
+ declare const useStudioStorage: () => StudioStorage;
1238
+ /**
1239
+ * Where a floating panel finds the toggle that opened it.
1240
+ *
1241
+ * Published because a consumer composing their own control stack and their own panel needs the
1242
+ * same pairing, and because the alternative, reading the button out of the document, finds the
1243
+ * first match on the page, so two studios would exempt each other's button, and it finds
1244
+ * nothing across a shadow root.
1245
+ */
1246
+ declare const useStudioControlAnchors: () => StudioControlAnchors;
1247
+ /**
1248
+ * Which words a studio says, and which regional conventions it writes them under.
1249
+ *
1250
+ * Extends `MountayaI18n` (the elements' own fields, declared in `@mountaya/elements/i18n` so a
1251
+ * renderer-free consumer and a port both reach them) with the ones a STUDIO adds. That
1252
+ * inheritance is the point rather than a convenience: a host that has set `language` on an
1253
+ * element and on a studio has set one field twice with one meaning.
1254
+ *
1255
+ * `strings` is the ELEMENTS' bundle and `studioStrings` is the studio's. Two bundles because
1256
+ * they are published from two packages on two translation schedules, and a consumer renaming one
1257
+ * panel's verb should not inherit responsibility for the map chrome's labels.
1258
+ */
1259
+ interface StudioI18nConfig extends MountayaI18n {
1260
+ /**
1261
+ * The mark every language picker in the studio draws beside a language name.
1262
+ *
1263
+ * Omitted, the pickers are plain lists of endonyms, a complete language picker, since a flag
1264
+ * is a country and a language is not. Pass a stable function: the studio's context is keyed on
1265
+ * it, so a function written inline renders every surface again at each render of the host.
1266
+ */
1267
+ readonly languageMark?: ((language: MapLanguage$1) => ReactNode) | undefined;
1268
+ /**
1269
+ * Which languages the studio's own pickers offer. Defaults to English and the languages handed
1270
+ * over in {@link studioTranslations}.
1271
+ *
1272
+ * Any `MapLanguage`, not only the translated ones: `resolveBundle` supports a consumer
1273
+ * supplying German through `studioStrings: { de: … }`, so the studio offers what a consumer
1274
+ * supplies.
1275
+ */
1276
+ readonly languages?: readonly MapLanguage$1[] | undefined;
1277
+ /**
1278
+ * The studio's own sentences, merged onto the selected language, key by key: an override that
1279
+ * names one sentence leaves the rest of its section as shipped. The map chrome's sentences are
1280
+ * {@link strings}.
1281
+ */
1282
+ readonly studioStrings?: StudioStringsOverrides | undefined;
1283
+ /**
1284
+ * The STUDIO's words in each language beyond English the page imported, keyed by language:
1285
+ * `{ fr: frStudioStrings }` from `@mountaya/studio/strings/fr`, beside the elements' French in
1286
+ * `translations`. A language asked for and not handed over reads in English and says so once
1287
+ * in development.
1288
+ *
1289
+ * Held by its members, so a set written inline resolves once.
1290
+ */
1291
+ readonly studioTranslations?: Translations<StudioStrings> | undefined;
1292
+ }
1293
+ /**
1294
+ * What a studio looks like: the part a design system does not answer.
1295
+ *
1296
+ * No Mantine type reaches this interface, which is what lets the headless provider take it: a
1297
+ * consumer of `@mountaya/studio-react/headless` brings their own components and still wants the
1298
+ * tokens, the scheme and the canvas paint.
1299
+ */
1300
+ interface StudioAppearanceConfig {
1301
+ /**
1302
+ * A class of your own on the surface's root element, merged with `.mtya-studio`, which the
1303
+ * stylesheet's container queries measure and its token block is declared on. Plain CSS on your
1304
+ * class beats every rule this package ships, which are unlayered and come earlier.
1305
+ */
1306
+ readonly className?: string | undefined;
1307
+ /**
1308
+ * Which colour scheme to paint in. Omitted, the studio follows Mantine's computed scheme.
1309
+ *
1310
+ * Stated on the studio's root as `data-mtya-color-scheme`, the attribute every sheet in the
1311
+ * family reads, the elements' and the studio's alike.
1312
+ */
1313
+ readonly colorScheme?: "dark" | "light" | undefined;
1314
+ /**
1315
+ * How tightly the studio draws its panels, forms and conversation.
1316
+ *
1317
+ * @default "compact"
1318
+ */
1319
+ readonly density?: StudioDensity | undefined;
1320
+ /**
1321
+ * What `<StudioHeader />` draws in place of the Mountaya lockup: a node of your own, or a
1322
+ * `{ icon, title, baseline }` rendered in the studio's own treatment.
1323
+ *
1324
+ * Requires the `white-label` entitlement, the same one that takes the Mountaya mark off a video
1325
+ * preview and the frames a recorder composites. Set by a viewer who does not hold it, the
1326
+ * override is REFUSED rather than partially honoured, and the header keeps saying Mountaya.
1327
+ *
1328
+ * `null` hides the header entirely, for a host whose own chrome already says whose studio this
1329
+ * is. That is a meaning rather than an absence, which is why omitting the field is `undefined`
1330
+ * and not `null`.
1331
+ */
1332
+ readonly header?: StudioHeaderOverride;
1333
+ /**
1334
+ * Overrides for what the MAP draws: the itinerary stroke, its casing, the layer ranks, the
1335
+ * palette a new segment is assigned from.
1336
+ *
1337
+ * A second seam beside {@link tokens} rather than more custom properties, and it has to be:
1338
+ * MapLibre evaluates paint expressions inside its own renderer against no DOM element, so a
1339
+ * `var(--mtya-accent)` reaches it as an unreadable string. The tokens theme the chrome AROUND
1340
+ * the canvas; this themes what is drawn IN it.
1341
+ *
1342
+ * Folded per key, so `{ itinerary: { casingColor } }` changes the halo and leaves every width,
1343
+ * dash and rank as shipped.
1344
+ */
1345
+ readonly paint?: MapPaintOverrides | undefined;
1346
+ /**
1347
+ * Inline style on the surface's root, merged over the layout it needs for itself and over the
1348
+ * tokens, so `style={{ "--mtya-accent": "#7048e8" }}` overrides the one property it names.
1349
+ */
1350
+ readonly style?: ElementStyle | undefined;
1351
+ /**
1352
+ * Overrides for the `--mtya-*` properties the studio and its elements are drawn with.
1353
+ *
1354
+ * The object is held for as long as its own members are the ones the render before stated,
1355
+ * compared one level deep by `Object.is`, so it may be written inline.
1356
+ */
1357
+ readonly tokens?: StudioTokens | undefined;
1358
+ }
1359
+ /**
1360
+ * Where the pictures come from.
1361
+ *
1362
+ * A glyph table per paint mode rather than one, and the reason is on `MountayaElementsProvider`:
1363
+ * a set has one paint mode, and a map control, a menu item and a waypoint mark are not drawn the
1364
+ * same way.
1365
+ */
1366
+ interface StudioAssetsConfig {
1367
+ /**
1368
+ * Where an activity's silhouette can be fetched as an image, for the surfaces that composite
1369
+ * rather than render: the recorder's focus marker and the elevation profile's follow-marker.
1370
+ * Omitted, both draw a plain disc.
1371
+ *
1372
+ * Pass a stable function: the studio's context is keyed on it, so a function written inline
1373
+ * renders every surface again at each render of the host.
1374
+ */
1375
+ readonly activityIconUrl?: ((slug: string) => string | undefined) | undefined;
1376
+ /**
1377
+ * The elevation raster every map in the studio bakes its always-on relief from, as a TileJSON
1378
+ * URL. Omitted, a map reads the elevation the layers manifest names, and renders flat where it
1379
+ * names none.
1380
+ */
1381
+ readonly demUrl?: string | undefined;
1382
+ /**
1383
+ * Glyphs for the map controls.
1384
+ *
1385
+ * @default the bundled Lucide set
1386
+ */
1387
+ readonly controlIcons?: MountayaElementsProviderProps["controlIcons"];
1388
+ /**
1389
+ * The pictures the import routing guide argues with, each as a URL you serve.
1390
+ *
1391
+ * The package ships no picture: what a studio's map looks like is the host's own. A comparison
1392
+ * is shown when both of its pictures are stated, and the guide makes that argument in words
1393
+ * otherwise. `MountayaStudioHost` hands them to the guide it mounts; a headless consumer states
1394
+ * them on its own `ImportRoutingGuideProvider`.
1395
+ *
1396
+ * @default undefined, and the guide requests no image
1397
+ */
1398
+ readonly importRoutingGuidePictures?: ImportRoutingGuidePictures | undefined;
1399
+ /**
1400
+ * The picture of a map layer, for the card grids that offer one. Omitted, a card shows the
1401
+ * layer's name with no picture.
1402
+ *
1403
+ * Pass a stable function: the studio's context is keyed on it, so a function written inline
1404
+ * renders every surface again at each render of the host.
1405
+ */
1406
+ readonly layerThumbnail?: ((kind: StudioLayerKind, slug: string) => string | undefined) | undefined;
1407
+ /**
1408
+ * Glyphs for the places an element draws, the waypoint marks on an elevation curve.
1409
+ *
1410
+ * @default the bundled marker set, never {@link controlIcons}
1411
+ */
1412
+ readonly markerIcons?: MountayaElementsProviderProps["markerIcons"];
1413
+ /**
1414
+ * Glyphs for the studio's own surfaces, as distinct from the map controls.
1415
+ *
1416
+ * @default {@link controlIcons} where it is stated, and the bundled outline set otherwise
1417
+ */
1418
+ readonly uiIcons?: MountayaElementsProviderProps["uiIcons"];
1419
+ }
1420
+ /**
1421
+ * What the studio does, and what a host does instead.
1422
+ *
1423
+ * The members here are the ones BOTH surfaces take. A host mounting the assembled studio has
1424
+ * more to override, because it has more that is mounted for it: see `StudioHostBehaviorConfig`.
1425
+ */
1426
+ interface StudioBehaviorConfig {
1427
+ /**
1428
+ * The origin every link that has to work outside this tab is built from: the embed snippet a
1429
+ * publisher pastes into their own page, and the share link they send.
1430
+ *
1431
+ * Omitted, it is `window.location.origin`, which is right wherever the studio and the viewer
1432
+ * are served together. State it where they are not, a development server on another port
1433
+ * among them, or a snippet carries that origin into a publisher's page.
1434
+ */
1435
+ readonly appOrigin?: string | null | undefined;
1436
+ /**
1437
+ * The router the studio sends a reader through when a surface links somewhere. Omitted, the
1438
+ * surfaces offer no link.
1439
+ *
1440
+ * Held by its members, so it may be written inline over a router's own two functions.
1441
+ */
1442
+ readonly navigation?: NavigationSeam | null | undefined;
1443
+ /**
1444
+ * How a collaborator's user id becomes a name, for every surface that names a peer. Omitted, a
1445
+ * peer is drawn with their initials.
1446
+ *
1447
+ * Pass a stable function: the studio's context is keyed on it, so a function written inline
1448
+ * renders every surface again at each render of the host.
1449
+ */
1450
+ readonly resolvePeerName?: StudioPeerNameSeam | undefined;
1451
+ /**
1452
+ * The capabilities the studio takes from the world around it, wholly or in part.
1453
+ *
1454
+ * Folded onto the browser defaults, so a host overriding one keeps the rest. Every seam has a
1455
+ * shipped implementation that does nothing, and doing nothing is a state every surface already
1456
+ * renders: `createInertStudioSeams()` turns them all off at once.
1457
+ *
1458
+ * A member left out or written as `undefined` keeps its default, so a host forwards a seam it
1459
+ * may not hold.
1460
+ *
1461
+ * The object is held for as long as its own members are the ones the render before stated,
1462
+ * compared one level deep by `Object.is`: written inline over seams declared once, it folds
1463
+ * no new set, and a seam built inline is a new member at every render.
1464
+ */
1465
+ readonly seams?: StudioSeamOverrides | undefined;
1466
+ }
1467
+ /**
1468
+ * What the studio is showing, and to whom.
1469
+ *
1470
+ * The members here are the ones BOTH surfaces take; a host resolves the rest for itself out of
1471
+ * the client it was given.
1472
+ */
1473
+ interface StudioDataConfig {
1474
+ /**
1475
+ * The activity catalog every surface that names an activity reads.
1476
+ *
1477
+ * Omitted, `MountayaStudioHost` reads it once through `useActivities()` and hands it down. Pass
1478
+ * a query's `data` straight through, `undefined` included: an absent catalog reads as one shared
1479
+ * empty catalog, where a `?? []` at the call site is a new array at each render. The studio's
1480
+ * context is keyed on the list, so a list written inline renders every surface again at each
1481
+ * render of the host.
1482
+ */
1483
+ readonly activities?: readonly CategoryActivities[] | null | undefined;
1484
+ /**
1485
+ * What this studio grants. `MountayaStudioHost` grants the whole editor where none is stated;
1486
+ * a read-only surface states `["embedding", "share"]`.
1487
+ *
1488
+ * The bus gates a verb on this set and a component gates its own affordance on it, so the two
1489
+ * read one set.
1490
+ *
1491
+ * `ToolCapability` rather than `StudioCapability`, and the difference is deliberate: the open one
1492
+ * admits a host's OWN capability string beside the studio's own, which is what a consumer
1493
+ * gating their own surfaces off the same set needs. The host and the headless provider take it
1494
+ * under one type, since it is one prop with one meaning.
1495
+ *
1496
+ * An array or a set is read at every render, so one a host mutates in place is followed from
1497
+ * the next render. An iterator (what `grants.values()` hands over) yields its members once: it
1498
+ * is read once, and its members are held for as long as the host hands the same object.
1499
+ */
1500
+ readonly capabilities?: Iterable<ToolCapability> | undefined;
1501
+ /**
1502
+ * The studio's state, from `createUiStore()`. `MountayaStudioHost` creates one per mount where
1503
+ * none is stated.
1504
+ *
1505
+ * Pass one to seed it: `createUiStore(embedUiBaseline)` starts a read-only viewer with no
1506
+ * enrichment overlay and no point-of-interest group. Every write after the mount crosses the
1507
+ * bus.
1508
+ *
1509
+ * Build it once per mount (`useState(createUiStore)`): one built in the render body is a new
1510
+ * store, and a studio that forgets its state, at each render of the host.
1511
+ */
1512
+ readonly store?: UiStoreApi | undefined;
1513
+ }
1514
+ /**
1515
+ * What an ASSEMBLED studio does, and what a host does instead.
1516
+ *
1517
+ * Everything the headless provider takes, plus the members that only make sense where the host
1518
+ * builds the bus and mounts the surfaces: a handler to replace, a confirmation to raise, a
1519
+ * departure to hold. A headless consumer wires each of those into the bus and the tool context
1520
+ * themselves, which is what "headless" means here rather than an omission.
1521
+ */
1522
+ interface StudioHostBehaviorConfig extends StudioBehaviorConfig {
1523
+ /**
1524
+ * The seam a verb outside the viewer's agreement hands its subject to, so the host attaches its
1525
+ * own action. Omitted, a surface at a limit states the limit and offers nothing.
1526
+ *
1527
+ * Pass a stable object: the studio's context is keyed on it, so one written inline renders
1528
+ * every surface again at each render of the host.
1529
+ */
1530
+ readonly billing?: StudioBillingGateSeam | undefined;
1531
+ /**
1532
+ * The gate the bus awaits before a destructive verb runs. Omitted, the host renders its own
1533
+ * dialog. A promise that resolves `false` is a refusal the verb reports as a structured
1534
+ * failure.
1535
+ *
1536
+ * Read when a verb asks, so one written inline costs nothing beneath.
1537
+ */
1538
+ readonly confirm?: StudioToolContext["confirm"];
1539
+ /**
1540
+ * The host's binding of the co-pilot: whether it may run for an organization, which model line
1541
+ * to name, and what to show in place of the conversation when the host withholds it. Omitted,
1542
+ * the studio has no co-pilot.
1543
+ *
1544
+ * Pass a stable object: the studio's context is keyed on it, so one written inline renders
1545
+ * every surface again at each render of the host.
1546
+ */
1547
+ readonly copilot?: StudioCopilotSeam | undefined;
1548
+ /**
1549
+ * Handlers to add or replace, spread over the published defaults: a key that names a published
1550
+ * verb replaces its handler and leaves the rest of the studio as shipped.
1551
+ *
1552
+ * Each entry is read when its verb is dispatched, so a map written inline builds no bus. A verb
1553
+ * stated as `undefined` is taken out of the studio: it is off the bus, the co-pilot is not
1554
+ * offered it, and every menu leaves out the item that would dispatch it
1555
+ * (`{ "studio.collection.manage.open": undefined }` for a host that manages collections itself).
1556
+ */
1557
+ readonly handlers?: StudioHandlers<StudioToolContext> | undefined;
1558
+ /**
1559
+ * Marks an organization's AI configuration stale after a co-pilot run is refused for a fault
1560
+ * that turns on it: the configuration is missing, or the reader has no access to it. Omitted,
1561
+ * the refusal still shows its message and the configuration is read again at its next refetch.
1562
+ */
1563
+ readonly invalidateAiConfig?: ((organizationId: string) => void) | undefined;
1564
+ /**
1565
+ * Marks the reader's memberships stale after a co-pilot run is refused or ended for want of
1566
+ * access: its start or its stream is answered 402, 403 or 404, a message finds its run gone, or
1567
+ * the run ends because its member may not run it there any more (no write role in its
1568
+ * organization, or an agreement that does not include Map Studio). The
1569
+ * co-pilot's availability is the host's answer from the memberships, so the notice the panel
1570
+ * shows next follows the role the reader holds now. Omitted, the refusal still shows its message
1571
+ * and the memberships are read again at their next refetch.
1572
+ */
1573
+ readonly invalidateMemberships?: (() => void) | undefined;
1574
+ /**
1575
+ * The gate that holds a departure while there is unsaved work. Omitted, a departure is never
1576
+ * held.
1577
+ *
1578
+ * Pass a stable object: the studio's context is keyed on it, so one written inline renders
1579
+ * every surface again at each render of the host.
1580
+ */
1581
+ readonly navigationBlocker?: StudioNavigationBlocker | undefined;
1582
+ /**
1583
+ * How the studio tells a reader something happened. Omitted, the studio works silently.
1584
+ *
1585
+ * Pass a stable object: the studio's context is keyed on it, so one written inline renders
1586
+ * every surface again at each render of the host.
1587
+ */
1588
+ readonly notify?: StudioNotify | undefined;
1589
+ /**
1590
+ * A telemetry observer, called once per dispatch with its outcome and latency, for every verb a
1591
+ * reader runs and every verb the co-pilot runs. An observer that throws changes no dispatch:
1592
+ * the fault is raised on a microtask, where the page's own error handling sees it.
1593
+ *
1594
+ * Read when a dispatch reports, so one written inline is attached once.
1595
+ */
1596
+ readonly onDispatch?: ToolDispatchObserver | undefined;
1597
+ /**
1598
+ * Asks the host whether the reader is still signed in after the API refused the browser's own
1599
+ * session under a co-pilot run: its start, its stream or a message into it is answered 401, as
1600
+ * it is once the reader signs out or their session is revoked. The host sends a reader nobody
1601
+ * is signed in as to sign in. Called once per refusal, once the conversation has settled. A 401
1602
+ * says nothing of the reader's access, so `invalidateMemberships` is not asked for it.
1603
+ *
1604
+ * Called only where the client rides the browser's own session. Under a publishable key a 401
1605
+ * refuses the key or the session token beside it, which is no sign-in a host can ask about, so
1606
+ * the studio calls nothing. Omitted, the refusal still shows its message.
1607
+ *
1608
+ * Read when a run is refused, so one written inline is attached once.
1609
+ */
1610
+ readonly onSignInRefused?: (() => void) | undefined;
1611
+ /**
1612
+ * Recognizers for a host's own thrown errors, asked before the status table and before the
1613
+ * published ones, which stay. This is where a host classifies what only it can tell apart,
1614
+ * such as a billing code that means "attach a card" rather than "outside the agreement".
1615
+ *
1616
+ * Read when a throw is classified, so a list written inline builds no bus.
1617
+ */
1618
+ readonly recognizers?: readonly ThrownRecognizer[] | undefined;
1619
+ /**
1620
+ * The host's own remedy for a co-pilot call that failed, which the model reads after the
1621
+ * playbook's recovery for that tool and code: where in this product a reader finds what the
1622
+ * failure says is missing. Omitted, the model reads the playbook's recovery alone. The video
1623
+ * wizard's director takes its own, as `video.recoveryAddendum`.
1624
+ *
1625
+ * Read when a call fails, so one written inline builds no conversation.
1626
+ */
1627
+ readonly recoveryAddendum?: RecoveryAddendum | undefined;
1628
+ /**
1629
+ * Whether a co-pilot run names the server tools its model sees, from the tools the
1630
+ * conversation's surfaces route to. Omitted, a run names none and keeps every server tool its
1631
+ * credential reaches.
1632
+ *
1633
+ * Leave it off under a publishable key: a run under a key calls no server tool, and the API
1634
+ * refuses a start or an update that names any. A host on the browser's own session turns it on
1635
+ * to narrow the server tools a run offers its model.
1636
+ *
1637
+ * @default false
1638
+ */
1639
+ readonly routesServerTools?: boolean | undefined;
1640
+ /**
1641
+ * How the open co-pilot thread is mirrored into the address bar, and read back out of it.
1642
+ * Omitted, a thread opens and closes and does not survive a reload or a shared link.
1643
+ */
1644
+ readonly threadsUrl?: AgentThreadsUrlSeam | undefined;
1645
+ /**
1646
+ * The studio's own slice of the address bar, which a content-open verb patches so a reload
1647
+ * reopens what was open. A `MountayaStudio` given no `url` of its own mirrors its map state
1648
+ * into it (the terrain, the overlay, the enrichments and the time offset) and restores it from
1649
+ * there on mount. Omitted, those verbs mirror nothing.
1650
+ */
1651
+ readonly url?: StudioUrlSeam | undefined;
1652
+ /**
1653
+ * What the export-as-video wizard `MountayaStudio` opens is bound to: its director's remedy for
1654
+ * a failed call, and the transform its preview map's tile requests ride. Omitted, the wizard
1655
+ * runs on the studio's own answers: the director reads the playbook's recovery alone, and the
1656
+ * preview draws each itinerary's published tiles under the studio map's credential.
1657
+ *
1658
+ * The wizard also takes {@link invalidateAiConfig}, which its director shares with the
1659
+ * co-pilot, so a host states that once.
1660
+ *
1661
+ * Held by its members, so it may be written inline over values declared once.
1662
+ */
1663
+ readonly video?: StudioVideoConfig | undefined;
1664
+ }
1665
+ /**
1666
+ * What the export-as-video wizard is bound to, where a studio mounts it for its host.
1667
+ *
1668
+ * `MountayaStudio` opens the wizard itself when a reader exports an itinerary as a video, and
1669
+ * draws its preview through the studio's own map client, so the preview and the editor read
1670
+ * under one credential. What is left are the two answers only a host has, each with a stated
1671
+ * absence.
1672
+ */
1673
+ interface StudioVideoConfig {
1674
+ /**
1675
+ * The host's own remedy for a call of the wizard's director that failed, which the model reads
1676
+ * after the playbook's recovery for that tool and code. Distinct from the co-pilot's
1677
+ * `behavior.recoveryAddendum`, since the director runs the camera verbs alone.
1678
+ *
1679
+ * Omitted, the model reads the playbook's recovery alone. Read when a call fails, so one written
1680
+ * inline builds no conversation.
1681
+ */
1682
+ readonly recoveryAddendum?: RecoveryAddendum | undefined;
1683
+ /**
1684
+ * The transform each request of the wizard's preview map rides, in place of the one the wizard
1685
+ * derives.
1686
+ *
1687
+ * Omitted, the wizard derives one from the studio's map client: its browser-safe credential,
1688
+ * its Tile API origin as the only host that receives it, and its language, as the studio's map
1689
+ * derives its own. To each request it claims, it adds `surface=published`, so the preview, and
1690
+ * the video recorded from it, draw the itinerary's published snapshot rather than the draft the
1691
+ * editor holds.
1692
+ *
1693
+ * Supply one for what that derivation cannot know: a header of your own, an origin the client
1694
+ * does not speak to. A transform of your own replaces the derived one whole, so it carries the
1695
+ * credential and asks for `surface=published` itself.
1696
+ */
1697
+ readonly transformRequest?: TileRequestTransform | undefined;
1698
+ }
1699
+ /**
1700
+ * What a host ADDS to the studio, as distinct from what it replaces.
1701
+ *
1702
+ * A group of its own rather than a member of `behavior`, and the line between them is the
1703
+ * question each answers. `behavior` is "what does it do, and what do you do instead": a handler
1704
+ * to replace, a confirm gate to raise, a router to send a reader through. A plugin adds
1705
+ * something the package has never heard of, in a place the package chose to open. Those are
1706
+ * different enough that folding them together would make `behavior` mean
1707
+ * "everything about behaviour", which is the flat-props problem the grouping exists to solve.
1708
+ *
1709
+ * Host-only, and it has to be: a headless consumer mounts their own surfaces, so the render
1710
+ * sites a contribution lands in do not exist for them. What they can still use is the registry
1711
+ * itself, from `@mountaya/studio/plugins`, driving their own components off `at(slot)`.
1712
+ */
1713
+ interface StudioPluginsConfig {
1714
+ /**
1715
+ * The plugins this studio installs, reconciled by id whenever the array changes.
1716
+ *
1717
+ * Hoist the declarations to module scope. The registry replaces a stored declaration when its
1718
+ * object reference changed, which is what makes a host that re-localizes its labels work, so
1719
+ * an array rebuilt inline on every host render re-renders the menus beneath it.
1720
+ */
1721
+ readonly install?: readonly StudioReactPlugin[] | undefined;
1722
+ /**
1723
+ * Where a failed plugin is reported, as ONE object discriminated on `kind`: a `run` that threw,
1724
+ * a `view` that threw during render, or an `install` the registry refused.
1725
+ *
1726
+ * ```ts
1727
+ * onError: (failure) => {
1728
+ * if (failure.kind === "install") {
1729
+ * report(failure.plugin.id, failure.error);
1730
+ * } else {
1731
+ * report(failure.contribution.qualifiedId, failure.error);
1732
+ * }
1733
+ * };
1734
+ * ```
1735
+ *
1736
+ * Omitted, a failure renders nothing and is silent, which is the right default for a menu
1737
+ * row (one broken plugin must not take the dropdown with it) and the wrong one for a host who
1738
+ * would like to know. A refusal names the DECLARATION rather than a contribution, because
1739
+ * producing one is exactly what the refusal prevented; narrow the error with
1740
+ * `isStudioPluginError` to read the defect list.
1741
+ *
1742
+ * A refusal is reported once for as long as `install` goes on stating its declaration, a list
1743
+ * written inline included: the declaration is found again by the id it states. It is reported
1744
+ * again once the list stops stating the declaration and states it again, and when the
1745
+ * declaration is refused in other words.
1746
+ *
1747
+ * A member of `install` that is no object states no declaration to name: it is refused, this
1748
+ * reporter is not called for it, and its refusal is raised on a microtask once the host has
1749
+ * committed, where the page's own error handling sees it. A server render commits nothing and
1750
+ * raises none. Such a member is raised once by the same rule, however often the list is
1751
+ * restated.
1752
+ *
1753
+ * Write it inline if that is what reads best. The host holds it through a ref and dispatches
1754
+ * through one stable function, so an arrow rebuilt on every render costs nothing beneath.
1755
+ */
1756
+ readonly onError?: StudioPluginErrorReporter | undefined;
1757
+ /**
1758
+ * A plugin engine of your own, instead of the one the host builds.
1759
+ *
1760
+ * For a host that installs and uninstalls from OUTSIDE the studio: a settings screen that
1761
+ * enables a plugin, a marketplace that loads one on demand. Supplied, `install` is still
1762
+ * reconciled into it, so the two compose rather than competing: a reconciliation takes back
1763
+ * only what a declared list installed, never what you installed through the engine yourself.
1764
+ *
1765
+ * The host attaches its BUS to whichever engine it ends up with, for as long as it is
1766
+ * mounted, so a plugin you installed before the studio mounted has its tools on the same bus
1767
+ * the co-pilot dispatches through, and gets them back when the studio unmounts.
1768
+ *
1769
+ * Build it once, outside the render: an engine built in the render body is a new registry at
1770
+ * each render of the host, which the bus is attached to again and every plugin menu reads anew.
1771
+ */
1772
+ readonly engine?: StudioPluginEngine<ReactNode> | undefined;
1773
+ }
1774
+ /**
1775
+ * What an ASSEMBLED studio looks like, including the two answers only a design system has.
1776
+ *
1777
+ * `theme` and `mantine` are here rather than on the shared interface because
1778
+ * `@mountaya/studio-react/headless` brings no design system: it has nothing to theme and
1779
+ * nothing to decide about mounting a provider for one. The split keeps the headless entry's
1780
+ * graph free of `@mantine/*` in the TYPES as well as at runtime.
1781
+ */
1782
+ interface StudioHostAppearanceConfig extends StudioAppearanceConfig {
1783
+ /**
1784
+ * Whether this host mounts a `MantineProvider` or inherits the one above it.
1785
+ *
1786
+ * `provide`, the default, mounts one scoped to the studio's root: its colour scheme and its
1787
+ * variables are written there, never on the page's `<html>` or `:root`, so a second studio
1788
+ * beside it keeps its own and the page keeps its scheme. A page that runs a `MantineProvider` of
1789
+ * its own writes its scheme on `<html>` as well, and where the two schemes differ Mantine's
1790
+ * per-scheme rules match both and are settled by their order in the sheet: such a page mounts
1791
+ * the studio with `inherit`, or in the page's scheme.
1792
+ *
1793
+ * `inherit` merges the studio's theme into the provider above through a nested
1794
+ * `MantineThemeProvider`, so the application's palette, radii and fonts stay; the studio's
1795
+ * {@link colorScheme} then reaches its own sheet and the elements, while Mantine's components
1796
+ * follow the enclosing provider's scheme. Either way the studio's dialogs, menus and tooltips
1797
+ * are portalled inside its root.
1798
+ *
1799
+ * @default "provide"
1800
+ */
1801
+ readonly mantine?: "inherit" | "provide" | undefined;
1802
+ /**
1803
+ * The Mantine theme this host merges over the studio's published base: the base first, then
1804
+ * the density, then this.
1805
+ *
1806
+ * Held by its content, compared member by member at every depth with functions by identity,
1807
+ * so it may be written inline.
1808
+ */
1809
+ readonly theme?: MantineThemeOverride | undefined;
1810
+ }
1811
+ /**
1812
+ * What an ASSEMBLED studio is showing, and to whom.
1813
+ *
1814
+ * The host resolves reads for itself out of the client it was given, so it takes the query
1815
+ * client and the viewer that a headless consumer supplies through their own providers and their
1816
+ * own tool context. Who a write acts as is the session token's to say: the client's.
1817
+ */
1818
+ interface StudioHostDataConfig extends StudioDataConfig {
1819
+ /**
1820
+ * The organizations this reader may write to, for every scope picker in the studio. Omitted,
1821
+ * the studio writes to the reader's personal scope alone.
1822
+ *
1823
+ * It is also who may edit an itinerary. Stated, the editor offers an itinerary's edits only to
1824
+ * a reader whose `writable.writableOrgIds` holds the organization that owns it (or to the
1825
+ * author of a personal one), and the editing verbs refuse anyone else with `forbidden` before
1826
+ * a request. Omitted, no role is asked and the API decides.
1827
+ *
1828
+ * Pass a stable object: the studio's context is keyed on it, so one written inline renders
1829
+ * every surface again at each render of the host.
1830
+ */
1831
+ readonly organizations?: StudioOrganizations | undefined;
1832
+ /**
1833
+ * The query client every read beneath this host runs on.
1834
+ *
1835
+ * State it and the host mounts a `QueryClientProvider` for it; omit it and the host inherits
1836
+ * the one above; with neither, the host creates one per mount.
1837
+ *
1838
+ * Build it once per mount: one built in the render body is a new cache at each render of the
1839
+ * host, and every read starts over.
1840
+ */
1841
+ readonly queryClient?: QueryClient | undefined;
1842
+ /**
1843
+ * Where a committed write GOES. Unset, it is the Mountaya API through the client above.
1844
+ *
1845
+ * The counterpart to {@link viewer} and it sits beside it on purpose: one names who is reading
1846
+ * and the other where what they write lands. Set {@link localStudioPersistence} or
1847
+ * {@link memoryStudioPersistence} and the editor's verbs all work against a local session
1848
+ * instead of an organization's catalogue, while the reads (search, geocoding, points of
1849
+ * interest, directions and tiles) keep going to the real APIs through the same client. That is
1850
+ * what a demo, a docs example and a sandbox inside your own Embedded Studio each need.
1851
+ */
1852
+ readonly persistence?: StudioPersistence | undefined;
1853
+ /**
1854
+ * The product this host renders: `"studio-embedded"`, the Embedded Studio, where none is
1855
+ * stated, or `"embedding"`, Map Publishing's hosted embed served from Mountaya's own origin.
1856
+ *
1857
+ * An Embedded Studio runs on a session token minted for `studio-embedded`, and the host refuses
1858
+ * a token minted for any other surface, and a publishable key given none, with a
1859
+ * `MountayaConfigurationError` before the studio sends anything. A client carrying a share token,
1860
+ * or the browser's own session and no key, is taken whatever this states. The hosted embed is
1861
+ * read-only, and the API records it by the origin it is served from rather than by a session, so
1862
+ * the host does not read the token its client carries: a key with a session minted for any
1863
+ * surface is taken, and so is a key alone. It grants `embedding` and `share`
1864
+ * alone, the pair it grants where `capabilities` states nothing, and refuses `editor` or
1865
+ * `authenticated` beside it with a `MountayaConfigurationError`.
1866
+ *
1867
+ * Stated on a page of your own, it lifts the host's check and nothing else: the API records a
1868
+ * request by the session it carries and the origin it comes from, so what the studio asks there
1869
+ * under an `api` session is counted as your own clients' requests are, and a `studio-embedded`
1870
+ * operation still refuses that session.
1871
+ */
1872
+ readonly surface?: "embedding" | "studio-embedded" | undefined;
1873
+ /**
1874
+ * The person reading this studio: their id, their entitlements, and the units they read in.
1875
+ * Omitted, the studio runs for an anonymous reader on metric units who holds no entitlement,
1876
+ * which suits a public embed; an application binds its signed-in reader here, built with
1877
+ * `usePlatformViewer` from what Mountaya answers for each of their scopes.
1878
+ */
1879
+ readonly viewer?: StudioViewer | undefined;
1880
+ }
1881
+ /**
1882
+ * useAgentDriving reports whether an agent run drives the studio, so a control can render inert
1883
+ * for the duration.
1884
+ *
1885
+ * It is the one reading surface for that flag: every gated control calls this rather than
1886
+ * selecting the chrome slot itself, so its import list IS the inventory of what the lock covers.
1887
+ *
1888
+ * The flag is the shared-UI mirror of a run's state, written by whatever owns the run. That
1889
+ * indirection is the point: a surface outside the agent's own tree (a sidenav, a routed region,
1890
+ * a consumer's own chrome) reads the same lock the panel does without knowing where the run
1891
+ * lives.
1892
+ *
1893
+ * These stay live while it is true, because the lock is unusable otherwise: the run's own stop
1894
+ * control, the composer, and the entity the run handed back for the user to adjust and save.
1895
+ * Gate everything else.
1896
+ *
1897
+ * @returns `true` while an agent run drives the studio, `false` otherwise.
1898
+ */
1899
+ declare const useAgentDriving: () => boolean;
1900
+ /**
1901
+ * BeginSegmentEdit arms the geometry editor for one persisted segment of the open itinerary,
1902
+ * resolving everything the edit needs from the segment's id alone.
1903
+ *
1904
+ * It resolves to the dispatch's `ToolResult`, or to null when there is nothing to begin: no
1905
+ * itinerary is open, or the chain does not carry the id. A null answer means no dispatch
1906
+ * happened, so a caller that reports a refusal has nothing to report.
1907
+ */
1908
+ type BeginSegmentEdit = (segmentId: string) => Promise<ToolResult | null>;
1909
+ /**
1910
+ * useBeginSegmentEdit is the ONE assembler of the segment geometry edit's begin payload, so
1911
+ * every surface that opens an edit (a list row, a click on the segment's line on the map) arms
1912
+ * the engine with byte-identical arguments.
1913
+ *
1914
+ * Every part of the payload is a place two copies would drift: the engine follows the
1915
+ * segment's OWN stored mode rather than the activity's default, so a freehand segment inside a
1916
+ * directions-capable activity reshapes as freehand; the seed comes from the right geometry leaf
1917
+ * for that mode; and the start is pinned only off the head of the chain, because the first
1918
+ * segment has no predecessor to stay continuous with.
1919
+ *
1920
+ * Everything is read AT DISPATCH TIME rather than subscribed: the chain comes off the store
1921
+ * handle, not off a selector. Nothing here renders its caller again: a row that rendered on
1922
+ * every chain write would pay for state it only reads inside a callback, and a map handler
1923
+ * sharing this hook must not bind its listeners again when an unrelated peer frame lands.
1924
+ *
1925
+ * The bus stays the authority on whether the edit may open at all: this resolves the arguments
1926
+ * and dispatches, and the handler owns the one-edit-at-a-time and collaboration-lock refusals.
1927
+ * A caller surfaces the refusal it cares about by branching on the returned result.
1928
+ *
1929
+ * @param activitySlug - The router's profile for the itinerary's activity, the one thing this
1930
+ * hook cannot resolve. A directions edit routes under it, and without it the edit draws no
1931
+ * line. Which activity an itinerary belongs to, and what the router calls it, is the host's
1932
+ * catalog to answer: `activityForId` in `@mountaya/studio` is the lookup.
1933
+ * @returns The {@link BeginSegmentEdit} callback, stable while the store and the slug are.
1934
+ */
1935
+ declare const useBeginSegmentEdit: (activitySlug?: string) => BeginSegmentEdit;
1936
+ /**
1937
+ * One saved waypoint, named through the published view source rather than through the wire
1938
+ * alias: the contract for a waypoint lives in `@mountaya/client`, and this entry deliberately
1939
+ * does not publish a second spelling of it.
1940
+ */
1941
+ type SavedWaypoint = ItineraryViewSource["waypoints"][number];
1942
+ /**
1943
+ * BeginWaypointEdit arms the placement session that REPOSITIONS one saved waypoint: the next
1944
+ * click on the map moves the existing marker rather than dropping a fresh one.
1945
+ *
1946
+ * Resolves to the dispatch's `ToolResult`, so a caller that words a refusal has one to word.
1947
+ */
1948
+ type BeginWaypointEdit = (waypoint: SavedWaypoint) => Promise<ToolResult>;
1949
+ /**
1950
+ * useBeginWaypointEdit is the ONE assembler of the waypoint move session's begin payload, so
1951
+ * every surface that opens one (a row's body click, its "Move on map" item, a click on the
1952
+ * marker itself) arms the engine with byte-identical arguments.
1953
+ *
1954
+ * The session is seeded with the waypoint's CURRENT colour, icon, name and coordinate, so the
1955
+ * marker the user drags is the one they already have rather than a default that silently
1956
+ * recolours it on save. The payload carries no copy of the saved waypoint: the open itinerary
1957
+ * holds it while the edit is open, so a cancel has nothing to put back.
1958
+ *
1959
+ * The coordinate is read off the waypoint's own geometry rather than passed in, because a
1960
+ * caller holding the waypoint already holds it and a second parameter is a second thing to get
1961
+ * wrong. It is the geometry's first point, read by `extractPoint`: a waypoint arrives as a
1962
+ * collection of one point, and a bare point is read the same way. A waypoint whose geometry
1963
+ * carries no point, or one whose longitude and latitude are not two finite numbers, opens
1964
+ * unplaced, which is the honest state: the next click places it.
1965
+ *
1966
+ * The payload is assembled inside the promise, so a throw on the way to the dispatch is a
1967
+ * rejection the caller handles and never an error out of a click handler.
1968
+ *
1969
+ * @returns The {@link BeginWaypointEdit} callback, one function for the caller's life.
1970
+ */
1971
+ declare const useBeginWaypointEdit: () => BeginWaypointEdit;
1972
+ /**
1973
+ * useActiveItineraryResource resolves the open itinerary as the {@link CollabResource} handle
1974
+ * its collaboration surfaces scope by: the presence roster, the segment and waypoint awareness
1975
+ * badges, the peer-draft ghosts and the live-aware segment fold each read ONLY this resource's
1976
+ * peers, locks and drafts, so a concurrent zone session never bleeds into an itinerary surface.
1977
+ *
1978
+ * The handle is memoised on the itinerary id, so it is one stable object per open itinerary: a
1979
+ * selector or effect keyed on it never churns while the same itinerary stays open.
1980
+ *
1981
+ * @returns The open itinerary's handle, or null when no itinerary is open.
1982
+ */
1983
+ declare const useActiveItineraryResource: () => CollabResource | null;
1984
+ /**
1985
+ * useActiveZoneResource resolves the open zone as the {@link CollabResource} handle its
1986
+ * collaboration surfaces scope by: the zone panel's roster and lock badge and the zone
1987
+ * peer-draft ghost each read ONLY this resource's live picture, so a concurrent itinerary
1988
+ * session never bleeds into the zone panel. The handle is memoised on the zone id, the
1989
+ * zone-family twin of {@link useActiveItineraryResource}.
1990
+ *
1991
+ * @returns The open zone's handle, or null when no zone is open.
1992
+ */
1993
+ declare const useActiveZoneResource: () => CollabResource | null;
1994
+ /**
1995
+ * useActiveCollabResources is the single source of truth for the studio's OPEN editor set: the
1996
+ * {@link CollabResource} handles a collaboration surface folds across.
1997
+ *
1998
+ * It composes the two singular resource hooks into one array, the itinerary before the zone,
1999
+ * and is the seam a multi-editor UI extends: a surface that reconciles every open resource at
2000
+ * once iterates THIS list rather than naming the itinerary and the zone by hand. A studio opens
2001
+ * at most one itinerary and one zone, so the set holds neither, either or both. The array is
2002
+ * memoised on the two handles, each already stable, so a selector or effect keyed on it never
2003
+ * churns.
2004
+ */
2005
+ declare const useActiveCollabResources: () => readonly CollabResource[];
2006
+ /**
2007
+ * usePeerLockHolderId reports the id of the PEER holding one entity's soft-lock in the given
2008
+ * editor resource, or null when it is unheld.
2009
+ *
2010
+ * It is scoped by `resource` so an itinerary row reads only its itinerary session's locks and
2011
+ * a zone panel only its zone session's: a lock in a concurrently-open document never makes an
2012
+ * unrelated row inert. The collaboration session filters the local user's own locks out of
2013
+ * the store, so a present holder is always a PEER, which is why a row reads this to decide
2014
+ * whether to render itself inert without comparing against the local user.
2015
+ *
2016
+ * The narrow selector keys on THIS resource and entity's holder, so a lock elsewhere never
2017
+ * renders the row again; a null resource (no document open) or a null id (a draft or create
2018
+ * row with no server identity a peer could lock) is never locked.
2019
+ *
2020
+ * The holder is an ID rather than a name on purpose. Who that id belongs to is a directory
2021
+ * question (a member list, an organization, a display-name policy), and answering it here
2022
+ * would make this hook the second place a consumer's identity model has to be taught.
2023
+ */
2024
+ declare const usePeerLockHolderId: (resource: CollabResource | null, kind: CollabLockKind, id: string | null) => string | null;
2025
+ /**
2026
+ * useCollectionScope reads the active collection scope from the URL: the organization whose
2027
+ * folders the sidenav tree is showing, or undefined for the personal scope. The personal view
2028
+ * is the ABSENCE of the key, matching how the listing endpoints spell it. The scope lives in
2029
+ * the URL rather than in component state so it survives a reload and a link carries it.
2030
+ *
2031
+ * The tree that reads it and the surfaces that write into that tree share this one read, so a
2032
+ * collection created from the sidenav is created in the scope the reader is looking at rather
2033
+ * than silently in a different one.
2034
+ *
2035
+ * @returns The organization id of the scope, or undefined for the personal scope.
2036
+ */
2037
+ declare const useCollectionScope: () => string | undefined;
2038
+ /**
2039
+ * SegmentDraftSource is the one thing an open segment edit needs from whatever is drawing it:
2040
+ * the handles as they stand right now.
2041
+ *
2042
+ * A structural interface with a single method, the same technique the segment tools use for
2043
+ * their map surface. The draft lives on the canvas rather than in the store, because it changes
2044
+ * on every pointer move and a store write per frame is a render per frame; a Save reads it
2045
+ * once, at the moment it is pressed. The `MapClient` of `@mountaya/elements/map-client`
2046
+ * satisfies it by having the method.
2047
+ */
2048
+ interface SegmentDraftSource {
2049
+ /** The segment's handles as the drawing surface holds them now, or null where none is drawn. */
2050
+ readonly getSegmentDraft: () => Position[] | null;
2051
+ }
2052
+ /**
2053
+ * UseEditActionsOptions scope the save. `itineraryId` names the itinerary a commit saves to,
2054
+ * and the commit reads its own scope without it. `draftSource` is where a segment save reads
2055
+ * its handles; a waypoint save reads its draft from the store, so a surface that only authors
2056
+ * waypoints may omit it.
2057
+ */
2058
+ interface UseEditActionsOptions {
2059
+ /**
2060
+ * Runs before the commit is dispatched, and is awaited.
2061
+ *
2062
+ * The seam for anything a surface wants written ONTO the draft first (an auto-generated name,
2063
+ * a provenance tag), because it has to land before the commit reads it. The commit reads the
2064
+ * draft once this has resolved, for a segment as for a waypoint. It is a hook rather than
2065
+ * something this package does, since every such value is copy: a waypoint left unnamed wants
2066
+ * "Water #2", and both the word for the icon and how the number joins it are decisions a
2067
+ * translation runtime makes.
2068
+ */
2069
+ readonly beforeSave?: (() => Promise<void> | void) | undefined;
2070
+ /**
2071
+ * Where a segment save reads its handles. A surface that only authors waypoints omits it.
2072
+ *
2073
+ * @default null
2074
+ */
2075
+ readonly draftSource?: SegmentDraftSource | null | undefined;
2076
+ /**
2077
+ * The itinerary a commit saves to. Omitted or null, a commit saves to the itinerary open in
2078
+ * the editor, or to the staged draft that shows.
2079
+ *
2080
+ * @default null
2081
+ */
2082
+ readonly itineraryId?: string | null | undefined;
2083
+ }
2084
+ /**
2085
+ * EditActionsModel is the save surface for whichever authoring session is open.
2086
+ *
2087
+ * `family` is null when none is, which is what a footer branches on to render nothing. A
2088
+ * surface that renders a frame (a sticky bar, a divider) has to know BEFORE it draws one, which
2089
+ * is why this is a hook rather than only a component: an empty frame is chrome with nothing in
2090
+ * it.
2091
+ */
2092
+ interface EditActionsModel {
2093
+ /** Whether the open session may be committed: enough handles, or a placed coordinate. */
2094
+ readonly canSave: boolean;
2095
+ /** Which authoring session is open, or null when none is. */
2096
+ readonly family: "segment" | "waypoint" | null;
2097
+ /**
2098
+ * Commits the open session, and resolves to the answer of its family's commit verb, typed by
2099
+ * that verb.
2100
+ *
2101
+ * A commit that lands answers `data.closed`. It is false where the draft changed while the
2102
+ * save was out: the save landed and the session stays open on the change, to be saved again,
2103
+ * so a surface that reads it tells the reader the edit is still open. Resolves to null when no
2104
+ * session is open at the press, and when the session was left while `beforeSave` was awaited:
2105
+ * nothing is dispatched for a session that has gone, nor for one opened once it had, of
2106
+ * either family. A session is left by a store write in which its family's session reads null.
2107
+ * One swapped for another of its family in a single write, which no tool of the studio does,
2108
+ * is read as the adoption of its own and committed. A save commits the family it was pressed
2109
+ * for.
2110
+ */
2111
+ readonly save: () => Promise<ToolResultOf<StudioToolOutputs, "studio.itinerary.segment.editCommit" | "studio.itinerary.waypoint.editCommit"> | null>;
2112
+ }
2113
+ /**
2114
+ * useEditActions drives the Save for a segment geometry edit or a waypoint authoring session.
2115
+ *
2116
+ * Mutual exclusion is enforced at the tool layer, so at most one family is open at a time and
2117
+ * the surface reads as ONE control regardless of which. The two differ in three places, and
2118
+ * each is a place two copies would drift:
2119
+ *
2120
+ * - **the tool dispatched**: `studio.itinerary.<family>.editCommit`;
2121
+ * - **where the draft comes from**: a segment reads its handles off the drawing surface at
2122
+ * press time; a waypoint's draft is already in the store, so the bus reads it there;
2123
+ * - **the save-enabled predicate**: a waypoint Save waits for a coordinate to land, a segment
2124
+ * Save for the draft to hold at least {@link SEGMENT_MIN_VIAS} handles.
2125
+ *
2126
+ * That last one is read as a BOOLEAN rather than a count, on purpose: the draft is written on
2127
+ * every interactive change, so subscribing to the number renders the footer on every pointer
2128
+ * move, while subscribing to whether it crosses the floor renders it on the single crossing.
2129
+ * Before the first change the draft is null, so an edit opened with its handles seeded reads
2130
+ * the seed count instead, already valid at two.
2131
+ *
2132
+ * The bus enforces the same floor on commit, so the render-time disable and the commit-side
2133
+ * guard agree rather than one of them being decorative.
2134
+ *
2135
+ * **This hook names nothing it saves.** A from-scratch waypoint left unnamed wants an
2136
+ * occurrence-aware label ("Water #2"), and both the word for the icon and the way the number
2137
+ * is joined to it are copy. A surface that wants one writes the name in `beforeSave`.
2138
+ *
2139
+ * @param options - The scope of the save and the source of a segment's draft; see
2140
+ * {@link UseEditActionsOptions}.
2141
+ * @returns The {@link EditActionsModel} of the open session.
2142
+ */
2143
+ declare const useEditActions: ({ beforeSave, draftSource, itineraryId }?: UseEditActionsOptions) => EditActionsModel;
2144
+ /**
2145
+ * useEscapeKey runs `handler` whenever the Escape key is pressed, for as long as `enabled` is
2146
+ * true.
2147
+ *
2148
+ * The listener sits on `window`, not a focused element, so the key reaches the handler even when
2149
+ * focus is captured by the map canvas, a panorama, or a text input: Escape is treated as a global
2150
+ * dismiss, never swallowed by a typing context (the reason this hook does not use Mantine's
2151
+ * `useHotkeys`, which ignores input and textarea focus). An Escape pressed inside an input
2152
+ * method's composition is the one exception: it cancels the composition and runs no handler.
2153
+ *
2154
+ * The latest `handler` is read through a ref, so a caller need not memoize it, while the listener
2155
+ * attaches once and detaches on unmount or when `enabled` flips false.
2156
+ *
2157
+ * @param handler - Runs with the keydown event, so it can `preventDefault`.
2158
+ * @param enabled - Whether the listener is attached.
2159
+ */
2160
+ declare const useEscapeKey: (handler: (event: KeyboardEvent) => void, enabled?: boolean) => void;
2161
+ /**
2162
+ * UseInlineRenameOptions describe the one thing being renamed and what to do when the user
2163
+ * commits: `name` is the current value (the field opens on it and cancel returns to it), and
2164
+ * `onCommit` is called ONLY with a name that is non-empty and actually different.
2165
+ *
2166
+ * `locked` discards an open rename the moment it becomes true, and opens none while it holds. A
2167
+ * collaborator's lock can land while a field is open, and whoever holds the lock owns the
2168
+ * entity now, so the local edit must not persist. Without it the open field commits against
2169
+ * something the user no longer owns, which reads as their own edit being lost rather than as a
2170
+ * lock arriving. A reader who may not rename the entity at all is the same case held for good.
2171
+ */
2172
+ interface UseInlineRenameOptions {
2173
+ /**
2174
+ * Whether the rename is withheld, as a collaborator's lock or a reader who may not edit the
2175
+ * entity withholds it: true discards an open rename at once and opens none.
2176
+ */
2177
+ readonly locked?: boolean | undefined;
2178
+ /** The current name: the field opens on it and a cancel returns to it. */
2179
+ readonly name: string;
2180
+ /** Called with the trimmed name, only when it is non-empty and differs from `name`. */
2181
+ readonly onCommit: (name: string) => void;
2182
+ /**
2183
+ * Decides whether a trimmed name may be committed. A `false` HOLDS THE FIELD OPEN rather
2184
+ * than closing it, which is the difference that makes this worth a seam.
2185
+ *
2186
+ * Without it a caller has two moves, and both are wrong. Validating inside `onCommit` happens
2187
+ * after the field has already closed, so the user watches their name vanish and the old one
2188
+ * come back with nothing said. Validating before calling `commit` means reproducing the
2189
+ * Enter/blur/Escape wiring at the call site to intercept one of them, which is the whole hook,
2190
+ * written again.
2191
+ *
2192
+ * A rejected name leaves `value` and `editing` untouched, so the field keeps what the user
2193
+ * typed and a caller can show the reason beside it.
2194
+ *
2195
+ * @default Accepts anything non-empty and different from `name`.
2196
+ */
2197
+ readonly validate?: ((name: string) => boolean) | undefined;
2198
+ }
2199
+ /**
2200
+ * InlineRename is the whole state machine, in the shape a text input and its row need it.
2201
+ *
2202
+ * `inputProps` spreads onto the field; `editing` and `value` drive what the row renders. A
2203
+ * consumer whose input is not a DOM `<input>` reads `commit`, `cancel` and `setValue`
2204
+ * directly: the handlers are the convenience, not the contract.
2205
+ */
2206
+ interface InlineRename {
2207
+ /** Closes the field and puts the current name back. */
2208
+ readonly cancel: () => void;
2209
+ /** Commits the typed name, by the rules {@link UseInlineRenameOptions} states. */
2210
+ readonly commit: () => void;
2211
+ /** Whether the field is open. */
2212
+ readonly editing: boolean;
2213
+ /** The handlers and the value to spread onto a DOM `<input>`. */
2214
+ readonly inputProps: {
2215
+ /** Cancels, unless the blur follows the commit that closed the field. */
2216
+ readonly onBlur: () => void;
2217
+ /** Takes what the reader typed. */
2218
+ readonly onChange: (event: {
2219
+ readonly currentTarget: {
2220
+ readonly value: string;
2221
+ };
2222
+ }) => void;
2223
+ /** Commits on Enter and cancels on Escape, outside an input method's composition. */
2224
+ readonly onKeyDown: (event: KeyboardEvent$1<HTMLInputElement>) => void;
2225
+ /** What the field shows. */
2226
+ readonly value: string;
2227
+ };
2228
+ /** Replaces what the field holds, for an input that is not a DOM `<input>`. */
2229
+ readonly setValue: (value: string) => void;
2230
+ /**
2231
+ * start opens the field on the current name, and does nothing while the rename is `locked`. A
2232
+ * row whose single click does something else cancels that action itself, as
2233
+ * `useSegmentRow`'s `startRename` does.
2234
+ */
2235
+ readonly start: () => void;
2236
+ /** What the field holds: the text as typed while it is open. */
2237
+ readonly value: string;
2238
+ }
2239
+ /**
2240
+ * useInlineRename is rename-in-place: open on a name, commit on Enter, cancel on Escape or blur.
2241
+ * An Enter or an Escape pressed inside an input method's composition confirms or cancels the
2242
+ * composition and does neither.
2243
+ *
2244
+ * Three details are the whole reason this is a hook rather than four `useState` calls at a call
2245
+ * site, and each of them is a bug the obvious version has:
2246
+ *
2247
+ * - **Enter commits, and the blur it causes must not then cancel.** Committing exits edit mode,
2248
+ * which blurs the input, which fires the cancel path, undoing the commit that just ran. A
2249
+ * latch set by commit and cleared by the next blur is what keeps the two from fighting. The
2250
+ * next `start` clears it too, since a commit is not always followed by a blur.
2251
+ * - **Blur cancels rather than commits.** Clicking away from a half-typed name is an abandon,
2252
+ * not a submit; a field that saved on blur turns every stray click into a rename.
2253
+ * - **An empty or unchanged name commits nothing.** Trimming to empty is how a user clears the
2254
+ * field before pressing Escape, and persisting "" would leave an unnamed entity behind.
2255
+ *
2256
+ * A row that begins an edit on single click and renames on double click also has to cancel the
2257
+ * first action when the second arrives; that half is {@link useDeferredClick}, below, because it
2258
+ * is a gesture rather than a rename and a consumer may want one without the other.
2259
+ *
2260
+ * @param options - The name, the commit and the guards; see {@link UseInlineRenameOptions}.
2261
+ * @returns The {@link InlineRename} state machine, a new object only when `editing` or `value`
2262
+ * changes.
2263
+ */
2264
+ declare const useInlineRename: ({ locked, name, onCommit, validate }: UseInlineRenameOptions) => InlineRename;
2265
+ /**
2266
+ * DeferredClick is a single-click action a double-click cancels.
2267
+ *
2268
+ * A row that opens an editor on one click and renames on two has to hold the first action back
2269
+ * long enough for the second to arrive. `schedule` arms it, `cancel` drops it, and the timer is
2270
+ * cleared on unmount so a row removed mid-gesture cannot fire into a component that is gone.
2271
+ */
2272
+ interface DeferredClick {
2273
+ /** Drops the action a single click scheduled, if it has not run. */
2274
+ readonly cancel: () => void;
2275
+ /**
2276
+ * Arms `action` to run once the double-click window has passed, replacing any action still
2277
+ * pending. `delayMs` defaults to the studio's double-click window.
2278
+ */
2279
+ readonly schedule: (action: () => void, delayMs?: number) => void;
2280
+ }
2281
+ /**
2282
+ * useDeferredClick defers a single-click action so a double-click can cancel it.
2283
+ *
2284
+ * Kept beside `useInlineRename` because the two are one gesture: without the defer, the first
2285
+ * click of a rename also opens whatever the single click does, and the user gets both.
2286
+ */
2287
+ declare const useDeferredClick: () => DeferredClick;
2288
+ /**
2289
+ * useLiveAwareSegments overlays the in-flight segment edit onto a persisted segment chain so
2290
+ * the header totals, the segment rows and the elevation chart all read the same live-edit
2291
+ * metrics.
2292
+ *
2293
+ * While a segment edit is open the session's liveSegment carries the latest routed distance
2294
+ * and ascent (and the rest of the elevation summary); this hook swaps it in for the persisted
2295
+ * entry with the same id, or places it among them when no persisted entry exists yet: at the
2296
+ * tail for a from-scratch create, and in the gap it is bound for when the session carries an
2297
+ * insert anchor, so a segment being inserted is drawn where it will land rather than jumping
2298
+ * into position once the server renumbers the chain.
2299
+ *
2300
+ * When NO local edit is open it also folds in collaborators' live segment drafts: a peer
2301
+ * reshaping a segment of the open itinerary morphs the profile the same way a local edit does,
2302
+ * keyed by id onto the matching persisted segment. The LOCAL live segment always wins: while a
2303
+ * local edit session is active the peer drafts step aside entirely (the local preview owns the
2304
+ * elevation sink, the same contention rule the map ghost obeys), so a local edit is never
2305
+ * fought by a peer's substitution. Outside any edit AND with no peer draft, the passed chain
2306
+ * flows back by reference, so a memoised consumer sees no change.
2307
+ *
2308
+ * Each read is its own narrow subscription rather than one object selector. Each returns a
2309
+ * slot (a primitive or a stored reference), so none of them can allocate, which is the one way
2310
+ * a store selector goes wrong: React refuses a snapshot that never settles.
2311
+ *
2312
+ * @param segments - The persisted chain, as the open itinerary holds it.
2313
+ * @returns The chain with the live edit or the peers' drafts folded in, or `segments` itself
2314
+ * when there is nothing to fold.
2315
+ */
2316
+ declare const useLiveAwareSegments: (segments: ItineraryViewSource["segments"]) => ItineraryViewSource["segments"];
2317
+ /**
2318
+ * MapHoveredRow is what a list row needs to answer the map's pointer: whether the feature this
2319
+ * row stands for is the one under the cursor, and the ref to hang on the row element so it can
2320
+ * be brought into view when it is.
2321
+ */
2322
+ interface MapHoveredRow<TElement extends HTMLElement = HTMLDivElement> {
2323
+ /** Whether the pointer is over this row's feature on the map. */
2324
+ readonly hovered: boolean;
2325
+ /** The ref to hang on the row element, which is scrolled into view as its feature lights. */
2326
+ readonly rowRef: RefObject<TElement | null>;
2327
+ }
2328
+ /**
2329
+ * useMapHoveredRow tells one editor row whether the pointer is over ITS feature on the map, and
2330
+ * scrolls it into view when it becomes so. It is the receiving half of the map→list hover: the
2331
+ * map records which segment or waypoint the pointer entered, and each row reads only whether
2332
+ * that record names it.
2333
+ *
2334
+ * The selector is a BOOLEAN rather than the hovered entity. A long itinerary renders one row
2335
+ * per segment and per waypoint, and every one of them subscribes: reading the object would
2336
+ * render the whole list again on every pointer enter and leave, while reading "is it me"
2337
+ * renders the two rows whose answer changed, the one lighting up and the one going dark.
2338
+ *
2339
+ * Scrolling is scoped to the false→true edge and uses `block: "nearest"`, so a row already on
2340
+ * screen is never moved. Without it the feature is only followed for the rows that happen to be
2341
+ * visible, which on a long itinerary is most of them missing. `scrollIntoView` is called
2342
+ * optionally because it is a layout API a headless test environment does not implement, and a
2343
+ * hover echo is not worth a thrown render.
2344
+ *
2345
+ * The smooth scroll is an ANIMATION the pointer triggers, and it fires repeatedly as the cursor
2346
+ * crosses an itinerary, so it honours the viewer's reduced-motion setting: with motion off the row
2347
+ * is still brought into view, it simply arrives at once.
2348
+ *
2349
+ * A ref and a scroll are not rendering: this hook decides nothing about markup, and the element
2350
+ * it scrolls is whichever one the consumer chose to hang the ref on. It is generic over that
2351
+ * element (`HTMLDivElement` unless stated), so a consumer wiring their own markup off the
2352
+ * headless entry hangs it on a `<div>`, an `<li>`, an `<article>` or anything else: the ref is
2353
+ * read once per hover edge, for `scrollIntoView`, which every element has.
2354
+ *
2355
+ * @param kind - Whether the row stands for a segment or a waypoint.
2356
+ * @param id - The id of the entity the row stands for.
2357
+ * @returns Whether the row's feature is hovered, and the ref to hang on the row.
2358
+ */
2359
+ declare const useMapHoveredRow: <TElement extends HTMLElement = HTMLDivElement>(kind: ItinerarySelection["kind"], id: string) => MapHoveredRow<TElement>;
2360
+ /** UsePlatformViewerOptions is what {@link usePlatformViewer} reads. */
2361
+ interface UsePlatformViewerOptions {
2362
+ /**
2363
+ * The client the memberships are read with. It reads the memberships of the user its session
2364
+ * token was minted for, who is the person `viewer` names: a publishable key beside a session
2365
+ * token your server minted with that person's `user_id`. A session minted without `user_id`
2366
+ * reads none, and the viewer holds nothing.
2367
+ *
2368
+ * Omitted, the client of the `MountayaProvider` above.
2369
+ */
2370
+ readonly client?: Mountaya | undefined;
2371
+ /**
2372
+ * Whether an id names the reader's own space rather than an organization, for a host that
2373
+ * spells its personal space with an organization id: the `isPersonalScope` of the roster it
2374
+ * hands `MountayaStudioHost`. Read when the viewer is asked, so a predicate written inline is
2375
+ * the same viewer at every render. Its answer for an id holds for the mount, or moves only in a
2376
+ * render that also changes `organizationId`, `personalSpace` or the memberships: nothing
2377
+ * subscribes to the predicate, so a change of its answer alone reaches a surface only when
2378
+ * something else renders it.
2379
+ *
2380
+ * @default Only an absent id, as `defaultStudioScope` of `@mountaya/studio` reads one.
2381
+ */
2382
+ readonly isPersonalScope?: ((organizationId: string | null | undefined) => boolean) | undefined;
2383
+ /**
2384
+ * The scope in view: the organization the studio is showing, or `null` for the reader's own
2385
+ * space. A change tells the studio's surfaces once the render that states it commits.
2386
+ *
2387
+ * It is the `organization_id` the studio's URL names, kept equal to it by the host: the viewer
2388
+ * answers what the person holds in this scope, and the studio's surfaces read the URL's scope
2389
+ * for everything else, so a studio showing one organization under a viewer answering for
2390
+ * another offers what neither scope holds.
2391
+ */
2392
+ readonly organizationId: string | null;
2393
+ /**
2394
+ * The answer for the reader's own space, which no operation of the public contract returns, or
2395
+ * `undefined` while the host has none. Left out, the personal space holds no feature and states
2396
+ * no ceiling, which is the reading for a publishable key: it never reaches the personal space.
2397
+ *
2398
+ * A value, as the host's read holds it: an answer written inline, or rebuilt at every render,
2399
+ * is the same answer while it states the same ceiling and the same features, and the studio's
2400
+ * surfaces are told once the render that changes it commits.
2401
+ */
2402
+ readonly personalSpace?: PlatformScopeAnswer | undefined;
2403
+ /**
2404
+ * The query cache the memberships are read on: the one handed to `MountayaStudioHost` as
2405
+ * `data.queryClient`, so the studio and its viewer read one cache.
2406
+ *
2407
+ * Omitted, the cache of the `QueryClientProvider` above.
2408
+ */
2409
+ readonly queryClient?: QueryClient | undefined;
2410
+ /**
2411
+ * The rest of the viewer, which the host answers itself: who the person is (the user the
2412
+ * session token was minted for, whose memberships are read), the units they read in, where a preference is kept, and the
2413
+ * subscription that tells their changes. `createMemoryViewer` of `@mountaya/studio` answers it
2414
+ * for a host that keeps preferences nowhere.
2415
+ *
2416
+ * Held by its members, like `data.viewer` on `MountayaStudioHost`.
2417
+ */
2418
+ readonly viewer: Pick<StudioViewer, "getPreferences" | "getUserId" | "setPreferences" | "subscribe">;
2419
+ }
2420
+ /**
2421
+ * PlatformViewerState is what {@link usePlatformViewer} answers: the viewer, and where the read it
2422
+ * is built from stands.
2423
+ *
2424
+ * The viewer alone cannot say why it holds nothing. A read still in flight, a key whose
2425
+ * organization or scope does not reach the studio, and a server that failed all leave it holding
2426
+ * nothing, as an agreement that covers nothing does, so a host that tells its reader why reads
2427
+ * `status` and `error` rather than the viewer.
2428
+ */
2429
+ interface PlatformViewerState {
2430
+ /**
2431
+ * The read's last failure, as the client raised it: a 402 for an organization that does not hold
2432
+ * Embedded Studio, a 403 for a key without the `studio-embedded` scope, a 5xx where the API
2433
+ * failed. Null while nothing has failed.
2434
+ */
2435
+ readonly error: MountayaError | null;
2436
+ /**
2437
+ * Where the memberships read stands:
2438
+ *
2439
+ * - `"pending"`: no answer has landed yet, or nobody is signed in; the viewer holds nothing.
2440
+ * - `"error"`: the read failed, and `error` says how; the viewer holds the last answer that
2441
+ * landed for this person, or nothing.
2442
+ * - `"success"`: the answer landed, and the viewer holds exactly what it lists.
2443
+ */
2444
+ readonly status: "error" | "pending" | "success";
2445
+ /**
2446
+ * The viewer to hand `MountayaStudioHost` as `data.viewer`. It keeps its identity while
2447
+ * `UsePlatformViewerOptions.viewer` states the same members, so the studio's context is built
2448
+ * once and its surfaces are told of each change through `subscribe`.
2449
+ */
2450
+ readonly viewer: StudioViewer;
2451
+ }
2452
+ /**
2453
+ * usePlatformViewer is the viewer of a person whose memberships the client reads, ready for
2454
+ * `data.viewer` on `MountayaStudioHost`: what they may use of the studio, and how many
2455
+ * itineraries they may keep, as Mountaya answers it for each scope, with where the read stands.
2456
+ *
2457
+ * It reads `users.getMyOrganizations` of `MountayaAdmin`, the memberships of the user the session
2458
+ * token was minted for, while `viewer.getUserId()` names a person, and builds the viewer with
2459
+ * `createPlatformViewer` of `@mountaya/studio`, which decides none of it: a feature is held
2460
+ * exactly where the membership of the scope in view lists it in `studio_entitlements`. A
2461
+ * membership states no itinerary ceiling: the personal space's answer states one. A publishable
2462
+ * key carrying the `studio-embedded` scope reads the one membership the session's user holds in
2463
+ * the key's organization, so a licensee's studio shows what its agreement covers, narrowed by the
2464
+ * organization's safety rules as what the key is served is: `profile-insights` only where
2465
+ * `with_profile_analysis` is set, `map-pois` only where the overlay allowlist (`with_overlays`)
2466
+ * admits the points of interest, and `map-overlays` only where it admits another overlay. A
2467
+ * licensee whose studio draws no overlays checks those rules, not its agreement.
2468
+ *
2469
+ * Until the read lands, while nobody is signed in or the session is minted without `user_id`, and
2470
+ * where it is refused, the viewer holds no entitlement and states no ceiling, and its surfaces are
2471
+ * told when the answer arrives. Those states read alike on the viewer and apart on `status` and
2472
+ * `error`: a key refused with a 402 or a 403 is a configuration to fix, not an agreement that
2473
+ * covers nothing. The answer shows or withholds what the studio offers and authorizes nothing:
2474
+ * every request is still refused by its own rule.
2475
+ *
2476
+ * Every page of the memberships is read, so a person holding more than one page of them holds
2477
+ * them all. The read's entry is under the operation's key of `mountayaKeys` of
2478
+ * `@mountaya/client-react` (`mountayaKeys.operation(scope, "rest", "getMyOrganizations")`), so a
2479
+ * host that changes what a person holds, by accepting an invitation, invalidates that key and the
2480
+ * viewer follows. The client repeats a read refused for the quota or by a failing gateway itself,
2481
+ * and the hook repeats nothing on top of it: a 500 is reported as the read's `error`.
2482
+ *
2483
+ * @param options - The client, the query cache, the scope in view, the personal space's answer
2484
+ * and the rest of the viewer.
2485
+ * @returns The viewer to hand `MountayaStudioHost` as `data.viewer`, and the read's status and
2486
+ * error.
2487
+ * @throws {MountayaElementsError} While rendering, with no `client` and no `MountayaProvider`
2488
+ * above, or with no `queryClient` and no `QueryClientProvider` above.
2489
+ * @example
2490
+ * ```tsx
2491
+ * import { QueryClient } from "@tanstack/react-query";
2492
+ * import { useState } from "react";
2493
+ *
2494
+ * import { Mountaya } from "@mountaya/client/browser";
2495
+ * import { createMemoryViewer } from "@mountaya/studio";
2496
+ * import { MountayaStudio, MountayaStudioHost, usePlatformViewer } from "@mountaya/studio-react";
2497
+ *
2498
+ * const ORGANIZATION_ID = "org_…";
2499
+ * const USER_ID = "user_…";
2500
+ *
2501
+ * // A token your server minted with postSession, its user_id set to USER_ID.
2502
+ * declare const sessionToken: string;
2503
+ *
2504
+ * const mountaya = new Mountaya({ credential: { publishableKey: "pk_…", sessionToken } });
2505
+ *
2506
+ * export const Studio = () => {
2507
+ * const [queryClient] = useState(() => new QueryClient());
2508
+ * const [person] = useState(() => createMemoryViewer({}, { getUserId: () => USER_ID }));
2509
+ * const { error, viewer } = usePlatformViewer({
2510
+ * client: mountaya,
2511
+ * organizationId: ORGANIZATION_ID,
2512
+ * queryClient,
2513
+ * viewer: person,
2514
+ * });
2515
+ *
2516
+ * return (
2517
+ * <>
2518
+ * {error === null ? null : (
2519
+ * <p role="alert">The studio cannot read what you may use: {error.message}</p>
2520
+ * )}
2521
+ * <MountayaStudioHost client={mountaya} data={{ queryClient, viewer }}>
2522
+ * <MountayaStudio />
2523
+ * </MountayaStudioHost>
2524
+ * </>
2525
+ * );
2526
+ * };
2527
+ * ```
2528
+ */
2529
+ declare const usePlatformViewer: ({ client, isPersonalScope, organizationId, personalSpace, queryClient, viewer }: UsePlatformViewerOptions) => PlatformViewerState;
2530
+ /**
2531
+ * StudioPluginItem is one contribution, ready to draw: what it is, whether it is dimmed, and how
2532
+ * to run it.
2533
+ *
2534
+ * `run` is bound to the live tool context and reads the target at CLICK time rather than at
2535
+ * render time, which is both more correct and what keeps the returned array stable across a
2536
+ * target rebuilt as a fresh literal every render.
2537
+ */
2538
+ interface StudioPluginItem<TSlot extends StudioPluginSlot> {
2539
+ /**
2540
+ * True while an agent run drives the studio.
2541
+ *
2542
+ * The lock DIMS rather than hides, which is the two-state posture this package already keeps:
2543
+ * a capability, entitlement or predicate refusal hides (as the video-export item does, because
2544
+ * a viewer who cannot have it should not be told about it), and a run in progress dims with a
2545
+ * reason (as every row-level control does, because it is coming back in a moment).
2546
+ */
2547
+ readonly disabled: boolean;
2548
+ /** The contribution as the registry holds it: what it draws, its plugin and its rank. */
2549
+ readonly entry: StudioSlotEntry<TSlot, ReactNode>;
2550
+ /**
2551
+ * What the action says, resolved: never empty.
2552
+ *
2553
+ * `entry.label` is optional in the CONTRACT, because the component form owes no label, while
2554
+ * validation refuses the action form at install without a non-empty label. Resolved once here
2555
+ * rather than at each render site, so no renderer keeps a fallback of its own (a fallback of
2556
+ * `""` gives a control-rail chip an empty accessible name). The qualified id is the
2557
+ * unreachable case's answer, because a name that identifies the plugin beats a name that is
2558
+ * not there.
2559
+ */
2560
+ readonly label: string;
2561
+ /** Runs the contribution's verb. Never throws; a failure reaches the host's `onError`. */
2562
+ readonly run: () => void;
2563
+ }
2564
+ /**
2565
+ * usePluginSlot reads what is installed in one slot, gated and ordered, ready to render.
2566
+ *
2567
+ * **It is INERT outside a host and never throws**: the opposite of `useStudioPlugins`, and for
2568
+ * the opposite reason. A menu still has to render inside a story, a snapshot test or a surface a
2569
+ * consumer mounted on its own, and a dropdown that throws because nobody installed a plugin
2570
+ * would make this feature a cost every consumer pays.
2571
+ *
2572
+ * Its snapshot is read off the SLOT'S ARRAY and not off the registry's version, and that is the
2573
+ * line that decides what an install costs. The registry rebuilds only the slots a plugin
2574
+ * touched, so `at('map.controls')` is referentially identical across the install of a
2575
+ * `segment.menu` plugin, and a snapshot that reads it lets React skip the render entirely for
2576
+ * every untouched slot. Reading the scalar instead would render again and rebuild the item
2577
+ * array in EVERY `usePluginSlot` in the tree on any change: one per segment row, one per
2578
+ * waypoint row, plus the fixed sites.
2579
+ *
2580
+ * **The gates are asked live.** A contribution's gate reads the tool context, whose identity
2581
+ * holds while what it answers moves: a viewer's entitlement arrives after the mount, and a
2582
+ * plugin's `when` reads the store. So the gates are asked on every render of the surface, and
2583
+ * again whenever the registry, the store or the viewer says it changed. The surface renders for
2584
+ * it only when the set of contributions that pass is another set: the answer is compared entry
2585
+ * by entry, and the array a caller memoizes on is the one it held while the entries stand. A
2586
+ * gate is therefore cheap by contract, as the plugin's own documentation of `when` states.
2587
+ *
2588
+ * Everything else the memo depends on is stable by construction: the registry, the tool context
2589
+ * and the slot do not move, the reporter is one function for the life of the host, and the
2590
+ * target is absent from the list on purpose.
2591
+ *
2592
+ * `target` is read through a latest-ref for that last reason. It is the one thing that cannot
2593
+ * come from context (which segment, which coordinate is a per-instance fact), and it is also
2594
+ * the thing a call site most naturally rebuilds inline. Depending on its identity would re-run
2595
+ * this memo on every render of every row.
2596
+ *
2597
+ * **A NULL target draws nothing**, which is the same answer a null context gets and for the same
2598
+ * reason: a contribution acts ON something, and a surface that cannot say what has nothing it can
2599
+ * honestly render. It is what a component takes when the seam is optional (a menu published for
2600
+ * a consumer to mount directly, where the studio's own row supplies a target and a bare mount
2601
+ * does not), and it is cheaper than a sentinel, which would run every gate and bind every
2602
+ * closure against a target nobody was going to act on.
2603
+ *
2604
+ * @param slot - The slot to read, as a plugin names it.
2605
+ * @param target - What the contributions act on, or null to draw nothing.
2606
+ * @returns The contributions that pass their gates, in order, one array while they stand.
2607
+ */
2608
+ declare const usePluginSlot: <TSlot extends StudioPluginSlot>(slot: TSlot, target: StudioPluginTarget<TSlot> | null) => readonly StudioPluginItem<TSlot>[];
2609
+ /** UseSegmentRowActionsOptions name the itinerary and the segment a row's verbs act on. */
2610
+ interface UseSegmentRowActionsOptions {
2611
+ /**
2612
+ * The itinerary the mutation is scoped to.
2613
+ *
2614
+ * Empty for a row backed by an unsaved draft: a draft sink keys on the segment's own client
2615
+ * id and has no itinerary to scope to yet.
2616
+ */
2617
+ readonly itineraryId: string;
2618
+ /** The segment the verbs act on. */
2619
+ readonly segmentId: string;
2620
+ }
2621
+ /**
2622
+ * SegmentRowActions are one segment row's verbs, each bound to the row's itinerary and segment,
2623
+ * and the last refusal they answered.
2624
+ *
2625
+ * `merge` takes the id of the segment folded into its successor, so a row merges with the
2626
+ * next segment under its own id and with the previous one under that segment's. `splitPick`
2627
+ * arms the pick on the map, and the split itself is reported where the pick resolves.
2628
+ * `exportSegment` and `toggleImportMode` open a surface and report nothing.
2629
+ */
2630
+ interface SegmentRowActions {
2631
+ /** Opens the export dialog scoped to this segment. */
2632
+ readonly exportSegment: () => void;
2633
+ /** Folds `segmentId` into its successor: this row's id merges with the next segment. */
2634
+ readonly merge: (segmentId: string) => Promise<void>;
2635
+ /**
2636
+ * The last refusal, naming the verb it came from, or null.
2637
+ *
2638
+ * Returned rather than raised, because where a refusal belongs on screen is a rendering
2639
+ * decision: an inline row error, a toast, an alert bar over the map. Every verb that reaches
2640
+ * the bus sets it: a server refuses a reshape for a reason the user has to see (a line the
2641
+ * router cannot follow, a merge across two engines, a cut too close to an end), and a rename,
2642
+ * a recolour or a speed for one they have to see as well (a write the API refused, a
2643
+ * collaborator's lock, a staged draft's save in flight), and a row menu closes on click with no
2644
+ * slot left to hold it.
2645
+ *
2646
+ * It carries the VERB and not only the result, because a caller cannot say anything useful
2647
+ * about a refusal without knowing what was refused: "Couldn't delete this segment" and
2648
+ * "Couldn't merge these segments" are different sentences, and a result alone leaves a
2649
+ * consumer matching on the server's message to tell them apart.
2650
+ *
2651
+ * A success clears it. A withheld confirmation ({@link isConfirmationWithheld}) is never kept:
2652
+ * it clears the field as a success does, since the verb never ran. A prompt the user declined
2653
+ * or let expire is their decision, not a refusal, and a context with no `confirm` seam, which
2654
+ * asks nobody, answers `confirmation-denied` and is read the same way.
2655
+ */
2656
+ readonly lastFailure: SegmentRowFailure | null;
2657
+ /** Recolours the segment. */
2658
+ readonly recolor: (color: string) => Promise<void>;
2659
+ /** Deletes the segment, once the reader confirms. */
2660
+ readonly remove: () => Promise<void>;
2661
+ /** Renames the segment. */
2662
+ readonly rename: (name: string) => Promise<void>;
2663
+ /** Changes the engine the segment is drawn with. */
2664
+ readonly setMode: (mode: SegmentEditMode) => Promise<void>;
2665
+ /** Sets the segment's speed in km/h, or null for the activity's default. */
2666
+ readonly setSpeed: (speed: number | null) => Promise<void>;
2667
+ /** Arms the pick on the map where the segment is split. */
2668
+ readonly splitPick: () => Promise<void>;
2669
+ /** Toggles a proposed segment between its routed and its freehand candidate. */
2670
+ readonly toggleImportMode: () => void;
2671
+ }
2672
+ /**
2673
+ * SegmentRowVerb names the verbs whose refusal a segment row hands its caller.
2674
+ *
2675
+ * A closed union rather than a string, so a consumer's switch over it is exhaustive: adding a
2676
+ * refusable verb here fails every caller that maps one to a sentence, which is exactly the
2677
+ * place a new verb needs to be noticed.
2678
+ *
2679
+ * `insert` and `editBegin` are not dispatched by {@link useSegmentRowActions}: the first is
2680
+ * raised by the row's chain menu and the second by the row opening its geometry editor, and the
2681
+ * one-edit-at-a-time gate refuses either while another session is armed, since an insert opens
2682
+ * its draw as an edit. Both belong in the same union because a caller maps
2683
+ * every refusal to a sentence in ONE place, and splitting the vocabulary by which hook happened
2684
+ * to raise it would make that caller ask a question it does not care about.
2685
+ *
2686
+ * `groupOpen`, `groupDelete` and `groupSetRange` are the list's group verbs, which
2687
+ * `useSegmentList` hands its `onFailure`: the group form opened on a group or seeded for a
2688
+ * segment (`studio.itinerary.group.modal.open`), a group dissolved
2689
+ * (`studio.itinerary.group.delete`) and a group's membership replaced
2690
+ * (`studio.itinerary.group.setRange`). Each is refused over a staged draft, and the last two
2691
+ * while a collaborator holds the group.
2692
+ */
2693
+ type SegmentRowVerb = "editBegin" | "groupDelete" | "groupOpen" | "groupSetRange" | "insert" | "merge" | "recolor" | "remove" | "rename" | "setMode" | "setSpeed" | "splitPick";
2694
+ /** A refusal, and the verb it came from. */
2695
+ interface SegmentRowFailure {
2696
+ /** The refusal the bus answered. */
2697
+ readonly result: ToolResult;
2698
+ /** The verb that was refused. */
2699
+ readonly verb: SegmentRowVerb;
2700
+ }
2701
+ /**
2702
+ * useSegmentRowActions binds one segment row's verbs to the studio's bus, each dispatched with
2703
+ * the itinerary and segment the row is scoped to.
2704
+ *
2705
+ * Every verb but the export and the import toggle, which open a surface, keeps its last refusal
2706
+ * as `lastFailure`, and a success or a withheld confirmation clears it;
2707
+ * {@link SegmentRowActions.lastFailure} says which refusals are kept.
2708
+ */
2709
+ declare const useSegmentRowActions: ({ itineraryId, segmentId }: UseSegmentRowActionsOptions) => SegmentRowActions;
2710
+ /**
2711
+ * SegmentSeamModel is one gutter's resolved shape: the segment a new one is inserted AFTER
2712
+ * (null at the head, where there is nothing before it) and the merge it offers.
2713
+ *
2714
+ * The merge is null at the head of the chain, and wherever the two rows the gutter sits between
2715
+ * are not the committed pair it would fuse. An uncommitted row rendered between them (an insert
2716
+ * being drawn into that very gap) would leave the gutter above it pointing at a fusion of two
2717
+ * rows the pointer is nowhere near, and the control's own hover preview would light them up as
2718
+ * if it were.
2719
+ */
2720
+ interface SegmentSeamModel {
2721
+ /** The segment a new one is inserted after, or null at the head of the chain. */
2722
+ readonly afterSegmentId: string | null;
2723
+ /** The merge the gutter offers, or null where its two rows are not the pair it would fuse. */
2724
+ readonly merge: SegmentChainMerge | null;
2725
+ }
2726
+ /**
2727
+ * SegmentListActions are the verbs a list dispatches that a row does not: the insert and the
2728
+ * merge that reshape the chain from a gutter, the preview that lights what a merge would fuse,
2729
+ * and the group verbs that move a segment in and out of a group.
2730
+ *
2731
+ * `groupSegment` and `removeFromGroup` read the chain AT DISPATCH TIME off the store handle
2732
+ * rather than closing over it, and every verb reads `onFailure` when it answers, which is what
2733
+ * keeps their identity stable across a live edit and an inline callback: a list bundles them
2734
+ * into objects every memoised row compares by reference, so a callback churning on the
2735
+ * throttled live-segment tick would render the whole list again many times a second.
2736
+ */
2737
+ interface SegmentListActions {
2738
+ /** Opens the group form for an existing group. A refusal reaches `onFailure` as `groupOpen`. */
2739
+ readonly editGroup: (groupId: string) => Promise<void>;
2740
+ /**
2741
+ * Opens the group form seeded with this segment and one free neighbour. It opens nothing for
2742
+ * an id the stored chain does not hold (a draft's row, a proposal). A refusal reaches
2743
+ * `onFailure` as `groupOpen`.
2744
+ */
2745
+ readonly groupSegment: (segmentId: string) => Promise<void>;
2746
+ /**
2747
+ * Begins drawing a segment after `afterSegmentId` (null for the head of the chain) in `mode`.
2748
+ * A refusal reaches `onFailure` as `insert`.
2749
+ */
2750
+ readonly insert: (afterSegmentId: string | null, mode: SegmentEditMode) => Promise<void>;
2751
+ /**
2752
+ * Folds `segmentId` into its successor. A refusal reaches `onFailure` as `merge`.
2753
+ */
2754
+ readonly merge: (segmentId: string) => Promise<void>;
2755
+ /** Emphasises the pair a merge would fuse, or restores the itinerary's emphasis with null. */
2756
+ readonly previewMerge: (segmentIds: readonly string[] | null) => void;
2757
+ /**
2758
+ * Leaves the group, dissolving it when one member would be left behind. A refusal reaches
2759
+ * `onFailure` as `groupDelete` for a dissolve and as `groupSetRange` for a shrink.
2760
+ */
2761
+ readonly removeFromGroup: (segmentId: string) => Promise<void>;
2762
+ }
2763
+ /**
2764
+ * SegmentListModel is what {@link useSegmentList} hands a segment list: the chain folded into
2765
+ * the models its rows and gutters read, the verbs neither of them owns, and the flags that
2766
+ * decide whether a new edit may begin.
2767
+ *
2768
+ * `actions` keeps one identity while the itinerary, the slug and the store do, and so does
2769
+ * every other member while what it is derived from stands, so a memoised row handed one of them
2770
+ * renders only when it moves.
2771
+ */
2772
+ interface SegmentListModel {
2773
+ /** The verbs the list dispatches that a row does not. */
2774
+ readonly actions: SegmentListActions;
2775
+ /** True while a run drives the workspace: every entry point into a new edit stands down. */
2776
+ readonly agentDriving: boolean;
2777
+ /** The ends of the committed chain, which decide what a row at either end offers. */
2778
+ readonly chainEnds: SegmentChainEnds;
2779
+ /** The grouping fold, keyed by segment id. */
2780
+ readonly groupRuns: ReadonlyMap<string, SegmentGroupRun>;
2781
+ /** True while ANY authoring engine owns the map: segment, waypoint or zone. */
2782
+ readonly isEditing: boolean;
2783
+ /** The committed chain with the in-flight edit overlaid: what the list RENDERS. */
2784
+ readonly liveSegments: ItineraryViewSource["segments"];
2785
+ /**
2786
+ * Who holds each locked segment, keyed by segment id. Absent means free.
2787
+ *
2788
+ * Resolved for the whole chain in one subscription rather than per row: `usePeerLockHolderId`
2789
+ * is a hook, so a row asking it is a subscription per row, and turning an id into a NAME is a
2790
+ * directory read the host would then issue once per row to answer a question that matters for
2791
+ * the one contested row.
2792
+ */
2793
+ readonly lockHolderIds: ReadonlyMap<string, string>;
2794
+ /** The merges the committed chain allows, read by the gutters and the row menus alike. */
2795
+ readonly merges: SegmentChainMerges;
2796
+ /** One model per rendered row, positional over {@link SegmentListModel.liveSegments}. */
2797
+ readonly seams: readonly SegmentSeamModel[];
2798
+ /** True when a gutter may offer its accelerators at all. */
2799
+ readonly seamsEnabled: boolean;
2800
+ }
2801
+ /**
2802
+ * UseSegmentListOptions name the itinerary a segment list renders, its committed chain, and
2803
+ * what a list needs that it cannot derive: the activity an insert routes for and who hears its
2804
+ * refusals.
2805
+ */
2806
+ interface UseSegmentListOptions {
2807
+ /** The activity an inserted routed segment routes for. */
2808
+ readonly activitySlug?: string | undefined;
2809
+ /** The itinerary whose chain the list renders and whose verbs it dispatches. */
2810
+ readonly itineraryId: string;
2811
+ /**
2812
+ * A refusal from one of the list's chain verbs or group verbs, in the row's own vocabulary.
2813
+ *
2814
+ * `SegmentRowFailure` rather than a union of the list's own, because a host maps every
2815
+ * refusal to a sentence in ONE place: a gutter's insert and a row menu's insert are the same
2816
+ * refusal reaching the user from two controls, and giving them two vocabularies would make
2817
+ * the host answer the same question twice and eventually differently.
2818
+ *
2819
+ * For the same reason it hears the refusals a row keeps as its `lastFailure` and no others: a
2820
+ * withheld confirmation ({@link isConfirmationWithheld}) never reaches it, since the verb never
2821
+ * ran.
2822
+ */
2823
+ readonly onFailure?: ((failure: SegmentRowFailure) => void) | undefined;
2824
+ /** The COMMITTED chain, in chain order. */
2825
+ readonly segments: ItineraryViewSource["segments"];
2826
+ }
2827
+ /**
2828
+ * useSegmentList is everything a segment list is except its markup: the chain folded into the
2829
+ * models its rows and gutters read, the verbs neither of them owns, and the flags that decide
2830
+ * whether a new edit may begin at all.
2831
+ *
2832
+ * **Every model is derived from the COMMITTED chain, and the rendered list is not the committed
2833
+ * chain.** A from-scratch draft appended at the tail, and an insert being drawn into a gap, both
2834
+ * occupy a visual position without occupying a chain position, so answering "which row is the
2835
+ * tail" positionally over what is rendered would let the real tail offer a merge it has no
2836
+ * successor for and lose its own Delete. The one thing that IS positional over the rendered list
2837
+ * is `seams`, because a gutter is a divider between two rendered rows.
2838
+ *
2839
+ * **The store reads are narrow.** The lock holders are read for the whole chain in one
2840
+ * subscription, whose map keeps its identity until a lock on a listed segment moves, so the
2841
+ * merge model derives again on a lock landing and on nothing else. Reading a holder per gutter
2842
+ * instead would cost two subscriptions per row on a chain that can run to dozens.
2843
+ *
2844
+ * @param options - The itinerary, its committed chain and the list's callbacks; see
2845
+ * {@link UseSegmentListOptions}.
2846
+ * @returns The {@link SegmentListModel} a list renders from.
2847
+ */
2848
+ declare const useSegmentList: ({ activitySlug, itineraryId, onFailure, segments }: UseSegmentListOptions) => SegmentListModel;
2849
+ /**
2850
+ * SegmentRowPostureState is what a row is allowed to BE, as one closed choice.
2851
+ *
2852
+ * A renderer branches on this rather than on a set of booleans, because the answers are
2853
+ * ordered and the order is load-bearing. Unsaved wins outright, ahead even of an open rename:
2854
+ * nothing about a row the server has never seen can be renamed, locked or driven, so the other
2855
+ * questions do not arise. After that, renaming wins over a lock that lands mid-rename (the
2856
+ * rename is already being discarded), and a peer's hold outranks a run's, because it can name
2857
+ * a person.
2858
+ */
2859
+ type SegmentRowPostureState = {
2860
+ readonly kind: "agentDriving";
2861
+ readonly reason: string;
2862
+ } | {
2863
+ readonly kind: "interactive";
2864
+ } | {
2865
+ readonly kind: "peerLocked";
2866
+ readonly reason: string;
2867
+ } | {
2868
+ readonly kind: "renaming";
2869
+ } | {
2870
+ readonly kind: "unsaved";
2871
+ readonly reason: string;
2872
+ };
2873
+ /**
2874
+ * UseSegmentRowOptions are what a row cannot derive for itself.
2875
+ *
2876
+ * The three hints are RESOLVED SENTENCES, and each is what its posture says on screen. A peer
2877
+ * lock names a person, which means a directory read the host owns; an unsaved row and a driven
2878
+ * one are static copy. Passing null for any of them means that state cannot arise on this
2879
+ * surface: a read-only list has no unsaved rows, a single-player one no peers.
2880
+ *
2881
+ * `onEditGeometry` overrides how the row opens an edit. Absent, it opens the persisted chain's
2882
+ * edit for `segmentId` through the published assembler, so a row dropped into a studio works
2883
+ * without wiring; a surface whose chain lives somewhere else (an import draft, a proposal)
2884
+ * supplies its own.
2885
+ *
2886
+ * `activitySlug` is what a directions edit routes under, and the one thing neither the row nor
2887
+ * the assembler beneath it can resolve: which activity an itinerary belongs to, and what the
2888
+ * router calls it, is the host's catalog to answer. Without it a directions edit opens and
2889
+ * draws no line, so a surface that grants the edit at all supplies it.
2890
+ */
2891
+ interface UseSegmentRowOptions {
2892
+ /** The router profile a directions edit routes under. */
2893
+ readonly activitySlug?: string | undefined;
2894
+ /** The sentence a row shows while a run drives the studio, or null where none can. */
2895
+ readonly agentLockHint?: string | null | undefined;
2896
+ /** The itinerary the row belongs to. Undefined for a draft's row, whose id is on no tile. */
2897
+ readonly itineraryId?: string | undefined;
2898
+ /** Opens the row's edit in place of the persisted chain's. */
2899
+ readonly onEditGeometry?: (() => void) | undefined;
2900
+ /**
2901
+ * A refusal of one of the row's verbs, with the verb it came from. Read through a ref, so a
2902
+ * handler written inline is safe.
2903
+ */
2904
+ readonly onFailure?: ((failure: SegmentRowFailure) => void) | undefined;
2905
+ /** The sentence a row shows while a peer holds the segment, or null where none can. */
2906
+ readonly peerLockHint?: string | null | undefined;
2907
+ /** The segment the row stands for. */
2908
+ readonly segmentId: string;
2909
+ /** The segment's current name, which the rename opens on. */
2910
+ readonly segmentName: string;
2911
+ /** The sentence a row shows while its segment is not saved yet, or null where none can be. */
2912
+ readonly unsavedHint?: string | null | undefined;
2913
+ }
2914
+ /**
2915
+ * SegmentRow is everything a segment row is, minus the markup.
2916
+ *
2917
+ * `active` and `menuOpen` are the row's transient chrome: the `…` trigger reveals on hover or
2918
+ * keyboard focus and pins visible while its menu is open. Neither belongs in a shared store: a
2919
+ * pointer crossing a long list would otherwise write once per row it crosses.
2920
+ */
2921
+ interface SegmentRow<TElement extends HTMLElement = HTMLDivElement> {
2922
+ /** True while the pointer or the keyboard is on the row, or its menu is open. */
2923
+ readonly active: boolean;
2924
+ /** The row's verbs, each bound to its itinerary and segment. */
2925
+ readonly actions: SegmentRowActions;
2926
+ /** Opens the geometry editor, deferred so a double-click can cancel it. */
2927
+ readonly editGeometry: () => void;
2928
+ /** True while the pointer is over THIS segment's line on the map. */
2929
+ readonly mapHovered: boolean;
2930
+ /** Whether the row's menu is open, which pins its trigger visible. */
2931
+ readonly menuOpen: boolean;
2932
+ /**
2933
+ * What a `segment.menu` plugin contribution acts on, held stable.
2934
+ *
2935
+ * Memoized HERE rather than built at the call site, because every consumer of it is a
2936
+ * memoized row: an object literal inside the list's `.map` would compare unequal on every
2937
+ * render of the list and defeat the memo on the row, the action cluster and the menu at once,
2938
+ * which is the shape `memoPolicy.test.ts` refuses.
2939
+ *
2940
+ * `itineraryId` is nullable because the same row renders for an import DRAFT, whose chain has
2941
+ * no server-side itinerary behind it yet.
2942
+ */
2943
+ readonly pluginTarget: StudioPluginTarget<"segment.menu">;
2944
+ /** What the row is allowed to be, as one closed choice. */
2945
+ readonly posture: SegmentRowPostureState;
2946
+ /**
2947
+ * The inline rename of the segment's name. Its commit is gated by the display name's rule
2948
+ * (`displayNameSchema` of `@mountaya/studio`): a name the rule refuses leaves `editing` true
2949
+ * and `value` as typed, and nothing is dispatched.
2950
+ */
2951
+ readonly rename: InlineRename;
2952
+ /** Spread onto the row element: hover, focus and the ref the map hover scrolls. */
2953
+ readonly rowProps: {
2954
+ /** Hides the trigger once focus leaves the row's subtree. */
2955
+ readonly onBlur: (event: FocusEvent<HTMLElement>) => void;
2956
+ /** Reveals the trigger for a keyboard user. */
2957
+ readonly onFocus: () => void;
2958
+ /** Reveals the trigger and emphasises the segment on the map. */
2959
+ readonly onMouseEnter: () => void;
2960
+ /** Hides the trigger and gives the itinerary its emphasis back. */
2961
+ readonly onMouseLeave: () => void;
2962
+ /** The ref the map hover scrolls into view. */
2963
+ readonly ref: RefObject<TElement | null>;
2964
+ };
2965
+ /** Opens or closes the row's menu. */
2966
+ readonly setMenuOpen: (open: boolean) => void;
2967
+ /** Opens the inline rename, cancelling the geometry edit the first click scheduled. */
2968
+ readonly startRename: () => void;
2969
+ }
2970
+ /**
2971
+ * useSegmentRow is the whole of a segment row that is not markup: its verbs, the rename state
2972
+ * machine, the hover surfaces of the row and of the map, and the posture the renderer branches
2973
+ * on.
2974
+ *
2975
+ * **Hovering the row emphasises its segment on the map, and leaving restores the itinerary's.**
2976
+ * That pairing is the reason it lives here rather than at a call site: a row that emphasised on
2977
+ * enter and forgot to restore on leave leaves the map dimmed around one segment forever, and
2978
+ * the bug is invisible until a user moves the pointer away. A row unmounted under the pointer
2979
+ * restores it too. A row with no `itineraryId` is a draft's, whose id is on no tile: it sends
2980
+ * the map no emphasis, since one that lights nothing dims every line.
2981
+ *
2982
+ * Everything is derived from the store and the provider except the three sentences and the
2983
+ * optional edit override: see {@link UseSegmentRowOptions}.
2984
+ *
2985
+ * @returns The {@link SegmentRow} a renderer draws from.
2986
+ */
2987
+ declare const useSegmentRow: <TElement extends HTMLElement = HTMLDivElement>({ activitySlug, agentLockHint, itineraryId, onEditGeometry, onFailure, peerLockHint, segmentId, segmentName, unsavedHint }: UseSegmentRowOptions) => SegmentRow<TElement>;
2988
+ /**
2989
+ * Reading SEVERAL slots of a store in one subscription.
2990
+ *
2991
+ * Every store hook here compares with `Object.is`, which makes a selector that builds an object
2992
+ * render its component again on every write anywhere in the store: the object is a fresh
2993
+ * allocation each time, so it never equals the last one. That is `Object.is` doing what it
2994
+ * says, and the studio's own `select*` helpers avoid it by reading a single slot.
2995
+ *
2996
+ * A surface that needs several slots has two honest options: one call per slot, or one call
2997
+ * whose result is compared by members instead of by identity. This is the second, and it is a
2998
+ * SELECTOR wrapper rather than a hook over a particular store so that one implementation serves
2999
+ * `useUiStore`, `useStoreSlice` and `useStudioStore` alike.
3000
+ *
3001
+ * It lives here rather than in `@mountaya/elements` because comparing the LAST result against
3002
+ * the next one is a React-render-cycle idea; the store underneath has no notion of a previous
3003
+ * render. And it exists at all rather than `zustand/react/shallow`'s `useShallow` because
3004
+ * reaching for that entry puts a second copy of zustand's React half in a consumer's bundle for
3005
+ * a memo this short.
3006
+ */
3007
+ /**
3008
+ * useShallowSelector wraps a selector so its result is compared by members rather than by
3009
+ * identity.
3010
+ *
3011
+ * The wrapped selector may build a fresh object per call (that is the point), and the memo
3012
+ * below hands back the previous one whenever the members match, so the `Object.is` inside
3013
+ * `useSyncExternalStore` sees no change and the component sits still. An array, a plain object,
3014
+ * a `Map` and a `Set` are compared by their members, and a `Date` by its instant. Any other
3015
+ * object is compared by identity, so a selector that builds one per call (a class instance)
3016
+ * never settles, and React refuses it as it refuses an allocating selector with no wrapper.
3017
+ *
3018
+ * The selector still runs on every notification, so it must stay cheap: read slots, do not
3019
+ * compute. Sorting a list or deriving a total inside one turns every write in the store into
3020
+ * that work, and the result will not be shallow-equal anyway.
3021
+ *
3022
+ * @param selector - The selector to wrap, which may be written inline.
3023
+ * @returns The wrapped selector, to hand to `useUiStore`, `useStoreSlice` or `useStudioStore`.
3024
+ *
3025
+ * @example
3026
+ * ```tsx
3027
+ * const { agentDriving, locating } = useUiStore(
3028
+ * useShallowSelector((state) => ({ agentDriving: state.agentDriving, locating: state.locating })),
3029
+ * );
3030
+ * ```
3031
+ */
3032
+ declare const useShallowSelector: <TState, TSlice>(selector: (state: TState) => TSlice) => ((state: TState) => TSlice);
3033
+ /**
3034
+ * Subscribing to the studio's store from React, without taking React's store library.
3035
+ *
3036
+ * `@mountaya/studio` builds its store on `zustand/vanilla`: a subscribable object and nothing
3037
+ * more, which is what lets the rules run in a worker or a React Native runtime. Turning one
3038
+ * into a hook is this package's job, and `useSyncExternalStore` is the whole of it: React
3039
+ * ships the correct implementation, including the tearing guarantees a hand-written
3040
+ * subscribe/setState pair gets wrong under concurrent rendering.
3041
+ *
3042
+ * Not `zustand/react`'s `useStore`, on purpose. It would work, and it would put a second copy
3043
+ * of zustand's React entry in a consumer's bundle beside whatever their own state library
3044
+ * already is, for a hook this short.
3045
+ */
3046
+ /**
3047
+ * ReadableStore is the shape this hook needs and nothing more: subscribe, and read.
3048
+ *
3049
+ * Structural rather than zustand's `StoreApi`, so a consumer driving these hooks from their
3050
+ * own store (a Redux slice, a signal, a hand-rolled emitter) satisfies it by having the two
3051
+ * methods rather than by adopting a dependency.
3052
+ */
3053
+ interface ReadableStore<TState> {
3054
+ /** Reads the store's state as it stands. */
3055
+ readonly getState: () => TState;
3056
+ /** Tells `listener` of every change, until the function it returns is called. */
3057
+ readonly subscribe: (listener: () => void) => () => void;
3058
+ }
3059
+ /**
3060
+ * useStudioStore subscribes to a slice of a studio store.
3061
+ *
3062
+ * The selector is applied on every notification, so it must be CHEAP and it must return a
3063
+ * stable reference for unchanged state: the studio's own selectors are written that way (they
3064
+ * read a slot off the state rather than building a fresh object) precisely so a subscriber
3065
+ * renders on the change it cares about and not on every write.
3066
+ *
3067
+ * A selector that derives a new object per call renders its component again on every store
3068
+ * write anywhere in the tree. That is not a limitation of this hook; it is `Object.is` doing
3069
+ * what it says, and no amount of memoisation inside here can fix a selector that is a fresh
3070
+ * allocation. Wrap one in {@link useShallowSelector} when the slice spans several slots.
3071
+ *
3072
+ * @param store - The store to read, or null where none is mounted.
3073
+ * @param selector - Reads the slice off the state.
3074
+ * @param fallback - What the hook answers while `store` is null.
3075
+ * @returns The slice, or `fallback` with no store.
3076
+ */
3077
+ declare const useStudioStore: <TState, TSlice>(store: ReadableStore<TState> | null, selector: (state: TState) => TSlice, fallback: TSlice) => TSlice;
3078
+ /**
3079
+ * useStoreSlice subscribes to a slice of a store.
3080
+ *
3081
+ * The selector runs on every notification, so it must be CHEAP and it must return a stable
3082
+ * reference for unchanged state: a selector that derives a new object per call renders its
3083
+ * component again on every write anywhere in the store. That is `Object.is` doing what it
3084
+ * says, and no memoisation inside here can fix a selector that is a fresh allocation. Wrap one
3085
+ * in {@link useShallowSelector} when the slice spans several slots.
3086
+ *
3087
+ * @returns The slice the selector reads, read again at each notification of the store.
3088
+ */
3089
+ declare const useStoreSlice: <TState, TSlice>(store: ReadableStore<TState>, selector: (state: TState) => TSlice) => TSlice;
3090
+ /**
3091
+ * STREETVIEW_CORRIDOR_METERS is how far from the itinerary a bounded Street View drop (and a
3092
+ * walking step inside the panorama) may stray before it is refused.
3093
+ *
3094
+ * Itineraries follow the roads and trails where Street View lives, so a tight corridor accepts a
3095
+ * near-itinerary drop while bounding the panorama to the itinerary. It is a number rather than a
3096
+ * hit test against a drawn shape because the gate runs before a coverage call is billed.
3097
+ */
3098
+ declare const STREETVIEW_CORRIDOR_METERS = 100;
3099
+ /**
3100
+ * StreetViewCorridor is a surface's half of `<StreetViewControl>`: the itinerary it bounds a drop
3101
+ * to (`bounds`, undefined for no bound), and the drag and open handlers that take the control's
3102
+ * defaults away from it.
3103
+ */
3104
+ interface StreetViewCorridor {
3105
+ /** The itinerary a drop is bounded to, or undefined where nothing bounds it. */
3106
+ readonly bounds: StreetViewBounds | undefined;
3107
+ /** Takes the coverage raster and the corridor band down, on every path that ends a drag. */
3108
+ readonly onDragEnd: () => void;
3109
+ /** Shows the coverage raster, and the corridor band where a drop is bounded. */
3110
+ readonly onDragStart: () => void;
3111
+ /** Opens the panorama at an accepted drop, longitude first. */
3112
+ readonly onOpen: (lngLat: [number, number]) => void;
3113
+ }
3114
+ /**
3115
+ * useStreetViewCorridor wires the Street View handle onto the tool bus, bounded to the active
3116
+ * itinerary when a surface asks for it.
3117
+ *
3118
+ * The control ships a complete interaction (grab, coverage raster, corridor band, drop,
3119
+ * corridor gate, coverage check, open), and every part that touches the MAP is behind an `on*`
3120
+ * that suppresses the default. Those are taken here, because a studio's mutations go through
3121
+ * one bus: an agent's `studio.streetview.open` and a user's drop become one path rather than
3122
+ * two that have to be kept agreeing.
3123
+ *
3124
+ * What is NOT taken is the pipeline between the drop and the open: the unproject, the corridor
3125
+ * gate, the billed coverage check, the refusal notice beside the handle. Those stay the
3126
+ * control's, so a drop accepted on one integration is accepted on every other. `bounds` is data
3127
+ * that gate runs on, not a handler replacing it.
3128
+ *
3129
+ * @param bounded - Whether a drop is bounded to the open itinerary. A read-only surface passes
3130
+ * true: an embed bounds Street View to the itinerary it is showing, so a visitor cannot walk a
3131
+ * shared Maps key across the globe. An editor passes false, accepts any covered drop, and
3132
+ * reads no itinerary at all for it.
3133
+ * @returns The {@link StreetViewCorridor} to spread onto `<StreetViewControl>`.
3134
+ */
3135
+ declare const useStreetViewCorridor: (bounded: boolean) => StreetViewCorridor;
3136
+ /**
3137
+ * useStudioApi is the data seam the mounted studio was given.
3138
+ *
3139
+ * A surface reaches it rarely and should: the verbs write through the handlers, which already
3140
+ * hold it, so a component calling the client directly is usually a verb that has not been
3141
+ * written yet. What it is for is the read a handler has no business owning: a rating posted
3142
+ * beside a transcript, a probe a panel makes on its own behalf.
3143
+ *
3144
+ * @returns The studio's {@link StudioApi}, or `undefined` outside a provider rather than a
3145
+ * throw, so a surface rendered in a consumer's own list does not crash their page; the caller
3146
+ * decides what an absent client means, which for every present caller is "do nothing".
3147
+ */
3148
+ declare const useStudioApi: () => StudioApi | undefined;
3149
+ /**
3150
+ * StudioDispatchOverrides carry the one thing a caller can vary per dispatch.
3151
+ *
3152
+ * Named for what it does rather than as `…Options`, which in this package is reserved for a
3153
+ * HOOK's own argument type: this is an argument to the dispatch function the hook returns.
3154
+ *
3155
+ * `context` replaces the studio's own for THIS call, which is what a surface layering a seam
3156
+ * over it needs: a dialog that wants its own confirmation prompt in front of the studio's, a
3157
+ * tab strip dispatching against a context carrying the surface it just mounted. Everything else
3158
+ * (the bus, the handlers, the store) is the studio's, so the layered context is a spread of
3159
+ * the one this hook already reads rather than a second one built from nothing.
3160
+ *
3161
+ * Omitted, the studio's own context is used, which is the case every ordinary surface is in.
3162
+ */
3163
+ interface StudioDispatchOverrides {
3164
+ /** The tool context this dispatch runs on, in place of the studio's own. */
3165
+ readonly context?: StudioToolContext | undefined;
3166
+ }
3167
+ /**
3168
+ * StudioDispatchFn runs one of the studio's own verbs, checked against its contract.
3169
+ *
3170
+ * `TName` is a key of {@link StudioToolInputs}, so a misspelled verb is a compile error naming
3171
+ * the tools that do exist, and the payload is the tool's own INPUT shape: the pre-parse one,
3172
+ * so a field carrying a Zod default stays optional to the caller.
3173
+ *
3174
+ * It answers the `ToolResult` of that verb's data, read from {@link StudioToolOutputs}. Where the
3175
+ * verb's contract states an `output`, a caller takes a member of `result.data` after `result.ok`
3176
+ * with no narrowing of its own. A verb that answers no data reads `undefined`, and a verb whose
3177
+ * contract states no output reads `unknown`. A refusal is the `ok: false` arm under every verb.
3178
+ *
3179
+ * A stand-in written by hand, a spy in a suite or a stub of the hook, is held to the same
3180
+ * answers. One that only refuses is a `StudioDispatchFn` as written, and so are a function that
3181
+ * forwards to a bus naming {@link StudioToolOutputs} and a spy typed by the dispatch,
3182
+ * `vi.fn<StudioDispatchFn>()`, resolved with a plain `ok` or a refusal. A function whose own type
3183
+ * answers one `ok` under every verb, an arrow function or a spy built over one, is refused with
3184
+ * TS2322, since a verb that states data would read an answer with none: it is asserted where it
3185
+ * is handed over, `spy as StudioDispatchFn`. A suite that reads what a verb answered mounts
3186
+ * `StudioProvider` over `studioToolBus()` from `@mountaya/studio/testing` and takes the hook as
3187
+ * it is.
3188
+ */
3189
+ type StudioDispatchFn = <TName extends keyof StudioToolInputs & string>(name: TName, input: StudioToolInputs[TName], options?: StudioDispatchOverrides) => Promise<ToolResultOf<StudioToolOutputs, TName>>;
3190
+ /**
3191
+ * UseStudioDispatch is what {@link useStudioDispatch} answers: the function that runs a verb, and
3192
+ * whether one this caller started is still running.
3193
+ */
3194
+ interface UseStudioDispatch {
3195
+ /**
3196
+ * dispatch runs a studio tool and resolves its result. It never rejects: with no studio above
3197
+ * it the answer is a refusal, and so is a rejection of a host's own bus.
3198
+ *
3199
+ * One function for the caller's life. It reads the bus and the tool context as it runs, so a
3200
+ * dispatch sent after the host rebuilt its context runs on the context that stands.
3201
+ */
3202
+ readonly dispatch: StudioDispatchFn;
3203
+ /**
3204
+ * pending is true from the moment a dispatch starts until it settles.
3205
+ *
3206
+ * Counted rather than flagged, so two overlapping dispatches do not clear each other's
3207
+ * spinner: the second's completion would otherwise unset a flag the first still needs.
3208
+ *
3209
+ * Reading it is what subscribes, and the subscriber is the hook's caller: once it has been
3210
+ * read, the caller re-renders each time it flips, and a caller that never reads it (a row whose
3211
+ * handler is `void dispatch(…)`) re-renders for no dispatch at all. A child handed the object
3212
+ * may read it in its own render: that read subscribes the caller, and the caller's re-render
3213
+ * hands the child a new object. It reads the count live, so a handler reading it outside a
3214
+ * render gets the value of that moment.
3215
+ */
3216
+ readonly pending: boolean;
3217
+ }
3218
+ /**
3219
+ * useStudioDispatch is how a studio surface changes anything.
3220
+ *
3221
+ * The typed sibling of `useStudioDispatchUnsafe`, and the one a studio surface should reach for.
3222
+ * That one takes a `string` and an `unknown` because it serves a host whose tool set this package
3223
+ * cannot know; this one is bound to {@link StudioToolInputs}, which is DERIVED from the published
3224
+ * contracts, so the verb and its payload are checked, and a schema change is a compile error at
3225
+ * every call site rather than a parse failure at one of them.
3226
+ *
3227
+ * **Bound rather than augmented, deliberately.** The alternative is
3228
+ * `declare module "@mountaya/studio" { interface ToolDispatchRegistry extends
3229
+ * StudioToolInputs {} }`, which is global: a package shipping it would type-check every
3230
+ * importer's dispatch against the studio's tools whether or not they mount a studio, with no
3231
+ * way to decline. Binding the map to a hook keeps the checking exactly where the studio is, and
3232
+ * keeps it expressible in a language with no declaration merging, which matters because the
3233
+ * same contract table is what the Dart and Flutter SDKs generate from.
3234
+ *
3235
+ * The answer is bound the same way. `dispatch` reads each verb's data from
3236
+ * {@link StudioToolOutputs}, which is derived from the same contracts, whether or not the host
3237
+ * merged them into `ToolOutputRegistry`. Nothing is parsed on the way back: what the verb's
3238
+ * handler returned is what the caller reads.
3239
+ *
3240
+ * The bus and the tool context, each nullable, collapse into one function that is always
3241
+ * there: an absent provider is a structured refusal with the shape every other failure has,
3242
+ * so a component renders in a story, a unit test or a print view with no studio around it,
3243
+ * and no call site proves the bus present.
3244
+ *
3245
+ * A dispatch costs its caller no render unless `pending` is read. The count of dispatches in
3246
+ * flight lives outside React state, and reading `pending` is what asks for a render of the
3247
+ * hook's caller when the answer flips. Most callers never read it, and a list of rows each
3248
+ * holding this hook would otherwise render twice per click on any of them. Each render returns
3249
+ * a fresh object, so a memoized child handed it renders with its caller, and an effect that
3250
+ * depends on the hook names `dispatch`, which is one function for the caller's life, rather
3251
+ * than the object.
3252
+ *
3253
+ * @returns The {@link UseStudioDispatch} of this render.
3254
+ *
3255
+ * @example
3256
+ * ```tsx
3257
+ * declare const itineraryId: string;
3258
+ * declare const setError: (message: string) => void;
3259
+ *
3260
+ * const { dispatch, pending } = useStudioDispatch();
3261
+ *
3262
+ * const rename = async (name: string) => {
3263
+ * const result = await dispatch("studio.itinerary.rename", { itineraryId, name });
3264
+ * if (!result.ok) {
3265
+ * setError(result.error);
3266
+ * }
3267
+ * };
3268
+ * ```
3269
+ */
3270
+ declare const useStudioDispatch: () => UseStudioDispatch;
3271
+ /**
3272
+ * StudioDispatchUnsafeFn runs one tool by name. The input is `unknown` because a component knows
3273
+ * its own verb and the bus knows the schema; narrowing here would mean re-declaring every tool's
3274
+ * input in this package, which is the duplication the registry exists to prevent.
3275
+ */
3276
+ type StudioDispatchUnsafeFn = (name: string, input?: unknown) => Promise<ToolResult>;
3277
+ /**
3278
+ * UseStudioDispatchUnsafe is what {@link useStudioDispatchUnsafe} answers: the function that runs
3279
+ * a tool by name, and whether one this caller started is still running.
3280
+ */
3281
+ interface UseStudioDispatchUnsafe {
3282
+ /**
3283
+ * dispatch runs a tool and resolves its result. It never rejects: with no studio above it the
3284
+ * answer is a refusal, said once on the console, and so is a rejection of a host's own bus.
3285
+ *
3286
+ * One function for the caller's life. It reads the bus and the tool context as it runs, so a
3287
+ * dispatch sent after the host rebuilt its context runs on the context that stands.
3288
+ */
3289
+ readonly dispatch: StudioDispatchUnsafeFn;
3290
+ /**
3291
+ * pending is true from the moment a dispatch starts until it settles.
3292
+ *
3293
+ * Counted rather than flagged, so two overlapping dispatches do not clear each other's
3294
+ * spinner: the second's completion would otherwise unset a flag the first still needs.
3295
+ *
3296
+ * Reading it is what subscribes, and the subscriber is the hook's caller: once it has been
3297
+ * read, the caller re-renders each time it flips, and a caller that never reads it (a row whose
3298
+ * handler is `void dispatch(…)`) re-renders for no dispatch at all. A child handed the object
3299
+ * may read it in its own render: that read subscribes the caller, and the caller's re-render
3300
+ * hands the child a new object. It reads the count live, so a handler reading it outside a
3301
+ * render gets the value of that moment.
3302
+ */
3303
+ readonly pending: boolean;
3304
+ }
3305
+ /**
3306
+ * useStudioDispatchUnsafe returns the surface's dispatch function and whether one is in flight.
3307
+ *
3308
+ * The result is RETURNED rather than thrown or swallowed, on purpose: a studio surface usually
3309
+ * wants to show the failure where the action was taken, and a hook that swallowed it would
3310
+ * leave a button that did nothing with no way to say why.
3311
+ *
3312
+ * A dispatch costs its caller no re-render unless `pending` is read, exactly as with
3313
+ * `useStudioDispatch`. The count of dispatches in flight lives outside React state, and reading
3314
+ * `pending` is what asks for a re-render of the hook's caller when the answer flips. Every row,
3315
+ * list and action hook in this entry point dispatches through one of the two and reads `dispatch`
3316
+ * alone, so a count in state would re-render each of them twice per dispatch. Each render returns a
3317
+ * fresh object, so a memoized child handed it re-renders with its caller, and an effect that
3318
+ * depends on the hook names `dispatch` rather than the object.
3319
+ *
3320
+ * @returns The {@link UseStudioDispatchUnsafe} of this render.
3321
+ */
3322
+ declare const useStudioDispatchUnsafe: <TCtx extends ToolBusContext = ToolBusContext>() => UseStudioDispatchUnsafe;
3323
+ /**
3324
+ * useStudioEntitlement reports whether the viewer holds an entitlement, live.
3325
+ *
3326
+ * The seam is the one the tool handlers already gate on, so a surface reveals exactly what the
3327
+ * bus would accept, by construction rather than by coincidence: with the handlers asking
3328
+ * `viewer.hasEntitlement` and the components deriving a feature again from whatever store the
3329
+ * host happens to keep, two derivations of one rule agree until one of them is fixed.
3330
+ *
3331
+ * Unlike its unit sibling, an absent provider is refused rather than defaulted: "in what units"
3332
+ * has a safe answer and "may this viewer do X" does not. Answering `false` outside a provider
3333
+ * would gate a surface on a guess, and answering `true` would open one.
3334
+ *
3335
+ * @param entitlement - The entitlement asked about.
3336
+ * @returns Whether the viewer holds it, read again when the viewer says it changed.
3337
+ * @throws {MountayaElementsError} When no studio is mounted above the caller.
3338
+ */
3339
+ declare const useStudioEntitlement: (entitlement: StudioEntitlement) => boolean;
3340
+ /**
3341
+ * StudioFailureReporter raises the studio's shared alert for a refused dispatch, naming the
3342
+ * action that failed and appending the reason. A successful result is a no-op, so a call site
3343
+ * can hand it every result rather than branching first.
3344
+ */
3345
+ type StudioFailureReporter = (result: ToolResult, action: string) => void;
3346
+ /**
3347
+ * useStudioFailureAlert is how a studio surface reports a dispatch that came back refused.
3348
+ *
3349
+ * Menus close on click, gutters have no error slot, and the sidenav footer commits and moves
3350
+ * on; none of them can hold a message, so the map alert is where an async refusal has to land,
3351
+ * and this is the single place that decides what it says. {@link failureAlertFor} holds that
3352
+ * decision; this binds it to the studio's own dispatch.
3353
+ *
3354
+ * It takes no argument: the bus and the context are read through the provider, so a row three
3355
+ * levels down, or a map hook, reports a failure without anything being threaded to it.
3356
+ *
3357
+ * The alert goes out through `studio.alert.show` like every other mutation, so the reporter
3358
+ * never writes the ui store itself.
3359
+ *
3360
+ * It reads its dispatcher through this package's own module graph rather than through the
3361
+ * barrel, which matters to a test harness: a stand-in hung on `@mountaya/studio-react/headless`
3362
+ * replaces `useStudioDispatch` for the SURFACE and not for this hook, so a suite that stubs the
3363
+ * barrel and asserts on the alert should drive a real bus through `StudioProvider` instead.
3364
+ *
3365
+ * @returns The {@link StudioFailureReporter}, one function for the caller's life.
3366
+ *
3367
+ * @example
3368
+ * ```tsx
3369
+ * declare const itineraryId: string;
3370
+ * declare const segmentId: string;
3371
+ *
3372
+ * const { dispatch } = useStudioDispatch();
3373
+ * const reportFailure = useStudioFailureAlert();
3374
+ *
3375
+ * const remove = async () => {
3376
+ * const result = await dispatch("studio.itinerary.segment.remove", { itineraryId, segmentId });
3377
+ * reportFailure(result, "Couldn't delete this segment");
3378
+ * };
3379
+ * ```
3380
+ */
3381
+ declare const useStudioFailureAlert: () => StudioFailureReporter;
3382
+ /**
3383
+ * useStudioObserve reports every dispatch the studio makes to `observer`, for as long as the
3384
+ * calling component is mounted.
3385
+ *
3386
+ * One observer sees the whole product surface (a person clicking a control, an agent running a
3387
+ * verb, a bridge relaying a message from a parent frame), because the bus is the one place all
3388
+ * three meet. That is what makes it the right seam for analytics, and for the two collaboration
3389
+ * reports a studio has to make: a lost-revision conflict, and an edit refused because a peer
3390
+ * holds the lock. Neither of those belongs in a handler, because a handler cannot know which
3391
+ * surface should say so.
3392
+ *
3393
+ * `observer` is read through a ref, so an inline closure over fresh props is safe and does NOT
3394
+ * re-subscribe on every render. That matters more here than it looks: an observer usually needs
3395
+ * the latest copy, the latest peer names, the latest open resource, and a caller who had to
3396
+ * memoize all of it would end up keeping the refs by hand.
3397
+ *
3398
+ * Nothing observed is a defined absence rather than a gap. A provider with no bus, or one
3399
+ * carrying a hand-written dispatch slice, has nothing to subscribe to, and an observer reports
3400
+ * on actions rather than performing them, so its absence loses a report and never an action.
3401
+ * An observer that throws changes no dispatch and stops no observer after it, so a failing sink
3402
+ * never surfaces as a tool failure. Its fault is not dropped: the bus raises the first of a
3403
+ * round as an uncaught error on a microtask, where the page's error reporting sees it.
3404
+ *
3405
+ * @param observer - Told of each dispatch once it completes; it may be written inline.
3406
+ */
3407
+ declare const useStudioObserve: (observer: ToolDispatchObserver) => void;
3408
+ /** useStudioPreferences is `useStudioViewerPreferences` over the viewer already in context. */
3409
+ declare const useStudioPreferences: () => ViewerPreferences | null;
3410
+ /**
3411
+ * useStudioSignedIn reports that somebody is reading rather than nobody.
3412
+ *
3413
+ * Its own hook rather than `useStudioUserId() !== null` at each call site, because the surfaces
3414
+ * that ask are the ones deciding what an ANONYMOUS reader sees (a share view's "open in
3415
+ * Mountaya" link, its sign-in prompt), and a comparison against null at each call site is a
3416
+ * chance to write `!== undefined` instead. The seam answers `null` for nobody and a
3417
+ * mistyped check would read every anonymous viewer as signed in, which fails open.
3418
+ */
3419
+ declare const useStudioSignedIn: () => boolean;
3420
+ /**
3421
+ * useStudioUnits is `useStudioViewerUnits` over the viewer already in context.
3422
+ *
3423
+ * The zero-argument form exists for the same reason `useCapability` has one: every surface that
3424
+ * renders a measurement needs this, and threading the viewer through each of them is the
3425
+ * boilerplate the context was put there to remove. The explicit form stays for a caller holding
3426
+ * a viewer that is not the mounted studio's: a preview of someone else's session, a test.
3427
+ *
3428
+ * Outside a provider it answers the DEFAULTS rather than throwing, unlike its entitlement
3429
+ * sibling, and the difference is what each question means when nobody has answered it. "May
3430
+ * this viewer do X" has no safe default (refusing silently would gate a surface on a guess),
3431
+ * while "in what units" does, and metric-and-degrees is the same answer an anonymous embed
3432
+ * gets. A row a consumer renders in their own list, outside the studio subtree, should show a
3433
+ * distance rather than crash their page.
3434
+ */
3435
+ declare const useStudioUnits: () => UnitFormatOptions;
3436
+ /**
3437
+ * useStudioUrl reads the studio's own slice of the address bar, or `inertStudioUrlSeam`
3438
+ * where the host supplied none.
3439
+ *
3440
+ * The inert seam is the published one rather than a local twin: a studio with no router still
3441
+ * mutates its store and simply does not land back on what was open after a reload, and that is
3442
+ * one answer with one implementation, which the assembled studio hands to `useStudioUrlState`
3443
+ * from the other side of the same absence.
3444
+ *
3445
+ * Reach for it where a surface needs a value that has to SURVIVE A RELOAD and travel in a link
3446
+ * (the collection scope a sidenav is browsing, the itinerary a detail panel is open on). State
3447
+ * that does not need either belongs in the store, which is cheaper and does not touch history.
3448
+ *
3449
+ * **A reader binds the seam's `subscribe` and `read` with `useSyncExternalStore`.** `read`
3450
+ * answers one object until a mirrored value changes, so the binding renders again on a change
3451
+ * and on nothing else. The seam arrives on the tool context, which is built once, so a host
3452
+ * builds its seam once and memoizes it.
3453
+ */
3454
+ declare const useStudioUrl: () => StudioUrlSeam;
3455
+ /** useStudioUserId is `useStudioViewerUserId` over the viewer already in context. */
3456
+ declare const useStudioUserId: () => string | null;
3457
+ /**
3458
+ * useStudioViewer is the viewer the mounted studio is showing this map to.
3459
+ *
3460
+ * The escape hatch under the zero-argument viewer hooks (`useStudioUnits`, `useStudioUserId`,
3461
+ * `useStudioPreferences`), for a surface asking something none of them names: the itinerary
3462
+ * ceiling of a scope, a preference write. Outside a provider it answers `inertViewer` from
3463
+ * `@mountaya/studio` rather than throwing, which is the same defined absence
3464
+ * `createStaticViewer` gives a host with no session: no user, no entitlement, no ceiling, no
3465
+ * preferences.
3466
+ *
3467
+ * Held live rather than read once, because every member is a getter and the session that fills
3468
+ * them resolves after the studio mounts.
3469
+ */
3470
+ declare const useStudioViewer: () => StudioViewer;
3471
+ /**
3472
+ * useStudioViewerEntitlement reports whether the host extends a named entitlement to the viewer,
3473
+ * and renders again when that answer changes.
3474
+ *
3475
+ * It exists because reading the seam directly is correct and stale. `hasEntitlement` is a
3476
+ * function so a handler can ask late (the context is built once per mount and a membership
3477
+ * resolves after it), but a component that calls it during render captures one answer and
3478
+ * keeps it. The surfaces gated on an entitlement are exactly the ones a session changes
3479
+ * underneath, because accepting an invitation, a change to an organization's agreement and
3480
+ * resolving a membership all happen without the studio remounting. The component renders
3481
+ * refused, the entitlement arrives, and nothing tells React to look again.
3482
+ *
3483
+ * `useSyncExternalStore` rather than an effect and a piece of state: it is the same subscription
3484
+ * either way, and this one is torn during a concurrent render instead of showing the previous
3485
+ * answer for a frame. `viewer.subscribe` matches its contract exactly, which is why the seam
3486
+ * declares it in that shape.
3487
+ *
3488
+ * The getter is memoized on the pair it reads, so a host whose viewer identity is stable (every
3489
+ * one built from a store is) subscribes again only when the entitlement asked for changes.
3490
+ *
3491
+ * The same getter is the server snapshot. The seam is the host's on the server as in the browser,
3492
+ * so a host whose server knows the viewer renders the entitled surface there; hydration then reads
3493
+ * the browser's viewer and expects the same answer, as React requires of every server snapshot.
3494
+ *
3495
+ * @param viewer - The viewer seam to ask.
3496
+ * @param entitlement - The entitlement asked about.
3497
+ * @returns Whether the viewer holds it.
3498
+ */
3499
+ declare const useStudioViewerEntitlement: <TEntitlement extends string>(viewer: ViewerSeam<TEntitlement>, entitlement: TEntitlement) => boolean;
3500
+ /**
3501
+ * useStudioViewerItineraryLimit reads how many itineraries the viewer may own in the scope
3502
+ * `organizationId` names, and renders again when that answer changes.
3503
+ *
3504
+ * The ceiling's counterpart of `useStudioViewerEntitlement`, for the reason given there:
3505
+ * `getItineraryLimit` is a function so a handler can ask late, and a component that calls it
3506
+ * during render keeps the answer of the render it called it in. A ceiling lands after the studio
3507
+ * mounts (the reader's own space is answered by a read of its own), so a create surface that
3508
+ * asked once would offer a create at the ceiling and leave the reader to meet the refusal.
3509
+ *
3510
+ * The same getter is the server snapshot, for the reason `useStudioViewerEntitlement` gives: the
3511
+ * seam is the host's on the server too, and hydration expects the browser's viewer to agree.
3512
+ *
3513
+ * @param viewer - The viewer seam to ask.
3514
+ * @param organizationId - The scope the itineraries are kept in: an organization, or the reader's
3515
+ * own space in any spelling the host's scope predicate reads, an omitted id among them.
3516
+ * @returns The ceiling the viewer states for the scope, or null where none is in force: none
3517
+ * applies, or none is known yet.
3518
+ */
3519
+ declare const useStudioViewerItineraryLimit: (viewer: Pick<StudioViewer, "getItineraryLimit" | "subscribe">, organizationId?: string | null | undefined) => number | null;
3520
+ /**
3521
+ * useStudioViewerPreferences reads the viewer's stated preferences and renders again when they
3522
+ * change.
3523
+ *
3524
+ * Generic over the entitlement vocabulary although it reads none: `hasEntitlement` takes the
3525
+ * vocabulary as an ARGUMENT, so a seam closed over a narrower one is not assignable to the open
3526
+ * `ViewerSeam<string>`, and a `StudioViewer` handed to a hook spelled that way would fail to
3527
+ * compile for a member the hook never touches.
3528
+ *
3529
+ * The sibling of `useStudioViewerEntitlement`, and it exists for the same reason spelled out there:
3530
+ * every member of the seam is a GETTER, because a tool handler asks once at dispatch time. A
3531
+ * component that calls `viewer.getPreferences()` during render captures one answer and keeps
3532
+ * it, so a viewer who switches to imperial goes on reading kilometers until something
3533
+ * unrelated renders the surface again. Nothing throws and nothing is red; the numbers are just
3534
+ * wrong.
3535
+ *
3536
+ * The same cached getter is the server snapshot, for the reason `useStudioViewerEntitlement`
3537
+ * gives: the seam is the host's on the server too, and hydration expects the browser's viewer to
3538
+ * agree. Sharing the cache is what keeps both reads the same object.
3539
+ */
3540
+ declare const useStudioViewerPreferences: <TEntitlement extends string>(viewer: ViewerSeam<TEntitlement>) => ViewerPreferences | null;
3541
+ /**
3542
+ * useStudioViewerUnits resolves the viewer's preferences into the options every formatter takes.
3543
+ *
3544
+ * The snapshot is CACHED on the values it resolves to, and that is a requirement rather than
3545
+ * an optimisation. `useSyncExternalStore` compares snapshots with `Object.is` and renders again
3546
+ * when they differ, so a getter returning a fresh object literal every call differs from
3547
+ * itself on every check: React renders, reads again, differs again, and the component loops
3548
+ * until the browser gives up. Returning the SAME object while the values are unchanged is what
3549
+ * makes an object-valued snapshot legal at all.
3550
+ *
3551
+ * It also preserves the property the call sites depend on: the identity changes only when the
3552
+ * units do, so a memoized row formatting several metrics per candidate is not invalidated by an
3553
+ * unrelated render.
3554
+ *
3555
+ * The comparison walks the resolved object's own keys rather than naming them.
3556
+ * `UnitFormatOptions` is fully populated by `resolveViewerUnits` (every member has a value), so
3557
+ * the walk is exact, and it is the one form that cannot fall behind the shape. A named subset
3558
+ * would answer the STALE object for a change to a member it leaves out (a `pace` or a
3559
+ * `temperature`): every formatter in the studio would go on rendering the previous unit while
3560
+ * the store already held the new one, which reads as a preference control that does nothing.
3561
+ *
3562
+ * The same cached getter is the server snapshot, for the reason `useStudioViewerEntitlement`
3563
+ * gives: the seam is the host's on the server too, and hydration expects the browser's viewer to
3564
+ * agree. Sharing the cache is what keeps both reads the same object.
3565
+ */
3566
+ declare const useStudioViewerUnits: <TEntitlement extends string>(viewer: ViewerSeam<TEntitlement>) => UnitFormatOptions;
3567
+ /**
3568
+ * useStudioViewerUserId reads who is reading, and renders again when that changes.
3569
+ *
3570
+ * A session resolves after the studio mounts (the same reason the entitlement hook exists),
3571
+ * so a surface that captured `null` at mount would treat a signed-in viewer as anonymous for
3572
+ * as long as it stayed mounted.
3573
+ *
3574
+ * The same getter is the server snapshot, for the reason `useStudioViewerEntitlement` gives: the
3575
+ * seam is the host's on the server too, and hydration expects the browser's viewer to agree.
3576
+ *
3577
+ * @returns The viewer's user id, or null for an anonymous reader.
3578
+ */
3579
+ declare const useStudioViewerUserId: <TEntitlement extends string>(viewer: ViewerSeam<TEntitlement>) => string | null;
3580
+ /**
3581
+ * useUiStore selects a slice of the studio's state and re-renders when that slice changes.
3582
+ *
3583
+ * Change is `Object.is`, which makes the selector the whole performance contract: reading a slot
3584
+ * off the state re-renders on the write that touched it, and building a fresh object re-renders
3585
+ * on every write anywhere in the studio. The published `select*` helpers are written the first
3586
+ * way; a multi-field read wants {@link useUiStoreShallow}, which memoises the last result and
3587
+ * returns it unchanged when the members match.
3588
+ *
3589
+ * @param selector - Reads the slice off the studio's state.
3590
+ * @returns The slice.
3591
+ * @throws {MountayaElementsError} When no provider above the caller carries a store.
3592
+ */
3593
+ declare const useUiStore: <T>(selector: (state: UiStore) => T) => T;
3594
+ /**
3595
+ * useUiStoreApi returns the store handle itself: the same instance the tool bus mutates.
3596
+ *
3597
+ * The read-side seam for a surface that must follow a high-frequency slice without re-rendering:
3598
+ * subscribe imperatively, write to a canvas or a ref, and let React sit still. A video preview
3599
+ * advancing frame by frame repaints its overlay this way, where `useUiStore` would re-render the
3600
+ * tree once per frame to move one line.
3601
+ *
3602
+ * It is a READ seam. Writes go through the bus, which is what makes one dispatch surface serve
3603
+ * the user and the agent alike; a component calling `setState` on this handle has stepped
3604
+ * outside that and the bus will not know it happened.
3605
+ *
3606
+ * @throws {MountayaElementsError} When no provider above the caller carries a store.
3607
+ */
3608
+ declare const useUiStoreApi: () => UiStoreApi;
3609
+ /**
3610
+ * useUiStoreShallow selects several slots of the studio's state at once and re-renders only
3611
+ * when one of their VALUES changes.
3612
+ *
3613
+ * The selector may build a fresh object per call: that is the point. It still runs on every
3614
+ * notification, so it must stay cheap: read slots, do not compute.
3615
+ *
3616
+ * @param selector - Reads the slots off the studio's state; it may be written inline.
3617
+ * @returns The selector's answer, the previous object while its members match.
3618
+ * @throws {MountayaElementsError} When no provider above the caller carries a store.
3619
+ *
3620
+ * @example
3621
+ * ```tsx
3622
+ * const { agentDriving, locating } = useUiStoreShallow((state) => ({
3623
+ * agentDriving: state.agentDriving,
3624
+ * locating: state.locating,
3625
+ * }));
3626
+ * ```
3627
+ */
3628
+ declare const useUiStoreShallow: <T>(selector: (state: UiStore) => T) => T;
3629
+ /**
3630
+ * WaypointListModel is what {@link useWaypointList} hands a waypoint list: the rows to render,
3631
+ * the draft among them, who holds which row, and whether a run holds them all.
3632
+ */
3633
+ interface WaypointListModel {
3634
+ /** True while a run drives the workspace: every entry point into a new edit stands down. */
3635
+ readonly agentDriving: boolean;
3636
+ /**
3637
+ * Who holds each locked waypoint, keyed by waypoint id. Absent means free.
3638
+ *
3639
+ * Resolved for the whole list in one subscription rather than per row: asking per row is a
3640
+ * subscription per row, and turning an id into a NAME is a directory read the host would then
3641
+ * issue once for every row to answer a question that matters for one.
3642
+ */
3643
+ readonly lockHolderIds: ReadonlyMap<string, string>;
3644
+ /**
3645
+ * The saved waypoints, plus the in-flight create draft when one is open.
3646
+ *
3647
+ * The draft appears at the TAIL, which is where a newly-created waypoint lands, so the row a
3648
+ * user is naming does not jump position the moment it commits.
3649
+ */
3650
+ readonly rows: ItineraryViewSource["waypoints"];
3651
+ /** The id of the row standing for the open create session, or null. */
3652
+ readonly draftWaypointId: string | null;
3653
+ }
3654
+ /**
3655
+ * UseWaypointListOptions name the itinerary a waypoint list renders, and its saved waypoints.
3656
+ */
3657
+ interface UseWaypointListOptions {
3658
+ /** The itinerary whose waypoints the list renders. */
3659
+ readonly itineraryId: string;
3660
+ /** The SAVED waypoints, in position order. */
3661
+ readonly waypoints: ItineraryViewSource["waypoints"];
3662
+ }
3663
+ /**
3664
+ * useWaypointList is the list's own derivations: what to render, and who holds what.
3665
+ *
3666
+ * **The draft row is synthesised, and only for a create session the chain does not already
3667
+ * carry.** A user authoring a waypoint from scratch picks its icon, colour and name before the
3668
+ * first map click lands, and without a row to show that on they would be editing something
3669
+ * invisible. An `update` session always targets a saved row, so synthesising for one would
3670
+ * render the same waypoint twice.
3671
+ *
3672
+ * The session reads are narrow and separate rather than one object selector. Each returns a
3673
+ * slot (a primitive or a stored reference), so none of them can allocate, which is the one way
3674
+ * a store selector goes wrong: React refuses a snapshot that never settles.
3675
+ *
3676
+ * @param options - The itinerary and its saved waypoints; see {@link UseWaypointListOptions}.
3677
+ * @returns The {@link WaypointListModel}, whose `rows` is `waypoints` itself while no create
3678
+ * draft is open.
3679
+ */
3680
+ declare const useWaypointList: ({ itineraryId, waypoints }: UseWaypointListOptions) => WaypointListModel;
3681
+ /**
3682
+ * UseWaypointRowActionsOptions say which BACKEND a row's verbs reach.
3683
+ *
3684
+ * `session: true` sends them to the in-flight create session's own draft, which lives in the
3685
+ * store and has no server identity yet. Everything else reaches the persisted tools: with an
3686
+ * itinerary id they write through, and with an empty one they reach a host's draft sink, which
3687
+ * keys on the waypoint's client id. The three destinations differ only in the tool NAME and the
3688
+ * scope, which is exactly why they belong in one place: a surface choosing between them at
3689
+ * several call sites is a surface that will eventually choose differently in one of them.
3690
+ */
3691
+ interface UseWaypointRowActionsOptions {
3692
+ /** The itinerary a persisted mutation is scoped to. Empty for a host-side draft. */
3693
+ readonly itineraryId: string;
3694
+ /** Whether the row stands for the in-flight create session's draft. */
3695
+ readonly session?: boolean | undefined;
3696
+ /** The waypoint the verbs act on. */
3697
+ readonly waypointId: string;
3698
+ }
3699
+ /**
3700
+ * WaypointRowVerb names the verbs whose refusal a waypoint row hands its caller.
3701
+ *
3702
+ * A closed union, so a consumer's switch over it is exhaustive. `move` is raised by the row
3703
+ * opening its move session, which the one-edit-at-a-time gate refuses while another engine is
3704
+ * armed; the others by {@link useWaypointRowActions}.
3705
+ */
3706
+ type WaypointRowVerb = "move" | "recolor" | "remove" | "rename" | "setIcon";
3707
+ /** A refusal of a waypoint row's verb, and the verb it came from. */
3708
+ interface WaypointRowFailure {
3709
+ /** The refusal the bus answered. */
3710
+ readonly result: ToolResult;
3711
+ /** The verb that was refused. */
3712
+ readonly verb: WaypointRowVerb;
3713
+ }
3714
+ /** WaypointRowActions are the verbs of one waypoint row, and the last refusal among them. */
3715
+ interface WaypointRowActions {
3716
+ /**
3717
+ * The last refusal, naming the verb it came from, or null.
3718
+ *
3719
+ * Returned rather than raised, because where a refusal belongs on screen is a rendering
3720
+ * decision. A write the API refused, a collaborator's lock or a staged draft's save in flight
3721
+ * refuses a verb, and a delete refused so brings the marker back with nothing said unless the
3722
+ * row says it. A success clears it, and so does a withheld confirmation
3723
+ * ({@link isConfirmationWithheld}), since the verb never ran.
3724
+ */
3725
+ readonly lastFailure: WaypointRowFailure | null;
3726
+ /** Recolours the waypoint. */
3727
+ readonly recolor: (color: string) => Promise<void>;
3728
+ /** Deletes the waypoint, or cancels the create session on a draft's row. */
3729
+ readonly remove: () => Promise<void>;
3730
+ /** Renames the waypoint. A name of spaces alone dispatches nothing: the field was abandoned. */
3731
+ readonly rename: (name: string) => Promise<void>;
3732
+ /** Changes the waypoint's icon. */
3733
+ readonly setIcon: (icon: UserWaypointIcon) => Promise<void>;
3734
+ }
3735
+ /**
3736
+ * useWaypointRowActions is every mutation one waypoint row can dispatch, as a bundle.
3737
+ *
3738
+ * Grouped here rather than left inline in a row so a row's render path reads as layout and its
3739
+ * mutations read as a list of verbs, and so that every one of them provably goes through the
3740
+ * bus in one place. That second reason is the load-bearing one: a row reaching into a store
3741
+ * for "just this one" would bypass the schema, the capability gate and the confirmation
3742
+ * protocol, and it would bypass them invisibly.
3743
+ *
3744
+ * Each verb keeps its last refusal as `lastFailure`, as the segment row's do.
3745
+ *
3746
+ * On a create session's row, `remove` is the session's cancel: it dispatches
3747
+ * `studio.itinerary.waypoint.editCancel`, asks no confirmation and reaches no persistence.
3748
+ *
3749
+ * @returns The {@link WaypointRowActions} of the row.
3750
+ */
3751
+ declare const useWaypointRowActions: ({ itineraryId, session, waypointId }: UseWaypointRowActionsOptions) => WaypointRowActions;
3752
+ /**
3753
+ * UseWaypointRowOptions are what a waypoint row cannot derive for itself.
3754
+ *
3755
+ * The two hints are RESOLVED SENTENCES: a peer's hold can name a person, which means a directory
3756
+ * read the host owns, and a run's is static copy. Passing null for either says that state cannot
3757
+ * arise on this surface: a read-only list has no run lock, a single-player one no peers.
3758
+ *
3759
+ * `waypoint` is the saved record a move session seeds from, and its absence is what says this row
3760
+ * has no persisted geometry to move: an in-flight create and an import proposal both pass null,
3761
+ * and neither offers the verb.
3762
+ */
3763
+ interface UseWaypointRowOptions {
3764
+ /** The sentence a row shows while a run drives the studio, or null where none can. */
3765
+ readonly agentLockHint?: string | null | undefined;
3766
+ /** The itinerary the row belongs to. Undefined for a draft's row, whose id is on no tile. */
3767
+ readonly itineraryId?: string | undefined;
3768
+ /**
3769
+ * A refusal of one of the row's verbs, handed back rather than raised, with the verb it came
3770
+ * from.
3771
+ *
3772
+ * The one-edit-at-a-time gate declines a move while another engine is armed, and a write the
3773
+ * API refused, a collaborator's lock or a staged draft's save in flight declines a rename, a
3774
+ * recolour, an icon or a delete. A click that silently does nothing reads as the studio having
3775
+ * missed it. Where a refusal belongs on screen is a rendering decision, and phrasing one needs
3776
+ * the translation runtime this package does not carry, so it crosses as the result, and the
3777
+ * host words it by its verb.
3778
+ *
3779
+ * A withheld confirmation is never handed on: the verb never ran. Read when a refusal lands,
3780
+ * so a handler written inline moves none of the row's callbacks.
3781
+ */
3782
+ readonly onFailure?: ((failure: WaypointRowFailure) => void) | undefined;
3783
+ /** The sentence a row shows while a peer holds the waypoint, or null where none can. */
3784
+ readonly peerLockHint?: string | null | undefined;
3785
+ /** Routes the metadata verbs at the create session's own draft rather than at the server. */
3786
+ readonly session?: boolean | undefined;
3787
+ /** The saved record a move seeds from, or null for a row with no persisted geometry. */
3788
+ readonly waypoint?: Parameters<ReturnType<typeof useBeginWaypointEdit>>[0] | null | undefined;
3789
+ /** The waypoint the row stands for. */
3790
+ readonly waypointId: string;
3791
+ }
3792
+ /**
3793
+ * WaypointRowModel is everything a waypoint row is, minus the markup: its verbs, the move and
3794
+ * its cancel, the hover state and the sentence a held row speaks with.
3795
+ */
3796
+ interface WaypointRowModel<TElement extends HTMLElement = HTMLDivElement> {
3797
+ /** The row's verbs, each bound to its itinerary and waypoint. */
3798
+ readonly actions: WaypointRowActions;
3799
+ /**
3800
+ * Opens the move session, deferred so a double-click can cancel it, or undefined when this
3801
+ * row has no persisted geometry to move.
3802
+ *
3803
+ * Undefined rather than a no-op, because a caller wires it to a body click and to a menu item,
3804
+ * and both should be ABSENT rather than inert on a row where the verb does not exist.
3805
+ */
3806
+ readonly moveOnMap: (() => void) | undefined;
3807
+ /** The resolved sentence holding this row, or null when it is free. */
3808
+ readonly lockHint: string | null;
3809
+ /**
3810
+ * Cancels a move the single click scheduled, for a rename that arrived instead.
3811
+ *
3812
+ * The layout owns the double-click, so the row learns the rename opened through its
3813
+ * `onStartRename` report and cancels here: the two halves of one gesture.
3814
+ */
3815
+ readonly cancelMove: () => void;
3816
+ /**
3817
+ * Runs a body action on the same delay {@link moveOnMap} takes, so a caller that replaces what
3818
+ * a single click does inherits the rename carve-out rather than deriving it again.
3819
+ *
3820
+ * Without it, a surface wiring its own body action gets that action AND a rename on every
3821
+ * double-click, which is the exact bug the deferred move exists to prevent, brought back by
3822
+ * whoever wired the replacement.
3823
+ */
3824
+ readonly deferBodyClick: (action: () => void) => void;
3825
+ /** True while the pointer is over THIS waypoint's marker on the map. */
3826
+ readonly mapHovered: boolean;
3827
+ /**
3828
+ * What a `waypoint.menu` plugin contribution acts on, held stable.
3829
+ *
3830
+ * Memoized here rather than at the call site because the row is memoized and a list maps over
3831
+ * it: a fresh literal per render would compare unequal every time and defeat the memo on every
3832
+ * row at once.
3833
+ */
3834
+ readonly pluginTarget: StudioPluginTarget<"waypoint.menu">;
3835
+ /** The ref to hang on the row element, which the map hover scrolls into view. */
3836
+ readonly rowRef: RefObject<TElement | null>;
3837
+ /** Emphasises the waypoint's marker on the map. */
3838
+ readonly onMouseEnter: () => void;
3839
+ /** Gives the itinerary its emphasis back. */
3840
+ readonly onMouseLeave: () => void;
3841
+ }
3842
+ /**
3843
+ * useWaypointRow is the whole of a waypoint row that is not markup: its verbs, the move
3844
+ * session's deferred open, the hover surfaces of the row and of the map, and the sentence a
3845
+ * held row speaks with.
3846
+ *
3847
+ * **Hovering the row emphasises its marker on the map, and leaving restores the itinerary's.**
3848
+ * That pairing is the reason it lives here rather than at a call site: a row that emphasised on
3849
+ * enter and forgot to restore on leave leaves the map dimmed around one marker forever, and the
3850
+ * bug is invisible until a user moves the pointer away. A row unmounted under the pointer
3851
+ * restores it too. A row with no `itineraryId` is a draft's, whose id is on no tile: it sends
3852
+ * the map no emphasis, since one that lights nothing dims every marker.
3853
+ *
3854
+ * A peer's hold outranks a run's, because it can name a person; with neither, the row is free.
3855
+ *
3856
+ * @returns The {@link WaypointRowModel} a renderer draws from.
3857
+ */
3858
+ declare const useWaypointRow: <TElement extends HTMLElement = HTMLDivElement>({ agentLockHint, itineraryId, onFailure, peerLockHint, session, waypoint, waypointId }: UseWaypointRowOptions) => WaypointRowModel<TElement>;
3859
+ /**
3860
+ * MountayaStudioProviderProps is what {@link MountayaStudioProvider} takes: the groups
3861
+ * `StudioProvider` takes, and the map and the client the elements read.
3862
+ */
3863
+ interface MountayaStudioProviderProps<TCtx extends ToolBusContext = ToolBusContext> extends StudioProviderProps<TCtx> {
3864
+ /**
3865
+ * The client an element resolves an id through, when it is handed one instead of geometry.
3866
+ *
3867
+ * Top-level rather than in `data`, matching `MountayaStudioHost`: it is the one thing a
3868
+ * surface reading Mountaya data cannot be mounted without.
3869
+ */
3870
+ readonly client?: MountayaElementsProviderProps$1["client"];
3871
+ /**
3872
+ * The map the controls drive, when there is one.
3873
+ *
3874
+ * Top-level because it is the seam this component exists to add: the studio half has no map
3875
+ * and the elements half is nothing without one, so burying it in a group would hide the
3876
+ * difference between the two providers this composes.
3877
+ */
3878
+ readonly map?: MountayaElementsProviderProps$1["map"];
3879
+ }
3880
+ /**
3881
+ * MountayaStudioProvider is both providers, mounted once.
3882
+ *
3883
+ * A studio needs seams from two places: those an ELEMENT needs (a map, a glyph set, copy) and
3884
+ * those a studio adds on top (a bus, the capabilities the surface holds, and the store the bus
3885
+ * writes). Those are genuinely two concerns, which is why they are two contexts and stay two
3886
+ * contexts: a page that renders a zoom control and no studio mounts one of them. Composing a
3887
+ * studio always means both, so this is one component, the union of both prop sets, and no
3888
+ * chance of mounting the outer one and forgetting the inner.
3889
+ *
3890
+ * Both halves stay exported. A surface that wants the elements without the studio (a report, a
3891
+ * print view, a dashboard card with an elevation profile) mounts {@link MountayaElementsProvider}
3892
+ * alone, and a surface embedding a studio inside a tree that already has the elements mounts
3893
+ * {@link StudioProvider} alone.
3894
+ *
3895
+ * The studio nests INSIDE the elements, and the nesting is not arbitrary even though the two
3896
+ * contexts never read each other: a studio surface is always drawn with elements around it,
3897
+ * never the reverse, and a consumer stays free to mount a second `StudioProvider` deeper down (a
3898
+ * modal editing a different resource with narrower capabilities) over the same element seams.
3899
+ *
3900
+ * @example
3901
+ * ```tsx
3902
+ * import type { Mountaya } from "@mountaya/client";
3903
+ * import type { MountayaMap } from "@mountaya/elements";
3904
+ * import type { StudioToolContext, ToolBus, UiStoreApi } from "@mountaya/studio";
3905
+ * import type { ReactNode } from "react";
3906
+ *
3907
+ * declare const bus: ToolBus<StudioToolContext>;
3908
+ * declare const client: Mountaya;
3909
+ * declare const map: MountayaMap;
3910
+ * declare const store: UiStoreApi;
3911
+ * declare const surface: ReactNode;
3912
+ * declare const toolContext: StudioToolContext;
3913
+ *
3914
+ * <MountayaStudioProvider
3915
+ * client={client}
3916
+ * data={{ bus, capabilities: ["authenticated", "editor"], context: toolContext, store }}
3917
+ * map={map}
3918
+ * >
3919
+ * {surface}
3920
+ * </MountayaStudioProvider>;
3921
+ * ```
3922
+ */
3923
+ declare const MountayaStudioProvider: <TCtx extends ToolBusContext = ToolBusContext>({ appearance, assets, behavior, children, client, i18n, map, ...studio }: MountayaStudioProviderProps<TCtx>) => ReactNode;
3924
+ /** The props of {@link StudioNavigationBlockerProvider}. */
3925
+ interface StudioNavigationBlockerProviderProps {
3926
+ /** The host's router binding, handed on as it is given. */
3927
+ readonly blocker: StudioNavigationBlocker;
3928
+ /** The guards that read the binding. */
3929
+ readonly children: ReactNode;
3930
+ }
3931
+ /**
3932
+ * StudioNavigationBlockerProvider supplies the host's router binding to every guard beneath it.
3933
+ *
3934
+ * `blocker` is handed on as it is given, and held by nothing here: a guard reads the binding
3935
+ * again whenever the function is a new one. A binding declared once, at module scope or under
3936
+ * `useCallback`, renders no guard of its own accord.
3937
+ */
3938
+ declare const StudioNavigationBlockerProvider: ({ blocker, children }: StudioNavigationBlockerProviderProps) => import("react").JSX.Element;
3939
+ /**
3940
+ * useStudioNavigationBlock holds a departure the studio is not ready to allow.
3941
+ *
3942
+ * Two gates, and only one of them needs a host. `blockUnload` is the browser's own close-tab
3943
+ * prompt, which is a DOM API and is wired here, so a studio with no host binding still catches
3944
+ * the reader who closes the tab mid-edit, which is the half that actually loses work.
3945
+ * `shouldBlock` is IN-APP navigation, which only the host's router can intercept; with no
3946
+ * binding nothing is held and the reader leaves.
3947
+ *
3948
+ * Both predicates are read at fire time through a ref rather than captured, so a guard may read
3949
+ * live store state (an engine armed a moment ago, a run that has just ended) without attaching
3950
+ * the browser listener again on every render.
3951
+ *
3952
+ * @returns The hold the host's router binding answers, or one that holds nothing where no
3953
+ * binding is mounted.
3954
+ */
3955
+ declare const useStudioNavigationBlock: ({ blockUnload, shouldBlock }: {
3956
+ readonly blockUnload: () => boolean;
3957
+ readonly shouldBlock: (attempt: StudioNavigationAttempt) => boolean;
3958
+ }) => StudioNavigationHold;
3959
+ /** The props of {@link StudioNotifyProvider}. */
3960
+ interface StudioNotifyProviderProps {
3961
+ /** The surfaces that raise a notification. */
3962
+ readonly children: ReactNode;
3963
+ /** The host's notification surface, handed on as it is given. */
3964
+ readonly notify: StudioNotify;
3965
+ }
3966
+ /**
3967
+ * StudioNotifyProvider supplies the host's notification surface to everything beneath it.
3968
+ *
3969
+ * `notify` is handed on as it is given, and held by nothing here: a surface that reads it
3970
+ * renders again whenever the object is a new one, so a host declares it once.
3971
+ */
3972
+ declare const StudioNotifyProvider: ({ children, notify }: StudioNotifyProviderProps) => import("react").JSX.Element;
3973
+ /** useStudioNotify reads the host's notification surface. */
3974
+ declare const useStudioNotify: () => StudioNotify;
3975
+ export { SegmentRow as $, StudioCopilotSeam as $n, StudioControlAnchors as $t, useStudioUrl as A, StudioTokens as An, useEditActions as At, useStudioDispatchUnsafe as B, StudioReactPluginSubject as Bn, useAgentDriving as Bt, useStudioViewerUserId as C, useStudioMapSeams as Cn, UseInlineRenameOptions as Ct, useStudioViewerEntitlement as D, useStudioTokens as Dn, EditActionsModel as Dt, useStudioViewerItineraryLimit as E, useStudioStrings as En, useEscapeKey as Et, StudioFailureReporter as F, StudioPluginsProvider as Fn, usePeerLockHolderId as Ft, useStudioApi as G, StudioOrganizationsProviderProps as Gn, StudioHostAppearanceConfig as Gt, StudioDispatchOverrides as H, OrganizationScopeOption as Hn, StudioAssetsConfig as Ht, useStudioFailureAlert as I, StudioPluginsProviderProps as In, BeginWaypointEdit as It, useStreetViewCorridor as J, useStudioOrganizations as Jn, StudioI18nConfig as Jt, STREETVIEW_CORRIDOR_METERS as K, StudioWritableOrganizations as Kn, StudioHostBehaviorConfig as Kt, useStudioEntitlement as L, StudioReactPlugin as Ln, useBeginWaypointEdit as Lt, useStudioSignedIn as M, StudioPluginErrorReporter as Mn, useActiveCollabResources as Mt, useStudioPreferences as N, StudioPluginFailure as Nn, useActiveItineraryResource as Nt, useStudioViewer as O, useStudioToolContext as On, SegmentDraftSource as Ot, useStudioObserve as P, StudioPluginsBinding as Pn, useActiveZoneResource as Pt, useShallowSelector as Q, StudioCopilotProviderProps as Qn, StudioContextValue as Qt, StudioDispatchUnsafeFn as R, StudioReactPluginContribution as Rn, BeginSegmentEdit as Rt, useUiStoreApi as S, useStudioLinks as Sn, InlineRename as St, useStudioViewerPreferences as T, useStudioStorage as Tn, useInlineRename as Tt, UseStudioDispatch as U, StudioOrganizations as Un, StudioBehaviorConfig as Ut, StudioDispatchFn as V, useStudioPlugins as Vn, StudioAppearanceConfig as Vt, useStudioDispatch as W, StudioOrganizationsProvider as Wn, StudioDataConfig as Wt, ReadableStore as X, CopilotAvailability as Xn, StudioVideoConfig as Xt, useStoreSlice as Y, useStudioWritableOrganizations as Yn, StudioPluginsConfig as Yt, useStudioStore as Z, StudioCopilotProvider as Zn, NavigationSeam as Zt, UseWaypointListOptions as _, useStudioGeolocation as _n, usePlatformViewer as _t, StudioNavigationBlockerProviderProps as a, StudioProviderProps as an, StudioBillingGateProvider as ar, SegmentSeamModel as at, useUiStoreShallow as b, useStudioLanguages as bn, useLiveAwareSegments as bt, MountayaStudioProviderProps as c, useStudioActivities as cn, StudioBillingSubject as cr, SegmentRowActions as ct, useWaypointRow as d, useStudioClock as dn, StudioHeaderOverride as dr, UseSegmentRowActionsOptions as dt, StudioControlKind as en, useCopilotAvailability as er, SegmentRowPostureState as et, UseWaypointRowActionsOptions as f, useStudioContext as fn, isStudioHeaderBrand as fr, useSegmentRowActions as ft, useWaypointRowActions as g, useStudioFormatters as gn, UsePlatformViewerOptions as gt, WaypointRowVerb as h, useStudioDensity as hn, useStudioResourceKey as hr, PlatformViewerState as ht, StudioNavigationBlockerProvider as i, StudioProviderDataConfig as in, StudioBillingGate as ir, SegmentListModel as it, useStudioUnits as j, StudioDensity as jn, useCollectionScope as jt, useStudioUserId as k, StudioTokenName as kn, UseEditActionsOptions as kt, UseWaypointRowOptions as l, useStudioActivityIconUrl as ln, useStudioBillingGate as lr, SegmentRowFailure as lt, WaypointRowFailure as m, useStudioDemUrl as mn, useStudioCache as mr, usePluginSlot as mt, StudioNotifyProviderProps as n, StudioPeerNameSeam as nn, useCopilotSetupAction as nr, useSegmentRow as nt, useStudioNavigationBlock as o, StudioSeamOverrides as on, StudioBillingGateProviderProps as or, UseSegmentListOptions as ot, WaypointRowActions as p, useStudioControlAnchors as pn, createStudioCache as pr, StudioPluginItem as pt, StreetViewCorridor as q, WritableOrganizationOption as qn, StudioHostDataConfig as qt, useStudioNotify as r, StudioProvider as rn, useCopilotWithheldNotice as rr, SegmentListActions as rt, MountayaStudioProvider as s, useCapability as sn, StudioBillingGateSeam as sr, useSegmentList as st, StudioNotifyProvider as t, StudioLayerKind as tn, useCopilotModelLine as tr, UseSegmentRowOptions as tt, WaypointRowModel as u, useStudioAppOrigin as un, StudioHeaderBrand as ur, SegmentRowVerb as ut, WaypointListModel as v, useStudioHeader as vn, MapHoveredRow as vt, useStudioViewerUnits as w, useStudioPeerName as wn, useDeferredClick as wt, useUiStore as x, useStudioLayerThumbnail as xn, DeferredClick as xt, useWaypointList as y, useStudioLanguageMark as yn, useMapHoveredRow as yt, UseStudioDispatchUnsafe as z, StudioReactPluginEntry as zn, useBeginSegmentEdit as zt };
3976
+ //# sourceMappingURL=chunk-B38srE2R.d.cts.map