@jxsuite/studio 5.5.0 → 5.7.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 (244) hide show
  1. package/LICENSE +1 -1
  2. package/dist/chunks/{2020-g8mwpbkq.js → 2020-cs2sb9t1.js} +3 -3
  3. package/dist/chunks/adapter-y5gdq19c.js +4 -0
  4. package/dist/chunks/cf-account-picker-882a7ecm.js +4 -0
  5. package/dist/chunks/cf-settings-20dznc3j.js +4 -0
  6. package/dist/chunks/components-q037dya7.js +4 -0
  7. package/dist/chunks/content-source-37x3vsap.js +4 -0
  8. package/dist/chunks/convert-to-repeater-grfep2w8.js +4 -0
  9. package/dist/chunks/editor-j5sq149q.js +4 -0
  10. package/dist/chunks/entry-commands-c5h3nqck.js +4 -0
  11. package/dist/chunks/extension-sections-dp8endhx.js +4 -0
  12. package/dist/chunks/file-ops-937cvqk6.js +4 -0
  13. package/dist/chunks/files-tznwe1p1.js +4 -0
  14. package/dist/chunks/format-host-e2pjvd25.js +4 -0
  15. package/dist/chunks/fs-events-fv64ak3s.js +4 -0
  16. package/dist/chunks/git-panel-gb713ttc.js +4 -0
  17. package/dist/chunks/grid-view-5amhg604.js +51 -0
  18. package/dist/chunks/grid-view-5mqv1cbd.css +1 -0
  19. package/dist/chunks/iframe-host-t819mcg5.js +4 -0
  20. package/dist/chunks/{index-arg188jq.js → index-9ydfe04y.js} +3 -3
  21. package/dist/chunks/index-m0x5ztax.js +4 -0
  22. package/dist/chunks/{javascript-zcdmye2k.js → javascript-d9pqgc2p.js} +2 -2
  23. package/dist/chunks/{jsonMode-6x5e1nbf.js → jsonMode-800yvbem.js} +5 -5
  24. package/dist/chunks/jx-validate-zc9zp77s.js +4 -0
  25. package/dist/chunks/layers-4bsr82wz.js +4 -0
  26. package/dist/chunks/layers-panel-b6shnaax.js +4 -0
  27. package/dist/chunks/lit-html-cfn61dn7.js +4 -0
  28. package/dist/chunks/media-picker-ej0kdh1j.js +4 -0
  29. package/dist/chunks/menu-rtxf9chb.js +4 -0
  30. package/dist/chunks/{monaco-binding-4az2kh5p.js → monaco-binding-62dtmgbf.js} +3 -3
  31. package/dist/chunks/monaco-buffer-nn4dtx27.js +4 -0
  32. package/dist/chunks/{monaco-setup-d7mwkcx3.js → monaco-setup-tj13ndtm.js} +3 -3
  33. package/dist/chunks/notify-ahs57a2z.js +4 -0
  34. package/dist/chunks/platform-v9xyfkbx.js +4 -0
  35. package/dist/chunks/publish-panel-bq36xcmj.js +4 -0
  36. package/dist/chunks/quick-search-zm00h9dh.js +4 -0
  37. package/dist/chunks/references-99ws0b0m.js +4 -0
  38. package/dist/chunks/right-panel-pq2f71q3.js +4 -0
  39. package/dist/chunks/section-registry-b2yzp9sw.js +4 -0
  40. package/dist/chunks/studio-01kbbqg3.js +928 -0
  41. package/dist/chunks/{studio-hf4qdjc8.js → studio-01qza1n3.js} +4 -4
  42. package/dist/chunks/{studio-pkkw32j0.js → studio-03wwfvyt.js} +4 -4
  43. package/dist/chunks/{studio-7gqyhjns.js → studio-0bbxhhce.js} +4 -4
  44. package/dist/chunks/studio-0k9mvpgj.js +14 -0
  45. package/dist/chunks/studio-0scebvb9.js +6 -0
  46. package/dist/chunks/studio-1a99w39s.js +5 -0
  47. package/dist/chunks/studio-1wvfxkyy.js +5 -0
  48. package/dist/chunks/studio-1x8x26k3.js +5 -0
  49. package/dist/chunks/studio-222rqyyc.js +5 -0
  50. package/dist/chunks/studio-4xppwncr.js +4 -0
  51. package/dist/chunks/{studio-xcng8nx7.js → studio-54g077x3.js} +5 -5
  52. package/dist/chunks/studio-56z7evx4.js +10 -0
  53. package/dist/chunks/studio-5e9zsamh.js +9 -0
  54. package/dist/chunks/studio-65fhspdd.js +5 -0
  55. package/dist/chunks/studio-693nhyky.js +5 -0
  56. package/dist/chunks/{studio-7jazdy6y.js → studio-7pgy3xaf.js} +4 -4
  57. package/dist/chunks/studio-888knnkc.js +5 -0
  58. package/dist/chunks/studio-9mqfamps.js +5 -0
  59. package/dist/chunks/studio-a7xqhc3n.js +5 -0
  60. package/dist/chunks/studio-aje966s9.js +5 -0
  61. package/dist/chunks/studio-aqmph6k4.js +5 -0
  62. package/dist/chunks/studio-c6w3tq7t.js +5 -0
  63. package/dist/chunks/{studio-6j2jn55a.js → studio-c6zdm25z.js} +8 -8
  64. package/dist/chunks/{studio-f8jyp45j.js → studio-c9d3pxf7.js} +4 -4
  65. package/dist/chunks/studio-ceb34dxj.js +5 -0
  66. package/dist/chunks/studio-cvbkkfqb.js +5 -0
  67. package/dist/chunks/studio-cxt150pj.js +7 -0
  68. package/dist/chunks/studio-dkn3x3hz.js +5 -0
  69. package/dist/chunks/studio-e6re3rk1.js +5 -0
  70. package/dist/chunks/{studio-5n1km79v.js → studio-edbtvcd1.js} +4 -4
  71. package/dist/chunks/{studio-xc8ebsts.js → studio-eh0rac07.js} +4 -4
  72. package/dist/chunks/{studio-625ezz59.js → studio-evwgp1ym.js} +4 -4
  73. package/dist/chunks/{studio-he2fhrgp.js → studio-f195h2hq.js} +4 -4
  74. package/dist/chunks/studio-fqq890ap.js +4 -0
  75. package/dist/chunks/studio-frb0qbf7.js +6 -0
  76. package/dist/chunks/studio-gfn1kpxj.js +6 -0
  77. package/dist/chunks/studio-gh97gngt.js +5 -0
  78. package/dist/chunks/{studio-awqghqxv.js → studio-gp02nqnw.js} +4 -4
  79. package/dist/chunks/{studio-x9sagq2d.js → studio-hjbg8d5y.js} +7 -7
  80. package/dist/chunks/studio-j6gnhvaa.js +5 -0
  81. package/dist/chunks/studio-mwxgyn9h.js +7 -0
  82. package/dist/chunks/{studio-x5esgzct.js → studio-n78gjfy8.js} +4 -4
  83. package/dist/chunks/studio-nbxqcgvf.js +5 -0
  84. package/dist/chunks/{studio-p1eggxcf.js → studio-nt06yybj.js} +4 -4
  85. package/dist/chunks/{studio-hc9q4j24.js → studio-p7c1agz0.js} +5 -5
  86. package/dist/chunks/{studio-8r4y2x0z.js → studio-pwqfmt4p.js} +4 -4
  87. package/dist/chunks/{studio-5wfrgee9.js → studio-r3kaka4d.js} +4 -4
  88. package/dist/chunks/studio-semd1s8s.js +5 -0
  89. package/dist/chunks/studio-skzanb0k.js +5 -0
  90. package/dist/chunks/studio-spf2skgc.js +5 -0
  91. package/dist/chunks/{studio-b4epb26c.js → studio-st75kn99.js} +7 -7
  92. package/dist/chunks/{studio-eq27rrr0.js → studio-sxc0zvpt.js} +3 -3
  93. package/dist/chunks/studio-t1eedsyx.js +4 -0
  94. package/dist/chunks/{studio-73czgk6a.js → studio-tp642n5g.js} +4 -4
  95. package/dist/chunks/studio-tw7rre6s.js +5 -0
  96. package/dist/chunks/{studio-7by9a93k.js → studio-tzegmy4w.js} +4 -4
  97. package/dist/chunks/studio-vavmwshr.js +5 -0
  98. package/dist/chunks/studio-wma2c6g8.js +5 -0
  99. package/dist/chunks/studio-x92tgnee.js +64 -0
  100. package/dist/chunks/studio-xk0z6msk.js +5 -0
  101. package/dist/chunks/{studio-c4pnt1c6.js → studio-xry7tk3z.js} +5 -5
  102. package/dist/chunks/studio-xta2vxp6.js +9 -0
  103. package/dist/chunks/{studio-21enxdr8.js → studio-xy3tv3az.js} +4 -4
  104. package/dist/chunks/studio-y7jehjrp.js +5 -0
  105. package/dist/chunks/{studio-k1eaqyzm.js → studio-yr04mv2j.js} +4 -4
  106. package/dist/chunks/{studio-mhhc9btt.js → studio-zd4kayn2.js} +4 -4
  107. package/dist/chunks/studio-zpnk016a.js +16 -0
  108. package/dist/chunks/{tsMode-rtwt7w1a.js → tsMode-k9s9fcag.js} +5 -5
  109. package/dist/chunks/workspace-b69mgm0e.js +4 -0
  110. package/dist/chunks/ws-client-0ja08haa.js +4 -0
  111. package/dist/iframe-entry.js +14 -14
  112. package/dist/manifest.json +62 -59
  113. package/dist/studio.css +1 -1
  114. package/dist/studio.js +121 -123
  115. package/package.json +5 -5
  116. package/src/account/action-flow.ts +294 -0
  117. package/src/account/action-required.ts +68 -0
  118. package/src/account-status.ts +29 -1
  119. package/src/browse/library-model.ts +3 -1
  120. package/src/browse/library-preview.ts +6 -2
  121. package/src/canvas/asset-refs.ts +3 -1
  122. package/src/canvas/asset-resolve.ts +79 -1
  123. package/src/canvas/iframe-entry.ts +38 -1
  124. package/src/canvas/iframe-host.ts +85 -0
  125. package/src/canvas/iframe-protocol.ts +13 -0
  126. package/src/canvas/stage-scrollbar.ts +7 -7
  127. package/src/files/asset-versions.ts +294 -0
  128. package/src/files/file-ops.ts +5 -8
  129. package/src/files/files.ts +61 -9
  130. package/src/files/fs-events.ts +279 -28
  131. package/src/files/media-meta.ts +2 -1
  132. package/src/files/media-paths.ts +5 -2
  133. package/src/files/media-upload.ts +5 -1
  134. package/src/new-project/add-repo-modal.ts +12 -1
  135. package/src/new-project/new-project-modal.ts +12 -1
  136. package/src/panels/git-panel.ts +25 -2
  137. package/src/panels/jump-bar.ts +132 -158
  138. package/src/panels/pane-context.ts +8 -8
  139. package/src/panels/pane-grid.ts +18 -26
  140. package/src/panels/style-panel.ts +2 -2
  141. package/src/platform-errors.ts +61 -1
  142. package/src/platforms/cloud.ts +389 -50
  143. package/src/platforms/devserver.ts +17 -1
  144. package/src/publish/pages-service.ts +17 -7
  145. package/src/services/ai-models.ts +30 -6
  146. package/src/services/ai-system-prompt.ts +81 -51
  147. package/src/services/context-manager.ts +41 -70
  148. package/src/services/document-assistant.ts +12 -3
  149. package/src/services/harness/chat-reducer.ts +115 -0
  150. package/src/services/harness/turn-hooks.ts +50 -0
  151. package/src/services/tool-executor.ts +69 -288
  152. package/src/services/tool-outcomes.ts +12 -10
  153. package/src/settings/preferences-accounts.ts +42 -3
  154. package/src/settings/preferences-dialog.ts +8 -1
  155. package/src/studio.ts +20 -6
  156. package/src/surfaces/block-action-bar.json +6 -1
  157. package/src/surfaces/dialog.ts +5 -0
  158. package/src/surfaces/jump-bar.json +9 -12
  159. package/src/surfaces/jump-bar.ts +15 -16
  160. package/src/surfaces/pane-context.json +2 -2
  161. package/src/surfaces/pane-grid.json +8 -25
  162. package/src/surfaces/pane-grid.ts +7 -8
  163. package/src/surfaces/statusbar.json +71 -3
  164. package/src/surfaces/statusbar.ts +66 -139
  165. package/src/surfaces/style-panel.json +3 -3
  166. package/src/surfaces/style-panel.ts +11 -1
  167. package/src/surfaces/welcome.json +86 -1
  168. package/src/surfaces/welcome.ts +61 -2
  169. package/src/types.ts +84 -2
  170. package/src/ui/ai-managed-connect.ts +41 -4
  171. package/src/ui/media-picker.ts +2 -1
  172. package/dist/chunks/adapter-bsbs78x9.js +0 -4
  173. package/dist/chunks/cf-account-picker-gnm7xeqb.js +0 -4
  174. package/dist/chunks/cf-settings-9y6jyscp.js +0 -4
  175. package/dist/chunks/components-s51h3b7c.js +0 -4
  176. package/dist/chunks/content-source-ty3be0qg.js +0 -4
  177. package/dist/chunks/convert-to-repeater-c3e7q61z.js +0 -4
  178. package/dist/chunks/editor-t002b41m.js +0 -4
  179. package/dist/chunks/entry-commands-sb72e9gy.js +0 -4
  180. package/dist/chunks/extension-sections-ktn2ntnj.js +0 -4
  181. package/dist/chunks/file-ops-78zeytkm.js +0 -4
  182. package/dist/chunks/files-gatzrz8v.js +0 -4
  183. package/dist/chunks/format-host-r59b1651.js +0 -4
  184. package/dist/chunks/fs-events-f8h91ndt.js +0 -4
  185. package/dist/chunks/git-panel-y12zf7nj.js +0 -4
  186. package/dist/chunks/grid-view-rfd8b2pg.js +0 -51
  187. package/dist/chunks/grid-view-tafenfm2.css +0 -1
  188. package/dist/chunks/iframe-host-vsrsj20g.js +0 -4
  189. package/dist/chunks/index-5aghyrfh.js +0 -4
  190. package/dist/chunks/jx-validate-653krkrf.js +0 -4
  191. package/dist/chunks/layers-32p8gtae.js +0 -4
  192. package/dist/chunks/layers-panel-rs58m105.js +0 -4
  193. package/dist/chunks/lit-html-54bmkwz3.js +0 -4
  194. package/dist/chunks/media-picker-5bb04wct.js +0 -4
  195. package/dist/chunks/menu-cbha7w2e.js +0 -4
  196. package/dist/chunks/monaco-buffer-9vbbyfr1.js +0 -4
  197. package/dist/chunks/notify-dc1nz5ar.js +0 -4
  198. package/dist/chunks/platform-2m49s1zf.js +0 -4
  199. package/dist/chunks/publish-panel-nx3ycmma.js +0 -4
  200. package/dist/chunks/quick-search-yzrzh9x3.js +0 -4
  201. package/dist/chunks/references-vx7mbj9f.js +0 -4
  202. package/dist/chunks/right-panel-7jzpbxja.js +0 -4
  203. package/dist/chunks/section-registry-gjryse41.js +0 -4
  204. package/dist/chunks/studio-3znfhcxg.js +0 -5
  205. package/dist/chunks/studio-58qam27v.js +0 -4
  206. package/dist/chunks/studio-6j59fwaw.js +0 -5
  207. package/dist/chunks/studio-7z69g1gx.js +0 -5
  208. package/dist/chunks/studio-93j3v6zx.js +0 -5
  209. package/dist/chunks/studio-9gf6v8zy.js +0 -5
  210. package/dist/chunks/studio-9rhmettf.js +0 -4
  211. package/dist/chunks/studio-ac5aq677.js +0 -10
  212. package/dist/chunks/studio-as65vbns.js +0 -5
  213. package/dist/chunks/studio-bkv0sga4.js +0 -6
  214. package/dist/chunks/studio-bttmqef4.js +0 -5
  215. package/dist/chunks/studio-c3y9d41k.js +0 -5
  216. package/dist/chunks/studio-ccegp7gz.js +0 -9
  217. package/dist/chunks/studio-chxabn98.js +0 -6
  218. package/dist/chunks/studio-cktcdsxz.js +0 -16
  219. package/dist/chunks/studio-cnspfke5.js +0 -5
  220. package/dist/chunks/studio-de3p1ktm.js +0 -5
  221. package/dist/chunks/studio-fsbcn530.js +0 -928
  222. package/dist/chunks/studio-gftga7a3.js +0 -64
  223. package/dist/chunks/studio-hf1rpcq0.js +0 -4
  224. package/dist/chunks/studio-hz02hq70.js +0 -5
  225. package/dist/chunks/studio-jnb285we.js +0 -5
  226. package/dist/chunks/studio-jsv3s3s1.js +0 -5
  227. package/dist/chunks/studio-ks7cksh0.js +0 -5
  228. package/dist/chunks/studio-nptx0dbs.js +0 -5
  229. package/dist/chunks/studio-pg0z7k98.js +0 -5
  230. package/dist/chunks/studio-pve0b2f2.js +0 -5
  231. package/dist/chunks/studio-q7zmjv3b.js +0 -6
  232. package/dist/chunks/studio-rpmvw7kj.js +0 -5
  233. package/dist/chunks/studio-rwhss52s.js +0 -5
  234. package/dist/chunks/studio-sbg3g3h0.js +0 -5
  235. package/dist/chunks/studio-sq1bn60g.js +0 -14
  236. package/dist/chunks/studio-vwz7rma2.js +0 -5
  237. package/dist/chunks/studio-wa55e8gf.js +0 -5
  238. package/dist/chunks/studio-x0mzdha2.js +0 -5
  239. package/dist/chunks/studio-xrgpakvc.js +0 -9
  240. package/dist/chunks/studio-xt3djk1w.js +0 -7
  241. package/dist/chunks/studio-yh3nggx1.js +0 -7
  242. package/dist/chunks/studio-zmecp6hq.js +0 -5
  243. package/dist/chunks/workspace-g6dvaete.js +0 -4
  244. package/dist/chunks/ws-client-shf41j5p.js +0 -4
