@jxsuite/studio 6.1.0 → 6.1.2

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 (645) hide show
  1. package/dist/chunks/2020-f2gkpy8d.js +4 -0
  2. package/dist/chunks/{action-group-2mqby73c.js → action-group-4aan7g6g.js} +3 -3
  3. package/dist/chunks/adapter-4912g339.js +4 -0
  4. package/dist/chunks/cf-account-picker-wccaenh6.js +4 -0
  5. package/dist/chunks/cf-settings-br6105tr.js +4 -0
  6. package/dist/chunks/color-28ksk2qm.js +4 -0
  7. package/dist/chunks/color-area-0fj8a4ga.js +4 -0
  8. package/dist/chunks/color-field-xch8kx2g.js +4 -0
  9. package/dist/chunks/color-slider-jxd8v350.js +4 -0
  10. package/dist/chunks/combobox-p0efwjke.js +4 -0
  11. package/dist/chunks/components-db68vsn7.js +4 -0
  12. package/dist/chunks/content-source-1449qesq.js +4 -0
  13. package/dist/chunks/convert-to-repeater-5h457egj.js +4 -0
  14. package/dist/chunks/dialog-c4x05vyx.js +4 -0
  15. package/dist/chunks/editor-x9jn86a7.js +4 -0
  16. package/dist/chunks/entry-commands-may24cpt.js +4 -0
  17. package/dist/chunks/extension-sections-pvr14vxr.js +4 -0
  18. package/dist/chunks/file-ops-x9v54pcj.js +4 -0
  19. package/dist/chunks/files-j3knqf0s.js +4 -0
  20. package/dist/chunks/format-host-tyre2trb.js +4 -0
  21. package/dist/chunks/fs-events-64ma9htc.js +4 -0
  22. package/dist/chunks/git-panel-84ps5dex.js +4 -0
  23. package/dist/chunks/grid-view-d2wq9ezg.js +51 -0
  24. package/dist/chunks/icons-pnfz478q.js +4 -0
  25. package/dist/chunks/iframe-entry-fvbk89gm.js +5 -0
  26. package/dist/chunks/iframe-entry-jdcktez8.js +5 -0
  27. package/dist/chunks/iframe-entry-x0ygf2yr.js +5 -0
  28. package/dist/chunks/iframe-entry-zap785cw.js +5 -0
  29. package/dist/chunks/iframe-host-ck6vejt5.js +4 -0
  30. package/dist/chunks/index-b8xw3vy9.js +4 -0
  31. package/dist/chunks/{index-gybvv7a6.js → index-zpjmzqfk.js} +3 -3
  32. package/dist/chunks/{javascript-rnvdp3k4.js → javascript-m54mnwp6.js} +3 -3
  33. package/dist/chunks/jsonMode-w15cmrcm.js +13 -0
  34. package/dist/chunks/jx-validate-at3zn8wa.js +4 -0
  35. package/dist/chunks/layers-h4xp1pss.js +4 -0
  36. package/dist/chunks/layers-panel-m5hw1d7g.js +4 -0
  37. package/dist/chunks/listbox-e74qjyq6.js +4 -0
  38. package/dist/chunks/lit-html-8t8t3dnr.js +4 -0
  39. package/dist/chunks/media-picker-2cweexc5.js +4 -0
  40. package/dist/chunks/menu-n6yzswmy.js +4 -0
  41. package/dist/chunks/menu-ynw13y0s.js +4 -0
  42. package/dist/chunks/monaco-binding-7gx83x3r.js +4 -0
  43. package/dist/chunks/monaco-buffer-qzxn567r.js +4 -0
  44. package/dist/chunks/monaco-setup-gxf6656g.js +4 -0
  45. package/dist/chunks/notify-cj5zbrs2.js +4 -0
  46. package/dist/chunks/number-field-y62xq0ty.js +4 -0
  47. package/dist/chunks/parse-b7ddhr8m.js +4 -0
  48. package/dist/chunks/platform-3dfws9js.js +4 -0
  49. package/dist/chunks/popover-jt2gxmzs.js +4 -0
  50. package/dist/chunks/publish-panel-1gvxbj21.js +4 -0
  51. package/dist/chunks/quick-search-0dajrwqg.js +4 -0
  52. package/dist/chunks/references-49qgt404.js +4 -0
  53. package/dist/chunks/right-panel-jm1bwe53.js +4 -0
  54. package/dist/chunks/section-registry-6kwc4fky.js +4 -0
  55. package/dist/chunks/select-rzds841e.js +4 -0
  56. package/dist/chunks/split-n2gfpm5m.js +4 -0
  57. package/dist/chunks/{studio-5g0ag7c0.js → studio-0q988f9w.js} +3 -3
  58. package/dist/chunks/studio-0rt52vpq.js +5 -0
  59. package/dist/chunks/studio-18vgbhs5.js +5 -0
  60. package/dist/chunks/{studio-pxg4ap1e.js → studio-1fxkaaea.js} +4 -4
  61. package/dist/chunks/studio-24mccdrj.js +5 -0
  62. package/dist/chunks/studio-2eh507zk.js +9 -0
  63. package/dist/chunks/studio-2hcbccfv.js +5 -0
  64. package/dist/chunks/studio-2j1cb95x.js +5 -0
  65. package/dist/chunks/studio-2jbs3rxv.js +5 -0
  66. package/dist/chunks/{studio-qbj760tx.js → studio-485046te.js} +7 -7
  67. package/dist/chunks/studio-4h8k4dw9.js +5 -0
  68. package/dist/chunks/studio-5f6n18kx.js +5 -0
  69. package/dist/chunks/studio-5gthpky6.js +5 -0
  70. package/dist/chunks/studio-5ve6bbep.js +5 -0
  71. package/dist/chunks/studio-6ep3js6b.js +9 -0
  72. package/dist/chunks/studio-6wkmf3wz.js +9 -0
  73. package/dist/chunks/studio-841rf3cg.js +5 -0
  74. package/dist/chunks/studio-8gmwgheg.js +5 -0
  75. package/dist/chunks/studio-8qm0ep50.js +5 -0
  76. package/dist/chunks/{studio-anyrgzvb.js → studio-90pq9km1.js} +4 -4
  77. package/dist/chunks/studio-924p1tm1.js +6 -0
  78. package/dist/chunks/{studio-v2bvmbjj.js → studio-a3g98wjr.js} +4 -4
  79. package/dist/chunks/studio-a3shpz9y.js +5 -0
  80. package/dist/chunks/studio-amsbaaar.js +6 -0
  81. package/dist/chunks/studio-at5spjbc.js +7 -0
  82. package/dist/chunks/studio-b2xv945e.js +5 -0
  83. package/dist/chunks/studio-bn5nkafw.js +5 -0
  84. package/dist/chunks/studio-bw6q5xjf.js +9 -0
  85. package/dist/chunks/studio-c7q0t9x1.js +5 -0
  86. package/dist/chunks/studio-camnhc96.js +6 -0
  87. package/dist/chunks/studio-cffqvnzd.js +5 -0
  88. package/dist/chunks/studio-d81xfh1g.js +5 -0
  89. package/dist/chunks/studio-dgz8d0c1.js +5 -0
  90. package/dist/chunks/studio-efvfrsf8.js +5 -0
  91. package/dist/chunks/studio-er30bpcx.js +5 -0
  92. package/dist/chunks/studio-ezscgr64.js +5 -0
  93. package/dist/chunks/studio-ffrrncvz.js +5 -0
  94. package/dist/chunks/studio-fpphgn8y.js +10 -0
  95. package/dist/chunks/studio-j1kvhdjk.js +4 -0
  96. package/dist/chunks/{studio-txjjzrsm.js → studio-j430n16g.js} +5 -5
  97. package/dist/chunks/studio-jjkg84nj.js +5 -0
  98. package/dist/chunks/studio-m0q32ars.js +4 -0
  99. package/dist/chunks/studio-m6bdst11.js +5 -0
  100. package/dist/chunks/studio-nv2cptd4.js +64 -0
  101. package/dist/chunks/studio-nwfrc98n.js +5 -0
  102. package/dist/chunks/studio-p1wgvp7r.js +5 -0
  103. package/dist/chunks/studio-pag2wncm.js +5 -0
  104. package/dist/chunks/studio-qvanvzfd.js +5 -0
  105. package/dist/chunks/studio-qwa64kt7.js +5 -0
  106. package/dist/chunks/studio-rk1zc4x3.js +928 -0
  107. package/dist/chunks/studio-se2r3ptc.js +5 -0
  108. package/dist/chunks/studio-sg2a0dh0.js +5 -0
  109. package/dist/chunks/studio-tjzjhe68.js +5 -0
  110. package/dist/chunks/{studio-0x3jyb8r.js → studio-tq0rtfwj.js} +4 -4
  111. package/dist/chunks/{studio-cpxkgjrj.js → studio-v0jzqdjm.js} +4 -4
  112. package/dist/chunks/studio-v2w7q8r1.js +7 -0
  113. package/dist/chunks/studio-v5vjq1h0.js +4 -0
  114. package/dist/chunks/studio-v8aga3vp.js +14 -0
  115. package/dist/chunks/studio-vfcdrfmv.js +5 -0
  116. package/dist/chunks/studio-vmfkgdjf.js +5 -0
  117. package/dist/chunks/studio-wt1816jj.js +5 -0
  118. package/dist/chunks/studio-wz73q5kq.js +4 -0
  119. package/dist/chunks/studio-y04qtxvp.js +7 -0
  120. package/dist/chunks/studio-y21g8zzg.js +5 -0
  121. package/dist/chunks/studio-y64hrt8p.js +12 -0
  122. package/dist/chunks/studio-ynn90f58.js +16 -0
  123. package/dist/chunks/studio-yxz682sx.js +5 -0
  124. package/dist/chunks/studio-zp7snvkq.js +5 -0
  125. package/dist/chunks/studio-zq4z6tm6.js +5 -0
  126. package/dist/chunks/swatch-group-ewh24n1f.js +4 -0
  127. package/dist/chunks/tabs-f5cw3tgp.js +4 -0
  128. package/dist/chunks/textfield-wewc8rq2.js +4 -0
  129. package/dist/chunks/toast-c9fn075p.js +4 -0
  130. package/dist/chunks/toast-host-ke5z4ng7.js +4 -0
  131. package/dist/chunks/{toolbar-2nnzqhrj.js → toolbar-44cm5cta.js} +3 -3
  132. package/dist/chunks/tooltip-5v8ngwj2.js +4 -0
  133. package/dist/chunks/tree-mdq3v5cw.js +4 -0
  134. package/dist/chunks/tsMode-sf49ee9x.js +14 -0
  135. package/dist/chunks/workspace-jtfahpee.js +4 -0
  136. package/dist/chunks/ws-client-nze0k6mv.js +4 -0
  137. package/dist/iframe-entry.js +16 -16
  138. package/dist/manifest.json +63 -63
  139. package/dist/studio.js +98 -98
  140. package/dist/workers/ts.worker.js +3 -3
  141. package/package.json +11 -11
  142. package/src/about/about-modal.ts +4 -3
  143. package/src/account/action-flow.ts +45 -38
  144. package/src/account-status.ts +7 -2
  145. package/src/browse/library-layouts.ts +8 -5
  146. package/src/browse/library-model.ts +18 -6
  147. package/src/browse/library-pane.ts +37 -21
  148. package/src/browse/library-preview.ts +14 -9
  149. package/src/browse/library-source.ts +1 -1
  150. package/src/canvas/asset-refs.ts +24 -9
  151. package/src/canvas/asset-resolve.ts +19 -23
  152. package/src/canvas/canvas-helpers.ts +7 -6
  153. package/src/canvas/canvas-live-render.ts +44 -53
  154. package/src/canvas/canvas-patcher.ts +30 -30
  155. package/src/canvas/canvas-perf.ts +11 -5
  156. package/src/canvas/canvas-render.ts +66 -42
  157. package/src/canvas/canvas-surface.ts +5 -3
  158. package/src/canvas/canvas-utils.ts +163 -64
  159. package/src/canvas/dialog-path.ts +9 -4
  160. package/src/canvas/dialog-state.ts +1 -2
  161. package/src/canvas/diff-marks.ts +9 -16
  162. package/src/canvas/diff-toolbar.ts +8 -7
  163. package/src/canvas/edit-width-drag.ts +4 -1
  164. package/src/canvas/edit-width.ts +1 -3
  165. package/src/canvas/iframe-channel.ts +27 -13
  166. package/src/canvas/iframe-drop.ts +13 -12
  167. package/src/canvas/iframe-editable-root.ts +29 -16
  168. package/src/canvas/iframe-entry.ts +80 -63
  169. package/src/canvas/iframe-eval.ts +73 -49
  170. package/src/canvas/iframe-host.ts +203 -118
  171. package/src/canvas/iframe-inline-edit.ts +69 -32
  172. package/src/canvas/iframe-insert.ts +5 -4
  173. package/src/canvas/iframe-interaction.ts +37 -26
  174. package/src/canvas/iframe-overlay.ts +1 -1
  175. package/src/canvas/iframe-patch.ts +18 -15
  176. package/src/canvas/iframe-position.ts +12 -6
  177. package/src/canvas/iframe-protocol.ts +15 -16
  178. package/src/canvas/iframe-render.ts +41 -36
  179. package/src/canvas/iframe-slash.ts +24 -11
  180. package/src/canvas/iframe-subtree.ts +6 -2
  181. package/src/canvas/path-mapping.ts +19 -12
  182. package/src/canvas/popover-path.ts +7 -3
  183. package/src/canvas/popover-state.ts +1 -2
  184. package/src/canvas/serialize-scope.ts +13 -5
  185. package/src/canvas/stage-scrollbar.ts +2 -1
  186. package/src/canvas/surface-registry.ts +21 -3
  187. package/src/collab/collab-commands.ts +7 -2
  188. package/src/collab/collab-session.ts +84 -45
  189. package/src/collab/collab-state.ts +4 -3
  190. package/src/collab/monaco-binding.ts +16 -13
  191. package/src/collab/monaco-cursors.ts +5 -2
  192. package/src/commands/budget.ts +3 -3
  193. package/src/commands/command-args.ts +103 -71
  194. package/src/commands/context.ts +22 -20
  195. package/src/commands/defaults.ts +4 -1
  196. package/src/commands/keymap.ts +47 -43
  197. package/src/commands/levels.ts +3 -3
  198. package/src/commands/live-context.ts +10 -8
  199. package/src/commands/reference.ts +2 -1
  200. package/src/commands/registry.ts +12 -10
  201. package/src/commands/run-reported.ts +15 -10
  202. package/src/component-props.ts +46 -30
  203. package/src/content/collection-match.ts +5 -4
  204. package/src/content/draft-state.ts +4 -3
  205. package/src/content/entry-commands.ts +3 -2
  206. package/src/content/entry-editor.ts +29 -17
  207. package/src/content/entry-fields.ts +12 -7
  208. package/src/content/entry-model.ts +21 -12
  209. package/src/editor/canvas-context-menu.ts +1 -2
  210. package/src/editor/canvas-slash-bridge.ts +3 -6
  211. package/src/editor/content-slice.ts +16 -14
  212. package/src/editor/context-menu.ts +35 -22
  213. package/src/editor/convert-targets.ts +30 -35
  214. package/src/editor/convert-to-component.ts +11 -5
  215. package/src/editor/convert-to-repeater.ts +34 -22
  216. package/src/editor/editable-tags.ts +17 -2
  217. package/src/editor/file-drop-action.ts +21 -22
  218. package/src/editor/inline-edit-apply.ts +35 -17
  219. package/src/editor/inline-edit.ts +66 -50
  220. package/src/editor/inline-format.ts +59 -56
  221. package/src/editor/inline-link.ts +40 -15
  222. package/src/editor/insert-zone-action.ts +1 -1
  223. package/src/editor/merge-tags.ts +58 -19
  224. package/src/editor/repeater-scope.ts +39 -28
  225. package/src/editor/shortcuts.ts +87 -47
  226. package/src/editor/slash-menu.ts +1 -6
  227. package/src/files/asset-versions.ts +4 -4
  228. package/src/files/components.ts +15 -10
  229. package/src/files/elements.ts +5 -6
  230. package/src/files/file-ops.ts +77 -36
  231. package/src/files/files.ts +90 -95
  232. package/src/files/media-meta.ts +2 -1
  233. package/src/files/media-paths.ts +6 -1
  234. package/src/files/serialize-document.ts +2 -2
  235. package/src/format/constraints.ts +1 -1
  236. package/src/format/convert-file.ts +27 -13
  237. package/src/format/format-choices.ts +2 -1
  238. package/src/format/format-host.ts +76 -50
  239. package/src/github/github-auth-status.ts +27 -3
  240. package/src/github/github-auth.ts +19 -9
  241. package/src/github/github-publish.ts +24 -20
  242. package/src/grid/cell-editors.ts +46 -31
  243. package/src/grid/cell-popovers.ts +5 -3
  244. package/src/grid/edit-buffer.ts +10 -9
  245. package/src/grid/grid-controller.ts +20 -22
  246. package/src/grid/grid-layout.ts +21 -5
  247. package/src/grid/grid-open.ts +3 -6
  248. package/src/grid/grid-panel.ts +11 -4
  249. package/src/grid/grid-source.ts +8 -8
  250. package/src/grid/grid-view.ts +14 -17
  251. package/src/grid/redirects-grid.ts +14 -5
  252. package/src/grid/redirects.ts +16 -14
  253. package/src/grid/schema-columns.ts +25 -19
  254. package/src/grid/sources/connector-source.ts +47 -20
  255. package/src/grid/sources/content-source.ts +25 -24
  256. package/src/grid/sources/csv-file-source.ts +2 -2
  257. package/src/grid/tabulator-tables.d.ts +55 -34
  258. package/src/hosting/stage.ts +7 -7
  259. package/src/i18n/i18n-commands.ts +1 -2
  260. package/src/media/media-pane.ts +4 -1
  261. package/src/new-project/add-repo-modal.ts +20 -19
  262. package/src/new-project/import-tab.ts +10 -14
  263. package/src/new-project/location-fields.ts +2 -1
  264. package/src/new-project/new-project-modal.ts +12 -9
  265. package/src/packages/jxsuite-update.ts +4 -3
  266. package/src/packages/pull-package-sync.ts +26 -25
  267. package/src/page-params.ts +97 -68
  268. package/src/panels/activity-panel.ts +17 -9
  269. package/src/panels/ai-chat/attached-context.ts +13 -7
  270. package/src/panels/ai-chat/chat-view.ts +80 -73
  271. package/src/panels/ai-chat/composer.ts +30 -33
  272. package/src/panels/ai-chat/sessions-view.ts +1 -2
  273. package/src/panels/ai-panel.ts +23 -20
  274. package/src/panels/block-action-bar.ts +46 -35
  275. package/src/panels/bottom-dock.ts +5 -3
  276. package/src/panels/canvas-dnd-bridge.ts +31 -24
  277. package/src/panels/data-explorer.ts +62 -25
  278. package/src/panels/data-grid.ts +14 -11
  279. package/src/panels/dnd.ts +108 -118
  280. package/src/panels/editors.ts +55 -22
  281. package/src/panels/elements-panel.ts +10 -3
  282. package/src/panels/events-panel.ts +84 -69
  283. package/src/panels/formula-workspace.ts +76 -51
  284. package/src/panels/frontmatter-fields.ts +24 -19
  285. package/src/panels/frontmatter-panel.ts +44 -34
  286. package/src/panels/git-diff-open.ts +4 -4
  287. package/src/panels/git-panel.ts +49 -61
  288. package/src/panels/head-panel.ts +131 -111
  289. package/src/panels/i18n-panel.ts +10 -3
  290. package/src/panels/imports-panel.ts +23 -47
  291. package/src/panels/jump-bar.ts +48 -29
  292. package/src/panels/layers-panel.ts +97 -74
  293. package/src/panels/left-panel.ts +3 -3
  294. package/src/panels/pane-context.ts +31 -22
  295. package/src/panels/pane-grid.ts +49 -20
  296. package/src/panels/panel-registry.ts +22 -37
  297. package/src/panels/properties-panel.ts +175 -121
  298. package/src/panels/quick-search.ts +53 -31
  299. package/src/panels/right-panel.ts +3 -3
  300. package/src/panels/seo-modal.ts +13 -17
  301. package/src/panels/settings-menu.ts +15 -15
  302. package/src/panels/signals-panel.ts +153 -131
  303. package/src/panels/statement-editor.ts +230 -140
  304. package/src/panels/style-panel.ts +254 -216
  305. package/src/panels/style-utils.ts +114 -51
  306. package/src/panels/stylebook-doc.ts +57 -54
  307. package/src/panels/stylebook-layers-panel.ts +9 -9
  308. package/src/panels/stylebook-panel.ts +13 -17
  309. package/src/panels/tab-drop.ts +27 -11
  310. package/src/panels/tab-strip.ts +36 -26
  311. package/src/platform-errors.ts +57 -43
  312. package/src/platform.ts +58 -30
  313. package/src/platforms/cloud.ts +345 -175
  314. package/src/platforms/default-platform.ts +10 -4
  315. package/src/platforms/devserver.ts +174 -127
  316. package/src/platforms/read-batcher.ts +16 -8
  317. package/src/project-list.ts +2 -1
  318. package/src/publish/deploy-checklist.ts +8 -2
  319. package/src/publish/pages-service.ts +28 -13
  320. package/src/publish/publish-commands.ts +5 -4
  321. package/src/publish/publish-panel.ts +10 -6
  322. package/src/recent-projects.ts +15 -8
  323. package/src/resize-edges.ts +26 -36
  324. package/src/services/a11y-report.ts +26 -19
  325. package/src/services/agent-seed.ts +23 -11
  326. package/src/services/ai-ask.ts +9 -12
  327. package/src/services/ai-command-tools.ts +68 -62
  328. package/src/services/ai-import-tools.ts +80 -67
  329. package/src/services/ai-models.ts +17 -13
  330. package/src/services/ai-project-tools.ts +68 -32
  331. package/src/services/ai-session-store.ts +19 -10
  332. package/src/services/ai-system-prompt.ts +46 -20
  333. package/src/services/ai-tools.ts +71 -27
  334. package/src/services/ai-write-report.ts +20 -12
  335. package/src/services/ai-writes.ts +4 -4
  336. package/src/services/automation.ts +58 -31
  337. package/src/services/cem-export.ts +149 -58
  338. package/src/services/clock.ts +6 -1
  339. package/src/services/code-services.ts +37 -31
  340. package/src/services/context-manager.ts +14 -10
  341. package/src/services/context-resolver.ts +20 -8
  342. package/src/services/data-service.ts +19 -15
  343. package/src/services/directory-picker.ts +18 -12
  344. package/src/services/document-assistant.ts +39 -19
  345. package/src/services/gated-registry.ts +10 -6
  346. package/src/services/harness/chat-reducer.ts +23 -1
  347. package/src/services/import-client.ts +91 -38
  348. package/src/services/import-seed.ts +8 -2
  349. package/src/services/jx-validate.ts +28 -31
  350. package/src/services/live-preview.ts +0 -0
  351. package/src/services/live-surfaces.ts +6 -3
  352. package/src/services/model-uri.ts +10 -2
  353. package/src/services/module-preloads.ts +12 -8
  354. package/src/services/monaco-buffer.ts +43 -24
  355. package/src/services/monaco-lazy.ts +7 -8
  356. package/src/services/monaco-setup.ts +23 -16
  357. package/src/services/notify.ts +44 -17
  358. package/src/services/popover-report.ts +25 -10
  359. package/src/services/preview-eval.ts +20 -8
  360. package/src/services/profile.ts +13 -6
  361. package/src/services/project-path.ts +13 -10
  362. package/src/services/references.ts +0 -0
  363. package/src/services/render-critic.ts +8 -7
  364. package/src/services/settings/kernel.ts +13 -4
  365. package/src/services/settings/write-queue.ts +9 -9
  366. package/src/services/token-lint.ts +12 -10
  367. package/src/services/tool-executor.ts +17 -5
  368. package/src/services/tool-outcomes.ts +44 -24
  369. package/src/services/trusted-types.ts +24 -7
  370. package/src/settings/contexts-section.ts +11 -8
  371. package/src/settings/contributed-section.ts +79 -60
  372. package/src/settings/css-vars-editor.ts +37 -16
  373. package/src/settings/defs-editor.ts +38 -35
  374. package/src/settings/extension-rows.ts +16 -8
  375. package/src/settings/extension-sections.ts +23 -13
  376. package/src/settings/extensions-section.ts +4 -1
  377. package/src/settings/general-settings.ts +11 -8
  378. package/src/settings/locales-section.ts +20 -12
  379. package/src/settings/preferences-dialog.ts +9 -6
  380. package/src/settings/preferences-keymap.ts +7 -5
  381. package/src/settings/preferences-sections.ts +11 -5
  382. package/src/settings/project-sections.ts +1 -1
  383. package/src/settings/schema-field-ui.ts +9 -0
  384. package/src/settings/settings-document.ts +5 -5
  385. package/src/shell/tree.ts +6 -5
  386. package/src/shell.ts +104 -81
  387. package/src/site-context.ts +37 -22
  388. package/src/state.ts +41 -49
  389. package/src/store.ts +54 -34
  390. package/src/studio.ts +39 -77
  391. package/src/style/live-preview.ts +1 -1
  392. package/src/style/project-styles.ts +6 -7
  393. package/src/style/token-ref.ts +5 -4
  394. package/src/surfaces/about.ts +18 -19
  395. package/src/surfaces/add-repo.ts +17 -19
  396. package/src/surfaces/ai-chat.ts +31 -36
  397. package/src/surfaces/ai-credentials-form.ts +6 -16
  398. package/src/surfaces/ai-managed-connect.ts +3 -4
  399. package/src/surfaces/ai-model-picker.ts +3 -5
  400. package/src/surfaces/block-action-bar.ts +22 -11
  401. package/src/surfaces/boot-failure.ts +4 -5
  402. package/src/surfaces/bottom-dock.ts +9 -18
  403. package/src/surfaces/canvas-stage.ts +12 -11
  404. package/src/surfaces/cf-account-picker.ts +17 -18
  405. package/src/surfaces/commandbar.ts +14 -9
  406. package/src/surfaces/convert-repeater.ts +17 -19
  407. package/src/surfaces/data-actions.ts +9 -7
  408. package/src/surfaces/dialog.ts +26 -28
  409. package/src/surfaces/diff-toolbar.ts +9 -7
  410. package/src/surfaces/doc-header.ts +10 -19
  411. package/src/surfaces/empty-state.ts +7 -10
  412. package/src/surfaces/entry-editor.ts +14 -11
  413. package/src/surfaces/expression-editor.ts +11 -25
  414. package/src/surfaces/files-panel.ts +27 -14
  415. package/src/surfaces/formula-palette.ts +4 -5
  416. package/src/surfaces/git-panel.ts +7 -15
  417. package/src/surfaces/github-auth.ts +16 -20
  418. package/src/surfaces/github-publish.ts +17 -22
  419. package/src/surfaces/grid-cell.ts +30 -31
  420. package/src/surfaces/grid-open.ts +10 -14
  421. package/src/surfaces/grid-panel.ts +13 -9
  422. package/src/surfaces/grid-replace.ts +13 -13
  423. package/src/surfaces/grid-views.ts +15 -18
  424. package/src/surfaces/inspector-dock.ts +13 -12
  425. package/src/surfaces/jump-bar.ts +5 -6
  426. package/src/surfaces/jxsuite-update.ts +16 -22
  427. package/src/surfaces/library-pane.ts +25 -20
  428. package/src/surfaces/logic-panel.ts +17 -30
  429. package/src/surfaces/logic-workspace.ts +13 -15
  430. package/src/surfaces/media-browser.ts +11 -10
  431. package/src/surfaces/media-field.ts +4 -5
  432. package/src/surfaces/media-pane.ts +8 -7
  433. package/src/surfaces/menu.ts +29 -23
  434. package/src/surfaces/navigator-dock.ts +11 -12
  435. package/src/surfaces/new-project.ts +27 -26
  436. package/src/surfaces/pane-context.ts +20 -25
  437. package/src/surfaces/pane-grid.ts +15 -10
  438. package/src/surfaces/panel-activity.ts +5 -6
  439. package/src/surfaces/panel-data.ts +3 -4
  440. package/src/surfaces/panel-deploy-checklist.ts +5 -6
  441. package/src/surfaces/panel-elements.ts +5 -7
  442. package/src/surfaces/panel-i18n.ts +5 -7
  443. package/src/surfaces/panel-imports.ts +6 -13
  444. package/src/surfaces/panel-outline.ts +25 -19
  445. package/src/surfaces/panel-page.ts +11 -18
  446. package/src/surfaces/panel-problems.ts +5 -7
  447. package/src/surfaces/panel-signals.ts +20 -34
  448. package/src/surfaces/panel-stylebook-layers.ts +5 -8
  449. package/src/surfaces/preferences.ts +21 -11
  450. package/src/surfaces/progress-modal.ts +15 -9
  451. package/src/surfaces/properties-panel.json +1 -1
  452. package/src/surfaces/properties-panel.ts +20 -42
  453. package/src/surfaces/publish.ts +18 -18
  454. package/src/surfaces/push-plan.ts +7 -8
  455. package/src/surfaces/rail.json +126 -73
  456. package/src/surfaces/rail.ts +38 -12
  457. package/src/surfaces/reference-field.ts +11 -15
  458. package/src/surfaces/schema-builder.ts +16 -22
  459. package/src/surfaces/schema-form.ts +15 -25
  460. package/src/surfaces/secret-field.ts +9 -6
  461. package/src/surfaces/seo.ts +21 -15
  462. package/src/surfaces/settings-contexts.ts +9 -7
  463. package/src/surfaces/settings-contributed.ts +14 -10
  464. package/src/surfaces/settings-css-vars.ts +5 -12
  465. package/src/surfaces/settings-defs.json +2 -2
  466. package/src/surfaces/settings-defs.ts +17 -21
  467. package/src/surfaces/settings-deploy.ts +8 -15
  468. package/src/surfaces/settings-extensions.ts +5 -6
  469. package/src/surfaces/settings-head.ts +33 -39
  470. package/src/surfaces/settings-locales.ts +8 -20
  471. package/src/surfaces/settings-overview.ts +5 -6
  472. package/src/surfaces/settings-packages.ts +8 -7
  473. package/src/surfaces/settings-pane.ts +9 -18
  474. package/src/surfaces/settings-rawjson.ts +5 -6
  475. package/src/surfaces/shell.ts +1 -2
  476. package/src/surfaces/slash-menu.ts +19 -9
  477. package/src/surfaces/statements.ts +13 -18
  478. package/src/surfaces/statusbar.ts +17 -14
  479. package/src/surfaces/style-panel.ts +18 -31
  480. package/src/surfaces/stylebook-chrome.ts +3 -5
  481. package/src/surfaces/tab-strip.ts +14 -13
  482. package/src/surfaces/target-line.ts +6 -7
  483. package/src/surfaces/welcome.ts +5 -7
  484. package/src/tabs/patch-ops.ts +4 -3
  485. package/src/tabs/project-config.ts +32 -21
  486. package/src/tabs/selection.ts +36 -8
  487. package/src/tabs/tab.ts +52 -41
  488. package/src/tabs/transact.ts +98 -53
  489. package/src/tabs/typing.ts +31 -0
  490. package/src/types.ts +32 -17
  491. package/src/ui/ai-credentials-form.ts +10 -13
  492. package/src/ui/ai-model-picker.ts +3 -3
  493. package/src/ui/cf-account-picker.ts +7 -9
  494. package/src/ui/color-selector.ts +9 -5
  495. package/src/ui/dynamic-slot.ts +7 -8
  496. package/src/ui/expression-editor.ts +112 -105
  497. package/src/ui/form-controls.ts +57 -48
  498. package/src/ui/formula-catalog.ts +239 -230
  499. package/src/ui/formula-chips.ts +33 -18
  500. package/src/ui/layers.ts +44 -31
  501. package/src/ui/media-picker.ts +18 -9
  502. package/src/ui/popover-surface.ts +20 -12
  503. package/src/ui/progress-modal.ts +13 -8
  504. package/src/ui/regions.ts +7 -6
  505. package/src/ui/schema-form.ts +113 -70
  506. package/src/ui/surface.ts +71 -8
  507. package/src/ui/timing.ts +9 -0
  508. package/src/ui/value-source.ts +44 -31
  509. package/src/ui/virtual-window.ts +3 -2
  510. package/src/utils/base64.ts +3 -1
  511. package/src/utils/edit-display.ts +103 -74
  512. package/src/utils/element-selectors.ts +3 -2
  513. package/src/utils/google-fonts.ts +15 -14
  514. package/src/utils/inherited-style.ts +18 -20
  515. package/src/utils/link-target.ts +1 -1
  516. package/src/utils/preview-format.ts +25 -3
  517. package/src/utils/strip-events.ts +49 -22
  518. package/src/utils/studio-utils.ts +29 -14
  519. package/src/view.ts +2 -3
  520. package/src/workspace/pane-derive.ts +10 -12
  521. package/src/workspace/session.ts +53 -43
  522. package/src/workspace/workspace.ts +47 -36
  523. package/dist/chunks/2020-nkxms0ay.js +0 -4
  524. package/dist/chunks/adapter-m948ab5f.js +0 -4
  525. package/dist/chunks/cf-account-picker-n8hr38v7.js +0 -4
  526. package/dist/chunks/cf-settings-356xdtne.js +0 -4
  527. package/dist/chunks/color-area-jqhna8zy.js +0 -4
  528. package/dist/chunks/color-field-embq5ctg.js +0 -4
  529. package/dist/chunks/color-fpezvnkt.js +0 -4
  530. package/dist/chunks/color-slider-1qmw7wqy.js +0 -4
  531. package/dist/chunks/combobox-773hdzyj.js +0 -4
  532. package/dist/chunks/components-yk3t844e.js +0 -4
  533. package/dist/chunks/content-source-bawmyc09.js +0 -4
  534. package/dist/chunks/convert-to-repeater-7wns8kf1.js +0 -4
  535. package/dist/chunks/dialog-mtm9fq5t.js +0 -4
  536. package/dist/chunks/editor-6sc8nacq.js +0 -4
  537. package/dist/chunks/entry-commands-8ay9fh81.js +0 -4
  538. package/dist/chunks/extension-sections-na7rj3nr.js +0 -4
  539. package/dist/chunks/file-ops-gye0qw56.js +0 -4
  540. package/dist/chunks/files-dmc2xvcq.js +0 -4
  541. package/dist/chunks/format-host-t76b53f8.js +0 -4
  542. package/dist/chunks/fs-events-cg4tpz06.js +0 -4
  543. package/dist/chunks/git-panel-yef7bshy.js +0 -4
  544. package/dist/chunks/grid-view-7tt4bxw1.js +0 -51
  545. package/dist/chunks/icons-qbh8akb1.js +0 -4
  546. package/dist/chunks/iframe-entry-f7mqjwpm.js +0 -5
  547. package/dist/chunks/iframe-entry-haw7jkvz.js +0 -5
  548. package/dist/chunks/iframe-entry-z6qrytv3.js +0 -5
  549. package/dist/chunks/iframe-host-tmz30gfp.js +0 -4
  550. package/dist/chunks/index-nag78a9h.js +0 -4
  551. package/dist/chunks/jsonMode-zhwsprqk.js +0 -13
  552. package/dist/chunks/jx-validate-3gbp5nkn.js +0 -4
  553. package/dist/chunks/layers-fvz99859.js +0 -4
  554. package/dist/chunks/layers-panel-gchmbf9p.js +0 -4
  555. package/dist/chunks/listbox-s8fkmnq8.js +0 -4
  556. package/dist/chunks/lit-html-9agdspkt.js +0 -4
  557. package/dist/chunks/media-picker-rhjvyy00.js +0 -4
  558. package/dist/chunks/menu-2e4y9j7b.js +0 -4
  559. package/dist/chunks/menu-37d07z9m.js +0 -4
  560. package/dist/chunks/monaco-binding-2jnhjjvr.js +0 -4
  561. package/dist/chunks/monaco-buffer-rp21359g.js +0 -4
  562. package/dist/chunks/monaco-setup-vhh7gayr.js +0 -4
  563. package/dist/chunks/notify-h3www560.js +0 -4
  564. package/dist/chunks/number-field-gw7sq8rn.js +0 -4
  565. package/dist/chunks/parse-897fvqah.js +0 -4
  566. package/dist/chunks/platform-hz34wcd7.js +0 -4
  567. package/dist/chunks/popover-8htra4er.js +0 -4
  568. package/dist/chunks/publish-panel-exsmjzyj.js +0 -4
  569. package/dist/chunks/quick-search-pgaqeh0m.js +0 -4
  570. package/dist/chunks/references-2cgdxnb8.js +0 -4
  571. package/dist/chunks/right-panel-jf856w5w.js +0 -4
  572. package/dist/chunks/section-registry-jnf8r5gy.js +0 -4
  573. package/dist/chunks/select-n3v7gwas.js +0 -4
  574. package/dist/chunks/split-pff8f3ze.js +0 -4
  575. package/dist/chunks/studio-0f55h9ye.js +0 -5
  576. package/dist/chunks/studio-0sqdhnew.js +0 -12
  577. package/dist/chunks/studio-19x1c75w.js +0 -5
  578. package/dist/chunks/studio-2sqcndak.js +0 -5
  579. package/dist/chunks/studio-3aey7dd3.js +0 -5
  580. package/dist/chunks/studio-3bpdkq2s.js +0 -5
  581. package/dist/chunks/studio-47y6fbpf.js +0 -5
  582. package/dist/chunks/studio-4m3826v2.js +0 -5
  583. package/dist/chunks/studio-4nx2dj1g.js +0 -4
  584. package/dist/chunks/studio-4xv5s47r.js +0 -9
  585. package/dist/chunks/studio-5g4t8v6w.js +0 -5
  586. package/dist/chunks/studio-5py436sf.js +0 -5
  587. package/dist/chunks/studio-77kt594t.js +0 -5
  588. package/dist/chunks/studio-8f87n763.js +0 -10
  589. package/dist/chunks/studio-8mb00b84.js +0 -5
  590. package/dist/chunks/studio-8p51gq2h.js +0 -6
  591. package/dist/chunks/studio-954ds834.js +0 -5
  592. package/dist/chunks/studio-9ft45c83.js +0 -9
  593. package/dist/chunks/studio-a2138x5k.js +0 -7
  594. package/dist/chunks/studio-a9yzstqj.js +0 -5
  595. package/dist/chunks/studio-acdksxx6.js +0 -5
  596. package/dist/chunks/studio-ar8jcf2y.js +0 -5
  597. package/dist/chunks/studio-bmn4mn9j.js +0 -7
  598. package/dist/chunks/studio-e7xxa0sj.js +0 -5
  599. package/dist/chunks/studio-ecaz25vk.js +0 -5
  600. package/dist/chunks/studio-ery42sqr.js +0 -4
  601. package/dist/chunks/studio-fzdywr6p.js +0 -9
  602. package/dist/chunks/studio-g5fmf0c1.js +0 -5
  603. package/dist/chunks/studio-g7nse7zb.js +0 -5
  604. package/dist/chunks/studio-geq1ea6k.js +0 -14
  605. package/dist/chunks/studio-ghkb32r8.js +0 -5
  606. package/dist/chunks/studio-ghrhy2y7.js +0 -5
  607. package/dist/chunks/studio-grawhey1.js +0 -5
  608. package/dist/chunks/studio-h0xgswew.js +0 -5
  609. package/dist/chunks/studio-h9c4p2tx.js +0 -5
  610. package/dist/chunks/studio-jyzj5cxs.js +0 -5
  611. package/dist/chunks/studio-mgx8yhnz.js +0 -64
  612. package/dist/chunks/studio-mpb04y1d.js +0 -6
  613. package/dist/chunks/studio-n17mty64.js +0 -5
  614. package/dist/chunks/studio-nwh2eqsk.js +0 -6
  615. package/dist/chunks/studio-q1h883bt.js +0 -16
  616. package/dist/chunks/studio-q4tv82h7.js +0 -9
  617. package/dist/chunks/studio-qpqa7vk3.js +0 -5
  618. package/dist/chunks/studio-qqz8e5gk.js +0 -5
  619. package/dist/chunks/studio-qvasen3f.js +0 -5
  620. package/dist/chunks/studio-rggdb3hm.js +0 -5
  621. package/dist/chunks/studio-sghy936h.js +0 -4
  622. package/dist/chunks/studio-skprc6ef.js +0 -5
  623. package/dist/chunks/studio-tt2nactf.js +0 -5
  624. package/dist/chunks/studio-tyasmc39.js +0 -5
  625. package/dist/chunks/studio-vk9ezads.js +0 -5
  626. package/dist/chunks/studio-vzacdfsc.js +0 -4
  627. package/dist/chunks/studio-w4c0xmrw.js +0 -5
  628. package/dist/chunks/studio-wfjqhhbk.js +0 -5
  629. package/dist/chunks/studio-wgh5kxpj.js +0 -5
  630. package/dist/chunks/studio-xasj0796.js +0 -5
  631. package/dist/chunks/studio-y78s8r2n.js +0 -5
  632. package/dist/chunks/studio-z8w183sh.js +0 -5
  633. package/dist/chunks/studio-zscd9ty4.js +0 -928
  634. package/dist/chunks/studio-zxp13sss.js +0 -7
  635. package/dist/chunks/studio-zygnmm01.js +0 -5
  636. package/dist/chunks/swatch-group-8qh9a3bm.js +0 -4
  637. package/dist/chunks/tabs-jwthg40w.js +0 -4
  638. package/dist/chunks/textfield-spy3hc77.js +0 -4
  639. package/dist/chunks/toast-4d35zd64.js +0 -4
  640. package/dist/chunks/toast-host-8sjmfed3.js +0 -4
  641. package/dist/chunks/tooltip-fd6g9xy3.js +0 -4
  642. package/dist/chunks/tree-h19v1jfz.js +0 -4
  643. package/dist/chunks/tsMode-gr0m4dzr.js +0 -14
  644. package/dist/chunks/workspace-m15qtcqp.js +0 -4
  645. package/dist/chunks/ws-client-nf61frr1.js +0 -4
