@jxsuite/studio 10.3.0 → 10.4.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 (89) hide show
  1. package/dist/chunks/{add-new-flow-3tkn72ey.js → add-new-flow-v0pm96mr.js} +2 -2
  2. package/dist/chunks/content-source-g38w0d3f.js +4 -0
  3. package/dist/chunks/{convert-to-repeater-gwzh9gar.js → convert-to-repeater-r8sfxjjm.js} +2 -2
  4. package/dist/chunks/entry-commands-t13dyw3c.js +4 -0
  5. package/dist/chunks/{extension-sections-338ee35t.js → extension-sections-vjzw46xb.js} +2 -2
  6. package/dist/chunks/file-ops-1sghzgcr.js +4 -0
  7. package/dist/chunks/{files-t07yqqej.js → files-zrqtgt41.js} +2 -2
  8. package/dist/chunks/{format-host-5ja5gxyk.js → format-host-9gy76erh.js} +2 -2
  9. package/dist/chunks/fs-events-45rhg3me.js +4 -0
  10. package/dist/chunks/grid-open-t4fq6bbm.js +4 -0
  11. package/dist/chunks/{grid-view-w9nfy203.js → grid-view-2f03wcgw.js} +2 -2
  12. package/dist/chunks/{iframe-host-wsg0bn73.js → iframe-host-9aq8ze3q.js} +2 -2
  13. package/dist/chunks/{jx-validate-ttr5ewf0.js → jx-validate-r4ax11e3.js} +2 -2
  14. package/dist/chunks/layers-panel-zr92pwdp.js +4 -0
  15. package/dist/chunks/media-library-j74rt0w4.js +4 -0
  16. package/dist/chunks/{media-open-yp9jm834.js → media-open-mypr0k6b.js} +2 -2
  17. package/dist/chunks/{media-picker-s41ngdfr.js → media-picker-pemtbsjv.js} +2 -2
  18. package/dist/chunks/{monaco-setup-g9kterhx.js → monaco-setup-0hw9f835.js} +2 -2
  19. package/dist/chunks/publish-panel-vg1n880b.js +4 -0
  20. package/dist/chunks/{publish-quick-w3nxd7q4.js → publish-quick-4fwngwrw.js} +2 -2
  21. package/dist/chunks/publish-workspace-jv4w2bx2.js +4 -0
  22. package/dist/chunks/quick-search-nh29rt8a.js +4 -0
  23. package/dist/chunks/right-panel-3ws9f2w0.js +4 -0
  24. package/dist/chunks/{source-control-6fk72me2.js → source-control-h3hcs5gy.js} +2 -2
  25. package/dist/chunks/{studio-jeb7hth3.js → studio-1ctnw3xv.js} +2 -2
  26. package/dist/chunks/{studio-15hwqgd8.js → studio-1y9mab9m.js} +2 -2
  27. package/dist/chunks/{studio-s7t4vp1d.js → studio-2e4hry72.js} +3 -3
  28. package/dist/chunks/{studio-0w3541dg.js → studio-2kpxm0eh.js} +3 -3
  29. package/dist/chunks/{studio-3c10v2q1.js → studio-2pk7kc7z.js} +2 -2
  30. package/dist/chunks/{studio-nwynxqtb.js → studio-2x972v58.js} +2 -2
  31. package/dist/chunks/{studio-fspe7m9t.js → studio-2zz4qbv9.js} +2 -2
  32. package/dist/chunks/{studio-ggx3j7nd.js → studio-3pz4t5a2.js} +2 -2
  33. package/dist/chunks/{studio-waekn290.js → studio-4bgvvzhv.js} +2 -2
  34. package/dist/chunks/{studio-y1b86ast.js → studio-61rg2cz5.js} +2 -2
  35. package/dist/chunks/{studio-nskxe9q1.js → studio-9gr7xs9r.js} +2 -2
  36. package/dist/chunks/{studio-wse1rs8t.js → studio-a88ej93p.js} +3 -3
  37. package/dist/chunks/{studio-zfdbmhp3.js → studio-acer0g8w.js} +2 -2
  38. package/dist/chunks/{studio-423tfdte.js → studio-amaz545p.js} +2 -2
  39. package/dist/chunks/{studio-ea6r1zyr.js → studio-az3wvyh2.js} +2 -2
  40. package/dist/chunks/{studio-5n193zqd.js → studio-bg8pzprg.js} +2 -2
  41. package/dist/chunks/{studio-bct64zmj.js → studio-bnc50f9h.js} +2 -2
  42. package/dist/chunks/{studio-3xk9zdgb.js → studio-brh8d2pr.js} +2 -2
  43. package/dist/chunks/{studio-fkrr7kgg.js → studio-c2fa783p.js} +3 -3
  44. package/dist/chunks/{studio-yzpskb0j.js → studio-cqxj4fcy.js} +2 -2
  45. package/dist/chunks/{studio-b4e0ftkt.js → studio-cw11h078.js} +2 -2
  46. package/dist/chunks/{studio-f8tyeyzt.js → studio-dn56z7sn.js} +3 -3
  47. package/dist/chunks/{studio-nn4f9m9c.js → studio-evq47j2z.js} +2 -2
  48. package/dist/chunks/{studio-e7vjyp04.js → studio-frc16j8v.js} +3 -3
  49. package/dist/chunks/{studio-wfct4h6n.js → studio-gnazwtv3.js} +2 -2
  50. package/dist/chunks/{studio-thz5t120.js → studio-hfqpfmpk.js} +2 -2
  51. package/dist/chunks/{studio-fj6c905s.js → studio-j5fcp6gj.js} +2 -2
  52. package/dist/chunks/{studio-s9fng7m8.js → studio-jd1qb1st.js} +3 -3
  53. package/dist/chunks/{studio-p2a03pgm.js → studio-jma2q8r9.js} +2 -2
  54. package/dist/chunks/{studio-yrcrncev.js → studio-knsjyx7n.js} +2 -2
  55. package/dist/chunks/{studio-8kx6m0rg.js → studio-mrjtnm62.js} +2 -2
  56. package/dist/chunks/{studio-b68k0z00.js → studio-nwf0c32p.js} +2 -2
  57. package/dist/chunks/{studio-hfxttkyr.js → studio-pj216fmn.js} +2 -2
  58. package/dist/chunks/{studio-x0gsfr1d.js → studio-pwctzka3.js} +3 -3
  59. package/dist/chunks/{studio-aam8zt8z.js → studio-q9hx2qp0.js} +2 -2
  60. package/dist/chunks/{studio-wgc54sxf.js → studio-qrzmfaf6.js} +2 -2
  61. package/dist/chunks/{studio-3q7mhbgx.js → studio-r6mx7vm5.js} +2 -2
  62. package/dist/chunks/{studio-stahswgb.js → studio-rr00ex23.js} +2 -2
  63. package/dist/chunks/{studio-321ym1tt.js → studio-s24mhq0z.js} +2 -2
  64. package/dist/chunks/{studio-bz0b5brj.js → studio-tmfcn347.js} +2 -2
  65. package/dist/chunks/{studio-a65kbs2e.js → studio-v7a7yb5w.js} +2 -2
  66. package/dist/chunks/{studio-2ggfzrrd.js → studio-wmjmsw0p.js} +3 -3
  67. package/dist/chunks/studio-xva3hzkv.js +5 -0
  68. package/dist/chunks/{studio-nf8esxxc.js → studio-xx3r3sb0.js} +2 -2
  69. package/dist/chunks/{studio-9qx1ywbv.js → studio-z3fztxrp.js} +4 -4
  70. package/dist/chunks/{studio-r050sez0.js → studio-z9453ypn.js} +2 -2
  71. package/dist/chunks/{workspace-9btkc8tk.js → workspace-6ztqcrsh.js} +2 -2
  72. package/dist/chunks/workspace-home-rse9h8a0.js +4 -0
  73. package/dist/manifest.json +46 -46
  74. package/dist/studio.js +10 -10
  75. package/package.json +11 -11
  76. package/src/surfaces/inspector-dock.json +3 -3
  77. package/dist/chunks/content-source-1vzxq1ba.js +0 -4
  78. package/dist/chunks/entry-commands-mx2whrjx.js +0 -4
  79. package/dist/chunks/file-ops-9bxvk59j.js +0 -4
  80. package/dist/chunks/fs-events-3424ezp3.js +0 -4
  81. package/dist/chunks/grid-open-1mpq9mzb.js +0 -4
  82. package/dist/chunks/layers-panel-hvy2e549.js +0 -4
  83. package/dist/chunks/media-library-ae67q4at.js +0 -4
  84. package/dist/chunks/publish-panel-gzfxcm0t.js +0 -4
  85. package/dist/chunks/publish-workspace-dppd82tc.js +0 -4
  86. package/dist/chunks/quick-search-tdxaam55.js +0 -4
  87. package/dist/chunks/right-panel-0yrw4cgz.js +0 -4
  88. package/dist/chunks/studio-53wy9ek3.js +0 -5
  89. package/dist/chunks/workspace-home-qcc4z5ag.js +0 -4
