@jxsuite/studio 8.0.1 → 8.1.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 (219) hide show
  1. package/dist/chunks/{2020-5wtzce5g.js → 2020-dg097k3e.js} +3 -3
  2. package/dist/chunks/adapter-tck81zft.js +4 -0
  3. package/dist/chunks/{add-new-flow-psym14sn.js → add-new-flow-a1w0bnm6.js} +3 -3
  4. package/dist/chunks/{cf-account-picker-haqazq5r.js → cf-account-picker-ce3kp3x1.js} +3 -3
  5. package/dist/chunks/cf-settings-7ye6x7g2.js +4 -0
  6. package/dist/chunks/color-4gj49xq6.js +4 -0
  7. package/dist/chunks/{color-area-6rbra5dy.js → color-area-vh9cew51.js} +2 -2
  8. package/dist/chunks/{color-field-gy56c94g.js → color-field-e78f16bs.js} +3 -3
  9. package/dist/chunks/{color-slider-sqqdyf6c.js → color-slider-fg4yhvk6.js} +2 -2
  10. package/dist/chunks/{combobox-72h32ejk.js → combobox-6hs00996.js} +2 -2
  11. package/dist/chunks/components-qce0v93f.js +4 -0
  12. package/dist/chunks/content-source-jjx8kgzr.js +4 -0
  13. package/dist/chunks/{convert-to-repeater-he70fc2b.js → convert-to-repeater-grnmea6c.js} +3 -3
  14. package/dist/chunks/editor-bkja5dbv.js +4 -0
  15. package/dist/chunks/entry-commands-1wh0btvg.js +4 -0
  16. package/dist/chunks/{extension-sections-0egb88dm.js → extension-sections-rp7fkega.js} +3 -3
  17. package/dist/chunks/file-ops-6pe4z7an.js +4 -0
  18. package/dist/chunks/files-ybpp3j38.js +4 -0
  19. package/dist/chunks/format-host-3mtbhxk1.js +4 -0
  20. package/dist/chunks/fs-events-xfanfxds.js +4 -0
  21. package/dist/chunks/grid-open-dg5qmnaj.js +4 -0
  22. package/dist/chunks/{grid-view-qg1b5eqx.js → grid-view-x26rfpz1.js} +16 -15
  23. package/dist/chunks/{icons-63bjtbs7.js → icons-853n6qt3.js} +2 -2
  24. package/dist/chunks/{iframe-entry-2zggzajv.js → iframe-entry-02wzcyvy.js} +4 -4
  25. package/dist/chunks/{iframe-entry-99nr5zfb.js → iframe-entry-42hpmwz5.js} +4 -4
  26. package/dist/chunks/{iframe-entry-76j8vwwx.js → iframe-entry-b5qgggyp.js} +2 -2
  27. package/dist/chunks/iframe-host-j2bk2xkc.js +4 -0
  28. package/dist/chunks/{index-32eqzv1k.js → index-203h71wy.js} +3 -3
  29. package/dist/chunks/index-fkrm7pdk.js +4 -0
  30. package/dist/chunks/{javascript-pjp734q4.js → javascript-ww5pv5ae.js} +2 -2
  31. package/dist/chunks/{jsonMode-njkvsa02.js → jsonMode-vwbdwwq3.js} +6 -6
  32. package/dist/chunks/jx-validate-w7v32f6a.js +4 -0
  33. package/dist/chunks/layers-g7j732cm.js +4 -0
  34. package/dist/chunks/layers-panel-gjrsxcck.js +4 -0
  35. package/dist/chunks/{listbox-c421cf8c.js → listbox-7gka1h86.js} +2 -2
  36. package/dist/chunks/lit-html-jdfz9rhc.js +4 -0
  37. package/dist/chunks/media-library-9j0v4wmk.js +4 -0
  38. package/dist/chunks/media-picker-cpyyt2m0.js +4 -0
  39. package/dist/chunks/{menu-bdpzbfvs.js → menu-d2jxpgma.js} +2 -2
  40. package/dist/chunks/{monaco-binding-vq1hgnn0.js → monaco-binding-63tqze27.js} +3 -3
  41. package/dist/chunks/monaco-buffer-9wcme176.js +4 -0
  42. package/dist/chunks/{monaco-setup-xrd2cbkp.js → monaco-setup-zyyynnj8.js} +3 -3
  43. package/dist/chunks/notify-rahnnnv4.js +4 -0
  44. package/dist/chunks/platform-b2aqv7v5.js +4 -0
  45. package/dist/chunks/{popover-b89sfej7.js → popover-9tf4cjrk.js} +2 -2
  46. package/dist/chunks/publish-panel-4yk2461b.js +4 -0
  47. package/dist/chunks/{publish-quick-qx2455cj.js → publish-quick-ajzdhhs6.js} +3 -3
  48. package/dist/chunks/publish-workspace-mxestzcf.js +4 -0
  49. package/dist/chunks/quick-search-9g6z65b0.js +4 -0
  50. package/dist/chunks/references-c26enpxs.js +4 -0
  51. package/dist/chunks/right-panel-9d0e0yg7.js +4 -0
  52. package/dist/chunks/source-control-xyn3a8ds.js +4 -0
  53. package/dist/chunks/{split-c9zfdgxf.js → split-m5rwn31z.js} +2 -2
  54. package/dist/chunks/{studio-x9hsze61.js → studio-02phtmqn.js} +4 -4
  55. package/dist/chunks/{studio-4hp8pkyt.js → studio-0khd0xdw.js} +4 -4
  56. package/dist/chunks/studio-1fvzq9vs.js +5 -0
  57. package/dist/chunks/studio-1gdfsr49.js +12 -0
  58. package/dist/chunks/{studio-3q40e3rj.js → studio-1meqbxns.js} +4 -4
  59. package/dist/chunks/{studio-q0tccd43.js → studio-1yhz0s8p.js} +4 -4
  60. package/dist/chunks/studio-25a5by3h.js +5 -0
  61. package/dist/chunks/{studio-k3xxbagr.js → studio-2b8443ms.js} +3 -3
  62. package/dist/chunks/{studio-3qqjeep5.js → studio-2c2mjyzj.js} +5 -5
  63. package/dist/chunks/studio-2dtc90zs.js +10 -0
  64. package/dist/chunks/{studio-9tmebf0s.js → studio-332hesdk.js} +4 -4
  65. package/dist/chunks/{studio-03ct6yfv.js → studio-3pndhat0.js} +8 -8
  66. package/dist/chunks/{studio-s32578pn.js → studio-3q6n9qvq.js} +4 -4
  67. package/dist/chunks/studio-4dsdnan2.js +9 -0
  68. package/dist/chunks/{studio-ed1hp6zf.js → studio-4fjqdzrb.js} +5 -5
  69. package/dist/chunks/{studio-jcnsdaep.js → studio-533py3yy.js} +4 -4
  70. package/dist/chunks/studio-5abge3wy.js +5 -0
  71. package/dist/chunks/{studio-8tr6cfrc.js → studio-6vrxzkba.js} +4 -4
  72. package/dist/chunks/{studio-jaaz8ce9.js → studio-73wz63nn.js} +4 -4
  73. package/dist/chunks/{studio-bavb31r0.js → studio-74nzv280.js} +4 -4
  74. package/dist/chunks/{studio-q7rtx6zq.js → studio-7cg75gtj.js} +7 -7
  75. package/dist/chunks/studio-89cwmnae.js +5 -0
  76. package/dist/chunks/studio-8m1t83kn.js +7 -0
  77. package/dist/chunks/{studio-q0mvbaq6.js → studio-8nyw10dp.js} +4 -4
  78. package/dist/chunks/{studio-83mk4bgg.js → studio-94ppxeqy.js} +8 -8
  79. package/dist/chunks/{studio-qmn1xc24.js → studio-957jg8g3.js} +4 -4
  80. package/dist/chunks/{studio-r5qy30vx.js → studio-9wyqyfqy.js} +4 -4
  81. package/dist/chunks/studio-a3evp7f6.js +6 -0
  82. package/dist/chunks/{studio-n0c5h6mf.js → studio-a6x058ew.js} +4 -4
  83. package/dist/chunks/studio-ana67wax.js +5 -0
  84. package/dist/chunks/studio-b4xhpcwy.js +4 -0
  85. package/dist/chunks/studio-bf0rgyf7.js +5 -0
  86. package/dist/chunks/{studio-x1x167jh.js → studio-bqgs90r8.js} +4 -4
  87. package/dist/chunks/{studio-qwdqwkj0.js → studio-c4rcaftm.js} +4 -4
  88. package/dist/chunks/{studio-mn0476ag.js → studio-c5dj3dzk.js} +4 -4
  89. package/dist/chunks/studio-cgjt1zce.js +5 -0
  90. package/dist/chunks/{studio-bbe4c90a.js → studio-cpdzrdgp.js} +4 -4
  91. package/dist/chunks/studio-cq87hree.js +5 -0
  92. package/dist/chunks/studio-d140sy8e.js +5 -0
  93. package/dist/chunks/{studio-jsgf2q5k.js → studio-dmn7gpba.js} +5 -5
  94. package/dist/chunks/studio-e8pzjjhf.js +5 -0
  95. package/dist/chunks/{studio-dgk4dqtx.js → studio-f8kz3krj.js} +5 -5
  96. package/dist/chunks/{studio-qgh13jtz.js → studio-fqs1a22a.js} +4 -4
  97. package/dist/chunks/{studio-syreb644.js → studio-fw3jp9m7.js} +4 -4
  98. package/dist/chunks/{studio-ed3xx40h.js → studio-g6ysm05p.js} +6 -6
  99. package/dist/chunks/studio-gmhd0j3f.js +5 -0
  100. package/dist/chunks/{studio-p4nrkvqr.js → studio-gqpty626.js} +4 -4
  101. package/dist/chunks/{studio-kt3pjkwd.js → studio-grp684wx.js} +4 -4
  102. package/dist/chunks/{studio-df0baea9.js → studio-h98520qr.js} +4 -4
  103. package/dist/chunks/{studio-8m0y2qe7.js → studio-hnx1h1pr.js} +4 -4
  104. package/dist/chunks/studio-hvxt8z79.js +5 -0
  105. package/dist/chunks/{studio-43sd2mam.js → studio-hw60n5dh.js} +3 -3
  106. package/dist/chunks/{studio-wbcjbhy1.js → studio-hxq1ebp0.js} +6 -6
  107. package/dist/chunks/{studio-wys23mxz.js → studio-j4e627w1.js} +4 -4
  108. package/dist/chunks/{studio-ccv2svc6.js → studio-j5jqvyn3.js} +4 -4
  109. package/dist/chunks/{studio-881z1xrx.js → studio-jqrg9xxg.js} +4 -4
  110. package/dist/chunks/{studio-b7y5mr30.js → studio-kdseew9m.js} +4 -4
  111. package/dist/chunks/studio-kt2j51sa.js +5 -0
  112. package/dist/chunks/{studio-d5grtb9e.js → studio-m4w6sygj.js} +9 -9
  113. package/dist/chunks/{studio-zz9qe3rw.js → studio-mmqr9awv.js} +37 -37
  114. package/dist/chunks/{studio-5g0rprdt.js → studio-nm9qev4p.js} +5 -5
  115. package/dist/chunks/{studio-tft6r105.js → studio-nsv7g1qn.js} +4 -4
  116. package/dist/chunks/{studio-3e54qh39.js → studio-p89w12s2.js} +5 -5
  117. package/dist/chunks/{studio-y3ahhdpx.js → studio-pbagym4j.js} +4 -4
  118. package/dist/chunks/{studio-w4rz9hdk.js → studio-pr23qhrw.js} +4 -4
  119. package/dist/chunks/{studio-6m380wp7.js → studio-r4ya3sb2.js} +4 -4
  120. package/dist/chunks/studio-rdnezzkd.js +6 -0
  121. package/dist/chunks/{studio-f14e1zdj.js → studio-rm9m3z60.js} +4 -4
  122. package/dist/chunks/studio-tpmnbgmt.js +5 -0
  123. package/dist/chunks/studio-ttxhq5yt.js +5 -0
  124. package/dist/chunks/{studio-nh6d342n.js → studio-txkx6586.js} +6 -6
  125. package/dist/chunks/{studio-a2bvaptz.js → studio-v0gsjav0.js} +4 -4
  126. package/dist/chunks/{studio-fbhxxc5f.js → studio-v2ek69cb.js} +4 -4
  127. package/dist/chunks/{studio-y0n7yxea.js → studio-wcakp5bt.js} +7 -7
  128. package/dist/chunks/{studio-k7evxqh4.js → studio-x3ge4rts.js} +4 -4
  129. package/dist/chunks/{studio-pbxa5fpc.js → studio-xddgbwhe.js} +3 -3
  130. package/dist/chunks/{studio-c05wdnt3.js → studio-y1x65h5r.js} +4 -4
  131. package/dist/chunks/{studio-rthyg42z.js → studio-z42kysg7.js} +169 -169
  132. package/dist/chunks/studio-zf188hnd.js +5 -0
  133. package/dist/chunks/{studio-tfkznv39.js → studio-zht0x0v3.js} +4 -4
  134. package/dist/chunks/{studio-svb7yyve.js → studio-zm7dnr9g.js} +4 -4
  135. package/dist/chunks/{tooltip-yypz28gq.js → tooltip-dj1pvgz7.js} +2 -2
  136. package/dist/chunks/{tree-9xa4hm7n.js → tree-j0ebwr5s.js} +2 -2
  137. package/dist/chunks/{tsMode-epyfz1hv.js → tsMode-vra2hh7y.js} +5 -5
  138. package/dist/chunks/workspace-3nt93k48.js +4 -0
  139. package/dist/chunks/workspace-home-zbgyqqws.js +4 -0
  140. package/dist/chunks/{ws-client-bv552sfx.js → ws-client-72x5n99j.js} +3 -3
  141. package/dist/iframe-entry.js +14 -14
  142. package/dist/manifest.json +75 -75
  143. package/dist/studio.js +80 -80
  144. package/package.json +11 -11
  145. package/src/browse/component-examples.ts +15 -224
  146. package/src/browse/library-preview.ts +6 -13
  147. package/src/browse/preview-root.ts +7 -4
  148. package/src/canvas/canvas-utils.ts +18 -4
  149. package/src/canvas/iframe-editable-root.ts +13 -4
  150. package/src/canvas/iframe-entry.ts +3 -1
  151. package/src/canvas/iframe-interaction.ts +11 -2
  152. package/src/canvas/iframe-render.ts +25 -3
  153. package/src/canvas/preview-placeholder.ts +120 -0
  154. package/src/editor/shortcuts.ts +3 -0
  155. package/src/panels/component-preview.ts +5 -0
  156. package/src/panels/pane-context.ts +43 -18
  157. package/src/panels/site-model.ts +7 -19
  158. package/src/panels/site-panel.ts +2 -25
  159. package/src/panels/stylebook-doc.ts +2 -53
  160. package/src/services/references.ts +0 -0
  161. package/src/style/stylebook-specimens.ts +11 -15
  162. package/src/surfaces/pane-context.json +286 -265
  163. package/src/surfaces/pane-context.ts +17 -8
  164. package/src/tabs/tab.ts +5 -6
  165. package/src/utils/geometry.ts +49 -2
  166. package/dist/chunks/adapter-5tphg7xe.js +0 -4
  167. package/dist/chunks/cf-settings-h2wrh6hq.js +0 -4
  168. package/dist/chunks/color-m7r1vk54.js +0 -4
  169. package/dist/chunks/components-r22xca09.js +0 -4
  170. package/dist/chunks/content-source-mmppmcyg.js +0 -4
  171. package/dist/chunks/editor-ccd9jwsa.js +0 -4
  172. package/dist/chunks/entry-commands-6qxz9e8p.js +0 -4
  173. package/dist/chunks/file-ops-qnab36ek.js +0 -4
  174. package/dist/chunks/files-rcn56qvm.js +0 -4
  175. package/dist/chunks/format-host-yxz0kjjs.js +0 -4
  176. package/dist/chunks/fs-events-d1qxq4z4.js +0 -4
  177. package/dist/chunks/grid-open-4z1g062t.js +0 -4
  178. package/dist/chunks/iframe-host-ssv7kyj0.js +0 -4
  179. package/dist/chunks/index-f0jn7nnp.js +0 -4
  180. package/dist/chunks/jx-validate-ttasrbh7.js +0 -4
  181. package/dist/chunks/layers-bgyr11tr.js +0 -4
  182. package/dist/chunks/layers-panel-7ez66zeq.js +0 -4
  183. package/dist/chunks/lit-html-v9gh687x.js +0 -4
  184. package/dist/chunks/media-library-sq468wts.js +0 -4
  185. package/dist/chunks/media-picker-shfe59pt.js +0 -4
  186. package/dist/chunks/monaco-buffer-3afgwvbp.js +0 -4
  187. package/dist/chunks/notify-kzrjr3fv.js +0 -4
  188. package/dist/chunks/platform-7v4rtd7m.js +0 -4
  189. package/dist/chunks/publish-panel-2z9gw8ee.js +0 -4
  190. package/dist/chunks/publish-workspace-wrc1dgwx.js +0 -4
  191. package/dist/chunks/quick-search-n0t0eqxb.js +0 -4
  192. package/dist/chunks/references-9547rg5s.js +0 -4
  193. package/dist/chunks/right-panel-wsgnr9pn.js +0 -4
  194. package/dist/chunks/source-control-kwktr9y6.js +0 -4
  195. package/dist/chunks/studio-07rcfje3.js +0 -5
  196. package/dist/chunks/studio-3exxhz5g.js +0 -5
  197. package/dist/chunks/studio-3qeh9t0h.js +0 -6
  198. package/dist/chunks/studio-58xg6j2q.js +0 -9
  199. package/dist/chunks/studio-80jyh1xh.js +0 -4
  200. package/dist/chunks/studio-8vcvfs7r.js +0 -6
  201. package/dist/chunks/studio-fyh0jc96.js +0 -5
  202. package/dist/chunks/studio-gcxk20n7.js +0 -5
  203. package/dist/chunks/studio-m8g16bgz.js +0 -5
  204. package/dist/chunks/studio-mx1smyq0.js +0 -5
  205. package/dist/chunks/studio-pgmvdv7z.js +0 -7
  206. package/dist/chunks/studio-ph84avkf.js +0 -5
  207. package/dist/chunks/studio-rj9eamf8.js +0 -5
  208. package/dist/chunks/studio-rptgsk96.js +0 -5
  209. package/dist/chunks/studio-s19tp1xr.js +0 -5
  210. package/dist/chunks/studio-tf9jryb1.js +0 -10
  211. package/dist/chunks/studio-txf2kysx.js +0 -5
  212. package/dist/chunks/studio-v8867ddv.js +0 -12
  213. package/dist/chunks/studio-vxq7fcvv.js +0 -5
  214. package/dist/chunks/studio-wc649wss.js +0 -5
  215. package/dist/chunks/studio-z97c48fk.js +0 -5
  216. package/dist/chunks/studio-zat62m0c.js +0 -5
  217. package/dist/chunks/studio-zcd2e7yz.js +0 -5
  218. package/dist/chunks/workspace-dz7nxfhv.js +0 -4
  219. package/dist/chunks/workspace-home-xsd7hkjw.js +0 -4
