@jxsuite/studio 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/chunks/{2020-j56903f1.js → 2020-mkb0qa6p.js} +2 -2
  2. package/dist/chunks/adapter-xcpsmecx.js +4 -0
  3. package/dist/chunks/{add-new-flow-snx1s4b0.js → add-new-flow-ptmhmzr9.js} +3 -3
  4. package/dist/chunks/{cf-account-picker-xyqw0jex.js → cf-account-picker-z1sgwpwd.js} +3 -3
  5. package/dist/chunks/cf-settings-xqvhxxe9.js +4 -0
  6. package/dist/chunks/components-whsc81a7.js +4 -0
  7. package/dist/chunks/content-source-jwtxg78w.js +4 -0
  8. package/dist/chunks/{convert-to-repeater-fhdwyg14.js → convert-to-repeater-f92ey3kp.js} +3 -3
  9. package/dist/chunks/editor-zdqdpq1x.js +4 -0
  10. package/dist/chunks/entry-commands-w8p2fbpt.js +4 -0
  11. package/dist/chunks/{extension-sections-8ez2rrk8.js → extension-sections-y2p1te2r.js} +3 -3
  12. package/dist/chunks/file-ops-13ab4swj.js +4 -0
  13. package/dist/chunks/files-zbc8p6v1.js +4 -0
  14. package/dist/chunks/{format-host-zfjz4rzm.js → format-host-zjsbktbx.js} +3 -3
  15. package/dist/chunks/fs-events-t6x0hch6.js +4 -0
  16. package/dist/chunks/grid-open-fyzdwpkh.js +4 -0
  17. package/dist/chunks/{grid-view-ka55z38f.js → grid-view-r22jsqht.js} +5 -5
  18. package/dist/chunks/{iframe-host-na2mywz4.js → iframe-host-kbyqc7pt.js} +3 -3
  19. package/dist/chunks/index-6nvj89vb.js +4 -0
  20. package/dist/chunks/{index-qb98xhse.js → index-pxwwf00y.js} +2 -2
  21. package/dist/chunks/{javascript-ces13wny.js → javascript-pzqryby6.js} +2 -2
  22. package/dist/chunks/{jsonMode-6md16d4v.js → jsonMode-tcnyxyap.js} +5 -5
  23. package/dist/chunks/jx-validate-5sp8a4rm.js +4 -0
  24. package/dist/chunks/layers-panel-qrxj9vr2.js +4 -0
  25. package/dist/chunks/layers-tpzayggx.js +4 -0
  26. package/dist/chunks/lit-html-x6nrxsx3.js +4 -0
  27. package/dist/chunks/media-library-ywppnjrz.js +4 -0
  28. package/dist/chunks/media-picker-etxgc8qq.js +4 -0
  29. package/dist/chunks/{monaco-binding-p8j80s4w.js → monaco-binding-bqpge64f.js} +2 -2
  30. package/dist/chunks/monaco-buffer-qrnqhk0b.js +4 -0
  31. package/dist/chunks/{monaco-setup-wasktzfg.js → monaco-setup-1mkab762.js} +3 -3
  32. package/dist/chunks/notify-kcv38wwe.js +4 -0
  33. package/dist/chunks/parse-df2kkmhc.js +4 -0
  34. package/dist/chunks/{platform-c16mqvmp.js → platform-dtsysmyd.js} +2 -2
  35. package/dist/chunks/publish-panel-evb1rcxt.js +4 -0
  36. package/dist/chunks/{publish-quick-vr695j26.js → publish-quick-m9vkhahq.js} +3 -3
  37. package/dist/chunks/publish-workspace-ktk9h536.js +4 -0
  38. package/dist/chunks/quick-search-2f47fxcw.js +4 -0
  39. package/dist/chunks/references-5w6ajjv7.js +4 -0
  40. package/dist/chunks/right-panel-kz0a6byf.js +4 -0
  41. package/dist/chunks/source-control-1phx90zk.js +4 -0
  42. package/dist/chunks/{studio-h5tpz5ke.js → studio-07k0geap.js} +4 -4
  43. package/dist/chunks/{studio-7xag4na8.js → studio-0g2sm01j.js} +4 -4
  44. package/dist/chunks/{studio-de1s2x9v.js → studio-0hr000ba.js} +4 -4
  45. package/dist/chunks/{studio-35vrtpdq.js → studio-1wyp7dt5.js} +4 -4
  46. package/dist/chunks/{studio-34jrz12k.js → studio-20ap8dds.js} +4 -4
  47. package/dist/chunks/{studio-d83m0wyq.js → studio-291gqh98.js} +3 -3
  48. package/dist/chunks/{studio-xdpz9rpe.js → studio-37twdaf7.js} +29 -29
  49. package/dist/chunks/{studio-ry81j4q1.js → studio-4nkm4404.js} +4 -4
  50. package/dist/chunks/{studio-3v5cagy9.js → studio-4smcnv33.js} +3 -3
  51. package/dist/chunks/{studio-k3a8rp3d.js → studio-4zqfw5ha.js} +2 -2
  52. package/dist/chunks/{studio-d038kqbs.js → studio-56egy6vf.js} +4 -4
  53. package/dist/chunks/{studio-x3mjr5cc.js → studio-5dmgmyw4.js} +4 -4
  54. package/dist/chunks/{studio-x97ay0v4.js → studio-5e7p1vgd.js} +3 -3
  55. package/dist/chunks/{studio-ndskgqef.js → studio-5m0w815d.js} +3 -3
  56. package/dist/chunks/{studio-pqqq6v85.js → studio-695k95bw.js} +4 -4
  57. package/dist/chunks/{studio-gwrhcrss.js → studio-6vwvshw8.js} +2 -2
  58. package/dist/chunks/{studio-pgm83a2f.js → studio-76t560kn.js} +4 -4
  59. package/dist/chunks/{studio-396srjbk.js → studio-7823f0g8.js} +3 -3
  60. package/dist/chunks/{studio-r17asgs0.js → studio-7vb997ff.js} +4 -4
  61. package/dist/chunks/{studio-et2q4s8n.js → studio-8486jn4r.js} +3 -3
  62. package/dist/chunks/{studio-3w35qvay.js → studio-848rk4p1.js} +4 -4
  63. package/dist/chunks/{studio-5tzgq6fx.js → studio-8jb31dcf.js} +4 -4
  64. package/dist/chunks/{studio-y26hx9re.js → studio-8qejv8yf.js} +4 -4
  65. package/dist/chunks/{studio-h7weqf2q.js → studio-8x8616xd.js} +4 -4
  66. package/dist/chunks/{studio-hcsba201.js → studio-9cp96v90.js} +2 -2
  67. package/dist/chunks/{studio-dx73md4n.js → studio-9rcbvksg.js} +6 -6
  68. package/dist/chunks/{studio-m48v13s3.js → studio-a3s6frde.js} +3 -3
  69. package/dist/chunks/{studio-4kzbrr5t.js → studio-ahf3cspq.js} +3 -3
  70. package/dist/chunks/{studio-zgx7svjd.js → studio-bkmv1h3e.js} +5 -5
  71. package/dist/chunks/{studio-3c8pp7pb.js → studio-brdp85q7.js} +4 -4
  72. package/dist/chunks/{studio-yg3djpnm.js → studio-cgb97rwv.js} +4 -4
  73. package/dist/chunks/{studio-tj2s0tks.js → studio-ch8gt8vt.js} +3 -3
  74. package/dist/chunks/{studio-p1n2xjda.js → studio-cqf1k4qk.js} +4 -4
  75. package/dist/chunks/{studio-jttyqrmh.js → studio-cvz0e00f.js} +4 -4
  76. package/dist/chunks/{studio-5wzdy1jc.js → studio-dbgv4fv9.js} +14 -14
  77. package/dist/chunks/{studio-h310mbqm.js → studio-dy2xtt7a.js} +4 -4
  78. package/dist/chunks/{studio-xkxetm65.js → studio-eesyjg7h.js} +5 -5
  79. package/dist/chunks/studio-et6t8g4m.js +4 -0
  80. package/dist/chunks/{studio-cpkamjdn.js → studio-f2j9et3h.js} +8 -8
  81. package/dist/chunks/{studio-epenqmvk.js → studio-fep7hr66.js} +4 -4
  82. package/dist/chunks/{studio-2ks6ka4g.js → studio-fyf7j57j.js} +3 -3
  83. package/dist/chunks/{studio-rzg8hnkf.js → studio-g5prntab.js} +4 -4
  84. package/dist/chunks/{studio-c1pxszat.js → studio-ga77mf07.js} +4 -4
  85. package/dist/chunks/{studio-9cxmp61c.js → studio-ggm7zf70.js} +3 -3
  86. package/dist/chunks/studio-h7gy12h2.js +5 -0
  87. package/dist/chunks/{studio-9dz76yqc.js → studio-hsr3k06v.js} +5 -5
  88. package/dist/chunks/{studio-vzgmyt0v.js → studio-j933k8nr.js} +4 -4
  89. package/dist/chunks/studio-jgbvqcgh.js +5 -0
  90. package/dist/chunks/{studio-wxhy1yh7.js → studio-jh6t5qz4.js} +3 -3
  91. package/dist/chunks/{studio-88bmt9rh.js → studio-k4xc5g6h.js} +4 -4
  92. package/dist/chunks/{studio-wxdcd42g.js → studio-mwnmzx7g.js} +6 -6
  93. package/dist/chunks/{studio-1e8dw2w2.js → studio-nf0pqpbj.js} +4 -4
  94. package/dist/chunks/{studio-2j86y34y.js → studio-p0nf2e1f.js} +5 -5
  95. package/dist/chunks/{studio-k3bcy02e.js → studio-pd9dsqpq.js} +4 -4
  96. package/dist/chunks/{studio-agyvzfm4.js → studio-pmzg17fj.js} +4 -4
  97. package/dist/chunks/{studio-zg16eeq1.js → studio-pzfa2vmb.js} +4 -4
  98. package/dist/chunks/{studio-hy4ye0dx.js → studio-qyb5bebs.js} +7 -7
  99. package/dist/chunks/{studio-0ydxv2mr.js → studio-rf8d6p9f.js} +6 -6
  100. package/dist/chunks/{studio-45gyxpcq.js → studio-rt498t2v.js} +4 -4
  101. package/dist/chunks/studio-sd07xva5.js +6 -0
  102. package/dist/chunks/{studio-06j4en5h.js → studio-skynbac3.js} +2 -2
  103. package/dist/chunks/{studio-vswcpzk7.js → studio-t3j8htp7.js} +5 -5
  104. package/dist/chunks/{studio-3zge48z4.js → studio-thj81e98.js} +6 -6
  105. package/dist/chunks/{studio-ekgtrndg.js → studio-tpy3rdxn.js} +4 -4
  106. package/dist/chunks/{studio-ewarnzm4.js → studio-va0e63sk.js} +4 -4
  107. package/dist/chunks/{studio-gr36vnte.js → studio-vcz63n42.js} +4 -4
  108. package/dist/chunks/studio-vffwe9k7.js +5 -0
  109. package/dist/chunks/{studio-7dzyz9n8.js → studio-vjhej0w5.js} +103 -103
  110. package/dist/chunks/{studio-hwejq03c.js → studio-vxjap704.js} +4 -4
  111. package/dist/chunks/{studio-03mqh8ax.js → studio-w67vfgy5.js} +2 -2
  112. package/dist/chunks/{studio-ajw4k8hp.js → studio-x2metr13.js} +3 -3
  113. package/dist/chunks/{studio-771k2n12.js → studio-xebavr9s.js} +4 -4
  114. package/dist/chunks/{studio-x08a3m0a.js → studio-yg5n49za.js} +4 -4
  115. package/dist/chunks/{studio-xh683qzy.js → studio-yhz5b313.js} +4 -4
  116. package/dist/chunks/{studio-fy7jzj9j.js → studio-zacvfm31.js} +4 -4
  117. package/dist/chunks/{studio-zkq3r91p.js → studio-zsjpsw08.js} +4 -4
  118. package/dist/chunks/{studio-2hsqbq7b.js → studio-zxm98z2m.js} +6 -6
  119. package/dist/chunks/{tsMode-h6tkz0ea.js → tsMode-6vwhy6ty.js} +5 -5
  120. package/dist/chunks/workspace-d65bz1qk.js +4 -0
  121. package/dist/chunks/workspace-home-vbg9b3jh.js +4 -0
  122. package/dist/chunks/{ws-client-e951my95.js → ws-client-zcxkfgmf.js} +3 -3
  123. package/dist/manifest.json +71 -71
  124. package/dist/studio.js +73 -70
  125. package/package.json +4 -4
  126. package/src/platform-errors.ts +17 -1
  127. package/src/platforms/cloud.ts +14 -0
  128. package/src/publish/publish-changes.ts +136 -4
  129. package/src/types.ts +14 -0
  130. package/dist/chunks/adapter-wc5zvg9a.js +0 -4
  131. package/dist/chunks/cf-settings-hp1pjm0n.js +0 -4
  132. package/dist/chunks/components-nkwphrx3.js +0 -4
  133. package/dist/chunks/content-source-6a253wmk.js +0 -4
  134. package/dist/chunks/editor-wqrc68ca.js +0 -4
  135. package/dist/chunks/entry-commands-nef0wrmp.js +0 -4
  136. package/dist/chunks/file-ops-y3w71k1n.js +0 -4
  137. package/dist/chunks/files-de90apn9.js +0 -4
  138. package/dist/chunks/fs-events-77c0mr0x.js +0 -4
  139. package/dist/chunks/grid-open-4n4fjfpf.js +0 -4
  140. package/dist/chunks/index-ewmgdb7c.js +0 -4
  141. package/dist/chunks/jx-validate-b309c020.js +0 -4
  142. package/dist/chunks/layers-8rn8y6qv.js +0 -4
  143. package/dist/chunks/layers-panel-eyah7h9z.js +0 -4
  144. package/dist/chunks/lit-html-wyqw04y2.js +0 -4
  145. package/dist/chunks/media-library-gs3np47y.js +0 -4
  146. package/dist/chunks/media-picker-tt7dk4tb.js +0 -4
  147. package/dist/chunks/monaco-buffer-wsf6cmnq.js +0 -4
  148. package/dist/chunks/notify-qwst108r.js +0 -4
  149. package/dist/chunks/parse-n8dfxnqf.js +0 -4
  150. package/dist/chunks/publish-panel-d34bhvwj.js +0 -4
  151. package/dist/chunks/publish-workspace-2yr60mt4.js +0 -4
  152. package/dist/chunks/quick-search-e6xsdv0d.js +0 -4
  153. package/dist/chunks/references-gsj6trdv.js +0 -4
  154. package/dist/chunks/right-panel-33jv1knc.js +0 -4
  155. package/dist/chunks/source-control-bj9bejjv.js +0 -4
  156. package/dist/chunks/studio-38g0jdz7.js +0 -5
  157. package/dist/chunks/studio-dbxv7w4s.js +0 -5
  158. package/dist/chunks/studio-psh8mwnw.js +0 -4
  159. package/dist/chunks/studio-v9ywz2se.js +0 -6
  160. package/dist/chunks/studio-yx8hzqja.js +0 -5
  161. package/dist/chunks/workspace-home-zkkrxq3r.js +0 -4
  162. package/dist/chunks/workspace-tdqqjqaa.js +0 -4
