@jxsuite/studio 10.4.0 → 10.6.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 (346) hide show
  1. package/data/locales/en/elements.json +434 -0
  2. package/data/webdata.json +116 -139
  3. package/dist/chunks/2020-rqm7qrje.js +4 -0
  4. package/dist/chunks/adapter-cyy8vbcx.js +4 -0
  5. package/dist/chunks/add-new-flow-8cgtejv2.js +4 -0
  6. package/dist/chunks/{cf-account-picker-xb8vvt2h.js → cf-account-picker-v3qd2dhw.js} +3 -3
  7. package/dist/chunks/cf-settings-1fnw874z.js +4 -0
  8. package/dist/chunks/{color-area-h8dbasp1.js → color-area-frd9y9q6.js} +2 -2
  9. package/dist/chunks/color-field-rebpbe33.js +4 -0
  10. package/dist/chunks/{color-slider-nz2mrzky.js → color-slider-6bzmk3s7.js} +2 -2
  11. package/dist/chunks/color-t2bnnj8y.js +4 -0
  12. package/dist/chunks/{combobox-6hs00996.js → combobox-c49x7gf1.js} +3 -3
  13. package/dist/chunks/components-y8yhdd7d.js +4 -0
  14. package/dist/chunks/content-source-9e7qvmsf.js +4 -0
  15. package/dist/chunks/convert-to-repeater-pd2w4z21.js +4 -0
  16. package/dist/chunks/editor-mb9jzdrw.js +4 -0
  17. package/dist/chunks/entry-commands-at0wnx3f.js +4 -0
  18. package/dist/chunks/extension-sections-4z9qq0gh.js +4 -0
  19. package/dist/chunks/file-ops-dtdvjmza.js +4 -0
  20. package/dist/chunks/files-8pf70854.js +4 -0
  21. package/dist/chunks/format-host-fd3m2y2a.js +4 -0
  22. package/dist/chunks/fs-events-hrk29vcv.js +4 -0
  23. package/dist/chunks/grid-open-bh74v82z.js +4 -0
  24. package/dist/chunks/{grid-view-2f03wcgw.js → grid-view-a51mgzmq.js} +17 -17
  25. package/dist/chunks/{icons-gb967qc8.js → icons-qp8fn1k8.js} +2 -2
  26. package/dist/chunks/{iframe-entry-btck0e9s.js → iframe-entry-mpwe5pwk.js} +4 -4
  27. package/dist/chunks/{iframe-entry-2x9bn5ng.js → iframe-entry-msd43x9h.js} +4 -4
  28. package/dist/chunks/iframe-entry-rt8jz5t8.js +5 -0
  29. package/dist/chunks/{iframe-entry-b5qgggyp.js → iframe-entry-v40cr813.js} +4 -4
  30. package/dist/chunks/iframe-host-q0s0wwy3.js +4 -0
  31. package/dist/chunks/{image-bake-4afr4y6a.js → image-bake-q9ajdjsj.js} +3 -3
  32. package/dist/chunks/{image-editor-x7t8jbjn.js → image-editor-ke9std9b.js} +3 -3
  33. package/dist/chunks/index-57ang7ma.js +4 -0
  34. package/dist/chunks/index-eytr7av4.js +17 -0
  35. package/dist/chunks/{index-yjrfeks8.js → index-x495reff.js} +3 -3
  36. package/dist/chunks/{javascript-hy2mws8v.js → javascript-qe34bvaz.js} +3 -3
  37. package/dist/chunks/jsonMode-m8rseh31.js +13 -0
  38. package/dist/chunks/jx-validate-bbd1mary.js +4 -0
  39. package/dist/chunks/layers-panel-wcjtdqsa.js +4 -0
  40. package/dist/chunks/layers-yscpys6q.js +4 -0
  41. package/dist/chunks/{listbox-7gka1h86.js → listbox-tktzq5xj.js} +2 -2
  42. package/dist/chunks/lit-html-qm5wbhqz.js +4 -0
  43. package/dist/chunks/media-library-2hfff88g.js +4 -0
  44. package/dist/chunks/media-open-4pb05cne.js +4 -0
  45. package/dist/chunks/media-picker-bzktmmwr.js +4 -0
  46. package/dist/chunks/menu-xc3cbgsd.js +4 -0
  47. package/dist/chunks/{monaco-binding-a51py33c.js → monaco-binding-7t38arh9.js} +3 -3
  48. package/dist/chunks/monaco-buffer-3vz94c9f.js +4 -0
  49. package/dist/chunks/monaco-setup-fstdew02.js +4 -0
  50. package/dist/chunks/notify-gbdcckrh.js +4 -0
  51. package/dist/chunks/parse-fpdzgk4c.js +4 -0
  52. package/dist/chunks/platform-9g72gdqr.js +4 -0
  53. package/dist/chunks/popover-cnmsav6b.js +4 -0
  54. package/dist/chunks/publish-panel-91x1cb5d.js +4 -0
  55. package/dist/chunks/publish-quick-e2dmf7eg.js +4 -0
  56. package/dist/chunks/publish-workspace-1x8mnzrj.js +4 -0
  57. package/dist/chunks/quick-search-2m4y6p1x.js +4 -0
  58. package/dist/chunks/references-yg1g9rwx.js +4 -0
  59. package/dist/chunks/right-panel-7mfyhzrk.js +4 -0
  60. package/dist/chunks/source-control-rrc4jgp5.js +4 -0
  61. package/dist/chunks/{split-m5rwn31z.js → split-d15yencd.js} +2 -2
  62. package/dist/chunks/studio-0jhhznxy.js +9 -0
  63. package/dist/chunks/studio-0nb57pjg.js +7 -0
  64. package/dist/chunks/{studio-s24mhq0z.js → studio-0wa4wv4s.js} +4 -4
  65. package/dist/chunks/studio-0z8kp4xk.js +5 -0
  66. package/dist/chunks/{studio-g0hxtcga.js → studio-18gc5t3v.js} +4 -4
  67. package/dist/chunks/{studio-4fnb5648.js → studio-1b79rpcb.js} +4 -4
  68. package/dist/chunks/studio-211q5j7m.js +4 -0
  69. package/dist/chunks/studio-213pyfxh.js +16 -0
  70. package/dist/chunks/studio-2b1smjvp.js +5 -0
  71. package/dist/chunks/{studio-nwf0c32p.js → studio-2v6tc9jp.js} +4 -4
  72. package/dist/chunks/studio-30j0wz99.js +5 -0
  73. package/dist/chunks/studio-3kmqhwtt.js +5 -0
  74. package/dist/chunks/studio-44drsmhw.js +5 -0
  75. package/dist/chunks/{studio-2pk7kc7z.js → studio-495b6f2r.js} +4 -4
  76. package/dist/chunks/{studio-jma2q8r9.js → studio-4gthb2fd.js} +4 -4
  77. package/dist/chunks/{studio-0gvvqj3h.js → studio-4xadhxj1.js} +4 -4
  78. package/dist/chunks/{studio-nvcn2ykc.js → studio-52mzbxqm.js} +4 -4
  79. package/dist/chunks/{studio-v7a7yb5w.js → studio-56mmnsw8.js} +7 -7
  80. package/dist/chunks/studio-59hz8f4r.js +5 -0
  81. package/dist/chunks/{studio-sce30r7b.js → studio-5k9mfafh.js} +3 -3
  82. package/dist/chunks/{studio-rr00ex23.js → studio-5qez462c.js} +6 -6
  83. package/dist/chunks/studio-6tnpg0vx.js +5 -0
  84. package/dist/chunks/studio-6w8mt734.js +6 -0
  85. package/dist/chunks/studio-7hm04x5z.js +5 -0
  86. package/dist/chunks/studio-8atmfjjm.js +7 -0
  87. package/dist/chunks/{studio-wmjmsw0p.js → studio-8n99z71s.js} +4 -4
  88. package/dist/chunks/studio-8vmad6x2.js +5 -0
  89. package/dist/chunks/studio-93p5k4r4.js +5 -0
  90. package/dist/chunks/{studio-2x972v58.js → studio-9gb0m81w.js} +4 -4
  91. package/dist/chunks/studio-a4ymg4vd.js +5 -0
  92. package/dist/chunks/studio-anc8067x.js +5 -0
  93. package/dist/chunks/{studio-2e4hry72.js → studio-dbdt67kr.js} +5 -5
  94. package/dist/chunks/studio-dbex091t.js +5 -0
  95. package/dist/chunks/{studio-amaz545p.js → studio-dj8ctxey.js} +4 -4
  96. package/dist/chunks/{studio-k2evngrj.js → studio-ed9bz68j.js} +5 -5
  97. package/dist/chunks/{studio-4bgvvzhv.js → studio-fe2d1fp5.js} +4 -4
  98. package/dist/chunks/{studio-45mj4jqe.js → studio-fgp4cyy3.js} +4 -4
  99. package/dist/chunks/studio-ft706q02.js +5 -0
  100. package/dist/chunks/studio-g79s1dyg.js +6 -0
  101. package/dist/chunks/{studio-pj216fmn.js → studio-gahswxp4.js} +4 -4
  102. package/dist/chunks/studio-gbqc12bk.js +5 -0
  103. package/dist/chunks/studio-gxphbetb.js +6 -0
  104. package/dist/chunks/studio-hdf01j7q.js +7 -0
  105. package/dist/chunks/studio-hf259xzd.js +48 -0
  106. package/dist/chunks/studio-jbva4wxw.js +5 -0
  107. package/dist/chunks/studio-jj9gf1qc.js +5 -0
  108. package/dist/chunks/studio-jsjg3mjv.js +5 -0
  109. package/dist/chunks/studio-jtvb8hd7.js +5 -0
  110. package/dist/chunks/{studio-g9brbewz.js → studio-kp4vzrct.js} +4 -4
  111. package/dist/chunks/studio-kpx02gaa.js +7 -0
  112. package/dist/chunks/{studio-3na1r48j.js → studio-kv1728ex.js} +8 -8
  113. package/dist/chunks/studio-m25ry0mf.js +5 -0
  114. package/dist/chunks/studio-mcbwmkyh.js +5 -0
  115. package/dist/chunks/studio-meajkr51.js +5 -0
  116. package/dist/chunks/studio-mkjrjpr2.js +6 -0
  117. package/dist/chunks/{studio-eqcddvc2.js → studio-mr084886.js} +201 -201
  118. package/dist/chunks/studio-mrb10hv3.js +5 -0
  119. package/dist/chunks/{studio-0939t1q1.js → studio-nhpg405j.js} +4 -4
  120. package/dist/chunks/studio-nsec0hxm.js +64 -0
  121. package/dist/chunks/{studio-xx3r3sb0.js → studio-nv0mh0p5.js} +4 -4
  122. package/dist/chunks/studio-pafmb06w.js +5 -0
  123. package/dist/chunks/{studio-pm17wdc4.js → studio-pgftd79b.js} +4 -4
  124. package/dist/chunks/{studio-4zd6an2b.js → studio-pk961xgz.js} +4 -4
  125. package/dist/chunks/studio-pzbr7g05.js +5 -0
  126. package/dist/chunks/studio-qcc5hsw2.js +10 -0
  127. package/dist/chunks/studio-qfq58c8n.js +5 -0
  128. package/dist/chunks/studio-qvb2jr83.js +5 -0
  129. package/dist/chunks/studio-r85zw6ay.js +5 -0
  130. package/dist/chunks/studio-s0kwce5w.js +9 -0
  131. package/dist/chunks/studio-s6ymkf3q.js +14 -0
  132. package/dist/chunks/{studio-0x6f3nk9.js → studio-s7p5ccxa.js} +4 -4
  133. package/dist/chunks/{studio-1410q5dw.js → studio-s9jjap3x.js} +4 -4
  134. package/dist/chunks/{studio-evq47j2z.js → studio-t5hde1ws.js} +4 -4
  135. package/dist/chunks/studio-vj9yv897.js +5 -0
  136. package/dist/chunks/studio-wmak8xjw.js +5 -0
  137. package/dist/chunks/{studio-bnc50f9h.js → studio-wqsmvtqj.js} +4 -4
  138. package/dist/chunks/studio-x3z3rhej.js +5 -0
  139. package/dist/chunks/{studio-bg8pzprg.js → studio-xb55kpmy.js} +4 -4
  140. package/dist/chunks/studio-xxtdajmv.js +12 -0
  141. package/dist/chunks/studio-xxttcym1.js +5 -0
  142. package/dist/chunks/{studio-90zkgne5.js → studio-y2zsnzye.js} +7 -7
  143. package/dist/chunks/{studio-3qr08sxq.js → studio-y3tjh2xb.js} +3 -3
  144. package/dist/chunks/studio-y4f1rdsj.js +5 -0
  145. package/dist/chunks/studio-ybkd5w8k.js +5 -0
  146. package/dist/chunks/{studio-tpxcryf2.js → studio-yetr4gg1.js} +4 -4
  147. package/dist/chunks/studio-z295anhs.js +6 -0
  148. package/dist/chunks/studio-z89e6wpg.js +9 -0
  149. package/dist/chunks/{studio-5tet77de.js → studio-zbwr6prc.js} +3 -3
  150. package/dist/chunks/{studio-daksw8kh.js → studio-zdbsv5q2.js} +4 -4
  151. package/dist/chunks/{studio-abh9kfdh.js → studio-zvthj8hg.js} +4 -4
  152. package/dist/chunks/toast-2kn2vrn4.js +4 -0
  153. package/dist/chunks/{toast-host-g3r2s0kn.js → toast-host-3rxeyj3d.js} +3 -3
  154. package/dist/chunks/{tooltip-dj1pvgz7.js → tooltip-ghkxkasp.js} +3 -3
  155. package/dist/chunks/{tree-j0ebwr5s.js → tree-vw4nc63s.js} +2 -2
  156. package/dist/chunks/tsMode-7gngmamr.js +14 -0
  157. package/dist/chunks/workspace-gv0hxgsm.js +4 -0
  158. package/dist/chunks/workspace-home-j7e0mjy5.js +4 -0
  159. package/dist/chunks/{ws-client-arz2qsy9.js → ws-client-vs11sxc5.js} +3 -3
  160. package/dist/iframe-entry.js +14 -14
  161. package/dist/manifest.json +84 -83
  162. package/dist/studio.js +99 -98
  163. package/dist/workers/ts.worker.js +3 -3
  164. package/package.json +12 -12
  165. package/src/browse/library-layouts.ts +9 -12
  166. package/src/browse/library-pane.ts +22 -16
  167. package/src/browse/library-source.ts +3 -4
  168. package/src/browse/preview-style.ts +2 -1
  169. package/src/canvas/canvas-live-render.ts +2 -5
  170. package/src/canvas/canvas-page-context.ts +5 -0
  171. package/src/canvas/canvas-render.ts +6 -1
  172. package/src/canvas/iframe-drop.ts +84 -1
  173. package/src/canvas/iframe-entry.ts +9 -6
  174. package/src/canvas/iframe-render.ts +13 -0
  175. package/src/collab/collab-session.ts +2 -2
  176. package/src/commands/levels.ts +1 -1
  177. package/src/content/entry-commands.ts +32 -27
  178. package/src/content/entry-editor.ts +46 -44
  179. package/src/content/entry-inspector.ts +15 -12
  180. package/src/content/entry-model.ts +3 -3
  181. package/src/content/entry-summaries.ts +5 -5
  182. package/src/content/hold-state.ts +172 -0
  183. package/src/content/page-summaries.ts +10 -14
  184. package/src/create/add-new-flow.ts +2 -1
  185. package/src/editor/convert-targets.ts +2 -23
  186. package/src/editor/inline-edit.ts +6 -1
  187. package/src/editor/repeater-scope.ts +333 -74
  188. package/src/editor/slash-menu.ts +35 -17
  189. package/src/files/files.ts +18 -0
  190. package/src/format/format-choices.ts +5 -5
  191. package/src/format/format-host.ts +35 -3
  192. package/src/grid/redirects-grid.ts +4 -4
  193. package/src/grid/sources/content-source.ts +42 -66
  194. package/src/locale/element-names.ts +131 -0
  195. package/src/panels/block-action-bar.ts +3 -4
  196. package/src/panels/dnd.ts +3 -1
  197. package/src/panels/elements-panel.ts +93 -36
  198. package/src/panels/events-panel.ts +6 -2
  199. package/src/panels/formula-workspace.ts +9 -0
  200. package/src/panels/imports-panel.ts +3 -2
  201. package/src/panels/navigator-panels.ts +10 -10
  202. package/src/panels/panel-registry.ts +3 -3
  203. package/src/panels/properties-panel.ts +127 -35
  204. package/src/panels/site-panel.ts +2 -1
  205. package/src/panels/statement-editor.ts +4 -0
  206. package/src/panels/style-panel.ts +2 -1
  207. package/src/panels/styles-panel.ts +2 -2
  208. package/src/panels/tab-strip.ts +29 -26
  209. package/src/platforms/cloud.ts +5 -2
  210. package/src/services/ai-command-tools.ts +2 -1
  211. package/src/services/ai-project-tools.ts +21 -8
  212. package/src/services/ai-tools.ts +5 -5
  213. package/src/services/ai-write-report.ts +22 -4
  214. package/src/services/context-manager.ts +110 -2
  215. package/src/services/document-assistant.ts +2 -2
  216. package/src/services/harness/chat-reducer.ts +9 -4
  217. package/src/services/jxn-language.ts +110 -0
  218. package/src/services/model-uri.ts +3 -0
  219. package/src/services/monaco-setup.ts +6 -2
  220. package/src/services/render-critic.ts +234 -12
  221. package/src/services/tool-executor.ts +16 -8
  222. package/src/settings/contributed-section.ts +2 -1
  223. package/src/settings/extension-commands.ts +2 -1
  224. package/src/settings/general-settings.ts +2 -2
  225. package/src/settings/settings-document.ts +5 -5
  226. package/src/shell.ts +1 -1
  227. package/src/studio.ts +28 -11
  228. package/src/style/variables-view.ts +2 -2
  229. package/src/surfaces/collections-panel.json +1 -1
  230. package/src/surfaces/collections-panel.ts +1 -1
  231. package/src/surfaces/entry-editor.json +10 -10
  232. package/src/surfaces/entry-editor.ts +22 -19
  233. package/src/surfaces/entry-inspector.json +11 -11
  234. package/src/surfaces/entry-inspector.ts +17 -10
  235. package/src/surfaces/panel-elements.json +466 -206
  236. package/src/surfaces/panel-elements.ts +61 -25
  237. package/src/surfaces/tab-strip.json +5 -5
  238. package/src/surfaces/tab-strip.ts +2 -2
  239. package/src/tabs/project-config.ts +13 -13
  240. package/src/tabs/tab.ts +7 -2
  241. package/src/types.ts +13 -2
  242. package/src/ui/expression-editor.ts +10 -5
  243. package/src/ui/schema-form.ts +18 -1
  244. package/src/utils/edit-display.ts +27 -1
  245. package/src/view.ts +9 -2
  246. package/src/workspace/tab-workspace.ts +2 -2
  247. package/src/workspace/workspace-back.ts +2 -2
  248. package/dist/chunks/2020-906vx2dq.js +0 -4
  249. package/dist/chunks/adapter-hnvad61x.js +0 -4
  250. package/dist/chunks/add-new-flow-v0pm96mr.js +0 -4
  251. package/dist/chunks/cf-settings-mkbcz4z2.js +0 -4
  252. package/dist/chunks/color-04361ttk.js +0 -4
  253. package/dist/chunks/color-field-qv5r2b16.js +0 -4
  254. package/dist/chunks/components-w5zqwva1.js +0 -4
  255. package/dist/chunks/content-source-g38w0d3f.js +0 -4
  256. package/dist/chunks/convert-to-repeater-r8sfxjjm.js +0 -4
  257. package/dist/chunks/editor-wvf5e6j9.js +0 -4
  258. package/dist/chunks/entry-commands-t13dyw3c.js +0 -4
  259. package/dist/chunks/extension-sections-vjzw46xb.js +0 -4
  260. package/dist/chunks/file-ops-1sghzgcr.js +0 -4
  261. package/dist/chunks/files-zrqtgt41.js +0 -4
  262. package/dist/chunks/format-host-9gy76erh.js +0 -4
  263. package/dist/chunks/fs-events-45rhg3me.js +0 -4
  264. package/dist/chunks/grid-open-t4fq6bbm.js +0 -4
  265. package/dist/chunks/iframe-entry-42hpmwz5.js +0 -5
  266. package/dist/chunks/iframe-host-9aq8ze3q.js +0 -4
  267. package/dist/chunks/index-f9qr7kzh.js +0 -4
  268. package/dist/chunks/jsonMode-vj30te2h.js +0 -13
  269. package/dist/chunks/jx-validate-r4ax11e3.js +0 -4
  270. package/dist/chunks/layers-m49nmwvx.js +0 -4
  271. package/dist/chunks/layers-panel-zr92pwdp.js +0 -4
  272. package/dist/chunks/lit-html-k2mb9k0r.js +0 -4
  273. package/dist/chunks/media-library-j74rt0w4.js +0 -4
  274. package/dist/chunks/media-open-mypr0k6b.js +0 -4
  275. package/dist/chunks/media-picker-pemtbsjv.js +0 -4
  276. package/dist/chunks/menu-d2jxpgma.js +0 -4
  277. package/dist/chunks/monaco-buffer-pa0g6ax7.js +0 -4
  278. package/dist/chunks/monaco-setup-0hw9f835.js +0 -4
  279. package/dist/chunks/notify-bwehrp7q.js +0 -4
  280. package/dist/chunks/parse-hee7ne9b.js +0 -4
  281. package/dist/chunks/platform-kv0k65cy.js +0 -4
  282. package/dist/chunks/popover-9tf4cjrk.js +0 -4
  283. package/dist/chunks/publish-panel-vg1n880b.js +0 -4
  284. package/dist/chunks/publish-quick-4fwngwrw.js +0 -4
  285. package/dist/chunks/publish-workspace-jv4w2bx2.js +0 -4
  286. package/dist/chunks/quick-search-nh29rt8a.js +0 -4
  287. package/dist/chunks/references-vqyr5s9x.js +0 -4
  288. package/dist/chunks/right-panel-3ws9f2w0.js +0 -4
  289. package/dist/chunks/source-control-h3hcs5gy.js +0 -4
  290. package/dist/chunks/studio-0khd8xtx.js +0 -4
  291. package/dist/chunks/studio-1ctnw3xv.js +0 -5
  292. package/dist/chunks/studio-1ks5d9y4.js +0 -5
  293. package/dist/chunks/studio-1y9mab9m.js +0 -5
  294. package/dist/chunks/studio-2kpxm0eh.js +0 -7
  295. package/dist/chunks/studio-2zz4qbv9.js +0 -5
  296. package/dist/chunks/studio-3pz4t5a2.js +0 -5
  297. package/dist/chunks/studio-4f7thq0p.js +0 -5
  298. package/dist/chunks/studio-61rg2cz5.js +0 -5
  299. package/dist/chunks/studio-7rrdbvex.js +0 -5
  300. package/dist/chunks/studio-9c6cbq2c.js +0 -4
  301. package/dist/chunks/studio-9dq7rwc7.js +0 -5
  302. package/dist/chunks/studio-9gr7xs9r.js +0 -6
  303. package/dist/chunks/studio-a88ej93p.js +0 -7
  304. package/dist/chunks/studio-acer0g8w.js +0 -5
  305. package/dist/chunks/studio-az3wvyh2.js +0 -5
  306. package/dist/chunks/studio-brh8d2pr.js +0 -5
  307. package/dist/chunks/studio-c2fa783p.js +0 -9
  308. package/dist/chunks/studio-cfnn70h1.js +0 -5
  309. package/dist/chunks/studio-cqxj4fcy.js +0 -5
  310. package/dist/chunks/studio-cw11h078.js +0 -5
  311. package/dist/chunks/studio-dn56z7sn.js +0 -5
  312. package/dist/chunks/studio-egnjpyde.js +0 -9
  313. package/dist/chunks/studio-ejrypvmq.js +0 -5
  314. package/dist/chunks/studio-frc16j8v.js +0 -10
  315. package/dist/chunks/studio-gnazwtv3.js +0 -5
  316. package/dist/chunks/studio-hfqpfmpk.js +0 -5
  317. package/dist/chunks/studio-hh394phe.js +0 -5
  318. package/dist/chunks/studio-j0zf5x2x.js +0 -5
  319. package/dist/chunks/studio-j5fcp6gj.js +0 -5
  320. package/dist/chunks/studio-jd1qb1st.js +0 -7
  321. package/dist/chunks/studio-k0xzrse2.js +0 -64
  322. package/dist/chunks/studio-k1xqrgm5.js +0 -5
  323. package/dist/chunks/studio-k3we3kqb.js +0 -5
  324. package/dist/chunks/studio-knsjyx7n.js +0 -5
  325. package/dist/chunks/studio-mrjtnm62.js +0 -5
  326. package/dist/chunks/studio-n9qba0gx.js +0 -5
  327. package/dist/chunks/studio-nzemfbkk.js +0 -14
  328. package/dist/chunks/studio-pwctzka3.js +0 -16
  329. package/dist/chunks/studio-q80fg1d6.js +0 -12
  330. package/dist/chunks/studio-q9hx2qp0.js +0 -5
  331. package/dist/chunks/studio-qrzmfaf6.js +0 -5
  332. package/dist/chunks/studio-r6mx7vm5.js +0 -7
  333. package/dist/chunks/studio-swedpd82.js +0 -5
  334. package/dist/chunks/studio-tmfcn347.js +0 -6
  335. package/dist/chunks/studio-v5wktj6f.js +0 -5
  336. package/dist/chunks/studio-vpevkfxw.js +0 -5
  337. package/dist/chunks/studio-wqfaqw4m.js +0 -5
  338. package/dist/chunks/studio-xpx91fby.js +0 -6
  339. package/dist/chunks/studio-xva3hzkv.js +0 -5
  340. package/dist/chunks/studio-z3fztxrp.js +0 -9
  341. package/dist/chunks/studio-z9453ypn.js +0 -6
  342. package/dist/chunks/toast-w11qpkyz.js +0 -4
  343. package/dist/chunks/tsMode-jg1dtphj.js +0 -14
  344. package/dist/chunks/workspace-6ztqcrsh.js +0 -4
  345. package/dist/chunks/workspace-home-rse9h8a0.js +0 -4
  346. package/src/content/draft-state.ts +0 -108
