@stacksjs/stx 0.2.793 → 0.2.795
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-027hdpgv.js +2 -0
- package/dist/chunk-054h7ktz.js +2 -0
- package/dist/chunk-09nyt9c5.js +2 -0
- package/dist/chunk-0d3ncyqh.js +2 -0
- package/dist/{chunk-2gqhfge6.js → chunk-12jjf2me.js} +2 -2
- package/dist/{chunk-jdj1358b.js → chunk-1hq3y7ss.js} +2 -2
- package/dist/{chunk-b4r7d6me.js → chunk-1q16p7t2.js} +5 -5
- package/dist/chunk-1yew6rw9.js +2 -0
- package/dist/chunk-211kxm18.js +2 -0
- package/dist/chunk-26y92p8r.js +2 -0
- package/dist/{chunk-a4cse2tj.js → chunk-2bvaakcv.js} +3 -3
- package/dist/{chunk-1z9hbzpk.js → chunk-2e5tvryz.js} +1 -1
- package/dist/{chunk-66r0f799.js → chunk-2xprqx2v.js} +5 -5
- package/dist/{chunk-dhqp3z4w.js → chunk-3em44jbm.js} +2 -2
- package/dist/chunk-3ep9h16p.js +2 -0
- package/dist/{chunk-6jzqzap6.js → chunk-3f8w1x6w.js} +10 -10
- package/dist/{chunk-14ft0zc7.js → chunk-3vpgr6nk.js} +6 -6
- package/dist/{chunk-8nb8b0nf.js → chunk-427mhgje.js} +1 -1
- package/dist/chunk-49tn6yst.js +2 -0
- package/dist/chunk-4b7dwwn6.js +2 -0
- package/dist/chunk-4ncbq4bx.js +2 -0
- package/dist/{chunk-985afhhy.js → chunk-4p5g7v9g.js} +2 -2
- package/dist/{chunk-7pk3t82j.js → chunk-4s0ye933.js} +2 -2
- package/dist/chunk-4srnxp3b.js +2 -0
- package/dist/chunk-538d185r.js +3 -0
- package/dist/{chunk-605b93pe.js → chunk-53v4cby3.js} +4 -4
- package/dist/{chunk-94gyfwpz.js → chunk-624xpap6.js} +12 -12
- package/dist/{chunk-kr8qdg0r.js → chunk-6s9bk98p.js} +2 -2
- package/dist/{chunk-q14d714d.js → chunk-6wpwpk3c.js} +4 -4
- package/dist/chunk-6z4bza9z.js +2 -0
- package/dist/chunk-75y9heas.js +2 -0
- package/dist/chunk-7ckdvsmj.js +3 -0
- package/dist/{chunk-rrb9m2q2.js → chunk-7k6hd10j.js} +5 -5
- package/dist/{chunk-1y9ez7nz.js → chunk-7s1kerhs.js} +2 -2
- package/dist/{chunk-k4bdf0dw.js → chunk-7xs45trj.js} +2 -2
- package/dist/{chunk-kce6pzmj.js → chunk-7y29q1ng.js} +3 -3
- package/dist/{chunk-vj59es75.js → chunk-7y73txmp.js} +1 -1
- package/dist/{chunk-gg71gm25.js → chunk-88acqv2r.js} +4 -4
- package/dist/{chunk-4de6rhaj.js → chunk-8t8e75xm.js} +4 -4
- package/dist/chunk-8w1wxr96.js +2 -0
- package/dist/{chunk-7gdwvnwc.js → chunk-8zf87cc5.js} +2 -2
- package/dist/{chunk-gv3bfkdm.js → chunk-90zswh9v.js} +5 -5
- package/dist/chunk-98kjk52z.js +2 -0
- package/dist/{chunk-c2qwbej3.js → chunk-9b9tvhmh.js} +5 -5
- package/dist/{chunk-bb2zfgwf.js → chunk-9jcqbgq9.js} +5 -5
- package/dist/chunk-9sea317f.js +2 -0
- package/dist/chunk-9tpv4cg7.js +2 -0
- package/dist/{chunk-qzb0v08n.js → chunk-ak10vygz.js} +1 -1
- package/dist/{chunk-m997knnz.js → chunk-aksrh8je.js} +3 -3
- package/dist/{chunk-6v4b0xc1.js → chunk-ata5wp2m.js} +4 -4
- package/dist/{chunk-a1ynjj47.js → chunk-axjfaere.js} +1226 -449
- package/dist/chunk-axq3c7cb.js +2 -0
- package/dist/{chunk-2hwwmn7c.js → chunk-ayd635jf.js} +5 -5
- package/dist/{chunk-qv85c3qy.js → chunk-azqf0ps0.js} +2 -2
- package/dist/{chunk-gb65t4n1.js → chunk-b58n1kfe.js} +2 -2
- package/dist/{chunk-c0ejyxfj.js → chunk-baj6w8ja.js} +2 -2
- package/dist/{chunk-es006emk.js → chunk-bwf8b4e4.js} +3 -3
- package/dist/{chunk-h0jnatd4.js → chunk-bzhzp4f4.js} +2 -2
- package/dist/chunk-c5trhqpg.js +2 -0
- package/dist/{chunk-bmfk3b29.js → chunk-c5vzr1va.js} +2 -2
- package/dist/chunk-c692kj5v.js +2 -0
- package/dist/{chunk-55j4jxwe.js → chunk-cepctq7e.js} +108 -108
- package/dist/{chunk-0r61tkfe.js → chunk-cfbpvm5e.js} +2 -2
- package/dist/chunk-cfr7cd88.js +2 -0
- package/dist/{chunk-bwcj9z19.js → chunk-d50vw81s.js} +4 -4
- package/dist/chunk-dsh5q9bg.js +2 -0
- package/dist/{chunk-e3wmnjz8.js → chunk-dstzvtvk.js} +3 -3
- package/dist/{chunk-2p4yad7w.js → chunk-dxe94pwy.js} +4 -4
- package/dist/{chunk-0ykteae5.js → chunk-ectx5ar9.js} +3 -3
- package/dist/chunk-emnphnz7.js +2 -0
- package/dist/chunk-ennzzth4.js +177 -0
- package/dist/chunk-epcdgn78.js +2 -0
- package/dist/chunk-etegf4zj.js +2 -0
- package/dist/chunk-ewzdsksb.js +2 -0
- package/dist/chunk-ey8bgg6x.js +2 -0
- package/dist/chunk-f03sg8b0.js +2 -0
- package/dist/{chunk-w5hhqjwr.js → chunk-f4j7nsj1.js} +1 -1
- package/dist/{chunk-fpn4dren.js → chunk-fcqxa38q.js} +1 -1
- package/dist/{chunk-j4s5k8sp.js → chunk-g4n0bjfb.js} +52 -52
- package/dist/chunk-gf04pgaa.js +2 -0
- package/dist/chunk-ghn8vhet.js +2 -0
- package/dist/chunk-gywp6kd8.js +2 -0
- package/dist/{chunk-tnn0br4w.js → chunk-h656zg6k.js} +3 -3
- package/dist/{chunk-syheccfj.js → chunk-hnbx1t3t.js} +2 -2
- package/dist/{chunk-g89fx9rq.js → chunk-hp10khyy.js} +41 -41
- package/dist/{chunk-d18xd9x5.js → chunk-hwcfgs3e.js} +3 -3
- package/dist/{chunk-5a92srn2.js → chunk-jmbh26gv.js} +1 -1
- package/dist/chunk-k6sjqb7g.js +2 -0
- package/dist/{chunk-vrbcdds3.js → chunk-ka8sk5qa.js} +1 -1
- package/dist/{chunk-r2nvxbjc.js → chunk-m081078c.js} +2 -2
- package/dist/{chunk-spt5kmb2.js → chunk-mcj5qtpp.js} +1 -1
- package/dist/chunk-me71d5w5.js +2 -0
- package/dist/{chunk-6h7yhyb8.js → chunk-njk5db1q.js} +4 -4
- package/dist/chunk-nvytej81.js +2 -0
- package/dist/{chunk-xc0vws7m.js → chunk-nyer6v3y.js} +5 -5
- package/dist/chunk-p1txw41y.js +2 -0
- package/dist/{chunk-agtvdtx4.js → chunk-p3ej3954.js} +2 -2
- package/dist/chunk-p8gekf4b.js +2 -0
- package/dist/{chunk-6jx0trea.js → chunk-pm8a4kdf.js} +6 -6
- package/dist/{chunk-56yhvhjq.js → chunk-pnddmgjf.js} +7 -7
- package/dist/chunk-px0qsd38.js +2 -0
- package/dist/{chunk-27rzdq3n.js → chunk-qnxctfdf.js} +2 -2
- package/dist/chunk-qr23snrp.js +2 -0
- package/dist/{chunk-v8rfeev5.js → chunk-r1vkk7qp.js} +2 -2
- package/dist/{chunk-qp3xd98j.js → chunk-r3a15pax.js} +2 -2
- package/dist/{chunk-pa9zfbh6.js → chunk-rdymnn2t.js} +2 -2
- package/dist/{chunk-g3z2g6hm.js → chunk-reb7rddz.js} +1 -1
- package/dist/chunk-s151a2dj.js +2 -0
- package/dist/{chunk-v1z6n7wz.js → chunk-sphc7xzx.js} +4 -4
- package/dist/chunk-sqettc34.js +2 -0
- package/dist/chunk-srgbv05n.js +2 -0
- package/dist/chunk-t0d4rsfx.js +2 -0
- package/dist/chunk-t0k0yk24.js +2 -0
- package/dist/chunk-tdcgskyy.js +2 -0
- package/dist/chunk-te3hr6d7.js +2 -0
- package/dist/chunk-tes8fdv6.js +2 -0
- package/dist/{chunk-9tqa8xvf.js → chunk-thpwk6ya.js} +2 -2
- package/dist/{chunk-w9nwb8r3.js → chunk-tmfrq4nq.js} +7 -7
- package/dist/{chunk-tnkxww7b.js → chunk-tqvw1673.js} +5 -5
- package/dist/chunk-v6j5vkce.js +2 -0
- package/dist/chunk-vmp876q6.js +2 -0
- package/dist/{chunk-4s5q1aea.js → chunk-vpzdqbw7.js} +4 -4
- package/dist/{chunk-tktkj2dc.js → chunk-vwp5fchy.js} +1 -1
- package/dist/{chunk-hs9fzxn0.js → chunk-w6e30qkz.js} +13 -13
- package/dist/{chunk-3gn1t0pa.js → chunk-w76cve9j.js} +9 -9
- package/dist/{chunk-7yb8943c.js → chunk-wa7fzgw7.js} +4 -4
- package/dist/chunk-wes5fdpe.js +2 -0
- package/dist/chunk-wfnfb4fr.js +2 -0
- package/dist/{chunk-cdsv4yrv.js → chunk-wfrqwtar.js} +1 -1
- package/dist/chunk-wzwfbehm.js +20 -0
- package/dist/{chunk-xadd911n.js → chunk-x8ghjw9b.js} +2 -2
- package/dist/{chunk-74rf78w8.js → chunk-x8h81amr.js} +2 -2
- package/dist/chunk-xbhb8102.js +2 -0
- package/dist/{chunk-5j619xgb.js → chunk-xqjat573.js} +2 -2
- package/dist/chunk-xv4paxmt.js +2 -0
- package/dist/{chunk-628jcm1d.js → chunk-y2jqx5k4.js} +1 -1
- package/dist/{chunk-g7anxh36.js → chunk-y64f5t74.js} +5 -5
- package/dist/chunk-yeaqebnd.js +2 -0
- package/dist/chunk-yj20tq3s.js +2 -0
- package/dist/chunk-yjm7c78z.js +2 -0
- package/dist/{chunk-h0c6jtrj.js → chunk-yjnaqahd.js} +4 -4
- package/dist/{chunk-4cffjp4f.js → chunk-zmr0pvcd.js} +113 -105
- package/dist/{chunk-44ep7dkr.js → chunk-zv3zpmv1.js} +1 -1
- package/dist/{chunk-bxxgr5c5.js → chunk-zva4a7xq.js} +2 -2
- package/dist/cli.js +19 -19
- package/dist/client/signals-authoring-runtime.js +2 -2
- package/dist/client/signals-binding-utils-runtime.js +14 -8
- package/dist/client/signals-component-props-runtime.js +8 -2
- package/dist/client/signals-expression-compiler-runtime.js +1 -1
- package/dist/client/signals-for-runtime.js +34 -0
- package/dist/client/signals-handler-runtime.js +43 -20
- package/dist/client/signals-helpers-runtime.js +39 -0
- package/dist/client/signals-native-row-runtime.d.ts +26 -0
- package/dist/client/signals-native-row-runtime.js +626 -0
- package/dist/client/signals-process-element-runtime.js +305 -287
- package/dist/client/signals-proxy-runtime.js +56 -31
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/accessibility.js +8 -0
- package/dist/native/compiler/bundle.js +1 -1
- package/dist/native/compiler/inline-style.js +38 -1
- package/dist/native/compiler/style-variables.js +9 -1
- package/dist/native/event-names.js +1 -0
- package/dist/native/prop-names.js +9 -1
- package/dist/native/runtime/binding-tree.d.ts +2 -0
- package/dist/native/runtime/binding-tree.js +12 -1
- package/dist/native/runtime/craft-bridge.js +66 -0
- package/dist/native/runtime/craft.d.ts +78 -2
- package/dist/native/runtime/native-host.d.ts +2 -0
- package/dist/native/runtime/native-host.js +219 -94
- package/dist/pwa.js +3 -3
- package/dist/signals.d.ts +13 -10
- package/dist/signals.js +5 -3
- package/dist/ssg.js +15 -15
- package/dist/stx-virtual-ts.d.ts +25 -1
- package/dist/stx-virtual-ts.js +109 -6
- package/dist/typecheck.d.ts +3 -1
- package/dist/typecheck.js +28 -11
- package/package.json +5 -5
- package/dist/chunk-0a9ceqa8.js +0 -2
- package/dist/chunk-0cm94ksp.js +0 -2
- package/dist/chunk-0ppx28f6.js +0 -2
- package/dist/chunk-1aent61q.js +0 -2
- package/dist/chunk-1brkqd5f.js +0 -2
- package/dist/chunk-1pbyr47e.js +0 -2
- package/dist/chunk-1tvb2stj.js +0 -2
- package/dist/chunk-22z2cwhv.js +0 -2
- package/dist/chunk-276e3d0g.js +0 -3
- package/dist/chunk-27vn4674.js +0 -2
- package/dist/chunk-2vxh8b8g.js +0 -2
- package/dist/chunk-33na85q2.js +0 -2
- package/dist/chunk-3t4t655h.js +0 -2
- package/dist/chunk-43ynckvh.js +0 -2
- package/dist/chunk-44tq4d62.js +0 -2
- package/dist/chunk-499v1ade.js +0 -2
- package/dist/chunk-4gx5ze56.js +0 -2
- package/dist/chunk-4v22nj67.js +0 -2
- package/dist/chunk-55wsqxfk.js +0 -2
- package/dist/chunk-5pe7wcvh.js +0 -2
- package/dist/chunk-5y5k6x3r.js +0 -2
- package/dist/chunk-699t603m.js +0 -2
- package/dist/chunk-6f6xqzhb.js +0 -2
- package/dist/chunk-7fx8p9w5.js +0 -2
- package/dist/chunk-8698v9gf.js +0 -2
- package/dist/chunk-8pphy0p1.js +0 -2
- package/dist/chunk-98308vtv.js +0 -20
- package/dist/chunk-ad2fk303.js +0 -2
- package/dist/chunk-ajj56vrw.js +0 -2
- package/dist/chunk-brqcepmv.js +0 -2
- package/dist/chunk-d5e47gr4.js +0 -2
- package/dist/chunk-d910ytt2.js +0 -2
- package/dist/chunk-d9p7xaj7.js +0 -2
- package/dist/chunk-ddbkw53b.js +0 -2
- package/dist/chunk-dtnyrjcj.js +0 -2
- package/dist/chunk-dyp0kgmr.js +0 -177
- package/dist/chunk-fc384a2h.js +0 -2
- package/dist/chunk-fkkdt6sj.js +0 -2
- package/dist/chunk-fxy0cq7h.js +0 -2
- package/dist/chunk-g6smtcc0.js +0 -2
- package/dist/chunk-gnydrw29.js +0 -2
- package/dist/chunk-jkm34gec.js +0 -2
- package/dist/chunk-js5zve3p.js +0 -2
- package/dist/chunk-k3mcb700.js +0 -3
- package/dist/chunk-kn38mjpp.js +0 -2
- package/dist/chunk-kvmpc0sg.js +0 -2
- package/dist/chunk-ncxed9r1.js +0 -2
- package/dist/chunk-nf2bzqaw.js +0 -2
- package/dist/chunk-nptp3x62.js +0 -2
- package/dist/chunk-qd9f47ds.js +0 -2
- package/dist/chunk-s1wdzttg.js +0 -2
- package/dist/chunk-t8vtf522.js +0 -2
- package/dist/chunk-t9744tty.js +0 -2
- package/dist/chunk-th5afzmv.js +0 -2
- package/dist/chunk-vaqqch06.js +0 -2
- package/dist/chunk-vgzfsh1z.js +0 -2
- package/dist/chunk-wr3adhd8.js +0 -2
- package/dist/chunk-zdwnzq78.js +0 -2
- package/dist/chunk-zsjw2jgy.js +0 -2
- package/dist/chunk-zyf6737j.js +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fl,gl,ml}from"./chunk-gb65t4n1.js";import{le,Vn,Un,bo,Gr,Jr,Wn,qn,wo,Yr}from"./chunk-9tqa8xvf.js";function W(e,s,i,a,d,y){let r=!0,u=new Set,f=(p)=>a.get?a.get(p):p,o=()=>f(e());return Object.defineProperty(o,"_isSignal",{value:!0}),Object.defineProperty(o,"modifiers",{get:s}),o.set=(p)=>{if(!r)return;let h=s(),t=a.set?a.set(p,h):p;if(h.trim&&typeof t==="string")t=t.trim();if(h.number&&typeof t==="string"&&t!==""){let l=Number(t);if(!Number.isNaN(l))t=l}if(Object.is(e(),t))return;e.set(t),i(t)},o.update=(p)=>o.set(p(o())),o.input=(p)=>{if(!s().lazy)o.set(p)},o.change=(p)=>{if(s().lazy)o.set(p)},o.subscribe=(p)=>{if(!r)return()=>{};let h=e.subscribe((t,l)=>p(f(t),f(l)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(o,"value",{get:o,set:o.set}),d(()=>{r=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{r=!0}),o}function X(e,s=!0,i){if(!s||!e||typeof window>"u")return;let a=window;if(!a.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let r=JSON.parse(y?.textContent||"{}");a.__STX_DATA__=r&&typeof r==="object"&&!Array.isArray(r)?r:{}}catch{a.__STX_DATA__={}}}let d=a.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,e))try{return{data:i?i(d[e]):d[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(e){if(typeof window>"u")return;let s=window;if(e===void 0)s.__STX_DATA__={};else{if(!s.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");s.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{s.__STX_DATA__={}}if(s.__STX_DATA__)delete s.__STX_DATA__[e]}}function Y(e){let s=null;try{s=typeof indexedDB<"u"?indexedDB:null}catch{s=null}if(!s)return null;let i=s,a=e||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let o=i.open(a,1);o.onupgradeneeded=()=>{o.result.createObjectStore("kv")},o.onsuccess=()=>u(o.result),o.onerror=()=>f(o.error),o.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},r=(u,f)=>y().then((o)=>new Promise((p,h)=>{let t=o.transaction("kv",u),l=f(t.objectStore("kv"));t.oncomplete=()=>p(l?l.result:void 0),t.onerror=()=>h(t.error),t.onabort=()=>h(t.error)}));return{get:(u)=>r("readonly",(f)=>f.get(u)),set:(u,f)=>r("readwrite",(o)=>{o.put(f,u)}),remove:(u)=>r("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>r("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(e,s){let i=e||{},a=null;if(i.storage!==void 0)a=i.storage;else try{a=typeof localStorage<"u"?localStorage:null}catch{a=null}let d=null,y=i.backend!==void 0;if(y)d=i.backend||null;let r=()=>{if(y)return d;y=!0;try{d=s?s():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=i.limit||32768,f=i.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),o=new Map,p=new Set,h=new Map,t=!1,l=Promise.resolve(),g=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!a)return!1;try{return a.setItem(n,c),!0}catch{return!1}},_=(n)=>{try{if(a)a.removeItem(n)}catch{}},k=()=>{if(t=!1,!h.size)return l;let n=Array.from(h.entries());return h.clear(),l=l.then(()=>Promise.all(n.map(([c,v])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(v===void 0?null:v))}catch{}return}let x;try{return x={v},d.set(c,x).catch(()=>{let S;try{S=JSON.stringify(v)}catch{return}return d?d.set(c,{j:S}).catch(()=>{m(c,S)}):void 0})}catch{return}}))).then(()=>{}),l},N=(n,c)=>{if(h.set(n,c),p.add(n),t)return;t=!0,f(()=>{k()})},M=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:g(c.j)};return},E={peek(n){if(o.has(n))return{value:o.get(n)};let c=null;try{c=a?a.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let v=g(c);return o.set(n,v),{value:v}},load(n){let c=E.peek(n),v=c?null:r();if(c||!v)return Promise.resolve(c);return v.get(n).then((x)=>{if(o.has(n))return{value:o.get(n)};let S=M(x);if(S)o.set(n,S.value),p.add(n);return S},()=>{return})},set(n,c){if(o.set(n,c),d&&p.has(n)){N(n,c);return}let v;try{v=JSON.stringify(c===void 0?null:c)}catch{return}if(v.length<=u&&m(n,v))return;if(!r()){if(v.length>u)m(n,v);return}_(n),N(n,c)},forget(n){for(let v of Array.from(o.keys()))if(v.indexOf(n)===0)o.delete(v);for(let v of Array.from(h.keys()))if(v.indexOf(n)===0)h.delete(v);for(let v of Array.from(p))if(v.indexOf(n)===0)p.delete(v);try{if(a)for(let v=a.length-1;v>=0;v--){let x=a.key(v);if(x&&x.indexOf(n)===0)a.removeItem(x)}}catch{}let c=r();if(!c)return l;return l=l.then(()=>c.removePrefix(n)).catch(()=>{}),l},flush(){return k()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")k()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{k()})}catch{}return E}function Z(e,s){if(!e)return!1;if(e===s.key)return!0;if(!s.url)return!1;if(e===s.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",a=new URL(e,i),d=new URL(s.url,i);if(a.origin!==d.origin||a.pathname!==d.pathname)return!1;return!a.search||a.search===d.search}catch{return!1}}function ee(e){let s=e.prefix||"stx:kept:",i=e.matches||((t,l)=>t===l.key||t===l.url),a=new Set,d=new Map,y,r=(t)=>t===void 0?y:t,u=(t,l)=>{let g=r(l);if(g===!1||g===null||g==="")return null;return`${s}${g===void 0?"":`${g}:`}query:${t}`},f=(t)=>{let l=t&&t.value;if(!l||typeof l!=="object"||!("d"in l))return;return{data:l.d,at:Number(l.at)||0}},o=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},p={setScope(t){y=t},scope:()=>y,keyFor:u,seed(t,l){let g=u(t,l);return g?f(e.kept.peek(g)):void 0},restore(t,l){let g=u(t,l);return g?e.kept.load(g).then(f):Promise.resolve(void 0)},persist(t,l,g){let m=u(t,g);if(m)e.kept.set(m,{d:l,at:Date.now()})},overlay(t,l,g){let m=o();if(!m||!m.size)return l;let _=l;return m.forEach((k)=>{try{_=k.overlay(t,_,g)}catch{}}),_},watch(t){return a.add(t),()=>{a.delete(t)}},cachedQuery(t,l){let g=d.get(t);if(g){if(l&&g.__options)g.__options(l);return g}let m=l||{},_=m.initial===void 0?null:m.initial,k=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,M=()=>({key:t,url:N()}),E=k(),n=_,c=0,v=e.sharedRequest(),x=0,S=p.seed(t,E);if(S)n=S.data;let I=e.state(p.overlay(M(),n)),U=e.state(!1),q=e.state(!1),K=e.state(null),P=e.state(S?S.at:0),R=0,F=()=>{I.set(p.overlay(M(),n))},z=(b)=>{let w=R;p.restore(t,b).then((T)=>{if(!T||w!==R||c)return;n=T.data,P.set(T.at),F()})};if(!S)z(E);let _t=()=>{let b=k();if(b===E)return;E=b,R++,x=0,q.set(!1),U.set(!1),c=0;let w=p.seed(t,E);if(n=w?w.data:_,P.set(w?w.at:0),F(),!w)z(E)},xt=(b,w)=>{let T=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,V=new Promise((D,H)=>{O=setTimeout(()=>{if(C)C.abort();H(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:b,url:w,signal:C?C.signal:void 0});else if(w){let D=m.fetch||((L,j)=>fetch(L,j)),H={method:"GET",headers:{Accept:"application/json"}};if(b)H.cache="no-cache";if(C)H.signal=C.signal;A=D(w,H).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((j)=>{throw Error(j&&(j.error||j.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([A,V]).then((D)=>{if(O)clearTimeout(O);return m.transform?m.transform(D):D},(D)=>{if(O)clearTimeout(O);throw D})},G=(b)=>{let w=R,T=N(),C=()=>{if(w!==R)return Promise.resolve(I());if(x++,q.set(!0),c===0&&!P())U.set(!0);let V=()=>{if(w!==R)return;if(x=Math.max(0,x-1),!x)q.set(!1),U.set(!1)};return xt(b,T).then((A)=>{if(w!==R||T!==N())return V(),I();return n=A,c=Date.now(),P.set(c),K.set(null),p.persist(t,A,E),F(),V(),I()},(A)=>{if(w===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return V(),I()})},O=`${w} ${T||""}`;return b?v.fresh(O,C):v.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return t},load(b){if(_t(),!b&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return G(!!b)},refresh(){return B.load(!0)},set(b){n=typeof b==="function"?b(n):b,p.persist(t,n,E),F()},invalidate(){c=0},__options(b){m={...m,...b}}};if(a.add({target:M,updated:()=>{if(c||P())G(!1)},outbox:(b)=>{if(b)n=p.overlay(M(),n,b.id),c=0,G(!0);F()}}),d.set(t,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(t)=>{let l=t.detail||{};if(l.kind!=="api"||typeof l.url!=="string")return;a.forEach((g)=>{if(i(l.url,g.target()))g.updated()})}),h.addEventListener("stx:outbox",(t)=>{let l=t.detail||{},g=l.sent&&typeof l.sent.id==="string"?l.sent:null;a.forEach((m)=>{if(g){let _=Array.isArray(g.affects)?g.affects:[],k=m.target();if(!_.some((N)=>i(N,k)))return}m.outbox(g)})});return p}function te(e){let s=e&&e.covers||((r,u)=>Object.is(r,u)),i=[],a=[],d=0,y=(r,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let o={key:r,promise:f};i.push(o);let p=()=>{let h=i.indexOf(o);if(h!==-1)i.splice(h,1)};return f.then(p,p),f};return{run(r,u){for(let f of i)if(s(f.key,r))return f.promise;for(let f of a)if(s(f.key,r))return f.promise;return y(r,u)},fresh(r,u){for(let h of a)if(s(h.key,r))return h.promise;let f=i.filter((h)=>s(h.key,r)).map((h)=>h.promise);if(!f.length)return y(r,u);let o={key:r,promise:null},p=()=>{};return o.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=a.indexOf(o);if(h!==-1)a.splice(h,1);return y(r,u)}),a.push(o),o.promise},latest(){let r=++d;return()=>r===d},get busy(){return i.length>0||a.length>0}}}function ne(e){let s=!1,i=null,a=null,d=0;async function y(){if(s)return;i=new AbortController;try{let r=await e.request(e.endpoint,{signal:i.signal,cache:"no-store",headers:{Accept:"text/event-stream"}});if(!r.ok||!r.body||!r.headers.get("content-type")?.includes("text/event-stream"))throw Error("Broadcast stream unavailable");if(s){await r.body.cancel();return}let u=r.body.getReader(),f=new TextDecoder,o="";d=0,e.onStatus?.(!0),e.onConnected?.();try{while(!s){let{done:p,value:h}=await u.read();if(p)break;if(o+=f.decode(h,{stream:!0}).replace(/\r\n/g,`
|
|
3
|
-
`),
|
|
2
|
+
import{gl,ml,hl}from"./chunk-b58n1kfe.js";import{le,Vn,Un,wo,Jr,Yr,Wn,qn,vo,Zr}from"./chunk-thpwk6ya.js";function z(e,o,l,r,d,y){let s=!0,u=new Set,h=(p)=>r.get?r.get(p):p,a=()=>h(e());return Object.defineProperty(a,"_isSignal",{value:!0}),Object.defineProperty(a,"modifiers",{get:o}),a.set=(p)=>{if(!s)return;let f=o(),t=r.set?r.set(p,f):p;if(f.trim&&typeof t==="string")t=t.trim();if(f.number&&typeof t==="string"&&t!==""){let i=Number(t);if(!Number.isNaN(i))t=i}if(Object.is(e(),t))return;e.set(t),l(t)},a.update=(p)=>a.set(p(a())),a.input=(p)=>{if(!o().lazy)a.set(p)},a.change=(p)=>{if(o().lazy)a.set(p)},a.subscribe=(p)=>{if(!s)return()=>{};let f=e.subscribe((t,i)=>p(h(t),h(i)));return u.add(f),()=>{f(),u.delete(f)}},Object.defineProperty(a,"value",{get:a,set:a.set}),d(()=>{s=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{s=!0}),a}function X(e,o=!0,l){if(!o||!e||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let s=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=s&&typeof s==="object"&&!Array.isArray(s)?s:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,e))try{return{data:l?l(d[e]):d[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(e){if(typeof window>"u")return;let o=window;if(e===void 0)o.__STX_DATA__={};else{if(!o.__STX_DATA__)try{let l=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");o.__STX_DATA__=l&&typeof l==="object"&&!Array.isArray(l)?l:{}}catch{o.__STX_DATA__={}}if(o.__STX_DATA__)delete o.__STX_DATA__[e]}}function Y(e){let o=null;try{o=typeof indexedDB<"u"?indexedDB:null}catch{o=null}if(!o)return null;let l=o,r=e||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,h)=>{let a=l.open(r,1);a.onupgradeneeded=()=>{a.result.createObjectStore("kv")},a.onsuccess=()=>u(a.result),a.onerror=()=>h(a.error),a.onblocked=()=>h(Error("blocked"))}),d.catch(()=>{d=null});return d},s=(u,h)=>y().then((a)=>new Promise((p,f)=>{let t=a.transaction("kv",u),i=h(t.objectStore("kv"));t.oncomplete=()=>p(i?i.result:void 0),t.onerror=()=>f(t.error),t.onabort=()=>f(t.error)}));return{get:(u)=>s("readonly",(h)=>h.get(u)),set:(u,h)=>s("readwrite",(a)=>{a.put(h,u)}),remove:(u)=>s("readwrite",(h)=>{h.delete(u)}),removePrefix:(u)=>s("readwrite",(h)=>{h.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(e,o){let l=e||{},r=null;if(l.storage!==void 0)r=l.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=l.backend!==void 0;if(y)d=l.backend||null;let s=()=>{if(y)return d;y=!0;try{d=o?o():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=l.limit||32768,h=l.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),a=new Map,p=new Set,f=new Map,t=!1,i=Promise.resolve(),g=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},_=(n)=>{try{if(r)r.removeItem(n)}catch{}},k=()=>{if(t=!1,!f.size)return i;let n=Array.from(f.entries());return f.clear(),i=i.then(()=>Promise.all(n.map(([c,v])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(v===void 0?null:v))}catch{}return}let x;try{return x={v},d.set(c,x).catch(()=>{let S;try{S=JSON.stringify(v)}catch{return}return d?d.set(c,{j:S}).catch(()=>{m(c,S)}):void 0})}catch{return}}))).then(()=>{}),i},N=(n,c)=>{if(f.set(n,c),p.add(n),t)return;t=!0,h(()=>{k()})},M=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:g(c.j)};return},E={peek(n){if(a.has(n))return{value:a.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let v=g(c);return a.set(n,v),{value:v}},load(n){let c=E.peek(n),v=c?null:s();if(c||!v)return Promise.resolve(c);return v.get(n).then((x)=>{if(a.has(n))return{value:a.get(n)};let S=M(x);if(S)a.set(n,S.value),p.add(n);return S},()=>{return})},set(n,c){if(a.set(n,c),d&&p.has(n)){N(n,c);return}let v;try{v=JSON.stringify(c===void 0?null:c)}catch{return}if(v.length<=u&&m(n,v))return;if(!s()){if(v.length>u)m(n,v);return}_(n),N(n,c)},forget(n){for(let v of Array.from(a.keys()))if(v.indexOf(n)===0)a.delete(v);for(let v of Array.from(f.keys()))if(v.indexOf(n)===0)f.delete(v);for(let v of Array.from(p))if(v.indexOf(n)===0)p.delete(v);try{if(r)for(let v=r.length-1;v>=0;v--){let x=r.key(v);if(x&&x.indexOf(n)===0)r.removeItem(x)}}catch{}let c=s();if(!c)return i;return i=i.then(()=>c.removePrefix(n)).catch(()=>{}),i},flush(){return k()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")k()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{k()})}catch{}return E}function Z(e,o){if(!e)return!1;if(e===o.key)return!0;if(!o.url)return!1;if(e===o.url)return!0;try{let l=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(e,l),d=new URL(o.url,l);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function ee(e){let o=e.prefix||"stx:kept:",l=e.matches||((t,i)=>t===i.key||t===i.url),r=new Set,d=new Map,y,s=(t)=>t===void 0?y:t,u=(t,i)=>{let g=s(i);if(g===!1||g===null||g==="")return null;return`${o}${g===void 0?"":`${g}:`}query:${t}`},h=(t)=>{let i=t&&t.value;if(!i||typeof i!=="object"||!("d"in i))return;return{data:i.d,at:Number(i.at)||0}},a=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},p={setScope(t){y=t},scope:()=>y,keyFor:u,seed(t,i){let g=u(t,i);return g?h(e.kept.peek(g)):void 0},restore(t,i){let g=u(t,i);return g?e.kept.load(g).then(h):Promise.resolve(void 0)},persist(t,i,g){let m=u(t,g);if(m)e.kept.set(m,{d:i,at:Date.now()})},overlay(t,i,g){let m=a();if(!m||!m.size)return i;let _=i;return m.forEach((k)=>{try{_=k.overlay(t,_,g)}catch{}}),_},watch(t){return r.add(t),()=>{r.delete(t)}},cachedQuery(t,i){let g=d.get(t);if(g){if(i&&g.__options)g.__options(i);return g}let m=i||{},_=m.initial===void 0?null:m.initial,k=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,M=()=>({key:t,url:N()}),E=k(),n=_,c=0,v=e.sharedRequest(),x=0,S=p.seed(t,E);if(S)n=S.data;let C=e.state(p.overlay(M(),n)),U=e.state(!1),q=e.state(!1),K=e.state(null),P=e.state(S?S.at:0),R=0,V=()=>{C.set(p.overlay(M(),n))},W=(w)=>{let b=R;p.restore(t,w).then((T)=>{if(!T||b!==R||c)return;n=T.data,P.set(T.at),V()})};if(!S)W(E);let xt=()=>{let w=k();if(w===E)return;E=w,R++,x=0,q.set(!1),U.set(!1),c=0;let b=p.seed(t,E);if(n=b?b.data:_,P.set(b?b.at:0),V(),!b)W(E)},St=(w,b)=>{let T=m.timeoutMs||15000,I=typeof AbortController<"u"?new AbortController:null,O=null,F=new Promise((D,H)=>{O=setTimeout(()=>{if(I)I.abort();H(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:w,url:b,signal:I?I.signal:void 0});else if(b){let D=m.fetch||((L,j)=>fetch(L,j)),H={method:"GET",headers:{Accept:"application/json"}};if(w)H.cache="no-cache";if(I)H.signal=I.signal;A=D(b,H).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((j)=>{throw Error(j&&(j.error||j.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(C());return Promise.race([A,F]).then((D)=>{if(O)clearTimeout(O);return m.transform?m.transform(D):D},(D)=>{if(O)clearTimeout(O);throw D})},G=(w)=>{let b=R,T=N(),I=()=>{if(b!==R)return Promise.resolve(C());if(x++,q.set(!0),c===0&&!P())U.set(!0);let F=()=>{if(b!==R)return;if(x=Math.max(0,x-1),!x)q.set(!1),U.set(!1)};return St(w,T).then((A)=>{if(b!==R||T!==N())return F(),C();return n=A,c=Date.now(),P.set(c),K.set(null),p.persist(t,A,E),V(),F(),C()},(A)=>{if(b===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return F(),C()})},O=`${b} ${T||""}`;return w?v.fresh(O,I):v.run(O,I)},B={data:C,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return t},load(w){if(xt(),!w&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(C());return G(!!w)},refresh(){return B.load(!0)},set(w){n=typeof w==="function"?w(n):w,p.persist(t,n,E),V()},invalidate(){c=0},__options(w){m={...m,...w}}};if(r.add({target:M,updated:()=>{if(c||P())G(!1)},outbox:(w)=>{if(w)n=p.overlay(M(),n,w.id),c=0,G(!0);V()}}),d.set(t,B),m.immediate)B.load();return B}},f=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&f&&typeof f.addEventListener==="function")f.addEventListener("stx:updated",(t)=>{let i=t.detail||{};if(i.kind!=="api"||typeof i.url!=="string")return;r.forEach((g)=>{if(l(i.url,g.target()))g.updated()})}),f.addEventListener("stx:outbox",(t)=>{let i=t.detail||{},g=i.sent&&typeof i.sent.id==="string"?i.sent:null;r.forEach((m)=>{if(g){let _=Array.isArray(g.affects)?g.affects:[],k=m.target();if(!_.some((N)=>l(N,k)))return}m.outbox(g)})});return p}function te(e){let o=e&&e.covers||((s,u)=>Object.is(s,u)),l=[],r=[],d=0,y=(s,u)=>{let h;try{h=Promise.resolve(u())}catch(f){h=Promise.reject(f)}let a={key:s,promise:h};l.push(a);let p=()=>{let f=l.indexOf(a);if(f!==-1)l.splice(f,1)};return h.then(p,p),h};return{run(s,u){for(let h of l)if(o(h.key,s))return h.promise;for(let h of r)if(o(h.key,s))return h.promise;return y(s,u)},fresh(s,u){for(let f of r)if(o(f.key,s))return f.promise;let h=l.filter((f)=>o(f.key,s)).map((f)=>f.promise);if(!h.length)return y(s,u);let a={key:s,promise:null},p=()=>{};return a.promise=Promise.all(h.map((f)=>f.then(p,p))).then(()=>{let f=r.indexOf(a);if(f!==-1)r.splice(f,1);return y(s,u)}),r.push(a),a.promise},latest(){let s=++d;return()=>s===d},get busy(){return l.length>0||r.length>0}}}function ne(e){let o=!1,l=null,r=null,d=0;async function y(){if(o)return;l=new AbortController;try{let s=await e.request(e.endpoint,{signal:l.signal,cache:"no-store",headers:{Accept:"text/event-stream"}});if(!s.ok||!s.body||!s.headers.get("content-type")?.includes("text/event-stream"))throw Error("Broadcast stream unavailable");if(o){await s.body.cancel();return}let u=s.body.getReader(),h=new TextDecoder,a="";d=0,e.onStatus?.(!0),e.onConnected?.();try{while(!o){let{done:p,value:f}=await u.read();if(p)break;if(a+=h.decode(f,{stream:!0}).replace(/\r\n/g,`
|
|
3
|
+
`),a.length>1048576)throw Error("Broadcast frame too large");let t;while((t=a.indexOf(`
|
|
4
4
|
|
|
5
|
-
`))!==-1){let
|
|
5
|
+
`))!==-1){let i=a.slice(0,t);a=a.slice(t+2);let g=i.split(`
|
|
6
6
|
`).filter((_)=>_.startsWith("data:")).map((_)=>_.slice(5).trimStart()).join(`
|
|
7
|
-
`);if(!g)continue;let m=JSON.parse(g);if(typeof m.channel==="string"&&typeof m.event==="string")e.onMessage(m)}}}finally{await u.cancel().catch(()=>{}),u.releaseLock()}}catch{}finally{if(e.onStatus?.(!1),!
|
|
7
|
+
`);if(!g)continue;let m=JSON.parse(g);if(typeof m.channel==="string"&&typeof m.event==="string")e.onMessage(m)}}}finally{await u.cancel().catch(()=>{}),u.releaseLock()}}catch{}finally{if(e.onStatus?.(!1),!o)r=setTimeout(y,Math.min((e.reconnectDelay??1000)*2**d++,30000))}}return y(),{close(){if(o=!0,l?.abort(),r)clearTimeout(r);e.onStatus?.(!1)}}}var re=` function useColorMode(options) {
|
|
8
8
|
options = options || {};
|
|
9
9
|
// The pre-paint boot script (stacksjs/stx#1794) publishes the app's
|
|
10
10
|
// configured options here. Reading them makes a bare useColorMode() agree
|
|
@@ -364,7 +364,7 @@ catch (e) {} }
|
|
|
364
364
|
return v;
|
|
365
365
|
};
|
|
366
366
|
var root = window.__STX_CURRENT_ELEMENT__;
|
|
367
|
-
var kebabName = name
|
|
367
|
+
var kebabName = __stxKebab(name);
|
|
368
368
|
var lowerName = name.toLowerCase();
|
|
369
369
|
var attributeNames = [name];
|
|
370
370
|
if (kebabName !== name) attributeNames.push(kebabName);
|
|
@@ -384,7 +384,7 @@ catch (e) {} }
|
|
|
384
384
|
if (serializedProps) {
|
|
385
385
|
try {
|
|
386
386
|
var parsedProps = JSON.parse(serializedProps);
|
|
387
|
-
var camelName = name
|
|
387
|
+
var camelName = __stxCamel(name);
|
|
388
388
|
if (Object.prototype.hasOwnProperty.call(parsedProps, name)) staticValue = parsedProps[name];
|
|
389
389
|
else if (Object.prototype.hasOwnProperty.call(parsedProps, camelName)) staticValue = parsedProps[camelName];
|
|
390
390
|
}
|
|
@@ -504,14 +504,22 @@ catch (e) {} }
|
|
|
504
504
|
|
|
505
505
|
function getElementAttributes(el) {
|
|
506
506
|
if (!el || !el.attributes) return [];
|
|
507
|
-
|
|
507
|
+
// A copy, since processing an element removes attributes as it goes. A
|
|
508
|
+
// plain loop: every element of every row comes through here, and
|
|
509
|
+
// Array.from with a map callback was a share of a launch in an interpreter.
|
|
510
|
+
var source = el.attributes;
|
|
511
|
+
// A Map of attributes (some DOMs' clones) has no length: list its entries.
|
|
512
|
+
if (typeof source.length !== 'number') source = Array.from(source);
|
|
513
|
+
var attrs = new Array(source.length);
|
|
514
|
+
for (var i = 0; i < source.length; i++) {
|
|
515
|
+
var attr = source[i];
|
|
508
516
|
// Browser DOM exposes Attr records through NamedNodeMap. HappyDOM and
|
|
509
517
|
// other standards-oriented DOM implementations may expose Map entries
|
|
510
518
|
// for cloned nodes instead. Normalize both shapes so reactive nodes
|
|
511
519
|
// created by :for hydrate exactly like their browser counterparts.
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
520
|
+
attrs[i] = Array.isArray(attr) ? { name: attr[0], value: attr[1] } : attr;
|
|
521
|
+
}
|
|
522
|
+
return attrs;
|
|
515
523
|
}
|
|
516
524
|
|
|
517
525
|
function getModelBinding(el) {
|
|
@@ -542,7 +550,7 @@ catch (e) {} }
|
|
|
542
550
|
}
|
|
543
551
|
|
|
544
552
|
function preserveDeferredParentComponentProps(el) {
|
|
545
|
-
var names = (el.getAttribute('data-stx-parent-bindings') || '')
|
|
553
|
+
var names = __stxWords(el.getAttribute('data-stx-parent-bindings') || '');
|
|
546
554
|
if (!names.length) return;
|
|
547
555
|
var deferred = readDeferredParentComponentProps(el);
|
|
548
556
|
names.forEach(function(name) {
|
|
@@ -599,9 +607,7 @@ catch (e) {} }
|
|
|
599
607
|
if (!el || !el.getAttribute) return;
|
|
600
608
|
var scopeId = el.getAttribute('data-stx-scope');
|
|
601
609
|
var scopeVars = scopeId && window.stx._scopes && window.stx._scopes[scopeId];
|
|
602
|
-
var camelName = name
|
|
603
|
-
return character.toUpperCase();
|
|
604
|
-
});
|
|
610
|
+
var camelName = __stxCamel(name);
|
|
605
611
|
// useReactiveProp signals are often intentionally aliased inside the
|
|
606
612
|
// child, for example liveClosable = useReactiveProp('closable', true).
|
|
607
613
|
// The public prop name therefore cannot be inferred from the variable
|
|
@@ -987,7 +993,7 @@ else {
|
|
|
987
993
|
}
|
|
988
994
|
`;var ue=` function bindParentComponentProps(el, callerScope) {
|
|
989
995
|
if (!el || !el.getAttribute || el.__stx_parent_props_bound) return;
|
|
990
|
-
var names = (el.getAttribute('data-stx-parent-bindings') || '')
|
|
996
|
+
var names = __stxWords(el.getAttribute('data-stx-parent-bindings') || '');
|
|
991
997
|
if (!names.length) return;
|
|
992
998
|
if (hasPendingLoopBoundary(el)) {
|
|
993
999
|
preserveDeferredParentComponentProps(el);
|
|
@@ -1061,8 +1067,14 @@ else {
|
|
|
1061
1067
|
}
|
|
1062
1068
|
|
|
1063
1069
|
function resolveComponentCallerScope(el, pageScope) {
|
|
1070
|
+
return componentCallerScopeFrom(el && (el.parentElement || el.parentNode), pageScope);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
// The caller scope for a component placed under \`current\`: the page's
|
|
1074
|
+
// scope, then every component scope around it, outermost first. A native
|
|
1075
|
+
// loop row binds before it is inserted, so it asks from its future parent.
|
|
1076
|
+
function componentCallerScopeFrom(current, pageScope) {
|
|
1064
1077
|
var ancestors = [];
|
|
1065
|
-
var current = el && (el.parentElement || el.parentNode);
|
|
1066
1078
|
while (current && current !== document) {
|
|
1067
1079
|
if (current.getAttribute && current.hasAttribute('data-stx-scope'))
|
|
1068
1080
|
ancestors.push(current.getAttribute('data-stx-scope'));
|
|
@@ -1259,7 +1271,7 @@ else {
|
|
|
1259
1271
|
}
|
|
1260
1272
|
});
|
|
1261
1273
|
}
|
|
1262
|
-
`;var
|
|
1274
|
+
`;var fe=` // Component composition API (Phase 4)
|
|
1263
1275
|
defineProps: function(definitions) {
|
|
1264
1276
|
var props = window.__STX_CURRENT_PROPS__ || {};
|
|
1265
1277
|
if (!definitions) return props;
|
|
@@ -1317,7 +1329,7 @@ else {
|
|
|
1317
1329
|
// implementation behind it (#1804).
|
|
1318
1330
|
useSlots: function() {
|
|
1319
1331
|
return window.__STX_CURRENT_SLOTS__ || {};
|
|
1320
|
-
},`;var
|
|
1332
|
+
},`;var he=` var __bindIfCounter = 0;
|
|
1321
1333
|
// \u2500\u2500 x-else / x-else-if chain support (stacksjs/stx#1734) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1322
1334
|
// Returns { name, terminal } for an else/else-if attribute present on el,
|
|
1323
1335
|
// or null. terminal=true for the catch-all x-else (no further siblings
|
|
@@ -1726,7 +1738,7 @@ else {
|
|
|
1726
1738
|
function stxConfirm(message, options) {
|
|
1727
1739
|
return _createDialog(message, options, true);
|
|
1728
1740
|
}
|
|
1729
|
-
`;var
|
|
1741
|
+
`;var we=` // ==========================================================================
|
|
1730
1742
|
// DevTools introspection (stacksjs/stx#1747, Phase 1)
|
|
1731
1743
|
// ==========================================================================
|
|
1732
1744
|
// A read-only, console-usable inspector wired to the live runtime \u2014 no manual
|
|
@@ -1861,7 +1873,7 @@ else {
|
|
|
1861
1873
|
return s ? __stxDevtoolsClassify(s) : null;
|
|
1862
1874
|
},
|
|
1863
1875
|
};
|
|
1864
|
-
`;var
|
|
1876
|
+
`;var be=` // ==========================================================================
|
|
1865
1877
|
// Auto-initialization
|
|
1866
1878
|
// ==========================================================================
|
|
1867
1879
|
|
|
@@ -2536,7 +2548,7 @@ finally {
|
|
|
2536
2548
|
const names = __stxNamesIn(body);
|
|
2537
2549
|
// A layered view answers from its layers directly: through the proxy,
|
|
2538
2550
|
// each name cost a trap and a fresh property descriptor.
|
|
2539
|
-
const own = __stxOwnOf.get(scope);
|
|
2551
|
+
const own = __stxOwnOf.get(__stxUnwrapTargetOf.get(scope) || scope);
|
|
2540
2552
|
for (let i = 0; i < names.length; i++) {
|
|
2541
2553
|
if (own !== undefined ? __stxLayerOf(own, names[i]) !== null : Object.prototype.propertyIsEnumerable.call(scope, names[i])) keys.push(names[i]);
|
|
2542
2554
|
}
|
|
@@ -2973,12 +2985,12 @@ catch (e) {
|
|
|
2973
2985
|
}
|
|
2974
2986
|
throw e;
|
|
2975
2987
|
}
|
|
2976
|
-
}`;function Ae(e,
|
|
2988
|
+
}`;function Ae(e,o){return` // ==========================================================================
|
|
2977
2989
|
// Declarative Data Fetching (Feature #6 - useFetch)
|
|
2978
2990
|
// ==========================================================================
|
|
2979
2991
|
|
|
2980
2992
|
var readHydratedData = ${e};
|
|
2981
|
-
var clearServerData = ${
|
|
2993
|
+
var clearServerData = ${o};
|
|
2982
2994
|
|
|
2983
2995
|
function useFetch(urlOrFn, options = {}) {
|
|
2984
2996
|
const hydrated = readHydratedData(options.key, options.hydrate !== false, options.transform);
|
|
@@ -3297,6 +3309,9 @@ else {
|
|
|
3297
3309
|
templateContent = wrapper;
|
|
3298
3310
|
}
|
|
3299
3311
|
|
|
3312
|
+
// The native row plan: undefined until the first row asks for it, null
|
|
3313
|
+
// where this template keeps the generic path.
|
|
3314
|
+
let rowPlan;
|
|
3300
3315
|
let currentElements = [];
|
|
3301
3316
|
// One entry per list item, each holding EVERY node that item rendered.
|
|
3302
3317
|
// currentElements stays flat for transition snapshots, but the keyed
|
|
@@ -3773,6 +3788,37 @@ catch (e) {
|
|
|
3773
3788
|
signals.index.set(i);
|
|
3774
3789
|
}
|
|
3775
3790
|
} else {
|
|
3791
|
+
// A native screen builds its rows from a plan of the template, made
|
|
3792
|
+
// with the first row (signals-native-row-runtime). A row is bound
|
|
3793
|
+
// before it is inserted, so it reaches the host whole.
|
|
3794
|
+
if (rowPlan === undefined) {
|
|
3795
|
+
// A native :for is a template holding the row; a plan covers a
|
|
3796
|
+
// template of one element (the usual row) or a bare element.
|
|
3797
|
+
const rowTemplate = isTemplate
|
|
3798
|
+
? (templateContent.childNodes.length === 1 ? templateContent.childNodes[0] : null)
|
|
3799
|
+
: templateContent;
|
|
3800
|
+
rowPlan = stxHost.isNative && typeof planNativeRow === 'function' && typeof stxHost.cloneElement === 'function'
|
|
3801
|
+
&& rowTemplate && !slotScopeInfo && !componentSetupTemplates.length ? planNativeRow(rowTemplate) : null;
|
|
3802
|
+
}
|
|
3803
|
+
if (rowPlan && !tgIsGroup) {
|
|
3804
|
+
const plannedItem = state(list[i]);
|
|
3805
|
+
plannedItem._isStxLoopItem = true;
|
|
3806
|
+
const plannedIndex = state(i);
|
|
3807
|
+
const plannedScope = layerTemplateScopes(globalHelpers, passedScope, capturedScope || {});
|
|
3808
|
+
Object.defineProperty(plannedScope, itemName, { value: plannedItem, writable: true, enumerable: true, configurable: true });
|
|
3809
|
+
if (indexName) Object.defineProperty(plannedScope, indexName, { value: plannedIndex, writable: true, enumerable: true, configurable: true });
|
|
3810
|
+
const created = createNativeRow(rowPlan, plannedScope, parent);
|
|
3811
|
+
markLoopRow(created.root, itemName, plannedItem);
|
|
3812
|
+
const plannedRow = isTemplate
|
|
3813
|
+
? [stxHost.anchor('stx-for-item-start'), created.root, stxHost.anchor('stx-for-item-end')]
|
|
3814
|
+
: [created.root];
|
|
3815
|
+
plannedRow.__stx_signals = { item: plannedItem, index: plannedIndex };
|
|
3816
|
+
for (let pi = 0; pi < plannedRow.length; pi++) stxHost.insert(parent, plannedRow[pi], cursor || placeholder);
|
|
3817
|
+
finishNativeRow(created);
|
|
3818
|
+
newElements.push(...plannedRow);
|
|
3819
|
+
newGroups.push(plannedRow);
|
|
3820
|
+
continue;
|
|
3821
|
+
}
|
|
3776
3822
|
// New item \u2014 create DOM elements with a fresh item signal
|
|
3777
3823
|
const elements = createItemElements(list[i], i, key);
|
|
3778
3824
|
elements.forEach(el => {
|
|
@@ -3861,6 +3907,631 @@ catch (e) {
|
|
|
3861
3907
|
if (tgIsGroup) parent.__stx_tg_init = true;
|
|
3862
3908
|
});
|
|
3863
3909
|
}
|
|
3910
|
+
`;var Ie=` // ==========================================================================
|
|
3911
|
+
// Native row plans
|
|
3912
|
+
// ==========================================================================
|
|
3913
|
+
|
|
3914
|
+
var __STX_ROW_GENERIC_ATTRS = { 'stx-hydrate': 1, 'data-stx-memo': 1, 'data-stx-suspense': 1, 'x-data': 1, 'data-stx-xdata': 1, ref: 1, 'data-stx-ref': 1, 'data-stx-lazy': 1, 'data-stx-slot-scope': 1 };
|
|
3915
|
+
var __STX_ROW_SKIPPED_EVENTS = { if: 1, for: 1, show: 1, model: 1, class: 1, style: 1, text: 1, html: 1, ref: 1 };
|
|
3916
|
+
var __STX_ROW_CONTROL_ATTRS = { value: 1, checked: 1, selected: 1, indeterminate: 1 };
|
|
3917
|
+
var __STX_IDENT = /^[A-Za-z_$][\\w$]*$/;
|
|
3918
|
+
var __STX_QUOTED = /'(?:[^'\\\\]|\\\\.)*'|"(?:[^"\\\\]|\\\\.)*"/g;
|
|
3919
|
+
var __STX_KEYWORDS = { return: 1, true: 1, false: 1, null: 1, typeof: 1, instanceof: 1, new: 1, this: 1, void: 1, in: 1, of: 1, delete: 1, function: 1, var: 1, let: 1, const: 1, if: 1, else: 1 };
|
|
3920
|
+
|
|
3921
|
+
function __stxAlwaysVisible() { return true; }
|
|
3922
|
+
|
|
3923
|
+
// A plan for rows cloned from \`template\`, or null where the generic path
|
|
3924
|
+
// has to make them.
|
|
3925
|
+
function planNativeRow(template) {
|
|
3926
|
+
if (!template || template.nodeType !== 1 || !template.attributes) return null;
|
|
3927
|
+
// Two scopes a row reads from: its own (bindings inside the row) and, for
|
|
3928
|
+
// a component, its caller's (the props the caller passes). Each keeps the
|
|
3929
|
+
// names its expressions mention and the functions compiled per shape.
|
|
3930
|
+
var plan = { sites: [], eval: rowGroup(), prop: rowGroup(), props: null, component: false, scopeId: null, setup: null, root: null };
|
|
3931
|
+
if (template.hasAttribute('data-stx-scope')) {
|
|
3932
|
+
plan.component = true;
|
|
3933
|
+
plan.scopeId = template.getAttribute('data-stx-template-scope') || template.getAttribute('data-stx-scope');
|
|
3934
|
+
var setups = window.__stx_componentSetups;
|
|
3935
|
+
plan.setup = setups && setups[plan.scopeId];
|
|
3936
|
+
if (typeof plan.setup !== 'function') return null;
|
|
3937
|
+
}
|
|
3938
|
+
try {
|
|
3939
|
+
plan.root = planRowNode(plan, template, true, false);
|
|
3940
|
+
}
|
|
3941
|
+
catch (e) {
|
|
3942
|
+
return null;
|
|
3943
|
+
}
|
|
3944
|
+
return plan.root ? plan : null;
|
|
3945
|
+
}
|
|
3946
|
+
|
|
3947
|
+
function rowGroup() {
|
|
3948
|
+
return { names: [], nameIndex: {}, shapes: new Map() };
|
|
3949
|
+
}
|
|
3950
|
+
|
|
3951
|
+
function planRowSite(plan, raw, kind) {
|
|
3952
|
+
var expr = raw.indexOf('&') === -1 ? raw : raw.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'");
|
|
3953
|
+
// The same body text each path compiles, so the functions are the ones
|
|
3954
|
+
// the generic path would have made.
|
|
3955
|
+
var body = kind === 'attr' || kind === 'text' || kind === 'prop' ? 'return (' + expr + ')'
|
|
3956
|
+
: kind === 'if' ? 'return ' + expr + ''
|
|
3957
|
+
: 'return ' + raw;
|
|
3958
|
+
var source = kind === 'attr' || kind === 'text' || kind === 'if' ? expr : raw;
|
|
3959
|
+
var group = kind === 'prop' ? plan.prop : plan.eval;
|
|
3960
|
+
if (parsePipeExpression(source, {}) !== null) throw new Error('pipe');
|
|
3961
|
+
if (plan.component && raw.indexOf(plan.scopeId) !== -1) throw new Error('scope id in an expression');
|
|
3962
|
+
// The names the expression can read: not the words of its quoted strings
|
|
3963
|
+
// (a class list in a ternary) nor keywords, which every row would
|
|
3964
|
+
// otherwise look up in its scope for nothing.
|
|
3965
|
+
var names = __stxNamesIn(source.replace(__STX_QUOTED, ' ')).filter(function(k) {
|
|
3966
|
+
return !__STX_KEYWORDS[k] && /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k);
|
|
3967
|
+
});
|
|
3968
|
+
for (var i = 0; i < names.length; i++) {
|
|
3969
|
+
if (group.nameIndex[names[i]] === undefined) {
|
|
3970
|
+
group.nameIndex[names[i]] = group.names.length;
|
|
3971
|
+
group.names.push(names[i]);
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3974
|
+
var site = { index: plan.sites.length, kind: kind, group: group, expr: source, body: body, names: names, placeholder: /^__[A-Z_]+__$/.test(source.trim()), ident: __STX_IDENT.test(source.trim()), handler: null };
|
|
3975
|
+
plan.sites.push(site);
|
|
3976
|
+
return site;
|
|
3977
|
+
}
|
|
3978
|
+
|
|
3979
|
+
// One element of the template: its bindings, the attributes a row's copy
|
|
3980
|
+
// keeps, and its children. Throws where the template needs the generic path;
|
|
3981
|
+
// returns { generic: true } for an :if branch whose content does.
|
|
3982
|
+
function planRowNode(plan, tmpl, isRoot, inBranch) {
|
|
3983
|
+
var node = { tmpl: tmpl, attrs: [], ops: [], children: [], ifSite: null, generic: false, inert: false, remap: [] };
|
|
3984
|
+
var attrs = getElementAttributes(tmpl);
|
|
3985
|
+
var parentEvents = __stxWords(tmpl.getAttribute('data-stx-parent-events') || '');
|
|
3986
|
+
var parentBindings = isRoot && plan.component ? __stxWords(tmpl.getAttribute('data-stx-parent-bindings') || '') : [];
|
|
3987
|
+
// A component's props, as bindParentComponentProps reads them: each
|
|
3988
|
+
// parent binding from its :name attribute, else from the bindings an
|
|
3989
|
+
// enclosing loop deferred (data-stx-deferred-parent-bindings). What the
|
|
3990
|
+
// row leaves deferred is the same for every row.
|
|
3991
|
+
var deferredProps = null;
|
|
3992
|
+
if (isRoot && plan.component) {
|
|
3993
|
+
plan.props = [];
|
|
3994
|
+
deferredProps = readDeferredParentComponentProps(tmpl);
|
|
3995
|
+
for (var b = 0; b < parentBindings.length; b++) {
|
|
3996
|
+
var propName = parentBindings[b];
|
|
3997
|
+
var propExpression = tmpl.hasAttribute(':' + propName) ? tmpl.getAttribute(':' + propName) : deferredProps[propName];
|
|
3998
|
+
if (typeof propExpression !== 'string') continue;
|
|
3999
|
+
plan.props.push({ name: propName, site: planRowSite(plan, propExpression, 'prop') });
|
|
4000
|
+
delete deferredProps[propName];
|
|
4001
|
+
}
|
|
4002
|
+
}
|
|
4003
|
+
var generic = false;
|
|
4004
|
+
for (var i = 0; i < attrs.length; i++) {
|
|
4005
|
+
var name = attrs[i].name;
|
|
4006
|
+
var value = attrs[i].value;
|
|
4007
|
+
if (!name) continue;
|
|
4008
|
+
if (name === ':if' || name === '@if') {
|
|
4009
|
+
if (isRoot) throw new Error('root if');
|
|
4010
|
+
if (getElseAttrInfo(tmpl.nextElementSibling)) throw new Error('if chain');
|
|
4011
|
+
node.ifSite = planRowSite(plan, value, 'if');
|
|
4012
|
+
continue;
|
|
4013
|
+
}
|
|
4014
|
+
if (name === 'x-if' || getElseAttrInfo(tmpl)) throw new Error('chain');
|
|
4015
|
+
if ((name === ':for' || name === '@for' || name === 'x-for') && isForDirectiveExpression(value)) throw new Error('nested for');
|
|
4016
|
+
if (name === 'x-cloak') continue;
|
|
4017
|
+
if (name === 'data-stx-scope' || name === 'data-stx-template-scope') {
|
|
4018
|
+
if (!isRoot) throw new Error('nested component');
|
|
4019
|
+
continue;
|
|
4020
|
+
}
|
|
4021
|
+
if (__STX_ROW_GENERIC_ATTRS[name] || name.startsWith('::') || name.startsWith('x-') || name.startsWith('@bind:')) { generic = true; continue; }
|
|
4022
|
+
if (name.charCodeAt(0) === 58) {
|
|
4023
|
+
var bound = name.slice(1);
|
|
4024
|
+
var base = bound.split('.')[0];
|
|
4025
|
+
if (base === 'class' || base === 'style' || base === 'text') {
|
|
4026
|
+
if (name !== ':' + base) { generic = true; continue; }
|
|
4027
|
+
node.ops.push({ kind: base, site: planRowSite(plan, value, base) });
|
|
4028
|
+
if (base === 'text') node.inert = true;
|
|
4029
|
+
continue;
|
|
4030
|
+
}
|
|
4031
|
+
if (DIRECTIVE_NAMES[base] || EVENT_RE.test(bound)) { generic = true; continue; }
|
|
4032
|
+
if (isRoot && plan.component && parentBindings.indexOf(bound) !== -1) continue;
|
|
4033
|
+
if ((__STX_ROW_CONTROL_ATTRS[bound] && bound in tmpl) || (bound === 'src' && tmpl.tagName === 'IFRAME')) { generic = true; continue; }
|
|
4034
|
+
node.ops.push({ kind: 'attr', attrName: bound, site: planRowSite(plan, value, 'attr') });
|
|
4035
|
+
continue;
|
|
4036
|
+
}
|
|
4037
|
+
if (name.charCodeAt(0) === 64) {
|
|
4038
|
+
if (name === '@class' || name === '@style' || name === '@text') {
|
|
4039
|
+
var directive = name.slice(1);
|
|
4040
|
+
node.ops.push({ kind: directive, site: planRowSite(plan, value, directive) });
|
|
4041
|
+
if (directive === 'text') node.inert = true;
|
|
4042
|
+
continue;
|
|
4043
|
+
}
|
|
4044
|
+
var parts = name.slice(1).split('.');
|
|
4045
|
+
var eventName = parentEvents.find(function(event) { return event.toLowerCase() === parts[0].toLowerCase(); }) || parts[0];
|
|
4046
|
+
if (__STX_ROW_SKIPPED_EVENTS[eventName]) { generic = true; continue; }
|
|
4047
|
+
if (plan.component && value.indexOf(plan.scopeId) !== -1) throw new Error('scope id in a handler');
|
|
4048
|
+
node.ops.push({
|
|
4049
|
+
kind: 'event',
|
|
4050
|
+
eventName: eventName,
|
|
4051
|
+
modifiers: parts.slice(1),
|
|
4052
|
+
value: value,
|
|
4053
|
+
key: '__stx_evt_' + eventName + '_' + value.substring(0, 20),
|
|
4054
|
+
forwarded: isRoot && plan.component && parentEvents.indexOf(eventName) !== -1,
|
|
4055
|
+
});
|
|
4056
|
+
continue;
|
|
4057
|
+
}
|
|
4058
|
+
if (deferredProps && name === 'data-stx-deferred-parent-bindings' && plan.props.length) {
|
|
4059
|
+
if (Object.keys(deferredProps).length) node.attrs.push({ name: name, value: JSON.stringify(deferredProps) });
|
|
4060
|
+
continue;
|
|
4061
|
+
}
|
|
4062
|
+
if (plan.component && typeof value === 'string' && value.indexOf(plan.scopeId) !== -1) node.remap.push(node.attrs.length);
|
|
4063
|
+
node.attrs.push(attrs[i]);
|
|
4064
|
+
}
|
|
4065
|
+
if (generic) {
|
|
4066
|
+
if (!inBranch || !node.ifSite) throw new Error('generic content');
|
|
4067
|
+
return { tmpl: tmpl, generic: true, ifSite: node.ifSite };
|
|
4068
|
+
}
|
|
4069
|
+
var kids = tmpl.childNodes || [];
|
|
4070
|
+
for (var k = 0; k < kids.length; k++) {
|
|
4071
|
+
var child = kids[k];
|
|
4072
|
+
if (child.nodeType !== 1 || child.tagName === 'SCRIPT' || child.tagName === 'TEMPLATE' || child.__stx_scope) throw new Error('child kind');
|
|
4073
|
+
var hasIf = child.hasAttribute(':if') || child.hasAttribute('@if');
|
|
4074
|
+
node.children.push(planRowNode(plan, child, false, hasIf));
|
|
4075
|
+
}
|
|
4076
|
+
return node;
|
|
4077
|
+
}
|
|
4078
|
+
|
|
4079
|
+
// Which of the plan's names this row's scope holds, and the functions
|
|
4080
|
+
// compiled for that answer. Rows of one loop nearly always share one.
|
|
4081
|
+
function rowShape(group, own, layers) {
|
|
4082
|
+
var names = group.names;
|
|
4083
|
+
var signature = '';
|
|
4084
|
+
for (var i = 0; i < names.length; i++) {
|
|
4085
|
+
var layer = __stxLayerOf(own, names[i]);
|
|
4086
|
+
layers[i] = layer;
|
|
4087
|
+
signature += layer === null ? '0' : '1';
|
|
4088
|
+
}
|
|
4089
|
+
var shape = group.shapes.get(signature);
|
|
4090
|
+
if (!shape) {
|
|
4091
|
+
shape = { signature: signature, compiled: [] };
|
|
4092
|
+
group.shapes.set(signature, shape);
|
|
4093
|
+
}
|
|
4094
|
+
return shape;
|
|
4095
|
+
}
|
|
4096
|
+
|
|
4097
|
+
// How the expression uses a name its scope holds, worked out when a row
|
|
4098
|
+
// first evaluates it: a prop's scope keeps a signal its expression calls or
|
|
4099
|
+
// uses as a signal (createAutoUnwrapProxy's rule), everything else follows
|
|
4100
|
+
// the expression (StxAutoUnwrapHandler's).
|
|
4101
|
+
function rowSignalUse(site, name) {
|
|
4102
|
+
return site.kind === 'prop'
|
|
4103
|
+
? (expressionCallsSignal(site.expr, name) || expressionUsesSignalApi(site.expr, name) ? 1 : 0)
|
|
4104
|
+
: expressionSignalUse(site.expr, name);
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
function compileRowSite(site, shape) {
|
|
4108
|
+
var nameIndex = site.group.nameIndex;
|
|
4109
|
+
var keys = [];
|
|
4110
|
+
var uses = [];
|
|
4111
|
+
for (var i = 0; i < site.names.length; i++) {
|
|
4112
|
+
if (shape.signature.charCodeAt(nameIndex[site.names[i]]) === 49) {
|
|
4113
|
+
keys.push(site.names[i]);
|
|
4114
|
+
uses.push(rowSignalUse(site, site.names[i]));
|
|
4115
|
+
}
|
|
4116
|
+
}
|
|
4117
|
+
var slots = keys.map(function(key) { return nameIndex[key]; });
|
|
4118
|
+
var compiled = { keys: keys, slots: slots, uses: uses, fn: null, error: null };
|
|
4119
|
+
try { compiled.fn = __stxCompile(keys, site.body); }
|
|
4120
|
+
catch (e) { compiled.error = e; }
|
|
4121
|
+
shape.compiled[site.index] = compiled;
|
|
4122
|
+
return compiled;
|
|
4123
|
+
}
|
|
4124
|
+
|
|
4125
|
+
function readRowScope(own, key) {
|
|
4126
|
+
var layer = __stxLayerOf(own, key);
|
|
4127
|
+
return layer === null ? own[key] : layer[key];
|
|
4128
|
+
}
|
|
4129
|
+
|
|
4130
|
+
// What the expression's auto-unwrap proxy would hand the function for one
|
|
4131
|
+
// name (StxAutoUnwrapHandler.get with the expression).
|
|
4132
|
+
function unwrapRowValue(site, value, use) {
|
|
4133
|
+
if (value && typeof value === 'function' && (value._isSignal || value._isDerived)) {
|
|
4134
|
+
if (value._isStxLoopItem) return value();
|
|
4135
|
+
if (use === 1) return value;
|
|
4136
|
+
if (use === 0) return value();
|
|
4137
|
+
var keep;
|
|
4138
|
+
try {
|
|
4139
|
+
var current = value();
|
|
4140
|
+
keep = !(current && typeof current === 'object' && Object.prototype.hasOwnProperty.call(current, 'value'));
|
|
4141
|
+
}
|
|
4142
|
+
catch (e) { keep = true; }
|
|
4143
|
+
return keep ? value : value();
|
|
4144
|
+
}
|
|
4145
|
+
if (value && typeof value === 'object' && value._isStxStore) {
|
|
4146
|
+
if (!site.handler) {
|
|
4147
|
+
var expr = site.expr;
|
|
4148
|
+
site.handler = site.kind === 'prop'
|
|
4149
|
+
? new StxAutoUnwrapHandler(function(prop) { return typeof prop === 'string' && (expressionCallsSignal(expr, prop) || expressionUsesSignalApi(expr, prop)); }, null)
|
|
4150
|
+
: new StxAutoUnwrapHandler(null, expr);
|
|
4151
|
+
}
|
|
4152
|
+
return new Proxy(value, site.handler);
|
|
4153
|
+
}
|
|
4154
|
+
return value;
|
|
4155
|
+
}
|
|
4156
|
+
|
|
4157
|
+
// An expression evaluated as its generic path does: through the unwrapping
|
|
4158
|
+
// scope first, then the raw scope, then reported and replaced by \`fallback\`.
|
|
4159
|
+
// \`at\`: the scope the site reads, as the row found it (row.local or row.caller).
|
|
4160
|
+
function evaluateRowSite(at, site, el, fallback, subscribe) {
|
|
4161
|
+
if (site.placeholder) return site.expr;
|
|
4162
|
+
var compiled = at.shape.compiled[site.index] || compileRowSite(site, at.shape);
|
|
4163
|
+
var keys = compiled.keys;
|
|
4164
|
+
var layers = at.layers;
|
|
4165
|
+
var raw = new Array(keys.length);
|
|
4166
|
+
var args = new Array(keys.length);
|
|
4167
|
+
for (var i = 0; i < keys.length; i++) {
|
|
4168
|
+
// The layer holding each name was found once for the row (rowShape):
|
|
4169
|
+
// the layers are the row's own objects and the scopes it was given.
|
|
4170
|
+
var value = layers[compiled.slots[i]][keys[i]];
|
|
4171
|
+
raw[i] = value;
|
|
4172
|
+
if (subscribe && value && typeof value === 'function' && (value._isSignal || value._isDerived)) value();
|
|
4173
|
+
args[i] = unwrapRowValue(site, value, compiled.uses[i]);
|
|
4174
|
+
}
|
|
4175
|
+
if (compiled.fn) {
|
|
4176
|
+
try {
|
|
4177
|
+
var result = compiled.fn.apply(null, args);
|
|
4178
|
+
if (site.kind === 'attr' || site.kind === 'text') {
|
|
4179
|
+
if (result && typeof result === 'function' && (result._isSignal || result._isDerived)) result = result();
|
|
4180
|
+
noteExprSuccess(site.expr);
|
|
4181
|
+
}
|
|
4182
|
+
return result;
|
|
4183
|
+
}
|
|
4184
|
+
catch (e1) {
|
|
4185
|
+
try {
|
|
4186
|
+
var retried = compiled.fn.apply(null, raw);
|
|
4187
|
+
if (site.kind === 'attr' || site.kind === 'text') {
|
|
4188
|
+
if (retried && typeof retried === 'function' && (retried._isSignal || retried._isDerived)) retried = retried();
|
|
4189
|
+
noteExprSuccess(site.expr);
|
|
4190
|
+
}
|
|
4191
|
+
return retried;
|
|
4192
|
+
}
|
|
4193
|
+
catch (e2) {
|
|
4194
|
+
return failRowSite(at, site, el, e2, fallback);
|
|
4195
|
+
}
|
|
4196
|
+
}
|
|
4197
|
+
}
|
|
4198
|
+
return failRowSite(at, site, el, compiled.error, fallback);
|
|
4199
|
+
}
|
|
4200
|
+
|
|
4201
|
+
function failRowSite(at, site, el, error, fallback) {
|
|
4202
|
+
reportUnknownBinding(error, site.expr, at.scope, el);
|
|
4203
|
+
if (site.kind === 'prop') {
|
|
4204
|
+
if (!(error instanceof ReferenceError) && !(error instanceof TypeError)) console.warn('[STX] Parent component prop error:', site.expr, error);
|
|
4205
|
+
return fallback;
|
|
4206
|
+
}
|
|
4207
|
+
var label = site.kind === 'attr' || site.kind === 'text' ? '[STX] Attribute expression error:'
|
|
4208
|
+
: site.kind === 'style' ? '[STX] Style expression error:'
|
|
4209
|
+
: site.kind === 'class' ? '[STX] Class expression error:' : '[STX] Expression error:';
|
|
4210
|
+
if (!(error instanceof ReferenceError) && !(error instanceof TypeError)) console.warn(label, site.expr, error);
|
|
4211
|
+
else if (site.kind === 'attr' || site.kind === 'text') noteExprFailure(site.expr, error);
|
|
4212
|
+
return fallback;
|
|
4213
|
+
}
|
|
4214
|
+
|
|
4215
|
+
// The visibility gates an element's attribute bindings wait on: every :if
|
|
4216
|
+
// around it, the row's own and those around the loop.
|
|
4217
|
+
function rowVisibility(el, row) {
|
|
4218
|
+
var gates = [];
|
|
4219
|
+
for (var node = el; node; node = node.parentNode) {
|
|
4220
|
+
if (node.__stx_if_visible) gates.push(node.__stx_if_visible);
|
|
4221
|
+
if (node === row.root && !node.parentNode) {
|
|
4222
|
+
for (var i = 0; i < row.outer.length; i++) gates.push(row.outer[i]);
|
|
4223
|
+
break;
|
|
4224
|
+
}
|
|
4225
|
+
}
|
|
4226
|
+
if (!gates.length) return __stxAlwaysVisible;
|
|
4227
|
+
if (gates.length === 1) { var gate = gates[0]; return function() { return gate(); }; }
|
|
4228
|
+
return function() {
|
|
4229
|
+
for (var g = 0; g < gates.length; g++) if (!gates[g]()) return false;
|
|
4230
|
+
return true;
|
|
4231
|
+
};
|
|
4232
|
+
}
|
|
4233
|
+
|
|
4234
|
+
// The nodes of one planned element, children placed and :if children
|
|
4235
|
+
// given their anchors, nothing bound yet.
|
|
4236
|
+
function buildRowNode(pnode, row) {
|
|
4237
|
+
var el = stxHost.cloneElement(pnode.tmpl, pnode.attrs);
|
|
4238
|
+
for (var r = 0; r < pnode.remap.length; r++) {
|
|
4239
|
+
var attribute = pnode.attrs[pnode.remap[r]];
|
|
4240
|
+
el.setAttribute(attribute.name, attribute.value.split(row.plan.scopeId).join(row.scopeId));
|
|
4241
|
+
}
|
|
4242
|
+
var kids = new Array(pnode.children.length);
|
|
4243
|
+
for (var i = 0; i < pnode.children.length; i++) {
|
|
4244
|
+
var child = pnode.children[i];
|
|
4245
|
+
var made;
|
|
4246
|
+
if (child.ifSite) {
|
|
4247
|
+
made = { pnode: child, el: null, anchor: stxHost.anchor('stx-if') };
|
|
4248
|
+
stxHost.append(el, made.anchor);
|
|
4249
|
+
}
|
|
4250
|
+
else {
|
|
4251
|
+
made = buildRowNode(child, row);
|
|
4252
|
+
stxHost.append(el, made.el);
|
|
4253
|
+
}
|
|
4254
|
+
kids[i] = made;
|
|
4255
|
+
}
|
|
4256
|
+
return { pnode: pnode, el: el, kids: kids, anchor: null };
|
|
4257
|
+
}
|
|
4258
|
+
|
|
4259
|
+
function bindRowNode(made, row) {
|
|
4260
|
+
var pnode = made.pnode;
|
|
4261
|
+
var el = made.el;
|
|
4262
|
+
var ops = pnode.ops;
|
|
4263
|
+
var visible = null;
|
|
4264
|
+
var urlWarning = null;
|
|
4265
|
+
for (var i = 0; i < ops.length; i++) {
|
|
4266
|
+
var op = ops[i];
|
|
4267
|
+
if (op.kind === 'attr') {
|
|
4268
|
+
if (!visible) visible = rowVisibility(el, row);
|
|
4269
|
+
if (!urlWarning) urlWarning = { warned: false };
|
|
4270
|
+
bindRowAttribute(el, op, row, visible, urlWarning);
|
|
4271
|
+
}
|
|
4272
|
+
else if (op.kind === 'class') {
|
|
4273
|
+
if (!visible) visible = rowVisibility(el, row);
|
|
4274
|
+
bindRowClass(el, op.site, row, visible);
|
|
4275
|
+
}
|
|
4276
|
+
else if (op.kind === 'style') {
|
|
4277
|
+
if (!visible) visible = rowVisibility(el, row);
|
|
4278
|
+
bindRowStyle(el, op.site, row, visible);
|
|
4279
|
+
}
|
|
4280
|
+
else if (op.kind === 'text') {
|
|
4281
|
+
el.__stx_inert_content = true;
|
|
4282
|
+
bindRowText(el, op.site, row);
|
|
4283
|
+
}
|
|
4284
|
+
else if (op.kind === 'event') {
|
|
4285
|
+
if (el[op.key]) continue;
|
|
4286
|
+
el[op.key] = true;
|
|
4287
|
+
var forwarded = op.forwarded && !!el.__stx_parent_scope;
|
|
4288
|
+
listenTemplateEvent(el, op.eventName, op.modifiers, op.value,
|
|
4289
|
+
forwarded ? layerTemplateScopes(globalHelpers, el.__stx_parent_scope) : row.evalScope, forwarded);
|
|
4290
|
+
}
|
|
4291
|
+
}
|
|
4292
|
+
if (pnode.inert) return;
|
|
4293
|
+
for (var k = 0; k < made.kids.length; k++) {
|
|
4294
|
+
var kid = made.kids[k];
|
|
4295
|
+
if (kid.anchor) bindRowIf(kid, made.el, row);
|
|
4296
|
+
else bindRowNode(kid, row);
|
|
4297
|
+
}
|
|
4298
|
+
}
|
|
4299
|
+
|
|
4300
|
+
function bindRowAttribute(el, op, row, visible, urlWarning) {
|
|
4301
|
+
effect(function() {
|
|
4302
|
+
if (!visible()) return;
|
|
4303
|
+
applyBoundAttribute(el, op.attrName, evaluateRowSite(row.local, op.site, el, ''), visible, urlWarning);
|
|
4304
|
+
});
|
|
4305
|
+
}
|
|
4306
|
+
|
|
4307
|
+
function bindRowText(el, site, row) {
|
|
4308
|
+
effect(function() { stxHost.setText(el, evaluateRowSite(row.local, site, el, '')); });
|
|
4309
|
+
}
|
|
4310
|
+
|
|
4311
|
+
function bindRowStyle(el, site, row, visible) {
|
|
4312
|
+
effect(function() {
|
|
4313
|
+
if (!visible()) return;
|
|
4314
|
+
stxHost.setStyle(el, evaluateRowSite(row.local, site, el, {}), true);
|
|
4315
|
+
});
|
|
4316
|
+
}
|
|
4317
|
+
|
|
4318
|
+
// bindClass, reading its names through the row's scope.
|
|
4319
|
+
function bindRowClass(el, site, row, visible) {
|
|
4320
|
+
var originalClasses = el.className;
|
|
4321
|
+
effect(function() {
|
|
4322
|
+
if (!visible()) return;
|
|
4323
|
+
var value = evaluateRowSite(row.local, site, el, '', true);
|
|
4324
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
4325
|
+
Object.keys(value).forEach(function(cls) {
|
|
4326
|
+
var tokens = cls.split(/\\s+/).filter(Boolean);
|
|
4327
|
+
if (value[cls]) tokens.forEach(function(t) { el.classList.add(t); });
|
|
4328
|
+
else tokens.forEach(function(t) { el.classList.remove(t); });
|
|
4329
|
+
});
|
|
4330
|
+
}
|
|
4331
|
+
else if (Array.isArray(value)) {
|
|
4332
|
+
el.className = [originalClasses, value.filter(Boolean).join(' ')].filter(Boolean).join(' ');
|
|
4333
|
+
}
|
|
4334
|
+
else {
|
|
4335
|
+
el.className = [originalClasses, value || ''].filter(Boolean).join(' ');
|
|
4336
|
+
}
|
|
4337
|
+
});
|
|
4338
|
+
}
|
|
4339
|
+
|
|
4340
|
+
// bindIf for an element of a planned row. Its element is made the first
|
|
4341
|
+
// time it shows, rather than cloned with the row and removed again.
|
|
4342
|
+
function bindRowIf(made, parentEl, row) {
|
|
4343
|
+
var pnode = made.pnode;
|
|
4344
|
+
var site = pnode.ifSite;
|
|
4345
|
+
var placeholder = made.anchor;
|
|
4346
|
+
var parent = parentEl;
|
|
4347
|
+
var el = null;
|
|
4348
|
+
var isInserted = false;
|
|
4349
|
+
var childrenProcessed = false;
|
|
4350
|
+
var firstRun = true;
|
|
4351
|
+
var direct = site.ident ? readRowScope(row.local.own, site.expr.trim()) : null;
|
|
4352
|
+
var directSignal = direct && (direct._isSignal || direct._isDerived) ? direct : null;
|
|
4353
|
+
effect(function() {
|
|
4354
|
+
parent = followPlaceholder(placeholder, parent, el ? [el] : []);
|
|
4355
|
+
var value = directSignal ? directSignal() : evaluateRowSite(row.local, site, null, '');
|
|
4356
|
+
var initial = firstRun;
|
|
4357
|
+
firstRun = false;
|
|
4358
|
+
if (!el) {
|
|
4359
|
+
if (!value) return;
|
|
4360
|
+
el = makeRowBranch(pnode, row);
|
|
4361
|
+
made.el = el;
|
|
4362
|
+
if (initial) {
|
|
4363
|
+
// Shown from the start: placed as the generic path's clone was.
|
|
4364
|
+
stxHost.insert(parent, el, placeholder.nextSibling);
|
|
4365
|
+
isInserted = true;
|
|
4366
|
+
}
|
|
4367
|
+
}
|
|
4368
|
+
stxHost.setVisible(el, !!value);
|
|
4369
|
+
if (value && !isInserted) {
|
|
4370
|
+
stxHost.insert(parent, el, placeholder.nextSibling);
|
|
4371
|
+
if (parent && parent.__stx_detached_if) parent.__stx_detached_if.delete(el);
|
|
4372
|
+
el.__stx_if_visible.set(true);
|
|
4373
|
+
el.__stx_shown_at = performance.now();
|
|
4374
|
+
isInserted = true;
|
|
4375
|
+
peek(resumeDetachedBranches);
|
|
4376
|
+
if (childrenProcessed) {
|
|
4377
|
+
queueMicrotask(function() {
|
|
4378
|
+
if (isInserted) peek(function() { resumeSubtreeScopes([el]); });
|
|
4379
|
+
});
|
|
4380
|
+
}
|
|
4381
|
+
}
|
|
4382
|
+
else if (!value && isInserted) {
|
|
4383
|
+
el.__stx_if_visible.set(false);
|
|
4384
|
+
suspendSubtreeScopes([el]);
|
|
4385
|
+
stxHost.remove(el);
|
|
4386
|
+
if (parent) {
|
|
4387
|
+
if (!parent.__stx_detached_if) parent.__stx_detached_if = new Set();
|
|
4388
|
+
parent.__stx_detached_if.add(el);
|
|
4389
|
+
}
|
|
4390
|
+
isInserted = false;
|
|
4391
|
+
}
|
|
4392
|
+
if (value && isInserted && !childrenProcessed) {
|
|
4393
|
+
childrenProcessed = true;
|
|
4394
|
+
peek(function() { hydrateRowBranch(made, row); });
|
|
4395
|
+
}
|
|
4396
|
+
});
|
|
4397
|
+
}
|
|
4398
|
+
|
|
4399
|
+
function makeRowBranch(pnode, row) {
|
|
4400
|
+
var el;
|
|
4401
|
+
if (pnode.generic) {
|
|
4402
|
+
el = stxHost.clone(pnode.tmpl);
|
|
4403
|
+
el.removeAttribute(':if');
|
|
4404
|
+
el.removeAttribute('@if');
|
|
4405
|
+
if (row.plan.component) remapRowSubtree(el, row);
|
|
4406
|
+
}
|
|
4407
|
+
else {
|
|
4408
|
+
var made = buildRowNode(pnode, row);
|
|
4409
|
+
el = made.el;
|
|
4410
|
+
el.__stx_row_made = made;
|
|
4411
|
+
}
|
|
4412
|
+
el.__stx_if_bound = true;
|
|
4413
|
+
el.__stx_if_visible = state(true);
|
|
4414
|
+
return el;
|
|
4415
|
+
}
|
|
4416
|
+
|
|
4417
|
+
function remapRowSubtree(el, row) {
|
|
4418
|
+
var oldId = row.plan.scopeId;
|
|
4419
|
+
[el].concat(stxHost.descendants(el)).forEach(function(node) {
|
|
4420
|
+
if (!node.attributes) return;
|
|
4421
|
+
getElementAttributes(node).forEach(function(attribute) {
|
|
4422
|
+
if (typeof attribute.value === 'string' && attribute.value.indexOf(oldId) !== -1)
|
|
4423
|
+
node.setAttribute(attribute.name, attribute.value.split(oldId).join(row.scopeId));
|
|
4424
|
+
});
|
|
4425
|
+
});
|
|
4426
|
+
}
|
|
4427
|
+
|
|
4428
|
+
function hydrateRowBranch(made, row) {
|
|
4429
|
+
var el = made.el;
|
|
4430
|
+
var built = el.__stx_row_made;
|
|
4431
|
+
if (built) {
|
|
4432
|
+
el.__stx_row_made = null;
|
|
4433
|
+
el.__stx_if_disposers = trackEffects(function() { bindRowNode(built, row); });
|
|
4434
|
+
resumeDetachedBranches();
|
|
4435
|
+
return;
|
|
4436
|
+
}
|
|
4437
|
+
// Generic content, processed as bindIf's shown branch is: once its row
|
|
4438
|
+
// is on the screen, since the generic walk reads the tree around it.
|
|
4439
|
+
var run = function() {
|
|
4440
|
+
if (!el.isConnected) {
|
|
4441
|
+
if (!row.inserted) { row.after.push(run); return; }
|
|
4442
|
+
var resume = function() { peek(run); };
|
|
4443
|
+
resume.el = el;
|
|
4444
|
+
detachedBranches.add(resume);
|
|
4445
|
+
return;
|
|
4446
|
+
}
|
|
4447
|
+
var wasTracked = !!el.__stx_disposers;
|
|
4448
|
+
if (wasTracked || !el.__stx_disposers)
|
|
4449
|
+
el.__stx_if_disposers = trackEffects(function() { processElement(el, row.evalScope); });
|
|
4450
|
+
resumeDetachedBranches();
|
|
4451
|
+
};
|
|
4452
|
+
run();
|
|
4453
|
+
}
|
|
4454
|
+
|
|
4455
|
+
// The scope a row's expressions read, with the layer each name lives in
|
|
4456
|
+
// found once (rowShape): the layers are the row's own objects and the
|
|
4457
|
+
// scopes it was given, so a read goes straight to the layer.
|
|
4458
|
+
function rowScopeAt(group, scope) {
|
|
4459
|
+
var own = __stxOwnOf.get(scope);
|
|
4460
|
+
var layers = new Array(group.names.length);
|
|
4461
|
+
return { scope: scope, own: own, layers: layers, shape: rowShape(group, own, layers) };
|
|
4462
|
+
}
|
|
4463
|
+
|
|
4464
|
+
// bindParentComponentProps for a planned row: the caller's props, each
|
|
4465
|
+
// evaluated with the function compiled for it, written as the generic
|
|
4466
|
+
// path writes them.
|
|
4467
|
+
function bindRowProps(root, row, callerScope) {
|
|
4468
|
+
root.__stx_parent_props_bound = true;
|
|
4469
|
+
var props = row.plan.props;
|
|
4470
|
+
var caller = row.caller = rowScopeAt(row.plan.prop, layerTemplateScopes(globalHelpers, callerScope));
|
|
4471
|
+
for (var i = 0; i < props.length; i++) bindRowProp(root, props[i], caller);
|
|
4472
|
+
}
|
|
4473
|
+
|
|
4474
|
+
function bindRowProp(root, prop, caller) {
|
|
4475
|
+
var name = prop.name;
|
|
4476
|
+
effect(function() {
|
|
4477
|
+
var value = evaluateRowSite(caller, prop.site, root, undefined);
|
|
4478
|
+
if (value && typeof value === 'function' && (value._isSignal || value._isDerived)) value = value();
|
|
4479
|
+
if (name.startsWith('aria-') && typeof value === 'boolean') stxHost.setAttribute(root, name, String(value));
|
|
4480
|
+
else if (value === null || value === undefined) stxHost.removeAttribute(root, name);
|
|
4481
|
+
else stxHost.setAttribute(root, name, value);
|
|
4482
|
+
syncComponentPropSignal(root, name, value);
|
|
4483
|
+
});
|
|
4484
|
+
}
|
|
4485
|
+
|
|
4486
|
+
// A row of \`plan\`, bound before it is inserted. \`parent\` is where it will
|
|
4487
|
+
// go; the caller inserts it and then calls finishNativeRow.
|
|
4488
|
+
function createNativeRow(plan, itemScope, parent) {
|
|
4489
|
+
var row = { plan: plan, root: null, scope: null, evalScope: null, local: null, caller: null, outer: [], after: [], inserted: false, scopeVars: null, scopeId: null };
|
|
4490
|
+
for (var node = parent; node; node = node.parentNode) if (node.__stx_if_visible) row.outer.push(node.__stx_if_visible);
|
|
4491
|
+
if (plan.component) row.scopeId = plan.scopeId + '_for_' + (++__forComponentScopeCounter);
|
|
4492
|
+
var made = buildRowNode(plan.root, row);
|
|
4493
|
+
var root = made.el;
|
|
4494
|
+
row.root = root;
|
|
4495
|
+
if (plan.component) {
|
|
4496
|
+
if (!root.hasAttribute('data-stx-template-scope')) root.setAttribute('data-stx-template-scope', plan.scopeId);
|
|
4497
|
+
root.setAttribute('data-stx-scope', row.scopeId);
|
|
4498
|
+
if (!(window.stx._scopes && window.stx._scopes[row.scopeId])) runClonedComponentSetup(plan.setup, root);
|
|
4499
|
+
var callerScope = componentCallerScopeFrom(parent, itemScope);
|
|
4500
|
+
root.__stx_parent_scope = callerScope;
|
|
4501
|
+
if (plan.props.length) bindRowProps(root, row, callerScope);
|
|
4502
|
+
var scopeVars = window.stx._scopes && window.stx._scopes[row.scopeId];
|
|
4503
|
+
if (!scopeVars) return { root: root, row: row };
|
|
4504
|
+
scopeVars.__el = root;
|
|
4505
|
+
row.scopeVars = scopeVars;
|
|
4506
|
+
row.scope = layerTemplateScopes(callerScope, scopeVars);
|
|
4507
|
+
// processElement layers the helpers and the component's variables over
|
|
4508
|
+
// this scope for each element; it already starts with the helpers (the
|
|
4509
|
+
// item scope's first layer) and ends with the variables, so the same
|
|
4510
|
+
// names resolve to the same layers through it as it is.
|
|
4511
|
+
row.evalScope = row.scope;
|
|
4512
|
+
}
|
|
4513
|
+
else {
|
|
4514
|
+
row.scope = itemScope;
|
|
4515
|
+
row.evalScope = layerTemplateScopes(globalHelpers, itemScope, findElementScope(parent) || {});
|
|
4516
|
+
}
|
|
4517
|
+
row.local = rowScopeAt(plan.eval, row.evalScope);
|
|
4518
|
+
var dispose = trackEffects(function() { bindRowNode(made, row); });
|
|
4519
|
+
if (plan.component) root.__stx_disposers = dispose;
|
|
4520
|
+
else root.__stx_effect_disposers = dispose;
|
|
4521
|
+
return { root: root, row: row };
|
|
4522
|
+
}
|
|
4523
|
+
|
|
4524
|
+
function finishNativeRow(created) {
|
|
4525
|
+
var row = created.row;
|
|
4526
|
+
row.inserted = true;
|
|
4527
|
+
var scopeVars = row.scopeVars;
|
|
4528
|
+
if (scopeVars && scopeVars.__mountCallbacks && !scopeVars.__mounted) {
|
|
4529
|
+
scopeVars.__mounted = true;
|
|
4530
|
+
runMountCallbacks(scopeVars.__mountCallbacks, scopeDestroySink(scopeVars));
|
|
4531
|
+
}
|
|
4532
|
+
var after = row.after.splice(0, row.after.length);
|
|
4533
|
+
for (var i = 0; i < after.length; i++) after[i]();
|
|
4534
|
+
}
|
|
3864
4535
|
`;var Ce=` // Also expose globally for convenience
|
|
3865
4536
|
window.state = state;
|
|
3866
4537
|
window.derived = derived;
|
|
@@ -3928,7 +4599,7 @@ catch (e) {
|
|
|
3928
4599
|
// Note: SPA Router and View Transitions CSS are provided by the canonical
|
|
3929
4600
|
// router script (packages/router/src/client.ts) which is injected alongside
|
|
3930
4601
|
// the signals runtime or via the @stxRouter directive.
|
|
3931
|
-
`;var
|
|
4602
|
+
`;var Re=` function expressionUsesSignalApi(expression, name) {
|
|
3932
4603
|
var escapedName = name.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');
|
|
3933
4604
|
return expressionUsesSignalMethod(expression, name)
|
|
3934
4605
|
|| expressionUsesSignalValue(expression, name);
|
|
@@ -3949,27 +4620,50 @@ catch (e) {
|
|
|
3949
4620
|
return new RegExp('(?:^|[^\\\\w$])' + escapedName + '\\\\s*\\\\(').test(expression);
|
|
3950
4621
|
}
|
|
3951
4622
|
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
4623
|
+
// What an expression does with a signal it names: calls it, calls one of
|
|
4624
|
+
// its methods, reads its .value, or none of these. It depends only on the
|
|
4625
|
+
// expression and the name, so it is worked out once: three regular
|
|
4626
|
+
// expressions were built for every signal an expression read, every time
|
|
4627
|
+
// it ran.
|
|
4628
|
+
const __stxSignalUse = new Map();
|
|
4629
|
+
function expressionSignalUse(expression, name) {
|
|
4630
|
+
let uses = __stxSignalUse.get(expression);
|
|
4631
|
+
if (uses === undefined) {
|
|
4632
|
+
if (__stxSignalUse.size >= 5000) __stxSignalUse.clear();
|
|
4633
|
+
uses = new Map();
|
|
4634
|
+
__stxSignalUse.set(expression, uses);
|
|
4635
|
+
}
|
|
4636
|
+
let use = uses.get(name);
|
|
4637
|
+
if (use === undefined) {
|
|
4638
|
+
use = expression.indexOf(name) === -1 ? 0
|
|
4639
|
+
: expressionCallsSignal(expression, name) || expressionUsesSignalMethod(expression, name) ? 1
|
|
4640
|
+
: expressionUsesSignalValue(expression, name) ? 2 : 0;
|
|
4641
|
+
uses.set(name, use);
|
|
4642
|
+
}
|
|
4643
|
+
return use;
|
|
4644
|
+
}
|
|
4645
|
+
|
|
4646
|
+
function expressionKeepsSignal(expression, prop, signal) {
|
|
4647
|
+
if (typeof prop !== 'string') return false;
|
|
4648
|
+
const use = expressionSignalUse(expression, prop);
|
|
4649
|
+
if (use === 1) return true;
|
|
4650
|
+
if (use === 0) return false;
|
|
4651
|
+
// A :for item is itself represented by a signal. If that item's value
|
|
4652
|
+
// is an object with a real value field, item.value means the field,
|
|
4653
|
+
// not the signal wrapper API. Primitive signals still support
|
|
4654
|
+
// count.value, matching the explicit ref syntax.
|
|
4655
|
+
try {
|
|
4656
|
+
var currentValue = signal();
|
|
4657
|
+
return !(currentValue && typeof currentValue === 'object'
|
|
4658
|
+
&& Object.prototype.hasOwnProperty.call(currentValue, 'value'));
|
|
4659
|
+
}
|
|
4660
|
+
catch (e) {
|
|
4661
|
+
return true;
|
|
4662
|
+
}
|
|
4663
|
+
}
|
|
3959
4664
|
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
// not the signal wrapper API. Primitive signals still support
|
|
3963
|
-
// count.value, matching the explicit ref syntax.
|
|
3964
|
-
try {
|
|
3965
|
-
var currentValue = signal();
|
|
3966
|
-
return !(currentValue && typeof currentValue === 'object'
|
|
3967
|
-
&& Object.prototype.hasOwnProperty.call(currentValue, 'value'));
|
|
3968
|
-
}
|
|
3969
|
-
catch (e) {
|
|
3970
|
-
return true;
|
|
3971
|
-
}
|
|
3972
|
-
});
|
|
4665
|
+
function createExpressionAutoUnwrapProxy(scope, expression) {
|
|
4666
|
+
return createExpressionUnwrapProxy(scope, expression);
|
|
3973
4667
|
}
|
|
3974
4668
|
|
|
3975
4669
|
function executeHandler(expr, event, el) {
|
|
@@ -4010,7 +4704,7 @@ catch (e) {
|
|
|
4010
4704
|
console.warn('[STX] Handler error:', expr, e);
|
|
4011
4705
|
}
|
|
4012
4706
|
}
|
|
4013
|
-
`;var
|
|
4707
|
+
`;var Oe=` // ==========================================================================
|
|
4014
4708
|
// Client-side useHead / useSeoMeta
|
|
4015
4709
|
// ==========================================================================
|
|
4016
4710
|
|
|
@@ -4102,7 +4796,46 @@ catch (e) {
|
|
|
4102
4796
|
if (config.canonical) meta.push({ property: 'og:url', content: config.canonical });
|
|
4103
4797
|
useHead({ title: config.title || config.ogTitle, meta: meta });
|
|
4104
4798
|
}
|
|
4105
|
-
`;var
|
|
4799
|
+
`;var De=` // ==========================================================================
|
|
4800
|
+
// Name and word lists, remembered
|
|
4801
|
+
// ==========================================================================
|
|
4802
|
+
|
|
4803
|
+
// The same few strings (a component's parent-binding names, a prop's name)
|
|
4804
|
+
// are taken apart for every row of every list. A regular expression split
|
|
4805
|
+
// or replace is among the slowest things an interpreted engine does, so
|
|
4806
|
+
// each answer is kept. Callers must not change a returned list.
|
|
4807
|
+
var __stxWordLists = new Map();
|
|
4808
|
+
function __stxWords(text) {
|
|
4809
|
+
var words = __stxWordLists.get(text);
|
|
4810
|
+
if (words === undefined) {
|
|
4811
|
+
words = String(text).split(/\\s+/).filter(Boolean);
|
|
4812
|
+
if (__stxWordLists.size >= 2000) __stxWordLists.clear();
|
|
4813
|
+
__stxWordLists.set(text, words);
|
|
4814
|
+
}
|
|
4815
|
+
return words;
|
|
4816
|
+
}
|
|
4817
|
+
var __stxCamelNames = new Map();
|
|
4818
|
+
function __stxCamel(name) {
|
|
4819
|
+
var camel = __stxCamelNames.get(name);
|
|
4820
|
+
if (camel === undefined) {
|
|
4821
|
+
camel = name.replace(/-([a-z0-9])/g, function(_, c) { return c.toUpperCase(); });
|
|
4822
|
+
if (__stxCamelNames.size >= 2000) __stxCamelNames.clear();
|
|
4823
|
+
__stxCamelNames.set(name, camel);
|
|
4824
|
+
}
|
|
4825
|
+
return camel;
|
|
4826
|
+
}
|
|
4827
|
+
var __stxKebabNames = new Map();
|
|
4828
|
+
function __stxKebab(name) {
|
|
4829
|
+
var kebab = __stxKebabNames.get(name);
|
|
4830
|
+
if (kebab === undefined) {
|
|
4831
|
+
kebab = name.replace(/([A-Z])/g, function(_, c) { return '-' + c.toLowerCase(); });
|
|
4832
|
+
if (__stxKebabNames.size >= 2000) __stxKebabNames.clear();
|
|
4833
|
+
__stxKebabNames.set(name, kebab);
|
|
4834
|
+
}
|
|
4835
|
+
return kebab;
|
|
4836
|
+
}
|
|
4837
|
+
|
|
4838
|
+
// ==========================================================================
|
|
4106
4839
|
// Global Helpers (Feature #5)
|
|
4107
4840
|
// ==========================================================================
|
|
4108
4841
|
|
|
@@ -4231,7 +4964,7 @@ catch (e) {
|
|
|
4231
4964
|
const deps = depsMap.get(key);
|
|
4232
4965
|
if (deps) notifySubscribers(deps);
|
|
4233
4966
|
}
|
|
4234
|
-
`;var
|
|
4967
|
+
`;var Me=` // \u2500\u2500 Host \u2500\u2500
|
|
4235
4968
|
//
|
|
4236
4969
|
// The tree this runtime mutates. Every write the binding layer makes to a
|
|
4237
4970
|
// node goes through here, so the same runtime can drive something that is not
|
|
@@ -4482,7 +5215,7 @@ catch (e) {
|
|
|
4482
5215
|
return ids;
|
|
4483
5216
|
}
|
|
4484
5217
|
};
|
|
4485
|
-
`;var
|
|
5218
|
+
`;var Pe=` // Hydrate a subtree inserted AFTER initial load \u2014 e.g. a streamed suspense
|
|
4486
5219
|
// boundary (#1746 Phase 3). Mirrors the SPA re-init pass, scoped to the
|
|
4487
5220
|
// container: (1) executes the subtree's scoped setup scripts (inert when
|
|
4488
5221
|
// inserted via innerHTML, so they're cloned into fresh script elements to
|
|
@@ -4533,7 +5266,7 @@ catch (e) {
|
|
|
4533
5266
|
}
|
|
4534
5267
|
window.dispatchEvent(new CustomEvent('stx:hydrated', { detail: { el: container, trigger: 'stream' } }));
|
|
4535
5268
|
}
|
|
4536
|
-
`;var
|
|
5269
|
+
`;var Le=` // ==========================================================================
|
|
4537
5270
|
// Post-hydration invariant sweep (stacksjs/stx#1773)
|
|
4538
5271
|
// ==========================================================================
|
|
4539
5272
|
//
|
|
@@ -4743,7 +5476,7 @@ catch (e) {
|
|
|
4743
5476
|
_exprFailureCount = 0;
|
|
4744
5477
|
}
|
|
4745
5478
|
}
|
|
4746
|
-
`;var
|
|
5479
|
+
`;var Ve=` // Reactive if/else-if/else chain. A single effect drives mutual exclusion:
|
|
4747
5480
|
// on each run it picks the first branch whose condition is truthy (the
|
|
4748
5481
|
// trailing x-else always matches), inserts that branch, and removes
|
|
4749
5482
|
// whichever branch was previously shown. One effect for the whole chain
|
|
@@ -5381,7 +6114,7 @@ else if (!value && isInserted) {
|
|
|
5381
6114
|
}
|
|
5382
6115
|
});
|
|
5383
6116
|
}
|
|
5384
|
-
`;function
|
|
6117
|
+
`;function He(e,o,l,r,d){return` // One request for every caller that wants the same answer: run joins one
|
|
5385
6118
|
// in flight, fresh waits one out and asks again, latest replaces a request
|
|
5386
6119
|
// counter. See shared-request.ts; cached queries are built on it.
|
|
5387
6120
|
var sharedRequest = (${d});
|
|
@@ -5400,8 +6133,8 @@ else if (!value && isInserted) {
|
|
|
5400
6133
|
// off the critical path and read back asynchronously. Values kept before it
|
|
5401
6134
|
// are read where they are.
|
|
5402
6135
|
var STX_KEPT_PREFIX = 'stx:kept:';
|
|
5403
|
-
var __stxKept = (${e})(undefined, ${
|
|
5404
|
-
var __stxQueries = (${
|
|
6136
|
+
var __stxKept = (${e})(undefined, ${o});
|
|
6137
|
+
var __stxQueries = (${l})({ state: state, kept: __stxKept, prefix: STX_KEPT_PREFIX, matches: ${r}, sharedRequest: sharedRequest });
|
|
5405
6138
|
function stxKeptPrefix(scope) {
|
|
5406
6139
|
return STX_KEPT_PREFIX + (scope === undefined || scope === null || scope === '' ? '' : String(scope) + ':');
|
|
5407
6140
|
}
|
|
@@ -5445,7 +6178,7 @@ else if (!value && isInserted) {
|
|
|
5445
6178
|
function cachedQuery(key, options) {
|
|
5446
6179
|
return __stxQueries.cachedQuery(key, options);
|
|
5447
6180
|
}
|
|
5448
|
-
`}var
|
|
6181
|
+
`}var je=` // Lazy hydration: defer processElement for subtrees marked with stx-hydrate.
|
|
5449
6182
|
// Triggers: "visible" (IntersectionObserver), "idle" (requestIdleCallback),
|
|
5450
6183
|
// "interaction" (mouseenter/click/focus), "media:<query>" (matchMedia).
|
|
5451
6184
|
function deferHydration(el, trigger, scope) {
|
|
@@ -5577,7 +6310,7 @@ else if (!value && isInserted) {
|
|
|
5577
6310
|
run();
|
|
5578
6311
|
}
|
|
5579
6312
|
}
|
|
5580
|
-
`;var
|
|
6313
|
+
`;var Ue=` // ==========================================================================
|
|
5581
6314
|
// Lifecycle
|
|
5582
6315
|
// ==========================================================================
|
|
5583
6316
|
|
|
@@ -5705,7 +6438,7 @@ else if (!value && isInserted) {
|
|
|
5705
6438
|
// Drain any early mount/destroy calls captured by the pre-initialization shim
|
|
5706
6439
|
if (window.__stx_early_mounts) { window.__stx_early_mounts.forEach(function(fn) { mountCallbacks.push(fn); }); window.__stx_early_mounts = null; }
|
|
5707
6440
|
if (window.__stx_early_destroys) { window.__stx_early_destroys.forEach(function(fn) { destroyCallbacks.push(fn); }); window.__stx_early_destroys = null; }
|
|
5708
|
-
`;var
|
|
6441
|
+
`;var qe=` var __forComponentScopeCounter = 0;
|
|
5709
6442
|
var __forComponentSetupFactories = new Map();
|
|
5710
6443
|
|
|
5711
6444
|
function forEachGroupElement(nodes, callback) {
|
|
@@ -5770,7 +6503,7 @@ else if (!value && isInserted) {
|
|
|
5770
6503
|
}
|
|
5771
6504
|
});
|
|
5772
6505
|
}
|
|
5773
|
-
`;var
|
|
6506
|
+
`;var Be=` // A :for row is a clone of its template, so a conditional element in the row
|
|
5774
6507
|
// is built for every row whether or not its condition ever holds; :if then
|
|
5775
6508
|
// parks the false ones. In WebKit a <video> or <audio> sets up a media player
|
|
5776
6509
|
// as it is created: a message list with one media slot per attachment took
|
|
@@ -5883,7 +6616,7 @@ else if (!value && isInserted) {
|
|
|
5883
6616
|
el.appendChild(fragment);
|
|
5884
6617
|
remapForComponentScopes([el]);
|
|
5885
6618
|
}
|
|
5886
|
-
`;var
|
|
6619
|
+
`;var Ke=` // A loop row binds in its own iteration scope, and only its loop puts it
|
|
5887
6620
|
// there. A walk from further out (an enclosing :if hydrating the branch it
|
|
5888
6621
|
// shows) carries no item, so it used to bind whatever in the row was still
|
|
5889
6622
|
// unbound -- a conditional's children, waiting for their own deferred pass
|
|
@@ -5923,7 +6656,7 @@ else if (!value && isInserted) {
|
|
|
5923
6656
|
}
|
|
5924
6657
|
return now;
|
|
5925
6658
|
}
|
|
5926
|
-
`;var
|
|
6659
|
+
`;var Ge=` /**
|
|
5927
6660
|
* Bind what the server said carries a binding, instead of looking for it.
|
|
5928
6661
|
*
|
|
5929
6662
|
* The walk exists because the runtime does not know where the bindings are.
|
|
@@ -6034,7 +6767,7 @@ else if (!value && isInserted) {
|
|
|
6034
6767
|
}
|
|
6035
6768
|
};
|
|
6036
6769
|
}
|
|
6037
|
-
`;var
|
|
6770
|
+
`;var $e=` function bindModel(el, expr, passedScope = componentScope, attrName = '@model') {
|
|
6038
6771
|
if (el.__stx_model_bound) return;
|
|
6039
6772
|
el.__stx_model_bound = true;
|
|
6040
6773
|
const tag = el.tagName.toLowerCase();
|
|
@@ -6192,7 +6925,7 @@ else {
|
|
|
6192
6925
|
|
|
6193
6926
|
el.removeAttribute(attrName);
|
|
6194
6927
|
}
|
|
6195
|
-
`;var
|
|
6928
|
+
`;var We=` mountEl: function(selector, setupFn) {
|
|
6196
6929
|
function doMount() {
|
|
6197
6930
|
var root = document.querySelector(selector);
|
|
6198
6931
|
if (!root) { console.warn('[stx] mountEl: element not found:', selector); return; }
|
|
@@ -6638,7 +7371,7 @@ else {
|
|
|
6638
7371
|
}
|
|
6639
7372
|
};
|
|
6640
7373
|
}
|
|
6641
|
-
`;var
|
|
7374
|
+
`;var Xe=` // ==========================================================================
|
|
6642
7375
|
// Optimistic State (useOptimistic) \u2014 stacksjs/stx#1742
|
|
6643
7376
|
// ==========================================================================
|
|
6644
7377
|
// Mirrors signals-api.ts useOptimistic. Shows base + pending actions while an
|
|
@@ -6671,7 +7404,7 @@ else {
|
|
|
6671
7404
|
}
|
|
6672
7405
|
return [optimistic, addOptimistic];
|
|
6673
7406
|
}
|
|
6674
|
-
`;var
|
|
7407
|
+
`;var Qe=` // \u2500\u2500 Overlay stack \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
6675
7408
|
//
|
|
6676
7409
|
// One stack for everything that takes over the page: stxAlert/stxConfirm,
|
|
6677
7410
|
// the runtime modal and drawer, @stacksjs/components' Dialog and Drawer, and
|
|
@@ -7045,7 +7778,7 @@ else {
|
|
|
7045
7778
|
else modal.open(id);
|
|
7046
7779
|
}
|
|
7047
7780
|
};
|
|
7048
|
-
`;var
|
|
7781
|
+
`;var Ye=` // ==========================================================================
|
|
7049
7782
|
// Advanced Data Fetching (useQuery / useMutation)
|
|
7050
7783
|
// ==========================================================================
|
|
7051
7784
|
|
|
@@ -7395,7 +8128,7 @@ finally {
|
|
|
7395
8128
|
reset: function() { data.set(null); error.set(null); loading.set(false); }
|
|
7396
8129
|
};
|
|
7397
8130
|
}
|
|
7398
|
-
`;var
|
|
8131
|
+
`;var Je=` // ==========================================================================
|
|
7399
8132
|
// Notify
|
|
7400
8133
|
// ==========================================================================
|
|
7401
8134
|
|
|
@@ -7420,16 +8153,16 @@ finally {
|
|
|
7420
8153
|
collectSubscribers(subscribers, reached);
|
|
7421
8154
|
reached.forEach(function(e) { e(); });
|
|
7422
8155
|
}
|
|
7423
|
-
`;function
|
|
8156
|
+
`;function Ze(e,o,l){return`${e} // ==========================================================================
|
|
7424
8157
|
// Reactive Core
|
|
7425
8158
|
// ==========================================================================
|
|
7426
8159
|
|
|
7427
|
-
${
|
|
8160
|
+
${o}
|
|
7428
8161
|
let activeEffect = null;
|
|
7429
8162
|
const effectStack = [];
|
|
7430
8163
|
const pendingEffects = new Set();
|
|
7431
8164
|
let isBatching = false;
|
|
7432
|
-
${
|
|
8165
|
+
${Je}
|
|
7433
8166
|
|
|
7434
8167
|
// DevTools Phase 2 (#1747): dev-mode reactivity instrumentation. OFF by
|
|
7435
8168
|
// default \u2014 even in the dev runtime \u2014 so set()/effect-run stay zero-overhead
|
|
@@ -7446,9 +8179,9 @@ ${Ye}
|
|
|
7446
8179
|
function __stxDevtoolsNow() { return (typeof performance !== 'undefined' && performance.now) ? performance.now() : Date.now(); }
|
|
7447
8180
|
function __stxDevtoolsRecordIf(rec) { if (!__stxDevtoolsTracking) return; __stxDevtoolsIfTrace.push(rec); if (__stxDevtoolsIfTrace.length > 100) __stxDevtoolsIfTrace.shift(); }
|
|
7448
8181
|
function __stxDevtoolsRecordQuery(rec) { if (!__stxDevtoolsTracking) return; __stxDevtoolsQueries.push(rec); if (__stxDevtoolsQueries.length > 100) __stxDevtoolsQueries.shift(); }
|
|
7449
|
-
${
|
|
8182
|
+
${l}
|
|
7450
8183
|
let activeDisposers = null; // Array | null \u2014 when non-null, effects auto-register their dispose fn
|
|
7451
|
-
const targetMap = new WeakMap();`}var
|
|
8184
|
+
const targetMap = new WeakMap();`}var et=` // Vue-compat aliases
|
|
7452
8185
|
var ref = state;
|
|
7453
8186
|
|
|
7454
8187
|
// reactive() used to be a bare alias of state(), which made it the most
|
|
@@ -7513,7 +8246,7 @@ ${i}
|
|
|
7513
8246
|
return proxy;
|
|
7514
8247
|
}
|
|
7515
8248
|
var computed = derived;
|
|
7516
|
-
var watchEffect = function(fn) { return effect(fn); };`;var
|
|
8249
|
+
var watchEffect = function(fn) { return effect(fn); };`;var tt=` // ==========================================================================
|
|
7517
8250
|
// Pipe Syntax Support (Feature #2)
|
|
7518
8251
|
// ==========================================================================
|
|
7519
8252
|
|
|
@@ -7699,7 +8432,46 @@ else {
|
|
|
7699
8432
|
|
|
7700
8433
|
return value;
|
|
7701
8434
|
}
|
|
7702
|
-
`;function
|
|
8435
|
+
`;function nt(e,o,l){return` // Known directive names to exclude from generic :attr binding
|
|
8436
|
+
var DIRECTIVE_NAMES = ${e};
|
|
8437
|
+
|
|
8438
|
+
// A bound value cannot introduce a URL scheme the page did not ask for.
|
|
8439
|
+
// This is the client half of url-safety.ts: the server refuses a scheme
|
|
8440
|
+
// substituted into an href, and x-href over a signal reaches the same
|
|
8441
|
+
// attribute by another road. Same policy, same unsafe: prefix, so a page
|
|
8442
|
+
// behaves the same whether the value arrived at render or at runtime.
|
|
8443
|
+
var URL_NAV_ATTR = {href:1, 'xlink:href':1, action:1, formaction:1, ping:1, cite:1, manifest:1, data:1, to:1};
|
|
8444
|
+
var URL_FETCH_ATTR = {src:1, srcset:1, poster:1, background:1};
|
|
8445
|
+
function __stxSafeUrlAttr(attrName, value, warning) {
|
|
8446
|
+
var navigable = URL_NAV_ATTR[attrName];
|
|
8447
|
+
if (!navigable && !URL_FETCH_ATTR[attrName]) return value;
|
|
8448
|
+
if (typeof value !== 'string' || !value) return value;
|
|
8449
|
+
// Browsers ignore ASCII whitespace and controls inside a scheme and match
|
|
8450
|
+
// it case-insensitively, so the spellings collapse before the test.
|
|
8451
|
+
var probe = value.replace(/[\\u0000-\\u0020\\u00a0\\u2000-\\u200f\\u2028\\u2029\\ufeff]+/g, '').toLowerCase();
|
|
8452
|
+
var refused = /^(?:javascript|vbscript|livescript|mocha|view-source):/.test(probe)
|
|
8453
|
+
|| (navigable
|
|
8454
|
+
? /^data:(?:text\\/html|text\\/xml|application\\/xhtml\\+xml|application\\/xml|image\\/svg\\+xml)/.test(probe)
|
|
8455
|
+
: /^data:(?:text\\/html|application\\/xhtml\\+xml)/.test(probe));
|
|
8456
|
+
if (!refused) return value;
|
|
8457
|
+
if (!warning.warned) {
|
|
8458
|
+
warning.warned = true;
|
|
8459
|
+
console.warn('[stx] refused a ' + attrName + ' value whose scheme can run script: ' + probe.slice(0, 24));
|
|
8460
|
+
}
|
|
8461
|
+
return 'unsafe:' + value;
|
|
8462
|
+
}
|
|
8463
|
+
// SVG attributes are case-sensitive, but the HTML parser lowercases
|
|
8464
|
+
// prefixed attribute names \u2014 ':viewBox' arrives as ':viewbox' because
|
|
8465
|
+
// the spec's "adjust SVG attributes" step only covers unprefixed names.
|
|
8466
|
+
// Without restoring the canonical casing, setAttribute('viewbox') creates
|
|
8467
|
+
// a dead duplicate attribute and the real viewBox never updates.
|
|
8468
|
+
var SVG_ATTR_CASE = {attributename:'attributeName', attributetype:'attributeType', basefrequency:'baseFrequency', baseprofile:'baseProfile', calcmode:'calcMode', clippathunits:'clipPathUnits', diffuseconstant:'diffuseConstant', edgemode:'edgeMode', filterunits:'filterUnits', glyphref:'glyphRef', gradienttransform:'gradientTransform', gradientunits:'gradientUnits', kernelmatrix:'kernelMatrix', kernelunitlength:'kernelUnitLength', keypoints:'keyPoints', keysplines:'keySplines', keytimes:'keyTimes', lengthadjust:'lengthAdjust', limitingconeangle:'limitingConeAngle', markerheight:'markerHeight', markerunits:'markerUnits', markerwidth:'markerWidth', maskcontentunits:'maskContentUnits', maskunits:'maskUnits', numoctaves:'numOctaves', pathlength:'pathLength', patterncontentunits:'patternContentUnits', patterntransform:'patternTransform', patternunits:'patternUnits', pointsatx:'pointsAtX', pointsaty:'pointsAtY', pointsatz:'pointsAtZ', preservealpha:'preserveAlpha', preserveaspectratio:'preserveAspectRatio', primitiveunits:'primitiveUnits', refx:'refX', refy:'refY', repeatcount:'repeatCount', repeatdur:'repeatDur', requiredextensions:'requiredExtensions', requiredfeatures:'requiredFeatures', specularconstant:'specularConstant', specularexponent:'specularExponent', spreadmethod:'spreadMethod', startoffset:'startOffset', stddeviation:'stdDeviation', stitchtiles:'stitchTiles', surfacescale:'surfaceScale', systemlanguage:'systemLanguage', tablevalues:'tableValues', targetx:'targetX', targety:'targetY', textlength:'textLength', viewbox:'viewBox', viewtarget:'viewTarget', xchannelselector:'xChannelSelector', ychannelselector:'yChannelSelector', zoomandpan:'zoomAndPan'};
|
|
8469
|
+
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
8470
|
+
var EVENT_RE = ${o};
|
|
8471
|
+
var X_HANDLED = ${l};
|
|
8472
|
+
var KEY_MAP = {enter:'Enter', tab:'Tab', escape:'Escape', space:' ', up:'ArrowUp', down:'ArrowDown', left:'ArrowLeft', right:'ArrowRight', 'delete':'Delete', backspace:'Backspace'};
|
|
8473
|
+
|
|
8474
|
+
// True for text a binding wrote, or markup :html injected: data, never
|
|
7703
8475
|
// template. Checked only for text that holds braces, so the climb is rare.
|
|
7704
8476
|
function isInertContent(node) {
|
|
7705
8477
|
for (var n = node; n; n = n.parentNode) if (n.__stx_inert_content) return true;
|
|
@@ -7941,7 +8713,8 @@ else if (part) {
|
|
|
7941
8713
|
const activeScope = evaluationScope || attrCapturedScope;
|
|
7942
8714
|
// Decode HTML entities that browsers may encode in attribute values
|
|
7943
8715
|
// e.g. :text="a > b" may be stored as :text="a > b" in HTML
|
|
7944
|
-
|
|
8716
|
+
// Nearly no expression holds an entity: six replaces on every run of every binding.
|
|
8717
|
+
var expr = rawExpr.indexOf('&') === -1 ? rawExpr : rawExpr.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'");
|
|
7945
8718
|
try {
|
|
7946
8719
|
if (/^__[A-Z_]+__$/.test(expr.trim())) return expr;
|
|
7947
8720
|
|
|
@@ -7985,44 +8758,8 @@ catch (e2) {
|
|
|
7985
8758
|
}
|
|
7986
8759
|
};
|
|
7987
8760
|
|
|
7988
|
-
//
|
|
7989
|
-
var
|
|
7990
|
-
|
|
7991
|
-
// A bound value cannot introduce a URL scheme the page did not ask for.
|
|
7992
|
-
// This is the client half of url-safety.ts: the server refuses a scheme
|
|
7993
|
-
// substituted into an href, and x-href over a signal reaches the same
|
|
7994
|
-
// attribute by another road. Same policy, same unsafe: prefix, so a page
|
|
7995
|
-
// behaves the same whether the value arrived at render or at runtime.
|
|
7996
|
-
var URL_NAV_ATTR = {href:1, 'xlink:href':1, action:1, formaction:1, ping:1, cite:1, manifest:1, data:1, to:1};
|
|
7997
|
-
var URL_FETCH_ATTR = {src:1, srcset:1, poster:1, background:1};
|
|
7998
|
-
var urlRefusalWarned = false;
|
|
7999
|
-
function safeUrlAttr(attrName, value) {
|
|
8000
|
-
var navigable = URL_NAV_ATTR[attrName];
|
|
8001
|
-
if (!navigable && !URL_FETCH_ATTR[attrName]) return value;
|
|
8002
|
-
if (typeof value !== 'string' || !value) return value;
|
|
8003
|
-
// Browsers ignore ASCII whitespace and controls inside a scheme and match
|
|
8004
|
-
// it case-insensitively, so the spellings collapse before the test.
|
|
8005
|
-
var probe = value.replace(/[\\u0000-\\u0020\\u00a0\\u2000-\\u200f\\u2028\\u2029\\ufeff]+/g, '').toLowerCase();
|
|
8006
|
-
var refused = /^(?:javascript|vbscript|livescript|mocha|view-source):/.test(probe)
|
|
8007
|
-
|| (navigable
|
|
8008
|
-
? /^data:(?:text\\/html|text\\/xml|application\\/xhtml\\+xml|application\\/xml|image\\/svg\\+xml)/.test(probe)
|
|
8009
|
-
: /^data:(?:text\\/html|application\\/xhtml\\+xml)/.test(probe));
|
|
8010
|
-
if (!refused) return value;
|
|
8011
|
-
if (!urlRefusalWarned) {
|
|
8012
|
-
urlRefusalWarned = true;
|
|
8013
|
-
console.warn('[stx] refused a ' + attrName + ' value whose scheme can run script: ' + probe.slice(0, 24));
|
|
8014
|
-
}
|
|
8015
|
-
return 'unsafe:' + value;
|
|
8016
|
-
}
|
|
8017
|
-
// SVG attributes are case-sensitive, but the HTML parser lowercases
|
|
8018
|
-
// prefixed attribute names \u2014 ':viewBox' arrives as ':viewbox' because
|
|
8019
|
-
// the spec's "adjust SVG attributes" step only covers unprefixed names.
|
|
8020
|
-
// Without restoring the canonical casing, setAttribute('viewbox') creates
|
|
8021
|
-
// a dead duplicate attribute and the real viewBox never updates.
|
|
8022
|
-
var SVG_ATTR_CASE = {attributename:'attributeName', attributetype:'attributeType', basefrequency:'baseFrequency', baseprofile:'baseProfile', calcmode:'calcMode', clippathunits:'clipPathUnits', diffuseconstant:'diffuseConstant', edgemode:'edgeMode', filterunits:'filterUnits', glyphref:'glyphRef', gradienttransform:'gradientTransform', gradientunits:'gradientUnits', kernelmatrix:'kernelMatrix', kernelunitlength:'kernelUnitLength', keypoints:'keyPoints', keysplines:'keySplines', keytimes:'keyTimes', lengthadjust:'lengthAdjust', limitingconeangle:'limitingConeAngle', markerheight:'markerHeight', markerunits:'markerUnits', markerwidth:'markerWidth', maskcontentunits:'maskContentUnits', maskunits:'maskUnits', numoctaves:'numOctaves', pathlength:'pathLength', patterncontentunits:'patternContentUnits', patterntransform:'patternTransform', patternunits:'patternUnits', pointsatx:'pointsAtX', pointsaty:'pointsAtY', pointsatz:'pointsAtZ', preservealpha:'preserveAlpha', preserveaspectratio:'preserveAspectRatio', primitiveunits:'primitiveUnits', refx:'refX', refy:'refY', repeatcount:'repeatCount', repeatdur:'repeatDur', requiredextensions:'requiredExtensions', requiredfeatures:'requiredFeatures', specularconstant:'specularConstant', specularexponent:'specularExponent', spreadmethod:'spreadMethod', startoffset:'startOffset', stddeviation:'stdDeviation', stitchtiles:'stitchTiles', surfacescale:'surfaceScale', systemlanguage:'systemLanguage', tablevalues:'tableValues', targetx:'targetX', targety:'targetY', textlength:'textLength', viewbox:'viewBox', viewtarget:'viewTarget', xchannelselector:'xChannelSelector', ychannelselector:'yChannelSelector', zoomandpan:'zoomAndPan'};
|
|
8023
|
-
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
8024
|
-
var EVENT_RE = ${s};
|
|
8025
|
-
var KEY_MAP = {enter:'Enter', tab:'Tab', escape:'Escape', space:' ', up:'ArrowUp', down:'ArrowDown', left:'ArrowLeft', right:'ArrowRight', 'delete':'Delete', backspace:'Backspace'};
|
|
8761
|
+
// One refusal warning per element, as before the policy moved out.
|
|
8762
|
+
var urlWarning = { warned: false };
|
|
8026
8763
|
|
|
8027
8764
|
// Handle attributes
|
|
8028
8765
|
getElementAttributes(el).forEach(attr => {
|
|
@@ -8057,13 +8794,12 @@ catch (e2) {
|
|
|
8057
8794
|
// :attr still works for backward compat but is reserved for structural directives.
|
|
8058
8795
|
// x-text, x-html, x-model, x-show, x-if, x-for, x-cloak, x-ref, x-data are
|
|
8059
8796
|
// handled by their own code paths below \u2014 exclude them here.
|
|
8060
|
-
var X_HANDLED = ${i};
|
|
8061
8797
|
if (name.startsWith('@bind:') || name.startsWith('x-bind:')
|
|
8062
8798
|
|| (name.startsWith(':') && !name.startsWith('::') && !DIRECTIVE_NAMES[name.slice(1).split('.')[0]] && !EVENT_RE.test(name.slice(1)))
|
|
8063
8799
|
|| (name.startsWith('x-') && !X_HANDLED[name.split('.')[0]] && !X_HANDLED[name])) {
|
|
8064
8800
|
let attrName = name.startsWith('@bind:') ? name.slice(6) : name.startsWith('x-bind:') ? name.slice(7) : name.startsWith('x-') ? name.slice(2) : name.slice(1);
|
|
8065
8801
|
if (el.namespaceURI === SVG_NS && SVG_ATTR_CASE[attrName]) attrName = SVG_ATTR_CASE[attrName];
|
|
8066
|
-
var parentBindingNames = (el.getAttribute && el.getAttribute('data-stx-parent-bindings') || '')
|
|
8802
|
+
var parentBindingNames = __stxWords(el.getAttribute && el.getAttribute('data-stx-parent-bindings') || '');
|
|
8067
8803
|
var bindingScope = el.__stx_parent_scope && parentBindingNames.includes(attrName)
|
|
8068
8804
|
? el.__stx_parent_scope
|
|
8069
8805
|
: attrCapturedScope;
|
|
@@ -8077,112 +8813,7 @@ catch (e2) {
|
|
|
8077
8813
|
effect(() => {
|
|
8078
8814
|
if (!attributesVisible()) return;
|
|
8079
8815
|
const v = evalAttrExpr(value, bindingScope);
|
|
8080
|
-
|
|
8081
|
-
// attribute does not update a <select>'s chosen option and can leave
|
|
8082
|
-
// inputs displaying stale text after a reactive update.
|
|
8083
|
-
if (attrName === 'value' && 'value' in el) {
|
|
8084
|
-
var controlValue = v;
|
|
8085
|
-
if (typeof v === 'object' && v !== null) {
|
|
8086
|
-
try { controlValue = JSON.stringify(v); }
|
|
8087
|
-
catch (e) { controlValue = String(v); }
|
|
8088
|
-
}
|
|
8089
|
-
controlValue = v === false || v === null || v === undefined ? '' : String(controlValue);
|
|
8090
|
-
el.__stx_bound_value = controlValue;
|
|
8091
|
-
var applyControlValue = function() {
|
|
8092
|
-
if (!attributesVisible()) return;
|
|
8093
|
-
var desiredValue = el.__stx_bound_value == null ? '' : String(el.__stx_bound_value);
|
|
8094
|
-
el.value = desiredValue;
|
|
8095
|
-
if (desiredValue === '' && el.tagName !== 'OPTION') el.removeAttribute(attrName);
|
|
8096
|
-
else if (el.getAttribute(attrName) !== desiredValue) el.setAttribute(attrName, desiredValue);
|
|
8097
|
-
if (typeof el.__stx_model_sync === 'function') el.__stx_model_sync();
|
|
8098
|
-
};
|
|
8099
|
-
applyControlValue();
|
|
8100
|
-
|
|
8101
|
-
// A select's value binding is processed before its child
|
|
8102
|
-
// directives. When a nested :for creates the matching options
|
|
8103
|
-
// afterward, the browser otherwise leaves the first option
|
|
8104
|
-
// selected. Keep the desired value and reapply it whenever the
|
|
8105
|
-
// option tree changes, including later reactive list updates.
|
|
8106
|
-
if (el.tagName === 'SELECT' && !el.__stx_value_observer && typeof window.MutationObserver !== 'undefined') {
|
|
8107
|
-
el.__stx_value_observer = new window.MutationObserver(applyControlValue);
|
|
8108
|
-
el.__stx_value_observer.observe(el, {
|
|
8109
|
-
childList: true,
|
|
8110
|
-
subtree: true,
|
|
8111
|
-
attributes: true,
|
|
8112
|
-
attributeFilter: ['value'],
|
|
8113
|
-
});
|
|
8114
|
-
el.__stx_destroy = el.__stx_destroy || [];
|
|
8115
|
-
el.__stx_destroy.push(function() {
|
|
8116
|
-
if (el.__stx_value_observer) el.__stx_value_observer.disconnect();
|
|
8117
|
-
el.__stx_value_observer = null;
|
|
8118
|
-
});
|
|
8119
|
-
}
|
|
8120
|
-
return;
|
|
8121
|
-
}
|
|
8122
|
-
// Checked, selected, and indeterminate are live DOM properties, just like value.
|
|
8123
|
-
// Updating only the HTML attribute leaves a user-touched checkbox or
|
|
8124
|
-
// radio in its previous state because the property becomes dirty.
|
|
8125
|
-
// Indeterminate has no corresponding effective HTML attribute at all.
|
|
8126
|
-
if ((attrName === 'checked' || attrName === 'selected' || attrName === 'indeterminate') && attrName in el) {
|
|
8127
|
-
var selectedState = Boolean(v);
|
|
8128
|
-
el[attrName] = selectedState;
|
|
8129
|
-
if (attrName === 'indeterminate') {
|
|
8130
|
-
el.removeAttribute(attrName);
|
|
8131
|
-
}
|
|
8132
|
-
else if (selectedState) {
|
|
8133
|
-
el.setAttribute(attrName, '');
|
|
8134
|
-
}
|
|
8135
|
-
else {
|
|
8136
|
-
el.removeAttribute(attrName);
|
|
8137
|
-
}
|
|
8138
|
-
return;
|
|
8139
|
-
}
|
|
8140
|
-
// aria-* and data-* carry a STRING: the platform's boolean attribute
|
|
8141
|
-
// is presence, which cannot say "false" and wrote data-open="" for
|
|
8142
|
-
// true, so a [data-open='true'] selector never matched. React renders
|
|
8143
|
-
// both as "true" / "false", and so does this.
|
|
8144
|
-
if ((attrName.startsWith('aria-') || attrName.startsWith('data-')) && typeof v === 'boolean') {
|
|
8145
|
-
stxHost.setAttribute(el, attrName, String(v));
|
|
8146
|
-
}
|
|
8147
|
-
else if (typeof v === 'boolean') {
|
|
8148
|
-
stxHost.setAttribute(el, attrName, v);
|
|
8149
|
-
}
|
|
8150
|
-
else if (v === null || v === undefined) {
|
|
8151
|
-
stxHost.removeAttribute(el, attrName);
|
|
8152
|
-
}
|
|
8153
|
-
else {
|
|
8154
|
-
var attrValue = v;
|
|
8155
|
-
if (typeof v === 'object') {
|
|
8156
|
-
try { attrValue = JSON.stringify(v); }
|
|
8157
|
-
catch (e) { attrValue = String(v); }
|
|
8158
|
-
}
|
|
8159
|
-
var attrValueSafe = safeUrlAttr(attrName, attrValue);
|
|
8160
|
-
// Keep structured values structured for non-DOM hosts. The DOM
|
|
8161
|
-
// host serializes them at its boundary, preserving web output.
|
|
8162
|
-
var hostValue = (typeof v === 'object' && v !== null) ? v : attrValueSafe;
|
|
8163
|
-
// Writing the value an attribute already has is not nothing: a
|
|
8164
|
-
// frame given its own src again loads again (an entry in the
|
|
8165
|
-
// page's history each time) and a video restarts. A player whose
|
|
8166
|
-
// rest and next set share a video re-set it on every step.
|
|
8167
|
-
if (el.getAttribute(attrName) === String(attrValueSafe)) return;
|
|
8168
|
-
// A frame already on the page that is pointed somewhere else
|
|
8169
|
-
// navigates, and every navigation is an entry in the page's own
|
|
8170
|
-
// history: a player showing a video per step left one per step,
|
|
8171
|
-
// and Back had to be tapped through all of them before it left
|
|
8172
|
-
// the screen. Out of the page and back in, the frame starts afresh
|
|
8173
|
-
// (its first load adds no entry, and its old entries go with it).
|
|
8174
|
-
var parentNode = el.parentNode;
|
|
8175
|
-
if (attrName === 'src' && el.tagName === 'IFRAME' && parentNode && el.isConnected
|
|
8176
|
-
&& el.hasAttribute('src') && el.getAttribute('src') !== String(attrValueSafe)) {
|
|
8177
|
-
var nextSibling = el.nextSibling;
|
|
8178
|
-
parentNode.removeChild(el);
|
|
8179
|
-
stxHost.setAttribute(el, attrName, hostValue);
|
|
8180
|
-
parentNode.insertBefore(el, nextSibling);
|
|
8181
|
-
}
|
|
8182
|
-
else {
|
|
8183
|
-
stxHost.setAttribute(el, attrName, hostValue);
|
|
8184
|
-
}
|
|
8185
|
-
}
|
|
8816
|
+
applyBoundAttribute(el, attrName, v, attributesVisible, urlWarning);
|
|
8186
8817
|
});
|
|
8187
8818
|
el.removeAttribute(name);
|
|
8188
8819
|
}
|
|
@@ -8257,7 +8888,7 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
|
|
|
8257
8888
|
const parts = name.slice(1).split('.');
|
|
8258
8889
|
// HTML folds attribute names to lowercase; the forwarding metadata
|
|
8259
8890
|
// retains the declared event spelling (e.g. update:modelValue).
|
|
8260
|
-
const parentEventNames = (el.getAttribute && el.getAttribute('data-stx-parent-events') || '')
|
|
8891
|
+
const parentEventNames = __stxWords(el.getAttribute && el.getAttribute('data-stx-parent-events') || '');
|
|
8261
8892
|
const eventName = parentEventNames.find(function(event) {
|
|
8262
8893
|
return event.toLowerCase() === parts[0].toLowerCase();
|
|
8263
8894
|
}) || parts[0];
|
|
@@ -8280,146 +8911,11 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
|
|
|
8280
8911
|
|
|
8281
8912
|
// Capture scope at setup time so @for loop variables are available when event fires
|
|
8282
8913
|
const isForwardedComponentEvent = !!(el.__stx_parent_scope && parentEventNames.includes(eventName));
|
|
8283
|
-
|
|
8914
|
+
const eventCapturedScope = isForwardedComponentEvent
|
|
8284
8915
|
? layerTemplateScopes(globalHelpers, el.__stx_parent_scope)
|
|
8285
8916
|
: layerTemplateScopes(globalHelpers, scope, (findElementScope(el) || {}));
|
|
8286
8917
|
|
|
8287
|
-
|
|
8288
|
-
// A forwarded handler belongs to the caller, whose scope can be
|
|
8289
|
-
// resolved again after this listener is bound: a component inside
|
|
8290
|
-
// another component's :if, in a dialog, was bound against the
|
|
8291
|
-
// page's scope and only later handed its real caller, so
|
|
8292
|
-
// @pick="pickFromBank" found nothing and did nothing. Read it now.
|
|
8293
|
-
if (isForwardedComponentEvent && el.__stx_parent_scope)
|
|
8294
|
-
eventCapturedScope = layerTemplateScopes(globalHelpers, el.__stx_parent_scope);
|
|
8295
|
-
// Vue-style component listeners fall through to the rendered native
|
|
8296
|
-
// root unless the child emits the same event. Signal components use
|
|
8297
|
-
// a scope wrapper, so native events arrive here from a descendant.
|
|
8298
|
-
// Ignore that native event only after defineEmits() has declared or
|
|
8299
|
-
// emitted the same name, preventing submit/click handlers from
|
|
8300
|
-
// firing once for the native event and again for the CustomEvent.
|
|
8301
|
-
var componentEmits = el.__stx_component_emits;
|
|
8302
|
-
if (isForwardedComponentEvent && event.target !== el
|
|
8303
|
-
&& componentEmits && componentEmits[eventName]) return;
|
|
8304
|
-
|
|
8305
|
-
// Vue-style component handlers receive the emitted payload directly.
|
|
8306
|
-
// Native root events still receive the Event object so server-only
|
|
8307
|
-
// components can forward clicks and other browser events.
|
|
8308
|
-
var emittedArgs = isForwardedComponentEvent && event instanceof CustomEvent
|
|
8309
|
-
&& Array.isArray(event.__stx_emit_args) ? event.__stx_emit_args : null;
|
|
8310
|
-
var handlerEvent = emittedArgs ? emittedArgs[0]
|
|
8311
|
-
: isForwardedComponentEvent && event instanceof CustomEvent ? event.detail : event;
|
|
8312
|
-
|
|
8313
|
-
// Skip an opener click that reaches UI which just became visible in
|
|
8314
|
-
// this frame. A click whose target is inside the revealed subtree is
|
|
8315
|
-
// a real interaction and must not be discarded, especially for
|
|
8316
|
-
// async lists whose controls are usable as soon as they render.
|
|
8317
|
-
if (eventName === 'click') {
|
|
8318
|
-
var ancestor = el;
|
|
8319
|
-
while (ancestor) {
|
|
8320
|
-
if (ancestor.__stx_shown_at
|
|
8321
|
-
&& (performance.now() - ancestor.__stx_shown_at) < 50
|
|
8322
|
-
&& !(ancestor.contains && ancestor.contains(event.target))) return;
|
|
8323
|
-
ancestor = ancestor.parentElement;
|
|
8324
|
-
}
|
|
8325
|
-
}
|
|
8326
|
-
// System key modifiers
|
|
8327
|
-
if (modifiers.includes('self') && event.target !== el) return;
|
|
8328
|
-
if (modifiers.includes('ctrl') && !event.ctrlKey) return;
|
|
8329
|
-
if (modifiers.includes('alt') && !event.altKey) return;
|
|
8330
|
-
if (modifiers.includes('shift') && !event.shiftKey) return;
|
|
8331
|
-
if (modifiers.includes('meta') && !event.metaKey) return;
|
|
8332
|
-
// Key modifiers
|
|
8333
|
-
for (var mi = 0; mi < modifiers.length; mi++) {
|
|
8334
|
-
if (KEY_MAP[modifiers[mi]] && event.key !== KEY_MAP[modifiers[mi]]) return;
|
|
8335
|
-
}
|
|
8336
|
-
if (modifiers.includes('prevent')) event.preventDefault();
|
|
8337
|
-
if (modifiers.includes('stop')) event.stopPropagation();
|
|
8338
|
-
// Execute with captured scope (includes @for loop variables)
|
|
8339
|
-
// For x-data scopes, expressions like "mobileOpen = !mobileOpen" need to
|
|
8340
|
-
// read the signal value AND write back through the signal's setter.
|
|
8341
|
-
try {
|
|
8342
|
-
if (!value || /^__[A-Z_]+__$/.test(value.trim())) return;
|
|
8343
|
-
var shorthandFn = parseEventShorthand(value, eventCapturedScope);
|
|
8344
|
-
if (shorthandFn) { shorthandFn.apply(null, emittedArgs || [handlerEvent]); return; }
|
|
8345
|
-
// Check if any scope values are signals (x-data pattern)
|
|
8346
|
-
// A derived value reads like a signal in a handler, as it does in a
|
|
8347
|
-
// binding: \`pick(selectedPackage)\` passes the package. Leaving it
|
|
8348
|
-
// out handed the handler the derived's getter function, so
|
|
8349
|
-
// \`selectedPackage.trainer_id\` was undefined with nothing said.
|
|
8350
|
-
// Only the names the handler mentions. A page's scope holds
|
|
8351
|
-
// hundreds; reading, testing and declaring every one of them on
|
|
8352
|
-
// each click or hover cost far more than the handler itself.
|
|
8353
|
-
var handlerNames = __stxNamesIn(value).filter(function(k) {
|
|
8354
|
-
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k) && (k in eventCapturedScope);
|
|
8355
|
-
});
|
|
8356
|
-
var hasSignals = handlerNames.some(function(k) {
|
|
8357
|
-
var v = eventCapturedScope[k];
|
|
8358
|
-
return v && typeof v === 'function' && (v._isSignal || v._isDerived);
|
|
8359
|
-
});
|
|
8360
|
-
// Only use signal read/write proxy for DIRECT assignment expressions
|
|
8361
|
-
// like "count = count + 1" or "open = !open". Function calls like
|
|
8362
|
-
// "openModal()" handle their own signal.set() internally \u2014 the writeback
|
|
8363
|
-
// would RESET signals to their pre-handler values.
|
|
8364
|
-
var isDirectAssignment = hasSignals && /^[a-zA-Z_$]\\w*\\s*=/.test(value.trim()) && !value.trim().startsWith('==');
|
|
8365
|
-
if (isDirectAssignment) {
|
|
8366
|
-
var getVars = handlerNames.map(function(k) {
|
|
8367
|
-
return 'var ' + k + ' = __s["' + k + '"] && typeof __s["' + k + '"] === "function" && (__s["' + k + '"]._isSignal || __s["' + k + '"]._isDerived) ? __s["' + k + '"]() : __s["' + k + '"]';
|
|
8368
|
-
}).join(';');
|
|
8369
|
-
var setVars = handlerNames.filter(function(k) {
|
|
8370
|
-
var v = eventCapturedScope[k];
|
|
8371
|
-
return v && typeof v === 'function' && v._isSignal;
|
|
8372
|
-
}).map(function(k) {
|
|
8373
|
-
return 'if(' + k + ' !== __s["' + k + '"]()) __s["' + k + '"].set(' + k + ')';
|
|
8374
|
-
}).join(';');
|
|
8375
|
-
var body = getVars + ';' + value + ';' + setVars;
|
|
8376
|
-
var fn2 = __stxCompile(['__s', '$event'], body);
|
|
8377
|
-
fn2(eventCapturedScope, handlerEvent);
|
|
8378
|
-
} else if (hasSignals) {
|
|
8379
|
-
// Function calls with signals in scope keep any signal used through
|
|
8380
|
-
// its object API as a raw signal function, and unwrap the rest for
|
|
8381
|
-
// primitive reads.
|
|
8382
|
-
var unwrapVars = handlerNames.map(function(k) {
|
|
8383
|
-
var v = eventCapturedScope[k];
|
|
8384
|
-
// A :for item is a signal only as an implementation detail, so
|
|
8385
|
-
// that keyed rows can update in place. Its \`.value\` is a field
|
|
8386
|
-
// on the item, never the signal compatibility API \u2014 the same
|
|
8387
|
-
// rule createAutoUnwrapProxy states for binding expressions.
|
|
8388
|
-
// Without the carve-out, expressionUsesSignalApi sees
|
|
8389
|
-
// \`option.value\` and hands the handler the raw signal, so a
|
|
8390
|
-
// handler like \`pick(option.value)\` receives the whole item.
|
|
8391
|
-
// It is not an error, so it lands silently: the wrong value is
|
|
8392
|
-
// stored and only surfaces much later.
|
|
8393
|
-
if (v && typeof v === 'function' && ((v._isSignal && !v._isStxLoopItem) || v._isDerived)
|
|
8394
|
-
&& (expressionCallsSignal(value, k) || expressionUsesSignalApi(value, k))) {
|
|
8395
|
-
return 'var ' + k + ' = __s["' + k + '"]';
|
|
8396
|
-
}
|
|
8397
|
-
return 'var ' + k + ' = __s["' + k + '"] && typeof __s["' + k + '"] === "function" && (__s["' + k + '"]._isSignal || __s["' + k + '"]._isDerived) ? __s["' + k + '"]() : __s["' + k + '"]';
|
|
8398
|
-
}).join(';');
|
|
8399
|
-
var fn3 = __stxCompile(['__s', '$event'], unwrapVars + ';' + value);
|
|
8400
|
-
fn3(eventCapturedScope, handlerEvent);
|
|
8401
|
-
} else {
|
|
8402
|
-
var fn = __stxCompileScoped(eventCapturedScope, ['$event'], value);
|
|
8403
|
-
fn(...__stxArgs(fn, eventCapturedScope), handlerEvent);
|
|
8404
|
-
}
|
|
8405
|
-
}
|
|
8406
|
-
catch (e) {
|
|
8407
|
-
// See #1694: dropping the TypeError/ReferenceError carve-out for inline
|
|
8408
|
-
// handlers \u2014 same reason as executeHandler above. Silencing these hid
|
|
8409
|
-
// the substring-detector bug (auto-unwrap missing .set( inside helper
|
|
8410
|
-
// calls) for ~30min of bisecting in the field.
|
|
8411
|
-
console.warn('[STX] Handler error:', value, e);
|
|
8412
|
-
}
|
|
8413
|
-
}, {
|
|
8414
|
-
capture: modifiers.includes('capture'),
|
|
8415
|
-
// A touch or wheel listener that is not passive holds every scroll
|
|
8416
|
-
// starting on the element until this thread has run it. Passive
|
|
8417
|
-
// unless .prevent needs preventDefault() or .nonpassive asks.
|
|
8418
|
-
passive: modifiers.includes('passive')
|
|
8419
|
-
|| (/^(touchstart|touchmove|wheel|mousewheel)$/i.test(eventName)
|
|
8420
|
-
&& !modifiers.includes('prevent') && !modifiers.includes('nonpassive')),
|
|
8421
|
-
once: modifiers.includes('once')
|
|
8422
|
-
});
|
|
8918
|
+
listenTemplateEvent(el, eventName, modifiers, value, eventCapturedScope, isForwardedComponentEvent);
|
|
8423
8919
|
el.removeAttribute(name);
|
|
8424
8920
|
}
|
|
8425
8921
|
});
|
|
@@ -8439,10 +8935,312 @@ catch (e) {
|
|
|
8439
8935
|
processElement(child, scope);
|
|
8440
8936
|
});
|
|
8441
8937
|
}
|
|
8442
|
-
}
|
|
8938
|
+
}
|
|
8939
|
+
|
|
8940
|
+
// A bound attribute's new value, written as the element's kind wants it:
|
|
8941
|
+
// live properties for form controls, strings for aria-/data- booleans, a
|
|
8942
|
+
// structured value kept structured for a native host. Shared by
|
|
8943
|
+
// processElement and the native row plans so both write a value one way.
|
|
8944
|
+
function applyBoundAttribute(el, attrName, v, attributesVisible, urlWarning) {
|
|
8945
|
+
// Form control values are live DOM properties. Setting only the HTML
|
|
8946
|
+
// attribute does not update a <select>'s chosen option and can leave
|
|
8947
|
+
// inputs displaying stale text after a reactive update.
|
|
8948
|
+
if (attrName === 'value' && 'value' in el) {
|
|
8949
|
+
var controlValue = v;
|
|
8950
|
+
if (typeof v === 'object' && v !== null) {
|
|
8951
|
+
try { controlValue = JSON.stringify(v); }
|
|
8952
|
+
catch (e) { controlValue = String(v); }
|
|
8953
|
+
}
|
|
8954
|
+
controlValue = v === false || v === null || v === undefined ? '' : String(controlValue);
|
|
8955
|
+
el.__stx_bound_value = controlValue;
|
|
8956
|
+
var applyControlValue = function() {
|
|
8957
|
+
if (!attributesVisible()) return;
|
|
8958
|
+
var desiredValue = el.__stx_bound_value == null ? '' : String(el.__stx_bound_value);
|
|
8959
|
+
el.value = desiredValue;
|
|
8960
|
+
if (desiredValue === '' && el.tagName !== 'OPTION') el.removeAttribute(attrName);
|
|
8961
|
+
else if (el.getAttribute(attrName) !== desiredValue) el.setAttribute(attrName, desiredValue);
|
|
8962
|
+
if (typeof el.__stx_model_sync === 'function') el.__stx_model_sync();
|
|
8963
|
+
};
|
|
8964
|
+
applyControlValue();
|
|
8965
|
+
|
|
8966
|
+
// A select's value binding is processed before its child
|
|
8967
|
+
// directives. When a nested :for creates the matching options
|
|
8968
|
+
// afterward, the browser otherwise leaves the first option
|
|
8969
|
+
// selected. Keep the desired value and reapply it whenever the
|
|
8970
|
+
// option tree changes, including later reactive list updates.
|
|
8971
|
+
if (el.tagName === 'SELECT' && !el.__stx_value_observer && typeof window.MutationObserver !== 'undefined') {
|
|
8972
|
+
el.__stx_value_observer = new window.MutationObserver(applyControlValue);
|
|
8973
|
+
el.__stx_value_observer.observe(el, {
|
|
8974
|
+
childList: true,
|
|
8975
|
+
subtree: true,
|
|
8976
|
+
attributes: true,
|
|
8977
|
+
attributeFilter: ['value'],
|
|
8978
|
+
});
|
|
8979
|
+
el.__stx_destroy = el.__stx_destroy || [];
|
|
8980
|
+
el.__stx_destroy.push(function() {
|
|
8981
|
+
if (el.__stx_value_observer) el.__stx_value_observer.disconnect();
|
|
8982
|
+
el.__stx_value_observer = null;
|
|
8983
|
+
});
|
|
8984
|
+
}
|
|
8985
|
+
return;
|
|
8986
|
+
}
|
|
8987
|
+
// Checked, selected, and indeterminate are live DOM properties, just like value.
|
|
8988
|
+
// Updating only the HTML attribute leaves a user-touched checkbox or
|
|
8989
|
+
// radio in its previous state because the property becomes dirty.
|
|
8990
|
+
// Indeterminate has no corresponding effective HTML attribute at all.
|
|
8991
|
+
if ((attrName === 'checked' || attrName === 'selected' || attrName === 'indeterminate') && attrName in el) {
|
|
8992
|
+
var selectedState = Boolean(v);
|
|
8993
|
+
el[attrName] = selectedState;
|
|
8994
|
+
if (attrName === 'indeterminate') {
|
|
8995
|
+
el.removeAttribute(attrName);
|
|
8996
|
+
}
|
|
8997
|
+
else if (selectedState) {
|
|
8998
|
+
el.setAttribute(attrName, '');
|
|
8999
|
+
}
|
|
9000
|
+
else {
|
|
9001
|
+
el.removeAttribute(attrName);
|
|
9002
|
+
}
|
|
9003
|
+
return;
|
|
9004
|
+
}
|
|
9005
|
+
// aria-* and data-* carry a STRING: the platform's boolean attribute
|
|
9006
|
+
// is presence, which cannot say "false" and wrote data-open="" for
|
|
9007
|
+
// true, so a [data-open='true'] selector never matched. React renders
|
|
9008
|
+
// both as "true" / "false", and so does this.
|
|
9009
|
+
if ((attrName.startsWith('aria-') || attrName.startsWith('data-')) && typeof v === 'boolean') {
|
|
9010
|
+
stxHost.setAttribute(el, attrName, String(v));
|
|
9011
|
+
}
|
|
9012
|
+
else if (typeof v === 'boolean') {
|
|
9013
|
+
stxHost.setAttribute(el, attrName, v);
|
|
9014
|
+
}
|
|
9015
|
+
else if (v === null || v === undefined) {
|
|
9016
|
+
stxHost.removeAttribute(el, attrName);
|
|
9017
|
+
}
|
|
9018
|
+
else {
|
|
9019
|
+
var attrValue = v;
|
|
9020
|
+
if (typeof v === 'object') {
|
|
9021
|
+
try { attrValue = JSON.stringify(v); }
|
|
9022
|
+
catch (e) { attrValue = String(v); }
|
|
9023
|
+
}
|
|
9024
|
+
var attrValueSafe = __stxSafeUrlAttr(attrName, attrValue, urlWarning);
|
|
9025
|
+
// Keep structured values structured for non-DOM hosts. The DOM
|
|
9026
|
+
// host serializes them at its boundary, preserving web output.
|
|
9027
|
+
var hostValue = (typeof v === 'object' && v !== null) ? v : attrValueSafe;
|
|
9028
|
+
// Writing the value an attribute already has is not nothing: a
|
|
9029
|
+
// frame given its own src again loads again (an entry in the
|
|
9030
|
+
// page's history each time) and a video restarts. A player whose
|
|
9031
|
+
// rest and next set share a video re-set it on every step.
|
|
9032
|
+
if (el.getAttribute(attrName) === String(attrValueSafe)) return;
|
|
9033
|
+
// A frame already on the page that is pointed somewhere else
|
|
9034
|
+
// navigates, and every navigation is an entry in the page's own
|
|
9035
|
+
// history: a player showing a video per step left one per step,
|
|
9036
|
+
// and Back had to be tapped through all of them before it left
|
|
9037
|
+
// the screen. Out of the page and back in, the frame starts afresh
|
|
9038
|
+
// (its first load adds no entry, and its old entries go with it).
|
|
9039
|
+
var parentNode = el.parentNode;
|
|
9040
|
+
if (attrName === 'src' && el.tagName === 'IFRAME' && parentNode && el.isConnected
|
|
9041
|
+
&& el.hasAttribute('src') && el.getAttribute('src') !== String(attrValueSafe)) {
|
|
9042
|
+
var nextSibling = el.nextSibling;
|
|
9043
|
+
parentNode.removeChild(el);
|
|
9044
|
+
stxHost.setAttribute(el, attrName, hostValue);
|
|
9045
|
+
parentNode.insertBefore(el, nextSibling);
|
|
9046
|
+
}
|
|
9047
|
+
else {
|
|
9048
|
+
stxHost.setAttribute(el, attrName, hostValue);
|
|
9049
|
+
}
|
|
9050
|
+
}
|
|
9051
|
+
}
|
|
9052
|
+
|
|
9053
|
+
// An authored @event listener. The scope is re-read for a forwarded
|
|
9054
|
+
// component event, whose caller can be resolved after the listener is bound.
|
|
9055
|
+
function listenTemplateEvent(el, eventName, modifiers, value, eventCapturedScope, isForwardedComponentEvent) {
|
|
9056
|
+
stxHost.listen(el, eventName, (event) => {
|
|
9057
|
+
// A forwarded handler belongs to the caller, whose scope can be
|
|
9058
|
+
// resolved again after this listener is bound: a component inside
|
|
9059
|
+
// another component's :if, in a dialog, was bound against the
|
|
9060
|
+
// page's scope and only later handed its real caller, so
|
|
9061
|
+
// @pick="pickFromBank" found nothing and did nothing. Read it now.
|
|
9062
|
+
if (isForwardedComponentEvent && el.__stx_parent_scope)
|
|
9063
|
+
eventCapturedScope = layerTemplateScopes(globalHelpers, el.__stx_parent_scope);
|
|
9064
|
+
// Vue-style component listeners fall through to the rendered native
|
|
9065
|
+
// root unless the child emits the same event. Signal components use
|
|
9066
|
+
// a scope wrapper, so native events arrive here from a descendant.
|
|
9067
|
+
// Ignore that native event only after defineEmits() has declared or
|
|
9068
|
+
// emitted the same name, preventing submit/click handlers from
|
|
9069
|
+
// firing once for the native event and again for the CustomEvent.
|
|
9070
|
+
var componentEmits = el.__stx_component_emits;
|
|
9071
|
+
if (isForwardedComponentEvent && event.target !== el
|
|
9072
|
+
&& componentEmits && componentEmits[eventName]) return;
|
|
9073
|
+
|
|
9074
|
+
// Vue-style component handlers receive the emitted payload directly.
|
|
9075
|
+
// Native root events still receive the Event object so server-only
|
|
9076
|
+
// components can forward clicks and other browser events.
|
|
9077
|
+
var emittedArgs = isForwardedComponentEvent && event instanceof CustomEvent
|
|
9078
|
+
&& Array.isArray(event.__stx_emit_args) ? event.__stx_emit_args : null;
|
|
9079
|
+
var handlerEvent = emittedArgs ? emittedArgs[0]
|
|
9080
|
+
: isForwardedComponentEvent && event instanceof CustomEvent ? event.detail : event;
|
|
9081
|
+
|
|
9082
|
+
// Skip an opener click that reaches UI which just became visible in
|
|
9083
|
+
// this frame. A click whose target is inside the revealed subtree is
|
|
9084
|
+
// a real interaction and must not be discarded, especially for
|
|
9085
|
+
// async lists whose controls are usable as soon as they render.
|
|
9086
|
+
if (eventName === 'click') {
|
|
9087
|
+
var ancestor = el;
|
|
9088
|
+
while (ancestor) {
|
|
9089
|
+
if (ancestor.__stx_shown_at
|
|
9090
|
+
&& (performance.now() - ancestor.__stx_shown_at) < 50
|
|
9091
|
+
&& !(ancestor.contains && ancestor.contains(event.target))) return;
|
|
9092
|
+
ancestor = ancestor.parentElement;
|
|
9093
|
+
}
|
|
9094
|
+
}
|
|
9095
|
+
// System key modifiers
|
|
9096
|
+
if (modifiers.includes('self') && event.target !== el) return;
|
|
9097
|
+
if (modifiers.includes('ctrl') && !event.ctrlKey) return;
|
|
9098
|
+
if (modifiers.includes('alt') && !event.altKey) return;
|
|
9099
|
+
if (modifiers.includes('shift') && !event.shiftKey) return;
|
|
9100
|
+
if (modifiers.includes('meta') && !event.metaKey) return;
|
|
9101
|
+
// Key modifiers
|
|
9102
|
+
for (var mi = 0; mi < modifiers.length; mi++) {
|
|
9103
|
+
if (KEY_MAP[modifiers[mi]] && event.key !== KEY_MAP[modifiers[mi]]) return;
|
|
9104
|
+
}
|
|
9105
|
+
if (modifiers.includes('prevent')) event.preventDefault();
|
|
9106
|
+
if (modifiers.includes('stop')) event.stopPropagation();
|
|
9107
|
+
// Execute with captured scope (includes @for loop variables)
|
|
9108
|
+
// For x-data scopes, expressions like "mobileOpen = !mobileOpen" need to
|
|
9109
|
+
// read the signal value AND write back through the signal's setter.
|
|
9110
|
+
try {
|
|
9111
|
+
if (!value || /^__[A-Z_]+__$/.test(value.trim())) return;
|
|
9112
|
+
var shorthandFn = parseEventShorthand(value, eventCapturedScope);
|
|
9113
|
+
if (shorthandFn) { shorthandFn.apply(null, emittedArgs || [handlerEvent]); return; }
|
|
9114
|
+
// Check if any scope values are signals (x-data pattern)
|
|
9115
|
+
// A derived value reads like a signal in a handler, as it does in a
|
|
9116
|
+
// binding: \`pick(selectedPackage)\` passes the package. Leaving it
|
|
9117
|
+
// out handed the handler the derived's getter function, so
|
|
9118
|
+
// \`selectedPackage.trainer_id\` was undefined with nothing said.
|
|
9119
|
+
// Only the names the handler mentions. A page's scope holds
|
|
9120
|
+
// hundreds; reading, testing and declaring every one of them on
|
|
9121
|
+
// each click or hover cost far more than the handler itself.
|
|
9122
|
+
var handlerNames = __stxNamesIn(value).filter(function(k) {
|
|
9123
|
+
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k) && (k in eventCapturedScope);
|
|
9124
|
+
});
|
|
9125
|
+
var hasSignals = handlerNames.some(function(k) {
|
|
9126
|
+
var v = eventCapturedScope[k];
|
|
9127
|
+
return v && typeof v === 'function' && (v._isSignal || v._isDerived);
|
|
9128
|
+
});
|
|
9129
|
+
// Only use signal read/write proxy for DIRECT assignment expressions
|
|
9130
|
+
// like "count = count + 1" or "open = !open". Function calls like
|
|
9131
|
+
// "openModal()" handle their own signal.set() internally \u2014 the writeback
|
|
9132
|
+
// would RESET signals to their pre-handler values.
|
|
9133
|
+
var isDirectAssignment = hasSignals && /^[a-zA-Z_$]\\w*\\s*=/.test(value.trim()) && !value.trim().startsWith('==');
|
|
9134
|
+
if (isDirectAssignment) {
|
|
9135
|
+
var getVars = handlerNames.map(function(k) {
|
|
9136
|
+
return 'var ' + k + ' = __s["' + k + '"] && typeof __s["' + k + '"] === "function" && (__s["' + k + '"]._isSignal || __s["' + k + '"]._isDerived) ? __s["' + k + '"]() : __s["' + k + '"]';
|
|
9137
|
+
}).join(';');
|
|
9138
|
+
var setVars = handlerNames.filter(function(k) {
|
|
9139
|
+
var v = eventCapturedScope[k];
|
|
9140
|
+
return v && typeof v === 'function' && v._isSignal;
|
|
9141
|
+
}).map(function(k) {
|
|
9142
|
+
return 'if(' + k + ' !== __s["' + k + '"]()) __s["' + k + '"].set(' + k + ')';
|
|
9143
|
+
}).join(';');
|
|
9144
|
+
var body = getVars + ';' + value + ';' + setVars;
|
|
9145
|
+
var fn2 = __stxCompile(['__s', '$event'], body);
|
|
9146
|
+
fn2(eventCapturedScope, handlerEvent);
|
|
9147
|
+
} else if (hasSignals) {
|
|
9148
|
+
// Function calls with signals in scope keep any signal used through
|
|
9149
|
+
// its object API as a raw signal function, and unwrap the rest for
|
|
9150
|
+
// primitive reads.
|
|
9151
|
+
var unwrapVars = handlerNames.map(function(k) {
|
|
9152
|
+
var v = eventCapturedScope[k];
|
|
9153
|
+
// A :for item is a signal only as an implementation detail, so
|
|
9154
|
+
// that keyed rows can update in place. Its \`.value\` is a field
|
|
9155
|
+
// on the item, never the signal compatibility API \u2014 the same
|
|
9156
|
+
// rule createAutoUnwrapProxy states for binding expressions.
|
|
9157
|
+
// Without the carve-out, expressionUsesSignalApi sees
|
|
9158
|
+
// \`option.value\` and hands the handler the raw signal, so a
|
|
9159
|
+
// handler like \`pick(option.value)\` receives the whole item.
|
|
9160
|
+
// It is not an error, so it lands silently: the wrong value is
|
|
9161
|
+
// stored and only surfaces much later.
|
|
9162
|
+
if (v && typeof v === 'function' && ((v._isSignal && !v._isStxLoopItem) || v._isDerived)
|
|
9163
|
+
&& (expressionCallsSignal(value, k) || expressionUsesSignalApi(value, k))) {
|
|
9164
|
+
return 'var ' + k + ' = __s["' + k + '"]';
|
|
9165
|
+
}
|
|
9166
|
+
return 'var ' + k + ' = __s["' + k + '"] && typeof __s["' + k + '"] === "function" && (__s["' + k + '"]._isSignal || __s["' + k + '"]._isDerived) ? __s["' + k + '"]() : __s["' + k + '"]';
|
|
9167
|
+
}).join(';');
|
|
9168
|
+
var fn3 = __stxCompile(['__s', '$event'], unwrapVars + ';' + value);
|
|
9169
|
+
fn3(eventCapturedScope, handlerEvent);
|
|
9170
|
+
} else {
|
|
9171
|
+
var fn = __stxCompileScoped(eventCapturedScope, ['$event'], value);
|
|
9172
|
+
fn(...__stxArgs(fn, eventCapturedScope), handlerEvent);
|
|
9173
|
+
}
|
|
9174
|
+
}
|
|
9175
|
+
catch (e) {
|
|
9176
|
+
// See #1694: dropping the TypeError/ReferenceError carve-out for inline
|
|
9177
|
+
// handlers \u2014 same reason as executeHandler above. Silencing these hid
|
|
9178
|
+
// the substring-detector bug (auto-unwrap missing .set( inside helper
|
|
9179
|
+
// calls) for ~30min of bisecting in the field.
|
|
9180
|
+
console.warn('[STX] Handler error:', value, e);
|
|
9181
|
+
}
|
|
9182
|
+
}, {
|
|
9183
|
+
capture: modifiers.includes('capture'),
|
|
9184
|
+
// A touch or wheel listener that is not passive holds every scroll
|
|
9185
|
+
// starting on the element until this thread has run it. Passive
|
|
9186
|
+
// unless .prevent needs preventDefault() or .nonpassive asks.
|
|
9187
|
+
passive: modifiers.includes('passive')
|
|
9188
|
+
|| (/^(touchstart|touchmove|wheel|mousewheel)$/i.test(eventName)
|
|
9189
|
+
&& !modifiers.includes('prevent') && !modifiers.includes('nonpassive')),
|
|
9190
|
+
once: modifiers.includes('once')
|
|
9191
|
+
});
|
|
9192
|
+
}
|
|
9193
|
+
`}var rt=` // ==========================================================================
|
|
8443
9194
|
// Auto-unwrap Signals (Feature #1)
|
|
8444
9195
|
// ==========================================================================
|
|
8445
9196
|
|
|
9197
|
+
// One handler class for every auto-unwrap proxy: an expression is
|
|
9198
|
+
// evaluated through a fresh one each time it runs, and a handler object
|
|
9199
|
+
// with closures of its own per proxy was a cost every binding paid in an
|
|
9200
|
+
// interpreter. A handler knows how to keep a signal either by a callback
|
|
9201
|
+
// (preserveSignal) or, for an expression, by what the expression does with
|
|
9202
|
+
// the name (expressionKeepsSignal), which needs no closure at all.
|
|
9203
|
+
function StxAutoUnwrapHandler(preserveSignal, expression) {
|
|
9204
|
+
this.preserveSignal = preserveSignal;
|
|
9205
|
+
this.expression = expression;
|
|
9206
|
+
}
|
|
9207
|
+
StxAutoUnwrapHandler.prototype.get = function(target, prop) {
|
|
9208
|
+
const val = target[prop];
|
|
9209
|
+
// If it's a signal or derived, call it to get the value
|
|
9210
|
+
if (val && typeof val === 'function' && (val._isSignal || val._isDerived)) {
|
|
9211
|
+
// Loop variables are implementation-detail signals so keyed rows can
|
|
9212
|
+
// update reactively. In template expressions they must behave like
|
|
9213
|
+
// their item value, including for objects with fields named value,
|
|
9214
|
+
// set, or subscribe. Otherwise item.value is mistaken for the
|
|
9215
|
+
// signal compatibility API and resolves to the whole item object.
|
|
9216
|
+
if (val._isStxLoopItem) return val();
|
|
9217
|
+
if (this.expression !== null) {
|
|
9218
|
+
if (expressionKeepsSignal(this.expression, prop, val)) return val;
|
|
9219
|
+
}
|
|
9220
|
+
else if (this.preserveSignal && this.preserveSignal(prop, val)) return val;
|
|
9221
|
+
return val();
|
|
9222
|
+
}
|
|
9223
|
+
// If it's an stx store, return a recursively-unwrapping wrapper so
|
|
9224
|
+
// store.signalProp resolves to the value in template expressions
|
|
9225
|
+
if (val && typeof val === 'object' && val._isStxStore) {
|
|
9226
|
+
return new Proxy(val, this);
|
|
9227
|
+
}
|
|
9228
|
+
return val;
|
|
9229
|
+
};
|
|
9230
|
+
StxAutoUnwrapHandler.prototype.set = function(target, prop, value) {
|
|
9231
|
+
const cur = target[prop];
|
|
9232
|
+
if (cur && typeof cur === 'function' && cur._isSignal && typeof cur.set === 'function') {
|
|
9233
|
+
cur.set(value);
|
|
9234
|
+
return true;
|
|
9235
|
+
}
|
|
9236
|
+
target[prop] = value;
|
|
9237
|
+
return true;
|
|
9238
|
+
};
|
|
9239
|
+
|
|
9240
|
+
// The scope an auto-unwrap proxy reads, so compiling an expression asks
|
|
9241
|
+
// the scope itself which names it holds rather than through the proxy.
|
|
9242
|
+
const __stxUnwrapTargetOf = new WeakMap();
|
|
9243
|
+
|
|
8446
9244
|
// Create a proxy that auto-unwraps signals when accessed.
|
|
8447
9245
|
// For stx stores (objects with _isStxStore), recursively wrap so nested
|
|
8448
9246
|
// signal properties auto-unwrap too \u2014 this is what makes template
|
|
@@ -8450,37 +9248,15 @@ catch (e) {
|
|
|
8450
9248
|
// resolve to the value. Action methods on the store pass through as
|
|
8451
9249
|
// functions because they don't carry _isSignal/_isDerived markers.
|
|
8452
9250
|
function createAutoUnwrapProxy(scope, preserveSignal) {
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
// signal compatibility API and resolves to the whole item object.
|
|
8463
|
-
if (val._isStxLoopItem) return val();
|
|
8464
|
-
if (preserveSignal && preserveSignal(prop, val)) return val;
|
|
8465
|
-
return val();
|
|
8466
|
-
}
|
|
8467
|
-
// If it's an stx store, return a recursively-unwrapping wrapper so
|
|
8468
|
-
// store.signalProp resolves to the value in template expressions
|
|
8469
|
-
if (val && typeof val === 'object' && val._isStxStore) {
|
|
8470
|
-
return createAutoUnwrapProxy(val, preserveSignal);
|
|
8471
|
-
}
|
|
8472
|
-
return val;
|
|
8473
|
-
},
|
|
8474
|
-
set(target, prop, value) {
|
|
8475
|
-
const cur = target[prop];
|
|
8476
|
-
if (cur && typeof cur === 'function' && cur._isSignal && typeof cur.set === 'function') {
|
|
8477
|
-
cur.set(value);
|
|
8478
|
-
return true;
|
|
8479
|
-
}
|
|
8480
|
-
target[prop] = value;
|
|
8481
|
-
return true;
|
|
8482
|
-
}
|
|
8483
|
-
});
|
|
9251
|
+
const proxy = new Proxy(scope, new StxAutoUnwrapHandler(preserveSignal || null, null));
|
|
9252
|
+
__stxUnwrapTargetOf.set(proxy, scope);
|
|
9253
|
+
return proxy;
|
|
9254
|
+
}
|
|
9255
|
+
|
|
9256
|
+
function createExpressionUnwrapProxy(scope, expression) {
|
|
9257
|
+
const proxy = new Proxy(scope, new StxAutoUnwrapHandler(null, expression));
|
|
9258
|
+
__stxUnwrapTargetOf.set(proxy, scope);
|
|
9259
|
+
return proxy;
|
|
8484
9260
|
}
|
|
8485
9261
|
|
|
8486
9262
|
// A proxy for the WRITE side of x-model, kept separate from the read proxy
|
|
@@ -8516,7 +9292,7 @@ catch (e) {
|
|
|
8516
9292
|
},
|
|
8517
9293
|
});
|
|
8518
9294
|
}
|
|
8519
|
-
`;function
|
|
9295
|
+
`;function ot(e){return` // Component mount system
|
|
8520
9296
|
var mountQueue = [];
|
|
8521
9297
|
|
|
8522
9298
|
// MERGE, never replace (#1804). Three client bundles assign window.stx and
|
|
@@ -8640,7 +9416,7 @@ ${e}
|
|
|
8640
9416
|
_scopes: {}, // Component-level scopes
|
|
8641
9417
|
_scopeCounter: 0, // Counter for generating unique scope IDs during SPA navigation
|
|
8642
9418
|
_latestSetup: window.__stx_latestSetup || null, // Latest SFC setup function (including scripts parsed before the runtime)
|
|
8643
|
-
_stores: new Map(), // Global store registry \u2014 survives SPA navigation`}var
|
|
9419
|
+
_stores: new Map(), // Global store registry \u2014 survives SPA navigation`}var st=` // ==========================================================================
|
|
8644
9420
|
// Template Refs (useRef)
|
|
8645
9421
|
// ==========================================================================
|
|
8646
9422
|
|
|
@@ -8672,7 +9448,7 @@ ${e}
|
|
|
8672
9448
|
Object.defineProperty(read, 'value', { get: read, enumerable: true });
|
|
8673
9449
|
return read;
|
|
8674
9450
|
}
|
|
8675
|
-
`;var
|
|
9451
|
+
`;var at=` // ==========================================================================
|
|
8676
9452
|
// Scope Disposal
|
|
8677
9453
|
// ==========================================================================
|
|
8678
9454
|
|
|
@@ -8880,7 +9656,7 @@ ${e}
|
|
|
8880
9656
|
delete scopes[id];
|
|
8881
9657
|
}
|
|
8882
9658
|
}
|
|
8883
|
-
`;var
|
|
9659
|
+
`;var it=` // Helper to process elements while skipping already-processed scoped containers
|
|
8884
9660
|
function processElementSkipScopes(el, processedScopes) {
|
|
8885
9661
|
if (processedScopes.has(el)) return;
|
|
8886
9662
|
if (el.nodeType === Node.TEXT_NODE) {
|
|
@@ -8921,7 +9697,7 @@ ${e}
|
|
|
8921
9697
|
if (el.tagName !== 'SCRIPT' && el.tagName !== 'STYLE') {
|
|
8922
9698
|
Array.from(el.childNodes).forEach(child => processElementSkipScopes(child, processedScopes));
|
|
8923
9699
|
}
|
|
8924
|
-
}`;var
|
|
9700
|
+
}`;var lt=` function bindShow(el, expr, passedScope = componentScope, attrName = '@show') {
|
|
8925
9701
|
if (el.__stx_show_bound) return;
|
|
8926
9702
|
el.__stx_show_bound = true;
|
|
8927
9703
|
|
|
@@ -8975,7 +9751,7 @@ ${e}
|
|
|
8975
9751
|
}
|
|
8976
9752
|
el.removeAttribute(attrName);
|
|
8977
9753
|
}
|
|
8978
|
-
`;var
|
|
9754
|
+
`;var ct=` // Re-initialize components after SPA content swap.
|
|
8979
9755
|
// Debounce to handle rapid re-fires (HMR triggers navigate which triggers stx:load again).
|
|
8980
9756
|
var _stxLoadTimer = null;
|
|
8981
9757
|
if (window.__stxLoadHandler) {
|
|
@@ -9016,7 +9792,7 @@ ${e}
|
|
|
9016
9792
|
var departingDestroys = null;
|
|
9017
9793
|
function beginSwap() {
|
|
9018
9794
|
departingDestroys = (departingDestroys || []).concat(destroyCallbacks.splice(0));
|
|
9019
|
-
}`;var
|
|
9795
|
+
}`;var dt=` function _handleStxLoad() {
|
|
9020
9796
|
_stxLoadTimer = null;
|
|
9021
9797
|
console.log('[stx:load] START. mountQueue:', mountQueue.length, '_latestSetup:', !!window.stx._latestSetup);
|
|
9022
9798
|
|
|
@@ -9202,7 +9978,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
|
|
|
9202
9978
|
// Everything that should have hydrated has now had its chance (#1773).
|
|
9203
9979
|
auditHydration(container, 'stx:load');
|
|
9204
9980
|
}
|
|
9205
|
-
`;var
|
|
9981
|
+
`;var ut=` // ==========================================================================
|
|
9206
9982
|
// State Signal
|
|
9207
9983
|
// ==========================================================================
|
|
9208
9984
|
|
|
@@ -9353,7 +10129,7 @@ finally {
|
|
|
9353
10129
|
function memo(compute, equals) {
|
|
9354
10130
|
return derived(compute, { equals: typeof equals === 'function' ? equals : Object.is });
|
|
9355
10131
|
}
|
|
9356
|
-
`;var
|
|
10132
|
+
`;var pt=` // \u2500\u2500 Store System \u2500\u2500
|
|
9357
10133
|
// Pinia-inspired, signals-based. Stores survive SPA navigation.
|
|
9358
10134
|
|
|
9359
10135
|
defineStore: function(id, setupOrOptions, storeOptions) {
|
|
@@ -9813,7 +10589,7 @@ finally {
|
|
|
9813
10589
|
}
|
|
9814
10590
|
console.log('[stx:store] useStore:', id);
|
|
9815
10591
|
return store;
|
|
9816
|
-
},`;var
|
|
10592
|
+
},`;var ft=` // Storage access is guarded end to end (stacksjs/stx#1793). Every one of
|
|
9817
10593
|
// these can throw, and each throw took down the whole client script for the
|
|
9818
10594
|
// page rather than just the composable:
|
|
9819
10595
|
//
|
|
@@ -9891,7 +10667,7 @@ finally {
|
|
|
9891
10667
|
window.addEventListener('storage', handler);
|
|
9892
10668
|
onDestroy(function() { window.removeEventListener('storage', handler); });
|
|
9893
10669
|
return s;
|
|
9894
|
-
}`;var
|
|
10670
|
+
}`;var mt=` function bindStyle(el, expr, passedScope = componentScope, isVisible) {
|
|
9895
10671
|
// Capture scope at setup time - use passed scope to preserve context
|
|
9896
10672
|
const capturedScope = layerTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
|
|
9897
10673
|
|
|
@@ -9926,7 +10702,7 @@ catch (e2) {
|
|
|
9926
10702
|
stxHost.setStyle(el, value, true);
|
|
9927
10703
|
});
|
|
9928
10704
|
}
|
|
9929
|
-
`;var
|
|
10705
|
+
`;var gt=` // <Suspense> boundary (#1742). Aggregates the loading/error state of every
|
|
9930
10706
|
// descendant suspense query (useQuery/useFetch with { suspense: true }) for
|
|
9931
10707
|
// which this is the nearest [data-stx-suspense] ancestor, and toggles three
|
|
9932
10708
|
// regions accordingly: [data-stx-suspense-fallback] while any query is loading,
|
|
@@ -9984,7 +10760,7 @@ catch (e2) {
|
|
|
9984
10760
|
var contentRoot = (contentEl === el) ? el : contentEl;
|
|
9985
10761
|
Array.from(contentRoot.childNodes).forEach(function(child) { processElement(child, scope); });
|
|
9986
10762
|
}
|
|
9987
|
-
`;var
|
|
10763
|
+
`;var vt=` // ==========================================================================
|
|
9988
10764
|
// Timer & Utility Composables
|
|
9989
10765
|
// ==========================================================================
|
|
9990
10766
|
|
|
@@ -10385,7 +11161,7 @@ else if (timer === null) {
|
|
|
10385
11161
|
}
|
|
10386
11162
|
};
|
|
10387
11163
|
}
|
|
10388
|
-
`;var
|
|
11164
|
+
`;var yt=` // \u2500\u2500 Tooltip runtime \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
10389
11165
|
(function() {
|
|
10390
11166
|
var tip = null;
|
|
10391
11167
|
function createTip() {
|
|
@@ -10424,7 +11200,7 @@ else if (timer === null) {
|
|
|
10424
11200
|
document.addEventListener('focusin', function(e) { var el = e.target.closest('[x-tooltip]'); if (el) show(el); });
|
|
10425
11201
|
document.addEventListener('focusout', function(e) { var el = e.target.closest('[x-tooltip]'); if (el) hide(); });
|
|
10426
11202
|
})();
|
|
10427
|
-
`;var
|
|
11203
|
+
`;var wt=` // ==========================================================================
|
|
10428
11204
|
// Toast notification system
|
|
10429
11205
|
// ==========================================================================
|
|
10430
11206
|
|
|
@@ -10720,7 +11496,7 @@ else if (timer === null) {
|
|
|
10720
11496
|
});
|
|
10721
11497
|
});
|
|
10722
11498
|
}
|
|
10723
|
-
`;var
|
|
11499
|
+
`;var _t=` // ==========================================================================
|
|
10724
11500
|
// WebSocket Composable
|
|
10725
11501
|
// ==========================================================================
|
|
10726
11502
|
|
|
@@ -10857,85 +11633,86 @@ else if (timer === null) {
|
|
|
10857
11633
|
subscribe: subscribe
|
|
10858
11634
|
};
|
|
10859
11635
|
}
|
|
10860
|
-
`;function ht(){let
|
|
10861
|
-
${
|
|
11636
|
+
`;function ht(e={}){let o=kt(Hn(e));try{let r=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(o);return r=r.replace(/\}(var |let |const |function )/g,"};$1"),r}catch{return o}}function kt(e){let o=[],l=0,r="console.log(";while(l<e.length){let d=e.indexOf(r,l);if(d===-1){o.push(e.slice(l));break}o.push(e.slice(l,d));let y=1,s=d+r.length;while(s<e.length&&y>0){let u=e[s];if(u==='"'||u==="'"||u==="`"){let h=u;s++;while(s<e.length&&e[s]!==h){if(e[s]==="\\")s++;s++}s++;continue}if(u==="(")y++;else if(u===")")y--;s++}o.push("0"),l=s}return o.join("")}function Hn(e={}){return`${ae}${Me}
|
|
11637
|
+
${Ze(ie,ke,Te)}
|
|
10862
11638
|
|
|
10863
|
-
${
|
|
10864
|
-
${
|
|
10865
|
-
${
|
|
10866
|
-
${
|
|
11639
|
+
${De}
|
|
11640
|
+
${rt}
|
|
11641
|
+
${tt}
|
|
11642
|
+
${ut}
|
|
10867
11643
|
${xe}
|
|
10868
|
-
${
|
|
10869
|
-
${
|
|
11644
|
+
${Ue}
|
|
11645
|
+
${_t}
|
|
10870
11646
|
${Ae(X.toString(),Q.toString())}
|
|
10871
|
-
${
|
|
11647
|
+
${st}
|
|
10872
11648
|
${ze}
|
|
10873
|
-
${
|
|
10874
|
-
${
|
|
11649
|
+
${Ye}
|
|
11650
|
+
${Xe}
|
|
10875
11651
|
// ==========================================================================
|
|
10876
11652
|
// Template Binding
|
|
10877
11653
|
// ==========================================================================
|
|
10878
11654
|
|
|
10879
11655
|
${Ee}
|
|
10880
11656
|
${Se}
|
|
10881
|
-
${
|
|
10882
|
-
${
|
|
11657
|
+
${Re}
|
|
11658
|
+
${je}
|
|
10883
11659
|
${se}
|
|
10884
11660
|
${ue}
|
|
10885
11661
|
${me}
|
|
10886
|
-
${Ke}
|
|
10887
|
-
${tt(gl(),ml(),fl())}
|
|
10888
|
-
|
|
10889
|
-
${mt}
|
|
10890
|
-
${it}
|
|
10891
11662
|
${Ge}
|
|
11663
|
+
${nt(ml(),hl(),gl())}
|
|
11664
|
+
|
|
11665
|
+
${gt}
|
|
11666
|
+
${lt}
|
|
11667
|
+
${$e}
|
|
10892
11668
|
${ce}
|
|
10893
|
-
${
|
|
11669
|
+
${mt}
|
|
10894
11670
|
${bt}
|
|
10895
|
-
${
|
|
11671
|
+
${qe}
|
|
10896
11672
|
${pe}
|
|
10897
|
-
${
|
|
11673
|
+
${Ke}
|
|
10898
11674
|
${Ne}
|
|
10899
|
-
${
|
|
10900
|
-
${
|
|
10901
|
-
${
|
|
11675
|
+
${e.native?Ie:""}
|
|
11676
|
+
${Be}
|
|
11677
|
+
${he}
|
|
11678
|
+
${Ve}
|
|
10902
11679
|
${Fe}
|
|
10903
11680
|
${de}
|
|
10904
|
-
${
|
|
11681
|
+
${vt}
|
|
10905
11682
|
${re}
|
|
10906
|
-
${
|
|
11683
|
+
${et}
|
|
10907
11684
|
|
|
10908
|
-
${
|
|
11685
|
+
${ft}
|
|
10909
11686
|
|
|
10910
11687
|
var useBroadcastStream = ${ne.toString()};
|
|
10911
11688
|
|
|
10912
|
-
${
|
|
11689
|
+
${He(J.toString(),Y.toString(),ee.toString(),Z.toString(),te.toString())}
|
|
10913
11690
|
${ve}
|
|
10914
|
-
${oe(
|
|
10915
|
-
${
|
|
10916
|
-
${
|
|
11691
|
+
${oe(z.toString())}
|
|
11692
|
+
${Oe}
|
|
11693
|
+
${wt}
|
|
10917
11694
|
|
|
10918
|
-
${
|
|
11695
|
+
${Qe}
|
|
10919
11696
|
${ye}
|
|
10920
11697
|
${_e}
|
|
10921
|
-
${
|
|
10922
|
-
${
|
|
10923
|
-
${
|
|
11698
|
+
${yt}
|
|
11699
|
+
${Pe}
|
|
11700
|
+
${ot(fe)}
|
|
10924
11701
|
|
|
10925
|
-
${
|
|
11702
|
+
${pt}
|
|
10926
11703
|
|
|
10927
|
-
${
|
|
11704
|
+
${We}
|
|
10928
11705
|
});
|
|
10929
11706
|
|
|
10930
11707
|
${Ce}
|
|
10931
|
-
${be}
|
|
10932
11708
|
${we}
|
|
10933
|
-
${
|
|
10934
|
-
${
|
|
11709
|
+
${be}
|
|
11710
|
+
${at}
|
|
11711
|
+
${Le}
|
|
10935
11712
|
${ge}
|
|
10936
|
-
${lt}
|
|
10937
11713
|
${ct}
|
|
10938
|
-
${
|
|
11714
|
+
${dt}
|
|
11715
|
+
${it}
|
|
10939
11716
|
})();
|
|
10940
|
-
`}var
|
|
10941
|
-
export{ht,Hn,
|
|
11717
|
+
`}var ch={state:le,derived:Vn,effect:Un,batch:wo,onMount:Jr,onDestroy:Yr,isSignal:Wn,isDerived:qn,untrack:vo,peek:Zr,generateSignalsRuntime:ht,generateSignalsRuntimeDev:Hn};
|
|
11718
|
+
export{ht,Hn,ch};
|