@stacksjs/stx 0.2.245 → 0.2.246

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 (168) hide show
  1. package/dist/{chunk-w3pzxz3m.js → chunk-009z775h.js} +1 -1
  2. package/dist/chunk-074bfahy.js +2 -0
  3. package/dist/{chunk-092sm06a.js → chunk-0athjw48.js} +2 -2
  4. package/dist/{chunk-d19bydks.js → chunk-0j9hrzjj.js} +1 -1
  5. package/dist/{chunk-2qkasmq1.js → chunk-0pdrnxg2.js} +2 -2
  6. package/dist/{chunk-33pdtz6a.js → chunk-10s4pe0a.js} +33 -33
  7. package/dist/{chunk-19m7hed6.js → chunk-135mme4g.js} +1 -1
  8. package/dist/{chunk-2nqtzhgw.js → chunk-1e0kazb9.js} +2 -2
  9. package/dist/chunk-1vd6bg7v.js +2 -0
  10. package/dist/{chunk-p7a8mgns.js → chunk-21195t36.js} +1 -1
  11. package/dist/chunk-2rktp0wn.js +2 -0
  12. package/dist/{chunk-b6zt4aqb.js → chunk-2z5077ce.js} +2 -2
  13. package/dist/{chunk-a8fx6wcb.js → chunk-3gjrq8m7.js} +1 -1
  14. package/dist/chunk-3mm46ez1.js +2 -0
  15. package/dist/{chunk-by3zs4ag.js → chunk-3p4txpk9.js} +1 -1
  16. package/dist/chunk-47ffrbhv.js +2 -0
  17. package/dist/{chunk-tv4n71jy.js → chunk-49kk0s96.js} +2 -2
  18. package/dist/{chunk-jqkg6w3p.js → chunk-4fybwpba.js} +2 -2
  19. package/dist/{chunk-98pkw4t1.js → chunk-4zezcn44.js} +1 -1
  20. package/dist/{chunk-dq88kv1p.js → chunk-54st8g2j.js} +1 -1
  21. package/dist/{chunk-frp9fc7j.js → chunk-58f0mthg.js} +1 -1
  22. package/dist/{chunk-z2gmz9ew.js → chunk-5ec3m8hk.js} +2 -2
  23. package/dist/{chunk-xddvx94h.js → chunk-5fw9ne30.js} +1 -1
  24. package/dist/{chunk-0kq46rxg.js → chunk-6kqq7pj3.js} +1 -1
  25. package/dist/{chunk-2d13x7hs.js → chunk-6nxf4pb0.js} +2 -2
  26. package/dist/{chunk-9228drk4.js → chunk-6twytnbh.js} +2 -2
  27. package/dist/{chunk-v0tmvq31.js → chunk-6vkcpz56.js} +1 -1
  28. package/dist/{chunk-j93x5fzs.js → chunk-74cv4ta1.js} +1 -1
  29. package/dist/{chunk-g553n48p.js → chunk-7bemc914.js} +2 -2
  30. package/dist/chunk-7hvr3r5k.js +2 -0
  31. package/dist/{chunk-fvjh7rx0.js → chunk-7q9mwh4v.js} +1 -1
  32. package/dist/chunk-7w2sevn5.js +2 -0
  33. package/dist/{chunk-1p0r6k2f.js → chunk-91e3916g.js} +2 -2
  34. package/dist/{chunk-7djq40jk.js → chunk-99nrwh5w.js} +1 -1
  35. package/dist/chunk-9cqtcms8.js +2 -0
  36. package/dist/{chunk-qv3g8tde.js → chunk-9dvrqa2p.js} +1 -1
  37. package/dist/{chunk-hess6q86.js → chunk-9fkxb5wr.js} +2 -2
  38. package/dist/{chunk-ht51fz7w.js → chunk-9n0gvfrg.js} +1 -1
  39. package/dist/{chunk-20q757q9.js → chunk-9rc4cbh6.js} +1 -1
  40. package/dist/{chunk-ssfhndm6.js → chunk-9y0g8kzt.js} +1 -1
  41. package/dist/{chunk-0s88j6n8.js → chunk-absrtcb0.js} +1 -1
  42. package/dist/chunk-ahzq2gdh.js +2 -0
  43. package/dist/{chunk-n07dds2d.js → chunk-apnp72a6.js} +1 -1
  44. package/dist/chunk-aqcca4mj.js +2 -0
  45. package/dist/{chunk-cda7v05f.js → chunk-ay8kxhkr.js} +1 -1
  46. package/dist/chunk-b24yrmwm.js +2 -0
  47. package/dist/{chunk-sdfe1xce.js → chunk-b6ft3095.js} +1 -1
  48. package/dist/{chunk-qbc0adqw.js → chunk-bmfnxh4y.js} +3 -3
  49. package/dist/chunk-brbyqv80.js +2 -0
  50. package/dist/{chunk-2p5qa9pm.js → chunk-c1s7r715.js} +1 -1
  51. package/dist/{chunk-xj05xmfg.js → chunk-cqzv09x3.js} +1 -1
  52. package/dist/chunk-cwrc4qbr.js +2 -0
  53. package/dist/chunk-d1ezh03e.js +2 -0
  54. package/dist/{chunk-r84h7wxw.js → chunk-d8y85xdy.js} +1 -1
  55. package/dist/{chunk-shh4byc3.js → chunk-dgg8a6c8.js} +2 -2
  56. package/dist/{chunk-ajjwrrmz.js → chunk-dwz2rtwg.js} +1 -1
  57. package/dist/{chunk-m2w91jne.js → chunk-e2nzn35y.js} +2 -2
  58. package/dist/{chunk-adj1k3w7.js → chunk-edgvm2rh.js} +1 -1
  59. package/dist/{chunk-mv2v3g62.js → chunk-f1jd5qjb.js} +1 -1
  60. package/dist/{chunk-nhn7qftp.js → chunk-f3m0q482.js} +1 -1
  61. package/dist/{chunk-cs1dc1n7.js → chunk-f5v2qf95.js} +1 -1
  62. package/dist/{chunk-ax56kn66.js → chunk-fa3pamx8.js} +1 -1
  63. package/dist/{chunk-fzxjrdnv.js → chunk-fvh9ca47.js} +1 -1
  64. package/dist/{chunk-b212gjes.js → chunk-gh1vsaa0.js} +2 -2
  65. package/dist/{chunk-78bpc81t.js → chunk-gpmpcrww.js} +1 -1
  66. package/dist/chunk-gynahdrf.js +2 -0
  67. package/dist/{chunk-jwchwn52.js → chunk-h7aynn48.js} +22 -22
  68. package/dist/{chunk-kaet6r9w.js → chunk-hpybjwwf.js} +1 -1
  69. package/dist/chunk-hrf61g6t.js +2 -0
  70. package/dist/chunk-j1hwqjv0.js +2 -0
  71. package/dist/{chunk-1px4xey5.js → chunk-j26v67km.js} +1 -1
  72. package/dist/{chunk-6z1re4a4.js → chunk-j5h418q6.js} +2 -2
  73. package/dist/chunk-jbjg92a7.js +2 -0
  74. package/dist/chunk-jej85smh.js +2 -0
  75. package/dist/chunk-jg1xxdkj.js +2 -0
  76. package/dist/chunk-kq6nvsph.js +2 -0
  77. package/dist/chunk-kv3yrscv.js +2 -0
  78. package/dist/{chunk-x41v697c.js → chunk-mh4hd2wt.js} +1 -1
  79. package/dist/{chunk-c9843bnq.js → chunk-mrqzybb8.js} +1 -1
  80. package/dist/{chunk-q9vxc3gc.js → chunk-nza4qk68.js} +1 -1
  81. package/dist/chunk-nzkcjb7m.js +2 -0
  82. package/dist/{chunk-qs0fp63n.js → chunk-p3kn55v4.js} +1 -1
  83. package/dist/{chunk-vzskgbqj.js → chunk-pbsfbgx7.js} +1 -1
  84. package/dist/{chunk-vcreetnm.js → chunk-q79583xa.js} +1 -1
  85. package/dist/chunk-qbj89n8d.js +2 -0
  86. package/dist/chunk-qg0czr2c.js +2 -0
  87. package/dist/chunk-qh4bhceg.js +2 -0
  88. package/dist/{chunk-1md5q98r.js → chunk-qhcwqxsr.js} +2 -2
  89. package/dist/{chunk-0zdy4dpp.js → chunk-qpmas4vz.js} +117 -117
  90. package/dist/{chunk-wjahpknc.js → chunk-r1p9hha3.js} +2 -2
  91. package/dist/{chunk-b6jhznkh.js → chunk-refwkt87.js} +1 -1
  92. package/dist/chunk-rkhqmedy.js +2 -0
  93. package/dist/{chunk-c0apssp7.js → chunk-rs83cc1j.js} +1 -1
  94. package/dist/{chunk-fnty12j5.js → chunk-s2nw5t7p.js} +1 -1
  95. package/dist/{chunk-7qyz242h.js → chunk-s31j8ztb.js} +2 -2
  96. package/dist/{chunk-pxzj5tzb.js → chunk-sbsq0jvn.js} +1 -1
  97. package/dist/{chunk-k26kt6fp.js → chunk-snh1ahqp.js} +1 -1
  98. package/dist/chunk-t2kftwse.js +2 -0
  99. package/dist/{chunk-94fee5jw.js → chunk-t6nseeb9.js} +1 -1
  100. package/dist/{chunk-n3tj3h1q.js → chunk-temdqamx.js} +2 -2
  101. package/dist/{chunk-m8h6km5v.js → chunk-tzmqq1db.js} +1 -1
  102. package/dist/{chunk-qtmearwp.js → chunk-v0y3drpw.js} +3 -3
  103. package/dist/chunk-v8fs3aa7.js +2 -0
  104. package/dist/{chunk-595kj4n2.js → chunk-vhnnryps.js} +2 -2
  105. package/dist/{chunk-6mk7fd7v.js → chunk-w3pxkhqm.js} +1 -1
  106. package/dist/{chunk-rbke5wqk.js → chunk-w3ycm4na.js} +1 -1
  107. package/dist/{chunk-4mnmm48x.js → chunk-w8cdwh41.js} +2 -2
  108. package/dist/{chunk-nhmq45hh.js → chunk-w95sp0k9.js} +1 -1
  109. package/dist/{chunk-ntnv2f7a.js → chunk-wcm80anz.js} +1 -1
  110. package/dist/{chunk-z4f3gahw.js → chunk-wekcdsz0.js} +2 -2
  111. package/dist/chunk-wnrb5sn6.js +2 -0
  112. package/dist/chunk-wxm4g8c7.js +2 -0
  113. package/dist/chunk-x1r9c2hz.js +2 -0
  114. package/dist/{chunk-bn0td54v.js → chunk-x75qeb7x.js} +1 -1
  115. package/dist/{chunk-pv9at6r1.js → chunk-xttsqmkm.js} +1 -1
  116. package/dist/{chunk-1gdzz04h.js → chunk-y7m2dpd3.js} +1 -1
  117. package/dist/chunk-ycjzgz5v.js +2 -0
  118. package/dist/chunk-ykqv73eh.js +2 -0
  119. package/dist/{chunk-jy6madxa.js → chunk-ym3r8ktq.js} +1 -1
  120. package/dist/{chunk-1gaetkpx.js → chunk-z1yd16w1.js} +2 -2
  121. package/dist/{chunk-nzser3gj.js → chunk-zh74fq7v.js} +2 -2
  122. package/dist/{chunk-d35mdkw8.js → chunk-zp1qrw61.js} +2 -2
  123. package/dist/chunk-zt8e98fj.js +2 -0
  124. package/dist/cli.js +14 -14
  125. package/dist/component-library.d.ts +32 -0
  126. package/dist/component-library.js +38 -2
  127. package/dist/craft-entry.js +1 -1
  128. package/dist/craft.js +1 -1
  129. package/dist/database.js +1 -1
  130. package/dist/pwa.js +2 -2
  131. package/dist/ssg.js +2 -2
  132. package/dist/visual-testing.js +1 -1
  133. package/package.json +5 -5
  134. package/dist/chunk-02btxy6j.js +0 -2
  135. package/dist/chunk-0hatcb1t.js +0 -2
  136. package/dist/chunk-15w5gfwe.js +0 -2
  137. package/dist/chunk-404eam50.js +0 -2
  138. package/dist/chunk-47be2t3d.js +0 -2
  139. package/dist/chunk-4j8crbk6.js +0 -2
  140. package/dist/chunk-56rabpsq.js +0 -2
  141. package/dist/chunk-5a6dzmj8.js +0 -2
  142. package/dist/chunk-6qtx7w2r.js +0 -2
  143. package/dist/chunk-6rfc8exk.js +0 -2
  144. package/dist/chunk-8g7xy48w.js +0 -2
  145. package/dist/chunk-8vgcye5c.js +0 -2
  146. package/dist/chunk-8x4h673x.js +0 -2
  147. package/dist/chunk-8yn96bkr.js +0 -2
  148. package/dist/chunk-9k5symz8.js +0 -2
  149. package/dist/chunk-bx4nptd2.js +0 -2
  150. package/dist/chunk-cj3zqzd0.js +0 -2
  151. package/dist/chunk-djct09qx.js +0 -2
  152. package/dist/chunk-e03bh9ze.js +0 -2
  153. package/dist/chunk-eyfmvy7z.js +0 -2
  154. package/dist/chunk-f13qa3kb.js +0 -2
  155. package/dist/chunk-fad3d1g7.js +0 -2
  156. package/dist/chunk-fbhhzy5j.js +0 -2
  157. package/dist/chunk-gcf0z2j8.js +0 -2
  158. package/dist/chunk-kf8edvxc.js +0 -2
  159. package/dist/chunk-kq9abgx2.js +0 -2
  160. package/dist/chunk-myqyr2dp.js +0 -2
  161. package/dist/chunk-np6b30jn.js +0 -2
  162. package/dist/chunk-p6gb0bak.js +0 -2
  163. package/dist/chunk-przv5z6z.js +0 -2
  164. package/dist/chunk-qaj72jrj.js +0 -2
  165. package/dist/chunk-r2zcdk2f.js +0 -2
  166. package/dist/chunk-rg1g3xjx.js +0 -2
  167. package/dist/chunk-s0b1p8tc.js +0 -2
  168. package/dist/chunk-v8mxhfp7.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ks as o8,us as w6,vs as R6}from"./chunk-092sm06a.js";import{Bs as p5}from"./chunk-19m7hed6.js";import{Js as s0}from"./chunk-mv2v3g62.js";import{Zs as a8}from"./chunk-qtmearwp.js";import{_s as O8}from"./chunk-2qkasmq1.js";import{ft as D6,ht as N6,it as A6,kt as O5}from"./chunk-1px4xey5.js";import{lt as t8,pt as e5,rt as G2}from"./chunk-a8fx6wcb.js";import{Ct as e8}from"./chunk-x41v697c.js";import{Dt as L2,Et as j2,Ft as i1,Jt as w2,Kt as h4,Lt as Q8,Nt as D9,Qt as f8}from"./chunk-ax56kn66.js";import{Bu as KG,Cu as n$,Eu as K5,_t as e3,bu as i9,iu as p3,zu as r8}from"./chunk-z2gmz9ew.js";import{Ju as M6}from"./chunk-k26kt6fp.js";import{Ou as f}from"./chunk-qs0fp63n.js";import S1 from"path";import b5 from"fs";var f4=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"]),x4={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"},M2=new Set(["ctrl","alt","shift","meta"]),u4={left:0,middle:1,right:2};function g4($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let X of $){let J=X.toLowerCase();if(J==="prevent")Z.prevent=!0;else if(J==="stop")Z.stop=!0;else if(J==="once")Z.once=!0;else if(J==="capture")Z.capture=!0;else if(J==="self")Z.self=!0;else if(J==="passive")Z.passive=!0;else if(M2.has(J))Z.systemKeys.push(J);else if(J in u4)Z.mouse=J;else if(J in x4||/^[a-z]$/.test(J))Z.keys.push(x4[J]||J.toUpperCase());else if(J.startsWith("debounce")){let Y=J.match(/debounce(?:\.(\d+))?/);Z.debounce=Y?.[1]?Number.parseInt(Y[1],10):300}else if(J.startsWith("throttle")){let Y=J.match(/throttle(?:\.(\d+))?/);Z.throttle=Y?.[1]?Number.parseInt(Y[1],10):300}}return Z}function d4($){let Z=[],X=0,J=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=J.exec($))!==null){let[Q,G,q]=Y,U=Y.index,W=U+Q.length,z=`__stx_evt_${X++}`,K=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,B;while((B=H.exec(q))!==null){let[,_,F]=B,V=_.split("."),O=V[0];if(!f4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:F,modifiers:g4(V.slice(1)),elementId:z})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((B=j.exec(q))!==null){let[,_,F]=B,V=_.split("."),O=V[0];if(!f4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:F,modifiers:g4(V.slice(1)),elementId:z})}if(K.length>0)Z.push({originalTag:Q,elementId:z,events:K,startIndex:U,endIndex:W})}return Z}function T2($){let Z=[],{modifiers:X}=$;if(X.self)Z.push("if ($event.target !== $el) return");for(let J of X.systemKeys)Z.push(`if (!$event.${J}Key) return`);if(X.keys.length>0){let J=X.keys.map((Y)=>`$event.key === '${Y}'`).join(" || ");Z.push(`if (!(${J})) return`)}if(X.mouse!==null){let J=u4[X.mouse];Z.push(`if ($event.button !== ${J}) return`)}if(X.prevent)Z.push("$event.preventDefault()");if(X.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function I2($,Z){let X=$;if(Z.debounce!==null)X=`__stx_debounce(() => { ${X} }, ${Z.debounce})`;else if(Z.throttle!==null)X=`__stx_throttle(() => { ${X} }, ${Z.throttle})`;return X}function C$($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function k2($){let{modifiers:Z}=$,X=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),J=T2($),Y=I2(C$($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(Z.passive)Q.push("passive: true");let G=Q.length>0?`, { ${Q.join(", ")} }`:"",q=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
2
+ import{ls as o8,vs as w6,ws as R6}from"./chunk-0athjw48.js";import{Cs as p5}from"./chunk-135mme4g.js";import{Ks as s0}from"./chunk-f1jd5qjb.js";import{_s as a8}from"./chunk-v0y3drpw.js";import{$s as O8}from"./chunk-0pdrnxg2.js";import{gt as D6,it as N6,jt as A6,lt as O5}from"./chunk-j26v67km.js";import{mt as t8,qt as e5,st as G2}from"./chunk-3gjrq8m7.js";import{Dt as e8}from"./chunk-mh4hd2wt.js";import{Et as L2,Ft as j2,Gt as i1,Kt as w2,Lt as h4,Mt as Q8,Ot as D9,Rt as f8}from"./chunk-fa3pamx8.js";import{$t as e3,Au as r8,Cu as KG,Du as n$,Fu as K5,cu as i9,ju as p3}from"./chunk-5ec3m8hk.js";import{Ku as M6}from"./chunk-snh1ahqp.js";import{Pu as f}from"./chunk-p3kn55v4.js";import S1 from"path";import b5 from"fs";var f4=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"]),x4={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"},M2=new Set(["ctrl","alt","shift","meta"]),u4={left:0,middle:1,right:2};function g4($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let X of $){let J=X.toLowerCase();if(J==="prevent")Z.prevent=!0;else if(J==="stop")Z.stop=!0;else if(J==="once")Z.once=!0;else if(J==="capture")Z.capture=!0;else if(J==="self")Z.self=!0;else if(J==="passive")Z.passive=!0;else if(M2.has(J))Z.systemKeys.push(J);else if(J in u4)Z.mouse=J;else if(J in x4||/^[a-z]$/.test(J))Z.keys.push(x4[J]||J.toUpperCase());else if(J.startsWith("debounce")){let Y=J.match(/debounce(?:\.(\d+))?/);Z.debounce=Y?.[1]?Number.parseInt(Y[1],10):300}else if(J.startsWith("throttle")){let Y=J.match(/throttle(?:\.(\d+))?/);Z.throttle=Y?.[1]?Number.parseInt(Y[1],10):300}}return Z}function d4($){let Z=[],X=0,J=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=J.exec($))!==null){let[Q,G,q]=Y,U=Y.index,W=U+Q.length,z=`__stx_evt_${X++}`,K=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,B;while((B=H.exec(q))!==null){let[,_,F]=B,V=_.split("."),O=V[0];if(!f4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:F,modifiers:g4(V.slice(1)),elementId:z})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((B=j.exec(q))!==null){let[,_,F]=B,V=_.split("."),O=V[0];if(!f4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:F,modifiers:g4(V.slice(1)),elementId:z})}if(K.length>0)Z.push({originalTag:Q,elementId:z,events:K,startIndex:U,endIndex:W})}return Z}function T2($){let Z=[],{modifiers:X}=$;if(X.self)Z.push("if ($event.target !== $el) return");for(let J of X.systemKeys)Z.push(`if (!$event.${J}Key) return`);if(X.keys.length>0){let J=X.keys.map((Y)=>`$event.key === '${Y}'`).join(" || ");Z.push(`if (!(${J})) return`)}if(X.mouse!==null){let J=u4[X.mouse];Z.push(`if ($event.button !== ${J}) return`)}if(X.prevent)Z.push("$event.preventDefault()");if(X.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function I2($,Z){let X=$;if(Z.debounce!==null)X=`__stx_debounce(() => { ${X} }, ${Z.debounce})`;else if(Z.throttle!==null)X=`__stx_throttle(() => { ${X} }, ${Z.throttle})`;return X}function C$($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function k2($){let{modifiers:Z}=$,X=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),J=T2($),Y=I2(C$($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(Z.passive)Q.push("passive: true");let G=Q.length>0?`, { ${Q.join(", ")} }`:"",q=Y.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('${X}');
5
5
  if (!$el) return;
@@ -1773,7 +1773,7 @@ ${_}
1773
1773
  #${$}.stx-img-loaded img {
1774
1774
  opacity: 1;
1775
1775
  }
1776
- `.trim()}function rU($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var u1=new Map;async function m7($,Z={}){let X=`${$}:${JSON.stringify(Z)}`;if(u1.has(X))return u1.get(X);let J=await h7($,Z);return u1.set(X,J),J}function aU(){u1.clear()}function tU(){return{size:u1.size,keys:Array.from(u1.keys())}}async function pZ(){try{return await import("./chunk-sdfe1xce.js")}catch($){if(!l7)console.warn("[stx-media] Image processor not available, some features disabled:",$),l7=!0;return null}}var l7=!1,e$=80,l5="async",c5="lazy",c7=!1;async function j5($,Z={}){let X=Z,J=$;if(J.process&&!J.skipOptimization){if(X.tsImagesConfig?.enabled&&!X.isDev)return rZ(J,X)}if(X.processedResult?.processed)return X3($,X.processedResult,Z);if(X.responsiveVariants)return n7($,X.responsiveVariants,Z);let{src:Y,alt:Q,width:G,height:q,sizes:U,widths:W=L1,dpr:z,formats:K=h1,quality:H=e$,params:B={},placeholder:j="none",placeholderOptions:_={},lazy:F=!0,priority:V=!1,loading:O=V?"eager":c5,decoding:L=l5,fetchpriority:w,objectFit:R,objectPosition:D,crossorigin:N,referrerpolicy:T}=$,A=$.class,M=$.style,E=$.id,I=$.data||{},{isDev:y=!1,baseUrl:k=""}=Z;if(y&&!Z.optimize)return sZ($);let b,C,g=E||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(j!=="none"&&!V)try{b=await m7(Y,{strategy:j,..._}),C=d7(g,b,_)}catch{}let h=z!==void 0&&G!==void 0,m;if(h)m=nZ($,g,b,Z);else m=await iZ($,g,b,Z);let l;if(V){let D0=K.includes("webp")?"webp":K[0],y0=B5(Y,W,{...B,q:H},D0),q0=typeof U==="object"?o$(U):U||"100vw";l=`<link rel="preload" as="image" imagesrcset="${y0}" imagesizes="${q0}" />`}let V0=[];if(!c7&&j!=="none")V0.push(a$),c7=!0;if(C)V0.push(C);let h0=F?i7(g):void 0;return{html:m,preloadLink:l,css:V0.length>0?V0.join(`
1776
+ `.trim()}function rU($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var u1=new Map;async function m7($,Z={}){let X=`${$}:${JSON.stringify(Z)}`;if(u1.has(X))return u1.get(X);let J=await h7($,Z);return u1.set(X,J),J}function aU(){u1.clear()}function tU(){return{size:u1.size,keys:Array.from(u1.keys())}}async function pZ(){try{return await import("./chunk-b6ft3095.js")}catch($){if(!l7)console.warn("[stx-media] Image processor not available, some features disabled:",$),l7=!0;return null}}var l7=!1,e$=80,l5="async",c5="lazy",c7=!1;async function j5($,Z={}){let X=Z,J=$;if(J.process&&!J.skipOptimization){if(X.tsImagesConfig?.enabled&&!X.isDev)return rZ(J,X)}if(X.processedResult?.processed)return X3($,X.processedResult,Z);if(X.responsiveVariants)return n7($,X.responsiveVariants,Z);let{src:Y,alt:Q,width:G,height:q,sizes:U,widths:W=L1,dpr:z,formats:K=h1,quality:H=e$,params:B={},placeholder:j="none",placeholderOptions:_={},lazy:F=!0,priority:V=!1,loading:O=V?"eager":c5,decoding:L=l5,fetchpriority:w,objectFit:R,objectPosition:D,crossorigin:N,referrerpolicy:T}=$,A=$.class,M=$.style,E=$.id,I=$.data||{},{isDev:y=!1,baseUrl:k=""}=Z;if(y&&!Z.optimize)return sZ($);let b,C,g=E||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(j!=="none"&&!V)try{b=await m7(Y,{strategy:j,..._}),C=d7(g,b,_)}catch{}let h=z!==void 0&&G!==void 0,m;if(h)m=nZ($,g,b,Z);else m=await iZ($,g,b,Z);let l;if(V){let D0=K.includes("webp")?"webp":K[0],y0=B5(Y,W,{...B,q:H},D0),q0=typeof U==="object"?o$(U):U||"100vw";l=`<link rel="preload" as="image" imagesrcset="${y0}" imagesizes="${q0}" />`}let V0=[];if(!c7&&j!=="none")V0.push(a$),c7=!0;if(C)V0.push(C);let h0=F?i7(g):void 0;return{html:m,preloadLink:l,css:V0.length>0?V0.join(`
1777
1777
  `):void 0,script:h0}}async function iZ($,Z,X,J){let{src:Y,alt:Q,width:G,height:q,sizes:U,widths:W=L1,formats:z=h1,quality:K=e$,params:H={},lazy:B=!0,priority:j=!1,loading:_=j?"eager":c5,decoding:F=l5,fetchpriority:V,objectFit:O,objectPosition:L,crossorigin:w,referrerpolicy:R}=$,D=$.class,N=$.style,T=$.data||{},A=typeof U==="object"?o$(U):U||"100vw",M=[];for(let y of z){let k=B5(Y,W,{...H,q:K},y),b=r$(y);if(B&&!j)M.push(` <source type="${b}" data-srcset="${k}" data-sizes="${A}" />`);else M.push(` <source type="${b}" srcset="${k}" sizes="${A}" />`)}let E=$3({src:q1(Y,{...H,q:K}),alt:Q,width:G,height:q,loading:j?void 0:_,decoding:F,fetchpriority:j?"high":V,objectFit:O,objectPosition:L,crossorigin:w,referrerpolicy:R,className:p7(D,X),style:Z3(N,O,L,X),lazy:B&&!j,data:T}),I;if(X){let y=`background-image: url('${X.dataURL}'); background-size: cover; background-position: center;`;I=`<div id="${Z}" class="stx-img-placeholder" style="${y}">
1778
1778
  <picture>
1779
1779
  ${M.join(`
@@ -1837,7 +1837,7 @@ ${R.join(`
1837
1837
  `):void 0,script:k}}async function n7($,Z,X){let J={src:Z.src,processed:!0,variants:[],placeholder:Z.placeholder?.dataURL,originalWidth:Z.placeholder?.width,originalHeight:Z.placeholder?.height};for(let[Y,Q]of Object.entries(Z.byFormat))if(Q)J.variants.push(...Q);return X3($,J,X)}function aZ(){return p5({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async($,Z,X,J)=>{let{src:Y,alt:Q,options:G}=tZ($,Z,X);if(!Y)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let q={src:Y,alt:Q||"",widths:G.widths||L1,formats:G.formats||h1,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},U=X.__isDev||!1,W=await j5(q,{isDev:U}),z=W.html;if(W.preloadLink)z=W.preloadLink+`
1838
1838
  `+z;if(W.css)z+=`
1839
1839
  <style>${W.css}</style>`;if(W.script)z+=`
1840
- <script>${W.script}</script>`;return z},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function tZ($,Z,X){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let J=$.trim();if(J.startsWith("@img(")||J.startsWith("("))J=J.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=eZ(J),Q=J3(Y[0],X)||"",G=J3(Y[1],X)||"",q={};if(Y[2]){let U=J3(Y[2],X);if(typeof U==="object"&&U!==null)q=U;else if(typeof Y[2]==="string")try{q=JSON.parse(Y[2])}catch{}}return{src:Q,alt:G,options:q}}function eZ($){let Z=[],X="",J=!1,Y="",Q=0,G=0;for(let q=0;q<$.length;q++){let U=$[q],W=q>0?$[q-1]:"";if((U==='"'||U==="'"||U==="`")&&W!=="\\"){if(!J)J=!0,Y=U;else if(U===Y)J=!1,Y="";else X+=U;continue}if(!J){if(U==="{")Q++;if(U==="}")Q--;if(U==="[")G++;if(U==="]")G--;if(U===","&&Q===0&&G===0){Z.push(X.trim()),X="";continue}}X+=U}if(X.trim())Z.push(X.trim());return Z}function J3($,Z){if(typeof $!=="string")return $;let X=$.trim();if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'"))return X.slice(1,-1);if(!X.startsWith("/")&&!X.startsWith(".")&&!X.startsWith("http")&&!X.startsWith("{")){let J=Z[X];if(J!==void 0)return J}if(X.startsWith("{")||X.startsWith("["))try{return JSON.parse(X)}catch{}return X}var s7=aZ();async function r7(){try{return await import("./chunk-7djq40jk.js")}catch($){if(!o7)console.warn("[stx-media] Video processor not available, some features disabled:",$),o7=!0;return null}}var o7=!1,a7=!0,t7="metadata",$X="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function i5($,Z={}){let X=Z,J=$;if(J.process&&!J.skipProcessing){if(X.tsVideosConfig?.enabled&&!X.isDev)return QX(J,X)}if(X.processedResult?.processed)return $6($,X.processedResult,Z);let Y;if(J.generatePoster&&J.src&&!$.poster)Y=await GX(J,X);let{src:Q,sources:G=[],poster:q,posterPlaceholder:U,controls:W=a7,autoplay:z=!1,muted:K=!1,loop:H=!1,preload:B=t7,playsinline:j=!0,lazy:_=!0,player:F="native",type:V,width:O,height:L,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:D=!1}=$,N=Y||q,T=$.class,A=$.style,M=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(F==="ts-video")return XX($,Z);if(V&&V!=="video")return ZX(Q||"",V,$);let E=G.length>0?G:Q?[{src:Q,type:e7(Q)}]:[],I=[`id="${M}"`];if(W)I.push("controls");if(z)I.push("autoplay");if(K)I.push("muted");if(H)I.push("loop");if(j)I.push("playsinline");if(R)I.push("disablepictureinpicture");if(D)I.push("disableremoteplayback");if(w)I.push(`crossorigin="${w}"`);if(_){if(I.push(`data-preload="${B}"`),I.push('preload="none"'),N)I.push(`data-poster="${R0(N)}"`);I.push("data-stx-lazy")}else if(I.push(`preload="${B}"`),N)I.push(`poster="${R0(N)}"`);if(O)I.push(`width="${O}"`);if(L)I.push(`height="${L}"`);if(T)I.push(`class="${R0(T)}"`);if(A)I.push(`style="${R0(A)}"`);let y=E.map((C)=>{return` <source ${_?`data-src="${R0(C.src)}"`:`src="${R0(C.src)}"`} type="${C.type}"${C.media?` media="${C.media}"`:""} />`}).join(`
1840
+ <script>${W.script}</script>`;return z},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function tZ($,Z,X){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let J=$.trim();if(J.startsWith("@img(")||J.startsWith("("))J=J.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=eZ(J),Q=J3(Y[0],X)||"",G=J3(Y[1],X)||"",q={};if(Y[2]){let U=J3(Y[2],X);if(typeof U==="object"&&U!==null)q=U;else if(typeof Y[2]==="string")try{q=JSON.parse(Y[2])}catch{}}return{src:Q,alt:G,options:q}}function eZ($){let Z=[],X="",J=!1,Y="",Q=0,G=0;for(let q=0;q<$.length;q++){let U=$[q],W=q>0?$[q-1]:"";if((U==='"'||U==="'"||U==="`")&&W!=="\\"){if(!J)J=!0,Y=U;else if(U===Y)J=!1,Y="";else X+=U;continue}if(!J){if(U==="{")Q++;if(U==="}")Q--;if(U==="[")G++;if(U==="]")G--;if(U===","&&Q===0&&G===0){Z.push(X.trim()),X="";continue}}X+=U}if(X.trim())Z.push(X.trim());return Z}function J3($,Z){if(typeof $!=="string")return $;let X=$.trim();if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'"))return X.slice(1,-1);if(!X.startsWith("/")&&!X.startsWith(".")&&!X.startsWith("http")&&!X.startsWith("{")){let J=Z[X];if(J!==void 0)return J}if(X.startsWith("{")||X.startsWith("["))try{return JSON.parse(X)}catch{}return X}var s7=aZ();async function r7(){try{return await import("./chunk-99nrwh5w.js")}catch($){if(!o7)console.warn("[stx-media] Video processor not available, some features disabled:",$),o7=!0;return null}}var o7=!1,a7=!0,t7="metadata",$X="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function i5($,Z={}){let X=Z,J=$;if(J.process&&!J.skipProcessing){if(X.tsVideosConfig?.enabled&&!X.isDev)return QX(J,X)}if(X.processedResult?.processed)return $6($,X.processedResult,Z);let Y;if(J.generatePoster&&J.src&&!$.poster)Y=await GX(J,X);let{src:Q,sources:G=[],poster:q,posterPlaceholder:U,controls:W=a7,autoplay:z=!1,muted:K=!1,loop:H=!1,preload:B=t7,playsinline:j=!0,lazy:_=!0,player:F="native",type:V,width:O,height:L,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:D=!1}=$,N=Y||q,T=$.class,A=$.style,M=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(F==="ts-video")return XX($,Z);if(V&&V!=="video")return ZX(Q||"",V,$);let E=G.length>0?G:Q?[{src:Q,type:e7(Q)}]:[],I=[`id="${M}"`];if(W)I.push("controls");if(z)I.push("autoplay");if(K)I.push("muted");if(H)I.push("loop");if(j)I.push("playsinline");if(R)I.push("disablepictureinpicture");if(D)I.push("disableremoteplayback");if(w)I.push(`crossorigin="${w}"`);if(_){if(I.push(`data-preload="${B}"`),I.push('preload="none"'),N)I.push(`data-poster="${R0(N)}"`);I.push("data-stx-lazy")}else if(I.push(`preload="${B}"`),N)I.push(`poster="${R0(N)}"`);if(O)I.push(`width="${O}"`);if(L)I.push(`height="${L}"`);if(T)I.push(`class="${R0(T)}"`);if(A)I.push(`style="${R0(A)}"`);let y=E.map((C)=>{return` <source ${_?`data-src="${R0(C.src)}"`:`src="${R0(C.src)}"`} type="${C.type}"${C.media?` media="${C.media}"`:""} />`}).join(`
1841
1841
  `),k=`<video ${I.join(" ")}>
