@stacksjs/stx 0.2.634 → 0.2.635
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-0d7dqt4d.js +2 -0
- package/dist/chunk-0grt24vd.js +2 -0
- package/dist/{chunk-7q55jxf5.js → chunk-0tm9ep8b.js} +2 -2
- package/dist/{chunk-7gq7w95h.js → chunk-14yjt309.js} +3 -3
- package/dist/{chunk-ygpa12ez.js → chunk-1d25z8q2.js} +3 -3
- package/dist/{chunk-6bhaa9g7.js → chunk-1wb98s7b.js} +13 -13
- package/dist/{chunk-nh7bcc4h.js → chunk-2efrxnnt.js} +2 -2
- package/dist/chunk-2vzfn6vy.js +2 -0
- package/dist/chunk-3bsz101e.js +2 -0
- package/dist/{chunk-w9e17a74.js → chunk-3e2v2fdh.js} +4 -4
- package/dist/{chunk-jq7ymh7q.js → chunk-3f4xy76k.js} +6 -6
- package/dist/chunk-3jwjesb5.js +2 -0
- package/dist/{chunk-968jp303.js → chunk-3td99hnc.js} +3 -3
- package/dist/chunk-4b4es5wg.js +2 -0
- package/dist/{chunk-phbnrw2h.js → chunk-4n24jbfs.js} +2 -2
- package/dist/{chunk-72p9brmx.js → chunk-4vkpgz28.js} +9 -9
- package/dist/chunk-4xeafdr6.js +2 -0
- package/dist/chunk-4xkqdfqd.js +2 -0
- package/dist/chunk-5k989nr4.js +2 -0
- package/dist/chunk-5v95x083.js +3 -0
- package/dist/chunk-5yf9yzkp.js +2 -0
- package/dist/{chunk-923vrf9c.js → chunk-6gwrmn3w.js} +7 -7
- package/dist/{chunk-p77g4mhy.js → chunk-6w1ngwsd.js} +2 -2
- package/dist/chunk-7m5xrqnj.js +2852 -0
- package/dist/chunk-7mtdjjbt.js +2 -0
- package/dist/{chunk-94yycjz8.js → chunk-7vdcsr14.js} +2 -2
- package/dist/{chunk-k5atee35.js → chunk-839m1t8t.js} +1 -1
- package/dist/chunk-88dxeynx.js +2 -0
- package/dist/chunk-8er7jc3c.js +2 -0
- package/dist/chunk-8phbb8wj.js +2 -0
- package/dist/{chunk-p4hmv654.js → chunk-8y3mff5c.js} +2 -2
- package/dist/{chunk-gqdh68vx.js → chunk-954tcahb.js} +2 -2
- package/dist/{chunk-sg5zgq5v.js → chunk-97zrn4wb.js} +5 -5
- package/dist/{chunk-q6evk3a4.js → chunk-9gx5p7zh.js} +2 -2
- package/dist/{chunk-g2rxbaah.js → chunk-a6hv03yw.js} +3 -3
- package/dist/chunk-a7s1j320.js +127 -0
- package/dist/chunk-a83r1xx9.js +2 -0
- package/dist/chunk-abpeac2d.js +2 -0
- package/dist/chunk-adzsqsjt.js +2 -0
- package/dist/{chunk-4fv3jq16.js → chunk-ahyq08mp.js} +2 -2
- package/dist/chunk-b1ndskw9.js +2 -0
- package/dist/chunk-b7fp3zta.js +2 -0
- package/dist/{chunk-pbphq5pj.js → chunk-b7hv69ty.js} +2 -2
- package/dist/{chunk-avt9cske.js → chunk-baw176ay.js} +6 -6
- package/dist/chunk-bgfkbesj.js +2 -0
- package/dist/{chunk-cy1j2zpr.js → chunk-bk9bx2ns.js} +2 -2
- package/dist/{chunk-gh34r6qb.js → chunk-bsts9pr5.js} +2 -2
- package/dist/{chunk-jzmz66a3.js → chunk-bysyrwfa.js} +3 -3
- package/dist/{chunk-y89m80pf.js → chunk-c4ysk7x2.js} +4 -4
- package/dist/{chunk-90pe63me.js → chunk-camd8j1q.js} +3 -3
- package/dist/{chunk-0qt1887j.js → chunk-cdab66xt.js} +2 -2
- package/dist/{chunk-gv15dd41.js → chunk-cjr8cpb7.js} +3 -3
- package/dist/{chunk-y8h823cb.js → chunk-cw9pc5yx.js} +41 -41
- package/dist/chunk-cy83yfy9.js +2 -0
- package/dist/chunk-dbqb1a51.js +2 -0
- package/dist/{chunk-pk757m0k.js → chunk-e0nq8g9j.js} +1 -1
- package/dist/chunk-e8t64hxk.js +2 -0
- package/dist/chunk-e943xk88.js +2 -0
- package/dist/{chunk-w8bf4mbw.js → chunk-emcbmr0r.js} +3 -3
- package/dist/{chunk-kpxty3pe.js → chunk-f30t1g74.js} +2 -2
- package/dist/{chunk-tx4xxpgg.js → chunk-f3agc1a3.js} +3 -3
- package/dist/{chunk-27784ceh.js → chunk-fm80xpxn.js} +4 -4
- package/dist/{chunk-xrrkf04f.js → chunk-fwawm5r3.js} +2 -2
- package/dist/chunk-g039c67x.js +2 -0
- package/dist/{chunk-gxpgwpq7.js → chunk-g9dz0mx9.js} +2 -2
- package/dist/{chunk-bd5na0h0.js → chunk-g9sdjgfw.js} +5 -5
- package/dist/{chunk-k2nrx78c.js → chunk-gcj5jfbv.js} +2 -2
- package/dist/chunk-ghfxfcr9.js +2 -0
- package/dist/chunk-gvyq9xt6.js +2 -0
- package/dist/chunk-h30y9k44.js +2 -0
- package/dist/{chunk-236twqn4.js → chunk-hbzk179w.js} +3 -3
- package/dist/chunk-hwp3m8a8.js +2 -0
- package/dist/{chunk-2bxsc7gf.js → chunk-j79f6syh.js} +4 -4
- package/dist/chunk-jarptkbv.js +2 -0
- package/dist/{chunk-ftkrsvqp.js → chunk-jtr30kkz.js} +1 -1
- package/dist/{chunk-fdy0hka5.js → chunk-kjtvdqb9.js} +13 -13
- package/dist/chunk-kk6tq07c.js +3 -0
- package/dist/chunk-km4xp898.js +2 -0
- package/dist/{chunk-j1rnhv0w.js → chunk-kr14jt4m.js} +3 -3
- package/dist/{chunk-az1y9jks.js → chunk-kwwrrasa.js} +2 -2
- package/dist/chunk-kxbw0e2f.js +3 -0
- package/dist/{chunk-a887js9p.js → chunk-m56ee2tw.js} +5 -5
- package/dist/chunk-meze7k8v.js +2 -0
- package/dist/chunk-mfwrxz9z.js +2 -0
- package/dist/chunk-mmpm1awz.js +2 -0
- package/dist/{chunk-0whv8hnp.js → chunk-mn97jhaq.js} +2 -2
- package/dist/{chunk-3yh585yv.js → chunk-mpb0ezee.js} +3 -3
- package/dist/{chunk-g35zftfn.js → chunk-mvt5n2q4.js} +1 -1
- package/dist/chunk-n7vetrt4.js +2 -0
- package/dist/chunk-nd716zha.js +2 -0
- package/dist/{chunk-0hs8jgw5.js → chunk-npn3h566.js} +2 -2
- package/dist/{chunk-5x59qjzs.js → chunk-pak6ngv0.js} +6 -6
- package/dist/{chunk-v5500ews.js → chunk-pp6ycfay.js} +2 -2
- package/dist/{chunk-vhktd16g.js → chunk-psranzfr.js} +2 -2
- package/dist/chunk-ptjz4f2e.js +2 -0
- package/dist/{chunk-8qrhz7n7.js → chunk-ptv5f34x.js} +6 -6
- package/dist/{chunk-86zj56pf.js → chunk-q0kbn64j.js} +5 -5
- package/dist/chunk-q4hmgj72.js +2 -0
- package/dist/chunk-q841b6x4.js +2 -0
- package/dist/{chunk-v4tmwamd.js → chunk-qa58qdz8.js} +2 -2
- package/dist/{chunk-8hjrr8j3.js → chunk-qczse5w4.js} +33 -33
- package/dist/{chunk-tn7hgtyn.js → chunk-qjfgdcck.js} +5 -5
- package/dist/chunk-qnh5x7vv.js +2 -0
- package/dist/chunk-qxjfvkjt.js +2 -0
- package/dist/chunk-rhhwz7e9.js +2 -0
- package/dist/chunk-rpbe5h6v.js +2 -0
- package/dist/chunk-rrdn4qnn.js +2 -0
- package/dist/{chunk-xm911f1g.js → chunk-ry1w4ghk.js} +1 -1
- package/dist/chunk-s7c9kb53.js +2 -0
- package/dist/chunk-sfj84n72.js +2 -0
- package/dist/chunk-sgr2hhsc.js +2 -0
- package/dist/{chunk-jbmjcs83.js → chunk-shcn4wve.js} +2 -2
- package/dist/{chunk-zs7t42b5.js → chunk-sn0a8cjd.js} +5 -5
- package/dist/chunk-taztcvv3.js +2 -0
- package/dist/chunk-vczt5k2j.js +2 -0
- package/dist/chunk-vj5fghnv.js +2 -0
- package/dist/{chunk-6dzqjbsz.js → chunk-vyjdzpb8.js} +2 -2
- package/dist/chunk-wj4rf7sb.js +2 -0
- package/dist/chunk-wn1s8af8.js +2 -0
- package/dist/{chunk-t7e9y46s.js → chunk-x7g0946r.js} +1 -1
- package/dist/{chunk-rq1c46zb.js → chunk-xdwpbqzz.js} +34 -9
- package/dist/chunk-y3jyk5bj.js +2 -0
- package/dist/chunk-y51ndrdb.js +2 -0
- package/dist/{chunk-xrkechs8.js → chunk-y5b25eks.js} +5 -5
- package/dist/{chunk-tc7gm68a.js → chunk-ycz5th6b.js} +2 -2
- package/dist/{chunk-3kkf43fv.js → chunk-ym0e374a.js} +2 -2
- package/dist/{chunk-pxpmx8vc.js → chunk-ymntav9f.js} +1 -1
- package/dist/{chunk-8kc6byaz.js → chunk-yp8tk3v3.js} +5 -5
- package/dist/{chunk-bng1ayzm.js → chunk-ytv0k9gy.js} +9 -9
- package/dist/chunk-ytxzy6eg.js +2 -0
- package/dist/chunk-ywf319rp.js +2 -0
- package/dist/chunk-yww6c9we.js +2 -0
- package/dist/chunk-yy43hxb7.js +2 -0
- package/dist/chunk-z42jb949.js +2 -0
- package/dist/{chunk-y04hzz4w.js → chunk-zfrpss8y.js} +4 -4
- package/dist/{chunk-8b2452m1.js → chunk-zpzk4wd2.js} +11 -11
- package/dist/chunk-zw20a7q4.js +2 -0
- package/dist/cli.js +76 -76
- package/dist/client/signals-public-api-runtime.js +1 -0
- package/dist/client/signals-timer-runtime.js +24 -0
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/lazy-module.js +2 -1
- package/dist/menubar.d.ts +2 -0
- package/dist/menubar.js +15 -2
- package/dist/native/compiler/headwind-to-style.d.ts +6 -3
- package/dist/native/compiler/headwind-to-style.js +25 -3
- package/dist/native/compiler/html-to-ir.js +4 -4
- package/dist/native/prop-names.d.ts +1 -1
- package/dist/native/prop-names.js +3 -1
- package/dist/native/runtime/native-host.js +66 -7
- package/dist/pwa.js +3 -3
- package/dist/runtime-globals.js +1 -0
- package/dist/ssg.js +9 -9
- package/dist/stx-module.d.ts +1 -0
- package/package.json +5 -5
- package/stx-module.d.ts +1 -0
- package/stx.d.ts +7 -0
- package/dist/chunk-0mgtrbaa.js +0 -2
- package/dist/chunk-0xc6rncm.js +0 -2852
- package/dist/chunk-1tpr8d8n.js +0 -2
- package/dist/chunk-20kjbf3h.js +0 -2
- package/dist/chunk-3gcg3gvy.js +0 -2
- package/dist/chunk-3wsrhj0k.js +0 -2
- package/dist/chunk-575cqc6z.js +0 -2
- package/dist/chunk-5x836mv3.js +0 -2
- package/dist/chunk-5yceay9n.js +0 -2
- package/dist/chunk-6pg2kxsq.js +0 -2
- package/dist/chunk-7nthebqr.js +0 -2
- package/dist/chunk-7s5304ae.js +0 -2
- package/dist/chunk-8dybd0g5.js +0 -2
- package/dist/chunk-8em788gc.js +0 -2
- package/dist/chunk-9svygzeg.js +0 -2
- package/dist/chunk-9z4qr5w9.js +0 -2
- package/dist/chunk-af4ss0p5.js +0 -2
- package/dist/chunk-aj34t5h3.js +0 -2
- package/dist/chunk-atcy4zq6.js +0 -2
- package/dist/chunk-az28kd7f.js +0 -2
- package/dist/chunk-cncdgxk3.js +0 -2
- package/dist/chunk-d2t2pq1s.js +0 -3
- package/dist/chunk-dcx2t3sy.js +0 -2
- package/dist/chunk-dn28q0m3.js +0 -2
- package/dist/chunk-dn89zg1v.js +0 -2
- package/dist/chunk-dwddzp5f.js +0 -2
- package/dist/chunk-enchx79c.js +0 -2
- package/dist/chunk-ev8ma4ph.js +0 -2
- package/dist/chunk-ftrsaag8.js +0 -2
- package/dist/chunk-g6efz3ww.js +0 -2
- package/dist/chunk-gd59tkhr.js +0 -2
- package/dist/chunk-h1g9m148.js +0 -2
- package/dist/chunk-h8tew5mz.js +0 -2
- package/dist/chunk-hdrcgepx.js +0 -127
- package/dist/chunk-hn64343d.js +0 -2
- package/dist/chunk-htaed68z.js +0 -2
- package/dist/chunk-j5jkh05f.js +0 -2
- package/dist/chunk-j90yng9b.js +0 -2
- package/dist/chunk-jabb3v4c.js +0 -2
- package/dist/chunk-jczvjn7z.js +0 -2
- package/dist/chunk-kqkhcbrx.js +0 -2
- package/dist/chunk-mgzegkvk.js +0 -2
- package/dist/chunk-mk71833d.js +0 -2
- package/dist/chunk-n3s3w1f5.js +0 -2
- package/dist/chunk-nj0b4ryt.js +0 -2
- package/dist/chunk-ny6enm8b.js +0 -3
- package/dist/chunk-p8ndfekp.js +0 -2
- package/dist/chunk-qhjm9hvz.js +0 -2
- package/dist/chunk-qzy34xmt.js +0 -2
- package/dist/chunk-ra40trfh.js +0 -2
- package/dist/chunk-rjq597cn.js +0 -2
- package/dist/chunk-rrdwynz4.js +0 -2
- package/dist/chunk-sddytf9n.js +0 -2
- package/dist/chunk-shhtbdnj.js +0 -2
- package/dist/chunk-t4g97h08.js +0 -2
- package/dist/chunk-t7f9zmy8.js +0 -2
- package/dist/chunk-tme29zh9.js +0 -3
- package/dist/chunk-x1xx8qt0.js +0 -2
- package/dist/chunk-xmfhb2v0.js +0 -2
- package/dist/chunk-xsw183n7.js +0 -2
- package/dist/chunk-xtwe2rnp.js +0 -2
- package/dist/chunk-xxnh7gv8.js +0 -2
- package/dist/chunk-y84n0dvg.js +0 -2
- package/dist/chunk-zr0k9pz5.js +0 -2
- package/dist/chunk-zytcxy8p.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Sl}from"./chunk-a6hv03yw.js";import"./chunk-7m5xrqnj.js";import"./chunk-bysyrwfa.js";import"./chunk-f30t1g74.js";import"./chunk-j79f6syh.js";import"./chunk-bk9bx2ns.js";import"./chunk-fwawm5r3.js";import"./chunk-1wb98s7b.js";import"./chunk-zpzk4wd2.js";import"./chunk-ptv5f34x.js";import"./chunk-ahyq08mp.js";import"./chunk-kk6tq07c.js";import"./chunk-c4ysk7x2.js";import"./chunk-ym0e374a.js";export{Sl as startInteractive};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as
|
|
3
|
-
export{
|
|
2
|
+
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as Fl}from"ts-broadcasting";import{Broadcast as zl,BroadcastServer as Hl}from"ts-broadcasting";var e=null,u=[];function Il(){return e}async function Ol(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Nl(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function Dl(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();Ra(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function Ra(n,t,r){if(!i())return;s.send(n,t,r)}function Ml(n,t,r){if(!i())return;s.toUser(n,t,r)}function Ll(n,t,r){if(!i())return;s.toUsers(n,t,r)}function jl(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function Bl(n,t,r){if(!i())return;s.presence(n,t,r)}
|
|
3
|
+
export{Il,Ol,Nl,Dl,Ra,Ml,Ll,jl,Bl,Fl,zl,Hl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{s}from"./chunk-
|
|
2
|
+
import{s}from"./chunk-3e2v2fdh.js";function y(e,n,i=240){return e.slice(n,n+i)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(e)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(e)||/\b(?:const|let|var)\s+alert\s*=/.test(e)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(e,n)=>{let i=e.indexOf("(",n);if(i===-1)return!0;let o=e.slice(i+1,e.indexOf(")",i)+1);return!/\b(?:location|search|href|url)\b/i.test(o)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(e,n)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(y(e,n,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(e,n)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(y(e,n))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(e)=>/setTimeout\s*\(/.test(e)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],C=["confirm","tooltip",...v.map((e)=>e.rule)];function g(e,n){let i=1;for(let o=0;o<n;o++)if(e[o]===`
|
|
3
3
|
`)i++;return i}function b(e,n){let i=e.lastIndexOf(`
|
|
4
4
|
`,n)+1,o=e.indexOf(`
|
|
5
5
|
`,n);return e.slice(i,o===-1?e.length:o).trim().slice(0,120)}function S(e,n){let i=e.slice(0,n),o=i.lastIndexOf("function"),l=i.lastIndexOf("=>"),r=Math.max(o,l);if(r===-1)return!1;let t=e.slice(Math.max(0,r-120),r);return/\basync\b[^;{}]*$/.test(t)}function k(e){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(e)||/\b(?:const|let|var)\s+confirm\s*=/.test(e)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(e)}function A(e,n,i){if(k(e))return e;let o=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,l=m(e),r="",t=0,a;while((a=o.exec(l))!==null){let c=a.index+a[1].length,u=g(e,c),d=b(e,c);if(/stxConfirm\s*\($/.test(e.slice(0,c+8)))continue;let p=S(e,c);if(i.push({file:n,line:u,rule:"confirm",applied:p,snippet:d,reason:p?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),p)r+=e.slice(t,c)+"await stxConfirm(",t=c+(a[0].length-a[1].length)}return r+e.slice(t)}function E(e,n,i){let o=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,l=R(e),r="",t=0,a;while((a=o.exec(l))!==null){let[c,u,d,p]=a,h=g(e,a.index),f=b(e,a.index),w=u.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(w)){i.push({file:n,line:h,rule:"tooltip",applied:!1,snippet:f,reason:`\`title\` on <${w}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test(u)||p.trim()===""){i.push({file:n,line:h,rule:"tooltip",applied:!1,snippet:f,reason:/\bx-tooltip[=\s]/.test(u)?"already has x-tooltip":"empty title"});continue}i.push({file:n,line:h,rule:"tooltip",applied:!0,snippet:f}),r+=e.slice(t,a.index)+`${u} x-tooltip=${d}${p}${d} title=${d}${p}${d}`,t=a.index+c.length}return r+e.slice(t)}function R(e){return e.replace(/<!--[\s\S]*?-->/g,(n)=>n.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(n)=>n.replace(/[^\n]/g," "))}function F(e){let n=(i)=>i.replace(/[^\n]/g," ");return e.replace(/\/\*[\s\S]*?\*\//g,n).replace(/\/\/[^\n]*/g,n)}function m(e,n=!1){let i=R(e);return(n?F(i):s(i)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(l,r)=>/\bclient\b/i.test(r)?l:l.replace(/[^\n]/g," "))}function O(e,n,i,o){let l=m(e),r=m(e,!0);for(let t of v){if(!i.includes(t.rule))continue;if(t.requires&&!t.requires(e))continue;t.pattern.lastIndex=0;let a,c=/['"]/.test(t.pattern.source)?r:l;t.pattern.lastIndex=0;while((a=t.pattern.exec(c))!==null){if(t.reject?.(e,a.index))continue;o.push({file:n,line:g(e,a.index),rule:t.rule,applied:!1,snippet:b(e,a.index),reason:`${t.primitive} \u2014 ${t.why}`})}}}function q(e,n={}){let i=n.rules??C,o=n.file??"<source>",l=[];O(e,o,i,l);let r=e;if(i.includes("confirm"))r=A(r,o,l);if(i.includes("tooltip"))r=E(r,o,l);l.sort((c,u)=>c.line-u.line);let t=new Set,a=l.filter((c)=>{let u=`${c.rule}:${c.line}`;if(t.has(u))return!1;return t.add(u),!0});return{code:r,findings:a}}var x=new Set(["confirm","tooltip"]);function I(e,n){if(e.length===0)return"No hand-rolled equivalents found.";let i=e.filter((t)=>t.applied),o=e.filter((t)=>!t.applied&&x.has(t.rule)),l=e.filter((t)=>!t.applied&&!x.has(t.rule)),r=[];if(i.length>0){r.push(n?`Rewrote ${i.length} site(s):`:`Would rewrite ${i.length} site(s) (pass --fix):`);for(let t of i)r.push(` ${t.file}:${t.line} [${t.rule}] ${t.snippet}`)}if(o.length>0){r.push("",`Needs a human \u2014 ${o.length} site(s):`);for(let t of o)r.push(` ${t.file}:${t.line} [${t.rule}] ${t.snippet}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{zt,Vc,Uc,Wc,qc,Gc,u,Kc,Ns,Xc,Ii,Oi}from"./chunk-7m5xrqnj.js";import"./chunk-bysyrwfa.js";import"./chunk-f30t1g74.js";import"./chunk-j79f6syh.js";import"./chunk-bk9bx2ns.js";import"./chunk-fwawm5r3.js";import"./chunk-1wb98s7b.js";import"./chunk-zpzk4wd2.js";import"./chunk-ptv5f34x.js";import"./chunk-ahyq08mp.js";import"./chunk-kk6tq07c.js";import"./chunk-c4ysk7x2.js";import"./chunk-ym0e374a.js";export{zt as STX_ENGINE_BINDING_NAMES,Ns as convertToCommonJS,Ii as extractScriptFromTemplate,u as extractVariables,Oi as hasVariables,Kc as isCompleteImport,Gc as isMissingBindingFailure,Wc as isModuleResolutionFailure,qc as isSyntaxFailure,Xc as splitDeclaration,Vc as stripTypeScript,Uc as withoutStxReferrer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pl}from"./chunk-954tcahb.js";import"./chunk-qjfgdcck.js";import"./chunk-xdwpbqzz.js";import"./chunk-yp8tk3v3.js";import"./chunk-7m5xrqnj.js";import"./chunk-bysyrwfa.js";import"./chunk-f30t1g74.js";import"./chunk-j79f6syh.js";import"./chunk-bk9bx2ns.js";import"./chunk-fwawm5r3.js";import"./chunk-1wb98s7b.js";import"./chunk-zpzk4wd2.js";import"./chunk-ptv5f34x.js";import"./chunk-ahyq08mp.js";import"./chunk-kk6tq07c.js";import"./chunk-c4ysk7x2.js";import"./chunk-ym0e374a.js";export{Pl as buildForProduction};
|
|
@@ -298,5 +298,5 @@ catch (error) {
|
|
|
298
298
|
init();
|
|
299
299
|
}
|
|
300
300
|
})();
|
|
301
|
-
</script>`}var
|
|
302
|
-
export{
|
|
301
|
+
</script>`}var bl={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},vl={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},wl={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},xl={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},Dr=[bl,vl,wl,xl];function zd(t){return[...t,...Dr]}
|
|
302
|
+
export{bl,vl,wl,xl,Dr,zd};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{De}from"./chunk-c4ysk7x2.js";import{Ue,un}from"./chunk-xdwpbqzz.js";import{gi,mi,f,Ft,he,j,n,A,o}from"./chunk-7m5xrqnj.js";import{C}from"./chunk-fwawm5r3.js";import{Gs}from"./chunk-bk9bx2ns.js";import{In,On,Nn,Mn,xe}from"./chunk-zpzk4wd2.js";import{Gi}from"./chunk-j79f6syh.js";import{ke,le,No,Do,Jt}from"./chunk-qjfgdcck.js";import{Ot,ms}from"./chunk-yp8tk3v3.js";import{Yt}from"./chunk-kwwrrasa.js";import{Et,mn,hn}from"./chunk-kxbw0e2f.js";import m from"fs";import c from"path";import{createHash as Q}from"crypto";function J(i){return Q("sha256").update(i).digest("hex").slice(0,8)}function U(i=!1){let l=i?un():Ue(),a=J(l);return{content:l,filename:`runtime.${a}.js`,hash:a}}function V(){let i=De(),l=J(i);return{content:i,filename:`router.${l}.js`,hash:l}}import q from"path";import{createHash as ee}from"crypto";function te(i={}){let l=new Set;return{context:new Proxy(i,{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(i,l,a={}){let r=q.resolve(i),e=await Bun.file(r).text(),S=ee("sha256").update(e).digest("hex").slice(0,16);gi();let _={};try{_=await o(a.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let R=g[1];if(/\bserver\b/.test(R))y.push(g[2])}let u=new Set(y.flatMap((R)=>he(R))),{context:D}=te({__filename:r,__dirname:q.dirname(r),__stx_serverDeclared:u}),w=new Set,B={...A,..._,...a,buildMode:"compile",strict:!1},b=await n(e,D,r,B,w),T=ke(b),M=mi();return{route:l,sourceFile:i,html:b,fragment:T,placeholders:M,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(w),contentHash:S,status:Ft(e),streamTemplates:D.__streamTemplates}}var re=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(i,l){let a=0,r=0;if(!m.existsSync(i))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 g=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),a++,r+=m.statSync(u).size}}}return e(i,l),{copied:a,bytes:r}}async function Pl(i={}){let l=Date.now(),a=c.resolve(i.root||process.cwd()),r=c.resolve(a,i.outputDir||".output");console.log("[stx build] Starting production build...");let e=await o(a),S=c.resolve(a,i.componentsDir??e.componentsDir??"components"),_=c.resolve(a,i.partialsDir??e.partialsDir??"partials"),y=c.resolve(a,i.layoutsDir??e.layoutsDir??"layouts"),d=i.publicDir??e.publicDir??"public",g=xe(e.app?.head,{known:Mn,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",w=i.routeRules??e.routeRules??{},B=Yt(w),b=i.serverApi??e.serverApi,T=typeof b==="object"?b:{};if(b)Ot(a,T);if(e.runtimeConfig)C(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let M=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of M)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=j(a,{pagesDirs:e._layerPageDirs}),Y=["components","layouts","partials"],O=R.filter((s)=>!Y.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${O.length} page routes (${R.length-O.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=U(i.debug),x=V();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 k=[],H=[];for(let s of O){let h=B(s.pattern),E=h.rendering==="prerender";if(E&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await X(s.filePath,s.pattern,{configDir:a,componentsDir:S,partialsDir:_,layoutsDir:y,debug:i.debug});if(k.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,x.filename),t.html=Nn(t.html,g,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=In(t.html,u);if(g.htmlAttrs)t.html=On(t.html,g.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 W=p[1];t.html=t.html.replace(" "+W,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${W}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await f(t.html),E){let p=await Jt(t,{params:{},request:new Request(`http://stx.build${s.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 ${s.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=le(t.html,D);let z=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),G=c.join("server","pages",`${z}.compiled.json`),I=c.join("server","fragments",`${z}.html`);await Bun.write(c.join(r,G),JSON.stringify(t,null,2)),await Bun.write(c.join(r,I),t.fragment),H.push({pattern:s.pattern,compiledPath:G,fragmentPath:I,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:E}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let F=c.resolve(a,d);if(m.existsSync(F)){let{copied:s,bytes:h}=Z(F,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let N=hn(a);if(N){let{copied:s,bytes:h}=Z(N,c.join(r,"public",mn));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${Et}/`)}let K={runtime:v.filename,router:x.filename},P=No(H,K,r);if(P.routeRules=w,P.routerContainer=D,b)P.apiRoutes=await ms(a,r,T);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Gs(a,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(Gi(e._layerGraph),null,2));Do(P,r);let L=Date.now()-l;return console.log(`
|
|
3
3
|
[stx build] Done in ${L}ms \u2014 ${k.length} pages compiled`),{pageCount:k.length,assets:K,outputDir:r,duration:L}}
|
|
4
|
-
export{
|
|
4
|
+
export{Pl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{or,Ge,Ce,_e,wi,ur,oe,Q,Tn,u,n,A}from"./chunk-7m5xrqnj.js";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function _(o){let e=[];g(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];g(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function g(s,p){let m;while((m=s.exec(o))!==null){let t=m.index,i=t+m[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:r,content:g}=or(o),c=await(e.renderer??((s)=>Ge(s)))(g);return{html:_(c),frontmatter:r??{}}}import{dirname as C,resolve as R}from"path";function k(o){let e=o,r=oe(o);if(r)e=r.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),m;while((m=g.exec(o))!==null){let i=m[1],l=m[2],f=m[0],d=i.includes("server");if(p(l))s.push(f);else if(d)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let d=l.index+l[0].length,x=t.indexOf("</script>",d);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let d=f.length-1;d>=0;d--)t=t.substring(0,f[d].start)+t.substring(f[d].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function v(o,e){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -9,10 +9,10 @@ import{sr,qe,ke,_e,vi,lr,oe,Q,En,u,n,A}from"./chunk-0xc6rncm.js";function h(o){r
|
|
|
9
9
|
<body>
|
|
10
10
|
${o}
|
|
11
11
|
</body>
|
|
12
|
-
</html>`}async function
|
|
12
|
+
</html>`}async function ti(o,e={}){let r=R(o),g=Bun.file(r);if(!await g.exists())throw Error(`Template file not found: ${r}`);let a=await g.text(),c=null;if(h(r)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=R(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:m,injectCSS:t,...i}=e,l={...e.context||{}};Tn(l);let f=await S(a,r,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),d=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(d,s,w)}return S(a,r,e)}async function S(o,e,r={}){let{templateContent:g,serverScripts:a,clientScripts:c}=k(o),s={...A,...r.options},p={__filename:e,__dirname:C(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...ur(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let i of a)await u(i,p,e);let m=new Set,t=g;if(t=await n(t,p,e,s,m),wi(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
|
|
13
13
|
${c.join(`
|
|
14
|
-
`)}`}else{if(r.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=
|
|
14
|
+
`)}`}else{if(r.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=Ce(p),d=(await Promise.all(c.map(async(w)=>{let y=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!y)return w;return await _e(y[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})}))).join(`
|
|
15
15
|
`);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${d}
|
|
16
16
|
$1`);else t+=`
|
|
17
|
-
${d}`}t=await Q(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=v(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-
|
|
18
|
-
export{
|
|
17
|
+
${d}`}t=await Q(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=v(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-meze7k8v.js");t=await i(t)}catch{}return t}
|
|
18
|
+
export{ti};
|
|
@@ -72,7 +72,7 @@ else {
|
|
|
72
72
|
${t}
|
|
73
73
|
})();
|
|
74
74
|
</script>
|
|
75
|
-
`}function
|
|
75
|
+
`}function au(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
|
|
76
76
|
<div id="${a}" class="stx-defer" data-defer-trigger="${r.trigger}">
|
|
77
77
|
${d}
|
|
78
78
|
${c}
|
|
@@ -81,4 +81,4 @@ else {
|
|
|
81
81
|
</div>
|
|
82
82
|
${h}
|
|
83
83
|
`})}
|
|
84
|
-
export{
|
|
84
|
+
export{au};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Z,n}from"./chunk-
|
|
2
|
+
import{Z,n}from"./chunk-7m5xrqnj.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 r=u[t[0]];console.log(`
|
|
3
3
|
${e.bold}${t[0]}${e.reset} - ${r.description}`),console.log(` Usage: ${e.cyan}${r.usage}${e.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${e.bold}Available Commands:${e.reset}
|
|
@@ -16,9 +16,9 @@ ${e.bold}Markdown:${e.reset}`),a.forEach((i)=>console.log(` ${e.blue}${i}${e.re
|
|
|
16
16
|
${e.bold}Other:${e.reset}`),d.forEach((i)=>console.log(` ${e.dim}${i}${e.reset}`));console.log()}},cat:{description:"Show file contents",usage:"cat <file>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file${e.reset}`);return}let r=g.resolve(o.cwd,t[0]);if(!await Bun.file(r).exists()){console.log(`${e.red}Error: File not found: ${r}${e.reset}`);return}let l=(await Bun.file(r).text()).split(`
|
|
17
17
|
`);console.log(),l.forEach((c,a)=>{let d=String(a+1).padStart(3," ");console.log(`${e.dim}${d}${e.reset} ${c}`)}),console.log()}},load:{description:"Load context from JSON file",usage:"load <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a JSON file${e.reset}`);return}let r=g.resolve(o.cwd,t[0]);if(!await Bun.file(r).exists()){console.log(`${e.red}Error: File not found: ${r}${e.reset}`);return}try{let s=await Bun.file(r).text(),l=JSON.parse(s);o.context={...o.context,...l},console.log(`${e.green}\u2713${e.reset} Loaded ${Object.keys(l).length} variables from ${t[0]}`)}catch(s){console.log(`${e.red}Error parsing JSON:${e.reset}`,s)}}},save:{description:"Save context to JSON file",usage:"save <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file name${e.reset}`);return}let r=g.resolve(o.cwd,t[0]);try{await Bun.write(r,JSON.stringify(o.context,null,2)),console.log(`${e.green}\u2713${e.reset} Context saved to ${t[0]}`)}catch(s){console.log(`${e.red}Error saving file:${e.reset}`,s)}}},history:{description:"Show command history",usage:"history [count]",handler:async(t,o)=>{let r=t[0]?Number.parseInt(t[0],10):20,s=o.history.slice(-r);if(s.length===0){console.log(`${e.dim}No history${e.reset}`);return}console.log(),s.forEach((l,c)=>{let a=String(o.history.length-s.length+c+1).padStart(3," ");console.log(`${e.dim}${a}${e.reset} ${l}`)}),console.log()}},exit:{description:"Exit interactive mode",usage:"exit",handler:async(t,o)=>{o.running=!1,console.log(`
|
|
18
18
|
${e.dim}Goodbye!${e.reset}
|
|
19
|
-
`)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let r=t.split(" "),s=r[0];if(r.length===1)return Object.keys(u).filter((l)=>l.startsWith(s));if(["render","cat","load","cd"].includes(s)){let l=r.slice(1).join(" "),c=g.dirname(l)||".",a=g.basename(l),d=g.resolve(o.cwd,c);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${s} ${c==="."?"":`${c}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(s)){let l=r[1]||"";return Object.keys(o.context).filter((c)=>c.startsWith(l)).map((c)=>`${s} ${c}`)}return[]}async function
|
|
19
|
+
`)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let r=t.split(" "),s=r[0];if(r.length===1)return Object.keys(u).filter((l)=>l.startsWith(s));if(["render","cat","load","cd"].includes(s)){let l=r.slice(1).join(" "),c=g.dirname(l)||".",a=g.basename(l),d=g.resolve(o.cwd,c);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${s} ${c==="."?"":`${c}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(s)){let l=r[1]||"";return Object.keys(o.context).filter((c)=>c.startsWith(l)).map((c)=>`${s} ${c}`)}return[]}async function Sl(t={}){let o={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},r=y.createInterface({input:process.stdin,output:process.stdout,completer:(l)=>[h(l,o),l],historySize:t.maxHistory||100});console.log(`
|
|
20
20
|
${e.bold}${e.blue}stx Interactive Mode${e.reset}
|
|
21
21
|
${e.dim}Type 'help' for available commands, 'exit' to quit${e.reset}
|
|
22
22
|
`);let s=()=>{let l=o.cwd.replace(process.env.HOME||"","~");r.question(`${e.cyan}stx${e.reset} ${e.dim}${l}${e.reset} ${e.green}>${e.reset} `,async(c)=>{let a=c.trim();if(!a){if(o.running)s();return}o.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],i=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(i&&u[i])try{await u[i].handler(f,o)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(i)if(a.includes("{{")||a.includes("}}"))try{let m=await Z(a,o.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(o.running)s();else r.close()})};r.on("SIGINT",()=>{console.log(`
|
|
23
23
|
${e.dim}(Use 'exit' to quit)${e.reset}`),s()}),s()}
|
|
24
|
-
export{
|
|
24
|
+
export{Sl};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-ptv5f34x.js";import"./chunk-f30t1g74.js";import"./chunk-c4ysk7x2.js";import{Ar,ao,ua}from"./chunk-kk6tq07c.js";import"./chunk-ahyq08mp.js";import{Je,Te,se,jt,me,kn,Cn,$e,fr,n,o}from"./chunk-7m5xrqnj.js";import"./chunk-zpzk4wd2.js";import"./chunk-1wb98s7b.js";import"./chunk-fwawm5r3.js";import"./chunk-bk9bx2ns.js";import"./chunk-ym0e374a.js";import"./chunk-j79f6syh.js";import{Ue}from"./chunk-xdwpbqzz.js";import"./chunk-bsts9pr5.js";import"./chunk-yp8tk3v3.js";import{ps}from"./chunk-fm80xpxn.js";import"./chunk-bysyrwfa.js";import{existsSync as ue,mkdirSync as pr,readFileSync as gr}from"fs";import X from"path";import{existsSync as je,mkdirSync as Et,realpathSync as nr,rmSync as It}from"fs";import C from"path";import{existsSync as Yn}from"fs";import te from"path";var Mt="data-stx-b",ze=new Set(ao),Dt=new Set(Ar);function Lt(r){if(r==="ref"||r==="data-stx-ref")return"ref";if(r.startsWith("::"))return null;if(r.startsWith("@bind:")||r.startsWith("x-bind:"))return"attr";if(r.startsWith("@")||r.startsWith(":")){let e=r.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(ua(e))return"event";if(r.startsWith("@"))return"event";return"attr"}if(r.startsWith("x-")){let e=r.split(".")[0];if(!Dt.has(e))return"attr";let t=e.slice(2);if(t==="cloak"||t==="data"||t==="bind")return null;if(t==="tooltip"||t==="tooltip-position")return null;return ze.has(t)?t==="if"?"if":t:"attr"}return null}function Vt(r){let e=[];for(let[t,i]of r){let s=Lt(t);if(s)e.push({name:t,value:i,kind:s})}return e}var $t=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,pe=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function He(r){let e=[],t=0;return{html:r.replace($t,(s,a,c)=>{if(!c||!/[:@]|x-/.test(c))return s;let u=[];pe.lastIndex=0;for(let b=pe.exec(c);b;b=pe.exec(c))u.push([b[1],b[2]??b[3]??b[4]??""]);let f=Vt(u);if(!f.length)return s;let h={id:t++,bindings:f};if(f.some((b)=>b.kind==="for"))h.template=!0;e.push(h);let S=s.endsWith("/>");return`${s.slice(0,S?-2:-1).trimEnd()} ${Mt}="${h.id}"${S?"/>":">"}`}),manifest:{entries:e}}}import pn from"path";function re(r){let e=r&&/^(\d+(?:\.\d+)?|\.\d+)(px|rem)?$/.exec(r.trim());if(!e)return;let t=Number(e[1])*(e[2]==="rem"?16:1);return Number.isFinite(t)?t:void 0}function ge(r,e){if(!se[r])return;return re(e?.get(jt(r))??se[r].value)}function he(r,e){let t=kn[r];if(!t)return;return re(e?.get($e(t))??me[t]?.value)}function ye(r,e){let t=Cn[r];if(!t)return;let i=re(e?.get($e(t.size))??me[t.size]?.value),s=re(e?.get($e(t.leading))??me[t.leading]?.value);if(i===void 0||s===void 0)return;return{fontSize:i,lineHeight:s}}var Wt={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"}},Ye={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},qe={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},Ge={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function G(r){let e=r.lastIndexOf("/");if(e>0&&!r.endsWith("]")){let i=G(r.slice(0,e)),s=r.slice(e+1),a=/^\[(.+)\]$/.test(s)?Number.parseFloat(s.slice(1,-1))*(s.includes("%")?1:100):Number.parseFloat(s);if(!i||!Number.isFinite(a))return;return Ft(i,a/100)}if(r==="transparent")return"transparent";if(r==="current")return"currentColor";if(r==="black")return"#000000";if(r==="white")return"#ffffff";let t=r.split("-");if(t.length===2){let[i,s]=t,a=Wt[i];if(a&&typeof a==="object")return a[s]}if(r.startsWith("[")&&r.endsWith("]")){let i=r.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(i)?i:void 0}return}function ve(r){return G(r.trim())}function Ft(r,e){if(r==="transparent")return r;let t=r.startsWith("#")?r.slice(1):"";if(t.length===3)t=t.split("").map((s)=>s+s).join("");if(t.length===8)t=t.slice(0,6);if(t.length!==6)return;let i=Math.round(Math.min(1,Math.max(0,e))*255);return`#${t}${i.toString(16).padStart(2,"0")}`}function be(r,e=16){if(!r.startsWith("[")||!r.endsWith("]"))return;let t=r.slice(1,-1),i=Number.parseFloat(t);if(!Number.isFinite(i))return;if(t.endsWith("rem"))return i*16;if(t.endsWith("em"))return i*e;return i}function O(r){if(r.startsWith("[")&&r.endsWith("]")){let e=r.slice(1,-1);if(e.endsWith("%"))return;let t=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(t)?t:void 0}return Ye[r]??he(r)}function ie(r){let e=/^\[(-?\d*\.?\d+)%\]$/.exec(r);if(e)return`${Number.parseFloat(e[1])}%`;return O(r)}var Xt={flex:(r,e)=>(e.display="flex",!0),hidden:(r,e)=>(e.display="none",!0),grid:(r,e)=>(e.display="grid",!0),"flex-row":(r,e)=>(e.flexDirection="row",!0),"flex-col":(r,e)=>(e.flexDirection="column",!0),"flex-row-reverse":(r,e)=>(e.flexDirection="row-reverse",!0),"flex-col-reverse":(r,e)=>(e.flexDirection="column-reverse",!0),"flex-wrap":(r,e)=>(e.flexWrap="wrap",!0),"flex-nowrap":(r,e)=>(e.flexWrap="nowrap",!0),"flex-wrap-reverse":(r,e)=>(e.flexWrap="wrap-reverse",!0),"flex-1":(r,e)=>(e.flex=1,e.flexGrow=1,e.flexShrink=1,e.flexBasis=0,!0),"flex-auto":(r,e)=>(e.flexGrow=1,e.flexShrink=1,!0),"flex-initial":(r,e)=>(e.flexGrow=0,e.flexShrink=1,!0),"flex-none":(r,e)=>(e.flexGrow=0,e.flexShrink=0,!0),grow:(r,e)=>(e.flexGrow=1,!0),"grow-0":(r,e)=>(e.flexGrow=0,!0),shrink:(r,e)=>(e.flexShrink=1,!0),"shrink-0":(r,e)=>(e.flexShrink=0,!0),"order-first":(r,e)=>(e.order=-9999,!0),"order-last":(r,e)=>(e.order=9999,!0),"order-none":(r,e)=>(e.order=0,!0),"justify-start":(r,e)=>(e.justifyContent="flex-start",!0),"justify-center":(r,e)=>(e.justifyContent="center",!0),"justify-end":(r,e)=>(e.justifyContent="flex-end",!0),"justify-between":(r,e)=>(e.justifyContent="space-between",!0),"justify-around":(r,e)=>(e.justifyContent="space-around",!0),"justify-evenly":(r,e)=>(e.justifyContent="space-evenly",!0),"items-start":(r,e)=>(e.alignItems="flex-start",!0),"items-center":(r,e)=>(e.alignItems="center",!0),"items-end":(r,e)=>(e.alignItems="flex-end",!0),"items-stretch":(r,e)=>(e.alignItems="stretch",!0),"items-baseline":(r,e)=>(e.alignItems="baseline",!0),"self-auto":(r,e)=>(e.alignSelf="auto",!0),"self-start":(r,e)=>(e.alignSelf="flex-start",!0),"self-center":(r,e)=>(e.alignSelf="center",!0),"self-end":(r,e)=>(e.alignSelf="flex-end",!0),"self-stretch":(r,e)=>(e.alignSelf="stretch",!0),"self-baseline":(r,e)=>(e.alignSelf="baseline",!0),"min-w-0":(r,e)=>(e.minWidth=0,!0),"aspect-square":(r,e)=>(e.aspectRatio=1,!0),"inset-0":(r,e)=>(e.top=0,e.right=0,e.bottom=0,e.left=0,!0),"tracking-tighter":(r,e)=>(e.letterSpacing=-0.8,!0),"tracking-tight":(r,e)=>(e.letterSpacing=-0.4,!0),"tracking-normal":(r,e)=>(e.letterSpacing=0,!0),"tracking-wide":(r,e)=>(e.letterSpacing=0.4,!0),"tracking-wider":(r,e)=>(e.letterSpacing=0.8,!0),"tracking-widest":(r,e)=>(e.letterSpacing=1.6,!0),"tabular-nums":()=>!0,block:()=>!0,"inline-flex":(r,e)=>(e.display="flex",!0),truncate:()=>!0,relative:(r,e)=>(e.position="relative",!0),absolute:(r,e)=>(e.position="absolute",!0),"overflow-visible":(r,e)=>(e.overflow="visible",!0),"overflow-hidden":(r,e)=>(e.overflow="hidden",!0),"overflow-scroll":(r,e)=>(e.overflow="scroll",!0),"overflow-x-auto":()=>!0,"overflow-x-scroll":()=>!0,"overflow-y-auto":()=>!0,"overflow-y-scroll":()=>!0,"font-thin":(r,e)=>(e.fontWeight="100",!0),"font-extralight":(r,e)=>(e.fontWeight="200",!0),"font-light":(r,e)=>(e.fontWeight="300",!0),"font-normal":(r,e)=>(e.fontWeight="400",!0),"font-medium":(r,e)=>(e.fontWeight="500",!0),"font-semibold":(r,e)=>(e.fontWeight="600",!0),"font-bold":(r,e)=>(e.fontWeight="bold",!0),"font-extrabold":(r,e)=>(e.fontWeight="800",!0),"font-black":(r,e)=>(e.fontWeight="900",!0),italic:(r,e)=>(e.fontStyle="italic",!0),"not-italic":(r,e)=>(e.fontStyle="normal",!0),"text-left":(r,e)=>(e.textAlign="left",!0),"text-center":(r,e)=>(e.textAlign="center",!0),"text-right":(r,e)=>(e.textAlign="right",!0),"text-justify":(r,e)=>(e.textAlign="justify",!0),uppercase:(r,e)=>(e.textTransform="uppercase",!0),lowercase:(r,e)=>(e.textTransform="lowercase",!0),capitalize:(r,e)=>(e.textTransform="capitalize",!0),"normal-case":(r,e)=>(e.textTransform="none",!0),underline:(r,e)=>(e.textDecorationLine="underline",!0),"line-through":(r,e)=>(e.textDecorationLine="line-through",!0),"no-underline":(r,e)=>(e.textDecorationLine="none",!0)};function zt(r,e){if(!r.startsWith("bg-"))return!1;let t=r.slice(3),i=G(t);if(i)return e.backgroundColor=i,!0;return!1}function Ht(r,e){if(!r.startsWith("text-"))return!1;let t=r.slice(5),i=ye(t);if(i)return Object.assign(e,i),!0;if(qe[t])return e.fontSize=qe[t],!0;if(t.startsWith("[")&&t.endsWith("]")){let a=t.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(a)){let c=a.endsWith("rem")||a.endsWith("em")?Number.parseFloat(a)*16:Number.parseFloat(a);if(Number.isFinite(c))return e.fontSize=c,!0}}let s=G(t);if(s)return e.color=s,!0;return!1}var Ut=new Set(["t","tr","r","br","b","bl","l","tl"]);function qt(r,e){let t=/^bg-(?:gradient|linear)-to-([a-z]+)$/.exec(r);if(t&&Ut.has(t[1]))return e.gradientDirection=`to-${t[1]}`,!0;let i=/^(from|via|to)-(.+)$/.exec(r);if(!i)return!1;let s=G(i[2]);if(!s)return!1;if(i[1]==="from")e.gradientFrom=s;else if(i[1]==="via")e.gradientVia=s;else e.gradientTo=s;return!0}function Gt(r,e){for(let t of["fill","stroke"]){let i=`${t}-`;if(!r.startsWith(i))continue;let s=r.slice(i.length);if(s==="none")return e[t]="none",!0;if(t==="stroke"&&/^\d+(?:\.\d+)?$/.test(s))return e.strokeWidth=Number.parseFloat(s),!0;if(t==="stroke"&&/^\[\d+(?:\.\d+)?(?:px)?\]$/.test(s))return e.strokeWidth=Number.parseFloat(s.slice(1)),!0;let a=G(s);if(a)return e[t]=a,!0}return!1}function Jt(r,e){if(r.startsWith("p-")){let t=O(r.slice(2));if(t!==void 0)return e.padding=t,!0}if(r.startsWith("px-")){let t=O(r.slice(3));if(t!==void 0)return e.paddingHorizontal=t,!0}if(r.startsWith("py-")){let t=O(r.slice(3));if(t!==void 0)return e.paddingVertical=t,!0}if(r.startsWith("pt-")){let t=O(r.slice(3));if(t!==void 0)return e.paddingTop=t,!0}if(r.startsWith("pr-")){let t=O(r.slice(3));if(t!==void 0)return e.paddingRight=t,!0}if(r.startsWith("pb-")){let t=O(r.slice(3));if(t!==void 0)return e.paddingBottom=t,!0}if(r.startsWith("pl-")){let t=O(r.slice(3));if(t!==void 0)return e.paddingLeft=t,!0}return!1}function Qe(r,e){if(/^-(?:m|mx|my|mt|mr|mb|ml)-/.test(r)){let t={};if(!Qe(r.slice(1),t))return!1;let i=Object.entries(t);if(i.some(([,s])=>typeof s!=="number"))return!1;for(let[s,a]of i)e[s]=-a;return!0}if(r.startsWith("m-")){let t=O(r.slice(2));if(t!==void 0)return e.margin=t,!0}if(r.startsWith("mx-")){let t=O(r.slice(3));if(t!==void 0)return e.marginHorizontal=t,!0}if(r.startsWith("my-")){let t=O(r.slice(3));if(t!==void 0)return e.marginVertical=t,!0}if(r.startsWith("mt-")){let t=O(r.slice(3));if(t!==void 0)return e.marginTop=t,!0}if(r.startsWith("mr-")){let t=O(r.slice(3));if(t!==void 0)return e.marginRight=t,!0}if(r.startsWith("mb-")){let t=O(r.slice(3));if(t!==void 0)return e.marginBottom=t,!0}if(r.startsWith("ml-")){let t=O(r.slice(3));if(t!==void 0)return e.marginLeft=t,!0}return!1}function Kt(r,e){if(!r.startsWith("w-"))return!1;let t=r.slice(2);if(t==="full")return e.width="100%",!0;if(t==="screen")return e.width="100%",!0;if(t==="auto")return e.width="auto",!0;if(t.includes("/")){let[s,a]=t.split("/"),c=Number.parseInt(s)/Number.parseInt(a)*100;return e.width=`${c}%`,!0}let i=ie(t);if(i!==void 0)return e.width=i,!0;return!1}function Yt(r,e){if(!r.startsWith("h-"))return!1;let t=r.slice(2);if(t==="full")return e.height="100%",!0;if(t==="screen")return e.height="100%",!0;if(t==="auto")return e.height="auto",!0;let i=ie(t);if(i!==void 0)return e.height=i,!0;return!1}function Qt(r,e){if(r==="rounded")return e.borderRadius=Ge.DEFAULT,!0;if(!r.startsWith("rounded-"))return!1;let t=r.slice(8);if(t==="")return!1;let i=/^(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(t),s=Ge[i[2]]??ge(i[2])??be(i[2]);if(s===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 c of i[1]?a[i[1]]:["borderRadius"])e[c]=s;return!0}function Zt(r,e){let t=/^border(?:-([trblxy]))?(?:-(\d+|\[[^\]]+\]))?$/.exec(r);if(!t)return!1;let[,i="",s]=t,a=s===void 0?1:Number(s);if(s?.startsWith("[")){let u=/^\[(\d+(?:\.\d+)?|\.\d+)(px|rem)?\]$/.exec(s);if(!u)return!1;a=Number(u[1])*(u[2]==="rem"?16:1)}if(!Number.isFinite(a)||a<0)return!1;let c={"":["borderWidth"],t:["borderTopWidth"],r:["borderRightWidth"],b:["borderBottomWidth"],l:["borderLeftWidth"],x:["borderLeftWidth","borderRightWidth"],y:["borderTopWidth","borderBottomWidth"]};for(let u of c[i])e[u]=a;return!0}function en(r,e){if(!r.startsWith("border-"))return!1;let t=r.slice(7),i=G(t);if(i)return e.borderColor=i,!0;return!1}function tn(r,e){if(!r.startsWith("opacity-"))return!1;let t=Number.parseInt(r.slice(8));if(!Number.isNaN(t))return e.opacity=t/100,!0;return!1}function nn(r,e){if(r.startsWith("tracking-[")){let t=be(r.slice(9),typeof e.fontSize==="number"?e.fontSize:16);if(t===void 0)return!1;return e.letterSpacing=t,!0}if(r.startsWith("leading-")){let t=r.slice(8),i=typeof e.fontSize==="number"?e.fontSize:16,s={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},a=t.startsWith("[")?/^\[[\d.]+\]$/.test(t)?Number.parseFloat(t.slice(1,-1))*i:be(t,i):s[t]!==void 0?s[t]*i:Ye[t];if(a===void 0||!Number.isFinite(a))return!1;return e.lineHeight=a,!0}return!1}function rn(r,e){let t=/^grid-cols-(\d+)$/.exec(r);if(!t)return!1;return e.gridColumns=Number(t[1]),!0}function sn(r,e){if(!r.startsWith("size-"))return!1;let t=r.slice(5),i=t==="full"?"100%":ie(t);if(i===void 0)return!1;return e.width=i,e.height=i,!0}var on={xs:320,sm:384,md:448,lg:512,xl:576,"2xl":672,"3xl":768,"4xl":896,"5xl":1024,"6xl":1152,"7xl":1280};function an(r,e){let t=/^(min|max)-(w|h)-(.+)$/.exec(r);if(!t)return!1;let[,i,s,a]=t,c=a==="full"||a==="screen"?"100%":a==="none"?void 0:s==="w"&&i==="max"&&on[a]||ie(a);if(c===void 0&&a!=="none")return!1;let u=`${i}${s==="w"?"Width":"Height"}`;if(c===void 0)delete e[u];else e[u]=c;return!0}function cn(r,e){let t=/^(-?)(top|right|bottom|left)-(.+)$/.exec(r);if(!t)return!1;let i=t[3]==="full"?"100%":O(t[3]);if(i===void 0)return!1;return e[t[2]]=typeof i==="number"&&t[1]?-i:i,!0}function ln(r,e){let t=/^(-?)translate-(x|y)-(.+)$/.exec(r);if(!t)return!1;let i=t[3],s;if(i.startsWith("[")){let u=/^\[([+-]?(?:\d+\.?\d*|\.\d+))(px|rem|em)?\]$/.exec(i);if(!u)return!1;s=Number(u[1])*(u[2]?.endsWith("em")?16:1)}else s=O(i);if(s===void 0||!Number.isFinite(s))return!1;if(t[1])s=-s;let a=t[2]==="x"?"translateX":"translateY",c=a==="translateX"?{translateX:s}:{translateY:s};return e.transform=[...(e.transform??[]).filter((u)=>!(a in u)),c],!0}function un(r,e){let t=/^space-(x|y)-(.+)$/.exec(r);if(!t)return!1;let i=O(t[2]);if(i===void 0)return!1;return e.gap=i,!0}function dn(r,e){if(r.startsWith("gap-")){let t=O(r.slice(4));if(t!==void 0)return e.gap=t,!0}if(r.startsWith("gap-x-")){let t=O(r.slice(6));if(t!==void 0)return e.columnGap=t,!0}if(r.startsWith("gap-y-")){let t=O(r.slice(6));if(t!==void 0)return e.rowGap=t,!0}return!1}function fn(r,e){let i={"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]}[r];if(!i)return!1;let[s,a,c,u]=i;return Object.assign(e,{shadowColor:"#000000",shadowOpacity:c,shadowRadius:s,shadowOffset:{width:0,height:a},elevation:u}),!0}function Q(r,e,t={}){let i=[],s=[],a=[],c=[],u={focus:{classes:[],originals:new Map},focusWithin:{classes:[],originals:new Map}},f=new Map;function h(l,p){let y=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(l),w=y&&Je[y[2]];if(w){let x=e?.get(Te(y[2]));return[`${y[1]}-${x===void 0?w[p]:`[${x}]`}${y[3]||""}`]}let N=/^rounded-(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(l);if(N&&se[N[2]]){let x=ge(N[2],e);return x===void 0?void 0:[`rounded-${N[1]?`${N[1]}-`:""}[${x}px]`]}let d=l.startsWith("text-")?l.slice(5):"";if(Cn[d]){let x=ye(d,e);return x&&[`text-[${x.fontSize}px]`,`leading-[${x.lineHeight}px]`]}for(let x of Object.keys(kn)){if(!l.endsWith(`-${x}`))continue;let R=he(x,e);return R===void 0?void 0:[`${l.slice(0,-x.length)}[${R}px]`]}return[l]}function S(l,p){if(!f.has(l))f.set(l,new Set);return f.get(l).add(p),l}for(let l of r.split(/\s+/).filter(Boolean)){let p=/^(dark:)?(focus|focus-within):(dark:)?(.+)$/.exec(l),y=p?.[2]==="focus"?"focus":"focusWithin";if(p&&t[y]&&!(p[1]&&p[3])){let w=`${p[1]||p[3]?"dark:":""}${p[4]}`,N=u[y];N.classes.push(w),N.originals.set(w,[...N.originals.get(w)??[],l]);continue}if(l.startsWith("dark:")){let w=h(l.slice(5),"dark");if(!w)c.push(l);else s.push(...w.map((N)=>S(N,l)))}else if(!l.includes(":")||l.startsWith("[")){let w=h(l,"light"),N=h(l,"dark");if(!w||!N){c.push(l);continue}if(i.push(...w.map((d)=>S(d,l))),N.join(" ")!==w.join(" "))a.push(...N.map((d)=>S(d,l)))}else c.push(l)}let v=[],b=Ke(i,v),m={style:b,unknown:v};if(s.length||a.length)m.dark=Ke([...a,...s],v);if(b.transform&&m.dark?.transform){let l=new Set(m.dark.transform.flatMap((p)=>Object.keys(p)));m.dark.transform=[...b.transform.filter((p)=>!Object.keys(p).some((y)=>l.has(y))),...m.dark.transform]}for(let l of i){if(l==="truncate")m.numberOfLines=1;let p=/^line-clamp-(\d+)$/.exec(l);if(p)m.numberOfLines=Number(p[1]);if(!m.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(l))m.icon=l}let g=v.flatMap((l)=>[...f.get(l)??[l]]);m.unknown=[...new Set([...g.filter((l)=>!/^line-clamp-\d+$/.test(l)),...c])];for(let l of["focus","focusWithin"]){let p=u[l];if(!p.classes.length)continue;let y=Q(p.classes.join(" "),e);m[l]={style:y.style,dark:y.dark},m.unknown=[...new Set([...m.unknown,...y.unknown.flatMap((w)=>p.originals.get(w)??[w])])];for(let w of p.classes)if(/^(?:dark:)?(?:truncate|line-clamp-\d+|i-[a-z0-9]+-.+)$/.test(w))m.unknown.push(...p.originals.get(w))}return m}function Ke(r,e){let t={},i=Array.isArray(r)?r:r.split(/\s+/).filter(Boolean);for(let s of i){if(/^i-[a-z0-9]+-/.test(s))continue;let a=Xt[s];if(a){a("",t);continue}if(fn(s,t))continue;if(qt(s,t))continue;if(zt(s,t))continue;if(Gt(s,t))continue;if(Ht(s,t))continue;if(Jt(s,t))continue;if(Qe(s,t))continue;if(Kt(s,t))continue;if(Yt(s,t))continue;if(Qt(s,t))continue;if(Zt(s,t))continue;if(en(s,t))continue;if(tn(s,t))continue;if(dn(s,t))continue;if(nn(s,t))continue;if(sn(s,t))continue;if(an(s,t))continue;if(rn(s,t))continue;let c=/^order-\[(-?\d+)\]$/.exec(s)??/^order-(-?\d+)$/.exec(s);if(c){t.order=Number(c[1]);continue}if(cn(s,t))continue;if(ln(s,t))continue;if(un(s,t))continue;if(e?.push(s),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${s}`)}return t}var Ze=new Map;function et(r,e){if(!r)return;let t=r.trim(),i=t.lastIndexOf("-"),s=i===-1?e[t]:e[t.slice(0,i)],a=i===-1?s:s?.[t.slice(i+1)];if(typeof a==="string"&&/^#[\da-f]{3,8}$/i.test(a))return a;return ve(t)??ve(`[${t}]`)}function gn(r){let e=r.roles??{},t=r.shapes??{},i=r.density??{},s={...r.theme?.colors,...r.theme?.extend?.colors},a=[],c=[];for(let[u,f]of Object.entries(e)){if(!Je[u])continue;let h=et(typeof f==="string"?f:f?.light,s),S=et(typeof f==="string"?f:f?.dark,s);if(h)a.push(`${Te(u)}: ${h};`);if(S)c.push(`${Te(u)}: ${S};`)}for(let[u,f]of Object.entries(t))if(se[u])a.push(`${jt(u)}: ${f};`);for(let[u,f]of Object.entries(i))if(me[u])a.push(`${$e(u)}: ${f};`);return[a.length?`:root { ${a.join(" ")} }`:"",c.length?`.dark { ${c.join(" ")} }`:""].filter(Boolean).join(`
|
|
3
|
+
`)}async function hn(r){let{resolveUserCssConfig:e}=await import("./chunk-meze7k8v.js"),t=await e(r);return t?gn(t):""}function tt(r){let e=pn.resolve(r),t=Ze.get(e);if(!t)t=hn(e).catch(()=>""),Ze.set(e,t);return t}var rt={"aria-pressed":"selected","aria-selected":"selected","aria-checked":"checked","aria-disabled":"disabled","aria-expanded":"expanded","aria-busy":"busy"},nt={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 mn(r){return r==="role"||r==="aria-label"||r==="aria-valuetext"||r in rt}function yn(r,e){if(e===void 0||e===null)return;let t=String(e).trim().toLowerCase();if(t==="mixed")return r==="aria-checked"?"mixed":!0;if(t==="undefined")return;return t===""||t==="true"}function bn(r){if(r===void 0||r===null)return null;for(let e of String(r).trim().toLowerCase().split(/\s+/))if(nt[e])return nt[e];return null}function vn(r,e,t){if(r==="aria-label")return{accessibilityLabel:e===void 0||e===null||e===""?null:String(e)};if(r==="aria-valuetext")return{accessibilityValue:e===void 0||e===null||e===""?null:String(e)};if(r==="role")return{accessibilityRole:bn(e)};let i=rt[r];if(!i)return;let s=t.accessibilityState,a=s&&typeof s==="object"?{...s}:{},c=yn(r,e);if(c===void 0)delete a[i];else a[i]=c;return{accessibilityState:Object.keys(a).length?a:null}}function wn(r){let e=r.accessibilityState&&typeof r.accessibilityState==="object"?r.accessibilityState:void 0,t={};for(let[s,a]of Object.entries(r)){if(!mn(s))continue;let c=vn(s,a,t);if(c)Object.assign(t,c)}for(let s of["accessibilityLabel","accessibilityRole","accessibilityValue"])if(r[s]===void 0&&t[s]!==void 0&&t[s]!==null)r[s]=t[s];let i=t.accessibilityState;if(i)r.accessibilityState={...i,...e}}var we=["accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue"];function Se(r){let e={...r};return wn(e),Object.fromEntries(we.filter((t)=>(t in e)).map((t)=>[t,e[t]]))}var Ne={"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 ke={svg:"Svg",g:"G",path:"Path",line:"Line",rect:"Rect",circle:"Circle",ellipse:"Ellipse",polyline:"Polyline",polygon:"Polygon",text:"SvgText",tspan:"SvgText",animate:"Animate"},Re=new Set(Object.values(ke));var ot=new Set(["defs","title","desc","metadata","style","symbol","use","clippath","mask","lineargradient","radialgradient","stop","pattern","marker","filter","foreignobject"]),at=["viewBox","preserveAspectRatio","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","fillOpacity","fillRule","vectorEffect","textAnchor","dominantBaseline","fontSize","fontWeight","attributeName","keyTimes","repeatCount"];function D(r){let e=typeof r==="number"?r:Number.parseFloat(String(r??""));return Number.isFinite(e)?e:0}function q(r){return Math.round(r*1000)/1000}function Ae(r){if(Array.isArray(r)&&r.length===4&&r.every((t)=>Number.isFinite(Number(t))))return r.map(Number);let e=String(r??"").trim().split(/[\s,]+/).map(Number);if(e.length!==4||e.some((t)=>!Number.isFinite(t))||e[2]<=0||e[3]<=0)return null;return e}function Sn(r){let e=String(r??"").trim().split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite);return e.length%2?e.slice(0,-1):e}var it=/[MLHVCSQTAZ]/i,xe=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function Nn(r){let e=[],t=r,i=it.exec(t);while(i){let s=i.index;t=t.slice(s);let a=t[0];t=t.slice(1);let c=it.exec(t),u=c?t.slice(0,c.index):t,f;if(a==="A"||a==="a"){f=[];let h=0,S=u.trim(),v=0;while(v<S.length){let b=h%7,m=S.slice(v).replace(/^[\s,]+/,"");if(v=S.length-m.length,!m)break;if(b===3||b===4)f.push(m[0]==="1"?1:0),v+=1;else{xe.lastIndex=0;let g=xe.exec(m);if(!g||g.index!==0)break;f.push(Number.parseFloat(g[0])),v+=g[0].length}h++}}else f=(u.match(xe)||[]).map(Number.parseFloat);e.push({command:a,args:f}),i=c}return e}function xn(r,e,t,i,s,a,c,u,f){if(r===u&&e===f)return[];let h=Math.abs(t),S=Math.abs(i);if(!h||!S)return[1,u,f];let v=s*Math.PI/180,b=Math.cos(v),m=Math.sin(v),g=(r-u)/2,l=(e-f)/2,p=b*g+m*l,y=-m*g+b*l,w=p*p/(h*h)+y*y/(S*S);if(w>1)h*=Math.sqrt(w),S*=Math.sqrt(w);let N=h*h*S*S-h*h*y*y-S*S*p*p,d=h*h*y*y+S*S*p*p,x=Math.sqrt(Math.max(0,N/d));if(a===c)x=-x;let R=x*(h*y)/S,W=x*-(S*p)/h,T=b*R-m*W+(r+u)/2,L=m*R+b*W+(e+f)/2,P=(M,j,V,Y)=>{let de=M*Y-j*V<0?-1:1,fe=(M*V+j*Y)/(Math.hypot(M,j)*Math.hypot(V,Y));return de*Math.acos(Math.min(1,Math.max(-1,fe)))},k=P(1,0,(p-R)/h,(y-W)/S),_=P((p-R)/h,(y-W)/S,(-p-R)/h,(-y-W)/S);if(!c&&_>0)_-=2*Math.PI;if(c&&_<0)_+=2*Math.PI;let I=Math.max(1,Math.ceil(Math.abs(_)/(Math.PI/2))),E=_/I,A=1.3333333333333333*Math.tan(E/4),B=[],H=(M)=>{let j=h*Math.cos(M),V=S*Math.sin(M);return[b*j-m*V+T,m*j+b*V+L]},U=(M)=>{let j=-h*Math.sin(M),V=S*Math.cos(M);return[b*j-m*V,m*j+b*V]},F=k;for(let M=0;M<I;M++){let j=F+E,[V,Y]=H(F),[de,fe]=U(F),[Fe,Xe]=H(j),[Pt,Bt]=U(j);B.push(2,V+A*de,Y+A*fe,Fe-A*Pt,Xe-A*Bt,M===I-1?u:Fe,M===I-1?f:Xe),F=j}return B}function ct(r){let e=[],t=0,i=0,s=0,a=0,c=0,u=0,f=0,h=0,S="";for(let{command:v,args:b}of Nn(String(r??""))){let m=v===v.toLowerCase(),g=v.toUpperCase(),l=()=>m?t:0,p=()=>m?i:0,y=0,w=(d)=>{if(y+d>b.length)return null;let x=b.slice(y,y+d);return y+=d,x};if(g==="Z"){e.push(4),t=s,i=a,S="Z";continue}let N=!0;while(y<b.length||N&&g==="Z"){switch(g){case"M":{let d=w(2);if(!d)return e;if(t=d[0]+l(),i=d[1]+p(),N)e.push(0,t,i),s=t,a=i;else e.push(1,t,i);S=N?"M":"L";break}case"L":{let d=w(2);if(!d)return e;t=d[0]+l(),i=d[1]+p(),e.push(1,t,i),S="L";break}case"H":{let d=w(1);if(!d)return e;t=d[0]+l(),e.push(1,t,i),S="L";break}case"V":{let d=w(1);if(!d)return e;i=d[0]+p(),e.push(1,t,i),S="L";break}case"C":{let d=w(6);if(!d)return e;let x=d[0]+l(),R=d[1]+p();c=d[2]+l(),u=d[3]+p(),t=d[4]+l(),i=d[5]+p(),e.push(2,x,R,c,u,t,i),S="C";break}case"S":{let d=w(4);if(!d)return e;let x=S==="C"?2*t-c:t,R=S==="C"?2*i-u:i;c=d[0]+l(),u=d[1]+p(),t=d[2]+l(),i=d[3]+p(),e.push(2,x,R,c,u,t,i),S="C";break}case"Q":{let d=w(4);if(!d)return e;f=d[0]+l(),h=d[1]+p(),t=d[2]+l(),i=d[3]+p(),e.push(3,f,h,t,i),S="Q";break}case"T":{let d=w(2);if(!d)return e;f=S==="Q"?2*t-f:t,h=S==="Q"?2*i-h:i,t=d[0]+l(),i=d[1]+p(),e.push(3,f,h,t,i),S="Q";break}case"A":{let d=w(7);if(!d)return e;let x=d[5]+l(),R=d[6]+p();e.push(...xn(t,i,d[0],d[1],d[2],d[3],d[4],x,R)),t=x,i=R,S="A";break}default:return e}N=!1}}return e.map((v)=>q(v))}function st(r,e,t,i){if(t<=0||i<=0)return[];let s=0.5522847498;return[0,r+t,e,2,r+t,e+s*i,r+s*t,e+i,r,e+i,2,r-s*t,e+i,r-t,e+s*i,r-t,e,2,r-t,e-s*i,r-s*t,e-i,r,e-i,2,r+s*t,e-i,r+t,e-s*i,r+t,e,4].map(q)}function _e(r,e){switch(r){case"Path":return ct(String(e.d??""));case"Line":return[0,D(e.x1),D(e.y1),1,D(e.x2),D(e.y2)].map(q);case"Rect":{let t=D(e.x),i=D(e.y),s=D(e.width),a=D(e.height);if(s<=0||a<=0)return[];let c=e.rx===void 0?D(e.ry):D(e.rx),u=e.ry===void 0?c:D(e.ry);if(c=Math.min(Math.max(0,c),s/2),u=Math.min(Math.max(0,u),a/2),!c||!u)return[0,t,i,1,t+s,i,1,t+s,i+a,1,t,i+a,4].map(q);let f=0.5522847498;return[0,t+c,i,1,t+s-c,i,2,t+s-c+f*c,i,t+s,i+u-f*u,t+s,i+u,1,t+s,i+a-u,2,t+s,i+a-u+f*u,t+s-c+f*c,i+a,t+s-c,i+a,1,t+c,i+a,2,t+c-f*c,i+a,t,i+a-u+f*u,t,i+a-u,1,t,i+u,2,t,i+u-f*u,t+c-f*c,i,t+c,i,4].map(q)}case"Circle":return st(D(e.cx),D(e.cy),D(e.r),D(e.r));case"Ellipse":return st(D(e.cx),D(e.cy),D(e.rx),D(e.ry));case"Polyline":case"Polygon":{let t=Sn(e.points);if(t.length<4)return[];let i=[0,t[0],t[1]];for(let s=2;s<t.length;s+=2)i.push(1,t[s],t[s+1]);if(r==="Polygon")i.push(4);return i.map(q)}default:return null}}function Tn(r){let e=/^\s*(\d+(?:\.\d+)?|\.\d+)\s*(ms|s)?\s*$/.exec(String(r??""));if(!e)return null;let t=Number(e[1])/(e[2]==="ms"?1000:1);return t>0?t:null}function Rn(r){if(r.attributeName!=="d")return null;let e=Tn(r.dur),t=String(r.values??"").split(";").map((u)=>u.trim()).filter(Boolean);if(e===null||t.length<2)return null;let i=t.map(ct);if(i.some((u)=>!u.length))return null;let s=String(r.keyTimes??"").split(";").map((u)=>u.trim()).filter(Boolean).map(Number),c=s.length===i.length&&s[0]===0&&s[s.length-1]===1&&s.every((u,f)=>Number.isFinite(u)&&(f===0||u>=s[f-1]))?s.map(q):i.map((u,f)=>q(f/(i.length-1)));return{frames:i,frameTimes:c,duration:e}}function Ee(r){let e=Rn(r),t={frames:e?.frames??null,frameTimes:e?.frameTimes??null,duration:e?.duration??null};for(let[i,s]of Object.entries(t))if(s===null)delete r[i];else r[i]=s;return t}var An=[...at,"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"],lt=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"]),_n=new Map(An.map((r)=>[ut(r),r]));function ut(r){return r.replace(/[-_]/g,"").toLowerCase()}function Ie(r,e){if((e==="Image"||e==="Video")&&r.toLowerCase()==="src")return"source";return _n.get(ut(r))??r}var En={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 dt(r){return En[r.toLowerCase()]||r}var In={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 Ce(r,e=!1){let t=String(r??"").trim();if(!t)return{symbol:"circle",known:!1};if(e)return{symbol:t,known:!0};let i=/^i-([a-z0-9]+)-(.+)$/.exec(t)??/^([a-z0-9]+):(.+)$/.exec(t),s=i?i[1]:"lucide",a=i?i[2]:t;if(s==="lucide"){let c=In[a];if(c)return{symbol:c,iconify:`i-lucide-${a}`,known:!0};if(!i&&t.includes("."))return{symbol:t,known:!0}}return{symbol:"circle",iconify:i?t:`i-lucide-${a}`,known:!1}}var pt=/^--[\w\u0080-\uFFFF-]+$/u;function ft(r,e){if(!/var\(/i.test(r))return r;let t="",i="",s=!1;for(let a=0;a<r.length;a++){let c=r[a];if(c==="\\"){t+=r.slice(a,a+2),a++;continue}if(i){if(t+=c,c===i)i="";continue}if(c==='"'||c==="'"){i=c,t+=c;continue}if(r.slice(a,a+4).toLowerCase()!=="var("||a>0&&/[\w-]/.test(r[a-1])){t+=c;continue}let u=1,f=-1,h="",S=a+4;for(;S<r.length;S++){let m=r[S];if(m==="\\"){S++;continue}if(h){if(m===h)h="";continue}if(m==='"'||m==="'"){h=m;continue}if(m==="(")u++;if(m===")"&&--u===0)break;if(m===","&&u===1&&f===-1)f=S}if(u!==0)return;let v=r.slice(a+4,f===-1?S:f).trim();if(!pt.test(v))return;let b=e(v,f===-1?void 0:r.slice(f+1,S).trim());if(b===void 0||t.length+b.length>65536)return;t+=b,s=!0,a=S}return s&&t.length>65536?void 0:t}function Z(r,e){let t=new Map,i=new Set;for(let[l,p]of r){let y=l.trim();if(!pt.test(y))continue;if(typeof p==="string"||typeof p==="number"&&Number.isFinite(p))t.set(y,String(p).trim())}let s=new Map,a=new Set;for(let[l,p]of t){let y=new Set,w=(N,d=0)=>d>64?void 0:ft(N,(x,R)=>(y.add(x),R===void 0?"":w(R,d+1)));if(w(p)===void 0)a.add(l);s.set(l,y)}let c=new Map,u=new Map,f=[],h=new Set,S=0;function v(l,p=0){if(p>64){a.add(l);return}c.set(l,S),u.set(l,S++),f.push(l),h.add(l);for(let N of s.get(l)??[]){if(!t.has(N))continue;if(!c.has(N)){if(v(N,p+1),u.has(N))u.set(l,Math.min(u.get(l),u.get(N)))}else if(h.has(N))u.set(l,Math.min(u.get(l),c.get(N)))}if(u.get(l)!==c.get(l))return;let y=[],w;do w=f.pop(),h.delete(w),y.push(w);while(w!==l);if(y.length>1||s.get(l)?.has(l))y.forEach((N)=>a.add(N))}for(let l of t.keys())if(!c.has(l))v(l);let b=new Map;function m(l,p){if(i.add(l),b.has(l))return b.get(l);let y=t.get(l),w=y===void 0||/^(?:inherit|unset)$/i.test(y)?e?.get(l):a.has(l)||/^(?:initial|revert|revert-layer)$/i.test(y)?void 0:g(y,p+1);return b.set(l,w),w}function g(l,p=0){if(p>64)return;return ft(l,(y,w)=>m(y,p)??(w===void 0?void 0:g(w,p+1)))}return{resolve:g,used:i,computed(){let l=new Map(e);for(let p of t.keys())l.set(p,m(p,0));return l}}}function Oe(r){if(r.display==="flex"&&r.flexDirection==null)return{...r,flexDirection:"row"};return r}var gt=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"]),On=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"]),ht=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"]),Pn=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,Bn=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(px|rem|em)?$/i,Mn=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),Dn=new Set(["perspective","scale","scaleX","scaleY","translateX","translateY"]);function Ln(r){if(typeof r!=="string")return r;let e=Bn.exec(r);return e?Number(e[1])*(/^r?em$/i.test(e[2]||"")?16:1):r}function K(r){return typeof r==="number"&&Number.isFinite(r)}function Vn(r,e){if(r==="shadowOffset"&&e&&typeof e==="object"&&!Array.isArray(e)){let{width:t,height:i}=e;return K(t)&&K(i)?{width:t,height:i}:void 0}if(r==="transform"&&Array.isArray(e)){let t=[];for(let i of e){if(!i||typeof i!=="object"||Array.isArray(i)||Object.keys(i).length!==1)return;let[s,a]=Object.entries(i)[0];if(Dn.has(s)&&K(a))t.push({[s]:a});else if(Mn.has(s)&&typeof a==="string"&&/^[+-]?(?:\d+\.?\d*|\.\d+)(?:deg|rad)$/.test(a))t.push({[s]:a});else return}return t}return}function $n(r){let e=[],t=0,i=0,s="";for(let a=0;a<=r.length;a++){let c=r[a];if(c==="\\"){a++;continue}if(s){if(c===s)s="";continue}if(c==='"'||c==="'"){s=c;continue}if(c==="(")i++;if(c===")")i=Math.max(0,i-1);if(a!==r.length&&(c!==";"||i))continue;let u=r.slice(t,a),f=u.indexOf(":");if(f!==-1)e.push([u.slice(0,f).trim(),u.slice(f+1).trim()]);t=a+1}return e}function jn(r,e){let t;if(typeof r==="string"){if(r=r.trim(),!r)return[];try{r=JSON.parse(r)}catch{}}if(typeof r==="string")t=$n(r);else if(r&&typeof r==="object"&&!Array.isArray(r))t=Object.entries(r);else{if(r!=null&&r!==!1)e({kind:"non-numeric-style",name:"style"});return[]}return t}function mt(r,e=()=>{},t={}){let i=jn(r,e),s=Z(i,t.inheritedVariables);return t.onVariables?.(s.computed()),Wn(i,s,e)}function Wn(r,e,t){let i={},s=[];for(let[a,c]of r){if(a.trim().startsWith("--")){s.push(a.trim());continue}let u=gt.has(a)||a.trim().startsWith("--")?a:a.trim().toLowerCase().replace(/-([a-z])/g,(S,v)=>v.toUpperCase());if(!gt.has(u)){t({kind:"unknown-style",name:u});continue}if(c==null||c==="")continue;let f=typeof c==="string"?e.resolve(c.trim()):c;if(f===void 0){t({kind:"non-numeric-style",name:u});continue}if(f==="")continue;let h;if(On.has(u)||ht.has(u)){if(h=Ln(f),!K(h)&&!(ht.has(u)&&typeof h==="string"&&h.endsWith("%")&&Pn.test(h.slice(0,-1))&&Number.isFinite(Number(h.slice(0,-1)))))h=void 0}else if(u==="display"&&f==="inline-flex")h="flex";else if(u==="shadowOffset"||u==="transform")h=Vn(u,f);else if(u==="gridTemplateColumns"||u==="gridTemplateRows")h=K(f)||typeof f==="string"?f:void 0;else if(u==="fontWeight"&&K(f))h=String(f);else if(typeof f==="string")h=f;if(h===void 0)t({kind:"non-numeric-style",name:u});else i[u]=h}for(let a of s)if(!e.used.has(a))t({kind:"unknown-style",name:a});return i}import{generate as ee,parse as yt}from"@stacksjs/ts-css/parse";async function bt(r,e){let t={light:new Map,dark:new Map},i=new Set,s=(v)=>{if(!i.has(v))i.add(v),e(v)},a=(v,b,m)=>{for(let g of m){let l=t[g].get(v);if(!l||Number(b.important)>Number(l.important)||b.important===l.important&&b.specificity>=l.specificity)t[g].set(v,b)}},c=(v)=>{if(v.type==="Declaration")return v.property.startsWith("--");if(v.type==="Rule"||v.type==="Atrule")return!!v.block&&[...v.block.children].some(c);return!1},u=(v)=>{let b=v.replace(/\s+/g,"").toLowerCase();if(!b||b==="all"||b==="screen")return["light","dark"];let m=/^(?:screenand)?\(prefers-color-scheme:(light|dark)\)$/.exec(b);return m?[m[1]]:void 0};function f(v,b){for(let m of v){if(!c(m))continue;if(m.type==="Atrule"){let l=m.prelude?ee(m.prelude):"",p=m.name.toLowerCase()==="media"?u(l):void 0;if(!p){s(`@${m.name} ${l}`.trim());continue}f(m.block.children,b.filter((y)=>p.includes(y)));continue}if(m.type!=="Rule")continue;let g=m.prelude.type==="SelectorList"?[...m.prelude.children].map(ee):[ee(m.prelude)];for(let l of g){let p=/^(html|:root)?(?:\.(dark|light))?$/.exec(l.trim());if(!p||!p[1]&&!p[2]){s(l);continue}let y=(p[1]===":root"?10:p[1]?1:0)+(p[2]?10:0);for(let w of m.block.children){if(w.type!=="Declaration"){if(c(w))s(`nested rule in ${l}`);continue}if(!w.property.startsWith("--"))continue;let N={value:ee(w.value),important:!!w.important,specificity:y};a(w.property,N,b.filter((d)=>!p[2]||p[2]===d))}}}}let h="",S;return await new HTMLRewriter().on("html",{element(v){let b=v.getAttribute("style");if(!b)return;try{let m=yt(b,{context:"declarationList"});if(m.type!=="DeclarationList")return;for(let g of m.children)if(g.type==="Declaration"&&g.property.startsWith("--"))a(g.property,{value:ee(g.value),important:!!g.important,specificity:1000},["light","dark"])}catch{s("invalid document inline theme")}}}).on("style",{element(v){h="";let b=v.getAttribute("type");S=!b||b.toLowerCase()==="text/css"?u(v.getAttribute("media")??""):void 0,v.onEndTag(()=>{try{let m=yt(h);if(m.type!=="StyleSheet")return;if(!S){if([...m.children].some(c))s("style type/media");return}f(m.children,S)}catch{s("invalid stylesheet")}})},text(v){h+=v.text}}).transform(new Response(r)).text(),{light:[...t.light].map(([v,b])=>[v,b.value]),dark:[...t.dark].map(([v,b])=>[v,b.value])}}function z(r,e={},t={},i={},s=[]){return{type:r,props:e,style:t,events:i,children:s}}function vt(r,e,t={}){return{version:"1.0.0",root:r,script:e,meta:{source:t.source||"unknown",compiledAt:t.compiledAt||Date.now(),headwindConfig:t.headwindConfig}}}var wt=new Set(["script","style","head","meta","link","title","base","noscript"]),St=new Set(["template","body","html","main","fragment"]),oe=new Set,Fn=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"]),Pe=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",...Re]),Xn=new Map([["data","data"],["sections","sections"],["renderitem","renderItem"],["rendersectionheader","renderSectionHeader"],["keyextractor","keyExtractor"]]),Nt=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),zn={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function J(r){return r.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,t)=>{let i=zn[t.toLowerCase()];if(i!==void 0)return i;if(t[0]==="#"){let s=t[1]==="x"||t[1]==="X"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Number.isFinite(s)?String.fromCodePoint(s):e}return e})}function xt(r,e,t,i={}){let s=i.inheritedVariables,a={},c={},u={},f="",h={};for(let[m,g]of e){let l=m.toLowerCase();if(l==="class"||l==="classname"){f=f?`${f} ${g}`:g;continue}if(l==="style"){h={...h,...Hn(r,g,t,{...i,onVariables(w){s=w,i.onVariables?.(w)}})};continue}if(l.startsWith(":")||l.startsWith("x-")&&l!=="x-cloak"){u[l.startsWith(":")?l.slice(1):l.slice(2)]=J(g);continue}if(l==="x-cloak")continue;if(l.startsWith("@")||l.startsWith("v-on:")){let w=l.startsWith("@")?l.slice(1):l.slice(5),[N]=w.split("."),d=Ne[N]??(N.startsWith("on")?N:"");if(!d||!Fn.has(d)){t.push({kind:"unread-event",tag:r,name:m});continue}c[d]=J(g);continue}if(l==="key"){a.key=g;continue}let p=J(g),y=Ie(m);if(p===""&<.has(y)){a[y]=!0;continue}try{a[y]=JSON.parse(p)}catch{a[y]=p}}let S=a["data-native"]?a["data-native"]==="TextInput":r==="textarea"||r==="input"&&!["checkbox","radio","hidden"].includes(String(a.type??"text").toLowerCase()),v=f?Q(f,s,{focus:S,focusWithin:!0}):void 0;for(let m of new Set(v?.unknown??[]))t.push({kind:"unknown-class",tag:r,name:m});let b=Oe({...v?.style,...h});return{props:a,style:b,events:c,bindings:u,classes:f,inline:h}}function Hn(r,e,t,i){return mt(J(e),(s)=>t.push({...s,tag:r}),i)}function Be(r){return r.children.map((e)=>typeof e==="string"?e:Be(e)).join("").replace(/\s+/g," ").trim()}function Un(r,e){let t=r.node,i=t.children.filter((a)=>typeof a!=="string"),s=t.children.filter((a)=>typeof a==="string").join("").trim();if(r.tag==="button"&&t.type==="Button"&&!r.declaredNative&&i.length>0)return t.type="Pressable",t.props.role??="button",t.children=t.children.flatMap((a)=>typeof a==="string"?a.trim()?[z("Text",{},{},{},[a.trim()])]:[]:[a]),t;if(t.type==="Button"&&i.length===0)return t.children=s?[s]:[],t;if(t.type==="Svg"||t.type==="G")return t.children=i,t;if(t.type==="SvgText"){let a=Be(t);return t.children=a?[a]:[],t}if(Nt.has(t.type)&&i.length===0&&s)return t.type="Text",t.children=[s],t;if(t.type==="Text"&&!s&&i.length===0&&typeof t.props.text==="string")return t.children=t.props.text?[t.props.text]:[],delete t.props.text,t;if(t.type==="Text"&&i.length>0){if(/(?:^|\s)(?:inline-)?(?:flex|grid)(?:\s|$)/.test(t._classes??"")||i.some((u)=>u.type!=="Text"))return t.type="View",t.children=t.children.map((u)=>typeof u==="string"?z("Text",{},{},{},[u]):u),t;let c=Be(t);return e.push({kind:"flattened-text",tag:r.tag}),t.children=c?[c]:[],t}if(Nt.has(t.type)&&i.length>0)t.children=i;return t}async function qn(r,e={}){let t=[],i=await bt(r,(g)=>t.push({kind:"unsupported-theme-rule",tag:"style",name:g})),s=Z(i.light).computed(),a=[],c=[],u=new Set;function f(g){let l=c[c.length-1];if(!l)a.push(g);else if(!l.dropped)l.node.children.push(g)}function h(g){let l=(y)=>{if(g.tag!=="html"&&g.node._styleSource)y._styleAncestors=[g.node._styleSource,...y._styleAncestors??[]]};if(g.node.bindings&&Object.keys(g.node.bindings).length>0){let y=g.node.children,w=y.filter((d)=>typeof d!=="string"),N=w.length===1&&w.length===y.length?w[0]:z("View",{},{},{},y);if(N.bindings={...g.node.bindings,...N.bindings},N.bindingId===void 0&&g.node.bindingId!==void 0)N.bindingId=g.node.bindingId;l(N),f(N);return}let p=c[c.length-1];for(let y of g.node.children){if(typeof y==="string"){if(p&&!p.dropped)p.node.children.push(y);continue}if(l(y),!p)a.push(y);else if(!p.dropped)p.node.children.push(y)}}function S(g,l){let p=c[c.length-1];if(g==="svg"||p?.svg)return v(g,l,p);let y=wt.has(g)&&!oe.has(g),w=c[c.length-1]?.dropped??!1,N=p?.variables??s,{props:d,style:x,events:R,bindings:W,classes:T,inline:L}=y||w?{props:{},style:{},events:{},bindings:{},classes:"",inline:{}}:xt(g,l,t,{inheritedVariables:N,onVariables:(E)=>{N=E}});if(g==="html")N=s;let P=d["data-native"],k;if(typeof P==="string"&&Pe.has(P))k=P,delete d["data-native"];else if(k=oe.has(g)?"View":dt(g),g==="input"){let E=String(d.type??"text").toLowerCase();if(E==="checkbox")k="Checkbox",d.formValue=d.value??"on",d.checked=d.checked===""||d.checked===!0||d.checked==="true",d.value=d.checked;else if(E==="hidden")k="View",x.display="none",L.display="none";else if(E==="radio")k="View",d.accessibilityRole="radio",t.push({kind:"unsupported-control",tag:g,name:"input:radio"})}if(!w&&k===g&&!Pe.has(k)&&!wt.has(g)&&!St.has(g)&&!u.has(g))u.add(g),t.push({kind:"unmapped-tag",tag:g});if((y||oe.has(g))&&!u.has(`drop:${g}`))u.add(`drop:${g}`),t.push({kind:"dropped-subtree",tag:g});if(k==="View"&&/(?:^|\s)overflow-x-(?:auto|scroll)(?:\s|$)/.test(T))k="ScrollView",d.horizontal=!0,d.showsHorizontalScrollIndicator??=!1;else if(k==="View"&&/(?:^|\s)overflow-y-(?:auto|scroll)(?:\s|$)/.test(T))k="ScrollView";if(g==="form")d["data-stx-form"]=!0;if(g==="button"&&d.type===void 0)d.type="submit";if((k==="Video"||k==="Image")&&d.source===void 0&&d.src!==void 0)d.source=d.src,delete d.src;if(k==="Icon"){let E=Q(T).icon,A=Ce(String(d.symbol||d.name||E||""),Boolean(d.symbol));if(d.symbol=A.symbol,A.iconify)d.iconify=A.iconify}if(k==="FlatList"||k==="SectionList"){let E=new Set([...Object.keys(d),...Object.keys(W)].map((A)=>A.toLowerCase()));for(let[A,B]of Xn)if(E.has(A))t.push({kind:"unsupported-list-prop",tag:k,name:B})}let _=z(k,d,x,R);_._inlineStyle=L,_._styleSource=J(l.find(([E])=>E==="style")?.[1]??"");let I=d["data-stx-b"];if(typeof I==="number"&&Number.isInteger(I))_.bindingId=I;if(delete d["data-stx-b"],T)_._classes=T;if(Object.keys(W).length>0)_.bindings=W;if(typeof d.key==="string")_.key=d.key,delete d.key;return{tag:g,node:_,variables:N,declaredNative:typeof P==="string"&&Pe.has(P),dropped:y||w||oe.has(g)||k==="Video",discard:y||w,unwrap:St.has(g)}}function v(g,l,p){let y=p?.dropped??!1,w=ke[g];if(y||!w){if(!y&&!u.has(`drop:${g}`))u.add(`drop:${g}`),t.push({kind:ot.has(g)?"dropped-subtree":"unmapped-tag",tag:g});return{tag:g,node:z("G",{},{},{}),svg:!0,dropped:!0,discard:!0,unwrap:!1}}let N=p?.variables??s,{props:d,style:x,events:R,bindings:W,classes:T,inline:L}=xt(g,l,t,{inheritedVariables:N,onVariables:(I)=>{N=I}});if(w==="Svg"){let I=Ae(d.viewBox);if(I)d.viewBox=I;else delete d.viewBox;for(let E of["width","height"]){if(typeof d[E]==="number"&&x[E]===void 0)x[E]=d[E];delete d[E]}}if(typeof d.strokeDasharray==="string"||typeof d.strokeDasharray==="number"){let I=String(d.strokeDasharray).split(/[\s,]+/).map(Number).filter(Number.isFinite);d.strokeDasharray=I}let P=_e(w,d);if(P)d.geometry=P;if(w==="Animate")Ee(d);let k=z(w,d,x,R);k._inlineStyle=L,k._styleSource=J(l.find(([I])=>I==="style")?.[1]??"");let _=d["data-stx-b"];if(typeof _==="number"&&Number.isInteger(_))k.bindingId=_;if(delete d["data-stx-b"],T)k._classes=T;if(Object.keys(W).length>0)k.bindings=W;if(typeof d.key==="string")k.key=d.key,delete d.key;return{tag:g,node:k,variables:N,svg:!0,dropped:!1,discard:!1,unwrap:!1}}if(await new HTMLRewriter().on("*",{element(g){let l=g.tagName.toLowerCase(),p=S(l,[...g.attributes]),y=!0;try{g.onEndTag(()=>{if(c.pop(),p.discard)return;if(p.unwrap)h(p);else f(Un(p,t))})}catch{y=!1}if(y)c.push(p);else if(!p.discard)f(p.node)},text(g){let l=c[c.length-1];if(!l||l.dropped)return;let p=J(g.text).replace(/\s+/g," ");if(!p.trim())return;l.node.children.push(p)}}).transform(new Response(r)).text(),a.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);let b=a.length===1?a[0]:z("View",{},{},{},a);if(i.light.length||i.dark.length)b._stylesheetTheme=i;let m=(g)=>{let l=Se(g.props);if(Object.keys(l).length)g._accessibilitySource=Object.fromEntries(we.filter((p)=>(p in g.props)).map((p)=>[p,g.props[p]])),Object.assign(g.props,l);for(let p of g.children)if(typeof p!=="string")m(p)};return m(b),{root:b,diagnostics:t}}async function kt(r,e={}){let{root:t,diagnostics:i}=await qn(r,e),s=e.script??{exports:{},functions:[],code:""};return{document:vt(t,s,{source:e.source??"unknown"}),diagnostics:i}}var Tt=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Gn=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,Jn=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,Rt=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function Me(r){let e=[];Tt.lastIndex=0;for(let a of r.matchAll(Tt)){let c=a[1]??"";if(/\bserver\b/.test(c))continue;e.push(a[2].trim())}let t=e.filter(Boolean).join(`
|
|
4
|
+
|
|
5
|
+
`),i=[];for(let a of[Gn,Jn]){a.lastIndex=0;for(let c of t.matchAll(a))if(!i.includes(c[1]))i.push(c[1])}let s={};Rt.lastIndex=0;for(let a of t.matchAll(Rt)){let c=a[2];try{s[a[1]]=JSON.parse(c.replace(/^'(.*)'$/,'"$1"'))}catch{s[a[1]]=c}}return{exports:s,functions:i,code:t}}var ae=/<script\b([^>]*\bdata-stx-scoped\b[^>]*)>([\s\S]*?)<\/script>/gi,At=/function\s+(__stx_setup_[\w$]+)\s*\(/,Kn=/\bdata-stx-owner\s*=\s*["']([^"']+)["']/i;function De(r){ae.lastIndex=0;for(let e of r.matchAll(ae)){let t=e[2].trim(),i=At.exec(t)?.[1];if(i)return{name:i,code:t}}return null}function _t(r){let e=[];ae.lastIndex=0;for(let t of r.matchAll(ae)){let i=t[1],s=t[2].trim(),a=Kn.exec(i)?.[1],c=/\bdata-stx-component-factories\b/i.test(i);if(!s||!a&&!c&&!At.test(s))continue;e.push(a?{code:s,owner:a}:{code:s})}return e}function Qn(){let r=[te.join(import.meta.dir,"..","primitives"),te.join(import.meta.dir,"native","primitives")];for(let e of r)if(Yn(te.join(e,"View.stx")))return e;return r[0]}async function Zn(r,e,t={}){let i=t.root??te.dirname(e),s=await o(i),a={root:i,componentsDir:t.componentsDir??s.componentsDir??te.join(i,"components"),buildMode:"serve",cache:!1,_targetComponentDirs:[Qn()],_targetComponentFallbackNames:["Button","Checkbox","Switch"],_nativeHostAttrs:!0,skipEventDirectives:!0,_pluginComponentDirs:s._pluginComponentDirs??[]},c={...t.context??{},__stx_inject_css:!1},u=new Set([e]),f=await n(r,c,e,a,u),{html:h,manifest:S}=He(f),v=await tt(i),{document:b,diagnostics:m}=await kt(v?`<style>${v}</style>${h}`:h,{source:e,script:Me(r)}),g=De(h),l=_t(h);if(Me(r).code.trim()){let d=await fr(r,e,t.context,{forceClientSetup:!0}),x=De(d.setupCode??"");if(g=x??g,x&&!l.some((R)=>R.code===x.code))l.push({code:x.code})}let{buildModuleRegistryScript:p,registeredModuleIdsIn:y}=await import("./chunk-x7g0946r.js"),w=[],N=await p(y(...l.map((d)=>d.code)),{collectInputs:w});for(let d of w)u.add(d);if(N)l.unshift({code:N});return{document:b,manifest:S,setup:g,scripts:l,diagnostics:m,html:h,dependencies:[...u]}}async function ce(r,e={}){return Zn(await Bun.file(r).text(),r,e)}var ne="__app";var le="__runtime",rr="__messages";function Le(r){let t=[C.join(import.meta.dir,"..","runtime",`${r}.ts`),C.join(import.meta.dir,"..","runtime",`${r}.js`),C.join(import.meta.dir,"native","runtime",`${r}.js`)].find((i)=>je(i));if(!t)throw Error(`Native runtime module ${r} is missing`);return t}async function Ve(r,e,t,i,s){let a={name:"stx-screen-inputs",setup(u){u.onLoad({filter:/.*/,namespace:"file"},({path:f})=>{i.add(f);let h=s?.get(f);return h===void 0?void 0:{contents:h,loader:"js"}})}},c=await Bun.build({entrypoints:[r],target:"browser",format:"iife",minify:t,plugins:[a,...e],define:{"process.env.NODE_ENV":JSON.stringify(t?"production":"development")}});if(!c.success){let u=c.logs.map((f)=>String(f.message??f)).join(`
|
|
6
|
+
`);throw Error(`Could not bundle ${r}:
|
|
7
|
+
${u}`)}return(await c.outputs[0].text()).trim()}var ir=/^[\w-]+(?:\/[\w-]+)*$/,sr=/^[\w-]+$/;async function or(r,e){let t=C.resolve(r,e.dir);if(!e.languages?.length)throw Error("messages.languages must name at least one language");let i=new Map,s=new Map;for(let a of e.languages){if(!sr.test(a))throw Error(`messages: "${a}" is not a language directory name`);let c=C.join(t,a);if(!je(c))throw Error(`messages: ${C.relative(r,c)} does not exist`);let u=new Map;for(let f of[...new Bun.Glob("**/*.{ts,js,mjs,json}").scanSync({cwd:c})].sort()){if(/\.(?:test|spec|d)\.[^.]+$/.test(f))continue;let h=f.replace(/\.[^./]+$/,"").split(C.sep).join("/");if(!ir.test(h))throw Error(`messages: ${a}/${f} is not an area name`);if(u.has(h))throw Error(`messages: ${a}/${h} is defined twice`);let S=C.join(c,f),v=await import(S),b=Object.keys(v).filter((l)=>l!=="default");if(b.length)throw Error(`messages: ${a}/${f} exports ${b.join(", ")}; a message module exports its messages as default, and nothing else`);let m=v.default,g=m!==null&&typeof m==="object"&&!Array.isArray(m)?JSON.stringify(m):void 0;if(g===void 0||!Bun.deepEquals(JSON.parse(g),m,!0))throw Error(`messages: ${a}/${f} must export plain data (an object JSON can hold) as default`);u.set(h,g),i.set(S,{language:a,area:h})}s.set(a,u)}return{files:i,data:s}}function ar(r,e){return`export default globalThis.__stxNativeRuntime.messages(${JSON.stringify(r)}, ${JSON.stringify(e)});`}function cr(r){let e=new Map;for(let[t,{language:i,area:s}]of r.files){let a=ar(i,s);e.set(t,a),e.set(nr(t),a)}return e}function lr(r){let e=new Set;for(let t of r.matchAll(/__stxNativeRuntime\.messages\(\s*"[\w-]+"\s*,\s*"([\w/-]+)"\s*\)/g))e.add(t[1]);return[...e].sort()}function ur(r,e){let t=C.isAbsolute(r.meta.source)?C.relative(e,r.meta.source).split(C.sep).join("/"):r.meta.source;return{...r,script:{exports:r.script.exports,functions:[],code:""},meta:{...r.meta,source:t,compiledAt:0}}}async function We(r){let e=Object.keys(r.screens);if(e.length===0)throw Error("screens must name at least one .stx file");let t=r.routed??!0,i=r.initialScreen??e[0];if(!r.screens[i])throw Error(`Initial screen ${i} is not in screens`);let s=C.resolve(r.root??process.cwd());if(r.messages&&!r.routesDir)throw Error("messages ship a language at a time beside route files: they need routesDir");if(r.sharedRuntime&&!r.routesDir)throw Error("sharedRuntime is the route files' runtime: it needs routesDir");if(r.messages&&!r.sharedRuntime)throw Error("messages are read by the shared runtime: they need sharedRuntime");if(r.messages&&r.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=r.messages?await or(s,r.messages):null,c=a?cr(a):null,u=[],f=async()=>{for(let T of e){let L=C.resolve(s,r.screens[T]);if(!L.endsWith(".stx"))throw Error(`Screen ${T} must name a .stx file`);u.push({name:T,file:L,compiled:await ce(L,{root:s})})}};if(c)await ps(c,f);else await f();let h=Le("jsc-globals"),S=Le("shared-screen"),v=r.app?C.resolve(s,r.app):null;if(v&&!je(v))throw Error(`The app script ${r.app} does not exist`);if(v&&!t)throw Error("An app script needs a routed bundle");if(v&&r.screens[ne])throw Error(`${ne} is the app script's route, not a screen name`);let b=r.browser;if(r.screens[le])throw Error(`${le} is the runtime prelude's file, not a screen name`);let m=Ue();if(b&&r.routesDir)throw Error("A browser screen is one route; routesDir is for device hosts");let g=(T,L,P)=>{let k=t?`var routeName = g.__stxNativeRoute || ${JSON.stringify(i)};
|
|
8
|
+
var isApp = ${v?`routeName === ${JSON.stringify(ne)}`:"false"};
|
|
9
|
+
if (!isApp && routeNames.indexOf(routeName) === -1) throw new Error(['Unknown native screen:', routeName].join(' '));
|
|
10
|
+
if (isApp ? ${!L} : ${JSON.stringify(T.map(({name:F})=>F))}.indexOf(routeName) === -1) throw new Error(['This bundle does not hold the native screen', routeName].join(' '));`:`var routeName = 'main';
|
|
11
|
+
var isApp = false;`,_=T.map(({name:F,compiled:M},j)=>`${j===0?"if":"else if"} (routeName === ${JSON.stringify(t?F:"main")}) {
|
|
12
|
+
nativeDocument = ${JSON.stringify(ur(M.document,s))};
|
|
13
|
+
manifest = ${JSON.stringify(M.manifest)};
|
|
14
|
+
}`).join(`
|
|
15
|
+
`),I=T.map(({name:F,compiled:M},j)=>`${j===0?"if":"else if"} (routeName === ${JSON.stringify(t?F:"main")}) {
|
|
16
|
+
g.__stx_latestSetup = null;
|
|
17
|
+
${M.scripts.map((V)=>V.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(V.owner)}] = function() {
|
|
21
|
+
${V.code}
|
|
22
|
+
};
|
|
23
|
+
g.__STX_SETUP_ROOT__ = screen && screen.scopeRoot(${JSON.stringify(V.owner)});
|
|
24
|
+
try { g.__stx_componentSetups[${JSON.stringify(V.owner)}](); }
|
|
25
|
+
finally { g.__STX_SETUP_ROOT__ = null; }`:V.code).join(`
|
|
26
|
+
`)}
|
|
27
|
+
}`).join(`
|
|
28
|
+
`),E=L&&v,A=b?Le("browser-screen"):null,B=b?Bun.resolveSync(b.platformModule,s):null;return`
|
|
29
|
+
${P?`var runtime = globalThis.__stxNativeRuntime;
|
|
30
|
+
if (!runtime || runtime.version !== ${JSON.stringify(P)}) throw new Error('This screen needs the stx native runtime it was built with: evaluate ${le}.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(h)};
|
|
34
|
+
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(S)};`}
|
|
35
|
+
${b?`import { createBrowserScreenBridge } from ${JSON.stringify(A)};
|
|
36
|
+
import { createBrowserPlatform } from ${JSON.stringify(B)};`:""}
|
|
37
|
+
${E?`import * as nativeAppModule from ${JSON.stringify(v)};`:"var nativeAppModule = null;"}
|
|
38
|
+
${b?"(async function() {":""}
|
|
39
|
+
var g = globalThis;
|
|
40
|
+
installJSCGlobals(g);
|
|
41
|
+
${b?`var browserPlatform = await createBrowserPlatform(${JSON.stringify(b.platformOptions??{})});
|
|
42
|
+
var browserBridge = createBrowserScreenBridge(browserPlatform, ${JSON.stringify(b)});
|
|
43
|
+
var bridge = browserBridge;
|
|
44
|
+
g.__stxNativeRoute = ${JSON.stringify(i)};`:"var bridge = g.__stxNativeBridge;"}
|
|
45
|
+
if (!bridge) throw new Error('Missing __stxNativeBridge');
|
|
46
|
+
var routeNames = ${JSON.stringify(t?e:["main"])};
|
|
47
|
+
${k}
|
|
48
|
+
g.__stxNativeRoute = routeName;
|
|
49
|
+
var nativeDocument;
|
|
50
|
+
var manifest;
|
|
51
|
+
${_}
|
|
52
|
+
var screen = null;
|
|
53
|
+
var app = null;
|
|
54
|
+
if (isApp) {
|
|
55
|
+
app = prepareNativeApp(bridge, { routeName: routeName, routeNames: routeNames });
|
|
56
|
+
g.__stxNativeUnmount = function() { app.unmount(); };
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
screen = prepareSharedNativeScreen(nativeDocument, manifest, bridge, { routeName: routeName, routeNames: routeNames });
|
|
60
|
+
g.__stx_host = screen.host;
|
|
61
|
+
g.__stxNativeUnmount = function() { screen.unmount(); };
|
|
62
|
+
}
|
|
63
|
+
${P?"runtime.startSignals();":m}
|
|
64
|
+
var pageSetup = g.__stx_latestSetup;
|
|
65
|
+
var pageRuntimeSetup = g.stx && g.stx._latestSetup;
|
|
66
|
+
${I}
|
|
67
|
+
// The screen's setup is the native host's to run. A screen script publishes
|
|
68
|
+
// it where a page's document runtime adopts its own, and in a browser that
|
|
69
|
+
// runtime's DOMContentLoaded and stx:load ran it a second time: another copy
|
|
70
|
+
// of the screen, mounted beside this one. Take it, and hand the page back
|
|
71
|
+
// whatever setup it had.
|
|
72
|
+
var screenSetup = g.__stx_latestSetup || null;
|
|
73
|
+
g.__stx_latestSetup = pageSetup;
|
|
74
|
+
if (g.stx) g.stx._latestSetup = pageRuntimeSetup || null;
|
|
75
|
+
if (isApp) app.start(nativeAppModule);
|
|
76
|
+
else screen.mount(g.stx, screenSetup);
|
|
77
|
+
${b?`var stopApp = nativeAppModule && typeof nativeAppModule.default === 'function' ? nativeAppModule.default(g.craft) : null;
|
|
78
|
+
var unmount = g.__stxNativeUnmount;
|
|
79
|
+
var ended = false;
|
|
80
|
+
g.__stxNativeUnmount = function() { if (ended) return; ended = true; if (typeof stopApp === 'function') stopApp(); unmount(); browserBridge.dispose(); };
|
|
81
|
+
g.addEventListener('pagehide', function(event) { if (!event.persisted) g.__stxNativeUnmount(); });
|
|
82
|
+
})().catch(function(error) { console.error('[stx browser screen]', error); var node = document.querySelector(${JSON.stringify(b.container)}); if (node) { node.textContent = 'This screen could not start. Reload to try again.'; node.setAttribute('role', 'alert'); } });`:""}
|
|
83
|
+
`},l=(T)=>({name:"stx-native-shared-screens",setup(L){L.onResolve({filter:/^stx:native-shared-screens$/},()=>({path:"entry",namespace:"stx-native-shared-screens"})),L.onLoad({filter:/.*/,namespace:"stx-native-shared-screens"},()=>({contents:T,loader:"js"}))}}),p=new Set(u.flatMap(({compiled:T})=>T.dependencies)),y=u.flatMap(({compiled:T})=>T.diagnostics).map((T)=>({level:"warning",message:[T.kind,T.tag,T.name].filter(Boolean).join(": ")})),w=r.minify??!1,N,d,x;if(r.routesDir){let T=C.resolve(s,r.routesDir);Et(T,{recursive:!0});let L=`
|
|
84
|
+
import { installJSCGlobals } from ${JSON.stringify(h)};
|
|
85
|
+
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(S)};
|
|
86
|
+
globalThis.__stxNativeRuntime = {
|
|
87
|
+
version: '__STX_NATIVE_RUNTIME_VERSION__',
|
|
88
|
+
installJSCGlobals: installJSCGlobals,
|
|
89
|
+
prepareNativeApp: prepareNativeApp,
|
|
90
|
+
prepareSharedNativeScreen: prepareSharedNativeScreen,
|
|
91
|
+
// Each screen starts its own signals runtime, after its host is in place.
|
|
92
|
+
startSignals: function() {
|
|
93
|
+
${m}
|
|
94
|
+
},
|
|
95
|
+
// A language's messages for an area (the compile's \`messages\`), read the
|
|
96
|
+
// first time they are looked into: a screen never parses a language it
|
|
97
|
+
// is not shown in, nor an area it does not use.
|
|
98
|
+
messages: function(language, area) {
|
|
99
|
+
var g = globalThis;
|
|
100
|
+
var loaded = g.__stxNativeMessages || (g.__stxNativeMessages = {});
|
|
101
|
+
function table() {
|
|
102
|
+
var forLanguage = loaded[language] || (loaded[language] = {});
|
|
103
|
+
if (Object.prototype.hasOwnProperty.call(forLanguage, area)) return forLanguage[area];
|
|
104
|
+
var value = null;
|
|
105
|
+
if (typeof g.__stxNativeReadMessages === 'function') {
|
|
106
|
+
try {
|
|
107
|
+
var text = g.__stxNativeReadMessages(language, area);
|
|
108
|
+
if (typeof text === 'string') value = JSON.parse(text);
|
|
109
|
+
}
|
|
110
|
+
catch (error) { console.error('[stx native] could not read the ' + language + ' messages for ' + area, error); }
|
|
111
|
+
}
|
|
112
|
+
forLanguage[area] = value;
|
|
113
|
+
return value;
|
|
114
|
+
}
|
|
115
|
+
var own = Object.prototype.hasOwnProperty;
|
|
116
|
+
return new Proxy({}, {
|
|
117
|
+
get: function(target, name) { var messages = table(); return messages && own.call(messages, name) ? messages[name] : undefined; },
|
|
118
|
+
has: function(target, name) { var messages = table(); return !!messages && own.call(messages, name); },
|
|
119
|
+
ownKeys: function() { var messages = table(); return messages ? Object.keys(messages) : []; },
|
|
120
|
+
getOwnPropertyDescriptor: function(target, name) {
|
|
121
|
+
var messages = table();
|
|
122
|
+
return messages && own.call(messages, name) ? { value: messages[name], writable: false, enumerable: true, configurable: true } : undefined;
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
`,P,k=C.join(T,`${le}.js`);if(r.sharedRuntime){let A=await Ve("stx:native-shared-screens",[l(L)],w,p);P=Bun.hash(A).toString(36),d=k,await Bun.write(d,A.replace("__STX_NATIVE_RUNTIME_VERSION__",P))}else It(k,{force:!0});let _=C.join(T,rr);It(_,{recursive:!0,force:!0});let I={},E=[...u.map((A)=>({name:A.name,screens:[A],app:!1})),...v?[{name:ne,screens:[],app:!0}]:[]];N={};for(let A=0;A<E.length;A+=6)await Promise.all(E.slice(A,A+6).map(async(B)=>{let H=C.join(T,`${B.name}.js`),U=await Ve("stx:native-shared-screens",[l(g(B.screens,B.app,P))],w,p,c??void 0);if(await Bun.write(H,U),N[B.name]=H,a)I[B.name]=lr(U)}));if(a){for(let[B,H]of a.data)for(let[U,F]of H)await Bun.write(C.join(_,B,`${U}.json`),F);let A=Object.fromEntries(Object.keys(I).sort().map((B)=>[B,I[B]]));await Bun.write(C.join(_,"routes.json"),JSON.stringify(A));for(let B of a.files.keys())p.add(B);x={dir:_,languages:[...a.data.keys()],routes:A}}if(!r.outFile)return{code:"",routes:N,runtime:d,...x?{messages:x}:{},diagnostics:y,dependencies:[...p]}}let R=await Ve("stx:native-shared-screens",[l(g(u,!0))],w,p);if(!r.outFile)return{code:R,diagnostics:y,dependencies:[...p]};let W=C.resolve(s,r.outFile);return Et(C.dirname(W),{recursive:!0}),await Bun.write(W,R),{code:R,outFile:W,...N?{routes:N,runtime:d}:{},...x?{messages:x}:{},diagnostics:y,dependencies:[...p]}}async function dr(r,e={}){return We({...e,screens:{main:r},routed:!1})}function Ct(r,e={}){return dr(r,e)}var Ot=["native.config.json","stx-native.config.json"];function hr(r=process.cwd(),e){let t=e?X.resolve(r,e):Ot.map((f)=>X.join(r,f)).find((f)=>ue(f));if(!t)return null;if(!ue(t))throw Error(`Native config not found: ${t}`);let i=JSON.parse(gr(t,"utf8")),s=Object.entries(i.screens??{});if(s.length===0)throw Error(`${X.basename(t)} must name at least one screen in "screens"`);let a={};for(let[f,h]of s){if(!/^[A-Z][\w-]*$/i.test(f))throw Error(`Invalid native screen name: ${f}`);if(typeof h!=="string"||!h.endsWith(".stx"))throw Error(`Screen ${f} must name a .stx file`);if(a[f]=X.resolve(X.dirname(t),h),!ue(a[f]))throw Error(`Screen ${f} not found: ${a[f]}`)}let c=i.initialScreen||s[0][0];if(!a[c])throw Error(`Initial screen ${c} is not in screens`);if(i.app!==void 0&&typeof i.app!=="string")throw Error(`"app" must name the app script's file`);let u=i.app?X.resolve(X.dirname(t),i.app):void 0;if(u&&!ue(u))throw Error(`App script not found: ${u}`);return{initialScreen:c,screens:a,file:t,...u?{app:u}:{}}}async function ks(r,e={}){let t=X.resolve(e.cwd??process.cwd()),i=e.format??"ir";if(i!=="ir"&&i!=="bundle")throw Error(`Unknown compile format: ${i}. Expected ir or bundle.`);let s=r?null:hr(t,e.config);if(!r&&!s)throw Error(`Please specify an input file: stx native compile <file.stx>, or add ${Ot[0]}`);let a,c=[];if(i==="bundle"){let f=s?await We({screens:s.screens,initialScreen:s.initialScreen,minify:e.minify,root:t,...s.app?{app:s.app}:{}}):await Ct(X.resolve(t,r),{minify:e.minify});a=f.code,c=f.diagnostics}else{let f=async(S)=>{let v=await ce(S);return c.push(...v.diagnostics.map((b)=>({level:"warning",message:[b.kind,b.tag,b.name].filter(Boolean).join(": ")}))),v.document},h=s?{initialScreen:s.initialScreen,screens:Object.fromEntries(await Promise.all(Object.entries(s.screens).map(async([S,v])=>[S,await f(v)])))}:await f(X.resolve(t,r));a=JSON.stringify(h,null,2)}if(!e.output)return{output:a,diagnostics:c};let u=X.resolve(t,e.output);return pr(X.dirname(u),{recursive:!0}),await Bun.write(u,a),{output:a,written:u,diagnostics:c}}export{ks as runNativeCompile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{zr,Co,Kn,Hr,Vr,Xt,kt,_o,Xn,Jn,Ur,Wr,Cl,_l,Fe}from"./chunk-4vkpgz28.js";export{Fe as DeployError,Co as calculateSha1,Kn as collectDeployFiles,Jn as createDefaultNetlifyConfig,Hr as createFileManifest,zr as createNetlifyClient,Cl as deploy,Xn as detectProjectConfig,Vr as filterRequiredFiles,Xt as formatSize,_o as generateNetlifyToml,kt as getTotalSize,Wr as hasNetlifyConfig,_l as initNetlify,Ur as writeNetlifyConfig};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
function I(s){let o=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;s=s.replace(o,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
|
|
3
3
|
`);let n=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return s=s.replace(n,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__composables
|
|
4
|
-
`),s}function
|
|
5
|
-
export{I,
|
|
4
|
+
`),s}function qt(s){return s.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
|
|
5
|
+
export{I,qt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ot,gs,ms,hs,Qu,ys}from"./chunk-yp8tk3v3.js";import"./chunk-j79f6syh.js";import"./chunk-fwawm5r3.js";import"./chunk-c4ysk7x2.js";export{ms as buildServerApi,Qu as createServerApi,Ot as discoverServerApi,gs as generateApiTypes,ys as isServerApiSource,hs as productionApiDispatcher};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{co,lo,pt,ee,Hn,Pr,Vn,Ir,Or,ll,ul,dl,Un,pl,fl,gl,ml,da,pa,fa,uo,ga,hl,ft,gt,mt,ht,yt,bt,De,yl}from"./chunk-c4ysk7x2.js";export{Vn as Router,gl as abortNavigation,Pr as bracketPathToRegex,ft as clearMiddleware,pa as createClientCookieManager,yt as createMiddlewareContext,ht as createRouteLocation,da as createServerCookieManager,fa as createStorageManager,ml as defineMiddleware,ul as defineRoute,dl as defineRoutes,Ir as findErrorPage,Or as formatRoutes,lo as generateRouteManifest,co as generateRouteTypes,ga as getMiddleware,gt as getMiddlewareNames,De as getRouterScript,yl as getRouterScriptDev,hl as hasMiddleware,pt as isFileRequestPath,mt as loadMiddlewareFromDirectory,Hn as matchRoute,fl as navigateTo,ee as patternToRegex,uo as registerMiddleware,pl as resetRoutes,Un as route,bt as runMiddleware,ll as setAppUrl};
|