@stacksjs/stx 0.2.901 → 0.2.902
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-0yhkgv37.js +2 -0
- package/dist/{chunk-9ehryt4w.js → chunk-10cnra24.js} +1 -1
- package/dist/{chunk-p80nnmha.js → chunk-16edtncx.js} +6 -6
- package/dist/{chunk-yjs11rre.js → chunk-27bqcv20.js} +1 -1
- package/dist/{chunk-mmtyp5z4.js → chunk-31r1tk86.js} +1 -1
- package/dist/{chunk-8kvqv885.js → chunk-33h2z0s5.js} +1 -1
- package/dist/{chunk-03ymcxsb.js → chunk-3mr0kx0h.js} +1 -1
- package/dist/{chunk-52njxk3w.js → chunk-3xpnw4s1.js} +1 -1
- package/dist/{chunk-hg31hs5d.js → chunk-3ykhczg6.js} +2 -2
- package/dist/{chunk-sxkkxmkc.js → chunk-44fmhh0e.js} +4 -4
- package/dist/{chunk-9mjr6187.js → chunk-4n102da4.js} +1 -1
- package/dist/{chunk-sn1qtgmc.js → chunk-55t633yd.js} +3 -3
- package/dist/{chunk-xk1pht3a.js → chunk-5883qema.js} +1 -1
- package/dist/{chunk-f32mtkqf.js → chunk-5c2yf28r.js} +4 -4
- package/dist/{chunk-e42x1k6j.js → chunk-6c2hsv1w.js} +1 -1
- package/dist/{chunk-ntvgvvrh.js → chunk-6mhz9stn.js} +1 -1
- package/dist/{chunk-7pfhr4nk.js → chunk-7nf7mp27.js} +1 -1
- package/dist/chunk-846bpzjc.js +2 -0
- package/dist/{chunk-c2e4m8qq.js → chunk-8e6en8x7.js} +1 -1
- package/dist/{chunk-1fxq73hk.js → chunk-8fg6gwds.js} +1 -1
- package/dist/{chunk-235fkffb.js → chunk-8pmm7je2.js} +1 -1
- package/dist/{chunk-ybpxtaft.js → chunk-9hde8azp.js} +1 -1
- package/dist/chunk-9y83pdcb.js +4 -0
- package/dist/{chunk-gypna2zb.js → chunk-af50zx8y.js} +2 -2
- package/dist/{chunk-5qkd77vw.js → chunk-aq5ffmrs.js} +1 -1
- package/dist/chunk-b6td3pfh.js +2 -0
- package/dist/chunk-b7dw6rhk.js +3 -0
- package/dist/{chunk-5hksy9tt.js → chunk-be1jvk13.js} +1 -1
- package/dist/{chunk-c0x9wyj7.js → chunk-bgkj0rxe.js} +1 -1
- package/dist/{chunk-6fv02vzc.js → chunk-bhvv6ngq.js} +1 -1
- package/dist/{chunk-9gjt51ac.js → chunk-bn1xt7t6.js} +1 -1
- package/dist/{chunk-yar3c574.js → chunk-br1kkmbz.js} +4 -4
- package/dist/{chunk-95tvzssr.js → chunk-by9s2a8d.js} +1 -1
- package/dist/{chunk-a7x8897c.js → chunk-ckey09ej.js} +1 -1
- package/dist/{chunk-yf715phy.js → chunk-de3tjmqc.js} +1 -1
- package/dist/{chunk-4s6w89m2.js → chunk-dw23nre3.js} +1 -1
- package/dist/{chunk-pms1q3c6.js → chunk-dysb1g8f.js} +1 -1
- package/dist/{chunk-qgcw5jy8.js → chunk-dz51m8bm.js} +1 -1
- package/dist/{chunk-6cnahhm1.js → chunk-f4jmkx33.js} +1 -1
- package/dist/{chunk-ccgcj9tg.js → chunk-fd2d2a69.js} +1 -1
- package/dist/{chunk-xf2jf63c.js → chunk-fys8hswh.js} +1 -1
- package/dist/{chunk-h1bd9496.js → chunk-g56ax995.js} +1 -1
- package/dist/{chunk-bts9v10s.js → chunk-h1a2mk6h.js} +1 -1
- package/dist/{chunk-ysncnbyf.js → chunk-jj7g3c8q.js} +1 -1
- package/dist/{chunk-kxh9rqdm.js → chunk-k4gmqhat.js} +1 -1
- package/dist/{chunk-krdhn8h1.js → chunk-k80jhkqx.js} +1 -1
- package/dist/chunk-kf6j1ht4.js +2 -0
- package/dist/{chunk-g4cs4dj8.js → chunk-m59tzyqp.js} +2 -2
- package/dist/chunk-m67qmg51.js +2 -0
- package/dist/{chunk-kmby9q2c.js → chunk-mphbgnta.js} +2 -2
- package/dist/{chunk-6d10g8wf.js → chunk-mtevtq09.js} +1 -1
- package/dist/chunk-nbk4tjdy.js +2 -0
- package/dist/{chunk-v35zj9fq.js → chunk-nfddhtkd.js} +1 -1
- package/dist/{chunk-c05zj2m9.js → chunk-nxat557m.js} +1 -1
- package/dist/chunk-ps1khncy.js +2 -0
- package/dist/{chunk-e9nyfgwk.js → chunk-q72z9ask.js} +1 -1
- package/dist/{chunk-ndwvgwvs.js → chunk-r1tf52r2.js} +2 -2
- package/dist/chunk-r368e96r.js +2 -0
- package/dist/{chunk-83hs9905.js → chunk-rdrstnn9.js} +1 -1
- package/dist/{chunk-0tzyr4cc.js → chunk-s9t97mza.js} +1 -1
- package/dist/{chunk-vtan6nan.js → chunk-thzj12av.js} +2 -2
- package/dist/{chunk-e23yc82s.js → chunk-v29fnbq1.js} +4 -4
- package/dist/{chunk-at70apjf.js → chunk-v650d8rj.js} +1 -1
- package/dist/{chunk-q3we5jsk.js → chunk-vaxxe2db.js} +1 -1
- package/dist/{chunk-7tjfca0a.js → chunk-w0sj4ehs.js} +1 -1
- package/dist/{chunk-ek4prrmd.js → chunk-wf7st1kj.js} +5 -5
- package/dist/chunk-xhb89sf5.js +2 -0
- package/dist/{chunk-kxbk4505.js → chunk-xjtq49hm.js} +1 -1
- package/dist/{chunk-ecknsnr2.js → chunk-yc6rvmbt.js} +1 -1
- package/dist/{chunk-frjpvdxn.js → chunk-z9nqmatt.js} +1 -1
- package/dist/{chunk-pgqennwt.js → chunk-zfrrfk0s.js} +1 -1
- package/dist/cli.js +8 -8
- 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/dist/temp-dir.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-15qrs231.js +0 -2
- package/dist/chunk-3043ycz6.js +0 -2
- package/dist/chunk-77nn1ckz.js +0 -3
- package/dist/chunk-8jvwapq3.js +0 -2
- package/dist/chunk-9ejk9mwk.js +0 -4
- package/dist/chunk-dvy101w4.js +0 -2
- package/dist/chunk-frf4qp4z.js +0 -2
- package/dist/chunk-kdh1s839.js +0 -2
- package/dist/chunk-s43ty9bg.js +0 -2
- package/dist/chunk-wkat7js9.js +0 -2
- package/dist/chunk-xr5xp6v0.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{zo,zh,Hh}from"./chunk-w0sj4ehs.js";import"./chunk-v650d8rj.js";import"./chunk-6mhz9stn.js";import"./chunk-qs0zk04y.js";import"./chunk-mphbgnta.js";import"./chunk-br1kkmbz.js";import"./chunk-vbmvft7g.js";import"./chunk-65g78sge.js";import"./chunk-3ykhczg6.js";import"./chunk-be1jvk13.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import"./chunk-16edtncx.js";import"./chunk-vaxxe2db.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{Hh as clearComposableCache,zh as getComposableScript,zo as listComposableModules};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Mn,Ki}from"./chunk-
|
|
2
|
+
import{Mn,Ki}from"./chunk-vaxxe2db.js";import"./chunk-esm0pnpz.js";export{Ki as generateRuntimeConfigTypes,Mn as prepareRuntimeConfig};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ze,Dn,po,Gi,z}from"./chunk-esm0pnpz.js";import{Mn}from"./chunk-q3we5jsk.js";import{Yr,C,Fl,xt,na,zl}from"./chunk-hdfhaddy.js";import{D}from"./chunk-7b3dqeyr.js";import{T,R}from"./chunk-0jdz31q1.js";import{Jr,wo,zn,Ll,Le}from"./chunk-5g5khx0m.js";import{fo,d,m,Hr,p,te,K,be,_,bt,yo,De,et,bo}from"./chunk-945zygwa.js";import{w}from"./chunk-v6gkjg5f.js";import{ne}from"./chunk-qykbjg3z.js";import{t,h}from"./chunk-68r2zs20.js";import{c}from"./chunk-p92272k0.js";import Ct from"path";import un from"process";import{AsyncLocalStorage as sc}from"async_hooks";var ti=new sc;function An(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ni(e,n){return ti.run(An(e),n)}async function si(e,n){let r=ti.getStore();if(!r)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 i=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(v,S)=>{if(S===void 0||typeof S==="function"||typeof S==="symbol"||typeof S==="bigint"||typeof S==="number"&&!Number.isFinite(S))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(S&&typeof S==="object"&&!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype&&Object.getPrototypeOf(S)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return S}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function Fr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function X(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,v=()=>{if(l!==0)return;let S=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(S){if(n&&S[1]==="const")return;let V=S[2];if(!a.has(V))i.push(V),a.add(V);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((V)=>{let W=V.trim();if(!W)return;let Z=W.indexOf(":"),G=(Z>=0?W.slice(Z+1).trim():W).split(/[\s=]/)[0];if(G&&!a.has(G))i.push(G),a.add(G)});return}let j=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(n&&r.slice(u).startsWith("const"))return;j[1].split(",").forEach((V)=>{let W=V.trim().replace(/^\.\.\./,"");if(!W)return;let Z=W.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(n)return;let L=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!a.has(V))i.push(V),a.add(V);return}let M=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let V=M[1];if(!a.has(V))i.push(V),a.add(V)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))v();u++}return i.join(", ")}function Xs(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function rc(e,n=X(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(X(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Js(e,n){let r=`{ ${rc(e,n)} }`;return X(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import sn from"fs";import Ve 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 ri=new Map;function Or(e,n=!0){let r=ri.get(e);if(n&&r)return r;let i=new Map,a=[Ve.join(e,"src"),Ve.join(e,"dist"),e];function l(u,f){if(f>6)return;let v;try{v=sn.readdirSync(u,{withFileTypes:!0})}catch{return}for(let S of v){let I=Ve.join(u,S.name);if(S.isDirectory()){if(S.name==="node_modules"||S.name.startsWith("."))continue;l(I,f+1)}else if(S.isFile()&&S.name.endsWith(".stx")){let j=S.name.slice(0,-4);if(!i.has(j))i.set(j,I);let L=j.toLowerCase();if(!i.has(L))i.set(L,I);let M=J(j);if(!i.has(M))i.set(M,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)ri.set(e,i);return i}function Ys(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=Ve.join(r,"node_modules",e);try{if(sn.statSync(i).isDirectory())return i}catch{}let a=Ve.dirname(r);if(a===r)return null;r=a}}function Zs(e,n,r={}){return[Ve.resolve(Ve.dirname(n),`${e}.stx`),Ve.resolve(Ve.dirname(n),e),Ve.resolve(r.componentsDir||"components",`${e}.stx`),Ve.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ii(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=J(n);return[n,r,i]}function $i(e,n){let[r,i,a]=ii(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function Ri(e,n){let r=n?Ve.resolve(n):void 0,i=Ve.dirname(Ve.resolve(e));for(;;){if(sn.existsSync(Ve.join(i,"package.json")))return r&&i===r?void 0:i;let a=Ve.dirname(i);if(a===i)return;i=a}}var ic=["src/ui","src/components","components","dist"];function rs(e,n){let r=Ve.resolve(e);if(!n&&!r.split(Ve.sep).includes("node_modules"))return[];let i=Ri(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(sn.readFileSync(Ve.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:ic;return[Ve.dirname(Ve.resolve(e)),...l.map((u)=>Ve.resolve(i,u))]}function*Ai(e,n,r={},i){let a=ii(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ve.resolve(Ve.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],u=r.projectRoot||process.cwd(),f=[...rs(n,r.projectRoot),...i?.__originalFilePath?[Ve.join(Ve.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],Ve.join(Ve.dirname(n),"components"),Ve.resolve(u,"src/components"),Ve.resolve(u,"components"),...import.meta.dir?[Ve.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(f)){for(let S of l)yield Ve.join(v,S);try{for(let S of sn.readdirSync(v,{withFileTypes:!0}))if(S.isDirectory())for(let I of l)yield Ve.join(v,S.name,I)}catch{}}}function oi(e,n,r={},i){let a=$i(e,i);if(a!==void 0)return a;for(let l of Ai(e,n,r,i))try{if(sn.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Qs(e,n=[],r={}){let i=new Set([...e].map((S)=>S.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([S,I])=>[S.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),v=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((S)=>i.has(S)))return!1;if([...n].some((S)=>!["load","error"].includes(S.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((S)=>i.has(S))}import Is from"fs";import xe from"path";import Bt from"path";import _n from"fs";var oc=new Set(["touchstart","touchmove","wheel","mousewheel"]);function Us(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return oc.has(e.toLowerCase())}var ai=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"]),ci={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"},ac=new Set(["ctrl","alt","shift","meta"]),pi={left:0,middle:1,right:2};function li(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let r of e){let i=r.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(ac.has(i))n.systemKeys.push(i);else if(i in pi)n.mouse=i;else if(i in ci||/^[a-z]$/.test(i))n.keys.push(ci[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function fi(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,v]=l,S=l.index,I=S+u.length,j=`__stx_evt_${n}${i++}`,L=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,V;while((V=M.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ai.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:li(G.slice(1)),elementId:j})}let W=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((V=W.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ai.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:li(G.slice(1)),elementId:j})}if(L.length>0)r.push({originalTag:u,elementId:j,events:L,startIndex:S,endIndex:I})}return r}function cc(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=pi[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function lc(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Hs(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function uc(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=cc(e),a=lc(Hs(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(Us(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
|
|
2
|
+
import{Ze,Dn,po,Gi,z}from"./chunk-esm0pnpz.js";import{Mn}from"./chunk-vaxxe2db.js";import{Yr,C,Fl,xt,na,zl}from"./chunk-hdfhaddy.js";import{D}from"./chunk-7b3dqeyr.js";import{T,R}from"./chunk-0jdz31q1.js";import{Jr,wo,zn,Ll,Le}from"./chunk-5g5khx0m.js";import{fo,d,m,Hr,p,te,K,be,_,bt,yo,De,et,bo}from"./chunk-945zygwa.js";import{w}from"./chunk-v6gkjg5f.js";import{ne}from"./chunk-qykbjg3z.js";import{t,h}from"./chunk-68r2zs20.js";import{c}from"./chunk-p92272k0.js";import Ct from"path";import un from"process";import{AsyncLocalStorage as sc}from"async_hooks";var ti=new sc;function An(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ni(e,n){return ti.run(An(e),n)}async function si(e,n){let r=ti.getStore();if(!r)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 i=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(v,S)=>{if(S===void 0||typeof S==="function"||typeof S==="symbol"||typeof S==="bigint"||typeof S==="number"&&!Number.isFinite(S))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(S&&typeof S==="object"&&!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype&&Object.getPrototypeOf(S)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return S}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function Fr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function X(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,v=()=>{if(l!==0)return;let S=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(S){if(n&&S[1]==="const")return;let V=S[2];if(!a.has(V))i.push(V),a.add(V);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((V)=>{let W=V.trim();if(!W)return;let Z=W.indexOf(":"),G=(Z>=0?W.slice(Z+1).trim():W).split(/[\s=]/)[0];if(G&&!a.has(G))i.push(G),a.add(G)});return}let j=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(n&&r.slice(u).startsWith("const"))return;j[1].split(",").forEach((V)=>{let W=V.trim().replace(/^\.\.\./,"");if(!W)return;let Z=W.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(n)return;let L=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!a.has(V))i.push(V),a.add(V);return}let M=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let V=M[1];if(!a.has(V))i.push(V),a.add(V)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))v();u++}return i.join(", ")}function Xs(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function rc(e,n=X(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(X(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Js(e,n){let r=`{ ${rc(e,n)} }`;return X(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import sn from"fs";import Ve 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 ri=new Map;function Or(e,n=!0){let r=ri.get(e);if(n&&r)return r;let i=new Map,a=[Ve.join(e,"src"),Ve.join(e,"dist"),e];function l(u,f){if(f>6)return;let v;try{v=sn.readdirSync(u,{withFileTypes:!0})}catch{return}for(let S of v){let I=Ve.join(u,S.name);if(S.isDirectory()){if(S.name==="node_modules"||S.name.startsWith("."))continue;l(I,f+1)}else if(S.isFile()&&S.name.endsWith(".stx")){let j=S.name.slice(0,-4);if(!i.has(j))i.set(j,I);let L=j.toLowerCase();if(!i.has(L))i.set(L,I);let M=J(j);if(!i.has(M))i.set(M,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)ri.set(e,i);return i}function Ys(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=Ve.join(r,"node_modules",e);try{if(sn.statSync(i).isDirectory())return i}catch{}let a=Ve.dirname(r);if(a===r)return null;r=a}}function Zs(e,n,r={}){return[Ve.resolve(Ve.dirname(n),`${e}.stx`),Ve.resolve(Ve.dirname(n),e),Ve.resolve(r.componentsDir||"components",`${e}.stx`),Ve.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ii(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=J(n);return[n,r,i]}function $i(e,n){let[r,i,a]=ii(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function Ri(e,n){let r=n?Ve.resolve(n):void 0,i=Ve.dirname(Ve.resolve(e));for(;;){if(sn.existsSync(Ve.join(i,"package.json")))return r&&i===r?void 0:i;let a=Ve.dirname(i);if(a===i)return;i=a}}var ic=["src/ui","src/components","components","dist"];function rs(e,n){let r=Ve.resolve(e);if(!n&&!r.split(Ve.sep).includes("node_modules"))return[];let i=Ri(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(sn.readFileSync(Ve.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:ic;return[Ve.dirname(Ve.resolve(e)),...l.map((u)=>Ve.resolve(i,u))]}function*Ai(e,n,r={},i){let a=ii(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ve.resolve(Ve.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],u=r.projectRoot||process.cwd(),f=[...rs(n,r.projectRoot),...i?.__originalFilePath?[Ve.join(Ve.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],Ve.join(Ve.dirname(n),"components"),Ve.resolve(u,"src/components"),Ve.resolve(u,"components"),...import.meta.dir?[Ve.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(f)){for(let S of l)yield Ve.join(v,S);try{for(let S of sn.readdirSync(v,{withFileTypes:!0}))if(S.isDirectory())for(let I of l)yield Ve.join(v,S.name,I)}catch{}}}function oi(e,n,r={},i){let a=$i(e,i);if(a!==void 0)return a;for(let l of Ai(e,n,r,i))try{if(sn.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Qs(e,n=[],r={}){let i=new Set([...e].map((S)=>S.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([S,I])=>[S.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),v=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((S)=>i.has(S)))return!1;if([...n].some((S)=>!["load","error"].includes(S.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((S)=>i.has(S))}import Is from"fs";import xe from"path";import Bt from"path";import _n from"fs";var oc=new Set(["touchstart","touchmove","wheel","mousewheel"]);function Us(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return oc.has(e.toLowerCase())}var ai=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"]),ci={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"},ac=new Set(["ctrl","alt","shift","meta"]),pi={left:0,middle:1,right:2};function li(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let r of e){let i=r.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(ac.has(i))n.systemKeys.push(i);else if(i in pi)n.mouse=i;else if(i in ci||/^[a-z]$/.test(i))n.keys.push(ci[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function fi(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,v]=l,S=l.index,I=S+u.length,j=`__stx_evt_${n}${i++}`,L=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,V;while((V=M.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ai.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:li(G.slice(1)),elementId:j})}let W=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((V=W.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ai.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:li(G.slice(1)),elementId:j})}if(L.length>0)r.push({originalTag:u,elementId:j,events:L,startIndex:S,endIndex:I})}return r}function cc(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=pi[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function lc(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Hs(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function uc(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=cc(e),a=lc(Hs(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(Us(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=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('${r}');
|
|
5
5
|
if (!$el) return;
|
|
@@ -112,7 +112,7 @@ else {
|
|
|
112
112
|
`)}
|
|
113
113
|
})();
|
|
114
114
|
</script>`}function pc(e,n=""){let r=fi(e,n);if(r.length===0)return{template:e,bindings:[]};let i=e,a=[];for(let l=r.length-1;l>=0;l--){let u=r[l],f=u.originalTag;if(!f.includes(" id="))f=f.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${u.elementId}"`);else{let v=f.match(/id=["']([^"']+)["']/);if(v)for(let S of u.events)S.elementId=v[1]}for(let v of u.events){let S=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),I=new RegExp(`\\s*${S}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${S}\\s*=\\s*'[^']*'`,"g");f=f.replace(I,""),f=f.replace(j,"")}i=i.slice(0,u.startIndex)+f+i.slice(u.endIndex),a.push(...u.events)}return{template:i,bindings:a}}function ui(e){let n=e.$uid;return typeof n==="string"&&n?`${n}_`:""}function nl(e,n,r){if(zl(e))return e;if(n.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:f,bindings:v}=pc(e,ui(n)),S=n.__stx_event_bindings||[];return n.__stx_event_bindings=[...S,...v],f}let i=fi(e,ui(n));if(i.length===0)return e;let a=e;for(let f=i.length-1;f>=0;f--){let v=i[f],S=v.originalTag;if(!S.includes(" id="))S=S.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let I=S.match(/id=["']([^"']+)["']/);if(I)for(let j of v.events)j.elementId=I[1]}for(let I of v.events){let j=I.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),L=new RegExp(`\\s*${j}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${j}\\s*=\\s*'[^']*'`,"g");S=S.replace(L,""),S=S.replace(M,"")}a=a.slice(0,v.startIndex)+S+a.slice(v.endIndex)}let l=Pi(i.flatMap((f)=>f.events)),u=c(a);if(u!==-1)a=a.slice(0,u)+l+`
|
|
115
|
-
`+a.slice(u);else a+=l;return a}function di(e,n){let r=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))r.add(a)}return r}function Vt(e,n){let r=t(e),{depths:i,balanced:a}=h(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let v=(f.index??0)+f[0].length-f[1].length;if(l(v))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&di(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&di(f[1],!1).has(n))return!0;return!1}var Ue="0.2.
|
|
115
|
+
`+a.slice(u);else a+=l;return a}function di(e,n){let r=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))r.add(a)}return r}function Vt(e,n){let r=t(e),{depths:i,balanced:a}=h(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let v=(f.index??0)+f[0].length-f[1].length;if(l(v))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&di(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&di(f[1],!1).has(n))return!0;return!1}var Ue="0.2.902";var gi=Symbol.for(`stx.lazy-module-promises.${Ue}`);function dc(){let e=globalThis;return e[gi]??=new Map,e[gi]}function o(e,n){let r=dc(),i=`${import.meta.url}\x00${e}`,a=r.get(i);if(a)return a;let l=n();return r.set(i,l),l.catch(()=>{if(r.get(i)===l)r.delete(i)}),l}var gc=/<\/(script)/gi;function me(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(gc,"<\\/$1")}import mi from"fs";var hi=[];function k(e){let n=new T(e);return hi.push(n),n}function rl(){for(let e of hi)e.clear()}function E(e,...n){return`${n.map((r)=>String(r??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function Nr(e){let n=[];for(let r of new Set(e))try{n.push({path:r,mtimeMs:mi.statSync(r).mtimeMs})}catch{}return n}function eo(e){for(let n of e)try{if(mi.statSync(n.path).mtimeMs!==n.mtimeMs)return!1}catch{return!1}return!0}var Ie=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var mc=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function hc(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let r=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!r)return null;return{pkg:r[1],subpath:r[2]||""}}let n=e.match(/^([^/]+)(\/.*)?$/);if(!n)return null;return{pkg:n[1],subpath:n[2]||""}}function xc(e,n){let r=n;while(!0){let i=Bt.join(r,"node_modules",e,"package.json");if(_n.existsSync(i))return Bt.dirname(i);let a=Bt.dirname(r);if(a===r)return null;r=a}}function bc(e,n){if(!e||typeof e!=="object")return null;let r=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return r(a.import);if(typeof a.default==="object")return r(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,n))return r(e[n]);let i=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let u=a.slice(0,l),f=a.slice(l+1);if(!n.startsWith(u)||!n.endsWith(f))continue;if(n.length<u.length+f.length)continue;if(!i||u.length>i.prefix.length)i={pattern:a,prefix:u,suffix:f}}if(i){let a=n.slice(i.prefix.length,n.length-i.suffix.length),l=r(e[i.pattern]);if(l)return l.replace("*",a)}return null}function yc(e,n){let r=hc(e);if(!r||!r.subpath)return null;let i=xc(r.pkg,n);if(!i)return null;let a;try{a=JSON.parse(_n.readFileSync(Bt.join(i,"package.json"),"utf8"))}catch{return null}let l=`.${r.subpath}`,u=bc(a.exports,l);if(!u)return null;let f=Bt.resolve(i,u);return _n.existsSync(f)?f:null}function zi(e,n){let r=n.filePath?Bt.dirname(n.filePath):n.projectRoot||process.cwd(),i=n.projectRoot||process.cwd(),a=new Set,l=[],u=[];return{code:e.replace(mc,(v,S)=>{let I;try{if(S.startsWith("./")||S.startsWith("../")||S.startsWith("/")){if(I=S.startsWith("/")?S:Bt.resolve(r,S),!_n.existsSync(I))throw Error(`file not found: ${I}`)}else{let j=null;try{j=Bun.resolveSync(S,i)}catch{j=yc(S,i)}if(!j)throw Error(`could not resolve ${S} (Bun.resolveSync + exports fallback both failed)`);I=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(S)} (from ${n.filePath||"<unknown>"}): ${j?.message||j}`),u.push(S),""}if(a.has(I))return"";a.add(I);try{let j=_n.readFileSync(I,"utf8");l.push({source:S,resolvedPath:I,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${I}: ${j?.message||j}`),u.push(S)}return""}),styles:l,unresolved:u}}function _c(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Hi(e){if(e.length===0)return"";return`${e.map((n)=>`<style data-stx-vendor="${_c(n.source)}" data-stx-layer="vendor">
|
|
116
116
|
@layer vendor {
|
|
117
117
|
${n.contents}
|
|
118
118
|
}
|
|
@@ -182,7 +182,7 @@ else {
|
|
|
182
182
|
// STX: auto-generated event bindings
|
|
183
183
|
${e.map((r,i)=>Ic(r,i)).join(`
|
|
184
184
|
`)}`}function _i(e){let n=[],r=new Set,i=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=i.length,u=0;while(u<l){let f=i[u];if(f==="'"||f==='"'||f==="`"){let v=f;if(u++,v==="`"){let S=0;while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]==="`"&&S===0){u++;break}if(i[u]==="$"&&i[u+1]==="{"){S++,u+=2;continue}if(i[u]==="}"&&S>0){S--,u++;continue}u++}}else while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]===v){u++;break}u++}continue}if(f==="/"&&i[u+1]==="/"){while(u<l&&i[u]!==`
|
|
185
|
-
`)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let v=i.slice(u),S=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(S){let L=S[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=S[0].length;continue}let I=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((L)=>{let M=L.trim(),V=M.indexOf(":"),W=V>=0?M.slice(V+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(W&&!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W)}),u+=I[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let L=j[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=j[0].length;continue}}u++}return n}var jc=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 Pc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let M;while((M=r.exec(L))!==null){let V=M[0];if(!jc.has(V))n.add(V)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let S=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=S.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)i(l[1]);return n}async function Ge(e,n={}){let r=e,i="",a=!1,l=[],u=zi(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=Hi(u.styles),v=Xt(r);r=v.code,l=[...v.imports,...v.models];let{hasUserImports:S,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
185
|
+
`)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let v=i.slice(u),S=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(S){let L=S[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=S[0].length;continue}let I=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((L)=>{let M=L.trim(),V=M.indexOf(":"),W=V>=0?M.slice(V+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(W&&!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W)}),u+=I[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let L=j[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=j[0].length;continue}}u++}return n}var jc=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 Pc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let M;while((M=r.exec(L))!==null){let V=M[0];if(!jc.has(V))n.add(V)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let S=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=S.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)i(l[1]);return n}async function Ge(e,n={}){let r=e,i="",a=!1,l=[],u=zi(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=Hi(u.styles),v=Xt(r);r=v.code,l=[...v.imports,...v.models];let{hasUserImports:S,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-nxat557m.js"));if(S(r))r=await I(r,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let U=xl(r);r=U.code,i=Sl(U.stxImports,U.browserImports.filter((H)=>!l.includes(H)))}if(i=`${Pn(r,n.serverData)}${i}`,r=D(r),!a&&Xe(n.attrs||""))r=Je(r);let j=Oc(n.eventBindings||[]),L=(n.attrs||"").trim(),M=/\btype\s*=\s*["']module["']/i.test(L),V=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(M){let U=L.replace(/\btype\s*=\s*["']module["']/i,"").trim(),H=`type="module" data-stx-scoped${V}${U?` ${U}`:""}`;return`${f}<script ${H}>
|
|
186
186
|
${me(`${i}${r}
|
|
187
187
|
${j}`)}
|
|
188
188
|
</script>`}let W=na(e),Z=/function __stx_setup_/.test(r),q=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function G(U){let H=U.length>0?`
|
|
@@ -1183,8 +1183,8 @@ ${S.join(`
|
|
|
1183
1183
|
`){let V=e[a];if(V==="\\"){a+=2;continue}if(V==="[")M=!0;else if(V==="]")M=!1;else if(V==="/"&&!M){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},L=()=>{if(i!==0)return;let M=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(M){let q=M[2].split(",").map((G)=>{let U=G.trim().split(":");return U[U.length-1].trim()});for(let G of q)if(G&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(G)&&!r.has(G))n.push(G),r.add(G);return}let V=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(V){let q=V[2];if(!r.has(q))n.push(q),r.add(q);return}let W=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(W){let q=W[1];if(!r.has(q))n.push(q),r.add(q);return}let Z=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Z){let q=Z[1];if(!r.has(q))n.push(q),r.add(q)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){u(e[a]);continue}if(e[a]==="`"){f();continue}if(e[a]==="/"&&I()){j();continue}if(e[a]==="{"){i++,a++;continue}if(e[a]==="}"){i--,a++;continue}if(i===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))L();a++}return n}function jp(e,n,r){for(let i of ee(e)){let a=O(i.attrs);if(["server","src","component","stx:component"].some((f)=>a.has(f))||!$t(a))continue;let l=an(e.slice(i.bodyStart,i.bodyEnd));if(!l)continue;let u=Object.assign(Object.create(null),r);for(let[f,v]of Object.entries(l.defaults))if(u[f]===void 0)u[f]=ws(v);for(let f of new Set([...l.propNames,...Object.keys(l.defaults)])){let v=l.localBindings[f]??(l.propBindings[f]?void 0:f);if(v)Object.defineProperty(n,v,{value:u[f],writable:!0,enumerable:!0,configurable:!0})}if(l.identifier)Object.defineProperty(n,l.identifier,{value:u,writable:!0,enumerable:!0,configurable:!0})}}var Pp=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function Wg(e,n){let r=Ut(e),i=e.slice(r).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/);if(!i)return null;let a=i[1].toLowerCase();if(!Pp.has(a))return null;let l=new RegExp(`<\\/?${a}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),u=x(e,(I,j)=>(l.lastIndex=j,l.exec(I)?.index===j?l.lastIndex:-1));if(a==="span"&&/\sdata-stx-scope\s*=/.test(u[0]?.token||""))return null;let f=0,v=!1;for(let I of u){if(f+=I.token.startsWith("</")?-1:1,f<0)return null;if(f===0){if(e.slice(I.end).trim())return null;v=!0;break}}if(!v)return null;let S=r+i[0].length;return e.slice(0,S)+n+e.slice(S)}function Wa(e,n){if(!e)return!1;return[...n.additionalComponentsDirs??[],...n.fallbackComponentsDir?[n.fallbackComponentsDir]:[]].some((i)=>{let a=xe.relative(xe.resolve(i),xe.resolve(e));return!a.startsWith("..")&&!xe.isAbsolute(a)})}async function zr(e,n,r,i,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,u=(ce)=>ce.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),f=r.__importedComponents;if(f){for(let ce of[l,l.toLowerCase(),u(l),J(l)])if(f.has(ce))return!0}let v=[...new Set([`${l}.stx`,`${u(l)}.stx`,`${J(l)}.stx`])],S=typeof a.root==="string"?xe.resolve(a.root):void 0,I=S??xe.dirname(i),j=[],L=(ce)=>{if(ce&&!j.includes(ce))j.push(ce)};for(let ce of rs(i,S))L(ce);let M=r.__originalFilePath;if(M)L(xe.join(xe.dirname(M),"components"));if(Wa(n,a))L(a._rootComponentsDir);L(n),L(a._rootComponentsDir),L(xe.join(xe.dirname(i),"components")),L(a.componentsDir);for(let ce of a.additionalComponentsDirs??[])L(ce);let V=a._targetComponentFallbackNames?.some((ce)=>ce.toLowerCase()===l.toLowerCase());if(!V)for(let ce of a._targetComponentDirs??[])L(ce);if(S)L(xe.resolve(S,"resources/views/components")),L(xe.resolve(S,"resources/components")),L(xe.resolve(S,"src/components")),L(xe.resolve(S,"components"));for(let ce of a._layerComponentDirs??[])L(ce);let W=a._pluginComponentDirs;if(Array.isArray(W))for(let ce of W)L(typeof ce==="string"?ce:null);if(L(a.fallbackComponentsDir),V)for(let ce of a._targetComponentDirs??[])L(ce);let Z=a._nativePrimitivesFallback;if(Z&&!Z.except.some((ce)=>ce.toLowerCase()===l.toLowerCase()))L(Z.dir);if(l.startsWith("./")||l.startsWith("../"))return s(xe.resolve(xe.dirname(i),`${l}.stx`));let q=ja(xe.resolve(import.meta.dir,"components")),G=j.map((ce)=>xe.isAbsolute(ce)?ce:xe.resolve(I,ce)),U=`${v.join("\x00")}\x00\x00${G.join("\x00")}`,H=Ar.get(U);if(H!==void 0)return H;let re=!1;e:for(let ce of G){if(ja(ce)===q)continue;for(let le of v)if(await s(xe.join(ce,le))){re=!0;break e}}return Ar.set(U,re),re}function ja(e){let n=Ir.get(e);if(n!==void 0)return n;let r=e;try{r=Is.realpathSync(e)}catch{}return Ir.set(e,r),r}function qg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function kl(e){if(!e)return!1;let n=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(n)}function Mp(e,n,r){if(!e.includes("{{")&&!e.includes("{!!"))return e;let i=(a,l)=>{let u;try{u=N(a,n)}catch{return l}if(u===void 0||u===null)return"";let f=String(u);if(/<\/style/i.test(f))return console.warn(`[stx] a <style> expression in ${r??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return f};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>i(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>i(l,a))}var Pa=new Set;function Ma(e,n,r,i){let a=`${e}\x00${n}\x00${i??""}`;if(!process.env.STX_DEBUG&&Pa.has(a))return;Pa.add(a);let l=n?` used in ${n}`:"",u=i?` Cause: ${i}.`:"",f=r.length>0?`
|
|
1184
1184
|
searched:
|
|
1185
1185
|
${r.map((v)=>` - ${v}`).join(`
|
|
1186
|
-
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function Da(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Dp=new Set(["for","if","show","key","ref","class","className","style"]),Na=new Set,Fa="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",_l=new RegExp(`\\b(?:${Fa})\\s*(?:<[^>]*>)?\\s*\\(`);function Vi(e){let n=new Set,r=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Fa})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Ye(e,n,r,i,a,l,u,f=new Set,v,S=mt(a),I,j=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-8kvqv885.js")),M=f??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let V=new Set(M);V.add(e);let W=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let Z=W&&W!=="load"&&qg(W)?W:"";try{let q=(pe)=>pe.split("-").map((ve)=>ve.charAt(0).toUpperCase()+ve.slice(1)).join(""),G=j.endsWith(".stx")?j.slice(0,-4):j,U=null,H=a.__importedComponents;if(H){let pe=[G,G.toLowerCase(),q(G),J(G)];for(let ve of pe)if(H.has(ve)){U=H.get(ve);break}}let re=[];if(!U){let pe=[`${G}.stx`,`${q(G)}.stx`,`${J(G)}.stx`],ve=[...new Set(pe)],Me=a.__originalFilePath,$e=[];for(let Te of rs(l))if(!$e.includes(Te))$e.push(Te);let lt=$e.length;for(let Te of u._layerComponentDirs??[])if(!$e.includes(Te))$e.push(Te);if(Me){let Te=xe.join(xe.dirname(Me),"components");$e.push(Te)}let Qe=u._rootComponentsDir;if(typeof Qe==="string"&&Wa(i,u)&&!$e.includes(Qe))$e.push(Qe);if(i&&!$e.includes(i))$e.push(i);if(typeof Qe==="string"&&!$e.includes(Qe))$e.push(Qe);let Ot=xe.join(xe.dirname(l),"components");if(!$e.includes(Ot))$e.push(Ot);if(u.componentsDir&&u.componentsDir!==i&&!$e.includes(u.componentsDir))$e.push(u.componentsDir);for(let Te of u.additionalComponentsDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let Yt=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(G),Dt=(I?.events??[]).map((Te)=>Te.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Zn=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Ns=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),Ls=!Dt.includes("valuechange")&&(Zn||Dt.includes("change")&&!Ns),Lt=u._nativeHostAttrs&&/^textinput$/i.test(G),Qt=Dt.includes("update:value")&&!Dt.includes("input"),yn=u._nativeHostAttrs&&/^video$/i.test(G),zs=u._nativeHostAttrs&&/^image$/i.test(G),Jn=Qs([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),en=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),Xn=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),Gn=yn&&(en||Xn)&&(I?.events??[]).every((Te)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(Te.replace(/^@/,"").split(".")[0])),Yn=new Set(["","primary","secondary","outline","ghost","danger"]),Qn=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",es=u._nativeHostAttrs&&/^button$/i.test(G)&&!Yn.has(Qn),Zr=u._targetComponentFallbackNames?.some((Te)=>Te.toLowerCase()===G.toLowerCase())??!1,Bs=Zr&&(!Yt||Ls)&&(!Lt||Qt)&&(!yn||Gn)&&(!zs||Jn)&&!es;for(let Te of Bs?[]:u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let tn=typeof u.root==="string"?xe.resolve(u.root):void 0,Xr=tn??xe.dirname(l),nn=[];if(tn)nn.push(xe.resolve(tn,"resources/views/components")),nn.push(xe.resolve(tn,"resources/components")),nn.push(xe.resolve(tn,"src/components")),nn.push(xe.resolve(tn,"components"));nn.push(xe.resolve(import.meta.dir,"components"));for(let Te of nn)if(!$e.includes(Te))$e.push(Te);if(Zr){let Te=(u._componentPackageDirs??[]).filter((gt)=>typeof gt==="string"&>.length>0),jt=(Bs?Te.length?Te:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((gt)=>typeof gt==="string"&>.length>0);if(jt.length){let gt=$e.slice(lt).map((ut)=>xe.isAbsolute(ut)?ut:xe.resolve(Xr,ut)).filter((ut)=>!jt.includes(ut)),ns=`${G}\x00${gt.join("\x00")}`,kt=Tr.get(ns);if(kt===void 0){kt=!1;for(let ut of gt){for(let zt of ve)if(await s(xe.join(ut,zt))){kt=!0;break}if(kt)break}Tr.set(ns,kt)}if(!kt){for(let ut of jt){let zt=$e.indexOf(ut);if(zt>=0)$e.splice(zt,1)}$e.splice(lt,0,...jt)}}}let Gr=u._pluginComponentDirs;if(Array.isArray(Gr)){for(let Te of Gr)if(typeof Te==="string"&&!$e.includes(Te))$e.push(Te)}if(u.fallbackComponentsDir&&!$e.includes(u.fallbackComponentsDir))$e.push(u.fallbackComponentsDir);if(Bs){for(let Te of u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te)}let ts=u._nativePrimitivesFallback;if(ts&&!ts.except.some((Te)=>Te.toLowerCase()===G.toLowerCase())&&!$e.includes(ts.dir))$e.push(ts.dir);let Qr=[...new Set($e.map((Te)=>{if(!Te)return Te;return xe.isAbsolute(Te)?Te:xe.resolve(Xr,Te)}))];$e.length=0,$e.push(...Qr);let Ws=`${G}\x00${l}\x00${Qr.join("\x00")}`,Fs=Ts.get(Ws);if(Fs)if(await s(Fs))U=Fs;else Ts.delete(Ws);if(!U&&(G.startsWith("./")||G.startsWith("../")))U=xe.resolve(xe.dirname(l),`${G}.stx`),re.push(U);else if(!U)for(let Te of $e){if(!Te)continue;for(let jt of ve){let gt=xe.join(Te,jt);if(re.push(gt),await s(gt)){U=gt;break}}if(U)break;if(!U)try{let jt=await import("fs");if(!jt.statSync(Te,{throwIfNoEntry:!1})?.isDirectory())continue;let ns=8,kt=[{path:Te,depth:0}];while(kt.length>0&&!U){let ut=kt.pop();if(ut.depth>=ns)continue;let zt;try{zt=jt.readdirSync(ut.path,{withFileTypes:!0})}catch{continue}for(let ss of zt){if(!ss.isDirectory())continue;if(ss.name==="node_modules"||ss.name.startsWith("."))continue;let ei=xe.join(ut.path,ss.name);for(let nc of ve){let Vs=xe.join(ei,nc);if(re.push(Vs),await s(Vs)){U=Vs;break}}if(U)break;kt.push({path:ei,depth:ut.depth+1})}}}catch{}if(U)break}if(U)Ts.set(Ws,U)}if(!U||!await s(U))return Ma(e,l,re),Da(e);v.add(U);let ce;if(Fn.has(U)&&Rr.get(U)===Aa(U))ce=Fn.get(U);else try{let pe=Aa(U);ce=await Bun.file(U).text(),Fn.set(U,ce),Rr.set(U,pe)}catch(pe){let ve=pe instanceof Error?pe.message:String(pe);return Ma(e,l,[U],ve),Da(e)}if(I)for(let pe of new Set([...Object.keys(n),...I.reactiveProps??[]])){let ve=pe.toLowerCase();if(ve.startsWith("aria-")||ve.startsWith("data-"))continue;let Me=pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${Me}\\b`).test(ce))I.declaredProps.add(pe);if(new RegExp(`\\$props\\s*(?:\\.\\s*${Me}\\b|\\[\\s*['"]${Me}['"]\\s*\\])`).test(ce)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${Me}['"]`).test(ce))I.consumedProps?.add(pe)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ce))for(let pe of I.reactiveProps){if(Dp.has(pe)||I.consumedProps?.has(pe))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ce))continue;let ve=`${U}\x00${pe}`;if(Na.has(ve))continue;Na.add(ve),console.warn(`[stx] ${xe.basename(U)} reads \`${pe}\` with defineProps(), which is not live, but ${xe.basename(l)} binds it (:${pe}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${pe}').`)}let le=new Set(["__originalFilePath","__importedComponents",ls,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),de={};for(let[pe,ve]of Object.entries(a))if(!pe.startsWith("__")||le.has(pe))de[pe]=ve;let Ee=S.length>0?{[ms]:[...S]}:{},Re=r;if(r.includes("@include")){let{processIncludes:pe}=await o("stx/includes",()=>import("./chunk-a7x8897c.js"));Re=await pe(r,a,l,u,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Re)){let{processComponents:pe}=await o("stx/component-renderer",()=>import("./chunk-6cnahhm1.js")),ve={...a,__processedComponents:M,...Ee};Re=await pe(Re,ve,l,u,v);let Me=ve.__stx_preserved_client_expressions;if(Array.isArray(Me)&&Me.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Me])]}let we=[];if(kl(Re)){let{processExpressions:pe}=await o("stx/expressions",()=>import("./chunk-52njxk3w.js")),ve=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Ee}:S.length>0?{...a,...Ee}:a;Re=pe(Re,ve,l);for(let Me of Re.matchAll(/\{\{([\s\S]*?)\}\}/g))we.push(Me[1].trim())}let ge=se(Re),ze=[],Fe=ge.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(pe,ve)=>{let Me=ge.scripts[Number(ve)]||"",$e=Me.match(/^<script\b([^>]*)>/i)?.[1]||"",lt=$e.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Qe=!lt||["module","text/javascript","application/javascript"].includes(lt),Ot=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${$e}`);if(!/\bserver\b/i.test($e)&&Qe&&!Ot)return ze.push(Me),"";return Me}),{extractSlotContent:it}=await o("stx/slots",()=>import("./chunk-9mjr6187.js")),rt=it(Fe),wt={};if(rt.defaultSlot?.trim())wt.default=rt.defaultSlot;for(let[pe,ve]of rt.namedSlots)wt[pe]=ve.content;let ft=a.__stx_scope_seq??={n:0,key:lo(String(a.__filename??l))},ot=Ba(e,process.cwd()),je=`stx_${(ot.endsWith(".stx")?ot.slice(0,-4):ot).replace(/[^a-zA-Z0-9]/g,"_")}_${++ft.n}_${ft.key}`,Ae={...de,$uid:je,$native:u._nativeHostAttrs===!0,...n,props:n,slot:Fe,$slots:wt,__processedComponents:V,__sections:{},__stx_signals_gate:Ne(ce)||kl(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...we]};if(/import\s/.test(ce)){Ae.__importedComponents=new Map(Ae.__importedComponents);let{processESImports:pe}=await o("stx/component-renderer",()=>import("./chunk-6cnahhm1.js"));ce=await pe(ce,Ae,U,u,v)}jp(ce,Ae,n);let dt=ce,nt=B(dt);if(nt)dt=nt.content.trim();let pn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Pt=[...ce.matchAll(pn)];for(let[,pe,ve]of Pt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(pe))We(ve,U,u.strict);let vt=[],fn=null,js=Pt.some((pe)=>/\bserver\b/.test(pe[1]||"")&&/\bcache\b/.test(pe[1]||"")),Jt=null,Rt=null,dn=null,Un=0,gn=null;if(Rp(u),js&&Pr>0){let pe=Tp({props:n,slot:Re,slotContext:r.trim()?Ap(de):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...S].sort(),layers:u._layerGraph?.layers.map((ve)=>ve.configFile),uid:je});if(pe!==null){Jt=`${U}\x00${E(ce)}\x00${pe}`;let ve=As.get(Jt);if(ve){for(let Me of ve.dependencies)v.add(Me);if(Ki(a,ve.clientFactories),ft.n+=ve.uidsConsumed,ve.preservedClientExpressions.length>0){let Me=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let $e of ve.preservedClientExpressions)Me.add($e);a.__stx_preserved_client_expressions=[...Me]}return ve.output}Rt=new Set(v),dn=Ci(a),Un=ft.n,gn=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let mn=new Set;for(let pe of Pt){let ve=pe[1]||"",Me=pe[2]||"",$e=ve.includes("server");if(Xe(ve)&&Me.trim())Me=Je(Me);if($e&&Me){for(let Qe of ye(Me))mn.add(Qe);try{await L(Me,Ae,U,{onFailure:(Qe)=>{if(Qe.kind!=="unknown")fn=Qe.kind}})}catch(Qe){}}if(!$e){let Qe=Me.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),Ot=Qe.includes("{{")&&Qe.includes("}}"),Yt=Qe.includes("{!!")&&Qe.includes("!!}");if(Ot||Yt)Qe=Wi(Qe,Ae,U);let Dt=ve.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");vt.push(`<script${Dt}>${Qe}</script>`)}}let St=se(ce).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),hn=St?St[1]:"",Ps=St?St[2]:"",Tt="",ue=hn&&/\bscoped\b/i.test(hn);if(St)Tt=`<style${hn}>${Mp(Ps,Ae,U)}</style>`;let fe=dt;if(fe=fe.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),St)fe=fe.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let pe=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ve=[];if(fe=fe.replace(pe,(Me,$e)=>{let lt=$e.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(lt)ve.push(`<style${lt[1]}>${lt[2]}</style>`);return""}),fe=fe.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ve.length>0)Tt=`${Tt}${ve.join(`
|
|
1187
|
-
`)}`}if(r&&fe.includes("{{ text || slot }}"))fe=fe.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:Se}=await o("stx/slots",()=>import("./chunk-
|
|
1186
|
+
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function Da(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Dp=new Set(["for","if","show","key","ref","class","className","style"]),Na=new Set,Fa="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",_l=new RegExp(`\\b(?:${Fa})\\s*(?:<[^>]*>)?\\s*\\(`);function Vi(e){let n=new Set,r=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Fa})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Ye(e,n,r,i,a,l,u,f=new Set,v,S=mt(a),I,j=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-33h2z0s5.js")),M=f??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let V=new Set(M);V.add(e);let W=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let Z=W&&W!=="load"&&qg(W)?W:"";try{let q=(pe)=>pe.split("-").map((ve)=>ve.charAt(0).toUpperCase()+ve.slice(1)).join(""),G=j.endsWith(".stx")?j.slice(0,-4):j,U=null,H=a.__importedComponents;if(H){let pe=[G,G.toLowerCase(),q(G),J(G)];for(let ve of pe)if(H.has(ve)){U=H.get(ve);break}}let re=[];if(!U){let pe=[`${G}.stx`,`${q(G)}.stx`,`${J(G)}.stx`],ve=[...new Set(pe)],Me=a.__originalFilePath,$e=[];for(let Te of rs(l))if(!$e.includes(Te))$e.push(Te);let lt=$e.length;for(let Te of u._layerComponentDirs??[])if(!$e.includes(Te))$e.push(Te);if(Me){let Te=xe.join(xe.dirname(Me),"components");$e.push(Te)}let Qe=u._rootComponentsDir;if(typeof Qe==="string"&&Wa(i,u)&&!$e.includes(Qe))$e.push(Qe);if(i&&!$e.includes(i))$e.push(i);if(typeof Qe==="string"&&!$e.includes(Qe))$e.push(Qe);let Ot=xe.join(xe.dirname(l),"components");if(!$e.includes(Ot))$e.push(Ot);if(u.componentsDir&&u.componentsDir!==i&&!$e.includes(u.componentsDir))$e.push(u.componentsDir);for(let Te of u.additionalComponentsDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let Yt=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(G),Dt=(I?.events??[]).map((Te)=>Te.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Zn=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Ns=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),Ls=!Dt.includes("valuechange")&&(Zn||Dt.includes("change")&&!Ns),Lt=u._nativeHostAttrs&&/^textinput$/i.test(G),Qt=Dt.includes("update:value")&&!Dt.includes("input"),yn=u._nativeHostAttrs&&/^video$/i.test(G),zs=u._nativeHostAttrs&&/^image$/i.test(G),Jn=Qs([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),en=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),Xn=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),Gn=yn&&(en||Xn)&&(I?.events??[]).every((Te)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(Te.replace(/^@/,"").split(".")[0])),Yn=new Set(["","primary","secondary","outline","ghost","danger"]),Qn=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",es=u._nativeHostAttrs&&/^button$/i.test(G)&&!Yn.has(Qn),Zr=u._targetComponentFallbackNames?.some((Te)=>Te.toLowerCase()===G.toLowerCase())??!1,Bs=Zr&&(!Yt||Ls)&&(!Lt||Qt)&&(!yn||Gn)&&(!zs||Jn)&&!es;for(let Te of Bs?[]:u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let tn=typeof u.root==="string"?xe.resolve(u.root):void 0,Xr=tn??xe.dirname(l),nn=[];if(tn)nn.push(xe.resolve(tn,"resources/views/components")),nn.push(xe.resolve(tn,"resources/components")),nn.push(xe.resolve(tn,"src/components")),nn.push(xe.resolve(tn,"components"));nn.push(xe.resolve(import.meta.dir,"components"));for(let Te of nn)if(!$e.includes(Te))$e.push(Te);if(Zr){let Te=(u._componentPackageDirs??[]).filter((gt)=>typeof gt==="string"&>.length>0),jt=(Bs?Te.length?Te:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((gt)=>typeof gt==="string"&>.length>0);if(jt.length){let gt=$e.slice(lt).map((ut)=>xe.isAbsolute(ut)?ut:xe.resolve(Xr,ut)).filter((ut)=>!jt.includes(ut)),ns=`${G}\x00${gt.join("\x00")}`,kt=Tr.get(ns);if(kt===void 0){kt=!1;for(let ut of gt){for(let zt of ve)if(await s(xe.join(ut,zt))){kt=!0;break}if(kt)break}Tr.set(ns,kt)}if(!kt){for(let ut of jt){let zt=$e.indexOf(ut);if(zt>=0)$e.splice(zt,1)}$e.splice(lt,0,...jt)}}}let Gr=u._pluginComponentDirs;if(Array.isArray(Gr)){for(let Te of Gr)if(typeof Te==="string"&&!$e.includes(Te))$e.push(Te)}if(u.fallbackComponentsDir&&!$e.includes(u.fallbackComponentsDir))$e.push(u.fallbackComponentsDir);if(Bs){for(let Te of u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te)}let ts=u._nativePrimitivesFallback;if(ts&&!ts.except.some((Te)=>Te.toLowerCase()===G.toLowerCase())&&!$e.includes(ts.dir))$e.push(ts.dir);let Qr=[...new Set($e.map((Te)=>{if(!Te)return Te;return xe.isAbsolute(Te)?Te:xe.resolve(Xr,Te)}))];$e.length=0,$e.push(...Qr);let Ws=`${G}\x00${l}\x00${Qr.join("\x00")}`,Fs=Ts.get(Ws);if(Fs)if(await s(Fs))U=Fs;else Ts.delete(Ws);if(!U&&(G.startsWith("./")||G.startsWith("../")))U=xe.resolve(xe.dirname(l),`${G}.stx`),re.push(U);else if(!U)for(let Te of $e){if(!Te)continue;for(let jt of ve){let gt=xe.join(Te,jt);if(re.push(gt),await s(gt)){U=gt;break}}if(U)break;if(!U)try{let jt=await import("fs");if(!jt.statSync(Te,{throwIfNoEntry:!1})?.isDirectory())continue;let ns=8,kt=[{path:Te,depth:0}];while(kt.length>0&&!U){let ut=kt.pop();if(ut.depth>=ns)continue;let zt;try{zt=jt.readdirSync(ut.path,{withFileTypes:!0})}catch{continue}for(let ss of zt){if(!ss.isDirectory())continue;if(ss.name==="node_modules"||ss.name.startsWith("."))continue;let ei=xe.join(ut.path,ss.name);for(let nc of ve){let Vs=xe.join(ei,nc);if(re.push(Vs),await s(Vs)){U=Vs;break}}if(U)break;kt.push({path:ei,depth:ut.depth+1})}}}catch{}if(U)break}if(U)Ts.set(Ws,U)}if(!U||!await s(U))return Ma(e,l,re),Da(e);v.add(U);let ce;if(Fn.has(U)&&Rr.get(U)===Aa(U))ce=Fn.get(U);else try{let pe=Aa(U);ce=await Bun.file(U).text(),Fn.set(U,ce),Rr.set(U,pe)}catch(pe){let ve=pe instanceof Error?pe.message:String(pe);return Ma(e,l,[U],ve),Da(e)}if(I)for(let pe of new Set([...Object.keys(n),...I.reactiveProps??[]])){let ve=pe.toLowerCase();if(ve.startsWith("aria-")||ve.startsWith("data-"))continue;let Me=pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${Me}\\b`).test(ce))I.declaredProps.add(pe);if(new RegExp(`\\$props\\s*(?:\\.\\s*${Me}\\b|\\[\\s*['"]${Me}['"]\\s*\\])`).test(ce)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${Me}['"]`).test(ce))I.consumedProps?.add(pe)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ce))for(let pe of I.reactiveProps){if(Dp.has(pe)||I.consumedProps?.has(pe))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ce))continue;let ve=`${U}\x00${pe}`;if(Na.has(ve))continue;Na.add(ve),console.warn(`[stx] ${xe.basename(U)} reads \`${pe}\` with defineProps(), which is not live, but ${xe.basename(l)} binds it (:${pe}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${pe}').`)}let le=new Set(["__originalFilePath","__importedComponents",ls,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),de={};for(let[pe,ve]of Object.entries(a))if(!pe.startsWith("__")||le.has(pe))de[pe]=ve;let Ee=S.length>0?{[ms]:[...S]}:{},Re=r;if(r.includes("@include")){let{processIncludes:pe}=await o("stx/includes",()=>import("./chunk-ckey09ej.js"));Re=await pe(r,a,l,u,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Re)){let{processComponents:pe}=await o("stx/component-renderer",()=>import("./chunk-f4jmkx33.js")),ve={...a,__processedComponents:M,...Ee};Re=await pe(Re,ve,l,u,v);let Me=ve.__stx_preserved_client_expressions;if(Array.isArray(Me)&&Me.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Me])]}let we=[];if(kl(Re)){let{processExpressions:pe}=await o("stx/expressions",()=>import("./chunk-3xpnw4s1.js")),ve=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Ee}:S.length>0?{...a,...Ee}:a;Re=pe(Re,ve,l);for(let Me of Re.matchAll(/\{\{([\s\S]*?)\}\}/g))we.push(Me[1].trim())}let ge=se(Re),ze=[],Fe=ge.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(pe,ve)=>{let Me=ge.scripts[Number(ve)]||"",$e=Me.match(/^<script\b([^>]*)>/i)?.[1]||"",lt=$e.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Qe=!lt||["module","text/javascript","application/javascript"].includes(lt),Ot=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${$e}`);if(!/\bserver\b/i.test($e)&&Qe&&!Ot)return ze.push(Me),"";return Me}),{extractSlotContent:it}=await o("stx/slots",()=>import("./chunk-4n102da4.js")),rt=it(Fe),wt={};if(rt.defaultSlot?.trim())wt.default=rt.defaultSlot;for(let[pe,ve]of rt.namedSlots)wt[pe]=ve.content;let ft=a.__stx_scope_seq??={n:0,key:lo(String(a.__filename??l))},ot=Ba(e,process.cwd()),je=`stx_${(ot.endsWith(".stx")?ot.slice(0,-4):ot).replace(/[^a-zA-Z0-9]/g,"_")}_${++ft.n}_${ft.key}`,Ae={...de,$uid:je,$native:u._nativeHostAttrs===!0,...n,props:n,slot:Fe,$slots:wt,__processedComponents:V,__sections:{},__stx_signals_gate:Ne(ce)||kl(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...we]};if(/import\s/.test(ce)){Ae.__importedComponents=new Map(Ae.__importedComponents);let{processESImports:pe}=await o("stx/component-renderer",()=>import("./chunk-f4jmkx33.js"));ce=await pe(ce,Ae,U,u,v)}jp(ce,Ae,n);let dt=ce,nt=B(dt);if(nt)dt=nt.content.trim();let pn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Pt=[...ce.matchAll(pn)];for(let[,pe,ve]of Pt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(pe))We(ve,U,u.strict);let vt=[],fn=null,js=Pt.some((pe)=>/\bserver\b/.test(pe[1]||"")&&/\bcache\b/.test(pe[1]||"")),Jt=null,Rt=null,dn=null,Un=0,gn=null;if(Rp(u),js&&Pr>0){let pe=Tp({props:n,slot:Re,slotContext:r.trim()?Ap(de):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...S].sort(),layers:u._layerGraph?.layers.map((ve)=>ve.configFile),uid:je});if(pe!==null){Jt=`${U}\x00${E(ce)}\x00${pe}`;let ve=As.get(Jt);if(ve){for(let Me of ve.dependencies)v.add(Me);if(Ki(a,ve.clientFactories),ft.n+=ve.uidsConsumed,ve.preservedClientExpressions.length>0){let Me=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let $e of ve.preservedClientExpressions)Me.add($e);a.__stx_preserved_client_expressions=[...Me]}return ve.output}Rt=new Set(v),dn=Ci(a),Un=ft.n,gn=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let mn=new Set;for(let pe of Pt){let ve=pe[1]||"",Me=pe[2]||"",$e=ve.includes("server");if(Xe(ve)&&Me.trim())Me=Je(Me);if($e&&Me){for(let Qe of ye(Me))mn.add(Qe);try{await L(Me,Ae,U,{onFailure:(Qe)=>{if(Qe.kind!=="unknown")fn=Qe.kind}})}catch(Qe){}}if(!$e){let Qe=Me.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),Ot=Qe.includes("{{")&&Qe.includes("}}"),Yt=Qe.includes("{!!")&&Qe.includes("!!}");if(Ot||Yt)Qe=Wi(Qe,Ae,U);let Dt=ve.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");vt.push(`<script${Dt}>${Qe}</script>`)}}let St=se(ce).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),hn=St?St[1]:"",Ps=St?St[2]:"",Tt="",ue=hn&&/\bscoped\b/i.test(hn);if(St)Tt=`<style${hn}>${Mp(Ps,Ae,U)}</style>`;let fe=dt;if(fe=fe.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),St)fe=fe.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let pe=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ve=[];if(fe=fe.replace(pe,(Me,$e)=>{let lt=$e.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(lt)ve.push(`<style${lt[1]}>${lt[2]}</style>`);return""}),fe=fe.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ve.length>0)Tt=`${Tt}${ve.join(`
|
|
1187
|
+
`)}`}if(r&&fe.includes("{{ text || slot }}"))fe=fe.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:Se}=await o("stx/slots",()=>import("./chunk-4n102da4.js")),{defaultSlot:Be,namedSlots:tt}=rt,at=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Fe),Et=vt.length>0&&pr(fe)||u._nativeHostAttrs===!0&&vt.length>0||at&&vt.length>0||vt.some((pe)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(pe)),Ms=(pe)=>Et?Vo(pe,je):pe,Ds=new Map([...tt].map(([pe,ve])=>[pe,{...ve,content:Ms(ve.content)}]));fe=await Se(fe,Et?Fo(Ms(Be),je):Be,Ds,Ae,Et?je:"");let Hn=Vi(vt),xn=(Array.isArray(Ae.__stx_client_signal_names)?Ae.__stx_client_signal_names:[]).filter((pe)=>!mn.has(pe));if(Hn.length>0||xn.length>0)Ae.__stx_client_signal_names=[...new Set([...xn,...Hn])];else delete Ae.__stx_client_signal_names;let bn=S.filter((pe)=>!mn.has(pe)&&!(pe in n));if(bn.length>0)Ae[ms]=bn;let Kn={...u,_rootComponentsDir:u._rootComponentsDir||u.componentsDir,componentsDir:xe.dirname(U),skipSignalsRuntime:!0,skipEventDirectives:u._nativeHostAttrs===!0||Et||vt.length===0,defaultLayout:void 0};Ae.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:qn}=await o("stx/process",()=>import("./chunk-r368e96r.js")),At=await qn(fe,Ae,U,Kn,v),Mt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let pe of At.matchAll(/\{\{([\s\S]*?)\}\}/g))Mt.add(pe[1].trim());if(Mt.size>0)a.__stx_preserved_client_expressions=[...Mt];let It=je,ct=At;if(Et){let pe="";if(Object.keys(n).length>0)try{pe=` data-stx-props="${kr(JSON.stringify(n))}"`}catch{}let ve=Z?` stx-hydrate="${kr(Z)}"`:"",Me=Object.fromEntries(Object.entries(wt).map(([Lt,Qt])=>[Lt,Boolean(Qt)])),$e=Object.keys(Me).length>0?` data-stx-slots="${kr(JSON.stringify(Me))}"`:"",lt=` data-stx-scope="${It}"${pe}${$e}${ve}`,Qe=At.slice(Ut(At)),Ot=/^<span(?=[\s/>])/i.test(Qe),Yt=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Qe),Dt=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Qe),Zn=Ot?"span":"div",Ns=Yt&&u._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':Dt&&u._nativeHostAttrs?' style="width:100%;height:100%"':Ot||Yt?' style="display:contents"':"";ct=Wg(At,lt)??`<${Zn}${lt} data-stx-component-wrapper${Ns}>${At}</${Zn}>`;let Ls=await Promise.all(vt.map(async(Lt)=>{let Qt=Lt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!Qt)return Lt;let[,yn,zs]=Qt,Jn=Ta(Lt,Ae,U);if(Jn!==null)return Jn;let en=await Lp(zs,U,u.buildMode==="compile"),Xn=Pn(en.clientCode,Ke(Ae)),{vendorStyleTags:Gn}=en,Yn=Xn?`function(__scopeId) {
|
|
1188
1188
|
${Xn}
|
|
1189
1189
|
return (${en.factoryBody})(__scopeId);
|
|
1190
1190
|
}`:en.factoryBody,Qn=Z?null:rr(a,Yn),es=Qn?`window.__stxComponentFactories[${JSON.stringify(Qn)}](${JSON.stringify(It)});`:`(${Yn})(${JSON.stringify(It)});`;if(Z)return`${Gn}<script type="stx/island" data-stx-island="${It}" data-stx-scoped data-stx-owner="${It}"${yn}>${me(es)}</script>`;return`${Gn}<script data-stx-scoped data-stx-run="always" data-stx-owner="${It}"${yn}>${me(es)}</script>`}));if(ct=ct+`
|
|
@@ -1210,7 +1210,7 @@ ${He.yellow}${He.bold}Message:${He.reset} ${n}
|
|
|
1210
1210
|
`,f)I+=`
|
|
1211
1211
|
${He.blue}${He.bold}Context:${He.reset}
|
|
1212
1212
|
${He.dim}${f}${He.reset}
|
|
1213
|
-
`;return I}function Ce(){Fn.clear(),Rr.clear(),Ts.clear(),Tr.clear(),Ar.clear(),Ir.clear(),As.clear()}function Ry(){return{size:Fn.size,maxSize:500}}var Cr=k(128);async function Lp(e,n,r){let i=E(e,n,r),a=Cr.get(i);if(a){if(eo(a.deps))return a;Cr.delete(i)}let l=zi(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=Hi(l.styles);u=Xt(u).code;let{hasUserImports:v,bundleClientScript:S}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
1213
|
+
`;return I}function Ce(){Fn.clear(),Rr.clear(),Ts.clear(),Tr.clear(),Ar.clear(),Ir.clear(),As.clear()}function Ry(){return{size:Fn.size,maxSize:500}}var Cr=k(128);async function Lp(e,n,r){let i=E(e,n,r),a=Cr.get(i);if(a){if(eo(a.deps))return a;Cr.delete(i)}let l=zi(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=Hi(l.styles);u=Xt(u).code;let{hasUserImports:v,bundleClientScript:S}=await o("stx/client-script-bundler",()=>import("./chunk-nxat557m.js")),I=[],j=!1;if(v(u)){let G=u;u=await S(G,n,{projectRoot:process.cwd(),minify:r,collectInputs:I}),j=u===G}let{stripStxRuntimeImports:L}=await o("stx/signal-processing",()=>import("./chunk-3mr0kx0h.js"));u=L(u);let M=D(u),V=Op(M),W=new Set(X(M,!0).split(",").map((G)=>G.trim())),Z=`function(__scopeId) {
|
|
1214
1214
|
${xt("const",[...Fl,...V],M)}
|
|
1215
1215
|
const __scope = window.stx._scopes = window.stx._scopes || {};
|
|
1216
1216
|
const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{q,wg,bi,Hc,a,j,xy,Sy}from"./chunk-
|
|
2
|
+
import{q,wg,bi,Hc,a,j,xy,Sy}from"./chunk-3ykhczg6.js";import"./chunk-be1jvk13.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import"./chunk-16edtncx.js";import"./chunk-vaxxe2db.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{j as config,q as defaultConfig,xy as defineStxConfig,bi as discoverConfig,a as loadStxConfig,Hc as resolveInstalledPackage,wg as resolveStxDirectories,Sy as validateConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{le,ue,de,Jn,Ee,Fe,ds,vu,$t,ln,Yn,Zn,Qn,pe,er,tr,ps}from"./chunk-
|
|
2
|
+
import{le,ue,de,Jn,Ee,Fe,ds,vu,$t,ln,Yn,Zn,Qn,pe,er,tr,ps}from"./chunk-7nf7mp27.js";import"./chunk-9y83pdcb.js";export{ue as DEFAULT_FORMATS,de as DEFAULT_QUALITY,le as DEFAULT_WIDTHS,ps as ImageProcessingError,tr as formatSize,ln as generateSizes,$t as generateSrcSet,Yn as getFallbackVariant,ds as getImageMetadata,pe as getMimeType,er as getTotalSize,Zn as groupVariantsByFormat,Ee as isImageBackendAvailable,Qn as isImageFile,Jn as isSharpAvailable,Fe as processImage,vu as resizeAndConvert};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ht,Ag,Pg,Ig,Og,Ng,y,Mg,Fi,Dg,wl,vl}from"./chunk-
|
|
2
|
+
import{ht,Ag,Pg,Ig,Og,Ng,y,Mg,Fi,Dg,wl,vl}from"./chunk-16edtncx.js";import"./chunk-vaxxe2db.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{ht as STX_ENGINE_BINDING_NAMES,Fi as convertToCommonJS,wl as extractScriptFromTemplate,y as extractVariables,vl as hasVariables,Mg as isCompleteImport,Ng as isMissingBindingFailure,Ig as isModuleResolutionFailure,Og as isSyntaxFailure,Dg as splitDeclaration,Ag as stripTypeScript,Pg as withoutStxReferrer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fy,Ps,pi,Is,Sr,fi,gi,gg,Os,Ns,Ms,mi,Mc,mg,Ot}from"./chunk-
|
|
2
|
+
import{fy,Ps,pi,Is,Sr,fi,gi,gg,Os,Ns,Ms,mi,Mc,mg,Ot}from"./chunk-mphbgnta.js";import"./chunk-br1kkmbz.js";import"./chunk-vbmvft7g.js";import"./chunk-3ykhczg6.js";import"./chunk-be1jvk13.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import{X}from"./chunk-16edtncx.js";import"./chunk-vaxxe2db.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{gg as bindLoopInterpolations,fy as clearScriptScanCache,Os as convertServerLoopAttributesToDirectives,fi as convertSignalDirectivesToAttributes,Ns as convertSignalLoopsToAttributes,Sr as extractClientSignalNames,X as extractExports,Mc as findMarkupIndexOutsideScripts,Is as hasSignalsSyntax,pi as parseLoopExpression,gi as preEvalLiteralReactiveIfs,Ms as processScriptSetup,mi as processSignals,mg as rewriteStxImportSpecifiers,Ps as scanScriptTags,Ot as stripStxRuntimeImports};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Pe,uo,Kg,Ay,Gg,Py,On,g,Y,ae,Nn,Ne,Xg,Wi,Jg,Iy,P,qi,Yg,Oy,N,Ny}from"./chunk-
|
|
2
|
+
import{Pe,uo,Kg,Ay,Gg,Py,On,g,Y,ae,Nn,Ne,Xg,Wi,Jg,Iy,P,qi,Yg,Oy,N,Ny}from"./chunk-16edtncx.js";import"./chunk-vaxxe2db.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{Yg as applyFilters,Py as clearCustomFilters,Xg as clientLoopScopes,uo as defaultFilters,Nn as escapeAttributeValue,g as escapeHtml,Y as escapeHtmlValue,ae as escapeInterpolatedHtmlValue,N as evaluateExpression,Pe as findMustacheEnd,Gg as getAllFilters,Jg as interpolateScriptAttributes,Wi as interpolateScriptExpressions,Iy as interpolateScriptsInTemplate,P as processExpressions,qi as processExpressionsChunked,Kg as registerFilter,Ay as registerFilters,On as replaceInterpolations,Oy as resetRejectedExpressionWarnings,Ny as unescapeHtml,Ne as usesSignalsInScript};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{n,u}from"./chunk-945zygwa.js";import{Ri,s,In,b}from"./chunk-
|
|
2
|
+
import{n,u}from"./chunk-945zygwa.js";import{Ri,s,In,b}from"./chunk-16edtncx.js";import{ft}from"./chunk-0b57fgpn.js";import{Hs,Vs}from"./chunk-150cz8qq.js";import{Xc,vi,Fs,zs}from"./chunk-vw7crz0z.js";import{qc,Kc}from"./chunk-be1jvk13.js";import{Mt}from"./chunk-bvqgq18r.js";import{Cn,tl,Pr,Ir}from"./chunk-pjpy86c3.js";import{w}from"./chunk-v6gkjg5f.js";import{ko}from"./chunk-n3fgrsva.js";import{c,f}from"./chunk-p92272k0.js";import Q from"fs";import z from"path";import{loadConfigWithResult as Kt}from"bunfig";var K={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,t={}){let{duration:i,delay:o,ease:r,direction:l,custom:d}={...K,...t};if(e==="custom"&&d)return d;switch(e){case"fade":return`${l==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
3
3
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
4
4
|
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${l==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
5
5
|
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
|
@@ -1306,6 +1306,6 @@ ${y}
|
|
|
1306
1306
|
customElements.define('${t}', ${d});
|
|
1307
1307
|
`}async function et(e,t,i,o){if(t.length<1)return u("WebComponent","@webcomponent directive requires at least the tag name parameter",n.INVALID_DIRECTIVE_SYNTAX);let r=t[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",m=U.isAbsolute(d)?[U.join(d,`${r}.stx`),U.join(U.dirname(o),`${r}.stx`)]:[U.join(U.dirname(o),d,`${r}.stx`),U.join(process.cwd(),d,`${r}.stx`),U.join(U.dirname(o),`${r}.stx`)],p=null;for(let h of m)if(await s(h)){p=await Bun.file(h).text();break}if(!p)return u("WebComponent",`Component file not found: ${r}.stx`,n.FILE_NOT_FOUND);let g=Bt(p,r);return`<script type="module">
|
|
1308
1308
|
${Jt(g)}
|
|
1309
|
-
</script>`}var q={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:Cn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:je,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:et,hasEndTag:!1,description:"Include a web component in the template"},qc,Kc,Hs,Vs,Ae,Re,Ee,_e,Oe,Te,Ue,De,...ko],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Gt(e,t,i){let o=t||"pages";if(e)return{root:e,pagesDir:o};let r=i||process.cwd(),l=z.join(r,"resources","views"),d=z.join(r,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let m=z.join(r,"resources","views","pages");if(Q.existsSync(m))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var tt=new Set,ge=["partialsDir","componentsDir","layoutsDir"],Pe=new WeakMap;function Yt(e,t){let i=t.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/");return o===r||o.startsWith(`${r}/`)}function wg(e,t){let i=!e.root,o=Gt(e.root,e.pagesDir,t);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let r=`${t}::${o.root}`;if(!tt.has(r))tt.add(r),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Pe.has(e)){let r={};for(let l of ge){let d=e[l];if(typeof d==="string"&&d)r[l]=d}Pe.set(e,r)}if(e.root&&e.root!=="."){let r=e.root;for(let l of ge){let d=e[l];if(typeof d!=="string"||!d)continue;if(z.isAbsolute(d)||Yt(d,r))continue;e[l]=z.join(r,d)}}for(let r of ge){let l=e[r];if(typeof l!=="string"||!l||z.isAbsolute(l))continue;e[r]=z.resolve(t,l)}return e}function Xt(e,t){let i=Pe.get(e);for(let o of ge){let r=e[o];if(typeof r!=="string"||!r)continue;let l=z.isAbsolute(r)?r:z.join(t,r);if(Q.existsSync(l))continue;let d=i?.[o]??r,m=e.root,p=!!m&&m!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(p?`, resolved under root "${m}".`:"."))}}function Zt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Qt(e){if(tl(e.stateDir),e.stateDir=Pr(),e.cachePath=Ir(e.cachePath),e.build)e.build.cacheDir=Ir(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=Ir(e.media.cache.directory);if(e.story)e.story.outDir=Ir(e.story.outDir)}var Y=null,Z=new Map,me=new Map,ae=null;async function bi(e,t=Kt){try{return await t(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}var er=/[\\/]install[\\/]cache[\\/](?:@[^\\/]+[\\/])?[^\\/]+@[^\\/]*@@@\d+[\\/]/;function Hc(e,t){let i=w.resolve(e,{paths:[t]});if(er.test(i))throw Error(`${e} is not installed in ${t} (found only in Bun's install cache)`);return i}async function a(e){let t=e?z.resolve(e):process.cwd(),i=me.get(t);if(i&&i.signature!==Fs(i.graph)){let l=Z.get(t);if(Z.delete(t),me.delete(t),!e)Y=null,ae=null;let{clearComponentCache:d}=await import("./chunk-kxbk4505.js"),{partialsCache:m}=await import("./chunk-a7x8897c.js");if(d(),m.clear(),l&&i.configSignature===zs(i.graph)){let p=l.then(async(g)=>{let y={...i.graph};await vi(y,t),me.set(t,{graph:y,signature:Fs(y),configSignature:zs(y)});let h={...g,_layerGraph:y};if(!e)Y=h;return h});return Z.set(t,p),p}}if(!e){if(Y)return Y;if(ae)return ae}let o=Z.get(t);if(o)return o;let r=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(z.join(t,`stx.config${v}`))),m=l.some((v)=>Q.existsSync(z.join(t,"config",`ui${v}`))),p;if(d&&m){let v=await bi({name:"ui",cwd:z.join(t,"config"),defaultConfig:q,errorPolicy:"throw",verbose:!1});p=(await bi({name:"stx",alias:"ui",cwd:t,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else p=(await bi({name:"stx",alias:"ui",cwd:t,defaultConfig:q,errorPolicy:"throw",verbose:!1})).config;if(p.extends!==void 0||i){let v=await Xc(t,q);p=v.config,me.set(t,{graph:v.graph,signature:Fs(v.graph),configSignature:zs(v.graph)})}if(p.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-mhv84p0x.js");v(p.runtimeConfig,{});let{generateRuntimeConfigTypes:x}=await import("./chunk-9ehryt4w.js");await x(t,p.runtimeConfig)}Zt(p),Qt(p),wg(p,t),Xt(p,t);let g=[],y=new Set((p.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of p.componentPackages??["@stacksjs/components"]){let x=`${v}/stx-plugin`;if(y.has(x)||y.has(v))continue;try{Hc(x,t),g.push(x)}catch{}}let h=[...p.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-jr3fmkq7.js"),x=[],C=[],A=new Set(p.componentPackages??["@stacksjs/components"]),P=[];for(let R of h){let _=typeof R==="string"?R:R[0],I=typeof R==="string"?{}:R[1]||{};try{let T,k;try{let S=Hc(_,t);T=await import(S),k=z.dirname(S)}catch{let S=z.resolve(t,_);T=await import(S),k=z.dirname(S)}let D=T.default||T;if(!v.has(D.name))await v.register(D,p);if(D.components){let S=Array.isArray(D.components)?D.components:[D.components],M=A.has(D.name)||A.has(_)||A.has(_.replace(/\/stx-plugin$/,""));for(let F of S){let N=z.resolve(k,F);x.push(N);let V=M;if(!V){let E=Ri(z.join(N,"package.json"));if(E)try{let L=JSON.parse(Q.readFileSync(z.join(E,"package.json"),"utf8"));V=typeof L.name==="string"&&A.has(L.name)}catch{}}if(V)C.push(N)}}if(D.pages){let S=z.resolve(k,D.pages),M=I.path||"/";P.push({dir:S,prefix:M})}if(D.setup){let S={addDirective:(M)=>{p.customDirectives=p.customDirectives||[],p.customDirectives.push(M)},addRoute:(M,F)=>{p.apiRoutes=p.apiRoutes||{},p.apiRoutes[M]=F},addMiddleware:(M)=>{p.middleware=p.middleware||[],p.middleware.push(M)},pluginDir:k,config:p};await D.setup(I,S)}process.stderr.write(`[stx] Plugin loaded: ${D.name||_}
|
|
1309
|
+
</script>`}var q={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:Cn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:je,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:et,hasEndTag:!1,description:"Include a web component in the template"},qc,Kc,Hs,Vs,Ae,Re,Ee,_e,Oe,Te,Ue,De,...ko],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Gt(e,t,i){let o=t||"pages";if(e)return{root:e,pagesDir:o};let r=i||process.cwd(),l=z.join(r,"resources","views"),d=z.join(r,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let m=z.join(r,"resources","views","pages");if(Q.existsSync(m))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var tt=new Set,ge=["partialsDir","componentsDir","layoutsDir"],Pe=new WeakMap;function Yt(e,t){let i=t.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/");return o===r||o.startsWith(`${r}/`)}function wg(e,t){let i=!e.root,o=Gt(e.root,e.pagesDir,t);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let r=`${t}::${o.root}`;if(!tt.has(r))tt.add(r),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Pe.has(e)){let r={};for(let l of ge){let d=e[l];if(typeof d==="string"&&d)r[l]=d}Pe.set(e,r)}if(e.root&&e.root!=="."){let r=e.root;for(let l of ge){let d=e[l];if(typeof d!=="string"||!d)continue;if(z.isAbsolute(d)||Yt(d,r))continue;e[l]=z.join(r,d)}}for(let r of ge){let l=e[r];if(typeof l!=="string"||!l||z.isAbsolute(l))continue;e[r]=z.resolve(t,l)}return e}function Xt(e,t){let i=Pe.get(e);for(let o of ge){let r=e[o];if(typeof r!=="string"||!r)continue;let l=z.isAbsolute(r)?r:z.join(t,r);if(Q.existsSync(l))continue;let d=i?.[o]??r,m=e.root,p=!!m&&m!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(p?`, resolved under root "${m}".`:"."))}}function Zt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Qt(e){if(tl(e.stateDir),e.stateDir=Pr(),e.cachePath=Ir(e.cachePath),e.build)e.build.cacheDir=Ir(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=Ir(e.media.cache.directory);if(e.story)e.story.outDir=Ir(e.story.outDir)}var Y=null,Z=new Map,me=new Map,ae=null;async function bi(e,t=Kt){try{return await t(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}var er=/[\\/]install[\\/]cache[\\/](?:@[^\\/]+[\\/])?[^\\/]+@[^\\/]*@@@\d+[\\/]/;function Hc(e,t){let i=w.resolve(e,{paths:[t]});if(er.test(i))throw Error(`${e} is not installed in ${t} (found only in Bun's install cache)`);return i}async function a(e){let t=e?z.resolve(e):process.cwd(),i=me.get(t);if(i&&i.signature!==Fs(i.graph)){let l=Z.get(t);if(Z.delete(t),me.delete(t),!e)Y=null,ae=null;let{clearComponentCache:d}=await import("./chunk-xjtq49hm.js"),{partialsCache:m}=await import("./chunk-ckey09ej.js");if(d(),m.clear(),l&&i.configSignature===zs(i.graph)){let p=l.then(async(g)=>{let y={...i.graph};await vi(y,t),me.set(t,{graph:y,signature:Fs(y),configSignature:zs(y)});let h={...g,_layerGraph:y};if(!e)Y=h;return h});return Z.set(t,p),p}}if(!e){if(Y)return Y;if(ae)return ae}let o=Z.get(t);if(o)return o;let r=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(z.join(t,`stx.config${v}`))),m=l.some((v)=>Q.existsSync(z.join(t,"config",`ui${v}`))),p;if(d&&m){let v=await bi({name:"ui",cwd:z.join(t,"config"),defaultConfig:q,errorPolicy:"throw",verbose:!1});p=(await bi({name:"stx",alias:"ui",cwd:t,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else p=(await bi({name:"stx",alias:"ui",cwd:t,defaultConfig:q,errorPolicy:"throw",verbose:!1})).config;if(p.extends!==void 0||i){let v=await Xc(t,q);p=v.config,me.set(t,{graph:v.graph,signature:Fs(v.graph),configSignature:zs(v.graph)})}if(p.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-mhv84p0x.js");v(p.runtimeConfig,{});let{generateRuntimeConfigTypes:x}=await import("./chunk-10cnra24.js");await x(t,p.runtimeConfig)}Zt(p),Qt(p),wg(p,t),Xt(p,t);let g=[],y=new Set((p.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of p.componentPackages??["@stacksjs/components"]){let x=`${v}/stx-plugin`;if(y.has(x)||y.has(v))continue;try{Hc(x,t),g.push(x)}catch{}}let h=[...p.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-jr3fmkq7.js"),x=[],C=[],A=new Set(p.componentPackages??["@stacksjs/components"]),P=[];for(let R of h){let _=typeof R==="string"?R:R[0],I=typeof R==="string"?{}:R[1]||{};try{let T,k;try{let S=Hc(_,t);T=await import(S),k=z.dirname(S)}catch{let S=z.resolve(t,_);T=await import(S),k=z.dirname(S)}let D=T.default||T;if(!v.has(D.name))await v.register(D,p);if(D.components){let S=Array.isArray(D.components)?D.components:[D.components],M=A.has(D.name)||A.has(_)||A.has(_.replace(/\/stx-plugin$/,""));for(let F of S){let N=z.resolve(k,F);x.push(N);let V=M;if(!V){let E=Ri(z.join(N,"package.json"));if(E)try{let L=JSON.parse(Q.readFileSync(z.join(E,"package.json"),"utf8"));V=typeof L.name==="string"&&A.has(L.name)}catch{}}if(V)C.push(N)}}if(D.pages){let S=z.resolve(k,D.pages),M=I.path||"/";P.push({dir:S,prefix:M})}if(D.setup){let S={addDirective:(M)=>{p.customDirectives=p.customDirectives||[],p.customDirectives.push(M)},addRoute:(M,F)=>{p.apiRoutes=p.apiRoutes||{},p.apiRoutes[M]=F},addMiddleware:(M)=>{p.middleware=p.middleware||[],p.middleware.push(M)},pluginDir:k,config:p};await D.setup(I,S)}process.stderr.write(`[stx] Plugin loaded: ${D.name||_}
|
|
1310
1310
|
`)}catch(T){console.warn(`[stx] Failed to load plugin ${_}:`,T.message)}}p._pluginComponentDirs=x,p._componentPackageDirs=C,p._pluginPageDirs=P}if(p.nativePrimitives!==!1)p._nativePrimitivesFallback={dir:js(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return p})();if(Z.set(t,r),r.catch(()=>{if(Z.get(t)===r)Z.delete(t)}),!e)ae=r,r.then((l)=>{Y=l}).catch(()=>{});return r}var j=new Proxy(q,{get(e,t){if(Y&&t in Y)return Y[t];if(!ae)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[t]}});function xy(e){return e}function Sy(e){let t=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")t.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")t.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")t.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")t.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)t.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)t.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))t.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))t.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)t.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)t.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))t.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))t.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))t.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))t.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,r)=>{if(!o.name||typeof o.name!=="string")t.push({path:`customDirectives[${r}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")t.push({path:`customDirectives[${r}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))t.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,r)=>{if(!o.name||typeof o.name!=="string")t.push({path:`middleware[${r}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")t.push({path:`middleware[${r}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))t.push({path:`middleware[${r}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)t.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))t.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))t.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((r,l)=>{if(!r.pattern||typeof r.pattern!=="string")t.push({path:`pwa.routes[${l}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(r.strategy))t.push({path:`pwa.routes[${l}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(r.maxAgeSeconds!==void 0&&(typeof r.maxAgeSeconds!=="number"||r.maxAgeSeconds<0))t.push({path:`pwa.routes[${l}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(r.maxEntries!==void 0&&(typeof r.maxEntries!=="number"||r.maxEntries<1))t.push({path:`pwa.routes[${l}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))t.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((r)=>typeof r!=="number"||r<16||r>1024).length>0)t.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((l)=>!o.includes(l)).length>0)t.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:t.length===0,errors:t,warnings:i}}
|
|
1311
1311
|
export{Bc,Fc,Tr,dt,zc,js,Bs,q,wg,bi,Hc,a,j,xy,Sy};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{en,we,R}from"./chunk-0jdz31q1.js";import{Pi,nl,o,A,We,Oe,En,qe,ke,se,Mr,O,$n,oo,pl,fl,An,Fr,ao,co,gl,Bi,ml,hl,yl,bl,Ke,Ge,lo,Ye,s,In,b,g,Y,ae,Ne,P,qi}from"./chunk-
|
|
2
|
+
import{en,we,R}from"./chunk-0jdz31q1.js";import{Pi,nl,o,A,We,Oe,En,qe,ke,se,Mr,O,$n,oo,pl,fl,An,Fr,ao,co,gl,Bi,ml,hl,yl,bl,Ke,Ge,lo,Ye,s,In,b,g,Y,ae,Ne,P,qi}from"./chunk-16edtncx.js";import{d,m,M,n,ce,te,u,Me,Ji,K,Ln,Yi,Zt,Zi,Pl,Wr,Il,vt,Ol,qr,Nl,jn,Qi,Ml,Kr,Xr,De,ea}from"./chunk-945zygwa.js";import{Jt}from"./chunk-esm0pnpz.js";import{Mn}from"./chunk-vaxxe2db.js";import{S}from"./chunk-af50zx8y.js";import{Ar,Gs}from"./chunk-0b57fgpn.js";import{Bc,Fc,Tr,dt,zc,j}from"./chunk-3ykhczg6.js";import{xi,Si,ki,_i}from"./chunk-150cz8qq.js";import{kn,Nc,Rs}from"./chunk-9hde8azp.js";import{Cs,Es,Ts}from"./chunk-5c2yf28r.js";import{Is,fi,gi,Os,Ns,mi}from"./chunk-mphbgnta.js";import{As,ci}from"./chunk-aq5ffmrs.js";import{si}from"./chunk-de61k0ab.js";import{ge,li,ui,di}from"./chunk-5jrpzepc.js";import{kr,Re,Dc,_r,Lc}from"./chunk-br1kkmbz.js";import{W,lt}from"./chunk-a7bqrjm5.js";import{Z}from"./chunk-65g78sge.js";import{Vc,Uc}from"./chunk-be1jvk13.js";import{I,Bn,ta}from"./chunk-qykbjg3z.js";import{Hn}from"./chunk-68r2zs20.js";import{L,c,f}from"./chunk-p92272k0.js";function ze(r){return/\bimport\s*\.\s*meta\b/.test(Hn(r))}function Br(r){let e=Oe(r),l=[],a=0;for(let h=0;h<e.length;h++){let t=e[h],p=t.name.toLowerCase();if(p==="template")a+=t.closing?-1:1;if(p!=="script"||t.closing)continue;let w=e[h+1];if(w?.name.toLowerCase()!=="script"||!w.closing)continue;l.push({start:t.start,end:w.end,attrs:t.attributes,body:r.slice(t.end,w.start),inert:a>0})}return l}function nt(r){return[...r].map(([e,l])=>l===!0?e:`${e}="${l.replace(/"/g,""")}"`).join(" ")}function wt(r){let e=Br(r);if(e.some((y)=>O(y.attrs).has("data-stx-module-bootstrap")))return r;let l=(y)=>{if(ze(y))return!0;try{return Z(y)}catch{return!1}};if(!e.some((y)=>l(y.body)||O(y.attrs).get("type")==="module"))return r;let a=new Bun.CryptoHasher("md5").update(r).digest("hex").slice(0,16),h="",t=0,p=!1,w=0;for(let y of e){let v=O(y.attrs),x=v.get("type");if(y.inert||v.has("data-stx-module-job")||v.has("data-stx-runtime")||v.has("data-stx-router"))continue;if(typeof x==="string"&&!["module","text/javascript","application/javascript"].includes(x.toLowerCase()))continue;if(![...v.keys()].some((T)=>/^data-stx-(?:scoped|modules|stores|(?:framework-)?composables)$/.test(T)))continue;let _=x==="module"||l(y.body);if(_)p=!0;if(!p)continue;if(!_&&(v.has("data-stx-owner")||v.has("data-stx-instance")))continue;h+=r.slice(t,y.start);let E=y.body,D=v.get("src");if(typeof D==="string")v.delete("src"),v.set("data-stx-source-url",D),E=`${_?"await":"return"} new Promise(function(resolve,reject){
|
|
3
3
|
var source=globalThis.__stxExecutingScript,script=document.createElement('script');
|
|
4
4
|
for(var attr of source.attributes)if(!['type','src','data-stx-module-job'].includes(attr.name))script.setAttribute(attr.name,attr.value);
|
|
5
5
|
${_?"script.type='module';":""}
|
|
@@ -1354,7 +1354,7 @@ ${C}
|
|
|
1354
1354
|
</style>`;a=a.replace(v,N),w.lastIndex=0}catch(C){}}}return a}import gt from"path";var is=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,os=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function as(r,e){if(!e||!r.includes("/"))return r;let l=gt.dirname(e);return r.replace(is,(a,h,t,p)=>{let w=gt.resolve(l,p);return`${h}${t}${w.split(gt.sep).join("/")}${t}`})}function wr(r,e){if(!e||!r.includes("<script"))return r;return r.replace(os,(l,a,h,t)=>`${a}${as(h,e)}${t}`)}var Ae="<!--PARENT_CONTENT_PLACEHOLDER-->";function vr(r){return r.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Dr(r,e){let l=r.length,a=e,h=!0,t=[],p=(w)=>w+9<=l&&r[w]==="<"&&r[w+1]==="/"&&(r[w+2]==="s"||r[w+2]==="S")&&(r[w+3]==="c"||r[w+3]==="C")&&(r[w+4]==="r"||r[w+4]==="R")&&(r[w+5]==="i"||r[w+5]==="I")&&(r[w+6]==="p"||r[w+6]==="P")&&(r[w+7]==="t"||r[w+7]==="T")&&(r[w+8]===">"||/\s/.test(r[w+8]));while(a<l){let w=r[a];if(p(a))return a;if(w==="/"&&r[a+1]==="/"){if(a=r.indexOf(`
|
|
1355
1355
|
`,a+2),a===-1)return-1;a+=1,h=!0;continue}if(w==="/"&&r[a+1]==="*"){let y=r.indexOf("*/",a+2);if(y===-1)return-1;a=y+2,h=!0;continue}if(w==="/"&&h){let y=a+1,v=!1;while(y<l){let x=r[y];if(x==="\\"){y+=2;continue}if(x==="[")v=!0;else if(x==="]")v=!1;else if(x==="/"&&!v){y++;break}else if(x===`
|
|
1356
1356
|
`){y=-1;break}y++}if(y===-1){a++,h=!1;continue}while(y<l&&/[a-z]/.test(r[y]))y++;a=y,h=!1;continue}if(w==="'"||w==='"'){let y=w;a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]===y){a++;break}if(r[a]===`
|
|
1357
|
-
`)break;a++}h=!1;continue}if(w==="`"){a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++;break}if(r[a]==="$"&&r[a+1]==="{"){t.push(!0),a+=2,h=!0;break}a++}if(t.length===0)h=!1;continue}if(w==="}"&&t.length>0){t.pop(),a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++,h=!1;break}if(r[a]==="$"&&r[a+1]==="{"){t.push(!0),a+=2,h=!0;break}a++}continue}if(/\s/.test(w));else if(/[)\].\w$]/.test(w))h=!1;else h=!0;a++}return-1}function Ir(r,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${l}(?:\\s|=|/?>))[^>]*>`,"i").exec(r);if(!a)return null;let h=a.index+a[0].length,t=r.indexOf("</script>",h);if(t===-1)return null;let p=r.indexOf(">",t);if(p===-1)return null;return{start:a.index,end:p+1}}var ls=4096;async function mt(r,e,l){if(ze(e)||Z(e)||l.buildMode!=="serve"||e.length<ls)return null;let{registerServeModuleBundle:a}=await import("./chunk-
|
|
1357
|
+
`)break;a++}h=!1;continue}if(w==="`"){a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++;break}if(r[a]==="$"&&r[a+1]==="{"){t.push(!0),a+=2,h=!0;break}a++}if(t.length===0)h=!1;continue}if(w==="}"&&t.length>0){t.pop(),a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++,h=!1;break}if(r[a]==="$"&&r[a+1]==="{"){t.push(!0),a+=2,h=!0;break}a++}continue}if(/\s/.test(w));else if(/[)\].\w$]/.test(w))h=!1;else h=!0;a++}return-1}function Ir(r,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${l}(?:\\s|=|/?>))[^>]*>`,"i").exec(r);if(!a)return null;let h=a.index+a[0].length,t=r.indexOf("</script>",h);if(t===-1)return null;let p=r.indexOf(">",t);if(p===-1)return null;return{start:a.index,end:p+1}}var ls=4096;async function mt(r,e,l){if(ze(e)||Z(e)||l.buildMode!=="serve"||e.length<ls)return null;let{registerServeModuleBundle:a}=await import("./chunk-dysb1g8f.js");return`<script ${r} src="${a(e)}"></script>`}async function yr(r,e,l,a){try{let{registeredModuleIdsIn:h,buildModuleRegistryScript:t}=await o("stx/client-module-registry",()=>import("./chunk-z9nqmatt.js")),p=[],w=await t(h(...r),{minify:ta(e.buildMode,e.minifyClient),collectInputs:p});for(let y of p)l?.add(y);if(a)a.inputs=p,a.code=w??void 0;if(!w)return null;if(e.buildMode==="serve"&&!ze(w)&&!Z(w)){let{registerServeModuleBundle:y}=await import("./chunk-dysb1g8f.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${y(w)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${w.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function us(r,e,l,a){let h={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:_}=await o("stx/framework-composables",()=>import("./chunk-dz51m8bm.js"));h.frameworkScript=await _(r)}catch{}let t=null;try{t=await o("stx/store-loader",()=>import("./chunk-yc6rvmbt.js"))}catch{}let p=e.storesDir,w=!!a.__stx_native_screen||(t?.pageStoresAll()??!0),y=w?"":r.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),v=[],x=[],k=null;for(let _=0;_<8;_++){let E=null,D="",T=!1;try{if(t){let U=w?await t.getStoreScript(p).then((V)=>V?{code:V,stores:["*"],functions:null}:null):await t.getStoreScriptFor(p,[y],{reads:t.storesReadInFiles([...v,...x]),runOnce:!0});if(U)E=U.code,D=U.stores.join(","),T=!!U.functions&&!w}}catch{}if(k!==null&&D===k)break;k=D;let C=T?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",N=E?`<script ${C}>${E}</script>`:null;h.storeCode=E,h.storeTag=E?await mt(C,E,e)??N:null;let q={};h.modulesTag=await yr([r,N],e,l,q),h.modulesCode=q.code??null,v=q.inputs??[],h.composableTag=null,h.composableCode=null,x=[];try{let{getComposableScript:U}=await o("stx/composable-loader",()=>import("./chunk-0yhkgv37.js")),V=e.composablesDir,H=[h.modulesCode??h.modulesTag,N,h.frameworkScript].filter((F)=>F!==null),B=await U(e._layerComposableDirs??V,r,H,x);if(B)h.composableCode=B,h.composableTag=await mt('data-stx-scoped data-stx-run="always" data-stx-composables',B,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${B.replace(/<\/script/gi,"<\\/script")}</script>`}catch{}if(w||!t)break}return h}async function ds(r,e,l,a={}){let{withModuleSubstitutes:h,moduleSubstitutionKey:t}=await import("./chunk-nxat557m.js"),p=await import("./chunk-kvjbpbmw.js"),{messages:w,webModules:y}=e,v=null,x=null,k=t()===""&&!a.__stx_native_screen;if(w&&p.pageMessagesEnabled(e)&&k)try{v=await p.loadPageMessages(process.cwd(),w)}catch(C){ps(C)}if(y&&Object.keys(y).length&&k)try{x=await(await import("./chunk-ayady5ws.js")).loadWebModules(process.cwd(),y)}catch(C){fs(C)}let _=new Map([...x??[],...v?.stubs??[]]),E=()=>us(r,e,l,a),D=_.size?await h(_,E):await E(),T=null;if(v){let C=p.messageAreasIn(D.modulesCode,D.storeCode,D.composableCode),N=p.pageMessagesScript(v,p.pageLanguages(r,v),C);if(N)T=await mt('data-stx-scoped data-stx-run="always" data-stx-messages',N,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${N.replace(/<\/script/gi,"<\\/script")}</script>`}return[T,D.modulesTag,D.storeTag,D.composableTag,D.frameworkScript].filter((C)=>C!==null)}var xr=!1;function ps(r){if(xr)return;xr=!0,console.warn(`[stx] messages: ${r instanceof Error?r.message:String(r)}; pages ship every language`)}var Sr=!1;function fs(r){if(Sr)return;Sr=!0,console.warn(`[stx] ${r instanceof Error?r.message:String(r)}; pages bundle the real modules`)}function gs(r,e=""){let l=Ir(r,"data-stx-runtime");if(!l)return r;let a=kr(r);if(a===-1||a===l.start){if(!e)return r;return r.slice(0,l.end)+e+r.slice(l.end)}if(a<l.start)return r.slice(0,a)+r.slice(l.start,l.end)+e+`
|
|
1358
1358
|
`+r.slice(a,l.start)+r.slice(l.end);let h=r.slice(l.start,l.end),t=r.slice(0,l.start)+r.slice(l.end),p=kr(t);if(p===-1)return h+e+`
|
|
1359
1359
|
`+t;return t.slice(0,p)+h+e+`
|
|
1360
1360
|
`+t.slice(p)}function ms(r){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return r.replace(e,(l,a,h)=>{let t=r.slice(0,h);return t.lastIndexOf("<")>t.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(r,e,l,a,h){if(await R(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return r;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=Ne(r,l);let t=!e.__stxProcessingDepth;An(e);for(let p of a._layerGraph?.configDependencies??[])h.add(p);if(t&&a.runtimeConfig)await Mn(e,l,a.runtimeConfig);if(t)yl(e),e.__stx_scope_seq??={n:0,key:lo(String(e.__filename??l))},e.__stx_head_injections=Zi(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!I()&&!Bn())&&l&&l.endsWith(".stx"))si(r,l);try{return await we.timeAsync("template-processing",async()=>{let p=await hs(r,e,l,a,h);if(t)p=Bi(p);if(t&&a.autoShell&&a.buildMode!=="compile"){let w=De(a.app?.head,{known:Xr,source:"app.head"}),v=(e.__stx_runtime_head||null)??ea(),x=(e.__stx_head_raw||"").trim(),k,_=x.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(_)k=_[1].trim(),x=x.replace(_[0],"").trim();let E=e.__sections?.title,D=E?P(E,e,l):void 0,T=v.title||k||D,C=!v.title&&(!!k||!!D),N=v.meta||[],q=new Set(N.map((J)=>vt(J)).filter(Boolean)),U={...w,...T&&{title:T},meta:[...(w.meta||[]).filter((J)=>!q.has(vt(J))),...N],link:[...w.link||[],...v.link||[]],script:[...w.script||[],...v.script||[]],headRaw:[w.headRaw,x].filter(Boolean).join(`
|
|
@@ -1369,7 +1369,7 @@ ${y.trim()}
|
|
|
1369
1369
|
@endsection`}}if(N&&y.includes("<script")){let H=se(y),B=H.scripts.map((F)=>$r(F,l)??F);y=Mr(H.output,B)}if(y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(H,B,F)=>(C[B]=F,"")),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(H,B,F)=>{if(/^(['"]).*\1$/.test(F.trim()))return H;try{let J=d(F.trim(),e);if(J===void 0)return H;let G=(e.__stx_inline_section_values??=[]).push(J)-1;return C[B]=`{{ __stx_inline_section_values[${G}] }}`,""}catch{return H}}),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(H,B,F)=>{if(F.includes("@parent"))C[B]=F.replace("@parent",Ae);else C[B]=F.trim();return""}),e.__sections=C,y=y.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(H,B,F)=>C[B]||F||""),!("slot"in e)||e.slot===void 0)y=y.replace(/\{\{\s*slot\s*\}\}/g,()=>C.content||"");if(y=Ts(y,T),N){let H=[],B=se(y),F=ke(B.output,En,(J,de)=>`\x00STX_ORPHAN_STYLE_${de}\x00`);if(y=F.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(J,de,G)=>{let pe=de==="SCRIPT"?$r(B.scripts[Number(G)],l):F.tokens[Number(G)];if(pe)H.push(pe);return""}),H.length>0){let J=H.join(`
|
|
1370
1370
|
`);C.content=C.content?`${C.content}
|
|
1371
1371
|
${J}`:J,e.__sections=C}}if(N)try{let H;if(le.isAbsolute(N))H=N,h.add(N);else H=await Me(()=>In(N,l,p,h),null,()=>{throw new ce(`Failed to resolve layout path: ${N}`,l,void 0,void 0,`Layout referenced from ${l}`)});if(!H){let ue=(Q)=>{if(!Q)return[];try{let xe=le.isAbsolute(Q)?Q:le.resolve(process.cwd(),Q);return cs.readdirSync(xe).filter(($e)=>$e.endsWith(".stx")).map(($e)=>$e.replace(/\.stx$/,""))}catch{return[]}},ne=[...ue(p.layoutsDir),...ue(p.fallbackLayoutsDir)].filter((Q,xe,$e)=>$e.indexOf(Q)===xe).sort(),ve=[p.layoutsDir,p.fallbackLayoutsDir].filter((Q)=>typeof Q==="string"&&Q.length>0),me=ve.length>0?` Searched: ${ve.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",ie=`Layout not found: ${N} (referenced from ${l})`+(ne.length>0?`. Available layouts: ${ne.join(", ")}`:p.layoutsDir?`. No .stx layouts found in ${p.layoutsDir}`:"")+me;if(K.log(Error(ie),{layoutPath:N,filePath:l,available:ne},"error"),console.error(`[stx] ${ie}`),p.debug)throw new ce(ie,l);return y}let B=await Me(()=>Bun.file(H).text(),"",()=>{throw new ce(`Failed to read layout file: ${H}`,l,void 0,void 0,"Layout content could not be loaded")});B=wr(B,H),B=B.replace(/\{\{--[\s\S]*?--\}\}/g,"");let F=Array.isArray(e.__layoutChain)?e.__layoutChain:[];if(F.includes(H)){let ue=[...F.slice(F.indexOf(H)),H];throw new ce(ue.length===2?`Circular layout: ${H} extends itself`:`Circular layout: ${ue.join(" -> ")}`,l,void 0,void 0,"Remove the @extends or @layout line that points back at a layout already in use")}let J=B.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(J){if(p.debug)console.log(`Found nested layout: ${J[1]} in ${H}`);let ue={},ne=B.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ie,Q,xe)=>(ue[Q]=xe.trim(),""));for(let[ie,Q]of Object.entries(ue))if(C[ie]&&C[ie].includes(Ae)){let xe=C[ie].indexOf(Ae);C[ie]=C[ie].slice(0,xe)+Q+C[ie].slice(xe+Ae.length)}else if(!C[ie])C[ie]=Q;let ve={...e,__sections:C,__layoutChain:[...F,H]},me=`@layout('${J[1]}')${ne}`;return await i(me,ve,H,p,h)}let de=B.replace(/\{\{--[\s\S]*?--\}\}/g,""),G=Es(de,T),pe={};return G=G.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ue,ne,ve)=>(pe[ne]=ve.trim(),`@slot('${ne}')`)),G=G.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(ue,ne,ve)=>{if(C[ne]){let me=C[ne];if(me.includes(Ae)){let ie=pe[ne]||"",Q=me.indexOf(Ae);me=me.slice(0,Q)+ie+me.slice(Q+Ae.length)}return me}return ve||""}),G=ys(G,C),G=G.replace(/\{\{\s*slot\s*\}\}/g,()=>C.content||""),G=Ts(G,T),e.__originalFilePath=l,y=await Rr(G,e,H,p,h),y=`<!-- stx-layout: ${N} -->
|
|
1372
|
-
${y}`,k(y)}catch(H){if(H instanceof te)throw H;throw new ce(`Error processing layout ${N}: ${H instanceof Error?H.message:String(H)}`,l)}return k(await Rr(y,e,l,p,h))}function ys(r,e){return r.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(l,a,h)=>{let t=e[a];if(t!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(t))return t}return h||""})}function bs(r,e){if(r.__stx_sfc_mode=!0,r.__stx_options=e,e.buildMode)r.__stx_buildMode=e.buildMode;let l=e.envPrefix||"STX_PUBLIC_",a={};for(let[h,t]of Object.entries(process.env))if(h.startsWith(l)&&t!==void 0)a[h]=t;r.$env=a}async function ws(r,e){await Me(()=>nr(r,e),void 0,(l)=>{K.log(l,{filePath:r,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${r}: ${l.message}`)})}var ht="data-stx-source";function $r(r,e){if(!r)return r;let l=/^<script\b([^>]*)>/i.exec(r);if(!l||!/\bserver\b/.test(l[1])||l[1].includes(ht))return r;return`<script ${ht}="${encodeURIComponent(e)}"${r.slice(7)}`}function vs(r){let e=new RegExp(`${ht}="([^"]*)"`).exec(r);return e?decodeURIComponent(e[1]):void 0}function Er(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Cr(r,e,l){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">${Er(r)}</span><span style="display:block;margin-top:4px">${Er(l)}</span></div>`}async function xs(r,e,l,a){let{scanScriptTags:h}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1372
|
+
${y}`,k(y)}catch(H){if(H instanceof te)throw H;throw new ce(`Error processing layout ${N}: ${H instanceof Error?H.message:String(H)}`,l)}return k(await Rr(y,e,l,p,h))}function ys(r,e){return r.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(l,a,h)=>{let t=e[a];if(t!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(t))return t}return h||""})}function bs(r,e){if(r.__stx_sfc_mode=!0,r.__stx_options=e,e.buildMode)r.__stx_buildMode=e.buildMode;let l=e.envPrefix||"STX_PUBLIC_",a={};for(let[h,t]of Object.entries(process.env))if(h.startsWith(l)&&t!==void 0)a[h]=t;r.$env=a}async function ws(r,e){await Me(()=>nr(r,e),void 0,(l)=>{K.log(l,{filePath:r,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${r}: ${l.message}`)})}var ht="data-stx-source";function $r(r,e){if(!r)return r;let l=/^<script\b([^>]*)>/i.exec(r);if(!l||!/\bserver\b/.test(l[1])||l[1].includes(ht))return r;return`<script ${ht}="${encodeURIComponent(e)}"${r.slice(7)}`}function vs(r){let e=new RegExp(`${ht}="([^"]*)"`).exec(r);return e?decodeURIComponent(e[1]):void 0}function Er(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Cr(r,e,l){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">${Er(r)}</span><span style="display:block;margin-top:4px">${Er(l)}</span></div>`}async function xs(r,e,l,a){let{scanScriptTags:h}=await o("stx/signal-processing",()=>import("./chunk-3mr0kx0h.js")),t=[],p=!I()&&!Bn();for(let y of h(r)){let v=y.attrs;if(!/\bserver\b/.test(v))continue;let x=y.start+y.fullMatch.indexOf(">")+1,k=Dr(r,x);if(k===-1)continue;let _=r.slice(x,k);if(!_.trim())continue;let E=vs(v)??l,D={index:y.start,length:k+9-y.start};try{let{extractVariables:T}=await o("stx/variable-extractor",()=>import("./chunk-33h2z0s5.js"));await T(_,e,E,{preserveExisting:!0,onFailure:(C)=>{if(C.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:E,kind:C.kind,message:C.message}),!p)return;t.push({...D,markup:Cr(E,C.kind,C.message)})}})}catch(T){let C=T instanceof Error?T:Error(String(T));if(K.log(C,{filePath:E,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${E}: ${C.message}`),p)t.push({...D,markup:Cr(E,"unknown",C.message)})}}if(t.length===0)return r;let w=r;for(let y of t.sort((v,x)=>x.index-v.index))w=w.slice(0,y.index)+y.markup+w.slice(y.index+y.length);return w}async function Ss(r,e,l){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-3xpnw4s1.js"));return a(r,e,{skipServer:!0})}catch(a){let h=a instanceof Error?a:Error(String(a));return K.log(h,{filePath:l,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${l}: ${h.message}`),r}}async function Rr(r,e,l,a,h){let t=r;await R();let p=a;if(t=await xs(t,e,l,a),t=await zt(t,e,l),t=await Kt(t,e,l),t=await Ss(t,e,l),await R(),t=await Nt(t,e,l,p),Ne(t))t=fi(t,e),t=Ns(t,e),t=Os(t,e);t=gi(t),await R();let{processStreamDirectives:w}=await o("stx/streaming",()=>import("./chunk-xhb89sf5.js"));t=w(t,e),t=await ci(t,e,l,p,!0),await R(),t=await ur(t,e,l,p,h),t=await Rs(t,e,l,p,h),await R(),t=Bc(t,e,l,p);let{processDeferDirectives:y}=await o("stx/defer",()=>import("./chunk-k2fw6paw.js"));t=y(t,e,l);let{processTeleportDirectives:v}=await o("stx/teleport",()=>import("./chunk-qzx6h6af.js"));t=v(t,e,l);let{processTransitionDirectives:x,processTransitionAttributes:k}=await o("stx/transitions",()=>import("./chunk-726w7fm2.js"));t=x(t,e,l),t=k(t);let{processErrorBoundaryDirectives:_,stripRenderFailedMarkers:E}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));t=_(t,e,l),t=E(t);let{processSuspenseDirectives:D}=await o("stx/suspense",()=>import("./chunk-cp82351f.js"));t=D(t,e,l);let{processAsyncDirectives:T}=await o("stx/async-components",()=>import("./chunk-tgwwa872.js"));t=T(t,e,l);let{processKeepAliveDirectives:C}=await o("stx/keep-alive",()=>import("./chunk-81qvg3yd.js"));t=C(t,e,l);let{processVirtualListDirectives:N,processVirtualGridDirectives:q,processInfiniteListDirectives:U}=await o("stx/virtual-scrolling",()=>import("./chunk-fznzn35q.js"));t=N(t,e,l),t=q(t,e,l),t=U(t,e,l),await R();let{processPartialHydrationDirectives:V,processStaticDirectives:H}=await o("stx/partial-hydration",()=>import("./chunk-km1k3c4e.js"));t=V(t,e,l),t=H(t);let{processComputedDirectives:B,processWatchDirectives:F}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));t=B(t,e,l),t=F(t,e,l);let{processFormValidationDirectives:J}=await o("stx/forms-validation",()=>import("./chunk-nfddhtkd.js"));t=J(t,e,l);let{processHeadDirective:de,processTitleDirective:G,processMetaDirective:pe,resetHead:ue}=await o("stx/head",()=>import("./chunk-7rn7w53f.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)ue();let ne=de(t);if(t=ne.content,ne.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${ne.headContent}
|
|
1373
1373
|
`;if(t=G(t,e),t=pe(t,e,l),t=rr(t),t=li(t,e),t=jt(t),t=Qt(t),t=await Cs(t,e,l,p,h),t=await Rs(t,e,l,p,h),await R(),t=t.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),t=Bi(t),t=ge(t,e,l),t=As(t),await R(),e.__stxProcessingDepth===1)t=bl(t,e);if(t=pl(t,e,{filePath:l,buildMode:p.buildMode}),t=ui(t,e),t=di(t,e),t=et(t,e),t=Wt(t,e),t=Xt(t,e),t=await Ct(t,e,l,p),t=await zc(t,e,l),t=await Vc(t,e,l,p),await R(),t=Uc(t,e,l,p),t=xi(t,e,l,p),t=Si(t,e,l),t=ki(t,e,l,p),t=Ot(t,e,l,p),t=ao(t,e),t=co(t),t=gl(t),!p.skipEventDirectives)t=nl(t,e,l);if(t=fl(t,e,l,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await R(),p.debug){let X=/\bx-data\s*=/.test(t),z=Is(r);if(X&&z)console.warn(`[stx] ${l}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
1374
1374
|
Both work on the same page, but they manage separate scopes.
|
|
1375
1375
|
Prefer signals (state/derived/effect) for new components.`)}t=Nc(t,e),t=await qi(t,e,l),await R(),t=ml(t),t=hl(t),t=$t(t);let{processXElementDirectives:ve}=await o("stx/x-element",()=>import("./chunk-2sz1kh9m.js"));t=ve(t);let me=e.__originalFilePath||l,ie=Ke(e);if(t=await mi(t,p,me,ie),await R(),t=Ft(t,e),t=await tr(t,e,l,p),await R(),p.media?.image?.autoSiblings){let X=p.publicDir||"public",{rewriteImagesWithSiblings:z}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-1pbghytr.js"));t=await z(t,{publicDir:X})}if(p.seo?.enabled)t=_i(t,e,p);let Q=(X,z,ee=!0)=>{if(!z)return X;let be=z.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),oe=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(X),he=oe?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(oe[0]):null;if(be&&oe&&he){if(ee){let Ie=oe.index+he.index;X=X.slice(0,Ie)+be[0]+X.slice(Ie+he[0].length)}if(z=z.replace(be[0],"").trim(),!z)return X}if(/<\/head>/i.test(X))return f(X,z);if(/<head\b[^>]*>/i.test(X))return X.replace(/(<head\b[^>]*>)/i,`$1
|
|
@@ -1381,6 +1381,6 @@ ${St()}
|
|
|
1381
1381
|
</script>`;if(t.includes("</head>")){let ee=L(t),oe=t.slice(0,ee).indexOf("<script");if(oe!==-1){let he=t.slice(0,oe),Ie=t.slice(oe);t=he+z+`
|
|
1382
1382
|
`+Ie}else t=f(t,z)}else if(t.includes("<body"))t=t.replace(/<body([^>]*)>/,`<body$1>
|
|
1383
1383
|
${z}`);else t=z+`
|
|
1384
|
-
`+t}{let{scanScriptTags:X}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1384
|
+
`+t}{let{scanScriptTags:X}=await o("stx/signal-processing",()=>import("./chunk-3mr0kx0h.js")),z=[];for(let ee of X(t)){if(!/\bserver\b/i.test(ee.attrs))continue;let be=ee.start+ee.fullMatch.indexOf(">")+1,oe=Dr(t,be);if(oe===-1)continue;let he=oe+9;while(he<t.length&&/\s/.test(t[he]))he++;z.push({start:ee.start,end:he})}if(z.length>0){let ee=Array(z.length+1),be=0;for(let oe=0;oe<z.length;oe++){let{start:he,end:Ie}=z[oe];ee[oe]=t.slice(be,he),be=Ie}ee[z.length]=t.slice(be),t=ee.join("")}}let yt=oo(t,l);if(yt.hasScoped)t=yt.html;let jr=e.__stx_event_bindings||[],rt=!1,bt=[],Nr=/\s:[a-z][\w.-]*\s*=/.test(t),{scanScriptTags:Hr}=await o("stx/signal-processing",()=>import("./chunk-3mr0kx0h.js"));for(let X of Hr(t,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))bt.push({match:X.fullMatch,attrs:X.attrs,content:X.body});for(let{match:X,attrs:z,content:ee}of bt){rt=!0;let be=ee;We(ee,l,a.strict,e.__originalFilePath);let oe=await Ge(ee,{eventBindings:jr,attrs:z,hasColonDirectives:Nr,templateContent:r,filePath:l,projectRoot:process.cwd(),production:ta(a.buildMode,a.minifyClient),serverData:ie});t=t.replace(X,()=>oe)}if(rt)e.__stx_event_bindings=[];if(!rt&&e.__stxProcessingDepth===1){let X=e.__stx_event_bindings||[];if(X.length>0){let z=Pi(X);if(z){let ee=c(t);t=ee===-1?t+z:t.slice(0,ee)+z+`
|
|
1385
1385
|
`+t.slice(ee)}e.__stx_event_bindings=[]}}if(!p.skipSignalsRuntime&&!Re(t)&&Dc(t))t=await _r(t,p);if(t=Lc(t),p.csp?.enabled&&p.csp.useNonce&&typeof e.cspNonce==="string")t=It(t,e.cspNonce);return t}
|
|
1386
1386
|
export{Pt,He,Ac,_s,ni,ri,yr,i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{yu,Km,bu,wu,Gm,Xm}from"./chunk-
|
|
2
|
+
import{yu,Km,bu,wu,Gm,Xm}from"./chunk-q72z9ask.js";import"./chunk-16edtncx.js";import"./chunk-vaxxe2db.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{Xm as applySlots,Gm as extractSlotContent,Km as parseSlotElement,yu as parseSlots,wu as processSlots,bu as renderSlot};
|