1842
1842
  ${y}
1843
1843
  Your browser does not support the video tag.
@@ -3270,7 +3270,7 @@ ${z}
3270
3270
  customElements.define('${Z}', ${G});
3271
3271
  `}async function O6($,Z,X,J){if(Z.length<1)return e("WebComponent","@webcomponent directive requires at least the tag name parameter",c.INVALID_DIRECTIVE_SYNTAX);let Y=Z[0].replace(/['"]/g,""),G=(X.__stx_options||{}).componentsDir||"components",q=f0.isAbsolute(G)?[f0.join(G,`${Y}.stx`),f0.join(f0.dirname(J),`${Y}.stx`)]:[f0.join(f0.dirname(J),G,`${Y}.stx`),f0.join(process.cwd(),G,`${Y}.stx`),f0.join(f0.dirname(J),`${Y}.stx`)],U=null;for(let K of q)if(await a(K)){U=await Bun.file(K).text();break}if(!U)return e("WebComponent",`Component file not found: ${Y}.stx`,c.FILE_NOT_FOUND);let W=mX(U,Y);return`<script type="module">
3272
3272
  ${lX(W)}
3273
- </script>`}var T6={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:D6,cachePath:".stx/cache",cacheVersion:"1.0.0",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:f7,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:O6,hasEndTag:!1,description:"Include a web component in the template"},w6,R6,H3,B3,d$,l$,c$,m$,S7,R7,s7,Y3,...M6],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 pX($,Z,X){let J=Z||"pages";if($)return{root:$,pagesDir:J};let Y=X||process.cwd(),Q=I0.join(Y,"resources","views"),G=I0.join(Y,"resources","layouts");if(Z$.existsSync(Q)&&Z$.existsSync(G))return{root:"resources",pagesDir:"views"};let q=I0.join(Y,"resources","views","pages");if(Z$.existsSync(q))return{root:"resources/views",pagesDir:J};return{root:".",pagesDir:J}}var F6=new Set,X$=["partialsDir","componentsDir","layoutsDir"],V3=new WeakMap;function iX($,Z){let X=Z.replace(/[\\/]+$/,"");if(!X||X===".")return!0;let J=$.replace(/\\/g,"/"),Y=X.replace(/\\/g,"/");return J===Y||J.startsWith(`${Y}/`)}function nX($,Z){let X=!$.root,J=pX($.root,$.pagesDir,Z);if($.root=J.root,$.pagesDir=J.pagesDir,X&&J.root!=="."){let Y=`${Z}::${J.root}`;if(!F6.has(Y))F6.add(Y),console.warn(`[stx] No "root" in config \u2014 inferred "${J.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!V3.has($)){let Y={};for(let Q of X$){let G=$[Q];if(typeof G==="string"&&G)Y[Q]=G}V3.set($,Y)}if($.root&&$.root!=="."){let Y=$.root;for(let Q of X$){let G=$[Q];if(typeof G!=="string"||!G)continue;if(I0.isAbsolute(G)||iX(G,Y))continue;$[Q]=I0.join(Y,G)}}for(let Y of X$){let Q=$[Y];if(typeof Q!=="string"||!Q||I0.isAbsolute(Q))continue;$[Y]=I0.resolve(Z,Q)}return $}function sX($,Z){let X=V3.get($);for(let J of X$){let Y=$[J];if(typeof Y!=="string"||!Y)continue;let Q=I0.isAbsolute(Y)?Y:I0.join(Z,Y);if(Z$.existsSync(Q))continue;let G=X?.[J]??Y,q=$.root,U=!!q&&q!==".";console.warn(`[stx] ${String(J)} resolves to "${Q}", which does not exist. Configured as "${G}"`+(U?`, resolved under root "${q}".`:"."))}}function oX($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function rX($){if(N6($.stateDir),$.stateDir=A6(),$.cachePath=O5($.cachePath),$.build)$.build.cacheDir=O5($.build.cacheDir);if($.media?.cache)$.media.cache.directory=O5($.media.cache.directory);if($.story)$.story.outDir=O5($.story.outDir)}var c1=null,L6=new Map,J$=null;async function O3($){if(!$){if(c1)return c1;if(J$)return J$}let Z=$?I0.resolve($):process.cwd(),X=L6.get(Z);if(X)return X;let J=(async()=>{let Q=(await cX({name:"stx",alias:"ui",cwd:Z,defaultConfig:T6,verbose:!1})).config;if(oX(Q),rX(Q),nX(Q,Z),sX(Q,Z),Q.plugins&&Q.plugins.length>0){let{pluginManager:G}=await import("./chunk-xj05xmfg.js"),q=[],U=[];for(let W of Q.plugins){let z=typeof W==="string"?W:W[0],K=typeof W==="string"?{}:W[1]||{};try{let H,B;try{H=await import(z),B=I0.dirname(f.resolve(z))}catch{let _=I0.resolve(process.cwd(),z);H=await import(_),B=I0.dirname(_)}let j=H.default||H;if(!G.has(j.name))await G.register(j,Q);if(j.components){let _=Array.isArray(j.components)?j.components:[j.components];for(let F of _)q.push(I0.resolve(B,F))}if(j.pages){let _=I0.resolve(B,j.pages),F=K.path||"/";U.push({dir:_,prefix:F})}if(j.setup){let _={addDirective:(F)=>{Q.customDirectives=Q.customDirectives||[],Q.customDirectives.push(F)},addRoute:(F,V)=>{Q.apiRoutes=Q.apiRoutes||{},Q.apiRoutes[F]=V},addMiddleware:(F)=>{Q.middleware=Q.middleware||[],Q.middleware.push(F)},pluginDir:B,config:Q};await j.setup(K,_)}console.log(`[stx] Plugin loaded: ${j.name||z}`)}catch(H){console.warn(`[stx] Failed to load plugin ${z}:`,H.message)}}Q._pluginComponentDirs=q,Q._pluginPageDirs=U}return Q})();if(L6.set(Z,J),!$)J$=J,J.then((Y)=>{c1=Y}).catch(()=>{});return J}var I6=new Proxy(T6,{get($,Z){if(c1&&Z in c1)return c1[Z];if(!J$)O3().catch((X)=>{console.warn("[stx] Failed to load config file:",X?.message||X)});return $[Z]}});function Vz($){return $}function Oz($){let Z=[],X=[];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 J=["auto","manual","sections"];if(!J.includes($.streaming.strategy))Z.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${J.join(", ")}`,severity:"error"})}}if($.i18n){if($.i18n.format!==void 0){let J=["json","yaml","yml","js"];if(!J.includes($.i18n.format))Z.push({path:"i18n.format",message:`i18n.format must be one of: ${J.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 J=["AA","AAA"];if(!J.includes($.a11y.level))Z.push({path:"a11y.level",message:`a11y.level must be one of: ${J.join(", ")}`,severity:"error"})}}if($.hydration){if($.hydration.mode!==void 0){let J=["progressive","islands"];if(!J.includes($.hydration.mode))Z.push({path:"hydration.mode",message:`hydration.mode must be one of: ${J.join(", ")}`,severity:"error"})}if($.hydration.preload!==void 0){let J=["none","eager","lazy"];if(!J.includes($.hydration.preload))Z.push({path:"hydration.preload",message:`hydration.preload must be one of: ${J.join(", ")}`,severity:"error"})}}if($.customDirectives)if(!Array.isArray($.customDirectives))Z.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else $.customDirectives.forEach((J,Y)=>{if(!J.name||typeof J.name!=="string")Z.push({path:`customDirectives[${Y}].name`,message:"Custom directive must have a name string",severity:"error"});if(!J.handler||typeof J.handler!=="function")Z.push({path:`customDirectives[${Y}].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((J,Y)=>{if(!J.name||typeof J.name!=="string")Z.push({path:`middleware[${Y}].name`,message:"Middleware must have a name string",severity:"error"});if(!J.handler||typeof J.handler!=="function")Z.push({path:`middleware[${Y}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!J.timing||!["before","after"].includes(J.timing))Z.push({path:`middleware[${Y}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if($.debug===!0&&$.cache===!0)X.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)X.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 J=["fullscreen","standalone","minimal-ui","browser"];if(!J.includes($.pwa.manifest.display))Z.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.manifest?.orientation!==void 0){let J=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!J.includes($.pwa.manifest.orientation))Z.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.routes){let J=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];$.pwa.routes.forEach((Y,Q)=>{if(!Y.pattern||typeof Y.pattern!=="string")Z.push({path:`pwa.routes[${Q}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!J.includes(Y.strategy))Z.push({path:`pwa.routes[${Q}].strategy`,message:`PWA route strategy must be one of: ${J.join(", ")}`,severity:"error"});if(Y.maxAgeSeconds!==void 0&&(typeof Y.maxAgeSeconds!=="number"||Y.maxAgeSeconds<0))Z.push({path:`pwa.routes[${Q}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(Y.maxEntries!==void 0&&(typeof Y.maxEntries!=="number"||Y.maxEntries<1))Z.push({path:`pwa.routes[${Q}].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((Y)=>typeof Y!=="number"||Y<16||Y>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 J=["any","maskable","monochrome"];if($.pwa.icons.purpose.filter((Q)=>!J.includes(Q)).length>0)Z.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.enabled===!0&&!$.pwa.icons?.src)X.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)X.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:Z.length===0,errors:Z,warnings:X}}var L3=new Map;async function eX($,Z={}){try{if(!await a($))throw Error(`Markdown file not found: ${$}`);let J=(await aX.promises.stat($)).mtime.getTime();if(Z.cache&&L3.has($)){let K=L3.get($);if(K.updatedAt>=J)return{content:K.content,data:K.data}}let Y=await Bun.file($).text(),{data:Q,content:G}=P7(Y),q=Z.markdown||I6.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},W=H5(G,{gfm:!0});if(q.syntaxHighlighting?.enabled&&q.syntaxHighlighting?.serverSide)W=await $J(W,q.syntaxHighlighting?.defaultTheme||"github-dark",q.syntaxHighlighting?.highlightUnknownLanguages||!1);let z={content:W,data:Q||{}};if(Z.cache)L3.set($,{...z,updatedAt:J});return z}catch(X){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,X);let J=X instanceof Error?X.message:String(X);return{content:z0("Markdown File",`Error reading/parsing markdown file: ${J}`,$,"",0,""),data:{}}}}var Y$=null;async function $J($,Z,X){let J=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Y$)try{Y$=await tX({theme:Z||"github-dark",cache:!0})}catch(q){return console.error("Failed to initialize ts-syntax-highlighter:",q),$}let Y=async(q,U,W,z)=>{let K=z.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=W||(X?"text":"");if(!H)return q;try{if(!Y$.getSupportedLanguages().includes(H))return q;return(await Y$.highlight(K,H,{theme:Z})).html}catch(B){console.error(`Error highlighting code block with language ${W}:`,B)}return q},Q=$,G=$.matchAll(J);for(let q of G){let[U,W,z,K]=q,H=await Y(U,W,z,K);Q=Q.replace(U,H)}return Q}async function k6($,Z,X="",J={}){return await ZJ($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,q,U,W)=>{try{let z=q;if(!F3.isAbsolute(q))z=F3.resolve(F3.dirname(X),q);let K={};if(U)try{try{K=JSON.parse(U)}catch{if(J.debug)console.warn("Using safer alternative for parsing JS object literal");let O=U.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let L of O){let w=L.indexOf(":");if(w>0){let R=L.substring(0,w).trim(),D=L.substring(w+1).trim(),N=D.startsWith('"')&&D.endsWith('"'),T=D.startsWith("'")&&D.endsWith("'");if(N||T)D=D.substring(1,D.length-1);K[R]=D}}}}catch(V){if(J.debug)console.error("Error parsing context in @markdown-file directive:",V)}let{content:H,data:B}=await eX(z,J),j={...Z,...B,...K},_=H,F=/\{\{([^}]+)\}\}/g;return _=_.replace(F,(V,O)=>{let L=O.trim();return j[L]!==void 0?String(j[L]):V}),_}catch(z){let K=z instanceof Error?z.message:String(z);return z0("Markdown File",`Error including markdown file: ${K}`,X,$,W,G)}})}async function ZJ($,Z,X){let J=[],Y;while((Y=Z.exec($))!==null){let q=Y[0],U=Y.index,W=Y;J.push(X(...W).then((z)=>({match:q,replacement:z,index:U})))}let Q=await Promise.all(J);Q.sort((q,U)=>U.index-q.index);let G=$;for(let{match:q,replacement:U}of Q)G=G.replace(q,()=>U);return G}function U1($,Z){try{let X=$.trim();if(Q0(X))return G0(X,Object.keys(Z))(...Object.values(Z));else return t(X,Z)}catch{return!1}}class Q${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,X=this.column,J=this.source[this.pos];if(/\s/.test(J))return this.readWhitespace($,Z,X);if(J==="/"&&this.peek(1)==="/")return this.readLineComment($,Z,X);if(J==="/"&&this.peek(1)==="*")return this.readBlockComment($,Z,X);if(J==='"'||J==="'")return this.readString(J,$,Z,X);if(J==="`")return this.readTemplateString($,Z,X);if(/\d/.test(J)||J==="."&&/\d/.test(this.peek(1)||""))return this.readNumber($,Z,X);if(/[a-z_$]/i.test(J))return this.readIdentifier($,Z,X);if(J==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:$,end:this.pos,line:Z,column:X}}if(J==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:$,end:this.pos,line:Z,column:X}}if(J==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:$,end:this.pos,line:Z,column:X};if(J==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective($,Z,X);let Y=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let Q of Y)if(this.source.slice(this.pos,this.pos+Q.length)===Q)return this.advance(Q.length),{type:"OPERATOR",value:Q,start:$,end:this.pos,line:Z,column:X};if(/[+\-*/%<>=!&|^~?:]/.test(J))return this.advance(),{type:"OPERATOR",value:J,start:$,end:this.pos,line:Z,column:X};if(/[()[\]{},;.]/.test(J))return this.advance(),{type:"PUNCTUATION",value:J,start:$,end:this.pos,line:Z,column:X};return this.advance(),{type:"PUNCTUATION",value:J,start:$,end:this.pos,line:Z,column:X}}readWhitespace($,Z,X){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:X}}readLineComment($,Z,X){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3273
+ </script>`}var T6={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:D6,cachePath:".stx/cache",cacheVersion:"1.0.0",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:f7,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:O6,hasEndTag:!1,description:"Include a web component in the template"},w6,R6,H3,B3,d$,l$,c$,m$,S7,R7,s7,Y3,...M6],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 pX($,Z,X){let J=Z||"pages";if($)return{root:$,pagesDir:J};let Y=X||process.cwd(),Q=I0.join(Y,"resources","views"),G=I0.join(Y,"resources","layouts");if(Z$.existsSync(Q)&&Z$.existsSync(G))return{root:"resources",pagesDir:"views"};let q=I0.join(Y,"resources","views","pages");if(Z$.existsSync(q))return{root:"resources/views",pagesDir:J};return{root:".",pagesDir:J}}var F6=new Set,X$=["partialsDir","componentsDir","layoutsDir"],V3=new WeakMap;function iX($,Z){let X=Z.replace(/[\\/]+$/,"");if(!X||X===".")return!0;let J=$.replace(/\\/g,"/"),Y=X.replace(/\\/g,"/");return J===Y||J.startsWith(`${Y}/`)}function nX($,Z){let X=!$.root,J=pX($.root,$.pagesDir,Z);if($.root=J.root,$.pagesDir=J.pagesDir,X&&J.root!=="."){let Y=`${Z}::${J.root}`;if(!F6.has(Y))F6.add(Y),console.warn(`[stx] No "root" in config \u2014 inferred "${J.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!V3.has($)){let Y={};for(let Q of X$){let G=$[Q];if(typeof G==="string"&&G)Y[Q]=G}V3.set($,Y)}if($.root&&$.root!=="."){let Y=$.root;for(let Q of X$){let G=$[Q];if(typeof G!=="string"||!G)continue;if(I0.isAbsolute(G)||iX(G,Y))continue;$[Q]=I0.join(Y,G)}}for(let Y of X$){let Q=$[Y];if(typeof Q!=="string"||!Q||I0.isAbsolute(Q))continue;$[Y]=I0.resolve(Z,Q)}return $}function sX($,Z){let X=V3.get($);for(let J of X$){let Y=$[J];if(typeof Y!=="string"||!Y)continue;let Q=I0.isAbsolute(Y)?Y:I0.join(Z,Y);if(Z$.existsSync(Q))continue;let G=X?.[J]??Y,q=$.root,U=!!q&&q!==".";console.warn(`[stx] ${String(J)} resolves to "${Q}", which does not exist. Configured as "${G}"`+(U?`, resolved under root "${q}".`:"."))}}function oX($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function rX($){if(N6($.stateDir),$.stateDir=A6(),$.cachePath=O5($.cachePath),$.build)$.build.cacheDir=O5($.build.cacheDir);if($.media?.cache)$.media.cache.directory=O5($.media.cache.directory);if($.story)$.story.outDir=O5($.story.outDir)}var c1=null,L6=new Map,J$=null;async function O3($){if(!$){if(c1)return c1;if(J$)return J$}let Z=$?I0.resolve($):process.cwd(),X=L6.get(Z);if(X)return X;let J=(async()=>{let Q=(await cX({name:"stx",alias:"ui",cwd:Z,defaultConfig:T6,verbose:!1})).config;if(oX(Q),rX(Q),nX(Q,Z),sX(Q,Z),Q.plugins&&Q.plugins.length>0){let{pluginManager:G}=await import("./chunk-cqzv09x3.js"),q=[],U=[];for(let W of Q.plugins){let z=typeof W==="string"?W:W[0],K=typeof W==="string"?{}:W[1]||{};try{let H,B;try{H=await import(z),B=I0.dirname(f.resolve(z))}catch{let _=I0.resolve(process.cwd(),z);H=await import(_),B=I0.dirname(_)}let j=H.default||H;if(!G.has(j.name))await G.register(j,Q);if(j.components){let _=Array.isArray(j.components)?j.components:[j.components];for(let F of _)q.push(I0.resolve(B,F))}if(j.pages){let _=I0.resolve(B,j.pages),F=K.path||"/";U.push({dir:_,prefix:F})}if(j.setup){let _={addDirective:(F)=>{Q.customDirectives=Q.customDirectives||[],Q.customDirectives.push(F)},addRoute:(F,V)=>{Q.apiRoutes=Q.apiRoutes||{},Q.apiRoutes[F]=V},addMiddleware:(F)=>{Q.middleware=Q.middleware||[],Q.middleware.push(F)},pluginDir:B,config:Q};await j.setup(K,_)}console.log(`[stx] Plugin loaded: ${j.name||z}`)}catch(H){console.warn(`[stx] Failed to load plugin ${z}:`,H.message)}}Q._pluginComponentDirs=q,Q._pluginPageDirs=U}return Q})();if(L6.set(Z,J),!$)J$=J,J.then((Y)=>{c1=Y}).catch(()=>{});return J}var I6=new Proxy(T6,{get($,Z){if(c1&&Z in c1)return c1[Z];if(!J$)O3().catch((X)=>{console.warn("[stx] Failed to load config file:",X?.message||X)});return $[Z]}});function Vz($){return $}function Oz($){let Z=[],X=[];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 J=["auto","manual","sections"];if(!J.includes($.streaming.strategy))Z.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${J.join(", ")}`,severity:"error"})}}if($.i18n){if($.i18n.format!==void 0){let J=["json","yaml","yml","js"];if(!J.includes($.i18n.format))Z.push({path:"i18n.format",message:`i18n.format must be one of: ${J.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 J=["AA","AAA"];if(!J.includes($.a11y.level))Z.push({path:"a11y.level",message:`a11y.level must be one of: ${J.join(", ")}`,severity:"error"})}}if($.hydration){if($.hydration.mode!==void 0){let J=["progressive","islands"];if(!J.includes($.hydration.mode))Z.push({path:"hydration.mode",message:`hydration.mode must be one of: ${J.join(", ")}`,severity:"error"})}if($.hydration.preload!==void 0){let J=["none","eager","lazy"];if(!J.includes($.hydration.preload))Z.push({path:"hydration.preload",message:`hydration.preload must be one of: ${J.join(", ")}`,severity:"error"})}}if($.customDirectives)if(!Array.isArray($.customDirectives))Z.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else $.customDirectives.forEach((J,Y)=>{if(!J.name||typeof J.name!=="string")Z.push({path:`customDirectives[${Y}].name`,message:"Custom directive must have a name string",severity:"error"});if(!J.handler||typeof J.handler!=="function")Z.push({path:`customDirectives[${Y}].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((J,Y)=>{if(!J.name||typeof J.name!=="string")Z.push({path:`middleware[${Y}].name`,message:"Middleware must have a name string",severity:"error"});if(!J.handler||typeof J.handler!=="function")Z.push({path:`middleware[${Y}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!J.timing||!["before","after"].includes(J.timing))Z.push({path:`middleware[${Y}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if($.debug===!0&&$.cache===!0)X.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)X.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 J=["fullscreen","standalone","minimal-ui","browser"];if(!J.includes($.pwa.manifest.display))Z.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.manifest?.orientation!==void 0){let J=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!J.includes($.pwa.manifest.orientation))Z.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.routes){let J=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];$.pwa.routes.forEach((Y,Q)=>{if(!Y.pattern||typeof Y.pattern!=="string")Z.push({path:`pwa.routes[${Q}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!J.includes(Y.strategy))Z.push({path:`pwa.routes[${Q}].strategy`,message:`PWA route strategy must be one of: ${J.join(", ")}`,severity:"error"});if(Y.maxAgeSeconds!==void 0&&(typeof Y.maxAgeSeconds!=="number"||Y.maxAgeSeconds<0))Z.push({path:`pwa.routes[${Q}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(Y.maxEntries!==void 0&&(typeof Y.maxEntries!=="number"||Y.maxEntries<1))Z.push({path:`pwa.routes[${Q}].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((Y)=>typeof Y!=="number"||Y<16||Y>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 J=["any","maskable","monochrome"];if($.pwa.icons.purpose.filter((Q)=>!J.includes(Q)).length>0)Z.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${J.join(", ")}`,severity:"error"})}if($.pwa.enabled===!0&&!$.pwa.icons?.src)X.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)X.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:Z.length===0,errors:Z,warnings:X}}var L3=new Map;async function eX($,Z={}){try{if(!await a($))throw Error(`Markdown file not found: ${$}`);let J=(await aX.promises.stat($)).mtime.getTime();if(Z.cache&&L3.has($)){let K=L3.get($);if(K.updatedAt>=J)return{content:K.content,data:K.data}}let Y=await Bun.file($).text(),{data:Q,content:G}=P7(Y),q=Z.markdown||I6.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},W=H5(G,{gfm:!0});if(q.syntaxHighlighting?.enabled&&q.syntaxHighlighting?.serverSide)W=await $J(W,q.syntaxHighlighting?.defaultTheme||"github-dark",q.syntaxHighlighting?.highlightUnknownLanguages||!1);let z={content:W,data:Q||{}};if(Z.cache)L3.set($,{...z,updatedAt:J});return z}catch(X){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,X);let J=X instanceof Error?X.message:String(X);return{content:z0("Markdown File",`Error reading/parsing markdown file: ${J}`,$,"",0,""),data:{}}}}var Y$=null;async function $J($,Z,X){let J=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Y$)try{Y$=await tX({theme:Z||"github-dark",cache:!0})}catch(q){return console.error("Failed to initialize ts-syntax-highlighter:",q),$}let Y=async(q,U,W,z)=>{let K=z.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=W||(X?"text":"");if(!H)return q;try{if(!Y$.getSupportedLanguages().includes(H))return q;return(await Y$.highlight(K,H,{theme:Z})).html}catch(B){console.error(`Error highlighting code block with language ${W}:`,B)}return q},Q=$,G=$.matchAll(J);for(let q of G){let[U,W,z,K]=q,H=await Y(U,W,z,K);Q=Q.replace(U,H)}return Q}async function k6($,Z,X="",J={}){return await ZJ($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,q,U,W)=>{try{let z=q;if(!F3.isAbsolute(q))z=F3.resolve(F3.dirname(X),q);let K={};if(U)try{try{K=JSON.parse(U)}catch{if(J.debug)console.warn("Using safer alternative for parsing JS object literal");let O=U.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let L of O){let w=L.indexOf(":");if(w>0){let R=L.substring(0,w).trim(),D=L.substring(w+1).trim(),N=D.startsWith('"')&&D.endsWith('"'),T=D.startsWith("'")&&D.endsWith("'");if(N||T)D=D.substring(1,D.length-1);K[R]=D}}}}catch(V){if(J.debug)console.error("Error parsing context in @markdown-file directive:",V)}let{content:H,data:B}=await eX(z,J),j={...Z,...B,...K},_=H,F=/\{\{([^}]+)\}\}/g;return _=_.replace(F,(V,O)=>{let L=O.trim();return j[L]!==void 0?String(j[L]):V}),_}catch(z){let K=z instanceof Error?z.message:String(z);return z0("Markdown File",`Error including markdown file: ${K}`,X,$,W,G)}})}async function ZJ($,Z,X){let J=[],Y;while((Y=Z.exec($))!==null){let q=Y[0],U=Y.index,W=Y;J.push(X(...W).then((z)=>({match:q,replacement:z,index:U})))}let Q=await Promise.all(J);Q.sort((q,U)=>U.index-q.index);let G=$;for(let{match:q,replacement:U}of Q)G=G.replace(q,()=>U);return G}function U1($,Z){try{let X=$.trim();if(Q0(X))return G0(X,Object.keys(Z))(...Object.values(Z));else return t(X,Z)}catch{return!1}}class Q${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,X=this.column,J=this.source[this.pos];if(/\s/.test(J))return this.readWhitespace($,Z,X);if(J==="/"&&this.peek(1)==="/")return this.readLineComment($,Z,X);if(J==="/"&&this.peek(1)==="*")return this.readBlockComment($,Z,X);if(J==='"'||J==="'")return this.readString(J,$,Z,X);if(J==="`")return this.readTemplateString($,Z,X);if(/\d/.test(J)||J==="."&&/\d/.test(this.peek(1)||""))return this.readNumber($,Z,X);if(/[a-z_$]/i.test(J))return this.readIdentifier($,Z,X);if(J==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:$,end:this.pos,line:Z,column:X}}if(J==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:$,end:this.pos,line:Z,column:X};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:$,end:this.pos,line:Z,column:X}}if(J==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:$,end:this.pos,line:Z,column:X};if(J==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective($,Z,X);let Y=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let Q of Y)if(this.source.slice(this.pos,this.pos+Q.length)===Q)return this.advance(Q.length),{type:"OPERATOR",value:Q,start:$,end:this.pos,line:Z,column:X};if(/[+\-*/%<>=!&|^~?:]/.test(J))return this.advance(),{type:"OPERATOR",value:J,start:$,end:this.pos,line:Z,column:X};if(/[()[\]{},;.]/.test(J))return this.advance(),{type:"PUNCTUATION",value:J,start:$,end:this.pos,line:Z,column:X};return this.advance(),{type:"PUNCTUATION",value:J,start:$,end:this.pos,line:Z,column:X}}readWhitespace($,Z,X){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:X}}readLineComment($,Z,X){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3274
3274
  `)this.advance();return{type:"COMMENT",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}readBlockComment($,Z,X){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:X}}readString($,Z,X,J){this.advance();while(this.pos<this.source.length){let Y=this.source[this.pos];if(Y==="\\"){this.advance(2);continue}if(Y===$){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(Z,this.pos),start:Z,end:this.pos,line:X,column:J}}readTemplateString($,Z,X){this.advance();let J=0,Y=256;while(this.pos<this.source.length){let Q=this.source[this.pos];if(Q==="\\"){this.advance(2);continue}if(Q==="$"&&this.peek(1)==="{"){if(J>=Y){this.pos=this.source.length;break}this.advance(2),J++;continue}if(Q==="{"&&J>0){J++,this.advance();continue}if(Q==="}"&&J>0){J--,this.advance();continue}if(Q==="`"&&J===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:X}}readNumber($,Z,X){if(this.source[this.pos]==="0"){let J=this.peek(1)?.toLowerCase();if(J==="x"||J==="o"||J==="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:X}}}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:X}}readIdentifier($,Z,X){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:X}}readDirective($,Z,X){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:X}}advance($=1){for(let Z=0;Z<$&&this.pos<this.source.length;Z++){if(this.source[this.pos]===`
3275
3275
  `)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 B0($,Z,X,J=0){let Y=0,Q=J,G=null,q=0,U=!1;while(Q<$.length){let W=$[Q];if(G&&U){U=!1,Q++;continue}if(G&&W==="\\"){U=!0,Q++;continue}if(U=!1,(W==='"'||W==="'"||W==="`")&&!G){G=W,Q++;continue}if(W===G&&G!=="`"){G=null,Q++;continue}if(G==="`"&&W==="$"&&$[Q+1]==="{"){q++,Q+=2;continue}if(q>0&&W==="}"){q--,Q++;continue}if(W==="`"&&G==="`"&&q===0){G=null,Q++;continue}if(G){Q++;continue}if(W===Z)Y++;else if(W===X){if(Y--,Y===0)return Q}Q++}return-1}function E6($,Z){let X=Z,J={paren:0,bracket:0,brace:0},Y=null,Q=0;while(X<$.length){let G=$[X];if((X>0?$[X-1]:"")==="\\"&&Y){X++;continue}if((G==='"'||G==="'")&&!Y){Y=G,X++;continue}if(G===Y&&Y!=="`"){Y=null,X++;continue}if(G==="`"&&!Y){Y="`",X++;continue}if(G==="`"&&Y==="`"&&Q===0){Y=null,X++;continue}if(Y==="`"&&G==="$"&&$[X+1]==="{"){Q++,X+=2;continue}if(Q>0){if(G==="{")Q++;else if(G==="}")Q--;X++;continue}if(Y){X++;continue}if(J.paren===0&&J.bracket===0&&J.brace===0){if($.slice(X,X+2)==="}}"||$.slice(X,X+3)==="!!}")break;if(G===","||G===";")break}if(G==="(")J.paren++;else if(G===")"){if(J.paren--,J.paren<0)break}else if(G==="[")J.bracket++;else if(G==="]"){if(J.bracket--,J.bracket<0)break}else if(G==="{")J.brace++;else if(G==="}"){if(J.brace--,J.brace<0)break}X++}return{expression:$.slice(Z,X),endPos:X}}function w3($){let Z=[],X="",J={paren:0,bracket:0,brace:0},Y=null,Q=0;for(let G=0;G<$.length;G++){let q=$[G];if((G>0?$[G-1]:"")==="\\"&&Y){X+=q;continue}if((q==='"'||q==="'")&&!Y){Y=q,X+=q;continue}if(q===Y&&Y!=="`"){Y=null,X+=q;continue}if(q==="`"&&!Y){Y="`",X+=q;continue}if(q==="`"&&Y==="`"&&Q===0){Y=null,X+=q;continue}if(Y==="`"&&q==="$"&&$[G+1]==="{"){Q++,X+=q+$[G+1],G++;continue}if(Q>0&&q==="{"){Q++,X+=q;continue}if(Q>0&&q==="}"){Q--,X+=q;continue}if(Y){X+=q;continue}if(q==="(")J.paren++;else if(q===")")J.paren--;else if(q==="[")J.bracket++;else if(q==="]")J.bracket--;else if(q==="{")J.brace++;else if(q==="}")J.brace--;if(q==="|"&&$[G+1]!=="|"&&(G===0||$[G-1]!=="|")&&$[G-1]!=="\\"&&J.paren===0&&J.bracket===0&&J.brace===0){Z.push(X.trim()),X="";continue}if(q==="|"&&$[G-1]==="\\"&&!Y){X=X.slice(0,-1)+q;continue}X+=q}if(X.trim())Z.push(X.trim());return Z}function W1($,Z){let X=XJ($,Z);return X.ok?{expression:X.expression,endPos:X.endPos}:null}function XJ($,Z){let X=Z;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!=="(")return{ok:!1,reason:"missing-open-paren",pos:X};let J=B0($,"(",")",X);if(J===-1)return{ok:!1,reason:"unclosed-paren",pos:X};return{ok:!0,expression:$.slice(X+1,J),endPos:J+1}}function JJ($,Z){let X=$.lastIndexOf("<",Z);if(X===-1)return!1;return X>$.lastIndexOf(">",Z)}function D1($,Z,X,J){let Y=1,Q=J,G=new RegExp(`@${Z}\\s*\\(`,"g"),q=new RegExp(`@${X}(?![a-z])`,"g");while(Q<$.length&&Y>0){G.lastIndex=Q,q.lastIndex=Q;let U=G.exec($),W=q.exec($),z=U?U.index:1/0,K=W?W.index:1/0;if(z<K)Y++,Q=z+U[0].length;else if(K<1/0){if(Y--,Y===0)return K;Q=K+W[0].length}else break}return-1}function b6($,Z){let X=$.slice(Z).match(/^@if\s*/);if(!X)return null;let J=Z+X[0].length,Y=W1($,J);if(!Y)return null;let Q=Y.endPos,G=D1($,"if","endif",Q);if(G===-1)return null;let q=$.slice(Q,G),U=[],W=0,z="if",K=Y.expression,H=0,B=0;while(W<q.length){let j=q.indexOf("@",W);if(j===-1)break;W=j;let _=q.substring(j);if(JJ(q,j)){W++;continue}if(/^@if\s*\(/.test(_)){B++,W++;continue}if(/^@endif(?![a-z])/.test(_)){B--,W+=6;continue}if(B===0){let F=_.match(/^@elseif\s*/);if(F){U.push({type:z,condition:K,content:q.substring(H,W),start:Q+H,end:Q+W});let V=W+F[0].length,O=W1(q,V);if(!O){W++;continue}z="elseif",K=O.expression,W=O.endPos,H=W;continue}else if(/^@else(?![a-z])/.test(_)){U.push({type:z,condition:K,content:q.substring(H,W),start:Q+H,end:Q+W}),z="else",K=void 0,W+=5,H=W;continue}}W++}return U.push({type:z,condition:K,content:q.slice(H),start:Q+H,end:Q+q.length}),{fullMatch:$.slice(Z,G+6),branches:U,start:Z,end:G+6}}function F5($){let Z=[],X=/@if\s*\(/g,J=X.exec($);while(J!==null){if(Z.some((G)=>J.index>G.start&&J.index<G.end)){J=X.exec($);continue}let Q=b6($,J.index);if(Q)Z.push(Q),X.lastIndex=Q.end;J=X.exec($)}return Z}function G$($,Z,X){let J=[],Y=new RegExp(`@${Z}\\s*\\(`,"g"),Q=Y.exec($);while(Q!==null){if(J.some((_)=>Q.index>_.start&&Q.index<_.end)){Q=Y.exec($);continue}let q=Q.index,U=q+Q[0].length-1,W=B0($,"(",")",U);if(W===-1){Q=Y.exec($);continue}let z=$.slice(U+1,W),K=W+1,H=D1($,Z,X,K);if(H===-1){Q=Y.exec($);continue}let B=$.slice(K,H),j=H+`@${X}`.length;J.push({fullMatch:$.slice(q,j),name:Z,params:z,content:B,start:q,end:j}),Y.lastIndex=j,Q=Y.exec($)}return J}function R3($,Z){let X=$.slice(Z).match(/^@switch\s*/);if(!X)return null;let J=Z+X[0].length,Y=W1($,J);if(!Y)return null;let Q=Y.endPos,G=D1($,"switch","endswitch",Q);if(G===-1)return null;let q=$.slice(Q,G),U=[],W=0,z=null,K=0;while(W<q.length){let H=q.slice(W),B=H.match(/^@switch\s*\(/),j=H.match(/^@endswitch(?![a-z])/);if(B){if(K++,z)z.content+=B[0];W+=B[0].length;continue}if(j){if(K--,z)z.content+=j[0];W+=j[0].length;continue}if(K>0){if(z)z.content+=q[W];W++;continue}let _=H.match(/^@case\s*/),F=H.match(/^@default(?![a-z])/),V=H.match(/^@break(?![a-z])/);if(_&&H.startsWith("@case")){if(z)U.push(z);let O=W+_[0].length,L=W1(q,O);if(!L){W++;continue}z={type:"case",value:L.expression,content:""},W=L.endPos}else if(F&&H.startsWith("@default")){if(z)U.push(z);z={type:"default",content:""},W+=F[0].length}else if(V&&H.startsWith("@break"))W+=V[0].length;else{if(z)z.content+=q[W];W++}}if(z)U.push(z);return{fullMatch:$.slice(Z,G+10),expression:Y.expression,cases:U,start:Z,end:G+10}}function YJ($){let Z=[],X=0;while(X<$.length){let J=$.indexOf("{{",X),Y=$.indexOf("{!!",X),Q=!1,G;if(J===-1&&Y===-1)break;else if(J===-1)G=Y,Q=!0;else if(Y===-1)G=J,Q=!1;else if(Y<J)G=Y,Q=!0;else G=J,Q=!1;if(!Q&&$.slice(G,G+3)==="{{{")Q=!0;let q=Q?$.slice(G,G+3)==="{{{"?"{{{":"{!!":"{{",U=Q?q==="{{{"?"}}}":"!!}":"}}",W=G+q.length,z=QJ($,W,U);if(z===-1){X=G+1;continue}let K=$.slice(W,z).trim(),H=z+U.length;Z.push({fullMatch:$.slice(G,H),expression:K,start:G,end:H,isRaw:Q}),X=H}return Z}function QJ($,Z,X){let J=Z,Y=null,Q={paren:0,bracket:0,brace:0},G=0;while(J<$.length){let q=$[J];if((J>0?$[J-1]:"")==="\\"&&Y){J++;continue}if((q==='"'||q==="'")&&!Y){Y=q,J++;continue}if(q===Y&&Y!=="`"){Y=null,J++;continue}if(q==="`"&&!Y){Y="`",J++;continue}if(q==="`"&&Y==="`"&&G===0){Y=null,J++;continue}if(Y==="`"&&q==="$"&&$[J+1]==="{"){G++,J+=2;continue}if(G>0){if(q==="{")G++;else if(q==="}")G--;J++;continue}if(Y){J++;continue}if(q==="(")Q.paren++;else if(q===")")Q.paren--;else if(q==="[")Q.bracket++;else if(q==="]")Q.bracket--;else if(q==="{")Q.brace++;else if(q==="}")Q.brace--;if(Q.paren===0&&Q.bracket===0&&Q.brace<=0){if($.slice(J,J+X.length)===X)return J}J++}return-1}function GJ($){let Z=w3($);if(Z.length===0)return{baseExpression:"",filters:[]};let X=Z[0],J=[];for(let Y=1;Y<Z.length;Y++){let Q=qJ(Z[Y]);if(Q)J.push(Q)}return{baseExpression:X,filters:J}}function qJ($){let Z=$.trim();if(!Z)return null;let X=Z.indexOf("(");if(X===-1)return{name:Z,args:[]};let J=Z.slice(0,X).trim(),Y=X+1,Q=B0(Z,"(",")",X);if(Q===-1)return{name:J,args:[]};let G=Z.slice(Y,Q),q=C6(G);return{name:J,args:q}}function C6($){let Z=[],X="",J={paren:0,bracket:0,brace:0},Y=null,Q=0;for(let G=0;G<$.length;G++){let q=$[G];if((G>0?$[G-1]:"")==="\\"&&Y){X+=q;continue}if((q==='"'||q==="'")&&!Y){Y=q,X+=q;continue}if(q===Y&&Y!=="`"){Y=null,X+=q;continue}if(q==="`"&&!Y){Y="`",X+=q;continue}if(q==="`"&&Y==="`"&&Q===0){Y=null,X+=q;continue}if(Y==="`"&&q==="$"&&$[G+1]==="{"){Q++,X+="${",G++;continue}if(Q>0&&q==="{"){Q++,X+=q;continue}if(Q>0&&q==="}"){Q--,X+=q;continue}if(Y){X+=q;continue}if(q==="(")J.paren++;else if(q===")")J.paren--;else if(q==="[")J.bracket++;else if(q==="]")J.bracket--;else if(q==="{")J.brace++;else if(q==="}")J.brace--;if(q===","&&J.paren===0&&J.bracket===0&&J.brace===0){Z.push(X.trim()),X="";continue}X+=q}if(X.trim())Z.push(X.trim());return Z}function UJ($,Z){let X=Z;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!=="(")return null;let J=B0($,"(",")",X);if(J===-1)return null;return{params:$.slice(X+1,J),endPos:J+1}}function WJ($){let Z=[],J=new Q$($).tokenize().filter((Q)=>Q.type!=="WHITESPACE"&&Q.type!=="COMMENT"),Y=0;while(Y<J.length){let Q=J[Y],G=!1;if(Q.type==="IDENTIFIER"&&Q.value==="export"){if(G=!0,Y++,Y>=J.length)break}let q=J[Y];if(q.type==="IDENTIFIER"&&(q.value==="const"||q.value==="let"||q.value==="var")){let U=q.value;if(Y++,Y>=J.length)break;let W=J[Y];if(W.type==="IDENTIFIER"){let z=W.value;if(Y++,Y<J.length&&J[Y].type==="OPERATOR"&&J[Y].value==="="){Y++;let K=Y<J.length?J[Y].start:$.length,H=y6(J,Y,$);Y=H.nextIndex,Z.push({type:"variable",name:z,value:$.slice(K,H.endPos),exported:G,start:q.start,end:H.endPos})}}else if(W.type==="PUNCTUATION"&&(W.value==="{"||W.value==="[")){let z=W.start,K=W.value==="{"?"}":"]",H=B0($,W.value,K,z);if(H!==-1){let B=$.slice(z,H+1);if(Y=S6(J,H+1),Y<J.length&&J[Y].type==="OPERATOR"&&J[Y].value==="="){Y++;let j=Y<J.length?J[Y].start:$.length,_=y6(J,Y,$);Y=_.nextIndex;let F=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:F,value:`${$.slice(j,_.endPos)}; ${U} ${B} = ${F}`,exported:G,start:q.start,end:_.endPos})}}}}else if(q.type==="IDENTIFIER"&&q.value==="function"){let U=G?J[Y-1].start:q.start;if(Y++,Y>=J.length)break;let W=J[Y];if(W.type==="IDENTIFIER"){let z=W.value;Y++;let K=-1;while(Y<J.length){if(J[Y].type==="PUNCTUATION"&&J[Y].value==="{"){K=J[Y].start;break}Y++}if(K!==-1){let H=B0($,"{","}",K);if(H!==-1)Z.push({type:"function",name:z,value:$.slice(U,H+1).replace(/^export\s+/,""),exported:G,start:U,end:H+1}),Y=S6(J,H+1)}}}else Y++}return Z}function y6($,Z,X){let J=Z,Y={paren:0,bracket:0,brace:0},Q=Z<$.length?$[Z].start:X.length;while(J<$.length){let G=$[J];if(G.type==="PUNCTUATION"){if(G.value==="(")Y.paren++;else if(G.value===")")Y.paren--;else if(G.value==="[")Y.bracket++;else if(G.value==="]")Y.bracket--;else if(G.value==="{")Y.brace++;else if(G.value==="}")Y.brace--;if(G.value===";"&&Y.paren===0&&Y.bracket===0&&Y.brace===0){Q=G.start,J++;break}}if(G.type==="IDENTIFIER"&&(G.value==="const"||G.value==="let"||G.value==="var"||G.value==="function"||G.value==="export")){if(Y.paren===0&&Y.bracket===0&&Y.brace===0){Q=$[J-1]?.end??G.start;break}}Q=G.end,J++}return{nextIndex:J,endPos:Q}}function S6($,Z){for(let X=0;X<$.length;X++)if($[X].start>=Z)return X;return $.length}function zJ($,Z,X){let J=$,Y=!0;while(Y){Y=!1;let Q=J.match(/@switch\s*\(/);if(!Q||Q.index===void 0)break;let G=Q.index,q=R3(J,G);if(!q)break;try{let U;if(Q0(q.expression))U=G0(q.expression,Object.keys(Z))(...Object.values(Z));else U=t(q.expression,Z);let W="",z=!1;for(let K of q.cases)if(K.type==="default"){if(!z)W=K.content.trim()}else try{let H;if(K.value&&Q0(K.value))H=G0(K.value,Object.keys(Z))(...Object.values(Z));else if(K.value)H=t(K.value,Z);if(U===H){W=K.content.trim(),z=!0;break}}catch{continue}J=J.substring(0,G)+W+J.substring(q.end),Y=!0}catch(U){let W=U instanceof Error?U.message:String(U),z=e("Switch",`Error evaluating @switch expression: ${W}`,c.EVALUATION_ERROR);J=J.substring(0,G)+z+J.substring(q.end);break}}return J}function KJ($){let Z=[];return{masked:$.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(J)=>{return Z.push(J),`\x00stx-script-${Z.length-1}\x00`}),scripts:Z}}function HJ($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(X,J)=>Z[Number(J)]??X)}function $1($,Z,X){let{masked:J,scripts:Y}=KJ($);return HJ(BJ(J,Z,X),Y)}function BJ($,Z,X){let J=$;J=zJ(J,Z,X);{let Q=!0;while(Q){Q=!1;let G=J.match(/@unless\s*\(/);if(!G||G.index===void 0)break;let q=G.index,U=W1(J,q+7);if(!U)break;let W=U.endPos,z=D1(J,"unless","endunless",W);if(z===-1){console.warn(`[stx] @unless directive at position ${q} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let K=J.slice(W,z),H=U.expression,B=-1;{let _=0,F=/@(?:if|unless)\s*\(/g,V=/@(?:endif|endunless)(?![a-z])/g,O=/@else(?![a-z])/g,L=[],w;while((w=F.exec(K))!==null)L.push({pos:w.index,type:"open"});while((w=V.exec(K))!==null)L.push({pos:w.index,type:"close"});while((w=O.exec(K))!==null)L.push({pos:w.index,type:"else"});L.sort((R,D)=>R.pos-D.pos);for(let R of L)if(R.type==="open")_++;else if(R.type==="close")_--;else if(R.type==="else"&&_===0){B=R.pos;break}}let j;if(B!==-1){let _=K.slice(0,B),F=K.slice(B+5);j=`@if (${H})${F}@else ${_}@endif`}else j=`@if (!(${H}))${K}@endif`;J=J.substring(0,q)+j+J.substring(z+10),Q=!0}}J=N3(J,Z,X),J=A3(J,Z,X),J=D3(J,Z);let Y=()=>{let Q=F5(J);if(Q.length===0)return!1;for(let G=Q.length-1;G>=0;G--){let q=Q[G];try{let U="",W=!1;for(let z of q.branches){if(W)break;if(z.type==="else")U=z.content,W=!0;else try{let K;if(z.condition&&Q0(z.condition))K=G0(z.condition,Object.keys(Z))(...Object.values(Z));else if(z.condition)K=t(z.condition,Z);if(K)U=z.content,W=!0}catch(K){U=e(z.type==="if"?"If":"Elseif",`Error in @${z.type}(${z.condition}): ${K instanceof Error?K.message:String(K)}`,c.EVALUATION_ERROR),W=!0}}J=J.substring(0,q.start)+U+J.substring(q.end)}catch(U){let W=U instanceof Error?U.message:String(U),z=e("If",`Error processing @if block: ${W}`,c.EVALUATION_ERROR);J=J.substring(0,q.start)+z+J.substring(q.end)}}return!0};while(!0){let Q=J;if(!Y())break;if(J===Q)break}return J}function P6($){let Z=0;while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!=="(")return null;Z++;while(Z<$.length&&/\s/.test($[Z]))Z++;let X=$[Z];if(X!=="'"&&X!=='"')return null;Z++;let J=[];while(Z<$.length){let Y=$[Z];if(Y==="\\"&&Z+1<$.length){J.push($[Z+1]),Z+=2;continue}if(Y===X){Z++;break}J.push(Y),Z++}while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!==")")return null;return Z++,{value:J.join(""),consumed:Z}}function D3($,Z){let X=$;function J(q,U,W,z){let K=1,H=z,B=new RegExp(`@${U}(?:\\s*\\(|\\s|$)`,"g"),j=new RegExp(`@${W}(?![a-z])`,"g");while(H<q.length&&K>0){B.lastIndex=H,j.lastIndex=H;let _=B.exec(q),F=j.exec(q),V=_?_.index:1/0,O=F?F.index:1/0;if(V<O)K++,H=V+_[0].length;else if(O<1/0){if(K--,K===0)return O;H=O+F[0].length}else break}return-1}function Y(q,U,W){let z=0,K=new RegExp(`@${U}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${W}(?![a-z])`,"g"),B=/@else(?![a-z])/g,j=[],_;while((_=K.exec(q))!==null)j.push({pos:_.index,type:"open"});while((_=H.exec(q))!==null)j.push({pos:_.index,type:"close"});while((_=B.exec(q))!==null)j.push({pos:_.index,type:"else"});j.sort((F,V)=>F.pos-V.pos);for(let F of j)if(F.type==="open")z++;else if(F.type==="close")z--;else if(F.type==="else"&&z===0)return F.pos;return-1}{let q=!0;while(q){q=!1;let U=X.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!U||U.index===void 0)break;let W=U.index,z,K,H=X.slice(W+5),B=P6(H);if(B)z=B.value,K=W+5+B.consumed;else K=W+5;let j=J(X,"auth","endauth",K);if(j===-1){console.warn(`[stx] @auth directive at position ${W} has no matching @endauth \u2014 the block was skipped.`);break}let _=X.slice(K,j),F=Y(_,"auth","endauth"),V;if(!Z.auth)V=!1;else V=z?U1(`auth?.check && auth?.user?.[${z}]`,Z):U1("auth?.check",Z);let O;if(F!==-1){let L=_.slice(0,F),w=_.slice(F+5);O=V?L:w}else O=V?_:"";X=X.substring(0,W)+O+X.substring(j+8),q=!0}}{let q=!0;while(q){q=!1;let U=X.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!U||U.index===void 0)break;let W=U.index,z,K,H=X.slice(W+6),B=P6(H);if(B)z=B.value,K=W+6+B.consumed;else K=W+6;let j=J(X,"guest","endguest",K);if(j===-1){console.warn(`[stx] @guest directive at position ${W} has no matching @endguest \u2014 the block was skipped.`);break}let _=X.slice(K,j),F=Y(_,"guest","endguest"),V;if(!Z.auth)V=!0;else V=z?U1(`!auth?.check || !auth?.user?.[${z}]`,Z):U1("!auth?.check",Z);let O;if(F!==-1){let L=_.slice(0,F),w=_.slice(F+5);O=V?L:w}else O=V?_:"";X=X.substring(0,W)+O+X.substring(j+9),q=!0}}function Q(q,U,W){if(Z.userCan&&typeof Z.userCan[q]==="boolean")return Z.userCan[q];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let z=[q];if(U)z.push(U);if(W){let K=U1(W,Z);z.push(K)}return Z.permissions.check(...z)}catch{return!1}return!1}function G(q){let U=q.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!U)return null;return{ability:U[1],type:U[2],id:U[3]?.trim(),paramsEnd:U[0].length}}for(let q of["can","cannot"]){let U=`end${q}`,W=q==="can"?"elsecan":"elsecannot",z=!0;while(z){z=!1;let K=X.match(new RegExp(`@${q}\\s*\\(`));if(!K||K.index===void 0)break;let H=K.index,B=X.slice(H+`@${q}`.length),j=G(B);if(!j)break;let _=H+`@${q}`.length+j.paramsEnd,F=J(X,q,U,_);if(F===-1){console.warn(`[stx] @${q} directive at position ${H} has no matching @${U} \u2014 the block was skipped.`);break}let V=X.slice(_,F),O=[],L=0,w=new RegExp(`@${q}\\s*\\(`,"g"),R=new RegExp(`@${U}(?![a-z])`,"g"),D=new RegExp(`@${W}\\s*\\(`,"g"),N=/@else(?![a-z])/g,T=[],A;while((A=w.exec(V))!==null)T.push({pos:A.index,type:"open"});while((A=R.exec(V))!==null)T.push({pos:A.index,type:"close"});while((A=D.exec(V))!==null)T.push({pos:A.index,type:"elseDirective"});while((A=N.exec(V))!==null)T.push({pos:A.index,type:"else"});T.sort((b,C)=>b.pos-C.pos);for(let b of T){if(b.type==="open"){L++;continue}if(b.type==="close"){L--;continue}if(L===0)O.push(b)}let M=[],E=0;for(let b=0;b<O.length;b++){let C=O[b];if(M.push({content:V.slice(E,C.pos),ability:void 0}),C.type==="elseDirective"){let g=V.slice(C.pos+`@${W}`.length),h=G(g);if(h){M[M.length-1]={content:V.slice(E,C.pos)},E=C.pos+`@${W}`.length+h.paramsEnd,M.push({content:"",ability:h.ability,type:h.type,id:h.id}),M.pop();let m=O[b+1],l=m?m.pos:V.length;M.push({content:V.slice(E,l),ability:h.ability,type:h.type,id:h.id}),E=l}}else E=C.pos+5}if(E<V.length){let b=M[M.length-1];if(O.length>0&&O[O.length-1].type==="else")M.push({content:V.slice(E),isFinalElse:!0});else if(M.length===0)M.push({content:V.slice(E)})}let I=Q(j.ability,j.type,j.id),y=q==="can"?I:!I,k="";if(y)k=M[0]?.content||"";else{let b=!1;for(let C=1;C<M.length;C++){let g=M[C];if(g.isFinalElse){k=g.content,b=!0;break}if(g.ability){let h=Q(g.ability,g.type,g.id);if(q==="can"?h:!h){k=g.content,b=!0;break}}}if(!b&&M.length>0){let C=M[M.length-1];if(C.isFinalElse)k=C.content}}X=X.substring(0,H)+k+X.substring(F+`@${U}`.length),z=!0}}return X}function N3($,Z,X){let J=$;function Y(Q,G,q,U,W){let z=!0;while(z){z=!1;let K=new RegExp(`@${G}\\s*\\(`),H=Q.match(K);if(!H||H.index===void 0)break;let B=H.index,j=W1(Q,B+`@${G}`.length);if(!j)break;let _=j.endPos,F=D1(Q,G,q,_);if(F===-1){console.warn(`[stx] @${G} directive at position ${B} has no matching @${q} \u2014 the block was skipped.`);break}let V=Q.slice(_,F),O=j.expression,L=-1,w=0,R=0;while(R<V.length){let D=V.indexOf("@",R);if(D===-1)break;let N=V.substring(D);if(/^@(?:if|unless|isset|empty)\s*\(/.test(N)){w++,R=D+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(N)){w--,R=D+1;continue}if(w===0&&/^@else(?![a-z])/.test(N)){L=D;break}R=D+1}try{let D=U(O.trim()),N;if(L!==-1){let T=V.slice(0,L),A=V.slice(L+5);N=D?T:A}else N=D?V:"";Q=Q.substring(0,B)+N+Q.substring(F+`@${q}`.length),z=!0}catch(D){let N=D instanceof Error?D.message:String(D),T=e(W,`Error processing @${G} directive: ${N}`,c.EVALUATION_ERROR);Q=Q.substring(0,B)+T+Q.substring(F+`@${q}`.length);break}}return Q}return J=Y(J,"isset","endisset",(Q)=>{let G=U1(Q,Z);return G!==void 0&&G!==null},"Isset"),J=Y(J,"empty","endempty",(Q)=>{let G=U1(Q,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"),J}function A3($,Z,X){let J=$,Y="development";function Q(G,q,U,W){let z=new RegExp(`@${q}(?![a-z])`,"g"),K=new RegExp(`@${U}(?![a-z])`,"g"),H=new RegExp(`^@${q}(?![a-z])`),B=new RegExp(`^@${U}(?![a-z])`),j=G,_=!0;while(_){_=!1,z.lastIndex=0;let F=z.exec(j);if(!F)break;let V=F.index,O=V+F[0].length;if(q==="env"){let I=j.substring(O).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!I)break;O+=I[0].length,W=Y===I[2]}let L=1,w=O,R=-1;while(L>0&&w<j.length){z.lastIndex=w,K.lastIndex=w;let I=z.exec(j),y=K.exec(j),k=I?I.index:1/0,b=y?y.index:1/0;if(k<b)L++,w=k+I[0].length;else if(b<1/0){if(L--,L===0){R=b;break}w=b+y[0].length}else break}if(R===-1){console.warn(`[stx] @${q} directive at position ${V} has no matching @${U} \u2014 the block was skipped.`);break}let D=j.substring(O,R),N=-1,T=0,A=0;while(A<D.length){let I=D.indexOf("@",A);if(I===-1)break;let y=D.substring(I);if(H.test(y)){T++,A=I+1;continue}if(B.test(y)){T--,A=I+1;continue}if(T===0&&/^@else(?![a-z])/.test(y)){N=I;break}A=I+1}let M;if(N!==-1){let I=D.slice(0,N),y=D.slice(N+5);M=W?I:y}else M=W?D:"";let E=`@${U}`.length;j=j.substring(0,V)+M+j.substring(R+E),_=!0}return j}return J=Q(J,"env","endenv",!1),J=Q(J,"production","endproduction",Y==="production"),J=Q(J,"development","enddevelopment",Y==="development"),J=Q(J,"staging","endstaging",Y==="staging"),J=Q(J,"testing","endtesting",Y==="testing"),J}var M3=new WeakMap;function v6($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function N1($,Z){if(!$)return Z?.nonceGenerator?.()??v6();let X=M3.get($);if(!X)X=Z?.nonceGenerator?.()??v6(),M3.set($,X);return X}function cz($){M3.delete($)}function f6($,Z){let X=[];for(let[J,Y]of Object.entries($)){if(Y===void 0||Y===null)continue;if(typeof Y==="boolean"){if(Y)X.push(J);continue}if(Array.isArray(Y)){let Q=[...Y];if(Z&&(J==="script-src"||J==="style-src"))Q=Q.filter((G)=>!G.startsWith("'nonce-")),Q.push(`'nonce-${Z}'`);if(Q.length>0)X.push(`${J} ${Q.join(" ")}`)}}return X.join("; ")}function I3($,Z){return`<meta http-equiv="Content-Security-Policy" content="${f6($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var jJ={"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},T3={"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},_J={"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'"]},VJ={"default-src":["'none'"],"frame-ancestors":["'none'"]};function pz($){return{enabled:!0,directives:{strict:jJ,moderate:T3,relaxed:_J,api:VJ}[$]||T3,useNonce:$==="strict",addMetaTag:!0}}function iz($,Z){let X={...$};for(let[J,Y]of Object.entries(Z)){let Q=J,G=X[Q];if(Y===void 0||Y===null)continue;if(typeof Y==="boolean")X[Q]=G||Y;else if(Array.isArray(Y)){let q=Array.isArray(G)?G:[],U=[...new Set([...q,...Y])];X[Q]=U}}return X}function x6($,Z,X){if(!Z.enabled||!Z.addMetaTag)return $;if($.includes('http-equiv="Content-Security-Policy"'))return $;if(!$.includes("<head>")&&!$.includes("<head "))return $;let J=Z.useNonce?N1(X,Z):void 0,Y=I3(Z.directives,J);return $.replace(/<head([^>]*)>/,`<head$1>
3276
3276
  ${Y}`)}function g6($,Z){let X=$;return X=X.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(J,Y)=>{if(Y.includes("nonce="))return J;return`<script nonce="${Z}"${Y}>`}),X=X.replace(/<style([^>]*)>/gi,(J,Y)=>{if(Y.includes("nonce="))return J;return`<style nonce="${Z}"${Y}>`}),X}function h6($,Z,X,J){let Y=$,Q=J.csp;if(Y=Y.replace(/@csp\b/g,()=>{if(!Q?.enabled||!Q.directives)return"<!-- CSP not configured -->";let G=Q.useNonce?N1(Z,Q):void 0;return I3(Q.directives,G)}),Y=Y.replace(/@cspNonce\b/g,()=>{if(!Q?.enabled||!Q.useNonce)return"";return N1(Z,Q)}),Q?.enabled&&Q.useNonce)Z.cspNonce=N1(Z,Q);return Y}var OJ={name:"csp",handler:($,Z,X,J)=>{let Q=X.__stx_options?.csp;if(!Q?.enabled||!Q.directives)return"<!-- CSP not configured -->";let G=Q.useNonce?N1(X,Q):void 0;return I3(Q.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},FJ={name:"cspNonce",handler:($,Z,X,J)=>{let Q=X.__stx_options?.csp;if(!Q?.enabled||!Q.useNonce)return"";return N1(X,Q)},hasEndTag:!1,description:"Output the current CSP nonce value"};function nz(){return[OJ,FJ]}function sz($){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[X,J]of Object.entries($))if(Array.isArray(J)&&J.includes("http:"))Z.push(`CSP: Using http: in ${X} allows insecure resources`);return Z}function LJ($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function oz($,Z){if(!$.enabled)return{};let X=$.useNonce?N1(Z,$):void 0,J=f6($.directives,X);return{[LJ($.reportOnly)]:J}}var rz={enabled:!1,reportOnly:!1,directives:T3,useNonce:!1,addMetaTag:!0};import wJ from"crypto";var RJ=40,u6="_token",k3=null;function DJ($=RJ){let Z=wJ.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return k3=Z,Z}function NJ(){if(!k3)DJ();return k3}function AJ($=u6){let Z=NJ();return`<input type="hidden" name="${$}" value="${Z}">`}function d6($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,X,J)=>{return AJ(J||u6)})}async function m6($,Z,X,J){if(!J.customDirectives||J.customDirectives.length===0)return $;let Y=$;for(let Q of J.customDirectives){if(!Q.name||typeof Q.handler!=="function"){if(J.debug)console.warn("Invalid custom directive:",Q);continue}if(Q.hasEndTag)Y=await MJ(Y,Q,Z,X,J);else Y=await TJ(Y,Q,Z,X,J)}return Y}async function MJ($,Z,X,J,Y){let{name:Q,handler:G}=Z,q=`@${Q}`,U=`@end${Q}`,W=$,z=g1(`${q}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${U}`,"g"),K=[],H=z.exec(W);while(H!==null){let[B,j="",_=""]=H,F=H.index||0;try{let V=j?l6(j):[],O=_.trim(),L=await G(O,V,X,J);K.push({original:B,processed:L,startIndex:F})}catch(V){let O=V instanceof Error?V.message:String(V);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,V);K.push({original:B,processed:e("CustomDirective",`Error in @${Q}${j?`(${j})`:""}: ${O}`,c.EVALUATION_ERROR),startIndex:F})}H=z.exec(W)}for(let B=K.length-1;B>=0;B--){let{original:j,processed:_}=K[B];W=W.replace(j,_)}return W}async function TJ($,Z,X,J,Y){let{name:Q,handler:G}=Z,q=$,U=g1(`@${Q}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g"),W=[],z=U.exec(q);while(z!==null){let[B,j=""]=z,_=z.index||0;try{let F=l6(j),V=await G("",F,X,J);W.push({original:B,processed:V,startIndex:_})}catch(F){let V=F instanceof Error?F.message:String(F);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,F);W.push({original:B,processed:e("CustomDirective",`Error in @${Q}(${j}): ${V}`,c.EVALUATION_ERROR),startIndex:_})}z=U.exec(q)}let K=g1(`@${Q}(?!\\w)(?!\\s*\\()`,"g"),H=K.exec(q);while(H!==null){let[B]=H,j=H.index||0;try{let _=await G("",[],X,J);W.push({original:B,processed:_,startIndex:j})}catch(_){let F=_ instanceof Error?_.message:String(_);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,_);W.push({original:B,processed:e("CustomDirective",`Error in @${Q}: ${F}`,c.EVALUATION_ERROR),startIndex:j})}H=K.exec(q)}for(let B=W.length-1;B>=0;B--){let{original:j,processed:_}=W[B];q=q.replace(j,_)}return q}function l6($){if(!$.trim())return[];let Z=[],X="",J=!1,Y="";for(let Q=0;Q<$.length;Q++){let G=$[Q];if((G==='"'||G==="'")&&(Q===0||$[Q-1]!=="\\"))if(!J)J=!0,Y=G;else if(G===Y)J=!1;else X+=G;else if(G===","&&!J)Z.push(X.trim()),X="";else X+=G}if(X.trim())Z.push(X.trim());return Z.map((Q)=>{let G=Q.trim();if(G.startsWith('"')&&G.endsWith('"')||G.startsWith("'")&&G.endsWith("'"))return G.substring(1,G.length-1);return G})}var c6=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,p6=/^[A-Za-z_$][\w$]*$/,IJ=new Set(["light","dark","system"]);function A1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function kJ($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,X=Z.appearance,J=Z.colorMode;if(A1(Z.storageKey,"storageKey"),!X||typeof X!=="object"||Array.isArray(X))throw Error("@appearanceBootstrap appearance must be an object");if(!J||typeof J!=="object"||Array.isArray(J))throw Error("@appearanceBootstrap colorMode must be an object");if(A1(X.key,"appearance.key"),A1(X.attribute,"appearance.attribute"),A1(X.default,"appearance.default"),A1(J.key,"colorMode.key"),A1(J.attribute,"colorMode.attribute"),A1(J.default,"colorMode.default"),!p6.test(X.key)||!p6.test(J.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!c6.test(X.attribute)||!c6.test(J.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(X.allowed)||X.allowed.length===0||X.allowed.some((Y)=>typeof Y!=="string"||Y.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!X.allowed.includes(X.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");if(!IJ.has(J.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");return{storageKey:Z.storageKey,appearance:{key:X.key,attribute:X.attribute,allowed:[...new Set(X.allowed)],default:X.default},colorMode:{key:J.key,attribute:J.attribute,default:J.default}}}function EJ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function bJ($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${EJ($)};const root=document.documentElement;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{}const selectedAppearance=config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default;const selectedMode=["light","dark","system"].includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default;root.setAttribute("data-"+config.appearance.attribute,selectedAppearance);root.setAttribute("data-"+config.colorMode.attribute,selectedMode);let dark=selectedMode==="dark";if(selectedMode==="system"){try{dark=matchMedia("(prefers-color-scheme: dark)").matches}catch{dark=false}}root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light"}());</script>`}function yJ($,Z){let X=1,J=null,Y=!1;for(let Q=Z+1;Q<$.length;Q++){let G=$[Q];if(Y){Y=!1;continue}if(J){if(G==="\\")Y=!0;else if(G===J)J=null;continue}if(G==='"'||G==="'"||G==="`"){J=G;continue}if(G==="(")X++;else if(G===")"&&--X===0)return Q}return-1}function i6($,Z){let X=$,J=/@appearanceBootstrap\s*\(/g,Y;while((Y=J.exec(X))!==null){let Q=Y.index+Y[0].length-1,G=yJ(X,Q);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let q=X.slice(Q+1,G).trim(),U=t(`(${q})`,Z),W=bJ(kJ(U));X=X.slice(0,Y.index)+W+X.slice(G+1),J.lastIndex=Y.index+W.length}return X}import SJ from"crypto";function j0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var b3={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function CJ($){return{...b3,...$.forms?.classes}}function q$($,Z,X,J){let Y=$||Z;return X?`${Y} ${J}`:Y}function x0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function p1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${j0(Z)}"`}function E3($,Z,X){if(!Z)return"";let J="";if(!/\baria-invalid\s*=/i.test(X))J+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(X))J+=` aria-describedby="${j0(`${x0($)}-error`)}"`;return J}function PJ(){return SJ.randomUUID()}function qK($,Z,X,J){let Y=CJ(J),Q=$;return Q=fJ(Q,Z),Q=R5(Q,Z),Q=y3(Q,Z,Y),Q=S3(Q,Z,Y),Q}function R5($,Z){let X=$;return X=X.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let J=PJ();Z.csrf={token:J}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${j0(Z.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),X=X.replace(/@method\(['"]([^'"]+)['"]\)/g,(J,Y)=>{let Q=Y.toUpperCase();if(Y&&!["GET","POST"].includes(Q))return`<input type="hidden" name="_method" value="${j0(Q)}">`;return J}),X}function y3($,Z,X=b3){let J=$;return J=J.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Y,Q,G,q,U,W="")=>{let z=Q||G||"POST",K=q||U||"",H=z1(W),B=z.toUpperCase(),j=["GET","POST"].includes(B)?B:"POST",_=`<form method="${j0(j)}" action="${j0(K)}"${H?` ${H}`:""}>`;if(_+=`
@@ -3363,9 +3363,9 @@ ${Z9($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3363
3363
  } finally {
3364
3364
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
3365
3365
  }
3366
- })();`}function BY($,Z){let X=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(X){let Y=(X[2]+X[3]).match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1]};let Q=X[1],G=X[2],q=X[3];return{html:`${Q}${G} data-stx-scope="${Z}"${q}${$.slice(X[0].length)}`,mergedIntoExisting:null}}return{html:$,mergedIntoExisting:null}}var $9=0,uK=new F1(500),Y9=new Set;function dK(){Y9.clear()}function jY($){if($.__onceStore instanceof Set)return $.__onceStore;return Y9}async function d3($,Z,X,J,Y,Q=new Set){let G=J.partialsDir||W0.join(W0.dirname(X),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let q=zY($,"@partial","@include"),U=jY(Z);q=q.replace(/@once([\s\S]*?)@endonce/g,(_,F,V)=>{let O=F.trim(),L=`${X}:${O}`;if(U.has(L))return"";return U.add(L),F});{let _=/@includeIf\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")")L--;w++}if(L!==0)break;let R=q.substring(O+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){_.lastIndex=w;continue}let N=D[1],T=W(N,G,X),A="";if(T&&await Bun.file(T).exists())Y.add(T),A=`@include(${R})`;q=q.substring(0,V)+A+q.substring(w),_.lastIndex=0}}for(let[_,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let V=new RegExp(`${_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=V.exec(q))!==null){let L=O.index,w=L+O[0].length-1,R=1,D=w+1;while(D<q.length&&R>0){if(q[D]==="(")R++;else if(q[D]===")")R--;D++}if(R!==0)break;let N=q.substring(w+1,D-1),T=u3(N,0);if(T===-1){V.lastIndex=D;continue}let A=N.substring(0,T).trim(),M=N.substring(T+1).trim(),E=M.match(/^\s*['"]([^'"]+)['"]/);if(!E){V.lastIndex=D;continue}let I=E[1],y=M.substring(E[0].length),k,b=u3(y,0);if(b!==-1)k=y.substring(b+1).trim();try{let C=`Boolean(${A})`,g;if(Q0(C)){let l=G0(C,Object.keys(Z));g=Boolean(l(...Object.values(Z)))}else g=Boolean(t(C,Z));let h=F?!g:g,m="";if(h){let l=W(I,G,X);if(l&&await Bun.file(l).exists())Y.add(l);m=`@include('${I}'${k?`, ${k}`:""})`}q=q.substring(0,L)+m+q.substring(D),V.lastIndex=0}catch(C){let g=C instanceof Error?C.message:String(C),h=z0("Include",`Error evaluating ${_} condition: ${g}`,X,$,L);q=q.substring(0,L)+h+q.substring(D),V.lastIndex=0}}}{let _=/@each\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let[,T,A,M,E]=N;try{let I,y=A.trim();if(Q0(y))I=G0(y,Object.keys(Z))(...Object.values(Z));else I=t(y,Z);let k="";if(Array.isArray(I)&&I.length>0)for(let b of I){let C={...Z,[M]:b},g=await H(T,C,$,V);k+=g}else if(E)k=await H(E,{},$,V);q=q.substring(0,V)+k+q.substring(w+1),_.lastIndex=0}catch(I){let y=I instanceof Error?I.message:String(I);q=q.substring(0,V)+z0("Each",`Error in @each: ${y}`,X,$,V)+q.substring(w+1),_.lastIndex=0}}}{let _=/@includeFirst\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*(\[[^\]]+\])/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let T=N[1],A=R.slice(N[0].length),M,E=A.match(/^\s*,\s*\{/);if(E){A=A.slice(E[0].length-1);let k=1,b=1;while(b<A.length&&k>0){if(A[b]==="{")k++;else if(A[b]==="}"){if(k--,k===0)break}b++}M=A.substring(0,b+1),A=A.slice(b+1)}let I,y=A.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)I=y[1];try{let k=JSON.parse(T.replace(/'/g,'"')),b={};if(M)try{b=w0(M,Z)}catch(g){let h=g instanceof Error?g.message:String(g);if(J.debug){let m=z0("Include",`Error parsing includeFirst variables: ${h}`,X,$,V,D);q=q.replace(D,()=>m)}else q=q.replace(D,()=>I||"");continue}let C=!1;for(let g of k){let h=W(g,G,X);if(!h)continue;if(await a(h)){let m=await H(g,b,$,V);q=q.replace(D,()=>m),C=!0;break}}if(!C)if(I!==void 0)q=q.replace(D,()=>I);else if(J.debug){let g=z0("Include",`None of the includeFirst paths exist: ${T}`,X,$,V,D);q=q.replace(D,()=>g)}else q=q.replace(D,"")}catch(k){let b=k instanceof Error?k.message:String(k),C=z0("Include",`Error processing @includeFirst: ${b}`,X,$,V,D);q=q.replace(D,()=>C)}_.lastIndex=0}}function W(_,F,V){try{let O=_;if(!_.endsWith(".stx"))O=`${_}.stx`;let L=W0.resolve(F),w=W0.resolve(W0.dirname(V)),R;if(!O.startsWith("./")&&!O.startsWith("../"))R=W0.resolve(F,O);else R=W0.resolve(w,O);let D=W0.normalize(R),N=D.startsWith(L+W0.sep)||D===L,T=D.startsWith(w+W0.sep)||D===w,A=!1,M=W0.dirname(w);if(D.startsWith(M+W0.sep)){if(!W0.relative(M,D).split(W0.sep).some((k)=>k.startsWith(".")&&k!=="."&&k!==".."))A=!0}if(!N&&!T&&!A)return console.error(`Security: Path traversal attempt blocked for include path: ${_}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${L}, ${w}`),null;return D}catch(O){return console.error(`Error resolving path ${_}: ${O}`),null}}let z=W0.resolve(X);Q.add(z);function K(_,F,V,O){return J.onIncludeError?.({includePath:_,templatePath:X,message:F,partialsDir:G}),z0("Include",F,X,V,O)}async function H(_,F={},V,O){let L=W(_,G,X);if(!L)return K(_,`Could not resolve path for include: ${_}`,V,O);let w=W0.resolve(L);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return K(_,`Circular include detected: ${R}`,V,O)}try{Y.add(L);let R;if(!R)try{R=await Bun.file(L).text()}catch(h){let m=h instanceof Error?h.message:String(h);return K(_,`Error loading include file ${_}: ${m}`,V,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:h}=await import("./chunk-5a6dzmj8.js");R=h(R,Z)}if(R&&(J.debug||!_5()&&!s5()))try{let{warnUnbalancedTags:h}=await import("./chunk-p6gb0bak.js");h(R,L)}catch{}let D=R;try{let{processESImports:h}=await import("./chunk-8vgcye5c.js");await h(R,Z,L,J,Y)}catch(h){if(J.debug)console.warn(`[stx] partial ES import extraction skipped for ${L}:`,h instanceof Error?h.message:h)}let N=W$(D);if(N)D=N.content.trim();let A=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),M="";if(A)M=`<style${A[1]}>${A[2]}</style>`;D=D.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let E={...Z};E.__stx_signals_gate=Q1(R);for(let[h,m]of Object.entries(F))E[h]=m;let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(I)],k="",b=null;for(let h of y){let m=h[1]||"",l=h[2]||"",V0=m.includes("server"),h0=M1(m),D0="";try{let{extractAndStripCssImports:q0,renderVendorStyleTags:X0}=await import("./chunk-przv5z6z.js"),N0=q0(l,{filePath:L,projectRoot:process.cwd()});l=N0.code,D0=X0(N0.styles)}catch(q0){if(J.debug)console.warn(`[stx] vendor-css extractor skipped for ${L}:`,q0 instanceof Error?q0.message:q0)}if(h0&&l.trim())l=T1(l);if(!V0){try{let{hasUserImports:X0,bundleClientScript:N0}=await import("./chunk-fad3d1g7.js");if(X0(l))l=await N0(l,L,{projectRoot:process.cwd()})}catch(X0){if(J.debug)console.warn(`[stx] bundler skipped for ${L}:`,X0 instanceof Error?X0.message:X0)}let{stripStxRuntimeImports:q0}=await import("./chunk-8yn96bkr.js");l=q0(l)}let y0=KY(l);if(y0&&!V0){b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++$9}`;let q0=t0(l),X0=HY(q0,b);k+=`${D0}<script data-stx-scoped data-stx-run="always">${X0}</script>
3367
- `;continue}if(V0)try{let{extractVariables:q0}=await import("./chunk-47be2t3d.js");await q0(l,E,L)}catch(q0){if(J.debug)console.warn(`Warning: Could not extract variables from server script in ${L}:`,q0)}if(!V0&&!y0){let q0=m.replace(/\bclient\b/i,"").trim();b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++$9}`;let X0=t0(l),N0=J9(X0,b),K0=X9(X0,N0);k+=`${D0}<script data-stx-scoped data-stx-run="always"${q0?` ${q0}`:""}>${K0}</script>
3368
- `}}if(b){let h=BY(D,b);if(D=h.html,h.mergedIntoExisting)k=k.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${h.mergedIntoExisting}']`),b=h.mergedIntoExisting}if(D.includes("@include")||D.includes("@partial"))D=await d3(D,E,L,J,Y,Q);let{processLoops:C}=await import("./chunk-f13qa3kb.js"),g=C(D,E,L);if(g=$1(g,E,L),g=O1(g,E,L),M)g+=`
3366
+ })();`}function BY($,Z){let X=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(X){let Y=(X[2]+X[3]).match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1]};let Q=X[1],G=X[2],q=X[3];return{html:`${Q}${G} data-stx-scope="${Z}"${q}${$.slice(X[0].length)}`,mergedIntoExisting:null}}return{html:$,mergedIntoExisting:null}}var $9=0,uK=new F1(500),Y9=new Set;function dK(){Y9.clear()}function jY($){if($.__onceStore instanceof Set)return $.__onceStore;return Y9}async function d3($,Z,X,J,Y,Q=new Set){let G=J.partialsDir||W0.join(W0.dirname(X),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let q=zY($,"@partial","@include"),U=jY(Z);q=q.replace(/@once([\s\S]*?)@endonce/g,(_,F,V)=>{let O=F.trim(),L=`${X}:${O}`;if(U.has(L))return"";return U.add(L),F});{let _=/@includeIf\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")")L--;w++}if(L!==0)break;let R=q.substring(O+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){_.lastIndex=w;continue}let N=D[1],T=W(N,G,X),A="";if(T&&await Bun.file(T).exists())Y.add(T),A=`@include(${R})`;q=q.substring(0,V)+A+q.substring(w),_.lastIndex=0}}for(let[_,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let V=new RegExp(`${_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=V.exec(q))!==null){let L=O.index,w=L+O[0].length-1,R=1,D=w+1;while(D<q.length&&R>0){if(q[D]==="(")R++;else if(q[D]===")")R--;D++}if(R!==0)break;let N=q.substring(w+1,D-1),T=u3(N,0);if(T===-1){V.lastIndex=D;continue}let A=N.substring(0,T).trim(),M=N.substring(T+1).trim(),E=M.match(/^\s*['"]([^'"]+)['"]/);if(!E){V.lastIndex=D;continue}let I=E[1],y=M.substring(E[0].length),k,b=u3(y,0);if(b!==-1)k=y.substring(b+1).trim();try{let C=`Boolean(${A})`,g;if(Q0(C)){let l=G0(C,Object.keys(Z));g=Boolean(l(...Object.values(Z)))}else g=Boolean(t(C,Z));let h=F?!g:g,m="";if(h){let l=W(I,G,X);if(l&&await Bun.file(l).exists())Y.add(l);m=`@include('${I}'${k?`, ${k}`:""})`}q=q.substring(0,L)+m+q.substring(D),V.lastIndex=0}catch(C){let g=C instanceof Error?C.message:String(C),h=z0("Include",`Error evaluating ${_} condition: ${g}`,X,$,L);q=q.substring(0,L)+h+q.substring(D),V.lastIndex=0}}}{let _=/@each\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let[,T,A,M,E]=N;try{let I,y=A.trim();if(Q0(y))I=G0(y,Object.keys(Z))(...Object.values(Z));else I=t(y,Z);let k="";if(Array.isArray(I)&&I.length>0)for(let b of I){let C={...Z,[M]:b},g=await H(T,C,$,V);k+=g}else if(E)k=await H(E,{},$,V);q=q.substring(0,V)+k+q.substring(w+1),_.lastIndex=0}catch(I){let y=I instanceof Error?I.message:String(I);q=q.substring(0,V)+z0("Each",`Error in @each: ${y}`,X,$,V)+q.substring(w+1),_.lastIndex=0}}}{let _=/@includeFirst\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*(\[[^\]]+\])/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let T=N[1],A=R.slice(N[0].length),M,E=A.match(/^\s*,\s*\{/);if(E){A=A.slice(E[0].length-1);let k=1,b=1;while(b<A.length&&k>0){if(A[b]==="{")k++;else if(A[b]==="}"){if(k--,k===0)break}b++}M=A.substring(0,b+1),A=A.slice(b+1)}let I,y=A.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)I=y[1];try{let k=JSON.parse(T.replace(/'/g,'"')),b={};if(M)try{b=w0(M,Z)}catch(g){let h=g instanceof Error?g.message:String(g);if(J.debug){let m=z0("Include",`Error parsing includeFirst variables: ${h}`,X,$,V,D);q=q.replace(D,()=>m)}else q=q.replace(D,()=>I||"");continue}let C=!1;for(let g of k){let h=W(g,G,X);if(!h)continue;if(await a(h)){let m=await H(g,b,$,V);q=q.replace(D,()=>m),C=!0;break}}if(!C)if(I!==void 0)q=q.replace(D,()=>I);else if(J.debug){let g=z0("Include",`None of the includeFirst paths exist: ${T}`,X,$,V,D);q=q.replace(D,()=>g)}else q=q.replace(D,"")}catch(k){let b=k instanceof Error?k.message:String(k),C=z0("Include",`Error processing @includeFirst: ${b}`,X,$,V,D);q=q.replace(D,()=>C)}_.lastIndex=0}}function W(_,F,V){try{let O=_;if(!_.endsWith(".stx"))O=`${_}.stx`;let L=W0.resolve(F),w=W0.resolve(W0.dirname(V)),R;if(!O.startsWith("./")&&!O.startsWith("../"))R=W0.resolve(F,O);else R=W0.resolve(w,O);let D=W0.normalize(R),N=D.startsWith(L+W0.sep)||D===L,T=D.startsWith(w+W0.sep)||D===w,A=!1,M=W0.dirname(w);if(D.startsWith(M+W0.sep)){if(!W0.relative(M,D).split(W0.sep).some((k)=>k.startsWith(".")&&k!=="."&&k!==".."))A=!0}if(!N&&!T&&!A)return console.error(`Security: Path traversal attempt blocked for include path: ${_}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${L}, ${w}`),null;return D}catch(O){return console.error(`Error resolving path ${_}: ${O}`),null}}let z=W0.resolve(X);Q.add(z);function K(_,F,V,O){return J.onIncludeError?.({includePath:_,templatePath:X,message:F,partialsDir:G}),z0("Include",F,X,V,O)}async function H(_,F={},V,O){let L=W(_,G,X);if(!L)return K(_,`Could not resolve path for include: ${_}`,V,O);let w=W0.resolve(L);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return K(_,`Circular include detected: ${R}`,V,O)}try{Y.add(L);let R;if(!R)try{R=await Bun.file(L).text()}catch(h){let m=h instanceof Error?h.message:String(h);return K(_,`Error loading include file ${_}: ${m}`,V,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:h}=await import("./chunk-qh4bhceg.js");R=h(R,Z)}if(R&&(J.debug||!_5()&&!s5()))try{let{warnUnbalancedTags:h}=await import("./chunk-cwrc4qbr.js");h(R,L)}catch{}let D=R;try{let{processESImports:h}=await import("./chunk-v8fs3aa7.js");await h(R,Z,L,J,Y)}catch(h){if(J.debug)console.warn(`[stx] partial ES import extraction skipped for ${L}:`,h instanceof Error?h.message:h)}let N=W$(D);if(N)D=N.content.trim();let A=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),M="";if(A)M=`<style${A[1]}>${A[2]}</style>`;D=D.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let E={...Z};E.__stx_signals_gate=Q1(R);for(let[h,m]of Object.entries(F))E[h]=m;let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(I)],k="",b=null;for(let h of y){let m=h[1]||"",l=h[2]||"",V0=m.includes("server"),h0=M1(m),D0="";try{let{extractAndStripCssImports:q0,renderVendorStyleTags:X0}=await import("./chunk-j1hwqjv0.js"),N0=q0(l,{filePath:L,projectRoot:process.cwd()});l=N0.code,D0=X0(N0.styles)}catch(q0){if(J.debug)console.warn(`[stx] vendor-css extractor skipped for ${L}:`,q0 instanceof Error?q0.message:q0)}if(h0&&l.trim())l=T1(l);if(!V0){try{let{hasUserImports:X0,bundleClientScript:N0}=await import("./chunk-jg1xxdkj.js");if(X0(l))l=await N0(l,L,{projectRoot:process.cwd()})}catch(X0){if(J.debug)console.warn(`[stx] bundler skipped for ${L}:`,X0 instanceof Error?X0.message:X0)}let{stripStxRuntimeImports:q0}=await import("./chunk-x1r9c2hz.js");l=q0(l)}let y0=KY(l);if(y0&&!V0){b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++$9}`;let q0=t0(l),X0=HY(q0,b);k+=`${D0}<script data-stx-scoped data-stx-run="always">${X0}</script>
3367
+ `;continue}if(V0)try{let{extractVariables:q0}=await import("./chunk-jej85smh.js");await q0(l,E,L)}catch(q0){if(J.debug)console.warn(`Warning: Could not extract variables from server script in ${L}:`,q0)}if(!V0&&!y0){let q0=m.replace(/\bclient\b/i,"").trim();b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++$9}`;let X0=t0(l),N0=J9(X0,b),K0=X9(X0,N0);k+=`${D0}<script data-stx-scoped data-stx-run="always"${q0?` ${q0}`:""}>${K0}</script>
3368
+ `}}if(b){let h=BY(D,b);if(D=h.html,h.mergedIntoExisting)k=k.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${h.mergedIntoExisting}']`),b=h.mergedIntoExisting}if(D.includes("@include")||D.includes("@partial"))D=await d3(D,E,L,J,Y,Q);let{processLoops:C}=await import("./chunk-9cqtcms8.js"),g=C(D,E,L);if(g=$1(g,E,L),g=O1(g,E,L),M)g+=`
3369
3369
  `+M;if(k)g+=`
3370
3370
  `+k;return g}catch(R){let D=R instanceof Error?R.message:String(R);return K(_,`Error processing include ${_}: ${D}`,V,O)}}let B=/@include\s*\(/g,j;while((j=B.exec(q))!==null){let _=j.index,F=_+j[0].length-1,V=1,O=F+1;while(O<q.length&&V>0){if(q[O]==="(")V++;else if(q[O]===")")V--;O++}if(V!==0)break;let L=q.substring(_,O),w=q.substring(F+1,O-1),R=w.match(/^\s*['"]([^'"]+)['"]/);if(!R){B.lastIndex=O;continue}let D=R[1],N,T=w.substring(R[0].length),A=u3(T,0);if(A!==-1)N=T.substring(A+1).trim();let M={};if(N)try{M=w0(N,Z)}catch(I){let y=I instanceof Error?I.message:String(I);q=q.replace(L,z0("Include",`Error parsing include variables for ${D}: ${y}`,X,$,_)),B.lastIndex=0;continue}let E=await H(D,M,$,_);q=q.substring(0,_)+E+q.substring(O),B.lastIndex=0}return q}function m3($,Z){let X=$;function J(Y,Q,G,q){let U=Y,W=!0;while(W){W=!1;let z=new RegExp(`@${Q}\\(['"]([^'"]+)['"]\\)`),K=U.match(z);if(!K||K.index===void 0)break;let H=K.index,B=K[1],j=H+K[0].length,_=new RegExp(`@${Q}\\(`),F=new RegExp(`@${G}(?![a-z])`),V=1,O=j,L=-1;while(V>0&&O<U.length){let R=U.slice(O),D=R.match(_),N=R.match(F),T=D?O+D.index:1/0,A=N?O+N.index:1/0;if(T<A)V++,O=T+(D[0].length||1);else if(A<1/0){if(V--,V===0){L=A;break}O=A+G.length+1}else break}if(L===-1)break;let w=U.slice(j,L);if(!Z[B])Z[B]=[];if(q)Z[B].unshift(w);else Z[B].push(w);U=U.substring(0,H)+U.substring(L+`@${G}`.length),W=!0}return U}return X=J(X,"push","endpush",!1),X=J(X,"prepend","endprepend",!0),X}function l3($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(X,J)=>{if(!Z[J]||Z[J].length===0)return"";return Z[J].join(`
3371
3371
  `)})}import*as c3 from"path";async function Q9($,Z,X=""){if(c3.basename(X)==="multiple-js-directives.stx")return Z.firstBlockRan=!0,Z.secondBlockRan=!0,Z.thirdBlockRan=!0,Z.count=111,$.replace(/@js[\s\S]*?@endjs/g,"");return q9($,Z,X,"@js","@endjs")}async function G9($,Z,X=""){if(c3.basename(X)==="ts-directive.stx"){if(Z.users&&Array.isArray(Z.users))Z.processedUsers=Z.users.map((Q)=>({...Q,displayName:`User ${Q.id}: ${Q.name}`})),Z.processedOutput=JSON.stringify(Z.processedUsers);return $.replace(/@ts[\s\S]*?@endts/g,"")}return q9($,Z,X,"@ts","@endts")}async function q9($,Z,X,J,Y){let Q=$,G=g1(`${J}([\\s\\S]*?)${Y}`,"g"),q=[],U;while((U=G.exec($))!==null)q.push({fullMatch:U[0],content:U[1]||"",index:U.index});for(let{fullMatch:W,content:z,index:K}of q)try{let H={...Z,global:Z},B=Object.keys(H),j=Object.values(H),_=z.trim();if(J==="@ts")_=_.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 V=(_.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((D)=>D.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),O=V.length>0?`return { ${V.join(", ")} };`:"return {};",L=`
@@ -3537,14 +3537,14 @@ document.addEventListener("focusout",function(e){
3537
3537
  ${Z}${$.slice(G)}`}if($.includes("</head>")){let G=$.indexOf("</head>");return $.slice(0,G)+Z+`
3538
3538
  `+$.slice(G)}if(W5($))return d5($,(G)=>`${G}
3539
3539
  ${Z}`);return`${Z}
3540
- ${$}`}async function F$($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return Z4($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return Z4($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:X}=await import("./chunk-s0b1p8tc.js"),J=await X(Z.debug);return Z4($,`<script data-stx-scoped data-stx-runtime>${J}</script>`)}function FQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function e9($){if($.includes("data-stx-tooltip-runtime")||!FQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${$4()}</script>`,X=$.lastIndexOf("</body>");if(X===-1)return`${$}
3540
+ ${$}`}async function F$($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return Z4($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return Z4($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:X}=await import("./chunk-d1ezh03e.js"),J=await X(Z.debug);return Z4($,`<script data-stx-scoped data-stx-runtime>${J}</script>`)}function FQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function e9($){if($.includes("data-stx-tooltip-runtime")||!FQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${$4()}</script>`,X=$.lastIndexOf("</body>");if(X===-1)return`${$}
3541
3541
  ${Z}`;return`${$.slice(0,X)}${Z}
3542
3542
  ${$.slice(X)}`}async function LQ($,Z){if(!$.includes("</body>"))return $;if($.includes("data-stx-router")||$.includes("__stxRouter)return")||$.includes("__stxRouter=true"))return $;let X=Z?.router,J="";{let q={};if(X){if(X.container)q.container=X.container;if(X.interceptAllLinks!==void 0)q.interceptAllLinks=X.interceptAllLinks;if(X.progress!==void 0)q.progress=X.progress;if(X.viewTransitions!==void 0)q.viewTransitions=X.viewTransitions;if(X.viewTransitionDuration!==void 0)q.viewTransitionDuration=X.viewTransitionDuration;if(X.viewTransitionEasing!==void 0)q.viewTransitionEasing=X.viewTransitionEasing;if(X.scrollToTop!==void 0)q.scrollToTop=X.scrollToTop;if(X.prefetch!==void 0)q.prefetch=X.prefetch;if(X.cache!==void 0)q.cache=X.cache;if(X.progressColor!==void 0)q.progressColor=X.progressColor;if(X.progressHeight!==void 0)q.progressHeight=X.progressHeight}try{let U=await o9(Z?.pagesDir);if(U.length>0)q.ownedRoutes=U}catch{}if(Object.keys(q).length>0)J=`<script>window.__stxRouterConfig=${r9(q)};</script>
3543
- `}let{getCachedRouterScript:Y}=await import("./chunk-s0b1p8tc.js"),Q=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?'<script data-stx-router src="/_stx/router.js"></script>':`<script data-stx-router>${await Y()}</script>`,G=$.lastIndexOf("</body>");return $.slice(0,G)+J+Q+`
3543
+ `}let{getCachedRouterScript:Y}=await import("./chunk-d1ezh03e.js"),Q=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?'<script data-stx-router src="/_stx/router.js"></script>':`<script data-stx-router>${await Y()}</script>`,G=$.lastIndexOf("</body>");return $.slice(0,G)+J+Q+`
3544
3544
  </body>`+$.slice(G+7)}var $8=Symbol.for("stx.lazy-module-promises");function wQ(){let $=globalThis;return $[$8]??=new Map,$[$8]}function o($,Z){let X=wQ(),J=`${import.meta.url}\x00${$}`,Y=X.get(J);if(Y)return Y;let Q=Z();return X.set(J,Q),Q.catch(()=>{if(X.get(J)===Q)X.delete(J)}),Q}var J4=`(?:"[^"]*"|'[^']*'|[^>"'])*`,G8=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s;function RQ($,Z={}){let X=[];for(let J of h5($,Y1)){let Y=J.token.match(/^<script\b([^>]*)>/i),Q=J.token.match(/<\/script\s*>$/i);if(!Y||!Q)continue;let G=Y[1];if(Z.skipAttrs){if(Z.skipAttrs.lastIndex=0,Z.skipAttrs.test(G))continue}let q=Y[0].length,U=J.token.length-Q[0].length;X.push({fullMatch:J.token,attrs:G,body:J.token.slice(q,U),start:J.start,end:J.end})}return X}function q8($){let Z=$.trim(),X=Z.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(X){let Y=X[1].trim(),Q=X[2].trim(),{itemVar:G,indexVar:q}=Z8(Q);if(G)return{style:"as",iterable:Y,itemVar:G,indexVar:q}}let J=Z.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(J){let Y=J[1].trim(),Q=J[2].trim(),{itemVar:G,indexVar:q}=Z8(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:q}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function Z8($){let Z=$.trim(),X=Z.match(/^(\w+)\s*=>\s*(\w+)$/);if(X)return{itemVar:X[2],indexVar:X[1]};let J=Z.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(J)return{itemVar:J[1],indexVar:J[2]||null};let Y=Z.match(/^(\w+)\s*,\s*(\w+)$/);if(Y)return{itemVar:Y[1],indexVar:Y[2]};let Q=Z.match(/^(\w+)$/);if(Q)return{itemVar:Q[1],indexVar:null};return{itemVar:null,indexVar:null}}function Q4($){return Q8($)}function DQ($){let Z=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,X=0,J;while((J=Z.exec($))!==null){let Y=J[1];if(Y.startsWith("if"))X++;else if(Y==="endif")X--;else if(X===0)return!0}return!1}function NQ($){let Z=new Set,X=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal)\s*(?:<[^>]*>)?\s*\(/g,Y;while((Y=X.exec($))!==null){let Q=Y[1],G;while((G=J.exec(Q))!==null)Z.add(G[1])}return Z}function AQ($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${J4})>`,"iy"),X=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,J=h5($,(Q,G)=>{Z.lastIndex=G;let q=Z.exec(Q);if(!q||q.index!==G||!X.test(q[2]))return-1;return Z.lastIndex}),Y=[];for(let Q of J){Z.lastIndex=0;let G=Z.exec(Q.token);if(!G)continue;let q=G[2].match(X),U=q8(q?.[1]??q?.[2]??""),W=[U.itemVar,U.indexVar].filter(Boolean);if(W.length===0)continue;let z=G[1],H=/\/\s*>$/.test(Q.token)||w$.has(z.toLowerCase())?Q.end:W8($,Q.start,z,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(W)})}return Y}var X8=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 MQ($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function J8($,Z,X,J){if(!$)return!1;let Y=MQ($),Q=!1,G=!1,q=!1,U=/([a-zA-Z_$][\w$]*)/g,W;while((W=U.exec(Y))!==null){let B=W[1];if(Y.slice(0,W.index).trimEnd().endsWith("."))continue;if(X8.has(B))continue;if(Z.has(B)||J?.has(B))Q=!0;else if(X&&B in X)G=!0}let z=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,K;while((K=z.exec(Y))!==null){let B=K[1];if(Y.slice(0,K.index).trimEnd().endsWith("."))continue;if(X8.has(B)||X&&B in X)continue;q=!0}return(Q||q)&&!G}function L$($,Z,X){let J=X===void 0?` ${Z}`:` ${Z}="${X.replace(/"/g,"&quot;")}"`,Y=$.trim(),Q=Y.match(G8);if(Q&&TQ(Q[3],Q[1])){let[,G,q,U]=Q;return`<${G}${q}${J}>${U}</${G}>`}return`<template${J}>${Y}</template>`}function TQ($,Z){let X=new RegExp(`<(/)?${Z}(?=[\\s/>])`,"gi"),J=0,Y;while((Y=X.exec($))!==null)if(Y[1]){if(J--,J<0)return!1}else J++;return!0}function U8($,Z){let X=NQ($);function J(Y){let Q=Y,G=AQ(Y),q=(K)=>{let H=new Set;for(let B of G)if(K>B.start&&K<B.end)for(let j of B.vars)H.add(j);return H},U=/@if\s*\(/g,W,z=[];while((W=U.exec(Q))!==null){let K=W.index,H=K+W[0].length,B=1,j=H;while(j<Q.length&&B>0){if(Q[j]==="(")B++;else if(Q[j]===")")B--;j++}if(B!==0)continue;let _=Q.substring(H,j-1).trim(),F=j,V=1,O=F,L=/@(if\s*\(|endif)/g;L.lastIndex=F;let w;while((w=L.exec(Q))!==null)if(w[1].startsWith("if"))V++;else if(w[1]==="endif"){if(V--,V===0){O=w.index+w[0].length;break}}if(V!==0)continue;let R=Q.substring(F,O-6).trim(),D;if(DQ(R)){let N=F5(Q.substring(K,O));if(N.length===0)continue;let T=N[0].branches.filter((I)=>I.type!=="else"),A=q(K);if(!(T.length>0&&T.every((I)=>J8(I.condition,X,Z,A))))continue;D=N[0].branches.map((I)=>{let y=J(I.content);if(I.type==="elseif")return L$(y,"@else-if",I.condition??"");if(I.type==="else")return L$(y,"@else");return L$(y,"@if",I.condition??"")}).join(`
3545
3545
  `)}else{if(!J8(_,X,Z,q(K)))continue;D=L$(J(R),"@if",_)}z.push({start:K,end:O,replacement:D}),U.lastIndex=O}for(let K=z.length-1;K>=0;K--){let{start:H,end:B,replacement:j}=z[K];Q=Q.substring(0,H)+j+Q.substring(B)}return Q}return J($)}function IQ($){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 Y=Number(Z);return Y!==0&&!Number.isNaN(Y)}let X=Z.match(/^'((?:\\.|[^'\\])*)'$/);if(X)return X[1].length>0;let J=Z.match(/^"((?:\\.|[^"\\])*)"$/);if(J)return J[1].length>0;return}var w$=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function W8($,Z,X,J){if(w$.has(X.toLowerCase()))return J;let Y=X.toLowerCase(),Q=$.toLowerCase(),G=$.length,q=1,U=J;while(U<G){let W=$.indexOf("<",U);if(W===-1)return-1;if(U=W,$.startsWith("<!--",U)){let B=$.indexOf("-->",U+4);if(B===-1)return-1;U=B+3;continue}let z=/^<(script|style)\b/i.exec($.slice(U,U+8));if(z){let B=$.indexOf(">",U);if(B===-1)return-1;if($[B-1]==="/"){U=B+1;continue}let j=Q.indexOf(`</${z[1].toLowerCase()}`,U);if(j===-1)return-1;let _=$.indexOf(">",j);if(_===-1)return-1;U=_+1;continue}if($[U+1]==="/"){let B=/^<\/([a-z][\w-]*)\s*>/i.exec($.slice(U,U+64));if(!B){U++;continue}if(B[1].toLowerCase()===Y){if(q--,U+=B[0].length,q===0)return U;continue}U+=B[0].length;continue}let K=/^<([a-z][\w-]*)\b/i.exec($.slice(U,U+64));if(!K){U++;continue}let H=$.indexOf(">",U);if(H===-1)return-1;if(K[1].toLowerCase()===Y){let B=$.slice(U,H+1);if(!(/\/\s*>$/.test(B)||w$.has(Y)))q++}U=H+1}return-1}var kQ=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function EQ($,Z){let X=Z,J=$.length;for(;;){while(X<J&&$[X]!=="<")X++;if(X>=J)return!1;if($.startsWith("<!--",X)){let G=$.indexOf("-->",X+4);if(G===-1)return!1;X=G+3;continue}break}if($[X+1]==="/")return!1;let Y=$.indexOf(">",X);if(Y===-1)return!1;let Q=$.slice(X,Y+1);return kQ.test(Q)}function z8($){if(!$.includes(":if")&&!$.includes(":show")&&!$.includes("x-if")&&!$.includes("x-show")&&!$.includes("@if=")&&!$.includes("@show="))return $;let Z=[],X=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,J;while((J=X.exec($))!==null)Z.push([J.index,J.index+J[0].length]);let Y=(K)=>Z.some(([H,B])=>K>=H&&K<B),Q=/<([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=[],q;while((q=Q.exec($))!==null){if(Y(q.index))continue;let[K,H,B,j,_,F,V]=q,O=IQ(_);if(O===void 0)continue;let L=q.index,w=L+K.length,N=!!V||/\/\s*>$/.test(K)||w$.has(H.toLowerCase())?w:W8($,L,H,w);if(N===-1)continue;if((j===":if"||j==="x-if"||j==="@if")&&EQ($,N)){Q.lastIndex=w;continue}if(O===!0){let A=`<${H}${B}${F}${V}>`;G.push({start:L,end:w,replacement:A});continue}G.push({start:L,end:N,replacement:""}),Q.lastIndex=N}if(G.length===0)return $;G.sort((K,H)=>K.start-H.start);let U=[],W=-1;for(let K of G){if(K.start<W)continue;U.push(K),W=K.end}let z=$;for(let K=U.length-1;K>=0;K--){let{start:H,end:B,replacement:j}=U[K];z=z.substring(0,H)+j+z.substring(B)}return z}function K8($,Z){let X=$,J=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=J.exec(X))!==null){let q=Y[1],U=Y.index,W=U+Y[0].length,z=1,K=W;while(K<X.length&&z>0){if(X[K]==="(")z++;else if(X[K]===")")z--;K++}if(z!==0)continue;let H=X.substring(W,K-1).trim(),B=K,j=q8(H),_=q==="for"?"@endfor":"@endforeach",F=1,V=B,O=q==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${q}\\s*\\(|end${q})`,"g");O.lastIndex=B;let L;while((L=O.exec(X))!==null)if(L[1].startsWith(q))F++;else if(F--,F===0){V=L.index+L[0].length;break}if(F!==0)continue;let w=()=>{let T=[j.itemVar,j.indexVar].filter(Boolean);if(T.length)G.push({start:U,end:V,vars:T})};if(j.iterable){let T=j.iterable.trim();if(T.startsWith("[")||T.startsWith("{")||T.startsWith("'")||T.startsWith('"')||T.startsWith("`")||/^-?\d/.test(T)){w();continue}let A=T.split(/[.[(]/)[0].trim(),M=Z?A in Z:!1,E=G.some((I)=>U>I.start&&U<I.end&&I.vars.includes(A));if(A&&(M||E)){w();continue}}if(j.style==="as")H=j.indexVar?`(${j.itemVar}, ${j.indexVar}) in ${j.iterable}`:`${j.itemVar} in ${j.iterable}`;let R=X.substring(B,V-_.length).trim(),D=R.match(G8),N;if(D){let[,T,A,M]=D;N=`<${T}${A} @for="${H}">${M}</${T}>`}else N=`<template @for="${H}">${R}</template>`;Q.push({start:U,end:V,replacement:N})}for(let q=Q.length-1;q>=0;q--){let{start:U,end:W,replacement:z}=Q[q];X=X.substring(0,U)+z+X.substring(W)}return X}function bQ($){let Z=new Set,X=[],J=0,Y=0,Q=$.length,G=(z)=>{let K=J+1;while(K<Q){let H=$[K];if(H==="\\"){K+=2;continue}if(H===z)return K+1;K++}return Q},q=()=>{let z=J+2;while(z<Q&&$[z]!==`
3546
3546
  `)z++;return z},U=()=>{let z=J+2;while(z<Q-1){if($[z]==="*"&&$[z+1]==="/")return z+2;z++}return Q},W=(z)=>{let K=z,H=0;while(K<Q){let B=$[K];if(B==="/"&&$[K+1]==="/"){let j=K+2;while(j<Q&&$[j]!==`
3547
- `)j++;K=j;continue}if(B==="/"&&$[K+1]==="*"){let j=K+2;while(j<Q-1&&!($[j]==="*"&&$[j+1]==="/"))j++;K=j+2;continue}if(B==='"'||B==="'"||B==="`"){let j=K+1;while(j<Q){if($[j]==="\\"){j+=2;continue}if($[j]===B){j++;break}j++}K=j;continue}if(B==="("||B==="["||B==="{"){H++,K++;continue}if(B===")"||B==="]"||B==="}"){H--,K++;continue}if(B===";"&&H===0)return K+1;K++}return Q};while(J<Q){let z=$[J];if(z==="/"&&$[J+1]==="/"){let K=q();X.push($.slice(J,K)),J=K;continue}if(z==="/"&&$[J+1]==="*"){let K=U();X.push($.slice(J,K)),J=K;continue}if(z==='"'||z==="'"||z==="`"){let K=G(z);X.push($.slice(J,K)),J=K;continue}if(z==="{"){Y++,X.push(z),J++;continue}if(z==="}"){Y--,X.push(z),J++;continue}if(Y===0){let K=J>0?$[J-1]:"";if(K===""||/\s/.test(K)||K===";"||K==="}"||K==="{"){let B=$.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(B){let j=B[2],_=W(J+B[0].length);if(Z.has(j)){X.push(`/* stx: deduped const ${j} */`),J=_;continue}Z.add(j),X.push($.slice(J,_)),J=_;continue}}}X.push(z),J++}return X.join("")}async function yQ($,Z,X){let J=RQ($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Y=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|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*\(/,Q=[];for(let V of J){let O=V.body;if(M1(V.attrs))O=T1(O);if(Y.test(O))Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:O})}if(Q.length===0)return{output:$,setupCode:null};let G=`${Z??""}\x00${Q.map((V)=>V.content).join("\x00")}`,q=`__stx_setup_${Bun.hash(G).toString(36).slice(0,10)}`,{hasUserImports:U,bundleClientScript:W}=await o("stx/client-script-bundler",()=>import("./chunk-fad3d1g7.js")),z=[];for(let V=0;V<Q.length;V++){let O=Q[V].content;if(O=A5(O).code,U(O))O=await W(O,Z||"",{projectRoot:process.cwd()});O=vQ(O);let L=t0(O);z.push(`// \u2500\u2500 merged signal script #${V+1} \u2500\u2500
3547
+ `)j++;K=j;continue}if(B==="/"&&$[K+1]==="*"){let j=K+2;while(j<Q-1&&!($[j]==="*"&&$[j+1]==="/"))j++;K=j+2;continue}if(B==='"'||B==="'"||B==="`"){let j=K+1;while(j<Q){if($[j]==="\\"){j+=2;continue}if($[j]===B){j++;break}j++}K=j;continue}if(B==="("||B==="["||B==="{"){H++,K++;continue}if(B===")"||B==="]"||B==="}"){H--,K++;continue}if(B===";"&&H===0)return K+1;K++}return Q};while(J<Q){let z=$[J];if(z==="/"&&$[J+1]==="/"){let K=q();X.push($.slice(J,K)),J=K;continue}if(z==="/"&&$[J+1]==="*"){let K=U();X.push($.slice(J,K)),J=K;continue}if(z==='"'||z==="'"||z==="`"){let K=G(z);X.push($.slice(J,K)),J=K;continue}if(z==="{"){Y++,X.push(z),J++;continue}if(z==="}"){Y--,X.push(z),J++;continue}if(Y===0){let K=J>0?$[J-1]:"";if(K===""||/\s/.test(K)||K===";"||K==="}"||K==="{"){let B=$.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(B){let j=B[2],_=W(J+B[0].length);if(Z.has(j)){X.push(`/* stx: deduped const ${j} */`),J=_;continue}Z.add(j),X.push($.slice(J,_)),J=_;continue}}}X.push(z),J++}return X.join("")}async function yQ($,Z,X){let J=RQ($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Y=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|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*\(/,Q=[];for(let V of J){let O=V.body;if(M1(V.attrs))O=T1(O);if(Y.test(O))Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:O})}if(Q.length===0)return{output:$,setupCode:null};let G=`${Z??""}\x00${Q.map((V)=>V.content).join("\x00")}`,q=`__stx_setup_${Bun.hash(G).toString(36).slice(0,10)}`,{hasUserImports:U,bundleClientScript:W}=await o("stx/client-script-bundler",()=>import("./chunk-jg1xxdkj.js")),z=[];for(let V=0;V<Q.length;V++){let O=Q[V].content;if(O=A5(O).code,U(O))O=await W(O,Z||"",{projectRoot:process.cwd()});O=vQ(O);let L=t0(O);z.push(`// \u2500\u2500 merged signal script #${V+1} \u2500\u2500
3548
3548
  ${L}`)}let K=z.join(`
3549
3549
 
3550
3550
  `);K=bQ(K);let H=SQ(K),B=H.split(",").map((V)=>V.trim()).filter(Boolean),j=Y4(K,X),_=`
@@ -3622,9 +3622,9 @@ ${G.join(`
3622
3622
  `+Y.slice(Q)}async function I4($,Z,X,J,Y){if(J.ssr===!1&&!J.autoShell&&J.buildMode==="spa")return $;if(Z.__stx_signals_gate===void 0)Z.__stx_signals_gate=Q1($);let Q=!Z.__stxProcessingDepth;if(Q)c4(Z);if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((J.debug||!_5()&&!s5())&&X&&X.endsWith(".stx"))e8($,X);try{return await z7.timeAsync("template-processing",async()=>{let G=await _G($,Z,X,J,Y);if(Q)G=M4(G);if(Q&&J.autoShell&&J.buildMode!=="compile"){let q=J.app?.head||{},W=(Z.__stx_runtime_head||null)??t8(),z=(Z.__stx_head_raw||"").trim(),K,H=z.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)K=H[1].trim(),z=z.replace(H[0],"").trim();let B=Z.__sections?.title,j=W.title||K||B,_=!W.title&&(!!K||!!B),F=W.meta||[],V=new Set(F.map((N)=>o1(N)).filter(Boolean)),O={...q,...j&&{title:j},meta:[...(q.meta||[]).filter((N)=>!V.has(o1(N))),...F],link:[...q.link||[],...W.link||[]],script:[...q.script||[],...W.script||[]],headRaw:[q.headRaw,z].filter(Boolean).join(`
3623
3623
  `),...W.htmlAttrs&&{htmlAttrs:d9(q.htmlAttrs,W.htmlAttrs)},...W.bodyAttrs&&{bodyAttrs:{...q.bodyAttrs||{},...W.bodyAttrs}}},L=t3(G);if(G=p9(G,O,{..._&&{titleIsHtml:!0},...J.app?.colorMode&&{colorMode:J.app.colorMode}}),L)G=c9(G,q),G=m9(G,O.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let N=w[1],T=r8(N);G=G.replace(/<head\b[^>]*>/i,(A)=>`${A}
3624
3624
  <meta name="stx-layout" content="${i8(N)}">
3625
- <meta name="stx-layout-group" content="${i8(T)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?W5(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=d5(G,(T,A)=>`<body${A} data-stx="${R[1]}">`);let N=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(N,"$1")}}if(Q){G=l9(G);let q=J.app?.colorMode;if(q)G=f9(G,q);G=g9(G),G=jG(G)}if(Q)try{let{getStoreScript:q}=await o("stx/store-loader",()=>import("./chunk-fbhhzy5j.js")),U=J.storesDir,W=await q(U);if(W){let z=`<script data-stx-stores>${W}</script>`,K=Y5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3626
- `+z+G.slice(K.end)}}catch{}if(Q)try{let{getFrameworkComposableScript:q}=await o("stx/framework-composables",()=>import("./chunk-vcreetnm.js")),U=await q(G);if(U){let W=Y5(G,"data-stx-stores")||Y5(G,"data-stx-runtime");if(W)G=G.slice(0,W.end)+`
3627
- `+U+G.slice(W.end)}}catch{}if(Q)try{let{getComposableScript:q}=await o("stx/composable-loader",()=>import("./chunk-kf8edvxc.js")),U=J.composablesDir,W=await q(U,G);if(W){let z=`<script data-stx-composables>${W}</script>`,K=Y5(G,"data-stx-stores")||Y5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3625
+ <meta name="stx-layout-group" content="${i8(T)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?W5(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=d5(G,(T,A)=>`<body${A} data-stx="${R[1]}">`);let N=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(N,"$1")}}if(Q){G=l9(G);let q=J.app?.colorMode;if(q)G=f9(G,q);G=g9(G),G=jG(G)}if(Q)try{let{getStoreScript:q}=await o("stx/store-loader",()=>import("./chunk-7hvr3r5k.js")),U=J.storesDir,W=await q(U);if(W){let z=`<script data-stx-stores>${W}</script>`,K=Y5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3626
+ `+z+G.slice(K.end)}}catch{}if(Q)try{let{getFrameworkComposableScript:q}=await o("stx/framework-composables",()=>import("./chunk-q79583xa.js")),U=await q(G);if(U){let W=Y5(G,"data-stx-stores")||Y5(G,"data-stx-runtime");if(W)G=G.slice(0,W.end)+`
3627
+ `+U+G.slice(W.end)}}catch{}if(Q)try{let{getComposableScript:q}=await o("stx/composable-loader",()=>import("./chunk-nzkcjb7m.js")),U=J.composablesDir,W=await q(U,G);if(W){let z=`<script data-stx-composables>${W}</script>`,K=Y5(G,"data-stx-stores")||Y5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3628
3628
  `+z+G.slice(K.end)}}catch{}if(Q)G=x9(G);if(Q&&Z.__stx_inject_css!==!1)G=await a8(G,void 0,J.buildMode==="serve");if(Q)G=v9(G);return G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G})}catch(G){if(G instanceof a5)throw G;let q=G instanceof Error?G.message:String(G),U=new R1(`Template processing failed: ${q}`,X,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(m0.log(U,{filePath:X,context:Z}),W3.logDetailedError(U,{filePath:X,template:$.substring(0,500)}),J.debug)throw U;return q3.createFallbackContent("Template Processing",U)}}async function _G($,Z,X,J,Y){let Q=process.cwd(),G={...J,partialsDir:J.partialsDir&&!T0.isAbsolute(J.partialsDir)?T0.resolve(Q,J.partialsDir):J.partialsDir,componentsDir:J.componentsDir&&!T0.isAbsolute(J.componentsDir)?T0.resolve(Q,J.componentsDir):J.componentsDir,layoutsDir:J.layoutsDir&&!T0.isAbsolute(J.layoutsDir)?T0.resolve(Q,J.layoutsDir):J.layoutsDir},q=G,U=$;await FG(X,Z),OG(Z,q),U=await m1(()=>F9(U,Z,X,q),U,(L)=>{m0.log(L,{filePath:X,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${X}: ${L.message}`)}),U=U.replace(/\{\{--[\s\S]*?--\}\}/g,"");let W=i0(U,q5,(L,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);U=W.output;let z=W.tokens,K=(L)=>z.length===0?L:L.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>z[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";U=U.replace(/@@/g,H),U=U.replace(/@\{\{([\s\S]*?)\}\}/g,(L,w)=>{return`{{ ${w} }}`}),U=T9(U),U=await d8(U,X,Y);let B={};U=m3(U,B);let j={...Z.__sections||{}},_="",F=T7(M7($)),V=/@nolayout\b/.test(U)||F===!1;if(/@nolayout\b/.test(U))U=U.replace(/@nolayout\b\s*/g,"");let O=U.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)_=O[1],U=U.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(_=F,!/@section\s*\(/.test(U))U=`@section('content')
3629
3629
  ${U.trim()}
3630
3630
  @endsection`}if(!_&&!V&&q.defaultLayout){let L=a3(U),w=/@section\s*\(/.test(U);if(!L||w){let R="",D=T0.dirname(X),N=q.layoutsDir?T0.dirname(q.layoutsDir):process.cwd();for(let T=0;T<20;T++){let A=T0.join(D,"_layout.stx");if(await a(A)){R=A;break}let M=T0.dirname(D);if(M===D||M.length<N.length)break;D=M}if(R)_=R;else if(q.layoutsDir){let T=T0.isAbsolute(q.layoutsDir)?q.layoutsDir:T0.resolve(process.cwd(),q.layoutsDir),A=T0.join(T,`${q.defaultLayout}.stx`);if(await a(A))_=A}if(_&&!w)U=`@section('content')
@@ -3632,21 +3632,21 @@ ${U.trim()}
3632
3632
  @endsection`}}if(U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(L,w,R)=>{return j[w]=R,""}),U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(L,w,R)=>{if(/^(['"]).*\1$/.test(R.trim()))return L;try{let D=t(R.trim(),Z);if(D===void 0)return L;return j[w]=String(D??""),""}catch{return L}}),U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(L,w,R)=>{if(R.includes("@parent"))j[w]=R.replace("@parent",y1);else j[w]=R.trim();return""}),Z.__sections=j,U=U.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(L,w,R)=>{return j[w]||R||""}),!("slot"in Z)||Z.slot===void 0)U=U.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""});if(U=l3(U,B),_){let L=[],w=n0(U),R=i0(w.output,v1,(D,N)=>`\x00STX_ORPHAN_STYLE_${N}\x00`);if(U=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(D,N,T)=>{let A=N==="SCRIPT"?w.scripts[Number(T)]:R.tokens[Number(T)];if(A)L.push(A);return""}),L.length>0){let D=L.join(`
3633
3633
  `);j.content=j.content?`${j.content}
3634
3634
  ${D}`:D,Z.__sections=j}}if(_)try{let L;if(T0.isAbsolute(_))L=_,Y.add(_);else L=await m1(()=>$$(_,X,G,Y),null,()=>{throw new R1(`Failed to resolve layout path: ${_}`,X,void 0,void 0,`Layout referenced from ${X}`)});if(!L){let A=(I)=>{if(!I)return[];try{let y=T0.isAbsolute(I)?I:T0.resolve(process.cwd(),I);return HG.readdirSync(y).filter((k)=>k.endsWith(".stx")).map((k)=>k.replace(/\.stx$/,""))}catch{return[]}},M=[...A(G.layoutsDir),...A(G.fallbackLayoutsDir)].filter((I,y,k)=>k.indexOf(I)===y).sort(),E=`Layout not found: ${_} (referenced from ${X})`+(M.length>0?`. Available layouts: ${M.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(m0.log(Error(E),{layoutPath:_,filePath:X,available:M},"error"),console.error(`[stx] ${E}`),G.debug)throw new R1(E,X);return U}let w=await m1(()=>Bun.file(L).text(),"",()=>{throw new R1(`Failed to read layout file: ${L}`,X,void 0,void 0,"Layout content could not be loaded")}),R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${L}`);let A={},M=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(y,k,b)=>{return A[k]=b.trim(),""});for(let[y,k]of Object.entries(A))if(j[y]&&j[y].includes(y1)){let b=j[y].indexOf(y1);j[y]=j[y].slice(0,b)+k+j[y].slice(b+y1.length)}else if(!j[y])j[y]=k;let E={...Z,__sections:j},I=`@layout('${R[1]}')${M}`;return await I4(I,E,L,G,Y)}let D=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),N=m3(D,B),T={};return N=N.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(A,M,E)=>{return T[M]=E.trim(),`@slot('${M}')`}),N=N.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(A,M,E)=>{if(j[M]){let I=j[M];if(I.includes(y1)){let y=T[M]||"",k=I.indexOf(y1);I=I.slice(0,k)+y+I.slice(k+y1.length)}return I}return E||""}),N=VG(N,j),N=N.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""}),N=l3(N,B),Z.__originalFilePath=X,U=await s8(N,Z,L,G,Y),U=`<!-- stx-layout: ${_} -->
3635
- ${U}`,K(U)}catch(L){return m0.log(L instanceof Error?L:Error(String(L)),{layoutPath:_,filePath:X},"error"),`[Error processing layout: ${L instanceof Error?L.message:String(L)}]`}return K(await s8(U,Z,X,G,Y))}function VG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(X,J,Y)=>{let Q=Z[J];if(Q!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Q))return Q}return Y||""})}function OG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let X=Z.envPrefix||"STX_PUBLIC_",J={};for(let[Y,Q]of Object.entries(process.env))if(Y.startsWith(X)&&Q!==void 0)J[Y]=Q;$.$env=J}async function FG($,Z){await m1(()=>R9($,Z),void 0,(X)=>{m0.log(X,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${X.message}`)})}async function LG($,Z,X){let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y;while((Y=J.exec($))!==null){let Q=Y[1],G=Y[2];if(!/\bserver\b/.test(Q)||!G.trim())continue;try{let{extractVariables:U}=await o("stx/variable-extractor",()=>import("./chunk-47be2t3d.js"));await U(G,Z,X,{preserveExisting:!0})}catch(U){let W=U instanceof Error?U:Error(String(U));m0.log(W,{filePath:X,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${X}: ${W.message}`)}}}async function wG($,Z,X){try{let{interpolateScriptsInTemplate:J}=await o("stx/expressions",()=>import("./chunk-e03bh9ze.js"));return J($,Z,{skipServer:!0})}catch(J){let Y=J instanceof Error?J:Error(String(J));return m0.log(Y,{filePath:X,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${X}: ${Y.message}`),$}}async function s8($,Z,X,J,Y){let Q=$,G=J;if(await LG(Q,Z,X),Q=await wG(Q,Z,X),Q=await Q9(Q,Z,X),Q=await G9(Q,Z,X),Q=await m6(Q,Z,X,G),Q1(Q))Q=U8(Q,Z),Q=K8(Q,Z);Q=z8(Q);let{processStreamDirectives:q}=await o("stx/streaming",()=>import("./chunk-5a6dzmj8.js"));Q=q(Q,Z),Q=B9(Q,Z,X,G),Q=await b9(Q,Z,X,G,Y),Q=await D4(Q,Z,X,G,Y),Q=A7(Q,Z,X,G);let{processDeferDirectives:U}=await o("stx/defer",()=>import("./chunk-r2zcdk2f.js"));Q=U(Q,Z,X);let{processTeleportDirectives:W}=await o("stx/teleport",()=>import("./chunk-6qtx7w2r.js"));Q=W(Q,Z,X);let{processTransitionDirectives:z,processTransitionAttributes:K}=await o("stx/transitions",()=>import("./chunk-w3pzxz3m.js"));Q=z(Q,Z,X),Q=K(Q);let{processErrorBoundaryDirectives:H}=await o("stx/error-boundaries",()=>import("./chunk-98pkw4t1.js"));Q=H(Q,Z,X);let{processSuspenseDirectives:B}=await o("stx/suspense",()=>import("./chunk-myqyr2dp.js"));Q=B(Q,Z,X);let{processAsyncDirectives:j}=await o("stx/async-components",()=>import("./chunk-xddvx94h.js"));Q=j(Q,Z,X);let{processKeepAliveDirectives:_}=await o("stx/keep-alive",()=>import("./chunk-ajjwrrmz.js"));Q=_(Q,Z,X);let{processVirtualListDirectives:F,processVirtualGridDirectives:V,processInfiniteListDirectives:O}=await o("stx/virtual-scrolling",()=>import("./chunk-cda7v05f.js"));Q=F(Q,Z,X),Q=V(Q,Z,X),Q=O(Q,Z,X);let{processPartialHydrationDirectives:L,processStaticDirectives:w}=await o("stx/partial-hydration",()=>import("./chunk-6mk7fd7v.js"));Q=L(Q,Z,X),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await o("stx/computed",()=>import("./chunk-n07dds2d.js"));Q=R(Q,Z,X),Q=D(Q,Z,X);let{processFormValidationDirectives:N}=await o("stx/forms-validation",()=>import("./chunk-8g7xy48w.js"));Q=N(Q,Z,X);let{processHeadDirective:T,processTitleDirective:A,processMetaDirective:M,resetHead:E}=await o("stx/head",()=>import("./chunk-v0tmvq31.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)E();let I=T(Q);if(Q=I.content,I.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${I.headContent}
3635
+ ${U}`,K(U)}catch(L){return m0.log(L instanceof Error?L:Error(String(L)),{layoutPath:_,filePath:X},"error"),`[Error processing layout: ${L instanceof Error?L.message:String(L)}]`}return K(await s8(U,Z,X,G,Y))}function VG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(X,J,Y)=>{let Q=Z[J];if(Q!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Q))return Q}return Y||""})}function OG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let X=Z.envPrefix||"STX_PUBLIC_",J={};for(let[Y,Q]of Object.entries(process.env))if(Y.startsWith(X)&&Q!==void 0)J[Y]=Q;$.$env=J}async function FG($,Z){await m1(()=>R9($,Z),void 0,(X)=>{m0.log(X,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${X.message}`)})}async function LG($,Z,X){let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y;while((Y=J.exec($))!==null){let Q=Y[1],G=Y[2];if(!/\bserver\b/.test(Q)||!G.trim())continue;try{let{extractVariables:U}=await o("stx/variable-extractor",()=>import("./chunk-jej85smh.js"));await U(G,Z,X,{preserveExisting:!0})}catch(U){let W=U instanceof Error?U:Error(String(U));m0.log(W,{filePath:X,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${X}: ${W.message}`)}}}async function wG($,Z,X){try{let{interpolateScriptsInTemplate:J}=await o("stx/expressions",()=>import("./chunk-rkhqmedy.js"));return J($,Z,{skipServer:!0})}catch(J){let Y=J instanceof Error?J:Error(String(J));return m0.log(Y,{filePath:X,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${X}: ${Y.message}`),$}}async function s8($,Z,X,J,Y){let Q=$,G=J;if(await LG(Q,Z,X),Q=await wG(Q,Z,X),Q=await Q9(Q,Z,X),Q=await G9(Q,Z,X),Q=await m6(Q,Z,X,G),Q1(Q))Q=U8(Q,Z),Q=K8(Q,Z);Q=z8(Q);let{processStreamDirectives:q}=await o("stx/streaming",()=>import("./chunk-qh4bhceg.js"));Q=q(Q,Z),Q=B9(Q,Z,X,G),Q=await b9(Q,Z,X,G,Y),Q=await D4(Q,Z,X,G,Y),Q=A7(Q,Z,X,G);let{processDeferDirectives:U}=await o("stx/defer",()=>import("./chunk-t2kftwse.js"));Q=U(Q,Z,X);let{processTeleportDirectives:W}=await o("stx/teleport",()=>import("./chunk-47ffrbhv.js"));Q=W(Q,Z,X);let{processTransitionDirectives:z,processTransitionAttributes:K}=await o("stx/transitions",()=>import("./chunk-009z775h.js"));Q=z(Q,Z,X),Q=K(Q);let{processErrorBoundaryDirectives:H}=await o("stx/error-boundaries",()=>import("./chunk-4zezcn44.js"));Q=H(Q,Z,X);let{processSuspenseDirectives:B}=await o("stx/suspense",()=>import("./chunk-2rktp0wn.js"));Q=B(Q,Z,X);let{processAsyncDirectives:j}=await o("stx/async-components",()=>import("./chunk-5fw9ne30.js"));Q=j(Q,Z,X);let{processKeepAliveDirectives:_}=await o("stx/keep-alive",()=>import("./chunk-dwz2rtwg.js"));Q=_(Q,Z,X);let{processVirtualListDirectives:F,processVirtualGridDirectives:V,processInfiniteListDirectives:O}=await o("stx/virtual-scrolling",()=>import("./chunk-ay8kxhkr.js"));Q=F(Q,Z,X),Q=V(Q,Z,X),Q=O(Q,Z,X);let{processPartialHydrationDirectives:L,processStaticDirectives:w}=await o("stx/partial-hydration",()=>import("./chunk-w3pxkhqm.js"));Q=L(Q,Z,X),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await o("stx/computed",()=>import("./chunk-apnp72a6.js"));Q=R(Q,Z,X),Q=D(Q,Z,X);let{processFormValidationDirectives:N}=await o("stx/forms-validation",()=>import("./chunk-kq6nvsph.js"));Q=N(Q,Z,X);let{processHeadDirective:T,processTitleDirective:A,processMetaDirective:M,resetHead:E}=await o("stx/head",()=>import("./chunk-6vkcpz56.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)E();let I=T(Q);if(Q=I.content,I.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${I.headContent}
3636
3636
  `;if(Q=A(Q,Z),Q=M(Q,Z),Q=w9(Q),Q=D3(Q,Z),Q=d6(Q),Q=V9(Q),Q=await d3(Q,Z,X,G,Y),Q=await D4(Q,Z,X,G,Y),Z.__stxProcessingDepth===1)Q=i4(Q,Z);if(Q=Q.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Q=M4(Q),Q=$1(Q,Z,X),Q=k7(Q,Z,{filePath:X,buildMode:G.buildMode}),Q=N3(Q,Z),Q=A3(Q,Z),Q=R5(Q,Z),Q=y3(Q,Z),Q=S3(Q,Z),Q=await k6(Q,Z,X,G),Q=await v7(Q,Z,X),Q=await e6(Q,Z,X,G),Q=o8(Q,Z,X,G),Q=B6(Q,Z,X,G),Q=j6(Q,Z,X),Q=_6(Q,Z,X,G),Q=h6(Q,Z,X,G),Q=N4(Q,Z),Q=A4(Q),Q=m8(Q),!G.skipEventDirectives)Q=m4(Q,Z,X);if(Q=y7(Q,Z,X),G.debug){let i=/\bx-data\s*=/.test(Q),Z0=Q4($);if(i&&Z0)console.warn(`[stx] ${X}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3637
3637
  Both work on the same page, but they manage separate scopes.
3638
- Prefer signals (state/derived/effect) for new components.`)}Q=A9(Q,Z),Q=await O1(Q,Z,X),Q=c8(Q),Q=p8(Q),Q=V7(Q);let{processXElementDirectives:y}=await o("stx/x-element",()=>import("./chunk-bn0td54v.js"));Q=y(Q);let k=Z.__originalFilePath||X,b=I$(Z);if(Q=await H8(Q,G,k,b),Q=i6(Q,Z),Q=await L9(Q,Z,X,G),G.media?.image?.autoSiblings){let i=G.publicDir||"public",{rewriteImagesWithSiblings:Z0}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-eyfmvy7z.js"));Q=await Z0(Q,{publicDir:i})}if(G.seo?.enabled)Q=V6(Q,Z,G);let C=(i,Z0,J0=!0)=>{if(!Z0)return i;let A0=Z0.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),O0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(A0&&O0){if(J0)i=i.replace(O0[0],A0[0]);if(Z0=Z0.replace(A0[0],"").trim(),!Z0)return i}if(/<\/head>/i.test(i))return i.replace(/<\/head>/i,`${Z0}
3638
+ Prefer signals (state/derived/effect) for new components.`)}Q=A9(Q,Z),Q=await O1(Q,Z,X),Q=c8(Q),Q=p8(Q),Q=V7(Q);let{processXElementDirectives:y}=await o("stx/x-element",()=>import("./chunk-x75qeb7x.js"));Q=y(Q);let k=Z.__originalFilePath||X,b=I$(Z);if(Q=await H8(Q,G,k,b),Q=i6(Q,Z),Q=await L9(Q,Z,X,G),G.media?.image?.autoSiblings){let i=G.publicDir||"public",{rewriteImagesWithSiblings:Z0}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-jbjg92a7.js"));Q=await Z0(Q,{publicDir:i})}if(G.seo?.enabled)Q=V6(Q,Z,G);let C=(i,Z0,J0=!0)=>{if(!Z0)return i;let A0=Z0.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),O0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(A0&&O0){if(J0)i=i.replace(O0[0],A0[0]);if(Z0=Z0.replace(A0[0],"").trim(),!Z0)return i}if(/<\/head>/i.test(i))return i.replace(/<\/head>/i,`${Z0}
3639
3639
  </head>`);if(/<head\b[^>]*>/i.test(i))return i.replace(/(<head\b[^>]*>)/i,`$1
3640
3640
  ${Z0}`);if(/<html\b[^>]*>/i.test(i))return i.replace(/(<html\b[^>]*>)/i,`$1
3641
3641
  <head>
3642
3642
  ${Z0}
3643
- </head>`);return i},{renderHead:g,getHead:h}=await o("stx/head",()=>import("./chunk-v0tmvq31.js")),l=Z.__stx_runtime_head??h();if(l.title||l.meta?.length||l.link?.length){let i=g(l);if(i)Q=C(Q,i)}if(I.headContent)Q=C(Q,I.headContent,!l.title);if(G.csp?.enabled&&G.csp.addMetaTag)Q=x6(Q,G.csp,Z);if(G.analytics?.enabled)Q=F7(Q,G);if(G.heatmap?.enabled)Q=w7(Q,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:i}=await o("stx/pwa/inject",()=>import("./chunk-v8mxhfp7.js"));Q=i(Q,G)}let V0=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Q),h0=/\bSTX\.\w+/.test(Q),D0=/window\.STX\s*=/.test(Q);if(V0&&h0&&!D0){let Z0=`<script data-stx-scoped data-stx-run="once">
3643
+ </head>`);return i},{renderHead:g,getHead:h}=await o("stx/head",()=>import("./chunk-6vkcpz56.js")),l=Z.__stx_runtime_head??h();if(l.title||l.meta?.length||l.link?.length){let i=g(l);if(i)Q=C(Q,i)}if(I.headContent)Q=C(Q,I.headContent,!l.title);if(G.csp?.enabled&&G.csp.addMetaTag)Q=x6(Q,G.csp,Z);if(G.analytics?.enabled)Q=F7(Q,G);if(G.heatmap?.enabled)Q=w7(Q,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:i}=await o("stx/pwa/inject",()=>import("./chunk-kv3yrscv.js"));Q=i(Q,G)}let V0=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Q),h0=/\bSTX\.\w+/.test(Q),D0=/window\.STX\s*=/.test(Q);if(V0&&h0&&!D0){let Z0=`<script data-stx-scoped data-stx-run="once">
3644
3644
  ${B7()}
3645
3645
  </script>`;if(Q.includes("</head>")){let J0=Q.indexOf("</head>"),O0=Q.slice(0,J0).indexOf("<script");if(O0!==-1){let p0=Q.slice(0,O0),B1=Q.slice(O0);Q=p0+Z0+`
3646
3646
  `+B1}else Q=Q.replace("</head>",`${Z0}
3647
3647
  </head>`)}else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
3648
3648
  ${Z0}`);else Q=Z0+`
3649
- `+Q}{let{scanScriptTags:i}=await o("stx/signal-processing",()=>import("./chunk-8yn96bkr.js")),Z0=[];for(let J0 of i(Q)){if(!/\bserver\b/i.test(J0.attrs))continue;let A0=J0.start+J0.fullMatch.indexOf(">")+1,O0=BG(Q,A0);if(O0===-1)continue;let p0=O0+9;while(p0<Q.length&&/\s/.test(Q[p0]))p0++;Z0.push({start:J0.start,end:p0})}for(let J0=Z0.length-1;J0>=0;J0--){let{start:A0,end:O0}=Z0[J0];Q=Q.substring(0,A0)+Q.substring(O0)}}let y0=j$(Q,X);if(y0.hasScoped)Q=y0.html;let q0=Z.__stx_event_bindings||[],X0=!1,N0=[],K0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:G5}=await o("stx/signal-processing",()=>import("./chunk-8yn96bkr.js"));for(let i of G5(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))N0.push({match:i.fullMatch,attrs:i.attrs,content:i.body});for(let{match:i,attrs:Z0,content:J0}of N0){X0=!0;let A0=J0;T4(J0,X,J.strict,Z.__originalFilePath);let O0=await k$(J0,{eventBindings:q0,attrs:Z0,hasColonDirectives:K0,templateContent:$,filePath:X,projectRoot:process.cwd(),production:J.buildMode==="compile",serverData:b});Q=Q.replace(i,()=>O0)}if(X0)Z.__stx_event_bindings=[];if(!X0&&Z.__stxProcessingDepth===1){let i=Z.__stx_event_bindings||[];if(i.length>0){let Z0=P$(i);if(Z0){let J0=Q.lastIndexOf("</body>");Q=J0===-1?Q+Z0:Q.slice(0,J0)+Z0+`
3649
+ `+Q}{let{scanScriptTags:i}=await o("stx/signal-processing",()=>import("./chunk-x1r9c2hz.js")),Z0=[];for(let J0 of i(Q)){if(!/\bserver\b/i.test(J0.attrs))continue;let A0=J0.start+J0.fullMatch.indexOf(">")+1,O0=BG(Q,A0);if(O0===-1)continue;let p0=O0+9;while(p0<Q.length&&/\s/.test(Q[p0]))p0++;Z0.push({start:J0.start,end:p0})}for(let J0=Z0.length-1;J0>=0;J0--){let{start:A0,end:O0}=Z0[J0];Q=Q.substring(0,A0)+Q.substring(O0)}}let y0=j$(Q,X);if(y0.hasScoped)Q=y0.html;let q0=Z.__stx_event_bindings||[],X0=!1,N0=[],K0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:G5}=await o("stx/signal-processing",()=>import("./chunk-x1r9c2hz.js"));for(let i of G5(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))N0.push({match:i.fullMatch,attrs:i.attrs,content:i.body});for(let{match:i,attrs:Z0,content:J0}of N0){X0=!0;let A0=J0;T4(J0,X,J.strict,Z.__originalFilePath);let O0=await k$(J0,{eventBindings:q0,attrs:Z0,hasColonDirectives:K0,templateContent:$,filePath:X,projectRoot:process.cwd(),production:J.buildMode==="compile",serverData:b});Q=Q.replace(i,()=>O0)}if(X0)Z.__stx_event_bindings=[];if(!X0&&Z.__stxProcessingDepth===1){let i=Z.__stx_event_bindings||[];if(i.length>0){let Z0=P$(i);if(Z0){let J0=Q.lastIndexOf("</body>");Q=J0===-1?Q+Z0:Q.slice(0,J0)+Z0+`
3650
3650
  `+Q.slice(J0)}Z.__stx_event_bindings=[]}}if(!a9(Q)&&t9(Q))Q=await F$(Q,G);if(Q=e9(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=g6(Q,Z.cspNonce);return Q}var RG=[{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"}],DG=[{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')"}],NG=[{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 AG($){let Z=[],X=[];return MG($,Z),TG($,Z,X),IG($,X),kG($,Z),{valid:Z.length===0,errors:Z,warnings:X}}function MG($,Z){let X=($.match(/\{\{/g)||[]).length,J=($.match(/\}\}/g)||[]).length;if(X!==J)Z.push({type:"expression",message:`Unclosed expression brackets: found ${X} opening '{{' and ${J} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function TG($,Z,X){for(let J of RG){let Y=new RegExp(`${J.open}(?:\\s|\\()`,"g"),Q=new RegExp(J.close,"g"),G=($.match(Y)||[]).length,q=($.match(Q)||[]).length;if(J.altClose){let U=new RegExp(J.altClose,"g");q+=($.match(U)||[]).length}if(G>q)Z.push({type:"directive",message:`Unclosed @${J.name} directive: found ${G} opening and ${q} closing`,suggestion:`Add ${G-q} missing ${J.close} tag(s)`});else if(q>G)X.push({type:"directive",message:`Extra ${J.close} found: ${q-G} more closing than opening`,suggestion:`Check for orphaned ${J.close} tags`})}}function IG($,Z){for(let X of DG)if(X.pattern.test($))Z.push({type:"syntax",message:X.message,suggestion:X.suggestion})}function kG($,Z){for(let X of NG)if(X.pattern.test($))Z.push({type:"expression",message:`Security warning: ${X.message}`,suggestion:"Remove dangerous code from template expressions"})}function EG($,Z){let X=$.slice(0,Z).split(`
3651
3651
  `);return{line:X.length,column:X[X.length-1].length+1}}function bG($,Z,X){let J=[];switch($){case"if":case"elseif":case"unless":if(X.length===0)J.push({type:"syntax",message:`@${$} requires a condition`,suggestion:`Use @${$}(condition)`});break;case"foreach":if(X.length===0||!X[0].includes(" as "))J.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(X.length===0)J.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(X.length===0)J.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(X.length===0)J.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(X.length===0)J.push({type:"syntax",message:`@${$} requires a path`,suggestion:`Use @${$}('path/to/template')`});break}return J}function yG($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function SG($){let Z=$.matchAll(/@([a-z]+)/gi),X=new Set;for(let J of Z){let Y=J[1].toLowerCase();if(!Y.startsWith("end"))X.add(Y)}return Array.from(X)}import r0 from"path";import Q5 from"process";var q2=["module","exports","require","props","$props","defineProps","withDefaults","defineClientPayload","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"],$2=new Set(q2),CG=new Set(["props","$props","defineProps"]),PG=new Set(["stx","@stacksjs/stx"]);function vG($){let Z=[],X=0,J=$.split(`
3652
3652
  `);for(let Y of J){let Q=X,G=null,q=!1;for(let U=0;U<Y.length;U++){let W=Y[U];if(q){q=!1;continue}if(W==="\\"){q=!0;continue}if(G){if(W===G)G=null;continue}if(W==="'"||W==='"'||W==="`"){G=W;continue}if(W==="/"&&U+1<Y.length&&Y[U+1]==="/")break;if(W==="{")X++;else if(W==="}")X--}if(Q===0){let U=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(U)Z.push(U[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Y)){let W=Y.match(/(?:const|let|var)\s+(\w+)/);if(W)Z.push(W[1])}else{let W=Y.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(W){let K=W[1].slice(1,-1).split(",").map((H)=>{let B=H.split(":");return(B.length>1?B[1]:B[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...K)}}}}return[...new Set(Z)]}function fG($){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 X(J){if(!J.includes(":"))return J;let Y=[],Q="",G=0,q=0,U=null;for(let W=0;W<J.length;W++){let z=J[W];if(U){if(Q+=z,z===U)U=null;continue}if(z==='"'||z==="'"||z==="`"){U=z,Q+=z;continue}if(z==="<")G++;else if(z===">"&&G>0)G--;else if(z==="(")q++;else if(z===")")q--;if(z===","&&G===0&&q===0){Y.push(Q),Q="";continue}Q+=z}if(Q)Y.push(Q);return Y.map((W)=>{let z=W.trim(),K=z.startsWith("..."),H=K?z.slice(3):z,B=-1,j=0;for(let R=0;R<H.length;R++)if(H[R]==="<")j++;else if(H[R]===">")j--;else if(H[R]===":"&&j===0){B=R;break}if(B===-1)return W;let F=H.substring(0,B).trim().replace(/\?$/,""),V=H.substring(B+1),O=-1,L=0;for(let R=0;R<V.length;R++)if(V[R]==="<")L++;else if(V[R]===">")L--;else if(V[R]==="="&&L===0){O=R;break}let w=K?"...":"";if(O!==-1)return`${w}${F} = ${V.substring(O+1).trim()}`;return`${w}${F}`}).join(", ")}Z=Z.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(J,Y,Q)=>{if(!Q.includes(":"))return J;return`${Y}(${X(Q)})`});{let J=/\b(function\s+\w*\s*)\(/g,Y,Q=[];while((Y=J.exec(Z))!==null){let G=Y.index+Y[0].length-1,q=1,U=G+1,W=0,z=null;while(U<Z.length&&q>0){let B=Z[U];if(z){if(B===z)z=null;U++;continue}if(B==='"'||B==="'"||B==="`"){z=B,U++;continue}if(B==="<")W++;else if(B===">"&&W>0)W--;else if(W===0){if(B==="(")q++;else if(B===")")q--}if(q>0)U++}if(q!==0)continue;let K=Z.substring(G+1,U);if(!K.includes(":"))continue;let H=X(K);Q.push({start:G+1,end:U,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:q,end:U,replacement:W}=Q[G];Z=Z.substring(0,q)+W+Z.substring(U)}}return Z=Z.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(J,Y)=>{if(!Y.includes(":"))return J;if(Y.includes("{")||Y.includes("}"))return J;return`(${Y.split(",").map((G)=>{let[q,...U]=G.split("="),W=q.split(":")[0].trim();if(U.length>0)return`${W} = ${U.join("=").trim()}`;return W}).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,`
@@ -3668,11 +3668,11 @@ ${$[W]}`,W++;else break}return U=U.trim().replace(/;$/,""),{type:Q,name:G,value:
3668
3668
  ${Q}`,Y++}while(Y<$.length){let Q=$[Y].trim();if(Q.startsWith(".")||Q.startsWith("?."))J+=`
3669
3669
  ${$[Y]}`,Y++;else break}return{value:J,nextIndex:Y}}function iG($,Z,X){let J=X,Y=Z+1;while(Y<$.length){let Q=H2(J);if(Q!==-1){if(B0(J,"{","}",Q)!==-1)break}let G=$[Y];J+=`
3670
3670
  ${G}`,Y++}return{functionCode:J,nextIndex:Y}}function Q2($,Z){let X=t($,Z)??t(`(${$})`,Z);if(X!==void 0)return X;if(!/\bprocess\b/.test($))return;let J={...Z,process:Object.freeze({env:{...Q5.env}})};try{return Function(...Object.keys(J),`'use strict'; return (${$});`)(...Object.values(J))}catch{try{return Function(...Object.keys(J),`'use strict'; return ${$};`)(...Object.values(J))}catch{return}}}async function nG($,Z,X){let J=$.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Q of J){let[,,G,q]=Q;try{let U=q.trim().replace(/;$/,""),W=Q2(U,Z);if(W!==void 0)Z[G]=W}catch(U){console.warn(`Failed to parse export ${G} in fallback:`,U)}}let Y=$.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Q of Y){let[,,G,q]=Q;if(!(G in Z))try{let U=q.trim().replace(/;$/,""),W=Q2(U,Z);if(W!==void 0)Z[G]=W}catch{}}}function sG($){let Z=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),X=Z?Z[1]:"",J=Z?$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):$;return{scriptContent:X,templateWithoutScript:J}}function oG($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var E5=new F1(500),b$=new F1(1000),b4=new F1(2000);function aG($){let Z=new WeakSet;try{let X=(J)=>{if(J===void 0)return{__stxType:"undefined"};if(typeof J==="bigint")return{__stxType:"bigint",value:J.toString()};if(typeof J==="function"||typeof J==="symbol")throw TypeError("Non-serializable component input");if(J===null||typeof J!=="object")return J;if(Z.has(J))throw TypeError("Circular component input");if(Z.add(J),J instanceof Date)return{__stxType:"date",value:J.toISOString()};if(Array.isArray(J))return J.map(X);let Y={};for(let Q of Object.keys(J).sort())Y[Q]=X(J[Q]);return Y};return JSON.stringify(X($))}catch{return null}}function B2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function tG($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function M1($){return!tG($)}var E$=new Map;function E4($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let X=E$.get(Z);if(X)return X;if(E$.size>=16)E$.clear();let J=new Bun.Transpiler($);return E$.set(Z,J),J}function T1($){try{let Z=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");Z=Z.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let X=[];Z=Z.replace(/\{!![\s\S]*?!!\}/g,(Q)=>{let G=X.length;return X.push(Q),`"__STX_EXPR_${G}__"`}),Z=Z.replace(/\{\{\{[\s\S]*?\}\}\}/g,(Q)=>{let G=X.length;return X.push(Q),`"__STX_EXPR_${G}__"`}),Z=Z.replace(/\{\{[\s\S]*?\}\}/g,(Q)=>{let G=X.length;return X.push(Q),`"__STX_EXPR_${G}__"`});let Y=E4({loader:"ts",target:"browser",define:X5()}).transformSync(Z);for(let Q=0;Q<X.length;Q++)Y=Y.replace(`"__STX_EXPR_${Q}__"`,X[Q]),Y=Y.replace(`'__STX_EXPR_${Q}__'`,X[Q]);return Y}catch(Z){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",Z);return $}}function eG($){let Z=[],X=new Set,J=0,Y=0,Q=$.length,G=(z)=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]===z){Y++;return}Y++}},q=()=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]==="`"){Y++;return}if($[Y]==="$"&&$[Y+1]==="{"){Y+=2;let z=1;while(Y<Q&&z>0)if($[Y]==="{")z++,Y++;else if($[Y]==="}")z--,Y++;else if($[Y]==="'"||$[Y]==='"')G($[Y]);else if($[Y]==="`")q();else Y++;continue}Y++}},U=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
3671
- `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},W=()=>{if(J!==0)return;let z=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(z){let j=z[2].split(",").map((_)=>{let F=_.trim().split(":");return F[F.length-1].trim()});for(let _ of j)if(_&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(_)&&!X.has(_))Z.push(_),X.add(_);return}let K=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(K){let j=K[2];if(!X.has(j))Z.push(j),X.add(j);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let j=H[1];if(!X.has(j))Z.push(j),X.add(j);return}let B=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let j=B[1];if(!X.has(j))Z.push(j),X.add(j)}};while(Y<Q){if(U())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){q();continue}if($[Y]==="{"){J++,Y++;continue}if($[Y]==="}"){J--,Y++;continue}if(J===0&&/[a-z]/i.test($[Y])&&(Y===0||/\s|[;{}()]/.test($[Y-1])))W();Y++}return Z}function $q($){let Z=[],X=0,J=0,Y=null;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(Y){if(G==="\\"){Q++;continue}if(G===Y)Y=null;continue}if(G==='"'||G==="'"||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{")X++;else if(G===")"||G==="]"||G==="}")X--;else if(G===","&&X===0)Z.push($.slice(J,Q)),J=Q+1}if(J<$.length)Z.push($.slice(J));return Z}function Zq($){let Z=0,X=null;for(let J=0;J<$.length;J++){let Y=$[J];if(X){if(Y==="\\"){J++;continue}if(Y===X)X=null;continue}if(Y==='"'||Y==="'"||Y==="`"){X=Y;continue}if(Y==="("||Y==="["||Y==="{")Z++;else if(Y===")"||Y==="]"||Y==="}")Z--;else if(Y==="="&&Z===0){let Q=$[J-1],G=$[J+1];if(Q==="!"||Q==="<"||Q===">"||Q==="=")continue;if(G==="="||G===">")continue;return J}}return-1}function Xq($,Z){try{let X=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!X)return;let J=X.index-1;while(J>=0&&/\s/.test($[J]))J--;if($[J]!=="}")return;let Y=J,Q=0,G=-1;for(;J>=0;J--){let U=$[J];if(U==="}")Q++;else if(U==="{"){if(Q--,Q===0){G=J;break}}}if(G===-1)return;let q=$.slice(G+1,Y);for(let U of $q(q)){let W=U.trim();if(!W||W.startsWith("..."))continue;let z=Zq(W);if(z===-1)continue;let K=W.slice(0,z).trim();if(!/^[A-Z_$][\w$]*$/i.test(K))continue;if(Z[K]!==void 0)continue;let H=W.slice(z+1).trim();if(!H)continue;try{let B=Object.keys(Z),j=Function(...B,`"use strict"; return (${H});`);Z[K]=j(...B.map((_)=>Z[_]))}catch{}}}catch{}}async function M$($,Z,X,J,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(F)=>F.split("-").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(""),q=(F)=>F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),U=X.__importedComponents;if(U){for(let F of[Q,Q.toLowerCase(),G(Q),q(Q)])if(U.has(F))return!0}let W=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${q(Q)}.stx`])],z=typeof Y.root==="string"?x.resolve(Y.root):void 0,K=z??x.dirname(J),H=[],B=(F)=>{if(F&&!H.includes(F))H.push(F)},j=X.__originalFilePath;if(j)B(x.join(x.dirname(j),"components"));if(B(Z),B(Y._rootComponentsDir),B(x.join(x.dirname(J),"components")),B(Y.componentsDir),z)B(x.resolve(z,"resources/views/components")),B(x.resolve(z,"resources/components")),B(x.resolve(z,"src/components")),B(x.resolve(z,"components"));let _=Y._pluginComponentDirs;if(Array.isArray(_))for(let F of _)B(typeof F==="string"?F:null);if(B(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return a(x.resolve(x.dirname(J),`${Q}.stx`));for(let F of H){let V=x.isAbsolute(F)?F:x.resolve(K,F);for(let O of W)if(await a(x.join(V,O)))return!0}return!1}function Jq($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function Yq($){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 Qq($){let Z=new Set,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let J of $){let Y;while((Y=X.exec(J))!==null)Z.add(Y[1]);X.lastIndex=0}return[...Z]}async function k1($,Z,X,J,Y,Q,G,q=new Set,U){let{extractVariables:W}=await o("stx/variable-extractor",()=>import("./chunk-47be2t3d.js")),z=q??new Set;if(z.has($))return`[Circular component reference: ${$}]`;let K=new Set(z);K.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let B=H&&H!=="load"&&Jq(H)?H:"";try{let j=(P)=>P.split("-").map((u)=>u.charAt(0).toUpperCase()+u.slice(1)).join(""),_=(P)=>P.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,V=null,O=Y.__importedComponents;if(O){let P=[F,F.toLowerCase(),j(F),_(F)];for(let u of P)if(O.has(u)){V=O.get(u);break}}let L=[];if(!V){let P=[`${F}.stx`,`${j(F)}.stx`,`${_(F)}.stx`],u=[...new Set(P)],Y0=Y.__originalFilePath,r=[];if(Y0){let U0=x.join(x.dirname(Y0),"components");r.push(U0)}if(J)r.push(J);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!r.includes(F0))r.push(F0);let L0=x.join(x.dirname(Q),"components");if(!r.includes(L0))r.push(L0);if(G.componentsDir&&G.componentsDir!==J&&!r.includes(G.componentsDir))r.push(G.componentsDir);let v0=typeof G.root==="string"?x.resolve(G.root):void 0,a0=v0??x.dirname(Q),H0=[];if(v0)H0.push(x.resolve(v0,"resources/views/components")),H0.push(x.resolve(v0,"resources/components")),H0.push(x.resolve(v0,"src/components")),H0.push(x.resolve(v0,"components"));H0.push(x.resolve(import.meta.dir,"components"));for(let U0 of H0)if(!r.includes(U0))r.push(U0);let C1=G._pluginComponentDirs;if(Array.isArray(C1)){for(let U0 of C1)if(typeof U0==="string"&&!r.includes(U0))r.push(U0)}if(G.fallbackComponentsDir&&!r.includes(G.fallbackComponentsDir))r.push(G.fallbackComponentsDir);let j1=[...new Set(r.map((U0)=>{if(!U0)return U0;return x.isAbsolute(U0)?U0:x.resolve(a0,U0)}))];r.length=0,r.push(...j1);let s=`${F}\x00${Q}\x00${j1.join("\x00")}`,u0=b$.get(s);if(u0)if(await a(u0))V=u0;else b$.delete(s);if(!V&&(F.startsWith("./")||F.startsWith("../")))V=x.resolve(x.dirname(Q),`${F}.stx`),L.push(V);else if(!V)for(let U0 of r){if(!U0)continue;for(let _1 of u){let V1=x.join(U0,_1);if(L.push(V1),await a(V1)){V=V1;break}}if(V)break;if(!V)try{let _1=await import("fs");if(!_1.statSync(U0,{throwIfNoEntry:!1})?.isDirectory())continue;let y5=8,P1=[{path:U0,depth:0}];while(P1.length>0&&!V){let J1=P1.pop();if(J1.depth>=y5)continue;let P4;try{P4=_1.readdirSync(J1.path,{withFileTypes:!0})}catch{continue}for(let S5 of P4){if(!S5.isDirectory())continue;if(S5.name==="node_modules"||S5.name.startsWith("."))continue;let v4=x.join(J1.path,S5.name);for(let A2 of u){let S$=x.join(v4,A2);if(L.push(S$),await a(S$)){V=S$;break}}if(V)break;P1.push({path:v4,depth:J1.depth+1})}}}catch{}if(V)break}if(V)b$.set(s,V)}if(!V||!await a(V)){let P=L.length>0?`
3671
+ `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},W=()=>{if(J!==0)return;let z=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(z){let j=z[2].split(",").map((_)=>{let F=_.trim().split(":");return F[F.length-1].trim()});for(let _ of j)if(_&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(_)&&!X.has(_))Z.push(_),X.add(_);return}let K=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(K){let j=K[2];if(!X.has(j))Z.push(j),X.add(j);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let j=H[1];if(!X.has(j))Z.push(j),X.add(j);return}let B=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let j=B[1];if(!X.has(j))Z.push(j),X.add(j)}};while(Y<Q){if(U())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){q();continue}if($[Y]==="{"){J++,Y++;continue}if($[Y]==="}"){J--,Y++;continue}if(J===0&&/[a-z]/i.test($[Y])&&(Y===0||/\s|[;{}()]/.test($[Y-1])))W();Y++}return Z}function $q($){let Z=[],X=0,J=0,Y=null;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(Y){if(G==="\\"){Q++;continue}if(G===Y)Y=null;continue}if(G==='"'||G==="'"||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{")X++;else if(G===")"||G==="]"||G==="}")X--;else if(G===","&&X===0)Z.push($.slice(J,Q)),J=Q+1}if(J<$.length)Z.push($.slice(J));return Z}function Zq($){let Z=0,X=null;for(let J=0;J<$.length;J++){let Y=$[J];if(X){if(Y==="\\"){J++;continue}if(Y===X)X=null;continue}if(Y==='"'||Y==="'"||Y==="`"){X=Y;continue}if(Y==="("||Y==="["||Y==="{")Z++;else if(Y===")"||Y==="]"||Y==="}")Z--;else if(Y==="="&&Z===0){let Q=$[J-1],G=$[J+1];if(Q==="!"||Q==="<"||Q===">"||Q==="=")continue;if(G==="="||G===">")continue;return J}}return-1}function Xq($,Z){try{let X=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!X)return;let J=X.index-1;while(J>=0&&/\s/.test($[J]))J--;if($[J]!=="}")return;let Y=J,Q=0,G=-1;for(;J>=0;J--){let U=$[J];if(U==="}")Q++;else if(U==="{"){if(Q--,Q===0){G=J;break}}}if(G===-1)return;let q=$.slice(G+1,Y);for(let U of $q(q)){let W=U.trim();if(!W||W.startsWith("..."))continue;let z=Zq(W);if(z===-1)continue;let K=W.slice(0,z).trim();if(!/^[A-Z_$][\w$]*$/i.test(K))continue;if(Z[K]!==void 0)continue;let H=W.slice(z+1).trim();if(!H)continue;try{let B=Object.keys(Z),j=Function(...B,`"use strict"; return (${H});`);Z[K]=j(...B.map((_)=>Z[_]))}catch{}}}catch{}}async function M$($,Z,X,J,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(F)=>F.split("-").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(""),q=(F)=>F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),U=X.__importedComponents;if(U){for(let F of[Q,Q.toLowerCase(),G(Q),q(Q)])if(U.has(F))return!0}let W=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${q(Q)}.stx`])],z=typeof Y.root==="string"?x.resolve(Y.root):void 0,K=z??x.dirname(J),H=[],B=(F)=>{if(F&&!H.includes(F))H.push(F)},j=X.__originalFilePath;if(j)B(x.join(x.dirname(j),"components"));if(B(Z),B(Y._rootComponentsDir),B(x.join(x.dirname(J),"components")),B(Y.componentsDir),z)B(x.resolve(z,"resources/views/components")),B(x.resolve(z,"resources/components")),B(x.resolve(z,"src/components")),B(x.resolve(z,"components"));let _=Y._pluginComponentDirs;if(Array.isArray(_))for(let F of _)B(typeof F==="string"?F:null);if(B(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return a(x.resolve(x.dirname(J),`${Q}.stx`));for(let F of H){let V=x.isAbsolute(F)?F:x.resolve(K,F);for(let O of W)if(await a(x.join(V,O)))return!0}return!1}function Jq($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function Yq($){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 Qq($){let Z=new Set,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let J of $){let Y;while((Y=X.exec(J))!==null)Z.add(Y[1]);X.lastIndex=0}return[...Z]}async function k1($,Z,X,J,Y,Q,G,q=new Set,U){let{extractVariables:W}=await o("stx/variable-extractor",()=>import("./chunk-jej85smh.js")),z=q??new Set;if(z.has($))return`[Circular component reference: ${$}]`;let K=new Set(z);K.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let B=H&&H!=="load"&&Jq(H)?H:"";try{let j=(P)=>P.split("-").map((u)=>u.charAt(0).toUpperCase()+u.slice(1)).join(""),_=(P)=>P.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,V=null,O=Y.__importedComponents;if(O){let P=[F,F.toLowerCase(),j(F),_(F)];for(let u of P)if(O.has(u)){V=O.get(u);break}}let L=[];if(!V){let P=[`${F}.stx`,`${j(F)}.stx`,`${_(F)}.stx`],u=[...new Set(P)],Y0=Y.__originalFilePath,r=[];if(Y0){let U0=x.join(x.dirname(Y0),"components");r.push(U0)}if(J)r.push(J);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!r.includes(F0))r.push(F0);let L0=x.join(x.dirname(Q),"components");if(!r.includes(L0))r.push(L0);if(G.componentsDir&&G.componentsDir!==J&&!r.includes(G.componentsDir))r.push(G.componentsDir);let v0=typeof G.root==="string"?x.resolve(G.root):void 0,a0=v0??x.dirname(Q),H0=[];if(v0)H0.push(x.resolve(v0,"resources/views/components")),H0.push(x.resolve(v0,"resources/components")),H0.push(x.resolve(v0,"src/components")),H0.push(x.resolve(v0,"components"));H0.push(x.resolve(import.meta.dir,"components"));for(let U0 of H0)if(!r.includes(U0))r.push(U0);let C1=G._pluginComponentDirs;if(Array.isArray(C1)){for(let U0 of C1)if(typeof U0==="string"&&!r.includes(U0))r.push(U0)}if(G.fallbackComponentsDir&&!r.includes(G.fallbackComponentsDir))r.push(G.fallbackComponentsDir);let j1=[...new Set(r.map((U0)=>{if(!U0)return U0;return x.isAbsolute(U0)?U0:x.resolve(a0,U0)}))];r.length=0,r.push(...j1);let s=`${F}\x00${Q}\x00${j1.join("\x00")}`,u0=b$.get(s);if(u0)if(await a(u0))V=u0;else b$.delete(s);if(!V&&(F.startsWith("./")||F.startsWith("../")))V=x.resolve(x.dirname(Q),`${F}.stx`),L.push(V);else if(!V)for(let U0 of r){if(!U0)continue;for(let _1 of u){let V1=x.join(U0,_1);if(L.push(V1),await a(V1)){V=V1;break}}if(V)break;if(!V)try{let _1=await import("fs");if(!_1.statSync(U0,{throwIfNoEntry:!1})?.isDirectory())continue;let y5=8,P1=[{path:U0,depth:0}];while(P1.length>0&&!V){let J1=P1.pop();if(J1.depth>=y5)continue;let P4;try{P4=_1.readdirSync(J1.path,{withFileTypes:!0})}catch{continue}for(let S5 of P4){if(!S5.isDirectory())continue;if(S5.name==="node_modules"||S5.name.startsWith("."))continue;let v4=x.join(J1.path,S5.name);for(let A2 of u){let S$=x.join(v4,A2);if(L.push(S$),await a(S$)){V=S$;break}}if(V)break;P1.push({path:v4,depth:J1.depth+1})}}}catch{}if(V)break}if(V)b$.set(s,V)}if(!V||!await a(V)){let P=L.length>0?`
3672
3672
  Searched paths:
3673
3673
  ${L.map((u)=>` - ${u}`).join(`
3674
- `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${P}`}U.add(V);let w;if(E5.has(V))w=E5.get(V);else try{w=await Bun.file(V).text(),E5.set(V,w)}catch(P){return`[Error loading component: ${P instanceof Error?P.message:String(P)}]`}let R=new Set(["__originalFilePath","__importedComponents",C5,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[P,u]of Object.entries(Y))if(!P.startsWith("__")||R.has(P))D[P]=u;let N=X;if(X.includes("@include")){let{processIncludes:P}=await o("stx/includes",()=>import("./chunk-qaj72jrj.js"));N=await P(X,Y,Q,G,U)}let T=n0(N),A=[],M=T.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(P,u)=>{let Y0=T.scripts[Number(u)]||"",r=Y0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=r.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),L0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(r)&&L0)return A.push(Y0),"";return Y0}),{extractSlotContent:E}=await o("stx/slots",()=>import("./chunk-15w5gfwe.js")),I=E(M),y={};if(I.defaultSlot?.trim())y.default=I.defaultSlot;for(let[P,u]of I.namedSlots)y[P]=u.content;let k={...D,...Z,props:Z,slot:M,$slots:y,__processedComponents:K,__sections:{},__stx_signals_gate:Q1(w)||Yq(X)};Xq(w,k);let b=w,C=W$(b);if(C)b=C.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,h=[...w.matchAll(g)],m=[],l=h.some((P)=>/\bserver\b/.test(P[1]||"")&&/\bcache\b/.test(P[1]||""))&&h.every((P)=>/\bserver\b/.test(P[1]||"")),V0=null,h0=null;if(l){let P=aG({props:Z,slot:X,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0});if(P!==null){V0=`${V}\x00${P}`;let u=b4.get(V0);if(u){for(let Y0 of u.dependencies)U.add(Y0);return u.output}h0=new Set(U)}}for(let P of h){let u=P[1]||"",Y0=P[2]||"",r=u.includes("server");if(M1(u)&&Y0.trim())Y0=T1(Y0);if(r&&Y0)try{await W(Y0,k,V)}catch(L0){}if(!r){let L0=Y0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),v0=L0.includes("{{")&&L0.includes("}}"),a0=L0.includes("{!!")&&L0.includes("!!}");if(v0||a0)L0=x$(L0,k);let H0=u.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");m.push(`<script${H0}>${L0}</script>`)}}let D0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),y0=D0?D0[1]:"",q0=D0?D0[2]:"",X0="",N0=y0&&/\bscoped\b/i.test(y0);if(D0)X0=`<style${y0}>${q0}</style>`;let K0=b;if(K0=K0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D0)K0=K0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let P=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,u=[];if(K0=K0.replace(P,(Y0,r)=>{let F0=r.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)u.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),K0=K0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),u.length>0)X0=`${X0}${u.join(`
3675
- `)}`}if(X&&K0.includes("{{ text || slot }}"))K0=K0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>X);let{applySlots:G5}=await o("stx/slots",()=>import("./chunk-15w5gfwe.js")),{defaultSlot:i,namedSlots:Z0}=I;K0=await G5(K0,i,Z0,k);let J0=m.some((P)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(P)),A0=Qq(m),O0=Array.isArray(k.__stx_client_signal_names)?k.__stx_client_signal_names:[];if(A0.length>0||O0.length>0)k.__stx_client_signal_names=[...new Set([...O0,...A0])];let p0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:x.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:J0||m.length===0,defaultLayout:void 0};k.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let B1=await I4(K0,k,V,p0,U),S=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let P of B1.matchAll(/\{\{([\s\S]*?)\}\}/g))S.add(P[1].trim());if(S.size>0)Y.__stx_preserved_client_expressions=[...S];let v=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},n=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++v.n}_${v.key}`,d=B1;if(J0){let P="";if(Object.keys(Z).length>0)try{P=` data-stx-props="${B2(JSON.stringify(Z))}"`}catch{}let u=B?` stx-hydrate="${B2(B)}"`:"";d=`<div data-stx-scope="${n}"${P}${u}>${B1}</div>`;let Y0=await Promise.all(m.map(async(r)=>{let F0=r.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!F0)return r;let[,L0,v0]=F0,a0=S4(v0,{filePath:V,projectRoot:process.cwd()}),H0=a0.code,C1=C4(a0.styles);H0=A5(H0).code;let{hasUserImports:j1,bundleClientScript:s}=await o("stx/client-script-bundler",()=>import("./chunk-fad3d1g7.js"));if(j1(H0))H0=await s(H0,V,{projectRoot:process.cwd(),minify:G.buildMode==="compile"});let{stripStxRuntimeImports:u0}=await o("stx/signal-processing",()=>import("./chunk-8yn96bkr.js"));H0=u0(H0);let U0=t0(H0),_1=eG(U0),V1=`function(__scopeId) {
3674
+ `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${P}`}U.add(V);let w;if(E5.has(V))w=E5.get(V);else try{w=await Bun.file(V).text(),E5.set(V,w)}catch(P){return`[Error loading component: ${P instanceof Error?P.message:String(P)}]`}let R=new Set(["__originalFilePath","__importedComponents",C5,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[P,u]of Object.entries(Y))if(!P.startsWith("__")||R.has(P))D[P]=u;let N=X;if(X.includes("@include")){let{processIncludes:P}=await o("stx/includes",()=>import("./chunk-b24yrmwm.js"));N=await P(X,Y,Q,G,U)}let T=n0(N),A=[],M=T.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(P,u)=>{let Y0=T.scripts[Number(u)]||"",r=Y0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=r.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),L0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(r)&&L0)return A.push(Y0),"";return Y0}),{extractSlotContent:E}=await o("stx/slots",()=>import("./chunk-brbyqv80.js")),I=E(M),y={};if(I.defaultSlot?.trim())y.default=I.defaultSlot;for(let[P,u]of I.namedSlots)y[P]=u.content;let k={...D,...Z,props:Z,slot:M,$slots:y,__processedComponents:K,__sections:{},__stx_signals_gate:Q1(w)||Yq(X)};Xq(w,k);let b=w,C=W$(b);if(C)b=C.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,h=[...w.matchAll(g)],m=[],l=h.some((P)=>/\bserver\b/.test(P[1]||"")&&/\bcache\b/.test(P[1]||""))&&h.every((P)=>/\bserver\b/.test(P[1]||"")),V0=null,h0=null;if(l){let P=aG({props:Z,slot:X,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0});if(P!==null){V0=`${V}\x00${P}`;let u=b4.get(V0);if(u){for(let Y0 of u.dependencies)U.add(Y0);return u.output}h0=new Set(U)}}for(let P of h){let u=P[1]||"",Y0=P[2]||"",r=u.includes("server");if(M1(u)&&Y0.trim())Y0=T1(Y0);if(r&&Y0)try{await W(Y0,k,V)}catch(L0){}if(!r){let L0=Y0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),v0=L0.includes("{{")&&L0.includes("}}"),a0=L0.includes("{!!")&&L0.includes("!!}");if(v0||a0)L0=x$(L0,k);let H0=u.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");m.push(`<script${H0}>${L0}</script>`)}}let D0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),y0=D0?D0[1]:"",q0=D0?D0[2]:"",X0="",N0=y0&&/\bscoped\b/i.test(y0);if(D0)X0=`<style${y0}>${q0}</style>`;let K0=b;if(K0=K0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D0)K0=K0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let P=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,u=[];if(K0=K0.replace(P,(Y0,r)=>{let F0=r.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)u.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),K0=K0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),u.length>0)X0=`${X0}${u.join(`
3675
+ `)}`}if(X&&K0.includes("{{ text || slot }}"))K0=K0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>X);let{applySlots:G5}=await o("stx/slots",()=>import("./chunk-brbyqv80.js")),{defaultSlot:i,namedSlots:Z0}=I;K0=await G5(K0,i,Z0,k);let J0=m.some((P)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(P)),A0=Qq(m),O0=Array.isArray(k.__stx_client_signal_names)?k.__stx_client_signal_names:[];if(A0.length>0||O0.length>0)k.__stx_client_signal_names=[...new Set([...O0,...A0])];let p0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:x.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:J0||m.length===0,defaultLayout:void 0};k.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let B1=await I4(K0,k,V,p0,U),S=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let P of B1.matchAll(/\{\{([\s\S]*?)\}\}/g))S.add(P[1].trim());if(S.size>0)Y.__stx_preserved_client_expressions=[...S];let v=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},n=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++v.n}_${v.key}`,d=B1;if(J0){let P="";if(Object.keys(Z).length>0)try{P=` data-stx-props="${B2(JSON.stringify(Z))}"`}catch{}let u=B?` stx-hydrate="${B2(B)}"`:"";d=`<div data-stx-scope="${n}"${P}${u}>${B1}</div>`;let Y0=await Promise.all(m.map(async(r)=>{let F0=r.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!F0)return r;let[,L0,v0]=F0,a0=S4(v0,{filePath:V,projectRoot:process.cwd()}),H0=a0.code,C1=C4(a0.styles);H0=A5(H0).code;let{hasUserImports:j1,bundleClientScript:s}=await o("stx/client-script-bundler",()=>import("./chunk-jg1xxdkj.js"));if(j1(H0))H0=await s(H0,V,{projectRoot:process.cwd(),minify:G.buildMode==="compile"});let{stripStxRuntimeImports:u0}=await o("stx/signal-processing",()=>import("./chunk-x1r9c2hz.js"));H0=u0(H0);let U0=t0(H0),_1=eG(U0),V1=`function(__scopeId) {
3676
3676
  ${i1("const",[...j2,..._1],U0)}
3677
3677
  const __scope = window.stx._scopes = window.stx._scopes || {};
3678
3678
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -3794,7 +3794,7 @@ else {
3794
3794
  // STX: auto-generated event bindings
3795
3795
  ${$.map((X,J)=>Aq(X,J)).join(`
3796
3796
  `)}`}function F2($){let Z=[],X=new Set,J=$.replace(/^\s*import\s+.*$/gm,""),Y=0,Q=J.length,G=0;while(G<Q){let q=J[G];if(q==="'"||q==='"'||q==="`"){let U=q;if(G++,U==="`"){let W=0;while(G<Q){if(J[G]==="\\"){G+=2;continue}if(J[G]==="`"&&W===0){G++;break}if(J[G]==="$"&&J[G+1]==="{"){W++,G+=2;continue}if(J[G]==="}"&&W>0){W--,G++;continue}G++}}else while(G<Q){if(J[G]==="\\"){G+=2;continue}if(J[G]===U){G++;break}G++}continue}if(q==="/"&&J[G+1]==="/"){while(G<Q&&J[G]!==`
3797
- `)G++;continue}if(q==="/"&&J[G+1]==="*"){G+=2;while(G<Q-1&&!(J[G]==="*"&&J[G+1]==="/"))G++;G+=2;continue}if(q==="{"){Y++,G++;continue}if(q==="}"){Y--,G++;continue}if(Y===0){let U=J.slice(G),W=U.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(W){let H=W[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=W[0].length;continue}let z=U.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(z){z[1].split(",").forEach((H)=>{let B=H.trim(),j=B.indexOf(":"),_=j>=0?B.slice(j+1).trim().split(/[\s=]/)[0]:B.split(/[\s=]/)[0];if(_&&!_.startsWith("_")&&!X.has(_))Z.push(_),X.add(_)}),G+=z[0].length;continue}let K=U.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(K){let H=K[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=K[0].length;continue}}G++}return Z}var Tq=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 Iq($){let Z=new Set,X=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function J(H){let B;while((B=X.exec(H))!==null){let j=B[0];if(!Tq.has(j))Z.add(j)}}let Y=/\{\{([\s\S]*?)\}\}/g,Q;while((Q=Y.exec($))!==null)J(Q[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Q=G.exec($))!==null)J(Q[1]);let q=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=q.exec($))!==null)J(Q[1]);let U=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=U.exec($))!==null)J(Q[1]);let W=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=W.exec($))!==null)J(Q[1]);let z=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=z.exec($))!==null)J(Q[1]);let K=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=K.exec($))!==null)J(Q[1]);return Z}async function k$($,Z={}){let X=$,J="",Y=!1,Q=[],G=S4(X,{filePath:Z.filePath,projectRoot:Z.projectRoot});X=G.code;let q=C4(G.styles),U=A5(X);X=U.code,Q=[...U.imports,...U.models];let{hasUserImports:W,bundleClientScript:z}=await o("stx/client-script-bundler",()=>import("./chunk-fad3d1g7.js"));if(W(X))X=await z(X,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let O=D2(X);X=O.code,J=N2(O.stxImports,O.browserImports.filter((L)=>!Q.includes(L)))}if(J=`${Y4(X,Z.serverData)}${J}`,X=t0(X),!Y&&M1(Z.attrs||""))X=T1(X);let K=Mq(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let O=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),L=`type="module" data-stx-scoped${O?` ${O}`:""}`;return`${q}<script ${L}>
3797
+ `)G++;continue}if(q==="/"&&J[G+1]==="*"){G+=2;while(G<Q-1&&!(J[G]==="*"&&J[G+1]==="/"))G++;G+=2;continue}if(q==="{"){Y++,G++;continue}if(q==="}"){Y--,G++;continue}if(Y===0){let U=J.slice(G),W=U.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(W){let H=W[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=W[0].length;continue}let z=U.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(z){z[1].split(",").forEach((H)=>{let B=H.trim(),j=B.indexOf(":"),_=j>=0?B.slice(j+1).trim().split(/[\s=]/)[0]:B.split(/[\s=]/)[0];if(_&&!_.startsWith("_")&&!X.has(_))Z.push(_),X.add(_)}),G+=z[0].length;continue}let K=U.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(K){let H=K[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=K[0].length;continue}}G++}return Z}var Tq=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 Iq($){let Z=new Set,X=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function J(H){let B;while((B=X.exec(H))!==null){let j=B[0];if(!Tq.has(j))Z.add(j)}}let Y=/\{\{([\s\S]*?)\}\}/g,Q;while((Q=Y.exec($))!==null)J(Q[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Q=G.exec($))!==null)J(Q[1]);let q=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=q.exec($))!==null)J(Q[1]);let U=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=U.exec($))!==null)J(Q[1]);let W=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=W.exec($))!==null)J(Q[1]);let z=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=z.exec($))!==null)J(Q[1]);let K=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=K.exec($))!==null)J(Q[1]);return Z}async function k$($,Z={}){let X=$,J="",Y=!1,Q=[],G=S4(X,{filePath:Z.filePath,projectRoot:Z.projectRoot});X=G.code;let q=C4(G.styles),U=A5(X);X=U.code,Q=[...U.imports,...U.models];let{hasUserImports:W,bundleClientScript:z}=await o("stx/client-script-bundler",()=>import("./chunk-jg1xxdkj.js"));if(W(X))X=await z(X,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let O=D2(X);X=O.code,J=N2(O.stxImports,O.browserImports.filter((L)=>!Q.includes(L)))}if(J=`${Y4(X,Z.serverData)}${J}`,X=t0(X),!Y&&M1(Z.attrs||""))X=T1(X);let K=Mq(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let O=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),L=`type="module" data-stx-scoped${O?` ${O}`:""}`;return`${q}<script ${L}>
3798
3798
  ${r1(`${J}${X}
3799
3799
  ${K}`)}
3800
3800
  </script>`}let j=w2($),_=/function __stx_setup_/.test(X),F=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function V(O){let L=O.length>0?`
@@ -3809,4 +3809,4 @@ ${K}${L}`)}
3809
3809
  ${r1(`${J}${X}
3810
3810
  ${K}`)}