@@ -0,0 +1,5 @@
1
+ import{tt}from"./studio-sxc0zvpt.js";import{te}from"./studio-ery42sqr.js";import{hk,p,We}from"./studio-y7jehjrp.js";import{Zt}from"./studio-1x8x26k3.js";import{ge,Q,v,Mo,k}from"./studio-fqq890ap.js";import{xn,KC,m,u,No,ci}from"./studio-cvbkkfqb.js";import{Gi,hm,up,Id,Bu}from"./studio-c6w3tq7t.js";import{un,rn}from"./studio-0k9mvpgj.js";import{y}from"./studio-zpnk016a.js";import{rt,Zi,zt,T,R,An,Ct,Xo,Nn,gk}from"./studio-spf2skgc.js";import{qn}from"./studio-xry7tk3z.js";import{Cw}from"./studio-54g077x3.js";import{aa,qE,la,KE,Cb,JE}from"./studio-xta2vxp6.js";import{aC,lC,lm}from"./studio-ceb34dxj.js";import{gE}from"./studio-aqmph6k4.js";import{sb,vE,ab,m1}from"./studio-xk0z6msk.js";import{oI,D,aI,Oo}from"./studio-tp642n5g.js";import{Oe}from"./studio-vavmwshr.js";import{me}from"./studio-0bbxhhce.js";var Y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};T("media-pane",Y);function et(t,e){t.region=e.region,t.name=e.name,t.kind=e.kind,t.src=e.src,t.facts=e.facts,t.ref=e.ref,t.specimen=e.specimen,t.specimenFamily=e.specimenFamily,t.fontFace=e.fontFace,t.extLabel=e.extLabel,t.usageState=e.usageState,t.usageHeadline=e.usageHeadline,t.usageFiles=e.usageFiles,t.hasUsageFiles=e.usageFiles.length>0}function at(t,e,a){t.replaceChildren();let r=v({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});et(r,e);let i=null,o=!1,n=R("media-pane",r,t).then((s)=>{if(o)return s.dispose(),s.root;return i=s,s.root});return{attached:()=>{if(o)return!1;let s=i?.root;return s===void 0?!0:s instanceof HTMLElement&&t.contains(s)},dispose(){o=!0,i?.dispose(),i=null},ready:n,update:(s)=>et(r,s)}}var z="media",Ht=new Set([".woff",".woff2",".ttf",".otf"]),Ot="The quick brown fox jumps over the lazy dog",A=new Map;function H(t){return A.get(t)??null}function s1(t,e){let a=H(t);return a!==null&&a.tabId===e.id&&a.wrap.isConnected&&a.surface.attached()}function rb(t){let e=A.get(t);if(!e)return;e.scope.stop(),e.surface.dispose(),A.delete(t)}function Vt(t){let e=Gi(t);if(Ht.has(e))return"font";let a=up({name:t});if(a==="image"||a==="video"||a==="audio")return a;return e===".pdf"?"embed":"unviewable"}function _t(t,e){let a=[up({name:t})];if(e?.width!=null&&e.height!=null)a.push(`${e.width} × ${e.height}`);if(e?.bytes!=null)a.push(m1(e.bytes));if(e?.modified)a.push(`modified ${e.modified.slice(0,10)}`);return a.join(" · ")}function Jt(t){return`jx-specimen-${t.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function Wt(t){let e=JE(t);if(e===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(t?.status==="ready"?t.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:e,usageState:"shown"}}async function Bt(t){let{openFileInTab:e}=await (me("tznwe1p1"),import("./files-tznwe1p1.js"));await e(t)}function pE(t,e){let{paneId:a,wrap:r}=t;if(s1(a,e))return;rb(a);let i=e.documentPath??"",o=Jt(i),n=Bu(i),s=Id(i),l=Gi(i),c=Vt(i),h=null,g=()=>{if(h!==null&&H(a)===h)f()},x=()=>{let j=sb(i),d=KE(i);if(j===null)vE(i).then(g);if(d===null||d.status==="pending")Cb(i).then(g);return{extLabel:l||"this file",facts:_t(i,j),fontFace:c==="font"?`@font-face { font-family: "${o}"; src: url("${n}"); }`:"",kind:c,name:i.split("/").pop()??"",ref:s,region:Zi(a,"media"),specimen:Ot,specimenFamily:`--jx-specimen-family: "${o}"`,src:n,...Wt(d)}},f=()=>{h?.surface.update(x())},S=ge(),N=at(r,x(),{copyRef:()=>{navigator.clipboard?.writeText(s)},imageLoaded:(j,d)=>{if(ab(i,j,d))g()},openDocument:(j)=>{Bt(j)}});h={paneId:a,scope:S,surface:N,tabId:e.id,wrap:r},A.set(a,h),S.run(()=>{Q(()=>{if(H(a)!==h)return;e.documentPath,f()})})}var qt={children:[],tagName:"div"};function ww(t){return hm(t)}function Kt(t){return Gi(t)===".svg"?[z,"source"]:[z]}function fE(t,e={}){let a=m.tabs.get(t);if(a)return ci(t,{focus:e.focus!==!1}),a;return No({capabilities:{modes:Kt(t)},document:structuredClone(qt),documentPath:t,id:t,sourceFormat:null,...e.paneId!==void 0&&{paneId:e.paneId},...e.preview===!0&&{preview:!0},...e.focus===!1&&{focus:!1}})}var Xt={children:[],tagName:"div"},Yt=new Set(["bunfig.json","jsconfig.json","package-lock.json","package.json","tsconfig.json","wrangler.json"]);function Hf(t){let e=t.slice(t.lastIndexOf("/")+1);if(Yt.has(e)||e.endsWith(".schema.json"))return!1;return t.endsWith(".json")||Boolean(Zt(t))}function it(t,e){if(t.startsWith("../")||t.includes("/../"))return`"${t}" is outside this project, so its comparison belongs to the project that owns it.`;if(e==="R")return"A renamed file's comparison needs both paths, and Studio does not model the old name yet.";if(ww(t))return`"${t}" is an image or media file, and a comparison of one is not text.`;return null}function Qt(){return["git-diff"]}function ee(t){let e=m.tabs.get(t);if(e)return ci(t),e;return No({capabilities:{modes:Qt()},document:structuredClone(Xt),documentPath:t,id:t,sourceFormat:null})}async function ot(t){if(!Hf(t))return ee(t);let e=await (me("tznwe1p1"),import("./files-tznwe1p1.js"));return await e.openFileInTab(t,{})??[...m.tabs.values()].find((r)=>r.documentPath===t)??null}var nt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubPublish",$description:"Create GitHub Repository: the three things the flow needs before it calls the API — the repository's name, an optional description, and whether it is private. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answer buttons. Nothing here reaches GitHub: `github/github-publish.ts` keeps the token, the request and the activity, and this document only collects.",tagName:"jx-dialog",$props:{headline:"Create GitHub Repository",confirmLabel:"Create Repository",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-publish"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'What is NOT here is most of the conversion. `.github-publish-dialog` was a flex column with an 8px gap and `8px 0` of padding: the gap is the one thing it said that nothing else draws, and `jx-dialog`\'s own body already pads the content, so only the gap survives. `.github-publish-dialog sp-textfield { width: 100% }` had nothing to transcribe either — a `jx-field` row is a grid whose control cell stretches, so the field fills the row without being told to. The three `sp-field-label`s are gone with them, because `jx-field` draws the label AND names the control from it; the third of them carried no `for` at all, so "Visibility" was text beside a switch rather than a name for it.','& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"}},children:[{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Repository name"},attributes:{part:"row","data-field":"name"},children:[{tagName:"jx-textfield",$props:{placeholder:"my-project",value:{$ref:"#/state/name"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Description (optional)"},attributes:{part:"row","data-field":"description"},children:[{tagName:"jx-textfield",$props:{placeholder:"A brief description",value:{$ref:"#/state/description"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDescription"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Visibility"},attributes:{part:"row","data-field":"visibility"},children:[{tagName:"div",$description:'The row opens with a plain `div`, and that is the whole reason it exists: `jx-field` names the first thing slotted into it that observes `labelledby`, so a switch slotted straight in would be announced "Visibility" over the top of the words printed beside it. A `div` observes no naming, so the switch keeps the name its own label gives it.',attributes:{part:"visibility-row"},children:[{tagName:"jx-switch",attributes:{part:"toggle"},$props:{checked:{$ref:"#/state/isPrivate"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setPrivate"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Private repository"}]}]}]}]}]};T("github-publish",nt);function st(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("dialog","github-publish")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},i=v({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm({description:i.description,isPrivate:i.isPrivate,name:i.name})},description:"",isPrivate:!0,name:t.name,setDescription:(l)=>{i.description=l},setName:(l)=>{i.name=l},setPrivate:(l)=>{i.isPrivate=l}}),o=null,n=R("github-publish",i,e).then(async(l)=>{o=l;let c=l.root;if(a)return l.dispose(),c;if(await An(c),a)return c;return un(c),c});return{close(){if(a)return;let l=o?.root;if(l instanceof HTMLElement)rn(l);o?.dispose(),o=null,e.remove(),r()},host:e,ready:n}}var M=["Create the repository","Add the remote","Push"];function re(t){return new Promise((e)=>{let a=!1,r=(o)=>{if(a)return;a=!0,e(o)},i=st({layer:Ct("dialog"),name:t,onCancel:()=>{i.close()},onClosed:()=>{r(null)},onConfirm:(o)=>{r({...o,name:o.name||t}),i.close()}})})}async function O({projectName:t}){let e=await Cw();if(!e)return!1;let a=await re(t);if(!a)return!1;let r=aa({source:"Source Control",status:`Creating ${a.name}…`,steps:[...M],title:"Create GitHub repository"});r.step(M[0]);let i=await fetch("https://api.github.com/user/repos",{body:JSON.stringify({auto_init:!1,description:a.description,name:a.name,private:a.isPrivate}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e}`,"Content-Type":"application/json"},method:"POST"}).catch((l)=>(r.log(te(l)),null));if(!i)return r.fail("Could not reach GitHub to create the repository.",{action:"git.createGithubRepository"}),!1;if(!i.ok){let l=await i.json();return r.log(l.errors?.[0]?.message||l.message||`GitHub answered ${i.status}.`),r.fail("Could not create the GitHub repository.",{action:"git.createGithubRepository"}),!1}let o=await i.json();r.log(`Created ${o.html_url}`);let n=p();r.step(M[1]);try{await n.gitAddRemote("origin",o.clone_url)}catch(l){return r.log(te(l)),r.fail("The repository was created, but the remote could not be added.",{action:"panel.focus.git"}),!1}r.step(M[2]);try{await n.gitPush({setUpstream:!0})}catch(l){return r.log(te(l)),r.fail("The repository was created, but the push failed.",{action:"git.push"}),!1}let{refreshGitStatus:s}=await (me("gb713ttc"),import("./git-panel-gb713ttc.js"));return await s(),r.done(o.html_url),k.success(`Repository created: ${o.html_url}`,{key:"github.repo"}),!0}var P=[];function ie(){return We()&&typeof p().listProjects==="function"}async function vw(){if(!ie()){P=[];return}try{P=await p().listProjects?.()??[]}catch{P=[]}}function uE(){return P}function lt(t){P=t}var ct=2,oe=1e4;class pt extends Error{blockedBy;constructor(t,e){super(t.length===0?`Studio did not report ${ct} consecutive quiet frames within ${e}ms`:`Studio was not idle after ${e}ms — blocked by ${t.join("; ")}`);this.name="NotIdleError",this.blockedBy=t}}function dt(){return[{blockers:()=>{let t=aI();return t>0?[`render: ${t} renderer(s) mid-paint`]:[]},name:"render"},{blockers:aC,name:"canvas"},{blockers:()=>{let t=hk();if(t.length===0)return[];return[`platform: ${t.length} in-flight (${[...new Set(t)].join(", ")})`]},name:"platform"},{blockers:gk,name:"overlay"},{blockers:qE,name:"activity"},{blockers:gE,name:"grid"}]}function ne(t=dt()){let e=[];for(let a of t)e.push(...a.blockers());return e}function ut(t={}){let{frames:e=ct,now:a=()=>Date.now(),raf:r=(n)=>{requestAnimationFrame(()=>n())},sources:i=dt(),timeoutMs:o=oe}=t;return new Promise((n,s)=>{let l=a()+o,c=0,h=!1,g=[],x=()=>{if(h)return;let f=ne(i);if(f.length>0)g=f,c=0;else if(c+=1,c>=e){h=!0,n();return}if(a()>=l){h=!0,s(new pt(f.length>0?f:g,o));return}r(x)};r(x)})}var mt=/\.toggle[A-Z]/;function se(t){return t.replace(/\.toggle([A-Z])/,(e,a)=>`.set${a}`)}function ht(t){return!mt.test(t.id)}var le={"file.contextMenu":{disposition:"refused",note:"opening a menu to press an item names a control; the ITEM is the command"},"layers.contextMenu":{disposition:"refused",note:"matched RENDERED TEXT, which R1 of scripts/screenshots/README.md forbids; a row is addressed by its data-jx-path"},"media.browse":{disposition:"command",note:"media.browse, site-architecture.md §9.4"},"project.showWelcome":{disposition:"refused",note:"cold start is a startup profile (?profile=fresh), not an action"},"settings.setSection":{disposition:"refused",note:`mirrored the section registry's LABELS; say settings.open { section: "cssVars" }`},"view.setStatus":{disposition:"refused",note:"the status bar is not staged — if a capture needs a calm shell, the app must BE calm"}},ce={openSettings:'a user opens Settings — run("settings.open")',select:'a user selects a node — run("selection.set", { path })',setActivity:'a user picks a Navigator panel — run("navigator.showPanel", { panel })',setRightTab:'a user picks an Inspector tab — run("inspector.setTab", { tab })',setStatus:"the status bar reports what the app just did; staging it is the one lie the Remote Rule (studio.md §13.5) names outright",setZoom:'a user zooms — run("canvas.setZoom", { zoom })'};function V(t,e){let a=t[e];if(a===void 0)return[];if(!Array.isArray(a))throw TypeError(`seed argument "${e}" must be an array`);return a}function pe(t,e){let a=t[e];if(a===null||typeof a!=="object")throw TypeError(`seed argument "${e}" must be an object`);return a}function de(t,e){let a=t[e];if(a===void 0)return;if(typeof a!=="string")throw TypeError(`seed argument "${e}" must be a string`);return a}function ue(t){return[{boundary:"the assistant's model stream",id:"seed.assistant",run:(e)=>{t.seedAssistantMessages(V(e,"messages"))}},{boundary:"the collaboration websocket (awareness + sync)",id:"seed.collab",run:(e)=>{let a=u.value;if(!a)return;let r=xn(a);r.status="synced",r.active=!0;let i=[];for(let o of V(e,"peers")){let n={...o.state};n.focusedPath??=a.documentPath,i.push({...o,state:n})}r.peers=i,Oo()}},{boundary:"the Cloudflare Pages API",id:"seed.publish",run:(e)=>{let a=de(e,"accountId");t.seedPublishConnected({deployment:pe(e,"deployment"),...a?{accountId:a}:{}})}},{boundary:"the platform's git routes (`gitStatus` / `gitBranches` / `gitLog`)",id:"seed.git",run:(e)=>{y.git.status=e.status??null,y.git.branches=e.branches??null,y.git.logEntries=e.log??null,y.git.loading=!1,y.git.error=null,Oo()}},{boundary:"the platform's recent-projects store (desktop IPC / cloud API)",id:"seed.projectList",run:(e)=>{lt(V(e,"projects")),Oo()}}]}class _ extends Error{id;constructor(t,e){super(`automation refuses "${t}" — ${e}`);this.name="AutomationRefusedError",this.id=t}}function he(t){let e=[];for(let a of t.visible()){if(!ht(a))continue;let r=t.disabledReason(a.id),i={enabled:r===void 0,id:a.id,title:a.title};if(a.args)i.args=a.args;if(r!==void 0)i.requires=r;e.push(i)}return e}function fe(t,e,a){if(a.has(t))return`"${t}" is a seed, not a command — call seed("${t}", …)`;let r=le[t];if(r?.disposition==="refused")return`"${t}" is refused by spec §13.5: ${r.note}`;if(r)return`"${t}" has no command record yet (${r.note}) — __jxAutomation.run projects the registry and nothing else`;let i=e.list().filter((o)=>ht(o)).map((o)=>o.id);return`unknown command "${t}" — the registry declares ${i.length} scriptable id(s)`}function be(t){let e=new Map(ue(t).map((r)=>[r.id,r])),a=new Set(e.keys());return{probe:{commands:()=>he(t.registry),idle:(r={})=>ut(r),pointAt:(r)=>lC(r.path),revealPath:(r)=>lm(r),seeds:()=>[...e.values()].map((r)=>({boundary:r.boundary,id:r.id})),state:()=>t.registry.context()},async run(r,i={}){if(mt.test(r))throw new _(r,`it names a delta against state the caller cannot observe; call "${se(r)}"`);let{registry:o}=t;if(!o.get(r))throw Error(fe(r,o,a));await o.run(r,i)},async seed(r,i={}){let o=r.startsWith("seed.")?r.slice(5):r,n=ce[o];if(n)throw new _(r,`a seed stands in for a remote, never for a user: ${n}`);let s=e.get(r.startsWith("seed.")?r:`seed.${r}`);if(!s)throw Error(`unknown seed "${r}" — declared seeds are ${[...e.keys()].join(", ")}`);await s.run(i)}}}function ib(t){return new URLSearchParams(t).get("automation")==="1"}function hE(t){if(!ib(location.search))return!1;return globalThis.__jxAutomation=be(t),!0}var gt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioJxsuiteUpdate",$description:"The on-open offer to bring a project's `@jxsuite/*` dependencies up to their newest published versions: one sentence, and the packages that would move. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answers. Nothing here asks the registry or writes a manifest: `packages/jxsuite-update.ts` keeps the lookup, the dismissal key and the install, and this document only says what is on offer.",tagName:"jx-dialog",$props:{headline:"Update @jxsuite packages?",confirmLabel:"Update",cancelLabel:"Not now",size:"sm"},attributes:{part:"jxsuite-update"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'The old body was a lit template with no stylesheet at all, which is why the conversion is mostly a deletion. Two `<br />`s stood in for a paragraph break, and one `<span style="white-space: pre-line">` held every package as a single `\\n`-joined string — a list spelled as whitespace. Neither is addressable and neither announces as what it is, so a screen reader read one run-on line and a test could only match a substring of it. It is a `<ul>` of keyed rows now: the list says how many packages there are, and each row is `[data-package]`. The one token repair travels with it — that span asked for `--spectrum-font-size-75`, which resolves only inside `<sp-theme>`, and a document mounted in the dialog layer is outside it, so the size silently fell back to the hard-coded `12px` written beside it.','& [part="offer"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="lede"]':{margin:"0"},'& [part="list"]':{$description:"Capped and scrolling, because the count is the registry's rather than this dialog's: a project that has not been opened in a year can have every `@jxsuite/*` package behind at once, and a dialog that grows past the viewport puts its own Update button off screen.",listStyle:"none",margin:"0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",maxHeight:"240px",overflowY:"auto"},'& [part="package"]':{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"var(--jx-space-3)",fontSize:"var(--jx-text-sm)"},'& [part="package-name"]':{color:"var(--fg)"},'& [part="package-move"]':{$description:"Tabular figures, so a column of versions does not jitter between rows of different widths.",color:"var(--fg-dim)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"}},children:[{tagName:"div",attributes:{part:"offer"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Newer versions of these packages have been published. Update the project to them?"},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/packages"},key:{$ref:"$map/item/name"},map:{tagName:"li",attributes:{part:"package","data-package":"${$map.item.name}"},children:[{tagName:"span",attributes:{part:"package-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"package-move"},textContent:"${$map.item.current} → ${$map.item.target}"}]}}]}]}]};T("jxsuite-update",gt);function ft(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("dialog","jxsuite-update")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},i=v({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm()},packages:t.packages}),o=null,n=R("jxsuite-update",i,e).then(async(s)=>{o=s;let l=s.root;if(a)return s.dispose(),l;if(await An(l),a)return l;return un(l),l});return{close(){let s=o?.root;if(s instanceof HTMLElement)rn(s);o?.dispose(),o=null,e.remove(),r()},host:e,ready:n}}function ob(t){return t.replace(/^[\^~>=<v\s]+/,"").trim().split(/\s+/)[0]??""}function bt(t){if(t.includes(":"))return!1;return/^\d+\.\d+/.test(ob(t))}function yt(t){let e=ob(t).split(/[-+]/)[0]??"",[a=0,r=0,i=0]=e.split(".").map((o)=>Math.trunc(Number(o))||0);return[a,r,i]}function we(t,e){let a=yt(t),r=yt(e);for(let i=0;i<3;i++){let o=a[i]??0,n=r[i]??0;if(o!==n)return o<n?-1:1}return 0}function yw(t,e){if(!bt(t)||!bt(e))return!1;return we(e,t)>0}var ve="@jxsuite/";async function J(){let t=p();if(!t.packageVersions)return[];let e;try{e=await t.packageVersions()}catch{return[]}let a=[];for(let r of e)if(r.name.startsWith(ve)&&yw(r.current,r.latest))a.push({current:r.current,dev:Boolean(r.dev),latest:r.latest,name:r.name});return a}function wt(t,e){let a=e.map((r)=>`${r.name}@${r.latest}`).toSorted().join(",");return`jx:jxsuite-update-dismissed:${t}:${a}`}function xe(t,e){try{return localStorage.getItem(wt(t,e))==="1"}catch{return!1}}function $e(t,e){try{localStorage.setItem(wt(t,e),"1")}catch{}}async function W(t){let e=p();if(!e.setPackageVersions||t.length===0)return;let a=la({status:"Updating @jxsuite packages…",title:"Updating dependencies"});try{let r=await e.setPackageVersions(t.map((i)=>({dev:i.dev,name:i.name,version:`^${i.latest}`})));if(r.ok)a.done(),k.success(`Updated ${t.length} @jxsuite package(s) to their latest versions.`);else a.fail(r.log??"Update failed")}catch(r){a.fail(r instanceof Error?r.message:String(r))}}function Se(t){return new Promise((e)=>{let a=!1,r=(s)=>{if(a)return;a=!0,e(s)},i=!1,o=()=>{if(i)return;i=!0,n.close()},n=ft({layer:Ct("dialog"),onCancel:()=>{o()},onClosed:()=>{r(!1),o()},onConfirm:()=>{r(!0),o()},packages:t.map((s)=>({current:s.current,name:s.name,target:`^${s.latest}`}))})})}async function tp(t){if(ib(location.search))return;if(!p().setPackageVersions)return;let a=await J();if(a.length===0||xe(t,a))return;if(!await Se(a)){$e(t,a);return}await W(a)}var G=["package.json","bun.lock","bun.lockb"],ke=new Set(["??","U"]),je=25,Pe="@jxsuite/";function F(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function E(t){if(Array.isArray(t))return t.map((e)=>E(e));if(F(t)){let e={};for(let a of Object.keys(t).toSorted())e[a]=E(t[a]);return e}return t}function vt(t){let e={...t};for(let a of["dependencies","devDependencies"]){let r=e[a];if(!F(r))continue;let i={...r};for(let o of Object.keys(i))if(o.startsWith(Pe))i[o]="*";e[a]=i}return e}function Ce(t,e){if(t===null||e===null)return!1;let a,r;try{a=JSON.parse(t),r=JSON.parse(e)}catch{return!1}if(!F(a)||!F(r))return!1;return JSON.stringify(E(vt(a)))===JSON.stringify(E(vt(r)))}async function L(t,e){try{return await p().gitShow({path:t,ref:e})}catch{return null}}async function $t(t){try{return await p().readFile(t)}catch{return null}}async function St(t){let e=[],a=[],r=!0;for(let i of G){let o=t.files.filter((l)=>l.path===i);if(o.length===0)continue;let n=await L(i,"@{u}");if(o.every((l)=>ke.has(l.status))){if(n!==null)a.push(i);continue}let s=await L(i,"HEAD");if(n===null||n===s)continue;if(e.push(i),i==="package.json")r&&=Ce(s,await $t(i))}return{automated:r,discard:e,removeUntracked:a}}function kt(t){return t.discard.length===0&&t.removeUntracked.length===0}async function Ne(t){let e=[...new Set(t.files.filter((a)=>!G.includes(a.path)).map((a)=>a.path))];if(e.length>je)return!0;for(let a of e){let r=await L(a,"@{u}");if(r!==null&&r!==await L(a,"HEAD"))return!0}return!1}async function Ae(t){let e=p();if(t.discard.length>0)await e.gitUnstage(t.discard),await e.gitDiscard(t.discard);for(let a of t.removeUntracked)await e.deleteFile(a)}async function B(){let t=p(),e=[];try{e=await J()}catch{e=[]}if(e.length>0&&t.setPackageVersions){await W(e);return}if(!t.installDependencies)return;let a=la({status:"Running bun install…",title:"Syncing dependencies"});try{let r=await t.installDependencies();if(r.ok)a.done();else a.fail(r.log??"bun install failed")}catch(r){a.fail(te(r))}}async function jt(t){let e=p();try{await Ae(t)}catch(a){throw Error(`Could not reset local package files: ${te(a)}`,{cause:a})}try{await e.gitPull()}catch(a){throw await B(),a}k.warn("Local package updates were superseded by pulled changes.",{source:"Source Control"}),await B()}async function Re(t){let e=p(),a;try{a=await e.gitStatus()}catch{throw t}if(!(a.behind>0))throw t;let r=await St(a);if(kt(r)||await Ne(a))throw t;if(!r.automated){if(!await Xo("Discard local package changes?","package.json / bun.lock have local edits that conflict with incoming changes. Discard them, pull, and re-sync packages?",{confirmLabel:"Discard and pull",destructive:!0}))throw t}await jt(r)}async function xt(){let t;try{let e=await p().listDirectory("");t=new Set(e.filter((a)=>a.type==="file").map((a)=>a.name))}catch{t=new Set(G)}return Promise.all(G.map((e)=>t.has(e)?$t(e):Promise.resolve(null)))}async function q(){let t=p(),e=await xt(),a=null;try{await t.gitFetch(),a=await t.gitStatus()}catch{a=null}if(a&&a.behind>0){let i=await St(a);if(!kt(i)&&i.automated){await jt(i);return}}try{await t.gitPull()}catch(i){await Re(i);return}let r=await xt();if(e.some((i,o)=>i!==r[o]))await B()}async function np(){let t=p(),e;try{e=await t.gitStatus()}catch{return}if(!e?.isRepo||(e.remotes?.length??0)===0)return;k.info("Syncing project…",{key:"project.sync",source:"Source Control"});try{await q()}catch(a){k.warn("The project could not be synced with its remote.",{detail:te(a),key:"project.sync",source:"Source Control",tier:"problem"})}}var Pt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelGit",$description:"The Navigator's Source Control panel: what git says about this project, and every verb that answers. It has four moods and the adapter names which one — no project, a first read still in flight, a project git is not tracking yet, and a repository — so nothing here asks whether `status` is null or what `isRepo` means. Under the fourth mood it draws the sync bar (with or without a remote), the branch row, the two sub-tabs, and then either the commit form over the changed files or the log. `panels/git-panel.ts` keeps every decision: what a comparison is, which files group under which component, what a status letter reads aloud, what a commit does before it runs, and which of the four verbs a row's buttons are. Rows arrive as strings and booleans, keyed by path.",tagName:"div",attributes:{part:"git-panel"},style:{$description:"The sixty-odd `.git-*` rules in `styles/overlays.css`, keyed on `part` and carried here. Four token repairs travel with them, all of the shape `surfaces/panel-imports.json` describes: `--spectrum-font-size-75` and `--spectrum-font-size-50` resolved only inside `<sp-theme>` and a document is mounted outside it, so every rule that read one would silently have taken its px fallback — they are `--jx-text-md` (12px) and `--jx-text-sm` (11px) here, at the same values, and the bare `10px` literals are `--jx-text-xs`. The one deliberate move is the two headline values, the sync label and the branch name: they were 13px, which is not a step on the scale, and they take `--jx-text-lg` (14px). Three rules are DELETED rather than moved, because the kit already draws them: the sub-tab strip's own fill, hover and selected underline are `jx-tabs`/`jx-tab`, the branch picker's box is `jx-select`, and `.git-split-btn`'s hand-built dropdown is the kit menu (see `openCommitMenu`). And one is repaired: a row's action buttons were `opacity: 0` until the ROW was hovered, so tabbing to Stage moved the keyboard onto an invisible control — the reveal is `:focus-within` as well as `:hover`.",display:"flex",flexDirection:"column",height:"100%",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"Drawn here rather than borrowed from `panels/empty-state.ts`, which is a lit template a document cannot call. What is kept is the pattern's rules (studio-ui-guidelines.md §11): one sentence saying what the region is for, then the action that fills it.",display:"flex",flex:"1",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-5)",textAlign:"center",color:"var(--fg-dim)"},'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-actions"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="sync-bar"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6), and it has exactly two items: `sync-head` (Refresh and the status, which never split) and what answers the status (the Fetch/Pull/Push group, or Create GitHub repository with no remote). It was a single line whose only shrinkable item was the status text, so a narrow Navigator never moved a button: it broke "3 behind / Last updated 09:04 AM" into a column one word wide (25px at the 160px floor) and painted "(no" under Create GitHub repository at the default 240px. Now the second item drops to a line of its own when the two no longer fit, and where that happens is decided by the status text\'s own width (a count, a locale\'s clock), never by a breakpoint. The row gap is the smaller step so a wrapped bar reads as one block.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="sync-bar"][data-remote="none"], & [part="sync-bar"][data-remote="none"] > [part="sync-head"]':{$description:"The no-remote bar keeps its tighter 8px between Refresh and the sentence, and on both axes: the head carries that gap now that Refresh and the text sit in it rather than in the bar.",gap:"var(--jx-space-3)"},'& [part="sync-head"]':{$description:"Refresh and the status, as one item of the bar, so wrapping never leaves the icon alone on a line above its text. `flex: 1 1 auto` makes its basis the status text's own width, which is the wrap threshold; with `min-width: 0` it can then shrink below that when it is alone on a line, and the status wraps as a sentence rather than word by word.",display:"flex",flex:"1 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="sync-text"]':{$description:"`1 1 auto` rather than `1`: the head's basis decides whether the verbs fit beside it, and it should be the status text's own width. An auto basis says that directly; the `0%` basis of `flex: 1` only reaches the same answer through how an engine treats a percentage while it measures.",display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="sync-label"]':{fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="sync-time"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="sync-actions"]':{$description:"The verbs never shrink: they are what moves. `margin-left: auto` keeps them at the inline end whether they share the status's line or sit on one of their own.",display:"flex",flex:"none",marginLeft:"auto"},'& [part="branch-row"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6) of two items, `branch-head` and the picker. It was a single line with the picker capped at 40% of it, so a long branch name was cut twice ("chor…" beside "cho…") and a narrow Navigator word-stacked "Active / branch". Now the picker drops below the name when the two no longer fit, at a width the name decides.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"10px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="branch-head"]':{$description:"The branch icon and the name, as one item so the icon is never alone on a line. The 999:1 grow ratio against the picker gives nearly all spare room to the name while the two share a line, so the picker stays the width of the branch it shows; once the picker wraps, it is alone and takes the whole line. A third item in this row needs its own flex decision.",display:"flex",flex:"999 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="branch-icon"]':{$description:"The hand-drawn 18px branch SVG this panel carried is the kit's `git-branch` glyph — the same key `PanelRecord.icon` already names for this panel's rail button, so the two drawings cannot drift.",flex:"none","--jx-icon-size":"18px",color:"var(--fg-dim)"},'& [part="branch-text"]':{display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="branch-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="branch-name"]':{overflow:"hidden",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="branch-picker"]':{$description:"Sized by the branch it shows while it shares the name's line, and the full width of the row once it wraps below it, which is where a long branch name finally reads whole. `min-width: 0` is the kit's own default, restated because studio-ui-guidelines.md §4.6 asks it of every flex child: when even a line of its own is narrower than the name, the picker shrinks and the kit's preview ellipsizes.",flex:"1 1 auto",minWidth:"0"},'& [part="tab"]':{$description:`The sub-tabs may shrink below their labels. A flex item's automatic minimum is its content, and a tab's label is nowrap, so "Local Changes (3)" and "History" held 179px against the 159px the Navigator has at its 160px floor and scrolled the whole panel sideways; the kit's label ellipsis could never engage. \`inspector-dock.json\` makes the same call for its tabs. It is a surface decision and not a kit default because the document tab strip deliberately scrolls instead.`,minWidth:"0"},'& [part="create-repository"] > [part="control"], & [part="init"] > [part="control"], & [part="clone"] > [part="control"], & [part="commit-button"] > [part="control"]':{$description:`The panel's labelled buttons wrap their words at the Navigator's floor instead of overflowing it. The kit's control is nowrap, which is right for a toolbar and made each label a floor of its own: "Create GitHub repository" held 165px in a 135px sync bar, "Clone Git Repository" and "Initialize Repository" held 141px and 135px in the empty state's 127px, and "Commit and sync" beside its menu had about a pixel to spare in the commit form's 135px. Nothing changes where the label fits, because a nowrap label and a wrapping one have the same max-content width. This reaches into the kit's \`control\` part as \`commandbar.json\` does for its primary button.`,whiteSpace:"normal"},'& [part="commit"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="commit-label"]':{fontWeight:"500",color:"var(--fg-dim)"},'& [part="commit-actions"]':{display:"flex",gap:"var(--jx-space-2)"},'& [part="commit-button"]':{flex:"1"},'& [part="section"]':{borderBottom:"1px solid var(--border)"},'& [part="section-header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-3) var(--jx-space-4) 6px",fontWeight:"700",color:"var(--fg)"},'& [part="count"]':{$description:"The pill beside a section title. `margin-inline-end: auto` is what pushes the section's own button to the right edge — it was a second rule (`.git-section-header .git-count`) over the same element, and there is only one place a count is drawn.",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"18px",height:"18px",marginInlineEnd:"auto",padding:"0 5px",borderRadius:"9px",background:"var(--accent-15)",color:"var(--accent)",fontSize:"var(--jx-text-xs)",fontWeight:"600"},'& [part="group"]':{marginBottom:"var(--jx-space-1)"},'& [part="group-header"]':{display:"flex",alignItems:"center",gap:"6px",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="group-name"]':{fontWeight:"500",color:"var(--fg)"},'& [part="file-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-1) var(--jx-space-3) var(--jx-space-1) var(--jx-space-5)"},'& [part="file-row"]:hover':{background:"var(--hover-bg)"},'& [part="file-open"]':{$description:"A REAL button, because it does something. It was a bare span with a cursor and a `title`: not focusable, no role, and Enter did nothing — so the panel's primary verb was mouse-only. A `<button>` needs no role, no tabindex and no key handler of its own, which is three lines of the old row that simply go.",display:"flex",flex:"1",alignItems:"baseline",gap:"6px",minWidth:"0",margin:"0",padding:"0",overflow:"hidden",border:"none",borderRadius:"var(--radius)",background:"none",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="file-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-dir"]':{overflow:"hidden",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-actions"]':{$description:"Revealed on `:focus-within` as well as on the row's hover. Opacity alone hid a control the keyboard could still reach: tabbing through a changed file landed on an invisible Stage button.",display:"flex",flex:"none",opacity:"0"},'& [part="file-row"]:hover [part="file-actions"], & [part="file-actions"]:focus-within':{opacity:"1"},'& [part="badge"]':{$description:"One letter and a colour, which is why every row's open button carries the status in words as well.",flex:"none",width:"16px",color:"var(--signal)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",fontWeight:"700",textAlign:"center"},'& [part="badge"][data-status="A"], & [part="badge"][data-status="U"]':{color:"var(--success)"},'& [part="badge"][data-status="D"]':{color:"var(--danger)"},'& [part="badge"][data-status="R"], & [part="badge"][data-status="C"]':{color:"var(--tag)"},'& [part="history"]':{flex:"1",overflowY:"auto",padding:"var(--jx-space-2) 0"},'& [part="history-list"]':{margin:"0",padding:"0",listStyle:"none"},'& [part="history-entry"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",padding:"6px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="history-entry"]:hover':{background:"var(--hover-bg)"},'& [part="history-hash"]':{color:"var(--accent)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)"},'& [part="history-message"]':{color:"var(--fg)"},'& [part="history-meta"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="status"]':{margin:"0",padding:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",textAlign:"center"},'& [part="failure"]':{$description:"The panel's own refusal banner. It is `failure` rather than `error` because the branch picker and the commit field each draw a permanent, empty `[part=\"error\"]` of their own inside this same light-DOM tree: under that name this padding, rule and wash drew a 16×13 box over both fields' top-left corners that took the click, and dressed either field's real refusal sentence as a banner.",margin:"0",padding:"6px var(--jx-space-3)",borderBottom:"1px solid var(--border)",background:"color-mix(in srgb, var(--danger) 8%, transparent)",color:"var(--danger)",fontSize:"var(--jx-text-sm)"},"@(forced-colors: active)":{'& [part="failure"]':{$description:"The wash behind the banner collapses into the page when every author colour is replaced, so the border is what is left to mark it.",border:"1px solid CanvasText",color:"CanvasText"}}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/view"},cases:{"no-project":{tagName:"div",attributes:{part:"empty","data-view":"no-project"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Source control keeps every version of a project, so any change can be undone. Open a project to see its history."},{tagName:"div",attributes:{part:"clone-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canClone"},cases:{true:{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"clone","data-action":"clone"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clone"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"download-simple"}},{tagName:"span",textContent:"Clone Git Repository"}]}]}}}]},loading:{tagName:"p",attributes:{part:"status","data-view":"loading"},textContent:"Loading…"},"no-repo":{tagName:"div",attributes:{part:"empty","data-view":"no-repo"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"This project is not tracked by git yet. Start tracking it to keep a history of every change and to publish it anywhere."},{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"init","data-action":"init"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/initRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"Initialize Repository"}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}]},repo:{tagName:"div",attributes:{part:"repo",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"remote-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/remoteState"},cases:{remote:{tagName:"div",attributes:{part:"sync-bar","data-remote":"yes"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"${state.syncLabel}"},{tagName:"span",attributes:{part:"updated-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLastUpdated"},cases:{true:{tagName:"span",attributes:{part:"sync-time"},textContent:"${state.lastUpdated}"}}}]}]},{$description:"Three quiet tools, so NOT compact. A compact group draws every member's frame and fill whatever its quiet says, so the `quiet: true` each verb below writes would have been silently framed into a segmented control; Spectrum's group here was quiet and never compact, which is what compact=false and the 2px gap between the verbs restore.",tagName:"jx-action-group",attributes:{part:"sync-actions"},$props:{label:"Remote actions",compact:!1},children:[{tagName:"jx-action-button",attributes:{part:"fetch","data-action":"fetch"},$props:{icon:"download-simple",size:"sm",quiet:!0,label:"Fetch",hint:"Fetch",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/fetch"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"pull","data-action":"pull"},$props:{icon:"arrow-down",size:"sm",quiet:!0,label:{$ref:"#/state/pullLabel"},hint:{$ref:"#/state/pullLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pull"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"push","data-action":"push"},$props:{icon:"arrow-up",size:"sm",quiet:!0,label:{$ref:"#/state/pushLabel"},hint:{$ref:"#/state/pushLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/push"},value:[]}]}}]}]},local:{tagName:"div",attributes:{part:"sync-bar","data-remote":"none"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"Local only (no remote)"}]}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}}},{tagName:"div",attributes:{part:"branch-row"},children:[{tagName:"div",attributes:{part:"branch-head"},children:[{tagName:"jx-icon",attributes:{part:"branch-icon"},$props:{name:"git-branch"}},{tagName:"div",attributes:{part:"branch-text"},children:[{tagName:"span",attributes:{part:"branch-label"},textContent:"Active branch"},{tagName:"span",attributes:{part:"branch-name"},textContent:"${state.branchName}"}]}]},{tagName:"jx-select",attributes:{part:"branch-picker"},$props:{label:"Switch branch",size:"sm",options:{$ref:"#/state/branchOptions"},value:{$ref:"#/state/branchValue"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/chooseBranch"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-tabs",attributes:{part:"tabs",selected:"${state.subTab}"},$props:{label:"Source control views"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectTab"},value:[{$ref:"event#/detail"}]}]},children:[{tagName:"jx-tab",attributes:{part:"tab","data-tab":"changes",value:"changes",label:"${state.changesLabel}",panel:"git-panel-body"}},{tagName:"jx-tab",attributes:{part:"tab","data-tab":"history",value:"history",label:"History",panel:"git-panel-body"}}]},{tagName:"div",attributes:{part:"body",id:"git-panel-body",role:"tabpanel","data-tab":"${state.subTab}"},style:{display:"contents"},$switch:{$ref:"#/state/subTab"},cases:{changes:{tagName:"div",attributes:{part:"changes",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"commit","data-jx-region":"navigator/panel:git/commit"},children:[{tagName:"span",attributes:{part:"commit-label",id:"git-commit-label"},textContent:"Please write a commit message"},{tagName:"jx-textfield",attributes:{part:"commit-input","data-field":"commit-message"},$props:{labelledby:"git-commit-label",multiline:!0,size:"sm",placeholder:"Describe your changes",value:{$ref:"#/state/commitMessage"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editMessage"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{if:{operator:"||",target:{$ref:"event#/ctrlKey"},value:{$ref:"event#/metaKey"}},then:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/commit"},value:[]}]}]}}]}},{tagName:"div",attributes:{part:"commit-actions"},children:[{tagName:"jx-button",attributes:{part:"commit-button","data-action":"commit-and-sync"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitAndSync"},value:[]}]},children:[{tagName:"span",textContent:"Commit and sync"}]},{tagName:"jx-action-button",attributes:{part:"commit-menu","data-action":"commit-menu"},$props:{icon:"caret-down",size:"sm",label:"More commit options",hint:"More commit options",haspopup:"menu"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openCommitMenu"},value:[{$ref:"event#/currentTarget"}]}]}}]}]},{tagName:"div",attributes:{part:"staged-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasStaged"},cases:{true:{tagName:"section",attributes:{part:"section","data-section":"staged","aria-label":"Staged Changes"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Staged Changes"},{tagName:"span",attributes:{part:"count"},textContent:"${state.stagedCount}"},{tagName:"jx-action-button",attributes:{part:"unstage-all","data-action":"unstage-all"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage all",hint:"Unstage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstageAll"},value:[]}]}}]},{$prototype:"Array",items:{$ref:"#/state/stagedFiles"},key:{$ref:"$map/item/key"},map:{$description:"One changed file. Every row opens the file it names — renderability decides which VIEW opens, not whether the row responds — and carries the two or three verbs its staged state allows. `$map/item` inside a nested map is the FILE, which is why the row hands its own path back to every action rather than an index.",tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}},{tagName:"section",attributes:{part:"section","data-section":"changed","aria-label":"Changed Components"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Changed Components"},{tagName:"span",attributes:{part:"count"},textContent:"${state.changedCount}"},{tagName:"span",attributes:{part:"stage-all-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasUnstaged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"stage-all","data-action":"stage-all"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage all",hint:"Stage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stageAll"},value:[]}]}}}}]},{tagName:"div",attributes:{part:"groups-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"div",attributes:{part:"groups"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"group-header"},children:[{tagName:"span",attributes:{part:"group-name"},textContent:"${$map.item.name}"}]},{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"changes"},textContent:"Nothing to commit. Files you edit and save show up here."}}}]}]},history:{tagName:"div",attributes:{part:"history"},children:[{tagName:"div",attributes:{part:"history-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/historyState"},cases:{listed:{tagName:"ul",attributes:{part:"history-list"},children:[{$prototype:"Array",items:{$ref:"#/state/commits"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"history-entry","data-hash":"${$map.item.hash}"},children:[{tagName:"span",attributes:{part:"history-hash"},textContent:"${$map.item.hash}"},{tagName:"span",attributes:{part:"history-message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"history-meta"},textContent:"${$map.item.meta}"}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"history"},textContent:"No commits yet. Each commit you make is a version you can come back to."}}}]}}},{tagName:"div",attributes:{part:"busy-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/busy"},cases:{true:{tagName:"p",attributes:{part:"status","data-status":"busy"},textContent:"Loading…"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.error}"}}}]}}}]};T("git-panel",Pt);function Nt(t,e){t.view=e.view,t.canClone=e.canClone,t.busy=e.busy,t.hasError=e.hasError,t.error=e.error,t.remoteState=e.remoteState,t.syncLabel=e.syncLabel,t.lastUpdated=e.lastUpdated,t.hasLastUpdated=e.hasLastUpdated,t.pullLabel=e.pullLabel,t.pushLabel=e.pushLabel,t.branchName=e.branchName,t.branchValue=e.branchValue,t.branchOptions=e.branchOptions,t.subTab=e.subTab,t.changesLabel=e.changesLabel,t.commitMessage=e.commitMessage,t.hasStaged=e.hasStaged,t.stagedCount=e.stagedCount,t.stagedFiles=e.stagedFiles,t.changedCount=e.changedCount,t.hasUnstaged=e.hasUnstaged,t.filesState=e.filesState,t.groups=e.groups,t.historyState=e.historyState,t.commits=e.commits}function Me(){return{branchName:"",branchOptions:[],branchValue:"",busy:!1,canClone:!1,changedCount:"0",changesLabel:"Local Changes",commitMessage:"",commits:[],error:"",filesState:"empty",groups:[],hasError:!1,hasLastUpdated:!1,hasStaged:!1,hasUnstaged:!1,historyState:"empty",lastUpdated:"",pullLabel:"Pull",pushLabel:"Push",remoteState:"local",stagedCount:"0",stagedFiles:[],subTab:"changes",syncLabel:"",view:"loading"}}function At(t,e,a){let r=v({...Me(),...a});Nt(r,e);let i=null,o=!1;return R("git-panel",r,t).then((n)=>{if(o){n.dispose();return}i=n}),{connected:()=>!o&&(i===null||i.root.parentNode===t),dispose(){o=!0,i?.dispose(),i=null},update:(n)=>{Nt(r,n)}}}async function dc(){if(!D)return;let t=p(),{git:e}=y;e.loading=!0,e.error=null;try{let[a,r]=await Promise.allSettled([t.gitStatus(),t.gitBranches()]);if(a.status==="fulfilled")e.status=a.value;if(r.status==="fulfilled")e.branches=r.value;let i=a.status==="rejected"?a.reason:r.status==="rejected"&&a.value?.isRepo?r.reason:null;if(i)e.error=te(i);e.lastUpdated=Mo(),e.rev+=1,await Ge()}catch(a){e.error=te(a)}finally{e.loading=!1}}async function Ge(){let t=y.git.diffState;if(!t)return;let e=y.git.status?.files.find((a)=>a.path===t.filePath);if(!e||!Tt(e.status)){y.git.diffState=null;return}try{y.git.diffState=await I(t.filePath,e.status)}catch{}}async function a1(t){y.git.rev+=1;let e=y.git.diffState;if(!t||e?.filePath!==t)return;try{y.git.diffState=await I(t,e.fileStatus)}catch{}}async function xw(t){let e=p();if(!e.gitClone){k.warn("Cloning is not supported on this platform.",{source:"Source Control"});return}let a=await Nn("Clone Git Repository",{confirmLabel:"Clone",message:"Repository URL",placeholder:"https://github.com/user/repo.git",validate:(r)=>r.trim()?"":"Enter a repository URL."});if(!a)return;try{k.info("Cloning repository…",{key:"git.clone",source:"Source Control"});let r=await e.gitClone(a);if(r?.root)k.success("Clone complete.",{key:"git.clone"}),await t.openRecentProject(r.root)}catch(r){k.error("Could not clone the repository.",{detail:te(r),key:"git.clone",source:"Source Control"})}}function _w(){return We()&&Boolean(p().gitClone)}var Fe={A:"added",D:"deleted",M:"modified",R:"renamed",U:"untracked"},De=new Set(["M","A","U","D"]);function Tt(t){return De.has(t)}async function I(t,e){let a=p(),r=e!=="A"&&e!=="U",i=e!=="D",[o,n]=await Promise.all([r?a.gitShow({path:t,ref:"HEAD"}):Promise.resolve(""),i?a.readFile(t):Promise.resolve("")]);return{currentContent:n,filePath:t,fileStatus:e,originalContent:o}}async function l1(t,e){try{return await I(t,e)}catch(a){return console.warn("loadDiffForLens:",te(a)),null}}async function Mt(){try{k.info("Initializing repository…",{key:"git.init"}),await p().gitInit(),k.success("Repository initialized.",{key:"git.init"})}catch(t){k.error("Could not initialize the repository.",{action:"git.init",detail:te(t),key:"git.init",source:"Source Control"});return}await dc()}async function Ee(){await b("gitPush")}async function Le(){if(await Cw())k.success("Signed in to GitHub.",{key:"github.auth"})}async function b(t,e){let a=p();y.git.loading=!0,y.git.error=null;try{return await a[t](e),await dc(),!0}catch(r){return y.git.error=te(r),y.git.loading=!1,!1}}function Gt(t){if(!y.git.commitMessage)y.git.commitMessage=t}async function Ue(){y.git.loading=!0,y.git.error=null;try{await q(),await dc()}catch(t){y.git.error=te(t),y.git.loading=!1}}var C=null;async function Ie(){let t=p();try{y.git.logEntries=await t.gitLog(30)}catch(e){y.git.error=te(e)}}var U={},K=null;function Ft(t){let e=t.path.split("/"),a=e.pop()??t.path,r=e.join("/");return{cannotDiscard:t.status==="U",dir:r,hasDir:r!=="",key:t.path,label:`${t.path}, ${Fe[t.status]??"changed"}`,name:a,path:t.path,staged:Boolean(t.staged),status:t.status}}function He(t){let e=new Map;for(let a of t){let r=a.path.split("/"),i;if(a.path.endsWith(".json")||a.path.endsWith(".class.json")||Zt(a.path))i=r.length>1?`/${r.at(-2)}`:`/${r[0]}`;else i="Other";if(!e.has(i))e.set(i,[]);e.get(i).push(a)}return[...e.entries()].map(([a,r])=>({files:r.map((i)=>Ft(i)),key:a,name:a}))}function ze(t){return{hash:t.hash.slice(0,7),key:t.hash,message:t.message,meta:`${t.author} · ${ta(t.date)}`}}function Ve(t){return t?`Last updated ${new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:""}function Dt(){if(!D)return"no-project";let{error:t,loading:e,status:a}=y.git;if(!a&&!e&&!t)return"loading";return a&&!a.isRepo?"no-repo":"repo"}function X(){let{branches:t,commitMessage:e,error:a,lastUpdated:r,loading:i,logEntries:o,status:n,subTab:s}=y.git,l=n?.files??[],c=l.filter((d)=>d.staged),h=l.filter((d)=>!d.staged),g=[...c,...h],x=!n?.ahead&&!n?.behind,f=n?.ahead?`${n.ahead} ahead`:"",S=n?.behind?`${n.behind} behind`:"",N=o??[];return{branchName:(t?.current??n?.branch??"")||"—",branchOptions:[...(t?.branches??[]).map((d)=>({label:d,value:d})),{label:"+ New branch…",value:Z}],branchValue:K??t?.current??"",busy:Boolean(i),canClone:_w(),changedCount:String(g.length),changesLabel:g.length>0?`Local Changes (${g.length})`:"Local Changes",commitMessage:e,commits:N.map((d)=>ze(d)),error:a??"",filesState:g.length>0?"listed":"empty",groups:He(g),hasError:Boolean(a),hasLastUpdated:Boolean(r),hasStaged:c.length>0,hasUnstaged:h.length>0,historyState:N.length>0?"listed":"empty",lastUpdated:Ve(r),pullLabel:S?`Pull (${S})`:"Pull",pushLabel:f?`Push (${f})`:"Push",remoteState:(n?.remotes?.length??0)>0?"remote":"local",stagedCount:String(c.length),stagedFiles:c.map((d)=>Ft(d)),subTab:s,syncLabel:x?"Up to date":`${f}${f&&S?", ":""}${S}`,view:Dt()}}var Z="__new__";function Et(t){return y.git.status?.files.find((e)=>e.path===t)}async function Lt(){let t=y.git.commitMessage.trim();if(!t)return;if(y.git.commitMessage="",await KC(),!await b("gitCommit",t))Gt(t)}async function _e(){let t=y.git.commitMessage.trim();if(!t)return;y.git.commitMessage="",y.git.loading=!0,y.git.error=null,await KC();let e=p(),a=!1;try{await e.gitCommit(t),a=!0,await e.gitPush(),await dc()}catch(r){if(y.git.error=te(r),y.git.loading=!1,!a)Gt(t)}}async function Je(t){let{branches:e,status:a}=y.git;if(t===Z){K=Z,Rt();let r=await Nn("New Branch",{confirmLabel:"Create",message:`Branching from ${e?.current||a?.branch||"the current branch"}.`,placeholder:"feature/my-change",validate:(i)=>i.trim()?"":"Enter a branch name."});if(K=null,Rt(),r)await b("gitCreateBranch",r);return}if(t!==e?.current)await b("gitCheckout",t)}async function Be(t){let e=Et(t);if(!e)return;let a=Tt(e.status)?it(e.path,e.status):`"${e.path}" has no change this view can open.`;if(a){y.git.error=a;return}try{y.git.loading=!0;let r=await I(e.path,e.status);y.git.diffState=r;let i=await ot(e.path);if(U.setGitDiffState?.(r),i)U.setCanvasMode?.(i,"git-diff")}catch(r){y.git.error=`Failed to load diff: ${te(r)}`}finally{y.git.loading=!1}}async function qe(t){if(Et(t)?.status==="U")return;if(!await Xo("Discard Changes",`Discard changes to ${t}?`,{confirmLabel:"Discard",destructive:!0}))return;await b("gitDiscard",[t])}function Ke(t){(me("rtxf9chb"),import("./menu-rtxf9chb.js")).then(({openMenu:e})=>{e({label:"Commit options",opener:t,place:(a)=>{let r=Oe(t);return{x:Math.max(4,r.right-a.width),y:r.bottom+4}},region:"git-commit",rows:[{destructive:!1,disabled:!1,dividerAbove:!1,id:"git.commitWithoutSync",run:()=>{Lt()},title:"Commit (don't sync)"}]})})}function Xe(t){if(y.git.subTab=t,t==="history"&&!y.git.logEntries)Ie()}var Ze={chooseBranch:(t)=>{Je(t)},clone:()=>{U.cloneRepository?.()},commit:()=>{Lt()},commitAndSync:()=>{_e()},createRepository:()=>{O({projectName:D?.name||"my-project"})},discard:(t)=>{qe(t)},editMessage:(t)=>{y.git.commitMessage=t},fetch:()=>{b("gitFetch")},initRepository:()=>{Mt()},openCommitMenu:Ke,openFile:(t)=>{Be(t)},pull:()=>{Ue()},push:()=>{b("gitPush")},refresh:()=>{dc()},selectTab:Xe,stage:(t)=>{b("gitStage",[t])},stageAll:()=>{let t=(y.git.status?.files??[]).filter((e)=>!e.staged).map((e)=>e.path);b("gitStage",t)},unstage:(t)=>{b("gitUnstage",[t])},unstageAll:()=>{let t=(y.git.status?.files??[]).filter((e)=>e.staged).map((e)=>e.path);b("gitUnstage",t)}},w=null;function Ut(){if(!w)return;w.scope.stop(),w.handle.dispose(),w=null}function Rt(){w?.handle.update(X())}function Ye(){if(C)return;C=setInterval(()=>{if(y.leftTab==="git"&&!y.git.loading)dc()},oI)}function Qe(t,e){U=e;let a=t.querySelector(".panel-content")??t;if(We()&&Dt()==="loading")dc();if(w&&(w.host!==a||!w.handle.connected()))Ut();if(w)return;let r=At(a,X(),Ze),i=ge();i.run(()=>{Q(()=>{let o=X();if(o.view==="repo")Ye();r.update(o)})}),w={handle:r,host:a,scope:i}}function c1(t){return tt}function ta(t){let e=new Date(t),a=Mo()-e.getTime(),r=Math.floor(a/60000);if(r<1)return"just now";if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let o=Math.floor(i/24);if(o<30)return`${o}d ago`;return e.toLocaleDateString()}function ea(){return[{category:"Source Control",id:"git.init",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"an open project that git is not already tracking",when:(t)=>t.project.open,enablement:(t)=>!t.project.isRepo,run:async()=>{await Mt()},title:"Initialize Repository"},{category:"Source Control",id:"git.createGithubRepository",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await O({projectName:D?.name||"my-project"})},title:"Create GitHub Repository"},{category:"Source Control",id:"git.push",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await Ee()},title:"Push"},{category:"Source Control",id:"git.signInToGithub",level:"application",menus:["palette"],group:"7_scm",run:async()=>{await Le()},title:"Sign In to GitHub"}]}function d1(t){t.registerAll(ea())}function Bf(){if(C)clearInterval(C),C=null;Ut()}function u1(){qn({id:"git",title:"Source Control",railLabel:"Source",level:"project",dock:"navigator",icon:"git-branch",badge:(t)=>t.git.dirtyCount||null,render:()=>tt,afterRender:(t,e)=>{Qe(e,t.deps)}})}
2
+ export{vw,uE,ib,hE,ob,yw,tp,np,s1,rb,pE,ww,fE,Hf,dc,a1,xw,_w,l1,c1,d1,Bf,u1};
3
+
4
+ //# debugId=5289D20821D65CF664756E2164756E21
5
+ //# sourceMappingURL=studio-j6gnhvaa.js.map
@@ -0,0 +1,7 @@
1
+ import{tt}from"./studio-sxc0zvpt.js";import{te}from"./studio-ery42sqr.js";import{ne}from"./studio-0k9mvpgj.js";import{T,R,on,Rc,Nn}from"./studio-spf2skgc.js";import{v,Mo,k}from"./studio-fqq890ap.js";import{p,We}from"./studio-y7jehjrp.js";import{qt,Md,Ga,Tp,Vs,Lp,Zt,Ka}from"./studio-1x8x26k3.js";import{ua}from"./studio-yr04mv2j.js";import{Ir,pp}from"./studio-888knnkc.js";import{dn,$o,zu,wm,bp,Ax,Qn,m,Gu,Pl,Ua,No,ek,ci,Cm,Sv}from"./studio-cvbkkfqb.js";import{$u,WE,VE,Ps}from"./studio-9mqfamps.js";import{_t,Lr,qr}from"./studio-semd1s8s.js";import{hs,XT,tL,Yb,fs,Zb}from"./studio-zpnk016a.js";import{la}from"./studio-xta2vxp6.js";import{qn}from"./studio-xry7tk3z.js";import{Dl}from"./studio-pwqfmt4p.js";import{gr,zs,Ws,gs}from"./studio-st75kn99.js";import{ib,tp,np,ww,fE,Bf}from"./studio-j6gnhvaa.js";import{_c,ev,Va}from"./studio-c6w3tq7t.js";import{AE,E1}from"./studio-56z7evx4.js";import{zE,Er,Jf,Yf}from"./studio-skzanb0k.js";import{Nt}from"./studio-nt06yybj.js";import{eb,tb,nb}from"./studio-zd4kayn2.js";import{ls}from"./studio-tzegmy4w.js";import{sa}from"./studio-e6re3rk1.js";import{D,Hl,vt}from"./studio-tp642n5g.js";import{me}from"./studio-0bbxhhce.js";async function Pf(){if(ib(location.search))return!1;let e=p();if(!e.dependenciesNeedInstall||!e.installDependencies)return!1;let t=!1;try{t=await e.dependenciesNeedInstall()}catch{return!1}if(!t)return!1;let n=la({status:"Running bun install…",title:"Installing dependencies"});try{let o=await e.installDependencies();if(o.ok)return n.done(),!0;n.fail(o.log??"bun install failed")}catch(o){n.fail(o instanceof Error?o.message:String(o))}return!1}var Be=["page","component"],Ge={components:"component",pages:"page"};function _(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ke(e){let t=_(e).toLowerCase();for(let[n,o]of Object.entries(Ge))if(t.startsWith(`${n}/`))return o;return null}function ee(e){return Be.some((t)=>e.includes(t))}function Ye(e){let t=D?.projectConfig?.layout;if(typeof t!=="string")return!1;return _(t).toLowerCase()===_(e).toLowerCase()}function ge(e){let t=[{ext:".json",label:"JSON (.json)"}];for(let n of Ka(e)){let o=Vs(n,"parse");if(o&&Vs(n,"serialize"))t.push({ext:n,label:`${o.name} (${n})`})}return t}function we(){return new Set([".json",...Tp().flatMap((e)=>e.extensions)])}function hw(e){if(e===null||e===void 0||e==="")return[];let t=Ke(e);if(t===null||Ye(e)||Ax(e))return[];let n=Zt(e);if(!(n?Boolean(n.capabilities.parse)&&ee(n.documentKinds):_(e).toLowerCase().endsWith(".json")))return[];let r=[];if(n)r.push({ext:".json",label:"JSON (.json)"});for(let a of Ka()){let i=Vs(a,"serialize");if(!i||i.name===n?.name||!ee(i.documentKinds)||!i.documentKinds.includes(t))continue;r.push({ext:a,label:`${i.name} (${a})`})}return r}function rE(){let e=new Set([".json"]);for(let t of Tp()){if(!t.capabilities.serialize||!ee(t.documentKinds))continue;for(let n of t.extensions)e.add(n)}return[...e].toSorted()}var oe="jx-studio-recent-projects",ye="jx-studio-recent-files",ve=8,Qe=10,M=[];function V(){if(!We())return null;let e=p();return e.getRecentProjects&&e.saveRecentProjects?e:null}function Xe(){try{let e=localStorage.getItem(oe);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function re(){return V()?M:Xe()}function be(e){M=e;let t=V();if(t)t.saveRecentProjects(e);else try{localStorage.setItem(oe,JSON.stringify(e))}catch{}}async function sE(){let e=V();if(!e)return;try{M=await e.getRecentProjects()}catch{M=[]}}function Xg(){return re().toSorted((e,t)=>t.timestamp-e.timestamp)}function Qg(e,t){let n=re().filter((o)=>o.root!==t);if(n.unshift({name:e,root:t,timestamp:Mo()}),n.length>ve)n.length=ve;be(n)}function pw(e){be(re().filter((t)=>t.root!==e))}function aE(){M=[];let e=V();if(e)e.saveRecentProjects([]);else localStorage.removeItem(oe)}function xe(){try{let e=localStorage.getItem(ye);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function lE(e){let t=xe().toSorted((n,o)=>o.timestamp-n.timestamp);return e==null?t:t.filter((n)=>n.root===e)}function Ff(e){let t=xe().filter((r)=>!(r.root===e.root&&r.path===e.path));t.unshift({name:e.name,path:e.path,root:e.root,timestamp:Mo()});let n=new Map,o=[];for(let r of t.toSorted((a,i)=>i.timestamp-a.timestamp)){let a=(n.get(r.root)??0)+1;if(n.set(r.root,a),a<=Qe)o.push(r)}localStorage.setItem(ye,JSON.stringify(o))}var Pe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioFilesPanel",$description:'The Navigator\'s Files tree, as a Jx document over the kit. `files/files.ts` keeps every decision — which directories are listed, which entries `.gitignore` masks, which rows the window draws, what a click on a row means, what the context menu offers and what each verb does to the filesystem — and hands this document one projection: a word saying which of three things to draw, a toolbar whose state is already resolved, and rows whose every field is already a string. Nothing here asks what a file is, how tall the Navigator is, or whether a directory has been read. THE TREE IS `jx-tree`, and that is what this document no longer says: `role="tree"`, `role="treeitem"`, `aria-level`, `aria-posinset`, `aria-setsize`, the roving `tabindex` and the five arrow-key cases were each written out here and written out again in `panel-outline.json`, two copies of one keyboard contract with nothing holding them in agreement. The element owns all of it; what is left here is what this tree IS — a flat projection of rows, each already carrying its own level and set counts, because the DOM holds a WINDOW onto the model and an expanded `node_modules` is eleven rows rather than ten thousand. The window reaches the element as `padtop`/`padbottom`, and a caret move past either comes back as `move` for the flow to scroll and repaint. Four facts a row carries are bound against ONE scope field each — the current path, the selected path, the dragged path and the drop target — so moving the caret or dragging a file re-evaluates an attribute per drawn row instead of rebuilding the list under the reader\'s pointer. The pragmatic-drag-and-drop handles are an ISLAND: the document draws the rows and the tree, and the adapter attaches sources and targets to them through `onNodeCreated` (specs/studio-ui-guidelines.md §9.4).',tagName:"div",attributes:{part:"files"},style:{$description:"What the twenty `.file-tree*`, `.files-toolbar`, `.project-header` and `.project-name` rules in `styles/panels.css` said, keyed on `part` and re-pointed at the studio token layer. Three names could not come with the declarations. The five `var(--spectrum-font-size-50 | -75, …)` reads are the kit's `--jx-text-sm` and `--jx-text-md`, which are the same 11px and 12px — a `--spectrum-*` name is declared by `<sp-theme>` and by nothing else in this package, so a document that reads one is a document whose type size changes when a component it does not use is removed. The `.selected`, `.dragging`, `.drag-over` and `.drag-over-root` classes are `data-` attributes on a part, because a part is the handle now and because a state a handler adds and forgets to take off is exactly the defect a cancelled drag used to leave on screen. MOST OF THE ROW'S OWN RULES ARE GONE, and that is the point of the element rather than an omission: `jx-tree-item` declares the flex line, the one-control-height box the window reserves scroll by, the indent (`--jx-tree-indent` times one less than `level` — exactly the `8 + depth * 16` this file composed per row), the hover and focus states, the selected wash and the faded dragged row. What is left here is what is TRUE OF THIS TREE and not of trees in general: it owns its own scrollbar, a click on a row opens it, and the row a drag is over wears the drop mark this file draws.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",overflow:"hidden",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"The two states that are not a tree. They are two states and not one sentence: a window with no project at all and a monorepo root that has not been pointed at a site are different situations, and only the second has anything to offer (studio-ui-guidelines.md §11).",padding:"var(--jx-space-6)",textAlign:"center",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-4)"},'& [part="empty"] p':{margin:"0"},'& [part="frame"]':{display:"flex",flexDirection:"column",height:"100%",minHeight:"0"},'& [part="project-header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-3) var(--jx-space-4)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="project-name"]':{fontSize:"var(--jx-text-md)",fontWeight:"600",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="toolbar"]':{display:"flex",gap:"var(--jx-space-2)",padding:"var(--jx-space-2) var(--jx-space-3)",borderBottom:"1px solid var(--border)",alignItems:"center",flexShrink:"0"},'& [part="search"]':{flex:"1",minWidth:"0"},'& [part="tree"]':{$description:"The scroller as well as the list. `ui/virtual-window.ts` walks up from the element it is given looking for the nearest thing that scrolls, and finding itself is the shortest answer — which is why the element declares no `overflow` of its own and leaves the question to the two trees that answer it differently. The colour is re-declared because `jx-tree` sets `--jx-fg` on itself, and this panel's text colour is the studio alias of it.",flex:"1",minHeight:"0",overflowY:"auto",color:"var(--fg)"},'& [part="tree"][data-drop="true"]':{background:"var(--hover-bg)"},'& [part="row"]':{$description:"What the element does not decide. A click on a row OPENS it here — a directory unfolds, a file takes a tab — so the pointer is a pointer rather than the element's default arrow; and the gap is the wider one this tree has always drawn between a 16px file glyph and its name.",gap:"var(--jx-space-3)",cursor:"pointer"},'& [part="loading-row"]':{$description:"A directory whose listing has not arrived yet. It holds the place and it is NOT a row: it is not a `jx-tree-item`, so the caret cannot land on it, the set counts do not include it and typeahead cannot match it — and it is replaced by the real rows on the repaint the listing provokes. It draws the same box by hand because it is the only line in this tree the element does not draw, and a placeholder of a different height would desynchronise the window's scroll reservation from the rows it reserves for.",display:"flex",alignItems:"center",boxSizing:"border-box",blockSize:"var(--jx-control-h)",paddingInline:"calc(var(--jx-space-3) + var(--depth, 0) * 16px) var(--jx-space-3)",color:"var(--fg-dim)",fontStyle:"italic",cursor:"default",userSelect:"none",whiteSpace:"nowrap"},'& [part="row-icon"]':{flexShrink:"0",display:"flex",alignItems:"center","--jx-icon-size":"16px"},'& [part="locale"]':{$description:"The language chip. Deliberately declares no block size, no padding and no line height: the row above is one control-height by contract, and a chip that grew the box would desynchronise the window's scroll reservation from the height it reserves by. It only ever shrinks the text. A chip, not a filter term: the search matches the file's name alone, because a query that silently also matched a language would make “why is this file here” unanswerable from what is on screen.",marginInlineStart:"auto",flexShrink:"0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxInlineSize:"6em"},'& [part="view-slot"], & [part="header-slot"], & [part="locale-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},$switch:{$ref:"#/state/view"},cases:{none:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"No project loaded"}]},welcome:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"Open a project folder to get started."},{tagName:"jx-button",attributes:{part:"open-project"},$props:{variant:"accent",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openProject"},value:[]}],description:"The declared `project.open` command, run through the registry — not a second opener of this surface's own. It is the one the chord, the palette and the status bar's PROJECT field already run, so a window that opens a project from here reports the outcome the same way they do (studio-ui-guidelines.md §12.5)."},children:[{tagName:"span",textContent:"Open Project"}]}]},tree:{tagName:"div",attributes:{part:"frame"},children:[{tagName:"div",attributes:{part:"header-slot",role:"none"},$switch:{$ref:"#/state/headerState"},cases:{shown:{tagName:"div",attributes:{part:"project-header"},children:[{tagName:"span",attributes:{part:"project-name",title:"${state.projectName}"},textContent:"${state.projectName}"}]}}},{tagName:"div",attributes:{part:"toolbar"},children:[{$description:"A row of quiet tools, so NOT compact. A compact group draws every member's frame and fill whatever its quiet says, which is the segmented look a choice wants and not the borderless one a toolbar wants; Spectrum's group here was `compact quiet`, a combination the kit spells as compact=false with its members' default quiet.",tagName:"jx-action-group",attributes:{part:"toolbar-actions"},$props:{compact:!1,label:"File tree actions"},children:[{tagName:"jx-action-button",attributes:{part:"new-file"},$props:{size:"sm",icon:"plus",label:"New File",hint:"New File"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/newFile"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"refresh"},$props:{size:"sm",icon:"arrows-clockwise",label:"Refresh",hint:"Refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}],description:"The rules go with the listings. Refresh is what an author reaches for after editing a `.gitignore` by hand, and a tree that came back still hiding by the old rules would read as the button not having worked."}},{tagName:"jx-action-button",attributes:{part:"show-ignored"},$props:{size:"sm",icon:{$ref:"#/state/ignoredIcon"},label:{$ref:"#/state/ignoredLabel"},hint:{$ref:"#/state/ignoredLabel"},selected:{$ref:"#/state/ignoredSelected"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleIgnored"},value:[]}],description:"A repaint and nothing else: the ignored entries were never dropped from the cached listings, only from the rows built out of them."}}]},{tagName:"jx-textfield",attributes:{part:"search"},$props:{label:"Filter files",placeholder:"Filter files…",size:"sm",value:{$ref:"#/state/query"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/search"},value:[{$ref:"event#/target/value"}]}],description:"The query matches a file's NAME and nothing else. A directory is kept whatever it says, because hiding the folder a match sits in would leave the match with nowhere to be drawn."}}]},{$description:'The `role="tree"`, and everything that used to be spelled out under it. The element writes the role, the name, the roving tab stop and every row\'s `aria-level` / `aria-posinset` / `aria-setsize`, and it owns the whole ARIA keyboard: the arrows walk the drawn rows without wrapping, `Home` and `End` reach the ends of the MODEL by way of the pads, `ArrowRight` opens a directory and steps into an open one, `ArrowLeft` closes one and otherwise steps out to its parent, `Enter` activates and a printable character is typeahead. Every chord it does not own — cut, copy, paste, delete, rename — passes straight through to the flow, which is the WCAG 2.5.7 obligation this tree carries because dragging a file is the other way to move it. What reaches this document is five events, and each of them is a decision `files.ts` already owned.',tagName:"jx-tree",attributes:{part:"tree",label:"Project files",current:"${state.currentPath}",padtop:"${state.padTop}",padbottom:"${state.padBottom}","data-drop":"${state.rootDrop || null}"},onselect:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"event#/detail/value"}]}],description:"The reader meant that row. This tree is single-select, so the element resolves every modifier to `replace` before it gets here and the detail's `mode` and `anchor` are answers to a question this tree does not ask. There is no `change` handler beside it on purpose: the element OWNS the caret and keeps it across every repaint that does not change `current`, so a second copy of it in the flow would be a variable that only ever went stale."},onactivate:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"event#/detail"}]}],description:"`Enter` or a double click. The same verb a single click reaches, by the same name."},onexpand:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/expand"},value:[{$ref:"event#/detail/value"},{$ref:"event#/detail/expanded"}]}],description:"`ArrowRight`, `ArrowLeft` or the twisty, with ONE dispatcher between them: the detail says the state the row should be PUT INTO, so the flow never has to work out which way a toggle was going."},onmove:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/move"},value:[{$ref:"event#/detail/from"},{$ref:"event#/detail/key"}]}],description:"The caret has to reach a row the window did not draw. The element knows only that the pad on that side is not zero; where the row is in the model, and how far to scroll to bring it into view, is the flow's — which is why this is an event and not a `scrollIntoView`."},ontypeahead:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/typeahead"},value:[{$ref:"event#/detail/from"},{$ref:"event#/detail/char"}]}],description:"A printable character, on a windowed tree. The same hand-off as `onmove` and for a sharper reason: a move off the end of the slice announces itself, and a letter never does — the element's own search over the drawn rows always answers, and over a `node_modules` of ten thousand entries the answer is whichever of the eleven painted rows happened to start with that letter. So the element dispatches EVERY such character and the flow answers it over the model."},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"row-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{item:{tagName:"jx-tree-item",attributes:{part:"row",value:"${$map.item.path}",label:"${$map.item.name}",level:"${$map.item.level}",posinset:"${$map.item.posInSet}",setsize:"${$map.item.setSize}",expanded:"${$map.item.ariaExpanded}",selected:"${state.selectedPath === $map.item.path ? 'true' : 'false'}","data-type":"${$map.item.type}","data-dragging":"${state.dragPath === $map.item.path ? '' : null}","data-drop":"${state.dropPath === $map.item.path ? '' : null}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"$map/item/path"}]}],description:"A single click OPENS the row, which is this tree's own answer and not the element's. `jx-tree` answers a click with `change` and `select`, exactly as it answers an arrow key, and a tree that opened on `select` would open every file the reader arrowed past. So the opening verb is bound here, where a click is a click; what a click MEANS — unfold this directory, take a tab for that file — stays the flow's, and Enter reaches the same verb through `activate`. It does NOT stop the event, which is the correction: the tree's delegated click is what moves the caret and the selection onto the row, so a `stopPropagation` here would leave a reader who clicked a folder with the tab stop still on whatever they had open last. The twisty stops its own click, so opening a directory from the chevron does not also activate the row."},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/contextMenu"},value:[{$ref:"$map/item/path"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]},children:[{tagName:"jx-icon",attributes:{slot:"icon",part:"row-icon","aria-hidden":"true"},$props:{name:{$ref:"$map/item/icon"}}},{tagName:"div",attributes:{slot:"status",part:"locale-slot",role:"none"},$switch:{$ref:"$map/item/localeState"},cases:{shown:{tagName:"span",attributes:{part:"locale"},textContent:"${$map.item.locale}"}}}]},loading:{$description:"A directory whose listing has not arrived yet. Deliberately not a `jx-tree-item`: there is no file there to select, open, rename or drag, and a row the caret could land on that answers to none of the verbs the caret offers is a stop in the walk with nothing behind it.",tagName:"div",attributes:{part:"loading-row",role:"none","data-loading":"true",style:"--depth:${$map.item.depth}"},textContent:"Loading…"}}}}]}]}}}]};T("files-panel",Pe);function Fe(e,t){e.view=t.view,e.headerState=t.headerState,e.projectName=t.projectName,e.query=t.query,e.ignoredLabel=t.ignoredLabel,e.ignoredIcon=t.ignoredIcon,e.ignoredSelected=t.ignoredSelected,e.padTop=t.padTop,e.padBottom=t.padBottom,e.rows=t.rows,e.selectedPath=t.selectedPath,e.dragPath=t.dragPath,e.dropPath=t.dropPath,e.rootDrop=t.rootDrop,e.currentPath=t.currentPath}function J(){return{currentPath:"",dragPath:"",dropPath:"",headerState:"hidden",ignoredIcon:"eye-slash",ignoredLabel:"Show ignored files",ignoredSelected:!1,padBottom:0,padTop:0,projectName:"",query:"",rootDrop:"",rows:[],selectedPath:"",view:"none"}}function et(e){let t=typeof e==="string"?void 0:e.attributes?.part;return typeof t==="string"?t:""}function nt(e){let n=e?.$map?.item;return typeof n?.path==="string"?n:null}function je(e,t,n){let o=v({...J(),...n});Fe(o,t);let r=null,a=!1,i=R("files-panel",o,e,{onNodeCreated:(s,l,c,d)=>{if(a||!(s instanceof HTMLElement))return;let F=et(c);if(F==="tree"){n.treeHost(s);return}if(F!=="row")return;let y=nt(d);if(y)n.rowHost(s,y.path,y.type)}}).then((s)=>{if(a){s.dispose();return}r=s});return{connected:()=>!a&&(r===null||r.root.parentNode===e),dispose(){a=!0,r?.dispose(),r=null},ready:i,update:(s)=>{Fe(o,s)}}}async function To(e){if(!D)return;try{let t=p(),[n]=await Promise.all([Ir(()=>t.listDirectory(e)),WE(e)]);D.dirs.set(e,n)}catch{D.dirs.set(e,[])}}function pe(){return Lr(_t.showIgnoredFiles)==="true"}function ot(e){qr(_t.showIgnoredFiles,e?"true":"")}async function Z_(){try{let e=p(),t=await e.probeRootProject();if(!t)return;let{meta:n,info:o}=t;if(Md(),qt(),Ga(e),$u(),pp(),Hl({dirs:new Map,expanded:new Set,isSiteProject:o.isSiteProject,name:o.isSiteProject?o.projectConfig?.name||n.name:n.name,projectConfig:(o.isSiteProject?o.projectConfig:null)||null,projectDirs:o.directories||[],projectRoot:".",root:n.root,searchQuery:"",selectedPath:null}),o.isSiteProject)Ua(n.root||".",o.projectConfig||null);if(o.isSiteProject){if(Qg(vt().name,n.root),await np(),await Pf())Md(),await qt(),Ga(e);await To("."),await Dl(),await jf(),tp(n.root)}}catch{}}async function X_({renderLeftPanel:e}){try{let t=p(),n=await t.openProject();if(!n)return!1;let{config:o,handle:r}=n;if(ek({document:{children:[],tagName:"div"},id:"initial"}),zE(),Md(),qt(),Ga(t),$u(),pp(),Hl({...D,dirs:new Map,expanded:new Set,isSiteProject:!0,name:o.name||r.name,projectConfig:o,projectRoot:r.root,searchQuery:"",selectedPath:null}),Ua(r.root,o),await np(),await Pf())Md(),await qt(),Ga(t);await To("."),await Dl();let a=new Set(["pages","layouts","components","content","data","public","styles"]),i=vt().dirs.get(".")||[],s=[];for(let l of i)if(l.type==="directory"&&a.has(l.name))s.push(l.name),vt().expanded.add(l.path||l.name),await To(l.path||l.name);return vt().projectDirs=s,Bf(),Zb(),fs("files"),Qg(vt().name,vt().projectRoot),e(),await jf(),tp(vt().projectRoot),!0}catch(t){return k.error("Could not open the project.",{detail:te(t),source:"Open Project"}),!1}}async function Q_(e){let t=p();if(t.createDestination!=="path")return!1;try{if(await t.activate(e),(await t.gitStatus()).isRepo)return!1;return await t.gitInit(),k.success("Initialized a git repository for this project."),!0}catch(n){return k.warn("Could not initialize a git repository — the project itself was written.",{detail:te(n),source:"Source Control"}),!1}}async function fw(){await qt();let e=[...Ka("page"),".json"],t;try{t=await p().listDirectory("pages")}catch{return null}let n=new Set(t.filter((o)=>o.type==="file").map((o)=>o.name));for(let o of e)if(n.has(`index${o}`))return`pages/index${o}`;return null}async function rt(){let e=await fw();if(e)await Lo(e)}async function jf(){let e=tL(m.projectRoot);if(Yb(m.projectRoot),e){if(await XT(e,{ensureSecondPane:()=>{Pl(Qn)},openFile:(n,o)=>Lo(n,{focus:!1,paneId:o})})>0)return!0}return await rt(),!1}function at(e,t,n){if(t==="directory")return n?"folder-open":"folder";let o=e.split(".").pop()?.toLowerCase();switch(o){case"css":case"js":case"json":case"ts":return"file-code";case"md":return"file-text";default:return o!==void 0&&ev(o)?"image":"file"}}function e1(){return tt}function t1(e){}var it=24,u=[],A=null,L=new Map,B=null,Se=null;function ue(){for(let e of L.values())if(e.isConnected&&e.offsetHeight>0)return e.offsetHeight;return it}function st(){for(let[e,t]of L)if(!t.isConnected)L.delete(e),Oe(t)}function Re(e){let t=L.get(e);return t?.isConnected===!0?t:null}function X(e){return u.find((t)=>!t.loading&&t.path===e)}function ke(e,t,n,o){let r=vt().dirs.get(e);if(!r){To(e).then(()=>f()),n.push({depth:t,expanded:!1,key:`loading:${e}`,loading:!0,name:"Loading…",path:e,posInSet:1,setSize:1,type:"file"});return}let a=[...r].toSorted((c,d)=>{if(c.type==="directory"&&d.type!=="directory")return-1;if(c.type!=="directory"&&d.type==="directory")return 1;return c.name.localeCompare(d.name)}),i=pe()?a:a.filter((c)=>!VE(e,c.path,c.type==="directory")),s=vt().searchQuery.toLowerCase(),l=s?i.filter((c)=>c.type==="directory"||c.name.toLowerCase().includes(s)):i;for(let[c,d]of l.entries()){let y=d.type==="directory"&&vt().expanded.has(d.path);if(n.push({depth:t,expanded:y,key:d.path,loading:!1,name:d.name,path:d.path,locale:zu(d.path,o)??void 0,posInSet:c+1,setSize:l.length,type:d.type}),y)ke(d.path,t+1,n,o)}}function Ee(e){return e===void 0?-1:u.findIndex((t)=>!t.loading&&t.path===e)}function q(e,t){for(let n=e+t;n>=0&&n<u.length;n+=t)if(!u[n].loading)return n;return-1}function lt(e){let t=u[e];if(!t)return-1;for(let n=e-1;n>=0;n--){let o=u[n];if(!o.loading&&o.depth<t.depth)return n}return-1}function ct(){if(A?.isConnected!==!0||O!=="")return;queueMicrotask(f)}function ie(){let e=A;if(e===null)return;B=nb(B,e,{count:()=>u.length,onChange:ct,rowHeight:ue})}function dt(e){let t=String(e.depth+1);if(e.loading)return{ariaExpanded:"",depth:String(e.depth),icon:"",key:e.key,kind:"loading",level:t,locale:"",localeState:"hidden",name:e.name,path:e.path,posInSet:"",setSize:"",type:e.type};return{ariaExpanded:e.type==="directory"?String(e.expanded):"",depth:String(e.depth),icon:at(e.path,e.type,e.expanded),key:e.key,kind:"item",level:t,locale:e.locale===void 0?"":dn(e.locale),localeState:e.locale===void 0?"hidden":"shown",name:e.name,path:e.path,posInSet:String(e.posInSet),setSize:String(e.setSize),type:e.type}}function pt(){if(st(),!D){u=[];let s={...J(),view:"none"};return P=s,s}if(!D.isSiteProject&&D.projectRoot==="."){u=[];let s={...J(),view:"welcome"};return P=s,s}let e=vt();u=[];let{i18n:t}=$o(e.projectConfig??{});ke(".",0,u,t);let n=eb(A,{count:u.length,rowHeight:ue()}),o=u.slice(n.start,n.end),r=(e.selectedPath!==null&&X(e.selectedPath)?e.selectedPath:"")||o.find((s)=>!s.loading)?.path||"",a=pe(),i={currentPath:r,dragPath:O,dropPath:W,headerState:e.isSiteProject?"shown":"hidden",ignoredIcon:a?"eye":"eye-slash",ignoredLabel:a?"Hide ignored files":"Show ignored files",ignoredSelected:a,padBottom:n.padBottom,padTop:n.padTop,projectName:e.projectConfig?.name||e.name,query:e.searchQuery,rootDrop:Z,rows:o.map((s)=>dt(s)),selectedPath:e.selectedPath??"",view:"tree"};return P=i,i}function se(){if(!w||!P)return;P={...P,dragPath:O,dropPath:W,rootDrop:Z},w.handle.update(P)}function f(){Se?.()}async function ut(){let e=vt();e.dirs.clear(),$u(),await To(".");for(let t of e.expanded)await To(t);f()}function ft(e){let t=X(e);if(!t)return;if(t.type==="directory"){Ce(e).then(()=>f());return}Lo(e)}function ht(e,t){let n=vt();if(X(e)?.type!=="directory"||n.expanded.has(e)===t)return;if(!t){n.expanded.delete(e),f();return}Ce(e).then(()=>f())}function Te(e){if(!D||vt().selectedPath===e)return;vt().selectedPath=e,f()}function mt(e,t){let n=Ee(e),o;switch(t){case"Home":{o=q(-1,1);break}case"End":{o=q(u.length,-1);break}case"ArrowUp":{o=q(n,-1);break}case"ArrowLeft":{o=lt(n);break}case"ArrowDown":case"ArrowRight":{o=q(n,1);break}default:return}De(o)}function gt(e,t){let n=Ee(e),o=u.length;for(let r=1;r<=o;r++){let a=(n+r+o)%o,i=u[a];if(i&&!i.loading&&i.name.trim().toLowerCase().startsWith(t)){De(a);return}}}function De(e){let t=u[e];if(!t)return;if(Te(t.path),Re(t.path))return;tb(A,e,ue()),f()}async function Ce(e){let t=vt();if(t.expanded.has(e)){t.expanded.delete(e);return}if(t.expanded.add(e),!t.dirs.has(e))await To(e)}var z=new Map,G=null,O="",K="",W="",Y=!1,Z="";function wt(e){return[...e.dataTransfer?.types??[]].includes("Files")}function Ne(e,t,n){let o=(i)=>{if(!wt(i))return;if(i.preventDefault(),i.stopPropagation(),i.dataTransfer)i.dataTransfer.dropEffect="copy";n(!0)},r=()=>n(!1),a=(i)=>{n(!1);let s=i.dataTransfer?.files;if(!s?.length)return;i.preventDefault(),i.stopPropagation(),Le(s,t,f)};return e.addEventListener("dragover",o),e.addEventListener("dragleave",r),e.addEventListener("drop",a),()=>{e.removeEventListener("dragover",o),e.removeEventListener("dragleave",r),e.removeEventListener("drop",a)}}function le(e,t){let n=e.replaceAll("\\","/"),o=t.replaceAll("\\","/");if(!n||n===o)return!1;if(n.startsWith(`${o}/`)||o.startsWith(`${n}/`))return!1;return Q(n)!==o}function ae(e,t,n){return n==="directory"&&typeof e==="string"&&le(e,t)}function I(e,t){let n=t?e:"";if(K===e&&W===n)return;K=e,W=n,Ie()}function U(e){if(Y===e)return;Y=e,Ie()}function Ie(){Z=Y&&K===""?"true":"",se()}async function Le(e,t,n){if((await Va([...e],{dir:t})).length===0)return;if(t!==".")vt().expanded.add(t);n()}function yt(e,t){let n=document.createElement("input");n.type="file",n.multiple=!0,n.accept=_c(),n.addEventListener("change",()=>{if(n.files?.length)Le(n.files,e,t)}),n.click()}function bt(e,t,n){Oe(e),L.set(t,e);let o=[gs({element:e,getInitialData(){return{entryType:n,path:t,type:"file-tree"}},onDragStart(){O=t,se()},onDrop(){O="",I("",!1),se()}}),Ne(e,n==="directory"?t:Q(t),(r)=>{I(r?t:"",r)}),zs({canDrop({source:r}){return r.data.type==="file-tree"},element:e,getData({source:r}){return ae(r.data.path,t,n)?{targetDir:t,type:"file-tree-target"}:{type:"file-tree-refused"}},onDrag({source:r}){I(t,ae(r.data.path,t,n))},onDragEnter({source:r}){I(t,ae(r.data.path,t,n))},onDragLeave(){I("",!1)},onDrop(){I("",!1)}})];z.set(e,gr(...o))}function Oe(e){let t=z.get(e);if(t)t(),z.delete(e)}function xt(e){if(G?.element===e)return;Ae(),A=e;let t=zs({canDrop({source:o}){return o.data.type==="file-tree"&&le(o.data.path,".")},element:e,getData(){return{targetDir:".",type:"file-tree-target"}},onDragEnter(){U(!0)},onDragLeave(){U(!1)},onDrop(){U(!1)}}),n=Ws({onDrop({source:o,location:r}){let[a]=r.current.dropTargets;if(!a)return;if(o.data.type!=="file-tree")return;if(a.data.type!=="file-tree-target")return;let i=o.data.path,s=a.data.targetDir;if(!le(i,s))return;let l=i.split("/").pop(),c=s==="."?l:`${s}/${l}`;Pt(i,c,f)}});G={cleanup:gr(t,n,Ne(e,".",U)),element:e},ie()}function Ae(){G?.cleanup(),G=null;for(let e of z.values())e();z.clear(),B?.window.destroy(),B=null,A=null,O="",K="",W="",Y=!1,Z=""}async function Pt(e,t,n){let o=p();Ps(e,t);try{let r=await o.renameFile(e,t);ua();for(let[s]of m.tabs.entries())if(s===e)Sv(e,t,t);else if(s.startsWith(`${e}/`)){let l=t+s.slice(e.length);Sv(s,l,l)}let a=Q(e),i=Q(t);if(await To(a),i!==a)await To(i);if(i!==".")vt().expanded.add(i);ze(r,t),n(),cE(`Moved to ${t}`,r,t)}catch(r){k.error(`Could not move ${e}.`,{detail:te(r),path:e,source:"Files"})}}function Q(e){let t=e.replaceAll("\\","/"),n=t.lastIndexOf("/");return n===-1?".":t.slice(0,n)}var H=null;function Me(){H?.close(),H=null}function Ft(e){let t={};if(e.type==="directory"){let n=bp(e.path);if(n?.isSourceRoot===!0&&!n.fileBacked)t.name=n.name;return t}if(t.file=e.path,sa(e.path))t.path=e.path;if(hw(e.path).length>0)t.source=e.path;return t}function S(e,t,n,o={}){return{destructive:!1,disabled:!1,dividerAbove:!1,id:e,run:n,title:t,...o}}function jt(e){let t=ne();if(!t)return[];let n=Ft(e),o=[];for(let r of t.forPlacement("context/file")){let a=r.args;if(!(a?.required??[]).every((l)=>(l in n)))continue;let i={};for(let l of Object.keys(a?.properties??{}))if(l in n)i[l]=n[l];let s=t.disabledReason(r.id);o.push(s===void 0?S(r.id,r.title,()=>{on(t,r.id,i,"Files")}):{destructive:!1,disabled:!0,dividerAbove:!1,id:r.id,requires:s,title:r.title})}return o}function $t(e){let t=e.type==="directory",n=[];if(t){if(n.push(S("files.newFile","New File…",()=>{He(e.path,f)}),S("files.upload","Upload Files…",()=>{yt(e.path,f)})),e.path==="pages"||e.path.endsWith("/pages"))n.push(S("files.pagesGrid","Edit Pages in Grid",()=>{E1()}))}else n.push(S("files.open","Open",()=>{Lo(e.path)}));return n.push(...jt(e),S("files.rename","Rename…",()=>{Ct(e,f)},{dividerAbove:!0}),S("files.delete","Delete",()=>{It(e,f)},{destructive:!0})),n}function St(e,t,n){let o=X(e);if(!o)return;Me();let r=Re(e);H=Nt({label:"File actions",onClosed:(a)=>{if(H===a)H=null},opener:r,origin:{x:t,y:n},region:"files",rows:$t({name:o.name,path:o.path,type:o.type})})}var Rt=JSON.stringify({children:[{children:[],tagName:"p"}],tagName:"div"},null,2),E="__other__";function $e(e){return e.trim().toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d-]/g,"")}function ce(e){let t=e.lastIndexOf(".");return t>0?e.slice(t):""}function kt(e){return[...(e.kind==="locked"?[{ext:e.ext,label:`${Vs(e.ext)?.name??e.ext} (${e.ext})`}]:ge(e.docKind)).map((n)=>({label:n.label,value:n.ext})),{dividerBefore:!0,label:"Other…",value:E}]}function Et(e,t,n){let o=e.kind==="choose"?e.defaultExt:e.ext;if(o!==void 0&&t.some((a)=>a.value===o))return o;let r=ce(n);if(r!==""&&t.some((a)=>a.value===r))return r;return t[0]?.value??E}async function mw(e){let{dir:t,format:n,source:o="Files"}=e;await qt();let r=new Set;try{let g=await p().listDirectory(t);r=new Set(g.map((h)=>h.name.toLowerCase()))}catch{}let a=n!==void 0&&n.kind!=="fixed"?n:null,i=a===null?null:kt(a),s=a===null||i===null?"":Et(a,i,e.suggestedName??""),l=(g,h)=>{let b=g.trim();if(n===void 0||h===E)return b;if(n.kind==="fixed"){let x=$e(b);return x===""?"":`${x}${n.ext}`}return b.toLowerCase().endsWith(h.toLowerCase())?b:`${b}${h}`},c=we(),d=(g,h)=>{let b=g.trim();if(!b)return n?.kind==="fixed"?"Enter a name.":"Enter a file name.";if(n?.kind==="fixed"&&$e(b)==="")return"Enter at least one letter or number.";let x=b.replaceAll("\\","/");if(x.startsWith("/")||x.endsWith("/"))return"Enter a name, not a path that starts or ends with a slash.";if(x.split("/").includes(".."))return"A name cannot step outside the destination folder.";if(x.includes("/")&&n!==void 0&&h!==E)return`Pick Other… to create a file in a subfolder of ${t==="."?"the project root":t}.`;let j=ce(x);if(h!==""&&h!==E&&j!==""&&j.toLowerCase()!==h.toLowerCase()&&c.has(j.toLowerCase()))return`You picked ${i?.find((Ue)=>Ue.value===h)?.label??h}; this name ends in ${j}.`;if(n?.kind==="locked"&&h===E){if(j!==""&&j.toLowerCase()!==n.ext.toLowerCase()&&c.has(j.toLowerCase()))return n.because}let he=l(g,h);return r.has(he.toLowerCase())?`${he} already exists in ${t}/.`:""},F=s,y=await Nn(e.title??"New File",{...i===null?{}:{choice:{initial:s,label:"Format",onChange:(g)=>{F=g},options:()=>i}},confirmLabel:"Create",message:t==="."?"Creating in the project root.":`Creating in ${t}/`,...e.suggestedName===void 0?{}:{placeholder:e.suggestedName},select:i===null?"stem":"all",validate:d,value:e.suggestedName??"untitled.json"});if(!y)return null;let C=l(y,F),N=t==="."?C:`${t}/${C}`;Ps(N);let fe=Zt(C),_e=typeof e.content==="function"?await e.content(ce(C),C):e.content,Ve=n!==void 0&&F!==E,Je=_e??fe?.studio?.newFileTemplate??(fe?"":C.toLowerCase().endsWith(".json")?Ve?Rt:`{}
2
+ `:"");try{return await p().writeFile(N,Je),await To(t),k.success(`Created ${N}`),N}catch(g){return k.error(`Could not create ${N}.`,{detail:te(g),path:N,source:o}),null}}async function He(e,t){await qt();let n=bp(e);if(n?.unresolvedFormat!=null)k.error(`New files in ${e}/ cannot be constrained to the collection's format.`,{detail:`The "${n.name}" content type declares format "${n.unresolvedFormat}", which no installed extension provides. Install the extension that supplies it, or correct `+"the name in Project Settings › Content Types.",path:e,source:"Files"});let o=n?.ext!=null&&n.unresolvedFormat===null,r=o&&n.isSourceRoot&&n.def.schema!==void 0,a;if(r){let{createEntry:i}=await (me("c5h3nqck"),import("./entry-commands-c5h3nqck.js"));a=await i(n.name,{dir:e})}else a=await mw({dir:e,format:o&&n.ext!==null?{because:`${n.name} entries are ${n.ext} files, so a document of another format here would not be one.`,ext:n.ext,kind:"locked"}:{defaultExt:".json",kind:"choose"},suggestedName:"untitled"});if(a!==null)t()}async function Tt(e,t){let n=await Yf(t);return Nn("Rename",{confirmLabel:"Rename",...n===void 0?{}:{message:n},select:"stem",validate:(o)=>o.trim()?"":"Enter a file name.",value:e})}function Dt(e,t){let n=t.references,o=t.tag?`; tag → <${t.tag.to}> (${t.tag.refsUpdated})`:"";if(n&&n.refsUpdated>0)return`Renamed to ${e}; updated ${n.refsUpdated} reference(s) in ${n.filesChanged} file(s)${o}`;if(o)return`Renamed to ${e}${o}`;return`Renamed to ${e}`}function cE(e,t,n){let o=t.errors??[];if(o.length===0){k.success(e);return}let r=o.length===1?"1 file":`${o.length} files`;k.warn(`${e} — references in ${r} could not be updated`,{detail:o.map((a)=>`${a.path}: ${a.error}`).join(`
3
+ `),path:n,source:"Files"})}function ze(e,t){for(let n of e.references?.files??[])if(n.path!==t&&m.tabs.has(n.path))ep(n.path)}function de(e){let t=e.replaceAll("\\","/");return t.includes("/")?t.slice(0,t.lastIndexOf("/")):"."}async function t$(e,t,n){ua();let o=de(e),r=de(t);if(await To(o),r!==o)await To(r);if(vt().selectedPath===e)vt().selectedPath=t;ze(n,t)}async function Ct(e,t){let n=await Tt(e.name,e.path);if(!n||n===e.name)return;let o=de(e.path),r=o==="."?n:`${o}/${n}`;Ps(e.path,r);try{let i=await p().renameFile(e.path,r);if(m.tabs.has(e.path))Sv(e.path,r,r);await t$(e.path,r,i),t(),cE(Dt(n,i),i,r)}catch(a){k.error(`Could not rename ${e.name}.`,{detail:te(a),path:e.path,source:"Files"})}}async function It(e,t){if(!await Jf(e))return;try{let o=p();Ps(e.path),await o.deleteFile(e.path),ua();let r=e.path.replaceAll("\\","/"),a=r.includes("/")?r.slice(0,r.lastIndexOf("/")):".";if(await To(a),vt().selectedPath===e.path)vt().selectedPath=null;t(),k.success(`Deleted ${e.name}`)}catch(o){k.error(`Could not delete ${e.name}.`,{detail:te(o),path:e.path,source:"Files"})}}function Lt(e,t){let n=t.paneId,o=Gu(e);if(n!==void 0&&o){if(o.activeTabId===e&&t.focus===!1)return;Cm(e,n)}ci(e,{focus:t.focus!==!1})}async function Lo(e,t={}){let n=t.focus!==!1;for(let[r,a]of m.tabs.entries())if(a.documentPath===e){if(Lt(r,t),n)vt().selectedPath=e;return}if(ww(e)){if(fE(e,t),n)vt().selectedPath=e;Ff({name:e.split("/").pop()||e,path:e,root:vt().projectRoot});return}if(e.toLowerCase().endsWith(".csv")){try{if(await AE(e,t),n)vt().selectedPath=e;Ff({name:e.split("/").pop()||e,path:e,root:vt().projectRoot})}catch(r){k.error(`Could not open ${e}.`,{detail:te(r),path:e,source:"Open File"})}return}let o=p();try{let r=await o.readFile(e);if(!r){if(await qt(),!Zt(e)&&!e.toLowerCase().endsWith(".json"))throw Lp(e);return}await qt();let a,i,s=null,l=Zt(e);if(l){let d=await Er(e,r);({document:a}=d),{frontmatter:i}=d}else if(e.endsWith(".json"))({document:a,layout:s}=hs(r));else throw Lp(e);if(No({id:e,documentPath:e,document:a,...i!=null&&{frontmatter:i},layout:s,sourceFormat:l?.name??null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1}}),n)vt().selectedPath=e;Ff({name:e.split("/").pop()||e,path:e,root:vt().projectRoot})}catch(r){k.error(`Could not open ${e}.`,{detail:te(r),path:e,source:"Open File"})}}async function gw(e,t){await Lo(t,{focus:!1,paneId:e,preview:!0})}function n1(e){if(wm(e))return;for(let[,t]of m.tabs.entries())if(t.documentPath===e&&!t.doc.dirty){ep(e);return}}function i1(e){for(let t of e)ep(t,{onlyIfChanged:!0})}async function ep(e,t={}){for(let[,n]of m.tabs.entries())if(n.documentPath===e){let o=p(),r=n.doc.dirty,a=()=>!r&&n.doc.dirty||wm(e);try{let i=await o.readFile(e);if(!i)return;if(await qt(),a())return;if(Zt(e)){let{document:s,frontmatter:l}=await Er(e,i);if(a())return;if(t.onlyIfChanged&&ls(s,n.doc.document)&&ls(l,n.doc.content.frontmatter))return;n.doc.document=s,n.doc.content.frontmatter=l}else if(e.endsWith(".json")){let s=hs(i);if(n.doc.layout=s.layout,t.onlyIfChanged&&ls(s.document,n.doc.document))return;n.doc.document=s.document}n.doc.dirty=!1}catch(i){k.error(`Could not reload ${e} after it changed on disk.`,{detail:te(i),key:`reload:${e}`,path:e,source:"Files"})}return}}function o1(){qn({id:"files",title:"Files",level:"project",dock:"navigator",icon:"folder",render:()=>tt,afterRender:(e,t)=>{At(t,e.rerender)}})}var Ot={activate:ft,contextMenu:St,expand:ht,move:mt,newFile:()=>{He(".",f)},openProject:()=>{Rc("project.open",void 0,"Files")},refresh:()=>{ut()},rowHost:bt,search:(e)=>{vt().searchQuery=e,f()},select:Te,toggleIgnored:()=>{ot(!pe()),f()},treeHost:xt,typeahead:gt},w=null,P=null;function At(e,t){let n=e.querySelector(".panel-content")??e;if(Se=t,w&&(w.host!==n||!w.handle.connected()))Mt();let o=pt();if(w)w.handle.update(o);else{let r=je(n,o,Ot);w={handle:r,host:n},r.ready.then(ie)}queueMicrotask(ie)}function Mt(){Me(),w?.handle.dispose(),w=null,P=null,Ae(),L.clear(),u=[]}
4
+ export{Pf,hw,rE,sE,Xg,Qg,pw,aE,lE,Ff,To,Z_,X_,Q_,fw,jf,e1,t1,mw,cE,t$,Lo,gw,n1,i1,ep,o1};
5
+
6
+ //# debugId=8017D335DAC27AE964756E2164756E21
7
+ //# sourceMappingURL=studio-mwxgyn9h.js.map
@@ -1,5 +1,5 @@
1
- function a(t,n=[]){if(t?.tagName==="slot"){let e=t.attributes?.name;n.push(typeof e==="string"?e.trim():"")}if(Array.isArray(t?.children))for(let e of t.children)a(typeof e==="string"?void 0:e,n);return n}function pb(t){let n=a(t),e=n.filter((s)=>s==="").length;if(e>1)return`Component has ${e} unnamed <slot> elements — only one default slot is allowed. Give extra slots a name attribute.`;let r=new Set;for(let s of n){if(s&&r.has(s))return`Duplicate slot name "${s}" — slot names must be unique within a component.`;r.add(s)}return null}
2
- export{pb};
1
+ function a(t,n=[]){if(t?.tagName==="slot"){let e=t.attributes?.name;n.push(typeof e==="string"?e.trim():"")}if(Array.isArray(t?.children))for(let e of t.children)a(typeof e==="string"?void 0:e,n);return n}function wb(t){let n=a(t),e=n.filter((s)=>s==="").length;if(e>1)return`Component has ${e} unnamed <slot> elements — only one default slot is allowed. Give extra slots a name attribute.`;let r=new Set;for(let s of n){if(s&&r.has(s))return`Duplicate slot name "${s}" — slot names must be unique within a component.`;r.add(s)}return null}
2
+ export{wb};
3
3
 
4
- //# debugId=C7F8347A159364EA64756E2164756E21
5
- //# sourceMappingURL=studio-x5esgzct.js.map
4
+ //# debugId=AAD7634503E4F45564756E2164756E21
5
+ //# sourceMappingURL=studio-n78gjfy8.js.map
@@ -0,0 +1,5 @@
1
+ function nt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ot(e){return nt(e)&&typeof e.$ref==="string"}function Za(e){return nt(e)&&e.$prototype==="Function"}function ba(e){return nt(e)&&nt(e.$expression)}function Mv(e){return ba(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Tk(e){return Za(e)&&Array.isArray(e.body)}function Lk(e){return nt(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function Ik(e){return nt(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function Vx(e){return nt(e)&&e.$prototype==="Array"}function Ks(e){return typeof e==="string"&&e.includes("${")}function Rk(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function ih(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function va(e,n){let t=e?.[n];return ih(t)?t:void 0}function oh(e,n){let t=e[n];if(ih(t))return t;let r={};return e[n]=r,r}function rh(e){return Ot(e)||Za(e)||ba(e)}function Op(e,n){let t=e[n];return rh(t)?t:void 0}function Pv(e){if(!e)return[];return e.map((n)=>typeof n==="string"?n:n.name)}function Hd(e){if(!nt(e)||!nt(e.$expression))return!1;let n=e.$expression;if(n.operator==="?:")return typeof n.value==="string"&&typeof n.initial==="string";if(n.operator==="switch")return nt(n.cases)&&Object.values(n.cases).every((t)=>typeof t==="string")&&typeof n.default==="string";return!1}function $k(e){if(typeof e==="string")return[e];if(!Hd(e))return[];let n=e.$expression;if(n.operator==="?:")return[...new Set([n.value,n.initial])];return[...new Set([...Object.values(n.cases),n.default])]}function qe(e){return typeof e==="string"?e:$k(e).join("|")}function Mp(e){return e.startsWith("#")}
2
+ export{nt,Ot,Za,ba,Mv,Tk,Lk,Ik,Vx,Ks,Rk,ih,va,oh,rh,Op,Pv,Hd,$k,qe,Mp};
3
+
4
+ //# debugId=DBCFD34E007C461F64756E2164756E21
5
+ //# sourceMappingURL=studio-nbxqcgvf.js.map
@@ -1,5 +1,5 @@
1
- import{QC}from"./studio-sq1bn60g.js";import{T,R,ps,Em}from"./studio-zmecp6hq.js";import{v}from"./studio-9rhmettf.js";import{He}from"./studio-cnspfke5.js";var w={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMenu",$description:"A Studio menu: one jx-menu whose rows are a projection of command records the adapter hands in as `rows`. Nothing here decides what a row says; a row prints its record's title, chord, disabled reason and destructive flag, a divider falls where the adapter marked a group boundary, and a row with children owns a one-level submenu of the same shape. The chord and the reason are rendered only when present, so a row's text is its title.",tagName:"jx-menu",$props:{label:{$ref:"#/state/label"},x:{$ref:"#/state/x"},y:{$ref:"#/state/y"},floor:{$ref:"#/state/floor"},placement:{$ref:"#/state/placement"}},onselect:{$ref:"#/state/select"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"},haspopup:{$ref:"$map/item/haspopup"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}},{tagName:"span",attributes:{slot:"submenu"},$switch:{$ref:"$map/item/haspopup"},cases:{true:{tagName:"jx-menu",$props:{label:{$ref:"$map/item/submenuLabel"}},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}}]}]}}]}}}]}]}}]};T("menu",w);var M="block-end span-inline-end";function j(e){if(e.placement!==void 0)return e.placement;return e.opener&&!e.origin&&!e.place&&!e.floor?M:""}function E(e){if(!e)return{x:0,y:0};let n=He(e);return{x:Math.round(n.left),y:Math.round(n.bottom)}}function p(e,n=0){let r=n===0?(e.children??[]).map((t)=>p(t,1)):[];return{...e,checked:e.checked??"",children:r,chord:e.chord??"",enabled:!e.disabled,haspopup:r.length>0,noChord:!e.chord,noDivider:!e.dividerAbove,requires:e.requires??"",submenuLabel:e.submenuLabel??e.title}}function N(e,n){for(let r of e){if(r.id===n)return r;let t=r.children.find((d)=>d.id===n);if(t)return t}return}var L={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function $t(e){let n=ps("popover",e.region),r=new AbortController,t=null,d=null,i=!1,f=()=>{if(i)return;i=!0,r.abort(),d?.(),d=null,Em("popover",e.region),P(e.opener??null),e.onClosed?.(u)},h=e.place?e.place(L):e.origin??E(e.opener),l=v({floor:e.floor?.()??0,label:e.label,placement:j(e),rows:e.rows.map((o)=>p(o)),select:(o,m)=>{let a=String(m.detail),s=N(l.rows,a);if(!s)return;if(s.run)s.run();else e.run?.(a);u.close()},x:h.x,y:h.y}),b=()=>{if(i||!t||!e.place)return;let o=e.place(He(t));l.x=o.x,l.y=o.y},y=(async()=>{let o=await R("menu",l,n,{signal:r.signal});if(r.signal.aborted)return;if({dispose:d}=o,t=o.root,t.addEventListener("toggle",(a)=>{if(a.newState==="closed")f()}),!t.hasAttribute("popover"))await new Promise((a)=>{t.addEventListener("jx-ready",()=>a(),{once:!0})});if(r.signal.aborted)return;let m=e.opener instanceof HTMLElement&&e.opener!==document.body?e.opener:void 0;t.showPopover(m?{source:m}:void 0),b(),requestAnimationFrame(b)})(),u={close:()=>{if(i)return;if(t?.open)t.hidePopover();f()},host:n,ready:y,setRows:(o)=>{if(i)return;let a=document.activeElement?.closest("jx-menu"),s=a&&a!==t?a.parentElement?.closest("jx-menu-item")?.dataset.commandId:void 0;l.rows=o.map((c)=>p(c)),setTimeout(()=>{if(i||!t||t.contains(document.activeElement))return;let c=s?t.querySelector(`jx-menu-item[data-command-id="${s}"]`):null,g=c?.querySelector("jx-menu")??null;if(c&&!(g?.open&&g.querySelector("jx-menu-item")))c.focus();else QC(t)},0)}};return u}function P(e){let n=document.activeElement;if(e?.isConnected&&(!n||n===document.body))e.focus()}
2
- export{$t};
1
+ import{_k}from"./studio-0k9mvpgj.js";import{T,R,vs,Nm}from"./studio-spf2skgc.js";import{v}from"./studio-fqq890ap.js";import{Oe}from"./studio-vavmwshr.js";var w={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMenu",$description:"A Studio menu: one jx-menu whose rows are a projection of command records the adapter hands in as `rows`. Nothing here decides what a row says; a row prints its record's title, chord, disabled reason and destructive flag, a divider falls where the adapter marked a group boundary, and a row with children owns a one-level submenu of the same shape. The chord and the reason are rendered only when present, so a row's text is its title.",tagName:"jx-menu",$props:{label:{$ref:"#/state/label"},x:{$ref:"#/state/x"},y:{$ref:"#/state/y"},floor:{$ref:"#/state/floor"},placement:{$ref:"#/state/placement"}},onselect:{$ref:"#/state/select"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"},haspopup:{$ref:"$map/item/haspopup"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}},{tagName:"span",attributes:{slot:"submenu"},$switch:{$ref:"$map/item/haspopup"},cases:{true:{tagName:"jx-menu",$props:{label:{$ref:"$map/item/submenuLabel"}},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}}]}]}}]}}}]}]}}]};T("menu",w);var M="block-end span-inline-end";function j(e){if(e.placement!==void 0)return e.placement;return e.opener&&!e.origin&&!e.place&&!e.floor?M:""}function E(e){if(!e)return{x:0,y:0};let n=Oe(e);return{x:Math.round(n.left),y:Math.round(n.bottom)}}function p(e,n=0){let r=n===0?(e.children??[]).map((t)=>p(t,1)):[];return{...e,checked:e.checked??"",children:r,chord:e.chord??"",enabled:!e.disabled,haspopup:r.length>0,noChord:!e.chord,noDivider:!e.dividerAbove,requires:e.requires??"",submenuLabel:e.submenuLabel??e.title}}function N(e,n){for(let r of e){if(r.id===n)return r;let t=r.children.find((d)=>d.id===n);if(t)return t}return}var L={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Nt(e){let n=vs("popover",e.region),r=new AbortController,t=null,d=null,i=!1,f=()=>{if(i)return;i=!0,r.abort(),d?.(),d=null,Nm("popover",e.region),P(e.opener??null),e.onClosed?.(u)},h=e.place?e.place(L):e.origin??E(e.opener),l=v({floor:e.floor?.()??0,label:e.label,placement:j(e),rows:e.rows.map((o)=>p(o)),select:(o,m)=>{let a=String(m.detail),s=N(l.rows,a);if(!s)return;if(s.run)s.run();else e.run?.(a);u.close()},x:h.x,y:h.y}),b=()=>{if(i||!t||!e.place)return;let o=e.place(Oe(t));l.x=o.x,l.y=o.y},y=(async()=>{let o=await R("menu",l,n,{signal:r.signal});if(r.signal.aborted)return;if({dispose:d}=o,t=o.root,t.addEventListener("toggle",(a)=>{if(a.newState==="closed")f()}),!t.hasAttribute("popover"))await new Promise((a)=>{t.addEventListener("jx-ready",()=>a(),{once:!0})});if(r.signal.aborted)return;let m=e.opener instanceof HTMLElement&&e.opener!==document.body?e.opener:void 0;t.showPopover(m?{source:m}:void 0),b(),requestAnimationFrame(b)})(),u={close:()=>{if(i)return;if(t?.open)t.hidePopover();f()},host:n,ready:y,setRows:(o)=>{if(i)return;let a=document.activeElement?.closest("jx-menu"),s=a&&a!==t?a.parentElement?.closest("jx-menu-item")?.dataset.commandId:void 0;l.rows=o.map((c)=>p(c)),setTimeout(()=>{if(i||!t||t.contains(document.activeElement))return;let c=s?t.querySelector(`jx-menu-item[data-command-id="${s}"]`):null,g=c?.querySelector("jx-menu")??null;if(c&&!(g?.open&&g.querySelector("jx-menu-item")))c.focus();else _k(t)},0)}};return u}function P(e){let n=document.activeElement;if(e?.isConnected&&(!n||n===document.body))e.focus()}
2
+ export{Nt};
3
3
 
4
- //# debugId=EAFE655A70AF6B0B64756E2164756E21
5
- //# sourceMappingURL=studio-p1eggxcf.js.map
4
+ //# debugId=78207AFC52B59A5764756E2164756E21
5
+ //# sourceMappingURL=studio-nt06yybj.js.map
@@ -1,9 +1,9 @@
1
- import{bv}from"./studio-sq1bn60g.js";import{v}from"./studio-9rhmettf.js";import{Il,dv,u}from"./studio-ks7cksh0.js";import{Di,Go,y}from"./studio-cktcdsxz.js";import{at}from"./studio-8r4y2x0z.js";import{st,gi,Sl,Lu,ur,tC,sC}from"./studio-vwz7rma2.js";import{D,Cc}from"./studio-73czgk6a.js";import{T,R}from"./studio-zmecp6hq.js";import{me}from"./studio-7gqyhjns.js";var jg={$sections:[{label:"Headings",elements:[{tag:"h1",text:"Code Is Poetry"},{tag:"h2",text:"Code Is Poetry"},{tag:"h3",text:"Code Is Poetry"},{tag:"h4",text:"Code Is Poetry"},{tag:"h5",text:"Code Is Poetry"},{tag:"h6",text:"Code Is Poetry"}]},{label:"Paragraph",elements:[{tag:"p",text:"In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."}]},{label:"List",elements:[{tag:"ul",children:[{tag:"li",text:"Alice."},{tag:"li",text:"The White Rabbit."},{tag:"li",text:"The Cheshire Cat."},{tag:"li",text:"The Mad Hatter."},{tag:"li",text:"The Queen of Hearts."}]},{tag:"ol",children:[{tag:"li",text:"First item"},{tag:"li",text:"Second item"},{tag:"li",text:"Third item"}]}]},{label:"Quote",elements:[{tag:"blockquote",children:[{tag:"p",text:"In quoting others, we cite ourselves.",style:"font-size:1.25em;font-style:italic"},{tag:"p",text:"— Julio Cortázar"}]}]},{label:"Code",elements:[{tag:"pre",children:[{tag:"code",text:`// A "block" is the abstract term used
1
+ import{$v}from"./studio-0k9mvpgj.js";import{v}from"./studio-fqq890ap.js";import{Nl,Cv,u}from"./studio-cvbkkfqb.js";import{Di,qo,y}from"./studio-zpnk016a.js";import{st}from"./studio-pwqfmt4p.js";import{lt,bi,Il,Ou,hr,kC,IC}from"./studio-ceb34dxj.js";import{D,Lc}from"./studio-tp642n5g.js";import{T,R}from"./studio-spf2skgc.js";import{me}from"./studio-0bbxhhce.js";var qg={$sections:[{label:"Headings",elements:[{tag:"h1",text:"Code Is Poetry"},{tag:"h2",text:"Code Is Poetry"},{tag:"h3",text:"Code Is Poetry"},{tag:"h4",text:"Code Is Poetry"},{tag:"h5",text:"Code Is Poetry"},{tag:"h6",text:"Code Is Poetry"}]},{label:"Paragraph",elements:[{tag:"p",text:"In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."}]},{label:"List",elements:[{tag:"ul",children:[{tag:"li",text:"Alice."},{tag:"li",text:"The White Rabbit."},{tag:"li",text:"The Cheshire Cat."},{tag:"li",text:"The Mad Hatter."},{tag:"li",text:"The Queen of Hearts."}]},{tag:"ol",children:[{tag:"li",text:"First item"},{tag:"li",text:"Second item"},{tag:"li",text:"Third item"}]}]},{label:"Quote",elements:[{tag:"blockquote",children:[{tag:"p",text:"In quoting others, we cite ourselves.",style:"font-size:1.25em;font-style:italic"},{tag:"p",text:"— Julio Cortázar"}]}]},{label:"Code",elements:[{tag:"pre",children:[{tag:"code",text:`// A "block" is the abstract term used
2
2
  // to describe units of markup that
3
3
  // when composed together, form the
4
4
  // content or layout of a page.
5
- registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",O);function z(e,o){let t=document.createElement("div");t.style.display="contents";let n=v({...e,...o}),r=null,s=!1;function i(){s=!0,R("stylebook-chrome",n,t).then((d)=>{s=!1,r=d})}return i(),{host:t,update(d){if(Object.assign(n,d),s||r!==null&&t.contains(r.root))return;r?.dispose(),r=null,t.textContent="",i()}}}function E(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function w(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}var M="& .element-card-preview";function Mg(e){let o=e,t={},n=(r)=>{let s={};for(let[i,d]of Object.entries(r))if(i!=="@--")s[i]=d;return s};for(let[r,s]of Object.entries(o)){if(!w(s)){t[r]=s;continue}if(r==="@--")continue;if(bv(r)){t[r]=s;continue}if(r.startsWith("@")){let i={};for(let[d,g]of Object.entries(s))if(w(g)&&E(d))i[`${M} ${d}`]=n(g);else i[d]=g;t[r]=i;continue}if(E(r)){t[`${M} ${r}`]=n(s);continue}t[r]=s}return t}function I(e,o){let t=o.split(" "),n=e;for(let r of t){if(!w(n))return null;n=n[r]}return w(n)?n:null}function J(e,o){let t=e,n=I(t,o);if(n&&Object.keys(n).length>0)return!0;for(let[r,s]of Object.entries(t)){if(!r.startsWith("@")||!w(s))continue;let i=I(s,o);if(i&&Object.keys(i).length>0)return!0}return!1}function _(e){let o=new Map,t=new Map,n=e.filter.toLowerCase(),r=(a,c,h)=>{let p=a.tag===h?h:`${h} ${a.tag}`;o.set(Sl(c),p);let m=a.children??[];for(let[l,C]of m.entries())r(C,[...c,"children",l],h)},s=(a)=>{let c={...a.attributes};if(a.style)c.style=a.style;return{tagName:a.tag,...a.text?{textContent:a.text}:{},...Object.keys(c).length>0?{attributes:c}:{},...a.children?{children:a.children.map(s)}:{}}},i=(a,c,h,p,m)=>{o.set(Sl(p),a),o.set(Sl([...p,"children",0]),a);let l=[...p,"children",0,"children",0];if(m)r(m,l,a);else o.set(Sl(l),a);if(!t.has(a))t.set(a,p);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[h],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:c}],tagName:"div"}},d=[],g=(a,c)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:a},{attributes:{class:"sb-body"},children:c,tagName:"div"}],tagName:"div"}),f=()=>["children",d.length,"children",1];for(let a of e.meta.$sections){let c=a.elements;if(n)c=c.filter((m)=>m.tag.includes(n)||a.label.toLowerCase().includes(n));if(e.customizedOnly)c=c.filter((m)=>J(e.effectiveStyle,m.tag));if(c.length===0)continue;let h=f(),p=c.map((m,l)=>i(m.tag,`<${m.tag}>`,s(m),[...h,"children",l],m));d.push(g(a.label,p))}let b=[];{let a=e.components;if(n)a=a.filter((c)=>c.tagName.toLowerCase().includes(n));if(e.customizedOnly)a=a.filter((c)=>J(e.effectiveStyle,c.tagName));if(a.length>0){let c=f(),h=a.map((p,m)=>{let l=[...c,"children",m];if(p.source!=="npm"&&p.path?.endsWith(".json")){b.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${p.path}`.replace(/^\/+/,"/")});let j={};for(let k of p.props??[])if(k.default!==void 0&&k.default!=="false"&&k.default!=="''")j[k.name]=String(k.default).replaceAll(/^'|'$/g,"");let q={tagName:p.tagName,...Object.keys(j).length>0?{attributes:j}:{}};return i(p.tagName,`<${p.tagName}>`,q,l,null)}let V={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${p.tagName}>`};return i(p.tagName,`<${p.tagName}>`,V,l,null)});d.push(g("Components",h))}}if(d.length===0)d.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});return{doc:{...b.length>0?{$elements:b}:{},$media:e.effectiveMedia,attributes:{class:"sb-root"},children:d,style:Mg(e.effectiveStyle),tagName:"div"},pathToTag:o,tagToCardPath:t}}var Pg="Project Styles",Ek="stylebook",By=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function L(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function C_(e){let o=L(e);if(o==="other")return e;let{prefix:t}=By.find((n)=>n.id===o);return dv(e,t)}function U(e){if(!e)return[];let o=[];for(let[t,n]of Object.entries(e)){if(!t.startsWith("--"))continue;if(typeof n!=="string"&&typeof n!=="number")continue;o.push({group:L(t),label:C_(t),name:t,value:n})}return o}function Tk(e){let o=U(e);return By.map((t)=>({group:t,tokens:o.filter((n)=>n.group===t.id)}))}function Lk(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=ur(e),n=[],r=[];for(let{name:i,query:d}of o){let g=Lu(d);if(g)n.push({key:`@${i}`,kind:"scheme",label:g==="dark"?"Dark":"Light",name:i,scheme:g});else r.push({key:`@${i}`,kind:"feature",label:`@${i}`,name:i})}let s=t.map(({name:i})=>({key:`@${i}`,kind:"size",label:`@${i}`,name:i}));return[...n,...s,...r]}function A(e,o){let t=e[o.key];return t&&typeof t==="object"?t:void 0}function Fg(e,o,t){let n=A(e,o)?.[t];return typeof n==="string"||typeof n==="number"?n:void 0}function S_(e,o,t,n){if(n){let s=e[o.key]??={};s[t]=n;return}let r=A(e,o);if(!r)return;if(delete r[t],Object.keys(r).length===0)delete e[o.key]}function Ik(e,o,t,n=[]){let r=new Set(n.map((s)=>s.name));return o.filter((s)=>!r.has(s.name)&&Fg(e,s,t)===void 0)}var W=new WeakMap;function K(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:y.stylebook.customizedOnly,filter:y.stylebook.filter,filterLabel:`Filter the ${Pg} catalogue`,title:Pg},t=W.get(e);if(t)return t.update(o),t.host;let n=z(o,{setFilter:(r)=>{y.stylebook.filter=r},toggleCustomized:()=>{y.stylebook.customizedOnly=!y.stylebook.customizedOnly}});return W.set(e,n),n.host}async function Rk(e,o){let t=e.wrap,n=st(e.paneId),r=y.stylebook.filter.toLowerCase(),{customizedOnly:s}=y.stylebook,i=Di(n?.doc.document?.$media),{sizeBreakpoints:d,baseWidth:g}=ur(i),f=d.length>0,b=K(e);t.style.overflow="hidden";let S=[];if(f){S.push({displayName:gi("--"),name:"base",width:g});for(let l of d)S.push({displayName:gi(l.name),name:l.name,width:l.width})}let a;if(!f){let l=i&&i["--"],C=l?`${gi("--")} (${g}px)`:null;a=[o.canvasPanelEntry(l?"base":null,C,!l,l?g:void 0)]}else a=S.map((l)=>o.canvasPanelEntry(l.name,`${l.displayName} (${l.width}px)`,!1,l.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:a.map((l)=>l.item)},a))return;let h=o.stageHost(e,"chrome-host");if(h&&h.firstChild!==b)h.replaceChildren(b);let p=_({components:at,customizedOnly:Boolean(s),effectiveMedia:i??{},effectiveStyle:Go(n?.doc.document?.style),filter:r,meta:jg,projectRoot:D?.projectRoot??null}),{panels:m}=e;for(let{panel:l}of a)m.push(l),tC(e.renderGeneration,p,l.canvas,l._width);if(f)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function fu(e,o,{panCanvas:t=!1}={}){if(y.stylebook.selection=e,Cc(u.value,{selection:[[]],ui:{activeSelector:e,rightTab:"style",...o!==void 0?{activeMedia:o}:{}}}),e&&t)sC(e)}var Q=8,zy=[{id:"properties",title:"Content"},{id:"style",title:"Style"},{id:"events",title:"Logic"},{id:"assistant",title:"Assistant"}];function Wy(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var x=(e)=>e.document.open,P=(e)=>e.selection.count>0&&e.editor.kind==="canvas",N=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Il(o)),B="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",H=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Vh(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:x,requires:"an open document",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:x,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:x,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let n=t.selection.paths.length;return`Duplicated ${n} element${n===1?"":"s"}; the ${n===1?"copy is":"copies are"} selected at ${H(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:P,enablement:(t)=>N(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(me("c3e7q61z"),import("./convert-to-repeater-c3e7q61z.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:n})=>{let r=t.selection.paths.length;return`Deleted ${r} element${r===1?"":"s"} at ${H(t.selection.paths)} in one undo step; the selection is now ${n.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:P,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:x,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...Z(e),...Y(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function Z(e){let o=0;return e.panelRoster.map((t)=>{let n={id:`panel.focus.${t.id}`,title:`Show ${t.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(r)=>r.project.open&&(t.when?.(r)??!0),run:()=>e.focusPanel(t.id)};if(t.rail!==!1&&o<Q)o+=1,n.keybinding=`mod+${o}`;return n})}function Y(e){return zy.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(r)=>r.document.open,run:()=>e.focusInspectorTab(o.id)}))}
6
- export{Mg,Pg,Ek,By,C_,Tk,Lk,Fg,S_,Ik,jg,Rk,fu,zy,Wy,Vh};
5
+ registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",O);function z(e,o){let t=document.createElement("div");t.style.display="contents";let n=v({...e,...o}),r=null,s=!1;function i(){s=!0,R("stylebook-chrome",n,t).then((d)=>{s=!1,r=d})}return i(),{host:t,update(d){if(Object.assign(n,d),s||r!==null&&t.contains(r.root))return;r?.dispose(),r=null,t.textContent="",i()}}}function E(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function w(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}var M="& .element-card-preview";function Wg(e){let o=e,t={},n=(r)=>{let s={};for(let[i,d]of Object.entries(r))if(i!=="@--")s[i]=d;return s};for(let[r,s]of Object.entries(o)){if(!w(s)){t[r]=s;continue}if(r==="@--")continue;if($v(r)){t[r]=s;continue}if(r.startsWith("@")){let i={};for(let[d,g]of Object.entries(s))if(w(g)&&E(d))i[`${M} ${d}`]=n(g);else i[d]=g;t[r]=i;continue}if(E(r)){t[`${M} ${r}`]=n(s);continue}t[r]=s}return t}function I(e,o){let t=o.split(" "),n=e;for(let r of t){if(!w(n))return null;n=n[r]}return w(n)?n:null}function J(e,o){let t=e,n=I(t,o);if(n&&Object.keys(n).length>0)return!0;for(let[r,s]of Object.entries(t)){if(!r.startsWith("@")||!w(s))continue;let i=I(s,o);if(i&&Object.keys(i).length>0)return!0}return!1}function _(e){let o=new Map,t=new Map,n=e.filter.toLowerCase(),r=(a,c,h)=>{let p=a.tag===h?h:`${h} ${a.tag}`;o.set(Il(c),p);let m=a.children??[];for(let[l,C]of m.entries())r(C,[...c,"children",l],h)},s=(a)=>{let c={...a.attributes};if(a.style)c.style=a.style;return{tagName:a.tag,...a.text?{textContent:a.text}:{},...Object.keys(c).length>0?{attributes:c}:{},...a.children?{children:a.children.map(s)}:{}}},i=(a,c,h,p,m)=>{o.set(Il(p),a),o.set(Il([...p,"children",0]),a);let l=[...p,"children",0,"children",0];if(m)r(m,l,a);else o.set(Il(l),a);if(!t.has(a))t.set(a,p);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[h],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:c}],tagName:"div"}},d=[],g=(a,c)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:a},{attributes:{class:"sb-body"},children:c,tagName:"div"}],tagName:"div"}),f=()=>["children",d.length,"children",1];for(let a of e.meta.$sections){let c=a.elements;if(n)c=c.filter((m)=>m.tag.includes(n)||a.label.toLowerCase().includes(n));if(e.customizedOnly)c=c.filter((m)=>J(e.effectiveStyle,m.tag));if(c.length===0)continue;let h=f(),p=c.map((m,l)=>i(m.tag,`<${m.tag}>`,s(m),[...h,"children",l],m));d.push(g(a.label,p))}let b=[];{let a=e.components;if(n)a=a.filter((c)=>c.tagName.toLowerCase().includes(n));if(e.customizedOnly)a=a.filter((c)=>J(e.effectiveStyle,c.tagName));if(a.length>0){let c=f(),h=a.map((p,m)=>{let l=[...c,"children",m];if(p.source!=="npm"&&p.path?.endsWith(".json")){b.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${p.path}`.replace(/^\/+/,"/")});let j={};for(let k of p.props??[])if(k.default!==void 0&&k.default!=="false"&&k.default!=="''")j[k.name]=String(k.default).replaceAll(/^'|'$/g,"");let q={tagName:p.tagName,...Object.keys(j).length>0?{attributes:j}:{}};return i(p.tagName,`<${p.tagName}>`,q,l,null)}let V={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${p.tagName}>`};return i(p.tagName,`<${p.tagName}>`,V,l,null)});d.push(g("Components",h))}}if(d.length===0)d.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});return{doc:{...b.length>0?{$elements:b}:{},$media:e.effectiveMedia,attributes:{class:"sb-root"},children:d,style:Wg(e.effectiveStyle),tagName:"div"},pathToTag:o,tagToCardPath:t}}var Vg="Project Styles",WS="stylebook",Qy=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function L(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function j_(e){let o=L(e);if(o==="other")return e;let{prefix:t}=Qy.find((n)=>n.id===o);return Cv(e,t)}function U(e){if(!e)return[];let o=[];for(let[t,n]of Object.entries(e)){if(!t.startsWith("--"))continue;if(typeof n!=="string"&&typeof n!=="number")continue;o.push({group:L(t),label:j_(t),name:t,value:n})}return o}function VS(e){let o=U(e);return Qy.map((t)=>({group:t,tokens:o.filter((n)=>n.group===t.id)}))}function US(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=hr(e),n=[],r=[];for(let{name:i,query:d}of o){let g=Ou(d);if(g)n.push({key:`@${i}`,kind:"scheme",label:g==="dark"?"Dark":"Light",name:i,scheme:g});else r.push({key:`@${i}`,kind:"feature",label:`@${i}`,name:i})}let s=t.map(({name:i})=>({key:`@${i}`,kind:"size",label:`@${i}`,name:i}));return[...n,...s,...r]}function A(e,o){let t=e[o.key];return t&&typeof t==="object"?t:void 0}function Ug(e,o,t){let n=A(e,o)?.[t];return typeof n==="string"||typeof n==="number"?n:void 0}function H_(e,o,t,n){if(n){let s=e[o.key]??={};s[t]=n;return}let r=A(e,o);if(!r)return;if(delete r[t],Object.keys(r).length===0)delete e[o.key]}function qS(e,o,t,n=[]){let r=new Set(n.map((s)=>s.name));return o.filter((s)=>!r.has(s.name)&&Ug(e,s,t)===void 0)}var W=new WeakMap;function K(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:y.stylebook.customizedOnly,filter:y.stylebook.filter,filterLabel:`Filter the ${Vg} catalogue`,title:Vg},t=W.get(e);if(t)return t.update(o),t.host;let n=z(o,{setFilter:(r)=>{y.stylebook.filter=r},toggleCustomized:()=>{y.stylebook.customizedOnly=!y.stylebook.customizedOnly}});return W.set(e,n),n.host}async function GS(e,o){let t=e.wrap,n=lt(e.paneId),r=y.stylebook.filter.toLowerCase(),{customizedOnly:s}=y.stylebook,i=Di(n?.doc.document?.$media),{sizeBreakpoints:d,baseWidth:g}=hr(i),f=d.length>0,b=K(e);t.style.overflow="hidden";let S=[];if(f){S.push({displayName:bi("--"),name:"base",width:g});for(let l of d)S.push({displayName:bi(l.name),name:l.name,width:l.width})}let a;if(!f){let l=i&&i["--"],C=l?`${bi("--")} (${g}px)`:null;a=[o.canvasPanelEntry(l?"base":null,C,!l,l?g:void 0)]}else a=S.map((l)=>o.canvasPanelEntry(l.name,`${l.displayName} (${l.width}px)`,!1,l.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:a.map((l)=>l.item)},a))return;let h=o.stageHost(e,"chrome-host");if(h&&h.firstChild!==b)h.replaceChildren(b);let p=_({components:st,customizedOnly:Boolean(s),effectiveMedia:i??{},effectiveStyle:qo(n?.doc.document?.style),filter:r,meta:qg,projectRoot:D?.projectRoot??null}),{panels:m}=e;for(let{panel:l}of a)m.push(l),kC(e.renderGeneration,p,l.canvas,l._width);if(f)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function wu(e,o,{panCanvas:t=!1}={}){if(y.stylebook.selection=e,Lc(u.value,{selection:[[]],ui:{activeSelector:e,rightTab:"style",...o!==void 0?{activeMedia:o}:{}}}),e&&t)IC(e)}var Q=8,ew=[{id:"properties",title:"Content"},{id:"style",title:"Style"},{id:"events",title:"Logic"},{id:"assistant",title:"Assistant"}];function tw(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var x=(e)=>e.document.open,P=(e)=>e.selection.count>0&&e.editor.kind==="canvas",N=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Nl(o)),B="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",H=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Jh(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:x,requires:"an open document",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:x,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:x,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let n=t.selection.paths.length;return`Duplicated ${n} element${n===1?"":"s"}; the ${n===1?"copy is":"copies are"} selected at ${H(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:P,enablement:(t)=>N(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(me("grfep2w8"),import("./convert-to-repeater-grfep2w8.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:n})=>{let r=t.selection.paths.length;return`Deleted ${r} element${r===1?"":"s"} at ${H(t.selection.paths)} in one undo step; the selection is now ${n.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:P,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:x,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...Z(e),...Y(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function Z(e){let o=0;return e.panelRoster.map((t)=>{let n={id:`panel.focus.${t.id}`,title:`Show ${t.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(r)=>r.project.open&&(t.when?.(r)??!0),run:()=>e.focusPanel(t.id)};if(t.rail!==!1&&o<Q)o+=1,n.keybinding=`mod+${o}`;return n})}function Y(e){return ew.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(r)=>r.document.open,run:()=>e.focusInspectorTab(o.id)}))}
6
+ export{Wg,Vg,WS,Qy,j_,VS,US,Ug,H_,qS,qg,GS,wu,ew,tw,Jh};
7
7
 
8
- //# debugId=DD7A3054C416250864756E2164756E21
9
- //# sourceMappingURL=studio-hc9q4j24.js.map
8
+ //# debugId=672B287246E1308B64756E2164756E21
9
+ //# sourceMappingURL=studio-p7c1agz0.js.map
@@ -1,5 +1,5 @@
1
- import{f}from"./studio-jsv3s3s1.js";import{D}from"./studio-73czgk6a.js";function p(n,r=[]){if(!n||typeof n!=="object"||Array.isArray(n))return r;let t=n;if(t.tagName==="slot"){let o=t.attributes?.name,l=typeof o==="string"?o.trim():"",{children:a}=t;r.push({name:l,...Array.isArray(a)&&a.length>0?{fallback:a}:{}})}if(Array.isArray(t.children))for(let e of t.children)p(e,r);return r}function m(n){if(n==null)return!1;if(typeof n!=="object")return!0;let r=n;return!r.$prototype&&!r.$handler&&!r.$compute}function ix(n,r){if(!n||typeof n!=="object"||Array.isArray(n))return null;let t=n,{tagName:e}=t;if(typeof e!=="string"||!e.includes("-"))return null;let o=p(t),l=t.state??{};return{$id:typeof t.$id==="string"&&t.$id?t.$id:null,hasElements:Array.isArray(t.$elements)&&t.$elements.length>0,path:r,props:Object.entries(l).filter(([,a])=>m(a)).map(([a,s])=>{if(typeof s!=="object"||s===null)return{default:s,name:a,type:typeof s};let i=s;return{default:i.default,format:i.format,name:a,type:i.type}}),...o.length>0?{slots:o}:{},tagName:e}}var at=[],u=!1;async function Tl(){try{at=await f().discoverComponents(D?.projectRoot||void 0),u=!0}catch{u=!0}}function pC(n,r){if(!n)return!1;let t=at.findIndex((l)=>l.path===n),e=ix(r,n);if(!e){if(t===-1)return!1;return at.splice(t,1),!0}let o=e;if(t===-1)at.push(o);else at[t]=o;return!0}function rm(n){let r=Object.fromEntries((n.props??[]).map((e)=>[e.name,e.default!==void 0?e.default:""])),t=[];for(let e of n.slots??[])for(let o of structuredClone(e.fallback??[]))if(!e.name)t.push(o);else if(typeof o==="object"&&o!==null&&typeof o.tagName==="string")o.attributes={slot:e.name,...o.attributes},t.push(o);else t.push({attributes:{slot:e.name},children:[o],tagName:"span"});return{$props:r,tagName:n.tagName,...t.length>0?{children:t}:{}}}function gc(n,r){if(!n)return`./${r}`;let t=n.replaceAll("\\","/"),e=r.replaceAll("\\","/"),l=(t.includes("/")?t.slice(0,t.lastIndexOf("/")):"").split("/").filter(Boolean),a=e.split("/").filter(Boolean),s=0;while(s<l.length&&s<a.length&&l[s]===a[s])s+=1;let i=l.length-s,c=a.slice(s);return(i>0?"../".repeat(i):"./")+c.join("/")}
2
- export{ix,at,Tl,pC,rm,gc};
1
+ import{p}from"./studio-y7jehjrp.js";import{D}from"./studio-tp642n5g.js";function u(n,r=[]){if(!n||typeof n!=="object"||Array.isArray(n))return r;let t=n;if(t.tagName==="slot"){let o=t.attributes?.name,l=typeof o==="string"?o.trim():"",{children:a}=t;r.push({name:l,...Array.isArray(a)&&a.length>0?{fallback:a}:{}})}if(Array.isArray(t.children))for(let e of t.children)u(e,r);return r}function m(n){if(n==null)return!1;if(typeof n!=="object")return!0;let r=n;return!r.$prototype&&!r.$handler&&!r.$compute}function Cx(n,r){if(!n||typeof n!=="object"||Array.isArray(n))return null;let t=n,{tagName:e}=t;if(typeof e!=="string"||!e.includes("-"))return null;let o=u(t),l=t.state??{};return{$id:typeof t.$id==="string"&&t.$id?t.$id:null,hasElements:Array.isArray(t.$elements)&&t.$elements.length>0,path:r,props:Object.entries(l).filter(([,a])=>m(a)).map(([a,s])=>{if(typeof s!=="object"||s===null)return{default:s,name:a,type:typeof s};let i=s;return{default:i.default,format:i.format,name:a,type:i.type}}),...o.length>0?{slots:o}:{},tagName:e}}var st=[],c=!1;async function Dl(){try{st=await p().discoverComponents(D?.projectRoot||void 0),c=!0}catch{c=!0}}function MC(n,r){if(!n)return!1;let t=st.findIndex((l)=>l.path===n),e=Cx(r,n);if(!e){if(t===-1)return!1;return st.splice(t,1),!0}let o=e;if(t===-1)st.push(o);else st[t]=o;return!0}function um(n){let r=Object.fromEntries((n.props??[]).map((e)=>[e.name,e.default!==void 0?e.default:""])),t=[];for(let e of n.slots??[])for(let o of structuredClone(e.fallback??[]))if(!e.name)t.push(o);else if(typeof o==="object"&&o!==null&&typeof o.tagName==="string")o.attributes={slot:e.name,...o.attributes},t.push(o);else t.push({attributes:{slot:e.name},children:[o],tagName:"span"});return{$props:r,tagName:n.tagName,...t.length>0?{children:t}:{}}}function xc(n,r){if(!n)return`./${r}`;let t=n.replaceAll("\\","/"),e=r.replaceAll("\\","/"),l=(t.includes("/")?t.slice(0,t.lastIndexOf("/")):"").split("/").filter(Boolean),a=e.split("/").filter(Boolean),s=0;while(s<l.length&&s<a.length&&l[s]===a[s])s+=1;let i=l.length-s,f=a.slice(s);return(i>0?"../".repeat(i):"./")+f.join("/")}
2
+ export{Cx,st,Dl,MC,um,xc};
3
3
 
4
- //# debugId=BAB17E6152B25E4F64756E2164756E21
5
- //# sourceMappingURL=studio-8r4y2x0z.js.map
4
+ //# debugId=77DA259515EEB11764756E2164756E21
5
+ //# sourceMappingURL=studio-pwqfmt4p.js.map