@stacksjs/stx 0.2.285 → 0.2.287
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtins/index.d.ts +4 -3
- package/dist/builtins/index.js +11 -11
- package/dist/chunk-122tyfre.js +2 -0
- package/dist/{chunk-0fgcnv6y.js → chunk-19nfvxfw.js} +1 -1
- package/dist/{chunk-f2s94353.js → chunk-1kah92n2.js} +1 -1
- package/dist/{chunk-90qr4f9m.js → chunk-1kms3b9d.js} +1 -1
- package/dist/{chunk-s2284nbk.js → chunk-1q4y74mh.js} +1 -1
- package/dist/{chunk-49kk0s96.js → chunk-248e84r1.js} +1 -1
- package/dist/{chunk-zfr4d08r.js → chunk-24ps8kft.js} +1 -1
- package/dist/chunk-2et5hxfv.js +2 -0
- package/dist/chunk-2r1rd8f0.js +2 -0
- package/dist/{chunk-n3qyd366.js → chunk-2tk1zkrz.js} +1 -1
- package/dist/{chunk-ysnk7x79.js → chunk-38ejahd9.js} +1 -1
- package/dist/chunk-3zv4wz87.js +2 -0
- package/dist/chunk-4122k1bh.js +2 -0
- package/dist/chunk-45az9zht.js +2 -0
- package/dist/{chunk-yq1d9hb3.js → chunk-4qr85f07.js} +1 -1
- package/dist/{chunk-9aw94jhm.js → chunk-4ww3znrr.js} +4 -4
- package/dist/chunk-5a19dhx5.js +2 -0
- package/dist/{chunk-39f40yc4.js → chunk-5kk8gsj2.js} +1 -1
- package/dist/{chunk-kzyhvrp8.js → chunk-5w1e3yxs.js} +1 -1
- package/dist/chunk-6gdycmxr.js +2 -0
- package/dist/{chunk-xqxg3fck.js → chunk-6hmnaza7.js} +10 -10
- package/dist/{chunk-zn5jgmqw.js → chunk-71t0yan0.js} +1 -1
- package/dist/chunk-74v15e8z.js +2 -0
- package/dist/{chunk-3y623mek.js → chunk-7b329e5v.js} +1 -1
- package/dist/{chunk-g3fy0tw8.js → chunk-866y9d8b.js} +154 -48
- package/dist/chunk-8fwerspy.js +2 -0
- package/dist/{chunk-c0an64km.js → chunk-8mjdpr94.js} +1 -1
- package/dist/{chunk-q68xmak4.js → chunk-92mj1t26.js} +18 -18
- package/dist/{chunk-f8b83xbw.js → chunk-9b22663r.js} +1 -1
- package/dist/chunk-9hjdgm4d.js +2 -0
- package/dist/{chunk-egez576q.js → chunk-9wr7zcad.js} +2 -2
- package/dist/{chunk-dy2y790t.js → chunk-a0nfbmeh.js} +1 -1
- package/dist/{chunk-7g88q9ft.js → chunk-acn1b56m.js} +2 -2
- package/dist/chunk-awkq3xfx.js +2 -0
- package/dist/{chunk-bf8wf3r2.js → chunk-b6ej2fdf.js} +2 -2
- package/dist/{chunk-e7jfpyqy.js → chunk-b8rrnqry.js} +1 -1
- package/dist/{chunk-a1g1zsbh.js → chunk-bfqfs07m.js} +1 -1
- package/dist/{chunk-fjkstnz3.js → chunk-bs6kapy7.js} +1 -1
- package/dist/{chunk-qd8ggjdx.js → chunk-btav940g.js} +1 -1
- package/dist/{chunk-pbk8jxe2.js → chunk-ccspd3mc.js} +1 -1
- package/dist/{chunk-7rxtra1g.js → chunk-csbgwaa5.js} +1 -1
- package/dist/chunk-d8t4sjsp.js +2 -0
- package/dist/chunk-dap191q2.js +2 -0
- package/dist/{chunk-ayrjwkyw.js → chunk-de7fye10.js} +1 -1
- package/dist/{chunk-2g9jwgs7.js → chunk-dgrt76d2.js} +1 -1
- package/dist/{chunk-9zndrzb3.js → chunk-dhh5q7qt.js} +1 -1
- package/dist/chunk-dsffsqnt.js +2 -0
- package/dist/{chunk-d0c3v7ax.js → chunk-dtq7y5ym.js} +1 -1
- package/dist/{chunk-w95sp0k9.js → chunk-fed3xsp9.js} +2 -2
- package/dist/{chunk-bxskmetn.js → chunk-ferav3bw.js} +1 -1
- package/dist/{chunk-a63y3aa0.js → chunk-fvhm8psm.js} +1 -1
- package/dist/{chunk-bz2gytfs.js → chunk-g4vpzv6b.js} +1 -1
- package/dist/{chunk-d34fnbpc.js → chunk-g9csmj0s.js} +1 -1
- package/dist/chunk-gtcrpmz1.js +2 -0
- package/dist/{chunk-9v5s9ax8.js → chunk-h4xh8cms.js} +1 -1
- package/dist/chunk-h8yqsz9m.js +2 -0
- package/dist/{chunk-phhzfeh9.js → chunk-hcq5dw7a.js} +1 -1
- package/dist/{chunk-d10btecr.js → chunk-hm0xha6c.js} +1 -1
- package/dist/chunk-jegt35zh.js +2 -0
- package/dist/{chunk-ggrzaenz.js → chunk-k56rjjc0.js} +1 -1
- package/dist/{chunk-ada449cq.js → chunk-kdh37tp8.js} +1 -1
- package/dist/{chunk-e4hhz9j3.js → chunk-kxzb4et3.js} +1 -1
- package/dist/{chunk-3bv8h4r6.js → chunk-mf4n3x1j.js} +1 -1
- package/dist/{chunk-5aq35j2e.js → chunk-mkd9kjgb.js} +1 -1
- package/dist/chunk-mxfh1nxg.js +2 -0
- package/dist/{chunk-snknv47x.js → chunk-nkb3scg6.js} +1 -1
- package/dist/{chunk-s67mgegv.js → chunk-nnd4wq8j.js} +1 -1
- package/dist/{chunk-1xfqy79h.js → chunk-nsp1cw38.js} +1 -1
- package/dist/chunk-p3242nck.js +2 -0
- package/dist/chunk-p98kfh94.js +2 -0
- package/dist/{chunk-t1k5dpbr.js → chunk-pkaabd8h.js} +1 -1
- package/dist/{chunk-t0ghjghe.js → chunk-pzm13sdc.js} +1 -1
- package/dist/{chunk-n32gnc22.js → chunk-q4p5k2p3.js} +1 -1
- package/dist/{chunk-sskbegsz.js → chunk-qc1f74ek.js} +1 -1
- package/dist/{chunk-nvgxjvnb.js → chunk-qpyjak7z.js} +1 -1
- package/dist/{chunk-0hdkedwq.js → chunk-qr82je1m.js} +1 -1
- package/dist/{chunk-a54n1r1q.js → chunk-qy73j6m4.js} +1 -1
- package/dist/{chunk-p396xrew.js → chunk-qzkhpsam.js} +1 -1
- package/dist/{chunk-f3hfk78e.js → chunk-r3ayvdz3.js} +1 -1
- package/dist/chunk-r7r66978.js +2 -0
- package/dist/{chunk-kpy77ys3.js → chunk-rbb7dvja.js} +1 -1
- package/dist/{chunk-kdrpx9ft.js → chunk-rj4kajww.js} +1 -1
- package/dist/{chunk-areethga.js → chunk-rp4rjjmf.js} +1 -1
- package/dist/{chunk-gjemavhx.js → chunk-se0p17c2.js} +1 -1
- package/dist/chunk-sj9pmene.js +2 -0
- package/dist/{chunk-a2qghr2x.js → chunk-sscwkffs.js} +1 -1
- package/dist/chunk-svpqxn2c.js +2 -0
- package/dist/chunk-t8y1ggdy.js +2 -0
- package/dist/{chunk-y6kw0wb7.js → chunk-tndhnk9e.js} +1 -1
- package/dist/{chunk-c6fw33zh.js → chunk-v5e1gxwm.js} +2 -2
- package/dist/{chunk-7p9ns60j.js → chunk-vrrax298.js} +1 -1
- package/dist/{chunk-zcmtqan3.js → chunk-wrzwgkbx.js} +3 -3
- package/dist/{chunk-jn6m8zf7.js → chunk-x650vjcp.js} +1 -1
- package/dist/{chunk-mjkfc2v6.js → chunk-xgnc1wy6.js} +1 -1
- package/dist/{chunk-52mh63sp.js → chunk-xpp135ad.js} +1 -1
- package/dist/chunk-y11cxbxd.js +3757 -0
- package/dist/{chunk-cvnh7dma.js → chunk-y98jsjqq.js} +1 -1
- package/dist/{chunk-vbdca0k1.js → chunk-ya386h70.js} +1 -1
- package/dist/chunk-ydrz60kr.js +2 -0
- package/dist/{chunk-0f1kz0x2.js → chunk-ypmqf7tm.js} +1 -1
- package/dist/{chunk-cb74rvec.js → chunk-z4jhj5e5.js} +1 -1
- package/dist/{chunk-fskfes13.js → chunk-zg75gjns.js} +1 -1
- package/dist/{chunk-mb518a4n.js → chunk-zqqx1qaj.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/client-script-bundler.js +7 -7
- package/dist/client-script.js +27 -7
- package/dist/component-client-factories.js +10 -5
- package/dist/component-processing.d.ts +13 -0
- package/dist/component-processing.js +37 -1
- package/dist/component-renderer.js +34 -15
- package/dist/conditionals.js +14 -3
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/document-shell.d.ts +1 -34
- package/dist/document-shell.js +19 -11
- package/dist/html-masking.d.ts +65 -9
- package/dist/html-masking.js +103 -15
- package/dist/misc-directives.d.ts +1 -1
- package/dist/misc-directives.js +48 -13
- package/dist/process.js +14 -4
- package/dist/pwa.js +2 -2
- package/dist/reactive-bindings.js +2 -0
- package/dist/runtime-globals.d.ts +7 -20
- package/dist/runtime-globals.js +28 -3
- package/dist/safe-evaluator.d.ts +15 -0
- package/dist/safe-evaluator.js +16 -12
- package/dist/server-bindings.js +21 -5
- package/dist/signal-processing.d.ts +17 -7
- package/dist/signal-processing.js +112 -43
- package/dist/signals-api.js +5 -2
- package/dist/signals.js +153 -47
- package/dist/ssg.js +2 -2
- package/dist/utils.js +23 -6
- package/dist/variable-extractor.js +17 -47
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-1k957wj9.js +0 -2
- package/dist/chunk-43r6p08p.js +0 -2
- package/dist/chunk-492g6g4g.js +0 -2
- package/dist/chunk-60c5bvke.js +0 -2
- package/dist/chunk-71nr1avx.js +0 -2
- package/dist/chunk-7gbwa2ph.js +0 -2
- package/dist/chunk-8ns2r0we.js +0 -2
- package/dist/chunk-9rkntp0z.js +0 -3756
- package/dist/chunk-b29wbjs5.js +0 -2
- package/dist/chunk-ba6tthsm.js +0 -2
- package/dist/chunk-f6x9bh8n.js +0 -2
- package/dist/chunk-f80wwn5x.js +0 -2
- package/dist/chunk-fk6ssg32.js +0 -2
- package/dist/chunk-gkmtkzdm.js +0 -2
- package/dist/chunk-hzw1ekq3.js +0 -2
- package/dist/chunk-j03bare5.js +0 -2
- package/dist/chunk-jxjt1szw.js +0 -2
- package/dist/chunk-m2harpd3.js +0 -2
- package/dist/chunk-qp97dx7x.js +0 -2
- package/dist/chunk-stw3ej3d.js +0 -2
- package/dist/chunk-v4f08c2r.js +0 -2
- package/dist/chunk-vrvehb01.js +0 -2
- package/dist/chunk-y1segp76.js +0 -2
- package/dist/chunk-y3qng57q.js +0 -2
- package/dist/chunk-yqaky7fa.js +0 -2
- package/dist/chunk-ytgnzeeb.js +0 -2
- package/dist/chunk-z7cwrmgt.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Hf as _$,If as K5}from"./chunk-
|
|
2
|
+
import{Hf as _$,If as K5}from"./chunk-pzm13sdc.js";import{eh as y7,ih as U$,jh as q6,lh as Z1,mh as y6,nh as Q5,oh as B$,ph as L$,qh as v6,rh as g6}from"./chunk-rbb7dvja.js";import{Aj as p5,Cj as c5,vj as u1,wj as O1,xj as H1,yj as m$,zj as p$}from"./chunk-fed3xsp9.js";import{Wj as Y$,Xj as J$}from"./chunk-a0nfbmeh.js";import{yk as g5,zk as f5}from"./chunk-71t0yan0.js";import{Fk as l7,Gk as i7}from"./chunk-58f0mthg.js";import{_k as Q1}from"./chunk-4ww3znrr.js";import{Bo as m0,Fm as x6,Gp as O0,Jm as Z5,Mm as N1,Nm as M1,Qn as Z$,Qq as G$,Up as Q6,Vp as E1,Zp as p0,_n as X5,am as b7,ao as S6,bo as z6,br as E$,cp as g7,dr as d0,er as M0,ir as V0,jp as P6,kp as b6,om as u0,to as j0}from"./chunk-y11cxbxd.js";import{Br as s$,Dr as n$,Gr as l1,Kr as o$,Nr as Q$,Or as F6,Yr as X6,qr as c1,tr as L6}from"./chunk-92mj1t26.js";import{$s as t$,ht as B,ot as W$,pt as K$,tt as o}from"./chunk-wrzwgkbx.js";import{yt as S0}from"./chunk-5kk8gsj2.js";import{Nu as R6,Ou as I6,Pu as D6,Qu as w6,Ru as T6,Su as C6,Uu as k6,Yu as A6,su as $5,tu as H6,xu as V6,yu as E6}from"./chunk-b6ej2fdf.js";import{gv as p}from"./chunk-qc1f74ek.js";var l5={read:($)=>{try{return JSON.parse($)}catch{return $}},write:($)=>{return JSON.stringify($)}};function e7($,X,Q={}){let{storage:Z="local",serializer:Y=l5,mergeDefaults:J=!1,listenToStorageChanges:G=!0}=Q,W=new Set,K=typeof window<"u",_=()=>{if(!K)return null;return Z==="session"?sessionStorage:localStorage},U=()=>{let L=_();if(!L)return X;try{let H=L.getItem($);if(H===null)return X;let q=Y.read(H);if(J&&typeof X==="object"&&X!==null)return{...X,...q};return q}catch{return X}},F=(L)=>{let H=_();if(!H)return;try{if(L===null||L===void 0)H.removeItem($);else H.setItem($,Y.write(L))}catch(q){console.warn(`[useStorage] Failed to write key "${$}":`,q)}},z=U(),j=(L,H)=>{for(let q of W)try{q(L,H)}catch(A){console.error("[useStorage] Subscriber error:",A)}};if(K&&G){let L=(q)=>{if(q.key===$&&q.storageArea===_()){let A=z;try{z=q.newValue?Y.read(q.newValue):X}catch(N){console.warn(`[useStorage] Failed to read key "${$}" from a cross-tab update:`,N);return}j(z,A)}};window.addEventListener("storage",L);let H=globalThis.onDestroy;if(typeof H==="function")H(()=>window.removeEventListener("storage",L))}let O={get value(){return z},set value(L){let H=z;z=L,F(L),j(L,H)},get:()=>z,set:(L)=>{O.value=L},remove:()=>{let L=_();if(L){L.removeItem($);let H=z;z=X,j(X,H)}},subscribe:(L)=>{return W.add(L),L(z,void 0),()=>W.delete(L)}};return O}function i5($,X,Q,Z,Y={}){let{serializer:J=l5,mergeDefaults:G=!1,listenToStorageChanges:W=!0}=Y,K=typeof window<"u",_=()=>{if(!K)return null;return $==="session"?sessionStorage:localStorage},U=(j)=>{if(j===null||j===void 0)return Z;try{let O=J.read(j);if(G&&typeof Z==="object"&&Z!==null)return{...Z,...O};return O}catch(O){return console.warn(`[${X}] Failed to read key "${Q}":`,O),Z}},z=p5((()=>{let j=_();if(!j)return Z;try{return U(j.getItem(Q))}catch(O){return console.warn(`[${X}] Cannot read "${Q}":`,O),Z}})());if(c5(()=>{let j=z(),O=_();if(!O)return;try{if(j===null||j===void 0)O.removeItem(Q);else O.setItem(Q,J.write(j))}catch(L){console.warn(`[${X}] Cannot persist "${Q}":`,L)}}),K&&W){let j=(L)=>{if(L.key!==Q)return;if(L.storageArea&&L.storageArea!==_())return;z.set(U(L.newValue))};window.addEventListener("storage",j);let O=globalThis.onDestroy;if(typeof O==="function")O(()=>window.removeEventListener("storage",j))}return z}function $3($,X,Q){return i5("local","useLocalStorage",$,X,Q)}function X3($,X,Q){return i5("session","useSessionStorage",$,X,Q)}function Q3($="local"){if(typeof window>"u")return;($==="session"?sessionStorage:localStorage).clear()}function Z3($="local"){if(typeof window>"u")return[];let X=$==="session"?sessionStorage:localStorage;return Object.keys(X)}function Y3($="local"){if(typeof window>"u")return 0;let X=$==="session"?sessionStorage:localStorage,Q=0;for(let Z in X)if(Object.prototype.hasOwnProperty.call(X,Z))Q+=(Z.length+(X.getItem(Z)?.length||0))*2;return Q}var l=null;function d1($,X,Q=new WeakSet){if(Object.is($,X))return!0;if(typeof $!=="object"||typeof X!=="object"||$===null||X===null)return!1;if(Q.has($))return!0;if(Q.add($),$ instanceof Date&&X instanceof Date)return $.getTime()===X.getTime();if($ instanceof RegExp&&X instanceof RegExp)return $.source===X.source&&$.flags===X.flags;if(Array.isArray($)){if(!Array.isArray(X)||$.length!==X.length)return!1;for(let J=0;J<$.length;J++)if(!d1($[J],X[J],Q))return!1;return!0}if(Array.isArray(X))return!1;if($ instanceof Map){if(!(X instanceof Map)||$.size!==X.size)return!1;for(let[J,G]of $)if(!X.has(J)||!d1(G,X.get(J),Q))return!1;return!0}if(X instanceof Map)return!1;if($ instanceof Set){if(!(X instanceof Set)||$.size!==X.size)return!1;for(let J of $)if(!X.has(J))return!1;return!0}if(X instanceof Set)return!1;let Z=Object.keys($),Y=Object.keys(X);if(Z.length!==Y.length)return!1;for(let J of Z){if(!Object.prototype.hasOwnProperty.call(X,J))return!1;if(!d1($[J],X[J],Q))return!1}return!0}function KJ($){l=$}function _J(){return l}function UJ(){return{isMounted:!1,isUnmounted:!1,hooks:{beforeMount:[],mounted:[],beforeUpdate:[],updated:[],beforeUnmount:[],unmounted:[]},effects:[],scope:J3()}}function J3(){return{refs:new Map,effects:new Set,cleanups:[]}}function BJ($){let X=new Set,Q=new Set,Z=$,Y=Symbol("ref"),J={get value(){let G=u1();if(G)Q.add(G);return Z},set value(G){if(!Object.is(G,Z)){let W=Z;Z=G;for(let K of X)K(G,W);for(let K of Q)if(m$())p$(K);else K()}},subscribe(G){return X.add(G),()=>{X.delete(G)}}};if(l)l.scope.refs.set(Y,J);return J}var a5=new WeakMap;function G3($){let X=a5.get($);if(X)return X;let Q=new Map,Z=(G)=>{let W=Q.get(G);if(!W)return;for(let K of[...W])if(m$())p$(K);else K()},Y=(G,W)=>{if(!Q.has(G))Q.set(G,new Set);return Q.get(G).add(W),()=>{Q.get(G)?.delete(W)}},J=new Proxy($,{get(G,W,K){let _=Reflect.get(G,W,K),U=u1();if(U)Y(W,U);if(_!==null&&typeof _==="object"&&!Array.isArray(_)){let F=Object.getPrototypeOf(_);if(F===Object.prototype||F===null)return G3(_)}return _},set(G,W,K,_){let U=Reflect.get(G,W,_),F=Reflect.set(G,W,K,_);if(!Object.is(K,U))Z(W);return F},deleteProperty(G,W){let K=Reflect.deleteProperty(G,W);return Z(W),K}});return a5.set($,J),J}function LJ($){let X,Q=!0,Z=new Set,Y=new Set,J=()=>{Q=!0,G()},G=()=>{if(Q){let K=X,_=O1(J);if(X=$(),H1(_),Q=!1,!Object.is(X,K)){for(let U of Z)U(X,K);for(let U of Y)U()}}},W=O1(J);return X=$(),Q=!1,H1(W),{get value(){let K=u1();if(K)Y.add(K);return G(),X},set value(K){console.warn("[stx] Computed properties are readonly")},subscribe(K){return Z.add(K),()=>{Z.delete(K)}}}}function W3($){if(typeof requestAnimationFrame==="function"){requestAnimationFrame(()=>{requestAnimationFrame($)});return}setTimeout($,0)}function FJ($,X,Q={}){let{immediate:Z=!1,deep:Y=!1,flush:J="post"}=Q,G,W,K=!1,_=()=>{if(K)return;let O=j();if((Y?!d1(O,G):!Object.is(O,G))||Z)if(X(O,G),Y&&O!==null&&typeof O==="object")try{G=structuredClone(O)}catch{G=O}else G=O},U=(O)=>{if(J==="sync")O();else if(J==="pre")Promise.resolve().then(O);else W3(O)},F=!1,z=()=>{if(K||F)return;F=!0,U(()=>{F=!1,_()})},j=()=>{if(typeof $==="function"){let O=O1(z);try{return $()}finally{H1(O)}}return $.value};if(typeof $!=="function"){let O=$.subscribe(()=>{U(_)});W=()=>{K=!0,O()}}else W=()=>{K=!0};if(G=j(),Z)U(_);if(l)l.scope.cleanups.push(()=>W?.());return()=>W?.()}function zJ($,X,Q={}){let Z=[],Y=$.map((J)=>J.value);for(let J of $){let G=J.subscribe(()=>{let W=$.map((K)=>K.value);X(W,Y),Y=[...W]});Z.push(G)}if(Q.immediate){let J=$.map((G)=>G.value);X(J,Y)}return()=>{for(let J of Z)J()}}function jJ($){let X,Q=!1,Z=()=>{if(Q)return;if(X)X();let Y=O1(Z);X=$(),H1(Y)};if(Z(),l)l.scope.cleanups.push(()=>{if(Q=!0,X)X()});return()=>{if(Q=!0,X)X()}}function OJ($){if(l)l.hooks.beforeMount.push($);else console.warn("[stx] onBeforeMount called outside of component setup")}function HJ($){if(l)l.hooks.mounted.push($);else console.warn("[stx] onMounted called outside of component setup")}function AJ($){if(l)l.hooks.beforeUpdate.push($);else console.warn("[stx] onBeforeUpdate called outside of component setup")}function qJ($){if(l)l.hooks.updated.push($);else console.warn("[stx] onUpdated called outside of component setup")}function NJ($){if(l)l.hooks.beforeUnmount.push($);else console.warn("[stx] onBeforeUnmount called outside of component setup")}function MJ($){if(l)l.hooks.unmounted.push($);else console.warn("[stx] onUnmounted called outside of component setup")}async function n0($,X){let Q=$.hooks[X];for(let Z of Q)await Z()}async function VJ($){await n0($,"beforeMount"),$.isMounted=!0,await n0($,"mounted")}async function EJ($){if(!$.isMounted||$.isUnmounted)return;await n0($,"beforeUpdate"),await n0($,"updated")}async function RJ($){if($.isUnmounted)return;await n0($,"beforeUnmount");for(let X of $.scope.cleanups)X();$.isUnmounted=!0,await n0($,"unmounted")}function IJ(){return`
|
|
3
3
|
<script data-stx-client-runtime>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -685,7 +685,7 @@ else {
|
|
|
685
685
|
<span class="frontmatter-label">${X}:</span>
|
|
686
686
|
<span>${Array.isArray(Q)?Q.join(", "):String(Q)}</span>
|
|
687
687
|
</div>`).join("")}
|
|
688
|
-
</div>`}import U6 from"net";async function J4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"0.0.0.0")})}async function G4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"::")})}async function W4($){if(!await J4($))return!1;return await G4($)}async function k0($,X=20){$=Number($);for(let Q=0;Q<X;Q++){let Z=$+Q;if(await W4(Z))return Z}throw Error(`Could not find an available port between ${$} and ${$+X-1}`)}var K4={title:"stx Development",width:1400,height:900,darkMode:!0,hotReload:!0,titlebarHidden:!1,nativeSidebar:!1,sidebarWidth:260,sidebarConfig:void 0};async function _4(){try{let $=await import("./chunk-
|
|
688
|
+
</div>`}import U6 from"net";async function J4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"0.0.0.0")})}async function G4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"::")})}async function W4($){if(!await J4($))return!1;return await G4($)}async function k0($,X=20){$=Number($);for(let Q=0;Q<X;Q++){let Z=$+Q;if(await W4(Z))return Z}throw Error(`Could not find an available port between ${$} and ${$+X-1}`)}var K4={title:"stx Development",width:1400,height:900,darkMode:!0,hotReload:!0,titlebarHidden:!1,nativeSidebar:!1,sidebarWidth:260,sidebarConfig:void 0};async function _4(){try{let $=await import("./chunk-se0p17c2.js");if(typeof $.openDevWindow!=="function")return null;return $}catch{return null}}async function t0($,X={}){let Q={...K4,...X},Z=await _4();if(!Z)return console.log(`${B.yellow}\u26A0${B.reset} Native window requested, but @stacksjs/desktop is not available.`),console.log(" Install & build the desktop package to enable --native."),!1;try{let Y=await Z.openDevWindow($,{title:Q.title,width:Q.width,height:Q.height,darkMode:Q.darkMode,hotReload:Q.hotReload,titlebarHidden:Q.titlebarHidden,nativeSidebar:Q.nativeSidebar,sidebarWidth:Q.sidebarWidth,sidebarConfig:Q.sidebarConfig});if(Y&&Q.nativeSidebar)console.log(`${B.green}\u2713${B.reset} Native sidebar enabled (macOS Tahoe style)`);return Y}catch(Y){return console.log(`${B.red}\u2717${B.reset} Could not open native window:`,Y),!1}}function o1($){if($.match(/<Sidebar[\s\S]*?variant=["'](?:tahoe|vibrancy|desktop)["'][\s\S]*?\/>/i)){let Y=$.match(/<script\s+server[^>]*>([\s\S]*?)<\/script>/i);if(Y){let J=Y[1];try{let G=`
|
|
689
689
|
${J}
|
|
690
690
|
return typeof sidebarConfig !== 'undefined' ? sidebarConfig : null;
|
|
691
691
|
`,K=Function(G)();if(K)return K}catch(G){console.warn("Invalid sidebarConfig:",G)}}return{sections:[]}}let Q=$.match(/@nativeSidebar\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(Q)try{return JSON.parse(Q[1])}catch{console.warn("Invalid @nativeSidebar configuration")}let Z=$.match(/<script\s+native-sidebar[^>]*>([\s\S]*?)<\/script>/i);if(Z)try{let Y=Z[1].match(/(?:export\s+(?:default\s+)?|const\s+\w+\s*=\s*)(\{[\s\S]*\})/m);if(Y)return Function(`return ${Y[1]}`)()}catch(Y){console.warn("Invalid native-sidebar script configuration:",Y)}return}function i$(){console.log(`
|
|
@@ -1057,7 +1057,7 @@ else {
|
|
|
1057
1057
|
};
|
|
1058
1058
|
})();
|
|
1059
1059
|
</script>
|
|
1060
|
-
`}function D0($,X,Q={}){let Z=j4(X,Q),Y=$.lastIndexOf("</body>");if(Y!==-1)return $.slice(0,Y)+Z+$.slice(Y);if($.includes("</html>"))return $.replace("</html>",`${Z}</html>`);return $+Z}function t1($){let X=$.toLowerCase();return X.endsWith(".css")||X.endsWith(".scss")||X.endsWith(".sass")||X.endsWith(".less")}function e1($){let X=$.toLowerCase();return[".stx",".html",".htm",".md",".js",".ts",".jsx",".tsx",".json"].some((Z)=>X.endsWith(Z))}function $$($){return[/^\./,/node_modules/,/\.stx\/output/,/\.stx\/cache/,/~$/,/\.swp$/,/\.swo$/].some((Q)=>Q.test($))}var $1=null;function X$($){if(!$1)$1=new B6($);return $1}function A1(){if($1)$1.stop(),$1=null}import q1 from"path";var X1={name:"bun-plugin-stx",async setup($){let Q={...await d0(),...$.config?.stx},Z=new Set,Y=Q.webComponents?.enabled?`./${q1.relative(q1.dirname($.config?.outdir||"dist"),Q.webComponents.outputDir||"dist/web-components")}`:"/web-components",J=[];if(Q.webComponents?.enabled)try{let G=await G$(Q,Z);if(J.push(...G),Q.debug&&G.length>0)console.log(`Successfully built ${G.length} web components`)}catch(G){console.error("Failed to build web components:",G)}$.onLoad({filter:/\.stx$/},async({path:G})=>{try{let W=new Set;if(Q.cache&&Q.cachePath){let L=await Y$(G,Q);if(L){if(Q.debug)console.log(`Using cached version of ${G}`);return{contents:L,loader:"html"}}}let K=await o$(()=>Bun.file(G).text(),"",(L)=>{throw new n$(`Failed to read stx file: ${G}`,G,void 0,void 0,`File read error: ${L.message}`)});if(!K)throw new n$(`stx file is empty: ${G}`,G);let{scriptContent:_,templateContent:U,allScripts:F}=t$.time("script-extraction",()=>{let L=K,H=Z$(K);if(H)L=H.content.trim();let q=K.match(/<script\b[^>]*>[\s\S]*?<\/script>/gi)||[],A="",N=[];for(let M of q){let R=M.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i)?.[1]||"",w=M.match(/<script\b([^>]*)>/i),C=w?w[1]:"";if(/\bserver\b/i.test(C))A=R;else N.push(M)}let V=L.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"");return{scriptContent:A,templateContent:V,allScripts:N}}),z={__filename:G,__dirname:q1.dirname(G),__stx:{webComponentsPath:Y,builtComponents:J}};await o$(()=>j0(_,z,G),void 0,(L)=>{let H=new s$(`Script execution failed in ${G}: ${L.message}`,G,void 0,void 0,_.substring(0,100));if(Q$.log(H,{filePath:G,scriptContent:_}),Q.debug)throw H});let O=await t$.timeAsync("directive-processing",async()=>{return await O0(U,z,G,Q,W)});if(F.length>0){let{interpolateScriptsInTemplate:L}=await import("./chunk-
|
|
1060
|
+
`}function D0($,X,Q={}){let Z=j4(X,Q),Y=$.lastIndexOf("</body>");if(Y!==-1)return $.slice(0,Y)+Z+$.slice(Y);if($.includes("</html>"))return $.replace("</html>",`${Z}</html>`);return $+Z}function t1($){let X=$.toLowerCase();return X.endsWith(".css")||X.endsWith(".scss")||X.endsWith(".sass")||X.endsWith(".less")}function e1($){let X=$.toLowerCase();return[".stx",".html",".htm",".md",".js",".ts",".jsx",".tsx",".json"].some((Z)=>X.endsWith(Z))}function $$($){return[/^\./,/node_modules/,/\.stx\/output/,/\.stx\/cache/,/~$/,/\.swp$/,/\.swo$/].some((Q)=>Q.test($))}var $1=null;function X$($){if(!$1)$1=new B6($);return $1}function A1(){if($1)$1.stop(),$1=null}import q1 from"path";var X1={name:"bun-plugin-stx",async setup($){let Q={...await d0(),...$.config?.stx},Z=new Set,Y=Q.webComponents?.enabled?`./${q1.relative(q1.dirname($.config?.outdir||"dist"),Q.webComponents.outputDir||"dist/web-components")}`:"/web-components",J=[];if(Q.webComponents?.enabled)try{let G=await G$(Q,Z);if(J.push(...G),Q.debug&&G.length>0)console.log(`Successfully built ${G.length} web components`)}catch(G){console.error("Failed to build web components:",G)}$.onLoad({filter:/\.stx$/},async({path:G})=>{try{let W=new Set;if(Q.cache&&Q.cachePath){let L=await Y$(G,Q);if(L){if(Q.debug)console.log(`Using cached version of ${G}`);return{contents:L,loader:"html"}}}let K=await o$(()=>Bun.file(G).text(),"",(L)=>{throw new n$(`Failed to read stx file: ${G}`,G,void 0,void 0,`File read error: ${L.message}`)});if(!K)throw new n$(`stx file is empty: ${G}`,G);let{scriptContent:_,templateContent:U,allScripts:F}=t$.time("script-extraction",()=>{let L=K,H=Z$(K);if(H)L=H.content.trim();let q=K.match(/<script\b[^>]*>[\s\S]*?<\/script>/gi)||[],A="",N=[];for(let M of q){let R=M.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i)?.[1]||"",w=M.match(/<script\b([^>]*)>/i),C=w?w[1]:"";if(/\bserver\b/i.test(C))A=R;else N.push(M)}let V=L.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"");return{scriptContent:A,templateContent:V,allScripts:N}}),z={__filename:G,__dirname:q1.dirname(G),__stx:{webComponentsPath:Y,builtComponents:J}};await o$(()=>j0(_,z,G),void 0,(L)=>{let H=new s$(`Script execution failed in ${G}: ${L.message}`,G,void 0,void 0,_.substring(0,100));if(Q$.log(H,{filePath:G,scriptContent:_}),Q.debug)throw H});let O=await t$.timeAsync("directive-processing",async()=>{return await O0(U,z,G,Q,W)});if(F.length>0){let{interpolateScriptsInTemplate:L}=await import("./chunk-g9csmj0s.js"),H=L(F.join(`
|
|
1061
1061
|
`),z),q=O.search(/<\/body>/i);if(q!==-1)O=O.slice(0,q)+H+`
|
|
1062
1062
|
`+O.slice(q);else O+=`
|
|
1063
1063
|
${H}`}if(O=await z6(O),W.forEach((L)=>Z.add(L)),Q.cache&&Q.cachePath){if(await J$(G,O,W,Q),Q.debug)console.log(`Cached template ${G} with ${W.size} dependencies`)}return{contents:O,loader:"html"}}catch(W){let K=W instanceof Error?W:new s$(`Plugin processing failed: ${String(W)}`,G);if(Q$.log(K,{filePath:G,buildConfig:$.config}),F6.logDetailedError(K,{filePath:G,plugin:"bun-plugin-stx"}),Q.debug)console.error("stx Plugin Error:",K);let _=K,U=_.line||null,F=_.context||null;return{contents:Q.debug||L6()?`<!DOCTYPE html>
|
|
@@ -1120,7 +1120,7 @@ ${H}`}if(O=await z6(O),W.forEach((L)=>Z.add(L)),Q.cache&&Q.cachePath){if(await J
|
|
|
1120
1120
|
<h1>Something went wrong</h1>
|
|
1121
1121
|
<p>An internal error occurred. Please try again later.</p>
|
|
1122
1122
|
</body>
|
|
1123
|
-
</html>`,loader:"html"}}})}};async function H4($,X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=Y0.resolve($);if(!H0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return r$(W,X);else if(!W.endsWith(".stx"))return console.error(`${B.red}Error: Unsupported file type: ${B.bright}${W}${B.reset}. Only .stx and .md files are supported.`),!1;let K=S0(process.cwd(),"output");H0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let A={name:"public-assets",setup(R){R.onResolve({filter:/^\/(images|fonts|assets|public)\//},(w)=>{return{path:w.path,external:!0}})}},N=await Bun.build({entrypoints:[W],outdir:K,plugins:[A,X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!N.success)return console.error(`${B.red}Build failed:${B.reset}`,N.logs),!1;let V=N.outputs.find((R)=>R.path.endsWith(".html"));if(!V)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(V.path).text(),!0}catch(A){return console.error(`${B.red}Error building stx file:${B.reset}`,A),!1}};if(!await U())return!1;let z=Y0.dirname(W);await W$(z);let j=Q;try{if(j=await k0(Q),j!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${j} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let A=X.hmrPort||j+1;J=X$({wsPort:A,verbose:!1}),G=J.start(A)}let O={},L=null;try{let{loadStxConfig:A}=await import("./chunk-
|
|
1123
|
+
</html>`,loader:"html"}}})}};async function H4($,X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=Y0.resolve($);if(!H0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return r$(W,X);else if(!W.endsWith(".stx"))return console.error(`${B.red}Error: Unsupported file type: ${B.bright}${W}${B.reset}. Only .stx and .md files are supported.`),!1;let K=S0(process.cwd(),"output");H0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let A={name:"public-assets",setup(R){R.onResolve({filter:/^\/(images|fonts|assets|public)\//},(w)=>{return{path:w.path,external:!0}})}},N=await Bun.build({entrypoints:[W],outdir:K,plugins:[A,X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!N.success)return console.error(`${B.red}Build failed:${B.reset}`,N.logs),!1;let V=N.outputs.find((R)=>R.path.endsWith(".html"));if(!V)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(V.path).text(),!0}catch(A){return console.error(`${B.red}Error building stx file:${B.reset}`,A),!1}};if(!await U())return!1;let z=Y0.dirname(W);await W$(z);let j=Q;try{if(j=await k0(Q),j!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${j} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let A=X.hmrPort||j+1;J=X$({wsPort:A,verbose:!1}),G=J.start(A)}let O={},L=null;try{let{loadStxConfig:A}=await import("./chunk-74v15e8z.js"),N=await A();if(N?.apiRouter)L=N?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(N?.apiRoutes){O=N.apiRoutes;let V=Object.keys(O).length;if(V>0)console.log(`${B.blue}Loaded ${B.bright}${V} API route${V>1?"s":""}${B.reset}`)}if(N?.broadcasting?.enabled)try{let{startBroadcasting:V,loadChannels:M}=await import("./chunk-sscwkffs.js"),R=N.broadcasting;await V(R);let w=R.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${w}/ws${B.reset}`);let C=Y0.join(process.cwd(),"channels.ts");if(H0.existsSync(C))try{let I=await M(C);console.log(`${B.blue}Loaded ${B.bright}${I} broadcast channel${I!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(I){console.warn(`${B.yellow}Failed to load channels.ts: ${I.message}${B.reset}`)}}catch(V){console.warn(`${B.yellow}Broadcasting failed to start: ${V.message}${B.reset}`)}}catch{}if(console.log(`${B.blue}Starting server on ${B.cyan}http://localhost:${j}/${B.reset}...`),Y)console.log(`${B.magenta}Hot reload enabled on ws://localhost:${G}${B.reset}`);let H=O4({port:j,async fetch(A){return _$(A,await(async()=>{let N=new URL(A.url);if(L)try{let C=await L.handleRequest(A);if(C.status!==404)return C}catch{}if(O[N.pathname])try{return await O[N.pathname](A)}catch(C){return new Response(JSON.stringify({error:C.message}),{status:500,headers:{"Content-Type":"application/json"}})}if(N.pathname==="/")return(async()=>{let I=await o(_||"");if(Y)I=D0(I,G);if(X.native)if(I.includes("<head>"))I=I.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else if(I.includes("<html"))I=I.replace(/(<html[^>]*>)/,"$1<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>");else I="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+I;if(X.titlebarHidden)if(I.includes("<head>"))I=I.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else if(I.includes("<html"))I=I.replace(/(<html[^>]*>)/,"$1<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>");else I=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${I}`;return I})().then((I)=>new Response(I,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}}));let V=Y0.join(K,N.pathname);if(H0.existsSync(V)&&H0.statSync(V).isFile()){let C=Bun.file(V),I=Y0.extname(V).toLowerCase(),E="text/plain";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}let M=Y0.dirname(W),R=Y0.join(M,N.pathname);if(H0.existsSync(R)&&H0.statSync(R).isFile()){let C=Bun.file(R),I=Y0.extname(R).toLowerCase(),E="text/plain";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".svg":E="image/svg+xml";break;case".ico":E="image/x-icon";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}let w=Y0.join(process.cwd(),"public",N.pathname);if(H0.existsSync(w)&&H0.statSync(w).isFile()){let C=Bun.file(w),I=Y0.extname(w).toLowerCase(),E="application/octet-stream";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".svg":E="image/svg+xml";break;case".ico":E="image/x-icon";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}return new Response("Not Found",{status:404})})())},error(A){return new Response(`<pre>${A}
|
|
1124
1124
|
${A.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),console.log(`
|
|
1125
1125
|
${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
|
|
1126
1126
|
${B.bright}\u2192 ${B.cyan}http://localhost:${j}/${B.reset}`),console.log(`
|
|
@@ -1607,12 +1607,12 @@ ${O.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),con
|
|
|
1607
1607
|
${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
|
|
1608
1608
|
${B.bright}\u2192 ${B.cyan}http://localhost:${U}/${B.reset}`),console.log(`
|
|
1609
1609
|
${B.yellow}Routes:${B.reset}`);let z=new Set(W.map((O)=>O.routeTemplate)),j=Object.entries(G).filter(([O])=>!z.has(O)).sort(([O],[L])=>O.localeCompare(L)).map(([O,L])=>({route:O==="/"?"/":O,filePath:Q0.relative(process.cwd(),L.filePath),fileType:L.fileType}));for(let O of W){let L=O.routeTemplate.replace(/\[([^\]]+)\]/g,":$1");j.push({route:L,filePath:Q0.relative(process.cwd(),O.filePath),fileType:"stx"})}if(j.sort((O,L)=>O.route.localeCompare(L.route)),j.forEach((O,L)=>{let q=L===j.length-1?"\u2514\u2500 ":"\u251C\u2500 ",A=O.fileType==="md"?`${B.magenta}(markdown)${B.reset}`:"";console.log(` ${B.green}${q}${O.route}${B.reset} \u2192 ${B.bright}${O.filePath}${B.reset} ${A}`)}),console.log(`
|
|
1610
|
-
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(F.url.toString(),()=>{if(Z)P0.watch(J,{recursive:!0}).close();F.stop()}),Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let O=P0.watch(J,{recursive:!0},async(L,H)=>{if(!H)return;if(H.endsWith(".stx")||H.endsWith(".js")||H.endsWith(".ts")||H.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${H}${B.yellow} changed, rebuilding...${B.reset}`),m0.clear(),p0(),await K()});process.on("SIGINT",()=>{O.close(),F.stop(),process.exit(0)})}return!0}function O6($){return String($??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var{serve:N4}=globalThis.Bun;import J0 from"fs";import g from"path";async function M6($){try{return Z5(await Bun.file($).text())}catch{return}}function e$($){let X=Bun.file($),Q=g.extname($).toLowerCase(),Z={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},J=[".js",".css",".json"].includes(Q)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Z[Q]||"application/octet-stream",...J}})}async function M4($=".",X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=g.resolve($),{loadStxConfig:K}=await import("./chunk-60c5bvke.js"),_=await K(W),U=_.root&&_.root!=="."?g.join(W,_.root):W,F=X.pagesDir||_.pagesDir||"pages",z=g.join(U,F);if(!J0.existsSync(z))return console.error(`${B.red}Error: No '${F}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${z}${B.reset}`),console.log(`${B.dim}Run stx dev from the app directory, pass it as an argument (stx dev <dir>),${B.reset}`),console.log(`${B.dim}point at another directory with --pages <dir>, or set pagesDir in stx.config.ts.${B.reset}`),console.log(`${B.dim}Starting fresh? Create ${F}/index.stx for the homepage.${B.reset}`),!1;let j=X5(U,{pagesDir:F});if(j.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${z}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${j.length}${B.blue} routes${B.reset}`);let O=_?._pluginPageDirs||[],L=[];for(let{dir:D,prefix:T}of O)if(J0.existsSync(D)){let x=X5(g.dirname(D),{pagesDir:g.basename(D)});for(let S of x){let b=T==="/"?S.pattern:`${T}${S.pattern==="/"?"":S.pattern}`;L.push({route:{...S,pattern:b},prefix:T})}if(x.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${x.length}${B.blue} routes at ${B.cyan}${T}${B.reset}`)}let H=new Map,q=null,A=null;if(X.stxOptions?.shell!==!1){if(A=await y6(W,X.stxOptions?.shell),A){if(q=await Q5(A,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${g.relative(W,A)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}R6(),await D6(W);let N=I6();if(N.length>0)console.log(`${B.blue}Loaded ${B.bright}${N.length}${B.blue} middleware: ${B.dim}${N.join(", ")}${B.reset}`);let V={},M=null;try{let{loadStxConfig:D}=await import("./chunk-60c5bvke.js"),T=await D(W);if(T?.apiRouter)M=T?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(T?.apiRoutes){V=T.apiRoutes;let x=Object.keys(V).length;if(x>0)console.log(`${B.blue}Loaded ${B.bright}${x} API route${x>1?"s":""}${B.reset}`)}if(T?.broadcasting?.enabled)try{let{startBroadcasting:x,loadChannels:S}=await import("./chunk-a2qghr2x.js"),b=T.broadcasting;await x(b);let _0=b.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${_0}/ws${B.reset}`);let K0=g.join(process.cwd(),"channels.ts");if(J0.existsSync(K0))try{let C0=await S(K0);console.log(`${B.blue}Loaded ${B.bright}${C0} broadcast channel${C0!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(C0){console.warn(`${B.yellow}Failed to load channels.ts: ${C0.message}${B.reset}`)}}catch(x){console.warn(`${B.yellow}Broadcasting failed to start: ${x.message}${B.reset}`)}}catch{}let R=S0(W,"output");J0.mkdirSync(R,{recursive:!0});let w=new Map,C=new Set,I=async(D)=>{let T=V6(z,D);if(!T)return null;try{let x=await Bun.build({entrypoints:[T],outdir:R,plugins:[X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!x.success)return null;let S=x.outputs.find((b)=>b.path.endsWith(".html"));if(!S)return null;return await Bun.file(S.path).text()}catch{return null}},E=new Map,h=async(D,T)=>{try{let{processDirectives:x,extractVariables:S,defaultConfig:b,loadStxConfig:_0,injectRouterScript:K0}=await import("./chunk-60c5bvke.js"),{checkCache:C0,cacheTemplate:u$,readFileCached:r,templateCache:f1}=await import("./chunk-v4f08c2r.js"),h1=await _0(W),k=(d)=>{if(!d)return d;if(g.isAbsolute(d))return d;return g.resolve(W,d)},y={...b,...h1,...X.stxOptions,autoShell:!0};if(X.debugDirectives)y.debug=!0;y.partialsDir=k(y.partialsDir),y.componentsDir=k(y.componentsDir),y.layoutsDir=k(y.layoutsDir),y.storesDir=k(y.storesDir||"stores"),y.cachePath=k(y.cachePath)??S0(W,"cache");let m=!T&&!X.profile,c=y.cache!==!1;if(c&&m){let d=f1.get(D.filePath);if(d)try{if((await J0.promises.stat(D.filePath)).mtime.getTime()<=d.mtime){let z0=!0;for(let $0 of d.dependencies){if(!J0.existsSync($0)){z0=!1;break}if((await J0.promises.stat($0)).mtime.getTime()>d.mtime){z0=!1;break}}if(z0){let $0=d.output;if(q)$0=L$($0,{preserveHead:!0});let j1=E.get(D.filePath);return{route:D,content:$0,status:j1?.status??await M6(D.filePath),headers:j1?.headers}}}}catch{}let L0=await C0(D.filePath,y);if(L0){let F0=L0;if(q)F0=L$(F0,{preserveHead:!0});let z0=E.get(D.filePath);return{route:D,content:F0,status:z0?.status??await M6(D.filePath),headers:z0?.headers}}}let s=c?await r(D.filePath):await Bun.file(D.filePath).text(),v=Z5(s),{classifyAllScripts:U0}=await import("./chunk-60c5bvke.js"),B0=U0(s),a=B0.server.map((d)=>d.content),e=s;for(let d of B0.server)e=e.replace(d.fullTag,"");let n={__filename:D.filePath,__dirname:g.dirname(D.filePath),params:T??{},__stx_runtime_head:{}};for(let d of a)try{await S(d,n,D.filePath)}catch(L0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",D.filePath,L0?.message||L0)}let r0=new Set,N0;if(X.profile){let d=performance.now();N0=await x(e,n,D.filePath,y,r0);let L0=performance.now()-d,F0=g.relative(W,D.filePath)||D.filePath;console.log(`[stx:profile] ${F0} \u2192 ${L0.toFixed(2)}ms`)}else N0=await x(e,n,D.filePath,y,r0);if(!q)N0=await K0(N0,{router:y.router});{let{interpolateScriptExpressions:d}=await import("./chunk-d34fnbpc.js");N0=N0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(L0,F0,z0)=>{if(!/function\s+__stx_setup_/.test(z0))return L0;return`<script${F0}>${d(z0,n)}</script>`})}if(q)N0=L$(N0,{preserveHead:!0});if(c&&m)await u$(D.filePath,N0,r0,y);let{extractStreamBoundaries:t7}=await import("./chunk-f8b83xbw.js"),s0=t7(n),z1=n.__streamTemplates;if(z1&&typeof z1==="object"&&Object.keys(z1).length>0){let d=n.streamBoundaries||{},L0={...y,autoShell:!1},F0=Object.keys(z1).map(($0)=>({id:$0,render:async()=>{let j1=typeof d[$0]==="function"?await d[$0]():void 0;return x(z1[$0],{...n,$boundary:j1},D.filePath,L0,new Set)}})),z0=new Set(F0.map(($0)=>$0.id));s0=[...(s0||[]).filter(($0)=>!z0.has($0.id)),...F0]}if(s0&&s0.length>0)C.add(D.pattern);else s0=void 0;let u5=N1(n),m5=M1(n);if(m)E.set(D.filePath,{status:u5,headers:m5});return{route:D,content:N0,status:u5??v,headers:m5,boundaries:s0}}catch(x){return console.error(`${B.red}Error building ${B.bright}${D.pattern}${B.reset}:`,x),null}},u=8,t=async()=>{w.clear(),H.clear();for(let D=0;D<j.length;D+=u){let T=j.slice(D,D+u),x=await Promise.all(T.map((S)=>h(S)));for(let S of x)if(S)w.set(S.route.pattern,S)}for(let D=0;D<L.length;D+=u){let T=L.slice(D,D+u),x=await Promise.all(T.map(({route:S})=>h(S)));for(let S of x)if(S)H.set(S.route.pattern,S)}return w.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await t())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await W$(W);let W0=Q;try{if(W0=await k0(Q),W0!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${W0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let D=X.hmrPort||W0+1;J=X$({wsPort:D,verbose:!1}),G=J.start(D)}let v1=(D,T)=>{let S=`<script data-stx-route-params>(function(){var p=${JSON.stringify(T).replace(/</g,"\\u003C").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};window.__stx_rp=p;if(window.stx){window.stx._rp=p;if(window.stx.setRouteParams)window.stx.setRouteParams(p)}})()</script>`;if(D.includes("</head>"))return D.replace("</head>",`${S}</head>`);if(D.includes("<body"))return D.replace(/<body([^>]*)>/,`<body$1>${S}`);return S+D};console.log(`${B.blue}Starting server...${B.reset}`);let g1=N4({port:W0,async fetch(D){let T=new URL(D.url),x=_?.publicDir||"public",S=g.join(W,x,T.pathname),b=g.join(W,T.pathname),_0=g.join(R,T.pathname),[K0,C0,u$]=await Promise.all([J0.promises.stat(S).catch(()=>null),J0.promises.stat(b).catch(()=>null),J0.promises.stat(_0).catch(()=>null)]);if(K0?.isFile())return e$(S);if(C0?.isFile())return e$(b);if(u$?.isFile())return e$(_0);if(T.pathname.startsWith("/_stx/component/")){let k=decodeURIComponent(T.pathname.slice(16));if(k)try{let y=`<${k} />`,m={...buildConfig,autoShell:!1},c=await processDirectives(y,{},g.join(W,"components",`${k}.stx`),m,new Set);return new Response(c,{headers:{"Content-Type":"text/html"}})}catch(y){return new Response(`<div class="stx-async-error">${y.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(T.pathname==="/_stx/img"){let{handleImageRequest:k}=await import("./chunk-f80wwn5x.js"),y=await k(D,{publicDir:g.join(W,x),cacheDir:S0(W,"cache","img")});if(y)return y}if(M)try{let k=await M.handleRequest(D);if(k.status!==404)return k}catch{}if(V[T.pathname])try{return await V[T.pathname](D)}catch(k){return new Response(JSON.stringify({error:k.message}),{status:500,headers:{"Content-Type":"application/json"}})}let r=$5(T.pathname,j);if(r){let k=w.get(r.route.pattern),y=C.has(r.route.pattern);if(r.route.isDynamic&&Object.keys(r.params).length>0||y){let m=await h(r.route,r.params);if(m)k=m}if(k){let m=k.status??200,c=k.headers??{},s=(r.route.filePath?x6(await Bun.file(r.route.filePath).text().catch(()=>"")):null)??{};if(s.validate){if(!await s.validate({params:r.params})){let B0=await I(404);if(B0){let a=B0;if(a=await o(a,W),Y)a=D0(a,G);return new Response(a,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(s.middleware){let U0=w6(T.pathname,r.params,s,T.search),B0=T6(U0,null,D,{isServer:!0}),a=await C6(s.middleware,B0);if(a.redirect){let e=a.redirect.path,n=a.redirect.options.redirectCode||302,r0=new Headers(a.responseHeaders);return r0.set("Location",e),new Response(null,{status:n,headers:r0})}if(a.abort){let{statusCode:e,message:n}=a.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${e}</title></head><body><h1>Error ${e}</h1><p>${n}</p></body></html>`,{status:e,headers:{"Content-Type":"text/html"}})}if(Object.keys(a.state).length>0){let e=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(a.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;k.content=k.content.replace("</head>",`${e}</head>`)}}let v=k.content;if(q&&v6(D)){let U0=k6(v),B0=S6(v),a=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i),e=a?a[1].trim():"";if(Object.keys(r.params).length>0)v=v1(v,r.params);v=await o(v,W);let n=_?.router?.container||"main";return v=g6(v,n),new Response(v,{status:m,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":U0.layout,"X-STX-Layout-Group":U0.group,"X-STX-Runtime":B0?"true":"false",...e&&{"X-STX-Title":encodeURIComponent(e)},[P6]:b6(),...Z1(),"Cache-Control":U$}})}if(q)v=B$(q,v);if(Object.keys(r.params).length>0)v=v1(v,r.params);if(v=await o(v,W),Y)v=D0(v,G);if(X.native)if(v.includes("<head>"))v=v.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else v="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+v;if(X.titlebarHidden)if(v.includes("<head>"))v=v.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else v=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${v}`;if(k.boundaries&&k.boundaries.length>0){let{renderStreamingPage:U0,streamToResponse:B0}=await import("./chunk-f8b83xbw.js");return B0(U0(v,k.boundaries,{timeoutMs:30000}),{status:m,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(v,{status:m,headers:{"Content-Type":"text/html",...Z1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...c}})}}if(L.length>0){let k=L.map((m)=>m.route),y=$5(T.pathname,k);if(y){let m=H.get(y.route.pattern);if(m){let c=m.content;if(q)c=B$(q,c);if(Object.keys(y.params).length>0)c=v1(c,y.params);if(c=await o(c,W),Y)c=D0(c,G);return new Response(c,{status:m.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:m}of O)if(m!=="/"&&T.pathname.startsWith(m)){let c=H.get(m)||H.get(m+"/");if(c){let s=c.content;if(q)s=B$(q,s);if(s=await o(s,W),Y)s=D0(s,G);return new Response(s,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let f1=w.get("/");if(f1){let k=f1.content;if(k=await o(k,W),Y)k=D0(k,G);if(X.native)if(k.includes("<head>"))k=k.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else k="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+k;return new Response(k,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let h1=await I(404);if(h1){let k=h1;if(k=await o(k,W),Y)k=D0(k,G);return new Response(k,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(D){let T=await I(500);if(T)return new Response(T,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${D}
|
|
1610
|
+
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(F.url.toString(),()=>{if(Z)P0.watch(J,{recursive:!0}).close();F.stop()}),Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let O=P0.watch(J,{recursive:!0},async(L,H)=>{if(!H)return;if(H.endsWith(".stx")||H.endsWith(".js")||H.endsWith(".ts")||H.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${H}${B.yellow} changed, rebuilding...${B.reset}`),m0.clear(),p0(),await K()});process.on("SIGINT",()=>{O.close(),F.stop(),process.exit(0)})}return!0}function O6($){return String($??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var{serve:N4}=globalThis.Bun;import J0 from"fs";import g from"path";async function M6($){try{return Z5(await Bun.file($).text())}catch{return}}function e$($){let X=Bun.file($),Q=g.extname($).toLowerCase(),Z={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},J=[".js",".css",".json"].includes(Q)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Z[Q]||"application/octet-stream",...J}})}async function M4($=".",X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=g.resolve($),{loadStxConfig:K}=await import("./chunk-74v15e8z.js"),_=await K(W),U=_.root&&_.root!=="."?g.join(W,_.root):W,F=X.pagesDir||_.pagesDir||"pages",z=g.join(U,F);if(!J0.existsSync(z))return console.error(`${B.red}Error: No '${F}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${z}${B.reset}`),console.log(`${B.dim}Run stx dev from the app directory, pass it as an argument (stx dev <dir>),${B.reset}`),console.log(`${B.dim}point at another directory with --pages <dir>, or set pagesDir in stx.config.ts.${B.reset}`),console.log(`${B.dim}Starting fresh? Create ${F}/index.stx for the homepage.${B.reset}`),!1;let j=X5(U,{pagesDir:F});if(j.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${z}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${j.length}${B.blue} routes${B.reset}`);let O=_?._pluginPageDirs||[],L=[];for(let{dir:D,prefix:T}of O)if(J0.existsSync(D)){let x=X5(g.dirname(D),{pagesDir:g.basename(D)});for(let S of x){let b=T==="/"?S.pattern:`${T}${S.pattern==="/"?"":S.pattern}`;L.push({route:{...S,pattern:b},prefix:T})}if(x.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${x.length}${B.blue} routes at ${B.cyan}${T}${B.reset}`)}let H=new Map,q=null,A=null;if(X.stxOptions?.shell!==!1){if(A=await y6(W,X.stxOptions?.shell),A){if(q=await Q5(A,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${g.relative(W,A)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}R6(),await D6(W);let N=I6();if(N.length>0)console.log(`${B.blue}Loaded ${B.bright}${N.length}${B.blue} middleware: ${B.dim}${N.join(", ")}${B.reset}`);let V={},M=null;try{let{loadStxConfig:D}=await import("./chunk-74v15e8z.js"),T=await D(W);if(T?.apiRouter)M=T?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(T?.apiRoutes){V=T.apiRoutes;let x=Object.keys(V).length;if(x>0)console.log(`${B.blue}Loaded ${B.bright}${x} API route${x>1?"s":""}${B.reset}`)}if(T?.broadcasting?.enabled)try{let{startBroadcasting:x,loadChannels:S}=await import("./chunk-sscwkffs.js"),b=T.broadcasting;await x(b);let _0=b.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${_0}/ws${B.reset}`);let K0=g.join(process.cwd(),"channels.ts");if(J0.existsSync(K0))try{let C0=await S(K0);console.log(`${B.blue}Loaded ${B.bright}${C0} broadcast channel${C0!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(C0){console.warn(`${B.yellow}Failed to load channels.ts: ${C0.message}${B.reset}`)}}catch(x){console.warn(`${B.yellow}Broadcasting failed to start: ${x.message}${B.reset}`)}}catch{}let R=S0(W,"output");J0.mkdirSync(R,{recursive:!0});let w=new Map,C=new Set,I=async(D)=>{let T=V6(z,D);if(!T)return null;try{let x=await Bun.build({entrypoints:[T],outdir:R,plugins:[X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!x.success)return null;let S=x.outputs.find((b)=>b.path.endsWith(".html"));if(!S)return null;return await Bun.file(S.path).text()}catch{return null}},E=new Map,h=async(D,T)=>{try{let{processDirectives:x,extractVariables:S,defaultConfig:b,loadStxConfig:_0,injectRouterScript:K0}=await import("./chunk-74v15e8z.js"),{checkCache:C0,cacheTemplate:u$,readFileCached:r,templateCache:f1}=await import("./chunk-dap191q2.js"),h1=await _0(W),k=(d)=>{if(!d)return d;if(g.isAbsolute(d))return d;return g.resolve(W,d)},y={...b,...h1,...X.stxOptions,autoShell:!0};if(X.debugDirectives)y.debug=!0;y.partialsDir=k(y.partialsDir),y.componentsDir=k(y.componentsDir),y.layoutsDir=k(y.layoutsDir),y.storesDir=k(y.storesDir||"stores"),y.cachePath=k(y.cachePath)??S0(W,"cache");let m=!T&&!X.profile,c=y.cache!==!1;if(c&&m){let d=f1.get(D.filePath);if(d)try{if((await J0.promises.stat(D.filePath)).mtime.getTime()<=d.mtime){let z0=!0;for(let $0 of d.dependencies){if(!J0.existsSync($0)){z0=!1;break}if((await J0.promises.stat($0)).mtime.getTime()>d.mtime){z0=!1;break}}if(z0){let $0=d.output;if(q)$0=L$($0,{preserveHead:!0});let j1=E.get(D.filePath);return{route:D,content:$0,status:j1?.status??await M6(D.filePath),headers:j1?.headers}}}}catch{}let L0=await C0(D.filePath,y);if(L0){let F0=L0;if(q)F0=L$(F0,{preserveHead:!0});let z0=E.get(D.filePath);return{route:D,content:F0,status:z0?.status??await M6(D.filePath),headers:z0?.headers}}}let s=c?await r(D.filePath):await Bun.file(D.filePath).text(),v=Z5(s),{classifyAllScripts:U0}=await import("./chunk-74v15e8z.js"),B0=U0(s),a=B0.server.map((d)=>d.content),e=s;for(let d of B0.server)e=e.replace(d.fullTag,"");let n={__filename:D.filePath,__dirname:g.dirname(D.filePath),params:T??{},__stx_runtime_head:{}};for(let d of a)try{await S(d,n,D.filePath)}catch(L0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",D.filePath,L0?.message||L0)}let r0=new Set,N0;if(X.profile){let d=performance.now();N0=await x(e,n,D.filePath,y,r0);let L0=performance.now()-d,F0=g.relative(W,D.filePath)||D.filePath;console.log(`[stx:profile] ${F0} \u2192 ${L0.toFixed(2)}ms`)}else N0=await x(e,n,D.filePath,y,r0);if(!q)N0=await K0(N0,{router:y.router});{let{interpolateScriptExpressions:d}=await import("./chunk-g9csmj0s.js");N0=N0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(L0,F0,z0)=>{if(!/function\s+__stx_setup_/.test(z0))return L0;return`<script${F0}>${d(z0,n)}</script>`})}if(q)N0=L$(N0,{preserveHead:!0});if(c&&m)await u$(D.filePath,N0,r0,y);let{extractStreamBoundaries:t7}=await import("./chunk-9b22663r.js"),s0=t7(n),z1=n.__streamTemplates;if(z1&&typeof z1==="object"&&Object.keys(z1).length>0){let d=n.streamBoundaries||{},L0={...y,autoShell:!1},F0=Object.keys(z1).map(($0)=>({id:$0,render:async()=>{let j1=typeof d[$0]==="function"?await d[$0]():void 0;return x(z1[$0],{...n,$boundary:j1},D.filePath,L0,new Set)}})),z0=new Set(F0.map(($0)=>$0.id));s0=[...(s0||[]).filter(($0)=>!z0.has($0.id)),...F0]}if(s0&&s0.length>0)C.add(D.pattern);else s0=void 0;let u5=N1(n),m5=M1(n);if(m)E.set(D.filePath,{status:u5,headers:m5});return{route:D,content:N0,status:u5??v,headers:m5,boundaries:s0}}catch(x){return console.error(`${B.red}Error building ${B.bright}${D.pattern}${B.reset}:`,x),null}},u=8,t=async()=>{w.clear(),H.clear();for(let D=0;D<j.length;D+=u){let T=j.slice(D,D+u),x=await Promise.all(T.map((S)=>h(S)));for(let S of x)if(S)w.set(S.route.pattern,S)}for(let D=0;D<L.length;D+=u){let T=L.slice(D,D+u),x=await Promise.all(T.map(({route:S})=>h(S)));for(let S of x)if(S)H.set(S.route.pattern,S)}return w.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await t())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await W$(W);let W0=Q;try{if(W0=await k0(Q),W0!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${W0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let D=X.hmrPort||W0+1;J=X$({wsPort:D,verbose:!1}),G=J.start(D)}let v1=(D,T)=>{let S=`<script data-stx-route-params>(function(){var p=${JSON.stringify(T).replace(/</g,"\\u003C").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};window.__stx_rp=p;if(window.stx){window.stx._rp=p;if(window.stx.setRouteParams)window.stx.setRouteParams(p)}})()</script>`;if(D.includes("</head>"))return D.replace("</head>",`${S}</head>`);if(D.includes("<body"))return D.replace(/<body([^>]*)>/,`<body$1>${S}`);return S+D};console.log(`${B.blue}Starting server...${B.reset}`);let g1=N4({port:W0,async fetch(D){let T=new URL(D.url),x=_?.publicDir||"public",S=g.join(W,x,T.pathname),b=g.join(W,T.pathname),_0=g.join(R,T.pathname),[K0,C0,u$]=await Promise.all([J0.promises.stat(S).catch(()=>null),J0.promises.stat(b).catch(()=>null),J0.promises.stat(_0).catch(()=>null)]);if(K0?.isFile())return e$(S);if(C0?.isFile())return e$(b);if(u$?.isFile())return e$(_0);if(T.pathname.startsWith("/_stx/component/")){let k=decodeURIComponent(T.pathname.slice(16));if(k)try{let y=`<${k} />`,m={...buildConfig,autoShell:!1},c=await processDirectives(y,{},g.join(W,"components",`${k}.stx`),m,new Set);return new Response(c,{headers:{"Content-Type":"text/html"}})}catch(y){return new Response(`<div class="stx-async-error">${y.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(T.pathname==="/_stx/img"){let{handleImageRequest:k}=await import("./chunk-jegt35zh.js"),y=await k(D,{publicDir:g.join(W,x),cacheDir:S0(W,"cache","img")});if(y)return y}if(M)try{let k=await M.handleRequest(D);if(k.status!==404)return k}catch{}if(V[T.pathname])try{return await V[T.pathname](D)}catch(k){return new Response(JSON.stringify({error:k.message}),{status:500,headers:{"Content-Type":"application/json"}})}let r=$5(T.pathname,j);if(r){let k=w.get(r.route.pattern),y=C.has(r.route.pattern);if(r.route.isDynamic&&Object.keys(r.params).length>0||y){let m=await h(r.route,r.params);if(m)k=m}if(k){let m=k.status??200,c=k.headers??{},s=(r.route.filePath?x6(await Bun.file(r.route.filePath).text().catch(()=>"")):null)??{};if(s.validate){if(!await s.validate({params:r.params})){let B0=await I(404);if(B0){let a=B0;if(a=await o(a,W),Y)a=D0(a,G);return new Response(a,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(s.middleware){let U0=w6(T.pathname,r.params,s,T.search),B0=T6(U0,null,D,{isServer:!0}),a=await C6(s.middleware,B0);if(a.redirect){let e=a.redirect.path,n=a.redirect.options.redirectCode||302,r0=new Headers(a.responseHeaders);return r0.set("Location",e),new Response(null,{status:n,headers:r0})}if(a.abort){let{statusCode:e,message:n}=a.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${e}</title></head><body><h1>Error ${e}</h1><p>${n}</p></body></html>`,{status:e,headers:{"Content-Type":"text/html"}})}if(Object.keys(a.state).length>0){let e=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(a.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;k.content=k.content.replace("</head>",`${e}</head>`)}}let v=k.content;if(q&&v6(D)){let U0=k6(v),B0=S6(v),a=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i),e=a?a[1].trim():"";if(Object.keys(r.params).length>0)v=v1(v,r.params);v=await o(v,W);let n=_?.router?.container||"main";return v=g6(v,n),new Response(v,{status:m,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":U0.layout,"X-STX-Layout-Group":U0.group,"X-STX-Runtime":B0?"true":"false",...e&&{"X-STX-Title":encodeURIComponent(e)},[P6]:b6(),...Z1(),"Cache-Control":U$}})}if(q)v=B$(q,v);if(Object.keys(r.params).length>0)v=v1(v,r.params);if(v=await o(v,W),Y)v=D0(v,G);if(X.native)if(v.includes("<head>"))v=v.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else v="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+v;if(X.titlebarHidden)if(v.includes("<head>"))v=v.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else v=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${v}`;if(k.boundaries&&k.boundaries.length>0){let{renderStreamingPage:U0,streamToResponse:B0}=await import("./chunk-9b22663r.js");return B0(U0(v,k.boundaries,{timeoutMs:30000}),{status:m,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(v,{status:m,headers:{"Content-Type":"text/html",...Z1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...c}})}}if(L.length>0){let k=L.map((m)=>m.route),y=$5(T.pathname,k);if(y){let m=H.get(y.route.pattern);if(m){let c=m.content;if(q)c=B$(q,c);if(Object.keys(y.params).length>0)c=v1(c,y.params);if(c=await o(c,W),Y)c=D0(c,G);return new Response(c,{status:m.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:m}of O)if(m!=="/"&&T.pathname.startsWith(m)){let c=H.get(m)||H.get(m+"/");if(c){let s=c.content;if(q)s=B$(q,s);if(s=await o(s,W),Y)s=D0(s,G);return new Response(s,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let f1=w.get("/");if(f1){let k=f1.content;if(k=await o(k,W),Y)k=D0(k,G);if(X.native)if(k.includes("<head>"))k=k.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else k="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+k;return new Response(k,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let h1=await I(404);if(h1){let k=h1;if(k=await o(k,W),Y)k=D0(k,G);return new Response(k,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(D){let T=await I(500);if(T)return new Response(T,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${D}
|
|
1611
1611
|
${D.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});if(console.clear(),console.log(`
|
|
1612
1612
|
${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
|
|
1613
1613
|
${B.bright}\u2192 ${B.cyan}http://localhost:${W0}/${B.reset}`),Y)console.log(`${B.dim} HMR: ws://localhost:${G}${B.reset}`);console.log(`
|
|
1614
1614
|
${B.yellow}Routes:${B.reset}`);let a0=[...E6(j,W)];for(let{route:D}of L)a0.push(`${D.pattern}`);if(a0.forEach((D,T)=>{let S=T===a0.length-1?"\u2514\u2500 ":"\u251C\u2500 ";console.log(` ${B.green}${S}${B.reset}${D}`)}),console.log(`
|
|
1615
|
-
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(g1.url.toString(),()=>{if(J)A1();g1.stop()}),X.native){let D,T=g.join(z,"index.stx");if(J0.existsSync(T)){let S=await Bun.file(T).text();D=o1(S)}let x=_?.app?.window??{};await t0(W0,{title:_?.app?.head?.title||g.basename(W)||"stx App",width:x.width,height:x.height,darkMode:x.darkMode,hotReload:x.hotReload,titlebarHidden:x.titlebarHidden??X.titlebarHidden===!0,nativeSidebar:!!D,sidebarConfig:D})}if(Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let D=(S)=>{return S.startsWith("public/")||S.startsWith("public\\")},T=(S)=>{let b=S.toLowerCase();return b.endsWith(".stx")||b.endsWith(".html")||b.endsWith(".md")},x=J0.watch(W,{recursive:!0},async(S,b)=>{if(!b||$$(b))return;if(e1(b))if(D(b)){if(console.log(`${B.cyan}${b} changed${B.reset}`),Y&&J)J.reload(b)}else if(T(b)){console.log(`${B.yellow}${b} changed, rebuilding...${B.reset}`),m0.clear(),p0();try{let{invalidateFileCache:_0,templateCache:K0}=await import("./chunk-
|
|
1615
|
+
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(g1.url.toString(),()=>{if(J)A1();g1.stop()}),X.native){let D,T=g.join(z,"index.stx");if(J0.existsSync(T)){let S=await Bun.file(T).text();D=o1(S)}let x=_?.app?.window??{};await t0(W0,{title:_?.app?.head?.title||g.basename(W)||"stx App",width:x.width,height:x.height,darkMode:x.darkMode,hotReload:x.hotReload,titlebarHidden:x.titlebarHidden??X.titlebarHidden===!0,nativeSidebar:!!D,sidebarConfig:D})}if(Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let D=(S)=>{return S.startsWith("public/")||S.startsWith("public\\")},T=(S)=>{let b=S.toLowerCase();return b.endsWith(".stx")||b.endsWith(".html")||b.endsWith(".md")},x=J0.watch(W,{recursive:!0},async(S,b)=>{if(!b||$$(b))return;if(e1(b))if(D(b)){if(console.log(`${B.cyan}${b} changed${B.reset}`),Y&&J)J.reload(b)}else if(T(b)){console.log(`${B.yellow}${b} changed, rebuilding...${B.reset}`),m0.clear(),p0();try{let{invalidateFileCache:_0,templateCache:K0}=await import("./chunk-dap191q2.js");_0(g.resolve(W,b)),K0.delete(g.resolve(W,b))}catch{}if(A&&b){if(g.resolve(W,b)===A||g.basename(A)===b){let K0=await Q5(A,X.stxOptions||{});if(K0)q=K0}}if(await t(),await K$(W),Y&&J)J.reload(b)}else{console.log(`${B.yellow}${b} changed, rebuilding...${B.reset}`),m0.clear(),p0();try{let{invalidateFileCache:_0,templateCache:K0}=await import("./chunk-dap191q2.js");_0(g.resolve(W,b)),K0.delete(g.resolve(W,b))}catch{}if(await t(),Y&&J)J.reload(b)}else if(t1(b)){if(console.log(`${B.cyan}CSS ${b} changed${B.reset}`),Y&&J)J.updateCss(b)}});process.on("SIGINT",()=>{if(x.close(),J)A1();g1.stop(),process.exit(0)})}return!0}var P={enabled:!1,components:new Map,stores:new Map,events:[],performance:[],selectedComponent:null,selectedStore:null,maxEvents:1000,maxPerformance:500};function V4($={}){if(typeof window>"u")return;P.enabled=!0,P.maxEvents=$.maxEvents||1000,P.maxPerformance=$.maxPerformance||500,window.__STX_DEVTOOLS__={getState:()=>P,getComponents:()=>Array.from(P.components.values()),getComponent:(X)=>P.components.get(X),getStores:()=>Array.from(P.stores.values()),getStore:(X)=>P.stores.get(X),getEvents:()=>P.events,getPerformance:()=>P.performance,selectComponent:(X)=>J5(X),selectStore:(X)=>R4(X),inspectElement:(X)=>I4(X),highlightComponent:(X)=>m6(X),clearHighlight:()=>p6(),logComponentTree:()=>D4(),logStoreState:(X)=>w4(X),timeTravel:(X,Q)=>T4(X,Q)},k4(),C4(),console.log("%c[STX DevTools] Enabled","color: #10b981; font-weight: bold;")}function E4(){P.enabled=!1,delete window.__STX_DEVTOOLS__;let $=document.getElementById("stx-devtools-panel");if($)$.remove();console.log("%c[STX DevTools] Disabled","color: #ef4444;")}function f6($){if(!P.enabled)return;let X=P.components.get($);if(X){if(X.parentId){let Q=P.components.get(X.parentId);if(Q)Q.children=Q.children.filter((Z)=>Z!==$)}P.components.delete($),Y5({timestamp:Date.now(),type:"component:unmounted",componentId:$,payload:{name:X.name}})}}function d6($,X,Q={},Z=[]){if(!P.enabled)return;let Y={id:$,state:X,getters:Q,actions:Z,history:[{timestamp:Date.now(),type:"state",name:"__init__",newValue:X}]};P.stores.set($,Y),Y5({timestamp:Date.now(),type:"store:registered",payload:{id:$,state:X}})}function u6($,X,Q,Z,Y="state"){if(!P.enabled)return;let J=P.stores.get($);if(J){let G={timestamp:Date.now(),type:Y,name:X,oldValue:Q,newValue:Z,stack:Error().stack};if(J.history.push(G),J.history.length>100)J.history=J.history.slice(-100);if(Y==="state")J.state={...J.state,[X]:Z};Y5({timestamp:Date.now(),type:`store:${Y}`,payload:{storeId:$,name:X,oldValue:Q,newValue:Z}})}}function Y5($){if(!P.enabled)return;if(P.events.push($),P.events.length>P.maxEvents)P.events=P.events.slice(-P.maxEvents);if(typeof window<"u")window.dispatchEvent(new CustomEvent("stx:devtools:event",{detail:$}))}function J5($){P.selectedComponent=$;let X=P.components.get($);if(X)m6($),console.log("%c[STX DevTools] Selected component:","color: #3b82f6;",X);return X}function R4($){P.selectedStore=$;let X=P.stores.get($);if(X)console.log("%c[STX DevTools] Selected store:","color: #8b5cf6;",X);return X}function I4($){let X=$;while(X){let Q=X.getAttribute("data-stx-component-id");if(Q)return J5(Q);X=X.parentElement}console.log("%c[STX DevTools] No component found for element","color: #f59e0b;");return}function m6($){p6();let X=P.components.get($);if(X?.element){let Q=document.createElement("div");Q.id="stx-devtools-highlight",Q.style.cssText=`
|
|
1616
1616
|
position: absolute;
|
|
1617
1617
|
background: rgba(59, 130, 246, 0.2);
|
|
1618
1618
|
border: 2px solid #3b82f6;
|
|
@@ -2881,9 +2881,9 @@ describe('Example', () => {
|
|
|
2881
2881
|
</footer>
|
|
2882
2882
|
@yield('scripts')
|
|
2883
2883
|
</body>
|
|
2884
|
-
</html>`}function iX(){return"<!-- Hero section -->"}function aX(){return"<!-- Features -->"}function rX(){return"<!-- Pricing -->"}function sX(){return"<!-- Button -->"}function C1($){if(!T1($))L5($,{recursive:!0})}function nX(){if(T1("bun.lockb"))return"bun";if(T1("pnpm-lock.yaml"))return"pnpm";if(T1("yarn.lock"))return"yarn";return"bun"}function F5($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toUpperCase())}function oX($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toLowerCase())}function c0($){return $.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}var{serve:tX}=globalThis.Bun;import k1 from"fs";import y0 from"path";function p2($,X=200,Q={}){return new Response($,{status:X,headers:{"Content-Type":"text/html; charset=utf-8",...Q}})}async function J8($){let{loadStxConfig:X}=await import("./chunk-
|
|
2884
|
+
</html>`}function iX(){return"<!-- Hero section -->"}function aX(){return"<!-- Features -->"}function rX(){return"<!-- Pricing -->"}function sX(){return"<!-- Button -->"}function C1($){if(!T1($))L5($,{recursive:!0})}function nX(){if(T1("bun.lockb"))return"bun";if(T1("pnpm-lock.yaml"))return"pnpm";if(T1("yarn.lock"))return"yarn";return"bun"}function F5($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toUpperCase())}function oX($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toLowerCase())}function c0($){return $.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}var{serve:tX}=globalThis.Bun;import k1 from"fs";import y0 from"path";function p2($,X=200,Q={}){return new Response($,{status:X,headers:{"Content-Type":"text/html; charset=utf-8",...Q}})}async function J8($){let{loadStxConfig:X}=await import("./chunk-ydrz60kr.js");return{...await X($.configDir??process.cwd()).catch(()=>({})),...$.stxOptions??{}}}async function eX($={}){let{port:X=3000,root:Q=".",watch:Z=!0,onRequest:Y,routes:J={},middleware:G=[],on404:W,onError:K}=$,_=y0.resolve(Q),U=await J8($),F=new Map;async function z(A){let N=k1.statSync(A),V=`${A}:${N.mtimeMs}`,M=F.get(V);if(M)return{content:M.content,status:M.status,headers:M.headers};for(let T of F.keys())if(T.startsWith(`${A}:`)&&T!==V)F.delete(T);let R=await Bun.file(A).text(),w=R,C=Z$(R);if(C)w=C.content.trim();let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,E=[],h=[],u;while((u=I.exec(R))!==null){let T=u[1],x=u[2],S=u[0];if(T.includes("server"))h.push(x);else E.push(S)}let t=R.match(/<style\b[^>]*>[\s\S]*?<\/style>/gi)||[],d5=w.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,""),W0={__filename:A,__dirname:y0.dirname(A)};for(let T of h)await j0(T,W0,A);let q0=await O0(d5,W0,A,U,new Set);if(t.length>0){let T=t.join(`
|
|
2885
2885
|
`);if(q0.match(/(<\/head>)/i))q0=q0.replace(/(<\/head>)/i,`${T}
|
|
2886
|
-
$1`)}if(E.length>0){let{interpolateScriptsInTemplate:T}=await import("./chunk-
|
|
2886
|
+
$1`)}if(E.length>0){let{interpolateScriptsInTemplate:T}=await import("./chunk-g9csmj0s.js"),x=T(E.join(`
|
|
2887
2887
|
`),W0);if(q0.match(/(<\/body>)/i))q0=q0.replace(/(<\/body>)/i,`${x}
|
|
2888
2888
|
$1`);else q0+=`
|
|
2889
2889
|
${x}`}let a0=N1(W0),D=M1(W0);return F.set(V,{content:q0,mtime:N.mtimeMs,status:a0,headers:D}),{content:q0,status:a0,headers:D}}async function j(A){let N=k1.statSync(A),V=`${A}:${N.mtimeMs}`,M=F.get(V);if(M)return M.content;let{content:R}=await V0(A,U);return F.set(V,{content:R,mtime:N.mtimeMs}),R}function O(A){let N=A.startsWith("/")?A.slice(1):A,V=[N,`${N}.stx`,`${N}.md`,`${N}.html`,y0.join(N,"index.stx"),y0.join(N,"index.md"),y0.join(N,"index.html")];for(let M of V){let R=y0.join(_,M);if(k1.existsSync(R)&&k1.statSync(R).isFile())return R}return null}async function L(A){let N=new URL(A.url),V=async()=>{if(J[N.pathname])return await J[N.pathname](A);if(Y){let R=await Y(A);if(R)return R}let M=O(N.pathname);if(!M){if(W)return await W(A);return new Response("Not Found",{status:404})}try{let R,w="text/html",C,I;if(M.endsWith(".stx")){let E=await z(M);R=E.content,C=E.status,I=E.headers}else if(M.endsWith(".md"))R=await j(M);else if(M.endsWith(".html"))R=await Bun.file(M).text();else if(M.endsWith(".css"))R=await Bun.file(M).text(),w="text/css";else if(M.endsWith(".js"))R=await Bun.file(M).text(),w="text/javascript";else if(M.endsWith(".json"))R=await Bun.file(M).text(),w="application/json";else return new Response(Bun.file(M));return new Response(R,{status:C??200,headers:{"Content-Type":w,...I}})}catch(R){if(K)return await K(R,A);let w=R instanceof Error?R.message:String(R),I=U?.debug===!0?`<h1>Error</h1><pre>${w}
|
|
@@ -4315,7 +4315,7 @@ else {
|
|
|
4315
4315
|
\u26A0\uFE0F Built ${Q.views.length} views with ${Q.errors.length} errors`);return Q}function Z9($,X){let Q=V$.watch($.viewsDir,{recursive:!0},async(Z,Y)=>{if(!Y)return;if(Y.endsWith(".stx")||Y.endsWith(".ts")||Y.endsWith(".js")){if($.debug)console.log(`
|
|
4316
4316
|
File changed: ${Y}, rebuilding...`);let J=await VZ($);X?.(J)}});return{close:()=>Q.close()}}async function Y9($,X={},Q={}){let Z={...Q,skipDefaultSeoTags:!0,skipSignalsRuntime:!0},Y=await V7($,X,Z);Y=await EZ(Y),Y=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Y=Y.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,""),Y=Y.replace(/<!--\s*stx SEO Tags\s*-->/gi,""),Y=Y.replace(/\n\s*\n\s*\n/g,`
|
|
4317
4317
|
|
|
4318
|
-
`).trim();let J=IZ(Y);return{html:Y,text:J}}async function EZ($){try{let{generateCss:X,extractClassNames:Q}=await import("./chunk-
|
|
4318
|
+
`).trim();let J=IZ(Y);return{html:Y,text:J}}async function EZ($){try{let{generateCss:X,extractClassNames:Q}=await import("./chunk-2tk1zkrz.js");if(Q($).size===0)return $;let Y=await X($);if(!Y)return $;let J=RZ(Y);if(J.size===0)return $;return $.replace(/(<[a-z][a-z0-9]*)((?:\s+[a-z][a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s+)class\s*=\s*"([^"]*)"((?:\s+[a-z][a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?>)/gi,(G,W,K,_,U,F)=>{let z=_.split(/\s+/).filter(Boolean),j=[];for(let q of z){let A=J.get(q);if(A)j.push(A)}if(j.length===0)return`${W}${K}class="${_}"${U}${F}`;let O=j.join("; "),H=`${K}${U}`.match(/style\s*=\s*"([^"]*)"/);if(H){let q=`${O}; ${H[1]}`,A=K.replace(/style\s*=\s*"[^"]*"/,`style="${q}"`),N=U.replace(/style\s*=\s*"[^"]*"/,`style="${q}"`);return`${W}${A}class="${_}"${N}${F}`}return`${W}${K}class="${_}" style="${O}"${U}${F}`})}catch{return $}}function RZ($){let X=new Map,Q=/\.([a-zA-Z0-9_-]+(?:\\:[a-zA-Z0-9_-]+)*)\s*\{([^}]+)\}/g,Z=Q.exec($);while(Z!==null){let Y=Z[1].replace(/\\/g,""),J=Z[2].split(";").map((G)=>G.trim()).filter(Boolean).join("; ");if(J)X.set(Y,J);Z=Q.exec($)}return X}function IZ($){return $.replace(/<br\s*\/?>/gi,`
|
|
4319
4319
|
`).replace(/<\/(p|div|h[1-6]|li|tr)>/gi,`
|
|
4320
4320
|
`).replace(/<\/td>/gi,"\t").replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/©/g,"(c)").replace(/·/g,"-").replace(/\n\s*\n\s*\n/g,`
|
|
4321
4321
|
|
|
@@ -4450,7 +4450,7 @@ ${R}`}function Z0($){return $.replace(/&/g,"&").replace(/"/g,""").repla
|
|
|
4450
4450
|
`;let Q=$.sitemap!==!1?`Sitemap: ${$.url.replace(/\/$/,"")}/sitemap.xml
|
|
4451
4451
|
`:"";if(X==="disallow")return["User-agent: *","Disallow: /","",Q].filter(Boolean).join(`
|
|
4452
4452
|
`);return["User-agent: *","Allow: /","",Q].filter(Boolean).join(`
|
|
4453
|
-
`)}var F1=null;async function JY(){if(F1!==null)return F1;try{let $=await import("./chunk-
|
|
4453
|
+
`)}var F1=null;async function JY(){if(F1!==null)return F1;try{let $=await import("./chunk-dgrt76d2.js");if(typeof $.getRouterScript==="function")F1=$.getRouterScript();else F1=""}catch{F1=""}return F1}async function b5($,X){let Q=await JY();if(!Q)return $;let Z={interceptAllLinks:!0,container:"main",...X},J=`${`<script>window.__stxRouterConfig=${JSON.stringify(Z)};</script>
|
|
4454
4454
|
`}<script>${Q}</script>`;if(/<\/body>/i.test($))return $.replace(/<\/body>/i,`${J}
|
|
4455
4455
|
</body>`);return`${$}
|
|
4456
4456
|
${J}`}var GY=`window.__stxThemeIcon=function(isDark){try{var want=isDark?'dark':'light';var pick=document.querySelector('link[rel~="icon"][media*="prefers-color-scheme: '+want+'"]');if(!pick)return;var live=document.querySelector('link[rel~="icon"]:not([media])');if(!live){live=document.createElement('link');live.setAttribute('rel','icon');document.head.appendChild(live)}if(pick.type)live.setAttribute('type',pick.type);var href=pick.getAttribute('href');if(live.getAttribute('href')!==href)live.setAttribute('href',href)}catch(e){}};`,WY=($,X,Q,Z)=>`(function(){${GY}function read(){try{var k=${JSON.stringify(X)};var t=localStorage.getItem(k);return t===null?(${JSON.stringify($)}==='dark'||(${JSON.stringify($)}==='auto'&&window.matchMedia('(prefers-color-scheme: dark)').matches)):t==='dark'}catch(e){return ${JSON.stringify($)}==='dark'}}function apply(){var isDark=read();var html=document.documentElement;html.classList[isDark?'add':'remove']('dark');var color=isDark?${JSON.stringify(Z)}:${JSON.stringify(Q)};if(!document.head)return;var tc=document.querySelector('meta[name="theme-color"]:not([media])');if(!tc){tc=document.createElement('meta');tc.setAttribute('name','theme-color');tc.setAttribute('data-stx-theme-meta','1')}tc.setAttribute('content',color);if(tc!==document.head.firstChild){document.head.insertBefore(tc,document.head.firstChild)}if(window.__stxThemeIcon)window.__stxThemeIcon(isDark)}apply();window.addEventListener('stx:navigate',apply);window.addEventListener('popstate',apply)})();`,KY=($,X,Q)=>`document.addEventListener('click',function(e){var t=e.target&&e.target.closest&&e.target.closest('#theme-toggle');if(!t)return;var html=document.documentElement;var isDark=html.classList.toggle('dark');try{localStorage.setItem(${JSON.stringify($)},isDark?'dark':'light')}catch(e){}var tc=document.querySelector('meta[name="theme-color"]:not([media])');if(tc)tc.setAttribute('content',isDark?${JSON.stringify(Q)}:${JSON.stringify(X)});if(window.__stxThemeIcon)window.__stxThemeIcon(isDark)});`;function C$($,X){if(X.theme===!1)return $;let Q=$.includes(g7),Z=typeof X.theme==="object"&&X.theme!==null?X.theme:{},Y=Z.default??"dark",J=Z.storageKey??"theme",G=Z.colors?.light??"#ffffff",W=Z.colors?.dark??"#000000";if(Y==="dark"&&!Q){if(!/<html\b[^>]*\bclass=/.test($))$=$.replace(/<html\b([^>]*)>/i,'<html$1 class="dark">');else if(!/<html\b[^>]*\bclass="[^"]*\bdark\b/.test($))$=$.replace(/<html\b([^>]*\bclass=")([^"]*)(")/i,"<html$1$2 dark$3")}if(!$.includes("data-stx-theme-meta")&&/<head\b[^>]*>/i.test($)){let K=['<meta name="color-scheme" content="dark light" data-stx-theme-meta="1">',`<meta name="theme-color" media="(prefers-color-scheme: light)" content="${G}" data-stx-theme-meta="1">`,`<meta name="theme-color" media="(prefers-color-scheme: dark)" content="${W}" data-stx-theme-meta="1">`].join(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Yu as y}from"./chunk-b6ej2fdf.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-css="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
|
|
3
3
|
`);return C.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...M.map((v)=>` '${v}': true`)," }","}","","export {}",""),C.join(`
|
|
4
4
|
`)}function HM(M,C){if(!M)return[];let v=F.isAbsolute(M)?M:F.resolve(process.cwd(),M),q=f(v),g=c(q),j=F.join(C,h);try{if(Z.existsSync(j)&&Z.readFileSync(j,"utf8")===g)return q;Z.mkdirSync(C,{recursive:!0}),Z.writeFileSync(j,g)}catch{}return q}
|
|
5
5
|
export{Y as wk,_ as xk,a as yk,s as zk,h as Ak,f as Bk,c as Ck,HM as Dk};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$ as ul,$a as on,$b as Go,$c as Gp,$d as Gq,A as ek,Aa as ym,Ab as _n,Ac as fp,Ad as fq,Ae as lr,B as fk,Ba as zm,Bb as $n,Bc as gp,Bd as gq,Be as mr,C as gk,Ca as Mm,Cb as ao,Cc as hp,Cd as hq,Ce as nr,D as hk,Da as Nm,Db as bo,Dc as ip,Dd as iq,De as or,E as Zk,Ea as Om,Eb as co,Ec as jp,Ed as jq,Ee as pr,F as _k,Fa as Pm,Fb as eo,Fc as kp,Fd as kq,Fe as qr,G as $k,Ga as Qm,Gb as fo,Gc as lp,Gd as lq,Ge as rr,H as al,Ha as Rm,Hb as go,Hc as mp,Hd as mq,He as sr,I as bl,Ia as Vm,Ib as ho,Ic as np,Id as nq,Ie as tr,J as cl,Ja as Wm,Jb as io,Jc as op,Jd as oq,Je as ur,K as dl,Ka as Xm,Kb as jo,Kc as pp,Kd as pq,Ke as vr,L as el,La as Ym,Lb as ko,Lc as qp,Ld as qq,Le as wr,M as fl,Ma as Zm,Mb as ro,Mc as rp,Md as rq,Me as xr,N as gl,Na as _m,Nb as so,Nc as sp,Nd as sq,Ne as yr,O as hl,Oa as $m,Ob as to,Oc as tp,Od as tq,Oe as zr,P as il,Pa as an,Pb as uo,Pc as up,Pd as uq,Pe as Ar,Q as jl,Qa as bn,Qb as vo,Qc as vp,Qd as vq,Qe as Br,R as kl,Ra as cn,Rb as wo,Rc as wp,Rd as wq,Re as Cr,S as ll,Sa as dn,Sb as xo,Sc as xp,Sd as xq,Se as Dr,T as ml,Ta as en,Tb as yo,Tc as yp,Td as yq,Te as Er,U as nl,Ua as fn,Ub as zo,Uc as zp,Ud as zq,Ue as Fr,V as ol,Va as gn,Vb as Ao,Vc as Ap,Vd as Aq,Ve as Gr,W as pl,Wa as jn,Wb as Bo,Wc as Bp,Wd as Bq,We as Hr,X as ql,Xa as kn,Xb as Co,Xc as Cp,Xd as Cq,Y as rl,Ya as ln,Yb as Do,Yc as Dp,Yd as Dq,Z as sl,Za as mn,Zb as Eo,Zc as Ep,Zd as Eq,_ as tl,_a as nn,_b as Fo,_c as Fp,_d as Fq,aa as vl,ab as pn,ac as Ho,ad as Hp,ae as Hq,ba as wl,bb as qn,bc as Io,bd as Ip,be as Iq,ca as xl,cb as rn,cc as Jo,cd as Jp,ce as Jq,da as yl,db as sn,dc as Ko,dd as Kp,de as Kq,ea as zl,eb as tn,ec as Lo,ed as Lp,ee as Lq,fa as Al,fb as un,fc as Mo,fd as Mp,fe as Mq,ga as Bl,gb as vn,gc as No,gd as Np,ge as Nq,ha as Cl,hb as wn,hc as Oo,hd as Op,he as Oq,ia as Dl,ib as xn,ic as Po,id as Pp,ie as Pq,ja as El,jb as yn,jc as Qo,jd as Qp,je as Qq,ka as Fl,kb as zn,kc as Ro,kd as Rp,ke as Rq,la as Gl,lb as An,lc as So,ld as Sp,le as Sq,ma as Hl,mb as Bn,mc as To,md as Tp,me as Tq,na as Il,nb as En,nc as Uo,nd as Up,ne as _q,o as a,oa as Jl,ob as Fn,oc as Vo,od as Vp,oe as $q,p as Rj,pa as nm,pb as Gn,pc as Wo,pd as Wp,pe as ar,q as Sj,qa as om,qb as Hn,qc as Xo,qd as Xp,qe as br,r as Tj,ra as pm,rb as Nn,rc as Yo,rd as Yp,re as cr,s as Uj,sa as qm,sb as On,sc as Zo,sd as Zp,se as dr,t as Vj,ta as rm,tb as Pn,tc as _o,td as _p,te as er,u as Wj,ua as sm,ub as Qn,uc as $o,ud as $p,ue as fr,v as Xj,va as tm,vb as Vn,vc as ap,vd as aq,ve as gr,w as Yj,wa as um,wb as Wn,wc as bp,wd as bq,we as hr,x as Zj,xa as vm,xb as Xn,xc as cp,xd as cq,xe as ir,y as ck,ya as wm,yb as Yn,yc as dp,yd as dq,ye as jr,z as dk,za as xm,zb as Zn,zc as ep,zd as eq,ze as kr}from"./chunk-6hmnaza7.js";import{$e as Rk,Xe as Nk,Ye as Ok,Ze as Pk,_e as Qk,af as Sk,bf as Tk,cf as Uk,df as Vk,ef as Wk,ff as Xk,gf as Yk}from"./chunk-19nfvxfw.js";import{hf as lo,if as mo,jf as no,kf as oo,lf as po,mf as qo}from"./chunk-ferav3bw.js";import{nf as Cn,of as Dn}from"./chunk-n3ggrhb3.js";import{pf as In}from"./chunk-k56rjjc0.js";import{Af as Km,Bf as Lm,qf as Am,rf as Bm,sf as Cm,tf as Dm,uf as Em,vf as Fm,wf as Gm,xf as Hm,yf as Im,zf as Jm}from"./chunk-vqxmxgaj.js";import{Cf as Lk,Df as Mk}from"./chunk-mkd9kjgb.js";import{Ef as mm}from"./chunk-7b329e5v.js";import{Ff as Sm,Gf as Tm,Hf as Um,If as hn,Jf as Jn,Kf as Kn,Lf as Ln,Mf as Mn,Nf as Rn,Of as Sn,Pf as Tn,Qf as Un}from"./chunk-pzm13sdc.js";import{$f as sk,Rf as ik,Sf as jk,Tf as kk,Uf as lk,Vf as mk,Wf as nk,Xf as ok,Yf as pk,Zf as qk,_f as rk,ag as tk,bg as uk,cg as vk,dg as wk}from"./chunk-nx5qkm8k.js";import{eg as ej,fg as fj,gg as gj,hg as hj,ig as ij,jg as jj,kg as kj,lg as lj,mg as mj,ng as nj,og as oj}from"./chunk-kxzb4et3.js";import{pg as Gj,rg as Hj}from"./chunk-bz820epz.js";import{Ag as Ak,Bg as Bk,Cg as Ck,Dg as Dk,Fg as Ek,Gg as Fk,Hg as Gk,Ig as Hk,Jg as Ik,Kg as Jk,Ng as Kk,xg as xk,yg as yk,zg as zk}from"./chunk-dhh5q7qt.js";import{Og as bm,Pg as cm,Qg as dm,Rg as em,Sg as hm,Tg as lm}from"./chunk-h4xh8cms.js";import{Ug as fm,Xg as gm}from"./chunk-qr82je1m.js";import{dh as Kl,eh as Ll,fh as Ml,gh as Nl,hh as Ol,ih as Pl,jh as Ql,kh as Rl,lh as Sl,mh as Tl,nh as Ul,oh as Vl,ph as Wl,qh as Xl,rh as Yl,sh as im,th as jm,uh as km}from"./chunk-rbb7dvja.js";import{vh as qh,wh as rh,xh as sh,yh as th}from"./chunk-248e84r1.js";import{Dh as uh}from"./chunk-w3ycm4na.js";import{Eh as Bh,Fh as Ch,Gh as Dh,Hh as Eh,Ih as Fh,Jh as Gh}from"./chunk-1kah92n2.js";import{Kh as Vi,Lh as Wi,Mh as Xi,Qh as Yi,Rh as Zi,Sh as _i}from"./chunk-zqqx1qaj.js";import{$h as Si,Th as Li,Uh as Mi,Vh as Ni,Wh as Oi,Xh as Pi,Zh as Qi,_h as Ri,ai as Ti,bi as Ui}from"./chunk-74cv4ta1.js";import{ci as Bg,di as Cg,ei as Dg,fi as Eg,gi as Fg,hi as Gg}from"./chunk-wcm80anz.js";import{ii as Hg,ji as Ig,ki as Jg,li as Kg,mi as Lg}from"./chunk-y7m2dpd3.js";import{ni as Mg,oi as Ng,pi as Og,qi as Pg,ri as Qg}from"./chunk-9y0g8kzt.js";import{si as Rg,ti as Sg,ui as Tg,vi as Ug,wi as Vg,xi as Wg,yi as Xg}from"./chunk-t6nseeb9.js";import{Ai as Zg,Bi as _g,Ci as $g,Di as ah,Ei as bh,zi as Yg}from"./chunk-xttsqmkm.js";import{Gi as ch,Hi as dh,Ii as eh,Ji as fh,Ki as gh,Li as hh,Mi as ih,Ni as jh,Oi as kh,Pi as lh,Qi as mh,Ri as nh,Si as oh,Ti as ph}from"./chunk-54st8g2j.js";import{Vi as vg,Wi as wg}from"./chunk-nsp1cw38.js";import{Zi as xg}from"./chunk-z4jhj5e5.js";import"./chunk-9n0gvfrg.js";import{bj as yg}from"./chunk-7q9mwh4v.js";import{cj as zg,dj as Ag}from"./chunk-refwkt87.js";import{ej as je,fj as ke,gj as le,hj as me,ij as ne,jj as oe,kj as pe,lj as qe,mj as re,nj as se,oj as te,pj as ue,qj as ve,rj as we}from"./chunk-kdh37tp8.js";import{sj as Xe,tj as Ye}from"./chunk-866y9d8b.js";import{Aj as Je,Bj as Ke,Cj as Le,Dj as Me,Ej as Ne,Fj as Oe,Gj as Pe,Hj as Qe,Ij as Re,Jj as Se,Kj as Te,Lj as Ue,Mj as Ve,Nj as We}from"./chunk-fed3xsp9.js";import{Oj as Ze,Pj as _e,Qj as $e,Rj as af,Sj as bf,Tj as cf,Uj as df,Vj as ef,Wj as ff,Xj as gf,Yj as hf}from"./chunk-a0nfbmeh.js";import{qk as Uq,rk as Vq,sk as Wq,tk as Xq,uk as Yq,vk as Zq}from"./chunk-9wr7zcad.js";import{Ak as Zl,Bk as _l,Ck as $l,Dk as am,wk as _j,xk as $j,yk as ak,zk as bk}from"./chunk-71t0yan0.js";import"./chunk-58f0mthg.js";import"./chunk-4ww3znrr.js";import{$l as bc,$m as ed,$n as Ie,$o as Qf,$p as Wh,$q as Ej,Al as Oa,Am as Gc,An as Fd,Ao as pf,Ap as pg,Aq as Ei,Bl as ib,Bm as Hc,Bn as Gd,Bo as qf,Bp as qg,Bq as Fi,Cl as jb,Cm as Ic,Cn as Xd,Co as rf,Cp as rg,Cq as Gi,Dl as kb,Dm as Jc,Dn as Yd,Do as sf,Dp as sg,Dq as Hi,El as lb,Em as Kc,En as Zd,Eo as tf,Ep as tg,Eq as Ii,Fl as mb,Fn as _d,Fo as uf,Fp as ug,Fq as Ji,Gl as nb,Gm as Lc,Gn as $d,Go as vf,Gp as vh,Gq as Ki,Hm as Mc,Hn as ae,Ho as wf,Hp as wh,Hq as $i,Im as Nc,In as be,Io as xf,Ip as xh,Iq as aj,Jl as Fb,Jm as Oc,Jn as ce,Jo as yf,Jp as yh,Jq as bj,Kl as Gb,Km as Pc,Kn as de,Ko as zf,Kp as zh,Kq as cj,Ll as Hb,Lm as Qc,Ln as ee,Lo as Af,Lp as Ah,Lq as dj,Ml as Ib,Mm as Rc,Mn as fe,Mo as Bf,Mp as Hh,Mq as pj,Nl as Jb,Nm as Sc,Nn as ge,No as Cf,Np as Ih,Nq as qj,Om as Tc,On as he,Oo as Df,Op as Jh,Oq as rj,Pm as Uc,Pn as ie,Po as Ef,Pp as Kh,Pq as sj,Ql as Mb,Qm as Vc,Qo as Ff,Qp as Lh,Qq as tj,Rl as Nb,Rm as Wc,Rn as Ae,Ro as Gf,Rp as Mh,Rq as uj,Sl as Ob,Sm as Xc,Sn as Be,So as Hf,Sp as Nh,Sq as vj,Tl as Vb,Tm as Yc,Tn as Ce,To as If,Tp as Oh,Tq as wj,Ul as Wb,Um as Zc,Un as De,Uo as Jf,Up as Ph,Uq as xj,Vl as Xb,Vm as _c,Vn as Ee,Vo as Kf,Vp as Qh,Vq as yj,Wl as Yb,Wm as $c,Wn as Fe,Wo as Lf,Wp as Rh,Wq as zj,Xl as Zb,Xm as ad,Xn as Ge,Xo as Mf,Xp as Sh,Xq as Aj,Yl as _b,Ym as bd,Yo as Nf,Yp as Th,Yq as Bj,Zl as $b,Zm as cd,Zo as Of,Zp as Uh,Zq as Cj,_l as ac,_m as dd,_n as He,_o as Pf,_p as Vh,_q as Dj,am as cc,an as fd,ap as Rf,aq as Xh,ar as Fj,bm as dc,bn as gd,bo as jf,bp as Sf,bq as fi,br as Ij,cm as ec,cn as hd,cp as Tf,cq as gi,cr as Jj,dm as fc,dn as id,dp as Uf,dq as hi,dr as Kj,em as gc,en as jd,ep as Vf,eq as ii,er as Lj,fm as hc,fn as kd,fp as Wf,fq as ji,fr as Mj,gm as ic,gn as ld,gp as Xf,gq as ki,gr as Nj,hn as md,hp as Yf,hq as li,hr as Oj,in as nd,ip as Zf,iq as mi,ir as Pj,jl as xa,jm as jc,jn as od,jp as _f,jq as ni,jr as Qj,kl as ya,km as kc,kn as pd,kp as $f,kq as oi,ll as za,lm as lc,ln as qd,lp as ag,lq as pi,ml as Aa,mm as mc,mn as rd,mp as bg,mq as qi,nl as Ba,nm as nc,nn as sd,np as cg,nq as ri,ol as Ca,om as oc,on as td,op as dg,oq as si,pl as Da,pm as pc,pn as ud,pp as eg,pq as ti,ql as Ea,qm as qc,qn as vd,qp as fg,qq as ui,rl as Fa,rm as rc,rn as wd,rp as gg,rq as vi,sl as Ga,sm as sc,sn as xd,sp as hg,sq as wi,tl as Ha,tm as tc,tn as yd,to as kf,tp as ig,tq as xi,ul as Ia,um as uc,un as zd,up as jg,uq as yi,vl as Ja,vm as vc,vn as Ad,vo as lf,vp as kg,vq as zi,wl as Ka,wm as wc,wn as Bd,wp as lg,wq as Ai,xl as La,xm as xc,xn as Cd,xo as mf,xp as mg,xq as Bi,yl as Ma,ym as Ec,yn as Dd,yo as nf,yp as ng,yq as Ci,zl as Na,zm as Fc,zn as Ed,zo as of,zp as og,zq as Di}from"./chunk-y11cxbxd.js";import{Ar as r,As as la,Br as s,Bs as ma,Cr as t,Cs as na,Dr as u,Ds as oa,Er as v,Es as pa,Fr as w,Fs as qa,Gr as x,Gs as ra,Hr as y,Hs as sa,Ir as z,Is as ta,Jr as A,Js as ua,Kr as B,Ks as va,Lr as C,Ls as wa,Mr as D,Nr as E,Or as F,Pr as G,Qr as H,Rr as I,Sr as J,Tr as K,Ur as L,bs as M,cs as N,ds as O,es as P,fs as Q,gs as R,hs as S,is as T,js as U,kr as b,ks as V,lr as c,ls as W,mr as d,ms as X,nr as e,ns as Y,or as f,os as Z,pr as g,ps as _,qr as h,qs as $,rr as i,rs as aa,sr as j,ss as ba,tr as k,ts as ca,ur as l,us as da,vr as m,vs as ea,wr as n,ws as fa,xr as o,xs as ia,yr as p,ys as ja,zr as q,zs as ka}from"./chunk-92mj1t26.js";import{Ms as Yh,Ns as Zh,Os as _h,Ps as $h,Qs as ai,Rs as bi,Ss as ci,Ts as di,Us as ei}from"./chunk-8mjdpr94.js";import{Vs as ga,Ws as ha}from"./chunk-pkaabd8h.js";import{Xs as Kb,Ys as Lb}from"./chunk-xpp135ad.js";import{ft as yc,gt as zc,it as Ac,rt as Bc,st as Cc,tt as Dc}from"./chunk-wrzwgkbx.js";import{ut as Pb,vt as Qb,wt as Rb,xt as Sb,yt as Tb,zt as Ub}from"./chunk-5kk8gsj2.js";import{At as xe,Bt as ye,Ct as ze}from"./chunk-38ejahd9.js";import{Dt as Hd,Et as Id,Ft as Jd,Gt as Kd,Ht as Ld,It as Md,Jt as Nd,Kt as Od,Lt as Pd,Mt as Qd,Nt as Rd,Ot as Sd,Pt as Td,Qt as Ud,Rt as Vd,St as Wd}from"./chunk-ypmqf7tm.js";import"./chunk-de7fye10.js";import{$t as tb,Wt as ob,Xt as pb,Yt as qb,Zt as rb,_t as sb,au as ub,bu as vb,cu as wb,du as xb,eu as yb,fu as zb,gu as Ab,hu as Bb,iu as Cb,ju as Db,ku as Eb}from"./chunk-v5e1gxwm.js";import{Eu as Ua,Fu as Va,Gu as Wa,Hu as Xa,Iu as Ya,Ju as Za,Ku as _a,Lu as $a,Mu as ab,Nu as bb,Ou as cb,Pu as db,Qu as eb,Ru as fb,Su as gb,Uu as hb,ou as Pa,pu as Qa,su as Ra,xu as Sa,yu as Ta}from"./chunk-b6ej2fdf.js";import"./chunk-x650vjcp.js";import"./chunk-qc1f74ek.js";export{sk as writeNetlifyConfig,jm as writeManifest,Xk as writeImageManifest,Ao as wrapComponentForHMR,ur as withDefaults,Fj as webComponentDirectiveHandler,pp as watermark,rq as watchViews,fl as watchMultiple,gl as watchEffect,el as watch,Ee as warmImagePlaceholders,tl as waitForStore,X as waitForLocale,mo as virtualPathFor,sj as videoDirective,G as validators,yr as validated,ge as validateValueEnhanced,wh as validateTemplate,up as validateParams,he as validateFormEnhanced,gq as validateFile,ce as validateFields,be as validateField,yh as validateDirective,Bd as validateCspDirectives,Nj as validateConfig,om as validateComponentScripts,Mm as validateComponentProps,ug as validateClientScript,th as v,qc as usesSignalsInScript,ub as usesReactiveRuntime,Lh as userComponentFileExists,$g as useVirtualList,Pd as useTitle,sl as useStoreOrThrow,So as useStore,ck as useStorage,Cq as useSlots,ek as useSessionStorage,Md as useSeoMeta,ul as useRouteParams,wl as useRouteParamOrThrow,vl as useRouteParam,Pd as usePageTitle,We as useOptimistic,yl as useMiddlewareValue,xl as useMiddlewareState,dk as useLocalStorage,to as useLoadingIndicator,Kd as useHead,qh as useForm,Eq as useAttrs,iq as uploadFiles,hq as uploadFile,pl as updateInstance,Ue as untrack,$h as unregisterDirective,ql as unmountInstance,xc as unescapeHtml,po as typecheckStxFiles,Kh as transpileTypeScript,hr as translate,Ba as transitionDirective,Zb as transformAutoImports,Gm as toUsers,Fm as toUser,_o as thumbnail,$p as thumbHashToRGBA,aq as thumbHashToDataURL,wb as templateNeedsRuntime,vb as templateHasReactiveContext,Ze as templateCache,Tc as syncRecordedResponse,xo as stxClientHelpers,Ef as structuredDataDirective,kr as stripLocalePrefix,Wl as stripDocumentWrapper,Lb as stripCommentsAndLiterals,sn as stringToStream,pd as strictCspPreset,re as streamingSuspenseDirective,ve as streamToResponse,pe as streamTemplateSimple,je as streamTemplate,Zj as stopHmrServer,Cm as stopBroadcasting,Sb as stateDirName,Tb as stateDir,Je as state,og as startsDocument,Un as startProductionServer,In as startInteractive,Bm as startBroadcasting,mr as stampLocaleLayoutGroup,Ia as staggerDirective,sp as srcsetUrls,Ja as springDirective,_c as splitByPipe,Sl as spaNavVaryHeaders,no as sourcePathFor,zp as smartBatchSign,Nh as slotContentHasExpressions,xp as signUrl,Ih as shouldTranspileTypeScript,Wj as shouldReloadOnChange,Cp as shouldRefreshSignature,Xj as shouldIgnoreFile,Tg as shouldCacheComponent,cp as sharpen,Br as shape,Rb as setStateDir,Cl as setRouteParams,Dl as setMiddlewareState,De as setImagePlaceholder,wq as setGlobalProvide,b as setErrorLocale,Zk as setCurrentInstance,gj as setCachedVideoResult,Xi as setCachedImageResult,Ri as setCached,Er as serveStxFile,Gr as serveMultipleStxFiles,Rj as serveMarkdownFile,co as serveFile,Hr as serveApp,bo as serve,Do as serializeState,hn as serializeSetCookie,ep as sepia,Nd as seoMetaToHeadConfig,Ca as scrollAnimateDirective,va as screenReaderDirective,wj as scopeHTML,vj as scopeCSS,Hf as scanForSitemapEntries,pa as scanA11yTargets,qa as scanA11yIssues,ip as saturation,vp as sanitizeParams,I as sanitizeFilePath,J as sanitizeExpression,K as sanitizeDirectiveParams,H as sanitizeDirectiveParam,L as sanitizeComponentProps,B as safeExecuteAsync,A as safeExecute,Cb as runtimeHandledXAttrsLiteral,xf as runPreProcessingMiddleware,yf as runPostProcessingMiddleware,Ln as runPageAction,Pe as runMountCallbacks,gb as runMiddleware,nl as runHooks,ar as runDoctor,Qe as runDestroyCallbacks,Mf as runComposers,jp as rotate,uh as rewriteImagesWithSiblings,Uc as responseBindings,Rh as resolveTemplatePath,ha as resolveStxTargets,Jj as resolveStxDirectories,gr as resolveI18n,Yo as resize,dc as resetPlaceholders,Jd as resetHead,Co as resetHMRHandler,o as resetErrorConfig,wr as required,hc as replacePlaceholders,pq as renderView,pj as renderVideoComponent,Wb as renderVendorStyleTags,Lq as renderToString,Mq as renderToStream,Nq as renderToDOM,_p as renderThumbhashToCanvas,Zq as renderTemplateString,Xq as renderTemplate,Yq as renderString,me as renderStreamingPage,Dh as renderSlot,Jg as renderSSRSuspense,Kp as renderProtectedVideo,Jp as renderProtectedImg,wp as renderMediaUpload,Wq as renderMarkdownView,$l as renderLayoutTypes,$i as renderImgComponent,Nk as renderImageComponent,Rd as renderHtmlAttrs,Qd as renderHead,sq as renderEmail,Ph as renderComponentWithSlot,Sd as renderBodyAttrs,No as render,rd as relaxedCspPreset,ae as registerValidationRule,te as registerStreamingDirectives,Uo as registerStoresClient,Al as registerStore,Ff as registerSeoDirectives,_a as registerMiddleware,lc as registerFilters,kc as registerFilter,d as registerErrorMessages,fe as registerEnhancedValidationRule,Yh as registerDirective,Ad as registerCspDirectives,Pm as registerComponentDirectives,Oa as registerAnimationDirectives,wa as registerA11yDirectives,bl as ref,An as redirect,Pc as recordResponseStatus,Qc as recordResponseHeader,Ub as rebaseOntoStateDir,Rc as readResponseStatus,Sc as readResponseHeaders,Pj as readMarkdownFile,_e as readFileCached,cl as reactive,np as quality,Hp as pruneSignatureCache,Ui as pruneCache,uq as provide,Vq as protectCodeBlocks,vr as prop,Pf as processVueTemplate,Zg as processVirtualListDirectives,bh as processVirtualGridDirectives,oj as processVideo,de as processValidateDirective,ea as processTranslateDirective,Dg as processTransitionDirectives,Gg as processTransitionAttributes,Vd as processTitleDirective,Hc as processTemplateBindings,zg as processTeleportDirectives,Hg as processSuspenseDirectives,Af as processStructuredData,ne as processStreamDirectives,Vc as processStatusDirective,oh as processStaticDirectives,vf as processStackReplacements,uf as processStackPushDirectives,Eh as processSlots,Ul as processShell,Ge as processServerBindings,Bf as processSeoDirective,ue as processSectionDirectives,Sf as processScopedStyles,Fc as processReactiveBindings,Lp as processProtectedMedia,hh as processPartialHydrationDirectives,tg as processOnceDirective,wf as processMiddleware,zf as processMetaDirectives,Wd as processMetaDirective,Qj as processMarkdownFileDirectives,Wh as processMarkdownDirectives,pf as processLoops,Rg as processKeepAliveDirectives,sg as processJsonDirective,ah as processInfiniteListDirectives,tf as processIncludes,bj as processImgComponents,Pk as processImageComponents,Ck as processImage,Ud as processHeadDirective,Yd as processForms,_d as processFormInputDirectives,uc as processExpressions,Ib as processEventDirectives,$d as processErrorDirective,Qf as processDynamicComponents,vh as processDirectives,ei as processDirectiveAttributes,yg as processDeferDirectives,Fd as processCustomDirectives,xd as processCspDirectives,Cr as processComponentProps,cc as processClientScript,Zd as processBasicFormDirectives,Mg as processAsyncDirectives,Gd as processAppearanceBootstrapDirective,Fa as processAnimationDirectives,ka as processA11yDirectives,ze as prepareImageDelivery,T as preloadTranslationsBackground,S as preloadTranslations,so as preloadIslandHandlers,Fe as preloadIconCollection,xm as poolStrings,Hj as pluginManager,Be as placeholdersWarmed,Cg as performLeave,Bg as performEnter,Re as pendingLifecycleCounts,Ve as peek,qf as partialsCache,qj as parseVideoDirectiveOptions,Wo as parseUrl,bq as parseThumbhashString,ed as parseSwitchBlock,Bh as parseSlots,Ch as parseSlotElement,jd as parseScriptDeclarations,Dj as parseSFCComponent,Mp as parseProtectedArgs,of as parseLoopBinding,aj as parseImgComponent,si as parseImageUrl,Ok as parseImageComponent,Jn as parseFormBody,gd as parseExpressionWithFilters,Qm as parseDefaults,xn as parseCookies,Ml as parseContainerSelector,bd as parseConditionalBlock,hd as parseArguments,Ma as parseAnimationShorthand,xr as optional,ym as optimizeTemplate,Uk as optimizeImage,Vk as optimizeDirectory,zr as oneOf,rf as onceStore,kl as onUpdated,Ec as onUpdate,ml as onUnmounted,Hl as onServer,il as onMounted,Ne as onMount,nh as onHydrated,Aq as onErrorCaptured,Oe as onDestroy,Xg as onDeactivated,Gl as onClient,jl as onBeforeUpdate,ll as onBeforeUnmount,hl as onBeforeMount,Wg as onActivated,Wp as observeElement,Bn as notFound,Xf as normalizeCriticalHeadOrder,zq as nextTick,Tm as negotiateEncoding,Ua as navigateTo,ol as mountInstance,Ea as motionDirective,qd as moderateCspPreset,wm as minifyHtml,Df as metaDirective,gg as metaDedupKey,Xo as mergeParams,ig as mergeHtmlAttrs,Ld as mergeHeadConfigs,zc as mergeCssConfig,ud as mergeCspDirectives,Ra as matchRoute,Xh as markdownDirectiveHandler,Oj as markdownCache,ga as looksLikeGlob,jr as localizePath,U as loadTranslationLazy,_ as loadTranslation,Kj as loadStxConfig,db as loadMiddlewareFromDirectory,km as loadManifest,Sp as loadElement,Dm as loadChannels,qr as lintStxStrict,Up as lazyLoadAll,Tp as lazyLoad,Ha as keyframeDirective,Jq as jsxs,Kq as jsxDEV,Iq as jsx,zn as jsonResponse,se as islandDirective,l as isTest,Xl as isSpaNavigation,Ql as isSpaNavRequest,Ap as isSignatureValid,Se as isSignal,Ak as isSharpAvailable,ln as isServerEnvironment,El as isServer,yb as isRuntimeOwnedColonAttr,da as isRtlLocale,j as isProduction,ia as isPresentationalRole,Pp as isNativeLazySupported,Uq as isMarkdownPath,Q as isLoading,R as isLoaded,Hh as isJavaScriptScript,Qp as isIntersectionObserverSupported,Ik as isImageFile,Bk as isImageBackendAvailable,aa as isICUFormat,mh as isHydrated,Mh as isHydrateTrigger,Nc as isHttpStatus,kn as isEdgeEnvironment,rr as isDirectiveKind,k as isDevelopment,Te as isDerived,Vj as isCssOnlyChange,Sm as isCompressible,Fl as isClient,Og as isAsyncComponent,Kn as isActionableMethod,fp as invert,af as invalidateFileCacheByDir,$e as invalidateFileCache,tc as interpolateScriptsInTemplate,rc as interpolateScriptExpressions,sc as interpolateScriptAttributes,x as inlineError,fr as injectThemeBootstrap,Cf as injectSeoTags,cr as injectSeo,jf as injectRouterScript,Uj as injectHotReload,kb as injectHeatmap,Dc as injectCss,vd as injectCspMetaTag,qg as injectConfigHeadTags,Wf as injectColorModeBootScript,kg as injectCloakStyle,bg as injectBuildId,Yb as injectBrowserCoreAutoImports,Jc as injectAnalytics,vq as inject,zl as initStoreRegistry,vk as initNetlify,uo as initLoadingIndicator,Rp as initLazyLoading,Hn as initFile,Zp as initBlurUp,dq as initAllBlurUp,dj as imgDirective,Sk as imageDirective,Sn as hydrateTemplateStream,Rn as hydrateTemplate,ro as hydrateIslands,jh as hydrateIsland,Tn as hydrateFragment,kh as hydrateByStrategy,lh as hydrateAll,Ko as hydrate,ao as htmlResponse,mg as hoistLeadingHeadTags,Yf as hoistColorModeBootScript,lb as heatmapDirective,Ni as hashString,hf as hashFilePath,Li as hashFile,Mi as hashBuffer,Of as hasVueTemplateSyntax,nf as hasVariables,Po as hasStore,ic as hasPlaceholders,tk as hasNetlifyConfig,ab as hasMiddleware,Jb as hasEventDirectives,pg as hasDocumentShell,zh as hasDirectives,ma as hasDOMSupport,Lk as handleImageRequest,Bq as handleError,Rq as h,Hk as groupVariantsByFormat,dp as grayscale,Vn as gitHash,qm as getUnusedDirectives,V as getTranslationSync,O as getTranslationCacheStats,W as getTranslationAsync,ba as getTranslation,ok as getTotalSize,Bp as getTimeUntilExpiry,vg as getStoreScript,Qo as getStoreNames,Oo as getStore,hk as getStorageSize,gk as getStorageKeys,Sh as getSourceLineInfo,Jh as getSharedTranspiler,la as getScreenReaderOnlyStyle,xj as getScopeAttribute,Ie as getRouteParams,Nb as getPublicEnvDefine,Ob as getPublicEnv,xh as getPositionInfo,fc as getPlaceholderRegistry,Ki as getPlaceholderCacheStats,Id as getPageMeta,ld as getNonce,Jk as getMimeType,cb as getMiddlewareNames,$a as getMiddleware,ca as getLocaleDirection,P as getLoadingState,Y as getLoadingLocales,Ae as getImagePlaceholder,Dk as getImageMetadata,xe as getImageDelivery,Jo as getHydrationRuntime,Bl as getHydratedStoreState,Yj as getHmrServer,Hd as getHead,Bo as getHMRHandler,wi as getFormatExtension,Pi as getFileMtime,Gk as getFallbackVariant,f as getErrorMessage,c as getErrorLocale,n as getErrorConfig,i as getErrorCodeName,_h as getDirectives,Zh as getDirective,_k as getCurrentInstance,Ac as getCssServeAsset,td as getCspPreset,Cd as getCspHeaderName,Vh as getComponentCacheStats,fj as getCachedVideoResult,Fp as getCachedSignature,cf as getCachedSignalsRuntime,df as getCachedRouterScript,Ii as getCachedPlaceholder,Wi as getCachedImageResult,Qi as getCached,Ti as getCacheStats,$f as getBuildId,Am as getBroadcastServer,vi as getBestVariant,mc as getAllFilters,ji as generateWidthSrcset,_g as generateVirtualListCSS,kq as generateVideoPreview,ie as generateValidationScript,lq as generateUploadRuntime,rm as generateTreeShakenBundle,Fg as generateTransitionRuntime,Eg as generateTransitionCSS,jj as generateThumbnails,Bi as generateThumbhashPlaceholder,an as generateTemplatesDocs,Lg as generateSuspenseRuntime,Kg as generateSuspenseCSS,Eo as generateStateScript,ti as generateSrcsetData,_i as generateSrcset,Ek as generateSrcSet,kj as generateSpriteSheet,tq as generateSpaShell,ui as generateSourceTags,pi as generateSizesFromBreakpoints,oi as generateSizesAttribute,Fk as generateSizes,Gf as generateSitemapIndex,dr as generateSitemap,Op as generateSimpleMediaPicker,Ip as generateSignatureRuntime,Ye as generateSignalsRuntimeDev,Xe as generateSignalsRuntime,bc as generateServerDataBridge,uj as generateScopeId,Ej as generateSFCWebComponent,Gb as generateRuntimeScript,Pa as generateRouteTypes,Qa as generateRouteManifest,If as generateRobotsTxt,er as generateRobots,Zi as generateResponsiveVariants,Aj as generateReactiveWebComponentTS,zj as generateReactiveWebComponent,Cj as generateReactiveRuntime,Bj as generateReactiveMixin,ij as generatePoster,Hi as generatePlaceholderStyle,Gi as generatePlaceholderCSS,Ai as generatePlaceholder,ih as generatePartialHydrationCSS,kd as generateNonce,pk as generateNetlifyToml,nq as generateMinifiedMediaRuntime,mq as generateMediaRuntime,Np as generateMediaManagerEmbed,im as generateManifest,wo as generateLoadingIndicatorHtml,Yp as generateLazyLoadRuntime,am as generateLayoutTypes,Di as generateLQIP,Vg as generateKeepAliveRuntime,Ug as generateKeepAliveCSS,ph as generateIslandManifest,jq as generateImagePreview,Wk as generateImageManifest,Io as generateHydrationScript,we as generateHydrationRuntime,Lo as generateHydrationCSS,ch as generateHydrationBootstrap,Tj as generateHotReloadScript,jb as generateHeatmapScript,zo as generateHMRClientScript,lj as generateHLSManifest,Fo as generateEventBindings,ni as generateDprSrcsetWithVariableQuality,mi as generateDprSrcset,ng as generateDocumentShell,fn as generateDocs,bn as generateDirectivesDocs,di as generateDirectiveRuntime,Jf as generateDefaultRobotsTxt,mj as generateDASHManifest,Cc as generateCss,od as generateCspMetaTag,nd as generateCspHeader,Gq as generateCompositionRuntime,$m as generateComponentsDocs,dh as generateComponentManifest,Zm as generateComponentDoc,Fi as generateColorPlaceholder,Vf as generateColorModeBootScript,rl as generateClientRuntime,Oi as generateCacheKey,$b as generateBrowserAutoImportDestructuring,eq as generateBlurUpRuntime,fq as generateBlurUpCSS,Gc as generateBindingsRuntime,ki as generateAutoWidthSrcset,_b as generateAutoImportDestructuring,Qg as generateAsyncComponentRuntime,Pg as generateAsyncComponentCSS,Na as generateAnimationRuntime,La as generateAnimationCSS,Ic as generateAnalyticsScript,qo as formatTypecheckDiagnostics,ko as formatTypeErrors,En as formatStxContent,nk as formatSize,Ta as formatRoutes,Fn as formatMarkdownContent,g as formatLocalizedError,$ as formatICU,p as formatFilePath,w as formatError,br as formatDoctorReport,cn as formatDocsAsMarkdown,en as formatDocsAsJson,dn as formatDocsAsHtml,mp as format,vm as foldConstants,lp as flipVertical,kp as flipHorizontal,bm as fingerprint,oo as findRuntimeTypeDeclarations,$q as findPantryPackage,ad as findMatchingEndTag,Yc as findMatchingDelimiter,Kb as findInterpolationEnd,cd as findIfBlocks,fd as findExpressions,Sa as findErrorPage,dd as findDirectiveBlocks,sm as findDeadCode,sm as findDeadBranches,Nl as findContainerRegion,_m as findComponentFiles,Fr as findCommonDir,mk as filterRequiredFiles,Qh as fileExists,kf as extractVariables,gm as extractTemplateExpressions,oe as extractStreamBoundaries,Go as extractState,Fh as extractSlotContent,mf as extractScriptFromTemplate,fm as extractScriptBlocks,gc as extractPlaceholders,$c as extractParenthesizedExpression,Oc as extractPageResponseStatus,hb as extractLayoutMetadata,Ei as extractDominantColor,id as extractDirectiveParams,Ah as extractDirectiveNames,Yl as extractContainerContent,Xm as extractComponentProps,eh as extractComponentName,Ym as extractComponentDescription,Bc as extractClassNames,ac as extractBridgeData,fh as extractBoundProps,Zc as extractBalancedExpression,Vb as extractAndStripCssImports,yj as extractAndScopeStyles,Hb as extractAndProcessEvents,ak as externalizeSharedAssets,bk as externalizeRepeatedAssets,$j as externalizeHtml,wc as evaluateExpression,um as evaluateConstant,Wc as evaluateAuthExpression,pc as escapeHtmlValue,oc as escapeHtml,C as errorRecovery,E as errorLogger,Ag as ensureTeleportTargets,rg as ensureDocumentShell,ee as enhancedValidationRules,Vm as enableDevTools,tm as eliminateDeadCode,Le as effect,tp as dprUrls,gn as docsCommand,_l as discoverLayoutNames,Xp as disconnectObserver,Wm as disableDevTools,F as devHelpers,Tl as detectShell,jn as detectRuntime,qk as detectProjectConfig,xi as detectFormat,nm as detectBuildMode,Ke as derived,uk as deploy,Mj as defineStxConfig,To as defineStore,Dq as defineSlots,pr as defineSiteConfig,tr as definePropsWithValidation,sr as defineProps,Gj as definePlugin,Od as definePageMeta,Wa as defineMiddleware,rh as defineForm,yq as defineExpose,xq as defineEmits,ai as defineDirective,Tq as defineCustomElement,Qn as defineConfig,bi as defineClientDirective,Ng as defineAsyncComponent,oq as defaultMediaConfig,Yk as defaultImageConfig,M as defaultI18nConfig,ib as defaultHeatmapConfig,Xd as defaultFormClasses,jc as defaultFilters,Ed as defaultCspConfig,Ij as defaultConfig,Dr as default,yc as deepMergeThemes,Rf as dedupeScopedStyles,Ci as decodeThumbhash,zd as cspNonceDirective,yd as cspDirective,cq as crossfadeTransition,Zo as crop,Yg as createVirtualList,rj as createVideoDirective,vn as createVercelHandler,ho as createTypeChecker,fa as createTranslateFilter,rn as createTextEncoderStream,Sq as createStxApp,qn as createStreamingResponse,qe as createStreamRenderer,Ro as createStore,Za as createStorageManager,Xa as createServerCookieManager,al as createScope,Ig as createSSRSuspense,He as createRouter,eb as createRouteLocation,fo as createRoute,bl as createRef,cl as createReactive,Fq as createProvideContext,Xn as createProject,Pn as createProductionBuild,ec as createPlaceholder,zm as createOptimizedBuild,wn as createNetlifyHandler,ik as createNetlifyClient,fb as createMiddlewareContext,eo as createMiddleware,Vp as createLazyObserver,Sg as createKeepAliveCache,nn as createKVNamespace,gh as createIslandRegistry,cj as createImgDirective,Tk as createImagePlugin,Mk as createImageHandler,Rk as createImageDirective,nb as createHeatmapAggregator,lk as createFileManifest,mn as createEnvAccessor,z as createEnhancedError,pn as createEdgeHandler,on as createEdgeCache,Th as createDetailedErrorMessage,un as createDenoHandler,rk as createDefaultNetlifyConfig,Dd as createCspHeaders,yn as createCookie,dl as createComputed,$k as createComponentInstance,tn as createCloudflareHandler,Ya as createClientCookieManager,ci as createBuiltinDirectives,Sq as createApp,Ka as createAnimationTimeline,ap as cover,lf as convertToCommonJS,hp as contrast,$o as contain,y as consoleError,m as configureErrorHandling,Lj as config,dl as computed,Um as compressResponse,Lf as composerPattern,Kf as composer,Vl as composeShellWithPage,Om as componentDirective,Oh as componentClientSignalNames,hm as compileTemplate,a as collectRepeatedFlag,kk as collectDeployFiles,lg as cloakStyleFragment,hj as clearVideoCache,N as clearTranslationCache,wg as clearStoreCache,fk as clearStorage,Gp as clearSignatureCache,Ji as clearPlaceholderCache,sf as clearOnceStore,md as clearNonce,bb as clearMiddleware,Ce as clearImagePlaceholders,ye as clearImageDeliveryCatalog,Qk as clearImageCache,e as clearErrorMessages,ef as clearDevCaches,nc as clearCustomFilters,Nf as clearComposers,xg as clearComposableCache,Uh as clearComponentCache,Si as clearCache,Db as clearBlankCache,vo as cleanupLoadingIndicator,Kl as classifyScript,Ll as classifyAllScripts,io as checkTemplateFile,jo as checkTemplate,ff as checkCache,Dp as checkAuthAccess,na as checkA11yWithRegex,oa as checkA11y,Jm as channel,Dn as captureScreenshots,Cn as captureScreenshot,Z as cancelPendingLoads,jk as calculateSha1,li as calculateOptimalWidths,gf as cacheTemplate,tj as buildWebComponents,lo as buildVirtualSource,qq as buildViews,Vo as buildUrl,ke as buildSuspenseResolveScript,or as buildStaticSite,qb as buildRuntimeGlobalsDestructure,cm as buildRuntimeAsset,dm as buildRouterAsset,nr as buildLangPickerScript,ri as buildImageUrl,cg as buildIdFragment,hg as buildHtmlAttrs,lm as buildForProduction,Rm as buildComponentLibrary,Ep as buildAuthParams,mm as buildApp,lr as buildAlternateLinks,On as build,Hm as broadcastPrivate,Im as broadcastPresence,Em as broadcast,gp as brightness,bp as blur,Eb as blankInertHtmlRegions,yp as batchSignUrls,Me as batch,sa as autoFixA11yFile,ta as autoFixA11yDirectory,ra as autoFixA11y,op as auto,ja as attributeValue,em as assetTags,Fb as asInvocableStatement,Ar as arrayOf,ir as applyTranslations,Yi as applyTransformations,Gh as applySlots,Nm as applyPropDefaults,rp as applyPreset,jg as applyHtmlAttrs,Td as applyHead,vc as applyFilters,Rl as appendVary,sd as apiCspPreset,Da as animationGroupDirective,nj as analyzeVideo,pm as analyzeUsage,Il as analyzeTemplate,Jl as analyzeProject,pm as analyzeDirectiveUsage,Kc as analyticsDirective,_n as addStore,Zn as addPage,wd as addNonceToInlineContent,$n as addLayout,Yn as addComponent,Mn as actionRedirectResponse,Va as abortNavigation,ua as a11yDirective,bf as __setSignalsGeneratorsForTest,ag as __setBuildIdForTest,ej as VideoProcessorCache,sh as Validator,xa as TransitionType,za as TransitionEase,ya as TransitionDirection,Xc as Tokenizer,go as TemplateTypeChecker,Gn as TEMPLATE_PRESETS,v as StxValidationError,r as StxSyntaxError,t as StxSecurityError,s as StxRuntimeError,u as StxFileError,q as StxError,Oq as Show,le as SUSPENSE_RESOLVER_RUNTIME,ob as STX_RUNTIME_GLOBALS,Xb as STX_AUTO_IMPORTS,Qb as STATE_DIR_ENV_VAR,Ga as SPRING_PRESETS,Ol as SPA_NAV_HEADER,xb as RUNTIME_OWNED_COLON_ATTRS,zb as RUNTIME_HANDLED_X_ATTRS,Lc as RESPONSE_STATUS_KEY,Mc as RESPONSE_HEADERS_KEY,tb as REACTIVE_RUNTIME_GLOBALS,Nn as ProductionBuild,Qq as Portal,Wn as PROJECT_TEMPLATES,qp as PRESETS,sb as NON_CLIENT_PRIMITIVES,Mo as MemorySessionStore,ii as MIME_TYPES,fi as MEDIA_DEFAULT_WIDTHS,hi as MEDIA_DEFAULT_FORMATS,Zl as LAYOUT_TYPES_FILE,Vi as ImageProcessorCache,Kk as ImageProcessingError,Ho as HydrationRuntime,Sj as HotReloadServer,mb as HeatmapAggregator,fg as HTML_CLASS_MARKER,eg as HTML_ATTRS_MARKER,Hq as Fragment,Pq as For,Pl as FRAGMENT_CACHE_CONTROL,D as ErrorLogger,h as ErrorCodes,_j as EXTERNALIZED_ASSET_DIR,wk as DeployError,xk as DEFAULT_WIDTHS,Aa as DEFAULT_TRANSITION_OPTIONS,Pb as DEFAULT_STATE_DIR,zk as DEFAULT_QUALITY,yi as DEFAULT_PLACEHOLDER_OPTIONS,yk as DEFAULT_FORMATS,gi as DEFAULT_DPR_VALUES,yo as ComponentHMRHandler,pb as COMPONENT_SCOPE_LOCAL_GLOBALS,Bb as COMPONENT_PASSTHROUGH_X_ATTRS,rb as COMPILE_TIME_ONLY_GLOBALS,qi as COMMON_SIZES,Tf as COLOR_MODE_BOOT_MARKER,Uf as COLOR_MODE_BOOT_GLOBAL,dg as CLOAK_STYLE,Lm as BroadcastServer,Km as Broadcast,Zf as BUILD_ID_META,_f as BUILD_ID_HEADER,Mb as BROWSER_CORE_IMPORTS,zi as BLUR_UP_CSS,Ab as ALPINE_BRIDGE_X_ATTRS,_q as $path};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{dr as E}from"./chunk-y11cxbxd.js";import{gv as D}from"./chunk-qc1f74ek.js";import I from"path";async function M(k={}){let G=performance.now(),J=k.root||process.cwd(),j=await E(),q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-2et5hxfv.js");B=await z({outputDir:".output",debug:k.debug,...k.ssr})}let H=Math.round(performance.now()-G);return{mode:q,ssg:A,ssr:B,duration:H}}
|
|
3
3
|
export{M as Ef};
|