@@ -1,7 +1,7 @@
1
- import{p,ye}from"./studio-4fnb5648.js";import{Cs}from"./studio-e7vjyp04.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-yrcrncev.js";import{qs}from"./studio-a65kbs2e.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-y1b86ast.js";import{yr,ih,hC,NA,qb,hi,ax,PA,Ql,gC,sh,jA,Ap}from"./studio-53wy9ek3.js";import{Ab,Ob}from"./studio-thz5t120.js";import{AS,Mw,Tm,Pw,OS,_i}from"./studio-wse1rs8t.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-9qx1ywbv.js";import{iN,yw,ww,_p}from"./studio-r050sez0.js";import{Vl}from"./studio-jeb7hth3.js";import{PS}from"./studio-g0hxtcga.js";import{Sa}from"./studio-wgc54sxf.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("9bxvk59j"),import("./file-ops-9bxvk59j.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(`
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
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("3tkn72ey"),import("./add-new-flow-3tkn72ey.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()}
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
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
5
 
6
6
  //# debugId=070A13E7BCCF0D1F64756E2164756E21
7
- //# sourceMappingURL=studio-0w3541dg.js.map
7
+ //# sourceMappingURL=studio-2kpxm0eh.js.map
@@ -1,5 +1,5 @@
1
- import{X}from"./studio-9c6cbq2c.js";import{ae}from"./studio-wqfaqw4m.js";import{p,ye}from"./studio-4fnb5648.js";import{nt}from"./studio-tpxcryf2.js";import{Hm,no,Bm,jC,mO,Cx,u}from"./studio-x0gsfr1d.js";import{Zl,IL,Ri,jd,DL,NL}from"./studio-stahswgb.js";import{as,Hc,TL}from"./studio-a65kbs2e.js";import{ks,KS,Pb,Us,iL,oL,rL,sL,aL,lL,cL,dL,uL,hL,pL,fL,Yw,mL,gL}from"./studio-8kx6m0rg.js";import{Vb}from"./studio-53wy9ek3.js";import{pb,hw,hm,jD,pm,X_,HD,fb,zD,pw}from"./studio-nf8esxxc.js";import{C}from"./studio-4f7thq0p.js";import{Ln,E,R}from"./studio-9dq7rwc7.js";import{me,te,g}from"./studio-3qr08sxq.js";import{n,v}from"./studio-k3we3kqb.js";var Y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsDeploy",$description:"Publish › Hosting's build adapter (studio.md §22.8), which was Project Settings › Deploy: one row over `build.adapter`, and the sentence a failed write leaves behind. It draws no heading of its own: Hosting's \"How it is built\" section heads it, and a second title inside that card would name the same thing twice. The adapter (`surfaces/settings-deploy.ts`) hands in the chosen adapter, the enumeration it is chosen from and whatever the last write had to say; the document draws them and hands the change straight back. Nothing here reads `project.json`: a section that re-read the config while drawing would be a second opinion about a file one module already owns.",tagName:"section",attributes:{part:"deploy"},style:{$description:"What is NOT in this block is most of the conversion. Four borrowed rules had nothing to transcribe: `.settings-field-label` and `.settings-field-desc` drew a row's label and the sentence under it, and `jx-field` draws both — with the label actually NAMING the control, which the bare `<label class=…>` beside the picker never did; `.settings-field` added a 20px bottom margin to separate one row from the next, and this section has one row, so the margin separated it from the end of the section; and `.settings-section` was never defined by any stylesheet at all, which is why it sits in `check-styles.ts`'s allow-list rather than in a rule.",display:"block",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="section-error"]':{$description:'A write that failed, said under the section title rather than pinned to the picker: settings save on change, so a silent rejection would read as "my edit just vanished", and what failed was the whole file rather than the value. Its size read `--spectrum-font-size-75` with a 12px fallback, which resolved only inside `<sp-theme>` — a document is mounted in the settings pane, where that name is not in scope and the fallback is all it would ever have taken — so the size is the kit\'s scale and the colour is the studio layer\'s. It is `section-error` rather than `error` because the adapter picker is a `jx-select`, which draws a permanent `[part="error"]` of its own in this same light-DOM tree: a rule on that name would give the picker\'s own refusal sentence this 16px margin too.',margin:"0 0 16px",fontSize:"var(--jx-text-md)",color:"var(--danger)"},'& [part="adapter"]':{$description:"How wide the picker may grow. A control offering five short words does not want the width of a 900px pane, and 320px is the one thing `.settings-build-adapter` said that the kit does not — the same measure the two pickers in Locales take.",maxWidth:"320px"}},children:[{tagName:"div",attributes:{part:"section-error-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"section-error",role:"alert"},textContent:"${state.error}"}}},{tagName:"jx-field",attributes:{part:"row","data-field":"adapter"},$props:{span:!0,label:"Build adapter",description:"What the site is built for. Static writes plain files; the others emit a server entry for that runtime."},children:[{tagName:"jx-select",attributes:{part:"adapter"},$props:{size:"sm",options:{$ref:"#/state/adapters"},value:{$ref:"#/state/adapter"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAdapter"},value:[{$ref:"event#/target/value"}]}]}}]}]};E("settings-deploy",Y);function Q(t,e){if(e.adapter!==void 0)t.adapter=e.adapter;if(e.adapters!==void 0)t.adapters=e.adapters;if(e.error!==void 0)t.error=e.error,t.hasError=e.error!==""}function Z(t,e,a){let r=g({adapter:"",adapters:[],error:"",hasError:!1,setAdapter:a.setAdapter});Q(r,e),t.replaceChildren();let i=null,l=!1;return R("settings-deploy",r,t).then((o)=>{if(l){o.dispose();return}i=o}),{connected:()=>!l&&(i===null?t.childNodes.length===0:i.root.parentNode===t),dispose(){l=!0,i?.dispose(),i=null},update:(o)=>Q(r,o)}}var tt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsRawJson",$description:"Project Settings › Raw JSON: `project.json` as it is written, and the way through to editing it as text. The adapter (`surfaces/settings-rawjson.ts`) hands in the serialisation the save chokepoint itself produced, so what is drawn is what a save writes rather than a second pretty-printer that would disagree with the file by an indent. The button opens the SAME tab in the Code editor — one document, three editors (`studio.md` §9.3) — so switching to the text and back keeps one undo stack instead of forking two.",tagName:"section",attributes:{part:"rawjson"},style:{$description:"Two of the rules this section borrowed are gone rather than moved. `.settings-field-desc` styled the sentence under the title, and it is kept here because there is no `jx-field` in this section to draw it — a `<pre>` is not a control and wrapping one in a row would give the file a label it does not need. `.settings-edit-as-code` set `align-self: flex-start` on the button, which did nothing: its parent carried `.settings-section`, a class no stylesheet defines, so there was no flex container for the declaration to be about — and `jx-button` is `inline-flex`, so it already sits at the left of a block.",display:"block",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="intro"]':{$description:"The sentence under the title. Its size read `--spectrum-font-size-75` with a 12px fallback, a name that resolves only inside `<sp-theme>`; a document is mounted in the settings pane, so the fallback is all it could ever have taken and the size is the kit's scale now.",margin:"0 0 6px",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="file"]':{$description:"The file's name, said in the prose as the file it is. It borrowed a bare `<code>` element and whatever the page happened to give one; a document's styling is its own, so the face is stated here.",fontFamily:"var(--font-mono)"},'& [part="json"]':{$description:'`project.json` as it is saved. It scrolls in its own box: a 250-line file must not push the "Edit as code" action off the bottom of the section. Its background read `var(--bg-dim, var(--bg))` and `--bg-dim` is declared nowhere in the token layer, so the fallback is what has always painted it — written as what it resolves to rather than as a name that never resolved.',margin:"0 0 12px",padding:"12px",maxHeight:"420px",overflow:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-md)",color:"var(--fg)",whiteSpace:"pre"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"Raw JSON"},{tagName:"p",attributes:{part:"intro"},children:["The whole of ",{tagName:"code",attributes:{part:"file"},textContent:"project.json"},", as it is saved. Editing it as code opens the same document in the Code editor — one undo stack, one dirty flag."]},{tagName:"pre",attributes:{part:"json"},textContent:"${state.json}"},{tagName:"jx-button",attributes:{part:"edit"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAsCode"}}]},children:[{tagName:"span",textContent:"Edit as code"}]}]};E("settings-rawjson",tt);function et(t,e){if(e.json!==void 0)t.json=e.json}function at(t,e,a){let r=g({editAsCode:a.editAsCode,json:""});et(r,e),t.replaceChildren();let i=null,l=!1;return R("settings-rawjson",r,t).then((o)=>{if(l){o.dispose();return}i=o}),{connected:()=>!l&&(i===null?t.childNodes.length===0:i.root.parentNode===t),dispose(){l=!0,i?.dispose(),i=null},update:(o)=>et(r,o)}}var I=new WeakMap;function W(){return C?.projectConfig??{}}var kt=[{label:"Static",value:"static"},{label:"Bun",value:"bun"},{label:"Node",value:"node"},{label:"Cloudflare Workers",value:"cloudflare-workers"},{label:"Cloudflare Pages",value:"cloudflare-pages"}],N=new WeakMap;function rt(t){return{adapter:W().build?.adapter||"static",adapters:kt.map((e)=>({label:e.label,value:e.value})),error:I.get(t)??""}}async function St(t,e){try{await no(e),I.delete(t)}catch(a){I.set(t,`Could not save project.json — ${X(a)}`)}D(t)}var it=new WeakMap;function Ct(t){let e=it.get(t);if(!e)e={setAdapter:(a)=>{N.get(t)?.update({adapter:a}),St(t,{build:{...W().build,adapter:a}})}},it.set(t,e);return e}function D(t){let e=N.get(t);if(e?.connected()){e.update(rt(t));return}e?.dispose(),N.set(t,Z(t,rt(t),Ct(t)))}function B(t){N.get(t)?.dispose(),N.delete(t)}var st=new WeakMap;function ot(){return{json:Hm(W())}}function MD(t,e){let a=st.get(t);if(a?.connected()){a.update(ot());return}a?.dispose(),st.set(t,at(t,ot(),{editAsCode:e.editAsCode}))}var lt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublishWorkspace",$description:"The Publish workspace's home (studio.md §22.8): four sub-tabs over one body. Review changes is the change list grouped the way the site is organised (Pages, each content collection, Components, Layouts, Styles, Media, Other), each file's checkbox including it in the next publish (staging it), its Before and after opening the comparison (§21), then the checks, the destination, the summary and the one primary button. Deploys is the live site, any deploy running now with its steps, the history the host returns and the branch previews. Branches is the branch list with switch and create. Hosting is where the project is saved, where the site is hosted, the build adapter (an island: the Deploy section that moved here from Project Settings) and the address, with the deploy checklist under them. `publish/publish-workspace.ts` keeps every decision and hands this document strings and booleans; nothing here knows what a status letter means, which destination a host allows or what a deployment's stage is called.",tagName:"div",attributes:{part:"publish","data-jx-region":"${state.region}","data-tab":"${state.tab}","aria-labelledby":"${state.titleId}",role:"region"},style:{$description:"Fills the pane's stage by its own geometry, as the Media home does: the stage is `position: relative`, so the workspace takes the whole of it and scrolls its own body. The status colours are the theme's semantic tokens, so a check, a badge and a deployment's state follow light and dark without a hex anywhere.",position:"absolute",inset:"0",display:"flex",flexDirection:"column",boxSizing:"border-box",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",background:"var(--bg)",'& [part="head"]':{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:"var(--jx-space-3)",padding:"var(--jx-space-4) var(--jx-space-5) 0"},'& [part="heading"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600"},'& [part="headline"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="tabs"]':{padding:"0 var(--jx-space-5)",flexShrink:"0"},'& [part="body"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-4) var(--jx-space-5) var(--jx-space-6)",containerType:"inline-size",containerName:"publish-body"},'& [part="review"]':{$description:"Two columns as the board draws them, the changes on the left and the publish card on the right; below 760px of pane the card drops under the list rather than squeezing it.",display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(260px, 340px)",gap:"var(--jx-space-5)",alignItems:"start"},"@container publish-body (max-width: 760px)":{'& [part="review"]':{gridTemplateColumns:"minmax(0, 1fr)"}},'& [part="changes-column"], & [part="publish-column"], & [part="deploys"], & [part="branches"], & [part="hosting"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-5)",minWidth:"0"},'& [part="deploys"], & [part="branches"], & [part="hosting"]':{maxWidth:"760px"},"& section":{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",minWidth:"0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)"},'& [part="section-heading"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"600",color:"var(--fg-dim)",textTransform:"uppercase",letterSpacing:"0.04em"},'& [part="publish-column"] > section':{padding:"var(--jx-space-4)",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)"},'& [part="sync-bar"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3)",paddingBottom:"var(--jx-space-3)",borderBottom:"1px solid var(--border)"},'& [part="sync-text"]':{display:"flex",flex:"1 1 auto",flexDirection:"column",minWidth:"0"},'& [part="sync-label"]':{fontWeight:"600"},'& [part="sync-time"], & [part="included"], & [part="file-dir"], & [part="history-meta"], & [part="choice-note"], & [part="live-summary"], & [part="hosting-summary"], & [part="branch-sync"], & [part="branch-summary"], & [part="deployment-when"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="changes-bar"]':{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--jx-space-3)"},'& [part="groups"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="group-name"]':{fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)",fontFamily:"var(--font-mono)"},'& [part="file-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"2px var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)"},'& [part="file-row"]:hover, & [part="file-row"]:focus-within':{background:"var(--hover-bg)"},'& [part="file-text"]':{display:"flex",flex:"1",alignItems:"baseline",gap:"var(--jx-space-2)",minWidth:"0",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},'& [part="file-dir"]':{overflow:"hidden",textOverflow:"ellipsis"},'& [part="badge"]':{$description:"One letter and a colour, which is why the checkbox and the row's buttons carry the status in words as well.",flex:"none",width:"16px",color:"var(--signal)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",fontWeight:"700",textAlign:"center"},'& [part="badge"][data-status="A"], & [part="badge"][data-status="U"]':{color:"var(--success)"},'& [part="badge"][data-status="D"]':{color:"var(--danger)"},'& [part="badge"][data-status="R"]':{color:"var(--tag)"},'& [part="empty-message"], & [part="status"], & [part="live-none"]':{margin:"0",color:"var(--fg-dim)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-6)",textAlign:"center"},'& [part="empty"] > [part="empty-message"]':{maxWidth:"48ch"},'& [part="empty-actions"], & [part="command-row"], & [part="publish-actions"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-2)"},'& [part="history-list"], & [part="check-list"], & [part="deployment-list"], & [part="branch-list"], & [part="checklist-steps"], & [part="activity-steps"]':{margin:"0",padding:"0",listStyle:"none",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="history-entry"]':{display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)",alignItems:"baseline"},'& [part="history-hash"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="history-message"]':{flex:"1",minWidth:"0"},'& [part="checklist-step"], & [part="activity-step"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)"},'& [part="check"]':{$description:"Centred, not baseline-aligned: the row can hold a small kit button, and a small kit control is layout-contained, so it has no baseline to align on.",display:"flex",alignItems:"center",gap:"var(--jx-space-2)"},'& [part="check-text"]':{flex:"1",minWidth:"0",lineHeight:"1.4"},'& [part="check-icon"], & [part="step-icon"]':{$description:"A kit icon for a check or a checklist link, sized by the kit's own property so it stays square; the activity feed's steps still draw a one-character glyph, which `minWidth` keeps on the same column.",flex:"none",minWidth:"1em",textAlign:"center","--jx-icon-size":"1em",color:"var(--fg-dim)"},'& [part="checklist-step"] > [part="step-icon"]':{$description:"A baseline-aligned row places a kit icon's bottom edge on the text baseline, which draws it high; the negative end margin lowers it onto the line's middle.",marginBlockEnd:"-0.15em"},'& [data-state="done"] > [part="check-icon"], & [data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [data-state="failed"] > [part="check-icon"], & [data-state="failed"] > [part="step-icon"]':{color:"var(--danger)"},'& [data-state="todo"] > [part="check-icon"]':{color:"var(--warning)"},'& [part="destinations"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="destination-card"] > [part="control"]':{$description:"A destination is a card with a name and a sentence saying what it does, inside one radio, as Add new's choice cards are: the reader hears one name and sees both lines.",width:"100%",height:"auto",flexDirection:"column",alignItems:"flex-start",textAlign:"start",padding:"var(--jx-space-2) var(--jx-space-3)",gap:"2px",whiteSpace:"normal"},'& [part="choice-name"]':{display:"block",fontWeight:"600"},'& [part="choice-note"]':{display:"block"},'& [part="refusal"], & [part="blocker"]':{margin:"0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="review-line"], & [part="live-site"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-2)",margin:"0"},'& [part="live-url"]':{fontWeight:"600",wordBreak:"break-all"},'& [part="live-summary"], & [part="hosting-summary"], & [part="host-name"], & [part="branch-note"]':{margin:"0",lineHeight:"1.5"},'& [part="host-name"]':{fontWeight:"600"},'& [part="activity"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)"},'& [part="activity-head"]':{display:"flex",justifyContent:"space-between",gap:"var(--jx-space-3)"},'& [part="activity-title"]':{fontWeight:"600"},'& [part="activity-status"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="deployment"]':{display:"grid",gridTemplateColumns:"minmax(64px, auto) minmax(0, 1fr) auto auto",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-1) 0",borderBottom:"1px solid var(--border)"},'& [part="deployment-label"]':{minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="deployment-status"]':{fontSize:"var(--jx-text-sm)"},'& [part="deployment-status"][data-status="success"]':{color:"var(--success)"},'& [part="deployment-status"][data-status="failure"]':{color:"var(--danger)"},'& [part="branch"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-1) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)","--jx-icon-size":"16px"},'& [part="branch"]:hover':{background:"var(--hover-bg)"},'& [part="branch-icon"]':{color:"var(--fg-dim)"},'& [part="branch-name"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",fontFamily:"var(--font-mono)"},'& [part="current"]':{display:"inline-flex",gap:"var(--jx-space-2)",alignItems:"baseline"},'& [part="current-tag"]':{padding:"0 6px",borderRadius:"var(--jx-radius-sm)",background:"var(--hover-bg)",fontSize:"var(--jx-text-xs)"},'& [part="hosting"] > section':{padding:"var(--jx-space-4)",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)"},'& [part="busy"]':{margin:"0",padding:"var(--jx-space-2) var(--jx-space-5)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:"`failure`, not `error`: a kit text field keeps a permanent live region named `error`, and a rule on that name would reach the summary field's (surface-part-names.test.ts).",margin:"0",padding:"var(--jx-space-2) var(--jx-space-5)",color:"var(--danger)",borderTop:"1px solid var(--border)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"header",attributes:{part:"head"},children:[{tagName:"h2",attributes:{part:"heading",id:"${state.titleId}"},textContent:"Publish"},{tagName:"span",attributes:{part:"headline"},textContent:"${state.headline}"}]},{tagName:"jx-tabs",attributes:{part:"tabs",selected:"${state.tab}"},$props:{label:"Publish views"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectTab"},value:[{$ref:"event#/detail"}]}]},children:[{$prototype:"Array",items:{$ref:"#/state/tabs"},key:{$ref:"$map/item/value"},map:{tagName:"jx-tab",attributes:{part:"tab",value:"${$map.item.value}",label:"${$map.item.label}",panel:"${state.panelId}","data-tab":"${$map.item.value}"}}}]},{tagName:"div",attributes:{part:"body",id:"${state.panelId}",role:"tabpanel","data-tab":"${state.tab}","aria-label":"${state.tabTitle}"},children:[{tagName:"div",attributes:{part:"tab-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/tab"},cases:{review:{tagName:"div",attributes:{part:"review-slot-mood",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mood"},cases:{"no-project":{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Open a project to publish it. Publishing reviews your saved changes and sends them to your site."},{tagName:"div",attributes:{part:"clone-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canClone"},cases:{true:{tagName:"jx-button",attributes:{part:"clone"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clone"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"download-simple"}},{tagName:"span",textContent:"Clone Git Repository"}]}}}]},loading:{tagName:"p",attributes:{part:"status"},textContent:"Loading…"},"no-repo":{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"This project is not tracked by git yet. Publishing starts with a repository, which keeps every version you publish."},{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"init"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/initRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"Initialize Repository"}]}]}]},repo:{tagName:"div",attributes:{part:"review"},children:[{tagName:"div",attributes:{part:"changes-column"},children:[{tagName:"div",attributes:{part:"sync-bar"},children:[{tagName:"jx-action-button",attributes:{part:"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh source control",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"${state.syncLabel}"},{tagName:"span",attributes:{part:"updated-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLastUpdated"},cases:{true:{tagName:"span",attributes:{part:"sync-time"},textContent:"${state.lastUpdated}"}}}]},{tagName:"div",attributes:{part:"remote-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/remoteState"},cases:{remote:{tagName:"jx-action-group",attributes:{part:"sync-actions"},$props:{label:"Sync with the remote",compact:!1},children:[{tagName:"jx-action-button",attributes:{part:"fetch"},$props:{icon:"download-simple",size:"sm",quiet:!0,label:"Fetch",hint:"Fetch from the remote",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/fetch"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"pull"},$props:{icon:"arrow-down",size:"sm",quiet:!0,label:{$ref:"#/state/pullLabel"},hint:{$ref:"#/state/pullLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pull"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"push"},$props:{icon:"arrow-up",size:"sm",quiet:!0,label:{$ref:"#/state/pushLabel"},hint:{$ref:"#/state/pushLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/push"},value:[]}]}}]},local:{tagName:"jx-button",attributes:{part:"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}}}]},{tagName:"section",attributes:{part:"changes"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Changes"},{tagName:"div",attributes:{part:"changes-bar"},children:[{tagName:"span",attributes:{part:"included"},textContent:"${state.includedLabel}"},{tagName:"div",attributes:{part:"include-all-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"jx-checkbox",attributes:{part:"include-all"},$props:{checked:{$ref:"#/state/allIncluded"},indeterminate:{$ref:"#/state/someIncluded"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/includeAll"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Include all"}]}}}]},{tagName:"div",attributes:{part:"groups-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"div",attributes:{part:"groups"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"group"},children:[{tagName:"div",attributes:{part:"group-name"},textContent:"${$map.item.name}"},{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-included":"${$map.item.included}"},children:[{tagName:"jx-checkbox",attributes:{part:"include","data-path":"${$map.item.path}"},$props:{checked:{$ref:"$map/item/included"},label:{$ref:"$map/item/includeLabel"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/include"},value:[{$ref:"$map/item/path"},{$ref:"event#/target/checked"}]}]}},{tagName:"span",attributes:{part:"file-text"},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}",title:"${$map.item.statusWord}"},textContent:"${$map.item.status}"},{tagName:"jx-action-button",attributes:{part:"compare","data-path":"${$map.item.path}"},$props:{icon:"columns",size:"sm",quiet:!0,label:{$ref:"$map/item/compareLabel"},hint:"Before and after"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/compare"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"discard","data-path":"${$map.item.path}"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:{$ref:"$map/item/discardLabel"},hint:{$ref:"$map/item/discardHint"},disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"Nothing to publish. Files you edit and save show up here, ready to review."}}}]},{tagName:"section",attributes:{part:"history"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Recent commits"},{tagName:"div",attributes:{part:"history-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/commitsState"},cases:{listed:{tagName:"ul",attributes:{part:"history-list"},children:[{$prototype:"Array",items:{$ref:"#/state/commits"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"history-entry"},children:[{tagName:"span",attributes:{part:"history-hash"},textContent:"${$map.item.hash}"},{tagName:"span",attributes:{part:"history-message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"history-meta"},textContent:"${$map.item.meta}"}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"No commits yet. Each change set you publish becomes a version you can come back to."}}}]}]},{tagName:"div",attributes:{part:"publish-column"},children:[{tagName:"section",attributes:{part:"checks"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Checks"},{tagName:"ul",attributes:{part:"check-list"},children:[{$prototype:"Array",items:{$ref:"#/state/checks"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"check","data-check":"${$map.item.key}","data-state":"${$map.item.state}"},children:[{tagName:"jx-icon",attributes:{part:"check-icon"},$props:{name:{$ref:"$map/item/icon"},label:{$ref:"$map/item/iconLabel"}}},{tagName:"span",attributes:{part:"check-text"},textContent:"${$map.item.text}"},{tagName:"span",attributes:{part:"check-action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",attributes:{part:"check-action",title:"${$map.item.actionTitle}","data-check":"${$map.item.key}"},$props:{size:"sm",disabled:{$ref:"$map/item/actionDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runCheck"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}}]}}]}]},{tagName:"section",attributes:{part:"destination","data-jx-region":"${state.commitRegion}","aria-labelledby":"${state.destinationId}"},children:[{tagName:"h3",attributes:{part:"section-heading",id:"${state.destinationId}"},textContent:"Where should these changes go?"},{tagName:"jx-action-group",attributes:{part:"destinations"},$props:{selects:"single",label:"Destination",compact:!1,orientation:"vertical"},children:[{$prototype:"Array",items:{$ref:"#/state/destinations"},key:{$ref:"$map/item/value"},map:{tagName:"jx-action-button",attributes:{part:"destination-card","data-destination":"${$map.item.value}"},$props:{label:{$ref:"$map/item/label"},checked:{$ref:"$map/item/checked"},disabled:{$ref:"$map/item/disabled"},hint:{$ref:"$map/item/reason"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickDestination"},value:[{$ref:"$map/item/value"}]}]},children:[{tagName:"span",attributes:{part:"choice-name"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"choice-note"},textContent:"${$map.item.note}"}]}}]},{tagName:"div",attributes:{part:"refusal-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasRefusal"},cases:{true:{tagName:"p",attributes:{part:"refusal"},textContent:"${state.refusal}"}}},{tagName:"jx-field",attributes:{part:"summary-field"},$props:{label:"Summary",span:!0,description:"Saved with the change as its commit message."},children:[{tagName:"jx-textfield",attributes:{part:"summary"},$props:{multiline:!0,size:"sm",placeholder:"Describe what changed, e.g. Add a pricing page",value:{$ref:"#/state/summary"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editSummary"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"publish-actions"},children:[{tagName:"jx-button",attributes:{part:"publish-button","data-destination":"${state.destination}"},$props:{variant:"accent",size:"md",disabled:{$ref:"#/state/primaryDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/publish"},value:[]}]},children:[{tagName:"span",textContent:"${state.primaryLabel}"}]},{tagName:"div",attributes:{part:"blocker-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasBlocker"},cases:{true:{tagName:"p",attributes:{part:"blocker"},textContent:"${state.blocker}"}}}]},{tagName:"div",attributes:{part:"review-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/reviewState"},cases:{opened:{tagName:"p",attributes:{part:"review-line"},children:[{tagName:"span",attributes:{part:"review-text"},textContent:"${state.reviewLine}"},{tagName:"jx-button",attributes:{part:"open-review"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"#/state/reviewUrl"}]}]},children:[{tagName:"span",textContent:"Open pull request"}]}]}}}]}]}]}}},deploys:{tagName:"div",attributes:{part:"deploys"},children:[{tagName:"section",attributes:{part:"live"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Live"},{tagName:"div",attributes:{part:"live-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLiveUrl"},cases:{true:{tagName:"div",attributes:{part:"live-site"},children:[{tagName:"span",attributes:{part:"live-url"},textContent:"${state.liveUrl}"},{tagName:"jx-button",attributes:{part:"visit"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"#/state/liveUrl"}]}]},children:[{tagName:"jx-icon",$props:{name:"globe"}},{tagName:"span",textContent:"Visit site"}]}]},false:{tagName:"p",attributes:{part:"live-none"},textContent:"${state.liveNone}"}}},{tagName:"p",attributes:{part:"live-summary"},textContent:"${state.liveSummary}"},{tagName:"div",attributes:{part:"command-row"},children:[{$prototype:"Array",items:{$ref:"#/state/deployCommands"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"command","data-command":"${$map.item.id}",title:"${$map.item.title}"},$props:{size:"sm",disabled:{$ref:"$map/item/disabled"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}]},{tagName:"div",attributes:{part:"running-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/runningState"},cases:{running:{tagName:"section",attributes:{part:"running"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Publishing now"},{$prototype:"Array",items:{$ref:"#/state/running"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"activity"},children:[{tagName:"div",attributes:{part:"activity-head"},children:[{tagName:"span",attributes:{part:"activity-title"},textContent:"${$map.item.title}"},{tagName:"span",attributes:{part:"activity-status"},textContent:"${$map.item.status}"}]},{tagName:"ol",attributes:{part:"activity-steps"},children:[{$prototype:"Array",items:{$ref:"$map/item/steps"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"activity-step","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-label"},textContent:"${$map.item.label}"}]}}]}]}}]}}},{tagName:"section",attributes:{part:"deploy-history"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"History"},{tagName:"jx-action-button",attributes:{part:"reload-deploys"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh deployments",hint:"Ask the host again",disabled:{$ref:"#/state/deploysBusy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/reloadDeployments"},value:[]}]}}]},{tagName:"div",attributes:{part:"deploys-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/deploysState"},cases:{listed:{tagName:"div",attributes:{part:"history-rows",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/historyState"},cases:{listed:{tagName:"ol",attributes:{part:"deployment-list"},children:[{$prototype:"Array",items:{$ref:"#/state/history"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"deployment","data-environment":"${$map.item.environment}"},children:[{tagName:"span",attributes:{part:"deployment-when"},textContent:"${$map.item.when}"},{tagName:"span",attributes:{part:"deployment-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"deployment-status","data-status":"${$map.item.statusKey}",title:"${$map.item.statusDetail}"},textContent:"${$map.item.status}"},{tagName:"jx-action-button",attributes:{part:"open-deployment"},$props:{icon:"arrow-square-out",size:"sm",quiet:!0,label:{$ref:"$map/item/openLabel"},hint:{$ref:"$map/item/url"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"$map/item/url"}]}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"The host reports no deployments of this project yet."}}},loading:{tagName:"p",attributes:{part:"status"},textContent:"Asking the host for its deployments…"},note:{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.deploysNote}"}}}]},{tagName:"section",attributes:{part:"previews"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Branch previews"},{tagName:"div",attributes:{part:"previews-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/previewsState"},cases:{listed:{tagName:"ol",attributes:{part:"deployment-list"},children:[{$prototype:"Array",items:{$ref:"#/state/previews"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"deployment","data-environment":"${$map.item.environment}"},children:[{tagName:"span",attributes:{part:"deployment-when"},textContent:"${$map.item.when}"},{tagName:"span",attributes:{part:"deployment-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"deployment-status","data-status":"${$map.item.statusKey}",title:"${$map.item.statusDetail}"},textContent:"${$map.item.status}"},{tagName:"jx-action-button",attributes:{part:"open-deployment"},$props:{icon:"arrow-square-out",size:"sm",quiet:!0,label:{$ref:"$map/item/openLabel"},hint:{$ref:"$map/item/url"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"$map/item/url"}]}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"No previews. A branch pushed to the remote is deployed as a preview of its own, with its own address."}}}]}]},branches:{tagName:"div",attributes:{part:"branches"},children:[{tagName:"section",attributes:{part:"branch-list-section"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Branches"},{tagName:"jx-button",attributes:{part:"new-branch"},$props:{size:"sm",disabled:{$ref:"#/state/newBranchDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/newBranch"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"New branch"}]}]},{tagName:"p",attributes:{part:"branch-summary"},textContent:"${state.branchSummary}"},{tagName:"div",attributes:{part:"branch-note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasBranchNote"},cases:{true:{tagName:"p",attributes:{part:"branch-note"},textContent:"${state.branchNote}"}}},{tagName:"div",attributes:{part:"branches-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/branchesState"},cases:{listed:{tagName:"ul",attributes:{part:"branch-list"},children:[{$prototype:"Array",items:{$ref:"#/state/branches"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"branch","data-branch":"${$map.item.name}","data-current":"${$map.item.current}"},children:[{tagName:"jx-icon",attributes:{part:"branch-icon"},$props:{name:"git-branch"}},{tagName:"span",attributes:{part:"branch-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"branch-state",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/current"},cases:{true:{tagName:"span",attributes:{part:"current"},children:[{tagName:"span",attributes:{part:"current-tag"},textContent:"Current"},{tagName:"span",attributes:{part:"branch-sync"},textContent:"${$map.item.note}"}]},false:{tagName:"jx-button",attributes:{part:"switch","data-branch":"${$map.item.name}"},$props:{size:"sm",label:{$ref:"$map/item/switchName"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/checkout"},value:[{$ref:"$map/item/name"}]}]},children:[{tagName:"span",textContent:"${$map.item.switchLabel}"}]}}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.branchesEmpty}"}}}]}]},hosting:{tagName:"div",attributes:{part:"hosting"},children:[{tagName:"section",attributes:{part:"source"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Where your project is saved"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.sourceSummary}"},{tagName:"div",attributes:{part:"command-row"},children:[{$prototype:"Array",items:{$ref:"#/state/sourceCommands"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"command","data-command":"${$map.item.id}",title:"${$map.item.title}"},$props:{size:"sm",disabled:{$ref:"$map/item/disabled"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}]},{tagName:"section",attributes:{part:"host"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Where your site is hosted"},{tagName:"p",attributes:{part:"host-name"},textContent:"${state.hostTitle}"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.hostSummary}"},{tagName:"div",attributes:{part:"command-row"},children:[{$prototype:"Array",items:{$ref:"#/state/hostCommands"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"command","data-command":"${$map.item.id}",title:"${$map.item.title}"},$props:{size:"sm",disabled:{$ref:"$map/item/disabled"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}]},{tagName:"section",attributes:{part:"build"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"How it is built"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"The build adapter decides what the build produces: static files, or a server for sign-in and data routes."},{tagName:"div",$description:"The mount box for the Deploy section (`settings/project-sections.ts` `renderDeploySection`, `surfaces/settings-deploy.json`), which moved here from Project Settings (studio.md §17.1). The flow is handed this node by `onNodeCreated` and mounts the section into it; nothing in this document styles what lands here.",attributes:{part:"adapter-island",role:"none"}}]},{tagName:"section",attributes:{part:"address"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Your address"},{tagName:"div",attributes:{part:"domain-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/domainState"},cases:{set:{tagName:"div",attributes:{part:"live-site"},children:[{tagName:"span",attributes:{part:"live-url"},textContent:"${state.domain}"},{tagName:"jx-button",attributes:{part:"visit"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"#/state/domain"}]}]},children:[{tagName:"jx-icon",$props:{name:"globe"}},{tagName:"span",textContent:"Visit site"}]}]}}},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.domainNote}"}]},{tagName:"section",attributes:{part:"checklist"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Deploy checklist"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.checklistSummary}"},{tagName:"ol",attributes:{part:"checklist-steps"},children:[{$prototype:"Array",items:{$ref:"#/state/checklistSteps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"checklist-step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"jx-icon",attributes:{part:"step-icon"},$props:{name:{$ref:"$map/item/icon"},label:{$ref:"$map/item/iconLabel"}}},{tagName:"span",attributes:{part:"step-label"},textContent:"${$map.item.text}"}]}}]}]}]}}}]},{tagName:"div",attributes:{part:"busy-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/busy"},cases:{true:{tagName:"p",attributes:{part:"busy",role:"status"},textContent:"Working…"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.error}"}}}]};E("publish-workspace",lt);function Pt(){return{allIncluded:!1,blocker:"",branchNote:"",branchSummary:"",branches:[],branchesEmpty:"",branchesState:"empty",busy:!1,canClone:!1,checklistSteps:[],checklistSummary:"",checks:[],commitRegion:"",commits:[],commitsState:"empty",deployCommands:[],deploysBusy:!1,deploysNote:"",deploysState:"note",destination:"live",destinationId:"",destinations:[],domain:"",domainNote:"",domainState:"none",error:"",filesState:"empty",groups:[],hasBlocker:!1,hasBranchNote:!1,hasError:!1,hasLastUpdated:!1,hasLiveUrl:!1,hasRefusal:!1,headline:"",history:[],historyState:"empty",hostCommands:[],hostSummary:"",hostTitle:"",includedLabel:"",lastUpdated:"",liveNone:"",liveSummary:"",liveUrl:"",mood:"loading",newBranchDisabled:!1,panelId:"",previews:[],previewsState:"empty",primaryDisabled:!0,primaryLabel:"",pullLabel:"Pull",pushLabel:"Push",refusal:"",region:"",remoteState:"local",reviewLine:"",reviewState:"none",reviewUrl:"",running:[],runningState:"none",someIncluded:!1,sourceCommands:[],sourceSummary:"",summary:"",syncLabel:"",tab:"review",tabTitle:"",tabs:[],titleId:""}}function Rt(t){let e=t?.$map,a=v(e)?e.item:void 0,r=v(a)?a.path:void 0;return n(r)?r:""}function Dt(t){let e=n(t)?void 0:t.attributes?.part;return n(e)?e:""}function pt(t,e,a){t.replaceChildren();let{adapterHost:r,compareHost:i,...l}=a,o=g({...Pt(),...l});Object.assign(o,e);let c=null,m=!1,f=R("publish-workspace",o,t,{onNodeCreated:(d,y,j,w)=>{if(m||!(d instanceof HTMLElement))return;let h=Dt(j);if(h==="adapter-island")r(d);else if(h==="compare")i(d,Rt(w))}}).then((d)=>{if(m)d.dispose();else c=d;return d.root});return{attached:()=>{if(m)return!1;let d=c?.root;return d===void 0?!0:d instanceof HTMLElement&&t.contains(d)},dispose(){m=!0,c?.dispose(),c=null},ready:f,update:(d)=>{Object.assign(o,d)}}}async function V(){let t=Ri();if(!t||!Zl()||u.publish.deploys.state==="loading")return;let e=u.publish.deploys,a=t.projectName,r=()=>u.publish.deploys!==e||Ri()?.projectName!==a;e.state="loading",e.project=a;try{let i=await IL(t);if(r()){dt(e);return}e.rows=i,e.error="",e.state="loaded",jd(i[0]??null)}catch(i){if(r()){dt(e);return}e.rows=[],e.error=X(i),e.state="failed"}}function dt(t){if(u.publish.deploys===t)t.state="idle"}function bt(){let t=DL(),{deploys:e}=u.publish;return e.state==="loaded"&&t!==null&&!e.rows.some((a)=>a.id===t.id)}function Lt(){return u.publish.deploys.state==="idle"||bt()}function PD(t){if(u.publish.tab=t,t==="review"&&u.git.logEntries===null&&u.git.status?.isRepo)KS();if(t==="deploys"&&(u.publish.deploys.state!=="loaded"||bt()))V()}var Tt=new Map([["done",{icon:"check",label:"Passed"}],["failed",{icon:"x",label:"Failed"}],["running",{icon:"spinner",label:"Running"}],["todo",{icon:"warning-circle",label:"To do"}],["unknown",{icon:"question",label:"Not checked yet"}]]);function ct(t){return Tt.get(t)??{icon:"question",label:"Not checked yet"}}function At(t){return`${t} ${t===1?"change":"changes"}`}function gt(){return u.git.status?.files??[]}function O(){let t=u.git.status?.remotes;return Array.isArray(t)&&t.length>0?t[0]??"":""}function z(){if(!C)return"no-project";let{error:t,loading:e,status:a}=u.git;if(!a&&!e&&!t)return"loading";return a&&!a.isRepo?"no-repo":"repo"}function F(){return u.git.branches?.current||u.git.status?.branch||""}function mt(){let{status:t}=u.git,e=t?.ahead?`${t.ahead} ahead`:"",a=t?.behind?`${t.behind} behind`:"";return e||a?[e,a].filter(Boolean).join(", "):"Up to date"}function Ht(t){if(t==="no-repo")return"Not tracked by git yet";if(t!=="repo")return"";let e=gt().length;return`${F()?`On ${F()}`:"On a branch with no name yet"} · ${e>0?`${At(e)} to publish`:"nothing to publish"}`}function It(t){return{files:t.files.map((e)=>({...e,compareLabel:`Before and after: ${e.label}`,discardHint:e.cannotDiscard?"A new file has no saved version to go back to":"Discard changes",discardLabel:`Discard changes to ${e.path}`,includeLabel:`Include ${e.path}`})),key:t.key,name:t.name}}function L(t){let e=ae();if(!e)return[];return t.flatMap((a)=>{let r=e.get(a);if(!r||!e.isVisible(a))return[];let i=e.disabledReason(a);return[{disabled:i!==void 0,id:a,label:r.title,title:i?`${r.title}: requires ${i}`:r.title}]})}function Wt(t){let e={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,icon:ct(t.state).icon,iconLabel:ct(t.state).label,key:t.key,state:t.state,text:t.text};if(t.key==="build"){if(t.state==="running"||!X_())return e;let r=t.state==="unknown"?"Check build":"Check again";return{...e,actionLabel:r,actionTitle:r,hasAction:!0}}let[a]=t.command?L([t.command]):[];return a?{...e,actionDisabled:a.disabled,actionLabel:a.label,actionTitle:a.title,hasAction:!0}:e}function Bt(t){let[e]=t.filter((a)=>a.environment==="production"&&ft(a)).toSorted((a,r)=>Date.parse(r.createdOn)-Date.parse(a.createdOn));return e?.id??""}function ft(t){return t.status==="success"&&t.stage==="deploy"}function zt(t,e){if(t.status==="failure")return"Failed";if(t.status==="canceled")return"Canceled";if(!ft(t))return"Building…";if(t.environment!=="production")return"Ready";return t.id===e?"Live":"Replaced"}function ut(t,e){let r=t.environment==="production"?`Production${t.branch?` · ${t.branch}`:""}`:t.branch||"Preview";return{environment:t.environment,key:t.id,label:r,openLabel:`Open ${r}`,status:zt(t,e),statusDetail:`${t.stage}: ${t.status}`,statusKey:t.status,url:t.url,when:Yw(t.createdOn)}}function Et(){if(!Zl())return{deploysNote:"This host cannot reach the Cloudflare API, so deployments are not listed here. Your host runs bunx jx build and serves dist/.",deploysState:"note"};if(!Ri())return{deploysNote:"Connect a host under Hosting, and every deployment it makes is listed here.",deploysState:"note"};if(u.publish.deploys.state==="failed")return{deploysNote:`The host did not answer: ${u.publish.deploys.error}`,deploysState:"note"};return{deploysNote:"",deploysState:u.publish.deploys.state==="loaded"?"listed":"loading"}}function Ft(){return u.publish.deploys.project===Ri()?.projectName?u.publish.deploys.rows:[]}function yt(){return Ri()?.productionUrl||C?.projectConfig?.url||""}function Mt(t){let e=Ri();if(e?.productionUrl)return"Cloudflare Pages serves it. A custom domain is added on the Cloudflare dashboard.";if(e)return"Cloudflare has not reported an address yet. A custom domain is added on the Cloudflare dashboard.";return t?"The Production URL in Project Settings › Overview. No host is connected yet; once one is, point this domain at it on the host's dashboard.":"Your site gets an address when a host is connected, or set its Production URL in Project Settings › Overview."}function Ut(t){if(!Ri())return yt()?"No host is connected, so Studio cannot say what is deployed there. Connect one under Hosting.":"";let e=t.find((o)=>o.environment==="production"),a=DL(),r=a&&(a.environment==="production"||!e)?a:void 0,[i]=[e,r].filter((o)=>o!==void 0).toSorted((o,c)=>Date.parse(c.createdOn)-Date.parse(o.createdOn));if(!i)return"No deployment has been observed yet.";let l=i.branch?` from ${i.branch}`:"";return`Last deployed ${Yw(i.createdOn)}${l} · ${i.stage}: ${i.status}`}function Vt(){let{status:t}=u.git;if(!C)return"";if(!t)return"Source control has not reported on this project yet.";if(!t.isRepo)return"Not tracked by git yet. A repository keeps every version you publish.";let e=F()||"an unnamed branch",a=O();if(Us())return`Saved on GitHub${a?` (${a})`:""}, on ${e}. Every commit lands there as it is made.`;return a?`Saved in git and pushed to ${a}, on ${e}.`:`Saved in git on this machine only, on ${e}. A host builds from a remote, so create the GitHub repository next.`}function Ot(){let{status:t}=u.git;if(!t)return["git.signInToGithub"];if(!t.isRepo)return["git.init","git.signInToGithub"];if(O()==="")return["git.createGithubRepository","git.signInToGithub"];return Us()?["git.signInToGithub"]:["git.push","git.signInToGithub"]}function Jt(){let t=Ri();if(t)return{hostSummary:`Every publish is pushed to the remote and built by Cloudflare Pages${t.productionUrl?` at ${t.productionUrl}`:""}.`,hostTitle:`Cloudflare Pages: ${t.projectName}`};if(ye()&&p().cfConnect)return{hostSummary:"Runs on Cloudflare with nothing to configure: connect it, and every publish builds and deploys.",hostTitle:"Jx Cloud, on Cloudflare"};if(Zl())return{hostSummary:"Connect a Cloudflare API token, and every publish builds and deploys on your own account.",hostTitle:"Your Cloudflare account"};return{hostSummary:"This host cannot reach Cloudflare. Choose a build adapter below; your host runs bunx jx build and serves dist/.",hostTitle:"Another host"}}function ht(t){let e=t.replaceAll(/[^\w-]/g,"-"),a=z(),{git:r}=u,i=gt(),l=i.filter((s)=>s.staged).length,{destination:o,tab:c}=u.publish,m=hm(o),f=a==="repo"?pm(m):"",d=o==="review"?pb():"",y=zD(),j=r.logEntries??[],w=Ri(),h=yt(),x=Ft(),J=x.filter((s)=>s.environment==="preview"),q=Bt(x),G=as.filter((s)=>s.source==="Publish"&&!Hc(s)),_=r.branches?.branches??[],A=r.branches?.current??"",P=Us(),H=O(),K=NL(),b=i.length;return{...Et(),...Jt(),allIncluded:b>0&&l===b,blocker:f,branchNote:P?"Each branch opens in its own session, so switching reloads Studio on that branch.":"",branchSummary:A?`On ${A}`:"",branches:_.map((s)=>({current:s===A,key:s,name:s,note:H?mt():"Local only",switchLabel:P?"Switch and reload":"Switch",switchName:P?`Switch to ${s} and reload`:`Switch to ${s}`})),branchesEmpty:a==="no-repo"?"This project is not tracked by git yet.":"No branches yet. The first commit makes one.",branchesState:_.length>0?"listed":"empty",busy:r.loading,canClone:Pb(),checklistSteps:K.steps,checklistSummary:K.summary,checks:a==="repo"?fb().map((s)=>Wt(s)):[],commitRegion:`${t}/commit`,commits:j.map((s)=>fL(s)),commitsState:j.length>0?"listed":"empty",deployCommands:L(w?["publish.deploy","publish.openDashboard"]:["publish.setUp"]),deploysBusy:u.publish.deploys.state==="loading",destination:m,destinationId:`${e}-destination`,destinations:hw(o),domain:h,domainNote:Mt(h),domainState:h?"set":"none",error:r.error??"",filesState:b>0?"listed":"empty",groups:pL(i).map((s)=>It(s)),hasBlocker:f!=="",hasBranchNote:P,hasError:Boolean(r.error),hasLastUpdated:Boolean(r.lastUpdated),hasLiveUrl:h!=="",hasRefusal:d!=="",headline:Ht(a),history:x.map((s)=>ut(s,q)),historyState:x.length>0?"listed":"empty",hostCommands:L(w?["publish.setUp","publish.openDashboard"]:["publish.setUp"]),includedLabel:b>0?`${l} of ${b} included`:"",lastUpdated:mL(r.lastUpdated),liveNone:w?"The host has not reported an address for this site yet.":"No host is connected. Connect one under Hosting, and every publish ships to it.",liveSummary:Ut(x),liveUrl:h,mood:a,newBranchDisabled:r.loading||a!=="repo",panelId:`${e}-body`,previews:J.map((s)=>ut(s,q)),previewsState:J.length>0?"listed":"empty",primaryDisabled:a!=="repo"||f!=="",primaryLabel:jD(m),pullLabel:r.status?.behind?`Pull (${r.status.behind} behind)`:"Pull",pushLabel:r.status?.ahead?`Push (${r.status.ahead} ahead)`:"Push",refusal:d,region:t,remoteState:H?"remote":"local",reviewLine:y?`Pull request #${y.number} is open for review.`:"",reviewState:y?"opened":"none",reviewUrl:y?.url??"",running:G.map((s)=>TL(s)),runningState:G.length>0?"running":"none",someIncluded:l>0&&l<b,sourceCommands:L(Ot()),sourceSummary:Vt(),summary:r.commitMessage,syncLabel:H?mt():"Local only (no remote)",tab:c,tabTitle:jC[c],tabs:Bm.map((s)=>({label:s==="review"&&b>0?`${jC[s]} (${b})`:jC[s],value:s})),titleId:`${e}-title`}}var k=new Map,M=new WeakMap;function $t(){return C?.projectConfig?.build?.adapter||"static"}function qt(t){let e=$t(),a=k.get(t);if(!a?.isConnected||M.get(a)===e)return;M.set(a,e),D(a)}function Gt(t){if(t==="build"){HD();return}let e=fb().find((a)=>a.key===t);if(e?.command)nt(e.command,void 0,"Publish")}function _t(t){return{adapterHost:(e)=>{let a=k.get(t);if(a&&a!==e)B(a);k.set(t,e),M.set(e,$t()),D(e)},checkout:(e)=>{hL(e)},clone:()=>{iL()},compare:(e)=>{U=e,oL(e)},compareHost:(e,a)=>{let r=T.get(t);if(!r)r=new Map,T.set(t,r);r.set(a,e)},createRepository:()=>{nt("git.createGithubRepository",void 0,"Publish")},discard:(e)=>{dL(e)},editSummary:(e)=>{u.git.commitMessage=e},fetch:()=>{rL()},include:(e,a)=>{aL(e,a)},includeAll:(e)=>{lL(e)},initRepository:()=>{nt("git.init",void 0,"Publish")},newBranch:()=>{uL()},openUrl:(e)=>{if(e)Vb(e)},pickDestination:(e)=>{if(Cx(e))u.publish.destination=e},publish:()=>{pw(hm(u.publish.destination))},pull:()=>{sL()},push:()=>{nt("git.push",void 0,"Publish")},refresh:()=>{ks()},reloadDeployments:()=>{V()},run:(e)=>{nt(e,void 0,"Publish")},runCheck:Gt,selectTab:(e)=>{if(mO(e))PD(e)}}}var S=new Map,T=new Map,U=null,vt=new Set;async function wt(t,e){await e.handle.ready;let a=U===null?void 0:T.get(t)?.get(U);if(a?.isConnected)(a.querySelector('[part="control"]')??a).focus()}function PE(t){let e=S.get(t);if(e?.wrap.isConnected&&e.handle.attached()){wt(t,e);return}vt.add(t)}function Y_(t,e){let a=S.get(t);return a!==void 0&&a.tabId===e.id&&a.wrap.isConnected&&a.handle.attached()}function Z_(t){let e=S.get(t);if(!e)return;e.scope.stop();let a=k.get(t);if(a)B(a);e.handle.dispose(),S.delete(t),k.delete(t),T.delete(t)}function FE(t,e){let{paneId:a,wrap:r}=t;if(Y_(a,e))return;if(Z_(a),ye()&&z()==="loading")ks();PD(u.publish.tab);let i=Ln(a,"publish"),l=pt(r,ht(i),_t(a)),o=me();o.run(()=>{te(()=>{let m=ht(i);if(m.mood==="repo")gL();if(l.update(m),qt(a),m.tab==="deploys"&&Lt())V()}),te(()=>{if(u.publish.tab==="review"&&z()==="repo")cL()})});let c={handle:l,scope:o,tabId:e.id,wrap:r};if(S.set(a,c),vt.delete(a))wt(a,c)}
1
+ import{X}from"./studio-9c6cbq2c.js";import{ae}from"./studio-wqfaqw4m.js";import{p,ye}from"./studio-4fnb5648.js";import{nt}from"./studio-tpxcryf2.js";import{Hm,no,Bm,jC,mO,Cx,u}from"./studio-pwctzka3.js";import{Zl,IL,Ri,jd,DL,NL}from"./studio-rr00ex23.js";import{as,Hc,TL}from"./studio-v7a7yb5w.js";import{ks,KS,Pb,Us,iL,oL,rL,sL,aL,lL,cL,dL,uL,hL,pL,fL,Yw,mL,gL}from"./studio-mrjtnm62.js";import{Vb}from"./studio-xva3hzkv.js";import{pb,hw,hm,jD,pm,X_,HD,fb,zD,pw}from"./studio-xx3r3sb0.js";import{C}from"./studio-4f7thq0p.js";import{Ln,E,R}from"./studio-9dq7rwc7.js";import{me,te,g}from"./studio-3qr08sxq.js";import{n,v}from"./studio-k3we3kqb.js";var Y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsDeploy",$description:"Publish › Hosting's build adapter (studio.md §22.8), which was Project Settings › Deploy: one row over `build.adapter`, and the sentence a failed write leaves behind. It draws no heading of its own: Hosting's \"How it is built\" section heads it, and a second title inside that card would name the same thing twice. The adapter (`surfaces/settings-deploy.ts`) hands in the chosen adapter, the enumeration it is chosen from and whatever the last write had to say; the document draws them and hands the change straight back. Nothing here reads `project.json`: a section that re-read the config while drawing would be a second opinion about a file one module already owns.",tagName:"section",attributes:{part:"deploy"},style:{$description:"What is NOT in this block is most of the conversion. Four borrowed rules had nothing to transcribe: `.settings-field-label` and `.settings-field-desc` drew a row's label and the sentence under it, and `jx-field` draws both — with the label actually NAMING the control, which the bare `<label class=…>` beside the picker never did; `.settings-field` added a 20px bottom margin to separate one row from the next, and this section has one row, so the margin separated it from the end of the section; and `.settings-section` was never defined by any stylesheet at all, which is why it sits in `check-styles.ts`'s allow-list rather than in a rule.",display:"block",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="section-error"]':{$description:'A write that failed, said under the section title rather than pinned to the picker: settings save on change, so a silent rejection would read as "my edit just vanished", and what failed was the whole file rather than the value. Its size read `--spectrum-font-size-75` with a 12px fallback, which resolved only inside `<sp-theme>` — a document is mounted in the settings pane, where that name is not in scope and the fallback is all it would ever have taken — so the size is the kit\'s scale and the colour is the studio layer\'s. It is `section-error` rather than `error` because the adapter picker is a `jx-select`, which draws a permanent `[part="error"]` of its own in this same light-DOM tree: a rule on that name would give the picker\'s own refusal sentence this 16px margin too.',margin:"0 0 16px",fontSize:"var(--jx-text-md)",color:"var(--danger)"},'& [part="adapter"]':{$description:"How wide the picker may grow. A control offering five short words does not want the width of a 900px pane, and 320px is the one thing `.settings-build-adapter` said that the kit does not — the same measure the two pickers in Locales take.",maxWidth:"320px"}},children:[{tagName:"div",attributes:{part:"section-error-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"section-error",role:"alert"},textContent:"${state.error}"}}},{tagName:"jx-field",attributes:{part:"row","data-field":"adapter"},$props:{span:!0,label:"Build adapter",description:"What the site is built for. Static writes plain files; the others emit a server entry for that runtime."},children:[{tagName:"jx-select",attributes:{part:"adapter"},$props:{size:"sm",options:{$ref:"#/state/adapters"},value:{$ref:"#/state/adapter"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAdapter"},value:[{$ref:"event#/target/value"}]}]}}]}]};E("settings-deploy",Y);function Q(t,e){if(e.adapter!==void 0)t.adapter=e.adapter;if(e.adapters!==void 0)t.adapters=e.adapters;if(e.error!==void 0)t.error=e.error,t.hasError=e.error!==""}function Z(t,e,a){let r=g({adapter:"",adapters:[],error:"",hasError:!1,setAdapter:a.setAdapter});Q(r,e),t.replaceChildren();let i=null,l=!1;return R("settings-deploy",r,t).then((o)=>{if(l){o.dispose();return}i=o}),{connected:()=>!l&&(i===null?t.childNodes.length===0:i.root.parentNode===t),dispose(){l=!0,i?.dispose(),i=null},update:(o)=>Q(r,o)}}var tt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsRawJson",$description:"Project Settings › Raw JSON: `project.json` as it is written, and the way through to editing it as text. The adapter (`surfaces/settings-rawjson.ts`) hands in the serialisation the save chokepoint itself produced, so what is drawn is what a save writes rather than a second pretty-printer that would disagree with the file by an indent. The button opens the SAME tab in the Code editor — one document, three editors (`studio.md` §9.3) — so switching to the text and back keeps one undo stack instead of forking two.",tagName:"section",attributes:{part:"rawjson"},style:{$description:"Two of the rules this section borrowed are gone rather than moved. `.settings-field-desc` styled the sentence under the title, and it is kept here because there is no `jx-field` in this section to draw it — a `<pre>` is not a control and wrapping one in a row would give the file a label it does not need. `.settings-edit-as-code` set `align-self: flex-start` on the button, which did nothing: its parent carried `.settings-section`, a class no stylesheet defines, so there was no flex container for the declaration to be about — and `jx-button` is `inline-flex`, so it already sits at the left of a block.",display:"block",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="intro"]':{$description:"The sentence under the title. Its size read `--spectrum-font-size-75` with a 12px fallback, a name that resolves only inside `<sp-theme>`; a document is mounted in the settings pane, so the fallback is all it could ever have taken and the size is the kit's scale now.",margin:"0 0 6px",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="file"]':{$description:"The file's name, said in the prose as the file it is. It borrowed a bare `<code>` element and whatever the page happened to give one; a document's styling is its own, so the face is stated here.",fontFamily:"var(--font-mono)"},'& [part="json"]':{$description:'`project.json` as it is saved. It scrolls in its own box: a 250-line file must not push the "Edit as code" action off the bottom of the section. Its background read `var(--bg-dim, var(--bg))` and `--bg-dim` is declared nowhere in the token layer, so the fallback is what has always painted it — written as what it resolves to rather than as a name that never resolved.',margin:"0 0 12px",padding:"12px",maxHeight:"420px",overflow:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-md)",color:"var(--fg)",whiteSpace:"pre"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"Raw JSON"},{tagName:"p",attributes:{part:"intro"},children:["The whole of ",{tagName:"code",attributes:{part:"file"},textContent:"project.json"},", as it is saved. Editing it as code opens the same document in the Code editor — one undo stack, one dirty flag."]},{tagName:"pre",attributes:{part:"json"},textContent:"${state.json}"},{tagName:"jx-button",attributes:{part:"edit"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAsCode"}}]},children:[{tagName:"span",textContent:"Edit as code"}]}]};E("settings-rawjson",tt);function et(t,e){if(e.json!==void 0)t.json=e.json}function at(t,e,a){let r=g({editAsCode:a.editAsCode,json:""});et(r,e),t.replaceChildren();let i=null,l=!1;return R("settings-rawjson",r,t).then((o)=>{if(l){o.dispose();return}i=o}),{connected:()=>!l&&(i===null?t.childNodes.length===0:i.root.parentNode===t),dispose(){l=!0,i?.dispose(),i=null},update:(o)=>et(r,o)}}var I=new WeakMap;function W(){return C?.projectConfig??{}}var kt=[{label:"Static",value:"static"},{label:"Bun",value:"bun"},{label:"Node",value:"node"},{label:"Cloudflare Workers",value:"cloudflare-workers"},{label:"Cloudflare Pages",value:"cloudflare-pages"}],N=new WeakMap;function rt(t){return{adapter:W().build?.adapter||"static",adapters:kt.map((e)=>({label:e.label,value:e.value})),error:I.get(t)??""}}async function St(t,e){try{await no(e),I.delete(t)}catch(a){I.set(t,`Could not save project.json — ${X(a)}`)}D(t)}var it=new WeakMap;function Ct(t){let e=it.get(t);if(!e)e={setAdapter:(a)=>{N.get(t)?.update({adapter:a}),St(t,{build:{...W().build,adapter:a}})}},it.set(t,e);return e}function D(t){let e=N.get(t);if(e?.connected()){e.update(rt(t));return}e?.dispose(),N.set(t,Z(t,rt(t),Ct(t)))}function B(t){N.get(t)?.dispose(),N.delete(t)}var st=new WeakMap;function ot(){return{json:Hm(W())}}function MD(t,e){let a=st.get(t);if(a?.connected()){a.update(ot());return}a?.dispose(),st.set(t,at(t,ot(),{editAsCode:e.editAsCode}))}var lt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublishWorkspace",$description:"The Publish workspace's home (studio.md §22.8): four sub-tabs over one body. Review changes is the change list grouped the way the site is organised (Pages, each content collection, Components, Layouts, Styles, Media, Other), each file's checkbox including it in the next publish (staging it), its Before and after opening the comparison (§21), then the checks, the destination, the summary and the one primary button. Deploys is the live site, any deploy running now with its steps, the history the host returns and the branch previews. Branches is the branch list with switch and create. Hosting is where the project is saved, where the site is hosted, the build adapter (an island: the Deploy section that moved here from Project Settings) and the address, with the deploy checklist under them. `publish/publish-workspace.ts` keeps every decision and hands this document strings and booleans; nothing here knows what a status letter means, which destination a host allows or what a deployment's stage is called.",tagName:"div",attributes:{part:"publish","data-jx-region":"${state.region}","data-tab":"${state.tab}","aria-labelledby":"${state.titleId}",role:"region"},style:{$description:"Fills the pane's stage by its own geometry, as the Media home does: the stage is `position: relative`, so the workspace takes the whole of it and scrolls its own body. The status colours are the theme's semantic tokens, so a check, a badge and a deployment's state follow light and dark without a hex anywhere.",position:"absolute",inset:"0",display:"flex",flexDirection:"column",boxSizing:"border-box",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",background:"var(--bg)",'& [part="head"]':{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:"var(--jx-space-3)",padding:"var(--jx-space-4) var(--jx-space-5) 0"},'& [part="heading"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600"},'& [part="headline"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="tabs"]':{padding:"0 var(--jx-space-5)",flexShrink:"0"},'& [part="body"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-4) var(--jx-space-5) var(--jx-space-6)",containerType:"inline-size",containerName:"publish-body"},'& [part="review"]':{$description:"Two columns as the board draws them, the changes on the left and the publish card on the right; below 760px of pane the card drops under the list rather than squeezing it.",display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(260px, 340px)",gap:"var(--jx-space-5)",alignItems:"start"},"@container publish-body (max-width: 760px)":{'& [part="review"]':{gridTemplateColumns:"minmax(0, 1fr)"}},'& [part="changes-column"], & [part="publish-column"], & [part="deploys"], & [part="branches"], & [part="hosting"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-5)",minWidth:"0"},'& [part="deploys"], & [part="branches"], & [part="hosting"]':{maxWidth:"760px"},"& section":{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",minWidth:"0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)"},'& [part="section-heading"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"600",color:"var(--fg-dim)",textTransform:"uppercase",letterSpacing:"0.04em"},'& [part="publish-column"] > section':{padding:"var(--jx-space-4)",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)"},'& [part="sync-bar"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3)",paddingBottom:"var(--jx-space-3)",borderBottom:"1px solid var(--border)"},'& [part="sync-text"]':{display:"flex",flex:"1 1 auto",flexDirection:"column",minWidth:"0"},'& [part="sync-label"]':{fontWeight:"600"},'& [part="sync-time"], & [part="included"], & [part="file-dir"], & [part="history-meta"], & [part="choice-note"], & [part="live-summary"], & [part="hosting-summary"], & [part="branch-sync"], & [part="branch-summary"], & [part="deployment-when"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="changes-bar"]':{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--jx-space-3)"},'& [part="groups"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="group-name"]':{fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)",fontFamily:"var(--font-mono)"},'& [part="file-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"2px var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)"},'& [part="file-row"]:hover, & [part="file-row"]:focus-within':{background:"var(--hover-bg)"},'& [part="file-text"]':{display:"flex",flex:"1",alignItems:"baseline",gap:"var(--jx-space-2)",minWidth:"0",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},'& [part="file-dir"]':{overflow:"hidden",textOverflow:"ellipsis"},'& [part="badge"]':{$description:"One letter and a colour, which is why the checkbox and the row's buttons carry the status in words as well.",flex:"none",width:"16px",color:"var(--signal)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",fontWeight:"700",textAlign:"center"},'& [part="badge"][data-status="A"], & [part="badge"][data-status="U"]':{color:"var(--success)"},'& [part="badge"][data-status="D"]':{color:"var(--danger)"},'& [part="badge"][data-status="R"]':{color:"var(--tag)"},'& [part="empty-message"], & [part="status"], & [part="live-none"]':{margin:"0",color:"var(--fg-dim)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-6)",textAlign:"center"},'& [part="empty"] > [part="empty-message"]':{maxWidth:"48ch"},'& [part="empty-actions"], & [part="command-row"], & [part="publish-actions"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-2)"},'& [part="history-list"], & [part="check-list"], & [part="deployment-list"], & [part="branch-list"], & [part="checklist-steps"], & [part="activity-steps"]':{margin:"0",padding:"0",listStyle:"none",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="history-entry"]':{display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)",alignItems:"baseline"},'& [part="history-hash"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="history-message"]':{flex:"1",minWidth:"0"},'& [part="checklist-step"], & [part="activity-step"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)"},'& [part="check"]':{$description:"Centred, not baseline-aligned: the row can hold a small kit button, and a small kit control is layout-contained, so it has no baseline to align on.",display:"flex",alignItems:"center",gap:"var(--jx-space-2)"},'& [part="check-text"]':{flex:"1",minWidth:"0",lineHeight:"1.4"},'& [part="check-icon"], & [part="step-icon"]':{$description:"A kit icon for a check or a checklist link, sized by the kit's own property so it stays square; the activity feed's steps still draw a one-character glyph, which `minWidth` keeps on the same column.",flex:"none",minWidth:"1em",textAlign:"center","--jx-icon-size":"1em",color:"var(--fg-dim)"},'& [part="checklist-step"] > [part="step-icon"]':{$description:"A baseline-aligned row places a kit icon's bottom edge on the text baseline, which draws it high; the negative end margin lowers it onto the line's middle.",marginBlockEnd:"-0.15em"},'& [data-state="done"] > [part="check-icon"], & [data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [data-state="failed"] > [part="check-icon"], & [data-state="failed"] > [part="step-icon"]':{color:"var(--danger)"},'& [data-state="todo"] > [part="check-icon"]':{color:"var(--warning)"},'& [part="destinations"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="destination-card"] > [part="control"]':{$description:"A destination is a card with a name and a sentence saying what it does, inside one radio, as Add new's choice cards are: the reader hears one name and sees both lines.",width:"100%",height:"auto",flexDirection:"column",alignItems:"flex-start",textAlign:"start",padding:"var(--jx-space-2) var(--jx-space-3)",gap:"2px",whiteSpace:"normal"},'& [part="choice-name"]':{display:"block",fontWeight:"600"},'& [part="choice-note"]':{display:"block"},'& [part="refusal"], & [part="blocker"]':{margin:"0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="review-line"], & [part="live-site"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-2)",margin:"0"},'& [part="live-url"]':{fontWeight:"600",wordBreak:"break-all"},'& [part="live-summary"], & [part="hosting-summary"], & [part="host-name"], & [part="branch-note"]':{margin:"0",lineHeight:"1.5"},'& [part="host-name"]':{fontWeight:"600"},'& [part="activity"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)"},'& [part="activity-head"]':{display:"flex",justifyContent:"space-between",gap:"var(--jx-space-3)"},'& [part="activity-title"]':{fontWeight:"600"},'& [part="activity-status"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="deployment"]':{display:"grid",gridTemplateColumns:"minmax(64px, auto) minmax(0, 1fr) auto auto",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-1) 0",borderBottom:"1px solid var(--border)"},'& [part="deployment-label"]':{minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="deployment-status"]':{fontSize:"var(--jx-text-sm)"},'& [part="deployment-status"][data-status="success"]':{color:"var(--success)"},'& [part="deployment-status"][data-status="failure"]':{color:"var(--danger)"},'& [part="branch"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-1) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)","--jx-icon-size":"16px"},'& [part="branch"]:hover':{background:"var(--hover-bg)"},'& [part="branch-icon"]':{color:"var(--fg-dim)"},'& [part="branch-name"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",fontFamily:"var(--font-mono)"},'& [part="current"]':{display:"inline-flex",gap:"var(--jx-space-2)",alignItems:"baseline"},'& [part="current-tag"]':{padding:"0 6px",borderRadius:"var(--jx-radius-sm)",background:"var(--hover-bg)",fontSize:"var(--jx-text-xs)"},'& [part="hosting"] > section':{padding:"var(--jx-space-4)",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)"},'& [part="busy"]':{margin:"0",padding:"var(--jx-space-2) var(--jx-space-5)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:"`failure`, not `error`: a kit text field keeps a permanent live region named `error`, and a rule on that name would reach the summary field's (surface-part-names.test.ts).",margin:"0",padding:"var(--jx-space-2) var(--jx-space-5)",color:"var(--danger)",borderTop:"1px solid var(--border)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"header",attributes:{part:"head"},children:[{tagName:"h2",attributes:{part:"heading",id:"${state.titleId}"},textContent:"Publish"},{tagName:"span",attributes:{part:"headline"},textContent:"${state.headline}"}]},{tagName:"jx-tabs",attributes:{part:"tabs",selected:"${state.tab}"},$props:{label:"Publish views"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectTab"},value:[{$ref:"event#/detail"}]}]},children:[{$prototype:"Array",items:{$ref:"#/state/tabs"},key:{$ref:"$map/item/value"},map:{tagName:"jx-tab",attributes:{part:"tab",value:"${$map.item.value}",label:"${$map.item.label}",panel:"${state.panelId}","data-tab":"${$map.item.value}"}}}]},{tagName:"div",attributes:{part:"body",id:"${state.panelId}",role:"tabpanel","data-tab":"${state.tab}","aria-label":"${state.tabTitle}"},children:[{tagName:"div",attributes:{part:"tab-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/tab"},cases:{review:{tagName:"div",attributes:{part:"review-slot-mood",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mood"},cases:{"no-project":{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Open a project to publish it. Publishing reviews your saved changes and sends them to your site."},{tagName:"div",attributes:{part:"clone-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canClone"},cases:{true:{tagName:"jx-button",attributes:{part:"clone"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clone"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"download-simple"}},{tagName:"span",textContent:"Clone Git Repository"}]}}}]},loading:{tagName:"p",attributes:{part:"status"},textContent:"Loading…"},"no-repo":{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"This project is not tracked by git yet. Publishing starts with a repository, which keeps every version you publish."},{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"init"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/initRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"Initialize Repository"}]}]}]},repo:{tagName:"div",attributes:{part:"review"},children:[{tagName:"div",attributes:{part:"changes-column"},children:[{tagName:"div",attributes:{part:"sync-bar"},children:[{tagName:"jx-action-button",attributes:{part:"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh source control",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"${state.syncLabel}"},{tagName:"span",attributes:{part:"updated-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLastUpdated"},cases:{true:{tagName:"span",attributes:{part:"sync-time"},textContent:"${state.lastUpdated}"}}}]},{tagName:"div",attributes:{part:"remote-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/remoteState"},cases:{remote:{tagName:"jx-action-group",attributes:{part:"sync-actions"},$props:{label:"Sync with the remote",compact:!1},children:[{tagName:"jx-action-button",attributes:{part:"fetch"},$props:{icon:"download-simple",size:"sm",quiet:!0,label:"Fetch",hint:"Fetch from the remote",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/fetch"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"pull"},$props:{icon:"arrow-down",size:"sm",quiet:!0,label:{$ref:"#/state/pullLabel"},hint:{$ref:"#/state/pullLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pull"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"push"},$props:{icon:"arrow-up",size:"sm",quiet:!0,label:{$ref:"#/state/pushLabel"},hint:{$ref:"#/state/pushLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/push"},value:[]}]}}]},local:{tagName:"jx-button",attributes:{part:"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}}}]},{tagName:"section",attributes:{part:"changes"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Changes"},{tagName:"div",attributes:{part:"changes-bar"},children:[{tagName:"span",attributes:{part:"included"},textContent:"${state.includedLabel}"},{tagName:"div",attributes:{part:"include-all-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"jx-checkbox",attributes:{part:"include-all"},$props:{checked:{$ref:"#/state/allIncluded"},indeterminate:{$ref:"#/state/someIncluded"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/includeAll"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Include all"}]}}}]},{tagName:"div",attributes:{part:"groups-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"div",attributes:{part:"groups"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"group"},children:[{tagName:"div",attributes:{part:"group-name"},textContent:"${$map.item.name}"},{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-included":"${$map.item.included}"},children:[{tagName:"jx-checkbox",attributes:{part:"include","data-path":"${$map.item.path}"},$props:{checked:{$ref:"$map/item/included"},label:{$ref:"$map/item/includeLabel"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/include"},value:[{$ref:"$map/item/path"},{$ref:"event#/target/checked"}]}]}},{tagName:"span",attributes:{part:"file-text"},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}",title:"${$map.item.statusWord}"},textContent:"${$map.item.status}"},{tagName:"jx-action-button",attributes:{part:"compare","data-path":"${$map.item.path}"},$props:{icon:"columns",size:"sm",quiet:!0,label:{$ref:"$map/item/compareLabel"},hint:"Before and after"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/compare"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"discard","data-path":"${$map.item.path}"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:{$ref:"$map/item/discardLabel"},hint:{$ref:"$map/item/discardHint"},disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"Nothing to publish. Files you edit and save show up here, ready to review."}}}]},{tagName:"section",attributes:{part:"history"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Recent commits"},{tagName:"div",attributes:{part:"history-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/commitsState"},cases:{listed:{tagName:"ul",attributes:{part:"history-list"},children:[{$prototype:"Array",items:{$ref:"#/state/commits"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"history-entry"},children:[{tagName:"span",attributes:{part:"history-hash"},textContent:"${$map.item.hash}"},{tagName:"span",attributes:{part:"history-message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"history-meta"},textContent:"${$map.item.meta}"}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"No commits yet. Each change set you publish becomes a version you can come back to."}}}]}]},{tagName:"div",attributes:{part:"publish-column"},children:[{tagName:"section",attributes:{part:"checks"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Checks"},{tagName:"ul",attributes:{part:"check-list"},children:[{$prototype:"Array",items:{$ref:"#/state/checks"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"check","data-check":"${$map.item.key}","data-state":"${$map.item.state}"},children:[{tagName:"jx-icon",attributes:{part:"check-icon"},$props:{name:{$ref:"$map/item/icon"},label:{$ref:"$map/item/iconLabel"}}},{tagName:"span",attributes:{part:"check-text"},textContent:"${$map.item.text}"},{tagName:"span",attributes:{part:"check-action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",attributes:{part:"check-action",title:"${$map.item.actionTitle}","data-check":"${$map.item.key}"},$props:{size:"sm",disabled:{$ref:"$map/item/actionDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runCheck"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}}]}}]}]},{tagName:"section",attributes:{part:"destination","data-jx-region":"${state.commitRegion}","aria-labelledby":"${state.destinationId}"},children:[{tagName:"h3",attributes:{part:"section-heading",id:"${state.destinationId}"},textContent:"Where should these changes go?"},{tagName:"jx-action-group",attributes:{part:"destinations"},$props:{selects:"single",label:"Destination",compact:!1,orientation:"vertical"},children:[{$prototype:"Array",items:{$ref:"#/state/destinations"},key:{$ref:"$map/item/value"},map:{tagName:"jx-action-button",attributes:{part:"destination-card","data-destination":"${$map.item.value}"},$props:{label:{$ref:"$map/item/label"},checked:{$ref:"$map/item/checked"},disabled:{$ref:"$map/item/disabled"},hint:{$ref:"$map/item/reason"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickDestination"},value:[{$ref:"$map/item/value"}]}]},children:[{tagName:"span",attributes:{part:"choice-name"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"choice-note"},textContent:"${$map.item.note}"}]}}]},{tagName:"div",attributes:{part:"refusal-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasRefusal"},cases:{true:{tagName:"p",attributes:{part:"refusal"},textContent:"${state.refusal}"}}},{tagName:"jx-field",attributes:{part:"summary-field"},$props:{label:"Summary",span:!0,description:"Saved with the change as its commit message."},children:[{tagName:"jx-textfield",attributes:{part:"summary"},$props:{multiline:!0,size:"sm",placeholder:"Describe what changed, e.g. Add a pricing page",value:{$ref:"#/state/summary"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editSummary"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"publish-actions"},children:[{tagName:"jx-button",attributes:{part:"publish-button","data-destination":"${state.destination}"},$props:{variant:"accent",size:"md",disabled:{$ref:"#/state/primaryDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/publish"},value:[]}]},children:[{tagName:"span",textContent:"${state.primaryLabel}"}]},{tagName:"div",attributes:{part:"blocker-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasBlocker"},cases:{true:{tagName:"p",attributes:{part:"blocker"},textContent:"${state.blocker}"}}}]},{tagName:"div",attributes:{part:"review-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/reviewState"},cases:{opened:{tagName:"p",attributes:{part:"review-line"},children:[{tagName:"span",attributes:{part:"review-text"},textContent:"${state.reviewLine}"},{tagName:"jx-button",attributes:{part:"open-review"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"#/state/reviewUrl"}]}]},children:[{tagName:"span",textContent:"Open pull request"}]}]}}}]}]}]}}},deploys:{tagName:"div",attributes:{part:"deploys"},children:[{tagName:"section",attributes:{part:"live"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Live"},{tagName:"div",attributes:{part:"live-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLiveUrl"},cases:{true:{tagName:"div",attributes:{part:"live-site"},children:[{tagName:"span",attributes:{part:"live-url"},textContent:"${state.liveUrl}"},{tagName:"jx-button",attributes:{part:"visit"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"#/state/liveUrl"}]}]},children:[{tagName:"jx-icon",$props:{name:"globe"}},{tagName:"span",textContent:"Visit site"}]}]},false:{tagName:"p",attributes:{part:"live-none"},textContent:"${state.liveNone}"}}},{tagName:"p",attributes:{part:"live-summary"},textContent:"${state.liveSummary}"},{tagName:"div",attributes:{part:"command-row"},children:[{$prototype:"Array",items:{$ref:"#/state/deployCommands"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"command","data-command":"${$map.item.id}",title:"${$map.item.title}"},$props:{size:"sm",disabled:{$ref:"$map/item/disabled"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}]},{tagName:"div",attributes:{part:"running-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/runningState"},cases:{running:{tagName:"section",attributes:{part:"running"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Publishing now"},{$prototype:"Array",items:{$ref:"#/state/running"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"activity"},children:[{tagName:"div",attributes:{part:"activity-head"},children:[{tagName:"span",attributes:{part:"activity-title"},textContent:"${$map.item.title}"},{tagName:"span",attributes:{part:"activity-status"},textContent:"${$map.item.status}"}]},{tagName:"ol",attributes:{part:"activity-steps"},children:[{$prototype:"Array",items:{$ref:"$map/item/steps"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"activity-step","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-label"},textContent:"${$map.item.label}"}]}}]}]}}]}}},{tagName:"section",attributes:{part:"deploy-history"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"History"},{tagName:"jx-action-button",attributes:{part:"reload-deploys"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh deployments",hint:"Ask the host again",disabled:{$ref:"#/state/deploysBusy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/reloadDeployments"},value:[]}]}}]},{tagName:"div",attributes:{part:"deploys-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/deploysState"},cases:{listed:{tagName:"div",attributes:{part:"history-rows",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/historyState"},cases:{listed:{tagName:"ol",attributes:{part:"deployment-list"},children:[{$prototype:"Array",items:{$ref:"#/state/history"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"deployment","data-environment":"${$map.item.environment}"},children:[{tagName:"span",attributes:{part:"deployment-when"},textContent:"${$map.item.when}"},{tagName:"span",attributes:{part:"deployment-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"deployment-status","data-status":"${$map.item.statusKey}",title:"${$map.item.statusDetail}"},textContent:"${$map.item.status}"},{tagName:"jx-action-button",attributes:{part:"open-deployment"},$props:{icon:"arrow-square-out",size:"sm",quiet:!0,label:{$ref:"$map/item/openLabel"},hint:{$ref:"$map/item/url"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"$map/item/url"}]}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"The host reports no deployments of this project yet."}}},loading:{tagName:"p",attributes:{part:"status"},textContent:"Asking the host for its deployments…"},note:{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.deploysNote}"}}}]},{tagName:"section",attributes:{part:"previews"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Branch previews"},{tagName:"div",attributes:{part:"previews-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/previewsState"},cases:{listed:{tagName:"ol",attributes:{part:"deployment-list"},children:[{$prototype:"Array",items:{$ref:"#/state/previews"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"deployment","data-environment":"${$map.item.environment}"},children:[{tagName:"span",attributes:{part:"deployment-when"},textContent:"${$map.item.when}"},{tagName:"span",attributes:{part:"deployment-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"deployment-status","data-status":"${$map.item.statusKey}",title:"${$map.item.statusDetail}"},textContent:"${$map.item.status}"},{tagName:"jx-action-button",attributes:{part:"open-deployment"},$props:{icon:"arrow-square-out",size:"sm",quiet:!0,label:{$ref:"$map/item/openLabel"},hint:{$ref:"$map/item/url"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"$map/item/url"}]}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"No previews. A branch pushed to the remote is deployed as a preview of its own, with its own address."}}}]}]},branches:{tagName:"div",attributes:{part:"branches"},children:[{tagName:"section",attributes:{part:"branch-list-section"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Branches"},{tagName:"jx-button",attributes:{part:"new-branch"},$props:{size:"sm",disabled:{$ref:"#/state/newBranchDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/newBranch"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"New branch"}]}]},{tagName:"p",attributes:{part:"branch-summary"},textContent:"${state.branchSummary}"},{tagName:"div",attributes:{part:"branch-note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasBranchNote"},cases:{true:{tagName:"p",attributes:{part:"branch-note"},textContent:"${state.branchNote}"}}},{tagName:"div",attributes:{part:"branches-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/branchesState"},cases:{listed:{tagName:"ul",attributes:{part:"branch-list"},children:[{$prototype:"Array",items:{$ref:"#/state/branches"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"branch","data-branch":"${$map.item.name}","data-current":"${$map.item.current}"},children:[{tagName:"jx-icon",attributes:{part:"branch-icon"},$props:{name:"git-branch"}},{tagName:"span",attributes:{part:"branch-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"branch-state",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/current"},cases:{true:{tagName:"span",attributes:{part:"current"},children:[{tagName:"span",attributes:{part:"current-tag"},textContent:"Current"},{tagName:"span",attributes:{part:"branch-sync"},textContent:"${$map.item.note}"}]},false:{tagName:"jx-button",attributes:{part:"switch","data-branch":"${$map.item.name}"},$props:{size:"sm",label:{$ref:"$map/item/switchName"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/checkout"},value:[{$ref:"$map/item/name"}]}]},children:[{tagName:"span",textContent:"${$map.item.switchLabel}"}]}}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.branchesEmpty}"}}}]}]},hosting:{tagName:"div",attributes:{part:"hosting"},children:[{tagName:"section",attributes:{part:"source"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Where your project is saved"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.sourceSummary}"},{tagName:"div",attributes:{part:"command-row"},children:[{$prototype:"Array",items:{$ref:"#/state/sourceCommands"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"command","data-command":"${$map.item.id}",title:"${$map.item.title}"},$props:{size:"sm",disabled:{$ref:"$map/item/disabled"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}]},{tagName:"section",attributes:{part:"host"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Where your site is hosted"},{tagName:"p",attributes:{part:"host-name"},textContent:"${state.hostTitle}"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.hostSummary}"},{tagName:"div",attributes:{part:"command-row"},children:[{$prototype:"Array",items:{$ref:"#/state/hostCommands"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"command","data-command":"${$map.item.id}",title:"${$map.item.title}"},$props:{size:"sm",disabled:{$ref:"$map/item/disabled"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}]},{tagName:"section",attributes:{part:"build"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"How it is built"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"The build adapter decides what the build produces: static files, or a server for sign-in and data routes."},{tagName:"div",$description:"The mount box for the Deploy section (`settings/project-sections.ts` `renderDeploySection`, `surfaces/settings-deploy.json`), which moved here from Project Settings (studio.md §17.1). The flow is handed this node by `onNodeCreated` and mounts the section into it; nothing in this document styles what lands here.",attributes:{part:"adapter-island",role:"none"}}]},{tagName:"section",attributes:{part:"address"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Your address"},{tagName:"div",attributes:{part:"domain-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/domainState"},cases:{set:{tagName:"div",attributes:{part:"live-site"},children:[{tagName:"span",attributes:{part:"live-url"},textContent:"${state.domain}"},{tagName:"jx-button",attributes:{part:"visit"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"#/state/domain"}]}]},children:[{tagName:"jx-icon",$props:{name:"globe"}},{tagName:"span",textContent:"Visit site"}]}]}}},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.domainNote}"}]},{tagName:"section",attributes:{part:"checklist"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Deploy checklist"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.checklistSummary}"},{tagName:"ol",attributes:{part:"checklist-steps"},children:[{$prototype:"Array",items:{$ref:"#/state/checklistSteps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"checklist-step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"jx-icon",attributes:{part:"step-icon"},$props:{name:{$ref:"$map/item/icon"},label:{$ref:"$map/item/iconLabel"}}},{tagName:"span",attributes:{part:"step-label"},textContent:"${$map.item.text}"}]}}]}]}]}}}]},{tagName:"div",attributes:{part:"busy-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/busy"},cases:{true:{tagName:"p",attributes:{part:"busy",role:"status"},textContent:"Working…"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.error}"}}}]};E("publish-workspace",lt);function Pt(){return{allIncluded:!1,blocker:"",branchNote:"",branchSummary:"",branches:[],branchesEmpty:"",branchesState:"empty",busy:!1,canClone:!1,checklistSteps:[],checklistSummary:"",checks:[],commitRegion:"",commits:[],commitsState:"empty",deployCommands:[],deploysBusy:!1,deploysNote:"",deploysState:"note",destination:"live",destinationId:"",destinations:[],domain:"",domainNote:"",domainState:"none",error:"",filesState:"empty",groups:[],hasBlocker:!1,hasBranchNote:!1,hasError:!1,hasLastUpdated:!1,hasLiveUrl:!1,hasRefusal:!1,headline:"",history:[],historyState:"empty",hostCommands:[],hostSummary:"",hostTitle:"",includedLabel:"",lastUpdated:"",liveNone:"",liveSummary:"",liveUrl:"",mood:"loading",newBranchDisabled:!1,panelId:"",previews:[],previewsState:"empty",primaryDisabled:!0,primaryLabel:"",pullLabel:"Pull",pushLabel:"Push",refusal:"",region:"",remoteState:"local",reviewLine:"",reviewState:"none",reviewUrl:"",running:[],runningState:"none",someIncluded:!1,sourceCommands:[],sourceSummary:"",summary:"",syncLabel:"",tab:"review",tabTitle:"",tabs:[],titleId:""}}function Rt(t){let e=t?.$map,a=v(e)?e.item:void 0,r=v(a)?a.path:void 0;return n(r)?r:""}function Dt(t){let e=n(t)?void 0:t.attributes?.part;return n(e)?e:""}function pt(t,e,a){t.replaceChildren();let{adapterHost:r,compareHost:i,...l}=a,o=g({...Pt(),...l});Object.assign(o,e);let c=null,m=!1,f=R("publish-workspace",o,t,{onNodeCreated:(d,y,j,w)=>{if(m||!(d instanceof HTMLElement))return;let h=Dt(j);if(h==="adapter-island")r(d);else if(h==="compare")i(d,Rt(w))}}).then((d)=>{if(m)d.dispose();else c=d;return d.root});return{attached:()=>{if(m)return!1;let d=c?.root;return d===void 0?!0:d instanceof HTMLElement&&t.contains(d)},dispose(){m=!0,c?.dispose(),c=null},ready:f,update:(d)=>{Object.assign(o,d)}}}async function V(){let t=Ri();if(!t||!Zl()||u.publish.deploys.state==="loading")return;let e=u.publish.deploys,a=t.projectName,r=()=>u.publish.deploys!==e||Ri()?.projectName!==a;e.state="loading",e.project=a;try{let i=await IL(t);if(r()){dt(e);return}e.rows=i,e.error="",e.state="loaded",jd(i[0]??null)}catch(i){if(r()){dt(e);return}e.rows=[],e.error=X(i),e.state="failed"}}function dt(t){if(u.publish.deploys===t)t.state="idle"}function bt(){let t=DL(),{deploys:e}=u.publish;return e.state==="loaded"&&t!==null&&!e.rows.some((a)=>a.id===t.id)}function Lt(){return u.publish.deploys.state==="idle"||bt()}function PD(t){if(u.publish.tab=t,t==="review"&&u.git.logEntries===null&&u.git.status?.isRepo)KS();if(t==="deploys"&&(u.publish.deploys.state!=="loaded"||bt()))V()}var Tt=new Map([["done",{icon:"check",label:"Passed"}],["failed",{icon:"x",label:"Failed"}],["running",{icon:"spinner",label:"Running"}],["todo",{icon:"warning-circle",label:"To do"}],["unknown",{icon:"question",label:"Not checked yet"}]]);function ct(t){return Tt.get(t)??{icon:"question",label:"Not checked yet"}}function At(t){return`${t} ${t===1?"change":"changes"}`}function gt(){return u.git.status?.files??[]}function O(){let t=u.git.status?.remotes;return Array.isArray(t)&&t.length>0?t[0]??"":""}function z(){if(!C)return"no-project";let{error:t,loading:e,status:a}=u.git;if(!a&&!e&&!t)return"loading";return a&&!a.isRepo?"no-repo":"repo"}function F(){return u.git.branches?.current||u.git.status?.branch||""}function mt(){let{status:t}=u.git,e=t?.ahead?`${t.ahead} ahead`:"",a=t?.behind?`${t.behind} behind`:"";return e||a?[e,a].filter(Boolean).join(", "):"Up to date"}function Ht(t){if(t==="no-repo")return"Not tracked by git yet";if(t!=="repo")return"";let e=gt().length;return`${F()?`On ${F()}`:"On a branch with no name yet"} · ${e>0?`${At(e)} to publish`:"nothing to publish"}`}function It(t){return{files:t.files.map((e)=>({...e,compareLabel:`Before and after: ${e.label}`,discardHint:e.cannotDiscard?"A new file has no saved version to go back to":"Discard changes",discardLabel:`Discard changes to ${e.path}`,includeLabel:`Include ${e.path}`})),key:t.key,name:t.name}}function L(t){let e=ae();if(!e)return[];return t.flatMap((a)=>{let r=e.get(a);if(!r||!e.isVisible(a))return[];let i=e.disabledReason(a);return[{disabled:i!==void 0,id:a,label:r.title,title:i?`${r.title}: requires ${i}`:r.title}]})}function Wt(t){let e={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,icon:ct(t.state).icon,iconLabel:ct(t.state).label,key:t.key,state:t.state,text:t.text};if(t.key==="build"){if(t.state==="running"||!X_())return e;let r=t.state==="unknown"?"Check build":"Check again";return{...e,actionLabel:r,actionTitle:r,hasAction:!0}}let[a]=t.command?L([t.command]):[];return a?{...e,actionDisabled:a.disabled,actionLabel:a.label,actionTitle:a.title,hasAction:!0}:e}function Bt(t){let[e]=t.filter((a)=>a.environment==="production"&&ft(a)).toSorted((a,r)=>Date.parse(r.createdOn)-Date.parse(a.createdOn));return e?.id??""}function ft(t){return t.status==="success"&&t.stage==="deploy"}function zt(t,e){if(t.status==="failure")return"Failed";if(t.status==="canceled")return"Canceled";if(!ft(t))return"Building…";if(t.environment!=="production")return"Ready";return t.id===e?"Live":"Replaced"}function ut(t,e){let r=t.environment==="production"?`Production${t.branch?` · ${t.branch}`:""}`:t.branch||"Preview";return{environment:t.environment,key:t.id,label:r,openLabel:`Open ${r}`,status:zt(t,e),statusDetail:`${t.stage}: ${t.status}`,statusKey:t.status,url:t.url,when:Yw(t.createdOn)}}function Et(){if(!Zl())return{deploysNote:"This host cannot reach the Cloudflare API, so deployments are not listed here. Your host runs bunx jx build and serves dist/.",deploysState:"note"};if(!Ri())return{deploysNote:"Connect a host under Hosting, and every deployment it makes is listed here.",deploysState:"note"};if(u.publish.deploys.state==="failed")return{deploysNote:`The host did not answer: ${u.publish.deploys.error}`,deploysState:"note"};return{deploysNote:"",deploysState:u.publish.deploys.state==="loaded"?"listed":"loading"}}function Ft(){return u.publish.deploys.project===Ri()?.projectName?u.publish.deploys.rows:[]}function yt(){return Ri()?.productionUrl||C?.projectConfig?.url||""}function Mt(t){let e=Ri();if(e?.productionUrl)return"Cloudflare Pages serves it. A custom domain is added on the Cloudflare dashboard.";if(e)return"Cloudflare has not reported an address yet. A custom domain is added on the Cloudflare dashboard.";return t?"The Production URL in Project Settings › Overview. No host is connected yet; once one is, point this domain at it on the host's dashboard.":"Your site gets an address when a host is connected, or set its Production URL in Project Settings › Overview."}function Ut(t){if(!Ri())return yt()?"No host is connected, so Studio cannot say what is deployed there. Connect one under Hosting.":"";let e=t.find((o)=>o.environment==="production"),a=DL(),r=a&&(a.environment==="production"||!e)?a:void 0,[i]=[e,r].filter((o)=>o!==void 0).toSorted((o,c)=>Date.parse(c.createdOn)-Date.parse(o.createdOn));if(!i)return"No deployment has been observed yet.";let l=i.branch?` from ${i.branch}`:"";return`Last deployed ${Yw(i.createdOn)}${l} · ${i.stage}: ${i.status}`}function Vt(){let{status:t}=u.git;if(!C)return"";if(!t)return"Source control has not reported on this project yet.";if(!t.isRepo)return"Not tracked by git yet. A repository keeps every version you publish.";let e=F()||"an unnamed branch",a=O();if(Us())return`Saved on GitHub${a?` (${a})`:""}, on ${e}. Every commit lands there as it is made.`;return a?`Saved in git and pushed to ${a}, on ${e}.`:`Saved in git on this machine only, on ${e}. A host builds from a remote, so create the GitHub repository next.`}function Ot(){let{status:t}=u.git;if(!t)return["git.signInToGithub"];if(!t.isRepo)return["git.init","git.signInToGithub"];if(O()==="")return["git.createGithubRepository","git.signInToGithub"];return Us()?["git.signInToGithub"]:["git.push","git.signInToGithub"]}function Jt(){let t=Ri();if(t)return{hostSummary:`Every publish is pushed to the remote and built by Cloudflare Pages${t.productionUrl?` at ${t.productionUrl}`:""}.`,hostTitle:`Cloudflare Pages: ${t.projectName}`};if(ye()&&p().cfConnect)return{hostSummary:"Runs on Cloudflare with nothing to configure: connect it, and every publish builds and deploys.",hostTitle:"Jx Cloud, on Cloudflare"};if(Zl())return{hostSummary:"Connect a Cloudflare API token, and every publish builds and deploys on your own account.",hostTitle:"Your Cloudflare account"};return{hostSummary:"This host cannot reach Cloudflare. Choose a build adapter below; your host runs bunx jx build and serves dist/.",hostTitle:"Another host"}}function ht(t){let e=t.replaceAll(/[^\w-]/g,"-"),a=z(),{git:r}=u,i=gt(),l=i.filter((s)=>s.staged).length,{destination:o,tab:c}=u.publish,m=hm(o),f=a==="repo"?pm(m):"",d=o==="review"?pb():"",y=zD(),j=r.logEntries??[],w=Ri(),h=yt(),x=Ft(),J=x.filter((s)=>s.environment==="preview"),q=Bt(x),G=as.filter((s)=>s.source==="Publish"&&!Hc(s)),_=r.branches?.branches??[],A=r.branches?.current??"",P=Us(),H=O(),K=NL(),b=i.length;return{...Et(),...Jt(),allIncluded:b>0&&l===b,blocker:f,branchNote:P?"Each branch opens in its own session, so switching reloads Studio on that branch.":"",branchSummary:A?`On ${A}`:"",branches:_.map((s)=>({current:s===A,key:s,name:s,note:H?mt():"Local only",switchLabel:P?"Switch and reload":"Switch",switchName:P?`Switch to ${s} and reload`:`Switch to ${s}`})),branchesEmpty:a==="no-repo"?"This project is not tracked by git yet.":"No branches yet. The first commit makes one.",branchesState:_.length>0?"listed":"empty",busy:r.loading,canClone:Pb(),checklistSteps:K.steps,checklistSummary:K.summary,checks:a==="repo"?fb().map((s)=>Wt(s)):[],commitRegion:`${t}/commit`,commits:j.map((s)=>fL(s)),commitsState:j.length>0?"listed":"empty",deployCommands:L(w?["publish.deploy","publish.openDashboard"]:["publish.setUp"]),deploysBusy:u.publish.deploys.state==="loading",destination:m,destinationId:`${e}-destination`,destinations:hw(o),domain:h,domainNote:Mt(h),domainState:h?"set":"none",error:r.error??"",filesState:b>0?"listed":"empty",groups:pL(i).map((s)=>It(s)),hasBlocker:f!=="",hasBranchNote:P,hasError:Boolean(r.error),hasLastUpdated:Boolean(r.lastUpdated),hasLiveUrl:h!=="",hasRefusal:d!=="",headline:Ht(a),history:x.map((s)=>ut(s,q)),historyState:x.length>0?"listed":"empty",hostCommands:L(w?["publish.setUp","publish.openDashboard"]:["publish.setUp"]),includedLabel:b>0?`${l} of ${b} included`:"",lastUpdated:mL(r.lastUpdated),liveNone:w?"The host has not reported an address for this site yet.":"No host is connected. Connect one under Hosting, and every publish ships to it.",liveSummary:Ut(x),liveUrl:h,mood:a,newBranchDisabled:r.loading||a!=="repo",panelId:`${e}-body`,previews:J.map((s)=>ut(s,q)),previewsState:J.length>0?"listed":"empty",primaryDisabled:a!=="repo"||f!=="",primaryLabel:jD(m),pullLabel:r.status?.behind?`Pull (${r.status.behind} behind)`:"Pull",pushLabel:r.status?.ahead?`Push (${r.status.ahead} ahead)`:"Push",refusal:d,region:t,remoteState:H?"remote":"local",reviewLine:y?`Pull request #${y.number} is open for review.`:"",reviewState:y?"opened":"none",reviewUrl:y?.url??"",running:G.map((s)=>TL(s)),runningState:G.length>0?"running":"none",someIncluded:l>0&&l<b,sourceCommands:L(Ot()),sourceSummary:Vt(),summary:r.commitMessage,syncLabel:H?mt():"Local only (no remote)",tab:c,tabTitle:jC[c],tabs:Bm.map((s)=>({label:s==="review"&&b>0?`${jC[s]} (${b})`:jC[s],value:s})),titleId:`${e}-title`}}var k=new Map,M=new WeakMap;function $t(){return C?.projectConfig?.build?.adapter||"static"}function qt(t){let e=$t(),a=k.get(t);if(!a?.isConnected||M.get(a)===e)return;M.set(a,e),D(a)}function Gt(t){if(t==="build"){HD();return}let e=fb().find((a)=>a.key===t);if(e?.command)nt(e.command,void 0,"Publish")}function _t(t){return{adapterHost:(e)=>{let a=k.get(t);if(a&&a!==e)B(a);k.set(t,e),M.set(e,$t()),D(e)},checkout:(e)=>{hL(e)},clone:()=>{iL()},compare:(e)=>{U=e,oL(e)},compareHost:(e,a)=>{let r=T.get(t);if(!r)r=new Map,T.set(t,r);r.set(a,e)},createRepository:()=>{nt("git.createGithubRepository",void 0,"Publish")},discard:(e)=>{dL(e)},editSummary:(e)=>{u.git.commitMessage=e},fetch:()=>{rL()},include:(e,a)=>{aL(e,a)},includeAll:(e)=>{lL(e)},initRepository:()=>{nt("git.init",void 0,"Publish")},newBranch:()=>{uL()},openUrl:(e)=>{if(e)Vb(e)},pickDestination:(e)=>{if(Cx(e))u.publish.destination=e},publish:()=>{pw(hm(u.publish.destination))},pull:()=>{sL()},push:()=>{nt("git.push",void 0,"Publish")},refresh:()=>{ks()},reloadDeployments:()=>{V()},run:(e)=>{nt(e,void 0,"Publish")},runCheck:Gt,selectTab:(e)=>{if(mO(e))PD(e)}}}var S=new Map,T=new Map,U=null,vt=new Set;async function wt(t,e){await e.handle.ready;let a=U===null?void 0:T.get(t)?.get(U);if(a?.isConnected)(a.querySelector('[part="control"]')??a).focus()}function PE(t){let e=S.get(t);if(e?.wrap.isConnected&&e.handle.attached()){wt(t,e);return}vt.add(t)}function Y_(t,e){let a=S.get(t);return a!==void 0&&a.tabId===e.id&&a.wrap.isConnected&&a.handle.attached()}function Z_(t){let e=S.get(t);if(!e)return;e.scope.stop();let a=k.get(t);if(a)B(a);e.handle.dispose(),S.delete(t),k.delete(t),T.delete(t)}function FE(t,e){let{paneId:a,wrap:r}=t;if(Y_(a,e))return;if(Z_(a),ye()&&z()==="loading")ks();PD(u.publish.tab);let i=Ln(a,"publish"),l=pt(r,ht(i),_t(a)),o=me();o.run(()=>{te(()=>{let m=ht(i);if(m.mood==="repo")gL();if(l.update(m),qt(a),m.tab==="deploys"&&Lt())V()}),te(()=>{if(u.publish.tab==="review"&&z()==="repo")cL()})});let c={handle:l,scope:o,tabId:e.id,wrap:r};if(S.set(a,c),vt.delete(a))wt(a,c)}
2
2
  export{MD,PD,PE,Y_,Z_,FE};
3
3
 
4
4
  //# debugId=5CCF83F4F751EEE164756E2164756E21
5
- //# sourceMappingURL=studio-3c10v2q1.js.map
5
+ //# sourceMappingURL=studio-2pk7kc7z.js.map