@@ -1,4 +0,0 @@
1
- import{PD,PE,Y_,Z_,FE}from"./studio-2pk7kc7z.js";import"./studio-xx3r3sb0.js";import"./studio-mrjtnm62.js";import"./studio-k2evngrj.js";import"./studio-jma2q8r9.js";import"./studio-v7a7yb5w.js";import"./studio-3pz4t5a2.js";import"./studio-rr00ex23.js";import"./studio-xpx91fby.js";import"./studio-r6mx7vm5.js";import"./studio-xva3hzkv.js";import"./studio-n9qba0gx.js";import"./studio-pwctzka3.js";import"./studio-g9brbewz.js";import"./studio-90zkgne5.js";import"./studio-61rg2cz5.js";import"./studio-tpxcryf2.js";import"./studio-5tet77de.js";import"./studio-bnc50f9h.js";import"./studio-4zd6an2b.js";import"./studio-acer0g8w.js";import"./studio-wqfaqw4m.js";import"./studio-hh394phe.js";import"./studio-knsjyx7n.js";import"./studio-swedpd82.js";import"./studio-9c6cbq2c.js";import"./studio-sce30r7b.js";import"./studio-q9hx2qp0.js";import"./studio-4fnb5648.js";import"./studio-9dq7rwc7.js";import"./studio-nzemfbkk.js";import"./studio-nvcn2ykc.js";import"./studio-1410q5dw.js";import"./studio-1ks5d9y4.js";export{Z_ as detachPublishWorkspace,PE as focusPublishHome,Y_ as publishWorkspaceMounted,FE as renderPublishWorkspace,PD as showPublishTab};
2
-
3
- //# debugId=FB46B75856CED2BD64756E2164756E21
4
- //# sourceMappingURL=publish-workspace-jv4w2bx2.js.map
@@ -1,4 +0,0 @@
1
- import{jE,mb}from"./studio-bg8pzprg.js";import"./studio-a88ej93p.js";import"./studio-qrzmfaf6.js";import"./studio-2zz4qbv9.js";import"./studio-daksw8kh.js";import"./studio-frc16j8v.js";import"./studio-hfqpfmpk.js";import"./studio-9gr7xs9r.js";import"./studio-mrjtnm62.js";import"./studio-k2evngrj.js";import"./studio-jma2q8r9.js";import"./studio-v7a7yb5w.js";import"./studio-3pz4t5a2.js";import"./studio-rr00ex23.js";import"./studio-xpx91fby.js";import"./studio-r6mx7vm5.js";import"./studio-xva3hzkv.js";import"./studio-n9qba0gx.js";import"./studio-pwctzka3.js";import"./studio-g9brbewz.js";import"./studio-90zkgne5.js";import"./studio-61rg2cz5.js";import"./studio-tpxcryf2.js";import"./studio-5tet77de.js";import"./studio-bnc50f9h.js";import"./studio-4zd6an2b.js";import"./studio-acer0g8w.js";import"./studio-wqfaqw4m.js";import"./studio-hh394phe.js";import"./studio-knsjyx7n.js";import"./studio-swedpd82.js";import"./studio-9c6cbq2c.js";import"./studio-sce30r7b.js";import"./studio-q9hx2qp0.js";import"./studio-4fnb5648.js";import"./studio-9dq7rwc7.js";import"./studio-nzemfbkk.js";import"./studio-nvcn2ykc.js";import"./studio-1410q5dw.js";import"./studio-1ks5d9y4.js";export{jE as initQuickSearch,mb as openQuickSearch};
2
-
3
- //# debugId=CFA87DDA4107811C64756E2164756E21
4
- //# sourceMappingURL=quick-search-nh29rt8a.js.map
@@ -1,4 +0,0 @@
1
- import{ph,qd,La,nI,us,iI,lv,oI,cv}from"./studio-4zd6an2b.js";import"./studio-9c6cbq2c.js";import"./studio-4fnb5648.js";export{us as invalidateUsages,La as loadUsages,iI as onUsagesInvalidated,qd as peekUsages,nI as retryUsages,cv as usageFiles,lv as usageHeadline,oI as usageWarning,ph as usagesSupported};
2
-
3
- //# debugId=8CA6856AFEEA139064756E2164756E21
4
- //# sourceMappingURL=references-vqyr5s9x.js.map
@@ -1,4 +0,0 @@
1
- import{XR,eE,lF,tE,tb,Hl,Iu}from"./studio-dn56z7sn.js";import"./studio-c2fa783p.js";import"./studio-jd1qb1st.js";import"./studio-tmfcn347.js";import"./studio-pj216fmn.js";import"./studio-z9453ypn.js";import"./studio-amaz545p.js";import"./studio-z3fztxrp.js";import"./studio-cqxj4fcy.js";import"./studio-4bgvvzhv.js";import"./studio-a88ej93p.js";import"./studio-qrzmfaf6.js";import"./studio-2zz4qbv9.js";import"./studio-daksw8kh.js";import"./studio-frc16j8v.js";import"./studio-hfqpfmpk.js";import"./studio-9gr7xs9r.js";import"./studio-mrjtnm62.js";import"./studio-k2evngrj.js";import"./studio-jma2q8r9.js";import"./studio-v7a7yb5w.js";import"./studio-3pz4t5a2.js";import"./studio-rr00ex23.js";import"./studio-xpx91fby.js";import"./studio-r6mx7vm5.js";import"./studio-xva3hzkv.js";import"./studio-n9qba0gx.js";import"./studio-pwctzka3.js";import"./studio-g9brbewz.js";import"./studio-90zkgne5.js";import"./studio-61rg2cz5.js";import"./studio-tpxcryf2.js";import"./studio-5tet77de.js";import"./studio-bnc50f9h.js";import"./studio-4zd6an2b.js";import"./studio-acer0g8w.js";import"./studio-wqfaqw4m.js";import"./studio-hh394phe.js";import"./studio-knsjyx7n.js";import"./studio-swedpd82.js";import"./studio-9c6cbq2c.js";import"./studio-sce30r7b.js";import"./studio-q9hx2qp0.js";import"./studio-4fnb5648.js";import"./studio-9dq7rwc7.js";import"./studio-nzemfbkk.js";import"./studio-nvcn2ykc.js";import"./studio-1410q5dw.js";import"./studio-1ks5d9y4.js";import"./studio-k1wvtp03.js";export{Hl as inspectorTab,eE as mount,tb as render,tE as restingInspectorTab,Iu as setInspectorTab,XR as stripOf,lF as unmount};
2
-
3
- //# debugId=95FFFC615B7AE2BD64756E2164756E21
4
- //# sourceMappingURL=right-panel-3ws9f2w0.js.map
@@ -1,4 +0,0 @@
1
- import{ks,XT,KS,JS,Pb,Us,QT,eL,tL,nL,iL,oL,rL,sL,aL,lL,cL,dL,uL,hL,YS,pL,fL,Yw,mL,gL,Fb,bL}from"./studio-mrjtnm62.js";import"./studio-k2evngrj.js";import"./studio-jma2q8r9.js";import"./studio-v7a7yb5w.js";import"./studio-3pz4t5a2.js";import"./studio-rr00ex23.js";import"./studio-xpx91fby.js";import"./studio-r6mx7vm5.js";import"./studio-xva3hzkv.js";import"./studio-n9qba0gx.js";import"./studio-pwctzka3.js";import"./studio-g9brbewz.js";import"./studio-90zkgne5.js";import"./studio-61rg2cz5.js";import"./studio-tpxcryf2.js";import"./studio-5tet77de.js";import"./studio-bnc50f9h.js";import"./studio-4zd6an2b.js";import"./studio-acer0g8w.js";import"./studio-wqfaqw4m.js";import"./studio-hh394phe.js";import"./studio-knsjyx7n.js";import"./studio-swedpd82.js";import"./studio-9c6cbq2c.js";import"./studio-sce30r7b.js";import"./studio-q9hx2qp0.js";import"./studio-4fnb5648.js";import"./studio-9dq7rwc7.js";import"./studio-nzemfbkk.js";import"./studio-nvcn2ykc.js";import"./studio-1410q5dw.js";import"./studio-1ks5d9y4.js";export{gL as armGitPoll,YS as changeRow,hL as checkoutBranch,Fb as cleanupSourceControl,JS as cloneRepository,fL as commitRow,uL as createBranch,dL as discardFile,KS as fetchGitLog,rL as fetchRemote,pL as groupFilesByComponent,cL as includeNewChanges,mL as lastUpdatedLabel,tL as loadDiffForLens,XT as noteFileSaved,oL as openFileComparison,Us as platformHostsGit,QT as platformOpensPullRequests,Pb as platformSupportsClone,sL as pullRemote,ks as refreshGitStatus,bL as registerSourceControlCommands,Yw as relativeDate,iL as runCloneRepository,lL as setAllIncluded,aL as setIncluded,nL as setSourceControlDeps,eL as statusTag};
2
-
3
- //# debugId=0F764DB110E551E064756E2164756E21
4
- //# sourceMappingURL=source-control-h3hcs5gy.js.map
@@ -1,4 +0,0 @@
1
- import{zy,xa,L_,os,$_,rs}from"./studio-3na1r48j.js";import{Ce}from"./studio-v5wktj6f.js";import{n,Y,v}from"./studio-k3we3kqb.js";var OR="meta",MR="frontmatter",PR="structure",FR="source",jR=2;function m(e){return v(e)}function Tu(e){return e.getMap(OR)}function HR(e){return e.getMap(MR)}function Xg(e){return e.getMap(PR)}function BR(e){return e.getText(FR)}var h=new Set(["textContent"]),y=new Set(["style","attributes","$props"]);function g(e,t){let o=e.toString();if(o===t)return!1;let r=0,s=Math.min(o.length,t.length);while(r<s&&o[r]===t[r])r+=1;let a=o.length,i=t.length;while(a>r&&i>r&&o[a-1]===t[i-1])a-=1,i-=1;if(a>r)e.delete(r,a-r);if(i>r)e.insert(r,t.slice(r,i));return!0}function f(e){let t=new os;for(let[o,r]of Object.entries(e)){if(r===void 0)continue;t.set(o,m(r)?f(r):Ce(r))}return t}function S(e,t){for(let o of[...e.keys()])if(!(o in t)||t[o]===void 0)e.delete(o);for(let[o,r]of Object.entries(t)){if(r===void 0)continue;let s=e.get(o);if(m(r))if(s instanceof os)S(s,r);else e.set(o,f(r));else if(!J(s,r))e.set(o,Ce(r))}}function J(e,t){if(e===t)return!0;if(e instanceof os||e instanceof xa||e instanceof rs)return!1;return JSON.stringify(e??null)===JSON.stringify(t??null)}function d(e){return n(e)?new rs(e):zR(e)}function nm(e){let t=new xa;return t.insert(0,e.map((o)=>d(o))),t}function zR(e){if(!m(e))throw TypeError("collab-schema: a document node must be a plain object");let t=new os;for(let[o,r]of Object.entries(e)){if(r===void 0)continue;if(o==="children"&&Array.isArray(r))t.set(o,nm(r));else if(h.has(o)&&n(r))t.set(o,new rs(r));else if(y.has(o)&&m(r))t.set(o,f(r));else t.set(o,Ce(r))}return t}function D(e){return Object.fromEntries(Array.from(e.entries(),([t,o])=>[t,im(o)]))}function O(e){if(n(e))return e;return e instanceof rs?e.toString():D(e)}function im(e){if(e instanceof os)return D(e);if(e instanceof xa)return e.toArray().map((t)=>im(t));if(e instanceof rs)return e.toString();return e}function CP(e){return D(Xg(e))}function E_(e,t){let o=Xg(e);for(let r of t)if(o instanceof os)o=o.get(String(r));else if(o instanceof xa){let s=Number(r);if(!Number.isInteger(s)||s<0||s>=o.length)return;o=o.get(s)}else return;return o}function qk(e,t,o){let r=BR(e);if(r.toString()===t)return!1;return e.transact(()=>{g(r,t)},o),!0}function kP(e,t,o={}){let r=Tu(e);if(r.get("structureSeeded")===!0)return!1;return e.transact(()=>{let s=Xg(e);for(let[i,c]of Object.entries(t)){if(c===void 0)continue;if(i==="children"&&Array.isArray(c))s.set(i,nm(c));else s.set(i,Ce(c))}let a=HR(e);for(let[i,c]of Object.entries(o.frontmatter??{}))if(c!==void 0)a.set(i,Ce(c));r.set("schemaVersion",jR),r.set("canonical","structure"),r.set("canonicalRev",0),r.set("sourceFormat",o.sourceFormat??null),r.set("structureSeeded",!0)},o.origin),!0}var EP="jx-local",TP="jx-mirror",LP="jx-seed";class Lu extends Error{constructor(e){super(`collab-path-unresolved:${e.join("/")}`);this.name="CollabPathError"}}function T(e,t){let o=E_(e,t);if(!(o instanceof os))throw new Lu(t);return o}function p(e,t,o){let r=T(e,t),s=r.get("children");if(s instanceof xa)return s;if(o&&s===void 0){let a=new xa;return r.set("children",a),a}throw new Lu([...t,"children"])}function V(e,t,o){let r=e.get(t);if(t==="children"&&Array.isArray(o)){e.set(t,nm(o));return}if(h.has(t)&&n(o)){if(r instanceof rs)g(r,o);else e.set(t,new rs(o));return}if(y.has(t)&&v(o)){if(r instanceof os)S(r,o);else e.set(t,f(o));return}e.set(t,Ce(o))}function w(e,t){let{op:o}=t;switch(t.op){case"set-key":{let r=T(e,t.path);if(t.value===void 0)r.delete(t.key);else V(r,t.key,t.value);return}case"insert-child":{let r=p(e,t.parentPath,!0);if(t.index<0||t.index>r.length)throw new Lu([...t.parentPath,"children",t.index]);r.insert(t.index,[d(t.node)]);return}case"remove-child":{let r=p(e,t.parentPath,!1);if(t.index<0||t.index>=r.length)throw new Lu([...t.parentPath,"children",t.index]);r.delete(t.index,1);return}case"set-child":{let r=p(e,t.parentPath,!1);if(t.index<0||t.index>=r.length)throw new Lu([...t.parentPath,"children",t.index]);let s=r.get(t.index);if(s instanceof rs&&n(t.node)){g(s,t.node);return}r.delete(t.index,1),r.insert(t.index,[d(t.node)]);return}case"move-child":{let r=p(e,t.fromParentPath,!1),s=p(e,t.toParentPath,!0);if(t.fromIndex<0||t.fromIndex>=r.length)throw new Lu([...t.fromParentPath,"children",t.fromIndex]);let a=im(r.get(t.fromIndex));if(r.delete(t.fromIndex,1),t.toIndex<0||t.toIndex>s.length)throw new Lu([...t.toParentPath,"children",t.toIndex]);s.insert(t.toIndex,[d(a)]);return}default:throw Error(`unknown-doc-op:${o}`)}}function $P(e,t,o){e.transact(()=>{for(let r of t)w(e,r)},o)}function P(e){for(let t=0;t<e.length;t++){let o=e[t];if(!n(o))continue;if(y.has(o))return{key:o,nodePath:e.slice(0,t)};if(h.has(o))return{key:o,nodePath:e.slice(0,t)}}return null}function C(e){return e instanceof rs||e instanceof os||n(e)}function N(e){return e.every((t)=>n(t)||Y(t))}function IP(e){if(e.length===0)return[];let t=e.map((s)=>s.path);if(!t.every((s)=>N(s)))return null;for(let s=0;s<t.length;s++)for(let a=0;a<t.length;a++){if(s===a)continue;let i=t[s],c=t[a];if(i.length<=c.length&&i.every((u,l)=>u===c[l]))return null}if(e.filter((s)=>s instanceof zy).length>1)return null;let r=[];for(let s of e){let{path:a}=s,i=P(a);if(i){let{doc:c}=s.target;if(!c)return null;let u=E_(c,[...i.nodePath,i.key]);if(u===void 0)return null;r.push({key:i.key,op:"set-key",path:i.nodePath,value:im(u)});continue}if(s instanceof $_){let c=a.at(-1);if(a.at(-2)==="children"&&Y(c)){r.push({index:c,node:s.target.toString(),op:"set-child",parentPath:a.slice(0,-2)});continue}return null}if(s instanceof L_){let c=s.target;for(let[u,l]of s.changes.keys)if(l.action==="delete")r.push({key:u,op:"set-key",path:a});else r.push({key:u,op:"set-key",path:a,value:im(c.get(u))})}else if(s instanceof zy){if(a.at(-1)!=="children")return null;let c=a.slice(0,-1),u=0;for(let l of s.changes.delta)if(l.retain!==void 0)u+=l.retain;else if(l.delete!==void 0)for(let x=0;x<l.delete;x++)r.push({index:u,op:"remove-child",parentPath:c});else if(l.insert!==void 0){let x=Array.isArray(l.insert)?l.insert:[l.insert];for(let E of x){if(!C(E))return null;r.push({index:u,node:O(E),op:"insert-child",parentPath:c}),u+=1}}}else return null}return r}function RP(e,t,o){e.transact(()=>{let r=Xg(e),s=[...r.keys()];for(let i of s)if(!(i in t)||t[i]===void 0)r.delete(i);for(let[i,c]of Object.entries(t)){if(c===void 0)continue;if(i==="children"&&Array.isArray(c))r.set(i,nm(c));else r.set(i,Ce(c))}let a=Tu(e);a.set("canonicalRev",Number(a.get("canonicalRev")??0)+1)},o)}function Gk(e){return Tu(e).get("canonical")==="source"?"source":"structure"}function Kk(e){return Number(Tu(e).get("canonicalRev")??0)}function DP(e,t,o){if(Gk(e)==="source")return!1;return e.transact(()=>{qk(e,t,o);let r=Tu(e);r.set("canonical","source"),r.set("canonicalRev",Kk(e)+1)},o),!0}function NP(e,t){if(Gk(e)!=="source")return!1;return e.transact(()=>{let o=Tu(e);o.set("canonical","structure"),o.set("canonicalRev",Kk(e)+1)},t),!0}function AP(e,t,o){let r=[];for(let[s,a]of e.getStates()){let i=a;if(s!==o&&i.mode==="source"&&i.focusedPath===t)r.push(s)}return r}function OP(e,t){let o=e.clientID,r=e.getStates().get(o);if(r?.mode!=="source"||r.focusedPath!==t)return!1;let s=o;for(let[a,i]of e.getStates()){let c=i;if(c.mode==="source"&&c.focusedPath===t&&c.canWrite!==!1&&a<s)s=a}return s===o}var Jk=["#4f9cf9","#e5484d","#30a46c","#f5a524","#8e4ec6","#00a2c7","#e93d82","#a8845c"];function MP(e){let t=5381;for(let r=0;r<e.length;r++)t=Math.imul(t,33)+(e.codePointAt(r)??0);let o=Math.abs(t)%Jk.length;return Jk[o]}export{OR,MR,PR,FR,jR,Tu,HR,Xg,BR,nm,zR,im,CP,E_,qk,kP,EP,TP,LP,Lu,$P,IP,RP,Gk,Kk,DP,NP,AP,OP,Jk,MP};
2
-
3
- //# debugId=BEBC77324A443C6564756E2164756E21
4
- //# sourceMappingURL=studio-0khd8xtx.js.map
@@ -1,5 +0,0 @@
1
- import{Gn,m,Ft}from"./studio-knsjyx7n.js";import{wN}from"./studio-z3fztxrp.js";import{rh}from"./studio-xva3hzkv.js";import{ce}from"./studio-0939t1q1.js";var e="edit",a=new Set(["edit","design"]);function r(t){for(let i of m.tabs.values())if(i.documentPath===t)return i;return null}async function Vl(t){if(!rh(t)){let o=Gn(t);if(o&&!o.fileBacked)return wN(t);let{openFileInTab:s}=await (ce("zrqtgt41"),import("./files-zrqtgt41.js"));return await s(t),r(t)}let{openFileInTab:i}=await (ce("zrqtgt41"),import("./files-zrqtgt41.js"));await i(t);let n=r(t);if(!n)return null;if(!a.has(n.session.ui.canvasMode)&&n.capabilities.modes.includes(e))n.session.ui.canvasMode=e,n.session.ui.preview=!1;return Ft(n.id),n}
2
- export{Vl};
3
-
4
- //# debugId=1FB211209C9683E364756E2164756E21
5
- //# sourceMappingURL=studio-1ctnw3xv.js.map
@@ -1,5 +0,0 @@
1
- var oa=new Set([".jpg",".jpeg",".png",".gif",".svg",".webp",".avif",".ico"]),tR=new Set([".mp4",".webm",".mov",".m4v"]),nR=new Set([".mp3",".wav",".ogg",".m4a",".flac"]),ra=new Set([...oa,...tR,...nR,".pdf",".woff",".woff2",".ttf",".otf"]);function At(t){let o=t.lastIndexOf(".");return o>0?t.slice(o).toLowerCase():""}function yf(t){return oa.has(t.startsWith(".")?t.toLowerCase():`.${t.toLowerCase()}`)}
2
- export{oa,tR,nR,ra,At,yf};
3
-
4
- //# debugId=AF99274705DA93DF64756E2164756E21
5
- //# sourceMappingURL=studio-1ks5d9y4.js.map
@@ -1,5 +0,0 @@
1
- import{S0,C0}from"./studio-wmjmsw0p.js";import{n,v}from"./studio-k3we3kqb.js";import{pp,ce}from"./studio-0939t1q1.js";var a={document:S0,project:C0},i={...a},s={document:null,project:null},d=!1;function u(e){return s[e]??=(async()=>{try{let{default:t}=await (ce("906vx2dq"),import("./2020-906vx2dq.js").then((m)=>pp(m.default,1))),{default:r}=await (ce("yjrfeks8"),import("./index-yjrfeks8.js").then((m)=>pp(m.default,1))),o=new t({allErrors:!0,strict:!1,allowUnionTypes:!0});return r(o),o.compile(i[e])}catch(t){if(!d)d=!0,console.error(`[jx] ${e} schema validation is unavailable — the AI assistant's schema gate is a `+"no-op for this session:",t);return null}})(),s[e]}function p(e){return v(e)&&Object.keys(e).length>0}function mF(e){let t=e?.document,r=e?.project,o=p(t)?t:a.document,c=p(r)?r:a.project,m=o!==a.document||c!==a.project;if(o===i.document&&c===i.project)return m;return i.document=o,i.project=c,s.document=null,s.project=null,m}var j=["unevaluatedProperty","additionalProperty","missingProperty"];function l(e){return(e.errors||[]).map((t)=>{let r=j.find((c)=>n(t.params[c])),o=r?` (${String(t.params[r])})`:"";return`${t.instancePath||"(root)"}: ${t.message}${o}`})}async function km(e){let t=await u("document");if(!t||t(e))return[];return l(t)}async function gF(e){let t=await u("document");if(!t)return null;return t(e)?[]:l(t)}async function Ku(e){let t=await u("project");if(!t||t(e))return[];return l(t)}
2
- export{mF,km,gF,Ku};
3
-
4
- //# debugId=CC65C2947752C54364756E2164756E21
5
- //# sourceMappingURL=studio-1y9mab9m.js.map
@@ -1,7 +0,0 @@
1
- import{p,ye}from"./studio-4fnb5648.js";import{Cs}from"./studio-frc16j8v.js";import{X}from"./studio-9c6cbq2c.js";import{w}from"./studio-sce30r7b.js";import{nt,Fn}from"./studio-tpxcryf2.js";import{Wt,ln,go,mv}from"./studio-knsjyx7n.js";import{qs}from"./studio-v7a7yb5w.js";import{zt}from"./studio-daksw8kh.js";import{us}from"./studio-4zd6an2b.js";import{yf}from"./studio-1ks5d9y4.js";import{Wm,Ax,nr}from"./studio-61rg2cz5.js";import{yr,ih,hC,NA,qb,hi,ax,PA,Ql,gC,sh,jA,Ap}from"./studio-xva3hzkv.js";import{Ab,Ob}from"./studio-hfqpfmpk.js";import{AS,Mw,Tm,Pw,OS,_i}from"./studio-a88ej93p.js";import{Sp,wS,sT,kb,aT,Cw,kw,lN,cT,_m,Ew,uN,dT,Eb,hN,pN,fN,mN,gN,uT,bN}from"./studio-z3fztxrp.js";import{iN,yw,ww,_p}from"./studio-z9453ypn.js";import{Vl}from"./studio-1ctnw3xv.js";import{PS}from"./studio-g0hxtcga.js";import{Sa}from"./studio-qrzmfaf6.js";import{Rp}from"./studio-cfnn70h1.js";import{C,wn}from"./studio-4f7thq0p.js";import{Ln,E,R}from"./studio-9dq7rwc7.js";import{me,te,g}from"./studio-3qr08sxq.js";import{n,Q,_,v}from"./studio-k3we3kqb.js";import{ce}from"./studio-0939t1q1.js";function ae(e){return{contentType:null,draft:!1,layout:void 0,path:e}}function ue(e,t,a){let{contentType:r,layout:o}=gC(t,a),i=a?.[Cs]===!0||t?.[Cs]===!0;return{contentType:r,draft:i,layout:o,path:e}}async function Ie(e){try{let t=await p().readFile(e);if(e.endsWith(".json")){let o=JSON.parse(t);return _(o)&&!Array.isArray(o)?ue(e,o,null):ae(e)}let{parseSourceForPath:a}=await (ce("1sghzgcr"),import("./file-ops-1sghzgcr.js")),r=await a(e,t);return ue(e,r.document,r.frontmatter)}catch{return ae(e)}}var Ve=300,q=null,V=null,re=0,ne=new Set;function fe(e){let t=e.join(`
2
- `);if(q?.key===t)return q.pages;if(!ye())return new Map(e.map((a)=>[a,ae(a)]));if(V?.key!==t){let a=re,r=Promise.all(e.slice(0,Ve).map((o)=>Ie(o))).then((o)=>{if(a!==re||V?.read!==r)return;V=null,q={key:t,pages:new Map(o.map((i)=>[i.path,i]))};for(let i of ne)i()});V={key:t,read:r}}return null}function cb(){re+=1,q=null,V=null}function ge(e){return ne.add(e),()=>{ne.delete(e)}}function lw(e){return e?"true":"false"}function ED(e){return e.trim().toLowerCase()}function db(e,...t){return e===""||t.some((a)=>a.toLowerCase().includes(e))}function Id(e){let t=e.replaceAll(/[-_]+/g," ").trim();return t===""?e:t.charAt(0).toUpperCase()+t.slice(1)}function ie(e){let t=Id(e);if(/ies$/i.test(t))return`${t.slice(0,-3)}y`;if(/[^s]s$/i.test(t))return t.slice(0,-1);return t}function oe(e){let t=e.slice(e.lastIndexOf("/")+1),a=t.lastIndexOf(".");return a>0?t.slice(0,a):t}function Y(e,t,a){let r=go(t,a);return r===null?e:`${e} (${r})`}function U(e,t,a=null){if(go(t,a)!==null){let c=mv(t,a);return Y(U(yr(c),c),t,a)}if(e.urlPattern==="/")return"Home";let r=e.urlPattern.split("/").filter((c)=>c!==""),o=(c)=>c==="*"||c.startsWith(":"),i=r.at(-1)??oe(t);if(!o(i))return Id(i);let l=r.findLast((c)=>!o(c));return Id(l??oe(t).replaceAll(/[[\].]/g,""))}function TD(e,t,a,r={}){let o=r.i18n??null,i=e.flatMap((u)=>ih(u.path,r.extensions)?[{fact:u,route:yr(u.path)}]:[]).toSorted((u,m)=>hC(u.route,m.route)||u.fact.path.localeCompare(m.fact.path)),l=[],c=(u,m,f,S)=>({detail:m.urlPattern,key:u.path,kind:f,label:S,path:u.path,selected:lw(u.path===a)}),d=new Map;for(let u of i){let m=u.fact.contentType;if(m!==null&&t.has(m))d.set(m,[...d.get(m)??[],u])}let s=new Set;for(let{fact:u,route:m}of i){let f=u.contentType,S=f===null?void 0:d.get(f);if(f===null||S===void 0){l.push(c(u,m,"page",U(m,u.path,o)));continue}if(s.has(f))continue;s.add(f),l.push({detail:ze(t.get(f)??null),key:`collection:${f}`,kind:"collection",label:Id(f),path:"",selected:"false"});let H=`${ie(f)} page`;for(let O of S){let P=Y(H,O.fact.path,o);l.push(c(O.fact,O.route,"entry-page",P))}}return l}function ze(e){if(e===null)return"";return`${e} ${e===1?"entry":"entries"}`}function LD(e,t){if(t==="")return[...e];let a=[],r=null,o=!1;for(let i of e){if(i.kind==="collection"){if(r=i,o=db(t,i.label),o)a.push(i);continue}if(i.kind==="page")r=null;if(i.kind==="entry-page"&&o||db(t,i.label,i.detail,i.path)){if(r&&!o)a.push(r),o=!0;a.push(i)}}return a}function EE(e,t,a,r=null){return e.filter((o)=>o.endsWith(".json")).toSorted((o,i)=>o.localeCompare(i)).flatMap((o)=>{let i=Id(oe(o));if(!db(a,i,o))return[];return[{detail:o===r?"default layout":"",key:o,label:i,path:o,selected:lw(o===t)}]})}var Be='img:not([src]), img[src=""] { visibility: hidden; }',he=new WeakMap;function _e(e){let t=he.get(e);if(t)return t;let a=e.defaultView?.CSSStyleSheet;if(!Q(a))return null;let r=new a;return r.replaceSync(Be),he.set(e,r),r}function cw(e,t){let a=e.shadowRoot??e.attachShadow({mode:"open"}),r=_e(e.ownerDocument);a.adoptedStyleSheets=[...iN(),...e.ownerDocument.adoptedStyleSheets,...r?[r]:[]],a.replaceChildren(t)}function dw(e){return e.shadowRoot?.firstElementChild??null}function z(e,t){if(e===void 0||e.trim()==="")return[];if(!t)return[e];return e.split(",").map((a)=>a.trim()).filter((a)=>a!=="")}var We=12;function we(e,t,a){let r=e.find((o)=>t.has(o.name));if(r)return{...r,order:t.get(r.name)};for(let o of e){if(o.measure)continue;let i=a.flatMap((c)=>z(c?.fields?.[o.name],o.list)),l=new Set(i).size;if(l>=2&&l<i.length&&l<=We)return{...o,order:[]}}return null}function N(e){return(t)=>e.get(t.path)}var ve=N(new Map),de={board:{itemWidth:0,rowHeight:0,windowed:!1},calendar:{itemWidth:0,rowHeight:0,windowed:!1},cards:{itemWidth:200,rowHeight:194,windowed:!0},table:{itemWidth:0,rowHeight:32,windowed:!0}},He=60,le=25;function xe(e,t){let a=de[e];if(a.itemWidth<=0||t<=0)return 1;return Math.max(1,Math.floor(t/a.itemWidth))}function Ge(e){if(e===void 0||!Number.isFinite(e))return"";if(e<1024)return`${e} B`;let t=["KB","MB","GB"],a=e/1024,r=0;while(a>=1024&&r<t.length-1)a/=1024,r+=1;return`${a<10?a.toFixed(1):Math.round(a)} ${t[r]}`}function qe(e){return e?Rp(new Date(e)):""}function Ye(e,t,a){switch(t){case"date":return a?.date??"";case"status":return a?.status??"";case"template":return a?.template??"";case"title":return a?.title??e.name;case"locale":return e.locale?Wt(e.locale):"";case"modified":return qe(e.modified);case"name":return e.name;case"path":return e.record?.source??e.path;case"size":return Ge(e.size);case"type":return e.type;case"url":return e.collection===hi?yr(e.path).urlPattern:"";default:{let r=mN(t);return r===null?"":a?.fields?.[r]??""}}}function $e(e,t,a,r){let o=yf(e.ext),i=r?.thumb??"";return{art:o||i!==""?"image":a&&e.collection!==null&&!e.record?"doc":"glyph",cells:t.map((l)=>({field:l.field,text:Ye(e,l.field,r)})),meta:e.type,name:r?.title??e.name,path:e.path,src:o?nr(e.path):i}}function se(e,t){return{art:"glyph",cells:[],meta:e.type,name:t?.title??e.name,path:e.path,src:""}}function Se(e,t=ve){let{days:a,undated:r}=pN(e,(c)=>t(c)?.date||dT(c)),o=a.slice(0,He),i=a.length-o.length,l=o.map((c)=>({count:"",files:c.files.map((d)=>se(d,t(d))),id:c.date,note:"",noteState:"hidden",title:c.date,undated:"false"}));if(r.length>0)l.push({count:"",files:r.slice(0,le).map((c)=>se(c,t(c))),id:"__undated",note:`${r.length} file${r.length===1?"":"s"} with no dated name and no modification time.`,noteState:"shown",title:"No date",undated:"true"});return{groups:l,truncated:i>0?`${i} older ${i===1?"day is":"days are"} not shown — filter, or switch to Table.`:""}}var be=["Draft","Published"];function Ue(e,t){let a=new Map;for(let o of e){let i=t(o)?.status||"No status",l=a.get(i);if(l)l.push(o);else a.set(i,[o])}let r=(o)=>{let i=be.indexOf(o);return i===-1?be.length:i};return[...a.entries()].map(([o,i])=>({files:i,group:o})).toSorted((o,i)=>r(o.group)-r(i.group)||o.group.localeCompare(i.group))}function Je(e,t,a){let r=`No ${a.title.toLowerCase()}`,o=new Map;for(let l of e){let c=z(t(l)?.fields?.[a.name],a.list);for(let d of c.length===0?[r]:new Set(c)){let s=o.get(d);if(s)s.push(l);else o.set(d,[l])}}let i=(l)=>{if(l===r)return Number.MAX_SAFE_INTEGER;let c=a.order.indexOf(l);return c===-1?a.order.length:c};return[...o.entries()].map(([l,c])=>({files:c,group:l})).toSorted((l,c)=>i(l.group)-i(c.group)||l.group.localeCompare(c.group))}function Le(e,t=ve,a=null){return(e.some((i)=>(t(i)?.status??"")!=="")?Ue(e,t):a?Je(e,t,a):fN(e)).map((i)=>{let l=i.files.length-le;return{count:String(i.files.length),files:i.files.slice(0,le).map((c)=>se(c,t(c))),id:i.group,note:l>0?`${l} more — switch to Table to see them.`:"",noteState:l>0?"shown":"hidden",title:i.group,undated:"false"}})}var Fe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioLibraryPane",$description:"The Content home (studio.md §22.5): one collection, browsed, as a Jx document over the kit. The adapter (`browse/library-pane.ts`) keeps every decision — which collection is shown, which of its files the filter kept, which of them the window renders, where the collection is published, and what a row's context menu offers — and hands this document one projection: a discriminant naming which of eight things to draw, the view switch already marked, a header line that is one of four states, and rows that are already strings. Nothing here asks what a file is, how big the viewport is, or whether the scan finished. The eight cases of `view` are the four honest empty states the Manage view collapsed into “No files found” — a scan still running, a scan that could not finish, a collection with nothing in it, and a filter that matched nothing — followed by the four views, so “what is on screen” has exactly one source. A card's live preview is an ISLAND: the document renders `doc-preview` and nothing inside it, and the adapter fills it through `onNodeCreated` when the card comes into view.",tagName:"div",attributes:{part:"library","data-jx-region":"${state.region}"},style:{$description:"What the fifty-two `.library*` rules in `styles/overlays.css` said, keyed on `part` and re-pointed at the studio token layer. Every one of them was this surface's alone, so the block goes with the conversion rather than being copied. Three sets of names could not come with the declarations. Ten `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, and `styles/spectrum.css` is deleted whole with the last Spectrum component, so a document that reads one is a document whose colours change when a component it does not use is removed. `--spectrum-gray-100` and `--spectrum-gray-200` are the studio's own `--bg-input` and `--hover-bg`; `--spectrum-blue-600` — the card's hover border and the drop outline — is `--accent`, which is what a Spectrum blue was standing in for; and `--spectrum-orange-100`, the incomplete-scan banner's ground, is mixed from `--warning` so the banner follows the chrome theme instead of being a dark-only hex. Nine names that were handles rather than styling stop being names at all: `.library-grid-cards`, `.library-grid-media`, `.library-day-undated`, `.library-drop-active`, `.library-upload-input` and the four `data-field` widths are `data-` attributes on a part here, because a part is the handle now.",display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"hidden",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="banner-slot"], & [part="locale-slot"], & [part="filter-slot"], & [part="fields-slot"], & [part="new-slot"], & [part="page-slot"], & [part="view-slot"], & [part="art-slot"], & [part="note-slot"], & [part="truncated-slot"]':{$description:"A `$switch` renders its own container, and none of these six 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="head"]':{$description:"The collection's title over its toolbar: the Content-Collection and Content-Pages boards' heading row. It does not scroll with the list.",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",padding:"var(--jx-space-4) var(--jx-space-5) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="heading"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="subtitle"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="subtitle"]:empty':{$description:"Only Pages carries a line under its title; a collection's own line is the header bar below the toolbar.",display:"none"},'& [part="toolbar"]':{$description:"It wraps rather than scrolls: the view switch, the search, the language facet, Fields and New are all equally reachable, and a toolbar that hid half of them behind an overflow would put the collection's own state somewhere the reader has to go looking for it.",display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"0",flexShrink:"0",flexWrap:"wrap"},'& [part="search"]':{width:"220px"},'& [part="locale"]':{$description:"Narrow on purpose: it holds one language name, and the toolbar wraps before it grows.",width:"160px"},'& [part="filter"]':{$description:"Narrow like the language facet: it holds one value of one field.",width:"160px"},'& [part="spacer"]':{flex:"1"},'& [part="layouts"]':{flexShrink:"0"},'& [part="banner"]':{$description:"The banner an INCOMPLETE listing carries. The Problem in the dock is the durable record; this is the same fact on the surface it is about, because a reader looking at a short list needs to know it is short for a reason without going anywhere to find out.",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--jx-space-4)",padding:"var(--jx-space-3) var(--jx-space-5)",background:"color-mix(in srgb, var(--warning) 18%, var(--bg-panel))",borderBottom:"1px solid var(--border)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="body"]':{flex:"1",minHeight:"0",overflow:"auto",position:"relative"},'& [part="empty"]':{padding:"48px var(--jx-space-6)",textAlign:"center",color:"var(--fg-dim)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)"},'& [part="empty"] p':{margin:"0"},'& [part="empty-detail"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="truncated"]':{$description:"What a capped layout did not draw, stated. A grouped list cannot window — a window over one either breaks the groups or needs variable-height measurement — so Calendar and Board cap instead, and a layout that truncated in silence would be the same class of lie as “No files found”.",margin:"var(--jx-space-3) 0 0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="grid"]':{$description:"Cards and Media, the two windowed grids. The item sizes here are the ones `library-layouts.ts`'s LAYOUT_METRICS counts rows in; change one and change both.",display:"grid",gap:"var(--jx-space-4)",padding:"var(--jx-space-4) var(--jx-space-5)",alignItems:"start"},'& [part="grid"][data-layout="cards"]':{gridTemplateColumns:"repeat(auto-fill, minmax(188px, 1fr))"},'& [part="card"], & [part="tile"]':{cursor:"pointer",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-panel)"},'& [part="card"]:hover, & [part="tile"]:hover':{borderColor:"var(--accent)"},'& [part="card-art"], & [part="tile-art"]':{aspectRatio:"4 / 3",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:"var(--bg-input)",pointerEvents:"none"},'& [part="file-glyph"]':{"--jx-icon-size":"32px",color:"var(--fg-dim)"},'& [part="doc-preview"]':{$description:"The island. The document renders this box and nothing inside it; the adapter mounts a real runtime render of the file into a shadow root of the island's own when the card comes into view (`mountPreview` in `browse/library-preview.ts`, which keeps the document's ids out of Studio's), and the zoom is what makes a page-sized document readable as a thumbnail without rendering it at thumbnail size: the render is laid out in a box two and a half times as wide and drawn at 0.4. It is `inert`, so a page's own links and buttons are neither focusable nor named inside the card.",width:"100%",height:"100%",zoom:"0.4",overflow:"hidden"},'& [part="thumb"]':{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"},'& [part="card-label"], & [part="tile-label"]':{padding:"6px var(--jx-space-3) 0",fontSize:"var(--jx-text-md)",color:"var(--fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},'& [part="card-meta"]':{padding:"0 var(--jx-space-3) 6px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="table"]':{$description:"A windowed list rather than a table component: the rows have to be sliceable, and every table widget wants the whole set.",display:"flex",flexDirection:"column",minWidth:"min-content",padding:"0 var(--jx-space-5) var(--jx-space-5)"},'& [part="table-head"], & [part="table-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",height:"32px",borderBottom:"1px solid var(--border)"},'& [part="table-head"]':{position:"sticky",top:"0",zIndex:"1",background:"var(--bg-panel)",fontWeight:"600",fontSize:"var(--jx-text-md)"},'& [part="table-row"]':{cursor:"pointer"},'& [part="table-row"]:hover':{background:"var(--hover-bg)"},'& [part="cell"]':{$description:"Every column keeps a floor: with a collection's six field columns beside the file facts, a cell that may shrink to nothing is a column of ellipses. When the floors outgrow the pane, the table scrolls sideways instead. Each cell's text is kept out of its intrinsic width (`contain: inline-size`), so the table's `min-content` is the sum of those floors rather than of every full title.",flex:"1",minWidth:"80px",contain:"inline-size",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-md)"},'& [part="cell"][data-field="name"], & [part="cell"][data-field="title"]':{$description:"What a row is called keeps a readable width however many field columns stand beside it.",flex:"3",minWidth:"220px",fontWeight:"500"},'& [part="cell"][data-field="path"]':{flex:"2",color:"var(--fg-dim)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"},'& [part="cell"][data-field="size"], & [part="cell"][data-field="modified"]':{flex:"0 0 96px"},'& [part="cell"][data-field="locale"]':{$description:"Fixed, like size and modified: a language name is short and never earns width from Name. Without this it inherits the `flex: 1` above and the Name column loses a quarter of itself in every multilingual project.",flex:"0 0 90px",color:"var(--fg-dim)"},'& [part="calendar"]':{padding:"var(--jx-space-4) var(--jx-space-5)"},'& [part="day"]':{marginBottom:"var(--jx-space-5)"},'& [part="day-date"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"600",color:"var(--fg)"},'& [part="day"][data-undated="true"] [part="day-date"]':{$description:"A file with no dated name and no modification time is set apart rather than parked on today. A calendar that invents dates is worse than one that says which files it could not place.",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="board"]':{display:"flex",gap:"var(--jx-space-4)",padding:"var(--jx-space-4) var(--jx-space-5)",alignItems:"flex-start",overflowX:"auto"},'& [part="column"]':{flex:"0 0 220px",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"var(--jx-space-3)",background:"var(--bg-panel)"},'& [part="column-title"]':{margin:"0 0 6px",fontSize:"var(--jx-text-md)",fontWeight:"600",display:"flex",justifyContent:"space-between"},'& [part="count"]':{color:"var(--fg-dim)",fontWeight:"400"},'& [part="list"]':{listStyle:"none",margin:"0",padding:"0"},'& [part="list-item"]':{padding:"3px var(--jx-space-2)",borderRadius:"var(--radius)",cursor:"pointer",fontSize:"var(--jx-text-md)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},'& [part="list-item"]:hover':{background:"var(--hover-bg)"},'& [part="page-line"]':{$description:"One line saying where the collection's entries are published, the Content-Collection board's bar under the toolbar. Its action is quiet: it opens another workspace, and it must not compete with New.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--jx-space-2)",padding:"var(--jx-space-2) var(--jx-space-5)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)",flexShrink:"0"},'& [part="page-pattern"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg)"},'& [part="design-page"], & [part="add-page"]':{marginLeft:"auto"},'& [part="card"]:focus-visible, & [part="table-row"]:focus-visible, & [part="list-item"]:focus-visible':{$description:"Rows and cards open on Enter or Space as well as a click, so the keyboard reaches an entry; the ring says which one it is on.",outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"div",attributes:{part:"heading"},children:[{tagName:"h2",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"p",attributes:{part:"subtitle"},textContent:"${state.subtitle}"}]},{tagName:"div",attributes:{part:"toolbar"},children:[{tagName:"jx-action-group",attributes:{part:"layouts"},$props:{selects:"single",compact:!0,label:"View"},children:[{$prototype:"Array",items:{$ref:"#/state/layouts"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"layout","data-layout":"${$map.item.key}"},$props:{size:"sm",hint:"${$map.item.label}",checked:{$ref:"$map/item/checked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setLayout"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]},{tagName:"jx-textfield",attributes:{part:"search"},$props:{label:"${state.searchLabel}",placeholder:"${state.searchLabel}…",size:"sm",value:{$ref:"#/state/query"},type:"search"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/search"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"locale-slot",role:"none"},$switch:{$ref:"#/state/localeState"},cases:{shown:{tagName:"jx-select",attributes:{part:"locale"},$props:{label:"Language",size:"sm",options:{$ref:"#/state/localeOptions"},value:{$ref:"#/state/localeValue"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setLocale"},value:[{$ref:"event#/target/value"}]}],description:"The facet's options come from ALL scanned files, never from the filtered ones: a picker whose choices collapse to the choice just made cannot be used to make another."}}}},{tagName:"div",attributes:{part:"filter-slot",role:"none"},$switch:{$ref:"#/state/filterState"},cases:{shown:{$description:"The Filter: one value of what groups the entries, their status or the field the Board groups by, so it offers exactly the Board's columns.",tagName:"jx-select",attributes:{part:"filter"},$props:{label:"Filter",size:"sm",options:{$ref:"#/state/filterOptions"},value:{$ref:"#/state/filterValue"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"span",attributes:{part:"spacer"}},{tagName:"div",attributes:{part:"grid-slot",role:"none"},$switch:{$ref:"#/state/fieldsState"},cases:{shown:{tagName:"jx-action-button",attributes:{part:"edit-grid"},$props:{size:"sm",icon:"rows",hint:"Edit every entry of this collection in a grid"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}],description:"The collection's grid (`collection.editInGrid { name }`): the one visible door to it, since the palette cannot prompt for a free-text name."},children:[{tagName:"span",textContent:"Edit in grid"}]}}},{tagName:"div",attributes:{part:"fields-slot",role:"none"},$switch:{$ref:"#/state/fieldsState"},cases:{shown:{tagName:"jx-action-button",attributes:{part:"fields"},$props:{size:"sm",icon:"sliders-horizontal",hint:"Edit this collection's fields in Project Settings",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFields"},value:[]}],description:'Project Settings › Content types, on this collection (`settings.open { section: "content", entry }`).'},children:[{tagName:"span",textContent:"Fields"}]}}},{tagName:"div",attributes:{part:"new-slot",role:"none"},$switch:{$ref:"#/state/newState"},cases:{shown:{tagName:"jx-button",attributes:{part:"new"},$props:{size:"sm",variant:"accent"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}],description:"Creation is somebody else's flow: `file.new` opens Add new on this collection's kind, a page for Pages and an entry for a collection."},children:[{tagName:"span",textContent:"${state.newLabel}"}]}}}]}]},{$description:"The header line: where this collection's entries are published, derived from the page whose `$paths.contentType` names it. Pages draw nothing here.",tagName:"div",attributes:{part:"page-slot",role:"none"},$switch:{$ref:"#/state/page/state"},cases:{loading:{tagName:"div",attributes:{part:"page-line"},children:[{tagName:"span",attributes:{part:"page-text"},textContent:"${state.page.text}"}]},page:{tagName:"div",attributes:{part:"page-line","data-state":"page"},children:[{tagName:"span",attributes:{part:"page-text"},textContent:"${state.page.text}"},{tagName:"code",attributes:{part:"page-pattern"},textContent:"${state.page.pattern}"},{tagName:"span",attributes:{part:"page-template"},textContent:"${state.page.template}"},{tagName:"jx-action-button",attributes:{part:"design-page"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/designPage"},value:[]}],description:"Opening the page is activating it, which enters Design (studio.md §22.1)."},children:[{tagName:"span",textContent:"${state.page.designLabel}"}]}]},none:{tagName:"div",attributes:{part:"page-line","data-state":"none"},children:[{tagName:"span",attributes:{part:"page-text"},textContent:"${state.page.text}"},{tagName:"jx-action-button",attributes:{part:"add-page"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addPage"},value:[]}],description:"Writes the collection's page exactly as Add new's own-page option does."},children:[{tagName:"span",textContent:"Add one"}]}]}}},{tagName:"div",attributes:{part:"banner-slot",role:"none"},$switch:{$ref:"#/state/bannerState"},cases:{shown:{tagName:"div",attributes:{part:"banner",role:"status"},children:[{tagName:"span",textContent:"${state.bannerText}"},{tagName:"jx-button",attributes:{part:"retry"},$props:{size:"sm",variant:"secondary"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"}}]},children:[{tagName:"span",textContent:"Retry"}]}]}}},{tagName:"div",attributes:{part:"body"},onscroll:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/scrolled"}}],description:"The rendered item count is proportional to the VIEWPORT, not to the project: a scroll recomputes the window from the box the adapter measures here, and never re-reads the scan."},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},$switch:{$ref:"#/state/view"},cases:{loading:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"Scanning the project…"}]},incomplete:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"Nothing to show, and the scan did not finish."},{tagName:"p",attributes:{part:"empty-detail"},textContent:"${state.emptyDetail}"},{tagName:"jx-button",attributes:{part:"retry"},$props:{size:"sm",variant:"primary"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"}}]},children:[{tagName:"span",textContent:"Retry"}]}]},empty:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"${state.emptyMessage}"},{tagName:"p",attributes:{part:"empty-detail"},textContent:"${state.emptyDetail}"}]},nomatch:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",children:[{tagName:"span",textContent:"${state.emptyMessage}"},{tagName:"span",attributes:{part:"empty-detail"},textContent:" ${state.emptyDetail}"}]},{tagName:"jx-button",attributes:{part:"reset"},$props:{size:"sm",variant:"secondary"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/reset"}}],description:"Both facets in one clause and one button, so a reader who filtered twice is told about both rather than sent to clear one and find the list still empty."},children:[{tagName:"span",textContent:"Clear filters"}]}]},cards:{tagName:"div",attributes:{part:"grid","data-layout":"cards",style:"${state.pad}"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/path"},map:{tagName:"div",attributes:{part:"card","data-path":"${$map.item.path}",tabindex:"0",role:"button"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]," ":[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]}}]},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:"div",attributes:{part:"card-art"},children:[{tagName:"div",attributes:{part:"art-slot",role:"none"},$switch:{$ref:"$map/item/art"},cases:{image:{tagName:"img",attributes:{part:"thumb",loading:"lazy",src:"${$map.item.src}",alt:""}},doc:{tagName:"div",attributes:{part:"doc-preview","data-path":"${$map.item.path}",inert:""}},glyph:{tagName:"jx-icon",attributes:{part:"file-glyph"},$props:{name:"file-text"}}}}]},{tagName:"div",attributes:{part:"card-label",title:"${$map.item.path}"},textContent:"${$map.item.name}"},{tagName:"div",attributes:{part:"card-meta"},textContent:"${$map.item.meta}"}]}}]},table:{tagName:"div",attributes:{part:"table",role:"table","aria-label":"${state.title}"},children:[{tagName:"div",attributes:{part:"table-head",role:"row"},children:[{$prototype:"Array",items:{$ref:"#/state/columns"},key:{$ref:"$map/item/field"},map:{tagName:"div",attributes:{part:"cell",role:"columnheader","data-field":"${$map.item.field}"},textContent:"${$map.item.title}"}}]},{tagName:"div",attributes:{part:"pad",style:"${state.padTop}"}},{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/path"},map:{tagName:"div",attributes:{part:"table-row",role:"row","data-path":"${$map.item.path}",tabindex:"0"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]," ":[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]}}]},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:[{$prototype:"Array",items:{$ref:"$map/item/cells"},key:{$ref:"$map/item/field"},map:{tagName:"div",attributes:{part:"cell",role:"cell","data-field":"${$map.item.field}"},textContent:"${$map.item.text}"}}]}},{tagName:"div",attributes:{part:"pad",style:"${state.padBottom}"}}]},calendar:{tagName:"div",attributes:{part:"calendar"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/id"},map:{tagName:"section",attributes:{part:"day","data-undated":"${$map.item.undated}"},children:[{tagName:"h3",attributes:{part:"day-date"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"note-slot",role:"none"},$switch:{$ref:"$map/item/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${$map.item.note}"}}},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"list-item","data-path":"${$map.item.path}",title:"${$map.item.path}",tabindex:"0"},textContent:"${$map.item.name}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]," ":[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]}}]},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"}]}]}}}]}]}},{tagName:"div",attributes:{part:"truncated-slot",role:"none"},$switch:{$ref:"#/state/truncatedState"},cases:{shown:{tagName:"p",attributes:{part:"truncated"},textContent:"${state.truncated}"}}}]},board:{tagName:"div",attributes:{part:"board"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/id"},map:{tagName:"section",attributes:{part:"column"},children:[{tagName:"h3",attributes:{part:"column-title"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"list-item","data-path":"${$map.item.path}",title:"${$map.item.path}",tabindex:"0"},textContent:"${$map.item.name}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]," ":[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]}}]},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"}]}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},$switch:{$ref:"$map/item/noteState"},cases:{shown:{tagName:"p",attributes:{part:"truncated"},textContent:"${$map.item.note}"}}}]}}]}}}]}]};E("library-pane",Fe);function Ce(e,t){e.region=t.region,e.view=t.view,e.title=t.title,e.subtitle=t.subtitle,e.searchLabel=t.searchLabel,e.newLabel=t.newLabel,e.newState=t.newState,e.fieldsState=t.fieldsState,e.page=t.page,e.layouts=t.layouts,e.filterState=t.filterState,e.filterOptions=t.filterOptions,e.filterValue=t.filterValue,e.localeState=t.localeState,e.localeOptions=t.localeOptions,e.localeValue=t.localeValue,e.query=t.query,e.bannerState=t.bannerState,e.bannerText=t.bannerText,e.emptyMessage=t.emptyMessage,e.emptyDetail=t.emptyDetail,e.pad=t.pad,e.padTop=t.padTop,e.padBottom=t.padBottom,e.rows=t.rows,e.columns=t.columns,e.groups=t.groups,e.truncated=t.truncated,e.truncatedState=t.truncatedState}function Xe(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function Qe(e){let t=e?.$map,a=v(t)?t.item:void 0,r=v(a)?a.path:void 0;return n(r)?r:""}function ke(e,t,a){e.replaceChildren();let r=new AbortController;NA(e,r.signal);let o=g({addPage:a.addPage,bannerState:"hidden",bannerText:"",columns:[],contextMenu:a.contextMenu,designPage:a.designPage,emptyDetail:"",emptyMessage:"",fieldsState:"hidden",groups:[],layouts:[],filterOptions:[],filterState:"hidden",filterValue:"",localeOptions:[],localeState:"hidden",localeValue:"",newLabel:"",newState:"hidden",openFields:a.openFields,openGrid:a.openGrid,openFile:a.openFile,openNew:a.openNew,pad:"",padBottom:"",padTop:"",previewSlot:a.previewSlot,query:"",region:"",reset:a.reset,retry:a.retry,page:{designLabel:"",pattern:"",state:"hidden",template:"",text:""},rows:[],scrolled:a.scrolled,scroller:a.scroller,search:a.search,searchLabel:"",setLayout:a.setLayout,setFilter:a.setFilter,setLocale:a.setLocale,subtitle:"",title:"",truncated:"",truncatedState:"hidden",view:"loading"});Ce(o,t);let i=null,l=!1,c=R("library-pane",o,e,{onNodeCreated:(d,s,u,m)=>{let f=Xe(u);if(f===""||!(d instanceof HTMLElement))return;if(f==="body"){a.scroller(d);return}if(f==="doc-preview"){let S=Qe(m);if(S)a.previewSlot(d,S)}}}).then((d)=>{let s=d.root;if(l)return d.dispose(),s;return i=d,s});return{attached:()=>{if(l)return!1;let d=i?.root;return d===void 0?!0:d instanceof HTMLElement&&e.contains(d)},dispose(){l=!0,r.abort(),i?.dispose(),i=null},ready:c,update:(d)=>Ce(o,d)}}var Ze="table",y=g({collection:hi,loading:!1,revision:0,views:{}});function il(e=Fu()){let t=y.views[e];if(t)return t;let a={filter:"",layout:Ze,locale:"",query:""};return y.views[e]=a,y.views[e]??a}function T(){return Ql(y.collection)??{fileBacked:!1,item:"page",key:hi,kind:"pages",title:"Pages"}}function Fu(){return T().key}var j=null,A=!1;function k(){if(j?.stale()===!0){j=null,A=!1;for(let e of M.values())e.cache.clear()}return j??=bN(),j}function x(){y.revision+=1}function $D(e){y.collection=e,il(e),x(),wn("leftPanel")}function TE(e,t=Fu()){il(t).layout=e,x()}function G_(e,t=Fu()){il(t).query=e,x()}function et(e,t=Fu()){il(t).filter=e,x()}function K_(e,t=Fu()){il(t).locale=e,x()}function Rd(){j=null,A=!1;for(let e of M.values())e.cache.clear();x()}function LE(){let e=k();if(!A&&!y.loading)I();if(!e.scanned())return null;let t=new Map;for(let a of e.files())if(a.collection!==null)t.set(a.collection,(t.get(a.collection)??0)+1);return t}var tt=600,Pe="content.scan",L="Content";async function I(){let e=k();A=!0,y.loading=!0,x();let t={handle:null},a=setTimeout(()=>{t.handle=qs({source:L,status:"Reading the project's directories…",title:"Scan project files"})},tt);try{await e.rows();let r=e.failures();if(r.length>0){let o=r.map((l)=>`${l.dir} — ${l.error}`).join(`
3
- `),i=`Could not read ${r.length} project ${r.length===1?"directory":"directories"} — this list is incomplete.`;w.error(i,{action:"content.refresh",detail:o,key:Pe,path:r[0].dir,source:L,tier:"problem"}),t.handle?.setStatus(i)}t.handle?.done(`${e.files().length} file(s)`)}catch(r){if(t.handle)t.handle.fail("Could not scan the project's files.");else w.error("Could not scan the project's files.",{action:"content.refresh",detail:X(r),key:Pe,source:L,tier:"problem"})}finally{clearTimeout(a),y.loading=!1,x(),wn("leftPanel")}}async function $E(){j=null,A=!1;for(let e of M.values())e.cache.clear();await I()}var M=new Map;function W(e){return M.get(e)??null}function IE(e,t){let a=W(e);return a!==null&&a.tabId===t.id&&a.wrap.isConnected&&a.surface.attached()}function RE(e){let t=M.get(e);if(!t)return;if(t.settleTimer!==null)clearTimeout(t.settleTimer),t.settleTimer=null;t.unlisten(),t.observer.destroy(),t.cache.clear(),t.slots.clear(),t.pendingPaths.clear(),t.scope.stop(),t.surface.dispose(),M.delete(e)}function at(e,t,a){let r=de[t],o=e?.scroller??null;if(!r.windowed||!o)return{end:a,padBottom:0,padTop:0,start:0,totalRows:a};return PS({columns:xe(t,o.clientWidth),count:a,rowHeight:r.rowHeight,scrollTop:o.scrollTop,viewportHeight:o.clientHeight})}async function rt(e,t){e.pendingPaths.add(t);try{let a=await ww(t,e.cache);if(!a||W(e.paneId)!==e)return;let r=e.slots.get(t);if(r?.isConnected&&!dw(r))cw(r,a)}finally{e.pendingPaths.delete(t)}}function je(e,t,a){let r=e.cache.get(a);if(dw(t))return;if(r){cw(t,r);return}if(e.pendingPaths.has(a))return;e.pending.set(t,a),e.observer.observe(t)}function ot(e,t,a){e.slots.set(a,t),je(e,t,a)}function it(e){if(e.settleTimer!==null)return;e.settleTimer=setTimeout(()=>{if(e.settleTimer=null,W(e.paneId)!==e)return;e.observer.releaseDetached();let t=uN.has(il().layout);for(let[a,r]of e.slots){if(!r.isConnected){e.slots.delete(a);continue}if(t)je(e,r,a)}},0)}function Re(e){if(e.record)lN(e.record.source,e.record.row);else if(e.collection===null||e.collection===hi)_i(e.path);else Vl(e.path)}var B=null;function lt(){B?.close(),B=null}function Me(e){return k().files().find((t)=>t.path===e)??null}function st(e,t,a){let r=Me(e);if(!r||r.record)return;lt();let o=(i,l,c,d={})=>({destructive:!1,disabled:!1,dividerAbove:!1,id:i,run:c,title:l,...d});B=zt({label:"File actions",onClosed:(i)=>{if(B===i)B=null},origin:{x:t,y:a},region:"content",rows:[o("open","Open",()=>{Re(r)}),o("rename","Rename…",()=>{ct(r)},{dividerAbove:!0}),...p().readFileBytes!==void 0?[o("duplicate","Duplicate",()=>{dt(r)})]:[],o("delete","Delete",()=>{pt(r)},{destructive:!0,dividerAbove:!0})]})}async function ct(e){let t=e.path.replaceAll("\\","/"),a=await OS(t,L);if(a===null)return;let r=await Ob(e.path),o={confirmLabel:"Rename",select:"stem",validate:(d)=>Wm(t,d,a),value:e.name};if(r!==void 0)o.message=r;let i=await Fn("Rename",o);if(!i||i===e.name)return;let l=Tm(t),c=l==="."?i:`${l}/${i}`;try{let d=await Pw(t,c);Rd(),await I(),Mw(AS(i,d),d,c)}catch(d){w.error(`Could not rename ${e.name}.`,{detail:X(d),path:e.path,source:L})}}async function dt(e){if(await Ax(e.path.replaceAll("\\","/"),{document:!0,source:L})!==null)Rd(),await I()}async function pt(e){if(!await Ab(e))return;try{await p().deleteFile(e.path),us(),Rd(),await I(),w.success(`Deleted ${e.name}`)}catch(a){w.error(`Could not delete ${e.name}.`,{detail:X(a),path:e.path,source:L})}}function Ne(e,t){if(e.layout===!1)return"with no template";let a=e.layout??t;return a?`using ${qb(a)}`:"with no template"}function ut(e,t,a,r=[]){let o={designLabel:"",pattern:"",state:"hidden",template:"",text:""};if(e.kind==="pages")return o;if(t===void 0)return{...o,state:"loading",text:"Finding where these entries are published…"};if(t===null)return{...o,state:"none",text:"Entries have no page of their own"};let i=Eb(),l=(d)=>{let s=d===null?-1:i.indexOf(d);return s===-1?i.length:s},c=r.filter((d)=>d.locale!==null).toSorted((d,s)=>l(d.locale)-l(s.locale));if(c.length>1){let d=new Set(c.map((s)=>Ne(s,a)));return{designLabel:`Design the ${e.item} page`,pattern:c.map((s)=>`${s.pattern} (${s.locale})`).join(", "),state:"page",template:d.size===1?[...d][0]:"using a template per language",text:`Each ${e.item} has a page in each language at`}}return{designLabel:`Design the ${e.item} page`,pattern:t.pattern,state:"page",template:Ne(t,a),text:`Each ${e.item} has a page at`}}function mt(e){let t=sh(e,il(e).locale);if(t)_i(t.path)}async function ft(e){let{addCollectionPage:t}=await (ce("v0pm96mr"),import("./add-new-flow-v0pm96mr.js"));await t(e)}function gt(e,t,a){return{checked:a?"true":"false",key:e,label:t}}function ht(e,t){let a=`${t.locale===""?"":` in ${Wt(t.locale)}`}${t.filter===""?"":` filtered to ${t.filter}`}`,r=t.query.trim();return`No ${e.kind==="pages"?"pages":e.title.toLowerCase()} match${r?` “${r}”`:""}${a}.`}function yt(e,t,a,r){if(a>0)return t;if(y.loading||!e.scanned())return"loading";if(e.failures().length>0)return"incomplete";return r===0?"empty":"nomatch"}function J_(e){return k().files().filter((t)=>t.collection===e).map((t)=>t.path)}function bt(e,t){if(e.kind==="pages")return k().scanned()?wt(t==="table"):N(new Map);if(e.fileBacked){let o=Ee(e.key),i=k().files().filter((l)=>l.collection===e.key&&l.record);return N(new Map(i.map((l)=>{let{fields:c}=l.record,d=wS(o,c),s=d===null?"":kb(c[d]??""),u=aT(l.record.source,c,o);return[l.path,{date:s,fields:c,status:"",thumb:u,title:l.name}]})))}if(!k().scanned())return N(new Map);let a=Cw(e.key,J_(e.key)),r=new Map((a??[]).map((o)=>[o.path,{date:o.date,fields:o.fields,status:o.status,thumb:o.thumb,title:o.title}]));return N(r)}function wt(e){let t=J_(hi),a=e?fe(t):null,r=new Set(Object.keys(C?.projectConfig?.content??{})),o=Ae(),{i18n:i}=ln(C?.projectConfig??{}),l=[...a?.values()??[]].some((d)=>d.draft),c=new Map(t.map((d)=>{let s=a?.get(d),u=s?.contentType??null,m=s===void 0?void 0:s.layout??o??!1;return[d,{date:"",status:s===void 0||!l?"":s.draft?"Draft":"Published",template:m===void 0?"":m===!1?"None":qb(m),title:u!==null&&r.has(u)?Y(`${ie(u)} page`,d,i):U(yr(d),d,i)}]}));return N(c)}function vt(e){return e.map((t)=>({file:t,route:yr(t.path)})).toSorted((t,a)=>hC(t.route,a.route)||t.file.path.localeCompare(a.file.path)).map(({file:t})=>t)}function Ee(e){return Sa(e)?.schema??PA(e)}function xt(e){let t=new Set,a=Sp(e),r=sT(e);for(let o of[a,r])if(o!==null)t.add(o);return t}function $t(e){let t=new Map;for(let[a,r]of Object.entries(e?.properties??{}))if(Array.isArray(r.enum))t.set(a,r.enum.filter((o)=>n(o)));return t}function St(e,t){let a=[...new Set(e.flatMap((i)=>i?.status?[i.status]:[]))];if(a.length>0)return{matches:(i,l)=>(i?.status??"")===l,title:"Status",values:a.toSorted((i,l)=>i==="Draft"?-1:l==="Draft"?1:i.localeCompare(l))};if(!t)return null;let r=new Set(e.flatMap((i)=>z(i?.fields?.[t.name],t.list))),o=t.order.length>0?[...t.order,...[...r].filter((i)=>!t.order.includes(i)).toSorted()]:[...r].toSorted((i,l)=>i.localeCompare(l));return{matches:(i,l)=>z(i?.fields?.[t.name],t.list).includes(l),title:t.title,values:o}}function Te(e,t){let a=k(),r=T(),o=il(r.key),{layout:i}=o,l=cT(a.files(),{collection:r.key,query:""}),c=bt(r,i),d=l.map((h)=>c(h)),s=r.kind==="collection"?Ee(r.key):null,u=gN(s,xt(s)),m=we(u,$t(s),d),f=r.kind==="collection"?St(d,m):null,S=f!==null&&f.values.includes(o.filter)?o.filter:"",H=cT(a.files(),{collection:r.key,locale:o.locale,query:o.query}),O=f===null||S===""?H:H.filter((h)=>f.matches(c(h),S)),P=r.kind==="pages"?vt(O):O,J=l.length,b=yt(a,i,P.length,J),D=at(e,i,P.length),Oe=P.slice(D.start,D.end),F=a.failures(),K=hN(l),pe=uT(r.key,{date:sT(s)!==null||d.some((h)=>(h?.date??"")!==""),fields:u,locale:K.length>1,status:d.some((h)=>(h?.status??"")!=="")}),De=b==="cards",Z=b==="calendar"?Se(P,c):{groups:[],truncated:""},G=r.kind==="pages",ee=G?"pages":r.title.toLowerCase();return{bannerState:F.length>0?"shown":"hidden",bannerText:F.length===0?"":`This list is incomplete — ${F.length} ${F.length===1?"directory":"directories"} could not be read (${F[0].dir}${F.length>1?", …":""}).`,columns:b==="table"?pe.map((h)=>({field:h.field,title:h.title})):[],emptyDetail:b==="incomplete"?`${F.length} ${F.length===1?"directory":"directories"} could not be read, so this is not the same as an empty collection.`:b==="nomatch"?`${J} ${J===1?r.item:ee} in all.`:b==="empty"?`New ${r.item} adds the first one.`:"",emptyMessage:b==="nomatch"?ht(r,o):b==="empty"?`No ${ee} yet.`:"",fieldsState:r.kind==="collection"?"shown":"hidden",groups:b==="board"?Le(P,c,m):Z.groups,layouts:_m.map((h)=>gt(h,Ew[h],i===h)),localeOptions:[{label:"All languages",value:"all"},...K.map((h)=>({label:Wt(h),value:h}))],filterOptions:f===null?[]:[{label:`Any ${f.title.toLowerCase()}`,value:"all"},...f.values.map((h)=>({label:h,value:h}))],filterState:f!==null&&f.values.length>1?"shown":"hidden",filterValue:S===""?"all":S,localeState:K.length<2?"hidden":"shown",localeValue:o.locale===""?"all":o.locale,newLabel:`New ${r.item}`,newState:r.fileBacked?"hidden":"shown",pad:`padding-top:calc(var(--jx-space-4) + ${D.padTop}px);padding-bottom:calc(var(--jx-space-4) + ${D.padBottom}px)`,padBottom:`height:${D.padBottom}px`,padTop:`height:${D.padTop}px`,page:ut(r,G?null:sh(r.key,o.locale),Ae(),G||o.locale!==""?[]:jA(r.key)??[]),query:o.query,region:Ln(t,"content"),rows:b==="cards"||b==="table"?Oe.map((h)=>$e(h,b==="table"?pe:[],De,c(h))):[],searchLabel:`Search ${ee}`,subtitle:G?"Every URL on your site.":"",title:r.title,truncated:Z.truncated,truncatedState:Z.truncated===""?"hidden":"shown",view:b}}function Ae(){return C?.projectConfig?.defaults?.layout??null}function ID(e,t){let{paneId:a,wrap:r}=e;if(IE(a,t))return;RE(a);let o=null,i=_p((s)=>{let u=o;if(!u)return;let m=u.pending.get(s);if(m!==void 0)u.pending.delete(s),rt(u,m)}),l=()=>{if(o!==null&&W(a)===o)o.surface.update(Te(o,a)),it(o)},c=ke(r,Te(null,a),{addPage:()=>{ft(T().key)},contextMenu:(s,u,m)=>st(s,u,m),designPage:()=>{mt(T().key)},openFields:()=>{nt("settings.open",{entry:T().key,section:"content"},L)},openGrid:()=>{let s=T(),u=s.fileBacked?ax(s.key):null;if(u){_i(u);return}nt("collection.editInGrid",{name:s.key},L)},openFile:(s)=>{Re(Me(s)??{collection:Fu(),path:s})},openNew:()=>{let s=T(),{locale:u}=il(s.key),m=s.kind==="pages"?{kind:"page"}:{collection:s.key,kind:"entry"};if(u!=="")m.locale=u;nt("file.new",m,L)},previewSlot:(s,u)=>{if(o)ot(o,s,u)},reset:()=>{G_(""),K_("")},retry:()=>{$E()},scrolled:()=>x(),scroller:(s)=>{if(o)o.scroller=s},search:(s)=>G_(s),setLayout:(s)=>TE(s),setFilter:(s)=>et(s==="all"?"":s),setLocale:(s)=>K_(s==="all"?"":s)}),d=me();o={cache:yw(),observer:i,paneId:a,pending:new WeakMap,pendingPaths:new Set,scope:d,scroller:null,settleTimer:null,slots:new Map,surface:c,tabId:t.id,unlisten:(()=>{let s=Ap(()=>x()),u=kw(()=>x()),m=ge(()=>x());return()=>{s(),u(),m()}})(),wrap:r},M.set(a,o),d.run(()=>{te(()=>{if(W(a)!==o)return;y.revision,y.collection,y.loading;let s=il(Fu());if(s.layout,s.query,s.locale,l(),!A&&!y.loading)I()})})}function RD(){y.collection=hi,y.views={},y.loading=!1,j=null,A=!1,x()}
4
- export{cb,lw,ED,db,Id,TD,LD,EE,cw,dw,il,Fu,$D,TE,G_,K_,Rd,LE,$E,IE,RE,J_,ID,RD};
5
-
6
- //# debugId=070A13E7BCCF0D1F64756E2164756E21
7
- //# sourceMappingURL=studio-2kpxm0eh.js.map
@@ -1,5 +0,0 @@
1
- import{St,ti,Se,Fe,xh,m,Si,Ft}from"./studio-knsjyx7n.js";import{p}from"./studio-4fnb5648.js";import{jt,fn}from"./studio-q9hx2qp0.js";import{Zs,dt}from"./studio-tpxcryf2.js";import{Ls,Ud}from"./studio-bnc50f9h.js";import{Fd,WT,BS,UT,qT}from"./studio-frc16j8v.js";import{Nb,ss,Yl,Ww,Vw,Lp,Qo,$p}from"./studio-hfqpfmpk.js";import{C}from"./studio-4f7thq0p.js";import{E,R}from"./studio-9dq7rwc7.js";import{g}from"./studio-3qr08sxq.js";import{n,Y,Q,wf}from"./studio-k3we3kqb.js";var T={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGridOpen",$description:"Every grid-able source a project has, grouped by where it comes from: the project's own pages and content collections first, then each connection's tables. It is the ISLAND of a confirm dialog rather than a dialog of its own — `ui/layers.ts`'s dialog owns the headline, the cancel button, modality and focus, and this document is only the list — because a second answer to \"what is a dialog\" is a defect (studio-ui-guidelines.md §12.5). Group headings are why it is not the kit menu: a menu row can carry a divider above it and cannot carry a name for the run it opens.",tagName:"div",attributes:{part:"sources"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",minWidth:"280px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="group-title"]':{margin:"0",fontSize:"var(--jx-text-xs)",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"1px",marginTop:"var(--jx-space-1)"},'& [part="source"]':{textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-2) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer"},'& [part="source"]:hover':{background:"var(--bg-hover)"},'& [part="source"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="group-empty"]':{margin:"0",padding:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{$description:"One origin of grid-able sources. A connection with no tables says why it has none instead of drawing an empty box — an author who has not pushed a schema yet is exactly the reader who needs the sentence.",tagName:"section",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"h3",attributes:{part:"group-title"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"rows"},$switch:{$ref:"$map/item/state"},cases:{listed:{tagName:"div",attributes:{part:"rows-list",role:"none"},style:{display:"contents"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/id"},map:{tagName:"button",attributes:{part:"source",type:"button","data-source":"${$map.item.id}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.label}"}}]},empty:{tagName:"p",attributes:{part:"group-empty"},textContent:"${$map.item.emptyMessage}"}}}]}}]};E("grid-open",T);function j(e,r,t){let o=g({groups:r,open:t}),i=null,s=!1,c=R("grid-open",o,e).then((y)=>{let a=y.root;if(s)return y.dispose(),a;return i=y,a});return{dispose(){s=!0,i?.dispose(),i=null},ready:c}}function x(){try{return p()}catch{return null}}function FS(){return Q(x()?.dataRows)}async function I(){let e=x();if(!Q(e?.dataConnections))return null;return e.dataConnections()}async function jN(e){let r=x();if(!Q(r?.dataConnectionTest))return{error:"Connection tests are not supported by this backend",ok:!1};try{return await r.dataConnectionTest(e)}catch(t){return{error:t instanceof Error?t.message:String(t),ok:!1}}}async function jT(e){let r=x();if(!Q(r?.dataPush))return{applied:!1,errors:["Schema push is not supported by this backend"],plan:[]};try{return await r.dataPush(e)}catch(t){return{applied:!1,errors:[t instanceof Error?t.message:String(t)],plan:[]}}}function k(e){let t=x()?.[e];if(t===void 0)throw Error(`The ${String(e)} surface is not supported by this backend`);return t}function v(e){return k("dataRows")(e)}function K(e){return k("dataInsertRow")(e)}function M(e){return k("dataUpdateRow")(e)}function O(e){return k("dataDeleteRow")(e)}function HN(e,r,t){let o=(c)=>c.replaceAll(/([a-z0-9])([A-Z])/g,"$1_$2").replaceAll(/[^A-Za-z0-9]+/g,"_").replaceAll(/^_+|_+$/g,"").toUpperCase(),s=[r??e,t.replace(/Env$/,"")].flatMap((c)=>{let y=o(c);return y?[y]:[]}).join("_")||"SECRET";return/^\d/.test(s)?`JX_${s}`:s}var H=["id","sku","slug","Slug"];function L(e){let r=new Set;return e.map((t,o)=>{let i=t.trim()===""?`column${o+1}`:t;if(r.has(i))i=`${i}__${o+1}`;return r.add(i),i})}function J(e,r){for(let t of H){let o=e.indexOf(t);if(o===-1)continue;let i=r.rows.map((s)=>s[o]??"");if(i.every((s)=>s!=="")&&new Set(i).size===i.length)return t}return null}function A(e,r){let t=Fd(e),o=L(t.headers),i=J(o,t),s=i?o.indexOf(i):-1,c=t.rows.map((d,u)=>s===-1?String(u):d[s]),y=new Map(c.map((d,u)=>[d,u])),a=xh(r,C?.projectConfig),l=a?.schema.properties??{},b=t.rows.slice(0,50).map((d)=>{let u={};for(let[S,G]of o.entries())u[G]=d[S]??"";return u}),f=new Map(Vw(b).map((d)=>[d.field,d])),w=new Map(Ww(a?.schema,{idField:i??void 0}).map((d)=>[d.field,d]));return{columns:o.map((d,u)=>{let G=(d in l?w.get(d):void 0)??f.get(d)??{editable:!0,field:d,kind:"string",title:t.headers[u]||d};return{...G,pk:d===i,title:t.headers[u]?.trim()||G.title}}),doc:t,fields:o,keys:c,keyToIndex:y,loadText:e}}function z(e,r){let t={},o=e.doc.rows[r]??[];for(let[i,s]of e.fields.entries()){let c=e.columns[i],y=o[i]??"";t[s]=c.kind==="string"||c.kind==="text"||c.kind==="readonly"?y:Lp(y,c)}return t}function F(e,r){let t=e.doc.rows.map((s)=>[...s]),o=(s)=>e.fields.indexOf(s);for(let s of r.cells){let c=e.keyToIndex.get(s.rowKey),y=o(s.field);if(c===void 0||y===-1)continue;t[c][y]=Qo(s.value)}for(let s of r.inserts){let c=e.fields.map((y)=>Qo(s.cells[y]??null));t.push(c)}let i=r.deletes.map((s)=>e.keyToIndex.get(s.rowKey)).filter((s)=>s!==void 0).toSorted((s,c)=>c-s);for(let s of i)t.splice(s,1);return{...e.doc,rows:t}}function _(e,r){return{cells:e.cells.map((t)=>({field:t.field,rowKey:t.rowKey,...r})),deletes:e.deletes.map((t)=>({rowKey:t.rowKey,...r})),inserts:e.inserts.map((t)=>({error:r.error,ok:r.ok,tempKey:t.tempKey}))}}function jS(e){let r=null,t=(o=!1)=>{if(!o&&r)return r;return r=p().readFile(e).then((i)=>A(i,e)),r};return{backingPaths:()=>new Map([[e,"*"]]),capabilities:{delete:!0,insert:!0,remotePaging:!1,remoteSort:!1},async columns(){return(await t()).columns},async commit(o){let i=await t(),s=p(),c=null;try{c=await s.readFile(e)}catch{c=null}if(c!==i.loadText&&!Ud(e))return _(o,{error:"File changed on disk — refresh to reload",ok:!1,stale:!0});let y=F(i,o),a=WT(y);return Ls(e),await s.writeFile(e,a),r=Promise.resolve(A(a,e)),_(o,{ok:!0})},id:e,label:e.split("/").pop()??e,async refresh(){await t(!0)},async rows(){let o=await t(),i=o.doc.rows.map((s,c)=>({cells:z(o,c),key:o.keys[c]}));return{rows:i,total:i.length}},async serializeForSource(o){let i=await t();return WT(F(i,o))}}}var U=50;function q(e){let r=e.toLowerCase();if(/(int|real|floa|doub|num|dec)/.test(r))return"number";if(r.includes("bool"))return"boolean";if(/(timestamp|datetime|date)/.test(r))return"date";return"string"}function Z(e){return!e.pk&&e.name!=="created_at"&&e.name!=="updated_at"}function W(e){if(e===void 0)return null;if(wf(e))return e;return JSON.stringify(e)}function N(e,r){let t=[],o="id",i=new Map,s=(a)=>{if(a.length>0)t=a,o=a.find((l)=>l.pk)?.name??"id"},c=(a)=>{let l={table:r};if(e)l.connection=e;if(l.limit=a?.limit??U,l.offset=a?.offset??0,a?.orderBy)l.dir=a.dir??"asc",l.orderBy=a.orderBy;return l},y=(a,l)=>{let b=a[o];if(n(b)||Y(b))return i.set(String(b),b),String(b);return`row-${l}`};return{capabilities:{delete:!0,insert:!0,remotePaging:!0,remoteSort:!0},async columns(){if(t.length===0){let a=await v(c({limit:1,offset:0}));s(a.columns)}return t.map((a)=>{let l=Z(a)?q(a.type):"readonly";return{editable:l!=="readonly",field:a.name,kind:l,pk:a.pk===!0,title:a.name,widthHint:a.pk?80:void 0}})},async commit(a){let l={cells:[],deletes:[],inserts:[]},b=new Map;for(let f of a.cells){let w=b.get(f.rowKey)??[];w.push({field:f.field,value:f.value}),b.set(f.rowKey,w)}for(let[f,w]of b){let h=i.get(f),d=(u,S)=>{for(let G of w)l.cells.push({error:S,field:G.field,ok:u,rowKey:f})};if(h===void 0){d(!1,"Row has no primary key — refresh the grid");continue}try{let u={};for(let G of w)u[G.field]=G.value;let S={pk:h,set:u,table:r};if(e)S.connection=e;await M(S),d(!0)}catch(u){d(!1,u instanceof Error?u.message:String(u))}}for(let f of a.inserts)try{let w={};for(let[G,P]of Object.entries(f.cells))if(P!==null)w[G]=P;let h={table:r,values:w};if(e)h.connection=e;let{row:d}=await K(h),u=d[o],S;if(n(u)||Y(u))S=String(u),i.set(S,u);l.inserts.push({newKey:S,ok:!0,tempKey:f.tempKey})}catch(w){l.inserts.push({error:w instanceof Error?w.message:String(w),ok:!1,tempKey:f.tempKey})}for(let f of a.deletes){let w=i.get(f.rowKey);if(w===void 0){l.deletes.push({error:"Row has no primary key — refresh the grid",ok:!1,rowKey:f.rowKey});continue}try{let h={pk:w,table:r};if(e)h.connection=e;await O(h),l.deletes.push({ok:!0,rowKey:f.rowKey})}catch(h){l.deletes.push({error:h instanceof Error?h.message:String(h),ok:!1,rowKey:f.rowKey})}}return l},id:ss({connection:e??"default",kind:"data",table:r}),label:r,async refresh(){t=[],i.clear()},async rows(a){let l=await v(c(a));return s(l.columns),{rows:l.rows.map((f,w)=>{let h=y(f,w),d={};for(let u of t)d[u.name]=W(f[u.name]);return{cells:d,key:h}}),total:l.total}}}}async function HT(e,r={}){let t=m.tabs.get(e);if(t)return Ft(e,{focus:r.focus!==!1}),t;try{await jt()}catch{}let o=jS(e),i=Si({capabilities:{modes:["grid","source"]},document:structuredClone(Nb),documentPath:e,id:e,sourceFormat:fn(e)?.name??null,...r.paneId!==void 0&&{paneId:r.paneId},...r.preview===!0&&{preview:!0},...r.focus===!1&&{focus:!1}});return $p(i,o).load(),i}function D(e){let r=Si({capabilities:{modes:["grid"]},document:structuredClone(Nb),documentPath:null,id:e.id});return $p(r,e).load(),r}function BN(e){let r=ss({kind:"collection",name:e}),t=m.tabs.get(r);if(t)return Ft(r),t;return D(UT(e))}function HS(){let e=ss({kind:"pages"}),r=m.tabs.get(e);if(r)return Ft(e),r;return D(qT())}function V(e,r){let t=ss({connection:e??"default",kind:"data",table:r}),o=m.tabs.get(t);if(o)return Ft(t),o;return D(N(e,r))}function X(e){let r=Yl(e);if(r?.kind==="pages")HS();else if(r?.kind==="collection")BN(r.name);else if(r?.kind==="data")V(r.connection,r.table)}function ee(e,r){return[{emptyMessage:"",key:"project",rows:[{id:ss({kind:"pages"}),label:"Pages"},...e.map(({name:t})=>({id:ss({kind:"collection",name:t}),label:`Collection: ${t}`}))],state:"listed",title:"Project"},...r.map((t)=>({emptyMessage:"No tables — push a schema first.",key:`data:${t.name}`,rows:t.tables.map((o)=>({id:ss({connection:t.name,kind:"data",table:o}),label:o})),state:t.tables.length===0?"empty":"listed",title:`Data · ${t.name}`}))]}async function BT(){let e=BS(),r=[];if(FS())r=(await I().catch(()=>null))?.connections??[];let t=null,o=Zs({cancelLabel:"Cancel",confirmLabel:"",headline:"Open Grid",island:(i)=>{t=j(i,ee(e,r),(s)=>{o.close(),X(s)})},layer:dt("dialog"),onCancel:()=>o.close(),onClosed:()=>{t?.dispose(),t=null},onConfirm:()=>{},region:"grid/open"});o.ready}function te(){return[{args:Se({name:Fe("The content collection's name, as project.json declares it.")}),category:"Project",id:"collection.editInGrid",level:"project",menus:["context/file","palette"],group:"5_data",requires:"a project that declares content collections",when:(e)=>e.project.open,run:(e,r)=>{let t=St("collection.editInGrid",r,"name"),o=BS().map((i)=>i.name);if(!o.includes(t))throw RangeError(`command "collection.editInGrid" argument "name": "${t}" is not a content `+"collection this project declares — it declares: "+`${o.length>0?o.join(", "):"none"}`);BN(t)},title:"Edit Collection in Grid"},{args:{additionalProperties:!1,properties:{connection:Fe('The connection name from project.json. Defaults to "default".'),table:Fe("The table to open.")},required:["table"],type:"object"},category:"Project",id:"data.openGrid",level:"project",menus:["palette"],group:"5_data",requires:"a platform that serves the data routes",when:(e)=>e.project.open,enablement:(e)=>e.capability.dataRows,run:(e,r)=>{let t=St("data.openGrid",r,"table");V(ti("data.openGrid",r,"connection"),t)},title:"Open Data Grid"}]}function zT(e){e.registerAll(te())}
2
- export{FS,jN,jT,HN,jS,HT,BN,HS,BT,zT};
3
-
4
- //# debugId=67AF438E9428C4A664756E2164756E21
5
- //# sourceMappingURL=studio-2zz4qbv9.js.map
@@ -1,5 +0,0 @@
1
- import{X}from"./studio-9c6cbq2c.js";import{p,ye}from"./studio-4fnb5648.js";import{Lh,w}from"./studio-sce30r7b.js";import{mi}from"./studio-nvcn2ykc.js";import{ea,Zd,m,bl,wI}from"./studio-knsjyx7n.js";import{qd,La,lv}from"./studio-4zd6an2b.js";import{Ox,fl,Vm}from"./studio-61rg2cz5.js";import{YI,w1,b0,v0,ZI,ad,x1,vf,Uv,y0,w0,Fh,qv,hg,_1,XI,u2,h2,p2,QI,f2,eR,x0,m2,g2,b2}from"./studio-1410q5dw.js";import{C}from"./studio-4f7thq0p.js";import{Ln}from"./studio-9dq7rwc7.js";import{me,te,g,le}from"./studio-3qr08sxq.js";import{Y}from"./studio-k3we3kqb.js";import{ce}from"./studio-0939t1q1.js";var ls="image",D=[320,640,960,1280,1920],A=null,H=null;function B(){return A??=(ce("x7t8jbjn"),import("./image-editor-x7t8jbjn.js")),A}function W(){return H??=(ce("4afr4y6a"),import("./image-bake-4afr4y6a.js")),H}var E=new WeakMap;function x(t){return E.get(le(t))}function _(t){let e=le(t),r=E.get(e);if(!r){r=g({decoded:!1,generation:0,history:x0(),live:null,message:"Reading the image…",saving:!1,size:null,source:null,status:"loading",typed:!1}),E.set(e,r);let i=F(r);Zd(e,i),Zd(t,i)}return r}function F(t){return{canRedo:()=>!t.saving&&t.history.future.length>0,canUndo:()=>!t.saving&&t.history.past.length>0,redo:()=>{if(!t.saving)t.history=b2(t.history)},undo:()=>{if(!t.saving)t.history=g2(t.history)}}}function h(t){return t.live??t.history.present}function M(t,e,r){let i=t.source;if(t.source={bytes:e,url:URL.createObjectURL(new Blob([e],{type:r}))},t.status="ready",t.message="",i!==null)URL.revokeObjectURL(i.url)}function U(t){if(t.source!==null)URL.revokeObjectURL(t.source.url),t.source=null,t.status="loading"}async function R(t,e){if(t.source!==null)return;t.generation+=1;let{generation:r}=t;t.status="loading",t.message="Reading the image…";let i=ye()?p():null,u=i?.readFileBytes;if(u===void 0){t.status="refused",t.message="This backend cannot hand Studio a file's raw bytes, so it cannot edit one.";return}let o;try{o=new Uint8Array(await u.call(i,e))}catch(a){if(t.generation===r)t.status="refused",t.message=`Could not read ${e}: ${a instanceof Error?a.message:String(a)}`;return}if(t.generation!==r)return;let n=v0(e,o);if(n!==null){t.status="refused",t.message=n;return}t.size??=YI(o).size,M(t,o,w1(e)??"")}function al(t){let e=x(t),r=e?.size;if(e===void 0||r===null||r===void 0)return!1;return e.typed||!x1(h(e),r)}function P(t,e){t.live=null,t.history=m2(t.history,e)}var v=new Map;function LL(t,e){let r=v.get(t);return r!==void 0&&le(r.tab)===le(e)&&r.wrap.isConnected&&(r.surface===null||r.surface.attached())}function Xw(t){let e=v.get(t);if(!e)return;e.disposed=!0,e.scope.stop(),e.surface?.dispose(),v.delete(t);let r=x(e.tab);if(e.drag!==null&&r!==void 0)r.live=null;if(r!==void 0&&S(e.tab).length===0)r.typed=!1;if(S(e.tab).length===0&&r!==void 0&&!r.saving)U(r),r.generation+=1}function j(t){if(t.rows.length===0||t.rows.find((e)=>e.tabindex==="0")?.id!==t.active)t.rows=hg.map((e)=>({id:e,label:_1[e],tabindex:e===t.active?"0":"-1"}));return t.rows}function y(t){return`${Number(t.toFixed(4))}%`}function O(){let e=C?.projectConfig?.images?.widths;return Array.isArray(e)&&e.length>0&&e.every((r)=>Y(r))?e:D}var q=ZI.map(({id:t,label:e})=>({label:e,value:t}));function b(t,e){let r=t.tab.documentPath??"",i=r.split("/").pop()??r,u=h(e),o=e.size??{height:1,width:1},n=Fh(u.turns,o),a=qv(ad(u,o),u,o),l=Uv(u,o),c=y0(u,o),s=eR(u,o,O()),f=w1(r)??"",d=e.source!==null&&e.decoded&&e.size!==null,I=d&&(e.typed||!x1(u,o)),T=vf(u.turns);return{alt:`${i}, being edited`,aspect:u.aspect,aspectOptions:q,brightness:String(u.brightness),busy:e.saving||!d,undecoded:!d,cannotFit:e.saving||!d||s===null||s===c.width,cannotRedo:e.saving||e.history.future.length===0,cannotSave:e.saving||!I||ea(t.tab),cannotUndo:e.saving||e.history.past.length===0,clean:e.saving||!I,contrast:String(u.contrast),cropH:y(a.height/n.height*100),cropW:y(a.width/n.width*100),cropX:y(a.x/n.width*100),cropY:y(a.y/n.height*100),facts:d?`Output ${c.width} × ${c.height} · crop ${l.width} × ${l.height} · source ${o.width} × ${o.height}`:"",filter:w0(u)||"none",fitHint:s===null?"Already no wider than the largest width the build derives.":"The largest of the project's image widths (images.widths, or the build's defaults) below this crop.",fitLabel:s===null?"Fit for web":`Fit for web (${s} px)`,handleHelpId:`${Ln(t.paneId,"image")}/handle-help`,handles:j(t),imageHeight:T?y(o.height/n.height*100):"100%",imageTransform:`translate(-50%, -50%) scale(${u.flipH?-1:1}, ${u.flipV?-1:1}) rotate(${u.turns*90}deg)`,imageWidth:T?y(o.width/n.width*100):"100%",maxOutputWidth:String(l.width),maxWidth:`${n.width}px`,message:e.message,moveCursor:u.crop===null?"default":"move",name:i,quality:b0(f)?"shown":"hidden",qualityValue:String(u.quality),ratio:String(n.width/n.height),region:Ln(t.paneId,"image"),saturation:String(u.saturation),saving:e.saving,src:e.source?.url??"",status:e.status,warning:`Save overwrites ${r} and keeps no backup. Source control is how to get the original back.`,width:String(c.width)}}function N(t,e,r){let i=qv(ad(e,r),e,r);Lh(`${_1[t]}: crop ${i.width} × ${i.height} at ${i.x}, ${i.y}`)}function z(t){return hg.some((e)=>e===t)}function V(t,e){let r=()=>e.source===null||!e.decoded?null:e.size,i=()=>t.surface?.syncFields(b(t,e)),u=F(e),o=(n)=>{let a=r();if(a!==null&&!e.saving)P(e,n(h(e),a))};return{cycleHandle:(n,a)=>{if(!z(n))return;let l=hg.indexOf(n),c=a<0?-1:1,s=hg[(l+c+hg.length)%hg.length];t.active=s,t.surface?.update(b(t,e)),t.surface?.focusHandle(s),Lh(_1[s])},fieldEdited:()=>{e.typed=!0},fitForWeb:()=>{o((n,a)=>{let l=eR(n,a,O());return l===null?n:QI(n,a,l)})},flip:(n)=>{o((a)=>p2(a,n==="v"?"v":"h"))},handleDown:(n,a,l,c,s)=>{let f=r(),d=t.surface?.frameRect();if(f===null||!z(n)||!d||d.width<=0||e.saving)return;s.setPointerCapture(a),t.active=n,t.drag={handle:n,pointerId:a,scale:Fh(h(e).turns,f).width/d.width,start:h(e),startX:l,startY:c}},handleFocused:(n)=>{if(z(n)&&t.active!==n)t.active=n,t.surface?.update(b(t,e))},handleMove:(n,a,l)=>{let{drag:c}=t,s=r();if(c===null||c.pointerId!==n||s===null||e.saving)return;e.live=XI(c.start,s,c.handle,(a-c.startX)*c.scale,(l-c.startY)*c.scale)},handleUp:(n)=>{let{drag:a}=t;if(a===null||a.pointerId!==n)return;if(t.drag=null,e.live!==null)P(e,e.live)},imageFailed:(n)=>{if(e.source?.url!==n)return;U(e),e.status="refused",e.message=`${t.tab.documentPath??"This file"} could not be decoded, so it cannot be edited.`},imageLoaded:(n,a)=>{if(e.source===null||!(n>0&&a>0))return;if(e.decoded=!0,e.size?.width!==n||e.size.height!==a)e.size={height:a,width:n};fl(t.tab.documentPath??"",n,a)},nudge:(n,a,l,c)=>{let s=r();if(s===null||!z(n)||e.saving)return;let f=c?10:1,d=XI(h(e),s,n,a*f,l*f);P(e,d),N(n,d,s)},redo:()=>{u.redo(t.tab)},reset:()=>{o(()=>x0().present)},rotate:(n)=>{o((a)=>h2(a,n<0?-1:1))},save:()=>{$L(t.tab)},setAspect:(n)=>{let a=ZI.find((l)=>l.id===n);if(a)o((l,c)=>u2(l,c,a.id))},setValue:(n,a)=>{if(a.trim()!==""&&(n==="brightness"||n==="contrast"||n==="saturation"||n==="quality"))o((l)=>f2(l,n,Number(a)));e.typed=!1,i()},setWidth:(n)=>{o((a,l)=>QI(a,l,n.trim()===""?null:Number(n))),e.typed=!1,i()},undo:()=>{u.undo(t.tab)}}}function iA(t,e){let{paneId:r,wrap:i}=t;if(LL(r,e))return;Xw(r);let u=_(e),o={active:"nw",disposed:!1,drag:null,paneId:r,rows:[],scope:me(),surface:null,tab:e,wrap:i};v.set(r,o),R(u,e.documentPath??""),B().then(({mountImageEditorSurface:n})=>{if(o.disposed)return;o.surface=n(i,b(o,u),V(o,u)),o.scope.run(()=>{te(()=>{if(!o.disposed)o.surface?.update(b(o,u))})})})}async function Q(t,e){if(t.source===null)await R(t,e);if(t.source===null&&t.status==="loading")await R(t,e);return t.source}function S(t){let e=le(t);return[...v.values()].filter((r)=>le(r.tab)===e)}async function $L(t){let e=t.documentPath??"",r=e.split("/").pop()??e;if(ea(t))return w.warn(`You have read access to this session — the edit to ${r} stays in your browser and cannot be saved.`,{key:`image.readOnly:${e}`,path:e,source:"Collaboration"}),!1;let i=x(t);if(i===void 0||i.saving)return i===void 0;for(let u of S(t))u.surface?.flushFields(),u.drag=null;if(i.typed=!1,i.live!==null)P(i,i.live);i.saving=!0;try{let{size:u}=i,o=h(i);if(u===null||x1(o,u))return w.info(`${r} has no changes, so nothing was written.`,{key:`image.identity:${e}`}),!0;let n=(k)=>(w.error(`Could not save ${r}.`,{detail:k,path:e,source:"Image"}),!1),a=await Q(i,e);if(a===null)return n(i.message);let l=w1(e)??"",{bakeImage:c}=await W(),s;try{s=await c(o,a.bytes,l)}catch(k){return n(`The browser could not process this image: ${X(k)}`)}if(!s.ok)return n(s.reason);if(!bl(t))return!1;if(t.documentPath!==e)return n("It was renamed while saving, so the edit was not written to its old name.");let{blob:f}=s,d=Vm(a.bytes.byteLength),I=f.size>a.bytes.byteLength?", so the file grew":"";if(!await Ox(e,new File([f],r,{type:l}),{note:`${s.size.width} × ${s.size.height}, ${Vm(f.size)} (was ${d}${I})`}))return!1;return M(i,new Uint8Array(await f.arrayBuffer()),l),i.size=s.size,i.decoded=!0,fl(e,s.size.width,s.size.height),i.live=null,i.history=x0(),!0}finally{if(i.saving=!1,S(t).length===0)U(i),i.generation+=1}}function oA(t){let e=m.tabs.get(t);if(!e||!al(e))return!0;let r=t.split("/").pop()??t;return w.warn(`${r} has an unsaved edit. Save or discard it before replacing the file.`,{key:`image.replaceDirty:${t}`,path:t,source:"Image"}),!1}function Qw(t){let e=m.tabs.get(t),r=e&&x(e);if(!e||r===void 0||r.saving||al(e))return;if(U(r),r.generation+=1,r.size=null,r.decoded=!1,r.live=null,r.history=x0(),S(e).length>0)R(r,t)}wI(al);var G={message:"no media file to look for",status:"failed"};function L(t){let e=mi(t);return e===""?null:{path:e}}function ex(t){let e=L(t);return e===null?null:qd(e)}async function Xu(t){let e=L(t);return e===null?G:La(e)}function rA(t){if(t===null)return"Counting references…";switch(t.status){case"unsupported":return null;case"pending":return"Counting references…";case"failed":return"Usage unknown";default:return lv(t.result)}}
2
- export{ls,al,LL,Xw,iA,$L,oA,Qw,ex,Xu,rA};
3
-
4
- //# debugId=4EBD0C6B7B176E4464756E2164756E21
5
- //# sourceMappingURL=studio-3pz4t5a2.js.map
@@ -1,5 +0,0 @@
1
- import{n,Y,Ze,Q,_,v,Pe,Go,Jn,xf,it}from"./studio-k3we3kqb.js";var Lv=400;var tf=350,d1=300,MM=30000;function rr(e){return Array.isArray(e?.children)?e.children:[]}function $v(e,t,i=""){if(!_(e))return e;if(Array.isArray(e)){for(let[l,s]of e.entries())$v(s,t,`${i}/${l}`);return e}let r=e,{children:o}=r;if(Go(o)){let l=o;t?.(i,l),r.children=[l]}if(Array.isArray(r.children))for(let[l,s]of r.children.entries())$v(s,t,`${i}/children/${l}`);if(r.$prototype==="Array"&&_(r.map))$v(r.map,t,`${i}/map`);if(_(r.cases))for(let[l,s]of Object.entries(r.cases))$v(s,t,`${i}/cases/${LI(l)}`);return e}function LI(e){return String(e).replaceAll("~","~0").replaceAll("/","~1")}function Vt(e){return e.length>=2?e.slice(0,-2):null}function zi(e){return e.at(-1)}function $I(e){return e.join("/")}function Cr(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;return e.every((i,r)=>i===t[r])}function kh(e,t=[],i=0){let r=[];return u(e,t,i,r,!1),r}function u(e,t,i,r,o){if(n(e)||Y(e)||Ze(e)){if(!o)r.push({depth:i,node:e,nodeType:"text",path:t});return}if(e.$prototype==="Array"){if(!o)r.push({depth:i,node:e,nodeType:"map",path:t});let s=e.map;if(_(s))u(s,[...t,"map"],i+1,r,!1);return}if(!o)r.push({depth:i,node:e,nodeType:"element",path:t});if(e.$props&&it(e.tagName).includes("-")&&!Array.isArray(e.children))return;let{children:l}=e;if(Array.isArray(l))for(let s=0;s<l.length;s++){let a=[...t,"children",s];u(l[s],a,i+1,r,!1)}else if(Go(l))u(l,[...t,"children"],i+1,r,!1);if(e.$switch&&_(e.cases))for(let[s,a]of Object.entries(e.cases)){let p=[...t,"cases",s];if(_(a)&&a.$ref)r.push({depth:i+1,node:a,nodeType:"case-ref",path:p});else if(_(a))r.push({depth:i+1,node:a,nodeType:"case",path:p}),u(a,p,i+2,r,!0)}}function kr(e){if(!e)return"?";if(e.$prototype==="Array"){let{items:r}=e;return`Repeater → ${(Pe(r)?r.$ref:void 0)||"items"}`}if(e.$title)return e.$title;if(e.$id)return e.$id;if(e.tagName==="slot"){let r=e.attributes?.name;return n(r)&&r.trim()?`slot: ${r.trim()}`:"slot"}let t=it(e.tagName)||"div",i=e.$switch?" ⇆":"";if(n(e.textContent)&&e.textContent.length>0)return`${t} — ${e.textContent.slice(0,24)}${i}`;return t+i}var C=null;function id(e){C=e}function _n(){return C}function Eh(e){return _(e)}function nf(e){if(Array.isArray(e))return e.map((i)=>nf(i));if(!Jn(e))return e;let t={};for(let[i,r]of Object.entries(e)){if(i.startsWith("on")&&xf(r))continue;if(i==="children")t.children=Array.isArray(r)?r.map((o)=>nf(o)):nf(r);else if(i==="cases"&&Eh(r)){let o={};for(let[l,s]of Object.entries(r))o[l]=nf(s);t.cases=o}else if(i==="state"&&Eh(r)){let o={};for(let[l,s]of Object.entries(r)){if(v(s)&&s.timing==="server")continue;o[l]=s}t.state=o}else t[i]=r}return t}var u1=null,Th=null,II=null,RI=null,DI=null;function c(e){let t=document.querySelector(`#${e}`);return t instanceof HTMLElement?t:null}function PM(){u1=c("activity-bar"),Th=c("left-panel"),II=c("right-panel"),RI=c("toolbar"),DI=c("statusbar")}function of(e,t){if(!e)throw TypeError(`#${t} is not in the shell yet; initShellRefs() has not found it`);return e}var ig=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),NI=[":hover",":focus",":active",":focus-within",":focus-visible",":disabled",":first-child",":last-child","::before","::after","::placeholder"];function s0(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}var f=new Map;function a0(e,t,i){let r=t??Lv;return(...o)=>{clearTimeout(f.get(e)),f.set(e,setTimeout(()=>{f.delete(e),i(...o)},r))}}function FM(e){clearTimeout(f.get(e)),f.delete(e)}var x=new Map;function y(e){return(_(e)||Q(e))&&"then"in e&&Q(e.then)}var d=0;function jM(){return d}function m(e,t){d+=1;let i=()=>{d-=1},r=null;try{let o=t();if(y(o))r=o}catch(o){console.error(`Renderer "${e}" failed:`,o)}if(!r){i();return}r.then(i,(o)=>{console.error(`Renderer "${e}" failed:`,o),i()})}function og(e,t){x.set(e,t)}function sr(){for(let[e,t]of x.entries())m(e,t)}function wn(...e){for(let t of e){let i=x.get(t);if(!i)continue;m(t,i)}}function vl(e,t){if(e){if(t.selection!==void 0)e.session.selection=t.selection;if(t.hover!==void 0)e.session.hover=t.hover;if(t.clipboard!==void 0)e.session.clipboard=t.clipboard;if(t.ui)Object.assign(e.session.ui,t.ui);if(t.canvas)Object.assign(e.session.canvas,t.canvas)}}function Na(e,t,i){if(e)e.session.ui[t]=i}function HM(e,t){if(e)Object.assign(e.session.canvas,t)}
2
- export{Lv,tf,d1,MM,rr,$v,LI,Vt,zi,$I,Cr,kh,kr,C,id,_n,Eh,nf,u1,Th,II,RI,DI,PM,of,ig,NI,s0,a0,FM,jM,og,sr,wn,vl,Na,HM};
3
-
4
- //# debugId=C365A06DD248F72464756E2164756E21
5
- //# sourceMappingURL=studio-4f7thq0p.js.map
@@ -1,5 +0,0 @@
1
- import{X}from"./studio-9c6cbq2c.js";import{p,ye}from"./studio-4fnb5648.js";import{w}from"./studio-sce30r7b.js";import{us}from"./studio-4zd6an2b.js";import{fI,Yx,xv,h}from"./studio-knsjyx7n.js";import{v1,mi,zv}from"./studio-nvcn2ykc.js";import{$s,Kd,HO,BO,zO}from"./studio-hh394phe.js";import{Ls}from"./studio-bnc50f9h.js";import{oa,tR,nR,ra,At}from"./studio-1ks5d9y4.js";import{GC,rI,mh}from"./studio-acer0g8w.js";import{C}from"./studio-4f7thq0p.js";import{Y}from"./studio-k3we3kqb.js";var UC="__other__";function ds(t){return t.trim().toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d-]/g,"")}function q$(t){let e=t.lastIndexOf(".");return e>0?t.slice(e):""}function G$(t,e,n){let r=t.trim();if(n===void 0||e==="__other__")return r;if(n.kind==="fixed"){let i=ds(r);return i===""?"":`${i}${n.ext}`}return r.toLowerCase().endsWith(e.toLowerCase())?r:`${r}${e}`}function iv(t,e,n){let{choice:r,dir:i,known:o=new Set,rows:s=null,taken:a}=n,l=t.trim();if(!l)return r?.kind==="fixed"?"Enter a name.":"Enter a file name.";if(r?.kind==="fixed"&&ds(l)==="")return"Enter at least one letter or number.";let d=l.replaceAll("\\","/");if(d.startsWith("/")||d.endsWith("/"))return"Enter a name, not a path that starts or ends with a slash.";if(d.split("/").includes(".."))return"A name cannot step outside the destination folder.";if(d.includes("/")&&r!==void 0&&e!=="__other__")return`Pick Other… to create a file in a subfolder of ${i==="."?"the project root":i}.`;let u=q$(d);if(e!==""&&e!=="__other__"&&u!==""&&u.toLowerCase()!==e.toLowerCase()&&o.has(u.toLowerCase()))return`You picked ${s?.find((v)=>v.value===e)?.label??e}; this name ends in ${u}.`;if(r?.kind==="locked"&&e==="__other__"){if(u!==""&&u.toLowerCase()!==r.ext.toLowerCase()&&o.has(u.toLowerCase()))return r.because}let m=G$(t,e,r);return a.has(m.toLowerCase())?`${m} already exists in ${i}/.`:""}function Wm(t,e,n){let r=e.trim();if(r==="")return"Enter a file name.";if(/[/\\]/.test(r))return"Enter a name, not a path. A rename keeps the file in its folder.";let i=(t.split("/").pop()??t).toLowerCase();if(r.startsWith(".")&&!i.startsWith("."))return"A name cannot start with a dot: hidden files are not listed, so the file could disappear.";let o=r.toLowerCase();if(o!==i&&[...n].some((s)=>s.toLowerCase()===o))return`${r} already exists in this folder.`;return""}function x(t){let e=["B","KB","MB","GB"],n=t,r=0;while(n>=1024&&r<e.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${e[r]}`}var R=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function Jc(){return(ye()?p().assetCapabilities?.accept:void 0)??R}function zd(t){return ra.has(At(t))}function Wd(t){let e=t.type??"";if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";let n=At(t.name);if(oa.has(n))return"image";if(tR.has(n))return"video";if(nR.has(n))return"audio";return"file"}var K$=new Set([".woff",".woff2",".ttf",".otf"]);function IO(t){if(K$.has(At(t)))return"font";let e=Wd({name:t});return e==="file"?"document":e}var k=/^content\/([^/]+)\//,Ta="public/media";function J$(t){let e=t?k.exec(t.replaceAll("\\","/")):null;return e?`content/${e[1]}/images`:Ta}function RO(t){let e=t.replaceAll("\\","/");return e===Ta||/^content\/[^/]+\/images$/.test(e)}function T(t){let e=t.replaceAll("\\","/");if(e.startsWith("public/"))return e.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(e);if(n)return`./${n[1]}`;return`./${e}`}function P(t,e){let n=new Set([...e].map((o)=>o.toLowerCase()));if(!n.has(t.toLowerCase()))return t;let r=At(t),i=r?t.slice(0,-r.length):t;for(let o=1;;o++){let s=`${i}-${o}${r}`;if(!n.has(s.toLowerCase()))return s}}function Y$(t,e){let n=t.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?e:`${n}/${e}`}var y=null;function DO(t){y=t}async function Nx(t,e){await(e===void 0?y?.(t):y?.(t,e))}function M(t){let e=t.replaceAll("\\","/"),n=e.lastIndexOf("/");return n>0?e.slice(0,n):"."}function I(t,e){let n=(o)=>e==="image"?oa.has(At(o.name)):zd(o.name),r=[],i=[];for(let o of t)if(n(o))r.push(o);else i.push(o.name);if(i.length>0)w.warn(i.length===1?`Skipped ${i[0]}`:`Skipped ${i.length} files`,{detail:e==="image"?`Only images can be used here: ${i.join(", ")}.`:`Studio lists images, video, audio, PDFs and fonts as media, so ${i.join(", ")} would not appear in it.`,source:"Media"});return r}async function Ys(t,e={}){let n=e.only===void 0?[...t]:I([...t],e.only);if(n.length===0)return[];let r=p(),i=e.dir??J$(h.value?.documentPath??null),o=e.source??"Media",s;try{let d=await $s(()=>r.listDirectory(i));s=new Set(d.map((u)=>u.name))}catch(d){if(e.dirExists===!0)return w.error(`Could not write to ${i}/.`,{detail:`The folder could not be read to choose a name that overwrites nothing: ${X(d)}`,path:i,source:o}),[];s=new Set}let a=ye()?p().assetCapabilities?.maxUploadBytes:void 0,l=[];for(let d of n){if(a!==void 0&&d.size>a){w.error(`${d.name} is too large.`,{detail:`This backend accepts at most ${x(a)}; that file is ${x(d.size)}.`,source:"Media"});continue}let u=P(d.name,s);s.add(u);let m=Y$(i,u);try{let{path:f}=await(e.write?e.write(m):r.uploadFile(m,d));Kd([f]),l.push({kind:Wd(d),name:u,path:f,ref:T(f)})}catch(f){w.error(`Could not upload ${d.name}.`,{detail:X(f),path:m,source:o})}}if(l.length>0){if(e.quiet!==!0)w.success(l.length===1?`Uploaded ${l[0].name} to ${i}/`:`Uploaded ${l.length} files to ${i}/`);await y?.(i)}return l}function L(t){try{let e=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t);return e.startsWith("\uFEFF")?null:e}catch{return null}}function D(t){let e=t.slice(0,t.length-At(t).length);return`${e.replace(/-copy(?:-\d+)?$/,"")}-copy${t.slice(e.length)}`}async function Ax(t,e={}){let n=t.split("/").pop()??t,r=e.source??"Media",i;try{let a=p();if(a.readFileBytes===void 0)throw Error("This backend cannot read a file's raw bytes.");i=await a.readFileBytes(t)}catch(a){return w.error(`Could not duplicate ${n}.`,{detail:X(a),path:t,source:r}),null}let o=e.document===!0?L(i):null,[s]=await Ys([new File([i],D(n))],{dir:M(t),dirExists:!0,quiet:!0,source:r,...o!==null&&{write:async(a)=>(await p().writeFile(a,o),{path:a})}});if(!s)return null;if(s.path===t)return w.warn(`${n} was not duplicated.`,{detail:"The backend keeps identical files once, so it made no second file.",path:t,source:r}),null;return w.success(`Duplicated ${n} as ${s.name}`),s}var z=[new Set([".jpg",".jpeg"]),new Set([".tif",".tiff"])];function A(t){return z.find((e)=>e.has(t))??new Set([t])}function NO(t){return[...A(At(t))].join(",")}function N(t,e){return A(At(t)).has(At(e.name))}function AO(t,e,n){let r=Wm(t,e,n);if(r!=="")return r;if(!N(t,{name:e.trim()}))return`Keep the ${At(t)} extension. A rename does not convert the file, so another extension would break it on every page.`;return""}async function Ox(t,e,n={}){let r=t.split("/").pop()??t;if(!N(t,e))return w.error(`${e.name} cannot replace ${r}.`,{detail:`${r} is ${At(t)||"a file with no extension"} and ${e.name} is ${At(e.name)||"a file with no extension"}. Every page that uses ${r} would get bytes its address does not describe; choose a file of the same type, or upload it as a new file.`,path:t,source:"Media"}),!1;let i=ye()?p().assetCapabilities?.maxUploadBytes:void 0;if(i!==void 0&&e.size>i)return w.error(`${e.name} is too large.`,{detail:`This backend accepts at most ${x(i)}; that file is ${x(e.size)}.`,source:"Media"}),!1;Ls(t);let o;try{({path:o}=await p().uploadFile(t,e))}catch(s){return w.error(`Could not replace ${r}.`,{detail:X(s),path:t,source:"Media"}),!1}if(Kd([t,o]),o===t)BO(t);if(us(),await(o===t?Nx(M(t),t):Nx(M(t))),o!==t)return w.warn(`${r} was not replaced.`,{detail:`The backend stored the new file as ${o}, so every reference still shows the old one.`,path:t,source:"Media",tier:"problem"}),!1;return w.success(n.note===void 0?`Replaced ${r}`:`Replaced ${r}: ${n.note}`),!0}function Mx(t){let e=mi(t),n=e.lastIndexOf("/");return n===-1?e:e.slice(n+1)}function ov(t){let e=mi(t),n=e.lastIndexOf("/");return n===-1?".":e.slice(0,n)}function B(){return C?.projectConfig?.content??null}function _(t){return xv(t,B(),rI())}function U(t,e){return`${mi(e.urlPrefix)}/${t.slice(e.dir.length+1)}`}function rv(t){let e=mi(t);if(e.startsWith(`${v1}/`))return`/${e.slice(v1.length+1)}`;let n=_(e);return n?`/${U(e,n)}`:`/${e}`}function nr(t){let e=mi(t);if(e==="")return t;let{space:n,fileBaseUrl:r}=mh(),i=zO(e);if(n==="repo")return Yx(fI(`${r}${zv(e)}`,HO(e)),i);let o=zv(rv(e).slice(1));return Yx(GC(`/${o}`),i)}var c=new Map,E=new Map,g=new Map,b=new Set;function S(t){return At(t)===".svg"}function F(t){let e=t===null?null:/^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/.exec(t),n=e?Number(e[1]):Number.NaN;return n>0?n:null}function j(t){let e=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;if(e.localName!=="svg")return null;let n=F(e.getAttribute("width")),r=F(e.getAttribute("height")),i=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number),o=i[2]??Number.NaN,s=i[3]??Number.NaN,a=i.length===4&&o>0&&s>0,l=null;if(n!==null&&r!==null)l={height:r,width:n};else if(a&&n!==null)l={height:n*s/o,width:n};else if(a&&r!==null)l={height:r,width:r*o/s};else if(a)l={height:s,width:o};return l&&{height:Math.round(l.height),width:Math.round(l.width)}}async function K(t){b.add(t);try{let e=j(await p().readFile(t));if(e&&e.width>0&&e.height>0)g.set(t,e)}catch{}}function Vd(t){let e=mi(t);return c.has(e)&&(!S(e)||b.has(e))}function O(t,e){let n=Mx(t),r=g.get(t);return{bytes:Y(e?.size)?e.size:null,ext:At(n),height:r?.height??null,kind:Wd({name:n}),modified:e?.modified??null,name:n,path:t,width:r?.width??null}}function Yc(t){return c.get(mi(t))??null}function OO(t){for(let e of t){if(e.type!=="file")continue;let n=mi(e.path);if(!c.has(n))c.set(n,O(n,e))}}async function hh(t){let e=mi(t),n=c.get(e);if(n&&Vd(e))return n;let r=E.get(e);if(r)return r;let i=(async()=>{if(S(e)&&!b.has(e))await K(e);if(n){let a=g.get(e);return{...n,height:a?.height??null,width:a?.width??null}}let s;try{s=(await $s(()=>p().listDirectory(ov(e)))).find((l)=>mi(l.path)===e)}catch{s=void 0}return O(e,s)})();E.set(e,i);let o=await i;return E.delete(e),c.set(e,o),o}function fl(t,e,n){if(!(e>0&&n>0))return!1;let r=mi(t);if(S(r))return!1;let i=g.get(r);if(i&&i.width===e&&i.height===n)return!1;g.set(r,{height:n,width:e});let o=c.get(r);if(o)c.set(r,{...o,height:n,width:e});return!0}function MO(){c.clear(),g.clear(),b.clear()}function Vm(t){if(t<1024)return`${t} B`;if(t<1048576)return`${Math.round(t/1024)} KB`;return`${(t/1048576).toFixed(1)} MB`}function Px(t){if(!t)return"";let e=[];if(t.width!==null&&t.height!==null)e.push(`${t.width} × ${t.height}`);if(t.bytes!==null)e.push(Vm(t.bytes));return e.join(" · ")}
2
- export{UC,ds,q$,G$,iv,Wm,Jc,zd,Wd,K$,IO,Ta,J$,RO,Y$,DO,Nx,Ys,Ax,NO,AO,Ox,Mx,ov,rv,nr,Vd,Yc,OO,hh,fl,MO,Vm,Px};
3
-
4
- //# debugId=44F9FA380FD26FC664756E2164756E21
5
- //# sourceMappingURL=studio-61rg2cz5.js.map
@@ -1,5 +0,0 @@
1
- import{vL,yL,wL}from"./studio-k2evngrj.js";import{p,ye}from"./studio-4fnb5648.js";import{hb,OE,ME}from"./studio-k1xqrgm5.js";import{uA,tx,cl,Ca,wA,cs,Xl,ox}from"./studio-xpx91fby.js";import{ce}from"./studio-0939t1q1.js";var t="checking",i=null;function uw(){return ye()&&Boolean(p().cfConnect)}async function ub(){if(!uw())return;i??=(async()=>{try{t=await p().cfConnection?.()??null}catch{t=null}i=null,um()})(),await i}function DD(){if(uw()&&t==="checking"&&!i)ub()}function ND(){t="checking",i=null}async function d(){let n=await p().cfConnect?.();if(n?.status==="connected"&&!n.connection.accountId){let{openCfAccountPicker:e}=await (ce("xb8vvt2h"),import("./cf-account-picker-xb8vvt2h.js"));await e()}cs(),await ub()}function s(){let n={id:"disconnect",label:"Disconnect",run:async()=>{await p().cfDisconnect?.(),cs(),await ub()},variant:"negative"},e=(r)=>({id:r==="Connect"?"connect":"reconnect",label:r,run:d,variant:"accent"}),o={id:"cloudflare",label:"Cloudflare",revoke:()=>{}};if(t==="checking")return{...o,actions:[],connected:!1,detail:"Checking your connection…"};if(!t?.connected)return{...o,actions:[e("Connect")],connected:!1,detail:"Not connected. Connecting publishes this site and runs the assistant on Workers AI."};let c=()=>{n.run()};if(t.needsReconnect)return{...o,actions:[e("Reconnect"),n],connected:!0,detail:"Connection expired. Reconnect to keep publishing and the assistant working.",revoke:c};if(t.needsAccount||!t.accountId)return{...o,actions:[{id:"choose-account",label:"Choose account",run:async()=>{let{openCfAccountPicker:r}=await (ce("xb8vvt2h"),import("./cf-account-picker-xb8vvt2h.js"));if(await r())cs(),await ub()},variant:"accent"},n],connected:!0,detail:"Connected, but no account is chosen yet — publishing and the assistant need one.",revoke:c};return{...o,actions:[n],connected:!0,detail:`Connected — ${t.accountName??t.accountId}.`,revoke:c}}function l(){let n=hb(),e=OE();return{connected:Boolean(n),detail:n?`Connected${e?` — account ${e}`:""}.`:"Not connected. Publishing will ask when it needs it.",id:"cloudflare",label:"Cloudflare",revoke:ME}}function u(n){let e={id:n.id,label:n.label,run:async()=>{await ox(n)}};if(n.primary)e.variant="accent";return e}function f(n){return{actions:(n.actions??[]).map((e)=>u(e)),connected:n.connected??!1,detail:n.detail,id:`platform:${n.id}`,label:n.label,revoke:()=>{}}}function DE(){let n=vL(),e=Xl(),o=cl();return[{id:"github",label:"GitHub",detail:n?yL()==="desktop"?"Signed in — the token is in this app's config folder, readable only by you.":"Signed in — a device-flow token is stored in this browser.":"Not signed in. Cloning and pushing will ask when they need it.",connected:Boolean(n),revoke:wL},{id:"ai",label:"AI provider",detail:tx()?`${Ca()==="anthropic"?"Anthropic key":"Key"} stored. Model ${e}${o?` via ${o}`:""}.`:"No key stored. The Assistant section is where one is entered.",connected:tx(),revoke:wA},uw()?s():l(),...uA().map((c)=>f(c))]}function AD(n){let e=DE().find((o)=>o.id===n);if(!e)return!1;return e.revoke(),um(),!0}var a=new Set;function OD(n){return a.add(n),()=>{a.delete(n)}}function um(){for(let n of a)n()}
2
- export{uw,ub,DD,ND,DE,AD,OD,um};
3
-
4
- //# debugId=887E2B94A6C0DAF664756E2164756E21
5
- //# sourceMappingURL=studio-7rrdbvex.js.map
@@ -1,4 +0,0 @@
1
- function X(n){return n instanceof Error?n.message:String(n)}export{X};
2
-
3
- //# debugId=1398F429E6CF29FB64756E2164756E21
4
- //# sourceMappingURL=studio-9c6cbq2c.js.map
@@ -1,5 +0,0 @@
1
- import{ZM,f1,i2}from"./studio-nzemfbkk.js";var d=null;function FI(e=document){return d??=i2({document:e}),d}function m(){return d??FI()}var Ve="data-jx-region",M=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],T=new Set(["dock.bottom"]);function O(e){let t=e.indexOf("/"),n=t===-1?e:e.slice(0,t),o=t===-1?void 0:e.slice(t+1);if(o===""||n==="")return null;let s=n,r;if(!T.has(n)){let a=n.indexOf(".");if(a!==-1){if(s=n.slice(0,a),r=n.slice(a+1),r==="")return null}}let i=M.find((a)=>a===s);if(i===void 0)return null;return r===void 0?o===void 0?{surface:i}:{part:o,surface:i}:o===void 0?{instance:r,surface:i}:{instance:r,part:o,surface:i}}function A(e){return O(e)!==null}function N(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function x(e){return e??document}var w=[{locate:([,e],t)=>{let o=hf(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return o?[o]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let n=hf("inspector",t);return n?[...n.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function I(e,t){let n=N(e);if(!A(n))return[];let o=[...x(t).querySelectorAll(`[data-jx-region="${CSS.escape(n)}"]`)];if(o.length>0)return o;for(let s of w){let r=n.match(s.pattern);if(r)return s.locate(r,x(t))}return[]}function hf(e,t){return I(e,t).at(-1)??null}var jI={dock:"dock.bottom",inspector:"inspector",navigator:"navigator",pane:"pane.primary",rail:"rail",status:"statusbar"};function Ln(e,t){return t?`pane.${e}/${t}`:`pane.${e}`}function VM(e){return Ln(e,"tabs")}function UM(e){return`navigator/panel:${e}`}function qM(e){return`inspector/tab:${e}`}var GM="navigator/statements";function KM(e){return`inspector/statements:${e}`}function u0(e){return`dock.bottom/panel:${e}`}var h={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function vt(e,t){let n=h[e];return t?`overlay.${n}:${t}`:`overlay.${n}`}var g=new Map,S=1;function y(e){let t=S;return S+=1,g.set(t,{...e,id:t}),t}function p(e){g.delete(e)}function v(){return[...g.values()]}function zM(e){let t=e.toLowerCase();return v().filter((n)=>n.elements.has(t))}function WM(e){return v().filter((t)=>t.name===e)}var c="jx-studio:/surfaces/",u=new Map;function E(e,t){u.set(e,t),f1(H(e),t)}function H(e){return`${c}${e}.json`}function JM(e){return u.get(e)}function L(e){if(!e.startsWith(c)||!e.endsWith(".json"))return;return u.get(e.slice(c.length,-5))}async function R(e,t,n,o={}){let s=u.get(e);if(!s)throw Error(`Studio surface "${e}" is not registered`);if(await m(),o.region)n.setAttribute(Ve,o.region);let r={scope:t,base:c,resolver:L};if(o.onNodeCreated)r.onNodeCreated=o.onNodeCreated;if(o.onNodeMoved)r.onNodeMoved=o.onNodeMoved;if(o.signal)r.signal=o.signal;let i=await ZM(s,n,r),a=(b)=>({dispose:b,elements:i.elements,root:i.root,scope:i.scope});if(o.signal?.aborted)return a(i.dispose);let l=0,f=()=>{i.dispose(),p(l)};return l=y({elements:i.elements,host:n,name:e,remount:async()=>{f(),await R(e,t,n,o)}}),o.signal?.addEventListener("abort",()=>p(l),{once:!0}),a(f)}
2
- export{zM,WM,FI,Ve,hf,jI,Ln,VM,UM,qM,GM,KM,u0,vt,E,JM,R};
3
-
4
- //# debugId=1C7B5B37616C53CE64756E2164756E21
5
- //# sourceMappingURL=studio-9dq7rwc7.js.map
@@ -1,6 +0,0 @@
1
- import{p}from"./studio-4fnb5648.js";import{C}from"./studio-4f7thq0p.js";import{af}from"./studio-q9hx2qp0.js";import{oe}from"./studio-v5wktj6f.js";import{v,T0}from"./studio-k3we3kqb.js";async function qw(e,o){return p().codeService(e,o)}async function KN(e){return p().locateFile(e)}var Yu=new Map;async function Gw(e,o){let s=e.$prototype?C?.projectConfig?.imports?.[e.$prototype]:null,t=e.$src||s;if(!t||!e.$prototype)return null;let r=`${t}::${e.$prototype}`;if(Yu.has(r))return Yu.get(r);try{let n=p(),i=!s&&o.documentPath?`${location.origin}/${o.documentPath}`:void 0,a=await n.fetchPluginSchema(t,e.$prototype,i);return Yu.set(r,a),a}catch{return Yu.set(r,null),null}}function ZT(e,o){let s=e.getModel();if(!s)return;let t=af();if(!t)return;let r=o.flatMap((n)=>{let i=n.labels?.[0];if(!i)return[];let{line:a,column:c,length:u}=i.span;return[{code:n.url?{target:t.Uri.parse(n.url),value:n.code}:n.code,endColumn:c+(u||1),endLineNumber:a,message:n.message+(n.help?`
2
- ${n.help}`:""),severity:n.severity==="error"?t.MarkerSeverity.Error:t.MarkerSeverity.Warning,source:"oxlint",startColumn:c,startLineNumber:a}]});t.editor.setModelMarkers(s,"oxlint",r)}function JN(e,o){let s=(t)=>{if(!v(t))return null;let r=t.parameters;if(!Array.isArray(r)||r.length===0)return null;return T0(r)};if(e.type==="def"){let t=e.defName?s(o?.state?.[e.defName]):null;if(t)return t}else if(e.type==="event"){if(!o||!e.path)return["state","event"];let t=oe(o,e.path),r=t&&e.eventKey?s(t[e.eventKey]):null;if(r)return r}return["state","event"]}
3
- export{qw,KN,Yu,Gw,ZT,JN};
4
-
5
- //# debugId=EFAA4A356901D95164756E2164756E21
6
- //# sourceMappingURL=studio-9gr7xs9r.js.map
@@ -1,7 +0,0 @@
1
- import{ft}from"./studio-5tet77de.js";import{X}from"./studio-9c6cbq2c.js";import{Tn,nt,Fn}from"./studio-tpxcryf2.js";import{ar,w}from"./studio-sce30r7b.js";import{ae}from"./studio-wqfaqw4m.js";import{cf,p,ye}from"./studio-4fnb5648.js";import{jt,Ih,sc,ou,Aa,lf,fn,wl}from"./studio-q9hx2qp0.js";import{us}from"./studio-4zd6an2b.js";import{$s,Um}from"./studio-hh394phe.js";import{Wt,ln,go,Gm,wv,Jd,Gn,fi,m,Da,oc,rc,Si,SI,Ft,kv,CI}from"./studio-knsjyx7n.js";import{Wp,PO,FO,Ls}from"./studio-bnc50f9h.js";import{rt,Eo,xr}from"./studio-g9brbewz.js";import{Es,fO,z$,yO,Ix,Rx}from"./studio-pwctzka3.js";import{sl}from"./studio-v7a7yb5w.js";import{ei}from"./studio-r6mx7vm5.js";import{Ea}from"./studio-n9qba0gx.js";import{yf}from"./studio-1ks5d9y4.js";import{Br,Ks,Js,zr}from"./studio-90zkgne5.js";import{Kw,Im,Rm,Fb}from"./studio-mrjtnm62.js";import{UC,q$,G$,iv,Wm,Jc,Ys}from"./studio-61rg2cz5.js";import{HT,HS}from"./studio-2zz4qbv9.js";import{Qw}from"./studio-3pz4t5a2.js";import{qN,Fr,Ab,Ob}from"./studio-hfqpfmpk.js";import{jb,Zu}from"./studio-jma2q8r9.js";import{zt}from"./studio-daksw8kh.js";import{Fw,jw,Hw}from"./studio-g0hxtcga.js";import{Fc}from"./studio-qrzmfaf6.js";import{Vs}from"./studio-j0zf5x2x.js";import{C,id,_n}from"./studio-4f7thq0p.js";import{E,R}from"./studio-9dq7rwc7.js";import{g}from"./studio-3qr08sxq.js";import{n,_}from"./studio-k3we3kqb.js";import{ce}from"./studio-0939t1q1.js";async function Lb(){if(Kw(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 o=sl({status:"Installing dependencies…",title:"Installing dependencies"});try{let r=await e.installDependencies();if(r.ok)return o.done(),!0;o.fail(r.log??"Install failed")}catch(r){o.fail(r instanceof Error?r.message:String(r))}return!1}var Le=["page","component"],Me={components:"component",pages:"page"};function L(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ae(e){let t=L(e).toLowerCase();for(let[o,r]of Object.entries(Me))if(t.startsWith(`${o}/`))return r;return null}function K(e){return Le.some((t)=>e.includes(t))}function He(e){let t=C?.projectConfig?.layout;if(!n(t))return!1;return L(t).toLowerCase()===L(e).toLowerCase()}function $S(e){let t=[{ext:".json",label:"JSON (.json)"}];for(let o of wl(e)){let r=Aa(o,"parse");if(r&&Aa(o,"serialize"))t.push({ext:o,label:`${r.name} (${o})`})}return t}function ie(){return new Set([".json",...ou().flatMap((e)=>e.extensions)])}function IS(e){if(e===null||e===void 0||e==="")return[];let t=Ae(e);if(t===null||He(e)||Gn(e))return[];let o=fn(e);if(!(o?Boolean(o.capabilities.parse)&&K(o.documentKinds):L(e).toLowerCase().endsWith(".json")))return[];let a=[];if(o)a.push({ext:".json",label:"JSON (.json)"});for(let i of wl()){let s=Aa(i,"serialize");if(!s||s.name===o?.name||!K(s.documentKinds)||!s.documentKinds.includes(t))continue;a.push({ext:i,label:`${s.name} (${i})`})}return a}function RN(){let e=new Set([".json"]);for(let t of ou()){if(!t.capabilities.serialize||!K(t.documentKinds))continue;for(let o of t.extensions)e.add(o)}return[...e].toSorted()}var Y="jx-studio-recent-projects",le="jx-studio-recent-files",se=8,We=10,T=[];function M(){if(!ye())return null;let e=p();return ze(e)?e:null}function ze(e){return Boolean(e.getRecentProjects&&e.saveRecentProjects)}function _e(){try{let e=localStorage.getItem(Y);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function Q(){return M()?T:_e()}function de(e){T=e;let t=M();if(t)t.saveRecentProjects(e);else try{localStorage.setItem(Y,JSON.stringify(e))}catch{}}async function DN(){let e=M();if(!e)return;try{T=await e.getRecentProjects()}catch{T=[]}}function Nw(){return Q().toSorted((e,t)=>t.timestamp-e.timestamp)}function Aw(e,t){let o=Q().filter((r)=>r.root!==t);if(o.unshift({name:e,root:t,timestamp:ar()}),o.length>se)o.length=se;de(o)}function RS(e){de(Q().filter((t)=>t.root!==e))}function NN(){T=[];let e=M();if(e)e.saveRecentProjects([]);else localStorage.removeItem(Y)}function pe(){try{let e=localStorage.getItem(le);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function AN(e){let t=pe().toSorted((o,r)=>r.timestamp-o.timestamp);return e==null?t:t.filter((o)=>o.root===e)}function $b(e){let t=pe().filter((a)=>!(a.root===e.root&&a.path===e.path));t.unshift({name:e.name,path:e.path,root:e.root,timestamp:ar()});let o=new Map,r=[];for(let a of t.toSorted((i,s)=>s.timestamp-i.timestamp)){let i=(o.get(a.root)??0)+1;if(o.set(a.root,i),i<=We)r.push(a)}localStorage.setItem(le,JSON.stringify(r))}var ue={$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"}]},address:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"Add ?project= and a project folder's absolute path to this page's address to open it."}]},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…"}}}}]}]}}}]};E("files-panel",ue);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 A(){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 Je(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function qe(e){let t=e?.$map,o=_(t)&&"item"in t?t.item:void 0;if(!_(o)||!("path"in o)||!n(o.path)||!("type"in o)||!n(o.type))return null;return{path:o.path,type:o.type}}function me(e,t,o){let r=g({...A(),...o});fe(r,t);let a=null,i=!1,s=R("files-panel",r,e,{onNodeCreated:(l,c,d,u)=>{if(i||!(l instanceof HTMLElement))return;let x=Je(d);if(x==="tree"){o.treeHost(l);return}if(x!=="row")return;let y=qe(u);if(y)o.rowHost(l,y.path,y.type)}}).then((l)=>{if(i){l.dispose();return}a=l});return{connected:()=>!i&&(a===null||a.root.parentNode===e),dispose(){i=!0,a?.dispose(),a=null},ready:s,update:(l)=>{fe(r,l)}}}async function rl(e){if(!C)return;try{let t=p(),[o]=await Promise.all([$s(()=>t.listDirectory(e)),PO(e)]);C.dirs.set(e,o)}catch{C.dirs.set(e,[])}}var he=new Set(["pages","layouts","components","content","data","public","styles"]);async function Em(){if(!C)return;await rl(".");let e=[];for(let t of C.dirs.get(".")??[])if(t.type==="directory"&&he.has(t.name))e.push(t.name),C.expanded.add(t.path||t.name),await rl(t.path||t.name);C.projectDirs=e}async function TT(e){let t=new Set(C?.projectDirs);if(!e.some((r)=>{let a=r.replaceAll("\\","/").replace(/^\.\//,"").split("/")[0]??"";return r.includes("/")&&he.has(a)&&!t.has(a)}))return!1;return await Em(),!0}function LT(){return Eo(rt.showIgnoredFiles)==="true"}function VP(e){xr(rt.showIgnoredFiles,e?"true":"")}async function $T(){try{let e=p(),t=await e.probeRootProject();if(!t)return;let{meta:o,info:r}=t;if(Ih(),jt(),sc(e),Wp(),Um(),id({dirs:new Map,expanded:new Set,isSiteProject:r.isSiteProject,name:r.isSiteProject?r.projectConfig?.name||o.name:o.name,projectConfig:(r.isSiteProject?r.projectConfig:null)||null,projectDirs:r.directories||[],projectRoot:".",root:o.root,searchQuery:"",selectedPath:null}),r.isSiteProject)rc(o.root||".",r.projectConfig||null);if(r.isSiteProject){if(Aw(_n().name,o.root),await Rm(),await Lb())Ih(),await jt(),sc(e);await Em(),await Ea(),await Ib(),Im(o.root)}}catch{}}async function IT({renderLeftPanel:e,resetProjectCaches:t}){try{let o=p(),r=await o.openProject?.();if(!r)return!1;let{config:a,handle:i}=r;if(SI({document:{children:[],tagName:"div"},id:"initial"}),qN(),Ih(),jt(),sc(o),Wp(),Um(),id({...C,dirs:new Map,expanded:new Set,isSiteProject:!0,name:a.name||i.name,projectConfig:a,projectRoot:i.root,searchQuery:"",selectedPath:null}),rc(i.root,a),await Rm(),await Lb())Ih(),await jt(),sc(o);return await Em(),await Ea(),Fb(),Rx(),t?.(),Aw(_n().name,_n().projectRoot),e(),await Ib(),Im(_n().projectRoot),!0}catch(o){return w.error("Could not open the project.",{detail:X(o),source:"Open Project"}),!1}}async function RT(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(),w.success("Initialized a git repository for this project."),!0}catch(o){return w.warn("Could not initialize a git repository — the project itself was written.",{detail:X(o),source:"Source Control"}),!1}}async function DS(){await jt();let e=[...wl("page"),".json"],t;try{t=await p().listDirectory("pages")}catch{return null}let o=new Set(t.filter((r)=>r.type==="file").map((r)=>r.name));for(let r of e)if(o.has(`index${r}`))return`pages/index${r}`;return null}async function UP(){let e=await DS();if(e)await _i(e)}async function Ib(){let e=yO(m.projectRoot),t=z$(m.projectRoot),o=await Be(e);return ge?.(t),o}var ge=null;function DT(e){ge=e}async function Be(e){if(Ix(m.projectRoot),e){if(await fO(e,{ensureSecondPane:()=>{oc(fi)},openFile:(o,r)=>_i(o,{focus:!1,paneId:r})})>0)return!0}return await UP(),!1}function Ue(e,t,o){if(t==="directory")return o?"folder-open":"folder";let r=e.split(".").pop()?.toLowerCase();switch(r){case"css":case"js":case"json":case"ts":return"file-code";case"md":return"file-text";default:return r!==void 0&&yf(r)?"image":"file"}}var qP=24,f=[],k=null,j=new Map,z=null,we=null;function oe(){for(let e of j.values())if(e.isConnected&&e.offsetHeight>0)return e.offsetHeight;return qP}function Ge(){for(let[e,t]of j)if(!t.isConnected)j.delete(e),Re(t)}function ve(e){let t=j.get(e);return t?.isConnected===!0?t:null}function B(e){return f.find((t)=>!t.loading&&t.path===e)}function be(e,t,o,r){let a=_n().dirs.get(e);if(!a){rl(e).then(()=>h()),o.push({depth:t,expanded:!1,key:`loading:${e}`,loading:!0,name:"Loading…",path:e,posInSet:1,setSize:1,type:"file"});return}let i=[...a].toSorted((d,u)=>{if(d.type==="directory"&&u.type!=="directory")return-1;if(d.type!=="directory"&&u.type==="directory")return 1;return d.name.localeCompare(u.name)}),s=LT()?i:i.filter((d)=>!FO(e,d.path,d.type==="directory")),l=_n().searchQuery.toLowerCase(),c=l?s.filter((d)=>d.type==="directory"||d.name.toLowerCase().includes(l)):s;for(let[d,u]of c.entries()){let y=u.type==="directory"&&_n().expanded.has(u.path);if(o.push({depth:t,expanded:y,key:u.path,loading:!1,name:u.name,path:u.path,locale:go(u.path,r)??void 0,posInSet:d+1,setSize:c.length,type:u.type}),y)be(u.path,t+1,o,r)}}function xe(e){return e===void 0?-1:f.findIndex((t)=>!t.loading&&t.path===e)}function H(e,t){for(let o=e+t;o>=0&&o<f.length;o+=t)if(!f[o].loading)return o;return-1}function Ke(e){let t=f[e];if(!t)return-1;for(let o=e-1;o>=0;o--){let r=f[o];if(!r.loading&&r.depth<t.depth)return o}return-1}function Ye(){if(k?.isConnected!==!0||S!=="")return;queueMicrotask(h)}function ee(){let e=k;if(e===null)return;z=Hw(z,e,{count:()=>f.length,onChange:Ye,rowHeight:oe})}function Qe(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:Ue(e.path,e.type,e.expanded),key:e.key,kind:"item",level:t,locale:e.locale===void 0?"":Wt(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 Xe(){if(Ge(),!C){f=[];let l={...A(),view:"none"};return b=l,l}if(!C.isSiteProject&&C.projectRoot==="."){f=[];let l=cf(p())?"welcome":"address",c={...A(),view:l};return b=c,c}let e=_n();f=[];let{i18n:t}=ln(e.projectConfig??{});be(".",0,f,t);let o=Fw(k,{count:f.length,rowHeight:oe()}),r=f.slice(o.start,o.end),a=(e.selectedPath!==null&&B(e.selectedPath)?e.selectedPath:"")||r.find((l)=>!l.loading)?.path||"",i=LT(),s={currentPath:a,dragPath:S,dropPath:I,headerState:e.isSiteProject?"shown":"hidden",ignoredIcon:i?"eye":"eye-slash",ignoredLabel:i?"Hide ignored files":"Show ignored files",ignoredSelected:i,padBottom:o.padBottom,padTop:o.padTop,projectName:e.projectConfig?.name||e.name,query:e.searchQuery,rootDrop:U,rows:r.map((l)=>Qe(l)),selectedPath:e.selectedPath??"",view:"tree"};return b=s,s}function te(){if(!v||!b)return;b={...b,dragPath:S,dropPath:I,rootDrop:U},v.handle.update(b)}function h(){we?.()}async function Ze(){let e=_n();e.dirs.clear(),Wp(),await rl(".");for(let t of e.expanded)await rl(t);h()}function et(e){let t=B(e);if(!t)return;if(t.type==="directory"){je(e).then(()=>h());return}_i(e)}function tt(e,t){let o=_n();if(B(e)?.type!=="directory"||o.expanded.has(e)===t)return;if(!t){o.expanded.delete(e),h();return}je(e).then(()=>h())}function Pe(e){if(!C||_n().selectedPath===e)return;_n().selectedPath=e,h()}function ot(e,t){let o=xe(e),r;switch(t){case"Home":{r=H(-1,1);break}case"End":{r=H(f.length,-1);break}case"ArrowUp":{r=H(o,-1);break}case"ArrowLeft":{r=Ke(o);break}case"ArrowDown":case"ArrowRight":{r=H(o,1);break}default:return}Fe(r)}function at(e,t){let o=xe(e),r=f.length;for(let a=1;a<=r;a++){let i=(o+a+r)%r,s=f[i];if(s&&!s.loading&&s.name.trim().toLowerCase().startsWith(t)){Fe(i);return}}}function Fe(e){let t=f[e];if(!t)return;if(Pe(t.path),ve(t.path))return;jw(k,e,oe()),h()}async function je(e){let t=_n();if(t.expanded.has(e)){t.expanded.delete(e);return}if(t.expanded.add(e),!t.dirs.has(e))await rl(e)}var N=new Map,V=null,S="",J="",I="",q=!1,U="";function GP(e){return[...e.dataTransfer?.types??[]].includes("Files")}function Se(e,t,o){let r=(s)=>{if(!GP(s))return;if(s.preventDefault(),s.stopPropagation(),s.dataTransfer)s.dataTransfer.dropEffect="copy";o(!0)},a=()=>o(!1),i=(s)=>{o(!1);let l=s.dataTransfer?.files;if(!l?.length)return;s.preventDefault(),s.stopPropagation(),ON(l,t,h)};return e.addEventListener("dragover",r),e.addEventListener("dragleave",a),e.addEventListener("drop",i),()=>{e.removeEventListener("dragover",r),e.removeEventListener("dragleave",a),e.removeEventListener("drop",i)}}function NT(e,t){let o=e.replaceAll("\\","/"),r=t.replaceAll("\\","/");if(!o||o===r)return!1;if(o.startsWith(`${r}/`)||r.startsWith(`${o}/`))return!1;return ne(o)!==r}function Z(e,t,o){let r=e.data.path;return o==="directory"&&n(r)&&NT(r,t)}function F(e,t){let o=t?e:"";if(J===e&&I===o)return;J=e,I=o,$e()}function W(e){if(q===e)return;q=e,$e()}function $e(){U=q&&J===""?"true":"",te()}async function ON(e,t,o){if((await Ys([...e],{dir:t})).length===0)return;if(t!==".")_n().expanded.add(t);o()}function KP(e,t){let o=document.createElement("input");o.type="file",o.multiple=!0,o.accept=Jc(),o.addEventListener("change",()=>{if(o.files?.length)ON(o.files,e,t)}),o.click()}function it(e,t,o){Re(e),j.set(t,e);let r=[zr({element:e,getInitialData(){return{entryType:o,path:t,type:"file-tree"}},onDragStart(){S=t,te()},onDrop(){S="",F("",!1),te()}}),Se(e,o==="directory"?t:ne(t),(a)=>{F(a?t:"",a)}),Ks({canDrop({source:a}){return a.data.type==="file-tree"},element:e,getData({source:a}){return Z(a,t,o)?{targetDir:t,type:"file-tree-target"}:{type:"file-tree-refused"}},onDrag({source:a}){F(t,Z(a,t,o))},onDragEnter({source:a}){F(t,Z(a,t,o))},onDragLeave(){F("",!1)},onDrop(){F("",!1)}})];N.set(e,Br(...r))}function Re(e){let t=N.get(e);if(t)t(),N.delete(e)}function st(e){if(V?.element===e)return;ke(),k=e;let t=Ks({canDrop({source:r}){let a=r.data.path;return r.data.type==="file-tree"&&n(a)&&NT(a,".")},element:e,getData(){return{targetDir:".",type:"file-tree-target"}},onDragEnter(){W(!0)},onDragLeave(){W(!1)},onDrop(){W(!1)}}),o=Js({onDrop({source:r,location:a}){let[i]=a.current.dropTargets;if(!i)return;if(r.data.type!=="file-tree")return;if(i.data.type!=="file-tree-target")return;let s=r.data.path,l=i.data.targetDir;if(!n(s)||!n(l)||!NT(s,l))return;let c=s.split("/").pop(),d=l==="."?c:`${l}/${c}`;lt(s,d,h)}});V={cleanup:Br(t,o,Se(e,".",W)),element:e},ee()}function ke(){V?.cleanup(),V=null;for(let e of N.values())e();N.clear(),z?.window.destroy(),z=null,k=null,S="",J="",I="",q=!1,U=""}async function lt(e,t,o){let r=t.split("/").pop()??t,a=ne(t),i={path:e,source:"Files"},s;try{s=await p().listDirectory(a)}catch(d){w.error(`Could not move ${e}.`,{...i,detail:`The folder could not be read to check for ${r}: ${X(d)}`});return}let l=r.toLowerCase(),c=s.find((d)=>d.name.toLowerCase()===l);if(c!==void 0){let d=a==="."?"The project root":`${a}/`;w.error(`Could not move ${e}.`,{...i,detail:`${d} already has ${c.name}, and a move would replace it.`});return}try{let d=await Pw(e,t);if(a!==".")_n().expanded.add(a);o(),Mw(`Moved to ${t}`,d,t)}catch(d){w.error(`Could not move ${e}.`,{...i,detail:X(d)})}}function ne(e){let t=e.replaceAll("\\","/"),o=t.lastIndexOf("/");return o===-1?".":t.slice(0,o)}var D=null;function Ee(){D?.close(),D=null}function ct(e){let t={};if(e.type==="directory"){let o=Jd(e.path);if(o?.isSourceRoot===!0&&!o.fileBacked)t.name=o.name;return t}if(t.file=e.path,Fc(e.path))t.path=e.path;if(IS(e.path).length>0)t.source=e.path;return t}function P(e,t,o,r={}){return{destructive:!1,disabled:!1,dividerAbove:!1,id:e,run:o,title:t,...r}}function dt(e){let t=ae();if(!t)return[];let o=ct(e),r=[];for(let a of t.forPlacement("context/file")){let i=a.args;if(!(i?.required??[]).every((c)=>(c in o)))continue;let s={};for(let c of Object.keys(i?.properties??{}))if(c in o)s[c]=o[c];let l=t.disabledReason(a.id);r.push(l===void 0?P(a.id,a.title,()=>{Tn(t,a.id,s,"Files")}):{destructive:!1,disabled:!0,dividerAbove:!1,id:a.id,requires:l,title:a.title})}return r}function pt(e){let t=e.type==="directory",o=[];if(t){if(o.push(P("files.newFile","New File…",()=>{Te(e.path,h)}),P("files.upload","Upload Files…",()=>{KP(e.path,h)})),e.path==="pages"||e.path.endsWith("/pages"))o.push(P("files.pagesGrid","Edit Pages in Grid",()=>{HS()}))}else o.push(P("files.open","Open",()=>{_i(e.path)}));return o.push(...dt(e),P("files.rename","Rename…",()=>{yt(e,h)},{dividerAbove:!0}),P("files.delete","Delete",()=>{bt(e,h)},{destructive:!0})),o}function ut(e,t,o){let r=B(e);if(!r)return;Ee();let a=ve(e);D=zt({label:"File actions",onClosed:(i)=>{if(D===i)D=null},opener:a,origin:{x:t,y:o},region:"files",rows:pt({name:r.name,path:r.path,type:r.type})})}var mt=JSON.stringify({children:[{children:[],tagName:"p"}],tagName:"div"},null,2);function ht(e){return[...(e.kind==="locked"?[{ext:e.ext,label:`${Aa(e.ext)?.name??e.ext} (${e.ext})`}]:$S(e.docKind)).map((o)=>({label:o.label,value:o.ext})),{dividerBefore:!0,label:"Other…",value:UC}]}function gt(e,t,o){let r=e.kind==="choose"?e.defaultExt:e.ext;if(r!==void 0&&t.some((i)=>i.value===r))return r;let a=q$(o);if(a!==""&&t.some((i)=>i.value===a))return a;return t[0]?.value??UC}async function JP(e){let{dir:t,format:o,source:r="Files"}=e;await jt();let a=await Ow(t),i=o!==void 0&&o.kind!=="fixed"?o:null,s=i===null?null:ht(i),l=i===null||s===null?"":gt(i,s,e.suggestedName??""),c={choice:o,dir:t,known:ie(),rows:s,taken:a},d=(G,Oe)=>iv(G,Oe,c),u=l,x={confirmLabel:"Create",message:t==="."?"Creating in the project root.":`Creating in ${t}/`,select:s===null?"stem":"all",validate:d,value:e.suggestedName??"untitled.json"};if(s!==null)x.choice={initial:l,label:"Format",onChange:(G)=>{u=G},options:()=>s};if(e.suggestedName!==void 0)x.placeholder=e.suggestedName;let y=await Fn(e.title??"New File",x);if(!y)return null;let O=G$(y,u,o),De=t==="."?O:`${t}/${O}`,re=fn(O),Ne=e.content,Ce=o!==void 0&&u!==UC,Ie=Ne??re?.studio?.newFileTemplate??(re?"":O.toLowerCase().endsWith(".json")?Ce?mt:`{}
2
- `:"");return NS(De,Ie,{dir:t,source:r})}async function Ow(e){try{let t=await p().listDirectory(e);return new Set(t.map((o)=>o.name.toLowerCase()))}catch{return new Set}}async function NS(e,t,o={}){let r=o.dir??(e.includes("/")?e.slice(0,e.lastIndexOf("/")):".");Ls(e);try{if(await p().writeFile(e,t),await rl(r),o.quiet!==!0)w.success(`Created ${e}`);return e}catch(a){return w.error(`Could not create ${e}.`,{detail:X(a),path:e,source:o.source??"Files"}),null}}async function Te(e,t){await jt();let o=Jd(e);if(o?.unresolvedFormat!=null)w.error(`New files in ${e}/ cannot be constrained to the collection's format.`,{detail:`The "${o.name}" content type declares format "${o.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 r=o?.ext!=null&&o.unresolvedFormat===null,a=r&&o.isSourceRoot&&o.def.schema!==void 0,i;if(a){let{createEntry:s}=await (ce("t13dyw3c"),import("./entry-commands-t13dyw3c.js"));i=await s(o.name,{dir:e})}else i=await JP({dir:e,format:r&&o.ext!==null?{because:`${o.name} entries are ${o.ext} files, so a document of another format here would not be one.`,ext:o.ext,kind:"locked"}:{defaultExt:".json",kind:"choose"},suggestedName:"untitled"});if(i!==null)t()}async function wt(e,t,o){let r=await Ob(t),a={confirmLabel:"Rename",select:"stem",validate:(i)=>Wm(t,i,o),value:e};if(r!==void 0)a.message=r;return Fn("Rename",a)}function AS(e,t){let o=t.references,r=t.tag?`; tag → <${t.tag.to}> (${t.tag.refsUpdated})`:"";if(o&&o.refsUpdated>0)return`Renamed to ${e}; updated ${o.refsUpdated} reference(s) in ${o.filesChanged} file(s)${r}`;if(r)return`Renamed to ${e}${r}`;return`Renamed to ${e}`}function Mw(e,t,o){let r=t.errors??[];if(r.length===0){w.success(e);return}let a=r.length===1?"1 file":`${r.length} files`;w.warn(`${e} — references in ${a} could not be updated`,{detail:r.map((i)=>`${i.path}: ${i.error}`).join(`
3
- `),path:o,source:"Files"})}function vt(e,t){for(let o of e.references?.files??[])if(o.path!==t&&m.tabs.has(o.path))Lm(o.path)}function Tm(e){let t=e.replaceAll("\\","/");return t.includes("/")?t.slice(0,t.lastIndexOf("/")):"."}async function YP(e,t,o){us();let r=Tm(e),a=Tm(t);if(await rl(r),a!==r)await rl(a);let i=_n();if(i.selectedPath===e)i.selectedPath=t;else if(i.selectedPath?.startsWith(`${e}/`))i.selectedPath=t+i.selectedPath.slice(e.length);vt(o,t)}async function Pw(e,t){Ls(e,t);let o=await p().renameFile(e,t),r=[...m.tabs.keys()];for(let a of r)if(a===e||a.startsWith(`${e}/`)){let i=t+a.slice(e.length);CI(a,i,i)}return await YP(e,t,o),o}async function OS(e,t){try{let o=await p().listDirectory(Tm(e));return new Set(o.map((r)=>r.name))}catch(o){return w.error(`Could not rename ${e.split("/").pop()??e}.`,{detail:`The folder could not be read to check the new name: ${X(o)}`,path:e,source:t}),null}}async function yt(e,t){let o=Tm(e.path),r=await OS(e.path,"Files");if(r===null)return;let a=await wt(e.name,e.path,r);if(!a||a===e.name)return;let i=o==="."?a:`${o}/${a}`;try{let s=await Pw(e.path,i);t(),Mw(AS(a,s),s,i)}catch(s){w.error(`Could not rename ${e.name}.`,{detail:X(s),path:e.path,source:"Files"})}}async function bt(e,t){if(!await Ab(e))return;try{let r=p();Ls(e.path),await r.deleteFile(e.path),us();let a=e.path.replaceAll("\\","/"),i=a.includes("/")?a.slice(0,a.lastIndexOf("/")):".";if(await rl(i),_n().selectedPath===e.path)_n().selectedPath=null;t(),w.success(`Deleted ${e.name}`)}catch(r){w.error(`Could not delete ${e.name}.`,{detail:X(r),path:e.path,source:"Files"})}}function xt(e,t){let o=t.paneId,r=Da(e);if(o!==void 0&&r){if(r.activeTabId===e&&t.focus===!1)return;kv(e,o)}Ft(e,{focus:t.focus!==!1})}async function _i(e,t={}){let o=t.focus!==!1;for(let[a,i]of m.tabs.entries())if(i.documentPath===e){if(t.canvasMode!==void 0)i.session.ui.canvasMode=t.canvasMode;if(xt(a,t),o)_n().selectedPath=e;return}if(jb(e)){if(Zu(e,t),o)_n().selectedPath=e;$b({name:e.split("/").pop()||e,path:e,root:_n().projectRoot});return}if(e.toLowerCase().endsWith(".csv")){try{if(await HT(e,t),o)_n().selectedPath=e;$b({name:e.split("/").pop()||e,path:e,root:_n().projectRoot})}catch(a){w.error(`Could not open ${e}.`,{detail:X(a),path:e,source:"Open File"})}return}let r=p();try{let a=await r.readFile(e);if(!a){if(await jt(),!fn(e)&&!e.toLowerCase().endsWith(".json"))throw lf(e);return}await jt();let i,s,l=null,c=fn(e);if(c){let u=await Fr(e,a);({document:i}=u),{frontmatter:s}=u}else if(e.endsWith(".json"))({document:i,layout:l}=Es(a));else throw lf(e);if(Si({id:e,documentPath:e,document:i,...s!=null&&{frontmatter:s},layout:l,source:c?a:null,sourceFormat:c?.name??null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1},...t.canvasMode!==void 0&&{canvasMode:t.canvasMode}}),o)_n().selectedPath=e;$b({name:e.split("/").pop()||e,path:e,root:_n().projectRoot})}catch(a){w.error(`Could not open ${e}.`,{detail:X(a),path:e,source:"Open File"})}}async function MS(e,t){await _i(t,{focus:!1,paneId:e,preview:!0})}function AT(e){if(wv(e))return;Qw(e);for(let[,t]of m.tabs.entries())if(t.documentPath===e&&!t.doc.dirty){Lm(e);return}}function OT(e){for(let t of e)Lm(t,{onlyIfChanged:!0})}async function Lm(e,t={}){for(let[,o]of m.tabs.entries())if(o.documentPath===e){let r=p(),a=o.doc.dirty,i=()=>!a&&o.doc.dirty||wv(e);try{let s=await r.readFile(e);if(!s)return;if(await jt(),i())return;if(fn(e)){let{document:l,frontmatter:c}=await Fr(e,s);if(i())return;if(t.onlyIfChanged&&Vs(l,o.doc.document)&&Vs(c,o.doc.content.frontmatter))return;o.doc.document=l,o.doc.content.frontmatter=c,o.doc.source=s}else if(e.endsWith(".json")){let l=Es(s);o.doc.layout=l.layout;let c=l.document;if(o.doc.bareRepeaters=Gm(c),t.onlyIfChanged&&Vs(c,o.doc.document))return;o.doc.document=c}o.doc.dirty=!1}catch(s){w.error(`Could not reload ${e} after it changed on disk.`,{detail:X(s),key:`reload:${e}`,path:e,source:"Files"})}return}}function MT(){ei({id:"files",title:"Files",level:"project",dock:"navigator",icon:"folder",rail:"developer",render:()=>ft,afterRender:(e,t)=>{ZP(t,e.rerender)}})}var Pt={activate:et,contextMenu:ut,expand:tt,move:ot,newFile:()=>{Te(".",h)},openProject:()=>{nt("project.open",void 0,"Files")},refresh:()=>{Ze()},rowHost:it,search:(e)=>{_n().searchQuery=e,h()},select:Pe,toggleIgnored:()=>{VP(!LT()),h()},treeHost:st,typeahead:at},v=null,b=null;function ZP(e,t){let o=e.querySelector(".panel-content")??e;if(we=t,v&&(v.host!==o||!v.handle.connected()))XP();let r=Xe();if(v)v.handle.update(r);else{let a=me(o,r,Pt);v={handle:a,host:o},a.ready.then(ee)}queueMicrotask(ee)}function XP(){Ee(),v?.handle.dispose(),v=null,b=null,ke(),j.clear(),f=[]}
4
- export{Lb,$S,IS,RN,DN,Nw,Aw,RS,NN,AN,$b,rl,Em,TT,LT,VP,$T,IT,RT,DS,UP,Ib,DT,qP,GP,NT,ON,KP,JP,Ow,NS,AS,Mw,Tm,YP,Pw,OS,_i,MS,AT,OT,Lm,MT,ZP,XP};
5
-
6
- //# debugId=4B109BA3243CC5AB64756E2164756E21
7
- //# sourceMappingURL=studio-a88ej93p.js.map
@@ -1,5 +0,0 @@
1
- import{p,ye}from"./studio-4fnb5648.js";import{r2,s2}from"./studio-nvcn2ykc.js";import{gh,WO,Vp}from"./studio-hh394phe.js";import{ln,xv,_v,h}from"./studio-knsjyx7n.js";import{C}from"./studio-4f7thq0p.js";function fh(){let t=ye()?p().canvasUrl:void 0;if(t)return new URL(t,location.href).origin;return location.origin}function dv(){let t=ye()?p().canvasUrl:void 0;if(!t)return null;let e=new URL(t,location.href);return e.origin===location.origin?e.searchParams.get("rpcToken"):null}function Gd(t){let e=fh(),n=ye()?p().documentBaseUrl:void 0;if(n){let o=n.endsWith("/")?n:`${n}/`;return new URL(o,`${e}/`).href}let r=t||"";return`${e}/${r?`${r}/`:""}`}function GC(t){if(t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("http")||t.startsWith("views://"))return t;let e=fh();if((e.startsWith("http:")||e.startsWith("https:"))&&e!==location.origin)return`${e}/${t.replace(/^\.?\//,"")}`;return t}function rI(){return ln(C?.projectConfig??{}).i18n?.locales??[]}function uv(t,e){let n=e?.space??"site",r=xv(t,C?.projectConfig?.content,rI());if(n==="site"&&!r&&!WO())return null;let o={documentDir:s2(t??""),lanes:r2,mounts:r?[r]:[],space:n};if(e?.fileBaseUrl!==void 0)o.fileBaseUrl=e.fileBaseUrl;return o}function Xc(t){return hv(t,h.value?.documentPath)}function hv(t,e){if(!t)return t;let n=uv(e,mh()),r=n&&{...n,revisions:Vp(),versions:gh()};return GC(_v(t,r)??t)}function mh(){let t={fileBaseUrl:Gd(C?.projectRoot)};if(ye())t.space=p().assetSpace;return t}
2
- export{fh,dv,Gd,GC,rI,uv,Xc,hv,mh};
3
-
4
- //# debugId=E011107A989B159B64756E2164756E21
5
- //# sourceMappingURL=studio-acer0g8w.js.map