@stacksjs/stx 0.2.648 → 0.2.654
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-17srvghf.js +2 -0
- package/dist/{chunk-nt0n0vjm.js → chunk-1zb7ar32.js} +2 -2
- package/dist/{chunk-e87xa4r3.js → chunk-26whq1rg.js} +2 -2
- package/dist/{chunk-k79x96ra.js → chunk-28jtt8hn.js} +42 -42
- package/dist/{chunk-zsgcsqat.js → chunk-2yg9y1na.js} +99 -99
- package/dist/{chunk-481d4kr9.js → chunk-2zqg980j.js} +1 -1
- package/dist/{chunk-x5tjb4y4.js → chunk-35zjpdcb.js} +1 -1
- package/dist/chunk-3634ds4n.js +2 -0
- package/dist/{chunk-nj1t4g3a.js → chunk-36649w15.js} +6 -6
- package/dist/chunk-3msbc4zj.js +2 -0
- package/dist/chunk-3q3gsr7m.js +2 -0
- package/dist/{chunk-3q163st5.js → chunk-3v8yejzc.js} +3 -3
- package/dist/chunk-42v0vegr.js +2 -0
- package/dist/{chunk-2jh21f1n.js → chunk-46w53nj5.js} +1 -1
- package/dist/{chunk-0jhdrgpr.js → chunk-48acjmeg.js} +2 -2
- package/dist/{chunk-55zaxb4s.js → chunk-4e0z858k.js} +10 -10
- package/dist/{chunk-yq021b3r.js → chunk-4nbq7mnp.js} +4 -4
- package/dist/{chunk-7rta163c.js → chunk-4qwvqbzf.js} +2 -2
- package/dist/{chunk-hjm69qnj.js → chunk-50pkybyn.js} +1 -1
- package/dist/{chunk-88z4wkrj.js → chunk-5yxd4ryz.js} +2 -2
- package/dist/{chunk-vqc4h16r.js → chunk-6598d3m6.js} +2 -2
- package/dist/{chunk-ab7zqtax.js → chunk-6raq8r7w.js} +1 -1
- package/dist/{chunk-zmh9p9aa.js → chunk-6rparhvs.js} +1 -1
- package/dist/{chunk-t1k9160w.js → chunk-71mthavp.js} +32 -32
- package/dist/chunk-73swyb5p.js +2 -0
- package/dist/{chunk-b0hpshvk.js → chunk-7wnd2psp.js} +1 -1
- package/dist/{chunk-ymymwzt5.js → chunk-8gewq710.js} +1 -1
- package/dist/{chunk-3zyjqvsq.js → chunk-929zbzh7.js} +9 -9
- package/dist/{chunk-v2x9vzgw.js → chunk-9y2ncrnq.js} +2 -2
- package/dist/{chunk-c9k40352.js → chunk-a2a74f6c.js} +1 -1
- package/dist/{chunk-67xhsacd.js → chunk-bgt1dx8c.js} +1 -1
- package/dist/chunk-c9b0cme2.js +2 -0
- package/dist/{chunk-89yj6tcd.js → chunk-cq40n7ak.js} +1 -1
- package/dist/{chunk-f46ht5kq.js → chunk-cvw7gknw.js} +3 -3
- package/dist/chunk-d0xcykw6.js +2 -0
- package/dist/{chunk-vdxjy7j2.js → chunk-d3bsfd10.js} +2 -2
- package/dist/{chunk-rjh2jwxx.js → chunk-d4tf0tfn.js} +4 -4
- package/dist/chunk-dxjc11hx.js +2 -0
- package/dist/{chunk-zhf01af3.js → chunk-dxk5sqtv.js} +2 -2
- package/dist/chunk-edz1h5f9.js +2 -0
- package/dist/{chunk-fg3jw17w.js → chunk-en8jgavy.js} +6 -5
- package/dist/chunk-etw04j02.js +2 -0
- package/dist/chunk-ewng6v6g.js +49 -0
- package/dist/{chunk-9121nkpj.js → chunk-ex1kd5gs.js} +3 -3
- package/dist/chunk-fbd9w4ys.js +2 -0
- package/dist/{chunk-qfe7ps3v.js → chunk-ff1cb7k4.js} +2 -2
- package/dist/chunk-fnj3gja0.js +2 -0
- package/dist/chunk-fsnby15p.js +2 -0
- package/dist/{chunk-pbtkbe48.js → chunk-g7j3mwzd.js} +18 -18
- package/dist/{chunk-3p7mk3mw.js → chunk-gmrc24cb.js} +1 -1
- package/dist/{chunk-p44kmbdg.js → chunk-h09a03ay.js} +4 -4
- package/dist/chunk-h0bg2h0j.js +2 -0
- package/dist/{chunk-wjt0kej9.js → chunk-h4vg78mw.js} +1 -1
- package/dist/{chunk-4q2dtxdk.js → chunk-hjmnsa6a.js} +1 -1
- package/dist/{chunk-er60h3j3.js → chunk-ht3dxx5m.js} +1 -1
- package/dist/{chunk-h5nmf98w.js → chunk-hw7sv4ac.js} +1 -1
- package/dist/{chunk-pg0xzsss.js → chunk-j2bkjtp3.js} +4 -4
- package/dist/chunk-j3472s37.js +3 -0
- package/dist/chunk-jmx4q1yr.js +2 -0
- package/dist/{chunk-j393gsfd.js → chunk-k49fg322.js} +2 -2
- package/dist/{chunk-0vkawews.js → chunk-k7nan28e.js} +5 -5
- package/dist/{chunk-06w0z1cm.js → chunk-kcrtqyek.js} +4 -4
- package/dist/{chunk-t2pzy3x1.js → chunk-khvc43pq.js} +2 -2
- package/dist/{chunk-qm4672dj.js → chunk-ktvr9ta8.js} +2 -2
- package/dist/{chunk-wq6j2h32.js → chunk-m47spkxr.js} +7 -7
- package/dist/chunk-m947aq9a.js +2 -0
- package/dist/{chunk-jkaszw24.js → chunk-mgj34bbg.js} +1 -1
- package/dist/{chunk-r1r6311d.js → chunk-n7xbhzzt.js} +4 -4
- package/dist/chunk-ndtxkps4.js +2 -0
- package/dist/{chunk-np4zm2ph.js → chunk-nttspz8c.js} +4 -4
- package/dist/chunk-pge3bzqx.js +2 -0
- package/dist/{chunk-9txn4rvb.js → chunk-phws2c9s.js} +1 -1
- package/dist/{chunk-j5gd0e53.js → chunk-q1x7ckfw.js} +1 -1
- package/dist/chunk-q79ksfcd.js +2 -0
- package/dist/chunk-qjf1c8fa.js +2 -0
- package/dist/{chunk-gv793yqq.js → chunk-qrt8b179.js} +2 -2
- package/dist/{chunk-w2zceynt.js → chunk-qygynhzc.js} +1 -1
- package/dist/{chunk-6ea6az61.js → chunk-ra56jh7e.js} +1 -1
- package/dist/chunk-rmdw6s65.js +2 -0
- package/dist/chunk-s0crnpyx.js +2 -0
- package/dist/{chunk-8p9kpfk8.js → chunk-s4cs2n2c.js} +1 -1
- package/dist/{chunk-t82be9yf.js → chunk-sd4jwn3y.js} +1 -1
- package/dist/chunk-t7j4h3nf.js +128 -0
- package/dist/{chunk-sgptbhrc.js → chunk-v9bmw06j.js} +1 -1
- package/dist/{chunk-gz90fqn8.js → chunk-vmn2b6p6.js} +1 -1
- package/dist/{chunk-aprhqxky.js → chunk-vngnface.js} +3 -3
- package/dist/{chunk-0h8tg21j.js → chunk-vs8kg85h.js} +1 -1
- package/dist/{chunk-84djpte6.js → chunk-wbzmr6a4.js} +2 -2
- package/dist/{chunk-ye8tgmd3.js → chunk-wh838rdh.js} +1 -1
- package/dist/{chunk-xm2mee4a.js → chunk-x9d4bpmh.js} +21 -21
- package/dist/{chunk-mnp8ecj9.js → chunk-xdgvb5a5.js} +1 -1
- package/dist/{chunk-pxs7sgnp.js → chunk-xhmpfq9d.js} +1 -1
- package/dist/{chunk-hfpv56cp.js → chunk-xq410rsc.js} +1 -1
- package/dist/{chunk-xvs04cnp.js → chunk-y8881za3.js} +1 -1
- package/dist/chunk-z75bp57x.js +2 -0
- package/dist/{chunk-8d2f2e42.js → chunk-znnfjxph.js} +1 -1
- package/dist/chunk-zrqremja.js +2 -0
- package/dist/cli.js +11 -11
- package/dist/client/signals-head-runtime.js +2 -1
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/expressions.js +9 -0
- package/dist/interpolation-context.d.ts +2 -0
- package/dist/interpolation-context.js +8 -0
- package/dist/native/bridge/protocol.d.ts +2 -0
- package/dist/native/compiler/bundle.d.ts +6 -0
- package/dist/native/compiler/bundle.js +16 -9
- package/dist/native/compiler/headwind-to-style.d.ts +5 -1
- package/dist/native/compiler/headwind-to-style.js +188 -3
- package/dist/native/compiler/html-to-ir.d.ts +2 -1
- package/dist/native/compiler/html-to-ir.js +9 -4
- package/dist/native/compiler/ir.d.ts +15 -0
- package/dist/native/compiler/layout-chrome.d.ts +6 -0
- package/dist/native/compiler/layout-chrome.js +72 -0
- package/dist/native/compiler/render-screen.js +19 -3
- package/dist/native/compiler/style-config.d.ts +32 -0
- package/dist/native/compiler/style-config.js +71 -0
- package/dist/native/compiler/stylesheet-rules.d.ts +17 -0
- package/dist/native/compiler/stylesheet-rules.js +107 -0
- package/dist/native/runtime/browser-screen.js +11 -0
- package/dist/native/runtime/craft-bridge.d.ts +3 -0
- package/dist/native/runtime/craft-bridge.js +41 -4
- package/dist/native/runtime/jsc-globals.d.ts +2 -0
- package/dist/native/runtime/jsc-globals.js +8 -1
- package/dist/native/runtime/native-host.d.ts +5 -0
- package/dist/native/runtime/native-host.js +48 -5
- package/dist/native/runtime/shared-screen.js +18 -2
- package/dist/native/runtime/web-navigation.d.ts +33 -0
- package/dist/native/runtime/web-navigation.js +107 -0
- package/dist/native/runtime/web-storage.d.ts +56 -0
- package/dist/native/runtime/web-storage.js +89 -0
- package/dist/native/testing.d.ts +3 -0
- package/dist/native/testing.js +3 -0
- package/dist/native-signing.d.ts +2 -0
- package/dist/native-signing.js +13 -4
- package/dist/process.js +2 -0
- package/dist/pwa.js +3 -3
- package/dist/reactive-bindings.js +3 -1
- package/dist/ssg.js +12 -12
- package/dist/utils.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-0en5jwjy.js +0 -2
- package/dist/chunk-2n3pa5gm.js +0 -2
- package/dist/chunk-354jmw2k.js +0 -3
- package/dist/chunk-3b5bphcn.js +0 -2
- package/dist/chunk-57md41g9.js +0 -2
- package/dist/chunk-6vh8s0pg.js +0 -2
- package/dist/chunk-8fsq2ynj.js +0 -2
- package/dist/chunk-8tpmz4as.js +0 -2
- package/dist/chunk-9x0zt65f.js +0 -2
- package/dist/chunk-a2bw46t9.js +0 -2
- package/dist/chunk-a4sggwcz.js +0 -2
- package/dist/chunk-b4fd2dtk.js +0 -2
- package/dist/chunk-c1479y92.js +0 -2
- package/dist/chunk-embejqx4.js +0 -2
- package/dist/chunk-eyfxw7ds.js +0 -2
- package/dist/chunk-f3y4fnaa.js +0 -2
- package/dist/chunk-f7930sce.js +0 -2
- package/dist/chunk-fsbjat59.js +0 -2
- package/dist/chunk-h15xb2vd.js +0 -2
- package/dist/chunk-m6qfqkbh.js +0 -2
- package/dist/chunk-ncqh5qe5.js +0 -2
- package/dist/chunk-radggg3p.js +0 -49
- package/dist/chunk-sszhz1zh.js +0 -2
- package/dist/chunk-weqc0ssb.js +0 -2
- package/dist/chunk-xfzcv0jc.js +0 -2
- package/dist/chunk-y9x4pyp2.js +0 -2
- package/dist/chunk-zdnc7a4t.js +0 -127
- package/dist/chunk-zyqs6a3p.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{k}from"./chunk-
|
|
2
|
+
import{k}from"./chunk-2yg9y1na.js";import{oe}from"./chunk-wbzmr6a4.js";function g(e,t){let r={};for(let n of e)r[n]=oe(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=oe(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function Mi(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=oe(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:V}}var tl=Mi;class Pn{rules=[];defaultValue="";addRule(e){let t=new Pn;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new Pn;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new Pn;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var td=new Pn;function nl(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>k(c,{...t,message:l},r)).join(`
|
|
3
3
|
`)}catch{return""}})}function rl(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>k(c,{...t,message:l},r)).join(`
|
|
4
4
|
`)}catch{return""}})}function sl(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function nd(e,t,r){let n=e;return n=nl(n,t,r),n=rl(n,t,r),n=sl(n,t,r),n}export{Mi,tl,Pn,td,nl,rl,sl,nd};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{op,na,ip,ra,yl,bl,en,Wn,ap,vl,wl,cp,h}from"./chunk-ff1cb7k4.js";import"./chunk-xhmpfq9d.js";import"./chunk-2yg9y1na.js";import"./chunk-35zjpdcb.js";import"./chunk-2h8ea0we.js";import"./chunk-4e0z858k.js";import"./chunk-ce6zddpf.js";import"./chunk-4qwvqbzf.js";export{en as buildCss,vl as extractClassNames,bl as fingerprintConfig,wl as generateCss,ap as getCachedCSS,op as getCssServeAsset,h as injectCss,na as loadCssEngine,ra as loadCssEngineConfig,Wn as rebuildCss,ip as resetCssCache,yl as resolveUserCssConfig,cp as withLinkedModuleBundles};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{N,Rl,po,i,R,xp,Sp}from"./chunk-3v8yejzc.js";import"./chunk-26whq1rg.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-h09a03ay.js";import"./chunk-qrt8b179.js";import"./chunk-2yg9y1na.js";import"./chunk-35zjpdcb.js";import"./chunk-2h8ea0we.js";import"./chunk-4e0z858k.js";import"./chunk-ce6zddpf.js";import"./chunk-4qwvqbzf.js";export{R as config,N as defaultConfig,xp as defineStxConfig,po as discoverConfig,i as loadStxConfig,Rl as resolveStxDirectories,Sp as validateConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Je}from"./chunk-
|
|
2
|
+
import{Je}from"./chunk-qrt8b179.js";import{pt,On}from"./chunk-en8jgavy.js";import{Pe,cn,Xa,Ja}from"./chunk-2yg9y1na.js";import{pr,fr,gr,hr,we}from"./chunk-4e0z858k.js";import{A}from"./chunk-2h8ea0we.js";import{jo}from"./chunk-35zjpdcb.js";import{h}from"./chunk-ff1cb7k4.js";import{s}from"./chunk-g7j3mwzd.js";import{N,i}from"./chunk-3v8yejzc.js";import{wa}from"./chunk-04kg16qs.js";import{ze,Se,$i,Ri,kn}from"./chunk-kcrtqyek.js";import{Zt,Ks}from"./chunk-5yxd4ryz.js";import{Cn}from"./chunk-6598d3m6.js";import{qt,jn,Bn}from"./chunk-xaa36b0x.js";import{V}from"./chunk-n7xbhzzt.js";import m from"fs";import c from"path";import{createHash as Q}from"crypto";function W(o){return Q("sha256").update(o).digest("hex").slice(0,8)}function J(o=!1){let l=o?On():pt(),a=W(l);return{content:l,filename:`runtime.${a}.js`,hash:a}}function U(){let o=Je(),l=W(o);return{content:o,filename:`router.${l}.js`,hash:l}}import q from"path";import{createHash as ee}from"crypto";function te(o={}){let l=new Set;return{context:new Proxy(o,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function X(o,l,a={}){let r=q.resolve(o),e=await Bun.file(r).text(),S=ee("sha256").update(e).digest("hex").slice(0,16);Xa();let _={};try{_=await i(a.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,f;while((f=d.exec(e))!==null){let R=f[1];if(/\bserver\b/.test(R))y.push(f[2])}let u=new Set(y.flatMap((R)=>Pe(R))),{context:D}=te({__filename:r,__dirname:q.dirname(r),__stx_serverDeclared:u}),w=new Set,j={...N,..._,...a,buildMode:"compile",strict:!1},b=await s(e,D,r,j,w),C=ze(b),P=Ja();return{route:l,sourceFile:o,html:b,fragment:C,placeholders:P,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(w),contentHash:S,status:cn(e),streamTemplates:D.__streamTemplates}}var re=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(o,l){let a=0,r=0;if(!m.existsSync(o))return{copied:a,bytes:r};m.mkdirSync(l,{recursive:!0});function e(S,_){let y=m.readdirSync(S,{withFileTypes:!0});for(let d of y){if(re.has(d.name))continue;let f=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(f,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(f,u),a++,r+=m.statSync(u).size}}}return e(o,l),{copied:a,bytes:r}}async function Mu(o={}){let l=Date.now(),a=c.resolve(o.root||process.cwd()),r=c.resolve(a,o.outputDir||".output");console.log("[stx build] Starting production build...");let e=await i(a),S=c.resolve(a,o.componentsDir??e.componentsDir??"components"),_=c.resolve(a,o.partialsDir??e.partialsDir??"partials"),y=c.resolve(a,o.layoutsDir??e.layoutsDir??"layouts"),d=o.publicDir??e.publicDir??"public",f=we(e.app?.head,{known:hr,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",w=o.routeRules??e.routeRules??{},j=Cn(w),b=o.serverApi??e.serverApi,C=typeof b==="object"?b:{};if(b)Zt(a,C);if(e.runtimeConfig)A(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let P=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let n of P)m.mkdirSync(n,{recursive:!0});console.log("[stx build] Discovering routes...");let R=V(a,{pagesDirs:e._layerPageDirs}),Y=["components","layouts","partials"],B=R.filter((n)=>!Y.some((g)=>n.pattern.startsWith(`/${g}/`)||n.pattern===`/${g}`));console.log(`[stx build] Found ${B.length} page routes (${R.length-B.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=J(o.debug),x=U();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",x.filename),x.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${x.filename} (${(x.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let M=[],k=[];for(let n of B){let g=j(n.pattern),O=g.rendering==="prerender";if(O&&(n.pattern.includes(":")||n.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${n.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await X(n.filePath,n.pattern,{configDir:a,componentsDir:S,partialsDir:_,layoutsDir:y,debug:o.debug});if(M.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,x.filename),t.html=gr(t.html,f,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=pr(t.html,u);if(f.htmlAttrs)t.html=fr(t.html,f.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let I=p[1];t.html=t.html.replace(" "+I,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${I}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await h(t.html),O){let p=await kn(t,{params:{},request:new Request(`http://stx.build${n.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${n.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=Se(t.html,D);let L=n.pattern==="/"?"index":n.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),z=c.join("server","pages",`${L}.compiled.json`),G=c.join("server","fragments",`${L}.html`);await Bun.write(c.join(r,z),JSON.stringify(t,null,2)),await Bun.write(c.join(r,G),t.fragment),k.push({pattern:n.pattern,compiledPath:z,fragmentPath:G,isDynamic:t.hasServerScripts,hasParams:n.pattern.includes(":")||n.pattern.includes("["),prerendered:O}),console.log(`[stx build] \u2713 ${n.pattern}`)}catch(t){if(Object.keys(g).length)throw t;console.error(`[stx build] \u2717 ${n.pattern}:`,t instanceof Error?t.message:t)}}let E=c.resolve(a,d);if(m.existsSync(E)){let{copied:n,bytes:g}=Z(E,c.join(r,"public"));if(n>0)console.log(`[stx build] Copied ${n} public asset${n===1?"":"s"} (${(g/1024).toFixed(1)}KB) from ${d}/`)}let H=Bn(a);if(H){let{copied:n,bytes:g}=Z(H,c.join(r,"public",jn));if(n>0)console.log(`[stx build] Copied ${n} asset${n===1?"":"s"} (${(g/1024).toFixed(1)}KB) from ${qt}/`)}let F={runtime:v.filename,router:x.filename},T=$i(k,F,r);if(T.routeRules=w,T.routerContainer=D,b)T.apiRoutes=await Ks(a,r,C);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await jo(a,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(wa(e._layerGraph),null,2));Ri(T,r);let K=Date.now()-l;return console.log(`
|
|
3
3
|
[stx build] Done in ${K}ms \u2014 ${M.length} pages compiled`),{pageCount:M.length,assets:F,outputDir:r,duration:K}}
|
|
4
4
|
export{Mu};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{un,zl,Hl,Vl,Ul,Wl,f,ql,Po,Gl,Va,Ua}from"./chunk-
|
|
2
|
+
import{un,zl,Hl,Vl,Ul,Wl,f,ql,Po,Gl,Va,Ua}from"./chunk-2yg9y1na.js";import"./chunk-35zjpdcb.js";import"./chunk-2h8ea0we.js";import"./chunk-4e0z858k.js";import"./chunk-ce6zddpf.js";import"./chunk-4qwvqbzf.js";export{un as STX_ENGINE_BINDING_NAMES,Po as convertToCommonJS,Va as extractScriptFromTemplate,f as extractVariables,Ua as hasVariables,ql as isCompleteImport,Wl as isMissingBindingFailure,Vl as isModuleResolutionFailure,Ul as isSyntaxFailure,Gl as splitDeclaration,zl as stripTypeScript,Hl as withoutStxReferrer};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-4e0z858k.js";import{Cs,Ko,gc}from"./chunk-4qwvqbzf.js";import"./chunk-ce6zddpf.js";import"./chunk-2yg9y1na.js";import"./chunk-2h8ea0we.js";import"./chunk-35zjpdcb.js";import"./chunk-a3d0g4mr.js";import"./chunk-qrt8b179.js";import{i}from"./chunk-3v8yejzc.js";import"./chunk-h09a03ay.js";import"./chunk-04kg16qs.js";import"./chunk-xhmpfq9d.js";import{gt,Ve,fe,Qt,Te,Vn,Un,Ue}from"./chunk-ff1cb7k4.js";import{s}from"./chunk-g7j3mwzd.js";import"./chunk-929zbzh7.js";import"./chunk-ewng6v6g.js";import"./chunk-36649w15.js";import{Vr}from"./chunk-k7nan28e.js";import"./chunk-prf164ct.js";import{pt}from"./chunk-en8jgavy.js";import"./chunk-9y2ncrnq.js";import"./chunk-5yxd4ryz.js";import{qs}from"./chunk-cvw7gknw.js";import"./chunk-8gewq710.js";import"./chunk-n7xbhzzt.js";import"./chunk-wh838rdh.js";import"./chunk-26whq1rg.js";import{existsSync as me,mkdirSync as qr,readFileSync as Gr}from"fs";import X from"path";import{existsSync as Je,mkdirSync as en,realpathSync as Mr,rmSync as tn}from"fs";import O from"path";import{existsSync as Ir}from"fs";import K from"path";var an="data-stx-b",Ze=new Set(Ko),cn=new Set(Cs);function ln(t){if(t==="ref"||t==="data-stx-ref")return"ref";if(t.startsWith("::"))return null;if(t.startsWith("@bind:")||t.startsWith("x-bind:"))return"attr";if(t.startsWith("@")||t.startsWith(":")){let e=t.slice(1).split(".")[0];if(Ze.has(e))return e==="if"?"if":e;if(e==="for"||e==="else"||e==="else-if"||e==="elseif")return"for";if(gc(e))return"event";if(t.startsWith("@"))return"event";return"attr"}if(t.startsWith("x-")){let e=t.split(".")[0];if(!cn.has(e))return"attr";let n=e.slice(2);if(n==="cloak"||n==="data"||n==="bind")return null;if(n==="tooltip"||n==="tooltip-position")return null;return Ze.has(n)?n==="if"?"if":n:"attr"}return null}function un(t){let e=[];for(let[n,r]of t){let o=ln(n);if(o)e.push({name:n,value:r,kind:o})}return e}var dn=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,ye=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function et(t){let e=[],n=0;return{html:t.replace(dn,(o,a,u)=>{if(!u||!/[:@]|x-/.test(u))return o;let l=[];ye.lastIndex=0;for(let h=ye.exec(u);h;h=ye.exec(u))l.push([h[1],h[2]??h[3]??h[4]??""]);let d=un(l);if(!d.length)return o;let m={id:n++,bindings:d};if(d.some((h)=>h.kind==="for"))m.template=!0;e.push(m);let b=o.endsWith("/>");return`${o.slice(0,b?-2:-1).trimEnd()} ${an}="${m.id}"${b?"/>":">"}`}),manifest:{entries:e}}}import Zn from"path";function se(t){let e=t&&/^(\d+(?:\.\d+)?|\.\d+)(px|rem)?$/.exec(t.trim());if(!e)return;let n=Number(e[1])*(e[2]==="rem"?16:1);return Number.isFinite(n)?n:void 0}function be(t,e){if(!fe[t])return;return se(e?.get(Qt(t))??fe[t].value)}function ve(t,e){let n=Vn[t];if(!n)return;return se(e?.get(Ue(n))??Te[n]?.value)}function we(t,e){let n=Un[t];if(!n)return;let r=se(e?.get(Ue(n.size))??Te[n.size]?.value),o=se(e?.get(Ue(n.leading))??Te[n.leading]?.value);if(r===void 0||o===void 0)return;return{fontSize:r,lineHeight:o}}var fn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},it=xe({}),tt,nt=null;function Ne(){let t=globalThis.__stxNativeStyleConfig;if(!t)return it;if(t!==tt)tt=t,nt=xe(t);return nt}function st(t,e=new Map,n=""){for(let[r,o]of Object.entries(t??{})){let a=r==="DEFAULT"?n.replace(/-$/,""):`${n}${r}`;if(typeof o==="string")e.set(a,o);else if(o&&typeof o==="object")st(o,e,`${a}-`)}return e}function ot(t){let e={};for(let[n,r]of Object.entries(t??{})){let o=typeof r==="number"?r:Number.parseFloat(String(r));if(Number.isFinite(o))e[n]=o}return e}function xe(t){return{shortcuts:new Map(Object.entries(t.shortcuts??{}).filter(([,e])=>typeof e==="string")),colors:st(t.colors),breakpoints:new Map(Object.entries({...fn,...ot(t.breakpoints)}))}}var Se={};function rt(t){Se=t??{},it=xe(Se)}async function at(t,e){let n=Se;rt(t);try{return await e()}finally{rt(n)}}function ct(t){if(!t)return{};let e=t.theme??{},n=Object.fromEntries(Object.entries(t.shortcuts??{}).filter(([,r])=>typeof r==="string"));return{...Object.keys(n).length?{shortcuts:n}:{},...e.colors?{colors:JSON.parse(JSON.stringify(e.colors))}:{},...e.screens?{breakpoints:ot(e.screens)}:{}}}function lt(t){return Ne().shortcuts.get(t)}function ut(t){return Ne().colors.get(t)}function dt(t){return Ne().breakpoints.get(t)}var ht=/^--[\w\u0080-\uFFFF-]+$/u;function ft(t,e){if(!/var\(/i.test(t))return t;let n="",r="",o=!1;for(let a=0;a<t.length;a++){let u=t[a];if(u==="\\"){n+=t.slice(a,a+2),a++;continue}if(r){if(n+=u,u===r)r="";continue}if(u==='"'||u==="'"){r=u,n+=u;continue}if(t.slice(a,a+4).toLowerCase()!=="var("||a>0&&/[\w-]/.test(t[a-1])){n+=u;continue}let l=1,d=-1,m="",b=a+4;for(;b<t.length;b++){let g=t[b];if(g==="\\"){b++;continue}if(m){if(g===m)m="";continue}if(g==='"'||g==="'"){m=g;continue}if(g==="(")l++;if(g===")"&&--l===0)break;if(g===","&&l===1&&d===-1)d=b}if(l!==0)return;let f=t.slice(a+4,d===-1?b:d).trim();if(!ht.test(f))return;let h=e(f,d===-1?void 0:t.slice(d+1,b).trim());if(h===void 0||n.length+h.length>65536)return;n+=h,o=!0,a=b}return o&&n.length>65536?void 0:n}function te(t,e){let n=new Map,r=new Set;for(let[c,p]of t){let y=c.trim();if(!ht.test(y))continue;if(typeof p==="string"||typeof p==="number"&&Number.isFinite(p))n.set(y,String(p).trim())}let o=new Map,a=new Set;for(let[c,p]of n){let y=new Set,v=(x,w=0)=>w>64?void 0:ft(x,(S,T)=>(y.add(S),T===void 0?"":v(T,w+1)));if(v(p)===void 0)a.add(c);o.set(c,y)}let u=new Map,l=new Map,d=[],m=new Set,b=0;function f(c,p=0){if(p>64){a.add(c);return}u.set(c,b),l.set(c,b++),d.push(c),m.add(c);for(let x of o.get(c)??[]){if(!n.has(x))continue;if(!u.has(x)){if(f(x,p+1),l.has(x))l.set(c,Math.min(l.get(c),l.get(x)))}else if(m.has(x))l.set(c,Math.min(l.get(c),u.get(x)))}if(l.get(c)!==u.get(c))return;let y=[],v;do v=d.pop(),m.delete(v),y.push(v);while(v!==c);if(y.length>1||o.get(c)?.has(c))y.forEach((x)=>a.add(x))}for(let c of n.keys())if(!u.has(c))f(c);let h=new Map;function g(c,p){if(r.add(c),h.has(c))return h.get(c);let y=n.get(c),v=y===void 0||/^(?:inherit|unset)$/i.test(y)?e?.get(c):a.has(c)||/^(?:initial|revert|revert-layer)$/i.test(y)?void 0:N(y,p+1);return h.set(c,v),v}function N(c,p=0){if(p>64)return;return ft(c,(y,v)=>g(y,p)??(v===void 0?void 0:N(v,p+1)))}return{resolve:N,used:r,computed(){let c=new Map(e);for(let p of n.keys())c.set(p,g(p,0));return c}}}function ke(t){if(t.display==="flex"&&t.flexDirection==null)return{...t,flexDirection:"row"};return t}var mt=new Set(["display","gridColumns","gridTemplateColumns","gridTemplateRows","gridAutoRows","flex","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","order","justifyContent","alignItems","alignSelf","alignContent","position","top","right","bottom","left","zIndex","width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle","backgroundColor","backgroundImage","opacity","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","color","fontSize","fontWeight","fontStyle","fontFamily","lineHeight","letterSpacing","textAlign","textDecorationLine","textDecorationColor","textTransform","resizeMode","tintColor","transform","overflow","fill","stroke","strokeWidth","gradientDirection","gradientFrom","gradientVia","gradientTo"]),pn=new Set(["gridColumns","gridAutoRows","flex","flexGrow","flexShrink","order","zIndex","aspectRatio","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","opacity","shadowOpacity","shadowRadius","elevation","fontSize","lineHeight","letterSpacing","strokeWidth"]),yt=new Set(["top","right","bottom","left","width","height","minWidth","maxWidth","minHeight","maxHeight","flexBasis","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical"]),gn=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,hn=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(px|rem|em)?$/i,mn=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),yn=new Set(["perspective","scale","scaleX","scaleY","translateX","translateY"]);function bn(t){if(typeof t!=="string")return t;let e=hn.exec(t);return e?Number(e[1])*(/^r?em$/i.test(e[2]||"")?16:1):t}function ee(t){return typeof t==="number"&&Number.isFinite(t)}function vn(t,e){if(t==="shadowOffset"&&e&&typeof e==="object"&&!Array.isArray(e)){let{width:n,height:r}=e;return ee(n)&&ee(r)?{width:n,height:r}:void 0}if(t==="transform"&&Array.isArray(e)){let n=[];for(let r of e){if(!r||typeof r!=="object"||Array.isArray(r)||Object.keys(r).length!==1)return;let[o,a]=Object.entries(r)[0];if(yn.has(o)&&ee(a))n.push({[o]:a});else if(mn.has(o)&&typeof a==="string"&&/^[+-]?(?:\d+\.?\d*|\.\d+)(?:deg|rad)$/.test(a))n.push({[o]:a});else return}return n}return}function wn(t){let e=[],n=0,r=0,o="";for(let a=0;a<=t.length;a++){let u=t[a];if(u==="\\"){a++;continue}if(o){if(u===o)o="";continue}if(u==='"'||u==="'"){o=u;continue}if(u==="(")r++;if(u===")")r=Math.max(0,r-1);if(a!==t.length&&(u!==";"||r))continue;let l=t.slice(n,a),d=l.indexOf(":");if(d!==-1)e.push([l.slice(0,d).trim(),l.slice(d+1).trim()]);n=a+1}return e}function Sn(t,e){let n;if(typeof t==="string"){if(t=t.trim(),!t)return[];try{t=JSON.parse(t)}catch{}}if(typeof t==="string")n=wn(t);else if(t&&typeof t==="object"&&!Array.isArray(t))n=Object.entries(t);else{if(t!=null&&t!==!1)e({kind:"non-numeric-style",name:"style"});return[]}return n}function oe(t,e=()=>{},n={}){let r=Sn(t,e),o=te(r,n.inheritedVariables);return n.onVariables?.(o.computed()),Nn(r,o,e)}function Nn(t,e,n){let r={},o=[];for(let[a,u]of t){if(a.trim().startsWith("--")){o.push(a.trim());continue}let l=mt.has(a)||a.trim().startsWith("--")?a:a.trim().toLowerCase().replace(/-([a-z])/g,(b,f)=>f.toUpperCase());if(!mt.has(l)){n({kind:"unknown-style",name:l});continue}if(u==null||u==="")continue;let d=typeof u==="string"?e.resolve(u.trim()):u;if(d===void 0){n({kind:"non-numeric-style",name:l});continue}if(d==="")continue;let m;if(pn.has(l)||yt.has(l)){if(m=bn(d),!ee(m)&&!(yt.has(l)&&typeof m==="string"&&m.endsWith("%")&&gn.test(m.slice(0,-1))&&Number.isFinite(Number(m.slice(0,-1)))))m=void 0}else if(l==="display"&&d==="inline-flex")m="flex";else if(l==="shadowOffset"||l==="transform")m=vn(l,d);else if(l==="gridTemplateColumns"||l==="gridTemplateRows")m=ee(d)||typeof d==="string"?d:void 0;else if(l==="fontWeight"&&ee(d))m=String(d);else if(typeof d==="string")m=d;if(m===void 0)n({kind:"non-numeric-style",name:l});else r[l]=m}for(let a of o)if(!e.used.has(a))n({kind:"unknown-style",name:a});return r}var xn={transparent:"transparent",current:"currentColor",black:"#000000",white:"#ffffff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},_e={px:1,0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},bt={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128},vt={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function Q(t){let e=t.lastIndexOf("/");if(e>0&&(!t.endsWith("]")||/\/\[[\d.]+%?\]$/.test(t))){let r=Q(t.slice(0,e)),o=t.slice(e+1),a=/^\[(.+)\]$/.test(o)?Number.parseFloat(o.slice(1,-1))*(o.includes("%")?1:100):Number.parseFloat(o);if(!r||!Number.isFinite(a))return;return kn(r,a/100)}if(t==="transparent")return"transparent";if(t==="current")return"currentColor";if(t==="black")return"#000000";if(t==="white")return"#ffffff";let n=t.split("-");if(n.length===2){let[r,o]=n,a=xn[r];if(a&&typeof a==="object")return a[o]}if(t.startsWith("[")&&t.endsWith("]")){let r=t.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(r)?r:void 0}return}function Ee(t){return Q(t.trim())}function kn(t,e){if(t==="transparent")return t;let n=t.startsWith("#")?t.slice(1):"";if(n.length===3)n=n.split("").map((o)=>o+o).join("");if(n.length===8)n=n.slice(0,6);if(n.length!==6)return;let r=Math.round(Math.min(1,Math.max(0,e))*255);return`#${n}${r.toString(16).padStart(2,"0")}`}function Re(t,e=16){if(!t.startsWith("[")||!t.endsWith("]"))return;let n=t.slice(1,-1),r=Number.parseFloat(n);if(!Number.isFinite(r))return;if(n.endsWith("rem"))return r*16;if(n.endsWith("em"))return r*e;return r}function P(t){if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1);if(e.endsWith("%"))return;let n=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(n)?n:void 0}return _e[t]??ve(t)}function ae(t){let e=/^\[(-?\d*\.?\d+)%\]$/.exec(t);if(e)return`${Number.parseFloat(e[1])}%`;return P(t)}var Tn={flex:(t,e)=>(e.display="flex",!0),hidden:(t,e)=>(e.display="none",!0),grid:(t,e)=>(e.display="grid",!0),"flex-row":(t,e)=>(e.flexDirection="row",!0),"flex-col":(t,e)=>(e.flexDirection="column",!0),"flex-row-reverse":(t,e)=>(e.flexDirection="row-reverse",!0),"flex-col-reverse":(t,e)=>(e.flexDirection="column-reverse",!0),"flex-wrap":(t,e)=>(e.flexWrap="wrap",!0),"flex-nowrap":(t,e)=>(e.flexWrap="nowrap",!0),"flex-wrap-reverse":(t,e)=>(e.flexWrap="wrap-reverse",!0),"flex-1":(t,e)=>(e.flex=1,e.flexGrow=1,e.flexShrink=1,e.flexBasis=0,!0),"flex-auto":(t,e)=>(e.flexGrow=1,e.flexShrink=1,!0),"flex-initial":(t,e)=>(e.flexGrow=0,e.flexShrink=1,!0),"flex-none":(t,e)=>(e.flexGrow=0,e.flexShrink=0,!0),grow:(t,e)=>(e.flexGrow=1,!0),"grow-0":(t,e)=>(e.flexGrow=0,!0),shrink:(t,e)=>(e.flexShrink=1,!0),"shrink-0":(t,e)=>(e.flexShrink=0,!0),"order-first":(t,e)=>(e.order=-9999,!0),"order-last":(t,e)=>(e.order=9999,!0),"order-none":(t,e)=>(e.order=0,!0),"justify-start":(t,e)=>(e.justifyContent="flex-start",!0),"justify-center":(t,e)=>(e.justifyContent="center",!0),"justify-end":(t,e)=>(e.justifyContent="flex-end",!0),"justify-between":(t,e)=>(e.justifyContent="space-between",!0),"justify-around":(t,e)=>(e.justifyContent="space-around",!0),"justify-evenly":(t,e)=>(e.justifyContent="space-evenly",!0),"items-start":(t,e)=>(e.alignItems="flex-start",!0),"items-center":(t,e)=>(e.alignItems="center",!0),"items-end":(t,e)=>(e.alignItems="flex-end",!0),"items-stretch":(t,e)=>(e.alignItems="stretch",!0),"items-baseline":(t,e)=>(e.alignItems="baseline",!0),"self-auto":(t,e)=>(e.alignSelf="auto",!0),"self-start":(t,e)=>(e.alignSelf="flex-start",!0),"self-center":(t,e)=>(e.alignSelf="center",!0),"self-end":(t,e)=>(e.alignSelf="flex-end",!0),"self-stretch":(t,e)=>(e.alignSelf="stretch",!0),"self-baseline":(t,e)=>(e.alignSelf="baseline",!0),"min-w-0":(t,e)=>(e.minWidth=0,!0),"aspect-square":(t,e)=>(e.aspectRatio=1,!0),"inset-0":(t,e)=>(e.top=0,e.right=0,e.bottom=0,e.left=0,!0),"mx-auto":(t,e)=>(e.alignSelf="center",!0),fixed:(t,e)=>(e.position="absolute",!0),sticky:()=>!0,"sr-only":(t,e)=>(e.position="absolute",e.width=1,e.height=1,e.overflow="hidden",!0),inline:()=>!0,"inline-block":()=>!0,contents:()=>!0,"align-top":()=>!0,"align-middle":()=>!0,"align-bottom":()=>!0,"align-baseline":()=>!0,"align-text-top":()=>!0,"whitespace-normal":()=>!0,"whitespace-pre":()=>!0,"whitespace-pre-line":()=>!0,"whitespace-pre-wrap":()=>!0,"whitespace-nowrap":()=>!0,"break-words":()=>!0,"break-all":()=>!0,"break-normal":()=>!0,"object-cover":()=>!0,"object-contain":()=>!0,"object-fill":()=>!0,"object-center":()=>!0,"tracking-tighter":(t,e)=>(e.letterSpacing=-0.8,!0),"tracking-tight":(t,e)=>(e.letterSpacing=-0.4,!0),"tracking-normal":(t,e)=>(e.letterSpacing=0,!0),"tracking-wide":(t,e)=>(e.letterSpacing=0.4,!0),"tracking-wider":(t,e)=>(e.letterSpacing=0.8,!0),"tracking-widest":(t,e)=>(e.letterSpacing=1.6,!0),"tabular-nums":()=>!0,block:()=>!0,"inline-flex":(t,e)=>(e.display="flex",!0),truncate:()=>!0,relative:(t,e)=>(e.position="relative",!0),absolute:(t,e)=>(e.position="absolute",!0),"overflow-visible":(t,e)=>(e.overflow="visible",!0),"overflow-hidden":(t,e)=>(e.overflow="hidden",!0),"overflow-scroll":(t,e)=>(e.overflow="scroll",!0),"overflow-x-auto":()=>!0,"overflow-x-scroll":()=>!0,"overflow-y-auto":()=>!0,"overflow-y-scroll":()=>!0,"font-thin":(t,e)=>(e.fontWeight="100",!0),"font-extralight":(t,e)=>(e.fontWeight="200",!0),"font-light":(t,e)=>(e.fontWeight="300",!0),"font-normal":(t,e)=>(e.fontWeight="400",!0),"font-medium":(t,e)=>(e.fontWeight="500",!0),"font-semibold":(t,e)=>(e.fontWeight="600",!0),"font-bold":(t,e)=>(e.fontWeight="bold",!0),"font-extrabold":(t,e)=>(e.fontWeight="800",!0),"font-black":(t,e)=>(e.fontWeight="900",!0),italic:(t,e)=>(e.fontStyle="italic",!0),"not-italic":(t,e)=>(e.fontStyle="normal",!0),"text-left":(t,e)=>(e.textAlign="left",!0),"text-center":(t,e)=>(e.textAlign="center",!0),"text-right":(t,e)=>(e.textAlign="right",!0),"text-justify":(t,e)=>(e.textAlign="justify",!0),uppercase:(t,e)=>(e.textTransform="uppercase",!0),lowercase:(t,e)=>(e.textTransform="lowercase",!0),capitalize:(t,e)=>(e.textTransform="capitalize",!0),"normal-case":(t,e)=>(e.textTransform="none",!0),underline:(t,e)=>(e.textDecorationLine="underline",!0),"line-through":(t,e)=>(e.textDecorationLine="line-through",!0),"no-underline":(t,e)=>(e.textDecorationLine="none",!0)};function Rn(t,e){if(!t.startsWith("bg-"))return!1;let n=t.slice(3),r=Q(n);if(r)return e.backgroundColor=r,!0;return!1}function An(t,e){if(!t.startsWith("text-"))return!1;let n=t.slice(5),r=we(n);if(r)return Object.assign(e,r),!0;if(bt[n])return e.fontSize=bt[n],!0;if(n.startsWith("[")&&n.endsWith("]")){let a=n.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(a)){let u=a.endsWith("rem")||a.endsWith("em")?Number.parseFloat(a)*16:Number.parseFloat(a);if(Number.isFinite(u))return e.fontSize=u,!0}}let o=Q(n);if(o)return e.color=o,!0;return!1}var _n=new Set(["t","tr","r","br","b","bl","l","tl"]);function En(t,e){let n=/^bg-(?:gradient|linear)-to-([a-z]+)$/.exec(t);if(n&&_n.has(n[1]))return e.gradientDirection=`to-${n[1]}`,!0;let r=/^(from|via|to)-(.+)$/.exec(t);if(!r)return!1;let o=Q(r[2]);if(!o)return!1;if(r[1]==="from")e.gradientFrom=o;else if(r[1]==="via")e.gradientVia=o;else e.gradientTo=o;return!0}function In(t,e){for(let n of["fill","stroke"]){let r=`${n}-`;if(!t.startsWith(r))continue;let o=t.slice(r.length);if(o==="none")return e[n]="none",!0;if(n==="stroke"&&/^\d+(?:\.\d+)?$/.test(o))return e.strokeWidth=Number.parseFloat(o),!0;if(n==="stroke"&&/^\[\d+(?:\.\d+)?(?:px)?\]$/.test(o))return e.strokeWidth=Number.parseFloat(o.slice(1)),!0;let a=Q(o);if(a)return e[n]=a,!0}return!1}function Cn(t,e){if(t.startsWith("p-")){let n=P(t.slice(2));if(n!==void 0)return e.padding=n,!0}if(t.startsWith("px-")){let n=P(t.slice(3));if(n!==void 0)return e.paddingHorizontal=n,!0}if(t.startsWith("py-")){let n=P(t.slice(3));if(n!==void 0)return e.paddingVertical=n,!0}if(t.startsWith("pt-")){let n=P(t.slice(3));if(n!==void 0)return e.paddingTop=n,!0}if(t.startsWith("pr-")){let n=P(t.slice(3));if(n!==void 0)return e.paddingRight=n,!0}if(t.startsWith("pb-")){let n=P(t.slice(3));if(n!==void 0)return e.paddingBottom=n,!0}if(t.startsWith("pl-")){let n=P(t.slice(3));if(n!==void 0)return e.paddingLeft=n,!0}return!1}function St(t,e){if(/^-(?:m|mx|my|mt|mr|mb|ml)-/.test(t)){let n={};if(!St(t.slice(1),n))return!1;let r=Object.entries(n);if(r.some(([,o])=>typeof o!=="number"))return!1;for(let[o,a]of r)e[o]=-a;return!0}if(t.startsWith("m-")){let n=P(t.slice(2));if(n!==void 0)return e.margin=n,!0}if(t.startsWith("mx-")){let n=P(t.slice(3));if(n!==void 0)return e.marginHorizontal=n,!0}if(t.startsWith("my-")){let n=P(t.slice(3));if(n!==void 0)return e.marginVertical=n,!0}if(t.startsWith("mt-")){let n=P(t.slice(3));if(n!==void 0)return e.marginTop=n,!0}if(t.startsWith("mr-")){let n=P(t.slice(3));if(n!==void 0)return e.marginRight=n,!0}if(t.startsWith("mb-")){let n=P(t.slice(3));if(n!==void 0)return e.marginBottom=n,!0}if(t.startsWith("ml-")){let n=P(t.slice(3));if(n!==void 0)return e.marginLeft=n,!0}return!1}function On(t,e){if(!t.startsWith("w-"))return!1;let n=t.slice(2);if(n==="full")return e.width="100%",!0;if(n==="screen")return e.width="100%",!0;if(n==="auto")return e.width="auto",!0;if(n.includes("/")){let[o,a]=n.split("/"),u=Number.parseInt(o)/Number.parseInt(a)*100;return e.width=`${u}%`,!0}let r=ae(n);if(r!==void 0)return e.width=r,!0;return!1}function Pn(t,e){if(!t.startsWith("h-"))return!1;let n=t.slice(2);if(n==="full")return e.height="100%",!0;if(n==="screen")return e.height="100%",!0;if(n==="auto")return e.height="auto",!0;let r=ae(n);if(r!==void 0)return e.height=r,!0;return!1}function Bn(t,e){if(t==="rounded")return e.borderRadius=vt.DEFAULT,!0;if(!t.startsWith("rounded-"))return!1;let n=t.slice(8);if(n==="")return!1;let r=/^(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(n),o=vt[r[2]]??be(r[2])??Re(r[2]);if(o===void 0)return!1;let a={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],tl:["borderTopLeftRadius"],tr:["borderTopRightRadius"],bl:["borderBottomLeftRadius"],br:["borderBottomRightRadius"]};for(let u of r[1]?a[r[1]]:["borderRadius"])e[u]=o;return!0}function Mn(t,e){let n=/^border(?:-([trblxy]))?(?:-(\d+|\[[^\]]+\]))?$/.exec(t);if(!n)return!1;let[,r="",o]=n,a=o===void 0?1:Number(o);if(o?.startsWith("[")){let l=/^\[(\d+(?:\.\d+)?|\.\d+)(px|rem)?\]$/.exec(o);if(!l)return!1;a=Number(l[1])*(l[2]==="rem"?16:1)}if(!Number.isFinite(a)||a<0)return!1;let u={"":["borderWidth"],t:["borderTopWidth"],r:["borderRightWidth"],b:["borderBottomWidth"],l:["borderLeftWidth"],x:["borderLeftWidth","borderRightWidth"],y:["borderTopWidth","borderBottomWidth"]};for(let l of u[r])e[l]=a;return!0}function Ln(t,e){if(!t.startsWith("border-"))return!1;let n=t.slice(7),r=Q(n);if(r)return e.borderColor=r,!0;return!1}function Dn(t,e){if(!t.startsWith("opacity-"))return!1;let n=Number.parseInt(t.slice(8));if(!Number.isNaN(n))return e.opacity=n/100,!0;return!1}function $n(t,e){if(t.startsWith("tracking-[")){let n=Re(t.slice(9),typeof e.fontSize==="number"?e.fontSize:16);if(n===void 0)return!1;return e.letterSpacing=n,!0}if(t.startsWith("leading-")){let n=t.slice(8),r=typeof e.fontSize==="number"?e.fontSize:16,o={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},a=n.startsWith("[")?/^\[[\d.]+\]$/.test(n)?Number.parseFloat(n.slice(1,-1))*r:Re(n,r):o[n]!==void 0?o[n]*r:_e[n];if(a===void 0||!Number.isFinite(a))return!1;return e.lineHeight=a,!0}return!1}function jn(t,e){let n=/^(-?)(inset-x|inset-y|inset|top|right|bottom|left)-(.+)$/.exec(t);if(!n)return!1;let r=n[3],o=/^\[(-?[\d.]+)px\]$/.exec(r),a=o?Number(o[1]):_e[r];if(a===void 0||!Number.isFinite(a))return!1;let u=n[1]?-a:a,l=n[2]==="inset"?["top","right","bottom","left"]:n[2]==="inset-x"?["left","right"]:n[2]==="inset-y"?["top","bottom"]:[n[2]];for(let d of l)e[d]=u;return!0}function Wn(t,e){let n=/^grid-cols-\[(.+)\]$/.exec(t);if(n)return e.gridColumns=n[1].split("_").filter(Boolean).length,!0;let r=/^grid-cols-(\d+)$/.exec(t);if(!r)return!1;return e.gridColumns=Number(r[1]),!0}function Fn(t,e){if(!t.startsWith("size-"))return!1;let n=t.slice(5),r=n==="full"?"100%":ae(n);if(r===void 0)return!1;return e.width=r,e.height=r,!0}var zn={xs:320,sm:384,md:448,lg:512,xl:576,"2xl":672,"3xl":768,"4xl":896,"5xl":1024,"6xl":1152,"7xl":1280};function Xn(t,e){let n=/^(min|max)-(w|h)-(.+)$/.exec(t);if(!n)return!1;let[,r,o,a]=n,u=a==="full"||a==="screen"?"100%":a==="none"?void 0:o==="w"&&r==="max"&&zn[a]||ae(a);if(u===void 0&&a!=="none")return!1;let l=`${r}${o==="w"?"Width":"Height"}`;if(u===void 0)delete e[l];else e[l]=u;return!0}function Hn(t,e){let n=/^(-?)(top|right|bottom|left)-(.+)$/.exec(t);if(!n)return!1;let r=n[3]==="full"?"100%":P(n[3]);if(r===void 0)return!1;return e[n[2]]=typeof r==="number"&&n[1]?-r:r,!0}function qn(t,e){let n=/^(-?)translate-(x|y)-(.+)$/.exec(t);if(!n)return!1;let r=n[3],o;if(r.startsWith("[")){let l=/^\[([+-]?(?:\d+\.?\d*|\.\d+))(px|rem|em)?\]$/.exec(r);if(!l)return!1;o=Number(l[1])*(l[2]?.endsWith("em")?16:1)}else o=P(r);if(o===void 0||!Number.isFinite(o))return!1;if(n[1])o=-o;let a=n[2]==="x"?"translateX":"translateY",u=a==="translateX"?{translateX:o}:{translateY:o};return e.transform=[...(e.transform??[]).filter((l)=>!(a in l)),u],!0}function Gn(t,e){let n=/^space-(x|y)-(.+)$/.exec(t);if(!n)return!1;let r=P(n[2]);if(r===void 0)return!1;return e.gap=r,!0}function Jn(t,e){if(t.startsWith("gap-")){let n=P(t.slice(4));if(n!==void 0)return e.gap=n,!0}if(t.startsWith("gap-x-")){let n=P(t.slice(6));if(n!==void 0)return e.columnGap=n,!0}if(t.startsWith("gap-y-")){let n=P(t.slice(6));if(n!==void 0)return e.rowGap=n,!0}return!1}function Kn(t,e){let r={"shadow-none":[0,0,0,0],"shadow-xs":[1,1,0.05,1],"shadow-sm":[2,1,0.1,2],shadow:[3,2,0.12,3],"shadow-md":[6,4,0.15,4],"shadow-lg":[10,6,0.18,8],"shadow-xl":[16,10,0.2,12],"shadow-2xl":[24,16,0.25,18]}[t];if(!r)return!1;let[o,a,u,l]=r;return Object.assign(e,{shadowColor:"#000000",shadowOpacity:u,shadowRadius:o,shadowOffset:{width:0,height:a},elevation:l}),!0}var Yn=new Set(["hover","group-hover","peer-hover","active","group-active","visited","placeholder","selection","print","motion-safe"]),Qn=/^(?:transition(?:-[a-z]+)?|duration-\S+|ease-\S+|delay-\S+|will-change-\S+|cursor-\S+|select-(?:none|text|all|auto)|outline-none|outline-0|appearance-none|scroll-smooth|scroll-auto|antialiased|subpixel-antialiased|touch-\S+|resize(?:-\S+)?|backdrop-blur(?:-\S+)?|isolate|contain-\S+)$/;function Nt(t){let e=[],n=0,r=0;for(let o=0;o<t.length;o++){let a=t[o];if(a==="[")n++;else if(a==="]")n=Math.max(0,n-1);else if(a===":"&&n===0)e.push(t.slice(r,o)),r=o+1}return e.push(t.slice(r)),e}function xt(t,e=new Set){let n=Nt(t),r=n[n.length-1],o=e.has(r)?void 0:lt(r);if(o===void 0)return[t];let a=n.slice(0,-1).map((l)=>`${l}:`).join(""),u=new Set(e).add(r);return o.split(/\s+/).filter(Boolean).flatMap((l)=>xt(`${a}${l}`,u))}function ce(t,e,n={}){let r=new Map,o=(f,h)=>{if(!r.has(f))r.set(f,{...h,classes:[],authored:new Map});return r.get(f)};o("base",{});let a=[];for(let f of t.split(/\s+/).filter(Boolean)){if(n.rules&&Object.hasOwn(n.rules,f)){a.push(f);continue}for(let h of xt(f)){let g=Nt(h),N=g.pop(),c=g.some((S)=>S.startsWith("focus"));if(g.some((S)=>/^(?:group-|peer-)?focus(?:-visible|-within)?$/.test(S))&&/^(?:ring|outline)(?:-|$)/.test(N))continue;if(Qn.test(N)||!c&&g.some((S)=>Yn.has(S)))continue;let p,y=!1,v=[];for(let S of g){let T=dt(S);if(T!==void 0&&p===void 0)p=T;else if(S==="disabled"&&!y)y=!0;else v.push(S)}let x=[...v,N].join(":"),w=y?o("disabled",{disabled:!0}):p!==void 0?o(`min:${p}`,{min:p}):r.get("base");if(y&&p!==void 0){r.get("base").authored.set(h,f),r.get("base").classes.push(h);continue}if(w.classes.push(x),!w.authored.has(x))w.authored.set(x,f===h?h:`${f} (${h})`)}}let u=(f,h)=>h.map((g)=>f.authored.get(g)??g),l=r.get("base"),d=Ae(l.classes.join(" "),e,n),m=new Map;if(a.length){let f=(N)=>N?oe(N,()=>{},{inheritedVariables:e}):{},h={},g={};for(let N of a){let c=n.rules[N];h={...h,...f(c.light)},g={...g,...f(c.dark)};for(let p of c.responsive??[]){let y=m.get(p.min)??{style:{}};if(y.style={...y.style,...f(p.light)},p.dark)y.dark={...y.dark,...f(p.dark)};m.set(p.min,y)}}if(d.style={...h,...d.style},Object.keys(g).length)d.dark={...g,...d.dark}}d.unknown=u(l,d.unknown);let b=[];for(let f of r.values()){if(f===l)continue;let h=Ae(f.classes.join(" "),e);d.unknown=[...new Set([...d.unknown,...u(f,h.unknown)])];let g={style:h.style,...h.dark?{dark:h.dark}:{}};if(f.disabled)d.disabled=g;else b.push({min:f.min,...g})}for(let[f,h]of m){let g=b.find((N)=>N.min===f);if(g){if(g.style={...h.style,...g.style},h.dark||g.dark)g.dark={...h.dark,...g.dark}}else b.push({min:f,...h})}if(b.length)d.responsive=b.sort((f,h)=>f.min-h.min);return d}function Ae(t,e,n={}){let r=[],o=[],a=[],u=[],l={focus:{classes:[],originals:new Map},focusWithin:{classes:[],originals:new Map}},d=new Map;function m(c,p){let y=/^(bg|text|border(?:-[trblxy])?|from|via|to|fill|stroke|divide|decoration|caret|accent)-(.+?)(\/[^\s]+)?$/.exec(c),v=y&&ut(y[2]);if(y&&v){let A=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+?)\s*)?\)$/.exec(v),_=A?e?.get(A[1])??A[2]:v;if(_&&/^(?:#[0-9a-f]{3,8}|rgba?\(.+\)|hsla?\(.+\))$/i.test(_))return[`${y[1]}-[${_.replace(/\s+/g,"")}]${y[3]||""}`]}let x=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(c),w=x&>[x[2]];if(w){let A=e?.get(Ve(x[2]));return[`${x[1]}-${A===void 0?w[p]:`[${A}]`}${x[3]||""}`]}let S=/^rounded-(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(c);if(S&&fe[S[2]]){let A=be(S[2],e);return A===void 0?void 0:[`rounded-${S[1]?`${S[1]}-`:""}[${A}px]`]}let T=c.startsWith("text-")?c.slice(5):"";if(Un[T]){let A=we(T,e);return A&&[`text-[${A.fontSize}px]`,`leading-[${A.lineHeight}px]`]}for(let A of Object.keys(Vn)){if(!c.endsWith(`-${A}`))continue;let _=ve(A,e);return _===void 0?void 0:[`${c.slice(0,-A.length)}[${_}px]`]}return[c]}function b(c,p){if(!d.has(c))d.set(c,new Set);return d.get(c).add(p),c}for(let c of t.split(/\s+/).filter(Boolean)){let p=/^(dark:)?(focus|focus-within):(dark:)?(.+)$/.exec(c),y=p?.[2]==="focus"?"focus":"focusWithin";if(p&&n[y]&&!(p[1]&&p[3])){let v=`${p[1]||p[3]?"dark:":""}${p[4]}`,x=l[y];x.classes.push(v),x.originals.set(v,[...x.originals.get(v)??[],c]);continue}if(c.startsWith("dark:")){let v=m(c.slice(5),"dark");if(!v)u.push(c);else o.push(...v.map((x)=>b(x,c)))}else if(!c.includes(":")||c.startsWith("[")){let v=m(c,"light"),x=m(c,"dark");if(!v||!x){u.push(c);continue}if(r.push(...v.map((w)=>b(w,c))),x.join(" ")!==v.join(" "))a.push(...x.map((w)=>b(w,c)))}else u.push(c)}let f=[],h=wt(r,f),g={style:h,unknown:f};if(o.length||a.length)g.dark=wt([...a,...o],f);if(h.transform&&g.dark?.transform){let c=new Set(g.dark.transform.flatMap((p)=>Object.keys(p)));g.dark.transform=[...h.transform.filter((p)=>!Object.keys(p).some((y)=>c.has(y))),...g.dark.transform]}for(let c of r){if(c==="truncate"||c==="whitespace-nowrap")g.numberOfLines=1;let p=/^object-(cover|contain|fill)$/.exec(c);if(p)g.resizeMode=p[1]==="fill"?"stretch":p[1];let y=/^line-clamp-(\d+)$/.exec(c);if(y)g.numberOfLines=Number(y[1]);if(!g.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(c))g.icon=c}let N=f.flatMap((c)=>[...d.get(c)??[c]]);g.unknown=[...new Set([...N.filter((c)=>!/^line-clamp-\d+$/.test(c)),...u])];for(let c of["focus","focusWithin"]){let p=l[c];if(!p.classes.length)continue;let y=Ae(p.classes.join(" "),e);g[c]={style:y.style,dark:y.dark},g.unknown=[...new Set([...g.unknown,...y.unknown.flatMap((v)=>p.originals.get(v)??[v])])];for(let v of p.classes)if(/^(?:dark:)?(?:truncate|line-clamp-\d+|i-[a-z0-9]+-.+)$/.test(v))g.unknown.push(...p.originals.get(v))}return g}function wt(t,e){let n={},r=Array.isArray(t)?t:t.split(/\s+/).filter(Boolean);for(let o of r){if(/^i-[a-z0-9]+-/.test(o))continue;let a=Tn[o];if(a){a("",n);continue}if(Kn(o,n))continue;if(En(o,n))continue;if(Rn(o,n))continue;if(In(o,n))continue;if(An(o,n))continue;if(Cn(o,n))continue;if(St(o,n))continue;if(On(o,n))continue;if(Pn(o,n))continue;if(Bn(o,n))continue;if(Mn(o,n))continue;if(Ln(o,n))continue;if(Dn(o,n))continue;if(Jn(o,n))continue;if($n(o,n))continue;if(Fn(o,n))continue;if(Xn(o,n))continue;if(Wn(o,n))continue;let u=/^z-\[(-?\d+)\]$/.exec(o)??/^z-(\d+)$/.exec(o);if(u){n.zIndex=Number(u[1]);continue}if(o==="z-auto")continue;if(jn(o,n))continue;let l=/^order-\[(-?\d+)\]$/.exec(o)??/^order-(-?\d+)$/.exec(o);if(l){n.order=Number(l[1]);continue}if(Hn(o,n))continue;if(qn(o,n))continue;if(Gn(o,n))continue;if(e?.push(o),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${o}`)}return n}var kt=new Map;function Tt(t,e){if(!t)return;let n=t.trim(),r=n.lastIndexOf("-"),o=r===-1?e[n]:e[n.slice(0,r)],a=r===-1?o:o?.[n.slice(r+1)];if(typeof a==="string"&&/^#[\da-f]{3,8}$/i.test(a))return a;return Ee(n)??Ee(`[${n}]`)}function er(t){let e=t.roles??{},n=t.shapes??{},r=t.density??{},o={...t.theme?.colors,...t.theme?.extend?.colors},a=[],u=[];for(let[l,d]of Object.entries(e)){if(!gt[l])continue;let m=Tt(typeof d==="string"?d:d?.light,o),b=Tt(typeof d==="string"?d:d?.dark,o);if(m)a.push(`${Ve(l)}: ${m};`);if(b)u.push(`${Ve(l)}: ${b};`)}for(let[l,d]of Object.entries(n))if(fe[l])a.push(`${Qt(l)}: ${d};`);for(let[l,d]of Object.entries(r))if(Te[l])a.push(`${Ue(l)}: ${d};`);return[a.length?`:root { ${a.join(" ")} }`:"",u.length?`.dark { ${u.join(" ")} }`:""].filter(Boolean).join(`
|
|
3
|
+
`)}async function tr(t){let{resolveUserCssConfig:e}=await import("./chunk-rmdw6s65.js"),n=await e(t);return n?er(n):""}function Rt(t){let e=Zn.resolve(t),n=kt.get(e);if(!n)n=tr(e).catch(()=>""),kt.set(e,n);return n}var _t={"aria-pressed":"selected","aria-selected":"selected","aria-checked":"checked","aria-disabled":"disabled","aria-expanded":"expanded","aria-busy":"busy"},At={alert:"alert",button:"button",checkbox:"checkbox",combobox:"combobox",header:"header",heading:"header",image:"image",img:"image",link:"link",menu:"menu",menubar:"menubar",menuitem:"menuitem",none:"none",presentation:"none",progressbar:"progressbar",radio:"radio",scrollbar:"scrollbar",search:"search",searchbox:"search",slider:"adjustable",spinbutton:"spinbutton",switch:"switch",tab:"tab",tablist:"tablist",timer:"timer",toolbar:"toolbar"};function nr(t){return t==="role"||t==="aria-label"||t==="aria-valuetext"||t in _t}function rr(t,e){if(e===void 0||e===null)return;let n=String(e).trim().toLowerCase();if(n==="mixed")return t==="aria-checked"?"mixed":!0;if(n==="undefined")return;return n===""||n==="true"}function ir(t){if(t===void 0||t===null)return null;for(let e of String(t).trim().toLowerCase().split(/\s+/))if(At[e])return At[e];return null}function sr(t,e,n){if(t==="aria-label")return{accessibilityLabel:e===void 0||e===null||e===""?null:String(e)};if(t==="aria-valuetext")return{accessibilityValue:e===void 0||e===null||e===""?null:String(e)};if(t==="role")return{accessibilityRole:ir(e)};let r=_t[t];if(!r)return;let o=n.accessibilityState,a=o&&typeof o==="object"?{...o}:{},u=rr(t,e);if(u===void 0)delete a[r];else a[r]=u;return{accessibilityState:Object.keys(a).length?a:null}}function or(t){let e=t.accessibilityState&&typeof t.accessibilityState==="object"?t.accessibilityState:void 0,n={};for(let[o,a]of Object.entries(t)){if(!nr(o))continue;let u=sr(o,a,n);if(u)Object.assign(n,u)}for(let o of["accessibilityLabel","accessibilityRole","accessibilityValue"])if(t[o]===void 0&&n[o]!==void 0&&n[o]!==null)t[o]=n[o];let r=n.accessibilityState;if(r)t.accessibilityState={...r,...e}}var Ie=["accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue"];function Ce(t){let e={...t};return or(e),Object.fromEntries(Ie.filter((n)=>(n in e)).map((n)=>[n,e[n]]))}var Oe={"region-change-complete":"onRegionChangeComplete",regionchangecomplete:"onRegionChangeComplete",click:"onPress",press:"onPress","press-in":"onPressIn",pressin:"onPressIn","press-out":"onPressOut",pressout:"onPressOut",longpress:"onLongPress",contextmenu:"onLongPress",input:"onChangeText",onchange:"onChange",change:"onValueChange","value-change":"onValueChange",valuechange:"onValueChange",focus:"onFocus",focusin:"onFocus",blur:"onBlur",focusout:"onBlur",submit:"onSubmitEditing","submit-editing":"onSubmitEditing",submitediting:"onSubmitEditing","end-editing":"onEndEditing",endediting:"onEndEditing",scroll:"onScroll","scroll-begin-drag":"onScrollBeginDrag",scrollbegindrag:"onScrollBeginDrag","scroll-end-drag":"onScrollEndDrag",scrollenddrag:"onScrollEndDrag","momentum-scroll-begin":"onMomentumScrollBegin",momentumscrollbegin:"onMomentumScrollBegin","momentum-scroll-end":"onMomentumScrollEnd",momentumscrollend:"onMomentumScrollEnd",refresh:"onRefresh",layout:"onLayout","end-reached":"onEndReached",endreached:"onEndReached",close:"onRequestClose","request-close":"onRequestClose",requestclose:"onRequestClose",show:"onShow",dismiss:"onDismiss","sliding-complete":"onSlidingComplete",slidingcomplete:"onSlidingComplete","load-start":"onLoadStart",loadstart:"onLoadStart",load:"onLoad","load-end":"onLoadEnd",loadend:"onLoadEnd",error:"onError",play:"onPlay",playing:"onPlay",pause:"onPause",ended:"onEnd",end:"onEnd",timeupdate:"onProgress",progress:"onProgress",loadedmetadata:"onLoad",enterpictureinpicture:"onPictureInPictureStart",leavepictureinpicture:"onPictureInPictureStop"};var Be={svg:"Svg",g:"G",path:"Path",line:"Line",rect:"Rect",circle:"Circle",ellipse:"Ellipse",polyline:"Polyline",polygon:"Polygon",text:"SvgText",tspan:"SvgText",animate:"Animate"},Me=new Set(Object.values(Be));var Ct=new Set(["defs","title","desc","metadata","style","symbol","use","clippath","mask","lineargradient","radialgradient","stop","pattern","marker","filter","foreignobject"]),Ot=["viewBox","preserveAspectRatio","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","fillOpacity","fillRule","vectorEffect","textAnchor","dominantBaseline","fontSize","fontWeight","attributeName","keyTimes","repeatCount"];function j(t){let e=typeof t==="number"?t:Number.parseFloat(String(t??""));return Number.isFinite(e)?e:0}function J(t){return Math.round(t*1000)/1000}function Le(t){if(Array.isArray(t)&&t.length===4&&t.every((n)=>Number.isFinite(Number(n))))return t.map(Number);let e=String(t??"").trim().split(/[\s,]+/).map(Number);if(e.length!==4||e.some((n)=>!Number.isFinite(n))||e[2]<=0||e[3]<=0)return null;return e}function ar(t){let e=String(t??"").trim().split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite);return e.length%2?e.slice(0,-1):e}var Et=/[MLHVCSQTAZ]/i,Pe=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function cr(t){let e=[],n=t,r=Et.exec(n);while(r){let o=r.index;n=n.slice(o);let a=n[0];n=n.slice(1);let u=Et.exec(n),l=u?n.slice(0,u.index):n,d;if(a==="A"||a==="a"){d=[];let m=0,b=l.trim(),f=0;while(f<b.length){let h=m%7,g=b.slice(f).replace(/^[\s,]+/,"");if(f=b.length-g.length,!g)break;if(h===3||h===4)d.push(g[0]==="1"?1:0),f+=1;else{Pe.lastIndex=0;let N=Pe.exec(g);if(!N||N.index!==0)break;d.push(Number.parseFloat(N[0])),f+=N[0].length}m++}}else d=(l.match(Pe)||[]).map(Number.parseFloat);e.push({command:a,args:d}),r=u}return e}function lr(t,e,n,r,o,a,u,l,d){if(t===l&&e===d)return[];let m=Math.abs(n),b=Math.abs(r);if(!m||!b)return[1,l,d];let f=o*Math.PI/180,h=Math.cos(f),g=Math.sin(f),N=(t-l)/2,c=(e-d)/2,p=h*N+g*c,y=-g*N+h*c,v=p*p/(m*m)+y*y/(b*b);if(v>1)m*=Math.sqrt(v),b*=Math.sqrt(v);let x=m*m*b*b-m*m*y*y-b*b*p*p,w=m*m*y*y+b*b*p*p,S=Math.sqrt(Math.max(0,x/w));if(a===u)S=-S;let T=S*(m*y)/b,A=S*-(b*p)/m,_=h*T-g*A+(t+l)/2,I=g*T+h*A+(e+d)/2,z=(M,D,V,U)=>{let Y=M*U-D*V<0?-1:1,H=(M*V+D*U)/(Math.hypot(M,D)*Math.hypot(V,U));return Y*Math.acos(Math.min(1,Math.max(-1,H)))},R=z(1,0,(p-T)/m,(y-A)/b),k=z((p-T)/m,(y-A)/b,(-p-T)/m,(-y-A)/b);if(!u&&k>0)k-=2*Math.PI;if(u&&k<0)k+=2*Math.PI;let C=Math.max(1,Math.ceil(Math.abs(k)/(Math.PI/2))),B=k/C,E=1.3333333333333333*Math.tan(B/4),F=[],q=(M)=>{let D=m*Math.cos(M),V=b*Math.sin(M);return[h*D-g*V+_,g*D+h*V+I]},W=(M)=>{let D=-m*Math.sin(M),V=b*Math.cos(M);return[h*D-g*V,g*D+h*V]},L=R;for(let M=0;M<C;M++){let D=L+B,[V,U]=q(L),[Y,H]=W(L),[Ye,Qe]=q(D),[sn,on]=W(D);F.push(2,V+E*Y,U+E*H,Ye-E*sn,Qe-E*on,M===C-1?l:Ye,M===C-1?d:Qe),L=D}return F}function Pt(t){let e=[],n=0,r=0,o=0,a=0,u=0,l=0,d=0,m=0,b="";for(let{command:f,args:h}of cr(String(t??""))){let g=f===f.toLowerCase(),N=f.toUpperCase(),c=()=>g?n:0,p=()=>g?r:0,y=0,v=(w)=>{if(y+w>h.length)return null;let S=h.slice(y,y+w);return y+=w,S};if(N==="Z"){e.push(4),n=o,r=a,b="Z";continue}let x=!0;while(y<h.length||x&&N==="Z"){switch(N){case"M":{let w=v(2);if(!w)return e;if(n=w[0]+c(),r=w[1]+p(),x)e.push(0,n,r),o=n,a=r;else e.push(1,n,r);b=x?"M":"L";break}case"L":{let w=v(2);if(!w)return e;n=w[0]+c(),r=w[1]+p(),e.push(1,n,r),b="L";break}case"H":{let w=v(1);if(!w)return e;n=w[0]+c(),e.push(1,n,r),b="L";break}case"V":{let w=v(1);if(!w)return e;r=w[0]+p(),e.push(1,n,r),b="L";break}case"C":{let w=v(6);if(!w)return e;let S=w[0]+c(),T=w[1]+p();u=w[2]+c(),l=w[3]+p(),n=w[4]+c(),r=w[5]+p(),e.push(2,S,T,u,l,n,r),b="C";break}case"S":{let w=v(4);if(!w)return e;let S=b==="C"?2*n-u:n,T=b==="C"?2*r-l:r;u=w[0]+c(),l=w[1]+p(),n=w[2]+c(),r=w[3]+p(),e.push(2,S,T,u,l,n,r),b="C";break}case"Q":{let w=v(4);if(!w)return e;d=w[0]+c(),m=w[1]+p(),n=w[2]+c(),r=w[3]+p(),e.push(3,d,m,n,r),b="Q";break}case"T":{let w=v(2);if(!w)return e;d=b==="Q"?2*n-d:n,m=b==="Q"?2*r-m:r,n=w[0]+c(),r=w[1]+p(),e.push(3,d,m,n,r),b="Q";break}case"A":{let w=v(7);if(!w)return e;let S=w[5]+c(),T=w[6]+p();e.push(...lr(n,r,w[0],w[1],w[2],w[3],w[4],S,T)),n=S,r=T,b="A";break}default:return e}x=!1}}return e.map((f)=>J(f))}function It(t,e,n,r){if(n<=0||r<=0)return[];let o=0.5522847498;return[0,t+n,e,2,t+n,e+o*r,t+o*n,e+r,t,e+r,2,t-o*n,e+r,t-n,e+o*r,t-n,e,2,t-n,e-o*r,t-o*n,e-r,t,e-r,2,t+o*n,e-r,t+n,e-o*r,t+n,e,4].map(J)}function De(t,e){switch(t){case"Path":return Pt(String(e.d??""));case"Line":return[0,j(e.x1),j(e.y1),1,j(e.x2),j(e.y2)].map(J);case"Rect":{let n=j(e.x),r=j(e.y),o=j(e.width),a=j(e.height);if(o<=0||a<=0)return[];let u=e.rx===void 0?j(e.ry):j(e.rx),l=e.ry===void 0?u:j(e.ry);if(u=Math.min(Math.max(0,u),o/2),l=Math.min(Math.max(0,l),a/2),!u||!l)return[0,n,r,1,n+o,r,1,n+o,r+a,1,n,r+a,4].map(J);let d=0.5522847498;return[0,n+u,r,1,n+o-u,r,2,n+o-u+d*u,r,n+o,r+l-d*l,n+o,r+l,1,n+o,r+a-l,2,n+o,r+a-l+d*l,n+o-u+d*u,r+a,n+o-u,r+a,1,n+u,r+a,2,n+u-d*u,r+a,n,r+a-l+d*l,n,r+a-l,1,n,r+l,2,n,r+l-d*l,n+u-d*u,r,n+u,r,4].map(J)}case"Circle":return It(j(e.cx),j(e.cy),j(e.r),j(e.r));case"Ellipse":return It(j(e.cx),j(e.cy),j(e.rx),j(e.ry));case"Polyline":case"Polygon":{let n=ar(e.points);if(n.length<4)return[];let r=[0,n[0],n[1]];for(let o=2;o<n.length;o+=2)r.push(1,n[o],n[o+1]);if(t==="Polygon")r.push(4);return r.map(J)}default:return null}}function ur(t){let e=/^\s*(\d+(?:\.\d+)?|\.\d+)\s*(ms|s)?\s*$/.exec(String(t??""));if(!e)return null;let n=Number(e[1])/(e[2]==="ms"?1000:1);return n>0?n:null}function dr(t){if(t.attributeName!=="d")return null;let e=ur(t.dur),n=String(t.values??"").split(";").map((l)=>l.trim()).filter(Boolean);if(e===null||n.length<2)return null;let r=n.map(Pt);if(r.some((l)=>!l.length))return null;let o=String(t.keyTimes??"").split(";").map((l)=>l.trim()).filter(Boolean).map(Number),u=o.length===r.length&&o[0]===0&&o[o.length-1]===1&&o.every((l,d)=>Number.isFinite(l)&&(d===0||l>=o[d-1]))?o.map(J):r.map((l,d)=>J(d/(r.length-1)));return{frames:r,frameTimes:u,duration:e}}function $e(t){let e=dr(t),n={frames:e?.frames??null,frameTimes:e?.frameTimes??null,duration:e?.duration??null};for(let[r,o]of Object.entries(n))if(o===null)delete t[r];else t[r]=o;return n}var fr=[...Ot,"accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoComplete","autoCorrect","autoFocus","contentContainerStyle","currentTime","defaultSource","defaultValue","ellipsizeMode","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","ios_backgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","listRole","maxLength","maximumDate","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumDate","minimumTrackTintColor","minimumValue","minuteInterval","numberOfLines","numColumns","onEndReachedThreshold","pagingEnabled","passwordRules","placeholderTextColor","pointerEvents","presentationStyle","nonModal","dismissOnOutsideTap","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","stickyHeaderIndices","testID","textContentType","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize","initialRegion","tileOverlay","edgePadding","fitToBounds","showsUserLocation","zoomEnabled","rotateEnabled","pitchEnabled","mapType","fillColor","strokeColor","pinColor","showsCompass","showsScale","cameraPitch","cameraHeading","autoScrollBottom","scrollKey","pictureInPicture","transitionID"],Bt=new Set(["alwaysBounceHorizontal","alwaysBounceVertical","animating","autoCorrect","autoFocus","autoplay","autoPlay","bounces","controls","disabled","editable","hidesWhenStopped","horizontal","loop","multiline","muted","pagingEnabled","paused","refreshing","scrollEnabled","secureTextEntry","selectTextOnFocus","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","transparent","visible","nonModal","dismissOnOutsideTap","fitToBounds","showsUserLocation","zoomEnabled","rotateEnabled","pitchEnabled","showsCompass","showsScale","pictureInPicture"]),pr=new Map(fr.map((t)=>[Mt(t),t]));function Mt(t){return t.replace(/[-_]/g,"").toLowerCase()}function je(t,e){if((e==="Image"||e==="Video")&&t.toLowerCase()==="src")return"source";return pr.get(Mt(t))??t}var gr={view:"View",sidebar:"Sidebar",splitview:"SplitView",textinput:"TextInput",pressable:"Pressable",icon:"Icon",text:"Text",button:"Button",image:"Image",img:"Image",video:"Video",map:"Map",mappolyline:"MapPolyline",mappolygon:"MapPolygon",mapmarker:"MapMarker",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",checkbox:"Checkbox",slider:"Slider",picker:"Picker",select:"Picker",loading:"ActivityIndicator",spinner:"ActivityIndicator",div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",a:"TouchableOpacity",section:"View",article:"View",header:"SafeAreaView",footer:"View",main:"View",nav:"View",aside:"View",form:"View",label:"Text",fieldset:"View",legend:"Text",option:"Text",dialog:"Modal",figure:"View",figcaption:"Text",picture:"View",hr:"View",ul:"View",ol:"View",li:"View",dl:"View",dt:"Text",dd:"Text",table:"View",thead:"View",tbody:"View",tfoot:"View",tr:"View",th:"Text",td:"Text",caption:"Text",strong:"Text",b:"Text",em:"Text",i:"Text",u:"Text",s:"Text",small:"Text",mark:"Text",abbr:"Text",time:"Text",code:"Text",kbd:"Text",samp:"Text",pre:"Text",blockquote:"Text",cite:"Text",q:"Text",sub:"Text",sup:"Text"};function Lt(t){return gr[t.toLowerCase()]||t}var hr={activity:"waveform.path.ecg","alarm-clock":"alarm","alert-circle":"exclamationmark.circle","alert-triangle":"exclamationmark.triangle",apple:"leaf",archive:"archivebox",armchair:"sofa","arrow-down":"arrow.down","arrow-left":"arrow.left","arrow-right":"arrow.right","arrow-up":"arrow.up","arrow-up-right":"arrow.up.right","at-sign":"at","audio-lines":"waveform",award:"rosette",backpack:"backpack","badge-check":"checkmark.seal","badge-x":"xmark.seal",ban:"nosign","bar-chart":"chart.bar","bar-chart-2":"chart.bar","bar-chart-3":"chart.bar",battery:"battery.100","battery-charging":"battery.100.bolt",bean:"leaf",bed:"bed.double",beef:"fork.knife",bell:"bell","bell-off":"bell.slash","bell-ring":"bell.and.waves.left.and.right",bike:"figure.outdoor.cycle",blocks:"square.grid.2x2",bluetooth:"antenna.radiowaves.left.and.right",book:"book","book-open":"book",bookmark:"bookmark",box:"shippingbox",brain:"brain",building:"building","building-2":"building.2",cable:"cable.connector","cake-slice":"birthday.cake",calendar:"calendar","calendar-check":"calendar.badge.checkmark","calendar-clock":"calendar.badge.clock","calendar-days":"calendar","calendar-minus":"calendar.badge.minus","calendar-minus-2":"calendar.badge.minus","calendar-off":"calendar.badge.exclamationmark","calendar-plus":"calendar.badge.plus","calendar-range":"calendar","calendar-sync":"arrow.triangle.2.circlepath","calendar-x":"calendar.badge.exclamationmark","calendar-x-2":"calendar.badge.exclamationmark",camera:"camera",carrot:"carrot","chart-bar":"chart.bar","chart-column":"chart.bar","chart-line":"chart.xyaxis.line","chart-no-axes-gantt":"chart.bar.doc.horizontal",check:"checkmark","check-circle":"checkmark.circle","check-circle-2":"checkmark.circle","chevron-down":"chevron.down","chevron-left":"chevron.left","chevron-right":"chevron.right","chevron-up":"chevron.up",circle:"circle","circle-alert":"exclamationmark.circle","circle-arrow-out-up-left":"arrow.uturn.backward.circle","circle-minus":"minus.circle","circle-arrow-down":"arrow.down.circle","circle-check":"checkmark.circle","circle-check-big":"checkmark.circle","circle-dot":"smallcircle.filled.circle","circle-help":"questionmark.circle","circle-play":"play.circle","circle-plus":"plus.circle","circle-user":"person.crop.circle","circle-x":"xmark.circle",clapperboard:"film",clipboard:"clipboard","clipboard-list":"list.clipboard",clock:"clock","clock-12":"clock","clock-2":"clock","clock-3":"clock","clock-4":"clock","clock-8":"clock","clock-alert":"clock.badge.exclamationmark",cloud:"cloud","cloud-off":"icloud.slash",coffee:"cup.and.saucer",cookie:"birthday.cake",copy:"doc.on.doc","credit-card":"creditcard","cup-soda":"takeoutbag.and.cup.and.straw",cylinder:"cylinder",disc:"opticaldisc",download:"arrow.down.circle",droplet:"drop",droplets:"drop",drumstick:"fork.knife",dumbbell:"dumbbell",edit:"pencil",egg:"frying.pan","external-link":"arrow.up.right.square",eye:"eye","eye-off":"eye.slash",file:"doc","file-text":"doc.text",filter:"line.3.horizontal.decrease",fish:"fish",flag:"flag",flame:"flame","flower-2":"camera.macro",footprints:"figure.run",gauge:"gauge",gift:"gift","glass-water":"waterbottle",globe:"globe","graduation-cap":"graduationcap","grip-vertical":"line.3.horizontal",hamburger:"takeoutbag.and.cup.and.straw","hand-fist":"hand.raised",heart:"heart","heart-off":"heart.slash","heart-pulse":"heart.text.square","help-circle":"questionmark.circle",history:"clock.arrow.circlepath",home:"house",hourglass:"hourglass",house:"house","id-card":"person.text.rectangle",image:"photo",inbox:"tray",info:"info.circle",layers:"square.3.layers.3d","layout-dashboard":"rectangle.3.group","layout-grid":"square.grid.2x2",leaf:"leaf",library:"books.vertical",link:"link",list:"list.bullet","list-checks":"checklist",loader:"arrow.triangle.2.circlepath","loader-2":"arrow.triangle.2.circlepath","loader-circle":"arrow.triangle.2.circlepath",lock:"lock","log-in":"arrow.right.to.line","log-out":"rectangle.portrait.and.arrow.right",mail:"envelope",map:"map","map-pin":"mappin.and.ellipse",medal:"medal",megaphone:"megaphone",menu:"line.3.horizontal","message-circle":"bubble.left","message-square":"text.bubble","message-square-quote":"quote.bubble","messages-square":"bubble.left.and.bubble.right",mic:"mic",milk:"waterbottle",minus:"minus",moon:"moon","more-horizontal":"ellipsis","more-vertical":"ellipsis",mountain:"mountain.2",music:"music.note","music-2":"music.note",nut:"leaf",package:"shippingbox",pause:"pause","pause-circle":"pause.circle",pencil:"pencil","person-standing":"figure.walk",phone:"phone",play:"play.fill",plug:"powerplug",plus:"plus","plus-circle":"plus.circle","rectangle-horizontal":"rectangle","refresh-cw":"arrow.clockwise",repeat:"repeat","rotate-ccw":"arrow.counterclockwise",route:"point.topleft.down.to.point.bottomright.curvepath",ruler:"ruler",sailboat:"sailboat",salad:"leaf",satellite:"antenna.radiowaves.left.and.right",save:"square.and.arrow.down",scale:"scalemass","scan-line":"barcode.viewfinder",search:"magnifyingglass",send:"paperplane",settings:"gearshape","settings-2":"slider.horizontal.3",share:"square.and.arrow.up","share-2":"square.and.arrow.up",shield:"shield","shield-check":"checkmark.shield","shopping-bag":"bag","shopping-cart":"cart",shuffle:"shuffle","skip-back":"backward.end","skip-forward":"forward.end",sliders:"slider.horizontal.3","sliders-horizontal":"slider.horizontal.3",smartphone:"iphone",snowflake:"snowflake",soup:"mug",sparkles:"sparkles",sprout:"leaf",square:"square",star:"star",stopwatch:"stopwatch",store:"storefront","stretch-horizontal":"rectangle.split.1x2",sun:"sun.max",sunrise:"sunrise",sunset:"sunset",tag:"tag",target:"scope",thermometer:"thermometer.medium","thumbs-up":"hand.thumbsup",timer:"timer",trash:"trash","trash-2":"trash","trending-down":"chart.line.downtrend.xyaxis","trending-up":"chart.line.uptrend.xyaxis","triangle-alert":"exclamationmark.triangle",trophy:"trophy",unlink:"personalhotspot.slash",upload:"arrow.up.circle",user:"person","user-check":"person.crop.circle.badge.checkmark","user-minus":"person.badge.minus","user-plus":"person.badge.plus","user-round":"person","user-round-check":"person.crop.circle.badge.checkmark","user-round-minus":"person.crop.circle.badge.minus","user-round-plus":"person.crop.circle.badge.plus","user-round-x":"person.crop.circle.badge.xmark","user-x":"person.crop.circle.badge.xmark",users:"person.2","users-round":"person.2",utensils:"fork.knife",video:"video","volume-2":"speaker.wave.2",warehouse:"building.2",watch:"applewatch",waves:"figure.pool.swim",weight:"scalemass",wheat:"laurel.leading",wifi:"wifi","wifi-off":"wifi.slash",wind:"wind",wine:"wineglass",x:"xmark","x-circle":"xmark.circle",zap:"bolt"};function ne(t,e=!1){let n=String(t??"").trim();if(!n)return{symbol:"circle",known:!1};if(e)return{symbol:n,known:!0};let r=/^i-([a-z0-9]+)-(.+)$/.exec(n)??/^([a-z0-9]+):(.+)$/.exec(n),o=r?r[1]:"lucide",a=r?r[2]:n;if(o==="lucide"){let u=hr[a];if(u)return{symbol:u,iconify:`i-lucide-${a}`,known:!0};if(!r&&n.includes("."))return{symbol:n,known:!0}}return{symbol:"circle",iconify:r?n:`i-lucide-${a}`,known:!1}}function We(t){return t.split(/\s+/).find((e)=>/^i-[a-z0-9]+-[a-z0-9-]+$/.test(e))}import{generate as le,parse as mr}from"@stacksjs/ts-css/parse";var yr=/^(?::hover|:active|:visited|:focus|:focus-visible|:focus-within)$/;function br(t){let e=t.replace(/\s+/g,"").toLowerCase();if(!e||e==="all"||e==="screen")return{};if(/^(?:screenand)?\(prefers-color-scheme:dark\)$/.test(e))return{dark:!0};if(/^(?:screenand)?\(prefers-color-scheme:light\)$/.test(e))return{};if(/prefers-reduced-motion|\(hover|\(pointer|print|forced-colors|prefers-contrast/.test(e))return"skip";let n=/^(?:screenand)?\(min-width:([\d.]+)(px|rem|em)\)$/.exec(e);if(n)return{min:Number(n[1])*(n[2]==="px"?1:16)};return}async function Dt(t,e){let n={},r=new Set,o=(m)=>{if(!r.has(m))r.add(m),e(m)},a=(m,b,f)=>{if(!b.trim())return;let h=n[m]??={},g=f.dark?"dark":"light";if(f.min===void 0){h[g]=h[g]?`${h[g]};${b}`:b;return}let N=h.responsive??=[],c=N.find((p)=>p.min===f.min);if(!c)N.push(c={min:f.min});c[g]=c[g]?`${c[g]};${b}`:b};function u(m,b){for(let f of m){if(f.type==="Atrule"){let N=f.name.toLowerCase();if(["font-face","keyframes","-webkit-keyframes","import","charset","property","page","layer"].includes(N)){if(N==="layer"&&f.block)u(f.block.children,b);continue}if(N!=="media"||!f.block){o(`@${N}`);continue}let c=f.prelude?le(f.prelude):"",p=br(c);if(p==="skip")continue;if(!p){o(`@media ${c}`);continue}u(f.block.children,{dark:b.dark||p.dark,min:p.min??b.min});continue}if(f.type!=="Rule"||f.block.type!=="Block")continue;let h=[...f.block.children].filter((N)=>N.type==="Declaration").map((N)=>le(N)).join(";"),g=f.prelude.type==="SelectorList"?[...f.prelude.children].map(le):[le(f.prelude)];for(let N of g){let c=/^(?:(?:html|:root)?\.dark\s+)?\.(-?[a-z_][\w-]*)((?::{1,2}[a-z-]+)*)$/i.exec(N.trim());if(!c){if(!/^(?:html|:root|body|\*|::?[a-z-]+)/i.test(N.trim()))o(N.trim());continue}let p=c[2];if(p){if(!yr.test(p))o(N.trim());continue}let y=b.dark||/^(?:(?:html|:root)?\.dark\s+)/i.test(N.trim());a(c[1],h,{dark:y,min:b.min})}}}let l="",d=!0;await new HTMLRewriter().on("style",{element(m){l="";let b=m.getAttribute("type");d=!b||b.toLowerCase()==="text/css",m.onEndTag(()=>{if(!d)return;try{let f=mr(l);if(f.type==="StyleSheet")u(f.children,{})}catch{o("invalid stylesheet")}})},text(m){l+=m.text}}).transform(new Response(t)).text();for(let m of Object.values(n))m.responsive?.sort((b,f)=>b.min-f.min);return n}import{generate as re,parse as Vt}from"@stacksjs/ts-css/parse";async function $t(t,e){let n={light:new Map,dark:new Map},r=new Set,o=(f)=>{if(!r.has(f))r.add(f),e(f)},a=(f,h,g)=>{for(let N of g){let c=n[N].get(f);if(!c||Number(h.important)>Number(c.important)||h.important===c.important&&h.specificity>=c.specificity)n[N].set(f,h)}},u=(f)=>{if(f.type==="Declaration")return f.property.startsWith("--");if(f.type==="Rule"||f.type==="Atrule")return!!f.block&&[...f.block.children].some(u);return!1},l=(f)=>{let h=f.replace(/\s+/g,"").toLowerCase();if(!h||h==="all"||h==="screen")return["light","dark"];let g=/^(?:screenand)?\(prefers-color-scheme:(light|dark)\)$/.exec(h);return g?[g[1]]:void 0};function d(f,h){for(let g of f){if(!u(g))continue;if(g.type==="Atrule"){let c=g.prelude?re(g.prelude):"",p=g.name.toLowerCase()==="media"?l(c):void 0;if(!p){o(`@${g.name} ${c}`.trim());continue}d(g.block.children,h.filter((y)=>p.includes(y)));continue}if(g.type!=="Rule")continue;let N=g.prelude.type==="SelectorList"?[...g.prelude.children].map(re):[re(g.prelude)];for(let c of N){let p=/^(html|:root)?(?:\.(dark|light))?$/.exec(c.trim());if(!p||!p[1]&&!p[2]){o(c);continue}let y=(p[1]===":root"?10:p[1]?1:0)+(p[2]?10:0);for(let v of g.block.children){if(v.type!=="Declaration"){if(u(v))o(`nested rule in ${c}`);continue}if(!v.property.startsWith("--"))continue;let x={value:re(v.value),important:!!v.important,specificity:y};a(v.property,x,h.filter((w)=>!p[2]||p[2]===w))}}}}let m="",b;return await new HTMLRewriter().on("html",{element(f){let h=f.getAttribute("style");if(!h)return;try{let g=Vt(h,{context:"declarationList"});if(g.type!=="DeclarationList")return;for(let N of g.children)if(N.type==="Declaration"&&N.property.startsWith("--"))a(N.property,{value:re(N.value),important:!!N.important,specificity:1000},["light","dark"])}catch{o("invalid document inline theme")}}}).on("style",{element(f){m="";let h=f.getAttribute("type");b=!h||h.toLowerCase()==="text/css"?l(f.getAttribute("media")??""):void 0,f.onEndTag(()=>{try{let g=Vt(m);if(g.type!=="StyleSheet")return;if(!b){if([...g.children].some(u))o("style type/media");return}d(g.children,b)}catch{o("invalid stylesheet")}})},text(f){m+=f.text}}).transform(new Response(t)).text(),{light:[...n.light].map(([f,h])=>[f,h.value]),dark:[...n.dark].map(([f,h])=>[f,h.value])}}function G(t,e={},n={},r={},o=[]){return{type:t,props:e,style:n,events:r,children:o}}function jt(t,e,n={}){return{version:"1.0.0",root:t,script:e,meta:{source:n.source||"unknown",compiledAt:n.compiledAt||Date.now(),headwindConfig:n.headwindConfig}}}var Wt=new Set(["script","style","head","meta","link","title","base","noscript"]),Ft=new Set(["template","body","html","main","fragment"]),ue=new Set,vr=new Set(["onBlur","onChange","onChangeText","onDismiss","onEnd","onEndEditing","onEndReached","onError","onFocus","onLayout","onLoad","onLoadEnd","onLoadStart","onLongPress","onMomentumScrollBegin","onMomentumScrollEnd","onPause","onPictureInPictureStart","onPictureInPictureStop","onPlay","onPress","onPressIn","onPressOut","onProgress","onRequestClose","onRegionChangeComplete","onRefresh","onScroll","onScrollBeginDrag","onScrollEndDrag","onShow","onSlidingComplete","onSubmitEditing","onValueChange"]),Fe=new Set(["Sidebar","SplitView","View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","Link","TouchableOpacity","TouchableHighlight","Pressable","Icon","Image","ImageBackground","Video","Map","MapPolyline","MapPolygon","MapMarker","FlatList","SectionList","Switch","Checkbox","Slider","Picker","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl",...Me]),wr=new Map([["data","data"],["sections","sections"],["renderitem","renderItem"],["rendersectionheader","renderSectionHeader"],["keyextractor","keyExtractor"]]),zt=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),Sr={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function Z(t){return t.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,n)=>{let r=Sr[n.toLowerCase()];if(r!==void 0)return r;if(n[0]==="#"){let o=n[1]==="x"||n[1]==="X"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isFinite(o)?String.fromCodePoint(o):e}return e})}function Xt(t,e,n,r={}){let o=r.inheritedVariables,a={},u={},l={},d="",m={};for(let[g,N]of e){let c=g.toLowerCase();if(c==="class"||c==="classname"){d=d?`${d} ${N}`:N;continue}if(c==="style"){m={...m,...Nr(t,N,n,{...r,onVariables(v){o=v,r.onVariables?.(v)}})};continue}if(c.startsWith(":")||c.startsWith("x-")&&c!=="x-cloak"){l[c.startsWith(":")?c.slice(1):c.slice(2)]=Z(N);continue}if(c==="x-cloak")continue;if(c.startsWith("@")||c.startsWith("v-on:")){let v=c.startsWith("@")?c.slice(1):c.slice(5),[x]=v.split("."),w=Oe[x]??(x.startsWith("on")?x:"");if(!w||!vr.has(w)){n.push({kind:"unread-event",tag:t,name:g});continue}u[w]=Z(N);continue}if(c==="key"){a.key=N;continue}let p=Z(N),y=je(g);if(p===""&&Bt.has(y)){a[y]=!0;continue}try{a[y]=JSON.parse(p)}catch{a[y]=p}}let b=a["data-native"]?a["data-native"]==="TextInput":t==="textarea"||t==="input"&&!["checkbox","radio","hidden"].includes(String(a.type??"text").toLowerCase()),f=d?ce(d,o,{focus:b,focusWithin:!0,rules:r.rules}):void 0;for(let g of new Set(f?.unknown??[]))n.push({kind:"unknown-class",tag:t,name:g});let h=ke({...f?.style,...m});return{props:a,style:h,events:u,bindings:l,classes:d,inline:m}}function Nr(t,e,n,r){return oe(Z(e),(o)=>n.push({...o,tag:t}),r)}function ze(t){return t.children.map((e)=>typeof e==="string"?e:ze(e)).join("").replace(/\s+/g," ").trim()}function xr(t,e){let n=t.node,r=n.children.filter((a)=>typeof a!=="string"),o=n.children.filter((a)=>typeof a==="string").join("").trim();if(t.tag==="button"&&n.type==="Button"&&!t.declaredNative&&r.length>0)return n.type="Pressable",n.props.role??="button",n.children=n.children.flatMap((a)=>typeof a==="string"?a.trim()?[G("Text",{},{},{},[a.trim()])]:[]:[a]),n;if(n.type==="Button"&&r.length===0)return n.children=o?[o]:[],n;if(n.type==="Svg"||n.type==="G")return n.children=r,n;if(n.type==="SvgText"){let a=ze(n);return n.children=a?[a]:[],n}if(zt.has(n.type)&&r.length===0&&o)return n.type="Text",n.children=[o],n;if(n.type==="Text"&&!o&&r.length===0&&typeof n.props.text==="string")return n.children=n.props.text?[n.props.text]:[],delete n.props.text,n;if(n.type==="Text"&&r.length>0){if(/(?:^|\s)(?:inline-)?(?:flex|grid)(?:\s|$)/.test(n._classes??"")||r.some((l)=>l.type!=="Text"))return n.type="View",n.children=n.children.map((l)=>typeof l==="string"?G("Text",{},{},{},[l]):l),n;let u=ze(n);return e.push({kind:"flattened-text",tag:t.tag}),n.children=u?[u]:[],n}if(zt.has(n.type)&&r.length>0)n.children=r;return n}async function kr(t,e={}){let n=[],r=await $t(t,(c)=>n.push({kind:"unsupported-theme-rule",tag:"style",name:c})),o=te(r.light).computed(),a=await Dt(t,(c)=>n.push({kind:"unsupported-style-rule",tag:"style",name:c})),u=[],l=[],d=new Set;function m(c){let p=l[l.length-1];if(!p)u.push(c);else if(!p.dropped)p.node.children.push(c)}function b(c){let p=(v)=>{if(c.tag!=="html"&&c.node._styleSource)v._styleAncestors=[c.node._styleSource,...v._styleAncestors??[]]};if(c.node.bindings&&Object.keys(c.node.bindings).length>0){let v=c.node.children,x=v.filter((S)=>typeof S!=="string"),w=x.length===1&&x.length===v.length?x[0]:G("View",{},{},{},v);if(w.bindings={...c.node.bindings,...w.bindings},w.bindingId===void 0&&c.node.bindingId!==void 0)w.bindingId=c.node.bindingId;p(w),m(w);return}let y=l[l.length-1];for(let v of c.node.children){if(typeof v==="string"){if(y&&!y.dropped)y.node.children.push(v);continue}if(p(v),!y)u.push(v);else if(!y.dropped)y.node.children.push(v)}}function f(c,p){let y=l[l.length-1];if(c==="svg"||y?.svg)return h(c,p,y);let v=Wt.has(c)&&!ue.has(c),x=l[l.length-1]?.dropped??!1,w=y?.variables??o,{props:S,style:T,events:A,bindings:_,classes:I,inline:z}=v||x?{props:{},style:{},events:{},bindings:{},classes:"",inline:{}}:Xt(c,p,n,{inheritedVariables:w,onVariables:(E)=>{w=E},rules:a});if(c==="html")w=o;let R=S["data-native"],k;if(typeof R==="string"&&Fe.has(R))k=R,delete S["data-native"];else{if(k=ue.has(c)?"View":Lt(c),(c==="i"||c==="span")&&/(?:^|\s)i-[a-z0-9]+-[a-z0-9-]+(?:\s|$)/.test(I))k="Icon";if(c==="input"){let E=String(S.type??"text").toLowerCase();if(E==="checkbox")k="Checkbox",S.formValue=S.value??"on",S.checked=S.checked===""||S.checked===!0||S.checked==="true",S.value=S.checked;else if(E==="hidden")k="View",T.display="none",z.display="none";else if(E==="radio")k="View",S.accessibilityRole="radio",n.push({kind:"unsupported-control",tag:c,name:"input:radio"})}}if(!x&&k===c&&!Fe.has(k)&&!Wt.has(c)&&!Ft.has(c)&&!d.has(c))d.add(c),n.push({kind:"unmapped-tag",tag:c});if((v||ue.has(c))&&!d.has(`drop:${c}`))d.add(`drop:${c}`),n.push({kind:"dropped-subtree",tag:c});if(k==="View"&&/(?:^|\s)overflow-x-(?:auto|scroll)(?:\s|$)/.test(I))k="ScrollView",S.horizontal=!0,S.showsHorizontalScrollIndicator??=!1;else if(k==="View"&&/(?:^|\s)overflow-y-(?:auto|scroll)(?:\s|$)/.test(I))k="ScrollView";if(c==="form")S["data-stx-form"]=!0;if(c==="button"&&S.type===void 0)S.type="submit";if((k==="Video"||k==="Image")&&S.source===void 0&&S.src!==void 0)S.source=S.src,delete S.src;if(k==="Icon"){let E=ce(I).icon,F=ne(String(S.symbol||S.name||E||""),Boolean(S.symbol));if(S.symbol=F.symbol,F.iconify)S.iconify=F.iconify}if(k==="FlatList"||k==="SectionList"){let E=new Set([...Object.keys(S),...Object.keys(_)].map((F)=>F.toLowerCase()));for(let[F,q]of wr)if(E.has(F))n.push({kind:"unsupported-list-prop",tag:k,name:q})}let C=G(k,S,T,A);C._inlineStyle=z,C._styleSource=Z(p.find(([E])=>E==="style")?.[1]??"");let B=S["data-stx-b"];if(typeof B==="number"&&Number.isInteger(B))C.bindingId=B;if(delete S["data-stx-b"],I)C._classes=I;if(Object.keys(_).length>0)C.bindings=_;if(typeof S.key==="string")C.key=S.key,delete S.key;return{tag:c,node:C,variables:w,declaredNative:typeof R==="string"&&Fe.has(R),dropped:v||x||ue.has(c)||k==="Video",discard:v||x,unwrap:Ft.has(c)}}function h(c,p,y){let v=y?.dropped??!1,x=Be[c];if(v||!x){if(!v&&!d.has(`drop:${c}`))d.add(`drop:${c}`),n.push({kind:Ct.has(c)?"dropped-subtree":"unmapped-tag",tag:c});return{tag:c,node:G("G",{},{},{}),svg:!0,dropped:!0,discard:!0,unwrap:!1}}let w=y?.variables??o,{props:S,style:T,events:A,bindings:_,classes:I,inline:z}=Xt(c,p,n,{inheritedVariables:w,onVariables:(B)=>{w=B},rules:a});if(x==="Svg"){let B=Le(S.viewBox);if(B)S.viewBox=B;else delete S.viewBox;for(let E of["width","height"]){if(typeof S[E]==="number"&&T[E]===void 0)T[E]=S[E];delete S[E]}}if(typeof S.strokeDasharray==="string"||typeof S.strokeDasharray==="number"){let B=String(S.strokeDasharray).split(/[\s,]+/).map(Number).filter(Number.isFinite);S.strokeDasharray=B}let R=De(x,S);if(R)S.geometry=R;if(x==="Animate")$e(S);let k=G(x,S,T,A);k._inlineStyle=z,k._styleSource=Z(p.find(([B])=>B==="style")?.[1]??"");let C=S["data-stx-b"];if(typeof C==="number"&&Number.isInteger(C))k.bindingId=C;if(delete S["data-stx-b"],I)k._classes=I;if(Object.keys(_).length>0)k.bindings=_;if(typeof S.key==="string")k.key=S.key,delete S.key;return{tag:c,node:k,variables:w,svg:!0,dropped:!1,discard:!1,unwrap:!1}}if(await new HTMLRewriter().on("*",{element(c){let p=c.tagName.toLowerCase(),y=f(p,[...c.attributes]),v=!0;try{c.onEndTag(()=>{if(l.pop(),y.discard)return;if(y.unwrap)b(y);else m(xr(y,n))})}catch{v=!1}if(v)l.push(y);else if(!y.discard)m(y.node)},text(c){let p=l[l.length-1];if(!p||p.dropped)return;let y=Z(c.text).replace(/\s+/g," ");if(!y.trim())return;p.node.children.push(y)}}).transform(new Response(t)).text(),u.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);let g=u.length===1?u[0]:G("View",{},{},{},u);if(r.light.length||r.dark.length)g._stylesheetTheme=r;if(Object.keys(a).length)g._stylesheetRules=a;let N=(c)=>{let p=Ce(c.props);if(Object.keys(p).length)c._accessibilitySource=Object.fromEntries(Ie.filter((y)=>(y in c.props)).map((y)=>[y,c.props[y]])),Object.assign(c.props,p);for(let y of c.children)if(typeof y!=="string")N(y)};return N(g),{root:g,diagnostics:n}}async function Ut(t,e={}){let{root:n,diagnostics:r}=await kr(t,e),o=e.script??{exports:{},functions:[],code:""};return{document:jt(n,o,{source:e.source??"unknown"}),diagnostics:r}}var Ht=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Tr=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,Rr=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,qt=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function Xe(t){let e=[];Ht.lastIndex=0;for(let a of t.matchAll(Ht)){let u=a[1]??"";if(/\bserver\b/.test(u))continue;e.push(a[2].trim())}let n=e.filter(Boolean).join(`
|
|
4
|
+
|
|
5
|
+
`),r=[];for(let a of[Tr,Rr]){a.lastIndex=0;for(let u of n.matchAll(a))if(!r.includes(u[1]))r.push(u[1])}let o={};qt.lastIndex=0;for(let a of n.matchAll(qt)){let u=a[2];try{o[a[1]]=JSON.parse(u.replace(/^'(.*)'$/,'"$1"'))}catch{o[a[1]]=u}}return{exports:o,functions:r,code:n}}var de="[data-native-chrome]";function Ar(t){let e=(t??"").trim().toLowerCase();return e==="tabs"||e==="bar"?e:""}function Gt(t){let e=ne(t);return e.known||/^i-|:/.test(t)?e.symbol:t}function _r(t){let e=(t??"").trim();if(!e.startsWith("/")||e.startsWith("//"))return null;return e}function Jt(t){return t.replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�?39;/g,"'").replace(/\s+/g," ").trim()}async function Kt(t){if(!/\bdata-native-chrome\b/i.test(t))return{html:t,chrome:null};let e=[],n=[],r=null,o=!1;if(await new HTMLRewriter().on(de,{element(l){o=!0,e.push(Ar(l.getAttribute("data-native-chrome"))),l.onEndTag(()=>{e.pop()})}}).on(`${de} a`,{element(l){let d=_r(l.getAttribute("href")),m=e[e.length-1]??"";if(!d||!m)return;let b=l.getAttribute("data-native-icon")||We(l.getAttribute("class")??""),f={path:d,title:"",region:m,label:l.getAttribute("aria-label")||l.getAttribute("title")||"",...b?{symbol:Gt(b)}:{}};r=f,l.onEndTag(()=>{if(f.title=Jt(f.title)||Jt(f.label),n.push(f),r===f)r=null})},text(l){if(r)r.title+=l.text}}).on(`${de} a *`,{element(l){if(!r||r.symbol)return;let d=l.getAttribute("data-native-icon")||We(l.getAttribute("class")??"");if(d)r.symbol=Gt(d)}}).transform(new Response(t)).text(),!o)return{html:t,chrome:null};let a=await new HTMLRewriter().on(de,{element(l){l.remove()}}).transform(new Response(t)).text(),u=(l)=>n.filter((d)=>d.region===l).map(({path:d,title:m,symbol:b})=>({path:d,title:m,...b?{symbol:b}:{}}));return{html:a,chrome:{tabs:u("tabs"),bar:u("bar")}}}var pe=/<script\b([^>]*\bdata-stx-scoped\b[^>]*)>([\s\S]*?)<\/script>/gi,Yt=/function\s+(__stx_setup_[\w$]+)\s*\(/,Er=/\bdata-stx-owner\s*=\s*["']([^"']+)["']/i;function He(t){pe.lastIndex=0;for(let e of t.matchAll(pe)){let n=e[2].trim(),r=Yt.exec(n)?.[1];if(r)return{name:r,code:n}}return null}function Zt(t){let e=[];pe.lastIndex=0;for(let n of t.matchAll(pe)){let r=n[1],o=n[2].trim(),a=Er.exec(r)?.[1],u=/\bdata-stx-component-factories\b/i.test(r);if(!o||!a&&!u&&!Yt.test(o))continue;e.push(a?{code:o,owner:a}:{code:o})}return e}function Cr(){let t=[K.join(import.meta.dir,"..","primitives"),K.join(import.meta.dir,"native","primitives")];for(let e of t)if(Ir(K.join(e,"View.stx")))return e;return t[0]}async function Or(t,e,n={}){let r=n.root??K.dirname(e),o=await i(r),a=(_,I)=>_?K.isAbsolute(_)?_:K.resolve(r,_):K.join(r,I),u={root:r,layoutsDir:a(o.layoutsDir,"layouts"),partialsDir:a(o.partialsDir,"partials"),storesDir:a(o.storesDir,"stores"),componentsDir:n.componentsDir??o.componentsDir??K.join(r,"components"),buildMode:"serve",cache:!1,_targetComponentDirs:[Cr()],_targetComponentFallbackNames:["Button","Checkbox","Switch"],_nativeHostAttrs:!0,skipEventDirectives:!0,_pluginComponentDirs:o._pluginComponentDirs??[]},l={...n.context??{},__stx_inject_css:!1},d=new Set([e]),m=await s(t,l,e,u,d),{html:b,chrome:f}=await Kt(m),{html:h,manifest:g}=et(b),N=await Rt(r),{document:c,diagnostics:p}=await Ut(N?`<style>${N}</style>${h}`:h,{source:e,script:Xe(t)}),y=l.__stx_runtime_head;if(typeof y?.title==="string"&&y.title.trim())c.title=y.title.trim();if(f)c.chrome=f;let v=He(h),x=Zt(h);if(Xe(t).code.trim()){let _=await Vr(t,e,n.context,{forceClientSetup:!0}),I=He(_.setupCode??"");if(v=I??v,I&&!x.some((z)=>z.code===I.code))x.push({code:I.code})}if(/<script\b[^>]*\bdata-stx-stores\b/i.test(h)){let{getStoreScript:_}=await import("./chunk-m947aq9a.js"),I=await _(u.storesDir);if(I){x.unshift({code:I});for(let z of new Bun.Glob("*.ts").scanSync({cwd:u.storesDir,absolute:!0}))d.add(z)}}let{buildModuleRegistryScript:w,registeredModuleIdsIn:S}=await import("./chunk-xq410rsc.js"),T=[],A=await w(S(...x.map((_)=>_.code)),{collectInputs:T});for(let _ of T)d.add(_);if(A)x.unshift({code:A});return{document:c,manifest:g,setup:v,scripts:x,diagnostics:p,html:h,dependencies:[...d]}}async function ge(t,e={}){return Or(await Bun.file(t).text(),t,e)}var ie="__app";async function Lr(t){try{let{loadCssEngineConfig:e}=await import("./chunk-rmdw6s65.js");return ct(await e(t))}catch{return{}}}var he="__runtime",Dr="__messages";function qe(t){let n=[O.join(import.meta.dir,"..","runtime",`${t}.ts`),O.join(import.meta.dir,"..","runtime",`${t}.js`),O.join(import.meta.dir,"native","runtime",`${t}.js`)].find((r)=>Je(r));if(!n)throw Error(`Native runtime module ${t} is missing`);return n}async function Ge(t,e,n,r,o){let a={name:"stx-screen-inputs",setup(l){l.onLoad({filter:/.*/,namespace:"file"},({path:d})=>{r.add(d);let m=o?.get(d);return m===void 0?void 0:{contents:m,loader:"js"}})}},u=await Bun.build({entrypoints:[t],target:"browser",format:"iife",minify:n,plugins:[a,...e],define:{"process.env.NODE_ENV":JSON.stringify(n?"production":"development")}});if(!u.success){let l=u.logs.map((d)=>String(d.message??d)).join(`
|
|
6
|
+
`);throw Error(`Could not bundle ${t}:
|
|
7
|
+
${l}`)}return(await u.outputs[0].text()).trim()}var $r=/^[\w-]+(?:\/[\w-]+)*$/,jr=/^[\w-]+$/;async function Wr(t,e){let n=O.resolve(t,e.dir);if(!e.languages?.length)throw Error("messages.languages must name at least one language");let r=new Map,o=new Map;for(let a of e.languages){if(!jr.test(a))throw Error(`messages: "${a}" is not a language directory name`);let u=O.join(n,a);if(!Je(u))throw Error(`messages: ${O.relative(t,u)} does not exist`);let l=new Map;for(let d of[...new Bun.Glob("**/*.{ts,js,mjs,json}").scanSync({cwd:u})].sort()){if(/\.(?:test|spec|d)\.[^.]+$/.test(d))continue;let m=d.replace(/\.[^./]+$/,"").split(O.sep).join("/");if(!$r.test(m))throw Error(`messages: ${a}/${d} is not an area name`);if(l.has(m))throw Error(`messages: ${a}/${m} is defined twice`);let b=O.join(u,d),f=await import(b),h=Object.keys(f).filter((c)=>c!=="default");if(h.length)throw Error(`messages: ${a}/${d} exports ${h.join(", ")}; a message module exports its messages as default, and nothing else`);let g=f.default,N=g!==null&&typeof g==="object"&&!Array.isArray(g)?JSON.stringify(g):void 0;if(N===void 0||!Bun.deepEquals(JSON.parse(N),g,!0))throw Error(`messages: ${a}/${d} must export plain data (an object JSON can hold) as default`);l.set(m,N),r.set(b,{language:a,area:m})}o.set(a,l)}return{files:r,data:o}}function Fr(t,e){return`export default globalThis.__stxNativeRuntime.messages(${JSON.stringify(t)}, ${JSON.stringify(e)});`}function zr(t){let e=new Map;for(let[n,{language:r,area:o}]of t.files){let a=Fr(r,o);e.set(n,a),e.set(Mr(n),a)}return e}function Xr(t){let e=new Set;for(let n of t.matchAll(/__stxNativeRuntime\.messages\(\s*"[\w-]+"\s*,\s*"([\w/-]+)"\s*\)/g))e.add(n[1]);return[...e].sort()}function Ur(t,e){let n=O.isAbsolute(t.meta.source)?O.relative(e,t.meta.source).split(O.sep).join("/"):t.meta.source;return{...t,script:{exports:t.script.exports,functions:[],code:""},meta:{...t.meta,source:n,compiledAt:0}}}async function Ke(t){let e=Object.keys(t.screens);if(e.length===0)throw Error("screens must name at least one .stx file");let n=t.routed??!0,r=t.initialScreen??e[0];if(!t.screens[r])throw Error(`Initial screen ${r} is not in screens`);let o=O.resolve(t.root??process.cwd());if(t.messages&&!t.routesDir)throw Error("messages ship a language at a time beside route files: they need routesDir");if(t.sharedRuntime&&!t.routesDir)throw Error("sharedRuntime is the route files' runtime: it needs routesDir");if(t.messages&&!t.sharedRuntime)throw Error("messages are read by the shared runtime: they need sharedRuntime");if(t.messages&&t.outFile)throw Error("messages leave the languages out of the screens' code, which the one-file bundle cannot read: build it without messages");let a=t.messages?await Wr(o,t.messages):null,u=t.styleConfig??await Lr(o),l=a?zr(a):null,d=[],m=async()=>{for(let R of e){let k=O.resolve(o,t.screens[R]);if(!k.endsWith(".stx"))throw Error(`Screen ${R} must name a .stx file`);d.push({name:R,file:k,compiled:await ge(k,{root:o})})}};await at(u,()=>l?qs(l,m):m());let b=qe("jsc-globals"),f=qe("shared-screen"),h=t.app?O.resolve(o,t.app):null;if(h&&!Je(h))throw Error(`The app script ${t.app} does not exist`);if(h&&!n)throw Error("An app script needs a routed bundle");if(h&&t.screens[ie])throw Error(`${ie} is the app script's route, not a screen name`);let g=t.browser;if(t.screens[he])throw Error(`${he} is the runtime prelude's file, not a screen name`);let N=pt();if(g&&t.routesDir)throw Error("A browser screen is one route; routesDir is for device hosts");let c=(R,k,C)=>{let B=n?`var routeName = g.__stxNativeRoute || ${JSON.stringify(r)};
|
|
8
|
+
var isApp = ${h?`routeName === ${JSON.stringify(ie)}`:"false"};
|
|
9
|
+
if (!isApp && routeNames.indexOf(routeName) === -1) throw new Error(['Unknown native screen:', routeName].join(' '));
|
|
10
|
+
if (isApp ? ${!k} : ${JSON.stringify(R.map(({name:V})=>V))}.indexOf(routeName) === -1) throw new Error(['This bundle does not hold the native screen', routeName].join(' '));`:`var routeName = 'main';
|
|
11
|
+
var isApp = false;`,E=R.map(({name:V,compiled:U},Y)=>`${Y===0?"if":"else if"} (routeName === ${JSON.stringify(n?V:"main")}) {
|
|
12
|
+
nativeDocument = ${JSON.stringify(Ur(U.document,o))};
|
|
13
|
+
manifest = ${JSON.stringify(U.manifest)};
|
|
14
|
+
}`).join(`
|
|
15
|
+
`),F=R.map(({name:V,compiled:U},Y)=>`${Y===0?"if":"else if"} (routeName === ${JSON.stringify(n?V:"main")}) {
|
|
16
|
+
g.__stx_latestSetup = null;
|
|
17
|
+
${U.scripts.map((H)=>H.owner?` g.__stx_componentSetups = g.__stx_componentSetups || {};
|
|
18
|
+
// Kept by id as well as run once: a :for or :if clone of this component
|
|
19
|
+
// has no script to copy, and is set up from this (component hydration).
|
|
20
|
+
g.__stx_componentSetups[${JSON.stringify(H.owner)}] = function() {
|
|
21
|
+
${H.code}
|
|
22
|
+
};
|
|
23
|
+
g.__STX_SETUP_ROOT__ = screen && screen.scopeRoot(${JSON.stringify(H.owner)});
|
|
24
|
+
try { g.__stx_componentSetups[${JSON.stringify(H.owner)}](); }
|
|
25
|
+
finally { g.__STX_SETUP_ROOT__ = null; }`:H.code).join(`
|
|
26
|
+
`)}
|
|
27
|
+
}`).join(`
|
|
28
|
+
`),q=k&&h,W=g?qe("browser-screen"):null,L=g?Bun.resolveSync(g.platformModule,o):null;return`
|
|
29
|
+
${C?`var runtime = globalThis.__stxNativeRuntime;
|
|
30
|
+
if (!runtime || runtime.version !== ${JSON.stringify(C)}) throw new Error('This screen needs the stx native runtime it was built with: evaluate ${he}.js from the same build first');
|
|
31
|
+
var installJSCGlobals = runtime.installJSCGlobals;
|
|
32
|
+
var prepareNativeApp = runtime.prepareNativeApp;
|
|
33
|
+
var prepareSharedNativeScreen = runtime.prepareSharedNativeScreen;`:`import { installJSCGlobals } from ${JSON.stringify(b)};
|
|
34
|
+
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(f)};`}
|
|
35
|
+
${g?`import { createBrowserScreenBridge } from ${JSON.stringify(W)};
|
|
36
|
+
import { createBrowserPlatform } from ${JSON.stringify(L)};`:""}
|
|
37
|
+
${q?`import * as nativeAppModule from ${JSON.stringify(h)};`:"var nativeAppModule = null;"}
|
|
38
|
+
${g?"(async function() {":""}
|
|
39
|
+
var g = globalThis;
|
|
40
|
+
installJSCGlobals(g);
|
|
41
|
+
g.__stxNativeStyleConfig = ${JSON.stringify(u)};
|
|
42
|
+
${g?`var browserPlatform = await createBrowserPlatform(${JSON.stringify(g.platformOptions??{})});
|
|
43
|
+
var browserBridge = createBrowserScreenBridge(browserPlatform, ${JSON.stringify(g)});
|
|
44
|
+
var bridge = browserBridge;
|
|
45
|
+
g.__stxNativeRoute = ${JSON.stringify(r)};`:"var bridge = g.__stxNativeBridge;"}
|
|
46
|
+
if (!bridge) throw new Error('Missing __stxNativeBridge');
|
|
47
|
+
var routeNames = ${JSON.stringify(n?e:["main"])};
|
|
48
|
+
${B}
|
|
49
|
+
g.__stxNativeRoute = routeName;
|
|
50
|
+
var nativeDocument;
|
|
51
|
+
var manifest;
|
|
52
|
+
${E}
|
|
53
|
+
var screen = null;
|
|
54
|
+
var app = null;
|
|
55
|
+
if (isApp) {
|
|
56
|
+
app = prepareNativeApp(bridge, { routeName: routeName, routeNames: routeNames });
|
|
57
|
+
g.__stxNativeUnmount = function() { app.unmount(); };
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
screen = prepareSharedNativeScreen(nativeDocument, manifest, bridge, { routeName: routeName, routeNames: routeNames });
|
|
61
|
+
g.__stx_host = screen.host;
|
|
62
|
+
g.__stxNativeUnmount = function() { screen.unmount(); };
|
|
63
|
+
}
|
|
64
|
+
${C?"runtime.startSignals();":N}
|
|
65
|
+
var pageSetup = g.__stx_latestSetup;
|
|
66
|
+
var pageRuntimeSetup = g.stx && g.stx._latestSetup;
|
|
67
|
+
${F}
|
|
68
|
+
// The screen's setup is the native host's to run. A screen script publishes
|
|
69
|
+
// it where a page's document runtime adopts its own, and in a browser that
|
|
70
|
+
// runtime's DOMContentLoaded and stx:load ran it a second time: another copy
|
|
71
|
+
// of the screen, mounted beside this one. Take it, and hand the page back
|
|
72
|
+
// whatever setup it had.
|
|
73
|
+
var screenSetup = g.__stx_latestSetup || null;
|
|
74
|
+
g.__stx_latestSetup = pageSetup;
|
|
75
|
+
if (g.stx) g.stx._latestSetup = pageRuntimeSetup || null;
|
|
76
|
+
if (isApp) app.start(nativeAppModule);
|
|
77
|
+
else screen.mount(g.stx, screenSetup);
|
|
78
|
+
${g?`var stopApp = nativeAppModule && typeof nativeAppModule.default === 'function' ? nativeAppModule.default(g.craft) : null;
|
|
79
|
+
var unmount = g.__stxNativeUnmount;
|
|
80
|
+
var ended = false;
|
|
81
|
+
g.__stxNativeUnmount = function() { if (ended) return; ended = true; if (typeof stopApp === 'function') stopApp(); unmount(); browserBridge.dispose(); };
|
|
82
|
+
g.addEventListener('pagehide', function(event) { if (!event.persisted) g.__stxNativeUnmount(); });
|
|
83
|
+
})().catch(function(error) { console.error('[stx browser screen]', error); var node = document.querySelector(${JSON.stringify(g.container)}); if (node) { node.textContent = 'This screen could not start. Reload to try again.'; node.setAttribute('role', 'alert'); } });`:""}
|
|
84
|
+
`},p=(R)=>({name:"stx-native-shared-screens",setup(k){k.onResolve({filter:/^stx:native-shared-screens$/},()=>({path:"entry",namespace:"stx-native-shared-screens"})),k.onLoad({filter:/.*/,namespace:"stx-native-shared-screens"},()=>({contents:R,loader:"js"}))}}),y=new Set(d.flatMap(({compiled:R})=>R.dependencies)),v=d.flatMap(({compiled:R})=>R.diagnostics).map((R)=>({level:"warning",message:[R.kind,R.tag,R.name].filter(Boolean).join(": ")})),x=d.filter(({compiled:R})=>R.document.chrome),w=x.length?{chrome:Object.fromEntries(x.map(({name:R,compiled:k})=>[R,k.document.chrome]))}:{},S=t.minify??!1,T,A,_;if(t.routesDir){let R=O.resolve(o,t.routesDir);en(R,{recursive:!0});let k=`
|
|
85
|
+
import { installJSCGlobals } from ${JSON.stringify(b)};
|
|
86
|
+
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(f)};
|
|
87
|
+
globalThis.__stxNativeRuntime = {
|
|
88
|
+
version: '__STX_NATIVE_RUNTIME_VERSION__',
|
|
89
|
+
installJSCGlobals: installJSCGlobals,
|
|
90
|
+
prepareNativeApp: prepareNativeApp,
|
|
91
|
+
prepareSharedNativeScreen: prepareSharedNativeScreen,
|
|
92
|
+
// Each screen starts its own signals runtime, after its host is in place.
|
|
93
|
+
startSignals: function() {
|
|
94
|
+
${N}
|
|
95
|
+
},
|
|
96
|
+
// A language's messages for an area (the compile's \`messages\`), read the
|
|
97
|
+
// first time they are looked into: a screen never parses a language it
|
|
98
|
+
// is not shown in, nor an area it does not use.
|
|
99
|
+
messages: function(language, area) {
|
|
100
|
+
var g = globalThis;
|
|
101
|
+
var loaded = g.__stxNativeMessages || (g.__stxNativeMessages = {});
|
|
102
|
+
function table() {
|
|
103
|
+
var forLanguage = loaded[language] || (loaded[language] = {});
|
|
104
|
+
if (Object.prototype.hasOwnProperty.call(forLanguage, area)) return forLanguage[area];
|
|
105
|
+
var value = null;
|
|
106
|
+
if (typeof g.__stxNativeReadMessages === 'function') {
|
|
107
|
+
try {
|
|
108
|
+
var text = g.__stxNativeReadMessages(language, area);
|
|
109
|
+
if (typeof text === 'string') value = JSON.parse(text);
|
|
110
|
+
}
|
|
111
|
+
catch (error) { console.error('[stx native] could not read the ' + language + ' messages for ' + area, error); }
|
|
112
|
+
}
|
|
113
|
+
forLanguage[area] = value;
|
|
114
|
+
return value;
|
|
115
|
+
}
|
|
116
|
+
var own = Object.prototype.hasOwnProperty;
|
|
117
|
+
return new Proxy({}, {
|
|
118
|
+
get: function(target, name) { var messages = table(); return messages && own.call(messages, name) ? messages[name] : undefined; },
|
|
119
|
+
has: function(target, name) { var messages = table(); return !!messages && own.call(messages, name); },
|
|
120
|
+
ownKeys: function() { var messages = table(); return messages ? Object.keys(messages) : []; },
|
|
121
|
+
getOwnPropertyDescriptor: function(target, name) {
|
|
122
|
+
var messages = table();
|
|
123
|
+
return messages && own.call(messages, name) ? { value: messages[name], writable: false, enumerable: true, configurable: true } : undefined;
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
`,C,B=O.join(R,`${he}.js`);if(t.sharedRuntime){let W=await Ge("stx:native-shared-screens",[p(k)],S,y);C=Bun.hash(W).toString(36),A=B,await Bun.write(A,W.replace("__STX_NATIVE_RUNTIME_VERSION__",C))}else tn(B,{force:!0});let E=O.join(R,Dr);tn(E,{recursive:!0,force:!0});let F={},q=[...d.map((W)=>({name:W.name,screens:[W],app:!1})),...h?[{name:ie,screens:[],app:!0}]:[]];T={};for(let W=0;W<q.length;W+=6)await Promise.all(q.slice(W,W+6).map(async(L)=>{let M=O.join(R,`${L.name}.js`),D=await Ge("stx:native-shared-screens",[p(c(L.screens,L.app,C))],S,y,l??void 0);if(await Bun.write(M,D),T[L.name]=M,a)F[L.name]=Xr(D)}));if(a){for(let[L,M]of a.data)for(let[D,V]of M)await Bun.write(O.join(E,L,`${D}.json`),V);let W=Object.fromEntries(Object.keys(F).sort().map((L)=>[L,F[L]]));await Bun.write(O.join(E,"routes.json"),JSON.stringify(W));for(let L of a.files.keys())y.add(L);_={dir:E,languages:[...a.data.keys()],routes:W}}if(!t.outFile)return{code:"",routes:T,runtime:A,..._?{messages:_}:{},...w,diagnostics:v,dependencies:[...y]}}let I=await Ge("stx:native-shared-screens",[p(c(d,!0))],S,y);if(!t.outFile)return{code:I,...w,diagnostics:v,dependencies:[...y]};let z=O.resolve(o,t.outFile);return en(O.dirname(z),{recursive:!0}),await Bun.write(z,I),{code:I,outFile:z,...T?{routes:T,runtime:A}:{},..._?{messages:_}:{},...w,diagnostics:v,dependencies:[...y]}}async function Hr(t,e={}){return Ke({...e,screens:{main:t},routed:!1})}function nn(t,e={}){return Hr(t,e)}var rn=["native.config.json","stx-native.config.json"];function Jr(t=process.cwd(),e){let n=e?X.resolve(t,e):rn.map((d)=>X.join(t,d)).find((d)=>me(d));if(!n)return null;if(!me(n))throw Error(`Native config not found: ${n}`);let r=JSON.parse(Gr(n,"utf8")),o=Object.entries(r.screens??{});if(o.length===0)throw Error(`${X.basename(n)} must name at least one screen in "screens"`);let a={};for(let[d,m]of o){if(!/^[A-Z][\w-]*$/i.test(d))throw Error(`Invalid native screen name: ${d}`);if(typeof m!=="string"||!m.endsWith(".stx"))throw Error(`Screen ${d} must name a .stx file`);if(a[d]=X.resolve(X.dirname(n),m),!me(a[d]))throw Error(`Screen ${d} not found: ${a[d]}`)}let u=r.initialScreen||o[0][0];if(!a[u])throw Error(`Initial screen ${u} is not in screens`);if(r.app!==void 0&&typeof r.app!=="string")throw Error(`"app" must name the app script's file`);let l=r.app?X.resolve(X.dirname(n),r.app):void 0;if(l&&!me(l))throw Error(`App script not found: ${l}`);return{initialScreen:u,screens:a,file:n,...l?{app:l}:{}}}async function _o(t,e={}){let n=X.resolve(e.cwd??process.cwd()),r=e.format??"ir";if(r!=="ir"&&r!=="bundle")throw Error(`Unknown compile format: ${r}. Expected ir or bundle.`);let o=t?null:Jr(n,e.config);if(!t&&!o)throw Error(`Please specify an input file: stx native compile <file.stx>, or add ${rn[0]}`);let a,u=[];if(r==="bundle"){let d=o?await Ke({screens:o.screens,initialScreen:o.initialScreen,minify:e.minify,root:n,...o.app?{app:o.app}:{}}):await nn(X.resolve(n,t),{minify:e.minify});a=d.code,u=d.diagnostics}else{let d=async(b)=>{let f=await ge(b);return u.push(...f.diagnostics.map((h)=>({level:"warning",message:[h.kind,h.tag,h.name].filter(Boolean).join(": ")}))),f.document},m=o?{initialScreen:o.initialScreen,screens:Object.fromEntries(await Promise.all(Object.entries(o.screens).map(async([b,f])=>[b,await d(f)])))}:await d(X.resolve(n,t));a=JSON.stringify(m,null,2)}if(!e.output)return{output:a,diagnostics:u};let l=X.resolve(n,e.output);return qr(X.dirname(l),{recursive:!0}),await Bun.write(l,a),{output:a,written:l,diagnostics:u}}export{_o as runNativeCompile};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{d,u}from"./chunk-
|
|
2
|
+
import{d,u}from"./chunk-4e0z858k.js";import{ue,m}from"./chunk-2yg9y1na.js";function A(t,o){let i=1,r=o,n="<template",e="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(n,r)&&(r+n.length>=t.length||/[\s>\/]/.test(t[r+n.length]))){i++,r+=n.length;continue}if(t.startsWith(e,r)){let a=t.indexOf(">",r+e.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var x=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function b(t,o){let i=null;for(let r=o;r<t.length;r++){let n=t[r];if(i){if(n==="\\"){r++;continue}if(n===i)i=null;continue}if(n==='"'||n==="'"){i=n;continue}if(n===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),n=1,e=i;while(e<t.length){let s=t.indexOf("<",e);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);e=g===-1?t.length:g+3;continue}let a=b(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),c=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(n--,n===0)return a}else if(!/\/\s*>$/.test(f))n++}e=a}return-1}function R(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,n=0;while(n<t.length){let e=t.indexOf("<",n);if(e===-1)break;if(t.startsWith("<!--",e)){let l=t.indexOf("-->",e+4);n=l===-1?t.length:l+3;continue}let s=b(t,e+1);if(s===-1)break;let a=t.slice(e,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){n=s;continue}let c=f[2].toLowerCase();if(f[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);n=s;continue}let g=/\/\s*>$/.test(a),h=i.length===0?a.match(r):null;if(h){let l=h[1]||h[2],p=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||x.has(c)?-1:N(t,c,s);if(S===-1)o.push({start:e,end:s,slotName:l,element:p}),n=s;else o.push({start:e,end:S,slotName:l,element:p+t.slice(s,S)}),n=S;continue}if(!g&&!x.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){n=l;continue}}}n=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,n=0;while(n<t.length){let e=t.indexOf("<",n);if(e===-1)break;if(t.startsWith("<!--",e)){let l=t.indexOf("-->",e+4);n=l===-1?t.length:l+3;continue}let s=b(t,e+1);if(s===-1)break;let a=t.slice(e,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){n=s;continue}let c=f[1]==="/",g=f[2].toLowerCase();if(c){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);n=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let p=A(t,s);if(p!==-1){let S=l[1]||l[2]||l[3];o.push({start:e,end:p,slotName:S,content:t.slice(s,p-11).trim(),propsBinding:l[4]||void 0}),n=p;continue}}}if(!/\/\s*>$/.test(a)&&!x.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){n=l;continue}}}n=s}return o}function Lc(t){let o={default:"",named:new Map},i=t,r=O(t);for(let e of r)o.named.set(e.slotName,{name:e.slotName,content:e.content,propsBinding:e.propsBinding});r.sort((e,s)=>s.start-e.start);for(let e of r)i=i.slice(0,e.start)+i.slice(e.end);let n=R(i);for(let e of n){let s=o.named.get(e.slotName);if(s)s.content+=e.element;else o.named.set(e.slotName,{name:e.slotName,content:e.element})}for(let e=n.length-1;e>=0;e--){let s=n[e];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Ju(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},n=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,e;while((e=n.exec(t))!==null)r[e[1]]=e[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function jc(t,o,i,r){if(!t)return i;let n=t.content;if(t.propsBinding&&Object.keys(o).length>0){let e=t.propsBinding.trim(),s={...r},a=new Set,f=new Set;if(e.startsWith("{")&&e.endsWith("}")){let c=e.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[h,l]=g.split(":").map((S)=>S.trim()),p=l||h;if(s[p]=o[h],o[h]!==void 0)f.add(p);else a.add(p)}}else if(s[e]=o,Object.values(o).some((c)=>c===void 0))a.add(e);else f.add(e);n=C(n,s,a,f)}return n}function C(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(n,e)=>{try{let s=e.trim();if(ue(s,i))return n;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!ue(s,r))return n;let a=k(s,o);if(a===void 0)return n;return m(String(a??""))}catch{return`{{ ${e} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),n=o;for(let e of r)if(n&&typeof n==="object"&&e in n)n=n[e];else return;return n}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,n,e]=i,s=o[r],a=parseInt(e,10);if(typeof s==="number")switch(n){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!d(t))return;return u(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Bc(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,c)=>{let g=o.named.get(a),h=c?.trim()||"",l=f||"",p={},S=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,w;while((w=S.exec(l))!==null){let y=w[1],E=w[2];p[y]=k(E,i)}return await jc(g,p,h,i)});let e=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(e,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let c=f?.trim()||"";return o.default||c}),r}async function M(t,o,i){let r=[],n=[];t.replace(o,(a,...f)=>{let c=f[f.length-2];return n.push({match:a,index:c}),r.push(i(a,...f.slice(0,-2))),a});let e=await Promise.all(r),s=t;for(let a=n.length-1;a>=0;a--){let{match:f,index:c}=n[a];s=s.slice(0,c)+e[a]+s.slice(c+f.length)}return s}function Yu(t){let o=Lc(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Zu(t,o,i,r){return await Bc(t,{default:o,named:i},r)}
|
|
3
3
|
export{Lc,Ju,jc,Bc,Yu,Zu};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ii,Mc}from"./chunk-
|
|
2
|
+
import{Ii,Mc}from"./chunk-46w53nj5.js";import"./chunk-48acjmeg.js";import"./chunk-c1dkh0es.js";export{Mc as createImageHandler,Ii as handleImageRequest};
|
|
@@ -189,7 +189,7 @@ else {
|
|
|
189
189
|
}, 0);
|
|
190
190
|
})();
|
|
191
191
|
</script>
|
|
192
|
-
`}function kd(s,n,t){return{id:s,fallback:t,content:n}}async function
|
|
192
|
+
`}function kd(s,n,t){return{id:s,fallback:t,content:n}}async function Cd(s){let n=s.map((e)=>`
|
|
193
193
|
<div id="stx-ssr-suspense-${e.id}" class="stx-ssr-suspense">
|
|
194
194
|
${e.fallback}
|
|
195
195
|
</div>
|
|
@@ -214,7 +214,7 @@ else {
|
|
|
214
214
|
}
|
|
215
215
|
})();
|
|
216
216
|
</script>
|
|
217
|
-
`}}return{initial:n,streaming:t()}}function
|
|
217
|
+
`}}return{initial:n,streaming:t()}}function _d(){return`
|
|
218
218
|
/* STX Suspense Styles */
|
|
219
219
|
.stx-suspense {
|
|
220
220
|
position: relative;
|
|
@@ -338,4 +338,4 @@ else {
|
|
|
338
338
|
console.log('[stx] Suspense runtime initialized');
|
|
339
339
|
})();
|
|
340
340
|
`}
|
|
341
|
-
export{Sd,kd,_d,
|
|
341
|
+
export{Sd,kd,Cd,_d,Ed};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{k}from"./chunk-
|
|
2
|
+
import{k}from"./chunk-2yg9y1na.js";import{s}from"./chunk-g7j3mwzd.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
|
|
3
3
|
${e.bold}${t[0]}${e.reset} - ${n.description}`),console.log(` Usage: ${e.cyan}${n.usage}${e.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${e.bold}Available Commands:${e.reset}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function
|
|
3
|
-
export{
|
|
2
|
+
var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function oe(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function Nn(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function Ud(e,n=Object.is){return Nn(e,{equals:n})}function Dn(e,n={}){let r,i=!1,o=()=>{if(i)return;if(r){let c=r;r=void 0;try{c()}catch(u){console.error("[stx] effect cleanup error:",u)}}let t=S(o);try{let c=e();r=typeof c==="function"?c:void 0}catch(c){i=!0,console.error("[stx] effect error (the effect is disposed):",c)}finally{h(t)}};if(n.immediate!==!1)o();return()=>{if(i=!0,r){let t=r;r=void 0,t()}}}function Hs(e){C(e)}function Pr(e){k.push(e)}function Ir(e){T.push(e)}function Wd(){O(k,"onMount",T)}function qd(){O(T,"onDestroy")}function O(e,n,r){let i=e.splice(0,e.length);for(let o of i)try{let t=o();if(r&&typeof t==="function")r.push(t)}catch(t){console.error(`[stx] ${n} callback threw:`,t)}}function Gd(){return{mount:k.length,destroy:T.length}}function Mn(e){return typeof e==="function"&&e._isSignal===!0}function Ln(e){return typeof e==="function"&&e._isDerived===!0}function Vs(e){if(Mn(e)||Ln(e))return m(()=>e());return e}function Or(e){return m(e)}function Kd(e,n){let r=typeof e==="function"?e:()=>e,i=oe([]),o=Nn(()=>i().reduce((u,l)=>n(u,l.action),r())),t=!1;return Dn(()=>{if(r(),!t){t=!0;return}if(Or(()=>i().length))i.set([])}),[o,(u,l)=>{let d={action:u};i.set([...i(),d]);let a=()=>{let s=i().filter((y)=>y!==d);if(s.length!==i().length)i.set(s)};if(l&&typeof l.then==="function")Promise.resolve(l).then(a,a);return a}]}
|
|
3
|
+
export{oe,Nn,Ud,Dn,Hs,Pr,Ir,Wd,qd,Gd,Mn,Ln,Vs,Or,Kd};
|