@stacksjs/stx 0.2.840 → 0.2.841

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 (81) hide show
  1. package/dist/{chunk-q1nj47gn.js → chunk-0kwpehta.js} +1 -1
  2. package/dist/chunk-1z5mj5m5.js +2 -0
  3. package/dist/{chunk-7m53tpxn.js → chunk-20rmh0be.js} +1 -1
  4. package/dist/{chunk-7y5gz0cs.js → chunk-2axvk5t9.js} +1 -1
  5. package/dist/{chunk-5pbxjx8s.js → chunk-30zf567p.js} +1 -1
  6. package/dist/{chunk-mh4kpnjr.js → chunk-32mf97nv.js} +1 -1
  7. package/dist/chunk-37ad1ewp.js +2 -0
  8. package/dist/{chunk-9razzga7.js → chunk-41s4jpkx.js} +2 -2
  9. package/dist/{chunk-xdzy4pm0.js → chunk-5xvxrnfh.js} +1 -1
  10. package/dist/{chunk-fpn5txnm.js → chunk-7hf37fqp.js} +1 -1
  11. package/dist/chunk-86dq5z6j.js +2 -0
  12. package/dist/{chunk-qcars8ar.js → chunk-8ye89bw9.js} +1 -1
  13. package/dist/{chunk-s2k1x2rn.js → chunk-amh7h4bq.js} +1 -1
  14. package/dist/{chunk-xqtt5t6d.js → chunk-aqvh8wx5.js} +4 -4
  15. package/dist/{chunk-kvpzxnww.js → chunk-axhg6nn9.js} +1 -1
  16. package/dist/{chunk-6n5kew7a.js → chunk-b85ss74r.js} +1 -1
  17. package/dist/{chunk-2knr61g3.js → chunk-bbza2wrb.js} +1 -1
  18. package/dist/chunk-bqb9neap.js +2 -0
  19. package/dist/{chunk-b685aqy4.js → chunk-c3gsnne5.js} +1 -1
  20. package/dist/chunk-cnqhbdsx.js +2 -0
  21. package/dist/chunk-d1b7h0n5.js +2 -0
  22. package/dist/{chunk-qzms4d8s.js → chunk-d5h2qak7.js} +1 -1
  23. package/dist/{chunk-b90xw7v4.js → chunk-d5ryynr2.js} +1 -1
  24. package/dist/{chunk-ecjx9z8a.js → chunk-d6z2v5k7.js} +1 -1
  25. package/dist/{chunk-3gzhh69y.js → chunk-dpmr4sym.js} +1 -1
  26. package/dist/{chunk-x42tsdbx.js → chunk-e8dnsaxj.js} +1 -1
  27. package/dist/{chunk-40bkdswh.js → chunk-eajm1dj6.js} +1 -1
  28. package/dist/{chunk-g6r2313a.js → chunk-edb768c0.js} +1 -1
  29. package/dist/{chunk-6nb07mdj.js → chunk-ep17rnxb.js} +1 -1
  30. package/dist/{chunk-2vprq4x0.js → chunk-eqfs73sa.js} +4 -4
  31. package/dist/{chunk-px5kda00.js → chunk-fhkdkpca.js} +2 -2
  32. package/dist/{chunk-ns0171xk.js → chunk-fp4291zm.js} +1 -1
  33. package/dist/{chunk-p65ax8s0.js → chunk-g7hd7eh0.js} +1 -1
  34. package/dist/{chunk-ebxz30e5.js → chunk-gw5bf8e7.js} +5 -5
  35. package/dist/{chunk-zrp4159x.js → chunk-hamc1fmd.js} +1 -1
  36. package/dist/{chunk-ywpan1k5.js → chunk-hn6yd2az.js} +1 -1
  37. package/dist/{chunk-b3fx75th.js → chunk-hnh12d0y.js} +1 -1
  38. package/dist/{chunk-4rswqcfc.js → chunk-hvd3hxs4.js} +1 -1
  39. package/dist/{chunk-rb17ssxh.js → chunk-j2vyhw8e.js} +1 -1
  40. package/dist/{chunk-vbw9jhz2.js → chunk-j2z7prcv.js} +6 -6
  41. package/dist/chunk-jap212a4.js +3 -0
  42. package/dist/{chunk-8gdtys3s.js → chunk-jten8e2c.js} +1 -1
  43. package/dist/{chunk-7dnp8evg.js → chunk-jxvxynnf.js} +3 -3
  44. package/dist/chunk-jxxyz9yp.js +2 -0
  45. package/dist/{chunk-azderqyk.js → chunk-k1jfzzqz.js} +4 -4
  46. package/dist/{chunk-vwddsdk5.js → chunk-kk66r2me.js} +2 -2
  47. package/dist/{chunk-c87zgwzn.js → chunk-m33na5j5.js} +1 -1
  48. package/dist/{chunk-57x8wxdf.js → chunk-mpc840yc.js} +4 -4
  49. package/dist/{chunk-xz2569ra.js → chunk-nfdaem8g.js} +1 -1
  50. package/dist/{chunk-chjdnmqv.js → chunk-qca4e1ms.js} +2 -2
  51. package/dist/chunk-rwx9aby2.js +2 -0
  52. package/dist/{chunk-88rwr1w2.js → chunk-rze2qphx.js} +1 -1
  53. package/dist/{chunk-ga8waz0a.js → chunk-v3ccft8t.js} +1 -1
  54. package/dist/{chunk-z9xjhc5m.js → chunk-vv71k945.js} +1 -1
  55. package/dist/{chunk-x0ygwk9x.js → chunk-vxzsspgc.js} +1 -1
  56. package/dist/{chunk-y8zzvzww.js → chunk-w2btre0d.js} +1 -1
  57. package/dist/{chunk-m7acbayx.js → chunk-wf2h75wp.js} +2 -2
  58. package/dist/{chunk-8d4br2j5.js → chunk-xjk5sxkz.js} +2 -2
  59. package/dist/{chunk-p2e02hh7.js → chunk-y0zhfyw4.js} +1 -1
  60. package/dist/{chunk-66eba1h4.js → chunk-y92nkb7x.js} +1 -1
  61. package/dist/chunk-ya7m4wgr.js +2 -0
  62. package/dist/{chunk-pqn7r8fw.js → chunk-ybmnf25a.js} +1 -1
  63. package/dist/{chunk-6efz68j8.js → chunk-yecjczcy.js} +1 -1
  64. package/dist/{chunk-znwc8gta.js → chunk-zay0083s.js} +1 -1
  65. package/dist/cli.js +7 -7
  66. package/dist/craft-entry.js +1 -1
  67. package/dist/craft.js +1 -1
  68. package/dist/native/testing.js +7 -1
  69. package/dist/pwa.js +1 -1
  70. package/dist/ssg.js +2 -2
  71. package/package.json +5 -5
  72. package/dist/chunk-03v59965.js +0 -2
  73. package/dist/chunk-5khpy4na.js +0 -2
  74. package/dist/chunk-a2p42cxf.js +0 -2
  75. package/dist/chunk-g957a2m3.js +0 -2
  76. package/dist/chunk-gbcwna5q.js +0 -2
  77. package/dist/chunk-jgx0ex9p.js +0 -3
  78. package/dist/chunk-ndah5rvs.js +0 -2
  79. package/dist/chunk-qb3c05qq.js +0 -2
  80. package/dist/chunk-spdh99jy.js +0 -2
  81. package/dist/chunk-vv7b8p5z.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{He,_n,Ks,_i,M}from"./chunk-8370x30n.js";import{kn}from"./chunk-p65ax8s0.js";import{Mr,k,fl,ct,Ii,gl}from"./chunk-23r3rby6.js";import{I}from"./chunk-zjqvbcwa.js";import{T,Xs,u,f,Ft,d,K,z,x,Zs,Ce,Ue,Qs}from"./chunk-89d3h8mp.js";import{s,me}from"./chunk-x4f7efgp.js";import{g}from"./chunk-0dve54ne.js";import{X}from"./chunk-7vhm0jj5.js";import it from"path";import Bt from"process";import{AsyncLocalStorage as sa}from"async_hooks";var Or=new sa;function bn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function jr(e,t){return Or.run(bn(e),t)}async function Dr(e,t){let i=Or.getStore();if(!i)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let n=i.pending.get(e);if(n)return n;let a=Promise.resolve().then(t).then((l)=>{let c=JSON.stringify(l,(v,E)=>{if(E===void 0||typeof E==="function"||typeof E==="symbol"||typeof E==="bigint"||typeof E==="number"&&!Number.isFinite(E))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(E&&typeof E==="object"&&!Array.isArray(E)&&Object.getPrototypeOf(E)!==Object.prototype&&Object.getPrototypeOf(E)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return E}),b=JSON.parse(c);return i.values.set(e,b),b}).catch((l)=>{throw i.pending.delete(e),l});return i.pending.set(e,a),a}function Er(e){let t=e.__stx_server_data;if(!t?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(t.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function V(e,t=!1){let i=s(e),n=[],a=new Set,l=0,c=0,b=i.length,v=()=>{if(l!==0)return;let E=i.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(t&&E[1]==="const")return;let P=E[2];if(!a.has(P))n.push(P),a.add(P);return}let A=i.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){if(t&&i.slice(c).startsWith("const"))return;A[1].split(",").forEach((P)=>{let B=P.trim();if(!B)return;let L=B.indexOf(":"),G=(L>=0?B.slice(L+1).trim():B).split(/[\s=]/)[0];if(G&&!a.has(G))n.push(G),a.add(G)});return}let j=i.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(t&&i.slice(c).startsWith("const"))return;j[1].split(",").forEach((P)=>{let B=P.trim().replace(/^\.\.\./,"");if(!B)return;let L=B.split(/[\s=]/)[0];if(L&&!a.has(L))n.push(L),a.add(L)});return}if(t)return;let F=i.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(F){let P=F[1];if(!a.has(P))n.push(P),a.add(P);return}let O=i.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let P=O[1];if(!a.has(P))n.push(P),a.add(P)}};while(c<b){if(i[c]==="{"){l++,c++;continue}if(i[c]==="}"){l--,c++;continue}if(l===0&&/[a-z]/i.test(i[c])&&(c===0||/\s|[;{}()]/.test(i[c-1])))v();c++}return n.join(", ")}function Os(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function ra(e,t=V(e).split(",").map((i)=>i.trim()).filter(Boolean)){let i=new Set(V(e,!0).split(",").map((n)=>n.trim()));return t.map((n)=>i.has(n)?`get ${n}() { return ${n} }, set ${n}(__stxValue_${n}) { ${n} = __stxValue_${n} }`:n).join(", ")}function Ns(e,t){let i=`{ ${ra(e,t)} }`;return V(e).split(",").some((n)=>n.trim()==="__stxLiveBindings")?`Object.defineProperties(${i}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:i}import Tt from"fs";import $e from"path";function U(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var Nr=new Map;function wr(e,t=!0){let i=Nr.get(e);if(t&&i)return i;let n=new Map,a=[$e.join(e,"src"),$e.join(e,"dist"),e];function l(c,b){if(b>6)return;let v;try{v=Tt.readdirSync(c,{withFileTypes:!0})}catch{return}for(let E of v){let A=$e.join(c,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(A,b+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let j=E.name.slice(0,-4);if(!n.has(j))n.set(j,A);let F=j.toLowerCase();if(!n.has(F))n.set(F,A);let O=U(j);if(!n.has(O))n.set(O,A)}}}for(let c of a)if(l(c,0),n.size>0)break;if(t)Nr.set(e,n);return n}function Ms(e,t){if(e.startsWith(".")||e.startsWith("/"))return null;let i=t;while(!0){let n=$e.join(i,"node_modules",e);try{if(Tt.statSync(n).isDirectory())return n}catch{}let a=$e.dirname(i);if(a===i)return null;i=a}}function Ds(e,t,i={}){return[$e.resolve($e.dirname(t),`${e}.stx`),$e.resolve($e.dirname(t),e),$e.resolve(i.componentsDir||"components",`${e}.stx`),$e.resolve(i.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function Lr(e){let t=e.endsWith(".stx")?e.slice(0,-4):e,i=t.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),n=U(t);return[t,i,n]}function ci(e,t){let[i,n,a]=Lr(e);for(let l of[i,i.toLowerCase(),n,a]){let c=t?.__importedComponents?.get(l);if(c!==void 0)return c}}function ia(e,t){let i=t?$e.resolve(t):void 0,n=$e.dirname($e.resolve(e));for(;;){if(Tt.existsSync($e.join(n,"package.json")))return i&&n===i?void 0:n;let a=$e.dirname(n);if(a===n)return;n=a}}var oa=["src/ui","src/components","components","dist"];function Dn(e,t){let i=$e.resolve(e);if(!t&&!i.split($e.sep).includes("node_modules"))return[];let n=ia(i,t);if(!n)return[];let a=[];try{let b=JSON.parse(Tt.readFileSync($e.join(n,"package.json"),"utf8")).stx?.components;if(Array.isArray(b))a=b.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:oa;return[$e.dirname($e.resolve(e)),...l.map((c)=>$e.resolve(n,c))]}function*li(e,t,i={},n){let a=Lr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield $e.resolve($e.dirname(t),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],c=i.projectRoot||process.cwd(),b=[...Dn(t,i.projectRoot),...n?.__originalFilePath?[$e.join($e.dirname(n.__originalFilePath),"components")]:[],...i.componentsDir?[i.componentsDir]:[],$e.join($e.dirname(t),"components"),$e.resolve(c,"src/components"),$e.resolve(c,"components"),...import.meta.dir?[$e.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(b)){for(let E of l)yield $e.join(v,E);try{for(let E of Tt.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let A of l)yield $e.join(v,E.name,A)}catch{}}}function zr(e,t,i={},n){let a=ci(e,n);if(a!==void 0)return a;for(let l of li(e,t,i,n))try{if(Tt.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ls(e,t=[],i={}){let n=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!n.has("src")&&!n.has("source")||!n.has("alt")&&!n.has("decorative"))return!1;let a=new Map(Object.entries(i).map(([E,A])=>[E.replace(/[-_]/g,"").toLowerCase(),A])),l=a.get("alt"),c=a.get("decorative"),b=typeof l==="string"&&!!l.trim(),v=typeof c==="string"?!["false","0","off","no"].includes(c.trim().toLowerCase()):Boolean(c);if(!b&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>n.has(E)))return!1;if([...t].some((E)=>!["load","error"].includes(E.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(n.has("resizemode")&&(n.has("fit")||n.has("objectfit")))return!1;if(n.has("src")&&n.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((E)=>n.has(E))}import ns from"fs";import ae from"path";import wt from"path";import en from"fs";var aa=new Set(["touchstart","touchmove","wheel","mousewheel"]);function hs(e,t){if(t.passive)return!0;if(t.prevent||t.nonpassive)return!1;return aa.has(e.toLowerCase())}var Br=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),Wr={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},ca=new Set(["ctrl","alt","shift","meta"]),Ur={left:0,middle:1,right:2};function Fr(e){let t={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let i of e){let n=i.toLowerCase();if(n==="prevent")t.prevent=!0;else if(n==="stop")t.stop=!0;else if(n==="once")t.once=!0;else if(n==="capture")t.capture=!0;else if(n==="self")t.self=!0;else if(n==="passive")t.passive=!0;else if(n==="nonpassive")t.nonpassive=!0;else if(ca.has(n))t.systemKeys.push(n);else if(n in Ur)t.mouse=n;else if(n in Wr||/^[a-z]$/.test(n))t.keys.push(Wr[n]||n.toUpperCase());else if(n.startsWith("debounce")){let a=n.match(/debounce(?:\.(\d+))?/);t.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(n.startsWith("throttle")){let a=n.match(/throttle(?:\.(\d+))?/);t.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return t}function Hr(e,t=""){let i=[],n=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[c,b,v]=l,E=l.index,A=E+c.length,j=`__stx_evt_${t}${n++}`,F=[],O=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,P;while((P=O.exec(v))!==null){let[,L,H]=P,G=L.split("."),D=G[0];if(!Br.has(D))continue;F.push({attribute:`@${L}`,event:D,handler:H,modifiers:Fr(G.slice(1)),elementId:j})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((P=B.exec(v))!==null){let[,L,H]=P,G=L.split("."),D=G[0];if(!Br.has(D))continue;F.push({attribute:`@${L}`,event:D,handler:H,modifiers:Fr(G.slice(1)),elementId:j})}if(F.length>0)i.push({originalTag:c,elementId:j,events:F,startIndex:E,endIndex:A})}return i}function la(e){let t=[],{modifiers:i}=e;if(i.self)t.push("if ($event.target !== $el) return");for(let n of i.systemKeys)t.push(`if (!$event.${n}Key) return`);if(i.keys.length>0){let n=i.keys.map((a)=>`$event.key === '${a}'`).join(" || ");t.push(`if (!(${n})) return`)}if(i.mouse!==null){let n=Ur[i.mouse];t.push(`if ($event.button !== ${n}) return`)}if(i.prevent)t.push("$event.preventDefault()");if(i.stop)t.push("$event.stopPropagation()");return t.join("; ")}function ua(e,t){let i=e;if(t.debounce!==null)i=`__stx_debounce(() => { ${i} }, ${t.debounce})`;else if(t.throttle!==null)i=`__stx_throttle(() => { ${i} }, ${t.throttle})`;return i}function xs(e){let t=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t))return e;return`if (typeof ${t} === 'function' && !${t}._isSignal) ${t}($event);`}function fa(e){let{modifiers:t}=e,i=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n=la(e),a=ua(xs(e.handler),t),l=[];if(t.once)l.push("once: true");if(t.capture)l.push("capture: true");if(hs(e.event,t))l.push("passive: true");let c=l.length>0?`, { ${l.join(", ")} }`:"",b=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
2
+ import{He,_n,Ks,_i,M}from"./chunk-8370x30n.js";import{kn}from"./chunk-g7hd7eh0.js";import{Mr,k,fl,ct,Ii,gl}from"./chunk-23r3rby6.js";import{I}from"./chunk-zjqvbcwa.js";import{T,Xs,u,f,Ft,d,K,z,x,Zs,Ce,Ue,Qs}from"./chunk-89d3h8mp.js";import{s,me}from"./chunk-x4f7efgp.js";import{g}from"./chunk-0dve54ne.js";import{X}from"./chunk-7vhm0jj5.js";import it from"path";import Bt from"process";import{AsyncLocalStorage as sa}from"async_hooks";var Or=new sa;function bn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function jr(e,t){return Or.run(bn(e),t)}async function Dr(e,t){let i=Or.getStore();if(!i)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let n=i.pending.get(e);if(n)return n;let a=Promise.resolve().then(t).then((l)=>{let c=JSON.stringify(l,(v,E)=>{if(E===void 0||typeof E==="function"||typeof E==="symbol"||typeof E==="bigint"||typeof E==="number"&&!Number.isFinite(E))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(E&&typeof E==="object"&&!Array.isArray(E)&&Object.getPrototypeOf(E)!==Object.prototype&&Object.getPrototypeOf(E)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return E}),b=JSON.parse(c);return i.values.set(e,b),b}).catch((l)=>{throw i.pending.delete(e),l});return i.pending.set(e,a),a}function Er(e){let t=e.__stx_server_data;if(!t?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(t.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function V(e,t=!1){let i=s(e),n=[],a=new Set,l=0,c=0,b=i.length,v=()=>{if(l!==0)return;let E=i.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(t&&E[1]==="const")return;let P=E[2];if(!a.has(P))n.push(P),a.add(P);return}let A=i.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){if(t&&i.slice(c).startsWith("const"))return;A[1].split(",").forEach((P)=>{let B=P.trim();if(!B)return;let L=B.indexOf(":"),G=(L>=0?B.slice(L+1).trim():B).split(/[\s=]/)[0];if(G&&!a.has(G))n.push(G),a.add(G)});return}let j=i.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(t&&i.slice(c).startsWith("const"))return;j[1].split(",").forEach((P)=>{let B=P.trim().replace(/^\.\.\./,"");if(!B)return;let L=B.split(/[\s=]/)[0];if(L&&!a.has(L))n.push(L),a.add(L)});return}if(t)return;let F=i.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(F){let P=F[1];if(!a.has(P))n.push(P),a.add(P);return}let O=i.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let P=O[1];if(!a.has(P))n.push(P),a.add(P)}};while(c<b){if(i[c]==="{"){l++,c++;continue}if(i[c]==="}"){l--,c++;continue}if(l===0&&/[a-z]/i.test(i[c])&&(c===0||/\s|[;{}()]/.test(i[c-1])))v();c++}return n.join(", ")}function Os(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function ra(e,t=V(e).split(",").map((i)=>i.trim()).filter(Boolean)){let i=new Set(V(e,!0).split(",").map((n)=>n.trim()));return t.map((n)=>i.has(n)?`get ${n}() { return ${n} }, set ${n}(__stxValue_${n}) { ${n} = __stxValue_${n} }`:n).join(", ")}function Ns(e,t){let i=`{ ${ra(e,t)} }`;return V(e).split(",").some((n)=>n.trim()==="__stxLiveBindings")?`Object.defineProperties(${i}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:i}import Tt from"fs";import $e from"path";function U(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var Nr=new Map;function wr(e,t=!0){let i=Nr.get(e);if(t&&i)return i;let n=new Map,a=[$e.join(e,"src"),$e.join(e,"dist"),e];function l(c,b){if(b>6)return;let v;try{v=Tt.readdirSync(c,{withFileTypes:!0})}catch{return}for(let E of v){let A=$e.join(c,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(A,b+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let j=E.name.slice(0,-4);if(!n.has(j))n.set(j,A);let F=j.toLowerCase();if(!n.has(F))n.set(F,A);let O=U(j);if(!n.has(O))n.set(O,A)}}}for(let c of a)if(l(c,0),n.size>0)break;if(t)Nr.set(e,n);return n}function Ms(e,t){if(e.startsWith(".")||e.startsWith("/"))return null;let i=t;while(!0){let n=$e.join(i,"node_modules",e);try{if(Tt.statSync(n).isDirectory())return n}catch{}let a=$e.dirname(i);if(a===i)return null;i=a}}function Ds(e,t,i={}){return[$e.resolve($e.dirname(t),`${e}.stx`),$e.resolve($e.dirname(t),e),$e.resolve(i.componentsDir||"components",`${e}.stx`),$e.resolve(i.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function Lr(e){let t=e.endsWith(".stx")?e.slice(0,-4):e,i=t.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),n=U(t);return[t,i,n]}function ci(e,t){let[i,n,a]=Lr(e);for(let l of[i,i.toLowerCase(),n,a]){let c=t?.__importedComponents?.get(l);if(c!==void 0)return c}}function ia(e,t){let i=t?$e.resolve(t):void 0,n=$e.dirname($e.resolve(e));for(;;){if(Tt.existsSync($e.join(n,"package.json")))return i&&n===i?void 0:n;let a=$e.dirname(n);if(a===n)return;n=a}}var oa=["src/ui","src/components","components","dist"];function Dn(e,t){let i=$e.resolve(e);if(!t&&!i.split($e.sep).includes("node_modules"))return[];let n=ia(i,t);if(!n)return[];let a=[];try{let b=JSON.parse(Tt.readFileSync($e.join(n,"package.json"),"utf8")).stx?.components;if(Array.isArray(b))a=b.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:oa;return[$e.dirname($e.resolve(e)),...l.map((c)=>$e.resolve(n,c))]}function*li(e,t,i={},n){let a=Lr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield $e.resolve($e.dirname(t),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],c=i.projectRoot||process.cwd(),b=[...Dn(t,i.projectRoot),...n?.__originalFilePath?[$e.join($e.dirname(n.__originalFilePath),"components")]:[],...i.componentsDir?[i.componentsDir]:[],$e.join($e.dirname(t),"components"),$e.resolve(c,"src/components"),$e.resolve(c,"components"),...import.meta.dir?[$e.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(b)){for(let E of l)yield $e.join(v,E);try{for(let E of Tt.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let A of l)yield $e.join(v,E.name,A)}catch{}}}function zr(e,t,i={},n){let a=ci(e,n);if(a!==void 0)return a;for(let l of li(e,t,i,n))try{if(Tt.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ls(e,t=[],i={}){let n=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!n.has("src")&&!n.has("source")||!n.has("alt")&&!n.has("decorative"))return!1;let a=new Map(Object.entries(i).map(([E,A])=>[E.replace(/[-_]/g,"").toLowerCase(),A])),l=a.get("alt"),c=a.get("decorative"),b=typeof l==="string"&&!!l.trim(),v=typeof c==="string"?!["false","0","off","no"].includes(c.trim().toLowerCase()):Boolean(c);if(!b&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>n.has(E)))return!1;if([...t].some((E)=>!["load","error"].includes(E.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(n.has("resizemode")&&(n.has("fit")||n.has("objectfit")))return!1;if(n.has("src")&&n.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((E)=>n.has(E))}import ns from"fs";import ae from"path";import wt from"path";import en from"fs";var aa=new Set(["touchstart","touchmove","wheel","mousewheel"]);function hs(e,t){if(t.passive)return!0;if(t.prevent||t.nonpassive)return!1;return aa.has(e.toLowerCase())}var Br=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),Wr={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},ca=new Set(["ctrl","alt","shift","meta"]),Ur={left:0,middle:1,right:2};function Fr(e){let t={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let i of e){let n=i.toLowerCase();if(n==="prevent")t.prevent=!0;else if(n==="stop")t.stop=!0;else if(n==="once")t.once=!0;else if(n==="capture")t.capture=!0;else if(n==="self")t.self=!0;else if(n==="passive")t.passive=!0;else if(n==="nonpassive")t.nonpassive=!0;else if(ca.has(n))t.systemKeys.push(n);else if(n in Ur)t.mouse=n;else if(n in Wr||/^[a-z]$/.test(n))t.keys.push(Wr[n]||n.toUpperCase());else if(n.startsWith("debounce")){let a=n.match(/debounce(?:\.(\d+))?/);t.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(n.startsWith("throttle")){let a=n.match(/throttle(?:\.(\d+))?/);t.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return t}function Hr(e,t=""){let i=[],n=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[c,b,v]=l,E=l.index,A=E+c.length,j=`__stx_evt_${t}${n++}`,F=[],O=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,P;while((P=O.exec(v))!==null){let[,L,H]=P,G=L.split("."),D=G[0];if(!Br.has(D))continue;F.push({attribute:`@${L}`,event:D,handler:H,modifiers:Fr(G.slice(1)),elementId:j})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((P=B.exec(v))!==null){let[,L,H]=P,G=L.split("."),D=G[0];if(!Br.has(D))continue;F.push({attribute:`@${L}`,event:D,handler:H,modifiers:Fr(G.slice(1)),elementId:j})}if(F.length>0)i.push({originalTag:c,elementId:j,events:F,startIndex:E,endIndex:A})}return i}function la(e){let t=[],{modifiers:i}=e;if(i.self)t.push("if ($event.target !== $el) return");for(let n of i.systemKeys)t.push(`if (!$event.${n}Key) return`);if(i.keys.length>0){let n=i.keys.map((a)=>`$event.key === '${a}'`).join(" || ");t.push(`if (!(${n})) return`)}if(i.mouse!==null){let n=Ur[i.mouse];t.push(`if ($event.button !== ${n}) return`)}if(i.prevent)t.push("$event.preventDefault()");if(i.stop)t.push("$event.stopPropagation()");return t.join("; ")}function ua(e,t){let i=e;if(t.debounce!==null)i=`__stx_debounce(() => { ${i} }, ${t.debounce})`;else if(t.throttle!==null)i=`__stx_throttle(() => { ${i} }, ${t.throttle})`;return i}function xs(e){let t=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t))return e;return`if (typeof ${t} === 'function' && !${t}._isSignal) ${t}($event);`}function fa(e){let{modifiers:t}=e,i=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n=la(e),a=ua(xs(e.handler),t),l=[];if(t.once)l.push("once: true");if(t.capture)l.push("capture: true");if(hs(e.event,t))l.push("passive: true");let c=l.length>0?`, { ${l.join(", ")} }`:"",b=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${i}');
5
5
  if (!$el) return;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function pa(e,t=""){let i=Hr(e,t);if(i.length===0)return{template:e,bindings:[]};let n=e,a=[];for(let l=i.length-1;l>=0;l--){let c=i[l],b=c.originalTag;if(!b.includes(" id="))b=b.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${c.elementId}"`);else{let v=b.match(/id=["']([^"']+)["']/);if(v)for(let E of c.events)E.elementId=v[1]}for(let v of c.events){let E=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(`\\s*${E}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${E}\\s*=\\s*'[^']*'`,"g");b=b.replace(A,""),b=b.replace(j,"")}n=n.slice(0,c.startIndex)+b+n.slice(c.endIndex),a.push(...c.events)}return{template:n,bindings:a}}function Vr(e){let t=e.$uid;return typeof t==="string"&&t?`${t}_`:""}function Pc(e,t,i){if(gl(e))return e;if(t.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:b,bindings:v}=pa(e,Vr(t)),E=t.__stx_event_bindings||[];return t.__stx_event_bindings=[...E,...v],b}let n=Hr(e,Vr(t));if(n.length===0)return e;let a=e;for(let b=n.length-1;b>=0;b--){let v=n[b],E=v.originalTag;if(!E.includes(" id="))E=E.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let A=E.match(/id=["']([^"']+)["']/);if(A)for(let j of v.events)j.elementId=A[1]}for(let A of v.events){let j=A.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),F=new RegExp(`\\s*${j}\\s*=\\s*"[^"]*"`,"g"),O=new RegExp(`\\s*${j}\\s*=\\s*'[^']*'`,"g");E=E.replace(F,""),E=E.replace(O,"")}a=a.slice(0,v.startIndex)+E+a.slice(v.endIndex)}let l=ui(n.flatMap((b)=>b.events)),c=a.lastIndexOf("</body>");if(c!==-1)a=a.slice(0,c)+l+`
115
- `+a.slice(c);else a+=l;return a}function qr(e,t){let i=new Set;for(let n of e.split(",")){let a=n.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(t){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))i.add(a)}return i}function At(e,t){let i=s(e),{depths:n,balanced:a}=me(i),l=(b)=>!a||n[b]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${t}\\b)`,"g");for(let b of i.matchAll(c)){let v=(b.index??0)+b[0].length-b[1].length;if(l(v))return!0}for(let b of i.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(b.index??0)&&qr(b[1],!0).has(t))return!0;for(let b of i.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(b.index??0)&&qr(b[1],!1).has(t))return!0;return!1}var Zr=new T(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4}),xt=/^[A-Za-z_$][\w$]*$/,da=new Set(["if","for","while","switch","with"]),Kr=["(","[","{"],Xr=[")","]","}"],ga=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function ma(e){let t=s(e),i=[];for(let n of t.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=n.index??0;i.push({text:n[0],start:a,end:a+n[0].length})}return{code:t,tokens:i}}function bs(e){let t=Zr.get(e);if(t)return t;let{code:i,tokens:n}=ma(e),a=new Map,l=[];for(let L=0;L<n.length;L++){let H=n[L].text;if(["(","[","{"].includes(H))l.push(L);else if([")","]","}"].includes(H)){let G=l.at(-1);if(G!==void 0&&["()","[]","{}"].includes(n[G].text+H))l.pop(),a.set(G,L),a.set(L,G)}}function c(L,H){let G=[],D=L;for(let ee=L;ee<H;ee++){if(["(","[","{"].includes(n[ee].text)&&(a.get(ee)??H)<H){ee=a.get(ee);continue}if(n[ee].text===",")G.push([D,ee]),D=ee+1}return G.push([D,H]),G}let b=[];function v(L,H,G,D=!1){if(n[L]?.text==="...")L++;if(L>=H)return;let ee=n[L].text;if(xt.test(ee)){if(G.add(ee),G===j)b.push({name:ee,token:L,functionScoped:D});return}if(ee!=="{"&&ee!=="[")return;let ne=a.get(L);if(ne===void 0||ne>=H)return;for(let[te,le]of c(L+1,ne)){let be=te;if(ee==="{")for(let ue=te;ue<le;ue++){if(n[ue].text===":"){be=ue+1;break}if(n[ue].text==="=")break;if(["(","[","{"].includes(n[ue].text)&&a.has(ue))ue=a.get(ue)}v(be,le,G,D)}}function E(L,H){let G=new Set;for(let[D,ee]of c(L,H))v(D,ee,G);return G}function A(L){let H=L;for(;H<n.length;H++){let G=n[H].text;if(["(","[","{"].includes(G)&&a.has(H)){H=a.get(H);continue}if([",",";",")","]","}"].includes(G))break}return n[Math.max(L,H-1)]?.end??i.length}let j=new Set,F=[];for(let L=0;L<n.length;L++)if(n[L].text==="=>"){let H=L-1,G=H,D;if(n[H]?.text===")"&&a.has(H))G=a.get(H),D=E(G+1,H);else if(n[H]&&xt.test(n[H].text))D=new Set([n[H].text]);else continue;let ee=L+1,ne=n[ee]?.text==="{"&&a.has(ee)?n[a.get(ee)].end:A(ee);F.push({start:n[G].start,end:ne,bodyStart:n[ee]?.start??ne,functionBody:!0,names:D})}else if(n[L].text==="("&&a.has(L)){let H=n[L-1]?.text;if(!H||da.has(H)||!xt.test(H)&&H!=="*"&&H!=="]")continue;let G=a.get(L),D=G+1;if(n[D]?.text===":"){D++;while(D<n.length&&!["{","=>",";","="].includes(n[D].text))D++}if(n[D]?.text!=="{"||!a.has(D))continue;F.push({start:n[L].start,end:n[a.get(D)].end,bodyStart:n[D].start,functionBody:H!=="catch",names:E(L+1,G)})}function O(L){let H=L;for(;H<n.length;H++){let G=n[H].text;if(Kr.includes(G)&&a.has(H)){H=a.get(H);continue}if(G===";"||Xr.includes(G))break;let D=n[H-1];if(H>L&&ga.has(G)&&D.text!==".")break;if(H>L&&/[\n\r]/.test(i.slice(D.end,n[H].start))&&(/^[\w$]+$/.test(D.text)||Xr.includes(D.text)||['"',"'","`"].includes(D.text))&&xt.test(G)&&!["in","of","instanceof"].includes(G))break}return H}let P=[];for(let L=0;L<n.length;L++){if(n[L].text!=="for")continue;let H=n[L+1]?.text==="await"?L+2:L+1;if(n[H]?.text!=="("||!a.has(H))continue;let G=a.get(H),D=G+1,ee=n[D]?.text==="{"&&a.has(D)?a.get(D):O(D),ne=n[ee]?.text===";"||n[ee]?.text==="}"?n[ee].end:n[Math.max(D,ee-1)]?.end??i.length;P.push({headStart:H,headEnd:G,start:n[H].start,end:ne})}for(let L=0;L<n.length;L++){let H=n[L].text,G=n[L-1]?.text;if(G==="."||n[L+1]?.text===":")continue;if(G==="as"||G==="<")continue;if(H==="const"||H==="let"||H==="var"){let D=O(L+1),ee=L+1,ne=!1,te=!1,le=0;for(let be=L+1;be<=D;be++){let ue=n[be]?.text;if(be<D&&Kr.includes(ue)&&a.has(be)&&a.get(be)<D){be=a.get(be);continue}if(be<D&&ue===":"&&!te)ne=!0;else if(be<D&&ue==="="&&le===0)ne=!1,te=!0;else if(be<D&&ne&&ue==="<")le++;else if(be<D&&ne&&ue===">"&&le>0)le--;else if(be===D||ue===","&&le===0)v(ee,be,j,H==="var"),ee=be+1,ne=!1,te=!1}}else if(H==="function"||H==="class"){let D=L+1;if(n[D]?.text==="*")D++;if(n[D]&&xt.test(n[D].text)&&n[D].text!=="extends")j.add(n[D].text),b.push({name:n[D].text,token:D})}else if(H==="import"){let D=L+1;if(n[D]?.text==="*"&&n[D+1]?.text==="as")D+=2;let ee=n[D]?.text;if(ee&&xt.test(ee)&&ee!=="type"&&n[D+1]?.text!=="("&&n[D+1]?.text!==".")j.add(ee),b.push({name:ee,token:D,file:!0});let ne=n[D]?.text==="{"?D:n[D+1]?.text===","&&n[D+2]?.text==="{"?D+2:-1;if(ne!==-1&&a.has(ne)){let te=a.get(ne);for(let[le,be]of c(ne+1,te)){let ue=be-1;while(ue>=le&&!xt.test(n[ue].text))ue--;if(ue>=le&&n[ue].text!=="type")b.push({name:n[ue].text,token:ue,file:!0})}}}}let B={code:i,scopes:F,loops:P,declarations:j,sites:b,tokens:n,pairs:a};return Zr.set(e,B),B}function Qt(e){let t=bs(e);return{code:t.code,shadows:(i,n)=>t.scopes.some((a)=>n>=a.start&&n<a.end&&a.names.has(i))}}function Nn(e){return new Set(bs(e).declarations)}function Oe(e,t){let{scopes:i,loops:n,sites:a,tokens:l,pairs:c}=bs(e),b=Array.from({length:l.length},()=>-1),v=[];for(let O=0;O<l.length;O++){b[O]=v.length?v[v.length-1]:-1;let P=l[O].text;if(P==="{"&&c.has(O))v.push(O);else if(P==="}"&&v.length&&c.get(O)===v[v.length-1])v.pop()}let E=new Set,A=new Map;for(let O of a){if(!t.has(O.name))continue;E.add(O.token);let P=O.file?-1:b[O.token],B=P===-1?[0,Number.POSITIVE_INFINITY]:[l[P].start,l[c.get(P)].end];if(O.functionScoped){let H=l[O.token].start,G=i.filter((D)=>D.functionBody&&H>=D.bodyStart&&H<D.end).sort((D,ee)=>D.end-D.bodyStart-(ee.end-ee.bodyStart))[0];B=G?[G.bodyStart,G.end]:[0,Number.POSITIVE_INFINITY]}else if(!O.file){let H=n.filter((G)=>O.token>G.headStart&&O.token<G.headEnd).sort((G,D)=>G.headEnd-G.headStart-(D.headEnd-D.headStart))[0];if(H)B=[H.start,H.end]}let L=A.get(O.name);if(L)L.push(B);else A.set(O.name,[B])}let j=new Set;for(let O=0;O<l.length;O++){if(l[O].text!=="import"||l[O-1]?.text===".")continue;let P=O+1;if(l[P]?.text==="type")P++;if(l[P]&&xt.test(l[P].text)&&l[P+1]?.text===",")P+=2;if(l[P]?.text==="{"&&c.has(P))for(let B=P+1;B<c.get(P);B++)j.add(B)}let F=new Set;for(let O=0;O<l.length;O++){let P=l[O].text;if(!t.has(P)||F.has(P)||E.has(O)||j.has(O))continue;let B=l[O-1]?.text;if(B==="#"||B==="."&&l[O-2]?.text!=="..")continue;if(l[O+1]?.text===":"&&(B==="{"||B===","))continue;let L=l[O].start;if(A.get(P)?.some(([H,G])=>L>=H&&L<G))continue;if(i.some((H)=>L>=H.start&&L<H.end&&H.names.has(P)))continue;F.add(P)}return F}var Ie="0.2.840";var Jr=Symbol.for(`stx.lazy-module-promises.${Ie}`);function xa(){let e=globalThis;return e[Jr]??=new Map,e[Jr]}function o(e,t){let i=xa(),n=`${import.meta.url}\x00${e}`,a=i.get(n);if(a)return a;let l=t();return i.set(n,l),l.catch(()=>{if(i.get(n)===l)i.delete(n)}),l}var ba=/<\/(script)/gi;function fn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(ba,"<\\/$1")}import Gr from"fs";var Yr=[];function w(e){let t=new T(e);return Yr.push(t),t}function Ic(){for(let e of Yr)e.clear()}function S(e,...t){return`${t.map((i)=>String(i??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function vr(e){let t=[];for(let i of new Set(e))try{t.push({path:i,mtimeMs:Gr.statSync(i).mtimeMs})}catch{}return t}function js(e){for(let t of e)try{if(Gr.statSync(t.path).mtimeMs!==t.mtimeMs)return!1}catch{return!1}return!0}var Se=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var ya=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function _a(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let i=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}let t=e.match(/^([^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}function wa(e,t){let i=t;while(!0){let n=wt.join(i,"node_modules",e,"package.json");if(en.existsSync(n))return wt.dirname(n);let a=wt.dirname(i);if(a===i)return null;i=a}}function Sa(e,t){if(!e||typeof e!=="object")return null;let i=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return i(a.import);if(typeof a.default==="object")return i(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,t))return i(e[t]);let n=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let c=a.slice(0,l),b=a.slice(l+1);if(!t.startsWith(c)||!t.endsWith(b))continue;if(t.length<c.length+b.length)continue;if(!n||c.length>n.prefix.length)n={pattern:a,prefix:c,suffix:b}}if(n){let a=t.slice(n.prefix.length,t.length-n.suffix.length),l=i(e[n.pattern]);if(l)return l.replace("*",a)}return null}function $a(e,t){let i=_a(e);if(!i||!i.subpath)return null;let n=wa(i.pkg,t);if(!n)return null;let a;try{a=JSON.parse(en.readFileSync(wt.join(n,"package.json"),"utf8"))}catch{return null}let l=`.${i.subpath}`,c=Sa(a.exports,l);if(!c)return null;let b=wt.resolve(n,c);return en.existsSync(b)?b:null}function bi(e,t){let i=t.filePath?wt.dirname(t.filePath):t.projectRoot||process.cwd(),n=t.projectRoot||process.cwd(),a=new Set,l=[],c=[];return{code:e.replace(ya,(v,E)=>{let A;try{if(E.startsWith("./")||E.startsWith("../")||E.startsWith("/")){if(A=E.startsWith("/")?E:wt.resolve(i,E),!en.existsSync(A))throw Error(`file not found: ${A}`)}else{let j=null;try{j=Bun.resolveSync(E,n)}catch{j=$a(E,n)}if(!j)throw Error(`could not resolve ${E} (Bun.resolveSync + exports fallback both failed)`);A=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(E)} (from ${t.filePath||"<unknown>"}): ${j?.message||j}`),c.push(E),""}if(a.has(A))return"";a.add(A);try{let j=en.readFileSync(A,"utf8");l.push({source:E,resolvedPath:A,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${A}: ${j?.message||j}`),c.push(E)}return""}),styles:l,unresolved:c}}function va(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wi(e){if(e.length===0)return"";return`${e.map((t)=>`<style data-stx-vendor="${va(t.source)}" data-stx-layer="vendor">
115
+ `+a.slice(c);else a+=l;return a}function qr(e,t){let i=new Set;for(let n of e.split(",")){let a=n.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(t){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))i.add(a)}return i}function At(e,t){let i=s(e),{depths:n,balanced:a}=me(i),l=(b)=>!a||n[b]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${t}\\b)`,"g");for(let b of i.matchAll(c)){let v=(b.index??0)+b[0].length-b[1].length;if(l(v))return!0}for(let b of i.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(b.index??0)&&qr(b[1],!0).has(t))return!0;for(let b of i.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(b.index??0)&&qr(b[1],!1).has(t))return!0;return!1}var Zr=new T(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4}),xt=/^[A-Za-z_$][\w$]*$/,da=new Set(["if","for","while","switch","with"]),Kr=["(","[","{"],Xr=[")","]","}"],ga=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function ma(e){let t=s(e),i=[];for(let n of t.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=n.index??0;i.push({text:n[0],start:a,end:a+n[0].length})}return{code:t,tokens:i}}function bs(e){let t=Zr.get(e);if(t)return t;let{code:i,tokens:n}=ma(e),a=new Map,l=[];for(let L=0;L<n.length;L++){let H=n[L].text;if(["(","[","{"].includes(H))l.push(L);else if([")","]","}"].includes(H)){let G=l.at(-1);if(G!==void 0&&["()","[]","{}"].includes(n[G].text+H))l.pop(),a.set(G,L),a.set(L,G)}}function c(L,H){let G=[],D=L;for(let ee=L;ee<H;ee++){if(["(","[","{"].includes(n[ee].text)&&(a.get(ee)??H)<H){ee=a.get(ee);continue}if(n[ee].text===",")G.push([D,ee]),D=ee+1}return G.push([D,H]),G}let b=[];function v(L,H,G,D=!1){if(n[L]?.text==="...")L++;if(L>=H)return;let ee=n[L].text;if(xt.test(ee)){if(G.add(ee),G===j)b.push({name:ee,token:L,functionScoped:D});return}if(ee!=="{"&&ee!=="[")return;let ne=a.get(L);if(ne===void 0||ne>=H)return;for(let[te,le]of c(L+1,ne)){let be=te;if(ee==="{")for(let ue=te;ue<le;ue++){if(n[ue].text===":"){be=ue+1;break}if(n[ue].text==="=")break;if(["(","[","{"].includes(n[ue].text)&&a.has(ue))ue=a.get(ue)}v(be,le,G,D)}}function E(L,H){let G=new Set;for(let[D,ee]of c(L,H))v(D,ee,G);return G}function A(L){let H=L;for(;H<n.length;H++){let G=n[H].text;if(["(","[","{"].includes(G)&&a.has(H)){H=a.get(H);continue}if([",",";",")","]","}"].includes(G))break}return n[Math.max(L,H-1)]?.end??i.length}let j=new Set,F=[];for(let L=0;L<n.length;L++)if(n[L].text==="=>"){let H=L-1,G=H,D;if(n[H]?.text===")"&&a.has(H))G=a.get(H),D=E(G+1,H);else if(n[H]&&xt.test(n[H].text))D=new Set([n[H].text]);else continue;let ee=L+1,ne=n[ee]?.text==="{"&&a.has(ee)?n[a.get(ee)].end:A(ee);F.push({start:n[G].start,end:ne,bodyStart:n[ee]?.start??ne,functionBody:!0,names:D})}else if(n[L].text==="("&&a.has(L)){let H=n[L-1]?.text;if(!H||da.has(H)||!xt.test(H)&&H!=="*"&&H!=="]")continue;let G=a.get(L),D=G+1;if(n[D]?.text===":"){D++;while(D<n.length&&!["{","=>",";","="].includes(n[D].text))D++}if(n[D]?.text!=="{"||!a.has(D))continue;F.push({start:n[L].start,end:n[a.get(D)].end,bodyStart:n[D].start,functionBody:H!=="catch",names:E(L+1,G)})}function O(L){let H=L;for(;H<n.length;H++){let G=n[H].text;if(Kr.includes(G)&&a.has(H)){H=a.get(H);continue}if(G===";"||Xr.includes(G))break;let D=n[H-1];if(H>L&&ga.has(G)&&D.text!==".")break;if(H>L&&/[\n\r]/.test(i.slice(D.end,n[H].start))&&(/^[\w$]+$/.test(D.text)||Xr.includes(D.text)||['"',"'","`"].includes(D.text))&&xt.test(G)&&!["in","of","instanceof"].includes(G))break}return H}let P=[];for(let L=0;L<n.length;L++){if(n[L].text!=="for")continue;let H=n[L+1]?.text==="await"?L+2:L+1;if(n[H]?.text!=="("||!a.has(H))continue;let G=a.get(H),D=G+1,ee=n[D]?.text==="{"&&a.has(D)?a.get(D):O(D),ne=n[ee]?.text===";"||n[ee]?.text==="}"?n[ee].end:n[Math.max(D,ee-1)]?.end??i.length;P.push({headStart:H,headEnd:G,start:n[H].start,end:ne})}for(let L=0;L<n.length;L++){let H=n[L].text,G=n[L-1]?.text;if(G==="."||n[L+1]?.text===":")continue;if(G==="as"||G==="<")continue;if(H==="const"||H==="let"||H==="var"){let D=O(L+1),ee=L+1,ne=!1,te=!1,le=0;for(let be=L+1;be<=D;be++){let ue=n[be]?.text;if(be<D&&Kr.includes(ue)&&a.has(be)&&a.get(be)<D){be=a.get(be);continue}if(be<D&&ue===":"&&!te)ne=!0;else if(be<D&&ue==="="&&le===0)ne=!1,te=!0;else if(be<D&&ne&&ue==="<")le++;else if(be<D&&ne&&ue===">"&&le>0)le--;else if(be===D||ue===","&&le===0)v(ee,be,j,H==="var"),ee=be+1,ne=!1,te=!1}}else if(H==="function"||H==="class"){let D=L+1;if(n[D]?.text==="*")D++;if(n[D]&&xt.test(n[D].text)&&n[D].text!=="extends")j.add(n[D].text),b.push({name:n[D].text,token:D})}else if(H==="import"){let D=L+1;if(n[D]?.text==="*"&&n[D+1]?.text==="as")D+=2;let ee=n[D]?.text;if(ee&&xt.test(ee)&&ee!=="type"&&n[D+1]?.text!=="("&&n[D+1]?.text!==".")j.add(ee),b.push({name:ee,token:D,file:!0});let ne=n[D]?.text==="{"?D:n[D+1]?.text===","&&n[D+2]?.text==="{"?D+2:-1;if(ne!==-1&&a.has(ne)){let te=a.get(ne);for(let[le,be]of c(ne+1,te)){let ue=be-1;while(ue>=le&&!xt.test(n[ue].text))ue--;if(ue>=le&&n[ue].text!=="type")b.push({name:n[ue].text,token:ue,file:!0})}}}}let B={code:i,scopes:F,loops:P,declarations:j,sites:b,tokens:n,pairs:a};return Zr.set(e,B),B}function Qt(e){let t=bs(e);return{code:t.code,shadows:(i,n)=>t.scopes.some((a)=>n>=a.start&&n<a.end&&a.names.has(i))}}function Nn(e){return new Set(bs(e).declarations)}function Oe(e,t){let{scopes:i,loops:n,sites:a,tokens:l,pairs:c}=bs(e),b=Array.from({length:l.length},()=>-1),v=[];for(let O=0;O<l.length;O++){b[O]=v.length?v[v.length-1]:-1;let P=l[O].text;if(P==="{"&&c.has(O))v.push(O);else if(P==="}"&&v.length&&c.get(O)===v[v.length-1])v.pop()}let E=new Set,A=new Map;for(let O of a){if(!t.has(O.name))continue;E.add(O.token);let P=O.file?-1:b[O.token],B=P===-1?[0,Number.POSITIVE_INFINITY]:[l[P].start,l[c.get(P)].end];if(O.functionScoped){let H=l[O.token].start,G=i.filter((D)=>D.functionBody&&H>=D.bodyStart&&H<D.end).sort((D,ee)=>D.end-D.bodyStart-(ee.end-ee.bodyStart))[0];B=G?[G.bodyStart,G.end]:[0,Number.POSITIVE_INFINITY]}else if(!O.file){let H=n.filter((G)=>O.token>G.headStart&&O.token<G.headEnd).sort((G,D)=>G.headEnd-G.headStart-(D.headEnd-D.headStart))[0];if(H)B=[H.start,H.end]}let L=A.get(O.name);if(L)L.push(B);else A.set(O.name,[B])}let j=new Set;for(let O=0;O<l.length;O++){if(l[O].text!=="import"||l[O-1]?.text===".")continue;let P=O+1;if(l[P]?.text==="type")P++;if(l[P]&&xt.test(l[P].text)&&l[P+1]?.text===",")P+=2;if(l[P]?.text==="{"&&c.has(P))for(let B=P+1;B<c.get(P);B++)j.add(B)}let F=new Set;for(let O=0;O<l.length;O++){let P=l[O].text;if(!t.has(P)||F.has(P)||E.has(O)||j.has(O))continue;let B=l[O-1]?.text;if(B==="#"||B==="."&&l[O-2]?.text!=="..")continue;if(l[O+1]?.text===":"&&(B==="{"||B===","))continue;let L=l[O].start;if(A.get(P)?.some(([H,G])=>L>=H&&L<G))continue;if(i.some((H)=>L>=H.start&&L<H.end&&H.names.has(P)))continue;F.add(P)}return F}var Ie="0.2.841";var Jr=Symbol.for(`stx.lazy-module-promises.${Ie}`);function xa(){let e=globalThis;return e[Jr]??=new Map,e[Jr]}function o(e,t){let i=xa(),n=`${import.meta.url}\x00${e}`,a=i.get(n);if(a)return a;let l=t();return i.set(n,l),l.catch(()=>{if(i.get(n)===l)i.delete(n)}),l}var ba=/<\/(script)/gi;function fn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(ba,"<\\/$1")}import Gr from"fs";var Yr=[];function w(e){let t=new T(e);return Yr.push(t),t}function Ic(){for(let e of Yr)e.clear()}function S(e,...t){return`${t.map((i)=>String(i??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function vr(e){let t=[];for(let i of new Set(e))try{t.push({path:i,mtimeMs:Gr.statSync(i).mtimeMs})}catch{}return t}function js(e){for(let t of e)try{if(Gr.statSync(t.path).mtimeMs!==t.mtimeMs)return!1}catch{return!1}return!0}var Se=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var ya=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function _a(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let i=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}let t=e.match(/^([^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}function wa(e,t){let i=t;while(!0){let n=wt.join(i,"node_modules",e,"package.json");if(en.existsSync(n))return wt.dirname(n);let a=wt.dirname(i);if(a===i)return null;i=a}}function Sa(e,t){if(!e||typeof e!=="object")return null;let i=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return i(a.import);if(typeof a.default==="object")return i(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,t))return i(e[t]);let n=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let c=a.slice(0,l),b=a.slice(l+1);if(!t.startsWith(c)||!t.endsWith(b))continue;if(t.length<c.length+b.length)continue;if(!n||c.length>n.prefix.length)n={pattern:a,prefix:c,suffix:b}}if(n){let a=t.slice(n.prefix.length,t.length-n.suffix.length),l=i(e[n.pattern]);if(l)return l.replace("*",a)}return null}function $a(e,t){let i=_a(e);if(!i||!i.subpath)return null;let n=wa(i.pkg,t);if(!n)return null;let a;try{a=JSON.parse(en.readFileSync(wt.join(n,"package.json"),"utf8"))}catch{return null}let l=`.${i.subpath}`,c=Sa(a.exports,l);if(!c)return null;let b=wt.resolve(n,c);return en.existsSync(b)?b:null}function bi(e,t){let i=t.filePath?wt.dirname(t.filePath):t.projectRoot||process.cwd(),n=t.projectRoot||process.cwd(),a=new Set,l=[],c=[];return{code:e.replace(ya,(v,E)=>{let A;try{if(E.startsWith("./")||E.startsWith("../")||E.startsWith("/")){if(A=E.startsWith("/")?E:wt.resolve(i,E),!en.existsSync(A))throw Error(`file not found: ${A}`)}else{let j=null;try{j=Bun.resolveSync(E,n)}catch{j=$a(E,n)}if(!j)throw Error(`could not resolve ${E} (Bun.resolveSync + exports fallback both failed)`);A=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(E)} (from ${t.filePath||"<unknown>"}): ${j?.message||j}`),c.push(E),""}if(a.has(A))return"";a.add(A);try{let j=en.readFileSync(A,"utf8");l.push({source:E,resolvedPath:A,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${A}: ${j?.message||j}`),c.push(E)}return""}),styles:l,unresolved:c}}function va(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wi(e){if(e.length===0)return"";return`${e.map((t)=>`<style data-stx-vendor="${va(t.source)}" data-stx-layer="vendor">
116
116
  @layer vendor {
117
117
  ${t.contents}
118
118
  }
@@ -182,7 +182,7 @@ else {
182
182
  // STX: auto-generated event bindings
183
183
  ${e.map((i,n)=>ja(i,n)).join(`
184
184
  `)}`}function ni(e){let t=[],i=new Set,n=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=n.length,c=0;while(c<l){let b=n[c];if(b==="'"||b==='"'||b==="`"){let v=b;if(c++,v==="`"){let E=0;while(c<l){if(n[c]==="\\"){c+=2;continue}if(n[c]==="`"&&E===0){c++;break}if(n[c]==="$"&&n[c+1]==="{"){E++,c+=2;continue}if(n[c]==="}"&&E>0){E--,c++;continue}c++}}else while(c<l){if(n[c]==="\\"){c+=2;continue}if(n[c]===v){c++;break}c++}continue}if(b==="/"&&n[c+1]==="/"){while(c<l&&n[c]!==`
185
- `)c++;continue}if(b==="/"&&n[c+1]==="*"){c+=2;while(c<l-1&&!(n[c]==="*"&&n[c+1]==="/"))c++;c+=2;continue}if(b==="{"){a++,c++;continue}if(b==="}"){a--,c++;continue}if(a===0){let v=n.slice(c),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let F=E[1];if(!F.startsWith("_")&&!i.has(F))t.push(F),i.add(F);c+=E[0].length;continue}let A=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){A[1].split(",").forEach((F)=>{let O=F.trim(),P=O.indexOf(":"),B=P>=0?O.slice(P+1).trim().split(/[\s=]/)[0]:O.split(/[\s=]/)[0];if(B&&!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B)}),c+=A[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let F=j[1];if(!F.startsWith("_")&&!i.has(F))t.push(F),i.add(F);c+=j[0].length;continue}}c++}return t}var Na=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function La(e){let t=new Set,i=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function n(F){let O;while((O=i.exec(F))!==null){let P=O[0];if(!Na.has(P))t.add(P)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)n(l[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=c.exec(e))!==null)n(l[1]);let b=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=b.exec(e))!==null)n(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)n(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)n(l[1]);let A=/@model\s*=\s*["']([^"']*)["']/gi;while((l=A.exec(e))!==null)n(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)n(l[1]);return t}async function je(e,t={}){let i=e,n="",a=!1,l=[],c=bi(i,{filePath:t.filePath,projectRoot:t.projectRoot});i=c.code;let b=wi(c.styles),v=Dt(i);i=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:A}=await o("stx/client-script-bundler",()=>import("./chunk-mh4kpnjr.js"));if(E(i))i=await A(i,t.filePath||"",{projectRoot:t.projectRoot,minify:t.production}),a=!0;if(t.autoImports!==!1){let D=Jc(i);i=D.code,n=Yc(D.stxImports,D.browserImports.filter((ee)=>!l.includes(ee)))}if(n=`${vn(i,t.serverData)}${n}`,i=I(i),!a&&Be(t.attrs||""))i=Fe(i);let j=Da(t.eventBindings||[]),F=(t.attrs||"").trim(),O=/\btype\s*=\s*["']module["']/i.test(F),P=t.instanceId?` data-stx-instance="${t.instanceId}"`:"";if(O){let D=F.replace(/\btype\s*=\s*["']module["']/i,"").trim(),ee=`type="module" data-stx-scoped${P}${D?` ${D}`:""}`;return`${b}<script ${ee}>
185
+ `)c++;continue}if(b==="/"&&n[c+1]==="*"){c+=2;while(c<l-1&&!(n[c]==="*"&&n[c+1]==="/"))c++;c+=2;continue}if(b==="{"){a++,c++;continue}if(b==="}"){a--,c++;continue}if(a===0){let v=n.slice(c),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let F=E[1];if(!F.startsWith("_")&&!i.has(F))t.push(F),i.add(F);c+=E[0].length;continue}let A=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){A[1].split(",").forEach((F)=>{let O=F.trim(),P=O.indexOf(":"),B=P>=0?O.slice(P+1).trim().split(/[\s=]/)[0]:O.split(/[\s=]/)[0];if(B&&!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B)}),c+=A[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let F=j[1];if(!F.startsWith("_")&&!i.has(F))t.push(F),i.add(F);c+=j[0].length;continue}}c++}return t}var Na=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function La(e){let t=new Set,i=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function n(F){let O;while((O=i.exec(F))!==null){let P=O[0];if(!Na.has(P))t.add(P)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)n(l[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=c.exec(e))!==null)n(l[1]);let b=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=b.exec(e))!==null)n(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)n(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)n(l[1]);let A=/@model\s*=\s*["']([^"']*)["']/gi;while((l=A.exec(e))!==null)n(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)n(l[1]);return t}async function je(e,t={}){let i=e,n="",a=!1,l=[],c=bi(i,{filePath:t.filePath,projectRoot:t.projectRoot});i=c.code;let b=wi(c.styles),v=Dt(i);i=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:A}=await o("stx/client-script-bundler",()=>import("./chunk-32mf97nv.js"));if(E(i))i=await A(i,t.filePath||"",{projectRoot:t.projectRoot,minify:t.production}),a=!0;if(t.autoImports!==!1){let D=Jc(i);i=D.code,n=Yc(D.stxImports,D.browserImports.filter((ee)=>!l.includes(ee)))}if(n=`${vn(i,t.serverData)}${n}`,i=I(i),!a&&Be(t.attrs||""))i=Fe(i);let j=Da(t.eventBindings||[]),F=(t.attrs||"").trim(),O=/\btype\s*=\s*["']module["']/i.test(F),P=t.instanceId?` data-stx-instance="${t.instanceId}"`:"";if(O){let D=F.replace(/\btype\s*=\s*["']module["']/i,"").trim(),ee=`type="module" data-stx-scoped${P}${D?` ${D}`:""}`;return`${b}<script ${ee}>
186
186
  ${fn(`${n}${i}
187
187
  ${j}`)}
188
188
  </script>`}let B=Ii(e),L=/function __stx_setup_/.test(i),H=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function G(D){let ee=D.length>0?`
@@ -570,8 +570,8 @@ ${E.join(`
570
570
  `){let P=e[a];if(P==="\\"){a+=2;continue}if(P==="[")O=!0;else if(P==="]")O=!1;else if(P==="/"&&!O){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},F=()=>{if(n!==0)return;let O=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(O){let H=O[2].split(",").map((G)=>{let D=G.trim().split(":");return D[D.length-1].trim()});for(let G of H)if(G&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(G)&&!i.has(G))t.push(G),i.add(G);return}let P=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(P){let H=P[2];if(!i.has(H))t.push(H),i.add(H);return}let B=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let H=B[1];if(!i.has(H))t.push(H),i.add(H);return}let L=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let H=L[1];if(!i.has(H))t.push(H),i.add(H)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){c(e[a]);continue}if(e[a]==="`"){b();continue}if(e[a]==="/"&&A()){j();continue}if(e[a]==="{"){n++,a++;continue}if(e[a]==="}"){n--,a++;continue}if(n===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))F();a++}return t}function su(e){let t=[],i=0,n=0,a=null;for(let l=0;l<e.length;l++){let c=e[l];if(a){if(c==="\\"){l++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="("||c==="["||c==="{")i++;else if(c===")"||c==="]"||c==="}")i--;else if(c===","&&i===0)t.push(e.slice(n,l)),n=l+1}if(n<e.length)t.push(e.slice(n));return t}function ru(e){let t=0,i=null;for(let n=0;n<e.length;n++){let a=e[n];if(i){if(a==="\\"){n++;continue}if(a===i)i=null;continue}if(a==='"'||a==="'"||a==="`"){i=a;continue}if(a==="("||a==="["||a==="{")t++;else if(a===")"||a==="]"||a==="}")t--;else if(a==="="&&t===0){let l=e[n-1],c=e[n+1];if(l==="!"||l==="<"||l===">"||l==="=")continue;if(c==="="||c===">")continue;return n}}return-1}function iu(e,t){try{let i=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!i)return;let n=i.index-1;while(n>=0&&/\s/.test(e[n]))n--;if(e[n]!=="}")return;let a=n,l=0,c=-1;for(;n>=0;n--){let v=e[n];if(v==="}")l++;else if(v==="{"){if(l--,l===0){c=n;break}}}if(c===-1)return;let b=e.slice(c+1,a);for(let v of su(b)){let E=v.trim();if(!E||E.startsWith("..."))continue;let A=ru(E);if(A===-1)continue;let j=E.slice(0,A).trim();if(!/^[A-Z_$][\w$]*$/i.test(j))continue;if(t[j]!==void 0)continue;let F=E.slice(A+1).trim();if(!F)continue;try{let O=Object.keys(t).filter(Ft),P=Function(...O,`"use strict"; return (${F});`);t[j]=P(...O.map((B)=>t[B]))}catch{}}}catch{}}var ou=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function yg(e,t){let i=Pt(e),n=e.slice(i).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/);if(!n)return null;let a=n[1].toLowerCase();if(!ou.has(a))return null;let l=new RegExp(`<\\/?${a}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),c=y(e,(A,j)=>(l.lastIndex=j,l.exec(A)?.index===j?l.lastIndex:-1));if(a==="span"&&/\sdata-stx-scope\s*=/.test(c[0]?.token||""))return null;let b=0,v=!1;for(let A of c){if(b+=A.token.startsWith("</")?-1:1,b<0)return null;if(b===0){if(e.slice(A.end).trim())return null;v=!0;break}}if(!v)return null;let E=i+n[0].length;return e.slice(0,E)+t+e.slice(E)}function Wo(e,t){if(!e)return!1;return[...t.additionalComponentsDirs??[],...t.fallbackComponentsDir?[t.fallbackComponentsDir]:[]].some((n)=>{let a=ae.relative(ae.resolve(n),ae.resolve(e));return!a.startsWith("..")&&!ae.isAbsolute(a)})}async function Tr(e,t,i,n,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,c=(te)=>te.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),b=i.__importedComponents;if(b){for(let te of[l,l.toLowerCase(),c(l),U(l)])if(b.has(te))return!0}let v=[...new Set([`${l}.stx`,`${c(l)}.stx`,`${U(l)}.stx`])],E=typeof a.root==="string"?ae.resolve(a.root):void 0,A=E??ae.dirname(n),j=[],F=(te)=>{if(te&&!j.includes(te))j.push(te)};for(let te of Dn(n,E))F(te);let O=i.__originalFilePath;if(O)F(ae.join(ae.dirname(O),"components"));if(Wo(t,a))F(a._rootComponentsDir);F(t),F(a._rootComponentsDir),F(ae.join(ae.dirname(n),"components")),F(a.componentsDir);for(let te of a.additionalComponentsDirs??[])F(te);let P=a._targetComponentFallbackNames?.some((te)=>te.toLowerCase()===l.toLowerCase());if(!P)for(let te of a._targetComponentDirs??[])F(te);if(E)F(ae.resolve(E,"resources/views/components")),F(ae.resolve(E,"resources/components")),F(ae.resolve(E,"src/components")),F(ae.resolve(E,"components"));for(let te of a._layerComponentDirs??[])F(te);let B=a._pluginComponentDirs;if(Array.isArray(B))for(let te of B)F(typeof te==="string"?te:null);if(F(a.fallbackComponentsDir),P)for(let te of a._targetComponentDirs??[])F(te);let L=a._nativePrimitivesFallback;if(L&&!L.except.some((te)=>te.toLowerCase()===l.toLowerCase()))F(L.dir);if(l.startsWith("./")||l.startsWith("../"))return r(ae.resolve(ae.dirname(n),`${l}.stx`));let H=Oo(ae.resolve(import.meta.dir,"components")),G=j.map((te)=>ae.isAbsolute(te)?te:ae.resolve(A,te)),D=`${v.join("\x00")}\x00\x00${G.join("\x00")}`,ee=lr.get(D);if(ee!==void 0)return ee;let ne=!1;e:for(let te of G){if(Oo(te)===H)continue;for(let le of v)if(await r(ae.join(te,le))){ne=!0;break e}}return lr.set(D,ne),ne}function Oo(e){let t=ur.get(e);if(t!==void 0)return t;let i=e;try{i=ns.realpathSync(e)}catch{}return ur.set(e,i),i}function bg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Zc(e){if(!e)return!1;let t=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(t)}function au(e,t,i){if(!e.includes("{{")&&!e.includes("{!!"))return e;let n=(a,l)=>{let c;try{c=R(a,t)}catch{return l}if(c===void 0||c===null)return"";let b=String(c);if(/<\/style/i.test(b))return console.warn(`[stx] a <style> expression in ${i??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return b};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>n(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>n(l,a))}var Mo=new Set;function jo(e,t,i,n){let a=`${e}\x00${t}\x00${n??""}`;if(!process.env.STX_DEBUG&&Mo.has(a))return;Mo.add(a);let l=t?` used in ${t}`:"",c=n?` Cause: ${n}.`:"",b=i.length>0?`
571
571
  searched:
572
572
  ${i.map((v)=>` - ${v}`).join(`
573
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${c}${b}`)}function Do(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var cu=new Set(["for","if","show","key","ref","class","className","style"]),No=new Set,Fo="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Qc=new RegExp(`\\b(?:${Fo})\\s*(?:<[^>]*>)?\\s*\\(`);function vi(e){let t=new Set,i=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Fo})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let n of e){let a;while((a=i.exec(n))!==null)t.add(a[1]);i.lastIndex=0}return[...t]}async function ze(e,t,i,n,a,l,c,b=new Set,v,E=st(a),A,j=e){let{extractVariables:F}=await o("stx/variable-extractor",()=>import("./chunk-3gzhh69y.js")),O=b??new Set;if(O.has(e))return`[Circular component reference: ${e}]`;let P=new Set(O);P.add(e);let B=typeof t.client==="string"?t.client.trim():"";if("client"in t)delete t.client;let L=B&&B!=="load"&&bg(B)?B:"";try{let H=(re)=>re.split("-").map((ce)=>ce.charAt(0).toUpperCase()+ce.slice(1)).join(""),G=j.endsWith(".stx")?j.slice(0,-4):j,D=null,ee=a.__importedComponents;if(ee){let re=[G,G.toLowerCase(),H(G),U(G)];for(let ce of re)if(ee.has(ce)){D=ee.get(ce);break}}let ne=[];if(!D){let re=[`${G}.stx`,`${H(G)}.stx`,`${U(G)}.stx`],ce=[...new Set(re)],_e=a.__originalFilePath,he=[];for(let ye of Dn(l))if(!he.includes(ye))he.push(ye);let Ze=he.length;for(let ye of c._layerComponentDirs??[])if(!he.includes(ye))he.push(ye);if(_e){let ye=ae.join(ae.dirname(_e),"components");he.push(ye)}let Re=c._rootComponentsDir;if(typeof Re==="string"&&Wo(n,c)&&!he.includes(Re))he.push(Re);if(n&&!he.includes(n))he.push(n);if(typeof Re==="string"&&!he.includes(Re))he.push(Re);let pt=ae.join(ae.dirname(l),"components");if(!he.includes(pt))he.push(pt);if(c.componentsDir&&c.componentsDir!==n&&!he.includes(c.componentsDir))he.push(c.componentsDir);for(let ye of c.additionalComponentsDirs??[])if(ye&&!he.includes(ye))he.push(ye);let vt=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(G),mt=(A?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Rn=Object.hasOwn(t,"checked")||Boolean(A?.reactiveProps?.includes("checked")),ls=Object.hasOwn(t,"value")||Boolean(A?.reactiveProps?.includes("value")),us=!mt.includes("valuechange")&&(Rn||mt.includes("change")&&!ls),yt=c._nativeHostAttrs&&/^textinput$/i.test(G),Et=mt.includes("update:value")&&!mt.includes("input"),Yt=c._nativeHostAttrs&&/^video$/i.test(G),fs=c._nativeHostAttrs&&/^image$/i.test(G),Cn=Ls([...Object.keys(t),...A?.reactiveProps??[]],A?.events,t),kt=Object.hasOwn(t,"src")||Boolean(A?.reactiveProps?.includes("src")),An=Object.hasOwn(t,"source")||Boolean(A?.reactiveProps?.includes("source")),Tn=Yt&&(kt||An)&&(A?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),In=new Set(["","primary","secondary","outline","ghost","danger"]),Pn=typeof t.variant==="string"?t.variant.trim().toLowerCase():"",On=c._nativeHostAttrs&&/^button$/i.test(G)&&!In.has(Pn),yr=c._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===G.toLowerCase())??!1,ps=yr&&(!vt||us)&&(!yt||Et)&&(!Yt||Tn)&&(!fs||Cn)&&!On;for(let ye of ps?[]:c._targetComponentDirs??[])if(ye&&!he.includes(ye))he.push(ye);let Rt=typeof c.root==="string"?ae.resolve(c.root):void 0,$r=Rt??ae.dirname(l),Ct=[];if(Rt)Ct.push(ae.resolve(Rt,"resources/views/components")),Ct.push(ae.resolve(Rt,"resources/components")),Ct.push(ae.resolve(Rt,"src/components")),Ct.push(ae.resolve(Rt,"components"));Ct.push(ae.resolve(import.meta.dir,"components"));for(let ye of Ct)if(!he.includes(ye))he.push(ye);if(yr){let ye=(ps?c._pluginComponentDirs??[]:c._targetComponentDirs??[]).filter((rt)=>typeof rt==="string"&&rt.length>0);if(ye.length){let rt=he.slice(Ze).map((Je)=>ae.isAbsolute(Je)?Je:ae.resolve($r,Je)).filter((Je)=>!ye.includes(Je)),_t=`${G}\x00${rt.join("\x00")}`,ht=cr.get(_t);if(ht===void 0){ht=!1;for(let Je of rt){for(let dt of ce)if(await r(ae.join(Je,dt))){ht=!0;break}if(ht)break}cr.set(_t,ht)}if(!ht){for(let Je of ye){let dt=he.indexOf(Je);if(dt>=0)he.splice(dt,1)}he.splice(Ze,0,...ye)}}}let Rr=c._pluginComponentDirs;if(Array.isArray(Rr)){for(let ye of Rr)if(typeof ye==="string"&&!he.includes(ye))he.push(ye)}if(c.fallbackComponentsDir&&!he.includes(c.fallbackComponentsDir))he.push(c.fallbackComponentsDir);if(ps){for(let ye of c._targetComponentDirs??[])if(ye&&!he.includes(ye))he.push(ye)}let Mn=c._nativePrimitivesFallback;if(Mn&&!Mn.except.some((ye)=>ye.toLowerCase()===G.toLowerCase())&&!he.includes(Mn.dir))he.push(Mn.dir);let Ar=[...new Set(he.map((ye)=>{if(!ye)return ye;return ae.isAbsolute(ye)?ye:ae.resolve($r,ye)}))];he.length=0,he.push(...Ar);let ds=`${G}\x00${l}\x00${Ar.join("\x00")}`,gs=es.get(ds);if(gs)if(await r(gs))D=gs;else es.delete(ds);if(!D&&(G.startsWith("./")||G.startsWith("../")))D=ae.resolve(ae.dirname(l),`${G}.stx`),ne.push(D);else if(!D)for(let ye of he){if(!ye)continue;for(let rt of ce){let _t=ae.join(ye,rt);if(ne.push(_t),await r(_t)){D=_t;break}}if(D)break;if(!D)try{let rt=await import("fs");if(!rt.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let ht=8,Je=[{path:ye,depth:0}];while(Je.length>0&&!D){let dt=Je.pop();if(dt.depth>=ht)continue;let Ir;try{Ir=rt.readdirSync(dt.path,{withFileTypes:!0})}catch{continue}for(let jn of Ir){if(!jn.isDirectory())continue;if(jn.name==="node_modules"||jn.name.startsWith("."))continue;let Pr=ae.join(dt.path,jn.name);for(let na of ce){let ms=ae.join(Pr,na);if(ne.push(ms),await r(ms)){D=ms;break}}if(D)break;Je.push({path:Pr,depth:dt.depth+1})}}}catch{}if(D)break}if(D)es.set(ds,D)}if(!D||!await r(D))return jo(e,l,ne),Do(e);v.add(D);let te;if(cn.has(D)&&ar.get(D)===To(D))te=cn.get(D);else try{let re=To(D);te=await Bun.file(D).text(),cn.set(D,te),ar.set(D,re)}catch(re){let ce=re instanceof Error?re.message:String(re);return jo(e,l,[D],ce),Do(e)}if(A)for(let re of new Set([...Object.keys(t),...A.reactiveProps??[]])){let ce=re.toLowerCase();if(ce.startsWith("aria-")||ce.startsWith("data-"))continue;let _e=re.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${_e}\\b`).test(te))A.declaredProps.add(re);if(new RegExp(`\\$props\\s*(?:\\.\\s*${_e}\\b|\\[\\s*['"]${_e}['"]\\s*\\])`).test(te)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${_e}['"]`).test(te))A.consumedProps?.add(re)}if(A?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(te))for(let re of A.reactiveProps){if(cu.has(re)||A.consumedProps?.has(re))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${re.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(te))continue;let ce=`${D}\x00${re}`;if(No.has(ce))continue;No.add(ce),console.warn(`[stx] ${ae.basename(D)} reads \`${re}\` with defineProps(), which is not live, but ${ae.basename(l)} binds it (:${re}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${re}').`)}let le=new Set(["__originalFilePath","__importedComponents",Fn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),be={};for(let[re,ce]of Object.entries(a))if(!re.startsWith("__")||le.has(re))be[re]=ce;let ue=E.length>0?{[Kn]:[...E]}:{},Ee=i;if(i.includes("@include")){let{processIncludes:re}=await o("stx/includes",()=>import("./chunk-40bkdswh.js"));Ee=await re(i,a,l,c,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ee)){let{processComponents:re}=await o("stx/component-renderer",()=>import("./chunk-b3fx75th.js")),ce={...a,__processedComponents:O,...ue};Ee=await re(Ee,ce,l,c,v);let _e=ce.__stx_preserved_client_expressions;if(Array.isArray(_e)&&_e.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],..._e])]}let Te=[];if(Zc(Ee)){let{processExpressions:re}=await o("stx/expressions",()=>import("./chunk-8gdtys3s.js")),ce=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...ue}:E.length>0?{...a,...ue}:a;Ee=re(Ee,ce,l);for(let _e of Ee.matchAll(/\{\{([\s\S]*?)\}\}/g))Te.push(_e[1].trim())}let We=J(Ee),Ke=[],Qe=We.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(re,ce)=>{let _e=We.scripts[Number(ce)]||"",he=_e.match(/^<script\b([^>]*)>/i)?.[1]||"",Ze=he.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Re=!Ze||["module","text/javascript","application/javascript"].includes(Ze),pt=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${he}`);if(!/\bserver\b/i.test(he)&&Re&&!pt)return Ke.push(_e),"";return _e}),{extractSlotContent:Xe}=await o("stx/slots",()=>import("./chunk-6nb07mdj.js")),tt=Xe(Qe),Ge={};if(tt.defaultSlot?.trim())Ge.default=tt.defaultSlot;for(let[re,ce]of tt.namedSlots)Ge[re]=ce.content;let bt=a.__stx_scope_seq??={n:0,key:Ws(String(a.__filename??l))},Wt=Bo(e,process.cwd()),ot=`stx_${(Wt.endsWith(".stx")?Wt.slice(0,-4):Wt).replace(/[^a-zA-Z0-9]/g,"_")}_${++bt.n}_${bt.key}`,Pe={...be,$uid:ot,$native:c._nativeHostAttrs===!0,...t,props:t,slot:Qe,$slots:Ge,__processedComponents:P,__sections:{},__stx_signals_gate:ke(te)||Zc(i),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Te]};if(/import\s/.test(te)){Pe.__importedComponents=new Map(Pe.__importedComponents);let{processESImports:re}=await o("stx/component-renderer",()=>import("./chunk-b3fx75th.js"));te=await re(te,Pe,D,c,v)}iu(te,Pe);let Vt=te,un=pe(Vt);if(un)Vt=un.content.trim();let rs=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Ut=[...te.matchAll(rs)];for(let[,re,ce]of Ut)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(re))Ne(ce,D,c.strict);let Ye=[],Ht=null,is=Ut.some((re)=>/\bserver\b/.test(re[1]||"")&&/\bcache\b/.test(re[1]||"")),$t=null,at=null,qt=null,pn=0,Zt=null;if(Yl(c),is&&fr>0){let re=Ql({props:t,slot:Ee,slotContext:i.trim()?eu(be):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:c._layerGraph?.layers.map((ce)=>ce.configFile),uid:ot});if(re!==null){$t=`${D}\x00${S(te)}\x00${re}`;let ce=ts.get($t);if(ce){for(let _e of ce.dependencies)v.add(_e);if(ki(a,ce.clientFactories),bt.n+=ce.uidsConsumed,ce.preservedClientExpressions.length>0){let _e=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let he of ce.preservedClientExpressions)_e.add(he);a.__stx_preserved_client_expressions=[..._e]}return ce.output}at=new Set(v),qt=$i(a),pn=bt.n,Zt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Kt=new Set;for(let re of Ut){let ce=re[1]||"",_e=re[2]||"",he=ce.includes("server");if(Be(ce)&&_e.trim())_e=Fe(_e);if(he&&_e){for(let Re of De(_e))Kt.add(Re);try{await F(_e,Pe,D,{onFailure:(Re)=>{if(Re.kind!=="unknown")Ht=Re.kind}})}catch(Re){}}if(!he){let Re=_e.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),pt=Re.includes("{{")&&Re.includes("}}"),vt=Re.includes("{!!")&&Re.includes("!!}");if(pt||vt)Re=Si(Re,Pe,D);let mt=ce.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Ye.push(`<script${mt}>${Re}</script>`)}}let et=J(te).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Xt=et?et[1]:"",os=et?et[2]:"",lt="",se=Xt&&/\bscoped\b/i.test(Xt);if(et)lt=`<style${Xt}>${au(os,Pe,D)}</style>`;let oe=Vt;if(oe=oe.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),et)oe=oe.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let re=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ce=[];if(oe=oe.replace(re,(_e,he)=>{let Ze=he.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ze)ce.push(`<style${Ze[1]}>${Ze[2]}</style>`);return""}),oe=oe.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ce.length>0)lt=`${lt}${ce.join(`
574
- `)}`}if(i&&oe.includes("{{ text || slot }}"))oe=oe.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>i);let{applySlots:de}=await o("stx/slots",()=>import("./chunk-6nb07mdj.js")),{defaultSlot:we,namedSlots:Ae}=tt,Ve=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Qe),nt=Ye.length>0&&Js(oe)||c._nativeHostAttrs===!0&&Ye.length>0||Ve&&Ye.length>0||Ye.some((re)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(re)),as=(re)=>nt?no(re,ot):re,cs=new Map([...Ae].map(([re,ce])=>[re,{...ce,content:as(ce.content)}]));oe=await de(oe,nt?to(as(we),ot):we,cs,Pe,nt?ot:"");let dn=vi(Ye),Jt=(Array.isArray(Pe.__stx_client_signal_names)?Pe.__stx_client_signal_names:[]).filter((re)=>!Kt.has(re));if(dn.length>0||Jt.length>0)Pe.__stx_client_signal_names=[...new Set([...Jt,...dn])];else delete Pe.__stx_client_signal_names;let Gt=E.filter((re)=>!Kt.has(re)&&!(re in t));if(Gt.length>0)Pe[Kn]=Gt;let $n={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:ae.dirname(D),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||nt||Ye.length===0,defaultLayout:void 0};Pe.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:En}=await o("stx/process",()=>import("./chunk-ndah5rvs.js")),ut=await En(oe,Pe,D,$n,v),gt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let re of ut.matchAll(/\{\{([\s\S]*?)\}\}/g))gt.add(re[1].trim());if(gt.size>0)a.__stx_preserved_client_expressions=[...gt];let ft=ot,qe=ut;if(nt){let re="";if(Object.keys(t).length>0)try{re=` data-stx-props="${ir(JSON.stringify(t))}"`}catch{}let ce=L?` stx-hydrate="${ir(L)}"`:"",_e=Object.fromEntries(Object.entries(Ge).map(([yt,Et])=>[yt,Boolean(Et)])),he=Object.keys(_e).length>0?` data-stx-slots="${ir(JSON.stringify(_e))}"`:"",Ze=` data-stx-scope="${ft}"${re}${he}${ce}`,Re=ut.slice(Pt(ut)),pt=/^<span(?=[\s/>])/i.test(Re),vt=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Re),mt=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Re),Rn=pt?"span":"div",ls=vt&&c._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':mt&&c._nativeHostAttrs?' style="width:100%;height:100%"':pt||vt?' style="display:contents"':"";qe=yg(ut,Ze)??`<${Rn}${Ze} data-stx-component-wrapper${ls}>${ut}</${Rn}>`;let us=await Promise.all(Ye.map(async(yt)=>{let Et=yt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!Et)return yt;let[,Yt,fs]=Et,Cn=Ao(yt,Pe,D);if(Cn!==null)return Cn;let kt=await uu(fs,D,c.buildMode==="compile"),An=vn(kt.clientCode,Le(Pe)),{vendorStyleTags:Tn}=kt,In=An?`function(__scopeId) {
573
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${c}${b}`)}function Do(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var cu=new Set(["for","if","show","key","ref","class","className","style"]),No=new Set,Fo="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Qc=new RegExp(`\\b(?:${Fo})\\s*(?:<[^>]*>)?\\s*\\(`);function vi(e){let t=new Set,i=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Fo})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let n of e){let a;while((a=i.exec(n))!==null)t.add(a[1]);i.lastIndex=0}return[...t]}async function ze(e,t,i,n,a,l,c,b=new Set,v,E=st(a),A,j=e){let{extractVariables:F}=await o("stx/variable-extractor",()=>import("./chunk-dpmr4sym.js")),O=b??new Set;if(O.has(e))return`[Circular component reference: ${e}]`;let P=new Set(O);P.add(e);let B=typeof t.client==="string"?t.client.trim():"";if("client"in t)delete t.client;let L=B&&B!=="load"&&bg(B)?B:"";try{let H=(re)=>re.split("-").map((ce)=>ce.charAt(0).toUpperCase()+ce.slice(1)).join(""),G=j.endsWith(".stx")?j.slice(0,-4):j,D=null,ee=a.__importedComponents;if(ee){let re=[G,G.toLowerCase(),H(G),U(G)];for(let ce of re)if(ee.has(ce)){D=ee.get(ce);break}}let ne=[];if(!D){let re=[`${G}.stx`,`${H(G)}.stx`,`${U(G)}.stx`],ce=[...new Set(re)],_e=a.__originalFilePath,he=[];for(let ye of Dn(l))if(!he.includes(ye))he.push(ye);let Ze=he.length;for(let ye of c._layerComponentDirs??[])if(!he.includes(ye))he.push(ye);if(_e){let ye=ae.join(ae.dirname(_e),"components");he.push(ye)}let Re=c._rootComponentsDir;if(typeof Re==="string"&&Wo(n,c)&&!he.includes(Re))he.push(Re);if(n&&!he.includes(n))he.push(n);if(typeof Re==="string"&&!he.includes(Re))he.push(Re);let pt=ae.join(ae.dirname(l),"components");if(!he.includes(pt))he.push(pt);if(c.componentsDir&&c.componentsDir!==n&&!he.includes(c.componentsDir))he.push(c.componentsDir);for(let ye of c.additionalComponentsDirs??[])if(ye&&!he.includes(ye))he.push(ye);let vt=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(G),mt=(A?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Rn=Object.hasOwn(t,"checked")||Boolean(A?.reactiveProps?.includes("checked")),ls=Object.hasOwn(t,"value")||Boolean(A?.reactiveProps?.includes("value")),us=!mt.includes("valuechange")&&(Rn||mt.includes("change")&&!ls),yt=c._nativeHostAttrs&&/^textinput$/i.test(G),Et=mt.includes("update:value")&&!mt.includes("input"),Yt=c._nativeHostAttrs&&/^video$/i.test(G),fs=c._nativeHostAttrs&&/^image$/i.test(G),Cn=Ls([...Object.keys(t),...A?.reactiveProps??[]],A?.events,t),kt=Object.hasOwn(t,"src")||Boolean(A?.reactiveProps?.includes("src")),An=Object.hasOwn(t,"source")||Boolean(A?.reactiveProps?.includes("source")),Tn=Yt&&(kt||An)&&(A?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),In=new Set(["","primary","secondary","outline","ghost","danger"]),Pn=typeof t.variant==="string"?t.variant.trim().toLowerCase():"",On=c._nativeHostAttrs&&/^button$/i.test(G)&&!In.has(Pn),yr=c._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===G.toLowerCase())??!1,ps=yr&&(!vt||us)&&(!yt||Et)&&(!Yt||Tn)&&(!fs||Cn)&&!On;for(let ye of ps?[]:c._targetComponentDirs??[])if(ye&&!he.includes(ye))he.push(ye);let Rt=typeof c.root==="string"?ae.resolve(c.root):void 0,$r=Rt??ae.dirname(l),Ct=[];if(Rt)Ct.push(ae.resolve(Rt,"resources/views/components")),Ct.push(ae.resolve(Rt,"resources/components")),Ct.push(ae.resolve(Rt,"src/components")),Ct.push(ae.resolve(Rt,"components"));Ct.push(ae.resolve(import.meta.dir,"components"));for(let ye of Ct)if(!he.includes(ye))he.push(ye);if(yr){let ye=(ps?c._pluginComponentDirs??[]:c._targetComponentDirs??[]).filter((rt)=>typeof rt==="string"&&rt.length>0);if(ye.length){let rt=he.slice(Ze).map((Je)=>ae.isAbsolute(Je)?Je:ae.resolve($r,Je)).filter((Je)=>!ye.includes(Je)),_t=`${G}\x00${rt.join("\x00")}`,ht=cr.get(_t);if(ht===void 0){ht=!1;for(let Je of rt){for(let dt of ce)if(await r(ae.join(Je,dt))){ht=!0;break}if(ht)break}cr.set(_t,ht)}if(!ht){for(let Je of ye){let dt=he.indexOf(Je);if(dt>=0)he.splice(dt,1)}he.splice(Ze,0,...ye)}}}let Rr=c._pluginComponentDirs;if(Array.isArray(Rr)){for(let ye of Rr)if(typeof ye==="string"&&!he.includes(ye))he.push(ye)}if(c.fallbackComponentsDir&&!he.includes(c.fallbackComponentsDir))he.push(c.fallbackComponentsDir);if(ps){for(let ye of c._targetComponentDirs??[])if(ye&&!he.includes(ye))he.push(ye)}let Mn=c._nativePrimitivesFallback;if(Mn&&!Mn.except.some((ye)=>ye.toLowerCase()===G.toLowerCase())&&!he.includes(Mn.dir))he.push(Mn.dir);let Ar=[...new Set(he.map((ye)=>{if(!ye)return ye;return ae.isAbsolute(ye)?ye:ae.resolve($r,ye)}))];he.length=0,he.push(...Ar);let ds=`${G}\x00${l}\x00${Ar.join("\x00")}`,gs=es.get(ds);if(gs)if(await r(gs))D=gs;else es.delete(ds);if(!D&&(G.startsWith("./")||G.startsWith("../")))D=ae.resolve(ae.dirname(l),`${G}.stx`),ne.push(D);else if(!D)for(let ye of he){if(!ye)continue;for(let rt of ce){let _t=ae.join(ye,rt);if(ne.push(_t),await r(_t)){D=_t;break}}if(D)break;if(!D)try{let rt=await import("fs");if(!rt.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let ht=8,Je=[{path:ye,depth:0}];while(Je.length>0&&!D){let dt=Je.pop();if(dt.depth>=ht)continue;let Ir;try{Ir=rt.readdirSync(dt.path,{withFileTypes:!0})}catch{continue}for(let jn of Ir){if(!jn.isDirectory())continue;if(jn.name==="node_modules"||jn.name.startsWith("."))continue;let Pr=ae.join(dt.path,jn.name);for(let na of ce){let ms=ae.join(Pr,na);if(ne.push(ms),await r(ms)){D=ms;break}}if(D)break;Je.push({path:Pr,depth:dt.depth+1})}}}catch{}if(D)break}if(D)es.set(ds,D)}if(!D||!await r(D))return jo(e,l,ne),Do(e);v.add(D);let te;if(cn.has(D)&&ar.get(D)===To(D))te=cn.get(D);else try{let re=To(D);te=await Bun.file(D).text(),cn.set(D,te),ar.set(D,re)}catch(re){let ce=re instanceof Error?re.message:String(re);return jo(e,l,[D],ce),Do(e)}if(A)for(let re of new Set([...Object.keys(t),...A.reactiveProps??[]])){let ce=re.toLowerCase();if(ce.startsWith("aria-")||ce.startsWith("data-"))continue;let _e=re.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${_e}\\b`).test(te))A.declaredProps.add(re);if(new RegExp(`\\$props\\s*(?:\\.\\s*${_e}\\b|\\[\\s*['"]${_e}['"]\\s*\\])`).test(te)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${_e}['"]`).test(te))A.consumedProps?.add(re)}if(A?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(te))for(let re of A.reactiveProps){if(cu.has(re)||A.consumedProps?.has(re))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${re.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(te))continue;let ce=`${D}\x00${re}`;if(No.has(ce))continue;No.add(ce),console.warn(`[stx] ${ae.basename(D)} reads \`${re}\` with defineProps(), which is not live, but ${ae.basename(l)} binds it (:${re}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${re}').`)}let le=new Set(["__originalFilePath","__importedComponents",Fn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),be={};for(let[re,ce]of Object.entries(a))if(!re.startsWith("__")||le.has(re))be[re]=ce;let ue=E.length>0?{[Kn]:[...E]}:{},Ee=i;if(i.includes("@include")){let{processIncludes:re}=await o("stx/includes",()=>import("./chunk-eajm1dj6.js"));Ee=await re(i,a,l,c,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ee)){let{processComponents:re}=await o("stx/component-renderer",()=>import("./chunk-hnh12d0y.js")),ce={...a,__processedComponents:O,...ue};Ee=await re(Ee,ce,l,c,v);let _e=ce.__stx_preserved_client_expressions;if(Array.isArray(_e)&&_e.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],..._e])]}let Te=[];if(Zc(Ee)){let{processExpressions:re}=await o("stx/expressions",()=>import("./chunk-jten8e2c.js")),ce=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...ue}:E.length>0?{...a,...ue}:a;Ee=re(Ee,ce,l);for(let _e of Ee.matchAll(/\{\{([\s\S]*?)\}\}/g))Te.push(_e[1].trim())}let We=J(Ee),Ke=[],Qe=We.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(re,ce)=>{let _e=We.scripts[Number(ce)]||"",he=_e.match(/^<script\b([^>]*)>/i)?.[1]||"",Ze=he.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Re=!Ze||["module","text/javascript","application/javascript"].includes(Ze),pt=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${he}`);if(!/\bserver\b/i.test(he)&&Re&&!pt)return Ke.push(_e),"";return _e}),{extractSlotContent:Xe}=await o("stx/slots",()=>import("./chunk-ep17rnxb.js")),tt=Xe(Qe),Ge={};if(tt.defaultSlot?.trim())Ge.default=tt.defaultSlot;for(let[re,ce]of tt.namedSlots)Ge[re]=ce.content;let bt=a.__stx_scope_seq??={n:0,key:Ws(String(a.__filename??l))},Wt=Bo(e,process.cwd()),ot=`stx_${(Wt.endsWith(".stx")?Wt.slice(0,-4):Wt).replace(/[^a-zA-Z0-9]/g,"_")}_${++bt.n}_${bt.key}`,Pe={...be,$uid:ot,$native:c._nativeHostAttrs===!0,...t,props:t,slot:Qe,$slots:Ge,__processedComponents:P,__sections:{},__stx_signals_gate:ke(te)||Zc(i),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Te]};if(/import\s/.test(te)){Pe.__importedComponents=new Map(Pe.__importedComponents);let{processESImports:re}=await o("stx/component-renderer",()=>import("./chunk-hnh12d0y.js"));te=await re(te,Pe,D,c,v)}iu(te,Pe);let Vt=te,un=pe(Vt);if(un)Vt=un.content.trim();let rs=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Ut=[...te.matchAll(rs)];for(let[,re,ce]of Ut)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(re))Ne(ce,D,c.strict);let Ye=[],Ht=null,is=Ut.some((re)=>/\bserver\b/.test(re[1]||"")&&/\bcache\b/.test(re[1]||"")),$t=null,at=null,qt=null,pn=0,Zt=null;if(Yl(c),is&&fr>0){let re=Ql({props:t,slot:Ee,slotContext:i.trim()?eu(be):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:c._layerGraph?.layers.map((ce)=>ce.configFile),uid:ot});if(re!==null){$t=`${D}\x00${S(te)}\x00${re}`;let ce=ts.get($t);if(ce){for(let _e of ce.dependencies)v.add(_e);if(ki(a,ce.clientFactories),bt.n+=ce.uidsConsumed,ce.preservedClientExpressions.length>0){let _e=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let he of ce.preservedClientExpressions)_e.add(he);a.__stx_preserved_client_expressions=[..._e]}return ce.output}at=new Set(v),qt=$i(a),pn=bt.n,Zt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Kt=new Set;for(let re of Ut){let ce=re[1]||"",_e=re[2]||"",he=ce.includes("server");if(Be(ce)&&_e.trim())_e=Fe(_e);if(he&&_e){for(let Re of De(_e))Kt.add(Re);try{await F(_e,Pe,D,{onFailure:(Re)=>{if(Re.kind!=="unknown")Ht=Re.kind}})}catch(Re){}}if(!he){let Re=_e.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),pt=Re.includes("{{")&&Re.includes("}}"),vt=Re.includes("{!!")&&Re.includes("!!}");if(pt||vt)Re=Si(Re,Pe,D);let mt=ce.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Ye.push(`<script${mt}>${Re}</script>`)}}let et=J(te).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Xt=et?et[1]:"",os=et?et[2]:"",lt="",se=Xt&&/\bscoped\b/i.test(Xt);if(et)lt=`<style${Xt}>${au(os,Pe,D)}</style>`;let oe=Vt;if(oe=oe.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),et)oe=oe.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let re=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ce=[];if(oe=oe.replace(re,(_e,he)=>{let Ze=he.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ze)ce.push(`<style${Ze[1]}>${Ze[2]}</style>`);return""}),oe=oe.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ce.length>0)lt=`${lt}${ce.join(`
574
+ `)}`}if(i&&oe.includes("{{ text || slot }}"))oe=oe.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>i);let{applySlots:de}=await o("stx/slots",()=>import("./chunk-ep17rnxb.js")),{defaultSlot:we,namedSlots:Ae}=tt,Ve=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Qe),nt=Ye.length>0&&Js(oe)||c._nativeHostAttrs===!0&&Ye.length>0||Ve&&Ye.length>0||Ye.some((re)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(re)),as=(re)=>nt?no(re,ot):re,cs=new Map([...Ae].map(([re,ce])=>[re,{...ce,content:as(ce.content)}]));oe=await de(oe,nt?to(as(we),ot):we,cs,Pe,nt?ot:"");let dn=vi(Ye),Jt=(Array.isArray(Pe.__stx_client_signal_names)?Pe.__stx_client_signal_names:[]).filter((re)=>!Kt.has(re));if(dn.length>0||Jt.length>0)Pe.__stx_client_signal_names=[...new Set([...Jt,...dn])];else delete Pe.__stx_client_signal_names;let Gt=E.filter((re)=>!Kt.has(re)&&!(re in t));if(Gt.length>0)Pe[Kn]=Gt;let $n={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:ae.dirname(D),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||nt||Ye.length===0,defaultLayout:void 0};Pe.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:En}=await o("stx/process",()=>import("./chunk-d1b7h0n5.js")),ut=await En(oe,Pe,D,$n,v),gt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let re of ut.matchAll(/\{\{([\s\S]*?)\}\}/g))gt.add(re[1].trim());if(gt.size>0)a.__stx_preserved_client_expressions=[...gt];let ft=ot,qe=ut;if(nt){let re="";if(Object.keys(t).length>0)try{re=` data-stx-props="${ir(JSON.stringify(t))}"`}catch{}let ce=L?` stx-hydrate="${ir(L)}"`:"",_e=Object.fromEntries(Object.entries(Ge).map(([yt,Et])=>[yt,Boolean(Et)])),he=Object.keys(_e).length>0?` data-stx-slots="${ir(JSON.stringify(_e))}"`:"",Ze=` data-stx-scope="${ft}"${re}${he}${ce}`,Re=ut.slice(Pt(ut)),pt=/^<span(?=[\s/>])/i.test(Re),vt=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Re),mt=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Re),Rn=pt?"span":"div",ls=vt&&c._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':mt&&c._nativeHostAttrs?' style="width:100%;height:100%"':pt||vt?' style="display:contents"':"";qe=yg(ut,Ze)??`<${Rn}${Ze} data-stx-component-wrapper${ls}>${ut}</${Rn}>`;let us=await Promise.all(Ye.map(async(yt)=>{let Et=yt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!Et)return yt;let[,Yt,fs]=Et,Cn=Ao(yt,Pe,D);if(Cn!==null)return Cn;let kt=await uu(fs,D,c.buildMode==="compile"),An=vn(kt.clientCode,Le(Pe)),{vendorStyleTags:Tn}=kt,In=An?`function(__scopeId) {
575
575
  ${An}
