@stacksjs/stx 0.2.53 → 0.2.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/app-shell.js +1 -1
  2. package/dist/auth.js +2 -2
  3. package/dist/build-mode-detector.js +1 -1
  4. package/dist/build-views.js +1 -1
  5. package/dist/build.js +1 -1
  6. package/dist/cli.js +2 -2
  7. package/dist/component-processing.js +1 -1
  8. package/dist/component-renderer.js +1 -1
  9. package/dist/components.js +1 -1
  10. package/dist/conditionals.js +1 -1
  11. package/dist/dev-server/index.js +1 -1
  12. package/dist/dev-server/serve-app.js +1 -1
  13. package/dist/dev-server/serve-file.js +1 -1
  14. package/dist/dev-server/serve-markdown.js +1 -1
  15. package/dist/dev-server/serve-multi.js +1 -1
  16. package/dist/dev-server.js +1 -1
  17. package/dist/docs.js +1 -1
  18. package/dist/dynamic-components.js +1 -1
  19. package/dist/expressions.js +1 -1
  20. package/dist/forms.js +1 -1
  21. package/dist/i18n.js +1 -1
  22. package/dist/includes.js +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/interactive.js +1 -1
  25. package/dist/lazy-loader.js +1 -1
  26. package/dist/loops.js +1 -1
  27. package/dist/misc-directives.js +1 -1
  28. package/dist/plugin.js +1 -1
  29. package/dist/process.js +1 -1
  30. package/dist/production-builder.js +1 -1
  31. package/dist/production-server.js +1 -1
  32. package/dist/pwa/index.js +1 -1
  33. package/dist/pwa/offline.js +1 -1
  34. package/dist/pwa.js +1 -1
  35. package/dist/reactive.js +1 -1
  36. package/dist/render.js +1 -1
  37. package/dist/routes.js +1 -1
  38. package/dist/safe-evaluator.js +1 -1
  39. package/dist/seo.js +1 -1
  40. package/dist/serve.js +1 -1
  41. package/dist/site-builder/build.js +1 -1
  42. package/dist/site-builder/index.js +1 -1
  43. package/dist/slots.js +1 -1
  44. package/dist/ssg.js +1 -1
  45. package/dist/ssr.js +1 -1
  46. package/dist/story/cli.js +1 -1
  47. package/dist/story/commands/dev.js +1 -1
  48. package/dist/story/commands/index.js +1 -1
  49. package/dist/story/index.js +1 -1
  50. package/dist/story/renderer.js +1 -1
  51. package/dist/story/server.js +1 -1
  52. package/dist/story/visual-testing.js +1 -1
  53. package/dist/streaming.js +1 -1
  54. package/dist/template-compiler.js +1 -1
  55. package/dist/template-hydrator.js +1 -1
  56. package/dist/testing.js +1 -1
  57. package/dist/utils.js +1 -1
  58. package/dist/variable-extractor.js +1 -1
  59. package/dist/web-components.js +1 -1
  60. package/package.json +7 -7
@@ -612,7 +612,7 @@ ${z}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
612
612
  `}),$}import T6 from"process";function l0($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(T6.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function PO($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(T6.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var m1=()=>{};var t9={};u(t9,{hasUserImports:()=>GG,bundleClientScript:()=>zG});import V0 from"path";import o0 from"fs";function GG($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!M6.some((z)=>z.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!M6.some((z)=>z.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function KG($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:V0.dirname(J),K=V0.resolve(G,Q),z=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,V0.join(K,"index.ts"),V0.join(K,"index.tsx"),V0.join(K,"index.js"),V0.join(K,"index.mjs")];for(let q of z)try{if(o0.existsSync(q)&&o0.statSync(q,{throwIfNoEntry:!1})?.isFile())return q}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=V0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,V0.join(G,"index.ts"),V0.join(G,"index.js")];for(let z of K)if(o0.existsSync(z)&&o0.statSync(z,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",z),{path:z};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function zG($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||V0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),z=V0.join(Q,`${K}.js`),q=Bun.file(z);if(await q.exists())return console.log("[stx:bundler] cache hit:",K),await q.text();let W=V0.join(X,".stx","bundle-tmp"),_=V0.join(W,`${K}.ts`),U=V0.join(W,"out",K);o0.mkdirSync(W,{recursive:!0}),o0.mkdirSync(U,{recursive:!0});let B=V0.dirname(Z),j=[],O=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=O.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let w=V.split(":")[0].trim();if(w)j.push(w)});else if(F[3])j.push(F[3])}while((F=L.exec($))!==null){if(F[1])continue;j.push(F[2])}let H=j.length>0?`
613
613
  export { ${j.join(", ")} }`:"";await Bun.write(_,$+H),console.log("[stx:bundler] bundling:",K,"from:",V0.basename(Z));try{let V=await Bun.build({entrypoints:[_],outdir:U,target:"browser",format:"esm",minify:J,plugins:[KG(X,B,_)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...l0()},root:X});if(!V.success){let A=V.logs.filter((R)=>R.level==="error").map((R)=>R.message).join(", ");return console.warn("[stx:bundler] build failed:",A),$}let w="";for(let A of V.outputs){w=await A.text();break}return w=w.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",w.length,"bytes"),o0.mkdirSync(Q,{recursive:!0}),await Bun.write(z,w),w}catch(V){let w=V instanceof Error?V.message:String(V),A=V?.errors,R=Array.isArray(A)&&A.length>0?`
