@stacksjs/stx 0.2.884 → 0.2.885
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-rw5sxr5a.js → chunk-0gkxqcpj.js} +1 -1
- package/dist/chunk-1dhdt31n.js +2 -0
- package/dist/chunk-2mn0w25t.js +2 -0
- package/dist/chunk-2mxqchs1.js +2 -0
- package/dist/{chunk-be201zh7.js → chunk-2n2102vf.js} +5 -5
- package/dist/{chunk-d80re6y8.js → chunk-2v0pcxqs.js} +4 -4
- package/dist/{chunk-5kh07k1p.js → chunk-46cghgdm.js} +2 -2
- package/dist/chunk-4mw05zhy.js +2 -0
- package/dist/{chunk-pxt57028.js → chunk-4n1ywp14.js} +1 -1
- package/dist/{chunk-we9k6vtw.js → chunk-4ryy2m8q.js} +3 -3
- package/dist/{chunk-pw2bfb6k.js → chunk-5mmgdpjr.js} +6 -6
- package/dist/{chunk-hd6hc981.js → chunk-5p6xtzkk.js} +1 -1
- package/dist/{chunk-jyyyzazb.js → chunk-5xhaabn0.js} +1 -1
- package/dist/{chunk-vh1sewja.js → chunk-63y8exx2.js} +1 -1
- package/dist/chunk-6cbxs47h.js +2 -0
- package/dist/chunk-6gyy25fz.js +2 -0
- package/dist/{chunk-kg7w5xwh.js → chunk-6nvm1dgn.js} +1 -1
- package/dist/{chunk-k06xctna.js → chunk-72qdbhfh.js} +1 -1
- package/dist/{chunk-swwn1pa7.js → chunk-7dtfkf1b.js} +1 -1
- package/dist/{chunk-tvhm8t45.js → chunk-84xnev80.js} +1 -1
- package/dist/{chunk-yv1w9dqr.js → chunk-8an1mp1z.js} +4 -4
- package/dist/chunk-8hbzej4h.js +2 -0
- package/dist/chunk-8qkmgxkn.js +2 -0
- package/dist/chunk-8xh4ek56.js +182 -0
- package/dist/{chunk-bnawaxh5.js → chunk-9cgwe3tb.js} +1 -1
- package/dist/{chunk-twhahqbd.js → chunk-aw6m1t68.js} +6 -6
- package/dist/{chunk-nb6erf75.js → chunk-c47stwqj.js} +1 -1
- package/dist/{chunk-n4d7qk9w.js → chunk-c8pdjhxm.js} +1 -1
- package/dist/{chunk-2bvms1pz.js → chunk-ce1d71m1.js} +2 -2
- package/dist/{chunk-xs8fccfq.js → chunk-charhv8y.js} +1 -1
- package/dist/{chunk-sb1e0rd8.js → chunk-css5czqk.js} +1 -1
- package/dist/{chunk-8t8yzdzq.js → chunk-d9hsqh1w.js} +1 -1
- package/dist/chunk-e2d34r31.js +2 -0
- package/dist/{chunk-q8dkdnvg.js → chunk-eebxdb5z.js} +1 -1
- package/dist/chunk-eg3sxm03.js +2 -0
- package/dist/chunk-fdzpphww.js +2 -0
- package/dist/{chunk-4fkcn6z5.js → chunk-fg67643b.js} +1 -1
- package/dist/{chunk-z9cz0vxm.js → chunk-j5a3yrcf.js} +1 -1
- package/dist/{chunk-q910pjr4.js → chunk-jbv448x5.js} +1 -1
- package/dist/chunk-k3s16azh.js +2 -0
- package/dist/{chunk-rcjkms52.js → chunk-kk92sv04.js} +5 -5
- package/dist/chunk-kpkjb7hy.js +2 -0
- package/dist/{chunk-a60ztvnp.js → chunk-kwf3kfr0.js} +1 -1
- package/dist/{chunk-0c913abf.js → chunk-m321yrb2.js} +1 -1
- package/dist/{chunk-v5zm24gy.js → chunk-m4f13mrp.js} +1 -1
- package/dist/{chunk-gn2x58yq.js → chunk-mejhzan9.js} +1 -1
- package/dist/{chunk-gksn30x7.js → chunk-mrjr0vtb.js} +21 -20
- package/dist/{chunk-00tq7ghn.js → chunk-n22xtagg.js} +2 -2
- package/dist/{chunk-4qzytgtg.js → chunk-n63z5hbk.js} +3 -3
- package/dist/{chunk-n2nxpgzc.js → chunk-nxbws5qm.js} +4 -4
- package/dist/{chunk-mdb4pvv9.js → chunk-p0rpdj1w.js} +1 -1
- package/dist/{chunk-rzq0s8k3.js → chunk-p6e48m6t.js} +1 -1
- package/dist/{chunk-rptq6d7b.js → chunk-p6yavy8h.js} +3 -3
- package/dist/{chunk-rcxer2km.js → chunk-pc8dt8xs.js} +1 -1
- package/dist/{chunk-rqbqxs01.js → chunk-pk3pp1j5.js} +1 -1
- package/dist/chunk-qtbbc0h2.js +3 -0
- package/dist/chunk-qw6cyy5j.js +2 -0
- package/dist/{chunk-7xc81f1w.js → chunk-rtehrddv.js} +2 -2
- package/dist/{chunk-szwde015.js → chunk-t4v7pjnh.js} +1 -1
- package/dist/{chunk-2nt2wjb2.js → chunk-tng16znx.js} +1 -1
- package/dist/chunk-tzvapd0t.js +2 -0
- package/dist/{chunk-6ha9vbjv.js → chunk-v9wt6jx2.js} +2 -2
- package/dist/{chunk-ntk07yeh.js → chunk-wh8yhpyh.js} +4 -4
- package/dist/chunk-wkcx67x4.js +2 -0
- package/dist/{chunk-19q3j7cd.js → chunk-ws3wfpy9.js} +1 -1
- package/dist/{chunk-0q117rw8.js → chunk-xfxcchpt.js} +1 -1
- package/dist/chunk-xwwp2ftx.js +2 -0
- package/dist/{chunk-7vggqc7d.js → chunk-y3v0r845.js} +10 -10
- package/dist/{chunk-rx94z3d5.js → chunk-z2mvdnce.js} +1 -1
- package/dist/chunk-z5n2sjg2.js +2 -0
- package/dist/{chunk-yh2hnt3m.js → chunk-zpj6ggee.js} +2 -2
- package/dist/cli.js +9 -9
- package/dist/component-library.js +5 -2
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/native/compiler/bundle.js +19 -1
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +6 -6
- package/dist/types/component-types.d.ts +2 -0
- package/package.json +5 -5
- package/dist/chunk-188st53m.js +0 -2
- package/dist/chunk-3t0pf47w.js +0 -2
- package/dist/chunk-5a73eghg.js +0 -2
- package/dist/chunk-5fn9s4e7.js +0 -2
- package/dist/chunk-bx301nnn.js +0 -2
- package/dist/chunk-ccv21bj8.js +0 -2
- package/dist/chunk-egmkawq6.js +0 -2
- package/dist/chunk-fa3syk1m.js +0 -3
- package/dist/chunk-fzxynhyc.js +0 -2
- package/dist/chunk-gg4vcn6m.js +0 -2
- package/dist/chunk-h573cegy.js +0 -2
- package/dist/chunk-j5gcwg3k.js +0 -2
- package/dist/chunk-mcc01ts7.js +0 -2
- package/dist/chunk-nsa675xs.js +0 -2
- package/dist/chunk-pzm31te2.js +0 -2
- package/dist/chunk-s7c1f3h4.js +0 -2
- package/dist/chunk-se4xbbh5.js +0 -2
- package/dist/chunk-t25pwp2a.js +0 -177
- package/dist/chunk-vc3sz26f.js +0 -2
- package/dist/chunk-wkgzyjyv.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function Kr(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Kr(i,n,r+1,o))return!0}return!1}var
|
|
3
|
-
export{Kr,
|
|
2
|
+
import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function Kr(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Kr(i,n,r+1,o))return!0}return!1}var _=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useBroadcastStream","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],Ll=["onMount","onDestroy"];function wt(e="const",t=[],r){let o=t.length?_.filter((s)=>!t.includes(s)):_;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var y=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=_.filter((e)=>!y.includes(e));function Qi(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],E=/\s@[a-z][\w.:-]*\s*=/i;function jl(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(Qi(e))return!0;return T(e,t)}function T(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(Kr(r[1],t))return!0;return!1}function Bl(e,t){if(!e)return!1;let r=f(e);return E.test(r)||d(r,t)}var R=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function Fl(e){return R.includes(e.toLowerCase())}var ho=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],w=["x-init","x-transition","x-effect","x-on"],zl=[...ho,...w];function Hl(){return`{${ho.map((e)=>`'${e}':1`).join(",")}}`}var ea=["class","style","text","html","show","model","if","ref"];function Vl(){return`{${ea.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function Ul(){return`/^(${p.join("|")})(?:\\.|$)/`}function Wl(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var A=65536,N=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=A;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=N){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
|
|
3
|
+
export{Kr,_,Ll,wt,Qi,jl,Bl,Fl,ho,zl,Hl,ea,Vl,Ul,Wl};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Z}from"./chunk-
|
|
3
|
-
`)}async function gm(d,g={}){if(d.length===0)return null;let l=process.cwd(),e=k(d,l,g.names),n;try{let{bundleClientScript:f}=await import("./chunk-
|
|
2
|
+
import{Z}from"./chunk-c47stwqj.js";import R from"path";var B=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function Yr(...d){let g=new Set;for(let l of d){if(!l||!l.includes("__stxModules["))continue;for(let e of l.matchAll(B))try{g.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...g].sort()}function So(...d){let g=new Map,l=(e,n)=>{let o=g.get(e);if(o===null)return;if(n===null){g.set(e,null);return}let s=o??new Set;for(let i of n)s.add(i);g.set(e,s)};for(let e of d){if(!e||!e.includes("__stxModules["))continue;let n=[];for(let s of e.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${s[2]}"`)}catch{continue}n.push({variable:s[1],id:i,start:s.index+s[0].length,end:e.length})}let o=e.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(n.length===0||o!==n.length){for(let s of Yr(e))l(s,null);continue}for(let[s,i]of n.entries()){let p=n.slice(s+1).find((h)=>h.variable===i.variable);i.end=p?p.start:e.length}for(let s of n){let i=new Set,p=!1,h=s.variable.replace(/[$]/g,"\\$&"),r=e.slice(s.start,s.end);for(let a of r.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=r.slice(a.index+s.variable.length,a.index+s.variable.length+200),c=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(c){i.add(c[c.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}l(s.id,p?null:i)}}return g}function k(d,g,l){let e=[],n=[];return d.forEach((o,s)=>{let i=o.startsWith("npm:")?o.slice(4):R.resolve(g,o),p=`__stxRegistered${s}`,h=JSON.stringify(o),r=l?.get(o);if(r&&[...r].every((a)=>/^[A-Za-z_$][\w$]*$/.test(a))){let a=[...r].sort(),f=a.map((m,_)=>`${m} as ${p}_${_}`);e.push(a.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let c=a.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");n.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${c} };`);return}e.push(`import * as ${p} from ${JSON.stringify(i)};`),n.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...n].join(`
|
|
3
|
+
`)}async function gm(d,g={}){if(d.length===0)return null;let l=process.cwd(),e=k(d,l,g.names),n;try{let{bundleClientScript:f}=await import("./chunk-72qdbhfh.js"),c=()=>f(e,R.join(l,".stx-module-registry.ts"),{projectRoot:l,minify:g.minify,externalizeUserModules:!1,collectInputs:g.collectInputs,throwOnFailure:!0});try{n=await c()}catch(m){if(!g.names)throw m;e=k(d,l,void 0),n=await c()}}catch(f){let{formatBuildFailure:c}=await import("./chunk-qg1kw5yf.js"),m=c(f);console.warn(`[stx] could not build the page module registry (#1957): ${m}`);let _=`[stx] the page module registry did not build, so ${d.join(", ")} cannot load (#1957): ${m}`;return`;console.error(${JSON.stringify(_)});`}let{transformAutoImports:o,generateAutoImportDestructuring:s}=await import("./chunk-eebxdb5z.js"),i=o(n),p=s(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-aqxh80vh.js");n=h(i.code);let r=JSON.stringify(new Bun.CryptoHasher("md5").update(e).digest("hex").slice(0,12)),a=Z(n);return[a?";await (async function() {":";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${r}]) { ${a?"await __stxBundles["+r+"];":""} return; }`,a?`var __resolveBundle, __rejectBundle;
|
|
4
4
|
__stxBundles[${r}]=new Promise(function(resolve,reject){__resolveBundle=resolve;__rejectBundle=reject;});
|
|
5
5
|
__stxBundles[${r}].catch(function(){});
|
|
6
6
|
try {`:`__stxBundles[${r}] = true;`,p,n,a?`__resolveBundle();
|
|
7
7
|
} catch(error) { delete __stxBundles[${r}]; __rejectBundle(error); throw error; }`:"","})();"].join(`
|
|
8
8
|
`)}var j=/^import(?:[ \t]*(\{[^}]*\})[ \t]*from|[ \t]*\*[ \t]*as[ \t]+([\w$]+)[ \t]+from)?[ \t]*["']\.\/(chunk-[\w-]+)\.js["'][ \t]*;?[ \t]*$/gm,O=/^export\s*\{([^}]*)\}\s*;?[ \t]*$/gm,I=new Set(["__preload","__chunks"]),N=/^("[^"]*"|[\w$]+)(?:\s+as\s+("[^"]*"|[\w$]+))?$/;function P(d){let g=[],l=[],e=!0,o=d.replace(/^var __chunkGraphs;[\s\S]*?^var __chunks = [\s\S]*?^\};[ \t]*\n?/m,"").replace(/^__chunks\(import\.meta\.url,[^\n]*\);[ \t]*\n?/gm,"").replace(j,(h,r,a,f)=>{let c=`__stxChunkExports${g.length}`;if(g.push(f),l.push(`var ${c} = __stxChunk(${JSON.stringify(f)});`),a)l.push(`var ${a} = ${c};`);else if(r)for(let m of r.slice(1,-1).split(",")){let _=m.trim();if(!_)continue;let w=N.exec(_);if(!w){e=!1;continue}if(I.has(w[1]))continue;let M=w[1].startsWith('"')?JSON.parse(w[1]):w[1],t=w[2]??w[1];if(t.startsWith('"')){e=!1;continue}l.push(`var ${t} = ${c}[${JSON.stringify(M)}];`)}return""});if(!e)throw Error("an import it does not read");let s=[];o=o.replace(/\(\s*__preload\([^)]*\)\s*,\s*import\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)\s*\)|\bimport\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)/g,(h,r,a)=>{let f=r??a;return s.push(f),`Promise.resolve().then(function () { return __stxChunk(${JSON.stringify(f)}); })`});let i=[];o=o.replace(O,(h,r)=>{for(let a of r.split(",")){let f=a.trim();if(!f)continue;let c=N.exec(f);if(!c||c[1].startsWith('"')){e=!1;continue}if(I.has(c[1]))continue;let m=c[2]??c[1];i.push([c[1],m.startsWith('"')?JSON.parse(m):m])}return""});let p=[/\bimport\.meta\b/,/\b__chunks\b/,/\b__preload\b/,/^\s*export\s+(?:default\b|const\b|let\b|var\b|function\b|class\b|async\b|\*|\{)/m,/\bfrom\s*["']\.\/chunk-/,/^\s*import\s*["']\.\/chunk-/m].find((h)=>h.test(o));if(!e||p)throw Error(`${p?`${p.source} is left in it`:"an export it does not read"}`);return{reads:l.join(`
|
|
9
9
|
`),chunks:g,lazy:s,body:o,exports:i}}function Zl(d){if(/\bexport\s+(?:let|var)\b/.test(d))return!0;if(d.length/Math.max(1,d.split(`
|
|
10
|
-
`).length)>200)return!1;for(let g of d.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let l of g[1].split(",")){let e=l.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(e))continue;let n=e.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${n}(?![\\w$])`,"g").test(d))continue;let s=new RegExp(`(?<![\\w$.])${n}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${n}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${n}\\s*=`,"g");if((d.match(s)?.length??0)>(d.match(i)?.length??0))return!0}return!1}async function ko(d,g={}){let l=d.filter((n)=>n.ids.length>0);if(l.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let e=process.cwd();try{let{bundleClientEntriesSplit:n}=await import("./chunk-
|
|
10
|
+
`).length)>200)return!1;for(let g of d.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let l of g[1].split(",")){let e=l.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(e))continue;let n=e.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${n}(?![\\w$])`,"g").test(d))continue;let s=new RegExp(`(?<![\\w$.])${n}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${n}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${n}\\s*=`,"g");if((d.match(s)?.length??0)>(d.match(i)?.length??0))return!0}return!1}async function ko(d,g={}){let l=d.filter((n)=>n.ids.length>0);if(l.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let e=process.cwd();try{let{bundleClientEntriesSplit:n}=await import("./chunk-72qdbhfh.js"),o=[],s=await n(new Map(l.map((t)=>[t.name,k(t.ids,e,t.names)])),{projectRoot:e,filePath:R.join(e,".stx-module-registry.ts"),collectInputs:o});g.collectInputs?.push(...o);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-eebxdb5z.js"),{transformStoreImports:h}=await import("./chunk-aqxh80vh.js"),r=new Map;for(let[t,u]of[...s.chunks,...s.entries])try{r.set(t,P(u))}catch(x){throw Error(`cannot read ${t}: ${x instanceof Error?x.message:String(x)}`)}for(let[t,u]of[...s.chunks,...s.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of o)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&Zl(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let a=new Set,f=new Set,c=(t)=>{if(f.has(t))return;if(a.has(t))throw Error(`the chunks import each other (${t})`);a.add(t);for(let u of r.get(t)?.chunks??[]){if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);c(u)}for(let u of r.get(t)?.lazy??[])if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);a.delete(t),f.add(t)};for(let t of r.keys())c(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of s.chunks.keys()){let u=r.get(t),{prelude:x,body:v}=m(u),b=u.exports.map(([S,y])=>`get ${JSON.stringify(y)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
|
|
11
11
|
${x}
|
|
12
12
|
${u.reads}
|
|
13
13
|
${v}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qt,ye,R}from"./chunk-s29hp1qw.js";import{Ti,Qc,o,A,Ue,Pe,_n,We,xe,re,Ir,J,En,to,ll,ul,$n,Lr,ro,so,dl,Mi,pl,fl,gl,ml,qe,Ke,oo,Je,s,An,y,g,Y,ie,Oe,P,Hi}from"./chunk-
|
|
2
|
+
import{Qt,ye,R}from"./chunk-s29hp1qw.js";import{Ti,Qc,o,A,Ue,Pe,_n,We,xe,re,Ir,J,En,to,ll,ul,$n,Lr,ro,so,dl,Mi,pl,fl,gl,ml,qe,Ke,oo,Je,s,An,y,g,Y,ie,Oe,P,Hi}from"./chunk-mrjr0vtb.js";import{d,m,N,n,ae,ee,u,Ne,qi,q,Mn,Ki,Yt,Gi,$l,zr,Rl,bt,Al,Hr,Pl,Dn,Xi,Il,Vr,Wr,Me,Ji}from"./chunk-295bykzd.js";import{Gt}from"./chunk-6t04tqvh.js";import{On}from"./chunk-pk3pp1j5.js";import{x}from"./chunk-kk92sv04.js";import{Tr,Us}from"./chunk-agd2b928.js";import{Dc,Lc,_r,ut,jc,L}from"./chunk-ce1d71m1.js";import{yi,bi,wi,vi}from"./chunk-0rdh8bw3.js";import{Pc,Cs}from"./chunk-d9hsqh1w.js";import{xs,Ss,ks}from"./chunk-8an1mp1z.js";import{$s,li,ui,Rs,As,di}from"./chunk-v9wt6jx2.js";import{Es,si}from"./chunk-charhv8y.js";import{ei}from"./chunk-c0g30cjs.js";import{fe,oi,ii,ai}from"./chunk-d2pexm3z.js";import{vr,Te,Oc,xr,Nc}from"./chunk-2v0pcxqs.js";import{U,ct}from"./chunk-care745q.js";import{Z}from"./chunk-c47stwqj.js";import{Fc,zc}from"./chunk-css5czqk.js";import{I,Ln,Yi}from"./chunk-ws2h92mm.js";import{Bn}from"./chunk-zpj6ggee.js";import{D,c,f}from"./chunk-xpbakn6t.js";function Ge(r){return/\bimport\s*\.\s*meta\b/.test(Bn(r))}function Fr(r){let e=Pe(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 vt(r){let e=Fr(r);if(e.some((b)=>J(b.attrs).has("data-stx-module-bootstrap")))return r;let l=(b)=>{if(Ge(b))return!0;try{return Z(b)}catch{return!1}};if(!e.some((b)=>l(b.body)||J(b.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 b of e){let S=J(b.attrs),v=S.get("type");if(b.inert||S.has("data-stx-module-job")||S.has("data-stx-runtime")||S.has("data-stx-router"))continue;if(typeof v==="string"&&!["module","text/javascript","application/javascript"].includes(v.toLowerCase()))continue;if(![...S.keys()].some((T)=>/^data-stx-(?:scoped|modules|stores|(?:framework-)?composables)$/.test(T)))continue;let _=v==="module"||l(b.body);if(_)p=!0;if(!p)continue;if(!_&&(S.has("data-stx-owner")||S.has("data-stx-instance")))continue;h+=r.slice(t,b.start);let E=b.body,M=S.get("src");if(typeof M==="string")S.delete("src"),S.set("data-stx-source-url",M),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';":""}
|
|
@@ -1350,7 +1350,7 @@ ${C}
|
|
|
1350
1350
|
</style>`;a=a.replace(S,O),w.lastIndex=0}catch(C){}}}return a}import gt from"path";var ts=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,rs=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function ns(r,e){if(!e||!r.includes("/"))return r;let l=gt.dirname(e);return r.replace(ts,(a,h,t,p)=>{let w=gt.resolve(l,p);return`${h}${t}${w.split(gt.sep).join("/")}${t}`})}function br(r,e){if(!e||!r.includes("<script"))return r;return r.replace(rs,(l,a,h,t)=>`${a}${ns(h,e)}${t}`)}var Re="<!--PARENT_CONTENT_PLACEHOLDER-->";function wr(r){return r.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Mr(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(`
|
|
1351
1351
|
`,a+2),a===-1)return-1;a+=1,h=!0;continue}if(w==="/"&&r[a+1]==="*"){let b=r.indexOf("*/",a+2);if(b===-1)return-1;a=b+2,h=!0;continue}if(w==="/"&&h){let b=a+1,S=!1;while(b<l){let v=r[b];if(v==="\\"){b+=2;continue}if(v==="[")S=!0;else if(v==="]")S=!1;else if(v==="/"&&!S){b++;break}else if(v===`
|
|
1352
1352
|
`){b=-1;break}b++}if(b===-1){a++,h=!1;continue}while(b<l&&/[a-z]/.test(r[b]))b++;a=b,h=!1;continue}if(w==="'"||w==='"'){let b=w;a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]===b){a++;break}if(r[a]===`
|
|
1353
|
-
`)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 Rr(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 is=4096;async function mt(r,e,l){if(Ge(e)||Z(e)||l.buildMode!=="serve"||e.length<is)return null;let{registerServeModuleBundle:a}=await import("./chunk-
|
|
1353
|
+
`)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 Rr(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 is=4096;async function mt(r,e,l){if(Ge(e)||Z(e)||l.buildMode!=="serve"||e.length<is)return null;let{registerServeModuleBundle:a}=await import("./chunk-xfxcchpt.js");return`<script ${r} src="${a(e)}"></script>`}async function gr(r,e,l,a){try{let{registeredModuleIdsIn:h,buildModuleRegistryScript:t}=await o("stx/client-module-registry",()=>import("./chunk-c8pdjhxm.js")),p=[],w=await t(h(...r),{minify:Yi(e.buildMode,e.minifyClient),collectInputs:p});for(let b of p)l?.add(b);if(a)a.inputs=p,a.code=w??void 0;if(!w)return null;if(e.buildMode==="serve"&&!Ge(w)&&!Z(w)){let{registerServeModuleBundle:b}=await import("./chunk-xfxcchpt.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${b(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 os(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-4ryy2m8q.js"));h.frameworkScript=await _(r)}catch{}let t=null;try{t=await o("stx/store-loader",()=>import("./chunk-2mn0w25t.js"))}catch{}let p=e.storesDir,w=!!a.__stx_native_screen||(t?.pageStoresAll()??!0),b=w?"":r.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),S=[],v=[],k=null;for(let _=0;_<8;_++){let E=null,M="",T=!1;try{if(t){let F=w?await t.getStoreScript(p).then((W)=>W?{code:W,stores:["*"],functions:null}:null):await t.getStoreScriptFor(p,[b],{reads:t.storesReadInFiles([...S,...v]),runOnce:!0});if(F)E=F.code,M=F.stores.join(","),T=!!F.functions&&!w}}catch{}if(k!==null&&M===k)break;k=M;let C=T?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",O=E?`<script ${C}>${E}</script>`:null;h.storeCode=E,h.storeTag=E?await mt(C,E,e)??O:null;let B={};h.modulesTag=await gr([r,O],e,l,B),h.modulesCode=B.code??null,S=B.inputs??[],h.composableTag=null,h.composableCode=null,v=[];try{let{getComposableScript:F}=await o("stx/composable-loader",()=>import("./chunk-8qkmgxkn.js")),W=e.composablesDir,j=[h.modulesCode??h.modulesTag,O,h.frameworkScript].filter((V)=>V!==null),H=await F(e._layerComposableDirs??W,r,j,v);if(H)h.composableCode=H,h.composableTag=await mt('data-stx-scoped data-stx-run="always" data-stx-composables',H,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${H.replace(/<\/script/gi,"<\\/script")}</script>`}catch{}if(w||!t)break}return h}async function as(r,e,l,a={}){let{withModuleSubstitutes:h,moduleSubstitutionKey:t}=await import("./chunk-72qdbhfh.js"),p=await import("./chunk-7kqgp3p7.js"),{messages:w,webModules:b}=e,S=null,v=null,k=t()===""&&!a.__stx_native_screen;if(w&&p.pageMessagesEnabled(e)&&k)try{S=await p.loadPageMessages(process.cwd(),w)}catch(C){cs(C)}if(b&&Object.keys(b).length&&k)try{v=await(await import("./chunk-3sema2js.js")).loadWebModules(process.cwd(),b)}catch(C){ls(C)}let _=new Map([...v??[],...S?.stubs??[]]),E=()=>os(r,e,l,a),M=_.size?await h(_,E):await E(),T=null;if(S){let C=p.messageAreasIn(M.modulesCode,M.storeCode,M.composableCode),O=p.pageMessagesScript(S,p.pageLanguages(r,S),C);if(O)T=await mt('data-stx-scoped data-stx-run="always" data-stx-messages',O,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${O.replace(/<\/script/gi,"<\\/script")}</script>`}return[T,M.modulesTag,M.storeTag,M.composableTag,M.frameworkScript].filter((C)=>C!==null)}var Sr=!1;function cs(r){if(Sr)return;Sr=!0,console.warn(`[stx] messages: ${r instanceof Error?r.message:String(r)}; pages ship every language`)}var kr=!1;function ls(r){if(kr)return;kr=!0,console.warn(`[stx] ${r instanceof Error?r.message:String(r)}; pages bundle the real modules`)}function us(r,e=""){let l=Rr(r,"data-stx-runtime");if(!l)return r;let a=vr(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+`
|
|
1354
1354
|
`+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=vr(t);if(p===-1)return h+e+`
|
|
1355
1355
|
`+t;return t.slice(0,p)+h+e+`
|
|
1356
1356
|
`+t.slice(p)}function ds(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=Oe(r,l);let t=!e.__stxProcessingDepth;$n(e);for(let p of a._layerGraph?.configDependencies??[])h.add(p);if(t&&a.runtimeConfig)await On(e,l,a.runtimeConfig);if(t)gl(e),e.__stx_scope_seq??={n:0,key:oo(String(e.__filename??l))},e.__stx_head_injections=Gi(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!I()&&!Ln())&&l&&l.endsWith(".stx"))ei(r,l);try{return await ye.timeAsync("template-processing",async()=>{let p=await ps(r,e,l,a,h);if(t)p=Mi(p);if(t&&a.autoShell&&a.buildMode!=="compile"){let w=Me(a.app?.head,{known:Wr,source:"app.head"}),S=(e.__stx_runtime_head||null)??Ji(),v=(e.__stx_head_raw||"").trim(),k,_=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(_)k=_[1].trim(),v=v.replace(_[0],"").trim();let E=e.__sections?.title,M=E?P(E,e,l):void 0,T=S.title||k||M,C=!S.title&&(!!k||!!M),O=S.meta||[],B=new Set(O.map((K)=>bt(K)).filter(Boolean)),F={...w,...T&&{title:T},meta:[...(w.meta||[]).filter((K)=>!B.has(bt(K))),...O],link:[...w.link||[],...S.link||[]],script:[...w.script||[],...S.script||[]],headRaw:[w.headRaw,v].filter(Boolean).join(`
|
|
@@ -1365,7 +1365,7 @@ ${b.trim()}
|
|
|
1365
1365
|
@endsection`}}if(O&&b.includes("<script")){let j=re(b),H=j.scripts.map((V)=>$r(V,l)??V);b=Ir(j.output,H)}if(b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(j,H,V)=>(C[H]=V,"")),b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(j,H,V)=>{if(/^(['"]).*\1$/.test(V.trim()))return j;try{let K=d(V.trim(),e);if(K===void 0)return j;let G=(e.__stx_inline_section_values??=[]).push(K)-1;return C[H]=`{{ __stx_inline_section_values[${G}] }}`,""}catch{return j}}),b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(j,H,V)=>{if(V.includes("@parent"))C[H]=V.replace("@parent",Re);else C[H]=V.trim();return""}),e.__sections=C,b=b.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(j,H,V)=>C[H]||V||""),!("slot"in e)||e.slot===void 0)b=b.replace(/\{\{\s*slot\s*\}\}/g,()=>C.content||"");if(b=ks(b,T),O){let j=[],H=re(b),V=xe(H.output,_n,(K,de)=>`\x00STX_ORPHAN_STYLE_${de}\x00`);if(b=V.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(K,de,G)=>{let pe=de==="SCRIPT"?$r(H.scripts[Number(G)],l):V.tokens[Number(G)];if(pe)j.push(pe);return""}),j.length>0){let K=j.join(`
|
|
1366
1366
|
`);C.content=C.content?`${C.content}
|
|
1367
1367
|
${K}`:K,e.__sections=C}}if(O)try{let j;if(le.isAbsolute(O))j=O,h.add(O);else j=await Ne(()=>An(O,l,p,h),null,()=>{throw new ae(`Failed to resolve layout path: ${O}`,l,void 0,void 0,`Layout referenced from ${l}`)});if(!j){let ue=(Q)=>{if(!Q)return[];try{let Se=le.isAbsolute(Q)?Q:le.resolve(process.cwd(),Q);return ss.readdirSync(Se).filter(($e)=>$e.endsWith(".stx")).map(($e)=>$e.replace(/\.stx$/,""))}catch{return[]}},se=[...ue(p.layoutsDir),...ue(p.fallbackLayoutsDir)].filter((Q,Se,$e)=>$e.indexOf(Q)===Se).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).`:"",oe=`Layout not found: ${O} (referenced from ${l})`+(se.length>0?`. Available layouts: ${se.join(", ")}`:p.layoutsDir?`. No .stx layouts found in ${p.layoutsDir}`:"")+me;if(q.log(Error(oe),{layoutPath:O,filePath:l,available:se},"error"),console.error(`[stx] ${oe}`),p.debug)throw new ae(oe,l);return b}let H=await Ne(()=>Bun.file(j).text(),"",()=>{throw new ae(`Failed to read layout file: ${j}`,l,void 0,void 0,"Layout content could not be loaded")});H=br(H,j),H=H.replace(/\{\{--[\s\S]*?--\}\}/g,"");let V=Array.isArray(e.__layoutChain)?e.__layoutChain:[];if(V.includes(j)){let ue=[...V.slice(V.indexOf(j)),j];throw new ae(ue.length===2?`Circular layout: ${j} 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 K=H.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(K){if(p.debug)console.log(`Found nested layout: ${K[1]} in ${j}`);let ue={},se=H.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(oe,Q,Se)=>(ue[Q]=Se.trim(),""));for(let[oe,Q]of Object.entries(ue))if(C[oe]&&C[oe].includes(Re)){let Se=C[oe].indexOf(Re);C[oe]=C[oe].slice(0,Se)+Q+C[oe].slice(Se+Re.length)}else if(!C[oe])C[oe]=Q;let ve={...e,__sections:C,__layoutChain:[...V,j]},me=`@layout('${K[1]}')${se}`;return await i(me,ve,j,p,h)}let de=H.replace(/\{\{--[\s\S]*?--\}\}/g,""),G=Ss(de,T),pe={};return G=G.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ue,se,ve)=>(pe[se]=ve.trim(),`@slot('${se}')`)),G=G.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(ue,se,ve)=>{if(C[se]){let me=C[se];if(me.includes(Re)){let oe=pe[se]||"",Q=me.indexOf(Re);me=me.slice(0,Q)+oe+me.slice(Q+Re.length)}return me}return ve||""}),G=fs(G,C),G=G.replace(/\{\{\s*slot\s*\}\}/g,()=>C.content||""),G=ks(G,T),e.__originalFilePath=l,b=await Ar(G,e,j,p,h),b=`<!-- stx-layout: ${O} -->
|
|
1368
|
-
${b}`,k(b)}catch(j){if(j instanceof ee)throw j;throw new ae(`Error processing layout ${O}: ${j instanceof Error?j.message:String(j)}`,l)}return k(await Ar(b,e,l,p,h))}function fs(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 gs(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 ms(r,e){await Ne(()=>sr(r,e),void 0,(l)=>{q.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 hs(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 ys(r,e,l,a){let{scanScriptTags:h}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1368
|
+
${b}`,k(b)}catch(j){if(j instanceof ee)throw j;throw new ae(`Error processing layout ${O}: ${j instanceof Error?j.message:String(j)}`,l)}return k(await Ar(b,e,l,p,h))}function fs(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 gs(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 ms(r,e){await Ne(()=>sr(r,e),void 0,(l)=>{q.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 hs(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 ys(r,e,l,a){let{scanScriptTags:h}=await o("stx/signal-processing",()=>import("./chunk-p6e48m6t.js")),t=[],p=!I()&&!Ln();for(let b of h(r)){let S=b.attrs;if(!/\bserver\b/.test(S))continue;let v=b.start+b.fullMatch.indexOf(">")+1,k=Mr(r,v);if(k===-1)continue;let _=r.slice(v,k);if(!_.trim())continue;let E=hs(S)??l,M={index:b.start,length:k+9-b.start};try{let{extractVariables:T}=await o("stx/variable-extractor",()=>import("./chunk-z2mvdnce.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({...M,markup:Cr(E,C.kind,C.message)})}})}catch(T){let C=T instanceof Error?T:Error(String(T));if(q.log(C,{filePath:E,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${E}: ${C.message}`),p)t.push({...M,markup:Cr(E,"unknown",C.message)})}}if(t.length===0)return r;let w=r;for(let b of t.sort((S,v)=>v.index-S.index))w=w.slice(0,b.index)+b.markup+w.slice(b.index+b.length);return w}async function bs(r,e,l){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-9cgwe3tb.js"));return a(r,e,{skipServer:!0})}catch(a){let h=a instanceof Error?a:Error(String(a));return q.log(h,{filePath:l,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${l}: ${h.message}`),r}}async function Ar(r,e,l,a,h){let t=r;await R();let p=a;if(t=await ys(t,e,l,a),t=await zt(t,e,l),t=await Kt(t,e,l),t=await bs(t,e,l),await R(),t=await Nt(t,e,l,p),Oe(t))t=li(t,e),t=As(t,e),t=Rs(t,e);t=ui(t),await R();let{processStreamDirectives:w}=await o("stx/streaming",()=>import("./chunk-kpkjb7hy.js"));t=w(t,e),t=await si(t,e,l,p,!0),await R(),t=await ur(t,e,l,p,h),t=await Cs(t,e,l,p,h),await R(),t=Dc(t,e,l,p);let{processDeferDirectives:b}=await o("stx/defer",()=>import("./chunk-t8r40wgf.js"));t=b(t,e,l);let{processTeleportDirectives:S}=await o("stx/teleport",()=>import("./chunk-fz4c5e9m.js"));t=S(t,e,l);let{processTransitionDirectives:v,processTransitionAttributes:k}=await o("stx/transitions",()=>import("./chunk-d7b30bg6.js"));t=v(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:M}=await o("stx/suspense",()=>import("./chunk-gmp10259.js"));t=M(t,e,l);let{processAsyncDirectives:T}=await o("stx/async-components",()=>import("./chunk-pjjrx9pk.js"));t=T(t,e,l);let{processKeepAliveDirectives:C}=await o("stx/keep-alive",()=>import("./chunk-axra1yas.js"));t=C(t,e,l);let{processVirtualListDirectives:O,processVirtualGridDirectives:B,processInfiniteListDirectives:F}=await o("stx/virtual-scrolling",()=>import("./chunk-jghpzx5m.js"));t=O(t,e,l),t=B(t,e,l),t=F(t,e,l),await R();let{processPartialHydrationDirectives:W,processStaticDirectives:j}=await o("stx/partial-hydration",()=>import("./chunk-4pjqj54a.js"));t=W(t,e,l),t=j(t);let{processComputedDirectives:H,processWatchDirectives:V}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));t=H(t,e,l),t=V(t,e,l);let{processFormValidationDirectives:K}=await o("stx/forms-validation",()=>import("./chunk-e2d34r31.js"));t=K(t,e,l);let{processHeadDirective:de,processTitleDirective:G,processMetaDirective:pe,resetHead:ue}=await o("stx/head",()=>import("./chunk-p5qac909.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)ue();let se=de(t);if(t=se.content,se.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${se.headContent}
|
|
1369
1369
|
`;if(t=G(t,e),t=pe(t,e,l),t=nr(t),t=oi(t,e),t=jt(t),t=Zt(t),t=await xs(t,e,l,p,h),t=await Cs(t,e,l,p,h),await R(),t=t.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),t=Mi(t),t=fe(t,e,l),t=Es(t),await R(),e.__stxProcessingDepth===1)t=ml(t,e);if(t=ll(t,e,{filePath:l,buildMode:p.buildMode}),t=ii(t,e),t=ai(t,e),t=et(t,e),t=Wt(t,e),t=Xt(t,e),t=await Ct(t,e,l,p),t=await jc(t,e,l),t=await Fc(t,e,l,p),await R(),t=zc(t,e,l,p),t=yi(t,e,l,p),t=bi(t,e,l),t=wi(t,e,l,p),t=Lt(t,e,l,p),t=ro(t,e),t=so(t),t=dl(t),!p.skipEventDirectives)t=Qc(t,e,l);if(t=ul(t,e,l,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await R(),p.debug){let X=/\bx-data\s*=/.test(t),z=$s(r);if(X&&z)console.warn(`[stx] ${l}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
1370
1370
|
Both work on the same page, but they manage separate scopes.
|
|
1371
1371
|
Prefer signals (state/derived/effect) for new components.`)}t=Pc(t,e),t=await Hi(t,e,l),await R(),t=pl(t),t=fl(t),t=$t(t);let{processXElementDirectives:ve}=await o("stx/x-element",()=>import("./chunk-satrf398.js"));t=ve(t);let me=e.__originalFilePath||l,oe=qe(e);if(t=await di(t,p,me,oe),await R(),t=qt(t,e),t=await rr(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-f3j1h3ch.js"));t=await z(t,{publicDir:X})}if(p.seo?.enabled)t=vi(t,e,p);let Q=(X,z,te=!0)=>{if(!z)return X;let we=z.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ce=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(X),he=ce?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ce[0]):null;if(we&&ce&&he){if(te){let De=ce.index+he.index;X=X.slice(0,De)+we[0]+X.slice(De+he[0].length)}if(z=z.replace(we[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
|
|
@@ -1377,6 +1377,6 @@ ${St()}
|
|
|
1377
1377
|
</script>`;if(t.includes("</head>")){let te=D(t),ce=t.slice(0,te).indexOf("<script");if(ce!==-1){let he=t.slice(0,ce),De=t.slice(ce);t=he+z+`
|
|
1378
1378
|
`+De}else t=f(t,z)}else if(t.includes("<body"))t=t.replace(/<body([^>]*)>/,`<body$1>
|
|
1379
1379
|
${z}`);else t=z+`
|
|
1380
|
-
`+t}{let{scanScriptTags:X}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1380
|
+
`+t}{let{scanScriptTags:X}=await o("stx/signal-processing",()=>import("./chunk-p6e48m6t.js")),z=[];for(let te of X(t)){if(!/\bserver\b/i.test(te.attrs))continue;let we=te.start+te.fullMatch.indexOf(">")+1,ce=Mr(t,we);if(ce===-1)continue;let he=ce+9;while(he<t.length&&/\s/.test(t[he]))he++;z.push({start:te.start,end:he})}if(z.length>0){let te=Array(z.length+1),we=0;for(let ce=0;ce<z.length;ce++){let{start:he,end:De}=z[ce];te[ce]=t.slice(we,he),we=De}te[z.length]=t.slice(we),t=te.join("")}}let yt=to(t,l);if(yt.hasScoped)t=yt.html;let jr=e.__stx_event_bindings||[],rt=!1,wt=[],Nr=/\s:[a-z][\w.-]*\s*=/.test(t),{scanScriptTags:Br}=await o("stx/signal-processing",()=>import("./chunk-p6e48m6t.js"));for(let X of Br(t,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))wt.push({match:X.fullMatch,attrs:X.attrs,content:X.body});for(let{match:X,attrs:z,content:te}of wt){rt=!0;let we=te;Ue(te,l,a.strict,e.__originalFilePath);let ce=await Ke(te,{eventBindings:jr,attrs:z,hasColonDirectives:Nr,templateContent:r,filePath:l,projectRoot:process.cwd(),production:Yi(a.buildMode,a.minifyClient),serverData:oe});t=t.replace(X,()=>ce)}if(rt)e.__stx_event_bindings=[];if(!rt&&e.__stxProcessingDepth===1){let X=e.__stx_event_bindings||[];if(X.length>0){let z=Ti(X);if(z){let te=c(t);t=te===-1?t+z:t.slice(0,te)+z+`
|
|
1381
1381
|
`+t.slice(te)}e.__stx_event_bindings=[]}}if(!p.skipSignalsRuntime&&!Te(t)&&Oc(t))t=await xr(t,p);if(t=Nc(t),p.csp?.enabled&&p.csp.useNonce&&typeof e.cspNonce==="string")t=Ot(t,e.cspNonce);return t}
|
|
1382
1382
|
export{Rt,ze,Tc,vs,Zo,Qo,gr,i};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{m,p}from"./chunk-295bykzd.js";import{se,B,g}from"./chunk-
|
|
2
|
+
import{m,p}from"./chunk-295bykzd.js";import{se,B,g}from"./chunk-mrjr0vtb.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function Z(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let f=t.indexOf("-->",s+4);n=f===-1?t.length:f+3;continue}let a=k(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function L(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let f=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=f||N.has(c)?-1:Z(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!f&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function j(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",f=u[2].toLowerCase();if(c){let l=i.lastIndexOf(f);if(l!==-1)i.splice(l);e=s;continue}if(f==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(f)){if(i.push(f),f==="script"||f==="style"){let l=t.toLowerCase().indexOf(`</${f}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function gu(t){let o={default:"",named:new Map},i=t,r=j(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=L(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Um(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function mu(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of c){let[d,l]=f.split(":").map((S)=>S.trim()),h=l||d;if(s[h]=o[d],o[d]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=I(e,s,a,u)}return e}function I(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(B(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!B(s,r))return e;let a=_(s,o);if(a===void 0)return e;return g(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!m(t))return;return p(t,Object.keys(o))(...Object.values(o))}catch{return}}async function hu(t,o,i,r){let e=t;e=await W(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,f)=>{let d=o.named.get(u),l=f?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&d?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=d.propsBinding.trim(),x=se(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=g(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${g(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${d.content}</template>`}return await mu(d,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let f=c?.trim()||"";return o.default||f}),e}async function W(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function Wm(t){let o=gu(t);return{defaultSlot:o.default,namedSlots:o.named}}async function qm(t,o,i,r,e){return await hu(t,{default:o,named:i},r,e)}
|
|
3
3
|
export{gu,Um,mu,hu,Wm,qm};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{uy,Ts,ci,$s,wr,li,ui,dg,Rs,As,Ps,di,Ic,pg,Pt}from"./chunk-
|
|
2
|
+
import{uy,Ts,ci,$s,wr,li,ui,dg,Rs,As,Ps,di,Ic,pg,Pt}from"./chunk-v9wt6jx2.js";import"./chunk-2v0pcxqs.js";import"./chunk-cb0c6959.js";import"./chunk-ce1d71m1.js";import"./chunk-css5czqk.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-0rdh8bw3.js";import"./chunk-agd2b928.js";import{G}from"./chunk-mrjr0vtb.js";import"./chunk-pk3pp1j5.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-kwf3kfr0.js";import"./chunk-s29hp1qw.js";import"./chunk-n22xtagg.js";export{dg as bindLoopInterpolations,uy as clearScriptScanCache,Rs as convertServerLoopAttributesToDirectives,li as convertSignalDirectivesToAttributes,As as convertSignalLoopsToAttributes,wr as extractClientSignalNames,G as extractExports,Ic as findMarkupIndexOutsideScripts,$s as hasSignalsSyntax,ci as parseLoopExpression,ui as preEvalLiteralReactiveIfs,Ps as processScriptSetup,di as processSignals,pg as rewriteStxImportSpecifiers,Ts as scanScriptTags,Pt as stripStxRuntimeImports};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Dn}from"./chunk-295bykzd.js";import{j,Q,w,Wt,qt,Lr,h,Cl,Fi,Y,O}from"./chunk-
|
|
2
|
+
import{Dn}from"./chunk-295bykzd.js";import{j,Q,w,Wt,qt,Lr,h,Cl,Fi,Y,O}from"./chunk-mrjr0vtb.js";import{fn}from"./chunk-ws3wfpy9.js";import{r}from"./chunk-qtbbc0h2.js";import{te}from"./chunk-ws2h92mm.js";import{D,c}from"./chunk-xpbakn6t.js";var X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function J(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,n;while((n=e.exec(t))!==null)s.push({start:n.index,end:n.index+n[0].length});return s}function F(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function K(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},n=s,i=n.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),n=n.slice(i[0].length);while(n.length>0){let o=n.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];n=n.slice(o[0].length);continue}let l=n.match(/^#([\w-]+)/);if(l){e.id=l[1],n=n.slice(l[0].length);continue}let a=n.match(/^\.([\w-]+)/);if(a){e.className=a[1],n=n.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function Z(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function P(t,s="main"){let e=K(s);if(!e)return null;let n=/<([a-z][\w-]*)\b([^>]*)>/gi,i=J(t),o;while((o=n.exec(t))!==null){if(F(o.index,i))continue;let l=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||X.has(l))continue;if(e.tag&&e.tag!==l)continue;if(!Z(a,e))continue;let u=o[0],g=o.index+u.length,f=new RegExp(`<(/?)${l}\\b([^>]*)>`,"gi");f.lastIndex=g;let d=1,x;while((x=f.exec(t))!==null){if(F(x.index,i))continue;let y=x[1]==="/";if(!y&&(x[2]||"").trimEnd().endsWith("/"))continue;if(d+=y?-1:1,d===0)return{openTag:u,openIndex:o.index,start:g,end:x.index,tagName:l}}return null}return null}var Ct="private, no-store";function an(t){return t.replace(/&#(\d+);/g,(s,e)=>L(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>L(Number.parseInt(e,16),s)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function L(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function Le(t){return t.headers.get("X-STX-Router")==="true"}function tt(t,s){if(!t)return s;return t.split(",").some((n)=>n.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function V(t){return{Vary:tt(t,"X-STX-Router")}}function E(t){return t.replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function H(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return w(s,(n,i)=>(e.lastIndex=i,e.exec(n)?e.lastIndex:-1)).map(({token:n})=>n)}function B(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let n of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=n[1].toLowerCase();if(!(i in s))s[i]=n[2]??n[3]??n[4]??""}return s}function Vn(t){let s=[];for(let e of H(t)){if(/^<title\b/i.test(e)){s.push(`<title>${E(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let n=B(e);if(/^<meta\b/i.test(e)){let i=n.property?"property":"name",o=an(n[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${r(o)}" content="${E(n.content??"")}">`)}else{let i=an(n.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&n.hreflang)s.push(`<link rel="${i}" href="${E(n.href??"")}"${i==="alternate"?` hreflang="${E(n.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
|
|
3
3
|
`}var et=["media","crossorigin","integrity"];function Un(t){let s=[];for(let e of H(t)){if(!/^<link\b/i.test(e))continue;let n=B(e);if(an(n.rel??"").trim().toLowerCase()!=="stylesheet")continue;if(!n.href||"data-css"in n||"disabled"in n)continue;let i=et.filter((o)=>(o in n)).map((o)=>` ${o}="${E(n[o])}"`).join("");s.push(`<link rel="stylesheet" href="${E(n.href)}"${i}>`)}return s.length?`<template data-stx-page-css="1">${s.join("")}</template>
|
|
4
|
-
`:""}import T from"path";var st="stx-page-head:",it=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function ot(){let t=te()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-1z6rrqvm.js"),n=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${n()}</script>`}catch{_[t]=""}return _[t]}async function Aa(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let n=T.resolve(t,s);if(await Bun.file(n).exists())return n;return null}let e=T.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Oo(t,s){try{let e=await Bun.file(t).text(),n=e,i=j(e);if(i)n=i.content.trim();let o=fn(e),l=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],u=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,g;while((g=u.exec(e))!==null)a.push(g[0]);let f=n;for(let p of o.server)f=f.replace(p.fullTag,"");for(let p of o.client)f=f.replace(p.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!f.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:x,extractVariables:y,defaultConfig:R,loadStxConfig:b}=await import("./chunk-
|
|
4
|
+
`:""}import T from"path";var st="stx-page-head:",it=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function ot(){let t=te()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-1z6rrqvm.js"),n=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${n()}</script>`}catch{_[t]=""}return _[t]}async function Aa(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let n=T.resolve(t,s);if(await Bun.file(n).exists())return n;return null}let e=T.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Oo(t,s){try{let e=await Bun.file(t).text(),n=e,i=j(e);if(i)n=i.content.trim();let o=fn(e),l=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],u=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,g;while((g=u.exec(e))!==null)a.push(g[0]);let f=n;for(let p of o.server)f=f.replace(p.fullTag,"");for(let p of o.client)f=f.replace(p.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!f.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:x,extractVariables:y,defaultConfig:R,loadStxConfig:b}=await import("./chunk-z5n2sjg2.js"),k=await b(),m={__filename:t,__dirname:T.dirname(t)};for(let p of l){let A=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(A&&!p.includes("client")&&!p.includes('type="module"'))await y(A[1],m,t)}let S=await x(f,m,t,{...R,...k,...s},new Set),C=S.indexOf(d);if(C===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:S.substring(0,C),afterSlot:S.substring(C+d.length),filePath:t,shellScripts:l,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function is(t,s,e){let n,i="",o=s.match(it);if(o){s=s.replace(o[0],"");try{let f=Buffer.from(o[1],"base64").toString("utf8"),d=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)n=d[1].trim();i=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let l=e||n||"stx App",a=ot(),u="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
6
6
|
<head>
|
|
7
7
|
<meta charset="UTF-8">
|
|
@@ -29,5 +29,5 @@ ${a}
|
|
|
29
29
|
`));if(o.length>0)m.push(o.filter((S)=>!g.has(S)).join(`
|
|
30
30
|
`));if(R.length>0)m.push(R.filter((S)=>!g.has(S)).join(`
|
|
31
31
|
`));return m.push(y),m.join(`
|
|
32
|
-
`)}import M from"fs";import z from"path";function Ia(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function Oa(t,s){let e=z.join(s,"manifest.json");M.writeFileSync(e,JSON.stringify(t,null,2))}function Na(t){let s=z.join(t,"manifest.json");if(!M.existsSync(s))return null;try{let e=M.readFileSync(s,"utf-8"),n=JSON.parse(e);if(n.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${n.version}`),null;return n}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function I(t,s,e={}){let n=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)n+=`; Max-Age=${e.maxAge}`;if(e.expires)n+=`; Expires=${e.expires.toUTCString()}`;if(e.path)n+=`; Path=${e.path}`;if(e.domain)n+=`; Domain=${e.domain}`;if(e.secure)n+="; Secure";if(e.httpOnly)n+="; HttpOnly";if(e.sameSite)n+=`; SameSite=${e.sameSite}`;return n}async function ct(t){let s=t.headers.get("content-type")||"",e={},n=(i,o)=>{let l=e[i];if(l===void 0)e[i]=o;else if(Array.isArray(l))l.push(o);else e[i]=[l,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,l]of i.entries())if(typeof l==="string")n(o,l);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())n(i,o);return e}return e}function No(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function G(t,s={}){let e=s.request,n=s.method??e?.method;if(!e||!No(n))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await ct(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let l=o,a=lt(l.cookies),u=l.redirect;if(typeof u==="string"&&u)return{redirect:u,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:g,redirect:f,...d}=l;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function lt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,n]of Object.entries(t)){if(!e)continue;if(typeof n==="string"){s.push(I(e,n));continue}if(n&&typeof n==="object"){let i=n;if(typeof i.value!=="string")continue;s.push(I(e,i.value,i))}}return s}function Ma(t,s=[],e){let n=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)n.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")n.set(i,o);return new Response(null,{status:303,headers:n})}async function Wn(t,s={}){let{html:e,context:n,redirect:i,cookies:o}=await ut(t,s),l=Wt(n),a=qt(n);if(i)return{html:e,redirect:i,cookies:o,status:l,headers:a};let{extractStreamBoundaries:u}=await import("./chunk-
|
|
32
|
+
`)}import M from"fs";import z from"path";function Ia(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function Oa(t,s){let e=z.join(s,"manifest.json");M.writeFileSync(e,JSON.stringify(t,null,2))}function Na(t){let s=z.join(t,"manifest.json");if(!M.existsSync(s))return null;try{let e=M.readFileSync(s,"utf-8"),n=JSON.parse(e);if(n.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${n.version}`),null;return n}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function I(t,s,e={}){let n=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)n+=`; Max-Age=${e.maxAge}`;if(e.expires)n+=`; Expires=${e.expires.toUTCString()}`;if(e.path)n+=`; Path=${e.path}`;if(e.domain)n+=`; Domain=${e.domain}`;if(e.secure)n+="; Secure";if(e.httpOnly)n+="; HttpOnly";if(e.sameSite)n+=`; SameSite=${e.sameSite}`;return n}async function ct(t){let s=t.headers.get("content-type")||"",e={},n=(i,o)=>{let l=e[i];if(l===void 0)e[i]=o;else if(Array.isArray(l))l.push(o);else e[i]=[l,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,l]of i.entries())if(typeof l==="string")n(o,l);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())n(i,o);return e}return e}function No(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function G(t,s={}){let e=s.request,n=s.method??e?.method;if(!e||!No(n))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await ct(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let l=o,a=lt(l.cookies),u=l.redirect;if(typeof u==="string"&&u)return{redirect:u,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:g,redirect:f,...d}=l;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function lt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,n]of Object.entries(t)){if(!e)continue;if(typeof n==="string"){s.push(I(e,n));continue}if(n&&typeof n==="object"){let i=n;if(typeof i.value!=="string")continue;s.push(I(e,i.value,i))}}return s}function Ma(t,s=[],e){let n=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)n.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")n.set(i,o);return new Response(null,{status:303,headers:n})}async function Wn(t,s={}){let{html:e,context:n,redirect:i,cookies:o}=await ut(t,s),l=Wt(n),a=qt(n);if(i)return{html:e,redirect:i,cookies:o,status:l,headers:a};let{extractStreamBoundaries:u}=await import("./chunk-kpkjb7hy.js"),g=u(n),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:d}=await import("./chunk-xwwp2ftx.js"),{defaultConfig:x}=await import("./chunk-1dhdt31n.js"),y=n.streamBoundaries||{},R={...x,autoShell:!1},b=Object.keys(f).map((m)=>({id:m,render:async()=>{let S=typeof y[m]==="function"?await y[m]():void 0;return d(f[m],{...n,$boundary:S},t.sourceFile,R,new Set)}})),k=new Set(b.map((m)=>m.id));g=[...(g||[]).filter((m)=>!k.has(m.id)),...b]}return{html:e,boundaries:g&&g.length>0?g:void 0,cookies:o,status:l,headers:a}}async function ut(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!Fi(t.html))return{html:t.html,context:e};for(let l of t.serverScriptContent)try{await h(l,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let n=await G(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(l)=>{let a=l.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),u=Lr(e);if(!u)return a;let g=D(a);return g<0?u+a:a.slice(0,g)+u+a.slice(g)};if(n.redirect)return{html:t.html,context:e,redirect:n.redirect,cookies:n.cookies};if(!Fi(t.html))return{html:i(t.html),context:e,cookies:n.cookies};let o=new Map;for(let[l,a]of Object.entries(t.placeholders))if(a.expression)try{let u=O(a.expression,e);if(a.type==="raw")o.set(l,u!==void 0&&u!==null?String(u):"");else o.set(l,u!==void 0&&u!==null?Y(String(u)):"")}catch(u){if(s.__stx_strict_hydration)throw u;o.set(l,"")}return{html:i(Cl(t.html,o)),context:e,cookies:n.cookies}}
|
|
33
33
|
export{Ct,an,Le,V,Vn,Un,Aa,Oo,is,nt,Pa,rt,je,Ia,Oa,Na,No,Ma,Wn};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t}from"./chunk-
|
|
2
|
+
import{t}from"./chunk-zpj6ggee.js";function y(e,i,s=240){return e.slice(i,i+s)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(e)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(e)||/\b(?:const|let|var)\s+alert\s*=/.test(e)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(e,i)=>{let s=e.indexOf("(",i);if(s===-1)return!0;let o=e.slice(s+1,e.indexOf(")",s)+1);return!/\b(?:location|search|href|url)\b/i.test(o)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(e,i)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(y(e,i,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(e,i)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(y(e,i))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(e)=>/setTimeout\s*\(/.test(e)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],C=["confirm","tooltip",...v.map((e)=>e.rule)];function g(e,i){let s=1;for(let o=0;o<i;o++)if(e[o]===`
|
|
3
3
|
`)s++;return s}function b(e,i){let s=e.lastIndexOf(`
|
|
4
4
|
`,i)+1,o=e.indexOf(`
|
|
5
5
|
`,i);return e.slice(s,o===-1?e.length:o).trim().slice(0,120)}function S(e,i){let s=e.slice(0,i),o=s.lastIndexOf("function"),l=s.lastIndexOf("=>"),r=Math.max(o,l);if(r===-1)return!1;let n=e.slice(Math.max(0,r-120),r);return/\basync\b[^;{}]*$/.test(n)}function k(e){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(e)||/\b(?:const|let|var)\s+confirm\s*=/.test(e)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(e)}function A(e,i,s){if(k(e))return e;let o=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,l=m(e),r="",n=0,a;while((a=o.exec(l))!==null){let c=a.index+a[1].length,u=g(e,c),d=b(e,c);if(/stxConfirm\s*\($/.test(e.slice(0,c+8)))continue;let p=S(e,c);if(s.push({file:i,line:u,rule:"confirm",applied:p,snippet:d,reason:p?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),p)r+=e.slice(n,c)+"await stxConfirm(",n=c+(a[0].length-a[1].length)}return r+e.slice(n)}function E(e,i,s){let o=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,l=R(e),r="",n=0,a;while((a=o.exec(l))!==null){let[c,u,d,p]=a,h=g(e,a.index),f=b(e,a.index),w=u.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(w)){s.push({file:i,line:h,rule:"tooltip",applied:!1,snippet:f,reason:`\`title\` on <${w}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test(u)||p.trim()===""){s.push({file:i,line:h,rule:"tooltip",applied:!1,snippet:f,reason:/\bx-tooltip[=\s]/.test(u)?"already has x-tooltip":"empty title"});continue}s.push({file:i,line:h,rule:"tooltip",applied:!0,snippet:f}),r+=e.slice(n,a.index)+`${u} x-tooltip=${d}${p}${d} title=${d}${p}${d}`,n=a.index+c.length}return r+e.slice(n)}function R(e){return e.replace(/<!--[\s\S]*?-->/g,(i)=>i.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(i)=>i.replace(/[^\n]/g," "))}function F(e){let i=(s)=>s.replace(/[^\n]/g," ");return e.replace(/\/\*[\s\S]*?\*\//g,i).replace(/\/\/[^\n]*/g,i)}function m(e,i=!1){let s=R(e);return(i?F(s):t(s)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(l,r)=>/\bclient\b/i.test(r)?l:l.replace(/[^\n]/g," "))}function O(e,i,s,o){let l=m(e),r=m(e,!0);for(let n of v){if(!s.includes(n.rule))continue;if(n.requires&&!n.requires(e))continue;n.pattern.lastIndex=0;let a,c=/['"]/.test(n.pattern.source)?r:l;n.pattern.lastIndex=0;while((a=n.pattern.exec(c))!==null){if(n.reject?.(e,a.index))continue;o.push({file:i,line:g(e,a.index),rule:n.rule,applied:!1,snippet:b(e,a.index),reason:`${n.primitive} \u2014 ${n.why}`})}}}function q(e,i={}){let s=i.rules??C,o=i.file??"<source>",l=[];O(e,o,s,l);let r=e;if(s.includes("confirm"))r=A(r,o,l);if(s.includes("tooltip"))r=E(r,o,l);l.sort((c,u)=>c.line-u.line);let n=new Set,a=l.filter((c)=>{let u=`${c.rule}:${c.line}`;if(n.has(u))return!1;return n.add(u),!0});return{code:r,findings:a}}var x=new Set(["confirm","tooltip"]);function I(e,i){if(e.length===0)return"No hand-rolled equivalents found.";let s=e.filter((n)=>n.applied),o=e.filter((n)=>!n.applied&&x.has(n.rule)),l=e.filter((n)=>!n.applied&&!x.has(n.rule)),r=[];if(s.length>0){r.push(i?`Rewrote ${s.length} site(s):`:`Would rewrite ${s.length} site(s) (pass --fix):`);for(let n of s)r.push(` ${n.file}:${n.line} [${n.rule}] ${n.snippet}`)}if(o.length>0){r.push("",`Needs a human \u2014 ${o.length} site(s):`);for(let n of o)r.push(` ${n.file}:${n.line} [${n.rule}] ${n.snippet}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Nn,F}from"./chunk-6t04tqvh.js";import m from"fs";import e from"path";async function On(r,o,i){if(r.__stx_runtime_config)return;let n=Nn();if(n||i){r.__stx_runtime_config=n??F(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-
|
|
2
|
+
import{Nn,F}from"./chunk-6t04tqvh.js";import m from"fs";import e from"path";async function On(r,o,i){if(r.__stx_runtime_config)return;let n=Nn();if(n||i){r.__stx_runtime_config=n??F(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-1dhdt31n.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=F(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Vi(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
|
|
3
3
|
declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
|
|
4
4
|
`),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
|
|
5
5
|
declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Es,lg,si,ug}from"./chunk-charhv8y.js";import"./chunk-d2pexm3z.js";import"./chunk-v9wt6jx2.js";import"./chunk-2v0pcxqs.js";import"./chunk-cb0c6959.js";import"./chunk-ce1d71m1.js";import"./chunk-css5czqk.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-0rdh8bw3.js";import"./chunk-agd2b928.js";import{Vt}from"./chunk-mrjr0vtb.js";import"./chunk-pk3pp1j5.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-kwf3kfr0.js";import"./chunk-s29hp1qw.js";import"./chunk-n22xtagg.js";export{ug as declareBareLoopHead,Vt as parseLoopBinding,lg as processLoops,si as processLoopsAsync,Es as reportDeferredLoopWarnings};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{j,cl,no,$n,h,qe,Ke}from"./chunk-
|
|
2
|
+
import{j,cl,no,$n,h,qe,Ke}from"./chunk-mrjr0vtb.js";import{_r,ut,W}from"./chunk-ce1d71m1.js";import{gr,i}from"./chunk-nxbws5qm.js";import{$e}from"./chunk-2v0pcxqs.js";import{ra}from"./chunk-xpbakn6t.js";function y(s){return s.endsWith(".md")||s.endsWith(".markdown")}function C(s){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(n,p){let g;while((g=n.exec(s))!==null){let t=g.index,o=t+g[0].length;if(p?.some((l)=>t>=l.start&&o<=l.end))continue;e.push({start:t,end:o})}}if(e.length===0)return s;e.sort((n,p)=>n.start-p.start);let c="",a=0;for(let n of e){if(n.start<a)continue;c+=s.slice(a,n.start),c+=`@raw${s.slice(n.start,n.end)}@endraw`,a=n.end}return c+=s.slice(a),c}async function b(s,e={}){let{data:r,content:m}=_r(s),a=await(e.renderer??((n)=>ut(n)))(m);return{html:C(a),frontmatter:r??{}}}import{dirname as k,resolve as R}from"path";function v(s){let e=s,r=j(s);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,c=[],a=[],n=[],p=(o)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(o),g;while((g=m.exec(s))!==null){let o=g[1],l=g[2],d=g[0],u=o.includes("server");if(p(l))n.push(d);else if(u)a.push(l);else c.push(d)}let t=e;{let o=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,d=[];while((l=o.exec(t))!==null){let u=l.index+l[0].length,f=t.indexOf("</script>",u);if(f===-1)continue;d.push({start:l.index,end:f+9}),o.lastIndex=f+9}for(let u=d.length-1;u>=0;u--)t=t.substring(0,d[u].start)+t.substring(d[u].end)}for(let o of c)t=t.replace(o,"");return{templateContent:t,serverScripts:a,clientScripts:c,signalsScripts:n}}function M(s,e){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -12,5 +12,5 @@ ${s}
|
|
|
12
12
|
</html>`}async function bc(s,e={}){let r=R(s),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let c=await m.text(),a=null;if(y(r)){let n=await b(c,{renderer:e.markdownRenderer});c=n.html,a=n.frontmatter}if(a)e={...e,context:{...a,...e.context||{}}};if(e.layout){let n=R(e.layout),p=Bun.file(n);if(!await p.exists())throw Error(`Layout template not found: ${n}`);let{layout:g,injectCSS:t,...o}=e,l={...e.context||{}};$n(l);let d=await w(c,r,{...o,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),u=await p.text(),f={...l,content:d},x={...o,context:f,injectCSS:t};return w(u,n,x)}return w(c,r,e)}async function w(s,e,r={}){let{templateContent:m,serverScripts:c,clientScripts:a}=v(s),n={...W,...r.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:n,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...no(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let o of c)await h(o,p,e);let g=new Set,t=m;if(t=await i(t,p,e,n,g),cl(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),a.length>0)t+=`
|
|
13
13
|
${a.join(`
|
|
14
14
|
`)}`}else{if(r.processClientScripts!==!1&&a.length>0){let o=p.__stx_event_bindings||[],l=qe(p),d=await Promise.all(a.map(async(x)=>{let _=x.match(/<script\b([^>]*)>/i)?.[1]||"";if(/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(_))return x;let S=x.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!S)return x;return await Ke(S[1],{eventBindings:o,templateContent:t,serverData:l,filePath:e})})),f=[await gr(d,{...n,buildMode:"compile"}),...d].filter(Boolean).join(`
|
|
15
|
-
`);t=ra(t,f)}t=await $e(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-
|
|
15
|
+
`);t=ra(t,f)}t=await $e(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-eg3sxm03.js");t=await o(t)}catch{}return t}
|
|
16
16
|
export{bc};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h,Di,hl,yl,Dg,Lg,jg,Bg,Fg,oo,zg,Ge,oe,Xe,Hg,jr,Vg,vl,xl,Bi,Je,s,An,Sl,y,ke,Ey}from"./chunk-
|
|
2
|
+
import{h,Di,hl,yl,Dg,Lg,jg,Bg,Fg,oo,zg,Ge,oe,Xe,Hg,jr,Vg,vl,xl,Bi,Je,s,An,Sl,y,ke,Ey}from"./chunk-mrjr0vtb.js";import"./chunk-pk3pp1j5.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-kwf3kfr0.js";import"./chunk-s29hp1qw.js";import"./chunk-n22xtagg.js";export{xl as SIGNAL_COMPOSABLE_CALL,ke as clearComponentCache,Bi as componentClientSignalNames,Di as convertToCommonJS,y as createDetailedErrorMessage,Fg as extractDirectiveNames,hl as extractScriptFromTemplate,h as extractVariables,s as fileExists,Ey as getComponentCacheStats,Lg as getPositionInfo,oe as getSharedTranspiler,Sl as getSourceLineInfo,Bg as hasDirectives,yl as hasVariables,Vg as isHydrateTrigger,zg as isJavaScriptScript,Je as renderComponentWithSlot,An as resolveTemplatePath,Hg as scopeOnRootElement,oo as scopeSequenceKey,Ge as shouldTranspileTypeScript,vl as slotContentHasExpressions,Xe as transpileTypeScript,jr as userComponentFileExists,jg as validateDirective,Dg as validateTemplate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{On,Vi}from"./chunk-
|
|
2
|
+
import{On,Vi}from"./chunk-pk3pp1j5.js";import"./chunk-6t04tqvh.js";export{Vi as generateRuntimeConfigTypes,On as prepareRuntimeConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{gu,Um,mu,hu,Wm,qm}from"./chunk-p0rpdj1w.js";import"./chunk-mrjr0vtb.js";import"./chunk-pk3pp1j5.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-kwf3kfr0.js";import"./chunk-s29hp1qw.js";import"./chunk-n22xtagg.js";export{qm as applySlots,Wm as extractSlotContent,Um as parseSlotElement,gu as parseSlots,hu as processSlots,mu as renderSlot};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{wt,Bl}from"./chunk-
|
|
2
|
+
import{wt,Bl}from"./chunk-n22xtagg.js";import{M}from"./chunk-hxhmhw23.js";import{G,qs,o,ge,Q,w,tl,Kt,Rn,Ge,Xe}from"./chunk-mrjr0vtb.js";import{xr}from"./chunk-2v0pcxqs.js";import{U}from"./chunk-care745q.js";import{Sn}from"./chunk-cb0c6959.js";var X=`(?:"[^"]*"|'[^']*'|[^>"'])*`,H=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,q=65536,J=4,N=new Map;function uy(){N.clear()}function K(e){let c=[];for(let t of w(e,Q)){let n=t.token.match(/^<script\b([^>]*)>/i),s=t.token.match(/<\/script\s*>$/i);if(!n||!s)continue;let a=n[0].length,f=t.token.length-s[0].length;c.push(Object.freeze({fullMatch:t.token,attrs:n[1],body:t.token.slice(a,f),start:t.start,end:t.end}))}return c}function Ts(e,c={}){let t=e.length>=q,n=t?N.get(e):void 0;if(n===void 0){if(n=K(e),t)tl(N,J),N.set(e,n)}let s=c.skipAttrs;if(!s)return n.slice();let a=[];for(let f of n)if(s.lastIndex=0,!s.test(f.attrs))a.push(f);return a}function ci(e){let c=e.trim(),t=c.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(t){let s=t[1].trim(),a=t[2].trim(),{itemVar:f,indexVar:i}=D(a);if(f)return{style:"as",iterable:s,itemVar:f,indexVar:i}}let n=c.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(n){let s=n[1].trim(),a=n[2].trim(),{itemVar:f,indexVar:i}=D(s);if(f)return{style:"in",iterable:a,itemVar:f,indexVar:i}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function D(e){let c=e.trim(),t=c.match(/^(\w+)\s*=>\s*(\w+)$/);if(t)return{itemVar:t[2],indexVar:t[1]};let n=c.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(n)return{itemVar:n[1],indexVar:n[2]||null};let s=c.match(/^(\w+)\s*,\s*(\w+)$/);if(s)return{itemVar:s[1],indexVar:s[2]};let a=c.match(/^(\w+)$/);if(a)return{itemVar:a[1],indexVar:null};return{itemVar:null,indexVar:null}}function $s(e,c){return Bl(e,c)}function Y(e){let c=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,t=0,n;while((n=c.exec(e))!==null){let s=n[1];if(s.startsWith("if"))t++;else if(s==="endif")t--;else if(t===0)return!0}return!1}function wr(e){let c=new Set,t=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,n=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,s;while((s=t.exec(e))!==null){let a=s[1],f;while((f=n.exec(a))!==null)c.add(f[1])}return c}function ee(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let c=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${X})>`,"iy"),t=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,n=w(e,(a,f)=>{c.lastIndex=f;let i=c.exec(a);if(!i||i.index!==f||!t.test(i[2]))return-1;return c.lastIndex}),s=[];for(let a of n){c.lastIndex=0;let f=c.exec(a.token);if(!f)continue;let i=f[2].match(t),p=ci(i?.[1]??i?.[2]??""),m=[p.itemVar,p.indexVar].filter(Boolean);if(m.length===0)continue;let r=f[1],g=/\/\s*>$/.test(a.token)||O.has(r.toLowerCase())?a.end:j(e,a.start,r,a.end);if(g!==-1)s.push({start:a.start,end:g,vars:new Set(m)})}return s}var z=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function te(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function W(e,c,t,n){if(!e)return!1;let s=te(e),a=!1,f=!1,i=!1,p=/([a-zA-Z_$][\w$]*)/g,m;while((m=p.exec(s))!==null){let u=m[1];if(s.slice(0,m.index).trimEnd().endsWith("."))continue;if(z.has(u))continue;if(c.has(u)||n?.has(u))a=!0;else if(t&&u in t)f=!0}let r=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,l;while((l=r.exec(s))!==null){let u=l[1];if(s.slice(0,l.index).trimEnd().endsWith("."))continue;if(z.has(u)||t&&u in t)continue;i=!0}return(a||i)&&!f}function L(e,c,t){let n=t===void 0?` ${c}`:` ${c}="${t.replace(/"/g,""")}"`,s=e.trim(),a=s.match(H);if(a&&!ne(a[1])&&se(a[3],a[1])){let[,f,i,p]=a;return`<${f}${i}${n}>${p}</${f}>`}return`<template${n}>${s}</template>`}function ne(e){return/^[A-Z]/.test(e)}function se(e,c){let t=new RegExp(`<(/)?${c}(?=[\\s/>])`,"gi"),n=0,s;while((s=t.exec(e))!==null)if(s[1]){if(n--,n<0)return!1}else n++;return!0}function li(e,c){let t=wr(e);function n(s){let a=s,f=ee(s),i=(l)=>{let g=new Set;for(let u of f)if(l>u.start&&l<u.end)for(let d of u.vars)g.add(d);return g},p=/@if\s*\(/g,m,r=[];while((m=p.exec(a))!==null){let l=m.index,g=l+m[0].length,u=1,d=g;while(d<a.length&&u>0){if(a[d]==="(")u++;else if(a[d]===")")u--;d++}if(u!==0)continue;let b=a.substring(g,d-1).trim(),S=d,E=1,y=S,x=/@(if\s*\(|endif)/g;x.lastIndex=S;let h;while((h=x.exec(a))!==null)if(h[1].startsWith("if"))E++;else if(h[1]==="endif"){if(E--,E===0){y=h.index+h[0].length;break}}if(E!==0)continue;let R=a.substring(S,y-6).trim(),A;if(Y(R)){let C=Sn(a.substring(l,y));if(C.length===0)continue;let T=C[0].branches.filter((_)=>_.type!=="else"),k=i(l);if(!(T.length>0&&T.every((_)=>W(_.condition,t,c,k))))continue;A=C[0].branches.map((_)=>{let V=n(_.content);if(_.type==="elseif")return L(V,"@else-if",_.condition??"");if(_.type==="else")return L(V,"@else");return L(V,"@if",_.condition??"")}).join(`
|
|
3
3
|
`)}else{if(!W(b,t,c,i(l)))continue;A=L(n(R),"@if",b)}r.push({start:l,end:y,replacement:A}),p.lastIndex=y}for(let l=r.length-1;l>=0;l--){let{start:g,end:u,replacement:d}=r[l];a=a.substring(0,g)+d+a.substring(u)}return a}return n(e)}function re(e){let c=e.trim();if(c==="")return;if(c==="true")return!0;if(c==="false")return!1;if(c==="null")return!1;if(c==="undefined")return!1;if(c==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(c)){let s=Number(c);return s!==0&&!Number.isNaN(s)}let t=c.match(/^'((?:\\.|[^'\\])*)'$/);if(t)return t[1].length>0;let n=c.match(/^"((?:\\.|[^"\\])*)"$/);if(n)return n[1].length>0;return}var O=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),B=/<(script|style)\b/iy,ie=/<\/script/gi,oe=/<\/style/gi;function j(e,c,t,n){if(O.has(t.toLowerCase()))return n;let s=t.toLowerCase(),a=e.length,f=1,i=n;while(i<a){let p=e.indexOf("<",i);if(p===-1)return-1;if(i=p,e.startsWith("<!--",i)){let g=e.indexOf("-->",i+4);if(g===-1)return-1;i=g+3;continue}B.lastIndex=i;let m=B.exec(e);if(m){let g=e.indexOf(">",i);if(g===-1)return-1;if(e[g-1]==="/"){i=g+1;continue}let u=m[1].toLowerCase()==="script"?ie:oe;u.lastIndex=i;let d=u.exec(e);if(d===null)return-1;let b=e.indexOf(">",d.index);if(b===-1)return-1;i=b+1;continue}if(e[i+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(i,i+64));if(!g){i++;continue}if(g[1].toLowerCase()===s){if(f--,i+=g[0].length,f===0)return i;continue}i+=g[0].length;continue}let r=/^<([a-z][\w-]*)\b/i.exec(e.slice(i,i+64));if(!r){i++;continue}let l=e.indexOf(">",i);if(l===-1)return-1;if(r[1].toLowerCase()===s){let g=e.slice(i,l+1);if(!(/\/\s*>$/.test(g)||O.has(s)))f++}i=l+1}return-1}var ce=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function ae(e,c){let t=c,n=e.length;for(;;){while(t<n&&e[t]!=="<")t++;if(t>=n)return!1;if(e.startsWith("<!--",t)){let f=e.indexOf("-->",t+4);if(f===-1)return!1;t=f+3;continue}break}if(e[t+1]==="/")return!1;let s=e.indexOf(">",t);if(s===-1)return!1;let a=e.slice(t,s+1);return ce.test(a)}function ui(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let c=[],t=/<([a-zA-Z][\w-]*)/y,n=/\s/,s=new Set([":if",":show","x-if","x-show","@if","@show"]);w(e,(r,l)=>{t.lastIndex=l;let g=t.exec(r);if(!g||/^(?:script|style)$/i.test(g[1]))return-1;let u=t.lastIndex,d;while(u<r.length){let b=u;while(u<r.length&&n.test(r[u]))u++;let S=u;if(r[S]==="/"){S++;while(S<r.length&&n.test(r[S]))S++}if(r[S]===">"){if(d)c.push({start:l,end:S+1,tag:g[1],...d});return-1}if(u===b)return-1;let E=u;while(u<r.length&&!n.test(r[u])&&r[u]!=="="&&r[u]!==">")u++;if(u===E)return-1;let y=r.slice(E,u);if(y.startsWith("@")&&y.includes("("))return-1;let x=u,h=u;while(h<r.length&&n.test(r[h]))h++;if(r[h]!=="="){u=x;continue}h++;while(h<r.length&&n.test(r[h]))h++;let R=r[h];if(R==='"'||R==="'"){let A=r.indexOf(R,h+1);if(A===-1)return-1;if(!d&&R==='"'&&s.has(y))d={attrName:y,attrStart:b,attrEnd:A+1,value:r.slice(h+1,A)};u=A+1}else{u=h;while(u<r.length&&!n.test(r[u])&&r[u]!==">")u++}}return-1});let a=[],f=-1;for(let r of c){let{start:l,end:g,tag:u,attrName:d,value:b}=r;if(l<f)continue;let S=re(b);if(S===void 0)continue;let x=/\/\s*>$/.test(e.slice(l,g))||O.has(u.toLowerCase())?g:j(e,l,u,g);if(x===-1)continue;if((d===":if"||d==="x-if"||d==="@if")&&ae(e,x))continue;if(S===!0){let R=e.slice(l,r.attrStart)+e.slice(r.attrEnd,g);a.push({start:l,end:g,replacement:R});continue}a.push({start:l,end:x,replacement:""}),f=x}if(a.length===0)return e;a.sort((r,l)=>r.start-l.start);let i=[],p=-1;for(let r of a){if(r.start<p)continue;i.push(r),p=r.end}let m=e;for(let r=i.length-1;r>=0;r--){let{start:l,end:g,replacement:u}=i[r];m=m.substring(0,l)+u+m.substring(g)}return m}var Z=[":for","@for","x-for"];function dg(e){let c=/(\s)((?::|@|x-|v-)[\w.:-]+)\s*=\s*"([^"]*\{\{[^"]*)"/g;return e.replace(c,(t,n,s,a)=>{let f=a.replace(/'((?:[^'\\]|\\.)*)'/g,(i,p)=>{if(!p.includes("{{"))return i;return`\`${p.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{\s*([^}]+?)\s*\}\}/g,(r,l)=>`\${${l}}`)}\``});return`${n}${s}="${f}"`})}function Rs(e,c){if(!c||Object.keys(c).length===0)return e;if(!Z.some((i)=>e.includes(`${i}=`)))return e;let t=wr(e);if(Array.isArray(c.__stx_client_signal_names)){for(let i of c.__stx_client_signal_names)if(typeof i==="string")t.add(i)}let n=e,s=[],a=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,f;while((f=a.exec(n))!==null){let[i,p,m]=f,r=f.index,l=r+i.length,g=Z.map((A)=>({attr:A,m:new RegExp(`\\s${A}="([^"]*)"`).exec(m)})).find((A)=>A.m!==null);if(!g||!g.m)continue;let u=ci(g.m[1]);if(!u.iterable||!u.itemVar)continue;let d=u.iterable.trim().split(/[.[(]/)[0].trim();if(!d||t.has(d)||!(d in c))continue;let b=j(n,r,p,l);if(b===-1)continue;let S=m.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),E=n.slice(l,b-`</${p}>`.length),y={...c,[u.itemVar]:void 0};if(u.indexVar)y[u.indexVar]=void 0;let x=Rs(E,y),h=u.indexVar?`${u.iterable} as ${u.indexVar} => ${u.itemVar}`:`${u.iterable} as ${u.itemVar}`,R=p.toLowerCase()==="template"?x:`<${p}${S}>${x}</${p}>`;s.push({start:r,end:b,replacement:`@foreach(${h})${R}@endforeach`}),a.lastIndex=b}for(let i=s.length-1;i>=0;i--){let{start:p,end:m,replacement:r}=s[i];n=n.slice(0,p)+r+n.slice(m)}return n}function As(e,c){let t=e,n=/@(for|foreach)\s*\(/g,s,a=[],f=[];while((s=n.exec(t))!==null){let i=s[1],p=s.index,m=p+s[0].length,r=1,l=m;while(l<t.length&&r>0){if(t[l]==="(")r++;else if(t[l]===")")r--;l++}if(r!==0)continue;let g=t.substring(m,l-1).trim(),u=l,d=ci(g),b=i==="for"?"@endfor":"@endforeach",S=1,E=u,y=i==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${i}\\s*\\(|end${i})`,"g");y.lastIndex=u;let x;while((x=y.exec(t))!==null)if(x[1].startsWith(i))S++;else if(S--,S===0){E=x.index+x[0].length;break}if(S!==0)continue;let h=()=>{let v=[d.itemVar,d.indexVar].filter(Boolean);if(v.length)f.push({start:p,end:E,vars:v})};if(d.iterable){let v=d.iterable.trim();if(v.startsWith("[")||v.startsWith("{")||v.startsWith("'")||v.startsWith('"')||v.startsWith("`")||/^-?\d/.test(v)){h();continue}let I=v.split(/[.[(]/)[0].trim(),_=c?I in c:!1,V=f.some((P)=>p>P.start&&p<P.end&&P.vars.includes(I));if(I&&(_||V)){h();continue}}if(d.style==="as")g=d.indexVar?`(${d.itemVar}, ${d.indexVar}) in ${d.iterable}`:`${d.itemVar} in ${d.iterable}`;let R=t.substring(u,E-b.length).trim(),A=c?{...c}:{};if(d.itemVar)delete A[d.itemVar];if(d.indexVar)delete A[d.indexVar];let C=dg(As(R,A)),T=C.match(H),k;if(T){let[,v,I,_]=T;k=`<${v}${I} @for="${g}">${_}</${v}>`}else k=`<template @for="${g}">${C}</template>`;a.push({start:p,end:E,replacement:k}),n.lastIndex=E}for(let i=a.length-1;i>=0;i--){let{start:p,end:m,replacement:r}=a[i];t=t.substring(0,p)+r+t.substring(m)}return t}function le(e){let c=new Set,t=[],n=0,s=0,a=e.length,f=(r)=>{let l=n+1;while(l<a){let g=e[l];if(g==="\\"){l+=2;continue}if(g===r)return l+1;l++}return a},i=()=>{let r=n+2;while(r<a&&e[r]!==`
|
|
4
4
|
`)r++;return r},p=()=>{let r=n+2;while(r<a-1){if(e[r]==="*"&&e[r+1]==="/")return r+2;r++}return a},m=(r)=>{let l=r,g=0;while(l<a){let u=e[l];if(u==="/"&&e[l+1]==="/"){let d=l+2;while(d<a&&e[d]!==`
|
|
5
|
-
`)d++;l=d;continue}if(u==="/"&&e[l+1]==="*"){let d=l+2;while(d<a-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;l=d+2;continue}if(u==='"'||u==="'"||u==="`"){let d=l+1;while(d<a){if(e[d]==="\\"){d+=2;continue}if(e[d]===u){d++;break}d++}l=d;continue}if(u==="("||u==="["||u==="{"){g++,l++;continue}if(u===")"||u==="]"||u==="}"){g--,l++;continue}if(u===";"&&g===0)return l+1;l++}return a};while(n<a){let r=e[n];if(r==="/"&&e[n+1]==="/"){let l=i();t.push(e.slice(n,l)),n=l;continue}if(r==="/"&&e[n+1]==="*"){let l=p();t.push(e.slice(n,l)),n=l;continue}if(r==='"'||r==="'"||r==="`"){let l=f(r);t.push(e.slice(n,l)),n=l;continue}if(r==="{"){s++,t.push(r),n++;continue}if(r==="}"){s--,t.push(r),n++;continue}if(s===0){let l=n>0?e[n-1]:"";if(l===""||/\s/.test(l)||l===";"||l==="}"||l==="{"){let u=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(u){let d=u[2],b=m(n+u[0].length);if(c.has(d)){t.push(`/* stx: deduped const ${d} */`),n=b;continue}c.add(d),t.push(e.slice(n,b)),n=b;continue}}}t.push(r),n++}return t.join("")}var ue=new Set(["script","style","html","head","meta","link","title","!doctype"]);function fe(e){let c=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${X})>`,"iy"),t=null,n=null;return w(e,(s,a)=>{c.lastIndex=a;let f=c.exec(s);if(!f)return-1;let i=f[1].toLowerCase();if(i==="script"||i==="style")return-1;let p=a+f[0].length-1;if(i==="body"&&n===null)n=p;if(t===null&&!ue.has(i))t=p;return a+f[0].length}),n??t}function de(e,c,t,n){let s=[],a=` data-stx="${n}"`,f=0,i=!1,p=(m)=>{if(t!==null&&!i&&t>=f&&t<=m)s.push(e.slice(f,t),a,e.slice(t,m)),i=!0;else s.push(e.slice(f,m))};for(let m of c){if(m.start<f)continue;p(m.start),f=m.end}return p(e.length),s.join("")}async function Ps(e,c,t,n={}){let s=Ts(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,f=[],{hasUserImports:i,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
5
|
+
`)d++;l=d;continue}if(u==="/"&&e[l+1]==="*"){let d=l+2;while(d<a-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;l=d+2;continue}if(u==='"'||u==="'"||u==="`"){let d=l+1;while(d<a){if(e[d]==="\\"){d+=2;continue}if(e[d]===u){d++;break}d++}l=d;continue}if(u==="("||u==="["||u==="{"){g++,l++;continue}if(u===")"||u==="]"||u==="}"){g--,l++;continue}if(u===";"&&g===0)return l+1;l++}return a};while(n<a){let r=e[n];if(r==="/"&&e[n+1]==="/"){let l=i();t.push(e.slice(n,l)),n=l;continue}if(r==="/"&&e[n+1]==="*"){let l=p();t.push(e.slice(n,l)),n=l;continue}if(r==='"'||r==="'"||r==="`"){let l=f(r);t.push(e.slice(n,l)),n=l;continue}if(r==="{"){s++,t.push(r),n++;continue}if(r==="}"){s--,t.push(r),n++;continue}if(s===0){let l=n>0?e[n-1]:"";if(l===""||/\s/.test(l)||l===";"||l==="}"||l==="{"){let u=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(u){let d=u[2],b=m(n+u[0].length);if(c.has(d)){t.push(`/* stx: deduped const ${d} */`),n=b;continue}c.add(d),t.push(e.slice(n,b)),n=b;continue}}}t.push(r),n++}return t.join("")}var ue=new Set(["script","style","html","head","meta","link","title","!doctype"]);function fe(e){let c=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${X})>`,"iy"),t=null,n=null;return w(e,(s,a)=>{c.lastIndex=a;let f=c.exec(s);if(!f)return-1;let i=f[1].toLowerCase();if(i==="script"||i==="style")return-1;let p=a+f[0].length-1;if(i==="body"&&n===null)n=p;if(t===null&&!ue.has(i))t=p;return a+f[0].length}),n??t}function de(e,c,t,n){let s=[],a=` data-stx="${n}"`,f=0,i=!1,p=(m)=>{if(t!==null&&!i&&t>=f&&t<=m)s.push(e.slice(f,t),a,e.slice(t,m)),i=!0;else s.push(e.slice(f,m))};for(let m of c){if(m.start<f)continue;p(m.start),f=m.end}return p(e.length),s.join("")}async function Ps(e,c,t,n={}){let s=Ts(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,f=[],{hasUserImports:i,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-72qdbhfh.js"));for(let x of s){let h=x.body;if(Ge(x.attrs))h=Xe(h);if(n.forceClientSetup||a.test(h)){f.push({content:h,start:x.start,end:x.end});continue}if(!i(h))continue;try{let R=await p(Kt(h).code,c||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(a.test(R))f.push({content:h,start:x.start,end:x.end})}catch{}}if(f.length===0)return{output:e,setupCode:null};let m=`${c??""}\x00${f.map((x)=>x.content).join("\x00")}`,r=`__stx_setup_${Bun.hash(m).toString(36).slice(0,10)}`,l=[];for(let x=0;x<f.length;x++){let h=f[x].bundled??Kt(f[x].content).code;if(!f[x].bundled&&i(h))h=await p(h,c||"",{projectRoot:process.cwd()});h=Pt(h);let R=M(h);l.push(`// \u2500\u2500 merged signal script #${x+1} \u2500\u2500
|
|
6
6
|
${R}`)}let g=l.join(`
|
|
7
7
|
|
|
8
8
|
`);g=le(g);let d=G(g).split(",").map((x)=>x.trim()).filter(Boolean),b=Rn(g,t),S=`
|