xote 2.0.0 → 3.0.0
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/xote.cjs +1 -1
- package/dist/xote.mjs +535 -414
- package/dist/xote.umd.js +1 -1
- package/package.json +1 -1
package/dist/xote.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(m,j){typeof exports=="object"&&typeof module<"u"?j(exports):typeof define=="function"&&define.amd?define(["exports"],j):(m=typeof globalThis<"u"?globalThis:m||self,j(m.xote={}))})(this,(function(m){"use strict";function j(e){return e===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function je(e){if(e!=null)return j(e)}function a(e){if(e===null||e.BS_PRIVATE_NESTED_SOME_NONE===void 0)return e;let t=e.BS_PRIVATE_NESTED_SOME_NONE;if(t!==0)return{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}function Me(e,t){return e!==void 0?a(e):t}function Ne(e){return e!==void 0}let J={contents:0};function W(){return J.contents=J.contents+1|0,J.contents}function M(e){return e!==void 0?e.h:0}function S(e,t,n,r){let l=M(e),u=M(r);return{k:t,v:n,h:l>=u?l+1|0:u+1|0,l:e,r}}function we(e,t){return{k:e,v:t,h:1,l:void 0,r:void 0}}function Pe(e,t){return e.v===t?e:{k:e.k,v:t,h:e.h,l:e.l,r:e.r}}function N(e,t,n,r){let l=e!==void 0?e.h:0,u=r!==void 0?r.h:0;if(l>(u+2|0)){let f=e.l,d=e.r;return M(f)>=M(d)?S(f,e.k,e.v,S(d,t,n,r)):S(S(f,e.k,e.v,d.l),d.k,d.v,S(d.r,t,n,r))}if(u<=(l+2|0))return{k:t,v:n,h:l>=u?l+1|0:u+1|0,l:e,r};let i=r.l,o=r.r;return M(o)>=M(i)?S(S(e,t,n,i),r.k,r.v,o):S(S(e,t,n,i.l),i.k,i.v,S(i.r,r.k,r.v,o))}function fe(e,t,n){let r=e.l;return r!==void 0?N(fe(r,t,n),e.k,e.v,e.r):(t.contents=e.k,n.contents=e.v,e.r)}function Re(e,t){for(;;){let n=e;if(n===void 0)return;let r=n.k;if(t===r)return j(n.v);e=t<r?n.l:n.r}}function A(e,t,n){if(e===void 0)return we(t,n);let r=e.k;if(t===r)return Pe(e,n);let l=e.v;return t<r?N(A(e.l,t,n),r,l,e.r):N(e.l,r,l,A(e.r,t,n))}function q(e,t){let n=e.k,r=e.l,l=e.r;if(t===n){if(r===void 0)return l;if(l===void 0)return r;let i={contents:l.k},o={contents:l.v},f=fe(l,i,o);return N(r,i.contents,o.contents,f)}if(t<n){if(r===void 0)return e;let i=q(r,t);return i===r?e:N(i,n,e.v,l)}if(l===void 0)return e;let u=q(l,t);return N(r,n,e.v,u)}function Ge(e,t){if(e!==void 0)return q(e,t)}let _=Re;function De(e){if(e!==void 0)return a(e);throw{RE_EXN_ID:"Not_found",Error:new Error}}let de=De;function E(e,t,n){let r=e!==void 0?e.h:0,l=n!==void 0?n.h:0;return{v:t,h:(r>=l?r:l)+1|0,l:e,r:n}}function Xe(e){return{v:e,h:1,l:void 0,r:void 0}}function ce(e,t){return t!==void 0?e!==void 0?e.h>=t.h:!1:!0}function w(e,t,n){let r=e!==void 0?e.h:0,l=n!==void 0?n.h:0;if(r>(l+2|0)){let o=e.l,f=e.r;return ce(o,f)?E(o,e.v,E(f,t,n)):E(E(o,e.v,f.l),f.v,E(f.r,t,n))}if(l<=(r+2|0))return{v:t,h:(r>=l?r:l)+1|0,l:e,r:n};let u=n.l,i=n.r;return ce(i,u)?E(E(e,t,u),n.v,i):E(E(e,t,u.l),u.v,E(u.r,n.v,i))}function se(e,t){let n=e.l;return n!==void 0?w(se(n,t),e.v,e.r):(t.contents=e.v,e.r)}function ae(e,t){for(;;){let n=e;if(n===void 0)return;ae(n.l,t),t(n.v),e=n.r}}function H(e){let t=e.l,n=e.r,r=t!==void 0?H(t):0,l=n!==void 0?H(n):0;return(1+r|0)+l|0}function he(e,t,n){for(;;){let r=t,l=e,u=l.v,i=l.l,o=l.r,f=i!==void 0?he(i,r,n):r;n[f]=u;let d=f+1|0;if(o===void 0)return d;t=d,e=o}}function ze(e){if(e===void 0)return[];let t=H(e),n=new Array(t);return he(e,0,n),n}function Le(e,t){for(;;){let n=e;if(n===void 0)return!1;let r=n.v;if(t===r)return!0;e=t<r?n.l:n.r}}function P(e,t){if(e===void 0)return Xe(t);let n=e.v;if(t===n)return e;let r=e.l,l=e.r;if(t<n){let i=P(r,t);return i===r?e:w(i,n,l)}let u=P(l,t);return u===l?e:w(r,n,u)}function U(e,t){if(e===void 0)return e;let n=e.v,r=e.l,l=e.r;if(t===n){if(r===void 0)return l;if(l===void 0)return r;let i={contents:l.v},o=se(l,i);return w(r,i.contents,o)}if(t<n){let i=U(r,t);return i===r?e:w(i,n,l)}let u=U(l,t);return u===l?e:w(r,n,u)}let Ve=Le,C=ae,Be=ze,pe=(function(e,t){for(var n in e)t(n)});function Q(e,t){if(e===t)return!0;let n=typeof e;if(n==="string"||n==="number"||n==="bigint"||n==="boolean"||n==="undefined"||e===null)return!1;let r=typeof t;if(n==="function"||r==="function")throw{RE_EXN_ID:"Invalid_argument",_1:"equal: functional value",Error:new Error};if(r==="number"||r==="bigint"||r==="undefined"||t===null)return!1;let l=e.TAG,u=t.TAG;if(l!==u)return!1;let i=e.length|0,o=t.length|0;if(i===o)if(Array.isArray(e)){let f=0;for(;;){let d=f;if(d===i)return!0;if(!Q(e[d],t[d]))return!1;f=d+1|0}}else{if(e instanceof Date&&t instanceof Date)return!(e>t||e<t);{let f={contents:!0},d=c=>{if(!Object.prototype.hasOwnProperty.call(t,c)){f.contents=!1;return}},s=c=>{if(!Object.prototype.hasOwnProperty.call(e,c)||!Q(t[c],e[c])){f.contents=!1;return}};return pe(e,d),f.contents&&pe(t,s),f.contents}}else return!1}let p={contents:void 0},v={contents:void 0},Fe={contents:void 0},h={contents:void 0},$={contents:void 0},R={contents:!1},O={contents:!1};function F(e){if(_(v.contents,e)===void 0){v.contents=A(v.contents,e,void 0);return}}function me(e,t){F(t);let n=de(_(p.contents,e));if(!Q(h.contents,e)||Ve(n.deps,t)!==!1)return;n.deps=P(n.deps,t);let r=de(_(v.contents,t));v.contents=A(v.contents,t,P(r,e))}function D(e){C(e.deps,t=>{let n=_(v.contents,t);if(n!==void 0){v.contents=A(v.contents,t,U(a(n),e.id));return}}),e.deps=void 0}function x(e){if(typeof e.kind=="object"){let r={contents:0};return C(e.deps,l=>{let u=_(v.contents,l);if(u!==void 0)return C(a(u),i=>{if(i===e.id)return;let o=_(p.contents,i);if(o===void 0)return;if(typeof o.kind=="object"&&o.level>r.contents){r.contents=o.level;return}})}),r.contents+1|0}let n={contents:0};return C(e.deps,r=>{let l=_(v.contents,r);if(l!==void 0)return C(a(l),u=>{let i=_(p.contents,u);if(i!==void 0&&i.level>n.contents){n.contents=i.level;return}})}),n.contents+1e3|0}function Y(){for(;;){if($.contents===void 0)return;let e=$.contents;$.contents=void 0,Be(e).toSorted((n,r)=>{let l=_(p.contents,n),u=_(p.contents,r);return l!==void 0?u!==void 0?l.level-u.level|0:-1:u!==void 0?1:0}).forEach(n=>{let r=_(p.contents,n);if(r===void 0)return;D(r);let l=h.contents;h.contents=n,r.run(),h.contents=l,r.level=x(r)})}}function _e(e){if($.contents=P($.contents,e),R.contents===!1&&O.contents===!1){O.contents=!0,Y(),O.contents=!1;return}}function ve(e){F(e);let t=_(v.contents,e);if(t!==void 0)if(C(a(t),n=>{$.contents=P($.contents,n)}),R.contents===!1&&O.contents===!1){O.contents=!0,Y(),O.contents=!1;return}else return}function xe(e){let t=h.contents;h.contents=void 0;let n=e();return h.contents=t,n}function Ke(e){let t=R.contents;R.contents=!0;let n=e();if(R.contents=t,$.contents!==void 0){let r=$.contents;$.contents=void 0,C(r,_e)}return n}const Je=Object.freeze(Object.defineProperty({__proto__:null,Id:void 0,IntMap:void 0,IntSet:void 0,Observer:void 0,addDep:me,batch:Ke,batching:R,clearDeps:D,computeLevel:x,currentObserverId:h,ensureSignalBucket:F,flush:Y,flushing:O,notify:ve,observers:p,pending:$,schedule:_e,signalObservers:v,signalPeeks:Fe,untrack:xe},Symbol.toStringTag,{value:"Module"}));function X(e){let t=W(),n={id:t,kind:"Effect",run:()=>e(),deps:void 0,level:1e3};p.contents=A(p.contents,t,n),D(n);let r=h.contents;return h.contents=t,n.run(),h.contents=r,n.level=x(n),{dispose:()=>{let u=_(p.contents,t);if(u!==void 0){D(u),p.contents=Ge(p.contents,t);return}}}}const We=Object.freeze(Object.defineProperty({__proto__:null,Core:void 0,Id:void 0,IntMap:void 0,IntSet:void 0,Observer:void 0,Signal:void 0,run:X},Symbol.toStringTag,{value:"Module"}));function Z(e){let t=W();return F(t),{id:t,value:{contents:e},version:{contents:0}}}function b(e){let t=h.contents;return t!==void 0&&me(t,e.id),e.value.contents}function K(e){return e.value.contents}function T(e,t){e.value.contents=t,e.version.contents=e.version.contents+1|0,ve(e.id)}function qe(e,t){T(e,t(e.value.contents))}const He=Object.freeze(Object.defineProperty({__proto__:null,Core:void 0,Id:void 0,IntMap:void 0,IntSet:void 0,Observer:void 0,get:b,make:Z,peek:K,set:T,update:qe},Symbol.toStringTag,{value:"Module"}));function G(e){let t=Z(),n={contents:!1},r=W(),l=()=>{let o=e();return n.contents===!1&&(n.contents=!0),T(t,o)},u={id:r,kind:{NAME:"Computed",VAL:t.id},run:l,deps:void 0,level:0};p.contents=A(p.contents,r,u),D(u);let i=h.contents;return h.contents=r,u.run(),h.contents=i,u.level=x(u),t}const Ue=Object.freeze(Object.defineProperty({__proto__:null,Core:void 0,Id:void 0,IntMap:void 0,IntSet:void 0,Observer:void 0,Signal:void 0,make:G},Symbol.toStringTag,{value:"Module"}));function z(e,t){return[e,{TAG:"Static",_0:t}]}function ge(e,t){return[e,{TAG:"SignalValue",_0:t}]}function $e(e,t){return[e,{TAG:"Compute",_0:t}]}function Se(e){return{TAG:"Text",_0:e}}function Qe(e){return{TAG:"SignalText",_0:G(e)}}function ee(e){return{TAG:"Fragment",_0:e}}function te(e){return{TAG:"SignalFragment",_0:e}}function Ye(e,t){return{TAG:"SignalFragment",_0:G(()=>b(e).map(t))}}function g(e,t,n,r,l){let u=t!==void 0?t:[].map(f=>f),i=n!==void 0?n:[].map(f=>f),o=r!==void 0?r:[].map(f=>f);return{TAG:"Element",tag:e,attrs:u,events:i,children:o}}function Ze(e,t,n,r){return g("div",e,t,n)}function et(e,t,n,r){return g("span",e,t,n)}function tt(e,t,n,r){return g("button",e,t,n)}function nt(e,t,n){return g("input",e,t,void 0)}function rt(e,t,n,r){return g("h1",e,t,n)}function lt(e,t,n,r){return g("h2",e,t,n)}function ut(e,t,n,r){return g("h3",e,t,n)}function it(e,t,n,r){return g("p",e,t,n)}function ot(e,t,n,r){return g("ul",e,t,n)}function ft(e,t,n,r){return g("li",e,t,n)}function Ee(e,t,n,r){return g("a",e,t,n)}function L(e,t){let n=Me(je(e.__xote_disposers),[]);e.__xote_disposers=n.concat([t])}function ne(e){let t=e.__xote_disposers;t!=null&&(t.forEach(r=>r.dispose()),e.__xote_disposers=[]),Array.from(e.childNodes||[]).forEach(ne)}function V(e){switch(e.TAG){case"Element":let t=document.createElement(e.tag);return e.attrs.forEach(d=>{let s=d[1],c=d[0];switch(s.TAG){case"Static":t.setAttribute(c,s._0);return;case"SignalValue":let k=s._0;t.setAttribute(c,K(k));let ue=X(()=>{let oe=b(k);t.setAttribute(c,oe)});return L(t,ue);case"Compute":let ie=s._0,ke=G(()=>ie());t.setAttribute(c,K(ke));let Bt=X(()=>{let oe=b(ke);t.setAttribute(c,oe)});return L(t,Bt)}}),e.events.forEach(d=>{t.addEventListener(d[0],d[1])}),e.children.forEach(d=>{let s=V(d);t.appendChild(s)}),t;case"Text":return document.createTextNode(e._0);case"SignalText":let n=e._0,r=document.createTextNode(K(n)),l=X(()=>{let d=b(n);r.textContent=d});return L(r,l),r;case"Fragment":let u=document.createDocumentFragment();return e._0.forEach(d=>{let s=V(d);u.appendChild(s)}),u;case"SignalFragment":let i=e._0,o=document.createElement("div");o.setAttribute("data-signal-fragment","true"),o.setAttribute("style","display: contents");let f=X(()=>{let d=b(i);Array.from(o.childNodes||[]).forEach(ne),o.innerHTML="",d.forEach(c=>{let k=V(c);o.appendChild(k)})});return L(o,f),o}}function ye(e,t){let n=V(e);t.appendChild(n)}function dt(e,t){let n=document.getElementById(t);if(n==null){console.error("Container element not found: "+t);return}else return ye(e,n)}const ct=Object.freeze(Object.defineProperty({__proto__:null,Computed:void 0,Core:void 0,Effect:void 0,Signal:void 0,a:Ee,addDisposer:L,attr:z,button:tt,computedAttr:$e,disposeElement:ne,div:Ze,element:g,fragment:ee,h1:rt,h2:lt,h3:ut,input:nt,li:ft,list:Ye,mount:ye,mountById:dt,p:it,render:V,signalAttr:ge,signalFragment:te,span:et,text:Se,textSignal:Qe,ul:ot},Symbol.toStringTag,{value:"Module"}));function st(e,t){return e(t)}function at(e,t){return e(t)}function ht(e,t,n,r){return e(t)}function pt(e,t,n,r){return e(t)}function mt(e){let t=e.children;return t!==void 0?t:ee([])}let _t=ee;function vt(){return Se("")}function gt(e){return e}function $t(e){return e}function y(e,t){return typeof t=="function"?$e(e,t):typeof t=="object"&&Ne(t.id)?ge(e,t):z(e,t)}function be(e){let t=[],n=e.id;n!==void 0&&t.push(y("id",a(n)));let r=e.class;r!==void 0&&t.push(y("class",a(r)));let l=e.style;l!==void 0&&t.push(y("style",a(l)));let u=e.type;u!==void 0&&t.push(y("type",a(u)));let i=e.value;i!==void 0&&t.push(y("value",a(i)));let o=e.placeholder;o!==void 0&&t.push(y("placeholder",a(o)));let f=e.disabled;f!==void 0&&f&&t.push(z("disabled","true"));let d=e.checked;d!==void 0&&d&&t.push(z("checked","true"));let s=e.href;s!==void 0&&t.push(y("href",a(s)));let c=e.target;c!==void 0&&t.push(y("target",a(c)));let k=e.data;return k!==void 0&&Object.entries(k).forEach(([ue,ie])=>{t.push(y("data-"+ue,ie))}),t}function Te(e){let t=[],n=e.onClick;n!==void 0&&t.push(["click",n]);let r=e.onInput;r!==void 0&&t.push(["input",r]);let l=e.onChange;l!==void 0&&t.push(["change",l]);let u=e.onSubmit;u!==void 0&&t.push(["submit",u]);let i=e.onFocus;i!==void 0&&t.push(["focus",i]);let o=e.onBlur;o!==void 0&&t.push(["blur",o]);let f=e.onKeyDown;f!==void 0&&t.push(["keydown",f]);let d=e.onKeyUp;d!==void 0&&t.push(["keyup",d]);let s=e.onMouseEnter;s!==void 0&&t.push(["mouseenter",s]);let c=e.onMouseLeave;return c!==void 0&&t.push(["mouseleave",c]),t}function Ae(e){let t=e.children;return t!==void 0?t.TAG==="Fragment"?t._0:[t]:[]}function B(e,t){return{TAG:"Element",tag:e,attrs:be(t),events:Te(t),children:Ae(t)}}let St=B,Et=B;function yt(e,t,n,r){return B(e,t)}function bt(e,t,n,r){return B(e,t)}const Tt=Object.freeze(Object.defineProperty({__proto__:null,$$null:vt,Component:void 0,Elements:{signal:gt,computed:$t,convertAttrValue:y,propsToAttrs:be,propsToEvents:Te,getChildren:Ae,createElement:B,jsx:St,jsxs:Et,jsxKeyed:yt,jsxsKeyed:bt},array:_t,jsx:st,jsxFragment:mt,jsxKeyed:ht,jsxs:at,jsxsKeyed:pt},Symbol.toStringTag,{value:"Module"}));function At(e,t){let n=e.length,r=new Array(n),l=0;for(let u=0;u<n;++u){let i=e[u],o=t(i);o!==void 0&&(r[l]=a(o),l=l+1|0)}return r.length=l,r}function Ct(e,t){let n=0;for(;;){let r=n;if(r===e.length)return;let l=t(e[r]);if(l!==void 0)return l;n=r+1|0}}function Ce(e){return At(e.split("/"),t=>{if(t!=="")return t.startsWith(":")?{TAG:"Param",_0:t.slice(1)}:{TAG:"Static",_0:t}})}function Oe(e,t){let n=t.split("/").filter(u=>u!=="");if(e.length!==n.length)return"NoMatch";let r={};return e.every((u,i)=>{let o=n[i];return u.TAG==="Static"?o===u._0:(r[u._0]=o,!0)})?{TAG:"Match",_0:r}:"NoMatch"}function re(e,t){return Oe(Ce(e),t)}const Ot=Object.freeze(Object.defineProperty({__proto__:null,match:re,matchPath:Oe,parsePattern:Ce},Symbol.toStringTag,{value:"Module"}));let I=Z({pathname:"/",search:"",hash:""});function le(){return{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash}}function It(){T(I,le());let e=t=>T(I,le());window.addEventListener("popstate",e)}function Ie(e,t,n,r){let l=t!==void 0?t:"",u=n!==void 0?n:"",i={pathname:e,search:l,hash:u},o=e+l+u,f={};window.history.pushState(f,"",o),T(I,i)}function kt(e,t,n,r){let l=t!==void 0?t:"",u=n!==void 0?n:"",i={pathname:e,search:l,hash:u},o=e+l+u,f={};window.history.replaceState(f,"",o),T(I,i)}function jt(e,t){return te(G(()=>{let n=b(I),r=re(e,n.pathname);return typeof r!="object"?[]:[t(r._0)]}))}function Mt(e){return te(G(()=>{let t=b(I),n=Ct(e,r=>{let l=re(r.pattern,t.pathname);if(typeof l=="object")return r.render(l._0)});return n!==void 0?[n]:[]}))}function Nt(e,t,n,r){let l=t!==void 0?t:[],u=n!==void 0?n:[],i=o=>{o.preventDefault(),Ie(e,void 0,void 0)};return Ee(l.concat([z("href",e)]),[["click",i]],u)}const wt=Object.freeze(Object.defineProperty({__proto__:null,Component:void 0,Computed:void 0,Core:void 0,Route:void 0,Signal:void 0,getCurrentLocation:le,init:It,link:Nt,location:I,push:Ie,replace:kt,route:jt,routes:Mt},Symbol.toStringTag,{value:"Module"}));let Pt=ct,Rt=Ue,Gt=Je,Dt=We,Xt=Tt,zt=Ot,Lt=wt,Vt=He;m.Component=Pt,m.Computed=Rt,m.Core=Gt,m.Effect=Dt,m.JSX=Xt,m.Route=zt,m.Router=Lt,m.Signal=Vt,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(_,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(_=typeof globalThis<"u"?globalThis:_||self,N(_.xote={}))})(this,(function(_){"use strict";function N(e){return e===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function Le(e){if(e!=null)return N(e)}function p(e){if(e===null||e.BS_PRIVATE_NESTED_SOME_NONE===void 0)return e;let t=e.BS_PRIVATE_NESTED_SOME_NONE;if(t!==0)return{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}function We(e,t){return e!==void 0?p(e):t}function Ke(e){return e!==void 0}let te={contents:0};function ne(){return te.contents=te.contents+1|0,te.contents}function $e(e,t,n,r,l){if(r<=t){for(let u=0;u<l;++u)n[u+r|0]=e[u+t|0];return}for(let u=l-1|0;u>=0;--u)n[u+r|0]=e[u+t|0]}function Se(e,t,n,r,l,u,i,o,f){let c=t+n|0,s=l+u|0,d=t,T=e[t],X=l,z=r[l],V=o;for(;;){let I=V,L=z,me=X,Ve=T,_e=d;if(f(Ve,L)<=0){i[I]=Ve;let ge=_e+1|0;if(ge>=c)return $e(r,me,i,I+1|0,s-me|0);V=I+1|0,T=e[ge],d=ge;continue}i[I]=L;let ve=me+1|0;if(ve>=s)return $e(e,_e,i,I+1|0,c-_e|0);V=I+1|0,z=r[ve],X=ve}}function Ee(e,t,n,r,l,u){for(let i=0;i<l;++i){let o=e[t+i|0],f=(r+i|0)-1|0;for(;f>=r&&u(n[f],o)>0;)n[f+1|0]=n[f],f=f-1|0;n[f+1|0]=o}}function H(e,t,n,r,l,u){if(l<=5)return Ee(e,t,n,r,l,u);let i=l/2|0,o=l-i|0;H(e,t+i|0,n,r+i|0,o,u),H(e,t,e,t+o|0,i,u),Se(e,t+o|0,i,n,r+i|0,o,n,r,u)}function qe(e,t){let n=e.length;if(n<=5)return Ee(e,0,e,0,n,t);let r=n/2|0,l=n-r|0,u=new Array(l);H(e,r,u,0,l,t),H(e,0,e,l,r,t),Se(e,l,r,u,0,l,e,0,t)}function Je(e,t){let n=e.slice(0);return qe(n,t),n}function P(e){return e!==void 0?e.h:0}function E(e,t,n,r){let l=P(e),u=P(r);return{k:t,v:n,h:l>=u?l+1|0:u+1|0,l:e,r}}function Ue(e,t){return{k:e,v:t,h:1,l:void 0,r:void 0}}function He(e,t){return e.v===t?e:{k:e.k,v:t,h:e.h,l:e.l,r:e.r}}function R(e,t,n,r){let l=e!==void 0?e.h:0,u=r!==void 0?r.h:0;if(l>(u+2|0)){let f=e.l,c=e.r;return P(f)>=P(c)?E(f,e.k,e.v,E(c,t,n,r)):E(E(f,e.k,e.v,c.l),c.k,c.v,E(c.r,t,n,r))}if(u<=(l+2|0))return{k:t,v:n,h:l>=u?l+1|0:u+1|0,l:e,r};let i=r.l,o=r.r;return P(o)>=P(i)?E(E(e,t,n,i),r.k,r.v,o):E(E(e,t,n,i.l),i.k,i.v,E(i.r,r.k,r.v,o))}function ye(e,t,n){let r=e.l;return r!==void 0?R(ye(r,t,n),e.k,e.v,e.r):(t.contents=e.k,n.contents=e.v,e.r)}function Qe(e,t){for(;;){let n=e;if(n===void 0)return;let r=n.k;if(t===r)return N(n.v);e=t<r?n.l:n.r}}function A(e,t,n){if(e===void 0)return Ue(t,n);let r=e.k;if(t===r)return He(e,n);let l=e.v;return t<r?R(A(e.l,t,n),r,l,e.r):R(e.l,r,l,A(e.r,t,n))}function re(e,t){let n=e.k,r=e.l,l=e.r;if(t===n){if(r===void 0)return l;if(l===void 0)return r;let i={contents:l.k},o={contents:l.v},f=ye(l,i,o);return R(r,i.contents,o.contents,f)}if(t<n){if(r===void 0)return e;let i=re(r,t);return i===r?e:R(i,n,e.v,l)}if(l===void 0)return e;let u=re(l,t);return R(r,n,e.v,u)}function le(e,t){if(e!==void 0)return re(e,t)}let m=Qe;function Ye(e){if(e!==void 0)return p(e);throw{RE_EXN_ID:"Not_found",Error:new Error}}let be=Ye;function y(e,t,n){let r=e!==void 0?e.h:0,l=n!==void 0?n.h:0;return{v:t,h:(r>=l?r:l)+1|0,l:e,r:n}}function Ze(e){return{v:e,h:1,l:void 0,r:void 0}}function Te(e,t){return t!==void 0?e!==void 0?e.h>=t.h:!1:!0}function G(e,t,n){let r=e!==void 0?e.h:0,l=n!==void 0?n.h:0;if(r>(l+2|0)){let o=e.l,f=e.r;return Te(o,f)?y(o,e.v,y(f,t,n)):y(y(o,e.v,f.l),f.v,y(f.r,t,n))}if(l<=(r+2|0))return{v:t,h:(r>=l?r:l)+1|0,l:e,r:n};let u=n.l,i=n.r;return Te(i,u)?y(y(e,t,u),n.v,i):y(y(e,t,u.l),u.v,y(u.r,n.v,i))}function Ae(e,t){let n=e.l;return n!==void 0?G(Ae(n,t),e.v,e.r):(t.contents=e.v,e.r)}function et(e){return e===void 0}function Ce(e,t){for(;;){let n=e;if(n===void 0)return;Ce(n.l,t),t(n.v),e=n.r}}function ue(e){let t=e.l,n=e.r,r=t!==void 0?ue(t):0,l=n!==void 0?ue(n):0;return(1+r|0)+l|0}function Oe(e,t,n){for(;;){let r=t,l=e,u=l.v,i=l.l,o=l.r,f=i!==void 0?Oe(i,r,n):r;n[f]=u;let c=f+1|0;if(o===void 0)return c;t=c,e=o}}function tt(e){if(e===void 0)return[];let t=ue(e),n=new Array(t);return Oe(e,0,n),n}function nt(e,t){for(;;){let n=e;if(n===void 0)return!1;let r=n.v;if(t===r)return!0;e=t<r?n.l:n.r}}function D(e,t){if(e===void 0)return Ze(t);let n=e.v;if(t===n)return e;let r=e.l,l=e.r;if(t<n){let i=D(r,t);return i===r?e:G(i,n,l)}let u=D(l,t);return u===l?e:G(r,n,u)}function ie(e,t){if(e===void 0)return e;let n=e.v,r=e.l,l=e.r;if(t===n){if(r===void 0)return l;if(l===void 0)return r;let i={contents:l.v},o=Ae(l,i);return G(r,i.contents,o)}if(t<n){let i=ie(r,t);return i===r?e:G(i,n,l)}let u=ie(l,t);return u===l?e:G(r,n,u)}let rt=et,lt=nt,j=Ce,ut=tt,Ie=(function(e,t){for(var n in e)t(n)});function Q(e,t){if(e===t)return!0;let n=typeof e;if(n==="string"||n==="number"||n==="bigint"||n==="boolean"||n==="undefined"||e===null)return!1;let r=typeof t;if(n==="function"||r==="function")throw{RE_EXN_ID:"Invalid_argument",_1:"equal: functional value",Error:new Error};if(r==="number"||r==="bigint"||r==="undefined"||t===null)return!1;let l=e.TAG,u=t.TAG;if(l!==u)return!1;let i=e.length|0,o=t.length|0;if(i===o)if(Array.isArray(e)){let f=0;for(;;){let c=f;if(c===i)return!0;if(!Q(e[c],t[c]))return!1;f=c+1|0}}else{if(e instanceof Date&&t instanceof Date)return!(e>t||e<t);{let f={contents:!0},c=d=>{if(!Object.prototype.hasOwnProperty.call(t,d)){f.contents=!1;return}},s=d=>{if(!Object.prototype.hasOwnProperty.call(e,d)||!Q(t[d],e[d])){f.contents=!1;return}};return Ie(e,c),f.contents&&Ie(t,s),f.contents}}else return!1}function it(e,t){return(typeof e=="number"||typeof e=="bigint")&&(typeof t=="number"||typeof t=="bigint")?e!==t:!Q(e,t)}let h={contents:void 0},v={contents:void 0},ot={contents:void 0},x={contents:void 0},a={contents:void 0},$={contents:void 0},k={contents:!1},M={contents:!1},S={contents:!1};function Y(e){if(m(v.contents,e)===void 0){v.contents=A(v.contents,e,void 0);return}}function je(e,t){Y(t);let n=be(m(h.contents,e));if(!Q(a.contents,e)||lt(n.deps,t)!==!1)return;n.deps=D(n.deps,t);let r=be(m(v.contents,t));v.contents=A(v.contents,t,D(r,e))}function oe(e){let t=m(x.contents,e);if(t===void 0)return;x.contents=le(x.contents,e);let n=m(h.contents,t);if(n!==void 0){B(n),h.contents=le(h.contents,t);return}}function B(e){j(e.deps,t=>{let n=m(v.contents,t);if(n===void 0)return;let r=ie(p(n),e.id);if(v.contents=A(v.contents,t,r),rt(r)&&S.contents===!1)return oe(t)}),e.deps=void 0}function Z(e){if(typeof e.kind=="object"){let r={contents:0};return j(e.deps,l=>{let u=m(v.contents,l);if(u!==void 0)return j(p(u),i=>{if(i===e.id)return;let o=m(h.contents,i);if(o===void 0)return;if(typeof o.kind=="object"&&o.level>r.contents){r.contents=o.level;return}})}),r.contents+1|0}let n={contents:0};return j(e.deps,r=>{let l=m(v.contents,r);if(l!==void 0)return j(p(l),u=>{let i=m(h.contents,u);if(i!==void 0&&i.level>n.contents){n.contents=i.level;return}})}),n.contents+1e3|0}function fe(){for(;$.contents!==void 0;){let e=$.contents;$.contents=void 0;let t=ut(e);Je(t,(r,l)=>{let u=m(h.contents,r),i=m(h.contents,l);return u!==void 0?i!==void 0?u.level-i.level|0:-1:i!==void 0?1:0}).forEach(r=>{let l=m(h.contents,r);if(l===void 0)return;S.contents=!0,B(l);let u=a.contents;a.contents=r;try{l.run(),S.contents=!1}catch(i){throw a.contents=u,S.contents=!1,i}a.contents=u,l.level=Z(l)})}}function ke(e){if($.contents=D($.contents,e),k.contents===!1&&M.contents===!1){M.contents=!0,fe(),M.contents=!1;return}}function Me(e){Y(e);let t=m(v.contents,e);if(t!==void 0)if(j(p(t),n=>{$.contents=D($.contents,n)}),k.contents===!1&&M.contents===!1){M.contents=!0,fe(),M.contents=!1;return}else return}function ft(e){let t=a.contents;a.contents=void 0;try{let n=e();return a.contents=t,n}catch(n){throw a.contents=t,n}}function ct(e){let t=k.contents;k.contents=!0;let n;try{n=e()}catch(r){throw k.contents=t,r}if(k.contents=t,$.contents!==void 0){let r=$.contents;$.contents=void 0,j(r,ke)}return n}const dt=Object.freeze(Object.defineProperty({__proto__:null,Id:void 0,IntMap:void 0,IntSet:void 0,Observer:void 0,addDep:je,autoDisposeComputed:oe,batch:ct,batching:k,clearDeps:B,computeLevel:Z,computedToObserver:x,currentObserverId:a,ensureSignalBucket:Y,flush:fe,flushing:M,notify:Me,observers:h,pending:$,retracking:S,schedule:ke,signalObservers:v,signalPeeks:ot,untrack:ft},Symbol.toStringTag,{value:"Module"}));function W(e){let t=ne(),n={contents:void 0},l={id:t,kind:"Effect",run:()=>{let o=n.contents;o!==void 0&&o(),n.contents=e()},deps:void 0,level:1e3};h.contents=A(h.contents,t,l),S.contents=!0,B(l);let u=a.contents;a.contents=t;try{l.run(),S.contents=!1}catch(o){throw a.contents=u,S.contents=!1,o}return a.contents=u,l.level=Z(l),{dispose:()=>{let o=m(h.contents,t);if(o===void 0)return;let f=n.contents;f!==void 0&&f(),B(o),h.contents=le(h.contents,t)}}}const st=Object.freeze(Object.defineProperty({__proto__:null,Core:void 0,Id:void 0,IntMap:void 0,IntSet:void 0,Observer:void 0,Signal:void 0,run:W},Symbol.toStringTag,{value:"Module"}));function ce(e){let t=ne();return Y(t),{id:t,value:{contents:e},version:{contents:0}}}function C(e){let t=a.contents;return t!==void 0&&je(t,e.id),e.value.contents}function ee(e){return e.value.contents}function O(e,t){let n;try{n=it(e.value.contents,t)}catch{n=!0}if(n)return e.value.contents=t,e.version.contents=e.version.contents+1|0,Me(e.id)}function at(e,t){O(e,t(e.value.contents))}const ht=Object.freeze(Object.defineProperty({__proto__:null,Core:void 0,Id:void 0,IntMap:void 0,IntSet:void 0,Observer:void 0,get:C,make:ce,peek:ee,set:O,update:at},Symbol.toStringTag,{value:"Module"}));function F(e){let t=ce(),n={contents:!1},r=ne(),l=()=>{let o=e();return n.contents===!1&&(n.contents=!0),O(t,o)},u={id:r,kind:{NAME:"Computed",VAL:t.id},run:l,deps:void 0,level:0};h.contents=A(h.contents,r,u),S.contents=!0,B(u);let i=a.contents;a.contents=r;try{u.run(),S.contents=!1}catch(o){throw a.contents=i,S.contents=!1,o}return a.contents=i,u.level=Z(u),x.contents=A(x.contents,t.id,r),t}function pt(e){oe(e.id)}const mt=Object.freeze(Object.defineProperty({__proto__:null,Core:void 0,Id:void 0,IntMap:void 0,IntSet:void 0,Observer:void 0,Signal:void 0,dispose:pt,make:F},Symbol.toStringTag,{value:"Module"}));function K(e,t){return[e,{TAG:"Static",_0:t}]}function we(e,t){return[e,{TAG:"SignalValue",_0:t}]}function Ne(e,t){return[e,{TAG:"Compute",_0:t}]}function Pe(e){return{TAG:"Text",_0:e}}function _t(e){return{TAG:"SignalText",_0:F(e)}}function de(e){return{TAG:"Fragment",_0:e}}function se(e){return{TAG:"SignalFragment",_0:e}}function vt(e,t){return{TAG:"SignalFragment",_0:F(()=>C(e).map(t))}}function g(e,t,n,r,l){let u=t!==void 0?t:[].map(f=>f),i=n!==void 0?n:[].map(f=>f),o=r!==void 0?r:[].map(f=>f);return{TAG:"Element",tag:e,attrs:u,events:i,children:o}}function gt(e,t,n,r){return g("div",e,t,n)}function $t(e,t,n,r){return g("span",e,t,n)}function St(e,t,n,r){return g("button",e,t,n)}function Et(e,t,n){return g("input",e,t,void 0)}function yt(e,t,n,r){return g("h1",e,t,n)}function bt(e,t,n,r){return g("h2",e,t,n)}function Tt(e,t,n,r){return g("h3",e,t,n)}function At(e,t,n,r){return g("p",e,t,n)}function Ct(e,t,n,r){return g("ul",e,t,n)}function Ot(e,t,n,r){return g("li",e,t,n)}function Re(e,t,n,r){return g("a",e,t,n)}function q(e,t){let n=We(Le(e.__xote_disposers),[]);e.__xote_disposers=n.concat([t])}function ae(e){let t=e.__xote_disposers;t!=null&&(t.forEach(r=>r.dispose()),e.__xote_disposers=[]),Array.from(e.childNodes||[]).forEach(ae)}function J(e){switch(e.TAG){case"Element":let t=document.createElement(e.tag);return e.attrs.forEach(c=>{let s=c[1],d=c[0];switch(s.TAG){case"Static":t.setAttribute(d,s._0);return;case"SignalValue":let T=s._0;t.setAttribute(d,ee(T));let X=W(()=>{let L=C(T);t.setAttribute(d,L)});return q(t,X);case"Compute":let z=s._0,V=F(()=>z());t.setAttribute(d,ee(V));let I=W(()=>{let L=C(V);t.setAttribute(d,L)});return q(t,I)}}),e.events.forEach(c=>{t.addEventListener(c[0],c[1])}),e.children.forEach(c=>{let s=J(c);t.appendChild(s)}),t;case"Text":return document.createTextNode(e._0);case"SignalText":let n=e._0,r=document.createTextNode(ee(n)),l=W(()=>{let c=C(n);r.textContent=c});return q(r,l),r;case"Fragment":let u=document.createDocumentFragment();return e._0.forEach(c=>{let s=J(c);u.appendChild(s)}),u;case"SignalFragment":let i=e._0,o=document.createElement("div");o.setAttribute("data-signal-fragment","true"),o.setAttribute("style","display: contents");let f=W(()=>{let c=C(i);Array.from(o.childNodes||[]).forEach(ae),o.innerHTML="",c.forEach(d=>{let T=J(d);o.appendChild(T)})});return q(o,f),o}}function Ge(e,t){let n=J(e);t.appendChild(n)}function It(e,t){let n=document.getElementById(t);if(n==null){console.error("Container element not found: "+t);return}else return Ge(e,n)}const jt=Object.freeze(Object.defineProperty({__proto__:null,Computed:void 0,Core:void 0,Effect:void 0,Signal:void 0,a:Re,addDisposer:q,attr:K,button:St,computedAttr:Ne,disposeElement:ae,div:gt,element:g,fragment:de,h1:yt,h2:bt,h3:Tt,input:Et,li:Ot,list:vt,mount:Ge,mountById:It,p:At,render:J,signalAttr:we,signalFragment:se,span:$t,text:Pe,textSignal:_t,ul:Ct},Symbol.toStringTag,{value:"Module"}));function kt(e,t){return e(t)}function Mt(e,t){return e(t)}function wt(e,t,n,r){return e(t)}function Nt(e,t,n,r){return e(t)}function Pt(e){let t=e.children;return t!==void 0?t:de([])}let Rt=de;function Gt(){return Pe("")}function Dt(e){return e}function xt(e){return e}function b(e,t){return typeof t=="function"?Ne(e,t):typeof t=="object"&&Ke(t.id)?we(e,t):K(e,t)}function De(e){let t=[],n=e.id;n!==void 0&&t.push(b("id",p(n)));let r=e.class;r!==void 0&&t.push(b("class",p(r)));let l=e.style;l!==void 0&&t.push(b("style",p(l)));let u=e.type;u!==void 0&&t.push(b("type",p(u)));let i=e.value;i!==void 0&&t.push(b("value",p(i)));let o=e.placeholder;o!==void 0&&t.push(b("placeholder",p(o)));let f=e.disabled;f!==void 0&&f&&t.push(K("disabled","true"));let c=e.checked;c!==void 0&&c&&t.push(K("checked","true"));let s=e.href;s!==void 0&&t.push(b("href",p(s)));let d=e.target;d!==void 0&&t.push(b("target",p(d)));let T=e.data;return T!==void 0&&Object.entries(T).forEach(([X,z])=>{t.push(b("data-"+X,z))}),t}function xe(e){let t=[],n=e.onClick;n!==void 0&&t.push(["click",n]);let r=e.onInput;r!==void 0&&t.push(["input",r]);let l=e.onChange;l!==void 0&&t.push(["change",l]);let u=e.onSubmit;u!==void 0&&t.push(["submit",u]);let i=e.onFocus;i!==void 0&&t.push(["focus",i]);let o=e.onBlur;o!==void 0&&t.push(["blur",o]);let f=e.onKeyDown;f!==void 0&&t.push(["keydown",f]);let c=e.onKeyUp;c!==void 0&&t.push(["keyup",c]);let s=e.onMouseEnter;s!==void 0&&t.push(["mouseenter",s]);let d=e.onMouseLeave;return d!==void 0&&t.push(["mouseleave",d]),t}function Be(e){let t=e.children;return t!==void 0?t.TAG==="Fragment"?t._0:[t]:[]}function U(e,t){return{TAG:"Element",tag:e,attrs:De(t),events:xe(t),children:Be(t)}}let Bt=U,Ft=U;function Xt(e,t,n,r){return U(e,t)}function zt(e,t,n,r){return U(e,t)}const Vt=Object.freeze(Object.defineProperty({__proto__:null,$$null:Gt,Component:void 0,Elements:{signal:Dt,computed:xt,convertAttrValue:b,propsToAttrs:De,propsToEvents:xe,getChildren:Be,createElement:U,jsx:Bt,jsxs:Ft,jsxKeyed:Xt,jsxsKeyed:zt},array:Rt,jsx:kt,jsxFragment:Pt,jsxKeyed:wt,jsxs:Mt,jsxsKeyed:Nt},Symbol.toStringTag,{value:"Module"}));function Lt(e,t){let n=e.length,r=new Array(n),l=0;for(let u=0;u<n;++u){let i=e[u],o=t(i);o!==void 0&&(r[l]=p(o),l=l+1|0)}return r.length=l,r}function Wt(e,t){let n=0;for(;;){let r=n;if(r===e.length)return;let l=t(e[r]);if(l!==void 0)return l;n=r+1|0}}function Fe(e){return Lt(e.split("/"),t=>{if(t!=="")return t.startsWith(":")?{TAG:"Param",_0:t.slice(1)}:{TAG:"Static",_0:t}})}function Xe(e,t){let n=t.split("/").filter(u=>u!=="");if(e.length!==n.length)return"NoMatch";let r={};return e.every((u,i)=>{let o=n[i];return u.TAG==="Static"?o===u._0:(r[u._0]=o,!0)})?{TAG:"Match",_0:r}:"NoMatch"}function he(e,t){return Xe(Fe(e),t)}const Kt=Object.freeze(Object.defineProperty({__proto__:null,match:he,matchPath:Xe,parsePattern:Fe},Symbol.toStringTag,{value:"Module"}));let w=ce({pathname:"/",search:"",hash:""});function pe(){return{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash}}function qt(){O(w,pe());let e=t=>O(w,pe());window.addEventListener("popstate",e)}function ze(e,t,n,r){let l=t!==void 0?t:"",u=n!==void 0?n:"",i={pathname:e,search:l,hash:u},o=e+l+u,f={};window.history.pushState(f,"",o),O(w,i)}function Jt(e,t,n,r){let l=t!==void 0?t:"",u=n!==void 0?n:"",i={pathname:e,search:l,hash:u},o=e+l+u,f={};window.history.replaceState(f,"",o),O(w,i)}function Ut(e,t){return se(F(()=>{let n=C(w),r=he(e,n.pathname);return typeof r!="object"?[]:[t(r._0)]}))}function Ht(e){return se(F(()=>{let t=C(w),n=Wt(e,r=>{let l=he(r.pattern,t.pathname);if(typeof l=="object")return r.render(l._0)});return n!==void 0?[n]:[]}))}function Qt(e,t,n,r){let l=t!==void 0?t:[],u=n!==void 0?n:[],i=o=>{o.preventDefault(),ze(e,void 0,void 0)};return Re(l.concat([K("href",e)]),[["click",i]],u)}const Yt=Object.freeze(Object.defineProperty({__proto__:null,Component:void 0,Computed:void 0,Core:void 0,Route:void 0,Signal:void 0,getCurrentLocation:pe,init:qt,link:Qt,location:w,push:ze,replace:Jt,route:Ut,routes:Ht},Symbol.toStringTag,{value:"Module"}));let Zt=jt,en=mt,tn=dt,nn=st,rn=Vt,ln=Kt,un=Yt,on=ht;_.Component=Zt,_.Computed=en,_.Core=tn,_.Effect=nn,_.JSX=rn,_.Route=ln,_.Router=un,_.Signal=on,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|