@stacksjs/stx 0.2.671 → 0.2.672
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/{chunk-d21ag28g.js → chunk-06b8btkv.js} +1 -1
- package/dist/chunk-0dcrd58z.js +2 -0
- package/dist/{chunk-3gcpv242.js → chunk-0f33ssaq.js} +1 -1
- package/dist/chunk-17yfcd5s.js +2 -0
- package/dist/{chunk-1zeerj7e.js → chunk-1mj9crcg.js} +4 -4
- package/dist/{chunk-nm7h30yt.js → chunk-23b0khvh.js} +1 -1
- package/dist/{chunk-erpjegf6.js → chunk-3349573p.js} +1 -1
- package/dist/chunk-4ve8vsw5.js +2 -0
- package/dist/{chunk-c836tm9c.js → chunk-5pgk3w2c.js} +1 -1
- package/dist/{chunk-nhh8b7xj.js → chunk-5w1c7x22.js} +1 -1
- package/dist/{chunk-j2318qfk.js → chunk-6xe8rnfv.js} +1 -1
- package/dist/chunk-7a3g26kk.js +2 -0
- package/dist/{chunk-kjfnym5y.js → chunk-7d2fab0z.js} +1 -1
- package/dist/chunk-7dtpszqq.js +2 -0
- package/dist/{chunk-48cx52vd.js → chunk-7kk2m44a.js} +2 -2
- package/dist/{chunk-bjrx38kf.js → chunk-7spxdz5k.js} +1 -1
- package/dist/{chunk-s45a5axx.js → chunk-8k3rwv8r.js} +2 -2
- package/dist/{chunk-1s6j0k3c.js → chunk-96mm4q2g.js} +1 -1
- package/dist/{chunk-11c5q4h7.js → chunk-9gfffs28.js} +2 -2
- package/dist/{chunk-ttszb0qr.js → chunk-9yxgdy4z.js} +1 -1
- package/dist/{chunk-x5tgasp8.js → chunk-a3yte051.js} +1 -1
- package/dist/{chunk-m6zpcyhm.js → chunk-a5zqqgx2.js} +1 -1
- package/dist/{chunk-6z3d3t00.js → chunk-a91atghh.js} +1 -1
- package/dist/{chunk-1pw1nvta.js → chunk-a95r5nmq.js} +1 -1
- package/dist/{chunk-ey3wv3qq.js → chunk-am246nf3.js} +1 -1
- package/dist/{chunk-gfa140m0.js → chunk-avnhsjq0.js} +1 -1
- package/dist/{chunk-wj9njs0n.js → chunk-aw3meb8t.js} +1 -1
- package/dist/{chunk-9ah1zsch.js → chunk-d6en3vz7.js} +1 -1
- package/dist/{chunk-eky3cdcg.js → chunk-dnw3knxq.js} +1 -1
- package/dist/{chunk-k5wpdg44.js → chunk-dw81nc5v.js} +1 -1
- package/dist/{chunk-zcv5vjq3.js → chunk-e44z03s5.js} +1 -1
- package/dist/chunk-f8dkq3ta.js +2 -0
- package/dist/{chunk-v0v2xnk7.js → chunk-f9hrpwsw.js} +1 -1
- package/dist/{chunk-kjrrxwj0.js → chunk-kenbxxbn.js} +1 -1
- package/dist/{chunk-2j996te9.js → chunk-kwek8xdt.js} +6 -6
- package/dist/{chunk-w63hh78w.js → chunk-mjm3tyfj.js} +5 -5
- package/dist/{chunk-av3qvakg.js → chunk-n3m7fkv1.js} +3 -3
- package/dist/{chunk-mehp1sma.js → chunk-p3x21vp7.js} +5 -5
- package/dist/{chunk-10np2c03.js → chunk-pvb48ehs.js} +1 -1
- package/dist/{chunk-2jqthnya.js → chunk-qffbkvfn.js} +1 -1
- package/dist/{chunk-pe470p36.js → chunk-qq1k3364.js} +1 -1
- package/dist/{chunk-jcrk8xn6.js → chunk-s20h5gmr.js} +2 -2
- package/dist/chunk-sc7hszsx.js +2 -0
- package/dist/{chunk-1yf17fzh.js → chunk-sj6mhjdq.js} +1 -1
- package/dist/{chunk-kezhxaye.js → chunk-sjcqxfq1.js} +2 -2
- package/dist/{chunk-wmkmj8d3.js → chunk-sqayfat9.js} +1 -1
- package/dist/{chunk-z7t0ds1f.js → chunk-sqhmkvwd.js} +1 -1
- package/dist/{chunk-pjgnvpks.js → chunk-sw6p5176.js} +1 -1
- package/dist/{chunk-7k3v1qv8.js → chunk-t961jbzc.js} +1 -1
- package/dist/chunk-t9yqq483.js +18 -0
- package/dist/{chunk-wytkp0ss.js → chunk-tb6vacgp.js} +1 -1
- package/dist/{chunk-435ww2a2.js → chunk-ttbn287w.js} +1 -1
- package/dist/{chunk-k35fd0mn.js → chunk-wankp78x.js} +4 -4
- package/dist/chunk-we8ptx6w.js +2 -0
- package/dist/{chunk-zg08y45x.js → chunk-wyq0c4wy.js} +1 -1
- package/dist/{chunk-x3s7wxm6.js → chunk-wz2zb53w.js} +1 -1
- package/dist/{chunk-r3e1avhs.js → chunk-wz6368p4.js} +1 -1
- package/dist/{chunk-7fk5ygvh.js → chunk-x68etmdg.js} +1 -1
- package/dist/{chunk-mnyf1jq8.js → chunk-yqz01qvy.js} +1 -1
- package/dist/chunk-z8j2sbnb.js +2 -0
- package/dist/chunk-zp9k5pha.js +2 -0
- package/dist/cli.js +7 -7
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/menubar-build.d.ts +10 -0
- package/dist/menubar-build.js +38 -0
- package/dist/pwa.js +1 -1
- package/dist/render.js +3 -0
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-7s44ew85.js +0 -2
- package/dist/chunk-a92b91a7.js +0 -2
- package/dist/chunk-dnszn1xb.js +0 -2
- package/dist/chunk-e5dvqb47.js +0 -2
- package/dist/chunk-ggxkpxfm.js +0 -2
- package/dist/chunk-m0e0n317.js +0 -2
- package/dist/chunk-qzfcy37r.js +0 -2
- package/dist/chunk-t8w6h94x.js +0 -2
- package/dist/chunk-vy35p3qj.js +0 -2
- package/dist/chunk-wqgz7vqp.js +0 -2
- package/dist/chunk-ym09kjfr.js +0 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{je,mn,ys,Bo,A}from"./chunk-1sr6c0nk.js";import{gn}from"./chunk-
|
|
2
|
+
import{je,mn,ys,Bo,A}from"./chunk-1sr6c0nk.js";import{gn}from"./chunk-pvb48ehs.js";import{br,x,ic,st,Go,ac}from"./chunk-pxdww4rb.js";import{T}from"./chunk-ce6zddpf.js";import{bs,l,p,Nt,u,z,D,w,Ss,xe,Fe,ks}from"./chunk-2dp7hyv7.js";import{i,et}from"./chunk-qjtpxsyx.js";import{f}from"./chunk-b7e07ybq.js";import{H}from"./chunk-fbtv2k1p.js";import Je from"path";import Ct from"process";import{AsyncLocalStorage as io}from"async_hooks";var nr=new io;function ln(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ur(e,s){return nr.run(ln(e),s)}async function fr(e,s){let t=nr.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let o=t.pending.get(e);if(o)return o;let a=Promise.resolve().then(s).then((h)=>{let c=JSON.stringify(h,(E,R)=>{if(R===void 0||typeof R==="function"||typeof R==="symbol"||typeof R==="bigint"||typeof R==="number"&&!Number.isFinite(R))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(R&&typeof R==="object"&&!Array.isArray(R)&&Object.getPrototypeOf(R)!==Object.prototype&&Object.getPrototypeOf(R)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return R}),v=JSON.parse(c);return t.values.set(e,v),v}).catch((h)=>{throw t.pending.delete(e),h});return t.pending.set(e,a),a}function cr(e){let s=e.__stx_server_data;if(!s?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(s.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function L(e,s=!1){let t=i(e),o=[],a=new Set,h=0,c=0,v=t.length,E=()=>{if(h!==0)return;let R=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(R){if(s&&R[1]==="const")return;let I=R[2];if(!a.has(I))o.push(I),a.add(I);return}let C=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){if(s&&t.slice(c).startsWith("const"))return;C[1].split(",").forEach((I)=>{let P=I.trim();if(!P)return;let Z=P.indexOf(":"),V=(Z>=0?P.slice(Z+1).trim():P).split(/[\s=]/)[0];if(V&&!a.has(V))o.push(V),a.add(V)});return}let O=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(O){if(s&&t.slice(c).startsWith("const"))return;O[1].split(",").forEach((I)=>{let P=I.trim().replace(/^\.\.\./,"");if(!P)return;let Z=P.split(/[\s=]/)[0];if(Z&&!a.has(Z))o.push(Z),a.add(Z)});return}if(s)return;let M=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!a.has(I))o.push(I),a.add(I);return}let N=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let I=N[1];if(!a.has(I))o.push(I),a.add(I)}};while(c<v){if(t[c]==="{"){h++,c++;continue}if(t[c]==="}"){h--,c++;continue}if(h===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))E();c++}return o.join(", ")}function ns(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function oo(e,s=L(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(L(e,!0).split(",").map((o)=>o.trim()));return s.map((o)=>t.has(o)?`get ${o}() { return ${o} }, set ${o}(__stxValue_${o}) { ${o} = __stxValue_${o} }`:o).join(", ")}function rs(e,s){let t=`{ ${oo(e,s)} }`;return L(e).split(",").some((o)=>o.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import kn from"fs";import Ce from"path";function j(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var pr=new Map;function ss(e,s=!0){let t=pr.get(e);if(s&&t)return t;let o=new Map,a=[Ce.join(e,"src"),Ce.join(e,"dist"),e];function h(c,v){if(v>6)return;let E;try{E=kn.readdirSync(c,{withFileTypes:!0})}catch{return}for(let R of E){let C=Ce.join(c,R.name);if(R.isDirectory()){if(R.name==="node_modules"||R.name.startsWith("."))continue;h(C,v+1)}else if(R.isFile()&&R.name.endsWith(".stx")){let O=R.name.slice(0,-4);if(!o.has(O))o.set(O,C);let M=O.toLowerCase();if(!o.has(M))o.set(M,C);let N=j(O);if(!o.has(N))o.set(N,C)}}}for(let c of a)if(h(c,0),o.size>0)break;if(s)pr.set(e,o);return o}function os(e,s){if(e.startsWith(".")||e.startsWith("/"))return null;let t=s;while(!0){let o=Ce.join(t,"node_modules",e);try{if(kn.statSync(o).isDirectory())return o}catch{}let a=Ce.dirname(t);if(a===t)return null;t=a}}function is(e,s,t={}){return[Ce.resolve(Ce.dirname(s),`${e}.stx`),Ce.resolve(Ce.dirname(s),e),Ce.resolve(t.componentsDir||"components",`${e}.stx`),Ce.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function dr(e){let s=e.endsWith(".stx")?e.slice(0,-4):e,t=s.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),o=j(s);return[s,t,o]}function So(e,s){let[t,o,a]=dr(e);for(let h of[t,t.toLowerCase(),o,a]){let c=s?.__importedComponents?.get(h);if(c!==void 0)return c}}function*ko(e,s,t={},o){let a=dr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ce.resolve(Ce.dirname(s),`${a[0]}.stx`);return}let h=[...new Set(a.map((E)=>`${E}.stx`))],c=t.projectRoot||process.cwd(),v=[...o?.__originalFilePath?[Ce.join(Ce.dirname(o.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],Ce.join(Ce.dirname(s),"components"),Ce.resolve(c,"src/components"),Ce.resolve(c,"components"),...import.meta.dir?[Ce.resolve(import.meta.dir,"components")]:[]];for(let E of new Set(v)){for(let R of h)yield Ce.join(E,R);try{for(let R of kn.readdirSync(E,{withFileTypes:!0}))if(R.isDirectory())for(let C of h)yield Ce.join(E,R.name,C)}catch{}}}function gr(e,s,t={},o){let a=So(e,o);if(a!==void 0)return a;for(let h of ko(e,s,t,o))try{if(kn.statSync(h,{throwIfNoEntry:!1})?.isFile())return h}catch{}return null}import Ks from"fs";import oe from"path";import mt from"path";import Kt from"fs";var ao=new Set(["touchstart","touchmove","wheel","mousewheel"]);function es(e,s){if(s.passive)return!0;if(s.prevent||s.nonpassive)return!1;return ao.has(e.toLowerCase())}var mr=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"]),hr={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"},co=new Set(["ctrl","alt","shift","meta"]),_r={left:0,middle:1,right:2};function xr(e){let s={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let o=t.toLowerCase();if(o==="prevent")s.prevent=!0;else if(o==="stop")s.stop=!0;else if(o==="once")s.once=!0;else if(o==="capture")s.capture=!0;else if(o==="self")s.self=!0;else if(o==="passive")s.passive=!0;else if(o==="nonpassive")s.nonpassive=!0;else if(co.has(o))s.systemKeys.push(o);else if(o in _r)s.mouse=o;else if(o in hr||/^[a-z]$/.test(o))s.keys.push(hr[o]||o.toUpperCase());else if(o.startsWith("debounce")){let a=o.match(/debounce(?:\.(\d+))?/);s.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(o.startsWith("throttle")){let a=o.match(/throttle(?:\.(\d+))?/);s.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return s}function wr(e,s=""){let t=[],o=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,h;while((h=a.exec(e))!==null){let[c,v,E]=h,R=h.index,C=R+c.length,O=`__stx_evt_${s}${o++}`,M=[],N=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=N.exec(E))!==null){let[,Z,U]=I,V=Z.split("."),X=V[0];if(!mr.has(X))continue;M.push({attribute:`@${Z}`,event:X,handler:U,modifiers:xr(V.slice(1)),elementId:O})}let P=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=P.exec(E))!==null){let[,Z,U]=I,V=Z.split("."),X=V[0];if(!mr.has(X))continue;M.push({attribute:`@${Z}`,event:X,handler:U,modifiers:xr(V.slice(1)),elementId:O})}if(M.length>0)t.push({originalTag:c,elementId:O,events:M,startIndex:R,endIndex:C})}return t}function lo(e){let s=[],{modifiers:t}=e;if(t.self)s.push("if ($event.target !== $el) return");for(let o of t.systemKeys)s.push(`if (!$event.${o}Key) return`);if(t.keys.length>0){let o=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");s.push(`if (!(${o})) return`)}if(t.mouse!==null){let o=_r[t.mouse];s.push(`if ($event.button !== ${o}) return`)}if(t.prevent)s.push("$event.preventDefault()");if(t.stop)s.push("$event.stopPropagation()");return s.join("; ")}function uo(e,s){let t=e;if(s.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${s.debounce})`;else if(s.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${s.throttle})`;return t}function ts(e){let s=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(s))return e;return`if (typeof ${s} === 'function' && !${s}._isSignal) ${s}($event);`}function fo(e){let{modifiers:s}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),o=lo(e),a=uo(ts(e.handler),s),h=[];if(s.once)h.push("once: true");if(s.capture)h.push("capture: true");if(es(e.event,s))h.push("passive: true");let c=h.length>0?`, { ${h.join(", ")} }`:"",v=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
|
|
3
3
|
(function() {
|
|
4
4
|
var $el = document.getElementById('${t}');
|
|
5
5
|
if (!$el) return;
|
|
@@ -112,7 +112,7 @@ else {
|
|
|
112
112
|
`)}
|
|
113
113
|
})();
|
|
114
114
|
</script>`}function po(e,s=""){let t=wr(e,s);if(t.length===0)return{template:e,bindings:[]};let o=e,a=[];for(let h=t.length-1;h>=0;h--){let c=t[h],v=c.originalTag;if(!v.includes(" id="))v=v.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${c.elementId}"`);else{let E=v.match(/id=["']([^"']+)["']/);if(E)for(let R of c.events)R.elementId=E[1]}for(let E of c.events){let R=E.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=new RegExp(`\\s*${R}\\s*=\\s*"[^"]*"`,"g"),O=new RegExp(`\\s*${R}\\s*=\\s*'[^']*'`,"g");v=v.replace(C,""),v=v.replace(O,"")}o=o.slice(0,c.startIndex)+v+o.slice(c.endIndex),a.push(...c.events)}return{template:o,bindings:a}}function yr(e){let s=e.$uid;return typeof s==="string"&&s?`${s}_`:""}function Ea(e,s,t){if(ac(e))return e;if(s.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:v,bindings:E}=po(e,yr(s)),R=s.__stx_event_bindings||[];return s.__stx_event_bindings=[...R,...E],v}let o=wr(e,yr(s));if(o.length===0)return e;let a=e;for(let v=o.length-1;v>=0;v--){let E=o[v],R=E.originalTag;if(!R.includes(" id="))R=R.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${E.elementId}"`);else{let C=R.match(/id=["']([^"']+)["']/);if(C)for(let O of E.events)O.elementId=C[1]}for(let C of E.events){let O=C.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),M=new RegExp(`\\s*${O}\\s*=\\s*"[^"]*"`,"g"),N=new RegExp(`\\s*${O}\\s*=\\s*'[^']*'`,"g");R=R.replace(M,""),R=R.replace(N,"")}a=a.slice(0,E.startIndex)+R+a.slice(E.endIndex)}let h=_o(o.flatMap((v)=>v.events)),c=a.lastIndexOf("</body>");if(c!==-1)a=a.slice(0,c)+h+`
|
|
115
|
-
`+a.slice(c);else a+=h;return a}function Sr(e,s){let t=new Set;for(let o of e.split(",")){let a=o.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(s){let h=a.lastIndexOf(":");if(h!==-1)a=a.slice(h+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Ht(e,s){let t=i(e),{depths:o,balanced:a}=et(t),h=(v)=>!a||o[v]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${s}\\b)`,"g");for(let v of t.matchAll(c)){let E=(v.index??0)+v[0].length-v[1].length;if(h(E))return!0}for(let v of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(h(v.index??0)&&Sr(v[1],!0).has(s))return!0;for(let v of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(h(v.index??0)&&Sr(v[1],!1).has(s))return!0;return!1}var $r="",Rn,ut=/^[A-Za-z_$][\w$]*$/,go=new Set(["if","for","while","switch","with"]),vr=["(","[","{"],Er=[")","]","}"],mo=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function ho(e){let s=i(e),t=[];for(let o of s.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=o.index??0;t.push({text:o[0],start:a,end:a+o[0].length})}return{code:s,tokens:t}}function fs(e){if(Rn&&e===$r)return Rn;let{code:s,tokens:t}=ho(e),o=new Map,a=[];for(let I=0;I<t.length;I++){let P=t[I].text;if(["(","[","{"].includes(P))a.push(I);else if([")","]","}"].includes(P)){let Z=a.at(-1);if(Z!==void 0&&["()","[]","{}"].includes(t[Z].text+P))a.pop(),o.set(Z,I),o.set(I,Z)}}function h(I,P){let Z=[],U=I;for(let V=I;V<P;V++){if(["(","[","{"].includes(t[V].text)&&(o.get(V)??P)<P){V=o.get(V);continue}if(t[V].text===",")Z.push([U,V]),U=V+1}return Z.push([U,P]),Z}let c=[];function v(I,P,Z,U=!1){if(t[I]?.text==="...")I++;if(I>=P)return;let V=t[I].text;if(ut.test(V)){if(Z.add(V),Z===C)c.push({name:V,token:I,functionScoped:U});return}if(V!=="{"&&V!=="[")return;let X=o.get(I);if(X===void 0||X>=P)return;for(let[Y,Q]of h(I+1,X)){let re=Y;if(V==="{")for(let pe=Y;pe<Q;pe++){if(t[pe].text===":"){re=pe+1;break}if(t[pe].text==="=")break;if(["(","[","{"].includes(t[pe].text)&&o.has(pe))pe=o.get(pe)}v(re,Q,Z,U)}}function E(I,P){let Z=new Set;for(let[U,V]of h(I,P))v(U,V,Z);return Z}function R(I){let P=I;for(;P<t.length;P++){let Z=t[P].text;if(["(","[","{"].includes(Z)&&o.has(P)){P=o.get(P);continue}if([",",";",")","]","}"].includes(Z))break}return t[Math.max(I,P-1)]?.end??s.length}let C=new Set,O=[];for(let I=0;I<t.length;I++)if(t[I].text==="=>"){let P=I-1,Z=P,U;if(t[P]?.text===")"&&o.has(P))Z=o.get(P),U=E(Z+1,P);else if(t[P]&&ut.test(t[P].text))U=new Set([t[P].text]);else continue;let V=I+1,X=t[V]?.text==="{"&&o.has(V)?t[o.get(V)].end:R(V);O.push({start:t[Z].start,end:X,bodyStart:t[V]?.start??X,functionBody:!0,names:U})}else if(t[I].text==="("&&o.has(I)){let P=t[I-1]?.text;if(!P||go.has(P)||!ut.test(P)&&P!=="*"&&P!=="]")continue;let Z=o.get(I),U=Z+1;if(t[U]?.text===":"){U++;while(U<t.length&&!["{","=>",";","="].includes(t[U].text))U++}if(t[U]?.text!=="{"||!o.has(U))continue;O.push({start:t[I].start,end:t[o.get(U)].end,bodyStart:t[U].start,functionBody:P!=="catch",names:E(I+1,Z)})}function M(I){let P=I;for(;P<t.length;P++){let Z=t[P].text;if(vr.includes(Z)&&o.has(P)){P=o.get(P);continue}if(Z===";"||Er.includes(Z))break;let U=t[P-1];if(P>I&&mo.has(Z)&&U.text!==".")break;if(P>I&&/[\n\r]/.test(s.slice(U.end,t[P].start))&&(/^[\w$]+$/.test(U.text)||Er.includes(U.text)||['"',"'","`"].includes(U.text))&&ut.test(Z)&&!["in","of","instanceof"].includes(Z))break}return P}let N=[];for(let I=0;I<t.length;I++){if(t[I].text!=="for")continue;let P=t[I+1]?.text==="await"?I+2:I+1;if(t[P]?.text!=="("||!o.has(P))continue;let Z=o.get(P),U=Z+1,V=t[U]?.text==="{"&&o.has(U)?o.get(U):M(U),X=t[V]?.text===";"||t[V]?.text==="}"?t[V].end:t[Math.max(U,V-1)]?.end??s.length;N.push({headStart:P,headEnd:Z,start:t[P].start,end:X})}for(let I=0;I<t.length;I++){let P=t[I].text,Z=t[I-1]?.text;if(Z==="."||t[I+1]?.text===":")continue;if(Z==="as"||Z==="<")continue;if(P==="const"||P==="let"||P==="var"){let U=M(I+1),V=I+1,X=!1,Y=!1,Q=0;for(let re=I+1;re<=U;re++){let pe=t[re]?.text;if(re<U&&vr.includes(pe)&&o.has(re)&&o.get(re)<U){re=o.get(re);continue}if(re<U&&pe===":"&&!Y)X=!0;else if(re<U&&pe==="="&&Q===0)X=!1,Y=!0;else if(re<U&&X&&pe==="<")Q++;else if(re<U&&X&&pe===">"&&Q>0)Q--;else if(re===U||pe===","&&Q===0)v(V,re,C,P==="var"),V=re+1,X=!1,Y=!1}}else if(P==="function"||P==="class"){let U=I+1;if(t[U]?.text==="*")U++;if(t[U]&&ut.test(t[U].text)&&t[U].text!=="extends")C.add(t[U].text),c.push({name:t[U].text,token:U})}else if(P==="import"){let U=I+1;if(t[U]?.text==="*"&&t[U+1]?.text==="as")U+=2;let V=t[U]?.text;if(V&&ut.test(V)&&V!=="type"&&t[U+1]?.text!=="("&&t[U+1]?.text!==".")C.add(V),c.push({name:V,token:U,file:!0});let X=t[U]?.text==="{"?U:t[U+1]?.text===","&&t[U+2]?.text==="{"?U+2:-1;if(X!==-1&&o.has(X)){let Y=o.get(X);for(let[Q,re]of h(X+1,Y)){let pe=re-1;while(pe>=Q&&!ut.test(t[pe].text))pe--;if(pe>=Q&&t[pe].text!=="type")c.push({name:t[pe].text,token:pe,file:!0})}}}}return $r=e,Rn={code:s,scopes:O,loops:N,declarations:C,sites:c,tokens:t,pairs:o},Rn}function xs(e){let s=fs(e);return{code:s.code,shadows:(t,o)=>s.scopes.some((a)=>o>=a.start&&o<a.end&&a.names.has(t))}}function Cn(e){return new Set(fs(e).declarations)}function rn(e,s){let{scopes:t,loops:o,sites:a,tokens:h,pairs:c}=fs(e),v=Array.from({length:h.length},()=>-1),E=[];for(let N=0;N<h.length;N++){v[N]=E.length?E[E.length-1]:-1;let I=h[N].text;if(I==="{"&&c.has(N))E.push(N);else if(I==="}"&&E.length&&c.get(N)===E[E.length-1])E.pop()}let R=new Set,C=new Map;for(let N of a){if(!s.has(N.name))continue;R.add(N.token);let I=N.file?-1:v[N.token],P=I===-1?[0,Number.POSITIVE_INFINITY]:[h[I].start,h[c.get(I)].end];if(N.functionScoped){let U=h[N.token].start,V=t.filter((X)=>X.functionBody&&U>=X.bodyStart&&U<X.end).sort((X,Y)=>X.end-X.bodyStart-(Y.end-Y.bodyStart))[0];P=V?[V.bodyStart,V.end]:[0,Number.POSITIVE_INFINITY]}else if(!N.file){let U=o.filter((V)=>N.token>V.headStart&&N.token<V.headEnd).sort((V,X)=>V.headEnd-V.headStart-(X.headEnd-X.headStart))[0];if(U)P=[U.start,U.end]}let Z=C.get(N.name);if(Z)Z.push(P);else C.set(N.name,[P])}let O=new Set;for(let N=0;N<h.length;N++){if(h[N].text!=="import"||h[N-1]?.text===".")continue;let I=N+1;if(h[I]?.text==="type")I++;if(h[I]&&ut.test(h[I].text)&&h[I+1]?.text===",")I+=2;if(h[I]?.text==="{"&&c.has(I))for(let P=I+1;P<c.get(I);P++)O.add(P)}let M=new Set;for(let N=0;N<h.length;N++){let I=h[N].text;if(!s.has(I)||M.has(I)||R.has(N)||O.has(N))continue;let P=h[N-1]?.text;if(P==="#"||P==="."&&h[N-2]?.text!=="..")continue;if(h[N+1]?.text===":"&&(P==="{"||P===","))continue;let Z=h[N].start;if(C.get(I)?.some(([U,V])=>Z>=U&&Z<V))continue;if(t.some((U)=>Z>=U.start&&Z<U.end&&U.names.has(I)))continue;M.add(I)}return M}var Re="0.2.
|
|
115
|
+
`+a.slice(c);else a+=h;return a}function Sr(e,s){let t=new Set;for(let o of e.split(",")){let a=o.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(s){let h=a.lastIndexOf(":");if(h!==-1)a=a.slice(h+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Ht(e,s){let t=i(e),{depths:o,balanced:a}=et(t),h=(v)=>!a||o[v]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${s}\\b)`,"g");for(let v of t.matchAll(c)){let E=(v.index??0)+v[0].length-v[1].length;if(h(E))return!0}for(let v of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(h(v.index??0)&&Sr(v[1],!0).has(s))return!0;for(let v of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(h(v.index??0)&&Sr(v[1],!1).has(s))return!0;return!1}var $r="",Rn,ut=/^[A-Za-z_$][\w$]*$/,go=new Set(["if","for","while","switch","with"]),vr=["(","[","{"],Er=[")","]","}"],mo=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function ho(e){let s=i(e),t=[];for(let o of s.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=o.index??0;t.push({text:o[0],start:a,end:a+o[0].length})}return{code:s,tokens:t}}function fs(e){if(Rn&&e===$r)return Rn;let{code:s,tokens:t}=ho(e),o=new Map,a=[];for(let I=0;I<t.length;I++){let P=t[I].text;if(["(","[","{"].includes(P))a.push(I);else if([")","]","}"].includes(P)){let Z=a.at(-1);if(Z!==void 0&&["()","[]","{}"].includes(t[Z].text+P))a.pop(),o.set(Z,I),o.set(I,Z)}}function h(I,P){let Z=[],U=I;for(let V=I;V<P;V++){if(["(","[","{"].includes(t[V].text)&&(o.get(V)??P)<P){V=o.get(V);continue}if(t[V].text===",")Z.push([U,V]),U=V+1}return Z.push([U,P]),Z}let c=[];function v(I,P,Z,U=!1){if(t[I]?.text==="...")I++;if(I>=P)return;let V=t[I].text;if(ut.test(V)){if(Z.add(V),Z===C)c.push({name:V,token:I,functionScoped:U});return}if(V!=="{"&&V!=="[")return;let X=o.get(I);if(X===void 0||X>=P)return;for(let[Y,Q]of h(I+1,X)){let re=Y;if(V==="{")for(let pe=Y;pe<Q;pe++){if(t[pe].text===":"){re=pe+1;break}if(t[pe].text==="=")break;if(["(","[","{"].includes(t[pe].text)&&o.has(pe))pe=o.get(pe)}v(re,Q,Z,U)}}function E(I,P){let Z=new Set;for(let[U,V]of h(I,P))v(U,V,Z);return Z}function R(I){let P=I;for(;P<t.length;P++){let Z=t[P].text;if(["(","[","{"].includes(Z)&&o.has(P)){P=o.get(P);continue}if([",",";",")","]","}"].includes(Z))break}return t[Math.max(I,P-1)]?.end??s.length}let C=new Set,O=[];for(let I=0;I<t.length;I++)if(t[I].text==="=>"){let P=I-1,Z=P,U;if(t[P]?.text===")"&&o.has(P))Z=o.get(P),U=E(Z+1,P);else if(t[P]&&ut.test(t[P].text))U=new Set([t[P].text]);else continue;let V=I+1,X=t[V]?.text==="{"&&o.has(V)?t[o.get(V)].end:R(V);O.push({start:t[Z].start,end:X,bodyStart:t[V]?.start??X,functionBody:!0,names:U})}else if(t[I].text==="("&&o.has(I)){let P=t[I-1]?.text;if(!P||go.has(P)||!ut.test(P)&&P!=="*"&&P!=="]")continue;let Z=o.get(I),U=Z+1;if(t[U]?.text===":"){U++;while(U<t.length&&!["{","=>",";","="].includes(t[U].text))U++}if(t[U]?.text!=="{"||!o.has(U))continue;O.push({start:t[I].start,end:t[o.get(U)].end,bodyStart:t[U].start,functionBody:P!=="catch",names:E(I+1,Z)})}function M(I){let P=I;for(;P<t.length;P++){let Z=t[P].text;if(vr.includes(Z)&&o.has(P)){P=o.get(P);continue}if(Z===";"||Er.includes(Z))break;let U=t[P-1];if(P>I&&mo.has(Z)&&U.text!==".")break;if(P>I&&/[\n\r]/.test(s.slice(U.end,t[P].start))&&(/^[\w$]+$/.test(U.text)||Er.includes(U.text)||['"',"'","`"].includes(U.text))&&ut.test(Z)&&!["in","of","instanceof"].includes(Z))break}return P}let N=[];for(let I=0;I<t.length;I++){if(t[I].text!=="for")continue;let P=t[I+1]?.text==="await"?I+2:I+1;if(t[P]?.text!=="("||!o.has(P))continue;let Z=o.get(P),U=Z+1,V=t[U]?.text==="{"&&o.has(U)?o.get(U):M(U),X=t[V]?.text===";"||t[V]?.text==="}"?t[V].end:t[Math.max(U,V-1)]?.end??s.length;N.push({headStart:P,headEnd:Z,start:t[P].start,end:X})}for(let I=0;I<t.length;I++){let P=t[I].text,Z=t[I-1]?.text;if(Z==="."||t[I+1]?.text===":")continue;if(Z==="as"||Z==="<")continue;if(P==="const"||P==="let"||P==="var"){let U=M(I+1),V=I+1,X=!1,Y=!1,Q=0;for(let re=I+1;re<=U;re++){let pe=t[re]?.text;if(re<U&&vr.includes(pe)&&o.has(re)&&o.get(re)<U){re=o.get(re);continue}if(re<U&&pe===":"&&!Y)X=!0;else if(re<U&&pe==="="&&Q===0)X=!1,Y=!0;else if(re<U&&X&&pe==="<")Q++;else if(re<U&&X&&pe===">"&&Q>0)Q--;else if(re===U||pe===","&&Q===0)v(V,re,C,P==="var"),V=re+1,X=!1,Y=!1}}else if(P==="function"||P==="class"){let U=I+1;if(t[U]?.text==="*")U++;if(t[U]&&ut.test(t[U].text)&&t[U].text!=="extends")C.add(t[U].text),c.push({name:t[U].text,token:U})}else if(P==="import"){let U=I+1;if(t[U]?.text==="*"&&t[U+1]?.text==="as")U+=2;let V=t[U]?.text;if(V&&ut.test(V)&&V!=="type"&&t[U+1]?.text!=="("&&t[U+1]?.text!==".")C.add(V),c.push({name:V,token:U,file:!0});let X=t[U]?.text==="{"?U:t[U+1]?.text===","&&t[U+2]?.text==="{"?U+2:-1;if(X!==-1&&o.has(X)){let Y=o.get(X);for(let[Q,re]of h(X+1,Y)){let pe=re-1;while(pe>=Q&&!ut.test(t[pe].text))pe--;if(pe>=Q&&t[pe].text!=="type")c.push({name:t[pe].text,token:pe,file:!0})}}}}return $r=e,Rn={code:s,scopes:O,loops:N,declarations:C,sites:c,tokens:t,pairs:o},Rn}function xs(e){let s=fs(e);return{code:s.code,shadows:(t,o)=>s.scopes.some((a)=>o>=a.start&&o<a.end&&a.names.has(t))}}function Cn(e){return new Set(fs(e).declarations)}function rn(e,s){let{scopes:t,loops:o,sites:a,tokens:h,pairs:c}=fs(e),v=Array.from({length:h.length},()=>-1),E=[];for(let N=0;N<h.length;N++){v[N]=E.length?E[E.length-1]:-1;let I=h[N].text;if(I==="{"&&c.has(N))E.push(N);else if(I==="}"&&E.length&&c.get(N)===E[E.length-1])E.pop()}let R=new Set,C=new Map;for(let N of a){if(!s.has(N.name))continue;R.add(N.token);let I=N.file?-1:v[N.token],P=I===-1?[0,Number.POSITIVE_INFINITY]:[h[I].start,h[c.get(I)].end];if(N.functionScoped){let U=h[N.token].start,V=t.filter((X)=>X.functionBody&&U>=X.bodyStart&&U<X.end).sort((X,Y)=>X.end-X.bodyStart-(Y.end-Y.bodyStart))[0];P=V?[V.bodyStart,V.end]:[0,Number.POSITIVE_INFINITY]}else if(!N.file){let U=o.filter((V)=>N.token>V.headStart&&N.token<V.headEnd).sort((V,X)=>V.headEnd-V.headStart-(X.headEnd-X.headStart))[0];if(U)P=[U.start,U.end]}let Z=C.get(N.name);if(Z)Z.push(P);else C.set(N.name,[P])}let O=new Set;for(let N=0;N<h.length;N++){if(h[N].text!=="import"||h[N-1]?.text===".")continue;let I=N+1;if(h[I]?.text==="type")I++;if(h[I]&&ut.test(h[I].text)&&h[I+1]?.text===",")I+=2;if(h[I]?.text==="{"&&c.has(I))for(let P=I+1;P<c.get(I);P++)O.add(P)}let M=new Set;for(let N=0;N<h.length;N++){let I=h[N].text;if(!s.has(I)||M.has(I)||R.has(N)||O.has(N))continue;let P=h[N-1]?.text;if(P==="#"||P==="."&&h[N-2]?.text!=="..")continue;if(h[N+1]?.text===":"&&(P==="{"||P===","))continue;let Z=h[N].start;if(C.get(I)?.some(([U,V])=>Z>=U&&Z<V))continue;if(t.some((U)=>Z>=U.start&&Z<U.end&&U.names.has(I)))continue;M.add(I)}return M}var Re="0.2.672";var kr=Symbol.for(`stx.lazy-module-promises.${Re}`);function bo(){let e=globalThis;return e[kr]??=new Map,e[kr]}function r(e,s){let t=bo(),o=`${import.meta.url}\x00${e}`,a=t.get(o);if(a)return a;let h=s();return t.set(o,h),h.catch(()=>{if(t.get(o)===h)t.delete(o)}),h}var yo=/<\/(script)/gi;function sn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(yo,"<\\/$1")}import Tr from"fs";class B{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,s){this.maxSize=e,this.options=s??null,this.sizes=s?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let s=this.cache.keys().next().value;if(s===void 0)break;this.delete(s)}}get(e){if(!this.cache.has(e))return;let s=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,s),s}set(e,s){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(s):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let o=this.cache.keys().next().value;if(o===void 0)break;this.delete(o)}if(this.cache.set(e,s),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let s=this.sizes.get(e);if(s!==void 0)this.bytes-=s,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var St=new Map,wo=500;function Et(e,s){if(s?.includes("g"))return new RegExp(e,s);let t=`${e}:${s||""}`;if(!St.has(t)){if(St.size>=wo){let o=St.keys().next().value;if(o)St.delete(o)}St.set(t,new RegExp(e,s))}return St.get(t)}class Rr{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let s=Array.from(new Set(e)),t=s.sort().join(","),o=this.pool.find((v)=>v.context.join(",")===t);if(o)return o.func;let a=this.fnCache,h=this.fnCacheMaxSize,c=(...v)=>(E)=>{try{let R=`${t}:${E}`,C=a.get(R);if(!C){if(a.size>=h){let O=a.keys().next().value;if(O)a.delete(O)}C=Function(...s,`
|
|
116
116
|
'use strict';
|
|
117
117
|
try {
|
|
118
118
|
return ${E};
|
|
@@ -193,7 +193,7 @@ else {
|
|
|
193
193
|
// STX: auto-generated event bindings
|
|
194
194
|
${e.map((t,o)=>na(t,o)).join(`
|
|
195
195
|
`)}`}function Mr(e){let s=[],t=new Set,o=e.replace(/^\s*import\s+.*$/gm,""),a=0,h=o.length,c=0;while(c<h){let v=o[c];if(v==="'"||v==='"'||v==="`"){let E=v;if(c++,E==="`"){let R=0;while(c<h){if(o[c]==="\\"){c+=2;continue}if(o[c]==="`"&&R===0){c++;break}if(o[c]==="$"&&o[c+1]==="{"){R++,c+=2;continue}if(o[c]==="}"&&R>0){R--,c++;continue}c++}}else while(c<h){if(o[c]==="\\"){c+=2;continue}if(o[c]===E){c++;break}c++}continue}if(v==="/"&&o[c+1]==="/"){while(c<h&&o[c]!==`
|
|
196
|
-
`)c++;continue}if(v==="/"&&o[c+1]==="*"){c+=2;while(c<h-1&&!(o[c]==="*"&&o[c+1]==="/"))c++;c+=2;continue}if(v==="{"){a++,c++;continue}if(v==="}"){a--,c++;continue}if(a===0){let E=o.slice(c),R=E.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let M=R[1];if(!M.startsWith("_")&&!t.has(M))s.push(M),t.add(M);c+=R[0].length;continue}let C=E.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){C[1].split(",").forEach((M)=>{let N=M.trim(),I=N.indexOf(":"),P=I>=0?N.slice(I+1).trim().split(/[\s=]/)[0]:N.split(/[\s=]/)[0];if(P&&!P.startsWith("_")&&!t.has(P))s.push(P),t.add(P)}),c+=C[0].length;continue}let O=E.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(O){let M=O[1];if(!M.startsWith("_")&&!t.has(M))s.push(M),t.add(M);c+=O[0].length;continue}}c++}return s}var ra=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 ia(e){let s=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function o(M){let N;while((N=t.exec(M))!==null){let I=N[0];if(!ra.has(I))s.add(I)}}let a=/\{\{([\s\S]*?)\}\}/g,h;while((h=a.exec(e))!==null)o(h[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((h=c.exec(e))!==null)o(h[1]);let v=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((h=v.exec(e))!==null)o(h[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((h=E.exec(e))!==null)o(h[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((h=R.exec(e))!==null)o(h[1]);let C=/@model\s*=\s*["']([^"']*)["']/gi;while((h=C.exec(e))!==null)o(h[1]);let O=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((h=O.exec(e))!==null)o(h[1]);return s}async function Ne(e,s={}){let t=e,o="",a=!1,h=[],c=Io(t,{filePath:s.filePath,projectRoot:s.projectRoot});t=c.code;let v=Oo(c.styles),E=Pt(t);t=E.code,h=[...E.imports,...E.models];let{hasUserImports:R,bundleClientScript:C}=await r("stx/client-script-bundler",()=>import("./chunk-
|
|
196
|
+
`)c++;continue}if(v==="/"&&o[c+1]==="*"){c+=2;while(c<h-1&&!(o[c]==="*"&&o[c+1]==="/"))c++;c+=2;continue}if(v==="{"){a++,c++;continue}if(v==="}"){a--,c++;continue}if(a===0){let E=o.slice(c),R=E.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let M=R[1];if(!M.startsWith("_")&&!t.has(M))s.push(M),t.add(M);c+=R[0].length;continue}let C=E.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){C[1].split(",").forEach((M)=>{let N=M.trim(),I=N.indexOf(":"),P=I>=0?N.slice(I+1).trim().split(/[\s=]/)[0]:N.split(/[\s=]/)[0];if(P&&!P.startsWith("_")&&!t.has(P))s.push(P),t.add(P)}),c+=C[0].length;continue}let O=E.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(O){let M=O[1];if(!M.startsWith("_")&&!t.has(M))s.push(M),t.add(M);c+=O[0].length;continue}}c++}return s}var ra=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 ia(e){let s=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function o(M){let N;while((N=t.exec(M))!==null){let I=N[0];if(!ra.has(I))s.add(I)}}let a=/\{\{([\s\S]*?)\}\}/g,h;while((h=a.exec(e))!==null)o(h[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((h=c.exec(e))!==null)o(h[1]);let v=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((h=v.exec(e))!==null)o(h[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((h=E.exec(e))!==null)o(h[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((h=R.exec(e))!==null)o(h[1]);let C=/@model\s*=\s*["']([^"']*)["']/gi;while((h=C.exec(e))!==null)o(h[1]);let O=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((h=O.exec(e))!==null)o(h[1]);return s}async function Ne(e,s={}){let t=e,o="",a=!1,h=[],c=Io(t,{filePath:s.filePath,projectRoot:s.projectRoot});t=c.code;let v=Oo(c.styles),E=Pt(t);t=E.code,h=[...E.imports,...E.models];let{hasUserImports:R,bundleClientScript:C}=await r("stx/client-script-bundler",()=>import("./chunk-wz6368p4.js"));if(R(t))t=await C(t,s.filePath||"",{projectRoot:s.projectRoot,minify:s.production}),a=!0;if(s.autoImports!==!1){let X=Wa(t);t=X.code,o=qa(X.stxImports,X.browserImports.filter((Y)=>!h.includes(Y)))}if(o=`${dn(t,s.serverData)}${o}`,t=T(t),!a&&De(s.attrs||""))t=Me(t);let O=sa(s.eventBindings||[]),M=(s.attrs||"").trim(),N=/\btype\s*=\s*["']module["']/i.test(M),I=s.instanceId?` data-stx-instance="${s.instanceId}"`:"";if(N){let X=M.replace(/\btype\s*=\s*["']module["']/i,"").trim(),Y=`type="module" data-stx-scoped${I}${X?` ${X}`:""}`;return`${v}<script ${Y}>
|
|
197
197
|
${sn(`${o}${t}
|
|
198
198
|
${O}`)}
|
|
199
199
|
</script>`}let P=Go(e),Z=/function __stx_setup_/.test(t),U=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function V(X){let Y=X.length>0?`
|
|
@@ -286,8 +286,8 @@ ${R.join(`
|
|
|
286
286
|
`)a++;return!0}if(e[a]==="/"&&e[a+1]==="*"){a+=2;while(a<h-1&&!(e[a]==="*"&&e[a+1]==="/"))a++;return a+=2,!0}return!1},R=()=>{if(o!==0)return;let C=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(C){let I=C[2].split(",").map((P)=>{let Z=P.trim().split(":");return Z[Z.length-1].trim()});for(let P of I)if(P&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(P)&&!t.has(P))s.push(P),t.add(P);return}let O=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(O){let I=O[2];if(!t.has(I))s.push(I),t.add(I);return}let M=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!t.has(I))s.push(I),t.add(I);return}let N=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let I=N[1];if(!t.has(I))s.push(I),t.add(I)}};while(a<h){if(E())continue;if(e[a]==="'"||e[a]==='"'){c(e[a]);continue}if(e[a]==="`"){v();continue}if(e[a]==="{"){o++,a++;continue}if(e[a]==="}"){o--,a++;continue}if(o===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))R();a++}return s}function fl(e){let s=[],t=0,o=0,a=null;for(let h=0;h<e.length;h++){let c=e[h];if(a){if(c==="\\"){h++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)s.push(e.slice(o,h)),o=h+1}if(o<e.length)s.push(e.slice(o));return s}function pl(e){let s=0,t=null;for(let o=0;o<e.length;o++){let a=e[o];if(t){if(a==="\\"){o++;continue}if(a===t)t=null;continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{")s++;else if(a===")"||a==="]"||a==="}")s--;else if(a==="="&&s===0){let h=e[o-1],c=e[o+1];if(h==="!"||h==="<"||h===">"||h==="=")continue;if(c==="="||c===">")continue;return o}}return-1}function dl(e,s){try{let t=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!t)return;let o=t.index-1;while(o>=0&&/\s/.test(e[o]))o--;if(e[o]!=="}")return;let a=o,h=0,c=-1;for(;o>=0;o--){let E=e[o];if(E==="}")h++;else if(E==="{"){if(h--,h===0){c=o;break}}}if(c===-1)return;let v=e.slice(c+1,a);for(let E of fl(v)){let R=E.trim();if(!R||R.startsWith("..."))continue;let C=pl(R);if(C===-1)continue;let O=R.slice(0,C).trim();if(!/^[A-Z_$][\w$]*$/i.test(O))continue;if(s[O]!==void 0)continue;let M=R.slice(C+1).trim();if(!M)continue;try{let N=Object.keys(s).filter(Nt),I=Function(...N,`"use strict"; return (${M});`);s[O]=I(...N.map((P)=>s[P]))}catch{}}}catch{}}var gl=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function tu(e,s){let t=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!t)return null;let o=t[2].toLowerCase();if(!gl.has(o))return null;let a=new RegExp(`<\\/?${o}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),h=ce(e,(R,C)=>(a.lastIndex=C,a.exec(R)?.index===C?a.lastIndex:-1));if(o==="span"&&/\sdata-stx-scope\s*=/.test(h[0]?.token||""))return null;let c=0,v=!1;for(let R of h){if(c+=R.token.startsWith("</")?-1:1,c<0)return null;if(c===0){if(e.slice(R.end).trim())return null;v=!0;break}}if(!v)return null;let E=t[0].length;return e.slice(0,E)+s+e.slice(E)}async function lr(e,s,t,o,a){let h=e.endsWith(".stx")?e.slice(0,-4):e,c=(Q)=>Q.split("-").map((re)=>re.charAt(0).toUpperCase()+re.slice(1)).join(""),v=t.__importedComponents;if(v){for(let Q of[h,h.toLowerCase(),c(h),j(h)])if(v.has(Q))return!0}let E=[...new Set([`${h}.stx`,`${c(h)}.stx`,`${j(h)}.stx`])],R=typeof a.root==="string"?oe.resolve(a.root):void 0,C=R??oe.dirname(o),O=[],M=(Q)=>{if(Q&&!O.includes(Q))O.push(Q)},N=t.__originalFilePath;if(N)M(oe.join(oe.dirname(N),"components"));M(s),M(a._rootComponentsDir),M(oe.join(oe.dirname(o),"components")),M(a.componentsDir);let I=a._targetComponentFallbackNames?.some((Q)=>Q.toLowerCase()===h.toLowerCase());if(!I)for(let Q of a._targetComponentDirs??[])M(Q);if(R)M(oe.resolve(R,"resources/views/components")),M(oe.resolve(R,"resources/components")),M(oe.resolve(R,"src/components")),M(oe.resolve(R,"components"));for(let Q of a._layerComponentDirs??[])M(Q);let P=a._pluginComponentDirs;if(Array.isArray(P))for(let Q of P)M(typeof Q==="string"?Q:null);if(M(a.fallbackComponentsDir),I)for(let Q of a._targetComponentDirs??[])M(Q);if(h.startsWith("./")||h.startsWith("../"))return n(oe.resolve(oe.dirname(o),`${h}.stx`));let Z=Li(oe.resolve(import.meta.dir,"components")),U=O.map((Q)=>oe.isAbsolute(Q)?Q:oe.resolve(C,Q)),V=`${E.join("\x00")}\x00\x00${U.join("\x00")}`,X=Fs.get(V);if(X!==void 0)return X;let Y=!1;e:for(let Q of U){if(Li(Q)===Z)continue;for(let re of E)if(await n(oe.join(Q,re))){Y=!0;break e}}return Fs.set(V,Y),Y}function Li(e){let s=Vs.get(e);if(s!==void 0)return s;let t=e;try{t=Ks.realpathSync(e)}catch{}return Vs.set(e,t),t}function nu(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Ga(e){if(!e)return!1;let s=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(s)}function ml(e,s,t){if(!e.includes("{{")&&!e.includes("{!!"))return e;let o=(a,h)=>{let c;try{c=_(a,s)}catch{return h}if(c===void 0||c===null)return"";let v=String(c);if(/<\/style/i.test(v))return console.warn(`[stx] a <style> expression in ${t??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return v};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,h)=>o(h,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,h)=>o(h,a))}var Bi=new Set;function zi(e,s,t,o){let a=`${e}\x00${s}\x00${o??""}`;if(!process.env.STX_DEBUG&&Bi.has(a))return;Bi.add(a);let h=s?` used in ${s}`:"",c=o?` Cause: ${o}.`:"",v=t.length>0?`
|
|
287
287
|
searched:
|
|
288
288
|
${t.map((E)=>` - ${E}`).join(`
|
|
289
|
-
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${h}, so it rendered as nothing.${c}${v}`)}function Wi(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function Do(e){let s=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let o of e){let a;while((a=t.exec(o))!==null)s.add(a[1]);t.lastIndex=0}return[...s]}async function Le(e,s,t,o,a,h,c,v=new Set,E,R=Qe(a),C,O=e){let{extractVariables:M}=await r("stx/variable-extractor",()=>import("./chunk-
|
|
290
|
-
`)}`}if(t&&ee.includes("{{ text || slot }}"))ee=ee.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:fe}=await r("stx/slots",()=>import("./chunk-
|
|
289
|
+
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${h}, so it rendered as nothing.${c}${v}`)}function Wi(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function Do(e){let s=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let o of e){let a;while((a=t.exec(o))!==null)s.add(a[1]);t.lastIndex=0}return[...s]}async function Le(e,s,t,o,a,h,c,v=new Set,E,R=Qe(a),C,O=e){let{extractVariables:M}=await r("stx/variable-extractor",()=>import("./chunk-96mm4q2g.js")),N=v??new Set;if(N.has(e))return`[Circular component reference: ${e}]`;let I=new Set(N);I.add(e);let P=typeof s.client==="string"?s.client.trim():"";if("client"in s)delete s.client;let Z=P&&P!=="load"&&nu(P)?P:"";try{let U=(ie)=>ie.split("-").map((se)=>se.charAt(0).toUpperCase()+se.slice(1)).join(""),V=O.endsWith(".stx")?O.slice(0,-4):O,X=null,Y=a.__importedComponents;if(Y){let ie=[V,V.toLowerCase(),U(V),j(V)];for(let se of ie)if(Y.has(se)){X=Y.get(se);break}}let Q=[];if(!X){let ie=[`${V}.stx`,`${U(V)}.stx`,`${j(V)}.stx`],se=[...new Set(ie)],ge=a.__originalFilePath,me=[];if(me.push(...c._layerComponentDirs??[]),ge){let Se=oe.join(oe.dirname(ge),"components");me.push(Se)}if(o)me.push(o);let He=c._rootComponentsDir;if(typeof He==="string"&&!me.includes(He))me.push(He);let Be=oe.join(oe.dirname(h),"components");if(!me.includes(Be))me.push(Be);if(c.componentsDir&&c.componentsDir!==o&&!me.includes(c.componentsDir))me.push(c.componentsDir);let at=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(V),ct=(C?.events??[]).map((Se)=>Se.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),lt=Object.hasOwn(s,"checked")||Boolean(C?.reactiveProps?.includes("checked")),_t=Object.hasOwn(s,"value")||Boolean(C?.reactiveProps?.includes("value")),_n=!ct.includes("valuechange")&&(lt||ct.includes("change")&&!_t),Xn=c._nativeHostAttrs&&/^textinput$/i.test(V),wt=ct.includes("update:value")&&!ct.includes("input"),Vt=c._targetComponentFallbackNames?.some((Se)=>Se.toLowerCase()===V.toLowerCase())&&(!at||_n)&&(!Xn||wt);for(let Se of Vt?[]:c._targetComponentDirs??[])if(Se&&!me.includes(Se))me.push(Se);let nt=typeof c.root==="string"?oe.resolve(c.root):void 0,wn=nt??oe.dirname(h),rt=[];if(nt)rt.push(oe.resolve(nt,"resources/views/components")),rt.push(oe.resolve(nt,"resources/components")),rt.push(oe.resolve(nt,"src/components")),rt.push(oe.resolve(nt,"components"));rt.push(oe.resolve(import.meta.dir,"components"));for(let Se of rt)if(!me.includes(Se))me.push(Se);let Ut=c._pluginComponentDirs;if(Array.isArray(Ut)){for(let Se of Ut)if(typeof Se==="string"&&!me.includes(Se))me.push(Se)}if(c.fallbackComponentsDir&&!me.includes(c.fallbackComponentsDir))me.push(c.fallbackComponentsDir);if(Vt){for(let Se of c._targetComponentDirs??[])if(Se&&!me.includes(Se))me.push(Se)}let Qs=[...new Set(me.map((Se)=>{if(!Se)return Se;return oe.isAbsolute(Se)?Se:oe.resolve(wn,Se)}))];me.length=0,me.push(...Qs);let Jn=`${V}\x00${h}\x00${Qs.join("\x00")}`,Gn=Fn.get(Jn);if(Gn)if(await n(Gn))X=Gn;else Fn.delete(Jn);if(!X&&(V.startsWith("./")||V.startsWith("../")))X=oe.resolve(oe.dirname(h),`${V}.stx`),Q.push(X);else if(!X)for(let Se of me){if(!Se)continue;for(let Sn of se){let $n=oe.join(Se,Sn);if(Q.push($n),await n($n)){X=$n;break}}if(X)break;if(!X)try{let Sn=await import("fs");if(!Sn.statSync(Se,{throwIfNoEntry:!1})?.isDirectory())continue;let so=8,Yn=[{path:Se,depth:0}];while(Yn.length>0&&!X){let vn=Yn.pop();if(vn.depth>=so)continue;let er;try{er=Sn.readdirSync(vn.path,{withFileTypes:!0})}catch{continue}for(let En of er){if(!En.isDirectory())continue;if(En.name==="node_modules"||En.name.startsWith("."))continue;let tr=oe.join(vn.path,En.name);for(let ro of se){let Qn=oe.join(tr,ro);if(Q.push(Qn),await n(Qn)){X=Qn;break}}if(X)break;Yn.push({path:tr,depth:vn.depth+1})}}}catch{}if(X)break}if(X)Fn.set(Jn,X)}if(!X||!await n(X))return zi(e,h,Q),Wi(e);E.add(X);let re;if(Qt.has(X))re=Qt.get(X);else try{re=await Bun.file(X).text(),Qt.set(X,re)}catch(ie){let se=ie instanceof Error?ie.message:String(ie);return zi(e,h,[X],se),Wi(e)}if(C)for(let ie of new Set([...Object.keys(s),...C.reactiveProps??[]])){let se=ie.toLowerCase();if(se.startsWith("aria-")||se.startsWith("data-"))continue;let ge=ie.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${ge}\\b`).test(re))C.declaredProps.add(ie);if(new RegExp(`\\$props\\s*(?:\\.\\s*${ge}\\b|\\[\\s*['"]${ge}['"]\\s*\\])`).test(re)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${ge}['"]`).test(re))C.consumedProps?.add(ie)}let pe=new Set(["__originalFilePath","__importedComponents",Tn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),Ee={};for(let[ie,se]of Object.entries(a))if(!ie.startsWith("__")||pe.has(ie))Ee[ie]=se;let ke=R.length>0?{[Nn]:[...R]}:{},We=t;if(t.includes("@include")){let{processIncludes:ie}=await r("stx/includes",()=>import("./chunk-e44z03s5.js"));We=await ie(t,a,h,c,E)}if(/<[A-Z][\w.-]*[\s/>]/.test(We)){let{processComponents:ie}=await r("stx/component-renderer",()=>import("./chunk-7spxdz5k.js"));We=await ie(We,{...a,__processedComponents:N,...ke},h,c,E)}let Te=[];if(Ga(We)){let{processExpressions:ie}=await r("stx/expressions",()=>import("./chunk-wyq0c4wy.js")),se=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...ke}:R.length>0?{...a,...ke}:a;We=ie(We,se,h);for(let ge of We.matchAll(/\{\{([\s\S]*?)\}\}/g))Te.push(ge[1].trim())}let Ke=q(We),Ge=[],xt=Ke.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ie,se)=>{let ge=Ke.scripts[Number(se)]||"",me=ge.match(/^<script\b([^>]*)>/i)?.[1]||"",He=me.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Be=!He||["module","text/javascript","application/javascript"].includes(He),at=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${me}`);if(!/\bserver\b/i.test(me)&&Be&&!at)return Ge.push(ge),"";return ge}),{extractSlotContent:Hn}=await r("stx/slots",()=>import("./chunk-sj6mhjdq.js")),ft=Hn(xt),pt={};if(ft.defaultSlot?.trim())pt.default=ft.defaultSlot;for(let[ie,se]of ft.namedSlots)pt[ie]=se.content;let dt=a.__stx_scope_seq??={n:0,key:ms(String(a.__filename??h))},Ot=Vi(e,process.cwd()),it=`stx_${(Ot.endsWith(".stx")?Ot.slice(0,-4):Ot).replace(/[^a-zA-Z0-9]/g,"_")}_${++dt.n}_${dt.key}`,Ve={...Ee,$uid:it,$native:c._nativeHostAttrs===!0,...s,props:s,slot:xt,$slots:pt,__processedComponents:I,__sections:{},__stx_signals_gate:ve(re)||Ga(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Te]};dl(re,Ve);let Mt=re,tn=ae(Mt);if(tn)Mt=tn.content.trim();let Kn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Dt=[...re.matchAll(Kn)];for(let[,ie,se]of Dt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ie))Ae(se,X,c.strict);let Xe=[],jt=null,Zn=Dt.some((ie)=>/\bserver\b/.test(ie[1]||"")&&/\bcache\b/.test(ie[1]||"")),bt=null,Ye=null,Lt=null,nn=0,Bt=null;if(ol(c),Zn&&Us>0){let ie=al({props:s,slot:We,slotContext:t.trim()?cl(Ee):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...R].sort(),layers:c._layerGraph?.layers.map((se)=>se.configFile),uid:it});if(ie!==null){bt=`${X}\x00${b(re)}\x00${ie}`;let se=Vn.get(bt);if(se){for(let ge of se.dependencies)E.add(ge);if(Br(a,se.clientFactories),dt.n+=se.uidsConsumed,se.preservedClientExpressions.length>0){let ge=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let me of se.preservedClientExpressions)ge.add(me);a.__stx_preserved_client_expressions=[...ge]}return se.output}Ye=new Set(E),Lt=Nr(a),nn=dt.n,Bt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let zt=new Set;for(let ie of Dt){let se=ie[1]||"",ge=ie[2]||"",me=se.includes("server");if(De(se)&&ge.trim())ge=Me(ge);if(me&&ge){for(let Be of Ie(ge))zt.add(Be);try{await M(ge,Ve,X,{onFailure:(Be)=>{if(Be.kind!=="unknown")jt=Be.kind}})}catch(Be){}}if(!me){let Be=ge.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),at=Be.includes("{{")&&Be.includes("}}"),ct=Be.includes("{!!")&&Be.includes("!!}");if(at||ct)Be=Lo(Be,Ve,X);let lt=se.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Xe.push(`<script${lt}>${Be}</script>`)}}let Ze=q(re).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Wt=Ze?Ze[1]:"",qn=Ze?Ze[2]:"",tt="",J=Wt&&/\bscoped\b/i.test(Wt);if(Ze)tt=`<style${Wt}>${ml(qn,Ve,X)}</style>`;let ee=Mt;if(ee=ee.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ze)ee=ee.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ie=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,se=[];if(ee=ee.replace(ie,(ge,me)=>{let He=me.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(He)se.push(`<style${He[1]}>${He[2]}</style>`);return""}),ee=ee.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),se.length>0)tt=`${tt}${se.join(`
|
|
290
|
+
`)}`}if(t&&ee.includes("{{ text || slot }}"))ee=ee.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:fe}=await r("stx/slots",()=>import("./chunk-sj6mhjdq.js")),{defaultSlot:_e,namedSlots:$e}=ft,ze=c._nativeHostAttrs===!0&&Xe.length>0||Xe.some((ie)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ie)),gt=(ie)=>ze?gi(ie,it):ie,Ys=new Map([...$e].map(([ie,se])=>[ie,{...se,content:gt(se.content)}]));ee=await fe(ee,gt(_e),Ys,Ve,ze?it:"");let hn=Do(Xe),xn=(Array.isArray(Ve.__stx_client_signal_names)?Ve.__stx_client_signal_names:[]).filter((ie)=>!zt.has(ie));if(hn.length>0||xn.length>0)Ve.__stx_client_signal_names=[...new Set([...xn,...hn])];else delete Ve.__stx_client_signal_names;let Ft=R.filter((ie)=>!zt.has(ie)&&!(ie in s));if(Ft.length>0)Ve[Nn]=Ft;let bn={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:oe.dirname(X),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||ze||Xe.length===0,defaultLayout:void 0};Ve.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:yn}=await r("stx/process",()=>import("./chunk-f8dkq3ta.js")),ot=await yn(ee,Ve,X,bn,E),yt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ie of ot.matchAll(/\{\{([\s\S]*?)\}\}/g))yt.add(ie[1].trim());if(yt.size>0)a.__stx_preserved_client_expressions=[...yt];let qe=it,Ue=ot;if(ze){let ie="";if(Object.keys(s).length>0)try{ie=` data-stx-props="${zs(JSON.stringify(s))}"`}catch{}let se=Z?` stx-hydrate="${zs(Z)}"`:"",ge=Object.fromEntries(Object.entries(pt).map(([lt,_t])=>[lt,Boolean(_t)])),me=Object.keys(ge).length>0?` data-stx-slots="${zs(JSON.stringify(ge))}"`:"",He=` data-stx-scope="${qe}"${ie}${me}${se}`,Be=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(ot),at=Be?"span":"div";Ue=tu(ot,He)??`<${at}${He} data-stx-component-wrapper${Be?' style="display:contents"':""}>${ot}</${at}>`;let ct=await Promise.all(Xe.map(async(lt)=>{let _t=lt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!_t)return lt;let[,_n,Xn]=_t,wt=await bl(Xn,X,c.buildMode==="compile"),Vt=dn(wt.clientCode,Oe(Ve)),{vendorStyleTags:nt}=wt,wn=Vt?`function(__scopeId) {
|
|
291
291
|
${Vt}
|
|
292
292
|
return (${wt.factoryBody})(__scopeId);
|
|
293
293
|
}`:wt.factoryBody,rt=Z?null:ws(a,wn),Ut=rt?`window.__stxComponentFactories[${JSON.stringify(rt)}](${JSON.stringify(qe)});`:`(${wn})(${JSON.stringify(qe)});`;if(Z)return`${nt}<script type="stx/island" data-stx-island="${qe}" data-stx-scoped data-stx-owner="${qe}"${_n}>${Ut}</script>`;return`${nt}<script data-stx-scoped data-stx-run="always" data-stx-owner="${qe}"${_n}>${Ut}</script>`}));if(Ue=Ue+`
|
|
@@ -313,7 +313,7 @@ ${we.yellow}${we.bold}Message:${we.reset} ${s}
|
|
|
313
313
|
`,v)C+=`
|
|
314
314
|
${we.blue}${we.bold}Context:${we.reset}
|
|
315
315
|
${we.dim}${v}${we.reset}
|
|
316
|
-
`;return C}function de(){Qt.clear(),Fn.clear(),Fs.clear(),Vs.clear(),Vn.clear()}function Rp(){return{size:Qt.size,maxSize:500}}var Ws=y(128);async function bl(e,s,t){let o=b(e,s,t),a=Ws.get(o);if(a){if(as(a.deps))return a;Ws.delete(o)}let h=Io(e,{filePath:s,projectRoot:process.cwd()}),c=h.code,v=Oo(h.styles);c=Pt(c).code;let{hasUserImports:E,bundleClientScript:R}=await r("stx/client-script-bundler",()=>import("./chunk-
|
|
316
|
+
`;return C}function de(){Qt.clear(),Fn.clear(),Fs.clear(),Vs.clear(),Vn.clear()}function Rp(){return{size:Qt.size,maxSize:500}}var Ws=y(128);async function bl(e,s,t){let o=b(e,s,t),a=Ws.get(o);if(a){if(as(a.deps))return a;Ws.delete(o)}let h=Io(e,{filePath:s,projectRoot:process.cwd()}),c=h.code,v=Oo(h.styles);c=Pt(c).code;let{hasUserImports:E,bundleClientScript:R}=await r("stx/client-script-bundler",()=>import("./chunk-wz6368p4.js")),C=[],O=!1;if(E(c)){let V=c;c=await R(V,s,{projectRoot:process.cwd(),minify:t,collectInputs:C}),O=c===V}let{stripStxRuntimeImports:M}=await r("stx/signal-processing",()=>import("./chunk-sw6p5176.js"));c=M(c);let N=T(c),I=ul(N),P=new Set(L(N,!0).split(",").map((V)=>V.trim())),Z=`function(__scopeId) {
|
|
317
317
|
${st("const",[...ic,...I],N)}
|
|
318
318
|
const __scope = window.stx._scopes = window.stx._scopes || {};
|
|
319
319
|
const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{_o,Ea,r,Et,te,S,Ae,on,Pe,le,q,or,an,us,La,ln,cr,ps,gs,ja,Ao,Ba,Fa,za,Ha,Oe,Ne,ms,Le,n,pn,m,d,F,K,ve,k,_}from"./chunk-
|
|
2
|
+
import{_o,Ea,r,Et,te,S,Ae,on,Pe,le,q,or,an,us,La,ln,cr,ps,gs,ja,Ao,Ba,Fa,za,Ha,Oe,Ne,ms,Le,n,pn,m,d,F,K,ve,k,_}from"./chunk-kwek8xdt.js";import{l,p,E,t,re,z,a,we,zo,D,hn,Ho,Mt,Vo,ec,pr,tc,rt,nc,fr,rc,yn,Uo,sc,gr,hr,xe,Wo}from"./chunk-2dp7hyv7.js";import{Ot}from"./chunk-1sr6c0nk.js";import{gn}from"./chunk-pvb48ehs.js";import{h}from"./chunk-8k3rwv8r.js";import{er,ts}from"./chunk-365vg0eg.js";import{ua,da,Yn,Xe,pa,R}from"./chunk-9gfffs28.js";import{mo,ho,yo,bo}from"./chunk-fzqj1mjz.js";import{oa,Br}from"./chunk-9yxgdy4z.js";import{Dr,Mr,Lr}from"./chunk-1mj9crcg.js";import{Nr,qn}from"./chunk-a95r5nmq.js";import{Fr,io,ao,zr,Hr,co}from"./chunk-sjcqxfq1.js";import{Zs}from"./chunk-prf164ct.js";import{ee,no,ro,so}from"./chunk-ka8befem.js";import{Gn,ge,aa,Kn,ca}from"./chunk-wankp78x.js";import{U,Ge}from"./chunk-bnn7pd62.js";import{fa,ga}from"./chunk-a5zqqgx2.js";import{C,bn,qo}from"./chunk-fbtv2k1p.js";import fs from"fs";import ce from"path";function lt(){return`
|
|
3
3
|
// STX Lifecycle Runtime
|
|
4
4
|
(function() {
|
|
5
5
|
if (typeof window === 'undefined') return;
|
|
@@ -854,13 +854,13 @@ ${I}
|
|
|
854
854
|
</style>`;o=o.replace(x,P),v.lastIndex=0}catch(I){}}}return o}import it from"path";var cs=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,ls=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function ds(c,e){if(!e||!c.includes("/"))return c;let u=it.dirname(e);return c.replace(cs,(o,g,i,f)=>{let v=it.resolve(u,f);return`${g}${i}${v.split(it.sep).join("/")}${i}`})}function dn(c,e){if(!e||!c.includes("<script"))return c;return c.replace(ls,(u,o,g,i)=>`${o}${ds(g,e)}${i}`)}var _e="<!--PARENT_CONTENT_PLACEHOLDER-->";function fn(c){return c.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Sn(c,e){let u=c.length,o=e,g=!0,i=[],f=(v)=>v+9<=u&&c[v]==="<"&&c[v+1]==="/"&&(c[v+2]==="s"||c[v+2]==="S")&&(c[v+3]==="c"||c[v+3]==="C")&&(c[v+4]==="r"||c[v+4]==="R")&&(c[v+5]==="i"||c[v+5]==="I")&&(c[v+6]==="p"||c[v+6]==="P")&&(c[v+7]==="t"||c[v+7]==="T")&&(c[v+8]===">"||/\s/.test(c[v+8]));while(o<u){let v=c[o];if(f(o))return o;if(v==="/"&&c[o+1]==="/"){if(o=c.indexOf(`
|
|
855
855
|
`,o+2),o===-1)return-1;o+=1,g=!0;continue}if(v==="/"&&c[o+1]==="*"){let y=c.indexOf("*/",o+2);if(y===-1)return-1;o=y+2,g=!0;continue}if(v==="/"&&g){let y=o+1,x=!1;while(y<u){let b=c[y];if(b==="\\"){y+=2;continue}if(b==="[")x=!0;else if(b==="]")x=!1;else if(b==="/"&&!x){y++;break}else if(b===`
|
|
856
856
|
`){y=-1;break}y++}if(y===-1){o++,g=!1;continue}while(y<u&&/[a-z]/.test(c[y]))y++;o=y,g=!1;continue}if(v==="'"||v==='"'){let y=v;o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]===y){o++;break}if(c[o]===`
|
|
857
|
-
`)break;o++}g=!1;continue}if(v==="`"){o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,g=!0;break}o++}if(i.length===0)g=!1;continue}if(v==="}"&&i.length>0){i.pop(),o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++,g=!1;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,g=!0;break}o++}continue}if(/\s/.test(v));else if(/[)\].\w$]/.test(v))g=!1;else g=!0;o++}return-1}function $n(c,e){let u=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`<script\\b(?=[^>]*\\b${u}(?:\\s|=|/?>))[^>]*>`,"i").exec(c);if(!o)return null;let g=o.index+o[0].length,i=c.indexOf("</script>",g);if(i===-1)return null;let f=c.indexOf(">",i);if(f===-1)return null;return{start:o.index,end:f+1}}var hs=4096;async function mn(c,e,u){if(u.buildMode!=="serve"||e.length<hs)return null;let{registerServeModuleBundle:o}=await import("./chunk-
|
|
857
|
+
`)break;o++}g=!1;continue}if(v==="`"){o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,g=!0;break}o++}if(i.length===0)g=!1;continue}if(v==="}"&&i.length>0){i.pop(),o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++,g=!1;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,g=!0;break}o++}continue}if(/\s/.test(v));else if(/[)\].\w$]/.test(v))g=!1;else g=!0;o++}return-1}function $n(c,e){let u=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`<script\\b(?=[^>]*\\b${u}(?:\\s|=|/?>))[^>]*>`,"i").exec(c);if(!o)return null;let g=o.index+o[0].length,i=c.indexOf("</script>",g);if(i===-1)return null;let f=c.indexOf(">",i);if(f===-1)return null;return{start:o.index,end:f+1}}var hs=4096;async function mn(c,e,u){if(u.buildMode!=="serve"||e.length<hs)return null;let{registerServeModuleBundle:o}=await import("./chunk-0f33ssaq.js");return`<script ${c} src="${o(e)}"></script>`}async function Hn(c,e,u){try{let{registeredModuleIdsIn:o,buildModuleRegistryScript:g}=await r("stx/client-module-registry",()=>import("./chunk-a91atghh.js")),i=[],f=await g(o(...c),{minify:qo(e.buildMode),collectInputs:i});for(let v of i)u?.add(v);if(!f)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:v}=await import("./chunk-0f33ssaq.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${v(f)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${f.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function ys(c,e=""){let u=$n(c,"data-stx-runtime");if(!u)return c;let o=Gn(c);if(o===-1||o===u.start){if(!e)return c;return c.slice(0,u.end)+e+c.slice(u.end)}if(o<u.start)return c.slice(0,o)+c.slice(u.start,u.end)+e+`
|
|
858
858
|
`+c.slice(o,u.start)+c.slice(u.end);let g=c.slice(u.start,u.end),i=c.slice(0,u.start)+c.slice(u.end),f=Gn(i);if(f===-1)return g+e+`
|
|
859
859
|
`+i;return i.slice(0,f)+g+e+`
|
|
860
860
|
`+i.slice(f)}function vs(c){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return c.replace(e,(u,o,g)=>{let i=c.slice(0,g);return i.lastIndexOf("<")>i.lastIndexOf(">")?`{{${o}}}`:`{<!--stx-literal-->{${o}}}`})}async function s(c,e,u,o,g){if(o.ssr===!1&&!o.autoShell&&o.buildMode==="spa")return c;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=ve(c,u);let i=!e.__stxProcessingDepth;ln(e);for(let f of o._layerGraph?.configDependencies??[])g.add(f);if(i&&o.runtimeConfig)await gn(e,u,o.runtimeConfig);if(i)za(e),e.__stx_scope_seq??={n:0,key:ms(String(e.__filename??u))},e.__stx_head_injections=Vo(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((o.debug||!C()&&!bn())&&u&&u.endsWith(".stx"))Zs(c,u);try{return await te.timeAsync("template-processing",async()=>{let f=await bs(c,e,u,o,g);if(i)f=Ao(f);if(i&&o.autoShell&&o.buildMode!=="compile"){let v=xe(o.app?.head,{known:hr,source:"app.head"}),x=(e.__stx_runtime_head||null)??Wo(),b=(e.__stx_head_raw||"").trim(),w,T=b.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(T)w=T[1].trim(),b=b.replace(T[0],"").trim();let A=e.__sections?.title,O=A?k(A,e,u):void 0,M=x.title||w||O,I=!x.title&&(!!w||!!O),P=x.meta||[],N=new Set(P.map((G)=>rt(G)).filter(Boolean)),V={...v,...M&&{title:M},meta:[...(v.meta||[]).filter((G)=>!N.has(rt(G))),...P],link:[...v.link||[],...x.link||[]],script:[...v.script||[],...x.script||[]],headRaw:[v.headRaw,b].filter(Boolean).join(`
|
|
861
861
|
`),...x.htmlAttrs&&{htmlAttrs:nc(v.htmlAttrs,x.htmlAttrs)},...x.bodyAttrs&&{bodyAttrs:{...v.bodyAttrs||{},...x.bodyAttrs}}},X=Uo(f);if(f=gr(f,V,{...I&&{titleIsHtml:!0},...o.app?.colorMode&&{colorMode:o.app.colorMode}},X),X)f=sc(f,v),f=fr(f,V.htmlAttrs);let L=f.match(/<!-- stx-layout: ([^ ]+) -->/);if(L&&f.includes("<head")){let G=L[1],J=ts(G);f=f.replace(/<head\b[^>]*>/i,(Y)=>`${Y}
|
|
862
862
|
<meta name="stx-layout" content="${fn(G)}">
|
|
863
|
-
<meta name="stx-layout-group" content="${fn(J)}">`)}let j=f.match(/function (__stx_setup_\w+)\(/),H=j?U(f):null;if(j&&H&&!/\bdata-stx=/.test(H.tag)){f=Ge(f,(J,Y)=>`<body${Y} data-stx="${j[1]}">`);let G=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${j[1]}"`,"i");f=f.replace(G,"$1")}}if(i){let v=e.__stx_head_injections??Vo(),y=rc(f);if(y!==null)v.beforeClose.push(y);let x=tn(f);if(x!==null)v.afterOpen.push(x);if(o.offline?.enabled&&!f.includes("data-stx-offline"))v.beforeClose.push(nn);f=ec(f,v);let b=o.app?.colorMode;if(b)f=pr(f,b)}if(i)if($n(f,"data-stx-runtime")){let y=null,x=null,b=null,w=null,T=null;try{let{getStoreScript:O}=await r("stx/store-loader",()=>import("./chunk-
|
|
863
|
+
<meta name="stx-layout-group" content="${fn(J)}">`)}let j=f.match(/function (__stx_setup_\w+)\(/),H=j?U(f):null;if(j&&H&&!/\bdata-stx=/.test(H.tag)){f=Ge(f,(J,Y)=>`<body${Y} data-stx="${j[1]}">`);let G=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${j[1]}"`,"i");f=f.replace(G,"$1")}}if(i){let v=e.__stx_head_injections??Vo(),y=rc(f);if(y!==null)v.beforeClose.push(y);let x=tn(f);if(x!==null)v.afterOpen.push(x);if(o.offline?.enabled&&!f.includes("data-stx-offline"))v.beforeClose.push(nn);f=ec(f,v);let b=o.app?.colorMode;if(b)f=pr(f,b)}if(i)if($n(f,"data-stx-runtime")){let y=null,x=null,b=null,w=null,T=null;try{let{getStoreScript:O}=await r("stx/store-loader",()=>import("./chunk-we8ptx6w.js")),M=o.storesDir,I=await O(M);if(I)b=`<script data-stx-stores>${I}</script>`,x=await mn("data-stx-stores",I,o)??b}catch{}y=await Hn([f,b],o,g);try{let{getFrameworkComposableScript:O}=await r("stx/framework-composables",()=>import("./chunk-sqayfat9.js"));T=await O(f)}catch{}try{let{getComposableScript:O}=await r("stx/composable-loader",()=>import("./chunk-zp9k5pha.js")),M=o.composablesDir,I=[y,b,T].filter((N)=>N!==null),P=await O(o._layerComposableDirs??M,f,I);if(P)w=await mn('data-stx-scoped data-stx-run="always" data-stx-composables',P,o)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${P}</script>`}catch{}let A=[y,x,w,T].filter((O)=>O!==null).map((O)=>`
|
|
864
864
|
${O}`).join("");f=ys(f,A)}else{let y=await Hn([f],o,g);if(y){let x=f.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(x!==-1)f=f.slice(0,x)+y+`
|
|
865
865
|
`+f.slice(x)}}if(i)f=tc(f);if(i&&e.__stx_inject_css!==!1)f=await h(f,void 0,o.buildMode==="serve",!0);else if(i)f=an(f);if(f=f.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),f=vs(f),i&&e.__stx_runtime_config)f=Ot(f,e.__stx_runtime_config);if(i&&!e.__stx_defer_server_data){let v=cr(e);if(v){let y=/<head\b[^>]*>/i.exec(f),x=y?y.index+y[0].length:0;f=f.slice(0,x)+v+f.slice(x)}}return f})}catch(f){if(f instanceof z)throw f;let v=f instanceof Error?f.message:String(f),y=new re(`Template processing failed: ${v}`,u,void 0,void 0,c.substring(0,200)+(c.length>200?"...":""));if(D.log(y,{filePath:u,context:e}),hn.logDetailedError(y,{filePath:u,template:c.substring(0,500)}),C()&&!o.debug)console.error(`[stx] ${ce.relative(process.cwd(),u)||u}: ${y.message}`);if(o.debug)throw y;return zo.createFallbackContent("Template Processing",y)}}async function bs(c,e,u,o,g){let i=process.cwd(),f={...o,partialsDir:o.partialsDir&&!ce.isAbsolute(o.partialsDir)?ce.resolve(i,o.partialsDir):o.partialsDir,componentsDir:o.componentsDir&&!ce.isAbsolute(o.componentsDir)?ce.resolve(i,o.componentsDir):o.componentsDir,layoutsDir:o.layoutsDir&&!ce.isAbsolute(o.layoutsDir)?ce.resolve(i,o.layoutsDir):o.layoutsDir},v=f,y=c;await ks(u,e),xs(e,v),y=await we(()=>zt(y,e,u,v),y,(L)=>{D.log(L,{filePath:u,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${u}: ${L.message}`)}),y=y.replace(/\{\{--[\s\S]*?--\}\}/g,"");let x=le(y,Pe,(L,j)=>`\x00STX_HTML_COMMENT_${j}\x00`);y=x.output;let b=x.tokens,w=(L)=>b.length===0?L:L.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(j,H)=>b[Number(H)]??""),T="\x00STX_ESCAPED_AT\x00",A="\x00STX_ESC_MUSTACHE_OPEN\x00",O="\x00STX_ESC_MUSTACHE_CLOSE\x00";y=y.replace(/@@/g,T),y=y.replace(/@\{\{([\s\S]*?)\}\}/g,(L,j)=>`${A}${j}${O}`),y=Jt(y),y=await un(y,u,g);let M={};y=Mr(y,M);let I={...e.__sections||{}},P="",N=mt(gt(c)),V=/@nolayout\b/.test(y)||N===!1;if(/@nolayout\b/.test(y))y=y.replace(/@nolayout\b\s*/g,"");let X=y.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(X)P=X[1],y=y.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof N==="string"){if(P=N,!/@section\s*\(/.test(y))y=`@section('content')
|
|
866
866
|
${y.trim()}
|
|
@@ -869,7 +869,7 @@ ${y.trim()}
|
|
|
869
869
|
@endsection`}}if(P&&y.includes("<script")){let L=q(y),j=L.scripts.map((H)=>vn(H,u)??H);y=or(L.output,j)}if(y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(L,j,H)=>(I[j]=H,"")),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(L,j,H)=>{if(/^(['"]).*\1$/.test(H.trim()))return L;try{let G=l(H.trim(),e);if(G===void 0)return L;let Y=(e.__stx_inline_section_values??=[]).push(G)-1;return I[j]=`{{ __stx_inline_section_values[${Y}] }}`,""}catch{return L}}),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(L,j,H)=>{if(H.includes("@parent"))I[j]=H.replace("@parent",_e);else I[j]=H.trim();return""}),e.__sections=I,y=y.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(L,j,H)=>I[j]||H||""),!("slot"in e)||e.slot===void 0)y=y.replace(/\{\{\s*slot\s*\}\}/g,()=>I.content||"");if(y=Lr(y,M),P){let L=[],j=q(y),H=le(j.output,on,(G,J)=>`\x00STX_ORPHAN_STYLE_${J}\x00`);if(y=H.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(G,J,Y)=>{let ne=J==="SCRIPT"?vn(j.scripts[Number(Y)],u):H.tokens[Number(Y)];if(ne)L.push(ne);return""}),L.length>0){let G=L.join(`
|
|
870
870
|
`);I.content=I.content?`${I.content}
|
|
871
871
|
${G}`:G,e.__sections=I}}if(P)try{let L;if(ce.isAbsolute(P))L=P,g.add(P);else L=await we(()=>pn(P,u,f,g),null,()=>{throw new re(`Failed to resolve layout path: ${P}`,u,void 0,void 0,`Layout referenced from ${u}`)});if(!L){let ne=(oe)=>{if(!oe)return[];try{let ae=ce.isAbsolute(oe)?oe:ce.resolve(process.cwd(),oe);return fs.readdirSync(ae).filter((ue)=>ue.endsWith(".stx")).map((ue)=>ue.replace(/\.stx$/,""))}catch{return[]}},se=[...ne(f.layoutsDir),...ne(f.fallbackLayoutsDir)].filter((oe,ae,ue)=>ue.indexOf(oe)===ae).sort(),de=`Layout not found: ${P} (referenced from ${u})`+(se.length>0?`. Available layouts: ${se.join(", ")}`:f.layoutsDir?`. No .stx layouts found in ${f.layoutsDir}`:"");if(D.log(Error(de),{layoutPath:P,filePath:u,available:se},"error"),console.error(`[stx] ${de}`),f.debug)throw new re(de,u);return y}let j=await we(()=>Bun.file(L).text(),"",()=>{throw new re(`Failed to read layout file: ${L}`,u,void 0,void 0,"Layout content could not be loaded")});j=dn(j,L);let H=j.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(H){if(f.debug)console.log(`Found nested layout: ${H[1]} in ${L}`);let ne={},se=j.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ae,ue,ke)=>(ne[ue]=ke.trim(),""));for(let[ae,ue]of Object.entries(ne))if(I[ae]&&I[ae].includes(_e)){let ke=I[ae].indexOf(_e);I[ae]=I[ae].slice(0,ke)+ue+I[ae].slice(ke+_e.length)}else if(!I[ae])I[ae]=ue;let de={...e,__sections:I},oe=`@layout('${H[1]}')${se}`;return await s(oe,de,L,f,g)}let G=j.replace(/\{\{--[\s\S]*?--\}\}/g,""),J=Mr(G,M),Y={};return J=J.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ne,se,de)=>(Y[se]=de.trim(),`@slot('${se}')`)),J=J.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(ne,se,de)=>{if(I[se]){let oe=I[se];if(oe.includes(_e)){let ae=Y[se]||"",ue=oe.indexOf(_e);oe=oe.slice(0,ue)+ae+oe.slice(ue+_e.length)}return oe}return de||""}),J=ws(J,I),J=J.replace(/\{\{\s*slot\s*\}\}/g,()=>I.content||""),J=Lr(J,M),e.__originalFilePath=u,y=await kn(J,e,L,f,g),y=`<!-- stx-layout: ${P} -->
|
|
872
|
-
${y}`,w(y)}catch(L){if(L instanceof z)throw L;throw new re(`Error processing layout ${P}: ${L instanceof Error?L.message:String(L)}`,u)}return w(await kn(y,e,u,f,g))}function ws(c,e){return c.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(u,o,g)=>{let i=e[o];if(i!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(i))return i}return g||""})}function xs(c,e){if(c.__stx_sfc_mode=!0,c.__stx_options=e,e.buildMode)c.__stx_buildMode=e.buildMode;let u=e.envPrefix||"STX_PUBLIC_",o={};for(let[g,i]of Object.entries(process.env))if(g.startsWith(u)&&i!==void 0)o[g]=i;c.$env=o}async function ks(c,e){await we(()=>Kt(c,e),void 0,(u)=>{D.log(u,{filePath:c,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${c}: ${u.message}`)})}var ot="data-stx-source";function vn(c,e){if(!c)return c;let u=/^<script\b([^>]*)>/i.exec(c);if(!u||!/\bserver\b/.test(u[1])||u[1].includes(ot))return c;return`<script ${ot}="${encodeURIComponent(e)}"${c.slice(7)}`}function Ss(c){let e=new RegExp(`${ot}="([^"]*)"`).exec(c);return e?decodeURIComponent(e[1]):void 0}function wn(c){return c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function xn(c,e,u){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a <script server> ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${wn(c)}</span><span style="display:block;margin-top:4px">${wn(u)}</span></div>`}async function $s(c,e,u,o){let{scanScriptTags:g}=await r("stx/signal-processing",()=>import("./chunk-
|
|
872
|
+
${y}`,w(y)}catch(L){if(L instanceof z)throw L;throw new re(`Error processing layout ${P}: ${L instanceof Error?L.message:String(L)}`,u)}return w(await kn(y,e,u,f,g))}function ws(c,e){return c.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(u,o,g)=>{let i=e[o];if(i!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(i))return i}return g||""})}function xs(c,e){if(c.__stx_sfc_mode=!0,c.__stx_options=e,e.buildMode)c.__stx_buildMode=e.buildMode;let u=e.envPrefix||"STX_PUBLIC_",o={};for(let[g,i]of Object.entries(process.env))if(g.startsWith(u)&&i!==void 0)o[g]=i;c.$env=o}async function ks(c,e){await we(()=>Kt(c,e),void 0,(u)=>{D.log(u,{filePath:c,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${c}: ${u.message}`)})}var ot="data-stx-source";function vn(c,e){if(!c)return c;let u=/^<script\b([^>]*)>/i.exec(c);if(!u||!/\bserver\b/.test(u[1])||u[1].includes(ot))return c;return`<script ${ot}="${encodeURIComponent(e)}"${c.slice(7)}`}function Ss(c){let e=new RegExp(`${ot}="([^"]*)"`).exec(c);return e?decodeURIComponent(e[1]):void 0}function wn(c){return c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function xn(c,e,u){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a <script server> ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${wn(c)}</span><span style="display:block;margin-top:4px">${wn(u)}</span></div>`}async function $s(c,e,u,o){let{scanScriptTags:g}=await r("stx/signal-processing",()=>import("./chunk-sw6p5176.js")),i=[],f=!C()&&!bn();for(let y of g(c)){let x=y.attrs;if(!/\bserver\b/.test(x))continue;let b=y.start+y.fullMatch.indexOf(">")+1,w=Sn(c,b);if(w===-1)continue;let T=c.slice(b,w);if(!T.trim())continue;let A=Ss(x)??u,O={index:y.start,length:w+9-y.start};try{let{extractVariables:M}=await r("stx/variable-extractor",()=>import("./chunk-96mm4q2g.js"));await M(T,e,A,{preserveExisting:!0,onFailure:(I)=>{if(I.kind==="unknown")return;if(o?.onServerScriptError?.({sourcePath:A,kind:I.kind,message:I.message}),!f)return;i.push({...O,markup:xn(A,I.kind,I.message)})}})}catch(M){let I=M instanceof Error?M:Error(String(M));if(D.log(I,{filePath:A,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${A}: ${I.message}`),f)i.push({...O,markup:xn(A,"unknown",I.message)})}}if(i.length===0)return c;let v=c;for(let y of i.sort((x,b)=>b.index-x.index))v=v.slice(0,y.index)+y.markup+v.slice(y.index+y.length);return v}async function Es(c,e,u){try{let{interpolateScriptsInTemplate:o}=await r("stx/expressions",()=>import("./chunk-wyq0c4wy.js"));return o(c,e,{skipServer:!0})}catch(o){let g=o instanceof Error?o:Error(String(o));return D.log(g,{filePath:u,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${u}: ${g.message}`),c}}async function kn(c,e,u,o,g){let i=c,f=o;if(i=await $s(i,e,u,o),i=await Bt(i,e,u),i=await Ft(i,e,u),i=await Es(i,e,u),i=await At(i,e,u,f),ve(i))i=io(i,e),i=Hr(i,e),i=zr(i,e);i=ao(i);let{processStreamDirectives:v}=await r("stx/streaming",()=>import("./chunk-7dtpszqq.js"));i=v(i,e),i=qn(i,e,u,f,!0),i=await en(i,e,u,f,g),i=await Br(i,e,u,f,g),i=ua(i,e,u,f);let{processDeferDirectives:y}=await r("stx/defer",()=>import("./chunk-2f17h17f.js"));i=y(i,e,u);let{processTeleportDirectives:x}=await r("stx/teleport",()=>import("./chunk-wq712sw1.js"));i=x(i,e,u);let{processTransitionDirectives:b,processTransitionAttributes:w}=await r("stx/transitions",()=>import("./chunk-k2pa44rf.js"));i=b(i,e,u),i=w(i);let{processErrorBoundaryDirectives:T,stripRenderFailedMarkers:A}=await r("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));i=T(i,e,u),i=A(i);let{processSuspenseDirectives:O}=await r("stx/suspense",()=>import("./chunk-weqc0ssb.js"));i=O(i,e,u);let{processAsyncDirectives:M}=await r("stx/async-components",()=>import("./chunk-67kj14at.js"));i=M(i,e,u);let{processKeepAliveDirectives:I}=await r("stx/keep-alive",()=>import("./chunk-6vzktvyw.js"));i=I(i,e,u);let{processVirtualListDirectives:P,processVirtualGridDirectives:N,processInfiniteListDirectives:V}=await r("stx/virtual-scrolling",()=>import("./chunk-sf0wsq74.js"));i=P(i,e,u),i=N(i,e,u),i=V(i,e,u);let{processPartialHydrationDirectives:X,processStaticDirectives:L}=await r("stx/partial-hydration",()=>import("./chunk-9szxxgv5.js"));i=X(i,e,u),i=L(i);let{processComputedDirectives:j,processWatchDirectives:H}=await r("stx/computed",()=>import("./chunk-1xdzcy9d.js"));i=j(i,e,u),i=H(i,e,u);let{processFormValidationDirectives:G}=await r("stx/forms-validation",()=>import("./chunk-am246nf3.js"));i=G(i,e,u);let{processHeadDirective:J,processTitleDirective:Y,processMetaDirective:ne,resetHead:se}=await r("stx/head",()=>import("./chunk-e1fetwbr.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)se();let de=J(i);if(i=de.content,de.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${de.headContent}
|
|
873
873
|
`;if(i=Y(i,e),i=ne(i,e,u),i=Xt(i),i=no(i,e),i=Ct(i),i=Ut(i),i=await Dr(i,e,u,f,g),i=await Br(i,e,u,f,g),e.__stxProcessingDepth===1)i=Ha(i,e);if(i=i.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),i=Ao(i),i=ee(i,e,u),i=Nr(i),i=La(i,e,{filePath:u,buildMode:f.buildMode}),i=ro(i,e),i=so(i,e),i=ze(i,e),i=Nt(i,e),i=Ht(i,e),i=await bt(i,e,u,f),i=await pa(i,e,u),i=await fa(i,e,u,f),i=ga(i,e,u,f),i=mo(i,e,u,f),i=ho(i,e,u),i=yo(i,e,u,f),i=_t(i,e,u,f),i=ps(i,e),i=gs(i),i=ja(i),!f.skipEventDirectives)i=Ea(i,e,u);if(i=vt(i,e,u),f.debug){let B=/\bx-data\s*=/.test(i),W=Fr(c);if(B&&W)console.warn(`[stx] ${u}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
874
874
|
Both work on the same page, but they manage separate scopes.
|
|
875
875
|
Prefer signals (state/derived/effect) for new components.`)}i=oa(i,e),i=await k(i,e,u),i=Ba(i),i=Fa(i),i=pt(i);let{processXElementDirectives:oe}=await r("stx/x-element",()=>import("./chunk-zhxdpzga.js"));i=oe(i);let ae=e.__originalFilePath||u,ue=Oe(e);if(i=await co(i,f,ae,ue),i=Pt(i,e),i=await Wt(i,e,u,f),f.media?.image?.autoSiblings){let B=f.publicDir||"public",{rewriteImagesWithSiblings:W}=await r("stx/image-optimization/auto-sibling",()=>import("./chunk-shpc1ttk.js"));i=await W(i,{publicDir:B})}if(f.seo?.enabled)i=bo(i,e,f);let ke=(B,W,Z=!0)=>{if(!W)return B;let he=W.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ie=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(B),fe=ie?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ie[0]):null;if(he&&ie&&fe){if(Z){let Ce=ie.index+fe.index;B=B.slice(0,Ce)+he[0]+B.slice(Ce+fe[0].length)}if(W=W.replace(he[0],"").trim(),!W)return B}if(/<\/head>/i.test(B))return B.replace(/<\/head>/i,`${W}
|
|
@@ -883,6 +883,6 @@ ${lt()}
|
|
|
883
883
|
`+Ce}else i=i.replace("</head>",`${W}
|
|
884
884
|
</head>`)}else if(i.includes("<body"))i=i.replace(/<body([^>]*)>/,`<body$1>
|
|
885
885
|
${W}`);else i=W+`
|
|
886
|
-
`+i}{let{scanScriptTags:B}=await r("stx/signal-processing",()=>import("./chunk-
|
|
886
|
+
`+i}{let{scanScriptTags:B}=await r("stx/signal-processing",()=>import("./chunk-sw6p5176.js")),W=[];for(let Z of B(i)){if(!/\bserver\b/i.test(Z.attrs))continue;let he=Z.start+Z.fullMatch.indexOf(">")+1,ie=Sn(i,he);if(ie===-1)continue;let fe=ie+9;while(fe<i.length&&/\s/.test(i[fe]))fe++;W.push({start:Z.start,end:fe})}if(W.length>0){let Z=Array(W.length+1),he=0;for(let ie=0;ie<W.length;ie++){let{start:fe,end:Ce}=W[ie];Z[ie]=i.slice(he,fe),he=Ce}Z[W.length]=i.slice(he),i=Z.join("")}}let at=us(i,u);if(at.hasScoped)i=at.html;let Rn=e.__stx_event_bindings||[],Ke=!1,ct=[],Mn=/\s:[a-z][\w.-]*\s*=/.test(i),{scanScriptTags:Dn}=await r("stx/signal-processing",()=>import("./chunk-sw6p5176.js"));for(let B of Dn(i,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))ct.push({match:B.fullMatch,attrs:B.attrs,content:B.body});for(let{match:B,attrs:W,content:Z}of ct){Ke=!0;let he=Z;Ae(Z,u,o.strict,e.__originalFilePath);let ie=await Ne(Z,{eventBindings:Rn,attrs:W,hasColonDirectives:Mn,templateContent:c,filePath:u,projectRoot:process.cwd(),production:qo(o.buildMode),serverData:ue});i=i.replace(B,()=>ie)}if(Ke)e.__stx_event_bindings=[];if(!Ke&&e.__stxProcessingDepth===1){let B=e.__stx_event_bindings||[];if(B.length>0){let W=_o(B);if(W){let Z=i.lastIndexOf("</body>");i=Z===-1?i+W:i.slice(0,Z)+W+`
|
|
887
887
|
`+i.slice(Z)}e.__stx_event_bindings=[]}}if(!ge(i)&&aa(i))i=await Kn(i,f);if(i=ca(i),f.csp?.enabled&&f.csp.useNonce&&typeof e.cspNonce==="string")i=$t(i,e.cspNonce);return i}
|
|
888
888
|
export{gt,Te,ta,Ys,Hn,s};
|