@@ -1,9 +1,9 @@
1
- import{p,_e}from"./studio-03mqh8ax.js";import{te}from"./studio-psh8mwnw.js";import{ge,Qs,ne,g}from"./studio-4kzbrr5t.js";import{ln,wx,Yl,Bi,Un,Y,qd,m,jt}from"./studio-vzgmyt0v.js";import{Ev}from"./studio-3w35qvay.js";import{Lo}from"./studio-ry81j4q1.js";import{us}from"./studio-k3bcy02e.js";import{Js,nn,Rp}from"./studio-x3mjr5cc.js";import{tr}from"./studio-34jrz12k.js";import{Id,Cs,gp,jl,Rc}from"./studio-wxdcd42g.js";import{ae}from"./studio-cpkamjdn.js";import{wi,T,R}from"./studio-jttyqrmh.js";import{yr,Yu,$S,Tb,di,Vl}from"./studio-pqqq6v85.js";import{er,ZD}from"./studio-c1pxszat.js";import{Fl,mp}from"./studio-fy7jzj9j.js";import{ya,Ic,FD,jD}from"./studio-d038kqbs.js";import{xp}from"./studio-732mw0g8.js";import{S}from"./studio-45gyxpcq.js";import{Se}from"./studio-ekgtrndg.js";import{n,Z,Ze,_,v}from"./studio-zkq3r91p.js";import{le}from"./studio-7xag4na8.js";var he=["title","name","label","heading"];function hp(e,t={}){let r=(i)=>{for(let o of he){let s=i.find((a)=>a.toLowerCase()===o);if(s!==void 0)return s}return null};return r(Object.keys(e?.properties??{}))??r(Object.keys(t).filter((i)=>n(t[i])))}function j(e){if(e instanceof Date)return rb(e);if(n(e))return e;if(Z(e)||Ze(e))return String(e);if(Array.isArray(e))return e.filter((t)=>n(t)||Z(t)).map(String).join(", ");return""}function be(e,t){return Object.fromEntries(Object.keys(e?.properties??{}).filter((r)=>(r in t)).map((r)=>[r,j(t[r])]))}var xe=["date","published","publishedAt","pubDate","publishDate"];function V_(e,t){for(let[r,i]of Object.entries(e?.properties??{}))if(i.format==="date"||i.format==="date-time")return r;return xe.find((r)=>(r in t))??null}function yE(e){let t=e?.properties??{};return V_(e,Object.fromEntries(Object.keys(t).map((r)=>[r,""])))}function rb(e){if(e instanceof Date)return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,10);if(!n(e))return"";let t=/^(\d{4}-\d{2}-\d{2})/.exec(e.trim());if(t)return t[1];let r=new Date(e);if(e.trim()===""||Number.isNaN(r.getTime()))return"";if(!e.includes(":")){let i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${r.getFullYear()}-${i}-${o}`}return r.toISOString().slice(0,10)}function P(e){let t=e.split("/").pop()??e,r=t.lastIndexOf(".");return r>0?t.slice(0,r):t}function B(e,t){if(t.startsWith("/"))return`public${t}`;let r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",i=[...r===""?[]:r.split("/"),...t.split("/")],o=[];for(let s of i){if(s===""||s===".")continue;if(s==="..")o.pop();else o.push(s)}return o.join("/")}var W=/^[a-z][\d+.a-z-]*:/i;function Ee(e,t){let r=t.trim();if(r==="")return"";return W.test(r)?r:tr(B(e,r))}function q(e){if(n(e))return e.split(",")[0]?.trim()??"";if(Array.isArray(e)){let[t]=e;return t===void 0?"":q(t)}if(v(e)){let{src:t}=e;return n(t)?t:""}return""}function U(e){if(e.format==="image")return!0;let t=e.properties?.src;if(e.type==="object"&&t?.type==="string")return!0;return e.type==="array"&&e.items!==void 0&&U(e.items)}function wE(e,t,r){for(let[i,o]of Object.entries(r?.properties??{}))if(U(o)){let s=Ee(e,q(t[i]));if(s!=="")return s}for(let i of Object.values(t)){if(!n(i)||W.test(i))continue;let o=i.lastIndexOf(".");if(o>0&&Rp(i.slice(o)))return tr(B(e,i))}return""}function X(e,t,r){let i=ya(t)?.schema??null,o=hp(i,r),s=o===null?void 0:r[o],a=jl(r),l=V_(i,r);return{date:l===null?"":rb(r[l]),fields:be(i,r),path:e,status:Rc(i,r)?a?"Draft":"Published":"",thumb:wE(e,r,i),title:n(s)&&s.trim()!==""?s:P(e)}}async function we(e){try{let t=await p().readFile(e);if(e.endsWith(".json")){let o=JSON.parse(t);return _(o)&&!Array.isArray(o)?o:{}}let{parseSourceForPath:r}=await (le("y3w71k1n"),import("./file-ops-y3w71k1n.js"));return(await r(e,t)).frontmatter}catch{return{}}}var E=new Map,x=new Map,N=0,F=new Set,K=200;async function Fe(e,t){let r=t.slice(0,K),i=await Promise.all(r.map(async(s)=>X(s,e,await we(s)))),o=t.slice(K).map((s)=>({date:"",path:s,status:"",thumb:"",title:P(s)}));return[...i,...o]}function ow(e,t){let r=t.join(`
1
+ import{p,_e}from"./studio-w67vfgy5.js";import{ee}from"./studio-et6t8g4m.js";import{ge,ea,ne,g}from"./studio-ahf3cspq.js";import{ln,wx,Yl,Bi,Un,Y,Gd,m,jt}from"./studio-j933k8nr.js";import{Ev}from"./studio-848rk4p1.js";import{Lo}from"./studio-4nkm4404.js";import{us}from"./studio-pd9dsqpq.js";import{Ys,nn,Rp}from"./studio-5dmgmyw4.js";import{tr}from"./studio-20ap8dds.js";import{Rd,Cs,gp,jl,Dc}from"./studio-mwnmzx7g.js";import{ae}from"./studio-f2j9et3h.js";import{xi,T,R}from"./studio-cvz0e00f.js";import{yr,Yu,$S,Tb,ui,Vl}from"./studio-695k95bw.js";import{er,ZD}from"./studio-ga77mf07.js";import{Fl,mp}from"./studio-zacvfm31.js";import{wa,Rc,FD,jD}from"./studio-56egy6vf.js";import{xp}from"./studio-732mw0g8.js";import{S}from"./studio-rt498t2v.js";import{Se}from"./studio-tpy3rdxn.js";import{n,Z,Ze,_,v}from"./studio-zsjpsw08.js";import{le}from"./studio-0g2sm01j.js";var he=["title","name","label","heading"];function hp(e,t={}){let r=(i)=>{for(let o of he){let s=i.find((a)=>a.toLowerCase()===o);if(s!==void 0)return s}return null};return r(Object.keys(e?.properties??{}))??r(Object.keys(t).filter((i)=>n(t[i])))}function j(e){if(e instanceof Date)return rb(e);if(n(e))return e;if(Z(e)||Ze(e))return String(e);if(Array.isArray(e))return e.filter((t)=>n(t)||Z(t)).map(String).join(", ");return""}function be(e,t){return Object.fromEntries(Object.keys(e?.properties??{}).filter((r)=>(r in t)).map((r)=>[r,j(t[r])]))}var xe=["date","published","publishedAt","pubDate","publishDate"];function V_(e,t){for(let[r,i]of Object.entries(e?.properties??{}))if(i.format==="date"||i.format==="date-time")return r;return xe.find((r)=>(r in t))??null}function yE(e){let t=e?.properties??{};return V_(e,Object.fromEntries(Object.keys(t).map((r)=>[r,""])))}function rb(e){if(e instanceof Date)return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,10);if(!n(e))return"";let t=/^(\d{4}-\d{2}-\d{2})/.exec(e.trim());if(t)return t[1];let r=new Date(e);if(e.trim()===""||Number.isNaN(r.getTime()))return"";if(!e.includes(":")){let i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${r.getFullYear()}-${i}-${o}`}return r.toISOString().slice(0,10)}function P(e){let t=e.split("/").pop()??e,r=t.lastIndexOf(".");return r>0?t.slice(0,r):t}function B(e,t){if(t.startsWith("/"))return`public${t}`;let r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",i=[...r===""?[]:r.split("/"),...t.split("/")],o=[];for(let s of i){if(s===""||s===".")continue;if(s==="..")o.pop();else o.push(s)}return o.join("/")}var W=/^[a-z][\d+.a-z-]*:/i;function Ee(e,t){let r=t.trim();if(r==="")return"";return W.test(r)?r:tr(B(e,r))}function q(e){if(n(e))return e.split(",")[0]?.trim()??"";if(Array.isArray(e)){let[t]=e;return t===void 0?"":q(t)}if(v(e)){let{src:t}=e;return n(t)?t:""}return""}function U(e){if(e.format==="image")return!0;let t=e.properties?.src;if(e.type==="object"&&t?.type==="string")return!0;return e.type==="array"&&e.items!==void 0&&U(e.items)}function wE(e,t,r){for(let[i,o]of Object.entries(r?.properties??{}))if(U(o)){let s=Ee(e,q(t[i]));if(s!=="")return s}for(let i of Object.values(t)){if(!n(i)||W.test(i))continue;let o=i.lastIndexOf(".");if(o>0&&Rp(i.slice(o)))return tr(B(e,i))}return""}function X(e,t,r){let i=wa(t)?.schema??null,o=hp(i,r),s=o===null?void 0:r[o],a=jl(r),l=V_(i,r);return{date:l===null?"":rb(r[l]),fields:be(i,r),path:e,status:Dc(i,r)?a?"Draft":"Published":"",thumb:wE(e,r,i),title:n(s)&&s.trim()!==""?s:P(e)}}async function we(e){try{let t=await p().readFile(e);if(e.endsWith(".json")){let o=JSON.parse(t);return _(o)&&!Array.isArray(o)?o:{}}let{parseSourceForPath:r}=await (le("13ab4swj"),import("./file-ops-13ab4swj.js"));return(await r(e,t)).frontmatter}catch{return{}}}var E=new Map,x=new Map,N=0,F=new Set,K=200;async function Fe(e,t){let r=t.slice(0,K),i=await Promise.all(r.map(async(s)=>X(s,e,await we(s)))),o=t.slice(K).map((s)=>({date:"",path:s,status:"",thumb:"",title:P(s)}));return[...i,...o]}function ow(e,t){let r=t.join(`
2
2
  `),i=E.get(e);if(i?.key===r)return i.entries;if(!_e())return t.map((s)=>({date:"",path:s,status:"",thumb:"",title:P(s)}));let o=`${e}
3
- ${r}`;if(!x.has(o)){let s=N,a=Fe(e,t).then((l)=>{if(x.get(o)===a)x.delete(o);if(s===N){E.set(e,{entries:l,key:r});for(let c of F)c()}return l});x.set(o,a)}return null}function Le(e,t,r){let i=E.get(t),o=i?.entries.findIndex((a)=>a.path===e)??-1;if(!i||o===-1)return!1;let s=i.entries.with(o,X(e,t,r));E.set(t,{entries:s,key:i.key});for(let a of F)a();return!0}function hD(e,t){let r=Vl(e);if(e===null||r===null||r===di)return!1;return Le(e,r,t)}function xE(){N+=1,E.clear(),x.clear()}function rw(e){return F.add(e),()=>{F.delete(e)}}var ve=/^\d{4}-\d{2}-\d{2}/,y="entry",b=g(new Map);function O(e){let t=b.get(e.id);if(t===void 0)return null;if("key"in t)return t.key;return er(e)?.state.rows[t.row]?.key??null}function Ce(e){return b.has(e.id)}function k(e,t){b.set(e.id,{key:t})}function Te(e){b.delete(e.id)}function h(e){return Ce(e)&&er(e)!==null}function Q(e){let t=er(e),r=O(e);if(!t||r===null)return{};let i={};for(let o of t.state.columns){let s=t.buffer.effectiveValue(r,o.field);if(s===null||s==="")continue;if(o.kind==="date"&&n(s)&&!ve.test(s)){i[o.field]=rb(s)||s;continue}i[o.field]=_(s)&&!Array.isArray(s)?s.$ref:s}return i}function Re(e){if(e===void 0||e===null)return null;if(Array.isArray(e))return e.map((t)=>n(t)?t:JSON.stringify(t));if(n(e)||Z(e)||Ze(e))return e;return JSON.stringify(e)}function A(e,t){let r=er(e),i=O(e);if(!r||i===null)return;let o=new Set(r.state.columns.map((s)=>s.field));r.buffer.group(()=>{for(let[s,a]of Object.entries(t))if(o.has(s))r.buffer.setCell(i,s,Re(a))})}function w(e){let t=er(e),r=O(e),i=t?.state.rows??[],o=r===null?-1:i.findIndex((s)=>s.key===r);return{index:o,next:o===-1?null:i[o+1]?.key??null,previous:o<=0?null:i[o-1]?.key??null,total:i.length}}async function pD(e,t){let{openFileInTab:r}=await (le("de90apn9"),import("./files-de90apn9.js"));await r(e);let i=m.tabs.get(e)??null;if(!i||!er(i))return i;if(!b.has(i.id))i.scope.run(()=>{Qs(()=>Te(i))});if(b.set(i.id,{row:t}),!i.capabilities.modes.includes(y))i.capabilities.modes.unshift(y);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,jt(i.id),i}function ee(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Pl(e){if(h(e))return Q(e);return ee(e)?e.doc.document:e.doc.content.frontmatter}function De(e,t,r){let i=e.doc.document,o=Object.hasOwn(i,t)?Se(i[t]):void 0,s=r===void 0||r===null||r==="";if(s)delete i[t];else i[t]=r;let a=s?void 0:Se(r);Bi({forward:{key:t,op:"set-key",path:[],value:a},inverse:{key:t,op:"set-key",path:[],value:o}}),e.doc.dirty=!0,ZD()}function I(e,t,r){if(h(e))A(e,{[t]:r});else if(ee(e))De(e,t,r);else qd(e,t,r)}function U_(e,t){if(h(e)){A(e,t);return}Y(e,(r)=>{for(let[i,o]of Object.entries(t))I(r,i,o)})}var re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="record-nav"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"record-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/recordNav"},cases:{shown:{$description:"A record of a file-backed collection (a CSV row): which row of the file this is, the rows either side of it, and the grid that shows them all. A file entry has no neighbours to step to, so it draws none of this.",tagName:"div",attributes:{part:"record-nav",role:"group","aria-label":"Records"},children:[{tagName:"jx-action-button",attributes:{part:"previous"},$props:{size:"sm",quiet:!0,label:"Previous record",hint:"Previous record",disabled:{$ref:"#/state/previousDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showPrevious"},value:[]}]},children:[{tagName:"span",textContent:"‹ Previous"}]},{tagName:"span",attributes:{part:"place"},textContent:"${state.place}"},{tagName:"jx-action-button",attributes:{part:"next"},$props:{size:"sm",quiet:!0,label:"Next record",hint:"Next record",disabled:{$ref:"#/state/nextDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showNext"},value:[]}]},children:[{tagName:"span",textContent:"Next ›"}]},{tagName:"jx-action-button",attributes:{part:"grid"},$props:{size:"sm",quiet:!0,label:"Edit in grid",hint:"Every record of the file, as a table"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}]},children:[{tagName:"span",textContent:"Edit in grid"}]}]}}},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",re);function ie(e,t){e.region=t.region,e.fieldsRegion=t.fieldsRegion,e.stage=t.stage,e.name=t.name,e.collection=t.collection,e.draftAxis=t.draftAxis,e.draft=t.draft,e.draftHint=t.draftHint,e.noteState=t.noteState,e.note=t.note,e.emptyLine=t.emptyLine,e.recordNav=t.recordNav,e.place=t.place,e.previousDisabled=t.previousDisabled,e.nextDisabled=t.nextDisabled}function je(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function oe(e,t,r,i){e.replaceChildren();let o=g({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",nextDisabled:!0,note:"",noteState:"hidden",openContentTypes:r.openContentTypes,openGrid:r.openGrid,place:"",previousDisabled:!0,recordNav:"hidden",region:"",setDraft:r.setDraft,showNext:r.showNext,showPrevious:r.showPrevious,stage:"empty"});ie(o,t);let s=null,a=!1,l=R("entry-editor",o,e,{onNodeCreated:(c,d,f)=>{if(c instanceof HTMLElement&&je(f)==="fields")i.fieldsSlot(c)}}).then((c)=>{let d=c.root;if(a)return c.dispose(),d;return s=c,d});return{attached:()=>{if(a)return!1;let c=s?.root;return c===void 0?!0:c instanceof HTMLElement&&e.contains(c)},dispose(){a=!0,s?.dispose(),s=null},ready:l,update:(c)=>ie(o,c)}}var H=g(new Map);function se(e,t){H.set(e,t)}function fD(e){return e?H.get(e):void 0}function mD(e){H.delete(e)}function M(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"").replace(/\/+$/,"")}function Pe(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function ce(e,t){let r=[];for(let s of e)r.push(M(s));let i=[],o=t?.content??{};for(let s of Object.values(o)){if(!n(s.source)||s.source===""||Pe(s.source))continue;let a=M(s.source),l=a.indexOf(Lo);if(l!==-1)a=M(a.slice(0,l));if(a===""||a===".")continue;if(![...r,...i].some((d)=>a===d||a.startsWith(`${d}/`)))i.push(a)}return i.length===0?e:[...e,...i]}function Oe(e,t){let r=Vl(e);if(r===null)return null;if(r===di)return t===void 0||Yu(e,t)?r:null;let i=Un(e);if(!i||i.name!==r||!i.def.format||i.ext===null)return r;return e.toLowerCase().endsWith(i.ext.toLowerCase())?r:null}var ke=new Set(["node_modules",".git",".jx",".cache"]);async function de(e,t,r,i,o,s=!1,a){let l;try{l=await us(()=>t.listDirectory(e))}catch(d){if(!s)i.push({dir:e,error:te(d)});return}let c=[];for(let d of l){if(d.type==="directory"){if(!ke.has(d.name))c.push(d.path);continue}let f=nn(d.name);r.push({collection:Oe(d.path,a),ext:f,locale:wx(d.path,o)??void 0,media:Js.has(f),modified:d.modified,name:d.name,path:d.path,size:d.size,type:f||"file"})}await Promise.all(c.map((d)=>de(d,t,r,i,o,!1,a)))}async function cm(e,t,r=new Set,i){let o=[],s=[],{i18n:a}=ln(S?.projectConfig??{});return await Promise.all(e.map((l)=>de(l,t,o,s,a,r.has(l),i))),o.sort((l,c)=>l.path.localeCompare(c.path)),{failures:s,files:o}}function _E(e,t){let r=e.filter((s)=>s.collection===t.collection),i=t.query.trim().toLowerCase();if(i)r=r.filter((s)=>s.name.toLowerCase().includes(i)||s.path.toLowerCase().includes(i));let o=t.locale?.trim();if(o)r=r.filter((s)=>s.locale===o);return r}var dm=["table","cards","calendar","board"],sw={board:"Board",calendar:"Calendar",cards:"Cards",table:"Table"};var gD=new Set(["cards"]),Ae=/^(\d{4}-\d{2}-\d{2})/;function SE(e){let t=Ae.exec(e.name);if(t)return t[1];if(e.modified){let r=xp(new Date(e.modified));if(r)return r}return null}function sb(){return ln(S?.projectConfig??{}).i18n?.locales??[]}function bD(e){let t=new Set;for(let r of e)if(r.locale)t.add(r.locale);return sb().filter((r)=>t.has(r))}function vD(e,t=SE){let r=new Map,i=[];for(let s of e){let a=t(s);if(a===null){i.push(s);continue}let l=r.get(a);if(l)l.push(s);else r.set(a,[s])}return{days:[...r.entries()].map(([s,a])=>({date:s,files:a})).toSorted((s,a)=>a.date.localeCompare(s.date)),undated:i}}function $e(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function yD(e){let t=new Map;for(let r of e){let i=$e(r.path),o=t.get(i);if(o)o.push(r);else t.set(i,[r])}return[...t.entries()].map(([r,i])=>({files:i,group:r})).toSorted((r,i)=>r.group.localeCompare(i.group))}function Ie(e,t,r,i){let o=hp(e,t),s=o===null?"":t[o]??"",a=Object.values(t).find((l)=>l.trim()!=="");return(s||a||i||`Row ${r+1}`).trim()}function He(e){let{headers:t,rows:r}=Id(e);return r.flatMap((i,o)=>i.some((s)=>s.trim()!=="")?[{fields:Object.fromEntries(t.map((s,a)=>[s,i[a]??""])),row:o}]:[])}function Me(e){let t;try{t=JSON.parse(e)}catch{return null}let r=(i)=>_(i)&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).map(([o,s])=>[o,j(s)])):{};if(!Array.isArray(t))return[{fields:r(t),row:0,single:!0}];return t.map((i,o)=>({fields:r(i),row:o}))}function ue(e,t,r){let i=e.toLowerCase(),o=i.endsWith(".csv")?He(t):i.endsWith(".json")?Me(t):null;if(o===null)return null;let s=(e.split("/").pop()??e).replace(/\.[^.]+$/,"");return o.map(({fields:a,row:l,single:c},d)=>({fields:a,index:d,row:l,title:Ie(r,a,d,c?s:"")}))}function fe(e,t){return`${e}#${t+1}`}var G="The Content workspace lists files; it does not edit them in the list. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ge(e){return`field:${e}`}function wD(e){return e.startsWith("field:")?e.slice(6):null}var Ve=6,me=new Set(["image","markdown","html","richtext"]);function V(e){return Tb($S(e))}function xD(e,t){return Object.entries(e?.properties??{}).filter(([r,i])=>{if(t.has(r)||r===Cs)return!1;if(i.type==="object"||n(i.format)&&me.has(i.format))return!1;let o=i.items?.format;return i.type!=="array"||i.items?.type==="string"&&!(n(o)&&me.has(o))}).slice(0,Ve).map(([r,i])=>{let o={name:r,title:V(r)};if(i.type==="array")o.list=!0;if(i.type==="number"||i.type==="integer"||i.format==="date"||i.format==="date-time")o.measure=!0;return o})}function Je(e){let t=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:240},{editable:!1,field:"url",kind:"string",pk:!0,title:"URL",widthHint:200},{editable:!1,field:"template",kind:"string",title:"Template",widthHint:140}];if(e?.status)t.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(e?.locale)t.push({editable:!1,field:"locale",kind:"string",title:"Language",widthHint:110});return t.push({editable:!1,field:"modified",kind:"date",title:"Edited",widthHint:120}),t}function CE(e=di,t){let r=[...t?.locale?[{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90}]:[],{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}];if(e===di)return Je(t);let i=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:260}];if(t?.status)i.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(t?.date)i.push({editable:!1,field:"date",kind:"date",title:"Date",widthHint:120});for(let o of t?.fields??[])i.push({editable:!1,field:Ge(o.name),kind:"string",title:o.title,widthHint:140});return[...i,...r]}function ze(e){return{cells:{locale:e.locale??null,modified:e.modified??null,status:null,template:null,title:e.name,url:e.collection===di?yr(e.path).urlPattern:null},key:e.path}}async function Ke(e,t){return(await Promise.all(e.map(async(i)=>{let o=i.collection===null?null:Un(i.path);if(!o?.fileBacked)return[i];let s;try{s=await t(i.path)}catch{return[i]}let a=ue(i.path,s,o.def.schema);if(a===null)return[i];return a.map((l)=>Ye(i,l))}))).flat()}function Ye(e,t){return{...e,name:t.title,path:fe(e.path,t.index),record:{fields:t.fields,row:t.row,source:e.path}}}async function Be(e){let t=p(),r=await Ke(e.files,(i)=>t.readFile(i));return{...e,files:r}}function _D(e){let t=null,r=null,i=null,o=e??(()=>ce(S?.projectDirs??[],S?.projectConfig??null));async function s(){if(t)return t;let a=o(),l=new Set(e?a:S?.projectDirs??[]),c=new Set(a.filter((d)=>!l.has(d)));return r??=Ev().then((d)=>cm(a,p(),c,d)).then(Be).then((d)=>(t=d,i=a.join(`
3
+ ${r}`;if(!x.has(o)){let s=N,a=Fe(e,t).then((l)=>{if(x.get(o)===a)x.delete(o);if(s===N){E.set(e,{entries:l,key:r});for(let c of F)c()}return l});x.set(o,a)}return null}function Le(e,t,r){let i=E.get(t),o=i?.entries.findIndex((a)=>a.path===e)??-1;if(!i||o===-1)return!1;let s=i.entries.with(o,X(e,t,r));E.set(t,{entries:s,key:i.key});for(let a of F)a();return!0}function hD(e,t){let r=Vl(e);if(e===null||r===null||r===ui)return!1;return Le(e,r,t)}function xE(){N+=1,E.clear(),x.clear()}function rw(e){return F.add(e),()=>{F.delete(e)}}var ve=/^\d{4}-\d{2}-\d{2}/,y="entry",b=g(new Map);function O(e){let t=b.get(e.id);if(t===void 0)return null;if("key"in t)return t.key;return er(e)?.state.rows[t.row]?.key??null}function Ce(e){return b.has(e.id)}function k(e,t){b.set(e.id,{key:t})}function Te(e){b.delete(e.id)}function h(e){return Ce(e)&&er(e)!==null}function Q(e){let t=er(e),r=O(e);if(!t||r===null)return{};let i={};for(let o of t.state.columns){let s=t.buffer.effectiveValue(r,o.field);if(s===null||s==="")continue;if(o.kind==="date"&&n(s)&&!ve.test(s)){i[o.field]=rb(s)||s;continue}i[o.field]=_(s)&&!Array.isArray(s)?s.$ref:s}return i}function Re(e){if(e===void 0||e===null)return null;if(Array.isArray(e))return e.map((t)=>n(t)?t:JSON.stringify(t));if(n(e)||Z(e)||Ze(e))return e;return JSON.stringify(e)}function A(e,t){let r=er(e),i=O(e);if(!r||i===null)return;let o=new Set(r.state.columns.map((s)=>s.field));r.buffer.group(()=>{for(let[s,a]of Object.entries(t))if(o.has(s))r.buffer.setCell(i,s,Re(a))})}function w(e){let t=er(e),r=O(e),i=t?.state.rows??[],o=r===null?-1:i.findIndex((s)=>s.key===r);return{index:o,next:o===-1?null:i[o+1]?.key??null,previous:o<=0?null:i[o-1]?.key??null,total:i.length}}async function pD(e,t){let{openFileInTab:r}=await (le("zbc8p6v1"),import("./files-zbc8p6v1.js"));await r(e);let i=m.tabs.get(e)??null;if(!i||!er(i))return i;if(!b.has(i.id))i.scope.run(()=>{ea(()=>Te(i))});if(b.set(i.id,{row:t}),!i.capabilities.modes.includes(y))i.capabilities.modes.unshift(y);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,jt(i.id),i}function te(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Pl(e){if(h(e))return Q(e);return te(e)?e.doc.document:e.doc.content.frontmatter}function De(e,t,r){let i=e.doc.document,o=Object.hasOwn(i,t)?Se(i[t]):void 0,s=r===void 0||r===null||r==="";if(s)delete i[t];else i[t]=r;let a=s?void 0:Se(r);Bi({forward:{key:t,op:"set-key",path:[],value:a},inverse:{key:t,op:"set-key",path:[],value:o}}),e.doc.dirty=!0,ZD()}function I(e,t,r){if(h(e))A(e,{[t]:r});else if(te(e))De(e,t,r);else Gd(e,t,r)}function U_(e,t){if(h(e)){A(e,t);return}Y(e,(r)=>{for(let[i,o]of Object.entries(t))I(r,i,o)})}var re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="record-nav"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"record-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/recordNav"},cases:{shown:{$description:"A record of a file-backed collection (a CSV row): which row of the file this is, the rows either side of it, and the grid that shows them all. A file entry has no neighbours to step to, so it draws none of this.",tagName:"div",attributes:{part:"record-nav",role:"group","aria-label":"Records"},children:[{tagName:"jx-action-button",attributes:{part:"previous"},$props:{size:"sm",quiet:!0,label:"Previous record",hint:"Previous record",disabled:{$ref:"#/state/previousDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showPrevious"},value:[]}]},children:[{tagName:"span",textContent:"‹ Previous"}]},{tagName:"span",attributes:{part:"place"},textContent:"${state.place}"},{tagName:"jx-action-button",attributes:{part:"next"},$props:{size:"sm",quiet:!0,label:"Next record",hint:"Next record",disabled:{$ref:"#/state/nextDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showNext"},value:[]}]},children:[{tagName:"span",textContent:"Next ›"}]},{tagName:"jx-action-button",attributes:{part:"grid"},$props:{size:"sm",quiet:!0,label:"Edit in grid",hint:"Every record of the file, as a table"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}]},children:[{tagName:"span",textContent:"Edit in grid"}]}]}}},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",re);function ie(e,t){e.region=t.region,e.fieldsRegion=t.fieldsRegion,e.stage=t.stage,e.name=t.name,e.collection=t.collection,e.draftAxis=t.draftAxis,e.draft=t.draft,e.draftHint=t.draftHint,e.noteState=t.noteState,e.note=t.note,e.emptyLine=t.emptyLine,e.recordNav=t.recordNav,e.place=t.place,e.previousDisabled=t.previousDisabled,e.nextDisabled=t.nextDisabled}function je(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function oe(e,t,r,i){e.replaceChildren();let o=g({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",nextDisabled:!0,note:"",noteState:"hidden",openContentTypes:r.openContentTypes,openGrid:r.openGrid,place:"",previousDisabled:!0,recordNav:"hidden",region:"",setDraft:r.setDraft,showNext:r.showNext,showPrevious:r.showPrevious,stage:"empty"});ie(o,t);let s=null,a=!1,l=R("entry-editor",o,e,{onNodeCreated:(c,d,f)=>{if(c instanceof HTMLElement&&je(f)==="fields")i.fieldsSlot(c)}}).then((c)=>{let d=c.root;if(a)return c.dispose(),d;return s=c,d});return{attached:()=>{if(a)return!1;let c=s?.root;return c===void 0?!0:c instanceof HTMLElement&&e.contains(c)},dispose(){a=!0,s?.dispose(),s=null},ready:l,update:(c)=>ie(o,c)}}var H=g(new Map);function se(e,t){H.set(e,t)}function fD(e){return e?H.get(e):void 0}function mD(e){H.delete(e)}function M(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"").replace(/\/+$/,"")}function Pe(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function ce(e,t){let r=[];for(let s of e)r.push(M(s));let i=[],o=t?.content??{};for(let s of Object.values(o)){if(!n(s.source)||s.source===""||Pe(s.source))continue;let a=M(s.source),l=a.indexOf(Lo);if(l!==-1)a=M(a.slice(0,l));if(a===""||a===".")continue;if(![...r,...i].some((d)=>a===d||a.startsWith(`${d}/`)))i.push(a)}return i.length===0?e:[...e,...i]}function Oe(e,t){let r=Vl(e);if(r===null)return null;if(r===ui)return t===void 0||Yu(e,t)?r:null;let i=Un(e);if(!i||i.name!==r||!i.def.format||i.ext===null)return r;return e.toLowerCase().endsWith(i.ext.toLowerCase())?r:null}var ke=new Set(["node_modules",".git",".jx",".cache"]);async function de(e,t,r,i,o,s=!1,a){let l;try{l=await us(()=>t.listDirectory(e))}catch(d){if(!s)i.push({dir:e,error:ee(d)});return}let c=[];for(let d of l){if(d.type==="directory"){if(!ke.has(d.name))c.push(d.path);continue}let f=nn(d.name);r.push({collection:Oe(d.path,a),ext:f,locale:wx(d.path,o)??void 0,media:Ys.has(f),modified:d.modified,name:d.name,path:d.path,size:d.size,type:f||"file"})}await Promise.all(c.map((d)=>de(d,t,r,i,o,!1,a)))}async function cm(e,t,r=new Set,i){let o=[],s=[],{i18n:a}=ln(S?.projectConfig??{});return await Promise.all(e.map((l)=>de(l,t,o,s,a,r.has(l),i))),o.sort((l,c)=>l.path.localeCompare(c.path)),{failures:s,files:o}}function _E(e,t){let r=e.filter((s)=>s.collection===t.collection),i=t.query.trim().toLowerCase();if(i)r=r.filter((s)=>s.name.toLowerCase().includes(i)||s.path.toLowerCase().includes(i));let o=t.locale?.trim();if(o)r=r.filter((s)=>s.locale===o);return r}var dm=["table","cards","calendar","board"],sw={board:"Board",calendar:"Calendar",cards:"Cards",table:"Table"};var gD=new Set(["cards"]),Ae=/^(\d{4}-\d{2}-\d{2})/;function SE(e){let t=Ae.exec(e.name);if(t)return t[1];if(e.modified){let r=xp(new Date(e.modified));if(r)return r}return null}function sb(){return ln(S?.projectConfig??{}).i18n?.locales??[]}function bD(e){let t=new Set;for(let r of e)if(r.locale)t.add(r.locale);return sb().filter((r)=>t.has(r))}function vD(e,t=SE){let r=new Map,i=[];for(let s of e){let a=t(s);if(a===null){i.push(s);continue}let l=r.get(a);if(l)l.push(s);else r.set(a,[s])}return{days:[...r.entries()].map(([s,a])=>({date:s,files:a})).toSorted((s,a)=>a.date.localeCompare(s.date)),undated:i}}function $e(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function yD(e){let t=new Map;for(let r of e){let i=$e(r.path),o=t.get(i);if(o)o.push(r);else t.set(i,[r])}return[...t.entries()].map(([r,i])=>({files:i,group:r})).toSorted((r,i)=>r.group.localeCompare(i.group))}function Ie(e,t,r,i){let o=hp(e,t),s=o===null?"":t[o]??"",a=Object.values(t).find((l)=>l.trim()!=="");return(s||a||i||`Row ${r+1}`).trim()}function He(e){let{headers:t,rows:r}=Rd(e);return r.flatMap((i,o)=>i.some((s)=>s.trim()!=="")?[{fields:Object.fromEntries(t.map((s,a)=>[s,i[a]??""])),row:o}]:[])}function Me(e){let t;try{t=JSON.parse(e)}catch{return null}let r=(i)=>_(i)&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).map(([o,s])=>[o,j(s)])):{};if(!Array.isArray(t))return[{fields:r(t),row:0,single:!0}];return t.map((i,o)=>({fields:r(i),row:o}))}function ue(e,t,r){let i=e.toLowerCase(),o=i.endsWith(".csv")?He(t):i.endsWith(".json")?Me(t):null;if(o===null)return null;let s=(e.split("/").pop()??e).replace(/\.[^.]+$/,"");return o.map(({fields:a,row:l,single:c},d)=>({fields:a,index:d,row:l,title:Ie(r,a,d,c?s:"")}))}function fe(e,t){return`${e}#${t+1}`}var G="The Content workspace lists files; it does not edit them in the list. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ge(e){return`field:${e}`}function wD(e){return e.startsWith("field:")?e.slice(6):null}var Ve=6,me=new Set(["image","markdown","html","richtext"]);function V(e){return Tb($S(e))}function xD(e,t){return Object.entries(e?.properties??{}).filter(([r,i])=>{if(t.has(r)||r===Cs)return!1;if(i.type==="object"||n(i.format)&&me.has(i.format))return!1;let o=i.items?.format;return i.type!=="array"||i.items?.type==="string"&&!(n(o)&&me.has(o))}).slice(0,Ve).map(([r,i])=>{let o={name:r,title:V(r)};if(i.type==="array")o.list=!0;if(i.type==="number"||i.type==="integer"||i.format==="date"||i.format==="date-time")o.measure=!0;return o})}function Je(e){let t=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:240},{editable:!1,field:"url",kind:"string",pk:!0,title:"URL",widthHint:200},{editable:!1,field:"template",kind:"string",title:"Template",widthHint:140}];if(e?.status)t.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(e?.locale)t.push({editable:!1,field:"locale",kind:"string",title:"Language",widthHint:110});return t.push({editable:!1,field:"modified",kind:"date",title:"Edited",widthHint:120}),t}function CE(e=ui,t){let r=[...t?.locale?[{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90}]:[],{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}];if(e===ui)return Je(t);let i=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:260}];if(t?.status)i.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(t?.date)i.push({editable:!1,field:"date",kind:"date",title:"Date",widthHint:120});for(let o of t?.fields??[])i.push({editable:!1,field:Ge(o.name),kind:"string",title:o.title,widthHint:140});return[...i,...r]}function ze(e){return{cells:{locale:e.locale??null,modified:e.modified??null,status:null,template:null,title:e.name,url:e.collection===ui?yr(e.path).urlPattern:null},key:e.path}}async function Ke(e,t){return(await Promise.all(e.map(async(i)=>{let o=i.collection===null?null:Un(i.path);if(!o?.fileBacked)return[i];let s;try{s=await t(i.path)}catch{return[i]}let a=ue(i.path,s,o.def.schema);if(a===null)return[i];return a.map((l)=>Ye(i,l))}))).flat()}function Ye(e,t){return{...e,name:t.title,path:fe(e.path,t.index),record:{fields:t.fields,row:t.row,source:e.path}}}async function Be(e){let t=p(),r=await Ke(e.files,(i)=>t.readFile(i));return{...e,files:r}}function _D(e){let t=null,r=null,i=null,o=e??(()=>ce(S?.projectDirs??[],S?.projectConfig??null));async function s(){if(t)return t;let a=o(),l=new Set(e?a:S?.projectDirs??[]),c=new Set(a.filter((d)=>!l.has(d)));return r??=Ev().then((d)=>cm(a,p(),c,d)).then(Be).then((d)=>(t=d,i=a.join(`
4
4
  `),r=null,d)),r}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(CE()),commit(a){return Promise.resolve({cells:a.cells.map((l)=>({error:G,field:l.field,ok:!1,rowKey:l.rowKey})),deletes:a.deletes.map((l)=>({error:G,ok:!1,rowKey:l.rowKey})),inserts:a.inserts.map((l)=>({error:G,ok:!1,tempKey:l.tempKey}))})},failures:()=>t?.failures??[],files:()=>t?.files??[],id:Yl("content"),label:"Content",async refresh(){t=null,r=null,await s()},async rows(){let a=await s();return{rows:a.files.map((l)=>ze(l)),total:a.files.length}},scanned:()=>t!==null,stale:()=>t!==null&&i!==o().join(`
5
- `)}}var We=[y],C=new Map;function J(e){return C.get(e)??null}function kE(e,t){let r=J(e);return r!==null&&r.tabId===t.id&&r.wrap.isConnected&&r.surface.attached()}function aw(e){let t=C.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),C.delete(e)}function ab(e,t){Y(e,(r)=>I(r,Cs,t))}function SD(e){let t=L(e),r=Pl(e);if(!t||!Rc(t.schema,r))return null;let i=jl(r);return{draft:i,text:i?"Draft":"Published",title:i?gp:"Not marked a draft."}}function EE(e){return Object.fromEntries(Object.entries(e?.properties??{}).map(([t,r])=>[t,{label:n(r.title)&&r.title!==""?r.title:V(t)}]))}function TE(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(t,r)=>mp(t,{projectConfig:S?.projectConfig??{},scope:r})}}function LE(e,t){return Object.fromEntries(jD(e.schema,t).map((r)=>[r,"Required — this entry does not have one."]))}function L(e){return h(e)?FD(e.documentPath):Ic(e.documentPath)}function $E(e,t,r){let i=hp(t,r),o=e.properties??{},s=i===null?void 0:o[i];if(i===null||s===void 0)return e;return{...e,properties:{[i]:s,...o}}}function qe(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function pe(e,t,r){let i=wi(e,"entry"),o=wi(e,"entry/fields");if(!r)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:gp,emptyLine:qe(t),fieldsRegion:o,name:"",nextDisabled:!0,note:"",noteState:"hidden",place:"",previousDisabled:!0,recordNav:"hidden",region:i,stage:"empty"};let s=Pl(t),a=jl(s),l=h(t),c=w(t);return{collection:r.name,draft:a,draftAxis:Rc(r.schema,s)?"shown":"hidden",draftHint:gp,emptyLine:"",fieldsRegion:o,name:l?Ue(r,s,c.index):t.documentPath?.split("/").pop()??"Untitled",nextDisabled:c.next===null,note:gp,noteState:a?"shown":"hidden",place:c.index===-1?"":`${c.index+1} of ${c.total}`,previousDisabled:c.previous===null,recordNav:l?"shown":"hidden",region:i,stage:"entry"}}function Ue(e,t,r){let i=hp(e.schema,t),o=i===null?void 0:t[i];if(n(o)&&o.trim()!=="")return o.trim();return r===-1?"Record":`Row ${r+1}`}function CD(e,t){let{paneId:r,wrap:i}=e;if(kE(r,t))return;aw(r);let o=null,s=null,a=()=>{if(o!==null&&J(r)===o)c()},l=(u)=>{if(!s||!u)return;let D=Pl(t),z=Fl(`entry:${r}`,$E(u.schema,u.schema,D),D,{context:TE(t),errors:LE(u,D),onChange:(ye)=>U_(t,ye),rerender:a,ui:EE(u.schema)});if(z.parentNode!==s)s.replaceChildren(z)},c=()=>{let u=L(t);if(!u)s=null;o?.surface.update(pe(r,t,u)),l(u)},d=ge(),f=oe(i,pe(r,t,L(t)),{openContentTypes:()=>{ae()?.run("settings.open",{section:"content"})},openGrid:()=>{let{index:u}=w(t);if(u!==-1&&t.documentPath)se(t.documentPath,u);t.session.ui.canvasMode="grid"},setDraft:(u)=>ab(t,u),showNext:()=>{let{next:u}=w(t);if(u!==null)k(t,u)},showPrevious:()=>{let{previous:u}=w(t);if(u!==null)k(t,u)}},{fieldsSlot:(u)=>{s=u,l(L(t))}});o={paneId:r,scope:d,surface:f,tabId:t.id,wrap:i},C.set(r,o),d.run(()=>{ne(()=>{if(J(r)!==o)return;t.doc.document,t.doc.content.frontmatter,S?.projectConfig?.content,c()})})}async function kD(e){let{openFileInTab:t}=await (le("de90apn9"),import("./files-de90apn9.js"));await t(e);for(let[r,i]of m.tabs.entries()){if(i.documentPath!==e)continue;for(let o of We)if(!i.capabilities.modes.includes(o))i.capabilities.modes.unshift(o);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,jt(r),i}return null}
5
+ `)}}var We=[y],C=new Map;function J(e){return C.get(e)??null}function kE(e,t){let r=J(e);return r!==null&&r.tabId===t.id&&r.wrap.isConnected&&r.surface.attached()}function aw(e){let t=C.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),C.delete(e)}function ab(e,t){Y(e,(r)=>I(r,Cs,t))}function SD(e){let t=L(e),r=Pl(e);if(!t||!Dc(t.schema,r))return null;let i=jl(r);return{draft:i,text:i?"Draft":"Published",title:i?gp:"Not marked a draft."}}function EE(e){return Object.fromEntries(Object.entries(e?.properties??{}).map(([t,r])=>[t,{label:n(r.title)&&r.title!==""?r.title:V(t)}]))}function TE(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(t,r)=>mp(t,{projectConfig:S?.projectConfig??{},scope:r})}}function LE(e,t){return Object.fromEntries(jD(e.schema,t).map((r)=>[r,"Required — this entry does not have one."]))}function L(e){return h(e)?FD(e.documentPath):Rc(e.documentPath)}function $E(e,t,r){let i=hp(t,r),o=e.properties??{},s=i===null?void 0:o[i];if(i===null||s===void 0)return e;return{...e,properties:{[i]:s,...o}}}function qe(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function pe(e,t,r){let i=xi(e,"entry"),o=xi(e,"entry/fields");if(!r)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:gp,emptyLine:qe(t),fieldsRegion:o,name:"",nextDisabled:!0,note:"",noteState:"hidden",place:"",previousDisabled:!0,recordNav:"hidden",region:i,stage:"empty"};let s=Pl(t),a=jl(s),l=h(t),c=w(t);return{collection:r.name,draft:a,draftAxis:Dc(r.schema,s)?"shown":"hidden",draftHint:gp,emptyLine:"",fieldsRegion:o,name:l?Ue(r,s,c.index):t.documentPath?.split("/").pop()??"Untitled",nextDisabled:c.next===null,note:gp,noteState:a?"shown":"hidden",place:c.index===-1?"":`${c.index+1} of ${c.total}`,previousDisabled:c.previous===null,recordNav:l?"shown":"hidden",region:i,stage:"entry"}}function Ue(e,t,r){let i=hp(e.schema,t),o=i===null?void 0:t[i];if(n(o)&&o.trim()!=="")return o.trim();return r===-1?"Record":`Row ${r+1}`}function CD(e,t){let{paneId:r,wrap:i}=e;if(kE(r,t))return;aw(r);let o=null,s=null,a=()=>{if(o!==null&&J(r)===o)c()},l=(u)=>{if(!s||!u)return;let D=Pl(t),z=Fl(`entry:${r}`,$E(u.schema,u.schema,D),D,{context:TE(t),errors:LE(u,D),onChange:(ye)=>U_(t,ye),rerender:a,ui:EE(u.schema)});if(z.parentNode!==s)s.replaceChildren(z)},c=()=>{let u=L(t);if(!u)s=null;o?.surface.update(pe(r,t,u)),l(u)},d=ge(),f=oe(i,pe(r,t,L(t)),{openContentTypes:()=>{ae()?.run("settings.open",{section:"content"})},openGrid:()=>{let{index:u}=w(t);if(u!==-1&&t.documentPath)se(t.documentPath,u);t.session.ui.canvasMode="grid"},setDraft:(u)=>ab(t,u),showNext:()=>{let{next:u}=w(t);if(u!==null)k(t,u)},showPrevious:()=>{let{previous:u}=w(t);if(u!==null)k(t,u)}},{fieldsSlot:(u)=>{s=u,l(L(t))}});o={paneId:r,scope:d,surface:f,tabId:t.id,wrap:i},C.set(r,o),d.run(()=>{ne(()=>{if(J(r)!==o)return;t.doc.document,t.doc.content.frontmatter,S?.projectConfig?.content,c()})})}async function kD(e){let{openFileInTab:t}=await (le("zbc8p6v1"),import("./files-zbc8p6v1.js"));await t(e);for(let[r,i]of m.tabs.entries()){if(i.documentPath!==e)continue;for(let o of We)if(!i.capabilities.modes.includes(o))i.capabilities.modes.unshift(o);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,jt(r),i}return null}
6
6
  export{hp,V_,yE,rb,wE,ow,hD,xE,rw,pD,Pl,U_,fD,mD,cm,_E,dm,sw,gD,SE,sb,bD,vD,yD,wD,xD,CE,_D,kE,aw,ab,SD,EE,TE,LE,$E,CD,kD};