@@ -1,5 +1,5 @@
1
- import{Q}from"./studio-nqxqf8p2.js";import{p}from"./studio-w4rz9hdk.js";import{g,C}from"./studio-43sd2mam.js";import{nv}from"./studio-c05wdnt3.js";import{Pt,Nt,ae}from"./studio-q7rtx6zq.js";import{jl,gp}from"./studio-07rcfje3.js";import{qe,ft,T,R,Jt,rt,tt}from"./studio-x9hsze61.js";import{Wu}from"./studio-jaaz8ce9.js";import{WD}from"./studio-bavb31r0.js";import{Kl}from"./studio-d5grtb9e.js";import{x}from"./studio-gcxk20n7.js";import{n,te,S,v}from"./studio-vxq7fcvv.js";var B=[{id:"general",intro:"",label:"General",note:""},{id:"integrations",intro:"Turn on what your site needs. Each one adds its own options where you use it.",label:"Integrations",note:""},{id:"advanced",intro:"Changes here affect every page. Most sites never need them.",label:"Advanced",note:"For developers"}],FR="integrations";function jR(e){return B.some((o)=>o.id===e)}var ve="overview",j=new Map,V=new Set;function A(){for(let e of V)e()}function kd(){A()}function E_(e){return V.add(e),()=>{V.delete(e)}}function Ml(e){j.set(e.key,e),A()}function HR(e){if(j.delete(e))A()}function we(){return[...j.values()].toSorted((e,o)=>e.order-o.order)}function Hy(){let e=we();return B.flatMap((o)=>{let s=e.filter((t)=>(t.group??"integrations")===o.id);return s.length===0?[]:[{id:o.id,intro:o.intro,label:o.label,note:o.note,sections:s}]})}function qk(){return Hy().flatMap((e)=>e.sections.map((o)=>o.key))}function I(e){return j.get(e)}var H=null,L=ve;function W(){if(H!==null&&j.has(H))return L=H,H=null,L;if(j.has(L))return L;return qk()[0]??L}function T_(e){if(j.has(e))L=e,H=null;else H=e;A()}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsDialog",$description:"Project Settings (§17.1): a `jx-dialog` whose body is the settings editor's two columns, the grouped section list and the section body. The dialog owns modality, Escape and focus restoration, and its one footer answer is Close: every section writes as it is edited, so there is nothing to confirm or cancel. The body is an ISLAND: this document draws the slot and nothing in it, and `settings/settings-dialog.ts` mounts `settings-pane.json` there through `onNodeCreated` (studio-ui-guidelines.md §9.4).",tagName:"jx-dialog",$props:{headline:"Project settings",confirmLabel:"",cancelLabel:"Close",size:"xl"},attributes:{part:"settings"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},children:[{tagName:"div",attributes:{part:"pane-slot"},style:{$description:"The editor's box is its own (`settings-pane.json`); the slot only gives it the dialog body's width.",minWidth:"0"}}]};T("settings-dialog",X);var J=ft("dialog","settings");function xe(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function Z(e){let o=document.createElement("div");o.style.pointerEvents="auto",e.layer.append(o);let s=!0,t=!1,i=()=>{if(!s)return;s=!1,e.closed()},r=g({closed:i}),l=null,a=(d)=>{if(!t&&s)Pt(d);return d},c=R("settings-dialog",r,o,{onNodeCreated:(d,m,h)=>{if(!t&&d instanceof HTMLElement&&xe(h)==="pane-slot")e.body(d)}}).then(async(d)=>{let m=d.root;if(t)return d.dispose(),m;return l=d,await Jt(m),(m.querySelector('dialog[part="dialog"]')??m).setAttribute(qe,J),a(m)}),u=()=>{let d=l?.root;if(d instanceof HTMLElement)Nt(d);i()};return{close:u,dispose(){if(t)return;u(),t=!0,l?.dispose(),l=null,o.remove()},host:o,ready:c,show(){if(!t)s=!0;return c.then(a)}}}var ee={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"${state.newLabel}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"${state.newLabel}"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"${state.newFieldLabel}",placeholder:"${state.newPlaceholder}",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyText}"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};T("settings-contributed",ee);function Te(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:"",emptyText:"",newFieldLabel:"",newLabel:"",newPlaceholder:""}}function Ne(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ne(e,o,s){e.textContent="";let t=g({...Te(),...o}),i=null,r=!1,l=R("settings-contributed",t,e,{onNodeCreated:(a,c,u)=>{if(!(a instanceof HTMLElement))return;let d=Ne(u);if(d==="form-host")s.formSlot(a);else if(d==="actions")s.actionsSlot(a)}}).then((a)=>{let c=a.root;if(r)return a.dispose(),c;return i=a,c});return{attached:()=>{if(r)return!1;let a=i?.root;return a===void 0?!0:a instanceof HTMLElement&&e.contains(a)},dispose(){r=!0,i?.dispose(),i=null},host:e,ready:l,update(a){t.actionsState=a.actionsState,t.editorRegion=a.editorRegion,t.editorState=a.editorState,t.entries=a.entries,t.entryName=a.entryName,t.layout=a.layout,t.newName=a.newName,t.newState=a.newState,t.title=a.title,t.emptyText=a.emptyText,t.newFieldLabel=a.newFieldLabel,t.newLabel=a.newLabel,t.newPlaceholder=a.newPlaceholder}}}var N=new Map,F=new Set,O=new Map;function BR(e,o){let s=x?.projectConfig?.[e],t=v(s)?s:{};if(!Object.hasOwn(t,o))return Object.keys(t);return N.set(e,o),null}var _=new Map;function ke(e,o){let s={},t=[];for(let i of o){let r=i.indexOf(": "),l=r===-1?"":i.slice(0,r),a=r===-1?i:i.slice(r+2);if(l===e){t.push(a);continue}if(!l.startsWith(`${e}/`))continue;let[c]=l.slice(e.length+1).split("/");if(c&&s[c]===void 0)s[c]=a}return{fields:s,section:t}}async function z(e,o){let s=x?.projectConfig;if(!s)return;if(!(await Kl()).ok)return;let i=[];try{i=await Wu(s)}catch(r){C.warn(`Could not validate project.json — ${Q(r)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}_.set(e,ke(e,i).fields),o()}function oe(e,o){for(let[s,t]of Object.entries(o))if(t===void 0)delete e[s];else e[s]=t}function U(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function Ce(e,o){if(!e)return{};let s=(i)=>{let r={};for(let[l,a]of Object.entries(i))r[l]=t(a);return r},t=(i)=>{if(n(i))return i.replaceAll("${key}",o);if(Array.isArray(i))return i.map((r)=>t(r));if(v(i))return s(i);return i};return s(e)}function ie(e,o,s=null){let t=p(),i={fieldKeyPrefix:`$settings.${e}`,resolvePointer:(r,l)=>{let a={projectConfig:x?.projectConfig??{}};if(v(l))a.scope=l;if(o.formats!==void 0)a.formats=o.formats;return gp(r,a)}};if(te(t.setSecrets))i.commitSecret=async(r,l)=>{let a=WD(e,s,r);return await t.setSecrets({set:{[a]:l}}),a};return i}function M(e){let o=x?.projectConfig;if(!o)return null;let s=o[e];if(v(s))return s;let t={};return o[e]=t,t}function re(e){return`${J}/${e}`}var se=new WeakMap;function w(e){Gk(e.container,e.contribution,e.opts)}function le(e,o){e.echo=o,w(e)}var Ee="entry";function je(e){let o=e?.trim().toLowerCase()||Ee,s=`${o.charAt(0).toUpperCase()}${o.slice(1)}`;return{emptyText:`Select ${/^[aeiou]/u.test(o)?"an":"a"} ${o} or create one`,newFieldLabel:`${s} name`,newLabel:`New ${o}`,newPlaceholder:`${U(o)}-name`}}function Me(e){let{contribution:o,opts:s}=e,t=o.key,i=o.title??t,r=s.actions?"slot":"none",l=re("editor"),a=je(o.settings.entry?.noun);if((o.settings.layout??"form")!=="map")return{actionsState:r,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:i,...a};let c=M(t)??{},u=N.get(t)??null,d=u===null?void 0:c[u],m=u!==null&&S(d);return{actionsState:r,editorRegion:l,editorState:m?"editing":"empty",entries:Object.keys(c).map((h)=>({key:h,region:re(`entry:${h}`),selected:h===u})),entryName:e.echo??(m?u:""),layout:"map",newName:O.get(t)??"",newState:F.has(t)?"open":"closed",title:i,...a}}function ce(e){let o=e.formHost;if(!o)return;let{contribution:s,opts:t}=e,i=s.key,r=s.settings.entry?.ui,l=()=>w(e),a=(k)=>{if(k.parentNode!==o)o.replaceChildren(k)};if((s.settings.layout??"form")!=="map"){let k=`/${i}`;a(jl(`section:${i}`,s.entrySchema,M(i)??{},{context:ie(i,t,null),errors:_.get(k)??{},onChange:(y)=>{let f=M(i);if(!f)return;oe(f,y),l(),z(k,l)},rerender:l,...r!==void 0&&{ui:r}}));return}let c=M(i)??{},u=N.get(i)??null,d=u===null?void 0:c[u];if(u===null||!S(d)){o.replaceChildren();return}let m=d,h=`/${i}/${u}`;a(jl(`section:${i}:${u}`,s.entrySchema,m,{context:ie(i,t,u),errors:_.get(h)??{},onChange:(k)=>{oe(m,k),l(),z(h,l)},rerender:l,...r!==void 0&&{ui:r}}))}function de(e){let o=e.actionsHost,{actions:s}=e.opts;if(!o)return;if(!s){o.replaceChildren();return}let t=e.contribution.key,i=(e.contribution.settings.layout??"form")==="map"?N.get(t)??null:null;s(o,{rerender:()=>w(e),sectionKey:t,selected:i})}function Pe(e){let o=(i)=>{e.echo=null,w(e),z(i,()=>w(e))},s=()=>{e.echo=null,w(e)},t=()=>e.contribution.key;return{cancelNew(){F.delete(t()),O.delete(t()),w(e)},cancelRename(i){le(e,i),s()},createNew(){let i=t(),r=U(O.get(i)??""),l=M(i);if(!r||!l||l[r])return;l[r]=Ce(e.contribution.settings.entry?.newEntry,r),N.set(i,r),F.delete(i),O.delete(i),o(`/${i}`)},editNew(i){O.set(t(),i),w(e)},openNew(){F.add(t()),w(e)},removeEntry(){let i=t(),r=N.get(i)??null,l=M(i);if(!r||!l?.[r])return;delete l[r],N.set(i,null),o(`/${i}`)},renameEntry(i){le(e,i);let r=t(),l=N.get(r)??null,a=M(r),c=U(i.trim());if(!l||!a||!c||c===l||a[c]){s();return}let u={};for(let[d,m]of Object.entries(a))u[d===l?c:d]=m,delete a[d];Object.assign(a,u),N.set(r,c),o(`/${r}`)},select(i){N.set(t(),i),e.echo=null,w(e)}}}function Gk(e,o,s={}){let t=se.get(e);if(t)t.contribution=o,t.opts=s;let i=t?.handle??null;if(!t||!i?.attached()){i?.dispose();let r={actionsHost:null,container:e,contribution:o,echo:null,formHost:null,handle:null,opts:s};se.set(e,r),i=ne(e,Pe(r),{actionsSlot:(l)=>{r.actionsHost=l,de(r)},formSlot:(l)=>{r.formHost=l,ce(r)}}),r.handle=i,t=r}i.update(Me(t)),de(t),ce(t)}var pe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsPane",$description:'The Project Settings dialog\'s two columns: the grouped section list and the section body (§17.1). It draws no section: `panels/settings-pane.ts` keeps the registry, decides which section is current, and renders whichever one that is into the one empty `[part="section-host"]` island this document leaves for it (studio-ui-guidelines.md §9.4), because a section renderer may be a lit template or a mounted document and neither can share a container with this one. The list is three vertical `tablist`s, one per group (General, Integrations, Advanced), each named by its group heading: a tablist may own only tabs, so a heading between two runs of rows has to END one list rather than sit inside it. Each group is one tab stop and the arrow keys move within it. Under the groups, a Moved footnote names what left Project Settings for a workspace, each with a button that goes there.',tagName:"div",attributes:{part:"doc"},style:{$description:'No part below is named `body`, `field`, `label`, `error`, `text` or `actions`: this document is mounted inside a `jx-dialog`, the kit is light DOM, and the dialog draws its own `[part="body"]` around this one, so a rule keyed on that name here would also be a rule the dialog\'s own styles reach.',display:"flex",height:"min(68vh, 640px)",minHeight:"0",background:"var(--bg)",color:"var(--fg)",fontFamily:"var(--jx-font-sans)",textAlign:"initial",'& [part="nav"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-4)",width:"200px",minWidth:"200px",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3) var(--jx-space-2) 0",borderRight:"1px solid var(--border)",overflowY:"auto",fontSize:"13px"},'& [part="group"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="group-title"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",margin:"0",padding:"0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",fontWeight:"600",letterSpacing:"0.04em",textTransform:"uppercase"},'& [part="group-note"]':{$description:`The Advanced group's "For developers": a qualifier on the heading, not a second heading, so it reads at the heading's size without its weight.`,fontWeight:"400",letterSpacing:"0",textTransform:"none"},'& [part="group-note"]:empty':{display:"none"},'& [part="group-tabs"]':{$description:"The rule a vertical strip draws on its trailing edge is the column's own here: the nav draws one border for all three groups, so each strip drawing its own would stack three short rules beside it.",borderInlineEnd:"0"},'& [part="nav-item"]':{$description:"Full-bleed rows, which a tab is not by default: `jx-tab` centres its label and caps itself at 220px because a horizontal strip is a row of chips. In the nav column the row IS the target, so the label goes to the leading edge and the cap comes off.",maxWidth:"none",justifyContent:"flex-start",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="moved"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",marginTop:"auto",padding:"var(--jx-space-3)",borderTop:"1px solid var(--border)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)"},'& [part="moved-title"]':{margin:"0",fontWeight:"600",color:"var(--fg)"},'& [part="moved-row"]':{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--jx-space-1)"},'& [part="content"]':{flex:"1",minWidth:"0",overflowY:"auto",padding:"var(--jx-space-2) var(--jx-space-5)"},'& [part="group-intro"]':{margin:"0 0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="group-intro"]:empty':{display:"none"},'& [part="section-host"]':{display:"block",minWidth:"0"},'& [part="empty"]':{$description:"What the body says when the active section is registered by nobody: every section unregistering at once, which is a project closing while the dialog is open. A blank column beside a list reads as a broken dialog, so it says which it is.",display:"flex",alignItems:"center",justifyContent:"center",minHeight:"120px",margin:"0",color:"var(--fg-dim)",fontSize:"13px"},'& [part="failure"]':{$description:"A section whose renderer threw or rejected. It is said where the section would have been, in the reader's line of sight, because a section that silently draws nothing is indistinguishable from one with nothing to say.",margin:"0",padding:"var(--jx-space-3)",border:"1px solid var(--danger)",borderRadius:"var(--radius)",color:"var(--fg)",fontSize:"13px"}},children:[{tagName:"div",attributes:{part:"nav",role:"none"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"group",role:"none","data-group":"${$map.item.id}"},children:[{tagName:"h3",attributes:{part:"group-title",id:"${$map.item.titleId}"},children:[{tagName:"span",textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"group-note"},textContent:"${$map.item.note}"}]},{tagName:"jx-tabs",attributes:{part:"group-tabs",selected:"${state.active}",orientation:"vertical"},$props:{label:{$ref:"$map/item/tabsLabel"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectSection"},value:[{$ref:"event#/detail"}]}]},children:[{$prototype:"Array",items:{$ref:"$map/item/sections"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab",attributes:{part:"nav-item",id:"${$map.item.tabId}","data-section":"${$map.item.key}",value:"${$map.item.key}",label:"${$map.item.label}",panel:"settings-pane-panel"}}}]}]}},{tagName:"div",attributes:{part:"moved",role:"group","aria-labelledby":"settings-pane-moved"},children:[{tagName:"p",attributes:{part:"moved-title",id:"settings-pane-moved"},textContent:"Moved"},{$prototype:"Array",items:{$ref:"#/state/moved"},key:{$ref:"$map/item/workspace"},map:{tagName:"div",attributes:{part:"moved-row","data-moved":"${$map.item.workspace}"},children:[{tagName:"span",textContent:"${$map.item.what} →"},{tagName:"jx-button",attributes:{part:"moved-link"},$props:{size:"sm",quiet:!0,label:{$ref:"$map/item/linkLabel"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMoved"},value:[{$ref:"$map/item/workspace"}]}]},children:[{tagName:"span",textContent:"${$map.item.place}"}]}]}}]}]},{tagName:"jx-tab-panel",attributes:{part:"content",id:"settings-pane-panel"},$props:{active:!0,labelledby:{$ref:"#/state/activeTabId"}},children:[{$description:`The current group's intro ("Changes here affect every page. Most sites never need them."), above whichever of its sections is showing. General has none, and an empty sentence draws nothing.`,tagName:"p",attributes:{part:"group-intro"},textContent:"${state.intro}"},{$description:"The island, and it stays empty: a settings section renders itself, into a host this document never writes into and never reads back (studio-ui-guidelines.md §9.4).",tagName:"div",attributes:{part:"section-host"}},{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/hasSection"},cases:{false:{tagName:"p",attributes:{part:"empty"},textContent:"${state.empty}"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},$switch:{$ref:"#/state/failureState"},cases:{failed:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.failure}"}}}]}]};T("settings-pane",pe);function He(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ue(e){return e===""?"ok":"failed"}function me(e,o,s){let t=g({...o,...s,failureState:ue(o.failure)});e.textContent="",delete e._$litPart$;let i=null,r=!1,l=null,a=R("settings-pane",t,e,{onNodeCreated:(c,u,d)=>{if(!r&&c instanceof HTMLElement&&He(d)==="section-host")l=c}}).then((c)=>{if(r){c.dispose();return}i=c});return{body:()=>l,dispose(){r=!0,i?.dispose(),i=null,l=null},focusActive(){let c=i?.root;if(c instanceof HTMLElement)c.querySelector('[part="nav-item"][aria-selected="true"]')?.focus()},ready:a,update(c){t.groups=c.groups,t.moved=c.moved,t.activeTabId=c.activeTabId,t.empty=c.empty,t.intro=c.intro,t.hasSection=c.hasSection,t.failure=c.failure,t.failureState=ue(c.failure),t.active=c.active}}}var Ie="No settings sections.",fe=[{place:"Styles › Variables",view:"variables",what:"Colors and fonts",workspace:"styles"},{place:"Publish › Hosting",publishTab:"hosting",what:"Hosting and domain",workspace:"publish"},{inspector:"page",place:"Page tab",what:"Head and SEO defaults",workspace:"design"}];function ge(e){return`settings-nav-${e}`}function Oe(e){return fe.find((o)=>o.workspace===e)??null}function G(e){let o=W(),s=Hy();return{active:o,activeTabId:ge(o),empty:Ie,failure:e,groups:s.map((t)=>({id:t.id,label:t.label,note:t.note,sections:t.sections.map((i)=>({key:i.key,label:i.label,tabId:ge(i.key)})),tabsLabel:t.note===""?t.label:`${t.label}, ${t.note.toLowerCase()}`,titleId:`settings-group-${t.id}`})),hasSection:I(o)!==void 0,intro:I(o)?.intro||(s.find((t)=>t.sections.some((i)=>i.key===o))?.intro??""),moved:fe.map((t)=>{let{title:i}=nv(t.workspace),r=t.place??i;return{linkLabel:`${t.what}: ${r}. Go to ${i}`,place:r,what:t.what,workspace:t.workspace}})}}function he(e,o){let s=!1,t=null,i=null,r=null,l="",a=0,c=me(e,G(l),{openMoved:(y)=>{let f=Oe(y);if(f!==null)o.openMoved(f.workspace,f.inspector,f.view,f.publishTab)},selectSection:(y)=>{T_(y)}});function u(y,f,E){if(s||E!==a)return;l=`Could not show ${I(y)?.label??y}: ${f}`,c.update(G(l))}function d(y){if(s)return;let f=W(),E=c.body();if(E!==t)t=E,r=null;if(!E||!y&&r===f){c.update(G(l));return}let q=r!==f;r=f,l="",c.update(G(l));let K=I(f);if(!K){i=null,E.replaceChildren();return}if(q||!i||i.parentElement!==E)i=document.createElement("div"),E.replaceChildren(i);a+=1;let Y=a;try{let D=K.render(i);if(D instanceof Promise)D.catch((ye)=>{u(f,Q(ye),Y)})}catch(D){u(f,Q(D),Y)}}let m=()=>E_(()=>{d(!0)}),h=m(),k=c.ready.then(()=>{d(!0)});return{dispose(){if(s)return;s=!0,h?.(),h=null,c.dispose()},focusActive:()=>{c.focusActive()},ready:k,resume(){if(s||h!==null)return;h=m(),i=null,d(!0)},suspend(){h?.(),h=null}}}var b=null,P=!1;function be(){return P}function De(){let e={dialog:Z({body:(o)=>{e.pane=he(o,{openMoved:(s,t,i,r)=>{Ae(s,t,i,r)}})},closed:()=>{if(b===e)Du()},layer:tt("dialog")}),pane:null};return e}async function Ae(e,o,s,t){if(Du(),s!==void 0){await rt("styles.open",{view:s},"Settings");return}if(t!==void 0){await rt("publish.open",{tab:t},"Settings");return}if(await rt("view.setWorkspace",{workspace:e},"Settings"),o===void 0)return;if(await rt("view.setRightPanel",{open:!0},"Settings"),ae()?.isEnabled("view.setRightTab")===!0)await rt("view.setRightTab",{tab:o},"Settings")}async function zR(){if(P&&b){await b.dialog.ready;return}if(P=!0,b&&!b.dialog.host.isConnected)Re(),P=!0;let e=b;if(e)e.pane?.resume(),await e.dialog.show();else e=De(),b=e,await e.dialog.ready;let o=e.pane;if(o===null||b!==e||!be())return;if(await o.ready,b===e&&be())o.focusActive()}function Du(){if(!P)return;P=!1,b?.pane?.suspend(),b?.dialog.close()}function Re(){P=!1;let e=b;b=null,e?.pane?.dispose(),e?.dialog.dispose()}
2
- export{FR,jR,kd,E_,Ml,HR,Hy,qk,T_,BR,Gk,zR,Du};
1
+ import{Q}from"./studio-nqxqf8p2.js";import{p}from"./studio-pr23qhrw.js";import{g,C}from"./studio-hw60n5dh.js";import{Qb}from"./studio-y1x65h5r.js";import{Mt,Nt,ae}from"./studio-7cg75gtj.js";import{Fl,gp}from"./studio-bf0rgyf7.js";import{qe,ft,T,R,Jt,rt,tt}from"./studio-02phtmqn.js";import{zu}from"./studio-73wz63nn.js";import{FD}from"./studio-74nzv280.js";import{Gl}from"./studio-m4w6sygj.js";import{S}from"./studio-ana67wax.js";import{n,te,_,v}from"./studio-kt2j51sa.js";var B=[{id:"general",intro:"",label:"General",note:""},{id:"integrations",intro:"Turn on what your site needs. Each one adds its own options where you use it.",label:"Integrations",note:""},{id:"advanced",intro:"Changes here affect every page. Most sites never need them.",label:"Advanced",note:"For developers"}],NR="integrations";function AR(e){return B.some((o)=>o.id===e)}var ve="overview",E=new Map,G=new Set;function D(){for(let e of G)e()}function Sd(){D()}function S_(e){return G.add(e),()=>{G.delete(e)}}function Ol(e){E.set(e.key,e),D()}function OR(e){if(E.delete(e))D()}function we(){return[...E.values()].toSorted((e,o)=>e.order-o.order)}function Py(){let e=we();return B.flatMap((o)=>{let s=e.filter((t)=>(t.group??"integrations")===o.id);return s.length===0?[]:[{id:o.id,intro:o.intro,label:o.label,note:o.note,sections:s}]})}function Hk(){return Py().flatMap((e)=>e.sections.map((o)=>o.key))}function H(e){return E.get(e)}var L=null,P=ve;function V(){if(L!==null&&E.has(L))return P=L,L=null,P;if(E.has(P))return P;return Hk()[0]??P}function C_(e){if(E.has(e))P=e,L=null;else L=e;D()}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsDialog",$description:"Project Settings (§17.1): a `jx-dialog` whose body is the settings editor's two columns, the grouped section list and the section body. The dialog owns modality, Escape and focus restoration, and its one footer answer is Close: every section writes as it is edited, so there is nothing to confirm or cancel. The body is an ISLAND: this document draws the slot and nothing in it, and `settings/settings-dialog.ts` mounts `settings-pane.json` there through `onNodeCreated` (studio-ui-guidelines.md §9.4).",tagName:"jx-dialog",$props:{headline:"Project settings",confirmLabel:"",cancelLabel:"Close",size:"xl"},attributes:{part:"settings"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},children:[{tagName:"div",attributes:{part:"pane-slot"},style:{$description:"The editor's box is its own (`settings-pane.json`); the slot only gives it the dialog body's width.",minWidth:"0"}}]};T("settings-dialog",X);var W=ft("dialog","settings");function xe(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function Z(e){let o=document.createElement("div");o.style.pointerEvents="auto",e.layer.append(o);let s=!0,t=!1,i=()=>{if(!s)return;s=!1,e.closed()},r=g({closed:i}),l=null,a=(d)=>{if(!t&&s)Mt(d);return d},c=R("settings-dialog",r,o,{onNodeCreated:(d,m,h)=>{if(!t&&d instanceof HTMLElement&&xe(h)==="pane-slot")e.body(d)}}).then(async(d)=>{let m=d.root;if(t)return d.dispose(),m;return l=d,await Jt(m),(m.querySelector('dialog[part="dialog"]')??m).setAttribute(qe,W),a(m)}),u=()=>{let d=l?.root;if(d instanceof HTMLElement)Nt(d);i()};return{close:u,dispose(){if(t)return;u(),t=!0,l?.dispose(),l=null,o.remove()},host:o,ready:c,show(){if(!t)s=!0;return c.then(a)}}}var ee={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"${state.newLabel}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"${state.newLabel}"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"${state.newFieldLabel}",placeholder:"${state.newPlaceholder}",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyText}"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};T("settings-contributed",ee);function Te(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:"",emptyText:"",newFieldLabel:"",newLabel:"",newPlaceholder:""}}function Ne(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ne(e,o,s){e.textContent="";let t=g({...Te(),...o}),i=null,r=!1,l=R("settings-contributed",t,e,{onNodeCreated:(a,c,u)=>{if(!(a instanceof HTMLElement))return;let d=Ne(u);if(d==="form-host")s.formSlot(a);else if(d==="actions")s.actionsSlot(a)}}).then((a)=>{let c=a.root;if(r)return a.dispose(),c;return i=a,c});return{attached:()=>{if(r)return!1;let a=i?.root;return a===void 0?!0:a instanceof HTMLElement&&e.contains(a)},dispose(){r=!0,i?.dispose(),i=null},host:e,ready:l,update(a){t.actionsState=a.actionsState,t.editorRegion=a.editorRegion,t.editorState=a.editorState,t.entries=a.entries,t.entryName=a.entryName,t.layout=a.layout,t.newName=a.newName,t.newState=a.newState,t.title=a.title,t.emptyText=a.emptyText,t.newFieldLabel=a.newFieldLabel,t.newLabel=a.newLabel,t.newPlaceholder=a.newPlaceholder}}}var x=new Map,A=new Set,I=new Map;function MR(e,o){let s=S?.projectConfig?.[e],t=v(s)?s:{};if(!Object.hasOwn(t,o))return Object.keys(t);return x.set(e,o),null}var J=new Map;function ke(e,o){let s={},t=[];for(let i of o){let r=i.indexOf(": "),l=r===-1?"":i.slice(0,r),a=r===-1?i:i.slice(r+2);if(l===e){t.push(a);continue}if(!l.startsWith(`${e}/`))continue;let[c]=l.slice(e.length+1).split("/");if(c&&s[c]===void 0)s[c]=a}return{fields:s,section:t}}async function z(e,o){let s=S?.projectConfig;if(!s)return;if(!(await Gl()).ok)return;let i=[];try{i=await zu(s)}catch(r){C.warn(`Could not validate project.json — ${Q(r)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}J.set(e,ke(e,i).fields),o()}function oe(e,o){for(let[s,t]of Object.entries(o))if(t===void 0)delete e[s];else e[s]=t}function U(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function Ce(e,o){if(!e)return{};let s=(i)=>{let r={};for(let[l,a]of Object.entries(i))r[l]=t(a);return r},t=(i)=>{if(n(i))return i.replaceAll("${key}",o);if(Array.isArray(i))return i.map((r)=>t(r));if(v(i))return s(i);return i};return s(e)}function ie(e,o,s=null){let t=p(),i={fieldKeyPrefix:`$settings.${e}`,resolvePointer:(r,l)=>{let a={projectConfig:S?.projectConfig??{}};if(v(l))a.scope=l;if(o.formats!==void 0)a.formats=o.formats;return gp(r,a)}};if(te(t.setSecrets))i.commitSecret=async(r,l)=>{let a=FD(e,s,r);return await t.setSecrets({set:{[a]:l}}),a};return i}function j(e){let o=S?.projectConfig;if(!o)return null;let s=o[e];if(v(s))return s;let t={};return o[e]=t,t}function re(e){return`${W}/${e}`}var se=new WeakMap;function w(e){Bk(e.container,e.contribution,e.opts)}function le(e,o){e.echo=o,w(e)}var Ee="entry";function je(e){let o=e?.trim().toLowerCase()||Ee,s=`${o.charAt(0).toUpperCase()}${o.slice(1)}`;return{emptyText:`Select ${/^[aeiou]/u.test(o)?"an":"a"} ${o} or create one`,newFieldLabel:`${s} name`,newLabel:`New ${o}`,newPlaceholder:`${U(o)}-name`}}function Me(e){let{contribution:o,opts:s}=e,t=o.key,i=o.title??t,r=s.actions?"slot":"none",l=re("editor"),a=je(o.settings.entry?.noun);if((o.settings.layout??"form")!=="map")return{actionsState:r,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:i,...a};let c=j(t)??{},u=x.get(t)??null,d=u===null?void 0:c[u],m=u!==null&&_(d);return{actionsState:r,editorRegion:l,editorState:m?"editing":"empty",entries:Object.keys(c).map((h)=>({key:h,region:re(`entry:${h}`),selected:h===u})),entryName:e.echo??(m?u:""),layout:"map",newName:I.get(t)??"",newState:A.has(t)?"open":"closed",title:i,...a}}function ce(e){let o=e.formHost;if(!o)return;let{contribution:s,opts:t}=e,i=s.key,r=s.settings.entry?.ui,l=()=>w(e),a=(N)=>{if(N.parentNode!==o)o.replaceChildren(N)};if((s.settings.layout??"form")!=="map"){let N=`/${i}`;a(Fl(`section:${i}`,s.entrySchema,j(i)??{},{context:ie(i,t,null),errors:J.get(N)??{},onChange:(y)=>{let f=j(i);if(!f)return;oe(f,y),l(),z(N,l)},rerender:l,...r!==void 0&&{ui:r}}));return}let c=j(i)??{},u=x.get(i)??null,d=u===null?void 0:c[u];if(u===null||!_(d)){o.replaceChildren();return}let m=d,h=`/${i}/${u}`;a(Fl(`section:${i}:${u}`,s.entrySchema,m,{context:ie(i,t,u),errors:J.get(h)??{},onChange:(N)=>{oe(m,N),l(),z(h,l)},rerender:l,...r!==void 0&&{ui:r}}))}function de(e){let o=e.actionsHost,{actions:s}=e.opts;if(!o)return;if(!s){o.replaceChildren();return}let t=e.contribution.key,i=(e.contribution.settings.layout??"form")==="map"?x.get(t)??null:null;s(o,{rerender:()=>w(e),sectionKey:t,selected:i})}function Pe(e){let o=(i)=>{e.echo=null,w(e),z(i,()=>w(e))},s=()=>{e.echo=null,w(e)},t=()=>e.contribution.key;return{cancelNew(){A.delete(t()),I.delete(t()),w(e)},cancelRename(i){le(e,i),s()},createNew(){let i=t(),r=U(I.get(i)??""),l=j(i);if(!r||!l||l[r])return;l[r]=Ce(e.contribution.settings.entry?.newEntry,r),x.set(i,r),A.delete(i),I.delete(i),o(`/${i}`)},editNew(i){I.set(t(),i),w(e)},openNew(){A.add(t()),w(e)},removeEntry(){let i=t(),r=x.get(i)??null,l=j(i);if(!r||!l?.[r])return;delete l[r],x.set(i,null),o(`/${i}`)},renameEntry(i){le(e,i);let r=t(),l=x.get(r)??null,a=j(r),c=U(i.trim());if(!l||!a||!c||c===l||a[c]){s();return}let u={};for(let[d,m]of Object.entries(a))u[d===l?c:d]=m,delete a[d];Object.assign(a,u),x.set(r,c),o(`/${r}`)},select(i){x.set(t(),i),e.echo=null,w(e)}}}function Bk(e,o,s={}){let t=se.get(e);if(t)t.contribution=o,t.opts=s;let i=t?.handle??null;if(!t||!i?.attached()){i?.dispose();let r={actionsHost:null,container:e,contribution:o,echo:null,formHost:null,handle:null,opts:s};se.set(e,r),i=ne(e,Pe(r),{actionsSlot:(l)=>{r.actionsHost=l,de(r)},formSlot:(l)=>{r.formHost=l,ce(r)}}),r.handle=i,t=r}i.update(Me(t)),de(t),ce(t)}var pe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsPane",$description:'The Project Settings dialog\'s two columns: the grouped section list and the section body (§17.1). It draws no section: `panels/settings-pane.ts` keeps the registry, decides which section is current, and renders whichever one that is into the one empty `[part="section-host"]` island this document leaves for it (studio-ui-guidelines.md §9.4), because a section renderer may be a lit template or a mounted document and neither can share a container with this one. The list is three vertical `tablist`s, one per group (General, Integrations, Advanced), each named by its group heading: a tablist may own only tabs, so a heading between two runs of rows has to END one list rather than sit inside it. Each group is one tab stop and the arrow keys move within it. Under the groups, a Moved footnote names what left Project Settings for a workspace, each with a button that goes there.',tagName:"div",attributes:{part:"doc"},style:{$description:'No part below is named `body`, `field`, `label`, `error`, `text` or `actions`: this document is mounted inside a `jx-dialog`, the kit is light DOM, and the dialog draws its own `[part="body"]` around this one, so a rule keyed on that name here would also be a rule the dialog\'s own styles reach.',display:"flex",height:"min(68vh, 640px)",minHeight:"0",background:"var(--bg)",color:"var(--fg)",fontFamily:"var(--jx-font-sans)",textAlign:"initial",'& [part="nav"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-4)",width:"200px",minWidth:"200px",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3) var(--jx-space-2) 0",borderRight:"1px solid var(--border)",overflowY:"auto",fontSize:"13px"},'& [part="group"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="group-title"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",margin:"0",padding:"0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",fontWeight:"600",letterSpacing:"0.04em",textTransform:"uppercase"},'& [part="group-note"]':{$description:`The Advanced group's "For developers": a qualifier on the heading, not a second heading, so it reads at the heading's size without its weight.`,fontWeight:"400",letterSpacing:"0",textTransform:"none"},'& [part="group-note"]:empty':{display:"none"},'& [part="group-tabs"]':{$description:"The rule a vertical strip draws on its trailing edge is the column's own here: the nav draws one border for all three groups, so each strip drawing its own would stack three short rules beside it.",borderInlineEnd:"0"},'& [part="nav-item"]':{$description:"Full-bleed rows, which a tab is not by default: `jx-tab` centres its label and caps itself at 220px because a horizontal strip is a row of chips. In the nav column the row IS the target, so the label goes to the leading edge and the cap comes off.",maxWidth:"none",justifyContent:"flex-start",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="moved"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",marginTop:"auto",padding:"var(--jx-space-3)",borderTop:"1px solid var(--border)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)"},'& [part="moved-title"]':{margin:"0",fontWeight:"600",color:"var(--fg)"},'& [part="moved-row"]':{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--jx-space-1)"},'& [part="content"]':{flex:"1",minWidth:"0",overflowY:"auto",padding:"var(--jx-space-2) var(--jx-space-5)"},'& [part="group-intro"]':{margin:"0 0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="group-intro"]:empty':{display:"none"},'& [part="section-host"]':{display:"block",minWidth:"0"},'& [part="empty"]':{$description:"What the body says when the active section is registered by nobody: every section unregistering at once, which is a project closing while the dialog is open. A blank column beside a list reads as a broken dialog, so it says which it is.",display:"flex",alignItems:"center",justifyContent:"center",minHeight:"120px",margin:"0",color:"var(--fg-dim)",fontSize:"13px"},'& [part="failure"]':{$description:"A section whose renderer threw or rejected. It is said where the section would have been, in the reader's line of sight, because a section that silently draws nothing is indistinguishable from one with nothing to say.",margin:"0",padding:"var(--jx-space-3)",border:"1px solid var(--danger)",borderRadius:"var(--radius)",color:"var(--fg)",fontSize:"13px"}},children:[{tagName:"div",attributes:{part:"nav",role:"none"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"group",role:"none","data-group":"${$map.item.id}"},children:[{tagName:"h3",attributes:{part:"group-title",id:"${$map.item.titleId}"},children:[{tagName:"span",textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"group-note"},textContent:"${$map.item.note}"}]},{tagName:"jx-tabs",attributes:{part:"group-tabs",selected:"${state.active}",orientation:"vertical"},$props:{label:{$ref:"$map/item/tabsLabel"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectSection"},value:[{$ref:"event#/detail"}]}]},children:[{$prototype:"Array",items:{$ref:"$map/item/sections"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab",attributes:{part:"nav-item",id:"${$map.item.tabId}","data-section":"${$map.item.key}",value:"${$map.item.key}",label:"${$map.item.label}",panel:"settings-pane-panel"}}}]}]}},{tagName:"div",attributes:{part:"moved",role:"group","aria-labelledby":"settings-pane-moved"},children:[{tagName:"p",attributes:{part:"moved-title",id:"settings-pane-moved"},textContent:"Moved"},{$prototype:"Array",items:{$ref:"#/state/moved"},key:{$ref:"$map/item/workspace"},map:{tagName:"div",attributes:{part:"moved-row","data-moved":"${$map.item.workspace}"},children:[{tagName:"span",textContent:"${$map.item.what} →"},{tagName:"jx-button",attributes:{part:"moved-link"},$props:{size:"sm",quiet:!0,label:{$ref:"$map/item/linkLabel"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMoved"},value:[{$ref:"$map/item/workspace"}]}]},children:[{tagName:"span",textContent:"${$map.item.place}"}]}]}}]}]},{tagName:"jx-tab-panel",attributes:{part:"content",id:"settings-pane-panel"},$props:{active:!0,labelledby:{$ref:"#/state/activeTabId"}},children:[{$description:`The current group's intro ("Changes here affect every page. Most sites never need them."), above whichever of its sections is showing. General has none, and an empty sentence draws nothing.`,tagName:"p",attributes:{part:"group-intro"},textContent:"${state.intro}"},{$description:"The island, and it stays empty: a settings section renders itself, into a host this document never writes into and never reads back (studio-ui-guidelines.md §9.4).",tagName:"div",attributes:{part:"section-host"}},{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/hasSection"},cases:{false:{tagName:"p",attributes:{part:"empty"},textContent:"${state.empty}"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},$switch:{$ref:"#/state/failureState"},cases:{failed:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.failure}"}}}]}]};T("settings-pane",pe);function He(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ue(e){return e===""?"ok":"failed"}function me(e,o,s){let t=g({...o,...s,failureState:ue(o.failure)});e.textContent="",delete e._$litPart$;let i=null,r=!1,l=null,a=R("settings-pane",t,e,{onNodeCreated:(c,u,d)=>{if(!r&&c instanceof HTMLElement&&He(d)==="section-host")l=c}}).then((c)=>{if(r){c.dispose();return}i=c});return{body:()=>l,dispose(){r=!0,i?.dispose(),i=null,l=null},focusActive(){let c=i?.root;if(c instanceof HTMLElement)c.querySelector('[part="nav-item"][aria-selected="true"]')?.focus()},ready:a,update(c){t.groups=c.groups,t.moved=c.moved,t.activeTabId=c.activeTabId,t.empty=c.empty,t.intro=c.intro,t.hasSection=c.hasSection,t.failure=c.failure,t.failureState=ue(c.failure),t.active=c.active}}}var Ie="No settings sections.",fe=[{place:"Styles › Variables",view:"variables",what:"Colors and fonts",workspace:"styles"},{place:"Publish › Hosting",publishTab:"hosting",what:"Hosting and domain",workspace:"publish"},{inspector:"page",place:"Page tab",what:"Head and SEO defaults",workspace:"design"}];function ge(e){return`settings-nav-${e}`}function Oe(e){return fe.find((o)=>o.workspace===e)??null}function F(e){let o=V(),s=Py();return{active:o,activeTabId:ge(o),empty:Ie,failure:e,groups:s.map((t)=>({id:t.id,label:t.label,note:t.note,sections:t.sections.map((i)=>({key:i.key,label:i.label,tabId:ge(i.key)})),tabsLabel:t.note===""?t.label:`${t.label}, ${t.note.toLowerCase()}`,titleId:`settings-group-${t.id}`})),hasSection:H(o)!==void 0,intro:H(o)?.intro||(s.find((t)=>t.sections.some((i)=>i.key===o))?.intro??""),moved:fe.map((t)=>{let{title:i}=Qb(t.workspace),r=t.place??i;return{linkLabel:`${t.what}: ${r}. Go to ${i}`,place:r,what:t.what,workspace:t.workspace}})}}function he(e,o){let s=!1,t=null,i=null,r=null,l="",a=0,c=me(e,F(l),{openMoved:(y)=>{let f=Oe(y);if(f!==null)o.openMoved(f.workspace,f.inspector,f.view,f.publishTab)},selectSection:(y)=>{C_(y)}});function u(y,f,k){if(s||k!==a)return;l=`Could not show ${H(y)?.label??y}: ${f}`,c.update(F(l))}function d(y){if(s)return;let f=V(),k=c.body();if(k!==t)t=k,r=null;if(!k||!y&&r===f){c.update(F(l));return}let q=r!==f;r=f,l="",c.update(F(l));let K=H(f);if(!K){i=null,k.replaceChildren();return}if(q||!i||i.parentElement!==k)i=document.createElement("div"),k.replaceChildren(i);a+=1;let Y=a;try{let O=K.render(i);if(O instanceof Promise)O.catch((ye)=>{u(f,Q(ye),Y)})}catch(O){u(f,Q(O),Y)}}let m=()=>S_(()=>{d(!0)}),h=m(),N=c.ready.then(()=>{d(!0)});return{dispose(){if(s)return;s=!0,h?.(),h=null,c.dispose()},focusActive:()=>{c.focusActive()},ready:N,resume(){if(s||h!==null)return;h=m(),i=null,d(!0)},suspend(){h?.(),h=null}}}var b=null,M=!1;function be(){return M}function De(){let e={dialog:Z({body:(o)=>{e.pane=he(o,{openMoved:(s,t,i,r)=>{Ae(s,t,i,r)}})},closed:()=>{if(b===e)Ru()},layer:tt("dialog")}),pane:null};return e}async function Ae(e,o,s,t){if(Ru(),s!==void 0){await rt("styles.open",{view:s},"Settings");return}if(t!==void 0){await rt("publish.open",{tab:t},"Settings");return}if(await rt("view.setWorkspace",{workspace:e},"Settings"),o===void 0)return;if(await rt("view.setRightPanel",{open:!0},"Settings"),ae()?.isEnabled("view.setRightTab")===!0)await rt("view.setRightTab",{tab:o},"Settings")}async function PR(){if(M&&b){await b.dialog.ready;return}if(M=!0,b&&!b.dialog.host.isConnected)Re(),M=!0;let e=b;if(e)e.pane?.resume(),await e.dialog.show();else e=De(),b=e,await e.dialog.ready;let o=e.pane;if(o===null||b!==e||!be())return;if(await o.ready,b===e&&be())o.focusActive()}function Ru(){if(!M)return;M=!1,b?.pane?.suspend(),b?.dialog.close()}function Re(){M=!1;let e=b;b=null,e?.pane?.dispose(),e?.dialog.dispose()}
2
+ export{NR,AR,Sd,S_,Ol,OR,Py,Hk,C_,MR,Bk,PR,Ru};
3
3
 
4
- //# debugId=2CA7708F02B2090764756E2164756E21
5
- //# sourceMappingURL=studio-3q40e3rj.js.map
4
+ //# debugId=BDE3A51A04703E2464756E2164756E21
5
+ //# sourceMappingURL=studio-1meqbxns.js.map
@@ -1,5 +1,5 @@
1
- import{p,_e}from"./studio-w4rz9hdk.js";import{Q}from"./studio-nqxqf8p2.js";import{ar,I$}from"./studio-fyh0jc96.js";import{ge,ta,ne,g,he,C,ul,ef}from"./studio-43sd2mam.js";import{uO,Y,av,Gd,Tr,Nx,Ax,Ra,hv,H$,m,u,_i}from"./studio-c05wdnt3.js";import{Ot,tu,Wi,nf,cn,ur,sI,Oa,aI}from"./studio-z97c48fk.js";import{jd}from"./studio-3exxhz5g.js";import{T$,JA,YA,hh,Jb}from"./studio-q7rtx6zq.js";import{Ko}from"./studio-x9hsze61.js";import{yN,gL}from"./studio-rj9eamf8.js";import{Vd}from"./studio-r5qy30vx.js";import{Es,ko}from"./studio-d5grtb9e.js";import{tl,Ju}from"./studio-y0n7yxea.js";import{rN}from"./studio-3qeh9t0h.js";import{oe}from"./studio-p4nrkvqr.js";import{n,Z,Xe,S,v}from"./studio-vxq7fcvv.js";function ie(e,o=[]){if(e?.tagName==="slot"){let s=e.attributes?.name;o.push(n(s)?s.trim():"")}if(Array.isArray(e?.children))for(let s of e.children)ie(n(s)?void 0:s,o);return o}function xS(e){let o=ie(e),s=o.filter((r)=>r==="").length;if(s>1)return`Component has ${s} unnamed <slot> elements — only one default slot is allowed. Give extra slots a name attribute.`;let l=new Set;for(let r of o){if(r&&l.has(r))return`Duplicate slot name "${r}" — slot names must be unique within a component.`;l.add(r)}return null}var se={invokerTags:Jb,popoverTags:hh},N="Popover",ke={display:"document.repairPopoverDisplay","open-display":"document.repairPopoverDisplay",invoker:"document.repairPopoverInvoker",mode:"document.repairPopoverMode"};function ae(e,o,s,l){let r=`${o}.${s}.${l.join("/")}`,d=e.get(r)??0;return e.set(r,d+1),d===0?r:`${r}#${d}`}function W(e,o){ul((d)=>d.source===N);let s=new Map,l=JA(e,se);for(let d of l){let c=d.fix===void 0?void 0:ke[d.fix],b={detail:d.detail,key:ae(s,"popover",d.rule,d.path),source:N,tier:"problem"};if(c!==void 0)b.action=c,b.actionArgs={path:d.path};if(o!==void 0)b.path=o;C(d.severity,d.message,b)}let r=yN(e,se);for(let d of r){let c={detail:d.detail,key:ae(s,"dialog",d.rule,d.path),source:N,tier:"problem"};if(o!==void 0)c.path=o;C(d.severity,d.message,c)}return l.length+r.length}function z(e,o){let s=o?.path;if(!Array.isArray(s))throw RangeError(`command "${e}" needs a "path" argument naming the popover`);return s}function J(e){let o=u.value;if(!o)throw RangeError(`command "${e}" needs an open document`);return o}function Se(){return[{category:"Document",group:"2_document",id:"document.checkPopovers",level:"document",menus:["palette"],requires:"an open document",run:()=>{let e=J("document.checkPopovers"),o=W(e.doc.document,e.documentPath??void 0);C.success(o===0?"No popover problems found in this document.":`${o} popover problem(s) filed.`,{key:"popover.run",source:N})},title:"Check Popovers",when:(e)=>e.document.open,aiTool:{description:"Check the open document for popover defects an author can fix — a base-rule `display` "+"that defeats the browser's own hiding of a closed popover, `popovertarget` on an "+"element that cannot invoke, a target naming no popover, a cut exit animation — and "+"file each as a Problem. The findings come back as data.",name:"check_popovers",report:()=>{let e=ef(N),o=e.length;return{data:e,summary:o===0?"No popover problems found in this document.":`Filed ${o} popover problem${o===1?"":"s"} in Problems.`}}}},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverDisplay",level:"document",menus:[],requires:"a popover whose base rule sets display",run:(e,o)=>{let l=J("document.repairPopoverDisplay"),r=z("document.repairPopoverDisplay",o),d=oe(l.doc.document,r),c=YA(d?.style);if(!c)throw RangeError(`command "${"document.repairPopoverDisplay"}": nothing to move — this popover sets no display`);Y(l,(b)=>{for(let w of c.base)Gd(b,r,w,"");for(let w of c.breakpoints)Ax(b,r,[w],"display","");if(c.openDisplay!==null)Nx(b,r,":popover-open","display",c.openDisplay)}),C.success("Moved `display` into `:popover-open`.",{key:"popover.repaired.display",source:N})},title:"Move display into :popover-open",when:(e)=>e.document.open},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverInvoker",level:"document",menus:[],requires:"an element carrying popovertarget that cannot invoke",run:(e,o)=>{let l=J("document.repairPopoverInvoker"),r=z("document.repairPopoverInvoker",o);Y(l,(d)=>{Tr(d,r,"popovertarget"),Tr(d,r,"popovertargetaction")}),C.success("Removed the attributes, which did nothing on this element.",{key:"popover.repaired.invoker",source:N})},title:"Remove the inert popover attributes",when:(e)=>e.document.open},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverMode",level:"document",menus:[],requires:"a popover whose mode is not one of the three keywords",run:(e,o)=>{let l=J("document.repairPopoverMode"),r=z("document.repairPopoverMode",o);Y(l,(d)=>{Tr(d,r,"popover",T$)}),C.success(`Set \`popover\` to "${T$}".`,{key:"popover.repaired.mode",source:N})},title:"Set popover to auto",when:(e)=>e.document.open}]}function eN(e){e.registerAll(Se())}function $w(e,o){if(e===o)return!0;if(Array.isArray(e)&&Array.isArray(o))return e.length===o.length&&e.every((s,l)=>s===o[l]);if(S(e)&&S(o)&&!Array.isArray(e)&&!Array.isArray(o))return e.$ref===o.$ref;return!1}var A="grid://",bb={children:[],tagName:"div"};function cs(e){switch(e.kind){case"pages":return`${A}pages`;case"collection":return`${A}collection/${encodeURIComponent(e.name)}`;default:return`${A}data/${encodeURIComponent(e.connection)}/${encodeURIComponent(e.table)}`}}function xe(e){return e.startsWith(A)}function zl(e){if(!xe(e))return null;let o=e.slice(A.length).split("/");if(o[0]==="pages"&&o.length===1)return{kind:"pages"};if(o[0]==="collection"&&o.length===2&&o[1])return{kind:"collection",name:decodeURIComponent(o[1])};if(o[0]==="data"&&o.length===3&&o[1]&&o[2])return{connection:decodeURIComponent(o[1]),kind:"data",table:decodeURIComponent(o[2])};return null}function fm(e){let o=zl(e);if(!o)return null;switch(o.kind){case"pages":return"Pages · grid";case"collection":return`${o.name} · grid`;default:return`${o.table} @ ${o.connection} · grid`}}var le=0;function ce(e){let o=e.coalesceMs??800,s=e.now??(()=>Date.now()),r=g({deletes:new Set,errors:new Map,inserts:new Map,pending:new Map,redoStack:[],stale:new Set,undoStack:[]}),d=null,c=(t,i,a)=>{let f=r.errors.get(t);if(f)f.set(i,a);else r.errors.set(t,new Map([[i,a]]))},b=(t,i)=>{let a=r.errors.get(t);if(a?.delete(i),a?.size===0)r.errors.delete(t)},w=(t)=>{if(r.redoStack.length=0,d){d.push(t);return}let i=r.undoStack.at(-1);if(t.kind==="cell"&&i?.kind==="cell"&&i.rowKey===t.rowKey&&i.field===t.field&&t.at-i.at<=o){i.after=t.after,i.at=t.at;return}r.undoStack.push(t)},k=(t,i,a)=>{let f=r.inserts.get(t);if(f){if(a===null)delete f[i];else f[i]=a;return}if($w(a,e.resolveBaseline(t,i))){let y=r.pending.get(t);if(y?.delete(i),y?.size===0)r.pending.delete(t);return}let h=r.pending.get(t);if(h)h.set(i,{value:a});else r.pending.set(t,new Map([[i,{value:a}]]))},G=(t,i)=>{let a=r.inserts.get(t);if(a)return a[i]??null;let f=r.pending.get(t)?.get(i);return f?f.value:e.resolveBaseline(t,i)},M=(t,i)=>{let a=r.errors.get(t);return a?.get(i)??a?.get("*")??null},F=(t,i)=>{switch(t.kind){case"cell":{k(t.rowKey,t.field,i==="undo"?t.before:t.after);break}case"insert":{if(i==="undo")r.inserts.delete(t.tempKey);else r.inserts.set(t.tempKey,{...t.cells});break}case"drop-insert":{if(i==="undo")r.inserts.set(t.tempKey,{...t.cells});else r.inserts.delete(t.tempKey);break}case"delete":{if(i==="undo")r.deletes.delete(t.rowKey);else r.deletes.add(t.rowKey);break}default:{let a=i==="undo"?t.ops.toReversed():t.ops;for(let f of a)F(f,i);break}}},D=()=>{if(d)throw Error("edit-buffer: groups may not nest");d=[]},P=()=>{let t=d;if(d=null,!t)return;if(t.length===1)r.undoStack.push(t[0]);else if(t.length>1)r.undoStack.push({kind:"group",ops:t})},T=(t)=>{let i=(a)=>{switch(a.kind){case"cell":return t(a.rowKey)?null:a;case"insert":case"drop-insert":return t(a.tempKey)?null:a;case"delete":return t(a.rowKey)?null:a;default:{let f=a.ops.map((h)=>i(h)).filter((h)=>h!==null);return f.length>0?{kind:"group",ops:f}:null}}};r.undoStack=r.undoStack.map(i).filter((a)=>a!==null),r.redoStack=r.redoStack.map(i).filter((a)=>a!==null)};return{applyCommitResult(t){let i=new Set;for(let a of t.cells)if(a.ok){let f=r.pending.get(a.rowKey);if(f?.delete(a.field),f?.size===0)r.pending.delete(a.rowKey);b(a.rowKey,a.field)}else if(c(a.rowKey,a.field,a.error??"Save failed"),a.stale)r.stale.add(a.rowKey);for(let a of t.inserts)if(a.ok)r.inserts.delete(a.tempKey),r.errors.delete(a.tempKey),i.add(a.tempKey);else c(a.tempKey,"*",a.error??"Insert failed");for(let a of t.deletes)if(a.ok)r.deletes.delete(a.rowKey),r.pending.delete(a.rowKey),r.errors.delete(a.rowKey),i.add(a.rowKey);else if(c(a.rowKey,"*",a.error??"Delete failed"),a.stale)r.stale.add(a.rowKey);for(let a of i)r.stale.delete(a);if(i.size>0)T((a)=>i.has(a))},buildBatch(){let t=[];for(let[i,a]of r.pending){if(r.deletes.has(i))continue;for(let[f,h]of a)t.push({baseline:e.resolveBaseline(i,f),field:f,rowKey:i,value:h.value})}return{cells:t,deletes:[...r.deletes].map((i)=>({rowKey:i})),inserts:[...r.inserts].map(([i,a])=>({cells:{...a},tempKey:i}))}},canRedo:()=>r.redoStack.length>0,canUndo:()=>r.undoStack.length>0,cellError:M,cellState(t,i){if(M(t,i)!==null)return"error";if(r.stale.has(t))return"stale";if(r.inserts.has(t)||r.pending.get(t)?.has(i))return"dirty";return"clean"},deleteRow(t){if(r.deletes.has(t))return;let i=r.inserts.get(t);if(i){let a={...i};r.inserts.delete(t),r.errors.delete(t),r.stale.delete(t),w({cells:a,kind:"drop-insert",tempKey:t});return}r.deletes.add(t),w({kind:"delete",rowKey:t})},dirtyCount(){let t=r.inserts.size+r.deletes.size;for(let[i,a]of r.pending)if(!r.deletes.has(i))t+=a.size;return t},discardRow(t){r.pending.delete(t),r.deletes.delete(t),r.inserts.delete(t),r.errors.delete(t),r.stale.delete(t),T((i)=>i===t)},effectiveValue:G,beginGroup:D,endGroup:P,group(t){D();try{t()}finally{P()}},insertRow(t={}){le+=1;let i=`__new-${le}`;return r.inserts.set(i,{...t}),w({cells:{...t},kind:"insert",tempKey:i}),i},isDirty:()=>r.pending.size>0||r.inserts.size>0||r.deletes.size>0,isInsertKey:(t)=>r.inserts.has(t),markStale(t){for(let i of t)r.stale.add(i)},redo(){let t=r.redoStack.pop();if(!t)return!1;return F(t,"redo"),r.undoStack.push(t),!0},reset(){r.pending.clear(),r.inserts.clear(),r.deletes.clear(),r.errors.clear(),r.stale.clear(),r.undoStack.length=0,r.redoStack.length=0},rowState(t){if(r.deletes.has(t))return"pending-delete";if(r.inserts.has(t))return"pending-insert";if(r.stale.has(t))return"stale";if(r.pending.has(t)||r.errors.has(t))return"dirty";return"clean"},setCell(t,i,a){let f=G(t,i);if($w(f,a))return;k(t,i,a),w({after:a,at:s(),before:f,field:i,kind:"cell",rowKey:t})},state:r,undo(){let t=r.undoStack.pop();if(!t)return!1;return F(t,"undo"),r.redoStack.push(t),!0}}}var de={array:220,boolean:70,date:130,enum:140,image:180,number:110,readonly:200,reference:200,string:180,text:340};function ue(e){return Math.min(340,Math.max(90,Math.round(e*7.5)))}function Pe(e){if(e.$ref)return"reference";if(e.enum!==void 0&&Array.isArray(e.enum))return"enum";let o=e.type==="array"?void 0:e.format;if(Ra(o))return"image";if(o==="date"||o==="date-time")return"date";switch(e.type){case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return"array";case"object":return"readonly";default:return(e.maxLength??0)>200||e.format==="markdown"?"text":"string"}}function fe(e){let o=e.replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replaceAll(/[_-]+/g," ").trim();return o.charAt(0).toUpperCase()+o.slice(1)}function Iw(e,o={}){let s=Object.entries(e?.properties??{}),l=new Set(e?.required),r=new Set(o.readonlyFields),d=s.map(([c,b])=>{let w=r.has(c)?"readonly":Pe(b),k=Array.isArray(b.enum)?Math.max(...b.enum.map((G)=>String(G).length),4):0;return{editable:w!=="readonly",field:c,kind:w,pk:c===o.idField,required:l.has(c),schema:b,title:fe(c),widthHint:w==="enum"?ue(k+3):de[w]}});return d.sort((c,b)=>{let w=(G)=>G.pk?0:G.required?1:2,k=w(c)-w(b);return k===0?0:k}),d}function Rw(e,o=50){let s=e.slice(0,o),l=[];for(let r of s)for(let d of Object.keys(r))if(!l.includes(d))l.push(d);return l.map((r)=>{let d=s.flatMap((w)=>{let k=w[r];return k===null||k===void 0||k===""?[]:[k]}),c=Ge(d),b=Math.max(...d.map((w)=>nr(w).length),r.length,4);return{editable:!0,field:r,kind:c,title:fe(r),widthHint:c==="string"||c==="text"?ue(b):de[c]}})}function Ge(e){if(e.length===0)return"string";if(e.some((s)=>Array.isArray(s)))return"array";let o=e.map(String);if(e.every((s)=>Xe(s))||o.every((s)=>/^(true|false)$/i.test(s)))return"boolean";if(e.every((s)=>Z(s))||o.every((s)=>s.trim()!==""&&!Number.isNaN(Number(s.replaceAll(/[$€£¥,\s]/g,"")))))return"number";if(o.every((s)=>/^\d{4}-\d{2}-\d{2}([T ].*)?$/.test(s)))return"date";if(o.some((s)=>s.length>200))return"text";return"string"}function xp(e,o){if(e===null||e===void 0)return null;switch(o.kind){case"number":{if(Z(e))return Number.isNaN(e)?null:e;let s=String(e).trim().replaceAll(/[$€£¥,\s]/g,"");if(s==="")return null;let l=Number(s);return Number.isNaN(l)?null:l}case"boolean":{if(Xe(e))return e;return String(e).trim().toLowerCase()==="true"}case"array":{if(Array.isArray(e))return e.map(String);let s=String(e).trim();return s===""?[]:s.split(",").map((l)=>l.trim()).filter(Boolean)}case"reference":{if(v(e)&&"$ref"in e){let l=e.$ref;return n(l)&&l!==""?l:null}let s=String(e).trim();return s===""?null:s}default:{let s=String(e);return s===""?null:s}}}function nr(e){if(e===null||e===void 0)return"";if(Array.isArray(e))return e.join(", ");if(S(e))return e.$ref;return String(e)}var wS="__key",H=new WeakMap;function ir(e){return e?H.get(he(e))??null:null}function _p(e,o){let l=g({columns:[],error:null,grouping:null,loading:!1,query:{},rows:[],saving:!1,total:0}),r=new Map,d=(t)=>{r=new Map(t.map((i)=>[i.key,i]))},c=ce({resolveBaseline:(t,i)=>r.get(t)?.cells[i]??null}),b=async()=>{let t=await o.rows(l.query);d(t.rows),l.rows=t.rows,l.total=t.total},w=(t)=>{let i=l.columns.filter((h)=>h.required&&h.editable);if(i.length===0)return null;let a=t.cells.filter((h)=>h.value===null&&i.some((y)=>y.field===h.field)).map((h)=>({error:"Required",field:h.field,ok:!1,rowKey:h.rowKey})),f=t.inserts.filter((h)=>i.some((y)=>h.cells[y.field]===null||h.cells[y.field]===void 0)).map((h)=>({error:`Missing required: ${i.filter((R)=>h.cells[R.field]===null||h.cells[R.field]===void 0).map((R)=>R.field).join(", ")}`,ok:!1,tempKey:h.tempKey}));if(a.length===0&&f.length===0)return null;return{cells:a,deletes:[],inserts:f}},k=(t)=>t===null||t===""||Array.isArray(t)&&t.length===0,G=(t,i,a)=>{if(a==="number")return(Z(t)?t:0)-(Z(i)?i:0);if(a==="boolean")return(t===!0?1:0)-(i===!0?1:0);return nr(t).localeCompare(nr(i))},M=()=>{let t=l.rows.map((f)=>f.key),{dir:i,orderBy:a}=l.query;if(a&&!o.capabilities.remoteSort){let f=l.columns.find((y)=>y.field===a)?.kind,h=i==="desc"?-1:1;t=t.toSorted((y,R)=>{let E=c.effectiveValue(y,a),U=c.effectiveValue(R,a);if(k(E)!==k(U))return k(E)?1:-1;return h*G(E,U,f)})}return l.grouping?[...F(t).values()].flat():t},F=(t)=>{let i=new Map;for(let a of t){let f=nr(c.effectiveValue(a,l.grouping)),h=i.get(f);if(h)h.push(a);else i.set(f,[a])}return i},D=null,P=()=>D?.refreshData(),T={addRow(t={}){let i=c.insertRow(t);return P(),i},bindView(t){D=t},buffer:c,deleteRows(t){if(t.length===0)return;c.group(()=>{for(let i of t)c.deleteRow(i)}),P()},discardRow(t){c.discardRow(t),P()},replaceAll(t,i){if(t==="")return 0;let a=l.columns.filter((y)=>y.editable&&(y.kind==="string"||y.kind==="text")),f=[...l.rows.map((y)=>y.key),...c.state.inserts.keys()],h=0;if(c.group(()=>{for(let y of f){if(c.rowState(y)==="pending-delete")continue;for(let R of a){let E=c.effectiveValue(y,R.field);if(n(E)&&E.includes(t))c.setCell(y,R.field,E.replaceAll(t,i)),h+=1}}}),h>0)P();return h},effectiveRows(){let t=(f)=>Array.isArray(f)?[...f]:S(f)?{$ref:f.$ref}:f,i=(f)=>{let h=[[wS,f]];for(let y of l.columns)h.push([y.field,t(c.effectiveValue(f,y.field))]);return Object.fromEntries(h)},a=M().map((f)=>i(f));for(let[f]of c.state.inserts)a.push(i(f));return a},groups(){if(!l.grouping)return[];return[...F(M())].map(([t,i])=>({count:i.length,value:t}))},async load(){l.loading=!0,l.error=null;try{l.columns=await o.columns(),await b()}catch(t){l.error=Q(t)}finally{l.loading=!1}P()},async refresh(){if(c.isDirty()){if(!await Ko("Refresh Grid",`Discard ${c.dirtyCount()} pending change(s) and reload?`,{confirmLabel:"Discard & Reload",destructive:!0}))return}c.reset(),await o.refresh?.(),await this.load()},async save(){if(l.saving)return;let t=c.buildBatch(),i=t.cells.length+t.inserts.length+t.deletes.length;if(i===0){C.info("No grid changes to save.",{key:"grid.save"});return}let a=w(t);if(a){c.applyCommitResult(a),C.warn("Required cells are empty — fix the marked rows, then save again.",{key:"grid.save",source:"Data",tier:"problem"});return}if(t.deletes.length>0){if(!await Ko("Delete Rows",`Save will permanently delete ${t.deletes.length} row(s). Continue?`,{confirmLabel:"Delete & Save",destructive:!0}))return}let h=new Set(t.cells.map((y)=>y.rowKey)).size+t.inserts.length+t.deletes.length>5?tl({title:"Saving grid"}):null;l.saving=!0;try{let y=await o.commit(t),R=(x,j)=>`${x}\x00${j}`,E=new Map(t.cells.map((x)=>[R(x.rowKey,x.field),x]));for(let x of y.cells){let j=E.get(R(x.rowKey,x.field));if(x.ok&&j){let re=r.get(x.rowKey);if(re)re.cells[x.field]=j.value}}if(c.applyCommitResult(y),y.inserts.some((x)=>x.ok)||y.deletes.some((x)=>x.ok))await b();let L=y.cells.filter((x)=>x.ok).length+y.inserts.filter((x)=>x.ok).length+y.deletes.filter((x)=>x.ok).length,ee=i-L,te=y.cells.filter((x)=>x.stale).length+y.deletes.filter((x)=>x.stale).length;if(ee===0)C.success(`Saved ${L} change(s).`,{key:"grid.save"});else C.error(`Saved ${L} · ${ee} failed${te?` (${te} stale)`:""} — kept pending.`,{action:"file.save",key:"grid.save",source:"Data"})}catch(y){C.error("Could not save the grid.",{action:"file.save",detail:Q(y),key:"grid.save",source:"Data"})}finally{l.saving=!1,h?.done(),P()}},serializeForSource(){if(!o.serializeForSource)return null;return o.serializeForSource(c.buildBatch())},async setQuery(t){l.query=t,l.loading=!0;try{await b()}catch(i){l.error=Q(i)}finally{l.loading=!1}P()},setGrouping(t){l.grouping=t,P()},async setSort(t){let i={...l.query};if(t)i.orderBy=t.field,i.dir=t.dir;else delete i.orderBy,delete i.dir;if(!o.capabilities.remoteSort){l.query=i,P();return}await this.setQuery(i)},source:o,state:l,tab:e};return e.scope.run(()=>{ne(()=>{e.doc.dirty=c.isDirty()}),av(e,{canRedo:()=>c.canRedo(),canUndo:()=>c.canUndo(),redo:()=>{c.redo(),P()},undo:()=>{c.undo(),P()}});let t=p();if(t.subscribeFileEvents&&o.backingPaths){let i=t.subscribeFileEvents((a)=>{let f=o.backingPaths(),h=new Set;for(let y of a){if(y.isDir)continue;let R=y.path.replaceAll("\\","/"),E=f.get(R);if(E!==void 0&&!Vd(R))h.add(E)}if(h.size===0)return;if(c.isDirty()){let y=h.has("*")?l.rows.map((R)=>R.key):[...h];c.markStale(y),C.warn("Grid rows changed on disk — marked stale; refresh to reload.",{key:"grid.stale",source:"Data"}),P()}else T.refresh()});ta(i)}ta(()=>{av(e,null),H.delete(he(e)),o.dispose?.()})}),H.set(he(e),T),T}async function Gu(e){let s=ir(e)?.serializeForSource();if(s)return s;await Ot();let l=Wi(e.doc.sourceFormat);if(l?.capabilities.serialize){let r=e.doc.content.frontmatter,d=e.doc.document,c={...r,...d,children:d.children??[]};return Oa(l.name,c,{mode:"roundtrip",...e.doc.source!==null&&{source:e.doc.source}})}if(e.doc.mode==="content"){let r=ur();if(r){let d=e.doc.content.frontmatter,c=Object.keys(d).length>0,b={...d,...e.doc.document};return Oa(r.name,b,{frontmatter:c,mode:"roundtrip"})}}return ko(uO(e.doc.document,e.doc.bareRepeaters??null),e.doc.layout??null)}var Re=200,Ee=500,Te=2097152,B=new Map,K=!1,I=null,O=null,V=null,X=null;function Oe(){let e=[];for(let o of m.tabs.values())if(o.doc.dirty&&o.documentPath)e.push(o);return e}async function me(){if(!_e())return;let e=p();if(!e.setPreviewOverlay||!e.clearPreviewOverlay)return;let o=new Set;for(let s of Oe()){let l=s.documentPath.replace(/^\.\//,""),r;try{r=await Gu(s)}catch{continue}if(r.length>Te)continue;if(o.add(l),B.get(l)===r)continue;B.set(l,r),await e.setPreviewOverlay(l,r)}for(let s of B.keys())if(!o.has(s))B.delete(s),await e.clearPreviewOverlay(s)}function pe(){if(!K)return;let e=Date.now();if(V??=e,O)clearTimeout(O);let o=e-V,s=Math.max(0,Math.min(Re,Ee-o));O=setTimeout(()=>{O=null,V=null,X=me().finally(()=>{X=null})},s)}function tN(){pe()}function nN(){if(K)return;K=!0,I=ge(),I.run(()=>{ne(()=>{for(let e of m.tabs.values())e.doc.dirty,e.doc.document;pe()})})}function iN(){if(K=!1,O)clearTimeout(O),O=null;V=null,I?.stop(),I=null,B.clear()}async function _S(){if(!K)return;if(O)clearTimeout(O),O=null,V=null;await X,await me()}var ye=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,Me=new Set(["vnd","prs","x"]);function $e(e){if(!n(e))return null;let[o,...s]=e.split(";"),l=(o??"").indexOf("/");if(l===-1)return null;let r=(o??"").slice(0,l).trim().toLowerCase(),d=(o??"").slice(l+1).trim().toLowerCase();if(!ye.test(r)||!ye.test(d))return null;let c=d.lastIndexOf("+"),b=c===-1?null:d.slice(c+1),w=c===-1?d:d.slice(0,c);if(b==="")return null;let k=w.indexOf("."),G=k===-1?null:w.slice(0,k),M=G!==null&&Me.has(G)?G:null,F=M===null?w:w.slice(M.length+1);if(F==="")return null;let D={};for(let P of s){let T=P.indexOf("=");if(T===-1)return null;let t=P.slice(0,T).trim().toLowerCase(),i=P.slice(T+1).trim();if(t==="")return null;if(i.startsWith('"')&&i.endsWith('"')&&i.length>=2)i=i.slice(1,-1);D[t]=i}return{parameters:D,subtype:F,suffix:b,tree:M,type:r}}function Dw(e){let o=$e(e);if(o===null)return null;let s=o.tree===null?"":`${o.tree}.`,l=o.suffix===null?"":`+${o.suffix}`;return`${o.type}/${s}${o.subtype}${l}`}var we="text/markdown; variant=GFM",be="application/yaml",Tt={".markdown":`${we}; charset=utf-8`,".md":`${we}; charset=utf-8`,".yaml":`${be}; charset=utf-8`,".yml":`${be}; charset=utf-8`};async function oN(e,o){let s=await sI(e.name,o);return aI(e,s)}async function or(e,o){await Ot();let s=cn(e);if(!s||!s.capabilities.parse)throw nf(e);return{...await oN(s,o),format:s}}var VT=async(e,o)=>{if(e.documentPath&&cn(e.documentPath)){let l=await or(e.documentPath,o);return e.doc.source=o,{document:l.document,frontmatter:l.frontmatter}}let s=Es(o);return e.doc.layout=s.layout,{document:s.document}};function Fe(e){return"showOpenFilePicker"in e}function De(e){return"showSaveFilePicker"in e}function q(e,o){if(e.documentPath!==null)o.path=e.documentPath;return o}async function iP(){try{await Ot();let e=tu(),o=[{accept:{"application/json":[".json"]},description:"Jx Component"},...e.filter((r)=>r.capabilities.parse).map((r)=>({accept:{[Dw(r.mediaType)??"text/plain"]:r.extensions},description:r.name}))],s=[".json",...e.flatMap((r)=>r.extensions)].join(","),l=async(r,d,c=null)=>{let b=c?await rN(r):null,w=cn(r);if(w){let{document:k,frontmatter:G}=await oN(w,d);_i({document:k,documentPath:b,fileHandle:c,frontmatter:G,id:r,source:d,sourceFormat:w.name})}else if(r.endsWith(".json")){let{document:k,layout:G}=Es(d);_i({document:k,documentPath:b,fileHandle:c,id:r,layout:G})}else throw nf(r)};if(Fe(window)){let[r]=await window.showOpenFilePicker({types:o}),d=await r.getFile();await l(r.name,await d.text(),r)}else{let r=document.createElement("input");r.type="file",r.accept=s,r.addEventListener("change",async()=>{let d=r.files?.[0];if(!d)return;await l(d.name,await d.text())}),r.click()}}catch(e){if(!(e instanceof Error&&e.name==="AbortError"))C.error("Could not open the file.",{detail:Q(e),source:"Open File"})}}var ve=()=>{};function UT(e){ve=e}function _(e){let o=e.doc.document;ve(e.documentPath,o,e);let s=n(o.tagName)&&o.tagName.includes("-")?xS(o):null;if(s)C.warn(s,q(e,{key:`slots:${e.documentPath??e.id}`,source:"Components",tier:"problem"}));W(o,e.documentPath??void 0)}function Ne(e){return!jd(e.documentPath??"")}async function Sp(e=u.value){if(!e)return!1;if(await gL(e.id),hv(e))return C.warn(`You have read access to this session — changes to ${e.documentPath??"this document"} stay in your browser and cannot be saved.`,q(e,{action:"file.save",key:`save.readOnly:${e.documentPath??e.id}`,source:"Collaboration"})),!1;if(!Ne(e))return C.warn(`${e.documentPath??"This file"} is a media file, so there is no document for Save to write.`,q(e,{key:`save.notADocument:${e.documentPath??e.id}`,source:"Save"})),!1;let o=ir(e);if(o)return await o.save(),!e.doc.dirty;try{if(await H$(e))return _(e),!0;let s=await Gu(e);if(e.documentPath){if(await p().writeFile(e.documentPath,s),e.doc.dirty=!1,e.doc.sourceFormat!==null)e.doc.source=s;return _S(),_(e),!0}if(e.fileHandle&&"createWritable"in e.fileHandle){let l=await e.fileHandle.createWritable();if(await l.write(s),await l.close(),e.doc.dirty=!1,e.doc.sourceFormat!==null)e.doc.source=s;return _(e),!0}C.warn("This document has no save target — use Export.",{key:"save.noTarget"})}catch(s){if(!(s instanceof Error&&s.name==="AbortError"))C.error(`Could not save ${e.documentPath??e.id}.`,q(e,{action:"file.save",detail:Q(s),key:`save:${e.documentPath??e.id}`,source:"Save"}))}return!1}function Ae(e){return Wi(e.doc.sourceFormat)??(e.doc.mode==="content"?ur():void 0)}async function qT(){let e=u.value;if(!e)return;try{await Ot();let o=Ae(e),s=await Gu(e),l=o?Dw(o.mediaType)??"text/plain":"application/json",r=o?o.extensions[0]:".json",d=o?o.name:"Jx Component",c=o?`content${r}`:"component.json";if(De(window)){let b=e.documentPath?e.documentPath.split("/").pop():c,w=await window.showSaveFilePicker({suggestedName:b,types:[{accept:{[l]:[r]},description:d}]}),k=await w.createWritable();await k.write(s),await k.close(),e.doc.dirty=!1,_(e),C.success(`Exported as ${w.name}.`)}else{let b=new Blob([s],{type:l}),w=URL.createObjectURL(b),k=document.createElement("a");k.href=w,k.download=c,k.click(),URL.revokeObjectURL(w),e.doc.dirty=!1,_(e),C.success(`Downloaded ${c}.`)}}catch(o){if(!(o instanceof Error&&o.name==="AbortError"))C.error("Could not export the document.",{detail:Q(o),source:"Export"})}}async function Ce(e,o){let s=jd(e)?await Ju(e):await ar({path:e});return I$(s,o)??""}async function vb(e){let o=await Ce(e.path,"delete"),s=`Delete ${e.name}? This cannot be undone.`;return Boolean(await Ko("Delete File",o===""?s:`${s} ${o}`,{confirmLabel:"Delete",destructive:!0}))}async function yb(e,o="rename"){let s=await Ce(e,o);return s===""?void 0:s}
2
- export{$w,bb,cs,zl,fm,Iw,Rw,xp,nr,wS,ir,_p,xS,eN,Gu,tN,nN,iN,_S,Dw,oN,or,VT,iP,UT,Sp,qT,vb,yb};
1
+ import{p,_e}from"./studio-pr23qhrw.js";import{Q}from"./studio-nqxqf8p2.js";import{$a,k$}from"./studio-cq87hree.js";import{ge,ea,ne,g,he,C,dl,tf}from"./studio-hw60n5dh.js";import{sO,Y,ov,qd,kr,Ix,Rx,Ra,cv,O$,m,u,_i}from"./studio-y1x65h5r.js";import{Bt,eu,zi,of,fn,cr,tI,Oa,nI}from"./studio-tpmnbgmt.js";import{Pd}from"./studio-hvxt8z79.js";import{x$,VA,UA,hh,Gb}from"./studio-7cg75gtj.js";import{Ko}from"./studio-02phtmqn.js";import{fN,dL}from"./studio-5abge3wy.js";import{zd}from"./studio-9wyqyfqy.js";import{ks,ko}from"./studio-m4w6sygj.js";import{tl,Ku}from"./studio-wcakp5bt.js";import{eN}from"./studio-rdnezzkd.js";import{oe}from"./studio-gqpty626.js";import{n,Z,Xe,_,v}from"./studio-kt2j51sa.js";function ie(e,o=[]){if(e?.tagName==="slot"){let s=e.attributes?.name;o.push(n(s)?s.trim():"")}if(Array.isArray(e?.children))for(let s of e.children)ie(n(s)?void 0:s,o);return o}function vS(e){let o=ie(e),s=o.filter((r)=>r==="").length;if(s>1)return`Component has ${s} unnamed <slot> elements — only one default slot is allowed. Give extra slots a name attribute.`;let l=new Set;for(let r of o){if(r&&l.has(r))return`Duplicate slot name "${r}" — slot names must be unique within a component.`;l.add(r)}return null}var se={invokerTags:Gb,popoverTags:hh},D="Popover",ke={display:"document.repairPopoverDisplay","open-display":"document.repairPopoverDisplay",invoker:"document.repairPopoverInvoker",mode:"document.repairPopoverMode"};function ae(e,o,s,l){let r=`${o}.${s}.${l.join("/")}`,d=e.get(r)??0;return e.set(r,d+1),d===0?r:`${r}#${d}`}function W(e,o){dl((d)=>d.source===D);let s=new Map,l=VA(e,se);for(let d of l){let c=d.fix===void 0?void 0:ke[d.fix],b={detail:d.detail,key:ae(s,"popover",d.rule,d.path),source:D,tier:"problem"};if(c!==void 0)b.action=c,b.actionArgs={path:d.path};if(o!==void 0)b.path=o;C(d.severity,d.message,b)}let r=fN(e,se);for(let d of r){let c={detail:d.detail,key:ae(s,"dialog",d.rule,d.path),source:D,tier:"problem"};if(o!==void 0)c.path=o;C(d.severity,d.message,c)}return l.length+r.length}function z(e,o){let s=o?.path;if(!Array.isArray(s))throw RangeError(`command "${e}" needs a "path" argument naming the popover`);return s}function J(e){let o=u.value;if(!o)throw RangeError(`command "${e}" needs an open document`);return o}function Se(){return[{category:"Document",group:"2_document",id:"document.checkPopovers",level:"document",menus:["palette"],requires:"an open document",run:()=>{let e=J("document.checkPopovers"),o=W(e.doc.document,e.documentPath??void 0);C.success(o===0?"No popover problems found in this document.":`${o} popover problem(s) filed.`,{key:"popover.run",source:D})},title:"Check Popovers",when:(e)=>e.document.open,aiTool:{description:"Check the open document for popover defects an author can fix — a base-rule `display` "+"that defeats the browser's own hiding of a closed popover, `popovertarget` on an "+"element that cannot invoke, a target naming no popover, a cut exit animation — and "+"file each as a Problem. The findings come back as data.",name:"check_popovers",report:()=>{let e=tf(D),o=e.length;return{data:e,summary:o===0?"No popover problems found in this document.":`Filed ${o} popover problem${o===1?"":"s"} in Problems.`}}}},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverDisplay",level:"document",menus:[],requires:"a popover whose base rule sets display",run:(e,o)=>{let l=J("document.repairPopoverDisplay"),r=z("document.repairPopoverDisplay",o),d=oe(l.doc.document,r),c=UA(d?.style);if(!c)throw RangeError(`command "${"document.repairPopoverDisplay"}": nothing to move — this popover sets no display`);Y(l,(b)=>{for(let w of c.base)qd(b,r,w,"");for(let w of c.breakpoints)Rx(b,r,[w],"display","");if(c.openDisplay!==null)Ix(b,r,":popover-open","display",c.openDisplay)}),C.success("Moved `display` into `:popover-open`.",{key:"popover.repaired.display",source:D})},title:"Move display into :popover-open",when:(e)=>e.document.open},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverInvoker",level:"document",menus:[],requires:"an element carrying popovertarget that cannot invoke",run:(e,o)=>{let l=J("document.repairPopoverInvoker"),r=z("document.repairPopoverInvoker",o);Y(l,(d)=>{kr(d,r,"popovertarget"),kr(d,r,"popovertargetaction")}),C.success("Removed the attributes, which did nothing on this element.",{key:"popover.repaired.invoker",source:D})},title:"Remove the inert popover attributes",when:(e)=>e.document.open},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverMode",level:"document",menus:[],requires:"a popover whose mode is not one of the three keywords",run:(e,o)=>{let l=J("document.repairPopoverMode"),r=z("document.repairPopoverMode",o);Y(l,(d)=>{kr(d,r,"popover",x$)}),C.success(`Set \`popover\` to "${x$}".`,{key:"popover.repaired.mode",source:D})},title:"Set popover to auto",when:(e)=>e.document.open}]}function JD(e){e.registerAll(Se())}function kw(e,o){if(e===o)return!0;if(Array.isArray(e)&&Array.isArray(o))return e.length===o.length&&e.every((s,l)=>s===o[l]);if(_(e)&&_(o)&&!Array.isArray(e)&&!Array.isArray(o))return e.$ref===o.$ref;return!1}var N="grid://",gb={children:[],tagName:"div"};function ls(e){switch(e.kind){case"pages":return`${N}pages`;case"collection":return`${N}collection/${encodeURIComponent(e.name)}`;default:return`${N}data/${encodeURIComponent(e.connection)}/${encodeURIComponent(e.table)}`}}function xe(e){return e.startsWith(N)}function Bl(e){if(!xe(e))return null;let o=e.slice(N.length).split("/");if(o[0]==="pages"&&o.length===1)return{kind:"pages"};if(o[0]==="collection"&&o.length===2&&o[1])return{kind:"collection",name:decodeURIComponent(o[1])};if(o[0]==="data"&&o.length===3&&o[1]&&o[2])return{connection:decodeURIComponent(o[1]),kind:"data",table:decodeURIComponent(o[2])};return null}function mm(e){let o=Bl(e);if(!o)return null;switch(o.kind){case"pages":return"Pages · grid";case"collection":return`${o.name} · grid`;default:return`${o.table} @ ${o.connection} · grid`}}var le=0;function ce(e){let o=e.coalesceMs??800,s=e.now??(()=>Date.now()),r=g({deletes:new Set,errors:new Map,inserts:new Map,pending:new Map,redoStack:[],stale:new Set,undoStack:[]}),d=null,c=(t,i,a)=>{let f=r.errors.get(t);if(f)f.set(i,a);else r.errors.set(t,new Map([[i,a]]))},b=(t,i)=>{let a=r.errors.get(t);if(a?.delete(i),a?.size===0)r.errors.delete(t)},w=(t)=>{if(r.redoStack.length=0,d){d.push(t);return}let i=r.undoStack.at(-1);if(t.kind==="cell"&&i?.kind==="cell"&&i.rowKey===t.rowKey&&i.field===t.field&&t.at-i.at<=o){i.after=t.after,i.at=t.at;return}r.undoStack.push(t)},k=(t,i,a)=>{let f=r.inserts.get(t);if(f){if(a===null)delete f[i];else f[i]=a;return}if(kw(a,e.resolveBaseline(t,i))){let y=r.pending.get(t);if(y?.delete(i),y?.size===0)r.pending.delete(t);return}let h=r.pending.get(t);if(h)h.set(i,{value:a});else r.pending.set(t,new Map([[i,{value:a}]]))},P=(t,i)=>{let a=r.inserts.get(t);if(a)return a[i]??null;let f=r.pending.get(t)?.get(i);return f?f.value:e.resolveBaseline(t,i)},O=(t,i)=>{let a=r.errors.get(t);return a?.get(i)??a?.get("*")??null},M=(t,i)=>{switch(t.kind){case"cell":{k(t.rowKey,t.field,i==="undo"?t.before:t.after);break}case"insert":{if(i==="undo")r.inserts.delete(t.tempKey);else r.inserts.set(t.tempKey,{...t.cells});break}case"drop-insert":{if(i==="undo")r.inserts.set(t.tempKey,{...t.cells});else r.inserts.delete(t.tempKey);break}case"delete":{if(i==="undo")r.deletes.delete(t.rowKey);else r.deletes.add(t.rowKey);break}default:{let a=i==="undo"?t.ops.toReversed():t.ops;for(let f of a)M(f,i);break}}},F=()=>{if(d)throw Error("edit-buffer: groups may not nest");d=[]},x=()=>{let t=d;if(d=null,!t)return;if(t.length===1)r.undoStack.push(t[0]);else if(t.length>1)r.undoStack.push({kind:"group",ops:t})},E=(t)=>{let i=(a)=>{switch(a.kind){case"cell":return t(a.rowKey)?null:a;case"insert":case"drop-insert":return t(a.tempKey)?null:a;case"delete":return t(a.rowKey)?null:a;default:{let f=a.ops.map((h)=>i(h)).filter((h)=>h!==null);return f.length>0?{kind:"group",ops:f}:null}}};r.undoStack=r.undoStack.map(i).filter((a)=>a!==null),r.redoStack=r.redoStack.map(i).filter((a)=>a!==null)};return{applyCommitResult(t){let i=new Set;for(let a of t.cells)if(a.ok){let f=r.pending.get(a.rowKey);if(f?.delete(a.field),f?.size===0)r.pending.delete(a.rowKey);b(a.rowKey,a.field)}else if(c(a.rowKey,a.field,a.error??"Save failed"),a.stale)r.stale.add(a.rowKey);for(let a of t.inserts)if(a.ok)r.inserts.delete(a.tempKey),r.errors.delete(a.tempKey),i.add(a.tempKey);else c(a.tempKey,"*",a.error??"Insert failed");for(let a of t.deletes)if(a.ok)r.deletes.delete(a.rowKey),r.pending.delete(a.rowKey),r.errors.delete(a.rowKey),i.add(a.rowKey);else if(c(a.rowKey,"*",a.error??"Delete failed"),a.stale)r.stale.add(a.rowKey);for(let a of i)r.stale.delete(a);if(i.size>0)E((a)=>i.has(a))},buildBatch(){let t=[];for(let[i,a]of r.pending){if(r.deletes.has(i))continue;for(let[f,h]of a)t.push({baseline:e.resolveBaseline(i,f),field:f,rowKey:i,value:h.value})}return{cells:t,deletes:[...r.deletes].map((i)=>({rowKey:i})),inserts:[...r.inserts].map(([i,a])=>({cells:{...a},tempKey:i}))}},canRedo:()=>r.redoStack.length>0,canUndo:()=>r.undoStack.length>0,cellError:O,cellState(t,i){if(O(t,i)!==null)return"error";if(r.stale.has(t))return"stale";if(r.inserts.has(t)||r.pending.get(t)?.has(i))return"dirty";return"clean"},deleteRow(t){if(r.deletes.has(t))return;let i=r.inserts.get(t);if(i){let a={...i};r.inserts.delete(t),r.errors.delete(t),r.stale.delete(t),w({cells:a,kind:"drop-insert",tempKey:t});return}r.deletes.add(t),w({kind:"delete",rowKey:t})},dirtyCount(){let t=r.inserts.size+r.deletes.size;for(let[i,a]of r.pending)if(!r.deletes.has(i))t+=a.size;return t},discardRow(t){r.pending.delete(t),r.deletes.delete(t),r.inserts.delete(t),r.errors.delete(t),r.stale.delete(t),E((i)=>i===t)},effectiveValue:P,beginGroup:F,endGroup:x,group(t){F();try{t()}finally{x()}},insertRow(t={}){le+=1;let i=`__new-${le}`;return r.inserts.set(i,{...t}),w({cells:{...t},kind:"insert",tempKey:i}),i},isDirty:()=>r.pending.size>0||r.inserts.size>0||r.deletes.size>0,isInsertKey:(t)=>r.inserts.has(t),markStale(t){for(let i of t)r.stale.add(i)},redo(){let t=r.redoStack.pop();if(!t)return!1;return M(t,"redo"),r.undoStack.push(t),!0},reset(){r.pending.clear(),r.inserts.clear(),r.deletes.clear(),r.errors.clear(),r.stale.clear(),r.undoStack.length=0,r.redoStack.length=0},rowState(t){if(r.deletes.has(t))return"pending-delete";if(r.inserts.has(t))return"pending-insert";if(r.stale.has(t))return"stale";if(r.pending.has(t)||r.errors.has(t))return"dirty";return"clean"},setCell(t,i,a){let f=P(t,i);if(kw(f,a))return;k(t,i,a),w({after:a,at:s(),before:f,field:i,kind:"cell",rowKey:t})},state:r,undo(){let t=r.undoStack.pop();if(!t)return!1;return M(t,"undo"),r.redoStack.push(t),!0}}}var de={array:220,boolean:70,date:130,enum:140,image:180,number:110,readonly:200,reference:200,string:180,text:340};function ue(e){return Math.min(340,Math.max(90,Math.round(e*7.5)))}function Pe(e){if(e.$ref)return"reference";if(e.enum!==void 0&&Array.isArray(e.enum))return"enum";let o=e.type==="array"?void 0:e.format;if(Ra(o))return"image";if(o==="date"||o==="date-time")return"date";switch(e.type){case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return"array";case"object":return"readonly";default:return(e.maxLength??0)>200||e.format==="markdown"?"text":"string"}}function fe(e){let o=e.replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replaceAll(/[_-]+/g," ").trim();return o.charAt(0).toUpperCase()+o.slice(1)}function Ew(e,o={}){let s=Object.entries(e?.properties??{}),l=new Set(e?.required),r=new Set(o.readonlyFields),d=s.map(([c,b])=>{let w=r.has(c)?"readonly":Pe(b),k=Array.isArray(b.enum)?Math.max(...b.enum.map((P)=>String(P).length),4):0;return{editable:w!=="readonly",field:c,kind:w,pk:c===o.idField,required:l.has(c),schema:b,title:fe(c),widthHint:w==="enum"?ue(k+3):de[w]}});return d.sort((c,b)=>{let w=(P)=>P.pk?0:P.required?1:2,k=w(c)-w(b);return k===0?0:k}),d}function Tw(e,o=50){let s=e.slice(0,o),l=[];for(let r of s)for(let d of Object.keys(r))if(!l.includes(d))l.push(d);return l.map((r)=>{let d=s.flatMap((w)=>{let k=w[r];return k===null||k===void 0||k===""?[]:[k]}),c=Ge(d),b=Math.max(...d.map((w)=>nr(w).length),r.length,4);return{editable:!0,field:r,kind:c,title:fe(r),widthHint:c==="string"||c==="text"?ue(b):de[c]}})}function Ge(e){if(e.length===0)return"string";if(e.some((s)=>Array.isArray(s)))return"array";let o=e.map(String);if(e.every((s)=>Xe(s))||o.every((s)=>/^(true|false)$/i.test(s)))return"boolean";if(e.every((s)=>Z(s))||o.every((s)=>s.trim()!==""&&!Number.isNaN(Number(s.replaceAll(/[$€£¥,\s]/g,"")))))return"number";if(o.every((s)=>/^\d{4}-\d{2}-\d{2}([T ].*)?$/.test(s)))return"date";if(o.some((s)=>s.length>200))return"text";return"string"}function xp(e,o){if(e===null||e===void 0)return null;switch(o.kind){case"number":{if(Z(e))return Number.isNaN(e)?null:e;let s=String(e).trim().replaceAll(/[$€£¥,\s]/g,"");if(s==="")return null;let l=Number(s);return Number.isNaN(l)?null:l}case"boolean":{if(Xe(e))return e;return String(e).trim().toLowerCase()==="true"}case"array":{if(Array.isArray(e))return e.map(String);let s=String(e).trim();return s===""?[]:s.split(",").map((l)=>l.trim()).filter(Boolean)}case"reference":{if(v(e)&&"$ref"in e){let l=e.$ref;return n(l)&&l!==""?l:null}let s=String(e).trim();return s===""?null:s}default:{let s=String(e);return s===""?null:s}}}function nr(e){if(e===null||e===void 0)return"";if(Array.isArray(e))return e.join(", ");if(_(e))return e.$ref;return String(e)}var bS="__key",H=new WeakMap;function ir(e){return e?H.get(he(e))??null:null}function _p(e,o){let l=g({columns:[],error:null,grouping:null,loading:!1,query:{},rows:[],saving:!1,total:0}),r=new Map,d=(t)=>{r=new Map(t.map((i)=>[i.key,i]))},c=ce({resolveBaseline:(t,i)=>r.get(t)?.cells[i]??null}),b=async()=>{let t=await o.rows(l.query);d(t.rows),l.rows=t.rows,l.total=t.total},w=(t)=>{let i=l.columns.filter((h)=>h.required&&h.editable);if(i.length===0)return null;let a=t.cells.filter((h)=>h.value===null&&i.some((y)=>y.field===h.field)).map((h)=>({error:"Required",field:h.field,ok:!1,rowKey:h.rowKey})),f=t.inserts.filter((h)=>i.some((y)=>h.cells[y.field]===null||h.cells[y.field]===void 0)).map((h)=>({error:`Missing required: ${i.filter((G)=>h.cells[G.field]===null||h.cells[G.field]===void 0).map((G)=>G.field).join(", ")}`,ok:!1,tempKey:h.tempKey}));if(a.length===0&&f.length===0)return null;return{cells:a,deletes:[],inserts:f}},k=(t)=>t===null||t===""||Array.isArray(t)&&t.length===0,P=(t,i,a)=>{if(a==="number")return(Z(t)?t:0)-(Z(i)?i:0);if(a==="boolean")return(t===!0?1:0)-(i===!0?1:0);return nr(t).localeCompare(nr(i))},O=()=>{let t=l.rows.map((f)=>f.key),{dir:i,orderBy:a}=l.query;if(a&&!o.capabilities.remoteSort){let f=l.columns.find((y)=>y.field===a)?.kind,h=i==="desc"?-1:1;t=t.toSorted((y,G)=>{let R=c.effectiveValue(y,a),U=c.effectiveValue(G,a);if(k(R)!==k(U))return k(R)?1:-1;return h*P(R,U,f)})}return l.grouping?[...M(t).values()].flat():t},M=(t)=>{let i=new Map;for(let a of t){let f=nr(c.effectiveValue(a,l.grouping)),h=i.get(f);if(h)h.push(a);else i.set(f,[a])}return i},F=null,x=()=>F?.refreshData(),E={addRow(t={}){let i=c.insertRow(t);return x(),i},bindView(t){F=t},buffer:c,deleteRows(t){if(t.length===0)return;c.group(()=>{for(let i of t)c.deleteRow(i)}),x()},discardRow(t){c.discardRow(t),x()},replaceAll(t,i){if(t==="")return 0;let a=l.columns.filter((y)=>y.editable&&(y.kind==="string"||y.kind==="text")),f=[...l.rows.map((y)=>y.key),...c.state.inserts.keys()],h=0;if(c.group(()=>{for(let y of f){if(c.rowState(y)==="pending-delete")continue;for(let G of a){let R=c.effectiveValue(y,G.field);if(n(R)&&R.includes(t))c.setCell(y,G.field,R.replaceAll(t,i)),h+=1}}}),h>0)x();return h},effectiveRows(){let t=(f)=>Array.isArray(f)?[...f]:_(f)?{$ref:f.$ref}:f,i=(f)=>{let h=[[bS,f]];for(let y of l.columns)h.push([y.field,t(c.effectiveValue(f,y.field))]);return Object.fromEntries(h)},a=O().map((f)=>i(f));for(let[f]of c.state.inserts)a.push(i(f));return a},groups(){if(!l.grouping)return[];return[...M(O())].map(([t,i])=>({count:i.length,value:t}))},async load(){l.loading=!0,l.error=null;try{l.columns=await o.columns(),await b()}catch(t){l.error=Q(t)}finally{l.loading=!1}x()},async refresh(){if(c.isDirty()){if(!await Ko("Refresh Grid",`Discard ${c.dirtyCount()} pending change(s) and reload?`,{confirmLabel:"Discard & Reload",destructive:!0}))return}c.reset(),await o.refresh?.(),await this.load()},async save(){if(l.saving)return;let t=c.buildBatch(),i=t.cells.length+t.inserts.length+t.deletes.length;if(i===0){C.info("No grid changes to save.",{key:"grid.save"});return}let a=w(t);if(a){c.applyCommitResult(a),C.warn("Required cells are empty — fix the marked rows, then save again.",{key:"grid.save",source:"Data",tier:"problem"});return}if(t.deletes.length>0){if(!await Ko("Delete Rows",`Save will permanently delete ${t.deletes.length} row(s). Continue?`,{confirmLabel:"Delete & Save",destructive:!0}))return}let h=new Set(t.cells.map((y)=>y.rowKey)).size+t.inserts.length+t.deletes.length>5?tl({title:"Saving grid"}):null;l.saving=!0;try{let y=await o.commit(t),G=(S,j)=>`${S}\x00${j}`,R=new Map(t.cells.map((S)=>[G(S.rowKey,S.field),S]));for(let S of y.cells){let j=R.get(G(S.rowKey,S.field));if(S.ok&&j){let re=r.get(S.rowKey);if(re)re.cells[S.field]=j.value}}if(c.applyCommitResult(y),y.inserts.some((S)=>S.ok)||y.deletes.some((S)=>S.ok))await b();let L=y.cells.filter((S)=>S.ok).length+y.inserts.filter((S)=>S.ok).length+y.deletes.filter((S)=>S.ok).length,ee=i-L,te=y.cells.filter((S)=>S.stale).length+y.deletes.filter((S)=>S.stale).length;if(ee===0)C.success(`Saved ${L} change(s).`,{key:"grid.save"});else C.error(`Saved ${L} · ${ee} failed${te?` (${te} stale)`:""} — kept pending.`,{action:"file.save",key:"grid.save",source:"Data"})}catch(y){C.error("Could not save the grid.",{action:"file.save",detail:Q(y),key:"grid.save",source:"Data"})}finally{l.saving=!1,h?.done(),x()}},serializeForSource(){if(!o.serializeForSource)return null;return o.serializeForSource(c.buildBatch())},async setQuery(t){l.query=t,l.loading=!0;try{await b()}catch(i){l.error=Q(i)}finally{l.loading=!1}x()},setGrouping(t){l.grouping=t,x()},async setSort(t){let i={...l.query};if(t)i.orderBy=t.field,i.dir=t.dir;else delete i.orderBy,delete i.dir;if(!o.capabilities.remoteSort){l.query=i,x();return}await this.setQuery(i)},source:o,state:l,tab:e};return e.scope.run(()=>{ne(()=>{e.doc.dirty=c.isDirty()}),ov(e,{canRedo:()=>c.canRedo(),canUndo:()=>c.canUndo(),redo:()=>{c.redo(),x()},undo:()=>{c.undo(),x()}});let t=p();if(t.subscribeFileEvents&&o.backingPaths){let i=t.subscribeFileEvents((a)=>{let f=o.backingPaths(),h=new Set;for(let y of a){if(y.isDir)continue;let G=y.path.replaceAll("\\","/"),R=f.get(G);if(R!==void 0&&!zd(G))h.add(R)}if(h.size===0)return;if(c.isDirty()){let y=h.has("*")?l.rows.map((G)=>G.key):[...h];c.markStale(y),C.warn("Grid rows changed on disk — marked stale; refresh to reload.",{key:"grid.stale",source:"Data"}),x()}else E.refresh()});ea(i)}ea(()=>{ov(e,null),H.delete(he(e)),o.dispose?.()})}),H.set(he(e),E),E}async function qu(e){let s=ir(e)?.serializeForSource();if(s)return s;await Bt();let l=zi(e.doc.sourceFormat);if(l?.capabilities.serialize){let r=e.doc.content.frontmatter,d=e.doc.document,c={...r,...d,children:d.children??[]};return Oa(l.name,c,{mode:"roundtrip",...e.doc.source!==null&&{source:e.doc.source}})}if(e.doc.mode==="content"){let r=cr();if(r){let d=e.doc.content.frontmatter,c=Object.keys(d).length>0,b={...d,...e.doc.document};return Oa(r.name,b,{frontmatter:c,mode:"roundtrip"})}}return ko(sO(e.doc.document,e.doc.bareRepeaters??null),e.doc.layout??null)}var Re=200,Ee=500,Te=2097152,A=new Map,V=!1,I=null,T=null,B=null,X=null;function Oe(){let e=[];for(let o of m.tabs.values())if(o.doc.dirty&&o.documentPath)e.push(o);return e}async function me(){if(!_e())return;let e=p();if(!e.setPreviewOverlay||!e.clearPreviewOverlay)return;let o=new Set;for(let s of Oe()){let l=s.documentPath.replace(/^\.\//,""),r;try{r=await qu(s)}catch{continue}if(r.length>Te)continue;if(o.add(l),A.get(l)===r)continue;A.set(l,r),await e.setPreviewOverlay(l,r)}for(let s of A.keys())if(!o.has(s))A.delete(s),await e.clearPreviewOverlay(s)}function pe(){if(!V)return;let e=Date.now();if(B??=e,T)clearTimeout(T);let o=e-B,s=Math.max(0,Math.min(Re,Ee-o));T=setTimeout(()=>{T=null,B=null,X=me().finally(()=>{X=null})},s)}function YD(){pe()}function ZD(){if(V)return;V=!0,I=ge(),I.run(()=>{ne(()=>{for(let e of m.tabs.values())e.doc.dirty,e.doc.document;pe()})})}function XD(){if(V=!1,T)clearTimeout(T),T=null;B=null,I?.stop(),I=null,A.clear()}async function yS(){if(!V)return;if(T)clearTimeout(T),T=null,B=null;await X,await me()}var ye=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,Me=new Set(["vnd","prs","x"]);function $e(e){if(!n(e))return null;let[o,...s]=e.split(";"),l=(o??"").indexOf("/");if(l===-1)return null;let r=(o??"").slice(0,l).trim().toLowerCase(),d=(o??"").slice(l+1).trim().toLowerCase();if(!ye.test(r)||!ye.test(d))return null;let c=d.lastIndexOf("+"),b=c===-1?null:d.slice(c+1),w=c===-1?d:d.slice(0,c);if(b==="")return null;let k=w.indexOf("."),P=k===-1?null:w.slice(0,k),O=P!==null&&Me.has(P)?P:null,M=O===null?w:w.slice(O.length+1);if(M==="")return null;let F={};for(let x of s){let E=x.indexOf("=");if(E===-1)return null;let t=x.slice(0,E).trim().toLowerCase(),i=x.slice(E+1).trim();if(t==="")return null;if(i.startsWith('"')&&i.endsWith('"')&&i.length>=2)i=i.slice(1,-1);F[t]=i}return{parameters:F,subtype:M,suffix:b,tree:O,type:r}}function Lw(e){let o=$e(e);if(o===null)return null;let s=o.tree===null?"":`${o.tree}.`,l=o.suffix===null?"":`+${o.suffix}`;return`${o.type}/${s}${o.subtype}${l}`}var we="text/markdown; variant=GFM",be="application/yaml",Tt={".markdown":`${we}; charset=utf-8`,".md":`${we}; charset=utf-8`,".yaml":`${be}; charset=utf-8`,".yml":`${be}; charset=utf-8`};async function QD(e,o){let s=await tI(e.name,o);return nI(e,s)}async function Hr(e,o){await Bt();let s=fn(e);if(!s||!s.capabilities.parse)throw of(e);return{...await QD(s,o),format:s}}var FT=async(e,o)=>{if(e.documentPath&&fn(e.documentPath)){let l=await Hr(e.documentPath,o);return e.doc.source=o,{document:l.document,frontmatter:l.frontmatter}}let s=ks(o);return e.doc.layout=s.layout,{document:s.document}};function Fe(e){return"showOpenFilePicker"in e}function De(e){return"showSaveFilePicker"in e}function q(e,o){if(e.documentPath!==null)o.path=e.documentPath;return o}async function X2(){try{await Bt();let e=eu(),o=[{accept:{"application/json":[".json"]},description:"Jx Component"},...e.filter((r)=>r.capabilities.parse).map((r)=>({accept:{[Lw(r.mediaType)??"text/plain"]:r.extensions},description:r.name}))],s=[".json",...e.flatMap((r)=>r.extensions)].join(","),l=async(r,d,c=null)=>{let b=c?await eN(r):null,w=fn(r);if(w){let{document:k,frontmatter:P}=await QD(w,d);_i({document:k,documentPath:b,fileHandle:c,frontmatter:P,id:r,source:d,sourceFormat:w.name})}else if(r.endsWith(".json")){let{document:k,layout:P}=ks(d);_i({document:k,documentPath:b,fileHandle:c,id:r,layout:P})}else throw of(r)};if(Fe(window)){let[r]=await window.showOpenFilePicker({types:o}),d=await r.getFile();await l(r.name,await d.text(),r)}else{let r=document.createElement("input");r.type="file",r.accept=s,r.addEventListener("change",async()=>{let d=r.files?.[0];if(!d)return;await l(d.name,await d.text())}),r.click()}}catch(e){if(!(e instanceof Error&&e.name==="AbortError"))C.error("Could not open the file.",{detail:Q(e),source:"Open File"})}}var ve=()=>{};function jT(e){ve=e}function K(e){let o=e.doc.document;ve(e.documentPath,o,e);let s=n(o.tagName)&&o.tagName.includes("-")?vS(o):null;if(s)C.warn(s,q(e,{key:`slots:${e.documentPath??e.id}`,source:"Components",tier:"problem"}));W(o,e.documentPath??void 0)}function Ne(e){return!Pd(e.documentPath??"")}async function Sp(e=u.value){if(!e)return!1;if(await dL(e.id),cv(e))return C.warn(`You have read access to this session — changes to ${e.documentPath??"this document"} stay in your browser and cannot be saved.`,q(e,{action:"file.save",key:`save.readOnly:${e.documentPath??e.id}`,source:"Collaboration"})),!1;if(!Ne(e))return C.warn(`${e.documentPath??"This file"} is a media file, so there is no document for Save to write.`,q(e,{key:`save.notADocument:${e.documentPath??e.id}`,source:"Save"})),!1;let o=ir(e);if(o)return await o.save(),!e.doc.dirty;try{if(await O$(e))return K(e),!0;let s=await qu(e);if(e.documentPath){if(await p().writeFile(e.documentPath,s),e.doc.dirty=!1,e.doc.sourceFormat!==null)e.doc.source=s;return yS(),K(e),!0}if(e.fileHandle&&"createWritable"in e.fileHandle){let l=await e.fileHandle.createWritable();if(await l.write(s),await l.close(),e.doc.dirty=!1,e.doc.sourceFormat!==null)e.doc.source=s;return K(e),!0}C.warn("This document has no save target — use Export.",{key:"save.noTarget"})}catch(s){if(!(s instanceof Error&&s.name==="AbortError"))C.error(`Could not save ${e.documentPath??e.id}.`,q(e,{action:"file.save",detail:Q(s),key:`save:${e.documentPath??e.id}`,source:"Save"}))}return!1}function Ae(e){return zi(e.doc.sourceFormat)??(e.doc.mode==="content"?cr():void 0)}async function HT(){let e=u.value;if(!e)return;try{await Bt();let o=Ae(e),s=await qu(e),l=o?Lw(o.mediaType)??"text/plain":"application/json",r=o?o.extensions[0]:".json",d=o?o.name:"Jx Component",c=o?`content${r}`:"component.json";if(De(window)){let b=e.documentPath?e.documentPath.split("/").pop():c,w=await window.showSaveFilePicker({suggestedName:b,types:[{accept:{[l]:[r]},description:d}]}),k=await w.createWritable();await k.write(s),await k.close(),e.doc.dirty=!1,K(e),C.success(`Exported as ${w.name}.`)}else{let b=new Blob([s],{type:l}),w=URL.createObjectURL(b),k=document.createElement("a");k.href=w,k.download=c,k.click(),URL.revokeObjectURL(w),e.doc.dirty=!1,K(e),C.success(`Downloaded ${c}.`)}}catch(o){if(!(o instanceof Error&&o.name==="AbortError"))C.error("Could not export the document.",{detail:Q(o),source:"Export"})}}async function Ce(e,o){let s=Pd(e)?await Ku(e):await $a({path:e});return k$(s,o)??""}async function bb(e){let o=await Ce(e.path,"delete"),s=`Delete ${e.name}? This cannot be undone.`;return Boolean(await Ko("Delete File",o===""?s:`${s} ${o}`,{confirmLabel:"Delete",destructive:!0}))}async function vb(e,o="rename"){let s=await Ce(e,o);return s===""?void 0:s}
2
+ export{kw,gb,ls,Bl,mm,Ew,Tw,xp,nr,bS,ir,_p,vS,JD,qu,YD,ZD,XD,yS,Lw,QD,Hr,FT,X2,jT,Sp,HT,bb,vb};
3
3
 
4
- //# debugId=0AA46BFC0227A79464756E2164756E21
5
- //# sourceMappingURL=studio-q0tccd43.js.map
4
+ //# debugId=41C934FE2B14C01C64756E2164756E21
5
+ //# sourceMappingURL=studio-1yhz0s8p.js.map
@@ -0,0 +1,5 @@
1
+ import{p,_e}from"./studio-pr23qhrw.js";import{Ne,Gw,xa,jc}from"./studio-v2ek69cb.js";import{g}from"./studio-hw60n5dh.js";import{ln,Y,kr,Up,Ra,u}from"./studio-y1x65h5r.js";import{Sv}from"./studio-tpmnbgmt.js";import{Vc,Sa,or}from"./studio-hvxt8z79.js";import{Vr}from"./studio-txkx6586.js";import{JT,il,Eb}from"./studio-5abge3wy.js";import{mt}from"./studio-2b8443ms.js";import{T,R,rt}from"./studio-02phtmqn.js";import{Zn}from"./studio-nm9qev4p.js";import{mb}from"./studio-2dtc90zs.js";import{Vu}from"./studio-a6x058ew.js";import{jy,VR,qg,kd,UR,qR,Vk,Hy,By}from"./studio-8m1t83kn.js";import{sm}from"./studio-3pndhat0.js";import{yw,ww,bp}from"./studio-a3evp7f6.js";import{S,xn}from"./studio-ana67wax.js";import{n,Z,v}from"./studio-kt2j51sa.js";import{le}from"./studio-fqs1a22a.js";var X=new Map([["img","src"],["source","src"],["video","poster"]]);function ee(e,t,a=Ne){if(!e||t!=="image")return{mode:"insert"};let r=X.get(e.tagName);if(r)return{attr:r,mode:"replace-attr",path:e.path};if(e.tagName.includes("-")){let s=(a.find((l)=>l.tagName===e.tagName)?.props??[]).filter((l)=>Ra(l.format));if(s.length===1)return{mode:"replace-prop",path:e.path,prop:s[0].name}}return{mode:"insert"}}function E(e){switch(e.kind){case"image":return{attributes:{src:e.ref},tagName:"img"};case"video":return{attributes:{controls:"",src:e.ref},tagName:"video"};case"audio":return{attributes:{controls:"",src:e.ref},tagName:"audio"};default:return{attributes:{href:e.ref},tagName:"a",textContent:e.name}}}function te(e,t){let a=[...e.targetPath],r=a.at(-1);if(t===0||!Z(r))return a;return a[a.length-1]=r+t,a}async function BR(e,t,a,r){if(!e||t.length===0)return;let o=await Sa(t),[s]=o;if(!s)return;let l=ee(a,s.kind);if(l.mode==="replace-attr"){Y(e,(m)=>kr(m,l.path,l.attr,s.ref));return}if(l.mode==="replace-prop"){Y(e,(m)=>Up(m,l.path,l.prop,s.ref));return}for(let[m,i]of o.entries()){let f={fragment:E(i),type:"block"};if(r)Eb(e,{type:r.instruction},f,te(r,m));else Eb(e,{type:"make-child"},f,[])}}var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSitePanel",$description:"The Site panel (specs/studio.md §5.7): the project as an author thinks of it, pages by address and then the parts pages are made of. Four sections under a header holding one filter and a + that opens Add new (`file.new`, §9.1.1). `panels/site-panel.ts` keeps every decision: which files are pages, the route order and nesting (`panels/site-model.ts`, over `@jxsuite/site/routes`), how many entries a collection has and how many pages use a template, which media the project holds (the Media section is a short strip of the first few, and the rest are one click away in Media), what a click opens and what a drag inserts. This document draws rows whose every field is already a string, and a section state that is one of loading, empty, nomatch or listed, so a section a filter empties keeps its heading and says why. Component previews are an island the flow fills, and the drag sources are registered by the adapter through `onNodeCreated`.",tagName:"div",attributes:{part:"site"},style:{$description:"The Site panel's own look, keyed on `part`. Rows are native buttons, because a row opens one thing and a button is the element that says so to every reader; the selected row is the one whose `data-selected` is true, which the flow sets from the focused pane's document. A collection heading is not a button: it opens nothing in Design, and its pages are the buttons under it, indented one step. Component cards and media thumbnails are drag sources as well as buttons; the adapter registers the drags through `onNodeCreated`, so nothing here names a drag.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="filter"]':{flex:"1",minWidth:"0"},'& [part="sections"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-1) 0 var(--jx-space-4)"},'& [part="section"]':{padding:"var(--jx-space-2) 0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3) var(--jx-space-1)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="section-count"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="open-media"]':{marginLeft:"auto"},'& [part="no-project"]':{margin:"0",padding:"var(--jx-space-6) var(--jx-space-4)",textAlign:"center",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0",padding:"var(--jx-space-1) var(--jx-space-3)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column"},'& [part="page-row"], & [part="template-row"], & [part="collection-row"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",width:"100%",boxSizing:"border-box",minHeight:"26px",padding:"var(--jx-space-1) var(--jx-space-3)",border:"none",background:"transparent",color:"inherit",font:"inherit",textAlign:"start"},'& [part="page-row"], & [part="template-row"]':{cursor:"pointer",":hover":{background:"var(--hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="page-row"][data-nested="true"]':{paddingLeft:"calc(var(--jx-space-3) + var(--jx-space-4))"},'& [data-selected="true"]':{background:"var(--accent-15)",color:"var(--fg)"},'& [part="collection-row"]':{color:"var(--fg-dim)"},'& [part="row-label"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-detail"]':{flexShrink:"0",maxWidth:"55%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="cards"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3)"},'& [part="component-card"]':{display:"flex",flexDirection:"column",width:"100%",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)",color:"inherit",font:"inherit",cursor:"grab",":hover":{borderColor:"var(--fg-dim)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="card-preview"]':{$description:"A live render on the light document surface the Insert panel's element cards use (`--canvas-*` does not follow the theme, because what is drawn here is a page's part, and a site's dark text on the dark chrome read as an empty black box). It is drawn at half size, so a component laid out for a page shows its face rather than a clipped corner of one oversized glyph. The render is in the island's own shadow root (`mountPreview` in `browse/library-preview.ts`), so no rule here can reach its elements: the half size is the island's `zoom`, which lays the render out twice as wide and draws it at half, and the 128px height is the 64px box at that zoom. The broken-image rule went into the root with it.",position:"relative",height:"128px",zoom:"0.5",overflow:"hidden",pointerEvents:"none",background:"white",color:"var(--canvas-fg-2)",fontSize:"var(--jx-text-md)"},'& [part="card-label"]':{padding:"var(--jx-space-1) var(--jx-space-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-sm)",textAlign:"start"},'& [part="thumbs"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(56px, 1fr))",gap:"var(--jx-space-1)",padding:"0 var(--jx-space-3)"},'& [part="media-strip"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="media-more"]':{alignSelf:"flex-start",marginInline:"var(--jx-space-3)"},'& [part="media-thumb"]':{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",aspectRatio:"1",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-sm)",background:"var(--bg-panel)",color:"var(--fg-dim)",font:"inherit",cursor:"grab",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="thumb-image"]':{width:"100%",height:"100%",objectFit:"cover"},'& [part="thumb-name"]':{padding:"var(--jx-space-1)",overflow:"hidden",fontSize:"var(--jx-text-xs)",wordBreak:"break-all"}},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:"Filter the site",placeholder:"Filter the site…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"add"},$props:{size:"sm",icon:"plus",label:"Add new",hint:"Add new",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/add"},value:[]}]}}]},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{none:{tagName:"p",attributes:{part:"no-project"},textContent:"Open a project to see its pages, templates, components and media."},project:{tagName:"div",attributes:{part:"sections"},children:[{tagName:"section",attributes:{part:"section","data-section":"pages","aria-labelledby":"site-section-pages"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-pages"},textContent:"Pages"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.pagesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/pagesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No pages yet. Add one with +."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/pages"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"page-item",role:"listitem","data-kind":"${$map.item.kind}"},$switch:{$ref:"$map/item/kind"},cases:{collection:{tagName:"div",attributes:{part:"collection-row"},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},page:{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},"entry-page":{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}","data-nested":"true"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}}}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"templates","aria-labelledby":"site-section-templates"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-templates"},textContent:"Templates"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.templatesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/templatesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No templates in layouts/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/templates"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"template-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"template-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"components","aria-labelledby":"site-section-components"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-components"},textContent:"Components"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.componentsCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/componentsState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No components yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"cards",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/components"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"component-card",type:"button","data-tag":"${$map.item.tagName}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.hint}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openComponent"},value:[{$ref:"$map/item/tagName"}]}]},children:[{$description:'The preview ISLAND: empty here, filled by the flow with the component rendered live from the Library\'s preview cache as the card scrolls into view (specs/studio-ui-guidelines.md §9.4). It is `inert`, not merely `aria-hidden`: a component\'s own links and buttons stay focusable under `aria-hidden`, and Chrome then counts their text into the card\'s name ("Contact Us Today Eer cta", "◀ ▶ Eer reviews"). Inert takes the render out of the accessibility tree, the tab order and the pointer at once, so the card is named by its label alone.',tagName:"div",attributes:{part:"card-preview",inert:""}},{tagName:"span",attributes:{part:"card-label"},textContent:"${$map.item.label}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"media","aria-labelledby":"site-section-media"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-media"},textContent:"Media"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.mediaCount}"},{tagName:"jx-button",attributes:{part:"open-media"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"Open Media"}]}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mediaState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No media in public/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"media-strip"},children:[{tagName:"div",attributes:{part:"thumbs",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/media"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"thumb-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"media-thumb",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"Open ${$map.item.name} in Media, or drag it onto the canvas","aria-label":"${$map.item.name}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumb"},cases:{image:{tagName:"img",attributes:{part:"thumb-image",src:"${$map.item.src}",alt:"",loading:"lazy",draggable:"false"}},file:{tagName:"span",attributes:{part:"thumb-name"},textContent:"${$map.item.name}"}}}]}]}}]},{tagName:"jx-button",attributes:{part:"media-more",hidden:"${state.mediaMore === '' ? '' : null}"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"${state.mediaMore}"}]}]}}}]}]}}}]};T("site-panel",O);function A(){return{body:"none",components:[],componentsCount:"",componentsState:"loading",filter:"",media:[],mediaCount:"",mediaMore:"",mediaState:"loading",pages:[],pagesCount:"",pagesState:"loading",templates:[],templatesCount:"",templatesState:"loading"}}function z(e,t){e.body=t.body,e.filter=t.filter,e.pages=t.pages,e.pagesState=t.pagesState,e.pagesCount=t.pagesCount,e.templates=t.templates,e.templatesState=t.templatesState,e.templatesCount=t.templatesCount,e.components=t.components,e.componentsState=t.componentsState,e.componentsCount=t.componentsCount,e.media=t.media,e.mediaState=t.mediaState,e.mediaCount=t.mediaCount,e.mediaMore=t.mediaMore}function ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function re(e){let t=e?.$map,a=v(t)?t.item:void 0;return v(a)?a:null}function I(e,t){let a=re(e)?.[t];return n(a)?a:""}function J(e,t,a,r){let o=g({...A(),...a});z(o,t);let s=null,l=!1,m=R("site-panel",o,e,{onNodeCreated:(i,f,P,h)=>{if(l||!(i instanceof HTMLElement))return;switch(ne(P)){case"card-preview":{let d=I(h,"tagName");if(d!=="")r.preview(i,d);break}case"component-card":{let d=I(h,"tagName");if(d!=="")r.componentSource(i,d);break}case"media-thumb":{let d=I(h,"path");if(d!=="")r.mediaSource(i,d);break}default:break}}}).then((i)=>{if(l)return i.dispose(),i;return s=i,i});return{connected:()=>!l&&(s===null||s.root.parentNode===e),dispose(){l=!0,s?.dispose(),s=null},ready:m,update:(i)=>{z(o,i)}}}var N=null,F=!1,x=null,b=0;function ie(){return Object.keys(S?.projectConfig?.content??{})}async function oe(e){return(await JT(e)).contentType}async function se(e){let[t,a]=await Promise.all([sm(["pages","layouts"],p()),Sv()]),r=t.files.filter((i)=>i.path.startsWith("pages/")),o=await Promise.all(r.map(async(i)=>({contentType:i.path.includes("[")?await oe(i.path):null,path:i.path})));if(e!==b)return;let s=N?.collections,l=new Map(ie().map((i)=>[i,s?.get(i)??null]));F=!1,N={collections:l,layouts:t.files.flatMap((i)=>i.path.startsWith("layouts/")?[i.path]:[]),pageExtensions:a,pages:o},C();let m=new Set(o.flatMap((i)=>i.contentType&&l.has(i.contentType)?[i.contentType]:[]));if(await Promise.all([...m].map(async(i)=>{let f=await mb(i).catch(()=>null);if(e===b&&f)l.set(i,f.length)})),e===b)C()}function pe(){if((!N||F)&&!x&&_e()&&S){let e=b;x=se(e).finally(()=>{if(e===b)x=null})}return N}function Vg(e){if(b+=1,F=!0,x=null,e===void 0||e.some((t)=>me(t)))D=!0;if(c)C()}var ce=["pages/","layouts/","content/","public/"];function me(e){if(e.startsWith("components/"))return!0;return e.endsWith(".json")&&e!=="project.json"&&!ce.some((t)=>e.startsWith(t))}var D=!1,M=!1;function de(){if(M||Gw&&!D||!_e())return;M=!0,D=!1,xa().finally(()=>{M=!1,C()})}function _(e,t){return Ne.flatMap((a)=>{let r=kd(a.tagName),o=`<${a.tagName}>`,s=L(a);if(!qg(e,a.tagName,s??"",a.package??""))return[];return[{hint:s?`Open ${o}, or drag it onto the canvas`:`${o} from ${a.package??"a package"}: open Packages, or drag it onto the canvas`,key:a.tagName,label:r,path:s??"",selected:jy(s!==null&&s===t),tagName:a.tagName}]})}function L(e){return e?.path!==void 0&&e.source!=="npm"?e.path:null}var V=8;function ue(e,t){return e>t?`Show all ${e} in Media`:""}function W(e,t,a){return e.flatMap((r)=>qg(t,r.name,r.file)?[{key:r.file,name:r.name,path:r.file,selected:jy(r.file===a),src:r.isImage?or(r.file):"",thumb:r.isImage?"image":"file"}]:[])}function ge(){let e=S?.projectConfig?.defaults?.layout;return n(e)?e.replace(/^\.\//,""):null}var w="";function j(e,t,a){if(e)return"loading";if(t===0)return"empty";return a===0?"nomatch":"listed"}function k(e,t,a){if(a||e===0)return"";return t===e?String(e):`${t} of ${e}`}function B(){if(!S)return{...A(),filter:w};let e=VR(w),t=u.value?.documentPath??null,a=pe();de();let r=Vu(),o=a?UR(a.pages,a.collections,t,{extensions:a.pageExtensions,i18n:ln(S.projectConfig??{}).i18n}):[],s=qR(o,e),l=ge(),m=a?Vk(a.layouts,t,"",l):[],i=a?Vk(a.layouts,t,e,l):[],f=!Gw,P=_("",t),h=_(e,t),d=r?W(r,"",t):[],y=r?W(r,e,t):[],H=(K)=>K.filter((Q)=>Q.kind!=="collection").length;return{body:"project",components:h,componentsCount:k(P.length,h.length,f),componentsState:j(f,P.length,h.length),filter:w,media:y.slice(0,V),mediaCount:k(d.length,y.length,r===null),mediaMore:ue(y.length,Math.min(y.length,V)),mediaState:j(r===null,d.length,y.length),pages:s,pagesCount:k(H(o),H(s),a===null),pagesState:j(a===null,o.length,s.length),templates:i,templatesCount:k(m.length,i.length,a===null),templatesState:j(a===null,m.length,i.length)}}function U(e){(le("ybpp3j38"),import("./files-ybpp3j38.js")).then(({openFileInTab:t})=>t(e))}var fe={add:()=>{rt("file.new",{},"Site panel")},open:U,openComponent:(e)=>{let t=Ne.find((r)=>r.tagName===e);if(!t)return;let a=L(t);if(a){U(a);return}rt("view.setActivity",{tab:"packages"},"Site panel")},openMedia:()=>{rt("view.setWorkspace",{workspace:"media"},"Site panel")},setFilter:(e)=>{w=e,C()}},c=null;async function he(e,t,a){let r=await ww(a,e.cache);if(r&&c===e&&t.isConnected&&!By(t))Hy(t,r)}function q(e,t,a){let r=Vr({element:t,getInitialData:()=>a()??{},onGenerateDragPreview:({nativeSetDragImage:o})=>{il({nativeSetDragImage:o})}});e.sources.set(t,r)}function be(e){for(let[t,a]of e.sources)if(!t.isConnected)a(),e.sources.delete(t);e.observer.releaseDetached()}function G(e){e.handle?.dispose();for(let t of e.sources.values())t();e.sources.clear(),e.observer.destroy(),e.cache.clear()}function ye(e){let t=Ne.find((a)=>a.tagName===e);return t?{fragment:jc(t),type:"block"}:null}function ve(e){let t=Vu()?.find((r)=>r.file===e);if(!t)return null;return{fragment:E({kind:Vc({name:t.name}),name:t.name,path:t.file,ref:t.ref}),type:"block"}}function xe(e){if(c&&(c.host!==e||c.handle?.connected()===!1))G(c),c=null;if(c){c.handle?.update(B()),be(c);return}let t=new Map,a={cache:yw(),handle:null,host:e,observer:bp((r)=>{let o=r instanceof HTMLElement?t.get(r):void 0;if(o!==void 0&&r instanceof HTMLElement)t.delete(r),he(a,r,o)}),pending:t,sources:new Map};c=a,a.handle=J(e,B(),fe,{componentSource:(r,o)=>{q(a,r,()=>ye(o))},mediaSource:(r,o)=>{q(a,r,()=>ve(o))},preview:(r,o)=>{let s=L(Ne.find((l)=>l.tagName===o));if(s)t.set(r,s),a.observer.observe(r)}})}function C(){xn("leftPanel")}function we(e){return e.querySelector(".panel-content")??e}function zR(){Zn({id:"site",title:"Site",level:"project",dock:"navigator",icon:"browser",render:()=>mt,afterRender:(e,t)=>{xe(we(t))}})}function WR(){if(c)G(c);c=null,w="",b+=1,N=null,F=!1,x=null,D=!0,M=!1}
2
+ export{BR,Vg,zR,WR};
3
+
4
+ //# debugId=D1A33BDB1908DB0364756E2164756E21
5
+ //# sourceMappingURL=studio-25a5by3h.js.map
@@ -2,7 +2,7 @@ var C=globalThis,O=(t)=>t,b=C.trustedTypes,j=b?b.createPolicy("lit-html",{create
2
2
  \f\r](?:([^\\s"'>=/]+)([
3
3
  \f\r]*=[
4
4
  \f\r]*(?:[^
5
- \f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),qr=E(1),J=E(2),K=E(3),Jc=Symbol.for("lit-noChange"),mt=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===Jc)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=mt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===mt||t==null||t===""?(this._$AH!==mt&&this._$AR(),this._$AH=mt):t!==this._$AH&&t!==Jc&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==mt&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=mt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=mt}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==Jc,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===Jc&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===mt?t=mt:t!==mt&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===mt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===mt?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==mt)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??mt)===Jc)return;let s=this._$AH,i=t===mt&&s!==mt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==mt&&(s===mt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var x$={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var io=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{qr,Jc,mt,x$,io};
5
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),Ur=E(1),J=E(2),K=E(3),qc=Symbol.for("lit-noChange"),mt=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===qc)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=mt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===mt||t==null||t===""?(this._$AH!==mt&&this._$AR(),this._$AH=mt):t!==this._$AH&&t!==qc&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==mt&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=mt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=mt}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==qc,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===qc&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===mt?t=mt:t!==mt&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===mt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===mt?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==mt)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??mt)===qc)return;let s=this._$AH,i=t===mt&&s!==mt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==mt&&(s===mt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var m$={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var no=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{Ur,qc,mt,m$,no};
6
6
 
7
- //# debugId=4CB94F161314B0FA64756E2164756E21
8
- //# sourceMappingURL=studio-k3xxbagr.js.map
7
+ //# debugId=0174B5162447AD9C64756E2164756E21
8
+ //# sourceMappingURL=studio-2b8443ms.js.map