@jxsuite/studio 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/chunks/{2020-j56903f1.js → 2020-mkb0qa6p.js} +2 -2
  2. package/dist/chunks/adapter-xcpsmecx.js +4 -0
  3. package/dist/chunks/{add-new-flow-snx1s4b0.js → add-new-flow-ptmhmzr9.js} +3 -3
  4. package/dist/chunks/{cf-account-picker-xyqw0jex.js → cf-account-picker-z1sgwpwd.js} +3 -3
  5. package/dist/chunks/cf-settings-xqvhxxe9.js +4 -0
  6. package/dist/chunks/components-whsc81a7.js +4 -0
  7. package/dist/chunks/content-source-jwtxg78w.js +4 -0
  8. package/dist/chunks/{convert-to-repeater-fhdwyg14.js → convert-to-repeater-f92ey3kp.js} +3 -3
  9. package/dist/chunks/editor-zdqdpq1x.js +4 -0
  10. package/dist/chunks/entry-commands-w8p2fbpt.js +4 -0
  11. package/dist/chunks/{extension-sections-8ez2rrk8.js → extension-sections-y2p1te2r.js} +3 -3
  12. package/dist/chunks/file-ops-13ab4swj.js +4 -0
  13. package/dist/chunks/files-zbc8p6v1.js +4 -0
  14. package/dist/chunks/{format-host-zfjz4rzm.js → format-host-zjsbktbx.js} +3 -3
  15. package/dist/chunks/fs-events-t6x0hch6.js +4 -0
  16. package/dist/chunks/grid-open-fyzdwpkh.js +4 -0
  17. package/dist/chunks/{grid-view-ka55z38f.js → grid-view-r22jsqht.js} +5 -5
  18. package/dist/chunks/{iframe-host-na2mywz4.js → iframe-host-kbyqc7pt.js} +3 -3
  19. package/dist/chunks/index-6nvj89vb.js +4 -0
  20. package/dist/chunks/{index-qb98xhse.js → index-pxwwf00y.js} +2 -2
  21. package/dist/chunks/{javascript-ces13wny.js → javascript-pzqryby6.js} +2 -2
  22. package/dist/chunks/{jsonMode-6md16d4v.js → jsonMode-tcnyxyap.js} +5 -5
  23. package/dist/chunks/jx-validate-5sp8a4rm.js +4 -0
  24. package/dist/chunks/layers-panel-qrxj9vr2.js +4 -0
  25. package/dist/chunks/layers-tpzayggx.js +4 -0
  26. package/dist/chunks/lit-html-x6nrxsx3.js +4 -0
  27. package/dist/chunks/media-library-ywppnjrz.js +4 -0
  28. package/dist/chunks/media-picker-etxgc8qq.js +4 -0
  29. package/dist/chunks/{monaco-binding-p8j80s4w.js → monaco-binding-bqpge64f.js} +2 -2
  30. package/dist/chunks/monaco-buffer-qrnqhk0b.js +4 -0
  31. package/dist/chunks/{monaco-setup-wasktzfg.js → monaco-setup-1mkab762.js} +3 -3
  32. package/dist/chunks/notify-kcv38wwe.js +4 -0
  33. package/dist/chunks/parse-df2kkmhc.js +4 -0
  34. package/dist/chunks/{platform-c16mqvmp.js → platform-dtsysmyd.js} +2 -2
  35. package/dist/chunks/publish-panel-evb1rcxt.js +4 -0
  36. package/dist/chunks/{publish-quick-vr695j26.js → publish-quick-m9vkhahq.js} +3 -3
  37. package/dist/chunks/publish-workspace-ktk9h536.js +4 -0
  38. package/dist/chunks/quick-search-2f47fxcw.js +4 -0
  39. package/dist/chunks/references-5w6ajjv7.js +4 -0
  40. package/dist/chunks/right-panel-kz0a6byf.js +4 -0
  41. package/dist/chunks/source-control-1phx90zk.js +4 -0
  42. package/dist/chunks/{studio-h5tpz5ke.js → studio-07k0geap.js} +4 -4
  43. package/dist/chunks/{studio-7xag4na8.js → studio-0g2sm01j.js} +4 -4
  44. package/dist/chunks/{studio-de1s2x9v.js → studio-0hr000ba.js} +4 -4
  45. package/dist/chunks/{studio-35vrtpdq.js → studio-1wyp7dt5.js} +4 -4
  46. package/dist/chunks/{studio-34jrz12k.js → studio-20ap8dds.js} +4 -4
  47. package/dist/chunks/{studio-d83m0wyq.js → studio-291gqh98.js} +3 -3
  48. package/dist/chunks/{studio-xdpz9rpe.js → studio-37twdaf7.js} +29 -29
  49. package/dist/chunks/{studio-ry81j4q1.js → studio-4nkm4404.js} +4 -4
  50. package/dist/chunks/{studio-3v5cagy9.js → studio-4smcnv33.js} +3 -3
  51. package/dist/chunks/{studio-k3a8rp3d.js → studio-4zqfw5ha.js} +2 -2
  52. package/dist/chunks/{studio-d038kqbs.js → studio-56egy6vf.js} +4 -4
  53. package/dist/chunks/{studio-x3mjr5cc.js → studio-5dmgmyw4.js} +4 -4
  54. package/dist/chunks/{studio-x97ay0v4.js → studio-5e7p1vgd.js} +3 -3
  55. package/dist/chunks/{studio-ndskgqef.js → studio-5m0w815d.js} +3 -3
  56. package/dist/chunks/{studio-pqqq6v85.js → studio-695k95bw.js} +4 -4
  57. package/dist/chunks/{studio-gwrhcrss.js → studio-6vwvshw8.js} +2 -2
  58. package/dist/chunks/{studio-pgm83a2f.js → studio-76t560kn.js} +4 -4
  59. package/dist/chunks/{studio-396srjbk.js → studio-7823f0g8.js} +3 -3
  60. package/dist/chunks/{studio-r17asgs0.js → studio-7vb997ff.js} +4 -4
  61. package/dist/chunks/{studio-et2q4s8n.js → studio-8486jn4r.js} +3 -3
  62. package/dist/chunks/{studio-3w35qvay.js → studio-848rk4p1.js} +4 -4
  63. package/dist/chunks/{studio-5tzgq6fx.js → studio-8jb31dcf.js} +4 -4
  64. package/dist/chunks/{studio-y26hx9re.js → studio-8qejv8yf.js} +4 -4
  65. package/dist/chunks/{studio-h7weqf2q.js → studio-8x8616xd.js} +4 -4
  66. package/dist/chunks/{studio-hcsba201.js → studio-9cp96v90.js} +2 -2
  67. package/dist/chunks/{studio-dx73md4n.js → studio-9rcbvksg.js} +6 -6
  68. package/dist/chunks/{studio-m48v13s3.js → studio-a3s6frde.js} +3 -3
  69. package/dist/chunks/{studio-4kzbrr5t.js → studio-ahf3cspq.js} +3 -3
  70. package/dist/chunks/{studio-zgx7svjd.js → studio-bkmv1h3e.js} +5 -5
  71. package/dist/chunks/{studio-3c8pp7pb.js → studio-brdp85q7.js} +4 -4
  72. package/dist/chunks/{studio-yg3djpnm.js → studio-cgb97rwv.js} +4 -4
  73. package/dist/chunks/{studio-tj2s0tks.js → studio-ch8gt8vt.js} +3 -3
  74. package/dist/chunks/{studio-p1n2xjda.js → studio-cqf1k4qk.js} +4 -4
  75. package/dist/chunks/{studio-jttyqrmh.js → studio-cvz0e00f.js} +4 -4
  76. package/dist/chunks/{studio-5wzdy1jc.js → studio-dbgv4fv9.js} +14 -14
  77. package/dist/chunks/{studio-h310mbqm.js → studio-dy2xtt7a.js} +4 -4
  78. package/dist/chunks/{studio-xkxetm65.js → studio-eesyjg7h.js} +5 -5
  79. package/dist/chunks/studio-et6t8g4m.js +4 -0
  80. package/dist/chunks/{studio-cpkamjdn.js → studio-f2j9et3h.js} +8 -8
  81. package/dist/chunks/{studio-epenqmvk.js → studio-fep7hr66.js} +4 -4
  82. package/dist/chunks/{studio-2ks6ka4g.js → studio-fyf7j57j.js} +3 -3
  83. package/dist/chunks/{studio-rzg8hnkf.js → studio-g5prntab.js} +4 -4
  84. package/dist/chunks/{studio-c1pxszat.js → studio-ga77mf07.js} +4 -4
  85. package/dist/chunks/{studio-9cxmp61c.js → studio-ggm7zf70.js} +3 -3
  86. package/dist/chunks/studio-h7gy12h2.js +5 -0
  87. package/dist/chunks/{studio-9dz76yqc.js → studio-hsr3k06v.js} +5 -5
  88. package/dist/chunks/{studio-vzgmyt0v.js → studio-j933k8nr.js} +4 -4
  89. package/dist/chunks/studio-jgbvqcgh.js +5 -0
  90. package/dist/chunks/{studio-wxhy1yh7.js → studio-jh6t5qz4.js} +3 -3
  91. package/dist/chunks/{studio-88bmt9rh.js → studio-k4xc5g6h.js} +4 -4
  92. package/dist/chunks/{studio-wxdcd42g.js → studio-mwnmzx7g.js} +6 -6
  93. package/dist/chunks/{studio-1e8dw2w2.js → studio-nf0pqpbj.js} +4 -4
  94. package/dist/chunks/{studio-2j86y34y.js → studio-p0nf2e1f.js} +5 -5
  95. package/dist/chunks/{studio-k3bcy02e.js → studio-pd9dsqpq.js} +4 -4
  96. package/dist/chunks/{studio-agyvzfm4.js → studio-pmzg17fj.js} +4 -4
  97. package/dist/chunks/{studio-zg16eeq1.js → studio-pzfa2vmb.js} +4 -4
  98. package/dist/chunks/{studio-hy4ye0dx.js → studio-qyb5bebs.js} +7 -7
  99. package/dist/chunks/{studio-0ydxv2mr.js → studio-rf8d6p9f.js} +6 -6
  100. package/dist/chunks/{studio-45gyxpcq.js → studio-rt498t2v.js} +4 -4
  101. package/dist/chunks/studio-sd07xva5.js +6 -0
  102. package/dist/chunks/{studio-06j4en5h.js → studio-skynbac3.js} +2 -2
  103. package/dist/chunks/{studio-vswcpzk7.js → studio-t3j8htp7.js} +5 -5
  104. package/dist/chunks/{studio-3zge48z4.js → studio-thj81e98.js} +6 -6
  105. package/dist/chunks/{studio-ekgtrndg.js → studio-tpy3rdxn.js} +4 -4
  106. package/dist/chunks/{studio-ewarnzm4.js → studio-va0e63sk.js} +4 -4
  107. package/dist/chunks/{studio-gr36vnte.js → studio-vcz63n42.js} +4 -4
  108. package/dist/chunks/studio-vffwe9k7.js +5 -0
  109. package/dist/chunks/{studio-7dzyz9n8.js → studio-vjhej0w5.js} +103 -103
  110. package/dist/chunks/{studio-hwejq03c.js → studio-vxjap704.js} +4 -4
  111. package/dist/chunks/{studio-03mqh8ax.js → studio-w67vfgy5.js} +2 -2
  112. package/dist/chunks/{studio-ajw4k8hp.js → studio-x2metr13.js} +3 -3
  113. package/dist/chunks/{studio-771k2n12.js → studio-xebavr9s.js} +4 -4
  114. package/dist/chunks/{studio-x08a3m0a.js → studio-yg5n49za.js} +4 -4
  115. package/dist/chunks/{studio-xh683qzy.js → studio-yhz5b313.js} +4 -4
  116. package/dist/chunks/{studio-fy7jzj9j.js → studio-zacvfm31.js} +4 -4
  117. package/dist/chunks/{studio-zkq3r91p.js → studio-zsjpsw08.js} +4 -4
  118. package/dist/chunks/{studio-2hsqbq7b.js → studio-zxm98z2m.js} +6 -6
  119. package/dist/chunks/{tsMode-h6tkz0ea.js → tsMode-6vwhy6ty.js} +5 -5
  120. package/dist/chunks/workspace-d65bz1qk.js +4 -0
  121. package/dist/chunks/workspace-home-vbg9b3jh.js +4 -0
  122. package/dist/chunks/{ws-client-e951my95.js → ws-client-zcxkfgmf.js} +3 -3
  123. package/dist/manifest.json +71 -71
  124. package/dist/studio.js +73 -70
  125. package/package.json +4 -4
  126. package/src/platform-errors.ts +17 -1
  127. package/src/platforms/cloud.ts +14 -0
  128. package/src/publish/publish-changes.ts +136 -4
  129. package/src/types.ts +14 -0
  130. package/dist/chunks/adapter-wc5zvg9a.js +0 -4
  131. package/dist/chunks/cf-settings-hp1pjm0n.js +0 -4
  132. package/dist/chunks/components-nkwphrx3.js +0 -4
  133. package/dist/chunks/content-source-6a253wmk.js +0 -4
  134. package/dist/chunks/editor-wqrc68ca.js +0 -4
  135. package/dist/chunks/entry-commands-nef0wrmp.js +0 -4
  136. package/dist/chunks/file-ops-y3w71k1n.js +0 -4
  137. package/dist/chunks/files-de90apn9.js +0 -4
  138. package/dist/chunks/fs-events-77c0mr0x.js +0 -4
  139. package/dist/chunks/grid-open-4n4fjfpf.js +0 -4
  140. package/dist/chunks/index-ewmgdb7c.js +0 -4
  141. package/dist/chunks/jx-validate-b309c020.js +0 -4
  142. package/dist/chunks/layers-8rn8y6qv.js +0 -4
  143. package/dist/chunks/layers-panel-eyah7h9z.js +0 -4
  144. package/dist/chunks/lit-html-wyqw04y2.js +0 -4
  145. package/dist/chunks/media-library-gs3np47y.js +0 -4
  146. package/dist/chunks/media-picker-tt7dk4tb.js +0 -4
  147. package/dist/chunks/monaco-buffer-wsf6cmnq.js +0 -4
  148. package/dist/chunks/notify-qwst108r.js +0 -4
  149. package/dist/chunks/parse-n8dfxnqf.js +0 -4
  150. package/dist/chunks/publish-panel-d34bhvwj.js +0 -4
  151. package/dist/chunks/publish-workspace-2yr60mt4.js +0 -4
  152. package/dist/chunks/quick-search-e6xsdv0d.js +0 -4
  153. package/dist/chunks/references-gsj6trdv.js +0 -4
  154. package/dist/chunks/right-panel-33jv1knc.js +0 -4
  155. package/dist/chunks/source-control-bj9bejjv.js +0 -4
  156. package/dist/chunks/studio-38g0jdz7.js +0 -5
  157. package/dist/chunks/studio-dbxv7w4s.js +0 -5
  158. package/dist/chunks/studio-psh8mwnw.js +0 -4
  159. package/dist/chunks/studio-v9ywz2se.js +0 -6
  160. package/dist/chunks/studio-yx8hzqja.js +0 -5
  161. package/dist/chunks/workspace-home-zkkrxq3r.js +0 -4
  162. package/dist/chunks/workspace-tdqqjqaa.js +0 -4