576
576
  return (${kt.factoryBody})(__scopeId);
577
577
  }`:kt.factoryBody,Pn=L?null:ks(a,In),On=Pn?`window.__stxComponentFactories[${JSON.stringify(Pn)}](${JSON.stringify(ft)});`:`(${In})(${JSON.stringify(ft)});`;if(L)return`${Tn}<script type="stx/island" data-stx-island="${ft}" data-stx-scoped data-stx-owner="${ft}"${Yt}>${On}</script>`;return`${Tn}<script data-stx-scoped data-stx-run="always" data-stx-owner="${ft}"${Yt}>${On}</script>`}));if(qe=qe+`
@@ -597,7 +597,7 @@ ${ve.yellow}${ve.bold}Message:${ve.reset} ${t}
597
597
  `,b)A+=`
598
598
  ${ve.blue}${ve.bold}Context:${ve.reset}
599
599
  ${ve.dim}${b}${ve.reset}
600
- `;return A}function ge(){cn.clear(),ar.clear(),es.clear(),cr.clear(),lr.clear(),ur.clear(),ts.clear()}function Qh(){return{size:cn.size,maxSize:500}}var or=w(128);async function uu(e,t,i){let n=S(e,t,i),a=or.get(n);if(a){if(js(a.deps))return a;or.delete(n)}let l=bi(e,{filePath:t,projectRoot:process.cwd()}),c=l.code,b=wi(l.styles);c=Dt(c).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-mh4kpnjr.js")),A=[],j=!1;if(v(c)){let G=c;c=await E(G,t,{projectRoot:process.cwd(),minify:i,collectInputs:A}),j=c===G}let{stripStxRuntimeImports:F}=await o("stx/signal-processing",()=>import("./chunk-qcars8ar.js"));c=F(c);let O=I(c),P=nu(O),B=new Set(V(O,!0).split(",").map((G)=>G.trim())),L=`function(__scopeId) {
600
+ `;return A}function ge(){cn.clear(),ar.clear(),es.clear(),cr.clear(),lr.clear(),ur.clear(),ts.clear()}function Qh(){return{size:cn.size,maxSize:500}}var or=w(128);async function uu(e,t,i){let n=S(e,t,i),a=or.get(n);if(a){if(js(a.deps))return a;or.delete(n)}let l=bi(e,{filePath:t,projectRoot:process.cwd()}),c=l.code,b=wi(l.styles);c=Dt(c).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-32mf97nv.js")),A=[],j=!1;if(v(c)){let G=c;c=await E(G,t,{projectRoot:process.cwd(),minify:i,collectInputs:A}),j=c===G}let{stripStxRuntimeImports:F}=await o("stx/signal-processing",()=>import("./chunk-8ye89bw9.js"));c=F(c);let O=I(c),P=nu(O),B=new Set(V(O,!0).split(",").map((G)=>G.trim())),L=`function(__scopeId) {
601
601
  ${ct("const",[...fl,...P],O)}
602
602
  const __scope = window.stx._scopes = window.stx._scopes || {};
603
603
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{W}from"./chunk-j2z7prcv.js";function n(t){return W(t)}
3
+ export{n};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{xe,qs,wg,ey,vg,ty,Lt,p,W,Q,Sn,ke,xg,Si,Sg,ny,_,kg,ry,R,sy}from"./chunk-vbw9jhz2.js";import"./chunk-p65ax8s0.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{kg as applyFilters,ty as clearCustomFilters,xg as clientLoopScopes,qs as defaultFilters,Sn as escapeAttributeValue,p as escapeHtml,W as escapeHtmlValue,Q as escapeInterpolatedHtmlValue,R as evaluateExpression,xe as findMustacheEnd,vg as getAllFilters,Sg as interpolateScriptAttributes,Si as interpolateScriptExpressions,ny as interpolateScriptsInTemplate,_ as processExpressions,wg as registerFilter,ey as registerFilters,Lt as replaceInterpolations,ry as resetRejectedExpressionWarnings,sy as unescapeHtml,ke as usesSignalsInScript};
2
+ import{xe,qs,wg,ey,vg,ty,Lt,p,W,Q,Sn,ke,xg,Si,Sg,ny,_,kg,ry,R,sy}from"./chunk-j2z7prcv.js";import"./chunk-g7hd7eh0.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{kg as applyFilters,ty as clearCustomFilters,xg as clientLoopScopes,qs as defaultFilters,Sn as escapeAttributeValue,p as escapeHtml,W as escapeHtmlValue,Q as escapeInterpolatedHtmlValue,R as evaluateExpression,xe as findMustacheEnd,vg as getAllFilters,Sg as interpolateScriptAttributes,Si as interpolateScriptExpressions,ny as interpolateScriptsInTemplate,_ as processExpressions,wg as registerFilter,ey as registerFilters,Lt as replaceInterpolations,ry as resetRejectedExpressionWarnings,sy as unescapeHtml,ke as usesSignalsInScript};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{En}from"./chunk-89d3h8mp.js";import{q,y,Nt,Mt,Er,m,rl,xi,W,R}from"./chunk-vbw9jhz2.js";import{tn}from"./chunk-xdzy4pm0.js";import{n}from"./chunk-jgx0ex9p.js";import{X}from"./chunk-7vhm0jj5.js";var z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function U(t){let r=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,s;while((s=e.exec(t))!==null)r.push({start:s.index,end:s.index+s[0].length});return r}function N(t,r){return r.some((e)=>t>=e.start&&t<e.end)}function G(t){let r=(t||"").trim();if(!r)return null;if(/[\s>+~,:]/.test(r))return null;let e={},s=r,a=s.match(/^[a-z][\w-]*/i);if(a)e.tag=a[0].toLowerCase(),s=s.slice(a[0].length);while(s.length>0){let i=s.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(i){if(e.attr=i[1],i[3]!==void 0&&i[3]!=="")e.attrValue=i[3];s=s.slice(i[0].length);continue}let o=s.match(/^#([\w-]+)/);if(o){e.id=o[1],s=s.slice(o[0].length);continue}let c=s.match(/^\.([\w-]+)/);if(c){e.className=c[1],s=s.slice(c[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function J(t,r){if(r.attr){if(!(r.attrValue===void 0?new RegExp(`\\b${r.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${r.attr}\\s*=\\s*(["'])\\s*${r.attrValue}\\s*\\1`,"i")).test(t))return!1}if(r.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${r.id}\\s*\\1`,"i").test(t))return!1}if(r.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(r.className))return!1}return!0}function P(t,r="main"){let e=G(r);if(!e)return null;let s=/<([a-z][\w-]*)\b([^>]*)>/gi,a=U(t),i;while((i=s.exec(t))!==null){if(N(i.index,a))continue;let o=i[1].toLowerCase(),c=i[2]||"";if(c.trimEnd().endsWith("/")||z.has(o))continue;if(e.tag&&e.tag!==o)continue;if(!J(c,e))continue;let l=i[0],u=i.index+l.length,f=new RegExp(`<(/?)${o}\\b([^>]*)>`,"gi");f.lastIndex=u;let p=1,h;while((h=f.exec(t))!==null){if(N(h.index,a))continue;let S=h[1]==="/";if(!S&&(h[2]||"").trimEnd().endsWith("/"))continue;if(p+=S?-1:1,p===0)return{openTag:l,openIndex:i.index,start:u,end:h.index,tagName:o}}return null}return null}var gt="private, no-store";function On(t){return t.replace(/&#(\d+);/g,(r,e)=>D(Number(e),r)).replace(/&#x([0-9a-f]+);/gi,(r,e)=>D(Number.parseInt(e,16),r)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function D(t,r){if(!Number.isInteger(t)||t<0||t>1114111)return r;try{return String.fromCodePoint(t)}catch{return r}}function Ee(t){return t.headers.get("X-STX-Router")==="true"}function K(t,r){if(!t)return r;return t.split(",").some((s)=>s.trim().toLowerCase()===r.toLowerCase())?t:`${t}, ${r}`}function j(t){return{Vary:K(t,"X-STX-Router")}}function k(t){return t.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Nn(t){let r=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy,s=y(r,(i,o)=>(e.lastIndex=o,e.exec(i)?e.lastIndex:-1)),a=[];for(let{token:i}of s){if(/^<title\b/i.test(i)){a.push(`<title>${k(i.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let o=Object.create(null),c=i.replace(/^<\w+\b|>$/g,"");for(let l of c.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let u=l[1].toLowerCase();if(!(u in o))o[u]=l[2]??l[3]??l[4]??""}if(/^<meta\b/i.test(i)){let l=o.property?"property":"name",u=On(o[l]??"").toLowerCase();if(u==="description"||/^(?:og|twitter):[\w:]+$/.test(u))a.push(`<meta ${l}="${n(u)}" content="${k(o.content??"")}">`)}else{let l=On(o.rel??"").toLowerCase();if(l==="canonical"||l==="alternate"&&o.hreflang)a.push(`<link rel="${l}" href="${k(o.href??"")}"${l==="alternate"?` hreflang="${k(o.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${a.join("")}</template>
3
- `}import O from"path";var Y="stx-page-head:",Z=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function Q(){let t=X()?"dev":"prod",r=v[t];if(r!==null)return r;try{let e=import.meta.require("./chunk-7m0r7mq9.js"),s=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${s()}</script>`}catch{v[t]=""}return v[t]}async function ua(t,r){if(r===!1)return null;if(r&&typeof r==="string"){let s=O.resolve(t,r);if(await Bun.file(s).exists())return s;return null}let e=O.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function yo(t,r){try{let e=await Bun.file(t).text(),s=e,a=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(a)s=a[1].trim();let i=tn(e),o=[...i.client.map((g)=>g.fullTag),...i.signals.map((g)=>g.fullTag)],c=[],l=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=l.exec(e))!==null)c.push(u[0]);let f=s;for(let g of i.server)f=f.replace(g.fullTag,"");for(let g of i.client)f=f.replace(g.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let p="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,p).replace(/<slot\s*>\s*<\/slot>/gi,p),!f.includes(p))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:S,defaultConfig:w,loadStxConfig:b}=await import("./chunk-qb3c05qq.js"),E=await b(),d={__filename:t,__dirname:O.dirname(t)};for(let g of o){let A=g.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(A&&!g.includes("client")&&!g.includes('type="module"'))await S(A[1],d,t)}let x=await h(f,d,t,{...w,...E,...r},new Set),C=x.indexOf(p);if(C===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:x.substring(0,C),afterSlot:x.substring(C+p.length),filePath:t,shellScripts:o,shellStyles:c}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function Xr(t,r,e){let s,a="",i=r.match(Z);if(i){r=r.replace(i[0],"");try{let f=Buffer.from(i[1],"base64").toString("utf8"),p=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(p)s=p[1].trim();a=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let o=e||s||"stx App",c=Q(),l="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
2
+ import{En}from"./chunk-89d3h8mp.js";import{q,y,Nt,Mt,Er,m,rl,xi,W,R}from"./chunk-j2z7prcv.js";import{tn}from"./chunk-5xvxrnfh.js";import{n}from"./chunk-jap212a4.js";import{X}from"./chunk-7vhm0jj5.js";var z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function U(t){let r=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,s;while((s=e.exec(t))!==null)r.push({start:s.index,end:s.index+s[0].length});return r}function N(t,r){return r.some((e)=>t>=e.start&&t<e.end)}function G(t){let r=(t||"").trim();if(!r)return null;if(/[\s>+~,:]/.test(r))return null;let e={},s=r,a=s.match(/^[a-z][\w-]*/i);if(a)e.tag=a[0].toLowerCase(),s=s.slice(a[0].length);while(s.length>0){let i=s.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(i){if(e.attr=i[1],i[3]!==void 0&&i[3]!=="")e.attrValue=i[3];s=s.slice(i[0].length);continue}let o=s.match(/^#([\w-]+)/);if(o){e.id=o[1],s=s.slice(o[0].length);continue}let c=s.match(/^\.([\w-]+)/);if(c){e.className=c[1],s=s.slice(c[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function J(t,r){if(r.attr){if(!(r.attrValue===void 0?new RegExp(`\\b${r.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${r.attr}\\s*=\\s*(["'])\\s*${r.attrValue}\\s*\\1`,"i")).test(t))return!1}if(r.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${r.id}\\s*\\1`,"i").test(t))return!1}if(r.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(r.className))return!1}return!0}function P(t,r="main"){let e=G(r);if(!e)return null;let s=/<([a-z][\w-]*)\b([^>]*)>/gi,a=U(t),i;while((i=s.exec(t))!==null){if(N(i.index,a))continue;let o=i[1].toLowerCase(),c=i[2]||"";if(c.trimEnd().endsWith("/")||z.has(o))continue;if(e.tag&&e.tag!==o)continue;if(!J(c,e))continue;let l=i[0],u=i.index+l.length,f=new RegExp(`<(/?)${o}\\b([^>]*)>`,"gi");f.lastIndex=u;let p=1,h;while((h=f.exec(t))!==null){if(N(h.index,a))continue;let S=h[1]==="/";if(!S&&(h[2]||"").trimEnd().endsWith("/"))continue;if(p+=S?-1:1,p===0)return{openTag:l,openIndex:i.index,start:u,end:h.index,tagName:o}}return null}return null}var gt="private, no-store";function On(t){return t.replace(/&#(\d+);/g,(r,e)=>D(Number(e),r)).replace(/&#x([0-9a-f]+);/gi,(r,e)=>D(Number.parseInt(e,16),r)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function D(t,r){if(!Number.isInteger(t)||t<0||t>1114111)return r;try{return String.fromCodePoint(t)}catch{return r}}function Ee(t){return t.headers.get("X-STX-Router")==="true"}function K(t,r){if(!t)return r;return t.split(",").some((s)=>s.trim().toLowerCase()===r.toLowerCase())?t:`${t}, ${r}`}function j(t){return{Vary:K(t,"X-STX-Router")}}function k(t){return t.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Nn(t){let r=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy,s=y(r,(i,o)=>(e.lastIndex=o,e.exec(i)?e.lastIndex:-1)),a=[];for(let{token:i}of s){if(/^<title\b/i.test(i)){a.push(`<title>${k(i.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let o=Object.create(null),c=i.replace(/^<\w+\b|>$/g,"");for(let l of c.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let u=l[1].toLowerCase();if(!(u in o))o[u]=l[2]??l[3]??l[4]??""}if(/^<meta\b/i.test(i)){let l=o.property?"property":"name",u=On(o[l]??"").toLowerCase();if(u==="description"||/^(?:og|twitter):[\w:]+$/.test(u))a.push(`<meta ${l}="${n(u)}" content="${k(o.content??"")}">`)}else{let l=On(o.rel??"").toLowerCase();if(l==="canonical"||l==="alternate"&&o.hreflang)a.push(`<link rel="${l}" href="${k(o.href??"")}"${l==="alternate"?` hreflang="${k(o.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${a.join("")}</template>
3
+ `}import O from"path";var Y="stx-page-head:",Z=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function Q(){let t=X()?"dev":"prod",r=v[t];if(r!==null)return r;try{let e=import.meta.require("./chunk-7m0r7mq9.js"),s=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${s()}</script>`}catch{v[t]=""}return v[t]}async function ua(t,r){if(r===!1)return null;if(r&&typeof r==="string"){let s=O.resolve(t,r);if(await Bun.file(s).exists())return s;return null}let e=O.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function yo(t,r){try{let e=await Bun.file(t).text(),s=e,a=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(a)s=a[1].trim();let i=tn(e),o=[...i.client.map((g)=>g.fullTag),...i.signals.map((g)=>g.fullTag)],c=[],l=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=l.exec(e))!==null)c.push(u[0]);let f=s;for(let g of i.server)f=f.replace(g.fullTag,"");for(let g of i.client)f=f.replace(g.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let p="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,p).replace(/<slot\s*>\s*<\/slot>/gi,p),!f.includes(p))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:S,defaultConfig:w,loadStxConfig:b}=await import("./chunk-ya7m4wgr.js"),E=await b(),d={__filename:t,__dirname:O.dirname(t)};for(let g of o){let A=g.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(A&&!g.includes("client")&&!g.includes('type="module"'))await S(A[1],d,t)}let x=await h(f,d,t,{...w,...E,...r},new Set),C=x.indexOf(p);if(C===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:x.substring(0,C),afterSlot:x.substring(C+p.length),filePath:t,shellScripts:o,shellStyles:c}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function Xr(t,r,e){let s,a="",i=r.match(Z);if(i){r=r.replace(i[0],"");try{let f=Buffer.from(i[1],"base64").toString("utf8"),p=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(p)s=p[1].trim();a=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let o=e||s||"stx App",c=Q(),l="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
4
4
  <html lang="en">
5
5
  <head>
6
6
  <meta charset="UTF-8">
@@ -28,5 +28,5 @@ ${c}
28
28
  `));if(i.length>0)d.push(i.filter((x)=>!u.has(x)).join(`
29
29
  `));if(w.length>0)d.push(w.filter((x)=>!u.has(x)).join(`
30
30
  `));return d.push(S),d.join(`
31
- `)}import T from"fs";import H from"path";function pa(t,r,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:r,outputDir:e}}function fa(t,r){let e=H.join(r,"manifest.json");T.writeFileSync(e,JSON.stringify(t,null,2))}function ga(t){let r=H.join(t,"manifest.json");if(!T.existsSync(r))return null;try{let e=T.readFileSync(r,"utf-8"),s=JSON.parse(e);if(s.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${s.version}`),null;return s}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,r,e={}){let s=`${encodeURIComponent(t)}=${encodeURIComponent(r)}`;if(e.maxAge!==void 0)s+=`; Max-Age=${e.maxAge}`;if(e.expires)s+=`; Expires=${e.expires.toUTCString()}`;if(e.path)s+=`; Path=${e.path}`;if(e.domain)s+=`; Domain=${e.domain}`;if(e.secure)s+="; Secure";if(e.httpOnly)s+="; HttpOnly";if(e.sameSite)s+=`; SameSite=${e.sameSite}`;return s}async function et(t){let r=t.headers.get("content-type")||"",e={},s=(a,i)=>{let o=e[a];if(o===void 0)e[a]=i;else if(Array.isArray(o))o.push(i);else e[a]=[o,i]};if(r.includes("multipart/form-data")){let a=await t.formData();for(let[i,o]of a.entries())if(typeof o==="string")s(i,o);return e}if(r.includes("application/x-www-form-urlencoded")){for(let[a,i]of new URLSearchParams(await t.text()).entries())s(a,i);return e}return e}function bo(t){if(!t)return!1;let r=t.toUpperCase();return r!=="GET"&&r!=="HEAD"}async function V(t,r={}){let e=r.request,s=r.method??e?.method;if(!e||!bo(s))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let a={};try{a=await et(e)}catch{}let i=await t.action({request:e,form:a,params:r.params??{},query:t.query??{},cookies:r.cookies??{}});if(i&&typeof i==="object"){let o=i,c=nt(o.cookies),l=o.redirect;if(typeof l==="string"&&l)return{redirect:l,ran:!0,...c.length>0?{cookies:c}:{}};let{cookies:u,redirect:f,...p}=o;if(Object.assign(t,p),c.length>0)return{ran:!0,cookies:c}}return{ran:!0}}function nt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let r=[];for(let[e,s]of Object.entries(t)){if(!e)continue;if(typeof s==="string"){r.push(M(e,s));continue}if(s&&typeof s==="object"){let a=s;if(typeof a.value!=="string")continue;r.push(M(e,a.value,a))}}return r}function ma(t,r=[],e){let s=new Headers({Location:t,"Cache-Control":"no-store"});for(let a of r)s.append("Set-Cookie",a);for(let[a,i]of Object.entries(e??{}))if(a.toLowerCase()!=="location")s.set(a,i);return new Response(null,{status:303,headers:s})}async function Mn(t,r={}){let{html:e,context:s,redirect:a,cookies:i}=await rt(t,r),o=Nt(s),c=Mt(s);if(a)return{html:e,redirect:a,cookies:i,status:o,headers:c};let{extractStreamBoundaries:l}=await import("./chunk-p2e02hh7.js"),u=l(s),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:p}=await import("./chunk-ndah5rvs.js"),{defaultConfig:h}=await import("./chunk-fpn5txnm.js"),S=s.streamBoundaries||{},w={...h,autoShell:!1},b=Object.keys(f).map((d)=>({id:d,render:async()=>{let x=typeof S[d]==="function"?await S[d]():void 0;return p(f[d],{...s,$boundary:x},t.sourceFile,w,new Set)}})),E=new Set(b.map((d)=>d.id));u=[...(u||[]).filter((d)=>!E.has(d.id)),...b]}return{html:e,boundaries:u&&u.length>0?u:void 0,cookies:i,status:o,headers:c}}async function rt(t,r){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...r};if(!t.hasServerScripts&&!xi(t.html))return{html:t.html,context:e};for(let o of t.serverScriptContent)try{await m(o,e,t.sourceFile)}catch(c){if(r.__stx_strict_hydration)throw c;console.warn(`[stx] Server script error in ${t.sourceFile}:`,c)}let s=await V(e,{request:r.request,method:r.method,params:r.params??{},cookies:r.cookies??{}}),a=(o)=>{let c=o.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),l=Er(e);if(!l)return c;let u=c.indexOf("</head>");return u<0?l+c:c.slice(0,u)+l+c.slice(u)};if(s.redirect)return{html:t.html,context:e,redirect:s.redirect,cookies:s.cookies};if(!xi(t.html))return{html:a(t.html),context:e,cookies:s.cookies};let i=new Map;for(let[o,c]of Object.entries(t.placeholders))if(c.expression)try{let l=R(c.expression,e);if(c.type==="raw")i.set(o,l!==void 0&&l!==null?String(l):"");else i.set(o,l!==void 0&&l!==null?W(String(l)):"")}catch(l){if(r.__stx_strict_hydration)throw l;i.set(o,"")}return{html:a(rl(t.html,i)),context:e,cookies:s.cookies}}
31
+ `)}import T from"fs";import H from"path";function pa(t,r,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:r,outputDir:e}}function fa(t,r){let e=H.join(r,"manifest.json");T.writeFileSync(e,JSON.stringify(t,null,2))}function ga(t){let r=H.join(t,"manifest.json");if(!T.existsSync(r))return null;try{let e=T.readFileSync(r,"utf-8"),s=JSON.parse(e);if(s.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${s.version}`),null;return s}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,r,e={}){let s=`${encodeURIComponent(t)}=${encodeURIComponent(r)}`;if(e.maxAge!==void 0)s+=`; Max-Age=${e.maxAge}`;if(e.expires)s+=`; Expires=${e.expires.toUTCString()}`;if(e.path)s+=`; Path=${e.path}`;if(e.domain)s+=`; Domain=${e.domain}`;if(e.secure)s+="; Secure";if(e.httpOnly)s+="; HttpOnly";if(e.sameSite)s+=`; SameSite=${e.sameSite}`;return s}async function et(t){let r=t.headers.get("content-type")||"",e={},s=(a,i)=>{let o=e[a];if(o===void 0)e[a]=i;else if(Array.isArray(o))o.push(i);else e[a]=[o,i]};if(r.includes("multipart/form-data")){let a=await t.formData();for(let[i,o]of a.entries())if(typeof o==="string")s(i,o);return e}if(r.includes("application/x-www-form-urlencoded")){for(let[a,i]of new URLSearchParams(await t.text()).entries())s(a,i);return e}return e}function bo(t){if(!t)return!1;let r=t.toUpperCase();return r!=="GET"&&r!=="HEAD"}async function V(t,r={}){let e=r.request,s=r.method??e?.method;if(!e||!bo(s))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let a={};try{a=await et(e)}catch{}let i=await t.action({request:e,form:a,params:r.params??{},query:t.query??{},cookies:r.cookies??{}});if(i&&typeof i==="object"){let o=i,c=nt(o.cookies),l=o.redirect;if(typeof l==="string"&&l)return{redirect:l,ran:!0,...c.length>0?{cookies:c}:{}};let{cookies:u,redirect:f,...p}=o;if(Object.assign(t,p),c.length>0)return{ran:!0,cookies:c}}return{ran:!0}}function nt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let r=[];for(let[e,s]of Object.entries(t)){if(!e)continue;if(typeof s==="string"){r.push(M(e,s));continue}if(s&&typeof s==="object"){let a=s;if(typeof a.value!=="string")continue;r.push(M(e,a.value,a))}}return r}function ma(t,r=[],e){let s=new Headers({Location:t,"Cache-Control":"no-store"});for(let a of r)s.append("Set-Cookie",a);for(let[a,i]of Object.entries(e??{}))if(a.toLowerCase()!=="location")s.set(a,i);return new Response(null,{status:303,headers:s})}async function Mn(t,r={}){let{html:e,context:s,redirect:a,cookies:i}=await rt(t,r),o=Nt(s),c=Mt(s);if(a)return{html:e,redirect:a,cookies:i,status:o,headers:c};let{extractStreamBoundaries:l}=await import("./chunk-y0zhfyw4.js"),u=l(s),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:p}=await import("./chunk-d1b7h0n5.js"),{defaultConfig:h}=await import("./chunk-7hf37fqp.js"),S=s.streamBoundaries||{},w={...h,autoShell:!1},b=Object.keys(f).map((d)=>({id:d,render:async()=>{let x=typeof S[d]==="function"?await S[d]():void 0;return p(f[d],{...s,$boundary:x},t.sourceFile,w,new Set)}})),E=new Set(b.map((d)=>d.id));u=[...(u||[]).filter((d)=>!E.has(d.id)),...b]}return{html:e,boundaries:u&&u.length>0?u:void 0,cookies:i,status:o,headers:c}}async function rt(t,r){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...r};if(!t.hasServerScripts&&!xi(t.html))return{html:t.html,context:e};for(let o of t.serverScriptContent)try{await m(o,e,t.sourceFile)}catch(c){if(r.__stx_strict_hydration)throw c;console.warn(`[stx] Server script error in ${t.sourceFile}:`,c)}let s=await V(e,{request:r.request,method:r.method,params:r.params??{},cookies:r.cookies??{}}),a=(o)=>{let c=o.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),l=Er(e);if(!l)return c;let u=c.indexOf("</head>");return u<0?l+c:c.slice(0,u)+l+c.slice(u)};if(s.redirect)return{html:t.html,context:e,redirect:s.redirect,cookies:s.cookies};if(!xi(t.html))return{html:a(t.html),context:e,cookies:s.cookies};let i=new Map;for(let[o,c]of Object.entries(t.placeholders))if(c.expression)try{let l=R(c.expression,e);if(c.type==="raw")i.set(o,l!==void 0&&l!==null?String(l):"");else i.set(o,l!==void 0&&l!==null?W(String(l)):"")}catch(l){if(r.__stx_strict_hydration)throw l;i.set(o,"")}return{html:a(rl(t.html,i)),context:e,cookies:s.cookies}}
32
32
  export{gt,On,Ee,j,Nn,ua,yo,Xr,qe,da,Ke,Te,pa,fa,ga,bo,ma,Mn};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{xo,fh,gh}from"./chunk-0kwpehta.js";import"./chunk-w2btre0d.js";import"./chunk-d5h2qak7.js";import"./chunk-4y6hes3h.js";import"./chunk-xjk5sxkz.js";import"./chunk-aqvh8wx5.js";import"./chunk-2fj5zev7.js";import"./chunk-qca4e1ms.js";import"./chunk-fp4291zm.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import"./chunk-j2z7prcv.js";import"./chunk-g7hd7eh0.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{gh as clearComposableCache,fh as getComposableScript,xo as listComposableModules};