@stacksjs/stx 0.2.332 → 0.2.333

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 (163) hide show
  1. package/dist/builtins/image-worker.d.ts +17 -0
  2. package/dist/builtins/image-worker.js +12 -1
  3. package/dist/caching.d.ts +17 -0
  4. package/dist/caching.js +24 -0
  5. package/dist/chunk-046dp691.js +2 -0
  6. package/dist/{chunk-kx30cykj.js → chunk-08w4gtyf.js} +3 -3
  7. package/dist/{chunk-be5es9s3.js → chunk-09jdvqhg.js} +2 -2
  8. package/dist/{chunk-7ds14xsn.js → chunk-0vv5s039.js} +1 -1
  9. package/dist/chunk-1brnvyhv.js +2 -0
  10. package/dist/{chunk-3n9rvrk1.js → chunk-1ebyt1ba.js} +1 -1
  11. package/dist/{chunk-wx3kf6tm.js → chunk-1hzgxk2m.js} +1 -1
  12. package/dist/chunk-1jzdpvvx.js +2 -0
  13. package/dist/{chunk-mnsaf11z.js → chunk-1tva0f8f.js} +1 -1
  14. package/dist/{chunk-bsa8pxtc.js → chunk-24b4711v.js} +1 -1
  15. package/dist/{chunk-wv9v9mj9.js → chunk-27xfkzks.js} +1 -1
  16. package/dist/{chunk-mywrt0dp.js → chunk-2cm03y4y.js} +1 -1
  17. package/dist/{chunk-tp6wkx7g.js → chunk-2tjk867y.js} +1 -1
  18. package/dist/{chunk-am42axf7.js → chunk-2vgkc0kg.js} +1 -1
  19. package/dist/{chunk-w4ckece4.js → chunk-2ye35vms.js} +10 -10
  20. package/dist/{chunk-ys8sm556.js → chunk-3ntf8f5e.js} +1 -1
  21. package/dist/{chunk-33rznhw1.js → chunk-42en0cxm.js} +1 -1
  22. package/dist/{chunk-09zjty4k.js → chunk-4jdj52c5.js} +1 -1
  23. package/dist/{chunk-424e1tyj.js → chunk-4k0ce745.js} +1 -1
  24. package/dist/chunk-4tnxnzja.js +2 -0
  25. package/dist/{chunk-peqad61h.js → chunk-4ty8j3xn.js} +1 -1
  26. package/dist/{chunk-gwrrs1qh.js → chunk-5swem3qy.js} +1 -1
  27. package/dist/chunk-63yfp05p.js +2 -0
  28. package/dist/{chunk-afsy9158.js → chunk-67bh5vrj.js} +1 -1
  29. package/dist/{chunk-kptkb3j4.js → chunk-6k8h1fj1.js} +1 -1
  30. package/dist/{chunk-289vztwy.js → chunk-71y3bhcw.js} +1 -1
  31. package/dist/{chunk-yjkaqxtc.js → chunk-7r80apc5.js} +1 -1
  32. package/dist/chunk-7y4eqkv4.js +2 -0
  33. package/dist/chunk-7ywnkv1f.js +2 -0
  34. package/dist/{chunk-77sa9wz4.js → chunk-80zj5516.js} +1 -1
  35. package/dist/chunk-8730k51r.js +2 -0
  36. package/dist/chunk-907qxn09.js +2 -0
  37. package/dist/{chunk-mv6dw7dn.js → chunk-9fcq5x2r.js} +1 -1
  38. package/dist/{chunk-2jfneptq.js → chunk-9kxfz708.js} +1 -1
  39. package/dist/{chunk-97yd8erh.js → chunk-9v0fsdsf.js} +1 -1
  40. package/dist/chunk-a97tp43x.js +2 -0
  41. package/dist/{chunk-1czvb2wx.js → chunk-amxtypkp.js} +1 -1
  42. package/dist/chunk-atw841yx.js +2 -0
  43. package/dist/chunk-c1c2a5es.js +2 -0
  44. package/dist/{chunk-70nkn5te.js → chunk-c1m1gng4.js} +1 -1
  45. package/dist/chunk-c2ta859c.js +3 -0
  46. package/dist/{chunk-cqp01pgs.js → chunk-caaenc3w.js} +2 -2
  47. package/dist/{chunk-kcn1ay55.js → chunk-cdqx2c2h.js} +1 -1
  48. package/dist/{chunk-pcvayb2f.js → chunk-cdsbxghb.js} +1 -1
  49. package/dist/{chunk-mbaew5a8.js → chunk-cmtjq1db.js} +2 -2
  50. package/dist/{chunk-7kfp7jde.js → chunk-crj19mqr.js} +1 -1
  51. package/dist/chunk-cvphepjb.js +2 -0
  52. package/dist/{chunk-xgj1jw4p.js → chunk-d4etph79.js} +1 -1
  53. package/dist/{chunk-tjhzxbxa.js → chunk-deqnt1w5.js} +1 -1
  54. package/dist/{chunk-meqcxfpr.js → chunk-dfejgnny.js} +1 -1
  55. package/dist/chunk-dnesmvvb.js +2 -0
  56. package/dist/{chunk-qcf4506g.js → chunk-drqdc0mh.js} +1 -1
  57. package/dist/{chunk-g5e5kja6.js → chunk-e1sxe3q4.js} +2 -2
  58. package/dist/{chunk-6t9xcjag.js → chunk-ef0ra05n.js} +1 -1
  59. package/dist/{chunk-dwjcmxez.js → chunk-eth22r93.js} +1 -1
  60. package/dist/chunk-ewsx2qxm.js +2 -0
  61. package/dist/{chunk-sj3k3jwt.js → chunk-farwrdr2.js} +1 -1
  62. package/dist/chunk-fcenm8n1.js +2 -0
  63. package/dist/chunk-fkdnfjc2.js +3 -0
  64. package/dist/chunk-gbz6pfs8.js +2 -0
  65. package/dist/chunk-gd2d52kn.js +2 -0
  66. package/dist/{chunk-2h6pmz31.js → chunk-gdbkqatx.js} +1 -1
  67. package/dist/{chunk-gne68nyp.js → chunk-gptwwv3c.js} +1 -1
  68. package/dist/{chunk-5ep11kvc.js → chunk-hyfjnn7g.js} +1 -1
  69. package/dist/{chunk-2jzntvfr.js → chunk-hzfd8cz0.js} +13 -2
  70. package/dist/{chunk-zyb5gfr0.js → chunk-j2dj21ay.js} +1 -1
  71. package/dist/chunk-jnahcd4d.js +2 -0
  72. package/dist/{chunk-kbv4km5j.js → chunk-k6ky5et7.js} +1 -1
  73. package/dist/{chunk-4zwjqcw4.js → chunk-kffndzch.js} +3 -3
  74. package/dist/{chunk-n2y2941z.js → chunk-kk7p8ekz.js} +1 -1
  75. package/dist/{chunk-dfymexrx.js → chunk-kpeqn5tx.js} +1 -1
  76. package/dist/{chunk-2t8jekek.js → chunk-krpkfndf.js} +1 -1
  77. package/dist/{chunk-m3a20mmb.js → chunk-kw98dfza.js} +1 -1
  78. package/dist/{chunk-r6g1n649.js → chunk-kxtqbrfr.js} +22 -22
  79. package/dist/chunk-m1yrakpk.js +2 -0
  80. package/dist/{chunk-mkk731dy.js → chunk-m8kezfrt.js} +1 -1
  81. package/dist/{chunk-z6xtb8fj.js → chunk-mm59b0gg.js} +1 -1
  82. package/dist/{chunk-7ymv9pd6.js → chunk-n66k2v2q.js} +2 -2
  83. package/dist/chunk-n9c975db.js +2 -0
  84. package/dist/{chunk-fc1g65e0.js → chunk-nat3actx.js} +1 -1
  85. package/dist/{chunk-kxtfmwy0.js → chunk-p1hy2bwn.js} +3 -3
  86. package/dist/{chunk-tz7t6ybm.js → chunk-pbexz0d4.js} +2 -2
  87. package/dist/{chunk-ms2kjpdt.js → chunk-pbzdjhp8.js} +1 -1
  88. package/dist/{chunk-d9ajsetq.js → chunk-q05eh1n4.js} +1 -1
  89. package/dist/{chunk-3wvdm033.js → chunk-q0g5c39d.js} +1 -1
  90. package/dist/chunk-q2hvne0v.js +2 -0
  91. package/dist/{chunk-cvedh4a7.js → chunk-q4p1h741.js} +1 -1
  92. package/dist/{chunk-qnx0eb8x.js → chunk-q569zmrr.js} +1 -1
  93. package/dist/{chunk-0w8t922h.js → chunk-q85qp5we.js} +1 -1
  94. package/dist/chunk-qpbk50xd.js +2 -0
  95. package/dist/{chunk-bsm13y1j.js → chunk-r8rbf28v.js} +1 -1
  96. package/dist/chunk-rxdd3k6n.js +2 -0
  97. package/dist/chunk-ssd10kje.js +2 -0
  98. package/dist/chunk-szx6pxh3.js +2 -0
  99. package/dist/{chunk-557n2zx7.js → chunk-t8ctvjqe.js} +1 -1
  100. package/dist/{chunk-wbtamqdk.js → chunk-te6qym2g.js} +2 -2
  101. package/dist/{chunk-xzkc36wt.js → chunk-tjag2cmm.js} +1 -1
  102. package/dist/{chunk-fw4nxafz.js → chunk-tpmgq2dx.js} +1 -1
  103. package/dist/chunk-tte4m2s9.js +2 -0
  104. package/dist/chunk-v0v1pxwh.js +2 -0
  105. package/dist/chunk-vv289x82.js +2 -0
  106. package/dist/{chunk-7080py5f.js → chunk-vvd659y4.js} +1 -1
  107. package/dist/chunk-vx6mxybh.js +2 -0
  108. package/dist/{chunk-3cba0xw5.js → chunk-wx5zf66r.js} +1 -1
  109. package/dist/chunk-x510wr8z.js +2 -0
  110. package/dist/{chunk-xt7bsyj7.js → chunk-x7yc7e9v.js} +1 -1
  111. package/dist/chunk-x95sxapm.js +2 -0
  112. package/dist/{chunk-rkna71t2.js → chunk-xdmb578h.js} +1 -1
  113. package/dist/chunk-y1x2ebhv.js +2 -0
  114. package/dist/{chunk-jwkmc175.js → chunk-yk6446kr.js} +1 -1
  115. package/dist/{chunk-0tyw6va3.js → chunk-ymrxpwr8.js} +1 -1
  116. package/dist/{chunk-g3cyygvf.js → chunk-yxppshfd.js} +1 -1
  117. package/dist/chunk-yzxm75jp.js +2 -0
  118. package/dist/{chunk-33az7v0k.js → chunk-zsnrcbw1.js} +2 -2
  119. package/dist/{chunk-qjh40e31.js → chunk-zz8qgqa1.js} +2 -2
  120. package/dist/cli.js +14 -14
  121. package/dist/craft-entry.js +1 -1
  122. package/dist/craft.js +1 -1
  123. package/dist/database.js +1 -1
  124. package/dist/pwa.js +2 -2
  125. package/dist/ssg.js +2 -2
  126. package/dist/visual-testing.js +1 -1
  127. package/package.json +5 -5
  128. package/dist/chunk-0ck064qf.js +0 -2
  129. package/dist/chunk-1f43h46q.js +0 -2
  130. package/dist/chunk-20e4pcq1.js +0 -2
  131. package/dist/chunk-2evvkp6k.js +0 -2
  132. package/dist/chunk-2gfjp8q1.js +0 -2
  133. package/dist/chunk-41fhbhbn.js +0 -2
  134. package/dist/chunk-476dmgkd.js +0 -2
  135. package/dist/chunk-73sq0e73.js +0 -2
  136. package/dist/chunk-793gxvjv.js +0 -2
  137. package/dist/chunk-7f16ymjn.js +0 -2
  138. package/dist/chunk-85e05tzn.js +0 -2
  139. package/dist/chunk-94c8we2y.js +0 -2
  140. package/dist/chunk-axe4hgv2.js +0 -2
  141. package/dist/chunk-b9jknz2y.js +0 -2
  142. package/dist/chunk-c2mvx2m8.js +0 -3
  143. package/dist/chunk-cn74d92v.js +0 -2
  144. package/dist/chunk-d9gk60kk.js +0 -2
  145. package/dist/chunk-epm72mma.js +0 -2
  146. package/dist/chunk-gcjr4mwg.js +0 -2
  147. package/dist/chunk-h3w1y4q7.js +0 -2
  148. package/dist/chunk-htsetvt7.js +0 -2
  149. package/dist/chunk-j762mz1x.js +0 -2
  150. package/dist/chunk-jhhp2d7n.js +0 -2
  151. package/dist/chunk-k14sz6cz.js +0 -2
  152. package/dist/chunk-kgxbad5v.js +0 -2
  153. package/dist/chunk-m3ya2dvf.js +0 -3
  154. package/dist/chunk-nxbje85a.js +0 -2
  155. package/dist/chunk-rsp59c5x.js +0 -2
  156. package/dist/chunk-tbsgchrd.js +0 -2
  157. package/dist/chunk-v82r1j02.js +0 -2
  158. package/dist/chunk-x3evfp7c.js +0 -2
  159. package/dist/chunk-x7qbgqps.js +0 -2
  160. package/dist/chunk-xgeps3fn.js +0 -2
  161. package/dist/chunk-zgnk8tpp.js +0 -2
  162. package/dist/chunk-zhtttwz2.js +0 -2
  163. package/dist/chunk-znn3ngey.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{As as F9,Pr as Q0,Rr as L9,Sr as H3,Tr as O9,Vs as M8,Zs as I8,_r as E2,bs as N8,ds as G0,hs as b2,ht as D7,is as D8,it as A7,ks as r0,ls as A8,ss as j3,ts as a4,us as Z0,vs as B0,ws as b0,xs as V9,ys as J2,zs as H0}from"./chunk-cqp01pgs.js";import{nt as g0,ot as VZ}from"./chunk-fc1g65e0.js";import{tt as s2}from"./chunk-3wvdm033.js";import{At as E8,Bt as E1,Dt as H1,Et as QZ,Ft as GZ,Gt as Q2,Ht as l2,It as _9,Jt as T2,Kt as U8,Lt as t6,Mt as B1,Nt as n0,Ot as l9,St as b8,Tt as C9,eu as y8,yt as n1,zt as f1}from"./chunk-4zwjqcw4.js";import{gu as G4,hu as z4,iu as q4,lu as W4,mu as U4}from"./chunk-c2mvx2m8.js";import{su as T7,tu as E7,uu as e2,vu as $9}from"./chunk-bsm13y1j.js";import{Au as k7,Cu as j2,xu as M7,zu as I7}from"./chunk-gne68nyp.js";import{Du as S9}from"./chunk-7ymv9pd6.js";import{Fu as l8,Gu as c8,Hu as p8,Iu as i8,Ju as n8,Lu as T8}from"./chunk-7080py5f.js";import{Mu as C8,Qu as r2,Su as s8}from"./chunk-yjkaqxtc.js";import{av as Z1}from"./chunk-tp6wkx7g.js";import{dv as S8}from"./chunk-557n2zx7.js";import{ev as B3,fv as jZ,gv as YZ,hv as i1,lv as BZ,mv as t$,nv as a6,pv as b4,sv as g4}from"./chunk-tjhzxbxa.js";import{Dv as M$,Gv as v6,Nv as H$,cw as k8,ew as hG,fw as $5,hw as K2}from"./chunk-2jzntvfr.js";import{mw as b7}from"./chunk-qnx0eb8x.js";import{rw as f}from"./chunk-5ep11kvc.js";import y1 from"path";import C2 from"fs";var o$=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),r$={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},NZ=new Set(["ctrl","alt","shift","meta"]),e$={left:0,middle:1,right:2};function a$($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let J of $){let X=J.toLowerCase();if(X==="prevent")Z.prevent=!0;else if(X==="stop")Z.stop=!0;else if(X==="once")Z.once=!0;else if(X==="capture")Z.capture=!0;else if(X==="self")Z.self=!0;else if(X==="passive")Z.passive=!0;else if(NZ.has(X))Z.systemKeys.push(X);else if(X in e$)Z.mouse=X;else if(X in r$||/^[a-z]$/.test(X))Z.keys.push(r$[X]||X.toUpperCase());else if(X.startsWith("debounce")){let Q=X.match(/debounce(?:\.(\d+))?/);Z.debounce=Q?.[1]?Number.parseInt(Q[1],10):300}else if(X.startsWith("throttle")){let Q=X.match(/throttle(?:\.(\d+))?/);Z.throttle=Q?.[1]?Number.parseInt(Q[1],10):300}}return Z}function $3($){let Z=[],J=0,X=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Q;while((Q=X.exec($))!==null){let[Y,G,z]=Q,q=Q.index,K=q+Y.length,W=`__stx_evt_${J++}`,U=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(z))!==null){let[,V,F]=j,L=V.split("."),O=L[0];if(!o$.has(O))continue;U.push({attribute:`@${V}`,event:O,handler:F,modifiers:a$(L.slice(1)),elementId:W})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(z))!==null){let[,V,F]=j,L=V.split("."),O=L[0];if(!o$.has(O))continue;U.push({attribute:`@${V}`,event:O,handler:F,modifiers:a$(L.slice(1)),elementId:W})}if(U.length>0)Z.push({originalTag:Y,elementId:W,events:U,startIndex:q,endIndex:K})}return Z}function DZ($){let Z=[],{modifiers:J}=$;if(J.self)Z.push("if ($event.target !== $el) return");for(let X of J.systemKeys)Z.push(`if (!$event.${X}Key) return`);if(J.keys.length>0){let X=J.keys.map((Q)=>`$event.key === '${Q}'`).join(" || ");Z.push(`if (!(${X})) return`)}if(J.mouse!==null){let X=e$[J.mouse];Z.push(`if ($event.button !== ${X}) return`)}if(J.prevent)Z.push("$event.preventDefault()");if(J.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function AZ($,Z){let J=$;if(Z.debounce!==null)J=`__stx_debounce(() => { ${J} }, ${Z.debounce})`;else if(Z.throttle!==null)J=`__stx_throttle(() => { ${J} }, ${Z.throttle})`;return J}function h9($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function MZ($){let{modifiers:Z}=$,J=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),X=DZ($),Q=AZ(h9($.handler),Z),Y=[];if(Z.once)Y.push("once: true");if(Z.capture)Y.push("capture: true");if(Z.passive)Y.push("passive: true");let G=Y.length>0?`, { ${Y.join(", ")} }`:"",z=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
2
+ import{$r as E2,As as H0,Bs as F9,Qr as Q0,Sr as L9,Tr as H3,Ur as O9,Ws as M8,_s as I8,cs as N8,es as G0,is as b2,it as D7,js as D8,jt as A7,ls as r0,ms as A8,ts as j3,us as a4,vs as Z0,ws as B0,xs as b0,ys as V9,zs as J2}from"./chunk-caaenc3w.js";import{ot as g0,pt as VZ}from"./chunk-nat3actx.js";import{ut as s2}from"./chunk-q0g5c39d.js";import{At as f1,Bt as E8,Ct as E1,Et as H1,Ft as QZ,Gt as GZ,Ht as Q2,It as l2,Jt as _9,Kt as T2,Lt as U8,Mt as t6,Nt as B1,Ot as n0,Pt as l9,Tt as b8,Ut as C9,fu as y8,zt as n1}from"./chunk-kffndzch.js";import{hu as G4,iu as z4,ju as q4,mu as W4,nu as U4}from"./chunk-c2ta859c.js";import{tu as T7,uu as E7,vu as e2,wu as $9}from"./chunk-r8rbf28v.js";import{Au as I7,Bu as k7,Du as j2,yu as M7}from"./chunk-gptwwv3c.js";import{Eu as S9}from"./chunk-n66k2v2q.js";import{Gu as l8,Hu as c8,Iu as p8,Ju as i8,Ku as n8,Mu as T8}from"./chunk-vvd659y4.js";import{Nu as C8,Ru as r2,Tu as s8}from"./chunk-7r80apc5.js";import{bv as Z1}from"./chunk-2tjk867y.js";import{ev as S8}from"./chunk-t8ctvjqe.js";import{fv as B3,gv as jZ,hv as YZ,iv as i1,mv as BZ,nv as t$,ov as a6,qv as b4,tv as g4}from"./chunk-deqnt1w5.js";import{Ev as M$,Hv as v6,Ov as H$,dw as k8,fw as hG,gw as $5,iw as K2}from"./chunk-hzfd8cz0.js";import{nw as b7}from"./chunk-q569zmrr.js";import{sw as f}from"./chunk-hyfjnn7g.js";import y1 from"path";import C2 from"fs";var o$=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),r$={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},NZ=new Set(["ctrl","alt","shift","meta"]),e$={left:0,middle:1,right:2};function a$($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let J of $){let X=J.toLowerCase();if(X==="prevent")Z.prevent=!0;else if(X==="stop")Z.stop=!0;else if(X==="once")Z.once=!0;else if(X==="capture")Z.capture=!0;else if(X==="self")Z.self=!0;else if(X==="passive")Z.passive=!0;else if(NZ.has(X))Z.systemKeys.push(X);else if(X in e$)Z.mouse=X;else if(X in r$||/^[a-z]$/.test(X))Z.keys.push(r$[X]||X.toUpperCase());else if(X.startsWith("debounce")){let Q=X.match(/debounce(?:\.(\d+))?/);Z.debounce=Q?.[1]?Number.parseInt(Q[1],10):300}else if(X.startsWith("throttle")){let Q=X.match(/throttle(?:\.(\d+))?/);Z.throttle=Q?.[1]?Number.parseInt(Q[1],10):300}}return Z}function $3($){let Z=[],J=0,X=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Q;while((Q=X.exec($))!==null){let[Y,G,z]=Q,q=Q.index,K=q+Y.length,W=`__stx_evt_${J++}`,U=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(z))!==null){let[,V,F]=j,L=V.split("."),O=L[0];if(!o$.has(O))continue;U.push({attribute:`@${V}`,event:O,handler:F,modifiers:a$(L.slice(1)),elementId:W})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(z))!==null){let[,V,F]=j,L=V.split("."),O=L[0];if(!o$.has(O))continue;U.push({attribute:`@${V}`,event:O,handler:F,modifiers:a$(L.slice(1)),elementId:W})}if(U.length>0)Z.push({originalTag:Y,elementId:W,events:U,startIndex:q,endIndex:K})}return Z}function DZ($){let Z=[],{modifiers:J}=$;if(J.self)Z.push("if ($event.target !== $el) return");for(let X of J.systemKeys)Z.push(`if (!$event.${X}Key) return`);if(J.keys.length>0){let X=J.keys.map((Q)=>`$event.key === '${Q}'`).join(" || ");Z.push(`if (!(${X})) return`)}if(J.mouse!==null){let X=e$[J.mouse];Z.push(`if ($event.button !== ${X}) return`)}if(J.prevent)Z.push("$event.preventDefault()");if(J.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function AZ($,Z){let J=$;if(Z.debounce!==null)J=`__stx_debounce(() => { ${J} }, ${Z.debounce})`;else if(Z.throttle!==null)J=`__stx_throttle(() => { ${J} }, ${Z.throttle})`;return J}function h9($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function MZ($){let{modifiers:Z}=$,J=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),X=DZ($),Q=AZ(h9($.handler),Z),Y=[];if(Z.once)Y.push("once: true");if(Z.capture)Y.push("capture: true");if(Z.passive)Y.push("passive: true");let G=Y.length>0?`, { ${Y.join(", ")} }`:"",z=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${J}');
5
5
  if (!$el) return;
@@ -1749,7 +1749,7 @@ ${V}
1749
1749
  #${$}.stx-img-loaded img {
1750
1750
  opacity: 1;
1751
1751
  }
1752
- `.trim()}function kK($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var P1=new Map;async function e3($,Z={}){let J=`${$}:${JSON.stringify(Z)}`;if(P1.has(J))return P1.get(J);let X=await r3($,Z);return P1.set(J,X),X}function TK(){P1.clear()}function EK(){return{size:P1.size,keys:Array.from(P1.keys())}}async function SJ(){try{return await import("./chunk-xzkc36wt.js")}catch($){if(!$7)console.warn("[stx-media] Image processor not available, some features disabled:",$),$7=!0;return null}}var $7=!1,G5=80,i2="async",n2="lazy",Z7=!1;async function H2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipOptimization){if(J.tsImagesConfig?.enabled&&!J.isDev)return gJ(X,J)}if(J.processedResult?.processed)return K5($,J.processedResult,Z);if(J.responsiveVariants)return Y7($,J.responsiveVariants,Z);let{src:Q,alt:Y,width:G,height:z,sizes:q,widths:K=_1,dpr:W,formats:U=S1,quality:H=G5,params:j={},placeholder:B="none",placeholderOptions:V={},lazy:F=!0,priority:L=!1,loading:O=L?"eager":n2,decoding:_=i2,fetchpriority:w,objectFit:R,objectPosition:N,crossorigin:A,referrerpolicy:k}=$,D=$.class,I=$.style,T=$.id,M=$.data||{},{isDev:E=!1,baseUrl:C=""}=Z;if(E&&!Z.optimize)return fJ($);let y,b,P=T||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(B!=="none"&&!L)try{y=await e3(Q,{strategy:B,...V}),b=t3(P,y,V)}catch{}let g=W!==void 0&&G!==void 0,c;if(g)c=vJ($,P,y,Z);else c=await PJ($,P,y,Z);let l;if(L){let u=U.includes("webp")?"webp":U[0],z0=U2(Q,K,{...j,q:H},u),d0=typeof q==="object"?J5(q):q||"100vw";l=`<link rel="preload" as="image" imagesrcset="${z0}" imagesizes="${d0}" />`}let h=[];if(!Z7&&B!=="none")h.push(Y5),Z7=!0;if(b)h.push(b);let s=F?X7(P):void 0;return{html:c,preloadLink:l,css:h.length>0?h.join(`
1752
+ `.trim()}function kK($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var P1=new Map;async function e3($,Z={}){let J=`${$}:${JSON.stringify(Z)}`;if(P1.has(J))return P1.get(J);let X=await r3($,Z);return P1.set(J,X),X}function TK(){P1.clear()}function EK(){return{size:P1.size,keys:Array.from(P1.keys())}}async function SJ(){try{return await import("./chunk-tjag2cmm.js")}catch($){if(!$7)console.warn("[stx-media] Image processor not available, some features disabled:",$),$7=!0;return null}}var $7=!1,G5=80,i2="async",n2="lazy",Z7=!1;async function H2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipOptimization){if(J.tsImagesConfig?.enabled&&!J.isDev)return gJ(X,J)}if(J.processedResult?.processed)return K5($,J.processedResult,Z);if(J.responsiveVariants)return Y7($,J.responsiveVariants,Z);let{src:Q,alt:Y,width:G,height:z,sizes:q,widths:K=_1,dpr:W,formats:U=S1,quality:H=G5,params:j={},placeholder:B="none",placeholderOptions:V={},lazy:F=!0,priority:L=!1,loading:O=L?"eager":n2,decoding:_=i2,fetchpriority:w,objectFit:R,objectPosition:N,crossorigin:A,referrerpolicy:k}=$,D=$.class,I=$.style,T=$.id,M=$.data||{},{isDev:E=!1,baseUrl:C=""}=Z;if(E&&!Z.optimize)return fJ($);let y,b,P=T||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(B!=="none"&&!L)try{y=await e3(Q,{strategy:B,...V}),b=t3(P,y,V)}catch{}let g=W!==void 0&&G!==void 0,c;if(g)c=vJ($,P,y,Z);else c=await PJ($,P,y,Z);let l;if(L){let u=U.includes("webp")?"webp":U[0],z0=U2(Q,K,{...j,q:H},u),d0=typeof q==="object"?J5(q):q||"100vw";l=`<link rel="preload" as="image" imagesrcset="${z0}" imagesizes="${d0}" />`}let h=[];if(!Z7&&B!=="none")h.push(Y5),Z7=!0;if(b)h.push(b);let s=F?X7(P):void 0;return{html:c,preloadLink:l,css:h.length>0?h.join(`
1753
1753
  `):void 0,script:s}}async function PJ($,Z,J,X){let{src:Q,alt:Y,width:G,height:z,sizes:q,widths:K=_1,formats:W=S1,quality:U=G5,params:H={},lazy:j=!0,priority:B=!1,loading:V=B?"eager":n2,decoding:F=i2,fetchpriority:L,objectFit:O,objectPosition:_,crossorigin:w,referrerpolicy:R}=$,N=$.class,A=$.style,k=$.data||{},D=typeof q==="object"?J5(q):q||"100vw",I=[];for(let E of W){let C=U2(Q,K,{...H,q:U},E),y=X5(E);if(j&&!B)I.push(` <source type="${y}" data-srcset="${C}" data-sizes="${D}" />`);else I.push(` <source type="${y}" srcset="${C}" sizes="${D}" />`)}let T=z5({src:G1(Q,{...H,q:U}),alt:Y,width:G,height:z,loading:B?void 0:V,decoding:F,fetchpriority:B?"high":L,objectFit:O,objectPosition:_,crossorigin:w,referrerpolicy:R,className:J7(N,J),style:q5(A,O,_,J),lazy:j&&!B,data:k}),M;if(J){let E=`background-image: url('${J.dataURL}'); background-size: cover; background-position: center;`;M=`<div id="${Z}" class="stx-img-placeholder" style="${E}">
1754
1754
  <picture>
1755
1755
  ${I.join(`
@@ -1813,7 +1813,7 @@ ${R.join(`
1813
1813
  `):void 0,script:C}}async function Y7($,Z,J){let X={src:Z.src,processed:!0,variants:[],placeholder:Z.placeholder?.dataURL,originalWidth:Z.placeholder?.width,originalHeight:Z.placeholder?.height};for(let[Q,Y]of Object.entries(Z.byFormat))if(Y)X.variants.push(...Y);return K5($,X,J)}function hJ(){return s2({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async($,Z,J,X)=>{let{src:Q,alt:Y,options:G}=uJ($,Z,J);if(!Q)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let z={src:Q,alt:Y||"",widths:G.widths||_1,formats:G.formats||S1,quality:G.quality,sizes:G.sizes,dpr:G.dpr,params:G.params,placeholder:G.placeholder,placeholderOptions:G.placeholderOptions,lazy:G.lazy!==!1,priority:G.priority||!1,loading:G.loading,decoding:G.decoding,fetchpriority:G.fetchpriority,objectFit:G.objectFit,objectPosition:G.objectPosition,class:G.class,style:G.style,id:G.id,width:G.width,height:G.height},q=J.__isDev||!1,K=await H2(z,{isDev:q}),W=K.html;if(K.preloadLink)W=K.preloadLink+`
1814
1814
  `+W;if(K.css)W+=`
1815
1815
  <style>${K.css}</style>`;if(K.script)W+=`
1816
- <script>${K.script}</script>`;return W},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function uJ($,Z,J){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let X=$.trim();if(X.startsWith("@img(")||X.startsWith("("))X=X.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Q=dJ(X),Y=W5(Q[0],J)||"",G=W5(Q[1],J)||"",z={};if(Q[2]){let q=W5(Q[2],J);if(typeof q==="object"&&q!==null)z=q;else if(typeof Q[2]==="string")try{z=JSON.parse(Q[2])}catch{}}return{src:Y,alt:G,options:z}}function dJ($){let Z=[],J="",X=!1,Q="",Y=0,G=0;for(let z=0;z<$.length;z++){let q=$[z],K=z>0?$[z-1]:"";if((q==='"'||q==="'"||q==="`")&&K!=="\\"){if(!X)X=!0,Q=q;else if(q===Q)X=!1,Q="";else J+=q;continue}if(!X){if(q==="{")Y++;if(q==="}")Y--;if(q==="[")G++;if(q==="]")G--;if(q===","&&Y===0&&G===0){Z.push(J.trim()),J="";continue}}J+=q}if(J.trim())Z.push(J.trim());return Z}function W5($,Z){if(typeof $!=="string")return $;let J=$.trim();if(J.startsWith('"')&&J.endsWith('"')||J.startsWith("'")&&J.endsWith("'"))return J.slice(1,-1);if(!J.startsWith("/")&&!J.startsWith(".")&&!J.startsWith("http")&&!J.startsWith("{")){let X=Z[J];if(X!==void 0)return X}if(J.startsWith("{")||J.startsWith("["))try{return JSON.parse(J)}catch{}return J}var Q7=hJ();async function z7(){try{return await import("./chunk-z6xtb8fj.js")}catch($){if(!G7)console.warn("[stx-media] Video processor not available, some features disabled:",$),G7=!0;return null}}var G7=!1,q7=!0,K7="metadata",mJ="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function o2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipProcessing){if(J.tsVideosConfig?.enabled&&!J.isDev)return nJ(X,J)}if(J.processedResult?.processed)return U7($,J.processedResult,Z);let Q;if(X.generatePoster&&X.src&&!$.poster)Q=await sJ(X,J);let{src:Y,sources:G=[],poster:z,posterPlaceholder:q,controls:K=q7,autoplay:W=!1,muted:U=!1,loop:H=!1,preload:j=K7,playsinline:B=!0,lazy:V=!0,player:F="native",type:L,width:O,height:_,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:N=!1}=$,A=Q||z,k=$.class,D=$.style,I=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(F==="ts-video")return cJ($,Z);if(L&&L!=="video")return lJ(Y||"",L,$);let T=G.length>0?G:Y?[{src:Y,type:W7(Y)}]:[],M=[`id="${I}"`];if(K)M.push("controls");if(W)M.push("autoplay");if(U)M.push("muted");if(H)M.push("loop");if(B)M.push("playsinline");if(R)M.push("disablepictureinpicture");if(N)M.push("disableremoteplayback");if(w)M.push(`crossorigin="${w}"`);if(V){if(M.push(`data-preload="${j}"`),M.push('preload="none"'),A)M.push(`data-poster="${I0(A)}"`);M.push("data-stx-lazy")}else if(M.push(`preload="${j}"`),A)M.push(`poster="${I0(A)}"`);if(O)M.push(`width="${O}"`);if(_)M.push(`height="${_}"`);if(k)M.push(`class="${I0(k)}"`);if(D)M.push(`style="${I0(D)}"`);let E=T.map((b)=>{return` <source ${V?`data-src="${I0(b.src)}"`:`src="${I0(b.src)}"`} type="${b.type}"${b.media?` media="${b.media}"`:""} />`}).join(`
1816
+ <script>${K.script}</script>`;return W},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function uJ($,Z,J){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let X=$.trim();if(X.startsWith("@img(")||X.startsWith("("))X=X.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Q=dJ(X),Y=W5(Q[0],J)||"",G=W5(Q[1],J)||"",z={};if(Q[2]){let q=W5(Q[2],J);if(typeof q==="object"&&q!==null)z=q;else if(typeof Q[2]==="string")try{z=JSON.parse(Q[2])}catch{}}return{src:Y,alt:G,options:z}}function dJ($){let Z=[],J="",X=!1,Q="",Y=0,G=0;for(let z=0;z<$.length;z++){let q=$[z],K=z>0?$[z-1]:"";if((q==='"'||q==="'"||q==="`")&&K!=="\\"){if(!X)X=!0,Q=q;else if(q===Q)X=!1,Q="";else J+=q;continue}if(!X){if(q==="{")Y++;if(q==="}")Y--;if(q==="[")G++;if(q==="]")G--;if(q===","&&Y===0&&G===0){Z.push(J.trim()),J="";continue}}J+=q}if(J.trim())Z.push(J.trim());return Z}function W5($,Z){if(typeof $!=="string")return $;let J=$.trim();if(J.startsWith('"')&&J.endsWith('"')||J.startsWith("'")&&J.endsWith("'"))return J.slice(1,-1);if(!J.startsWith("/")&&!J.startsWith(".")&&!J.startsWith("http")&&!J.startsWith("{")){let X=Z[J];if(X!==void 0)return X}if(J.startsWith("{")||J.startsWith("["))try{return JSON.parse(J)}catch{}return J}var Q7=hJ();async function z7(){try{return await import("./chunk-mm59b0gg.js")}catch($){if(!G7)console.warn("[stx-media] Video processor not available, some features disabled:",$),G7=!0;return null}}var G7=!1,q7=!0,K7="metadata",mJ="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function o2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipProcessing){if(J.tsVideosConfig?.enabled&&!J.isDev)return nJ(X,J)}if(J.processedResult?.processed)return U7($,J.processedResult,Z);let Q;if(X.generatePoster&&X.src&&!$.poster)Q=await sJ(X,J);let{src:Y,sources:G=[],poster:z,posterPlaceholder:q,controls:K=q7,autoplay:W=!1,muted:U=!1,loop:H=!1,preload:j=K7,playsinline:B=!0,lazy:V=!0,player:F="native",type:L,width:O,height:_,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:N=!1}=$,A=Q||z,k=$.class,D=$.style,I=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(F==="ts-video")return cJ($,Z);if(L&&L!=="video")return lJ(Y||"",L,$);let T=G.length>0?G:Y?[{src:Y,type:W7(Y)}]:[],M=[`id="${I}"`];if(K)M.push("controls");if(W)M.push("autoplay");if(U)M.push("muted");if(H)M.push("loop");if(B)M.push("playsinline");if(R)M.push("disablepictureinpicture");if(N)M.push("disableremoteplayback");if(w)M.push(`crossorigin="${w}"`);if(V){if(M.push(`data-preload="${j}"`),M.push('preload="none"'),A)M.push(`data-poster="${I0(A)}"`);M.push("data-stx-lazy")}else if(M.push(`preload="${j}"`),A)M.push(`poster="${I0(A)}"`);if(O)M.push(`width="${O}"`);if(_)M.push(`height="${_}"`);if(k)M.push(`class="${I0(k)}"`);if(D)M.push(`style="${I0(D)}"`);let E=T.map((b)=>{return` <source ${V?`data-src="${I0(b.src)}"`:`src="${I0(b.src)}"`} type="${b.type}"${b.media?` media="${b.media}"`:""} />`}).join(`
1817
1817
  `),C=`<video ${M.join(" ")}>
1818
1818
  ${E}
1819
1819
  Your browser does not support the video tag.
@@ -3219,7 +3219,7 @@ ${W}
3219
3219
  customElements.define('${Z}', ${G});
3220
3220
  `}async function R7($,Z,J,X){if(Z.length<1)return G0("WebComponent","@webcomponent directive requires at least the tag name parameter",Q0.INVALID_DIRECTIVE_SYNTAX);let Q=Z[0].replace(/['"]/g,""),G=(J.__stx_options||{}).componentsDir||"components",z=h0.isAbsolute(G)?[h0.join(G,`${Q}.stx`),h0.join(h0.dirname(X),`${Q}.stx`)]:[h0.join(h0.dirname(X),G,`${Q}.stx`),h0.join(process.cwd(),G,`${Q}.stx`),h0.join(h0.dirname(X),`${Q}.stx`)],q=null;for(let U of z)if(await e(U)){q=await Bun.file(U).text();break}if(!q)return G0("WebComponent",`Component file not found: ${Q}.stx`,Q0.FILE_NOT_FOUND);let K=jX(q,Q);return`<script type="module">
3221
3221
  ${BX(K)}
3222
- </script>`}var _5={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:M7,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:n3,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:R7,hasEndTag:!1,description:"Include a web component in the template"},D7,A7,H5,j5,s9,r9,a9,o9,l3,C3,Q7,U5,...b7],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function _X($,Z,J){let X=Z||"pages";if($)return{root:$,pagesDir:X};let Q=J||process.cwd(),Y=y0.join(Q,"resources","views"),G=y0.join(Q,"resources","layouts");if(Z9.existsSync(Y)&&Z9.existsSync(G))return{root:"resources",pagesDir:"views"};let z=y0.join(Q,"resources","views","pages");if(Z9.existsSync(z))return{root:"resources/views",pagesDir:X};return{root:".",pagesDir:X}}var N7=new Set,J9=["partialsDir","componentsDir","layoutsDir"],L5=new WeakMap;function LX($,Z){let J=Z.replace(/[\\/]+$/,"");if(!J||J===".")return!0;let X=$.replace(/\\/g,"/"),Q=J.replace(/\\/g,"/");return X===Q||X.startsWith(`${Q}/`)}function OX($,Z){let J=!$.root,X=_X($.root,$.pagesDir,Z);if($.root=X.root,$.pagesDir=X.pagesDir,J&&X.root!=="."){let Q=`${Z}::${X.root}`;if(!N7.has(Q))N7.add(Q),console.warn(`[stx] No "root" in config \u2014 inferred "${X.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!L5.has($)){let Q={};for(let Y of J9){let G=$[Y];if(typeof G==="string"&&G)Q[Y]=G}L5.set($,Q)}if($.root&&$.root!=="."){let Q=$.root;for(let Y of J9){let G=$[Y];if(typeof G!=="string"||!G)continue;if(y0.isAbsolute(G)||LX(G,Q))continue;$[Y]=y0.join(Q,G)}}for(let Q of J9){let Y=$[Q];if(typeof Y!=="string"||!Y||y0.isAbsolute(Y))continue;$[Q]=y0.resolve(Z,Y)}return $}function FX($,Z){let J=L5.get($);for(let X of J9){let Q=$[X];if(typeof Q!=="string"||!Q)continue;let Y=y0.isAbsolute(Q)?Q:y0.join(Z,Q);if(Z9.existsSync(Y))continue;let G=J?.[X]??Q,z=$.root,q=!!z&&z!==".";console.warn(`[stx] ${String(X)} resolves to "${Y}", which does not exist. Configured as "${G}"`+(q?`, resolved under root "${z}".`:"."))}}function wX($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function RX($){if(I7($.stateDir),$.stateDir=k7(),$.cachePath=j2($.cachePath),$.build)$.build.cacheDir=j2($.build.cacheDir);if($.media?.cache)$.media.cache.directory=j2($.media.cache.directory);if($.story)$.story.outDir=j2($.story.outDir)}var z1=null,L1=new Map,t2=new Map,B2=null;async function O5($){let Z=$?y0.resolve($):process.cwd(),J=t2.get(Z);if(J&&J.signature!==e2(J.graph)){let Y=L1.get(Z);if(L1.delete(Z),t2.delete(Z),!$)z1=null,B2=null;let{clearComponentCache:G}=await import("./chunk-73sq0e73.js"),{partialsCache:z}=await import("./chunk-94c8we2y.js");if(G(),z.clear(),Y&&J.configSignature===$9(J.graph)){let q=Y.then(async(K)=>{let W={...J.graph};await E7(W,Z),t2.set(Z,{graph:W,signature:e2(W),configSignature:$9(W)});let U={...K,_layerGraph:W};if(!$)z1=U;return U});return L1.set(Z,q),q}}if(!$){if(z1)return z1;if(B2)return B2}let X=L1.get(Z);if(X)return X;let Q=(async()=>{let G=(await VX({name:"stx",alias:"ui",cwd:Z,defaultConfig:_5,verbose:!1})).config;if(G.extends!==void 0||J){let z=await T7(Z,_5);G=z.config,t2.set(Z,{graph:z.graph,signature:e2(z.graph),configSignature:$9(z.graph)})}if(G.runtimeConfig){let{resolveRuntimeConfig:z}=await import("./chunk-bsa8pxtc.js");z(G.runtimeConfig,{});let{generateRuntimeConfigTypes:q}=await import("./chunk-41fhbhbn.js");await q(Z,G.runtimeConfig)}if(wX(G),RX(G),OX(G,Z),FX(G,Z),G.plugins&&G.plugins.length>0){let{pluginManager:z}=await import("./chunk-afsy9158.js"),q=[],K=[];for(let W of G.plugins){let U=typeof W==="string"?W:W[0],H=typeof W==="string"?{}:W[1]||{};try{let j,B;try{j=await import(U),B=y0.dirname(f.resolve(U))}catch{let F=y0.resolve(Z,U);j=await import(F),B=y0.dirname(F)}let V=j.default||j;if(!z.has(V.name))await z.register(V,G);if(V.components){let F=Array.isArray(V.components)?V.components:[V.components];for(let L of F)q.push(y0.resolve(B,L))}if(V.pages){let F=y0.resolve(B,V.pages),L=H.path||"/";K.push({dir:F,prefix:L})}if(V.setup){let F={addDirective:(L)=>{G.customDirectives=G.customDirectives||[],G.customDirectives.push(L)},addRoute:(L,O)=>{G.apiRoutes=G.apiRoutes||{},G.apiRoutes[L]=O},addMiddleware:(L)=>{G.middleware=G.middleware||[],G.middleware.push(L)},pluginDir:B,config:G};await V.setup(H,F)}console.log(`[stx] Plugin loaded: ${V.name||U}`)}catch(j){console.warn(`[stx] Failed to load plugin ${U}:`,j.message)}}G._pluginComponentDirs=q,G._pluginPageDirs=K}return G})();if(L1.set(Z,Q),Q.catch(()=>{if(L1.get(Z)===Q)L1.delete(Z)}),!$)B2=Q,Q.then((Y)=>{z1=Y}).catch(()=>{});return Q}var y7=new Proxy(_5,{get($,Z){if(z1&&Z in z1)return z1[Z];if(!B2)O5().catch((J)=>{console.warn("[stx] Failed to load config file:",J?.message||J)});return $[Z]}});function IW($){return $}function kW($){let Z=[],J=[];if($.partialsDir!==void 0&&typeof $.partialsDir!=="string")Z.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if($.componentsDir!==void 0&&typeof $.componentsDir!=="string")Z.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if($.cache!==void 0&&typeof $.cache!=="boolean")Z.push({path:"cache",message:"cache must be a boolean",severity:"error"});if($.debug!==void 0&&typeof $.debug!=="boolean")Z.push({path:"debug",message:"debug must be a boolean",severity:"error"});if($.streaming){if($.streaming.bufferSize!==void 0){if(typeof $.streaming.bufferSize!=="number"||$.streaming.bufferSize<=0)Z.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if($.streaming.timeout!==void 0){if(typeof $.streaming.timeout!=="number"||$.streaming.timeout<=0)Z.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if($.streaming.strategy!==void 0){let X=["auto","manual","sections"];if(!X.includes($.streaming.strategy))Z.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${X.join(", ")}`,severity:"error"})}}if($.i18n){if($.i18n.format!==void 0){let X=["json","yaml","yml","js"];if(!X.includes($.i18n.format))Z.push({path:"i18n.format",message:`i18n.format must be one of: ${X.join(", ")}`,severity:"error"})}}if($.animation){if($.animation.defaultDuration!==void 0){if(typeof $.animation.defaultDuration!=="number"||$.animation.defaultDuration<0)Z.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if($.animation.staggerDelay!==void 0){if(typeof $.animation.staggerDelay!=="number"||$.animation.staggerDelay<0)Z.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if($.a11y){if($.a11y.level!==void 0){let X=["AA","AAA"];if(!X.includes($.a11y.level))Z.push({path:"a11y.level",message:`a11y.level must be one of: ${X.join(", ")}`,severity:"error"})}}if($.hydration){if($.hydration.mode!==void 0){let X=["progressive","islands"];if(!X.includes($.hydration.mode))Z.push({path:"hydration.mode",message:`hydration.mode must be one of: ${X.join(", ")}`,severity:"error"})}if($.hydration.preload!==void 0){let X=["none","eager","lazy"];if(!X.includes($.hydration.preload))Z.push({path:"hydration.preload",message:`hydration.preload must be one of: ${X.join(", ")}`,severity:"error"})}}if($.customDirectives)if(!Array.isArray($.customDirectives))Z.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else $.customDirectives.forEach((X,Q)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`customDirectives[${Q}].name`,message:"Custom directive must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`customDirectives[${Q}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if($.middleware)if(!Array.isArray($.middleware))Z.push({path:"middleware",message:"middleware must be an array",severity:"error"});else $.middleware.forEach((X,Q)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`middleware[${Q}].name`,message:"Middleware must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`middleware[${Q}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!X.timing||!["before","after"].includes(X.timing))Z.push({path:`middleware[${Q}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if($.debug===!0&&$.cache===!0)J.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if($.seo?.enabled===!0&&!$.seo?.defaultConfig?.title)J.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if($.pwa){if($.pwa.enabled===!0&&!$.pwa.manifest?.name)Z.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if($.pwa.manifest?.display!==void 0){let X=["fullscreen","standalone","minimal-ui","browser"];if(!X.includes($.pwa.manifest.display))Z.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.manifest?.orientation!==void 0){let X=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!X.includes($.pwa.manifest.orientation))Z.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.routes){let X=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];$.pwa.routes.forEach((Q,Y)=>{if(!Q.pattern||typeof Q.pattern!=="string")Z.push({path:`pwa.routes[${Y}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!X.includes(Q.strategy))Z.push({path:`pwa.routes[${Y}].strategy`,message:`PWA route strategy must be one of: ${X.join(", ")}`,severity:"error"});if(Q.maxAgeSeconds!==void 0&&(typeof Q.maxAgeSeconds!=="number"||Q.maxAgeSeconds<0))Z.push({path:`pwa.routes[${Y}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(Q.maxEntries!==void 0&&(typeof Q.maxEntries!=="number"||Q.maxEntries<1))Z.push({path:`pwa.routes[${Y}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if($.pwa.icons?.sizes){if(!Array.isArray($.pwa.icons.sizes))Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if($.pwa.icons.sizes.filter((Q)=>typeof Q!=="number"||Q<16||Q>1024).length>0)Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if($.pwa.icons?.purpose){let X=["any","maskable","monochrome"];if($.pwa.icons.purpose.filter((Y)=>!X.includes(Y)).length>0)Z.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.enabled===!0&&!$.pwa.icons?.src)J.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if($.pwa.enabled===!0&&!$.pwa.manifest?.themeColor)J.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:Z.length===0,errors:Z,warnings:J}}var w5=new Map;async function AX($,Z={}){try{if(!await e($))throw Error(`Markdown file not found: ${$}`);let X=(await NX.promises.stat($)).mtime.getTime();if(Z.cache&&w5.has($)){let U=w5.get($);if(U.updatedAt>=X)return{content:U.content,data:U.data}}let Q=await Bun.file($).text(),{data:Y,content:G}=p3(Q),z=Z.markdown||y7.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},K=W2(G,{gfm:!0});if(z.syntaxHighlighting?.enabled&&z.syntaxHighlighting?.serverSide)K=await MX(K,z.syntaxHighlighting?.defaultTheme||"github-dark",z.syntaxHighlighting?.highlightUnknownLanguages||!1);let W={content:K,data:Y||{}};if(Z.cache)w5.set($,{...W,updatedAt:X});return W}catch(J){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,J);let X=J instanceof Error?J.message:String(J);return{content:_0("Markdown File",`Error reading/parsing markdown file: ${X}`,$,"",0,""),data:{}}}}var X9=null;async function MX($,Z,J){let X=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!X9)try{X9=await DX({theme:Z||"github-dark",cache:!0})}catch(z){return console.error("Failed to initialize ts-syntax-highlighter:",z),$}let Q=async(z,q,K,W)=>{let U=W.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=K||(J?"text":"");if(!H)return z;try{if(!X9.getSupportedLanguages().includes(H))return z;return(await X9.highlight(U,H,{theme:Z})).html}catch(j){console.error(`Error highlighting code block with language ${K}:`,j)}return z},Y=$,G=$.matchAll(X);for(let z of G){let[q,K,W,U]=z,H=await Q(q,K,W,U);Y=Y.replace(q,H)}return Y}async function C7($,Z,J="",X={}){return await IX($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,z,q,K)=>{try{let W=z;if(!F5.isAbsolute(z))W=F5.resolve(F5.dirname(J),z);let U={};if(q)try{try{U=JSON.parse(q)}catch{if(X.debug)console.warn("Using safer alternative for parsing JS object literal");let O=q.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let _ of O){let w=_.indexOf(":");if(w>0){let R=_.substring(0,w).trim(),N=_.substring(w+1).trim(),A=N.startsWith('"')&&N.endsWith('"'),k=N.startsWith("'")&&N.endsWith("'");if(A||k)N=N.substring(1,N.length-1);U[R]=N}}}}catch(L){if(X.debug)console.error("Error parsing context in @markdown-file directive:",L)}let{content:H,data:j}=await AX(W,X),B={...Z,...j,...U},V=H,F=/\{\{([^}]+)\}\}/g;return V=V.replace(F,(L,O)=>{let _=O.trim();return B[_]!==void 0?String(B[_]):L}),V}catch(W){let U=W instanceof Error?W.message:String(W);return _0("Markdown File",`Error including markdown file: ${U}`,J,$,K,G)}})}async function IX($,Z,J){let X=[],Q;while((Q=Z.exec($))!==null){let z=Q[0],q=Q.index,K=Q;X.push(J(...K).then((W)=>({match:z,replacement:W,index:q})))}let Y=await Promise.all(X);Y.sort((z,q)=>q.index-z.index);let G=$;for(let{match:z,replacement:q}of Y)G=G.replace(z,()=>q);return G}function q1($,Z){try{let J=$.trim();if(B0(J))return H0(J,Object.keys(Z))(...Object.values(Z));else return Z0(J,Z)}catch{return!1}}class Y9{source;pos=0;line=1;column=0;tokens=[];constructor($){this.source=$}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let $=this.nextToken();if($)this.tokens.push($)}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 $=this.pos,Z=this.line,J=this.column,X=this.source[this.pos];if(/\s/.test(X))return this.readWhitespace($,Z,J);if(X==="/"&&this.peek(1)==="/")return this.readLineComment($,Z,J);if(X==="/"&&this.peek(1)==="*")return this.readBlockComment($,Z,J);if(X==='"'||X==="'")return this.readString(X,$,Z,J);if(X==="`")return this.readTemplateString($,Z,J);if(/\d/.test(X)||X==="."&&/\d/.test(this.peek(1)||""))return this.readNumber($,Z,J);if(/[a-z_$]/i.test(X))return this.readIdentifier($,Z,J);if(X==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:$,end:this.pos,line:Z,column:J}}if(X==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:$,end:this.pos,line:Z,column:J}}if(X==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:$,end:this.pos,line:Z,column:J};if(X==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective($,Z,J);let Q=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let Y of Q)if(this.source.slice(this.pos,this.pos+Y.length)===Y)return this.advance(Y.length),{type:"OPERATOR",value:Y,start:$,end:this.pos,line:Z,column:J};if(/[+\-*/%<>=!&|^~?:]/.test(X))return this.advance(),{type:"OPERATOR",value:X,start:$,end:this.pos,line:Z,column:J};if(/[()[\]{},;.]/.test(X))return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J};return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J}}readWhitespace($,Z,J){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readLineComment($,Z,J){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3222
+ </script>`}var _5={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:M7,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:n3,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:R7,hasEndTag:!1,description:"Include a web component in the template"},D7,A7,H5,j5,s9,r9,a9,o9,l3,C3,Q7,U5,...b7],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function _X($,Z,J){let X=Z||"pages";if($)return{root:$,pagesDir:X};let Q=J||process.cwd(),Y=y0.join(Q,"resources","views"),G=y0.join(Q,"resources","layouts");if(Z9.existsSync(Y)&&Z9.existsSync(G))return{root:"resources",pagesDir:"views"};let z=y0.join(Q,"resources","views","pages");if(Z9.existsSync(z))return{root:"resources/views",pagesDir:X};return{root:".",pagesDir:X}}var N7=new Set,J9=["partialsDir","componentsDir","layoutsDir"],L5=new WeakMap;function LX($,Z){let J=Z.replace(/[\\/]+$/,"");if(!J||J===".")return!0;let X=$.replace(/\\/g,"/"),Q=J.replace(/\\/g,"/");return X===Q||X.startsWith(`${Q}/`)}function OX($,Z){let J=!$.root,X=_X($.root,$.pagesDir,Z);if($.root=X.root,$.pagesDir=X.pagesDir,J&&X.root!=="."){let Q=`${Z}::${X.root}`;if(!N7.has(Q))N7.add(Q),console.warn(`[stx] No "root" in config \u2014 inferred "${X.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!L5.has($)){let Q={};for(let Y of J9){let G=$[Y];if(typeof G==="string"&&G)Q[Y]=G}L5.set($,Q)}if($.root&&$.root!=="."){let Q=$.root;for(let Y of J9){let G=$[Y];if(typeof G!=="string"||!G)continue;if(y0.isAbsolute(G)||LX(G,Q))continue;$[Y]=y0.join(Q,G)}}for(let Q of J9){let Y=$[Q];if(typeof Y!=="string"||!Y||y0.isAbsolute(Y))continue;$[Q]=y0.resolve(Z,Y)}return $}function FX($,Z){let J=L5.get($);for(let X of J9){let Q=$[X];if(typeof Q!=="string"||!Q)continue;let Y=y0.isAbsolute(Q)?Q:y0.join(Z,Q);if(Z9.existsSync(Y))continue;let G=J?.[X]??Q,z=$.root,q=!!z&&z!==".";console.warn(`[stx] ${String(X)} resolves to "${Y}", which does not exist. Configured as "${G}"`+(q?`, resolved under root "${z}".`:"."))}}function wX($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function RX($){if(I7($.stateDir),$.stateDir=k7(),$.cachePath=j2($.cachePath),$.build)$.build.cacheDir=j2($.build.cacheDir);if($.media?.cache)$.media.cache.directory=j2($.media.cache.directory);if($.story)$.story.outDir=j2($.story.outDir)}var z1=null,L1=new Map,t2=new Map,B2=null;async function O5($){let Z=$?y0.resolve($):process.cwd(),J=t2.get(Z);if(J&&J.signature!==e2(J.graph)){let Y=L1.get(Z);if(L1.delete(Z),t2.delete(Z),!$)z1=null,B2=null;let{clearComponentCache:G}=await import("./chunk-1brnvyhv.js"),{partialsCache:z}=await import("./chunk-ewsx2qxm.js");if(G(),z.clear(),Y&&J.configSignature===$9(J.graph)){let q=Y.then(async(K)=>{let W={...J.graph};await E7(W,Z),t2.set(Z,{graph:W,signature:e2(W),configSignature:$9(W)});let U={...K,_layerGraph:W};if(!$)z1=U;return U});return L1.set(Z,q),q}}if(!$){if(z1)return z1;if(B2)return B2}let X=L1.get(Z);if(X)return X;let Q=(async()=>{let G=(await VX({name:"stx",alias:"ui",cwd:Z,defaultConfig:_5,verbose:!1})).config;if(G.extends!==void 0||J){let z=await T7(Z,_5);G=z.config,t2.set(Z,{graph:z.graph,signature:e2(z.graph),configSignature:$9(z.graph)})}if(G.runtimeConfig){let{resolveRuntimeConfig:z}=await import("./chunk-24b4711v.js");z(G.runtimeConfig,{});let{generateRuntimeConfigTypes:q}=await import("./chunk-szx6pxh3.js");await q(Z,G.runtimeConfig)}if(wX(G),RX(G),OX(G,Z),FX(G,Z),G.plugins&&G.plugins.length>0){let{pluginManager:z}=await import("./chunk-67bh5vrj.js"),q=[],K=[];for(let W of G.plugins){let U=typeof W==="string"?W:W[0],H=typeof W==="string"?{}:W[1]||{};try{let j,B;try{j=await import(U),B=y0.dirname(f.resolve(U))}catch{let F=y0.resolve(Z,U);j=await import(F),B=y0.dirname(F)}let V=j.default||j;if(!z.has(V.name))await z.register(V,G);if(V.components){let F=Array.isArray(V.components)?V.components:[V.components];for(let L of F)q.push(y0.resolve(B,L))}if(V.pages){let F=y0.resolve(B,V.pages),L=H.path||"/";K.push({dir:F,prefix:L})}if(V.setup){let F={addDirective:(L)=>{G.customDirectives=G.customDirectives||[],G.customDirectives.push(L)},addRoute:(L,O)=>{G.apiRoutes=G.apiRoutes||{},G.apiRoutes[L]=O},addMiddleware:(L)=>{G.middleware=G.middleware||[],G.middleware.push(L)},pluginDir:B,config:G};await V.setup(H,F)}console.log(`[stx] Plugin loaded: ${V.name||U}`)}catch(j){console.warn(`[stx] Failed to load plugin ${U}:`,j.message)}}G._pluginComponentDirs=q,G._pluginPageDirs=K}return G})();if(L1.set(Z,Q),Q.catch(()=>{if(L1.get(Z)===Q)L1.delete(Z)}),!$)B2=Q,Q.then((Y)=>{z1=Y}).catch(()=>{});return Q}var y7=new Proxy(_5,{get($,Z){if(z1&&Z in z1)return z1[Z];if(!B2)O5().catch((J)=>{console.warn("[stx] Failed to load config file:",J?.message||J)});return $[Z]}});function IW($){return $}function kW($){let Z=[],J=[];if($.partialsDir!==void 0&&typeof $.partialsDir!=="string")Z.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if($.componentsDir!==void 0&&typeof $.componentsDir!=="string")Z.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if($.cache!==void 0&&typeof $.cache!=="boolean")Z.push({path:"cache",message:"cache must be a boolean",severity:"error"});if($.debug!==void 0&&typeof $.debug!=="boolean")Z.push({path:"debug",message:"debug must be a boolean",severity:"error"});if($.streaming){if($.streaming.bufferSize!==void 0){if(typeof $.streaming.bufferSize!=="number"||$.streaming.bufferSize<=0)Z.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if($.streaming.timeout!==void 0){if(typeof $.streaming.timeout!=="number"||$.streaming.timeout<=0)Z.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if($.streaming.strategy!==void 0){let X=["auto","manual","sections"];if(!X.includes($.streaming.strategy))Z.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${X.join(", ")}`,severity:"error"})}}if($.i18n){if($.i18n.format!==void 0){let X=["json","yaml","yml","js"];if(!X.includes($.i18n.format))Z.push({path:"i18n.format",message:`i18n.format must be one of: ${X.join(", ")}`,severity:"error"})}}if($.animation){if($.animation.defaultDuration!==void 0){if(typeof $.animation.defaultDuration!=="number"||$.animation.defaultDuration<0)Z.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if($.animation.staggerDelay!==void 0){if(typeof $.animation.staggerDelay!=="number"||$.animation.staggerDelay<0)Z.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if($.a11y){if($.a11y.level!==void 0){let X=["AA","AAA"];if(!X.includes($.a11y.level))Z.push({path:"a11y.level",message:`a11y.level must be one of: ${X.join(", ")}`,severity:"error"})}}if($.hydration){if($.hydration.mode!==void 0){let X=["progressive","islands"];if(!X.includes($.hydration.mode))Z.push({path:"hydration.mode",message:`hydration.mode must be one of: ${X.join(", ")}`,severity:"error"})}if($.hydration.preload!==void 0){let X=["none","eager","lazy"];if(!X.includes($.hydration.preload))Z.push({path:"hydration.preload",message:`hydration.preload must be one of: ${X.join(", ")}`,severity:"error"})}}if($.customDirectives)if(!Array.isArray($.customDirectives))Z.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else $.customDirectives.forEach((X,Q)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`customDirectives[${Q}].name`,message:"Custom directive must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`customDirectives[${Q}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if($.middleware)if(!Array.isArray($.middleware))Z.push({path:"middleware",message:"middleware must be an array",severity:"error"});else $.middleware.forEach((X,Q)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`middleware[${Q}].name`,message:"Middleware must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`middleware[${Q}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!X.timing||!["before","after"].includes(X.timing))Z.push({path:`middleware[${Q}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if($.debug===!0&&$.cache===!0)J.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if($.seo?.enabled===!0&&!$.seo?.defaultConfig?.title)J.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if($.pwa){if($.pwa.enabled===!0&&!$.pwa.manifest?.name)Z.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if($.pwa.manifest?.display!==void 0){let X=["fullscreen","standalone","minimal-ui","browser"];if(!X.includes($.pwa.manifest.display))Z.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.manifest?.orientation!==void 0){let X=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!X.includes($.pwa.manifest.orientation))Z.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.routes){let X=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];$.pwa.routes.forEach((Q,Y)=>{if(!Q.pattern||typeof Q.pattern!=="string")Z.push({path:`pwa.routes[${Y}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!X.includes(Q.strategy))Z.push({path:`pwa.routes[${Y}].strategy`,message:`PWA route strategy must be one of: ${X.join(", ")}`,severity:"error"});if(Q.maxAgeSeconds!==void 0&&(typeof Q.maxAgeSeconds!=="number"||Q.maxAgeSeconds<0))Z.push({path:`pwa.routes[${Y}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(Q.maxEntries!==void 0&&(typeof Q.maxEntries!=="number"||Q.maxEntries<1))Z.push({path:`pwa.routes[${Y}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if($.pwa.icons?.sizes){if(!Array.isArray($.pwa.icons.sizes))Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if($.pwa.icons.sizes.filter((Q)=>typeof Q!=="number"||Q<16||Q>1024).length>0)Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if($.pwa.icons?.purpose){let X=["any","maskable","monochrome"];if($.pwa.icons.purpose.filter((Y)=>!X.includes(Y)).length>0)Z.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.enabled===!0&&!$.pwa.icons?.src)J.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if($.pwa.enabled===!0&&!$.pwa.manifest?.themeColor)J.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:Z.length===0,errors:Z,warnings:J}}var w5=new Map;async function AX($,Z={}){try{if(!await e($))throw Error(`Markdown file not found: ${$}`);let X=(await NX.promises.stat($)).mtime.getTime();if(Z.cache&&w5.has($)){let U=w5.get($);if(U.updatedAt>=X)return{content:U.content,data:U.data}}let Q=await Bun.file($).text(),{data:Y,content:G}=p3(Q),z=Z.markdown||y7.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},K=W2(G,{gfm:!0});if(z.syntaxHighlighting?.enabled&&z.syntaxHighlighting?.serverSide)K=await MX(K,z.syntaxHighlighting?.defaultTheme||"github-dark",z.syntaxHighlighting?.highlightUnknownLanguages||!1);let W={content:K,data:Y||{}};if(Z.cache)w5.set($,{...W,updatedAt:X});return W}catch(J){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,J);let X=J instanceof Error?J.message:String(J);return{content:_0("Markdown File",`Error reading/parsing markdown file: ${X}`,$,"",0,""),data:{}}}}var X9=null;async function MX($,Z,J){let X=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!X9)try{X9=await DX({theme:Z||"github-dark",cache:!0})}catch(z){return console.error("Failed to initialize ts-syntax-highlighter:",z),$}let Q=async(z,q,K,W)=>{let U=W.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=K||(J?"text":"");if(!H)return z;try{if(!X9.getSupportedLanguages().includes(H))return z;return(await X9.highlight(U,H,{theme:Z})).html}catch(j){console.error(`Error highlighting code block with language ${K}:`,j)}return z},Y=$,G=$.matchAll(X);for(let z of G){let[q,K,W,U]=z,H=await Q(q,K,W,U);Y=Y.replace(q,H)}return Y}async function C7($,Z,J="",X={}){return await IX($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,z,q,K)=>{try{let W=z;if(!F5.isAbsolute(z))W=F5.resolve(F5.dirname(J),z);let U={};if(q)try{try{U=JSON.parse(q)}catch{if(X.debug)console.warn("Using safer alternative for parsing JS object literal");let O=q.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let _ of O){let w=_.indexOf(":");if(w>0){let R=_.substring(0,w).trim(),N=_.substring(w+1).trim(),A=N.startsWith('"')&&N.endsWith('"'),k=N.startsWith("'")&&N.endsWith("'");if(A||k)N=N.substring(1,N.length-1);U[R]=N}}}}catch(L){if(X.debug)console.error("Error parsing context in @markdown-file directive:",L)}let{content:H,data:j}=await AX(W,X),B={...Z,...j,...U},V=H,F=/\{\{([^}]+)\}\}/g;return V=V.replace(F,(L,O)=>{let _=O.trim();return B[_]!==void 0?String(B[_]):L}),V}catch(W){let U=W instanceof Error?W.message:String(W);return _0("Markdown File",`Error including markdown file: ${U}`,J,$,K,G)}})}async function IX($,Z,J){let X=[],Q;while((Q=Z.exec($))!==null){let z=Q[0],q=Q.index,K=Q;X.push(J(...K).then((W)=>({match:z,replacement:W,index:q})))}let Y=await Promise.all(X);Y.sort((z,q)=>q.index-z.index);let G=$;for(let{match:z,replacement:q}of Y)G=G.replace(z,()=>q);return G}function q1($,Z){try{let J=$.trim();if(B0(J))return H0(J,Object.keys(Z))(...Object.values(Z));else return Z0(J,Z)}catch{return!1}}class Y9{source;pos=0;line=1;column=0;tokens=[];constructor($){this.source=$}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let $=this.nextToken();if($)this.tokens.push($)}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 $=this.pos,Z=this.line,J=this.column,X=this.source[this.pos];if(/\s/.test(X))return this.readWhitespace($,Z,J);if(X==="/"&&this.peek(1)==="/")return this.readLineComment($,Z,J);if(X==="/"&&this.peek(1)==="*")return this.readBlockComment($,Z,J);if(X==='"'||X==="'")return this.readString(X,$,Z,J);if(X==="`")return this.readTemplateString($,Z,J);if(/\d/.test(X)||X==="."&&/\d/.test(this.peek(1)||""))return this.readNumber($,Z,J);if(/[a-z_$]/i.test(X))return this.readIdentifier($,Z,J);if(X==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:$,end:this.pos,line:Z,column:J}}if(X==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:$,end:this.pos,line:Z,column:J}}if(X==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:$,end:this.pos,line:Z,column:J};if(X==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective($,Z,J);let Q=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let Y of Q)if(this.source.slice(this.pos,this.pos+Y.length)===Y)return this.advance(Y.length),{type:"OPERATOR",value:Y,start:$,end:this.pos,line:Z,column:J};if(/[+\-*/%<>=!&|^~?:]/.test(X))return this.advance(),{type:"OPERATOR",value:X,start:$,end:this.pos,line:Z,column:J};if(/[()[\]{},;.]/.test(X))return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J};return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J}}readWhitespace($,Z,J){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readLineComment($,Z,J){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3223
3223
  `)this.advance();return{type:"COMMENT",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readBlockComment($,Z,J){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($,this.pos),start:$,end:this.pos,line:Z,column:J}}readString($,Z,J,X){this.advance();while(this.pos<this.source.length){let Q=this.source[this.pos];if(Q==="\\"){this.advance(2);continue}if(Q===$){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(Z,this.pos),start:Z,end:this.pos,line:J,column:X}}readTemplateString($,Z,J){this.advance();let X=0,Q=256;while(this.pos<this.source.length){let Y=this.source[this.pos];if(Y==="\\"){this.advance(2);continue}if(Y==="$"&&this.peek(1)==="{"){if(X>=Q){this.pos=this.source.length;break}this.advance(2),X++;continue}if(Y==="{"&&X>0){X++,this.advance();continue}if(Y==="}"&&X>0){X--,this.advance();continue}if(Y==="`"&&X===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readNumber($,Z,J){if(this.source[this.pos]==="0"){let X=this.peek(1)?.toLowerCase();if(X==="x"||X==="o"||X==="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($,this.pos),start:$,end:this.pos,line:Z,column:J}}}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($,this.pos),start:$,end:this.pos,line:Z,column:J}}readIdentifier($,Z,J){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readDirective($,Z,J){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($,this.pos),start:$,end:this.pos,line:Z,column:J}}advance($=1){for(let Z=0;Z<$&&this.pos<this.source.length;Z++){if(this.source[this.pos]===`
3224
3224
  `)this.line++,this.column=0;else this.column++;this.pos++}}peek($){return this.source[this.pos+$]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState($){this.pos=$.pos,this.line=$.line,this.column=$.column}}function w0($,Z,J,X=0){let Q=0,Y=X,G=null,z=0,q=!1;while(Y<$.length){let K=$[Y];if(G&&q){q=!1,Y++;continue}if(G&&K==="\\"){q=!0,Y++;continue}if(q=!1,(K==='"'||K==="'"||K==="`")&&!G){G=K,Y++;continue}if(K===G&&G!=="`"){G=null,Y++;continue}if(G==="`"&&K==="$"&&$[Y+1]==="{"){z++,Y+=2;continue}if(z>0&&K==="}"){z--,Y++;continue}if(K==="`"&&G==="`"&&z===0){G=null,Y++;continue}if(G){Y++;continue}if(K===Z)Q++;else if(K===J){if(Q--,Q===0)return Y}Y++}return-1}function S7($,Z){let J=Z,X={paren:0,bracket:0,brace:0},Q=null,Y=0;while(J<$.length){let G=$[J];if((J>0?$[J-1]:"")==="\\"&&Q){J++;continue}if((G==='"'||G==="'")&&!Q){Q=G,J++;continue}if(G===Q&&Q!=="`"){Q=null,J++;continue}if(G==="`"&&!Q){Q="`",J++;continue}if(G==="`"&&Q==="`"&&Y===0){Q=null,J++;continue}if(Q==="`"&&G==="$"&&$[J+1]==="{"){Y++,J+=2;continue}if(Y>0){if(G==="{")Y++;else if(G==="}")Y--;J++;continue}if(Q){J++;continue}if(X.paren===0&&X.bracket===0&&X.brace===0){if($.slice(J,J+2)==="}}"||$.slice(J,J+3)==="!!}")break;if(G===","||G===";")break}if(G==="(")X.paren++;else if(G===")"){if(X.paren--,X.paren<0)break}else if(G==="[")X.bracket++;else if(G==="]"){if(X.bracket--,X.bracket<0)break}else if(G==="{")X.brace++;else if(G==="}"){if(X.brace--,X.brace<0)break}J++}return{expression:$.slice(Z,J),endPos:J}}function R5($){let Z=[],J="",X={paren:0,bracket:0,brace:0},Q=null,Y=0;for(let G=0;G<$.length;G++){let z=$[G];if((G>0?$[G-1]:"")==="\\"&&Q){J+=z;continue}if((z==='"'||z==="'")&&!Q){Q=z,J+=z;continue}if(z===Q&&Q!=="`"){Q=null,J+=z;continue}if(z==="`"&&!Q){Q="`",J+=z;continue}if(z==="`"&&Q==="`"&&Y===0){Q=null,J+=z;continue}if(Q==="`"&&z==="$"&&$[G+1]==="{"){Y++,J+=z+$[G+1],G++;continue}if(Y>0&&z==="{"){Y++,J+=z;continue}if(Y>0&&z==="}"){Y--,J+=z;continue}if(Q){J+=z;continue}if(z==="(")X.paren++;else if(z===")")X.paren--;else if(z==="[")X.bracket++;else if(z==="]")X.bracket--;else if(z==="{")X.brace++;else if(z==="}")X.brace--;if(z==="|"&&$[G+1]!=="|"&&(G===0||$[G-1]!=="|")&&$[G-1]!=="\\"&&X.paren===0&&X.bracket===0&&X.brace===0){Z.push(J.trim()),J="";continue}if(z==="|"&&$[G-1]==="\\"&&!Q){J=J.slice(0,-1)+z;continue}J+=z}if(J.trim())Z.push(J.trim());return Z}function K1($,Z){let J=kX($,Z);return J.ok?{expression:J.expression,endPos:J.endPos}:null}function kX($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return{ok:!1,reason:"missing-open-paren",pos:J};let X=w0($,"(",")",J);if(X===-1)return{ok:!1,reason:"unclosed-paren",pos:J};return{ok:!0,expression:$.slice(J+1,X),endPos:X+1}}function TX($,Z){let J=$.lastIndexOf("<",Z);if(J===-1)return!1;return J>$.lastIndexOf(">",Z)}function O1($,Z,J,X){let Q=1,Y=X,G=new RegExp(`@${Z}\\s*\\(`,"g"),z=new RegExp(`@${J}(?![a-z])`,"g");while(Y<$.length&&Q>0){G.lastIndex=Y,z.lastIndex=Y;let q=G.exec($),K=z.exec($),W=q?q.index:1/0,U=K?K.index:1/0;if(W<U)Q++,Y=W+q[0].length;else if(U<1/0){if(Q--,Q===0)return U;Y=U+K[0].length}else break}return-1}function P7($,Z){let J=$.slice(Z).match(/^@if\s*/);if(!J)return null;let X=Z+J[0].length,Q=K1($,X);if(!Q)return null;let Y=Q.endPos,G=O1($,"if","endif",Y);if(G===-1)return null;let z=$.slice(Y,G),q=[],K=0,W="if",U=Q.expression,H=0,j=0;while(K<z.length){let B=z.indexOf("@",K);if(B===-1)break;K=B;let V=z.substring(B);if(TX(z,B)){K++;continue}if(/^@if\s*\(/.test(V)){j++,K++;continue}if(/^@endif(?![a-z])/.test(V)){j--,K+=6;continue}if(j===0){let F=V.match(/^@elseif\s*/);if(F){q.push({type:W,condition:U,content:z.substring(H,K),start:Y+H,end:Y+K});let L=K+F[0].length,O=K1(z,L);if(!O){K++;continue}W="elseif",U=O.expression,K=O.endPos,H=K;continue}else if(/^@else(?![a-z])/.test(V)){q.push({type:W,condition:U,content:z.substring(H,K),start:Y+H,end:Y+K}),W="else",U=void 0,K+=5,H=K;continue}}K++}return q.push({type:W,condition:U,content:z.slice(H),start:Y+H,end:Y+z.length}),{fullMatch:$.slice(Z,G+6),branches:q,start:Z,end:G+6}}function V2($){let Z=[],J=/@if\s*\(/g,X=J.exec($);while(X!==null){if(Z.some((G)=>X.index>G.start&&X.index<G.end)){X=J.exec($);continue}let Y=P7($,X.index);if(Y)Z.push(Y),J.lastIndex=Y.end;X=J.exec($)}return Z}function Q9($,Z,J){let X=[],Q=new RegExp(`@${Z}\\s*\\(`,"g"),Y=Q.exec($);while(Y!==null){if(X.some((V)=>Y.index>V.start&&Y.index<V.end)){Y=Q.exec($);continue}let z=Y.index,q=z+Y[0].length-1,K=w0($,"(",")",q);if(K===-1){Y=Q.exec($);continue}let W=$.slice(q+1,K),U=K+1,H=O1($,Z,J,U);if(H===-1){Y=Q.exec($);continue}let j=$.slice(U,H),B=H+`@${J}`.length;X.push({fullMatch:$.slice(z,B),name:Z,params:W,content:j,start:z,end:B}),Q.lastIndex=B,Y=Q.exec($)}return X}function N5($,Z){let J=$.slice(Z).match(/^@switch\s*/);if(!J)return null;let X=Z+J[0].length,Q=K1($,X);if(!Q)return null;let Y=Q.endPos,G=O1($,"switch","endswitch",Y);if(G===-1)return null;let z=$.slice(Y,G),q=[],K=0,W=null,U=0;while(K<z.length){let H=z.slice(K),j=H.match(/^@switch\s*\(/),B=H.match(/^@endswitch(?![a-z])/);if(j){if(U++,W)W.content+=j[0];K+=j[0].length;continue}if(B){if(U--,W)W.content+=B[0];K+=B[0].length;continue}if(U>0){if(W)W.content+=z[K];K++;continue}let V=H.match(/^@case\s*/),F=H.match(/^@default(?![a-z])/),L=H.match(/^@break(?![a-z])/);if(V&&H.startsWith("@case")){if(W)q.push(W);let O=K+V[0].length,_=K1(z,O);if(!_){K++;continue}W={type:"case",value:_.expression,content:""},K=_.endPos}else if(F&&H.startsWith("@default")){if(W)q.push(W);W={type:"default",content:""},K+=F[0].length}else if(L&&H.startsWith("@break"))K+=L[0].length;else{if(W)W.content+=z[K];K++}}if(W)q.push(W);return{fullMatch:$.slice(Z,G+10),expression:Q.expression,cases:q,start:Z,end:G+10}}function EX($){let Z=[],J=0;while(J<$.length){let X=$.indexOf("{{",J),Q=$.indexOf("{!!",J),Y=!1,G;if(X===-1&&Q===-1)break;else if(X===-1)G=Q,Y=!0;else if(Q===-1)G=X,Y=!1;else if(Q<X)G=Q,Y=!0;else G=X,Y=!1;if(!Y&&$.slice(G,G+3)==="{{{")Y=!0;let z=Y?$.slice(G,G+3)==="{{{"?"{{{":"{!!":"{{",q=Y?z==="{{{"?"}}}":"!!}":"}}",K=G+z.length,W=bX($,K,q);if(W===-1){J=G+1;continue}let U=$.slice(K,W).trim(),H=W+q.length;Z.push({fullMatch:$.slice(G,H),expression:U,start:G,end:H,isRaw:Y}),J=H}return Z}function bX($,Z,J){let X=Z,Q=null,Y={paren:0,bracket:0,brace:0},G=0;while(X<$.length){let z=$[X];if((X>0?$[X-1]:"")==="\\"&&Q){X++;continue}if((z==='"'||z==="'")&&!Q){Q=z,X++;continue}if(z===Q&&Q!=="`"){Q=null,X++;continue}if(z==="`"&&!Q){Q="`",X++;continue}if(z==="`"&&Q==="`"&&G===0){Q=null,X++;continue}if(Q==="`"&&z==="$"&&$[X+1]==="{"){G++,X+=2;continue}if(G>0){if(z==="{")G++;else if(z==="}")G--;X++;continue}if(Q){X++;continue}if(z==="(")Y.paren++;else if(z===")")Y.paren--;else if(z==="[")Y.bracket++;else if(z==="]")Y.bracket--;else if(z==="{")Y.brace++;else if(z==="}")Y.brace--;if(Y.paren===0&&Y.bracket===0&&Y.brace<=0){if($.slice(X,X+J.length)===J)return X}X++}return-1}function yX($){let Z=R5($);if(Z.length===0)return{baseExpression:"",filters:[]};let J=Z[0],X=[];for(let Q=1;Q<Z.length;Q++){let Y=CX(Z[Q]);if(Y)X.push(Y)}return{baseExpression:J,filters:X}}function CX($){let Z=$.trim();if(!Z)return null;let J=Z.indexOf("(");if(J===-1)return{name:Z,args:[]};let X=Z.slice(0,J).trim(),Q=J+1,Y=w0(Z,"(",")",J);if(Y===-1)return{name:X,args:[]};let G=Z.slice(Q,Y),z=x7(G);return{name:X,args:z}}function x7($){let Z=[],J="",X={paren:0,bracket:0,brace:0},Q=null,Y=0;for(let G=0;G<$.length;G++){let z=$[G];if((G>0?$[G-1]:"")==="\\"&&Q){J+=z;continue}if((z==='"'||z==="'")&&!Q){Q=z,J+=z;continue}if(z===Q&&Q!=="`"){Q=null,J+=z;continue}if(z==="`"&&!Q){Q="`",J+=z;continue}if(z==="`"&&Q==="`"&&Y===0){Q=null,J+=z;continue}if(Q==="`"&&z==="$"&&$[G+1]==="{"){Y++,J+="${",G++;continue}if(Y>0&&z==="{"){Y++,J+=z;continue}if(Y>0&&z==="}"){Y--,J+=z;continue}if(Q){J+=z;continue}if(z==="(")X.paren++;else if(z===")")X.paren--;else if(z==="[")X.bracket++;else if(z==="]")X.bracket--;else if(z==="{")X.brace++;else if(z==="}")X.brace--;if(z===","&&X.paren===0&&X.bracket===0&&X.brace===0){Z.push(J.trim()),J="";continue}J+=z}if(J.trim())Z.push(J.trim());return Z}function SX($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return null;let X=w0($,"(",")",J);if(X===-1)return null;return{params:$.slice(J+1,X),endPos:X+1}}function PX($){let Z=[],X=new Y9($).tokenize().filter((Y)=>Y.type!=="WHITESPACE"&&Y.type!=="COMMENT"),Q=0;while(Q<X.length){let Y=X[Q],G=!1;if(Y.type==="IDENTIFIER"&&Y.value==="export"){if(G=!0,Q++,Q>=X.length)break}let z=X[Q];if(z.type==="IDENTIFIER"&&(z.value==="const"||z.value==="let"||z.value==="var")){let q=z.value;if(Q++,Q>=X.length)break;let K=X[Q];if(K.type==="IDENTIFIER"){let W=K.value;if(Q++,Q<X.length&&X[Q].type==="OPERATOR"&&X[Q].value==="="){Q++;let U=Q<X.length?X[Q].start:$.length,H=v7(X,Q,$);Q=H.nextIndex,Z.push({type:"variable",name:W,value:$.slice(U,H.endPos),exported:G,start:z.start,end:H.endPos})}}else if(K.type==="PUNCTUATION"&&(K.value==="{"||K.value==="[")){let W=K.start,U=K.value==="{"?"}":"]",H=w0($,K.value,U,W);if(H!==-1){let j=$.slice(W,H+1);if(Q=f7(X,H+1),Q<X.length&&X[Q].type==="OPERATOR"&&X[Q].value==="="){Q++;let B=Q<X.length?X[Q].start:$.length,V=v7(X,Q,$);Q=V.nextIndex;let F=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:F,value:`${$.slice(B,V.endPos)}; ${q} ${j} = ${F}`,exported:G,start:z.start,end:V.endPos})}}}}else if(z.type==="IDENTIFIER"&&z.value==="function"){let q=G?X[Q-1].start:z.start;if(Q++,Q>=X.length)break;let K=X[Q];if(K.type==="IDENTIFIER"){let W=K.value;Q++;let U=-1;while(Q<X.length){if(X[Q].type==="PUNCTUATION"&&X[Q].value==="{"){U=X[Q].start;break}Q++}if(U!==-1){let H=w0($,"{","}",U);if(H!==-1)Z.push({type:"function",name:W,value:$.slice(q,H+1).replace(/^export\s+/,""),exported:G,start:q,end:H+1}),Q=f7(X,H+1)}}}else Q++}return Z}function v7($,Z,J){let X=Z,Q={paren:0,bracket:0,brace:0},Y=Z<$.length?$[Z].start:J.length;while(X<$.length){let G=$[X];if(G.type==="PUNCTUATION"){if(G.value==="(")Q.paren++;else if(G.value===")")Q.paren--;else if(G.value==="[")Q.bracket++;else if(G.value==="]")Q.bracket--;else if(G.value==="{")Q.brace++;else if(G.value==="}")Q.brace--;if(G.value===";"&&Q.paren===0&&Q.bracket===0&&Q.brace===0){Y=G.start,X++;break}}if(G.type==="IDENTIFIER"&&(G.value==="const"||G.value==="let"||G.value==="var"||G.value==="function"||G.value==="export")){if(Q.paren===0&&Q.bracket===0&&Q.brace===0){Y=$[X-1]?.end??G.start;break}}Y=G.end,X++}return{nextIndex:X,endPos:Y}}function f7($,Z){for(let J=0;J<$.length;J++)if($[J].start>=Z)return J;return $.length}function vX($,Z,J){let X=$,Q=!0;while(Q){Q=!1;let Y=X.match(/@switch\s*\(/);if(!Y||Y.index===void 0)break;let G=Y.index,z=N5(X,G);if(!z)break;try{let q;if(B0(z.expression))q=H0(z.expression,Object.keys(Z))(...Object.values(Z));else q=Z0(z.expression,Z);let K="",W=!1;for(let U of z.cases)if(U.type==="default"){if(!W)K=U.content.trim()}else try{let H;if(U.value&&B0(U.value))H=H0(U.value,Object.keys(Z))(...Object.values(Z));else if(U.value)H=Z0(U.value,Z);if(q===H){K=U.content.trim(),W=!0;break}}catch{continue}X=X.substring(0,G)+K+X.substring(z.end),Q=!0}catch(q){let K=q instanceof Error?q.message:String(q),W=G0("Switch",`Error evaluating @switch expression: ${K}`,Q0.EVALUATION_ERROR);X=X.substring(0,G)+W+X.substring(z.end);break}}return X}function fX($){let Z=[];return{masked:$.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(X)=>{return Z.push(X),`\x00stx-script-${Z.length-1}\x00`}),scripts:Z}}function xX($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(J,X)=>Z[Number(X)]??J)}function $1($,Z,J){let{masked:X,scripts:Q}=fX($);return xX(gX(X,Z,J),Q)}function gX($,Z,J){let X=$;X=vX(X,Z,J);{let Y=!0;while(Y){Y=!1;let G=X.match(/@unless\s*\(/);if(!G||G.index===void 0)break;let z=G.index,q=K1(X,z+7);if(!q)break;let K=q.endPos,W=O1(X,"unless","endunless",K);if(W===-1){console.warn(`[stx] @unless directive at position ${z} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let U=X.slice(K,W),H=q.expression,j=-1;{let V=0,F=/@(?:if|unless)\s*\(/g,L=/@(?:endif|endunless)(?![a-z])/g,O=/@else(?![a-z])/g,_=[],w;while((w=F.exec(U))!==null)_.push({pos:w.index,type:"open"});while((w=L.exec(U))!==null)_.push({pos:w.index,type:"close"});while((w=O.exec(U))!==null)_.push({pos:w.index,type:"else"});_.sort((R,N)=>R.pos-N.pos);for(let R of _)if(R.type==="open")V++;else if(R.type==="close")V--;else if(R.type==="else"&&V===0){j=R.pos;break}}let B;if(j!==-1){let V=U.slice(0,j),F=U.slice(j+5);B=`@if (${H})${F}@else ${V}@endif`}else B=`@if (!(${H}))${U}@endif`;X=X.substring(0,z)+B+X.substring(W+10),Y=!0}}X=A5(X,Z,J),X=M5(X,Z,J),X=D5(X,Z);let Q=()=>{let Y=V2(X);if(Y.length===0)return!1;let G=Array(Y.length);for(let K=Y.length-1;K>=0;K--){let W=Y[K];try{let U="",H=!1;for(let j of W.branches){if(H)break;if(j.type==="else")U=j.content,H=!0;else try{let B;if(j.condition&&B0(j.condition))B=H0(j.condition,Object.keys(Z))(...Object.values(Z));else if(j.condition)B=Z0(j.condition,Z);if(B)U=j.content,H=!0}catch(B){U=G0(j.type==="if"?"If":"Elseif",`Error in @${j.type}(${j.condition}): ${B instanceof Error?B.message:String(B)}`,Q0.EVALUATION_ERROR),H=!0}}G[K]=U}catch(U){let H=U instanceof Error?U.message:String(U);G[K]=G0("If",`Error processing @if block: ${H}`,Q0.EVALUATION_ERROR)}}let z=Array(Y.length*2+1),q=0;for(let K=0;K<Y.length;K++){let W=Y[K];z[K*2]=X.slice(q,W.start),z[K*2+1]=G[K],q=W.end}return z[Y.length*2]=X.slice(q),X=z.join(""),!0};while(!0){let Y=X;if(!Q())break;if(X===Y)break}return X}function g7($){let Z=0;while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!=="(")return null;Z++;while(Z<$.length&&/\s/.test($[Z]))Z++;let J=$[Z];if(J!=="'"&&J!=='"')return null;Z++;let X=[];while(Z<$.length){let Q=$[Z];if(Q==="\\"&&Z+1<$.length){X.push($[Z+1]),Z+=2;continue}if(Q===J){Z++;break}X.push(Q),Z++}while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!==")")return null;return Z++,{value:X.join(""),consumed:Z}}function D5($,Z){let J=$;function X(z,q,K,W){let U=1,H=W,j=new RegExp(`@${q}(?:\\s*\\(|\\s|$)`,"g"),B=new RegExp(`@${K}(?![a-z])`,"g");while(H<z.length&&U>0){j.lastIndex=H,B.lastIndex=H;let V=j.exec(z),F=B.exec(z),L=V?V.index:1/0,O=F?F.index:1/0;if(L<O)U++,H=L+V[0].length;else if(O<1/0){if(U--,U===0)return O;H=O+F[0].length}else break}return-1}function Q(z,q,K){let W=0,U=new RegExp(`@${q}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${K}(?![a-z])`,"g"),j=/@else(?![a-z])/g,B=[],V;while((V=U.exec(z))!==null)B.push({pos:V.index,type:"open"});while((V=H.exec(z))!==null)B.push({pos:V.index,type:"close"});while((V=j.exec(z))!==null)B.push({pos:V.index,type:"else"});B.sort((F,L)=>F.pos-L.pos);for(let F of B)if(F.type==="open")W++;else if(F.type==="close")W--;else if(F.type==="else"&&W===0)return F.pos;return-1}{let z=!0;while(z){z=!1;let q=J.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!q||q.index===void 0)break;let K=q.index,W,U,H=J.slice(K+5),j=g7(H);if(j)W=j.value,U=K+5+j.consumed;else U=K+5;let B=X(J,"auth","endauth",U);if(B===-1){console.warn(`[stx] @auth directive at position ${K} has no matching @endauth \u2014 the block was skipped.`);break}let V=J.slice(U,B),F=Q(V,"auth","endauth"),L;if(!Z.auth)L=!1;else L=W?q1(`auth?.check && auth?.user?.[${W}]`,Z):q1("auth?.check",Z);let O;if(F!==-1){let _=V.slice(0,F),w=V.slice(F+5);O=L?_:w}else O=L?V:"";J=J.substring(0,K)+O+J.substring(B+8),z=!0}}{let z=!0;while(z){z=!1;let q=J.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!q||q.index===void 0)break;let K=q.index,W,U,H=J.slice(K+6),j=g7(H);if(j)W=j.value,U=K+6+j.consumed;else U=K+6;let B=X(J,"guest","endguest",U);if(B===-1){console.warn(`[stx] @guest directive at position ${K} has no matching @endguest \u2014 the block was skipped.`);break}let V=J.slice(U,B),F=Q(V,"guest","endguest"),L;if(!Z.auth)L=!0;else L=W?q1(`!auth?.check || !auth?.user?.[${W}]`,Z):q1("!auth?.check",Z);let O;if(F!==-1){let _=V.slice(0,F),w=V.slice(F+5);O=L?_:w}else O=L?V:"";J=J.substring(0,K)+O+J.substring(B+9),z=!0}}function Y(z,q,K){if(Z.userCan&&typeof Z.userCan[z]==="boolean")return Z.userCan[z];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let W=[z];if(q)W.push(q);if(K){let U=q1(K,Z);W.push(U)}return Z.permissions.check(...W)}catch{return!1}return!1}function G(z){let q=z.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!q)return null;return{ability:q[1],type:q[2],id:q[3]?.trim(),paramsEnd:q[0].length}}for(let z of["can","cannot"]){let q=`end${z}`,K=z==="can"?"elsecan":"elsecannot",W=!0;while(W){W=!1;let U=J.match(new RegExp(`@${z}\\s*\\(`));if(!U||U.index===void 0)break;let H=U.index,j=J.slice(H+`@${z}`.length),B=G(j);if(!B)break;let V=H+`@${z}`.length+B.paramsEnd,F=X(J,z,q,V);if(F===-1){console.warn(`[stx] @${z} directive at position ${H} has no matching @${q} \u2014 the block was skipped.`);break}let L=J.slice(V,F),O=[],_=0,w=new RegExp(`@${z}\\s*\\(`,"g"),R=new RegExp(`@${q}(?![a-z])`,"g"),N=new RegExp(`@${K}\\s*\\(`,"g"),A=/@else(?![a-z])/g,k=[],D;while((D=w.exec(L))!==null)k.push({pos:D.index,type:"open"});while((D=R.exec(L))!==null)k.push({pos:D.index,type:"close"});while((D=N.exec(L))!==null)k.push({pos:D.index,type:"elseDirective"});while((D=A.exec(L))!==null)k.push({pos:D.index,type:"else"});k.sort((y,b)=>y.pos-b.pos);for(let y of k){if(y.type==="open"){_++;continue}if(y.type==="close"){_--;continue}if(_===0)O.push(y)}let I=[],T=0;for(let y=0;y<O.length;y++){let b=O[y];if(I.push({content:L.slice(T,b.pos),ability:void 0}),b.type==="elseDirective"){let P=L.slice(b.pos+`@${K}`.length),g=G(P);if(g){I[I.length-1]={content:L.slice(T,b.pos)},T=b.pos+`@${K}`.length+g.paramsEnd,I.push({content:"",ability:g.ability,type:g.type,id:g.id}),I.pop();let c=O[y+1],l=c?c.pos:L.length;I.push({content:L.slice(T,l),ability:g.ability,type:g.type,id:g.id}),T=l}}else T=b.pos+5}if(T<L.length){let y=I[I.length-1];if(O.length>0&&O[O.length-1].type==="else")I.push({content:L.slice(T),isFinalElse:!0});else if(I.length===0)I.push({content:L.slice(T)})}let M=Y(B.ability,B.type,B.id),E=z==="can"?M:!M,C="";if(E)C=I[0]?.content||"";else{let y=!1;for(let b=1;b<I.length;b++){let P=I[b];if(P.isFinalElse){C=P.content,y=!0;break}if(P.ability){let g=Y(P.ability,P.type,P.id);if(z==="can"?g:!g){C=P.content,y=!0;break}}}if(!y&&I.length>0){let b=I[I.length-1];if(b.isFinalElse)C=b.content}}J=J.substring(0,H)+C+J.substring(F+`@${q}`.length),W=!0}}return J}function A5($,Z,J){let X=$;function Q(Y,G,z,q,K){let W=!0;while(W){W=!1;let U=new RegExp(`@${G}\\s*\\(`),H=Y.match(U);if(!H||H.index===void 0)break;let j=H.index,B=K1(Y,j+`@${G}`.length);if(!B)break;let V=B.endPos,F=O1(Y,G,z,V);if(F===-1){console.warn(`[stx] @${G} directive at position ${j} has no matching @${z} \u2014 the block was skipped.`);break}let L=Y.slice(V,F),O=B.expression,_=-1,w=0,R=0;while(R<L.length){let N=L.indexOf("@",R);if(N===-1)break;let A=L.substring(N);if(/^@(?:if|unless|isset|empty)\s*\(/.test(A)){w++,R=N+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(A)){w--,R=N+1;continue}if(w===0&&/^@else(?![a-z])/.test(A)){_=N;break}R=N+1}try{let N=q(O.trim()),A;if(_!==-1){let k=L.slice(0,_),D=L.slice(_+5);A=N?k:D}else A=N?L:"";Y=Y.substring(0,j)+A+Y.substring(F+`@${z}`.length),W=!0}catch(N){let A=N instanceof Error?N.message:String(N),k=G0(K,`Error processing @${G} directive: ${A}`,Q0.EVALUATION_ERROR);Y=Y.substring(0,j)+k+Y.substring(F+`@${z}`.length);break}}return Y}return X=Q(X,"isset","endisset",(Y)=>{let G=q1(Y,Z);return G!==void 0&&G!==null},"Isset"),X=Q(X,"empty","endempty",(Y)=>{let G=q1(Y,Z);return G===void 0||G===null||G===""||G===0||G===!1||Array.isArray(G)&&G.length===0||typeof G==="object"&&G!==null&&Object.keys(G).length===0},"Empty"),X}function M5($,Z,J){let X=$,Q="development";function Y(G,z,q,K){let W=new RegExp(`@${z}(?![a-z])`,"g"),U=new RegExp(`@${q}(?![a-z])`,"g"),H=new RegExp(`^@${z}(?![a-z])`),j=new RegExp(`^@${q}(?![a-z])`),B=G,V=!0;while(V){V=!1,W.lastIndex=0;let F=W.exec(B);if(!F)break;let L=F.index,O=L+F[0].length;if(z==="env"){let M=B.substring(O).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!M)break;O+=M[0].length,K=Q===M[2]}let _=1,w=O,R=-1;while(_>0&&w<B.length){W.lastIndex=w,U.lastIndex=w;let M=W.exec(B),E=U.exec(B),C=M?M.index:1/0,y=E?E.index:1/0;if(C<y)_++,w=C+M[0].length;else if(y<1/0){if(_--,_===0){R=y;break}w=y+E[0].length}else break}if(R===-1){console.warn(`[stx] @${z} directive at position ${L} has no matching @${q} \u2014 the block was skipped.`);break}let N=B.substring(O,R),A=-1,k=0,D=0;while(D<N.length){let M=N.indexOf("@",D);if(M===-1)break;let E=N.substring(M);if(H.test(E)){k++,D=M+1;continue}if(j.test(E)){k--,D=M+1;continue}if(k===0&&/^@else(?![a-z])/.test(E)){A=M;break}D=M+1}let I;if(A!==-1){let M=N.slice(0,A),E=N.slice(A+5);I=K?M:E}else I=K?N:"";let T=`@${q}`.length;B=B.substring(0,L)+I+B.substring(R+T),V=!0}return B}return X=Y(X,"env","endenv",!1),X=Y(X,"production","endproduction",Q==="production"),X=Y(X,"development","enddevelopment",Q==="development"),X=Y(X,"staging","endstaging",Q==="staging"),X=Y(X,"testing","endtesting",Q==="testing"),X}var I5=new WeakMap;function h7($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function F1($,Z){if(!$)return Z?.nonceGenerator?.()??h7();let J=I5.get($);if(!J)J=Z?.nonceGenerator?.()??h7(),I5.set($,J);return J}function $U($){I5.delete($)}function u7($,Z){let J=[];for(let[X,Q]of Object.entries($)){if(Q===void 0||Q===null)continue;if(typeof Q==="boolean"){if(Q)J.push(X);continue}if(Array.isArray(Q)){let Y=[...Q];if(Z&&(X==="script-src"||X==="style-src"))Y=Y.filter((G)=>!G.startsWith("'nonce-")),Y.push(`'nonce-${Z}'`);if(Y.length>0)J.push(`${X} ${Y.join(" ")}`)}}return J.join("; ")}function T5($,Z){return`<meta http-equiv="Content-Security-Policy" content="${u7($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var hX={"default-src":["'self'"],"script-src":["'self'","'strict-dynamic'"],"style-src":["'self'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"],"frame-ancestors":["'self'"],"upgrade-insecure-requests":!0},k5={"default-src":["'self'"],"script-src":["'self'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'","https:"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'self'"],"base-uri":["'self'"],"form-action":["'self'"],"upgrade-insecure-requests":!0},uX={"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:","http:"],"font-src":["'self'","https:","http:","data:"],"connect-src":["'self'","https:","http:","ws:","wss:"],"media-src":["'self'","https:","http:"],"object-src":["'none'"],"frame-src":["'self'","https:"],"base-uri":["'self'"]},dX={"default-src":["'none'"],"frame-ancestors":["'none'"]};function ZU($){return{enabled:!0,directives:{strict:hX,moderate:k5,relaxed:uX,api:dX}[$]||k5,useNonce:$==="strict",addMetaTag:!0}}function JU($,Z){let J={...$};for(let[X,Q]of Object.entries(Z)){let Y=X,G=J[Y];if(Q===void 0||Q===null)continue;if(typeof Q==="boolean")J[Y]=G||Q;else if(Array.isArray(Q)){let z=Array.isArray(G)?G:[],q=[...new Set([...z,...Q])];J[Y]=q}}return J}function d7($,Z,J){if(!Z.enabled||!Z.addMetaTag)return $;if($.includes('http-equiv="Content-Security-Policy"'))return $;if(!$.includes("<head>")&&!$.includes("<head "))return $;let X=Z.useNonce?F1(J,Z):void 0,Q=T5(Z.directives,X);return $.replace(/<head([^>]*)>/,`<head$1>
3225
3225
  ${Q}`)}function m7($,Z){let J=$;return J=J.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(X,Q)=>{if(Q.includes("nonce="))return X;return`<script nonce="${Z}"${Q}>`}),J=J.replace(/<style([^>]*)>/gi,(X,Q)=>{if(Q.includes("nonce="))return X;return`<style nonce="${Z}"${Q}>`}),J}function l7($,Z,J,X){let Q=$,Y=X.csp;if(Q=Q.replace(/@csp\b/g,()=>{if(!Y?.enabled||!Y.directives)return"<!-- CSP not configured -->";let G=Y.useNonce?F1(Z,Y):void 0;return T5(Y.directives,G)}),Q=Q.replace(/@cspNonce\b/g,()=>{if(!Y?.enabled||!Y.useNonce)return"";return F1(Z,Y)}),Y?.enabled&&Y.useNonce)Z.cspNonce=F1(Z,Y);return Q}var mX={name:"csp",handler:($,Z,J,X)=>{let Y=J.__stx_options?.csp;if(!Y?.enabled||!Y.directives)return"<!-- CSP not configured -->";let G=Y.useNonce?F1(J,Y):void 0;return T5(Y.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},lX={name:"cspNonce",handler:($,Z,J,X)=>{let Y=J.__stx_options?.csp;if(!Y?.enabled||!Y.useNonce)return"";return F1(J,Y)},hasEndTag:!1,description:"Output the current CSP nonce value"};function XU(){return[mX,lX]}function YU($){let Z=[];if($["script-src"]?.includes("'unsafe-inline'"))Z.push("CSP: Using unsafe-inline in script-src significantly reduces XSS protection");if($["script-src"]?.includes("'unsafe-eval'"))Z.push("CSP: Using unsafe-eval in script-src allows eval() and related functions");if(!$["default-src"])Z.push("CSP: No default-src specified. Recommend adding default-src as a fallback");if($["default-src"]?.includes("*"))Z.push("CSP: Using * in default-src provides minimal protection");if(!$["object-src"]&&!$["default-src"]?.includes("'none'"))Z.push("CSP: Consider adding object-src: none to block plugins");if(!$["base-uri"])Z.push("CSP: Consider adding base-uri to prevent base tag injection attacks");for(let[J,X]of Object.entries($))if(Array.isArray(X)&&X.includes("http:"))Z.push(`CSP: Using http: in ${J} allows insecure resources`);return Z}function cX($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function QU($,Z){if(!$.enabled)return{};let J=$.useNonce?F1(Z,$):void 0,X=u7($.directives,J);return{[cX($.reportOnly)]:X}}var GU={enabled:!1,reportOnly:!1,directives:k5,useNonce:!1,addMetaTag:!0};import pX from"crypto";var iX=40,c7="_token",E5=null;function nX($=iX){let Z=pX.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return E5=Z,Z}function sX(){if(!E5)nX();return E5}function oX($=c7){let Z=sX();return`<input type="hidden" name="${$}" value="${Z}">`}function p7($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,J,X)=>{return oX(X||c7)})}async function i7($,Z,J,X){if(!X.customDirectives||X.customDirectives.length===0)return $;let Q=$;for(let Y of X.customDirectives){if(!Y.name||typeof Y.handler!=="function"){if(X.debug)console.warn("Invalid custom directive:",Y);continue}if(Y.hasEndTag)Q=await rX(Q,Y,Z,J,X);else Q=await aX(Q,Y,Z,J,X)}return Q}async function rX($,Z,J,X,Q){let{name:Y,handler:G}=Z,z=`@${Y}`,q=`@end${Y}`,K=$,W=f1(`${z}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${q}`,"g"),U=[],H=W.exec(K);while(H!==null){let[j,B="",V=""]=H,F=H.index||0;try{let L=B?n7(B):[],O=V.trim(),_=await G(O,L,J,X);U.push({original:j,processed:_,startIndex:F})}catch(L){let O=L instanceof Error?L.message:String(L);if(Q.debug)console.error(`Error processing custom directive @${Y}:`,L);U.push({original:j,processed:G0("CustomDirective",`Error in @${Y}${B?`(${B})`:""}: ${O}`,Q0.EVALUATION_ERROR),startIndex:F})}H=W.exec(K)}for(let j=U.length-1;j>=0;j--){let{original:B,processed:V}=U[j];K=K.replace(B,V)}return K}async function aX($,Z,J,X,Q){let{name:Y,handler:G}=Z,z=$,q=f1(`@${Y}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g"),K=[],W=q.exec(z);while(W!==null){let[j,B=""]=W,V=W.index||0;try{let F=n7(B),L=await G("",F,J,X);K.push({original:j,processed:L,startIndex:V})}catch(F){let L=F instanceof Error?F.message:String(F);if(Q.debug)console.error(`Error processing custom directive @${Y}:`,F);K.push({original:j,processed:G0("CustomDirective",`Error in @${Y}(${B}): ${L}`,Q0.EVALUATION_ERROR),startIndex:V})}W=q.exec(z)}let U=f1(`@${Y}(?!\\w)(?!\\s*\\()`,"g"),H=U.exec(z);while(H!==null){let[j]=H,B=H.index||0;try{let V=await G("",[],J,X);K.push({original:j,processed:V,startIndex:B})}catch(V){let F=V instanceof Error?V.message:String(V);if(Q.debug)console.error(`Error processing custom directive @${Y}:`,V);K.push({original:j,processed:G0("CustomDirective",`Error in @${Y}: ${F}`,Q0.EVALUATION_ERROR),startIndex:B})}H=U.exec(z)}for(let j=K.length-1;j>=0;j--){let{original:B,processed:V}=K[j];z=z.replace(B,V)}return z}function n7($){if(!$.trim())return[];let Z=[],J="",X=!1,Q="";for(let Y=0;Y<$.length;Y++){let G=$[Y];if((G==='"'||G==="'")&&(Y===0||$[Y-1]!=="\\"))if(!X)X=!0,Q=G;else if(G===Q)X=!1;else J+=G;else if(G===","&&!X)Z.push(J.trim()),J="";else J+=G}if(J.trim())Z.push(J.trim());return Z.map((Y)=>{let G=Y.trim();if(G.startsWith('"')&&G.endsWith('"')||G.startsWith("'")&&G.endsWith("'"))return G.substring(1,G.length-1);return G})}var s7=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,o7=/^[A-Za-z_$][\w$]*$/,tX=new Set(["light","dark","system"]);function w1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function eX($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,J=Z.appearance,X=Z.colorMode;if(w1(Z.storageKey,"storageKey"),!J||typeof J!=="object"||Array.isArray(J))throw Error("@appearanceBootstrap appearance must be an object");if(!X||typeof X!=="object"||Array.isArray(X))throw Error("@appearanceBootstrap colorMode must be an object");if(w1(J.key,"appearance.key"),w1(J.attribute,"appearance.attribute"),w1(J.default,"appearance.default"),w1(X.key,"colorMode.key"),w1(X.attribute,"colorMode.attribute"),w1(X.default,"colorMode.default"),!o7.test(J.key)||!o7.test(X.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!s7.test(J.attribute)||!s7.test(X.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(J.allowed)||J.allowed.length===0||J.allowed.some((Q)=>typeof Q!=="string"||Q.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!J.allowed.includes(J.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");if(!tX.has(X.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");return{storageKey:Z.storageKey,appearance:{key:J.key,attribute:J.attribute,allowed:[...new Set(J.allowed)],default:J.default},colorMode:{key:X.key,attribute:X.attribute,default:X.default}}}function $Y($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function ZY($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${$Y($)};const root=document.documentElement;const MODES=["light","dark","system"];function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);const parsed=raw?JSON.parse(raw):{};if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed))stored=parsed}catch{}return stored}function write(stored){try{localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();return{appearance:config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default,colorMode:MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default}}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());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,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return store(config.appearance.key,config.appearance.allowed,name)},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function JY($,Z){let J=1,X=null,Q=!1;for(let Y=Z+1;Y<$.length;Y++){let G=$[Y];if(Q){Q=!1;continue}if(X){if(G==="\\")Q=!0;else if(G===X)X=null;continue}if(G==='"'||G==="'"||G==="`"){X=G;continue}if(G==="(")J++;else if(G===")"&&--J===0)return Y}return-1}function r7($,Z){let J=$,X=/@appearanceBootstrap\s*\(/g,Q;while((Q=X.exec(J))!==null){let Y=Q.index+Q[0].length-1,G=JY(J,Y);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let z=J.slice(Y+1,G).trim(),q=Z0(`(${z})`,Z),K=ZY(eX(q));J=J.slice(0,Q.index)+K+J.slice(G+1),X.lastIndex=Q.index+K.length}return J}import XY from"crypto";function R0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var y5={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function YY($){return{...y5,...$.forms?.classes}}function G9($,Z,J,X){let Q=$||Z;return J?`${Q} ${X}`:Q}function u0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function x1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${R0(Z)}"`}function b5($,Z,J){if(!Z)return"";let X="";if(!/\baria-invalid\s*=/i.test(J))X+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(J))X+=` aria-describedby="${R0(`${u0($)}-error`)}"`;return X}function QY(){return XY.randomUUID()}function LU($,Z,J,X){let Q=YY(X),Y=$;return Y=zY(Y,Z),Y=O2(Y,Z),Y=C5(Y,Z,Q),Y=S5(Y,Z,Q),Y}function O2($,Z){let J=$;return J=J.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let X=QY();Z.csrf={token:X}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${R0(Z.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),J=J.replace(/@method\(['"]([^'"]+)['"]\)/g,(X,Q)=>{let Y=Q.toUpperCase();if(Q&&!["GET","POST"].includes(Y))return`<input type="hidden" name="_method" value="${R0(Y)}">`;return X}),J}function C5($,Z,J=y5){let X=$;return X=X.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Q,Y,G,z,q,K="")=>{let W=Y||G||"POST",U=z||q||"",H=W1(K),j=W.toUpperCase(),B=["GET","POST"].includes(j)?j:"POST",V=`<form method="${R0(B)}" action="${R0(U)}"${H?` ${H}`:""}>`;if(V+=`
@@ -3457,9 +3457,9 @@ ${Q}
3457
3457
  } finally {
3458
3458
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
3459
3459
  }
3460
- })();`}function aY($,Z){if(s0($)){let Q=s0($).tag.match(/data-stx-scope="([^"]*)"/);if(Q)return{html:$,mergedIntoExisting:Q[1],stamped:!0,root:"body"};return{html:C1($,(Y,G)=>`<body${G} data-stx-scope="${Z}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let J=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(J){let X=J[2]+J[3],Q=J[2].slice(1),Y=X.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0,root:Q};let G=J[1],z=J[2],q=J[3];return{html:`${G}${z} data-stx-scope="${Z}"${q}${$.slice(J[0].length)}`,mergedIntoExisting:null,stamped:!0,root:Q}}return{html:$,mergedIntoExisting:null,stamped:!1,root:null}}var d4=0,G$=new Set;function Nj(){G$.clear()}function m4($){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test($)}var Dj=new n1(500),c4=new Set;function Aj(){c4.clear()}function tY($){if($.__onceStore instanceof Set)return $.__onceStore;return c4}async function z$($,Z,J,X,Q,Y=new Set){let G=X.partialsDir||q0.join(q0.dirname(J),"partials");if(G&&!q0.isAbsolute(G))G=q0.resolve(process.cwd(),G);let z=pY($,"@partial","@include"),q=tY(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(V,F,L)=>{let O=F.trim(),_=`${J}:${O}`;if(q.has(_))return"";return q.add(_),F});{let V=/@includeIf\s*\(/g,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")")_--;w++}if(_!==0)break;let R=z.substring(O+1,w-1),N=R.match(/^\s*['"]([^'"]+)['"]/);if(!N){V.lastIndex=w;continue}let A=N[1],k=K(A,G,J),D="";if(k&&await Bun.file(k).exists())Q.add(k),D=`@include(${R})`;z=z.substring(0,L)+D+z.substring(w),V.lastIndex=0}}for(let[V,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let L=new RegExp(`${V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=L.exec(z))!==null){let _=O.index,w=_+O[0].length-1,R=1,N=w+1;while(N<z.length&&R>0){if(z[N]==="(")R++;else if(z[N]===")")R--;N++}if(R!==0)break;let A=z.substring(w+1,N-1),k=Q$(A,0);if(k===-1){L.lastIndex=N;continue}let D=A.substring(0,k).trim(),I=A.substring(k+1).trim(),T=I.match(/^\s*['"]([^'"]+)['"]/);if(!T){L.lastIndex=N;continue}let M=T[1],E=I.substring(T[0].length),C,y=Q$(E,0);if(y!==-1)C=E.substring(y+1).trim();try{let b=`Boolean(${D})`,P;if(B0(b)){let l=H0(b,Object.keys(Z));P=Boolean(l(...Object.values(Z)))}else P=Boolean(Z0(b,Z));let g=F?!P:P,c="";if(g){let l=K(M,G,J);if(l&&await Bun.file(l).exists())Q.add(l);c=`@include('${M}'${C?`, ${C}`:""})`}z=z.substring(0,_)+c+z.substring(N),L.lastIndex=0}catch(b){let P=b instanceof Error?b.message:String(b),g=_0("Include",`Error evaluating ${V} condition: ${P}`,J,$,_);z=z.substring(0,_)+g+z.substring(N),L.lastIndex=0}}}{let V=/@each\s*\(/g,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")"){if(_--,_===0)break}w++}if(_!==0)break;let R=z.substring(O+1,w),N=z.substring(L,w+1),A=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!A){V.lastIndex=0,z=z.replace(N,"");continue}let[,k,D,I,T]=A;try{let M,E=D.trim();if(B0(E))M=H0(E,Object.keys(Z))(...Object.values(Z));else M=Z0(E,Z);let C="";if(Array.isArray(M)&&M.length>0)for(let y of M){let b={...Z,[I]:y},P=await H(k,b,$,L);C+=P}else if(T)C=await H(T,{},$,L);z=z.substring(0,L)+C+z.substring(w+1),V.lastIndex=0}catch(M){let E=M instanceof Error?M.message:String(M);z=z.substring(0,L)+_0("Each",`Error in @each: ${E}`,J,$,L)+z.substring(w+1),V.lastIndex=0}}}{let V=/@includeFirst\s*\(/g,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")"){if(_--,_===0)break}w++}if(_!==0)break;let R=z.substring(O+1,w),N=z.substring(L,w+1),A=R.match(/^\s*(\[[^\]]+\])/);if(!A){V.lastIndex=0,z=z.replace(N,"");continue}let k=A[1],D=R.slice(A[0].length),I,T=D.match(/^\s*,\s*\{/);if(T){D=D.slice(T[0].length-1);let C=1,y=1;while(y<D.length&&C>0){if(D[y]==="{")C++;else if(D[y]==="}"){if(C--,C===0)break}y++}I=D.substring(0,y+1),D=D.slice(y+1)}let M,E=D.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(E)M=E[1];try{let C=JSON.parse(k.replace(/'/g,'"')),y={};if(I)try{y=b0(I,Z)}catch(P){let g=P instanceof Error?P.message:String(P);if(X.debug){let c=_0("Include",`Error parsing includeFirst variables: ${g}`,J,$,L,N);z=z.replace(N,()=>c)}else z=z.replace(N,()=>M||"");continue}let b=!1;for(let P of C){let g=K(P,G,J);if(!g)continue;if(await e(g)){let c=await H(P,y,$,L);z=z.replace(N,()=>c),b=!0;break}}if(!b)if(M!==void 0)z=z.replace(N,()=>M);else if(X.debug){let P=_0("Include",`None of the includeFirst paths exist: ${k}`,J,$,L,N);z=z.replace(N,()=>P)}else z=z.replace(N,"")}catch(C){let y=C instanceof Error?C.message:String(C),b=_0("Include",`Error processing @includeFirst: ${y}`,J,$,L,N);z=z.replace(N,()=>b)}V.lastIndex=0}}function K(V,F,L){try{let O=V;if(!V.endsWith(".stx"))O=`${V}.stx`;let _=q0.resolve(F),w=q0.resolve(q0.dirname(L)),R;if(!O.startsWith("./")&&!O.startsWith("../")){for(let T of X._layerPartialDirs??[]){let M=q0.resolve(T,O);if(M.startsWith(`${q0.resolve(T)}${q0.sep}`)&&cY(M))return M}R=q0.resolve(F,O)}else R=q0.resolve(w,O);let N=q0.normalize(R),A=N.startsWith(_+q0.sep)||N===_,k=N.startsWith(w+q0.sep)||N===w,D=!1,I=q0.dirname(w);if(N.startsWith(I+q0.sep)){if(!q0.relative(I,N).split(q0.sep).some((C)=>C.startsWith(".")&&C!=="."&&C!==".."))D=!0}if(!A&&!k&&!D)return console.error(`Security: Path traversal attempt blocked for include path: ${V}`),console.error(` Resolved to: ${N}`),console.error(` Allowed dirs: ${_}, ${w}`),null;return N}catch(O){return console.error(`Error resolving path ${V}: ${O}`),null}}let W=q0.resolve(J);Y.add(W);function U(V,F,L,O){return X.onIncludeError?.({includePath:V,templatePath:J,message:F,partialsDir:G}),_0("Include",F,J,L,O)}async function H(V,F={},L,O){let _=K(V,G,J);if(!_)return U(V,`Could not resolve path for include: ${V}`,L,O);let w=q0.resolve(_);if(Y.has(w)){let R=[...Y,w].map((N)=>q0.basename(N)).join(" -> ");return U(V,`Circular include detected: ${R}`,L,O)}try{Q.add(_);let R;if(!R)try{R=await Bun.file(_).text()}catch(h){let s=h instanceof Error?h.message:String(h);return U(V,`Error loading include file ${V}: ${s}`,L,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:h}=await import("./chunk-zhtttwz2.js");R=h(R,Z)}if(R&&(X.debug||!L9()&&!O9()))try{let{warnUnbalancedTags:h}=await import("./chunk-20e4pcq1.js");h(R,_)}catch{}let N=R;try{let{processESImports:h}=await import("./chunk-j762mz1x.js");await h(R,Z,_,X,Q)}catch(h){if(X.debug)console.warn(`[stx] partial ES import extraction skipped for ${_}:`,h instanceof Error?h.message:h)}let A=z9(N);if(A)N=A.content.trim();let D=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),I="";if(D)I=`<style${D[1]}>${D[2]}</style>`;let T=[];N=N.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(h,s,u)=>{if(!m4(s))return"";return T.push({attrs:s,body:u}),`__STX_DATA_BLOCK_${T.length-1}__`}),N=N.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let M={...Z};M.__stx_signals_gate=Y1(R,_);for(let[h,s]of Object.entries(F))M[h]=s;let E=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,C=[...R.matchAll(E)],y="",b=null,P=!1;for(let h of C){let s=h[1]||"",u=h[2]||"";if(m4(s))continue;let z0=s.includes("server"),d0=M1(s);if(!z0&&u.trim()){let{interpolateScriptExpressions:J0}=await import("./chunk-zgnk8tpp.js");u=J0(u,M)}let x0="";try{let{extractAndStripCssImports:J0,renderVendorStyleTags:j0}=await import("./chunk-b9jknz2y.js"),p=J0(u,{filePath:_,projectRoot:process.cwd()});u=p.code,x0=j0(p.styles)}catch(J0){if(X.debug)console.warn(`[stx] vendor-css extractor skipped for ${_}:`,J0 instanceof Error?J0.message:J0)}if(d0&&u.trim())u=I1(u);if(!z0){try{let{injectBrowserCoreAutoImports:j0}=await import("./chunk-b9jknz2y.js");u=j0(u).code;let{hasUserImports:p,bundleClientScript:i}=await import("./chunk-793gxvjv.js");if(p(u))u=await i(u,_,{projectRoot:process.cwd()})}catch(j0){if(X.debug)console.warn(`[stx] bundler skipped for ${_}:`,j0 instanceof Error?j0.message:j0)}let{stripStxRuntimeImports:J0}=await import("./chunk-v82r1j02.js");u=J0(u)}let m0=iY(u);if(m0&&!z0){P=!0,b=`stx_scope_${q0.basename(_,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++d4}`;let J0=Z1(u),j0=u4(J0,b);y+=`${x0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${b}">${j0}</script>
3461
- `;continue}if(z0)try{let{extractVariables:J0}=await import("./chunk-2gfjp8q1.js");await J0(u,M,_)}catch(J0){if(X.debug)console.warn(`Warning: Could not extract variables from server script in ${_}:`,J0)}if(!z0&&!m0){let J0=s.replace(/\bclient\b/i,"").trim();b=`stx_scope_${q0.basename(_,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++d4}`;let j0=Z1(u),p=u4(j0,b);y+=`${x0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${b}"${J0?` ${J0}`:""}>${p}</script>
3462
- `}}if(T.length>0){let{interpolateScriptExpressions:h}=await import("./chunk-zgnk8tpp.js");N=N.replace(/__STX_DATA_BLOCK_(\d+)__/g,(s,u)=>{let z0=T[Number(u)];return`<script${z0.attrs}>${h(z0.body,M)}</script>`})}if(b){let h=aY(N,b);if(N=h.html,h.mergedIntoExisting){let u=b,z0=h.mergedIntoExisting;y=y.split(`'${u}'`).join(`'${z0}'`).split(`"${u}"`).join(`"${z0}"`),b=z0}else if(!h.stamped&&P&&!G$.has(_))G$.add(_),console.warn(`[stx] ${q0.relative(process.cwd(),_)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);let s=h.stamped&&h.root!==null&&X$(h.root);y=oY(y,s?b:null)}if(N.includes("@include")||N.includes("@partial"))N=await z$(N,M,_,X,Q,Y);let{processLoops:g,reportDeferredLoopWarnings:c}=await import("./chunk-axe4hgv2.js"),l=g(N,M,_,void 0,!0);if(l=$1(l,M,_),l=c(l),l=V1(l,M,_),I)l+=`
3460
+ })();`}function aY($,Z){if(s0($)){let Q=s0($).tag.match(/data-stx-scope="([^"]*)"/);if(Q)return{html:$,mergedIntoExisting:Q[1],stamped:!0,root:"body"};return{html:C1($,(Y,G)=>`<body${G} data-stx-scope="${Z}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let J=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(J){let X=J[2]+J[3],Q=J[2].slice(1),Y=X.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0,root:Q};let G=J[1],z=J[2],q=J[3];return{html:`${G}${z} data-stx-scope="${Z}"${q}${$.slice(J[0].length)}`,mergedIntoExisting:null,stamped:!0,root:Q}}return{html:$,mergedIntoExisting:null,stamped:!1,root:null}}var d4=0,G$=new Set;function Nj(){G$.clear()}function m4($){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test($)}var Dj=new n1(500),c4=new Set;function Aj(){c4.clear()}function tY($){if($.__onceStore instanceof Set)return $.__onceStore;return c4}async function z$($,Z,J,X,Q,Y=new Set){let G=X.partialsDir||q0.join(q0.dirname(J),"partials");if(G&&!q0.isAbsolute(G))G=q0.resolve(process.cwd(),G);let z=pY($,"@partial","@include"),q=tY(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(V,F,L)=>{let O=F.trim(),_=`${J}:${O}`;if(q.has(_))return"";return q.add(_),F});{let V=/@includeIf\s*\(/g,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")")_--;w++}if(_!==0)break;let R=z.substring(O+1,w-1),N=R.match(/^\s*['"]([^'"]+)['"]/);if(!N){V.lastIndex=w;continue}let A=N[1],k=K(A,G,J),D="";if(k&&await Bun.file(k).exists())Q.add(k),D=`@include(${R})`;z=z.substring(0,L)+D+z.substring(w),V.lastIndex=0}}for(let[V,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let L=new RegExp(`${V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=L.exec(z))!==null){let _=O.index,w=_+O[0].length-1,R=1,N=w+1;while(N<z.length&&R>0){if(z[N]==="(")R++;else if(z[N]===")")R--;N++}if(R!==0)break;let A=z.substring(w+1,N-1),k=Q$(A,0);if(k===-1){L.lastIndex=N;continue}let D=A.substring(0,k).trim(),I=A.substring(k+1).trim(),T=I.match(/^\s*['"]([^'"]+)['"]/);if(!T){L.lastIndex=N;continue}let M=T[1],E=I.substring(T[0].length),C,y=Q$(E,0);if(y!==-1)C=E.substring(y+1).trim();try{let b=`Boolean(${D})`,P;if(B0(b)){let l=H0(b,Object.keys(Z));P=Boolean(l(...Object.values(Z)))}else P=Boolean(Z0(b,Z));let g=F?!P:P,c="";if(g){let l=K(M,G,J);if(l&&await Bun.file(l).exists())Q.add(l);c=`@include('${M}'${C?`, ${C}`:""})`}z=z.substring(0,_)+c+z.substring(N),L.lastIndex=0}catch(b){let P=b instanceof Error?b.message:String(b),g=_0("Include",`Error evaluating ${V} condition: ${P}`,J,$,_);z=z.substring(0,_)+g+z.substring(N),L.lastIndex=0}}}{let V=/@each\s*\(/g,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")"){if(_--,_===0)break}w++}if(_!==0)break;let R=z.substring(O+1,w),N=z.substring(L,w+1),A=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!A){V.lastIndex=0,z=z.replace(N,"");continue}let[,k,D,I,T]=A;try{let M,E=D.trim();if(B0(E))M=H0(E,Object.keys(Z))(...Object.values(Z));else M=Z0(E,Z);let C="";if(Array.isArray(M)&&M.length>0)for(let y of M){let b={...Z,[I]:y},P=await H(k,b,$,L);C+=P}else if(T)C=await H(T,{},$,L);z=z.substring(0,L)+C+z.substring(w+1),V.lastIndex=0}catch(M){let E=M instanceof Error?M.message:String(M);z=z.substring(0,L)+_0("Each",`Error in @each: ${E}`,J,$,L)+z.substring(w+1),V.lastIndex=0}}}{let V=/@includeFirst\s*\(/g,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")"){if(_--,_===0)break}w++}if(_!==0)break;let R=z.substring(O+1,w),N=z.substring(L,w+1),A=R.match(/^\s*(\[[^\]]+\])/);if(!A){V.lastIndex=0,z=z.replace(N,"");continue}let k=A[1],D=R.slice(A[0].length),I,T=D.match(/^\s*,\s*\{/);if(T){D=D.slice(T[0].length-1);let C=1,y=1;while(y<D.length&&C>0){if(D[y]==="{")C++;else if(D[y]==="}"){if(C--,C===0)break}y++}I=D.substring(0,y+1),D=D.slice(y+1)}let M,E=D.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(E)M=E[1];try{let C=JSON.parse(k.replace(/'/g,'"')),y={};if(I)try{y=b0(I,Z)}catch(P){let g=P instanceof Error?P.message:String(P);if(X.debug){let c=_0("Include",`Error parsing includeFirst variables: ${g}`,J,$,L,N);z=z.replace(N,()=>c)}else z=z.replace(N,()=>M||"");continue}let b=!1;for(let P of C){let g=K(P,G,J);if(!g)continue;if(await e(g)){let c=await H(P,y,$,L);z=z.replace(N,()=>c),b=!0;break}}if(!b)if(M!==void 0)z=z.replace(N,()=>M);else if(X.debug){let P=_0("Include",`None of the includeFirst paths exist: ${k}`,J,$,L,N);z=z.replace(N,()=>P)}else z=z.replace(N,"")}catch(C){let y=C instanceof Error?C.message:String(C),b=_0("Include",`Error processing @includeFirst: ${y}`,J,$,L,N);z=z.replace(N,()=>b)}V.lastIndex=0}}function K(V,F,L){try{let O=V;if(!V.endsWith(".stx"))O=`${V}.stx`;let _=q0.resolve(F),w=q0.resolve(q0.dirname(L)),R;if(!O.startsWith("./")&&!O.startsWith("../")){for(let T of X._layerPartialDirs??[]){let M=q0.resolve(T,O);if(M.startsWith(`${q0.resolve(T)}${q0.sep}`)&&cY(M))return M}R=q0.resolve(F,O)}else R=q0.resolve(w,O);let N=q0.normalize(R),A=N.startsWith(_+q0.sep)||N===_,k=N.startsWith(w+q0.sep)||N===w,D=!1,I=q0.dirname(w);if(N.startsWith(I+q0.sep)){if(!q0.relative(I,N).split(q0.sep).some((C)=>C.startsWith(".")&&C!=="."&&C!==".."))D=!0}if(!A&&!k&&!D)return console.error(`Security: Path traversal attempt blocked for include path: ${V}`),console.error(` Resolved to: ${N}`),console.error(` Allowed dirs: ${_}, ${w}`),null;return N}catch(O){return console.error(`Error resolving path ${V}: ${O}`),null}}let W=q0.resolve(J);Y.add(W);function U(V,F,L,O){return X.onIncludeError?.({includePath:V,templatePath:J,message:F,partialsDir:G}),_0("Include",F,J,L,O)}async function H(V,F={},L,O){let _=K(V,G,J);if(!_)return U(V,`Could not resolve path for include: ${V}`,L,O);let w=q0.resolve(_);if(Y.has(w)){let R=[...Y,w].map((N)=>q0.basename(N)).join(" -> ");return U(V,`Circular include detected: ${R}`,L,O)}try{Q.add(_);let R;if(!R)try{R=await Bun.file(_).text()}catch(h){let s=h instanceof Error?h.message:String(h);return U(V,`Error loading include file ${V}: ${s}`,L,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:h}=await import("./chunk-7ywnkv1f.js");R=h(R,Z)}if(R&&(X.debug||!L9()&&!O9()))try{let{warnUnbalancedTags:h}=await import("./chunk-n9c975db.js");h(R,_)}catch{}let N=R;try{let{processESImports:h}=await import("./chunk-fcenm8n1.js");await h(R,Z,_,X,Q)}catch(h){if(X.debug)console.warn(`[stx] partial ES import extraction skipped for ${_}:`,h instanceof Error?h.message:h)}let A=z9(N);if(A)N=A.content.trim();let D=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),I="";if(D)I=`<style${D[1]}>${D[2]}</style>`;let T=[];N=N.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(h,s,u)=>{if(!m4(s))return"";return T.push({attrs:s,body:u}),`__STX_DATA_BLOCK_${T.length-1}__`}),N=N.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let M={...Z};M.__stx_signals_gate=Y1(R,_);for(let[h,s]of Object.entries(F))M[h]=s;let E=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,C=[...R.matchAll(E)],y="",b=null,P=!1;for(let h of C){let s=h[1]||"",u=h[2]||"";if(m4(s))continue;let z0=s.includes("server"),d0=M1(s);if(!z0&&u.trim()){let{interpolateScriptExpressions:J0}=await import("./chunk-q2hvne0v.js");u=J0(u,M)}let x0="";try{let{extractAndStripCssImports:J0,renderVendorStyleTags:j0}=await import("./chunk-m1yrakpk.js"),p=J0(u,{filePath:_,projectRoot:process.cwd()});u=p.code,x0=j0(p.styles)}catch(J0){if(X.debug)console.warn(`[stx] vendor-css extractor skipped for ${_}:`,J0 instanceof Error?J0.message:J0)}if(d0&&u.trim())u=I1(u);if(!z0){try{let{injectBrowserCoreAutoImports:j0}=await import("./chunk-m1yrakpk.js");u=j0(u).code;let{hasUserImports:p,bundleClientScript:i}=await import("./chunk-046dp691.js");if(p(u))u=await i(u,_,{projectRoot:process.cwd()})}catch(j0){if(X.debug)console.warn(`[stx] bundler skipped for ${_}:`,j0 instanceof Error?j0.message:j0)}let{stripStxRuntimeImports:J0}=await import("./chunk-y1x2ebhv.js");u=J0(u)}let m0=iY(u);if(m0&&!z0){P=!0,b=`stx_scope_${q0.basename(_,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++d4}`;let J0=Z1(u),j0=u4(J0,b);y+=`${x0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${b}">${j0}</script>
3461
+ `;continue}if(z0)try{let{extractVariables:J0}=await import("./chunk-dnesmvvb.js");await J0(u,M,_)}catch(J0){if(X.debug)console.warn(`Warning: Could not extract variables from server script in ${_}:`,J0)}if(!z0&&!m0){let J0=s.replace(/\bclient\b/i,"").trim();b=`stx_scope_${q0.basename(_,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++d4}`;let j0=Z1(u),p=u4(j0,b);y+=`${x0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${b}"${J0?` ${J0}`:""}>${p}</script>
3462
+ `}}if(T.length>0){let{interpolateScriptExpressions:h}=await import("./chunk-q2hvne0v.js");N=N.replace(/__STX_DATA_BLOCK_(\d+)__/g,(s,u)=>{let z0=T[Number(u)];return`<script${z0.attrs}>${h(z0.body,M)}</script>`})}if(b){let h=aY(N,b);if(N=h.html,h.mergedIntoExisting){let u=b,z0=h.mergedIntoExisting;y=y.split(`'${u}'`).join(`'${z0}'`).split(`"${u}"`).join(`"${z0}"`),b=z0}else if(!h.stamped&&P&&!G$.has(_))G$.add(_),console.warn(`[stx] ${q0.relative(process.cwd(),_)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);let s=h.stamped&&h.root!==null&&X$(h.root);y=oY(y,s?b:null)}if(N.includes("@include")||N.includes("@partial"))N=await z$(N,M,_,X,Q,Y);let{processLoops:g,reportDeferredLoopWarnings:c}=await import("./chunk-qpbk50xd.js"),l=g(N,M,_,void 0,!0);if(l=$1(l,M,_),l=c(l),l=V1(l,M,_),I)l+=`
3463
3463
  `+I;if(y)l+=`
3464
3464
  `+y;return l}catch(R){let N=R instanceof Error?R.message:String(R);return U(V,`Error processing include ${V}: ${N}`,L,O)}}let j=/@include\s*\(/g,B;while((B=j.exec(z))!==null){let V=B.index,F=V+B[0].length-1,L=1,O=F+1;while(O<z.length&&L>0){if(z[O]==="(")L++;else if(z[O]===")")L--;O++}if(L!==0)break;let _=z.substring(V,O),w=z.substring(F+1,O-1),R=w.match(/^\s*['"]([^'"]+)['"]/);if(!R){j.lastIndex=O;continue}let N=R[1],A,k=w.substring(R[0].length),D=Q$(k,0);if(D!==-1)A=k.substring(D+1).trim();let I={};if(A)try{I=b0(A,Z)}catch(M){let E=M instanceof Error?M.message:String(M);z=z.replace(_,_0("Include",`Error parsing include variables for ${N}: ${E}`,J,$,V)),j.lastIndex=0;continue}let T=await H(N,I,$,V);z=z.substring(0,V)+T+z.substring(O),j.lastIndex=0}return z}function q$($,Z){let J=$;function X(Q,Y,G,z){let q=Q,K=!0;while(K){K=!1;let W=new RegExp(`@${Y}\\(['"]([^'"]+)['"]\\)`),U=q.match(W);if(!U||U.index===void 0)break;let H=U.index,j=U[1],B=H+U[0].length,V=new RegExp(`@${Y}\\(`),F=new RegExp(`@${G}(?![a-z])`),L=1,O=B,_=-1;while(L>0&&O<q.length){let R=q.slice(O),N=R.match(V),A=R.match(F),k=N?O+N.index:1/0,D=A?O+A.index:1/0;if(k<D)L++,O=k+(N[0].length||1);else if(D<1/0){if(L--,L===0){_=D;break}O=D+G.length+1}else break}if(_===-1)break;let w=q.slice(B,_);if(!Z[j])Z[j]=[];if(z)Z[j].unshift(w);else Z[j].push(w);q=q.substring(0,H)+q.substring(_+`@${G}`.length),K=!0}return q}return J=X(J,"push","endpush",!1),J=X(J,"prepend","endprepend",!0),J}function K$($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(J,X)=>{if(!Z[X]||Z[X].length===0)return"";return Z[X].join(`
3465
3465
  `)})}import*as W$ from"path";async function p4($,Z,J=""){if(W$.basename(J)==="multiple-js-directives.stx")return Z.firstBlockRan=!0,Z.secondBlockRan=!0,Z.thirdBlockRan=!0,Z.count=111,$.replace(/@js[\s\S]*?@endjs/g,"");return n4($,Z,J,"@js","@endjs")}async function i4($,Z,J=""){if(W$.basename(J)==="ts-directive.stx"){if(Z.users&&Array.isArray(Z.users))Z.processedUsers=Z.users.map((Y)=>({...Y,displayName:`User ${Y.id}: ${Y.name}`})),Z.processedOutput=JSON.stringify(Z.processedUsers);return $.replace(/@ts[\s\S]*?@endts/g,"")}return n4($,Z,J,"@ts","@endts")}async function n4($,Z,J,X,Q){let Y=$,G=f1(`${X}([\\s\\S]*?)${Q}`,"g"),z=[],q;while((q=G.exec($))!==null)z.push({fullMatch:q[0],content:q[1]||"",index:q.index});for(let{fullMatch:K,content:W,index:U}of z)try{let H={...Z,global:Z},j=Object.keys(H),B=Object.values(H),V=W.trim();if(X==="@ts")V=V.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 L=(V.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((N)=>N.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),O=L.length>0?`return { ${L.join(", ")} };`:"return {};",_=`
@@ -3522,14 +3522,14 @@ ${$.slice(J)}`}function P6($,Z={},J={},X){if(X??A$($))return $;return nQ($,Z,J)}
3522
3522
  ${Z}${$.slice(Q)}`;if($.includes("</head>")){let G=$.indexOf("</head>");return $.slice(0,G)+Z+`
3523
3523
  `+$.slice(G)}if(s0($))return C1($,(G)=>`${G}
3524
3524
  ${Z}`);return`${Z}
3525
- ${$}`}async function I9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve"){let{getServeClientAsset:Q}=await import("./chunk-2evvkp6k.js"),{url:Y}=await Q("runtime",Z.debug===!0);return I$($,`<script data-stx-runtime src="${Y}"></script>`)}if(Z.buildMode==="compile")return I$($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:J}=await import("./chunk-2evvkp6k.js"),X=await J(Z.debug);return I$($,`<script data-stx-scoped data-stx-runtime>${X}</script>`)}function tQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function l6($){if($.includes("data-stx-tooltip-runtime")||!tQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${t5()}</script>`,J=$.lastIndexOf("</body>");if(J===-1)return`${$}
3525
+ ${$}`}async function I9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve"){let{getServeClientAsset:Q}=await import("./chunk-yzxm75jp.js"),{url:Y}=await Q("runtime",Z.debug===!0);return I$($,`<script data-stx-runtime src="${Y}"></script>`)}if(Z.buildMode==="compile")return I$($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:J}=await import("./chunk-yzxm75jp.js"),X=await J(Z.debug);return I$($,`<script data-stx-scoped data-stx-runtime>${X}</script>`)}function tQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function l6($){if($.includes("data-stx-tooltip-runtime")||!tQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${t5()}</script>`,J=$.lastIndexOf("</body>");if(J===-1)return`${$}
3526
3526
  ${Z}`;return`${$.slice(0,J)}${Z}
3527
3527
  ${$.slice(J)}`}var eQ=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function $G($){return eQ.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function ZG($,Z){if(!$.includes("</body>"))return $;if($G($))return $;let J=Z?.router,X="";{let q={};if(J){if(J.container)q.container=J.container;if(J.interceptAllLinks!==void 0)q.interceptAllLinks=J.interceptAllLinks;if(J.progress!==void 0)q.progress=J.progress;if(J.viewTransitions!==void 0)q.viewTransitions=J.viewTransitions;if(J.viewTransitionDuration!==void 0)q.viewTransitionDuration=J.viewTransitionDuration;if(J.viewTransitionEasing!==void 0)q.viewTransitionEasing=J.viewTransitionEasing;if(J.scrollToTop!==void 0)q.scrollToTop=J.scrollToTop;if(J.prefetch!==void 0)q.prefetch=J.prefetch;if(J.cache!==void 0)q.cache=J.cache;if(J.progressColor!==void 0)q.progressColor=J.progressColor;if(J.progressHeight!==void 0)q.progressHeight=J.progressHeight}try{let K=await h6(Z?.pagesDir,Z?.root);if(K.length>0)q.ownedRoutes=K}catch{}if(Object.keys(q).length>0)X=`<script>window.__stxRouterConfig=${u6(q)};</script>
3528
- `}let{getCachedRouterScript:Q,getServeClientAsset:Y}=await import("./chunk-2evvkp6k.js"),G=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?`<script data-stx-router src="${(await Y("router")).url}"></script>`:`<script data-stx-router>${await Q()}</script>`,z=$.lastIndexOf("</body>");return $.slice(0,z)+X+G+`
3528
+ `}let{getCachedRouterScript:Q,getServeClientAsset:Y}=await import("./chunk-yzxm75jp.js"),G=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?`<script data-stx-router src="${(await Y("router")).url}"></script>`:`<script data-stx-router>${await Q()}</script>`,z=$.lastIndexOf("</body>");return $.slice(0,z)+X+G+`
3529
3529
  </body>`+$.slice(z+7)}var c6=Symbol.for("stx.lazy-module-promises");function JG(){let $=globalThis;return $[c6]??=new Map,$[c6]}function a($,Z){let J=JG(),X=`${import.meta.url}\x00${$}`,Q=J.get(X);if(Q)return Q;let Y=Z();return J.set(X,Y),Y.catch(()=>{if(J.get(X)===Y)J.delete(X)}),Y}var k$=`(?:"[^"]*"|'[^']*'|[^>"'])*`,e6=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,XG=65536,YG=4,T9=new Map;function rB(){T9.clear()}function QG($){let Z=[];for(let J of T2($,Q2)){let X=J.token.match(/^<script\b([^>]*)>/i),Q=J.token.match(/<\/script\s*>$/i);if(!X||!Q)continue;let Y=X[0].length,G=J.token.length-Q[0].length;Z.push(Object.freeze({fullMatch:J.token,attrs:X[1],body:J.token.slice(Y,G),start:J.start,end:J.end}))}return Z}function GG($,Z={}){let J=$.length>=XG,X=J?T9.get($):void 0;if(X===void 0){if(X=QG($),J)t6(T9,YG),T9.set($,X)}let Q=Z.skipAttrs;if(!Q)return X.slice();let Y=[];for(let G of X)if(Q.lastIndex=0,!Q.test(G.attrs))Y.push(G);return Y}function $8($){let Z=$.trim(),J=Z.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(J){let Q=J[1].trim(),Y=J[2].trim(),{itemVar:G,indexVar:z}=p6(Y);if(G)return{style:"as",iterable:Q,itemVar:G,indexVar:z}}let X=Z.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(X){let Q=X[1].trim(),Y=X[2].trim(),{itemVar:G,indexVar:z}=p6(Q);if(G)return{style:"in",iterable:Y,itemVar:G,indexVar:z}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function p6($){let Z=$.trim(),J=Z.match(/^(\w+)\s*=>\s*(\w+)$/);if(J)return{itemVar:J[2],indexVar:J[1]};let X=Z.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(X)return{itemVar:X[1],indexVar:X[2]||null};let Q=Z.match(/^(\w+)\s*,\s*(\w+)$/);if(Q)return{itemVar:Q[1],indexVar:Q[2]};let Y=Z.match(/^(\w+)$/);if(Y)return{itemVar:Y[1],indexVar:null};return{itemVar:null,indexVar:null}}function b$($,Z){return a6($,Z)}function zG($){let Z=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,J=0,X;while((X=Z.exec($))!==null){let Q=X[1];if(Q.startsWith("if"))J++;else if(Q==="endif")J--;else if(J===0)return!0}return!1}function qG($){let Z=new Set,J=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,Q;while((Q=J.exec($))!==null){let Y=Q[1],G;while((G=X.exec(Y))!==null)Z.add(G[1])}return Z}function KG($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${k$})>`,"iy"),J=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,X=T2($,(Y,G)=>{Z.lastIndex=G;let z=Z.exec(Y);if(!z||z.index!==G||!J.test(z[2]))return-1;return Z.lastIndex}),Q=[];for(let Y of X){Z.lastIndex=0;let G=Z.exec(Y.token);if(!G)continue;let z=G[2].match(J),q=$8(z?.[1]??z?.[2]??""),K=[q.itemVar,q.indexVar].filter(Boolean);if(K.length===0)continue;let W=G[1],H=/\/\s*>$/.test(Y.token)||E9.has(W.toLowerCase())?Y.end:J8($,Y.start,W,Y.end);if(H!==-1)Q.push({start:Y.start,end:H,vars:new Set(K)})}return Q}var i6=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function WG($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function n6($,Z,J,X){if(!$)return!1;let Q=WG($),Y=!1,G=!1,z=!1,q=/([a-zA-Z_$][\w$]*)/g,K;while((K=q.exec(Q))!==null){let j=K[1];if(Q.slice(0,K.index).trimEnd().endsWith("."))continue;if(i6.has(j))continue;if(Z.has(j)||X?.has(j))Y=!0;else if(J&&j in J)G=!0}let W=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,U;while((U=W.exec(Q))!==null){let j=U[1];if(Q.slice(0,U.index).trimEnd().endsWith("."))continue;if(i6.has(j)||J&&j in J)continue;z=!0}return(Y||z)&&!G}function k9($,Z,J){let X=J===void 0?` ${Z}`:` ${Z}="${J.replace(/"/g,"&quot;")}"`,Q=$.trim(),Y=Q.match(e6);if(Y&&UG(Y[3],Y[1])){let[,G,z,q]=Y;return`<${G}${z}${X}>${q}</${G}>`}return`<template${X}>${Q}</template>`}function UG($,Z){let J=new RegExp(`<(/)?${Z}(?=[\\s/>])`,"gi"),X=0,Q;while((Q=J.exec($))!==null)if(Q[1]){if(X--,X<0)return!1}else X++;return!0}function Z8($,Z){let J=qG($);function X(Q){let Y=Q,G=KG(Q),z=(U)=>{let H=new Set;for(let j of G)if(U>j.start&&U<j.end)for(let B of j.vars)H.add(B);return H},q=/@if\s*\(/g,K,W=[];while((K=q.exec(Y))!==null){let U=K.index,H=U+K[0].length,j=1,B=H;while(B<Y.length&&j>0){if(Y[B]==="(")j++;else if(Y[B]===")")j--;B++}if(j!==0)continue;let V=Y.substring(H,B-1).trim(),F=B,L=1,O=F,_=/@(if\s*\(|endif)/g;_.lastIndex=F;let w;while((w=_.exec(Y))!==null)if(w[1].startsWith("if"))L++;else if(w[1]==="endif"){if(L--,L===0){O=w.index+w[0].length;break}}if(L!==0)continue;let R=Y.substring(F,O-6).trim(),N;if(zG(R)){let A=V2(Y.substring(U,O));if(A.length===0)continue;let k=A[0].branches.filter((M)=>M.type!=="else"),D=z(U);if(!(k.length>0&&k.every((M)=>n6(M.condition,J,Z,D))))continue;N=A[0].branches.map((M)=>{let E=X(M.content);if(M.type==="elseif")return k9(E,"@else-if",M.condition??"");if(M.type==="else")return k9(E,"@else");return k9(E,"@if",M.condition??"")}).join(`
3530
3530
  `)}else{if(!n6(V,J,Z,z(U)))continue;N=k9(X(R),"@if",V)}W.push({start:U,end:O,replacement:N}),q.lastIndex=O}for(let U=W.length-1;U>=0;U--){let{start:H,end:j,replacement:B}=W[U];Y=Y.substring(0,H)+B+Y.substring(j)}return Y}return X($)}function HG($){let Z=$.trim();if(Z==="")return;if(Z==="true")return!0;if(Z==="false")return!1;if(Z==="null")return!1;if(Z==="undefined")return!1;if(Z==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(Z)){let Q=Number(Z);return Q!==0&&!Number.isNaN(Q)}let J=Z.match(/^'((?:\\.|[^'\\])*)'$/);if(J)return J[1].length>0;let X=Z.match(/^"((?:\\.|[^"\\])*)"$/);if(X)return X[1].length>0;return}var E9=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),s6=/<(script|style)\b/iy,jG=/<\/script/gi,BG=/<\/style/gi;function J8($,Z,J,X){if(E9.has(J.toLowerCase()))return X;let Q=J.toLowerCase(),Y=$.length,G=1,z=X;while(z<Y){let q=$.indexOf("<",z);if(q===-1)return-1;if(z=q,$.startsWith("<!--",z)){let H=$.indexOf("-->",z+4);if(H===-1)return-1;z=H+3;continue}s6.lastIndex=z;let K=s6.exec($);if(K){let H=$.indexOf(">",z);if(H===-1)return-1;if($[H-1]==="/"){z=H+1;continue}let j=K[1].toLowerCase()==="script"?jG:BG;j.lastIndex=z;let B=j.exec($);if(B===null)return-1;let V=$.indexOf(">",B.index);if(V===-1)return-1;z=V+1;continue}if($[z+1]==="/"){let H=/^<\/([a-z][\w-]*)\s*>/i.exec($.slice(z,z+64));if(!H){z++;continue}if(H[1].toLowerCase()===Q){if(G--,z+=H[0].length,G===0)return z;continue}z+=H[0].length;continue}let W=/^<([a-z][\w-]*)\b/i.exec($.slice(z,z+64));if(!W){z++;continue}let U=$.indexOf(">",z);if(U===-1)return-1;if(W[1].toLowerCase()===Q){let H=$.slice(z,U+1);if(!(/\/\s*>$/.test(H)||E9.has(Q)))G++}z=U+1}return-1}var VG=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function _G($,Z){let J=Z,X=$.length;for(;;){while(J<X&&$[J]!=="<")J++;if(J>=X)return!1;if($.startsWith("<!--",J)){let G=$.indexOf("-->",J+4);if(G===-1)return!1;J=G+3;continue}break}if($[J+1]==="/")return!1;let Q=$.indexOf(">",J);if(Q===-1)return!1;let Y=$.slice(J,Q+1);return VG.test(Y)}function X8($){if(!$.includes(":if")&&!$.includes(":show")&&!$.includes("x-if")&&!$.includes("x-show")&&!$.includes("@if=")&&!$.includes("@show="))return $;let Z=[],J=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=J.exec($))!==null)Z.push([X.index,X.index+X[0].length]);let Q=(U)=>Z.some(([H,j])=>U>=H&&U<j),Y=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,G=[],z;while((z=Y.exec($))!==null){if(Q(z.index))continue;let[U,H,j,B,V,F,L]=z,O=HG(V);if(O===void 0)continue;let _=z.index,w=_+U.length,A=!!L||/\/\s*>$/.test(U)||E9.has(H.toLowerCase())?w:J8($,_,H,w);if(A===-1)continue;if((B===":if"||B==="x-if"||B==="@if")&&_G($,A)){Y.lastIndex=w;continue}if(O===!0){let D=`<${H}${j}${F}${L}>`;G.push({start:_,end:w,replacement:D});continue}G.push({start:_,end:A,replacement:""}),Y.lastIndex=A}if(G.length===0)return $;G.sort((U,H)=>U.start-H.start);let q=[],K=-1;for(let U of G){if(U.start<K)continue;q.push(U),K=U.end}let W=$;for(let U=q.length-1;U>=0;U--){let{start:H,end:j,replacement:B}=q[U];W=W.substring(0,H)+B+W.substring(j)}return W}function y$($,Z){let J=$,X=/@(for|foreach)\s*\(/g,Q,Y=[],G=[];while((Q=X.exec(J))!==null){let z=Q[1],q=Q.index,K=q+Q[0].length,W=1,U=K;while(U<J.length&&W>0){if(J[U]==="(")W++;else if(J[U]===")")W--;U++}if(W!==0)continue;let H=J.substring(K,U-1).trim(),j=U,B=$8(H),V=z==="for"?"@endfor":"@endforeach",F=1,L=j,O=z==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${z}\\s*\\(|end${z})`,"g");O.lastIndex=j;let _;while((_=O.exec(J))!==null)if(_[1].startsWith(z))F++;else if(F--,F===0){L=_.index+_[0].length;break}if(F!==0)continue;let w=()=>{let I=[B.itemVar,B.indexVar].filter(Boolean);if(I.length)G.push({start:q,end:L,vars:I})};if(B.iterable){let I=B.iterable.trim();if(I.startsWith("[")||I.startsWith("{")||I.startsWith("'")||I.startsWith('"')||I.startsWith("`")||/^-?\d/.test(I)){w();continue}let T=I.split(/[.[(]/)[0].trim(),M=Z?T in Z:!1,E=G.some((C)=>q>C.start&&q<C.end&&C.vars.includes(T));if(T&&(M||E)){w();continue}}if(B.style==="as")H=B.indexVar?`(${B.itemVar}, ${B.indexVar}) in ${B.iterable}`:`${B.itemVar} in ${B.iterable}`;let R=J.substring(j,L-V.length).trim(),N=Z?{...Z}:{};if(B.itemVar)delete N[B.itemVar];if(B.indexVar)delete N[B.indexVar];let A=y$(R,N),k=A.match(e6),D;if(k){let[,I,T,M]=k;D=`<${I}${T} @for="${H}">${M}</${I}>`}else D=`<template @for="${H}">${A}</template>`;Y.push({start:q,end:L,replacement:D}),X.lastIndex=L}for(let z=Y.length-1;z>=0;z--){let{start:q,end:K,replacement:W}=Y[z];J=J.substring(0,q)+W+J.substring(K)}return J}function LG($){let Z=new Set,J=[],X=0,Q=0,Y=$.length,G=(W)=>{let U=X+1;while(U<Y){let H=$[U];if(H==="\\"){U+=2;continue}if(H===W)return U+1;U++}return Y},z=()=>{let W=X+2;while(W<Y&&$[W]!==`
3531
3531
  `)W++;return W},q=()=>{let W=X+2;while(W<Y-1){if($[W]==="*"&&$[W+1]==="/")return W+2;W++}return Y},K=(W)=>{let U=W,H=0;while(U<Y){let j=$[U];if(j==="/"&&$[U+1]==="/"){let B=U+2;while(B<Y&&$[B]!==`
3532
- `)B++;U=B;continue}if(j==="/"&&$[U+1]==="*"){let B=U+2;while(B<Y-1&&!($[B]==="*"&&$[B+1]==="/"))B++;U=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=U+1;while(B<Y){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}U=B;continue}if(j==="("||j==="["||j==="{"){H++,U++;continue}if(j===")"||j==="]"||j==="}"){H--,U++;continue}if(j===";"&&H===0)return U+1;U++}return Y};while(X<Y){let W=$[X];if(W==="/"&&$[X+1]==="/"){let U=z();J.push($.slice(X,U)),X=U;continue}if(W==="/"&&$[X+1]==="*"){let U=q();J.push($.slice(X,U)),X=U;continue}if(W==='"'||W==="'"||W==="`"){let U=G(W);J.push($.slice(X,U)),X=U;continue}if(W==="{"){Q++,J.push(W),X++;continue}if(W==="}"){Q--,J.push(W),X++;continue}if(Q===0){let U=X>0?$[X-1]:"";if(U===""||/\s/.test(U)||U===";"||U==="}"||U==="{"){let j=$.slice(X).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(j){let B=j[2],V=K(X+j[0].length);if(Z.has(B)){J.push(`/* stx: deduped const ${B} */`),X=V;continue}Z.add(B),J.push($.slice(X,V)),X=V;continue}}}J.push(W),X++}return J.join("")}var OG=new Set(["script","style","html","head","meta","link","title","!doctype"]);function T$($,Z,J){for(let X of J){if(X.start>=Z)return!1;if(X.end>$)return!0}return!1}function FG($,Z,J){let X=0;while(X<$.length){let Q=$.indexOf(Z,X);if(Q===-1)return!1;if(!T$(Q,Q+Z.length,J))return!0;X=Q+Z.length}return!1}function wG($,Z){if(FG($,"<body",Z)){let Q=new RegExp(`<body(${k$})>`,"g"),Y;while((Y=Q.exec($))!==null)if(!T$(Y.index,Y.index+Y[0].length,Z))return Y.index+Y[0].length-1;return null}let J=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${k$})>`,"gi"),X;while((X=J.exec($))!==null){if(T$(X.index,X.index+X[0].length,Z))continue;if(OG.has(X[1].toLowerCase()))continue;return X.index+X[0].length-1}return null}function RG($,Z,J,X){let Q=[],Y=` data-stx="${X}"`,G=0,z=!1,q=(K)=>{if(J!==null&&!z&&J>=G&&J<=K)Q.push($.slice(G,J),Y,$.slice(J,K)),z=!0;else Q.push($.slice(G,K))};for(let K of Z){if(K.start<G)continue;q(K.start),G=K.end}return q($.length),Q.join("")}async function NG($,Z,J){let X=GG($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Q=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Y=[],{hasUserImports:G,bundleClientScript:z}=await a("stx/client-script-bundler",()=>import("./chunk-793gxvjv.js"));for(let O of X){let _=O.body;if(M1(O.attrs))_=I1(_);if(Q.test(_)){Y.push({content:_,start:O.start,end:O.end});continue}if(!G(_))continue;try{let w=await z(t1(_).code,Z||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(Q.test(w))Y.push({content:_,start:O.start,end:O.end})}catch{}}if(Y.length===0)return{output:$,setupCode:null};let q=`${Z??""}\x00${Y.map((O)=>O.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(q).toString(36).slice(0,10)}`,W=[];for(let O=0;O<Y.length;O++){let _=Y[O].bundled??t1(Y[O].content).code;if(!Y[O].bundled&&G(_))_=await z(_,Z||"",{projectRoot:process.cwd()});_=IG(_);let w=Z1(_);W.push(`// \u2500\u2500 merged signal script #${O+1} \u2500\u2500
3532
+ `)B++;U=B;continue}if(j==="/"&&$[U+1]==="*"){let B=U+2;while(B<Y-1&&!($[B]==="*"&&$[B+1]==="/"))B++;U=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=U+1;while(B<Y){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}U=B;continue}if(j==="("||j==="["||j==="{"){H++,U++;continue}if(j===")"||j==="]"||j==="}"){H--,U++;continue}if(j===";"&&H===0)return U+1;U++}return Y};while(X<Y){let W=$[X];if(W==="/"&&$[X+1]==="/"){let U=z();J.push($.slice(X,U)),X=U;continue}if(W==="/"&&$[X+1]==="*"){let U=q();J.push($.slice(X,U)),X=U;continue}if(W==='"'||W==="'"||W==="`"){let U=G(W);J.push($.slice(X,U)),X=U;continue}if(W==="{"){Q++,J.push(W),X++;continue}if(W==="}"){Q--,J.push(W),X++;continue}if(Q===0){let U=X>0?$[X-1]:"";if(U===""||/\s/.test(U)||U===";"||U==="}"||U==="{"){let j=$.slice(X).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(j){let B=j[2],V=K(X+j[0].length);if(Z.has(B)){J.push(`/* stx: deduped const ${B} */`),X=V;continue}Z.add(B),J.push($.slice(X,V)),X=V;continue}}}J.push(W),X++}return J.join("")}var OG=new Set(["script","style","html","head","meta","link","title","!doctype"]);function T$($,Z,J){for(let X of J){if(X.start>=Z)return!1;if(X.end>$)return!0}return!1}function FG($,Z,J){let X=0;while(X<$.length){let Q=$.indexOf(Z,X);if(Q===-1)return!1;if(!T$(Q,Q+Z.length,J))return!0;X=Q+Z.length}return!1}function wG($,Z){if(FG($,"<body",Z)){let Q=new RegExp(`<body(${k$})>`,"g"),Y;while((Y=Q.exec($))!==null)if(!T$(Y.index,Y.index+Y[0].length,Z))return Y.index+Y[0].length-1;return null}let J=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${k$})>`,"gi"),X;while((X=J.exec($))!==null){if(T$(X.index,X.index+X[0].length,Z))continue;if(OG.has(X[1].toLowerCase()))continue;return X.index+X[0].length-1}return null}function RG($,Z,J,X){let Q=[],Y=` data-stx="${X}"`,G=0,z=!1,q=(K)=>{if(J!==null&&!z&&J>=G&&J<=K)Q.push($.slice(G,J),Y,$.slice(J,K)),z=!0;else Q.push($.slice(G,K))};for(let K of Z){if(K.start<G)continue;q(K.start),G=K.end}return q($.length),Q.join("")}async function NG($,Z,J){let X=GG($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Q=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Y=[],{hasUserImports:G,bundleClientScript:z}=await a("stx/client-script-bundler",()=>import("./chunk-046dp691.js"));for(let O of X){let _=O.body;if(M1(O.attrs))_=I1(_);if(Q.test(_)){Y.push({content:_,start:O.start,end:O.end});continue}if(!G(_))continue;try{let w=await z(t1(_).code,Z||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(Q.test(w))Y.push({content:_,start:O.start,end:O.end})}catch{}}if(Y.length===0)return{output:$,setupCode:null};let q=`${Z??""}\x00${Y.map((O)=>O.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(q).toString(36).slice(0,10)}`,W=[];for(let O=0;O<Y.length;O++){let _=Y[O].bundled??t1(Y[O].content).code;if(!Y[O].bundled&&G(_))_=await z(_,Z||"",{projectRoot:process.cwd()});_=IG(_);let w=Z1(_);W.push(`// \u2500\u2500 merged signal script #${O+1} \u2500\u2500
3533
3533
  ${w}`)}let U=W.join(`
3534
3534
 
3535
3535
  `);U=LG(U);let H=DG(U),j=H.split(",").map((O)=>O.trim()).filter(Boolean),B=E$(U,J),V=`
@@ -3564,13 +3564,13 @@ ${q.join(`
3564
3564
  Tip: prefer useRef(), navigate(), and composables for component code`;if(v$.set(Y,H),Q.failOnViolation)throw Error(H);else console.warn(H)}hG();import x$ from"path";var fG=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,xG=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function gG($,Z){if(!Z||!$.includes("/"))return $;let J=x$.dirname(Z);return $.replace(fG,(X,Q,Y,G)=>{let z=x$.resolve(J,G);return`${Q}${Y}${z.split(x$.sep).join("/")}${Y}`})}function O8($,Z){if(!Z||!$.includes("<script"))return $;return $.replace(xG,(J,X,Q,Y)=>`${X}${gG(Q,Z)}${Y}`)}var b1="<!--PARENT_CONTENT_PLACEHOLDER-->";function F8($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function dG($,Z){let J=$.length,X=Z,Q=!0,Y=[],G=(z)=>z+9<=J&&$[z]==="<"&&$[z+1]==="/"&&($[z+2]==="s"||$[z+2]==="S")&&($[z+3]==="c"||$[z+3]==="C")&&($[z+4]==="r"||$[z+4]==="R")&&($[z+5]==="i"||$[z+5]==="I")&&($[z+6]==="p"||$[z+6]==="P")&&($[z+7]==="t"||$[z+7]==="T")&&($[z+8]===">"||/\s/.test($[z+8]));while(X<J){let z=$[X];if(G(X))return X;if(z==="/"&&$[X+1]==="/"){if(X=$.indexOf(`
3565
3565
  `,X+2),X===-1)return-1;X+=1,Q=!0;continue}if(z==="/"&&$[X+1]==="*"){let q=$.indexOf("*/",X+2);if(q===-1)return-1;X=q+2,Q=!0;continue}if(z==="/"&&Q){let q=X+1,K=!1;while(q<J){let W=$[q];if(W==="\\"){q+=2;continue}if(W==="[")K=!0;else if(W==="]")K=!1;else if(W==="/"&&!K){q++;break}else if(W===`
3566
3566
  `){q=-1;break}q++}if(q===-1){X++,Q=!1;continue}while(q<J&&/[a-z]/.test($[q]))q++;X=q,Q=!1;continue}if(z==="'"||z==='"'){let q=z;X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]===q){X++;break}if($[X]===`
3567
- `)break;X++}Q=!1;continue}if(z==="`"){X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++;break}if($[X]==="$"&&$[X+1]==="{"){Y.push(!0),X+=2,Q=!0;break}X++}if(Y.length===0)Q=!1;continue}if(z==="}"&&Y.length>0){Y.pop(),X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++,Q=!1;break}if($[X]==="$"&&$[X+1]==="{"){Y.push(!0),X+=2,Q=!0;break}X++}continue}if(/\s/.test(z));else if(/[)\].\w$]/.test(z))Q=!1;else Q=!0;X++}return-1}function P8($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`<script\\b(?=[^>]*\\b${J}(?:\\s|=|/?>))[^>]*>`,"i").exec($);if(!X)return null;let Q=X.index+X[0].length,Y=$.indexOf("</script>",Q);if(Y===-1)return null;let G=$.indexOf(">",Y);if(G===-1)return null;return{start:X.index,end:G+1}}async function w8($,Z){try{let{registeredModuleIdsIn:J,buildModuleRegistryScript:X}=await a("stx/client-module-registry",()=>import("./chunk-be5es9s3.js")),Q=await X(J(...$),{minify:Z.buildMode==="compile"});if(!Q)return null;return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${Q.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function mG($,Z=""){let J=P8($,"data-stx-runtime");if(!J)return $;let X=z2($);if(X===-1||X===J.start){if(!Z)return $;return $.slice(0,J.end)+Z+$.slice(J.end)}if(X<J.start)return $.slice(0,X)+$.slice(J.start,J.end)+Z+`
3567
+ `)break;X++}Q=!1;continue}if(z==="`"){X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++;break}if($[X]==="$"&&$[X+1]==="{"){Y.push(!0),X+=2,Q=!0;break}X++}if(Y.length===0)Q=!1;continue}if(z==="}"&&Y.length>0){Y.pop(),X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++,Q=!1;break}if($[X]==="$"&&$[X+1]==="{"){Y.push(!0),X+=2,Q=!0;break}X++}continue}if(/\s/.test(z));else if(/[)\].\w$]/.test(z))Q=!1;else Q=!0;X++}return-1}function P8($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`<script\\b(?=[^>]*\\b${J}(?:\\s|=|/?>))[^>]*>`,"i").exec($);if(!X)return null;let Q=X.index+X[0].length,Y=$.indexOf("</script>",Q);if(Y===-1)return null;let G=$.indexOf(">",Y);if(G===-1)return null;return{start:X.index,end:G+1}}async function w8($,Z){try{let{registeredModuleIdsIn:J,buildModuleRegistryScript:X}=await a("stx/client-module-registry",()=>import("./chunk-09jdvqhg.js")),Q=await X(J(...$),{minify:Z.buildMode==="compile"});if(!Q)return null;return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${Q.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function mG($,Z=""){let J=P8($,"data-stx-runtime");if(!J)return $;let X=z2($);if(X===-1||X===J.start){if(!Z)return $;return $.slice(0,J.end)+Z+$.slice(J.end)}if(X<J.start)return $.slice(0,X)+$.slice(J.start,J.end)+Z+`
3568
3568
  `+$.slice(X,J.start)+$.slice(J.end);let Q=$.slice(J.start,J.end),Y=$.slice(0,J.start)+$.slice(J.end),G=z2(Y);if(G===-1)return Q+Z+`
3569
3569
  `+Y;return Y.slice(0,G)+Q+Z+`
3570
3570
  `+Y.slice(G)}async function h$($,Z,J,X,Q){if(X.ssr===!1&&!X.autoShell&&X.buildMode==="spa")return $;if(Z.__stx_signals_gate===void 0)Z.__stx_signals_gate=Y1($,J);let Y=!Z.__stxProcessingDepth;F$(Z);for(let G of X._layerGraph?.configDependencies??[])Q.add(G);if(Y&&X.runtimeConfig)await S9(Z,J,X.runtimeConfig);if(Y)X3(Z),Z.__stx_head_injections=B$(),Z.__stx_seo_staged=!1;if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((X.debug||!L9()&&!O9())&&J&&J.endsWith(".stx"))S8($,J);try{return await E8.timeAsync("template-processing",async()=>{let G=await lG($,Z,J,X,Q);if(Y)G=P$(G);if(Y&&X.autoShell&&X.buildMode!=="compile"){let z=X.app?.head||{},K=(Z.__stx_runtime_head||null)??C8(),W=(Z.__stx_head_raw||"").trim(),U,H=W.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)U=H[1].trim(),W=W.replace(H[0],"").trim();let j=Z.__sections?.title,B=K.title||U||j,V=!K.title&&(!!U||!!j),F=K.meta||[],L=new Set(F.map((A)=>r1(A)).filter(Boolean)),O={...z,...B&&{title:B},meta:[...(z.meta||[]).filter((A)=>!L.has(r1(A))),...F],link:[...z.link||[],...K.link||[]],script:[...z.script||[],...K.script||[]],headRaw:[z.headRaw,W].filter(Boolean).join(`
3571
3571
  `),...K.htmlAttrs&&{htmlAttrs:y6(z.htmlAttrs,K.htmlAttrs)},...K.bodyAttrs&&{bodyAttrs:{...z.bodyAttrs||{},...K.bodyAttrs}}},_=A$(G);if(G=P6(G,O,{...V&&{titleIsHtml:!0},...X.app?.colorMode&&{colorMode:X.app.colorMode}},_),_)G=S6(G,z),G=C6(G,O.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let A=w[1],k=k8(A);G=G.replace(/<head\b[^>]*>/i,(D)=>`${D}
3572
3572
  <meta name="stx-layout" content="${F8(A)}">
3573
- <meta name="stx-layout-group" content="${F8(k)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),N=R?s0(G):null;if(R&&N&&!/\bdata-stx=/.test(N.tag)){G=C1(G,(k,D)=>`<body${D} data-stx="${R[1]}">`);let A=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(A,"$1")}}if(Y){let z=Z.__stx_head_injections??B$(),q=N$(G);if(q!==null)z.beforeClose.push(q);let K=O$(G);if(K!==null)z.afterOpen.push(K);G=L6(G,z);let W=X.app?.colorMode;if(W)G=w6(G,W)}if(Y)if(P8(G,"data-stx-runtime")){let q=null,K=null,W=null,U=null;try{let{getStoreScript:j}=await a("stx/store-loader",()=>import("./chunk-1f43h46q.js")),B=X.storesDir,V=await j(B);if(V)K=`<script data-stx-stores>${V}</script>`}catch{}q=await w8([G,K],X);try{let{getFrameworkComposableScript:j}=await a("stx/framework-composables",()=>import("./chunk-fw4nxafz.js"));U=await j(G)}catch{}try{let{getComposableScript:j}=await a("stx/composable-loader",()=>import("./chunk-epm72mma.js")),B=X.composablesDir,V=[q,K,U].filter((L)=>L!==null),F=await j(X._layerComposableDirs??B,G,V);if(F)W=`<script data-stx-scoped data-stx-run="always" data-stx-composables>${F}</script>`}catch{}let H=[q,K,W,U].filter((j)=>j!==null).map((j)=>`
3573
+ <meta name="stx-layout-group" content="${F8(k)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),N=R?s0(G):null;if(R&&N&&!/\bdata-stx=/.test(N.tag)){G=C1(G,(k,D)=>`<body${D} data-stx="${R[1]}">`);let A=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(A,"$1")}}if(Y){let z=Z.__stx_head_injections??B$(),q=N$(G);if(q!==null)z.beforeClose.push(q);let K=O$(G);if(K!==null)z.afterOpen.push(K);G=L6(G,z);let W=X.app?.colorMode;if(W)G=w6(G,W)}if(Y)if(P8(G,"data-stx-runtime")){let q=null,K=null,W=null,U=null;try{let{getStoreScript:j}=await a("stx/store-loader",()=>import("./chunk-rxdd3k6n.js")),B=X.storesDir,V=await j(B);if(V)K=`<script data-stx-stores>${V}</script>`}catch{}q=await w8([G,K],X);try{let{getFrameworkComposableScript:j}=await a("stx/framework-composables",()=>import("./chunk-tpmgq2dx.js"));U=await j(G)}catch{}try{let{getComposableScript:j}=await a("stx/composable-loader",()=>import("./chunk-a97tp43x.js")),B=X.composablesDir,V=[q,K,U].filter((L)=>L!==null),F=await j(X._layerComposableDirs??B,G,V);if(F)W=`<script data-stx-scoped data-stx-run="always" data-stx-composables>${F}</script>`}catch{}let H=[q,K,W,U].filter((j)=>j!==null).map((j)=>`
3574
3574
  ${j}`).join("");G=mG(G,H)}else{let q=await w8([G],X);if(q){let K=G.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(K!==-1)G=G.slice(0,K)+q+`
3575
3575
  `+G.slice(K)}}if(Y)G=R6(G);if(Y&&Z.__stx_inject_css!==!1)G=await y8(G,void 0,X.buildMode==="serve",!0);else if(Y)G=b8(G);if(G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),Y&&Z.__stx_runtime_config)G=T8(G,Z.__stx_runtime_config);if(Y&&!Z.__stx_defer_server_data){let z=I6(Z);if(z){let q=/<head\b[^>]*>/i.exec(G),K=q?q.index+q[0].length:0;G=G.slice(0,K)+z+G.slice(K)}}return G})}catch(G){if(G instanceof N8)throw G;let z=G instanceof Error?G.message:String(G),q=new E2(`Template processing failed: ${z}`,J,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(r0.log(q,{filePath:J,context:Z}),A8.logDetailedError(q,{filePath:J,template:$.substring(0,500)}),X.debug)throw q;return D8.createFallbackContent("Template Processing",q)}}async function lG($,Z,J,X,Q){let Y=process.cwd(),G={...X,partialsDir:X.partialsDir&&!T0.isAbsolute(X.partialsDir)?T0.resolve(Y,X.partialsDir):X.partialsDir,componentsDir:X.componentsDir&&!T0.isAbsolute(X.componentsDir)?T0.resolve(Y,X.componentsDir):X.componentsDir,layoutsDir:X.layoutsDir&&!T0.isAbsolute(X.layoutsDir)?T0.resolve(Y,X.layoutsDir):X.layoutsDir},z=G,q=$;await iG(J,Z),pG(Z,z),q=await b2(()=>G6(q,Z,J,z),q,(_)=>{r0.log(_,{filePath:J,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${J}: ${_.message}`)}),q=q.replace(/\{\{--[\s\S]*?--\}\}/g,"");let K=B1(q,_9,(_,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);q=K.output;let W=K.tokens,U=(_)=>W.length===0?_:_.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>W[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";q=q.replace(/@@/g,H),q=q.replace(/@\{\{([\s\S]*?)\}\}/g,(_,w)=>{return`{{ ${w} }}`}),q=U6(q),q=await K8(q,J,Q);let j={};q=q$(q,j);let B={...Z.__sections||{}},V="",F=x3(f3($)),L=/@nolayout\b/.test(q)||F===!1;if(/@nolayout\b/.test(q))q=q.replace(/@nolayout\b\s*/g,"");let O=q.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)V=O[1],q=q.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(V=F,!/@section\s*\(/.test(q))q=`@section('content')
3576
3576
  ${q.trim()}
@@ -3579,21 +3579,21 @@ ${q.trim()}
3579
3579
  @endsection`}}if(q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(_,w,R)=>{return B[w]=R,""}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(_,w,R)=>{if(/^(['"]).*\1$/.test(R.trim()))return _;try{let N=Z0(R.trim(),Z);if(N===void 0)return _;return B[w]=String(N??""),""}catch{return _}}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(_,w,R)=>{if(R.includes("@parent"))B[w]=R.replace("@parent",b1);else B[w]=R.trim();return""}),Z.__sections=B,q=q.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(_,w,R)=>{return B[w]||R||""}),!("slot"in Z)||Z.slot===void 0)q=q.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""});if(q=K$(q,j),V){let _=[],w=n0(q),R=B1(w.output,l2,(N,A)=>`\x00STX_ORPHAN_STYLE_${A}\x00`);if(q=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(N,A,k)=>{let D=A==="SCRIPT"?nG(w.scripts[Number(k)],J):R.tokens[Number(k)];if(D)_.push(D);return""}),_.length>0){let N=_.join(`
3580
3580
  `);B.content=B.content?`${B.content}
3581
3581
  ${N}`:N,Z.__sections=B}}if(V)try{let _;if(T0.isAbsolute(V))_=V,Q.add(V);else _=await b2(()=>a2(V,J,G,Q),null,()=>{throw new E2(`Failed to resolve layout path: ${V}`,J,void 0,void 0,`Layout referenced from ${J}`)});if(!_){let D=(M)=>{if(!M)return[];try{let E=T0.isAbsolute(M)?M:T0.resolve(process.cwd(),M);return uG.readdirSync(E).filter((C)=>C.endsWith(".stx")).map((C)=>C.replace(/\.stx$/,""))}catch{return[]}},I=[...D(G.layoutsDir),...D(G.fallbackLayoutsDir)].filter((M,E,C)=>C.indexOf(M)===E).sort(),T=`Layout not found: ${V} (referenced from ${J})`+(I.length>0?`. Available layouts: ${I.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(r0.log(Error(T),{layoutPath:V,filePath:J,available:I},"error"),console.error(`[stx] ${T}`),G.debug)throw new E2(T,J);return q}let w=await b2(()=>Bun.file(_).text(),"",()=>{throw new E2(`Failed to read layout file: ${_}`,J,void 0,void 0,"Layout content could not be loaded")});w=O8(w,_);let R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${_}`);let D={},I=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(E,C,y)=>{return D[C]=y.trim(),""});for(let[E,C]of Object.entries(D))if(B[E]&&B[E].includes(b1)){let y=B[E].indexOf(b1);B[E]=B[E].slice(0,y)+C+B[E].slice(y+b1.length)}else if(!B[E])B[E]=C;let T={...Z,__sections:B},M=`@layout('${R[1]}')${I}`;return await h$(M,T,_,G,Q)}let N=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),A=q$(N,j),k={};return A=A.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(D,I,T)=>{return k[I]=T.trim(),`@slot('${I}')`}),A=A.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(D,I,T)=>{if(B[I]){let M=B[I];if(M.includes(b1)){let E=k[I]||"",C=M.indexOf(b1);M=M.slice(0,C)+E+M.slice(C+b1.length)}return M}return T||""}),A=cG(A,B),A=A.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""}),A=K$(A,j),Z.__originalFilePath=J,q=await R8(A,Z,_,G,Q),q=`<!-- stx-layout: ${V} -->
3582
- ${q}`,U(q)}catch(_){return r0.log(_ instanceof Error?_:Error(String(_)),{layoutPath:V,filePath:J},"error"),`[Error processing layout: ${_ instanceof Error?_.message:String(_)}]`}return U(await R8(q,Z,J,G,Q))}function cG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(J,X,Q)=>{let Y=Z[X];if(Y!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Y))return Y}return Q||""})}function pG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let J=Z.envPrefix||"STX_PUBLIC_",X={};for(let[Q,Y]of Object.entries(process.env))if(Q.startsWith(J)&&Y!==void 0)X[Q]=Y;$.$env=X}async function iG($,Z){await b2(()=>K6($,Z),void 0,(J)=>{r0.log(J,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${J.message}`)})}var g$="data-stx-source";function nG($,Z){if(!$)return $;let J=/^<script\b([^>]*)>/i.exec($);if(!J||!/\bserver\b/.test(J[1])||J[1].includes(g$))return $;return`<script ${g$}="${encodeURIComponent(Z)}"${$.slice(7)}`}function sG($){let Z=new RegExp(`${g$}="([^"]*)"`).exec($);return Z?decodeURIComponent(Z[1]):void 0}async function oG($,Z,J){let X=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Q;while((Q=X.exec($))!==null){let Y=Q[1],G=Q[2];if(!/\bserver\b/.test(Y)||!G.trim())continue;let q=sG(Y)??J;try{let{extractVariables:K}=await a("stx/variable-extractor",()=>import("./chunk-2gfjp8q1.js"));await K(G,Z,q,{preserveExisting:!0})}catch(K){let W=K instanceof Error?K:Error(String(K));r0.log(W,{filePath:q,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${q}: ${W.message}`)}}}async function rG($,Z,J){try{let{interpolateScriptsInTemplate:X}=await a("stx/expressions",()=>import("./chunk-zgnk8tpp.js"));return X($,Z,{skipServer:!0})}catch(X){let Q=X instanceof Error?X:Error(String(X));return r0.log(Q,{filePath:J,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${J}: ${Q.message}`),$}}async function R8($,Z,J,X,Q){let Y=$,G=X;if(await oG(Y,Z,J),Y=await rG(Y,Z,J),Y=await p4(Y,Z,J),Y=await i4(Y,Z,J),Y=await i7(Y,Z,J,G),Y1(Y))Y=Z8(Y,Z),Y=y$(Y,Z);Y=X8(Y);let{processStreamDirectives:z}=await a("stx/streaming",()=>import("./chunk-zhtttwz2.js"));Y=z(Y,Z),Y=Z6(Y,Z,J,G,!0),Y=await V6(Y,Z,J,G,Q),Y=await Y$(Y,Z,J,G,Q),Y=v3(Y,Z,J,G);let{processDeferDirectives:q}=await a("stx/defer",()=>import("./chunk-cn74d92v.js"));Y=q(Y,Z,J);let{processTeleportDirectives:K}=await a("stx/teleport",()=>import("./chunk-ys8sm556.js"));Y=K(Y,Z,J);let{processTransitionDirectives:W,processTransitionAttributes:U}=await a("stx/transitions",()=>import("./chunk-33rznhw1.js"));Y=W(Y,Z,J),Y=U(Y);let{processErrorBoundaryDirectives:H}=await a("stx/error-boundaries",()=>import("./chunk-xgj1jw4p.js"));Y=H(Y,Z,J);let{processSuspenseDirectives:j}=await a("stx/suspense",()=>import("./chunk-77sa9wz4.js"));Y=j(Y,Z,J);let{processAsyncDirectives:B}=await a("stx/async-components",()=>import("./chunk-0w8t922h.js"));Y=B(Y,Z,J);let{processKeepAliveDirectives:V}=await a("stx/keep-alive",()=>import("./chunk-7ds14xsn.js"));Y=V(Y,Z,J);let{processVirtualListDirectives:F,processVirtualGridDirectives:L,processInfiniteListDirectives:O}=await a("stx/virtual-scrolling",()=>import("./chunk-ms2kjpdt.js"));Y=F(Y,Z,J),Y=L(Y,Z,J),Y=O(Y,Z,J);let{processPartialHydrationDirectives:_,processStaticDirectives:w}=await a("stx/partial-hydration",()=>import("./chunk-2jfneptq.js"));Y=_(Y,Z,J),Y=w(Y);let{processComputedDirectives:R,processWatchDirectives:N}=await a("stx/computed",()=>import("./chunk-3n9rvrk1.js"));Y=R(Y,Z,J),Y=N(Y,Z,J);let{processFormValidationDirectives:A}=await a("stx/forms-validation",()=>import("./chunk-70nkn5te.js"));Y=A(Y,Z,J);let{processHeadDirective:k,processTitleDirective:D,processMetaDirective:I,resetHead:T}=await a("stx/head",()=>import("./chunk-meqcxfpr.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)T();let M=k(Y);if(Y=M.content,M.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${M.headContent}
3582
+ ${q}`,U(q)}catch(_){return r0.log(_ instanceof Error?_:Error(String(_)),{layoutPath:V,filePath:J},"error"),`[Error processing layout: ${_ instanceof Error?_.message:String(_)}]`}return U(await R8(q,Z,J,G,Q))}function cG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(J,X,Q)=>{let Y=Z[X];if(Y!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Y))return Y}return Q||""})}function pG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let J=Z.envPrefix||"STX_PUBLIC_",X={};for(let[Q,Y]of Object.entries(process.env))if(Q.startsWith(J)&&Y!==void 0)X[Q]=Y;$.$env=X}async function iG($,Z){await b2(()=>K6($,Z),void 0,(J)=>{r0.log(J,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${J.message}`)})}var g$="data-stx-source";function nG($,Z){if(!$)return $;let J=/^<script\b([^>]*)>/i.exec($);if(!J||!/\bserver\b/.test(J[1])||J[1].includes(g$))return $;return`<script ${g$}="${encodeURIComponent(Z)}"${$.slice(7)}`}function sG($){let Z=new RegExp(`${g$}="([^"]*)"`).exec($);return Z?decodeURIComponent(Z[1]):void 0}async function oG($,Z,J){let X=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Q;while((Q=X.exec($))!==null){let Y=Q[1],G=Q[2];if(!/\bserver\b/.test(Y)||!G.trim())continue;let q=sG(Y)??J;try{let{extractVariables:K}=await a("stx/variable-extractor",()=>import("./chunk-dnesmvvb.js"));await K(G,Z,q,{preserveExisting:!0})}catch(K){let W=K instanceof Error?K:Error(String(K));r0.log(W,{filePath:q,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${q}: ${W.message}`)}}}async function rG($,Z,J){try{let{interpolateScriptsInTemplate:X}=await a("stx/expressions",()=>import("./chunk-q2hvne0v.js"));return X($,Z,{skipServer:!0})}catch(X){let Q=X instanceof Error?X:Error(String(X));return r0.log(Q,{filePath:J,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${J}: ${Q.message}`),$}}async function R8($,Z,J,X,Q){let Y=$,G=X;if(await oG(Y,Z,J),Y=await rG(Y,Z,J),Y=await p4(Y,Z,J),Y=await i4(Y,Z,J),Y=await i7(Y,Z,J,G),Y1(Y))Y=Z8(Y,Z),Y=y$(Y,Z);Y=X8(Y);let{processStreamDirectives:z}=await a("stx/streaming",()=>import("./chunk-7ywnkv1f.js"));Y=z(Y,Z),Y=Z6(Y,Z,J,G,!0),Y=await V6(Y,Z,J,G,Q),Y=await Y$(Y,Z,J,G,Q),Y=v3(Y,Z,J,G);let{processDeferDirectives:q}=await a("stx/defer",()=>import("./chunk-8730k51r.js"));Y=q(Y,Z,J);let{processTeleportDirectives:K}=await a("stx/teleport",()=>import("./chunk-3ntf8f5e.js"));Y=K(Y,Z,J);let{processTransitionDirectives:W,processTransitionAttributes:U}=await a("stx/transitions",()=>import("./chunk-42en0cxm.js"));Y=W(Y,Z,J),Y=U(Y);let{processErrorBoundaryDirectives:H}=await a("stx/error-boundaries",()=>import("./chunk-d4etph79.js"));Y=H(Y,Z,J);let{processSuspenseDirectives:j}=await a("stx/suspense",()=>import("./chunk-80zj5516.js"));Y=j(Y,Z,J);let{processAsyncDirectives:B}=await a("stx/async-components",()=>import("./chunk-q85qp5we.js"));Y=B(Y,Z,J);let{processKeepAliveDirectives:V}=await a("stx/keep-alive",()=>import("./chunk-0vv5s039.js"));Y=V(Y,Z,J);let{processVirtualListDirectives:F,processVirtualGridDirectives:L,processInfiniteListDirectives:O}=await a("stx/virtual-scrolling",()=>import("./chunk-pbzdjhp8.js"));Y=F(Y,Z,J),Y=L(Y,Z,J),Y=O(Y,Z,J);let{processPartialHydrationDirectives:_,processStaticDirectives:w}=await a("stx/partial-hydration",()=>import("./chunk-9kxfz708.js"));Y=_(Y,Z,J),Y=w(Y);let{processComputedDirectives:R,processWatchDirectives:N}=await a("stx/computed",()=>import("./chunk-1ebyt1ba.js"));Y=R(Y,Z,J),Y=N(Y,Z,J);let{processFormValidationDirectives:A}=await a("stx/forms-validation",()=>import("./chunk-c1m1gng4.js"));Y=A(Y,Z,J);let{processHeadDirective:k,processTitleDirective:D,processMetaDirective:I,resetHead:T}=await a("stx/head",()=>import("./chunk-dfejgnny.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)T();let M=k(Y);if(Y=M.content,M.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${M.headContent}
3583
3583
  `;if(Y=D(Y,Z),Y=I(Y,Z),Y=q6(Y),Y=D5(Y,Z),Y=p7(Y),Y=Y6(Y),Y=await z$(Y,Z,J,G,Q),Y=await Y$(Y,Z,J,G,Q),Z.__stxProcessingDepth===1)Y=Y3(Y,Z);if(Y=Y.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Y=P$(Y),Y=$1(Y,Z,J),Y=U$(Y),Y=h3(Y,Z,{filePath:J,buildMode:G.buildMode}),Y=A5(Y,Z),Y=M5(Y,Z),Y=O2(Y,Z),Y=C5(Y,Z),Y=S5(Y,Z),Y=await C7(Y,Z,J,G),Y=await i3(Y,Z,J),Y=await M8(Y,Z,J,G),Y=I8(Y,Z,J,G),Y=V7(Y,Z,J,G),Y=_7(Y,Z,J),Y=L7(Y,Z,J,G),Y=l7(Y,Z,J,G),Y=C$(Y,Z),Y=S$(Y),Y=H8(Y),!G.skipEventDirectives)Y=Z3(Y,Z,J);if(Y=m3(Y,Z,J),G.debug){let p=/\bx-data\s*=/.test(Y),i=b$($);if(p&&i)console.warn(`[stx] ${J}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3584
3584
  Both work on the same page, but they manage separate scopes.
3585
- Prefer signals (state/derived/effect) for new components.`)}Y=C4(Y,Z),Y=await V1(Y,Z,J),Y=_8(Y),Y=L8(Y),Y=k3(Y);let{processXElementDirectives:E}=await a("stx/x-element",()=>import("./chunk-dwjcmxez.js"));Y=E(Y);let C=Z.__originalFilePath||J,y=b9(Z);if(Y=await Y8(Y,G,C,y),Y=r7(Y,Z),Y=await z6(Y,Z,J,G),G.media?.image?.autoSiblings){let p=G.publicDir||"public",{rewriteImagesWithSiblings:i}=await a("stx/image-optimization/auto-sibling",()=>import("./chunk-7f16ymjn.js"));Y=await i(Y,{publicDir:p})}if(G.seo?.enabled)Y=O7(Y,Z,G);let b=(p,i,U0=!0)=>{if(!i)return p;let Y0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),O0=p.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(Y0&&O0){if(U0)p=p.replace(O0[0],Y0[0]);if(i=i.replace(Y0[0],"").trim(),!i)return p}if(/<\/head>/i.test(p))return p.replace(/<\/head>/i,`${i}
3585
+ Prefer signals (state/derived/effect) for new components.`)}Y=C4(Y,Z),Y=await V1(Y,Z,J),Y=_8(Y),Y=L8(Y),Y=k3(Y);let{processXElementDirectives:E}=await a("stx/x-element",()=>import("./chunk-eth22r93.js"));Y=E(Y);let C=Z.__originalFilePath||J,y=b9(Z);if(Y=await Y8(Y,G,C,y),Y=r7(Y,Z),Y=await z6(Y,Z,J,G),G.media?.image?.autoSiblings){let p=G.publicDir||"public",{rewriteImagesWithSiblings:i}=await a("stx/image-optimization/auto-sibling",()=>import("./chunk-atw841yx.js"));Y=await i(Y,{publicDir:p})}if(G.seo?.enabled)Y=O7(Y,Z,G);let b=(p,i,U0=!0)=>{if(!i)return p;let Y0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),O0=p.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(Y0&&O0){if(U0)p=p.replace(O0[0],Y0[0]);if(i=i.replace(Y0[0],"").trim(),!i)return p}if(/<\/head>/i.test(p))return p.replace(/<\/head>/i,`${i}
3586
3586
  </head>`);if(/<head\b[^>]*>/i.test(p))return p.replace(/(<head\b[^>]*>)/i,`$1
3587
3587
  ${i}`);if(/<html\b[^>]*>/i.test(p))return p.replace(/(<html\b[^>]*>)/i,`$1
3588
3588
  <head>
3589
3589
  ${i}
3590
- </head>`);return p},{renderHead:P,getHead:g}=await a("stx/head",()=>import("./chunk-meqcxfpr.js")),l=Z.__stx_runtime_head??g();if(l.title||l.meta?.length||l.link?.length){let p=P(l);if(p)Y=b(Y,p)}if(M.headContent)Y=b(Y,M.headContent,!l.title);if(G.csp?.enabled&&G.csp.addMetaTag)Y=d7(Y,G.csp,Z);if(G.analytics?.enabled)Y=E3(Y,G);if(G.heatmap?.enabled)Y=y3(Y,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:p}=await a("stx/pwa/inject",()=>import("./chunk-d9gk60kk.js"));Y=p(Y,G)}let h=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Y),s=/\bSTX\.\w+/.test(Y),u=/window\.STX\s*=/.test(Y);if(h&&s&&!u){let i=`<script data-stx-scoped data-stx-run="once">
3590
+ </head>`);return p},{renderHead:P,getHead:g}=await a("stx/head",()=>import("./chunk-dfejgnny.js")),l=Z.__stx_runtime_head??g();if(l.title||l.meta?.length||l.link?.length){let p=P(l);if(p)Y=b(Y,p)}if(M.headContent)Y=b(Y,M.headContent,!l.title);if(G.csp?.enabled&&G.csp.addMetaTag)Y=d7(Y,G.csp,Z);if(G.analytics?.enabled)Y=E3(Y,G);if(G.heatmap?.enabled)Y=y3(Y,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:p}=await a("stx/pwa/inject",()=>import("./chunk-4tnxnzja.js"));Y=p(Y,G)}let h=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Y),s=/\bSTX\.\w+/.test(Y),u=/window\.STX\s*=/.test(Y);if(h&&s&&!u){let i=`<script data-stx-scoped data-stx-run="once">
3591
3591
  ${A3()}
3592
3592
  </script>`;if(Y.includes("</head>")){let U0=Y.indexOf("</head>"),O0=Y.slice(0,U0).indexOf("<script");if(O0!==-1){let E0=Y.slice(0,O0),j1=Y.slice(O0);Y=E0+i+`
3593
3593
  `+j1}else Y=Y.replace("</head>",`${i}
3594
3594
  </head>`)}else if(Y.includes("<body"))Y=Y.replace(/<body([^>]*)>/,`<body$1>
3595
3595
  ${i}`);else Y=i+`
3596
- `+Y}{let{scanScriptTags:p}=await a("stx/signal-processing",()=>import("./chunk-v82r1j02.js")),i=[];for(let U0 of p(Y)){if(!/\bserver\b/i.test(U0.attrs))continue;let Y0=U0.start+U0.fullMatch.indexOf(">")+1,O0=dG(Y,Y0);if(O0===-1)continue;let E0=O0+9;while(E0<Y.length&&/\s/.test(Y[E0]))E0++;i.push({start:U0.start,end:E0})}if(i.length>0){let U0=Array(i.length+1),Y0=0;for(let O0=0;O0<i.length;O0++){let{start:E0,end:j1}=i[O0];U0[O0]=Y.slice(Y0,E0),Y0=j1}U0[i.length]=Y.slice(Y0),Y=U0.join("")}}let z0=C9(Y,J);if(z0.hasScoped)Y=z0.html;let d0=Z.__stx_event_bindings||[],x0=!1,m0=[],J0=/\s:[a-z][\w.-]*\s*=/.test(Y),{scanScriptTags:j0}=await a("stx/signal-processing",()=>import("./chunk-v82r1j02.js"));for(let p of j0(Y,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))m0.push({match:p.fullMatch,attrs:p.attrs,content:p.body});for(let{match:p,attrs:i,content:U0}of m0){x0=!0;let Y0=U0;f$(U0,J,X.strict,Z.__originalFilePath);let O0=await y9(U0,{eventBindings:d0,attrs:i,hasColonDirectives:J0,templateContent:$,filePath:J,projectRoot:process.cwd(),production:X.buildMode==="compile",serverData:y});Y=Y.replace(p,()=>O0)}if(x0)Z.__stx_event_bindings=[];if(!x0&&Z.__stxProcessingDepth===1){let p=Z.__stx_event_bindings||[];if(p.length>0){let i=u9(p);if(i){let U0=Y.lastIndexOf("</body>");Y=U0===-1?Y+i:Y.slice(0,U0)+i+`
3596
+ `+Y}{let{scanScriptTags:p}=await a("stx/signal-processing",()=>import("./chunk-y1x2ebhv.js")),i=[];for(let U0 of p(Y)){if(!/\bserver\b/i.test(U0.attrs))continue;let Y0=U0.start+U0.fullMatch.indexOf(">")+1,O0=dG(Y,Y0);if(O0===-1)continue;let E0=O0+9;while(E0<Y.length&&/\s/.test(Y[E0]))E0++;i.push({start:U0.start,end:E0})}if(i.length>0){let U0=Array(i.length+1),Y0=0;for(let O0=0;O0<i.length;O0++){let{start:E0,end:j1}=i[O0];U0[O0]=Y.slice(Y0,E0),Y0=j1}U0[i.length]=Y.slice(Y0),Y=U0.join("")}}let z0=C9(Y,J);if(z0.hasScoped)Y=z0.html;let d0=Z.__stx_event_bindings||[],x0=!1,m0=[],J0=/\s:[a-z][\w.-]*\s*=/.test(Y),{scanScriptTags:j0}=await a("stx/signal-processing",()=>import("./chunk-y1x2ebhv.js"));for(let p of j0(Y,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))m0.push({match:p.fullMatch,attrs:p.attrs,content:p.body});for(let{match:p,attrs:i,content:U0}of m0){x0=!0;let Y0=U0;f$(U0,J,X.strict,Z.__originalFilePath);let O0=await y9(U0,{eventBindings:d0,attrs:i,hasColonDirectives:J0,templateContent:$,filePath:J,projectRoot:process.cwd(),production:X.buildMode==="compile",serverData:y});Y=Y.replace(p,()=>O0)}if(x0)Z.__stx_event_bindings=[];if(!x0&&Z.__stxProcessingDepth===1){let p=Z.__stx_event_bindings||[];if(p.length>0){let i=u9(p);if(i){let U0=Y.lastIndexOf("</body>");Y=U0===-1?Y+i:Y.slice(0,U0)+i+`
3597
3597
  `+Y.slice(U0)}Z.__stx_event_bindings=[]}}if(!d6(Y)&&m6(Y))Y=await I9(Y,G);if(Y=l6(Y),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Y=m7(Y,Z.cspNonce);return Y}var aG=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],tG=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],eG=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function $z($){let Z=[],J=[];return Zz($,Z),Jz($,Z,J),Xz($,J),Yz($,Z),{valid:Z.length===0,errors:Z,warnings:J}}function Zz($,Z){let J=($.match(/\{\{/g)||[]).length,X=($.match(/\}\}/g)||[]).length;if(J!==X)Z.push({type:"expression",message:`Unclosed expression brackets: found ${J} opening '{{' and ${X} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function Jz($,Z,J){for(let X of aG){let Q=new RegExp(`${X.open}(?:\\s|\\()`,"g"),Y=new RegExp(X.close,"g"),G=($.match(Q)||[]).length,z=($.match(Y)||[]).length;if(X.altClose){let q=new RegExp(X.altClose,"g");z+=($.match(q)||[]).length}if(G>z)Z.push({type:"directive",message:`Unclosed @${X.name} directive: found ${G} opening and ${z} closing`,suggestion:`Add ${G-z} missing ${X.close} tag(s)`});else if(z>G)J.push({type:"directive",message:`Extra ${X.close} found: ${z-G} more closing than opening`,suggestion:`Check for orphaned ${X.close} tags`})}}function Xz($,Z){for(let J of tG)if(J.pattern.test($))Z.push({type:"syntax",message:J.message,suggestion:J.suggestion})}function Yz($,Z){for(let J of eG)if(J.pattern.test($))Z.push({type:"expression",message:`Security warning: ${J.message}`,suggestion:"Remove dangerous code from template expressions"})}function Qz($,Z){let J=$.slice(0,Z).split(`
3598
3598
  `);return{line:J.length,column:J[J.length-1].length+1}}function Gz($,Z,J){let X=[];switch($){case"if":case"elseif":case"unless":if(J.length===0)X.push({type:"syntax",message:`@${$} requires a condition`,suggestion:`Use @${$}(condition)`});break;case"foreach":if(J.length===0||!J[0].includes(" as "))X.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(J.length===0)X.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(J.length===0)X.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(J.length===0)X.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(J.length===0)X.push({type:"syntax",message:`@${$} requires a path`,suggestion:`Use @${$}('path/to/template')`});break}return X}function zz($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function qz($){let Z=$.matchAll(/@([a-z]+)/gi),J=new Set;for(let X of Z){let Q=X[1].toLowerCase();if(!Q.startsWith("end"))J.add(Q)}return Array.from(J)}import a0 from"path";import Z2 from"process";var o8=["module","exports","require","props","$props","defineProps","withDefaults","defineClientPayload","useServerData","useRuntimeConfig","useServerRuntimeConfig","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","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"],v8=new Set(o8),Kz=new Set(["props","$props","defineProps"]),Wz=new Set(["stx","@stacksjs/stx"]),f8=E1(128),x8=E1(64);function Uz($){let Z=[],J=0,X=$.split(`
3599
3599
  `);for(let Q of X){let Y=J,G=null,z=!1;for(let q=0;q<Q.length;q++){let K=Q[q];if(z){z=!1;continue}if(K==="\\"){z=!0;continue}if(G){if(K===G)G=null;continue}if(K==="'"||K==='"'||K==="`"){G=K;continue}if(K==="/"&&q+1<Q.length&&Q[q+1]==="/")break;if(K==="{")J++;else if(K==="}")J--}if(Y===0){let q=Q.match(/(?:const|let|var)\s+(\w+)\s*=/);if(q)Z.push(q[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Q)){let K=Q.match(/(?:const|let|var)\s+(\w+)/);if(K)Z.push(K[1])}else{let K=Q.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(K){let U=K[1].slice(1,-1).split(",").map((H)=>{let j=H.split(":");return(j.length>1?j[1]:j[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...U)}}}}return[...new Set(Z)]}function Hz($){let Z=$;Z=Z.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),Z=Z.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),Z=Z.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function J(X){if(!X.includes(":"))return X;let Q=[],Y="",G=0,z=0,q=null;for(let K=0;K<X.length;K++){let W=X[K];if(q){if(Y+=W,W===q)q=null;continue}if(W==='"'||W==="'"||W==="`"){q=W,Y+=W;continue}if(W==="<")G++;else if(W===">"&&G>0)G--;else if(W==="(")z++;else if(W===")")z--;if(W===","&&G===0&&z===0){Q.push(Y),Y="";continue}Y+=W}if(Y)Q.push(Y);return Q.map((K)=>{let W=K.trim(),U=W.startsWith("..."),H=U?W.slice(3):W,j=-1,B=0;for(let R=0;R<H.length;R++)if(H[R]==="<")B++;else if(H[R]===">")B--;else if(H[R]===":"&&B===0){j=R;break}if(j===-1)return K;let F=H.substring(0,j).trim().replace(/\?$/,""),L=H.substring(j+1),O=-1,_=0;for(let R=0;R<L.length;R++)if(L[R]==="<")_++;else if(L[R]===">")_--;else if(L[R]==="="&&_===0){O=R;break}let w=U?"...":"";if(O!==-1)return`${w}${F} = ${L.substring(O+1).trim()}`;return`${w}${F}`}).join(", ")}Z=Z.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(X,Q,Y)=>{if(!Y.includes(":"))return X;return`${Q}(${J(Y)})`});{let X=/\b(function\s+\w*\s*)\(/g,Q,Y=[];while((Q=X.exec(Z))!==null){let G=Q.index+Q[0].length-1,z=1,q=G+1,K=0,W=null;while(q<Z.length&&z>0){let j=Z[q];if(W){if(j===W)W=null;q++;continue}if(j==='"'||j==="'"||j==="`"){W=j,q++;continue}if(j==="<")K++;else if(j===">"&&K>0)K--;else if(K===0){if(j==="(")z++;else if(j===")")z--}if(z>0)q++}if(z!==0)continue;let U=Z.substring(G+1,q);if(!U.includes(":"))continue;let H=J(U);Y.push({start:G+1,end:q,replacement:H})}for(let G=Y.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Y[G];Z=Z.substring(0,z)+K+Z.substring(q)}}return Z=Z.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(X,Q)=>{if(!Q.includes(":"))return X;if(Q.includes("{")||Q.includes("}"))return X;return`(${Q.split(",").map((G)=>{let[z,...q]=G.split("="),K=z.split(":")[0].trim();if(q.length>0)return`${K} = ${q.join("=").trim()}`;return K}).join(", ")}) =>`}),Z=Z.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"),Z=Z.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Z=Z.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Z=Z.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Z=Z.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Z=Z.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Z=Z.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Z=Z.replace(/\n\s*\n\s*\n/g,`
@@ -3615,11 +3615,11 @@ ${$[K]}`,K++;else break}return q=q.trim().replace(/;$/,""),{type:Y,name:G,value:
3615
3615
  ${Y}`,Q++}while(Q<$.length){let Y=$[Q].trim();if(Y.startsWith(".")||Y.startsWith("?."))X+=`
3616
3616
  ${$[Q]}`,Q++;else break}return{value:X,nextIndex:Q}}function Nz($,Z,J){let X=J,Q=Z+1;while(Q<$.length){let Y=$Z(X);if(Y!==-1){if(w0(X,"{","}",Y)!==-1)break}let G=$[Q];X+=`
3617
3617
  ${G}`,Q++}return{functionCode:X,nextIndex:Q}}function m8($,Z){let J=Z0($,Z)??Z0(`(${$})`,Z);if(J!==void 0)return J;if(!/\bprocess\b/.test($))return;let X={...Z,process:Object.freeze({env:{...Z2.env}})},Q=Object.keys(X).filter(J2),Y=Q.map((G)=>X[G]);try{return Function(...Q,`'use strict'; return (${$});`)(...Y)}catch{try{return Function(...Q,`'use strict'; return ${$};`)(...Y)}catch{return}}}async function Dz($,Z,J){let X=$.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Y of X){let[,,G,z]=Y;try{let q=z.trim().replace(/;$/,""),K=m8(q,Z);if(K!==void 0)Z[G]=K}catch(q){console.warn(`Failed to parse export ${G} in fallback:`,q)}}let Q=$.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Y of Q){let[,,G,z]=Y;if(!(G in Z))try{let q=z.trim().replace(/;$/,""),K=m8(q,Z);if(K!==void 0)Z[G]=K}catch{}}}function Az($){let Z=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),J=Z?Z[1]:"",X=Z?$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):$;return{scriptContent:J,templateWithoutScript:X}}function Mz($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var y2=new n1(500),v9=new n1(1000),qZ=33554432,l$=qZ;function Iz($){let Z=$.componentRenderCacheBytes;if(typeof Z!=="number"||Z<0||Z===l$)return;l$=Z,f9.setMaxBytes(Z)}var f9=new n1(2000,{maxBytes:qZ,sizeOf:($)=>$.output.length});function kz($){let Z=new WeakSet;try{let J=(X)=>{if(X===void 0)return{__stxType:"undefined"};if(typeof X==="bigint")return{__stxType:"bigint",value:X.toString()};if(typeof X==="function"||typeof X==="symbol")throw TypeError("Non-serializable component input");if(X===null||typeof X!=="object")return X;if(Z.has(X))throw TypeError("Circular component input");if(Z.add(X),X instanceof Date)return{__stxType:"date",value:X.toISOString()};if(Array.isArray(X))return X.map(J);let Q={};for(let Y of Object.keys(X).sort())Q[Y]=J(X[Y]);return Q};return JSON.stringify(J($))}catch{return null}}function ZZ($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Tz($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function M1($){return!Tz($)}var P9=new Map;function d$($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let J=P9.get(Z);if(J)return J;if(P9.size>=16)P9.clear();let X=new Bun.Transpiler($);return P9.set(Z,X),X}var JZ=new WeakMap,Ez=256;function I1($){try{let Z=d$({loader:"ts",target:"browser",define:e1()}),J=JZ.get(Z);if(!J)J=new Map,JZ.set(Z,J);let X=J.get($);if(X!==void 0)return X;let Q=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");Q=Q.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let Y=[];Q=Q.replace(/\{!![\s\S]*?!!\}/g,(z)=>{let q=Y.length;return Y.push(z),`"__STX_EXPR_${q}__"`}),Q=Q.replace(/\{\{\{[\s\S]*?\}\}\}/g,(z)=>{let q=Y.length;return Y.push(z),`"__STX_EXPR_${q}__"`}),Q=Q.replace(/\{\{[\s\S]*?\}\}/g,(z)=>{let q=Y.length;return Y.push(z),`"__STX_EXPR_${q}__"`});let G=Z.transformSync(Q);for(let z=0;z<Y.length;z++)G=G.replace(`"__STX_EXPR_${z}__"`,Y[z]),G=G.replace(`'__STX_EXPR_${z}__'`,Y[z]);if(J.size>=Ez){let z=J.keys().next();if(!z.done)J.delete(z.value)}return J.set($,G),G}catch(Z){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",Z);return $}}function bz($){let Z=[],J=new Set,X=0,Q=0,Y=$.length,G=(W)=>{Q++;while(Q<Y){if($[Q]==="\\"){Q+=2;continue}if($[Q]===W){Q++;return}Q++}},z=()=>{Q++;while(Q<Y){if($[Q]==="\\"){Q+=2;continue}if($[Q]==="`"){Q++;return}if($[Q]==="$"&&$[Q+1]==="{"){Q+=2;let W=1;while(Q<Y&&W>0)if($[Q]==="{")W++,Q++;else if($[Q]==="}")W--,Q++;else if($[Q]==="'"||$[Q]==='"')G($[Q]);else if($[Q]==="`")z();else Q++;continue}Q++}},q=()=>{if($[Q]==="/"&&$[Q+1]==="/"){while(Q<Y&&$[Q]!==`
3618
- `)Q++;return!0}if($[Q]==="/"&&$[Q+1]==="*"){Q+=2;while(Q<Y-1&&!($[Q]==="*"&&$[Q+1]==="/"))Q++;return Q+=2,!0}return!1},K=()=>{if(X!==0)return;let W=$.slice(Q).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(W){let B=W[2].split(",").map((V)=>{let F=V.trim().split(":");return F[F.length-1].trim()});for(let V of B)if(V&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(V)&&!J.has(V))Z.push(V),J.add(V);return}let U=$.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(U){let B=U[2];if(!J.has(B))Z.push(B),J.add(B);return}let H=$.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!J.has(B))Z.push(B),J.add(B);return}let j=$.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!J.has(B))Z.push(B),J.add(B)}};while(Q<Y){if(q())continue;if($[Q]==="'"||$[Q]==='"'){G($[Q]);continue}if($[Q]==="`"){z();continue}if($[Q]==="{"){X++,Q++;continue}if($[Q]==="}"){X--,Q++;continue}if(X===0&&/[a-z]/i.test($[Q])&&(Q===0||/\s|[;{}()]/.test($[Q-1])))K();Q++}return Z}function yz($){let Z=[],J=0,X=0,Q=null;for(let Y=0;Y<$.length;Y++){let G=$[Y];if(Q){if(G==="\\"){Y++;continue}if(G===Q)Q=null;continue}if(G==='"'||G==="'"||G==="`"){Q=G;continue}if(G==="("||G==="["||G==="{")J++;else if(G===")"||G==="]"||G==="}")J--;else if(G===","&&J===0)Z.push($.slice(X,Y)),X=Y+1}if(X<$.length)Z.push($.slice(X));return Z}function Cz($){let Z=0,J=null;for(let X=0;X<$.length;X++){let Q=$[X];if(J){if(Q==="\\"){X++;continue}if(Q===J)J=null;continue}if(Q==='"'||Q==="'"||Q==="`"){J=Q;continue}if(Q==="("||Q==="["||Q==="{")Z++;else if(Q===")"||Q==="]"||Q==="}")Z--;else if(Q==="="&&Z===0){let Y=$[X-1],G=$[X+1];if(Y==="!"||Y==="<"||Y===">"||Y==="=")continue;if(G==="="||G===">")continue;return X}}return-1}function Sz($,Z){try{let J=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!J)return;let X=J.index-1;while(X>=0&&/\s/.test($[X]))X--;if($[X]!=="}")return;let Q=X,Y=0,G=-1;for(;X>=0;X--){let q=$[X];if(q==="}")Y++;else if(q==="{"){if(Y--,Y===0){G=X;break}}}if(G===-1)return;let z=$.slice(G+1,Q);for(let q of yz(z)){let K=q.trim();if(!K||K.startsWith("..."))continue;let W=Cz(K);if(W===-1)continue;let U=K.slice(0,W).trim();if(!/^[A-Z_$][\w$]*$/i.test(U))continue;if(Z[U]!==void 0)continue;let H=K.slice(W+1).trim();if(!H)continue;try{let j=Object.keys(Z).filter(J2),B=Function(...j,`"use strict"; return (${H});`);Z[U]=B(...j.map((V)=>Z[V]))}catch{}}}catch{}}async function B9($,Z,J,X,Q){let Y=$.endsWith(".stx")?$.slice(0,-4):$,G=(L)=>L.split("-").map((O)=>O.charAt(0).toUpperCase()+O.slice(1)).join(""),z=(L)=>L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q=J.__importedComponents;if(q){for(let L of[Y,Y.toLowerCase(),G(Y),z(Y)])if(q.has(L))return!0}let K=[...new Set([`${Y}.stx`,`${G(Y)}.stx`,`${z(Y)}.stx`])],W=typeof Q.root==="string"?x.resolve(Q.root):void 0,U=W??x.dirname(X),H=[],j=(L)=>{if(L&&!H.includes(L))H.push(L)},B=J.__originalFilePath;if(B)j(x.join(x.dirname(B),"components"));if(j(Z),j(Q._rootComponentsDir),j(x.join(x.dirname(X),"components")),j(Q.componentsDir),W)j(x.resolve(W,"resources/views/components")),j(x.resolve(W,"resources/components")),j(x.resolve(W,"src/components")),j(x.resolve(W,"components"));for(let L of Q._layerComponentDirs??[])j(L);let V=Q._pluginComponentDirs;if(Array.isArray(V))for(let L of V)j(typeof L==="string"?L:null);if(j(Q.fallbackComponentsDir),Y.startsWith("./")||Y.startsWith("../"))return e(x.resolve(x.dirname(X),`${Y}.stx`));let F=XZ(x.resolve(import.meta.dir,"components"));for(let L of H){let O=x.isAbsolute(L)?L:x.resolve(U,L);if(XZ(O)===F)continue;for(let _ of K)if(await e(x.join(O,_)))return!0}return!1}function XZ($){try{return zZ.realpathSync($)}catch{return $}}function Pz($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function vz($){if(!$)return!1;let Z=$.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(Z)}function fz($){let Z=new Set,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let X of $){let Q;while((Q=J.exec(X))!==null)Z.add(Q[1]);J.lastIndex=0}return[...Z]}async function A1($,Z,J,X,Q,Y,G,z=new Set,q){let{extractVariables:K}=await a("stx/variable-extractor",()=>import("./chunk-2gfjp8q1.js")),W=z??new Set;if(W.has($))return`[Circular component reference: ${$}]`;let U=new Set(W);U.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&Pz(H)?H:"";try{let B=(d)=>d.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),V=(d)=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,L=null,O=Q.__importedComponents;if(O){let d=[F,F.toLowerCase(),B(F),V(F)];for(let m of d)if(O.has(m)){L=O.get(m);break}}let _=[];if(!L){let d=[`${F}.stx`,`${B(F)}.stx`,`${V(F)}.stx`],m=[...new Set(d)],K0=Q.__originalFilePath,r=[];if(r.push(...G._layerComponentDirs??[]),K0){let A0=x.join(x.dirname(K0),"components");r.push(A0)}if(X)r.push(X);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!r.includes(F0))r.push(F0);let D0=x.join(x.dirname(Y),"components");if(!r.includes(D0))r.push(D0);if(G.componentsDir&&G.componentsDir!==X&&!r.includes(G.componentsDir))r.push(G.componentsDir);let P0=typeof G.root==="string"?x.resolve(G.root):void 0,c0=P0??x.dirname(Y),C0=[];if(P0)C0.push(x.resolve(P0,"resources/views/components")),C0.push(x.resolve(P0,"resources/components")),C0.push(x.resolve(P0,"src/components")),C0.push(x.resolve(P0,"components"));C0.push(x.resolve(import.meta.dir,"components"));for(let A0 of C0)if(!r.includes(A0))r.push(A0);let X1=G._pluginComponentDirs;if(Array.isArray(X1)){for(let A0 of X1)if(typeof A0==="string"&&!r.includes(A0))r.push(A0)}if(G.fallbackComponentsDir&&!r.includes(G.fallbackComponentsDir))r.push(G.fallbackComponentsDir);let t=[...new Set(r.map((A0)=>{if(!A0)return A0;return x.isAbsolute(A0)?A0:x.resolve(c0,A0)}))];r.length=0,r.push(...t);let t0=`${F}\x00${Y}\x00${t.join("\x00")}`,P2=v9.get(t0);if(P2)if(await e(P2))L=P2;else v9.delete(t0);if(!L&&(F.startsWith("./")||F.startsWith("../")))L=x.resolve(x.dirname(Y),`${F}.stx`),_.push(L);else if(!L)for(let A0 of r){if(!A0)continue;for(let v2 of m){let f2=x.join(A0,v2);if(_.push(f2),await e(f2)){L=f2;break}}if(L)break;if(!L)try{let v2=await import("fs");if(!v2.statSync(A0,{throwIfNoEntry:!1})?.isDirectory())continue;let wZ=8,x9=[{path:A0,depth:0}];while(x9.length>0&&!L){let x2=x9.pop();if(x2.depth>=wZ)continue;let n$;try{n$=v2.readdirSync(x2.path,{withFileTypes:!0})}catch{continue}for(let g2 of n$){if(!g2.isDirectory())continue;if(g2.name==="node_modules"||g2.name.startsWith("."))continue;let s$=x.join(x2.path,g2.name);for(let RZ of m){let g9=x.join(s$,RZ);if(_.push(g9),await e(g9)){L=g9;break}}if(L)break;x9.push({path:s$,depth:x2.depth+1})}}}catch{}if(L)break}if(L)v9.set(t0,L)}if(!L||!await e(L)){let d=_.length>0?`
3618
+ `)Q++;return!0}if($[Q]==="/"&&$[Q+1]==="*"){Q+=2;while(Q<Y-1&&!($[Q]==="*"&&$[Q+1]==="/"))Q++;return Q+=2,!0}return!1},K=()=>{if(X!==0)return;let W=$.slice(Q).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(W){let B=W[2].split(",").map((V)=>{let F=V.trim().split(":");return F[F.length-1].trim()});for(let V of B)if(V&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(V)&&!J.has(V))Z.push(V),J.add(V);return}let U=$.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(U){let B=U[2];if(!J.has(B))Z.push(B),J.add(B);return}let H=$.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!J.has(B))Z.push(B),J.add(B);return}let j=$.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!J.has(B))Z.push(B),J.add(B)}};while(Q<Y){if(q())continue;if($[Q]==="'"||$[Q]==='"'){G($[Q]);continue}if($[Q]==="`"){z();continue}if($[Q]==="{"){X++,Q++;continue}if($[Q]==="}"){X--,Q++;continue}if(X===0&&/[a-z]/i.test($[Q])&&(Q===0||/\s|[;{}()]/.test($[Q-1])))K();Q++}return Z}function yz($){let Z=[],J=0,X=0,Q=null;for(let Y=0;Y<$.length;Y++){let G=$[Y];if(Q){if(G==="\\"){Y++;continue}if(G===Q)Q=null;continue}if(G==='"'||G==="'"||G==="`"){Q=G;continue}if(G==="("||G==="["||G==="{")J++;else if(G===")"||G==="]"||G==="}")J--;else if(G===","&&J===0)Z.push($.slice(X,Y)),X=Y+1}if(X<$.length)Z.push($.slice(X));return Z}function Cz($){let Z=0,J=null;for(let X=0;X<$.length;X++){let Q=$[X];if(J){if(Q==="\\"){X++;continue}if(Q===J)J=null;continue}if(Q==='"'||Q==="'"||Q==="`"){J=Q;continue}if(Q==="("||Q==="["||Q==="{")Z++;else if(Q===")"||Q==="]"||Q==="}")Z--;else if(Q==="="&&Z===0){let Y=$[X-1],G=$[X+1];if(Y==="!"||Y==="<"||Y===">"||Y==="=")continue;if(G==="="||G===">")continue;return X}}return-1}function Sz($,Z){try{let J=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!J)return;let X=J.index-1;while(X>=0&&/\s/.test($[X]))X--;if($[X]!=="}")return;let Q=X,Y=0,G=-1;for(;X>=0;X--){let q=$[X];if(q==="}")Y++;else if(q==="{"){if(Y--,Y===0){G=X;break}}}if(G===-1)return;let z=$.slice(G+1,Q);for(let q of yz(z)){let K=q.trim();if(!K||K.startsWith("..."))continue;let W=Cz(K);if(W===-1)continue;let U=K.slice(0,W).trim();if(!/^[A-Z_$][\w$]*$/i.test(U))continue;if(Z[U]!==void 0)continue;let H=K.slice(W+1).trim();if(!H)continue;try{let j=Object.keys(Z).filter(J2),B=Function(...j,`"use strict"; return (${H});`);Z[U]=B(...j.map((V)=>Z[V]))}catch{}}}catch{}}async function B9($,Z,J,X,Q){let Y=$.endsWith(".stx")?$.slice(0,-4):$,G=(L)=>L.split("-").map((O)=>O.charAt(0).toUpperCase()+O.slice(1)).join(""),z=(L)=>L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q=J.__importedComponents;if(q){for(let L of[Y,Y.toLowerCase(),G(Y),z(Y)])if(q.has(L))return!0}let K=[...new Set([`${Y}.stx`,`${G(Y)}.stx`,`${z(Y)}.stx`])],W=typeof Q.root==="string"?x.resolve(Q.root):void 0,U=W??x.dirname(X),H=[],j=(L)=>{if(L&&!H.includes(L))H.push(L)},B=J.__originalFilePath;if(B)j(x.join(x.dirname(B),"components"));if(j(Z),j(Q._rootComponentsDir),j(x.join(x.dirname(X),"components")),j(Q.componentsDir),W)j(x.resolve(W,"resources/views/components")),j(x.resolve(W,"resources/components")),j(x.resolve(W,"src/components")),j(x.resolve(W,"components"));for(let L of Q._layerComponentDirs??[])j(L);let V=Q._pluginComponentDirs;if(Array.isArray(V))for(let L of V)j(typeof L==="string"?L:null);if(j(Q.fallbackComponentsDir),Y.startsWith("./")||Y.startsWith("../"))return e(x.resolve(x.dirname(X),`${Y}.stx`));let F=XZ(x.resolve(import.meta.dir,"components"));for(let L of H){let O=x.isAbsolute(L)?L:x.resolve(U,L);if(XZ(O)===F)continue;for(let _ of K)if(await e(x.join(O,_)))return!0}return!1}function XZ($){try{return zZ.realpathSync($)}catch{return $}}function Pz($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function vz($){if(!$)return!1;let Z=$.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(Z)}function fz($){let Z=new Set,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let X of $){let Q;while((Q=J.exec(X))!==null)Z.add(Q[1]);J.lastIndex=0}return[...Z]}async function A1($,Z,J,X,Q,Y,G,z=new Set,q){let{extractVariables:K}=await a("stx/variable-extractor",()=>import("./chunk-dnesmvvb.js")),W=z??new Set;if(W.has($))return`[Circular component reference: ${$}]`;let U=new Set(W);U.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&Pz(H)?H:"";try{let B=(d)=>d.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),V=(d)=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,L=null,O=Q.__importedComponents;if(O){let d=[F,F.toLowerCase(),B(F),V(F)];for(let m of d)if(O.has(m)){L=O.get(m);break}}let _=[];if(!L){let d=[`${F}.stx`,`${B(F)}.stx`,`${V(F)}.stx`],m=[...new Set(d)],K0=Q.__originalFilePath,r=[];if(r.push(...G._layerComponentDirs??[]),K0){let A0=x.join(x.dirname(K0),"components");r.push(A0)}if(X)r.push(X);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!r.includes(F0))r.push(F0);let D0=x.join(x.dirname(Y),"components");if(!r.includes(D0))r.push(D0);if(G.componentsDir&&G.componentsDir!==X&&!r.includes(G.componentsDir))r.push(G.componentsDir);let P0=typeof G.root==="string"?x.resolve(G.root):void 0,c0=P0??x.dirname(Y),C0=[];if(P0)C0.push(x.resolve(P0,"resources/views/components")),C0.push(x.resolve(P0,"resources/components")),C0.push(x.resolve(P0,"src/components")),C0.push(x.resolve(P0,"components"));C0.push(x.resolve(import.meta.dir,"components"));for(let A0 of C0)if(!r.includes(A0))r.push(A0);let X1=G._pluginComponentDirs;if(Array.isArray(X1)){for(let A0 of X1)if(typeof A0==="string"&&!r.includes(A0))r.push(A0)}if(G.fallbackComponentsDir&&!r.includes(G.fallbackComponentsDir))r.push(G.fallbackComponentsDir);let t=[...new Set(r.map((A0)=>{if(!A0)return A0;return x.isAbsolute(A0)?A0:x.resolve(c0,A0)}))];r.length=0,r.push(...t);let t0=`${F}\x00${Y}\x00${t.join("\x00")}`,P2=v9.get(t0);if(P2)if(await e(P2))L=P2;else v9.delete(t0);if(!L&&(F.startsWith("./")||F.startsWith("../")))L=x.resolve(x.dirname(Y),`${F}.stx`),_.push(L);else if(!L)for(let A0 of r){if(!A0)continue;for(let v2 of m){let f2=x.join(A0,v2);if(_.push(f2),await e(f2)){L=f2;break}}if(L)break;if(!L)try{let v2=await import("fs");if(!v2.statSync(A0,{throwIfNoEntry:!1})?.isDirectory())continue;let wZ=8,x9=[{path:A0,depth:0}];while(x9.length>0&&!L){let x2=x9.pop();if(x2.depth>=wZ)continue;let n$;try{n$=v2.readdirSync(x2.path,{withFileTypes:!0})}catch{continue}for(let g2 of n$){if(!g2.isDirectory())continue;if(g2.name==="node_modules"||g2.name.startsWith("."))continue;let s$=x.join(x2.path,g2.name);for(let RZ of m){let g9=x.join(s$,RZ);if(_.push(g9),await e(g9)){L=g9;break}}if(L)break;x9.push({path:s$,depth:x2.depth+1})}}}catch{}if(L)break}if(L)v9.set(t0,L)}if(!L||!await e(L)){let d=_.length>0?`
3619
3619
  Searched paths:
3620
3620
  ${_.map((m)=>` - ${m}`).join(`
3621
- `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${d}`}q.add(L);let w;if(y2.has(L))w=y2.get(L);else try{w=await Bun.file(L).text(),y2.set(L,w)}catch(d){return`[Error loading component: ${d instanceof Error?d.message:String(d)}]`}let R=new Set(["__originalFilePath","__importedComponents",h2,"__stx_client_signal_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),N={};for(let[d,m]of Object.entries(Q))if(!d.startsWith("__")||R.has(d))N[d]=m;let A=J;if(J.includes("@include")){let{processIncludes:d}=await a("stx/includes",()=>import("./chunk-94c8we2y.js"));A=await d(J,Q,Y,G,q)}let k=n0(A),D=[],I=k.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(d,m)=>{let K0=k.scripts[Number(m)]||"",r=K0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=r.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),D0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(r)&&D0)return D.push(K0),"";return K0}),{extractSlotContent:T}=await a("stx/slots",()=>import("./chunk-x3evfp7c.js")),M=T(I),E={};if(M.defaultSlot?.trim())E.default=M.defaultSlot;for(let[d,m]of M.namedSlots)E[d]=m.content;let C=Q.__stx_scope_seq??={n:0,key:Bun.hash(String(Q.__filename??Y)).toString(36).slice(0,6)},y=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++C.n}_${C.key}`,b={...N,$uid:y,...Z,props:Z,slot:I,$slots:E,__processedComponents:U,__sections:{},__stx_signals_gate:Y1(w)||vz(J)};Sz(w,b);let P=w,g=z9(P);if(g)P=g.content.trim();let c=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,l=[...w.matchAll(c)],h=[],s=l.some((d)=>/\bserver\b/.test(d[1]||"")&&/\bcache\b/.test(d[1]||"")),u=null,z0=null,d0=null,x0=0,m0=null;if(Iz(G),s&&l$>0){let d=kz({props:Z,slot:J,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,layers:G._layerGraph?.layers.map((m)=>m.configFile),uid:y});if(d!==null){u=`${L}\x00${H1(w)}\x00${d}`;let m=f9.get(u);if(m){for(let K0 of m.dependencies)q.add(K0);if(z3(Q,m.clientFactories),C.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let K0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[]);for(let r of m.preservedClientExpressions)K0.add(r);Q.__stx_preserved_client_expressions=[...K0]}return m.output}z0=new Set(q),d0=Q3(Q),x0=C.n,m0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[])}}for(let d of l){let m=d[1]||"",K0=d[2]||"",r=m.includes("server");if(M1(m)&&K0.trim())K0=I1(K0);if(r&&K0)try{await K(K0,b,L)}catch(D0){}if(!r){let D0=K0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),P0=D0.includes("{{")&&D0.includes("}}"),c0=D0.includes("{!!")&&D0.includes("!!}");if(P0||c0)D0=p9(D0,b);let C0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");h.push(`<script${C0}>${D0}</script>`)}}let J0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),j0=J0?J0[1]:"",p=J0?J0[2]:"",i="",U0=j0&&/\bscoped\b/i.test(j0);if(J0)i=`<style${j0}>${p}</style>`;let Y0=P;if(Y0=Y0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),J0)Y0=Y0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let d=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(Y0=Y0.replace(d,(K0,r)=>{let F0=r.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)m.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),Y0=Y0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)i=`${i}${m.join(`
3622
- `)}`}if(J&&Y0.includes("{{ text || slot }}"))Y0=Y0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>J);let{applySlots:O0}=await a("stx/slots",()=>import("./chunk-x3evfp7c.js")),{defaultSlot:E0,namedSlots:j1}=M,X2=h.some((d)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(d)),S2=(d)=>X2?j8(d,y):d,S=new Map([...j1].map(([d,m])=>[d,{...m,content:S2(m.content)}]));Y0=await O0(Y0,S2(E0),S,b);let v=fz(h),o=Array.isArray(b.__stx_client_signal_names)?b.__stx_client_signal_names:[];if(v.length>0||o.length>0)b.__stx_client_signal_names=[...new Set([...o,...v])];let X0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:x.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:X2||h.length===0,defaultLayout:void 0};b.__stxProcessingDepth=(Q.__stxProcessingDepth||0)+1;let W0=await h$(Y0,b,L,X0,q),N0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[]);for(let d of W0.matchAll(/\{\{([\s\S]*?)\}\}/g))N0.add(d[1].trim());if(N0.size>0)Q.__stx_preserved_client_expressions=[...N0];let l0=y,S0=W0;if(X2){let d="";if(Object.keys(Z).length>0)try{d=` data-stx-props="${ZZ(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${ZZ(j)}"`:"";S0=`<div data-stx-scope="${l0}"${d}${m}>${W0}</div>`;let K0=await Promise.all(h.map(async(r)=>{let F0=r.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!F0)return r;let[,D0,P0]=F0,{vendorStyleTags:c0,factoryBody:C0}=await hz(P0,L,G.buildMode==="compile"),X1=j?null:d9(Q,C0),t=X1?`window.__stxComponentFactories[${JSON.stringify(X1)}](${JSON.stringify(l0)});`:`(${C0})(${JSON.stringify(l0)});`;if(j)return`${c0}<script type="stx/island" data-stx-island="${l0}" data-stx-scoped data-stx-owner="${l0}"${D0}>${t}</script>`;return`${c0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${l0}"${D0}>${t}</script>`}));if(S0=S0+`
3621
+ `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${d}`}q.add(L);let w;if(y2.has(L))w=y2.get(L);else try{w=await Bun.file(L).text(),y2.set(L,w)}catch(d){return`[Error loading component: ${d instanceof Error?d.message:String(d)}]`}let R=new Set(["__originalFilePath","__importedComponents",h2,"__stx_client_signal_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),N={};for(let[d,m]of Object.entries(Q))if(!d.startsWith("__")||R.has(d))N[d]=m;let A=J;if(J.includes("@include")){let{processIncludes:d}=await a("stx/includes",()=>import("./chunk-ewsx2qxm.js"));A=await d(J,Q,Y,G,q)}let k=n0(A),D=[],I=k.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(d,m)=>{let K0=k.scripts[Number(m)]||"",r=K0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=r.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),D0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(r)&&D0)return D.push(K0),"";return K0}),{extractSlotContent:T}=await a("stx/slots",()=>import("./chunk-907qxn09.js")),M=T(I),E={};if(M.defaultSlot?.trim())E.default=M.defaultSlot;for(let[d,m]of M.namedSlots)E[d]=m.content;let C=Q.__stx_scope_seq??={n:0,key:Bun.hash(String(Q.__filename??Y)).toString(36).slice(0,6)},y=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++C.n}_${C.key}`,b={...N,$uid:y,...Z,props:Z,slot:I,$slots:E,__processedComponents:U,__sections:{},__stx_signals_gate:Y1(w)||vz(J)};Sz(w,b);let P=w,g=z9(P);if(g)P=g.content.trim();let c=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,l=[...w.matchAll(c)],h=[],s=l.some((d)=>/\bserver\b/.test(d[1]||"")&&/\bcache\b/.test(d[1]||"")),u=null,z0=null,d0=null,x0=0,m0=null;if(Iz(G),s&&l$>0){let d=kz({props:Z,slot:J,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,layers:G._layerGraph?.layers.map((m)=>m.configFile),uid:y});if(d!==null){u=`${L}\x00${H1(w)}\x00${d}`;let m=f9.get(u);if(m){for(let K0 of m.dependencies)q.add(K0);if(z3(Q,m.clientFactories),C.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let K0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[]);for(let r of m.preservedClientExpressions)K0.add(r);Q.__stx_preserved_client_expressions=[...K0]}return m.output}z0=new Set(q),d0=Q3(Q),x0=C.n,m0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[])}}for(let d of l){let m=d[1]||"",K0=d[2]||"",r=m.includes("server");if(M1(m)&&K0.trim())K0=I1(K0);if(r&&K0)try{await K(K0,b,L)}catch(D0){}if(!r){let D0=K0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),P0=D0.includes("{{")&&D0.includes("}}"),c0=D0.includes("{!!")&&D0.includes("!!}");if(P0||c0)D0=p9(D0,b);let C0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");h.push(`<script${C0}>${D0}</script>`)}}let J0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),j0=J0?J0[1]:"",p=J0?J0[2]:"",i="",U0=j0&&/\bscoped\b/i.test(j0);if(J0)i=`<style${j0}>${p}</style>`;let Y0=P;if(Y0=Y0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),J0)Y0=Y0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let d=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(Y0=Y0.replace(d,(K0,r)=>{let F0=r.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)m.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),Y0=Y0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)i=`${i}${m.join(`
3622
+ `)}`}if(J&&Y0.includes("{{ text || slot }}"))Y0=Y0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>J);let{applySlots:O0}=await a("stx/slots",()=>import("./chunk-907qxn09.js")),{defaultSlot:E0,namedSlots:j1}=M,X2=h.some((d)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(d)),S2=(d)=>X2?j8(d,y):d,S=new Map([...j1].map(([d,m])=>[d,{...m,content:S2(m.content)}]));Y0=await O0(Y0,S2(E0),S,b);let v=fz(h),o=Array.isArray(b.__stx_client_signal_names)?b.__stx_client_signal_names:[];if(v.length>0||o.length>0)b.__stx_client_signal_names=[...new Set([...o,...v])];let X0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:x.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:X2||h.length===0,defaultLayout:void 0};b.__stxProcessingDepth=(Q.__stxProcessingDepth||0)+1;let W0=await h$(Y0,b,L,X0,q),N0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[]);for(let d of W0.matchAll(/\{\{([\s\S]*?)\}\}/g))N0.add(d[1].trim());if(N0.size>0)Q.__stx_preserved_client_expressions=[...N0];let l0=y,S0=W0;if(X2){let d="";if(Object.keys(Z).length>0)try{d=` data-stx-props="${ZZ(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${ZZ(j)}"`:"";S0=`<div data-stx-scope="${l0}"${d}${m}>${W0}</div>`;let K0=await Promise.all(h.map(async(r)=>{let F0=r.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!F0)return r;let[,D0,P0]=F0,{vendorStyleTags:c0,factoryBody:C0}=await hz(P0,L,G.buildMode==="compile"),X1=j?null:d9(Q,C0),t=X1?`window.__stxComponentFactories[${JSON.stringify(X1)}](${JSON.stringify(l0)});`:`(${C0})(${JSON.stringify(l0)});`;if(j)return`${c0}<script type="stx/island" data-stx-island="${l0}" data-stx-scoped data-stx-owner="${l0}"${D0}>${t}</script>`;return`${c0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${l0}"${D0}>${t}</script>`}));if(S0=S0+`
3623
3623
  `+K0.join(`
3624
3624
  `),i)S0+=`
3625
3625
  `+i}else{if(i)S0+=`
@@ -3642,7 +3642,7 @@ ${$0.yellow}${$0.bold}Message:${$0.reset} ${Z}
3642
3642
  `,z)W+=`
3643
3643
  ${$0.blue}${$0.bold}Context:${$0.reset}
3644
3644
  ${$0.dim}${z}${$0.reset}
3645
- `;return W}function QL(){y2.clear(),v9.clear(),f9.clear()}function GL(){return{size:y2.size,maxSize:500}}var m$=E1(128);async function hz($,Z,J){let X=H1($,Z,J),Q=m$.get(X);if(Q){if(GZ(Q.deps))return Q;m$.delete(X)}let Y=p$($,{filePath:Z,projectRoot:process.cwd()}),G=Y.code,z=i$(Y.styles);G=t1(G).code;let{hasUserImports:q,bundleClientScript:K}=await a("stx/client-script-bundler",()=>import("./chunk-793gxvjv.js")),W=[],U=!1;if(q(G)){let L=G;G=await K(L,Z,{projectRoot:process.cwd(),minify:J,collectInputs:W}),U=G===L}let{stripStxRuntimeImports:H}=await a("stx/signal-processing",()=>import("./chunk-v82r1j02.js"));G=H(G);let j=Z1(G),B=bz(j),V=`function(__scopeId) {
3645
+ `;return W}function QL(){y2.clear(),v9.clear(),f9.clear()}function GL(){return{size:y2.size,maxSize:500}}var m$=E1(128);async function hz($,Z,J){let X=H1($,Z,J),Q=m$.get(X);if(Q){if(GZ(Q.deps))return Q;m$.delete(X)}let Y=p$($,{filePath:Z,projectRoot:process.cwd()}),G=Y.code,z=i$(Y.styles);G=t1(G).code;let{hasUserImports:q,bundleClientScript:K}=await a("stx/client-script-bundler",()=>import("./chunk-046dp691.js")),W=[],U=!1;if(q(G)){let L=G;G=await K(L,Z,{projectRoot:process.cwd(),minify:J,collectInputs:W}),U=G===L}let{stripStxRuntimeImports:H}=await a("stx/signal-processing",()=>import("./chunk-y1x2ebhv.js"));G=H(G);let j=Z1(G),B=bz(j),V=`function(__scopeId) {
3646
3646
  ${i1("const",[...YZ,...B],j)}
3647
3647
  const __scope = window.stx._scopes = window.stx._scopes || {};
3648
3648
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -3741,7 +3741,7 @@ else {
3741
3741
  // STX: auto-generated event bindings
3742
3742
  ${$.map((J,X)=>Jq(J,X)).join(`
3743
3743
  `)}`}function HZ($){let Z=[],J=new Set,X=$.replace(/^\s*import\s+.*$/gm,""),Q=0,Y=X.length,G=0;while(G<Y){let z=X[G];if(z==="'"||z==='"'||z==="`"){let q=z;if(G++,q==="`"){let K=0;while(G<Y){if(X[G]==="\\"){G+=2;continue}if(X[G]==="`"&&K===0){G++;break}if(X[G]==="$"&&X[G+1]==="{"){K++,G+=2;continue}if(X[G]==="}"&&K>0){K--,G++;continue}G++}}else while(G<Y){if(X[G]==="\\"){G+=2;continue}if(X[G]===q){G++;break}G++}continue}if(z==="/"&&X[G+1]==="/"){while(G<Y&&X[G]!==`
3744
- `)G++;continue}if(z==="/"&&X[G+1]==="*"){G+=2;while(G<Y-1&&!(X[G]==="*"&&X[G+1]==="/"))G++;G+=2;continue}if(z==="{"){Q++,G++;continue}if(z==="}"){Q--,G++;continue}if(Q===0){let q=X.slice(G),K=q.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(K){let H=K[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=K[0].length;continue}let W=q.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(W){W[1].split(",").forEach((H)=>{let j=H.trim(),B=j.indexOf(":"),V=B>=0?j.slice(B+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(V&&!V.startsWith("_")&&!J.has(V))Z.push(V),J.add(V)}),G+=W[0].length;continue}let U=q.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(U){let H=U[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=U[0].length;continue}}G++}return Z}var Yq=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function Qq($){let Z=new Set,J=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function X(H){let j;while((j=J.exec(H))!==null){let B=j[0];if(!Yq.has(B))Z.add(B)}}let Q=/\{\{([\s\S]*?)\}\}/g,Y;while((Y=Q.exec($))!==null)X(Y[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Y=G.exec($))!==null)X(Y[1]);let z=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Y=z.exec($))!==null)X(Y[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Y=q.exec($))!==null)X(Y[1]);let K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Y=K.exec($))!==null)X(Y[1]);let W=/@model\s*=\s*["']([^"']*)["']/gi;while((Y=W.exec($))!==null)X(Y[1]);let U=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Y=U.exec($))!==null)X(Y[1]);return Z}async function y9($,Z={}){let J=$,X="",Q=!1,Y=[],G=p$(J,{filePath:Z.filePath,projectRoot:Z.projectRoot});J=G.code;let z=i$(G.styles),q=t1(J);J=q.code,Y=[...q.imports,...q.models];let{hasUserImports:K,bundleClientScript:W}=await a("stx/client-script-bundler",()=>import("./chunk-793gxvjv.js"));if(K(J))J=await W(J,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Q=!0;if(Z.autoImports!==!1){let _=LZ(J);J=_.code,X=FZ(_.stxImports,_.browserImports.filter((w)=>!Y.includes(w)))}if(X=`${E$(J,Z.serverData)}${X}`,J=Z1(J),!Q&&M1(Z.attrs||""))J=I1(J);let U=Xq(Z.eventBindings||[]),H=(Z.attrs||"").trim(),j=/\btype\s*=\s*["']module["']/i.test(H),B=Z.instanceId?` data-stx-instance="${Z.instanceId}"`:"";if(j){let _=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),w=`type="module" data-stx-scoped${B}${_?` ${_}`:""}`;return`${z}<script ${w}>
3744
+ `)G++;continue}if(z==="/"&&X[G+1]==="*"){G+=2;while(G<Y-1&&!(X[G]==="*"&&X[G+1]==="/"))G++;G+=2;continue}if(z==="{"){Q++,G++;continue}if(z==="}"){Q--,G++;continue}if(Q===0){let q=X.slice(G),K=q.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(K){let H=K[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=K[0].length;continue}let W=q.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(W){W[1].split(",").forEach((H)=>{let j=H.trim(),B=j.indexOf(":"),V=B>=0?j.slice(B+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(V&&!V.startsWith("_")&&!J.has(V))Z.push(V),J.add(V)}),G+=W[0].length;continue}let U=q.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(U){let H=U[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=U[0].length;continue}}G++}return Z}var Yq=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function Qq($){let Z=new Set,J=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function X(H){let j;while((j=J.exec(H))!==null){let B=j[0];if(!Yq.has(B))Z.add(B)}}let Q=/\{\{([\s\S]*?)\}\}/g,Y;while((Y=Q.exec($))!==null)X(Y[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Y=G.exec($))!==null)X(Y[1]);let z=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Y=z.exec($))!==null)X(Y[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Y=q.exec($))!==null)X(Y[1]);let K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Y=K.exec($))!==null)X(Y[1]);let W=/@model\s*=\s*["']([^"']*)["']/gi;while((Y=W.exec($))!==null)X(Y[1]);let U=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Y=U.exec($))!==null)X(Y[1]);return Z}async function y9($,Z={}){let J=$,X="",Q=!1,Y=[],G=p$(J,{filePath:Z.filePath,projectRoot:Z.projectRoot});J=G.code;let z=i$(G.styles),q=t1(J);J=q.code,Y=[...q.imports,...q.models];let{hasUserImports:K,bundleClientScript:W}=await a("stx/client-script-bundler",()=>import("./chunk-046dp691.js"));if(K(J))J=await W(J,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Q=!0;if(Z.autoImports!==!1){let _=LZ(J);J=_.code,X=FZ(_.stxImports,_.browserImports.filter((w)=>!Y.includes(w)))}if(X=`${E$(J,Z.serverData)}${X}`,J=Z1(J),!Q&&M1(Z.attrs||""))J=I1(J);let U=Xq(Z.eventBindings||[]),H=(Z.attrs||"").trim(),j=/\btype\s*=\s*["']module["']/i.test(H),B=Z.instanceId?` data-stx-instance="${Z.instanceId}"`:"";if(j){let _=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),w=`type="module" data-stx-scoped${B}${_?` ${_}`:""}`;return`${z}<script ${w}>
3745
3745
  ${a1(`${X}${J}
3746
3746
  ${U}`)}
3747
3747
  </script>`}let V=BZ($),F=/function __stx_setup_/.test(J),L=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function O(_){let w=_.length>0?`
@@ -3756,4 +3756,4 @@ ${U}${w}`)}
3756
3756
  ${a1(`${X}${J}
3757
3757
  ${U}`)}
3758
3758
  })()</script>`}
3759
- export{aZ as Cl,tZ as Dl,eZ as El,e0 as Fl,s9 as Gl,o9 as Hl,r9 as Il,a9 as Jl,v3 as Kl,P3 as Ll,zJ as Ml,KJ as Nl,UJ as Ol,lq as Pl,cq as Ql,pq as Rl,iq as Sl,nq as Tl,oZ as Ul,b3 as Vl,y3 as Wl,C3 as Xl,S3 as Yl,dq as Zl,p3 as _l,W2 as $l,h9 as am,u9 as bm,IZ as cm,Z3 as dm,zq as em,k2 as fm,e1 as gm,eB as hm,p$ as im,i$ as jm,iz as km,t1 as lm,LZ as mm,OZ as nm,FZ as om,NL as pm,b9 as qm,E$ as rm,y9 as sm,Uq as tm,m2 as um,Hq as vm,jq as wm,Bq as xm,Vq as ym,c2 as zm,EZ as Am,Mq as Bm,bZ as Cm,Iq as Dm,c9 as Em,V3 as Fm,Y1 as Gm,p9 as Hm,SZ as Im,kq as Jm,V1 as Km,PZ as Lm,Tq as Mm,v0 as Nm,Eq as Om,Sq as Pm,mZ as Qm,lZ as Rm,k3 as Sm,T3 as Tm,E3 as Um,hq as Vm,f3 as Wm,e9 as Xm,q2 as Ym,p2 as Zm,aq as _m,t9 as $m,BJ as an,VJ as bn,_J as cn,tq as dn,g3 as en,h3 as fn,q1 as gn,Y9 as hn,w0 as in,S7 as jn,R5 as kn,K1 as ln,O1 as mn,P7 as nn,V2 as on,Q9 as pn,N5 as qn,EX as rn,yX as sn,x7 as tn,SX as un,PX as vn,h7 as wn,F1 as xn,$U as yn,u7 as zn,T5 as An,hX as Bn,k5 as Cn,uX as Dn,dX as En,ZU as Fn,JU as Gn,d7 as Hn,m7 as In,l7 as Jn,mX as Kn,lX as Ln,XU as Mn,YU as Nn,cX as On,QU as Pn,GU as Qn,i7 as Rn,r7 as Sn,y5 as Tn,LU as Un,O2 as Vn,C5 as Wn,S5 as Xn,OU as Yn,GY as Zn,FU as _n,zY as $n,e7 as ao,wU as bo,qY as co,RU as do,NU as eo,z9 as fo,Z4 as go,J4 as ho,X4 as io,kU as jo,u5 as ko,lU as lo,cU as mo,pU as no,iU as oo,bY as po,C4 as qo,X$ as ro,uY as so,Y$ as to,f6 as uo,NB as vo,d6 as wo,ZG as xo,rB as yo,GG as zo,$8 as Ao,b$ as Bo,Z8 as Co,X8 as Do,y$ as Eo,NG as Fo,DG as Go,Y8 as Ho,o6 as Io,AG as Jo,IG as Ko,F$ as Lo,M6 as Mo,I6 as No,o8 as Oo,Hz as Po,jz as Qo,Bz as Ro,Vz as So,_z as To,r8 as Uo,wz as Vo,Az as Wo,Mz as Xo,e4 as Yo,U$ as Zo,Z6 as _o,Nj as $o,Dj as ap,c4 as bp,Aj as cp,z$ as dp,q$ as ep,K$ as fp,Q6 as gp,G6 as hp,z6 as ip,V7 as jp,_7 as kp,L7 as lp,O7 as mp,H5 as np,j5 as op,sK as pp,oK as qp,rK as rp,JX as sp,aK as tp,nj as up,sj as vp,K6 as wp,oj as xp,LQ as yp,U6 as zp,V6 as Ap,_$ as Bp,SQ as Cp,L$ as Dp,w6 as Ep,R6 as Fp,mQ as Gp,QB as Hp,GB as Ip,N6 as Jp,zB as Kp,qB as Lp,O$ as Mp,E6 as Np,A9 as Op,M9 as Pp,r1 as Qp,pQ as Rp,y6 as Sp,C6 as Tp,jB as Up,N$ as Vp,iQ as Wp,nQ as Xp,D$ as Yp,A$ as Zp,S6 as _p,P6 as $p,C$ as aq,S$ as bq,f$ as cq,h$ as dq,$z as eq,Qz as fq,Gz as gq,zz as hq,qz as iq,Tz as jq,M1 as kq,d$ as lq,I1 as mq,B9 as nq,Pz as oq,vz as pq,fz as qq,A1 as rq,e as sq,a2 as tq,KZ as uq,_0 as vq,QL as wq,GL as xq,i3 as yq,n3 as zq,_1 as Aq,s3 as Bq,S1 as Cq,o3 as Dq,U2 as Eq,UK as Fq,bJ as Gq,Z5 as Hq,HK as Iq,J5 as Jq,jK as Kq,BK as Lq,G1 as Mq,VK as Nq,_K as Oq,LK as Pq,OK as Qq,FK as Rq,wK as Sq,yJ as Tq,Y5 as Uq,r3 as Vq,NK as Wq,DK as Xq,AK as Yq,MK as Zq,IK as _q,t3 as $q,kK as ar,e3 as br,TK as cr,EK as dr,H2 as er,xJ as fr,SK as gr,hJ as hr,Q7 as ir,o2 as jr,hK as kr,H7 as lr,U5 as mr,XW as nr,V5 as or,qX as pr,HX as qr,YW as rr,QW as sr,GW as tr,zW as ur,qW as vr,KW as wr,jX as xr,BX as yr,R7 as zr,_5 as Ar,OX as Br,O5 as Cr,y7 as Dr,IW as Er,kW as Fr,w5 as Gr,AX as Hr,C7 as Ir};
3759
+ export{aZ as Dl,tZ as El,eZ as Fl,e0 as Gl,s9 as Hl,o9 as Il,r9 as Jl,a9 as Kl,v3 as Ll,P3 as Ml,zJ as Nl,KJ as Ol,UJ as Pl,lq as Ql,cq as Rl,pq as Sl,iq as Tl,nq as Ul,oZ as Vl,b3 as Wl,y3 as Xl,C3 as Yl,S3 as Zl,dq as _l,p3 as $l,W2 as am,h9 as bm,u9 as cm,IZ as dm,Z3 as em,zq as fm,k2 as gm,e1 as hm,eB as im,p$ as jm,i$ as km,iz as lm,t1 as mm,LZ as nm,OZ as om,FZ as pm,NL as qm,b9 as rm,E$ as sm,y9 as tm,Uq as um,m2 as vm,Hq as wm,jq as xm,Bq as ym,Vq as zm,c2 as Am,EZ as Bm,Mq as Cm,bZ as Dm,Iq as Em,c9 as Fm,V3 as Gm,Y1 as Hm,p9 as Im,SZ as Jm,kq as Km,V1 as Lm,PZ as Mm,Tq as Nm,v0 as Om,Eq as Pm,Sq as Qm,mZ as Rm,lZ as Sm,k3 as Tm,T3 as Um,E3 as Vm,hq as Wm,f3 as Xm,e9 as Ym,q2 as Zm,p2 as _m,aq as $m,t9 as an,BJ as bn,VJ as cn,_J as dn,tq as en,g3 as fn,h3 as gn,q1 as hn,Y9 as in,w0 as jn,S7 as kn,R5 as ln,K1 as mn,O1 as nn,P7 as on,V2 as pn,Q9 as qn,N5 as rn,EX as sn,yX as tn,x7 as un,SX as vn,PX as wn,h7 as xn,F1 as yn,$U as zn,u7 as An,T5 as Bn,hX as Cn,k5 as Dn,uX as En,dX as Fn,ZU as Gn,JU as Hn,d7 as In,m7 as Jn,l7 as Kn,mX as Ln,lX as Mn,XU as Nn,YU as On,cX as Pn,QU as Qn,GU as Rn,i7 as Sn,r7 as Tn,y5 as Un,LU as Vn,O2 as Wn,C5 as Xn,S5 as Yn,OU as Zn,GY as _n,FU as $n,zY as ao,e7 as bo,wU as co,qY as do,RU as eo,NU as fo,z9 as go,Z4 as ho,J4 as io,X4 as jo,kU as ko,u5 as lo,lU as mo,cU as no,pU as oo,iU as po,bY as qo,C4 as ro,X$ as so,uY as to,Y$ as uo,f6 as vo,NB as wo,d6 as xo,ZG as yo,rB as zo,GG as Ao,$8 as Bo,b$ as Co,Z8 as Do,X8 as Eo,y$ as Fo,NG as Go,DG as Ho,Y8 as Io,o6 as Jo,AG as Ko,IG as Lo,F$ as Mo,M6 as No,I6 as Oo,o8 as Po,Hz as Qo,jz as Ro,Bz as So,Vz as To,_z as Uo,r8 as Vo,wz as Wo,Az as Xo,Mz as Yo,e4 as Zo,U$ as _o,Z6 as $o,Nj as ap,Dj as bp,c4 as cp,Aj as dp,z$ as ep,q$ as fp,K$ as gp,Q6 as hp,G6 as ip,z6 as jp,V7 as kp,_7 as lp,L7 as mp,O7 as np,H5 as op,j5 as pp,sK as qp,oK as rp,rK as sp,JX as tp,aK as up,nj as vp,sj as wp,K6 as xp,oj as yp,LQ as zp,U6 as Ap,V6 as Bp,_$ as Cp,SQ as Dp,L$ as Ep,w6 as Fp,R6 as Gp,mQ as Hp,QB as Ip,GB as Jp,N6 as Kp,zB as Lp,qB as Mp,O$ as Np,E6 as Op,A9 as Pp,M9 as Qp,r1 as Rp,pQ as Sp,y6 as Tp,C6 as Up,jB as Vp,N$ as Wp,iQ as Xp,nQ as Yp,D$ as Zp,A$ as _p,S6 as $p,P6 as aq,C$ as bq,S$ as cq,f$ as dq,h$ as eq,$z as fq,Qz as gq,Gz as hq,zz as iq,qz as jq,Tz as kq,M1 as lq,d$ as mq,I1 as nq,B9 as oq,Pz as pq,vz as qq,fz as rq,A1 as sq,e as tq,a2 as uq,KZ as vq,_0 as wq,QL as xq,GL as yq,i3 as zq,n3 as Aq,_1 as Bq,s3 as Cq,S1 as Dq,o3 as Eq,U2 as Fq,UK as Gq,bJ as Hq,Z5 as Iq,HK as Jq,J5 as Kq,jK as Lq,BK as Mq,G1 as Nq,VK as Oq,_K as Pq,LK as Qq,OK as Rq,FK as Sq,wK as Tq,yJ as Uq,Y5 as Vq,r3 as Wq,NK as Xq,DK as Yq,AK as Zq,MK as _q,IK as $q,t3 as ar,kK as br,e3 as cr,TK as dr,EK as er,H2 as fr,xJ as gr,SK as hr,hJ as ir,Q7 as jr,o2 as kr,hK as lr,H7 as mr,U5 as nr,XW as or,V5 as pr,qX as qr,HX as rr,YW as sr,QW as tr,GW as ur,zW as vr,qW as wr,KW as xr,jX as yr,BX as zr,R7 as Ar,_5 as Br,OX as Cr,O5 as Dr,y7 as Er,IW as Fr,kW as Gr,w5 as Hr,AX as Ir,C7 as Jr};