7
7
 
8
- //# debugId=2B9F26EAF1B25F5864756E2164756E21
9
- //# sourceMappingURL=studio-zgx7svjd.js.map
8
+ //# debugId=8950B9BAF8EB18F464756E2164756E21
9
+ //# sourceMappingURL=studio-bkmv1h3e.js.map
@@ -1,5 +1,5 @@
1
- import{n,_}from"./studio-zkq3r91p.js";var w=["order","widths","hidden","sort","groupBy","filter"],g="jx-grid-layout:";function c(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function u(e){let t=c()?.getItem(g+e);if(!t)return null;try{let r=JSON.parse(t);return _(r)?r:null}catch{return null}}function f(e,t){c()?.setItem(g+e,JSON.stringify(t))}function a(e){let t={};for(let r of w)if(e[r]!==void 0)Object.assign(t,{[r]:e[r]});return t}function v(e){return JSON.stringify(w.map((t)=>e[t]??null))}function _d(e){let t=u(e);return t?a(t):null}function im(e,t){if(!c())return;let o=u(e)??{},s={...o,widths:{...o.widths,...t.widths}};for(let i of w)if(i!=="widths"&&t[i]!==void 0)Object.assign(s,{[i]:t[i]});f(e,s)}function Vk(e){let t=u(e);if(!t)return;let r={active:null};if(t.views)r.views=t.views;f(e,r)}function Ru(e){let t=u(e)?.views;return Array.isArray(t)?t.filter((r)=>G(r)):[]}function G(e){return _(e)&&"name"in e&&n(e.name)}function L_(e){return u(e)?.active??null}function BR(e){let t=u(e),r=t?.active;if(!t||!r)return!1;let o=Ru(e).find((s)=>s.name===r);return o?v(a(o))!==v(a(t)):!1}function zR(e,t){let r=t.trim(),o=c();if(r===""||!o)return null;let s=u(e)??{},i={name:r,...a(s)},d=Ru(e).filter((l)=>l.name!==r);return d.push(i),f(e,{...s,active:r,views:d}),i}function Wy(e,t){let r=Ru(e).find((i)=>i.name===t);if(!r||!c())return null;let o=u(e)??{},s=a(r);return f(e,{active:r.name,views:o.views??[],...s}),s}function Uk(e,t){let r=u(e);if(!r||!c())return!1;let o=Ru(e),s=o.filter((i)=>i.name!==t);if(s.length===o.length)return!1;return f(e,{...r,active:r.active===t?null:r.active??null,views:s}),!0}function WR(e,t){if(!t)return e;let r=new Set(t.hidden),o=[];for(let i of e){if(i.field!==void 0&&r.has(i.field))continue;let d=i.field?t.widths?.[i.field]:void 0;o.push(d?{...i,width:d}:i)}if(!t.order?.length)return o;let s=new Map(t.order.map((i,d)=>[i,d]));return o.map((i,d)=>({def:i,index:d})).toSorted((i,d)=>{let l=s.get(i.def.field??"")??t.order.length+i.index,p=s.get(d.def.field??"")??t.order.length+d.index;return l-p}).map(({def:i})=>i)}
2
- export{_d,im,Vk,Ru,L_,BR,zR,Wy,Uk,WR};
1
+ import{n,_}from"./studio-zsjpsw08.js";var w=["order","widths","hidden","sort","groupBy","filter"],g="jx-grid-layout:";function c(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function u(e){let t=c()?.getItem(g+e);if(!t)return null;try{let r=JSON.parse(t);return _(r)?r:null}catch{return null}}function f(e,t){c()?.setItem(g+e,JSON.stringify(t))}function a(e){let t={};for(let r of w)if(e[r]!==void 0)Object.assign(t,{[r]:e[r]});return t}function v(e){return JSON.stringify(w.map((t)=>e[t]??null))}function Sd(e){let t=u(e);return t?a(t):null}function im(e,t){if(!c())return;let o=u(e)??{},s={...o,widths:{...o.widths,...t.widths}};for(let i of w)if(i!=="widths"&&t[i]!==void 0)Object.assign(s,{[i]:t[i]});f(e,s)}function Vk(e){let t=u(e);if(!t)return;let r={active:null};if(t.views)r.views=t.views;f(e,r)}function Ru(e){let t=u(e)?.views;return Array.isArray(t)?t.filter((r)=>G(r)):[]}function G(e){return _(e)&&"name"in e&&n(e.name)}function L_(e){return u(e)?.active??null}function BR(e){let t=u(e),r=t?.active;if(!t||!r)return!1;let o=Ru(e).find((s)=>s.name===r);return o?v(a(o))!==v(a(t)):!1}function zR(e,t){let r=t.trim(),o=c();if(r===""||!o)return null;let s=u(e)??{},i={name:r,...a(s)},d=Ru(e).filter((l)=>l.name!==r);return d.push(i),f(e,{...s,active:r,views:d}),i}function Wy(e,t){let r=Ru(e).find((i)=>i.name===t);if(!r||!c())return null;let o=u(e)??{},s=a(r);return f(e,{active:r.name,views:o.views??[],...s}),s}function Uk(e,t){let r=u(e);if(!r||!c())return!1;let o=Ru(e),s=o.filter((i)=>i.name!==t);if(s.length===o.length)return!1;return f(e,{...r,active:r.active===t?null:r.active??null,views:s}),!0}function WR(e,t){if(!t)return e;let r=new Set(t.hidden),o=[];for(let i of e){if(i.field!==void 0&&r.has(i.field))continue;let d=i.field?t.widths?.[i.field]:void 0;o.push(d?{...i,width:d}:i)}if(!t.order?.length)return o;let s=new Map(t.order.map((i,d)=>[i,d]));return o.map((i,d)=>({def:i,index:d})).toSorted((i,d)=>{let l=s.get(i.def.field??"")??t.order.length+i.index,p=s.get(d.def.field??"")??t.order.length+d.index;return l-p}).map(({def:i})=>i)}
2
+ export{Sd,im,Vk,Ru,L_,BR,zR,Wy,Uk,WR};
3
3
 
4
- //# debugId=8D22B0AFD928F5F664756E2164756E21
5
- //# sourceMappingURL=studio-3c8pp7pb.js.map
4
+ //# debugId=71CEF3088342ED8164756E2164756E21
5
+ //# sourceMappingURL=studio-brdp85q7.js.map