@@ -0,0 +1,4 @@
1
+ import{bS,am}from"./studio-5ve6bbep.js";import"./studio-y04qtxvp.js";import"./studio-18vgbhs5.js";import"./studio-j430n16g.js";import"./studio-a3shpz9y.js";import"./studio-8qm0ep50.js";import"./studio-fpphgn8y.js";import"./studio-1fxkaaea.js";import"./studio-2hcbccfv.js";import"./studio-er30bpcx.js";import"./studio-pag2wncm.js";import"./studio-924p1tm1.js";import"./studio-6wkmf3wz.js";import"./studio-at5spjbc.js";import"./studio-p1wgvp7r.js";import"./studio-v2w7q8r1.js";import"./studio-zp7snvkq.js";import"./studio-se2r3ptc.js";import"./studio-ynn90f58.js";import"./studio-4h8k4dw9.js";import"./studio-vfcdrfmv.js";import"./studio-qvanvzfd.js";import"./studio-qwa64kt7.js";import"./studio-jjkg84nj.js";import"./studio-24mccdrj.js";import"./studio-vmfkgdjf.js";import"./studio-485046te.js";import"./studio-nwfrc98n.js";import"./studio-ffrrncvz.js";import"./studio-2jbs3rxv.js";import"./studio-0q988f9w.js";import"./studio-v8aga3vp.js";import"./studio-j1kvhdjk.js";import"./studio-d81xfh1g.js";import"./studio-wz73q5kq.js";export{bS as initQuickSearch,am as openQuickSearch};
2
+
3
+ //# debugId=547A8C88477C52EA64756E2164756E21
4
+ //# sourceMappingURL=quick-search-0dajrwqg.js.map
@@ -0,0 +1,4 @@
1
+ import{hy,jc,ea,kC,Ia,Dm,EC,Nm}from"./studio-zp7snvkq.js";import"./studio-ffrrncvz.js";import"./studio-j1kvhdjk.js";export{Ia as invalidateUsages,ea as loadUsages,jc as peekUsages,kC as retryUsages,Nm as usageFiles,Dm as usageHeadline,EC as usageWarning,hy as usagesSupported};
2
+
3
+ //# debugId=767DEE6A12B5F4A764756E2164756E21
4
+ //# sourceMappingURL=references-49qgt404.js.map
@@ -0,0 +1,4 @@
1
+ import{yS,ZI,lm,Cd,cm}from"./studio-efvfrsf8.js";import"./studio-6ep3js6b.js";import"./studio-amsbaaar.js";import"./studio-yxz682sx.js";import"./studio-a3shpz9y.js";import"./studio-zq4z6tm6.js";import"./studio-1fxkaaea.js";import"./studio-924p1tm1.js";import"./studio-v2w7q8r1.js";import"./studio-zp7snvkq.js";import"./studio-se2r3ptc.js";import"./studio-ynn90f58.js";import"./studio-4h8k4dw9.js";import"./studio-vfcdrfmv.js";import"./studio-qvanvzfd.js";import"./studio-qwa64kt7.js";import"./studio-jjkg84nj.js";import"./studio-24mccdrj.js";import"./studio-vmfkgdjf.js";import"./studio-485046te.js";import"./studio-nwfrc98n.js";import"./studio-ffrrncvz.js";import"./studio-2jbs3rxv.js";import"./studio-0q988f9w.js";import"./studio-v8aga3vp.js";import"./studio-j1kvhdjk.js";import"./studio-d81xfh1g.js";import"./studio-wz73q5kq.js";import"./studio-k1wvtp03.js";export{Cd as inspectorTab,yS as mount,lm as render,cm as setInspectorTab,ZI as unmount};
2
+
3
+ //# debugId=0C4348EFCD33535264756E2164756E21
4
+ //# sourceMappingURL=right-panel-jm1bwe53.js.map
@@ -0,0 +1,4 @@
1
+ import{rl,Ub,Cs,XS,xm,ax,lx,qb,Kb}from"./studio-v5vjq1h0.js";export{rl as notifySettingsDocument,Ub as onSettingsDocumentChanged,Cs as registerSettingsSection,Kb as setSettingsSection,qb as settingsDocumentSection,lx as settingsSection,ax as settingsSectionKeys,xm as sortedSettingsSections,XS as unregisterSettingsSection};
2
+
3
+ //# debugId=C9A1C704292C57CC64756E2164756E21
4
+ //# sourceMappingURL=section-registry-6kwc4fky.js.map
@@ -0,0 +1,4 @@
1
+ var r=0;function o(t){return t.querySelector('select[part="control"]')}function c(t,l){return[...t.options].some((e)=>e.getAttribute("part")!=="unlisted"&&e.value===l)}function i(t,l){let e=String(t.value??""),n=t.unlisted??[];if(e!==""&&!c(l,e)){if(n.length!==1||n[0]?.value!==e)t.unlisted=[{label:e,value:e}]}else if(n.length>0)t.unlisted=[];if([...l.options].some((u)=>u.value===e)){if(l.value!==e||l.selectedIndex<0)l.value=e}else if(l.selectedIndex>=0)l.selectedIndex=-1}function s(t,l){r+=1,t.uid=`jx-select-${r}`;let e=o(l);if(!e)return;i(t,e),new MutationObserver(()=>i(t,e)).observe(e,{attributeFilter:["data-value"],attributes:!0,childList:!0,subtree:!0})}export{s as mountSelect,i as syncSelect};
2
+
3
+ //# debugId=17BAAFC1CC52064864756E2164756E21
4
+ //# sourceMappingURL=select-rzds841e.js.map
@@ -0,0 +1,4 @@
1
+ import{t,n}from"./iframe-entry-fvbk89gm.js";var C="jx-split",y=0.000001,N=Object.freeze({altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1});function m(r){return{altKey:r.altKey===!0,ctrlKey:r.ctrlKey===!0,metaKey:r.metaKey===!0,shiftKey:r.shiftKey===!0}}function T(r){let e="detail"in r?r.detail:void 0;if(!n(e))return{...N};return{altKey:"altKey"in e&&e.altKey===!0,ctrlKey:"ctrlKey"in e&&e.ctrlKey===!0,metaKey:"metaKey"in e&&e.metaKey===!0,shiftKey:"shiftKey"in e&&e.shiftKey===!0}}var d=new WeakMap;function f(r){let e=r.currentTarget;return e instanceof HTMLElement&&e.localName===C?e:null}function p(r,e,...i){for(let o of i)r.dispatchEvent(new CustomEvent(o,{bubbles:!0,composed:!0,detail:e}))}function c(r,e){let i=Number(r);return Number.isFinite(i)?i:e}function K(r,e){let i=Number(r);return Number.isFinite(i)&&i>0?i:e}function b(r){return String(r.orientation)!=="horizontal"}function E(r,e){return r?e.clientX:e.clientY}var M=new WeakMap;function O(r,e){let i=M.get(r);if(i&&i.vertical===e&&i.element.isConnected&&r.isConnected&&i.element.contains(r)){let o=i.element.getBoundingClientRect(),l=e?o.width:o.height;if(l>0)return l}for(let o=r.parentElement;o;o=o.parentElement){if(globalThis.getComputedStyle(o).display==="contents")continue;let l=o.getBoundingClientRect(),u=e?l.width:l.height;if(u>0)return M.set(r,{element:o,vertical:e}),u}return 0}function g(r,e){let i=O(e,b(r)),o=c(r.min,0),l=c(r.max,1),u=i>0?Math.max(0,c(r.gap,0))/i:0,a=Math.max(o,u),s=Math.min(l,1-u);if(a>s){let S=(a+s)/2;a=S,s=S}return{hi:s,length:i,lo:a}}function h(r,e,i,o){let l=Math.min(o,Math.max(i,e));if(!Number.isFinite(l)||l===Number(r.value))return!1;return r.value=l,!0}function x(r,e,i){let o=Math.min(i,Math.max(e,c(r.collapse,e))),l=Number(r.value);if(Math.abs(l-o)>y)return r.restore=l,o;let u=c(r.restore,-1);return u>=0&&Math.abs(u-o)>y?u:(e+i)/2}function P(r,e){if(r)return e==="ArrowLeft"?-1:e==="ArrowRight"?1:0;return e==="ArrowUp"?-1:e==="ArrowDown"?1:0}function H(r,e){let i=f(e);if(!i||r.disabled===!0||c(e.button,0)!==0)return;let{hi:o,length:l,lo:u}=g(r,i);if(l<=0)return;if(e.preventDefault(),i.focus(),d.set(i,{hi:o,length:l,lo:u,origin:E(b(r),e),start:Number(r.value)}),t(i.setPointerCapture))try{i.setPointerCapture(e.pointerId)}catch{}r.dragging=!0}function L(r,e){let i=f(e),o=i?d.get(i):void 0;if(!i||!o)return;let l=E(b(r),e)-o.origin;if(h(r,o.start+l/o.length,o.lo,o.hi))p(i,m(e),"input")}function D(r,e){let i=f(e);if(!i||!d.delete(i))return;if(r.dragging=!1,t(i.releasePointerCapture)&&t(i.hasPointerCapture)&&i.hasPointerCapture(e.pointerId))i.releasePointerCapture(e.pointerId);p(i,m(e),"change")}function k(r,e){let i=f(e);if(!i||r.disabled===!0)return;let{hi:o,lo:l}=g(r,i),u;if(e.key==="Home")u=l;else if(e.key==="End")u=o;else if(e.key==="Enter")u=x(r,l,o);else{let a=P(b(r),e.key);if(a===0)return;let s=e.shiftKey?K(r.largeStep,0.1):K(r.step,0.02);u=Number(r.value)+a*s}if(e.preventDefault(),h(r,u,l,o))p(i,m(e),"input","change")}function F(r,e){let i=f(e);if(!i||r.disabled===!0)return;let{hi:o,lo:l}=g(r,i);if(h(r,x(r,l,o),l,o))p(i,m(e),"input","change")}export{F as onSplitDoubleClick,k as onSplitKeydown,H as onSplitPointerDown,L as onSplitPointerMove,D as onSplitPointerUp,T as splitModifiersOf,O as trackOf};
2
+
3
+ //# debugId=F2E2352671D3E1BD64756E2164756E21
4
+ //# sourceMappingURL=split-n2gfpm5m.js.map
@@ -2,7 +2,7 @@ var C=globalThis,O=(t)=>t,b=C.trustedTypes,j=b?b.createPolicy("lit-html",{create
2
2
  \f\r](?:([^\\s"'>=/]+)([
3
3
  \f\r]*=[
4
4
  \f\r]*(?:[^
5
- \f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),br=E(1),J=E(2),K=E(3),zl=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===zl)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=tt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===tt||t==null||t===""?(this._$AH!==tt&&this._$AR(),this._$AH=tt):t!==this._$AH&&t!==zl&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==tt&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=tt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=tt}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==zl,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===zl&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===tt?t=tt:t!==tt&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===tt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===tt?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==tt)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??tt)===zl)return;let s=this._$AH,i=t===tt&&s!==tt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==tt&&(s===tt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var yk={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var Ni=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{br,zl,tt,yk,Ni};
5
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),$o=E(1),J=E(2),K=E(3),sc=Symbol.for("lit-noChange"),mt=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===sc)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=mt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===mt||t==null||t===""?(this._$AH!==mt&&this._$AR(),this._$AH=mt):t!==this._$AH&&t!==sc&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==mt&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=mt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=mt}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==sc,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===sc&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===mt?t=mt:t!==mt&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===mt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===mt?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==mt)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??mt)===sc)return;let s=this._$AH,i=t===mt&&s!==mt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==mt&&(s===mt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var nk={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var Vi=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{$o,sc,mt,nk,Vi};
6
6
 
7
- //# debugId=7591B26DF15D755E64756E2164756E21
8
- //# sourceMappingURL=studio-5g0ag7c0.js.map
7
+ //# debugId=F048EDEC156337CF64756E2164756E21
8
+ //# sourceMappingURL=studio-0q988f9w.js.map
@@ -0,0 +1,5 @@
1
+ import{i,w}from"./studio-cffqvnzd.js";var t="jx.collab.v1";function Rw(o){if(!w(o))return{offer:[],refused:null};let{collab:l,detail:n,protocols:e}=o;if(l===!1){let r=i(n)?n.trim():"";return{offer:[],refused:r||"This server has collaboration disabled."}}if(!Array.isArray(e)||e.length===0)return{offer:[],refused:null};if(e.includes(t))return{offer:[t],refused:null};let s=e.filter((r)=>i(r)).join(", ")||"none";return{offer:[],refused:`This server speaks collab envelope ${s}; this editor speaks ${t}.`}}
2
+ export{Rw};
3
+
4
+ //# debugId=95E0533EC97C072364756E2164756E21
5
+ //# sourceMappingURL=studio-0rt52vpq.js.map
@@ -0,0 +1,5 @@
1
+ import{Ln,D1,b,h,zr,bi}from"./studio-24mccdrj.js";import{xe,oe,v,Kr,E}from"./studio-wz73q5kq.js";import{Z1,f,Qe}from"./studio-ffrrncvz.js";import{rn}from"./studio-nwfrc98n.js";import{re}from"./studio-j1kvhdjk.js";import{ir,Wm,Hp,qd,lh}from"./studio-qvanvzfd.js";import{yn,hn}from"./studio-v8aga3vp.js";import{x}from"./studio-ynn90f58.js";import{VC,zC,jm}from"./studio-se2r3ptc.js";import{mt}from"./studio-0q988f9w.js";import{dt,sr,Gt,I,A,jn,Lt,co,Hn,tk}from"./studio-2jbs3rxv.js";import{Ta,IT,La,NT,oy,OT}from"./studio-6wkmf3wz.js";import{Xn}from"./studio-v2w7q8r1.js";import{nx}from"./studio-j430n16g.js";import{tT}from"./studio-8gmwgheg.js";import{Bb,iT,Vb,qS}from"./studio-a3shpz9y.js";import{B$,O,z$,qr}from"./studio-c7q0t9x1.js";import{Me}from"./studio-m6bdst11.js";import{i,te,T,w}from"./studio-cffqvnzd.js";import{we}from"./studio-a3g98wjr.js";var et={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};I("media-pane",et);function at(t,e){t.region=e.region,t.name=e.name,t.kind=e.kind,t.src=e.src,t.facts=e.facts,t.ref=e.ref,t.specimen=e.specimen,t.specimenFamily=e.specimenFamily,t.fontFace=e.fontFace,t.extLabel=e.extLabel,t.usageState=e.usageState,t.usageHeadline=e.usageHeadline,t.usageFiles=e.usageFiles,t.hasUsageFiles=e.usageFiles.length>0}function rt(t,e,a){t.replaceChildren();let r=v({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});at(r,e);let o=null,n=!1,s=A("media-pane",r,t).then((l)=>{if(n)l.dispose();else o=l;return l.root});return{attached:()=>{if(n)return!1;let l=o?.root;return l===void 0?!0:l instanceof HTMLElement&&t.contains(l)},dispose(){n=!0,o?.dispose(),o=null},ready:s,update:(l)=>at(r,l)}}var V="media",Vt=new Set([".woff",".woff2",".ttf",".otf"]),_t="The quick brown fox jumps over the lazy dog",M=new Map;function H(t){return M.get(t)??null}function FS(t,e){let a=H(t);return a!==null&&a.tabId===e.id&&a.wrap.isConnected&&a.surface.attached()}function Hb(t){let e=M.get(t);if(!e)return;e.scope.stop(),e.surface.dispose(),M.delete(t)}function Wt(t){let e=ir(t);if(Vt.has(e))return"font";let a=Hp({name:t});if(a==="image"||a==="video"||a==="audio")return a;return e===".pdf"?"embed":"unviewable"}function Jt(t,e){let a=[Hp({name:t})];if(e?.width!=null&&e.height!=null)a.push(`${e.width} × ${e.height}`);if(e?.bytes!=null)a.push(qS(e.bytes));if(e?.modified)a.push(`modified ${e.modified.slice(0,10)}`);return a.join(" · ")}function Bt(t){return`jx-specimen-${t.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function qt(t){let e=OT(t);if(e===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(t?.status==="ready"?t.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:e,usageState:"shown"}}async function Kt(t){let{openFileInTab:e}=await (we("j3knqf0s"),import("./files-j3knqf0s.js"));await e(t)}function XE(t,e){let{paneId:a,wrap:r}=t;if(FS(a,e))return;Hb(a);let o=e.documentPath??"",n=Bt(o),s=lh(o),l=qd(o),p=ir(o),c=Wt(o),d=null,m=()=>{if(d!==null&&H(a)===d)g()},k=()=>{let C=Bb(o),u=NT(o);if(C===null)iT(o).then(m);if(u===null||u.status==="pending")oy(o).then(m);return{extLabel:p||"this file",facts:Jt(o,C),fontFace:c==="font"?`@font-face { font-family: "${n}"; src: url("${s}"); }`:"",kind:c,name:o.split("/").pop()??"",ref:l,region:sr(a,"media"),specimen:_t,specimenFamily:`--jx-specimen-family: "${n}"`,src:s,...qt(u)}},g=()=>{d?.surface.update(k())},j=xe(),R=rt(r,k(),{copyRef:()=>{if("clipboard"in navigator)navigator.clipboard.writeText(l)},imageLoaded:(C,u)=>{if(Vb(o,C,u))m()},openDocument:(C)=>{Kt(C)}});d={paneId:a,scope:j,surface:R,tabId:e.id,wrap:r},M.set(a,d),j.run(()=>{oe(()=>{if(H(a)!==d)return;e.documentPath,g()})})}var Xt={children:[],tagName:"div"};function Qw(t){return Wm(t)}function Zt(t){return ir(t)===".svg"?[V,"source"]:[V]}function QE(t,e={}){let a=b.tabs.get(t);if(a)return bi(t,{focus:e.focus!==!1}),a;return zr({capabilities:{modes:Zt(t)},document:structuredClone(Xt),documentPath:t,id:t,sourceFormat:null,...e.paneId!==void 0&&{paneId:e.paneId},...e.preview===!0&&{preview:!0},...e.focus===!1&&{focus:!1}})}var Yt={children:[],tagName:"div"},Qt=new Set(["bunfig.json","jsconfig.json","package-lock.json","package.json","tsconfig.json","wrangler.json"]);function bm(t){let e=t.slice(t.lastIndexOf("/")+1);if(Qt.has(e)||e.endsWith(".schema.json"))return!1;return t.endsWith(".json")||Boolean(rn(t))}function it(t,e){if(t.startsWith("../")||t.includes("/../"))return`"${t}" is outside this project, so its comparison belongs to the project that owns it.`;if(e==="R")return"A renamed file's comparison needs both paths, and Studio does not model the old name yet.";if(Qw(t))return`"${t}" is an image or media file, and a comparison of one is not text.`;return null}function ee(){return["git-diff"]}function ae(t){let e=b.tabs.get(t);if(e)return bi(t),e;return zr({capabilities:{modes:ee()},document:structuredClone(Yt),documentPath:t,id:t,sourceFormat:null})}async function ot(t){if(!bm(t))return ae(t);let e=await (we("j3knqf0s"),import("./files-j3knqf0s.js"));return await e.openFileInTab(t,{}),[...b.tabs.values()].find((a)=>a.documentPath===t)??null}var P=[];function ie(){return Qe()&&te(f().listProjects)}async function Zw(){if(!ie()){P=[];return}try{P=await f().listProjects?.()??[]}catch{P=[]}}function YE(){return P}function nt(t){P=t}var st=2,ne=1e4;class lt extends Error{blockedBy;constructor(t,e){super(t.length===0?`Studio did not report ${st} consecutive quiet frames within ${e}ms`:`Studio was not idle after ${e}ms — blocked by ${t.join("; ")}`);this.name="NotIdleError",this.blockedBy=t}}function ct(){return[{blockers:()=>{let t=z$();return t>0?[`render: ${t} renderer(s) mid-paint`]:[]},name:"render"},{blockers:VC,name:"canvas"},{blockers:()=>{let t=Z1();if(t.length===0)return[];return[`platform: ${t.length} in-flight (${[...new Set(t)].join(", ")})`]},name:"platform"},{blockers:tk,name:"overlay"},{blockers:IT,name:"activity"},{blockers:tT,name:"grid"}]}function se(t=ct()){let e=[];for(let a of t)e.push(...a.blockers());return e}function pt(t={}){let{frames:e=st,now:a=()=>Date.now(),raf:r=(s)=>{requestAnimationFrame(()=>s())},sources:o=ct(),timeoutMs:n=ne}=t;return new Promise((s,l)=>{let p=a()+n,c=0,d=!1,m=[],k=()=>{if(d)return;let g=se(o);if(g.length>0)m=g,c=0;else if(c+=1,c>=e){d=!0,s();return}if(a()>=p){d=!0,l(new lt(g.length>0?g:m,n));return}r(k)};r(k)})}var ut=/\.toggle[A-Z]/;function le(t){return t.replace(/\.toggle([A-Z])/,(e,a)=>`.set${a}`)}function ht(t){return!ut.test(t.id)}var ce={"file.contextMenu":{disposition:"refused",note:"opening a menu to press an item names a control; the ITEM is the command"},"layers.contextMenu":{disposition:"refused",note:"matched RENDERED TEXT, which R1 of scripts/screenshots/README.md forbids; a row is addressed by its data-jx-path"},"media.browse":{disposition:"command",note:"media.browse, site-architecture.md §9.4"},"project.showWelcome":{disposition:"refused",note:"cold start is a startup profile (?profile=fresh), not an action"},"settings.setSection":{disposition:"refused",note:`mirrored the section registry's LABELS; say settings.open { section: "cssVars" }`},"view.setStatus":{disposition:"refused",note:"the status bar is not staged — if a capture needs a calm shell, the app must BE calm"}},pe=new Map(Object.entries(ce)),de={openSettings:'a user opens Settings — run("settings.open")',select:'a user selects a node — run("selection.set", { path })',setActivity:'a user picks a Navigator panel — run("navigator.showPanel", { panel })',setRightTab:'a user picks an Inspector tab — run("inspector.setTab", { tab })',setStatus:"the status bar reports what the app just did; staging it is the one lie the Remote Rule (studio.md §13.5) names outright",setZoom:'a user zooms — run("canvas.setZoom", { zoom })'},ue=new Map(Object.entries(de));function _(t,e){let a=t[e];if(a===void 0)return[];if(!Array.isArray(a))throw TypeError(`seed argument "${e}" must be an array`);return a}function me(t,e){let a=t[e];if(!T(a))throw TypeError(`seed argument "${e}" must be an object`);return a}function he(t,e){let a=t[e];if(a===void 0)return;if(!i(a))throw TypeError(`seed argument "${e}" must be a string`);return a}function ge(t){return[{boundary:"the assistant's model stream",id:"seed.assistant",run:(e)=>{t.seedAssistantMessages(_(e,"messages"))}},{boundary:"the collaboration websocket (awareness + sync)",id:"seed.collab",run:(e)=>{let a=h.value;if(!a)return;let r=Ln(a);r.status="synced",r.active=!0;let o=[];for(let n of _(e,"peers")){let s={...n.state};s.focusedPath??=a.documentPath,o.push({...n,state:s})}r.peers=o,qr()}},{boundary:"the Cloudflare Pages API",id:"seed.publish",run:(e)=>{let a=he(e,"accountId"),r={deployment:me(e,"deployment")};if(a)r.accountId=a;t.seedPublishConnected(r)}},{boundary:"the platform's git routes (`gitStatus` / `gitBranches` / `gitLog`)",id:"seed.git",run:(e)=>{let{status:a,branches:r,log:o}=e;x.git.status=a??null,x.git.branches=r??null,x.git.logEntries=o??null,x.git.loading=!1,x.git.error=null,qr()}},{boundary:"the platform's recent-projects store (desktop IPC / cloud API)",id:"seed.projectList",run:(e)=>{nt(_(e,"projects")),qr()}}]}class W extends Error{id;constructor(t,e){super(`automation refuses "${t}" — ${e}`);this.name="AutomationRefusedError",this.id=t}}function fe(t){let e=[];for(let a of t.visible()){if(!ht(a))continue;let r=t.disabledReason(a.id),o={enabled:r===void 0,id:a.id,title:a.title};if(a.args)o.args=a.args;if(r!==void 0)o.requires=r;e.push(o)}return e}function be(t,e,a){if(a.has(t))return`"${t}" is a seed, not a command — call seed("${t}", …)`;let r=pe.get(t);if(r?.disposition==="refused")return`"${t}" is refused by spec §13.5: ${r.note}`;if(r)return`"${t}" has no command record yet (${r.note}) — __jxAutomation.run projects the registry and nothing else`;let o=e.list().filter((n)=>ht(n)).map((n)=>n.id);return`unknown command "${t}" — the registry declares ${o.length} scriptable id(s)`}function ye(t){let e=new Map(ge(t).map((r)=>[r.id,r])),a=new Set(e.keys());return{probe:{commands:()=>fe(t.registry),idle:(r={})=>pt(r),pointAt:(r)=>zC(r.path),revealPath:(r)=>jm(r),seeds:()=>[...e.values()].map((r)=>({boundary:r.boundary,id:r.id})),state:()=>t.registry.context()},async run(r,o={}){if(ut.test(r))throw new W(r,`it names a delta against state the caller cannot observe; call "${le(r)}"`);let{registry:n}=t;if(!n.get(r))throw Error(be(r,n,a));await n.run(r,o)},async seed(r,o={}){let n=r.startsWith("seed.")?r.slice(5):r,s=ue.get(n);if(s)throw new W(r,`a seed stands in for a remote, never for a user: ${s}`);let l=e.get(r.startsWith("seed.")?r:`seed.${r}`);if(!l)throw Error(`unknown seed "${r}" — declared seeds are ${[...e.keys()].join(", ")}`);await l.run(o)}}}function Fb(t){return new URLSearchParams(t).get("automation")==="1"}function ZE(t){if(!Fb(location.search))return!1;return globalThis.__jxAutomation=ye(t),!0}var gt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioJxsuiteUpdate",$description:"The on-open offer to bring a project's `@jxsuite/*` dependencies up to their newest published versions: one sentence, and the packages that would move. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answers. Nothing here asks the registry or writes a manifest: `packages/jxsuite-update.ts` keeps the lookup, the dismissal key and the install, and this document only says what is on offer.",tagName:"jx-dialog",$props:{headline:"Update @jxsuite packages?",confirmLabel:"Update",cancelLabel:"Not now",size:"sm"},attributes:{part:"jxsuite-update"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'The old body was a lit template with no stylesheet at all, which is why the conversion is mostly a deletion. Two `<br />`s stood in for a paragraph break, and one `<span style="white-space: pre-line">` held every package as a single `\\n`-joined string — a list spelled as whitespace. Neither is addressable and neither announces as what it is, so a screen reader read one run-on line and a test could only match a substring of it. It is a `<ul>` of keyed rows now: the list says how many packages there are, and each row is `[data-package]`. The one token repair travels with it — that span asked for `--spectrum-font-size-75`, which resolves only inside `<sp-theme>`, and a document mounted in the dialog layer is outside it, so the size silently fell back to the hard-coded `12px` written beside it.','& [part="offer"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="lede"]':{margin:"0"},'& [part="list"]':{$description:"Capped and scrolling, because the count is the registry's rather than this dialog's: a project that has not been opened in a year can have every `@jxsuite/*` package behind at once, and a dialog that grows past the viewport puts its own Update button off screen.",listStyle:"none",margin:"0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",maxHeight:"240px",overflowY:"auto"},'& [part="package"]':{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"var(--jx-space-3)",fontSize:"var(--jx-text-sm)"},'& [part="package-name"]':{color:"var(--fg)"},'& [part="package-move"]':{$description:"Tabular figures, so a column of versions does not jitter between rows of different widths.",color:"var(--fg-dim)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"}},children:[{tagName:"div",attributes:{part:"offer"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Newer versions of these packages have been published. Update the project to them?"},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/packages"},key:{$ref:"$map/item/name"},map:{tagName:"li",attributes:{part:"package","data-package":"${$map.item.name}"},children:[{tagName:"span",attributes:{part:"package-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"package-move"},textContent:"${$map.item.current} → ${$map.item.target}"}]}}]}]}]};I("jxsuite-update",gt);function ft(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(dt,Gt("dialog","jxsuite-update")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},o=()=>a,n=v({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm()},packages:t.packages}),s=null,l=A("jxsuite-update",n,e).then(async(p)=>{s=p;let c=p.root;if(o())return p.dispose(),c;if(await jn(c),o())return c;return yn(c),c});return{close(){let p=s?.root;if(p instanceof HTMLElement)hn(p);s?.dispose(),s=null,e.remove(),r()},host:e,ready:l}}function jb(t){return t.replace(/^[\^~>=<v\s]+/,"").trim().split(/\s+/)[0]??""}function bt(t){if(t.includes(":"))return!1;return/^\d+\.\d+/.test(jb(t))}function yt(t){let e=jb(t).split(/[-+]/)[0]??"",[a=0,r=0,o=0]=e.split(".").map((n)=>Math.trunc(Number(n))||0);return[a,r,o]}function $e(t,e){let a=yt(t),r=yt(e);for(let o=0;o<3;o++){let n=a[o]??0,s=r[o]??0;if(n!==s)return n<s?-1:1}return 0}function Xw(t,e){if(!bt(t)||!bt(e))return!1;return $e(e,t)>0}var J="@jxsuite/";async function B(){let t=f();if(!t.packageVersions)return[];let e;try{e=await t.packageVersions()}catch{return[]}let a=[];for(let r of e)if(r.name.startsWith(J)&&Xw(r.current,r.latest))a.push({current:r.current,dev:Boolean(r.dev),latest:r.latest,name:r.name});return a}function vt(t,e){let a=e.map((r)=>`${r.name}@${r.latest}`).toSorted().join(",");return`jx:jxsuite-update-dismissed:${t}:${a}`}function Se(t,e){try{return localStorage.getItem(vt(t,e))==="1"}catch{return!1}}function ke(t,e){try{localStorage.setItem(vt(t,e),"1")}catch{}}async function q(t){let e=f();if(!e.setPackageVersions||t.length===0)return;let a=La({status:"Updating @jxsuite packages…",title:"Updating dependencies"});try{let r=await e.setPackageVersions(t.map((o)=>({dev:o.dev,name:o.name,version:`^${o.latest}`})));if(r.ok)a.done(),E.success(`Updated ${t.length} @jxsuite package(s) to their latest versions.`);else a.fail(r.log??"Update failed")}catch(r){a.fail(r instanceof Error?r.message:String(r))}}function je(t){return new Promise((e)=>{let a=!1,r=(l)=>{if(a)return;a=!0,e(l)},o=!1,n=()=>{if(o)return;o=!0,s.close()},s=ft({layer:Lt("dialog"),onCancel:()=>{n()},onClosed:()=>{r(!1),n()},onConfirm:()=>{r(!0),n()},packages:t.map((l)=>({current:l.current,name:l.name,target:`^${l.latest}`}))})})}async function Cp(t){if(Fb(location.search))return;if(!f().setPackageVersions)return;let a=await B();if(a.length===0||Se(t,a))return;if(!await je(a)){ke(t,a);return}await q(a)}var F=["package.json","bun.lock","bun.lockb"],Ce=new Set(["??","U"]),Pe=25;function D(t){if(Array.isArray(t))return t.map((e)=>D(e));if(w(t)){let e={};for(let[a,r]of Object.entries(t).toSorted(([o],[n])=>o<n?-1:1))e[a]=D(r);return e}return t}function wt(t){let e={...t};for(let a of["dependencies","devDependencies"]){let r=e[a];if(!w(r))continue;let o={...r};for(let n of Object.keys(o))if(n.startsWith(J))o[n]="*";e[a]=o}return e}function Ne(t,e){if(t===null||e===null)return!1;let a,r;try{a=JSON.parse(t),r=JSON.parse(e)}catch{return!1}if(!w(a)||!w(r))return!1;return JSON.stringify(D(wt(a)))===JSON.stringify(D(wt(r)))}async function G(t,e){try{return await f().gitShow({path:t,ref:e})}catch{return null}}async function $t(t){try{return await f().readFile(t)}catch{return null}}async function St(t){let e=[],a=[],r=!0;for(let o of F){let n=t.files.filter((p)=>p.path===o);if(n.length===0)continue;let s=await G(o,"@{u}");if(n.every((p)=>Ce.has(p.status))){if(s!==null)a.push(o);continue}let l=await G(o,"HEAD");if(s===null||s===l)continue;if(e.push(o),o==="package.json")r&&=Ne(l,await $t(o))}return{automated:r,discard:e,removeUntracked:a}}function kt(t){return t.discard.length===0&&t.removeUntracked.length===0}async function Ae(t){let e=[...new Set(t.files.filter((a)=>!F.includes(a.path)).map((a)=>a.path))];if(e.length>Pe)return!0;for(let a of e){let r=await G(a,"@{u}");if(r!==null&&r!==await G(a,"HEAD"))return!0}return!1}async function Te(t){let e=f();if(t.discard.length>0)await e.gitUnstage(t.discard),await e.gitDiscard(t.discard);for(let a of t.removeUntracked)await e.deleteFile(a)}async function K(){let t=f(),e=[];try{e=await B()}catch{e=[]}if(e.length>0&&t.setPackageVersions){await q(e);return}if(!t.installDependencies)return;let a=La({status:"Running bun install…",title:"Syncing dependencies"});try{let r=await t.installDependencies();if(r.ok)a.done();else a.fail(r.log??"bun install failed")}catch(r){a.fail(re(r))}}async function jt(t){let e=f();try{await Te(t)}catch(a){throw Error(`Could not reset local package files: ${re(a)}`,{cause:a})}try{await e.gitPull()}catch(a){throw await K(),a}E.warn("Local package updates were superseded by pulled changes.",{source:"Source Control"}),await K()}async function Re(t){let e=f(),a;try{a=await e.gitStatus()}catch{throw t}if(!(a.behind>0))throw t;let r=await St(a);if(kt(r)||await Ae(a))throw t;if(!r.automated){if(!await co("Discard local package changes?","package.json / bun.lock have local edits that conflict with incoming changes. Discard them, pull, and re-sync packages?",{confirmLabel:"Discard and pull",destructive:!0}))throw t}await jt(r)}async function xt(){let t;try{let e=await f().listDirectory("");t=new Set(e.filter((a)=>a.type==="file").map((a)=>a.name))}catch{t=new Set(F)}return Promise.all(F.map((e)=>t.has(e)?$t(e):Promise.resolve(null)))}async function X(){let t=f(),e=await xt(),a=null;try{await t.gitFetch(),a=await t.gitStatus()}catch{a=null}if(a&&a.behind>0){let o=await St(a);if(!kt(o)&&o.automated){await jt(o);return}}try{await t.gitPull()}catch(o){await Re(o);return}let r=await xt();if(e.some((o,n)=>o!==r[n]))await K()}async function kp(){let t=f();try{let e=await t.gitStatus();if(!e.isRepo||!Array.isArray(e.remotes)||e.remotes.length===0)return}catch{return}E.info("Syncing project…",{key:"project.sync",source:"Source Control"});try{await X()}catch(e){E.warn("The project could not be synced with its remote.",{detail:re(e),key:"project.sync",source:"Source Control",tier:"problem"})}}var Ct={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubPublish",$description:"Create GitHub Repository: the three things the flow needs before it calls the API — the repository's name, an optional description, and whether it is private. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answer buttons. Nothing here reaches GitHub: `github/github-publish.ts` keeps the token, the request and the activity, and this document only collects.",tagName:"jx-dialog",$props:{headline:"Create GitHub Repository",confirmLabel:"Create Repository",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-publish"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'What is NOT here is most of the conversion. `.github-publish-dialog` was a flex column with an 8px gap and `8px 0` of padding: the gap is the one thing it said that nothing else draws, and `jx-dialog`\'s own body already pads the content, so only the gap survives. `.github-publish-dialog sp-textfield { width: 100% }` had nothing to transcribe either — a `jx-field` row is a grid whose control cell stretches, so the field fills the row without being told to. The three `sp-field-label`s are gone with them, because `jx-field` draws the label AND names the control from it; the third of them carried no `for` at all, so "Visibility" was text beside a switch rather than a name for it.','& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"}},children:[{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Repository name"},attributes:{part:"row","data-field":"name"},children:[{tagName:"jx-textfield",$props:{placeholder:"my-project",value:{$ref:"#/state/name"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Description (optional)"},attributes:{part:"row","data-field":"description"},children:[{tagName:"jx-textfield",$props:{placeholder:"A brief description",value:{$ref:"#/state/description"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDescription"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Visibility"},attributes:{part:"row","data-field":"visibility"},children:[{tagName:"div",$description:'The row opens with a plain `div`, and that is the whole reason it exists: `jx-field` names the first thing slotted into it that observes `labelledby`, so a switch slotted straight in would be announced "Visibility" over the top of the words printed beside it. A `div` observes no naming, so the switch keeps the name its own label gives it.',attributes:{part:"visibility-row"},children:[{tagName:"jx-switch",attributes:{part:"toggle"},$props:{checked:{$ref:"#/state/isPrivate"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setPrivate"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Private repository"}]}]}]}]}]};I("github-publish",Ct);function Pt(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(dt,Gt("dialog","github-publish")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},o=()=>a,n=v({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm({description:n.description,isPrivate:n.isPrivate,name:n.name})},description:"",isPrivate:!0,name:t.name,setDescription:(c)=>{n.description=c},setName:(c)=>{n.name=c},setPrivate:(c)=>{n.isPrivate=c}}),s=null,l=A("github-publish",n,e).then(async(c)=>{s=c;let d=c.root;if(o())return c.dispose(),d;if(await jn(d),o())return d;return yn(d),d});return{close(){if(a)return;let c=s?.root;if(c instanceof HTMLElement)hn(c);s?.dispose(),s=null,e.remove(),r()},host:e,ready:l}}var L=["Create the repository","Add the remote","Push"];function De(t){return new Promise((e)=>{let a=!1,r=(n)=>{if(a)return;a=!0,e(n)},o=Pt({layer:Lt("dialog"),name:t,onCancel:()=>{o.close()},onClosed:()=>{r(null)},onConfirm:(n)=>{r({...n,name:n.name||t}),o.close()}})})}async function Z({projectName:t}){let e=await nx();if(!e)return!1;let a=await De(t);if(!a)return!1;let r=Ta({source:"Source Control",status:`Creating ${a.name}…`,steps:[...L],title:"Create GitHub repository"});r.step(L[0]);let o;try{o=await fetch("https://api.github.com/user/repos",{body:JSON.stringify({auto_init:!1,description:a.description,name:a.name,private:a.isPrivate}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e}`,"Content-Type":"application/json"},method:"POST"})}catch(p){return r.log(re(p)),r.fail("Could not reach GitHub to create the repository.",{action:"git.createGithubRepository"}),!1}if(!o.ok){let p=await o.json();return r.log(p.errors?.[0]?.message||p.message||`GitHub answered ${o.status}.`),r.fail("Could not create the GitHub repository.",{action:"git.createGithubRepository"}),!1}let n=await o.json();r.log(`Created ${n.html_url}`);let s=f();r.step(L[1]);try{await s.gitAddRemote("origin",n.clone_url)}catch(p){return r.log(re(p)),r.fail("The repository was created, but the remote could not be added.",{action:"panel.focus.git"}),!1}r.step(L[2]);try{await s.gitPush({setUpstream:!0})}catch(p){return r.log(re(p)),r.fail("The repository was created, but the push failed.",{action:"git.push"}),!1}let{refreshGitStatus:l}=await (we("84ps5dex"),import("./git-panel-84ps5dex.js"));return await l(),r.done(n.html_url),E.success(`Repository created: ${n.html_url}`,{key:"github.repo"}),!0}var Nt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelGit",$description:"The Navigator's Source Control panel: what git says about this project, and every verb that answers. It has four moods and the adapter names which one — no project, a first read still in flight, a project git is not tracking yet, and a repository — so nothing here asks whether `status` is null or what `isRepo` means. Under the fourth mood it draws the sync bar (with or without a remote), the branch row, the two sub-tabs, and then either the commit form over the changed files or the log. `panels/git-panel.ts` keeps every decision: what a comparison is, which files group under which component, what a status letter reads aloud, what a commit does before it runs, and which of the four verbs a row's buttons are. Rows arrive as strings and booleans, keyed by path.",tagName:"div",attributes:{part:"git-panel"},style:{$description:"The sixty-odd `.git-*` rules in `styles/overlays.css`, keyed on `part` and carried here. Four token repairs travel with them, all of the shape `surfaces/panel-imports.json` describes: `--spectrum-font-size-75` and `--spectrum-font-size-50` resolved only inside `<sp-theme>` and a document is mounted outside it, so every rule that read one would silently have taken its px fallback — they are `--jx-text-md` (12px) and `--jx-text-sm` (11px) here, at the same values, and the bare `10px` literals are `--jx-text-xs`. The one deliberate move is the two headline values, the sync label and the branch name: they were 13px, which is not a step on the scale, and they take `--jx-text-lg` (14px). Three rules are DELETED rather than moved, because the kit already draws them: the sub-tab strip's own fill, hover and selected underline are `jx-tabs`/`jx-tab`, the branch picker's box is `jx-select`, and `.git-split-btn`'s hand-built dropdown is the kit menu (see `openCommitMenu`). And one is repaired: a row's action buttons were `opacity: 0` until the ROW was hovered, so tabbing to Stage moved the keyboard onto an invisible control — the reveal is `:focus-within` as well as `:hover`.",display:"flex",flexDirection:"column",height:"100%",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"Drawn here rather than borrowed from `panels/empty-state.ts`, which is a lit template a document cannot call. What is kept is the pattern's rules (studio-ui-guidelines.md §11): one sentence saying what the region is for, then the action that fills it.",display:"flex",flex:"1",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-5)",textAlign:"center",color:"var(--fg-dim)"},'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-actions"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="sync-bar"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6), and it has exactly two items: `sync-head` (Refresh and the status, which never split) and what answers the status (the Fetch/Pull/Push group, or Create GitHub repository with no remote). It was a single line whose only shrinkable item was the status text, so a narrow Navigator never moved a button: it broke "3 behind / Last updated 09:04 AM" into a column one word wide (25px at the 160px floor) and painted "(no" under Create GitHub repository at the default 240px. Now the second item drops to a line of its own when the two no longer fit, and where that happens is decided by the status text\'s own width (a count, a locale\'s clock), never by a breakpoint. The row gap is the smaller step so a wrapped bar reads as one block.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="sync-bar"][data-remote="none"], & [part="sync-bar"][data-remote="none"] > [part="sync-head"]':{$description:"The no-remote bar keeps its tighter 8px between Refresh and the sentence, and on both axes: the head carries that gap now that Refresh and the text sit in it rather than in the bar.",gap:"var(--jx-space-3)"},'& [part="sync-head"]':{$description:"Refresh and the status, as one item of the bar, so wrapping never leaves the icon alone on a line above its text. `flex: 1 1 auto` makes its basis the status text's own width, which is the wrap threshold; with `min-width: 0` it can then shrink below that when it is alone on a line, and the status wraps as a sentence rather than word by word.",display:"flex",flex:"1 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="sync-text"]':{$description:"`1 1 auto` rather than `1`: the head's basis decides whether the verbs fit beside it, and it should be the status text's own width. An auto basis says that directly; the `0%` basis of `flex: 1` only reaches the same answer through how an engine treats a percentage while it measures.",display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="sync-label"]':{fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="sync-time"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="sync-actions"]':{$description:"The verbs never shrink: they are what moves. `margin-left: auto` keeps them at the inline end whether they share the status's line or sit on one of their own.",display:"flex",flex:"none",marginLeft:"auto"},'& [part="branch-row"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6) of two items, `branch-head` and the picker. It was a single line with the picker capped at 40% of it, so a long branch name was cut twice ("chor…" beside "cho…") and a narrow Navigator word-stacked "Active / branch". Now the picker drops below the name when the two no longer fit, at a width the name decides.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"10px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="branch-head"]':{$description:"The branch icon and the name, as one item so the icon is never alone on a line. The 999:1 grow ratio against the picker gives nearly all spare room to the name while the two share a line, so the picker stays the width of the branch it shows; once the picker wraps, it is alone and takes the whole line. A third item in this row needs its own flex decision.",display:"flex",flex:"999 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="branch-icon"]':{$description:"The hand-drawn 18px branch SVG this panel carried is the kit's `git-branch` glyph — the same key `PanelRecord.icon` already names for this panel's rail button, so the two drawings cannot drift.",flex:"none","--jx-icon-size":"18px",color:"var(--fg-dim)"},'& [part="branch-text"]':{display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="branch-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="branch-name"]':{overflow:"hidden",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="branch-picker"]':{$description:"Sized by the branch it shows while it shares the name's line, and the full width of the row once it wraps below it, which is where a long branch name finally reads whole. `min-width: 0` is the kit's own default, restated because studio-ui-guidelines.md §4.6 asks it of every flex child: when even a line of its own is narrower than the name, the picker shrinks and the kit's preview ellipsizes.",flex:"1 1 auto",minWidth:"0"},'& [part="tab"]':{$description:`The sub-tabs may shrink below their labels. A flex item's automatic minimum is its content, and a tab's label is nowrap, so "Local Changes (3)" and "History" held 179px against the 159px the Navigator has at its 160px floor and scrolled the whole panel sideways; the kit's label ellipsis could never engage. \`inspector-dock.json\` makes the same call for its tabs. It is a surface decision and not a kit default because the document tab strip deliberately scrolls instead.`,minWidth:"0"},'& [part="create-repository"] > [part="control"], & [part="init"] > [part="control"], & [part="clone"] > [part="control"], & [part="commit-button"] > [part="control"]':{$description:`The panel's labelled buttons wrap their words at the Navigator's floor instead of overflowing it. The kit's control is nowrap, which is right for a toolbar and made each label a floor of its own: "Create GitHub repository" held 165px in a 135px sync bar, "Clone Git Repository" and "Initialize Repository" held 141px and 135px in the empty state's 127px, and "Commit and sync" beside its menu had about a pixel to spare in the commit form's 135px. Nothing changes where the label fits, because a nowrap label and a wrapping one have the same max-content width. This reaches into the kit's \`control\` part as \`commandbar.json\` does for its primary button.`,whiteSpace:"normal"},'& [part="commit"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="commit-label"]':{fontWeight:"500",color:"var(--fg-dim)"},'& [part="commit-actions"]':{display:"flex",gap:"var(--jx-space-2)"},'& [part="commit-button"]':{flex:"1"},'& [part="section"]':{borderBottom:"1px solid var(--border)"},'& [part="section-header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-3) var(--jx-space-4) 6px",fontWeight:"700",color:"var(--fg)"},'& [part="count"]':{$description:"The pill beside a section title. `margin-inline-end: auto` is what pushes the section's own button to the right edge — it was a second rule (`.git-section-header .git-count`) over the same element, and there is only one place a count is drawn.",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"18px",height:"18px",marginInlineEnd:"auto",padding:"0 5px",borderRadius:"9px",background:"var(--accent-15)",color:"var(--accent)",fontSize:"var(--jx-text-xs)",fontWeight:"600"},'& [part="group"]':{marginBottom:"var(--jx-space-1)"},'& [part="group-header"]':{display:"flex",alignItems:"center",gap:"6px",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="group-name"]':{fontWeight:"500",color:"var(--fg)"},'& [part="file-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-1) var(--jx-space-3) var(--jx-space-1) var(--jx-space-5)"},'& [part="file-row"]:hover':{background:"var(--hover-bg)"},'& [part="file-open"]':{$description:"A REAL button, because it does something. It was a bare span with a cursor and a `title`: not focusable, no role, and Enter did nothing — so the panel's primary verb was mouse-only. A `<button>` needs no role, no tabindex and no key handler of its own, which is three lines of the old row that simply go.",display:"flex",flex:"1",alignItems:"baseline",gap:"6px",minWidth:"0",margin:"0",padding:"0",overflow:"hidden",border:"none",borderRadius:"var(--radius)",background:"none",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="file-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-dir"]':{overflow:"hidden",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-actions"]':{$description:"Revealed on `:focus-within` as well as on the row's hover. Opacity alone hid a control the keyboard could still reach: tabbing through a changed file landed on an invisible Stage button.",display:"flex",flex:"none",opacity:"0"},'& [part="file-row"]:hover [part="file-actions"], & [part="file-actions"]:focus-within':{opacity:"1"},'& [part="badge"]':{$description:"One letter and a colour, which is why every row's open button carries the status in words as well.",flex:"none",width:"16px",color:"var(--signal)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",fontWeight:"700",textAlign:"center"},'& [part="badge"][data-status="A"], & [part="badge"][data-status="U"]':{color:"var(--success)"},'& [part="badge"][data-status="D"]':{color:"var(--danger)"},'& [part="badge"][data-status="R"], & [part="badge"][data-status="C"]':{color:"var(--tag)"},'& [part="history"]':{flex:"1",overflowY:"auto",padding:"var(--jx-space-2) 0"},'& [part="history-list"]':{margin:"0",padding:"0",listStyle:"none"},'& [part="history-entry"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",padding:"6px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="history-entry"]:hover':{background:"var(--hover-bg)"},'& [part="history-hash"]':{color:"var(--accent)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)"},'& [part="history-message"]':{color:"var(--fg)"},'& [part="history-meta"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="status"]':{margin:"0",padding:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",textAlign:"center"},'& [part="failure"]':{$description:"The panel's own refusal banner. It is `failure` rather than `error` because the branch picker and the commit field each draw a permanent, empty `[part=\"error\"]` of their own inside this same light-DOM tree: under that name this padding, rule and wash drew a 16×13 box over both fields' top-left corners that took the click, and dressed either field's real refusal sentence as a banner.",margin:"0",padding:"6px var(--jx-space-3)",borderBottom:"1px solid var(--border)",background:"color-mix(in srgb, var(--danger) 8%, transparent)",color:"var(--danger)",fontSize:"var(--jx-text-sm)"},"@(forced-colors: active)":{'& [part="failure"]':{$description:"The wash behind the banner collapses into the page when every author colour is replaced, so the border is what is left to mark it.",border:"1px solid CanvasText",color:"CanvasText"}}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/view"},cases:{"no-project":{tagName:"div",attributes:{part:"empty","data-view":"no-project"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Source control keeps every version of a project, so any change can be undone. Open a project to see its history."},{tagName:"div",attributes:{part:"clone-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canClone"},cases:{true:{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"clone","data-action":"clone"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clone"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"download-simple"}},{tagName:"span",textContent:"Clone Git Repository"}]}]}}}]},loading:{tagName:"p",attributes:{part:"status","data-view":"loading"},textContent:"Loading…"},"no-repo":{tagName:"div",attributes:{part:"empty","data-view":"no-repo"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"This project is not tracked by git yet. Start tracking it to keep a history of every change and to publish it anywhere."},{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"init","data-action":"init"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/initRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"Initialize Repository"}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}]},repo:{tagName:"div",attributes:{part:"repo",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"remote-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/remoteState"},cases:{remote:{tagName:"div",attributes:{part:"sync-bar","data-remote":"yes"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"${state.syncLabel}"},{tagName:"span",attributes:{part:"updated-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLastUpdated"},cases:{true:{tagName:"span",attributes:{part:"sync-time"},textContent:"${state.lastUpdated}"}}}]}]},{$description:"Three quiet tools, so NOT compact. A compact group draws every member's frame and fill whatever its quiet says, so the `quiet: true` each verb below writes would have been silently framed into a segmented control; Spectrum's group here was quiet and never compact, which is what compact=false and the 2px gap between the verbs restore.",tagName:"jx-action-group",attributes:{part:"sync-actions"},$props:{label:"Remote actions",compact:!1},children:[{tagName:"jx-action-button",attributes:{part:"fetch","data-action":"fetch"},$props:{icon:"download-simple",size:"sm",quiet:!0,label:"Fetch",hint:"Fetch",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/fetch"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"pull","data-action":"pull"},$props:{icon:"arrow-down",size:"sm",quiet:!0,label:{$ref:"#/state/pullLabel"},hint:{$ref:"#/state/pullLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pull"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"push","data-action":"push"},$props:{icon:"arrow-up",size:"sm",quiet:!0,label:{$ref:"#/state/pushLabel"},hint:{$ref:"#/state/pushLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/push"},value:[]}]}}]}]},local:{tagName:"div",attributes:{part:"sync-bar","data-remote":"none"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"Local only (no remote)"}]}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}}},{tagName:"div",attributes:{part:"branch-row"},children:[{tagName:"div",attributes:{part:"branch-head"},children:[{tagName:"jx-icon",attributes:{part:"branch-icon"},$props:{name:"git-branch"}},{tagName:"div",attributes:{part:"branch-text"},children:[{tagName:"span",attributes:{part:"branch-label"},textContent:"Active branch"},{tagName:"span",attributes:{part:"branch-name"},textContent:"${state.branchName}"}]}]},{tagName:"jx-select",attributes:{part:"branch-picker"},$props:{label:"Switch branch",size:"sm",options:{$ref:"#/state/branchOptions"},value:{$ref:"#/state/branchValue"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/chooseBranch"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-tabs",attributes:{part:"tabs",selected:"${state.subTab}"},$props:{label:"Source control views"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectTab"},value:[{$ref:"event#/detail"}]}]},children:[{tagName:"jx-tab",attributes:{part:"tab","data-tab":"changes",value:"changes",label:"${state.changesLabel}",panel:"git-panel-body"}},{tagName:"jx-tab",attributes:{part:"tab","data-tab":"history",value:"history",label:"History",panel:"git-panel-body"}}]},{tagName:"div",attributes:{part:"body",id:"git-panel-body",role:"tabpanel","data-tab":"${state.subTab}"},style:{display:"contents"},$switch:{$ref:"#/state/subTab"},cases:{changes:{tagName:"div",attributes:{part:"changes",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"commit","data-jx-region":"navigator/panel:git/commit"},children:[{tagName:"span",attributes:{part:"commit-label",id:"git-commit-label"},textContent:"Please write a commit message"},{tagName:"jx-textfield",attributes:{part:"commit-input","data-field":"commit-message"},$props:{labelledby:"git-commit-label",multiline:!0,size:"sm",placeholder:"Describe your changes",value:{$ref:"#/state/commitMessage"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editMessage"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{if:{operator:"||",target:{$ref:"event#/ctrlKey"},value:{$ref:"event#/metaKey"}},then:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/commit"},value:[]}]}]}}]}},{tagName:"div",attributes:{part:"commit-actions"},children:[{tagName:"jx-button",attributes:{part:"commit-button","data-action":"commit-and-sync"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitAndSync"},value:[]}]},children:[{tagName:"span",textContent:"Commit and sync"}]},{tagName:"jx-action-button",attributes:{part:"commit-menu","data-action":"commit-menu"},$props:{icon:"caret-down",size:"sm",label:"More commit options",hint:"More commit options",haspopup:"menu"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openCommitMenu"},value:[{$ref:"event#/currentTarget"}]}]}}]}]},{tagName:"div",attributes:{part:"staged-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasStaged"},cases:{true:{tagName:"section",attributes:{part:"section","data-section":"staged","aria-label":"Staged Changes"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Staged Changes"},{tagName:"span",attributes:{part:"count"},textContent:"${state.stagedCount}"},{tagName:"jx-action-button",attributes:{part:"unstage-all","data-action":"unstage-all"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage all",hint:"Unstage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstageAll"},value:[]}]}}]},{$prototype:"Array",items:{$ref:"#/state/stagedFiles"},key:{$ref:"$map/item/key"},map:{$description:"One changed file. Every row opens the file it names — renderability decides which VIEW opens, not whether the row responds — and carries the two or three verbs its staged state allows. `$map/item` inside a nested map is the FILE, which is why the row hands its own path back to every action rather than an index.",tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}},{tagName:"section",attributes:{part:"section","data-section":"changed","aria-label":"Changed Components"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Changed Components"},{tagName:"span",attributes:{part:"count"},textContent:"${state.changedCount}"},{tagName:"span",attributes:{part:"stage-all-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasUnstaged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"stage-all","data-action":"stage-all"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage all",hint:"Stage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stageAll"},value:[]}]}}}}]},{tagName:"div",attributes:{part:"groups-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"div",attributes:{part:"groups"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"group-header"},children:[{tagName:"span",attributes:{part:"group-name"},textContent:"${$map.item.name}"}]},{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"changes"},textContent:"Nothing to commit. Files you edit and save show up here."}}}]}]},history:{tagName:"div",attributes:{part:"history"},children:[{tagName:"div",attributes:{part:"history-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/historyState"},cases:{listed:{tagName:"ul",attributes:{part:"history-list"},children:[{$prototype:"Array",items:{$ref:"#/state/commits"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"history-entry","data-hash":"${$map.item.hash}"},children:[{tagName:"span",attributes:{part:"history-hash"},textContent:"${$map.item.hash}"},{tagName:"span",attributes:{part:"history-message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"history-meta"},textContent:"${$map.item.meta}"}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"history"},textContent:"No commits yet. Each commit you make is a version you can come back to."}}}]}}},{tagName:"div",attributes:{part:"busy-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/busy"},cases:{true:{tagName:"p",attributes:{part:"status","data-status":"busy"},textContent:"Loading…"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.error}"}}}]}}}]};I("git-panel",Nt);function At(t,e){t.view=e.view,t.canClone=e.canClone,t.busy=e.busy,t.hasError=e.hasError,t.error=e.error,t.remoteState=e.remoteState,t.syncLabel=e.syncLabel,t.lastUpdated=e.lastUpdated,t.hasLastUpdated=e.hasLastUpdated,t.pullLabel=e.pullLabel,t.pushLabel=e.pushLabel,t.branchName=e.branchName,t.branchValue=e.branchValue,t.branchOptions=e.branchOptions,t.subTab=e.subTab,t.changesLabel=e.changesLabel,t.commitMessage=e.commitMessage,t.hasStaged=e.hasStaged,t.stagedCount=e.stagedCount,t.stagedFiles=e.stagedFiles,t.changedCount=e.changedCount,t.hasUnstaged=e.hasUnstaged,t.filesState=e.filesState,t.groups=e.groups,t.historyState=e.historyState,t.commits=e.commits}function Le(){return{branchName:"",branchOptions:[],branchValue:"",busy:!1,canClone:!1,changedCount:"0",changesLabel:"Local Changes",commitMessage:"",commits:[],error:"",filesState:"empty",groups:[],hasError:!1,hasLastUpdated:!1,hasStaged:!1,hasUnstaged:!1,historyState:"empty",lastUpdated:"",pullLabel:"Pull",pushLabel:"Push",remoteState:"local",stagedCount:"0",stagedFiles:[],subTab:"changes",syncLabel:"",view:"loading"}}function Tt(t,e,a){let r=v({...Le(),...a});At(r,e);let o=null,n=!1;return A("git-panel",r,t).then((s)=>{if(n){s.dispose();return}o=s}),{connected:()=>!n&&(o===null||o.root.parentNode===t),dispose(){n=!0,o?.dispose(),o=null},update:(s)=>{At(r,s)}}}async function Rc(){if(!O)return;let t=f(),{git:e}=x;e.loading=!0,e.error=null;try{let[a,r]=await Promise.allSettled([t.gitStatus(),t.gitBranches()]);if(a.status==="fulfilled")e.status=a.value;if(r.status==="fulfilled")e.branches=r.value;let o=a.status==="rejected"?a.reason:r.status==="rejected"&&a.value.isRepo?r.reason:null;if(o)e.error=re(o);e.lastUpdated=Kr(),e.rev+=1,await Ee()}catch(a){e.error=re(a)}finally{e.loading=!1}}async function Ee(){let t=x.git.diffState;if(!t)return;let e=x.git.status?.files.find((a)=>a.path===t.filePath);if(!e||!Mt(e.status)){x.git.diffState=null;return}try{x.git.diffState=await z(t.filePath,e.status)}catch{}}async function jS(t){x.git.rev+=1;let e=x.git.diffState;if(!t||e?.filePath!==t)return;try{x.git.diffState=await z(t,e.fileStatus)}catch{}}async function ex(t){let e=f();if(!e.gitClone){E.warn("Cloning is not supported on this platform.",{source:"Source Control"});return}let a=await Hn("Clone Git Repository",{confirmLabel:"Clone",message:"Repository URL",placeholder:"https://github.com/user/repo.git",validate:(r)=>r.trim()?"":"Enter a repository URL."});if(!a)return;try{E.info("Cloning repository…",{key:"git.clone",source:"Source Control"});let r=await e.gitClone(a);if(r.root)E.success("Clone complete.",{key:"git.clone"}),await t.openRecentProject(r.root)}catch(r){E.error("Could not clone the repository.",{detail:re(r),key:"git.clone",source:"Source Control"})}}function tx(){return Qe()&&Boolean(f().gitClone)}var Ue=new Map([["A","added"],["D","deleted"],["M","modified"],["R","renamed"],["U","untracked"]]),Ie=new Set(["M","A","U","D"]);function Mt(t){return Ie.has(t)}async function z(t,e){let a=f(),r=e!=="A"&&e!=="U",o=e!=="D",[n,s]=await Promise.all([r?a.gitShow({path:t,ref:"HEAD"}):Promise.resolve(""),o?a.readFile(t):Promise.resolve("")]);return{currentContent:s,filePath:t,fileStatus:e,originalContent:n}}async function HS(t,e){try{return await z(t,e)}catch(a){return console.warn("loadDiffForLens:",re(a)),null}}async function Ft(){try{E.info("Initializing repository…",{key:"git.init"}),await f().gitInit(),E.success("Repository initialized.",{key:"git.init"})}catch(t){E.error("Could not initialize the repository.",{action:"git.init",detail:re(t),key:"git.init",source:"Source Control"});return}await Rc()}async function Oe(){await y((t)=>t.gitPush())}async function ze(){if(await nx())E.success("Signed in to GitHub.",{key:"github.auth"})}async function y(t){let e=f();x.git.loading=!0,x.git.error=null;try{return await t(e),await Rc(),!0}catch(a){return x.git.error=re(a),x.git.loading=!1,!1}}function Dt(t){if(!x.git.commitMessage)x.git.commitMessage=t}async function He(){x.git.loading=!0,x.git.error=null;try{await X(),await Rc()}catch(t){x.git.error=re(t),x.git.loading=!1}}var N=null;async function Ve(){let t=f();try{x.git.logEntries=await t.gitLog(30)}catch(e){x.git.error=re(e)}}var U={},Y=null;function Et(t){let e=t.path.split("/"),a=e.pop()??t.path,r=e.join("/");return{cannotDiscard:t.status==="U",dir:r,hasDir:r!=="",key:t.path,label:`${t.path}, ${Ue.get(t.status)??"changed"}`,name:a,path:t.path,staged:Boolean(t.staged),status:t.status}}function _e(t){let e=new Map;for(let a of t){let r=a.path.split("/"),o;if(a.path.endsWith(".json")||a.path.endsWith(".class.json")||rn(a.path))o=r.length>1?`/${r.at(-2)}`:`/${r[0]}`;else o="Other";let n=e.get(o);if(!n)n=[],e.set(o,n);n.push(a)}return[...e.entries()].map(([a,r])=>({files:r.map((o)=>Et(o)),key:a,name:a}))}function We(t){return{hash:t.hash.slice(0,7),key:t.hash,message:t.message,meta:`${t.author} · ${ra(t.date)}`}}function Je(t){return t?`Last updated ${new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:""}function Ut(){if(!O)return"no-project";let{error:t,loading:e,status:a}=x.git;if(!a&&!e&&!t)return"loading";return a&&!a.isRepo?"no-repo":"repo"}function Q(){let{branches:t,commitMessage:e,error:a,lastUpdated:r,loading:o,logEntries:n,status:s,subTab:l}=x.git,p=s?.files??[],c=p.filter((u)=>u.staged),d=p.filter((u)=>!u.staged),m=[...c,...d],k=!s?.ahead&&!s?.behind,g=s?.ahead?`${s.ahead} ahead`:"",j=s?.behind?`${s.behind} behind`:"",R=n??[];return{branchName:(t?.current??s?.branch??"")||"—",branchOptions:[...(t?.branches??[]).map((u)=>({label:u,value:u})),{label:"+ New branch…",value:tt}],branchValue:Y??t?.current??"",busy:Boolean(o),canClone:tx(),changedCount:String(m.length),changesLabel:m.length>0?`Local Changes (${m.length})`:"Local Changes",commitMessage:e,commits:R.map((u)=>We(u)),error:a??"",filesState:m.length>0?"listed":"empty",groups:_e(m),hasError:Boolean(a),hasLastUpdated:Boolean(r),hasStaged:c.length>0,hasUnstaged:d.length>0,historyState:R.length>0?"listed":"empty",lastUpdated:Je(r),pullLabel:j?`Pull (${j})`:"Pull",pushLabel:g?`Push (${g})`:"Push",remoteState:Array.isArray(s?.remotes)&&s.remotes.length>0?"remote":"local",stagedCount:String(c.length),stagedFiles:c.map((u)=>Et(u)),subTab:l,syncLabel:k?"Up to date":`${g}${g&&j?", ":""}${j}`,view:Ut()}}var tt="__new__";function It(t){return x.git.status?.files.find((e)=>e.path===t)}async function Ot(){let t=x.git.commitMessage.trim();if(!t)return;if(x.git.commitMessage="",await D1(),!await y((e)=>e.gitCommit(t)))Dt(t)}async function Be(){let t=x.git.commitMessage.trim();if(!t)return;x.git.commitMessage="",x.git.loading=!0,x.git.error=null,await D1();let e=f(),a=!1;try{await e.gitCommit(t),a=!0,await e.gitPush(),await Rc()}catch(r){if(x.git.error=re(r),x.git.loading=!1,!a)Dt(t)}}async function qe(t){let{branches:e,status:a}=x.git;if(t===tt){Y=tt,Rt();let r=await Hn("New Branch",{confirmLabel:"Create",message:`Branching from ${e?.current||a?.branch||"the current branch"}.`,placeholder:"feature/my-change",validate:(o)=>o.trim()?"":"Enter a branch name."});if(Y=null,Rt(),r)await y((o)=>o.gitCreateBranch(r));return}if(t!==e?.current)await y((r)=>r.gitCheckout(t))}async function Ke(t){let e=It(t);if(!e)return;let a=Mt(e.status)?it(e.path,e.status):`"${e.path}" has no change this view can open.`;if(a){x.git.error=a;return}try{x.git.loading=!0;let r=await z(e.path,e.status);x.git.diffState=r;let o=await ot(e.path);if(U.setGitDiffState?.(r),o)U.setCanvasMode?.(o,"git-diff")}catch(r){x.git.error=`Failed to load diff: ${re(r)}`}finally{x.git.loading=!1}}async function Xe(t){if(It(t)?.status==="U")return;if(!await co("Discard Changes",`Discard changes to ${t}?`,{confirmLabel:"Discard",destructive:!0}))return;await y((a)=>a.gitDiscard([t]))}function Ze(t){(we("ynw13y0s"),import("./menu-ynw13y0s.js")).then(({openMenu:e})=>{e({label:"Commit options",opener:t,place:(a)=>{let r=Me(t);return{x:Math.max(4,r.right-a.width),y:r.bottom+4}},region:"git-commit",rows:[{destructive:!1,disabled:!1,dividerAbove:!1,id:"git.commitWithoutSync",run:()=>{Ot()},title:"Commit (don't sync)"}]})})}function Ye(t){if(x.git.subTab=t,t==="history"&&!x.git.logEntries)Ve()}var ta={chooseBranch:(t)=>{qe(t)},clone:()=>{U.cloneRepository?.()},commit:()=>{Ot()},commitAndSync:()=>{Be()},createRepository:()=>{Z({projectName:O?.name||"my-project"})},discard:(t)=>{Xe(t)},editMessage:(t)=>{x.git.commitMessage=t},fetch:()=>{y((t)=>t.gitFetch())},initRepository:()=>{Ft()},openCommitMenu:Ze,openFile:(t)=>{Ke(t)},pull:()=>{He()},push:()=>{y((t)=>t.gitPush())},refresh:()=>{Rc()},selectTab:Ye,stage:(t)=>{y((e)=>e.gitStage([t]))},stageAll:()=>{let t=(x.git.status?.files??[]).filter((e)=>!e.staged).map((e)=>e.path);y((e)=>e.gitStage(t))},unstage:(t)=>{y((e)=>e.gitUnstage([t]))},unstageAll:()=>{let t=(x.git.status?.files??[]).filter((e)=>e.staged).map((e)=>e.path);y((e)=>e.gitUnstage(t))}},S=null;function zt(){if(!S)return;S.scope.stop(),S.handle.dispose(),S=null}function Rt(){S?.handle.update(Q())}function ea(){if(N)return;N=setInterval(()=>{if(x.leftTab==="git"&&!x.git.loading)Rc()},B$)}function aa(t,e){U=e;let a=t.querySelector(".panel-content")??t;if(Qe()&&Ut()==="loading")Rc();if(S&&(S.host!==a||!S.handle.connected()))zt();if(S)return;let r=Tt(a,Q(),ta),o=xe();o.run(()=>{oe(()=>{let n=Q();if(n.view==="repo")ea();r.update(n)})}),S={handle:r,host:a,scope:o}}function ra(t){let e=new Date(t),a=Kr()-e.getTime(),r=Math.floor(a/60000);if(r<1)return"just now";if(r<60)return`${r}m ago`;let o=Math.floor(r/60);if(o<24)return`${o}h ago`;let n=Math.floor(o/24);if(n<30)return`${n}d ago`;return e.toLocaleDateString()}function ia(){return[{category:"Source Control",id:"git.init",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"an open project that git is not already tracking",when:(t)=>t.project.open,enablement:(t)=>!t.project.isRepo,run:async()=>{await Ft()},title:"Initialize Repository"},{category:"Source Control",id:"git.createGithubRepository",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await Z({projectName:O?.name||"my-project"})},title:"Create GitHub Repository"},{category:"Source Control",id:"git.push",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await Oe()},title:"Push"},{category:"Source Control",id:"git.signInToGithub",level:"application",menus:["palette"],group:"7_scm",run:async()=>{await ze()},title:"Sign In to GitHub"}]}function BS(t){t.registerAll(ia())}function ym(){if(N)clearInterval(N),N=null;zt()}function VS(){Xn({id:"git",title:"Source Control",railLabel:"Source",level:"project",dock:"navigator",icon:"git-branch",badge:(t)=>t.git.dirtyCount||null,render:()=>mt,afterRender:(t,e)=>{aa(e,t.deps)}})}
2
+ export{Zw,YE,Fb,ZE,jb,Xw,Cp,kp,FS,Hb,XE,Qw,QE,bm,Rc,jS,ex,tx,HS,BS,ym,VS};
3
+
4
+ //# debugId=3457B85F71380CB764756E2164756E21
5
+ //# sourceMappingURL=studio-18vgbhs5.js.map
@@ -1,5 +1,5 @@
1
- import{kk}from"./studio-geq1ea6k.js";import{T,R,vs,Om}from"./studio-e7xxa0sj.js";import{v}from"./studio-vzacdfsc.js";import{Oe}from"./studio-a9yzstqj.js";var w={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMenu",$description:"A Studio menu: one jx-menu whose rows are a projection of command records the adapter hands in as `rows`. Nothing here decides what a row says; a row prints its record's title, chord, disabled reason and destructive flag, a divider falls where the adapter marked a group boundary, and a row with children owns a one-level submenu of the same shape. The chord and the reason are rendered only when present, so a row's text is its title.",tagName:"jx-menu",$props:{label:{$ref:"#/state/label"},x:{$ref:"#/state/x"},y:{$ref:"#/state/y"},floor:{$ref:"#/state/floor"},placement:{$ref:"#/state/placement"}},onselect:{$ref:"#/state/select"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"},haspopup:{$ref:"$map/item/haspopup"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}},{tagName:"span",attributes:{slot:"submenu"},$switch:{$ref:"$map/item/haspopup"},cases:{true:{tagName:"jx-menu",$props:{label:{$ref:"$map/item/submenuLabel"}},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}}]}]}}]}}}]}]}}]};T("menu",w);var M="block-end span-inline-end";function j(e){if(e.placement!==void 0)return e.placement;return e.opener&&!e.origin&&!e.place&&!e.floor?M:""}function E(e){if(!e)return{x:0,y:0};let n=Oe(e);return{x:Math.round(n.left),y:Math.round(n.bottom)}}function p(e,n=0){let r=n===0?(e.children??[]).map((t)=>p(t,1)):[];return{...e,checked:e.checked??"",children:r,chord:e.chord??"",enabled:!e.disabled,haspopup:r.length>0,noChord:!e.chord,noDivider:!e.dividerAbove,requires:e.requires??"",submenuLabel:e.submenuLabel??e.title}}function N(e,n){for(let r of e){if(r.id===n)return r;let t=r.children.find((d)=>d.id===n);if(t)return t}return}var L={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Nt(e){let n=vs("popover",e.region),r=new AbortController,t=null,d=null,i=!1,f=()=>{if(i)return;i=!0,r.abort(),d?.(),d=null,Om("popover",e.region),P(e.opener??null),e.onClosed?.(u)},h=e.place?e.place(L):e.origin??E(e.opener),l=v({floor:e.floor?.()??0,label:e.label,placement:j(e),rows:e.rows.map((o)=>p(o)),select:(o,m)=>{let a=String(m.detail),s=N(l.rows,a);if(!s)return;if(s.run)s.run();else e.run?.(a);u.close()},x:h.x,y:h.y}),b=()=>{if(i||!t||!e.place)return;let o=e.place(Oe(t));l.x=o.x,l.y=o.y},y=(async()=>{let o=await R("menu",l,n,{signal:r.signal});if(r.signal.aborted)return;if({dispose:d}=o,t=o.root,t.addEventListener("toggle",(a)=>{if(a.newState==="closed")f()}),!t.hasAttribute("popover"))await new Promise((a)=>{t.addEventListener("jx-ready",()=>a(),{once:!0})});if(r.signal.aborted)return;let m=e.opener instanceof HTMLElement&&e.opener!==document.body?e.opener:void 0;t.showPopover(m?{source:m}:void 0),b(),requestAnimationFrame(b)})(),u={close:()=>{if(i)return;if(t?.open)t.hidePopover();f()},host:n,ready:y,setRows:(o)=>{if(i)return;let a=document.activeElement?.closest("jx-menu"),s=a&&a!==t?a.parentElement?.closest("jx-menu-item")?.dataset.commandId:void 0;l.rows=o.map((c)=>p(c)),setTimeout(()=>{if(i||!t||t.contains(document.activeElement))return;let c=s?t.querySelector(`jx-menu-item[data-command-id="${s}"]`):null,g=c?.querySelector("jx-menu")??null;if(c&&!(g?.open&&g.querySelector("jx-menu-item")))c.focus();else kk(t)},0)}};return u}function P(e){let n=document.activeElement;if(e?.isConnected&&(!n||n===document.body))e.focus()}
2
- export{Nt};
1
+ import{ak}from"./studio-v8aga3vp.js";import{I,A,Ns,hg}from"./studio-2jbs3rxv.js";import{v}from"./studio-wz73q5kq.js";import{Me}from"./studio-m6bdst11.js";var y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMenu",$description:"A Studio menu: one jx-menu whose rows are a projection of command records the adapter hands in as `rows`. Nothing here decides what a row says; a row prints its record's title, chord, disabled reason and destructive flag, a divider falls where the adapter marked a group boundary, and a row with children owns a one-level submenu of the same shape. The chord and the reason are rendered only when present, so a row's text is its title.",tagName:"jx-menu",$props:{label:{$ref:"#/state/label"},x:{$ref:"#/state/x"},y:{$ref:"#/state/y"},floor:{$ref:"#/state/floor"},placement:{$ref:"#/state/placement"}},onselect:{$ref:"#/state/select"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"},haspopup:{$ref:"$map/item/haspopup"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}},{tagName:"span",attributes:{slot:"submenu"},$switch:{$ref:"$map/item/haspopup"},cases:{true:{tagName:"jx-menu",$props:{label:{$ref:"$map/item/submenuLabel"}},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}}]}]}}]}}}]}]}}]};I("menu",y);var j="block-end span-inline-end";function E(e){if(e.placement!==void 0)return e.placement;return e.opener&&!e.origin&&!e.place&&!e.floor?j:""}function N(e){if(!e)return{x:0,y:0};let n=Me(e);return{x:Math.round(n.left),y:Math.round(n.bottom)}}function p(e,n=0){let r=n===0?(e.children??[]).map((t)=>p(t,1)):[];return{...e,checked:e.checked??"",children:r,chord:e.chord??"",enabled:!e.disabled,haspopup:r.length>0,noChord:!e.chord,noDivider:!e.dividerAbove,requires:e.requires??"",submenuLabel:e.submenuLabel??e.title}}function P(e,n){for(let r of e){if(r.id===n)return r;let t=r.children.find((l)=>l.id===n);if(t)return t}return}function Bt(e){let n=Ns("popover",e.region),r=new AbortController,t=null,l=null,i=!1,f=()=>{if(i)return;i=!0,r.abort(),l?.(),l=null,hg("popover",e.region),L(e.opener??null),e.onClosed?.(u)},h=e.place?e.place(new DOMRect):e.origin??N(e.opener),d=v({floor:e.floor?.()??0,label:e.label,placement:E(e),rows:e.rows.map((o)=>p(o)),select:(o,c)=>{let a=String(c.detail),s=P(d.rows,a);if(!s)return;if(s.run)s.run();else e.run?.(a);u.close()},x:h.x,y:h.y}),b=()=>{if(i||!t||!e.place)return;let o=e.place(Me(t));d.x=o.x,d.y=o.y},g=()=>r.signal.aborted,x=(async()=>{let o=await A("menu",d,n,{signal:r.signal});if(g())return;if({dispose:l}=o,t=o.root,t.addEventListener("toggle",(a)=>{if(a.newState==="closed")f()}),!t.hasAttribute("popover"))await new Promise((a)=>{t.addEventListener("jx-ready",()=>a(),{once:!0})});if(g())return;let c=e.opener instanceof HTMLElement&&e.opener!==document.body?e.opener:void 0;t.showPopover(c?{source:c}:void 0),b(),requestAnimationFrame(b)})(),u={close:()=>{if(i)return;if(t?.open)t.hidePopover();f()},host:n,ready:x,setRows:(o)=>{if(i)return;let a=document.activeElement?.closest("jx-menu"),s=a&&a!==t?a.parentElement?.closest("jx-menu-item")?.dataset.commandId:void 0;d.rows=o.map((m)=>p(m)),setTimeout(()=>{if(i||!t||t.contains(document.activeElement))return;let m=s?t.querySelector(`jx-menu-item[data-command-id="${s}"]`):null,w=m?.querySelector("jx-menu")??null;if(m&&!(w?.open&&w.querySelector("jx-menu-item")))m.focus();else ak(t)},0)}};return u}function L(e){let n=document.activeElement;if(e?.isConnected&&(!n||n===document.body))e.focus()}
2
+ export{Bt};
3
3
 
4
- //# debugId=7280D90AC8977E7664756E2164756E21
5
- //# sourceMappingURL=studio-pxg4ap1e.js.map
4
+ //# debugId=9DD79CE7AF79B57F64756E2164756E21
5
+ //# sourceMappingURL=studio-1fxkaaea.js.map
@@ -0,0 +1,5 @@
1
+ import{xe,bl,oe,v,he,au,E}from"./studio-wz73q5kq.js";import{Qd}from"./studio-vmfkgdjf.js";import{f}from"./studio-ffrrncvz.js";import{Li,rn,Go}from"./studio-nwfrc98n.js";import{dk,S_,cc,lR,mv,uk,hk,uR,yg}from"./studio-d81xfh1g.js";import{og,Dt,ai,ao,ul,O}from"./studio-c7q0t9x1.js";import{Te,ne,sg,ag,K1}from"./studio-y21g8zzg.js";import{i,ee,at,T,Xi,dc,Rh}from"./studio-cffqvnzd.js";import{we}from"./studio-a3g98wjr.js";var Et=new Set(["Adlm","Arab","Aran","Armi","Avst","Cprt","Egyd","Egyh","Elym","Gara","Hatr","Hebr","Hluw","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogd","Sogo","Syrc","Thaa","Todr","Yezi"]),i_="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$";function oo(e){if(!i(e)||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function My(e){return oo(e)!==null}function e$(e){let t=oo(e);if(t===null)return"ltr";let n=new Intl.Locale(t),o=n.script??n.maximize().script;return o!==void 0&&Et.has(o)?"rtl":"ltr"}function bn(e){let t=oo(e);if(t===null)return i(e)?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}var Nt="prefix-except-default";function Br(e){let t=e.i18n,n=[];if(!T(t))return{errors:n,i18n:null};let o=Array.isArray(t.locales)?t.locales:[],r=[];for(let l of o){let c=oo(l);if(c===null){n.push(`i18n.locales: "${String(l)}" is not a well-formed BCP 47 language tag.`);continue}if(!r.includes(c))r.push(c)}let s=oo(t.defaultLocale)??r[0]??null;if(t.defaultLocale!==void 0&&oo(t.defaultLocale)===null)n.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(s===null)return n.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:n,i18n:null};if(!r.includes(s))r.unshift(s);let a=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:Nt;return{errors:n,i18n:{defaultLocale:s,locales:r,routing:a}}}function ch(e,t){let n=fe(U(e),t);if(n===-1||t===null)return null;return oo(U(e)[n])}function t$(e,t){let n=ch(e,t);if(n!==null||t===null||t.routing!=="prefix-except-default")return n;return U(e)[0]==="pages"?t.defaultLocale:null}function S1(e,t){let n=U(e),o=fe(n,t);return o===-1?n.join("/"):n.filter((r,s)=>s!==o).join("/")}function dh(e,t,n){if(n===null)return null;let o=oo(t);if(o===null||!n.locales.includes(o))return null;let r=U(e),s=fe(r,n),a=s===-1?Mt(r):s;if(a===-1)return null;let l=s===-1?r:r.filter((c,u)=>u!==s);if(o===n.defaultLocale&&n.routing==="prefix-except-default")return l.join("/");return l.toSpliced(a,0,o.toLowerCase()).join("/")}function U(e){return e.replace(/^\.\//,"").split("/").filter(Boolean)}function fe(e,t){if(t===null)return-1;return e.findIndex((n)=>{let o=oo(n);return o!==null&&t.locales.includes(o)})}function Mt(e){if(e[0]==="pages"&&e.length>1)return 1;if(e[0]==="content"&&e.length>2)return 2;return-1}var Lt=new Map([["design","canvas"],["edit","canvas"],["entry","entry"],["git-diff","diff"],["grid","grid"],["manage","library"],["media","media"],["preview","canvas"],["settings","config"],["source","code"],["stylebook","config"]]),Fy={canvas:"Canvas",code:"Code",config:"Project Styles",diff:"Diff",entry:"Entry",grid:"Grid",media:"Media",library:"Library",none:"None"};function Da(e){return Lt.get(e)??"canvas"}var Ft=new Map([["design","design"],["edit","edit"],["preview","preview"]]);function n$(e){return Ft.get(e)??"design"}var jy=(e)=>e.editor.kind==="canvas",Jd=(e)=>jy(e)&&e.selection.count>0,Hy=(e)=>Jd(e)&&!e.selection.isRoot;function Km(){return{project:{open:!1,isSite:!1,isRepo:!1,isMultilingual:!1},git:{ahead:0,behind:0,dirtyCount:0},document:{open:!1,dirty:!1,mode:"",canUndo:!1,canRedo:!1},editor:{kind:"none"},canvas:{view:"design"},pane:{count:1,derived:!1},selection:{count:0,paths:[],kind:"",isRoot:!1,isComponentInstance:!1,isLayoutNode:!1,isRepeater:!1},caret:{active:!1,inCanvas:!1},focus:{region:"pane"},modal:{open:!1},collab:{attached:!1,readOnly:!1,sourceCanonical:!1},ai:{configured:!1,streaming:!1,waiting:!1},capability:{gitClone:!1,importSite:!1,openProjectInNewWindow:!1,dataRows:!1,windowControls:!1,findReferences:!1,readFileBytes:!1}}}function r_(e={}){let t=Km();for(let n of Object.keys(e)){let o=e[n];if(o)Object.assign(t[n],o)}return t}var _t=["palette"],Vt=["caret","global"],Wt=["dock","global"],Bt=["canvas","global"],Ut=["grid","global"],Kt=["code","global"],Le=["global"];function i$(e){if(e.modal.open)return _t;if(e.caret.active)return Vt;if(e.focus.region!=="pane")return Wt;switch(e.editor.kind){case"grid":return Ut;case"code":return Kt;case"canvas":return e.canvas.view==="preview"?Le:Bt;default:return Le}}var pe=v(new Set);function Wp(e){pe.add(e)}function By(e){pe.delete(e)}function o_(e){return pe.has(e)}function Gm(e,t){return{success:!0,data:e,summary:t}}function Zi(e){return{success:!1,error:e}}function rr({name:e,description:t,parameters:n,strict:o=!0,llmStrict:r=!1,interactive:s,execute:a}){let l={name:e,description:t,parameters:n,strict:o,llmStrict:r,execute:a};if(s!==void 0)l.interactive=s;return l}function Vy(e){let t=[];return{record(n){t.push(n),e?.(n)},writes:t}}function Yd(e=null,t={}){let n=new Map(Object.entries(t));return{sessionId:e,get:(o)=>n.get(o),set:(o,r)=>{n.set(o,r)},toJSON:()=>Object.fromEntries(n)}}var Ht=new AbortController().signal;function Wy(e={}){let t=e.session??Yd();return{actor:e.actor??{id:`assistant:${t.sessionId??"local"}:`,kind:"assistant",sessionId:t.sessionId,turnId:""},callId:e.callId??"",ledger:e.ledger??Vy(),progress:e.progress??(()=>{}),session:t,signal:e.signal??Ht}}function r$(e){let t=new AbortController;if(e.aborted)return t.abort(e.reason),{release:()=>{},signal:t.signal};let n=()=>{t.abort(e.reason)};return e.addEventListener("abort",n,{once:!0}),{release:()=>{e.removeEventListener("abort",n)},signal:t.signal}}function C1(){let e=new Map;return{register(t){if(e.has(t.name))console.warn(`Tool "${t.name}" is being re-registered.`);e.set(t.name,t)},list(){return[...e.values()]},listForLLM(){return[...e.values()].map((t)=>{let n={name:t.name,description:t.description,parameters:t.parameters};if(t.llmStrict===!0)n.strict=!0;return{type:"function",function:n}})},getDefinition(t){return e.get(t)},validate(t,n){let o=e.get(t);if(!o)return{valid:!1,errors:[`Unknown tool: "${t}"`]};if(!o.strict)return{valid:!0};let r=o.parameters;if(!r.properties)return{valid:!0};let s=[],a=r.properties,l=r.required||[];for(let c of l)if(!(c in n)||n[c]===void 0||n[c]===null)s.push(`Missing required argument: "${c}"`);for(let[c,u]of Object.entries(n)){let d=a[c];if(!d)continue;let p=d.type;if(!p)continue;let g=Fe(u);if(p==="number"||p==="integer"){if(ge(u,"number"))continue;if(ge(u,"string")){if(!Number.isNaN(Number(u)))continue;s.push(`Argument "${c}" should be a number, got non-numeric string "${u}"`);continue}s.push(`Argument "${c}" should be a number, got ${g}`);continue}if(p==="string"&&g!=="string")s.push(`Argument "${c}" should be a string, got ${g}`);else if(p==="boolean"&&g!=="boolean")s.push(`Argument "${c}" should be a boolean, got ${g}`);else if(p==="array"&&g!=="array")s.push(`Argument "${c}" should be an array, got ${g}`);else if(p==="object"&&g!=="object")s.push(`Argument "${c}" should be an object, got ${g}`)}return s.length>0?{valid:!1,errors:s}:{valid:!0}},async execute(t,n,o=Wy()){let r=e.get(t);if(!r)return Zi(`Unknown tool: "${t}"`);let s=this.validate(t,n);if(!s.valid)return Zi(`Validation failed: ${(s.errors||[]).join("; ")}`);try{return await r.execute(n,o)}catch(a){return Zi(`Tool "${t}" execution error: ${me(a)}`)}}}}function Gt(e){return JSON.parse(JSON.stringify(e))}function me(e){return e.message}var Yt=["string","number","boolean","undefined"];function ge(e,t){return typeof e===t}function qt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Fe(e){if(Array.isArray(e))return"array";return Yt.find((t)=>ge(e,t))??"object"}function zt(e){if(!e)return{};let t=JSON.parse(e);if(!qt(t)){let n=t===null?"null":Fe(t);throw TypeError(`arguments must be a JSON object, got ${n}`)}return t}async function o$(e,t,n){let o=!1,r;try{let s=zt(t.argumentsText);o=!0,r=await e.execute(t.name,s,n)}catch(s){r=Zi(`Failed to parse arguments: ${me(s)}`)}try{return{status:"done",result:Gt(r),executed:o}}catch(s){let a=me(s);return{status:"done",result:Zi(`Tool "${t.name}" returned a result that cannot be serialized: ${a}`),executed:o}}}var K=[],Zt=50;function s$(e){return Object.assign(Vy(),{turnId:e})}function a$(e,t){if(t.length===0)return[];let n={id:e,writes:[...t]};K.push(n);while(K.length>Zt)K.shift();return n.writes}function s_(e){return K.find((t)=>t.id===e)?.writes??[]}function l$(e){let t=e.filter((l)=>l.ok),n=new Set(t.map((l)=>l.path)),o=e.length-t.length;if(n.size===0)return o>0?`${o} change${o===1?"":"s"} failed`:"";let r=`Changed ${n.size} file${n.size===1?"":"s"}`,s=new Set(t.flatMap((l)=>l.disk?[l.path]:[])),a=[r];if(s.size>0)a.push(`${s.size} written to disk — undo cannot reach ${s.size===1?"it":"them"}`);if(o>0)a.push(`${o} failed`);return a.join(" · ")}function a_(){K.splice(0)}function c$(e,t){let n=null;for(let o=e.length-1;o>=0;o--){let r=e[o];if(r.id===t)return n;let s=r.role==="assistant"&&(r.content||(r.toolCalls?.length??0)>0);if(n===null&&s)n=r.id}return t===void 0?n:null}function L1(e,t){if(!i(t)||t==="")return e;let n=e.indexOf("#"),o=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),s=r.indexOf("?"),a=s===-1?r:r.slice(0,s),c=(s===-1?[]:r.slice(s+1).split("&")).filter((u)=>u!==""&&!Xt(u));return c.push(`v=${encodeURIComponent(t)}`),`${a}?${c.join("&")}${o}`}function Xt(e){let t=e.indexOf("="),n=t===-1?e:e.slice(0,t);if(n==="v")return!0;if(!n.includes("%"))return!1;try{return decodeURIComponent(n)==="v"}catch{return!1}}function Qt(e,t){if(!e||!Object.hasOwn(e,t))return;let n=e[t];return i(n)?n:void 0}function Zm(e,t,n=[]){if(!e||!t)return null;let o=e.replaceAll("\\","/").replace(/^\.\//,""),r=null,s=(a,l)=>{if(o.startsWith(`${a}/`)&&(!r||a.length>r.dir.length))r={dir:a,urlPrefix:l}};for(let[a,l]of Object.entries(t)){if(!l?.source||!S_.test(a))continue;let c=tn(l.source);if(c===""||c.startsWith(".."))continue;if(c.includes(cc)){let u=en(o,c,a,n);if(u)s(u.dir,u.urlPrefix);continue}if(/\.[a-z0-9]+$/i.test(c))continue;s(c,`/${dk}/${a}`)}return r}function en(e,t,n,o){let r=t.indexOf(cc),s=t.slice(0,r),a=t.slice(r+cc.length);if(!e.startsWith(s))return null;let l=e.slice(s.length).split("/")[0]??"";if(l===""||!S_.test(l))return null;let c=o.find((d)=>d.toLowerCase()===l.toLowerCase());if(c===void 0||!S_.test(c))return null;return{dir:`${s}${l}${a}`.replace(/\/+$/,""),urlPrefix:`/${dk}/${n}/${c}`}}function tn(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/\/+$/,"")}function Xm(e,t){if(!t||e==="")return null;if(t.space==="repo"){if(!t.fileBaseUrl)return null;let o=uR(e,t.documentDir,t.mounts,t.lanes);if(o===null)return null;let{suffix:r}=mv(e);return L1(`${t.fileBaseUrl}${yg(o)}${r}`,Qt(t.versions,o))}let[n]=t.mounts;return n?nn(e,t.documentDir,n):null}function nn(e,t,n){if(uk(e))return null;let{path:o,suffix:r}=mv(e),s;try{s=decodeURIComponent(o)}catch{return null}let a=hk(t,s);if(a===null)return null;let l=lR([n],a);if(!l)return null;return`${l}${r}`}function _e(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}function H(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/\/+$/,"")}function Ve(e){return e??O?.projectConfig??null}function We(e){return e?.content??{}}function on(e){let t=Br(e??{}).i18n?.locales??[];return t.length>0?[...t]:null}function Be(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function Ue(e){if(e.format==="json")return{ext:".json",unresolvedFormat:null};if(e.format===void 0||e.format==="")return{ext:Go()?.extensions[0]??".json",unresolvedFormat:null};let t=Li(e.format);return t?.extensions[0]===void 0?{ext:null,unresolvedFormat:e.format}:{ext:t.extensions[0],unresolvedFormat:null}}function sn(e,t){let n=t===null?"[^/]+":`(?:${t.map((r)=>_e(r)).join("|")})`,o=H(e).split(cc).map((r)=>_e(r)).join(n);return new RegExp(`^${o}(?:/|$)`,"i")}function an(e,t,n){let o=sn(e,n).exec(t);if(!o)return null;return o[0].replace(/\/$/,"")}function ln(e){return H(e).replaceAll(cc,"").length}function Gp(e,t){if(e===null||e===void 0||e==="")return null;let n=Ve(t),o=on(n),r=H(e),s=null,a=-1;for(let[l,c]of Object.entries(We(n))){let{source:u}=c;if(u===void 0||u===""||Be(u))continue;let d=ln(u);if(d<=a)continue;let p=an(u,r,o);if(p===null)continue;s={def:c,dir:r,fileBacked:!1,isSourceRoot:r.length===p.length,name:l,...Ue(c)},a=d}return s}function u_(e,t){if(e===null||e===void 0||e==="")return null;let n=Ve(t),o=H(e),r=o.toLowerCase();for(let[s,a]of Object.entries(We(n))){let{source:l}=a;if(l===void 0||l===""||!Be(l))continue;let c=H(l).toLowerCase();if(r===c||r.endsWith(`/${c}`))return{def:a,dir:o.includes("/")?o.slice(0,o.lastIndexOf("/")):".",fileBacked:!0,isSourceRoot:!1,name:s,...Ue(a)}}return Gp(o.includes("/")?o.slice(0,o.lastIndexOf("/")):".",n)}function tc(e){return e.replaceAll(/([A-Z])/g," $1").replace(/^./,(t)=>t.toUpperCase())}function nv(e){return e.replaceAll(/[^a-zA-Z0-9]+(.)?/g,(t,n)=>n?n.toUpperCase():"").replace(/^[A-Z]/,(t)=>t.toLowerCase())}function iv(e){return e.replaceAll(/(^|-)(\w)/g,(t,n,o)=>(n?" ":"")+o.toUpperCase())}function h_(e,t){return e?.$label||tc(t)}function I$(e,t){if(e?.$label)return e.$label;if(t.includes("-"))return t.replaceAll(/(^|-)(\w)/g,(n,o,r)=>(o?" ":"")+r.toUpperCase());return tc(t)}function Oa(e){return e==="image"||e==="uri-reference"}function Zd(e){if(e.$shorthand===!0)return"shorthand";if(e.$input==="button-group")return"button-group";if(e.$input==="media")return"media";if(e.format==="color")return"color";if(Oa(e.format))return"media";if(e.$units!==void 0)return"number-unit";if(e.type==="number")return"number";if(Array.isArray(e.enum))return"select";if(Array.isArray(e.examples)||Array.isArray(e.presets))return"combobox";return"text"}function ph(e,t){if(!e||!t?.content)return null;let n=u_(e,t);if(!n||!n.def.schema)return null;if(!n.fileBacked){let o=n.ext??Go()?.extensions[0]??".json";if(!e.toLowerCase().endsWith(o.toLowerCase()))return null}return{name:n.name,schema:n.def.schema}}function Qm(e,t){let n=e.trim().toLowerCase().replaceAll(/[^a-z0-9\s-]/g,"").replaceAll(/\s+/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");if(!n)return"";return`${t}${n}`}function rv(e,t){return e.replace(new RegExp(`^${t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}`),"").replace(/^--/,"").replaceAll("-"," ").replaceAll(/\b\w/g,(n)=>n.toUpperCase())||e}function D$(e){if(!e)return{kind:"text"};let t=e.trim().replaceAll(/\s*\|\s*undefined\b/g,"").trim();if(t==="boolean")return{kind:"boolean"};if(t==="number")return{kind:"number"};if(t.match(/^'[^']*'(\s*\|\s*'[^']*')+$/))return{kind:"combobox",options:[...t.matchAll(/'([^']*)'/g)].map((r)=>r[1])};return{kind:"text"}}function Wr(e){return JSON.parse(JSON.stringify(e))}function Oe(e){return e?.at(-1)??null}function u$(e){return e?.[0]??null}function Uy(e,t){if(!t||!e)return!1;return e.some((n)=>ao(n,t))}function Rs(e){return F(e)}function F(e){let t=[];for(let n of e)t.push([...n]);return t}function qy(e,t){if(Uy(e,t))return F(e.filter((n)=>!ao(n,t)));return[...F(e),[...t]]}function h$(e,t,n){let o=e.findIndex((a)=>ao(a,n)),r=t?e.findIndex((a)=>ao(a,t)):-1;if(o===-1||r===-1)return[[...n]];let s=r<=o?e.slice(r,o+1):e.slice(o,r+1).toReversed();return F(s)}function Ke(e,t){return F(e.filter((n)=>!ul(t,n)))}function cn(e,t){let n=Math.min(e.length,t.length);for(let o=0;o<n;o++){let r=e[o],s=t[o];if(r===s)continue;if(ee(r)&&ee(s))return r-s;return String(r)<String(s)?-1:1}return e.length-t.length}function un(e){return F(e.filter((t)=>!e.some((n)=>!ao(n,t)&&ul(n,t))))}function Up(e){return _(e)!==null}function _(e){let t=e?.at(-1);return e&&e.at(-2)==="children"&&ee(t)?{index:t,parentPath:e.slice(0,-2)}:null}function Ky(e){return un(e).filter((t)=>Up(t)).toSorted((t,n)=>cn(n,t))}function p$(e){let t=[];for(let n of e)if(!t.some((o)=>ao(o,n)))t.push([...n]);return t}function qp(e){if(e.length===0)return{mixed:!1,value:void 0};let[t]=e,n=JSON.stringify(t??null);for(let o=1;o<e.length;o++)if(JSON.stringify(e[o]??null)!==n)return{mixed:!0,value:void 0};return{mixed:!1,value:t}}var He=null;function f$(e){He=e}function Ge(){return He}var G=null,q=null,z=null,ye=!0;function ze(){G=[],q=[],z=[],ye=!0}function m(e){if(G)G.push(e)}function Ei(e){if(q)q.push(e)}function Ze(e){if(z)z.push(e)}function Xe(){let e={docOps:q??[],fmOps:z??[],invertible:ye,ops:G??[]};return G=null,q=null,z=null,ye=!0,e}var Qe=100,dn=20;function Z(){try{return typeof localStorage>"u"||!localStorage.getItem("jx-legacy-history")}catch{return!0}}function S(e,t){let n=ne(e,t);if(!n)throw TypeError(`No node at path [${t.join(", ")}]`);return n}function C(e,t,n,o){return{forward:{key:t,op:"set-key",path:e,value:o},inverse:{key:t,op:"set-key",path:e,value:n}}}function fn(e,t,n,o,r){let s=e.length,a=s<t.length&&e.every((u,d)=>u===t[d]),l=t[s+1];if(!a||t[s]!=="children"||!ee(l))return t;if(r?l<n:l<=n)return t;let c=[...t];return c[s+1]=l+o,c}var et=null;function tt(e){et=e}var nt=null;function ot(e){nt=e}function pn(e,t,n,o){for(let r=t.docOps.length-1;r>=0;r--)ag(e.doc.document,he(t.docOps[r].inverse));for(let r=t.fmOps.length-1;r>=0;r--){let s=t.fmOps[r];Ce(e,s.field,s.before)}e.doc.document={...he(e.doc.document)},e.session.selection=n,e.doc.dirty=o}function Y(e,t,{skipHistory:n=!1,origin:o="user",coalesceKey:r=null}={}){if(!e)return!1;if(o!=="remote"&&nt?.(e,o))return!1;let s=Rs(e.session.selection),a=e.doc.dirty;ze();let l,c=null;try{t(e)}catch(A){c={error:A}}finally{l=Xe()}if(c)throw pn(e,l,s,a),c.error;let u=he(e.doc.document),d={...u},p=Ge(),g=p===null?{patchable:!1,reason:"no-patch-consumer"}:l.ops.length===0?{patchable:!1,reason:"unrecorded-mutation"}:p.classify(e,l.ops);if(g.patchable)p.markConsumed(d,e);if(e.doc.document=d,g.patchable)try{p.apply(e,l.ops,l)}catch(A){p.escalate(`patch-apply-failed: ${A instanceof Error?A.message:String(A)}`,e)}if(!n&&!V)mn(e,u,l,s,r);return e.doc.dirty=!0,et?.(e,l,o),!0}function mn(e,t,n,o,r=null){let s=e.history.snapshots.slice(0,e.history.index+1),a=Z()&&n.invertible&&(n.docOps.length>0||n.fmOps.length>0),l=s.at(-1);if(r&&a&&l&&l.coalesceKey===r&&l.inverseOps){if(l.forwardOps=[...l.forwardOps??[],...n.docOps.map((u)=>u.forward)],l.inverseOps=[...l.inverseOps,...n.docOps.map((u)=>u.inverse)],l.selection=Rs(e.session.selection),l.document)l.document=Wr(t);e.history.snapshots=s,e.history.index=s.length-1;return}let c=!a||s.length%dn===0;if(s.push({document:c?Wr(t):null,fmOps:a&&n.fmOps.length>0?n.fmOps:null,forwardOps:a?n.docOps.map((u)=>u.forward):null,inverseOps:a?n.docOps.map((u)=>u.inverse):null,coalesceKey:r,selection:Rs(e.session.selection),selectionBefore:o}),s.length>Qe){if(!s[1].document)s[1].document=be(s,1);s.shift()}e.history.snapshots=s,e.history.index=s.length-1}function be(e,t){let n=t;while(n>=0&&!e[n].document)n-=1;let o=n<0?null:e[n].document;if(!o)throw Error("history-missing-checkpoint");let r=Wr(o);for(let s=n+1;s<=t;s++)for(let a of e[s].forwardOps??[])ag(r,a);return r}function ta(e,t,n){return Y(e,(o)=>t(o.doc.document),n)}function ve(e,t){Y(e,(n)=>{for(let o of t)Pe(n,o)},{origin:"remote",skipHistory:!0})}var gn=new Set(["state","$media","$head","$elements","imports","$layout"]);function Pe(e,t){let n=null;if(t.op==="set-key")n=ne(e.doc.document,t.path)?.[t.key];switch(ag(e.doc.document,t),Ei({forward:t,inverse:t}),t.op){case"set-key":{if(gn.has(t.key))m({key:t.key,op:"doc-meta"});else if(t.key==="style")m({op:"set-style",path:t.path});else if(t.key==="textContent")m({op:"set-text",path:t.path});else if(t.key==="attributes"||t.key==="cases"||t.key==="$props")m({op:"replace",path:t.path});else{let o=t.key.startsWith("on")&&(Rh(t.value)||Rh(n));m({isEvent:o,key:t.key,op:"set-prop",path:t.path})}return}case"insert-child":{m({index:t.index,op:"insert",parentPath:t.parentPath});return}case"remove-child":{m({op:"remove",path:[...t.parentPath,"children",t.index]});return}case"set-child":{m({op:"replace",path:[...t.parentPath,"children",t.index]});return}case"move-child":{m({fromPath:[...t.fromParentPath,"children",t.fromIndex],op:"move",toIndex:t.toIndex,toParentPath:t.toParentPath});break}default:break}}var V=null,rt=null;function it(e){rt=e}function Gy(e){V=e}function Jy(){let e=V;if(e&&!N.has(e)){let t=he(e.doc.document),n={document:Wr(t),selection:Rs(e.session.selection)},o=e.history.snapshots.slice(0,e.history.index+1);if(o.push(n),o.length>Qe)o.shift();e.history.snapshots=o,e.history.index=o.length-1}if(V=null,e)rt?.(e)}function l_(){return V!==null}function m$(){return V}var N=new WeakMap;function Jm(e,t){if(t)N.set(e,t);else N.delete(e)}function g$(e){let t=N.get(e);return t?t.canUndo(e):e.history.index>0}function b$(e){let t=N.get(e);return t?t.canRedo(e):e.history.index<e.history.snapshots.length-1}function st(e,t){let{snapshots:n}=e.history;e.doc.document=be(n,t);let o=n[t];e.session.selection=Rs(he(o.selection))}function lt(e,t){try{if(typeof localStorage>"u"||!localStorage.getItem("jx-canvas-debug"))return}catch{return}let n=JSON.stringify(be(e.history.snapshots,t)),o=JSON.stringify(Wr(he(e.doc.document)));if(n!==o)console.error("jx history: ops-based undo/redo diverged from checkpoint replay",{index:t})}function c_(e){let t=N.get(e);if(t){t.undo(e);return}if(e.history.index<=0)return;let n=e.history.snapshots[e.history.index],o=Z()?n.inverseOps:null,r=Z()?n.fmOps:null;if(o&&o.length>0||r&&r.length>0){if(!Y(e,(a)=>{if(o)for(let l=o.length-1;l>=0;l--)Pe(a,he(o[l]));if(r)for(let l=r.length-1;l>=0;l--){let c=he(r[l]);Ce(a,c.field,c.before)}},{origin:"history",skipHistory:!0}))return;e.session.selection=Rs(he(n.selectionBefore??[])),e.history.index-=1,lt(e,e.history.index)}else e.history.index-=1,st(e,e.history.index);e.doc.dirty=!0}function y$(e){let t=N.get(e);if(t){t.redo(e);return}if(e.history.index>=e.history.snapshots.length-1)return;let n=e.history.snapshots[e.history.index+1],o=Z()?n.forwardOps:null,r=Z()?n.fmOps:null;if(o&&o.length>0||r&&r.length>0){if(!Y(e,(a)=>{if(o)for(let l of o)Pe(a,he(l));if(r)for(let l of r){let c=he(l);Ce(a,c.field,c.after)}},{origin:"history",skipHistory:!0}))return;e.session.selection=Rs(he(n.selection)),e.history.index+=1,lt(e,e.history.index)}else e.history.index+=1,st(e,e.history.index);e.doc.dirty=!0}function Ir(e,t,n,o){let r=ne(e.doc.document,t);if(!r)return;sg(r).splice(n,0,structuredClone(o)),m({index:n,op:"insert",parentPath:t}),Ei({forward:{index:n,node:Te(o),op:"insert-child",parentPath:t},inverse:{index:n,op:"remove-child",parentPath:t}})}function uh(e,t){let n=_(t);if(!n)return;let{index:o,parentPath:r}=n,[s]=S(e.doc.document,r).children.splice(o,1);m({op:"remove",path:t}),Ei({forward:{index:o,op:"remove-child",parentPath:r},inverse:{index:o,node:Te(s),op:"insert-child",parentPath:r}}),e.session.selection=Ke(e.session.selection,t)}function T1(e,t){let n=_(t);if(!n)return;let o=ne(e.doc.document,t);if(!o)return;let{index:r,parentPath:s}=n,a=structuredClone(he(o));S(e.doc.document,s).children.splice(r+1,0,a),m({index:r+1,op:"insert",parentPath:s}),Ei({forward:{index:r+1,node:Te(a),op:"insert-child",parentPath:s},inverse:{index:r+1,op:"remove-child",parentPath:s}}),e.session.selection=[[...s,"children",r+1]]}function Kp(e,t){for(let n of Ky(t))uh(e,n)}function Yy(e,t){let n=[];for(let o of Ky(t)){let r=e.session.selection;T1(e,o);let s=Oe(e.session.selection),a=_(s);if(!s||!a||e.session.selection===r)continue;n=n.map((l)=>fn(a.parentPath,l,a.index,1,!0)),n.unshift(s)}if(n.length>0)e.session.selection=n}function v$(e,t,n="div"){let o=_(t);if(!o)return;let r=ne(e.doc.document,t);if(!r)return;let{index:s,parentPath:a}=o,l={children:[structuredClone(he(r))],tagName:n},c=Te(r);S(e.doc.document,a).children.splice(s,1,l),m({op:"replace",path:t}),Ei({forward:{index:s,node:Te(l),op:"set-child",parentPath:a},inverse:{index:s,node:c,op:"set-child",parentPath:a}}),e.session.selection=[[...a,"children",s]]}function Ql(e,t,n,o){let r=e.doc.document,s=Dt(t),a=ai(t);if(!s||!ee(a))return;let l=ne(r,s),c=ne(r,n);if(!l||!Array.isArray(l.children)||!c)return;if(l.children[a]===void 0)return;let u=o;if(l===c&&a<o)u-=1;let d={fromIndex:a,fromParentPath:s,op:"move-child",toIndex:u,toParentPath:n},p=K1(r,d),[g]=l.children.splice(a,1);if(sg(c).splice(u,0,g),m({fromPath:t,op:"move",toIndex:u,toParentPath:n}),Ei({forward:d,inverse:p}),ao(Oe(e.session.selection),t)){let A=o;if(s.length===n.length&&s.every((M,L)=>M===n[L])&&a<o)A=o-1;e.session.selection=[[...n,"children",A]]}}function Ye(e,t,n,o){let r=ne(e.doc.document,t);if(!r)return;let s=r[n],a=Te(s);if(o===void 0||o===null||o==="")delete r[n];else r[n]=o;if(Ei(C(t,n,a,Te(r[n]))),n==="textContent")m({op:"set-text",path:t});else if(n==="style")m({op:"set-style",path:t});else{let l=o===void 0||o===null||o===""?s:o,c=n.startsWith("on")&&Rh(l);m({isEvent:c,key:n,op:"set-prop",path:t})}}function zc(e,t,n,o){let r=S(e.doc.document,t),s=Te(r.style);if(!r.style)r.style={};if(o===void 0||o==="")delete r.style[n];else r.style[n]=o;if(Object.keys(r.style).length===0)delete r.style;Ei(C(t,"style",s,Te(r.style))),m({op:"set-style",path:t})}function so(e,t,n,o){let r=S(e.doc.document,t),s=Te(r.attributes);if(!r.attributes)r.attributes={};if(o===void 0||o==="")delete r.attributes[n];else r.attributes[n]=o;if(Object.keys(r.attributes).length===0)delete r.attributes;Ei(C(t,"attributes",s,Te(r.attributes))),m({attr:n,op:"set-attr",path:t})}function w$(e,t,n,o,r){if(!n)return zc(e,t,o,r);let s=S(e.doc.document,t),a=Te(s.style);if(!s.style)s.style={};let l=`@${n}`,c=dc(s.style,l);if(r===void 0||r===""){if(delete c[o],Object.keys(c).length===0)delete s.style[l]}else c[o]=r;if(Object.keys(s.style).length===0)delete s.style;Ei(C(t,"style",a,Te(s.style))),m({op:"set-style",path:t})}function Zy(e,t,n,o,r){let s=S(e.doc.document,t),a=Te(s.style);if(!s.style)s.style={};let l=dc(s.style,n);if(r===void 0||r===""){if(delete l[o],Object.keys(l).length===0)delete s.style[n]}else l[o]=r;if(Object.keys(s.style).length===0)delete s.style;Ei(C(t,"style",a,Te(s.style))),m({op:"set-style",path:t})}function x$(e,t,n,o,r,s){let a=S(e.doc.document,t),l=Te(a.style);if(!a.style)a.style={};let c=`@${n}`,u=dc(a.style,c),d=dc(u,o);if(s===void 0||s===""){if(delete d[r],Object.keys(d).length===0)delete u[o];if(Object.keys(u).length===0)delete a.style[c]}else d[r]=s;if(Object.keys(a.style).length===0)delete a.style;Ei(C(t,"style",l,Te(a.style))),m({op:"set-style",path:t})}function ut(e,t){let n=[e];for(let o of t){let r=Xi(n.at(-1),o);if(!r)break;n.push(r)}for(let o=n.length-2;o>=0;o--){let r=n[o],s=t[o],a=Xi(r,s);if(a&&Object.keys(a).length===0)delete r[s]}}function Xy(e,t,n,o,r){let s=S(e.doc.document,t),a=Te(s.style);if(!s.style)s.style={};let l=s.style;for(let c of n)l=dc(l,c);if(r===void 0||r==="")delete l[o],ut(s.style,n);else l[o]=r;if(Object.keys(s.style).length===0)delete s.style;Ei(C(t,"style",a,Te(s.style))),m({op:"set-style",path:t})}function _$(e,t,n,o,r,s){let a=S(e.doc.document,t),l=Te(a.style);if(!a.style)a.style={};let c=`@${n}`,u=dc(a.style,c),d=u;for(let p of o)d=dc(d,p);if(s===void 0||s===""){if(delete d[r],ut(u,o),Object.keys(u).length===0)delete a.style[c]}else d[r]=s;if(Object.keys(a.style).length===0)delete a.style;Ei(C(t,"style",l,Te(a.style))),m({op:"set-style",path:t})}function S$(e,t,n){let o=S(e.doc.document,t),r=Te(o.style);if(n&&Object.keys(n).length>0)o.style=n;else delete o.style;Ei(C(t,"style",r,Te(o.style))),m({op:"set-style",path:t})}function na(e,t,n){let o=e.doc.document,r=Te(o.state);if(!o.state)o.state={};o.state[t]=n,Ei(C([],"state",r,Te(o.state))),m({key:"state",op:"doc-meta"})}function Qy(e,t){let n=e.doc.document;if(n.state){let o=Te(n.state);if(delete n.state[t],Object.keys(n.state).length===0)delete n.state;Ei(C([],"state",o,Te(n.state))),m({key:"state",op:"doc-meta"})}}function To(e,t,n){let o=e.doc.document,r=Te(o.state);if(!o.state)o.state={};let s=o.state[t],a=s==null?{}:!T(s)||Array.isArray(s)?{default:s}:s;o.state[t]=a,Object.assign(a,n);for(let l of Object.keys(a))if(a[l]===void 0||a[l]===null)delete a[l];Ei(C([],"state",r,Te(o.state))),m({key:"state",op:"doc-meta"})}function C$(e,t,n){let o=e.doc.document;if(!o.state||!o.state[t])return;let r=Te(o.state);o.state[n]=o.state[t],delete o.state[t],Ei(C([],"state",r,Te(o.state))),m({key:"state",op:"doc-meta"})}function hh(e,t,n,o){let r=S(e.doc.document,t),s=Te(r.$props);if(!r.$props)r.$props={};if(o===void 0||o===null||o==="")delete r.$props[n];else r.$props[n]=o;if(Object.keys(r.$props).length===0)delete r.$props;Ei(C(t,"$props",s,Te(r.$props))),m({op:"replace",path:t})}function k$(e,t,n,o){let r=S(e.doc.document,t),s=Te(r.cases);if(!r.cases)r.cases={};r.cases[n]=o||{tagName:"div",textContent:n},Ei(C(t,"cases",s,Te(r.cases))),m({op:"replace",path:t})}function E$(e,t,n){let o=S(e.doc.document,t);if(o.cases){let r=Te(o.cases);delete o.cases[n],Ei(C(t,"cases",r,Te(o.cases))),m({op:"replace",path:t})}}function T$(e,t,n,o){let r=S(e.doc.document,t);if(!r.cases||!r.cases[n])return;let s=Te(r.cases);r.cases[o]=r.cases[n],delete r.cases[n],Ei(C(t,"cases",s,Te(r.cases))),m({op:"replace",path:t})}function ec(e,t,n){let o=e.doc.content.frontmatter,r=Object.hasOwn(o,t)?Te(o[t]):void 0,s=n===void 0||n===null||n==="";if(s)delete o[t];else o[t]=n;let a=s?void 0:Te(n);Ze({after:a,before:r,field:t}),e.doc.dirty=!0}function Ce(e,t,n){if(n===void 0)delete e.doc.content.frontmatter[t];else e.doc.content.frontmatter[t]=n}var mi="project.json";function yn(e,t=!1){return{activeMedia:null,activeSelector:null,openPopover:null,openDialog:null,canvasMode:e,editZoom:1,editingFormula:null,editingFunction:null,featureToggles:{},inspectorSections:{},pendingInlineEdit:null,preview:t,previewColorScheme:"auto",previewLocale:null,previewParams:{},previewProps:null,rightTab:"properties",showLayout:!0,styleFilter:"",styleSections:{},dataRows:{},dataLimits:{},styleShorthands:{},zoom:1}}var hn=["edit","design","preview","source","stylebook","git-diff"];function zy({id:e,documentPath:t=null,fileHandle:n=null,document:o,frontmatter:r,sourceFormat:s=null,capabilities:a,openedFrom:l=null,preview:c=!1,layout:u=null}){let d=xe();og(o);let p=a?.modes??xn(t,s),g=p.find((se)=>se!=="preview")??"edit",A=p[0]==="preview",M={content:{frontmatter:r||{}},dirty:!1,document:o,handlersSource:null,layout:u,mode:Tn(t,s),sourceFormat:s},L={index:0,snapshots:[{document:structuredClone(o),selection:[]}]},ie={canvas:{refreshing:!1,error:null,livePreviews:null,pendingInlineEdit:null,scope:null,status:"idle"},clipboard:null,hover:null,openedFrom:l,selection:[],ui:yn(g,A)};return d.run(()=>({capabilities:{modes:p},doc:v(M),documentPath:t,fileHandle:n,history:v(L),id:e,pinned:!1,preview:c,scope:d,session:v(ie)}))}function xn(e,t){if(e===mi)return["stylebook","source"];let n=Li(t)??rn(e);if(n)return n.studio?.modes??["edit","design","preview","source"];return hn}function Tn(e,t){let n=Li(t)??rn(e);if(n)return n.studio?.documentMode?.default??"content";return"component"}function k1(e){return Da(e.session.ui.canvasMode)}function E1(e){let t=[];for(let n of e.capabilities.modes){if(n==="preview")continue;let o=Da(n);if(!t.includes(o))t.push(o)}return t}function d$(e,t){return e.capabilities.modes.find((n)=>n!=="preview"&&Da(n)===t)}function zp(e){e.scope.stop()}var dt=new WeakMap,W=new Map;function Ln(e){let t=he(e),n=dt.get(t);if(!n)n=v({active:!1,attachError:"",peers:[],readOnly:!1,sourceCanonical:!1,status:"unavailable"}),dt.set(t,n);return n}function ft(e){W.set(e,(W.get(e)??0)+1)}function pt(e){let t=W.get(e)??0;if(t<=1)W.delete(e);else W.set(e,t-1)}function Ym(e){return W.has(e.replaceAll("\\","/"))}var vn=8000,Pn=800,On=2500,mt=null;function Cn(){return mt??=(we("b8xw3vy9"),import("./index-b8xw3vy9.js")),mt}function yt(){try{return f()}catch{return null}}var B=null;function N$(e){B=e}var Ae=null;function O$(e){Ae=e}var bt=()=>{};function A$(e){bt=e??(()=>{})}var Re=new WeakMap;function ht(e){return he(e)}function Je(e,t){return e.frontmatterMap(t)}function Sn(e){return e.synced}function I(e){return Re.get(ht(e))}function ke(e){let t=ht(e),n=Re.get(t);if(!n)n={attaching:null,generation:0,optedOut:v({value:!1}),session:null,watcherInstalled:!1},Re.set(t,n);return n}var gt=!1;function wn(){if(gt)return;gt=!0,tt(An),it(Rn),ot((e)=>{if(I(e)?.session?.synced&&Ln(e).sourceCanonical)return bt("Source editing in progress — structural edits are paused"),"source-canonical";return null})}function An(e,t,n){let o=I(e)?.session;if(!o||!o.synced)return;if(o.lastSeenRef=he(e.doc.document),n==="remote"){ae(o);return}if(o.canWrite)Jn(o,t),ae(o)}function Rn(e){let t=I(e)?.session;if(!t?.synced||t.batchOps===null)return;let{batchOps:n,batchNeedsDiff:o}=t;if(t.batchOps=null,t.batchNeedsDiff=!1,!t.canWrite)return;if(t.undoManager?.stopCapturing(),o)X(t);else if(n.length>0)try{t.collab.applyDocOpsToY(t.handle.doc,n,t.collab.LOCAL_ORIGIN)}catch{X(t)}t.undoManager?.stopCapturing()}function Jn(e,t){let n=t.docOps.map((o)=>o.forward);if(l_()){if(e.batchOps??=[],n.length===0)e.batchNeedsDiff=!0;else e.batchOps.push(...n);return}if(n.length===0){X(e);return}try{e.collab.applyDocOpsToY(e.handle.doc,n,e.collab.LOCAL_ORIGIN)}catch{X(e)}}function X(e){let{collab:t,handle:n,tab:o}=e,r=t.yDocToJson(n.doc),s=Wr(he(o.doc.document)),a=t.diffDocs(r,s);if(a===null)t.replaceYStructure(n.doc,s,t.LOCAL_ORIGIN);else if(a.length>0)try{t.applyDocOpsToY(n.doc,a,t.LOCAL_ORIGIN)}catch{t.replaceYStructure(n.doc,s,t.LOCAL_ORIGIN)}}function Se(e){let t=e.collab.yDocToJson(e.handle.doc);Y(e.tab,(n)=>{let o=n.doc.document;for(let r of Object.keys(o))if(!(r in t))delete o[r];Object.assign(o,t)},{origin:"remote",skipHistory:!0})}function In(e){if(!e.canWrite)return!1;let{awareness:t}=e.handle,n=t.clientID;for(let[o,r]of t.getStates())if(r.canWrite!==!1&&o<n)n=o;return n===e.handle.awareness.clientID}function ae(e){if(!B||!In(e))return;if(e.collab.canonicalOf(e.handle.doc)==="source")return;let t=Date.now();if(e.lastMirrorAt??=t,t-e.lastMirrorAt>=On){if(e.mirrorTimer)clearTimeout(e.mirrorTimer),e.mirrorTimer=null;e.lastMirrorAt=t,je(e);return}if(e.mirrorTimer)clearTimeout(e.mirrorTimer);e.mirrorTimer=setTimeout(()=>{e.mirrorTimer=null,e.lastMirrorAt=Date.now(),je(e)},Pn)}async function je(e){if(!B||!e.synced)return;try{let t=await B(e.tab);e.collab.updateSourceText(e.handle.doc,t,e.collab.MIRROR_ORIGIN)}catch{}}async function xt(e){if(!Ae||!e.synced||!e.canWrite)return;let{collab:t,handle:n,tab:o}=e,r=t.canonicalRevOf(n.doc),s=t.sourceText(n.doc).toString(),a;try{a=await Ae(o,s)}catch{return}if(!Sn(e)||t.canonicalRevOf(n.doc)!==r)return;let l=t.diffDocs(t.yDocToJson(n.doc),a.document);if(l===null)t.replaceYStructure(n.doc,a.document,t.MIRROR_ORIGIN);else if(l.length>0)try{t.applyDocOpsToY(n.doc,l,t.MIRROR_ORIGIN)}catch{t.replaceYStructure(n.doc,a.document,t.MIRROR_ORIGIN)}let c=Je(t,n.doc),u=a.frontmatter??{};n.doc.transact(()=>{let d=[...c.keys()];for(let p of d)if(!(p in u))c.delete(p);for(let[p,g]of Object.entries(u))if(!t.deepEqual(c.get(p),g))c.set(p,g)},t.MIRROR_ORIGIN)}function P$(e){let t=I(e)?.session;if(!t?.synced)return null;let{collab:n,handle:o}=t,r=null,s=()=>r!==null&&t.sourceLockOwner===r;return{awareness:o.awareness,enter:async()=>{r={},t.sourceLockOwner=r;let a=o.awareness.getLocalState();if(a)o.awareness.setLocalState({...a,mode:"source"});if(!t.canWrite)return;let l=null;if(B)try{l=await B(e)}catch{l=null}if(!s())return;n.acquireSourceCanonical(o.doc,l??n.sourceText(o.doc).toString(),n.LOCAL_ORIGIN)},leave:()=>{if(!s()){r=null;return}r=null,t.sourceLockOwner=null;let a=o.awareness.getLocalState();if(a)o.awareness.setLocalState({...a,mode:"structure"});if(!t.canWrite)return;if(n.otherSourceEditors(o.awareness,t.path,o.awareness.clientID).filter((c)=>o.awareness.getStates().get(c)?.canWrite!==!1).length===0)xt(t).then(()=>{n.releaseSourceCanonical(o.doc,n.LOCAL_ORIGIN)})},localOrigin:n.LOCAL_ORIGIN,readOnly:!t.canWrite,text:n.sourceText(o.doc)}}function eg(e){let t=Ln(e);return t.active&&t.readOnly}async function I1(e){let t=I(e)?.session;if(!t?.synced||!t.canWrite)return!1;if(t.mirrorTimer)clearTimeout(t.mirrorTimer),t.mirrorTimer=null;return await je(t),await t.handle.flush(),!0}async function D1(){for(let e of De)if(I(e)?.session?.synced)await I1(e)}var De=new Set;function Q(e){if(!yt()?.collab||!e.documentPath||e.documentPath===mi)return;let n=ke(e);if(n.watcherInstalled)return;n.watcherInstalled=!0,wn(),De.add(e),e.scope.run(()=>{oe(()=>{if(n.optedOut.value)le(e);else $e(e)}),bl(()=>{De.delete(e),le(e)})})}function N1(e,t){let n=ke(e);if(n.optedOut.value===!t)return;if(n.optedOut.value=!t,!n.watcherInstalled&&t)Q(e)}function O1(e){return I(e)?.optedOut.value!==!0}function Tt(e){if(!I(e)?.watcherInstalled){Q(e);return}le(e),$e(e)}async function $e(e){let t=ke(e);if(t.session||t.attaching)return;let{documentPath:n}=e,o=yt();if(!n||!o?.collab){Ln(e).status="unavailable";return}let{generation:r}=t,s=Ln(e);s.status="connecting",s.attachError="";let a=(async()=>{try{let[l,c]=await Promise.all([Cn(),o.collab(n)]);if(!c){s.status="detached";return}if(t.generation!==r){c.destroy();return}let u,d=new Promise((p,g)=>{u=setTimeout(()=>g(Error("collab-sync-timeout")),vn)});try{await Promise.race([c.whenSynced,d])}finally{clearTimeout(u)}if(t.generation!==r){c.destroy();return}t.session=jn(e,n,l,c),s.active=!0,s.status="synced",s.readOnly=!t.session.canWrite,s.attachError="",ft(n)}catch(l){s.status="failed",s.active=!1,s.attachError=l instanceof Error?l.message:String(l),E.warn(`Live collaboration is not available for "${n}" — ${s.attachError}`,{key:`collab:${n}`,path:n,source:"Collaboration"})}finally{t.attaching=null}})();t.attaching=a,await a}function le(e){let t=I(e);if(!t)return;t.generation+=1;let{session:n}=t;t.session=null;let o=Ln(e);if(o.active=!1,o.status="detached",o.attachError="",o.peers=[],!n)return;if(pt(n.path),n.mirrorTimer)clearTimeout(n.mirrorTimer);if(n.sourceParseTimer)clearTimeout(n.sourceParseTimer);for(let r of n.disposers)try{r()}catch{}Jm(e,null),e.history.snapshots=[{document:Wr(he(e.doc.document)),selection:Rs(e.session.selection)}],e.history.index=0,n.undoManager?.destroy(),n.handle.destroy()}function jn(e,t,n,o){let r=o.identity(),s={applyingRemoteFrontmatter:!1,batchNeedsDiff:!1,batchOps:null,canWrite:r?r.permission!=="read":!0,collab:n,disposers:[],handle:o,lastSeenRef:he(e.doc.document),mirrorTimer:null,path:t,sourceLockOwner:null,sourceParseTimer:null,synced:!1,tab:e,undoManager:null};if(n.metaMap(o.doc).get("structureSeeded")===!0){let y=n.yDocToJson(o.doc),x=Wr(he(e.doc.document));if(!n.deepEqual(y,x)){let R=n.diffDocs(x,y);if(R===null)s.synced=!0,Se(s),s.synced=!1;else if(R.length>0)ve(e,R)}s.applyingRemoteFrontmatter=!0;let P=Je(n,o.doc);for(let[R,k]of P.entries())e.doc.content.frontmatter[R]=k;s.applyingRemoteFrontmatter=!1}else if(s.canWrite)n.seedStructure(o.doc,Wr(he(e.doc.document)),{frontmatter:Wr(he(e.doc.content.frontmatter)),origin:n.SEED_ORIGIN,sourceFormat:e.doc.sourceFormat});s.lastSeenRef=he(e.doc.document),s.disposers.push(o.onDirty((y)=>{e.doc.dirty=y})),o.awareness.setLocalState({canWrite:s.canWrite,focusedPath:t,structuralSelection:null,user:r?{avatarUrl:r.avatarUrl,color:r.color,login:r.login,name:r.name}:{color:n.colorForKey(String(o.awareness.clientID)),login:`guest-${o.awareness.clientID%1000}`}});let l=new n.UndoManager([n.structureMap(o.doc),n.frontmatterMap(o.doc)],{trackedOrigins:new Set([n.LOCAL_ORIGIN])});s.undoManager=l;let c=({stackItem:y})=>{y.meta.set("selection",Rs(e.session.selection))},u=({stackItem:y})=>{let x=y.meta.get("selection");e.session.selection=Rs(x??[])};l.on("stack-item-added",c),l.on("stack-item-popped",u),s.disposers.push(()=>{l.off("stack-item-added",c),l.off("stack-item-popped",u)}),Jm(e,{canRedo:()=>l.canRedo(),canUndo:()=>l.canUndo(),redo:()=>{l.redo()},undo:()=>{l.undo()}});let d=n.structureMap(o.doc),p=(y,x)=>{if(x.origin===n.LOCAL_ORIGIN||!s.synced)return;let P=n.yEventsToDocOps(y);if(P===null){Se(s);return}if(P.length===0)return;try{ve(e,P)}catch{Se(s)}};d.observeDeep(p),s.disposers.push(()=>d.unobserveDeep(p));let g=Ln(e);g.sourceCanonical=n.canonicalOf(o.doc)==="source";let A=n.metaMap(o.doc),M=()=>{g.sourceCanonical=n.canonicalOf(o.doc)==="source"};A.observe(M),s.disposers.push(()=>A.unobserve(M));let L=n.sourceText(o.doc),ie=(y,x)=>{if(x.origin===n.MIRROR_ORIGIN||!s.synced)return;if(n.canonicalOf(o.doc)!=="source")return;if(!n.isSourceReconciler(o.awareness,s.path))return;if(s.sourceParseTimer)clearTimeout(s.sourceParseTimer);s.sourceParseTimer=setTimeout(()=>{s.sourceParseTimer=null,xt(s)},600)};L.observe(ie),s.disposers.push(()=>L.unobserve(ie));let j=Je(n,o.doc),se=(y,x)=>{if(x.origin===n.LOCAL_ORIGIN||!s.synced)return;s.applyingRemoteFrontmatter=!0;try{for(let[P,R]of y.changes.keys)if(R.action==="delete")delete e.doc.content.frontmatter[P];else e.doc.content.frontmatter[P]=j.get(P)}finally{s.applyingRemoteFrontmatter=!1}};j.observe(se),s.disposers.push(()=>j.unobserve(se)),e.scope.run(()=>{let y=JSON.stringify(e.doc.content.frontmatter);oe(()=>{let x=JSON.stringify(e.doc.content.frontmatter);if(x===y)return;if(y=x,s.applyingRemoteFrontmatter||!s.synced||!s.canWrite)return;let P=JSON.parse(x);o.doc.transact(()=>{let R=[...j.keys()];for(let k of R)if(!(k in P))j.delete(k);for(let[k,Me]of Object.entries(P))if(!n.deepEqual(j.get(k),Me))j.set(k,Me)},n.LOCAL_ORIGIN),ae(s)}),oe(()=>{let x=e.session.selection.length>0?Rs(e.session.selection):null,P=o.awareness.getLocalState();if(P)o.awareness.setLocalState({...P,structuralSelection:x})}),oe(()=>{let x=he(e.doc.document);queueMicrotask(()=>{if(I(e)?.session!==s||!s.synced||!s.canWrite)return;let R=he(e.doc.document);if(R!==x||R===s.lastSeenRef)return;s.lastSeenRef=R,X(s),ae(s)})})});let ue=Ln(e),de=()=>{let y=[];for(let[x,P]of o.awareness.getStates())if(x!==o.awareness.clientID&&P.user)y.push({clientId:x,state:P});ue.peers=y};return de(),o.awareness.on("change",de),s.disposers.push(()=>o.awareness.off("change",de),o.onStatus((y)=>{if(y==="offline"||y==="connecting")ue.status="offline";else if(s.synced)ue.status="synced"}),o.onReset(()=>{le(e),$e(e)})),s.synced=!0,s}function J(e,t,n){return RangeError(`command "${e}" argument "${t}": ${n}`)}function Dn(e){if(ee(e))return"number";if(at(e))return"boolean";return i(e)?"string":"object"}function w(e){if(e===void 0)return"missing";return i(e)?`"${e}"`:`${Dn(e)} ${JSON.stringify(e)}`}function Pt(e){return Array.isArray(e)&&e.every((t)=>i(t)||ee(t))}function ct(e,t,n){let o=t[n];if(!i(o)||o==="")throw J(e,n,`expected a non-empty string, got ${w(o)}`);return o}function Dr(e,t,n){if(t[n]===void 0)return;return ct(e,t,n)}function Ot(e,t,n){let o=t[n];if(!ee(o)||!Number.isFinite(o))throw J(e,n,`expected a finite number, got ${w(o)}`);return o}function vt(e,t,n){let o=t[n];if(!ee(o)||!Number.isInteger(o))throw J(e,n,`expected an integer, got ${w(o)}`);return o}function ev(e,t,n,o,r){let s=Ot(e,t,n);if(s<o||s>r)throw J(e,n,`${s} is outside the supported range ${o}–${r}`);return s}function Ti(e,t,n){let o=t[n];if(!at(o))throw J(e,n,`expected a boolean, got ${w(o)}`);return o}function gi(e,t,n,o){let r=t[n],s=i(r)?o.find((a)=>a===r):void 0;if(s===void 0)throw J(e,n,`${w(r)} is not declared — declared: ${o.join(", ")||"none"}`);return s}function d_(e,t,n){let o=t[n];if(!Pt(o))throw J(e,n,`expected an array of path segments (strings or numbers), got ${w(o)}`);return o}function L$(e,t,n){if(t[n]===null)return null;return d_(e,t,n)}function $1(e,t,n){let o=t[n];if(!Array.isArray(o))throw J(e,n,`expected an array of document paths, got ${w(o)}`);return o.map((r,s)=>{if(!Pt(r))throw J(e,n,`entry ${s} is not a document path — expected an array of segments, got ${w(r)}`);return r})}function Ie(e,t=Object.keys(e)){return{additionalProperties:!1,properties:e,required:[...t],type:"object"}}function Vr(e,t){return{description:t,enum:[...e],type:"string"}}function Na(e,t){return{description:t,get enum(){return[...e()]},type:"string"}}function R1(e,t={}){return{description:e,type:"number",...t}}function pr(e){return{description:e,type:"boolean"}}function tv(e,t=!1){let n={items:{type:["string","number"]},type:"array"};return t?{description:e,oneOf:[n,{type:"null"}]}:{description:e,...n}}function $$(e){return{description:e,items:{items:{type:["string","number"]},type:"array"},type:"array"}}function qe(e){return{description:e,type:"string"}}function kn(e){return e.length===2&&e.includes("string")&&e.includes("number")}function Ee(e){return i(e)?[e]:e}function Ct(e){let t=e;if("enum"in t)return"enum";if("const"in t)return"const";if(Array.isArray(t.oneOf))return"one-of";if(Array.isArray(t.type))return"typed";switch(t.type){case"boolean":return"boolean";case"number":case"integer":{if(t.minimum!==void 0&&t.maximum!==void 0)return"bounded-number";return t.type==="integer"?"integer":"number"}case"string":return"string";case"array":{let n=t.items?.type;if(Array.isArray(n))return kn(n)?"path":"pass-through";return n==="array"?"path-list":"pass-through"}case"null":case"object":return"typed";default:break}return"pass-through"}function St(e,t){switch(e){case"null":return t===null;case"boolean":return at(t);case"string":return i(t);case"number":return ee(t)&&Number.isFinite(t);case"integer":return ee(t)&&Number.isInteger(t);case"array":return Array.isArray(t);case"object":return T(t)&&!Array.isArray(t);default:break}return!1}function wt(e){if(e.length<=1)return e.join("");return`${e.slice(0,-1).join(", ")} or ${e.at(-1)}`}function $n(e,t,n,o){let r=t[n];if(r===void 0||!o.some((s)=>St(s,r)))throw J(e,n,`expected ${wt(o)}, got ${w(r)}`);return r}function At(e){switch(Ct(e)){case"enum":return`one of ${(e.enum??[]).map((t)=>w(t)).join(" | ")}`;case"const":return`the constant ${w(e.const)}`;case"one-of":return(e.oneOf??[]).map((t)=>At(t)).join(" or ");case"typed":return wt(Ee(e.type??[]));case"boolean":return"a boolean";case"bounded-number":return`a number from ${e.minimum} to ${e.maximum}`;case"number":return"a finite number";case"integer":return"an integer";case"string":return"a non-empty string";case"path":return"a document path";case"path-list":return"a list of document paths";default:return"anything"}}function En(e,t,n,o){let r=t[n],s=[];for(let a of o){if(a.type!==void 0&&!Ee(a.type).some((l)=>St(l,r)))continue;try{return Rt(e,t,n,a)}catch(l){s.push(l)}}if(s.length===1)throw s[0];throw J(e,n,`expected ${o.map((a)=>At(a)).join(" or ")}, got ${w(r)}`)}function Rt(e,t,n,o){switch(Ct(o)){case"enum":return gi(e,t,n,o.enum??[]);case"const":{let r=t[n];if(r!==o.const)throw J(e,n,`expected the constant ${w(o.const)}, got ${w(r)}`);return r}case"one-of":return En(e,t,n,o.oneOf??[]);case"typed":return $n(e,t,n,Ee(o.type??[]));case"boolean":return Ti(e,t,n);case"bounded-number":{if(o.type==="integer")vt(e,t,n);return ev(e,t,n,o.minimum,o.maximum)}case"number":return Ot(e,t,n);case"integer":return vt(e,t,n);case"string":return ct(e,t,n);case"path":return d_(e,t,n);case"path-list":return $1(e,t,n);default:return t[n]}}function R$(e,t,n){let o=t,r=o.properties??{},s=Object.keys(r),a=o.required??[],l={};for(let[c,u]of Object.entries(n)){if(u===void 0||Object.hasOwn(r,c))continue;if(o.additionalProperties===!1)throw J(e,c,`not declared — declared: ${s.join(", ")||"none"}`);l[c]=u}for(let c of s){if(n[c]===void 0&&!a.includes(c))continue;l[c]=Rt(e,n,c,r[c])}return l}var Nn=20,si="primary",Jp="secondary",A1=2,b=v({activePaneId:si,clipboard:null,closedTabs:[],componentRegistry:[],mruOrder:[],fileTree:{dirs:new Map,expanded:new Set,searchQuery:"",selectedPath:null},panes:[{activeTabId:null,derived:null,id:si,tabOrder:[]}],projectConfig:null,projectRoot:null,styleClipboard:null,tabs:new Map,ui:{activityBar:"files"},get activeTabId(){let e=qo();return e.derived?.kind==="lens"?qn(e.derived.sourcePaneId)?.activeTabId??null:e.activeTabId},get tabOrder(){return qo().tabOrder}}),h=au(()=>b.activeTabId?b.tabs.get(b.activeTabId)??null:null);function qo(){let{panes:e}=b;return e.find((t)=>t.id===b.activePaneId)??e[0]}function qn(e){return b.panes.find((t)=>t.id===e)}function fh(e){return b.panes.find((t)=>t.tabOrder.includes(e))}function Ko(e){let t=qn(e);if(!t||t.id===b.activePaneId)return;b.activePaneId=t.id,D();let{activeTabId:n}=t;if(n){Ne(n);let o=b.tabs.get(n);if(o)jt(o)}}function Yp(e){return b.activePaneId===e}function p_(e){let t=e??qo().activeTabId,n=t?b.tabs.get(t):null;if(!t||!n)return null;let o=fh(t);if(!o)return null;let r=nc(o.id);return Qp(t),mh(r,t),r.activeTabId=t,b.activePaneId=r.id,D(),Ne(t),r}function f_(e){return b.panes.find((t)=>t.id!==e)??Mn(Jp)}function nc(e){let t=f_(e);if(t.derived)t.derived=null;return t}function Mn(e){let t=qn(e);if(t)return t;return b.panes=[...b.panes,{activeTabId:null,derived:null,id:e,tabOrder:[]}],qn(e)}function Zp(e){if(b.panes.length<2)return;let t=e===si?b.panes.find((r)=>r.id!==si)?.id:e,n=t===void 0?void 0:qn(t),o=b.panes.find((r)=>r.id!==t);if(!n||!o)return;for(let r of n.tabOrder)mh(o,r);if(o.activeTabId=b.activePaneId===n.id?n.activeTabId??o.activeTabId:o.activeTabId??n.activeTabId,b.activePaneId=o.id,o.derived?.sourcePaneId===n.id)o.derived=null;b.panes=b.panes.filter((r)=>r.id!==n.id),D()}function Xp(e){return e.tabOrder.length===0&&e.derived===null}function Qp(e){let t=[];for(let n of b.panes){if(!n.tabOrder.includes(e))continue;if(n.tabOrder=n.tabOrder.filter((o)=>o!==e),n.activeTabId===e)n.activeTabId=n.tabOrder.at(-1)??null;if(n.id!==si&&Xp(n))t.push(n.id)}for(let n of t)Zp(n)}function mh(e,t,n){if(e.tabOrder.includes(t))return;let o=n??_n(e,t);e.tabOrder=[...e.tabOrder.slice(0,o),t,...e.tabOrder.slice(o)]}function Fn(e){let t=0;for(let n of e.tabOrder){if(b.tabs.get(n)?.pinned!==!0)break;t+=1}return t}function _n(e,t){return b.tabs.get(t)?.pinned===!0?Fn(e):e.tabOrder.length}function dl(e,t=null){if(b.projectRoot&&e!==b.projectRoot)a_();b.projectRoot=e,b.projectConfig=t}function ef(e){let t=h.value;return e!==null&&t!==null&&he(t)===he(e)}function Uc(e){if(!e)return!1;let t=b.tabs.get(e.id);return t!==void 0&&he(t)===he(e)}function Ne(e){b.mruOrder=[e,...b.mruOrder.filter((t)=>t!==e)]}var ce=null,te=0;function D(){ce=null,te=0}function jt(e){if(O&&e.documentPath)O.selectedPath=e.documentPath}function re(e,t={}){let n=b.tabs.get(e),o=fh(e);if(!n||!o)return;if(o.activeTabId=e,t.focus===!1)return;if(b.activePaneId=o.id,!t.cycling)D(),Ne(e);jt(n)}function zr(e){let t=b.tabs.get(e.id),n=e.preview===!0&&t?.pinned!==!0,o=zy({...e,preview:n}),r=(e.paneId===void 0?void 0:qn(e.paneId))??qo(),s;if(t)o.pinned=t.pinned,zp(t);else{if(n){let l=Jt(r),c=l?b.tabs.get(l):null;if(c)Qd(c);m_()}let a=n?Jt(r):null;if(a)s=r.tabOrder.indexOf(a),g_(a);mh(r,o.id,s)}return b.tabs.set(o.id,o),re(o.id,{focus:e.focus!==!1}),Q(o),o}function Jt(e){return e.tabOrder.find((t)=>b.tabs.get(t)?.preview===!0)??null}function ic(e){let t=b.tabs.get(e);if(t?.preview===!0)t.preview=!1}function m_(){for(let[e,t]of b.tabs)if(t.preview&&t.doc.dirty)ic(e)}function ov(e,t){let n=b.tabs.get(e),o=fh(e);if(!n||!o)return;if(n.pinned=t,t)n.preview=!1;let r=o.tabOrder.filter((a)=>a!==e),s=r.filter((a)=>b.tabs.get(a)?.pinned===!0).length;o.tabOrder=[...r.slice(0,s),e,...r.slice(s)]}function P1(e,t){let n=b.tabs.get(e),o=fh(e);if(!n||!o)return;o.tabOrder=kt(o,e,t)}function kt(e,t,n){let o=b.tabs.get(t);if(!o)return e.tabOrder;let r=e.tabOrder.filter((u)=>u!==t),s=r.filter((u)=>b.tabs.get(u)?.pinned===!0).length,a=o.pinned?0:s,l=o.pinned?s:r.length,c=Math.min(Math.max(n,a),l);return[...r.slice(0,c),t,...r.slice(c)]}function g_(e){let t=b.tabs.get(e);if(!t)return;let n=fh(e),o=n?.activeTabId===e;if(Vn(t),zp(t),b.tabs.delete(e),By(e),Qp(e),b.mruOrder=b.mruOrder.filter((a)=>a!==e),D(),n&&Xp(n))Zp(n.id);if(!o)return;let r=qo(),s=b.mruOrder.find((a)=>r.tabOrder.includes(a))??r.tabOrder.at(-1)??null;if(s)re(s)}function M1(){let e=[...b.tabs.values()];b.tabs.clear(),$t(),b.mruOrder=[],D();for(let t of e)zp(t)}function $t(){b.panes=[{activeTabId:null,derived:null,id:si,tabOrder:[]}],b.activePaneId=si}function Vn(e){if(!e.documentPath)return;let t=e.documentPath;b.closedTabs=[{documentPath:t},...b.closedTabs.filter((n)=>n.documentPath!==t)].slice(0,Nn)}function Wn(){let[e]=b.closedTabs;if(!e)return;return b.closedTabs=b.closedTabs.slice(1),e.documentPath}function It(e){if(!ce)ce=b.mruOrder.filter((o)=>b.tabs.has(o)),te=0;let t=ce;if(t.length<2)return;te=((te+e)%t.length+t.length)%t.length;let n=t[te];return re(n,{cycling:!0}),n}function F1(e){let t=[...b.tabs.keys()],n=[...b.tabs.values()],o=zy(e);b.tabs.set(o.id,o),$t(),b.panes[0].tabOrder=[o.id],b.mruOrder=[],D(),re(o.id),Q(o);for(let r of t){if(r===o.id)continue;b.tabs.delete(r)}for(let r of n)zp(r);return o}function bi(e,t={}){re(e,t)}function tg(e,t,n){let o=qn(t);if(!o||!b.tabs.has(e))return null;if(o.tabOrder.includes(e)){if(n!==void 0)o.tabOrder=kt(o,e,n);return o}return Qp(e),mh(o,e,n),o}function sv(e,t,n){let o=b.tabs.get(e);if(!o)return;if(o.id=t,o.documentPath=n,o_(e))By(e),Wp(t);b.tabs.delete(e),b.tabs.set(t,o);for(let r of b.panes)if(r.tabOrder=r.tabOrder.map((s)=>s===e?t:s),r.activeTabId===e)r.activeTabId=t;b.mruOrder=b.mruOrder.map((r)=>r===e?t:r),D(),Tt(o)}function j1(e,t){e.registerAll([...Bn(t),...Un(t)])}function Bn(e){let t=()=>b.tabs.size>1;return[{id:"document.nextTab",title:"Next Tab",category:"Document",level:"document",keybinding:["ctrl+tab","mod+tab"],menus:["palette"],group:"2_navigate",when:(n)=>n.document.open,enablement:t,requires:"a second open document",run:()=>{It(1)}},{id:"document.previousTab",title:"Previous Tab",category:"Document",level:"document",keybinding:["ctrl+shift+tab","mod+shift+tab"],menus:["palette"],group:"2_navigate",when:(n)=>n.document.open,enablement:t,requires:"a second open document",run:()=>{It(-1)}},{args:Ie({path:qe('Project-relative path of the file to open, e.g. "pages/about.json" or "components/nav-bar.json". It must exist.')}),id:"document.open",title:"Open Document",category:"Document",level:"project",menus:["palette"],group:"1_file",when:(n)=>n.project.open,requires:"an open project",aiTool:{description:"Open a project file as the active document; the document tools then operate on it. Use it when the user should SEE the page, or for iterative visual refinement after creating a page or component.",name:"open_document",report:({after:n,args:o})=>{let r=ct("document.open",o,"path"),s=h.value?.documentPath??null;if(s!==r)return`Opened "${r}", but the active document is ${s===null?"none":`"${s}"`}.`;let a=n.editor.kind==="canvas"?"on the canvas; the document tools now operate on it":`in the ${Fy[n.editor.kind]} editor, which is not an element tree the document tools can edit`;return`"${r}" is the active document, ${a}.`}},run:async(n,o)=>{let r=ct("document.open",o,"path");if(await e.openFile(r),![...b.tabs.values()].some((s)=>s.documentPath===r))throw RangeError(`command "document.open" argument "path": "${r}" could not be opened — it does `+"not exist, or no editor claims its format. Problems has the reason.")}},{args:Ie({file:qe('Project-relative path of the file to open in the other pane, e.g. "pages/about.json". It must exist.')}),id:"document.openToSide",title:"Open to the Side",category:"Document",level:"project",menus:["context/file","palette"],group:"1_file",when:(n)=>n.project.open,requires:"an open project",undo:"none",run:async(n,o)=>{let r=ct("document.openToSide",o,"file"),s=nc(qo().id);if(await e.openFile(r,{paneId:s.id}),![...b.tabs.values()].some((a)=>a.documentPath===r)){if(Xp(s)&&s.id!==si)Zp(s.id);throw RangeError(`command "document.openToSide" argument "file": "${r}" could not be opened — it `+"does not exist, or no editor claims its format. Problems has the reason.")}}},{id:"document.reopenClosed",title:"Reopen Closed Document",category:"Document",level:"document",keybinding:"mod+shift+t",menus:["context/tab","palette"],group:"1_file",enablement:()=>b.closedTabs.length>0,requires:"a document closed in this session",run:async()=>{let n=Wn();if(n)await e.openFile(n)}},{id:"document.togglePinned",title:"Pin / Unpin Document",category:"Document",level:"document",menus:["context/tab","palette"],group:"1_file",when:(n)=>n.document.open,requires:"an open document",run:()=>{let n=b.activeTabId,o=n?b.tabs.get(n):null;if(n&&o)ov(n,!o.pinned)}},{args:Ie({pinned:pr("True to pin the active document's tab, false to unpin it.")}),id:"document.setPinned",title:"Set Document Pinned",category:"Document",level:"document",menus:["palette"],group:"1_file",when:(n)=>n.document.open,requires:"an open document",run:(n,o)=>{let r=b.activeTabId;if(r&&b.tabs.get(r))ov(r,Ti("document.setPinned",o,"pinned"))}},{id:"document.keepOpen",title:"Keep Document Open",category:"Document",level:"document",menus:["context/tab","palette"],group:"1_file",when:(n)=>n.document.open,enablement:()=>{let n=b.activeTabId;return n!==null&&b.tabs.get(n)?.preview===!0},requires:"a preview document — one opened by a single click",run:()=>{let n=b.activeTabId;if(n)ic(n)}}]}function Un(e){let t=()=>b.panes.length>1;return[{id:"pane.splitRight",title:"Split Right",category:"View",level:"document",keybinding:"mod+\\",menus:["context/pane","context/tab","palette"],group:"5_pane",when:(n)=>n.document.open,enablement:()=>b.activeTabId!==null,requires:"an open document",undo:"none",run:()=>{p_()}},{args:Ie({path:qe("Project-relative path of the document to open beside this one.")}),id:"pane.compareWith",title:"Compare With…",category:"View",level:"document",menus:["context/pane","context/tab","palette"],group:"5_pane",when:(n)=>n.document.open,enablement:()=>b.activeTabId!==null,requires:"an open document",undo:"none",run:async(n,o)=>{let r=ct("pane.compareWith",o,"path"),s=qo();if((s.activeTabId?b.tabs.get(s.activeTabId):null)?.documentPath===r)throw RangeError(`command "pane.compareWith" argument "path": "${r}" is the document this pane is `+"already showing — name a different one");await e.openFileInPane(nc(s.id).id,r)}},{id:"pane.focusPrimary",title:"Focus Primary Pane",category:"View",level:"document",keybinding:"mod+0",menus:["palette"],group:"5_pane",enablement:t,requires:"a split pane grid",undo:"none",run:()=>{Ko(si)}},{id:"pane.focusSecondary",title:"Focus Side Pane",category:"View",level:"document",keybinding:"mod+alt+0",menus:["palette"],group:"5_pane",enablement:t,requires:"a split pane grid",undo:"none",run:()=>{Ko(Jp)}},{id:"pane.unsplit",title:"Close Side Pane",category:"View",level:"document",menus:["context/pane","palette"],group:"5_pane",enablement:t,requires:"a second pane",undo:"none",run:Kn}]}function Kn(){let e=b.panes.find((t)=>t.derived!==null);if(e?.id===si){if(e.derived=null,!Xp(e))return}Zp(e?.id??Jp)}
2
+ export{i_,oo,My,e$,bn,Br,ch,t$,S1,dh,Fy,Da,n$,jy,Jd,Hy,Km,r_,i$,Wp,By,o_,Gm,Zi,rr,Vy,Yd,Wy,r$,C1,o$,s$,a$,s_,l$,a_,c$,mi,zy,k1,E1,d$,zp,Oe,u$,Uy,Rs,qy,h$,Up,Ky,p$,qp,f$,Ei,Y,ta,Gy,Jy,l_,m$,Jm,g$,b$,c_,y$,Ir,uh,T1,Kp,Yy,v$,Ql,Ye,zc,so,w$,Zy,x$,Xy,_$,S$,na,Qy,To,C$,hh,k$,E$,T$,ec,Ln,Ym,L1,Zm,Xm,ct,Dr,ev,Ti,gi,d_,L$,$1,Ie,Vr,Na,R1,pr,tv,$$,qe,R$,Gp,u_,tc,nv,iv,h_,I$,Oa,Zd,ph,Qm,rv,D$,Wr,N$,O$,A$,P$,eg,I1,D1,N1,O1,si,Jp,A1,b,h,qo,qn,fh,Ko,Yp,p_,f_,nc,Zp,Xp,Qp,mh,dl,ef,Uc,zr,ic,m_,ov,P1,g_,M1,F1,bi,tg,sv,j1};
3
+
4
+ //# debugId=A8C9F86EA3446B5464756E2164756E21
5
+ //# sourceMappingURL=studio-24mccdrj.js.map