@stacksjs/bun-router 0.0.26 → 0.1.0

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.
Files changed (103) hide show
  1. package/dist/chunk-0gjq8ttx.js +14 -0
  2. package/dist/chunk-0t5vz87j.js +35 -0
  3. package/dist/chunk-30rkn2ym.js +2 -0
  4. package/dist/chunk-38cmrard.js +2 -0
  5. package/dist/chunk-3qna6dwd.js +2 -0
  6. package/dist/chunk-4d5fmta0.js +2 -0
  7. package/dist/chunk-4x3b4b4q.js +2 -0
  8. package/dist/chunk-5be9x5cq.js +3 -0
  9. package/dist/chunk-5mxby3fd.js +1654 -0
  10. package/dist/chunk-5n0ckcmc.js +3 -0
  11. package/dist/chunk-5ncn73tp.js +3 -0
  12. package/dist/chunk-5s0pnsd6.js +12 -0
  13. package/dist/chunk-5s1pr62n.js +3 -0
  14. package/dist/chunk-67wgad4f.js +60 -0
  15. package/dist/chunk-6bbmkwng.js +3 -0
  16. package/dist/chunk-6s1kbajm.js +7851 -0
  17. package/dist/chunk-6sjvhy5f.js +3 -0
  18. package/dist/chunk-6xed4va1.js +2 -0
  19. package/dist/chunk-73k79n7q.js +15413 -0
  20. package/dist/chunk-748n6ydj.js +2 -0
  21. package/dist/chunk-7qnxdedn.js +321 -0
  22. package/dist/chunk-7rsf8tes.js +898 -0
  23. package/dist/chunk-8aspmtf1.js +2 -0
  24. package/dist/chunk-8wpj3fqe.js +351 -0
  25. package/dist/chunk-8yfdg595.js +2 -0
  26. package/dist/chunk-90eze7av.js +3 -0
  27. package/dist/chunk-9805tt8n.js +341 -0
  28. package/dist/chunk-9dvwyej7.js +2 -0
  29. package/dist/chunk-9ght4n4r.js +216 -0
  30. package/dist/chunk-a2w45krb.js +2 -0
  31. package/dist/chunk-a3wahyg7.js +3 -0
  32. package/dist/chunk-a547f2ab.js +48 -0
  33. package/dist/chunk-bqdycvtc.js +2 -0
  34. package/dist/chunk-brpgjyqg.js +3 -0
  35. package/dist/chunk-cd03rk3x.js +2 -0
  36. package/dist/chunk-csfrpsp7.js +185 -0
  37. package/dist/chunk-ct0m17q5.js +2 -0
  38. package/dist/chunk-dhbvvr5h.js +2 -0
  39. package/dist/chunk-dhptcsya.js +943 -0
  40. package/dist/chunk-dq93zag9.js +2 -0
  41. package/dist/chunk-dxg045wj.js +5 -0
  42. package/dist/chunk-e3qej0jr.js +4 -0
  43. package/dist/chunk-edrtesh7.js +2 -0
  44. package/dist/chunk-ejcws37w.js +2 -0
  45. package/dist/chunk-ex5fkjah.js +397 -0
  46. package/dist/chunk-ex890p45.js +51 -0
  47. package/dist/chunk-f69cpnhw.js +2 -0
  48. package/dist/chunk-fjf53b44.js +2 -0
  49. package/dist/chunk-fjzye4qj.js +2 -0
  50. package/dist/chunk-gfd23b6t.js +2 -0
  51. package/dist/chunk-habv0vef.js +12 -0
  52. package/dist/chunk-hmgedrmr.js +11 -0
  53. package/dist/chunk-hz6fc788.js +2 -0
  54. package/dist/chunk-jff6j9y3.js +10 -0
  55. package/dist/chunk-jmeb7n8k.js +70 -0
  56. package/dist/chunk-jrf5a2ap.js +2 -0
  57. package/dist/chunk-jy2jhcpy.js +246 -0
  58. package/dist/chunk-kc659vhx.js +4 -0
  59. package/dist/chunk-kjtjbcq4.js +71 -0
  60. package/dist/chunk-krkchy8v.js +4 -0
  61. package/dist/chunk-kxp888dn.js +4540 -0
  62. package/dist/chunk-m249t3je.js +3 -0
  63. package/dist/chunk-m9yabnjx.js +2 -0
  64. package/dist/chunk-mekrq9wd.js +2 -0
  65. package/dist/chunk-mmxv535f.js +82 -0
  66. package/dist/chunk-mypn7jss.js +2 -0
  67. package/dist/chunk-n18x1k3c.js +2 -0
  68. package/dist/chunk-nkddjzsa.js +2 -0
  69. package/dist/chunk-pjmhqmr9.js +2 -0
  70. package/dist/chunk-qyrnsaq1.js +2 -0
  71. package/dist/chunk-r19ff2qm.js +62 -0
  72. package/dist/chunk-r338fssq.js +2 -0
  73. package/dist/chunk-s36z58x2.js +29 -0
  74. package/dist/chunk-s3dn1kwx.js +231 -0
  75. package/dist/chunk-s79dd325.js +471 -0
  76. package/dist/chunk-sw0chtw4.js +4 -0
  77. package/dist/chunk-ta38j9em.js +2 -0
  78. package/dist/chunk-tpfgntwj.js +4211 -0
  79. package/dist/chunk-vr10sbbh.js +3 -0
  80. package/dist/chunk-vsh4390q.js +358 -0
  81. package/dist/chunk-vv3gb1m5.js +84 -0
  82. package/dist/chunk-vw8rwv6e.js +2 -0
  83. package/dist/chunk-w4r464v5.js +288 -0
  84. package/dist/chunk-wcrqs5z9.js +2 -0
  85. package/dist/chunk-x6d1rmwa.js +2 -0
  86. package/dist/chunk-x7ft15zz.js +2 -0
  87. package/dist/chunk-x8trwn7j.js +3 -0
  88. package/dist/chunk-xg9xscqz.js +1 -0
  89. package/dist/chunk-xhepdj1f.js +2 -0
  90. package/dist/chunk-xv2em0q4.js +4 -0
  91. package/dist/chunk-ypw6g0te.js +2 -0
  92. package/dist/chunk-z8szsm21.js +2 -0
  93. package/dist/chunk-zetqzgf3.js +194 -0
  94. package/dist/chunk-zfbh14qe.js +2 -0
  95. package/dist/chunk-zhx0hxdd.js +28 -0
  96. package/dist/cli.js +67 -3240
  97. package/dist/container/index.js +1 -321
  98. package/dist/index.js +80 -13987
  99. package/dist/types.d.ts +12 -2
  100. package/package.json +1 -1
  101. package/dist/chunk-1ahs68ys.js +0 -18
  102. package/dist/chunk-cgptvjdf.js +0 -18131
  103. package/dist/chunk-g3ybefhg.js +0 -1923
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import"./chunk-a3wahyg7.js";var l=null,v=[],m=new WeakMap;function x(e){let o=e,t=new Set,n={get value(){if(l){let s=m.get(n);if(!s)s=new Set,m.set(n,s);s.add(l)}return o},set value(s){if(!Object.is(o,s)){o=s,t.forEach((i)=>i(s));let r=m.get(n);if(r)r.forEach((i)=>i())}},subscribe(s){return t.add(s),()=>t.delete(s)},peek(){return o}};return n}function h(e){return e!==null&&typeof e==="object"&&"value"in e&&"subscribe"in e&&"peek"in e}function k(e){return h(e)?e.value:e}function _(e){let o={};for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))o[t]=x(e[t]);return o}function E(e){return x(e)}function S(e){let o=typeof e==="function",t=o?e:e.get,n=o?void 0:e.set,s=o?Object.is:e.equals||Object.is,r,i=!0,c=new Set,f=new Set,d=()=>{if(i=!0,f.size>0){let u=a.value;f.forEach((w)=>w(u))}};function p(){c.clear();let u=l;l=d,v.push(d);try{return t()}finally{v.pop(),l=u}}let a={get value(){if(l){let u=m.get(a);if(!u)u=new Set,m.set(a,u);u.add(l)}if(i){let u=p();if(!s(r,u))r=u;i=!1}return r},set value(u){if(n)n(u);else console.warn("Computed property is readonly")},subscribe(u){return f.add(u),()=>f.delete(u)},peek(){if(i)r=t(),i=!1;return r},invalidate(){i=!0},get dirty(){return i},get deps(){return c}};return a}function R(e,o,t={}){let{immediate:n=!1,deep:s=!1,flush:r="pre",once:i=!1}=t,c,f=!0,d=!1,p=()=>{if(h(e))return s?b(e.value):e.value;return e()},a=()=>{if(!f||d)return;let y=p();if(c!==void 0&&Object.is(c,y)&&!s)return;let g=()=>{if(o(y,c),c=s?b(y):y,i)w()};if(r==="sync")g();else if(r==="post")queueMicrotask(g);else Promise.resolve().then(g)},u=null;if(h(e))u=e.subscribe(()=>a());else u=S(e).subscribe(()=>a());if(n)c=void 0,a();else c=p();let w=()=>{if(f=!1,u)u(),u=null};return w.pause=()=>{d=!0},w.resume=()=>{d=!1},w}function $(e,o,t={}){let{immediate:n=!1,once:s=!1}=t,r=e.map((a)=>h(a)?a.value:void 0),i=!0,c=!1,f=()=>{if(!i||c)return;let a=e.map((u)=>h(u)?u.value:void 0);if(o(a,r),r=[...a],s)p()},d=e.map((a)=>{if(h(a))return a.subscribe(()=>f());return()=>{}});if(n)f();let p=()=>{i=!1,d.forEach((a)=>a())};return p.pause=()=>{c=!0},p.resume=()=>{c=!1},p}function j(e,o={}){let{flush:t="pre"}=o,n,s=!0,r=!1,i=()=>{if(!s||r)return;if(n)n();let f=l;l=i,v.push(i);try{n=e()}finally{v.pop(),l=f}};if(t==="sync")i();else if(t==="post")queueMicrotask(i);else Promise.resolve().then(i);let c=()=>{if(s=!1,n)n()};return c.pause=()=>{r=!0},c.resume=()=>{r=!1},c}function C(e,o={},t){let n=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return e.replace(n,(s,r,i)=>{try{let c=Function(...Object.keys(o),`return ${i}`)(...Object.values(o));return o[r]=c,`<!-- computed: ${r} = ${c} -->`}catch(c){return`<!-- computed error: ${r} - ${c} -->`}})}function D(e,o={},t){let n=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return e.replace(n,(s,r,i)=>{return`
3
+ <script data-watch="${`watch-${Math.random().toString(36).substring(2,9)}`}">
4
+ (function() {
5
+ // Watch implementation for ${r}
6
+ const handler = ${i.trim()};
7
+ if (window.__stxState && window.__stxState['${r}']) {
8
+ window.__stxState['${r}'].subscribe(function(newValue) {
9
+ handler(newValue);
10
+ });
11
+ }
12
+ })();
13
+ </script>
14
+ `})}function b(e){if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((t)=>b(t));if(e instanceof Date)return new Date(e.getTime());if(e instanceof Map){let t=new Map;return e.forEach((n,s)=>t.set(b(s),b(n))),t}if(e instanceof Set){let t=new Set;return e.forEach((n)=>t.add(b(n))),t}let o={};for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))o[t]=b(e[t]);return o}function P(e,o=100){let t=x(e()),n=null,s=()=>{if(n)clearTimeout(n);n=setTimeout(()=>{t.value=e()},o)};return S(e).subscribe(()=>s()),{get value(){return t.value},set value(r){console.warn("Debounced computed is readonly")},subscribe:t.subscribe,peek:t.peek,invalidate(){s()},get dirty(){return!1},get deps(){return new Set}}}function M(e,o=100){let t=x(e()),n=0,s=()=>{let r=Date.now();if(r-n>=o)n=r,t.value=e()};return S(e).subscribe(()=>s()),{get value(){return t.value},set value(r){console.warn("Throttled computed is readonly")},subscribe:t.subscribe,peek:t.peek,invalidate(){s()},get dirty(){return!1},get deps(){return new Set}}}var V={ref:x,computed:S,watch:R,watchMultiple:$,watchEffect:j,isRef:h,unref:k,toRefs:_,shallowRef:E,debouncedComputed:P,throttledComputed:M,processComputedDirectives:C,processWatchDirectives:D};export{$ as watchMultiple,j as watchEffect,R as watch,k as unref,_ as toRefs,M as throttledComputed,$ as stxWatchMultiple,j as stxWatchEffect,R as stxWatch,k as stxUnref,_ as stxToRefs,M as stxThrottledComputed,E as stxShallowRef,x as stxRef,h as stxIsRef,P as stxDebouncedComputed,S as stxComputed,E as shallowRef,x as ref,D as processWatchDirectives,C as processComputedDirectives,h as isRef,V as default,P as debouncedComputed,S as computed};
@@ -0,0 +1,35 @@
1
+ // @bun
2
+ import{In as le,Kn as ue}from"./chunk-krkchy8v.js";import{Mo as ce}from"./chunk-5be9x5cq.js";import C from"path";import O from"process";class Fe{source;pos=0;line=1;column=0;tokens=[];constructor(n){this.source=n}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let n=this.nextToken();if(n)this.tokens.push(n)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let n=this.pos,e=this.line,t=this.column,o=this.source[this.pos];if(/\s/.test(o))return this.readWhitespace(n,e,t);if(o==="/"&&this.peek(1)==="/")return this.readLineComment(n,e,t);if(o==="/"&&this.peek(1)==="*")return this.readBlockComment(n,e,t);if(o==='"'||o==="'")return this.readString(o,n,e,t);if(o==="`")return this.readTemplateString(n,e,t);if(/\d/.test(o)||o==="."&&/\d/.test(this.peek(1)||""))return this.readNumber(n,e,t);if(/[a-z_$]/i.test(o))return this.readIdentifier(n,e,t);if(o==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:n,end:this.pos,line:e,column:t};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:n,end:this.pos,line:e,column:t};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:n,end:this.pos,line:e,column:t}}if(o==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:n,end:this.pos,line:e,column:t};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:n,end:this.pos,line:e,column:t}}if(o==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:n,end:this.pos,line:e,column:t};if(o==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective(n,e,t);let i=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let s of i)if(this.source.slice(this.pos,this.pos+s.length)===s)return this.advance(s.length),{type:"OPERATOR",value:s,start:n,end:this.pos,line:e,column:t};if(/[+\-*/%<>=!&|^~?:]/.test(o))return this.advance(),{type:"OPERATOR",value:o,start:n,end:this.pos,line:e,column:t};if(/[()[\]{},;.]/.test(o))return this.advance(),{type:"PUNCTUATION",value:o,start:n,end:this.pos,line:e,column:t};return this.advance(),{type:"PUNCTUATION",value:o,start:n,end:this.pos,line:e,column:t}}readWhitespace(n,e,t){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice(n,this.pos),start:n,end:this.pos,line:e,column:t}}readLineComment(n,e,t){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3
+ `)this.advance();return{type:"COMMENT",value:this.source.slice(n,this.pos),start:n,end:this.pos,line:e,column:t}}readBlockComment(n,e,t){this.advance(2);while(this.pos<this.source.length-1){if(this.source[this.pos]==="*"&&this.source[this.pos+1]==="/"){this.advance(2);break}this.advance()}return{type:"COMMENT",value:this.source.slice(n,this.pos),start:n,end:this.pos,line:e,column:t}}readString(n,e,t,o){this.advance();while(this.pos<this.source.length){let i=this.source[this.pos];if(i==="\\"){this.advance(2);continue}if(i===n){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:o}}readTemplateString(n,e,t){this.advance();let o=0,i=256;while(this.pos<this.source.length){let s=this.source[this.pos];if(s==="\\"){this.advance(2);continue}if(s==="$"&&this.peek(1)==="{"){if(o>=i){this.pos=this.source.length;break}this.advance(2),o++;continue}if(s==="{"&&o>0){o++,this.advance();continue}if(s==="}"&&o>0){o--,this.advance();continue}if(s==="`"&&o===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice(n,this.pos),start:n,end:this.pos,line:e,column:t}}readNumber(n,e,t){if(this.source[this.pos]==="0"){let o=this.peek(1)?.toLowerCase();if(o==="x"||o==="o"||o==="b"){this.advance(2);while(this.pos<this.source.length&&/[\da-f_]/i.test(this.source[this.pos]))this.advance();return{type:"NUMBER",value:this.source.slice(n,this.pos),start:n,end:this.pos,line:e,column:t}}}while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance();if(this.source[this.pos]==="."&&/\d/.test(this.peek(1)||"")){this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(/e/i.test(this.source[this.pos]||"")){if(this.advance(),/[+-]/.test(this.source[this.pos]||""))this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(this.source[this.pos]==="n")this.advance();return{type:"NUMBER",value:this.source.slice(n,this.pos),start:n,end:this.pos,line:e,column:t}}readIdentifier(n,e,t){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice(n,this.pos),start:n,end:this.pos,line:e,column:t}}readDirective(n,e,t){this.advance();while(this.pos<this.source.length&&/[a-z]/i.test(this.source[this.pos]))this.advance();return{type:"DIRECTIVE",value:this.source.slice(n,this.pos),start:n,end:this.pos,line:e,column:t}}advance(n=1){for(let e=0;e<n&&this.pos<this.source.length;e++){if(this.source[this.pos]===`
4
+ `)this.line++,this.column=0;else this.column++;this.pos++}}peek(n){return this.source[this.pos+n]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState(n){this.pos=n.pos,this.line=n.line,this.column=n.column}}function T(n,e,t,o=0){let i=0,s=o,r=null,a=0,c=!1;while(s<n.length){let l=n[s];if(r&&c){c=!1,s++;continue}if(r&&l==="\\"){c=!0,s++;continue}if(c=!1,(l==='"'||l==="'"||l==="`")&&!r){r=l,s++;continue}if(l===r&&r!=="`"){r=null,s++;continue}if(r==="`"&&l==="$"&&n[s+1]==="{"){a++,s+=2;continue}if(a>0&&l==="}"){a--,s++;continue}if(l==="`"&&r==="`"&&a===0){r=null,s++;continue}if(r){s++;continue}if(l===e)i++;else if(l===t){if(i--,i===0)return s}s++}return-1}function ct(n,e){let t=e,o={paren:0,bracket:0,brace:0},i=null,s=0;while(t<n.length){let r=n[t];if((t>0?n[t-1]:"")==="\\"&&i){t++;continue}if((r==='"'||r==="'")&&!i){i=r,t++;continue}if(r===i&&i!=="`"){i=null,t++;continue}if(r==="`"&&!i){i="`",t++;continue}if(r==="`"&&i==="`"&&s===0){i=null,t++;continue}if(i==="`"&&r==="$"&&n[t+1]==="{"){s++,t+=2;continue}if(s>0){if(r==="{")s++;else if(r==="}")s--;t++;continue}if(i){t++;continue}if(o.paren===0&&o.bracket===0&&o.brace===0){if(n.slice(t,t+2)==="}}"||n.slice(t,t+3)==="!!}")break;if(r===","||r===";")break}if(r==="(")o.paren++;else if(r===")"){if(o.paren--,o.paren<0)break}else if(r==="[")o.bracket++;else if(r==="]"){if(o.bracket--,o.bracket<0)break}else if(r==="{")o.brace++;else if(r==="}"){if(o.brace--,o.brace<0)break}t++}return{expression:n.slice(e,t),endPos:t}}function lt(n){let e=[],t="",o={paren:0,bracket:0,brace:0},i=null,s=0;for(let r=0;r<n.length;r++){let a=n[r];if((r>0?n[r-1]:"")==="\\"&&i){t+=a;continue}if((a==='"'||a==="'")&&!i){i=a,t+=a;continue}if(a===i&&i!=="`"){i=null,t+=a;continue}if(a==="`"&&!i){i="`",t+=a;continue}if(a==="`"&&i==="`"&&s===0){i=null,t+=a;continue}if(i==="`"&&a==="$"&&n[r+1]==="{"){s++,t+=a+n[r+1],r++;continue}if(s>0&&a==="{"){s++,t+=a;continue}if(s>0&&a==="}"){s--,t+=a;continue}if(i){t+=a;continue}if(a==="(")o.paren++;else if(a===")")o.paren--;else if(a==="[")o.bracket++;else if(a==="]")o.bracket--;else if(a==="{")o.brace++;else if(a==="}")o.brace--;if(a==="|"&&n[r+1]!=="|"&&(r===0||n[r-1]!=="|")&&n[r-1]!=="\\"&&o.paren===0&&o.bracket===0&&o.brace===0){e.push(t.trim()),t="";continue}if(a==="|"&&n[r-1]==="\\"&&!i){t=t.slice(0,-1)+a;continue}t+=a}if(t.trim())e.push(t.trim());return e}var Le={maxSanitizeDepth:10,allowBracketNotation:!1},H={...Le};var K=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],Be=new Set(["eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this"]),Q=new Set(["__proto__","constructor","prototype"]),qe=/[\w)\]]\s*\[\s*['"]/;function Ue(n){let e="",t=null,o=!1;for(let i=0;i<n.length;i++){let s=n[i];if(o){o=!1;continue}if(s==="\\"&&t){o=!0;continue}if(t){if(t==="`"&&s==="$"&&i+1<n.length&&n[i+1]==="{"){let r=1;i+=2;while(i<n.length&&r>0){if(n[i]==="{")r++;else if(n[i]==="}")r--;if(r>0)e+=n[i],i++}continue}if(s===t)t=null;continue}if(s==='"'||s==="'"||s==="`"){t=s;continue}e+=s}return e}function ze(n,e){let t=/[$A-Z_a-z][$\w]*/g,o;while((o=t.exec(n))!==null){let i=o[0],s=n[o.index-1];if(Be.has(i))throw Error(`Potentially unsafe expression (matched /\\b${i}\\b/; identifier ${i}): ${e}`);if(s==="."&&Q.has(i))throw Error(`Potentially unsafe expression (matched /.${i}/; property ${i}): ${e}`)}}function Ve(n){let e=/\[\s*(['"])(.*?)\1\s*\]/g,t;while((t=e.exec(n))!==null){let o=t[2];if(!Q.has(o))continue;let i=n.slice(0,t.index).match(/\S(?=\s*$)/)?.[0],s=n.slice(t.index+t[0].length).match(/^\s*(\S)/)?.[1];if(!((i==="{"||i===",")&&s===":"))throw Error(`Potentially unsafe expression (bracket key ${t[2]}): ${n}`)}}function Y(n){let e=n.trim(),t=Ue(e);ze(t,e),Ve(e);for(let o of K)if(o.test(t))throw Error(`Potentially unsafe expression (matched /${o.source}/): ${e}`);if(!H.allowBracketNotation&&qe.test(e))throw Error(`Bracket notation with strings not allowed: ${e}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return e}function Ge(n){let e={};e.Math=Math,e.JSON=JSON,e.Date=Date,e.String=String,e.Number=Number,e.Boolean=Boolean,e.Array=Array,e.parseInt=Number.parseInt,e.parseFloat=Number.parseFloat,e.isNaN=Number.isNaN,e.isFinite=Number.isFinite,e.encodeURIComponent=encodeURIComponent,e.decodeURIComponent=decodeURIComponent;for(let[t,o]of Object.entries(n)){if(t.startsWith("__")||K.some((i)=>i.test(t)))continue;if(o&&typeof o==="object"&&!Array.isArray(o))e[t]=B(o);else e[t]=o}return e}function B(n,e=0){if(e>=H.maxSanitizeDepth)return"[Object too deep]";if(n===null||typeof n!=="object")return n;if(Array.isArray(n))return n.map((o)=>B(o,e+1));if(n instanceof Date||n instanceof RegExp||n instanceof Map||n instanceof Set||n instanceof Error)return n;let t={};for(let[o,i]of Object.entries(n)){if(o.startsWith("__")||o==="constructor"||o==="prototype")continue;if(i&&typeof i==="object")t[o]=B(i,e+1);else t[o]=i}return t}function L(n,e){try{let t=Ge(e),o=Object.keys(t),i=Object.values(t);return Ze(n,o)(...i)}catch{return}}function ft(n){try{return Y(n),!0}catch{return!1}}function ht(n,e){try{let t=L(n,e);if(t&&typeof t==="object"&&!Array.isArray(t))return t;return{}}catch{return{}}}var ee=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]);function Ze(n,e){let t=Y(n),o=/^[A-Za-z_$][\w$]*$/,i=[],s=[];for(let c=0;c<e.length;c++){let l=e[c];if(!o.test(l))continue;if(ee.has(l))continue;i.push(c),s.push(l)}let r=(c)=>Function(...s,...c,`
5
+ 'use strict';
6
+ try {
7
+ return ${t};
8
+ }
9
+ catch (e) {
10
+ if (e instanceof TypeError) {
11
+ return undefined;
12
+ }
13
+ throw e;
14
+ }
15
+ `),a=r([]);if(s.length===e.length)return J(a,s,r);return J((...c)=>{let l=Array(i.length);for(let u=0;u<i.length;u++)l[u]=c[i[u]];return a(...l)},s,r,(c)=>{a=r(c)})}function J(n,e,t,o){let s=/^(\w+) is not defined$/,r=n,a=[],c=new Set(e);return(...l)=>{for(let u=0;u<=8;u++)try{return r(...l)}catch(p){let d=p instanceof Error?p.message:"",m=s.exec(d);if(!(p instanceof ReferenceError)||!m)return;let g=m[1];if(c.has(g)||ee.has(g))return;c.add(g),a.push(g),r=t(a),o?.(a)}return}}function pt(n){let e=n.trim(),t=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let o of t)if(o.test(e))return!1;return!0}var{require:te}=import.meta,fe=["module","exports","require","props","$props","defineProps","withDefaults","defineClientPayload","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"],ne=new Set(fe),Xe=new Set(["stx","@stacksjs/stx"]);function Je(n){let e=[],t=0,o=n.split(`
16
+ `);for(let i of o){let s=t,r=null,a=!1;for(let c=0;c<i.length;c++){let l=i[c];if(a){a=!1;continue}if(l==="\\"){a=!0;continue}if(r){if(l===r)r=null;continue}if(l==="'"||l==='"'||l==="`"){r=l;continue}if(l==="/"&&c+1<i.length&&i[c+1]==="/")break;if(l==="{")t++;else if(l==="}")t--}if(s===0){let c=i.match(/(?:const|let|var)\s+(\w+)\s*=/);if(c)e.push(c[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(i)){let l=i.match(/(?:const|let|var)\s+(\w+)/);if(l)e.push(l[1])}else{let l=i.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(l){let u=l[1].slice(1,-1).split(",").map((p)=>{let d=p.split(":");return(d.length>1?d[1]:d[0]).trim()}).filter((p)=>/^\w+$/.test(p));e.push(...u)}}}}return[...new Set(e)]}function He(n){let e=n;e=e.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),e=e.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),e=e.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function t(o){if(!o.includes(":"))return o;let i=[],s="",r=0,a=0,c=null;for(let l=0;l<o.length;l++){let u=o[l];if(c){if(s+=u,u===c)c=null;continue}if(u==='"'||u==="'"||u==="`"){c=u,s+=u;continue}if(u==="<")r++;else if(u===">"&&r>0)r--;else if(u==="(")a++;else if(u===")")a--;if(u===","&&r===0&&a===0){i.push(s),s="";continue}s+=u}if(s)i.push(s);return i.map((l)=>{let u=l.trim(),p=u.startsWith("..."),d=p?u.slice(3):u,m=-1,g=0;for(let _=0;_<d.length;_++)if(d[_]==="<")g++;else if(d[_]===">")g--;else if(d[_]===":"&&g===0){m=_;break}if(m===-1)return l;let v=d.substring(0,m).trim().replace(/\?$/,""),$=d.substring(m+1),k=-1,x=0;for(let _=0;_<$.length;_++)if($[_]==="<")x++;else if($[_]===">")x--;else if($[_]==="="&&x===0){k=_;break}let E=p?"...":"";if(k!==-1)return`${E}${v} = ${$.substring(k+1).trim()}`;return`${E}${v}`}).join(", ")}e=e.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(o,i,s)=>{if(!s.includes(":"))return o;return`${i}(${t(s)})`});{let o=/\b(function\s+\w*\s*)\(/g,i,s=[];while((i=o.exec(e))!==null){let r=i.index+i[0].length-1,a=1,c=r+1,l=0,u=null;while(c<e.length&&a>0){let m=e[c];if(u){if(m===u)u=null;c++;continue}if(m==='"'||m==="'"||m==="`"){u=m,c++;continue}if(m==="<")l++;else if(m===">"&&l>0)l--;else if(l===0){if(m==="(")a++;else if(m===")")a--}if(a>0)c++}if(a!==0)continue;let p=e.substring(r+1,c);if(!p.includes(":"))continue;let d=t(p);s.push({start:r+1,end:c,replacement:d})}for(let r=s.length-1;r>=0;r--){let{start:a,end:c,replacement:l}=s[r];e=e.substring(0,a)+l+e.substring(c)}}return e=e.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(o,i)=>{if(!i.includes(":"))return o;if(i.includes("{")||i.includes("}"))return o;return`(${i.split(",").map((s)=>{let[r,...a]=s.split("="),c=r.split(":")[0].trim();if(a.length>0)return`${c} = ${a.join("=").trim()}`;return c}).join(", ")}) =>`}),e=e.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),e=e.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),e=e.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),e=e.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),e=e.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),e=e.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),e=e.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),e=e.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),e=e.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),e=e.replace(/\n\s*\n\s*\n/g,`
17
+
18
+ `),e}function Ke(n){return/cannot find module|could not resolve|module not found|failed to resolve/i.test(n)}function Qe(n){if(!/is not defined|can't find variable/i.test(n))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test(n)}async function wt(n,e,t,o={}){if(!n.trim())return;let i;try{let f=new Bun.Transpiler({loader:"ts",target:"browser",define:ce()}),h=n.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");h=h.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),i=f.transformSync(h)}catch{i=He(n)}let s={exports:{}},r=s.exports,a=O.cwd(),c={},l=[...i.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((f)=>f[1]).filter((f)=>!f.startsWith("node:")&&!f.startsWith(".")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(f));for(let f of l)try{let h=C.resolve(a,"node_modules",f),b=C.join(h,"package.json"),y=JSON.parse(te("fs").readFileSync(b,"utf8")),S=y.main||"index.js";if(y.exports){let I=typeof y.exports==="string"?y.exports:y.exports["."];if(typeof I==="string")S=I;else if(I?.bun)S=I.bun;else if(I?.import)S=I.import;else if(I?.default)S=I.default}c[f]=await import(C.resolve(h,S))}catch{}let u=(f)=>{if(c[f])return c[f];return te(f)},p=e.props||{},d=(f)=>{if(!f)return p;let h={};for(let[b,y]of Object.entries(f)){let S=p[b];if(S!==void 0)h[b]=S;else if(typeof y==="function")h[b]=y();else h[b]=y}return h};for(let[f,h]of Object.entries(p))Object.defineProperty(d,f,{value:h,enumerable:!0,configurable:!0,writable:!0});for(let f of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(p,f))continue;try{Object.defineProperty(d,f,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let m=(f)=>{if(!f)return p;let h={...p};for(let[b,y]of Object.entries(f)){let S=y&&typeof y==="object"&&!Array.isArray(y)?y:{type:y};if(h[b]===void 0&&S.default!==void 0)h[b]=typeof S.default==="function"?S.default():S.default}return h},g=()=>e.slots||{},v=(f,h)=>{let b={...f};for(let[y,S]of Object.entries(h))if(b[y]===void 0)if(typeof S==="function")b[y]=S();else b[y]=S;return b},$=(f)=>{let h=()=>f;return h.set=(b)=>{},h.update=(b)=>{},h},k=(f)=>{let h,b=!1;return()=>{if(!b)try{h=f(),b=!0}catch{h=void 0}return h}},x=(f)=>{},E=(f)=>f(),_=(f)=>{},R=(f)=>{};function N(f){let h=f||{};if(h.title!==void 0||h.description!==void 0)z({title:h.title,description:h.description})}function A(f){if(!f||typeof f!=="object")return;let h=e.__stxClientPayload??{};Object.assign(h,f),e.__stxClientPayload=h}let W=()=>{let f=e.__stxServeContext,h=e.__stxServeSearch??f?.search??"",b=f?.path??"",y=Object.fromEntries(new URLSearchParams(h)),S=e.query,I=Object.keys(y).length>0?y:S??{},F=h||(Object.keys(I).length>0?`?${new URLSearchParams(I).toString()}`:"");return{params:e.params??{},query:I,path:b,name:"",fullPath:b+F,hash:"",matched:[]}},P=()=>({push:(f)=>{},replace:(f)=>{},back:()=>{},forward:()=>{},go:(f)=>{}}),U=(f)=>{let h=e.__stx_runtime_head||{};e.__stx_runtime_head=le(h,f||{})},z=(f)=>{U(ue(f||{}))},ge=(f)=>({value:f}),ve=(f)=>f,be=(f)=>({value:typeof f==="function"?f():f}),ye=(f,h)=>{},xe=(f)=>{},we=(f)=>{},$e=(f)=>f?f():Promise.resolve(),Se=(f)=>(h,...b)=>{},ke=(f)=>{},_e=(f,h)=>{},Ee=(f,h)=>h,Ie=()=>({value:"light"}),Ae=()=>$(!1),D=(f)=>$(!1),Ne=()=>$(!1),Re=()=>D("(prefers-color-scheme: dark)"),Ce=()=>D("(prefers-color-scheme: light)"),Te=()=>D("(prefers-reduced-motion: reduce)"),Pe=()=>D("(prefers-contrast: more)"),j={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},Oe=new Proxy(j,{get(f,h){if(h in f)return f[h];return},set(f,h,b){return f[h]=b,!0}}),We={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},De=console;try{let f=tt(i,t),h=new Set(Object.keys(p)),b=(w)=>/^[a-z_$][\w$]*$/i.test(w),y=Object.keys(e).filter((w)=>!h.has(w)&&w!=="props"&&b(w)),S=y.map((w)=>e[w]);if(!y.includes("__stxServeContext"))y.push("__stxServeContext"),S.push(void 0);let I=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","let","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","enum","await","async","module","exports","require","params","window","document","console","state","derived","effect"]),F=[],V=[];for(let[w,M]of Object.entries(p)){if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(w))continue;if(I.has(w))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${w}\\b`).test(f))continue;F.push(w),V.push(M)}let Me=Je(f).map((w)=>`module.exports.${w} = typeof ${w} !== 'undefined' ? ${w} : module.exports.${w};`).join(`
19
+ `),je=e.params??{},G=[],Z=[];for(let w=0;w<y.length;w++){if(y[w]==="params")continue;G.push(y[w]),Z.push(S[w])}let X=await Function(...fe,...F,...G,`return (async () => {
20
+ ${f}
21
+ ${Me}
22
+ return module.exports
23
+ })()`)(s,r,u,p,d,m,v,A,$,k,x,E,_,R,N,W,P,U,z,ge,ve,be,ye,xe,we,$e,Se,ke,g,_e,Ee,Ie,Ae,D,Ne,Re,Ce,Te,Pe,Oe,We,De,j.confirm,j.alert,j.fetch,je,...V,...Z);if(o.preserveExisting){for(let[w,M]of Object.entries(X))if(!(w in e)||e[w]===void 0)e[w]=M}else Object.assign(e,X);for(let[w,M]of Object.entries(p))if(!(w in e))e[w]=M}catch(f){let h=f instanceof Error?f.message:String(f);if(Ke(h))console.warn(`[stx] server <script> in ${t??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${h}`);else if(Qe(h))console.warn(`[stx] server <script> in ${t??"<unknown>"} names something that does not exist, so every variable in that script is undefined. Optional chaining does not help here: an undefined identifier throws before the chain is reached. Cause: ${h}`);else if(O.env.STX_DEBUG)console.warn(`[stx] server <script> did not execute in ${t??"<unknown>"} \u2014 falling back to static extraction. Cause: ${h}`);try{await at(i,e,t)}catch(b){if(O.env.STX_DEBUG){let y=b instanceof Error?b.message:String(b);console.warn(`[stx] fallback extraction also failed in ${t??"<unknown>"}: ${y}`)}}}}function Ye(n){let e=0,t=null,o=!1,i=!1;for(let s=0;s<n.length;s++){let r=n[s];if(t){if(r===t){if(t=null,o||e===0)i=!0}continue}if(r==="'"||r==='"'||r==="`"){t=r;continue}if(r==="{")e++;else if(r==="}")e--;else if(n.startsWith("from",s)&&e===0)o=!0}return t===null&&e===0&&i}var et=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function tt(n,e){let t=e?C.dirname(e):O.cwd(),o=O.cwd(),i=n.split(`
24
+ `),s=[],r=0;while(r<i.length){let a=i[r].trim();if(a.startsWith("interface ")||a.startsWith("export interface ")||a.startsWith("type ")||a.startsWith("export type ")){if(a.includes("{")&&!a.includes("}")){let c=0;for(;r<i.length;r++){for(let l of i[r])if(l==="{")c++;else if(l==="}")c--;if(c<=0)break}}r++;continue}if(a.startsWith("definePageMeta(")){let c=0,l=!1,u=r;for(let m=r;m<i.length&&!l;m++){let g=null,v=!1,$=i[m];for(let k=0;k<$.length;k++){let x=$[k];if(v){v=!1;continue}if(x==="\\"){v=!0;continue}if(g){if(x===g)g=null;continue}if(x==='"'||x==="'"||x==="`"){g=x;continue}if(x==="(")c++;else if(x===")"){if(c--,c===0){r=m+1,l=!0;break}}}}if(!l)r=i.length;let p=i.slice(u,r).join(`
25
+ `),d=[];for(let m of["title","description"]){let g=new RegExp(`\\b${m}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(p);if(g)d.push(`${m}: ${JSON.stringify(g[2])}`)}if(d.length>0)s.push(`useSeoMeta({ ${d.join(", ")} });`);continue}if(a.startsWith("import ")||a==="import"||a.startsWith("import{")){let c=a,l=0;while(!Ye(c)&&r+l+1<i.length)l++,c=`${c} ${i[r+l].trim()}`;r+=l;let u=c.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),p=c.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),d=c.match(/^import\s+['"](.+?)['"]/),m=c,g=(v)=>{if(v.startsWith("."))return C.resolve(t,v);if(v.startsWith("~/")||v.startsWith("@/"))return C.resolve(o,v.slice(2));return v};if(u){let[,v,$]=u,k=g($);s.push(`const ${v} = (await import('${k}')).default`),s.push(`module.exports.${v} = ${v};`)}else if(p){let[,v,$]=p,k=g($),x=[],E=[],_=Xe.has($);for(let R of v.split(",")){let N=R.trim();if(!N)continue;let A=N.split(/\s+as\s+/);if(A.length===2){let[W,P]=[A[0].trim(),A[1].trim()];if(_&&ne.has(W)){s.push(`const ${P} = ${W};`),E.push(P);continue}x.push(`${W}: ${P}`),E.push(P)}else{if(_&&ne.has(N)){E.push(N);continue}x.push(N),E.push(N)}}if(x.length>0)s.push(`const { ${x.join(", ")} } = await import('${k}')`);for(let R of E)s.push(`module.exports.${R} = ${R};`)}else if(d){let v=g(d[1]);s.push(`await import('${v}')`)}else s.push(m);r++;continue}if(et.test(a))s.push(i[r]),r++;else if(a.startsWith("export const ")||a.startsWith("export let ")||a.startsWith("export var ")){let c=se(i,r),{type:l,name:u,value:p}=c;s.push(`${l} ${u} = ${p};`),s.push(`module.exports.${u} = ${u};`),r=c.nextIndex}else if(a.startsWith("export function ")||a.startsWith("export async function ")){let c=q(i,r);s.push(c.functionCode),s.push(`module.exports.${c.name} = ${c.name};`),r=c.nextIndex}else if(a.startsWith("const ")||a.startsWith("let ")||a.startsWith("var ")){let c=se(i,r),{type:l,name:u,value:p}=c;s.push(`${l} ${u} = ${p};`),s.push(`module.exports.${u} = ${u};`),r=c.nextIndex}else if(a.startsWith("function ")||a.startsWith("async function ")){let c=q(i,r);s.push(c.functionCode),s.push(`module.exports.${c.name} = ${c.name};`),r=c.nextIndex}else if(a.startsWith("export default function ")||a.startsWith("export default async function ")){let c=i[r].replace(/^(\s*)export\s+default\s+/,"$1"),l=[...i];l[r]=c;let u=q(l,r);if(s.push(u.functionCode),u.name)s.push(`module.exports.default = ${u.name};`);r=u.nextIndex}else if(a.startsWith("export default ")){let c=a.replace(/^export\s+default\s+/,"").replace(/;$/,"");s.push(`module.exports.default = ${c};`),r++}else if(a.startsWith("class ")||a.startsWith("export class ")){let c=a.match(/(?:export\s+)?class\s+(\w+)/);if(c){let l=c[1],u=i[r].replace(/^export\s+/,""),p=0,d=r;for(;d<i.length;d++){let m=i[d];for(let g of m)if(g==="{")p++;else if(g==="}")p--;if(d>r)u+=`
26
+ `+m;if(p<=0&&d>=r)break}s.push(u),s.push(`module.exports.${l} = ${l};`),r=d+1}else s.push(a),r++}else if(a.includes("module.exports"))s.push(a),r++;else if(a.trim()&&!a.startsWith("//"))s.push(a),r++;else r++}return nt(s.join(`
27
+ `),t,o)}function nt(n,e,t){let o=n.length,i="",s=0,r=null,a=!1,c=!1,l=0;while(s<o){let u=n[s],p=n[s+1];if(a){if(i+=u,u===`
28
+ `)a=!1;s++;continue}if(c){if(i+=u,u==="*"&&p==="/"){i+=p,s+=2,c=!1;continue}s++;continue}if(!r&&u==="/"&&p==="/"){a=!0,i+=u,s++;continue}if(!r&&u==="/"&&p==="*"){c=!0,i+=u,s++;continue}if(r){if(i+=u,u==="\\"){i+=p,s+=2;continue}if(u===r&&r!=="`"){r=null,s++;continue}if(r==="`"){if(u==="$"&&p==="{"){l++,i+=p,s+=2;continue}if(u==="`"){r=null,s++;continue}}s++;continue}if(l>0){if(u==="{")l++;else if(u==="}")l--}if(u==='"'||u==="'"||u==="`"){r=u,i+=u,s++;continue}if(u==="a"&&n.startsWith("await",s)){let d=it(n,s);if(d){let{quote:m,path:g,end:v}=d;if(g.startsWith(".")||g.startsWith("~/")||g.startsWith("@/")){let $=g.startsWith(".")?C.resolve(e,g):C.resolve(t,g.slice(2));i+=`await import(${m}${$}${m})`,s=v;continue}}}i+=u,s++}return i}function it(n,e){let t=e+5;if(t>=n.length)return null;if(!/\s/.test(n[t]))return null;while(t<n.length&&/\s/.test(n[t]))t++;if(!n.startsWith("import",t))return null;t+=6;while(t<n.length&&/\s/.test(n[t]))t++;if(n[t]!=="(")return null;t++;while(t<n.length&&/\s/.test(n[t]))t++;let o=n[t];if(o!=="'"&&o!=='"')return null;t++;let i=t;while(t<n.length&&n[t]!==o)if(n[t]==="\\")t+=2;else t++;if(t>=n.length)return null;let s=n.slice(i,t);t++;while(t<n.length&&/\s/.test(n[t]))t++;if(n[t]!==")")return null;return{quote:o,path:s,end:t+1}}function he(n,e){let t=n[e];if(t!=="{"&&t!=="[")return null;let o=T(n,t,t==="{"?"}":"]",e);if(o===-1)return null;return{pattern:n.slice(e,o+1),endPos:o+1}}function pe(n){let e=[],t=n.slice(1,-1).trim();if(!t)return e;let o=0,i=0,s="";while(o<t.length){let r=t[o];if(r==="{"||r==="["){let a=i===0?he(t,o):null;if(a){e.push(...pe(a.pattern)),o=a.endPos,s="";continue}i++}else if(r==="}"||r==="]")i--;if(i>0){o++;continue}if(r===","){if(s.trim())e.push(s.trim());s="",o++;continue}if(r===":"){s="",o++;continue}if(r==="="){if(s.trim())e.push(s.trim());s="",o++;while(o<t.length&&t[o]!==","&&i===0){if(t[o]==="{"||t[o]==="[")i++;else if(t[o]==="}"||t[o]==="]")i--;o++}continue}if(/[\w$]/.test(r))s+=r;o++}if(s.trim())e.push(s.trim());return e}function st(n){let e=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec(n);if(!e)return null;let t=e[0].length,o=(i)=>i===" "||i==="\t";while(t<n.length&&o(n[t]))t++;if(n[t]===":"){let i=0,s=null;t++;for(;t<n.length;t++){let r=n[t];if(s){if(r==="\\"){t++;continue}if(r===s)s=null;continue}if(r==="'"||r==='"'||r==="`"){s=r;continue}if(r==="("||r==="["||r==="{"||r==="<"){i++;continue}if(r===")"||r==="]"||r==="}"||r===">"){i--;continue}if(r==="="&&i<=0){let a=n[t+1],c=n[t-1];if(a!=="="&&a!==">"&&c!=="="&&c!=="!"&&c!=="<"&&c!==">")break}}if(n[t]!=="=")return null}while(t<n.length&&o(n[t]))t++;if(n[t]!=="=")return null;return{type:e[1],name:e[2],value:n.slice(t+1).trim()}}function ie(n,e,t,o){let i=null,s=!1;for(let r of n){if(s){s=!1;continue}if(r==="\\"){s=!0;continue}if(i){if(r===i)i=null;continue}if(r==="'"||r==='"'||r==="`"){i=r;continue}if(r===e)o++;else if(r===t)o--}return o}function se(n,e){let t=n[e].trim(),o=st(t),i=o?[t,o.type,o.name,o.value]:null;if(!i){let u=t.match(/^(?:export\s+)?(const|let|var)\s+/);if(u){let p=t.slice(u[0].length),d=e;if(p.startsWith("{")||p.startsWith("[")){let g=p[0],v=g==="{"?"}":"]",$=ie(p,g,v,0),k=p;for(let x=e+1;x<n.length&&$>0;x++)k+=` ${n[x].trim()}`,d=x,$=ie(n[x],g,v,$);if($>0)k=p,d=e;p=k}let m=he(p,0);if(m){let g=u[1],v=m.pattern,$=p.slice(m.endPos).trim();if($.startsWith("=")){let k=$.slice(1).trim(),x=k,E=Math.max(d,e);if(re(k)){let A=oe(n,E,k);x=A.value,E=A.nextIndex}else E=E+1;x=x.trim().replace(/;$/,"");let _=pe(v),R=`__stx_src_${e}`,N=_.map((A)=>`module.exports.${A} = ${A};`).join(`
29
+ `);return{type:g,name:R,value:`${x}; ${g} ${v} = ${R};
30
+ ${N}`,nextIndex:E}}}}throw Error(`Failed to parse variable declaration: ${t}`)}let[,s,r,a]=i,c=a,l=e;if(re(a)){let u=oe(n,e,a);c=u.value,l=u.nextIndex}else l=e+1;while(l<n.length){let u=n[l].trim();if(u.startsWith(".")||u.startsWith("?."))c+=`
31
+ ${n[l]}`,l++;else break}return c=c.trim().replace(/;$/,""),{type:s,name:r,value:c,nextIndex:l}}function q(n,e){let t=n[e].trim(),o=t.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);if(!o)throw Error(`Failed to parse function declaration: ${t}`);let[,i]=o,s=t.replace(/^export\s+/,""),r=e;if(rt(t)){let a=ot(n,e,s);s=a.functionCode,r=a.nextIndex}else r=e+1;return{name:i,functionCode:s,nextIndex:r}}function re(n){let e=n.trim();if(e.startsWith("{"))return T(e,"{","}",0)===-1;if(e.startsWith("["))return T(e,"[","]",0)===-1;return!de(e)}function de(n){let e={paren:0,bracket:0,brace:0},t=null,o=0;for(let i=0;i<n.length;i++){let s=n[i];if((i>0?n[i-1]:"")==="\\"&&t)continue;if((s==='"'||s==="'")&&!t){t=s;continue}if(s===t&&t!=="`"){t=null;continue}if(s==="`"&&!t){t="`";continue}if(s==="`"&&t==="`"&&o===0){t=null;continue}if(t==="`"&&s==="$"&&n[i+1]==="{"){o++,i++;continue}if(o>0&&s==="{"){o++;continue}if(o>0&&s==="}"){o--;continue}if(t)continue;if(s==="(")e.paren++;else if(s===")")e.paren--;else if(s==="[")e.bracket++;else if(s==="]")e.bracket--;else if(s==="{")e.brace++;else if(s==="}")e.brace--}return e.paren===0&&e.bracket===0&&e.brace===0&&t===null}function me(n){let e=n.indexOf("(");if(e===-1)return n.indexOf("{");let t=T(n,"(",")",e);if(t===-1)return-1;return n.indexOf("{",t)}function rt(n){let e=me(n);if(e===-1)return!0;return T(n,"{","}",e)===-1}function oe(n,e,t){let o=t,i=e+1;while(i<n.length&&!de(o)){let s=n[i];o+=`
32
+ ${s}`,i++}while(i<n.length){let s=n[i].trim();if(s.startsWith(".")||s.startsWith("?."))o+=`
33
+ ${n[i]}`,i++;else break}return{value:o,nextIndex:i}}function ot(n,e,t){let o=t,i=e+1;while(i<n.length){let s=me(o);if(s!==-1){if(T(o,"{","}",s)!==-1)break}let r=n[i];o+=`
34
+ ${r}`,i++}return{functionCode:o,nextIndex:i}}function ae(n,e){let t=L(n,e)??L(`(${n})`,e);if(t!==void 0)return t;if(!/\bprocess\b/.test(n))return;let o={...e,process:Object.freeze({env:{...O.env}})};try{return Function(...Object.keys(o),`'use strict'; return (${n});`)(...Object.values(o))}catch{try{return Function(...Object.keys(o),`'use strict'; return ${n};`)(...Object.values(o))}catch{return}}}async function at(n,e,t){let o=n.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let s of o){let[,,r,a]=s;try{let c=a.trim().replace(/;$/,""),l=ae(c,e);if(l!==void 0)e[r]=l}catch(c){console.warn(`Failed to parse export ${r} in fallback:`,c)}}let i=n.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let s of i){let[,,r,a]=s;if(!(r in e))try{let c=a.trim().replace(/;$/,""),l=ae(c,e);if(l!==void 0)e[r]=l}catch{}}}function $t(n){let e=n.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),t=e?e[1]:"",o=e?n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):n;return{scriptContent:t,templateWithoutScript:o}}function St(n){let e=n.trim();if(!e)return!1;return/(?:const|let|var|function)\s+\w+/.test(e)}
35
+ export{Y as kn,L as ln,ft as mn,ht as nn,Ze as on,pt as pn,Fe as qn,T as rn,ct as sn,lt as tn,fe as un,He as vn,Ke as wn,Qe as xn,wt as yn,Ye as zn,tt as An,st as Bn,$t as Cn,St as Dn};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{V as a}from"./chunk-a547f2ab.js";import"./chunk-6s1kbajm.js";import"./chunk-m249t3je.js";import"./chunk-tpfgntwj.js";import"./chunk-jff6j9y3.js";import"./chunk-csfrpsp7.js";import"./chunk-0t5vz87j.js";import"./chunk-krkchy8v.js";import"./chunk-brpgjyqg.js";import"./chunk-5mxby3fd.js";import"./chunk-5be9x5cq.js";import"./chunk-jmeb7n8k.js";import"./chunk-kc659vhx.js";import"./chunk-a3wahyg7.js";export{a as buildForProduction};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Gp as a,Hp as b}from"./chunk-kc659vhx.js";import"./chunk-a3wahyg7.js";export{b as warnUnbalancedTags,a as findUnbalancedTags};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{lu as a,mu as b,nu as c,ou as d,pu as e,qu as f,ru as g,su as h,tu as i}from"./chunk-hz6fc788.js";import"./chunk-5n0ckcmc.js";import"./chunk-a3wahyg7.js";export{c as setCachedImageResult,e as processImage,f as optimizeImage,b as getCachedImageResult,i as generateSrcset,h as generateResponsiveVariants,d as clearImageCache,g as applyTransformations,a as ImageProcessorCache};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ds as a,es as b,fs as c,gs as d,hs as e,is as f,js as g,ks as h,ls as i,ms as j,ns as k,os as l,ps as m,qs as n,rs as o,ss as p,ts as q}from"./chunk-90eze7av.js";import"./chunk-jy2jhcpy.js";import"./chunk-a3wahyg7.js";export{h as resizeAndConvert,f as processImage,d as isSharpAvailable,m as isImageFile,e as isImageBackendAvailable,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,g as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,p as formatSize,q as ImageProcessingError,a as DEFAULT_WIDTHS,c as DEFAULT_QUALITY,b as DEFAULT_FORMATS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ao as z,Bo as A,Co as B,Do as C,Eo as D,Fo as E,Go as F,Ho as G,Io as H,Jo as I,Ko as J,Lo as K,bo as a,co as b,do as c,eo as d,fo as e,go as f,ho as g,io as h,jo as i,ko as j,lo as k,mo as l,no as m,oo as n,po as o,qo as p,ro as q,so as r,to as s,uo as t,vo as u,wo as v,xo as w,yo as x,zo as y}from"./chunk-5mxby3fd.js";import"./chunk-a3wahyg7.js";export{o as setAppUrl,H as runMiddleware,r as route,j as resolveLayoutChain,s as resetRoutes,z as registerMiddleware,g as patternToRegex,t as navigateTo,h as matchRoute,E as loadMiddlewareFromDirectory,c as isNonPageRoutePattern,b as isNonPageRoutePath,B as hasMiddleware,K as getRouterScript,D as getMiddlewareNames,A as getMiddleware,d as generateRouteTypes,e as generateRouteManifest,n as formatRoutes,m as findErrorPage,f as filePathToPattern,J as extractLayoutMetadata,I as deriveLayoutGroup,q as defineRoutes,p as defineRoute,v as defineMiddleware,y as createStorageManager,w as createServerCookieManager,l as createRouter,F as createRouteLocation,G as createMiddlewareContext,x as createClientCookieManager,C as clearMiddleware,i as bracketPathToRegex,u as abortNavigation,k as Router,a as NON_PAGE_DIRS};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import r from"process";function c(i="STX_PUBLIC_"){let t={},n={};for(let[e,o]of Object.entries(r.env)){if(!e.startsWith(i)||o===void 0)continue;t[`import.meta.env.${e}`]=JSON.stringify(o),n[e]=o}return t["import.meta.env"]=JSON.stringify(n),t}function f(i="STX_PUBLIC_"){let t={};for(let[n,e]of Object.entries(r.env))if(n.startsWith(i)&&e!==void 0)t[n]=e;return t}
3
+ export{c as Mo,f as No};