@@ -1,6 +1,6 @@
1
- import{gx,Mp,Pp,Fp,bx,Rm,jd,Jb,jp,w$,lh,Nm,UA,ka}from"./studio-cpkamjdn.js";import{p}from"./studio-03mqh8ax.js";import{ph}from"./studio-k3bcy02e.js";import{uv}from"./studio-vzgmyt0v.js";import{Ht,fn}from"./studio-3w35qvay.js";import{Ne}from"./studio-1e8dw2w2.js";import{rh,Bb,Md,zb,Wb,sh}from"./studio-x3mjr5cc.js";import{qw}from"./studio-pqqq6v85.js";import{jr}from"./studio-c1pxszat.js";import{S}from"./studio-45gyxpcq.js";import{n,Q,_,v,td}from"./studio-zkq3r91p.js";function C(e,t){return new URL(`/node_modules/${e}`,t).href}function x(e){if(e===void 0)return!1;if(n(e))return!e.includes("${");if(Array.isArray(e))return e.every((t)=>x(t));if(v(e))return!("$ref"in e)&&!("$prototype"in e)&&!("$expression"in e)&&Object.values(e).every((t)=>x(t));return!0}function gS(e){let t=new Map;for(let[s,r]of Object.entries(e.state??{})){if(td(s)||!v(r)||!Array.isArray(r.examples))continue;let[o]=r.examples;if(x(o))t.set(s,o)}return t}var k={body:"body",root:":root"};function R(e,t,s,r,o=k){let l=[],a=(i,c)=>{let d={mediaQueries:t,scope:c,transposeValue:s};if(r)d.resolveValue=(m,g)=>r(m,g,c);for(let m of Rm(i,d))l.push(m.text)},y={},h={},b=[],w=[];for(let[i,c]of Object.entries(e)){if(_(c)&&!Array.isArray(c)){if(i.startsWith("@"))b.push([i,c]);else if(!i.startsWith("--"))w.push([i,c]);continue}if(bx(i)||i.startsWith("@"))continue;if(i.startsWith("--")||i==="colorScheme"||i==="color-scheme")y[i]=c;else h[i]=c}a(y,o.root),a(h,o.body);for(let[i,c]of w)if(i.startsWith("&"))a({[i]:c},o.root);else a(c,i);for(let[i,c]of b){if(gx(i)||Mp(i)){a({[i]:c},null);continue}let d={},m={},g=[];for(let[u,f]of Object.entries(c)){if(_(f)&&!Array.isArray(f)){if(!u.startsWith("@"))g.push([u,f]);continue}if(u.startsWith("--"))d[u]=f;else m[u]=f}a({[i]:d},o.root),a({[i]:m},o.body);for(let[u,f]of g)a({[i]:f},u)}if(Object.values(t).some((i)=>Fp(i)!==null)&&!("colorScheme"in e))l.push(`${o.root} { color-scheme: light dark }`,`${o.root}:where([${Pp}="light"]) { color-scheme: light }`,`${o.root}:where([${Pp}="dark"]) { color-scheme: dark }`);return l.join(`
2
- `)}var T={body:":host",root:":host"},P=new WeakMap,J=new WeakMap;function A(e){let t=e.replaceAll(/:root\b/g,":host").replaceAll(/(^|[\s,>+~(])(?:html|body)(?![\w-])/g,"$1:host").replaceAll(/:host(?:\s*>?\s*:host)+/g,":host");return t===e?null:t}function j(e){for(let t=0;t<e.cssRules.length;t+=1){let s=e.cssRules[t],r=s instanceof CSSStyleRule?A(s.selectorText):null;if(s instanceof CSSStyleRule&&r!==null){let l=`${r}${s.cssText.slice(s.cssText.indexOf("{"))}`;try{e.insertRule(l,t),e.deleteRule(t+1)}catch{}}let o=e.cssRules[t];if(o instanceof CSSGroupingRule)j(o)}}function D(e){let t=[];for(let s of e??[]){if(!_(s)||String(s.tagName).toLowerCase()!=="link")continue;let{href:r,rel:o}=s.attributes??{};if(n(r)&&r!==""&&n(o)&&o.split(/\s+/).includes("stylesheet"))t.push(r)}return t}async function M(e){let t=Wb(e,"project.json");try{let s=await fetch(t);if(!s.ok)return null;let r=new URL(t,location.href).href,o=new CSSStyleSheet({baseURL:r});return o.replaceSync(await s.text()),j(o),o}catch{return null}}async function L(e){let s=(await Promise.all(D(e.$head).map((o)=>M(o)))).filter((o)=>o!==null),{style:r}=e;if(_(r)){let o=new CSSStyleSheet;o.replaceSync(R(r,e.$media??{},(l)=>l,void 0,T)),s.push(o)}return s}function E(){let e=S?.projectConfig;if(!e||!Q(globalThis.CSSStyleSheet))return Promise.resolve([]);let t=P.get(e);if(!t)t=L(e).then((s)=>(J.set(e,s),s)),P.set(e,t);return t}function JD(){let e=S?.projectConfig;return(e&&J.get(e))??[]}var H=150;function Sw(e=H){let t=new Map;function s(){for(let[r,o]of t){if(t.size<=e)break;t.delete(r),o.remove()}}return{clear(){for(let r of t.values())r.remove();t.clear()},get(r){let o=t.get(r);if(o!==void 0)t.delete(r),t.set(r,o);return o},has:(r)=>t.has(r),keys:()=>[...t.keys()],set(r,o){t.delete(r),t.set(r,o),s()},size:()=>t.size}}function O(e){let t=Md(S?.projectRoot);return URL.canParse(t)?new URL(e,t).href:location.href}async function N(e){try{let t=await p().readFile(e);jd(!0);let s=zb(e,sh());await Ht();let r;if(fn(e))r=(await jr(e,t)).document;else r=JSON.parse(t);return await F(r,e,s)}catch{return null}}async function F(e,t,s){jd(!0),Jb(Bb());let r=await lh(e,{},O(t)),o=s&&{...s,versions:ph()};w$((l)=>uv(l,o));try{let l=ka(e,r);return l instanceof HTMLElement?l:null}finally{w$(null)}}async function W(e,t){let s=await RT(t);if(!s)return null;let r=gS(s);return await bS(s,t,r)?qw(e,r):null}async function RT(e){try{let t=JSON.parse(await p().readFile(e));return _(t)&&!Array.isArray(t)?t:null}catch{return null}}async function bS(e,t,s){let r=null;try{jd(!0),Jb(Bb());let o=await lh(e,{},O(t));for(let[y,h]of s)o[y]=h;let l=!1;Nm(()=>{l=!0});let{stop:a}=jp(()=>ka({...e,tagName:"div"},o));return r=a,!l}catch{return!1}finally{Nm(null),r?.()}}function V(e){return e.source!=="npm"&&(e.path?.endsWith(".json")??!1)}async function Cw(e,t){let s=t.get(e);if(s)return s;let r;try{UA((l)=>C(l,`${rh()}/`)),await E();let o=Ne.find((l)=>l.path===e);if(o&&V(o))r=await W(o,e);else r=o?await qw(o):await N(e)}catch{return}if(!r)return;return t.set(e,r),r}function bp(e){if(!Q(globalThis.IntersectionObserver))return{destroy(){},observe:(r)=>e(r),releaseDetached:()=>0};let t=new Set,s=new IntersectionObserver((r)=>{for(let o of r)if(o.isIntersecting)t.delete(o.target),s.unobserve(o.target),e(o.target)},{rootMargin:"200px"});return{destroy(){s.disconnect(),t.clear()},observe(r){if(t.has(r))return;t.add(r),s.observe(r)},releaseDetached(){let r=0;for(let o of t)if(!o.isConnected)t.delete(o),s.unobserve(o),r+=1;return r}}}
1
+ import{gx,Mp,Pp,Fp,bx,Rm,Hd,Jb,jp,w$,lh,Nm,qA,ka}from"./studio-f2j9et3h.js";import{p}from"./studio-w67vfgy5.js";import{ph}from"./studio-pd9dsqpq.js";import{uv}from"./studio-j933k8nr.js";import{Ht,fn}from"./studio-848rk4p1.js";import{Ne}from"./studio-nf0pqpbj.js";import{rh,Bb,Pd,zb,Wb,sh}from"./studio-5dmgmyw4.js";import{qw}from"./studio-695k95bw.js";import{jr}from"./studio-ga77mf07.js";import{S}from"./studio-rt498t2v.js";import{n,Q,_,v,nd}from"./studio-zsjpsw08.js";function C(e,t){return new URL(`/node_modules/${e}`,t).href}function x(e){if(e===void 0)return!1;if(n(e))return!e.includes("${");if(Array.isArray(e))return e.every((t)=>x(t));if(v(e))return!("$ref"in e)&&!("$prototype"in e)&&!("$expression"in e)&&Object.values(e).every((t)=>x(t));return!0}function gS(e){let t=new Map;for(let[s,r]of Object.entries(e.state??{})){if(nd(s)||!v(r)||!Array.isArray(r.examples))continue;let[o]=r.examples;if(x(o))t.set(s,o)}return t}var k={body:"body",root:":root"};function R(e,t,s,r,o=k){let l=[],a=(i,c)=>{let d={mediaQueries:t,scope:c,transposeValue:s};if(r)d.resolveValue=(m,g)=>r(m,g,c);for(let m of Rm(i,d))l.push(m.text)},y={},h={},b=[],w=[];for(let[i,c]of Object.entries(e)){if(_(c)&&!Array.isArray(c)){if(i.startsWith("@"))b.push([i,c]);else if(!i.startsWith("--"))w.push([i,c]);continue}if(bx(i)||i.startsWith("@"))continue;if(i.startsWith("--")||i==="colorScheme"||i==="color-scheme")y[i]=c;else h[i]=c}a(y,o.root),a(h,o.body);for(let[i,c]of w)if(i.startsWith("&"))a({[i]:c},o.root);else a(c,i);for(let[i,c]of b){if(gx(i)||Mp(i)){a({[i]:c},null);continue}let d={},m={},g=[];for(let[u,f]of Object.entries(c)){if(_(f)&&!Array.isArray(f)){if(!u.startsWith("@"))g.push([u,f]);continue}if(u.startsWith("--"))d[u]=f;else m[u]=f}a({[i]:d},o.root),a({[i]:m},o.body);for(let[u,f]of g)a({[i]:f},u)}if(Object.values(t).some((i)=>Fp(i)!==null)&&!("colorScheme"in e))l.push(`${o.root} { color-scheme: light dark }`,`${o.root}:where([${Pp}="light"]) { color-scheme: light }`,`${o.root}:where([${Pp}="dark"]) { color-scheme: dark }`);return l.join(`
2
+ `)}var T={body:":host",root:":host"},P=new WeakMap,J=new WeakMap;function A(e){let t=e.replaceAll(/:root\b/g,":host").replaceAll(/(^|[\s,>+~(])(?:html|body)(?![\w-])/g,"$1:host").replaceAll(/:host(?:\s*>?\s*:host)+/g,":host");return t===e?null:t}function j(e){for(let t=0;t<e.cssRules.length;t+=1){let s=e.cssRules[t],r=s instanceof CSSStyleRule?A(s.selectorText):null;if(s instanceof CSSStyleRule&&r!==null){let l=`${r}${s.cssText.slice(s.cssText.indexOf("{"))}`;try{e.insertRule(l,t),e.deleteRule(t+1)}catch{}}let o=e.cssRules[t];if(o instanceof CSSGroupingRule)j(o)}}function D(e){let t=[];for(let s of e??[]){if(!_(s)||String(s.tagName).toLowerCase()!=="link")continue;let{href:r,rel:o}=s.attributes??{};if(n(r)&&r!==""&&n(o)&&o.split(/\s+/).includes("stylesheet"))t.push(r)}return t}async function M(e){let t=Wb(e,"project.json");try{let s=await fetch(t);if(!s.ok)return null;let r=new URL(t,location.href).href,o=new CSSStyleSheet({baseURL:r});return o.replaceSync(await s.text()),j(o),o}catch{return null}}async function L(e){let s=(await Promise.all(D(e.$head).map((o)=>M(o)))).filter((o)=>o!==null),{style:r}=e;if(_(r)){let o=new CSSStyleSheet;o.replaceSync(R(r,e.$media??{},(l)=>l,void 0,T)),s.push(o)}return s}function E(){let e=S?.projectConfig;if(!e||!Q(globalThis.CSSStyleSheet))return Promise.resolve([]);let t=P.get(e);if(!t)t=L(e).then((s)=>(J.set(e,s),s)),P.set(e,t);return t}function JD(){let e=S?.projectConfig;return(e&&J.get(e))??[]}var H=150;function Sw(e=H){let t=new Map;function s(){for(let[r,o]of t){if(t.size<=e)break;t.delete(r),o.remove()}}return{clear(){for(let r of t.values())r.remove();t.clear()},get(r){let o=t.get(r);if(o!==void 0)t.delete(r),t.set(r,o);return o},has:(r)=>t.has(r),keys:()=>[...t.keys()],set(r,o){t.delete(r),t.set(r,o),s()},size:()=>t.size}}function O(e){let t=Pd(S?.projectRoot);return URL.canParse(t)?new URL(e,t).href:location.href}async function N(e){try{let t=await p().readFile(e);Hd(!0);let s=zb(e,sh());await Ht();let r;if(fn(e))r=(await jr(e,t)).document;else r=JSON.parse(t);return await F(r,e,s)}catch{return null}}async function F(e,t,s){Hd(!0),Jb(Bb());let r=await lh(e,{},O(t)),o=s&&{...s,versions:ph()};w$((l)=>uv(l,o));try{let l=ka(e,r);return l instanceof HTMLElement?l:null}finally{w$(null)}}async function W(e,t){let s=await RT(t);if(!s)return null;let r=gS(s);return await bS(s,t,r)?qw(e,r):null}async function RT(e){try{let t=JSON.parse(await p().readFile(e));return _(t)&&!Array.isArray(t)?t:null}catch{return null}}async function bS(e,t,s){let r=null;try{Hd(!0),Jb(Bb());let o=await lh(e,{},O(t));for(let[y,h]of s)o[y]=h;let l=!1;Nm(()=>{l=!0});let{stop:a}=jp(()=>ka({...e,tagName:"div"},o));return r=a,!l}catch{return!1}finally{Nm(null),r?.()}}function V(e){return e.source!=="npm"&&(e.path?.endsWith(".json")??!1)}async function Cw(e,t){let s=t.get(e);if(s)return s;let r;try{qA((l)=>C(l,`${rh()}/`)),await E();let o=Ne.find((l)=>l.path===e);if(o&&V(o))r=await W(o,e);else r=o?await qw(o):await N(e)}catch{return}if(!r)return;return t.set(e,r),r}function bp(e){if(!Q(globalThis.IntersectionObserver))return{destroy(){},observe:(r)=>e(r),releaseDetached:()=>0};let t=new Set,s=new IntersectionObserver((r)=>{for(let o of r)if(o.isIntersecting)t.delete(o.target),s.unobserve(o.target),e(o.target)},{rootMargin:"200px"});return{destroy(){s.disconnect(),t.clear()},observe(r){if(t.has(r))return;t.add(r),s.observe(r)},releaseDetached(){let r=0;for(let o of t)if(!o.isConnected)t.delete(o),s.unobserve(o),r+=1;return r}}}
3
3
  export{gS,JD,Sw,RT,bS,Cw,bp};
4
4
 
5
- //# debugId=6A7EA18CA4A7F43864756E2164756E21
6
- //# sourceMappingURL=studio-pgm83a2f.js.map
5
+ //# debugId=6090EDEA0E8D838964756E2164756E21
6
+ //# sourceMappingURL=studio-76t560kn.js.map
@@ -1,5 +1,5 @@
1
- import{p,_e}from"./studio-03mqh8ax.js";import{Ne,Zw,xa,Fc}from"./studio-1e8dw2w2.js";import{g}from"./studio-4kzbrr5t.js";import{ln,Ia,Y,Cr,Up,u}from"./studio-vzgmyt0v.js";import{Ev}from"./studio-3w35qvay.js";import{Wc,Sa,tr}from"./studio-34jrz12k.js";import{Wr}from"./studio-ewarnzm4.js";import{ZT,nl,Rb}from"./studio-pqqq6v85.js";import{mt}from"./studio-ajw4k8hp.js";import{T,R,rt}from"./studio-jttyqrmh.js";import{Xn}from"./studio-9cxmp61c.js";import{gb}from"./studio-wxdcd42g.js";import{Wu}from"./studio-agyvzfm4.js";import{Vy,GR,Zg,Sd,KR,JR,qk,Uy,qy}from"./studio-0ydxv2mr.js";import{cm}from"./studio-zgx7svjd.js";import{Sw,Cw,bp}from"./studio-pgm83a2f.js";import{S,xn}from"./studio-45gyxpcq.js";import{n,Z,v}from"./studio-zkq3r91p.js";import{le}from"./studio-7xag4na8.js";var X=new Map([["img","src"],["source","src"],["video","poster"]]);function ee(e,t,a=Ne){if(!e||t!=="image")return{mode:"insert"};let r=X.get(e.tagName);if(r)return{attr:r,mode:"replace-attr",path:e.path};if(e.tagName.includes("-")){let s=(a.find((l)=>l.tagName===e.tagName)?.props??[]).filter((l)=>Ia(l.format));if(s.length===1)return{mode:"replace-prop",path:e.path,prop:s[0].name}}return{mode:"insert"}}function E(e){switch(e.kind){case"image":return{attributes:{src:e.ref},tagName:"img"};case"video":return{attributes:{controls:"",src:e.ref},tagName:"video"};case"audio":return{attributes:{controls:"",src:e.ref},tagName:"audio"};default:return{attributes:{href:e.ref},tagName:"a",textContent:e.name}}}function te(e,t){let a=[...e.targetPath],r=a.at(-1);if(t===0||!Z(r))return a;return a[a.length-1]=r+t,a}async function VR(e,t,a,r){if(!e||t.length===0)return;let o=await Sa(t),[s]=o;if(!s)return;let l=ee(a,s.kind);if(l.mode==="replace-attr"){Y(e,(m)=>Cr(m,l.path,l.attr,s.ref));return}if(l.mode==="replace-prop"){Y(e,(m)=>Up(m,l.path,l.prop,s.ref));return}for(let[m,i]of o.entries()){let f={fragment:E(i),type:"block"};if(r)Rb(e,{type:r.instruction},f,te(r,m));else Rb(e,{type:"make-child"},f,[])}}var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSitePanel",$description:"The Site panel (specs/studio.md §5.7): the project as an author thinks of it, pages by address and then the parts pages are made of. Four sections under a header holding one filter and a + that opens Add new (`file.new`, §9.1.1). `panels/site-panel.ts` keeps every decision: which files are pages, the route order and nesting (`panels/site-model.ts`, over `@jxsuite/site/routes`), how many entries a collection has and how many pages use a template, which media the project holds (the Media section is a short strip of the first few, and the rest are one click away in Media), what a click opens and what a drag inserts. This document draws rows whose every field is already a string, and a section state that is one of loading, empty, nomatch or listed, so a section a filter empties keeps its heading and says why. Component previews are an island the flow fills, and the drag sources are registered by the adapter through `onNodeCreated`.",tagName:"div",attributes:{part:"site"},style:{$description:"The Site panel's own look, keyed on `part`. Rows are native buttons, because a row opens one thing and a button is the element that says so to every reader; the selected row is the one whose `data-selected` is true, which the flow sets from the focused pane's document. A collection heading is not a button: it opens nothing in Design, and its pages are the buttons under it, indented one step. Component cards and media thumbnails are drag sources as well as buttons; the adapter registers the drags through `onNodeCreated`, so nothing here names a drag.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="filter"]':{flex:"1",minWidth:"0"},'& [part="sections"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-1) 0 var(--jx-space-4)"},'& [part="section"]':{padding:"var(--jx-space-2) 0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3) var(--jx-space-1)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="section-count"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="open-media"]':{marginLeft:"auto"},'& [part="no-project"]':{margin:"0",padding:"var(--jx-space-6) var(--jx-space-4)",textAlign:"center",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0",padding:"var(--jx-space-1) var(--jx-space-3)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column"},'& [part="page-row"], & [part="template-row"], & [part="collection-row"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",width:"100%",boxSizing:"border-box",minHeight:"26px",padding:"var(--jx-space-1) var(--jx-space-3)",border:"none",background:"transparent",color:"inherit",font:"inherit",textAlign:"start"},'& [part="page-row"], & [part="template-row"]':{cursor:"pointer",":hover":{background:"var(--hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="page-row"][data-nested="true"]':{paddingLeft:"calc(var(--jx-space-3) + var(--jx-space-4))"},'& [data-selected="true"]':{background:"var(--accent-15)",color:"var(--fg)"},'& [part="collection-row"]':{color:"var(--fg-dim)"},'& [part="row-label"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-detail"]':{flexShrink:"0",maxWidth:"55%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="cards"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3)"},'& [part="component-card"]':{display:"flex",flexDirection:"column",width:"100%",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)",color:"inherit",font:"inherit",cursor:"grab",":hover":{borderColor:"var(--fg-dim)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="card-preview"]':{$description:"A live render on the light document surface the Insert panel's element cards use (`--canvas-*` does not follow the theme, because what is drawn here is a page's part, and a site's dark text on the dark chrome read as an empty black box). It is drawn at half size, so a component laid out for a page shows its face rather than a clipped corner of one oversized glyph. The render is in the island's own shadow root (`mountPreview` in `browse/library-preview.ts`), so no rule here can reach its elements: the half size is the island's `zoom`, which lays the render out twice as wide and draws it at half, and the 128px height is the 64px box at that zoom. The broken-image rule went into the root with it.",position:"relative",height:"128px",zoom:"0.5",overflow:"hidden",pointerEvents:"none",background:"white",color:"var(--canvas-fg-2)",fontSize:"var(--jx-text-md)"},'& [part="card-label"]':{padding:"var(--jx-space-1) var(--jx-space-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-sm)",textAlign:"start"},'& [part="thumbs"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(56px, 1fr))",gap:"var(--jx-space-1)",padding:"0 var(--jx-space-3)"},'& [part="media-strip"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="media-more"]':{alignSelf:"flex-start",marginInline:"var(--jx-space-3)"},'& [part="media-thumb"]':{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",aspectRatio:"1",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-sm)",background:"var(--bg-panel)",color:"var(--fg-dim)",font:"inherit",cursor:"grab",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="thumb-image"]':{width:"100%",height:"100%",objectFit:"cover"},'& [part="thumb-name"]':{padding:"var(--jx-space-1)",overflow:"hidden",fontSize:"var(--jx-text-xs)",wordBreak:"break-all"}},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:"Filter the site",placeholder:"Filter the site…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"add"},$props:{size:"sm",icon:"plus",label:"Add new",hint:"Add new",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/add"},value:[]}]}}]},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{none:{tagName:"p",attributes:{part:"no-project"},textContent:"Open a project to see its pages, templates, components and media."},project:{tagName:"div",attributes:{part:"sections"},children:[{tagName:"section",attributes:{part:"section","data-section":"pages","aria-labelledby":"site-section-pages"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-pages"},textContent:"Pages"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.pagesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/pagesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No pages yet. Add one with +."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/pages"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"page-item",role:"listitem","data-kind":"${$map.item.kind}"},$switch:{$ref:"$map/item/kind"},cases:{collection:{tagName:"div",attributes:{part:"collection-row"},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},page:{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},"entry-page":{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}","data-nested":"true"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}}}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"templates","aria-labelledby":"site-section-templates"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-templates"},textContent:"Templates"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.templatesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/templatesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No templates in layouts/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/templates"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"template-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"template-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"components","aria-labelledby":"site-section-components"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-components"},textContent:"Components"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.componentsCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/componentsState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No components yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"cards",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/components"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"component-card",type:"button","data-tag":"${$map.item.tagName}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.hint}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openComponent"},value:[{$ref:"$map/item/tagName"}]}]},children:[{$description:'The preview ISLAND: empty here, filled by the flow with the component rendered live from the Library\'s preview cache as the card scrolls into view (specs/studio-ui-guidelines.md §9.4). It is `inert`, not merely `aria-hidden`: a component\'s own links and buttons stay focusable under `aria-hidden`, and Chrome then counts their text into the card\'s name ("Contact Us Today Eer cta", "◀ ▶ Eer reviews"). Inert takes the render out of the accessibility tree, the tab order and the pointer at once, so the card is named by its label alone.',tagName:"div",attributes:{part:"card-preview",inert:""}},{tagName:"span",attributes:{part:"card-label"},textContent:"${$map.item.label}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"media","aria-labelledby":"site-section-media"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-media"},textContent:"Media"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.mediaCount}"},{tagName:"jx-button",attributes:{part:"open-media"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"Open Media"}]}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mediaState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No media in public/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"media-strip"},children:[{tagName:"div",attributes:{part:"thumbs",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/media"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"thumb-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"media-thumb",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"Open ${$map.item.name} in Media, or drag it onto the canvas","aria-label":"${$map.item.name}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumb"},cases:{image:{tagName:"img",attributes:{part:"thumb-image",src:"${$map.item.src}",alt:"",loading:"lazy",draggable:"false"}},file:{tagName:"span",attributes:{part:"thumb-name"},textContent:"${$map.item.name}"}}}]}]}}]},{tagName:"jx-button",attributes:{part:"media-more",hidden:"${state.mediaMore === '' ? '' : null}"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"${state.mediaMore}"}]}]}}}]}]}}}]};T("site-panel",O);function A(){return{body:"none",components:[],componentsCount:"",componentsState:"loading",filter:"",media:[],mediaCount:"",mediaMore:"",mediaState:"loading",pages:[],pagesCount:"",pagesState:"loading",templates:[],templatesCount:"",templatesState:"loading"}}function z(e,t){e.body=t.body,e.filter=t.filter,e.pages=t.pages,e.pagesState=t.pagesState,e.pagesCount=t.pagesCount,e.templates=t.templates,e.templatesState=t.templatesState,e.templatesCount=t.templatesCount,e.components=t.components,e.componentsState=t.componentsState,e.componentsCount=t.componentsCount,e.media=t.media,e.mediaState=t.mediaState,e.mediaCount=t.mediaCount,e.mediaMore=t.mediaMore}function ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function re(e){let t=e?.$map,a=v(t)?t.item:void 0;return v(a)?a:null}function I(e,t){let a=re(e)?.[t];return n(a)?a:""}function J(e,t,a,r){let o=g({...A(),...a});z(o,t);let s=null,l=!1,m=R("site-panel",o,e,{onNodeCreated:(i,f,P,h)=>{if(l||!(i instanceof HTMLElement))return;switch(ne(P)){case"card-preview":{let d=I(h,"tagName");if(d!=="")r.preview(i,d);break}case"component-card":{let d=I(h,"tagName");if(d!=="")r.componentSource(i,d);break}case"media-thumb":{let d=I(h,"path");if(d!=="")r.mediaSource(i,d);break}default:break}}}).then((i)=>{if(l)return i.dispose(),i;return s=i,i});return{connected:()=>!l&&(s===null||s.root.parentNode===e),dispose(){l=!0,s?.dispose(),s=null},ready:m,update:(i)=>{z(o,i)}}}var N=null,F=!1,x=null,b=0;function ie(){return Object.keys(S?.projectConfig?.content??{})}async function oe(e){return(await ZT(e)).contentType}async function se(e){let[t,a]=await Promise.all([cm(["pages","layouts"],p()),Ev()]),r=t.files.filter((i)=>i.path.startsWith("pages/")),o=await Promise.all(r.map(async(i)=>({contentType:i.path.includes("[")?await oe(i.path):null,path:i.path})));if(e!==b)return;let s=N?.collections,l=new Map(ie().map((i)=>[i,s?.get(i)??null]));F=!1,N={collections:l,layouts:t.files.flatMap((i)=>i.path.startsWith("layouts/")?[i.path]:[]),pageExtensions:a,pages:o},C();let m=new Set(o.flatMap((i)=>i.contentType&&l.has(i.contentType)?[i.contentType]:[]));if(await Promise.all([...m].map(async(i)=>{let f=await gb(i).catch(()=>null);if(e===b&&f)l.set(i,f.length)})),e===b)C()}function pe(){if((!N||F)&&!x&&_e()&&S){let e=b;x=se(e).finally(()=>{if(e===b)x=null})}return N}function Jg(e){if(b+=1,F=!0,x=null,e===void 0||e.some((t)=>me(t)))D=!0;if(c)C()}var ce=["pages/","layouts/","content/","public/"];function me(e){if(e.startsWith("components/"))return!0;return e.endsWith(".json")&&e!=="project.json"&&!ce.some((t)=>e.startsWith(t))}var D=!1,M=!1;function de(){if(M||Zw&&!D||!_e())return;M=!0,D=!1,xa().finally(()=>{M=!1,C()})}function _(e,t){return Ne.flatMap((a)=>{let r=Sd(a.tagName),o=`<${a.tagName}>`,s=L(a);if(!Zg(e,a.tagName,s??"",a.package??""))return[];return[{hint:s?`Open ${o}, or drag it onto the canvas`:`${o} from ${a.package??"a package"}: open Packages, or drag it onto the canvas`,key:a.tagName,label:r,path:s??"",selected:Vy(s!==null&&s===t),tagName:a.tagName}]})}function L(e){return e?.path!==void 0&&e.source!=="npm"?e.path:null}var V=8;function ue(e,t){return e>t?`Show all ${e} in Media`:""}function W(e,t,a){return e.flatMap((r)=>Zg(t,r.name,r.file)?[{key:r.file,name:r.name,path:r.file,selected:Vy(r.file===a),src:r.isImage?tr(r.file):"",thumb:r.isImage?"image":"file"}]:[])}function ge(){let e=S?.projectConfig?.defaults?.layout;return n(e)?e.replace(/^\.\//,""):null}var w="";function j(e,t,a){if(e)return"loading";if(t===0)return"empty";return a===0?"nomatch":"listed"}function k(e,t,a){if(a||e===0)return"";return t===e?String(e):`${t} of ${e}`}function B(){if(!S)return{...A(),filter:w};let e=GR(w),t=u.value?.documentPath??null,a=pe();de();let r=Wu(),o=a?KR(a.pages,a.collections,t,{extensions:a.pageExtensions,i18n:ln(S.projectConfig??{}).i18n}):[],s=JR(o,e),l=ge(),m=a?qk(a.layouts,t,"",l):[],i=a?qk(a.layouts,t,e,l):[],f=!Zw,P=_("",t),h=_(e,t),d=r?W(r,"",t):[],y=r?W(r,e,t):[],H=(K)=>K.filter((Q)=>Q.kind!=="collection").length;return{body:"project",components:h,componentsCount:k(P.length,h.length,f),componentsState:j(f,P.length,h.length),filter:w,media:y.slice(0,V),mediaCount:k(d.length,y.length,r===null),mediaMore:ue(y.length,Math.min(y.length,V)),mediaState:j(r===null,d.length,y.length),pages:s,pagesCount:k(H(o),H(s),a===null),pagesState:j(a===null,o.length,s.length),templates:i,templatesCount:k(m.length,i.length,a===null),templatesState:j(a===null,m.length,i.length)}}function U(e){(le("de90apn9"),import("./files-de90apn9.js")).then(({openFileInTab:t})=>t(e))}var fe={add:()=>{rt("file.new",{},"Site panel")},open:U,openComponent:(e)=>{let t=Ne.find((r)=>r.tagName===e);if(!t)return;let a=L(t);if(a){U(a);return}rt("view.setActivity",{tab:"packages"},"Site panel")},openMedia:()=>{rt("view.setWorkspace",{workspace:"media"},"Site panel")},setFilter:(e)=>{w=e,C()}},c=null;async function he(e,t,a){let r=await Cw(a,e.cache);if(r&&c===e&&t.isConnected&&!qy(t))Uy(t,r)}function q(e,t,a){let r=Wr({element:t,getInitialData:()=>a()??{},onGenerateDragPreview:({nativeSetDragImage:o})=>{nl({nativeSetDragImage:o})}});e.sources.set(t,r)}function be(e){for(let[t,a]of e.sources)if(!t.isConnected)a(),e.sources.delete(t);e.observer.releaseDetached()}function G(e){e.handle?.dispose();for(let t of e.sources.values())t();e.sources.clear(),e.observer.destroy(),e.cache.clear()}function ye(e){let t=Ne.find((a)=>a.tagName===e);return t?{fragment:Fc(t),type:"block"}:null}function ve(e){let t=Wu()?.find((r)=>r.file===e);if(!t)return null;return{fragment:E({kind:Wc({name:t.name}),name:t.name,path:t.file,ref:t.ref}),type:"block"}}function xe(e){if(c&&(c.host!==e||c.handle?.connected()===!1))G(c),c=null;if(c){c.handle?.update(B()),be(c);return}let t=new Map,a={cache:Sw(),handle:null,host:e,observer:bp((r)=>{let o=r instanceof HTMLElement?t.get(r):void 0;if(o!==void 0&&r instanceof HTMLElement)t.delete(r),he(a,r,o)}),pending:t,sources:new Map};c=a,a.handle=J(e,B(),fe,{componentSource:(r,o)=>{q(a,r,()=>ye(o))},mediaSource:(r,o)=>{q(a,r,()=>ve(o))},preview:(r,o)=>{let s=L(Ne.find((l)=>l.tagName===o));if(s)t.set(r,s),a.observer.observe(r)}})}function C(){xn("leftPanel")}function we(e){return e.querySelector(".panel-content")??e}function UR(){Xn({id:"site",title:"Site",level:"project",dock:"navigator",icon:"browser",render:()=>mt,afterRender:(e,t)=>{xe(we(t))}})}function qR(){if(c)G(c);c=null,w="",b+=1,N=null,F=!1,x=null,D=!0,M=!1}
1
+ import{p,_e}from"./studio-w67vfgy5.js";import{Ne,Zw,xa,jc}from"./studio-nf0pqpbj.js";import{g}from"./studio-ahf3cspq.js";import{ln,Ia,Y,Cr,Up,h}from"./studio-j933k8nr.js";import{Ev}from"./studio-848rk4p1.js";import{Vc,Sa,tr}from"./studio-20ap8dds.js";import{Wr}from"./studio-va0e63sk.js";import{ZT,nl,Rb}from"./studio-695k95bw.js";import{mt}from"./studio-x2metr13.js";import{T,R,rt}from"./studio-cvz0e00f.js";import{Xn}from"./studio-ggm7zf70.js";import{gb}from"./studio-mwnmzx7g.js";import{Wu}from"./studio-pmzg17fj.js";import{Vy,GR,Zg,Cd,KR,JR,qk,Uy,qy}from"./studio-rf8d6p9f.js";import{cm}from"./studio-bkmv1h3e.js";import{Sw,Cw,bp}from"./studio-76t560kn.js";import{S,xn}from"./studio-rt498t2v.js";import{n,Z,v}from"./studio-zsjpsw08.js";import{le}from"./studio-0g2sm01j.js";var X=new Map([["img","src"],["source","src"],["video","poster"]]);function ee(e,t,a=Ne){if(!e||t!=="image")return{mode:"insert"};let r=X.get(e.tagName);if(r)return{attr:r,mode:"replace-attr",path:e.path};if(e.tagName.includes("-")){let s=(a.find((l)=>l.tagName===e.tagName)?.props??[]).filter((l)=>Ia(l.format));if(s.length===1)return{mode:"replace-prop",path:e.path,prop:s[0].name}}return{mode:"insert"}}function E(e){switch(e.kind){case"image":return{attributes:{src:e.ref},tagName:"img"};case"video":return{attributes:{controls:"",src:e.ref},tagName:"video"};case"audio":return{attributes:{controls:"",src:e.ref},tagName:"audio"};default:return{attributes:{href:e.ref},tagName:"a",textContent:e.name}}}function te(e,t){let a=[...e.targetPath],r=a.at(-1);if(t===0||!Z(r))return a;return a[a.length-1]=r+t,a}async function VR(e,t,a,r){if(!e||t.length===0)return;let o=await Sa(t),[s]=o;if(!s)return;let l=ee(a,s.kind);if(l.mode==="replace-attr"){Y(e,(m)=>Cr(m,l.path,l.attr,s.ref));return}if(l.mode==="replace-prop"){Y(e,(m)=>Up(m,l.path,l.prop,s.ref));return}for(let[m,i]of o.entries()){let u={fragment:E(i),type:"block"};if(r)Rb(e,{type:r.instruction},u,te(r,m));else Rb(e,{type:"make-child"},u,[])}}var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSitePanel",$description:"The Site panel (specs/studio.md §5.7): the project as an author thinks of it, pages by address and then the parts pages are made of. Four sections under a header holding one filter and a + that opens Add new (`file.new`, §9.1.1). `panels/site-panel.ts` keeps every decision: which files are pages, the route order and nesting (`panels/site-model.ts`, over `@jxsuite/site/routes`), how many entries a collection has and how many pages use a template, which media the project holds (the Media section is a short strip of the first few, and the rest are one click away in Media), what a click opens and what a drag inserts. This document draws rows whose every field is already a string, and a section state that is one of loading, empty, nomatch or listed, so a section a filter empties keeps its heading and says why. Component previews are an island the flow fills, and the drag sources are registered by the adapter through `onNodeCreated`.",tagName:"div",attributes:{part:"site"},style:{$description:"The Site panel's own look, keyed on `part`. Rows are native buttons, because a row opens one thing and a button is the element that says so to every reader; the selected row is the one whose `data-selected` is true, which the flow sets from the focused pane's document. A collection heading is not a button: it opens nothing in Design, and its pages are the buttons under it, indented one step. Component cards and media thumbnails are drag sources as well as buttons; the adapter registers the drags through `onNodeCreated`, so nothing here names a drag.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="filter"]':{flex:"1",minWidth:"0"},'& [part="sections"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-1) 0 var(--jx-space-4)"},'& [part="section"]':{padding:"var(--jx-space-2) 0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3) var(--jx-space-1)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="section-count"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="open-media"]':{marginLeft:"auto"},'& [part="no-project"]':{margin:"0",padding:"var(--jx-space-6) var(--jx-space-4)",textAlign:"center",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0",padding:"var(--jx-space-1) var(--jx-space-3)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column"},'& [part="page-row"], & [part="template-row"], & [part="collection-row"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",width:"100%",boxSizing:"border-box",minHeight:"26px",padding:"var(--jx-space-1) var(--jx-space-3)",border:"none",background:"transparent",color:"inherit",font:"inherit",textAlign:"start"},'& [part="page-row"], & [part="template-row"]':{cursor:"pointer",":hover":{background:"var(--hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="page-row"][data-nested="true"]':{paddingLeft:"calc(var(--jx-space-3) + var(--jx-space-4))"},'& [data-selected="true"]':{background:"var(--accent-15)",color:"var(--fg)"},'& [part="collection-row"]':{color:"var(--fg-dim)"},'& [part="row-label"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-detail"]':{flexShrink:"0",maxWidth:"55%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="cards"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3)"},'& [part="component-card"]':{display:"flex",flexDirection:"column",width:"100%",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)",color:"inherit",font:"inherit",cursor:"grab",":hover":{borderColor:"var(--fg-dim)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="card-preview"]':{$description:"A live render on the light document surface the Insert panel's element cards use (`--canvas-*` does not follow the theme, because what is drawn here is a page's part, and a site's dark text on the dark chrome read as an empty black box). It is drawn at half size, so a component laid out for a page shows its face rather than a clipped corner of one oversized glyph. The render is in the island's own shadow root (`mountPreview` in `browse/library-preview.ts`), so no rule here can reach its elements: the half size is the island's `zoom`, which lays the render out twice as wide and draws it at half, and the 128px height is the 64px box at that zoom. The broken-image rule went into the root with it.",position:"relative",height:"128px",zoom:"0.5",overflow:"hidden",pointerEvents:"none",background:"white",color:"var(--canvas-fg-2)",fontSize:"var(--jx-text-md)"},'& [part="card-label"]':{padding:"var(--jx-space-1) var(--jx-space-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-sm)",textAlign:"start"},'& [part="thumbs"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(56px, 1fr))",gap:"var(--jx-space-1)",padding:"0 var(--jx-space-3)"},'& [part="media-strip"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="media-more"]':{alignSelf:"flex-start",marginInline:"var(--jx-space-3)"},'& [part="media-thumb"]':{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",aspectRatio:"1",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-sm)",background:"var(--bg-panel)",color:"var(--fg-dim)",font:"inherit",cursor:"grab",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="thumb-image"]':{width:"100%",height:"100%",objectFit:"cover"},'& [part="thumb-name"]':{padding:"var(--jx-space-1)",overflow:"hidden",fontSize:"var(--jx-text-xs)",wordBreak:"break-all"}},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:"Filter the site",placeholder:"Filter the site…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"add"},$props:{size:"sm",icon:"plus",label:"Add new",hint:"Add new",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/add"},value:[]}]}}]},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{none:{tagName:"p",attributes:{part:"no-project"},textContent:"Open a project to see its pages, templates, components and media."},project:{tagName:"div",attributes:{part:"sections"},children:[{tagName:"section",attributes:{part:"section","data-section":"pages","aria-labelledby":"site-section-pages"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-pages"},textContent:"Pages"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.pagesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/pagesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No pages yet. Add one with +."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/pages"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"page-item",role:"listitem","data-kind":"${$map.item.kind}"},$switch:{$ref:"$map/item/kind"},cases:{collection:{tagName:"div",attributes:{part:"collection-row"},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},page:{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},"entry-page":{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}","data-nested":"true"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}}}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"templates","aria-labelledby":"site-section-templates"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-templates"},textContent:"Templates"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.templatesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/templatesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No templates in layouts/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/templates"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"template-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"template-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"components","aria-labelledby":"site-section-components"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-components"},textContent:"Components"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.componentsCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/componentsState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No components yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"cards",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/components"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"component-card",type:"button","data-tag":"${$map.item.tagName}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.hint}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openComponent"},value:[{$ref:"$map/item/tagName"}]}]},children:[{$description:'The preview ISLAND: empty here, filled by the flow with the component rendered live from the Library\'s preview cache as the card scrolls into view (specs/studio-ui-guidelines.md §9.4). It is `inert`, not merely `aria-hidden`: a component\'s own links and buttons stay focusable under `aria-hidden`, and Chrome then counts their text into the card\'s name ("Contact Us Today Eer cta", "◀ ▶ Eer reviews"). Inert takes the render out of the accessibility tree, the tab order and the pointer at once, so the card is named by its label alone.',tagName:"div",attributes:{part:"card-preview",inert:""}},{tagName:"span",attributes:{part:"card-label"},textContent:"${$map.item.label}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"media","aria-labelledby":"site-section-media"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-media"},textContent:"Media"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.mediaCount}"},{tagName:"jx-button",attributes:{part:"open-media"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"Open Media"}]}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mediaState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No media in public/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"media-strip"},children:[{tagName:"div",attributes:{part:"thumbs",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/media"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"thumb-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"media-thumb",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"Open ${$map.item.name} in Media, or drag it onto the canvas","aria-label":"${$map.item.name}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumb"},cases:{image:{tagName:"img",attributes:{part:"thumb-image",src:"${$map.item.src}",alt:"",loading:"lazy",draggable:"false"}},file:{tagName:"span",attributes:{part:"thumb-name"},textContent:"${$map.item.name}"}}}]}]}}]},{tagName:"jx-button",attributes:{part:"media-more",hidden:"${state.mediaMore === '' ? '' : null}"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"${state.mediaMore}"}]}]}}}]}]}}}]};T("site-panel",O);function A(){return{body:"none",components:[],componentsCount:"",componentsState:"loading",filter:"",media:[],mediaCount:"",mediaMore:"",mediaState:"loading",pages:[],pagesCount:"",pagesState:"loading",templates:[],templatesCount:"",templatesState:"loading"}}function z(e,t){e.body=t.body,e.filter=t.filter,e.pages=t.pages,e.pagesState=t.pagesState,e.pagesCount=t.pagesCount,e.templates=t.templates,e.templatesState=t.templatesState,e.templatesCount=t.templatesCount,e.components=t.components,e.componentsState=t.componentsState,e.componentsCount=t.componentsCount,e.media=t.media,e.mediaState=t.mediaState,e.mediaCount=t.mediaCount,e.mediaMore=t.mediaMore}function ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function re(e){let t=e?.$map,a=v(t)?t.item:void 0;return v(a)?a:null}function I(e,t){let a=re(e)?.[t];return n(a)?a:""}function J(e,t,a,r){let o=g({...A(),...a});z(o,t);let s=null,l=!1,m=R("site-panel",o,e,{onNodeCreated:(i,u,P,f)=>{if(l||!(i instanceof HTMLElement))return;switch(ne(P)){case"card-preview":{let d=I(f,"tagName");if(d!=="")r.preview(i,d);break}case"component-card":{let d=I(f,"tagName");if(d!=="")r.componentSource(i,d);break}case"media-thumb":{let d=I(f,"path");if(d!=="")r.mediaSource(i,d);break}default:break}}}).then((i)=>{if(l)return i.dispose(),i;return s=i,i});return{connected:()=>!l&&(s===null||s.root.parentNode===e),dispose(){l=!0,s?.dispose(),s=null},ready:m,update:(i)=>{z(o,i)}}}var N=null,F=!1,x=null,b=0;function ie(){return Object.keys(S?.projectConfig?.content??{})}async function oe(e){return(await ZT(e)).contentType}async function se(e){let[t,a]=await Promise.all([cm(["pages","layouts"],p()),Ev()]),r=t.files.filter((i)=>i.path.startsWith("pages/")),o=await Promise.all(r.map(async(i)=>({contentType:i.path.includes("[")?await oe(i.path):null,path:i.path})));if(e!==b)return;let s=N?.collections,l=new Map(ie().map((i)=>[i,s?.get(i)??null]));F=!1,N={collections:l,layouts:t.files.flatMap((i)=>i.path.startsWith("layouts/")?[i.path]:[]),pageExtensions:a,pages:o},C();let m=new Set(o.flatMap((i)=>i.contentType&&l.has(i.contentType)?[i.contentType]:[]));if(await Promise.all([...m].map(async(i)=>{let u=await gb(i).catch(()=>null);if(e===b&&u)l.set(i,u.length)})),e===b)C()}function pe(){if((!N||F)&&!x&&_e()&&S){let e=b;x=se(e).finally(()=>{if(e===b)x=null})}return N}function Jg(e){if(b+=1,F=!0,x=null,e===void 0||e.some((t)=>me(t)))D=!0;if(c)C()}var ce=["pages/","layouts/","content/","public/"];function me(e){if(e.startsWith("components/"))return!0;return e.endsWith(".json")&&e!=="project.json"&&!ce.some((t)=>e.startsWith(t))}var D=!1,M=!1;function de(){if(M||Zw&&!D||!_e())return;M=!0,D=!1,xa().finally(()=>{M=!1,C()})}function _(e,t){return Ne.flatMap((a)=>{let r=Cd(a.tagName),o=`<${a.tagName}>`,s=L(a);if(!Zg(e,a.tagName,s??"",a.package??""))return[];return[{hint:s?`Open ${o}, or drag it onto the canvas`:`${o} from ${a.package??"a package"}: open Packages, or drag it onto the canvas`,key:a.tagName,label:r,path:s??"",selected:Vy(s!==null&&s===t),tagName:a.tagName}]})}function L(e){return e?.path!==void 0&&e.source!=="npm"?e.path:null}var V=8;function ue(e,t){return e>t?`Show all ${e} in Media`:""}function W(e,t,a){return e.flatMap((r)=>Zg(t,r.name,r.file)?[{key:r.file,name:r.name,path:r.file,selected:Vy(r.file===a),src:r.isImage?tr(r.file):"",thumb:r.isImage?"image":"file"}]:[])}function ge(){let e=S?.projectConfig?.defaults?.layout;return n(e)?e.replace(/^\.\//,""):null}var w="";function j(e,t,a){if(e)return"loading";if(t===0)return"empty";return a===0?"nomatch":"listed"}function k(e,t,a){if(a||e===0)return"";return t===e?String(e):`${t} of ${e}`}function B(){if(!S)return{...A(),filter:w};let e=GR(w),t=h.value?.documentPath??null,a=pe();de();let r=Wu(),o=a?KR(a.pages,a.collections,t,{extensions:a.pageExtensions,i18n:ln(S.projectConfig??{}).i18n}):[],s=JR(o,e),l=ge(),m=a?qk(a.layouts,t,"",l):[],i=a?qk(a.layouts,t,e,l):[],u=!Zw,P=_("",t),f=_(e,t),d=r?W(r,"",t):[],y=r?W(r,e,t):[],H=(K)=>K.filter((Q)=>Q.kind!=="collection").length;return{body:"project",components:f,componentsCount:k(P.length,f.length,u),componentsState:j(u,P.length,f.length),filter:w,media:y.slice(0,V),mediaCount:k(d.length,y.length,r===null),mediaMore:ue(y.length,Math.min(y.length,V)),mediaState:j(r===null,d.length,y.length),pages:s,pagesCount:k(H(o),H(s),a===null),pagesState:j(a===null,o.length,s.length),templates:i,templatesCount:k(m.length,i.length,a===null),templatesState:j(a===null,m.length,i.length)}}function U(e){(le("zbc8p6v1"),import("./files-zbc8p6v1.js")).then(({openFileInTab:t})=>t(e))}var fe={add:()=>{rt("file.new",{},"Site panel")},open:U,openComponent:(e)=>{let t=Ne.find((r)=>r.tagName===e);if(!t)return;let a=L(t);if(a){U(a);return}rt("view.setActivity",{tab:"packages"},"Site panel")},openMedia:()=>{rt("view.setWorkspace",{workspace:"media"},"Site panel")},setFilter:(e)=>{w=e,C()}},c=null;async function he(e,t,a){let r=await Cw(a,e.cache);if(r&&c===e&&t.isConnected&&!qy(t))Uy(t,r)}function q(e,t,a){let r=Wr({element:t,getInitialData:()=>a()??{},onGenerateDragPreview:({nativeSetDragImage:o})=>{nl({nativeSetDragImage:o})}});e.sources.set(t,r)}function be(e){for(let[t,a]of e.sources)if(!t.isConnected)a(),e.sources.delete(t);e.observer.releaseDetached()}function G(e){e.handle?.dispose();for(let t of e.sources.values())t();e.sources.clear(),e.observer.destroy(),e.cache.clear()}function ye(e){let t=Ne.find((a)=>a.tagName===e);return t?{fragment:jc(t),type:"block"}:null}function ve(e){let t=Wu()?.find((r)=>r.file===e);if(!t)return null;return{fragment:E({kind:Vc({name:t.name}),name:t.name,path:t.file,ref:t.ref}),type:"block"}}function xe(e){if(c&&(c.host!==e||c.handle?.connected()===!1))G(c),c=null;if(c){c.handle?.update(B()),be(c);return}let t=new Map,a={cache:Sw(),handle:null,host:e,observer:bp((r)=>{let o=r instanceof HTMLElement?t.get(r):void 0;if(o!==void 0&&r instanceof HTMLElement)t.delete(r),he(a,r,o)}),pending:t,sources:new Map};c=a,a.handle=J(e,B(),fe,{componentSource:(r,o)=>{q(a,r,()=>ye(o))},mediaSource:(r,o)=>{q(a,r,()=>ve(o))},preview:(r,o)=>{let s=L(Ne.find((l)=>l.tagName===o));if(s)t.set(r,s),a.observer.observe(r)}})}function C(){xn("leftPanel")}function we(e){return e.querySelector(".panel-content")??e}function UR(){Xn({id:"site",title:"Site",level:"project",dock:"navigator",icon:"browser",render:()=>mt,afterRender:(e,t)=>{xe(we(t))}})}function qR(){if(c)G(c);c=null,w="",b+=1,N=null,F=!1,x=null,D=!0,M=!1}
2
2
  export{VR,Jg,UR,qR};
3
3
 
4
- //# debugId=985D9219DA66DC5964756E2164756E21
5
- //# sourceMappingURL=studio-396srjbk.js.map
4
+ //# debugId=903B0332822B40C464756E2164756E21
5
+ //# sourceMappingURL=studio-7823f0g8.js.map
@@ -1,5 +1,5 @@
1
- var s=new Set(["project.schema.json","document.schema.json"]);function lI(e){return s.has(e)?`file:///.jx/generated/${e}`:`file:///${e}`}function rM(e,r){return{head:`file:///.jx/diff/${e}/head/${r}`,work:`file:///.jx/diff/${e}/work/${r}`}}function sM(e){switch(e.slice(e.lastIndexOf(".")+1).toLowerCase()){case"cjs":case"js":case"mjs":return"javascript";case"css":return"css";case"htm":case"html":return"html";case"json":return"json";case"md":return"markdown";case"cts":case"mts":case"ts":return"typescript";case"yaml":case"yml":return"yaml";default:return"plaintext"}}
2
- export{lI,rM,sM};
1
+ var s=new Set(["project.schema.json","document.schema.json"]);function lI(e){return s.has(e)?`file:///.jx/generated/${e}`:`file:///${e}`}function sM(e,r){return{head:`file:///.jx/diff/${e}/head/${r}`,work:`file:///.jx/diff/${e}/work/${r}`}}function aM(e){switch(e.slice(e.lastIndexOf(".")+1).toLowerCase()){case"cjs":case"js":case"mjs":return"javascript";case"css":return"css";case"htm":case"html":return"html";case"json":return"json";case"md":return"markdown";case"cts":case"mts":case"ts":return"typescript";case"yaml":case"yml":return"yaml";default:return"plaintext"}}
2
+ export{lI,sM,aM};
3
3
 
4
- //# debugId=336EF59C7B8DB82264756E2164756E21
5
- //# sourceMappingURL=studio-r17asgs0.js.map
4
+ //# debugId=0E6CBF308F303F9F64756E2164756E21
5
+ //# sourceMappingURL=studio-7vb997ff.js.map
@@ -1,5 +1,5 @@
1
- import{kT,ET,TT}from"./studio-epenqmvk.js";import{p,_e}from"./studio-03mqh8ax.js";import{db,NE,AE}from"./studio-yx8hzqja.js";import{bA,dx,sl,CA,ds,Kl,px}from"./studio-h7weqf2q.js";import{le}from"./studio-7xag4na8.js";var t="checking",i=null;function uw(){return _e()&&Boolean(p().cfConnect)}async function cb(){if(!uw())return;i??=(async()=>{try{t=await p().cfConnection?.()??null}catch{t=null}i=null,um()})(),await i}function TD(){if(uw()&&t==="checking"&&!i)cb()}function LD(){t="checking",i=null}async function d(){let n=await p().cfConnect?.();if(n?.status==="connected"&&!n.connection.accountId){let{openCfAccountPicker:e}=await (le("xyqw0jex"),import("./cf-account-picker-xyqw0jex.js"));await e()}ds(),await cb()}function s(){let n={id:"disconnect",label:"Disconnect",run:async()=>{await p().cfDisconnect?.(),ds(),await cb()},variant:"negative"},e=(r)=>({id:r==="Connect"?"connect":"reconnect",label:r,run:d,variant:"accent"}),o={id:"cloudflare",label:"Cloudflare",revoke:()=>{}};if(t==="checking")return{...o,actions:[],connected:!1,detail:"Checking your connection…"};if(!t?.connected)return{...o,actions:[e("Connect")],connected:!1,detail:"Not connected. Connecting publishes this site and runs the assistant on Workers AI."};let c=()=>{n.run()};if(t.needsReconnect)return{...o,actions:[e("Reconnect"),n],connected:!0,detail:"Connection expired. Reconnect to keep publishing and the assistant working.",revoke:c};if(t.needsAccount||!t.accountId)return{...o,actions:[{id:"choose-account",label:"Choose account",run:async()=>{let{openCfAccountPicker:r}=await (le("xyqw0jex"),import("./cf-account-picker-xyqw0jex.js"));if(await r())ds(),await cb()},variant:"accent"},n],connected:!0,detail:"Connected, but no account is chosen yet — publishing and the assistant need one.",revoke:c};return{...o,actions:[n],connected:!0,detail:`Connected — ${t.accountName??t.accountId}.`,revoke:c}}function l(){let n=db(),e=NE();return{connected:Boolean(n),detail:n?`Connected${e?` — account ${e}`:""}.`:"Not connected. Publishing will ask when it needs it.",id:"cloudflare",label:"Cloudflare",revoke:AE}}function u(n){let e={id:n.id,label:n.label,run:async()=>{await px(n)}};if(n.primary)e.variant="accent";return e}function f(n){return{actions:(n.actions??[]).map((e)=>u(e)),connected:n.connected??!1,detail:n.detail,id:`platform:${n.id}`,label:n.label,revoke:()=>{}}}function RE(){let n=kT(),e=Kl(),o=sl();return[{id:"github",label:"GitHub",detail:n?ET()==="desktop"?"Signed in — the token is in this app's config folder, readable only by you.":"Signed in — a device-flow token is stored in this browser.":"Not signed in. Cloning and pushing will ask when they need it.",connected:Boolean(n),revoke:TT},{id:"ai",label:"AI provider",detail:dx()?`Key stored. Model ${e}${o?` via ${o}`:""}.`:"No key stored. The Assistant section is where one is entered.",connected:dx(),revoke:CA},uw()?s():l(),...bA().map((c)=>f(c))]}function $D(n){let e=RE().find((o)=>o.id===n);if(!e)return!1;return e.revoke(),um(),!0}var a=new Set;function ID(n){return a.add(n),()=>{a.delete(n)}}function um(){for(let n of a)n()}
1
+ import{kT,ET,TT}from"./studio-fep7hr66.js";import{p,_e}from"./studio-w67vfgy5.js";import{db,NE,AE}from"./studio-h7gy12h2.js";import{bA,dx,sl,kA,ds,Kl,px}from"./studio-8x8616xd.js";import{le}from"./studio-0g2sm01j.js";var t="checking",i=null;function uw(){return _e()&&Boolean(p().cfConnect)}async function cb(){if(!uw())return;i??=(async()=>{try{t=await p().cfConnection?.()??null}catch{t=null}i=null,um()})(),await i}function TD(){if(uw()&&t==="checking"&&!i)cb()}function LD(){t="checking",i=null}async function d(){let n=await p().cfConnect?.();if(n?.status==="connected"&&!n.connection.accountId){let{openCfAccountPicker:e}=await (le("z1sgwpwd"),import("./cf-account-picker-z1sgwpwd.js"));await e()}ds(),await cb()}function s(){let n={id:"disconnect",label:"Disconnect",run:async()=>{await p().cfDisconnect?.(),ds(),await cb()},variant:"negative"},e=(r)=>({id:r==="Connect"?"connect":"reconnect",label:r,run:d,variant:"accent"}),o={id:"cloudflare",label:"Cloudflare",revoke:()=>{}};if(t==="checking")return{...o,actions:[],connected:!1,detail:"Checking your connection…"};if(!t?.connected)return{...o,actions:[e("Connect")],connected:!1,detail:"Not connected. Connecting publishes this site and runs the assistant on Workers AI."};let c=()=>{n.run()};if(t.needsReconnect)return{...o,actions:[e("Reconnect"),n],connected:!0,detail:"Connection expired. Reconnect to keep publishing and the assistant working.",revoke:c};if(t.needsAccount||!t.accountId)return{...o,actions:[{id:"choose-account",label:"Choose account",run:async()=>{let{openCfAccountPicker:r}=await (le("z1sgwpwd"),import("./cf-account-picker-z1sgwpwd.js"));if(await r())ds(),await cb()},variant:"accent"},n],connected:!0,detail:"Connected, but no account is chosen yet — publishing and the assistant need one.",revoke:c};return{...o,actions:[n],connected:!0,detail:`Connected — ${t.accountName??t.accountId}.`,revoke:c}}function l(){let n=db(),e=NE();return{connected:Boolean(n),detail:n?`Connected${e?` — account ${e}`:""}.`:"Not connected. Publishing will ask when it needs it.",id:"cloudflare",label:"Cloudflare",revoke:AE}}function u(n){let e={id:n.id,label:n.label,run:async()=>{await px(n)}};if(n.primary)e.variant="accent";return e}function f(n){return{actions:(n.actions??[]).map((e)=>u(e)),connected:n.connected??!1,detail:n.detail,id:`platform:${n.id}`,label:n.label,revoke:()=>{}}}function RE(){let n=kT(),e=Kl(),o=sl();return[{id:"github",label:"GitHub",detail:n?ET()==="desktop"?"Signed in — the token is in this app's config folder, readable only by you.":"Signed in — a device-flow token is stored in this browser.":"Not signed in. Cloning and pushing will ask when they need it.",connected:Boolean(n),revoke:TT},{id:"ai",label:"AI provider",detail:dx()?`Key stored. Model ${e}${o?` via ${o}`:""}.`:"No key stored. The Assistant section is where one is entered.",connected:dx(),revoke:kA},uw()?s():l(),...bA().map((c)=>f(c))]}function $D(n){let e=RE().find((o)=>o.id===n);if(!e)return!1;return e.revoke(),um(),!0}var a=new Set;function ID(n){return a.add(n),()=>{a.delete(n)}}function um(){for(let n of a)n()}
2
2
  export{uw,cb,TD,LD,RE,$D,ID,um};
3
3
 
4
- //# debugId=C8771F934183BB7764756E2164756E21
5
- //# sourceMappingURL=studio-et2q4s8n.js.map
4
+ //# debugId=24C583C2B46FA82864756E2164756E21
5
+ //# sourceMappingURL=studio-8486jn4r.js.map
@@ -1,5 +1,5 @@
1
- import{p}from"./studio-03mqh8ax.js";import{n}from"./studio-zkq3r91p.js";import{le}from"./studio-7xag4na8.js";var a=null,P=null,F=null,g=!1;function S(t){return F=t,g=!0,a?E():Promise.resolve()}async function E(){if(!g)return;g=!1;try{let{applyProjectSchemas:t}=await (le("wasktzfg"),import("./monaco-setup-wasktzfg.js"));t(F)}catch{}}function Jm(){if(a)return Promise.resolve(a);return P??=(async()=>{let[t]=await Promise.all([(le("wqrc68ca"),import("./editor-wqrc68ca.js")),(le("wasktzfg"),import("./monaco-setup-wasktzfg.js"))]);return a=t,await E(),a})(),P}function nf(){return a}function Cv(t,o,e){if(!t?.isConnected||o)return!1;return e()}var i=[],d=null;function Ht(){if(!d)d=(async()=>{try{i=await p().listFormats?.()??[]}catch{i=[]}return i})();return d}function Lh(){d=null,i=[],f=null,c=[],x=null,l=[]}var c=[],f=null;function Qc(){if(!f)f=(async()=>{try{c=await p().listExtensions?.()??[]}catch{c=[]}return c})();return f}function kv(){return c}var l=[],x=null;function w(){if(!x)x=(async()=>{try{l=await p().listExtensionCatalog?.()??[]}catch{l=[]}return l})();return x}function Ux(){return l}async function j(t){let o=null;try{o=await t.fetchProjectSchemas?.()??null}catch{}S(o),await (le("b309c020"),import("./jx-validate-b309c020.js")).then(({applyProjectSchemas:e})=>e(o)).catch(()=>!1)}function ec(t){j(t),w(),(le("8ez2rrk8"),import("./extension-sections-8ez2rrk8.js")).then(({syncExtensionSettingsSections:o})=>o()).catch(()=>{})}function Xd(){return i}function Na(t,o){let e=t.startsWith(".")?t.toLowerCase():`.${t.toLowerCase()}`;return i.find((r)=>r.extensions.includes(e)&&(!o||r.capabilities[o]))}function Wi(t){if(!t)return;return i.find((o)=>o.name===t)}function of(t){return Error(`No format class imported for "${t}" — add one to project.json imports `+`(e.g. "Markdown": "@jxsuite/parser/Markdown.class.json") and make sure the project's dependencies are installed`)}function fn(t){if(!t)return;let o=t.lastIndexOf(".");if(o===-1)return;return Na(t.slice(o))}function ul(t){let o=new Set;for(let e of i){if(t&&!e.documentKinds.includes(t))continue;for(let r of e.extensions)o.add(r)}return o.delete(".json"),[...o]}async function Ev(){return await Ht(),[".json",...ul("page")]}function lr(){return i.find((t)=>t.capabilities.serialize&&t.documentKinds.includes("content"))}async function M(t){let o=p();if(!o.formatAction)throw Error("Platform does not support format actions");return o.formatAction(t)}async function oI(t,o,e){return await M({action:"parse",format:t,options:e,source:o})}async function Aa(t,o,e){return await M({action:"serialize",doc:o,format:t,options:e})}function rI(t,o){let e=t?.studio?.documentMode,r=e?.componentWhen;if(r?.frontmatterKey){let s=o[r.frontmatterKey],u=r.matches?new RegExp(r.matches):/./;if(n(s)&&u.test(s))return{document:o,frontmatter:{},mode:"component"}}if(e?.default==="component")return{document:o,frontmatter:{},mode:"component"};let m=o.children??[];if(Array.isArray(m)&&m.length===0)m.push({children:[],tagName:"p"});let b=new Set(["state","imports"]),h={children:m},y={};for(let[s,u]of Object.entries(o)){if(s==="children")continue;if(b.has(s))h[s]=u;else y[s]=u}return{document:h,frontmatter:y,mode:"content"}}
2
- export{Jm,nf,Cv,Ht,Lh,Qc,kv,Ux,ec,Xd,Na,Wi,of,fn,ul,Ev,lr,oI,Aa,rI};
1
+ import{p}from"./studio-w67vfgy5.js";import{n}from"./studio-zsjpsw08.js";import{le}from"./studio-0g2sm01j.js";var a=null,P=null,F=null,g=!1;function S(t){return F=t,g=!0,a?E():Promise.resolve()}async function E(){if(!g)return;g=!1;try{let{applyProjectSchemas:t}=await (le("1mkab762"),import("./monaco-setup-1mkab762.js"));t(F)}catch{}}function Jm(){if(a)return Promise.resolve(a);return P??=(async()=>{let[t]=await Promise.all([(le("zdqdpq1x"),import("./editor-zdqdpq1x.js")),(le("1mkab762"),import("./monaco-setup-1mkab762.js"))]);return a=t,await E(),a})(),P}function nf(){return a}function Cv(t,o,e){if(!t?.isConnected||o)return!1;return e()}var i=[],d=null;function Ht(){if(!d)d=(async()=>{try{i=await p().listFormats?.()??[]}catch{i=[]}return i})();return d}function Lh(){d=null,i=[],f=null,c=[],x=null,l=[]}var c=[],f=null;function ed(){if(!f)f=(async()=>{try{c=await p().listExtensions?.()??[]}catch{c=[]}return c})();return f}function kv(){return c}var l=[],x=null;function w(){if(!x)x=(async()=>{try{l=await p().listExtensionCatalog?.()??[]}catch{l=[]}return l})();return x}function Ux(){return l}async function j(t){let o=null;try{o=await t.fetchProjectSchemas?.()??null}catch{}S(o),await (le("5sp8a4rm"),import("./jx-validate-5sp8a4rm.js")).then(({applyProjectSchemas:e})=>e(o)).catch(()=>!1)}function ec(t){j(t),w(),(le("y2p1te2r"),import("./extension-sections-y2p1te2r.js")).then(({syncExtensionSettingsSections:o})=>o()).catch(()=>{})}function Qd(){return i}function Na(t,o){let e=t.startsWith(".")?t.toLowerCase():`.${t.toLowerCase()}`;return i.find((r)=>r.extensions.includes(e)&&(!o||r.capabilities[o]))}function Wi(t){if(!t)return;return i.find((o)=>o.name===t)}function of(t){return Error(`No format class imported for "${t}" — add one to project.json imports `+`(e.g. "Markdown": "@jxsuite/parser/Markdown.class.json") and make sure the project's dependencies are installed`)}function fn(t){if(!t)return;let o=t.lastIndexOf(".");if(o===-1)return;return Na(t.slice(o))}function ul(t){let o=new Set;for(let e of i){if(t&&!e.documentKinds.includes(t))continue;for(let r of e.extensions)o.add(r)}return o.delete(".json"),[...o]}async function Ev(){return await Ht(),[".json",...ul("page")]}function lr(){return i.find((t)=>t.capabilities.serialize&&t.documentKinds.includes("content"))}async function M(t){let o=p();if(!o.formatAction)throw Error("Platform does not support format actions");return o.formatAction(t)}async function oI(t,o,e){return await M({action:"parse",format:t,options:e,source:o})}async function Aa(t,o,e){return await M({action:"serialize",doc:o,format:t,options:e})}function rI(t,o){let e=t?.studio?.documentMode,r=e?.componentWhen;if(r?.frontmatterKey){let s=o[r.frontmatterKey],u=r.matches?new RegExp(r.matches):/./;if(n(s)&&u.test(s))return{document:o,frontmatter:{},mode:"component"}}if(e?.default==="component")return{document:o,frontmatter:{},mode:"component"};let m=o.children??[];if(Array.isArray(m)&&m.length===0)m.push({children:[],tagName:"p"});let b=new Set(["state","imports"]),h={children:m},y={};for(let[s,u]of Object.entries(o)){if(s==="children")continue;if(b.has(s))h[s]=u;else y[s]=u}return{document:h,frontmatter:y,mode:"content"}}
2
+ export{Jm,nf,Cv,Ht,Lh,ed,kv,Ux,ec,Qd,Na,Wi,of,fn,ul,Ev,lr,oI,Aa,rI};
3
3
 
4
- //# debugId=DEA74E46643F00DD64756E2164756E21
5
- //# sourceMappingURL=studio-3w35qvay.js.map
4
+ //# debugId=FEE0CDDC40E0C14564756E2164756E21
5
+ //# sourceMappingURL=studio-848rk4p1.js.map
@@ -1,5 +1,5 @@
1
- var n;function aM(e){n=new URL("./",e).href}function Zx(e){if(n===void 0)throw Error(`bundleUrl(${JSON.stringify(e)}) before setBundleBase(). An entry module (src/studio.ts or src/canvas/iframe-entry.ts) must call setBundleBase(import.meta.url) first; a test needs tests/with-dom.ts, which sets one.`);return new URL(e,n).href}
2
- export{aM,Zx};
1
+ var n;function lM(e){n=new URL("./",e).href}function Zx(e){if(n===void 0)throw Error(`bundleUrl(${JSON.stringify(e)}) before setBundleBase(). An entry module (src/studio.ts or src/canvas/iframe-entry.ts) must call setBundleBase(import.meta.url) first; a test needs tests/with-dom.ts, which sets one.`);return new URL(e,n).href}
2
+ export{lM,Zx};
3
3
 
4
- //# debugId=16826B4B6718CFBA64756E2164756E21
5
- //# sourceMappingURL=studio-5tzgq6fx.js.map
4
+ //# debugId=8EC7B07D7FE9B88964756E2164756E21
5
+ //# sourceMappingURL=studio-8jb31dcf.js.map
@@ -1,5 +1,5 @@
1
- import{Jx,Yx}from"./studio-881z1xrx.js";import{n,v}from"./studio-zkq3r91p.js";import{ip,le}from"./studio-7xag4na8.js";var a={document:Jx,project:Yx},i={...a},s={document:null,project:null},d=!1;function u(e){return s[e]??=(async()=>{try{let{default:t}=await (le("j56903f1"),import("./2020-j56903f1.js").then((m)=>ip(m.default,1))),{default:r}=await (le("qb98xhse"),import("./index-qb98xhse.js").then((m)=>ip(m.default,1))),o=new t({allErrors:!0,strict:!1,allowUnionTypes:!0});return r(o),o.compile(i[e])}catch(t){if(!d)d=!0,console.error(`[jx] ${e} schema validation is unavailable — the AI assistant's schema gate is a `+"no-op for this session:",t);return null}})(),s[e]}function p(e){return v(e)&&Object.keys(e).length>0}function Q2(e){let t=e?.document,r=e?.project,o=p(t)?t:a.document,c=p(r)?r:a.project,m=o!==a.document||c!==a.project;if(o===i.document&&c===i.project)return m;return i.document=o,i.project=c,s.document=null,s.project=null,m}var j=["unevaluatedProperty","additionalProperty","missingProperty"];function l(e){return(e.errors||[]).map((t)=>{let r=j.find((c)=>n(t.params[c])),o=r?` (${String(t.params[r])})`:"";return`${t.instancePath||"(root)"}: ${t.message}${o}`})}async function hm(e){let t=await u("document");if(!t||t(e))return[];return l(t)}async function eP(e){let t=await u("document");if(!t)return null;return t(e)?[]:l(t)}async function Bu(e){let t=await u("project");if(!t||t(e))return[];return l(t)}
2
- export{Q2,hm,eP,Bu};
1
+ import{Jx,Yx}from"./studio-881z1xrx.js";import{n,v}from"./studio-zsjpsw08.js";import{ip,le}from"./studio-0g2sm01j.js";var a={document:Jx,project:Yx},i={...a},s={document:null,project:null},d=!1;function u(e){return s[e]??=(async()=>{try{let{default:t}=await (le("mkb0qa6p"),import("./2020-mkb0qa6p.js").then((m)=>ip(m.default,1))),{default:r}=await (le("pxwwf00y"),import("./index-pxwwf00y.js").then((m)=>ip(m.default,1))),o=new t({allErrors:!0,strict:!1,allowUnionTypes:!0});return r(o),o.compile(i[e])}catch(t){if(!d)d=!0,console.error(`[jx] ${e} schema validation is unavailable — the AI assistant's schema gate is a `+"no-op for this session:",t);return null}})(),s[e]}function p(e){return v(e)&&Object.keys(e).length>0}function eP(e){let t=e?.document,r=e?.project,o=p(t)?t:a.document,c=p(r)?r:a.project,m=o!==a.document||c!==a.project;if(o===i.document&&c===i.project)return m;return i.document=o,i.project=c,s.document=null,s.project=null,m}var j=["unevaluatedProperty","additionalProperty","missingProperty"];function l(e){return(e.errors||[]).map((t)=>{let r=j.find((c)=>n(t.params[c])),o=r?` (${String(t.params[r])})`:"";return`${t.instancePath||"(root)"}: ${t.message}${o}`})}async function hm(e){let t=await u("document");if(!t||t(e))return[];return l(t)}async function tP(e){let t=await u("document");if(!t)return null;return t(e)?[]:l(t)}async function Bu(e){let t=await u("project");if(!t||t(e))return[];return l(t)}
2
+ export{eP,hm,tP,Bu};
3
3
 
4
- //# debugId=4F32DE6671839A2B64756E2164756E21
5
- //# sourceMappingURL=studio-y26hx9re.js.map
4
+ //# debugId=BF83E8C819C002A564756E2164756E21
5
+ //# sourceMappingURL=studio-8qejv8yf.js.map
@@ -1,5 +1,5 @@
1
- import{p,_e}from"./studio-03mqh8ax.js";import{pt,Uo,IA,Np,fx,xr,DA,Ap}from"./studio-771k2n12.js";import{C}from"./studio-4kzbrr5t.js";import{Ys,tt}from"./studio-jttyqrmh.js";import{n,Z,Ze,Q,v}from"./studio-zkq3r91p.js";var l=null;async function Pd(){if(!_e()||!Q(p().getAccountStatus)){l=null;return}try{l=await p().getAccountStatus?.()??null}catch{l=null}}function sC(){return l}function aC(){return l!==null&&l.installations.length===0&&Boolean(l.appInstallUrl)}function gA(){if(l===null)return null;let e=l.installations.flatMap((r)=>r.manageUrl?[{account:r.account??`Installation ${r.id}`,url:r.manageUrl}]:[]);if(e.length===0&&!l.appInstallUrl)return null;let t={manage:e};if(l.appInstallUrl)t.installUrl=l.appInstallUrl;return t}function bA(){return l?.entries??[]}function i$(){return(l?.notices??[]).filter((e)=>e.display!=="toast")}var L=new Set;function N(){let e=(l?.notices??[]).filter((t)=>t.display==="toast"&&!L.has(t.id));for(let t of e)L.add(t.id);return e}var G="https://jxsuite.com/problems/";function E(e){return typeof e==="string"}function X(e){return typeof e==="object"&&e!==null}function Vb(e){if(!E(e)||!e.startsWith("https://jxsuite.com/problems/"))return null;let t=e.slice(29);return t===""?null:t}function nr(e){if(E(e))return e.trim()===""?null:e;if(!X(e))return null;for(let t of[e.detail,e.error,e.title])if(E(t)&&t.trim()!=="")return t;return null}function rl(e,t){return nr(e)??(t===void 0?"Request failed":`Request failed (${t})`)}var d=(e,t,r,i)=>{let s={status:t,title:r,type:`${G}${e}`};if(i!==void 0)s.extensions=i;return s},ge={invalidRequest:d("invalid-request",400,"The request was malformed or incomplete"),notFound:d("not-found",404,"The requested resource does not exist"),methodNotAllowed:d("method-not-allowed",405,"That method is not allowed on this route"),conflict:d("conflict",409,"The request conflicts with the current state",["conflicts"]),payloadTooLarge:d("payload-too-large",413,"The request body is too large"),unauthorized:d("unauthorized",401,"Credentials are missing or not accepted"),forbidden:d("forbidden",403,"The request was refused"),needsInstallationAccess:d("needs-installation-access",403,"The GitHub App is not installed for that account",["installUrl"]),pathOutsideProject:d("path-outside-project",403,"The path resolves outside the active project"),actionRequired:d("action-required",403,"An action is required first",["actions","heading","retry"]),noActiveProject:d("no-active-project",409,"No project is active on this backend"),capabilityUnavailable:d("capability-unavailable",501,"This backend does not provide that capability"),upstreamFailure:d("upstream-failure",502,"An upstream service failed",["upstream"]),internalError:d("internal-error",500,"The backend failed to complete the request")};var o=(e,t,r,i)=>{let s={method:e,path:t,optional:i!==void 0,summary:r};if(i!==void 0)s.degradation=i;return s},he={activate:o("POST","/__studio/activate","Bind the backend to a project root"),project:o("GET","/__studio/project","Root project metadata {name, root}"),projectInfo:o("GET","/__studio/project-info","Probe a directory: {isSiteProject, projectConfig?, directories?}"),resolveSite:o("GET","/__studio/resolve-site","Resolve the owning site of a file path {sitePath, projectConfig?, fileRelPath?}"),sites:o("GET","/__studio/sites","Enumerate site projects [{config, path}] (backs listProjects)","The welcome screen's Projects catalogue stays hidden."),createProject:o("POST","/__studio/create-project","Scaffold a project at a caller-chosen destination → {root, config}"),starters:o("GET","/__studio/starters","Starter templates (StarterInfo[])","The New Project picker offers only blank/templates."),importSite:o("POST","/__studio/import-site","Clone a live website into a project; streams NDJSON progress","The New Project Import tab is unavailable."),files:o("GET","/__studio/files","List a directory (DirEntry[]) in stable path order; an entry may carry an opaque content `version` the backend vouches for; with ?glob=<pattern>, search matching files project-wide"),fileRead:o("GET","/__studio/file","Read a file's text content"),filesRead:o("POST","/__studio/files/read","Read many files' text content {paths} → ReadFilesResult {files: [path, {content} | "+"{error: {status, code?, message}}][], omitted}. At most READ_FILES_MAX_PATHS (200) paths and a backend byte budget per call: the excess is listed in `omitted` (never a 400) and the first path is always answered. Per-path errors: 404 missing/deleted, 415 binary, 413 too large, 502 upstream. Allowed for read-only sessions; keeps fileRead's server-side effects","Adapters fall back to one fileRead per path."),fileWrite:o("PUT","/__studio/file","Write a file's text content"),fileDelete:o("DELETE","/__studio/file","Delete a file"),fileUpload:o("POST","/__studio/file/upload","Upload binary content to a path → UploadResult {path, size?}. `path` is the answer, not an "+"echo: a store that de-duplicates, suffixes, or normalizes names reports what it really wrote"),fileBytes:o("GET","/__studio/file/bytes","A project file's raw bytes, undecoded — the read side of `fileUpload`, for a caller that must "+"not go through UTF-8","Studio can only read a project file as text, so any surface that must decode one stays hidden."),documentRaw:o("GET","/__studio/raw/","A project file as its own bytes, at its own URL — the mount a canvas renders against when "+"the editor origin does not serve the site's URL space. The project-relative path is appended to this prefix","The canvas cannot address project files by URL, so a host whose origin does not serve the site URL space renders no component $refs and no images."),fileRename:o("POST","/__studio/file/rename","Rename/move (+ refactor report). `from`/`to` are server-root-relative; every path in the "+"report is relative to the active project (specs/server.md §4.1)"),references:o("GET","/__studio/references","Where a file or a component tag is used (?path=&tag=, at least one) → ReferencesResult "+"{files, filesReferencing, refsTotal} — the read side of the rename refactor's own walker, "+"cached until the backend's watcher sees the tree move (backs findReferences). `?path=` is server-root-relative and every path in the answer is relative to the active project; a "+"target outside that project is a 400, never a zero-result 200 (specs/server.md §4.1)",'Usage counts are hidden: no "Used on N pages" in the inspector, no Selection: Find Usages, and delete/rename confirmations state no reference count.'),locate:o("POST","/__studio/locate","Find a file by name → {path | null}"),collab:o("GET","/__studio/collab","Realtime co-editing: a WebSocket upgrade speaking the @jxsuite/collab wire envelope (one socket per project, documents multiplexed by path; y-protocols sync + project-level "+"awareness in lib0 binary frames — see @jxsuite/collab/envelope for the frame layout and "+"the docEpoch/doc-reset lifecycle). A plain GET (no Upgrade) answers {collab, protocols, version} as the capability probe, and `protocols` is the subprotocol negotiation: the client offers one of them as Sec-WebSocket-Protocol and the server echoes it, or the "+"client offers none when the server advertises none, because RFC 6455 §4.1 fails a "+"connection whose offer went unechoed.","Realtime co-editing is unavailable; Studio edits solo with file-level saves"),components:o("GET","/__studio/components","Discover components (ComponentMeta[])"),cem:o("GET","/__studio/cem","Custom-elements manifest of an npm dependency","Dependency components lose prop/slot metadata."),formats:o("GET","/__studio/formats","The project's format registry entries plus a sibling `extensions` array — per enabled "+"extension its manifest identity and project-section contributions (ExtensionsInfo[]; backs listFormats and listExtensions).","Only .json documents open (backs listFormats); descriptor-contributed settings sections do not appear."),extensionCatalog:o("GET","/__studio/catalog","Extensions this backend can OFFER (ExtensionCatalogEntry[]) — the shipped first-party "+"catalogue plus any package in the project's own dependencies exporting a jx-extension.json, each marked with whether the host resolves it without a project install and whether the project has it installed. A capability rather than a constant: a Worker ships a fixed set "+"of extension packages (specs/extensions.md §5.5). Backs listExtensionCatalog.","The Extensions section offers no catalogue; adding an extension stays a typed package name."),projectSchemas:o("GET","/__studio/project-schemas","The project's generated entry documents (project.schema.json / document.schema.json), "+"PRE-BUNDLED into self-contained schemas — {project, document} (backs fetchProjectSchemas). "+"Regenerated on demand when missing or older than project.json.","The JSON editor falls back to the bundled core schemas (extension sections get no editor validation/completion)."),format:o("POST","/__studio/format","Dispatch a format capability {format, action: parse|serialize, source?|doc?}","Non-JSON documents cannot be parsed/serialized (backs formatAction)."),pluginSchema:o("GET","/__studio/plugin-schema","Extract a $studio schema from a class source","Plugin property panels fall back to generic JSON editing."),codeFormat:o("POST","/__studio/code/format","Format posted source {code, path?} → {code, errors}","Code editors skip format-on-open/save (codeService returns null)."),codeMinify:o("POST","/__studio/code/minify","Minify posted source {code} → {code}","Compiled-output minification is skipped."),codeLint:o("POST","/__studio/code/lint","Lint posted source {code, path?} → {diagnostics}","Code editors show no lint markers."),buildSite:o("POST","/__studio/build","Build or render the site → {routes, files, errors, mode?, url}","Build Site reports that this target cannot build."),previewSite:o("POST","/__studio/preview","Preview the working tree at a route → {routes, files, errors, mode, url, reused}","Open in Browser falls back to buildSite."),previewOverlay:o("POST","/__studio/preview/overlay","Publish (POST) or retract (DELETE) a document's unsaved bytes → 204","A live preview shows the last saved state instead of the editor's."),packages:o("GET","/__studio/packages","List dependencies (PackageInfo[])"),packagesAdd:o("POST","/__studio/packages/add","Add a registry dependency, writing package.json and package-lock.json together"),packagesRemove:o("POST","/__studio/packages/remove","Remove a dependency, writing package.json and package-lock.json together"),packagesInstall:o("POST","/__studio/packages/install","Install the declared dependencies (npm's installer, writing package-lock.json)","Install/reinstall affordances are hidden; add, remove and version updates still work where the backend serves them (a cloud session updates the lockfile without installing)."),packagesNeedsInstall:o("GET","/__studio/packages/needs-install","Whether node_modules is stale","The install-on-open prompt never shows."),packagesVersions:o("GET","/__studio/packages/versions","Newest published version of each dependency (PackageVersionInfo[])","The Latest column stays empty and the update affordances are hidden."),packagesSetVersions:o("POST","/__studio/packages/set-versions","Rewrite dependency ranges and install (lockfile-only where nothing installs)","Bulk version updates are hidden."),gitStatus:o("GET","/__studio/git/status","Working-tree status (GitStatusResult)"),gitBranches:o("GET","/__studio/git/branches","Branch list (GitBranchesResult)"),gitLog:o("GET","/__studio/git/log","Recent commits (GitLogEntry[])"),gitStage:o("POST","/__studio/git/stage","Stage files"),gitUnstage:o("POST","/__studio/git/unstage","Unstage files"),gitCommit:o("POST","/__studio/git/commit","Commit staged (else all dirty) files"),gitPush:o("POST","/__studio/git/push","Push (cloud: sync check — commits land on push)"),gitPull:o("POST","/__studio/git/pull","Pull/fast-forward; 409 {conflicts} on overlap"),gitFetch:o("POST","/__studio/git/fetch","Refresh remote tracking state"),gitCheckout:o("POST","/__studio/git/checkout","Switch branches"),gitCreateBranch:o("POST","/__studio/git/create-branch","Create a branch"),gitDiff:o("GET","/__studio/git/diff","Unified diff of dirty files (or one path)"),gitShow:o("GET","/__studio/git/show","File content at a ref"),gitDiscard:o("POST","/__studio/git/discard","Discard working changes"),gitInit:o("POST","/__studio/git/init","Initialize a repository"),gitAddRemote:o("POST","/__studio/git/add-remote","Add a remote"),gitClone:o("POST","/__studio/git/clone","Clone a repository","The welcome screen hides Clone Git Repository."),gitPr:o("POST","/__studio/git/pr","Open a pull request → PullRequestInfo","Studio falls back to a direct GitHub API call with the user's token."),dataConnections:o("GET","/__studio/data/connections","Connector connections with configured/missingSecrets/isDefault state, reachable table names, and registry-descriptor provider metadata (DataConnectionsResponse; backs dataConnections)","The connections settings section shows no status, and data-domain actions stay hidden."),dataConnectionTest:o("POST","/__studio/data/connections/test","Probe a connection {connection} → DataConnectionTestResult (backs dataConnectionTest)","The Test Connection action is hidden."),dataPush:o("POST","/__studio/data/push","Additive schema push {connection?, dryRun?} → DataPushResult (plan of DataPushStep[], "+"applied, warnings/errors; backs dataPush)","The Push Schema action is hidden; schemas deploy via `jx db push` instead."),dataRows:o("GET","/__studio/data/rows","Page a table (DataRowsQuery params) → DataRowsResult {rows, total, columns} (backs dataRows)","The data grid is unavailable."),dataInsertRow:o("POST","/__studio/data/rows","Insert a row {table, connection?, values} → {row} (backs dataInsertRow)","The data grid hides its add-row footer."),dataUpdateRow:o("PUT","/__studio/data/rows","Update a row keyed on its primary key {table, connection?, pk, set} → {row} (backs "+"dataUpdateRow)","Data grid cells are read-only."),dataDeleteRow:o("DELETE","/__studio/data/rows","Delete a row (?table=&pk=&connection=) → {ok} (backs dataDeleteRow)","The data grid hides row deletion."),secretsList:o("GET","/__studio/secrets","Configured secret env-var NAMES, never values (SecretsListResponse; backs listSecrets)","Secret fields cannot show set/unset state."),secretsSet:o("PUT","/__studio/secrets","Write/remove secrets in the backend store (.dev.vars locally) {set?, remove?} → names "+"(backs setSecrets)","The secret form control renders disabled; secrets are edited in .dev.vars by hand."),aiChat:o("POST","/__studio/ai/chat","StreamEvent SSE chat proxy {messages, tools, systemPrompt, model}"),aiModels:o("GET","/__studio/ai/models","Model catalogue (AiModelsResponse)"),cfProxy:o("POST","/__studio/cf/proxy","Allowlisted Cloudflare API passthrough {path, method?, body?} (backs cfApi)","The Publish panel explains the git-push publishing path instead.")};var o$=200,r$=100,s$=12;var Y=new Set(["reload","repeat","none"]);function Dp(e){if(!Array.isArray(e))return[];return e.flatMap((r)=>{if(!v(r))return[];let{href:i,id:s,label:f,primary:g}=r;if(!n(s)||!s||!n(f)||!f)return[];let c={id:s,label:f};if(n(i)&&i)c.href=i;if(g===!0)c.primary=!0;return[c]})}function q(e){return n(e)&&Y.has(e)}function a$(e){return q(e)?e:void 0}function ee(e){return e.replaceAll("_","-")}function _(e){if(!v(e))return{};let{actions:t,code:r,heading:i,installUrl:s,retry:f,type:g}=e,c={},a=Vb(g)??(n(r)?ee(r):null);if(a!==null)c.code=a;if(n(s))c.installUrl=s;if(t!==void 0)c.actions=Dp(t);if(n(i)&&i)c.heading=i;if(q(f))c.retry=f;return c}function vA(e){let t=_(e);return t.code==="needs-installation-access"&&t.installUrl?t.installUrl:null}function yA(e){return _(e).code==="action-required"}function Fd(){return Uo(pt.aiOpenAiKey)}function wA(e){xr(pt.aiOpenAiKey,e||"")}function dx(){return IA(pt.aiOpenAiKey)}function sl(){return Uo(pt.aiBaseUrl)}function ux(){return Uo(pt.aiModel)}function xA(e){xr(pt.aiModel,e||"")}function _A(e){DA([[pt.aiOpenAiKey,e.apiKey],[pt.aiBaseUrl,e.baseUrl],[pt.aiModel,e.model]])}function SA(e){return!Lm(pt.aiOpenAiKey,e.apiKey,Fd())||!Lm(pt.aiBaseUrl,e.baseUrl,sl())||!Lm(pt.aiModel,e.model,ux())}function Lm(e,t,r){return fx(e,t)===fx(e,r)}function CA(){Ap([pt.aiOpenAiKey,pt.aiBaseUrl,pt.aiModel])}function lC(){return{apiKey:Fd(),baseUrl:sl()}}function V(e){return`${e.apiKey}\x00${e.baseUrl}`}var m=null,P="",j=!1,A=!1,D="",M,I="",R=null,U=null,F=new Set,te=600000,S=0,J=!1;function ds(){m=null,P="",j=!1,A=!1,D="",M=void 0,I="",R=null,U=null,S=0}var ne=new Set([pt.aiOpenAiKey.key,pt.aiBaseUrl.key,pt.cfToken.key,pt.cfAccountId.key]);Np((e)=>{if(e.some((t)=>ne.has(t)))ds()});function l$(e){return m&&P===V(e)?m:null}function K(e){return m?.find((t)=>t.id===e)}function c$(e){return K(e)?.toolSupport}function kA(e){return K(e)?.contextWindow}function hx(e){if(e)F.add(e);U??=ah({force:!0}).catch(()=>{}).then(()=>{S=Date.now();for(let t of F)t()})}function oe(){if(!A||S===0||Date.now()-S<te)return!1;return U=null,S=0,hx(),!0}function re(){if(typeof window>"u"||J)return;J=!0,window.addEventListener("focus",()=>{oe()})}re();function Ub(){return dx()||cC()}function cC(){return j}function EA(){return A}function $m(){return M}function TA(){return I}function dC(){return R}function ie(){return D}function Kl(){return ux()||ie()||pt.aiModel.default}function se(e,t){let r;try{r=new URL(e,"http://jx.invalid")}catch{return e}return r.pathname=r.pathname.replace(/[^/]*$/,t),/^https?:/i.test(e)?r.href:`${r.pathname}${r.search}`}async function ah(e={}){let t=e.credentials??lC(),r=V(t);if(m&&P===r&&!e.force)return m;let i=p(),s=await Promise.resolve(i.aiChatUrl()),f=se(s,"models"),g={};if(t.apiKey)g["X-Api-Key"]=t.apiKey;if(t.baseUrl)g["X-Api-Base-URL"]=t.baseUrl;let c=await fetch(f,{headers:g});if(!c.ok)throw Error(`HTTP ${c.status}`);let a=await c.json();if(j=a.configured===!0,A=a.managed===!0,D=a.defaultModel??"",M=a.code,I=a.upstreamError!==void 0?a.upstreamMessage??"":"",R=null,a.code==="action_required"){let u={actions:Dp(a.actions)};if(n(a.detail)&&a.detail)u.detail=a.detail;R=u}return m=(a.models||[]).map((u)=>{let h={id:u.id,name:u.name||u.id};if(Z(u.contextWindow))h.contextWindow=u.contextWindow;if(Ze(u.toolSupport))h.toolSupport=u.toolSupport;return h}),P=r,m}var T=new Set,B=null;function LA(e){if(T.size===0){B=e;return}for(let t of T)t(e)}function H(e){T.add(e);let t=B;if(B=null,t)e(t);return()=>{T.delete(e)}}function uC(){return _e()&&Q(p().performAction)}function d$(e){let t=e.find((i)=>i.primary)??e[0];if(!t)return null;let r=e.find((i)=>i!==t);return r?{lead:t,other:r}:{lead:t}}var w=null,W=!1;function hC(e){let t=d$(e.actions);if(!uC()||!t)return Promise.resolve(!1);return w??=ae(e,t).finally(()=>{w=null}),w}async function Im(e){let t=_(e);if(t.code!=="action-required"||!t.actions?.length)return!1;return hC({actions:t.actions,detail:e instanceof Error?e.message:void 0,heading:t.heading,retry:t.retry})}async function z(){ds(),await Pd(),u$()}function ae(e,t){let r=e.detail??"This needs one more step first.";return new Promise((i)=>{let s="offer",f=(y)=>{if(s==="done")return;s="done",O.close(),i(y)},g=(y)=>{s="offer",O.update({cancelLabel:"Not now",confirmLabel:t.lead.label,message:y,secondaryLabel:t.other?.label??""})},c=async(y)=>{let b;try{b=await y}catch(x){if(s==="waiting")g(x instanceof Error?x.message:String(x));return}if(b?.status==="done"){await z(),f(!0);return}if(s!=="waiting"||!b||b.status==="redirect")return;Pd(),g(r)},a=(y)=>{if(s!=="offer")return;s="waiting";let b;try{b=p().performAction(y)}catch(x){g(x instanceof Error?x.message:String(x));return}O.update({cancelLabel:"Cancel",confirmLabel:"Waiting…",message:"Finish in the window that opened. This closes by itself once it is done.",secondaryLabel:""}),c(b)},{lead:u,other:h}=t,k={cancelLabel:"Not now",confirmLabel:u.label,headline:e.heading??"One more step",layer:tt("dialog"),message:r,onCancel:()=>{W=!0,f(!1)},onClosed:()=>{f(!1)},onConfirm:()=>{a(u)},region:"account/action"};if(h)k.onSecondary=()=>{a(h)},k.secondaryLabel=h.label;let O=Ys(k)})}function ce(e){if(e==="reload")location.reload();else if(e==="repeat")C.info("Done. Run that again now.",{key:"account.action.retry",source:"Account"})}function $A(){return H((e)=>{if(W||w)return;hC(e).then((t)=>{if(t)ce(e.retry)})})}async function px(e){if(!uC())return!1;let t=p().performAction(e),r;try{r=await t}catch(i){return C.error(i instanceof Error?i.message:String(i),{key:"account.action",source:"Account",tier:"toast"}),!1}if(r?.status==="done")return await z(),!0;if(r?.status!=="redirect")await Pd();return!1}function u$(){for(let e of N()){let t={key:`account.notice.${e.id}`,source:"Account"};if(e.level==="warning")C.warn(e.message,t);else C.info(e.message,t)}}
2
- export{Pd,sC,aC,gA,bA,i$,Vb,nr,rl,o$,r$,s$,Dp,a$,vA,yA,Fd,wA,dx,sl,ux,xA,_A,SA,Lm,CA,lC,ds,l$,c$,kA,hx,Ub,cC,EA,$m,TA,dC,Kl,ah,LA,uC,d$,hC,Im,$A,px,u$};
1
+ import{p,_e}from"./studio-w67vfgy5.js";import{pt,Uo,RA,Np,fx,xr,NA,Ap}from"./studio-xebavr9s.js";import{C}from"./studio-ahf3cspq.js";import{Zs,tt}from"./studio-cvz0e00f.js";import{n,Z,Ze,Q,v}from"./studio-zsjpsw08.js";var l=null;async function Fd(){if(!_e()||!Q(p().getAccountStatus)){l=null;return}try{l=await p().getAccountStatus?.()??null}catch{l=null}}function sC(){return l}function aC(){return l!==null&&l.installations.length===0&&Boolean(l.appInstallUrl)}function gA(){if(l===null)return null;let e=l.installations.flatMap((r)=>r.manageUrl?[{account:r.account??`Installation ${r.id}`,url:r.manageUrl}]:[]);if(e.length===0&&!l.appInstallUrl)return null;let t={manage:e};if(l.appInstallUrl)t.installUrl=l.appInstallUrl;return t}function bA(){return l?.entries??[]}function i$(){return(l?.notices??[]).filter((e)=>e.display!=="toast")}var L=new Set;function N(){let e=(l?.notices??[]).filter((t)=>t.display==="toast"&&!L.has(t.id));for(let t of e)L.add(t.id);return e}var G="https://jxsuite.com/problems/";function E(e){return typeof e==="string"}function X(e){return typeof e==="object"&&e!==null}function Vb(e){if(!E(e)||!e.startsWith("https://jxsuite.com/problems/"))return null;let t=e.slice(29);return t===""?null:t}function nr(e){if(E(e))return e.trim()===""?null:e;if(!X(e))return null;for(let t of[e.detail,e.error,e.title])if(E(t)&&t.trim()!=="")return t;return null}function rl(e,t){return nr(e)??(t===void 0?"Request failed":`Request failed (${t})`)}var d=(e,t,r,i)=>{let s={status:t,title:r,type:`${G}${e}`};if(i!==void 0)s.extensions=i;return s},ge={invalidRequest:d("invalid-request",400,"The request was malformed or incomplete"),notFound:d("not-found",404,"The requested resource does not exist"),methodNotAllowed:d("method-not-allowed",405,"That method is not allowed on this route"),conflict:d("conflict",409,"The request conflicts with the current state",["conflicts"]),payloadTooLarge:d("payload-too-large",413,"The request body is too large"),unauthorized:d("unauthorized",401,"Credentials are missing or not accepted"),forbidden:d("forbidden",403,"The request was refused"),needsInstallationAccess:d("needs-installation-access",403,"The GitHub App is not installed for that account",["installUrl"]),pathOutsideProject:d("path-outside-project",403,"The path resolves outside the active project"),actionRequired:d("action-required",403,"An action is required first",["actions","heading","retry"]),noActiveProject:d("no-active-project",409,"No project is active on this backend"),capabilityUnavailable:d("capability-unavailable",501,"This backend does not provide that capability"),upstreamFailure:d("upstream-failure",502,"An upstream service failed",["upstream"]),internalError:d("internal-error",500,"The backend failed to complete the request")};var o=(e,t,r,i)=>{let s={method:e,path:t,optional:i!==void 0,summary:r};if(i!==void 0)s.degradation=i;return s},he={activate:o("POST","/__studio/activate","Bind the backend to a project root"),project:o("GET","/__studio/project","Root project metadata {name, root}"),projectInfo:o("GET","/__studio/project-info","Probe a directory: {isSiteProject, projectConfig?, directories?}"),resolveSite:o("GET","/__studio/resolve-site","Resolve the owning site of a file path {sitePath, projectConfig?, fileRelPath?}"),sites:o("GET","/__studio/sites","Enumerate site projects [{config, path}] (backs listProjects)","The welcome screen's Projects catalogue stays hidden."),createProject:o("POST","/__studio/create-project","Scaffold a project at a caller-chosen destination → {root, config}"),starters:o("GET","/__studio/starters","Starter templates (StarterInfo[])","The New Project picker offers only blank/templates."),importSite:o("POST","/__studio/import-site","Clone a live website into a project; streams NDJSON progress","The New Project Import tab is unavailable."),files:o("GET","/__studio/files","List a directory (DirEntry[]) in stable path order; an entry may carry an opaque content `version` the backend vouches for; with ?glob=<pattern>, search matching files project-wide"),fileRead:o("GET","/__studio/file","Read a file's text content"),filesRead:o("POST","/__studio/files/read","Read many files' text content {paths} → ReadFilesResult {files: [path, {content} | "+"{error: {status, code?, message}}][], omitted}. At most READ_FILES_MAX_PATHS (200) paths and a backend byte budget per call: the excess is listed in `omitted` (never a 400) and the first path is always answered. Per-path errors: 404 missing/deleted, 415 binary, 413 too large, 502 upstream. Allowed for read-only sessions; keeps fileRead's server-side effects","Adapters fall back to one fileRead per path."),fileWrite:o("PUT","/__studio/file","Write a file's text content"),fileDelete:o("DELETE","/__studio/file","Delete a file"),fileUpload:o("POST","/__studio/file/upload","Upload binary content to a path → UploadResult {path, size?}. `path` is the answer, not an "+"echo: a store that de-duplicates, suffixes, or normalizes names reports what it really wrote"),fileBytes:o("GET","/__studio/file/bytes","A project file's raw bytes, undecoded — the read side of `fileUpload`, for a caller that must "+"not go through UTF-8","Studio can only read a project file as text, so any surface that must decode one stays hidden."),documentRaw:o("GET","/__studio/raw/","A project file as its own bytes, at its own URL — the mount a canvas renders against when "+"the editor origin does not serve the site's URL space. The project-relative path is appended to this prefix","The canvas cannot address project files by URL, so a host whose origin does not serve the site URL space renders no component $refs and no images."),fileRename:o("POST","/__studio/file/rename","Rename/move (+ refactor report). `from`/`to` are server-root-relative; every path in the "+"report is relative to the active project (specs/server.md §4.1)"),references:o("GET","/__studio/references","Where a file or a component tag is used (?path=&tag=, at least one) → ReferencesResult "+"{files, filesReferencing, refsTotal} — the read side of the rename refactor's own walker, "+"cached until the backend's watcher sees the tree move (backs findReferences). `?path=` is server-root-relative and every path in the answer is relative to the active project; a "+"target outside that project is a 400, never a zero-result 200 (specs/server.md §4.1)",'Usage counts are hidden: no "Used on N pages" in the inspector, no Selection: Find Usages, and delete/rename confirmations state no reference count.'),locate:o("POST","/__studio/locate","Find a file by name → {path | null}"),collab:o("GET","/__studio/collab","Realtime co-editing: a WebSocket upgrade speaking the @jxsuite/collab wire envelope (one socket per project, documents multiplexed by path; y-protocols sync + project-level "+"awareness in lib0 binary frames — see @jxsuite/collab/envelope for the frame layout and "+"the docEpoch/doc-reset lifecycle). A plain GET (no Upgrade) answers {collab, protocols, version} as the capability probe, and `protocols` is the subprotocol negotiation: the client offers one of them as Sec-WebSocket-Protocol and the server echoes it, or the "+"client offers none when the server advertises none, because RFC 6455 §4.1 fails a "+"connection whose offer went unechoed.","Realtime co-editing is unavailable; Studio edits solo with file-level saves"),components:o("GET","/__studio/components","Discover components (ComponentMeta[])"),cem:o("GET","/__studio/cem","Custom-elements manifest of an npm dependency","Dependency components lose prop/slot metadata."),formats:o("GET","/__studio/formats","The project's format registry entries plus a sibling `extensions` array — per enabled "+"extension its manifest identity and project-section contributions (ExtensionsInfo[]; backs listFormats and listExtensions).","Only .json documents open (backs listFormats); descriptor-contributed settings sections do not appear."),extensionCatalog:o("GET","/__studio/catalog","Extensions this backend can OFFER (ExtensionCatalogEntry[]) — the shipped first-party "+"catalogue plus any package in the project's own dependencies exporting a jx-extension.json, each marked with whether the host resolves it without a project install and whether the project has it installed. A capability rather than a constant: a Worker ships a fixed set "+"of extension packages (specs/extensions.md §5.5). Backs listExtensionCatalog.","The Extensions section offers no catalogue; adding an extension stays a typed package name."),projectSchemas:o("GET","/__studio/project-schemas","The project's generated entry documents (project.schema.json / document.schema.json), "+"PRE-BUNDLED into self-contained schemas — {project, document} (backs fetchProjectSchemas). "+"Regenerated on demand when missing or older than project.json.","The JSON editor falls back to the bundled core schemas (extension sections get no editor validation/completion)."),format:o("POST","/__studio/format","Dispatch a format capability {format, action: parse|serialize, source?|doc?}","Non-JSON documents cannot be parsed/serialized (backs formatAction)."),pluginSchema:o("GET","/__studio/plugin-schema","Extract a $studio schema from a class source","Plugin property panels fall back to generic JSON editing."),codeFormat:o("POST","/__studio/code/format","Format posted source {code, path?} → {code, errors}","Code editors skip format-on-open/save (codeService returns null)."),codeMinify:o("POST","/__studio/code/minify","Minify posted source {code} → {code}","Compiled-output minification is skipped."),codeLint:o("POST","/__studio/code/lint","Lint posted source {code, path?} → {diagnostics}","Code editors show no lint markers."),buildSite:o("POST","/__studio/build","Build or render the site → {routes, files, errors, mode?, url}","Build Site reports that this target cannot build."),previewSite:o("POST","/__studio/preview","Preview the working tree at a route → {routes, files, errors, mode, url, reused}","Open in Browser falls back to buildSite."),previewOverlay:o("POST","/__studio/preview/overlay","Publish (POST) or retract (DELETE) a document's unsaved bytes → 204","A live preview shows the last saved state instead of the editor's."),packages:o("GET","/__studio/packages","List dependencies (PackageInfo[])"),packagesAdd:o("POST","/__studio/packages/add","Add a registry dependency, writing package.json and package-lock.json together"),packagesRemove:o("POST","/__studio/packages/remove","Remove a dependency, writing package.json and package-lock.json together"),packagesInstall:o("POST","/__studio/packages/install","Install the declared dependencies (npm's installer, writing package-lock.json)","Install/reinstall affordances are hidden; add, remove and version updates still work where the backend serves them (a cloud session updates the lockfile without installing)."),packagesNeedsInstall:o("GET","/__studio/packages/needs-install","Whether node_modules is stale","The install-on-open prompt never shows."),packagesVersions:o("GET","/__studio/packages/versions","Newest published version of each dependency (PackageVersionInfo[])","The Latest column stays empty and the update affordances are hidden."),packagesSetVersions:o("POST","/__studio/packages/set-versions","Rewrite dependency ranges and install (lockfile-only where nothing installs)","Bulk version updates are hidden."),gitStatus:o("GET","/__studio/git/status","Working-tree status (GitStatusResult)"),gitBranches:o("GET","/__studio/git/branches","Branch list (GitBranchesResult)"),gitLog:o("GET","/__studio/git/log","Recent commits (GitLogEntry[])"),gitStage:o("POST","/__studio/git/stage","Stage files"),gitUnstage:o("POST","/__studio/git/unstage","Unstage files"),gitCommit:o("POST","/__studio/git/commit","Commit staged (else all dirty) files"),gitPush:o("POST","/__studio/git/push","Push (cloud: sync check — commits land on push)"),gitPull:o("POST","/__studio/git/pull","Pull/fast-forward; 409 {conflicts} on overlap"),gitFetch:o("POST","/__studio/git/fetch","Refresh remote tracking state"),gitCheckout:o("POST","/__studio/git/checkout","Switch branches"),gitCreateBranch:o("POST","/__studio/git/create-branch","Create a branch"),gitCommitBranch:o("POST","/__studio/git/commit-branch","Commit the change set as a NEW branch off the session's base, then take it out of this one "+"→ GitCommitBranchResult; 409 branch_exists","A publish the remote conflicts with reports the conflict alone, and Send for review stays refused on a branch whose every commit is live."),gitDiff:o("GET","/__studio/git/diff","Unified diff of dirty files (or one path)"),gitShow:o("GET","/__studio/git/show","File content at a ref"),gitDiscard:o("POST","/__studio/git/discard","Discard working changes"),gitInit:o("POST","/__studio/git/init","Initialize a repository"),gitAddRemote:o("POST","/__studio/git/add-remote","Add a remote"),gitClone:o("POST","/__studio/git/clone","Clone a repository","The welcome screen hides Clone Git Repository."),gitPr:o("POST","/__studio/git/pr","Open a pull request → PullRequestInfo","Studio falls back to a direct GitHub API call with the user's token."),dataConnections:o("GET","/__studio/data/connections","Connector connections with configured/missingSecrets/isDefault state, reachable table names, and registry-descriptor provider metadata (DataConnectionsResponse; backs dataConnections)","The connections settings section shows no status, and data-domain actions stay hidden."),dataConnectionTest:o("POST","/__studio/data/connections/test","Probe a connection {connection} → DataConnectionTestResult (backs dataConnectionTest)","The Test Connection action is hidden."),dataPush:o("POST","/__studio/data/push","Additive schema push {connection?, dryRun?} → DataPushResult (plan of DataPushStep[], "+"applied, warnings/errors; backs dataPush)","The Push Schema action is hidden; schemas deploy via `jx db push` instead."),dataRows:o("GET","/__studio/data/rows","Page a table (DataRowsQuery params) → DataRowsResult {rows, total, columns} (backs dataRows)","The data grid is unavailable."),dataInsertRow:o("POST","/__studio/data/rows","Insert a row {table, connection?, values} → {row} (backs dataInsertRow)","The data grid hides its add-row footer."),dataUpdateRow:o("PUT","/__studio/data/rows","Update a row keyed on its primary key {table, connection?, pk, set} → {row} (backs "+"dataUpdateRow)","Data grid cells are read-only."),dataDeleteRow:o("DELETE","/__studio/data/rows","Delete a row (?table=&pk=&connection=) → {ok} (backs dataDeleteRow)","The data grid hides row deletion."),secretsList:o("GET","/__studio/secrets","Configured secret env-var NAMES, never values (SecretsListResponse; backs listSecrets)","Secret fields cannot show set/unset state."),secretsSet:o("PUT","/__studio/secrets","Write/remove secrets in the backend store (.dev.vars locally) {set?, remove?} → names "+"(backs setSecrets)","The secret form control renders disabled; secrets are edited in .dev.vars by hand."),aiChat:o("POST","/__studio/ai/chat","StreamEvent SSE chat proxy {messages, tools, systemPrompt, model}"),aiModels:o("GET","/__studio/ai/models","Model catalogue (AiModelsResponse)"),cfProxy:o("POST","/__studio/cf/proxy","Allowlisted Cloudflare API passthrough {path, method?, body?} (backs cfApi)","The Publish panel explains the git-push publishing path instead.")};var o$=200,r$=100,s$=12;var Y=new Set(["reload","repeat","none"]);function Dp(e){if(!Array.isArray(e))return[];return e.flatMap((r)=>{if(!v(r))return[];let{href:i,id:s,label:u,primary:f}=r;if(!n(s)||!s||!n(u)||!u)return[];let g={id:s,label:u};if(n(i)&&i)g.href=i;if(f===!0)g.primary=!0;return[g]})}function q(e){return n(e)&&Y.has(e)}function a$(e){return q(e)?e:void 0}function ee(e){return e.replaceAll("_","-")}function S(e){if(!v(e))return{};let{actions:t,code:r,conflicts:i,heading:s,installUrl:u,retry:f,type:g}=e,a={},c=Vb(g)??(n(r)?ee(r):null);if(c!==null)a.code=c;if(n(u))a.installUrl=u;if(t!==void 0)a.actions=Dp(t);if(n(s)&&s)a.heading=s;if(q(f))a.retry=f;if(Array.isArray(i))a.conflicts=i.filter((m)=>n(m));return a}function vA(e){let t=S(e);return(t.code==="pull-conflict"||t.code==="conflict")&&t.conflicts?t.conflicts:null}function yA(e){let t=S(e);return t.code==="needs-installation-access"&&t.installUrl?t.installUrl:null}function wA(e){return S(e).code==="action-required"}function jd(){return Uo(pt.aiOpenAiKey)}function xA(e){xr(pt.aiOpenAiKey,e||"")}function dx(){return RA(pt.aiOpenAiKey)}function sl(){return Uo(pt.aiBaseUrl)}function ux(){return Uo(pt.aiModel)}function _A(e){xr(pt.aiModel,e||"")}function SA(e){NA([[pt.aiOpenAiKey,e.apiKey],[pt.aiBaseUrl,e.baseUrl],[pt.aiModel,e.model]])}function CA(e){return!Lm(pt.aiOpenAiKey,e.apiKey,jd())||!Lm(pt.aiBaseUrl,e.baseUrl,sl())||!Lm(pt.aiModel,e.model,ux())}function Lm(e,t,r){return fx(e,t)===fx(e,r)}function kA(){Ap([pt.aiOpenAiKey,pt.aiBaseUrl,pt.aiModel])}function lC(){return{apiKey:jd(),baseUrl:sl()}}function V(e){return`${e.apiKey}\x00${e.baseUrl}`}var h=null,P="",j=!1,A=!1,D="",M,I="",R=null,U=null,F=new Set,te=600000,_=0,J=!1;function ds(){h=null,P="",j=!1,A=!1,D="",M=void 0,I="",R=null,U=null,_=0}var ne=new Set([pt.aiOpenAiKey.key,pt.aiBaseUrl.key,pt.cfToken.key,pt.cfAccountId.key]);Np((e)=>{if(e.some((t)=>ne.has(t)))ds()});function l$(e){return h&&P===V(e)?h:null}function K(e){return h?.find((t)=>t.id===e)}function c$(e){return K(e)?.toolSupport}function EA(e){return K(e)?.contextWindow}function hx(e){if(e)F.add(e);U??=ah({force:!0}).catch(()=>{}).then(()=>{_=Date.now();for(let t of F)t()})}function oe(){if(!A||_===0||Date.now()-_<te)return!1;return U=null,_=0,hx(),!0}function re(){if(typeof window>"u"||J)return;J=!0,window.addEventListener("focus",()=>{oe()})}re();function Ub(){return dx()||cC()}function cC(){return j}function TA(){return A}function $m(){return M}function LA(){return I}function dC(){return R}function ie(){return D}function Kl(){return ux()||ie()||pt.aiModel.default}function se(e,t){let r;try{r=new URL(e,"http://jx.invalid")}catch{return e}return r.pathname=r.pathname.replace(/[^/]*$/,t),/^https?:/i.test(e)?r.href:`${r.pathname}${r.search}`}async function ah(e={}){let t=e.credentials??lC(),r=V(t);if(h&&P===r&&!e.force)return h;let i=p(),s=await Promise.resolve(i.aiChatUrl()),u=se(s,"models"),f={};if(t.apiKey)f["X-Api-Key"]=t.apiKey;if(t.baseUrl)f["X-Api-Base-URL"]=t.baseUrl;let g=await fetch(u,{headers:f});if(!g.ok)throw Error(`HTTP ${g.status}`);let a=await g.json();if(j=a.configured===!0,A=a.managed===!0,D=a.defaultModel??"",M=a.code,I=a.upstreamError!==void 0?a.upstreamMessage??"":"",R=null,a.code==="action_required"){let c={actions:Dp(a.actions)};if(n(a.detail)&&a.detail)c.detail=a.detail;R=c}return h=(a.models||[]).map((c)=>{let m={id:c.id,name:c.name||c.id};if(Z(c.contextWindow))m.contextWindow=c.contextWindow;if(Ze(c.toolSupport))m.toolSupport=c.toolSupport;return m}),P=r,h}var T=new Set,B=null;function $A(e){if(T.size===0){B=e;return}for(let t of T)t(e)}function H(e){T.add(e);let t=B;if(B=null,t)e(t);return()=>{T.delete(e)}}function uC(){return _e()&&Q(p().performAction)}function d$(e){let t=e.find((i)=>i.primary)??e[0];if(!t)return null;let r=e.find((i)=>i!==t);return r?{lead:t,other:r}:{lead:t}}var w=null,W=!1;function hC(e){let t=d$(e.actions);if(!uC()||!t)return Promise.resolve(!1);return w??=ae(e,t).finally(()=>{w=null}),w}async function Im(e){let t=S(e);if(t.code!=="action-required"||!t.actions?.length)return!1;return hC({actions:t.actions,detail:e instanceof Error?e.message:void 0,heading:t.heading,retry:t.retry})}async function z(){ds(),await Fd(),u$()}function ae(e,t){let r=e.detail??"This needs one more step first.";return new Promise((i)=>{let s="offer",u=(y)=>{if(s==="done")return;s="done",O.close(),i(y)},f=(y)=>{s="offer",O.update({cancelLabel:"Not now",confirmLabel:t.lead.label,message:y,secondaryLabel:t.other?.label??""})},g=async(y)=>{let b;try{b=await y}catch(x){if(s==="waiting")f(x instanceof Error?x.message:String(x));return}if(b?.status==="done"){await z(),u(!0);return}if(s!=="waiting"||!b||b.status==="redirect")return;Fd(),f(r)},a=(y)=>{if(s!=="offer")return;s="waiting";let b;try{b=p().performAction(y)}catch(x){f(x instanceof Error?x.message:String(x));return}O.update({cancelLabel:"Cancel",confirmLabel:"Waiting…",message:"Finish in the window that opened. This closes by itself once it is done.",secondaryLabel:""}),g(b)},{lead:c,other:m}=t,k={cancelLabel:"Not now",confirmLabel:c.label,headline:e.heading??"One more step",layer:tt("dialog"),message:r,onCancel:()=>{W=!0,u(!1)},onClosed:()=>{u(!1)},onConfirm:()=>{a(c)},region:"account/action"};if(m)k.onSecondary=()=>{a(m)},k.secondaryLabel=m.label;let O=Zs(k)})}function ce(e){if(e==="reload")location.reload();else if(e==="repeat")C.info("Done. Run that again now.",{key:"account.action.retry",source:"Account"})}function IA(){return H((e)=>{if(W||w)return;hC(e).then((t)=>{if(t)ce(e.retry)})})}async function px(e){if(!uC())return!1;let t=p().performAction(e),r;try{r=await t}catch(i){return C.error(i instanceof Error?i.message:String(i),{key:"account.action",source:"Account",tier:"toast"}),!1}if(r?.status==="done")return await z(),!0;if(r?.status!=="redirect")await Fd();return!1}function u$(){for(let e of N()){let t={key:`account.notice.${e.id}`,source:"Account"};if(e.level==="warning")C.warn(e.message,t);else C.info(e.message,t)}}
2
+ export{Fd,sC,aC,gA,bA,i$,Vb,nr,rl,o$,r$,s$,Dp,a$,vA,yA,wA,jd,xA,dx,sl,ux,_A,SA,CA,Lm,kA,lC,ds,l$,c$,EA,hx,Ub,cC,TA,$m,LA,dC,Kl,ah,$A,uC,d$,hC,Im,IA,px,u$};
3
3
 
4
- //# debugId=0296875224BA87A964756E2164756E21
5
- //# sourceMappingURL=studio-h7weqf2q.js.map
4
+ //# debugId=E6C3CC564CD5168C64756E2164756E21
5
+ //# sourceMappingURL=studio-8x8616xd.js.map
@@ -1,4 +1,4 @@
1
- import{pe}from"./studio-7xag4na8.js";var xe=pe(function(Tr){Object.defineProperty(Tr,"__esModule",{value:!0});Tr.regexpCode=Tr.getEsmExportName=Tr.getProperty=Tr.safeStringify=Tr.stringify=Tr.strConcat=Tr.addCodeArg=Tr.str=Tr._=Tr.nil=Tr._Code=Tr.Name=Tr.IDENTIFIER=Tr._CodeOrName=void 0;class Ke{}Tr._CodeOrName=Ke;Tr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class he extends Ke{constructor(e){super();if(!Tr.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Tr.Name=he;class U extends Ke{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof he)t[r.str]=(t[r.str]||0)+1;return t},{})}}Tr._Code=U;Tr.nil=new U("");function Nr(e,...t){let r=[e[0]],n=0;while(n<t.length)Nt(r,t[n]),r.push(e[++n]);return new U(r)}Tr._=Nr;var kt=new U("+");function qr(e,...t){let r=[Pe(e[0])],n=0;while(n<t.length)r.push(kt),Nt(r,t[n]),r.push(kt,Pe(e[++n]));return Wi(r),new U(r)}Tr.str=qr;function Nt(e,t){if(t instanceof U)e.push(...t._items);else if(t instanceof he)e.push(t);else e.push(Xi(t))}Tr.addCodeArg=Nt;function Wi(e){let t=1;while(t<e.length-1){if(e[t]===kt){let r=Qi(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function Qi(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof he||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof he))return`"${e}${t.slice(1)}`;return}function Zi(e,t){return t.emptyStr()?e:e.emptyStr()?t:qr`${e}${t}`}Tr.strConcat=Zi;function Xi(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Pe(Array.isArray(e)?e.join(","):e)}function Yi(e){return new U(Pe(e))}Tr.stringify=Yi;function Pe(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Tr.safeStringify=Pe;function ea(e){return typeof e=="string"&&Tr.IDENTIFIER.test(e)?new U(`.${e}`):Nr`[${e}]`}Tr.getProperty=ea;function ta(e){if(typeof e=="string"&&Tr.IDENTIFIER.test(e))return new U(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Tr.getEsmExportName=ta;function ra(e){return new U(e.toString())}Tr.regexpCode=ra});var jt=pe(function(Cr){Object.defineProperty(Cr,"__esModule",{value:!0});Cr.ValueScope=Cr.ValueScopeName=Cr.Scope=Cr.varKinds=Cr.UsedValueState=void 0;var C=xe();class jr extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Je;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Je||(Cr.UsedValueState=Je={}));Cr.varKinds={const:new C.Name("const"),let:new C.Name("let"),var:new C.Name("var")};class Tt{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof C.Name?e:this.name(e)}name(e){return new C.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Cr.Scope=Tt;class It extends C.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=C._`.${new C.Name(t)}[${r}]`}}Cr.ValueScopeName=It;var ma=C._`\n`;class Dr extends Tt{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ma:C.nil}}get(){return this._scope}name(e){return new It(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:o}=n,s=(r=t.key)!==null&&r!==void 0?r:t.ref,i=this._values[o];if(i){let d=i.get(s);if(d)return d}else i=this._values[o]=new Map;i.set(s,n);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:o,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return C._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let o=C.nil;for(let s in e){let i=e[s];if(!i)continue;let a=r[s]=r[s]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Je.Started);let d=t(c);if(d){let u=this.opts.es5?Cr.varKinds.var:Cr.varKinds.const;o=C._`${o}${u} ${c} = ${d};${this.opts._n}`}else if(d=n===null||n===void 0?void 0:n(c))o=C._`${o}${d}${this.opts._n}`;else throw new jr(c);a.set(c,Je.Completed)})}return o}}Cr.ValueScope=Dr});var zt=pe(function(A){Object.defineProperty(A,"__esModule",{value:!0});A.or=A.and=A.not=A.CodeGen=A.operators=A.varKinds=A.ValueScopeName=A.ValueScope=A.Scope=A.Name=A.regexpCode=A.stringify=A.getProperty=A.nil=A.strConcat=A.str=A._=void 0;var P=xe(),H=jt(),Y=xe();Object.defineProperty(A,"_",{enumerable:!0,get:function(){return Y._}});Object.defineProperty(A,"str",{enumerable:!0,get:function(){return Y.str}});Object.defineProperty(A,"strConcat",{enumerable:!0,get:function(){return Y.strConcat}});Object.defineProperty(A,"nil",{enumerable:!0,get:function(){return Y.nil}});Object.defineProperty(A,"getProperty",{enumerable:!0,get:function(){return Y.getProperty}});Object.defineProperty(A,"stringify",{enumerable:!0,get:function(){return Y.stringify}});Object.defineProperty(A,"regexpCode",{enumerable:!0,get:function(){return Y.regexpCode}});Object.defineProperty(A,"Name",{enumerable:!0,get:function(){return Y.Name}});var Ye=jt();Object.defineProperty(A,"Scope",{enumerable:!0,get:function(){return Ye.Scope}});Object.defineProperty(A,"ValueScope",{enumerable:!0,get:function(){return Ye.ValueScope}});Object.defineProperty(A,"ValueScopeName",{enumerable:!0,get:function(){return Ye.ValueScopeName}});Object.defineProperty(A,"varKinds",{enumerable:!0,get:function(){return Ye.varKinds}});A.operators={GT:new P._Code(">"),GTE:new P._Code(">="),LT:new P._Code("<"),LTE:new P._Code("<="),EQ:new P._Code("==="),NEQ:new P._Code("!=="),NOT:new P._Code("!"),OR:new P._Code("||"),AND:new P._Code("&&"),ADD:new P._Code("+")};class ee{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Mr extends ee{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?H.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=_e(this.rhs,e,t);return this}get names(){return this.rhs instanceof P._CodeOrName?this.rhs.names:{}}}class At extends ee{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof P.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=_e(this.rhs,e,t),this}get names(){let e=this.lhs instanceof P.Name?{}:{...this.lhs.names};return Xe(e,this.rhs)}}class Fr extends At{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Vr extends ee{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class zr extends ee{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Ur extends ee{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Hr extends ee{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=_e(this.code,e,t),this}get names(){return this.code instanceof P._CodeOrName?this.code.names:{}}}class et extends ee{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let o=r[n];if(o.optimizeNames(e,t))continue;$a(e,o.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>se(e,t.names),{})}}class te extends et{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Lr extends et{}class Oe extends te{}Oe.kind="else";class Q extends te{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Oe(r):r}if(t){if(e===!1)return t instanceof Q?t:t.nodes;if(this.nodes.length)return this;return new Q(Wr(e),t instanceof Q?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=_e(this.condition,e,t),this}get names(){let e=super.names;if(Xe(e,this.condition),this.else)se(e,this.else.names);return e}}Q.kind="if";class me extends te{}me.kind="for";class Kr extends me{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=_e(this.iteration,e,t),this}get names(){return se(super.names,this.iteration.names)}}class Gr extends me{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?H.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){let e=Xe(super.names,this.from);return Xe(e,this.to)}}class Dt extends me{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=_e(this.iterable,e,t),this}get names(){return se(super.names,this.iterable.names)}}class Be extends te{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Be.kind="func";class We extends et{render(e){return"return "+super.render(e)}}We.kind="return";class Jr extends te{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)se(e,this.catch.names);if(this.finally)se(e,this.finally.names);return e}}class Qe extends te{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Qe.kind="catch";class Ze extends te{render(e){return"finally"+super.render(e)}}Ze.kind="finally";class Br{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
1
+ import{pe}from"./studio-0g2sm01j.js";var xe=pe(function(Tr){Object.defineProperty(Tr,"__esModule",{value:!0});Tr.regexpCode=Tr.getEsmExportName=Tr.getProperty=Tr.safeStringify=Tr.stringify=Tr.strConcat=Tr.addCodeArg=Tr.str=Tr._=Tr.nil=Tr._Code=Tr.Name=Tr.IDENTIFIER=Tr._CodeOrName=void 0;class Ke{}Tr._CodeOrName=Ke;Tr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class he extends Ke{constructor(e){super();if(!Tr.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Tr.Name=he;class U extends Ke{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof he)t[r.str]=(t[r.str]||0)+1;return t},{})}}Tr._Code=U;Tr.nil=new U("");function Nr(e,...t){let r=[e[0]],n=0;while(n<t.length)Nt(r,t[n]),r.push(e[++n]);return new U(r)}Tr._=Nr;var kt=new U("+");function qr(e,...t){let r=[Pe(e[0])],n=0;while(n<t.length)r.push(kt),Nt(r,t[n]),r.push(kt,Pe(e[++n]));return Wi(r),new U(r)}Tr.str=qr;function Nt(e,t){if(t instanceof U)e.push(...t._items);else if(t instanceof he)e.push(t);else e.push(Xi(t))}Tr.addCodeArg=Nt;function Wi(e){let t=1;while(t<e.length-1){if(e[t]===kt){let r=Qi(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function Qi(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof he||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof he))return`"${e}${t.slice(1)}`;return}function Zi(e,t){return t.emptyStr()?e:e.emptyStr()?t:qr`${e}${t}`}Tr.strConcat=Zi;function Xi(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Pe(Array.isArray(e)?e.join(","):e)}function Yi(e){return new U(Pe(e))}Tr.stringify=Yi;function Pe(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Tr.safeStringify=Pe;function ea(e){return typeof e=="string"&&Tr.IDENTIFIER.test(e)?new U(`.${e}`):Nr`[${e}]`}Tr.getProperty=ea;function ta(e){if(typeof e=="string"&&Tr.IDENTIFIER.test(e))return new U(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Tr.getEsmExportName=ta;function ra(e){return new U(e.toString())}Tr.regexpCode=ra});var jt=pe(function(Cr){Object.defineProperty(Cr,"__esModule",{value:!0});Cr.ValueScope=Cr.ValueScopeName=Cr.Scope=Cr.varKinds=Cr.UsedValueState=void 0;var C=xe();class jr extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Je;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Je||(Cr.UsedValueState=Je={}));Cr.varKinds={const:new C.Name("const"),let:new C.Name("let"),var:new C.Name("var")};class Tt{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof C.Name?e:this.name(e)}name(e){return new C.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Cr.Scope=Tt;class It extends C.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=C._`.${new C.Name(t)}[${r}]`}}Cr.ValueScopeName=It;var ma=C._`\n`;class Dr extends Tt{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ma:C.nil}}get(){return this._scope}name(e){return new It(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:o}=n,s=(r=t.key)!==null&&r!==void 0?r:t.ref,i=this._values[o];if(i){let d=i.get(s);if(d)return d}else i=this._values[o]=new Map;i.set(s,n);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:o,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return C._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let o=C.nil;for(let s in e){let i=e[s];if(!i)continue;let a=r[s]=r[s]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Je.Started);let d=t(c);if(d){let u=this.opts.es5?Cr.varKinds.var:Cr.varKinds.const;o=C._`${o}${u} ${c} = ${d};${this.opts._n}`}else if(d=n===null||n===void 0?void 0:n(c))o=C._`${o}${d}${this.opts._n}`;else throw new jr(c);a.set(c,Je.Completed)})}return o}}Cr.ValueScope=Dr});var zt=pe(function(A){Object.defineProperty(A,"__esModule",{value:!0});A.or=A.and=A.not=A.CodeGen=A.operators=A.varKinds=A.ValueScopeName=A.ValueScope=A.Scope=A.Name=A.regexpCode=A.stringify=A.getProperty=A.nil=A.strConcat=A.str=A._=void 0;var P=xe(),H=jt(),Y=xe();Object.defineProperty(A,"_",{enumerable:!0,get:function(){return Y._}});Object.defineProperty(A,"str",{enumerable:!0,get:function(){return Y.str}});Object.defineProperty(A,"strConcat",{enumerable:!0,get:function(){return Y.strConcat}});Object.defineProperty(A,"nil",{enumerable:!0,get:function(){return Y.nil}});Object.defineProperty(A,"getProperty",{enumerable:!0,get:function(){return Y.getProperty}});Object.defineProperty(A,"stringify",{enumerable:!0,get:function(){return Y.stringify}});Object.defineProperty(A,"regexpCode",{enumerable:!0,get:function(){return Y.regexpCode}});Object.defineProperty(A,"Name",{enumerable:!0,get:function(){return Y.Name}});var Ye=jt();Object.defineProperty(A,"Scope",{enumerable:!0,get:function(){return Ye.Scope}});Object.defineProperty(A,"ValueScope",{enumerable:!0,get:function(){return Ye.ValueScope}});Object.defineProperty(A,"ValueScopeName",{enumerable:!0,get:function(){return Ye.ValueScopeName}});Object.defineProperty(A,"varKinds",{enumerable:!0,get:function(){return Ye.varKinds}});A.operators={GT:new P._Code(">"),GTE:new P._Code(">="),LT:new P._Code("<"),LTE:new P._Code("<="),EQ:new P._Code("==="),NEQ:new P._Code("!=="),NOT:new P._Code("!"),OR:new P._Code("||"),AND:new P._Code("&&"),ADD:new P._Code("+")};class ee{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Mr extends ee{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?H.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=_e(this.rhs,e,t);return this}get names(){return this.rhs instanceof P._CodeOrName?this.rhs.names:{}}}class At extends ee{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof P.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=_e(this.rhs,e,t),this}get names(){let e=this.lhs instanceof P.Name?{}:{...this.lhs.names};return Xe(e,this.rhs)}}class Fr extends At{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Vr extends ee{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class zr extends ee{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Ur extends ee{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Hr extends ee{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=_e(this.code,e,t),this}get names(){return this.code instanceof P._CodeOrName?this.code.names:{}}}class et extends ee{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let o=r[n];if(o.optimizeNames(e,t))continue;$a(e,o.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>se(e,t.names),{})}}class te extends et{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Lr extends et{}class Oe extends te{}Oe.kind="else";class Q extends te{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Oe(r):r}if(t){if(e===!1)return t instanceof Q?t:t.nodes;if(this.nodes.length)return this;return new Q(Wr(e),t instanceof Q?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=_e(this.condition,e,t),this}get names(){let e=super.names;if(Xe(e,this.condition),this.else)se(e,this.else.names);return e}}Q.kind="if";class me extends te{}me.kind="for";class Kr extends me{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=_e(this.iteration,e,t),this}get names(){return se(super.names,this.iteration.names)}}class Gr extends me{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?H.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){let e=Xe(super.names,this.from);return Xe(e,this.to)}}class Dt extends me{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=_e(this.iterable,e,t),this}get names(){return se(super.names,this.iterable.names)}}class Be extends te{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Be.kind="func";class We extends et{render(e){return"return "+super.render(e)}}We.kind="return";class Jr extends te{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)se(e,this.catch.names);if(this.finally)se(e,this.finally.names);return e}}class Qe extends te{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Qe.kind="catch";class Ze extends te{render(e){return"finally"+super.render(e)}}Ze.kind="finally";class Br{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
2
2
  `:""},this._extScope=e,this._scope=new H.Scope({parent:e}),this._nodes=[new Lr]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let o=this._scope.toName(t);if(r!==void 0&&n)this._constants[o.str]=r;return this._leafNode(new Mr(e,o,r)),o}const(e,t,r){return this._def(H.varKinds.const,e,t,r)}let(e,t,r){return this._def(H.varKinds.let,e,t,r)}var(e,t,r){return this._def(H.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new At(e,t,r))}add(e,t){return this._leafNode(new Fr(e,A.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==P.nil)this._leafNode(new Hr(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),P.addCodeArg(t,n)}return t.push("}"),new P._Code(t)}if(e,t,r){if(this._blockNode(new Q(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Q(e))}else(){return this._elseNode(new Oe)}endIf(){return this._endBlockNode(Q,Oe)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Kr(e),t)}forRange(e,t,r,n,o=this.opts.es5?H.varKinds.var:H.varKinds.let){let s=this._scope.toName(e);return this._for(new Gr(o,s,t,r),()=>n(s))}forOf(e,t,r,n=H.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=t instanceof P.Name?t:this.var("_arr",t);return this.forRange("_i",0,P._`${s}.length`,(i)=>{this.var(o,P._`${s}[${i}]`),r(o)})}return this._for(new Dt("of",n,o,t),()=>r(o))}forIn(e,t,r,n=this.opts.es5?H.varKinds.var:H.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,P._`Object.keys(${t})`,r);let o=this._scope.toName(e);return this._for(new Dt("in",n,o,t),()=>r(o))}endFor(){return this._endBlockNode(me)}label(e){return this._leafNode(new Vr(e))}break(e){return this._leafNode(new zr(e))}return(e){let t=new We;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(We)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new Jr;if(this._blockNode(n),this.code(e),t){let o=this.name("e");this._currNode=n.catch=new Qe(o),t(o)}if(r)this._currNode=n.finally=new Ze,this.code(r);return this._endBlockNode(Qe,Ze)}throw(e){return this._leafNode(new Ur(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=P.nil,r,n){if(this._blockNode(new Be(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Be)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Q))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}A.CodeGen=Br;function se(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Xe(e,t){return t instanceof P._CodeOrName?se(e,t.names):e}function _e(e,t,r){if(e instanceof P.Name)return n(e);if(!o(e))return e;return new P._Code(e._items.reduce((s,i)=>{if(i instanceof P.Name)i=n(i);if(i instanceof P._Code)s.push(...i._items);else s.push(i);return s},[]));function n(s){let i=r[s.str];if(i===void 0||t[s.str]!==1)return s;return delete t[s.str],i}function o(s){return s instanceof P._Code&&s._items.some((i)=>i instanceof P.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function $a(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Wr(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:P._`!${Ct(e)}`}A.not=Wr;var va=Qr(A.operators.AND);function wa(...e){return e.reduce(va)}A.and=wa;var Ea=Qr(A.operators.OR);function ba(...e){return e.reduce(Ea)}A.or=ba;function Qr(e){return(t,r)=>t===P.nil?r:r===P.nil?t:P._`${Ct(t)} ${e} ${Ct(r)}`}function Ct(e){return e instanceof P.Name?e:P._`(${e})`}});var yn=pe(function(sn){Object.defineProperty(sn,"__esModule",{value:!0});sn.checkStrictMode=sn.getErrorPath=sn.Type=sn.useFunc=sn.setEvaluated=sn.evaluatedPropsToName=sn.mergeEvaluated=sn.eachItem=sn.unescapeJsonPointer=sn.escapeJsonPointer=sn.escapeFragment=sn.unescapeFragment=sn.schemaRefOrVal=sn.schemaHasRulesButRef=sn.schemaHasRules=sn.checkUnknownRules=sn.alwaysValidSchema=sn.toHash=void 0;var R=zt(),Oa=xe();function Ra(e){let t={};for(let r of e)t[r]=!0;return t}sn.toHash=Ra;function ka(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return en(e,t),!tn(t,e.self.RULES.all)}sn.alwaysValidSchema=ka;function en(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let o=n.RULES.keywords;for(let s in t)if(!o[s])on(e,`unknown keyword: "${s}"`)}sn.checkUnknownRules=en;function tn(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}sn.schemaHasRules=tn;function Na(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}sn.schemaHasRulesButRef=Na;function qa({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return R._`${r}`}return R._`${e}${t}${R.getProperty(n)}`}sn.schemaRefOrVal=qa;function Ta(e){return rn(decodeURIComponent(e))}sn.unescapeFragment=Ta;function Ia(e){return encodeURIComponent(Ft(e))}sn.escapeFragment=Ia;function Ft(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}sn.escapeJsonPointer=Ft;function rn(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}sn.unescapeJsonPointer=rn;function ja(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}sn.eachItem=ja;function Xr({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof R.Name?(s instanceof R.Name?e(o,s,i):t(o,s,i),i):s instanceof R.Name?(t(o,i,s),s):r(s,i);return a===R.Name&&!(c instanceof R.Name)?n(o,c):c}}sn.mergeEvaluated={props:Xr({mergeNames:(e,t,r)=>e.if(R._`${r} !== true && ${t} !== undefined`,()=>{e.if(R._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,R._`${r} || {}`).code(R._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(R._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,R._`${r} || {}`),Vt(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:nn}),items:Xr({mergeNames:(e,t,r)=>e.if(R._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,R._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(R._`${r} !== true`,()=>e.assign(r,t===!0?!0:R._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function nn(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",R._`{}`);if(t!==void 0)Vt(e,r,t);return r}sn.evaluatedPropsToName=nn;function Vt(e,t,r){Object.keys(r).forEach((n)=>e.assign(R._`${t}${R.getProperty(n)}`,!0))}sn.setEvaluated=Vt;var Yr={};function Da(e,t){return e.scopeValue("func",{ref:t,code:Yr[t.code]||(Yr[t.code]=new Oa._Code(t.code))})}sn.useFunc=Da;var Mt;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Mt||(sn.Type=Mt={}));function Ca(e,t,r){if(e instanceof R.Name){let n=t===Mt.Num;return r?n?R._`"[" + ${e} + "]"`:R._`"['" + ${e} + "']"`:n?R._`"/" + ${e}`:R._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?R.getProperty(e).toString():"/"+Ft(e)}sn.getErrorPath=Ca;function on(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}sn.checkStrictMode=on});var Cc=pe(function(cn){Object.defineProperty(cn,"__esModule",{value:!0});var T=zt(),ec={data:new T.Name("data"),valCxt:new T.Name("valCxt"),instancePath:new T.Name("instancePath"),parentData:new T.Name("parentData"),parentDataProperty:new T.Name("parentDataProperty"),rootData:new T.Name("rootData"),dynamicAnchors:new T.Name("dynamicAnchors"),vErrors:new T.Name("vErrors"),errors:new T.Name("errors"),this:new T.Name("this"),self:new T.Name("self"),scope:new T.Name("scope"),json:new T.Name("json"),jsonPos:new T.Name("jsonPos"),jsonLen:new T.Name("jsonLen"),jsonPart:new T.Name("jsonPart")};cn.default=ec});var Re=pe(function(fn){Object.defineProperty(fn,"__esModule",{value:!0});fn.extendErrors=fn.resetErrorsCount=fn.reportExtraError=fn.reportError=fn.keyword$DataError=fn.keywordError=void 0;var x=zt(),rt=yn(),j=Cc();fn.keywordError={message:({keyword:e})=>x.str`must pass "${e}" keyword validation`};fn.keyword$DataError={message:({keyword:e,schemaType:t})=>t?x.str`"${e}" keyword must be ${t} ($data)`:x.str`"${e}" keyword is invalid ($data)`};function rc(e,t=fn.keywordError,r,n){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,c=ln(e,t,r);if(n!==null&&n!==void 0?n:i||a)dn(s,c);else un(o,x._`[${c}]`)}fn.reportError=rc;function nc(e,t=fn.keywordError,r){let{it:n}=e,{gen:o,compositeRule:s,allErrors:i}=n,a=ln(e,t,r);if(dn(o,a),!(s||i))un(n,j.default.vErrors)}fn.reportExtraError=nc;function oc(e,t){e.assign(j.default.errors,t),e.if(x._`${j.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(x._`${j.default.vErrors}.length`,t),()=>e.assign(j.default.vErrors,null)))}fn.resetErrorsCount=oc;function sc({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",o,j.default.errors,(a)=>{if(e.const(i,x._`${j.default.vErrors}[${a}]`),e.if(x._`${i}.instancePath === undefined`,()=>e.assign(x._`${i}.instancePath`,x.strConcat(j.default.instancePath,s.errorPath))),e.assign(x._`${i}.schemaPath`,x.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(x._`${i}.schema`,r),e.assign(x._`${i}.data`,n)})}fn.extendErrors=sc;function dn(e,t){let r=e.const("err",t);e.if(x._`${j.default.vErrors} === null`,()=>e.assign(j.default.vErrors,x._`[${r}]`),x._`${j.default.vErrors}.push(${r})`),e.code(x._`${j.default.errors}++`)}function un(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;if(o.$async)r.throw(x._`new ${e.ValidationError}(${t})`);else r.assign(x._`${n}.errors`,t),r.return(!1)}var ie={keyword:new x.Name("keyword"),schemaPath:new x.Name("schemaPath"),params:new x.Name("params"),propertyName:new x.Name("propertyName"),message:new x.Name("message"),schema:new x.Name("schema"),parentSchema:new x.Name("parentSchema")};function ln(e,t,r){let{createErrors:n}=e.it;if(n===!1)return x._`{}`;return ic(e,t,r)}function ic(e,t,r={}){let{gen:n,it:o}=e,s=[ac(o,r),cc(e,r)];return dc(e,t,s),n.object(...s)}function ac({errorPath:e},{instancePath:t}){let r=t?x.str`${e}${rt.getErrorPath(t,rt.Type.Str)}`:e;return[j.default.instancePath,x.strConcat(j.default.instancePath,r)]}function cc({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:x.str`${t}/${e}`;if(r)o=x.str`${o}${rt.getErrorPath(r,rt.Type.Str)}`;return[ie.schemaPath,o]}function dc(e,{params:t,message:r},n){let{keyword:o,data:s,schemaValue:i,it:a}=e,{opts:c,propertyName:d,topSchemaRef:u,schemaPath:l}=a;if(n.push([ie.keyword,o],[ie.params,typeof t=="function"?t(e):t||x._`{}`]),c.messages)n.push([ie.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([ie.schema,i],[ie.parentSchema,x._`${u}${l}`],[j.default.data,s]);if(d)n.push([ie.propertyName,d])}});var gn=pe(function(mn){Object.defineProperty(mn,"__esModule",{value:!0});mn.boolOrEmptySchema=mn.topBoolOrEmptySchema=void 0;var pc=Re(),mc=zt(),_c=Cc(),gc={message:"boolean schema is false"};function yc(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)pn(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(_c.default.data);else t.assign(mc._`${n}.errors`,null),t.return(!0)}mn.topBoolOrEmptySchema=yc;function $c(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),pn(e);else r.var(t,!0)}mn.boolOrEmptySchema=$c;function pn(e,t){let{gen:r,data:n}=e;pc.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},gc,void 0,t)}});var Ht=pe(function($n){Object.defineProperty($n,"__esModule",{value:!0});$n.getRules=$n.isJSONType=void 0;var wc=["string","number","integer","boolean","null","object","array"],Ec=new Set(wc);function bc(e){return typeof e=="string"&&Ec.has(e)}$n.isJSONType=bc;function Sc(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}$n.getRules=Sc});var Lt=pe(function(bn){Object.defineProperty(bn,"__esModule",{value:!0});bn.shouldUseRule=bn.shouldUseGroup=bn.schemaHasRulesForType=void 0;function xc({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&wn(e,n)}bn.schemaHasRulesForType=xc;function wn(e,t){return t.rules.some((r)=>En(e,r))}bn.shouldUseGroup=wn;function En(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}bn.shouldUseRule=En});var ke=pe(function(Rn){Object.defineProperty(Rn,"__esModule",{value:!0});Rn.reportTypeError=Rn.checkDataTypes=Rn.checkDataType=Rn.coerceAndCheckDataType=Rn.getJSONTypes=Rn.getSchemaTypes=Rn.DataType=void 0;var kc=Ht(),Nc=Lt(),qc=Re(),S=zt(),Pn=yn(),ge;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ge||(Rn.DataType=ge={}));function Tc(e){let t=xn(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}Rn.getSchemaTypes=Tc;function xn(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(kc.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Rn.getJSONTypes=xn;function Ic(e,t){let{gen:r,data:n,opts:o}=e,s=jc(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&Nc.schemaHasRulesForType(e,t[0]));if(i){let a=Gt(t,n,o.strictNumbers,ge.Wrong);r.if(a,()=>{if(s.length)Dc(e,t,s);else Jt(e)})}return i}Rn.coerceAndCheckDataType=Ic;var On=new Set(["string","number","integer","boolean","null"]);function jc(e,t){return t?e.filter((r)=>On.has(r)||t==="array"&&r==="array"):[]}function Dc(e,t,r){let{gen:n,data:o,opts:s}=e,i=n.let("dataType",S._`typeof ${o}`),a=n.let("coerced",S._`undefined`);if(s.coerceTypes==="array")n.if(S._`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,S._`${o}[0]`).assign(i,S._`typeof ${o}`).if(Gt(t,o,s.strictNumbers),()=>n.assign(a,o)));n.if(S._`${a} !== undefined`);for(let d of r)if(On.has(d)||d==="array"&&s.coerceTypes==="array")c(d);n.else(),Jt(e),n.endIf(),n.if(S._`${a} !== undefined`,()=>{n.assign(o,a),Ac(e,a)});function c(d){switch(d){case"string":n.elseIf(S._`${i} == "number" || ${i} == "boolean"`).assign(a,S._`"" + ${o}`).elseIf(S._`${o} === null`).assign(a,S._`""`);return;case"number":n.elseIf(S._`${i} == "boolean" || ${o} === null
3
3
  || (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,S._`+${o}`);return;case"integer":n.elseIf(S._`${i} === "boolean" || ${o} === null
4
4
  || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,S._`+${o}`);return;case"boolean":n.elseIf(S._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf(S._`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf(S._`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf(S._`${i} === "string" || ${i} === "number"
@@ -9,4 +9,4 @@ import{pe}from"./studio-7xag4na8.js";var xe=pe(function(Tr){Object.definePropert
9
9
  export{zt,yn,Cc,Ag,Cy,Og,Z0,ek,tk,nk,ik,ok,rk,sk,ak,lk};
10
10
 
11
11
  //# debugId=24481EE95B01662A64756E2164756E21
12
- //# sourceMappingURL=studio-hcsba201.js.map
12
+ //# sourceMappingURL=studio-9cp96v90.js.map