@stacksjs/stx 0.2.288 → 0.2.289
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.
- package/dist/builtins/image-delivery.js +25 -0
- package/dist/{chunk-sxderfaa.js → chunk-0b8032q1.js} +1 -1
- package/dist/{chunk-72c7gyqc.js → chunk-0xnvkqn6.js} +1 -1
- package/dist/{chunk-rb87b7kr.js → chunk-2ctw99gz.js} +1 -1
- package/dist/{chunk-ak06mywr.js → chunk-2s0jm6fq.js} +1 -1
- package/dist/{chunk-pv9apyrr.js → chunk-31108nwx.js} +1 -1
- package/dist/{chunk-kws4rewx.js → chunk-37zxqngs.js} +1 -1
- package/dist/{chunk-srcbkg7g.js → chunk-3jqcv3ve.js} +1 -1
- package/dist/{chunk-a9fxxwrv.js → chunk-4hsvmefz.js} +1 -1
- package/dist/{chunk-qww39be9.js → chunk-508p29a1.js} +1 -1
- package/dist/{chunk-96cqevhm.js → chunk-50e0319x.js} +1 -1
- package/dist/{chunk-vwzqg4fh.js → chunk-9zdyma99.js} +1 -1
- package/dist/{chunk-1t9g3mhg.js → chunk-adr8nyhc.js} +1 -1
- package/dist/{chunk-evfct6hb.js → chunk-amwtttwf.js} +1 -1
- package/dist/{chunk-ch31zddx.js → chunk-besxa233.js} +2 -2
- package/dist/{chunk-adkjxvy6.js → chunk-bkg7622z.js} +1 -1
- package/dist/chunk-bq6q6pjx.js +3 -0
- package/dist/{chunk-k4jt9t4p.js → chunk-btqfj5be.js} +1 -1
- package/dist/{chunk-ayaz0wcj.js → chunk-ckwq6fkw.js} +1 -1
- package/dist/{chunk-91ffbzmh.js → chunk-ddqynjve.js} +1 -1
- package/dist/{chunk-bphx7ngb.js → chunk-dw57wss6.js} +1 -1
- package/dist/{chunk-ee2tfpec.js → chunk-ecgf48zt.js} +2 -2
- package/dist/{chunk-2rfxs7zm.js → chunk-fcedzn8w.js} +1 -1
- package/dist/{chunk-rjqfa3g8.js → chunk-fvej04d8.js} +1 -1
- package/dist/{chunk-pb16azfa.js → chunk-gpspx24d.js} +1 -1
- package/dist/{chunk-0896td83.js → chunk-gxghqvws.js} +1 -1
- package/dist/{chunk-811cxzn4.js → chunk-gyd4cb9m.js} +1 -1
- package/dist/{chunk-qj2s3r1w.js → chunk-havegv3v.js} +16 -16
- package/dist/{chunk-vtjfv7kg.js → chunk-hxjkjm6k.js} +1 -1
- package/dist/{chunk-4tr92e0v.js → chunk-j5n1td3p.js} +1 -1
- package/dist/{chunk-1g6pvs7k.js → chunk-k4aq88mj.js} +1 -1
- package/dist/{chunk-3p0n9ryv.js → chunk-kvrjfqxd.js} +1 -1
- package/dist/{chunk-xvndd7h6.js → chunk-nh0frxtq.js} +1 -1
- package/dist/{chunk-cqzqfm7m.js → chunk-nka77z47.js} +1 -1
- package/dist/{chunk-06706a9a.js → chunk-nkpj1a74.js} +1 -1
- package/dist/{chunk-hv5v6vc2.js → chunk-p5b0r6fn.js} +1 -1
- package/dist/{chunk-v2z3creg.js → chunk-pne8pq50.js} +1 -1
- package/dist/{chunk-hqh7x9h5.js → chunk-pvb0rf99.js} +1 -1
- package/dist/{chunk-zfnabevq.js → chunk-r84zvf0z.js} +1 -1
- package/dist/{chunk-jyc9eha6.js → chunk-rth88zfm.js} +1 -1
- package/dist/{chunk-sag55qv7.js → chunk-s5f9bj8h.js} +1 -1
- package/dist/{chunk-z6azwfb4.js → chunk-t2w7twke.js} +1 -1
- package/dist/{chunk-13tawjw8.js → chunk-t2wnvvec.js} +8 -8
- package/dist/{chunk-e63a220e.js → chunk-tqgevvqn.js} +1 -1
- package/dist/{chunk-978faewt.js → chunk-vrnn3pqk.js} +1 -1
- package/dist/{chunk-34qkshwh.js → chunk-yhqheg5m.js} +1 -1
- package/dist/{chunk-5j9tvhpq.js → chunk-zy4zf7hy.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +2 -2
- package/package.json +6 -6
- package/dist/chunk-t5c7rk0h.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$r as X2,As as Q8,Cr as N2,Fr as Z8,Hr as Q0,Ks as K7,Lr as M2,Ls as U7,Mr as J8,Or as o0,Pr as X8,Wr as r7,Xr as e,Yr as q0,Zr as T0,_r as U9,as as U0,bs as G9,rr as Y0,tr as Y9,vr as Q9,ws as Y8}from"./chunk-ymc99r5x.js";import{Rs as i2}from"./chunk-dcxtrqfy.js";import{Zs as x0,_s as h8}from"./chunk-qjkzpd68.js";import{$s as H6}from"./chunk-
|
|
2
|
+
import{$r as X2,As as Q8,Cr as N2,Fr as Z8,Hr as Q0,Ks as K7,Lr as M2,Ls as U7,Mr as J8,Or as o0,Pr as X8,Wr as r7,Xr as e,Yr as q0,Zr as T0,_r as U9,as as U0,bs as G9,rr as Y0,tr as Y9,vr as Q9,ws as Y8}from"./chunk-ymc99r5x.js";import{Rs as i2}from"./chunk-dcxtrqfy.js";import{Zs as x0,_s as h8}from"./chunk-qjkzpd68.js";import{$s as H6}from"./chunk-bq6q6pjx.js";import{ct as u1,dt as x1,et as z8,ft as T1,ht as V1,it as b8,jt as y8,yt as q8}from"./chunk-0xnvkqn6.js";import{Bt as H7,Ct as j7,Et as W2,zt as W7}from"./chunk-fv923f7g.js";import{Ft as K8,Jt as o2,Lt as w8}from"./chunk-2e6xafcm.js";import{Vt as Z1}from"./chunk-nygtwffe.js";import{Yt as U8}from"./chunk-461br5nn.js";import{$t as E8,Zt as G3,_t as x8,au as h1,eu as g8,fu as p$,gu as $6,iu as q4,lu as f6}from"./chunk-h7v70dbp.js";import{Gu as x5,Xu as G8,Zu as zG,_u as t9,av as z2,wu as t5,zu as u4}from"./chunk-drbbt69f.js";import{fv as B7}from"./chunk-kb5j08tq.js";import{kv as u}from"./chunk-2vza9m2x.js";import b1 from"path";import k2 from"fs";var m$=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"]),l$={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"},p8=new Set(["ctrl","alt","shift","meta"]),i$={left:0,middle:1,right:2};function c$($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let J of $){let X=J.toLowerCase();if(X==="prevent")Z.prevent=!0;else if(X==="stop")Z.stop=!0;else if(X==="once")Z.once=!0;else if(X==="capture")Z.capture=!0;else if(X==="self")Z.self=!0;else if(X==="passive")Z.passive=!0;else if(p8.has(X))Z.systemKeys.push(X);else if(X in i$)Z.mouse=X;else if(X in l$||/^[a-z]$/.test(X))Z.keys.push(l$[X]||X.toUpperCase());else if(X.startsWith("debounce")){let Y=X.match(/debounce(?:\.(\d+))?/);Z.debounce=Y?.[1]?Number.parseInt(Y[1],10):300}else if(X.startsWith("throttle")){let Y=X.match(/throttle(?:\.(\d+))?/);Z.throttle=Y?.[1]?Number.parseInt(Y[1],10):300}}return Z}function n$($){let Z=[],J=0,X=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=X.exec($))!==null){let[Q,G,z]=Y,q=Y.index,K=q+Q.length,U=`__stx_evt_${J++}`,W=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(z))!==null){let[,V,F]=j,O=V.split("."),_=O[0];if(!m$.has(_))continue;W.push({attribute:`@${V}`,event:_,handler:F,modifiers:c$(O.slice(1)),elementId:U})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(z))!==null){let[,V,F]=j,O=V.split("."),_=O[0];if(!m$.has(_))continue;W.push({attribute:`@${V}`,event:_,handler:F,modifiers:c$(O.slice(1)),elementId:U})}if(W.length>0)Z.push({originalTag:Q,elementId:U,events:W,startIndex:q,endIndex:K})}return Z}function i8($){let Z=[],{modifiers:J}=$;if(J.self)Z.push("if ($event.target !== $el) return");for(let X of J.systemKeys)Z.push(`if (!$event.${X}Key) return`);if(J.keys.length>0){let X=J.keys.map((Y)=>`$event.key === '${Y}'`).join(" || ");Z.push(`if (!(${X})) return`)}if(J.mouse!==null){let X=i$[J.mouse];Z.push(`if ($event.button !== ${X}) return`)}if(J.prevent)Z.push("$event.preventDefault()");if(J.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function n8($,Z){let J=$;if(Z.debounce!==null)J=`__stx_debounce(() => { ${J} }, ${Z.debounce})`;else if(Z.throttle!==null)J=`__stx_throttle(() => { ${J} }, ${Z.throttle})`;return J}function P9($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function o8($){let{modifiers:Z}=$,J=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),X=i8($),Y=n8(P9($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(Z.passive)Q.push("passive: true");let G=Q.length>0?`, { ${Q.join(", ")} }`:"",z=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
|
|
3
3
|
(function() {
|
|
4
4
|
var $el = document.getElementById('${J}');
|
|
5
5
|
if (!$el) return;
|
|
@@ -3307,9 +3307,9 @@ ${u7($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
|
|
|
3307
3307
|
} finally {
|
|
3308
3308
|
if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
|
|
3309
3309
|
}
|
|
3310
|
-
})();`}function fX($,Z){if(G1($)){let Y=G1($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};return{html:C1($,(Q,G)=>`<body${G} data-stx-scope="${Z}">`),mergedIntoExisting:null,stamped:!0}}let J=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(J){let Y=(J[2]+J[3]).match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};let Q=J[1],G=J[2],z=J[3];return{html:`${Q}${G} data-stx-scope="${Z}"${z}${$.slice(J[0].length)}`,mergedIntoExisting:null,stamped:!0}}return{html:$,mergedIntoExisting:null,stamped:!1}}var h7=0,eU=new u1(500),l7=new Set;function $W(){l7.clear()}function xX($){if($.__onceStore instanceof Set)return $.__onceStore;return l7}async function S5($,Z,J,X,Y,Q=new Set){let G=X.partialsDir||W0.join(W0.dirname(J),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let z=SX($,"@partial","@include"),q=xX(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(V,F,O)=>{let _=F.trim(),L=`${J}:${_}`;if(q.has(L))return"";return q.add(L),F});{let V=/@includeIf\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")")L--;w++}if(L!==0)break;let R=z.substring(_+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){V.lastIndex=w;continue}let M=D[1],I=K(M,G,J),N="";if(I&&await Bun.file(I).exists())Y.add(I),N=`@include(${R})`;z=z.substring(0,O)+N+z.substring(w),V.lastIndex=0}}for(let[V,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let O=new RegExp(`${V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),_;while((_=O.exec(z))!==null){let L=_.index,w=L+_[0].length-1,R=1,D=w+1;while(D<z.length&&R>0){if(z[D]==="(")R++;else if(z[D]===")")R--;D++}if(R!==0)break;let M=z.substring(w+1,D-1),I=C5(M,0);if(I===-1){O.lastIndex=D;continue}let N=M.substring(0,I).trim(),A=M.substring(I+1).trim(),T=A.match(/^\s*['"]([^'"]+)['"]/);if(!T){O.lastIndex=D;continue}let k=T[1],y=A.substring(T[0].length),E,b=C5(y,0);if(b!==-1)E=y.substring(b+1).trim();try{let C=`Boolean(${N})`,v;if(q0(C)){let x=U0(C,Object.keys(Z));v=Boolean(x(...Object.values(Z)))}else v=Boolean(e(C,Z));let P=F?!v:v,g="";if(P){let x=K(k,G,J);if(x&&await Bun.file(x).exists())Y.add(x);g=`@include('${k}'${E?`, ${E}`:""})`}z=z.substring(0,L)+g+z.substring(D),O.lastIndex=0}catch(C){let v=C instanceof Error?C.message:String(C),P=j0("Include",`Error evaluating ${V} condition: ${v}`,J,$,L);z=z.substring(0,L)+P+z.substring(D),O.lastIndex=0}}}{let V=/@each\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=z.substring(_+1,w),D=z.substring(O,w+1),M=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!M){V.lastIndex=0,z=z.replace(D,"");continue}let[,I,N,A,T]=M;try{let k,y=N.trim();if(q0(y))k=U0(y,Object.keys(Z))(...Object.values(Z));else k=e(y,Z);let E="";if(Array.isArray(k)&&k.length>0)for(let b of k){let C={...Z,[A]:b},v=await H(I,C,$,O);E+=v}else if(T)E=await H(T,{},$,O);z=z.substring(0,O)+E+z.substring(w+1),V.lastIndex=0}catch(k){let y=k instanceof Error?k.message:String(k);z=z.substring(0,O)+j0("Each",`Error in @each: ${y}`,J,$,O)+z.substring(w+1),V.lastIndex=0}}}{let V=/@includeFirst\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=z.substring(_+1,w),D=z.substring(O,w+1),M=R.match(/^\s*(\[[^\]]+\])/);if(!M){V.lastIndex=0,z=z.replace(D,"");continue}let I=M[1],N=R.slice(M[0].length),A,T=N.match(/^\s*,\s*\{/);if(T){N=N.slice(T[0].length-1);let E=1,b=1;while(b<N.length&&E>0){if(N[b]==="{")E++;else if(N[b]==="}"){if(E--,E===0)break}b++}A=N.substring(0,b+1),N=N.slice(b+1)}let k,y=N.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)k=y[1];try{let E=JSON.parse(I.replace(/'/g,'"')),b={};if(A)try{b=T0(A,Z)}catch(v){let P=v instanceof Error?v.message:String(v);if(X.debug){let g=j0("Include",`Error parsing includeFirst variables: ${P}`,J,$,O,D);z=z.replace(D,()=>g)}else z=z.replace(D,()=>k||"");continue}let C=!1;for(let v of E){let P=K(v,G,J);if(!P)continue;if(await s(P)){let g=await H(v,b,$,O);z=z.replace(D,()=>g),C=!0;break}}if(!C)if(k!==void 0)z=z.replace(D,()=>k);else if(X.debug){let v=j0("Include",`None of the includeFirst paths exist: ${I}`,J,$,O,D);z=z.replace(D,()=>v)}else z=z.replace(D,"")}catch(E){let b=E instanceof Error?E.message:String(E),C=j0("Include",`Error processing @includeFirst: ${b}`,J,$,O,D);z=z.replace(D,()=>C)}V.lastIndex=0}}function K(V,F,O){try{let _=V;if(!V.endsWith(".stx"))_=`${V}.stx`;let L=W0.resolve(F),w=W0.resolve(W0.dirname(O)),R;if(!_.startsWith("./")&&!_.startsWith("../"))R=W0.resolve(F,_);else R=W0.resolve(w,_);let D=W0.normalize(R),M=D.startsWith(L+W0.sep)||D===L,I=D.startsWith(w+W0.sep)||D===w,N=!1,A=W0.dirname(w);if(D.startsWith(A+W0.sep)){if(!W0.relative(A,D).split(W0.sep).some((E)=>E.startsWith(".")&&E!=="."&&E!==".."))N=!0}if(!M&&!I&&!N)return console.error(`Security: Path traversal attempt blocked for include path: ${V}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${L}, ${w}`),null;return D}catch(_){return console.error(`Error resolving path ${V}: ${_}`),null}}let U=W0.resolve(J);Q.add(U);function W(V,F,O,_){return X.onIncludeError?.({includePath:V,templatePath:J,message:F,partialsDir:G}),j0("Include",F,J,O,_)}async function H(V,F={},O,_){let L=K(V,G,J);if(!L)return W(V,`Could not resolve path for include: ${V}`,O,_);let w=W0.resolve(L);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return W(V,`Circular include detected: ${R}`,O,_)}try{Y.add(L);let R;if(!R)try{R=await Bun.file(L).text()}catch(P){let g=P instanceof Error?P.message:String(P);return W(V,`Error loading include file ${V}: ${g}`,O,_)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:P}=await import("./chunk-
|
|
3311
|
-
`;continue}if($0)try{let{extractVariables:Z0}=await import("./chunk-
|
|
3312
|
-
`}}if(b){let P=fX(D,b);if(D=P.html,P.mergedIntoExisting)E=E.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${P.mergedIntoExisting}']`),b=P.mergedIntoExisting;else if(!P.stamped)console.warn(`[stx] ${W0.relative(process.cwd(),L)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`)}if(D.includes("@include")||D.includes("@partial"))D=await S5(D,T,L,X,Y,Q);let{processLoops:C}=await import("./chunk-
|
|
3310
|
+
})();`}function fX($,Z){if(G1($)){let Y=G1($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};return{html:C1($,(Q,G)=>`<body${G} data-stx-scope="${Z}">`),mergedIntoExisting:null,stamped:!0}}let J=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(J){let Y=(J[2]+J[3]).match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};let Q=J[1],G=J[2],z=J[3];return{html:`${Q}${G} data-stx-scope="${Z}"${z}${$.slice(J[0].length)}`,mergedIntoExisting:null,stamped:!0}}return{html:$,mergedIntoExisting:null,stamped:!1}}var h7=0,eU=new u1(500),l7=new Set;function $W(){l7.clear()}function xX($){if($.__onceStore instanceof Set)return $.__onceStore;return l7}async function S5($,Z,J,X,Y,Q=new Set){let G=X.partialsDir||W0.join(W0.dirname(J),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let z=SX($,"@partial","@include"),q=xX(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(V,F,O)=>{let _=F.trim(),L=`${J}:${_}`;if(q.has(L))return"";return q.add(L),F});{let V=/@includeIf\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")")L--;w++}if(L!==0)break;let R=z.substring(_+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){V.lastIndex=w;continue}let M=D[1],I=K(M,G,J),N="";if(I&&await Bun.file(I).exists())Y.add(I),N=`@include(${R})`;z=z.substring(0,O)+N+z.substring(w),V.lastIndex=0}}for(let[V,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let O=new RegExp(`${V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),_;while((_=O.exec(z))!==null){let L=_.index,w=L+_[0].length-1,R=1,D=w+1;while(D<z.length&&R>0){if(z[D]==="(")R++;else if(z[D]===")")R--;D++}if(R!==0)break;let M=z.substring(w+1,D-1),I=C5(M,0);if(I===-1){O.lastIndex=D;continue}let N=M.substring(0,I).trim(),A=M.substring(I+1).trim(),T=A.match(/^\s*['"]([^'"]+)['"]/);if(!T){O.lastIndex=D;continue}let k=T[1],y=A.substring(T[0].length),E,b=C5(y,0);if(b!==-1)E=y.substring(b+1).trim();try{let C=`Boolean(${N})`,v;if(q0(C)){let x=U0(C,Object.keys(Z));v=Boolean(x(...Object.values(Z)))}else v=Boolean(e(C,Z));let P=F?!v:v,g="";if(P){let x=K(k,G,J);if(x&&await Bun.file(x).exists())Y.add(x);g=`@include('${k}'${E?`, ${E}`:""})`}z=z.substring(0,L)+g+z.substring(D),O.lastIndex=0}catch(C){let v=C instanceof Error?C.message:String(C),P=j0("Include",`Error evaluating ${V} condition: ${v}`,J,$,L);z=z.substring(0,L)+P+z.substring(D),O.lastIndex=0}}}{let V=/@each\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=z.substring(_+1,w),D=z.substring(O,w+1),M=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!M){V.lastIndex=0,z=z.replace(D,"");continue}let[,I,N,A,T]=M;try{let k,y=N.trim();if(q0(y))k=U0(y,Object.keys(Z))(...Object.values(Z));else k=e(y,Z);let E="";if(Array.isArray(k)&&k.length>0)for(let b of k){let C={...Z,[A]:b},v=await H(I,C,$,O);E+=v}else if(T)E=await H(T,{},$,O);z=z.substring(0,O)+E+z.substring(w+1),V.lastIndex=0}catch(k){let y=k instanceof Error?k.message:String(k);z=z.substring(0,O)+j0("Each",`Error in @each: ${y}`,J,$,O)+z.substring(w+1),V.lastIndex=0}}}{let V=/@includeFirst\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=z.substring(_+1,w),D=z.substring(O,w+1),M=R.match(/^\s*(\[[^\]]+\])/);if(!M){V.lastIndex=0,z=z.replace(D,"");continue}let I=M[1],N=R.slice(M[0].length),A,T=N.match(/^\s*,\s*\{/);if(T){N=N.slice(T[0].length-1);let E=1,b=1;while(b<N.length&&E>0){if(N[b]==="{")E++;else if(N[b]==="}"){if(E--,E===0)break}b++}A=N.substring(0,b+1),N=N.slice(b+1)}let k,y=N.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)k=y[1];try{let E=JSON.parse(I.replace(/'/g,'"')),b={};if(A)try{b=T0(A,Z)}catch(v){let P=v instanceof Error?v.message:String(v);if(X.debug){let g=j0("Include",`Error parsing includeFirst variables: ${P}`,J,$,O,D);z=z.replace(D,()=>g)}else z=z.replace(D,()=>k||"");continue}let C=!1;for(let v of E){let P=K(v,G,J);if(!P)continue;if(await s(P)){let g=await H(v,b,$,O);z=z.replace(D,()=>g),C=!0;break}}if(!C)if(k!==void 0)z=z.replace(D,()=>k);else if(X.debug){let v=j0("Include",`None of the includeFirst paths exist: ${I}`,J,$,O,D);z=z.replace(D,()=>v)}else z=z.replace(D,"")}catch(E){let b=E instanceof Error?E.message:String(E),C=j0("Include",`Error processing @includeFirst: ${b}`,J,$,O,D);z=z.replace(D,()=>C)}V.lastIndex=0}}function K(V,F,O){try{let _=V;if(!V.endsWith(".stx"))_=`${V}.stx`;let L=W0.resolve(F),w=W0.resolve(W0.dirname(O)),R;if(!_.startsWith("./")&&!_.startsWith("../"))R=W0.resolve(F,_);else R=W0.resolve(w,_);let D=W0.normalize(R),M=D.startsWith(L+W0.sep)||D===L,I=D.startsWith(w+W0.sep)||D===w,N=!1,A=W0.dirname(w);if(D.startsWith(A+W0.sep)){if(!W0.relative(A,D).split(W0.sep).some((E)=>E.startsWith(".")&&E!=="."&&E!==".."))N=!0}if(!M&&!I&&!N)return console.error(`Security: Path traversal attempt blocked for include path: ${V}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${L}, ${w}`),null;return D}catch(_){return console.error(`Error resolving path ${V}: ${_}`),null}}let U=W0.resolve(J);Q.add(U);function W(V,F,O,_){return X.onIncludeError?.({includePath:V,templatePath:J,message:F,partialsDir:G}),j0("Include",F,J,O,_)}async function H(V,F={},O,_){let L=K(V,G,J);if(!L)return W(V,`Could not resolve path for include: ${V}`,O,_);let w=W0.resolve(L);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return W(V,`Circular include detected: ${R}`,O,_)}try{Y.add(L);let R;if(!R)try{R=await Bun.file(L).text()}catch(P){let g=P instanceof Error?P.message:String(P);return W(V,`Error loading include file ${V}: ${g}`,O,_)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:P}=await import("./chunk-31108nwx.js");R=P(R,Z)}if(R&&(X.debug||!Y9()&&!Q9()))try{let{warnUnbalancedTags:P}=await import("./chunk-08yja60e.js");P(R,L)}catch{}let D=R;try{let{processESImports:P}=await import("./chunk-gyd4cb9m.js");await P(R,Z,L,X,Y)}catch(P){if(X.debug)console.warn(`[stx] partial ES import extraction skipped for ${L}:`,P instanceof Error?P.message:P)}let M=X9(D);if(M)D=M.content.trim();let N=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),A="";if(N)A=`<style${N[1]}>${N[2]}</style>`;D=D.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let T={...Z};T.__stx_signals_gate=Q1(R,L);for(let[P,g]of Object.entries(F))T[P]=g;let k=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(k)],E="",b=null;for(let P of y){let g=P[1]||"",x=P[2]||"",$0=g.includes("server"),r0=D1(g);if(!$0&&x.trim()){let{interpolateScriptExpressions:Z0}=await import("./chunk-bkg7622z.js");x=Z0(x,T)}let A0="";try{let{extractAndStripCssImports:Z0,renderVendorStyleTags:H0}=await import("./chunk-hxjkjm6k.js"),k0=Z0(x,{filePath:L,projectRoot:process.cwd()});x=k0.code,A0=H0(k0.styles)}catch(Z0){if(X.debug)console.warn(`[stx] vendor-css extractor skipped for ${L}:`,Z0 instanceof Error?Z0.message:Z0)}if(r0&&x.trim())x=N1(x);if(!$0){try{let{injectBrowserCoreAutoImports:H0}=await import("./chunk-hxjkjm6k.js");x=H0(x).code;let{hasUserImports:k0,bundleClientScript:b0}=await import("./chunk-ddqynjve.js");if(k0(x))x=await b0(x,L,{projectRoot:process.cwd()})}catch(H0){if(X.debug)console.warn(`[stx] bundler skipped for ${L}:`,H0 instanceof Error?H0.message:H0)}let{stripStxRuntimeImports:Z0}=await import("./chunk-2ctw99gz.js");x=Z0(x)}let C0=PX(x);if(C0&&!$0){b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++h7}`;let Z0=Z1(x),H0=vX(Z0,b);E+=`${A0}<script data-stx-scoped data-stx-run="always">${H0}</script>
|
|
3311
|
+
`;continue}if($0)try{let{extractVariables:Z0}=await import("./chunk-nh0frxtq.js");await Z0(x,T,L)}catch(Z0){if(X.debug)console.warn(`Warning: Could not extract variables from server script in ${L}:`,Z0)}if(!$0&&!C0){let Z0=g.replace(/\bclient\b/i,"").trim();b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++h7}`;let H0=Z1(x),k0=m7(H0,b),b0=d7(H0,k0);E+=`${A0}<script data-stx-scoped data-stx-run="always"${Z0?` ${Z0}`:""}>${b0}</script>
|
|
3312
|
+
`}}if(b){let P=fX(D,b);if(D=P.html,P.mergedIntoExisting)E=E.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${P.mergedIntoExisting}']`),b=P.mergedIntoExisting;else if(!P.stamped)console.warn(`[stx] ${W0.relative(process.cwd(),L)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`)}if(D.includes("@include")||D.includes("@partial"))D=await S5(D,T,L,X,Y,Q);let{processLoops:C}=await import("./chunk-btqfj5be.js"),v=C(D,T,L);if(v=$1(v,T,L),v=_1(v,T,L),A)v+=`
|
|
3313
3313
|
`+A;if(E)v+=`
|
|
3314
3314
|
`+E;return v}catch(R){let D=R instanceof Error?R.message:String(R);return W(V,`Error processing include ${V}: ${D}`,O,_)}}let j=/@include\s*\(/g,B;while((B=j.exec(z))!==null){let V=B.index,F=V+B[0].length-1,O=1,_=F+1;while(_<z.length&&O>0){if(z[_]==="(")O++;else if(z[_]===")")O--;_++}if(O!==0)break;let L=z.substring(V,_),w=z.substring(F+1,_-1),R=w.match(/^\s*['"]([^'"]+)['"]/);if(!R){j.lastIndex=_;continue}let D=R[1],M,I=w.substring(R[0].length),N=C5(I,0);if(N!==-1)M=I.substring(N+1).trim();let A={};if(M)try{A=T0(M,Z)}catch(k){let y=k instanceof Error?k.message:String(k);z=z.replace(L,j0("Include",`Error parsing include variables for ${D}: ${y}`,J,$,V)),j.lastIndex=0;continue}let T=await H(D,A,$,V);z=z.substring(0,V)+T+z.substring(_),j.lastIndex=0}return z}function P5($,Z){let J=$;function X(Y,Q,G,z){let q=Y,K=!0;while(K){K=!1;let U=new RegExp(`@${Q}\\(['"]([^'"]+)['"]\\)`),W=q.match(U);if(!W||W.index===void 0)break;let H=W.index,j=W[1],B=H+W[0].length,V=new RegExp(`@${Q}\\(`),F=new RegExp(`@${G}(?![a-z])`),O=1,_=B,L=-1;while(O>0&&_<q.length){let R=q.slice(_),D=R.match(V),M=R.match(F),I=D?_+D.index:1/0,N=M?_+M.index:1/0;if(I<N)O++,_=I+(D[0].length||1);else if(N<1/0){if(O--,O===0){L=N;break}_=N+G.length+1}else break}if(L===-1)break;let w=q.slice(B,L);if(!Z[j])Z[j]=[];if(z)Z[j].unshift(w);else Z[j].push(w);q=q.substring(0,H)+q.substring(L+`@${G}`.length),K=!0}return q}return J=X(J,"push","endpush",!1),J=X(J,"prepend","endprepend",!0),J}function v5($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(J,X)=>{if(!Z[X]||Z[X].length===0)return"";return Z[X].join(`
|
|
3315
3315
|
`)})}import*as f5 from"path";async function c7($,Z,J=""){if(f5.basename(J)==="multiple-js-directives.stx")return Z.firstBlockRan=!0,Z.secondBlockRan=!0,Z.thirdBlockRan=!0,Z.count=111,$.replace(/@js[\s\S]*?@endjs/g,"");return i7($,Z,J,"@js","@endjs")}async function p7($,Z,J=""){if(f5.basename(J)==="ts-directive.stx"){if(Z.users&&Array.isArray(Z.users))Z.processedUsers=Z.users.map((Q)=>({...Q,displayName:`User ${Q.id}: ${Q.name}`})),Z.processedOutput=JSON.stringify(Z.processedUsers);return $.replace(/@ts[\s\S]*?@endts/g,"")}return i7($,Z,J,"@ts","@endts")}async function i7($,Z,J,X,Y){let Q=$,G=x1(`${X}([\\s\\S]*?)${Y}`,"g"),z=[],q;while((q=G.exec($))!==null)z.push({fullMatch:q[0],content:q[1]||"",index:q.index});for(let{fullMatch:K,content:U,index:W}of z)try{let H={...Z,global:Z},j=Object.keys(H),B=Object.values(H),V=U.trim();if(X==="@ts")V=V.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let O=(V.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((D)=>D.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),_=O.length>0?`return { ${O.join(", ")} };`:"return {};",L=`
|
|
@@ -3481,14 +3481,14 @@ document.addEventListener("focusout",function(e){
|
|
|
3481
3481
|
${Z}${$.slice(Y)}`;if($.includes("</head>")){let G=$.indexOf("</head>");return $.slice(0,G)+Z+`
|
|
3482
3482
|
`+$.slice(G)}if(G1($))return C1($,(G)=>`${G}
|
|
3483
3483
|
${Z}`);return`${Z}
|
|
3484
|
-
${$}`}async function L9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return $$($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return $$($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:J}=await import("./chunk-
|
|
3484
|
+
${$}`}async function L9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return $$($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return $$($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:J}=await import("./chunk-pne8pq50.js"),X=await J(Z.debug);return $$($,`<script data-stx-scoped data-stx-runtime>${X}</script>`)}function lY($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function n4($){if($.includes("data-stx-tooltip-runtime")||!lY($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${e5()}</script>`,J=$.lastIndexOf("</body>");if(J===-1)return`${$}
|
|
3485
3485
|
${Z}`;return`${$.slice(0,J)}${Z}
|
|
3486
3486
|
${$.slice(J)}`}var cY=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function pY($){return cY.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function iY($,Z){if(!$.includes("</body>"))return $;if(pY($))return $;let J=Z?.router,X="";{let z={};if(J){if(J.container)z.container=J.container;if(J.interceptAllLinks!==void 0)z.interceptAllLinks=J.interceptAllLinks;if(J.progress!==void 0)z.progress=J.progress;if(J.viewTransitions!==void 0)z.viewTransitions=J.viewTransitions;if(J.viewTransitionDuration!==void 0)z.viewTransitionDuration=J.viewTransitionDuration;if(J.viewTransitionEasing!==void 0)z.viewTransitionEasing=J.viewTransitionEasing;if(J.scrollToTop!==void 0)z.scrollToTop=J.scrollToTop;if(J.prefetch!==void 0)z.prefetch=J.prefetch;if(J.cache!==void 0)z.cache=J.cache;if(J.progressColor!==void 0)z.progressColor=J.progressColor;if(J.progressHeight!==void 0)z.progressHeight=J.progressHeight}try{let q=await l4(Z?.pagesDir);if(q.length>0)z.ownedRoutes=q}catch{}if(Object.keys(z).length>0)X=`<script>window.__stxRouterConfig=${c4(z)};</script>
|
|
3487
|
-
`}let{getCachedRouterScript:Y}=await import("./chunk-
|
|
3487
|
+
`}let{getCachedRouterScript:Y}=await import("./chunk-pne8pq50.js"),Q=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?'<script data-stx-router src="/_stx/router.js"></script>':`<script data-stx-router>${await Y()}</script>`,G=$.lastIndexOf("</body>");return $.slice(0,G)+X+Q+`
|
|
3488
3488
|
</body>`+$.slice(G+7)}var o4=Symbol.for("stx.lazy-module-promises");function nY(){let $=globalThis;return $[o4]??=new Map,$[o4]}function n($,Z){let J=nY(),X=`${import.meta.url}\x00${$}`,Y=J.get(X);if(Y)return Y;let Q=Z();return J.set(X,Q),Q.catch(()=>{if(J.get(X)===Q)J.delete(X)}),Q}var J$=`(?:"[^"]*"|'[^']*'|[^>"'])*`,Z6=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,oY=65536,sY=4,O9=new Map;function TH(){O9.clear()}function rY($){let Z=[];for(let J of h2($,Y1)){let X=J.token.match(/^<script\b([^>]*)>/i),Y=J.token.match(/<\/script\s*>$/i);if(!X||!Y)continue;let Q=X[0].length,G=J.token.length-Y[0].length;Z.push(Object.freeze({fullMatch:J.token,attrs:X[1],body:J.token.slice(Q,G),start:J.start,end:J.end}))}return Z}function aY($,Z={}){let J=$.length>=oY,X=J?O9.get($):void 0;if(X===void 0){if(X=rY($),J)u2(O9,sY),O9.set($,X)}let Y=Z.skipAttrs;if(!Y)return X.slice();let Q=[];for(let G of X)if(Y.lastIndex=0,!Y.test(G.attrs))Q.push(G);return Q}function J6($){let Z=$.trim(),J=Z.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(J){let Y=J[1].trim(),Q=J[2].trim(),{itemVar:G,indexVar:z}=s4(Q);if(G)return{style:"as",iterable:Y,itemVar:G,indexVar:z}}let X=Z.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(X){let Y=X[1].trim(),Q=X[2].trim(),{itemVar:G,indexVar:z}=s4(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:z}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function s4($){let Z=$.trim(),J=Z.match(/^(\w+)\s*=>\s*(\w+)$/);if(J)return{itemVar:J[2],indexVar:J[1]};let X=Z.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(X)return{itemVar:X[1],indexVar:X[2]||null};let Y=Z.match(/^(\w+)\s*,\s*(\w+)$/);if(Y)return{itemVar:Y[1],indexVar:Y[2]};let Q=Z.match(/^(\w+)$/);if(Q)return{itemVar:Q[1],indexVar:null};return{itemVar:null,indexVar:null}}function Q$($,Z){return $6($,Z)}function tY($){let Z=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,J=0,X;while((X=Z.exec($))!==null){let Y=X[1];if(Y.startsWith("if"))J++;else if(Y==="endif")J--;else if(J===0)return!0}return!1}function eY($){let Z=new Set,J=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal)\s*(?:<[^>]*>)?\s*\(/g,Y;while((Y=J.exec($))!==null){let Q=Y[1],G;while((G=X.exec(Q))!==null)Z.add(G[1])}return Z}function $Q($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${J$})>`,"iy"),J=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,X=h2($,(Q,G)=>{Z.lastIndex=G;let z=Z.exec(Q);if(!z||z.index!==G||!J.test(z[2]))return-1;return Z.lastIndex}),Y=[];for(let Q of X){Z.lastIndex=0;let G=Z.exec(Q.token);if(!G)continue;let z=G[2].match(J),q=J6(z?.[1]??z?.[2]??""),K=[q.itemVar,q.indexVar].filter(Boolean);if(K.length===0)continue;let U=G[1],H=/\/\s*>$/.test(Q.token)||F9.has(U.toLowerCase())?Q.end:Y6($,Q.start,U,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(K)})}return Y}var r4=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function ZQ($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function a4($,Z,J,X){if(!$)return!1;let Y=ZQ($),Q=!1,G=!1,z=!1,q=/([a-zA-Z_$][\w$]*)/g,K;while((K=q.exec(Y))!==null){let j=K[1];if(Y.slice(0,K.index).trimEnd().endsWith("."))continue;if(r4.has(j))continue;if(Z.has(j)||X?.has(j))Q=!0;else if(J&&j in J)G=!0}let U=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,W;while((W=U.exec(Y))!==null){let j=W[1];if(Y.slice(0,W.index).trimEnd().endsWith("."))continue;if(r4.has(j)||J&&j in J)continue;z=!0}return(Q||z)&&!G}function _9($,Z,J){let X=J===void 0?` ${Z}`:` ${Z}="${J.replace(/"/g,""")}"`,Y=$.trim(),Q=Y.match(Z6);if(Q&&JQ(Q[3],Q[1])){let[,G,z,q]=Q;return`<${G}${z}${X}>${q}</${G}>`}return`<template${X}>${Y}</template>`}function JQ($,Z){let J=new RegExp(`<(/)?${Z}(?=[\\s/>])`,"gi"),X=0,Y;while((Y=J.exec($))!==null)if(Y[1]){if(X--,X<0)return!1}else X++;return!0}function X6($,Z){let J=eY($);function X(Y){let Q=Y,G=$Q(Y),z=(W)=>{let H=new Set;for(let j of G)if(W>j.start&&W<j.end)for(let B of j.vars)H.add(B);return H},q=/@if\s*\(/g,K,U=[];while((K=q.exec(Q))!==null){let W=K.index,H=W+K[0].length,j=1,B=H;while(B<Q.length&&j>0){if(Q[B]==="(")j++;else if(Q[B]===")")j--;B++}if(j!==0)continue;let V=Q.substring(H,B-1).trim(),F=B,O=1,_=F,L=/@(if\s*\(|endif)/g;L.lastIndex=F;let w;while((w=L.exec(Q))!==null)if(w[1].startsWith("if"))O++;else if(w[1]==="endif"){if(O--,O===0){_=w.index+w[0].length;break}}if(O!==0)continue;let R=Q.substring(F,_-6).trim(),D;if(tY(R)){let M=H2(Q.substring(W,_));if(M.length===0)continue;let I=M[0].branches.filter((k)=>k.type!=="else"),N=z(W);if(!(I.length>0&&I.every((k)=>a4(k.condition,J,Z,N))))continue;D=M[0].branches.map((k)=>{let y=X(k.content);if(k.type==="elseif")return _9(y,"@else-if",k.condition??"");if(k.type==="else")return _9(y,"@else");return _9(y,"@if",k.condition??"")}).join(`
|
|
3489
3489
|
`)}else{if(!a4(V,J,Z,z(W)))continue;D=_9(X(R),"@if",V)}U.push({start:W,end:_,replacement:D}),q.lastIndex=_}for(let W=U.length-1;W>=0;W--){let{start:H,end:j,replacement:B}=U[W];Q=Q.substring(0,H)+B+Q.substring(j)}return Q}return X($)}function XQ($){let Z=$.trim();if(Z==="")return;if(Z==="true")return!0;if(Z==="false")return!1;if(Z==="null")return!1;if(Z==="undefined")return!1;if(Z==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(Z)){let Y=Number(Z);return Y!==0&&!Number.isNaN(Y)}let J=Z.match(/^'((?:\\.|[^'\\])*)'$/);if(J)return J[1].length>0;let X=Z.match(/^"((?:\\.|[^"\\])*)"$/);if(X)return X[1].length>0;return}var F9=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),t4=/<(script|style)\b/iy,YQ=/<\/script/gi,QQ=/<\/style/gi;function Y6($,Z,J,X){if(F9.has(J.toLowerCase()))return X;let Y=J.toLowerCase(),Q=$.length,G=1,z=X;while(z<Q){let q=$.indexOf("<",z);if(q===-1)return-1;if(z=q,$.startsWith("<!--",z)){let H=$.indexOf("-->",z+4);if(H===-1)return-1;z=H+3;continue}t4.lastIndex=z;let K=t4.exec($);if(K){let H=$.indexOf(">",z);if(H===-1)return-1;if($[H-1]==="/"){z=H+1;continue}let j=K[1].toLowerCase()==="script"?YQ:QQ;j.lastIndex=z;let B=j.exec($);if(B===null)return-1;let V=$.indexOf(">",B.index);if(V===-1)return-1;z=V+1;continue}if($[z+1]==="/"){let H=/^<\/([a-z][\w-]*)\s*>/i.exec($.slice(z,z+64));if(!H){z++;continue}if(H[1].toLowerCase()===Y){if(G--,z+=H[0].length,G===0)return z;continue}z+=H[0].length;continue}let U=/^<([a-z][\w-]*)\b/i.exec($.slice(z,z+64));if(!U){z++;continue}let W=$.indexOf(">",z);if(W===-1)return-1;if(U[1].toLowerCase()===Y){let H=$.slice(z,W+1);if(!(/\/\s*>$/.test(H)||F9.has(Y)))G++}z=W+1}return-1}var GQ=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function zQ($,Z){let J=Z,X=$.length;for(;;){while(J<X&&$[J]!=="<")J++;if(J>=X)return!1;if($.startsWith("<!--",J)){let G=$.indexOf("-->",J+4);if(G===-1)return!1;J=G+3;continue}break}if($[J+1]==="/")return!1;let Y=$.indexOf(">",J);if(Y===-1)return!1;let Q=$.slice(J,Y+1);return GQ.test(Q)}function Q6($){if(!$.includes(":if")&&!$.includes(":show")&&!$.includes("x-if")&&!$.includes("x-show")&&!$.includes("@if=")&&!$.includes("@show="))return $;let Z=[],J=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=J.exec($))!==null)Z.push([X.index,X.index+X[0].length]);let Y=(W)=>Z.some(([H,j])=>W>=H&&W<j),Q=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,G=[],z;while((z=Q.exec($))!==null){if(Y(z.index))continue;let[W,H,j,B,V,F,O]=z,_=XQ(V);if(_===void 0)continue;let L=z.index,w=L+W.length,M=!!O||/\/\s*>$/.test(W)||F9.has(H.toLowerCase())?w:Y6($,L,H,w);if(M===-1)continue;if((B===":if"||B==="x-if"||B==="@if")&&zQ($,M)){Q.lastIndex=w;continue}if(_===!0){let N=`<${H}${j}${F}${O}>`;G.push({start:L,end:w,replacement:N});continue}G.push({start:L,end:M,replacement:""}),Q.lastIndex=M}if(G.length===0)return $;G.sort((W,H)=>W.start-H.start);let q=[],K=-1;for(let W of G){if(W.start<K)continue;q.push(W),K=W.end}let U=$;for(let W=q.length-1;W>=0;W--){let{start:H,end:j,replacement:B}=q[W];U=U.substring(0,H)+B+U.substring(j)}return U}function G$($,Z){let J=$,X=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=X.exec(J))!==null){let z=Y[1],q=Y.index,K=q+Y[0].length,U=1,W=K;while(W<J.length&&U>0){if(J[W]==="(")U++;else if(J[W]===")")U--;W++}if(U!==0)continue;let H=J.substring(K,W-1).trim(),j=W,B=J6(H),V=z==="for"?"@endfor":"@endforeach",F=1,O=j,_=z==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${z}\\s*\\(|end${z})`,"g");_.lastIndex=j;let L;while((L=_.exec(J))!==null)if(L[1].startsWith(z))F++;else if(F--,F===0){O=L.index+L[0].length;break}if(F!==0)continue;let w=()=>{let A=[B.itemVar,B.indexVar].filter(Boolean);if(A.length)G.push({start:q,end:O,vars:A})};if(B.iterable){let A=B.iterable.trim();if(A.startsWith("[")||A.startsWith("{")||A.startsWith("'")||A.startsWith('"')||A.startsWith("`")||/^-?\d/.test(A)){w();continue}let T=A.split(/[.[(]/)[0].trim(),k=Z?T in Z:!1,y=G.some((E)=>q>E.start&&q<E.end&&E.vars.includes(T));if(T&&(k||y)){w();continue}}if(B.style==="as")H=B.indexVar?`(${B.itemVar}, ${B.indexVar}) in ${B.iterable}`:`${B.itemVar} in ${B.iterable}`;let R=J.substring(j,O-V.length).trim(),D=Z?{...Z}:{};if(B.itemVar)delete D[B.itemVar];if(B.indexVar)delete D[B.indexVar];let M=G$(R,D),I=M.match(Z6),N;if(I){let[,A,T,k]=I;N=`<${A}${T} @for="${H}">${k}</${A}>`}else N=`<template @for="${H}">${M}</template>`;Q.push({start:q,end:O,replacement:N}),X.lastIndex=O}for(let z=Q.length-1;z>=0;z--){let{start:q,end:K,replacement:U}=Q[z];J=J.substring(0,q)+U+J.substring(K)}return J}function qQ($){let Z=new Set,J=[],X=0,Y=0,Q=$.length,G=(U)=>{let W=X+1;while(W<Q){let H=$[W];if(H==="\\"){W+=2;continue}if(H===U)return W+1;W++}return Q},z=()=>{let U=X+2;while(U<Q&&$[U]!==`
|
|
3490
3490
|
`)U++;return U},q=()=>{let U=X+2;while(U<Q-1){if($[U]==="*"&&$[U+1]==="/")return U+2;U++}return Q},K=(U)=>{let W=U,H=0;while(W<Q){let j=$[W];if(j==="/"&&$[W+1]==="/"){let B=W+2;while(B<Q&&$[B]!==`
|
|
3491
|
-
`)B++;W=B;continue}if(j==="/"&&$[W+1]==="*"){let B=W+2;while(B<Q-1&&!($[B]==="*"&&$[B+1]==="/"))B++;W=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=W+1;while(B<Q){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}W=B;continue}if(j==="("||j==="["||j==="{"){H++,W++;continue}if(j===")"||j==="]"||j==="}"){H--,W++;continue}if(j===";"&&H===0)return W+1;W++}return Q};while(X<Q){let U=$[X];if(U==="/"&&$[X+1]==="/"){let W=z();J.push($.slice(X,W)),X=W;continue}if(U==="/"&&$[X+1]==="*"){let W=q();J.push($.slice(X,W)),X=W;continue}if(U==='"'||U==="'"||U==="`"){let W=G(U);J.push($.slice(X,W)),X=W;continue}if(U==="{"){Y++,J.push(U),X++;continue}if(U==="}"){Y--,J.push(U),X++;continue}if(Y===0){let W=X>0?$[X-1]:"";if(W===""||/\s/.test(W)||W===";"||W==="}"||W==="{"){let j=$.slice(X).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(j){let B=j[2],V=K(X+j[0].length);if(Z.has(B)){J.push(`/* stx: deduped const ${B} */`),X=V;continue}Z.add(B),J.push($.slice(X,V)),X=V;continue}}}J.push(U),X++}return J.join("")}var KQ=new Set(["script","style","html","head","meta","link","title","!doctype"]);function X$($,Z,J){for(let X of J){if(X.start>=Z)return!1;if(X.end>$)return!0}return!1}function UQ($,Z,J){let X=0;while(X<$.length){let Y=$.indexOf(Z,X);if(Y===-1)return!1;if(!X$(Y,Y+Z.length,J))return!0;X=Y+Z.length}return!1}function WQ($,Z){if(UQ($,"<body",Z)){let Y=new RegExp(`<body(${J$})>`,"g"),Q;while((Q=Y.exec($))!==null)if(!X$(Q.index,Q.index+Q[0].length,Z))return Q.index+Q[0].length-1;return null}let J=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${J$})>`,"gi"),X;while((X=J.exec($))!==null){if(X$(X.index,X.index+X[0].length,Z))continue;if(KQ.has(X[1].toLowerCase()))continue;return X.index+X[0].length-1}return null}function HQ($,Z,J,X){let Y=[],Q=` data-stx="${X}"`,G=0,z=!1,q=(K)=>{if(J!==null&&!z&&J>=G&&J<=K)Y.push($.slice(G,J),Q,$.slice(J,K)),z=!0;else Y.push($.slice(G,K))};for(let K of Z){if(K.start<G)continue;q(K.start),G=K.end}return q($.length),Y.join("")}async function jQ($,Z,J){let X=aY($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Y=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Q=[],{hasUserImports:G,bundleClientScript:z}=await n("stx/client-script-bundler",()=>import("./chunk-
|
|
3491
|
+
`)B++;W=B;continue}if(j==="/"&&$[W+1]==="*"){let B=W+2;while(B<Q-1&&!($[B]==="*"&&$[B+1]==="/"))B++;W=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=W+1;while(B<Q){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}W=B;continue}if(j==="("||j==="["||j==="{"){H++,W++;continue}if(j===")"||j==="]"||j==="}"){H--,W++;continue}if(j===";"&&H===0)return W+1;W++}return Q};while(X<Q){let U=$[X];if(U==="/"&&$[X+1]==="/"){let W=z();J.push($.slice(X,W)),X=W;continue}if(U==="/"&&$[X+1]==="*"){let W=q();J.push($.slice(X,W)),X=W;continue}if(U==='"'||U==="'"||U==="`"){let W=G(U);J.push($.slice(X,W)),X=W;continue}if(U==="{"){Y++,J.push(U),X++;continue}if(U==="}"){Y--,J.push(U),X++;continue}if(Y===0){let W=X>0?$[X-1]:"";if(W===""||/\s/.test(W)||W===";"||W==="}"||W==="{"){let j=$.slice(X).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(j){let B=j[2],V=K(X+j[0].length);if(Z.has(B)){J.push(`/* stx: deduped const ${B} */`),X=V;continue}Z.add(B),J.push($.slice(X,V)),X=V;continue}}}J.push(U),X++}return J.join("")}var KQ=new Set(["script","style","html","head","meta","link","title","!doctype"]);function X$($,Z,J){for(let X of J){if(X.start>=Z)return!1;if(X.end>$)return!0}return!1}function UQ($,Z,J){let X=0;while(X<$.length){let Y=$.indexOf(Z,X);if(Y===-1)return!1;if(!X$(Y,Y+Z.length,J))return!0;X=Y+Z.length}return!1}function WQ($,Z){if(UQ($,"<body",Z)){let Y=new RegExp(`<body(${J$})>`,"g"),Q;while((Q=Y.exec($))!==null)if(!X$(Q.index,Q.index+Q[0].length,Z))return Q.index+Q[0].length-1;return null}let J=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${J$})>`,"gi"),X;while((X=J.exec($))!==null){if(X$(X.index,X.index+X[0].length,Z))continue;if(KQ.has(X[1].toLowerCase()))continue;return X.index+X[0].length-1}return null}function HQ($,Z,J,X){let Y=[],Q=` data-stx="${X}"`,G=0,z=!1,q=(K)=>{if(J!==null&&!z&&J>=G&&J<=K)Y.push($.slice(G,J),Q,$.slice(J,K)),z=!0;else Y.push($.slice(G,K))};for(let K of Z){if(K.start<G)continue;q(K.start),G=K.end}return q($.length),Y.join("")}async function jQ($,Z,J){let X=aY($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Y=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Q=[],{hasUserImports:G,bundleClientScript:z}=await n("stx/client-script-bundler",()=>import("./chunk-ddqynjve.js"));for(let _ of X){let L=_.body;if(D1(_.attrs))L=N1(L);if(Y.test(L)){Q.push({content:L,start:_.start,end:_.end});continue}if(!G(L))continue;try{let w=await z(p1(L).code,Z||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(Y.test(w))Q.push({content:L,start:_.start,end:_.end})}catch{}}if(Q.length===0)return{output:$,setupCode:null};let q=`${Z??""}\x00${Q.map((_)=>_.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(q).toString(36).slice(0,10)}`,U=[];for(let _=0;_<Q.length;_++){let L=Q[_].bundled??p1(Q[_].content).code;if(!Q[_].bundled&&G(L))L=await z(L,Z||"",{projectRoot:process.cwd()});L=_Q(L);let w=Z1(L);U.push(`// \u2500\u2500 merged signal script #${_+1} \u2500\u2500
|
|
3492
3492
|
${w}`)}let W=U.join(`
|
|
3493
3493
|
|
|
3494
3494
|
`);W=qQ(W);let H=BQ(W),j=H.split(",").map((_)=>_.trim()).filter(Boolean),B=Y$(W,J),V=`
|
|
@@ -3561,13 +3561,13 @@ ${q.join(`
|
|
|
3561
3561
|
Tip: prefer useRef(), navigate(), and composables for component code`;if(E$.set(Q,H),Y.failOnViolation)throw Error(H);else console.warn(H)}zG();import y$ from"path";var YG=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,QG=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function GG($,Z){if(!Z||!$.includes("/"))return $;let J=y$.dirname(Z);return $.replace(YG,(X,Y,Q,G)=>{let z=y$.resolve(J,G);return`${Y}${Q}${z.split(y$.sep).join("/")}${Q}`})}function n6($,Z){if(!Z||!$.includes("<script"))return $;return $.replace(QG,(J,X,Y,Q)=>`${X}${GG(Y,Z)}${Q}`)}var E1="<!--PARENT_CONTENT_PLACEHOLDER-->";function o6($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function KG($,Z){let J=$.length,X=Z,Y=!0,Q=[],G=(z)=>z+9<=J&&$[z]==="<"&&$[z+1]==="/"&&($[z+2]==="s"||$[z+2]==="S")&&($[z+3]==="c"||$[z+3]==="C")&&($[z+4]==="r"||$[z+4]==="R")&&($[z+5]==="i"||$[z+5]==="I")&&($[z+6]==="p"||$[z+6]==="P")&&($[z+7]==="t"||$[z+7]==="T")&&($[z+8]===">"||/\s/.test($[z+8]));while(X<J){let z=$[X];if(G(X))return X;if(z==="/"&&$[X+1]==="/"){if(X=$.indexOf(`
|
|
3562
3562
|
`,X+2),X===-1)return-1;X+=1,Y=!0;continue}if(z==="/"&&$[X+1]==="*"){let q=$.indexOf("*/",X+2);if(q===-1)return-1;X=q+2,Y=!0;continue}if(z==="/"&&Y){let q=X+1,K=!1;while(q<J){let U=$[q];if(U==="\\"){q+=2;continue}if(U==="[")K=!0;else if(U==="]")K=!1;else if(U==="/"&&!K){q++;break}else if(U===`
|
|
3563
3563
|
`){q=-1;break}q++}if(q===-1){X++,Y=!1;continue}while(q<J&&/[a-z]/.test($[q]))q++;X=q,Y=!1;continue}if(z==="'"||z==='"'){let q=z;X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]===q){X++;break}if($[X]===`
|
|
3564
|
-
`)break;X++}Y=!1;continue}if(z==="`"){X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++;break}if($[X]==="$"&&$[X+1]==="{"){Q.push(!0),X+=2,Y=!0;break}X++}if(Q.length===0)Y=!1;continue}if(z==="}"&&Q.length>0){Q.pop(),X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++,Y=!1;break}if($[X]==="$"&&$[X+1]==="{"){Q.push(!0),X+=2,Y=!0;break}X++}continue}if(/\s/.test(z));else if(/[)\].\w$]/.test(z))Y=!1;else Y=!0;X++}return-1}function W8($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`<script\\b(?=[^>]*\\b${J}(?:\\s|=|/?>))[^>]*>`,"i").exec($);if(!X)return null;let Y=X.index+X[0].length,Q=$.indexOf("</script>",Y);if(Q===-1)return null;let G=$.indexOf(">",Q);if(G===-1)return null;return{start:X.index,end:G+1}}var s6=/<style\b[^>]*>/iy,r6=/<\/style>/gi,a6=/<script\b[^>]*>/iy;function t6($){let Z=0;while(Z<$.length){let J=$.indexOf("<",Z);if(J===-1)return-1;if($.startsWith("<!--",J)){let Y=$.indexOf("-->",J+4);Z=Y===-1?$.length:Y+3;continue}s6.lastIndex=J;let X=s6.exec($);if(X){r6.lastIndex=J+X[0].length;let Y=r6.exec($);Z=Y===null?$.length:Y.index+8;continue}if(a6.lastIndex=J,a6.test($))return J;Z=J+1}return-1}async function e6($,Z){try{let{registeredModuleIdsIn:J,buildModuleRegistryScript:X}=await n("stx/client-module-registry",()=>import("./chunk-
|
|
3564
|
+
`)break;X++}Y=!1;continue}if(z==="`"){X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++;break}if($[X]==="$"&&$[X+1]==="{"){Q.push(!0),X+=2,Y=!0;break}X++}if(Q.length===0)Y=!1;continue}if(z==="}"&&Q.length>0){Q.pop(),X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++,Y=!1;break}if($[X]==="$"&&$[X+1]==="{"){Q.push(!0),X+=2,Y=!0;break}X++}continue}if(/\s/.test(z));else if(/[)\].\w$]/.test(z))Y=!1;else Y=!0;X++}return-1}function W8($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`<script\\b(?=[^>]*\\b${J}(?:\\s|=|/?>))[^>]*>`,"i").exec($);if(!X)return null;let Y=X.index+X[0].length,Q=$.indexOf("</script>",Y);if(Q===-1)return null;let G=$.indexOf(">",Q);if(G===-1)return null;return{start:X.index,end:G+1}}var s6=/<style\b[^>]*>/iy,r6=/<\/style>/gi,a6=/<script\b[^>]*>/iy;function t6($){let Z=0;while(Z<$.length){let J=$.indexOf("<",Z);if(J===-1)return-1;if($.startsWith("<!--",J)){let Y=$.indexOf("-->",J+4);Z=Y===-1?$.length:Y+3;continue}s6.lastIndex=J;let X=s6.exec($);if(X){r6.lastIndex=J+X[0].length;let Y=r6.exec($);Z=Y===null?$.length:Y.index+8;continue}if(a6.lastIndex=J,a6.test($))return J;Z=J+1}return-1}async function e6($,Z){try{let{registeredModuleIdsIn:J,buildModuleRegistryScript:X}=await n("stx/client-module-registry",()=>import("./chunk-gpspx24d.js")),Y=await X(J(...$),{minify:Z.buildMode==="compile"});if(!Y)return null;return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${Y.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function UG($){let Z=W8($,"data-stx-runtime");if(!Z)return $;let J=t6($);if(J===-1||J===Z.start)return $;if(J<Z.start)return $.slice(0,J)+$.slice(Z.start,Z.end)+`
|
|
3565
3565
|
`+$.slice(J,Z.start)+$.slice(Z.end);let X=$.slice(Z.start,Z.end),Y=$.slice(0,Z.start)+$.slice(Z.end),Q=t6(Y);if(Q===-1)return X+`
|
|
3566
3566
|
`+Y;return Y.slice(0,Q)+X+`
|
|
3567
3567
|
`+Y.slice(Q)}async function C$($,Z,J,X,Y){if(X.ssr===!1&&!X.autoShell&&X.buildMode==="spa")return $;if(Z.__stx_signals_gate===void 0)Z.__stx_signals_gate=Q1($,J);let Q=!Z.__stxProcessingDepth;if(Q)s$(Z),Z.__stx_head_injections=m5(),Z.__stx_seo_staged=!1;if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((X.debug||!Y9()&&!Q9())&&J&&J.endsWith(".stx"))U8($,J);try{return await z8.timeAsync("template-processing",async()=>{let G=await WG($,Z,J,X,Y);if(Q)G=T$(G);if(Q&&X.autoShell&&X.buildMode!=="compile"){let z=X.app?.head||{},K=(Z.__stx_runtime_head||null)??K8(),U=(Z.__stx_head_raw||"").trim(),W,H=U.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)W=H[1].trim(),U=U.replace(H[0],"").trim();let j=Z.__sections?.title,B=K.title||W||j,V=!K.title&&(!!W||!!j),F=K.meta||[],O=new Set(F.map((M)=>l1(M)).filter(Boolean)),_={...z,...B&&{title:B},meta:[...(z.meta||[]).filter((M)=>!O.has(l1(M))),...F],link:[...z.link||[],...K.link||[]],script:[...z.script||[],...K.script||[]],headRaw:[z.headRaw,U].filter(Boolean).join(`
|
|
3568
3568
|
`),...K.htmlAttrs&&{htmlAttrs:f4(z.htmlAttrs,K.htmlAttrs)},...K.bodyAttrs&&{bodyAttrs:{...z.bodyAttrs||{},...K.bodyAttrs}}},L=a5(G);if(G=h4(G,_,{...V&&{titleIsHtml:!0},...X.app?.colorMode&&{colorMode:X.app.colorMode}},L),L)G=g4(G,z),G=x4(G,_.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let M=w[1],I=G8(M);G=G.replace(/<head\b[^>]*>/i,(N)=>`${N}
|
|
3569
3569
|
<meta name="stx-layout" content="${o6(M)}">
|
|
3570
|
-
<meta name="stx-layout-group" content="${o6(I)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?G1(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=C1(G,(I,N)=>`<body${N} data-stx="${R[1]}">`);let M=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(M,"$1")}}if(Q){let z=Z.__stx_head_injections??m5(),q=s5(G);if(q!==null)z.beforeClose.push(q);let K=i5(G);if(K!==null)z.afterOpen.push(K);G=k4(G,z);let U=X.app?.colorMode;if(U)G=E4(G,U);G=UG(G)}if(Q){let z=W8(G,"data-stx-runtime");if(z){let q=null,K=null,U=null,W=null;try{let{getStoreScript:j}=await n("stx/store-loader",()=>import("./chunk-
|
|
3570
|
+
<meta name="stx-layout-group" content="${o6(I)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?G1(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=C1(G,(I,N)=>`<body${N} data-stx="${R[1]}">`);let M=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(M,"$1")}}if(Q){let z=Z.__stx_head_injections??m5(),q=s5(G);if(q!==null)z.beforeClose.push(q);let K=i5(G);if(K!==null)z.afterOpen.push(K);G=k4(G,z);let U=X.app?.colorMode;if(U)G=E4(G,U);G=UG(G)}if(Q){let z=W8(G,"data-stx-runtime");if(z){let q=null,K=null,U=null,W=null;try{let{getStoreScript:j}=await n("stx/store-loader",()=>import("./chunk-j5n1td3p.js")),B=X.storesDir,V=await j(B);if(V)K=`<script data-stx-stores>${V}</script>`}catch{}q=await e6([G,K],X);try{let{getFrameworkComposableScript:j}=await n("stx/framework-composables",()=>import("./chunk-0b8032q1.js"));W=await j(G)}catch{}try{let{getComposableScript:j}=await n("stx/composable-loader",()=>import("./chunk-2s0jm6fq.js")),B=X.composablesDir,V=[q,K,W].filter((O)=>O!==null),F=await j(B,G,V);if(F)U=`<script data-stx-composables>${F}</script>`}catch{}let H=[q,K,U,W].filter((j)=>j!==null).map((j)=>`
|
|
3571
3571
|
${j}`).join("");if(H)G=G.slice(0,z.end)+H+G.slice(z.end)}else{let q=await e6([G],X);if(q){let K=G.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(K!==-1)G=G.slice(0,K)+q+`
|
|
3572
3572
|
`+G.slice(K)}}}if(Q)G=b4(G);if(Q&&Z.__stx_inject_css!==!1)G=await q8(G,void 0,X.buildMode==="serve");if(Q)G=M4(G);return G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G})}catch(G){if(G instanceof Z8)throw G;let z=G instanceof Error?G.message:String(G),q=new N2(`Template processing failed: ${z}`,J,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(o0.log(q,{filePath:J,context:Z}),X8.logDetailedError(q,{filePath:J,template:$.substring(0,500)}),X.debug)throw q;return J8.createFallbackContent("Template Processing",q)}}async function WG($,Z,J,X,Y){let Q=process.cwd(),G={...X,partialsDir:X.partialsDir&&!M0.isAbsolute(X.partialsDir)?M0.resolve(Q,X.partialsDir):X.partialsDir,componentsDir:X.componentsDir&&!M0.isAbsolute(X.componentsDir)?M0.resolve(Q,X.componentsDir):X.componentsDir,layoutsDir:X.layoutsDir&&!M0.isAbsolute(X.layoutsDir)?M0.resolve(Q,X.layoutsDir):X.layoutsDir},z=G,q=$;await BG(J,Z),jG(Z,z),q=await M2(()=>Y4(q,Z,J,z),q,(L)=>{o0.log(L,{filePath:J,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${J}: ${L.message}`)}),q=q.replace(/\{\{--[\s\S]*?--\}\}/g,"");let K=p0(q,Y2,(L,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);q=K.output;let U=K.tokens,W=(L)=>U.length===0?L:L.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>U[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";q=q.replace(/@@/g,H),q=q.replace(/@\{\{([\s\S]*?)\}\}/g,(L,w)=>{return`{{ ${w} }}`}),q=H4(q),q=await d6(q,J,Y);let j={};q=P5(q,j);let B={...Z.__sections||{}},V="",F=M3(N3($)),O=/@nolayout\b/.test(q)||F===!1;if(/@nolayout\b/.test(q))q=q.replace(/@nolayout\b\s*/g,"");let _=q.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(_)V=_[1],q=q.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(V=F,!/@section\s*\(/.test(q))q=`@section('content')
|
|
3573
3573
|
${q.trim()}
|
|
@@ -3576,7 +3576,7 @@ ${q.trim()}
|
|
|
3576
3576
|
@endsection`}}if(q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(L,w,R)=>{return B[w]=R,""}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(L,w,R)=>{if(/^(['"]).*\1$/.test(R.trim()))return L;try{let D=e(R.trim(),Z);if(D===void 0)return L;return B[w]=String(D??""),""}catch{return L}}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(L,w,R)=>{if(R.includes("@parent"))B[w]=R.replace("@parent",E1);else B[w]=R.trim();return""}),Z.__sections=B,q=q.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(L,w,R)=>{return B[w]||R||""}),!("slot"in Z)||Z.slot===void 0)q=q.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""});if(q=v5(q,j),V){let L=[],w=i0(q),R=p0(w.output,y1,(D,M)=>`\x00STX_ORPHAN_STYLE_${M}\x00`);if(q=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(D,M,I)=>{let N=M==="SCRIPT"?w.scripts[Number(I)]:R.tokens[Number(I)];if(N)L.push(N);return""}),L.length>0){let D=L.join(`
|
|
3577
3577
|
`);B.content=B.content?`${B.content}
|
|
3578
3578
|
${D}`:D,Z.__sections=B}}if(V)try{let L;if(M0.isAbsolute(V))L=V,Y.add(V);else L=await M2(()=>s2(V,J,G,Y),null,()=>{throw new N2(`Failed to resolve layout path: ${V}`,J,void 0,void 0,`Layout referenced from ${J}`)});if(!L){let N=(k)=>{if(!k)return[];try{let y=M0.isAbsolute(k)?k:M0.resolve(process.cwd(),k);return qG.readdirSync(y).filter((E)=>E.endsWith(".stx")).map((E)=>E.replace(/\.stx$/,""))}catch{return[]}},A=[...N(G.layoutsDir),...N(G.fallbackLayoutsDir)].filter((k,y,E)=>E.indexOf(k)===y).sort(),T=`Layout not found: ${V} (referenced from ${J})`+(A.length>0?`. Available layouts: ${A.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(o0.log(Error(T),{layoutPath:V,filePath:J,available:A},"error"),console.error(`[stx] ${T}`),G.debug)throw new N2(T,J);return q}let w=await M2(()=>Bun.file(L).text(),"",()=>{throw new N2(`Failed to read layout file: ${L}`,J,void 0,void 0,"Layout content could not be loaded")});w=n6(w,L);let R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${L}`);let N={},A=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(y,E,b)=>{return N[E]=b.trim(),""});for(let[y,E]of Object.entries(N))if(B[y]&&B[y].includes(E1)){let b=B[y].indexOf(E1);B[y]=B[y].slice(0,b)+E+B[y].slice(b+E1.length)}else if(!B[y])B[y]=E;let T={...Z,__sections:B},k=`@layout('${R[1]}')${A}`;return await C$(k,T,L,G,Y)}let D=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),M=P5(D,j),I={};return M=M.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(N,A,T)=>{return I[A]=T.trim(),`@slot('${A}')`}),M=M.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(N,A,T)=>{if(B[A]){let k=B[A];if(k.includes(E1)){let y=I[A]||"",E=k.indexOf(E1);k=k.slice(0,E)+y+k.slice(E+E1.length)}return k}return T||""}),M=HG(M,B),M=M.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""}),M=v5(M,j),Z.__originalFilePath=J,q=await $8(M,Z,L,G,Y),q=`<!-- stx-layout: ${V} -->
|
|
3579
|
-
${q}`,W(q)}catch(L){return o0.log(L instanceof Error?L:Error(String(L)),{layoutPath:V,filePath:J},"error"),`[Error processing layout: ${L instanceof Error?L.message:String(L)}]`}return W(await $8(q,Z,J,G,Y))}function HG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(J,X,Y)=>{let Q=Z[X];if(Q!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Q))return Q}return Y||""})}function jG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let J=Z.envPrefix||"STX_PUBLIC_",X={};for(let[Y,Q]of Object.entries(process.env))if(Y.startsWith(J)&&Q!==void 0)X[Y]=Q;$.$env=X}async function BG($,Z){await M2(()=>z4($,Z),void 0,(J)=>{o0.log(J,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${J.message}`)})}async function VG($,Z,J){let X=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y;while((Y=X.exec($))!==null){let Q=Y[1],G=Y[2];if(!/\bserver\b/.test(Q)||!G.trim())continue;try{let{extractVariables:q}=await n("stx/variable-extractor",()=>import("./chunk-
|
|
3579
|
+
${q}`,W(q)}catch(L){return o0.log(L instanceof Error?L:Error(String(L)),{layoutPath:V,filePath:J},"error"),`[Error processing layout: ${L instanceof Error?L.message:String(L)}]`}return W(await $8(q,Z,J,G,Y))}function HG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(J,X,Y)=>{let Q=Z[X];if(Q!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Q))return Q}return Y||""})}function jG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let J=Z.envPrefix||"STX_PUBLIC_",X={};for(let[Y,Q]of Object.entries(process.env))if(Y.startsWith(J)&&Q!==void 0)X[Y]=Q;$.$env=X}async function BG($,Z){await M2(()=>z4($,Z),void 0,(J)=>{o0.log(J,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${J.message}`)})}async function VG($,Z,J){let X=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y;while((Y=X.exec($))!==null){let Q=Y[1],G=Y[2];if(!/\bserver\b/.test(Q)||!G.trim())continue;try{let{extractVariables:q}=await n("stx/variable-extractor",()=>import("./chunk-nh0frxtq.js"));await q(G,Z,J,{preserveExisting:!0})}catch(q){let K=q instanceof Error?q:Error(String(q));o0.log(K,{filePath:J,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${J}: ${K.message}`)}}}async function LG($,Z,J){try{let{interpolateScriptsInTemplate:X}=await n("stx/expressions",()=>import("./chunk-bkg7622z.js"));return X($,Z,{skipServer:!0})}catch(X){let Y=X instanceof Error?X:Error(String(X));return o0.log(Y,{filePath:J,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${J}: ${Y.message}`),$}}async function $8($,Z,J,X,Y){let Q=$,G=X;if(await VG(Q,Z,J),Q=await LG(Q,Z,J),Q=await c7(Q,Z,J),Q=await p7(Q,Z,J),Q=await y7(Q,Z,J,G),Q1(Q))Q=X6(Q,Z),Q=G$(Q,Z);Q=Q6(Q);let{processStreamDirectives:z}=await n("stx/streaming",()=>import("./chunk-31108nwx.js"));Q=z(Q,Z),Q=e7(Q,Z,J,G),Q=await L4(Q,Z,J,G,Y),Q=await A$(Q,Z,J,G,Y),Q=D3(Q,Z,J,G);let{processDeferDirectives:q}=await n("stx/defer",()=>import("./chunk-e7kd0ny8.js"));Q=q(Q,Z,J);let{processTeleportDirectives:K}=await n("stx/teleport",()=>import("./chunk-e0aybavh.js"));Q=K(Q,Z,J);let{processTransitionDirectives:U,processTransitionAttributes:W}=await n("stx/transitions",()=>import("./chunk-vxxxczmn.js"));Q=U(Q,Z,J),Q=W(Q);let{processErrorBoundaryDirectives:H}=await n("stx/error-boundaries",()=>import("./chunk-mc58fhgm.js"));Q=H(Q,Z,J);let{processSuspenseDirectives:j}=await n("stx/suspense",()=>import("./chunk-r90w3x6h.js"));Q=j(Q,Z,J);let{processAsyncDirectives:B}=await n("stx/async-components",()=>import("./chunk-y5jjrnfa.js"));Q=B(Q,Z,J);let{processKeepAliveDirectives:V}=await n("stx/keep-alive",()=>import("./chunk-ym4ggcpy.js"));Q=V(Q,Z,J);let{processVirtualListDirectives:F,processVirtualGridDirectives:O,processInfiniteListDirectives:_}=await n("stx/virtual-scrolling",()=>import("./chunk-zqwmy0av.js"));Q=F(Q,Z,J),Q=O(Q,Z,J),Q=_(Q,Z,J);let{processPartialHydrationDirectives:L,processStaticDirectives:w}=await n("stx/partial-hydration",()=>import("./chunk-jv91rkhx.js"));Q=L(Q,Z,J),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await n("stx/computed",()=>import("./chunk-02af607x.js"));Q=R(Q,Z,J),Q=D(Q,Z,J);let{processFormValidationDirectives:M}=await n("stx/forms-validation",()=>import("./chunk-vzzkhjw7.js"));Q=M(Q,Z,J);let{processHeadDirective:I,processTitleDirective:N,processMetaDirective:A,resetHead:T}=await n("stx/head",()=>import("./chunk-zvw2qgwt.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)T();let k=I(Q);if(Q=k.content,k.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${k.headContent}
|
|
3580
3580
|
`;if(Q=N(Q,Z),Q=A(Q,Z),Q=G4(Q),Q=w5(Q,Z),Q=b7(Q),Q=J4(Q),Q=await S5(Q,Z,J,G,Y),Q=await A$(Q,Z,J,G,Y),Z.__stxProcessingDepth===1)Q=r$(Q,Z);if(Q=Q.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Q=T$(Q),Q=$1(Q,Z,J),Q=k3(Q,Z,{filePath:J,buildMode:G.buildMode}),Q=R5(Q,Z),Q=D5(Q,Z),Q=V2(Q,Z),Q=E5(Q,Z),Q=b5(Q,Z),Q=await _7(Q,Z,J,G),Q=await S3(Q,Z,J),Q=await Y8(Q,Z,J,G),Q=Q8(Q,Z,J,G),Q=J7(Q,Z,J,G),Q=X7(Q,Z,J),Q=Y7(Q,Z,J,G),Q=T7(Q,Z,J,G),Q=k$(Q,Z),Q=I$(Q),Q=l6(Q),!G.skipEventDirectives)Q=o$(Q,Z,J);if(Q=E3(Q,Z,J),G.debug){let i=/\bx-data\s*=/.test(Q),l=Q$($);if(i&&l)console.warn(`[stx] ${J}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
3581
3581
|
Both work on the same page, but they manage separate scopes.
|
|
3582
3582
|
Prefer signals (state/derived/effect) for new components.`)}Q=U4(Q,Z),Q=await _1(Q,Z,J),Q=p6(Q),Q=i6(Q),Q=B3(Q);let{processXElementDirectives:y}=await n("stx/x-element",()=>import("./chunk-kf8t2wq7.js"));Q=y(Q);let E=Z.__originalFilePath||J,b=I9(Z);if(Q=await G6(Q,G,E,b),Q=v7(Q,Z),Q=await Q4(Q,Z,J,G),G.media?.image?.autoSiblings){let i=G.publicDir||"public",{rewriteImagesWithSiblings:l}=await n("stx/image-optimization/auto-sibling",()=>import("./chunk-bw48gj8j.js"));Q=await l(Q,{publicDir:i})}if(G.seo?.enabled)Q=Q7(Q,Z,G);let C=(i,l,K0=!0)=>{if(!l)return i;let J0=l.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),B0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(J0&&B0){if(K0)i=i.replace(B0[0],J0[0]);if(l=l.replace(J0[0],"").trim(),!l)return i}if(/<\/head>/i.test(i))return i.replace(/<\/head>/i,`${l}
|
|
@@ -3590,7 +3590,7 @@ ${W3()}
|
|
|
3590
3590
|
`+L1}else Q=Q.replace("</head>",`${l}
|
|
3591
3591
|
</head>`)}else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
|
|
3592
3592
|
${l}`);else Q=l+`
|
|
3593
|
-
`+Q}{let{scanScriptTags:i}=await n("stx/signal-processing",()=>import("./chunk-
|
|
3593
|
+
`+Q}{let{scanScriptTags:i}=await n("stx/signal-processing",()=>import("./chunk-2ctw99gz.js")),l=[];for(let K0 of i(Q)){if(!/\bserver\b/i.test(K0.attrs))continue;let J0=K0.start+K0.fullMatch.indexOf(">")+1,B0=KG(Q,J0);if(B0===-1)continue;let I0=B0+9;while(I0<Q.length&&/\s/.test(Q[I0]))I0++;l.push({start:K0.start,end:I0})}if(l.length>0){let K0=Array(l.length+1),J0=0;for(let B0=0;B0<l.length;B0++){let{start:I0,end:L1}=l[B0];K0[B0]=Q.slice(J0,I0),J0=L1}K0[l.length]=Q.slice(J0),Q=K0.join("")}}let C0=H9(Q,J);if(C0.hasScoped)Q=C0.html;let Z0=Z.__stx_event_bindings||[],H0=!1,k0=[],b0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:d0}=await n("stx/signal-processing",()=>import("./chunk-2ctw99gz.js"));for(let i of d0(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))k0.push({match:i.fullMatch,attrs:i.attrs,content:i.body});for(let{match:i,attrs:l,content:K0}of k0){H0=!0;let J0=K0;b$(K0,J,X.strict,Z.__originalFilePath);let B0=await T9(K0,{eventBindings:Z0,attrs:l,hasColonDirectives:b0,templateContent:$,filePath:J,projectRoot:process.cwd(),production:X.buildMode==="compile",serverData:b});Q=Q.replace(i,()=>B0)}if(H0)Z.__stx_event_bindings=[];if(!H0&&Z.__stxProcessingDepth===1){let i=Z.__stx_event_bindings||[];if(i.length>0){let l=v9(i);if(l){let K0=Q.lastIndexOf("</body>");Q=K0===-1?Q+l:Q.slice(0,K0)+l+`
|
|
3594
3594
|
`+Q.slice(K0)}Z.__stx_event_bindings=[]}}if(!p4(Q)&&i4(Q))Q=await L9(Q,G);if(Q=n4(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=I7(Q,Z.cspNonce);return Q}var _G=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],OG=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],FG=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function wG($){let Z=[],J=[];return RG($,Z),DG($,Z,J),NG($,J),MG($,Z),{valid:Z.length===0,errors:Z,warnings:J}}function RG($,Z){let J=($.match(/\{\{/g)||[]).length,X=($.match(/\}\}/g)||[]).length;if(J!==X)Z.push({type:"expression",message:`Unclosed expression brackets: found ${J} opening '{{' and ${X} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function DG($,Z,J){for(let X of _G){let Y=new RegExp(`${X.open}(?:\\s|\\()`,"g"),Q=new RegExp(X.close,"g"),G=($.match(Y)||[]).length,z=($.match(Q)||[]).length;if(X.altClose){let q=new RegExp(X.altClose,"g");z+=($.match(q)||[]).length}if(G>z)Z.push({type:"directive",message:`Unclosed @${X.name} directive: found ${G} opening and ${z} closing`,suggestion:`Add ${G-z} missing ${X.close} tag(s)`});else if(z>G)J.push({type:"directive",message:`Extra ${X.close} found: ${z-G} more closing than opening`,suggestion:`Check for orphaned ${X.close} tags`})}}function NG($,Z){for(let J of OG)if(J.pattern.test($))Z.push({type:"syntax",message:J.message,suggestion:J.suggestion})}function MG($,Z){for(let J of FG)if(J.pattern.test($))Z.push({type:"expression",message:`Security warning: ${J.message}`,suggestion:"Remove dangerous code from template expressions"})}function AG($,Z){let J=$.slice(0,Z).split(`
|
|
3595
3595
|
`);return{line:J.length,column:J[J.length-1].length+1}}function kG($,Z,J){let X=[];switch($){case"if":case"elseif":case"unless":if(J.length===0)X.push({type:"syntax",message:`@${$} requires a condition`,suggestion:`Use @${$}(condition)`});break;case"foreach":if(J.length===0||!J[0].includes(" as "))X.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(J.length===0)X.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(J.length===0)X.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(J.length===0)X.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(J.length===0)X.push({type:"syntax",message:`@${$} requires a path`,suggestion:`Use @${$}('path/to/template')`});break}return X}function IG($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function TG($){let Z=$.matchAll(/@([a-z]+)/gi),J=new Set;for(let X of Z){let Y=X[1].toLowerCase();if(!Y.startsWith("end"))J.add(Y)}return Array.from(J)}import s0 from"path";import J2 from"process";var R8=["module","exports","require","props","$props","defineProps","withDefaults","defineClientPayload","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"],H8=new Set(R8),EG=new Set(["props","$props","defineProps"]),bG=new Set(["stx","@stacksjs/stx"]),j8=T1(128),B8=T1(64);function yG($){let Z=[],J=0,X=$.split(`
|
|
3596
3596
|
`);for(let Y of X){let Q=J,G=null,z=!1;for(let q=0;q<Y.length;q++){let K=Y[q];if(z){z=!1;continue}if(K==="\\"){z=!0;continue}if(G){if(K===G)G=null;continue}if(K==="'"||K==='"'||K==="`"){G=K;continue}if(K==="/"&&q+1<Y.length&&Y[q+1]==="/")break;if(K==="{")J++;else if(K==="}")J--}if(Q===0){let q=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(q)Z.push(q[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Y)){let K=Y.match(/(?:const|let|var)\s+(\w+)/);if(K)Z.push(K[1])}else{let K=Y.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(K){let W=K[1].slice(1,-1).split(",").map((H)=>{let j=H.split(":");return(j.length>1?j[1]:j[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...W)}}}}return[...new Set(Z)]}function CG($){let Z=$;Z=Z.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),Z=Z.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),Z=Z.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function J(X){if(!X.includes(":"))return X;let Y=[],Q="",G=0,z=0,q=null;for(let K=0;K<X.length;K++){let U=X[K];if(q){if(Q+=U,U===q)q=null;continue}if(U==='"'||U==="'"||U==="`"){q=U,Q+=U;continue}if(U==="<")G++;else if(U===">"&&G>0)G--;else if(U==="(")z++;else if(U===")")z--;if(U===","&&G===0&&z===0){Y.push(Q),Q="";continue}Q+=U}if(Q)Y.push(Q);return Y.map((K)=>{let U=K.trim(),W=U.startsWith("..."),H=W?U.slice(3):U,j=-1,B=0;for(let R=0;R<H.length;R++)if(H[R]==="<")B++;else if(H[R]===">")B--;else if(H[R]===":"&&B===0){j=R;break}if(j===-1)return K;let F=H.substring(0,j).trim().replace(/\?$/,""),O=H.substring(j+1),_=-1,L=0;for(let R=0;R<O.length;R++)if(O[R]==="<")L++;else if(O[R]===">")L--;else if(O[R]==="="&&L===0){_=R;break}let w=W?"...":"";if(_!==-1)return`${w}${F} = ${O.substring(_+1).trim()}`;return`${w}${F}`}).join(", ")}Z=Z.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(X,Y,Q)=>{if(!Q.includes(":"))return X;return`${Y}(${J(Q)})`});{let X=/\b(function\s+\w*\s*)\(/g,Y,Q=[];while((Y=X.exec(Z))!==null){let G=Y.index+Y[0].length-1,z=1,q=G+1,K=0,U=null;while(q<Z.length&&z>0){let j=Z[q];if(U){if(j===U)U=null;q++;continue}if(j==='"'||j==="'"||j==="`"){U=j,q++;continue}if(j==="<")K++;else if(j===">"&&K>0)K--;else if(K===0){if(j==="(")z++;else if(j===")")z--}if(z>0)q++}if(z!==0)continue;let W=Z.substring(G+1,q);if(!W.includes(":"))continue;let H=J(W);Q.push({start:G+1,end:q,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Q[G];Z=Z.substring(0,z)+K+Z.substring(q)}}return Z=Z.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(X,Y)=>{if(!Y.includes(":"))return X;if(Y.includes("{")||Y.includes("}"))return X;return`(${Y.split(",").map((G)=>{let[z,...q]=G.split("="),K=z.split(":")[0].trim();if(q.length>0)return`${K} = ${q.join("=").trim()}`;return K}).join(", ")}) =>`}),Z=Z.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),Z=Z.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Z=Z.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Z=Z.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Z=Z.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Z=Z.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Z=Z.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Z=Z.replace(/\n\s*\n\s*\n/g,`
|
|
@@ -3612,11 +3612,11 @@ ${$[K]}`,K++;else break}return q=q.trim().replace(/;$/,""),{type:Q,name:G,value:
|
|
|
3612
3612
|
${Q}`,Y++}while(Y<$.length){let Q=$[Y].trim();if(Q.startsWith(".")||Q.startsWith("?."))X+=`
|
|
3613
3613
|
${$[Y]}`,Y++;else break}return{value:X,nextIndex:Y}}function mG($,Z,J){let X=J,Y=Z+1;while(Y<$.length){let Q=k8(X);if(Q!==-1){if(_0(X,"{","}",Q)!==-1)break}let G=$[Y];X+=`
|
|
3614
3614
|
${G}`,Y++}return{functionCode:X,nextIndex:Y}}function F8($,Z){let J=e($,Z)??e(`(${$})`,Z);if(J!==void 0)return J;if(!/\bprocess\b/.test($))return;let X={...Z,process:Object.freeze({env:{...J2.env}})},Y=Object.keys(X).filter(X2),Q=Y.map((G)=>X[G]);try{return Function(...Y,`'use strict'; return (${$});`)(...Q)}catch{try{return Function(...Y,`'use strict'; return ${$};`)(...Q)}catch{return}}}async function lG($,Z,J){let X=$.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Q of X){let[,,G,z]=Q;try{let q=z.trim().replace(/;$/,""),K=F8(q,Z);if(K!==void 0)Z[G]=K}catch(q){console.warn(`Failed to parse export ${G} in fallback:`,q)}}let Y=$.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Q of Y){let[,,G,z]=Q;if(!(G in Z))try{let q=z.trim().replace(/;$/,""),K=F8(q,Z);if(K!==void 0)Z[G]=K}catch{}}}function cG($){let Z=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),J=Z?Z[1]:"",X=Z?$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):$;return{scriptContent:J,templateWithoutScript:X}}function pG($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var A2=new u1(500),b9=new u1(1000),C8=33554432,f$=C8;function nG($){let Z=$.componentRenderCacheBytes;if(typeof Z!=="number"||Z<0||Z===f$)return;f$=Z,y9.setMaxBytes(Z)}var y9=new u1(2000,{maxBytes:C8,sizeOf:($)=>$.output.length});function oG($){let Z=new WeakSet;try{let J=(X)=>{if(X===void 0)return{__stxType:"undefined"};if(typeof X==="bigint")return{__stxType:"bigint",value:X.toString()};if(typeof X==="function"||typeof X==="symbol")throw TypeError("Non-serializable component input");if(X===null||typeof X!=="object")return X;if(Z.has(X))throw TypeError("Circular component input");if(Z.add(X),X instanceof Date)return{__stxType:"date",value:X.toISOString()};if(Array.isArray(X))return X.map(J);let Y={};for(let Q of Object.keys(X).sort())Y[Q]=J(X[Q]);return Y};return JSON.stringify(J($))}catch{return null}}function I8($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function sG($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function D1($){return!sG($)}var E9=new Map;function P$($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let J=E9.get(Z);if(J)return J;if(E9.size>=16)E9.clear();let X=new Bun.Transpiler($);return E9.set(Z,X),X}var T8=new WeakMap,rG=256;function N1($){try{let Z=P$({loader:"ts",target:"browser",define:$2()}),J=T8.get(Z);if(!J)J=new Map,T8.set(Z,J);let X=J.get($);if(X!==void 0)return X;let Y=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");Y=Y.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let Q=[];Y=Y.replace(/\{!![\s\S]*?!!\}/g,(z)=>{let q=Q.length;return Q.push(z),`"__STX_EXPR_${q}__"`}),Y=Y.replace(/\{\{\{[\s\S]*?\}\}\}/g,(z)=>{let q=Q.length;return Q.push(z),`"__STX_EXPR_${q}__"`}),Y=Y.replace(/\{\{[\s\S]*?\}\}/g,(z)=>{let q=Q.length;return Q.push(z),`"__STX_EXPR_${q}__"`});let G=Z.transformSync(Y);for(let z=0;z<Q.length;z++)G=G.replace(`"__STX_EXPR_${z}__"`,Q[z]),G=G.replace(`'__STX_EXPR_${z}__'`,Q[z]);if(J.size>=rG){let z=J.keys().next();if(!z.done)J.delete(z.value)}return J.set($,G),G}catch(Z){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",Z);return $}}function aG($){let Z=[],J=new Set,X=0,Y=0,Q=$.length,G=(U)=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]===U){Y++;return}Y++}},z=()=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]==="`"){Y++;return}if($[Y]==="$"&&$[Y+1]==="{"){Y+=2;let U=1;while(Y<Q&&U>0)if($[Y]==="{")U++,Y++;else if($[Y]==="}")U--,Y++;else if($[Y]==="'"||$[Y]==='"')G($[Y]);else if($[Y]==="`")z();else Y++;continue}Y++}},q=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
|
|
3615
|
-
`)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},K=()=>{if(X!==0)return;let U=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(U){let B=U[2].split(",").map((V)=>{let F=V.trim().split(":");return F[F.length-1].trim()});for(let V of B)if(V&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(V)&&!J.has(V))Z.push(V),J.add(V);return}let W=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(W){let B=W[2];if(!J.has(B))Z.push(B),J.add(B);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!J.has(B))Z.push(B),J.add(B);return}let j=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!J.has(B))Z.push(B),J.add(B)}};while(Y<Q){if(q())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){z();continue}if($[Y]==="{"){X++,Y++;continue}if($[Y]==="}"){X--,Y++;continue}if(X===0&&/[a-z]/i.test($[Y])&&(Y===0||/\s|[;{}()]/.test($[Y-1])))K();Y++}return Z}function tG($){let Z=[],J=0,X=0,Y=null;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(Y){if(G==="\\"){Q++;continue}if(G===Y)Y=null;continue}if(G==='"'||G==="'"||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{")J++;else if(G===")"||G==="]"||G==="}")J--;else if(G===","&&J===0)Z.push($.slice(X,Q)),X=Q+1}if(X<$.length)Z.push($.slice(X));return Z}function eG($){let Z=0,J=null;for(let X=0;X<$.length;X++){let Y=$[X];if(J){if(Y==="\\"){X++;continue}if(Y===J)J=null;continue}if(Y==='"'||Y==="'"||Y==="`"){J=Y;continue}if(Y==="("||Y==="["||Y==="{")Z++;else if(Y===")"||Y==="]"||Y==="}")Z--;else if(Y==="="&&Z===0){let Q=$[X-1],G=$[X+1];if(Q==="!"||Q==="<"||Q===">"||Q==="=")continue;if(G==="="||G===">")continue;return X}}return-1}function $z($,Z){try{let J=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!J)return;let X=J.index-1;while(X>=0&&/\s/.test($[X]))X--;if($[X]!=="}")return;let Y=X,Q=0,G=-1;for(;X>=0;X--){let q=$[X];if(q==="}")Q++;else if(q==="{"){if(Q--,Q===0){G=X;break}}}if(G===-1)return;let z=$.slice(G+1,Y);for(let q of tG(z)){let K=q.trim();if(!K||K.startsWith("..."))continue;let U=eG(K);if(U===-1)continue;let W=K.slice(0,U).trim();if(!/^[A-Z_$][\w$]*$/i.test(W))continue;if(Z[W]!==void 0)continue;let H=K.slice(U+1).trim();if(!H)continue;try{let j=Object.keys(Z).filter(X2),B=Function(...j,`"use strict"; return (${H});`);Z[W]=B(...j.map((V)=>Z[V]))}catch{}}}catch{}}async function A9($,Z,J,X,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(F)=>F.split("-").map((O)=>O.charAt(0).toUpperCase()+O.slice(1)).join(""),z=(F)=>F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q=J.__importedComponents;if(q){for(let F of[Q,Q.toLowerCase(),G(Q),z(Q)])if(q.has(F))return!0}let K=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${z(Q)}.stx`])],U=typeof Y.root==="string"?h.resolve(Y.root):void 0,W=U??h.dirname(X),H=[],j=(F)=>{if(F&&!H.includes(F))H.push(F)},B=J.__originalFilePath;if(B)j(h.join(h.dirname(B),"components"));if(j(Z),j(Y._rootComponentsDir),j(h.join(h.dirname(X),"components")),j(Y.componentsDir),U)j(h.resolve(U,"resources/views/components")),j(h.resolve(U,"resources/components")),j(h.resolve(U,"src/components")),j(h.resolve(U,"components"));let V=Y._pluginComponentDirs;if(Array.isArray(V))for(let F of V)j(typeof F==="string"?F:null);if(j(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return s(h.resolve(h.dirname(X),`${Q}.stx`));for(let F of H){let O=h.isAbsolute(F)?F:h.resolve(W,F);for(let _ of K)if(await s(h.join(O,_)))return!0}return!1}function Zz($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function Jz($){if(!$)return!1;let Z=$.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(Z)}function Xz($){let Z=new Set,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let X of $){let Y;while((Y=J.exec(X))!==null)Z.add(Y[1]);J.lastIndex=0}return[...Z]}async function A1($,Z,J,X,Y,Q,G,z=new Set,q){let{extractVariables:K}=await n("stx/variable-extractor",()=>import("./chunk-
|
|
3615
|
+
`)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},K=()=>{if(X!==0)return;let U=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(U){let B=U[2].split(",").map((V)=>{let F=V.trim().split(":");return F[F.length-1].trim()});for(let V of B)if(V&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(V)&&!J.has(V))Z.push(V),J.add(V);return}let W=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(W){let B=W[2];if(!J.has(B))Z.push(B),J.add(B);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!J.has(B))Z.push(B),J.add(B);return}let j=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!J.has(B))Z.push(B),J.add(B)}};while(Y<Q){if(q())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){z();continue}if($[Y]==="{"){X++,Y++;continue}if($[Y]==="}"){X--,Y++;continue}if(X===0&&/[a-z]/i.test($[Y])&&(Y===0||/\s|[;{}()]/.test($[Y-1])))K();Y++}return Z}function tG($){let Z=[],J=0,X=0,Y=null;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(Y){if(G==="\\"){Q++;continue}if(G===Y)Y=null;continue}if(G==='"'||G==="'"||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{")J++;else if(G===")"||G==="]"||G==="}")J--;else if(G===","&&J===0)Z.push($.slice(X,Q)),X=Q+1}if(X<$.length)Z.push($.slice(X));return Z}function eG($){let Z=0,J=null;for(let X=0;X<$.length;X++){let Y=$[X];if(J){if(Y==="\\"){X++;continue}if(Y===J)J=null;continue}if(Y==='"'||Y==="'"||Y==="`"){J=Y;continue}if(Y==="("||Y==="["||Y==="{")Z++;else if(Y===")"||Y==="]"||Y==="}")Z--;else if(Y==="="&&Z===0){let Q=$[X-1],G=$[X+1];if(Q==="!"||Q==="<"||Q===">"||Q==="=")continue;if(G==="="||G===">")continue;return X}}return-1}function $z($,Z){try{let J=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!J)return;let X=J.index-1;while(X>=0&&/\s/.test($[X]))X--;if($[X]!=="}")return;let Y=X,Q=0,G=-1;for(;X>=0;X--){let q=$[X];if(q==="}")Q++;else if(q==="{"){if(Q--,Q===0){G=X;break}}}if(G===-1)return;let z=$.slice(G+1,Y);for(let q of tG(z)){let K=q.trim();if(!K||K.startsWith("..."))continue;let U=eG(K);if(U===-1)continue;let W=K.slice(0,U).trim();if(!/^[A-Z_$][\w$]*$/i.test(W))continue;if(Z[W]!==void 0)continue;let H=K.slice(U+1).trim();if(!H)continue;try{let j=Object.keys(Z).filter(X2),B=Function(...j,`"use strict"; return (${H});`);Z[W]=B(...j.map((V)=>Z[V]))}catch{}}}catch{}}async function A9($,Z,J,X,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(F)=>F.split("-").map((O)=>O.charAt(0).toUpperCase()+O.slice(1)).join(""),z=(F)=>F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q=J.__importedComponents;if(q){for(let F of[Q,Q.toLowerCase(),G(Q),z(Q)])if(q.has(F))return!0}let K=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${z(Q)}.stx`])],U=typeof Y.root==="string"?h.resolve(Y.root):void 0,W=U??h.dirname(X),H=[],j=(F)=>{if(F&&!H.includes(F))H.push(F)},B=J.__originalFilePath;if(B)j(h.join(h.dirname(B),"components"));if(j(Z),j(Y._rootComponentsDir),j(h.join(h.dirname(X),"components")),j(Y.componentsDir),U)j(h.resolve(U,"resources/views/components")),j(h.resolve(U,"resources/components")),j(h.resolve(U,"src/components")),j(h.resolve(U,"components"));let V=Y._pluginComponentDirs;if(Array.isArray(V))for(let F of V)j(typeof F==="string"?F:null);if(j(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return s(h.resolve(h.dirname(X),`${Q}.stx`));for(let F of H){let O=h.isAbsolute(F)?F:h.resolve(W,F);for(let _ of K)if(await s(h.join(O,_)))return!0}return!1}function Zz($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function Jz($){if(!$)return!1;let Z=$.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(Z)}function Xz($){let Z=new Set,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let X of $){let Y;while((Y=J.exec(X))!==null)Z.add(Y[1]);J.lastIndex=0}return[...Z]}async function A1($,Z,J,X,Y,Q,G,z=new Set,q){let{extractVariables:K}=await n("stx/variable-extractor",()=>import("./chunk-nh0frxtq.js")),U=z??new Set;if(U.has($))return`[Circular component reference: ${$}]`;let W=new Set(U);W.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&Zz(H)?H:"";try{let B=(d)=>d.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),V=(d)=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,O=null,_=Y.__importedComponents;if(_){let d=[F,F.toLowerCase(),B(F),V(F)];for(let m of d)if(_.has(m)){O=_.get(m);break}}let L=[];if(!O){let d=[`${F}.stx`,`${B(F)}.stx`,`${V(F)}.stx`],m=[...new Set(d)],z0=Y.__originalFilePath,o=[];if(z0){let L0=h.join(h.dirname(z0),"components");o.push(L0)}if(X)o.push(X);let V0=G._rootComponentsDir;if(typeof V0==="string"&&!o.includes(V0))o.push(V0);let w0=h.join(h.dirname(Q),"components");if(!o.includes(w0))o.push(w0);if(G.componentsDir&&G.componentsDir!==X&&!o.includes(G.componentsDir))o.push(G.componentsDir);let S0=typeof G.root==="string"?h.resolve(G.root):void 0,a0=S0??h.dirname(Q),y0=[];if(S0)y0.push(h.resolve(S0,"resources/views/components")),y0.push(h.resolve(S0,"resources/components")),y0.push(h.resolve(S0,"src/components")),y0.push(h.resolve(S0,"components"));y0.push(h.resolve(import.meta.dir,"components"));for(let L0 of y0)if(!o.includes(L0))o.push(L0);let c0=G._pluginComponentDirs;if(Array.isArray(c0)){for(let L0 of c0)if(typeof L0==="string"&&!o.includes(L0))o.push(L0)}if(G.fallbackComponentsDir&&!o.includes(G.fallbackComponentsDir))o.push(G.fallbackComponentsDir);let X1=[...new Set(o.map((L0)=>{if(!L0)return L0;return h.isAbsolute(L0)?L0:h.resolve(a0,L0)}))];o.length=0,o.push(...X1);let r=`${F}\x00${Q}\x00${X1.join("\x00")}`,t0=b9.get(r);if(t0)if(await s(t0))O=t0;else b9.delete(r);if(!O&&(F.startsWith("./")||F.startsWith("../")))O=h.resolve(h.dirname(Q),`${F}.stx`),L.push(O);else if(!O)for(let L0 of o){if(!L0)continue;for(let E2 of m){let b2=h.join(L0,E2);if(L.push(b2),await s(b2)){O=b2;break}}if(O)break;if(!O)try{let E2=await import("fs");if(!E2.statSync(L0,{throwIfNoEntry:!1})?.isDirectory())continue;let l8=8,C9=[{path:L0,depth:0}];while(C9.length>0&&!O){let y2=C9.pop();if(y2.depth>=l8)continue;let u$;try{u$=E2.readdirSync(y2.path,{withFileTypes:!0})}catch{continue}for(let C2 of u$){if(!C2.isDirectory())continue;if(C2.name==="node_modules"||C2.name.startsWith("."))continue;let d$=h.join(y2.path,C2.name);for(let c8 of m){let S9=h.join(d$,c8);if(L.push(S9),await s(S9)){O=S9;break}}if(O)break;C9.push({path:d$,depth:y2.depth+1})}}}catch{}if(O)break}if(O)b9.set(r,O)}if(!O||!await s(O)){let d=L.length>0?`
|
|
3616
3616
|
Searched paths:
|
|
3617
3617
|
${L.map((m)=>` - ${m}`).join(`
|
|
3618
|
-
`)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${d}`}q.add(O);let w;if(A2.has(O))w=A2.get(O);else try{w=await Bun.file(O).text(),A2.set(O,w)}catch(d){return`[Error loading component: ${d instanceof Error?d.message:String(d)}]`}let R=new Set(["__originalFilePath","__importedComponents",S2,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[d,m]of Object.entries(Y))if(!d.startsWith("__")||R.has(d))D[d]=m;let M=J;if(J.includes("@include")){let{processIncludes:d}=await n("stx/includes",()=>import("./chunk-
|
|
3619
|
-
`)}`}if(J&&J0.includes("{{ text || slot }}"))J0=J0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>J);let{applySlots:B0}=await n("stx/slots",()=>import("./chunk-
|
|
3618
|
+
`)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${d}`}q.add(O);let w;if(A2.has(O))w=A2.get(O);else try{w=await Bun.file(O).text(),A2.set(O,w)}catch(d){return`[Error loading component: ${d instanceof Error?d.message:String(d)}]`}let R=new Set(["__originalFilePath","__importedComponents",S2,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[d,m]of Object.entries(Y))if(!d.startsWith("__")||R.has(d))D[d]=m;let M=J;if(J.includes("@include")){let{processIncludes:d}=await n("stx/includes",()=>import("./chunk-508p29a1.js"));M=await d(J,Y,Q,G,q)}let I=i0(M),N=[],A=I.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(d,m)=>{let z0=I.scripts[Number(m)]||"",o=z0.match(/^<script\b([^>]*)>/i)?.[1]||"",V0=o.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),w0=!V0||["module","text/javascript","application/javascript"].includes(V0);if(!/\bserver\b/i.test(o)&&w0)return N.push(z0),"";return z0}),{extractSlotContent:T}=await n("stx/slots",()=>import("./chunk-amwtttwf.js")),k=T(A),y={};if(k.defaultSlot?.trim())y.default=k.defaultSlot;for(let[d,m]of k.namedSlots)y[d]=m.content;let E=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},b=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++E.n}_${E.key}`,C={...D,$uid:b,...Z,props:Z,slot:A,$slots:y,__processedComponents:W,__sections:{},__stx_signals_gate:Q1(w)||Jz(J)};$z(w,C);let v=w,P=X9(v);if(P)v=P.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,x=[...w.matchAll(g)],$0=[],r0=x.some((d)=>/\bserver\b/.test(d[1]||"")&&/\bcache\b/.test(d[1]||"")),A0=null,C0=null,Z0=null,H0=0,k0=null;if(nG(G),r0&&f$>0){let d=oG({props:Z,slot:J,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,uid:b});if(d!==null){A0=`${O}\x00${V1(w)}\x00${d}`;let m=y9.get(A0);if(m){for(let z0 of m.dependencies)q.add(z0);if(e$(Y,m.clientFactories),E.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let z0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let o of m.preservedClientExpressions)z0.add(o);Y.__stx_preserved_client_expressions=[...z0]}return m.output}C0=new Set(q),Z0=a$(Y),H0=E.n,k0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[])}}for(let d of x){let m=d[1]||"",z0=d[2]||"",o=m.includes("server");if(D1(m)&&z0.trim())z0=N1(z0);if(o&&z0)try{await K(z0,C,O)}catch(w0){}if(!o){let w0=z0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),S0=w0.includes("{{")&&w0.includes("}}"),a0=w0.includes("{!!")&&w0.includes("!!}");if(S0||a0)w0=l9(w0,C);let y0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");$0.push(`<script${y0}>${w0}</script>`)}}let b0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),d0=b0?b0[1]:"",i=b0?b0[2]:"",l="",K0=d0&&/\bscoped\b/i.test(d0);if(b0)l=`<style${d0}>${i}</style>`;let J0=v;if(J0=J0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),b0)J0=J0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let d=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(J0=J0.replace(d,(z0,o)=>{let V0=o.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(V0)m.push(`<style${V0[1]}>${V0[2]}</style>`);return""}),J0=J0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)l=`${l}${m.join(`
|
|
3619
|
+
`)}`}if(J&&J0.includes("{{ text || slot }}"))J0=J0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>J);let{applySlots:B0}=await n("stx/slots",()=>import("./chunk-amwtttwf.js")),{defaultSlot:I0,namedSlots:L1}=k;J0=await B0(J0,I0,L1,C);let I2=$0.some((d)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(d)),T2=Xz($0),S=Array.isArray(C.__stx_client_signal_names)?C.__stx_client_signal_names:[];if(T2.length>0||S.length>0)C.__stx_client_signal_names=[...new Set([...S,...T2])];let f={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:h.dirname(O),skipSignalsRuntime:!0,skipEventDirectives:I2||$0.length===0,defaultLayout:void 0};C.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let c=await C$(J0,C,O,f,q),t=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let d of c.matchAll(/\{\{([\s\S]*?)\}\}/g))t.add(d[1].trim());if(t.size>0)Y.__stx_preserved_client_expressions=[...t];let G0=b,X0=c;if(I2){let d="";if(Object.keys(Z).length>0)try{d=` data-stx-props="${I8(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${I8(j)}"`:"";X0=`<div data-stx-scope="${G0}"${d}${m}>${c}</div>`;let z0=await Promise.all($0.map(async(o)=>{let V0=o.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!V0)return o;let[,w0,S0]=V0,{vendorStyleTags:a0,factoryBody:y0}=await Gz(S0,O,G.buildMode==="compile"),c0=j?null:f9(Y,y0),X1=c0?`window.__stxComponentFactories[${JSON.stringify(c0)}](${JSON.stringify(G0)});`:`(${y0})(${JSON.stringify(G0)});`;if(j)return`${a0}<script type="stx/island" data-stx-island="${G0}" data-stx-scoped${w0}>${X1}</script>`;return`${a0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${G0}"${w0}>${X1}</script>`}));if(X0=X0+`
|
|
3620
3620
|
`+z0.join(`
|
|
3621
3621
|
`),l)X0+=`
|
|
3622
3622
|
`+l}else{if(l)X0+=`
|
|
@@ -3639,7 +3639,7 @@ ${a.yellow}${a.bold}Message:${a.reset} ${Z}
|
|
|
3639
3639
|
`,z)U+=`
|
|
3640
3640
|
${a.blue}${a.bold}Context:${a.reset}
|
|
3641
3641
|
${a.dim}${z}${a.reset}
|
|
3642
|
-
`;return U}function ZL(){A2.clear(),b9.clear(),y9.clear()}function JL(){return{size:A2.size,maxSize:500}}var v$=T1(128);async function Gz($,Z,J){let X=V1($,Z,J),Y=v$.get(X);if(Y){if(y8(Y.deps))return Y;v$.delete(X)}let Q=g$($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,z=h$(Q.styles);G=p1(G).code;let{hasUserImports:q,bundleClientScript:K}=await n("stx/client-script-bundler",()=>import("./chunk-
|
|
3642
|
+
`;return U}function ZL(){A2.clear(),b9.clear(),y9.clear()}function JL(){return{size:A2.size,maxSize:500}}var v$=T1(128);async function Gz($,Z,J){let X=V1($,Z,J),Y=v$.get(X);if(Y){if(y8(Y.deps))return Y;v$.delete(X)}let Q=g$($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,z=h$(Q.styles);G=p1(G).code;let{hasUserImports:q,bundleClientScript:K}=await n("stx/client-script-bundler",()=>import("./chunk-ddqynjve.js")),U=[],W=!1;if(q(G)){let O=G;G=await K(O,Z,{projectRoot:process.cwd(),minify:J,collectInputs:U}),W=G===O}let{stripStxRuntimeImports:H}=await n("stx/signal-processing",()=>import("./chunk-2ctw99gz.js"));G=H(G);let j=Z1(G),B=aG(j),V=`function(__scopeId) {
|
|
3643
3643
|
${h1("const",[...E8,...B],j)}
|
|
3644
3644
|
const __scope = window.stx._scopes = window.stx._scopes || {};
|
|
3645
3645
|
const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
|
|
@@ -3738,7 +3738,7 @@ else {
|
|
|
3738
3738
|
// STX: auto-generated event bindings
|
|
3739
3739
|
${$.map((J,X)=>Nz(J,X)).join(`
|
|
3740
3740
|
`)}`}function f8($){let Z=[],J=new Set,X=$.replace(/^\s*import\s+.*$/gm,""),Y=0,Q=X.length,G=0;while(G<Q){let z=X[G];if(z==="'"||z==='"'||z==="`"){let q=z;if(G++,q==="`"){let K=0;while(G<Q){if(X[G]==="\\"){G+=2;continue}if(X[G]==="`"&&K===0){G++;break}if(X[G]==="$"&&X[G+1]==="{"){K++,G+=2;continue}if(X[G]==="}"&&K>0){K--,G++;continue}G++}}else while(G<Q){if(X[G]==="\\"){G+=2;continue}if(X[G]===q){G++;break}G++}continue}if(z==="/"&&X[G+1]==="/"){while(G<Q&&X[G]!==`
|
|
3741
|
-
`)G++;continue}if(z==="/"&&X[G+1]==="*"){G+=2;while(G<Q-1&&!(X[G]==="*"&&X[G+1]==="/"))G++;G+=2;continue}if(z==="{"){Y++,G++;continue}if(z==="}"){Y--,G++;continue}if(Y===0){let q=X.slice(G),K=q.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(K){let H=K[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=K[0].length;continue}let U=q.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(U){U[1].split(",").forEach((H)=>{let j=H.trim(),B=j.indexOf(":"),V=B>=0?j.slice(B+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(V&&!V.startsWith("_")&&!J.has(V))Z.push(V),J.add(V)}),G+=U[0].length;continue}let W=q.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(W){let H=W[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=W[0].length;continue}}G++}return Z}var Az=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 kz($){let Z=new Set,J=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function X(H){let j;while((j=J.exec(H))!==null){let B=j[0];if(!Az.has(B))Z.add(B)}}let Y=/\{\{([\s\S]*?)\}\}/g,Q;while((Q=Y.exec($))!==null)X(Q[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Q=G.exec($))!==null)X(Q[1]);let z=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=z.exec($))!==null)X(Q[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=q.exec($))!==null)X(Q[1]);let K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=K.exec($))!==null)X(Q[1]);let U=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=U.exec($))!==null)X(Q[1]);let W=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=W.exec($))!==null)X(Q[1]);return Z}async function T9($,Z={}){let J=$,X="",Y=!1,Q=[],G=g$(J,{filePath:Z.filePath,projectRoot:Z.projectRoot});J=G.code;let z=h$(G.styles),q=p1(J);J=q.code,Q=[...q.imports,...q.models];let{hasUserImports:K,bundleClientScript:U}=await n("stx/client-script-bundler",()=>import("./chunk-
|
|
3741
|
+
`)G++;continue}if(z==="/"&&X[G+1]==="*"){G+=2;while(G<Q-1&&!(X[G]==="*"&&X[G+1]==="/"))G++;G+=2;continue}if(z==="{"){Y++,G++;continue}if(z==="}"){Y--,G++;continue}if(Y===0){let q=X.slice(G),K=q.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(K){let H=K[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=K[0].length;continue}let U=q.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(U){U[1].split(",").forEach((H)=>{let j=H.trim(),B=j.indexOf(":"),V=B>=0?j.slice(B+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(V&&!V.startsWith("_")&&!J.has(V))Z.push(V),J.add(V)}),G+=U[0].length;continue}let W=q.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(W){let H=W[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=W[0].length;continue}}G++}return Z}var Az=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 kz($){let Z=new Set,J=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function X(H){let j;while((j=J.exec(H))!==null){let B=j[0];if(!Az.has(B))Z.add(B)}}let Y=/\{\{([\s\S]*?)\}\}/g,Q;while((Q=Y.exec($))!==null)X(Q[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Q=G.exec($))!==null)X(Q[1]);let z=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=z.exec($))!==null)X(Q[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=q.exec($))!==null)X(Q[1]);let K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=K.exec($))!==null)X(Q[1]);let U=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=U.exec($))!==null)X(Q[1]);let W=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=W.exec($))!==null)X(Q[1]);return Z}async function T9($,Z={}){let J=$,X="",Y=!1,Q=[],G=g$(J,{filePath:Z.filePath,projectRoot:Z.projectRoot});J=G.code;let z=h$(G.styles),q=p1(J);J=q.code,Q=[...q.imports,...q.models];let{hasUserImports:K,bundleClientScript:U}=await n("stx/client-script-bundler",()=>import("./chunk-ddqynjve.js"));if(K(J))J=await U(J,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let _=d8(J);J=_.code,X=m8(_.stxImports,_.browserImports.filter((L)=>!Q.includes(L)))}if(X=`${Y$(J,Z.serverData)}${X}`,J=Z1(J),!Y&&D1(Z.attrs||""))J=N1(J);let W=Mz(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let _=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),L=`type="module" data-stx-scoped${_?` ${_}`:""}`;return`${z}<script ${L}>
|
|
3742
3742
|
${c1(`${X}${J}
|
|
3743
3743
|
${W}`)}
|
|
3744
3744
|
</script>`}let B=g8($),V=/function __stx_setup_/.test(J),F=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function O(_){let L=_.length>0?`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$l as k,Rl as c,Ul as d,Vl as e,Wl as f,Xl as g,Yl as h,Zl as i,_l as j,am as l,bm as m}from"./chunk-
|
|
2
|
+
import{$l as k,Rl as c,Ul as d,Vl as e,Wl as f,Xl as g,Yl as h,Zl as i,_l as j,am as l,bm as m}from"./chunk-havegv3v.js";import"./chunk-ymc99r5x.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import{Ys as a,Zs as b}from"./chunk-qjkzpd68.js";import"./chunk-bq6q6pjx.js";import"./chunk-0xnvkqn6.js";import"./chunk-fv923f7g.js";import"./chunk-2e6xafcm.js";import"./chunk-nygtwffe.js";import"./chunk-461br5nn.js";import"./chunk-h7v70dbp.js";import"./chunk-drbbt69f.js";import"./chunk-kb5j08tq.js";import"./chunk-2vza9m2x.js";export{h as transformAutoImports,b as stripCommentsAndLiterals,e as renderVendorStyleTags,m as processClientScript,g as injectBrowserCoreAutoImports,l as generateServerDataBridge,j as generateBrowserAutoImportDestructuring,i as generateAutoImportDestructuring,a as findInterpolationEnd,k as extractBridgeData,d as extractAndStripCssImports,f as STX_AUTO_IMPORTS,c as BROWSER_CORE_IMPORTS};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Yi as a,Zi as b}from"./chunk-
|
|
2
|
+
import{Yi as a,Zi as b}from"./chunk-k4aq88mj.js";import"./chunk-efr3ejqt.js";import"./chunk-37zxqngs.js";import"./chunk-havegv3v.js";import"./chunk-ymc99r5x.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-bq6q6pjx.js";import"./chunk-0xnvkqn6.js";import"./chunk-fv923f7g.js";import"./chunk-2e6xafcm.js";import"./chunk-nygtwffe.js";import"./chunk-461br5nn.js";import"./chunk-h7v70dbp.js";import"./chunk-drbbt69f.js";import"./chunk-kb5j08tq.js";import"./chunk-2vza9m2x.js";export{a as getStoreScript,b as clearStoreCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{bj as O,cj as w,dj as Z}from"./chunk-efr3ejqt.js";import{$k as R,gl as U,ll as T}from"./chunk-
|
|
2
|
+
import{bj as O,cj as w,dj as Z}from"./chunk-efr3ejqt.js";import{$k as R,gl as U,ll as T}from"./chunk-37zxqngs.js";import{Pp as k,Sl as M,er as C,po as W}from"./chunk-havegv3v.js";import{Vt as E,Wt as L}from"./chunk-nygtwffe.js";import{_t as B}from"./chunk-h7v70dbp.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd(),externalizeUserModules:!1});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
|
|
3
3
|
${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(G.length===0)return Z(Y,z,K,""),null;let j=G.join(`
|
|
4
4
|
|
|
5
5
|
`),x=`;(function(){
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Hp as H,Zp as x,cr as g,pm as O,uo as R}from"./chunk-
|
|
2
|
+
import{Hp as H,Zp as x,cr as g,pm as O,uo as R}from"./chunk-havegv3v.js";import b from"path";var v={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},M=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var T=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function f(q){let B=[],Q=0,G;T.lastIndex=0;while((G=T.exec(q))!==null){if(G.index>Q){let X=q.slice(Q,G.index);if(X.trim())B.push({type:B.length===0?"shell":"content",content:X})}let J=G[1],K=G[2];B.push({type:"suspense",name:J,content:K}),Q=G.index+G[0].length}if(Q<q.length){let J=q.slice(Q);if(J.trim())B.push({type:B.length===0?"shell":"content",content:J})}if(B.length===0)B.push({type:"shell",content:q});return B}async function r(q,B={},Q={}){let G={...g,...Q,streaming:{...v,...Q.streaming}},J=G.streaming?.bufferSize||16384;return new ReadableStream({async start(K){try{let X=await Bun.file(q).text(),z=X.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),L=z?z[1]:"",Y=X.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j={...B,__filename:q,__dirname:b.dirname(q)};if(L.trim())await R(L,j,q);let D=f(Y),$=new Set;if(!D.some((w)=>w.type==="suspense")){let w=G.streaming?.strategy||"auto",U=new RegExp(M.source,"g");if(!(w!=="manual"&&U.test(Y))){let F=await H(Y,j,q,G,$);for(let V=0;V<F.length;V+=J)K.enqueue(F.slice(V,V+J)),await new Promise((W)=>setTimeout(W,0))}else{let F=[],V=new RegExp(M.source,"g"),W;while((W=V.exec(Y))!==null)F.push({name:W[1],content:W[2],start:W.index,end:W.index+W[0].length});let y=0;for(let A of F){if(A.start>y){let k=Y.slice(y,A.start);if(k.trim()){let E=await H(k,j,q,G,$);K.enqueue(E),await new Promise((S)=>setTimeout(S,0))}}let I=await H(A.content,j,q,G,$);K.enqueue(I),await new Promise((k)=>setTimeout(k,0)),y=A.end}if(y<Y.length){let A=Y.slice(y);if(A.trim()){let I=await H(A,j,q,G,$);K.enqueue(I)}}}}else{let w=new Map;for(let Z of D)if(Z.type==="shell"||Z.type==="content"){let F=await H(Z.content,j,q,G,$);K.enqueue(F)}else if(Z.type==="suspense"&&Z.name){let F=`stx-suspense-${Z.name}`;K.enqueue(`<div id="${F}" data-suspense="${Z.name}" style="display:contents;">
|
|
3
3
|
<template data-suspense-fallback>Loading...</template>
|
|
4
4
|
</div>`),w.set(Z.name,H(Z.content,j,q,G,$))}K.enqueue(`
|
|
5
5
|
<script>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{qo as a,ro as b,so as c,to as d,uo as e,vo as f,wo as g,xo as h,yo as i,zo as j}from"./chunk-
|
|
2
|
+
import{qo as a,ro as b,so as c,to as d,uo as e,vo as f,wo as g,xo as h,yo as i,zo as j}from"./chunk-havegv3v.js";import"./chunk-ymc99r5x.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-bq6q6pjx.js";import"./chunk-0xnvkqn6.js";import"./chunk-fv923f7g.js";import"./chunk-2e6xafcm.js";import"./chunk-nygtwffe.js";import"./chunk-461br5nn.js";import"./chunk-h7v70dbp.js";import"./chunk-drbbt69f.js";import"./chunk-kb5j08tq.js";import"./chunk-2vza9m2x.js";export{b as stripTypeScript,h as splitDeclaration,c as isModuleResolutionFailure,d as isMissingBindingFailure,f as isCompleteImport,j as hasVariables,e as extractVariables,i as extractScriptFromTemplate,g as convertToCommonJS,a as STX_ENGINE_BINDING_NAMES};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{cr as a,dr as b,er as c,fr as d,gr as e,hr as f}from"./chunk-
|
|
2
|
+
import{cr as a,dr as b,er as c,fr as d,gr as e,hr as f}from"./chunk-havegv3v.js";import"./chunk-ymc99r5x.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-bq6q6pjx.js";import"./chunk-0xnvkqn6.js";import"./chunk-fv923f7g.js";import"./chunk-2e6xafcm.js";import"./chunk-nygtwffe.js";import"./chunk-461br5nn.js";import"./chunk-h7v70dbp.js";import"./chunk-drbbt69f.js";import"./chunk-kb5j08tq.js";import"./chunk-2vza9m2x.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
|