@jxsuite/studio 6.1.1 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (785) hide show
  1. package/README.md +5 -5
  2. package/dist/chunks/2020-5wtzce5g.js +4 -0
  3. package/dist/chunks/{action-group-2mqby73c.js → action-group-4aan7g6g.js} +3 -3
  4. package/dist/chunks/adapter-5tphg7xe.js +4 -0
  5. package/dist/chunks/add-new-flow-psym14sn.js +4 -0
  6. package/dist/chunks/cf-account-picker-haqazq5r.js +4 -0
  7. package/dist/chunks/cf-settings-h2wrh6hq.js +4 -0
  8. package/dist/chunks/color-area-6rbra5dy.js +4 -0
  9. package/dist/chunks/color-field-gy56c94g.js +4 -0
  10. package/dist/chunks/color-m7r1vk54.js +4 -0
  11. package/dist/chunks/color-slider-sqqdyf6c.js +4 -0
  12. package/dist/chunks/combobox-72h32ejk.js +4 -0
  13. package/dist/chunks/components-r22xca09.js +4 -0
  14. package/dist/chunks/content-source-mmppmcyg.js +4 -0
  15. package/dist/chunks/convert-to-repeater-he70fc2b.js +4 -0
  16. package/dist/chunks/dialog-c4x05vyx.js +4 -0
  17. package/dist/chunks/editor-ccd9jwsa.js +4 -0
  18. package/dist/chunks/entry-commands-6qxz9e8p.js +4 -0
  19. package/dist/chunks/extension-sections-0egb88dm.js +4 -0
  20. package/dist/chunks/file-ops-qnab36ek.js +4 -0
  21. package/dist/chunks/files-rcn56qvm.js +4 -0
  22. package/dist/chunks/format-host-yxz0kjjs.js +4 -0
  23. package/dist/chunks/fs-events-d1qxq4z4.js +4 -0
  24. package/dist/chunks/grid-open-4z1g062t.js +4 -0
  25. package/dist/chunks/grid-view-qg1b5eqx.js +51 -0
  26. package/dist/chunks/icons-63bjtbs7.js +4 -0
  27. package/dist/chunks/iframe-entry-2zggzajv.js +5 -0
  28. package/dist/chunks/iframe-entry-76j8vwwx.js +5 -0
  29. package/dist/chunks/iframe-entry-99nr5zfb.js +5 -0
  30. package/dist/chunks/iframe-entry-pkgmcgp0.js +5 -0
  31. package/dist/chunks/iframe-host-ssv7kyj0.js +4 -0
  32. package/dist/chunks/{index-2veqmnhr.js → index-32eqzv1k.js} +3 -3
  33. package/dist/chunks/index-f0jn7nnp.js +4 -0
  34. package/dist/chunks/{javascript-8nbvs12s.js → javascript-pjp734q4.js} +3 -3
  35. package/dist/chunks/jsonMode-njkvsa02.js +13 -0
  36. package/dist/chunks/jx-validate-ttasrbh7.js +4 -0
  37. package/dist/chunks/layers-bgyr11tr.js +4 -0
  38. package/dist/chunks/layers-panel-7ez66zeq.js +4 -0
  39. package/dist/chunks/listbox-c421cf8c.js +4 -0
  40. package/dist/chunks/lit-html-v9gh687x.js +4 -0
  41. package/dist/chunks/media-library-sq468wts.js +4 -0
  42. package/dist/chunks/media-picker-shfe59pt.js +4 -0
  43. package/dist/chunks/menu-bdpzbfvs.js +4 -0
  44. package/dist/chunks/monaco-binding-vq1hgnn0.js +4 -0
  45. package/dist/chunks/monaco-buffer-3afgwvbp.js +4 -0
  46. package/dist/chunks/monaco-setup-xrd2cbkp.js +4 -0
  47. package/dist/chunks/notify-kzrjr3fv.js +4 -0
  48. package/dist/chunks/number-field-y62xq0ty.js +4 -0
  49. package/dist/chunks/parse-v77xtwv7.js +4 -0
  50. package/dist/chunks/platform-7v4rtd7m.js +4 -0
  51. package/dist/chunks/popover-b89sfej7.js +4 -0
  52. package/dist/chunks/publish-panel-2z9gw8ee.js +4 -0
  53. package/dist/chunks/publish-quick-qx2455cj.js +4 -0
  54. package/dist/chunks/publish-workspace-wrc1dgwx.js +4 -0
  55. package/dist/chunks/quick-search-n0t0eqxb.js +4 -0
  56. package/dist/chunks/references-9547rg5s.js +4 -0
  57. package/dist/chunks/right-panel-wsgnr9pn.js +4 -0
  58. package/dist/chunks/select-rzds841e.js +4 -0
  59. package/dist/chunks/source-control-kwktr9y6.js +4 -0
  60. package/dist/chunks/split-c9zfdgxf.js +4 -0
  61. package/dist/chunks/studio-03ct6yfv.js +9 -0
  62. package/dist/chunks/studio-07rcfje3.js +5 -0
  63. package/dist/chunks/studio-3e54qh39.js +7 -0
  64. package/dist/chunks/studio-3exxhz5g.js +5 -0
  65. package/dist/chunks/studio-3q40e3rj.js +5 -0
  66. package/dist/chunks/studio-3qeh9t0h.js +6 -0
  67. package/dist/chunks/studio-3qqjeep5.js +6 -0
  68. package/dist/chunks/studio-43sd2mam.js +4 -0
  69. package/dist/chunks/studio-4hp8pkyt.js +5 -0
  70. package/dist/chunks/studio-58xg6j2q.js +9 -0
  71. package/dist/chunks/studio-5g0rprdt.js +7 -0
  72. package/dist/chunks/studio-6m380wp7.js +5 -0
  73. package/dist/chunks/studio-80jyh1xh.js +4 -0
  74. package/dist/chunks/studio-83mk4bgg.js +9 -0
  75. package/dist/chunks/{studio-kggey1jt.js → studio-881z1xrx.js} +4 -4
  76. package/dist/chunks/studio-8m0y2qe7.js +5 -0
  77. package/dist/chunks/studio-8tr6cfrc.js +5 -0
  78. package/dist/chunks/studio-8vcvfs7r.js +6 -0
  79. package/dist/chunks/studio-9tmebf0s.js +5 -0
  80. package/dist/chunks/studio-a2bvaptz.js +5 -0
  81. package/dist/chunks/studio-b7y5mr30.js +5 -0
  82. package/dist/chunks/studio-bavb31r0.js +5 -0
  83. package/dist/chunks/studio-bbe4c90a.js +5 -0
  84. package/dist/chunks/studio-c05wdnt3.js +5 -0
  85. package/dist/chunks/studio-ccv2svc6.js +5 -0
  86. package/dist/chunks/studio-d5grtb9e.js +16 -0
  87. package/dist/chunks/studio-df0baea9.js +5 -0
  88. package/dist/chunks/studio-dgk4dqtx.js +7 -0
  89. package/dist/chunks/studio-e1g64q43.js +5 -0
  90. package/dist/chunks/studio-ed1hp6zf.js +6 -0
  91. package/dist/chunks/studio-ed3xx40h.js +7 -0
  92. package/dist/chunks/studio-f14e1zdj.js +5 -0
  93. package/dist/chunks/studio-fbhxxc5f.js +5 -0
  94. package/dist/chunks/studio-fyh0jc96.js +5 -0
  95. package/dist/chunks/studio-gcxk20n7.js +5 -0
  96. package/dist/chunks/studio-jaaz8ce9.js +5 -0
  97. package/dist/chunks/{studio-8grwxtqk.js → studio-jcnsdaep.js} +4 -4
  98. package/dist/chunks/studio-jsgf2q5k.js +7 -0
  99. package/dist/chunks/{studio-1q1sh2ax.js → studio-k3xxbagr.js} +3 -3
  100. package/dist/chunks/studio-k7evxqh4.js +5 -0
  101. package/dist/chunks/studio-kt3pjkwd.js +5 -0
  102. package/dist/chunks/studio-m8g16bgz.js +5 -0
  103. package/dist/chunks/studio-mn0476ag.js +5 -0
  104. package/dist/chunks/studio-mx1smyq0.js +5 -0
  105. package/dist/chunks/studio-n0c5h6mf.js +5 -0
  106. package/dist/chunks/{studio-rv11kfwa.js → studio-nh6d342n.js} +7 -7
  107. package/dist/chunks/studio-nqxqf8p2.js +4 -0
  108. package/dist/chunks/studio-p4nrkvqr.js +5 -0
  109. package/dist/chunks/{studio-h46vtzk8.js → studio-pbxa5fpc.js} +4 -4
  110. package/dist/chunks/studio-pgmvdv7z.js +7 -0
  111. package/dist/chunks/studio-ph84avkf.js +5 -0
  112. package/dist/chunks/{studio-wszjyh0j.js → studio-q0mvbaq6.js} +4 -4
  113. package/dist/chunks/studio-q0tccd43.js +5 -0
  114. package/dist/chunks/studio-q7rtx6zq.js +14 -0
  115. package/dist/chunks/{studio-pre0skq6.js → studio-qgh13jtz.js} +4 -4
  116. package/dist/chunks/studio-qmn1xc24.js +5 -0
  117. package/dist/chunks/studio-qwdqwkj0.js +5 -0
  118. package/dist/chunks/{studio-t6b6qe31.js → studio-r5qy30vx.js} +4 -4
  119. package/dist/chunks/studio-rj9eamf8.js +5 -0
  120. package/dist/chunks/studio-rptgsk96.js +5 -0
  121. package/dist/chunks/studio-rthyg42z.js +928 -0
  122. package/dist/chunks/studio-s19tp1xr.js +5 -0
  123. package/dist/chunks/studio-s32578pn.js +5 -0
  124. package/dist/chunks/studio-svb7yyve.js +5 -0
  125. package/dist/chunks/studio-syreb644.js +5 -0
  126. package/dist/chunks/studio-tf9jryb1.js +10 -0
  127. package/dist/chunks/studio-tfkznv39.js +5 -0
  128. package/dist/chunks/studio-tft6r105.js +5 -0
  129. package/dist/chunks/studio-txf2kysx.js +5 -0
  130. package/dist/chunks/studio-v8867ddv.js +12 -0
  131. package/dist/chunks/studio-vxq7fcvv.js +5 -0
  132. package/dist/chunks/studio-w4rz9hdk.js +5 -0
  133. package/dist/chunks/studio-wbcjbhy1.js +9 -0
  134. package/dist/chunks/studio-wc649wss.js +5 -0
  135. package/dist/chunks/studio-wys23mxz.js +5 -0
  136. package/dist/chunks/studio-x1x167jh.js +5 -0
  137. package/dist/chunks/studio-x9hsze61.js +5 -0
  138. package/dist/chunks/studio-y0n7yxea.js +9 -0
  139. package/dist/chunks/studio-y3ahhdpx.js +5 -0
  140. package/dist/chunks/studio-z97c48fk.js +5 -0
  141. package/dist/chunks/studio-zat62m0c.js +5 -0
  142. package/dist/chunks/studio-zcd2e7yz.js +5 -0
  143. package/dist/chunks/studio-zz9qe3rw.js +64 -0
  144. package/dist/chunks/swatch-group-ewh24n1f.js +4 -0
  145. package/dist/chunks/tabs-f5cw3tgp.js +4 -0
  146. package/dist/chunks/textfield-wewc8rq2.js +4 -0
  147. package/dist/chunks/toast-1gv0h53h.js +4 -0
  148. package/dist/chunks/toast-host-1yg5ar8d.js +4 -0
  149. package/dist/chunks/{toolbar-2nnzqhrj.js → toolbar-44cm5cta.js} +3 -3
  150. package/dist/chunks/tooltip-yypz28gq.js +4 -0
  151. package/dist/chunks/tree-9xa4hm7n.js +4 -0
  152. package/dist/chunks/tsMode-epyfz1hv.js +14 -0
  153. package/dist/chunks/workspace-dz7nxfhv.js +4 -0
  154. package/dist/chunks/workspace-home-xsd7hkjw.js +4 -0
  155. package/dist/chunks/ws-client-bv552sfx.js +4 -0
  156. package/dist/iframe-entry.js +20 -16
  157. package/dist/manifest.json +77 -63
  158. package/dist/studio.js +106 -107
  159. package/dist/workers/ts.worker.js +3 -3
  160. package/package.json +17 -16
  161. package/src/about/about-modal.ts +4 -3
  162. package/src/account/action-flow.ts +45 -38
  163. package/src/account-status.ts +7 -2
  164. package/src/browse/component-examples.ts +272 -0
  165. package/src/browse/library-commands.ts +64 -104
  166. package/src/browse/library-layouts.ts +270 -53
  167. package/src/browse/library-model.ts +194 -134
  168. package/src/browse/library-pane.ts +748 -440
  169. package/src/browse/library-preview.ts +161 -26
  170. package/src/browse/library-source.ts +308 -41
  171. package/src/browse/preview-root.ts +78 -0
  172. package/src/browse/preview-style.ts +155 -0
  173. package/src/canvas/asset-refs.ts +40 -10
  174. package/src/canvas/asset-resolve.ts +19 -23
  175. package/src/canvas/canvas-helpers.ts +7 -6
  176. package/src/canvas/canvas-live-render.ts +260 -77
  177. package/src/canvas/canvas-origin.ts +37 -12
  178. package/src/canvas/canvas-page-context.ts +112 -0
  179. package/src/canvas/canvas-patcher.ts +30 -30
  180. package/src/canvas/canvas-perf.ts +11 -5
  181. package/src/canvas/canvas-render.ts +175 -148
  182. package/src/canvas/canvas-surface.ts +5 -3
  183. package/src/canvas/canvas-utils.ts +147 -61
  184. package/src/canvas/dialog-path.ts +9 -4
  185. package/src/canvas/dialog-state.ts +1 -2
  186. package/src/canvas/diff-marks.ts +9 -16
  187. package/src/canvas/diff-toolbar.ts +8 -7
  188. package/src/canvas/edit-width-drag.ts +4 -1
  189. package/src/canvas/edit-width.ts +1 -3
  190. package/src/canvas/iframe-channel.ts +27 -13
  191. package/src/canvas/iframe-drop.ts +120 -12
  192. package/src/canvas/iframe-editable-root.ts +29 -16
  193. package/src/canvas/iframe-entry.ts +104 -75
  194. package/src/canvas/iframe-eval.ts +73 -49
  195. package/src/canvas/iframe-host.ts +269 -158
  196. package/src/canvas/iframe-inline-edit.ts +49 -30
  197. package/src/canvas/iframe-insert.ts +5 -4
  198. package/src/canvas/iframe-interaction.ts +30 -25
  199. package/src/canvas/iframe-keys.ts +11 -0
  200. package/src/canvas/iframe-overlay.ts +1 -1
  201. package/src/canvas/iframe-patch.ts +25 -21
  202. package/src/canvas/iframe-position.ts +12 -6
  203. package/src/canvas/iframe-protocol.ts +36 -21
  204. package/src/canvas/iframe-render.ts +84 -35
  205. package/src/canvas/iframe-slash.ts +24 -11
  206. package/src/canvas/iframe-subtree.ts +10 -3
  207. package/src/canvas/npm-modules.ts +22 -0
  208. package/src/canvas/path-mapping.ts +19 -12
  209. package/src/canvas/popover-path.ts +7 -3
  210. package/src/canvas/popover-state.ts +1 -2
  211. package/src/canvas/preview-navigate.ts +16 -0
  212. package/src/canvas/repeater-sources.ts +200 -0
  213. package/src/canvas/serialize-scope.ts +13 -5
  214. package/src/canvas/stage-scrollbar.ts +7 -2
  215. package/src/canvas/surface-registry.ts +27 -3
  216. package/src/collab/collab-commands.ts +7 -2
  217. package/src/collab/collab-session.ts +84 -45
  218. package/src/collab/collab-state.ts +4 -3
  219. package/src/collab/monaco-binding.ts +16 -13
  220. package/src/collab/monaco-cursors.ts +5 -2
  221. package/src/commands/app-commands.ts +16 -6
  222. package/src/commands/budget.ts +13 -11
  223. package/src/commands/command-args.ts +103 -71
  224. package/src/commands/context.ts +55 -28
  225. package/src/commands/defaults.ts +69 -45
  226. package/src/commands/keymap.ts +56 -43
  227. package/src/commands/levels.ts +14 -8
  228. package/src/commands/live-context.ts +9 -7
  229. package/src/commands/reference.ts +2 -1
  230. package/src/commands/registry.ts +22 -11
  231. package/src/commands/run-reported.ts +15 -10
  232. package/src/component-props.ts +46 -30
  233. package/src/content/collection-match.ts +11 -9
  234. package/src/content/collection-pages.ts +412 -0
  235. package/src/content/content-collections.ts +270 -0
  236. package/src/content/draft-state.ts +4 -3
  237. package/src/content/entry-commands.ts +54 -62
  238. package/src/content/entry-editor.ts +137 -32
  239. package/src/content/entry-fields.ts +25 -8
  240. package/src/content/entry-inspector.ts +225 -0
  241. package/src/content/entry-model.ts +38 -15
  242. package/src/content/entry-open.ts +80 -0
  243. package/src/content/entry-summaries.ts +440 -0
  244. package/src/content/file-record-ids.ts +80 -0
  245. package/src/content/file-records.ts +125 -0
  246. package/src/content/page-summaries.ts +129 -0
  247. package/src/content/record-entry.ts +201 -0
  248. package/src/content/writing-banner.ts +177 -0
  249. package/src/create/add-new-commands.ts +185 -0
  250. package/src/create/add-new-flow.ts +1116 -0
  251. package/src/create/add-new.ts +1014 -0
  252. package/src/create/element-name.ts +121 -0
  253. package/src/editor/canvas-context-menu.ts +1 -2
  254. package/src/editor/canvas-slash-bridge.ts +3 -6
  255. package/src/editor/content-slice.ts +16 -14
  256. package/src/editor/context-menu.ts +35 -22
  257. package/src/editor/convert-targets.ts +30 -35
  258. package/src/editor/convert-to-component.ts +78 -48
  259. package/src/editor/convert-to-repeater.ts +34 -22
  260. package/src/editor/editable-tags.ts +17 -2
  261. package/src/editor/file-drop-action.ts +29 -22
  262. package/src/editor/inline-edit-apply.ts +79 -17
  263. package/src/editor/inline-edit.ts +76 -50
  264. package/src/editor/inline-format.ts +59 -56
  265. package/src/editor/inline-link.ts +40 -15
  266. package/src/editor/insert-component.ts +91 -0
  267. package/src/editor/insert-zone-action.ts +14 -5
  268. package/src/editor/merge-tags.ts +58 -19
  269. package/src/editor/repeater-scope.ts +39 -28
  270. package/src/editor/shortcuts.ts +76 -42
  271. package/src/editor/slash-menu.ts +52 -14
  272. package/src/files/asset-versions.ts +4 -4
  273. package/src/files/components.ts +89 -20
  274. package/src/files/elements.ts +5 -6
  275. package/src/files/file-ops.ts +92 -41
  276. package/src/files/files.ts +248 -239
  277. package/src/files/fs-events.ts +18 -7
  278. package/src/files/media-meta.ts +97 -2
  279. package/src/files/media-paths.ts +3 -0
  280. package/src/files/media-types.ts +55 -0
  281. package/src/files/media-upload.ts +209 -52
  282. package/src/files/new-file-name.ts +156 -0
  283. package/src/files/serialize-document.ts +15 -5
  284. package/src/format/constraints.ts +1 -1
  285. package/src/format/convert-file.ts +27 -13
  286. package/src/format/format-choices.ts +2 -1
  287. package/src/format/format-host.ts +91 -50
  288. package/src/github/github-auth-status.ts +27 -3
  289. package/src/github/github-auth.ts +21 -11
  290. package/src/github/github-publish.ts +28 -23
  291. package/src/grid/cell-editors.ts +46 -31
  292. package/src/grid/cell-popovers.ts +5 -3
  293. package/src/grid/edit-buffer.ts +10 -9
  294. package/src/grid/grid-controller.ts +25 -23
  295. package/src/grid/grid-layout.ts +21 -5
  296. package/src/grid/grid-open.ts +3 -33
  297. package/src/grid/grid-panel.ts +65 -6
  298. package/src/grid/grid-reveal.ts +34 -0
  299. package/src/grid/grid-source.ts +9 -31
  300. package/src/grid/grid-view.ts +45 -23
  301. package/src/grid/redirects-grid.ts +14 -5
  302. package/src/grid/redirects.ts +16 -14
  303. package/src/grid/schema-columns.ts +25 -19
  304. package/src/grid/sources/connector-source.ts +47 -20
  305. package/src/grid/sources/content-source.ts +100 -31
  306. package/src/grid/sources/csv-file-source.ts +2 -2
  307. package/src/grid/tabulator-tables.d.ts +61 -34
  308. package/src/hosting/document.ts +2 -2
  309. package/src/hosting/stage.ts +7 -7
  310. package/src/i18n/i18n-commands.ts +3 -3
  311. package/src/media/media-commands.ts +181 -0
  312. package/src/media/media-library-model.ts +232 -0
  313. package/src/media/media-library.ts +1283 -0
  314. package/src/media/media-pane.ts +51 -20
  315. package/src/new-project/add-repo-modal.ts +20 -19
  316. package/src/new-project/import-tab.ts +10 -14
  317. package/src/new-project/location-fields.ts +2 -1
  318. package/src/new-project/new-project-modal.ts +12 -9
  319. package/src/packages/jxsuite-update.ts +4 -3
  320. package/src/packages/pull-package-sync.ts +26 -25
  321. package/src/page-params.ts +97 -68
  322. package/src/panels/activity-panel.ts +38 -14
  323. package/src/panels/ai-chat/attached-context.ts +13 -7
  324. package/src/panels/ai-chat/chat-markdown.ts +8 -8
  325. package/src/panels/ai-chat/chat-view.ts +80 -73
  326. package/src/panels/ai-chat/composer.ts +30 -33
  327. package/src/panels/ai-chat/sessions-view.ts +1 -2
  328. package/src/panels/ai-panel.ts +23 -20
  329. package/src/panels/block-action-bar.ts +57 -46
  330. package/src/panels/bottom-dock.ts +5 -3
  331. package/src/panels/canvas-dnd-bridge.ts +36 -26
  332. package/src/panels/chat-panel.ts +6 -6
  333. package/src/panels/collections-panel.ts +306 -0
  334. package/src/panels/component-preview.ts +35 -13
  335. package/src/panels/data-explorer.ts +63 -26
  336. package/src/panels/data-grid.ts +18 -11
  337. package/src/panels/dnd.ts +115 -138
  338. package/src/panels/editors.ts +52 -21
  339. package/src/panels/elements-panel.ts +19 -5
  340. package/src/panels/empty-state.ts +2 -2
  341. package/src/panels/events-panel.ts +84 -69
  342. package/src/panels/formula-workspace.ts +78 -54
  343. package/src/panels/frontmatter-fields.ts +33 -28
  344. package/src/panels/git-diff-open.ts +10 -6
  345. package/src/panels/head-panel.ts +488 -202
  346. package/src/panels/i18n-panel.ts +20 -12
  347. package/src/panels/imports-panel.ts +25 -47
  348. package/src/panels/jump-bar.ts +75 -31
  349. package/src/panels/layers-panel.ts +130 -101
  350. package/src/panels/left-panel.ts +25 -11
  351. package/src/panels/navigator-panels.ts +23 -11
  352. package/src/panels/pane-context.ts +140 -49
  353. package/src/panels/pane-grid.ts +55 -26
  354. package/src/panels/panel-registry.ts +36 -46
  355. package/src/panels/properties-panel.ts +182 -124
  356. package/src/panels/quick-search.ts +53 -31
  357. package/src/panels/right-panel.ts +201 -45
  358. package/src/panels/seo-modal.ts +54 -125
  359. package/src/panels/settings-menu.ts +63 -61
  360. package/src/panels/settings-pane.ts +268 -162
  361. package/src/panels/signals-panel.ts +156 -135
  362. package/src/panels/site-model.ts +367 -0
  363. package/src/panels/site-panel.ts +638 -0
  364. package/src/panels/statement-editor.ts +230 -140
  365. package/src/panels/style-panel.ts +253 -206
  366. package/src/panels/style-utils.ts +114 -51
  367. package/src/panels/stylebook-doc.ts +195 -60
  368. package/src/panels/stylebook-layers-panel.ts +48 -89
  369. package/src/panels/stylebook-panel.ts +60 -27
  370. package/src/panels/styles-panel.ts +327 -0
  371. package/src/panels/tab-drop.ts +27 -11
  372. package/src/panels/tab-strip.ts +143 -49
  373. package/src/platform-errors.ts +57 -43
  374. package/src/platform.ts +59 -31
  375. package/src/platforms/cloud.ts +373 -176
  376. package/src/platforms/default-platform.ts +14 -8
  377. package/src/platforms/devserver.ts +180 -142
  378. package/src/platforms/read-batcher.ts +16 -8
  379. package/src/project-list.ts +2 -1
  380. package/src/publish/deploy-checklist.ts +20 -9
  381. package/src/publish/pages-service.ts +66 -27
  382. package/src/publish/publish-changes.ts +491 -0
  383. package/src/publish/publish-commands.ts +88 -22
  384. package/src/publish/publish-ids.ts +49 -0
  385. package/src/publish/publish-panel.ts +10 -6
  386. package/src/publish/publish-quick.ts +148 -0
  387. package/src/publish/publish-workspace.ts +926 -0
  388. package/src/publish/source-control.ts +907 -0
  389. package/src/recent-projects.ts +15 -8
  390. package/src/resize-edges.ts +26 -36
  391. package/src/services/a11y-report.ts +26 -19
  392. package/src/services/agent-seed.ts +23 -11
  393. package/src/services/ai-ask.ts +9 -12
  394. package/src/services/ai-command-tools.ts +68 -62
  395. package/src/services/ai-import-tools.ts +80 -67
  396. package/src/services/ai-models.ts +17 -13
  397. package/src/services/ai-project-tools.ts +68 -32
  398. package/src/services/ai-session-store.ts +19 -10
  399. package/src/services/ai-system-prompt.ts +46 -20
  400. package/src/services/ai-tools.ts +71 -27
  401. package/src/services/ai-write-report.ts +20 -12
  402. package/src/services/ai-writes.ts +4 -4
  403. package/src/services/automation.ts +74 -51
  404. package/src/services/cem-export.ts +149 -58
  405. package/src/services/cf-settings.ts +4 -4
  406. package/src/services/clock.ts +6 -1
  407. package/src/services/code-services.ts +37 -31
  408. package/src/services/connection.ts +2 -2
  409. package/src/services/context-manager.ts +14 -10
  410. package/src/services/context-resolver.ts +20 -8
  411. package/src/services/data-service.ts +19 -15
  412. package/src/services/directory-picker.ts +20 -14
  413. package/src/services/document-assistant.ts +39 -19
  414. package/src/services/gated-registry.ts +10 -6
  415. package/src/services/harness/chat-reducer.ts +23 -1
  416. package/src/services/import-client.ts +91 -38
  417. package/src/services/import-seed.ts +8 -2
  418. package/src/services/jx-validate.ts +28 -31
  419. package/src/services/live-preview.ts +0 -0
  420. package/src/services/live-surfaces.ts +6 -3
  421. package/src/services/model-uri.ts +10 -2
  422. package/src/services/module-preloads.ts +12 -8
  423. package/src/services/monaco-buffer.ts +43 -24
  424. package/src/services/monaco-lazy.ts +7 -8
  425. package/src/services/monaco-setup.ts +23 -16
  426. package/src/services/notify.ts +44 -17
  427. package/src/services/popover-report.ts +25 -10
  428. package/src/services/preview-eval.ts +20 -8
  429. package/src/services/profile.ts +13 -6
  430. package/src/services/project-path.ts +13 -10
  431. package/src/services/references.ts +0 -0
  432. package/src/services/render-critic.ts +29 -9
  433. package/src/services/settings/definitions.ts +25 -14
  434. package/src/services/settings/kernel.ts +13 -4
  435. package/src/services/settings/write-queue.ts +9 -9
  436. package/src/services/token-lint.ts +12 -10
  437. package/src/services/tool-executor.ts +17 -5
  438. package/src/services/tool-outcomes.ts +44 -24
  439. package/src/services/trusted-types.ts +24 -7
  440. package/src/settings/contexts-section.ts +11 -8
  441. package/src/settings/contributed-section.ts +128 -70
  442. package/src/settings/css-vars-editor.ts +119 -32
  443. package/src/settings/defs-editor.ts +38 -35
  444. package/src/settings/developer-panels.ts +43 -0
  445. package/src/settings/extension-rows.ts +16 -8
  446. package/src/settings/extension-sections.ts +42 -14
  447. package/src/settings/extensions-section.ts +4 -1
  448. package/src/settings/general-settings.ts +101 -28
  449. package/src/settings/locales-section.ts +20 -12
  450. package/src/settings/preferences-dialog.ts +17 -7
  451. package/src/settings/preferences-keymap.ts +7 -5
  452. package/src/settings/preferences-sections.ts +11 -5
  453. package/src/settings/project-sections.ts +28 -11
  454. package/src/settings/schema-field-ui.ts +12 -1
  455. package/src/settings/section-registry.ts +116 -11
  456. package/src/settings/settings-dialog.ts +192 -0
  457. package/src/settings/settings-document.ts +186 -166
  458. package/src/shell/tree.ts +6 -5
  459. package/src/shell.ts +536 -477
  460. package/src/site-context.ts +101 -32
  461. package/src/state.ts +68 -57
  462. package/src/store.ts +54 -34
  463. package/src/studio.ts +219 -116
  464. package/src/style/live-preview.ts +1 -1
  465. package/src/style/project-styles.ts +40 -7
  466. package/src/style/stylebook-specimens.ts +89 -0
  467. package/src/style/stylebook-target.ts +26 -0
  468. package/src/style/tag-inheritance.ts +105 -0
  469. package/src/style/token-ref.ts +5 -4
  470. package/src/style/variables-focus.ts +61 -0
  471. package/src/style/variables-view.ts +235 -0
  472. package/src/surfaces/about.ts +18 -19
  473. package/src/surfaces/add-new.json +1482 -0
  474. package/src/surfaces/add-new.ts +325 -0
  475. package/src/surfaces/add-repo.ts +17 -19
  476. package/src/surfaces/ai-chat.ts +33 -38
  477. package/src/surfaces/ai-credentials-form.ts +6 -16
  478. package/src/surfaces/ai-managed-connect.ts +3 -4
  479. package/src/surfaces/ai-model-picker.ts +3 -5
  480. package/src/surfaces/block-action-bar.ts +22 -11
  481. package/src/surfaces/boot-failure.json +4 -3
  482. package/src/surfaces/boot-failure.ts +4 -5
  483. package/src/surfaces/bottom-dock.json +1 -1
  484. package/src/surfaces/bottom-dock.ts +9 -18
  485. package/src/surfaces/canvas-stage.json +30 -19
  486. package/src/surfaces/canvas-stage.ts +17 -16
  487. package/src/surfaces/cf-account-picker.ts +17 -18
  488. package/src/surfaces/collections-panel.json +615 -0
  489. package/src/surfaces/collections-panel.ts +168 -0
  490. package/src/surfaces/commandbar.json +241 -96
  491. package/src/surfaces/commandbar.ts +145 -105
  492. package/src/surfaces/convert-repeater.ts +17 -19
  493. package/src/surfaces/data-actions.ts +9 -7
  494. package/src/surfaces/dialog.ts +26 -28
  495. package/src/surfaces/diff-toolbar.ts +9 -7
  496. package/src/surfaces/empty-state.json +1 -1
  497. package/src/surfaces/empty-state.ts +7 -10
  498. package/src/surfaces/entry-editor.json +136 -0
  499. package/src/surfaces/entry-editor.ts +35 -11
  500. package/src/surfaces/entry-inspector.json +371 -0
  501. package/src/surfaces/entry-inspector.ts +143 -0
  502. package/src/surfaces/expression-editor.ts +11 -25
  503. package/src/surfaces/files-panel.ts +27 -14
  504. package/src/surfaces/formula-palette.ts +4 -5
  505. package/src/surfaces/github-auth.ts +16 -20
  506. package/src/surfaces/github-publish.ts +17 -22
  507. package/src/surfaces/grid-cell.ts +30 -31
  508. package/src/surfaces/grid-open.ts +10 -14
  509. package/src/surfaces/grid-panel.ts +13 -9
  510. package/src/surfaces/grid-replace.ts +13 -13
  511. package/src/surfaces/grid-views.ts +15 -18
  512. package/src/surfaces/inspector-dock.json +162 -14
  513. package/src/surfaces/inspector-dock.ts +59 -31
  514. package/src/surfaces/jump-bar.ts +5 -6
  515. package/src/surfaces/jxsuite-update.ts +16 -22
  516. package/src/surfaces/library-pane.json +670 -437
  517. package/src/surfaces/library-pane.ts +111 -77
  518. package/src/surfaces/logic-panel.ts +17 -30
  519. package/src/surfaces/logic-workspace.ts +13 -15
  520. package/src/surfaces/media-browser.json +62 -6
  521. package/src/surfaces/media-browser.ts +26 -11
  522. package/src/surfaces/media-field.json +1 -1
  523. package/src/surfaces/media-field.ts +4 -5
  524. package/src/surfaces/media-library.json +1586 -0
  525. package/src/surfaces/media-library.ts +282 -0
  526. package/src/surfaces/media-pane.ts +8 -7
  527. package/src/surfaces/media-pick-dialog.json +71 -0
  528. package/src/surfaces/media-pick-dialog.ts +132 -0
  529. package/src/surfaces/menu.ts +47 -23
  530. package/src/surfaces/navigator-dock.ts +11 -12
  531. package/src/surfaces/new-project.ts +27 -26
  532. package/src/surfaces/pane-context.json +144 -77
  533. package/src/surfaces/pane-context.ts +44 -25
  534. package/src/surfaces/pane-grid.ts +15 -10
  535. package/src/surfaces/panel-activity.ts +5 -6
  536. package/src/surfaces/panel-data.ts +3 -4
  537. package/src/surfaces/panel-deploy-checklist.json +12 -6
  538. package/src/surfaces/panel-deploy-checklist.ts +8 -7
  539. package/src/surfaces/panel-elements.ts +5 -7
  540. package/src/surfaces/panel-i18n.ts +5 -7
  541. package/src/surfaces/panel-imports.ts +6 -13
  542. package/src/surfaces/panel-outline.ts +25 -19
  543. package/src/surfaces/panel-page.json +72 -2
  544. package/src/surfaces/panel-page.ts +49 -25
  545. package/src/surfaces/panel-problems.ts +5 -7
  546. package/src/surfaces/panel-signals.json +1 -1
  547. package/src/surfaces/panel-signals.ts +25 -39
  548. package/src/surfaces/panel-stylebook-layers.json +71 -204
  549. package/src/surfaces/panel-stylebook-layers.ts +5 -29
  550. package/src/surfaces/preferences.json +120 -48
  551. package/src/surfaces/preferences.ts +29 -11
  552. package/src/surfaces/progress-modal.ts +15 -9
  553. package/src/surfaces/properties-panel.json +1 -1
  554. package/src/surfaces/properties-panel.ts +20 -42
  555. package/src/surfaces/publish-quick.json +428 -0
  556. package/src/surfaces/publish-quick.ts +165 -0
  557. package/src/surfaces/publish-workspace.json +2892 -0
  558. package/src/surfaces/publish-workspace.ts +391 -0
  559. package/src/surfaces/publish.ts +18 -18
  560. package/src/surfaces/push-plan.ts +7 -8
  561. package/src/surfaces/rail.json +1 -159
  562. package/src/surfaces/rail.ts +22 -79
  563. package/src/surfaces/reference-field.ts +11 -15
  564. package/src/surfaces/schema-builder.ts +16 -22
  565. package/src/surfaces/schema-form.json +10 -2
  566. package/src/surfaces/schema-form.ts +17 -25
  567. package/src/surfaces/secret-field.ts +9 -6
  568. package/src/surfaces/seo.json +1 -1
  569. package/src/surfaces/seo.ts +21 -15
  570. package/src/surfaces/settings-contexts.ts +9 -7
  571. package/src/surfaces/settings-contributed.json +5 -5
  572. package/src/surfaces/settings-contributed.ts +32 -12
  573. package/src/surfaces/settings-css-vars.json +44 -36
  574. package/src/surfaces/settings-css-vars.ts +82 -16
  575. package/src/surfaces/settings-defs.json +2 -2
  576. package/src/surfaces/settings-defs.ts +17 -21
  577. package/src/surfaces/settings-deploy.json +2 -15
  578. package/src/surfaces/settings-deploy.ts +9 -16
  579. package/src/surfaces/settings-dialog.json +51 -0
  580. package/src/surfaces/settings-dialog.ts +169 -0
  581. package/src/surfaces/settings-extensions.ts +5 -6
  582. package/src/surfaces/settings-head.ts +33 -39
  583. package/src/surfaces/settings-locales.ts +8 -20
  584. package/src/surfaces/settings-overview.json +3 -3
  585. package/src/surfaces/settings-overview.ts +14 -8
  586. package/src/surfaces/settings-packages.ts +8 -7
  587. package/src/surfaces/settings-pane.json +269 -46
  588. package/src/surfaces/settings-pane.ts +88 -36
  589. package/src/surfaces/settings-rawjson.ts +5 -6
  590. package/src/surfaces/shell.json +2 -1
  591. package/src/surfaces/shell.ts +1 -2
  592. package/src/surfaces/site-panel.json +1029 -0
  593. package/src/surfaces/site-panel.ts +233 -0
  594. package/src/surfaces/slash-menu.json +63 -21
  595. package/src/surfaces/slash-menu.ts +42 -9
  596. package/src/surfaces/statements.ts +13 -18
  597. package/src/surfaces/statusbar.ts +56 -29
  598. package/src/surfaces/style-panel.ts +18 -31
  599. package/src/surfaces/stylebook-chrome.ts +3 -5
  600. package/src/surfaces/styles-panel.json +735 -0
  601. package/src/surfaces/styles-panel.ts +195 -0
  602. package/src/surfaces/styles-variables.json +149 -0
  603. package/src/surfaces/styles-variables.ts +145 -0
  604. package/src/surfaces/tab-strip.json +4 -4
  605. package/src/surfaces/tab-strip.ts +14 -13
  606. package/src/surfaces/target-line.ts +6 -7
  607. package/src/surfaces/welcome.ts +6 -8
  608. package/src/surfaces/writing-banner.json +94 -0
  609. package/src/surfaces/writing-banner.ts +80 -0
  610. package/src/tabs/bare-repeaters.ts +101 -0
  611. package/src/tabs/patch-ops.ts +4 -3
  612. package/src/tabs/project-config.ts +32 -21
  613. package/src/tabs/selection.ts +36 -8
  614. package/src/tabs/tab.ts +99 -48
  615. package/src/tabs/transact.ts +98 -53
  616. package/src/types.ts +53 -43
  617. package/src/ui/ai-credentials-form.ts +10 -13
  618. package/src/ui/ai-model-picker.ts +3 -3
  619. package/src/ui/cf-account-picker.ts +7 -9
  620. package/src/ui/color-selector.ts +9 -5
  621. package/src/ui/dynamic-slot.ts +7 -8
  622. package/src/ui/expression-editor.ts +112 -105
  623. package/src/ui/form-controls.ts +104 -56
  624. package/src/ui/formula-catalog.ts +239 -230
  625. package/src/ui/formula-chips.ts +33 -18
  626. package/src/ui/layers.ts +57 -31
  627. package/src/ui/media-picker.ts +300 -47
  628. package/src/ui/popover-surface.ts +20 -12
  629. package/src/ui/progress-modal.ts +13 -8
  630. package/src/ui/regions.ts +14 -12
  631. package/src/ui/schema-form.ts +372 -97
  632. package/src/ui/surface.ts +71 -8
  633. package/src/ui/timing.ts +9 -0
  634. package/src/ui/value-source.ts +44 -31
  635. package/src/ui/virtual-window.ts +29 -3
  636. package/src/utils/base64.ts +6 -4
  637. package/src/utils/edit-display.ts +366 -111
  638. package/src/utils/element-selectors.ts +3 -2
  639. package/src/utils/google-fonts.ts +15 -14
  640. package/src/utils/inherited-style.ts +18 -20
  641. package/src/utils/link-target.ts +1 -1
  642. package/src/utils/local-day.ts +18 -0
  643. package/src/utils/preview-format.ts +25 -3
  644. package/src/utils/strip-events.ts +49 -22
  645. package/src/utils/studio-utils.ts +29 -14
  646. package/src/view.ts +2 -3
  647. package/src/workspace/pane-derive.ts +14 -16
  648. package/src/workspace/session.ts +81 -50
  649. package/src/workspace/tab-workspace.ts +137 -0
  650. package/src/workspace/workspace-back.ts +189 -0
  651. package/src/workspace/workspace-home.ts +133 -0
  652. package/src/workspace/workspace-ids.ts +129 -0
  653. package/src/workspace/workspace-switch.ts +372 -0
  654. package/src/workspace/workspace.ts +165 -47
  655. package/styles/shell-frame.css +30 -7
  656. package/styles/shell-frame.json +15 -3
  657. package/dist/chunks/2020-va2wwra4.js +0 -4
  658. package/dist/chunks/adapter-f93pafd7.js +0 -4
  659. package/dist/chunks/cf-account-picker-af1h381v.js +0 -4
  660. package/dist/chunks/cf-settings-125tdm0w.js +0 -4
  661. package/dist/chunks/color-area-jqhna8zy.js +0 -4
  662. package/dist/chunks/color-field-embq5ctg.js +0 -4
  663. package/dist/chunks/color-fpezvnkt.js +0 -4
  664. package/dist/chunks/color-slider-1qmw7wqy.js +0 -4
  665. package/dist/chunks/combobox-773hdzyj.js +0 -4
  666. package/dist/chunks/components-ax2f1fnn.js +0 -4
  667. package/dist/chunks/content-source-108aqtk1.js +0 -4
  668. package/dist/chunks/convert-to-repeater-ry5rmppr.js +0 -4
  669. package/dist/chunks/dialog-mtm9fq5t.js +0 -4
  670. package/dist/chunks/editor-pfgdmkb0.js +0 -4
  671. package/dist/chunks/entry-commands-t0k1q0kx.js +0 -4
  672. package/dist/chunks/extension-sections-6mwh2hf8.js +0 -4
  673. package/dist/chunks/file-ops-meej5mqf.js +0 -4
  674. package/dist/chunks/files-44vp8a2s.js +0 -4
  675. package/dist/chunks/format-host-7q1petb9.js +0 -4
  676. package/dist/chunks/fs-events-h2mwnxaz.js +0 -4
  677. package/dist/chunks/git-panel-zngbymvd.js +0 -4
  678. package/dist/chunks/grid-view-sx9vynsp.js +0 -51
  679. package/dist/chunks/icons-p44xhjf0.js +0 -4
  680. package/dist/chunks/iframe-entry-f7mqjwpm.js +0 -5
  681. package/dist/chunks/iframe-entry-haw7jkvz.js +0 -5
  682. package/dist/chunks/iframe-entry-z6qrytv3.js +0 -5
  683. package/dist/chunks/iframe-host-qk3ycq87.js +0 -4
  684. package/dist/chunks/index-wkyfjeqz.js +0 -4
  685. package/dist/chunks/jsonMode-s8kt9dsj.js +0 -13
  686. package/dist/chunks/jx-validate-psgd7vsx.js +0 -4
  687. package/dist/chunks/layers-panel-1kq2jyfk.js +0 -4
  688. package/dist/chunks/layers-xd92fg8d.js +0 -4
  689. package/dist/chunks/listbox-s8fkmnq8.js +0 -4
  690. package/dist/chunks/lit-html-ac4cwwr4.js +0 -4
  691. package/dist/chunks/media-picker-0svzkdyb.js +0 -4
  692. package/dist/chunks/menu-37d07z9m.js +0 -4
  693. package/dist/chunks/menu-5c55ea3d.js +0 -4
  694. package/dist/chunks/monaco-binding-z6r70pdt.js +0 -4
  695. package/dist/chunks/monaco-buffer-fz6gq5y7.js +0 -4
  696. package/dist/chunks/monaco-setup-q4axkgj7.js +0 -4
  697. package/dist/chunks/notify-0xgtn8q1.js +0 -4
  698. package/dist/chunks/number-field-gw7sq8rn.js +0 -4
  699. package/dist/chunks/parse-897fvqah.js +0 -4
  700. package/dist/chunks/platform-v1qctbe6.js +0 -4
  701. package/dist/chunks/popover-8htra4er.js +0 -4
  702. package/dist/chunks/publish-panel-ym1fmgq5.js +0 -4
  703. package/dist/chunks/quick-search-a54e6t5n.js +0 -4
  704. package/dist/chunks/references-gmqp82fs.js +0 -4
  705. package/dist/chunks/right-panel-v7t9awbk.js +0 -4
  706. package/dist/chunks/section-registry-vhyf3zsr.js +0 -4
  707. package/dist/chunks/select-n3v7gwas.js +0 -4
  708. package/dist/chunks/split-pff8f3ze.js +0 -4
  709. package/dist/chunks/studio-0bhx5hz6.js +0 -5
  710. package/dist/chunks/studio-0k1ddnyy.js +0 -6
  711. package/dist/chunks/studio-1b04pd0j.js +0 -64
  712. package/dist/chunks/studio-4dwbj6gb.js +0 -5
  713. package/dist/chunks/studio-4tanh828.js +0 -5
  714. package/dist/chunks/studio-55h4mstj.js +0 -4
  715. package/dist/chunks/studio-5tnvjkz4.js +0 -5
  716. package/dist/chunks/studio-60dqgb0c.js +0 -5
  717. package/dist/chunks/studio-61dp09qg.js +0 -9
  718. package/dist/chunks/studio-63epcrj2.js +0 -5
  719. package/dist/chunks/studio-74k29dy9.js +0 -5
  720. package/dist/chunks/studio-7vg6jcd3.js +0 -5
  721. package/dist/chunks/studio-7zx31knw.js +0 -9
  722. package/dist/chunks/studio-8bxk97km.js +0 -5
  723. package/dist/chunks/studio-933e30n4.js +0 -5
  724. package/dist/chunks/studio-98wnwhbg.js +0 -5
  725. package/dist/chunks/studio-9mccjwjh.js +0 -14
  726. package/dist/chunks/studio-a2ke1e4t.js +0 -5
  727. package/dist/chunks/studio-e3a2a6v3.js +0 -4
  728. package/dist/chunks/studio-e81q1vb9.js +0 -5
  729. package/dist/chunks/studio-epgrmqqm.js +0 -5
  730. package/dist/chunks/studio-ery42sqr.js +0 -4
  731. package/dist/chunks/studio-g1shz58g.js +0 -5
  732. package/dist/chunks/studio-gf0fz03c.js +0 -5
  733. package/dist/chunks/studio-gjtpe62q.js +0 -6
  734. package/dist/chunks/studio-gkskhg7m.js +0 -5
  735. package/dist/chunks/studio-gx4dnjzd.js +0 -5
  736. package/dist/chunks/studio-j03zga3y.js +0 -9
  737. package/dist/chunks/studio-jhpxeckz.js +0 -5
  738. package/dist/chunks/studio-k01r7ykp.js +0 -5
  739. package/dist/chunks/studio-kk7h30ne.js +0 -7
  740. package/dist/chunks/studio-kt1zqney.js +0 -5
  741. package/dist/chunks/studio-m3cwhvye.js +0 -5
  742. package/dist/chunks/studio-mcayt6hz.js +0 -5
  743. package/dist/chunks/studio-myjcghv3.js +0 -5
  744. package/dist/chunks/studio-n8bxwc3y.js +0 -4
  745. package/dist/chunks/studio-ngm8gvpb.js +0 -5
  746. package/dist/chunks/studio-nj5a01jy.js +0 -928
  747. package/dist/chunks/studio-pcgz8heb.js +0 -5
  748. package/dist/chunks/studio-qcsq0t15.js +0 -5
  749. package/dist/chunks/studio-qkstvve9.js +0 -5
  750. package/dist/chunks/studio-qv1pwd3c.js +0 -5
  751. package/dist/chunks/studio-rc6dvxjb.js +0 -7
  752. package/dist/chunks/studio-s8dmmz66.js +0 -5
  753. package/dist/chunks/studio-sp5xzbj4.js +0 -6
  754. package/dist/chunks/studio-szsjbj0g.js +0 -5
  755. package/dist/chunks/studio-t1xzawhr.js +0 -16
  756. package/dist/chunks/studio-tdcprbqb.js +0 -5
  757. package/dist/chunks/studio-vrmcjf9g.js +0 -7
  758. package/dist/chunks/studio-vyc0b4he.js +0 -10
  759. package/dist/chunks/studio-w0cgf6jg.js +0 -5
  760. package/dist/chunks/studio-w3hskzqk.js +0 -5
  761. package/dist/chunks/studio-xgrgcdyh.js +0 -9
  762. package/dist/chunks/studio-xz2yxfcb.js +0 -5
  763. package/dist/chunks/studio-y6n42tgs.js +0 -5
  764. package/dist/chunks/studio-yb560vxr.js +0 -5
  765. package/dist/chunks/studio-yn9f8vtx.js +0 -5
  766. package/dist/chunks/studio-yw05w8f0.js +0 -7
  767. package/dist/chunks/studio-z16sgavc.js +0 -5
  768. package/dist/chunks/studio-zey7zsdw.js +0 -12
  769. package/dist/chunks/studio-zyqn40w4.js +0 -5
  770. package/dist/chunks/swatch-group-8qh9a3bm.js +0 -4
  771. package/dist/chunks/tabs-jwthg40w.js +0 -4
  772. package/dist/chunks/textfield-spy3hc77.js +0 -4
  773. package/dist/chunks/toast-4d35zd64.js +0 -4
  774. package/dist/chunks/toast-host-8sjmfed3.js +0 -4
  775. package/dist/chunks/tooltip-fd6g9xy3.js +0 -4
  776. package/dist/chunks/tree-h19v1jfz.js +0 -4
  777. package/dist/chunks/tsMode-2frah6h1.js +0 -14
  778. package/dist/chunks/workspace-zt81g1ms.js +0 -4
  779. package/dist/chunks/ws-client-n2bh4hkf.js +0 -4
  780. package/src/panels/frontmatter-panel.ts +0 -701
  781. package/src/panels/git-panel.ts +0 -1120
  782. package/src/surfaces/doc-header.json +0 -776
  783. package/src/surfaces/doc-header.ts +0 -231
  784. package/src/surfaces/git-panel.json +0 -1880
  785. package/src/surfaces/git-panel.ts +0 -272
@@ -1,13 +1,13 @@
1
- var So,Hn,Bt,V=(e,t)=>{for(var[n,r,o]of So||[])for(var s=[e],i=globalThis,a=i.document,c,l,u,f,d;l=s.pop();)if(!Hn[l]&&(u=r[l])){Hn[l]=1;for(f=1;f<u.length;f++)s.push(o[u[f]]);if(!t&&l!==e&&(c=a&&a.head)){if(Bt===void 0)Bt=(f=a.querySelector("meta[property=csp-nonce]"))&&(f.nonce||f.getAttribute("nonce"))||"";if(d=a.createElement("link"),d.rel="modulepreload",d.crossOrigin="",Bt)d.nonce=Bt;d.href=new i.URL(u[0],n),c.appendChild(d)}}},Ma=(e,t,n,r)=>{for(var o={},s=0;s<t.length;s++)o[t[s]]=n[s];(So||=[]).push([e,o,t]),Hn||={},V(t[r],1)};Ma(import.meta.url,["qfa3kc6p","h19v1jfz","fd6g9xy3","spy3hc77","4d35zd64","8sjmfed3","fpezvnkt","p44xhjf0","gw7sq8rn","2mqby73c","8htra4er","n3v7gwas","pff8f3ze","8qh9a3bm","jwthg40w","2nnzqhrj","jqhna8zy","embq5ctg","1qmw7wqy","773hdzyj","mtm9fq5t","s8fkmnq8","37d07z9m","f7mqjwpm","haw7jkvz","z6qrytv3"],[["./iframe-entry.js"],["./chunks/tree-h19v1jfz.js"],["./chunks/tooltip-fd6g9xy3.js",23],["./chunks/textfield-spy3hc77.js"],["./chunks/toast-4d35zd64.js",24],["./chunks/toast-host-8sjmfed3.js",24],["./chunks/color-fpezvnkt.js",25],["./chunks/icons-p44xhjf0.js"],["./chunks/number-field-gw7sq8rn.js"],["./chunks/action-group-2mqby73c.js"],["./chunks/popover-8htra4er.js",23],["./chunks/select-n3v7gwas.js"],["./chunks/split-pff8f3ze.js"],["./chunks/swatch-group-8qh9a3bm.js"],["./chunks/tabs-jwthg40w.js"],["./chunks/toolbar-2nnzqhrj.js"],["./chunks/color-area-jqhna8zy.js",25],["./chunks/color-field-embq5ctg.js",25,23],["./chunks/color-slider-1qmw7wqy.js",25],["./chunks/combobox-773hdzyj.js",23],["./chunks/dialog-mtm9fq5t.js"],["./chunks/listbox-s8fkmnq8.js"],["./chunks/menu-37d07z9m.js",23],["./chunks/iframe-entry-f7mqjwpm.js"],["./chunks/iframe-entry-haw7jkvz.js"],["./chunks/iframe-entry-z6qrytv3.js"]],0);
2
- function ko(e){let{target:t,source:n,targetOrigin:r,acceptOrigin:o,token:s}=e,i=new Set,a=(c)=>{if(o!=="*"&&c.origin!==o)return;let l=c.data;if(!l||typeof l!=="object"||l["jx:canvas"]!==s)return;for(let u of i)u(l.payload)};return n.addEventListener("message",a),{dispose(){i.clear(),n.removeEventListener("message",a)},onMessage(c){return i.add(c),()=>i.delete(c)},post(c){t.postMessage({["jx:canvas"]:s,payload:c},r)}}}function oe(e){return e.getBoundingClientRect()}function To(e){return e.getBoundingClientRect()}function Ao(e,t,n=document){return n.elementFromPoint(e,t)}function se(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function De(e){return se(e)&&typeof e.$ref==="string"}function ft(e){return se(e)&&e.$prototype==="Function"}function Ke(e){return se(e)&&se(e.$expression)}function Co(e){return Ke(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Fn(e){return ft(e)&&Array.isArray(e.body)}function Wn(e){return se(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function Bn(e){return se(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function Kt(e){return se(e)&&e.$prototype==="Array"}function le(e){return typeof e==="string"&&e.includes("${")}function Kn(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function Po(e){return De(e)||ft(e)||Ke(e)}function Ro(e){if(!e)return[];return e.map((t)=>typeof t==="string"?t:t.name)}function Vn(e){if(!se(e)||!se(e.$expression))return!1;let t=e.$expression;if(t.operator==="?:")return typeof t.value==="string"&&typeof t.initial==="string";if(t.operator==="switch")return se(t.cases)&&Object.values(t.cases).every((n)=>typeof n==="string")&&typeof t.default==="string";return!1}function _a(e){if(typeof e==="string")return[e];if(!Vn(e))return[];let t=e.$expression;if(t.operator==="?:")return[...new Set([t.value,t.initial])];return[...new Set([...Object.values(t.cases),t.default])]}function be(e){return typeof e==="string"?e:_a(e).join("|")}function Vt(e){return e.startsWith("#")}function Un(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return(n)=>(n in t)}var Ut=Object.assign;var Oa=Object.prototype.hasOwnProperty,qt=(e,t)=>Oa.call(e,t),Ve=Array.isArray,dt=(e)=>No(e)==="[object Map]";var $o=(e)=>typeof e==="function",Da=(e)=>typeof e==="string",Ue=(e)=>typeof e==="symbol",qe=(e)=>e!==null&&typeof e==="object";var La=Object.prototype.toString,No=(e)=>La.call(e),Mo=(e)=>No(e).slice(8,-1);var zt=(e)=>Da(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var Gt=(e)=>{let t=Object.create(null);return(n)=>t[n]||(t[n]=e(n))},Ia=/-\w/g,wf=Gt((e)=>e.replace(Ia,(t)=>t.slice(1).toUpperCase())),Ja=/\B([A-Z])/g,Ef=Gt((e)=>e.replace(Ja,"-$1").toLowerCase()),_o=Gt((e)=>e.charAt(0).toUpperCase()+e.slice(1)),vf=Gt((e)=>e?`on${_o(e)}`:""),we=(e,t)=>!Object.is(e,t);var ja="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Sf=Un(ja+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var z;class Lo{constructor(e=!1){if(this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&z)if(z.active)this.parent=z,this.index=(z.scopes||(z.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let r=this.scopes.slice();for(e=0,t=r.length;e<t;e++)r[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}}run(e){if(this._active){let t=z;try{return z=this,e()}finally{z=t}}}on(){if(++this._on===1)this.prevScope=z,z=this}off(){if(this._on>0&&--this._on===0){if(z===this)z=this.prevScope;else{let e=z;while(e){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();this.effects.length=0;for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let r=this.parent.scopes.pop();if(r&&r!==this)this.parent.scopes[this.index]=r,r.index=this.index}this.parent=void 0}}}function Ge(e){return new Lo(e)}function Qt(e,t=!1){if(z)z.cleanups.push(e)}var H;var qn=new WeakSet;class Zt{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,z)if(z.active)z.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,qn.has(this))qn.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))Jo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Oo(this),jo(this);let e=H,t=ce;H=this,ce=!0;try{return this.fn()}finally{Ho(this),H=e,ce=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)rr(e);this.deps=this.depsTail=void 0,Oo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)qn.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(Yn(this))this.run()}get dirty(){return Yn(this)}}var Io=0,mt,ht;function Jo(e,t=!1){if(e.flags|=8,t){e.next=ht,ht=e;return}e.next=mt,mt=e}function tr(){Io++}function nr(){if(--Io>0)return;if(ht){let t=ht;ht=void 0;while(t){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;while(mt){let t=mt;mt=void 0;while(t){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){if(!e)e=r}t=n}}if(e)throw e}function jo(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ho(e){let t,n=e.depsTail,r=n;while(r){let o=r.prevDep;if(r.version===-1){if(r===n)n=o;rr(r),Ha(r)}else t=r;r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Yn(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Fo(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function Fo(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===gt)return;if(e.globalVersion=gt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Yn(e)))return;e.flags|=2;let t=e.dep,n=H,r=ce;H=e,ce=!0;try{jo(e);let o=e.fn(e._value);if(t.version===0||we(o,e._value))e.flags|=128,e._value=o,t.version++}catch(o){throw t.version++,o}finally{H=n,ce=r,Ho(e),e.flags&=-3}}function rr(e,t=!1){let{dep:n,prevSub:r,nextSub:o}=e;if(r)r.nextSub=o,e.prevSub=void 0;if(o)o.prevSub=r,e.nextSub=void 0;if(n.subs===e){if(n.subs=r,!r&&n.computed){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)rr(s,!0)}}if(!t&&!--n.sc&&n.map)n.map.delete(n.key)}function Ha(e){let{prevDep:t,nextDep:n}=e;if(t)t.nextDep=n,e.prevDep=void 0;if(n)n.prevDep=t,e.nextDep=void 0}function G(e,t){if(e.effect instanceof Zt)e=e.effect.fn;let n=new Zt(e);if(t)Ut(n,t);try{n.run()}catch(o){throw n.stop(),o}let r=n.run.bind(n);return r.effect=n,r}var ce=!0,Wo=[];function en(){Wo.push(ce),ce=!1}function tn(){let e=Wo.pop();ce=e===void 0?!0:e}function nn(e,t=!1){if(H instanceof Zt)H.cleanup=e}function Oo(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=H;H=void 0;try{t()}finally{H=n}}}var gt=0;class Bo{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class rn{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!H||!ce||H===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==H){if(t=this.activeLink=new Bo(H,this),!H.deps)H.deps=H.depsTail=t;else t.prevDep=H.depsTail,H.depsTail.nextDep=t,H.depsTail=t;Ko(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let n=t.nextDep;if(n.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=n;if(t.prevDep=H.depsTail,t.nextDep=void 0,H.depsTail.nextDep=t,H.depsTail=t,H.deps===t)H.deps=n}}return t}trigger(e){this.version++,gt++,this.notify(e)}notify(e){tr();try{for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{nr()}}}function Ko(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Ko(r)}let n=e.dep.subs;if(n!==e){if(e.prevSub=n,n)n.nextSub=e}e.dep.subs=e}}var Xn=new WeakMap,Le=Symbol(""),Zn=Symbol(""),xt=Symbol("");function Q(e,t,n){if(ce&&H){let r=Xn.get(e);if(!r)Xn.set(e,r=new Map);let o=r.get(n);if(!o)r.set(n,o=new rn),o.map=r,o.key=n;o.track()}}function Ce(e,t,n,r,o,s){let i=Xn.get(e);if(!i){gt++;return}let a=(c)=>{if(c)c.trigger()};if(tr(),t==="clear")i.forEach(a);else{let c=Ve(e),l=c&&zt(n);if(c&&n==="length"){let u=Number(r);i.forEach((f,d)=>{if(d==="length"||d===xt||!Ue(d)&&d>=u)a(f)})}else{if(n!==void 0||i.has(void 0))a(i.get(n));if(l)a(i.get(xt));switch(t){case"add":if(!c){if(a(i.get(Le)),dt(e))a(i.get(Zn))}else if(l)a(i.get("length"));break;case"delete":if(!c){if(a(i.get(Le)),dt(e))a(i.get(Zn))}break;case"set":if(dt(e))a(i.get(Le));break}}}nr()}function ze(e){let t=j(e);if(t===e)return t;if(Q(t,"iterate",xt),Re(e))return t;if(!ve(e))return t.map(ge);return yt(e)?t.map((n)=>Ie(ge(n))):t.map(Ie)}function or(e){return Q(e=j(e),"iterate",xt),e}function he(e,t){if(ve(e))return yt(e)?Ie(ge(t)):Ie(t);return ge(t)}var Fa={__proto__:null,[Symbol.iterator](){return zn(this,Symbol.iterator,(e)=>he(this,e))},concat(...e){return ze(this).concat(...e.map((t)=>Ve(t)?ze(t):t))},entries(){return zn(this,"entries",(e)=>(e[1]=he(this,e[1]),e))},every(e,t){return Ee(this,"every",e,t,void 0,arguments)},filter(e,t){return Ee(this,"filter",e,t,(n)=>n.map((r)=>he(this,r)),arguments)},find(e,t){return Ee(this,"find",e,t,(n)=>he(this,n),arguments)},findIndex(e,t){return Ee(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ee(this,"findLast",e,t,(n)=>he(this,n),arguments)},findLastIndex(e,t){return Ee(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ee(this,"forEach",e,t,void 0,arguments)},includes(...e){return Gn(this,"includes",e)},indexOf(...e){return Gn(this,"indexOf",e)},join(e){return ze(this).join(e)},lastIndexOf(...e){return Gn(this,"lastIndexOf",e)},map(e,t){return Ee(this,"map",e,t,void 0,arguments)},pop(){return pt(this,"pop")},push(...e){return pt(this,"push",e)},reduce(e,...t){return Do(this,"reduce",e,t)},reduceRight(e,...t){return Do(this,"reduceRight",e,t)},shift(){return pt(this,"shift")},some(e,t){return Ee(this,"some",e,t,void 0,arguments)},splice(...e){return pt(this,"splice",e)},toReversed(){return ze(this).toReversed()},toSorted(e){return ze(this).toSorted(e)},toSpliced(...e){return ze(this).toSpliced(...e)},unshift(...e){return pt(this,"unshift",e)},values(){return zn(this,"values",(e)=>he(this,e))}};function zn(e,t,n){let r=or(e),o=r[t]();if(r!==e&&!Re(e))o._next=o.next,o.next=()=>{let s=o._next();if(!s.done)s.value=n(s.value);return s};return o}var Wa=Array.prototype;function Ee(e,t,n,r,o,s){let i=or(e),a=i!==e&&!Re(e),c=i[t];if(c!==Wa[t]){let f=c.apply(e,s);return a?ge(f):f}let l=n;if(i!==e){if(a)l=function(f,d){return n.call(this,he(e,f),d,e)};else if(n.length>2)l=function(f,d){return n.call(this,f,d,e)}}let u=c.call(i,l,r);return a&&o?o(u):u}function Do(e,t,n,r){let o=or(e),s=o!==e&&!Re(e),i=n,a=!1;if(o!==e){if(s)a=r.length===0,i=function(l,u,f){if(a)a=!1,l=he(e,l);return n.call(this,l,he(e,u),f,e)};else if(n.length>3)i=function(l,u,f){return n.call(this,l,u,f,e)}}let c=o[t](i,...r);return a?he(e,c):c}function Gn(e,t,n){let r=j(e);Q(r,"iterate",xt);let o=r[t](...n);if((o===-1||o===!1)&&tl(n[0]))return n[0]=j(n[0]),r[t](...n);return o}function pt(e,t,n=[]){en(),tr();let r=j(e)[t].apply(e,n);return nr(),tn(),r}var Ba=Un("__proto__,__v_isRef,__isVue"),Vo=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Ue));function Ka(e){if(!Ue(e))e=String(e);let t=j(this);return Q(t,"has",e),t.hasOwnProperty(e)}class sr{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t==="__v_skip")return e.__v_skip;let r=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!r;else if(t==="__v_isReadonly")return r;else if(t==="__v_isShallow")return o;else if(t==="__v_raw"){if(n===(r?o?Qa:Go:o?zo:qo).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n))return e;return}let s=Ve(e);if(!r){let a;if(s&&(a=Fa[t]))return a;if(t==="hasOwnProperty")return Ka}let i=Reflect.get(e,t,Pe(e)?e:n);if(Ue(t)?Vo.has(t):Ba(t))return i;if(!r)Q(e,"get",t);if(o)return i;if(Pe(i)){let a=s&&zt(t)?i:i.value;return r&&qe(a)?er(a):a}if(qe(i))return r?er(i):on(i);return i}}class ir extends sr{constructor(e=!1){super(!1,e)}set(e,t,n,r){let o=e[t],s=Ve(e)&&zt(t);if(!this._isShallow){let c=ve(o);if(!Re(n)&&!ve(n))o=j(o),n=j(n);if(!s&&Pe(o)&&!Pe(n))if(c)return!0;else return o.value=n,!0}let i=s?Number(t)<e.length:qt(e,t),a=Reflect.set(e,t,n,Pe(e)?e:r);if(e===j(r)&&a){if(!i)Ce(e,"add",t,n);else if(we(n,o))Ce(e,"set",t,n,o)}return a}deleteProperty(e,t){let n=qt(e,t),r=e[t],o=Reflect.deleteProperty(e,t);if(o&&n)Ce(e,"delete",t,void 0,r);return o}has(e,t){let n=Reflect.has(e,t);if(!Ue(t)||!Vo.has(t))Q(e,"has",t);return n}ownKeys(e){return Q(e,"iterate",Ve(e)?"length":Le),Reflect.ownKeys(e)}}class Uo extends sr{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}var Va=new ir,Ua=new Uo,qa=new ir(!0);var Qn=(e)=>e,Yt=(e)=>Reflect.getPrototypeOf(e);function za(e,t,n){return function(...r){let o=this.__v_raw,s=j(o),i=dt(s),a=e==="entries"||e===Symbol.iterator&&i,c=e==="keys"&&i,l=o[e](...r),u=n?Qn:t?Ie:ge;return!t&&Q(s,"iterate",c?Zn:Le),Ut(Object.create(l),{next(){let{value:f,done:d}=l.next();return d?{value:f,done:d}:{value:a?[u(f[0]),u(f[1])]:u(f),done:d}}})}}function Xt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ga(e,t){let n={get(o){let s=this.__v_raw,i=j(s),a=j(o);if(!e){if(we(o,a))Q(i,"get",o);Q(i,"get",a)}let{has:c}=Yt(i),l=t?Qn:e?Ie:ge;if(c.call(i,o))return l(s.get(o));else if(c.call(i,a))return l(s.get(a));else if(s!==i)s.get(o)},get size(){let o=this.__v_raw;return!e&&Q(j(o),"iterate",Le),o.size},has(o){let s=this.__v_raw,i=j(s),a=j(o);if(!e){if(we(o,a))Q(i,"has",o);Q(i,"has",a)}return o===a?s.has(o):s.has(o)||s.has(a)},forEach(o,s){let i=this,a=i.__v_raw,c=j(a),l=t?Qn:e?Ie:ge;return!e&&Q(c,"iterate",Le),a.forEach((u,f)=>o.call(s,l(u),l(f),i))}};return Ut(n,e?{add:Xt("add"),set:Xt("set"),delete:Xt("delete"),clear:Xt("clear")}:{add(o){let s=j(this),i=Yt(s),a=j(o),c=!t&&!Re(o)&&!ve(o)?a:o;if(!(i.has.call(s,c)||we(o,c)&&i.has.call(s,o)||we(a,c)&&i.has.call(s,a)))s.add(c),Ce(s,"add",c,c);return this},set(o,s){if(!t&&!Re(s)&&!ve(s))s=j(s);let i=j(this),{has:a,get:c}=Yt(i),l=a.call(i,o);if(!l)o=j(o),l=a.call(i,o);let u=c.call(i,o);if(i.set(o,s),!l)Ce(i,"add",o,s);else if(we(s,u))Ce(i,"set",o,s,u);return this},delete(o){let s=j(this),{has:i,get:a}=Yt(s),c=i.call(s,o);if(!c)o=j(o),c=i.call(s,o);let l=a?a.call(s,o):void 0,u=s.delete(o);if(c)Ce(s,"delete",o,void 0,l);return u},clear(){let o=j(this),s=o.size!==0,i=void 0,a=o.clear();if(s)Ce(o,"clear",void 0,void 0,void 0);return a}}),["keys","values","entries",Symbol.iterator].forEach((o)=>{n[o]=za(o,e,t)}),n}function ar(e,t){let n=Ga(e,t);return(r,o,s)=>{if(o==="__v_isReactive")return!e;else if(o==="__v_isReadonly")return e;else if(o==="__v_raw")return r;return Reflect.get(qt(n,o)&&o in r?n:r,o,s)}}var Ya={get:ar(!1,!1)},Xa={get:ar(!1,!0)},Za={get:ar(!0,!1)};var qo=new WeakMap,zo=new WeakMap,Go=new WeakMap,Qa=new WeakMap;function el(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function on(e){if(ve(e))return e;return lr(e,!1,Va,Ya,qo)}function Yo(e){return lr(e,!1,qa,Xa,zo)}function er(e){return lr(e,!0,Ua,Za,Go)}function lr(e,t,n,r,o){if(!qe(e))return e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let s=o.get(e);if(s)return s;let i=el(Mo(e));if(i===0)return e;let a=new Proxy(e,i===2?r:n);return o.set(e,a),a}function yt(e){if(ve(e))return yt(e.__v_raw);return!!(e&&e.__v_isReactive)}function ve(e){return!!(e&&e.__v_isReadonly)}function Re(e){return!!(e&&e.__v_isShallow)}function tl(e){return e?!!e.__v_raw:!1}function j(e){let t=e&&e.__v_raw;return t?j(t):e}var ge=(e)=>qe(e)?on(e):e,Ie=(e)=>qe(e)?er(e):e;function Pe(e){return e?e.__v_isRef===!0:!1}function ue(e){return nl(e,!1)}function nl(e,t){if(Pe(e))return e;return new Xo(e,t)}class Xo{constructor(e,t){this.dep=new rn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:j(e),this._value=t?e:ge(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Re(e)||ve(e);if(e=n?e:j(e),we(e,t))this._rawValue=e,this._value=n?e:ge(e),this.dep.trigger()}}class Zo{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new rn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=gt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&H!==this)return Jo(this,!0),!0}get value(){let e=this.dep.track();if(Fo(this),e)e.version=this.dep.version;return this._value}set value(e){if(this.setter)this.setter(e)}}function bt(e,t,n=!1){let r,o;if($o(e))r=e;else r=e.get,o=e.set;return new Zo(r,o,n)}function sn(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}var rl=new Set(["all","print","screen","speech"]);function Qo(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let n=e.slice(2,-1).trim();return rl.has(n.toLowerCase())?n:e.slice(1)}return null}function wt(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function vt(e){return e.startsWith("@keyframes")}function es(e,t){let n=[];for(let r of cr(e))for(let o of cr(t))n.push(ol(r,o));return n.join(", ")}function ol(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function cr(e){let t=[],n=0,r=null,o=0;for(let i=0;i<e.length;i+=1){let a=e[i];if(r){if(a==="\\")i+=1;else if(a===r)r=null;continue}if(a==='"'||a==="'")r=a;else if(a==="("||a==="[")n+=1;else if(a===")"||a==="]")n=Math.max(0,n-1);else if(a===","&&n===0)t.push(e.slice(o,i)),o=i+1}t.push(e.slice(o));let s=t.map((i)=>i.trim()).filter((i)=>i!=="");return s.length>0?s:[e]}var sl=/[\s>+~,()]/,il=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function al(e,t){let n="",r=0;for(;;){let o=e.indexOf("[open]",r);if(o===-1)return n+e.slice(r);let s=o;while(s>0&&!sl.test(e[s-1]))s-=1;let i=il.exec(e.slice(s,o))?.[0]?.toLowerCase(),a=i===void 0?t.dialog===!0:i==="dialog";n+=e.slice(r,o)+(a?"[data-jx-dialog-open]":"[open]"),r=o+6}}function ur(e,t={}){if(e.includes("::backdrop"))return null;let n=e.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return al(n,t)}var $e="data-color-scheme";function an(e){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1]??null}function ts(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${$e}]))`,forced:`${e}:where([${$e}="${t}"])`};return{auto:`:where(:root:not([${$e}])) ${e}`,forced:`:where(:root[${$e}="${t}"]) ${e}`}}function St(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function fr(e){return e.startsWith("--")?e:sn(e)}function Et(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function ns(e,t,n){let r=n.map(([s,i])=>`${s}: ${i}`).join("; "),o=t===null?r:`${t} { ${r} }`;for(let s=e.length-1;s>=0;s-=1)o=`${e[s]} { ${o} }`;return o}function ll(e,t,n){let r=n.map(({selector:s,declarations:i})=>`${s} { ${i.map(([a,c])=>`${a}: ${c}`).join("; ")} }`).join(" "),o=`@keyframes ${t} { ${r} }`;for(let s=e.length-1;s>=0;s-=1)o=`${e[s]} { ${o} }`;return o}function cl(e){let t=Object.keys(e).filter((r)=>vt(r));if(t.length===0)return e;let n={...e};for(let r of t)delete n[r];return n}function ul(e){let t=e.startsWith("&")?e.slice(1):e;return t===""||t.startsWith(":")||t.startsWith(".")||t.startsWith("[")}function kt(e,t={}){let{scope:n=null,mediaQueries:r={},transposeValue:o=(h)=>h,transposeSelector:s=(h)=>h,resolveValue:i}=t,a=[],c=(h)=>h!==null&&typeof h==="object"&&!Array.isArray(h)&&!De(h),l=(h,x)=>{if(c(x))return[x];if(!wt(h)||!Array.isArray(x)||x.length===0)return[];return x.every((S)=>c(S))?x:[]},u=(h,x,S,A)=>{if(x===void 0||x===null)return null;if(De(x))return S?i?.(h,x,A)??null:null;if(typeof x==="object")return null;let C=String(x);if(le(C))return S?i?.(h,C,A)??null:null;return o(C)},f=(h,x,S=!0,A="self")=>{let C=[];for(let[T,g]of Object.entries(h)){if(l(T,g).length>0)continue;if(x&&(T.startsWith("@")||St(T)))continue;if(T.startsWith("$"))continue;let v=u(T,g,S,A);if(v!==null)C.push([fr(T),v])}return C},d=(h,x,S,A,C)=>{if(S.length===0)return;let T=x;if(T!==null){let v=s(T);if(v===null)return;T=v}let g=ns(h,T,S);a.push({text:g,conditions:[...h],selector:T,declarations:S,target:A,key:Et(g),...typeof C==="string"&&C!==""?{description:C}:{}})},m=(h,x,S)=>{let A=h.slice(10).trim();if(A==="")return;let C=[];for(let[g,v]of Object.entries(x)){if(!c(v))continue;let P=f(v,!0,!1,"unscoped");if(P.length>0)C.push({declarations:P,selector:g.trim()})}if(C.length===0)return;let T=ll(S,A,C);a.push({blocks:C,conditions:[...S],declarations:[],key:Et(T),selector:null,target:"unscoped",text:T})},w=(h,x,S,A,C)=>{if(h==="@--")return;if(wt(h)){d([...A,h],null,f(x,!1,!0,"unscoped"),"unscoped",x.$description);return}if(vt(h)){m(h,x,A);return}let T=Qo(h,r),g=T===null?h:`@media ${T}`,v=T===null?null:an(T);if(v!==null&&S!==null){let{auto:P,forced:E}=ts(S,v);y(x,P,[...A,g],C),y(cl(x),E,A,C);return}y(x,S,[...A,g],C)};function y(h,x,S,A){d(S,x,f(h,!0,!0,A),A,h.$description);for(let[C,T]of Object.entries(h))for(let g of l(C,T))if(C.startsWith("@"))w(C,g,x,S,A);else if(x!==null)y(g,es(x,C),S,ul(C)?A:"descendant")}return y(e,n,[],"self"),a}var Se="en-US",rs="UTC",os=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],ss=os.map((e)=>e.path),is=Object.fromEntries(os.map((e)=>[e.path,e.params.indexOf("locale")]));function fl(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function dr(e){if(e==="")return[];return e.split("/").map((t)=>fl(t))}function fe(e,t){let n=e;for(let r of dr(t))n=n?.[r];return n}function pr(e){let t=e.$map;return t&&typeof t==="object"?t:void 0}var ls=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),cs=new Set(["!","-"]),us=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),dl=new Set(["=","+=","-=","*=","/="]),pl=new Set(["push","pop","shift","unshift","splice"]),fs=new Set(["reduce","map","filter"]),ds=new Set(["?:","switch"]),ps=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),ml=new Set([...ls,...cs,...us,...fs,...ds,...ps,"call"]),hl=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...ss]),gl={"Intl/compare":(e,t,n,r)=>new Intl.Collator(n??Se,r).compare(e,t),"Intl/displayName":(e,t,n,r)=>new Intl.DisplayNames(n??Se,{...r,type:t??"language"}).of(e),"Intl/formatDate":(e,t,n)=>new Intl.DateTimeFormat(t??Se,{timeZone:rs,...n}).format(new Date(e)),"Intl/formatList":(e,t,n)=>new Intl.ListFormat(t??Se,n).format(e),"Intl/formatNumber":(e,t,n)=>new Intl.NumberFormat(t??Se,n).format(e),"Intl/formatRelativeTime":(e,t,n,r)=>new Intl.RelativeTimeFormat(n??Se,r).format(e,t),"Intl/plural":(e,t,n)=>new Intl.PluralRules(t??Se,n).select(e),"Intl/segment":(e,t,n)=>[...new Intl.Segmenter(n??Se,{granularity:t??"grapheme"}).segment(e)].map((r)=>r.segment)};function xl(e,t,n){let r=is[e];if(r===void 0||r<0||t[r]!=null)return t;let s=n.$page?.locale;if(typeof s!=="string"||s==="")return t;let i=[...t];return i[r]=s,i}function yl(e){return e.startsWith("window#/")&&hl.has(e.slice(8))}function ms(e){return ls.has(e)}var as=64,bl=64;function K(e,t){if(!e)return;let n=(e.depth??0)+1;if(n>bl)return;return{depth:n,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function W(e,t,n,r,o){if(e===null||e===void 0)return e;if(typeof e==="object"&&!Array.isArray(e)&&"operator"in e)return ee(e,t,n,r,o);if(typeof e==="object"&&!Array.isArray(e)&&"$ref"in e){let s=ln(e.$ref,t,n,r);return o?.report(o.path??[],s),s}if(Array.isArray(e))return e.map((s,i)=>W(s,t,n,r,K(o,i)));return o?.report(o.path??[],e),e}function wl(e,t,n,r){let o=(s)=>{if(!e.slice(s.length).includes("/"))return t;return ln(e.slice(0,e.lastIndexOf("/")),t,n,r)};if(e.startsWith("#/state/"))return o("#/state/");if(e.startsWith("parent#/"))return o("parent#/");if(e.startsWith("$map/")||e.startsWith("$args/"))return e.split("/").length>2?ln(e.slice(0,e.lastIndexOf("/")),t,n,r):void 0;return}function ln(e,t,n,r){if(e==="$reduce/acc")return r?.acc;if(e.startsWith("$reduce/"))return r?.acc;if(e.startsWith("$args/")){let o=e.slice(6).split("/"),s=r?.args?.[o[0]];return o.length>1?Ne(s,o.slice(1).join("/")):s}if(e.startsWith("event#/")){let o=e.slice(7);return Ne(n,o)}if(e.startsWith("$map/")){let o=e.split("/"),[,s]=o,i,a=pr(t);if(s==="item")i=r?.item??a?.item??t["$map/item"];else if(s==="index")i=r?.index??a?.index??t["$map/index"];else i=a?.[s]??t[`$map/${s}`];return o.length>2?Ne(i,o.slice(2).join("/")):i}if(e.startsWith("#/state/"))return fe(t,e.slice(8));if(e.startsWith("parent#/"))return fe(t,e.slice(8));if(e.startsWith("window#/"))return Ne(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return Ne(globalThis.document,e.slice(10));return fe(t,e)??null}function El(e,t,n,r){if(e.startsWith("$map/")){let o=e.split("/"),[,s]=o,i,a=pr(t);if(s==="item")i=r?.item??a?.item??t["$map/item"];else if(s==="index")i=r?.index??a?.index??t["$map/index"];else i=a?.[s]??t[`$map/${s}`];if(o.length>2){let c=o.slice(2),l=c.pop(),u=c.length>0?Ne(i,c.join("/")):i;return{key:l,obj:u}}return{key:s==="item"?"$map/item":"$map/index",obj:pr(t)??t}}if(e.startsWith("#/state/")){let o=e.slice(8);if(o.indexOf("/")===-1)return{key:o,obj:t};let i=dr(o),a=i.pop(),c=t;for(let l of i)c=c[l];return{key:a,obj:c}}return{key:e,obj:t}}function ee(e,t,n,r,o){let s=vl(e,t,n,r,o);return o?.report(o.path??[],s),s}function vl(e,t,n,r,o){let{operator:s,target:i,value:a,initial:c}=e;if(!ml.has(s))throw Error(`$expression: unknown operator "${s}"`);if(cs.has(s)&&!("value"in e)){let l=W(i,t,n,r,K(o,"target"));if(s==="!")return!l;if(s==="-")return-l}if(s==="call"){let l=i?.$ref;if(typeof l!=="string")throw TypeError("$expression: call target must be a $ref pointer");let u=(r?.callDepth??0)+1;if(u>as)throw Error(`$expression: call depth exceeded (${as})`);let f=Array.isArray(a)?a.map((m,w)=>W(m,t,n,r,K(o,["value",w]))):[];if(l.startsWith("window#/")){if(!yl(l))throw Error(`$expression: "${l}" is not a blessed pure global`);let m=l.slice(8),w=gl[m];if(w)return w(...xl(m,f,t));let y=Ne(globalThis.window,m),h=m.lastIndexOf("/"),x=h===-1?globalThis.window:Ne(globalThis.window,m.slice(0,h));return y.apply(x,f)}let d=ln(l,t,n,r);if(typeof d==="function")return d.apply(wl(l,t,n,r),f);if(d&&typeof d==="object"&&"$expression"in d){let m=d,w={};for(let[y,h]of(m.parameters??[]).entries()){let x=typeof h==="string"?h:h?.name??"";if(!x)continue;w[x]=f[y]===void 0&&typeof h==="object"&&h!==null&&"default"in h?h.default:f[y]}return ee(m.$expression,t,n,{args:w,callDepth:u})}throw TypeError(`$expression: call target "${l}" is not callable`)}if(ds.has(s)){if(s==="?:"){let m=W(i,t,n,r,K(o,"target"));if(o){let w=W(a,t,n,r,K(o,"value")),y=W(c,t,n,r,K(o,"initial"));return m?w:y}return m?W(a,t,n,r):W(c,t,n,r)}let l=W(i,t,n,r,K(o,"target")),u=String(l),f=e.cases??{},d=Object.hasOwn(f,u);if(o){let m;for(let[y,h]of Object.entries(f)){let x=W(h,t,n,r,K(o,["cases",y]));if(y===u)m=x}let w=W(e.default,t,n,r,K(o,"default"));return d?m:w}return d?W(f[u],t,n,r):W(e.default,t,n,r)}if(us.has(s)){let l=W(i,t,n,r,K(o,"target")),u=W(a,t,n,r,K(o,"value"));switch(s){case"+":return l+u;case"-":return l-u;case"*":return l*u;case"/":return l/u;case"%":return l%u;case"===":return l===u;case"!==":return l!==u;case"<":return l<u;case"<=":return l<=u;case">":return l>u;case">=":return l>=u;case"&&":return l&&u;case"||":return l||u;case"??":return l??u;default:break}}if(dl.has(s)){let l=W(a,t,n,r,K(o,"value")),{obj:u,key:f}=El(i.$ref,t,n,r);switch(s){case"=":{u[f]=l;break}case"+=":{let d=u[f];u[f]=d+l;break}case"-=":{let d=u[f];u[f]=d-l;break}case"*=":{let d=u[f];u[f]=d*l;break}case"/=":{let d=u[f];u[f]=d/l;break}default:break}return}if(pl.has(s)){let l=W(i,t,n,r,K(o,"target"));switch(s){case"push":return l.push(W(a,t,n,r,K(o,"value")));case"unshift":return l.unshift(W(a,t,n,r,K(o,"value")));case"pop":return l.pop();case"shift":return l.shift();case"splice":{let u=W(a,t,n,r,K(o,"value"));return l.splice(...u)}default:break}}if(ps.has(s)){let l=W(i,t,n,r,K(o,"target")),u=a===void 0?[]:Array.isArray(a)?W(a,t,n,r,K(o,"value")):[W(a,t,n,r,K(o,"value"))],f=l?.[s];if(typeof f!=="function")return;return f.apply(l,u)}if(fs.has(s)){let l=W(i,t,n,r,K(o,"target"));if(s==="reduce"){let u=W(c,t,n,r,K(o,"initial"));for(let[f,d]of l.entries())u=ee(a,t,n,{acc:u,index:f,item:d},f===0?K(o,"value"):void 0);return u}if(s==="map")return l.map((u,f)=>ee(a,t,n,{...r,index:f,item:u},f===0?K(o,"value"):void 0));if(s==="filter")return l.filter((u,f)=>ee(a,t,n,{...r,index:f,item:u},f===0?K(o,"value"):void 0))}return}function Ne(e,t){return fe(e,t)}function Je(e,t,n,r){return W(e,t,n,r)}function cn(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function hs(e){let t=cn(e);return t.startsWith("/")?t:`/${t}`}function gs(e,t){return[...e].toSorted((n,r)=>r[t].length-n[t].length)}function Sl(e,t){return e===t||e.startsWith(`${t}/`)}function xs(e,t){let n=cn(t);for(let r of gs(e,"dir")){let o=cn(r.dir);if(!Sl(n,o)||n===o)continue;let s=n.slice(o.length+1),{filter:i}=r;if(i&&!i(s))return null;let a=s.split("/").map((c)=>encodeURIComponent(c)).join("/");return`${hs(r.urlPrefix)}/${a}`}return null}function kl(e,t){let n=t.split("#")[0].split("?")[0];if(!n.startsWith("/"))return null;let r;try{r=decodeURIComponent(n)}catch{return null}if(/%2e|%2f/i.test(r))return null;for(let o of gs(e,"urlPrefix")){let s=hs(o.urlPrefix);if(!r.startsWith(`${s}/`))continue;let a=r.slice(s.length+1).split("/");if(a.some((l)=>l===""||l==="."||l===".."))return null;let{filter:c}=o;if(c&&!c(a.join("/")))return null;return`${cn(o.dir)}/${a.join("/")}`}return null}var Ff=String.raw`"'\s<>()\\`;var Tl="public";function Tt(e){let t=e.search(/[#?]/);return t===-1?{path:e,suffix:""}:{path:e.slice(0,t),suffix:e.slice(t)}}function mr(e){return e===""||e.startsWith("/")||e.startsWith("#")||e.includes("${")||/^[a-z][\w+.-]*:/i.test(e)}function hr(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function gr(e,t){let r=(e===""||e==="."?[]:hr(e).split("/")).filter((o)=>o!==""&&o!==".");for(let o of t.replaceAll("\\","/").split("/")){if(o===""||o===".")continue;if(o===".."){if(r.length===0)return null;r.pop();continue}r.push(o)}return r.join("/")}function Al(e,t,n){let{path:r}=Tt(e);if(!r.startsWith("/"))return[];let o;try{o=decodeURIComponent(r)}catch{return[]}if(/%2e|%2f/i.test(o))return[];let s=o.replace(/^\/+/,"");if(s===""||s.split("/").some((a)=>a==="."||a===".."))return[];let i=[];for(let a of n){if(a==="mounts"){let c=kl(t,r);if(c!==null&&!c.startsWith("/")&&!/^[A-Za-z]:/.test(c))i.push(hr(c));continue}i.push(a==="root"?s:`${Tl}/${s}`)}return[...new Set(i)]}function ys(e,t,n,r){let{path:o}=Tt(e);if(o==="")return null;if(mr(e))return o.startsWith("/")?Al(o,n,r)[0]??null:null;if(o.endsWith("/"))return null;let s;try{s=decodeURIComponent(o)}catch{return null}let i=gr(t,s);if(i===null||i===""||i===hr(t))return null;return i}function bs(e){return e.split("/").map((t)=>encodeURIComponent(t)).join("/")}function ws(e){let t=[],n=0;while(n<e.length){while(n<e.length&&(/\s/.test(e[n])||e[n]===","))n+=1;if(n>=e.length)break;let r=n;while(n<e.length&&!/\s/.test(e[n]))n+=1;let o=e.slice(r,n);if(o.endsWith(",")){t.push({descriptor:"",url:o.replace(/,+$/,"")});continue}while(n<e.length&&/\s/.test(e[n]))n+=1;let s=n;while(n<e.length&&e[n]!==",")n+=1;let i=e.slice(s,n).trim();if(n+=1,o=o.replace(/,+$/,""),o!=="")t.push({descriptor:i,url:o})}return t}function Es(e){return e.map(({url:t,descriptor:n})=>n?`${t} ${n}`:t).join(", ")}function Cl(e){if("operator"in e)return"expression";if("if"in e)return"if";if("$switch"in e)return"switch";if("stopPropagation"in e)return"stopPropagation";if("preventDefault"in e)return"preventDefault";return"dispatch"}async function Ye(e,t,n,r={}){let o=r.args?{args:r.args}:void 0;for(let s of e)switch(Cl(s)){case"expression":{let i=ee(s,t,n,o);if(i&&typeof i.then==="function")await i;break}case"if":{let i=s,a=Je(i.if,t,n,o)?i.then:i.else;if(Array.isArray(a))await Ye(a,t,n,r);break}case"switch":{let i=s,a=String(Je(i.$switch,t,n,o)),c=i.cases??{},l=Object.hasOwn(c,a)?c[a]:i.default;if(Array.isArray(l))await Ye(l,t,n,r);break}case"dispatch":{let i=s,a=typeof r.target==="function"?r.target():r.target,c=n?.currentTarget??a;if(!c)break;let l={};if("detail"in i)l.detail=Je(i.detail,t,n,o);if(i.bubbles!==void 0)l.bubbles=i.bubbles;if(i.composed!==void 0)l.composed=i.composed;c.dispatchEvent(new CustomEvent(i.dispatchEvent,l));break}case"stopPropagation":{n?.stopPropagation();break}case"preventDefault":{n?.preventDefault();break}default:break}}function vs(e,t){for(let n of e.split(";")){let r=n.indexOf("=");if(r===-1)continue;if(n.slice(0,r).trim()===t)return n.slice(r+1)}return null}function Ss(e,t,n){let r=e.startsWith("__Host-"),o=[`${e}=${encodeURIComponent(JSON.stringify(t))}`];if(n.maxAge!==void 0)o.push(`Max-Age=${n.maxAge}`);let s=r?"/":n.path;if(s)o.push(`Path=${s}`);if(n.domain&&!r)o.push(`Domain=${n.domain}`);let{sameSite:i}=n;if(n.secure===!0||r||e.startsWith("__Secure-")||i?.toLowerCase()==="none")o.push("Secure");if(i)o.push(`SameSite=${i}`);return o.join("; ")}var xr=new Map;async function kr(e,t){if(typeof e!=="string")return e;let n=t?.resolver?.(e);if(n)return n;if(xr.has(e))return xr.get(e);let r=fetch(e).then(async(o)=>{if(!o.ok)throw Error(`Jx: failed to fetch ${e} (${o.status})`);if((o.headers?.get("Content-Type")??"").includes("text/html"))throw Error(`Jx: ${e} returned HTML, not a document — the host answered a missing file with its `+"app shell (a single-page fallback), so this path is not served.");return await o.json()});return xr.set(e,r),r}var Pl=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),Ds={skip:!1};function Ls(e){Ds.skip=e}var Is={skip:!1};function Js(e){Is.skip=e}var br=null;function js(e){br=e||null}function Hs(e){return br?`${e}?token=${encodeURIComponent(br)}`:e}function Fs(e){let t=Ge(!0);return t.run(()=>{G(e)}),()=>t.stop()}function xn(e){let t=Ge(!0);try{return{result:t.run(e),stop:()=>t.stop()}}catch(n){throw t.stop(),n}}var Ws=!1;function Bs(e){Ws=e}var Rl=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,$l={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};function Nl(e){if(!Ws||!e.includes("v"))return e;return e.replace(Rl,(t,n,r)=>`${n}${$l[r.toLowerCase()]??`cq${r}`}`)}var Ks=!1;function Vs(e){Ks=e}var Tr=!1;function Us(e){Tr=e}var Ar=!1;function qs(e){Ar=e}var fn=!1;function wr(e){return fn||e.dataset.jxPath!==void 0}function Ml(e,t){if(Ks&&t==="href"&&(e.tagName==="A"||e.tagName==="AREA"))return"data-jx-href";if(Tr&&t==="popover"&&wr(e))return"data-jx-popover";if(Ar&&wr(e)){if(t==="commandfor")return"data-jx-commandfor";if(t==="inert")return"data-jx-inert";if(t==="open"&&e.tagName==="DIALOG")return"data-jx-open"}return t}var Ze=null;function yn(e){Ze=e}var _l=new Set(["src","poster","data"]),Ol=new Set(["srcset","imagesrcset"]),Dl=new Set(["LINK"]);function Ll(e,t){return _l.has(t)||t==="href"&&Dl.has(e)}function Cr(e,t,n){if(!Ze||n==="")return n;let r=t.toLowerCase();if(Ol.has(r)){let o=ws(n),s=!1,i=o.map((a)=>{let c=Ze?.(a.url,r)??null;if(c===null||c===a.url)return a;return s=!0,{descriptor:a.descriptor,url:c}});return s?Es(i):n}if(!Ll(e,r))return n;return Ze(n,r)??n}var Il=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function Jl(e){if(!Ze||!e.includes("url("))return e;return e.replaceAll(Il,(t,n,r)=>{let o=r===""?null:Ze?.(r,"url()")??null;return o===null?t:`url(${n}${o}${n})`})}function dn(e){return Nl(Jl(e))}var zs=!1;function Gs(e){zs=e}var jl=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function Hl(e,t,n){if(!zs||e!=="textContent")return null;let r=null;if(U(t)){if(!t.$ref.startsWith("#/state/"))return null;let s=t.$ref.slice(8);r=s&&!s.includes("/")?s:null}else if(typeof t==="string")r=jl.exec(t)?.[1]??null;if(!r)return null;let o=j(n)[r];if(Pe(o)||typeof o==="function")return null;if(typeof o==="object"&&o!==null)return null;return r}async function bn(e,t={},n=location.href,r){let o=()=>r?.root??null,s={},i=e.state??{},a=yt(t);for(let f of Object.keys(t))if(a&&!(f in i))Object.defineProperty(s,f,{configurable:!0,enumerable:!0,get:()=>t[f],set:(d)=>{t[f]=d}});else s[f]=t[f];let c=e.imports??{};for(let[,f]of Object.entries(i))if(Wn(f)&&!f.$src){let d=c[f.$prototype];if(d){if(!d.endsWith(".class.json")){console.warn(`Jx: import "${f.$prototype}" must map to a .class.json path, got "${d}"`);continue}f.$src=d}}for(let[f,d]of Object.entries(i)){if(typeof d==="string"){if(!d.includes("${"))s[f]=d;continue}if(typeof d==="number"||typeof d==="boolean"||d===null){s[f]=d;continue}if(Array.isArray(d)){s[f]=d;continue}if(typeof d==="object"){if(d.$prototype)continue;if(Ke(d))continue;if(Bn(d))continue;if("default"in d){s[f]=d.default;continue}if(Fl(d))continue;s[f]=d}}let l=on(s);for(let[f,d]of Object.entries(i))if(typeof d==="string"&&d.includes("${"))l[f]=bt(()=>ke(d,l));for(let[f,d]of Object.entries(i))if(Ke(d)){let m=d.$expression;if(Co(d)){let w=d.parameters;l[f]=(...y)=>{let h={};for(let[x,S]of w.entries()){let A=typeof S==="string"?S:S?.name??"";if(!A)continue;h[A]=y[x]===void 0&&typeof S==="object"&&S!==null&&"default"in S?S.default:y[x]}return ee(m,l,null,{args:h})}}else if(ms(m.operator)){let w=(y,h)=>ee(m,y,h);l[f]=w}else l[f]=bt(()=>ee(m,l,null))}for(let[f,d]of Object.entries(i))if(Fn(d)){let{body:m}=d;if(Array.isArray(d.parameters)&&d.parameters.length>0){let w=d.parameters;l[f]=(...y)=>{let h={};for(let[x,S]of w.entries()){let A=typeof S==="string"?S:S?.name??"";if(!A)continue;h[A]=y[x]===void 0&&typeof S==="object"&&S!==null&&"default"in S?S.default:y[x]}return Ye(m,l,null,{args:h,target:o})}}else{let w=(y,h)=>{Ye(m,y,h??null,{target:o})};l[f]=w}}else if(ft(d))l[f]=await Kl(d,l,f,n);for(let[f,d]of Object.entries(i))if(Wn(d))l[f]=await nc(d,l,f,n,r);if(!(r?.skipServerFunctions??Ds.skip)){for(let[f,d]of Object.entries(i))if(Bn(d))l[f]=await ac(d,l,f,n)}let u=r?.media??ii;if(e.$media)l.$media=e.$media;else if(!l.$media&&Object.keys(u).length>0)l.$media=u;return l}function Fl(e){for(let t of Object.keys(e))if(Pl.has(t))return!0;return!1}function ke(e,t){let n=t?.$map;return Function("state","$map","item","index",`return \`${e}\``)(t,n,n?.item,n?.index)}function Wl(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let t=0;for(let n=1;n<e.length;n+=1){let r=e[n];if(r==="{")t+=1;else if(r==="}"){if(t-=1,t===0)return n===e.length-1}}return!1}function Bl(e,t){if(!Wl(e))return ke(e,t);let n=t?.$map;return Function("state","$map","item","index",`return (${e.slice(2,-1)})`)(t,n,n?.item,n?.index)}var et=new Map,Xe=new Map,Ys=new Set;function Xs(e,t){if(Ys.add(e),typeof t==="function"){et.delete(e),Xe.set(e,t);return}Xe.delete(e),et.set(e,t)}function Pr(e){let t=et.get(e);if(t)return t;let n=Xe.get(e);if(!n)return;if(typeof n!=="function")return n;let r=Promise.resolve(n()).then((o)=>(et.set(e,o),Xe.delete(e),o),(o)=>{throw Xe.set(e,n),o});return Xe.set(e,r),r}async function Kl(e,t,n,r){if(e.body&&e.$src)throw Error(`Jx: '${n}' declares both body and $src — these are mutually exclusive`);if(!e.body&&!e.$src){let a=Er(e),c=Function(...a,"");return Object.defineProperty(c,"name",{configurable:!0,value:e.name??n}),c}let o;if(typeof e.body==="string"){let a=Er(e);o=Function(...a,e.body),Object.defineProperty(o,"name",{configurable:!0,value:e.name??n})}else{let a=e.$src;if(!a)throw Error(`Jx: '${n}' has neither body nor $src`);let c=e.$export??n,l,u=Pr(a);if(u instanceof Promise)l=await u;else if(u)l=u;else{if(r){let d=new URL(a,r).href;try{l=await import(d)}catch{l=await import(a)}}else l=await import(a);et.set(a,l)}let f=l[c]??l.default?.[c];if(typeof f!=="function")throw TypeError(`Jx: export "${c}" not found or not a function in "${a}"`);o=f}let s=(e.parameters??e.arguments??[]).length>0,i=!1;if(!s){if(typeof e.body==="string")i=Kn(e.body);else if(o)i=o.length<=1&&Kn(o.toString())}if(i)return bt(()=>o(t));return o}function Er(e){let t=e.parameters?Ro(e.parameters):e.arguments??[];return t.length>0&&t[0]==="state"?t:["state",...t]}var Pt=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]),ks=new Set,Vl="http://www.w3.org/2000/svg",Ul="http://www.w3.org/1998/Math/MathML";function ql(e,t){if(e==="svg")return Vl;if(e==="math")return Ul;return t??null}function de(e,t,n){let r=n?._path??[];if(typeof e==="string"||typeof e==="number"||typeof e==="boolean"){let f=document.createTextNode(String(e));if(typeof e==="string"&&le(e))G(()=>{f.textContent=ke(e,t)});return f}let o=t;for(let[f,d]of Object.entries(e))if(f.startsWith("$")&&!Pt.has(f)){if(o===t)o=Object.create(t);o[f]=U(d)?Y(d.$ref,t):d}if("$ref"in e&&!e.tagName){let f=String(e.$ref??"");if(!ks.has(f))ks.add(f),console.warn(`Jx: a $ref child ("${f}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let s=Nr(e.tagName,o),i=s.includes("-")&&customElements.get(s);if(e.$props&&i)return Os(e,o,n,r);if(e.$props){if(s.includes("-"))return Os(e,o,n,r);let{$props:f,...d}=e;return de(d,dc(e,o),n)}if(e.$switch)return tc(e,o,n);let a=ql(s,n?._ns),c=s==="foreignObject"?null:a,l=a?document.createElementNS(a,s):document.createElement(s);if(n?.onNodeCreated)n.onNodeCreated(l,r,e,o);if(Rr(l,e,o),e.style&&s.includes("-"))$r.set(l,e.style);wn(l,e.style??{},o.$media??{},o),vn(l,e.attributes??{},o);let u=e.children;if(Kt(u)){let f=n||c?{...n,_ns:c,_path:[...r,"children"]}:void 0;vr(l,u,o,f)}else if(Array.isArray(u))for(let f=0;f<u.length;f++){let d=u[f],m=n||c?{...n,_ns:c,_path:[...r,"children",f]}:void 0;if(Kt(d))vr(l,d,o,m);else l.append(de(d,o,m))}return l}function Rr(e,t,n){for(let[r,o]of Object.entries(t)){if(Pt.has(r))continue;if(r.startsWith("$"))continue;if(r.startsWith("on")&&Zs(e,r,o,n))continue;Qs(e,r,o,n)}}function Zs(e,t,n,r){let o=t.slice(2),s=r;if(U(n)){let i=Y(n.$ref,r);if(typeof i==="function"){let a=i;e.addEventListener(o,(c)=>a(s,c))}return!0}if(Fn(n)){let{body:i}=n;return e.addEventListener(o,(a)=>{Ye(i,s,a)}),!0}if(ft(n)&&typeof n.body==="string"){let i=Er(n),a=Function(...i,n.body);return e.addEventListener(o,(c)=>a(s,c)),!0}if(Ke(n)){let i=n.$expression;return e.addEventListener(o,(a)=>ee(i,s,a)),!0}return!1}function zl(e,t,n){for(let[r,o]of Object.entries(t))if(r.startsWith("on")&&!Pt.has(r))Zs(e,r,o,n)}function Qs(e,t,n,r){let o=e,s=Hl(t,n,r);if(s)e.dataset.jxBoundProp=s;let i=(c)=>typeof c==="string"?Cr(e.tagName,t,c):c,a=(c)=>{let l=e;if(t==="className"&&!(l instanceof HTMLElement)){l.setAttribute("class",c==null?"":String(c));return}if(o[t]===c)return;o[t]=c};if(U(n)){let c=n;if(t==="id"){o[t]=Y(c.$ref,r);return}G(()=>{a(i(Y(c.$ref,r)))});return}if(le(n)){G(()=>{a(i(ke(n,r)))});return}a(i(n))}function Ts(e,t){let n=[];return{detach:t,insert(r){let o=[];for(let i of r){let a=e.cssRules.length;try{e.insertRule(i,a)}catch{continue}let c=e.cssRules[a];if(c)o.push(c)}let s={rules:o,texts:r};return n.push(s),s},remove(r){let o=n.indexOf(r);if(o!==-1)n.splice(o,1);if(r.rules.length===0)return;let s=[...e.cssRules],i=r.rules.map((a)=>s.indexOf(a)).filter((a)=>a>=0).toSorted((a,c)=>c-a);for(let a of i)e.deleteRule(a);r.rules.length=0},replaceAll(r){n.length=0,n.push({rules:[],texts:r}),e.replaceSync(r.join(`
3
- `))},text(){return n.flatMap((r)=>r.texts.join(`
1
+ import{e,i,x,t,n,s,r,v,b,j,O,R,D,S,l,c,I,F,Z,W,J,u,w}from"./chunks/iframe-entry-99nr5zfb.js";var Ko,cr,fn,me=(o,a)=>{for(var[d,f,p]of Ko||[])for(var m=[o],g=globalThis,h=g.document,y,E,C,T,A;E=m.pop();)if(!cr[E]&&(C=f[E])){cr[E]=1;for(T=1;T<C.length;T++)m.push(p[C[T]]);if(!a&&E!==o&&(y=h&&h.head)){if(fn===void 0)fn=(T=h.querySelector("meta[property=csp-nonce]"))&&(T.nonce||T.getAttribute("nonce"))||"";if(A=h.createElement("link"),A.rel="modulepreload",A.crossOrigin="",fn)A.nonce=fn;A.href=new g.URL(C[0],d),y.appendChild(A)}}},Vl=(o,a,d,f)=>{for(var p={},m=0;m<a.length;m++)p[a[m]]=d[m];(Ko||=[]).push([o,p,a]),cr||={},me(a[f],1)};Vl(import.meta.url,["djjkmvtm","9xa4hm7n","yypz28gq","wewc8rq2","1gv0h53h","1yg5ar8d","m7r1vk54","63bjtbs7","y62xq0ty","4aan7g6g","b89sfej7","rzds841e","c9zfdgxf","ewh24n1f","f5cw3tgp","44cm5cta","6rbra5dy","gy56c94g","sqqdyf6c","72h32ejk","c4x05vyx","c421cf8c","bdpzbfvs","99nr5zfb","76j8vwwx","pkgmcgp0","2zggzajv"],[["./iframe-entry.js",23],["./chunks/tree-9xa4hm7n.js",23],["./chunks/tooltip-yypz28gq.js",24,23],["./chunks/textfield-wewc8rq2.js"],["./chunks/toast-1gv0h53h.js",25],["./chunks/toast-host-1yg5ar8d.js",25],["./chunks/color-m7r1vk54.js",26],["./chunks/icons-63bjtbs7.js",23],["./chunks/number-field-y62xq0ty.js"],["./chunks/action-group-4aan7g6g.js"],["./chunks/popover-b89sfej7.js",24],["./chunks/select-rzds841e.js"],["./chunks/split-c9zfdgxf.js",23],["./chunks/swatch-group-ewh24n1f.js"],["./chunks/tabs-f5cw3tgp.js"],["./chunks/toolbar-44cm5cta.js"],["./chunks/color-area-6rbra5dy.js",26,23],["./chunks/color-field-gy56c94g.js",26,24,23],["./chunks/color-slider-sqqdyf6c.js",26],["./chunks/combobox-72h32ejk.js",24],["./chunks/dialog-c4x05vyx.js"],["./chunks/listbox-c421cf8c.js",23],["./chunks/menu-bdpzbfvs.js",24,23],["./chunks/iframe-entry-99nr5zfb.js"],["./chunks/iframe-entry-76j8vwwx.js",23],["./chunks/iframe-entry-pkgmcgp0.js"],["./chunks/iframe-entry-2zggzajv.js",23]],0);
2
+ var ur="jx:canvas";function Uo(o){let{target:a,source:d,targetOrigin:f,acceptOrigin:p,token:m}=o,g=new Set,h=(y)=>{if(p!=="*"&&y.origin!==p)return;let E=y.data;if(!n(E)||!(ur in E)||E[ur]!==m)return;let C="payload"in E?E.payload:void 0;for(let T of g)T(C)};return d.addEventListener("message",h),{dispose(){g.clear(),d.removeEventListener("message",h)},onMessage(y){return g.add(y),()=>g.delete(y)},post(y){a.postMessage({[ur]:m,payload:y},f)}}}function Pe(o){return o.getBoundingClientRect()}function qo(o){return o.getBoundingClientRect()}function zo(o,a,d=document){return d.elementFromPoint(o,a)}function dr(o){let a=Object.create(null);for(let d of o.split(","))a[d]=1;return(d)=>(d in a)}var pn=Object.assign;var Wl=Object.prototype.hasOwnProperty,mn=(o,a)=>Wl.call(o,a),ct=Array.isArray,$t=(o)=>Yo(o)==="[object Map]";var Go=(o)=>typeof o==="function",Bl=(o)=>typeof o==="string",ut=(o)=>typeof o==="symbol",dt=(o)=>o!==null&&typeof o==="object";var Kl=Object.prototype.toString,Yo=(o)=>Kl.call(o),Xo=(o)=>Yo(o).slice(8,-1);var hn=(o)=>Bl(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o;var gn=(o)=>{let a=Object.create(null);return(d)=>a[d]||(a[d]=o(d))},Ul=/-\w/g,op=gn((o)=>o.replace(Ul,(a)=>a.slice(1).toUpperCase())),ql=/\B([A-Z])/g,ip=gn((o)=>o.replace(ql,"-$1").toLowerCase()),Zo=gn((o)=>o.charAt(0).toUpperCase()+o.slice(1)),sp=gn((o)=>o?`on${Zo(o)}`:""),Ie=(o,a)=>!Object.is(o,a);var zl="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var ap=dr(zl+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var be;class ni{constructor(o=!1){if(this.detached=o,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!o&&be)if(be.active)this.parent=be,this.index=(be.scopes||(be.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let o,a;if(this.scopes){let d=this.scopes.slice();for(o=0,a=d.length;o<a;o++)d[o].pause()}for(o=0,a=this.effects.length;o<a;o++)this.effects[o].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let o,a;if(this.scopes){let f=this.scopes.slice();for(o=0,a=f.length;o<a;o++)f[o].resume()}let d=this.effects.slice();for(o=0,a=d.length;o<a;o++)d[o].resume()}}}run(o){if(this._active){let a=be;try{return be=this,o()}finally{be=a}}}on(){if(++this._on===1)this.prevScope=be,be=this}off(){if(this._on>0&&--this._on===0){if(be===this)be=this.prevScope;else{let o=be;while(o){if(o.prevScope===this){o.prevScope=this.prevScope;break}o=o.prevScope}}this.prevScope=void 0}}stop(o){if(this._active){this._active=!1;let a,d;for(a=0,d=this.effects.length;a<d;a++)this.effects[a].stop();this.effects.length=0;for(a=0,d=this.cleanups.length;a<d;a++)this.cleanups[a]();if(this.cleanups.length=0,this.scopes){let f=this.scopes.slice();for(a=0,d=f.length;a<d;a++)f[a].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!o){let f=this.parent.scopes.pop();if(f&&f!==this)this.parent.scopes[this.index]=f,f.index=this.index}this.parent=void 0}}}function pt(o){return new ni(o)}function Sn(o,a=!1){if(be)be.cleanups.push(o)}var ue;var fr=new WeakSet;class bn{constructor(o){if(this.fn=o,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,be)if(be.active)be.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,fr.has(this))fr.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))oi(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Qo(this),ii(this);let o=ue,a=$e;ue=this,$e=!0;try{return this.fn()}finally{si(this),ue=o,$e=a,this.flags&=-3}}stop(){if(this.flags&1){for(let o=this.deps;o;o=o.nextDep)Er(o);this.deps=this.depsTail=void 0,Qo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)fr.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(hr(this))this.run()}get dirty(){return hr(this)}}var ri=0,kt,Mt;function oi(o,a=!1){if(o.flags|=8,a){o.next=Mt,Mt=o;return}o.next=kt,kt=o}function Sr(){ri++}function vr(){if(--ri>0)return;if(Mt){let a=Mt;Mt=void 0;while(a){let d=a.next;a.next=void 0,a.flags&=-9,a=d}}let o;while(kt){let a=kt;kt=void 0;while(a){let d=a.next;if(a.next=void 0,a.flags&=-9,a.flags&1)try{a.trigger()}catch(f){if(!o)o=f}a=d}}if(o)throw o}function ii(o){for(let a=o.deps;a;a=a.nextDep)a.version=-1,a.prevActiveLink=a.dep.activeLink,a.dep.activeLink=a}function si(o){let a,d=o.depsTail,f=d;while(f){let p=f.prevDep;if(f.version===-1){if(f===d)d=p;Er(f),Gl(f)}else a=f;f.dep.activeLink=f.prevActiveLink,f.prevActiveLink=void 0,f=p}o.deps=a,o.depsTail=d}function hr(o){for(let a=o.deps;a;a=a.nextDep)if(a.dep.version!==a.version||a.dep.computed&&(ai(a.dep.computed)||a.dep.version!==a.version))return!0;if(o._dirty)return!0;return!1}function ai(o){if(o.flags&4&&!(o.flags&16))return;if(o.flags&=-17,o.globalVersion===_t)return;if(o.globalVersion=_t,!o.isSSR&&o.flags&128&&(!o.deps&&!o._dirty||!hr(o)))return;o.flags|=2;let a=o.dep,d=ue,f=$e;ue=o,$e=!0;try{ii(o);let p=o.fn(o._value);if(a.version===0||Ie(p,o._value))o.flags|=128,o._value=p,a.version++}catch(p){throw a.version++,p}finally{ue=d,$e=f,si(o),o.flags&=-3}}function Er(o,a=!1){let{dep:d,prevSub:f,nextSub:p}=o;if(f)f.nextSub=p,o.prevSub=void 0;if(p)p.prevSub=f,o.nextSub=void 0;if(d.subs===o){if(d.subs=f,!f&&d.computed){d.computed.flags&=-5;for(let m=d.computed.deps;m;m=m.nextDep)Er(m,!0)}}if(!a&&!--d.sc&&d.map)d.map.delete(d.key)}function Gl(o){let{prevDep:a,nextDep:d}=o;if(a)a.nextDep=d,o.prevDep=void 0;if(d)d.prevDep=a,o.nextDep=void 0}function we(o,a){if(o.effect instanceof bn)o=o.effect.fn;let d=new bn(o);if(a)pn(d,a);try{d.run()}catch(p){throw d.stop(),p}let f=d.run.bind(d);return f.effect=d,f}var $e=!0,li=[];function Dt(){li.push($e),$e=!1}function Lt(){let o=li.pop();$e=o===void 0?!0:o}function vn(o,a=!1){if(ue instanceof bn)ue.cleanup=o}function Qo(o){let{cleanup:a}=o;if(o.cleanup=void 0,a){let d=ue;ue=void 0;try{a()}finally{ue=d}}}var _t=0;class ci{constructor(o,a){this.sub=o,this.dep=a,this.version=a.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class En{constructor(o){this.computed=o,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(o){if(!ue||!$e||ue===this.computed)return;let a=this.activeLink;if(a===void 0||a.sub!==ue){if(a=this.activeLink=new ci(ue,this),!ue.deps)ue.deps=ue.depsTail=a;else a.prevDep=ue.depsTail,ue.depsTail.nextDep=a,ue.depsTail=a;ui(a)}else if(a.version===-1){if(a.version=this.version,a.nextDep){let d=a.nextDep;if(d.prevDep=a.prevDep,a.prevDep)a.prevDep.nextDep=d;if(a.prevDep=ue.depsTail,a.nextDep=void 0,ue.depsTail.nextDep=a,ue.depsTail=a,ue.deps===a)ue.deps=d}}return a}trigger(o){this.version++,_t++,this.notify(o)}notify(o){Sr();try{for(let a=this.subs;a;a=a.prevSub)if(a.sub.notify())a.sub.dep.notify()}finally{vr()}}}function ui(o){if(o.dep.sc++,o.sub.flags&4){let a=o.dep.computed;if(a&&!o.dep.subs){a.flags|=20;for(let f=a.deps;f;f=f.nextDep)ui(f)}let d=o.dep.subs;if(d!==o){if(o.prevSub=d,d)d.nextSub=o}o.dep.subs=o}}var gr=new WeakMap,tt=Symbol(""),xr=Symbol(""),Jt=Symbol("");function Te(o,a,d){if($e&&ue){let f=gr.get(o);if(!f)gr.set(o,f=new Map);let p=f.get(d);if(!p)f.set(d,p=new En),p.map=f,p.key=d;p.track()}}function Ke(o,a,d,f,p,m){let g=gr.get(o);if(!g){_t++;return}let h=(y)=>{if(y)y.trigger()};if(Sr(),a==="clear")g.forEach(h);else{let y=ct(o),E=y&&hn(d);if(y&&d==="length"){let C=Number(f);g.forEach((T,A)=>{if(A==="length"||A===Jt||!ut(A)&&A>=C)h(T)})}else{if(d!==void 0||g.has(void 0))h(g.get(d));if(E)h(g.get(Jt));switch(a){case"add":if(!y){if(h(g.get(tt)),$t(o))h(g.get(xr))}else if(E)h(g.get("length"));break;case"delete":if(!y){if(h(g.get(tt)),$t(o))h(g.get(xr))}break;case"set":if($t(o))h(g.get(tt));break}}}vr()}function ft(o){let a=le(o);if(a===o)return a;if(Te(a,"iterate",Jt),qe(o))return a;if(!He(o))return a.map(De);return It(o)?a.map((d)=>nt(De(d))):a.map(nt)}function wr(o){return Te(o=le(o),"iterate",Jt),o}function Je(o,a){if(He(o))return It(o)?nt(De(a)):nt(a);return De(a)}var Yl={__proto__:null,[Symbol.iterator](){return pr(this,Symbol.iterator,(o)=>Je(this,o))},concat(...o){return ft(this).concat(...o.map((a)=>ct(a)?ft(a):a))},entries(){return pr(this,"entries",(o)=>(o[1]=Je(this,o[1]),o))},every(o,a){return je(this,"every",o,a,void 0,arguments)},filter(o,a){return je(this,"filter",o,a,(d)=>d.map((f)=>Je(this,f)),arguments)},find(o,a){return je(this,"find",o,a,(d)=>Je(this,d),arguments)},findIndex(o,a){return je(this,"findIndex",o,a,void 0,arguments)},findLast(o,a){return je(this,"findLast",o,a,(d)=>Je(this,d),arguments)},findLastIndex(o,a){return je(this,"findLastIndex",o,a,void 0,arguments)},forEach(o,a){return je(this,"forEach",o,a,void 0,arguments)},includes(...o){return mr(this,"includes",o)},indexOf(...o){return mr(this,"indexOf",o)},join(o){return ft(this).join(o)},lastIndexOf(...o){return mr(this,"lastIndexOf",o)},map(o,a){return je(this,"map",o,a,void 0,arguments)},pop(){return Ot(this,"pop")},push(...o){return Ot(this,"push",o)},reduce(o,...a){return ti(this,"reduce",o,a)},reduceRight(o,...a){return ti(this,"reduceRight",o,a)},shift(){return Ot(this,"shift")},some(o,a){return je(this,"some",o,a,void 0,arguments)},splice(...o){return Ot(this,"splice",o)},toReversed(){return ft(this).toReversed()},toSorted(o){return ft(this).toSorted(o)},toSpliced(...o){return ft(this).toSpliced(...o)},unshift(...o){return Ot(this,"unshift",o)},values(){return pr(this,"values",(o)=>Je(this,o))}};function pr(o,a,d){let f=wr(o),p=f[a],m=p.call(f);if(f!==o&&!qe(o)){if(m[Symbol.toStringTag]==="Array Iterator"){let g=Object.create(Object.getPrototypeOf(m));if(g.next=()=>ei(m.next(),d),p!==di[a])Object.defineProperties(g,{return:{get(){let h=m.return;return typeof h==="function"?h.bind(m):h}},throw:{get(){let h=m.throw;return typeof h==="function"?h.bind(m):h}}});return g}m._next=m.next,m.next=()=>ei(m._next(),d)}return m}function ei(o,a){if(!o.done)o.value=a(o.value);return o}var di=Array.prototype;function je(o,a,d,f,p,m){let g=wr(o),h=g!==o&&!qe(o),y=g[a];if(y!==di[a]){let T=y.apply(o,m);return h?De(T):T}let E=d;if(g!==o){if(h)E=function(T,A){return d.call(this,Je(o,T),A,o)};else if(d.length>2)E=function(T,A){return d.call(this,T,A,o)}}let C=y.call(g,E,f);return h&&p?p(C):C}function ti(o,a,d,f){let p=wr(o),m=p!==o&&!qe(o),g=d,h=!1;if(p!==o){if(m)h=f.length===0,g=function(E,C,T){if(h)h=!1,E=Je(o,E);return d.call(this,E,Je(o,C),T,o)};else if(d.length>3)g=function(E,C,T){return d.call(this,E,C,T,o)}}let y=p[a](g,...f);return h?Je(o,y):y}function mr(o,a,d){let f=le(o);Te(f,"iterate",Jt);let p=f[a](...d);if((p===-1||p===!1)&&cc(d[0]))return d[0]=le(d[0]),f[a](...d);return p}function Ot(o,a,d=[]){Dt(),Sr();let f=le(o)[a].apply(o,d);return vr(),Lt(),f}var Xl=dr("__proto__,__v_isRef,__isVue"),fi=new Set(Object.getOwnPropertyNames(Symbol).filter((o)=>o!=="arguments"&&o!=="caller").map((o)=>Symbol[o]).filter(ut));function Zl(o){if(!ut(o))o=String(o);let a=le(this);return Te(a,"has",o),a.hasOwnProperty(o)}class Tr{constructor(o=!1,a=!1){this._isReadonly=o,this._isShallow=a}get(o,a,d){if(a==="__v_skip")return o.__v_skip;let f=this._isReadonly,p=this._isShallow;if(a==="__v_isReactive")return!f;else if(a==="__v_isReadonly")return f;else if(a==="__v_isShallow")return p;else if(a==="__v_raw"){if(d===(f?p?ac:gi:p?hi:mi).get(o)||Object.getPrototypeOf(o)===Object.getPrototypeOf(d))return o;return}let m=ct(o);if(!f){let h;if(m&&(h=Yl[a]))return h;if(a==="hasOwnProperty")return Zl}let g=Reflect.get(o,a,Ue(o)?o:d);if(ut(a)?fi.has(a):Xl(a))return g;if(!f)Te(o,"get",a);if(p)return g;if(Ue(g)){let h=m&&hn(a)?g:g.value;return f&&dt(h)?br(h):h}if(dt(g))return f?br(g):wn(g);return g}}class Cr extends Tr{constructor(o=!1){super(!1,o)}set(o,a,d,f){let p=o[a],m=ct(o)&&hn(a);if(!this._isShallow){let y=He(p);if(!qe(d)&&!He(d))p=le(p),d=le(d);if(!m&&Ue(p)&&!Ue(d))if(y)return!0;else return p.value=d,!0}let g=m?Number(a)<o.length:mn(o,a),h=Reflect.set(o,a,d,Ue(o)?o:f);if(o===le(f)&&h){if(!g)Ke(o,"add",a,d);else if(Ie(d,p))Ke(o,"set",a,d,p)}return h}deleteProperty(o,a){let d=mn(o,a),f=o[a],p=Reflect.deleteProperty(o,a);if(p&&d)Ke(o,"delete",a,void 0,f);return p}has(o,a){let d=Reflect.has(o,a);if(!ut(a)||!fi.has(a))Te(o,"has",a);return d}ownKeys(o){return Te(o,"iterate",ct(o)?"length":tt),Reflect.ownKeys(o)}}class pi extends Tr{constructor(o=!1){super(!0,o)}set(o,a){return!0}deleteProperty(o,a){return!0}}var Ql=new Cr,ec=new pi,tc=new Cr(!0);var yr=(o)=>o,xn=(o)=>Reflect.getPrototypeOf(o);function nc(o,a,d){return function(...f){let p=this.__v_raw,m=le(p),g=$t(m),h=o==="entries"||o===Symbol.iterator&&g,y=o==="keys"&&g,E=p[o](...f),C=d?yr:a?nt:De;return!a&&Te(m,"iterate",y?xr:tt),pn(Object.create(E),{next(){let{value:T,done:A}=E.next();return A?{value:T,done:A}:{value:h?[C(T[0]),C(T[1])]:C(T),done:A}}})}}function yn(o){return function(...a){return o==="delete"?!1:o==="clear"?void 0:this}}function rc(o,a){let d={get(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(Ie(p,h))Te(g,"get",p);Te(g,"get",h)}let{has:y}=xn(g),E=a?yr:o?nt:De;if(y.call(g,p))return E(m.get(p));else if(y.call(g,h))return E(m.get(h));else if(m!==g)m.get(p)},get size(){let p=this.__v_raw;return!o&&Te(le(p),"iterate",tt),p.size},has(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(Ie(p,h))Te(g,"has",p);Te(g,"has",h)}return p===h?m.has(p):m.has(p)||m.has(h)},forEach(p,m){let g=this,h=g.__v_raw,y=le(h),E=a?yr:o?nt:De;return!o&&Te(y,"iterate",tt),h.forEach((C,T)=>p.call(m,E(C),E(T),g))}};return pn(d,o?{add:yn("add"),set:yn("set"),delete:yn("delete"),clear:yn("clear")}:{add(p){let m=le(this),g=xn(m),h=le(p),y=!a&&!qe(p)&&!He(p)?h:p;if(!(g.has.call(m,y)||Ie(p,y)&&g.has.call(m,p)||Ie(h,y)&&g.has.call(m,h)))m.add(y),Ke(m,"add",y,y);return this},set(p,m){if(!a&&!qe(m)&&!He(m))m=le(m);let g=le(this),{has:h,get:y}=xn(g),E=h.call(g,p);if(!E)p=le(p),E=h.call(g,p);let C=y.call(g,p);if(g.set(p,m),!E)Ke(g,"add",p,m);else if(Ie(m,C))Ke(g,"set",p,m,C);return this},delete(p){let m=le(this),{has:g,get:h}=xn(m),y=g.call(m,p);if(!y)p=le(p),y=g.call(m,p);let E=h?h.call(m,p):void 0,C=m.delete(p);if(y)Ke(m,"delete",p,void 0,E);return C},clear(){let p=le(this),m=p.size!==0,g=void 0,h=p.clear();if(m)Ke(p,"clear",void 0,void 0,void 0);return h}}),["keys","values","entries",Symbol.iterator].forEach((p)=>{d[p]=nc(p,o,a)}),d}function Ar(o,a){let d=rc(o,a);return(f,p,m)=>{if(p==="__v_isReactive")return!o;else if(p==="__v_isReadonly")return o;else if(p==="__v_isShallow")return a;else if(p==="__v_raw")return f;return Reflect.get(mn(d,p)&&p in f?d:f,p,m)}}var oc={get:Ar(!1,!1)},ic={get:Ar(!1,!0)},sc={get:Ar(!0,!1)};var mi=new WeakMap,hi=new WeakMap,gi=new WeakMap,ac=new WeakMap;function lc(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function wn(o){if(He(o))return o;return Pr(o,!1,Ql,oc,mi)}function xi(o){return Pr(o,!1,tc,ic,hi)}function br(o){return Pr(o,!0,ec,sc,gi)}function Pr(o,a,d,f,p){if(!dt(o))return o;if(o.__v_raw&&!(a&&o.__v_isReactive))return o;if(o.__v_skip||!Object.isExtensible(o))return o;let m=p.get(o);if(m)return m;let g=lc(Xo(o));if(g===0)return o;let h=new Proxy(o,g===2?f:d);return p.set(o,h),h}function It(o){if(He(o))return It(o.__v_raw);return!!(o&&o.__v_isReactive)}function He(o){return!!(o&&o.__v_isReadonly)}function qe(o){return!!(o&&o.__v_isShallow)}function cc(o){return o?!!o.__v_raw:!1}function le(o){let a=o&&o.__v_raw;return a?le(a):o}var De=(o)=>dt(o)?wn(o):o,nt=(o)=>dt(o)?br(o):o;function Ue(o){return o?o.__v_isRef===!0:!1}function ze(o){return uc(o,!1)}function uc(o,a){if(Ue(o))return o;return new yi(o,a)}class yi{constructor(o,a){this.dep=new En,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=a?o:le(o),this._value=a?o:De(o),this.__v_isShallow=a}get value(){return this.dep.track(),this._value}set value(o){let a=this._rawValue,d=this.__v_isShallow||qe(o)||He(o);if(o=d?o:le(o),Ie(o,a))this._rawValue=o,this._value=d?o:De(o),this.dep.trigger()}}class bi{constructor(o,a,d){this.fn=o,this.setter=a,this._value=void 0,this.dep=new En(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=_t-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!a,this.isSSR=d}notify(){if(this.flags|=16,!(this.flags&8)&&ue!==this)return oi(this,!0),!0}get value(){let o=this.dep.track();if(ai(this),o)o.version=this.dep.version;return this._value}set value(o){if(this.setter)this.setter(o)}}function jt(o,a,d=!1){let f,p;if(Go(o))f=o;else f=o.get,p=o.set;return new bi(f,p,d)}function Tn(o){return o.replaceAll(/[A-Z]/g,(a)=>`-${a.toLowerCase()}`)}var dc=new Set(["all","print","screen","speech"]);function Si(o,a){if(o.startsWith("@--"))return a[o.slice(1)]??o.slice(1);if(o.startsWith("@(")){let d=o.slice(2,-1).trim();return dc.has(d.toLowerCase())?d:o.slice(1)}return null}function Ht(o){return o.startsWith("@position-try")||o.startsWith("@property")||o.startsWith("@font-face")||o.startsWith("@counter-style")}function Vt(o){return o.startsWith("@keyframes")}function vi(o,a){let d=[];for(let f of Nr(o))for(let p of Nr(a))d.push(fc(f,p));return d.join(", ")}function fc(o,a){if(a.startsWith("&"))return a.replaceAll("&",o);if(a.startsWith("[")||a.startsWith(":")||a.startsWith("."))return`${o}${a}`;return`${o} ${a}`}function Nr(o){let a=[],d=0,f=null,p=0;for(let g=0;g<o.length;g+=1){let h=o[g];if(f){if(h==="\\")g+=1;else if(h===f)f=null;continue}if(h==='"'||h==="'")f=h;else if(h==="("||h==="[")d+=1;else if(h===")"||h==="]")d=Math.max(0,d-1);else if(h===","&&d===0)a.push(o.slice(p,g)),p=g+1}a.push(o.slice(p));let m=a.flatMap((g)=>{let h=g.trim();return h===""?[]:[h]});return m.length>0?m:[o]}var pc=/[\s>+~,()]/,mc=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function hc(o,a){let d="",f=0;for(;;){let p=o.indexOf("[open]",f);if(p===-1)return d+o.slice(f);let m=p;while(m>0&&!pc.test(o.charAt(m-1)))m-=1;let g=mc.exec(o.slice(m,p))?.[0]?.toLowerCase(),h=g===void 0?a.dialog===!0:g==="dialog";d+=o.slice(f,p)+(h?"[data-jx-dialog-open]":"[open]"),f=p+6}}function Rr(o,a={}){if(o.includes("::backdrop"))return null;let d=o.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return hc(d,a)}var Ge="data-color-scheme";function Cn(o){let a=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(o.trim())?.[1];return a==="light"||a==="dark"?a:null}function Ei(o,a){if(o===":root"||o==="html")return{auto:`${o}:where(:not([${Ge}]))`,forced:`${o}:where([${Ge}="${a}"])`};return{auto:`:where(:root:not([${Ge}])) ${o}`,forced:`:where(:root[${Ge}="${a}"]) ${o}`}}function Wt(o){return o.startsWith(":")||o.startsWith(".")||o.startsWith("&")||o.startsWith("[")}function $r(o){return o.startsWith("--")?o:Tn(o)}function Ft(o){let a=2166136261;for(let d=0;d<o.length;d+=1)a^=o.charCodeAt(d),a=Math.imul(a,16777619);return(a>>>0).toString(36)}function wi(o,a,d){let f=d.map(([m,g])=>`${m}: ${g}`).join("; "),p=a===null?f:`${a} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function gc(o,a,d){let f=d.map(({selector:m,declarations:g})=>`${m} { ${g.map(([h,y])=>`${h}: ${y}`).join("; ")} }`).join(" "),p=`@keyframes ${a} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function xc(o){let a=Object.keys(o).filter((f)=>Vt(f));if(a.length===0)return o;let d={...o};for(let f of a)delete d[f];return d}function yc(o){let a=o.startsWith("&")?o.slice(1):o;return a===""||a.startsWith(":")||a.startsWith(".")||a.startsWith("[")}function Bt(o,a={}){let{scope:d=null,mediaQueries:f={},transposeValue:p=(L)=>L,transposeSelector:m=(L)=>L,resolveValue:g}=a,h=[],y=(L)=>L!==null&&typeof L==="object"&&!Array.isArray(L)&&!r(L),E=(L,_)=>{if(y(_))return[_];if(!Ht(L)||!Array.isArray(_)||_.length===0)return[];return _.every((Y)=>y(Y))?_:[]},C=(L,_,Y,q)=>{if(_===void 0||_===null)return null;if(r(_))return Y?g?.(L,_,q)??null:null;if(n(_))return null;let G=String(_);if(c(G))return Y?g?.(L,G,q)??null:null;return p(G)},T=(L,_,Y=!0,q="self")=>{let G=[];for(let[U,M]of Object.entries(L)){if(E(U,M).length>0)continue;if(_&&(U.startsWith("@")||Wt(U)))continue;if(U.startsWith("$"))continue;let B=C(U,M,Y,q);if(B!==null)G.push([$r(U),B])}return G},A=(L,_,Y,q,G)=>{if(Y.length===0)return;let U=_;if(U!==null){let re=m(U);if(re===null)return;U=re}let M=wi(L,U,Y),B={text:M,conditions:[...L],selector:U,declarations:Y,target:q,key:Ft(M)};if(e(G)&&G!=="")B.description=G;h.push(B)},H=(L,_,Y)=>{let q=L.slice(10).trim();if(q==="")return;let G=[];for(let[M,B]of Object.entries(_)){if(!y(B))continue;let re=T(B,!0,!1,"unscoped");if(re.length>0)G.push({declarations:re,selector:M.trim()})}if(G.length===0)return;let U=gc(Y,q,G);h.push({blocks:G,conditions:[...Y],declarations:[],key:Ft(U),selector:null,target:"unscoped",text:U})},k=(L,_,Y,q,G)=>{if(L==="@--")return;if(Ht(L)){A([...q,L],null,T(_,!1,!0,"unscoped"),"unscoped",_.$description);return}if(Vt(L)){H(L,_,q);return}let U=Si(L,f),M=U===null?L:`@media ${U}`,B=U===null?null:Cn(U);if(B!==null&&Y!==null){let{auto:re,forced:X}=Ei(Y,B);K(_,re,[...q,M],G),K(xc(_),X,q,G);return}K(_,Y,[...q,M],G)};function K(L,_,Y,q){A(Y,_,T(L,!0,!0,q),q,L.$description);for(let[G,U]of Object.entries(L))for(let M of E(G,U))if(G.startsWith("@"))k(G,M,_,Y,q);else if(_!==null)K(M,vi(_,G),Y,yc(G)?q:"descendant")}return K(o,d,[],"self"),h}var Fe="en-US",Ti="UTC",Ci=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],Ai=Ci.map((o)=>o.path),Pi=Object.fromEntries(Ci.map((o)=>[o.path,o.params.indexOf("locale")]));function bc(o){return o.replaceAll("~1","/").replaceAll("~0","~")}function Or(o){if(o==="")return[];return o.split("/").map((a)=>bc(a))}function he(o,a){let d=o;for(let f of Or(a))d=d?.[f];return d}function kr(o){let a=o.$map;return n(a)?a:void 0}function Sc(o){return n(o)&&!Array.isArray(o)&&"operator"in o}function $i(o){return n(o)&&!Array.isArray(o)&&"$ref"in o}var Oi=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),ki=new Set(["!","-"]),Mi=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),vc=new Set(["=","+=","-=","*=","/="]),Ec=new Set(["push","pop","shift","unshift","splice"]),_i=new Set(["reduce","map","filter"]),Ji=new Set(["?:","switch"]),Di=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),wc=new Set([...Oi,...ki,...Mi,..._i,...Ji,...Di,"call"]),Tc=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...Ai]),Cc=new Map([["Intl/compare",(o,a,d,f)=>new Intl.Collator(d??Fe,f).compare(o,a)],["Intl/displayName",(o,a,d,f)=>new Intl.DisplayNames(d??Fe,{...f,type:a??"language"}).of(o)],["Intl/formatDate",(o,a,d)=>new Intl.DateTimeFormat(a??Fe,{timeZone:Ti,...d}).format(new Date(o))],["Intl/formatList",(o,a,d)=>new Intl.ListFormat(a??Fe,d).format(o)],["Intl/formatNumber",(o,a,d)=>new Intl.NumberFormat(a??Fe,d).format(o)],["Intl/formatRelativeTime",(o,a,d,f)=>new Intl.RelativeTimeFormat(d??Fe,f).format(o,a)],["Intl/plural",(o,a,d)=>new Intl.PluralRules(a??Fe,d).select(o)],["Intl/segment",(o,a,d)=>[...new Intl.Segmenter(d??Fe,{granularity:a??"grapheme"}).segment(o)].map((f)=>f.segment)]]);function Ac(o,a,d){let f=Pi[o];if(f===void 0||f<0||a[f]!=null)return a;let p=he(d.$page,"locale");if(!e(p)||p==="")return a;let m=[...a];return m[f]=p,m}function Pc(o){return o.startsWith("window#/")&&Tc.has(o.slice(8))}function Li(o){return Oi.has(o)}var Ni=64,Nc=64;function pe(o,a){if(!o)return;let d=(o.depth??0)+1;if(d>Nc)return;return{depth:d,path:[...o.path??[],...Array.isArray(a)?a:[a]],report:o.report}}function fe(o,a,d,f,p){if(o===null||o===void 0)return o;if(Sc(o))return Ce(o,a,d,f,p);if($i(o)){let m=An(o.$ref,a,d,f);return p?.report(p.path??[],m),m}if(Array.isArray(o))return Ii(o,a,d,f,p);return p?.report(p.path??[],o),o}function Ii(o,a,d,f,p){return o.map((m,g)=>fe(m,a,d,f,pe(p,g)))}function Rc(o,a,d,f){let p=(m)=>{if(!o.slice(m.length).includes("/"))return a;return An(o.slice(0,o.lastIndexOf("/")),a,d,f)};if(o.startsWith("#/state/"))return p("#/state/");if(o.startsWith("parent#/"))return p("parent#/");if(o.startsWith("$map/")||o.startsWith("$args/"))return o.split("/").length>2?An(o.slice(0,o.lastIndexOf("/")),a,d,f):void 0;return}function An(o,a,d,f){if(o==="$reduce/acc")return f?.acc;if(o.startsWith("$reduce/"))return f?.acc;if(o.startsWith("$args/")){let p=o.slice(6).split("/"),m=f?.args?.[p[0]];return p.length>1?he(m,p.slice(1).join("/")):m}if(o.startsWith("event#/")){let p=o.slice(7);return he(d,p)}if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=kr(a);if(m==="item")g=f?.item??h?.item??a["$map/item"];else if(m==="index")g=f?.index??h?.index??a["$map/index"];else g=h?.[m]??a[`$map/${m}`];return p.length>2?he(g,p.slice(2).join("/")):g}if(o.startsWith("#/state/"))return he(a,o.slice(8));if(o.startsWith("parent#/"))return he(a,o.slice(8));if(o.startsWith("window#/"))return he(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return he(globalThis.document,o.slice(10));return he(a,o)??null}function $c(o,a,d,f){if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=kr(a);if(m==="item")g=f?.item??h?.item??a["$map/item"];else if(m==="index")g=f?.index??h?.index??a["$map/index"];else g=h?.[m]??a[`$map/${m}`];if(p.length>2){let y=p.slice(2),E=y.pop(),C=y.length>0?he(g,y.join("/")):g;return{key:E,obj:C}}return{key:m==="item"?"$map/item":"$map/index",obj:kr(a)??a}}if(o.startsWith("#/state/")){let p=o.slice(8);if(p.indexOf("/")===-1)return{key:p,obj:a};let g=Or(p),h=g.pop(),y=a;for(let E of g)y=y[E];return{key:h,obj:y}}return{key:o,obj:a}}function Ce(o,a,d,f,p){let m=Oc(o,a,d,f,p);return p?.report(p.path??[],m),m}function Ri(o,a,d){switch(o){case"+":return a+d;case"-":return a-d;case"*":return a*d;case"/":return a/d;case"%":return a%d;case"<":return a<d;case"<=":return a<=d;case">":return a>d;default:return a>=d}}function Oc(o,a,d,f,p){let{operator:m,target:g,value:h,initial:y}=o;if(!wc.has(m))throw Error(`$expression: unknown operator "${m}"`);if(ki.has(m)&&!("value"in o)){let E=fe(g,a,d,f,pe(p,"target"));if(m==="!")return!E;if(m==="-")return-E}if(m==="call"){let E=$i(g)?g.$ref:void 0;if(!e(E))throw TypeError("$expression: call target must be a $ref pointer");let C=(f?.callDepth??0)+1;if(C>Ni)throw Error(`$expression: call depth exceeded (${Ni})`);let T=Array.isArray(h)?h.map((H,k)=>fe(H,a,d,f,pe(p,["value",k]))):[];if(E.startsWith("window#/")){if(!Pc(E))throw Error(`$expression: "${E}" is not a blessed pure global`);let H=E.slice(8),k=Cc.get(H);if(k)return k(...Ac(H,T,a));let K=he(globalThis.window,H),L=H.lastIndexOf("/"),_=L===-1?globalThis.window:he(globalThis.window,H.slice(0,L));return K.apply(_,T)}let A=An(E,a,d,f);if(t(A))return A.apply(Rc(E,a,d,f),T);if(n(A)&&"$expression"in A){let H=A,k={};for(let[K,L]of(H.parameters??[]).entries()){let _=e(L)?L:L?.name??"";if(!_)continue;k[_]=T[K]===void 0&&n(L)&&"default"in L?L.default:T[K]}return Ce(H.$expression,a,d,{args:k,callDepth:C})}throw TypeError(`$expression: call target "${E}" is not callable`)}if(Ji.has(m)){if(m==="?:"){let H=fe(g,a,d,f,pe(p,"target"));if(p){let k=fe(h,a,d,f,pe(p,"value")),K=fe(y,a,d,f,pe(p,"initial"));return H?k:K}return H?fe(h,a,d,f):fe(y,a,d,f)}let E=fe(g,a,d,f,pe(p,"target")),C=String(E),T=o.cases??{},A=Object.hasOwn(T,C);if(p){let H;for(let[K,L]of Object.entries(T)){let _=fe(L,a,d,f,pe(p,["cases",K]));if(K===C)H=_}let k=fe(o.default,a,d,f,pe(p,"default"));return A?H:k}return A?fe(T[C],a,d,f):fe(o.default,a,d,f)}if(Mi.has(m)){let E=fe(g,a,d,f,pe(p,"target")),C=fe(h,a,d,f,pe(p,"value"));switch(m){case"===":return E===C;case"!==":return E!==C;case"&&":return E&&C;case"||":return E||C;case"??":return E??C;default:return Ri(m,E,C)}}if(vc.has(m)){let E=fe(h,a,d,f,pe(p,"value")),{obj:C,key:T}=$c(g.$ref,a,d,f);C[T]=m==="="?E:Ri(m.slice(0,-1),C[T],E);return}if(Ec.has(m)){let E=fe(g,a,d,f,pe(p,"target"));switch(m){case"push":return E.push(fe(h,a,d,f,pe(p,"value")));case"unshift":return E.unshift(fe(h,a,d,f,pe(p,"value")));case"pop":return E.pop();case"shift":return E.shift();case"splice":{let C=fe(h,a,d,f,pe(p,"value"));return E.splice(...C)}default:break}}if(Di.has(m)){let E=fe(g,a,d,f,pe(p,"target")),C=h===void 0?[]:Array.isArray(h)?Ii(h,a,d,f,pe(p,"value")):[fe(h,a,d,f,pe(p,"value"))],T=he(E,m);if(!t(T))return;return T.apply(E,C)}if(_i.has(m)){let E=fe(g,a,d,f,pe(p,"target")),C=h;if(m==="reduce"){let T=fe(y,a,d,f,pe(p,"initial"));for(let[A,H]of E.entries())T=Ce(C,a,d,{acc:T,index:A,item:H},A===0?pe(p,"value"):void 0);return T}if(m==="map")return E.map((T,A)=>Ce(C,a,d,{...f,index:A,item:T},A===0?pe(p,"value"):void 0));if(m==="filter")return E.filter((T,A)=>Ce(C,a,d,{...f,index:A,item:T},A===0?pe(p,"value"):void 0))}return}function rt(o,a,d,f){return fe(o,a,d,f)}function Pn(o){let a=o.replaceAll("\\","/");return a.length>1&&a.endsWith("/")?a.slice(0,-1):a}function ji(o){let a=Pn(o);return a.startsWith("/")?a:`/${a}`}function Hi(o,a){return[...o].toSorted((d,f)=>f[a].length-d[a].length)}function kc(o,a){return o===a||o.startsWith(`${a}/`)}function Fi(o,a){let d=Pn(a);for(let f of Hi(o,"dir")){let p=Pn(f.dir);if(!kc(d,p)||d===p)continue;let m=d.slice(p.length+1),{filter:g}=f;if(g&&!g(m))return null;let h=m.split("/").map((y)=>encodeURIComponent(y)).join("/");return`${ji(f.urlPrefix)}/${h}`}return null}function Mc(o,a){let d=a.split("#")[0].split("?")[0];if(!d.startsWith("/"))return null;let f;try{f=decodeURIComponent(d)}catch{return null}if(/%2e|%2f/i.test(f))return null;for(let p of Hi(o,"urlPrefix")){let m=ji(p.urlPrefix);if(!f.startsWith(`${m}/`))continue;let h=f.slice(m.length+1).split("/");if(h.some((E)=>E===""||E==="."||E===".."))return null;let{filter:y}=p;if(y&&!y(h.join("/")))return null;return`${Pn(p.dir)}/${h.join("/")}`}return null}var Pp=String.raw`"'\s<>()\\`;var _c="public";function Kt(o){let a=o.search(/[#?]/);return a===-1?{path:o,suffix:""}:{path:o.slice(0,a),suffix:o.slice(a)}}function Mr(o){return o===""||o.startsWith("/")||o.startsWith("#")||o.includes("${")||/^[a-z][\w+.-]*:/i.test(o)}function _r(o){return o.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function Jr(o,a){let f=(o===""||o==="."?[]:_r(o).split("/")).filter((p)=>p!==""&&p!==".");for(let p of a.replaceAll("\\","/").split("/")){if(p===""||p===".")continue;if(p===".."){if(f.length===0)return null;f.pop();continue}f.push(p)}return f.join("/")}function Jc(o,a,d){let{path:f}=Kt(o);if(!f.startsWith("/"))return[];let p;try{p=decodeURIComponent(f)}catch{return[]}if(/%2e|%2f/i.test(p))return[];let m=p.replace(/^\/+/,"");if(m===""||m.split("/").some((h)=>h==="."||h===".."))return[];let g=[];for(let h of d){if(h==="mounts"){let y=Mc(a,f);if(y!==null&&!y.startsWith("/")&&!/^[A-Za-z]:/.test(y))g.push(_r(y));continue}g.push(h==="root"?m:`${_c}/${m}`)}return[...new Set(g)]}function Vi(o,a,d,f){let{path:p}=Kt(o);if(p==="")return null;if(Mr(o))return p.startsWith("/")?Jc(p,d,f)[0]??null:null;if(p.endsWith("/"))return null;let m;try{m=decodeURIComponent(p)}catch{return null}let g=Jr(a,m);if(g===null||g===""||g===_r(a))return null;return g}function Wi(o){return o.split("/").map((a)=>encodeURIComponent(a)).join("/")}function Bi(o){let a=[],d=0;while(d<o.length){while(d<o.length&&(/\s/.test(o[d])||o[d]===","))d+=1;if(d>=o.length)break;let f=d;while(d<o.length&&!/\s/.test(o[d]))d+=1;let p=o.slice(f,d);if(p.endsWith(",")){a.push({descriptor:"",url:p.replace(/,+$/,"")});continue}while(d<o.length&&/\s/.test(o[d]))d+=1;let m=d;while(d<o.length&&o[d]!==",")d+=1;let g=o.slice(m,d).trim();if(d+=1,p=p.replace(/,+$/,""),p!=="")a.push({descriptor:g,url:p})}return a}function Ki(o){return o.map(({url:a,descriptor:d})=>d?`${a} ${d}`:a).join(", ")}function Dc(o){if("operator"in o)return{kind:"expression",node:o};if("if"in o)return{kind:"if",node:o};if("$switch"in o)return{kind:"switch",node:o};if("stopPropagation"in o)return{kind:"stopPropagation"};if("preventDefault"in o)return{kind:"preventDefault"};return{kind:"dispatch",node:o}}function Lc(o){return(n(o)||t(o))&&"then"in o&&t(o.then)}async function mt(o,a,d,f={}){let p=f.args?{args:f.args}:void 0;for(let m of o){let g=Dc(m);switch(g.kind){case"expression":{let h=Ce(g.node,a,d,p);if(Lc(h))await h;break}case"if":{let h=g.node,y=rt(h.if,a,d,p)?h.then:h.else;if(Array.isArray(y))await mt(y,a,d,f);break}case"switch":{let h=g.node,y=String(rt(h.$switch,a,d,p)),E=h.cases??{},C=Object.hasOwn(E,y)?E[y]:h.default;if(Array.isArray(C))await mt(C,a,d,f);break}case"dispatch":{let h=g.node,y=t(f.target)?f.target():f.target,E=d?.currentTarget??y;if(!E)break;let C={};if("detail"in h)C.detail=rt(h.detail,a,d,p);if(h.bubbles!==void 0)C.bubbles=h.bubbles;if(h.composed!==void 0)C.composed=h.composed;E.dispatchEvent(new CustomEvent(h.dispatchEvent,C));break}case"stopPropagation":{d?.stopPropagation();break}case"preventDefault":{d?.preventDefault();break}default:break}}}function Ui(o,a){for(let d of o.split(";")){let f=d.indexOf("=");if(f===-1)continue;if(d.slice(0,f).trim()===a)return d.slice(f+1)}return null}function qi(o,a,d){let f=o.startsWith("__Host-"),p=[`${o}=${encodeURIComponent(JSON.stringify(a))}`];if(d.maxAge!==void 0)p.push(`Max-Age=${d.maxAge}`);let m=f?"/":d.path;if(m)p.push(`Path=${m}`);if(d.domain&&!f)p.push(`Domain=${d.domain}`);let{sameSite:g}=d;if(d.secure===!0||f||o.startsWith("__Secure-")||g?.toLowerCase()==="none")p.push("Secure");if(g)p.push(`SameSite=${g}`);return p.join("; ")}function Dr(o){return t(o)}var Lr=new Map;function Ic(o){return o.headers?.get("Content-Type")??""}async function Br(o,a){if(!e(o))return o;let d=a?.resolver?.(o);if(d)return d;if(Lr.has(o))return Lr.get(o);let f=fetch(o).then(async(p)=>{if(!p.ok)throw Error(`Jx: failed to fetch ${o} (${p.status})`);if(Ic(p).includes("text/html"))throw Error(`Jx: ${o} returned HTML, not a document — the host answered a missing file with its `+"app shell (a single-page fallback), so this path is not served.");return await p.json()});return Lr.set(o,f),f}var jc=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),hs={skip:!1};function gs(o){hs.skip=o}var xs={skip:!1};function ys(o){xs.skip=o}var jr=null;function bs(o){jr=o||null}function Ss(o){return jr?`${o}?token=${encodeURIComponent(jr)}`:o}function vs(o){let a=pt(!0);return a.run(()=>{we(o)}),()=>a.stop()}function bt(o){let a=pt(!0);try{return{result:a.run(o),stop:()=>a.stop()}}catch(d){throw a.stop(),d}}var Es=!1;function ws(o){Es=o}var Hc=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,Fc=new Map([["b","cqb"],["h","cqh"],["i","cqi"],["max","cqmax"],["min","cqmin"],["w","cqw"]]);function Vc(o){if(!Es||!o.includes("v"))return o;return o.replace(Hc,(a,d,f)=>`${d}${Fc.get(f.toLowerCase())??`cq${f}`}`)}var Ts=!1;function Cs(o){Ts=o}var Kr=!1;function As(o){Kr=o}var Ur=!1;function Ps(o){Ur=o}var Rn=!1;function Hr(o){return Rn||o.dataset.jxPath!==void 0}function Wc(o,a){if(Ts&&a==="href"&&(o.tagName==="A"||o.tagName==="AREA"))return"data-jx-href";if(Kr&&a==="popover"&&Hr(o))return"data-jx-popover";if(Ur&&Hr(o)){if(a==="commandfor")return"data-jx-commandfor";if(a==="inert")return"data-jx-inert";if(a==="open"&&o.tagName==="DIALOG")return"data-jx-open"}return a}var xt=null;function Dn(o){xt=o}var Bc=new Set(["src","poster","data"]),Kc=new Set(["srcset","imagesrcset"]),Uc=new Set(["LINK"]);function qc(o,a){return Bc.has(a)||a==="href"&&Uc.has(o)}function qr(o,a,d){if(!xt||d==="")return d;let f=a.toLowerCase();if(Kc.has(f)){let p=Bi(d),m=p.map((h)=>{let y=xt?.(h.url,f)??null;if(y===null||y===h.url)return h;return{descriptor:h.descriptor,url:y}});return m.some((h,y)=>h!==p[y])?Ki(m):d}if(!qc(o,f))return d;return xt(d,f)??d}var zc=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function Gc(o){if(!xt||!o.includes("url("))return o;return o.replaceAll(zc,(a,d,f)=>{let p=f===""?null:xt?.(f,"url()")??null;return p===null?a:`url(${d}${p}${d})`})}function $n(o){return Vc(Gc(o))}var Ns=!1;function Rs(o){Ns=o}var Yc=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function Xc(o,a,d){if(!Ns||o!=="textContent")return null;let f=null;if(r(a)){if(!a.$ref.startsWith("#/state/"))return null;let m=a.$ref.slice(8);f=m&&!m.includes("/")?m:null}else if(e(a))f=Yc.exec(a)?.[1]??null;if(!f)return null;let p=le(d)[f];if(Ue(p)||t(p))return null;if(n(p))return null;return f}async function Ln(o,a={},d=location.href,f){let p=()=>f?.root??null,m={},g=o.state??{},h=It(a);for(let T of Object.keys(a))if(h&&!(T in g))Object.defineProperty(m,T,{configurable:!0,enumerable:!0,get:()=>a[T],set:(A)=>{a[T]=A}});else m[T]=a[T];let y=o.imports??{};for(let[,T]of Object.entries(g))if(R(T)&&!T.$src){let A=y[T.$prototype];if(A){if(!A.endsWith(".class.json")){console.warn(`Jx: import "${T.$prototype}" must map to a .class.json path, got "${A}"`);continue}T.$src=A}}for(let[T,A]of Object.entries(g)){if(e(A)){if(!A.includes("${"))m[T]=A;continue}if(i(A)||x(A)||A===null){m[T]=A;continue}if(Array.isArray(A)){m[T]=A;continue}if(n(A)){if(A.$prototype)continue;if(b(A))continue;if(D(A))continue;if("default"in A){m[T]=A.default;continue}if(Zc(A))continue;m[T]=A}}let E=wn(m);for(let[T,A]of Object.entries(g))if(e(A)&&A.includes("${"))E[T]=jt(()=>Ms(A,E));for(let[T,A]of Object.entries(g))if(b(A)){let H=A.$expression;if(j(A)){let k=A.parameters;E[T]=(...K)=>Ce(H,E,null,{args:zi(k,K)})}else if(Li(H.operator)){let k=(K,L)=>Ce(H,K,L);E[T]=k}else E[T]=jt(()=>Ce(H,E,null))}for(let[T,A]of Object.entries(g))if(O(A)){let{body:H}=A;if(Array.isArray(A.parameters)&&A.parameters.length>0){let k=A.parameters;E[T]=(...K)=>mt(H,E,null,{args:zi(k,K),target:p})}else{let k=(K,L)=>{mt(H,K,L??null,{target:p})};E[T]=k}}else if(v(A))E[T]=await ru(A,E,T,d);for(let[T,A]of Object.entries(g))if(R(A))E[T]=await yu(A,E,T,d,f);if(!(f?.skipServerFunctions??hs.skip)){for(let[T,A]of Object.entries(g))if(D(A))E[T]=await Cu(A,E,T,d)}let C=f?.media??Us;if(o.$media)E.$media=o.$media;else if(!E.$media&&Object.keys(C).length>0)E.$media=C;return E}function zi(o,a){let d={};for(let[f,p]of o.entries()){let m=e(p)?p:p?.name??"";if(!m)continue;d[m]=a[f]===void 0&&p!==null&&!e(p)&&"default"in p?p.default:a[f]}return d}function Zc(o){for(let a of Object.keys(o))if(jc.has(a))return!0;return!1}var $s=["state","$map","item","index","$site","$page"];function Os(o){let a=eu(o);return[o,a,a?.item,a?.index,o.$site,o.$page]}function Ye(o,a){let d=Gi.get(o);if(!d)d=Function(...$s,`return \`${o}\``),ks(Gi,o,d);return d(...Os(a))}var Gi=new Map,Yi=new Map,Qc=4096;function ks(o,a,d){if(o.size>=Qc)o.clear();o.set(a,d)}var Xi=new Set,Zi=null;function In(o,a,d){we(()=>{try{a()}catch(f){if(Zi)Zi(f instanceof Error?f:Error(String(f)),o);else if(!Xi.has(o))Xi.add(o),console.warn(`jx: template ${JSON.stringify(o)} threw:`,f);d?.()}})}function eu(o){return o.$map}function tu(o){if(!o.startsWith("${")||!o.endsWith("}"))return!1;let a=0;for(let d=1;d<o.length;d+=1){let f=o[d];if(f==="{")a+=1;else if(f==="}"){if(a-=1,a===0)return d===o.length-1}}return!1}function Ms(o,a){if(!tu(o))return Ye(o,a);let d=Yi.get(o);if(!d)d=Function(...$s,`return (${o.slice(2,-1)})`),ks(Yi,o,d);return d(...Os(a))}var _s=null;function Js(o){_s=o}var Qi="npm:";async function nu(o,a){if(o.startsWith(Qi)){let d=o.slice(Qi.length);return ht(_s?.(d)??d)}if(a)try{return await ht(new URL(o,a).href)}catch{return ht(o)}return ht(o)}function ht(o){return import(o)}var St=new Map,gt=new Map,Ds=new Set;function Ls(o,a){if(Ds.add(o),t(a)){St.delete(o),gt.set(o,a);return}gt.delete(o),St.set(o,a)}function zr(o){let a=St.get(o);if(a)return a;let d=gt.get(o);if(!d)return;if(!t(d))return d;let f=d(),p=(async()=>{try{let m=await f;return St.set(o,m),gt.delete(o),m}catch(m){throw gt.set(o,d),m}})();return gt.set(o,p),p}async function ru(o,a,d,f){if(o.body&&o.$src)throw Error(`Jx: '${d}' declares both body and $src — these are mutually exclusive`);if(!o.body&&!o.$src){let h=Fr(o),y=Function(...h,"");return Object.defineProperty(y,"name",{configurable:!0,value:o.name??d}),y}let p;if(e(o.body)){let h=Fr(o);p=Function(...h,o.body),Object.defineProperty(p,"name",{configurable:!0,value:o.name??d})}else{let h=o.$src;if(!h)throw Error(`Jx: '${d}' has neither body nor $src`);let y=o.$export??d,E,C=zr(h);if(C instanceof Promise)E=await C;else if(C)E=C;else E=await nu(h,f),St.set(h,E);let T=E[y]??E.default?.[y];if(!t(T))throw TypeError(`Jx: export "${y}" not found or not a function in "${h}"`);p=T}let m=(o.parameters??o.arguments??[]).length>0,g=!1;if(!m)g=e(o.body)?I(o.body):p.length<=1&&I(p.toString());if(g)return jt(()=>p(a));return p}function Fr(o){let a=o.parameters?W(o.parameters):o.arguments??[];return a.length>0&&a[0]==="state"?a:["state",...a]}var Gt=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]);function Gr(o){return Object.create(o)}function jn(o){return o.$media??{}}function Hn(o){return o}function ou(o){let a=Hn(o)._state;return n(a)?a:null}function iu(o){return t(o)}var es=new Set,su="http://www.w3.org/2000/svg",au="http://www.w3.org/1998/Math/MathML";function lu(o,a){if(o==="svg")return su;if(o==="math")return au;return a??null}function Oe(o,a,d){let f=d?._path??[];if(e(o)||i(o)||x(o)){let T=document.createTextNode(String(o));if(c(o))In(o,()=>{T.textContent=Ye(o,a)},()=>{T.textContent=""});return T}let p=a;for(let[T,A]of Object.entries(o))if(T.startsWith("$")&&!Gt.has(T)){if(p===a)p=Gr(a);p[T]=r(A)?Se(A.$ref,a):A}if("$ref"in o&&!o.tagName){let T=String(o.$ref??"");if(!es.has(T))es.add(T),console.warn(`Jx: a $ref child ("${T}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let m=Zr(o.tagName,p),g=m.includes("-")&&customElements.get(m);if(o.$props&&g)return ds(o,p,d,f);if(o.$props){if(m.includes("-"))return ds(o,p,d,f);let{$props:T,...A}=o;return Oe(A,$u(o,p),d)}if(o.$switch)return xu(o,p,d);let h=lu(m,d?._ns),y=m==="foreignObject"?null:h,E=h?document.createElementNS(h,m):document.createElement(m);if(d?.onNodeCreated)d.onNodeCreated(E,f,o,p);if(Yr(E,o,p),o.style&&m.includes("-"))Xr.set(E,o.style);Fn(E,o.style??{},jn(p),p),Wn(E,o.attributes??{},p);let C=o.children;if(S(C)){let T=d||y?{...d,_ns:y,_path:[...f,"children"]}:void 0;Vr(E,C,p,T)}else if(Array.isArray(C))for(let T=0;T<C.length;T++){let A=C[T],H=d||y?{...d,_ns:y,_path:[...f,"children",T]}:void 0;if(S(A))Vr(E,A,p,H);else E.append(Oe(A,p,H))}return E}function Yr(o,a,d){for(let[f,p]of Object.entries(a)){if(Gt.has(f))continue;if(f.startsWith("$"))continue;if(f.startsWith("on")&&Is(o,f,p,d))continue;js(o,f,p,d)}}function Is(o,a,d,f){let p=a.slice(2),m=f;if(r(d)){let g=Se(d.$ref,f);if(iu(g))o.addEventListener(p,(h)=>g(m,h));return!0}if(O(d)){let{body:g}=d;return o.addEventListener(p,(h)=>{mt(g,m,h)}),!0}if(v(d)&&e(d.body)){let g=Fr(d),h=Function(...g,d.body);return o.addEventListener(p,(y)=>h(m,y)),!0}if(b(d)){let g=d.$expression;return o.addEventListener(p,(h)=>Ce(g,m,h)),!0}return!1}function cu(o,a,d){for(let[f,p]of Object.entries(a))if(f.startsWith("on")&&!Gt.has(f))Is(o,f,p,d)}function js(o,a,d,f){let p=Hn(o),m=Xc(a,d,f);if(m)o.dataset.jxBoundProp=m;let g=(y)=>e(y)?qr(o.tagName,a,y):y,h=(y)=>{let E=o;if(a==="className"&&!(E instanceof HTMLElement)){E.setAttribute("class",y==null?"":String(y));return}if(p[a]===y)return;p[a]=y};if(r(d)){let y=d;if(a==="id"){p[a]=Se(y.$ref,f);return}we(()=>{h(g(Se(y.$ref,f)))});return}if(c(d)){let y=d;In(y,()=>{h(g(Ye(y,f)))});return}h(g(d))}function ts(o,a){let d=[];return{detach:a,insert(f){let p=[];for(let g of f){let h=o.cssRules.length;try{o.insertRule(g,h)}catch{continue}let y=o.cssRules[h];if(y)p.push(y)}let m={rules:p,texts:f};return d.push(m),m},remove(f){let p=d.indexOf(f);if(p!==-1)d.splice(p,1);if(f.rules.length===0)return;let m=[...o.cssRules],g=f.rules.map((h)=>m.indexOf(h)).filter((h)=>h>=0).toSorted((h,y)=>y-h);for(let h of g)o.deleteRule(h);f.rules.length=0},replaceAll(f){d.length=0,d.push({rules:[],texts:f}),o.replaceSync(f.join(`
3
+ `))},text(){return d.flatMap((f)=>f.texts.join(`
4
4
  `)).join(`
5
- `)}}}function Gl(e){let t=[],n=()=>{e.textContent=t.map((r)=>r.texts.join(`
5
+ `)}}}function uu(o){let a=[],d=()=>{o.textContent=a.map((f)=>f.texts.join(`
6
6
  `)).join(`
7
- `)};return{detach(){e.remove()},insert(r){let o={rules:[],texts:r};return t.push(o),n(),o},remove(r){let o=t.indexOf(r);if(o!==-1)t.splice(o,1),n()},replaceAll(r){t.length=0,t.push({rules:[],texts:r}),n()},text(){return e.textContent??""}}}function ei(e){let n=e.defaultView?.CSSStyleSheet;if(typeof n==="function"&&Array.isArray(e.adoptedStyleSheets))try{let o=new n;return e.adoptedStyleSheets=[...e.adoptedStyleSheets,o],Ts(o,()=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((s)=>s!==o)})}catch{}let r=e.createElement("style");return r.dataset.jxSheet="",(e.head??e.documentElement).append(r),r.sheet?Ts(r.sheet,()=>r.remove()):Gl(r)}var Ct=new WeakMap;function Yl(e){let t=Ct.get(e);if(t)return t;let n={hoisted:new Map,interned:new Map,scratch:null,scratchOwners:new Map,serial:0,shared:ei(e)};return Ct.set(e,n),n}var pn=new WeakMap,As="\x01jx-scope\x01";function ti(e){e.scratch.replaceAll([...e.scratchOwners.values()].flat())}function Cs(e,t,n){let r=t.get(n);if(r.refs-=1,r.refs<=0)t.delete(n),e.shared.remove(r.inserted)}function Ps(e,t,n,r){let o=t.get(n);if(o){o.refs+=1;return}t.set(n,{inserted:e.shared.insert(r),refs:1})}function mn(e,t){let n=pn.get(e);if(!n||t!==void 0&&n!==t)return;pn.delete(e),n.stop?.();for(let o of n.vars)e.style.removeProperty(o);if(delete e.dataset.jx,Ct.get(n.doc)!==n.state)return;let{state:r}=n;if(n.interned===null){if(r.scratchOwners.delete(e))ti(r)}else Cs(r,r.interned,n.interned);for(let o of n.hoisted)Cs(r,r.hoisted,o)}function ni(e=document){let t=Ct.get(e);if(!t)return;Ct.delete(e);for(let n of t.scratchOwners.keys())pn.delete(n),delete n.dataset.jx;t.scratchOwners.clear(),t.interned.clear(),t.hoisted.clear(),t.shared.detach(),t.scratch?.detach()}function Xl(e){return Boolean(e)&&typeof e==="object"&&"display"in e}var $r=new WeakMap;function ri(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t)){let s=n[r];n[r]=s!==null&&typeof s==="object"&&o!==null&&typeof o==="object"&&!Array.isArray(o)?ri(s,o):o}return n}function wn(e,t,n={},r={}){oi(e,t,n,r,!1)}function En(e,t,n={},r={}){oi(e,t??{},n,r,!0)}function oi(e,t,n,r,o){mn(e);let s=e.ownerDocument??document,i=Yl(s),a=(Tr||Ar)&&wr(e)?(x)=>ur(x,{dialog:e.tagName==="DIALOG"}):(x)=>x,c=-1,l=0,u=[],f=kt(t,{mediaQueries:n,resolveValue:(x,S,A)=>{if(A==="self"&&x.startsWith("--"))return u.push({name:x,value:S}),null;if(c<0)({serial:c}=i),i.serial+=1;let C=`--jx-r${c}-${l}`;return l+=1,u.push({name:C,value:S}),`var(${C})`},scope:As,transposeSelector:a,transposeValue:dn});if(f.length===0&&u.length===0)return;let d=f.filter((x)=>x.target!=="unscoped"),m=f.filter((x)=>x.target==="unscoped");for(let x of m)Ps(i,i.hoisted,x.text,[x.text]);let w=`jx-${Et(d.map((x)=>x.key).join("|"))}`,y=d.map((x)=>x.text.replaceAll(As,`[data-jx="${w}"]`));if(y.length>0)if(e.dataset.jx=w,o)i.scratch??=ei(s),i.scratchOwners.set(e,y),ti(i);else Ps(i,i.interned,w,y);let h={doc:s,hoisted:m.map((x)=>x.text),interned:y.length>0&&!o?w:null,state:i,stop:null,uid:w,vars:u.map((x)=>x.name)};if(u.length>0){let x=Ge();x.run(()=>{for(let{name:S,value:A}of u)G(()=>{let C=U(A)?Y(A.$ref,r):ke(A,r);e.style.setProperty(S,dn(String(C??"")))})}),h.stop=()=>x.stop()}pn.set(e,h),Qt(()=>mn(e,h),!0)}var Zl=new Set(["contenteditable","draggable","spellcheck"]);function Ql(e,t){let n=e.toLowerCase();if(n.startsWith("aria-")||Zl.has(n))return String(t);return t?"":null}function vn(e,t,n){for(let[r,o]of Object.entries(t)){let s=Ml(e,r),i=(a)=>{if(a===null||a===void 0){e.removeAttribute(s);return}if(typeof a==="boolean"){let c=Ql(s,a);if(c===null)e.removeAttribute(s);else e.setAttribute(s,c);return}e.setAttribute(s,Cr(e.tagName,r,String(a)))};if(U(o))G(()=>i(Y(o.$ref,n)));else if(le(o))G(()=>i(Bl(o,n)));else i(o)}}function vr(e,t,n,r){let o=r?._path??[],s=document.createComment("jx-array");e.append(s);let{items:i,map:a,filter:c,sort:l,key:u}=t,f=U(u)?u.$ref:null,d=Qe,m=!1,w=(v)=>{if(!m)m=!0,console.warn(`Jx $map: ${v}`)},y=[],h=(v)=>{v.scope.stop(),v.node.remove()},x=(v,P,E)=>{let _=Yo({index:E,item:P}),R=Object.create(n);R.$map=_,Object.defineProperty(R,"$map/item",{enumerable:!0,get:()=>_.item}),Object.defineProperty(R,"$map/index",{enumerable:!0,get:()=>_.index});let I=Ge(!0),te=r?{...r,_path:[...o,"map",E]}:void 0,b=I.run(()=>de(a,R,te));return{key:v,map:_,node:b,scope:I}},S=(v,P)=>{let E=new Map;for(let I of y)E.set(I.key,I);let _=[];for(let I=0;I<v.length;I++){let te=P[I],b=v[I],k=E.get(te);if(k){if(E.delete(te),k.map.item!==b)k.map.item=b;if(k.map.index!==I)k.map.index=I,r?.onNodeMoved?.(k.node,[...o,"map",I]);_.push(k)}else _.push(x(te,b,I))}for(let I of E.values())h(I);let R=y.find((I)=>!E.has(I.key))?.node??s;for(let I of _){if(I.node===R){R=R.nextSibling??s;continue}R.before(I.node)}y=_},A=()=>{let v=U(i)?Y(i.$ref,n):i;if(Array.isArray(v)&&U(c)){let R=Y(c.$ref,n);if(typeof R==="function")v=v.filter(R)}if(Array.isArray(v)&&U(l)){let R=Y(l.$ref,n);if(typeof R==="function")v=[...v].toSorted(R)}let P=Array.isArray(v)&&a?v:[],E=P.map((R,I)=>ec(f,R,I,w)),_=new Set;for(let R=0;R<E.length;R++)if(_.has(E[R]))w(`duplicate key ${String(E[R])} — every occurrence after the first is rebuilt on each change`),E[R]={duplicate:R};else _.add(E[R]);en();try{gn(Sr(d),()=>S(P,E))}finally{tn()}},C=!1,T=!1,g=G(A,{scheduler:()=>{if(C)return;C=!0,queueMicrotask(()=>{if(C=!1,!T)g()})}});Qt(()=>{T=!0;for(let v of y)h(v);y=[]},!0)}function ec(e,t,n,r){if(e===null)return n;if(e==="$map/item")return t;if(e.startsWith("$map/item/")){let o=fe(t,e.slice(10));if(o===void 0||o===null)return r(`key "${e}" is empty for some items — those rows fall back to their index`),n;return o}return r(`key "${e}" is not a $map/item pointer — rows fall back to their index`),n}function Nr(e,t){if(typeof e==="string")return e;if(!Vn(e))return"div";let n=e.$expression;if(n.operator==="?:")return Je(n.target,t,null)?n.value:n.initial;let r=Je(n.target,t,null);return n.cases[String(r)]??n.default}function tc(e,t,n){let r=n?._path??[],o=document.createElement(Nr(e.tagName,t)),s=Qe;if(n?.onNodeCreated)n.onNodeCreated(o,r,e,t);Rr(o,e,t),wn(o,e.style??{},t.$media??{},t),vn(o,e.attributes??{},t);let i=0,a=null,c=null,l=()=>{a?.stop(),a=null};return G(()=>{if(!U(e.$switch)){l(),o.replaceChildren(),i+=1;return}let u=String(Y(e.$switch.$ref,t));if(u===c)return;c=u,l(),o.replaceChildren(),i+=1;let f=e.cases?.[u];if(!f)return;let d=i,m=Ge(!0);a=m;let w=n?{...n,_path:[...r,"cases",u]}:void 0;if(U(f)){let{href:y}=new URL(f.$ref,n?._ctx?.base??location.href);kr(y,n?._ctx).then(async(h)=>{if(d!==i)return;let x=await bn(h,{},y,n?._ctx);if(d!==i)return;o.replaceChildren(),gn(Sr(s),()=>m.run(()=>o.append(de(h,x,w))))}).catch((h)=>console.error("Jx $switch: failed to load external case",f.$ref,h));return}en();try{gn(Sr(s),()=>m.run(()=>o.append(de(f,t,w))))}finally{tn()}}),Qt(l,!0),o}async function nc(e,t,n,r,o){if(e.$src)return rc(e,t,n,r);switch(e.$prototype){case"Request":{let s=ue(null),i=e.debounce??0,a=null;if(!e.manual&&!(o?.skipAutoRequests??Is.skip))G(()=>{let c;if(le(e.url))c=ke(e.url,t);else({url:c}=e);if(!c||c==="undefined"||c.includes("undefined"))return;let l=new AbortController;nn(()=>{if(l.abort(),a!==null)clearTimeout(a)});let u=()=>fetch(c,{method:e.method??"GET",signal:l.signal,...e.headers&&{headers:e.headers},...e.body&&{body:typeof e.body==="object"?JSON.stringify(e.body):e.body}}).then((f)=>f.ok?f.json():Promise.reject(f.statusText)).then((f)=>{s.value=f}).catch((f)=>{if(!(f instanceof Error&&f.name==="AbortError"))s.value={error:String(f)}});if(i>0)a=setTimeout(u,i);else u()});return s}case"URLSearchParams":return bt(()=>{let s={};for(let[i,a]of Object.entries(e))if(i!=="$prototype")s[i]=U(a)?Y(a.$ref,t):le(a)?ke(a,t):a;return new URLSearchParams(s).toString()});case"LocalStorage":case"SessionStorage":{let s=e.$prototype==="LocalStorage"?localStorage:sessionStorage,i=e.key??n,a;try{let l=s.getItem(i);a=l!==null?JSON.parse(l):e.default??null}catch{a=e.default??null}let c=ue(a);return G(()=>{let l=c.value;if(l===null)try{s.removeItem(i)}catch{}else try{s.setItem(i,JSON.stringify(l))}catch{}}),c}case"Cookie":{let s=e.name??n,a=ue((()=>{let c=vs(document.cookie,s);if(c===null)return null;try{return JSON.parse(decodeURIComponent(c))}catch{return c}})()??e.default??null);return G(()=>{document.cookie=Ss(s,a.value,e)}),a}case"IndexedDB":{let s=ue(null),{database:i,store:a,version:c=1,keyPath:l="id",autoIncrement:u=!0,indexes:f=[]}=e;if(!i||!a)throw Error(`Jx: IndexedDB entry '${n}' requires database and store`);let d=indexedDB.open(i,c);return d.addEventListener("upgradeneeded",(m)=>{let w=m.target.result;if(!w.objectStoreNames.contains(a)){let y=w.createObjectStore(a,{autoIncrement:u,keyPath:l});for(let h of f)y.createIndex(h.name,h.keyPath,{unique:h.unique??!1})}}),d.addEventListener("success",(m)=>{let w=m.target.result;s.value={database:i,getStore:(y="readwrite")=>Promise.resolve(w.transaction(a,y).objectStore(a)),isReady:!0,store:a,version:c}}),d.addEventListener("error",()=>{s.value={error:d.error?.message}}),s}case"Set":return new Set(Array.isArray(e.default)?e.default:[]);case"Map":return new Map(Object.entries(se(e.default)?e.default:{}));case"FormData":{let s=new FormData;for(let[i,a]of Object.entries(e.fields??{}))s.append(i,a);return s}case"Blob":return new Blob(e.parts??[],{type:typeof e.type==="string"?e.type:"text/plain"});case"ReadableStream":return null;default:return console.warn(`Jx: unknown $prototype "${e.$prototype}" for "${n}". Did you mean to add '$src'?`),ue(null)}}var Mr=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);async function rc(e,t,n,r){let o=e.$src;if(!o||!o.endsWith(".class.json"))throw Error(`Jx: $prototype "${e.$prototype}" requires a .class.json $src, got "${o}". Wrap the class in a .class.json schema with $implementation.`);return sc(e,t,n,r)}async function oc(e,t,n,r){let o,s=Pr(t);if(s instanceof Promise)o=await s;else if(s)o=s;else{try{o=await import(t)}catch{if(r)o=await import(new URL(t,r).href);else throw Error(`Failed to import "${t}"`)}et.set(t,o)}let i=o[n]??o.default?.[n];if(!i)throw Error(`Jx: export "${n}" not found in "${t}"`);if(typeof i!=="function")throw TypeError(`Jx: "${n}" from "${t}" is not a class`);let a={};for(let[d,m]of Object.entries(e))if(!Mr.has(d))a[d]=m;let l=new i(a),u;if(typeof l.resolve==="function")u=await l.resolve();else if("value"in l)({value:u}=l);else u=l;let f=ue(u);if(typeof l.subscribe==="function")l.subscribe((d)=>{f.value=d});return f}async function sc(e,t,n,r){let o=e.$src,s;if(!o.startsWith(".")&&!o.startsWith("/")&&!o.startsWith("http")&&!o.startsWith("file:"))return un(e,t,n,r);try{let d=r?new URL(o,r).href:o,m=await fetch(d);if(!m.ok)throw Error(`HTTP ${m.status}`);s=await m.json()}catch{return un(e,t,n,r)}if(s.$implementation){if(JSON.stringify(s).includes('"#/$context/'))return un(e,t,n,r);let m=r?new URL(o,r).href:new URL(o,location.href).href,w=new URL(s.$implementation,m).href,y=e.$export??s.title??e.$prototype;try{return await oc(e,w,y,r)}catch{return un(e,t,n,r)}}let a=ic(s),c={};for(let[d,m]of Object.entries(e))if(!Mr.has(d))c[d]=m;let l=new a(c),u;if(typeof l.resolve==="function")u=await l.resolve();else if("value"in l)({value:u}=l);else u=l;let f=ue(u);if(typeof l.subscribe==="function")l.subscribe((d)=>{f.value=d});return f}function ic(e){let t=e.$defs?.fields??{},n=e.$defs?.constructor,r=typeof n==="object"?n:void 0,o=e.$defs?.methods??{};class s{constructor(a={}){for(let[c,l]of Object.entries(t)){let u=l.identifier??c,f=l.access==="private"?`_${u}`:u;if(a[u]!==void 0)this[f]=a[u];else if(l.initializer!==void 0)this[f]=l.initializer;else if(l.default!==void 0)this[f]=structuredClone(l.default);else this[f]=null}if(r?.body){let c=Array.isArray(r.body)?r.body.join(`
8
- `):r.body;Function("config",c).call(this,a)}}}for(let[a,c]of Object.entries(o)){let l=c.identifier??a,u=(c.parameters??[]).map((d)=>{if(d.$ref)return d.$ref.split("/").pop();let m=d.identifier??d.name;return typeof m==="string"?m:"arg"}),f=Array.isArray(c.body)?c.body.join(`
9
- `):c.body??"";if(c.role==="accessor"){let d={};if(c.getter)d.get=Function(c.getter.body??"");if(c.setter){let m=(c.setter.parameters??[]).map((w)=>w.$ref?.split("/").pop()??"v");d.set=Function(...m,c.setter.body??"")}Object.defineProperty(s.prototype,l,{...d,configurable:!0})}else if(c.scope==="static")s[l]=Function(...u,f);else s.prototype[l]=Function(...u,f)}return Object.defineProperty(s,"name",{configurable:!0,value:e.title}),s}async function un(e,t,n,r){let o={};for(let[c,l]of Object.entries(e))if(!Mr.has(c))o[c]=l;let s=Object.values(o).some((c)=>le(c)),i=(c)=>fetch(Hs("/__jx_resolve__"),{body:JSON.stringify({$base:r,$export:e.$export,$prototype:e.$prototype,$src:e.$src,...c}),headers:{"Content-Type":"application/json"},method:"POST"}).then((l)=>{if(!l.ok)throw Error(`Jx dev proxy ${l.status} for "${n}"`);return l.json()}),a=ue(null);if(s)G(()=>{let c={};for(let[l,u]of Object.entries(o))c[l]=le(u)?ke(u,t):u;i(c).then((l)=>{a.value=l}).catch((l)=>console.error("Jx dev proxy:",l))});else i(o).then((c)=>{a.value=c}).catch((c)=>console.error("Jx dev proxy:",c));return a}function si(e,t,n){let r=0;return(o)=>{r+=1;let s=r;new Promise((i)=>{i(t(o))}).then((i)=>{if(s===r)e.value=i}).catch((i)=>{if(s===r)console.error(n,i)})}}async function ac(e,t,n,r){let{$src:o,$export:s}=e,i=Ys.has(o)?Pr(o):void 0;if(!i)return lc(e,t,n,r);let a=i instanceof Promise?await i:i,c=a[s]??a.default?.[s];if(!c)throw Error(`Jx: export "${s}" not found in "${o}" for "${n}"`);if(typeof c!=="function")throw TypeError(`Jx: "${s}" from "${o}" is not a function`);let l=c,u=e.arguments??{},f=Object.values(u).some((w)=>U(w)),d=()=>{let w={};for(let[y,h]of Object.entries(u))w[y]=U(h)?Y(h.$ref,t):h;return w},m=ue(null);if(f){let w=si(m,l,"Jx server function:");G(()=>{let y=d();nn(()=>{}),w(y)})}else m.value=await l(d());return m}async function lc(e,t,n,r){let o=e.arguments??{},s=Object.values(o).some((u)=>U(u)),i=()=>{let u={};for(let[f,d]of Object.entries(o))u[f]=U(d)?Y(d.$ref,t):d;return u},a=(u)=>fetch(Hs("/__jx_server__"),{body:JSON.stringify({$base:r,$export:e.$export,$src:e.$src,arguments:u}),headers:{"Content-Type":"application/json"},method:"POST"}).then((f)=>{if(!f.ok)throw Error(`Jx server proxy ${f.status} for "${n}"`);return f.json()}),c=ue(null),l=si(c,a,"Jx server proxy:");if(s)G(()=>{let u=i();nn(()=>{}),l(u)});else l(i());return c}function Y(e,t){if(typeof e!=="string")return e;if(e.startsWith("$map/")||e.startsWith("#/$map/")){let n=(e.startsWith("#/")?e.slice(2):e).split("/"),[,r]=n,s=t.$map?.[r]??t[`$map/${r}`];return n.length>2?yr(s,n.slice(2).join("/")):s}if(e.startsWith("#/state/"))return fe(t,e.slice(8));if(e.startsWith("parent#/"))return fe(t,e.slice(8));if(e.startsWith("window#/"))return yr(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return yr(globalThis.document,e.slice(10));return fe(t,e)??null}function U(e){return De(e)}function yr(e,t){return fe(e,t)}function Rs(e,t,n,r){let o=t.replaceAll(/-([a-z])/g,(i,a)=>a.toUpperCase()),s=e[o];if(typeof s==="boolean"){e[o]=n!==null&&n!=="false";return}if(n===null){let i=r?.get(o);e[o]=i===void 0?typeof s==="number"?0:"":i;return}e[o]=typeof s==="number"?Number(n):n}function cc(e){let t=new Map;for(let[n,r]of Object.entries(e.state??{})){if(r!==null&&typeof r==="object"){let o=r;if("default"in o){t.set(n,o.default);continue}if(uc.some((s)=>(s in o)))continue}t.set(n,r)}return t}var uc=["$expression","$prototype","$ref","$src"],$s=new Set;function fc(e,t){if(Object.hasOwn(e,t))return!0;if(e.hasAttribute(t))return!0;let n=t.replaceAll(/[A-Z]/gu,(r)=>`-${r.toLowerCase()}`);return n!==t&&e.hasAttribute(n)}function hn(e,t){if(!Vt(e))return!1;let n=t===void 0?e:`${t}:${e}`;if(!$s.has(n))$s.add(n),console.warn(`Jx: "${e}" is private state (spec.md §5.6) and cannot be set through $props`+`${t===void 0?"":` (${t})`}. The write was ignored; rename the entry without the leading # to make it part of the component's interface.`);return!0}function dc(e,t){let n=Object.create(t);for(let[r,o]of Object.entries(e.$props??{})){if(hn(r,"$props"))continue;n[r]=U(o)?Y(o.$ref,t):o}return n}var ii={},At=new Map;async function ai(e,t){let n=t??location.href,{tagName:r}=e;if(!r||!r.includes("-"))throw Error(`Jx redefineElement: tagName "${r}" must contain a hyphen`);if(!customElements.get(r)){await Rt(e,n);return}if(e.$elements)await _r(e.$elements,n);let o=At.get(r)?.doc.observedAttributes??[],s=e.observedAttributes??[];if(JSON.stringify(o)!==JSON.stringify(s))console.warn(`Jx redefineElement: <${r}> keeps observedAttributes [${o.join(", ")}] as first defined; [${s.join(", ")}] takes effect only in a fresh realm`);At.set(r,{base:n,doc:e})}function li(e){ii=e??{}}async function _r(e,t,n){for(let r of e){if(typeof r==="string"){try{await import(r.startsWith("/")||r.startsWith(".")?r:`/node_modules/${r}`)}catch(i){console.warn(`Jx: failed to import package "${r}"`,i)}continue}if(!U(r))continue;let{href:o}=new URL(r.$ref,t),s=await kr(o,n);if(!s.tagName||!s.tagName.includes("-"))continue;if(customElements.get(s.tagName))continue;if(s.$elements)await _r(s.$elements,o,n);await Rt(s,o)}}var Ns=32,pc={expansion:0,frames:[]},Qe=pc;function gn(e,t){let n=Qe;Qe=e;try{return t()}finally{Qe=n}}function Sr(e){return{expansion:e.frames.length,frames:e.frames}}function mc(e,t){if(Object.is(e,t))return!0;if(!Ms(e)||!Ms(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function Ms(e){if(typeof e!=="object"||e===null)return!1;let t=j(e);if(Array.isArray(t))return!0;let n=Object.getPrototypeOf(t);return n===Object.prototype||n===null}function hc(e,t){if(e.tag!==t.tag)return!1;let n=Object.keys(e.props);if(n.length!==Object.keys(t.props).length)return!1;return n.every((r)=>Object.hasOwn(t.props,r)&&mc(e.props[r],t.props[r]))}function gc(e,t){let n=[...e.frames.map((r)=>r.tag),t.tag].join(" → ");if(e.frames.slice(e.expansion).some((r)=>hc(r,t)))throw Error(`Component <${t.tag}> renders itself: ${n}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(e.frames.length>=Ns)throw Error(`Component nesting exceeds ${Ns} levels: ${n}. A component that renders itself with changing props needs a case that stops.`);return{expansion:e.expansion,frames:[...e.frames,t]}}var _s=new Set;async function Rt(e,t){let n=t,r=e;if(typeof e==="string"){if(n=new URL(e,n??location.href).href,_s.has(n))return;_s.add(n),r=await kr(e)}n??=location.href;let o=r,{tagName:s}=o;if(!s||!s.includes("-"))throw Error(`Jx defineElement: tagName "${s}" must contain a hyphen`);if(customElements.get(s))return;if(o.$elements)await _r(o.$elements,n);At.set(s,{base:n,doc:o});let i=o,a=n,c=i.observedAttributes??[],l=class extends HTMLElement{_jxInitialized=!1;_state=null;static get observedAttributes(){return c}async connectedCallback(){if(this.dataset.jxDefinitionRoot!==void 0)return;if(this._jxInitialized)return;this._jxInitialized=!0;let u=Qe,f={},d=At.get(s)??{base:a,doc:i},{doc:m,base:w}=d,y=await bn(m,{},w,{base:w,media:null,root:this});for(let E of c)if(this.hasAttribute(E))Rs(y,E,this.getAttribute(E)),f[E]=this.getAttribute(E);let h=this.dataset.jxProps;if(h){try{let E=JSON.parse(h);for(let[_,R]of Object.entries(E)){if(hn(_,"data-jx-props"))continue;if(_ in(m.state??{}))y[_]=R,f[_]=R}}catch{}delete this.dataset.jxProps}let x=this.getAttributeNames().filter((E)=>E.startsWith("props.")&&E.length>6);for(let E of x){let _=E.slice(6);if(hn(_,"props.* attribute")){this.removeAttribute(E);continue}if(_ in(m.state??{}))y[_]=this.getAttribute(E),f[_]=this.getAttribute(E),this.removeAttribute(E)}for(let E of Object.keys(m.state??{})){if(Vt(E))continue;if(E in this&&this[E]!==void 0&&fc(this,E))y[E]=this[E],f[E]=this[E]}let S;try{S=gc(u,{props:f,tag:s})}catch(E){if(this.replaceChildren(),!this.isConnected)return;console.error(`Jx: <${s}> was not rendered:`,E),this.dispatchEvent(new ErrorEvent("jx-error",{bubbles:!0,composed:!0,error:E,message:E instanceof Error?E.message:String(E)}));return}for(let E of Object.keys(m.state??{})){if(Vt(E))continue;if(!(E in HTMLElement.prototype))Object.defineProperty(this,E,{configurable:!0,get:()=>y[E],set:(_)=>{y[E]=_}})}this._state=y;let A=[...this.childNodes];this.replaceChildren();let C=Xl(m.style)?m.style:{display:"block",...m.style},T=ri(C,$r.get(this));if(wn(this,T,y.$media??{},y),vn(this,m.attributes??{},y),zl(this,m,y),!Array.isArray(m.children)&&m.textContent!==void 0)Qs(this,"textContent",m.textContent,y);let g=Array.isArray(m.children)?m.children:[],v=fn;fn||=this.dataset.jxPath!==void 0;try{gn(S,()=>{for(let E of g)this.append(de(E,y))})}finally{fn=v}xc(this,A);let{onMount:P}=y;if(typeof P==="function")queueMicrotask(()=>P(y,this))}disconnectedCallback(){if(typeof this._state?.onUnmount==="function")this._state.onUnmount(this._state)}adoptedCallback(){if(typeof this._state?.onAdopted==="function")this._state.onAdopted(this._state)}attributeChangedCallback(u,f,d){if(!this._state||f===d)return;Rs(this._state,u,d,cc(At.get(s)?.doc??i))}};customElements.define(s,l)}function Os(e,t,n,r){let o=document.createElement(Nr(e.tagName,t));if(n?.onNodeCreated)n.onNodeCreated(o,r??[],e,t);for(let[i,a]of Object.entries(e.$props??{})){if(hn(i,"$props"))continue;let c=(l)=>{o[i]=typeof l==="string"?Cr(o.tagName,i,l):l};if(U(a)){let l=a;c(Y(l.$ref,t)),G(()=>{c(Y(l.$ref,t))})}else if(le(a))G(()=>{c(ke(a,t))});else c(a)}if(e.style)$r.set(o,e.style);wn(o,e.style??{},t.$media??{},t),vn(o,e.attributes??{},t),Rr(o,e,t);let s=Array.isArray(e.children)?e.children:[];for(let i=0;i<s.length;i++){let a=s[i],c=n&&r?{...n,_path:[...r,"children",i]}:void 0;if(Kt(a))vr(o,a,t,c);else o.append(de(a,t,c))}return o}function xc(e,t){let n=e.querySelectorAll("slot");if(n.length===0)return;let r=new Map,o=[];for(let s of t)if(s.nodeType===Node.ELEMENT_NODE&&s.getAttribute("slot")){let i=s.getAttribute("slot");if(!r.has(i))r.set(i,[]);r.get(i).push(s)}else o.push(s);for(let s of n){let i=s.getAttribute("name"),a=i?r.get(i)??[]:o;s.replaceWith(...a.length>0?a:[...s.childNodes])}}function yc(e,t){if(typeof t!=="string"||t==="")return e;let n=e.indexOf("#"),r=n===-1?"":e.slice(n),o=n===-1?e:e.slice(0,n),s=o.indexOf("?"),i=s===-1?o:o.slice(0,s),c=(s===-1?[]:o.slice(s+1).split("&")).filter((l)=>l!==""&&!bc(l));return c.push(`v=${encodeURIComponent(t)}`),`${i}?${c.join("&")}${r}`}function bc(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 wc(e,t){if(!e||!Object.hasOwn(e,t))return;let n=e[t];return typeof n==="string"?n:void 0}function $t(e,t){if(!t||e==="")return null;if(t.space==="repo"){if(!t.fileBaseUrl)return null;let r=ys(e,t.documentDir,t.mounts,t.lanes);if(r===null)return null;let{suffix:o}=Tt(e);return yc(`${t.fileBaseUrl}${bs(r)}${o}`,wc(t.versions,r))}let[n]=t.mounts;return n?Ec(e,t.documentDir,n):null}function Ec(e,t,n){if(mr(e))return null;let{path:r,suffix:o}=Tt(e),s;try{s=decodeURIComponent(r)}catch{return null}let i=gr(t,s);if(i===null)return null;let a=xs([n],i);if(!a)return null;return`${a}${o}`}function je(e){return`[data-jx-path='${e.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function vc(e,t){if(!t)return!1;return e.length<=t.length&&e.every((n,r)=>t[r]===n)}function ci(e,t,n){let r=n.layoutWrapped&&typeof t==="object"?t?.$__layout:void 0;if(r){let s=typeof r==="object"?r:{};return{chrome:e.length>0&&!vc(e,n.pageContentPrefix),kind:"layout",layoutFile:typeof s.file==="string"?s.file:"",layoutPath:Array.isArray(s.path)?s.path:[]}}let o=e;if(n.layoutWrapped&&n.pageContentPrefix){let s=n.pageContentPrefix;if(e.length>=s.length&&s.every((i,a)=>e[a]===i)){let i=e.slice(s.length),[a]=i;o=typeof a==="number"?["children",a-(n.pageContentOffset??0),...i.slice(1)]:["children",...i]}}if(n.arrayPaths.size>0){let s=!0;while(s){s=!1;for(let i=1;i<o.length-1;i++)if(o[i]==="children"&&o[i+1]===0&&n.arrayPaths.has(o.slice(0,i).join("/"))){o=[...o.slice(0,i),"map",...o.slice(i+2)],s=!0;break}}}return{kind:"path",path:o}}function J(e){return JSON.stringify(e)}function q(e){return JSON.parse(e)}function ui(e){if(e.dataset.jxDefinitionRoot!==void 0)return!1;return e.getAttribute("contenteditable")==="false"||e.tagName.includes("-")}function Sn(e,t){let n=e instanceof Element?e:e?.parentElement??null;while(n){if(n instanceof HTMLElement){if(n.dataset.jxPath&&t(n))return{el:n,path:q(n.dataset.jxPath)};if(ui(n))return null}n=n.parentElement}return null}function kn(e,t){let n=e.querySelector(je(J(t)));return n instanceof HTMLElement?n:null}function Or(e){return e.textContent?.length??0}function Sc(e,t,n){if(!e.contains(t))return null;let r=e.ownerDocument.createRange();r.setStart(e,0);try{r.setEnd(t,n)}catch{return null}return r.toString().length}function kc(e,t){let n=Math.max(0,Math.min(t,Or(e))),r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),o=0,s=null,i=r.nextNode();while(i){let a=i.length;if(o+a>=n)return{node:i,offset:n-o};o+=a,s=i,i=r.nextNode()}return s?{node:s,offset:s.length}:{node:e,offset:0}}function Nt(e,t,n){let r=Sn(e,n);if(!r||!e)return null;let o=Sc(r.el,e,t);return o===null?null:{offset:o,path:r.path}}function Dr(e,t){let n=kn(e,t.path);return n?kc(n,t.offset):null}function fi(e){return e.offset<=0}function Mt(e,t){return J(e.path)===J(t.path)}function Lr(e,t){let n=[];for(let r of e.querySelectorAll("[data-jx-path]"))if(t(r)&&!Tc(r,e))n.push(r);return n}function Tc(e,t){let n=e.parentElement;while(n&&n!==t){if(ui(n))return!0;n=n.parentElement}return!1}function di(e,t,n,r){let o=Lr(e,r),s=J(t),i=o.findIndex((c)=>c.dataset.jxPath===s),a=i===-1?void 0:o[i+n];return a?{el:a,path:q(a.dataset.jxPath)}:null}var Ir="jx-site-style";function pi(e,t,n,r){let o=[],s=(u,f)=>{for(let d of kt(u,{mediaQueries:t,scope:f,transposeValue:n,...r?{resolveValue:(m,w)=>r(m,w,f)}:{}}))o.push(d.text)},i={},a={},c=[],l=[];for(let[u,f]of Object.entries(e)){if(f!==null&&typeof f==="object"&&!Array.isArray(f)){if(u.startsWith("@"))c.push([u,f]);else if(!u.startsWith("--"))l.push([u,f]);continue}if(St(u)||u.startsWith("@"))continue;if(u.startsWith("--")||u==="colorScheme"||u==="color-scheme")i[u]=f;else a[u]=f}s(i,":root"),s(a,"body");for(let[u,f]of l)if(u.startsWith("&"))s({[u]:f},":root");else s(f,u);for(let[u,f]of c){if(wt(u)||vt(u)){s({[u]:f},null);continue}let d={},m={},w=[];for(let[y,h]of Object.entries(f)){if(h!==null&&typeof h==="object"&&!Array.isArray(h)){if(!y.startsWith("@"))w.push([y,h]);continue}if(y.startsWith("--"))d[y]=h;else m[y]=h}s({[u]:d},":root"),s({[u]:m},"body");for(let[y,h]of w)s({[u]:h},y)}if(Object.values(t).some((u)=>an(u)!==null)&&!("colorScheme"in e))o.push(":root { color-scheme: light dark }",`:root:where([${$e}="light"]) { color-scheme: light }`,`:root:where([${$e}="dark"]) { color-scheme: dark }`);return o.join(`
10
- `)}async function Ac(e,t){let n=e.$elements;if(!Array.isArray(n))return;await Promise.all(n.map(async(r)=>{let o=(async()=>{if(typeof r==="string")await import(r.startsWith("/")||r.startsWith(".")?r:`/node_modules/${r}`);else if(r&&typeof r==="object"&&"$ref"in r)await Rt(new URL(String(r.$ref),t).href);else if(r&&typeof r==="object")await Rt(r,t)})();try{await Promise.race([o,new Promise((s,i)=>{setTimeout(()=>i(Error("register timeout")),5000)})])}catch(s){console.warn("iframe canvas: failed to register element",JSON.stringify(r),s)}}))}var mi="jx-canvas-edit-css",Cc=`
7
+ `)};return{detach(){o.remove()},insert(f){let p={rules:[],texts:f};return a.push(p),d(),p},remove(f){let p=a.indexOf(f);if(p!==-1)a.splice(p,1),d()},replaceAll(f){a.length=0,a.push({rules:[],texts:f}),d()},text(){return o.textContent}}}function Hs(o){let d=o.defaultView?.CSSStyleSheet;if(t(d)&&Array.isArray(o.adoptedStyleSheets))try{let p=new d;return o.adoptedStyleSheets=[...o.adoptedStyleSheets,p],ts(p,()=>{o.adoptedStyleSheets=o.adoptedStyleSheets.filter((m)=>m!==p)})}catch{}let f=o.createElement("style");return f.dataset.jxSheet="",(du(o)??o.documentElement).append(f),f.sheet?ts(f.sheet,()=>f.remove()):uu(f)}function du(o){return o.head}var zt=new WeakMap;function fu(o){let a=zt.get(o);if(a)return a;let d={hoisted:new Map,interned:new Map,scratch:null,scratchOwners:new Map,serial:0,shared:Hs(o)};return zt.set(o,d),d}var On=new WeakMap,ns="\x01jx-scope\x01";function Fs(o){o.scratch.replaceAll([...o.scratchOwners.values()].flat())}function rs(o,a,d){let f=a.get(d);if(f.refs-=1,f.refs<=0)a.delete(d),o.shared.remove(f.inserted)}function os(o,a,d,f){let p=a.get(d);if(p){p.refs+=1;return}a.set(d,{inserted:o.shared.insert(f),refs:1})}function kn(o,a){let d=On.get(o);if(!d||a!==void 0&&d!==a)return;On.delete(o),d.stop?.();for(let p of d.vars)o.style.removeProperty(p);if(delete o.dataset.jx,zt.get(d.doc)!==d.state)return;let{state:f}=d;if(d.interned===null){if(f.scratchOwners.delete(o))Fs(f)}else rs(f,f.interned,d.interned);for(let p of d.hoisted)rs(f,f.hoisted,p)}function Vs(o=document){let a=zt.get(o);if(!a)return;zt.delete(o);for(let d of a.scratchOwners.keys())On.delete(d),delete d.dataset.jx;a.scratchOwners.clear(),a.interned.clear(),a.hoisted.clear(),a.shared.detach(),a.scratch?.detach()}function pu(o){return n(o)&&"display"in o}var Xr=new WeakMap;function Ws(o,a){if(!a)return o;let d={...o};for(let[f,p]of Object.entries(a)){let m=d[f];d[f]=F(p)&&n(m)?Ws(Array.isArray(m)?Object.fromEntries(Object.entries(m)):m,p):p}return d}function Fn(o,a,d={},f={}){Bs(o,a,d,f,!1)}function Vn(o,a,d={},f={}){Bs(o,a??{},d,f,!0)}function Bs(o,a,d,f,p){kn(o);let m=o.ownerDocument,g=fu(m),h=(Kr||Ur)&&Hr(o)?(_)=>Rr(_,{dialog:o.tagName==="DIALOG"}):(_)=>_,y=-1,E=0,C=[],T=Bt(a,{mediaQueries:d,resolveValue:(_,Y,q)=>{if(q==="self"&&_.startsWith("--"))return C.push({name:_,value:Y}),null;let G;if(q==="self")G=`--jx-s${E}`;else{if(y<0)({serial:y}=g),g.serial+=1;G=`--jx-r${y}-${E}`}return E+=1,C.push({name:G,value:Y}),`var(${G})`},scope:ns,transposeSelector:h,transposeValue:$n});if(T.length===0&&C.length===0)return;let A=T.filter((_)=>_.target!=="unscoped"),H=T.filter((_)=>_.target==="unscoped");for(let _ of H)os(g,g.hoisted,_.text,[_.text]);let k=`jx-${Ft(A.map((_)=>_.key).join("|"))}`,K=A.map((_)=>_.text.replaceAll(ns,`[data-jx="${k}"]`));if(K.length>0)if(o.dataset.jx=k,p)g.scratch??=Hs(m),g.scratchOwners.set(o,K),Fs(g);else os(g,g.interned,k,K);let L={doc:m,hoisted:H.map((_)=>_.text),interned:K.length>0&&!p?k:null,state:g,stop:null,uid:k,vars:C.map((_)=>_.name)};if(C.length>0){let _=pt();_.run(()=>{for(let{name:Y,value:q}of C)we(()=>{let G=r(q)?Se(q.$ref,f):Ye(q,f);o.style.setProperty(Y,$n(String(G??"")))})}),L.stop=()=>_.stop()}On.set(o,L),Sn(()=>kn(o,L),!0)}var mu=new Set(["contenteditable","draggable","spellcheck"]);function hu(o,a){let d=o.toLowerCase();if(d.startsWith("aria-")||mu.has(d))return String(a);return a?"":null}function Wn(o,a,d){for(let[f,p]of Object.entries(a)){let m=Wc(o,f),g=(h)=>{if(h===null||h===void 0){o.removeAttribute(m);return}if(x(h)){let y=hu(m,h);if(y===null)o.removeAttribute(m);else o.setAttribute(m,y);return}o.setAttribute(m,qr(o.tagName,f,String(h)))};if(r(p))we(()=>g(Se(p.$ref,d)));else if(c(p))In(p,()=>g(Ms(p,d)));else g(p)}}function Vr(o,a,d,f){let p=f?._path??[],m=document.createComment("jx-array");o.append(m);let{items:g,map:h,filter:y,sort:E,key:C}=a,T=r(C)?C.$ref:null,A=yt,H=!1,k=(B)=>{if(!H)H=!0,console.warn(`Jx $map: ${B}`)},K=[],L=(B)=>{B.node.remove(),B.scope.stop()},_=(B,re,X)=>{let ce=xi({index:X,item:re}),ee=Gr(d);ee.$map=ce,Object.defineProperty(ee,"$map/item",{enumerable:!0,get:()=>ce.item}),Object.defineProperty(ee,"$map/index",{enumerable:!0,get:()=>ce.index});let ne=pt(!0),ve=f?{...f,_path:[...p,"map",X]}:void 0,V=ne.run(()=>Oe(h,ee,ve));return{key:B,map:ce,node:V,scope:ne}},Y=(B,re)=>{let X=new Map;for(let ne of K)X.set(ne.key,ne);let ce=[];for(let ne=0;ne<B.length;ne++){let ve=re[ne],V=B[ne],N=X.get(ve);if(N){if(X.delete(ve),N.map.item!==V)N.map.item=V;if(N.map.index!==ne)N.map.index=ne,f?.onNodeMoved?.(N.node,[...p,"map",ne]);ce.push(N)}else ce.push(_(ve,V,ne))}for(let ne of X.values())L(ne);let ee=K.find((ne)=>!X.has(ne.key))?.node??m;for(let ne of ce){if(ne.node===ee){ee=ee.nextSibling??m;continue}ee.before(ne.node)}K=ce},q=()=>{let B=r(g)?Se(g.$ref,d):g;if(Array.isArray(B)&&r(y)){let ee=Se(y.$ref,d);if(t(ee))B=B.filter(ee)}if(Array.isArray(B)&&r(E)){let ee=Se(E.$ref,d);if(t(ee)){let ne=ee;B=[...B].toSorted(ne)}}let re=Array.isArray(B)&&h?B:[],X=re.map((ee,ne)=>gu(T,ee,ne,k)),ce=new Set;for(let ee=0;ee<X.length;ee++)if(ce.has(X[ee]))k(`duplicate key ${String(X[ee])} — every occurrence after the first is rebuilt on each change`),X[ee]={duplicate:ee};else ce.add(X[ee]);Dt();try{Jn(Wr(A),()=>Y(re,X))}finally{Lt()}},G=!1,U=!1,M=we(q,{scheduler:()=>{if(G)return;G=!0,queueMicrotask(()=>{if(G=!1,!U)M()})}});Sn(()=>{U=!0;for(let B of K)L(B);K=[]},!0)}function gu(o,a,d,f){if(o===null)return d;if(o==="$map/item")return a;if(o.startsWith("$map/item/")){let p=he(a,o.slice(10));if(p===void 0||p===null)return f(`key "${o}" is empty for some items — those rows fall back to their index`),d;return p}return f(`key "${o}" is not a $map/item pointer — rows fall back to their index`),d}function Zr(o,a){if(e(o))return o;if(!J(o))return"div";let d=o.$expression;if(d.operator==="?:")return rt(d.target,a,null)?d.value:d.initial;let f=rt(d.target,a,null);return d.cases[String(f)]??d.default}function xu(o,a,d){let f=d?._path??[],p=document.createElement(Zr(o.tagName,a)),m=yt;if(d?.onNodeCreated)d.onNodeCreated(p,f,o,a);Yr(p,o,a),Fn(p,o.style??{},jn(a),a),Wn(p,o.attributes??{},a);let g=0,h=null,y=null,E=()=>{h?.stop(),h=null};return we(()=>{if(!r(o.$switch)){p.replaceChildren(),E(),g+=1;return}let C=String(Se(o.$switch.$ref,a));if(C===y)return;y=C,p.replaceChildren(),E(),g+=1;let T=o.cases?.[C];if(!T)return;let A=g,H=pt(!0);h=H;let k=d?{...d,_path:[...f,"cases",C]}:void 0;if(r(T)){let{href:K}=new URL(T.$ref,d?._ctx?.base??location.href);Br(K,d?._ctx).then(async(L)=>{if(A!==g)return;let _=await Ln(L,{},K,d?._ctx);if(A!==g)return;p.replaceChildren(),Jn(Wr(m),()=>H.run(()=>p.append(Oe(L,_,k))))}).catch((L)=>console.error("Jx $switch: failed to load external case",T.$ref,L));return}Dt();try{Jn(Wr(m),()=>H.run(()=>p.append(Oe(T,a,k))))}finally{Lt()}}),Sn(E,!0),p}var Mn=ze;async function yu(o,a,d,f,p){if(o.$src)return Su(o,a,d,f);switch(o.$prototype){case"Request":{let m=ze(null),g=o.debounce??0,h=null;if(!o.manual&&!(p?.skipAutoRequests??xs.skip))we(()=>{let y;if(c(o.url))y=Ye(o.url,a);else({url:y}=o);if(!y||y==="undefined"||y.includes("undefined"))return;let E=new AbortController;vn(()=>{if(E.abort(),h!==null)clearTimeout(h)});let C=()=>fetch(y,{method:o.method??"GET",signal:E.signal,...o.headers&&{headers:o.headers},...o.body&&{body:n(o.body)?JSON.stringify(o.body):o.body}}).then((T)=>T.ok?T.json():Promise.reject(T.statusText)).then((T)=>{m.value=T}).catch((T)=>{if(!(T instanceof Error&&T.name==="AbortError"))m.value={error:String(T)}});if(g>0)h=setTimeout(C,g);else C()});return m}case"URLSearchParams":return jt(()=>{let m={};for(let[g,h]of Object.entries(o))if(g!=="$prototype")m[g]=r(h)?Se(h.$ref,a):c(h)?Ye(h,a):h;return new URLSearchParams(m).toString()});case"LocalStorage":case"SessionStorage":{let m=o.$prototype==="LocalStorage"?localStorage:sessionStorage,g=o.key??d,h;try{let E=m.getItem(g);h=E!==null?JSON.parse(E):o.default??null}catch{h=o.default??null}let y=Mn(h);return we(()=>{let E=y.value;if(E===null)try{m.removeItem(g)}catch{}else try{m.setItem(g,JSON.stringify(E))}catch{}}),y}case"Cookie":{let m=o.name??d,h=Mn((()=>{let y=Ui(document.cookie,m);if(y===null)return null;try{return JSON.parse(decodeURIComponent(y))}catch{return y}})()??o.default??null);return we(()=>{document.cookie=qi(m,h.value,o)}),h}case"IndexedDB":{let m=ze(null),{database:g,store:h,version:y=1,keyPath:E="id",autoIncrement:C=!0,indexes:T=[]}=o;if(!g||!h)throw Error(`Jx: IndexedDB entry '${d}' requires database and store`);let A=indexedDB.open(g,y);return A.addEventListener("upgradeneeded",(H)=>{let k=H.target.result;if(!k.objectStoreNames.contains(h)){let K=k.createObjectStore(h,{autoIncrement:C,keyPath:E});for(let L of T)K.createIndex(L.name,L.keyPath,{unique:L.unique??!1})}}),A.addEventListener("success",(H)=>{let k=H.target.result;m.value={database:g,getStore:(K="readwrite")=>Promise.resolve(k.transaction(h,K).objectStore(h)),isReady:!0,store:h,version:y}}),A.addEventListener("error",()=>{m.value={error:A.error?.message}}),m}case"Set":return new Set(Array.isArray(o.default)?o.default:[]);case"Map":return new Map(Object.entries(s(o.default)?o.default:{}));case"FormData":{let m=new FormData;for(let[g,h]of Object.entries(o.fields??{}))m.append(g,h);return m}case"Blob":{let m=o.parts;return new Blob(m??[],{type:e(o.type)?o.type:"text/plain"})}case"ReadableStream":return null;default:return console.warn(`Jx: unknown $prototype "${o.$prototype}" for "${d}". Did you mean to add '$src'?`),ze(null)}}var bu=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);function Qr(o){let a={};for(let[d,f]of Object.entries(o))if(!bu.has(d))a[d]=f;return a}async function Su(o,a,d,f){let p=o.$src;if(!p||!p.endsWith(".class.json"))throw Error(`Jx: $prototype "${o.$prototype}" requires a .class.json $src, got "${p}". Wrap the class in a .class.json schema with $implementation.`);return Eu(o,a,d,f)}async function vu(o,a,d,f){let p,m=zr(a);if(m instanceof Promise)p=await m;else if(m)p=m;else{try{p=await ht(a)}catch{if(f){let C=new URL(a,f).href;p=await ht(C)}else throw Error(`Failed to import "${a}"`)}St.set(a,p)}let g=p[d]??p.default?.[d];if(!g)throw Error(`Jx: export "${d}" not found in "${a}"`);if(!t(g))throw TypeError(`Jx: "${d}" from "${a}" is not a class`);let h=new g(Qr(o)),y=t(h.resolve)?await h.resolve():("value"in h)?h.value:h,E=Mn(y);if(t(h.subscribe))h.subscribe((C)=>{E.value=C});return E}async function Eu(o,a,d,f){let p=o.$src,m;if(!p.startsWith(".")&&!p.startsWith("/")&&!p.startsWith("http")&&!p.startsWith("file:"))return Nn(o,a,d,f);try{let T=f?new URL(p,f).href:p,A=await fetch(T);if(!A.ok)throw Error(`HTTP ${A.status}`);m=await A.json()}catch{return Nn(o,a,d,f)}if(m.$implementation){if(JSON.stringify(m).includes('"#/$context/'))return Nn(o,a,d,f);let A=f?new URL(p,f).href:new URL(p,location.href).href,H=new URL(m.$implementation,A).href,k=o.$export??m.title??o.$prototype;try{return await vu(o,H,k,f)}catch{return Nn(o,a,d,f)}}let y=new(Tu(m))(Qr(o)),E=t(y.resolve)?await y.resolve():("value"in y)?y.value:y,C=Mn(E);if(t(y.subscribe))y.subscribe((T)=>{C.value=T});return C}function wu(o){return n(o)}function Tu(o){let a=o.$defs?.fields??{},d=o.$defs?.constructor,f=wu(d)?d:void 0,p=o.$defs?.methods??{};class m{constructor(g={}){for(let[h,y]of Object.entries(a)){let E=y.identifier??h,C=y.access==="private"?`_${E}`:E;if(g[E]!==void 0)this[C]=g[E];else if(y.initializer!==void 0)this[C]=y.initializer;else if(y.default!==void 0)this[C]=structuredClone(y.default);else this[C]=null}if(f?.body){let h=Array.isArray(f.body)?f.body.join(`
8
+ `):f.body;Function("config",h).call(this,g)}}}for(let[g,h]of Object.entries(p)){let y=h.identifier??g,E=(h.parameters??[]).map((T)=>{if(T.$ref)return T.$ref.split("/").pop()??"";let A=T.identifier??T.name;return e(A)?A:"arg"}),C=Array.isArray(h.body)?h.body.join(`
9
+ `):h.body??"";if(h.role==="accessor"){let T={};if(h.getter)T.get=Function(h.getter.body??"");if(h.setter){let A=(h.setter.parameters??[]).map((H)=>H.$ref?.split("/").pop()??"v");T.set=Function(...A,h.setter.body??"")}Object.defineProperty(m.prototype,y,{...T,configurable:!0})}else if(h.scope==="static")m[y]=Function(...E,C);else m.prototype[y]=Function(...E,C)}return Object.defineProperty(m,"name",{configurable:!0,value:o.title}),m}async function Nn(o,a,d,f){let p=Qr(o),m=Object.values(p).some((y)=>c(y)),g=(y)=>fetch(Ss("/__jx_resolve__"),{body:JSON.stringify({$base:f,$export:o.$export,$prototype:o.$prototype,$src:o.$src,...y}),headers:{"Content-Type":"application/json"},method:"POST"}).then((E)=>{if(!E.ok)throw Error(`Jx dev proxy ${E.status} for "${d}"`);return E.json()}),h=ze(null);if(m)we(()=>{let y={};for(let[E,C]of Object.entries(p))y[E]=c(C)?Ye(C,a):C;g(y).then((E)=>{h.value=E}).catch((E)=>console.error("Jx dev proxy:",E))});else g(p).then((y)=>{h.value=y}).catch((y)=>console.error("Jx dev proxy:",y));return h}function Ks(o,a,d){let f=0;return(p)=>{f+=1;let m=f;new Promise((g)=>{g(a(p))}).then((g)=>{if(m===f)o.value=g}).catch((g)=>{if(m===f)console.error(d,g)})}}async function Cu(o,a,d,f){let{$src:p,$export:m}=o,g=Ds.has(p)?zr(p):void 0;if(!g)return Au(o,a,d,f);let h=g instanceof Promise?await g:g,y=h[m]??h.default?.[m];if(!y)throw Error(`Jx: export "${m}" not found in "${p}" for "${d}"`);if(!t(y))throw TypeError(`Jx: "${m}" from "${p}" is not a function`);let E=y,C=o.arguments??{},T=Object.values(C).some((k)=>r(k)),A=()=>{let k={};for(let[K,L]of Object.entries(C))k[K]=r(L)?Se(L.$ref,a):L;return k},H=ze(null);if(T){let k=Ks(H,E,"Jx server function:");we(()=>{let K=A();vn(()=>{}),k(K)})}else H.value=await E(A());return H}async function Au(o,a,d,f){let p=o.arguments??{},m=Object.values(p).some((C)=>r(C)),g=()=>{let C={};for(let[T,A]of Object.entries(p))C[T]=r(A)?Se(A.$ref,a):A;return C},h=(C)=>fetch(Ss("/__jx_server__"),{body:JSON.stringify({$base:f,$export:o.$export,$src:o.$src,arguments:C}),headers:{"Content-Type":"application/json"},method:"POST"}).then((T)=>{if(!T.ok)throw Error(`Jx server proxy ${T.status} for "${d}"`);return T.json()}),y=ze(null),E=Ks(y,h,"Jx server proxy:");if(m)we(()=>{let C=g();vn(()=>{}),E(C)});else E(g());return y}function Se(o,a){if(!e(o))return o;if(o.startsWith("$map/")||o.startsWith("#/$map/")){let d=(o.startsWith("#/")?o.slice(2):o).split("/"),[,f]=d,m=a.$map?.[f]??a[`$map/${f}`];return d.length>2?he(m,d.slice(2).join("/")):m}if(o.startsWith("#/state/"))return he(a,o.slice(8));if(o.startsWith("parent#/"))return he(a,o.slice(8));if(o.startsWith("window#/"))return he(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return he(globalThis.document,o.slice(10));return he(a,o)??null}function is(o,a,d,f){let p=a.replaceAll(/-([a-z])/g,(g,h)=>h.toUpperCase()),m=o[p];if(x(m)){o[p]=d!==null&&d!=="false";return}if(d===null){let g=f?.get(p);o[p]=g===void 0?i(m)?0:"":g;return}o[p]=i(m)?Number(d):d}function ss(o){let a=new Map;for(let[d,f]of Object.entries(o.state??{})){if(n(f)){if("default"in f){a.set(d,f.default);continue}if(Pu.some((p)=>(p in f)))continue}a.set(d,f)}return a}var Pu=["$expression","$prototype","$ref","$src"],as=new Set;function Nu(o,a){if(Object.hasOwn(o,a))return!0;if(o.hasAttribute(a))return!0;let d=a.replaceAll(/[A-Z]/gu,(f)=>`-${f.toLowerCase()}`);return d!==a&&o.hasAttribute(d)}function Ru(o,a){for(let d=Reflect.getPrototypeOf(o);d;d=Reflect.getPrototypeOf(d)){let f=Object.getOwnPropertyDescriptor(d,a);if(f)return f.set}return}function _n(o,a){if(!w(o))return!1;let d=a===void 0?o:`${a}:${o}`;if(!as.has(d))as.add(d),console.warn(`Jx: "${o}" is private state (spec.md §5.6) and cannot be set through $props`+`${a===void 0?"":` (${a})`}. The write was ignored; rename the entry without the leading # to make it part of the component's interface.`);return!0}function $u(o,a){let d=Gr(a);for(let[f,p]of Object.entries(o.$props??{})){if(_n(f,"$props"))continue;d[f]=r(p)?Se(p.$ref,a):p}return d}var Us={},qt=new Map;async function qs(o,a){let d=a??location.href,{tagName:f}=o;if(!f||!f.includes("-"))throw Error(`Jx redefineElement: tagName "${f}" must contain a hyphen`);if(!customElements.get(f)){await Yt(o,d);return}if(o.$elements)await eo(o.$elements,d);let p=qt.get(f)?.doc.observedAttributes??[],m=o.observedAttributes??[];if(JSON.stringify(p)!==JSON.stringify(m))console.warn(`Jx redefineElement: <${f}> keeps observedAttributes [${p.join(", ")}] as first defined; [${m.join(", ")}] takes effect only in a fresh realm`);qt.set(f,{base:d,doc:o})}function zs(o){Us=o??{}}async function eo(o,a,d){for(let f of o){if(e(f)){try{await import(f.startsWith("/")||f.startsWith(".")?f:`/node_modules/${f}`)}catch(g){console.warn(`Jx: failed to import package "${f}"`,g)}continue}if(!r(f))continue;let{href:p}=new URL(f.$ref,a),m=await Br(p,d);if(!m.tagName||!m.tagName.includes("-"))continue;if(customElements.get(m.tagName))continue;if(m.$elements)await eo(m.$elements,p,d);await Yt(m,p)}}var ls=32,Ou={expansion:0,frames:[]},yt=Ou;function Ir(o,a,d){if(!o.isConnected)return;console.error(`Jx: <${a}> was not rendered:`,d),o.dispatchEvent(new ErrorEvent("jx-error",{bubbles:!0,composed:!0,error:d,message:d.message}))}function Jn(o,a){let d=yt;yt=o;try{return a()}finally{yt=d}}function Wr(o){return{expansion:o.frames.length,frames:o.frames}}function ku(o,a){if(Object.is(o,a))return!0;if(!cs(o)||!cs(a))return!1;try{return JSON.stringify(o)===JSON.stringify(a)}catch{return!1}}function cs(o){if(!n(o))return!1;let a=le(o);if(Array.isArray(a))return!0;let d=Object.getPrototypeOf(a);return d===Object.prototype||d===null}function Mu(o,a){if(o.tag!==a.tag)return!1;let d=Object.keys(o.props);if(d.length!==Object.keys(a.props).length)return!1;return d.every((f)=>Object.hasOwn(a.props,f)&&ku(o.props[f],a.props[f]))}function _u(o,a){let d=[...o.frames.map((f)=>f.tag),a.tag].join(" → ");if(o.frames.slice(o.expansion).some((f)=>Mu(f,a)))throw Error(`Component <${a.tag}> renders itself: ${d}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(o.frames.length>=ls)throw Error(`Component nesting exceeds ${ls} levels: ${d}. A component that renders itself with changing props needs a case that stops.`);return{expansion:o.expansion,frames:[...o.frames,a]}}var us=new Set;async function Yt(o,a){let d=a,f;if(e(o)){if(d=new URL(o,d??location.href).href,us.has(d))return;us.add(d),f=await Br(o)}else f=o;d??=location.href;let{tagName:p}=f;if(!p||!p.includes("-"))throw Error(`Jx defineElement: tagName "${p}" must contain a hyphen`);if(customElements.get(p))return;if(f.$elements)await eo(f.$elements,d);qt.set(p,{base:d,doc:f});let m=f,g=d,h=m.observedAttributes??[],y=class extends HTMLElement{_jxInitialized=!1;_state=null;static get observedAttributes(){return h}async connectedCallback(){if(this.dataset.jxDefinitionRoot!==void 0)return;if(this._jxInitialized)return;this._jxInitialized=!0;let E=yt,C={},T=qt.get(p)??{base:g,doc:m},{doc:A,base:H}=T,k=await Ln(A,{},H,{base:H,media:null,root:this});for(let N of h)if(this.hasAttribute(N))is(k,N,this.getAttribute(N)),C[N]=this.getAttribute(N);let K=this.dataset.jxProps;if(K){try{let N=JSON.parse(K),z=n(N)||e(N)?Object.entries(N):[];for(let[Q,de]of z){if(_n(Q,"data-jx-props"))continue;if(Q in(A.state??{}))k[Q]=de,C[Q]=de}}catch{}delete this.dataset.jxProps}let L=this.getAttributeNames().filter((N)=>N.startsWith("props.")&&N.length>6);for(let N of L){let z=N.slice(6);if(_n(z,"props.* attribute")){this.removeAttribute(N);continue}if(z in(A.state??{}))k[z]=this.getAttribute(N),C[z]=this.getAttribute(N),this.removeAttribute(N)}for(let N of Object.keys(A.state??{})){if(w(N))continue;let z=Hn(this);if(N in this&&z[N]!==void 0&&Nu(this,N))k[N]=z[N],C[N]=z[N]}let _;try{_=_u(E,{props:C,tag:p})}catch(N){this.replaceChildren(),Ir(this,p,N instanceof Error?N:Error(String(N)));return}for(let N of Object.keys(A.state??{})){if(w(N))continue;let z=Ru(this,N);Object.defineProperty(this,N,{configurable:!0,get:()=>k[N],set:(Q)=>{z?.call(this,Q),k[N]=Q}})}this._state=k;let Y=Lu(this);this.replaceChildren();let q=A.style,G=q&&pu(q)?q:{display:"block",...q},U=Ws(G,Xr.get(this));if(Fn(this,U,jn(k),k),Wn(this,A.attributes??{},k),cu(this,A,k),!Array.isArray(A.children)&&A.textContent!==void 0)js(this,"textContent",A.textContent,k);let M=Array.isArray(A.children)?A.children:[],B=()=>{let N=Rn;Rn||=this.dataset.jxPath!==void 0;let z=null;try{Jn(_,()=>{for(let Q of M)this.append(Oe(Q,k))})}catch(Q){z=Q instanceof Error?Q:Error(String(Q))}finally{Rn=N}return ju(this,Y),z},re=()=>{let{onMount:N}=k;if(Dr(N))queueMicrotask(()=>N.call(this,k,this))},X=bt(B),ce=X.result;if(!ce){re();return}Ir(this,p,ce);let ee=[...ss(A).keys()].filter((N)=>!w(N)),ne=ce.message,ve=!1,V=we(()=>{for(let N of ee)k[N]},{scheduler:()=>{if(ve)return;ve=!0,queueMicrotask(()=>{if(ve=!1,!this.isConnected){V.effect.stop();return}V(),X.stop(),this.replaceChildren(),Dt();try{X=bt(B)}finally{Lt()}let N=X.result;if(!N)V.effect.stop(),re();else if(N.message!==ne)ne=N.message,Ir(this,p,N)})}})}disconnectedCallback(){let E=this._state;if(E&&Dr(E.onUnmount))E.onUnmount(E)}adoptedCallback(){let E=this._state;if(E&&Dr(E.onAdopted))E.onAdopted(E)}attributeChangedCallback(E,C,T){if(!this._state||C===T)return;is(this._state,E,T,ss(qt.get(p)?.doc??m))}};customElements.define(p,y)}function ds(o,a,d,f){let p=document.createElement(Zr(o.tagName,a));if(d?.onNodeCreated)d.onNodeCreated(p,f??[],o,a);for(let[g,h]of Object.entries(o.$props??{})){if(_n(g,"$props"))continue;let y=(E)=>{let C=e(E)?qr(p.tagName,g,E):E;Hn(p)[g]=C;let T=ou(p);if(T&&g in HTMLElement.prototype&&Object.hasOwn(le(T),g))T[g]=C};if(r(h)){let E=h;y(Se(E.$ref,a)),we(()=>{y(Se(E.$ref,a))})}else if(c(h))In(h,()=>{y(Ye(h,a))});else y(h)}if(o.style)Xr.set(p,o.style);Fn(p,o.style??{},jn(a),a),Wn(p,o.attributes??{},a),Yr(p,o,a);let m=Array.isArray(o.children)?o.children:[];for(let g=0;g<m.length;g++){let h=m[g],y=d&&f?{...d,_path:[...f,"children",g]}:void 0;if(S(h))Vr(p,h,a,y);else p.append(Oe(h,a,y))}return p}function Gs(o){return o.nodeType===Node.ELEMENT_NODE}function Ys(o){return o.nodeType===Node.TEXT_NODE}function fs(o){return o.nodeType===Node.COMMENT_NODE}var Ju=/^[\t\n\f\r ]+$/u,ps="jx-slot",ms="data-jx-slots",Du="jx.slot.group",Ut=(()=>{let o=Symbol.for(Du),a=globalThis;return a[o]??=new WeakMap,a[o]})();function Lu(o){let a=o.getAttribute(ms);if(a===null)return[...o.childNodes];o.removeAttribute(ms);let d=`${ps} ${a} `,f=`/${ps} ${a}`,p=[],m=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_COMMENT);for(let h=m.nextNode();h;h=m.nextNode())if(fs(h)&&h.data.startsWith(d))p.push(h);let g=[];for(let h of p){let y=decodeURIComponent(h.data.slice(d.length));for(let E=h.nextSibling;E;E=E.nextSibling){if(fs(E)&&E.data===f)break;Ut.set(E,y),g.push(E)}}return g}function Iu(o){return o.some((a)=>Gs(a)||Ys(a)&&a.data!=="")}function ju(o,a){let d=[...o.querySelectorAll("slot")];if(d.length===0)return;let f=new Map;for(let m of a){if(Ys(m)&&Ju.test(m.data))continue;let g=Ut.get(m);Ut.delete(m);let h=g??(Gs(m)?m.getAttribute("slot")??"":""),y=f.get(h);if(!y)y=[],f.set(h,y);y.push(m)}let p=new Set;for(let m of d){let g=m.getAttribute("name")??"",h=[];if(!p.has(g))p.add(g),h=f.get(g)??[];let y=Iu(h)?h:[...h,...m.childNodes],E=m.parentElement;if(E&&E!==o&&E.localName.includes("-")){let C=Ut.get(m)??m.getAttribute("slot")??"";for(let T of y)Ut.set(T,C)}m.replaceWith(...y)}}function Fu(o,a){if(!e(a)||a==="")return o;let d=o.indexOf("#"),f=d===-1?"":o.slice(d),p=d===-1?o:o.slice(0,d),m=p.indexOf("?"),g=m===-1?p:p.slice(0,m),y=(m===-1?[]:p.slice(m+1).split("&")).filter((E)=>E!==""&&!Vu(E));return y.push(`v=${encodeURIComponent(a)}`),`${g}?${y.join("&")}${f}`}function Vu(o){let a=o.indexOf("="),d=a===-1?o:o.slice(0,a);if(d==="v")return!0;if(!d.includes("%"))return!1;try{return decodeURIComponent(d)==="v"}catch{return!1}}function Wu(o,a){if(!o||!Object.hasOwn(o,a))return;let d=o[a];return e(d)?d:void 0}function Xt(o,a){if(!a||o==="")return null;if(a.space==="repo"){if(!a.fileBaseUrl)return null;let f=Vi(o,a.documentDir,a.mounts,a.lanes);if(f===null)return null;let{suffix:p}=Kt(o);return Fu(`${a.fileBaseUrl}${Wi(f)}${p}`,Wu(a.versions,f))}let[d]=a.mounts;return d?Bu(o,a.documentDir,d):null}function Bu(o,a,d){if(Mr(o))return null;let{path:f,suffix:p}=Kt(o),m;try{m=decodeURIComponent(f)}catch{return null}let g=Jr(a,m);if(g===null)return null;let h=Fi([d],g);if(!h)return null;return`${h}${p}`}function ot(o){return`[data-jx-path='${o.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function Ku(o,a){if(!a)return!1;return o.length<=a.length&&o.every((d,f)=>a[f]===d)}function Xs(o,a,d){let f=d.layoutWrapped&&n(a)?a.$__layout:void 0;if(f){let m=s(f)?f:{},{file:g,path:h}=m;return{chrome:o.length>0&&!Ku(o,d.pageContentPrefix),kind:"layout",layoutFile:e(g)?g:"",layoutPath:Array.isArray(h)?h:[]}}let p=o;if(d.layoutWrapped&&d.pageContentPrefix){let m=d.pageContentPrefix;if(o.length>=m.length&&m.every((g,h)=>o[h]===g)){let g=o.slice(m.length),[h]=g;p=i(h)?["children",h-(d.pageContentOffset??0),...g.slice(1)]:["children",...g]}}if(d.arrayPaths.size>0){let m=!0;while(m){m=!1;for(let g=1;g<p.length-1;g++)if(p[g]==="children"&&p[g+1]===0&&d.arrayPaths.has(p.slice(0,g).join("/"))){p=[...p.slice(0,g),"map",...p.slice(g+2)],m=!0;break}}}return{kind:"path",path:p}}function ae(o){return JSON.stringify(o)}function ge(o){return JSON.parse(o)}function Zs(o){if(o.dataset.jxDefinitionRoot!==void 0)return!1;return o.getAttribute("contenteditable")==="false"||o.tagName.includes("-")}function Bn(o,a){let d=o instanceof Element?o:o?.parentElement??null;while(d){if(d instanceof HTMLElement){if(d.dataset.jxPath&&a(d))return{el:d,path:ge(d.dataset.jxPath)};if(Zs(d))return null}d=d.parentElement}return null}function Kn(o,a){let d=o.querySelector(ot(ae(a)));return d instanceof HTMLElement?d:null}function to(o){return o.textContent.length}function Uu(o,a,d){if(!o.contains(a))return null;let f=o.ownerDocument.createRange();f.setStart(o,0);try{f.setEnd(a,d)}catch{return null}return f.toString().length}function qu(o,a){let d=Math.max(0,Math.min(a,to(o))),f=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_TEXT),p=0,m=null,g=f.nextNode();while(g){let h=g.length;if(p+h>=d)return{node:g,offset:d-p};p+=h,m=g,g=f.nextNode()}return m?{node:m,offset:m.length}:{node:o,offset:0}}function Zt(o,a,d){let f=Bn(o,d);if(!f||!o)return null;let p=Uu(f.el,o,a);return p===null?null:{offset:p,path:f.path}}function no(o,a){let d=Kn(o,a.path);return d?qu(d,a.offset):null}function Qs(o){return o.offset<=0}function Qt(o,a){return ae(o.path)===ae(a.path)}function ro(o,a){let d=[];for(let f of o.querySelectorAll("[data-jx-path]"))if(a(f)&&!zu(f,o))d.push(f);return d}function zu(o,a){let d=o.parentElement;while(d&&d!==a){if(Zs(d))return!0;d=d.parentElement}return!1}function ea(o,a,d,f){let p=ro(o,f),m=ae(a),g=p.findIndex((y)=>y.dataset.jxPath===m),h=g===-1?void 0:p[g+d];return h?{el:h,path:ge(h.dataset.jxPath)}:null}var oo="jx-site-style",Gu={body:"body",root:":root"};function ta(o,a,d,f,p=Gu){let m=[],g=(T,A)=>{let H={mediaQueries:a,scope:A,transposeValue:d};if(f)H.resolveValue=(k,K)=>f(k,K,A);for(let k of Bt(T,H))m.push(k.text)},h={},y={},E=[],C=[];for(let[T,A]of Object.entries(o)){if(n(A)&&!Array.isArray(A)){if(T.startsWith("@"))E.push([T,A]);else if(!T.startsWith("--"))C.push([T,A]);continue}if(Wt(T)||T.startsWith("@"))continue;if(T.startsWith("--")||T==="colorScheme"||T==="color-scheme")h[T]=A;else y[T]=A}g(h,p.root),g(y,p.body);for(let[T,A]of C)if(T.startsWith("&"))g({[T]:A},p.root);else g(A,T);for(let[T,A]of E){if(Ht(T)||Vt(T)){g({[T]:A},null);continue}let H={},k={},K=[];for(let[L,_]of Object.entries(A)){if(n(_)&&!Array.isArray(_)){if(!L.startsWith("@"))K.push([L,_]);continue}if(L.startsWith("--"))H[L]=_;else k[L]=_}g({[T]:H},p.root),g({[T]:k},p.body);for(let[L,_]of K)g({[T]:_},L)}if(Object.values(a).some((T)=>Cn(T)!==null)&&!("colorScheme"in o))m.push(`${p.root} { color-scheme: light dark }`,`${p.root}:where([${Ge}="light"]) { color-scheme: light }`,`${p.root}:where([${Ge}="dark"]) { color-scheme: dark }`);return m.join(`
10
+ `)}async function Yu(o,a){let d=o.$elements;if(!Array.isArray(d))return;await Promise.all(d.map(async(f)=>{let p=(async()=>{if(e(f))await import(f.startsWith("/")||f.startsWith(".")?f:`/node_modules/${f}`);else if(n(f)&&"$ref"in f)await Yt(new URL(String(f.$ref),a).href);else if(n(f))await Yt(f,a)})();try{await Promise.race([p,new Promise((m,g)=>{setTimeout(()=>g(Error("register timeout")),5000)})])}catch(m){console.warn("iframe canvas: failed to register element",JSON.stringify(f),m)}}))}var na="jx-canvas-edit-css",Xu=`
11
11
  .empty-media-placeholder {
12
12
  display: inline-block;
13
13
  min-width: 120px;
@@ -96,7 +96,7 @@ function ko(e){let{target:t,source:n,targetOrigin:r,acceptOrigin:o,token:s}=e,i=
96
96
  [data-jx-layout-region] [data-jx-layout-region]::before {
97
97
  content: none;
98
98
  }
99
- `;function Pc(e,t){let n=e.head.querySelector(`#${mi}`);if(t!=="design"&&t!=="edit"){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=mi,r.textContent=Cc,e.head.append(r)}var hi="jx-canvas-overlay-css",Rc=`
99
+ `;function Zu(o,a){let d=o.head.querySelector(`#${na}`);if(a!=="design"&&a!=="edit"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=na,f.textContent=Xu,o.head.append(f)}var ra="jx-canvas-overlay-css",Qu=`
100
100
  /* The UA rule a de-popovered element lost, re-supplied at UA-EQUIVALENT PRECEDENCE.
101
101
 
102
102
  The cascade layer is the mechanism and it is the whole point. An unlayered author declaration
@@ -184,7 +184,7 @@ dialog[data-jx-dialog-open]::before {
184
184
  letter-spacing: 0.08em;
185
185
  pointer-events: none;
186
186
  }
187
- `;function $c(e,t){let n=e.head.querySelector(`#${hi}`);if(t==="preview"){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=hi,r.textContent=Rc,e.head.append(r)}var gi="jx-canvas-diff-css",Nc=`
187
+ `;function ed(o,a){let d=o.head.querySelector(`#${ra}`);if(a==="preview"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=ra,f.textContent=Qu,o.head.append(f)}var oa="jx-canvas-diff-css",td=`
188
188
  [data-jx-diff] {
189
189
  position: relative;
190
190
  border-left-width: 3px;
@@ -227,7 +227,7 @@ dialog[data-jx-dialog-open]::before {
227
227
  border-left-color: CanvasText;
228
228
  }
229
229
  }
230
- `;function Mc(e,t){let n=e.head.querySelector(`#${gi}`);if(!t){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=gi,r.textContent=Nc,e.head.append(r)}function _c(e,t){for(let n of e.querySelectorAll("[data-jx-diff], [data-jx-diff-within]"))if(n instanceof HTMLElement)delete n.dataset.jxDiff,delete n.dataset.jxDiffWithin;if(!t?.length)return;for(let n of t){let r=kn(e,n.path);if(r){r.dataset.jxDiff=n.kind;continue}let{path:o}=n;while(o.length>=2){o=o.slice(0,-2);let s=kn(e,o);if(s){s.dataset.jxDiffWithin="";break}}}}function Oc(e,t){e.documentElement.toggleAttribute("data-jx-preview",t==="preview")}function Tn(e){return e==="design"||e==="edit"}function Dc(e,t){if(!Tn(t)){e.removeAttribute("contenteditable"),e.removeAttribute("spellcheck"),e.removeAttribute("role"),e.removeAttribute("aria-multiline"),e.removeAttribute("aria-label");return}e.contentEditable="true",e.spellcheck=!0,e.setAttribute("autocorrect","off"),e.setAttribute("writingsuggestions","false"),e.setAttribute("draggable","false"),e.setAttribute("role","textbox"),e.setAttribute("aria-multiline","true"),e.setAttribute("aria-label","Document content")}var xi="jx-canvas-stylebook-css",Lc=`
230
+ `;function nd(o,a){let d=o.head.querySelector(`#${oa}`);if(!a){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=oa,f.textContent=td,o.head.append(f)}function rd(o,a){for(let d of o.querySelectorAll("[data-jx-diff], [data-jx-diff-within]"))if(d instanceof HTMLElement)delete d.dataset.jxDiff,delete d.dataset.jxDiffWithin;if(!a?.length)return;for(let d of a){let f=Kn(o,d.path);if(f){f.dataset.jxDiff=d.kind;continue}let{path:p}=d;while(p.length>=2){p=p.slice(0,-2);let m=Kn(o,p);if(m){m.dataset.jxDiffWithin="";break}}}}function od(o,a){o.documentElement.toggleAttribute("data-jx-preview",a==="preview")}function Un(o){return o==="design"||o==="edit"}function id(o,a){if(!Un(a)){o.removeAttribute("contenteditable"),o.removeAttribute("spellcheck"),o.removeAttribute("role"),o.removeAttribute("aria-multiline"),o.removeAttribute("aria-label");return}o.contentEditable="true",o.spellcheck=!0,o.setAttribute("autocorrect","off"),o.setAttribute("writingsuggestions","false"),o.setAttribute("draggable","false"),o.setAttribute("role","textbox"),o.setAttribute("aria-multiline","true"),o.setAttribute("aria-label","Document content")}var ia="jx-canvas-stylebook-css",sd=`
231
231
  .sb-root {
232
232
  padding: 16px;
233
233
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
@@ -271,6 +271,10 @@ dialog[data-jx-dialog-open]::before {
271
271
  .element-card-preview > * {
272
272
  max-width: 100%;
273
273
  margin: 0;
274
+ }
275
+ /* A list keeps its inline-start padding: its markers are drawn in it, and with none they are
276
+ clipped by the card ("1." shows as "."). Every other specimen sits flush in its card. */
277
+ .element-card-preview > :not(ol, ul, menu) {
274
278
  padding: 0;
275
279
  }
276
280
  .element-card-preview > hr {
@@ -306,10 +310,10 @@ dialog[data-jx-dialog-open]::before {
306
310
  color: color-mix(in srgb, #808080 70%, transparent);
307
311
  font-size: 13px;
308
312
  }
309
- `;function Ic(e,t){let n=e.head.querySelector(`#${xi}`);if(t!=="stylebook"){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=xi,r.textContent=Lc,e.head.append(r)}function Jr(e,t={}){let n=document.head.querySelector(`#${Ir}`);if(!e||typeof e!=="object"){n?.remove();return}let r=pi(e,t,dn);if(n){n.textContent=r;return}let o=document.createElement("style");o.id=Ir,o.textContent=r,document.head.append(o)}function jr(e,t){if(t)e.documentElement.dataset.colorScheme=t;else delete e.documentElement.dataset.colorScheme}function _t(e,t){for(let r of e.querySelectorAll("[data-jx-popover-open]"))delete r.dataset.jxPopoverOpen;if(t===null)return;let n=e.querySelector(`[data-jx-popover]${je(t)}`);if(n)n.dataset.jxPopoverOpen=""}function tt(e,t){for(let r of e.querySelectorAll("[data-jx-dialog-open]"))delete r.dataset.jxDialogOpen;if(t===null)return;let n=e.querySelector(`dialog${je(t)}`);if(n)n.dataset.jxDialogOpen=""}function Jc(e,t=null){let n=e.$head;if(!Array.isArray(n))return;for(let r of n){if(!r?.tagName)continue;let o=String(r.tagName).toLowerCase();if(o==="script"&&!r.attributes?.src)continue;let s={...r.attributes};for(let c of["href","src"]){let l=s[c];if(typeof l!=="string"||l==="")continue;if(!l.startsWith("/")&&!l.startsWith(".")&&!l.startsWith("http")){s[c]=`/node_modules/${l}`;continue}s[c]=$t(l,t)??l}let i=`${o}${s.href?`[href="${String(s.href)}"]`:""}${s.src?`[src="${String(s.src)}"]`:""}`;if(i!==o&&document.head.querySelector(i))continue;let a=document.createElement(o);for(let[c,l]of Object.entries(s))a.setAttribute(c,String(l));if(r.textContent)a.textContent=r.textContent;document.head.append(a)}}function Hr(e){let t=[],n=(r)=>t.some((o)=>r.length>o.length&&o.every((s,i)=>r[i]===s));return(r,o,s)=>{if(!(r instanceof HTMLElement))return;let i=o.length===0&&s?.tagName?.includes("-");if(i)r.dataset.jxDefinitionRoot="";let a=!i&&r.tagName.includes("-")&&Tn(e.canvasMode);if(a)r.contentEditable="false",t.push(o);let c=ci(o,s,e);if(c.kind==="layout"){if(r.dataset.jxLayoutPath=J(c.layoutPath),c.layoutFile)r.dataset.jxLayoutFile=c.layoutFile;if(c.chrome){if(r.dataset.jxLayoutRegion="",Tn(e.canvasMode))r.contentEditable="false"}return}if(r.dataset.jxPath=J(c.path),!a&&Tn(e.canvasMode)&&n(o))r.contentEditable="true"}}function yi(e,t=3){let n=new WeakMap,r=(o)=>{let s=o.target;if(!(s instanceof HTMLImageElement))return;if(!s.src||s.src.startsWith("data:"))return;let i=(n.get(s)??0)+1;if(i>t)return;n.set(s,i),setTimeout(()=>{let a=s.src;s.src="",s.src=a},150*i)};return e.addEventListener("error",r,!0),()=>e.removeEventListener("error",r,!0)}async function bi(e){let t=e.assets??null;yn(t?(i)=>$t(i,t):null),Ls(e.mode!=="preview"),Js(e.mode!=="preview"&&!e.allowAutoRequests),Bs(!0),Vs(e.mode!=="preview"&&e.mode!=="stylebook"),Us(e.mode!=="preview"),qs(e.mode!=="preview"),Gs(e.mode==="design"||e.mode==="edit"),Jr(e.siteStyle,e.doc.$media??{}),Jc(e.doc,t),Pc(e.container.ownerDocument,e.mode),$c(e.container.ownerDocument,e.mode),Oc(e.container.ownerDocument,e.mode),Ic(e.container.ownerDocument,e.mode),Mc(e.container.ownerDocument,Boolean(e.diffMarks?.length)),li(e.doc.$media??{}),await Ac(e.doc,e.docBase);let n=await bn(e.doc,{},e.docBase),r=Hr(e.mapperCtx),{result:o,stop:s}=xn(()=>de(e.doc,n,{_path:[],onNodeCreated:r}));return e.container.replaceChildren(o),_t(e.container,e.popoverOpen??null),tt(e.container,e.dialogOpen??null),Dc(e.container,e.mode),_c(e.container,e.diffMarks??null),{ctx:{defs:n,docBase:e.docBase,mapperCtx:e.mapperCtx,mode:e.mode},dispose:s}}function Z(e,t){let n=e;for(let r of t){if(n==null)return;n=n[r]}return n}function wi(e){return e.length>=2?e.slice(0,-2):null}function Ei(e){return e.at(-1)}function vi(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;return e.every((n,r)=>n===t[r])}function nt(e,t){if(e.length>t.length)return!1;return e.every((n,r)=>n===t[r])}var An=14,jc="empty-container-placeholder";function Si(e){let t=oe(e);return{height:t.height,width:t.width,x:t.x,y:t.y}}function Hc(e){let t=getComputedStyle(e),{display:n}=t,r=n==="flex"||n==="inline-flex",o=n==="grid"||n==="inline-grid";return r&&t.flexDirection.startsWith("row")||o&&(t.gridAutoFlow??"").startsWith("column")}function Ai(e,t,n){let r=e.dataset?.jxPath;if(r==null)return null;let o=q(r);if(e.classList.contains(jc))return[{edge:"center",index:0,insertParentPath:o,rect:Si(e)}];let s=wi(o);if(!s)return null;let i=e.parentElement;if(!i)return null;let a=Ei(o);if(typeof a!=="number")return null;let c=Si(e);if(Hc(i)){let u=t.x-c.x;if(u<An)return[Cn("left",s,a,ki(c,!0))];if(c.width-u<An)return[Cn("right",s,a+1,Ti(c,!0))];return null}let l=t.y-c.y;if(l<An)return[Cn("top",s,a,ki(c,!1))];if(c.height-l<An)return[Cn("bottom",s,a+1,Ti(c,!1))];return null}function Cn(e,t,n,r){return{edge:e,index:n,insertParentPath:t,rect:r}}function ki(e,t){return t?{height:e.height,width:0,x:e.x,y:e.y}:{height:0,width:e.width,x:e.x,y:e.y}}function Ti(e,t){return t?{height:e.height,width:0,x:e.x+e.width,y:e.y}:{height:0,width:e.width,x:e.x,y:e.y+e.height}}function Ci(e){if(!e||e.length===0)return"none";return e.map((t)=>`${t.edge}:${t.insertParentPath.join("/")}:${t.index}`).join("|")}var Fr={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var Pn=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function Ri(e,t){if(!t)return!1;if(t.contentEditable==="plaintext-only")return!1;let n=window.getSelection();if(!n||!n.rangeCount)return!1;let{anchorNode:r,focusNode:o}=n;if(!r||!o)return!1;if(!t.contains(r)||!t.contains(o))return!1;let s=(i)=>{let a=i;while(a&&a!==t){if(a.nodeType===Node.ELEMENT_NODE&&a.tagName.toLowerCase()===e)return!0;a=a.parentNode}return!1};return s(r)&&s(o)}function $i(e,t){if(!t)return;let n=window.getSelection();if(!n||!n.rangeCount)return;let r=n.getRangeAt(0);if(r.collapsed)return;if(!t.contains(r.commonAncestorContainer))return;Qc(r);let o=Wc(e,r,t);if(o.length>0)Bc(e,r,t,o);else Kc(e,r,t);rt(t)}function Wc(e,t,n){let r=[],o=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode(s){if(s.tagName.toLowerCase()===e&&t.intersectsNode(s))return NodeFilter.FILTER_ACCEPT;return NodeFilter.FILTER_SKIP}});while(o.nextNode())r.push(o.currentNode);return r}function Bc(e,t,n,r){for(let o=r.length-1;o>=0;o--){let s=r[o];Ni(s)}}function Ni(e){if(!e.parentNode)return;let n=document.createDocumentFragment();while(e.firstChild)n.append(e.firstChild);e.replaceWith(n)}function Kc(e,t,n){let r=t.extractContents(),o=Vc(r),s=Uc(r);if(!r.hasChildNodes()){if(o)t.insertNode(document.createTextNode(o));if(s){let l=document.createTextNode(s);t.collapse(!1),t.insertNode(l)}return}let i=document.createElement(e);i.append(r);let a=document.createDocumentFragment();if(o)a.append(document.createTextNode(o));if(a.append(i),s)a.append(document.createTextNode(s));t.insertNode(a);let c=window.getSelection();if(c){c.removeAllRanges();let l=document.createRange();l.selectNodeContents(i),c.addRange(l)}}function Vc(e){let t=e.firstChild;if(!t||t.nodeType!==Node.TEXT_NODE)return null;let n=t.textContent??"",r=n.match(/^(\s+)/);if(!r)return null;let o=r[1];if(n.length===o.length)t.remove();else t.textContent=n.slice(o.length);return o}function Uc(e){let t=e.lastChild;if(!t||t.nodeType!==Node.TEXT_NODE)return null;let n=t.textContent??"",r=n.match(/(\s+)$/);if(!r)return null;let o=r[1];if(n.length===o.length)t.remove();else t.textContent=n.slice(0,-o.length);return o}function rt(e){if(!e)return;let t=!0,n=0;while(t&&n<10){if(t=!1,n+=1,e.normalize(),qc(e))t=!0;if(zc(e))t=!0;if(Gc(e))t=!0;if(Yc(e))t=!0;if(Xc(e))t=!0}}function qc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode,s=o.nextSibling;if(s&&s.nodeType===Node.ELEMENT_NODE&&s.tagName===o.tagName&&Pn.has(o.tagName.toLowerCase())&&Zc(o,s))r.push([o,s])}for(let o=r.length-1;o>=0;o--){let[s,i]=r[o];while(i.firstChild)s.append(i.firstChild);i.remove(),t=!0}return t}function zc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Pn.has(o.tagName.toLowerCase()))continue;if(o.childNodes.length===1&&o.firstChild!==null&&o.firstChild.nodeType===Node.ELEMENT_NODE&&o.firstChild.tagName===o.tagName)r.push(o)}for(let o of r){let s=o.firstChild;while(s.firstChild)s.before(s.firstChild);s.remove(),t=!0}return t}function Gc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Pn.has(o.tagName.toLowerCase()))continue;if(o.childNodes.length===0&&!o.textContent)r.push(o)}for(let o of r)o.remove(),t=!0;return t}function Yc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Pn.has(o.tagName.toLowerCase()))continue;if(o===e)continue;let s=o.firstChild;if(s&&s.nodeType===Node.TEXT_NODE){let a=s.textContent??"",c=a.match(/^(\s+)/);if(c&&a.length>c[1].length)r.push({el:o,type:"lift-leading",ws:c[1]})}let i=o.lastChild;if(i&&i.nodeType===Node.TEXT_NODE&&i!==s){let a=i.textContent??"",c=a.match(/(\s+)$/);if(c&&a.length>c[1].length)r.push({el:o,type:"lift-trailing",ws:c[1]})}}for(let o of r)if(o.type==="lift-leading"){let s=o.el.firstChild;s.textContent=(s.textContent??"").slice(o.ws.length),o.el.parentNode?.insertBefore(document.createTextNode(o.ws),o.el),t=!0}else if(o.type==="lift-trailing"){let s=o.el.lastChild;s.textContent=(s.textContent??"").slice(0,-o.ws.length),o.el.parentNode?.insertBefore(document.createTextNode(o.ws),o.el.nextSibling),t=!0}return t}function Xc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(o.tagName.toLowerCase()!=="span")continue;if(o===e)continue;if(o.attributes.length>0)continue;r.push(o)}for(let o of r)Ni(o),t=!0;return t}function Zc(e,t){if(e.tagName.toLowerCase()==="a")return e.getAttribute("href")===t.getAttribute("href");return!0}function Qc(e){Pi(e,!0),Pi(e,!1)}function Pi(e,t){let n=t?e.startContainer:e.endContainer,r=t?e.startOffset:e.endOffset;if(n.nodeType!==Node.TEXT_NODE)return;let o=n.textContent??"",s=eu(o);for(let i of s)if(t){if(r>i.start&&r<i.end)e.setStart(n,i.start)}else if(r>i.start&&r<i.end)e.setEnd(n,i.end)}function eu(e){let t=[],n=0;while(n<e.length-1){if(e[n]==="$"&&e[n+1]==="{"){let r=n,o=1,s=n+2;while(s<e.length&&o>0){if(e[s]==="{")o+=1;else if(e[s]==="}")o-=1;s+=1}if(o===0){t.push({end:s,start:r}),n=s;continue}}n+=1}return t}var tu=new Set(["pre"]),nu=new Set(Object.entries(Fr.$defs).filter(([e,t])=>!tu.has(e)&&(t.$inlineChildren?.length??0)>0).map(([e])=>e));function Mi(e,t){return t?.[e.toLowerCase()]??nu.has(e.toLowerCase())}var ru={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},_e=ru;function Wr(e){_e=e}var M=null,ie=null,ot=null,Ot=null,st=null,Me=null,pe=!1,Lt="",Dt=!1,Oi=null;function Di(e){Oi=e}function He(e){return Mi(e.tagName,Oi)}function Br(e,t,n,r){if(M)xe(!0);if(M=e,ie=t,ot=n.onCommit,Ot=n.onSplit,st=n.onInsert,Me=n.onEnd,pe=r?.plainText===!0,Lt=pe?e.textContent??"":"",Dt=!1,e.dataset.jxActiveBlock="",pe){try{e.contentEditable="plaintext-only"}catch{e.contentEditable="true"}e.focus()}e.addEventListener("keydown",Kr),e.addEventListener("input",Vr),e.addEventListener("paste",Ur)}function xe(e=!1){if(!M)return;if(Wi(!1),_e.dismiss(),delete M.dataset.jxActiveBlock,pe)M.contentEditable="false";if(M.removeEventListener("keydown",Kr),M.removeEventListener("input",Vr),M.removeEventListener("paste",Ur),M=null,ie=null,ot=null,Ot=null,st=null,pe=!1,Lt="",Dt=!1,e)Me=null;else if(Me){let t=Me;Me=null,t()}}function Li(){Wi(!0)}function Ii(){return pe&&M!==null}function me(){return M!==null}function it(){return M}function Ji(){return ie}function ji(){return _e.isOpen()}function Kr(e){if(pe){if(e.key==="Escape"){if(e.preventDefault(),e.stopPropagation(),M)M.textContent=Lt;xe();return}if(e.key==="Enter"){e.preventDefault(),e.stopPropagation(),xe();return}if((e.ctrlKey||e.metaKey)&&["b","i","u","`"].includes(e.key))e.preventDefault()}}function Vr(){if(_e.isOpen())Gr()}function Ur(e){e.preventDefault();let t=e.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,t)}function Hi(){if(!Ot||!M||!ie)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0),n=document.createRange();n.setStart(M,0),n.setEnd(t.startContainer,t.startOffset);let r=document.createRange();r.setStart(t.endContainer,t.endOffset),r.setEnd(M,M.childNodes.length);let o=_i(n.cloneContents()),s=_i(r.cloneContents()),i=[...ie],a=Ot;return Fi(),a(i,o,s),!0}function Fi(){if(!M)return;if(delete M.dataset.jxActiveBlock,pe)M.contentEditable="false";if(M.removeEventListener("keydown",Kr),M.removeEventListener("input",Vr),M.removeEventListener("paste",Ur),M=null,ie=null,ot=null,Ot=null,st=null,pe=!1,Lt="",Dt=!1,Me){let e=Me;Me=null,e()}}function Wi(e){if(!ot||!M||!ie)return;if(pe){let n=(M.textContent??"").replaceAll(`
310
- `," ");if(n===Lt.replaceAll(`
311
- `," ")&&!Dt)return;Dt=!0,ot(ie,null,n,e);return}rt(M);let t=Bi(M);ot(ie,t.children??null,t.textContent??null,e)}function ou(e){if(!Array.isArray(e.children)||e.children.length===0)return{textContent:""};let t=[];for(let n of e.children)if(typeof n==="string"&&t.length>0&&typeof t.at(-1)==="string")t[t.length-1]+=n;else t.push(n);if(t.every((n)=>typeof n==="string"))return{textContent:t.join("")};return{children:t}}function Bi(e){let t=e.childNodes;if(t.length===0)return{textContent:""};if(t.length===1&&t[0].nodeType===Node.TEXT_NODE)return{textContent:t[0].textContent};let n=[];for(let r of t){let o=qr(r);if(o!==null&&o!==void 0)n.push(o)}return ou({children:n})}function qr(e){if(e.nodeType===Node.TEXT_NODE){let a=e.textContent;if(!a)return null;return a}if(e.nodeType!==Node.ELEMENT_NODE)return null;let t=e,n=t.tagName.toLowerCase(),r={tagName:n},o={b:"strong",i:"em",s:"del",strike:"del"};if(o[n])r.tagName=o[n];let s=t.dataset.jxHref??t.getAttribute("href");if(n==="a"&&s!=null){if(r.attributes={href:s},t.title)r.attributes.title=t.title}if(n==="code")return r.textContent=t.textContent,r;let{childNodes:i}=t;if(i.length===0)r.textContent="";else if(i.length===1&&i[0].nodeType===Node.TEXT_NODE)r.textContent=i[0].textContent;else{r.children=[];for(let a of i){let c=qr(a);if(c)r.children.push(c)}}return r}function _i(e){let t=e.childNodes;if(t.length===0)return{textContent:""};if(t.length===1&&t[0].nodeType===Node.TEXT_NODE)return{textContent:t[0].textContent};let n=[];for(let r of t){let o=qr(r);if(o)n.push(o)}if(n.length===1&&typeof n[0]!=="string"&&n[0].tagName==="span"&&typeof n[0].textContent==="string")return{textContent:n[0].textContent};return n.length>0?{children:n}:{textContent:""}}function $n(e){let t=document.createRange();return t.setStart(M,0),t.setEnd(e.startContainer,e.startOffset),t.toString()}var Ki=0,Rn=!0;function zr(e){if(!M||!st||!ie)return;if(pe)return;let t=window.getSelection();if(!t||!t.rangeCount)return;let n=t.getRangeAt(0);Rn=e?.anchored!==!1,Ki=$n(n).length,_e.show(M,"",{onSelect:Ui,...Rn?{}:{showFilter:!0}})}function Vi(e){if(e.key!=="/"||e.ctrlKey||e.metaKey||!M)return;let t=window.getSelection();if(!t||t.rangeCount===0)return;let n=$n(t.getRangeAt(0));if(n===""||n.endsWith(" ")||n.endsWith(`
312
- `))requestAnimationFrame(()=>zr())}function Gr(){if(!M||!Rn)return;let e=window.getSelection();if(!e||!e.rangeCount){_e.dismiss();return}let t=e.getRangeAt(0),n=$n(t),r=n.lastIndexOf("/");if(r===-1||n.length<Ki-1){_e.dismiss();return}let o=n.slice(r+1).toLowerCase();_e.show(M,o,{onSelect:Ui})}function Ui(e){if(!M||!st||!ie)return;let t=Rn?window.getSelection():null;if(t&&t.rangeCount){let s=t.getRangeAt(0),a=$n(s).lastIndexOf("/");if(a!==-1){let c=document.createTreeWalker(M,NodeFilter.SHOW_TEXT),l=0,u=null,f=0;while(c.nextNode()){let d=c.currentNode;if(l+d.length>a){u=d,f=a-l;break}l+=d.length}if(u){let d=document.createRange();d.setStart(u,f),d.setEnd(s.startContainer,s.startOffset),d.deleteContents()}}}rt(M);let n=Bi(M),r=[...ie],o=st;Fi(),o(r,e,n)}function su(e,t){let{target:n}=e;return n===t||n===t.documentElement||n===t.body}function Yr(e){let t=e instanceof Element?e:null;while(t){if(t.dataset?.jxPath)return t;t=t.parentElement}return null}function zi(e,t){let n=oe(e);return{path:q(t),rect:{height:n.height,width:n.width,x:n.x,y:n.y}}}function qi(e){let t=Yr(e instanceof Element?e:null);if(!t)return null;return zi(t,t.dataset.jxPath)}function iu(e){let t=e.checkVisibility;return typeof t==="function"?t.call(e,{checkVisibilityCSS:!0}):!0}function Gi(e,t=document){let n=[],r=[];for(let o of e){let s=t.querySelector(je(J(o)));if(!s)continue;if(iu(s)){let i=oe(s);n.push({path:o,rect:{height:i.height,width:i.width,x:i.x,y:i.y}})}else r.push(o)}return{hidden:r,hits:n}}var au=new Set(["toggle","show","hide"]);function lu(e,t){if(!(e instanceof Element))return;let n=e.closest("[popovertarget]"),r=n?.getAttribute("popovertarget");if(!n||!r)return;let i=[...n.ownerDocument.querySelectorAll("[data-jx-popover]")].find((l)=>l.id===r)?.dataset.jxPath;if(!i)return;let a=n.getAttribute("popovertargetaction")??"toggle",c=au.has(a)?a:"toggle";t.post({action:c,kind:"popoverTargetClick",targetPath:q(i)})}function cu(e,t){if(!(e instanceof Element))return;let n=e.closest("[data-jx-commandfor]"),r=n?.dataset.jxCommandfor,o=n?.getAttribute("command")?.trim().toLowerCase()??"";if(!n||!r||!o)return;let a=[...n.ownerDocument.querySelectorAll("[data-jx-popover], dialog[data-jx-path]")].find((c)=>c.id===r)?.dataset.jxPath;if(!a)return;t.post({command:o,kind:"commandTargetClick",targetPath:q(a)})}function Yi(e,t=document,n){let r=null,o=null,s=n?.getGen?.()??0,i=()=>n?.getMode?.()==="preview",a=()=>{e.post({kind:"paneFocus"})},c=(g)=>{if(i()){if(g.target instanceof Element){let E=g.target.closest("a[href]")?.getAttribute("href");if(E&&!E.startsWith("#"))g.preventDefault(),e.post({href:E,kind:"previewNavigate"})}return}if(n?.getMode?.()==="stylebook"&&g.target instanceof Element&&g.target.closest("a"))g.preventDefault();let v=qi(g.target);if(v){let P=g;e.post({additive:P.ctrlKey===!0||P.metaKey===!0,hit:v,kind:"hit"})}lu(g.target,e),cu(g.target,e)},l=(g)=>{if(i())return;let v=g?.dataset.jxPath??null;if(v===r)return;r=v,e.post({hit:g&&v?zi(g,v):null,kind:"hover"})},u=()=>{let g=n?.getGen?.()??s;if(g!==s)s=g,o="none"},f=(g,v)=>{if(!n||n.getMode?.()==="stylebook"||i())return;u();let P=n.getShadowDoc(),E=Yr(g instanceof Element?g:null),_=E&&P?Ai(E,v,P):null,R=Ci(_);if(R===o)return;o=R,e.post({kind:"insertZones",zones:_})},d=0,m=null,w=0,y=0,h=(g)=>t.defaultView?.requestAnimationFrame(g)??requestAnimationFrame(g),x=(g)=>t.defaultView?.cancelAnimationFrame(g)??cancelAnimationFrame(g),S=()=>{d=0;let g=m;m=null,l(Yr(g instanceof Element?g:null)),f(g,{x:w,y})},A=(g)=>{let v=g;if(m=g.target,w=v.clientX,y=v.clientY,d)return;d=h(S)},C=(g)=>{if(!su(g,t))return;if(l(null),n&&!i()&&o!=="none")o="none",e.post({kind:"insertZones",zones:null})},T=(g)=>{let v=g;if(i())return;let P=me()?it():null;if(P&&g.target instanceof Node&&P.contains(g.target))return;let E=qi(g.target);if(!E)return;g.preventDefault(),e.post({kind:"contextMenu",path:E.path,x:v.clientX,y:v.clientY})};return t.addEventListener("pointerdown",a,!0),t.addEventListener("click",c,!0),t.addEventListener("pointermove",A,!0),t.addEventListener("pointerleave",C,!0),t.addEventListener("contextmenu",T,!0),()=>{if(d)x(d),d=0;t.removeEventListener("pointerdown",a,!0),t.removeEventListener("click",c,!0),t.removeEventListener("pointermove",A,!0),t.removeEventListener("pointerleave",C,!0),t.removeEventListener("contextmenu",T,!0)}}var uu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function fu(e){let t=e instanceof Element?e:null;while(t){if(t.dataset?.jxPath)return t;t=t.parentElement}return null}function Zr(e,t,n){let r=Ao(e,t,n);return fu(r)}function Qr(e,t,n,r){let o=e.dataset?.jxPath;if(o==null)return null;let s=q(o);if(s.length===0){let d=[...e.children];if(d.length===0)return Xr(r,s)?{edge:"inside",instruction:"make-child",referenceRect:Fe(e),targetPath:s}:null;return du(d,t,s,r)}if(!Xr(r,s))return null;let i=Z(n,s),a=(be(i?.tagName)||"div").toLowerCase(),c=Array.isArray(i?.children)&&i.children.some((d)=>d!=null&&typeof d==="object"),l=uu.has(a)||!c,u=Fe(e),f=u.height===0?0:(t-u.y)/u.height;if(l)return f<0.5?{edge:"top",instruction:"reorder-above",referenceRect:u,targetPath:s}:{edge:"bottom",instruction:"reorder-below",referenceRect:u,targetPath:s};if(f<0.25)return{edge:"top",instruction:"reorder-above",referenceRect:u,targetPath:s};if(f>0.75)return{edge:"bottom",instruction:"reorder-below",referenceRect:u,targetPath:s};return{edge:"inside",instruction:"make-child",referenceRect:u,targetPath:s}}function du(e,t,n,r){let o=1/0,s="reorder-below",i=e.length-1;for(let c=0;c<e.length;c++){let l=Fe(e[c]),u=Math.abs(t-l.y),f=Math.abs(t-(l.y+l.height));if(u<o)o=u,s="reorder-above",i=c;if(f<o)o=f,s="reorder-below",i=c}let a=[...n,"children",i];if(!Xr(r,a))return null;return{edge:s==="reorder-above"?"top":"bottom",instruction:s,referenceRect:Fe(e[i]),targetPath:a}}function Xr(e,t){if(e.type!=="tree-node")return!0;let n=e.path;if(vi(n,t))return!1;return!nt(n,t)}function Fe(e){let t=oe(e);return{height:t.height,width:t.width,x:t.x,y:t.y}}var pu=40,Xi=12;function eo(e,t,n=pu){if(e<n)return-1;if(e>t-n)return 1;return 0}var to=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),no=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),Zi=new Set(["deleteByCut","deleteContent"]),Qi=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),mu="format",hu=new Set(["insertParagraph","insertLineBreak"]);function ea(e){let{inputType:t,from:n,to:r}=e;if(t==="insertCompositionText"||t==="insertFromComposition")return{kind:"native"};if(t==="historyUndo"||t==="historyRedo")return{kind:"reject"};if(t.startsWith(mu))return{kind:"reject"};if(t==="insertFromDrop"||t==="deleteByDrag")return{kind:"reject"};if(e.inPropHost)return hu.has(t)?{kind:"reject"}:{kind:"native"};if(!n||!r)return{kind:"reject"};let o=Mt(n,r)&&n.offset===r.offset,s=!Mt(n,r);if(t==="insertParagraph")return{from:n,kind:"split",to:r};if(t==="insertLineBreak"&&!s)return{kind:"native"};if(o&&to.has(t)&&e.atBlockStart)return{at:n,kind:"mergeBackward"};if(o&&no.has(t)&&e.atBlockEnd)return{at:n,kind:"mergeForward"};if(s){if(Qi.has(t)||t==="insertLineBreak")return{from:n,kind:"replaceRange",text:e.data,to:r};if(to.has(t)||no.has(t)||Zi.has(t))return{from:n,kind:"replaceRange",text:"",to:r};return{kind:"reject"}}if(Qi.has(t)||to.has(t)||no.has(t)||Zi.has(t))return{kind:"native"};return{kind:"native"}}var gu=500;function Nn(e,t){let n=e.ownerDocument.getSelection();if(!n||n.rangeCount===0||!n.anchorNode||!n.focusNode)return null;if(!e.contains(n.anchorNode)||!e.contains(n.focusNode))return null;let r=Nt(n.anchorNode,n.anchorOffset,t),o=Nt(n.focusNode,n.focusOffset,t);return r&&o?{anchor:r,head:o}:null}function It(e,t){let n=Dr(e,t.anchor),r=Dr(e,t.head)??n;if(!n)return!1;let o=e.ownerDocument.getSelection();if(!o)return!1;let s=e.ownerDocument.createRange();if(s.setStart(n.node,n.offset),o.removeAllRanges(),o.addRange(s),r&&r!==n)o.extend(r.node,r.offset);return!0}function ta(e,t){let n=e.ownerDocument,r=null,o=null,s=()=>{let T=t.getMode?.();return T===void 0||T==="design"||T==="edit"},i=0,a=()=>{if(i)clearTimeout(i),i=0},c=()=>{if(i=0,!r||!t.onCommitTick)return;let T=Nn(e,t.isEditableBlock);if(t.onCommitTick(),T)It(e,T)},l=!1,u=()=>{if(!t.onCommitTick||!r||l)return;a(),i=setTimeout(c,t.commitDelayMs??gu)},f=()=>{l=!0,a()},d=()=>{l=!1,u()},m=()=>{a(),r=null,o=null},w=()=>{if(!r)return;a(),r=null,o=null,t.onDeactivate()},y=()=>{if(!s()){w();return}let g=n.getSelection()?.focusNode??null;if(!g)return;if(!e.contains(g)){w();return}let v=Sn(g,t.isEditableBlock);if(!v){if(r?.contains(g)){t.onSelectionChange?.();return}w();return}let P=J(v.path);if(P===o){t.onSelectionChange?.();return}w(),r=v.el,o=P,t.onActivate(v.el,v.path)},h=(T)=>{let[g]=typeof T.getTargetRanges==="function"?T.getTargetRanges():[],v=n.getSelection(),P=v&&v.rangeCount>0&&(v.isCollapsed||!g),E,_,R,I;if(P)({startContainer:E,startOffset:_,endContainer:R,endOffset:I}=v.getRangeAt(0));else if(g)({startContainer:E,startOffset:_,endContainer:R,endOffset:I}=g);else return null;let te=Nt(E,_,t.isEditableBlock),b=Nt(R,I,t.isEditableBlock),k=Sn(R,t.isEditableBlock);return te&&b&&k?{endEl:k.el,from:te,to:b}:null},x=(T)=>{let g=T;if(!s())return;let v=h(g),P=ea({atBlockEnd:v?v.to.offset>=Or(v.endEl):!1,atBlockStart:v?fi(v.from):!1,data:g.data??"",from:v?.from??null,inPropHost:r!==null&&o===null,inputType:g.inputType,to:v?.to??null});switch(P.kind){case"native":return;case"split":{if(g.preventDefault(),!Mt(P.from,P.to)&&!t.onReplaceRange)return;t.onSplit?.();return}case"mergeBackward":{g.preventDefault(),t.onMergeBackward?.(P.at);return}case"mergeForward":{g.preventDefault(),t.onMergeForward?.(P.at);return}case"replaceRange":{g.preventDefault(),t.onReplaceRange?.(P.from,P.to,P.text);return}default:g.preventDefault()}},S=(T)=>{if(!s()||!t.onPropActivate)return;let g=T.target instanceof Element?T.target:null;while(g&&g!==e){if(g.dataset?.jxBoundProp){if(g!==r){if(w(),t.onPropActivate(g))r=g,o=null}return}if(g.dataset?.jxPath)return;g=g.parentElement}},A=(T)=>{T.preventDefault()},C=()=>u();return n.addEventListener("selectionchange",y),e.addEventListener("beforeinput",x),e.addEventListener("input",C),e.addEventListener("compositionstart",f),e.addEventListener("compositionend",d),e.addEventListener("dragstart",A),n.addEventListener("pointerdown",S,!0),{capture:()=>Nn(e,t.isEditableBlock),forget:m,isComposing:()=>l,flush:()=>{if(l)return;if(i)a(),c()},placeCaret:(T)=>{let g=It(e,{anchor:T,head:T});if(g)y();return g},restore:(T)=>{let g=It(e,T);if(g)y();return g},stop:()=>{n.removeEventListener("selectionchange",y),e.removeEventListener("beforeinput",x),e.removeEventListener("input",C),e.removeEventListener("compositionstart",f),e.removeEventListener("compositionend",d),e.removeEventListener("dragstart",A),n.removeEventListener("pointerdown",S,!0),w()},sync:y}}var na=(e,t)=>document.execCommand(e,!1,t);function ra(e){let t=window.getSelection();if(!t||!t.rangeCount)return{active:!1,href:null};let n=t.anchorNode;while(n&&n!==e){if(n.nodeType===Node.ELEMENT_NODE&&n.tagName.toLowerCase()==="a"){let r=n;return{active:!0,href:r.dataset.jxHref??r.getAttribute("href")}}n=n.parentNode}return{active:!1,href:null}}function xu(e){let t=window.getSelection();if(!t||!t.rangeCount)return null;let n=t.anchorNode;while(n&&n!==e){if(n.nodeType===Node.ELEMENT_NODE&&n.tagName.toLowerCase()==="a")return n;n=n.parentNode}return null}function oa(e,t){let n=xu(e);if(n)if(t)n.setAttribute("href",t);else{let r=document.createDocumentFragment();while(n.firstChild)r.append(n.firstChild);n.replaceWith(r)}else if(t)na("createLink",t);rt(e)}function sa(e,t){e.focus(),na("insertText",`\${${t}}`)}var Mn=new Set(["img","video","source","iframe","audio"]),_n="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",yu="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";var bu=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function wu(e){return bu.test(e)}var Eu=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),vu=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),ia=["empty-text-placeholder","empty-container-placeholder"];function ro(e){if(!e.tagName||e.textContent||e.innerHTML)return null;if(e.$__layout)return null;if(Array.isArray(e.children)&&e.children.length>0)return null;if(Eu.has(be(e.tagName)))return"empty-text-placeholder";if(vu.has(be(e.tagName)))return"empty-container-placeholder";return null}function Jt(e){return e.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function aa(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);while(t.nextNode()){let n=t.currentNode;if(n.data.includes("❪"))n.data=n.data.replaceAll(/\u276A\s*(.*?)\s*\u276B/g,"${$1}")}}function Su(e){let t=e.map;return{children:t&&typeof t==="object"?[Te(t)]:[],className:"repeater-perimeter",tagName:"div"}}function Te(e){if(!e||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>Te(i));if(e.$prototype==="Array")return Su(e);let t=e,n={},r=!1,o=Mn.has(t.tagName||"");if(o){let{attributes:i,src:a}=t,c=i?.src,l=t.poster,u=i?.poster;if(!(a&&a!==""||c&&c!=="")&&!(l&&l!==""||u&&u!==""))r=!0}for(let[i,a]of Object.entries(t))if(i==="state"||i==="$media"||i==="$elements")n[i]=a;else if(i==="$props"&&a&&typeof a==="object"){let c={};for(let[l,u]of Object.entries(a))if(typeof u==="string"&&u.includes("${"))if(wu(l))c[l]=yu;else if(l==="href"||l==="action")c[l]="";else c[l]=Jt(u);else if(u&&typeof u==="object"&&u.$ref){let f=u.$ref,d=f.startsWith("#/state/")?f.slice(8):f;c[l]=`{${d}}`}else c[l]=u;n[i]=c}else if(i==="children")if(Array.isArray(a))n.children=a.map((c)=>Te(c));else if(a&&typeof a==="object"&&a.$prototype==="Array")n.children=[Te(a)];else n.children=Te(a);else if(i==="cases"&&t.$switch&&a&&typeof a==="object"){let c=Object.keys(a);if(c.length>0){let l=a[c[0]];n.children=l&&typeof l==="object"&&!l.$ref?[Te(l)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${c.join(" | ")}]`}]}}else if(i==="attributes"&&o&&a&&typeof a==="object"){let c=a,l={};for(let[u,f]of Object.entries(c))if(u==="src"||u==="poster")if(typeof f==="string"&&f!==""&&!f.includes("${"))l[u]=f;else r=!0,l[u]=_n;else if(typeof f==="string"&&f.includes("${")){let d=u==="href"||u==="action";l[u]=d?"":Jt(f)}else if(f&&typeof f==="object"&&f.$ref){let d=f.$ref,m=d.startsWith("#/state/")?d.slice(8):d;l[u]=`{${m}}`}else l[u]=f;n.attributes=l}else if(i==="style")if(a&&typeof a==="object"){let c={};for(let[l,u]of Object.entries(a))if(typeof u!=="string"||!u.includes("${"))c[l]=u;n.style=c}else n.style=a;else if(typeof a==="string"&&a.includes("${"))if((i==="src"||i==="poster")&&Mn.has(t.tagName||""))r=!0,n[i]=_n;else{let l=i==="src"||i==="href"||i==="poster"||i==="action";n[i]=l?"":Jt(a)}else if(a&&typeof a==="object"&&a.$ref){let c=a.$ref,l=c.startsWith("#/state/")?c.slice(8):c;if((i==="src"||i==="poster")&&Mn.has(t.tagName||""))r=!0,n[i]=_n;else n[i]=`{${l}}`}else if((i==="src"||i==="poster")&&a===""&&Mn.has(t.tagName||""))r=!0,n[i]=_n;else n[i]=Te(a);let s=ro(n);if(s)n.className=n.className?`${n.className} ${s}`:s;if(r){let i=n.className||"";if(!i.includes("empty-media-placeholder"))n.className=i?`${i} empty-media-placeholder`:"empty-media-placeholder"}return n}var ku={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},Tu=["strong","em","u","del","sub","sup","code"],On="jx-pending-format",la="jx-pending-format-style";function Au(e){let t=e.parentElement;while(t){if(t.tagName.includes("-"))return t;t=t.parentElement}return null}function Cu(e,t){if(!e)return!1;let n=e.attributes;if(n){if(n[`props.${t}`]!==void 0)return!0;let r=new Set([t.toLowerCase(),sn(t).toLowerCase()]);for(let[s,i]of Object.entries(n))if(i!==void 0&&r.has(s.toLowerCase()))return!0;let o=n["data-jx-props"];if(typeof o==="string"&&Pu(o,t))return!0}if(Pt.has(t)||t.startsWith("$"))return!1;return e[t]!==void 0}function Pu(e,t){try{let n=JSON.parse(e);return typeof n==="object"&&n!==null&&t in n}catch{return!1}}function ca(e,t){let r=J(t).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),o=e.querySelector(`[data-jx-path='${r}']`);return o instanceof HTMLElement?o:null}function Ru(e){return{height:e.height,width:e.width,x:e.x,y:e.y}}function ua(e,t,n){let r=t.ownerDocument,o=()=>{let b=n?.getMode?.();return b===void 0||b==="design"||b==="edit"},s=null,i=0,a=(b)=>{let k=window.getSelection();if(!k||!k.rangeCount)return null;let N=k.getRangeAt(0);return b.contains(N.commonAncestorContainer)?N:null},c=()=>{let b=it();if(!b)return;let k=a(b);if(k&&!k.collapsed)s=k.cloneRange()},l=()=>{if(r.querySelector(`#${la}`))return;let b=r.createElement("style");b.id=la,b.textContent=`::highlight(${On}) { background-color: Highlight; color: HighlightText; }`,r.head.append(b)},u=()=>{let b=globalThis.Highlight,k=globalThis.CSS?.highlights;if(!b||!k)return;if(s&&s.startContainer.isConnected)l(),k.set(On,new b(s.cloneRange()));else k.delete(On)},f=()=>{globalThis.CSS?.highlights?.delete(On)},d=()=>{let b=it();if(!b||!b.dataset.jxPath)return null;let k=a(b),N=k??s,F=N?Ru(To(N)):null,B=k?k.collapsed:!0,X=Tu.filter((Ae)=>Ri(Ae,b)),ne=ra(b);if(ne.active)X.push("a");return i+=1,{activeTags:X,collapsed:B,kind:"selectionChanged",link:ne,localScope:null,path:q(b.dataset.jxPath),rect:F,seq:i}},m=()=>{if(!me())return;c(),u();let b=d();if(b)e.post(b)},w=!1,y=(b,k)=>{aa(b),e.post({kind:"editStart",path:k}),Br(b,k,{onCommit:(N,F,B,X)=>{w=!1,e.post({children:F,kind:"editCommit",path:N,textContent:B,...X?{inPlace:!0}:{}})},onEnd:()=>{f(),s=null,e.post({kind:"editEnd"})},onInsert:(N,F,B)=>e.post({cmd:F,commitData:B,kind:"editInsert",path:N}),onSplit:(N,F,B)=>e.post({after:B,before:F,kind:"editSplit",path:N})}),c(),m()},h=(b,k)=>{let N=n?.getShadowDoc?.();if(!N)return!0;let F=Z(N,b);if(Cu(F,k))return!1;let B=F?.$props?.[k];if(B==null)return!0;if(typeof B!=="string")return!1;return!B.includes("${")},x=(b,k,N)=>{e.post({kind:"editStart",path:k,prop:N}),Br(b,k,{onCommit:(F,B,X,ne)=>{w=!1,e.post({kind:"editCommitProp",path:F,prop:N,value:X??"",...ne?{inPlace:!0}:{}})},onEnd:()=>{f(),s=null,E.forget(),e.post({kind:"editEnd"})},onInsert:()=>{},onSplit:()=>{}},{plainText:!0})},S=(b)=>{let k=it();if(!k)return;if(Ii())return;if(s&&s.startContainer.isConnected&&k.contains(s.commonAncestorContainer)){let N=window.getSelection();k.focus(),N?.removeAllRanges(),N?.addRange(s)}if(b.command==="link")oa(k,b.href);else if(b.command==="insertData")sa(k,b.token);else{let N=ku[b.command];if(N)$i(N,k)}c(),m()},A=(b)=>{let k=b.dataset.jxBoundProp,N=Au(b),F=N?.dataset.jxPath;if(!k||!N||!F)return!1;let B=q(F);if(!h(B,k))return!1;return x(b,B,k),!0},C=(b,k)=>{let N=di(t,b,k,He);if(!N)return!1;let[F,B]=k===-1?[b,N.path]:[N.path,b];return E.flush(),e.post({fromPath:F,intoPath:B,kind:"editMerge"}),!0},T=(b,k,N)=>{let F=Lr(t,He),B=J(b.path),X=J(k.path),ne=F.findIndex((ae)=>ae.dataset.jxPath===B),Ae=F.findIndex((ae)=>ae.dataset.jxPath===X);if(ne===-1||Ae===-1||Ae<=ne)return!1;let Ht=F.slice(ne+1,Ae).map((ae)=>q(ae.dataset.jxPath));return E.flush(),e.post({between:Ht,from:b,kind:"editRangeReplace",text:N,to:k}),!0},g=()=>c(),v=()=>c(),P=()=>c(),E=ta(t,{getMode:()=>n?.getMode?.()??"edit",isEditableBlock:He,onActivate:(b,k)=>y(b,k),onDeactivate:()=>{if(me())xe()},onCommitTick:()=>Li(),onMergeBackward:(b)=>C(b.path,-1),onMergeForward:(b)=>C(b.path,1),onReplaceRange:(b,k,N)=>T(b,k,N),onPropActivate:A,onSelectionChange:()=>m(),onSplit:()=>Hi()}),_=(b)=>Vi(b),R=()=>{if(ji())Gr()},I=()=>{if(!w)w=!0,e.post({kind:"editInput"})};t.addEventListener("input",I),t.addEventListener("keydown",_),t.addEventListener("input",R),r.addEventListener("mouseup",g,!0),r.addEventListener("keyup",v,!0),r.addEventListener("blur",P,!0);let te=e.onMessage((b)=>{if(b.kind==="applyFormat"){S(b.intent);return}if(b.kind==="openSlash"){zr({anchored:!1});return}if(b.kind==="flushEdits"){E.flush(),e.post({kind:"flushComplete",reqId:b.reqId});return}if(b.kind==="endEdit"){if(me())xe();return}if(b.kind!=="enterEdit")return;if(!o())return;if(b.prop!==void 0){let F=ca(t,b.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(b.prop)}"]`);if(F)A(F);return}let k=ca(t,b.path);if(k&&He(k))E.placeCaret({offset:b.offset??0,path:b.path})});return()=>{if(t.removeEventListener("keydown",_),t.removeEventListener("input",R),t.removeEventListener("input",I),r.removeEventListener("mouseup",g,!0),r.removeEventListener("keyup",v,!0),r.removeEventListener("blur",P,!0),E.stop(),te(),f(),s=null,me())xe()}}var $u=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function fa(e,t){let n=!1,r=null,o=null,s={dismiss:()=>{if(!n)return;n=!1,o=null,e.post({kind:"slashDismiss"})},isOpen:()=>n,show:(l,u,f)=>{if({onSelect:r}=f,n&&u===o)return;n=!0,o=u;let d=oe(l);e.post({filter:u,kind:"slashShow",rect:{height:d.height,width:d.width,x:d.left,y:d.top},...f.showFilter===!0?{showFilter:!0}:{}})}};Wr(s);let i=(l)=>{if(!n||!$u.has(l.key))return;l.preventDefault(),l.stopPropagation(),e.post({key:l.key,kind:"slashNav"})},a=()=>{if(n)s.dismiss()};t.addEventListener("keydown",i,!0),t.addEventListener("mousedown",a,!0);let c=e.onMessage((l)=>{if(l.kind==="slashSelect"){n=!1,o=null,r?.({...l.cmd});return}if(l.kind==="slashDismissed")n=!1,o=null});return()=>{t.removeEventListener("keydown",i,!0),t.removeEventListener("mousedown",a,!0),c(),Wr({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var da=["global","canvas","caret","grid","code","dock","palette"];var hp={"commandbar/primary":{admits:["application","document"],note:"document only for Save / Undo / Redo / Open in Browser, by frequency; ≤5 total"},"commandbar/overflow":{admits:["application","project","document"],note:"never selection — the Command Bar is not a selection surface"},"statusbar/project":{admits:["project"],note:"the status bar's left field"},"statusbar/document":{admits:["document"],note:"the status bar's centre field"},"statusbar/selection":{admits:["selection"],note:"the status bar's right field"},"context/element":{admits:["selection"],note:"the canvas element menu acts on a selection"},"context/file":{admits:["project"],note:"a file row addresses the project's file set"},"context/layer":{admits:["selection"],note:"an outline row IS a selection"},"context/tab":{admits:["document"],note:"a tab addresses one document"},"context/pane":{admits:["document"],note:"a pane hosts one document"},blockbar:{admits:["selection"],note:"the floating bar owns selection-scoped verbs"},"blockbar/format":{admits:["selection"],note:"the bar's inline-format cluster — a range inside the selection is still the selection"},"outline/row":{admits:["selection"],note:"row actions act on the row's node"},"settings/menu":{admits:["application","project"],note:"the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it "+"may host two levels for the reason commandbar/overflow does: a menu prints each row's own name, chord and gate, and draws a divider where the level changes. The rail's PINNED groups stay single-level, in PANEL_PLACEMENT_MATRIX"},palette:{admits:["application","project","document","selection"],note:"the level-agnostic surface; it groups rows by level"},never:{admits:["application","project","document","selection"],note:"keyboard- and API-only; no rendered surface to be misplaced in"}};var Nu=["mod","ctrl","alt","shift"],Mu={mod:"mod",cmd:"mod",command:"mod",meta:"mod",super:"mod",ctrl:"ctrl",control:"ctrl",alt:"alt",opt:"alt",option:"alt",shift:"shift"},_u={up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",esc:"escape",space:" ",spacebar:" ",del:"delete",plus:"=",return:"enter"};function Ou(e){return[...Nu.filter((n)=>e[n]),e.key].join("+")}function Du(e){return/^Digit(\d)$/.exec(e??"")?.[1]}function pa(e,t){let n=Du(e.code)??e.key.toLowerCase();if(Mu[n])return"";let r={mod:t?e.metaKey:e.ctrlKey,ctrl:t?e.ctrlKey:!1,alt:e.altKey,shift:e.shiftKey,key:_u[n]??n};return Ou(r)}var yp=["global",...da.filter((e)=>e!=="global"&&e!=="palette")];var Lu=["caret","global"],Iu=["canvas","global"],Ju=["global"],Dn={chords:[],mac:!1};function ju(e){if(!(e instanceof HTMLElement))return!1;return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"}function Hu(e,t){if(e)return Lu;return t==="preview"?Ju:Iu}function Fu(e,t=Dn,n=!1,r="design"){if(ju(e.target))return!1;let o=pa(e,t.mac);if(!o)return!1;let s=Hu(n,r);return t.chords.some((i)=>i.chord===o&&s.includes(i.scope))}function Wu(e){return{altKey:e.altKey,code:e.code,ctrlKey:e.ctrlKey,key:e.key,metaKey:e.metaKey,shiftKey:e.shiftKey}}function ma(e,t=document,n=()=>!1,r=()=>Dn,o=()=>"design"){let s=(i)=>{if(!Fu(i,r(),n(),o()))return;i.preventDefault(),e.post({event:Wu(i),kind:"forwardKey"})};return t.addEventListener("keydown",s,!0),()=>t.removeEventListener("keydown",s,!0)}function Bu(e){return JSON.parse(JSON.stringify(e))}function Ln(e){return e===void 0||e===null?e:Bu(e)}function at(e,t){let n=e;for(let r of t){if(n==null)return;n=n[r]}return n}function lt(e){if(Array.isArray(e))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!e.children)e.children=[];if(!Array.isArray(e.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return e.children}function oo(e,t){switch(t.op){case"set-key":{let n=at(e,t.path);if(!n)throw Error(`doc-op-node-not-found:${t.path.join("/")}`);let r=n;if(t.value===void 0)delete r[t.key];else r[t.key]=Ln(t.value);return}case"insert-child":{let n=at(e,t.parentPath);lt(n).splice(t.index,0,Ln(t.node));return}case"remove-child":{let n=at(e,t.parentPath);lt(n).splice(t.index,1);return}case"set-child":{let n=at(e,t.parentPath);lt(n).splice(t.index,1,Ln(t.node));return}case"move-child":{Ku(t);let n=at(e,t.fromParentPath),r=at(e,t.toParentPath),o=lt(n),s=lt(r),[i]=o.splice(t.fromIndex,1);s.splice(t.toIndex,0,i);return}default:break}throw Error(`unknown-doc-op:${t.op}`)}function Ku(e){let t=[...e.fromParentPath,"children",e.fromIndex],n=e.toParentPath;if(n.length>=t.length&&t.every((r,o)=>r===n[o]))throw Error(`doc-op-move-into-self:${n.join("/")}`)}function ct(e){if(!e||typeof e!=="object")return e;if(Array.isArray(e))return e.map((n)=>ct(n));let t={};for(let[n,r]of Object.entries(e)){if(n.startsWith("on")&&Po(r))continue;if(n==="children")t.children=Array.isArray(r)?r.map((o)=>ct(o)):ct(r);else if(n==="cases"&&typeof r==="object"){let o={};for(let[s,i]of Object.entries(r))o[s]=ct(i);t.cases=o}else if(n==="state"&&typeof r==="object"&&r!==null){let o={};for(let[s,i]of Object.entries(r)){if(i&&typeof i==="object"&&i.timing==="server")continue;o[s]=i}t.state=o}else if(n==="style"||n==="attributes"||n==="$media")t[n]=r;else t[n]=r}return t}var so=new WeakMap,In=new Set;function io(e,t,n){let r=Z(e,t);if(r===void 0)throw Error(`iframe-patch-node-not-found:${t.join("/")}`);let o=typeof r==="string"?r:Te(ct(r)),{result:s,stop:i}=xn(()=>de(o,n.defs,{_path:Vu(t,n),onNodeCreated:Hr(n.mapperCtx)}));if(In.add(i),s instanceof HTMLElement)so.set(s,i);return s}function ao(e){let t=[e,...e.querySelectorAll("*")];for(let n of t){if(!(n instanceof HTMLElement))continue;mn(n);let r=so.get(n);if(r)r(),In.delete(r),so.delete(n)}}function ha(){for(let e of In)e();In.clear()}function Vu(e,t){let{mapperCtx:n}=t;if(n.layoutWrapped&&n.pageContentPrefix&&e[0]==="children"){let[,r]=e;return typeof r==="number"?[...n.pageContentPrefix,r+(n.pageContentOffset??0),...e.slice(2)]:[...n.pageContentPrefix,...e.slice(1)]}return e}function ya(e,t,n,r,o){for(let i of t)oo(e,i);if(!o?.length){for(let i of t)ga(e,i,n,r);return}let s=new Set(o.map((i)=>J(i)));for(let i of t){if(i.op==="set-key"&&s.has(J(i.path))){Uu(e,i.path,n);continue}ga(e,i,n,r)}}function Uu(e,t,n){let r=Ea(n,t);if(r)ut(r,Z(e,t))}function lo(e){if(!e)throw Error("iframe-patch-no-render-ctx");return e}function ga(e,t,n,r){switch(t.op){case"set-key":{if(t.key==="style"){Xu(e,t.path,n,r);return}if(t.key==="textContent"){Zu(e,t.path,n);return}if(t.key.startsWith("on"))return;xa(e,t.path,n,lo(r));return}case"insert-child":{qu(e,t.parentPath,t.index,n,lo(r));return}case"set-child":{xa(e,[...t.parentPath,"children",t.index],n,lo(r));return}case"remove-child":{zu(e,t.parentPath,t.index,n);return}case"move-child":{Gu(e,t.fromParentPath,t.fromIndex,t.toParentPath,t.toIndex,n);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(t)}`)}}function qu(e,t,n,r,o){let s=We(r,t),i=Z(e,t),a=io(e,[...t,"children",n],o);Jn(r,t,n,1),ba(s,a,wa(s,i,n)),ut(s,i)}function xa(e,t,n,r){let o=We(n,t),s=io(e,t,r);ao(o),o.replaceWith(s)}function zu(e,t,n,r){let o=We(r,[...t,"children",n]),s=o.parentElement;if(ao(o),o.remove(),Jn(r,t,n+1,-1),s)ut(s,Z(e,t))}function Gu(e,t,n,r,o,s){let i=[...t,"children",n],a=We(s,i),c=a.parentElement,l=We(s,r);a.remove(),Jn(s,t,n+1,-1);let u=jn(l)??r;Jn(s,u,o,1),Yu(a,i,[...u,"children",o]);let f=Z(e,u);if(ba(l,a,wa(l,f,o)),c)ut(c,Z(e,jn(c)??t));ut(l,f)}function ut(e,t){for(let r of ia)e.classList.remove(r);let n=t?ro(t):null;if(n)e.classList.add(n)}function ba(e,t,n){if(n)n.before(t);else e.append(t)}function wa(e,t,n){let r=t?.textContent,o=r!=null&&String(r)!==""?1:0;return e.childNodes[o+n]??null}function Jn(e,t,n,r){let o=t.length;for(let s of e.querySelectorAll("[data-jx-path]")){let i=jn(s);if(!i||i.length<o+2||i[o]!=="children")continue;let a=i[o+1];if(typeof a!=="number"||a<n)continue;if(!t.every((l,u)=>i[u]===l))continue;let c=[...i];c[o+1]=a+r,s.dataset.jxPath=J(c)}}function Yu(e,t,n){let r=[e,...e.querySelectorAll("[data-jx-path]")];for(let o of r){let s=jn(o);if(!s||s.length<t.length||!t.every((i,a)=>s[a]===i))continue;o.dataset.jxPath=J([...n,...s.slice(t.length)])}}function jn(e){let t=e.dataset.jxPath;return t===void 0?null:q(t)}function Xu(e,t,n,r){let o=We(n,t),s=Z(e,t),i=r?.defs?.$media??{};En(o,Qu(s?.style),i)}function Zu(e,t,n){let r=We(n,t),o=Z(e,t);r.textContent=ef(o),ut(r,o)}function We(e,t){let n=Ea(e,t);if(!n)throw Error(`iframe-patch-element-not-found:${J(t)}`);return n}function Ea(e,t){let r=J(t).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),o=e.querySelector(`[data-jx-path='${r}']`);return o instanceof HTMLElement?o:null}function Qu(e){if(!e||typeof e!=="object")return;let t={};for(let[n,r]of Object.entries(e)){if(typeof r==="string"&&r.includes("${"))continue;t[n]=r}return t}function ef(e){let t=e?.textContent;if(t==null)return"";if(typeof t==="string")return t.includes("${")?Jt(t):t;if(typeof t==="object"&&t.$ref){let n=String(t.$ref);return`{${n.startsWith("#/state/")?n.slice(8):n}}`}return String(t)}function va(e){if(e===void 0)return"undefined";let t;try{t=typeof e==="string"?JSON.stringify(e):JSON.stringify(e)??"undefined"}catch{t=String(e)}if(t.length>48)t=`${t.slice(0,47)}…`;return t}function tf(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&"$expression"in e&&Array.isArray(e.parameters)}function nf(e,t){let n={};for(let r of Object.keys(e))try{let o=e[r];if(typeof o==="function"){if(tf(t?.[r]))n[r]=o;continue}let s=JSON.stringify(o);n[r]=s===void 0?null:JSON.parse(s)}catch{n[r]=null}return n}function rf(e,t,n){if(!n||n.length===0)return e;let r=t,o=e;for(let s of n){if(!r||typeof r!=="object")break;let i=r;if(i.$prototype==="Array"&&s==="map"){let a=i.items,c=a&&typeof a==="object"&&"$ref"in a?Y(a.$ref,o):a;if(Array.isArray(c)&&c.length>0){let l;try{l=structuredClone(c[0])}catch{l=null}let u=Object.create(o);u.$map={index:0,item:l},u["$map/item"]=l,u["$map/index"]=0,o=u}}r=i[s]}return o}function Sa(e,t,n,r){let o=n&&typeof n==="object"?n.state??null:null;return e.map(({id:s,node:i})=>{let a=new Map,c;try{c=rf(nf(t,o),n,r)}catch(l){return{error:l instanceof Error?l.message:String(l),id:s,values:[]}}try{if(!i||typeof i!=="object"||!("operator"in i))throw Error("not an expression node");return ee(i,c,null,void 0,{report:(l,u)=>a.set(l.join("/"),va(u))}),{id:s,values:[...a.entries()]}}catch(l){return{error:l instanceof Error?l.message:String(l),id:s,values:[...a.entries()]}}})}function ka(e){let t={};for(let n of Object.keys(e))try{let r=e[n];if(typeof r==="function")continue;let o=JSON.stringify(r);if(o===void 0){t[n]=null;continue}if(o.length>256000){t[n]="[large value omitted]";continue}t[n]=JSON.parse(o)}catch{t[n]=null}return t}var Ta={"jx-ui:/behaviors/color-area.ts":()=>(V("jqhna8zy"),import("./chunks/color-area-jqhna8zy.js")),"jx-ui:/behaviors/color-field.ts":()=>(V("embq5ctg"),import("./chunks/color-field-embq5ctg.js")),"jx-ui:/behaviors/color-slider.ts":()=>(V("1qmw7wqy"),import("./chunks/color-slider-1qmw7wqy.js")),"jx-ui:/behaviors/combobox.ts":()=>(V("773hdzyj"),import("./chunks/combobox-773hdzyj.js")),"jx-ui:/behaviors/dialog.ts":()=>(V("mtm9fq5t"),import("./chunks/dialog-mtm9fq5t.js")),"jx-ui:/behaviors/listbox.ts":()=>(V("s8fkmnq8"),import("./chunks/listbox-s8fkmnq8.js")),"jx-ui:/behaviors/menu.ts":()=>(V("37d07z9m"),import("./chunks/menu-37d07z9m.js")),"jx-ui:/behaviors/number-field.ts":()=>(V("gw7sq8rn"),import("./chunks/number-field-gw7sq8rn.js")),"jx-ui:/behaviors/action-group.ts":()=>(V("2mqby73c"),import("./chunks/action-group-2mqby73c.js")),"jx-ui:/behaviors/popover.ts":()=>(V("8htra4er"),import("./chunks/popover-8htra4er.js")),"jx-ui:/behaviors/select.ts":()=>(V("n3v7gwas"),import("./chunks/select-n3v7gwas.js")),"jx-ui:/behaviors/split.ts":()=>(V("pff8f3ze"),import("./chunks/split-pff8f3ze.js")),"jx-ui:/behaviors/swatch-group.ts":()=>(V("8qh9a3bm"),import("./chunks/swatch-group-8qh9a3bm.js")),"jx-ui:/behaviors/tabs.ts":()=>(V("jwthg40w"),import("./chunks/tabs-jwthg40w.js")),"jx-ui:/behaviors/toolbar.ts":()=>(V("2nnzqhrj"),import("./chunks/toolbar-2nnzqhrj.js")),"jx-ui:/behaviors/tree.ts":()=>(V("h19v1jfz"),import("./chunks/tree-h19v1jfz.js")),"jx-ui:/behaviors/tooltip.ts":()=>(V("fd6g9xy3"),import("./chunks/tooltip-fd6g9xy3.js")),"jx-ui:/behaviors/textfield.ts":()=>(V("spy3hc77"),import("./chunks/textfield-spy3hc77.js")),"jx-ui:/behaviors/toast.ts":()=>(V("4d35zd64"),import("./chunks/toast-4d35zd64.js")),"jx-ui:/behaviors/toast-host.ts":()=>(V("8sjmfed3"),import("./chunks/toast-host-8sjmfed3.js")),"jx-ui:/color.ts":()=>(V("fpezvnkt"),import("./chunks/color-fpezvnkt.js")),"jx-ui:/icons.ts":()=>(V("p44xhjf0"),import("./chunks/icons-p44xhjf0.js"))};var of;function Aa(e){of=new URL("./",e).href}Aa(import.meta.url);for(let[e,t]of Object.entries(Ta))Xs(e,t);function jt(e,t,n,r){let o=Zr(e.x,e.y,r);if(!o)return null;return Qr(o,e.y,n,t)}function co(e){return[...e.dataTransfer?.types??[]].includes("Files")}var sf={type:"block"},fo={},uo=null;function Ca(e){return e?{...e,versions:fo}:null}function af(e,t){let n=e.dataset?.jxPath;if(n==null)return null;let r=q(n),o=t?Z(t,r):void 0;return{path:r,rect:Fe(e),tagName:(be(o?.tagName)||e.tagName).toLowerCase()}}function lf(e){if(!(e instanceof Element))return null;if(e.closest("[data-jx-path]"))return null;let t=e.closest("[data-jx-layout-region]");if(!(t instanceof HTMLElement))return null;return{className:typeof t.className==="string"?t.className:"",layoutFile:t.dataset.jxLayoutFile??"",layoutPath:q(t.dataset.jxLayoutPath??"[]"),rect:Fe(t),tagName:t.tagName.toLowerCase()}}var cf=new Set(["style","textContent"]);function uf(e){let t=Ji();if(!t)return!1;for(let n of e){let r;if(n.op==="set-key"){if(cf.has(n.key)||n.key.startsWith("on"))continue;r=n.path}else if(n.op==="move-child"){if(r=n.fromParentPath,nt(r,t)||nt(n.toParentPath,t))return!0;continue}else r=n.parentPath;if(nt(r,t))return!0}return!1}var ff=2,df=5000,pf=500;function mf(e){let{channel:t,container:n}=e;fo={},uo=null;let r=null,o=null,s=-1,i=null,a=-1,c="design",l=null,u=null,f=Dn,d=null,m=null,w=-1,y=-1,h=0,x=null,S=n.ownerDocument.defaultView;function A(){if(h&&S)S.cancelAnimationFrame(h);h=0,x=null}function C(){h=0;let p=x?.src??m;if(!S||!x||!p||!i)return;let D=eo(x.y,S.innerHeight);if(D===0)return;let L=S.scrollY;if(S.scrollBy(0,D*Xi),S.scrollY===L)return;let re=jt(x,p,i,n.ownerDocument);t.post({...x.withCursor?{cursor:{x:x.x,y:x.y}}:{},dragSeq:x.dragSeq,gen:x.gen??w,kind:"dragOver",preview:re}),h=S.requestAnimationFrame(C)}function T(p,D,L){if(!S||eo(p.y,S.innerHeight)===0){A();return}if(x={dragSeq:D,withCursor:L!=null,x:p.x,y:p.y,...L?{gen:L.gen,src:L.src}:{}},!h)h=S.requestAnimationFrame(C)}let g=Yi(t,n.ownerDocument,{getGen:()=>a,getMode:()=>c,getShadowDoc:()=>i}),v=(p)=>{if(c!=="design"&&c!=="edit")return;let D=lf(p.target);if(D)t.post({hit:D,kind:"layoutHit"})};n.ownerDocument.addEventListener("click",v,!0);let P=ma(t,n.ownerDocument,me,()=>f,()=>c),E=ua(t,n,{getMode:()=>c,getShadowDoc:()=>i}),_=fa(t,n.ownerDocument),R=yi(n),I=30000,te=-1;function b(){let p=n.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),D=oe(n),L=0;for(let re of p)L=Math.max(L,oe(re).bottom-D.top);return L}function k(){let p=Math.max(n.scrollHeight,b()),D=Math.min(p,I);if(D>0&&Math.abs(D-te)>=1){te=D;let L=n.firstElementChild,re=L instanceof HTMLElement&&L.dataset.jxDefinitionRoot!==void 0;t.post({fragment:re,height:D,kind:"contentHeight"}),Be()}}let N=S?.ResizeObserver,F=N?new N(()=>k()):null,B=n.ownerDocument,X=0,ne=0,Ae=0,Ht="",ae=new Map;function Pa(){let p=Date.now();for(let[D,L]of ae)if(L<=p)ae.delete(D);return ae.size}function Ra(){return{animations:typeof B.getAnimations==="function"?B.getAnimations().filter((D)=>D.playState==="running").length:0,fonts:B.fonts?B.fonts.status==="loaded":!0,gen:a,images:Pa(),kind:"idle"}}function po(){X=0;let p=Ra(),D=`${p.gen}|${p.fonts}|${p.animations}|${p.images}`,L=D!==Ht;if(L)Ht=D,t.post(p);if(ne=p.fonts&&p.animations===0&&p.images===0?L?1:ne+1:0,ne>=ff){k();return}if(Date.now()>=Ae)return;X=S?S.requestAnimationFrame(po):0}function Be(){if(ne=0,Ae=Date.now()+df,!X&&S)X=S.requestAnimationFrame(po)}let mo=(p)=>{if(p.target instanceof HTMLImageElement)ae.set(p.target,Date.now()+pf),Be()},ho=(p)=>{if(p.target instanceof HTMLImageElement&&ae.delete(p.target))Be()};n.addEventListener("error",mo,!0),n.addEventListener("load",ho,!0),Be(),F?.observe(n);let go=(p)=>{if(c==="preview"){if(p.ctrlKey||p.metaKey)p.preventDefault();return}p.preventDefault(),t.post({ctrlKey:p.ctrlKey,deltaX:p.deltaX,deltaY:p.deltaY,kind:"forwardWheel",metaKey:p.metaKey,shiftKey:p.shiftKey,x:p.clientX,y:p.clientY})};n.ownerDocument.addEventListener("wheel",go,{passive:!1});let $a=300,xo=0,yo=(p,D)=>{p.preventDefault(),p.stopPropagation();let L={x:p.clientX,y:p.clientY},re=n.ownerDocument,O=Zr(L.x,L.y,re),ye=O?af(O,i):null,Wt=i&&O?Qr(O,L.y,i,sf):null;if(D==="fileDragOver"){if(p.dataTransfer)p.dataTransfer.dropEffect="copy";t.post({hit:ye,kind:"fileDragOver",preview:Wt});return}t.post({files:[...p.dataTransfer?.files??[]],hit:ye,kind:"fileDrop",preview:Wt})},Ft=(p)=>{if(!m){if(co(p)){yo(p,"fileDragOver");return}let re=Date.now();if(re-xo>=$a)xo=re,t.post({kind:"nativeDragEnter"});return}if(p.preventDefault(),p.dataTransfer)p.dataTransfer.dropEffect="move";let D={x:p.clientX,y:p.clientY},L=i?jt(D,m,i,n.ownerDocument):null;t.post({cursor:D,dragSeq:y,gen:w,kind:"dragOver",preview:L}),T(D,y)},bo=(p)=>{if(!m){if(co(p))yo(p,"fileDrop");return}p.preventDefault();let D={x:p.clientX,y:p.clientY},L=i?jt(D,m,i,n.ownerDocument):null;t.post({dragSeq:y,gen:w,instruction:L?.instruction??null,kind:"dropResult",targetPath:L?.targetPath??null}),m=null,w=-1,y=-1,A()},wo=(p)=>{if(!m&&co(p)&&!p.relatedTarget)t.post({kind:"fileDragLeave"})};n.ownerDocument.addEventListener("dragenter",Ft,!0),n.ownerDocument.addEventListener("dragover",Ft,!0),n.ownerDocument.addEventListener("dragleave",wo,!0),n.ownerDocument.addEventListener("drop",bo,!0);let Na=t.onMessage((p)=>{if(p.kind==="measure"){let{hidden:O,hits:ye}=Gi(p.paths,n.ownerDocument);t.post({hidden:O,hits:ye,kind:"geometry",reqId:p.reqId});return}if(p.kind==="evalExpr"){let O=p.gen===a&&d&&i?Sa(p.exprs,d.defs,i,p.contextPath):[];t.post({gen:p.gen,kind:"evalResult",reqId:p.reqId,results:O});return}if(p.kind==="patch"){let{gen:O}=p;if(O<a){t.post({gen:O,kind:"patchError",message:"patch-behind-render"});return}if(O>a||!i||!d){t.post({gen:O,kind:"patchError",message:"patch-ahead-of-render"});return}let ye=new Set((p.echoPaths??[]).map((Oe)=>J(Oe))),Wt=ye.size===0?p.forwardOps:p.forwardOps.filter((Oe)=>!(Oe.op==="set-key"&&ye.has(J(Oe.path)))),Eo=me()&&uf(Wt),vo=Eo?Nn(n,He):null;if(Eo)xe();try{if(ya(i,p.forwardOps,n,d,p.echoPaths),_t(n,l),tt(n,u),vo)It(n,vo);t.post({gen:O,kind:"patchComplete"}),Be()}catch(Oe){t.post({gen:O,kind:"patchError",message:String(Oe?.message??Oe)})}return}if(p.kind==="styleUpdate"){if(p.gen!==a||!i)return;i.style=p.style;let O=n.firstElementChild;if(O instanceof HTMLElement)En(O,p.style,i.$media??{});return}if(p.kind==="dragStart"){m=p.src,w=p.gen,y=p.dragSeq;return}if(p.kind==="dragEnd"||p.kind==="dragCancel"){m=null,w=-1,y=-1,A();return}if(p.kind==="dragMove"){let O=m&&i?jt(p.cursor,m,i,n.ownerDocument):null;t.post({dragSeq:p.dragSeq,gen:w,kind:"dragOver",preview:O}),T(p.cursor,p.dragSeq);return}if(p.kind==="drop"){let O=m&&i?jt(p.cursor,m,i,n.ownerDocument):null;t.post({dragSeq:p.dragSeq,gen:w,instruction:O?.instruction??null,kind:"dropResult",targetPath:O?.targetPath??null}),m=null,w=-1,y=-1,A();return}if(p.kind==="assetVersions"){fo=p.versions;let O=Ca(uo);if(O)yn((ye)=>$t(ye,O));return}if(p.kind==="keymap"){f={chords:p.chords,mac:p.mac};return}if(p.kind==="setColorScheme"){jr(n.ownerDocument,p.scheme);return}if(p.kind==="setPopoverOpen"){if(c==="preview")return;l=p.path===null?null:J(p.path),_t(n,l),tt(n,u),k();return}if(p.kind==="setDialogOpen"){if(c==="preview")return;u=p.path===null?null:J(p.path),tt(n,u),k();return}if(p.kind==="redefineElement"){ai(p.doc,p.base);return}if(p.kind==="setLocale"){let O=n.ownerDocument.documentElement;if(p.locale===null)O.removeAttribute("lang"),O.removeAttribute("dir");else O.setAttribute("lang",p.locale),O.setAttribute("dir",p.dir);return}if(p.kind==="siteStyleUpdate"){Jr(p.siteStyle,p.media);return}if(p.kind!=="render"||p.gen<s)return;if(jr(n.ownerDocument,p.colorScheme??null),me())xe();s=p.gen,uo=p.assets??null,Di(p.editableTags??null);let{gen:D,mapperCtx:L}=p,re=p.shadowDoc;(async()=>{try{if(ha(),o?.(),o=null,r?.dispose(),ni(n.ownerDocument),r=await bi({assets:Ca(p.assets??null),container:n,doc:p.doc,docBase:p.docBase,mapperCtx:{arrayPaths:new Set(L.arrayPaths),canvasMode:L.canvasMode,layoutWrapped:L.layoutWrapped,pageContentOffset:L.pageContentOffset,pageContentPrefix:L.pageContentPrefix},diffMarks:p.diffMarks??null,mode:p.mode,popoverOpen:p.popoverOpen?J(p.popoverOpen):null,dialogOpen:p.dialogOpen?J(p.dialogOpen):null,siteStyle:p.siteStyle,...p.allowAutoRequests?{allowAutoRequests:!0}:{}}),D===s){l=p.popoverOpen?J(p.popoverOpen):null,u=p.dialogOpen?J(p.dialogOpen):null,_t(n,l),tt(n,u),i=re,d=r.ctx,a=D,c=p.mode,t.post({gen:D,kind:"renderComplete"}),Be();let O=r.ctx.defs;o=Fs(()=>{try{t.post({gen:D,kind:"dataScope",scope:ka(O)})}catch{}}),k()}}catch(O){t.post({gen:D,kind:"renderError",message:String(O?.message??O)})}})()});return t.post({kind:"ready"}),()=>{if(Na(),g(),P(),E(),_(),R(),X&&S)S.cancelAnimationFrame(X);X=0,n.removeEventListener("error",mo,!0),n.removeEventListener("load",ho,!0),A(),F?.disconnect(),n.ownerDocument.removeEventListener("click",v,!0),n.ownerDocument.removeEventListener("wheel",go),n.ownerDocument.removeEventListener("dragenter",Ft,!0),n.ownerDocument.removeEventListener("dragleave",wo,!0),n.ownerDocument.removeEventListener("dragover",Ft,!0),n.ownerDocument.removeEventListener("drop",bo,!0),o?.(),r?.dispose()}}function hf(e){let t=new URLSearchParams(e.location.search);js(t.get("rpcToken"));let n=t.get("parentOrigin"),r=n||"*";if(!n)console.warn("[jx-canvas] no parentOrigin in iframe URL — accepting messages from any origin (token-gated). "+"The parent origin did not round-trip; the channel relies on the shared token alone.");let o=e.document.querySelector("#jx-canvas-root")??e.document.body,s=ko({acceptOrigin:r,source:e,target:e.parent,targetOrigin:r,token:t.get("token")||""});return mf({channel:s,container:o})}if(typeof window<"u"&&window.parent!==window)hf(window);export{ff as IDLE_QUIET_FRAMES,df as IDLE_WATCH_MAX_MS,pf as IMAGE_RETRY_WINDOW_MS,hf as bootCanvasIframe,af as fileDropHitFor,co as isExternalFileDrag,lf as layoutHitFor,uf as patchDisturbsActiveEdit,mf as startCanvasIframe};
313
+ `;function ad(o,a){let d=o.head.querySelector(`#${ia}`);if(a!=="stylebook"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=ia,f.textContent=sd,o.head.append(f)}function io(o,a={}){let d=document.head.querySelector(`#${oo}`);if(!o||!n(o)){d?.remove();return}let f=ta(o,a,$n);if(d){d.textContent=f;return}let p=document.createElement("style");p.id=oo,p.textContent=f,document.head.append(p)}function so(o,a){if(a)o.documentElement.dataset.colorScheme=a;else delete o.documentElement.dataset.colorScheme}function aa(o){let a=o.documentElement;return{dir:a.getAttribute("dir"),lang:a.getAttribute("lang")}}function sa(o,a,d){if(d===null)o.removeAttribute(a);else o.setAttribute(a,d)}function qn(o,a,d){let f=o.documentElement;sa(f,"lang",a?.locale??d.lang),sa(f,"dir",a?.dir==="rtl"?"rtl":d.dir)}function en(o,a){for(let f of o.querySelectorAll("[data-jx-popover-open]"))delete f.dataset.jxPopoverOpen;if(a===null)return;let d=o.querySelector(`[data-jx-popover]${ot(a)}`);if(d)d.dataset.jxPopoverOpen=""}function vt(o,a){for(let f of o.querySelectorAll("[data-jx-dialog-open]"))delete f.dataset.jxDialogOpen;if(a===null)return;let d=o.querySelector(`dialog${ot(a)}`);if(d)d.dataset.jxDialogOpen=""}function ld(o,a=null){let d=o.$head;if(!Array.isArray(d))return;for(let f of d){if(!n(f)||!f.tagName)continue;let p=String(f.tagName).toLowerCase();if(p==="script"&&!f.attributes?.src)continue;let m={...f.attributes};for(let y of["href","src"]){let E=m[y];if(!e(E)||E==="")continue;if(!E.startsWith("/")&&!E.startsWith(".")&&!E.startsWith("http")){m[y]=`/node_modules/${E}`;continue}m[y]=Xt(E,a)??E}let g=`${p}${m.href?`[href="${String(m.href)}"]`:""}${m.src?`[src="${String(m.src)}"]`:""}`;if(g!==p&&document.head.querySelector(g))continue;let h=document.createElement(p);for(let[y,E]of Object.entries(m))h.setAttribute(y,String(E));if(f.textContent)h.textContent=String(f.textContent);document.head.append(h)}}function ao(o){let a=[],d=(f)=>a.some((p)=>f.length>p.length&&p.every((m,g)=>f[g]===m));return(f,p,m)=>{if(!(f instanceof HTMLElement))return;let g=p.length===0&&n(m)&&e(m.tagName)&&m.tagName.includes("-");if(g)f.dataset.jxDefinitionRoot="";let h=!g&&f.tagName.includes("-")&&Un(o.canvasMode);if(h)f.contentEditable="false",a.push(p);let y=Xs(p,m,o);if(y.kind==="layout"){if(f.dataset.jxLayoutPath=ae(y.layoutPath),y.layoutFile)f.dataset.jxLayoutFile=y.layoutFile;if(y.chrome){if(f.dataset.jxLayoutRegion="",Un(o.canvasMode))f.contentEditable="false"}return}if(f.dataset.jxPath=ae(y.path),!h&&Un(o.canvasMode)&&d(p))f.contentEditable="true"}}function la(o,a=3){let d=new WeakMap,f=(p)=>{let m=p.target;if(!(m instanceof HTMLImageElement))return;if(!m.src||m.src.startsWith("data:"))return;let g=(d.get(m)??0)+1;if(g>a)return;d.set(m,g),setTimeout(()=>{let h=m.src;m.src="",m.src=h},150*g)};return o.addEventListener("error",f,!0),()=>o.removeEventListener("error",f,!0)}async function ca(o){let a=o.assets??null;Dn(a?(g)=>Xt(g,a):null),gs(o.mode!=="preview"),ys(o.mode!=="preview"&&!o.allowAutoRequests),ws(!0),Cs(o.mode!=="preview"&&o.mode!=="stylebook"),As(o.mode!=="preview"),Ps(o.mode!=="preview"),Rs(o.mode==="design"||o.mode==="edit"),io(o.siteStyle,o.doc.$media??{}),ld(o.doc,a),Zu(o.container.ownerDocument,o.mode),ed(o.container.ownerDocument,o.mode),od(o.container.ownerDocument,o.mode),ad(o.container.ownerDocument,o.mode),nd(o.container.ownerDocument,Boolean(o.diffMarks?.length)),zs(o.doc.$media??{}),await Yu(o.doc,o.docBase);let d=await Ln(o.doc,{},o.docBase),f=ao(o.mapperCtx),{result:p,stop:m}=bt(()=>Oe(o.doc,d,{_path:[],onNodeCreated:f}));return o.container.replaceChildren(p),en(o.container,o.popoverOpen??null),vt(o.container,o.dialogOpen??null),id(o.container,o.mode),rd(o.container,o.diffMarks??null),{ctx:{defs:d,docBase:o.docBase,mapperCtx:o.mapperCtx,mode:o.mode},dispose:m}}function cd(o){return JSON.parse(JSON.stringify(o))}function zn(o){return o===void 0||o===null?o:cd(o)}function xe(o,a){let d=o;for(let f of a){if(d==null)return;d=d[f]}return d}function ua(o){if(Array.isArray(o))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!o.children)o.children=[];if(!Array.isArray(o.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return o.children}function lo(o,a){let{op:d}=a;switch(a.op){case"set-key":{let f=xe(o,a.path);if(!f)throw Error(`doc-op-node-not-found:${a.path.join("/")}`);if(a.value===void 0)delete f[a.key];else f[a.key]=zn(a.value);return}case"insert-child":{tn(o,a.parentPath).splice(a.index,0,zn(a.node));return}case"remove-child":{tn(o,a.parentPath).splice(a.index,1);return}case"set-child":{tn(o,a.parentPath).splice(a.index,1,zn(a.node));return}case"move-child":{ud(a);let f=tn(o,a.fromParentPath),p=tn(o,a.toParentPath),[m]=f.splice(a.fromIndex,1);p.splice(a.toIndex,0,m);return}default:break}throw Error(`unknown-doc-op:${d}`)}function tn(o,a){let d=xe(o,a);if(d==null)throw TypeError(`doc-op-node-not-found:${a.join("/")}`);return ua(d)}function ud(o){let a=[...o.fromParentPath,"children",o.fromIndex],d=o.toParentPath;if(d.length>=a.length&&a.every((f,p)=>f===d[p]))throw Error(`doc-op-move-into-self:${d.join("/")}`)}function da(o){return o.length>=2?o.slice(0,-2):null}function fa(o){return o.at(-1)}function pa(o,a){if(o===a)return!0;if(!o||!a||o.length!==a.length)return!1;return o.every((d,f)=>d===a[f])}function Et(o,a){if(o.length>a.length)return!1;return o.every((d,f)=>d===a[f])}var Gn=14,dd="empty-container-placeholder";function ma(o){let a=Pe(o);return{height:a.height,width:a.width,x:a.x,y:a.y}}function fd(o){let a=getComputedStyle(o),{display:d}=a,f=d==="flex"||d==="inline-flex",p=d==="grid"||d==="inline-grid";return f&&a.flexDirection.startsWith("row")||p&&a.gridAutoFlow.startsWith("column")}function xa(o,a,d){let f=o.dataset.jxPath;if(f==null)return null;let p=ge(f);if(o.classList.contains(dd))return[{edge:"center",index:0,insertParentPath:p,rect:ma(o)}];let m=da(p);if(!m)return null;let g=o.parentElement;if(!g)return null;let h=fa(p);if(!i(h))return null;let y=ma(o);if(fd(g)){let C=a.x-y.x;if(C<Gn)return[Yn("left",m,h,ha(y,!0))];if(y.width-C<Gn)return[Yn("right",m,h+1,ga(y,!0))];return null}let E=a.y-y.y;if(E<Gn)return[Yn("top",m,h,ha(y,!1))];if(y.height-E<Gn)return[Yn("bottom",m,h+1,ga(y,!1))];return null}function Yn(o,a,d,f){return{edge:o,index:d,insertParentPath:a,rect:f}}function ha(o,a){return a?{height:o.height,width:0,x:o.x,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y}}function ga(o,a){return a?{height:o.height,width:0,x:o.x+o.width,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y+o.height}}function ya(o){if(!o||o.length===0)return"none";return o.map((a)=>`${a.edge}:${a.insertParentPath.join("/")}:${a.index}`).join("|")}var Xn=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function co(o){return o.nodeType===Node.ELEMENT_NODE}function ba(o){return o.nodeType===Node.TEXT_NODE}function va(o,a){if(!a)return!1;if(a.contentEditable==="plaintext-only")return!1;let d=window.getSelection();if(!d||!d.rangeCount)return!1;let{anchorNode:f,focusNode:p}=d;if(!f||!p)return!1;if(!a.contains(f)||!a.contains(p))return!1;let m=(g)=>{let h=g;while(h&&h!==a){if(co(h)&&h.tagName.toLowerCase()===o)return!0;h=h.parentNode}return!1};return m(f)&&m(p)}function Ea(o,a){if(!a)return;let d=window.getSelection();if(!d||!d.rangeCount)return;let f=d.getRangeAt(0);if(f.collapsed)return;if(!a.contains(f.commonAncestorContainer))return;Td(f);let p=pd(o,f,a);if(p.length>0)md(o,f,a,p);else hd(o,f,a);wt(a)}function pd(o,a,d){let f=[];for(let p of d.querySelectorAll("*"))if(p.tagName.toLowerCase()===o&&a.intersectsNode(p))f.push(p);return f}function md(o,a,d,f){for(let p=f.length-1;p>=0;p--){let m=f[p];wa(m)}}function wa(o){if(!o.parentNode)return;let d=document.createDocumentFragment();while(o.firstChild)d.append(o.firstChild);o.replaceWith(d)}function hd(o,a,d){let f=a.extractContents(),p=gd(f),m=xd(f);if(!f.hasChildNodes()){if(p)a.insertNode(document.createTextNode(p));if(m){let E=document.createTextNode(m);a.collapse(!1),a.insertNode(E)}return}let g=document.createElement(o);g.append(f);let h=document.createDocumentFragment();if(p)h.append(document.createTextNode(p));if(h.append(g),m)h.append(document.createTextNode(m));a.insertNode(h);let y=window.getSelection();if(y){y.removeAllRanges();let E=document.createRange();E.selectNodeContents(g),y.addRange(E)}}function gd(o){let a=o.firstChild;if(!a||a.nodeType!==Node.TEXT_NODE)return null;let d=a.textContent??"",f=d.match(/^(\s+)/);if(!f)return null;let p=f[1];if(d.length===p.length)a.remove();else a.textContent=d.slice(p.length);return p}function xd(o){let a=o.lastChild;if(!a||a.nodeType!==Node.TEXT_NODE)return null;let d=a.textContent??"",f=d.match(/(\s+)$/);if(!f)return null;let p=f[1];if(d.length===p.length)a.remove();else a.textContent=d.slice(0,-p.length);return p}function wt(o){if(!o)return;let a=!0,d=0;while(a&&d<10){if(a=!1,d+=1,o.normalize(),yd(o))a=!0;if(bd(o))a=!0;if(Sd(o))a=!0;if(vd(o))a=!0;if(Ed(o))a=!0}}function yd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){let p=f.nextSibling;if(p&&co(p)&&p.tagName===f.tagName&&Xn.has(f.tagName.toLowerCase())&&wd(f,p))d.push([f,p])}for(let f=d.length-1;f>=0;f--){let[p,m]=d[f];while(m.firstChild)p.append(m.firstChild);m.remove(),a=!0}return a}function bd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;let p=f.firstChild;if(f.childNodes.length===1&&p!==null&&co(p)&&p.tagName===f.tagName)d.push(f)}for(let f of d){let p=f.firstChild;if(p===null)throw TypeError("collapseRedundantNesting: an earlier collapse emptied this wrapper");while(p.firstChild)p.before(p.firstChild);p.remove(),a=!0}return a}function Sd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;if(f.childNodes.length===0&&!f.textContent)d.push(f)}for(let f of d)f.remove(),a=!0;return a}function vd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;if(f===o)continue;let p=f.firstChild;if(p&&ba(p)){let g=p.textContent,h=g.match(/^(\s+)/);if(h&&g.length>h[1].length)d.push({el:f,text:p,type:"lift-leading",ws:h[1]})}let m=f.lastChild;if(m&&ba(m)&&m!==p){let g=m.textContent,h=g.match(/(\s+)$/);if(h&&g.length>h[1].length)d.push({el:f,text:m,type:"lift-trailing",ws:h[1]})}}for(let f of d){if(f.type==="lift-leading")f.text.textContent=f.text.textContent.slice(f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el);else f.text.textContent=f.text.textContent.slice(0,-f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el.nextSibling);a=!0}return a}function Ed(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(f.tagName.toLowerCase()!=="span")continue;if(f===o)continue;if(f.attributes.length>0)continue;d.push(f)}for(let f of d)wa(f),a=!0;return a}function wd(o,a){if(o.tagName.toLowerCase()==="a")return o.getAttribute("href")===a.getAttribute("href");return!0}function Td(o){Sa(o,!0),Sa(o,!1)}function Sa(o,a){let d=a?o.startContainer:o.endContainer,f=a?o.startOffset:o.endOffset;if(d.nodeType!==Node.TEXT_NODE)return;let p=d.textContent??"",m=Cd(p);for(let g of m)if(a){if(f>g.start&&f<g.end)o.setStart(d,g.start)}else if(f>g.start&&f<g.end)o.setEnd(d,g.end)}function Cd(o){let a=[],d=0;while(d<o.length-1){if(o[d]==="$"&&o[d+1]==="{"){let f=d,p=1,m=d+2;while(m<o.length&&p>0){if(o[m]==="{")p+=1;else if(o[m]==="}")p-=1;m+=1}if(p===0){a.push({end:m,start:f}),d=m;continue}}d+=1}return a}var Zn=(o,a)=>document.execCommand(o,!1,a);function Ta(o){return o.nodeType===Node.ELEMENT_NODE&&o.nodeName.toLowerCase()==="a"}function Ca(o){let a=window.getSelection();if(!a||!a.rangeCount)return{active:!1,href:null};let d=a.anchorNode;while(d&&d!==o){if(Ta(d))return{active:!0,href:d.dataset.jxHref??d.getAttribute("href")};d=d.parentNode}return{active:!1,href:null}}function Ad(o){let a=window.getSelection();if(!a||!a.rangeCount)return null;let d=a.anchorNode;while(d&&d!==o){if(Ta(d))return d;d=d.parentNode}return null}function Aa(o,a){let d=Ad(o);if(d)if(a)d.setAttribute("href",a);else{let f=document.createDocumentFragment();while(d.firstChild)f.append(d.firstChild);d.replaceWith(f)}else if(a)Zn("createLink",a);wt(o)}function Pa(o,a){o.focus(),Zn("insertText",`\${${a}}`)}var Na={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var Ra=Na.$defs,Nd=new Set(["pre"]),Rd=new Set(Object.entries(Ra).filter(([o,a])=>!Nd.has(o)&&(a.$inlineChildren?.length??0)>0).map(([o])=>o));function $a(o,a){return a?.[o.toLowerCase()]??Rd.has(o.toLowerCase())}var $d={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},Ze=$d;function uo(o){Ze=o}var te=null,Ne=null,Tt=null,nn=null,Ct=null,Xe=null,ke=!1,on="",rn=!1,ka=null;function Ma(o){ka=o}function it(o){return $a(o.tagName,ka)}function fo(o,a,d,f){if(te)Le(!0);if(te=o,Ne=a,Tt=d.onCommit,nn=d.onSplit,Ct=d.onInsert,Xe=d.onEnd,ke=f?.plainText===!0,on=ke?o.textContent:"",rn=!1,o.dataset.jxActiveBlock="",ke){try{o.contentEditable="plaintext-only"}catch{o.contentEditable="true"}o.focus()}o.addEventListener("keydown",po),o.addEventListener("input",mo),o.addEventListener("paste",ho)}function Le(o=!1){if(!te)return;if(Ha(!1),Ze.dismiss(),delete te.dataset.jxActiveBlock,ke)te.contentEditable="false";if(te.removeEventListener("keydown",po),te.removeEventListener("input",mo),te.removeEventListener("paste",ho),te=null,Ne=null,Tt=null,nn=null,Ct=null,ke=!1,on="",rn=!1,o)Xe=null;else if(Xe){let a=Xe;Xe=null,a()}}function _a(){Ha(!0)}function Ja(){return ke&&te!==null}function Me(){return te!==null}function At(){return te}function Da(){return Ne}function La(){return Ze.isOpen()}function po(o){if(ke){if(o.key==="Escape"){if(o.preventDefault(),o.stopPropagation(),te)te.textContent=on;Le();return}if(o.key==="Enter"){o.preventDefault(),o.stopPropagation(),Le();return}if((o.ctrlKey||o.metaKey)&&["b","i","u","`"].includes(o.key))o.preventDefault()}}function mo(){if(Ze.isOpen())yo()}function ho(o){o.preventDefault();let a=o.clipboardData?.getData("text/plain")??"";Zn("insertText",a)}function Ia(){if(!nn||!te||!Ne)return!1;let o=window.getSelection();if(!o||!o.rangeCount)return!1;let a=o.getRangeAt(0),d=document.createRange();d.setStart(te,0),d.setEnd(a.startContainer,a.startOffset);let f=document.createRange();f.setStart(a.endContainer,a.endOffset),f.setEnd(te,te.childNodes.length);let p=Oa(d.cloneContents()),m=Oa(f.cloneContents()),g=[...Ne],h=nn;return ja(),h(g,p,m),!0}function ja(){if(!te)return;if(delete te.dataset.jxActiveBlock,ke)te.contentEditable="false";if(te.removeEventListener("keydown",po),te.removeEventListener("input",mo),te.removeEventListener("paste",ho),te=null,Ne=null,Tt=null,nn=null,Ct=null,ke=!1,on="",rn=!1,Xe){let o=Xe;Xe=null,o()}}function Ha(o){if(!Tt||!te||!Ne)return;if(ke){let d=te.textContent.replaceAll(`
314
+ `," ");if(d===on.replaceAll(`
315
+ `," ")&&!rn)return;rn=!0,Tt(Ne,null,d,o);return}wt(te);let a=Fa(te);Tt(Ne,a.children??null,a.textContent??null,o)}function Od(o){if(!Array.isArray(o.children)||o.children.length===0)return{textContent:""};let a=[];for(let d of o.children){let f=a.at(-1);if(e(d)&&e(f))a[a.length-1]=f+d;else a.push(d)}if(a.every((d)=>e(d)))return{textContent:a.join("")};return{children:a}}function Fa(o){let a=o.childNodes;if(a.length===0)return{textContent:""};if(a.length===1&&a[0].nodeType===Node.TEXT_NODE)return{textContent:a[0].textContent};let d=[];for(let f of a){let p=go(f);if(p!==null)d.push(p)}return Od({children:d})}function kd(o){return o.nodeType===Node.ELEMENT_NODE&&"dataset"in o}var Md=new Map([["b","strong"],["i","em"],["s","del"],["strike","del"]]);function go(o){if(o.nodeType===Node.TEXT_NODE){let h=o.textContent;if(!h)return null;return h}if(!kd(o))return null;let a=o,d=a.tagName.toLowerCase(),f={tagName:d},p=Md.get(d);if(p)f.tagName=p;let m=a.dataset.jxHref??a.getAttribute("href");if(d==="a"&&m!=null){if(f.attributes={href:m},"title"in a&&e(a.title)&&a.title)f.attributes.title=a.title}if(d==="code")return f.textContent=a.textContent,f;let{childNodes:g}=a;if(g.length===0)f.textContent="";else if(g.length===1&&g[0].nodeType===Node.TEXT_NODE)f.textContent=g[0].textContent;else{f.children=[];for(let h of g){let y=go(h);if(y)f.children.push(y)}}return f}function Oa(o){let a=o.childNodes;if(a.length===0)return{textContent:""};if(a.length===1&&a[0].nodeType===Node.TEXT_NODE)return{textContent:a[0].textContent};let d=[];for(let p of a){let m=go(p);if(m)d.push(m)}let[f]=d;if(d.length===1&&f!==void 0&&!e(f)&&f.tagName==="span"&&e(f.textContent))return{textContent:f.textContent};return d.length>0?{children:d}:{textContent:""}}function er(o){let a=document.createRange();return a.setStart(te,0),a.setEnd(o.startContainer,o.startOffset),a.toString()}var Va=0,Qn=!0;function xo(o){if(!te||!Ct||!Ne)return;if(ke)return;let a=window.getSelection();if(!a||!a.rangeCount)return;let d=a.getRangeAt(0);Qn=o?.anchored!==!1,Va=er(d).length;let f={onSelect:Ba};if(!Qn)f.showFilter=!0;Ze.show(te,"",f)}function Wa(o){if(o.key!=="/"||o.ctrlKey||o.metaKey||!te)return;let a=window.getSelection();if(!a||a.rangeCount===0)return;let d=er(a.getRangeAt(0));if(d===""||d.endsWith(" ")||d.endsWith(`
316
+ `))requestAnimationFrame(()=>xo())}function yo(){if(!te||!Qn)return;let o=window.getSelection();if(!o||!o.rangeCount){Ze.dismiss();return}let a=o.getRangeAt(0),d=er(a),f=d.lastIndexOf("/");if(f===-1||d.length<Va-1){Ze.dismiss();return}let p=d.slice(f+1).toLowerCase();Ze.show(te,p,{onSelect:Ba})}function Ba(o){if(!te||!Ct||!Ne)return;let a=Qn?window.getSelection():null;if(a&&a.rangeCount){let m=a.getRangeAt(0),h=er(m).lastIndexOf("/");if(h!==-1){let y=document.createTreeWalker(te,NodeFilter.SHOW_TEXT),E=0,C=null,T=0;while(y.nextNode()){let A=y.currentNode;if(E+A.length>h){C=A,T=h-E;break}E+=A.length}if(C){let A=document.createRange();A.setStart(C,T),A.setEnd(m.startContainer,m.startOffset),A.deleteContents()}}}wt(te);let d=Fa(te),f=[...Ne],p=Ct;ja(),p(f,o,d)}function _d(o,a){let{target:d}=o;return d===a||d===a.documentElement||d===a.body}function bo(o){let a=o instanceof Element?o:null;while(a){if(a instanceof HTMLElement&&a.dataset.jxPath)return a;a=a.parentElement}return null}function Ua(o,a){let d=Pe(o);return{path:ge(a),rect:{height:d.height,width:d.width,x:d.x,y:d.y}}}function Ka(o){let a=bo(o instanceof Element?o:null);if(!a)return null;return Ua(a,a.dataset.jxPath)}function Jd(o){let a=o.checkVisibility;return t(a)?a.call(o,{checkVisibilityCSS:!0}):!0}function qa(o,a=document){let d=[],f=[];for(let p of o){let m=a.querySelector(ot(ae(p)));if(!m)continue;if(Jd(m)){let g=Pe(m);d.push({path:p,rect:{height:g.height,width:g.width,x:g.x,y:g.y}})}else f.push(p)}return{hidden:f,hits:d}}var Dd=new Set(["toggle","show","hide"]);function Ld(o){return Dd.has(o)}function Id(o,a){if(!(o instanceof Element))return;let d=o.closest("[popovertarget]"),f=d?.getAttribute("popovertarget");if(!d||!f)return;let g=[...d.ownerDocument.querySelectorAll("[data-jx-popover]")].find((E)=>E.id===f)?.dataset.jxPath;if(!g)return;let h=d.getAttribute("popovertargetaction")??"toggle",y=Ld(h)?h:"toggle";a.post({action:y,kind:"popoverTargetClick",targetPath:ge(g)})}function jd(o,a){if(!(o instanceof Element))return;let d=o.closest("[data-jx-commandfor]"),f=d?.dataset.jxCommandfor,p=d?.getAttribute("command")?.trim().toLowerCase()??"";if(!d||!f||!p)return;let h=[...d.ownerDocument.querySelectorAll("[data-jx-popover], dialog[data-jx-path]")].find((y)=>y.id===f)?.dataset.jxPath;if(!h)return;a.post({command:p,kind:"commandTargetClick",targetPath:ge(h)})}function za(o,a=document,d){let f=null,p=null,m=d?.getGen?.()??0,g=()=>d?.getMode?.()==="preview",h=()=>{o.post({kind:"paneFocus"})},y=(M)=>{if(g()){if(M.target instanceof Element){let X=M.target.closest("a[href]")?.getAttribute("href");if(X&&!X.startsWith("#"))M.preventDefault(),o.post({href:X,kind:"previewNavigate"})}return}if(d?.getMode?.()==="stylebook"&&M.target instanceof Element&&M.target.closest("a"))M.preventDefault();let B=Ka(M.target);if(B)o.post({additive:M.ctrlKey===!0||M.metaKey===!0,hit:B,kind:"hit"});Id(M.target,o),jd(M.target,o)},E=(M)=>{if(g())return;let B=M?.dataset.jxPath??null;if(B===f)return;f=B,o.post({hit:M&&B?Ua(M,B):null,kind:"hover"})},C=()=>{let M=d?.getGen?.()??m;if(M!==m)m=M,p="none"},T=(M,B)=>{if(!d||d.getMode?.()==="stylebook"||g())return;C();let re=d.getShadowDoc(),X=bo(M instanceof Element?M:null),ce=X&&re?xa(X,B,re):null,ee=ya(ce);if(ee===p)return;p=ee,o.post({kind:"insertZones",zones:ce})},A=0,H=null,k=0,K=0,L=(M)=>a.defaultView?.requestAnimationFrame(M)??requestAnimationFrame(M),_=(M)=>a.defaultView?.cancelAnimationFrame(M)??cancelAnimationFrame(M),Y=()=>{A=0;let M=H;H=null,E(bo(M instanceof Element?M:null)),T(M,{x:k,y:K})},q=(M)=>{if(H=M.target,k=M.clientX,K=M.clientY,A)return;A=L(Y)},G=(M)=>{if(!_d(M,a))return;if(E(null),d&&!g()&&p!=="none")p="none",o.post({kind:"insertZones",zones:null})},U=(M)=>{if(g())return;let B=Me()?At():null;if(B&&M.target instanceof Node&&B.contains(M.target))return;let re=Ka(M.target);if(!re)return;M.preventDefault(),o.post({kind:"contextMenu",path:re.path,x:M.clientX,y:M.clientY})};return a.addEventListener("pointerdown",h,!0),a.addEventListener("click",y,!0),a.addEventListener("pointermove",q,!0),a.addEventListener("pointerleave",G,!0),a.addEventListener("contextmenu",U,!0),()=>{if(A)_(A),A=0;a.removeEventListener("pointerdown",h,!0),a.removeEventListener("click",y,!0),a.removeEventListener("pointermove",q,!0),a.removeEventListener("pointerleave",G,!0),a.removeEventListener("contextmenu",U,!0)}}var Hd=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ga=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),Fd=new Set([...Ga,"button","dt","h1","h2","h3","h4","h5","h6","label","legend","p","pre","summary"]);function Ya(o){return(u(o?.tagName)||"div").toLowerCase()}function Vd(o,a){let d=o.type==="block"?o.tag??"":Ya(xe(a,o.path));return Ga.has(d.toLowerCase())}function Wd(o,a){let d=null,f=o;while(f){let p=ge(f.dataset.jxPath??"");if(p.length===0)break;if(Fd.has(Ya(xe(a,p))))d=f;f=Xa(f.parentElement)}return d}function Xa(o){let a=o;while(a){if(a instanceof HTMLElement&&a.dataset.jxPath)return a;a=a.parentElement}return null}function So(o,a,d){let f=zo(o,a,d);return Xa(f)}function vo(o,a,d,f){let p=o.dataset.jxPath;if(p==null)return null;let m=ge(p);if(m.length===0){let H=[...o.children];if(H.length===0)return tr(f,m)?{edge:"inside",instruction:"make-child",referenceRect:Qe(o),targetPath:m}:null;return Bd(H,a,m,f)}if(!tr(f,m))return null;let g=Vd(f,d)?null:Wd(o,d);if(g){let H=ge(g.dataset.jxPath??"");if(!tr(f,H))return null;let k=Qe(g);return(k.height===0?0:(a-k.y)/k.height)<0.5?{edge:"top",instruction:"reorder-above",referenceRect:k,targetPath:H}:{edge:"bottom",instruction:"reorder-below",referenceRect:k,targetPath:H}}let h=xe(d,m),y=(u(h?.tagName)||"div").toLowerCase(),E=Array.isArray(h?.children)&&h.children.some((H)=>n(H)),C=Hd.has(y)||!E,T=Qe(o),A=T.height===0?0:(a-T.y)/T.height;if(C)return A<0.5?{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m}:{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};if(A<0.25)return{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m};if(A>0.75)return{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};return{edge:"inside",instruction:"make-child",referenceRect:T,targetPath:m}}function Bd(o,a,d,f){let p=1/0,m="reorder-below",g=o.length-1;for(let y=0;y<o.length;y++){let E=Qe(o[y]),C=Math.abs(a-E.y),T=Math.abs(a-(E.y+E.height));if(C<p)p=C,m="reorder-above",g=y;if(T<p)p=T,m="reorder-below",g=y}let h=[...d,"children",g];if(!tr(f,h))return null;return{edge:m==="reorder-above"?"top":"bottom",instruction:m,referenceRect:Qe(o[g]),targetPath:h}}function tr(o,a){if(o.type!=="tree-node")return!0;let d=o.path;if(pa(d,a))return!1;return!Et(d,a)}function Qe(o){let a=Pe(o);return{height:a.height,width:a.width,x:a.x,y:a.y}}var Kd=40,Za=12;function Eo(o,a,d=Kd){if(o<d)return-1;if(o>a-d)return 1;return 0}var wo=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),To=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),Qa=new Set(["deleteByCut","deleteContent"]),el=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),Ud="format",qd=new Set(["insertParagraph","insertLineBreak"]);function tl(o){let{inputType:a,from:d,to:f}=o;if(a==="insertCompositionText"||a==="insertFromComposition")return{kind:"native"};if(a==="historyUndo"||a==="historyRedo")return{kind:"reject"};if(a.startsWith(Ud))return{kind:"reject"};if(a==="insertFromDrop"||a==="deleteByDrag")return{kind:"reject"};if(o.inPropHost)return qd.has(a)?{kind:"reject"}:{kind:"native"};if(!d||!f)return{kind:"reject"};let p=Qt(d,f)&&d.offset===f.offset,m=!Qt(d,f);if(a==="insertParagraph")return{from:d,kind:"split",to:f};if(a==="insertLineBreak"&&!m)return{kind:"native"};if(p&&wo.has(a)&&o.atBlockStart)return{at:d,kind:"mergeBackward"};if(p&&To.has(a)&&o.atBlockEnd)return{at:d,kind:"mergeForward"};if(m){if(el.has(a)||a==="insertLineBreak")return{from:d,kind:"replaceRange",text:o.data,to:f};if(wo.has(a)||To.has(a)||Qa.has(a))return{from:d,kind:"replaceRange",text:"",to:f};return{kind:"reject"}}if(el.has(a)||wo.has(a)||To.has(a)||Qa.has(a))return{kind:"native"};return{kind:"native"}}var zd=500;function nr(o,a){let d=o.ownerDocument.getSelection();if(!d||d.rangeCount===0||!d.anchorNode||!d.focusNode)return null;if(!o.contains(d.anchorNode)||!o.contains(d.focusNode))return null;let f=Zt(d.anchorNode,d.anchorOffset,a),p=Zt(d.focusNode,d.focusOffset,a);return f&&p?{anchor:f,head:p}:null}function sn(o,a){let d=no(o,a.anchor),f=no(o,a.head)??d;if(!d)return!1;let p=o.ownerDocument.getSelection();if(!p)return!1;let m=o.ownerDocument.createRange();if(m.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(m),f&&f!==d)p.extend(f.node,f.offset);return!0}function nl(o){return"dataset"in o}function rl(o,a){let d=o.ownerDocument,f=null,p=null,m=()=>{let U=a.getMode?.();return U===void 0||U==="design"||U==="edit"},g=null,h=()=>{if(g!==null)clearTimeout(g),g=null},y=()=>{if(g=null,!f||!a.onCommitTick)return;let U=nr(o,a.isEditableBlock);if(a.onCommitTick(),U)sn(o,U)},E=!1,C=()=>{if(!a.onCommitTick||!f||E)return;h(),g=setTimeout(y,a.commitDelayMs??zd)},T=()=>{E=!0,h()},A=()=>{E=!1,C()},H=()=>{h(),f=null,p=null},k=()=>{if(!f)return;h(),f=null,p=null,a.onDeactivate()},K=()=>{if(!m()){k();return}let M=d.getSelection()?.focusNode??null;if(!M)return;if(!o.contains(M)){k();return}let B=Bn(M,a.isEditableBlock);if(!B){if(f?.contains(M)){a.onSelectionChange?.();return}k();return}let re=ae(B.path);if(re===p){a.onSelectionChange?.();return}k(),f=B.el,p=re,a.onActivate(B.el,B.path)},L=(U)=>{let[M]=t(U.getTargetRanges)?U.getTargetRanges():[],B=d.getSelection(),re=B&&B.rangeCount>0&&(B.isCollapsed||!M),X,ce,ee,ne;if(re)({startContainer:X,startOffset:ce,endContainer:ee,endOffset:ne}=B.getRangeAt(0));else if(M)({startContainer:X,startOffset:ce,endContainer:ee,endOffset:ne}=M);else return null;let ve=Zt(X,ce,a.isEditableBlock),V=Zt(ee,ne,a.isEditableBlock),N=Bn(ee,a.isEditableBlock);return ve&&V&&N?{endEl:N.el,from:ve,to:V}:null},_=(U)=>{if(!m())return;let M=L(U),B=tl({atBlockEnd:M?M.to.offset>=to(M.endEl):!1,atBlockStart:M?Qs(M.from):!1,data:U.data??"",from:M?.from??null,inPropHost:f!==null&&p===null,inputType:U.inputType,to:M?.to??null});switch(B.kind){case"native":return;case"split":{if(U.preventDefault(),!Qt(B.from,B.to)&&!a.onReplaceRange)return;a.onSplit?.();return}case"mergeBackward":{U.preventDefault(),a.onMergeBackward?.(B.at);return}case"mergeForward":{U.preventDefault(),a.onMergeForward?.(B.at);return}case"replaceRange":{U.preventDefault(),a.onReplaceRange?.(B.from,B.to,B.text);return}default:U.preventDefault()}},Y=(U)=>{if(!m()||!a.onPropActivate)return;let M=U.target instanceof Element?U.target:null;while(M&&M!==o){if(nl(M)&&M.dataset.jxBoundProp){let B=M;if(B!==f){if(k(),a.onPropActivate(B))f=B,p=null}return}if(nl(M)&&M.dataset.jxPath)return;M=M.parentElement}},q=(U)=>{U.preventDefault()},G=()=>C();return d.addEventListener("selectionchange",K),o.addEventListener("beforeinput",_),o.addEventListener("input",G),o.addEventListener("compositionstart",T),o.addEventListener("compositionend",A),o.addEventListener("dragstart",q),d.addEventListener("pointerdown",Y,!0),{capture:()=>nr(o,a.isEditableBlock),forget:H,isComposing:()=>E,flush:()=>{if(E)return;if(g!==null)h(),y()},placeCaret:(U)=>{let M=sn(o,{anchor:U,head:U});if(M)K();return M},restore:(U)=>{let M=sn(o,U);if(M)K();return M},stop:()=>{d.removeEventListener("selectionchange",K),o.removeEventListener("beforeinput",_),o.removeEventListener("input",G),o.removeEventListener("compositionstart",T),o.removeEventListener("compositionend",A),o.removeEventListener("dragstart",q),d.removeEventListener("pointerdown",Y,!0),k()},sync:K}}function Ve(o){return n(o)}function Pt(o){if(Array.isArray(o))return o.map((d)=>Pt(d));if(!l(o))return o;let a={};for(let[d,f]of Object.entries(o)){if(d.startsWith("on")&&Z(f))continue;if(d==="children")a.children=Array.isArray(f)?f.map((p)=>Pt(p)):Pt(f);else if(d==="cases"&&Ve(f)){let p={};for(let[m,g]of Object.entries(f))p[m]=Pt(g);a.cases=p}else if(d==="state"&&Ve(f)){let p={};for(let[m,g]of Object.entries(f)){if(s(g)&&g.timing==="server")continue;p[m]=g}a.state=p}else a[d]=f}return a}var Gd=new Set(["img","video","source","iframe","audio"]),ol="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Yd="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";var Xd=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function il(o){return Xd.test(o)}var Zd=/(?<![\w$.])(?:item|index|\$map)\b/u;function We(o){if(e(o))return o.includes("${")&&Zd.test(o);return l(o)&&e(o.$ref)&&/^(?:#\/)?\$map\//u.test(o.$ref)}function rr(o,a){if(o==="href"||o==="action")return"";if(il(o))return Yd;if(e(a))return an(a);return l(a)&&e(a.$ref)?ml(a.$ref):""}var Qd=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),ef=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),sl=["empty-text-placeholder","empty-container-placeholder"],tf=["width","height","inlineSize","blockSize"];function nf(o){let{style:a}=o;if(!n(a))return!1;return tf.some((d)=>{let f=a[d],p=i(f)?String(f):e(f)?f.trim():"";return p!==""&&p!=="auto"})}function Ao(o){if(!o.tagName||o.textContent||o.innerHTML)return null;if(o.$__layout)return null;if(Array.isArray(o.children)&&o.children.length>0)return null;if(nf(o))return null;if(Qd.has(u(o.tagName)))return"empty-text-placeholder";if(ef.has(u(o.tagName)))return"empty-container-placeholder";return null}function an(o){return o.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function al(o){let a=document.createTreeWalker(o,NodeFilter.SHOW_TEXT);while(a.nextNode()){let d=a.currentNode;if(d.data.includes("❪"))d.data=d.data.replaceAll(/\u276A\s*(.*?)\s*\u276B/g,"${$1}")}}function rf(o,a){let d=o.map;return{children:n(d)?[et(d,ul(o.items,a))]:[],className:"repeater-perimeter",tagName:"div"}}function ll(o){return JSON.stringify(o)}function cl(o){let a=o.startsWith("#/")?o.slice(2):o,[d,...f]=a.split("/"),p=d==="state"||d==="$map"?d:null;if(p===null)return null;let m=f.map((g)=>g.replaceAll("~1","/").replaceAll("~0","~"));return p+m.map((g)=>`?.[${ll(g)}]`).join("")}function Co(o,a){if(a===null)return`(${o})`;return`((r) => ((item, index, $map) => (${o}))(r, 0, { index: 0, item: r }))(${a})`}function ul(o,a){if(Array.isArray(o))return`${ll(o)}[0]`;if(r(o)){let f=cl(o.$ref);return f===null?null:`${Co(f,a)}?.[0]`}let d=e(o)?dl(o):[];if(e(o)&&d.length===1&&of(o,d[0]))return`${Co(d[0].expr,a)}?.[0]`;return null}function of(o,a){return a.start===0&&a.end===o.length-1}function dl(o){let a=[],d=o.indexOf("${");while(d!==-1){let f=0,p=-1;for(let m=d+1;m<o.length;m+=1)if(o[m]==="{")f+=1;else if(o[m]==="}"){if(f-=1,f===0){p=m;break}}if(p===-1)break;a.push({end:p,expr:o.slice(d+2,p),start:d}),d=o.indexOf("${",p+1)}return a}function fl(o,a=null){let d=dl(o);if(d.length===0)return o;let f="",p=0;for(let{start:m,end:g,expr:h}of d)f+=o.slice(p,m),f+=`\${(() => { try { return ${Co(h,a)}; } catch { return ""; } })()}`,p=g+1;return f+o.slice(p)}function sf(o,a){let d=o.startsWith("#/")?o.slice(2):o;if(d!=="$map"&&!d.startsWith("$map/"))return{$ref:o};let f=cl(o);return a===null||f===null?void 0:fl(`\${${f}}`,a)}function pl(o,a){let d=o,f=null;for(let p of a){if(Array.isArray(d)){d=i(p)?d[p]:void 0;continue}if(!l(d))return f;if(p==="map"&&d.$prototype==="Array")f=ul(d.items,f);d=e(p)?d[p]:void 0}return f}function ml(o){return`{${o.startsWith("#/state/")?o.slice(8):o}}`}function hl(o,a=null){return et(o,a)}function et(o,a){if(Array.isArray(o))return o.map((h)=>et(h,a));if(!l(o))return o;if(o.$prototype==="Array")return rf(o,a);let d=o,f={},p=!1,m=e(d.tagName)&&Gd.has(d.tagName);if(m){let{attributes:h,src:y}=d,E=h?.src,C=d.poster,T=h?.poster;if(!(y&&y!==""||E&&E!=="")&&!(C&&C!==""||T&&T!==""))p=!0}for(let[h,y]of Object.entries(d))if(h==="state"||h==="$media"||h==="$elements")f[h]=y;else if(h==="$props"&&Ve(y)){let E={};for(let[C,T]of Object.entries(y))if(!We(T))E[C]=T;else if(e(T))E[C]=il(C)||C==="href"||C==="action"?rr(C,T):fl(T,a);else if(r(T)){let A=sf(T.$ref,a);if(A!==void 0)E[C]=A}else E[C]=T;f[h]=E}else if(h==="children")if(Array.isArray(y))f.children=y.map((E)=>et(E,a));else if(l(y)&&y.$prototype==="Array")f.children=[et(y,a)];else f.children=et(y,a);else if(h==="cases"&&d.$switch&&Ve(y)){let[E]=Object.entries(y);if(E){let[,C]=E;f.children=Ve(C)&&!(l(C)&&C.$ref)?[et(C,a)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${Object.keys(y).join(" | ")}]`}]}}else if(h==="attributes"&&m&&Ve(y)){let E={};for(let[C,T]of Object.entries(y))if((C==="src"||C==="poster")&&(T===""||T==null||We(T)))p=!0,E[C]=ol;else E[C]=We(T)?rr(C,T):T;f.attributes=E}else if(h==="attributes"&&Ve(y)){let E={};for(let[C,T]of Object.entries(y))E[C]=We(T)?rr(C,T):T;f.attributes=E}else if(h==="style")if(Ve(y)){let E={};for(let[C,T]of Object.entries(y))if(!We(T))E[C]=T;f.style=E}else f.style=y;else if(h==="$switch"&&e(y)&&y.includes("${"))f[h]=an(y);else if(h==="textContent"&&e(y)&&y.includes("${"))f[h]=an(y);else if(h==="textContent"&&l(y)&&y.$ref)f[h]=ml(y.$ref);else if(m&&(h==="src"||h==="poster"))if(y===""||y==null||We(y))p=!0,f[h]=ol;else f[h]=y;else if(We(y))f[h]=rr(h,y);else if(e(y)||l(y)&&y.$ref)f[h]=y;else f[h]=et(y,a);let g=Ao(f);if(g)f.className=f.className?`${f.className} ${g}`:g;if(p){let h=e(f.className)?f.className:"";if(!h.includes("empty-media-placeholder"))f.className=h?`${h} empty-media-placeholder`:"empty-media-placeholder"}return f}var af={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},Po=globalThis,lf=["strong","em","u","del","sub","sup","code"],or="jx-pending-format",gl="jx-pending-format-style";function cf(o){let a=o.parentElement;while(a){if(a.tagName.includes("-"))return a;a=a.parentElement}return null}function uf(o,a){if(!o)return!1;let d=o.attributes;if(d){if(d[`props.${a}`]!==void 0)return!0;let f=new Set([a.toLowerCase(),Tn(a).toLowerCase()]);for(let m of Object.keys(d))if(d[m]!==void 0&&f.has(m.toLowerCase()))return!0;let p=d["data-jx-props"];if(e(p)&&df(p,a))return!0}if(Gt.has(a)||a.startsWith("$"))return!1;return o[a]!==void 0}function df(o,a){try{let d=JSON.parse(o);return n(d)&&a in d}catch{return!1}}function xl(o,a){let f=ae(a).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function ff(o){return{height:o.height,width:o.width,x:o.x,y:o.y}}function yl(o,a,d){let f=a.ownerDocument,p=()=>{let V=d?.getMode?.();return V===void 0||V==="design"||V==="edit"},m=null,g=0,h=(V)=>{let N=window.getSelection();if(!N||!N.rangeCount)return null;let z=N.getRangeAt(0);return V.contains(z.commonAncestorContainer)?z:null},y=()=>{let V=At();if(!V)return;let N=h(V);if(N&&!N.collapsed)m=N.cloneRange()},E=()=>{if(f.querySelector(`#${gl}`))return;let V=f.createElement("style");V.id=gl,V.textContent=`::highlight(${or}) { background-color: Highlight; color: HighlightText; }`,f.head.append(V)},C=()=>{let V=Po.Highlight,N=Po.CSS?.highlights;if(!V||!N)return;if(m&&m.startContainer.isConnected)E(),N.set(or,new V(m.cloneRange()));else N.delete(or)},T=()=>{Po.CSS?.highlights?.delete(or)},A=()=>{let V=At();if(!V||!V.dataset.jxPath)return null;let N=h(V),z=N??m,Q=z?ff(qo(z)):null,de=N?N.collapsed:!0,_e=lf.filter((Ae)=>va(Ae,V)),ye=Ca(V);if(ye.active)_e.push("a");return g+=1,{activeTags:_e,collapsed:de,kind:"selectionChanged",link:ye,localScope:null,path:ge(V.dataset.jxPath),rect:Q,seq:g}},H=()=>{if(!Me())return;y(),C();let V=A();if(V)o.post(V)},k=!1,K=(V,N)=>{al(V),o.post({kind:"editStart",path:N}),fo(V,N,{onCommit:(z,Q,de,_e)=>{k=!1;let ye={children:Q,kind:"editCommit",path:z,textContent:de};if(_e)ye.inPlace=!0;o.post(ye)},onEnd:()=>{T(),m=null,o.post({kind:"editEnd"})},onInsert:(z,Q,de)=>o.post({cmd:Q,commitData:de,kind:"editInsert",path:z}),onSplit:(z,Q,de)=>o.post({after:de,before:Q,kind:"editSplit",path:z})}),y(),H()},L=(V,N)=>{let z=d?.getShadowDoc?.();if(!z)return!0;let Q=xe(z,V);if(uf(Q,N))return!1;let de=Q?.$props?.[N];if(de==null)return!0;if(!e(de))return!1;return!de.includes("${")},_=(V,N,z)=>{o.post({kind:"editStart",path:N,prop:z}),fo(V,N,{onCommit:(Q,de,_e,ye)=>{k=!1;let Ae={kind:"editCommitProp",path:Q,prop:z,value:_e??""};if(ye)Ae.inPlace=!0;o.post(Ae)},onEnd:()=>{T(),m=null,X.forget(),o.post({kind:"editEnd"})},onInsert:()=>{},onSplit:()=>{}},{plainText:!0})},Y=(V)=>{let N=At();if(!N)return;if(Ja())return;if(m&&m.startContainer.isConnected&&N.contains(m.commonAncestorContainer)){let z=window.getSelection();N.focus(),z?.removeAllRanges(),z?.addRange(m)}if(V.command==="link")Aa(N,V.href);else if(V.command==="insertData")Pa(N,V.token);else{let z=af[V.command];if(z)Ea(z,N)}y(),H()},q=(V)=>{let N=V.dataset.jxBoundProp,z=cf(V),Q=z?.dataset.jxPath;if(!N||!z||!Q)return!1;let de=ge(Q);if(!L(de,N))return!1;return _(V,de,N),!0},G=(V,N)=>{let z=ea(a,V,N,it);if(!z)return!1;let[Q,de]=N===-1?[V,z.path]:[z.path,V];return X.flush(),o.post({fromPath:Q,intoPath:de,kind:"editMerge"}),!0},U=(V,N,z)=>{let Q=ro(a,it),de=ae(V.path),_e=ae(N.path),ye=Q.findIndex((Be)=>Be.dataset.jxPath===de),Ae=Q.findIndex((Be)=>Be.dataset.jxPath===_e);if(ye===-1||Ae===-1||Ae<=ye)return!1;let cn=Q.slice(ye+1,Ae).map((Be)=>ge(Be.dataset.jxPath));return X.flush(),o.post({between:cn,from:V,kind:"editRangeReplace",text:z,to:N}),!0},M=()=>y(),B=()=>y(),re=()=>y(),X=rl(a,{getMode:()=>d?.getMode?.()??"edit",isEditableBlock:it,onActivate:(V,N)=>K(V,N),onDeactivate:()=>{if(Me())Le()},onCommitTick:()=>_a(),onMergeBackward:(V)=>G(V.path,-1),onMergeForward:(V)=>G(V.path,1),onReplaceRange:(V,N,z)=>U(V,N,z),onPropActivate:q,onSelectionChange:()=>H(),onSplit:()=>Ia()}),ce=(V)=>Wa(V),ee=()=>{if(La())yo()},ne=()=>{if(!k)k=!0,o.post({kind:"editInput"})};a.addEventListener("input",ne),a.addEventListener("keydown",ce),a.addEventListener("input",ee),f.addEventListener("mouseup",M,!0),f.addEventListener("keyup",B,!0),f.addEventListener("blur",re,!0);let ve=o.onMessage((V)=>{if(V.kind==="applyFormat"){Y(V.intent);return}if(V.kind==="openSlash"){xo({anchored:!1});return}if(V.kind==="flushEdits"){X.flush(),o.post({kind:"flushComplete",reqId:V.reqId});return}if(V.kind==="endEdit"){if(Me())Le();return}if(V.kind!=="enterEdit")return;if(!p())return;if(V.prop!==void 0){let Q=xl(a,V.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(V.prop)}"]`);if(Q)q(Q);return}let N=xl(a,V.path);if(N&&it(N))X.placeCaret({offset:V.offset??0,path:V.path})});return()=>{if(a.removeEventListener("keydown",ce),a.removeEventListener("input",ee),a.removeEventListener("input",ne),f.removeEventListener("mouseup",M,!0),f.removeEventListener("keyup",B,!0),f.removeEventListener("blur",re,!0),X.stop(),ve(),T(),m=null,Me())Le()}}var pf=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function mf(o){return pf.has(o)}function bl(o,a){let d=!1,f=null,p=null,m={dismiss:()=>{if(!d)return;d=!1,p=null,o.post({kind:"slashDismiss"})},isOpen:()=>d,show:(E,C,T)=>{if({onSelect:f}=T,d&&C===p)return;d=!0,p=C;let A=Pe(E),H={filter:C,kind:"slashShow",rect:{height:A.height,width:A.width,x:A.left,y:A.top}};if(T.showFilter===!0)H.showFilter=!0;o.post(H)}};uo(m);let g=(E)=>{if(!d||!mf(E.key))return;E.preventDefault(),E.stopPropagation(),o.post({key:E.key,kind:"slashNav"})},h=()=>{if(d)m.dismiss()};a.addEventListener("keydown",g,!0),a.addEventListener("mousedown",h,!0);let y=o.onMessage((E)=>{if(E.kind==="slashSelect"){d=!1,p=null,f?.({...E.cmd});return}if(E.kind==="slashDismissed")d=!1,p=null});return()=>{a.removeEventListener("keydown",g,!0),a.removeEventListener("mousedown",h,!0),y(),uo({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var Sl=["global","canvas","caret","grid","code","dock","palette"];var bh={"commandbar/primary":{admits:["application","document"],note:"document only for Save / Undo / Redo / Open in Browser, by frequency; ≤5 total"},"commandbar/overflow":{admits:["application","project","document"],note:"never selection — the Command Bar is not a selection surface"},"statusbar/project":{admits:["project"],note:"the status bar's left field"},"statusbar/document":{admits:["document"],note:"the status bar's centre field"},"statusbar/selection":{admits:["selection"],note:"the status bar's right field"},"context/element":{admits:["selection"],note:"the canvas element menu acts on a selection"},"context/file":{admits:["project"],note:"a file row addresses the project's file set"},"context/layer":{admits:["selection"],note:"an outline row IS a selection"},"context/tab":{admits:["document"],note:"a tab addresses one document"},"context/pane":{admits:["document"],note:"a pane hosts one document"},blockbar:{admits:["selection"],note:"the floating bar owns selection-scoped verbs"},"blockbar/format":{admits:["selection"],note:"the bar's inline-format cluster — a range inside the selection is still the selection"},"outline/row":{admits:["selection"],note:"row actions act on the row's node"},"settings/menu":{admits:["application","project"],note:"the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it "+"may host two levels for the reason commandbar/overflow does: a menu prints each row's own name, chord and gate, and draws a divider where the level changes. The rail's PINNED groups stay single-level, in PANEL_PLACEMENT_MATRIX"},palette:{admits:["application","project","document","selection"],note:"the level-agnostic surface; it groups rows by level"},never:{admits:["application","project","document","selection"],note:"keyboard- and API-only; no rendered surface to be misplaced in"}};var hf=["mod","ctrl","alt","shift"],gf=new Map([["mod","mod"],["cmd","mod"],["command","mod"],["meta","mod"],["super","mod"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["opt","alt"],["option","alt"],["shift","shift"]]),xf=new Map([["up","arrowup"],["down","arrowdown"],["left","arrowleft"],["right","arrowright"],["esc","escape"],["space"," "],["spacebar"," "],["del","delete"],["plus","="],["return","enter"]]);function yf(o){return[...hf.filter((d)=>o[d]),o.key].join("+")}function bf(o){return/^Digit(\d)$/.exec(o??"")?.[1]}function vl(o,a){let d=bf(o.code)??o.key.toLowerCase();if(gf.has(d))return"";let f={mod:a?o.metaKey:o.ctrlKey,ctrl:a?o.ctrlKey:!1,alt:o.altKey,shift:o.shiftKey,key:xf.get(d)??d};return yf(f)}var wh=["global",...Sl.filter((o)=>o!=="global"&&o!=="palette")];var Sf=["caret","global"],vf=["canvas","global"],Ef=["global"],ir={chords:[],mac:!1};function wf(o){if(!(o instanceof HTMLElement))return!1;return o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"}function Tf(o,a){if(o)return Sf;return a==="preview"?Ef:vf}function Cf(o,a=ir,d=!1,f="design"){if(wf(o.target))return!1;let p=vl(o,a.mac);if(!p)return!1;let m=Tf(d,f);return a.chords.some((g)=>g.chord===p&&m.includes(g.scope))}function Af(o){return{altKey:o.altKey,code:o.code,ctrlKey:o.ctrlKey,key:o.key,metaKey:o.metaKey,shiftKey:o.shiftKey}}function El(o,a=document,d=()=>!1,f=()=>ir,p=()=>"design"){let m=(g)=>{if(!Cf(g,f(),d(),p()))return;g.preventDefault(),o.post({event:Af(g),kind:"forwardKey"})};return a.addEventListener("keydown",m,!0),()=>a.removeEventListener("keydown",m,!0)}var No=new WeakMap,sr=new Set;function Ro(o,a,d){let f=xe(o,a);if(f===void 0)throw Error(`iframe-patch-node-not-found:${a.join("/")}`);let p=e(f)?f:hl(Pt(f),pl(o,a)),{result:m,stop:g}=bt(()=>Oe(p,d.defs,{_path:Pf(a,d),onNodeCreated:ao(d.mapperCtx)}));if(sr.add(g),m instanceof HTMLElement)No.set(m,g);return m}function $o(o){let a=[o,...o.querySelectorAll("*")];for(let d of a){if(!(d instanceof HTMLElement))continue;kn(d);let f=No.get(d);if(f)f(),sr.delete(f),No.delete(d)}}function wl(){for(let o of sr)o();sr.clear()}function Pf(o,a){let{mapperCtx:d}=a;if(d.layoutWrapped&&d.pageContentPrefix&&o[0]==="children"){let[,f]=o;return i(f)?[...d.pageContentPrefix,f+(d.pageContentOffset??0),...o.slice(2)]:[...d.pageContentPrefix,...o.slice(1)]}return o}function Al(o,a,d,f,p){for(let g of a)lo(o,g);if(!p?.length){for(let g of a)Tl(o,g,d,f);return}let m=new Set(p.map((g)=>ae(g)));for(let g of a){if(g.op==="set-key"&&m.has(ae(g.path))){Nf(o,g.path,d);continue}Tl(o,g,d,f)}}function Nf(o,a,d){let f=Rl(d,a);if(f)Nt(f,xe(o,a))}function Oo(o){if(!o)throw Error("iframe-patch-no-render-ctx");return o}function Tl(o,a,d,f){switch(a.op){case"set-key":{if(a.key==="style"){Mf(o,a.path,d,f);return}if(a.key==="textContent"){_f(o,a.path,d);return}if(a.key.startsWith("on"))return;Cl(o,a.path,d,Oo(f));return}case"insert-child":{Rf(o,a.parentPath,a.index,d,Oo(f));return}case"set-child":{Cl(o,[...a.parentPath,"children",a.index],d,Oo(f));return}case"remove-child":{$f(o,a.parentPath,a.index,d);return}case"move-child":{Of(o,a.fromParentPath,a.fromIndex,a.toParentPath,a.toIndex,d);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(a)}`)}}function Rf(o,a,d,f,p){let m=st(f,a),g=xe(o,a),h=Ro(o,[...a,"children",d],p);ar(f,a,d,1),Pl(m,h,Nl(m,g,d)),Nt(m,g)}function Cl(o,a,d,f){let p=st(d,a),m=Ro(o,a,f);$o(p),p.replaceWith(m)}function $f(o,a,d,f){let p=st(f,[...a,"children",d]),m=p.parentElement;if($o(p),p.remove(),ar(f,a,d+1,-1),m)Nt(m,xe(o,a))}function Of(o,a,d,f,p,m){let g=[...a,"children",d],h=st(m,g),y=h.parentElement,E=st(m,f);h.remove(),ar(m,a,d+1,-1);let C=lr(E)??f;ar(m,C,p,1),kf(h,g,[...C,"children",p]);let T=xe(o,C);if(Pl(E,h,Nl(E,T,p)),y)Nt(y,xe(o,lr(y)??a));Nt(E,T)}function Nt(o,a){for(let f of sl)o.classList.remove(f);let d=a?Ao(a):null;if(d)o.classList.add(d)}function Pl(o,a,d){if(d)d.before(a);else o.append(a)}function Nl(o,a,d){let f=a?.textContent,p=f!=null&&String(f)!==""?1:0;return o.childNodes[p+d]??null}function ar(o,a,d,f){let p=a.length;for(let m of o.querySelectorAll("[data-jx-path]")){let g=lr(m);if(!g||g.length<p+2||g[p]!=="children")continue;let h=g[p+1];if(!i(h)||h<d)continue;if(!a.every((E,C)=>g[C]===E))continue;let y=[...g];y[p+1]=h+f,m.dataset.jxPath=ae(y)}}function kf(o,a,d){let f=[o,...o.querySelectorAll("[data-jx-path]")];for(let p of f){let m=lr(p);if(!m||m.length<a.length||!a.every((g,h)=>m[h]===g))continue;p.dataset.jxPath=ae([...d,...m.slice(a.length)])}}function lr(o){let a=o.dataset.jxPath;return a===void 0?null:ge(a)}function Mf(o,a,d,f){let p=st(d,a),m=xe(o,a),g=f?.defs.$media??{};Vn(p,Jf(m?.style),g,f?.defs??{})}function _f(o,a,d){let f=st(d,a),p=xe(o,a);f.textContent=Df(p),Nt(f,p)}function st(o,a){let d=Rl(o,a);if(!d)throw Error(`iframe-patch-element-not-found:${ae(a)}`);return d}function Rl(o,a){let f=ae(a).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function Jf(o){if(!o||!n(o))return;let a={};for(let[d,f]of Object.entries(o)){if(We(f))continue;a[d]=f}return a}function Df(o){let a=o?.textContent;if(a==null)return"";if(e(a))return a.includes("${")?an(a):a;if(n(a)&&a.$ref){let d=String(a.$ref);return`{${d.startsWith("#/state/")?d.slice(8):d}}`}return String(a)}function $l(o){if(o===void 0)return"undefined";let a;try{a=JSON.stringify(o)??"undefined"}catch{a=String(o)}if(a.length>48)a=`${a.slice(0,47)}…`;return a}function Lf(o){return s(o)&&"$expression"in o&&Array.isArray(o.parameters)}function If(o){try{return structuredClone(o)}catch{return null}}function jf(o,a){let d={};for(let f of Object.keys(o))try{let p=o[f];if(t(p)){if(Lf(a?.[f]))d[f]=p;continue}let m=JSON.stringify(p);d[f]=m===void 0?null:JSON.parse(m)}catch{d[f]=null}return d}function Hf(o,a,d){if(!d||d.length===0)return o;let f=a,p=o;for(let m of d){if(!n(f))break;let g=f;if(g.$prototype==="Array"&&m==="map"){let h=g.items,y=r(h)?Se(h.$ref,p):h;if(Array.isArray(y)&&y.length>0){let[E]=y,C=If(E),T=Object.create(p);T.$map={index:0,item:C},T["$map/item"]=C,T["$map/index"]=0,p=T}}f=g[m]}return p}function Ol(o,a,d,f){let p=d?.state??null;return o.map(({id:m,node:g})=>{let h=new Map,y;try{y=Hf(jf(a,p),d,f)}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[]}}try{if(!n(g)||!("operator"in g))throw Error("not an expression node");return Ce(g,y,null,void 0,{report:(E,C)=>{h.set(E.join("/"),$l(C))}}),{id:m,values:[...h.entries()]}}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[...h.entries()]}}})}var Ff=256000,Vf="[large value omitted]";function kl(o){let a={};for(let d of Object.keys(o))try{let f=o[d];if(t(f))continue;let p=JSON.stringify(f);if(p===void 0){a[d]=null;continue}if(p.length>Ff){a[d]=Vf;continue}a[d]=JSON.parse(p)}catch{a[d]=null}return a}function Ml(o,a){return new URL(`/node_modules/${o}`,a).href}var _l={"jx-ui:/behaviors/color-area.ts":()=>(me("6rbra5dy"),import("./chunks/color-area-6rbra5dy.js")),"jx-ui:/behaviors/color-field.ts":()=>(me("gy56c94g"),import("./chunks/color-field-gy56c94g.js")),"jx-ui:/behaviors/color-slider.ts":()=>(me("sqqdyf6c"),import("./chunks/color-slider-sqqdyf6c.js")),"jx-ui:/behaviors/combobox.ts":()=>(me("72h32ejk"),import("./chunks/combobox-72h32ejk.js")),"jx-ui:/behaviors/dialog.ts":()=>(me("c4x05vyx"),import("./chunks/dialog-c4x05vyx.js")),"jx-ui:/behaviors/listbox.ts":()=>(me("c421cf8c"),import("./chunks/listbox-c421cf8c.js")),"jx-ui:/behaviors/menu.ts":()=>(me("bdpzbfvs"),import("./chunks/menu-bdpzbfvs.js")),"jx-ui:/behaviors/number-field.ts":()=>(me("y62xq0ty"),import("./chunks/number-field-y62xq0ty.js")),"jx-ui:/behaviors/action-group.ts":()=>(me("4aan7g6g"),import("./chunks/action-group-4aan7g6g.js")),"jx-ui:/behaviors/popover.ts":()=>(me("b89sfej7"),import("./chunks/popover-b89sfej7.js")),"jx-ui:/behaviors/select.ts":()=>(me("rzds841e"),import("./chunks/select-rzds841e.js")),"jx-ui:/behaviors/split.ts":()=>(me("c9zfdgxf"),import("./chunks/split-c9zfdgxf.js")),"jx-ui:/behaviors/swatch-group.ts":()=>(me("ewh24n1f"),import("./chunks/swatch-group-ewh24n1f.js")),"jx-ui:/behaviors/tabs.ts":()=>(me("f5cw3tgp"),import("./chunks/tabs-f5cw3tgp.js")),"jx-ui:/behaviors/toolbar.ts":()=>(me("44cm5cta"),import("./chunks/toolbar-44cm5cta.js")),"jx-ui:/behaviors/tree.ts":()=>(me("9xa4hm7n"),import("./chunks/tree-9xa4hm7n.js")),"jx-ui:/behaviors/tooltip.ts":()=>(me("yypz28gq"),import("./chunks/tooltip-yypz28gq.js")),"jx-ui:/behaviors/textfield.ts":()=>(me("wewc8rq2"),import("./chunks/textfield-wewc8rq2.js")),"jx-ui:/behaviors/toast.ts":()=>(me("1gv0h53h"),import("./chunks/toast-1gv0h53h.js")),"jx-ui:/behaviors/toast-host.ts":()=>(me("1yg5ar8d"),import("./chunks/toast-host-1yg5ar8d.js")),"jx-ui:/color.ts":()=>(me("m7r1vk54"),import("./chunks/color-m7r1vk54.js")),"jx-ui:/icons.ts":()=>(me("63bjtbs7"),import("./chunks/icons-63bjtbs7.js"))};var Wf;function Jl(o){Wf=new URL("./",o).href}Jl(import.meta.url);for(let[o,a]of Object.entries(_l))Ls(o,a);Js((o)=>Ml(o,location.href));function ln(o,a,d,f){let p=So(o.x,o.y,f);if(!p)return null;return vo(p,o.y,d,a)}function ko(o){return[...o.dataTransfer?.types??[]].includes("Files")}var Bf={type:"block"},_o={},Mo=null;function Dl(o){return o?{...o,versions:_o}:null}function Kf(o,a){let d=o.dataset.jxPath;if(d==null)return null;let f=ge(d),p=a?xe(a,f):void 0;return{path:f,rect:Qe(o),tagName:(u(p?.tagName)||o.tagName).toLowerCase()}}function Uf(o){if(!(o instanceof Element))return null;if(o.closest("[data-jx-path]"))return null;let a=o.closest("[data-jx-layout-region]");if(!(a instanceof HTMLElement))return null;return{className:a.className,layoutFile:a.dataset.jxLayoutFile??"",layoutPath:ge(a.dataset.jxLayoutPath??"[]"),rect:Qe(a),tagName:a.tagName.toLowerCase()}}function Ll(o){let a=n(o)&&"message"in o?o.message:void 0;return String(a??o)}var qf=new Set(["style","textContent"]);function zf(o){let a=Da();if(!a)return!1;for(let d of o){let f;if(d.op==="set-key"){if(qf.has(d.key)||d.key.startsWith("on"))continue;f=d.path}else if(d.op==="move-child"){if(f=d.fromParentPath,Et(f,a)||Et(d.toParentPath,a))return!0;continue}else f=d.parentPath;if(Et(f,a))return!0}return!1}var Gf=2,Yf=5000,Xf=500;function Zf(o){let{channel:a,container:d}=o;_o={},Mo=null;let f=null,p=null,m=-1,g=aa(d.ownerDocument),h=null,y=-1,E="design",C=null,T=null,A=ir,H=null,k=null,K=-1,L=-1,_=0,Y=null,q=d.ownerDocument.defaultView;function G(){if(_&&q)q.cancelAnimationFrame(_);_=0,Y=null}function U(){_=0;let P=Y?.src??k;if(!q||!Y||!P||!h)return;let ie=Eo(Y.y,q.innerHeight);if(ie===0)return;let oe=q.scrollY;if(q.scrollBy(0,ie*Za),q.scrollY===oe)return;let Ee=ln(Y,P,h,d.ownerDocument),se={dragSeq:Y.dragSeq,gen:Y.gen??K,kind:"dragOver",preview:Ee};if(Y.withCursor)se.cursor={x:Y.x,y:Y.y};a.post(se),_=q.requestAnimationFrame(U)}function M(P,ie,oe){if(!q||Eo(P.y,q.innerHeight)===0){G();return}let Ee={dragSeq:ie,withCursor:oe!=null,x:P.x,y:P.y};if(oe)Ee.gen=oe.gen,Ee.src=oe.src;if(Y=Ee,!_)_=q.requestAnimationFrame(U)}let B=za(a,d.ownerDocument,{getGen:()=>y,getMode:()=>E,getShadowDoc:()=>h}),re=(P)=>{if(E!=="design"&&E!=="edit")return;let ie=Uf(P.target);if(ie)a.post({hit:ie,kind:"layoutHit"})};d.ownerDocument.addEventListener("click",re,!0);let X=El(a,d.ownerDocument,Me,()=>A,()=>E),ce=yl(a,d,{getMode:()=>E,getShadowDoc:()=>h}),ee=bl(a,d.ownerDocument),ne=la(d),ve=30000,V=-1;function N(){let P=d.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),ie=Pe(d),oe=0;for(let Ee of P)oe=Math.max(oe,Pe(Ee).bottom-ie.top);return oe}function z(){let P=Math.max(d.scrollHeight,N()),ie=Math.min(P,ve);if(ie>0&&Math.abs(ie-V)>=1){V=ie;let oe=d.firstElementChild,Ee=oe instanceof HTMLElement&&oe.dataset.jxDefinitionRoot!==void 0;a.post({fragment:Ee,height:ie,kind:"contentHeight"}),at()}}let Q=q?.ResizeObserver,de=Q?new Q(()=>z()):null,_e=d.ownerDocument,ye=0,Ae=0,cn=0,Be="",Rt=new Map;function Il(){let P=Date.now();for(let[ie,oe]of Rt)if(oe<=P)Rt.delete(ie);return Rt.size}function jl(){let P=_e;return{animations:P.getAnimations?.().filter((oe)=>oe.playState==="running").length??0,fonts:P.fonts?P.fonts.status==="loaded":!0,gen:y,images:Il(),kind:"idle"}}function Jo(){ye=0;let P=jl(),ie=`${P.gen}|${P.fonts}|${P.animations}|${P.images}`,oe=ie!==Be;if(oe)Be=ie,a.post(P);if(Ae=P.fonts&&P.animations===0&&P.images===0?oe?1:Ae+1:0,Ae>=Gf){z();return}if(Date.now()>=cn)return;ye=q?q.requestAnimationFrame(Jo):0}function at(){if(Ae=0,cn=Date.now()+Yf,!ye&&q)ye=q.requestAnimationFrame(Jo)}let Do=(P)=>{if(P.target instanceof HTMLImageElement)Rt.set(P.target,Date.now()+Xf),at()},Lo=(P)=>{if(P.target instanceof HTMLImageElement&&Rt.delete(P.target))at()};d.addEventListener("error",Do,!0),d.addEventListener("load",Lo,!0),at(),de?.observe(d);let Io=(P)=>{if(E==="preview"){if(P.ctrlKey||P.metaKey)P.preventDefault();return}P.preventDefault(),a.post({ctrlKey:P.ctrlKey,deltaX:P.deltaX,deltaY:P.deltaY,kind:"forwardWheel",metaKey:P.metaKey,shiftKey:P.shiftKey,x:P.clientX,y:P.clientY})};d.ownerDocument.addEventListener("wheel",Io,{passive:!1});let Hl=300,jo=0,Ho=(P,ie)=>{P.preventDefault(),P.stopPropagation();let oe={x:P.clientX,y:P.clientY},Ee=d.ownerDocument,se=So(oe.x,oe.y,Ee),Re=se?Kf(se,h):null,dn=h&&se?vo(se,oe.y,h,Bf):null;if(ie==="fileDragOver"){if(P.dataTransfer)P.dataTransfer.dropEffect="copy";a.post({hit:Re,kind:"fileDragOver",preview:dn});return}a.post({files:[...P.dataTransfer?.files??[]],hit:Re,kind:"fileDrop",preview:dn})},un=(P)=>{if(!k){if(ko(P)){Ho(P,"fileDragOver");return}let Ee=Date.now();if(Ee-jo>=Hl)jo=Ee,a.post({kind:"nativeDragEnter"});return}if(P.preventDefault(),P.dataTransfer)P.dataTransfer.dropEffect="move";let ie={x:P.clientX,y:P.clientY},oe=h?ln(ie,k,h,d.ownerDocument):null;a.post({cursor:ie,dragSeq:L,gen:K,kind:"dragOver",preview:oe}),M(ie,L)},Fo=(P)=>{if(!k){if(ko(P))Ho(P,"fileDrop");return}P.preventDefault();let ie={x:P.clientX,y:P.clientY},oe=h?ln(ie,k,h,d.ownerDocument):null;a.post({dragSeq:L,gen:K,instruction:oe?.instruction??null,kind:"dropResult",targetPath:oe?.targetPath??null}),k=null,K=-1,L=-1,G()},Vo=(P)=>{if(!k&&ko(P)&&!P.relatedTarget)a.post({kind:"fileDragLeave"})};d.ownerDocument.addEventListener("dragenter",un,!0),d.ownerDocument.addEventListener("dragover",un,!0),d.ownerDocument.addEventListener("dragleave",Vo,!0),d.ownerDocument.addEventListener("drop",Fo,!0);let Fl=a.onMessage((P)=>{if(P.kind==="measure"){let{hidden:se,hits:Re}=qa(P.paths,d.ownerDocument);a.post({hidden:se,hits:Re,kind:"geometry",reqId:P.reqId});return}if(P.kind==="evalExpr"){let se=P.gen===y&&H&&h?Ol(P.exprs,H.defs,h,P.contextPath):[];a.post({gen:P.gen,kind:"evalResult",reqId:P.reqId,results:se});return}if(P.kind==="patch"){let{gen:se}=P;if(se<y){a.post({gen:se,kind:"patchError",message:"patch-behind-render"});return}if(se>y||!h||!H){a.post({gen:se,kind:"patchError",message:"patch-ahead-of-render"});return}let Re=new Set((P.echoPaths??[]).map((lt)=>ae(lt))),dn=Re.size===0?P.forwardOps:P.forwardOps.filter((lt)=>!(lt.op==="set-key"&&Re.has(ae(lt.path)))),Wo=Me()&&zf(dn),Bo=Wo?nr(d,it):null;if(Wo)Le();try{if(Al(h,P.forwardOps,d,H,P.echoPaths),en(d,C),vt(d,T),Bo)sn(d,Bo);a.post({gen:se,kind:"patchComplete"}),at()}catch(lt){a.post({gen:se,kind:"patchError",message:Ll(lt)})}return}if(P.kind==="styleUpdate"){if(P.gen!==y||!h)return;h.style=P.style;let se=d.firstElementChild;if(se instanceof HTMLElement)Vn(se,P.style,h.$media??{});return}if(P.kind==="dragStart"){k=P.src,K=P.gen,L=P.dragSeq;return}if(P.kind==="dragEnd"||P.kind==="dragCancel"){k=null,K=-1,L=-1,G();return}if(P.kind==="dragMove"){let se=k&&h?ln(P.cursor,k,h,d.ownerDocument):null;a.post({dragSeq:P.dragSeq,gen:K,kind:"dragOver",preview:se}),M(P.cursor,P.dragSeq);return}if(P.kind==="drop"){let se=k&&h?ln(P.cursor,k,h,d.ownerDocument):null;a.post({dragSeq:P.dragSeq,gen:K,instruction:se?.instruction??null,kind:"dropResult",targetPath:se?.targetPath??null}),k=null,K=-1,L=-1,G();return}if(P.kind==="assetVersions"){_o=P.versions;let se=Dl(Mo);if(se)Dn((Re)=>Xt(Re,se));return}if(P.kind==="keymap"){A={chords:P.chords,mac:P.mac};return}if(P.kind==="setColorScheme"){so(d.ownerDocument,P.scheme);return}if(P.kind==="setPopoverOpen"){if(E==="preview")return;C=P.path===null?null:ae(P.path),en(d,C),vt(d,T),z();return}if(P.kind==="setDialogOpen"){if(E==="preview")return;T=P.path===null?null:ae(P.path),vt(d,T),z();return}if(P.kind==="redefineElement"){qs(P.doc,P.base);return}if(P.kind==="setLocale"){qn(d.ownerDocument,P.locale===null?null:{dir:P.dir,locale:P.locale},g);return}if(P.kind==="siteStyleUpdate"){io(P.siteStyle,P.media);return}if(P.kind!=="render"||P.gen<m)return;if(so(d.ownerDocument,P.colorScheme??null),qn(d.ownerDocument,P.locale??null,g),Me())Le();m=P.gen,Mo=P.assets??null,Ma(P.editableTags??null);let{gen:ie,mapperCtx:oe}=P,Ee=P.shadowDoc;(async()=>{try{wl(),p?.(),p=null,f?.dispose(),Vs(d.ownerDocument);let se={assets:Dl(P.assets??null),container:d,doc:P.doc,docBase:P.docBase,mapperCtx:{arrayPaths:new Set(oe.arrayPaths),canvasMode:oe.canvasMode,layoutWrapped:oe.layoutWrapped,pageContentOffset:oe.pageContentOffset,pageContentPrefix:oe.pageContentPrefix},diffMarks:P.diffMarks??null,mode:P.mode,popoverOpen:P.popoverOpen?ae(P.popoverOpen):null,dialogOpen:P.dialogOpen?ae(P.dialogOpen):null,siteStyle:P.siteStyle};if(P.allowAutoRequests)se.allowAutoRequests=!0;if(f=await ca(se),ie===m){C=P.popoverOpen?ae(P.popoverOpen):null,T=P.dialogOpen?ae(P.dialogOpen):null,en(d,C),vt(d,T),h=Ee,H=f.ctx,y=ie,E=P.mode,a.post({gen:ie,kind:"renderComplete"}),at();let{defs:Re}=f.ctx;p=vs(()=>{try{a.post({gen:ie,kind:"dataScope",scope:kl(Re)})}catch{}}),z()}}catch(se){a.post({gen:ie,kind:"renderError",message:Ll(se)})}})()});return a.post({kind:"ready"}),()=>{if(Fl(),qn(d.ownerDocument,null,g),B(),X(),ce(),ee(),ne(),ye&&q)q.cancelAnimationFrame(ye);ye=0,d.removeEventListener("error",Do,!0),d.removeEventListener("load",Lo,!0),G(),de?.disconnect(),d.ownerDocument.removeEventListener("click",re,!0),d.ownerDocument.removeEventListener("wheel",Io),d.ownerDocument.removeEventListener("dragenter",un,!0),d.ownerDocument.removeEventListener("dragleave",Vo,!0),d.ownerDocument.removeEventListener("dragover",un,!0),d.ownerDocument.removeEventListener("drop",Fo,!0),p?.(),f?.dispose()}}function Qf(o){let a=new URLSearchParams(o.location.search);bs(a.get("rpcToken"));let d=a.get("parentOrigin"),f=d||"*";if(!d)console.warn("[jx-canvas] no parentOrigin in iframe URL — accepting messages from any origin (token-gated). "+"The parent origin did not round-trip; the channel relies on the shared token alone.");let p=o.document.querySelector("#jx-canvas-root"),m=p instanceof HTMLElement?p:o.document.body,g=Uo({acceptOrigin:f,source:o,target:o.parent,targetOrigin:f,token:a.get("token")||""});return Zf({channel:g,container:m})}if(typeof window<"u"&&window.parent!==window)Qf(window);export{Gf as IDLE_QUIET_FRAMES,Yf as IDLE_WATCH_MAX_MS,Xf as IMAGE_RETRY_WINDOW_MS,Qf as bootCanvasIframe,Kf as fileDropHitFor,ko as isExternalFileDrag,Uf as layoutHitFor,zf as patchDisturbsActiveEdit,Zf as startCanvasIframe};
313
317
 
314
- //# debugId=C85ED0AE14F83A8D64756E2164756E21
318
+ //# debugId=376A8BE22AD4734264756E2164756E21
315
319
  //# sourceMappingURL=iframe-entry.js.map