614
614
  ${A.map((N)=>`- ${N?.message??N}`).join(`
615
- `)}`:"";return console.warn(`[stx:bundler] error: ${w}${R}`),$}finally{try{o0.rmSync(_,{force:!0}),o0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var M6;var e9=b(()=>{m1();M6=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function gO($){u1={...u1,...$}}function hO(){u1={...E6}}function dO(){return{...u1}}function _G($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function UG($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(qG.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&I6.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function BG($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!I6.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function F5($){let Z=$.trim(),Y=_G(Z);UG(Y,Z),BG(Z);for(let X of Z4)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!u1.allowBracketNotation&&WG.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function k6($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||Z4.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=$4(X);else Z[Y]=X}return Z}function $4($,Z=0){if(Z>=u1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>$4(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=$4(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=k6(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return F5($),!0}catch{return!1}}function mO($){try{return F5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function uO($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function lO($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=F5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let z=Z[K];if(!X.test(z))continue;if(jG.has(z))continue;J.push(K),Q.push(z)}let G=Function(...Q,`
615
+ `)}`:"";return console.warn(`[stx:bundler] error: ${w}${R}`),$}finally{try{o0.rmSync(_,{force:!0}),o0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var M6;var e9=b(()=>{m1();M6=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function gO($){u1={...u1,...$}}function hO(){u1={...E6}}function dO(){return{...u1}}function _G($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function UG($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(qG.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&I6.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function BG($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!I6.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function F5($){let Z=$.trim(),Y=_G(Z);UG(Y,Z),BG(Z);for(let X of Z4)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!u1.allowBracketNotation&&WG.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function k6($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||Z4.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=$4(X);else Z[Y]=X}return Z}function $4($,Z=0){if(Z>=u1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>$4(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=$4(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=k6(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return F5($),!0}catch{return!1}}function mO($){try{return F5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function uO($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function lO($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=F5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let z=Z[K];if(!X.test(z))continue;if(jG.has(z))continue;J.push(K),Q.push(z)}let G=Function(...Q,`
616
616
  'use strict';
617
617
  try {
618
618
  return ${Y};
@@ -612,7 +612,7 @@ ${z}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
612
612
  `}),$}import k6 from"process";function p0($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(k6.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function sO($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(k6.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var c1=()=>{};var Q4={};u(Q4,{hasUserImports:()=>HG,bundleClientScript:()=>FG});import V0 from"path";import r0 from"fs";function HG($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!S6.some((z)=>z.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!S6.some((z)=>z.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function LG($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:V0.dirname(J),K=V0.resolve(G,Q),z=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,V0.join(K,"index.ts"),V0.join(K,"index.tsx"),V0.join(K,"index.js"),V0.join(K,"index.mjs")];for(let W of z)try{if(r0.existsSync(W)&&r0.statSync(W,{throwIfNoEntry:!1})?.isFile())return W}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=V0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,V0.join(G,"index.ts"),V0.join(G,"index.js")];for(let z of K)if(r0.existsSync(z)&&r0.statSync(z,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",z),{path:z};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function FG($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||V0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),z=V0.join(Q,`${K}.js`),W=Bun.file(z);if(await W.exists())return console.log("[stx:bundler] cache hit:",K),await W.text();let _=V0.join(X,".stx","bundle-tmp"),U=V0.join(_,`${K}.ts`),q=V0.join(_,"out",K);r0.mkdirSync(_,{recursive:!0}),r0.mkdirSync(q,{recursive:!0});let B=V0.dirname(Z),j=[],O=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=O.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let w=V.split(":")[0].trim();if(w)j.push(w)});else if(F[3])j.push(F[3])}while((F=L.exec($))!==null){if(F[1])continue;j.push(F[2])}let H=j.length>0?`
613
613
  export { ${j.join(", ")} }`:"";await Bun.write(U,$+H),console.log("[stx:bundler] bundling:",K,"from:",V0.basename(Z));try{let V=await Bun.build({entrypoints:[U],outdir:q,target:"browser",format:"esm",minify:J,plugins:[LG(X,B,U)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...p0()},root:X});if(!V.success){let A=V.logs.filter((R)=>R.level==="error").map((R)=>R.message).join(", ");return console.warn("[stx:bundler] build failed:",A),$}let w="";for(let A of V.outputs){w=await A.text();break}return w=w.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",w.length,"bytes"),r0.mkdirSync(Q,{recursive:!0}),await Bun.write(z,w),w}catch(V){let w=V instanceof Error?V.message:String(V),A=V?.errors,R=Array.isArray(A)&&A.length>0?`
614
614
  ${A.map((N)=>`- ${N?.message??N}`).join(`
615
- `)}`:"";return console.warn(`[stx:bundler] error: ${w}${R}`),$}finally{try{r0.rmSync(U,{force:!0}),r0.rmSync(q,{recursive:!0,force:!0})}catch{}}}var S6;var G4=b(()=>{c1();S6=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function eO($){i1={...i1,...$}}function $H(){i1={...C6}}function ZH(){return{...i1}}function wG($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function RG($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(VG.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&P6.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function NG($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!P6.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function D5($){let Z=$.trim(),Y=wG(Z);RG(Y,Z),NG(Z);for(let X of z4)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!i1.allowBracketNotation&&AG.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function y6($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||z4.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=K4(X);else Z[Y]=X}return Z}function K4($,Z=0){if(Z>=i1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>K4(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=K4(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=y6(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return D5($),!0}catch{return!1}}function YH($){try{return D5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function XH($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function JH($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function U0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=D5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let z=Z[K];if(!X.test(z))continue;if(TG.has(z))continue;J.push(K),Q.push(z)}let G=Function(...Q,`
615
+ `)}`:"";return console.warn(`[stx:bundler] error: ${w}${R}`),$}finally{try{r0.rmSync(U,{force:!0}),r0.rmSync(q,{recursive:!0,force:!0})}catch{}}}var S6;var G4=b(()=>{c1();S6=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function eO($){i1={...i1,...$}}function $H(){i1={...C6}}function ZH(){return{...i1}}function wG($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function RG($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(VG.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&P6.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function NG($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!P6.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function D5($){let Z=$.trim(),Y=wG(Z);RG(Y,Z),NG(Z);for(let X of z4)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!i1.allowBracketNotation&&AG.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function y6($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||z4.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=K4(X);else Z[Y]=X}return Z}function K4($,Z=0){if(Z>=i1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>K4(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=K4(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=y6(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return D5($),!0}catch{return!1}}function YH($){try{return D5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function XH($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function JH($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function U0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=D5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let z=Z[K];if(!X.test(z))continue;if(TG.has(z))continue;J.push(K),Q.push(z)}let G=Function(...Q,`
616
616
  'use strict';
617
617
  try {
618
618
  return ${Y};
@@ -612,7 +612,7 @@ ${z}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
612
612
  `}),$}import V3 from"process";function o0($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(V3.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function fF($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(V3.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var G5=()=>{};var f9={};d(f9,{hasUserImports:()=>CK,bundleClientScript:()=>vK});import A0 from"path";import Y1 from"fs";function CK($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!R3.some((z)=>z.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!R3.some((z)=>z.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function yK($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:A0.dirname(J),K=A0.resolve(G,Q),z=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,A0.join(K,"index.ts"),A0.join(K,"index.tsx"),A0.join(K,"index.js"),A0.join(K,"index.mjs")];for(let W of z)try{if(Y1.existsSync(W)&&Y1.statSync(W,{throwIfNoEntry:!1})?.isFile())return W}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=A0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,A0.join(G,"index.ts"),A0.join(G,"index.js")];for(let z of K)if(Y1.existsSync(z)&&Y1.statSync(z,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",z),{path:z};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function vK($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||A0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),z=A0.join(Q,`${K}.js`),W=Bun.file(z);if(await W.exists())return console.log("[stx:bundler] cache hit:",K),await W.text();let _=A0.join(X,".stx","bundle-tmp"),q=A0.join(_,`${K}.ts`),U=A0.join(_,"out",K);Y1.mkdirSync(_,{recursive:!0}),Y1.mkdirSync(U,{recursive:!0});let B=A0.dirname(Z),j=[],O=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=O.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let A=V.split(":")[0].trim();if(A)j.push(A)});else if(F[3])j.push(F[3])}while((F=L.exec($))!==null){if(F[1])continue;j.push(F[2])}let H=j.length>0?`
613
613
  export { ${j.join(", ")} }`:"";await Bun.write(q,$+H),console.log("[stx:bundler] bundling:",K,"from:",A0.basename(Z));try{let V=await Bun.build({entrypoints:[q],outdir:U,target:"browser",format:"esm",minify:J,plugins:[yK(X,B,q)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...o0()},root:X});if(!V.success){let R=V.logs.filter((w)=>w.level==="error").map((w)=>w.message).join(", ");return console.warn("[stx:bundler] build failed:",R),$}let A="";for(let R of V.outputs){A=await R.text();break}return A=A.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",A.length,"bytes"),Y1.mkdirSync(Q,{recursive:!0}),await Bun.write(z,A),A}catch(V){let A=V instanceof Error?V.message:String(V),R=V?.errors,w=Array.isArray(R)&&R.length>0?`
614
614
  ${R.map((N)=>`- ${N?.message??N}`).join(`
615
- `)}`:"";return console.warn(`[stx:bundler] error: ${A}${w}`),$}finally{try{Y1.rmSync(q,{force:!0}),Y1.rmSync(U,{recursive:!0,force:!0})}catch{}}}var R3;var g9=b(()=>{G5();R3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function uF($){K5={...K5,...$}}function lF(){K5={...w3}}function pF(){return{...K5}}function gK($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function hK($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(xK.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&N3.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function dK($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!N3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function u5($){let Z=$.trim(),Y=gK(Z);hK(Y,Z),dK(Z);for(let X of d9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!K5.allowBracketNotation&&fK.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function T3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||d9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=h9(X);else Z[Y]=X}return Z}function h9($,Z=0){if(Z>=K5.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>h9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=h9(J,Z+1);else Y[X]=J}return Y}function s($,Z){try{let Y=T3(Z),X=Object.keys(Y),J=Object.values(Y);return e($,X)(...J)}catch{return}}function t($){try{return u5($),!0}catch{return!1}}function cF($){try{return u5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function iF($,Z){try{let Y=s($,Z);return Boolean(Y)}catch{return!1}}function nF($,Z){try{let Y=s($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function B0($,Z){try{let Y=s($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function e($,Z){let Y=u5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let z=Z[K];if(!X.test(z))continue;if(mK.has(z))continue;J.push(K),Q.push(z)}let G=Function(...Q,`
615
+ `)}`:"";return console.warn(`[stx:bundler] error: ${A}${w}`),$}finally{try{Y1.rmSync(q,{force:!0}),Y1.rmSync(U,{recursive:!0,force:!0})}catch{}}}var R3;var g9=b(()=>{G5();R3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function uF($){K5={...K5,...$}}function lF(){K5={...w3}}function pF(){return{...K5}}function gK($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function hK($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(xK.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&N3.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function dK($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!N3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function u5($){let Z=$.trim(),Y=gK(Z);hK(Y,Z),dK(Z);for(let X of d9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!K5.allowBracketNotation&&fK.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function T3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||d9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=h9(X);else Z[Y]=X}return Z}function h9($,Z=0){if(Z>=K5.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>h9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=h9(J,Z+1);else Y[X]=J}return Y}function s($,Z){try{let Y=T3(Z),X=Object.keys(Y),J=Object.values(Y);return e($,X)(...J)}catch{return}}function t($){try{return u5($),!0}catch{return!1}}function cF($){try{return u5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function iF($,Z){try{let Y=s($,Z);return Boolean(Y)}catch{return!1}}function nF($,Z){try{let Y=s($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function B0($,Z){try{let Y=s($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function e($,Z){let Y=u5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let z=Z[K];if(!X.test(z))continue;if(mK.has(z))continue;J.push(K),Q.push(z)}let G=Function(...Q,`
616
616
  'use strict';
617
617
  try {
618
618
  return ${Y};
@@ -612,7 +612,7 @@ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
612
612
  `}),$}import f3 from"process";function m0($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(f3.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function gB($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(f3.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var f1=()=>{};var C9={};l(C9,{hasUserImports:()=>mJ,bundleClientScript:()=>lJ});import F0 from"path";import n0 from"fs";function mJ($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!g3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!g3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function uJ($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:F0.dirname(J),K=F0.resolve(G,Q),q=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,F0.join(K,"index.ts"),F0.join(K,"index.tsx"),F0.join(K,"index.js"),F0.join(K,"index.mjs")];for(let z of q)try{if(n0.existsSync(z)&&n0.statSync(z,{throwIfNoEntry:!1})?.isFile())return z}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=F0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,F0.join(G,"index.ts"),F0.join(G,"index.js")];for(let q of K)if(n0.existsSync(q)&&n0.statSync(q,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",q),{path:q};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function lJ($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||F0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),q=F0.join(Q,`${K}.js`),z=Bun.file(q);if(await z.exists())return console.log("[stx:bundler] cache hit:",K),await z.text();let _=F0.join(X,".stx","bundle-tmp"),W=F0.join(_,`${K}.ts`),U=F0.join(_,"out",K);n0.mkdirSync(_,{recursive:!0}),n0.mkdirSync(U,{recursive:!0});let B=F0.dirname(Z),j=[],O=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=O.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let R=V.split(":")[0].trim();if(R)j.push(R)});else if(F[3])j.push(F[3])}while((F=L.exec($))!==null){if(F[1])continue;j.push(F[2])}let H=j.length>0?`
613
613
  export { ${j.join(", ")} }`:"";await Bun.write(W,$+H),console.log("[stx:bundler] bundling:",K,"from:",F0.basename(Z));try{let V=await Bun.build({entrypoints:[W],outdir:U,target:"browser",format:"esm",minify:J,plugins:[uJ(X,B,W)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...m0()},root:X});if(!V.success){let w=V.logs.filter((A)=>A.level==="error").map((A)=>A.message).join(", ");return console.warn("[stx:bundler] build failed:",w),$}let R="";for(let w of V.outputs){R=await w.text();break}return R=R.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",R.length,"bytes"),n0.mkdirSync(Q,{recursive:!0}),await Bun.write(q,R),R}catch(V){let R=V instanceof Error?V.message:String(V),w=V?.errors,A=Array.isArray(w)&&w.length>0?`
614
614
  ${w.map((N)=>`- ${N?.message??N}`).join(`
615
- `)}`:"";return console.warn(`[stx:bundler] error: ${R}${A}`),$}finally{try{n0.rmSync(W,{force:!0}),n0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var g3;var P9=b(()=>{f1();g3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function lB($){g1={...g1,...$}}function pB(){g1={...d3}}function cB(){return{...g1}}function iJ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function nJ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(pJ.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&m3.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function oJ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!m3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function W5($){let Z=$.trim(),Y=iJ(Z);nJ(Y,Z),oJ(Z);for(let X of x9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!g1.allowBracketNotation&&cJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function u3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||x9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=v9(X);else Z[Y]=X}return Z}function v9($,Z=0){if(Z>=g1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>v9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=v9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=u3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return W5($),!0}catch{return!1}}function iB($){try{return W5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function nB($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function oB($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=W5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(sJ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
615
+ `)}`:"";return console.warn(`[stx:bundler] error: ${R}${A}`),$}finally{try{n0.rmSync(W,{force:!0}),n0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var g3;var P9=b(()=>{f1();g3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function lB($){g1={...g1,...$}}function pB(){g1={...d3}}function cB(){return{...g1}}function iJ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function nJ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(pJ.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&m3.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function oJ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!m3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function W5($){let Z=$.trim(),Y=iJ(Z);nJ(Y,Z),oJ(Z);for(let X of x9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!g1.allowBracketNotation&&cJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function u3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||x9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=v9(X);else Z[Y]=X}return Z}function v9($,Z=0){if(Z>=g1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>v9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=v9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=u3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return W5($),!0}catch{return!1}}function iB($){try{return W5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function nB($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function oB($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=W5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(sJ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
616
616
  'use strict';
617
617
  try {
618
618
  return ${Y};
@@ -612,7 +612,7 @@ ${z}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
612
612
  `}),$}import X6 from"process";function m0($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(X6.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function $O($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(X6.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var f1=()=>{};var h9={};u(h9,{hasUserImports:()=>vQ,bundleClientScript:()=>fQ});import F0 from"path";import n0 from"fs";function vQ($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!J6.some((z)=>z.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!J6.some((z)=>z.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function xQ($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:F0.dirname(J),K=F0.resolve(G,Q),z=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,F0.join(K,"index.ts"),F0.join(K,"index.tsx"),F0.join(K,"index.js"),F0.join(K,"index.mjs")];for(let q of z)try{if(n0.existsSync(q)&&n0.statSync(q,{throwIfNoEntry:!1})?.isFile())return q}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=F0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,F0.join(G,"index.ts"),F0.join(G,"index.js")];for(let z of K)if(n0.existsSync(z)&&n0.statSync(z,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",z),{path:z};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function fQ($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||F0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),z=F0.join(Q,`${K}.js`),q=Bun.file(z);if(await q.exists())return console.log("[stx:bundler] cache hit:",K),await q.text();let W=F0.join(X,".stx","bundle-tmp"),_=F0.join(W,`${K}.ts`),U=F0.join(W,"out",K);n0.mkdirSync(W,{recursive:!0}),n0.mkdirSync(U,{recursive:!0});let B=F0.dirname(Z),j=[],O=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=O.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let A=V.split(":")[0].trim();if(A)j.push(A)});else if(F[3])j.push(F[3])}while((F=L.exec($))!==null){if(F[1])continue;j.push(F[2])}let H=j.length>0?`
613
613
  export { ${j.join(", ")} }`:"";await Bun.write(_,$+H),console.log("[stx:bundler] bundling:",K,"from:",F0.basename(Z));try{let V=await Bun.build({entrypoints:[_],outdir:U,target:"browser",format:"esm",minify:J,plugins:[xQ(X,B,_)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...m0()},root:X});if(!V.success){let w=V.logs.filter((R)=>R.level==="error").map((R)=>R.message).join(", ");return console.warn("[stx:bundler] build failed:",w),$}let A="";for(let w of V.outputs){A=await w.text();break}return A=A.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",A.length,"bytes"),n0.mkdirSync(Q,{recursive:!0}),await Bun.write(z,A),A}catch(V){let A=V instanceof Error?V.message:String(V),w=V?.errors,R=Array.isArray(w)&&w.length>0?`
614
614
  ${w.map((N)=>`- ${N?.message??N}`).join(`
615
- `)}`:"";return console.warn(`[stx:bundler] error: ${A}${R}`),$}finally{try{n0.rmSync(_,{force:!0}),n0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var J6;var d9=b(()=>{f1();J6=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function QO($){g1={...g1,...$}}function GO(){g1={...G6}}function KO(){return{...g1}}function dQ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function mQ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(gQ.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&K6.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function uQ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!K6.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function U5($){let Z=$.trim(),Y=dQ(Z);mQ(Y,Z),uQ(Z);for(let X of u9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!g1.allowBracketNotation&&hQ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function z6($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||u9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=m9(X);else Z[Y]=X}return Z}function m9($,Z=0){if(Z>=g1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>m9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=m9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=z6(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return U5($),!0}catch{return!1}}function zO($){try{return U5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function qO($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function WO($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function W0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=U5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let z=Z[K];if(!X.test(z))continue;if(lQ.has(z))continue;J.push(K),Q.push(z)}let G=Function(...Q,`
615
+ `)}`:"";return console.warn(`[stx:bundler] error: ${A}${R}`),$}finally{try{n0.rmSync(_,{force:!0}),n0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var J6;var d9=b(()=>{f1();J6=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function QO($){g1={...g1,...$}}function GO(){g1={...G6}}function KO(){return{...g1}}function dQ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function mQ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(gQ.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&K6.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function uQ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!K6.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function U5($){let Z=$.trim(),Y=dQ(Z);mQ(Y,Z),uQ(Z);for(let X of u9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!g1.allowBracketNotation&&hQ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function z6($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||u9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=m9(X);else Z[Y]=X}return Z}function m9($,Z=0){if(Z>=g1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>m9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=m9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=z6(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return U5($),!0}catch{return!1}}function zO($){try{return U5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function qO($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function WO($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function W0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=U5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let z=Z[K];if(!X.test(z))continue;if(lQ.has(z))continue;J.push(K),Q.push(z)}let G=Function(...Q,`
616
616
  'use strict';
617
617
  try {
618
618
  return ${Y};
@@ -612,7 +612,7 @@ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
612
612
  `}),$}import h3 from"process";function u0($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(h3.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function cB($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(h3.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var g1=()=>{};var v9={};l(v9,{hasUserImports:()=>sJ,bundleClientScript:()=>aJ});import F0 from"path";import o0 from"fs";function sJ($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!d3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!d3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function rJ($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:F0.dirname(J),K=F0.resolve(G,Q),q=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,F0.join(K,"index.ts"),F0.join(K,"index.tsx"),F0.join(K,"index.js"),F0.join(K,"index.mjs")];for(let z of q)try{if(o0.existsSync(z)&&o0.statSync(z,{throwIfNoEntry:!1})?.isFile())return z}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=F0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,F0.join(G,"index.ts"),F0.join(G,"index.js")];for(let q of K)if(o0.existsSync(q)&&o0.statSync(q,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",q),{path:q};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function aJ($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||F0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),q=F0.join(Q,`${K}.js`),z=Bun.file(q);if(await z.exists())return console.log("[stx:bundler] cache hit:",K),await z.text();let _=F0.join(X,".stx","bundle-tmp"),W=F0.join(_,`${K}.ts`),U=F0.join(_,"out",K);o0.mkdirSync(_,{recursive:!0}),o0.mkdirSync(U,{recursive:!0});let B=F0.dirname(Z),j=[],O=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=O.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let A=V.split(":")[0].trim();if(A)j.push(A)});else if(F[3])j.push(F[3])}while((F=L.exec($))!==null){if(F[1])continue;j.push(F[2])}let H=j.length>0?`
613
613
  export { ${j.join(", ")} }`:"";await Bun.write(W,$+H),console.log("[stx:bundler] bundling:",K,"from:",F0.basename(Z));try{let V=await Bun.build({entrypoints:[W],outdir:U,target:"browser",format:"esm",minify:J,plugins:[rJ(X,B,W)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...u0()},root:X});if(!V.success){let w=V.logs.filter((R)=>R.level==="error").map((R)=>R.message).join(", ");return console.warn("[stx:bundler] build failed:",w),$}let A="";for(let w of V.outputs){A=await w.text();break}return A=A.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",A.length,"bytes"),o0.mkdirSync(Q,{recursive:!0}),await Bun.write(q,A),A}catch(V){let A=V instanceof Error?V.message:String(V),w=V?.errors,R=Array.isArray(w)&&w.length>0?`
614
614
  ${w.map((N)=>`- ${N?.message??N}`).join(`
615
- `)}`:"";return console.warn(`[stx:bundler] error: ${A}${R}`),$}finally{try{o0.rmSync(W,{force:!0}),o0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var d3;var x9=b(()=>{g1();d3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function rB($){h1={...h1,...$}}function aB(){h1={...u3}}function tB(){return{...h1}}function $Q($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function ZQ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(tJ.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&l3.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function YQ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!l3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function B5($){let Z=$.trim(),Y=$Q(Z);ZQ(Y,Z),YQ(Z);for(let X of g9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!h1.allowBracketNotation&&eJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function p3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||g9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=f9(X);else Z[Y]=X}return Z}function f9($,Z=0){if(Z>=h1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>f9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=f9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=p3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return B5($),!0}catch{return!1}}function eB($){try{return B5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function $j($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function Zj($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=B5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(XQ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
615
+ `)}`:"";return console.warn(`[stx:bundler] error: ${A}${R}`),$}finally{try{o0.rmSync(W,{force:!0}),o0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var d3;var x9=b(()=>{g1();d3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function rB($){h1={...h1,...$}}function aB(){h1={...u3}}function tB(){return{...h1}}function $Q($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function ZQ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(tJ.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&l3.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function YQ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!l3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function B5($){let Z=$.trim(),Y=$Q(Z);ZQ(Y,Z),YQ(Z);for(let X of g9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!h1.allowBracketNotation&&eJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function p3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||g9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=f9(X);else Z[Y]=X}return Z}function f9($,Z=0){if(Z>=h1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>f9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=f9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=p3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return B5($),!0}catch{return!1}}function eB($){try{return B5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function $j($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function Zj($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=B5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(XQ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
616
616
  'use strict';
617
617
  try {
618
618
  return ${Y};
package/dist/streaming.js CHANGED
@@ -612,7 +612,7 @@ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
612
612
  `}),$}import P3 from"process";function p0($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(P3.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function kB($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(P3.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var m1=()=>{};var S9={};c(S9,{hasUserImports:()=>vJ,bundleClientScript:()=>fJ});import V0 from"path";import r0 from"fs";function vJ($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!v3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!v3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function xJ($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:V0.dirname(J),K=V0.resolve(G,Q),q=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,V0.join(K,"index.ts"),V0.join(K,"index.tsx"),V0.join(K,"index.js"),V0.join(K,"index.mjs")];for(let z of q)try{if(r0.existsSync(z)&&r0.statSync(z,{throwIfNoEntry:!1})?.isFile())return z}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=V0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,V0.join(G,"index.ts"),V0.join(G,"index.js")];for(let q of K)if(r0.existsSync(q)&&r0.statSync(q,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",q),{path:q};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function fJ($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||V0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),q=V0.join(Q,`${K}.js`),z=Bun.file(q);if(await z.exists())return console.log("[stx:bundler] cache hit:",K),await z.text();let W=V0.join(X,".stx","bundle-tmp"),U=V0.join(W,`${K}.ts`),_=V0.join(W,"out",K);r0.mkdirSync(W,{recursive:!0}),r0.mkdirSync(_,{recursive:!0});let B=V0.dirname(Z),j=[],H=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,O=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=H.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let A=V.split(":")[0].trim();if(A)j.push(A)});else if(F[3])j.push(F[3])}while((F=O.exec($))!==null){if(F[1])continue;j.push(F[2])}let L=j.length>0?`
613
613
  export { ${j.join(", ")} }`:"";await Bun.write(U,$+L),console.log("[stx:bundler] bundling:",K,"from:",V0.basename(Z));try{let V=await Bun.build({entrypoints:[U],outdir:_,target:"browser",format:"esm",minify:J,plugins:[xJ(X,B,U)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...p0()},root:X});if(!V.success){let w=V.logs.filter((R)=>R.level==="error").map((R)=>R.message).join(", ");return console.warn("[stx:bundler] build failed:",w),$}let A="";for(let w of V.outputs){A=await w.text();break}return A=A.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",A.length,"bytes"),r0.mkdirSync(Q,{recursive:!0}),await Bun.write(q,A),A}catch(V){let A=V instanceof Error?V.message:String(V),w=V?.errors,R=Array.isArray(w)&&w.length>0?`
614
614
  ${w.map((N)=>`- ${N?.message??N}`).join(`
615
- `)}`:"";return console.warn(`[stx:bundler] error: ${A}${R}`),$}finally{try{r0.rmSync(U,{force:!0}),r0.rmSync(_,{recursive:!0,force:!0})}catch{}}}var v3;var y9=S(()=>{m1();v3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function PB($){u1={...u1,...$}}function vB(){u1={...f3}}function xB(){return{...u1}}function dJ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function mJ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(gJ.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&g3.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function uJ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!g3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function B5($){let Z=$.trim(),Y=dJ(Z);mJ(Y,Z),uJ(Z);for(let X of P9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!u1.allowBracketNotation&&hJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function h3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||P9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=C9(X);else Z[Y]=X}return Z}function C9($,Z=0){if(Z>=u1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>C9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=C9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=h3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return B5($),!0}catch{return!1}}function fB($){try{return B5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function gB($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function hB($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function W0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=B5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(pJ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
615
+ `)}`:"";return console.warn(`[stx:bundler] error: ${A}${R}`),$}finally{try{r0.rmSync(U,{force:!0}),r0.rmSync(_,{recursive:!0,force:!0})}catch{}}}var v3;var y9=S(()=>{m1();v3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function PB($){u1={...u1,...$}}function vB(){u1={...f3}}function xB(){return{...u1}}function dJ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function mJ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(gJ.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&g3.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function uJ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!g3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function B5($){let Z=$.trim(),Y=dJ(Z);mJ(Y,Z),uJ(Z);for(let X of P9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!u1.allowBracketNotation&&hJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function h3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||P9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=C9(X);else Z[Y]=X}return Z}function C9($,Z=0){if(Z>=u1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>C9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=C9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=h3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return B5($),!0}catch{return!1}}function fB($){try{return B5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function gB($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function hB($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function W0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=B5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(pJ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
616
616
  'use strict';
617
617
  try {
618
618
  return ${Y};
@@ -682,7 +682,7 @@ ${H}
682
682
  `}),$}import BK from"process";function j1($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(BK.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function UK($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(BK.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var r$=()=>{};var kY={};a(kY,{hasUserImports:()=>IF,bundleClientScript:()=>kF});import p0 from"path";import n1 from"fs";function IF($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!zK.some((W)=>W.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!zK.some((W)=>W.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function DF($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:p0.dirname(J),K=p0.resolve(G,Q),W=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,p0.join(K,"index.ts"),p0.join(K,"index.tsx"),p0.join(K,"index.js"),p0.join(K,"index.mjs")];for(let _ of W)try{if(n1.existsSync(_)&&n1.statSync(_,{throwIfNoEntry:!1})?.isFile())return _}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=p0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,p0.join(G,"index.ts"),p0.join(G,"index.js")];for(let W of K)if(n1.existsSync(W)&&n1.statSync(W,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",W),{path:W};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function kF($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||p0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),W=p0.join(Q,`${K}.js`),_=Bun.file(W);if(await _.exists())return console.log("[stx:bundler] cache hit:",K),await _.text();let B=p0.join(X,".stx","bundle-tmp"),U=p0.join(B,`${K}.ts`),z=p0.join(B,"out",K);n1.mkdirSync(B,{recursive:!0}),n1.mkdirSync(z,{recursive:!0});let q=p0.dirname(Z),j=[],H=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,O=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=H.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let N=V.split(":")[0].trim();if(N)j.push(N)});else if(F[3])j.push(F[3])}while((F=O.exec($))!==null){if(F[1])continue;j.push(F[2])}let L=j.length>0?`
683
683
  export { ${j.join(", ")} }`:"";await Bun.write(U,$+L),console.log("[stx:bundler] bundling:",K,"from:",p0.basename(Z));try{let V=await Bun.build({entrypoints:[U],outdir:z,target:"browser",format:"esm",minify:J,plugins:[DF(X,q,U)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...j1()},root:X});if(!V.success){let A=V.logs.filter((w)=>w.level==="error").map((w)=>w.message).join(", ");return console.warn("[stx:bundler] build failed:",A),$}let N="";for(let A of V.outputs){N=await A.text();break}return N=N.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",N.length,"bytes"),n1.mkdirSync(Q,{recursive:!0}),await Bun.write(W,N),N}catch(V){let N=V instanceof Error?V.message:String(V),A=V?.errors,w=Array.isArray(A)&&A.length>0?`
684
684
  ${A.map((R)=>`- ${R?.message??R}`).join(`
685
- `)}`:"";return console.warn(`[stx:bundler] error: ${N}${w}`),$}finally{try{n1.rmSync(U,{force:!0}),n1.rmSync(z,{recursive:!0,force:!0})}catch{}}}var zK;var SY=S(()=>{r$();zK=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function Ab($){I5={...I5,...$}}function wb(){I5={...jK}}function Rb(){return{...I5}}function CF($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function yF($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(SF.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&HK.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function PF($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!HK.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function o7($){let Z=$.trim(),Y=CF(Z);yF(Y,Z),PF(Z);for(let X of CY)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!I5.allowBracketNotation&&bF.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function OK($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||CY.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=bY(X);else Z[Y]=X}return Z}function bY($,Z=0){if(Z>=I5.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>bY(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=bY(J,Z+1);else Y[X]=J}return Y}function Q0($,Z){try{let Y=OK(Z),X=Object.keys(Y),J=Object.values(Y);return W0($,X)(...J)}catch{return}}function K0($){try{return o7($),!0}catch{return!1}}function Mb($){try{return o7($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function Tb($,Z){try{let Y=Q0($,Z);return Boolean(Y)}catch{return!1}}function Eb($,Z){try{let Y=Q0($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function E0($,Z){try{let Y=Q0($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function W0($,Z){let Y=o7($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let W=Z[K];if(!X.test(W))continue;if(xF.has(W))continue;J.push(K),Q.push(W)}let G=Function(...Q,`
685
+ `)}`:"";return console.warn(`[stx:bundler] error: ${N}${w}`),$}finally{try{n1.rmSync(U,{force:!0}),n1.rmSync(z,{recursive:!0,force:!0})}catch{}}}var zK;var SY=S(()=>{r$();zK=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function Ab($){I5={...I5,...$}}function wb(){I5={...jK}}function Rb(){return{...I5}}function CF($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function yF($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(SF.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&HK.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function PF($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!HK.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function o7($){let Z=$.trim(),Y=CF(Z);yF(Y,Z),PF(Z);for(let X of CY)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!I5.allowBracketNotation&&bF.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function OK($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||CY.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=bY(X);else Z[Y]=X}return Z}function bY($,Z=0){if(Z>=I5.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>bY(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=bY(J,Z+1);else Y[X]=J}return Y}function Q0($,Z){try{let Y=OK(Z),X=Object.keys(Y),J=Object.values(Y);return W0($,X)(...J)}catch{return}}function K0($){try{return o7($),!0}catch{return!1}}function Mb($){try{return o7($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function Tb($,Z){try{let Y=Q0($,Z);return Boolean(Y)}catch{return!1}}function Eb($,Z){try{let Y=Q0($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function E0($,Z){try{let Y=Q0($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function W0($,Z){let Y=o7($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let W=Z[K];if(!X.test(W))continue;if(xF.has(W))continue;J.push(K),Q.push(W)}let G=Function(...Q,`
686
686
  'use strict';
687
687
  try {
688
688
  return ${Y};
@@ -612,7 +612,7 @@ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
612
612
  `}),$}import C3 from"process";function m0($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(C3.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function TB($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(C3.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var f1=()=>{};var k9={};c(k9,{hasUserImports:()=>CJ,bundleClientScript:()=>vJ});import L0 from"path";import s0 from"fs";function CJ($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!P3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!P3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function PJ($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:L0.dirname(J),K=L0.resolve(G,Q),q=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,L0.join(K,"index.ts"),L0.join(K,"index.tsx"),L0.join(K,"index.js"),L0.join(K,"index.mjs")];for(let z of q)try{if(s0.existsSync(z)&&s0.statSync(z,{throwIfNoEntry:!1})?.isFile())return z}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=L0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,L0.join(G,"index.ts"),L0.join(G,"index.js")];for(let q of K)if(s0.existsSync(q)&&s0.statSync(q,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",q),{path:q};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function vJ($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||L0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),q=L0.join(Q,`${K}.js`),z=Bun.file(q);if(await z.exists())return console.log("[stx:bundler] cache hit:",K),await z.text();let _=L0.join(X,".stx","bundle-tmp"),W=L0.join(_,`${K}.ts`),U=L0.join(_,"out",K);s0.mkdirSync(_,{recursive:!0}),s0.mkdirSync(U,{recursive:!0});let B=L0.dirname(Z),j=[],O=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=O.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let R=V.split(":")[0].trim();if(R)j.push(R)});else if(F[3])j.push(F[3])}while((F=L.exec($))!==null){if(F[1])continue;j.push(F[2])}let H=j.length>0?`
613
613
  export { ${j.join(", ")} }`:"";await Bun.write(W,$+H),console.log("[stx:bundler] bundling:",K,"from:",L0.basename(Z));try{let V=await Bun.build({entrypoints:[W],outdir:U,target:"browser",format:"esm",minify:J,plugins:[PJ(X,B,W)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...m0()},root:X});if(!V.success){let w=V.logs.filter((A)=>A.level==="error").map((A)=>A.message).join(", ");return console.warn("[stx:bundler] build failed:",w),$}let R="";for(let w of V.outputs){R=await w.text();break}return R=R.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",R.length,"bytes"),s0.mkdirSync(Q,{recursive:!0}),await Bun.write(q,R),R}catch(V){let R=V instanceof Error?V.message:String(V),w=V?.errors,A=Array.isArray(w)&&w.length>0?`
614
614
  ${w.map((N)=>`- ${N?.message??N}`).join(`
615
- `)}`:"";return console.warn(`[stx:bundler] error: ${R}${A}`),$}finally{try{s0.rmSync(W,{force:!0}),s0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var P3;var S9=b(()=>{f1();P3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function kB($){g1={...g1,...$}}function SB(){g1={...x3}}function bB(){return{...g1}}function gJ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function hJ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(xJ.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&f3.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function dJ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!f3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function _5($){let Z=$.trim(),Y=gJ(Z);hJ(Y,Z),dJ(Z);for(let X of y9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!g1.allowBracketNotation&&fJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function g3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||y9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=b9(X);else Z[Y]=X}return Z}function b9($,Z=0){if(Z>=g1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>b9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=b9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=g3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return _5($),!0}catch{return!1}}function yB($){try{return _5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function CB($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function PB($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=_5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(mJ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
615
+ `)}`:"";return console.warn(`[stx:bundler] error: ${R}${A}`),$}finally{try{s0.rmSync(W,{force:!0}),s0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var P3;var S9=b(()=>{f1();P3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function kB($){g1={...g1,...$}}function SB(){g1={...x3}}function bB(){return{...g1}}function gJ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function hJ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(xJ.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&f3.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function dJ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!f3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function _5($){let Z=$.trim(),Y=gJ(Z);hJ(Y,Z),dJ(Z);for(let X of y9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!g1.allowBracketNotation&&fJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function g3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||y9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=b9(X);else Z[Y]=X}return Z}function b9($,Z=0){if(Z>=g1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>b9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=b9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=g3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return _5($),!0}catch{return!1}}function yB($){try{return _5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function CB($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function PB($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=_5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(mJ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
616
616
  'use strict';
617
617
  try {
618
618
  return ${Y};
package/dist/testing.js CHANGED
@@ -612,7 +612,7 @@ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
612
612
  `}),$}import C3 from"process";function u0($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(C3.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function IB($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(C3.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var d1=()=>{};var S9={};c(S9,{hasUserImports:()=>PJ,bundleClientScript:()=>xJ});import L0 from"path";import s0 from"fs";function PJ($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!P3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!P3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function vJ($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:L0.dirname(J),K=L0.resolve(G,Q),q=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,L0.join(K,"index.ts"),L0.join(K,"index.tsx"),L0.join(K,"index.js"),L0.join(K,"index.mjs")];for(let z of q)try{if(s0.existsSync(z)&&s0.statSync(z,{throwIfNoEntry:!1})?.isFile())return z}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=L0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,L0.join(G,"index.ts"),L0.join(G,"index.js")];for(let q of K)if(s0.existsSync(q)&&s0.statSync(q,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",q),{path:q};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function xJ($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||L0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),q=L0.join(Q,`${K}.js`),z=Bun.file(q);if(await z.exists())return console.log("[stx:bundler] cache hit:",K),await z.text();let _=L0.join(X,".stx","bundle-tmp"),U=L0.join(_,`${K}.ts`),W=L0.join(_,"out",K);s0.mkdirSync(_,{recursive:!0}),s0.mkdirSync(W,{recursive:!0});let j=L0.dirname(Z),B=[],H=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=H.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let R=V.split(":")[0].trim();if(R)B.push(R)});else if(F[3])B.push(F[3])}while((F=L.exec($))!==null){if(F[1])continue;B.push(F[2])}let O=B.length>0?`
613
613
  export { ${B.join(", ")} }`:"";await Bun.write(U,$+O),console.log("[stx:bundler] bundling:",K,"from:",L0.basename(Z));try{let V=await Bun.build({entrypoints:[U],outdir:W,target:"browser",format:"esm",minify:J,plugins:[vJ(X,j,U)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...u0()},root:X});if(!V.success){let w=V.logs.filter((A)=>A.level==="error").map((A)=>A.message).join(", ");return console.warn("[stx:bundler] build failed:",w),$}let R="";for(let w of V.outputs){R=await w.text();break}return R=R.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",R.length,"bytes"),s0.mkdirSync(Q,{recursive:!0}),await Bun.write(q,R),R}catch(V){let R=V instanceof Error?V.message:String(V),w=V?.errors,A=Array.isArray(w)&&w.length>0?`
614
614
  ${w.map((N)=>`- ${N?.message??N}`).join(`
615
- `)}`:"";return console.warn(`[stx:bundler] error: ${R}${A}`),$}finally{try{s0.rmSync(U,{force:!0}),s0.rmSync(W,{recursive:!0,force:!0})}catch{}}}var P3;var b9=b(()=>{d1();P3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function bB($){m1={...m1,...$}}function yB(){m1={...x3}}function CB(){return{...m1}}function hJ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function dJ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(fJ.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&f3.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function mJ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!f3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function j5($){let Z=$.trim(),Y=hJ(Z);dJ(Y,Z),mJ(Z);for(let X of C9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!m1.allowBracketNotation&&gJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function g3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||C9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=y9(X);else Z[Y]=X}return Z}function y9($,Z=0){if(Z>=m1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>y9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=y9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=g3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return j5($),!0}catch{return!1}}function PB($){try{return j5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function vB($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function xB($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=j5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(uJ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
615
+ `)}`:"";return console.warn(`[stx:bundler] error: ${R}${A}`),$}finally{try{s0.rmSync(U,{force:!0}),s0.rmSync(W,{recursive:!0,force:!0})}catch{}}}var P3;var b9=b(()=>{d1();P3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function bB($){m1={...m1,...$}}function yB(){m1={...x3}}function CB(){return{...m1}}function hJ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function dJ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(fJ.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&f3.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function mJ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!f3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function j5($){let Z=$.trim(),Y=hJ(Z);dJ(Y,Z),mJ(Z);for(let X of C9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!m1.allowBracketNotation&&gJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function g3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||C9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=y9(X);else Z[Y]=X}return Z}function y9($,Z=0){if(Z>=m1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>y9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=y9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=g3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return j5($),!0}catch{return!1}}function PB($){try{return j5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function vB($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function xB($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=j5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(uJ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
616
616
  'use strict';
617
617
  try {
618
618
  return ${Y};
package/dist/utils.js CHANGED
@@ -61,7 +61,7 @@ ${K}${O}
61
61
  'use strict';
62
62
  ${X}${Y}
63
63
  ${K}
64
- })()</script>`}var YY,XY,JY,qY,UY;var b$=b(()=>{H0();YY=["state","derived","effect","batch","untrack","peek","isSignal","isDerived","onMount","onDestroy","useRef","navigate","goBack","goForward","useRoute","setRouteParams","useSearchParams","useQuery","useMutation","useEventListener","useMeta","useDebounce","useDebouncedValue","useThrottle","useInterval","useTimeout","useToggle","useCounter","useClickOutside","useFocus","useAsync","useColorMode","useDark","ref","reactive","computed","watch","watchEffect","watchMultiple","onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","defineProps","withDefaults","defineEmits","defineExpose","provide","inject","nextTick","getCurrentInstance","onErrorCaptured","useSlots","useAttrs","createStore","defineStore","useStore","action","createSelector","h","Fragment"],XY=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser"],JY=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);qY={left:0,middle:1,right:2};UY=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"])});function LY($){let Z="",Y=null,X=!1;for(let Q=0;Q<$.length;Q++){let J=$[Q];if(X){X=!1;continue}if(J==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&J==="$"&&Q+1<$.length&&$[Q+1]==="{"){let G=1;Q+=2;while(Q<$.length&&G>0){if($[Q]==="{")G++;else if($[Q]==="}")G--;if(G>0)Z+=$[Q],Q++}continue}if(J===Y)Y=null;continue}if(J==='"'||J==="'"||J==="`"){Y=J;continue}Z+=J}return Z}function FY($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let Q=X[0],J=$[X.index-1];if(OY.has(Q))throw Error(`Potentially unsafe expression (identifier ${Q}): ${Z}`);if(J==="."&&J7.has(Q))throw Error(`Potentially unsafe expression (property ${Q}): ${Z}`)}}function VY($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!J7.has(X))continue;let Q=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],J=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((Q==="{"||Q===",")&&J===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function j5($){let Z=$.trim(),Y=LY(Z);FY(Y,Z),VY(Z);for(let X of X7)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!Y7.allowBracketNotation&&HY.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function wY($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||X7.some((Q)=>Q.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=y$(X);else Z[Y]=X}return Z}function y$($,Z=0){if(Z>=Y7.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>y$(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,Q]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(Q&&typeof Q==="object")Y[X]=y$(Q,Z+1);else Y[X]=Q}return Y}function i($,Z){try{let Y=wY(Z),X=Object.keys(Y),Q=Object.values(Y);return $0($,X)(...Q)}catch{return}}function e($){try{return j5($),!0}catch{return!1}}function W0($,Z){try{let Y=i($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function $0($,Z){let Y=j5($),X=/^[A-Za-z_$][\w$]*$/,Q=[],J=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(RY.has(q))continue;Q.push(K),J.push(q)}let G=Function(...J,`
64
+ })()</script>`}var YY,XY,JY,qY,UY;var b$=b(()=>{H0();YY=["state","derived","effect","batch","untrack","peek","isSignal","isDerived","onMount","onDestroy","useRef","navigate","goBack","goForward","useRoute","setRouteParams","useSearchParams","useQuery","useMutation","useEventListener","useMeta","useDebounce","useDebouncedValue","useThrottle","useInterval","useTimeout","useToggle","useCounter","useClickOutside","useFocus","useAsync","useColorMode","useDark","ref","reactive","computed","watch","watchEffect","watchMultiple","onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","defineProps","withDefaults","defineEmits","defineExpose","provide","inject","nextTick","getCurrentInstance","onErrorCaptured","useSlots","useAttrs","createStore","defineStore","useStore","action","createSelector","h","Fragment"],XY=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser"],JY=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);qY={left:0,middle:1,right:2};UY=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"])});function LY($){let Z="",Y=null,X=!1;for(let Q=0;Q<$.length;Q++){let J=$[Q];if(X){X=!1;continue}if(J==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&J==="$"&&Q+1<$.length&&$[Q+1]==="{"){let G=1;Q+=2;while(Q<$.length&&G>0){if($[Q]==="{")G++;else if($[Q]==="}")G--;if(G>0)Z+=$[Q],Q++}continue}if(J===Y)Y=null;continue}if(J==='"'||J==="'"||J==="`"){Y=J;continue}Z+=J}return Z}function FY($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let Q=X[0],J=$[X.index-1];if(OY.has(Q))throw Error(`Potentially unsafe expression (matched /\\b${Q}\\b/; identifier ${Q}): ${Z}`);if(J==="."&&J7.has(Q))throw Error(`Potentially unsafe expression (matched /.${Q}/; property ${Q}): ${Z}`)}}function VY($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!J7.has(X))continue;let Q=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],J=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((Q==="{"||Q===",")&&J===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function j5($){let Z=$.trim(),Y=LY(Z);FY(Y,Z),VY(Z);for(let X of X7)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!Y7.allowBracketNotation&&HY.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function wY($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||X7.some((Q)=>Q.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=y$(X);else Z[Y]=X}return Z}function y$($,Z=0){if(Z>=Y7.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>y$(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,Q]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(Q&&typeof Q==="object")Y[X]=y$(Q,Z+1);else Y[X]=Q}return Y}function i($,Z){try{let Y=wY(Z),X=Object.keys(Y),Q=Object.values(Y);return $0($,X)(...Q)}catch{return}}function e($){try{return j5($),!0}catch{return!1}}function W0($,Z){try{let Y=i($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function $0($,Z){let Y=j5($),X=/^[A-Za-z_$][\w$]*$/,Q=[],J=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(RY.has(q))continue;Q.push(K),J.push(q)}let G=Function(...J,`
65
65
  'use strict';
66
66
  try {
67
67
  return ${Y};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var{defineProperty:u,getOwnPropertyNames:fQ,getOwnPropertyDescriptor:mQ}=Object,hQ=Object.prototype.hasOwnProperty;function dQ(Q){return this[Q]}var bZ=(Q)=>{var Z=(t??=new WeakMap).get(Q),$;if(Z)return Z;if(Z=u({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function"){for(var Y of fQ(Q))if(!hQ.call(Z,Y))u(Z,Y,{get:dQ.bind(Q,Y),enumerable:!($=mQ(Q,Y))||$.enumerable})}return t.set(Q,Z),Z},t;var uQ=(Q)=>Q;function lQ(Q,Z){this[Q]=uQ.bind(null,Z)}var e=(Q,Z)=>{for(var $ in Z)u(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:lQ.bind(Z,$)})};var f=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var l=import.meta.require;import QQ from"process";function ZQ(Q="STX_PUBLIC_"){let Z={},$={};for(let[Y,X]of Object.entries(QQ.env)){if(!Y.startsWith(Q)||X===void 0)continue;Z[`import.meta.env.${Y}`]=JSON.stringify(X),$[Y]=X}return Z["import.meta.env"]=JSON.stringify($),Z}function kZ(Q="STX_PUBLIC_"){let Z={};for(let[$,Y]of Object.entries(QQ.env))if($.startsWith(Q)&&Y!==void 0)Z[$]=Y;return Z}var $Q=()=>{};function SZ(Q){C={...C,...Q}}function CZ(){C={...XQ}}function vZ(){return{...C}}function oQ(Q){let Z="",$=null,Y=!1;for(let X=0;X<Q.length;X++){let J=Q[X];if(Y){Y=!1;continue}if(J==="\\"&&$){Y=!0;continue}if($){if($==="`"&&J==="$"&&X+1<Q.length&&Q[X+1]==="{"){let W=1;X+=2;while(X<Q.length&&W>0){if(Q[X]==="{")W++;else if(Q[X]==="}")W--;if(W>0)Z+=Q[X],X++}continue}if(J===$)$=null;continue}if(J==='"'||J==="'"||J==="`"){$=J;continue}Z+=J}return Z}function sQ(Q,Z){let $=/[$A-Z_a-z][$\w]*/g,Y;while((Y=$.exec(Q))!==null){let X=Y[0],J=Q[Y.index-1];if(pQ.has(X))throw Error(`Potentially unsafe expression (identifier ${X}): ${Z}`);if(J==="."&&JQ.has(X))throw Error(`Potentially unsafe expression (property ${X}): ${Z}`)}}function aQ(Q){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,$;while(($=Z.exec(Q))!==null){let Y=$[2];if(!JQ.has(Y))continue;let X=Q.slice(0,$.index).match(/\S(?=\s*$)/)?.[0],J=Q.slice($.index+$[0].length).match(/^\s*(\S)/)?.[1];if(!((X==="{"||X===",")&&J===":"))throw Error(`Potentially unsafe expression (bracket key ${$[2]}): ${Q}`)}}function o(Q){let Z=Q.trim(),$=oQ(Z);sQ($,Z),aQ(Z);for(let Y of c)if(Y.test($))throw Error(`Potentially unsafe expression (matched /${Y.source}/): ${Z}`);if(!C.allowBracketNotation&&cQ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function WQ(Q){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[$,Y]of Object.entries(Q)){if($.startsWith("__")||c.some((X)=>X.test($)))continue;if(Y&&typeof Y==="object"&&!Array.isArray(Y))Z[$]=p(Y);else Z[$]=Y}return Z}function p(Q,Z=0){if(Z>=C.maxSanitizeDepth)return"[Object too deep]";if(Q===null||typeof Q!=="object")return Q;if(Array.isArray(Q))return Q.map((Y)=>p(Y,Z+1));if(Q instanceof Date||Q instanceof RegExp||Q instanceof Map||Q instanceof Set||Q instanceof Error)return Q;let $={};for(let[Y,X]of Object.entries(Q)){if(Y.startsWith("__")||Y==="constructor"||Y==="prototype")continue;if(X&&typeof X==="object")$[Y]=p(X,Z+1);else $[Y]=X}return $}function P(Q,Z){try{let $=WQ(Z),Y=Object.keys($),X=Object.values($);return rQ(Q,Y)(...X)}catch{return}}function xZ(Q){try{return o(Q),!0}catch{return!1}}function gZ(Q){try{return o(Q),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function fZ(Q,Z){try{let $=P(Q,Z);return Boolean($)}catch{return!1}}function mZ(Q,Z){try{let $=P(Q,Z);if(Array.isArray($))return $;if($&&typeof $==="object"&&"length"in $){let Y=$.length;if(typeof Y==="number"&&Number.isFinite(Y)&&Y>=0&&Number.isInteger(Y))return Array.from($)}return[]}catch{return[]}}function hZ(Q,Z){try{let $=P(Q,Z);if($&&typeof $==="object"&&!Array.isArray($))return $;return{}}catch{return{}}}function rQ(Q,Z){let $=o(Q),Y=/^[A-Za-z_$][\w$]*$/,X=[],J=[];for(let z=0;z<Z.length;z++){let U=Z[z];if(!Y.test(U))continue;if(iQ.has(U))continue;X.push(z),J.push(U)}let W=Function(...J,`
2
+ var{defineProperty:u,getOwnPropertyNames:fQ,getOwnPropertyDescriptor:mQ}=Object,hQ=Object.prototype.hasOwnProperty;function dQ(Q){return this[Q]}var bZ=(Q)=>{var Z=(t??=new WeakMap).get(Q),$;if(Z)return Z;if(Z=u({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function"){for(var Y of fQ(Q))if(!hQ.call(Z,Y))u(Z,Y,{get:dQ.bind(Q,Y),enumerable:!($=mQ(Q,Y))||$.enumerable})}return t.set(Q,Z),Z},t;var uQ=(Q)=>Q;function lQ(Q,Z){this[Q]=uQ.bind(null,Z)}var e=(Q,Z)=>{for(var $ in Z)u(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:lQ.bind(Z,$)})};var f=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var l=import.meta.require;import QQ from"process";function ZQ(Q="STX_PUBLIC_"){let Z={},$={};for(let[Y,X]of Object.entries(QQ.env)){if(!Y.startsWith(Q)||X===void 0)continue;Z[`import.meta.env.${Y}`]=JSON.stringify(X),$[Y]=X}return Z["import.meta.env"]=JSON.stringify($),Z}function kZ(Q="STX_PUBLIC_"){let Z={};for(let[$,Y]of Object.entries(QQ.env))if($.startsWith(Q)&&Y!==void 0)Z[$]=Y;return Z}var $Q=()=>{};function SZ(Q){C={...C,...Q}}function CZ(){C={...XQ}}function vZ(){return{...C}}function oQ(Q){let Z="",$=null,Y=!1;for(let X=0;X<Q.length;X++){let J=Q[X];if(Y){Y=!1;continue}if(J==="\\"&&$){Y=!0;continue}if($){if($==="`"&&J==="$"&&X+1<Q.length&&Q[X+1]==="{"){let W=1;X+=2;while(X<Q.length&&W>0){if(Q[X]==="{")W++;else if(Q[X]==="}")W--;if(W>0)Z+=Q[X],X++}continue}if(J===$)$=null;continue}if(J==='"'||J==="'"||J==="`"){$=J;continue}Z+=J}return Z}function sQ(Q,Z){let $=/[$A-Z_a-z][$\w]*/g,Y;while((Y=$.exec(Q))!==null){let X=Y[0],J=Q[Y.index-1];if(pQ.has(X))throw Error(`Potentially unsafe expression (matched /\\b${X}\\b/; identifier ${X}): ${Z}`);if(J==="."&&JQ.has(X))throw Error(`Potentially unsafe expression (matched /.${X}/; property ${X}): ${Z}`)}}function aQ(Q){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,$;while(($=Z.exec(Q))!==null){let Y=$[2];if(!JQ.has(Y))continue;let X=Q.slice(0,$.index).match(/\S(?=\s*$)/)?.[0],J=Q.slice($.index+$[0].length).match(/^\s*(\S)/)?.[1];if(!((X==="{"||X===",")&&J===":"))throw Error(`Potentially unsafe expression (bracket key ${$[2]}): ${Q}`)}}function o(Q){let Z=Q.trim(),$=oQ(Z);sQ($,Z),aQ(Z);for(let Y of c)if(Y.test($))throw Error(`Potentially unsafe expression (matched /${Y.source}/): ${Z}`);if(!C.allowBracketNotation&&cQ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function WQ(Q){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[$,Y]of Object.entries(Q)){if($.startsWith("__")||c.some((X)=>X.test($)))continue;if(Y&&typeof Y==="object"&&!Array.isArray(Y))Z[$]=p(Y);else Z[$]=Y}return Z}function p(Q,Z=0){if(Z>=C.maxSanitizeDepth)return"[Object too deep]";if(Q===null||typeof Q!=="object")return Q;if(Array.isArray(Q))return Q.map((Y)=>p(Y,Z+1));if(Q instanceof Date||Q instanceof RegExp||Q instanceof Map||Q instanceof Set||Q instanceof Error)return Q;let $={};for(let[Y,X]of Object.entries(Q)){if(Y.startsWith("__")||Y==="constructor"||Y==="prototype")continue;if(X&&typeof X==="object")$[Y]=p(X,Z+1);else $[Y]=X}return $}function P(Q,Z){try{let $=WQ(Z),Y=Object.keys($),X=Object.values($);return rQ(Q,Y)(...X)}catch{return}}function xZ(Q){try{return o(Q),!0}catch{return!1}}function gZ(Q){try{return o(Q),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function fZ(Q,Z){try{let $=P(Q,Z);return Boolean($)}catch{return!1}}function mZ(Q,Z){try{let $=P(Q,Z);if(Array.isArray($))return $;if($&&typeof $==="object"&&"length"in $){let Y=$.length;if(typeof Y==="number"&&Number.isFinite(Y)&&Y>=0&&Number.isInteger(Y))return Array.from($)}return[]}catch{return[]}}function hZ(Q,Z){try{let $=P(Q,Z);if($&&typeof $==="object"&&!Array.isArray($))return $;return{}}catch{return{}}}function rQ(Q,Z){let $=o(Q),Y=/^[A-Za-z_$][\w$]*$/,X=[],J=[];for(let z=0;z<Z.length;z++){let U=Z[z];if(!Y.test(U))continue;if(iQ.has(U))continue;X.push(z),J.push(U)}let W=Function(...J,`
3
3
  'use strict';
4
4
  try {
5
5
  return ${$};
@@ -612,7 +612,7 @@ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
612
612
  `}),$}import k3 from"process";function m0($="STX_PUBLIC_"){let Z={},Y={};for(let[X,J]of Object.entries(k3.env)){if(!X.startsWith($)||J===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(J),Y[X]=J}return Z["import.meta.env"]=JSON.stringify(Y),Z}function RB($="STX_PUBLIC_"){let Z={};for(let[Y,X]of Object.entries(k3.env))if(Y.startsWith($)&&X!==void 0)Z[Y]=X;return Z}var f1=()=>{};var D9={};c(D9,{hasUserImports:()=>bJ,bundleClientScript:()=>CJ});import L0 from"path";import n0 from"fs";function bJ($){let Z=/^\s*import\s+(?!type\s)/gm;if(!$.match(Z))return!1;let X=/^\s*import\s+(?!type\s).*?\s+from\s+['"]([^'"]+)['"]/gm,J;while((J=X.exec($))!==null){let G=J[1];if(!S3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected user import:",G),!0}let Q=/^\s*import\s+['"]([^'"]+)['"]/gm;while((J=Q.exec($))!==null){let G=J[1];if(!S3.some((q)=>q.test(G)))return console.log("[stx:bundler] detected side-effect import:",G),!0}return!1}function yJ($,Z,Y){let X=(J,Q)=>{let G=J===Y?Z:L0.dirname(J),K=L0.resolve(G,Q),q=[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.mjs`,`${K}.jsx`,L0.join(K,"index.ts"),L0.join(K,"index.tsx"),L0.join(K,"index.js"),L0.join(K,"index.mjs")];for(let z of q)try{if(n0.existsSync(z)&&n0.statSync(z,{throwIfNoEntry:!1})?.isFile())return z}catch{}return K};return{name:"stx-client-bundle",setup(J){J.onResolve({filter:/^(stx|@stacksjs\/stx|@stacksjs\/browser)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Q)=>({path:Q.path,external:!0})),J.onResolve({filter:/^\.\.?\//},(Q)=>{return{path:X(Q.importer,Q.path)}}),J.onResolve({filter:/^@\//},(Q)=>{let G=L0.resolve($,Q.path.slice(2)),K=[G,`${G}.ts`,`${G}.js`,L0.join(G,"index.ts"),L0.join(G,"index.js")];for(let q of K)if(n0.existsSync(q)&&n0.statSync(q,{throwIfNoEntry:!1})?.isFile())return console.log("[stx:bundler] resolved @/ import:",Q.path,"\u2192",q),{path:q};return console.warn("[stx:bundler] could not resolve @/ import:",Q.path),{path:G}})}}}async function CJ($,Z,Y={}){let X=Y.projectRoot||process.cwd(),J=Y.minify??!1,Q=Y.cacheDir||L0.join(X,".stx","bundle-cache"),G=new Bun.CryptoHasher("md5");G.update($+Z);let K=G.digest("hex").slice(0,12),q=L0.join(Q,`${K}.js`),z=Bun.file(q);if(await z.exists())return console.log("[stx:bundler] cache hit:",K),await z.text();let _=L0.join(X,".stx","bundle-tmp"),W=L0.join(_,`${K}.ts`),U=L0.join(_,"out",K);n0.mkdirSync(_,{recursive:!0}),n0.mkdirSync(U,{recursive:!0});let B=L0.dirname(Z),j=[],O=/^(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^(export\s+)?(?:async\s+)?function\s+(\w+)/gm,F;while((F=O.exec($))!==null){if(F[1])continue;if(F[2])F[2].split(",").forEach((V)=>{let R=V.split(":")[0].trim();if(R)j.push(R)});else if(F[3])j.push(F[3])}while((F=L.exec($))!==null){if(F[1])continue;j.push(F[2])}let H=j.length>0?`
613
613
  export { ${j.join(", ")} }`:"";await Bun.write(W,$+H),console.log("[stx:bundler] bundling:",K,"from:",L0.basename(Z));try{let V=await Bun.build({entrypoints:[W],outdir:U,target:"browser",format:"esm",minify:J,plugins:[yJ(X,B,W)],define:{"process.env.NODE_ENV":J?'"production"':'"development"',...m0()},root:X});if(!V.success){let w=V.logs.filter((A)=>A.level==="error").map((A)=>A.message).join(", ");return console.warn("[stx:bundler] build failed:",w),$}let R="";for(let w of V.outputs){R=await w.text();break}return R=R.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),console.log("[stx:bundler] bundled:",K,"output:",R.length,"bytes"),n0.mkdirSync(Q,{recursive:!0}),await Bun.write(q,R),R}catch(V){let R=V instanceof Error?V.message:String(V),w=V?.errors,A=Array.isArray(w)&&w.length>0?`
614
614
  ${w.map((N)=>`- ${N?.message??N}`).join(`
615
- `)}`:"";return console.warn(`[stx:bundler] error: ${R}${A}`),$}finally{try{n0.rmSync(W,{force:!0}),n0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var S3;var E9=b(()=>{f1();S3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function IB($){g1={...g1,...$}}function DB(){g1={...y3}}function EB(){return{...g1}}function xJ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function fJ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(PJ.has(J))throw Error(`Potentially unsafe expression (identifier ${J}): ${Z}`);if(Q==="."&&C3.has(J))throw Error(`Potentially unsafe expression (property ${J}): ${Z}`)}}function gJ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!C3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function z5($){let Z=$.trim(),Y=xJ(Z);fJ(Y,Z),gJ(Z);for(let X of S9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!g1.allowBracketNotation&&vJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function P3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||S9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=k9(X);else Z[Y]=X}return Z}function k9($,Z=0){if(Z>=g1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>k9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=k9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=P3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return z5($),!0}catch{return!1}}function kB($){try{return z5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function SB($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function bB($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=z5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(hJ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
615
+ `)}`:"";return console.warn(`[stx:bundler] error: ${R}${A}`),$}finally{try{n0.rmSync(W,{force:!0}),n0.rmSync(U,{recursive:!0,force:!0})}catch{}}}var S3;var E9=b(()=>{f1();S3=[/^stx$/,/^@stacksjs\/stx$/,/^@stacksjs\/browser$/,/^@stores$/,/^stx\/stores$/,/^@composables$/]});function IB($){g1={...g1,...$}}function DB(){g1={...y3}}function EB(){return{...g1}}function xJ($){let Z="",Y=null,X=!1;for(let J=0;J<$.length;J++){let Q=$[J];if(X){X=!1;continue}if(Q==="\\"&&Y){X=!0;continue}if(Y){if(Y==="`"&&Q==="$"&&J+1<$.length&&$[J+1]==="{"){let G=1;J+=2;while(J<$.length&&G>0){if($[J]==="{")G++;else if($[J]==="}")G--;if(G>0)Z+=$[J],J++}continue}if(Q===Y)Y=null;continue}if(Q==='"'||Q==="'"||Q==="`"){Y=Q;continue}Z+=Q}return Z}function fJ($,Z){let Y=/[$A-Z_a-z][$\w]*/g,X;while((X=Y.exec($))!==null){let J=X[0],Q=$[X.index-1];if(PJ.has(J))throw Error(`Potentially unsafe expression (matched /\\b${J}\\b/; identifier ${J}): ${Z}`);if(Q==="."&&C3.has(J))throw Error(`Potentially unsafe expression (matched /.${J}/; property ${J}): ${Z}`)}}function gJ($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,Y;while((Y=Z.exec($))!==null){let X=Y[2];if(!C3.has(X))continue;let J=$.slice(0,Y.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(Y.index+Y[0].length).match(/^\s*(\S)/)?.[1];if(!((J==="{"||J===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${Y[2]}): ${$}`)}}function z5($){let Z=$.trim(),Y=xJ(Z);fJ(Y,Z),gJ(Z);for(let X of S9)if(X.test(Y))throw Error(`Potentially unsafe expression (matched /${X.source}/): ${Z}`);if(!g1.allowBracketNotation&&vJ.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function P3($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[Y,X]of Object.entries($)){if(Y.startsWith("__")||S9.some((J)=>J.test(Y)))continue;if(X&&typeof X==="object"&&!Array.isArray(X))Z[Y]=k9(X);else Z[Y]=X}return Z}function k9($,Z=0){if(Z>=g1.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((X)=>k9(X,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let Y={};for(let[X,J]of Object.entries($)){if(X.startsWith("__")||X==="constructor"||X==="prototype")continue;if(J&&typeof J==="object")Y[X]=k9(J,Z+1);else Y[X]=J}return Y}function n($,Z){try{let Y=P3(Z),X=Object.keys(Y),J=Object.values(Y);return t($,X)(...J)}catch{return}}function a($){try{return z5($),!0}catch{return!1}}function kB($){try{return z5($),null}catch(Z){return Z instanceof Error?Z.message:String(Z)}}function SB($,Z){try{let Y=n($,Z);return Boolean(Y)}catch{return!1}}function bB($,Z){try{let Y=n($,Z);if(Array.isArray(Y))return Y;if(Y&&typeof Y==="object"&&"length"in Y){let X=Y.length;if(typeof X==="number"&&Number.isFinite(X)&&X>=0&&Number.isInteger(X))return Array.from(Y)}return[]}catch{return[]}}function _0($,Z){try{let Y=n($,Z);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function t($,Z){let Y=z5($),X=/^[A-Za-z_$][\w$]*$/,J=[],Q=[];for(let K=0;K<Z.length;K++){let q=Z[K];if(!X.test(q))continue;if(hJ.has(q))continue;J.push(K),Q.push(q)}let G=Function(...Q,`
616
616
  'use strict';
617
617
  try {
618
618
  return ${Y};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.53",
4
+ "version": "0.2.54",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -104,10 +104,10 @@
104
104
  "zip:windows-x64": "zip -j bin/stx-windows-x64.zip bin/stx-windows-x64.exe",
105
105
  "zip:darwin-x64": "zip -j bin/stx-darwin-x64.zip bin/stx-darwin-x64",
106
106
  "zip:darwin-arm64": "zip -j bin/stx-darwin-arm64.zip bin/stx-darwin-arm64",
107
- "lint": "bunx --bun pickier lint",
108
- "lint:fix": "bunx --bun pickier lint --fix",
109
- "fresh": "bunx rimraf node_modules/ bun.lock && bun i",
110
- "changelog": "bunx changelogen --output CHANGELOG.md",
107
+ "lint": "bun x --bun pickier lint",
108
+ "lint:fix": "bun x --bun pickier lint --fix",
109
+ "fresh": "bun x rimraf node_modules/ bun.lock && bun i",
110
+ "changelog": "bun x changelogen --output CHANGELOG.md",
111
111
  "prepublishOnly": "bun run build",
112
112
  "test": "bun test --preload ./happy-dom.ts",
113
113
  "test:watch": "bun test --watch --preload ./happy-dom.ts",
@@ -117,10 +117,10 @@
117
117
  "dependencies": {
118
118
  "@cwcss/crosswind": "^0.2.0",
119
119
  "@stacksjs/clapp": "^0.2.0",
120
- "@stacksjs/desktop": "0.2.53",
120
+ "@stacksjs/desktop": "0.2.54",
121
121
  "@stacksjs/sanitizer": "0.2.35",
122
122
  "@stacksjs/ts-craft": "^0.0.2",
123
- "bun-plugin-stx": "0.2.51",
123
+ "bun-plugin-stx": "0.2.54",
124
124
  "bunfig": "^0.15.6",
125
125
  "stx-router": "0.2.53",
126
126
  "ts-broadcasting": "^0.0.4",