@stacksjs/stx 0.2.648 → 0.2.654
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-17srvghf.js +2 -0
- package/dist/{chunk-nt0n0vjm.js → chunk-1zb7ar32.js} +2 -2
- package/dist/{chunk-e87xa4r3.js → chunk-26whq1rg.js} +2 -2
- package/dist/{chunk-k79x96ra.js → chunk-28jtt8hn.js} +42 -42
- package/dist/{chunk-zsgcsqat.js → chunk-2yg9y1na.js} +99 -99
- package/dist/{chunk-481d4kr9.js → chunk-2zqg980j.js} +1 -1
- package/dist/{chunk-x5tjb4y4.js → chunk-35zjpdcb.js} +1 -1
- package/dist/chunk-3634ds4n.js +2 -0
- package/dist/{chunk-nj1t4g3a.js → chunk-36649w15.js} +6 -6
- package/dist/chunk-3msbc4zj.js +2 -0
- package/dist/chunk-3q3gsr7m.js +2 -0
- package/dist/{chunk-3q163st5.js → chunk-3v8yejzc.js} +3 -3
- package/dist/chunk-42v0vegr.js +2 -0
- package/dist/{chunk-2jh21f1n.js → chunk-46w53nj5.js} +1 -1
- package/dist/{chunk-0jhdrgpr.js → chunk-48acjmeg.js} +2 -2
- package/dist/{chunk-55zaxb4s.js → chunk-4e0z858k.js} +10 -10
- package/dist/{chunk-yq021b3r.js → chunk-4nbq7mnp.js} +4 -4
- package/dist/{chunk-7rta163c.js → chunk-4qwvqbzf.js} +2 -2
- package/dist/{chunk-hjm69qnj.js → chunk-50pkybyn.js} +1 -1
- package/dist/{chunk-88z4wkrj.js → chunk-5yxd4ryz.js} +2 -2
- package/dist/{chunk-vqc4h16r.js → chunk-6598d3m6.js} +2 -2
- package/dist/{chunk-ab7zqtax.js → chunk-6raq8r7w.js} +1 -1
- package/dist/{chunk-zmh9p9aa.js → chunk-6rparhvs.js} +1 -1
- package/dist/{chunk-t1k9160w.js → chunk-71mthavp.js} +32 -32
- package/dist/chunk-73swyb5p.js +2 -0
- package/dist/{chunk-b0hpshvk.js → chunk-7wnd2psp.js} +1 -1
- package/dist/{chunk-ymymwzt5.js → chunk-8gewq710.js} +1 -1
- package/dist/{chunk-3zyjqvsq.js → chunk-929zbzh7.js} +9 -9
- package/dist/{chunk-v2x9vzgw.js → chunk-9y2ncrnq.js} +2 -2
- package/dist/{chunk-c9k40352.js → chunk-a2a74f6c.js} +1 -1
- package/dist/{chunk-67xhsacd.js → chunk-bgt1dx8c.js} +1 -1
- package/dist/chunk-c9b0cme2.js +2 -0
- package/dist/{chunk-89yj6tcd.js → chunk-cq40n7ak.js} +1 -1
- package/dist/{chunk-f46ht5kq.js → chunk-cvw7gknw.js} +3 -3
- package/dist/chunk-d0xcykw6.js +2 -0
- package/dist/{chunk-vdxjy7j2.js → chunk-d3bsfd10.js} +2 -2
- package/dist/{chunk-rjh2jwxx.js → chunk-d4tf0tfn.js} +4 -4
- package/dist/chunk-dxjc11hx.js +2 -0
- package/dist/{chunk-zhf01af3.js → chunk-dxk5sqtv.js} +2 -2
- package/dist/chunk-edz1h5f9.js +2 -0
- package/dist/{chunk-fg3jw17w.js → chunk-en8jgavy.js} +6 -5
- package/dist/chunk-etw04j02.js +2 -0
- package/dist/chunk-ewng6v6g.js +49 -0
- package/dist/{chunk-9121nkpj.js → chunk-ex1kd5gs.js} +3 -3
- package/dist/chunk-fbd9w4ys.js +2 -0
- package/dist/{chunk-qfe7ps3v.js → chunk-ff1cb7k4.js} +2 -2
- package/dist/chunk-fnj3gja0.js +2 -0
- package/dist/chunk-fsnby15p.js +2 -0
- package/dist/{chunk-pbtkbe48.js → chunk-g7j3mwzd.js} +18 -18
- package/dist/{chunk-3p7mk3mw.js → chunk-gmrc24cb.js} +1 -1
- package/dist/{chunk-p44kmbdg.js → chunk-h09a03ay.js} +4 -4
- package/dist/chunk-h0bg2h0j.js +2 -0
- package/dist/{chunk-wjt0kej9.js → chunk-h4vg78mw.js} +1 -1
- package/dist/{chunk-4q2dtxdk.js → chunk-hjmnsa6a.js} +1 -1
- package/dist/{chunk-er60h3j3.js → chunk-ht3dxx5m.js} +1 -1
- package/dist/{chunk-h5nmf98w.js → chunk-hw7sv4ac.js} +1 -1
- package/dist/{chunk-pg0xzsss.js → chunk-j2bkjtp3.js} +4 -4
- package/dist/chunk-j3472s37.js +3 -0
- package/dist/chunk-jmx4q1yr.js +2 -0
- package/dist/{chunk-j393gsfd.js → chunk-k49fg322.js} +2 -2
- package/dist/{chunk-0vkawews.js → chunk-k7nan28e.js} +5 -5
- package/dist/{chunk-06w0z1cm.js → chunk-kcrtqyek.js} +4 -4
- package/dist/{chunk-t2pzy3x1.js → chunk-khvc43pq.js} +2 -2
- package/dist/{chunk-qm4672dj.js → chunk-ktvr9ta8.js} +2 -2
- package/dist/{chunk-wq6j2h32.js → chunk-m47spkxr.js} +7 -7
- package/dist/chunk-m947aq9a.js +2 -0
- package/dist/{chunk-jkaszw24.js → chunk-mgj34bbg.js} +1 -1
- package/dist/{chunk-r1r6311d.js → chunk-n7xbhzzt.js} +4 -4
- package/dist/chunk-ndtxkps4.js +2 -0
- package/dist/{chunk-np4zm2ph.js → chunk-nttspz8c.js} +4 -4
- package/dist/chunk-pge3bzqx.js +2 -0
- package/dist/{chunk-9txn4rvb.js → chunk-phws2c9s.js} +1 -1
- package/dist/{chunk-j5gd0e53.js → chunk-q1x7ckfw.js} +1 -1
- package/dist/chunk-q79ksfcd.js +2 -0
- package/dist/chunk-qjf1c8fa.js +2 -0
- package/dist/{chunk-gv793yqq.js → chunk-qrt8b179.js} +2 -2
- package/dist/{chunk-w2zceynt.js → chunk-qygynhzc.js} +1 -1
- package/dist/{chunk-6ea6az61.js → chunk-ra56jh7e.js} +1 -1
- package/dist/chunk-rmdw6s65.js +2 -0
- package/dist/chunk-s0crnpyx.js +2 -0
- package/dist/{chunk-8p9kpfk8.js → chunk-s4cs2n2c.js} +1 -1
- package/dist/{chunk-t82be9yf.js → chunk-sd4jwn3y.js} +1 -1
- package/dist/chunk-t7j4h3nf.js +128 -0
- package/dist/{chunk-sgptbhrc.js → chunk-v9bmw06j.js} +1 -1
- package/dist/{chunk-gz90fqn8.js → chunk-vmn2b6p6.js} +1 -1
- package/dist/{chunk-aprhqxky.js → chunk-vngnface.js} +3 -3
- package/dist/{chunk-0h8tg21j.js → chunk-vs8kg85h.js} +1 -1
- package/dist/{chunk-84djpte6.js → chunk-wbzmr6a4.js} +2 -2
- package/dist/{chunk-ye8tgmd3.js → chunk-wh838rdh.js} +1 -1
- package/dist/{chunk-xm2mee4a.js → chunk-x9d4bpmh.js} +21 -21
- package/dist/{chunk-mnp8ecj9.js → chunk-xdgvb5a5.js} +1 -1
- package/dist/{chunk-pxs7sgnp.js → chunk-xhmpfq9d.js} +1 -1
- package/dist/{chunk-hfpv56cp.js → chunk-xq410rsc.js} +1 -1
- package/dist/{chunk-xvs04cnp.js → chunk-y8881za3.js} +1 -1
- package/dist/chunk-z75bp57x.js +2 -0
- package/dist/{chunk-8d2f2e42.js → chunk-znnfjxph.js} +1 -1
- package/dist/chunk-zrqremja.js +2 -0
- package/dist/cli.js +11 -11
- package/dist/client/signals-head-runtime.js +2 -1
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/expressions.js +9 -0
- package/dist/interpolation-context.d.ts +2 -0
- package/dist/interpolation-context.js +8 -0
- package/dist/native/bridge/protocol.d.ts +2 -0
- package/dist/native/compiler/bundle.d.ts +6 -0
- package/dist/native/compiler/bundle.js +16 -9
- package/dist/native/compiler/headwind-to-style.d.ts +5 -1
- package/dist/native/compiler/headwind-to-style.js +188 -3
- package/dist/native/compiler/html-to-ir.d.ts +2 -1
- package/dist/native/compiler/html-to-ir.js +9 -4
- package/dist/native/compiler/ir.d.ts +15 -0
- package/dist/native/compiler/layout-chrome.d.ts +6 -0
- package/dist/native/compiler/layout-chrome.js +72 -0
- package/dist/native/compiler/render-screen.js +19 -3
- package/dist/native/compiler/style-config.d.ts +32 -0
- package/dist/native/compiler/style-config.js +71 -0
- package/dist/native/compiler/stylesheet-rules.d.ts +17 -0
- package/dist/native/compiler/stylesheet-rules.js +107 -0
- package/dist/native/runtime/browser-screen.js +11 -0
- package/dist/native/runtime/craft-bridge.d.ts +3 -0
- package/dist/native/runtime/craft-bridge.js +41 -4
- package/dist/native/runtime/jsc-globals.d.ts +2 -0
- package/dist/native/runtime/jsc-globals.js +8 -1
- package/dist/native/runtime/native-host.d.ts +5 -0
- package/dist/native/runtime/native-host.js +48 -5
- package/dist/native/runtime/shared-screen.js +18 -2
- package/dist/native/runtime/web-navigation.d.ts +33 -0
- package/dist/native/runtime/web-navigation.js +107 -0
- package/dist/native/runtime/web-storage.d.ts +56 -0
- package/dist/native/runtime/web-storage.js +89 -0
- package/dist/native/testing.d.ts +3 -0
- package/dist/native/testing.js +3 -0
- package/dist/native-signing.d.ts +2 -0
- package/dist/native-signing.js +13 -4
- package/dist/process.js +2 -0
- package/dist/pwa.js +3 -3
- package/dist/reactive-bindings.js +3 -1
- package/dist/ssg.js +12 -12
- package/dist/utils.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-0en5jwjy.js +0 -2
- package/dist/chunk-2n3pa5gm.js +0 -2
- package/dist/chunk-354jmw2k.js +0 -3
- package/dist/chunk-3b5bphcn.js +0 -2
- package/dist/chunk-57md41g9.js +0 -2
- package/dist/chunk-6vh8s0pg.js +0 -2
- package/dist/chunk-8fsq2ynj.js +0 -2
- package/dist/chunk-8tpmz4as.js +0 -2
- package/dist/chunk-9x0zt65f.js +0 -2
- package/dist/chunk-a2bw46t9.js +0 -2
- package/dist/chunk-a4sggwcz.js +0 -2
- package/dist/chunk-b4fd2dtk.js +0 -2
- package/dist/chunk-c1479y92.js +0 -2
- package/dist/chunk-embejqx4.js +0 -2
- package/dist/chunk-eyfxw7ds.js +0 -2
- package/dist/chunk-f3y4fnaa.js +0 -2
- package/dist/chunk-f7930sce.js +0 -2
- package/dist/chunk-fsbjat59.js +0 -2
- package/dist/chunk-h15xb2vd.js +0 -2
- package/dist/chunk-m6qfqkbh.js +0 -2
- package/dist/chunk-ncqh5qe5.js +0 -2
- package/dist/chunk-radggg3p.js +0 -49
- package/dist/chunk-sszhz1zh.js +0 -2
- package/dist/chunk-weqc0ssb.js +0 -2
- package/dist/chunk-xfzcv0jc.js +0 -2
- package/dist/chunk-y9x4pyp2.js +0 -2
- package/dist/chunk-zdnc7a4t.js +0 -127
- package/dist/chunk-zyqs6a3p.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Co,Ea,r,_t,te,S,Re,on,Ae,le,q,or,an,us,La,ln,cr,ps,gs,ja,Ao,Ba,Fa,za,Ha,Ie,Oe,ms,Me,n,pn,g,m,F,K,be,k,C}from"./chunk-2yg9y1na.js";import{l,d,E,t,re,z,a,ve,zo,D,hn,Ho,Mt,Vo,ec,pr,tc,nt,nc,fr,rc,yn,Uo,sc,gr,hr,we,Wo}from"./chunk-4e0z858k.js";import{Ot}from"./chunk-2h8ea0we.js";import{gn}from"./chunk-35zjpdcb.js";import{h}from"./chunk-ff1cb7k4.js";import{er,ts}from"./chunk-qrt8b179.js";import{ua,da,Yn,Ke,pa,R}from"./chunk-3v8yejzc.js";import{mo,ho,yo,bo}from"./chunk-h09a03ay.js";import{oa,Br}from"./chunk-929zbzh7.js";import{Dr,Mr,Lr}from"./chunk-ewng6v6g.js";import{Nr,qn}from"./chunk-36649w15.js";import{Fr,io,ao,zr,Hr,co}from"./chunk-k7nan28e.js";import{Zs}from"./chunk-prf164ct.js";import{ee,no,ro,so}from"./chunk-8gewq710.js";import{Gn,ge,aa,Kn,ca}from"./chunk-n7xbhzzt.js";import{U,qe}from"./chunk-szyqxcfj.js";import{fa,ga}from"./chunk-26whq1rg.js";import{_,bn,qo}from"./chunk-j3472s37.js";import fs from"fs";import ce from"path";function lt(){return`
|
|
3
3
|
// STX Lifecycle Runtime
|
|
4
4
|
(function() {
|
|
5
5
|
if (typeof window === 'undefined') return;
|
|
@@ -347,7 +347,7 @@ else {
|
|
|
347
347
|
|
|
348
348
|
console.log('[stx] Lifecycle runtime initialized');
|
|
349
349
|
})();
|
|
350
|
-
`}function Je(c){return Symbol(c)}var Ts=Je("theme"),Cs=Je("router"),As=Je("i18n");import*as dt from"crypto";function ut(c){let e=/\$(\w+)\./g,u=[],o;while((o=e.exec(c))!==null)if(!u.includes(o[1]))u.push(o[1]);return u}function In(){return`stx-${dt.randomBytes(4).toString("hex")}`}function On(c){return/\$\w+\./.test(c)}function Pn(c){if(
|
|
350
|
+
`}function Je(c){return Symbol(c)}var Ts=Je("theme"),Cs=Je("router"),As=Je("i18n");import*as dt from"crypto";function ut(c){let e=/\$(\w+)\./g,u=[],o;while((o=e.exec(c))!==null)if(!u.includes(o[1]))u.push(o[1]);return u}function In(){return`stx-${dt.randomBytes(4).toString("hex")}`}function On(c){return/\$\w+\./.test(c)}function Pn(c){if(!/\{\{[^}]*\$\w/.test(c)||!/\$\w+\./.test(c))return{html:c,bindings:[],stores:new Set};let e=[],u=new Set,o=/<(\w+)([^>]*?)(\s*\/?>)/g,f=c;return f=f.replace(o,(i,p,v,y)=>{if(["script","style","template"].includes(p.toLowerCase()))return i;if(!v.includes("{{"))return i;let x=[],b=!1,w=v,T=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,A=[...v.matchAll(T)];for(let I of A){let P=I[0],N=I[1],V=I[2];if(On(V)){b=!0;let X=V.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(X){let L=X[1];if(x.push({attr:N,expr:L,fullMatch:P,originalAttr:N}),ut(L).forEach((H)=>u.add(H)),N==="text")w=w.replace(P,"");else if(N==="class")w=w.replace(P,'class=""');else if(N==="disabled"||N==="hidden")w=w.replace(P,"");else w=w.replace(P,`${N}=""`)}}}if(!b)return i;let O=w.match(/\bid\s*=\s*"([^"]+)"/),M;if(O)M=O[1];else M=In(),w=` id="${M}"${w}`;for(let I of x)e.push({elementId:M,attribute:I.attr,expression:I.expr,stores:ut(I.expr)});return`<${p}${w}${y}`}),{html:f,bindings:e,stores:u}}function Ln(c,e){if(c.length===0)return"";let u=Array.from(e),o=`
|
|
351
351
|
<script>
|
|
352
352
|
(function() {
|
|
353
353
|
'use strict';
|
|
@@ -815,7 +815,7 @@ window.__stx_reactive = (function() {
|
|
|
815
815
|
|
|
816
816
|
return { initScope: initScope, reactive: reactive };
|
|
817
817
|
})();
|
|
818
|
-
`}function yt(c,e){let u=c.replace(/\{!!([\s\S]*?)!!\}/g,(v,y)=>{try{let x=
|
|
818
|
+
`}function yt(c,e){let u=c.replace(/\{!!([\s\S]*?)!!\}/g,(v,y)=>{try{let x=C(y,e,!0);if(x===void 0)return v;return String(x)}catch{return v}}),o="",f=0,i=null;while(f<u.length){let v=u[f];if(i&&v==="\\"){o+=v+(u[f+1]??""),f+=2;continue}if(v==="{"&&u[f+1]==="{"){let y=u.indexOf("}}",f+2);if(y!==-1){let x=u.slice(f,y+2);o+=p(u.slice(f+2,y),x,i),f=y+2;continue}}if(i){if(v===i)i=null}else if(v==="'"||v==='"'||v==="`")i=v;o+=v,f++}return o;function p(v,y,x){let b;try{b=C(v,e,!0)}catch{return y}if(b===void 0)return y;if(x){let w=String(b).replace(/\\/g,"\\\\").replace(new RegExp(x==="`"?"`":x,"g"),`\\${x}`).replace(/\r/g,"\\r").replace(/\n/g,"\\n");return x==="`"?w.replace(/\$\{/g,"\\${"):w}if(typeof b==="string"){let w=b.trim();if(w.startsWith("{")&&w.endsWith("}")||w.startsWith("[")&&w.endsWith("]"))try{return JSON.parse(w),w}catch{}}return JSON.stringify(b)}}function nr(c,e){if(c.length===0)return"";let u=c.map((o)=>{let f=JSON.stringify(Object.fromEntries(o.refs)),i=yt(o.stateExpr,e),p=o.initExpr?yt(o.initExpr,e):null,v=JSON.stringify(i),y=p?JSON.stringify(p):"null";return`
|
|
819
819
|
(function() {
|
|
820
820
|
var scopeEl = document.querySelector('${o.selector}');
|
|
821
821
|
if (!scopeEl) return;
|
|
@@ -828,14 +828,14 @@ ${tr()}
|
|
|
828
828
|
${u}
|
|
829
829
|
</script>`}function vt(c,e,u){if(!sr(c))return c;let o=Xn(c);if(o.length===0)return c;let f=rr(c,o),i=nr(o,e),p=f.lastIndexOf("</body>");if(p!==-1)f=f.slice(0,p)+i+`
|
|
830
830
|
`+f.slice(p);else f+=i;return f}function rr(c,e){let u=0,o=c.replace(/<([a-z][a-z0-9-]*)(\s+[^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,(f,i,p)=>{let v=e[u++];if(!v)return f;let y=/data-stx-scope="([^"]*)"/.exec(p);if(y)return v.id=y[1],v.selector=`[data-stx-scope="${v.id}"]`,f;return`<${i} data-stx-scope="${v.id}"${p}>`});return o=o.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),o=o.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),o=o.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),o=o.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),o}function sr(c){return/x-data\s*=\s*["']/.test(c)}import ir from"fs";import Ze from"path";import{createHighlighter as ar}from"ts-syntax-highlighter";var Qe=new Map;async function Ee(c,e={}){try{if(!await n(c))throw Error(`Markdown file not found: ${c}`);let o=(await ir.promises.stat(c)).mtime.getTime();if(e.cache&&Qe.has(c)){let w=Qe.get(c);if(w.updatedAt>=o)return{content:w.content,data:w.data}}let f=await Bun.file(c).text(),{data:i,content:p}=Yn(f),v=e.markdown||R.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},x=Ke(p,{gfm:!0});if(v.syntaxHighlighting?.enabled&&v.syntaxHighlighting?.serverSide)x=await lr(x,v.syntaxHighlighting?.defaultTheme||"github-dark",v.syntaxHighlighting?.highlightUnknownLanguages||!1);let b={content:x,data:i||{}};if(e.cache)Qe.set(c,{...b,updatedAt:o});return b}catch(u){if(e.debug)console.error(`Error reading/parsing markdown file ${c}:`,u);let o=u instanceof Error?u.message:String(u);return{content:g("Markdown File",`Error reading/parsing markdown file: ${o}`,c,"",0,""),data:{}}}}var Ue=null;async function lr(c,e,u){let o=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Ue)try{Ue=await ar({theme:e||"github-dark",cache:!0})}catch(v){return console.error("Failed to initialize ts-syntax-highlighter:",v),c}let f=async(v,y,x,b)=>{let w=b.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'"),T=x||(u?"text":"");if(!T)return v;try{if(!Ue.getSupportedLanguages().includes(T))return v;return(await Ue.highlight(w,T,{theme:e})).html}catch(A){console.error(`Error highlighting code block with language ${x}:`,A)}return v},i=c,p=c.matchAll(o);for(let v of p){let[y,x,b,w]=v,T=await f(y,x,b,w);i=i.replace(y,T)}return i}async function bt(c,e,u="",o={}){return await ur(c,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(p,v,y,x)=>{try{let b=v;if(!Ze.isAbsolute(v))b=Ze.resolve(Ze.dirname(u),v);let w={};if(y)try{try{w=JSON.parse(y)}catch{if(o.debug)console.warn("Using safer alternative for parsing JS object literal");let N=y.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let V of N){let X=V.indexOf(":");if(X>0){let L=V.substring(0,X).trim(),j=V.substring(X+1).trim(),H=j.startsWith('"')&&j.endsWith('"'),G=j.startsWith("'")&&j.endsWith("'");if(H||G)j=j.substring(1,j.length-1);w[L]=j}}}}catch(P){if(o.debug)console.error("Error parsing context in @markdown-file directive:",P)}let{content:T,data:A}=await Ee(b,o),O={...e,...A,...w},M=T,I=/\{\{([^}]+)\}\}/g;return M=M.replace(I,(P,N)=>{let V=N.trim();return O[V]!==void 0?String(O[V]):P}),M}catch(b){let w=b instanceof Error?b.message:String(b);return g("Markdown File",`Error including markdown file: ${w}`,u,c,x,p)}})}async function ur(c,e,u){let o=[],f;while((f=e.exec(c))!==null){let v=f[0],y=f.index,x=f;o.push(u(...x).then((b)=>({match:v,replacement:b,index:y})))}let i=await Promise.all(o);i.sort((v,y)=>y.index-v.index);let p=c;for(let{match:v,replacement:y}of i)p=p.replace(v,()=>y);return p}var wt=new WeakMap;function xt(c=16){let e=new Uint8Array(c);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e))}function Ve(c,e){if(!c)return e?.nonceGenerator?.()??xt();let u=wt.get(c);if(!u)u=e?.nonceGenerator?.()??xt(),wt.set(c,u);return u}function dr(c,e){let u=[];for(let[o,f]of Object.entries(c)){if(f===void 0||f===null)continue;if(typeof f==="boolean"){if(f)u.push(o);continue}if(Array.isArray(f)){let i=[...f];if(e&&(o==="script-src"||o==="style-src"))i=i.filter((p)=>!p.startsWith("'nonce-")),i.push(`'nonce-${e}'`);if(i.length>0)u.push(`${o} ${i.join(" ")}`)}}return u.join("; ")}function kt(c,e){return`<meta http-equiv="Content-Security-Policy" content="${dr(c,e).replace(/&/g,"&").replace(/"/g,""")}">`}function St(c,e,u){if(!e.enabled||!e.addMetaTag)return c;if(c.includes('http-equiv="Content-Security-Policy"'))return c;if(!c.includes("<head>")&&!c.includes("<head "))return c;let o=e.useNonce?Ve(u,e):void 0,f=kt(e.directives,o);return c.replace(/<head([^>]*)>/,`<head$1>
|
|
831
|
-
${f}`)}function $t(c,e){let u=c;return u=u.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(o,f)=>{if(f.includes("nonce="))return o;return`<script nonce="${e}"${f}>`}),u=u.replace(/<style([^>]*)>/gi,(o,f)=>{if(f.includes("nonce="))return o;return`<style nonce="${e}"${f}>`}),u}function Et(c,e,u,o){let f=c,i=o.csp;if(f=f.replace(/@csp\b/g,()=>{if(!i?.enabled||!i.directives)return"<!-- CSP not configured -->";let p=i.useNonce?Ve(e,i):void 0;return kt(i.directives,p)}),f=f.replace(/@cspNonce\b/g,()=>{if(!i?.enabled||!i.useNonce)return"";return Ve(e,i)}),i?.enabled&&i.useNonce)e.cspNonce=Ve(e,i);return f}import mr from"crypto";var yr=40,_t="_token",Ye=null;function vr(c=yr){let e=mr.randomBytes(Math.ceil(c/2)).toString("hex").slice(0,c);return Ye=e,e}function br(){if(!Ye)vr();return Ye}function wr(c=_t){let e=br();return`<input type="hidden" name="${c}" value="${e}">`}function Tt(c){return c.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,u,o)=>wr(o||_t))}async function At(c,e,u,o){if(!o.customDirectives||o.customDirectives.length===0)return c;let f=c;for(let i of o.customDirectives){if(!i.name||typeof i.handler!=="function"){if(o.debug)console.warn("Invalid custom directive:",i);continue}if(i.hasEndTag)f=await xr(f,i,e,u,o);else f=await kr(f,i,e,u,o)}return f}async function xr(c,e,u,o,f){let{name:i,handler:p}=e,v=`@${i}`,y=`@end${i}`,x=c,b=Ct(`${v}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${y}`,"g"),w=[],T=b.exec(x);while(T!==null){let[A,O="",M=""]=T,I=T.index||0;try{let P=O?Rt(e,O):[],N=M.trim(),V=await p(N,P,u,o);w.push({original:A,processed:V,startIndex:I})}catch(P){let N=P instanceof Error?P.message:String(P);if(f.debug)console.error(`Error processing custom directive @${i}:`,P);w.push({original:A,processed:a("CustomDirective",`Error in @${i}${O?`(${O})`:""}: ${N}`,t.EVALUATION_ERROR),startIndex:I})}T=b.exec(x)}for(let A=w.length-1;A>=0;A--){let{original:O,processed:M}=w[A];x=x.replace(O,M)}return x}async function kr(c,e,u,o,f){let{name:i,handler:p}=e,v=c,y=[],x=[];if(e.rawParams){for(let T of Ho(v,Ct(`(?<![\\w$@])@${i}\\s*\\(`,"g")))if(T.end!==-1)x.push({fullMatch:T.call,paramString:T.args,startIndex:T.start})}else{let T=Ct(`@${i}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");T.lastIndex=0;let A=T.exec(v);while(A!==null)x.push({fullMatch:A[0],paramString:A[1]??"",startIndex:A.index||0}),A=T.exec(v)}for(let{fullMatch:T,paramString:A,startIndex:O}of x)try{let M=Rt(e,A),I=await p("",M,u,o);y.push({original:T,processed:I,startIndex:O})}catch(M){let I=M instanceof Error?M.message:String(M);if(f.debug)console.error(`Error processing custom directive @${i}:`,M);y.push({original:T,processed:a("CustomDirective",`Error in @${i}(${A}): ${I}`,t.EVALUATION_ERROR),startIndex:O})}let b=Ct(`@${i}(?!\\w)(?!\\s*\\()`,"g"),w=b.exec(v);while(w!==null){let[T]=w,A=w.index||0;try{let O=await p("",[],u,o);y.push({original:T,processed:O,startIndex:A})}catch(O){let M=O instanceof Error?O.message:String(O);if(f.debug)console.error(`Error processing custom directive @${i}:`,O);y.push({original:T,processed:a("CustomDirective",`Error in @${i}: ${M}`,t.EVALUATION_ERROR),startIndex:A})}w=b.exec(v)}for(let T=y.length-1;T>=0;T--){let{original:A,processed:O}=y[T];v=v.replace(A,O)}return v}function Rt(c,e){return c.rawParams?Mt(e):Sr(e)}function Sr(c){if(!c.trim())return[];let e=[],u="",o=!1,f="";for(let i=0;i<c.length;i++){let p=c[i];if((p==='"'||p==="'")&&(i===0||c[i-1]!=="\\"))if(!o)o=!0,f=p;else if(p===f)o=!1;else u+=p;else if(p===","&&!o)e.push(u.trim()),u="";else u+=p}if(u.trim())e.push(u.trim());return e.map((i)=>{let p=i.trim();if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))return p.substring(1,p.length-1);return p})}var Dt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,It=/^[A-Za-z_$][\w$]*$/,$r=new Set(["light","dark","system"]);function Se(c,e){if(typeof c!=="string"||c.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function Er(c){if(!c||typeof c!=="object"||Array.isArray(c))throw Error("@appearanceBootstrap expects an options object");let e=c,{appearance:u,colorMode:o}=e;if(Se(e.storageKey,"storageKey"),u!==void 0&&(!u||typeof u!=="object"||Array.isArray(u)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!o||typeof o!=="object"||Array.isArray(o))throw Error("@appearanceBootstrap colorMode must be an object");if(Se(o.key,"colorMode.key"),Se(o.attribute,"colorMode.attribute"),Se(o.default,"colorMode.default"),!It.test(o.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Dt.test(o.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!$r.has(o.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let f=null;if(u){if(Se(u.key,"appearance.key"),Se(u.attribute,"appearance.attribute"),Se(u.default,"appearance.default"),!It.test(u.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Dt.test(u.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(u.allowed)||u.allowed.length===0||u.allowed.some((i)=>typeof i!=="string"||i.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!u.allowed.includes(u.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");f={key:u.key,attribute:u.attribute,allowed:[...new Set(u.allowed)],default:u.default}}return{storageKey:e.storageKey,appearance:f,colorMode:{key:o.key,attribute:o.attribute,default:o.default},respectExisting:e.respectExisting===!0}}function _r(c){return JSON.stringify(c).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Tr(c){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${_r(c)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());if(config.appearance)root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function Cr(c,e){let u=1,o=null,f=!1;for(let i=e+1;i<c.length;i++){let p=c[i];if(f){f=!1;continue}if(o){if(p==="\\")f=!0;else if(p===o)o=null;continue}if(p==='"'||p==="'"||p==="`"){o=p;continue}if(p==="(")u++;else if(p===")"&&--u===0)return i}return-1}function Pt(c,e){let u=c,o=/@appearanceBootstrap\s*\(/g,f;while((f=o.exec(u))!==null){let i=f.index+f[0].length-1,p=Cr(u,i);if(p===-1)throw Error("@appearanceBootstrap has an unclosed options object");let v=u.slice(i+1,p).trim(),y=l(`(${v})`,e),x=Tr(Er(y));u=u.slice(0,f.index)+x+u.slice(p+1),o.lastIndex=f.index+x.length}return u}import Ar from"crypto";function Q(c){return F(String(c??""))}var jt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function ze(c,e,u,o){let f=c||e;return u?`${f} ${o}`:f}function me(c){return String(c).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function De(c,e){if(/\bid\s*=/i.test(c))return"";return` id="${Q(e)}"`}function et(c,e,u){if(!e)return"";let o="";if(!/\baria-invalid\s*=/i.test(u))o+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(u))o+=` aria-describedby="${Q(`${me(c)}-error`)}"`;return o}function Rr(){return Ar.randomUUID()}function We(c,e){let u=c;return u=u.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let o=Rr();e.csrf={token:o}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${Q(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),u=u.replace(/@method\(['"]([^'"]+)['"]\)/g,(o,f)=>{let i=f.toUpperCase();if(f&&!["GET","POST"].includes(i))return`<input type="hidden" name="_method" value="${Q(i)}">`;return o}),u}function Nt(c,e,u=jt){let o=c;return o=o.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(f,i,p,v,y,x="")=>{let b=i||p||"POST",w=v||y||"",T=ye(x),A=b.toUpperCase(),O=["GET","POST"].includes(A)?A:"POST",M=`<form method="${Q(O)}" action="${Q(w)}"${T?` ${T}`:""}>`;if(M+=`
|
|
831
|
+
${f}`)}function $t(c,e){let u=c;return u=u.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(o,f)=>{if(f.includes("nonce="))return o;return`<script nonce="${e}"${f}>`}),u=u.replace(/<style([^>]*)>/gi,(o,f)=>{if(f.includes("nonce="))return o;return`<style nonce="${e}"${f}>`}),u}function Et(c,e,u,o){let f=c,i=o.csp;if(f=f.replace(/@csp\b/g,()=>{if(!i?.enabled||!i.directives)return"<!-- CSP not configured -->";let p=i.useNonce?Ve(e,i):void 0;return kt(i.directives,p)}),f=f.replace(/@cspNonce\b/g,()=>{if(!i?.enabled||!i.useNonce)return"";return Ve(e,i)}),i?.enabled&&i.useNonce)e.cspNonce=Ve(e,i);return f}import mr from"crypto";var yr=40,Tt="_token",Ye=null;function vr(c=yr){let e=mr.randomBytes(Math.ceil(c/2)).toString("hex").slice(0,c);return Ye=e,e}function br(){if(!Ye)vr();return Ye}function wr(c=Tt){let e=br();return`<input type="hidden" name="${c}" value="${e}">`}function Ct(c){return c.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,u,o)=>wr(o||Tt))}async function At(c,e,u,o){if(!o.customDirectives||o.customDirectives.length===0)return c;let f=c;for(let i of o.customDirectives){if(!i.name||typeof i.handler!=="function"){if(o.debug)console.warn("Invalid custom directive:",i);continue}if(i.hasEndTag)f=await xr(f,i,e,u,o);else f=await kr(f,i,e,u,o)}return f}async function xr(c,e,u,o,f){let{name:i,handler:p}=e,v=`@${i}`,y=`@end${i}`,x=c,b=_t(`${v}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${y}`,"g"),w=[],T=b.exec(x);while(T!==null){let[A,O="",M=""]=T,I=T.index||0;try{let P=O?Rt(e,O):[],N=M.trim(),V=await p(N,P,u,o);w.push({original:A,processed:V,startIndex:I})}catch(P){let N=P instanceof Error?P.message:String(P);if(f.debug)console.error(`Error processing custom directive @${i}:`,P);w.push({original:A,processed:a("CustomDirective",`Error in @${i}${O?`(${O})`:""}: ${N}`,t.EVALUATION_ERROR),startIndex:I})}T=b.exec(x)}for(let A=w.length-1;A>=0;A--){let{original:O,processed:M}=w[A];x=x.replace(O,M)}return x}async function kr(c,e,u,o,f){let{name:i,handler:p}=e,v=c,y=[],x=[];if(e.rawParams){for(let T of Ho(v,_t(`(?<![\\w$@])@${i}\\s*\\(`,"g")))if(T.end!==-1)x.push({fullMatch:T.call,paramString:T.args,startIndex:T.start})}else{let T=_t(`@${i}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");T.lastIndex=0;let A=T.exec(v);while(A!==null)x.push({fullMatch:A[0],paramString:A[1]??"",startIndex:A.index||0}),A=T.exec(v)}for(let{fullMatch:T,paramString:A,startIndex:O}of x)try{let M=Rt(e,A),I=await p("",M,u,o);y.push({original:T,processed:I,startIndex:O})}catch(M){let I=M instanceof Error?M.message:String(M);if(f.debug)console.error(`Error processing custom directive @${i}:`,M);y.push({original:T,processed:a("CustomDirective",`Error in @${i}(${A}): ${I}`,t.EVALUATION_ERROR),startIndex:O})}let b=_t(`@${i}(?!\\w)(?!\\s*\\()`,"g"),w=b.exec(v);while(w!==null){let[T]=w,A=w.index||0;try{let O=await p("",[],u,o);y.push({original:T,processed:O,startIndex:A})}catch(O){let M=O instanceof Error?O.message:String(O);if(f.debug)console.error(`Error processing custom directive @${i}:`,O);y.push({original:T,processed:a("CustomDirective",`Error in @${i}: ${M}`,t.EVALUATION_ERROR),startIndex:A})}w=b.exec(v)}for(let T=y.length-1;T>=0;T--){let{original:A,processed:O}=y[T];v=v.replace(A,O)}return v}function Rt(c,e){return c.rawParams?Mt(e):Sr(e)}function Sr(c){if(!c.trim())return[];let e=[],u="",o=!1,f="";for(let i=0;i<c.length;i++){let p=c[i];if((p==='"'||p==="'")&&(i===0||c[i-1]!=="\\"))if(!o)o=!0,f=p;else if(p===f)o=!1;else u+=p;else if(p===","&&!o)e.push(u.trim()),u="";else u+=p}if(u.trim())e.push(u.trim());return e.map((i)=>{let p=i.trim();if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))return p.substring(1,p.length-1);return p})}var Dt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,It=/^[A-Za-z_$][\w$]*$/,$r=new Set(["light","dark","system"]);function Se(c,e){if(typeof c!=="string"||c.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function Er(c){if(!c||typeof c!=="object"||Array.isArray(c))throw Error("@appearanceBootstrap expects an options object");let e=c,{appearance:u,colorMode:o}=e;if(Se(e.storageKey,"storageKey"),u!==void 0&&(!u||typeof u!=="object"||Array.isArray(u)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!o||typeof o!=="object"||Array.isArray(o))throw Error("@appearanceBootstrap colorMode must be an object");if(Se(o.key,"colorMode.key"),Se(o.attribute,"colorMode.attribute"),Se(o.default,"colorMode.default"),!It.test(o.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Dt.test(o.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!$r.has(o.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let f=null;if(u){if(Se(u.key,"appearance.key"),Se(u.attribute,"appearance.attribute"),Se(u.default,"appearance.default"),!It.test(u.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Dt.test(u.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(u.allowed)||u.allowed.length===0||u.allowed.some((i)=>typeof i!=="string"||i.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!u.allowed.includes(u.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");f={key:u.key,attribute:u.attribute,allowed:[...new Set(u.allowed)],default:u.default}}return{storageKey:e.storageKey,appearance:f,colorMode:{key:o.key,attribute:o.attribute,default:o.default},respectExisting:e.respectExisting===!0}}function _r(c){return JSON.stringify(c).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Tr(c){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${_r(c)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());if(config.appearance)root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function Cr(c,e){let u=1,o=null,f=!1;for(let i=e+1;i<c.length;i++){let p=c[i];if(f){f=!1;continue}if(o){if(p==="\\")f=!0;else if(p===o)o=null;continue}if(p==='"'||p==="'"||p==="`"){o=p;continue}if(p==="(")u++;else if(p===")"&&--u===0)return i}return-1}function Pt(c,e){let u=c,o=/@appearanceBootstrap\s*\(/g,f;while((f=o.exec(u))!==null){let i=f.index+f[0].length-1,p=Cr(u,i);if(p===-1)throw Error("@appearanceBootstrap has an unclosed options object");let v=u.slice(i+1,p).trim(),y=l(`(${v})`,e),x=Tr(Er(y));u=u.slice(0,f.index)+x+u.slice(p+1),o.lastIndex=f.index+x.length}return u}import Ar from"crypto";function Q(c){return F(String(c??""))}var jt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function ze(c,e,u,o){let f=c||e;return u?`${f} ${o}`:f}function me(c){return String(c).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function De(c,e){if(/\bid\s*=/i.test(c))return"";return` id="${Q(e)}"`}function et(c,e,u){if(!e)return"";let o="";if(!/\baria-invalid\s*=/i.test(u))o+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(u))o+=` aria-describedby="${Q(`${me(c)}-error`)}"`;return o}function Rr(){return Ar.randomUUID()}function We(c,e){let u=c;return u=u.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let o=Rr();e.csrf={token:o}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${Q(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),u=u.replace(/@method\(['"]([^'"]+)['"]\)/g,(o,f)=>{let i=f.toUpperCase();if(f&&!["GET","POST"].includes(i))return`<input type="hidden" name="_method" value="${Q(i)}">`;return o}),u}function Nt(c,e,u=jt){let o=c;return o=o.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(f,i,p,v,y,x="")=>{let b=i||p||"POST",w=v||y||"",T=ye(x),A=b.toUpperCase(),O=["GET","POST"].includes(A)?A:"POST",M=`<form method="${Q(O)}" action="${Q(w)}"${T?` ${T}`:""}>`;if(M+=`
|
|
832
832
|
${We("@csrf",e)}`,!["GET","POST"].includes(A))M+=`
|
|
833
|
-
${We(`@method('${A}')`,e)}`;return M}),o=o.replace(/@endform/g,"</form>"),o=o.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(f,i,p,v,y,x="")=>{let b=i||p||"",w=v||y||"",T=ye(x),A=Ne(b,e),O=A!==void 0&&A!==null?A:w||"",M=T.match(/type=['"]([^'"]+)['"]/i),I=M?M[1]:"text",P=He(b,e),N=T.match(/class=['"]([^'"]+)['"]/i),V=ze(N?N[1]:"",u.input,P,u.inputError),X=T.replace(/class=['"][^'"]+['"]/i,"");return X=X.replace(/type=['"][^'"]+['"]/i,""),`<input type="${Q(I)}" name="${Q(b)}"${De(T,me(b))} value="${Q(O)}" class="${V}"${et(b,P,T)}${X?` ${X}`:""}>`}),o=o.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(f,i,p="",v="")=>{let y=ye(p),x=Ne(i,e)||v.trim(),b=He(i,e),w=y.match(/class=['"]([^'"]+)['"]/i),T=ze(w?w[1]:"",u.input,b,u.inputError),A=y.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${Q(i)}"${De(y,me(i))} class="${T}"${et(i,b,y)}${A?` ${A}`:""}>${Q(x)}</textarea>`}),o=o.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(f,i,p="",v)=>{let y=ye(p),x=Ne(i,e),b=He(i,e),w=y.match(/class=['"]([^'"]+)['"]/i),T=ze(w?w[1]:"",u.input,b,u.inputError),A=y.replace(/class=['"][^'"]+['"]/i,""),O=v;if(x!==void 0)O=v.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(M,I,P)=>{if((Array.isArray(x)?x.some((V)=>String(V)===P):String(x)===P)&&!I.includes("selected"))return I.replace(/(<option)/,"$1 selected");return M});return`<select name="${Q(i)}"${De(y,me(i))} class="${T}"${et(i,b,y)}${A?` ${A}`:""}>${O}</select>`}),o=o.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(f,i,p,v="")=>{let y=p===void 0?"1":p,x=p===void 0?me(i):`${me(i)}-${me(y)}`,b=ye(v),w=Ne(i,e),T=w!==void 0&&(Array.isArray(w)?w.some((I)=>String(I)===y):w===!0||String(w)===y),A=b.match(/class=['"]([^'"]+)['"]/i),O=A?A[1]:u.checkInput,M=b.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${Q(i)}"${De(b,x)} value="${Q(y)}" class="${O}"${T?" checked":""}${M?` ${M}`:""}>`}),o=o.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(f,i,p,v="")=>{let y=ye(v),x=Ne(i,e),b=x!==void 0&&x===p,w=y.match(/class=['"]([^'"]+)['"]/i),T=w?w[1]:u.checkInput,A=y.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${Q(i)}"${De(y,`${me(i)}-${me(p)}`)} value="${Q(p)}" class="${T}"${b?" checked":""}${A?` ${A}`:""}>`}),o=o.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(f,i,p="")=>{let v=ye(p),y=v.match(/accept=['"]([^'"]+)['"]/i),x=y?y[1]:"",b=v.includes("multiple"),w=He(i,e),T=v.match(/class=['"]([^'"]+)['"]/i),A=ze(T?T[1]:"",u.input,w,u.inputError),O=v.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),M=[`<input type="file" name="${Q(i)}"${De(v,me(i))}`,`class="${A}"`];if(x)M.push(`accept="${Q(x)}"`);if(b)M.push("multiple");if(O)M.push(O);return`${M.join(" ")}>`}),o=o.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(f,i,p="",v)=>{let y=ye(p),x=y.match(/class=['"]([^'"]+)['"]/i),b=x?x[1]:u.label,w=y.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${Q(me(i))}" class="${b}"${w?` ${w}`:""}>${v}</label>`}),o}function Ht(c,e,u=jt){return c.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(o,f,i)=>{try{if(He(f,e)){let p=i.replace(/\{\{([^}]+)\}\}/g,(v,y,x)=>{let b=(w)=>K(i,x,String(w??""),!1,v.length);try{if(y.trim()==="$message"||y.trim()==="message")return b(Lt(f,e));if(y.trim().includes("errors.first")||y.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return b(e.errors.first(f));return b(Lt(f,e))}let w=y.trim();if(d(w)){let T=l(w,e);return T!==void 0?b(T):w}return w}catch{return y}});return`<div id="${Q(`${me(f)}-error`)}" role="alert">${p}</div>`}return""}catch(p){return console.error("Error processing @error directive:",p),o}})}function He(c,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(c);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,c);return!1}function Lt(c,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(c);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,c)){let u=e.errors[c];return Array.isArray(u)?u[0]:String(u)}return""}function Ne(c,e){let u;if(e.old&&typeof e.old==="function")return e.old(c);if(e.old&&typeof e.old==="object")return e.old[c];if(c.endsWith("[]")){let o=c.slice(0,-2);if(u=e[o],u!==void 0)return u}return e[c]}function ye(c){if(!c.trim())return"";let e=[],u=c.trim(),o=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,f;while((f=o.exec(u))!==null){let[,i,,p]=f;e.push(`${i}="${p.trim()}"`)}return e.join(" ")}import*as tt from"path";async function Bt(c,e,u=""){if(tt.basename(u)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,c.replace(/@js[\s\S]*?@endjs/g,"");return qt(c,e,u,"@js","@endjs")}async function Ft(c,e,u=""){if(tt.basename(u)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((i)=>({...i,displayName:`User ${i.id}: ${i.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return c.replace(/@ts[\s\S]*?@endts/g,"")}return qt(c,e,u,"@ts","@endts")}async function qt(c,e,u,o,f){let i=c,p=
|
|
833
|
+
${We(`@method('${A}')`,e)}`;return M}),o=o.replace(/@endform/g,"</form>"),o=o.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(f,i,p,v,y,x="")=>{let b=i||p||"",w=v||y||"",T=ye(x),A=Ne(b,e),O=A!==void 0&&A!==null?A:w||"",M=T.match(/type=['"]([^'"]+)['"]/i),I=M?M[1]:"text",P=He(b,e),N=T.match(/class=['"]([^'"]+)['"]/i),V=ze(N?N[1]:"",u.input,P,u.inputError),X=T.replace(/class=['"][^'"]+['"]/i,"");return X=X.replace(/type=['"][^'"]+['"]/i,""),`<input type="${Q(I)}" name="${Q(b)}"${De(T,me(b))} value="${Q(O)}" class="${V}"${et(b,P,T)}${X?` ${X}`:""}>`}),o=o.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(f,i,p="",v="")=>{let y=ye(p),x=Ne(i,e)||v.trim(),b=He(i,e),w=y.match(/class=['"]([^'"]+)['"]/i),T=ze(w?w[1]:"",u.input,b,u.inputError),A=y.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${Q(i)}"${De(y,me(i))} class="${T}"${et(i,b,y)}${A?` ${A}`:""}>${Q(x)}</textarea>`}),o=o.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(f,i,p="",v)=>{let y=ye(p),x=Ne(i,e),b=He(i,e),w=y.match(/class=['"]([^'"]+)['"]/i),T=ze(w?w[1]:"",u.input,b,u.inputError),A=y.replace(/class=['"][^'"]+['"]/i,""),O=v;if(x!==void 0)O=v.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(M,I,P)=>{if((Array.isArray(x)?x.some((V)=>String(V)===P):String(x)===P)&&!I.includes("selected"))return I.replace(/(<option)/,"$1 selected");return M});return`<select name="${Q(i)}"${De(y,me(i))} class="${T}"${et(i,b,y)}${A?` ${A}`:""}>${O}</select>`}),o=o.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(f,i,p,v="")=>{let y=p===void 0?"1":p,x=p===void 0?me(i):`${me(i)}-${me(y)}`,b=ye(v),w=Ne(i,e),T=w!==void 0&&(Array.isArray(w)?w.some((I)=>String(I)===y):w===!0||String(w)===y),A=b.match(/class=['"]([^'"]+)['"]/i),O=A?A[1]:u.checkInput,M=b.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${Q(i)}"${De(b,x)} value="${Q(y)}" class="${O}"${T?" checked":""}${M?` ${M}`:""}>`}),o=o.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(f,i,p,v="")=>{let y=ye(v),x=Ne(i,e),b=x!==void 0&&x===p,w=y.match(/class=['"]([^'"]+)['"]/i),T=w?w[1]:u.checkInput,A=y.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${Q(i)}"${De(y,`${me(i)}-${me(p)}`)} value="${Q(p)}" class="${T}"${b?" checked":""}${A?` ${A}`:""}>`}),o=o.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(f,i,p="")=>{let v=ye(p),y=v.match(/accept=['"]([^'"]+)['"]/i),x=y?y[1]:"",b=v.includes("multiple"),w=He(i,e),T=v.match(/class=['"]([^'"]+)['"]/i),A=ze(T?T[1]:"",u.input,w,u.inputError),O=v.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),M=[`<input type="file" name="${Q(i)}"${De(v,me(i))}`,`class="${A}"`];if(x)M.push(`accept="${Q(x)}"`);if(b)M.push("multiple");if(O)M.push(O);return`${M.join(" ")}>`}),o=o.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(f,i,p="",v)=>{let y=ye(p),x=y.match(/class=['"]([^'"]+)['"]/i),b=x?x[1]:u.label,w=y.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${Q(me(i))}" class="${b}"${w?` ${w}`:""}>${v}</label>`}),o}function Ht(c,e,u=jt){return c.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(o,f,i)=>{try{if(He(f,e)){let p=i.replace(/\{\{([^}]+)\}\}/g,(v,y,x)=>{let b=(w)=>K(i,x,String(w??""),!1,v.length);try{if(y.trim()==="$message"||y.trim()==="message")return b(Lt(f,e));if(y.trim().includes("errors.first")||y.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return b(e.errors.first(f));return b(Lt(f,e))}let w=y.trim();if(d(w)){let T=l(w,e);return T!==void 0?b(T):w}return w}catch{return y}});return`<div id="${Q(`${me(f)}-error`)}" role="alert">${p}</div>`}return""}catch(p){return console.error("Error processing @error directive:",p),o}})}function He(c,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(c);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,c);return!1}function Lt(c,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(c);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,c)){let u=e.errors[c];return Array.isArray(u)?u[0]:String(u)}return""}function Ne(c,e){let u;if(e.old&&typeof e.old==="function")return e.old(c);if(e.old&&typeof e.old==="object")return e.old[c];if(c.endsWith("[]")){let o=c.slice(0,-2);if(u=e[o],u!==void 0)return u}return e[c]}function ye(c){if(!c.trim())return"";let e=[],u=c.trim(),o=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,f;while((f=o.exec(u))!==null){let[,i,,p]=f;e.push(`${i}="${p.trim()}"`)}return e.join(" ")}import*as tt from"path";async function Bt(c,e,u=""){if(tt.basename(u)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,c.replace(/@js[\s\S]*?@endjs/g,"");return qt(c,e,u,"@js","@endjs")}async function Ft(c,e,u=""){if(tt.basename(u)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((i)=>({...i,displayName:`User ${i.id}: ${i.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return c.replace(/@ts[\s\S]*?@endts/g,"")}return qt(c,e,u,"@ts","@endts")}async function qt(c,e,u,o,f){let i=c,p=_t(`${o}([\\s\\S]*?)${f}`,"g"),v=[],y;while((y=p.exec(c))!==null)v.push({fullMatch:y[0],content:y[1]||"",index:y.index});for(let{fullMatch:x,content:b,index:w}of v)try{let T={...e,global:e},A=Object.keys(T),O=Object.values(T),M=b.trim();if(o==="@ts")M=M.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let P=(M.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((j)=>j.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),N=P.length>0?`return { ${P.join(", ")} };`:"return {};",V=`
|
|
834
834
|
${M}
|
|
835
835
|
${N}
|
|
836
836
|
`,L=Function(...A,V)(...O);if(L&&typeof L==="object")Object.assign(e,L);i=i.replace(x,"")}catch(T){console.error(`Error executing ${o} code block in ${u}:`,T);let A=T instanceof Error?T.message:String(T),O=g(`${o} Directive`,`Error executing code: ${A}`,u,c,w,x);console.error(O),i=i.replace(x,"")}return i}function Ir(c,e="_method"){let u=c.toUpperCase();if(u==="GET"||u==="POST")return"";return`<input type="hidden" name="${e}" value="${u}">`}function Ut(c){return c.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(e,u,o,f,i)=>Ir(o,i||"_method"))}async function Vt(c,e,u,o,f){if(!o.middleware||o.middleware.length===0)return c;let i=c,p=o.middleware.filter((v)=>v.timing===f);if(p.length===0)return i;for(let v of p){if(!v.name||typeof v.handler!=="function"){if(o.debug)console.warn("Invalid middleware:",v);continue}try{let y=await v.handler(i,e,u,o);if(typeof y==="string")i=y;else if(o.debug)console.warn(`Middleware ${v.name} did not return a string`)}catch(y){if(o.debug)console.error(`Error in middleware ${v.name}:`,y);if(o.debug){let x=g("Middleware",`Error in middleware '${v.name}': ${y instanceof Error?y.message:String(y)}`,u,c);i=i.replace(/<body[^>]*>/,`$&
|
|
837
837
|
<div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${m(x)}</div>
|
|
838
|
-
`)}}}return i}async function zt(c,e,u,o){return Vt(c,e,u,o,"before")}async function Wt(c,e,u,o){return Vt(c,e,u,o,"after")}function Xt(c){return c.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,u,o,f,i)=>{try{let p=f?
|
|
838
|
+
`)}}}return i}async function zt(c,e,u,o){return Vt(c,e,u,o,"before")}async function Wt(c,e,u,o){return Vt(c,e,u,o,"after")}function Xt(c){return c.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,u,o,f,i)=>{try{let p=f?E(f,{}):{};return er(o,p,i==="true")}catch(p){return console.error(`Error processing @route directive: ${p}`),"#route-error"}})}var Be={patterns:[],exact:{}};async function Kt(c,e){let u=c.split("/").pop()?.split(".")[0]||"";if(Be.exact[c])for(let o of Be.exact[c])await Promise.resolve(o(e,c));if(Be.exact[u])for(let o of Be.exact[u])await Promise.resolve(o(e,c));for(let{pattern:o,callback:f}of Be.patterns)if(o.test(c)||o.test(u))await Promise.resolve(f(e,c))}var Or=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Pr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function _e(c,e){let u=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;u.lastIndex=e;let o=u.exec(c);if(!o)return null;let f=/\/\s*>$/.test(o[0])||o[1]===o[1].toLowerCase()&&Or.has(o[1]),i=f?o[2].replace(/\/\s*$/,""):o[2];return{full:o[0],tag:o[1],attrs:i,selfClosing:f,start:o.index,end:o.index+o[0].length}}function jr(c,e,u){let o=1,f=u,i=new RegExp(`<${e}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),p=new RegExp(`</${e}\\s*>`,"gi");while(o>0&&f<c.length){i.lastIndex=f,p.lastIndex=f;let v=i.exec(c),y=p.exec(c);if(!y)return-1;if(v&&v.index<y.index)o++,f=v.index+v[0].length;else{if(o--,o===0)return y.index+y[0].length;f=y.index+y[0].length}}return-1}function $e(c,e){if(e.selfClosing)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};let u=jr(c,e.tag,e.end);if(u===-1)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};return{outerStart:e.start,outerEnd:u,innerHTML:c.slice(e.end,u-`</${e.tag}>`.length)}}function Gt(c,e){return new RegExp(`(?:^|\\s)${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test(c)||c.includes(` ${e}=`)||c.includes(` ${e} `)||c.trimEnd().endsWith(` ${e}`)}function Fe(c,e){let u=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=c.match(new RegExp(`${u}="([^"]*)"`,"s"))||c.match(new RegExp(`${u}='([^']*)'`,"s"));return o?o[1]:null}function xe(c,e){let u=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return c.replace(new RegExp(`\\s*${u}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${u}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${u}(?=\\s|$|>|/)`,"g"),"")}function Pe(c,e,u){let o=e.selfClosing?" /":"",f=`<${e.tag}${u}${o}>`;return c.slice(0,e.start)+f+c.slice(e.end)}function qr(c){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test(c)}function Ur(c){let e=c,u=0;while(u<e.length){let o=_e(e,u);if(!o)break;let f=Fe(o.attrs,"v-for");if(f===null){u=o.end;continue}let i=f.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!i){u=o.end;continue}let p=i[1].trim(),v=i[2].trim(),y;if(p.includes(",")){let I=p.split(",").map((V)=>V.trim()),P=I[0],N=I[1];y=`${v} as ${N} => ${P}`}else y=`${v} as ${p}`;let x=xe(o.attrs,"v-for"),b=xe(x,":key").replace(/\s*v-bind:key="[^"]*"/g,""),w=$e(e,o),T=e.slice(w.outerStart,w.outerEnd),A=Pe(T,{...o,start:0,end:o.end-o.start},b),O=`@foreach(${y})
|
|
839
839
|
`,M=`${O}${A}
|
|
840
840
|
@endforeach`;e=e.slice(0,w.outerStart)+M+e.slice(w.outerEnd),u=w.outerStart+O.length}return e}function Vr(c){let e=c,u=0;while(u<e.length){let o=_e(e,u);if(!o)break;let f=Fe(o.attrs,"v-if");if(f===null){u=o.end;continue}let i=[],p=$e(e,o),v=xe(o.attrs,"v-if"),y=Pe(e.slice(p.outerStart,p.outerEnd),{...o,start:0,end:o.end-o.start},v);i.push({type:"if",expr:f,outerStart:p.outerStart,outerEnd:p.outerEnd,element:y,parsedTag:o});let x=p.outerEnd,b=!0;while(b){let M=e.slice(x).match(/^\s*/),I=M?M[0].length:0,P=_e(e,x+I);if(!P){b=!1;break}let N=Fe(P.attrs,"v-else-if"),V=Gt(P.attrs,"v-else");if(N!==null){let X=$e(e,P),L=xe(P.attrs,"v-else-if"),j=Pe(e.slice(X.outerStart,X.outerEnd),{...P,start:0,end:P.end-P.start},L);i.push({type:"else-if",expr:N,outerStart:x,outerEnd:X.outerEnd,element:j,parsedTag:P}),x=X.outerEnd}else if(V){let X=$e(e,P),L=xe(P.attrs,"v-else"),j=Pe(e.slice(X.outerStart,X.outerEnd),{...P,start:0,end:P.end-P.start},L);i.push({type:"else",outerStart:x,outerEnd:X.outerEnd,element:j,parsedTag:P}),b=!1}else b=!1}let w=[];for(let M of i)if(M.type==="if")w.push(`@if(${M.expr})
|
|
841
841
|
${M.element}`);else if(M.type==="else-if")w.push(`@elseif(${M.expr})
|
|
@@ -854,35 +854,35 @@ ${I}
|
|
|
854
854
|
</style>`;o=o.replace(x,P),v.lastIndex=0}catch(I){}}}return o}import it from"path";var cs=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,ls=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function ds(c,e){if(!e||!c.includes("/"))return c;let u=it.dirname(e);return c.replace(cs,(o,f,i,p)=>{let v=it.resolve(u,p);return`${f}${i}${v.split(it.sep).join("/")}${i}`})}function dn(c,e){if(!e||!c.includes("<script"))return c;return c.replace(ls,(u,o,f,i)=>`${o}${ds(f,e)}${i}`)}var Te="<!--PARENT_CONTENT_PLACEHOLDER-->";function fn(c){return c.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Sn(c,e){let u=c.length,o=e,f=!0,i=[],p=(v)=>v+9<=u&&c[v]==="<"&&c[v+1]==="/"&&(c[v+2]==="s"||c[v+2]==="S")&&(c[v+3]==="c"||c[v+3]==="C")&&(c[v+4]==="r"||c[v+4]==="R")&&(c[v+5]==="i"||c[v+5]==="I")&&(c[v+6]==="p"||c[v+6]==="P")&&(c[v+7]==="t"||c[v+7]==="T")&&(c[v+8]===">"||/\s/.test(c[v+8]));while(o<u){let v=c[o];if(p(o))return o;if(v==="/"&&c[o+1]==="/"){if(o=c.indexOf(`
|
|
855
855
|
`,o+2),o===-1)return-1;o+=1,f=!0;continue}if(v==="/"&&c[o+1]==="*"){let y=c.indexOf("*/",o+2);if(y===-1)return-1;o=y+2,f=!0;continue}if(v==="/"&&f){let y=o+1,x=!1;while(y<u){let b=c[y];if(b==="\\"){y+=2;continue}if(b==="[")x=!0;else if(b==="]")x=!1;else if(b==="/"&&!x){y++;break}else if(b===`
|
|
856
856
|
`){y=-1;break}y++}if(y===-1){o++,f=!1;continue}while(y<u&&/[a-z]/.test(c[y]))y++;o=y,f=!1;continue}if(v==="'"||v==='"'){let y=v;o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]===y){o++;break}if(c[o]===`
|
|
857
|
-
`)break;o++}f=!1;continue}if(v==="`"){o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,f=!0;break}o++}if(i.length===0)f=!1;continue}if(v==="}"&&i.length>0){i.pop(),o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++,f=!1;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,f=!0;break}o++}continue}if(/\s/.test(v));else if(/[)\].\w$]/.test(v))f=!1;else f=!0;o++}return-1}function $n(c,e){let u=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`<script\\b(?=[^>]*\\b${u}(?:\\s|=|/?>))[^>]*>`,"i").exec(c);if(!o)return null;let f=o.index+o[0].length,i=c.indexOf("</script>",f);if(i===-1)return null;let p=c.indexOf(">",i);if(p===-1)return null;return{start:o.index,end:p+1}}var hs=4096;async function mn(c,e,u){if(u.buildMode!=="serve"||e.length<hs)return null;let{registerServeModuleBundle:o}=await import("./chunk-
|
|
857
|
+
`)break;o++}f=!1;continue}if(v==="`"){o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,f=!0;break}o++}if(i.length===0)f=!1;continue}if(v==="}"&&i.length>0){i.pop(),o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++,f=!1;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,f=!0;break}o++}continue}if(/\s/.test(v));else if(/[)\].\w$]/.test(v))f=!1;else f=!0;o++}return-1}function $n(c,e){let u=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`<script\\b(?=[^>]*\\b${u}(?:\\s|=|/?>))[^>]*>`,"i").exec(c);if(!o)return null;let f=o.index+o[0].length,i=c.indexOf("</script>",f);if(i===-1)return null;let p=c.indexOf(">",i);if(p===-1)return null;return{start:o.index,end:p+1}}var hs=4096;async function mn(c,e,u){if(u.buildMode!=="serve"||e.length<hs)return null;let{registerServeModuleBundle:o}=await import("./chunk-hw7sv4ac.js");return`<script ${c} src="${o(e)}"></script>`}async function Hn(c,e,u){try{let{registeredModuleIdsIn:o,buildModuleRegistryScript:f}=await r("stx/client-module-registry",()=>import("./chunk-xq410rsc.js")),i=[],p=await f(o(...c),{minify:qo(e.buildMode),collectInputs:i});for(let v of i)u?.add(v);if(!p)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:v}=await import("./chunk-hw7sv4ac.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${v(p)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${p.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function ys(c,e=""){let u=$n(c,"data-stx-runtime");if(!u)return c;let o=Gn(c);if(o===-1||o===u.start){if(!e)return c;return c.slice(0,u.end)+e+c.slice(u.end)}if(o<u.start)return c.slice(0,o)+c.slice(u.start,u.end)+e+`
|
|
858
858
|
`+c.slice(o,u.start)+c.slice(u.end);let f=c.slice(u.start,u.end),i=c.slice(0,u.start)+c.slice(u.end),p=Gn(i);if(p===-1)return f+e+`
|
|
859
859
|
`+i;return i.slice(0,p)+f+e+`
|
|
860
|
-
`+i.slice(p)}function vs(c){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return c.replace(e,(u,o,f)=>{let i=c.slice(0,f);return i.lastIndexOf("<")>i.lastIndexOf(">")?`{{${o}}}`:`{<!--stx-literal-->{${o}}}`})}async function s(c,e,u,o,f){if(o.ssr===!1&&!o.autoShell&&o.buildMode==="spa")return c;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=be(c,u);let i=!e.__stxProcessingDepth;ln(e);for(let p of o._layerGraph?.configDependencies??[])f.add(p);if(i&&o.runtimeConfig)await gn(e,u,o.runtimeConfig);if(i)za(e),e.__stx_scope_seq??={n:0,key:ms(String(e.__filename??u))},e.__stx_head_injections=Vo(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((o.debug||!
|
|
860
|
+
`+i.slice(p)}function vs(c){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return c.replace(e,(u,o,f)=>{let i=c.slice(0,f);return i.lastIndexOf("<")>i.lastIndexOf(">")?`{{${o}}}`:`{<!--stx-literal-->{${o}}}`})}async function s(c,e,u,o,f){if(o.ssr===!1&&!o.autoShell&&o.buildMode==="spa")return c;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=be(c,u);let i=!e.__stxProcessingDepth;ln(e);for(let p of o._layerGraph?.configDependencies??[])f.add(p);if(i&&o.runtimeConfig)await gn(e,u,o.runtimeConfig);if(i)za(e),e.__stx_scope_seq??={n:0,key:ms(String(e.__filename??u))},e.__stx_head_injections=Vo(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((o.debug||!_()&&!bn())&&u&&u.endsWith(".stx"))Zs(c,u);try{return await te.timeAsync("template-processing",async()=>{let p=await bs(c,e,u,o,f);if(i)p=Ao(p);if(i&&o.autoShell&&o.buildMode!=="compile"){let v=we(o.app?.head,{known:hr,source:"app.head"}),x=(e.__stx_runtime_head||null)??Wo(),b=(e.__stx_head_raw||"").trim(),w,T=b.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(T)w=T[1].trim(),b=b.replace(T[0],"").trim();let A=e.__sections?.title,O=A?k(A,e,u):void 0,M=x.title||w||O,I=!x.title&&(!!w||!!O),P=x.meta||[],N=new Set(P.map((G)=>nt(G)).filter(Boolean)),V={...v,...M&&{title:M},meta:[...(v.meta||[]).filter((G)=>!N.has(nt(G))),...P],link:[...v.link||[],...x.link||[]],script:[...v.script||[],...x.script||[]],headRaw:[v.headRaw,b].filter(Boolean).join(`
|
|
861
861
|
`),...x.htmlAttrs&&{htmlAttrs:nc(v.htmlAttrs,x.htmlAttrs)},...x.bodyAttrs&&{bodyAttrs:{...v.bodyAttrs||{},...x.bodyAttrs}}},X=Uo(p);if(p=gr(p,V,{...I&&{titleIsHtml:!0},...o.app?.colorMode&&{colorMode:o.app.colorMode}},X),X)p=sc(p,v),p=fr(p,V.htmlAttrs);let L=p.match(/<!-- stx-layout: ([^ ]+) -->/);if(L&&p.includes("<head")){let G=L[1],J=ts(G);p=p.replace(/<head\b[^>]*>/i,(Y)=>`${Y}
|
|
862
862
|
<meta name="stx-layout" content="${fn(G)}">
|
|
863
|
-
<meta name="stx-layout-group" content="${fn(J)}">`)}let j=p.match(/function (__stx_setup_\w+)\(/),H=j?U(p):null;if(j&&H&&!/\bdata-stx=/.test(H.tag)){p=qe(p,(J,Y)=>`<body${Y} data-stx="${j[1]}">`);let G=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${j[1]}"`,"i");p=p.replace(G,"$1")}}if(i){let v=e.__stx_head_injections??Vo(),y=rc(p);if(y!==null)v.beforeClose.push(y);let x=tn(p);if(x!==null)v.afterOpen.push(x);if(o.offline?.enabled&&!p.includes("data-stx-offline"))v.beforeClose.push(nn);p=ec(p,v);let b=o.app?.colorMode;if(b)p=pr(p,b)}if(i)if($n(p,"data-stx-runtime")){let y=null,x=null,b=null,w=null,T=null;try{let{getStoreScript:O}=await r("stx/store-loader",()=>import("./chunk-
|
|
863
|
+
<meta name="stx-layout-group" content="${fn(J)}">`)}let j=p.match(/function (__stx_setup_\w+)\(/),H=j?U(p):null;if(j&&H&&!/\bdata-stx=/.test(H.tag)){p=qe(p,(J,Y)=>`<body${Y} data-stx="${j[1]}">`);let G=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${j[1]}"`,"i");p=p.replace(G,"$1")}}if(i){let v=e.__stx_head_injections??Vo(),y=rc(p);if(y!==null)v.beforeClose.push(y);let x=tn(p);if(x!==null)v.afterOpen.push(x);if(o.offline?.enabled&&!p.includes("data-stx-offline"))v.beforeClose.push(nn);p=ec(p,v);let b=o.app?.colorMode;if(b)p=pr(p,b)}if(i)if($n(p,"data-stx-runtime")){let y=null,x=null,b=null,w=null,T=null;try{let{getStoreScript:O}=await r("stx/store-loader",()=>import("./chunk-m947aq9a.js")),M=o.storesDir,I=await O(M);if(I)b=`<script data-stx-stores>${I}</script>`,x=await mn("data-stx-stores",I,o)??b}catch{}y=await Hn([p,b],o,f);try{let{getFrameworkComposableScript:O}=await r("stx/framework-composables",()=>import("./chunk-bgt1dx8c.js"));T=await O(p)}catch{}try{let{getComposableScript:O}=await r("stx/composable-loader",()=>import("./chunk-d0xcykw6.js")),M=o.composablesDir,I=[y,b,T].filter((N)=>N!==null),P=await O(o._layerComposableDirs??M,p,I);if(P)w=await mn('data-stx-scoped data-stx-run="always" data-stx-composables',P,o)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${P}</script>`}catch{}let A=[y,x,w,T].filter((O)=>O!==null).map((O)=>`
|
|
864
864
|
${O}`).join("");p=ys(p,A)}else{let y=await Hn([p],o,f);if(y){let x=p.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(x!==-1)p=p.slice(0,x)+y+`
|
|
865
|
-
`+p.slice(x)}}if(i)p=tc(p);if(i&&e.__stx_inject_css!==!1)p=await h(p,void 0,o.buildMode==="serve",!0);else if(i)p=an(p);if(p=p.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),p=vs(p),i&&e.__stx_runtime_config)p=Ot(p,e.__stx_runtime_config);if(i&&!e.__stx_defer_server_data){let v=cr(e);if(v){let y=/<head\b[^>]*>/i.exec(p),x=y?y.index+y[0].length:0;p=p.slice(0,x)+v+p.slice(x)}}return p})}catch(p){if(p instanceof z)throw p;let v=p instanceof Error?p.message:String(p),y=new
|
|
865
|
+
`+p.slice(x)}}if(i)p=tc(p);if(i&&e.__stx_inject_css!==!1)p=await h(p,void 0,o.buildMode==="serve",!0);else if(i)p=an(p);if(p=p.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),p=vs(p),i&&e.__stx_runtime_config)p=Ot(p,e.__stx_runtime_config);if(i&&!e.__stx_defer_server_data){let v=cr(e);if(v){let y=/<head\b[^>]*>/i.exec(p),x=y?y.index+y[0].length:0;p=p.slice(0,x)+v+p.slice(x)}}return p})}catch(p){if(p instanceof z)throw p;let v=p instanceof Error?p.message:String(p),y=new re(`Template processing failed: ${v}`,u,void 0,void 0,c.substring(0,200)+(c.length>200?"...":""));if(D.log(y,{filePath:u,context:e}),hn.logDetailedError(y,{filePath:u,template:c.substring(0,500)}),_()&&!o.debug)console.error(`[stx] ${ce.relative(process.cwd(),u)||u}: ${y.message}`);if(o.debug)throw y;return zo.createFallbackContent("Template Processing",y)}}async function bs(c,e,u,o,f){let i=process.cwd(),p={...o,partialsDir:o.partialsDir&&!ce.isAbsolute(o.partialsDir)?ce.resolve(i,o.partialsDir):o.partialsDir,componentsDir:o.componentsDir&&!ce.isAbsolute(o.componentsDir)?ce.resolve(i,o.componentsDir):o.componentsDir,layoutsDir:o.layoutsDir&&!ce.isAbsolute(o.layoutsDir)?ce.resolve(i,o.layoutsDir):o.layoutsDir},v=p,y=c;await ks(u,e),xs(e,v),y=await ve(()=>zt(y,e,u,v),y,(L)=>{D.log(L,{filePath:u,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${u}: ${L.message}`)}),y=y.replace(/\{\{--[\s\S]*?--\}\}/g,"");let x=le(y,Ae,(L,j)=>`\x00STX_HTML_COMMENT_${j}\x00`);y=x.output;let b=x.tokens,w=(L)=>b.length===0?L:L.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(j,H)=>b[Number(H)]??""),T="\x00STX_ESCAPED_AT\x00",A="\x00STX_ESC_MUSTACHE_OPEN\x00",O="\x00STX_ESC_MUSTACHE_CLOSE\x00";y=y.replace(/@@/g,T),y=y.replace(/@\{\{([\s\S]*?)\}\}/g,(L,j)=>`${A}${j}${O}`),y=Jt(y),y=await un(y,u,f);let M={};y=Mr(y,M);let I={...e.__sections||{}},P="",N=mt(ft(c)),V=/@nolayout\b/.test(y)||N===!1;if(/@nolayout\b/.test(y))y=y.replace(/@nolayout\b\s*/g,"");let X=y.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(X)P=X[1],y=y.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof N==="string"){if(P=N,!/@section\s*\(/.test(y))y=`@section('content')
|
|
866
866
|
${y.trim()}
|
|
867
|
-
@endsection`}if(!P&&!V&&v.defaultLayout){let L=yn(y),j=/@section\s*\(/.test(y);if(!L||j){let H="",G=
|
|
867
|
+
@endsection`}if(!P&&!V&&v.defaultLayout){let L=yn(y),j=/@section\s*\(/.test(y);if(!L||j){let H="",G=ce.dirname(u),J=v.layoutsDir?ce.dirname(v.layoutsDir):process.cwd();for(let Y=0;Y<20;Y++){let ne=ce.join(G,"_layout.stx");if(await n(ne)){H=ne;break}let se=ce.dirname(G);if(se===G||se.length<J.length)break;G=se}if(H)P=H;else if(v.layoutsDir){let Y=ce.isAbsolute(v.layoutsDir)?v.layoutsDir:ce.resolve(process.cwd(),v.layoutsDir),ne=ce.join(Y,`${v.defaultLayout}.stx`);if(await n(ne))P=ne}if(P&&!j)y=`@section('content')
|
|
868
868
|
${y.trim()}
|
|
869
|
-
@endsection`}}if(P&&y.includes("<script")){let L=q(y),j=L.scripts.map((H)=>vn(H,u)??H);y=or(L.output,j)}if(y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(L,j,H)=>(I[j]=H,"")),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(L,j,H)=>{if(/^(['"]).*\1$/.test(H.trim()))return L;try{let G=l(H.trim(),e);if(G===void 0)return L;let Y=(e.__stx_inline_section_values??=[]).push(G)-1;return I[j]=`{{ __stx_inline_section_values[${Y}] }}`,""}catch{return L}}),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(L,j,H)=>{if(H.includes("@parent"))I[j]=H.replace("@parent",Te);else I[j]=H.trim();return""}),e.__sections=I,y=y.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(L,j,H)=>I[j]||H||""),!("slot"in e)||e.slot===void 0)y=y.replace(/\{\{\s*slot\s*\}\}/g,()=>I.content||"");if(y=Lr(y,M),P){let L=[],j=q(y),H=
|
|
869
|
+
@endsection`}}if(P&&y.includes("<script")){let L=q(y),j=L.scripts.map((H)=>vn(H,u)??H);y=or(L.output,j)}if(y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(L,j,H)=>(I[j]=H,"")),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(L,j,H)=>{if(/^(['"]).*\1$/.test(H.trim()))return L;try{let G=l(H.trim(),e);if(G===void 0)return L;let Y=(e.__stx_inline_section_values??=[]).push(G)-1;return I[j]=`{{ __stx_inline_section_values[${Y}] }}`,""}catch{return L}}),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(L,j,H)=>{if(H.includes("@parent"))I[j]=H.replace("@parent",Te);else I[j]=H.trim();return""}),e.__sections=I,y=y.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(L,j,H)=>I[j]||H||""),!("slot"in e)||e.slot===void 0)y=y.replace(/\{\{\s*slot\s*\}\}/g,()=>I.content||"");if(y=Lr(y,M),P){let L=[],j=q(y),H=le(j.output,on,(G,J)=>`\x00STX_ORPHAN_STYLE_${J}\x00`);if(y=H.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(G,J,Y)=>{let ne=J==="SCRIPT"?vn(j.scripts[Number(Y)],u):H.tokens[Number(Y)];if(ne)L.push(ne);return""}),L.length>0){let G=L.join(`
|
|
870
870
|
`);I.content=I.content?`${I.content}
|
|
871
|
-
${G}`:G,e.__sections=I}}if(P)try{let L;if(
|
|
872
|
-
${y}`,w(y)}catch(L){if(L instanceof z)throw L;throw new
|
|
873
|
-
`;if(i=Y(i,e),i=
|
|
871
|
+
${G}`:G,e.__sections=I}}if(P)try{let L;if(ce.isAbsolute(P))L=P,f.add(P);else L=await ve(()=>pn(P,u,p,f),null,()=>{throw new re(`Failed to resolve layout path: ${P}`,u,void 0,void 0,`Layout referenced from ${u}`)});if(!L){let ne=(oe)=>{if(!oe)return[];try{let ae=ce.isAbsolute(oe)?oe:ce.resolve(process.cwd(),oe);return fs.readdirSync(ae).filter((ue)=>ue.endsWith(".stx")).map((ue)=>ue.replace(/\.stx$/,""))}catch{return[]}},se=[...ne(p.layoutsDir),...ne(p.fallbackLayoutsDir)].filter((oe,ae,ue)=>ue.indexOf(oe)===ae).sort(),de=`Layout not found: ${P} (referenced from ${u})`+(se.length>0?`. Available layouts: ${se.join(", ")}`:p.layoutsDir?`. No .stx layouts found in ${p.layoutsDir}`:"");if(D.log(Error(de),{layoutPath:P,filePath:u,available:se},"error"),console.error(`[stx] ${de}`),p.debug)throw new re(de,u);return y}let j=await ve(()=>Bun.file(L).text(),"",()=>{throw new re(`Failed to read layout file: ${L}`,u,void 0,void 0,"Layout content could not be loaded")});j=dn(j,L);let H=j.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(H){if(p.debug)console.log(`Found nested layout: ${H[1]} in ${L}`);let ne={},se=j.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ae,ue,ke)=>(ne[ue]=ke.trim(),""));for(let[ae,ue]of Object.entries(ne))if(I[ae]&&I[ae].includes(Te)){let ke=I[ae].indexOf(Te);I[ae]=I[ae].slice(0,ke)+ue+I[ae].slice(ke+Te.length)}else if(!I[ae])I[ae]=ue;let de={...e,__sections:I},oe=`@layout('${H[1]}')${se}`;return await s(oe,de,L,p,f)}let G=j.replace(/\{\{--[\s\S]*?--\}\}/g,""),J=Mr(G,M),Y={};return J=J.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ne,se,de)=>(Y[se]=de.trim(),`@slot('${se}')`)),J=J.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(ne,se,de)=>{if(I[se]){let oe=I[se];if(oe.includes(Te)){let ae=Y[se]||"",ue=oe.indexOf(Te);oe=oe.slice(0,ue)+ae+oe.slice(ue+Te.length)}return oe}return de||""}),J=ws(J,I),J=J.replace(/\{\{\s*slot\s*\}\}/g,()=>I.content||""),J=Lr(J,M),e.__originalFilePath=u,y=await kn(J,e,L,p,f),y=`<!-- stx-layout: ${P} -->
|
|
872
|
+
${y}`,w(y)}catch(L){if(L instanceof z)throw L;throw new re(`Error processing layout ${P}: ${L instanceof Error?L.message:String(L)}`,u)}return w(await kn(y,e,u,p,f))}function ws(c,e){return c.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(u,o,f)=>{let i=e[o];if(i!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(i))return i}return f||""})}function xs(c,e){if(c.__stx_sfc_mode=!0,c.__stx_options=e,e.buildMode)c.__stx_buildMode=e.buildMode;let u=e.envPrefix||"STX_PUBLIC_",o={};for(let[f,i]of Object.entries(process.env))if(f.startsWith(u)&&i!==void 0)o[f]=i;c.$env=o}async function ks(c,e){await ve(()=>Kt(c,e),void 0,(u)=>{D.log(u,{filePath:c,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${c}: ${u.message}`)})}var ot="data-stx-source";function vn(c,e){if(!c)return c;let u=/^<script\b([^>]*)>/i.exec(c);if(!u||!/\bserver\b/.test(u[1])||u[1].includes(ot))return c;return`<script ${ot}="${encodeURIComponent(e)}"${c.slice(7)}`}function Ss(c){let e=new RegExp(`${ot}="([^"]*)"`).exec(c);return e?decodeURIComponent(e[1]):void 0}function wn(c){return c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function xn(c,e,u){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a <script server> ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${wn(c)}</span><span style="display:block;margin-top:4px">${wn(u)}</span></div>`}async function $s(c,e,u,o){let{scanScriptTags:f}=await r("stx/signal-processing",()=>import("./chunk-q79ksfcd.js")),i=[],p=!_()&&!bn();for(let y of f(c)){let x=y.attrs;if(!/\bserver\b/.test(x))continue;let b=y.start+y.fullMatch.indexOf(">")+1,w=Sn(c,b);if(w===-1)continue;let T=c.slice(b,w);if(!T.trim())continue;let A=Ss(x)??u,O={index:y.start,length:w+9-y.start};try{let{extractVariables:M}=await r("stx/variable-extractor",()=>import("./chunk-sd4jwn3y.js"));await M(T,e,A,{preserveExisting:!0,onFailure:(I)=>{if(I.kind==="unknown")return;if(o?.onServerScriptError?.({sourcePath:A,kind:I.kind,message:I.message}),!p)return;i.push({...O,markup:xn(A,I.kind,I.message)})}})}catch(M){let I=M instanceof Error?M:Error(String(M));if(D.log(I,{filePath:A,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${A}: ${I.message}`),p)i.push({...O,markup:xn(A,"unknown",I.message)})}}if(i.length===0)return c;let v=c;for(let y of i.sort((x,b)=>b.index-x.index))v=v.slice(0,y.index)+y.markup+v.slice(y.index+y.length);return v}async function Es(c,e,u){try{let{interpolateScriptsInTemplate:o}=await r("stx/expressions",()=>import("./chunk-q1x7ckfw.js"));return o(c,e,{skipServer:!0})}catch(o){let f=o instanceof Error?o:Error(String(o));return D.log(f,{filePath:u,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${u}: ${f.message}`),c}}async function kn(c,e,u,o,f){let i=c,p=o;if(i=await $s(i,e,u,o),i=await Bt(i,e,u),i=await Ft(i,e,u),i=await Es(i,e,u),i=await At(i,e,u,p),be(i))i=io(i,e),i=Hr(i,e),i=zr(i,e);i=ao(i);let{processStreamDirectives:v}=await r("stx/streaming",()=>import("./chunk-ndtxkps4.js"));i=v(i,e),i=qn(i,e,u,p,!0),i=await en(i,e,u,p,f),i=await Br(i,e,u,p,f),i=ua(i,e,u,p);let{processDeferDirectives:y}=await r("stx/defer",()=>import("./chunk-2f17h17f.js"));i=y(i,e,u);let{processTeleportDirectives:x}=await r("stx/teleport",()=>import("./chunk-wq712sw1.js"));i=x(i,e,u);let{processTransitionDirectives:b,processTransitionAttributes:w}=await r("stx/transitions",()=>import("./chunk-k2pa44rf.js"));i=b(i,e,u),i=w(i);let{processErrorBoundaryDirectives:T,stripRenderFailedMarkers:A}=await r("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));i=T(i,e,u),i=A(i);let{processSuspenseDirectives:O}=await r("stx/suspense",()=>import("./chunk-zrqremja.js"));i=O(i,e,u);let{processAsyncDirectives:M}=await r("stx/async-components",()=>import("./chunk-67kj14at.js"));i=M(i,e,u);let{processKeepAliveDirectives:I}=await r("stx/keep-alive",()=>import("./chunk-6vzktvyw.js"));i=I(i,e,u);let{processVirtualListDirectives:P,processVirtualGridDirectives:N,processInfiniteListDirectives:V}=await r("stx/virtual-scrolling",()=>import("./chunk-sf0wsq74.js"));i=P(i,e,u),i=N(i,e,u),i=V(i,e,u);let{processPartialHydrationDirectives:X,processStaticDirectives:L}=await r("stx/partial-hydration",()=>import("./chunk-9szxxgv5.js"));i=X(i,e,u),i=L(i);let{processComputedDirectives:j,processWatchDirectives:H}=await r("stx/computed",()=>import("./chunk-1xdzcy9d.js"));i=j(i,e,u),i=H(i,e,u);let{processFormValidationDirectives:G}=await r("stx/forms-validation",()=>import("./chunk-pge3bzqx.js"));i=G(i,e,u);let{processHeadDirective:J,processTitleDirective:Y,processMetaDirective:ne,resetHead:se}=await r("stx/head",()=>import("./chunk-cq40n7ak.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)se();let de=J(i);if(i=de.content,de.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${de.headContent}
|
|
873
|
+
`;if(i=Y(i,e),i=ne(i,e,u),i=Xt(i),i=no(i,e),i=Ct(i),i=Ut(i),i=await Dr(i,e,u,p,f),i=await Br(i,e,u,p,f),e.__stxProcessingDepth===1)i=Ha(i,e);if(i=i.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),i=Ao(i),i=ee(i,e,u),i=Nr(i),i=La(i,e,{filePath:u,buildMode:p.buildMode}),i=ro(i,e),i=so(i,e),i=We(i,e),i=Nt(i,e),i=Ht(i,e),i=await bt(i,e,u,p),i=await pa(i,e,u),i=await fa(i,e,u,p),i=ga(i,e,u,p),i=mo(i,e,u,p),i=ho(i,e,u),i=yo(i,e,u,p),i=Et(i,e,u,p),i=ps(i,e),i=gs(i),i=ja(i),!p.skipEventDirectives)i=Ea(i,e,u);if(i=vt(i,e,u),p.debug){let B=/\bx-data\s*=/.test(i),W=Fr(c);if(B&&W)console.warn(`[stx] ${u}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
874
874
|
Both work on the same page, but they manage separate scopes.
|
|
875
|
-
Prefer signals (state/derived/effect) for new components.`)}i=oa(i,e),i=await k(i,e,u),i=Ba(i),i=Fa(i),i=pt(i);let{processXElementDirectives:oe}=await r("stx/x-element",()=>import("./chunk-zhxdpzga.js"));i=oe(i);let ae=e.__originalFilePath||u,
|
|
875
|
+
Prefer signals (state/derived/effect) for new components.`)}i=oa(i,e),i=await k(i,e,u),i=Ba(i),i=Fa(i),i=pt(i);let{processXElementDirectives:oe}=await r("stx/x-element",()=>import("./chunk-zhxdpzga.js"));i=oe(i);let ae=e.__originalFilePath||u,ue=Ie(e);if(i=await co(i,p,ae,ue),i=Pt(i,e),i=await Wt(i,e,u,p),p.media?.image?.autoSiblings){let B=p.publicDir||"public",{rewriteImagesWithSiblings:W}=await r("stx/image-optimization/auto-sibling",()=>import("./chunk-shpc1ttk.js"));i=await W(i,{publicDir:B})}if(p.seo?.enabled)i=bo(i,e,p);let ke=(B,W,Z=!0)=>{if(!W)return B;let he=W.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ie=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(B),fe=ie?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ie[0]):null;if(he&&ie&&fe){if(Z){let Ce=ie.index+fe.index;B=B.slice(0,Ce)+he[0]+B.slice(Ce+fe[0].length)}if(W=W.replace(he[0],"").trim(),!W)return B}if(/<\/head>/i.test(B))return B.replace(/<\/head>/i,`${W}
|
|
876
876
|
</head>`);if(/<head\b[^>]*>/i.test(B))return B.replace(/(<head\b[^>]*>)/i,`$1
|
|
877
877
|
${W}`);if(/<html\b[^>]*>/i.test(B))return B.replace(/(<html\b[^>]*>)/i,`$1
|
|
878
878
|
<head>
|
|
879
879
|
${W}
|
|
880
|
-
</head>`);return B},{renderHead:En,getHead:_n}=await r("stx/head",()=>import("./chunk-
|
|
880
|
+
</head>`);return B},{renderHead:En,getHead:_n}=await r("stx/head",()=>import("./chunk-cq40n7ak.js")),je=e.__stx_runtime_head??_n();if(je.title||je.meta?.length||je.link?.length){let B=En(je);if(B)i=ke(i,B)}if(de.headContent)i=ke(i,de.headContent,!je.title);if(p.csp?.enabled&&p.csp.addMetaTag)i=St(i,p.csp,e);if(p.analytics?.enabled)i=gt(i,p);if(p.heatmap?.enabled)i=da(i,p);if(p.pwa?.enabled&&p.pwa.autoInject!==!1){let{injectPwaTags:B}=await r("stx/pwa/inject",()=>import("./chunk-3q3gsr7m.js"));i=B(i,p)}let Tn=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(i),Cn=/\bSTX\.\w+/.test(i),An=/window\.STX\s*=/.test(i);if(Tn&&Cn&&!An){let W=`<script data-stx-scoped data-stx-run="once">
|
|
881
881
|
${lt()}
|
|
882
882
|
</script>`;if(i.includes("</head>")){let Z=i.indexOf("</head>"),ie=i.slice(0,Z).indexOf("<script");if(ie!==-1){let fe=i.slice(0,ie),Ce=i.slice(ie);i=fe+W+`
|
|
883
883
|
`+Ce}else i=i.replace("</head>",`${W}
|
|
884
884
|
</head>`)}else if(i.includes("<body"))i=i.replace(/<body([^>]*)>/,`<body$1>
|
|
885
885
|
${W}`);else i=W+`
|
|
886
|
-
`+i}{let{scanScriptTags:B}=await r("stx/signal-processing",()=>import("./chunk-
|
|
886
|
+
`+i}{let{scanScriptTags:B}=await r("stx/signal-processing",()=>import("./chunk-q79ksfcd.js")),W=[];for(let Z of B(i)){if(!/\bserver\b/i.test(Z.attrs))continue;let he=Z.start+Z.fullMatch.indexOf(">")+1,ie=Sn(i,he);if(ie===-1)continue;let fe=ie+9;while(fe<i.length&&/\s/.test(i[fe]))fe++;W.push({start:Z.start,end:fe})}if(W.length>0){let Z=Array(W.length+1),he=0;for(let ie=0;ie<W.length;ie++){let{start:fe,end:Ce}=W[ie];Z[ie]=i.slice(he,fe),he=Ce}Z[W.length]=i.slice(he),i=Z.join("")}}let at=us(i,u);if(at.hasScoped)i=at.html;let Rn=e.__stx_event_bindings||[],Ge=!1,ct=[],Mn=/\s:[a-z][\w.-]*\s*=/.test(i),{scanScriptTags:Dn}=await r("stx/signal-processing",()=>import("./chunk-q79ksfcd.js"));for(let B of Dn(i,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))ct.push({match:B.fullMatch,attrs:B.attrs,content:B.body});for(let{match:B,attrs:W,content:Z}of ct){Ge=!0;let he=Z;Re(Z,u,o.strict,e.__originalFilePath);let ie=await Oe(Z,{eventBindings:Rn,attrs:W,hasColonDirectives:Mn,templateContent:c,filePath:u,projectRoot:process.cwd(),production:qo(o.buildMode),serverData:ue});i=i.replace(B,()=>ie)}if(Ge)e.__stx_event_bindings=[];if(!Ge&&e.__stxProcessingDepth===1){let B=e.__stx_event_bindings||[];if(B.length>0){let W=Co(B);if(W){let Z=i.lastIndexOf("</body>");i=Z===-1?i+W:i.slice(0,Z)+W+`
|
|
887
887
|
`+i.slice(Z)}e.__stx_event_bindings=[]}}if(!ge(i)&&aa(i))i=await Kn(i,p);if(i=ca(i),p.csp?.enabled&&p.csp.useNonce&&typeof e.cspNonce==="string")i=$t(i,e.cspNonce);return i}
|
|
888
888
|
export{ft,Ee,ta,Ys,Hn,s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qs,eo,to,dp,jr,pp}from"./chunk-
|
|
2
|
+
import{Qs,eo,to,dp,jr,pp}from"./chunk-929zbzh7.js";export{jr as clearImageDeliveryCatalog,dp as deliveredImage,to as efficientDeliverySources,Qs as getImageDelivery,eo as isTransparentImage,pp as prepareImageDelivery};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,a,Dt,Mt,Lt,je,tt,P,xs,mr,Be}from"./chunk-
|
|
2
|
+
import{t,a,Dt,Mt,Lt,je,tt,P,xs,mr,Be}from"./chunk-4e0z858k.js";var O=/(?<![\w$@])@meta\s*\(/g,I=/(?<![\w$@])@metaTag\s*\(/g,C=/(?<![\w$@])@structuredData\s*\(/g,k=/(?<![\w$@])@seo\s*\(/g;function _(e,r){return(n)=>P(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function N(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function mo(e,r,n,g){if(!e.includes("@meta"))return e;let i=Dt(e,O,(s,c)=>{let o=mr(Mt(s),r);if(o.kind==="tag")return N(o.tag);if(o.kind==="empty")return"";return P("Meta",c,o.message,n,o.code)},_("Meta",n));return i=Dt(i,I,(s,c)=>{let o=Lt(s,r);if(!o.ok)return P("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!tt(o.value))return P("MetaTag",c,`expected an object such as { name, content }, got ${je(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return P("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${l(u.name)}"`;if(u.property)p+=` property="${l(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${l(u.httpEquiv)}"`;return p+=` content="${l(u.content)}">`,p},_("MetaTag",n)),i}function b(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(tt(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(tt))return e.map(r);return null}function E(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function ho(e,r,n){if(!e.includes("@structuredData"))return e;return Dt(e,C,(g,i)=>{let s=Lt(g,r);if(!s.ok)return P("StructuredData",i,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=b(s.value);if(!c)return P("StructuredData",i,`expected an object or an array of objects, got ${je(s.value)}`,n,t.TYPE_ERROR);try{return E(c)}catch(o){let u=o instanceof Error?o.message:String(o);return P("StructuredData",i,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},_("StructuredData",n))}var j=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),A={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function yo(e,r,n,g){if(!e.includes("@seo"))return e;return Dt(e,k,(i,s)=>{if(!i.trim())return P("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=Lt(i,r);if(!c.ok)return P("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!tt(c.value))return P("SEO",s,`expected an object such as { title, description }, got ${je(c.value)}`,n,t.TYPE_ERROR);try{return L(c.value,s,n)}catch(o){let u=o instanceof Error?o.message:String(o);return P("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},_("SEO",n))}function R(e,r,n,g){let i=e[r];if(i===void 0||i===null||i===!1)return;if(tt(i))return i;xs(n,`${r} must be an object, got ${je(i)}; its tags were left out`,g);return}function L(e,r,n){let g=Object.keys(e).filter((o)=>!j.has(o));if(g.length>0){let o=g.map((u)=>A[u]?`${u} (use ${A[u]})`:u).join(", ");xs(r,`@seo does not read ${o}; ${g.length===1?"it was":"they were"} ignored`,n)}let i="";if(e.title)i+=`<title>${l(e.title)}</title>
|
|
3
3
|
`,i+=`<meta name="title" content="${l(e.title)}">
|
|
4
4
|
`;if(e.description)i+=`<meta name="description" content="${l(e.description)}">
|
|
5
5
|
`;if(e.keywords){let o=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;i+=`<meta name="keywords" content="${l(o)}">
|
|
@@ -43,7 +43,7 @@ import{t,a,Dt,Mt,Lt,je,tt,P,xs,mr,Be}from"./chunk-55zaxb4s.js";var O=/(?<![\w$@]
|
|
|
43
43
|
${y}
|
|
44
44
|
`),h;return h.replace(/<head[^>]*>/,`$&
|
|
45
45
|
${y}
|
|
46
|
-
`)}function q(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function v(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function M(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?v(r[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function V(e){return x(e).length>0}function G(e){for(let r of x(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return v(g)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Xr={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let i=mr(r,n??{});if(i.kind==="error")return P("Meta",`@meta(${r.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(n)n.__stx_runtime_head=Be(n.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Jr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return a("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return a("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return E(i)}catch(i){let s=i instanceof Error?i.message:String(i);return a("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function kp(){return[Xr,Jr]}function
|
|
46
|
+
`)}function q(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function v(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function M(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?v(r[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function V(e){return x(e).length>0}function G(e){for(let r of x(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return v(g)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Xr={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let i=mr(r,n??{});if(i.kind==="error")return P("Meta",`@meta(${r.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(n)n.__stx_runtime_head=Be(n.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Jr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return a("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return a("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return E(i)}catch(i){let s=i instanceof Error?i.message:String(i);return a("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function kp(){return[Xr,Jr]}function Cp(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:i=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,""),o=(m)=>m.startsWith("http")?m:`${c}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=o(m.loc),f=m.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),D=m.changefreq||g,y=m.priority??i,h=` <url>
|
|
47
47
|
<loc>${T(d)}</loc>`;for(let w of m.alternates??[])h+=`
|
|
48
48
|
<xhtml:link rel="alternate" hreflang="${T(w.hreflang)}" href="${T(o(w.href))}"/>`;if(f)h+=`
|
|
49
49
|
<lastmod>${f}</lastmod>`;return h+=`
|
|
@@ -53,7 +53,7 @@ ${y}
|
|
|
53
53
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((m)=>m.alternates?.length)?' xmlns:xhtml="http://www.w3.org/1999/xhtml"':""}>
|
|
54
54
|
${u.join(`
|
|
55
55
|
`)}
|
|
56
|
-
</urlset>`}function
|
|
56
|
+
</urlset>`}function _p(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
|
|
57
57
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
58
58
|
${e.map((s)=>{let c=s.startsWith("http")?s:`${n}${s.startsWith("/")?"":"/"}${s}`;return` <sitemap>
|
|
59
59
|
<loc>${T(c)}</loc>
|
|
@@ -62,4 +62,4 @@ ${e.map((s)=>{let c=s.startsWith("http")?s:`${n}${s.startsWith("/")?"":"/"}${s}`
|
|
|
62
62
|
`)}
|
|
63
63
|
</sitemapindex>`}async function Ep(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,i=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let o of c.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let p=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}i.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return i.sort((o,u)=>o.loc.localeCompare(u.loc)),i}function Yr(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
|
|
64
64
|
`).trim()}function Tp(e){return Yr({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
65
|
-
export{mo,ho,yo,bo,Xr,Jr,kp,_p,
|
|
65
|
+
export{mo,ho,yo,bo,Xr,Jr,kp,Cp,_p,Ep,Yr,Tp};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{kl,Br}from"./chunk-929zbzh7.js";import"./chunk-8gewq710.js";import"./chunk-wh838rdh.js";import{ar}from"./chunk-2yg9y1na.js";import"./chunk-35zjpdcb.js";import"./chunk-2h8ea0we.js";import{et}from"./chunk-4e0z858k.js";import"./chunk-ce6zddpf.js";import"./chunk-4qwvqbzf.js";export{et as freeIdentifiers,Br as processComponents,kl as processESImports,ar as rendersAsElement};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{B}from"./chunk-
|
|
2
|
+
import{B}from"./chunk-2yg9y1na.js";import{Le,A,Ot}from"./chunk-2h8ea0we.js";import{lt,xe,O,Se,Ai,Bs,Pi,kn}from"./chunk-kcrtqyek.js";import{bt,ie,Xe}from"./chunk-qrt8b179.js";import{Xs}from"./chunk-5yxd4ryz.js";import{Cn}from"./chunk-6598d3m6.js";import{ge}from"./chunk-n7xbhzzt.js";import Z from"fs";import T from"path";var{serve:pe}=globalThis.Bun;import F from"zlib";import{promisify as Q}from"util";var K=Q(F.brotliCompress),ee=Q(F.gzip),te=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ne=["text/event-stream","multipart/x-mixed-replace"],re=1024;function se(t){if(!t)return!1;let e=t.toLowerCase();if(ne.some((o)=>e.startsWith(o)))return!1;return te.some((o)=>e.startsWith(o))}function oe(t){let e=new Map;for(let o of t.split(",")){let[r,...a]=o.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of a){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function ae(t){if(!t)return null;let e=oe(t),o=e.get("*"),r=(a)=>e.get(a)??o??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var Y=33554432,H=new Map,U=0;function ce(t,e){if(e.length>Y/8)return;H.set(t,e),U+=e.length;for(let[o,r]of H){if(U<=Y)break;H.delete(o),U-=r.length}}async function xn(t,e,o={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!se(e.headers.get("content-type")))return e;let r=ae(t.headers.get("accept-encoding"));if(!r)return e;let a;try{a=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(a,{status:e.status,statusText:e.statusText,headers:J(e.headers)});if(a.length<(o.threshold??re))return f();try{let h=o.quality??5,g=`${r}:${h}:${a.length}:${Bun.hash(a)}`,l=H.get(g);if(!l)l=r==="br"?await K(a,{params:{[F.constants.BROTLI_PARAM_QUALITY]:h,[F.constants.BROTLI_PARAM_SIZE_HINT]:a.length}}):await ee(a),ce(g,l);if(l.length>=a.length)return f();let m=J(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function J(t){let e=new Headers(t),o=e.get("Vary");if(!o)return e.set("Vary","Accept-Encoding"),e;if(!o.split(",").some((a)=>a.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${o}, Accept-Encoding`);return e}class G{now;entries=new B(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,o){let r,a=async()=>{let s=r??await o();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",O(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return a();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${xe(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let b=new Headers(s.headers);return b.set("Cache-Control","private, no-store"),b.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:b})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let v=this.generation,N=async()=>{let s=await o();r=s;let b=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||b.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let E=await s.clone().arrayBuffer();if(E.byteLength>1048576)return null;s.headers.set("Vary",O(s.headers.get("Vary")).Vary);let n={body:E,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===v)this.entries.set(h,n);return n},x=this.pending.get(h);if(!x){if(this.pending.size>=1000)return a();x=N().finally(()=>{if(this.pending.get(h)===x)this.pending.delete(h)}),this.pending.set(h,x)}if(g&&m<e.maxAge+(e.swr??0))return x.catch(()=>{}),l(g);let M=await x;return M?l(M):a()}}var ue={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function $u(t={}){let e=T.resolve(t.outputDir||".output"),o=t.port??3000,r=Ai(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let a=Cn(r.routeRules),f=new G,h=Xs(e,r.apiRoutes??[]),g=Bun.file(T.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?A(l):void 0,v=new Map,N=new Map,x=new Map,M=new Map;for(let n of r.routes)try{let y=T.join(e,n.compiledPath),i=JSON.parse(await Bun.file(y).text());if(m)i.html=Ot(i.html,m);v.set(n.pattern,i),x.set(n.pattern,Xe(i.html)),M.set(n.pattern,ge(i.html));let X=T.join(e,n.fragmentPath);if(await Bun.file(X).exists()){let P=await Bun.file(X).text();N.set(n.pattern,m?Ot(P,m):P)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,b=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:i}=ie(n.pattern,{page:!0});b.push({regex:y,route:n,paramNames:i})}else s.set(n.pattern,n);let E=pe({port:o,async fetch(n){return xn(n,await Le(m??A(),async()=>{let i=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[i])return t.apiRoutes[i](n);let X=await h(n);if(X)return X;if((n.method==="GET"||n.method==="HEAD")&&i!=="/"){let p=T.resolve(e,"public"),d;try{d=decodeURIComponent(i)}catch{d=i}if(!d.includes("\x00")){let u=T.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${T.sep}`))try{if(Z.existsSync(u)&&Z.statSync(u).isFile()){let R=T.extname(u).toLowerCase(),L=ue[R]||"application/octet-stream",_=i.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(i);return new Response(Bun.file(u),{headers:{"Content-Type":L,"Cache-Control":_?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=xe(n),C=null,q={};if(C=s.get(i)||null,!C)for(let{regex:p,route:d,paramNames:u}of b){let c=i.match(p);if(c){C=d,u.forEach((R,L)=>{q[R]=c[L+1]});break}}if(!C){let p=bt(i)?null:s.get("/404")||null;if(p){let d=v.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let k=a(i),W=Object.keys(k).length>0;return f.respond(n,k.cache,async()=>{let p=v.get(C.pattern);if(P&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let c=N.get(C.pattern);if(c){let R=x.get(C.pattern);return new Response(c,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...M.has(C.pattern)?{"X-STX-Runtime":M.get(C.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},...O(),...k.cache?{}:{"Cache-Control":lt}}})}}let d=Bs(n.method),u=v.get(C.pattern);if(!u){let c=s.get("/500")||null;if(c){let R=v.get(c.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(C.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...O(),"Cache-Control":"public, max-age=60"}});try{let{html:c,boundaries:R,redirect:L,cookies:_,status:I,headers:D}=await kn(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(L)return Pi(L,_,D);if(R&&R.length>0){let{renderStreamingPage:S,streamToResponse:z}=await import("./chunk-ndtxkps4.js"),j=new Headers({...O(),...D,"Cache-Control":"private, no-store"});for(let V of _??[])j.append("Set-Cookie",V);if(P&&!d){let V=Xe(c);j.set("X-STX-Fragment","true"),j.set("X-STX-Runtime",ge(c)?"true":"false"),j.set("X-STX-Layout",V.layout),j.set("X-STX-Layout-Group",V.group)}return z(S(P&&!d?Se(c,r.routerContainer||"main"):c,R,{timeoutMs:30000}),{status:I??u.status??200,headers:j})}let w=new Headers({"Content-Type":"text/html",...O(),...k.cache?{}:{"Cache-Control":"private, no-store"}});for(let S of _??[])w.append("Set-Cookie",S);for(let[S,z]of Object.entries(D??{}))w.set(S,z);if(w.set("Vary",O(w.get("Vary")).Vary),P&&!d){let S=Xe(c);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",ge(c)?"true":"false"),w.set("X-STX-Layout",S.layout),w.set("X-STX-Layout-Group",S.group),new Response(Se(c,r.routerContainer||"main"),{status:I??u.status??200,headers:w})}return new Response(c,{status:I??u.status??200,headers:w})}catch(c){if(console.error(`[stx] Hydration error for ${i}:`,c),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${E.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${v.size} pre-loaded)`),{port:E.port,stop:()=>{f.invalidate(),E.stop()},invalidate:(n)=>f.invalidate(n)}}
|
|
3
3
|
export{xn,$u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mo,ho,yo,bo,Xr,Jr,kp,_p,
|
|
2
|
+
import{mo,ho,yo,bo,Xr,Jr,kp,Cp,_p,Ep,Yr,Tp}from"./chunk-h09a03ay.js";import"./chunk-4e0z858k.js";export{Tp as generateDefaultRobotsTxt,Yr as generateRobotsTxt,Cp as generateSitemap,_p as generateSitemapIndex,bo as injectSeoTags,Xr as metaDirective,mo as processMetaDirectives,yo as processSeoDirective,ho as processStructuredData,kp as registerSeoDirectives,Ep as scanForSitemapEntries,Jr as structuredDataDirective};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ye,Io,Oo,Kl,Pt,Wa,No,qa,$p,Ie,dn,Oe}from"./chunk-
|
|
2
|
+
import{ye,Io,Oo,Kl,Pt,Wa,No,qa,$p,Ie,dn,Oe}from"./chunk-2yg9y1na.js";import{Za,o}from"./chunk-egg54kd0.js";import"./chunk-35zjpdcb.js";import"./chunk-2h8ea0we.js";import"./chunk-4e0z858k.js";import"./chunk-ce6zddpf.js";import"./chunk-4qwvqbzf.js";export{ye as BROWSER_CORE_IMPORTS,Kl as STX_AUTO_IMPORTS,Io as extractAndStripCssImports,Ie as extractBridgeData,Za as findInterpolationEnd,qa as generateAutoImportDestructuring,$p as generateBrowserAutoImportDestructuring,dn as generateServerDataBridge,Pt as injectBrowserCoreAutoImports,Oe as processClientScript,No as referencesName,Oo as renderVendorStyleTags,o as stripCommentsAndLiterals,Wa as transformAutoImports};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{El,gp,mp,hp,yp,Tl,$l,bp,vp,uo,wp,Xn,Jn,Wr}from"./chunk-
|
|
2
|
+
import{El,gp,mp,hp,yp,Tl,$l,bp,vp,uo,wp,Xn,Jn,Wr}from"./chunk-xhmpfq9d.js";import{Ye}from"./chunk-x34scshq.js";import"./chunk-2yg9y1na.js";import"./chunk-35zjpdcb.js";import"./chunk-2h8ea0we.js";import"./chunk-4e0z858k.js";import"./chunk-ce6zddpf.js";import"./chunk-4qwvqbzf.js";export{yp as __setSignalsGeneratorsForTest,Ye as cacheEngineFingerprint,Jn as cacheTemplate,Xn as checkCache,wp as clearDevCaches,$l as getCachedRouterScript,Tl as getCachedSignalsRuntime,bp as getServeClientAsset,uo as getServeModuleBundle,Wr as hashFilePath,mp as invalidateFileCache,hp as invalidateFileCacheByDir,gp as readFileCached,vp as registerServeModuleBundle,El as templateCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{_}from"./chunk-j3472s37.js";import{Fe,wn}from"./chunk-wpm58d6p.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
|
|
3
3
|
maxEntries: ${o},
|
|
4
4
|
${u?`maxAgeSeconds: ${u},`:""}
|
|
5
5
|
purgeOnQuotaError: true,
|
|
@@ -17,7 +17,7 @@ registerRoute(
|
|
|
17
17
|
],`:""}
|
|
18
18
|
})
|
|
19
19
|
);`)}return c.join(`
|
|
20
|
-
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?Fe(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function
|
|
20
|
+
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?Fe(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?Fe(t,e):null,l=s?wn(s):"[]",o=k(n.modules),u=d(e);return`/**
|
|
21
21
|
* Service Worker - Generated by stx with Workbox
|
|
22
22
|
* Cache Version: ${n.cacheVersion}
|
|
23
23
|
*
|
|
@@ -41,7 +41,7 @@ importScripts('https://storage.googleapis.com/workbox-cdn/releases/7.0.0/workbox
|
|
|
41
41
|
// build's transpiler folds that particular read to a constant, so every
|
|
42
42
|
// published copy of stx emitted "debug: true" and no app could turn Workbox's
|
|
43
43
|
// logging off in production however it set NODE_ENV (see ../env.ts).
|
|
44
|
-
workbox.setConfig({ debug: ${!
|
|
44
|
+
workbox.setConfig({ debug: ${!_()} });
|
|
45
45
|
|
|
46
46
|
// Extract modules from workbox global
|
|
47
47
|
${o}
|
|
@@ -308,4 +308,4 @@ self.addEventListener('message', (event) => {
|
|
|
308
308
|
event.waitUntil(syncQueue.pushRequest({ request }));
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
|
-
`}export{
|
|
311
|
+
`}export{W as generateWorkboxServiceWorker};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
function _(){let{NODE_ENV:n}=process.env;return n==="production"}function H(){let{STX_DEBUG:n}=process.env;return!_()||n==="true"}function bn(){let{NODE_ENV:n}=process.env;return n==="test"}function qo(n){return n==="compile"||_()}function yr(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
|
|
3
|
+
export{_,H,bn,qo,yr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{xc,Sc}from"./chunk-x9d4bpmh.js";import"./chunk-vs8kg85h.js";import"./chunk-h4vg78mw.js";import"./chunk-d4tf0tfn.js";import"./chunk-4nbq7mnp.js";import"./chunk-k49fg322.js";import"./chunk-zqtbtqbq.js";import"./chunk-s4cs2n2c.js";import{Ci}from"./chunk-kcrtqyek.js";import"./chunk-jxda11cg.js";import"./chunk-46w53nj5.js";import"./chunk-phws2c9s.js";import"./chunk-rcadtv3x.js";import"./chunk-v9bmw06j.js";import"./chunk-48acjmeg.js";import"./chunk-ym41ybz2.js";import"./chunk-n38yb274.js";import"./chunk-ra56jh7e.js";import"./chunk-tre98h62.js";import"./chunk-2zqg980j.js";import"./chunk-dgb4z4kw.js";import"./chunk-r3e6x87d.js";import"./chunk-mmwedr93.js";import"./chunk-vngnface.js";import"./chunk-kgfgb971.js";import"./chunk-nrvwejdw.js";import"./chunk-ex1kd5gs.js";import"./chunk-m47spkxr.js";import"./chunk-en8jgavy.js";import"./chunk-ktvr9ta8.js";import"./chunk-c1dkh0es.js";import"./chunk-6ajahb2x.js";import"./chunk-cvw7gknw.js";import"./chunk-5yxd4ryz.js";import"./chunk-9y2ncrnq.js";import{Ee,s}from"./chunk-g7j3mwzd.js";import"./chunk-ff1cb7k4.js";import"./chunk-prf164ct.js";import"./chunk-36649w15.js";import"./chunk-ewng6v6g.js";import"./chunk-929zbzh7.js";import"./chunk-8gewq710.js";import"./chunk-k7nan28e.js";import{me}from"./chunk-n7xbhzzt.js";import"./chunk-wh838rdh.js";import{Xn,Jn}from"./chunk-xhmpfq9d.js";import{qr,N,i}from"./chunk-3v8yejzc.js";import"./chunk-26whq1rg.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-h09a03ay.js";import"./chunk-qrt8b179.js";import{f,Oe}from"./chunk-2yg9y1na.js";import"./chunk-35zjpdcb.js";import"./chunk-2h8ea0we.js";import"./chunk-4e0z858k.js";import"./chunk-ce6zddpf.js";import"./chunk-4qwvqbzf.js";import"./chunk-9p6efb17.js";import"./chunk-khvc43pq.js";export{qr as buildWebComponents,Jn as cacheTemplate,Xn as checkCache,Ci as classifyAllScripts,xc as createMiddleware,Sc as createRoute,N as defaultConfig,f as extractVariables,me as injectRouterScript,i as loadStxConfig,Oe as processClientScript,s as processDirectives,Ee as readMarkdownFile};
|