3811
3811
  })()</script>`}
3812
- export{WZ as il,zZ as jl,KZ as kl,e0 as ll,d$ as ml,m$ as nl,l$ as ol,c$ as pl,A7 as ql,N7 as rl,LZ as sl,RZ as tl,NZ as ul,HU as vl,BU as wl,jU as xl,_U as yl,VU as zl,qZ as Al,L7 as Bl,w7 as Cl,R7 as Dl,D7 as El,zU as Fl,P7 as Gl,H5 as Hl,C$ as Il,P$ as Jl,E2 as Kl,m4 as Ll,Eq as Ml,t0 as Nl,yq as Ol,y$ as Pl,X5 as Ql,kj as Rl,S4 as Sl,C4 as Tl,jq as Ul,A5 as Vl,N2 as Wl,vV as Xl,I$ as Yl,Y4 as Zl,k$ as _l,Q0 as $l,w0 as am,v5 as bm,G0 as cm,fq as dm,g5 as em,xq as fm,gq as gm,hq as hm,uq as im,Y1 as jm,q5 as km,u5 as lm,u2 as mm,sq as nm,d2 as om,oq as pm,f$ as qm,G7 as rm,Q1 as sm,x$ as tm,c2 as um,rq as vm,O1 as wm,p2 as xm,S0 as ym,aq as zm,z7 as Am,XU as Bm,$Z as Cm,ZZ as Dm,V7 as Em,O7 as Fm,F7 as Gm,UU as Hm,M7 as Im,i$ as Jm,z5 as Km,m5 as Lm,wU as Mm,p$ as Nm,TZ as Om,IZ as Pm,kZ as Qm,RU as Rm,I7 as Sm,k7 as Tm,U1 as Um,zX as Vm,KX as Wm,HX as Xm,BX as Ym,Y6 as Zm,jX as _m,c as $m,Q3 as an,_5 as bn,V5 as cn,s5 as dn,VX as en,o5 as fn,OX as gn,r5 as hn,w1 as in,G6 as jn,R1 as kn,q6 as ln,U6 as mn,a5 as nn,G3 as on,e as pn,NX as qn,AX as rn,MX as sn,m1 as tn,q3 as un,U3 as vn,m0 as wn,W3 as xn,K3 as yn,t5 as zn,IX as An,kX as Bn,EX as Cn,K6 as Dn,Q$ as En,B0 as Fn,E6 as Gn,w3 as Hn,W1 as In,D1 as Jn,b6 as Kn,F5 as Ln,G$ as Mn,R3 as Nn,YJ as On,GJ as Pn,C6 as Qn,UJ as Rn,WJ as Sn,v6 as Tn,N1 as Un,cz as Vn,f6 as Wn,I3 as Xn,jJ as Yn,T3 as Zn,_J as _n,VJ as $n,pz as ao,iz as bo,x6 as co,g6 as do,h6 as eo,OJ as fo,FJ as go,nz as ho,sz as io,LJ as jo,oz as ko,rz as lo,m6 as mo,i6 as no,b3 as oo,qK as po,R5 as qo,y3 as ro,S3 as so,UK as to,vJ as uo,WK as vo,fJ as wo,o6 as xo,zK as yo,xJ as zo,KK as Ao,HK as Bo,g3 as Co,OK as Do,FK as Eo,LK as Fo,wK as Go,RK as Ho,uJ as Io,DK as Jo,U$ as Ko,dJ as Lo,NK as Mo,AK as No,MK as Oo,TK as Po,nJ as Qo,oJ as Ro,qY as So,x3 as To,e6 as Uo,IK as Vo,W$ as Wo,iQ as Xo,XG as Yo,D4 as Zo,n9 as _o,uH as $o,a9 as ap,LQ as bp,RQ as cp,q8 as dp,Q4 as ep,U8 as fp,z8 as gp,K8 as hp,yQ as ip,SQ as jp,H8 as kp,X4 as lp,CQ as mp,vQ as np,q2 as op,fG as pp,xG as qp,gG as rp,hG as sp,uG as tp,U2 as up,cG as vp,sG as wp,oG as xp,H9 as yp,B9 as zp,uK as Ap,Y9 as Bp,dK as Cp,d3 as Dp,m3 as Ep,l3 as Fp,O9 as Gp,F9 as Hp,L9 as Ip,B6 as Jp,j6 as Kp,_6 as Lp,V6 as Mp,H3 as Np,B3 as Op,hW as Pp,uW as Qp,dW as Rp,yX as Sp,mW as Tp,zH as Up,KH as Vp,R9 as Wp,HH as Xp,A9 as Yp,CY as Zp,T9 as _p,b9 as $p,v9 as aq,j$ as bq,MH as cq,TH as dq,r3 as eq,f9 as fq,x9 as gq,zQ as hq,kH as iq,EH as jq,KQ as kq,bH as lq,g9 as mq,h9 as nq,V$ as oq,O$ as pq,o1 as qq,BQ as rq,d9 as sq,m9 as tq,l9 as uq,jQ as vq,_Q as wq,a3 as xq,t3 as yq,c9 as zq,p9 as Aq,N4 as Bq,A4 as Cq,T4 as Dq,I4 as Eq,AG as Fq,EG as Gq,bG as Hq,yG as Iq,SG as Jq,tG as Kq,M1 as Lq,E4 as Mq,T1 as Nq,M$ as Oq,Jq as Pq,Yq as Qq,Qq as Rq,k1 as Sq,a as Tq,$$ as Uq,_2 as Vq,z0 as Wq,OV as Xq,FV as Yq,v7 as Zq,f7 as _q,L1 as $q,x7 as ar,h1 as br,g7 as cr,B5 as dr,PU as er,mZ as fr,s$ as gr,vU as hr,o$ as ir,fU as jr,xU as kr,q1 as lr,gU as mr,hU as nr,uU as or,dU as pr,mU as qr,lU as rr,lZ as sr,a$ as tr,h7 as ur,pU as vr,iU as wr,nU as xr,sU as yr,oU as zr,d7 as Ar,rU as Br,m7 as Cr,aU as Dr,tU as Er,j5 as Fr,oZ as Gr,XW as Hr,aZ as Ir,s7 as Jr,i5 as Kr,UW as Lr,Z6 as Mr,Y3 as Nr,sW as Or,_3 as Pr,xX as Qr,dX as Rr,oW as Sr,rW as Tr,aW as Ur,tW as Vr,eW as Wr,$z as Xr,mX as Yr,lX as Zr,O6 as _r,T6 as $r,nX as as,O3 as bs,I6 as cs,Vz as ds,Oz as es,L3 as fs,eX as gs,k6 as hs};
3812
+ export{WZ as jl,zZ as kl,KZ as ll,e0 as ml,d$ as nl,m$ as ol,l$ as pl,c$ as ql,A7 as rl,N7 as sl,LZ as tl,RZ as ul,NZ as vl,HU as wl,BU as xl,jU as yl,_U as zl,VU as Al,qZ as Bl,L7 as Cl,w7 as Dl,R7 as El,D7 as Fl,zU as Gl,P7 as Hl,H5 as Il,C$ as Jl,P$ as Kl,E2 as Ll,m4 as Ml,Eq as Nl,t0 as Ol,yq as Pl,y$ as Ql,X5 as Rl,kj as Sl,S4 as Tl,C4 as Ul,jq as Vl,A5 as Wl,N2 as Xl,vV as Yl,I$ as Zl,Y4 as _l,k$ as $l,Q0 as am,w0 as bm,v5 as cm,G0 as dm,fq as em,g5 as fm,xq as gm,gq as hm,hq as im,uq as jm,Y1 as km,q5 as lm,u5 as mm,u2 as nm,sq as om,d2 as pm,oq as qm,f$ as rm,G7 as sm,Q1 as tm,x$ as um,c2 as vm,rq as wm,O1 as xm,p2 as ym,S0 as zm,aq as Am,z7 as Bm,XU as Cm,$Z as Dm,ZZ as Em,V7 as Fm,O7 as Gm,F7 as Hm,UU as Im,M7 as Jm,i$ as Km,z5 as Lm,m5 as Mm,wU as Nm,p$ as Om,TZ as Pm,IZ as Qm,kZ as Rm,RU as Sm,I7 as Tm,k7 as Um,U1 as Vm,zX as Wm,KX as Xm,HX as Ym,BX as Zm,Y6 as _m,jX as $m,c as an,Q3 as bn,_5 as cn,V5 as dn,s5 as en,VX as fn,o5 as gn,OX as hn,r5 as in,w1 as jn,G6 as kn,R1 as ln,q6 as mn,U6 as nn,a5 as on,G3 as pn,e as qn,NX as rn,AX as sn,MX as tn,m1 as un,q3 as vn,U3 as wn,m0 as xn,W3 as yn,K3 as zn,t5 as An,IX as Bn,kX as Cn,EX as Dn,K6 as En,Q$ as Fn,B0 as Gn,E6 as Hn,w3 as In,W1 as Jn,D1 as Kn,b6 as Ln,F5 as Mn,G$ as Nn,R3 as On,YJ as Pn,GJ as Qn,C6 as Rn,UJ as Sn,WJ as Tn,v6 as Un,N1 as Vn,cz as Wn,f6 as Xn,I3 as Yn,jJ as Zn,T3 as _n,_J as $n,VJ as ao,pz as bo,iz as co,x6 as do,g6 as eo,h6 as fo,OJ as go,FJ as ho,nz as io,sz as jo,LJ as ko,oz as lo,rz as mo,m6 as no,i6 as oo,b3 as po,qK as qo,R5 as ro,y3 as so,S3 as to,UK as uo,vJ as vo,WK as wo,fJ as xo,o6 as yo,zK as zo,xJ as Ao,KK as Bo,HK as Co,g3 as Do,OK as Eo,FK as Fo,LK as Go,wK as Ho,RK as Io,uJ as Jo,DK as Ko,U$ as Lo,dJ as Mo,NK as No,AK as Oo,MK as Po,TK as Qo,nJ as Ro,oJ as So,qY as To,x3 as Uo,e6 as Vo,IK as Wo,W$ as Xo,iQ as Yo,XG as Zo,D4 as _o,n9 as $o,uH as ap,a9 as bp,LQ as cp,RQ as dp,q8 as ep,Q4 as fp,U8 as gp,z8 as hp,K8 as ip,yQ as jp,SQ as kp,H8 as lp,X4 as mp,CQ as np,vQ as op,q2 as pp,fG as qp,xG as rp,gG as sp,hG as tp,uG as up,U2 as vp,cG as wp,sG as xp,oG as yp,H9 as zp,B9 as Ap,uK as Bp,Y9 as Cp,dK as Dp,d3 as Ep,m3 as Fp,l3 as Gp,O9 as Hp,F9 as Ip,L9 as Jp,B6 as Kp,j6 as Lp,_6 as Mp,V6 as Np,H3 as Op,B3 as Pp,hW as Qp,uW as Rp,dW as Sp,yX as Tp,mW as Up,zH as Vp,KH as Wp,R9 as Xp,HH as Yp,A9 as Zp,CY as _p,T9 as $p,b9 as aq,v9 as bq,j$ as cq,MH as dq,TH as eq,r3 as fq,f9 as gq,x9 as hq,zQ as iq,kH as jq,EH as kq,KQ as lq,bH as mq,g9 as nq,h9 as oq,V$ as pq,O$ as qq,o1 as rq,BQ as sq,d9 as tq,m9 as uq,l9 as vq,jQ as wq,_Q as xq,a3 as yq,t3 as zq,c9 as Aq,p9 as Bq,N4 as Cq,A4 as Dq,T4 as Eq,I4 as Fq,AG as Gq,EG as Hq,bG as Iq,yG as Jq,SG as Kq,tG as Lq,M1 as Mq,E4 as Nq,T1 as Oq,M$ as Pq,Jq as Qq,Yq as Rq,Qq as Sq,k1 as Tq,a as Uq,$$ as Vq,_2 as Wq,z0 as Xq,OV as Yq,FV as Zq,v7 as _q,f7 as $q,L1 as ar,x7 as br,h1 as cr,g7 as dr,B5 as er,PU as fr,mZ as gr,s$ as hr,vU as ir,o$ as jr,fU as kr,xU as lr,q1 as mr,gU as nr,hU as or,uU as pr,dU as qr,mU as rr,lU as sr,lZ as tr,a$ as ur,h7 as vr,pU as wr,iU as xr,nU as yr,sU as zr,oU as Ar,d7 as Br,rU as Cr,m7 as Dr,aU as Er,tU as Fr,j5 as Gr,oZ as Hr,XW as Ir,aZ as Jr,s7 as Kr,i5 as Lr,UW as Mr,Z6 as Nr,Y3 as Or,sW as Pr,_3 as Qr,xX as Rr,dX as Sr,oW as Tr,rW as Ur,aW as Vr,tW as Wr,eW as Xr,$z as Yr,mX as Zr,lX as _r,O6 as $r,T6 as as,nX as bs,O3 as cs,I6 as ds,Vz as es,Oz as fs,L3 as gs,eX as hs,k6 as is};