imba
Version:
8 lines (7 loc) • 142 kB
JavaScript
var Cr=Object.defineProperty;var Eu=Object.getOwnPropertyDescriptor;var Tu=Object.getOwnPropertyNames;var $u=Object.prototype.hasOwnProperty;var ku=(s,t)=>{for(var e in t)Cr(s,e,{get:t[e],enumerable:!0})},Nu=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Tu(t))!$u.call(s,n)&&n!==e&&Cr(s,n,{get:()=>t[n],enumerable:!(r=Eu(t,n))||r.enumerable});return s};var Ou=s=>Nu(Cr({},"__esModule",{value:!0}),s);var up={};ku(up,{Accessor:()=>Nn,Action:()=>Or,CUSTOM_TYPES:()=>fn,ClassFlags:()=>dt,Comment:()=>wr,Component:()=>$e,ComputedType:()=>kn,CustomEvent:()=>K,Document:()=>dn,DocumentFragment:()=>vh,EaseGroup:()=>Dh,Easer:()=>bn,Element:()=>F,ElementRoute:()=>Nr,ElementRouteTo:()=>Tn,Emitter:()=>xe,Event:()=>br,EventHandler:()=>Tr,FocusEvent:()=>dh,Fragment:()=>Yt,HAS:()=>Ka,HTMLButtonElement:()=>un,HTMLElement:()=>fh,HTMLHtmlElement:()=>mh,HTMLInputElement:()=>an,HTMLOptionElement:()=>cn,HTMLScriptElement:()=>ph,HTMLSelectElement:()=>ln,HTMLTextAreaElement:()=>hn,ImbaElement:()=>Ih,IntersectionEventDefaults:()=>Ne,KeyboardEvent:()=>nn,LazyProxy:()=>Bs,MouseEvent:()=>rn,Node:()=>Sr,OBSERVED:()=>N,ObservableArray:()=>$n,PointerEvent:()=>sn,Queue:()=>tn,Ref:()=>Xt,RenderContext:()=>Gt,Router:()=>En,SVGElement:()=>gh,Scheduler:()=>Ys,ShadowRoot:()=>yh,TYPES:()=>_e,Text:()=>on,Touch:()=>wn,UIEvent:()=>ch,Window:()=>bh,__has__$:()=>zs,__hooks__$:()=>pr,__imba__$:()=>gr,__init__$:()=>Tt,__inited__$:()=>Vs,__initor__$:()=>mr,__meta__$:()=>Ks,__mixin__$:()=>Ra,__patch__$:()=>Fa,__served__:()=>Ja,accessor:()=>bu,afterReconcile$:()=>Va,afterVisit$:()=>Aa,appendChild$:()=>ja,atomic:()=>iu,augment$:()=>qt,autorun:()=>ru,awaits:()=>su,beforeReconcile$:()=>Da,clearInterval:()=>Qs,clearTimeout:()=>Js,colors:()=>Mh,commit:()=>L,createAtom:()=>eu,createComment:()=>$t,createComponent:()=>mn,createDynamic:()=>Th,createElement:()=>xh,createFragment:()=>Eh,createIndexedList:()=>Ch,createKeyedList:()=>Ph,createLiveFragment:()=>Oh,createRef:()=>cu,createRenderContext:()=>yr,createSVGElement:()=>_h,createSlot:()=>Te,createTextNode:()=>xr,customElements:()=>Sh,decorate$:()=>Ya,defineConfig:()=>th,defineTag:()=>kh,descriptor:()=>Su,devlog$:()=>Ga,disposeObservables:()=>du,emit:()=>lt,env:()=>oh,events:()=>zh,extend$:()=>vr,getComputed:()=>fu,getDeepPropertyDescriptor:()=>we,getRenderContext:()=>uh,getSuperTagType:()=>$h,getTagType:()=>pn,get_document:()=>Ee,has$:()=>Ua,hooks:()=>Zs,hotkeys:()=>xn,hydrate:()=>Lh,hydrator:()=>_r,idx$:()=>Ba,inited$:()=>Qa,is$:()=>Ha,isa$:()=>qa,iterable$:()=>Us,listen:()=>ot,locals:()=>Xh,logFormatter:()=>en,matcher:()=>Hs,memofunc:()=>lh,mount:()=>vn,multi$:()=>Wa,observable:()=>nu,once:()=>V,parseTime:()=>Ut,proxy:()=>Gs,register$:()=>f,render:()=>Rh,renderContext:()=>C,renderer:()=>G,reportChanged:()=>au,reportInvalidated:()=>hu,reportObserved:()=>uu,router:()=>Zh,run:()=>ou,rx:()=>Wt,scheduler:()=>P,serve:()=>ih,session:()=>_n,setInterval:()=>Xs,setTimeout:()=>Ws,spy:()=>lu,statics$:()=>qs,styles:()=>gn,sup$:()=>Xa,toCamelCase:()=>Za,transitions:()=>ke,unlisten:()=>Bt,unmount:()=>yn,up$:()=>za,use_devlog:()=>ah,use_dom_bind:()=>jh,use_dom_teleport:()=>Ah,use_dom_transitions:()=>Vh,use_events:()=>Kh,use_events_hotkey:()=>Wh,use_events_intersect:()=>Uh,use_events_keyboard:()=>Sn,use_events_mouse:()=>Er,use_events_mutate:()=>Gh,use_events_pointer:()=>Hh,use_events_resize:()=>Bh,use_events_selection:()=>Yh,use_events_touch:()=>qh,use_hooks:()=>eh,use_router:()=>Jh,use_slots:()=>Nh,use_styles:()=>Fh,use_window:()=>wh,\u03B1action:()=>yu,\u03B1autorun:()=>vu,\u03B1bound:()=>sh,\u03B1computed:()=>mu,\u03B1lazy:()=>rh,\u03B1observable:()=>pu,\u03B1prop:()=>wu,\u03B1ref:()=>gu,\u03B1thenable:()=>nh});module.exports=Ou(up);var Tt=Symbol.for("#__init__"),mr=Symbol.for("#__initor__"),Vs=Symbol.for("#__inited__"),pr=Symbol.for("#__hooks__"),Fa=Symbol.for("#__patch__"),zs=Symbol.for("#has"),Ks=Symbol.for("#meta"),gr=Symbol.for("imba"),Ra=Symbol.for("#__mixin__"),Hs=Symbol.for("#matcher"),Oe=Symbol.for("#L"),ja=Symbol.for("#appendChild"),Aa=Symbol.for("#afterVisit"),Da=Symbol.for("#beforeReconcile"),Va=Symbol.for("#afterReconcile"),za=Symbol.for("##up"),Ka={SUPERCALLS:8,CONSTRUCTOR:16},dt={IsExtension:1,IsTag:2,HasDescriptors:4,HasSuperCalls:8,HasConstructor:16,HasFields:32,HasMixins:64,HasInitor:128,HasDecorators:256,IsObjectExtension:512,IsMixin:1024},kt=new Map,Cu=globalThis[gr]||(globalThis[gr]={counter:0,classes:kt});function bt(s,t={}){var e;return kt.has(s)||kt.set(s,{symbol:Symbol(s.name),parent:(e=Object.getPrototypeOf(s.prototype))==null?void 0:e.constructor,for:s,uses:null,inits:null,id:Cu.counter++,...t}),kt.get(s)}var Cn=new WeakMap;function Ha(s,t){var e;return s==t||((e=t?.[Hs])==null?void 0:e.call(t,s))}function qa(s,t){var e;return typeof t=="string"?typeof s===t:(e=t?.[Symbol.hasInstance])==null?void 0:e.call(t,s)}function Ua(s,t){var e,r,n,i,o,l;return(l=(o=(n=(e=t?.[zs])==null?void 0:e.call(t,s))!=null?n:(r=t?.includes)==null?void 0:r.call(t,s))!=null?o:(i=t?.has)==null?void 0:i.call(t,s))!=null?l:!1}function Ba(s,t){return t!=null&&t.indexOf?t.indexOf(s):Array.prototype.indexOf.call(s,t)}function Ga(s,t,...e){return t&&t[Oe]instanceof Function?s=t[Oe](s,t,...e):globalThis[Oe]instanceof Function&&(s=globalThis[Oe](s,t,...e)),s}function qs(s){return Cn.get(s)||Cn.set(s,{}).get(s)}function Us(s){var t;return((t=s?.toIterable)==null?void 0:t.call(s))||s}function Ya(s,t,e,r){let n,i=arguments.length,o=s.length,l=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r;for(;o>0;)(n=s[--o])&&(l=(i<3?n(l):i>3?n(t,e,l):n(t,e))||l);return i>3&&l&&Object.defineProperty(t,e,l),l}function Pu(s,t){if(!s||!t)return!1;if(s.get)return t.get===s.get;if(s.set)return t.set===s.set;if(s.value)return s.value===t.value}function vr(s,t,e,r={}){let n=s.constructor;!e&&t&&(e=Object.getOwnPropertyDescriptors(t),delete e.constructor,e[Tt]&&(console.warn(`Cannot define plain fields when extending class ${n.name}`),delete e[Tt]));let i=bt(n);if(i&&i.augments){let o=new Map;for(let l of Object.keys(e)){let a=Object.getOwnPropertyDescriptor(s,l);for(let h of i.augments){let c=o.get(h);c||o.set(h,c={});let d=Object.getOwnPropertyDescriptor(h.prototype,l);d&&!Pu(a,d)?console.warn("wont extend",l,d,a):c[l]=e[l]}}for(let[l,a]of o)Object.keys(a).length&&vr(l.prototype,null,a)}return Object.defineProperties(s,e),s}function qt(s,t){var e;let r=bt(s),n=bt(t),i=n.parent;for(;i&&((e=bt(i))==null?void 0:e.flags)&dt.IsMixin;){qt(s,i),i=null;break}if(i&&!(s.prototype instanceof i))throw new Error(`Mixin ${t.name} has superclass not present in target class`);if(!n.augments){n.augments=new Set;let l=n.ref=Symbol(t.name),a=Object[Symbol.hasInstance];t.prototype[l]=!0,Object.defineProperty(t,Symbol.hasInstance,{value:function(h){return this===t?h&&!!h[l]:a.call(this,h)}})}if(s.prototype[n.ref])return s;if(n.uses)for(let l of n.uses)qt(s,l);n.augments.add(s),r.uses||(r.uses=[]),r.uses.push(t);let o=Object.getOwnPropertyDescriptors(t.prototype);return delete o.constructor,o[Tt]&&(r.inits||(r.inits=[]),r.inits.push(t.prototype[Tt]),delete o[Tt]),Object.defineProperties(s.prototype,o),t?.mixed instanceof Function&&t.mixed(s),s}function Wa(s,t,...e){let r=t?class extends t{}:class{},n=bt(r,{symbol:s});for(let i of e)qt(r,i);return r.prototype[s]=function(i,o,l){if(n.inits)for(let a of n.inits)a.call(this,i,!1,l)},r}var Y={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(s,t,e)=>Reflect.apply(Y.target,t,e),get:(s,t)=>{let e=Reflect.get(Y.target,t,Y.self);return e instanceof Function?e.bind(Y.self):e},set:(s,t,e,r)=>Reflect.set(Y.target,t,e,Y.self)})};function Xa(s,t){return Y.self=s,Y.target=Y.cache[t],Y.proxy}function f(s,t,e,r,n=null){var i;let o=Object.getPrototypeOf(s.prototype),l=(r&(dt.HasMixins|dt.IsExtension))==dt.HasMixins,a;if(l&&(kt.set(s,kt.get(o.constructor)),o=Object.getPrototypeOf(o)),n){let c=r&dt.IsObjectExtension?n:n.prototype,d=bt(s);if(d.uses){n===c&&console.warn("Cannot extend object with mixins");for(let v of d.uses)qt(n,v)}return r&dt.HasSuperCalls&&(Y.cache[t]=Object.create(Object.getPrototypeOf(c),Object.getOwnPropertyDescriptors(c))),vr(c,s.prototype),n}let h=o?.constructor;if(a=bt(s,{symbol:t}),Object.defineProperty(s,Ks,{value:a,enumerable:!1,configurable:!0}),e&&s.name!==e&&Object.defineProperty(s,"name",{value:e,configurable:!0}),a.flags=r,r&dt.HasConstructor&&(s.prototype[mr]=t),a.uses)for(let c of a.uses)(i=c.mixes)==null||i.call(c,s);return h?.inherited instanceof Function&&h.inherited(s),s}function Qa(s,t){var e;s[mr]===t&&((e=s[Vs])==null||e.call(s),s[pr]&&s[pr].inited(s))}var Ce=Symbol.for("#__listeners__"),Lu=/-./g,Ja=new Set,Iu=Symbol(),Pn=class{static for(t){return new Proxy({},new this(t))}constructor(t){this.getter=t}get target(){return this.getter()}get(t,e){return this.target[e]}set(t,e,r){return this.target[e]=r,!0}};f(Pn,Iu,"LazyProxy",16);var Bs=Pn;function Gs(s,t={}){return new Proxy(t,new Bs(s))}function Ut(s){let t=typeof s;if(t=="number")return s;if(t=="string"){if(/^\d+fps$/.test(s))return 1e3/parseFloat(s);if(/^([-+]?[\d\.]+)s$/.test(s))return parseFloat(s)*1e3;if(/^([-+]?[\d\.]+)ms$/.test(s))return parseFloat(s)}return null}function Za(s){return s.indexOf("-")>=0?s.replace(Lu,function(t){return t.charAt(1).toUpperCase()}):s}function we(s,t,e){if(!s)return;let r=Object.getOwnPropertyDescriptor(s,t);return r||s==e?r||void 0:we(Reflect.getPrototypeOf(s),t,e)}var Ln=function(s,t,e){let r,n,i;for(;(r=e)&&(e=e.next);)(n=e.listener)&&(e.path&&n[e.path]?i=t?n[e.path].apply(n,t):n[e.path]():i=t?n.apply(e,t):n.call(e)),e.times&&--e.times<=0&&(r.next=e.next,e.listener=null)};function ot(s,t,e,r){let n,i,o;return n=s[Ce]||(s[Ce]={}),i=n[t]||(n[t]={}),o=i.tail||(i.tail=i.next={}),o.listener=e,o.path=r,i.tail=o.next={},o}function V(s,t,e){let r=ot(s,t,e);return r.times=1,r}function Bt(s,t,e,r){if(!e)return;let n,i,o=s[Ce];if(o&&(n=o[t])){for(;(i=n)&&(n=n.next);)if(n==e||n.listener==e){i.next=n.next,n.listener=null;break}}}function lt(s,t,e=null){let r;(r=s[Ce])&&(r[t]&&Ln(t,e,r[t]),r.all&&Ln(t,[t,e],r.all))}var Mu=Symbol(),In=class{emit(t,...e){return lt(this,t,e)}on(t,...e){return ot(this,t,...e)}once(t,...e){return V(this,t,...e)}un(t,...e){return Bt(this,t,...e)}};f(In,Mu,"Emitter",0);var xe=In;function th(s){return s}function Pr(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function Fu(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Mn=Symbol.for("#__init__"),Fn=Symbol.for("#schedule"),Lr=Symbol.for("#frames"),Pe=Symbol.for("#interval"),Nt=Symbol.for("#stage"),Ot=Symbol.for("#scheduled"),Le=Symbol.for("#version"),Ru=Symbol.for("#fps"),Rn=Symbol.for("#ticker"),ju=globalThis.requestAnimationFrame||function(s){return globalThis.setTimeout(s,1e3/60)},mp=1/60,Au=Symbol(),jn=class{constructor(t=null){this[Mn](t)}[Mn](t=null,e=!0,r=!0){var n;this.owner=t&&(n=t.owner)!==void 0?n:null,this.target=t&&(n=t.target)!==void 0?n:null,this.active=t&&(n=t.active)!==void 0?n:!1,this.value=t&&(n=t.value)!==void 0?n:void 0,this.skip=t&&(n=t.skip)!==void 0?n:0,this.last=t&&(n=t.last)!==void 0?n:0}tick(t,e){return this.last=this.owner[Lr],this.target.tick(this,e),1}update(t,e){let r=this.active,n=t.value;return this.value!=n&&(this.deactivate(),this.value=n),(this.value||r||e)&&this.activate(),this}queue(){this.owner.add(this)}activate(){return this.value===!0?this.owner.on("commit",this):this.value===!1||typeof this.value=="number"&&(this.value/16.666666666666668<=2?this.owner.on("raf",this):this[Pe]=globalThis.setInterval(this.queue.bind(this),this.value)),this.active=!0,this}deactivate(){return this.value===!0&&this.owner.un("commit",this),this.owner.un("raf",this),this[Pe]&&(globalThis.clearInterval(this[Pe]),this[Pe]=null),this.active=!1,this}};f(jn,Au,"Scheduled",16);var Du=jn,Vu=Symbol(),An=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[Nt]=-1,this[Lr]=0,this[Ot]=!1,this[Le]=0,this.listeners={},this.intervals={},this.commit=function(){return t.add("commit"),t},this[Ru]=0,this.$promise=null,this.$resolve=null,this[Rn]=function(e){return t[Ot]=!1,t.tick(e)}}touch(){return this[Le]++}get version(){return this[Le]}add(t,e=!1){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[Ot]||this[Fn](),this}get committing\u03A6(){return this.queue.indexOf("commit")>=0}get syncing\u03A6(){return this[Nt]==1}listen(t,e){let r=this.listeners[t],n=!r;return r||(r=this.listeners[t]=new Set),r.add(e),t=="raf"&&n&&this.add("raf"),this}unlisten(t,e){var r;let n=this.listeners[t];return n&&n.delete(e),t=="raf"&&n&&n.size==0&&(r=this.listeners.raf,delete this.listeners.raf),this}on(t,e){return this.listen(t,e)}un(t,e){return this.unlisten(t,e)}get promise(){var t=this;return this.$promise||(this.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let r=this.queue,n=this[Lr]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[Nt]=1,this[Le]++,r.length)for(let i=0,o=Fu(r),l=o.length;i<l;i++){let a=o[i];typeof a=="string"&&this.listeners[a]?this.listeners[a].forEach(function(h){if(Pr(h.tick,Function))return h.tick(e,a);if(Pr(h,Function))return h(e,a)}):Pr(a,Function)?a(this.dt,this):a.tick&&a.tick(this.dt,this)}return this[Nt]=this[Ot]?0:-1,this.$promise&&(this.$resolve(this),this.$promise=this.$resolve=null),this.listeners.raf&&this.add("raf"),this}[Fn](){return this[Ot]||(this[Ot]=!0,this[Nt]==-1&&(this[Nt]=0),ju(this[Rn])),this}schedule(t,e){var r,n;return e||(e=t[r=this.id]||(t[r]={value:!0})),(e[n=this.id]||(e[n]=new Du({owner:this,target:t}))).update(e,!0)}unschedule(t,e={}){e||(e=t[this.id]);let r=e&&e[this.id];return r&&r.active&&r.deactivate(),this}};f(An,Vu,"Scheduler",16);var Ys=An,P=new Ys;function L(){return P.add("commit").promise}function Ws(s,t){return globalThis.setTimeout(function(){s(),L()},t)}function Xs(s,t){return globalThis.setInterval(function(){s(),L()},t)}var Qs=globalThis.clearInterval,Js=globalThis.clearTimeout,Qt=globalThis.imba||(globalThis.imba={});Qt.commit=L,Qt.setTimeout=Ws,Qt.setInterval=Xs,Qt.clearInterval=Qs,Qt.clearTimeout=Js;var Zs={on:function(s,t){return ot(this,s,t)},inited:function(s){return lt(this,"inited",[s])}};function eh(){return!0}function Dn(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function rh(s,t,e){if(e.get){let r=e.get;e.get=function(){let n=r.call(this);return Object.defineProperty(this,t,{enumerable:!1,value:n}),n}}return e}function sh(s,t,e){var r,n;if(Dn(e.value,Function)){let i=e.value;e.get=function(){if(this==s)return i;let o=i.bind(this);return Object.defineProperty(this,t,{enumerable:!1,value:o}),o},r=e.value,delete e.value,n=e.writable,delete e.writable}return e}var Vn=new WeakMap;function nh(s,t,e){var r;let n=this[0]||{},i=e.value,o=Symbol(),l=new WeakMap,a=Vn.get(s),h=n.timeout||20*1e3,c=""+(((r=s.constructor)==null?void 0:r.name)||"")+"."+String(typeof t=="symbol"?t.description:t);if(a||Vn.set(s,a={}),a.key)throw new Error("@thenable "+c+" not allowed - @thenable "+a.key+" already defined");if(!Dn(i,Function))throw new Error("@thenable "+c+" only supports functions");if(i.length>0)throw new Error("@thenable "+c+" methods cannot be called with arguments");let d=function(u){return console.trace("@thenable "+c+" took more than "+h+"ms - make sure method does not return self.",u)},v=function(u){let m=l.get(u);return m||l.set(u,m={}),m},E=function(u,m){let p=this,g=v(p);return(g.promise||(g.promise=new Promise(function(S,w){let y=n.timeout!==!1?setTimeout(d,n.timeout||2e4,p):null,b=function(_){return y&&clearTimeout(y),g.met=!0,g.error=_,console.trace("@thenable "+c+" threw error",_),w(_)};return p[t]().then(function(){return y&&clearTimeout(y),g.met=!0,S(p)},b)}))).then(u,m)};return Object.defineProperty(s,"then",{enumerable:!1,configurable:!0,get:function(){return v(this).met?null:E}}),e.value=function(u){var m;let p=v(this);return(m=p.wrapped)!=null||(p.wrapped=Promise.resolve(i.call(this,p))),p.wrapped},e.value.reset=function(u){let m=v(u);l.delete(u)},e.value.check=v,e}function ih(){return console.warn("imba.serve is not available on the client")}var zu=Symbol(),Ir,oh=new(Ir=class{},f(Ir,zu,"Env",0),Ir),zn={};function lh(s,t,e){if(t!=null){let r=zn[s]||(zn[s]=new WeakMap);return r.get(t)||r.set(t,(e.memoized=s)&&e).get(t)}return e}function Ku(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var Ie=Symbol.for("#idler"),Jt=Symbol.for("#resolve"),Hu=Symbol(),Kn=class extends Set{constructor(){super(),this[Ie]=Promise.resolve(this)}emit(t,...e){return lt(this,t,e)}on(t,...e){return ot(this,t,...e)}once(t,...e){return V(this,t,...e)}un(t,...e){return Bt(this,t,...e)}add(t){var e=this;if(Ku(t,Function)&&(t=t()),!this.has(t)){let r=this.size==0;super.add(t),r&&(this[Ie]=this[Jt]=null,this.emit("busy",this)),this.emit("add",t,this);let n=function(){return e.delete(t)};t.then(n,n)}return t}delete(t){return super.delete(t)?(this.emit("delete",t,this),this.size==0&&(this[Jt]&&(this[Jt](!0),this[Jt]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[Ie]||(this[Ie]=new Promise(function(e){return t.size==0?e(!0):t[Jt]=e}))}get idle\u03A6(){return this.size==0}then(t,e){return this.idle.then(t,e)}};f(Kn,Hu,"Queue",24);var tn=Kn;function en(s,t){let e=[],r=[];for(let n=0,i=Us(s),o=i.length;n<o;n++){let l=i[n];if(n%2!=0)continue;let a=s[n+1];l==""?(r.push("%o"),e.push(a)):(r.push("%c%s%c %o"),e.push("background-color:#4c73e8;color:white",l,"background-color:none;color:initial"),e.push(a))}return[r.join(" "),...e]}var Mr=Symbol.for("#L");function ah(){return globalThis[Mr]||(globalThis[Mr]=globalThis[Mr]||en),!0}var Hn=Symbol.for("#toStringDeopt"),Me=Symbol.for("#named"),qn=Symbol.for("#symbols"),Un=Symbol.for("#batches"),Bn=Symbol.for("#extras"),Gn=Symbol.for("#stacks"),qu=Symbol(),Yn=class{constructor(t){this.dom=t,this.string=""}contains(t){return this.dom.classList.contains(t)}has(t){return this.dom.classList.contains(t)}add(t){return this.contains(t)?this:(this.string+=(this.string?" ":"")+t,this.dom.classList.add(t),this)}set(t,e){this[Me]||(this[Me]={});let r=this[Me][t];return r!=e&&(r&&this.decr(r),e&&this.incr(e),this[Me][t]=e),this}remove(t){if(!this.contains(t))return this;let e=new RegExp("(^|\\s)"+t+"(?=\\s|$)","g");return this.string=this.string.replace(e,""),this.dom.classList.remove(t),this}toggle(t,e){return e===void 0&&(e=!this.contains(t)),e?this.add(t):this.remove(t)}incr(t,e=0){var r=this;let n=this.stacks,i=n[t]||0;return i<1&&this.add(t),e>0&&setTimeout(function(){return r.decr(t)},e),n[t]=Math.max(i,0)+1}decr(t){let e=this.stacks,r=e[t]||0;return r==1&&this.remove(t),e[t]=Math.max(r,1)-1}reconcile(t,e,r){let n=this[qn],i=this[Un],o=!0;if(!n)n=this[qn]=[t],i=this[Un]=[e||""],r&&(this.dom.className||"").indexOf(r)==-1&&(n.push(t),i.push(r)),this.toString=this.valueOf=this[Hn];else{let l=n.indexOf(t),a=e||"";l==-1?(n.push(t),i.push(a),r&&(this.dom.className||"").indexOf(r)==-1&&(n.push(t),i.push(r))):i[l]!=a?i[l]=a:o=!1}o&&(this[Bn]=" "+i.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[Hn](){return this.string+(this[Bn]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[Gn]||(this[Gn]={})}};f(Yn,qu,"Flags",16);var Wn=Yn,Xn=Symbol.for("#__init__"),Fr=Symbol.for("#getRenderContext"),Uu=Symbol.for("#getDynamicContext"),Bu=Symbol.for("#removeFromCache"),C={context:null,document:null,createTextNode:function(s){return globalThis.document.createTextNode(s)}},Gu=Symbol(),Qn=class{constructor(t=null){this[Xn](t)}[Xn](t=null,e=!0,r=!0){var n;this.stack=t&&(n=t.stack)!==void 0?n:[],this.moving=t&&(n=t.moving)!==void 0?n:new Set}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}};f(Qn,Gu,"Renderer",16);var Yu=Qn,G=new Yu,Wu=Symbol(),Jn=class hh extends Map{constructor(t,e=null){super(),this._=t,this.sym=e}pop(){return C.context=null}[Fr](t){let e=this.get(t);return e||this.set(t,e=new hh(this._,t)),C.context=e}[Uu](t,e){return this[Fr](t)[Fr](e)}[Bu](t){let e=this[t];return e&&(this.delete(e),this[t]=null,this.value==e&&(this.value=null)),this}run(t,e=1){if(this.value=t,C.context==this&&(C.context=null),typeof t=="number"&&(t=String(t)),typeof t=="string"&&e==0){let r=this.text||(this.text=C.createTextNode(t));return t!=r.textContent&&(r.textContent=t),r}return this.get(t)}cache(t){return this.set(this.value,t),t}};f(Jn,Wu,"RenderContext",16);var Gt=Jn;function yr(s,t=Symbol(),e=s){return C.context=s[t]||(s[t]=new Gt(e,t))}function uh(){let s=C.context,t=s||new Gt(null);return globalThis.DEBUG_IMBA&&!s&&G.stack.length>0&&console.trace("detected unmemoized nodes in",G.stack.slice(0),"see https://imba.io",t),s&&(C.context=null),t}function Rr(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function Xu(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Zt=Symbol.for("#parent"),Zn=Symbol.for("#closestNode"),Qu=Symbol.for("#parentNode"),Ju=Symbol.for("#context"),ti=Symbol.for("##inited"),jr=Symbol.for("#getRenderContext"),Zu=Symbol.for("#getDynamicContext"),ei=Symbol.for("#insertChild"),te=Symbol.for("#appendChild"),Ar=Symbol.for("#replaceChild"),ri=Symbol.for("#removeChild"),ht=Symbol.for("#insertInto"),si=Symbol.for("#insertIntoDeopt"),ee=Symbol.for("#removeFrom"),ni=Symbol.for("#removeFromDeopt"),Ct=Symbol.for("#replaceWith"),ii=Symbol.for("#replaceWithDeopt"),Dr=Symbol.for("#placeholderNode"),tc=Symbol.for("#attachToParent"),ec=Symbol.for("#detachFromParent"),oi=Symbol.for("#placeChild"),rc=Symbol.for("#beforeReconcile"),sc=Symbol.for("#afterReconcile"),nc=Symbol.for("#afterVisit"),ic=Symbol.for("#visitContext"),li=Symbol.for("#__init__"),ai=Symbol.for("##parent"),Vr=Symbol.for("##up"),hi=Symbol.for("##context"),St=Symbol.for("#domNode"),Fe=Symbol.for("##placeholderNode"),ui=Symbol.for("#forNode"),ci=Symbol.for("#domDeopt"),Re=Symbol.for("##visitContext"),di=Symbol.for("#isRichElement"),fi=Symbol.for("#src"),Pt=Symbol.for("#htmlNodeName"),oc=Symbol.for("#getSlot"),mi=Symbol.for("#ImbaElement"),pi=Symbol.for("#cssns"),lc=Symbol.for("#cssid"),br=window.Event,ch=window.UIEvent,dh=window.FocusEvent,rn=window.MouseEvent,sn=window.PointerEvent,nn=window.KeyboardEvent,K=window.CustomEvent,Sr=window.Node,wr=window.Comment,on=window.Text,F=window.Element,fh=window.HTMLElement,mh=window.HTMLHtmlElement,ln=window.HTMLSelectElement,an=window.HTMLInputElement,hn=window.HTMLTextAreaElement,un=window.HTMLButtonElement,cn=window.HTMLOptionElement,ph=window.HTMLScriptElement,gh=window.SVGElement,vh=window.DocumentFragment,yh=window.ShadowRoot,dn=window.Document,bh=window.Window,Sh=window.customElements,gi={};function vi(s,t,e){if(!s)return e[t]=null;if(e[t]!==void 0)return e[t];let r=Object.getOwnPropertyDescriptor(s,t);return r!==void 0||s==SVGElement?e[t]=r||null:vi(Reflect.getPrototypeOf(s),t,e)}var zr={},Kr={},_e={},fn={};function Ee(){return globalThis.document}function wh(){return globalThis.imba.uses_window=!0,!0}var ac={get(s,t){let e=s,r;for(;e&&r==null;)(e=e[Zt])&&(r=e[t]);return r},set(s,t,e){let r=s,n;for(;r&&n==null;){if(we(r,t,Element))return r[t]=e,!0;r=r[Zt]}return!0}},hc=Symbol(),yi=class{get flags(){return this.documentElement.flags}emit(...t){return this.documentElement.emit(...t)}};f(yi,hc,"Document",1,Document);var wp=yi;Node.prototype[li]=function(){return this};var uc=Symbol(),bi=class{get[Zt](){return this[ai]||this.parentNode||this[Vr]}get[Zn](){return this}get[Qu](){var t;return(t=this[Zt])==null?void 0:t[Zn]}get[Ju](){return this[hi]||(this[hi]=new Proxy(this,ac))}[ti](){return this}[jr](t){return yr(this,t)}[Zu](t,e){return this[jr](t)[jr](e)}[ei](t,e){return t[ht](this,e)}[te](t){return t[ht](this,null)}[Ar](t,e){let r=this[ei](t,e);return this[ri](e),r}[ri](t){return t[ee](this)}[ht](t,e=null){return e?t.insertBefore(this,e):t.appendChild(this),this}[si](t,e){return e?t.insertBefore(this[St]||this,e):t.appendChild(this[St]||this),this}[ee](t){return t.removeChild(this)}[ni](t){return t.removeChild(this[St]||this)}[Ct](t,e){return e[Ar](t,this)}[ii](t,e){return e[Ar](t,this[St]||this)}get[Dr](){let t;return this[Fe]||(this[Fe]=(t=globalThis.document.createComment("placeholder"),t[ui]=this,t))}set[Dr](t){let e=this[Fe];this[Fe]=t,t[ui]=this,e&&e!=t&&e.parentNode&&e[Ct](t)}[tc](){let t=this[St],e=t&&t.parentNode;return t&&e&&t!=this&&(this[St]=null,this[ht](e,t),t[ee](e)),this}[ec](){this[ci]!=!0&&(this[ci]=!0,!0)&&(this[Ct]=this[ii],this[ee]=this[ni],this[ht]=this[si],this[Vr]||(this[Vr]=this[Zt]));let t=this[Dr];return this.parentNode&&t!=this&&(t[ht](this.parentNode,this),this[ee](this.parentNode)),this[St]=t,this}[oi](t,e,r){let n=typeof t;if(n==="undefined"||t===null){if(r&&Rr(r,Comment))return r;let i=globalThis.document.createComment("");return r?r[Ct](i,this):i[ht](this,null)}if(t===r)return t;if(n!=="object"){let i,o=t;return r?Rr(r,Text)?(r.textContent=o,r):(i=globalThis.document.createTextNode(o),r[Ct](i,this),i):(this.appendChild(i=globalThis.document.createTextNode(o)),i)}else return t[ht]?r?r[Ct](t,this):t[ht](this,null):this[oi](String(t),e,r)}};f(bi,uc,"Node",1,Node);var _p=bi,cc=Symbol(),Si=class{log(...t){return console.log(...t)}get hidden\u03A6(){var t,e;let r=globalThis.getComputedStyle(this);return r.display=="none"||r.visibility=="hidden"?!0:this.offsetParent||this===globalThis.document.body?!1:(e=(t=this.parentElement)==null?void 0:t.hidden\u03A6)!=null?e:!0}get detached\u03A6(){return!globalThis.document.documentElement.contains(this)}get unobstructed\u03A6(){let t=this.getBoundingClientRect(),e=window.visualViewport,r=t.left+t.width*.5,n=t.top+t.height*.5;if(e.width>r&&r>0&&e.height>n&&n>0){let i=globalThis.document.elementFromPoint(r,n);return!!(i&&(i.contains(this)||this.contains(i)))}return!1}get focus\u03A6(){return globalThis.document.activeElement==this}get focin\u03A6(){return this.contains(globalThis.document.activeElement)}emit(t,e,r={}){var n,i,o;e!=null&&((n=r.detail)!=null||(r.detail=e)),(i=r.bubbles)!=null||(r.bubbles=!0),(o=r.cancelable)!=null||(r.cancelable=!0);let l=new CustomEvent(t,r);r.original&&(l.originalEvent=r.original);let a=this.dispatchEvent(l);return l}text$(t){return this.textContent=t,this}[rc](){return this}[sc](){return this}[nc](){this[Re]&&(this[Re]=null)}get[ic](){return this[Re]||(this[Re]={})}get flags(){return this.$flags||(this.$flags=new Wn(this),this.flag$==Element.prototype.flag$&&(this.flags$ext=this.className),this.flagDeopt$()),this.$flags}flag$(t){let e=this.flags$ns;this.className=e?e+(this.flags$ext=t):this.flags$ext=t}flagDeopt$(){var t=this;this.flag$=this.flagExt$,this.flagSelf$=function(e){return t.flagSync$(t.flags$own=e)}}flagExt$(t){return this.flagSync$(this.flags$ext=t)}flagSelf$(t){return this.flagDeopt$(),this.flagSelf$(t)}flagSync$(){return this.className=(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||"")}set$(t,e){let r=we(this,t,Element);!r||!r.set?this.setAttribute(t,e):this[t]=e}get richValue(){return this.value}set richValue(t){this.value=t}};f(Si,cc,"Element",1,Element);var Tp=Si;Element.prototype.setns$=Element.prototype.setAttributeNS,Element.prototype[di]=!0;function xh(s,t,e,r){let n=globalThis.document.createElement(s);return e&&(n.className=e),r!==null&&n.text$(r),t&&t[te]&&t[te](n),n}var dc=Symbol(),wi=class{set$(t,e){var r;let n=gi[r=this.nodeName]||(gi[r]={}),i=vi(this,t,n);!i||!i.set?this.setAttribute(t,e):this[t]=e}flag$(t){let e=this.flags$ns;this.setAttribute("class",e?e+(this.flags$ext=t):this.flags$ext=t)}flagSelf$(t){var e=this;return this.flag$=function(r){return e.flagSync$(e.flags$ext=r)},this.flagSelf$=function(r){return e.flagSync$(e.flags$own=r)},this.flagSelf$(t)}flagSync$(){return this.setAttribute("class",(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||""))}};f(wi,dc,"SVGElement",1,SVGElement);var kp=wi,fc=Symbol(),xi=class{set src(t){if(this[fi]!=t&&(this[fi]=t,!0)){if(t&&t.adoptNode)t.adoptNode(this);else if(t&&t.type=="svg"){if(t.attributes)for(let e=t.attributes,r=0,n=Object.keys(e),i=n.length,o,l;r<i;r++)o=n[r],l=e[o],this.setAttribute(o,l);this.innerHTML=t.content}}}};f(xi,fc,"SVGSVGElement",1,SVGSVGElement);var Op=xi;function _h(s,t,e,r,n){let i=globalThis.document.createElementNS("http://www.w3.org/2000/svg",s);return e&&(i.className.baseVal=e),t&&t[te]&&t[te](i),r&&(i.textContent=r),i}function $t(s){return globalThis.document.createComment(s)}function xr(s){return globalThis.document.createTextNode(s)}function Eh(){return globalThis.document.createDocumentFragment()}var je=globalThis.navigator,mc=je&&je.vendor||"",_i=je&&je.userAgent||"",pc=mc.indexOf("Apple")>-1||_i.indexOf("CriOS")>=0||_i.indexOf("FxiOS")>=0,Ae=!pc,Ei=new Map,gc=Symbol(),Ti=class extends HTMLElement{connectedCallback(){return Ae?this.parentNode.removeChild(this):this.parentNode.connectedCallback()}disconnectedCallback(){if(!Ae)return this.parentNode.disconnectedCallback()}};f(Ti,gc,"CustomHook",0);var vc=Ti;window.customElements.define("i-hook",vc);function yc(s,t){let e=Ei.get(t);if(!e){e={};let r=t.prototype,n=[r];for(;(r=r&&Object.getPrototypeOf(r))&&r.constructor!=s.constructor;)n.unshift(r);for(let i=0,o=Xu(n),l=o.length;i<l;i++){let a=o[i],h=Object.getOwnPropertyDescriptors(a);Object.assign(e,h)}Ei.set(t,e)}return e}function mn(s,t,e,r,n){let i;typeof s!="string"&&s&&s.nodeName&&(s=s.nodeName);let o=Kr[s]||s;if(zr[s]){let l=zr[s],a=l.prototype[Pt];if(a&&Ae)i=globalThis.document.createElement(a,{is:o});else if(l.create$&&a){i=globalThis.document.createElement(a),i.setAttribute("is",o);let h=yc(i,l);Object.defineProperties(i,h),i.__slots={},i.appendChild(globalThis.document.createElement("i-hook"))}else l.create$?(i=l.create$(i),i.__slots={}):console.warn("could not create tag "+s)}else i=globalThis.document.createElement(Kr[s]||s);return i[ai]=t,i[li](),i[ti](),r!==null&&i[oc]("__").text$(r),(e||i.flags$ns)&&i.flag$(e||""),i}function Th(s,t,e,r){return s==null||s==null?$t(""):Rr(s,Node)||s[di]?s:mn(s,t,e,r)}function pn(s,t){if(_e[s])return _e[s];if(window[t])return window[t];if(window[s])return window[s]}function $h(s,t,e){var r;let n=pn(s,t);if(n||console.warn("could not inherit from undefined tag type "+s),!(n==e||n.prototype instanceof e||n.prototype[Pt])){let i=n.prototype[mi];if(!i){let o=Symbol();i=(r=class extends n{constructor(){super(...arguments),this.__slots={},this.__F=0}},f(r,o,"CustomBuiltInElement",16),r),n.prototype[mi]=i;let l=Object.getOwnPropertyDescriptors(e.prototype);Object.defineProperties(i.prototype,l),i.prototype[Pt]=s}return i}return n}function kh(s,t,e={}){_e[s]=fn[s]=t,t.nodeName=s;let r=s,n=t.prototype;if(s.indexOf("-")==-1&&(r=""+s+"-tag",Kr[s]=r),e.cssns){let i=(n._ns_||n[pi]||"")+" "+(e.cssns||"");n._ns_=i.trim()+" ",n[pi]=e.cssns}if(e.cssid){let i=(n.flags$ns||"")+" "+e.cssid;n[lc]=e.cssid,n.flags$ns=i.trim()+" "}return n[Pt]&&!e.extends&&(e.extends=n[Pt]),e.extends?(n[Pt]=e.extends,zr[s]=t,Ae&&window.customElements.define(r,t,{extends:e.extends})):window.customElements.define(r,t),t}var bc=globalThis.imba||(globalThis.imba={});bc.document=globalThis.document;function re(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function Hr(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var De=Symbol.for("#parent"),$i=Symbol.for("#closestNode"),Sc=Symbol.for("#isRichElement"),wc=Symbol.for("#afterVisit"),xc=Symbol.for("#getRenderContext"),ki=Symbol.for("#appendChild"),Ni=Symbol.for("#removeChild"),Oi=Symbol.for("#replaceChild"),ut=Symbol.for("#insertInto"),Ve=Symbol.for("#replaceWith"),Ci=Symbol.for("#insertChild"),ze=Symbol.for("#removeFrom"),Pi=Symbol.for("#placeChild"),_c=Symbol.for("#registerFunctionalSlot"),Ec=Symbol.for("#getFunctionalSlot"),Li=Symbol.for("#getSlot"),qr=Symbol.for("##parent"),wt=Symbol.for("##up"),Ii=Symbol.for("##flags"),Tc=Symbol.for("#domFlags"),q=Symbol.for("#end"),Mi=Symbol.for("#textContent"),Ke=Symbol.for("#textNode"),Ur=Symbol.for("#functionalSlots");function Nh(){return!0}var $c=Symbol(),Fi=class{constructor(){this.childNodes=[]}log(...t){}hasChildNodes(){return!1}set[De](t){this[qr]=t}get[De](){return this[qr]||this[wt]}get[$i](){return this[De][$i]}get[Sc](){return!0}get flags(){return this[Ii]||(this[Ii]=new Wn(this))}flagSync$(){return this}[wc](){return this}[xc](t){return yr(this,t)}};f(Fi,$c,"Fragment",16);var Yt=Fi,kc=0,Nc=Symbol(),Ri=class extends Yt{constructor(t,e){super(...arguments),this[wt]=e,this.parentNode=null,this[Tc]=t,this.childNodes=[],this[q]=$t("slot"+kc++),e&&e[ki](this)}get[De](){return this[qr]||this.parentNode||this[wt]}set textContent(t){this[Mi]=t}get textContent(){return this[Mi]}hasChildNodes(){for(let t=0,e=Hr(this.childNodes),r=e.length;t<r;t++){let n=e[t];if(re(n,Yt)&&n.hasChildNodes()||!re(n,wr)&&re(n,Sr))return!0}return!1}text$(t){return this[Ke]?this[Ke].textContent=t:this[Ke]=this[Pi](t),this[Ke]}appendChild(t){return this.parentNode&&t[ut](this.parentNode,this[q]),this.childNodes.push(t)}[ki](t){var e;return this.parentNode?t[ut](this.parentNode,this[q]):(e=t[wt])!=null||(t[wt]=this[wt]||this),this.childNodes.push(t)}insertBefore(t,e){this.parentNode&&this.parentNode[Ci](t,e);let r=this.childNodes.indexOf(e);return r>=0&&this.childNodes.splice(r,0,t),t}[Ni](t){this.parentNode&&this.parentNode[Ni](t);let e=this.childNodes.indexOf(t);e>=0&&this.childNodes.splice(e,1)}[Oi](t,e){this.parentNode&&this.parentNode[Oi](t,e);let r=this.childNodes.indexOf(e);return this.childNodes[r]=t,t}[ut](t,e){let r=this.parentNode;if(this.parentNode!=t&&(this.parentNode=t,!0)){this[q]&&(e=this[q][ut](t,e));for(let n=0,i=Hr(this.childNodes),o=i.length;n<o;n++)i[n][ut](t,e)}return this}[Ve](t,e){let r=t[ut](e,this[q]);return this[ze](e),r}[Ci](t,e){if(this.parentNode&&this.insertBefore(t,e||this[q]),e){let r=this.childNodes.indexOf(e);r>=0&&this.childNodes.splice(r,0,t)}else this.childNodes.push(t);return t}[ze](t){for(let e=0,r=Hr(this.childNodes),n=r.length;e<n;e++)r[e][ze](t);return this[q]&&this[q][ze](t),this.parentNode=null,this}[Pi](t,e,r){let n=this.parentNode,i=typeof t;if(i==="undefined"||t===null){if(r&&re(r,wr))return r;let o=$t("");if(r){let l=this.childNodes.indexOf(r);return this.childNodes.splice(l,1,o),n&&r[Ve](o,n),o}return this.childNodes.push(o),n&&o[ut](n,this[q]),o}if(t===r)return t;if(i!=="object"){let o,l=t;if(r){if(re(r,on))return r.textContent=l,r;{o=xr(l);let a=this.childNodes.indexOf(r);return this.childNodes.splice(a,1,o),n&&r[Ve](o,n),o}}else return this.childNodes.push(o=xr(l)),n&&o[ut](n,this[q]),o}else if(r){let o=this.childNodes.indexOf(r);return this.childNodes.splice(o,1,t),n&&r[Ve](t,n),t}else return this.childNodes.push(t),n&&t[ut](n,this[q]),t}};f(Ri,Nc,"VirtualFragment",16);var ji=Ri;function Oh(s,t){return new ji(s,t)}function Te(s,t){let e=new ji(s,null);return e[wt]=t,e}var Oc=Symbol(),Ai=class{[_c](t){let e=this[Ur]||(this[Ur]={});return e[t]||(e[t]=Te(0,this))}[Ec](t,e){let r=this[Ur];return r&&r[t]||this[Li](t,e)}[Li](t,e){var r;return t=="__"&&!this.render||!this.__slots?this:(r=this.__slots)[t]||(r[t]=Te(0,this))}};f(Ai,Oc,"Node",1,Sr);var Mp=Ai;function Cc(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Pc=Symbol.for("#afterVisit"),He=Symbol.for("#insertInto"),Di=Symbol.for("#appendChild"),Lc=Symbol.for("#replaceWith"),Br=Symbol.for("#removeFrom"),Ic=Symbol.for("#domFlags"),Mc=Symbol.for("##parent"),ft=Symbol.for("#end"),Fc=Symbol.for("#removeChild"),Rc=Symbol.for("#insertChild"),jc=Symbol(),Vi=class extends Yt{constructor(t,e){super(...arguments),this[Ic]=t,this[Mc]=e,t&256||(this[ft]=$t("list")),this.$=this.childNodes,this.length=0,e&&e[Di](this)}hasChildNodes(){return this.length!=0}[Pc](t){let e=this.length;if(this.length=t,e==t)return;let r=this.parentNode;if(!r)return;let n=this.childNodes,i=this[ft];if(e>t)for(;e>t;)r[Fc](n[--e]);else if(t>e)for(;t>e;)r[Rc](n[e++],i);this.length=t}[He](t,e){this.parentNode=t,this[ft]&&this[ft][He](t,e),e=this[ft];for(let r=0,n=Cc(this.childNodes),i=n.length;r<i;r++){let o=n[r];if(r==this.length)break;o[He](t,e)}return this}[Di](t){}[Lc](t,e){let r=t[He](e,this[ft]);return this[Br](e),r}[Br](t){let e=this.length;for(;e>0;)this.childNodes[--e][Br](t);this[ft]&&t.removeChild(this[ft]),this.parentNode=null}};f(Vi,jc,"IndexedTagFragment",16);var Ac=Vi;function Ch(s,t){return new Ac(s,t)}function zi(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Gr=Symbol.for("#appendChild"),qe=Symbol.for("#insertChild"),Dc=Symbol.for("#replaceWith"),Ue=Symbol.for("#insertInto"),Yr=Symbol.for("#removeFrom"),Vc=Symbol.for("#afterVisit"),Be=Symbol.for("#domFlags"),Ki=Symbol.for("##parent"),mt=Symbol.for("#end"),Hi=Symbol.for("#removeChild"),zc=Symbol(),qi=class extends Yt{constructor(t,e){super(...arguments),this[Be]=t,this[Ki]=e,this.changes=new Map,this.dirty=!1,this.array=this.childNodes,this.$=new Gt(this,Symbol()),t&256||(this[mt]=$t("map")),e&&e[Gr](this)}[Gr](t){if(this.parentNode)return this.parentNode[qe](t,this[mt])}hasChildNodes(){return this.childNodes.length!=0}push(t,e){if(!(this[Be]&1)){this.array.push(t),this[Gr](t);return}let r=this.array[e];if(r!==t){this.dirty=!0;let n=this.array.indexOf(t),i=this.changes.get(t);n===-1?(this.array.splice(e,0,t),this.insertChild(t,e,n)):n===e+1?(r&&this.changes.set(r,-1),this.array.splice(e,1)):(n>=0&&this.array.splice(n,1),this.array.splice(e,0,t),this.moveChild(t,e,n)),i==-1&&this.changes.delete(t)}}insertChild(t,e,r){let n=this.parentNode;if(n)if(e>0){let i=this.array[e-1];n[qe](t,i.nextSibling)}else n[qe](t,this.childNodes[e+1]||this[mt])}moveChild(t,e,r){return this.insertChild(t,e,r)}removeChild(t,e){t.parentNode&&t[Yr](t.parentNode)}[qe](t,e){}[Dc](t,e){let r=t[Ue](e,this[mt]);return this[Yr](e),r}[Ue](t,e){this[Ki]=t;let r=this.parentNode;if(t!=r){this.parentNode=t;for(let n=0,i=zi(this.array),o=i.length;n<o;n++)i[n][Ue](t,e);this[mt]&&this[mt][Ue](t,e)}return this}[Yr](t){for(let e=0,r=zi(this.array),n=r.length;e<n;e++){let i=r[e];t[Hi](i)}return this[mt]&&t[Hi](this[mt]),this.parentNode=null}[Vc](t){var e=this;if(!(this[Be]&1)){this[Be]|=1;return}if(this.dirty&&(this.changes.forEach(function(r,n){if(r==-1)return e.removeChild(n)}),this.changes.clear(),this.dirty=!1),this.array.length>t)for(;this.array.length>t;){let r=this.array.pop();this.removeChild(r)}}};f(qi,zc,"KeyedTagFragment",16);var Kc=qi;function Ph(s,t){return new Kc(s,t)}function Ui(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function Hc(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Ge=Symbol.for("#__init__"),qc=Symbol.for("##inited"),Uc=Symbol.for("#afterVisit"),Bc=Symbol.for("#insertInto"),Gc=Symbol.for("#insertIntoDeopt"),Yc=Symbol.for("#beforeReconcile"),Wc=Symbol.for("#afterReconcile"),Bi=Symbol.for("#__hooks__"),Lt=Symbol.for("#autorender"),Ye=Symbol.for("##visitContext"),Gi=Symbol.for("#domNode"),Xc=Symbol(),Wr,_r=new(Wr=class{constructor(s=null){this[Ge](s)}[Ge](s=null,t=!0,e=!0){var r;this.items=s&&(r=s.items)!==void 0?r:[],this.current=s&&(r=s.current)!==void 0?r:null,this.lastQueued=s&&(r=s.lastQueued)!==void 0?r:null,this.tests=s&&(r=s.tests)!==void 0?r:0}flush(){let s=null;for(;s=this.items.shift();){if(!s.parentNode||s.hydrated\u03A6)continue;let t=this.current;this.current=s,s.__F|=1024;try{s.connectedCallback()}catch(e){console.error(e)}this.current=t}}queue(s){var t=this;let e=this.items.length,r=0,n=this.lastQueued;this.lastQueued=s;let i=Node.DOCUMENT_POSITION_PRECEDING,o=Node.DOCUMENT_POSITION_FOLLOWING;if(e){let l=this.items.indexOf(n),a=l,h=function(d,v){return t.tests++,d.compareDocumentPosition(v)};(l==-1||n.nodeName!=s.nodeName)&&(a=l=0);let c=this.items[a];for(;c&&h(c,s)&o;)c=this.items[++a];if(a!=l)c?this.items.splice(a,0,s):this.items.push(s);else{for(;c&&h(c,s)&i;)c=this.items[--a];a!=l&&(c?this.items.splice(a+1,0,s):this.items.unshift(s))}}else this.items.push(s),this.current||globalThis.queueMicrotask(this.flush.bind(this))}},f(Wr,Xc,null,16),Wr);function Lh(){return _r.flush()}var Qc=Symbol(),Yi=class extends HTMLElement{constructor(){super(),this.flags$ns&&(this.flag$=this.flagExt$),this.setup$(),this.build()}setup$(){return this.__slots={},this.__F=0}[Ge](){return this.__F|=3,this}[qc](){if(this[Bi])return this[Bi].inited(this)}flag$(t){this.className=this.flags$ext=t}build(){return this}awaken(){return this}mount(){return this}remount(){return this.mount(),this}unmount(){return this}rendered(){return this}dehydrate(){return this}hydrate(){return this.autoschedule=!0,this}tick(t,e){return this.commit()}visit(){return this.commit()}commit(){return this.render\u03A6?(this.__F|=256,this.render&&this.render(),this.rendered(),this.__F=(this.__F|512)&-257&-8193):(this.__F|=8192,this)}get autoschedule(){return(this.__F&64)!=0}set autoschedule(t){t?this.__F|=64:this.__F&=-65}set autorender(t){let e=this[Lt]||(this[Lt]={});e.value=t,this.mounted\u03A6&&P.schedule(this,e)}get render\u03A6(){return!this.suspended\u03A6}get mounting\u03A6(){return(this.__F&16)!=0}get mounted\u03A6(){return(this.__F&32)!=0}get awakened\u03A6(){return(this.__F&8)!=0}get rendered\u03A6(){return(this.__F&512)!=0}get suspended\u03A6(){return(this.__F&4096)!=0}get rendering\u03A6(){return(this.__F&256)!=0}get scheduled\u03A6(){return(this.__F&128)!=0}get hydrated\u03A6(){return(this.__F&2)!=0}get ssr\u03A6(){return(this.__F&1024)!=0}get scheduler(){return P}schedule(){return P.on("commit",this),this.__F|=128,this}unschedule(){return P.un("commit",this),this.__F&=-129,this}async suspend(t=null){let e=this.flags.incr("@suspended");return this.__F|=4096,Ui(t,Function)&&(await t(),this.unsuspend()),this}unsuspend(){return this.flags.decr("@suspended")==0&&(this.__F&=-4097,this.commit()),this}[Uc](){if(this.visit(),this[Ye])return this[Ye]=null}[Bc](t,e=null){if(this.mounted\u03A6&&t.moveBefore)t.moveBefore(this,e);else{let r=(this.__F&32)!=0&&t==this.parentNode;r&&G.moving.add(this),e?t.insertBefore(this,e):t.appendChild(this),r&&G.moving.delete(this)}return this}[Gc](t,e){if(this.mounted\u03A6&&t.moveBefore)t.moveBefore(this[Gi]||this,e);else{let r=this[Gi]||this,n=(this.__F&32)!=0&&t==this.parentNode;n&&G.moving.add(this),e?t.insertBefore(r,e):t.appendChild(r),n&&G.moving.delete(this)}return this}[Yc](){return this.__F&1024&&(this.__F=this.__F&-1025,this.classList.remove("_ssr_"),this.flags$ext&&this.flags$ext.indexOf("_ssr_")==0&&(this.flags$ext=this.flags$ext.slice(5)),this.__F&512||(this.innerHTML="")),globalThis.DEBUG_IMBA&&G.push(this),this[Ye]&&(this[Ye]=null),this}[Wc](){return globalThis.DEBUG_IMBA&&G.pop(this),this}connectedMoveCallback(){this.remount()}connectedCallback(){let t=this.__F,e=t&1,r=t&8;if(t&ENV_EL_MOVING){this.__F=t&~ENV_EL_MOVING,this.remount();return}if(!e&&!(t&1024)){_r.queue(this);return}if(t&48)return;this.__F|=16,e||this[Ge](),t&2||(this.flags$ext=this.className,this.__F|=2,this.hydrate(),this.commit()),r||(this.awaken(),this.__F|=8),lt(this,"mount",[this]);let n=this.mount();return n&&Ui(n.then,Function)&&n.then(P.commit),t=this.__F=(this.__F|32)&-17,t&64&&this.schedule(),this[Lt]&&P.schedule(this,this[Lt]),this}disconnectedCallback(){var t;if(!(this.__F&ENV_EL_MOVING)){if(G.moving.size){for(let e of Hc(G.moving))if((t=e?.contains)!=null&&t.call(e,this)){this.__F|=ENV_EL_MOVING;return}}if(this.__F=this.__F&-49,this.__F&128&&this.unschedule(),lt(this,"unmount",[this]),this.unmount(),this[Lt])return P.unschedule(this,this[Lt])}}dataForTagName(t){}};f(Yi,Qc,"Component",16);var $e=Yi,Ih=$e;function Jc(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var Wi=Symbol.for("#__init__"),Zc={cm:1,mm:1,Q:1,pc:1,pt:1,px:1,em:1,ex:1,ch:1,rem:1,vw:1,vh:1,vmin:1,vmax:1,s:1,ms:1,fr:1,"%":1,in:1,turn:1,grad:1,rad:1,deg:1,Hz:1,kHz:1},Xi={prefix:1,suffix:1,content:1},Xr={rose:[[356,100,97],[356,100,95],[353,96,90],[353,96,82],[351,95,71],[350,89,60],[347,77,50],[345,83,41],[343,80,35],[342,75,30]],pink:[[327,73,97],[326,78,95],[326,85,90],[327,87,82],[329,86,70],[330,81,60],[333,71,51],[335,78,42],[336,74,35],[336,69,30]],fuchsia:[[289,100,98],[287,100,95],[288,96,91],[291,93,83],[292,91,73],[292,84,61],[293,69,49],[295,72,40],[295,70,33],[297,64,28]],purple:[[270,100,98],[269,100,95],[269,100,92],[269,97,85],[270,95,75],[271,91,65],[271,81,56],[272,72,47],[273,67,39],[274,66,32]],violet:[[250,100,98],[251,91,95],[251,95,92],[252,95,85],[255,92,76],[258,90,66],[262,83,58],[263,70,50],[263,69,42],[264,67,35]],indigo:[[226,100,97],[226,100,94],[228,96,89],[230,94,82],[234,89,74],[239,84,67],[243,75,59],[245,58,51],[244,55,41],[242,47,34]],blue:[[214,100,97],[214,95,93],[213,97,87],[212,96,78],[213,94,68],[217,91,60],[221,83,53],[224,76,48],[226,71,40],[224,64,33]],sky:[[204,100,97],[204,94,94],[201,94,86],[199,95,74],[198,93,60],[199,89,48],[200,98,39],[201,96,32],[201,90,27],[202,80,24]],cyan:[[183,100,96],[185,96,90],[186,94,82],[187,92,69],[188,86,53],[189,94,43],[192,91,36],[193,82,31],[194,70,27],[196,64,24]],teal:[[166,76,97],[167,85,89],[168,84,78],[171,77,64],[172,66,50],[173,80,40],[175,84,32],[175,77,26],[176,69,22],[176,61,19]],emerald:[[152,81,96],[149,80,90],[152,76,80],[156,72,67],[158,64,52],[160,84,39],[161,94,30],[163,94,24],[163,88,20],[164,86,16]],green:[[138,76,97],[141,84,93],[141,79,85],[142,77,73],[142,69,58],[142,71,45],[142,76,36],[142,72,29],[143,64,24],[144,61,20]],lime:[[78,92,95],[80,89,89],[81,88,80],[82,85,67],[83,78,55],[84,81,44],[85,85,35],[86,78,27],[86,69,23],[88,61,20]],yellow:[[55,92,95],[55,97,88],[53,98,77],[50,98,64],[48,96,53],[45,93,47],[41,96,40],[35,92,33],[32,81,29],[28,73,26]],amber:[[48,100,96],[48,96,89],[48,97,77],[46,97,65],[43,96,56],[38,92,50],[32,95,44],[26,90,37],[23,83,31],[22,78,26]],orange:[[33,100,96],[34,100,92],[32,98,83],[31,97,72],[27,96,61],[25,95,53],[21,90,48],[17,88,40],[15,79,34],[15,75,28]],red:[[0,86,97],[0,93,94],[0,96,89],[0,94,82],[0,91,71],[0,84,60],[0,72,51],[0,74,42],[0,70,35],[0,63,31]],warmer:[[60,9,98],[60,5,96],[20,6,90],[24,6,83],[24,5,64],[25,5,45],[33,5,32],[30,6,25],[12,6,15],[24,10,10]],warm:[[0,0,98],[0,0,96],[0,0,90],[0,0,83],[0,0,64],[0,0,45],[0,0,32],[0,0,25],[0,0,15],[0,0,9]],gray:[[0,0,98],[240,5,96],[240,6,90],[240,5,84],[240,5,65],[240,4,46],[240,5,34],[240,5,26],[240,4,16],[240,6,10]],cool:[[210,20,98],[220,14,96],[220,13,91],[216,12,84],[218,11,65],[220,9,46],[215,14,34],[217,19,27],[215,28,17],[221,39,11]],cooler:[[210,40,98],[210,40,96],[214,32,91],[213,27,84],[215,20,65],[215,16,47],[215,19,35],[215,25,27],[217,33,17],[222,47,11]]},td=new RegExp("^("+Object.keys(Xr).join("|")+")(\\d+(?:\\.\\d+)?)$"),ed=/^([xyz])$/,rd=/^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/,sd=`*,::before,::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: currentColor;
}`,nd=Symbol(),Qi=class{constructor(t=null){this[Wi](t)}[Wi](t=null,e=!0,r=!0){var n;this.entries=t&&(n=t.entries)!==void 0?n:{}}register(t,e){let r=this.entries[t];r?r&&(r.css=e,r.node&&(r.node.textContent=e)):(r=this.entries[t]={sourceId:t,css:e},this.entries.resets||this.register("resets",sd),r.node=globalThis.document.createElement("style"),r.node.setAttribute("data-id",t),r.node.textContent=r.css,globalThis.document.head.appendChild(r.node))}toString(){return Object.values(this.entries).map(function(t){return t.css}).join(`
`)}toValue(t,e,r,n=null){let i;Xi[r]&&(t=String(t));let o=typeof t;if(o=="number"){if(e||(ed.test(r)?e="px":rd.test(r)?e="u":r=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return Zc[e]?t+e:e=="u"?t*4+"px":"calc(var(--u_"+e+",1px) * "+t+")"}else if(o=="string"){if(r&&Xi[r]&&t[0]!='"'&&t[0]!="'"&&(t.indexOf('"')>=0?t.indexOf("'")==-1&&(t="'"+t+"'"):t='"'+t+'"'),i=t.match(td)){let l=Xr[i[1]][parseInt(i[2])],a="100%";if(typeof n=="number"?a=n+"%":typeof n=="string"&&(a=n),l)return"hsla("+l[0]+","+l[1]+"%,"+l[2]+"%,"+a+")"}}else if(t&&Jc(t.toStyleString,Function))return t.toStyleString();return t}parseDimension(t){if(typeof t=="string"){let[e,r,n]=t.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(r),n]}else if(typeof t=="number")return[t]}};f(Qi,nd,"Styles",16);var id=Qi,gn=new id,Mh=Object.keys(Xr);function Fh(){return globalThis.imba.uses_styles=!0,!0}var od=Symbol(),Ji=class{css$(t,e,r){return this.style[t]=e}css$var(t,e,r,n,i=null){let o=gn.toValue(e,r,n,i);this.style.setProperty(t,o)}};f(Ji,od,"Element",1,F);var Vp=Ji;function ld(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var Zi=Symbol.for("#insertInto"),to=Symbol.for("#removeFrom");function Rh(s,t={}){let e=C.context;C.context=t;let r=s(t);return C.context==t&&(C.context=e),r}function vn(s,t,e={}){let r=t||globalThis.document.body,n=s;if(ld(s,Function)){let i=s,o=e.tick||(e.tick=function(){let l=e.context||(e.context=new Gt(r,null)),a=C.context;C.context=l;let h=s(l,e);return C.context==l&&(C.context=a),e.node!=h&&(e.node&&globalThis.imba.unmount(e.node),h?((e.node=h)[Zi](r),h.tick==$e.prototype.tick&&(h.tick=e.tick,h.scheduled\u03A6),V(h,"unmount",function(){if(e.node==h)return e.node=null,P.unlisten("commit",e.tick)})):(e.node=h,P.unlisten("commit",e.tick))),h});return P.listen("commit",o),o()}else n.__F|=64;return n[Zi](r),n}function yn(s){return s&&s[to]&&s.parentNode&&s[to](s.parentNode),s}var eo=globalThis.imba||(globalThis.imba={});eo.mount=vn,eo.unmount=yn;function Q(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function se(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var ne=Symbol.for("##onchange"),ie=Symbol.for("#afterVisit"),oe=Symbol.for("##oninput"),We=Symbol.for("##onclick"),le=Symbol.for("##bound"),pt=Symbol.for("##visitContext");function jh(){return globalThis.imba.uses_dom_bind=!0,!0}var ad={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},Qr=function(s){return Q(s,Array)||s&&Q(s.has,Function)},Jr=function(s,t){return s==t?!0:Q(s,Array)?s.indexOf(t)>=0:s&&Q(s.has,Function)?s.has(t):s&&Q(s.contains,Function)?s.contains(t):!1},Zr=function(s,t){if(Q(s,Array))return s.push(t);if(s&&Q(s.add,Functio