imba
Version:
9 lines • 143 kB
JavaScript
var Lr=Object.defineProperty;var Eu=Object.getOwnPropertyDescriptor;var $u=Object.getOwnPropertyNames;var ku=Object.prototype.hasOwnProperty;var Nu=(s,t)=>{for(var e in t)Lr(s,e,{get:t[e],enumerable:!0})},Ou=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $u(t))!ku.call(s,n)&&n!==e&&Lr(s,n,{get:()=>t[n],enumerable:!(r=Eu(t,n))||r.enumerable});return s};var Cu=s=>Ou(Lr({},"__esModule",{value:!0}),s);var cp={};Nu(cp,{Accessor:()=>On,Action:()=>Pr,CUSTOM_TYPES:()=>mn,ClassFlags:()=>dt,Comment:()=>_r,Component:()=>$e,ComputedType:()=>Nn,CustomEvent:()=>H,Document:()=>fn,DocumentFragment:()=>yh,EaseGroup:()=>Vh,Easer:()=>Sn,Element:()=>F,ElementRoute:()=>Cr,ElementRouteTo:()=>$n,Emitter:()=>xe,Event:()=>wr,EventHandler:()=>kr,FocusEvent:()=>fh,Fragment:()=>Wt,HAS:()=>Ha,HTMLButtonElement:()=>cn,HTMLElement:()=>mh,HTMLHtmlElement:()=>ph,HTMLInputElement:()=>hn,HTMLOptionElement:()=>dn,HTMLScriptElement:()=>gh,HTMLSelectElement:()=>an,HTMLTextAreaElement:()=>un,ImbaElement:()=>Mh,IntersectionEventDefaults:()=>Ne,KeyboardEvent:()=>on,LazyProxy:()=>Gs,MouseEvent:()=>sn,Node:()=>xr,OBSERVED:()=>N,ObservableArray:()=>kn,PointerEvent:()=>nn,Queue:()=>en,Ref:()=>Xt,RenderContext:()=>Gt,Router:()=>En,SVGElement:()=>vh,Scheduler:()=>Ys,ShadowRoot:()=>bh,TYPES:()=>_e,Text:()=>ln,Touch:()=>xn,UIEvent:()=>dh,Window:()=>Sh,__has__$:()=>Ks,__hooks__$:()=>gr,__imba__$:()=>vr,__init__$:()=>Et,__inited__$:()=>Hs,__initor__$:()=>pr,__meta__$:()=>qs,__mixin__$:()=>Ra,__patch__$:()=>Fa,__served__:()=>Ja,accessor:()=>Su,afterReconcile$:()=>Va,afterVisit$:()=>Aa,appendChild$:()=>ja,atomic:()=>ou,augment$:()=>qt,autorun:()=>su,awaits:()=>nu,beforeReconcile$:()=>Da,clearInterval:()=>Js,clearTimeout:()=>Zs,colors:()=>Fh,commit:()=>L,createAtom:()=>ru,createComment:()=>$t,createComponent:()=>pn,createDynamic:()=>$h,createElement:()=>_h,createFragment:()=>Eh,createIndexedList:()=>Ph,createKeyedList:()=>Lh,createLiveFragment:()=>Ch,createRef:()=>du,createRenderContext:()=>Sr,createSVGElement:()=>Th,createSlot:()=>Ee,createTextNode:()=>Tr,customElements:()=>wh,decorate$:()=>Wa,defineConfig:()=>th,defineTag:()=>Nh,descriptor:()=>wu,devlog$:()=>Ga,disposeObservables:()=>fu,emit:()=>lt,env:()=>oh,events:()=>Hh,extend$:()=>br,getComputed:()=>mu,getDeepPropertyDescriptor:()=>we,getRenderContext:()=>ch,getSuperTagType:()=>kh,getTagType:()=>gn,get_document:()=>Te,has$:()=>Ba,hooks:()=>tn,hotkeys:()=>_n,hydrate:()=>Ih,hydrator:()=>Er,idx$:()=>Ua,inited$:()=>Qa,is$:()=>Ka,isa$:()=>qa,iterable$:()=>yr,listen:()=>ot,locals:()=>Qh,logFormatter:()=>rn,matcher:()=>Bs,memofunc:()=>lh,memofuncv:()=>ah,mount:()=>yn,multi$:()=>Ya,observable:()=>iu,once:()=>V,parseTime:()=>Bt,proxy:()=>Ws,register$:()=>f,render:()=>jh,renderContext:()=>C,renderer:()=>G,reportChanged:()=>hu,reportInvalidated:()=>uu,reportObserved:()=>cu,router:()=>tu,run:()=>lu,rx:()=>Yt,scheduler:()=>P,serve:()=>ih,session:()=>Tn,setInterval:()=>Qs,setTimeout:()=>Xs,spy:()=>au,statics$:()=>Us,styles:()=>vn,sup$:()=>Xa,toCamelCase:()=>Za,transitions:()=>ke,unlisten:()=>Ut,unmount:()=>bn,up$:()=>za,use_devlog:()=>hh,use_dom_bind:()=>Ah,use_dom_teleport:()=>Dh,use_dom_transitions:()=>zh,use_events:()=>Kh,use_events_hotkey:()=>Xh,use_events_intersect:()=>Uh,use_events_keyboard:()=>wn,use_events_mouse:()=>$r,use_events_mutate:()=>Wh,use_events_pointer:()=>qh,use_events_resize:()=>Gh,use_events_selection:()=>Yh,use_events_touch:()=>Bh,use_hooks:()=>eh,use_router:()=>Zh,use_slots:()=>Oh,use_styles:()=>Rh,use_window:()=>xh,\u03B1action:()=>bu,\u03B1autorun:()=>yu,\u03B1bound:()=>sh,\u03B1computed:()=>pu,\u03B1lazy:()=>rh,\u03B1observable:()=>gu,\u03B1prop:()=>xu,\u03B1ref:()=>vu,\u03B1thenable:()=>nh});module.exports=Cu(cp);var Et=Symbol.for("#__init__"),pr=Symbol.for("#__initor__"),Hs=Symbol.for("#__inited__"),gr=Symbol.for("#__hooks__"),Fa=Symbol.for("#__patch__"),Ks=Symbol.for("#has"),qs=Symbol.for("#meta"),vr=Symbol.for("imba"),Ra=Symbol.for("#__mixin__"),Bs=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"),Ha={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,Pu=globalThis[vr]||(globalThis[vr]={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:Pu.counter++,...t}),kt.get(s)}var Pn=new WeakMap;function Ka(s,t){var e;return s==t||((e=t?.[Bs])==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 Ba(s,t){var e,r,n,i,o,l;return(l=(o=(n=(e=t?.[Ks])==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 Ua(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 Us(s){return Pn.get(s)||Pn.set(s,{}).get(s)}function yr(s){var t;return((t=s?.toIterable)==null?void 0:t.call(s))||s}function Wa(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 Lu(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 br(s,t,e,r={}){let n=s.constructor;!e&&t&&(e=Object.getOwnPropertyDescriptors(t),delete e.constructor,e[Et]&&(console.warn(`Cannot define plain fields when extending class ${n.name}`),delete e[Et]));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 d=o.get(h);d||o.set(h,d={});let c=Object.getOwnPropertyDescriptor(h.prototype,l);c&&!Lu(a,c)?console.warn("wont extend",l,c,a):d[l]=e[l]}}for(let[l,a]of o)Object.keys(a).length&&br(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[Et]&&(r.inits||(r.inits=[]),r.inits.push(t.prototype[Et]),delete o[Et]),Object.defineProperties(s.prototype,o),t?.mixed instanceof Function&&t.mixed(s),s}function Ya(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 W={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(s,t,e)=>Reflect.apply(W.target,t,e),get:(s,t)=>{let e=Reflect.get(W.target,t,W.self);return e instanceof Function?e.bind(W.self):e},set:(s,t,e,r)=>Reflect.set(W.target,t,e,W.self)})};function Xa(s,t){return W.self=s,W.target=W.cache[t],W.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 d=r&dt.IsObjectExtension?n:n.prototype,c=bt(s);if(c.uses){n===d&&console.warn("Cannot extend object with mixins");for(let v of c.uses)qt(n,v)}return r&dt.HasSuperCalls&&(W.cache[t]=Object.create(Object.getPrototypeOf(d),Object.getOwnPropertyDescriptors(d))),br(d,s.prototype),n}let h=o?.constructor;if(a=bt(s,{symbol:t}),Object.defineProperty(s,qs,{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[pr]=t),a.uses)for(let d of a.uses)(i=d.mixes)==null||i.call(d,s);return h?.inherited instanceof Function&&h.inherited(s),s}function Qa(s,t){var e;s[pr]===t&&((e=s[Hs])==null||e.call(s),s[gr]&&s[gr].inited(s))}var Ce=Symbol.for("#__listeners__"),Iu=/-./g,Ja=new Set,Mu=Symbol(),Ln=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(Ln,Mu,"LazyProxy",16);var Gs=Ln;function Ws(s,t={}){return new Proxy(t,new Gs(s))}function Bt(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(Iu,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 In=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 Ut(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]&&In(t,e,r[t]),r.all&&In(t,[t,e],r.all))}var Fu=Symbol(),Mn=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 Ut(this,t,...e)}};f(Mn,Fu,"Emitter",0);var xe=Mn;function th(s){return s}function Ir(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function Ru(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Fn=Symbol.for("#__init__"),Rn=Symbol.for("#schedule"),Mr=Symbol.for("#frames"),Pe=Symbol.for("#interval"),Nt=Symbol.for("#stage"),Ot=Symbol.for("#scheduled"),Le=Symbol.for("#version"),ju=Symbol.for("#fps"),jn=Symbol.for("#ticker"),Au=globalThis.requestAnimationFrame||function(s){return globalThis.setTimeout(s,1e3/60)},pp=1/60,Du=Symbol(),An=class{constructor(t=null){this[Fn](t)}[Fn](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[Mr],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(An,Du,"Scheduled",16);var Vu=An,zu=Symbol(),Dn=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[Nt]=-1,this[Mr]=0,this[Ot]=!1,this[Le]=0,this.listeners={},this.intervals={},this.commit=function(){return t.add("commit"),t},this[ju]=0,this.$promise=null,this.$resolve=null,this[jn]=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[Rn](),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[Mr]++;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=Ru(r),l=o.length;i<l;i++){let a=o[i];typeof a=="string"&&this.listeners[a]?this.listeners[a].forEach(function(h){if(Ir(h.tick,Function))return h.tick(e,a);if(Ir(h,Function))return h(e,a)}):Ir(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}[Rn](){return this[Ot]||(this[Ot]=!0,this[Nt]==-1&&(this[Nt]=0),Au(this[jn])),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 Vu({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(Dn,zu,"Scheduler",16);var Ys=Dn,P=new Ys;function L(){return P.add("commit").promise}function Xs(s,t){return globalThis.setTimeout(function(){s(),L()},t)}function Qs(s,t){return globalThis.setInterval(function(){s(),L()},t)}var Js=globalThis.clearInterval,Zs=globalThis.clearTimeout,Qt=globalThis.imba||(globalThis.imba={});Qt.commit=L,Qt.setTimeout=Xs,Qt.setInterval=Qs,Qt.clearInterval=Js,Qt.clearTimeout=Zs;var tn={on:function(s,t){return ot(this,s,t)},inited:function(s){return lt(this,"inited",[s])}};function eh(){return!0}function Vn(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(Vn(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 zn=new WeakMap;function nh(s,t,e){var r;let n=this[0]||{},i=e.value,o=Symbol(),l=new WeakMap,a=zn.get(s),h=n.timeout||20*1e3,d=""+(((r=s.constructor)==null?void 0:r.name)||"")+"."+String(typeof t=="symbol"?t.description:t);if(a||zn.set(s,a={}),a.key)throw new Error("@thenable "+d+" not allowed - @thenable "+a.key+" already defined");if(!Vn(i,Function))throw new Error("@thenable "+d+" only supports functions");if(i.length>0)throw new Error("@thenable "+d+" methods cannot be called with arguments");let c=function(u){return console.trace("@thenable "+d+" 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},T=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(c,n.timeout||2e4,p):null,b=function(_){return y&&clearTimeout(y),g.met=!0,g.error=_,g.promise=null,g.wrapped=null,console.trace("@thenable "+d+" threw error",_),w(_)};return p[t]().then(function(){return y&&clearTimeout(y),g.met=!0,g.promise=null,g.wrapped=null,S(p)},b)}))).then(u,m)};return Object.defineProperty(s,"then",{enumerable:!1,configurable:!0,get:function(){return v(this).met?null:T}}),e.value=function(u){var m;let p=v(this);return p.met?p.error?Promise.reject(p.error):Promise.resolve(this):((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 Hu=Symbol(),Fr,oh=new(Fr=class{},f(Fr,Hu,"Env",0),Fr),Ie={};function lh(s,t,e){if(t!=null){let r=Ie[s]||(Ie[s]=new WeakMap);return r.get(t)||r.set(t,(e.memoized=s)&&e).get(t)}return e}function ah(s,t,e,r){let n=Ie[s]||(Ie[s]=new WeakMap),i=n.get(t);i||n.set(t,i={f:null,o:null,p:null});for(let o=0,l=yr(r),a=l.length;o<a;o++){let h=l[o],d=h!==null&&(typeof h=="object"||typeof h=="function")?i.o||(i.o=new WeakMap):i.p||(i.p=new Map),c=d.get(h);c||d.set(h,c={f:null,o:null,p:null}),i=c}return i.f||(i.f=(e.memoized=s)&&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 Me=Symbol.for("#idler"),Jt=Symbol.for("#resolve"),qu=Symbol(),Hn=class extends Set{constructor(){super(),this[Me]=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 Ut(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[Me]=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[Me]||(this[Me]=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(Hn,qu,"Queue",24);var en=Hn;function rn(s,t){let e=[],r=[];for(let n=0,i=yr(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 Rr=Symbol.for("#L");function hh(){return globalThis[Rr]||(globalThis[Rr]=globalThis[Rr]||rn),!0}var Kn=Symbol.for("#toStringDeopt"),Fe=Symbol.for("#named"),qn=Symbol.for("#symbols"),Bn=Symbol.for("#batches"),Un=Symbol.for("#extras"),Gn=Symbol.for("#stacks"),Bu=Symbol(),Wn=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[Fe]||(this[Fe]={});let r=this[Fe][t];return r!=e&&(r&&this.decr(r),e&&this.incr(e),this[Fe][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[Bn],o=!0;if(!n)n=this[qn]=[t],i=this[Bn]=[e||""],r&&(this.dom.className||"").indexOf(r)==-1&&(n.push(t),i.push(r)),this.toString=this.valueOf=this[Kn];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[Un]=" "+i.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[Kn](){return this.string+(this[Un]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[Gn]||(this[Gn]={})}};f(Wn,Bu,"Flags",16);var Yn=Wn,Xn=Symbol.for("#__init__"),jr=Symbol.for("#getRenderContext"),Uu=Symbol.for("#getDynamicContext"),Gu=Symbol.for("#removeFromCache"),C={context:null,document:null,createTextNode:function(s){return globalThis.document.createTextNode(s)}},Wu=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,Wu,"Renderer",16);var Yu=Qn,G=new Yu,Xu=Symbol(),Jn=class uh extends Map{constructor(t,e=null){super(),this._=t,this.sym=e}pop(){return C.context=null}[jr](t){let e=this.get(t);return e||this.set(t,e=new uh(this._,t)),C.context=e}[Uu](t,e){return this[jr](t)[jr](e)}[Gu](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),e==0){let r=t;if(typeof r=="number"&&(r=String(r)),typeof r=="string"){let n=this.text||(this.text=C.createTextNode(r));return r!=n.textContent&&(n.textContent=r),n}}return this.get(t)}cache(t){return this.set(this.value,t),t}};f(Jn,Xu,"RenderContext",16);var Gt=Jn;function Sr(s,t=Symbol(),e=s){return C.context=s[t]||(s[t]=new Gt(e,t))}function ch(){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 Ar(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function Qu(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Zt=Symbol.for("#parent"),Zn=Symbol.for("#closestNode"),Ju=Symbol.for("#parentNode"),Zu=Symbol.for("#context"),ti=Symbol.for("##inited"),Dr=Symbol.for("#getRenderContext"),tc=Symbol.for("#getDynamicContext"),ei=Symbol.for("#insertChild"),te=Symbol.for("#appendChild"),Vr=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"),zr=Symbol.for("#placeholderNode"),ec=Symbol.for("#attachToParent"),rc=Symbol.for("#detachFromParent"),oi=Symbol.for("#placeChild"),sc=Symbol.for("#beforeReconcile"),nc=Symbol.for("#afterReconcile"),ic=Symbol.for("#afterVisit"),oc=Symbol.for("#visitContext"),li=Symbol.for("#__init__"),ai=Symbol.for("##parent"),Hr=Symbol.for("##up"),hi=Symbol.for("##context"),St=Symbol.for("#domNode"),Re=Symbol.for("##placeholderNode"),ui=Symbol.for("#forNode"),ci=Symbol.for("#domDeopt"),je=Symbol.for("##visitContext"),di=Symbol.for("#isRichElement"),fi=Symbol.for("#src"),Pt=Symbol.for("#htmlNodeName"),lc=Symbol.for("#getSlot"),mi=Symbol.for("#ImbaElement"),pi=Symbol.for("#cssns"),ac=Symbol.for("#cssid"),wr=window.Event,dh=window.UIEvent,fh=window.FocusEvent,sn=window.MouseEvent,nn=window.PointerEvent,on=window.KeyboardEvent,H=window.CustomEvent,xr=window.Node,_r=window.Comment,ln=window.Text,F=window.Element,mh=window.HTMLElement,ph=window.HTMLHtmlElement,an=window.HTMLSelectElement,hn=window.HTMLInputElement,un=window.HTMLTextAreaElement,cn=window.HTMLButtonElement,dn=window.HTMLOptionElement,gh=window.HTMLScriptElement,vh=window.SVGElement,yh=window.DocumentFragment,bh=window.ShadowRoot,fn=window.Document,Sh=window.Window,wh=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 Kr={},qr={},_e={},mn={};function Te(){return globalThis.document}function xh(){return globalThis.imba.uses_window=!0,!0}var hc={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}},uc=Symbol(),yi=class{get flags(){return this.documentElement.flags}emit(...t){return this.documentElement.emit(...t)}};f(yi,uc,"Document",1,Document);var xp=yi;Node.prototype[li]=function(){return this};var cc=Symbol(),bi=class{get[Zt](){return this[ai]||this.parentNode||this[Hr]}get[Zn](){return this}get[Ju](){var t;return(t=this[Zt])==null?void 0:t[Zn]}get[Zu](){return this[hi]||(this[hi]=new Proxy(this,hc))}[ti](){return this}[Dr](t){return Sr(this,t)}[tc](t,e){return this[Dr](t)[Dr](e)}[ei](t,e){return t[ht](this,e)}[te](t){return t[ht](this,null)}[Vr](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[Vr](t,this)}[ii](t,e){return e[Vr](t,this[St]||this)}get[zr](){let t;return this[Re]||(this[Re]=(t=globalThis.document.createComment("placeholder"),t[ui]=this,t))}set[zr](t){let e=this[Re];this[Re]=t,t[ui]=this,e&&e!=t&&e.parentNode&&e[Ct](t)}[ec](){let t=this[St],e=t&&t.parentNode;return t&&e&&t!=this&&(this[St]=null,this[ht](e,t),t[ee](e)),this}[rc](){this[ci]!=!0&&(this[ci]=!0,!0)&&(this[Ct]=this[ii],this[ee]=this[ni],this[ht]=this[si],this[Hr]||(this[Hr]=this[Zt]));let t=this[zr];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&&Ar(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?Ar(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,cc,"Node",1,Node);var Tp=bi,dc=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}[sc](){return this}[nc](){return this}[ic](){this[je]&&(this[je]=null)}get[oc](){return this[je]||(this[je]={})}get flags(){return this.$flags||(this.$flags=new Yn(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,dc,"Element",1,Element);var $p=Si;Element.prototype.setns$=Element.prototype.setAttributeNS,Element.prototype[di]=!0;function _h(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 fc=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,fc,"SVGElement",1,SVGElement);var Np=wi,mc=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,mc,"SVGSVGElement",1,SVGSVGElement);var Cp=xi;function Th(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 Tr(s){return globalThis.document.createTextNode(s)}function Eh(){return globalThis.document.createDocumentFragment()}var Ae=globalThis.navigator,pc=Ae&&Ae.vendor||"",_i=Ae&&Ae.userAgent||"",gc=pc.indexOf("Apple")>-1||_i.indexOf("CriOS")>=0||_i.indexOf("FxiOS")>=0,De=!gc,Ti=new Map,vc=Symbol(),Ei=class extends HTMLElement{connectedCallback(){return De?this.parentNode.removeChild(this):this.parentNode.connectedCallback()}disconnectedCallback(){if(!De)return this.parentNode.disconnectedCallback()}};f(Ei,vc,"CustomHook",0);var yc=Ei;window.customElements.define("i-hook",yc);function bc(s,t){let e=Ti.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=Qu(n),l=o.length;i<l;i++){let a=o[i],h=Object.getOwnPropertyDescriptors(a);Object.assign(e,h)}Ti.set(t,e)}return e}function pn(s,t,e,r,n){let i;typeof s!="string"&&s&&s.nodeName&&(s=s.nodeName);let o=qr[s]||s;if(Kr[s]){let l=Kr[s],a=l.prototype[Pt];if(a&&De)i=globalThis.document.createElement(a,{is:o});else if(l.create$&&a){i=globalThis.document.createElement(a),i.setAttribute("is",o);let h=bc(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(qr[s]||s);return i[ai]=t,i[li](),i[ti](),r!==null&&i[lc]("__").text$(r),(e||i.flags$ns)&&i.flag$(e||""),i}function $h(s,t,e,r){return s==null||s==null?$t(""):Ar(s,Node)||s[di]?s:pn(s,t,e,r)}function gn(s,t){if(_e[s])return _e[s];if(window[t])return window[t];if(window[s])return window[s]}function kh(s,t,e){var r;let n=gn(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 Nh(s,t,e={}){_e[s]=mn[s]=t,t.nodeName=s;let r=s,n=t.prototype;if(s.indexOf("-")==-1&&(r=""+s+"-tag",qr[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[ac]=e.cssid,n.flags$ns=i.trim()+" "}return n[Pt]&&!e.extends&&(e.extends=n[Pt]),e.extends?(n[Pt]=e.extends,Kr[s]=t,De&&window.customElements.define(r,t,{extends:e.extends})):window.customElements.define(r,t),t}var Sc=globalThis.imba||(globalThis.imba={});Sc.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 Br(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Ve=Symbol.for("#parent"),$i=Symbol.for("#closestNode"),wc=Symbol.for("#isRichElement"),xc=Symbol.for("#afterVisit"),_c=Symbol.for("#getRenderContext"),ki=Symbol.for("#appendChild"),Ni=Symbol.for("#removeChild"),Oi=Symbol.for("#replaceChild"),ut=Symbol.for("#insertInto"),ze=Symbol.for("#replaceWith"),Ci=Symbol.for("#insertChild"),He=Symbol.for("#removeFrom"),Pi=Symbol.for("#placeChild"),Tc=Symbol.for("#registerFunctionalSlot"),Ec=Symbol.for("#getFunctionalSlot"),Li=Symbol.for("#getSlot"),Ur=Symbol.for("##parent"),wt=Symbol.for("##up"),Ii=Symbol.for("##flags"),$c=Symbol.for("#domFlags"),q=Symbol.for("#end"),Mi=Symbol.for("#textContent"),Ke=Symbol.for("#textNode"),Gr=Symbol.for("#functionalSlots");function Oh(){return!0}var kc=Symbol(),Fi=class{constructor(){this.childNodes=[]}log(...t){}hasChildNodes(){return!1}set[Ve](t){this[Ur]=t}get[Ve](){return this[Ur]||this[wt]}get[$i](){return this[Ve][$i]}get[wc](){return!0}get flags(){return this[Ii]||(this[Ii]=new Yn(this))}flagSync$(){return this}[xc](){return this}[_c](t){return Sr(this,t)}};f(Fi,kc,"Fragment",16);var Wt=Fi,Nc=0,Oc=Symbol(),Ri=class extends Wt{constructor(t,e){super(...arguments),this[wt]=e,this.parentNode=null,this[$c]=t,this.childNodes=[],this[q]=$t("slot"+Nc++),e&&e[ki](this)}get[Ve](){return this[Ur]||this.parentNode||this[wt]}set textContent(t){this[Mi]=t}get textContent(){return this[Mi]}hasChildNodes(){for(let t=0,e=Br(this.childNodes),r=e.length;t<r;t++){let n=e[t];if(re(n,Wt)&&n.hasChildNodes()||!re(n,_r)&&re(n,xr))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=Br(this.childNodes),o=i.length;n<o;n++)i[n][ut](t,e)}return this}[ze](t,e){let r=t[ut](e,this[q]);return this[He](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}[He](t){for(let e=0,r=Br(this.childNodes),n=r.length;e<n;e++)r[e][He](t);return this[q]&&this[q][He](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,_r))return r;let o=$t("");if(r){let l=this.childNodes.indexOf(r);return this.childNodes.splice(l,1,o),n&&r[ze](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,ln))return r.textContent=l,r;{o=Tr(l);let a=this.childNodes.indexOf(r);return this.childNodes.splice(a,1,o),n&&r[ze](o,n),o}}else return this.childNodes.push(o=Tr(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[ze](t,n),t}else return this.childNodes.push(t),n&&t[ut](n,this[q]),t}};f(Ri,Oc,"VirtualFragment",16);var ji=Ri;function Ch(s,t){return new ji(s,t)}function Ee(s,t){let e=new ji(s,null);return e[wt]=t,e}var Cc=Symbol(),Ai=class{[Tc](t){let e=this[Gr]||(this[Gr]={});return e[t]||(e[t]=Ee(0,this))}[Ec](t,e){let r=this[Gr];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]=Ee(0,this))}};f(Ai,Cc,"Node",1,xr);var Fp=Ai;function Pc(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Lc=Symbol.for("#afterVisit"),qe=Symbol.for("#insertInto"),Di=Symbol.for("#appendChild"),Ic=Symbol.for("#replaceWith"),Wr=Symbol.for("#removeFrom"),Mc=Symbol.for("#domFlags"),Fc=Symbol.for("##parent"),ft=Symbol.for("#end"),Rc=Symbol.for("#removeChild"),jc=Symbol.for("#insertChild"),Ac=Symbol(),Vi=class extends Wt{constructor(t,e){super(...arguments),this[Mc]=t,this[Fc]=e,t&256||(this[ft]=$t("list")),this.$=this.childNodes,this.length=0,e&&e[Di](this)}hasChildNodes(){return this.length!=0}[Lc](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[Rc](n[--e]);else if(t>e)for(;t>e;)r[jc](n[e++],i);this.length=t}[qe](t,e){this.parentNode=t,this[ft]&&this[ft][qe](t,e),e=this[ft];for(let r=0,n=Pc(this.childNodes),i=n.length;r<i;r++){let o=n[r];if(r==this.length)break;o[qe](t,e)}return this}[Di](t){}[Ic](t,e){let r=t[qe](e,this[ft]);return this[Wr](e),r}[Wr](t){let e=this.length;for(;e>0;)this.childNodes[--e][Wr](t);this[ft]&&t.removeChild(this[ft]),this.parentNode=null}};f(Vi,Ac,"IndexedTagFragment",16);var Dc=Vi;function Ph(s,t){return new Dc(s,t)}function zi(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Yr=Symbol.for("#appendChild"),Be=Symbol.for("#insertChild"),Vc=Symbol.for("#replaceWith"),Ue=Symbol.for("#insertInto"),Xr=Symbol.for("#removeFrom"),zc=Symbol.for("#afterVisit"),Ge=Symbol.for("#domFlags"),Hi=Symbol.for("##parent"),mt=Symbol.for("#end"),Ki=Symbol.for("#removeChild"),Hc=Symbol(),qi=class extends Wt{constructor(t,e){super(...arguments),this[Ge]=t,this[Hi]=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[Yr](this)}[Yr](t){if(this.parentNode)return this.parentNode[Be](t,this[mt])}hasChildNodes(){return this.childNodes.length!=0}push(t,e){if(!(this[Ge]&1)){this.array.push(t),this[Yr](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[Be](t,i.nextSibling)}else n[Be](t,this.childNodes[e+1]||this[mt])}moveChild(t,e,r){return this.insertChild(t,e,r)}removeChild(t,e){t.parentNode&&t[Xr](t.parentNode)}[Be](t,e){}[Vc](t,e){let r=t[Ue](e,this[mt]);return this[Xr](e),r}[Ue](t,e){this[Hi]=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}[Xr](t){for(let e=0,r=zi(this.array),n=r.length;e<n;e++){let i=r[e];t[Ki](i)}return this[mt]&&t[Ki](this[mt]),this.parentNode=null}[zc](t){var e=this;if(!(this[Ge]&1)){this[Ge]|=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,Hc,"KeyedTagFragment",16);var Kc=qi;function Lh(s,t){return new Kc(s,t)}function Bi(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function qc(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var We=Symbol.for("#__init__"),Bc=Symbol.for("##inited"),Uc=Symbol.for("#afterVisit"),Gc=Symbol.for("#insertInto"),Wc=Symbol.for("#insertIntoDeopt"),Yc=Symbol.for("#beforeReconcile"),Xc=Symbol.for("#afterReconcile"),Ui=Symbol.for("#__hooks__"),Lt=Symbol.for("#autorender"),Ye=Symbol.for("##visitContext"),Gi=Symbol.for("#domNode"),Qc=Symbol(),Qr,Er=new(Qr=class{constructor(s=null){this[We](s)}[We](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(c,v){return t.tests++,c.compareDocumentPosition(v)};(l==-1||n.nodeName!=s.nodeName)&&(a=l=0);let d=this.items[a];for(;d&&h(d,s)&o;)d=this.items[++a];if(a!=l)d?this.items.splice(a,0,s):this.items.push(s);else{for(;d&&h(d,s)&i;)d=this.items[--a];a!=l&&(d?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(Qr,Qc,null,16),Qr);function Ih(){return Er.flush()}var Jc=Symbol(),Wi=class extends HTMLElement{constructor(){super(),this.flags$ns&&(this.flag$=this.flagExt$),this.setup$(),this.build()}setup$(){return this.__slots={},this.__F=0}[We](){return this.__F|=3,this}[Bc](){if(this[Ui])return this[Ui].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,Bi(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}[Gc](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}[Wc](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}[Xc](){return globalThis.DEBUG_IMBA&&G.pop(this),this}connectedMoveCallback(){this.remount()}connectedCallback(){let t=this.__F,e=t&1,r=t&8;if(t&16384){this.__F=t&-16385,this.remount();return}if(!e&&!(t&1024)){Er.queue(this);return}if(t&48)return;this.__F|=16,e||this[We](),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&&Bi(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&16384)){if(G.moving.size){for(let e of qc(G.moving))if((t=e?.contains)!=null&&t.call(e,this)){this.__F|=16384;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(Wi,Jc,"Component",16);var $e=Wi,Mh=$e;function Zc(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var Yi=Symbol.for("#__init__"),td={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},Jr={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]]},ed=new RegExp("^("+Object.keys(Jr).join("|")+")(\\d+(?:\\.\\d+)?)$"),rd=/^([xyz])$/,sd=/^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/,nd=`*,::before,::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: currentColor;
}`,id=Symbol(),Qi=class{constructor(t=null){this[Yi](t)}[Yi](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",nd),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||(rd.test(r)?e="px":sd.test(r)?e="u":r=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return td[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(ed)){let l=Jr[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&&Zc(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,id,"Styles",16);var od=Qi,vn=new od,Fh=Object.keys(Jr);function Rh(){return globalThis.imba.uses_styles=!0,!0}var ld=Symbol(),Ji=class{css$(t,e,r){return this.style[t]=e}css$var(t,e,r,n,i=null){let o=vn.toValue(e,r,n,i);this.style.setProperty(t,o)}};f(Ji,ld,"Element",1,F);var zp=Ji;function ad(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 jh(s,t={}){let e=C.context;C.context=t;let r=s(t);return C.context==t&&(C.context=e),r}function yn(s,t,e={}){let r=t||globalThis.document.body,n=s;if(ad(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 bn(s){return s&&s[to]&&s.parentNode&&s[to](s.parentNode),s}var eo=globalThis.imba||(globalThis.imba={});eo.mount=yn,eo.unmount=bn;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"),Xe=Symbol.for("##onclick"),le=Symbol.for("##bound"),pt=Symbol.for("##visitContext");function Ah(){return globalThis.imba.uses_dom_bind=!0,!0}var hd={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},Zr=function(s){return Q(s,Array)||s&&Q(s.has,Function)},ts=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},es=function(s,t){if(Q(s,Array))return s.push(t);if(s&&Q(s.add,Function))return s.add(t)},rs=function(s,t){if(Q(s,Array)){let e=s.indexOf(t);if(e>=0)return s.splice(e,1)}else if(s&&Q(s.delete,Function))return s.delete(t)};function ud(s){function t(){return s[0]?s[0][s[1]]:void 0}function e(r){return s[0]?s[0][s[1]]=r:null}return{get:t,set:e}}var cd=Symbol(),ro=class{getRichValue(){return this.value}setRichValue(t){return this.value=t}bind$(t,e){let r=e||[];return t=="data"&&!this[le]&&hd[this.nodeName]&&(this[le]=!0,this[ne]&&this.addEventListener("change",this[ne]=this[ne].bind(this)),this[oe]&&this.addEventListener("input",this[oe]=this[oe].bind(this),{capture:!0}),this[Xe]&&this.addEventListener("click",this[Xe]=this[Xe].bind(this),{capture:!0})),Object.defineProperty(this,t,Q(r,Array)?ud(r):r),r}};f(ro,cd,"Element",1,F);var Kp=ro;Object.defineProperty(F.prototype,"richValue",{get:function(){return this.getRichValue()},set:function(s){return this.setRichValue(s)}});var dd=Symbol(),so=class{[ne](t){let e=this.data,r=this.$$value;this.$$value=void 0;let n=this.getRichValue();if(this.multiple){if(r)for(let i=0,o=se(r),l=o.length;i<l;i++){let a=o[i];n.indexOf(a)==-1&&rs(e,a)}for(let i=0,o=se(n),l=o.length;i<l;i++){let a=o[i];(!r||r.indexOf(a)==-1)&&es(e,a)}}else this.data=n[0];return L(),this}getRichValue(){var t;if(this.$$value)return this.$$value;t=[];for(let e=0,r=se(this.selectedOptions),n=r.length;e<n;e++){let i=r[e];t.push(i.richValue)}return this.$$value=t}syncValue(){let t=this.data;if(this.multiple){let e=[];for(let r=0,n=se(this.options||[]),i=n.length;r<i;r++){let o=n[r],l=o.richValue,a=ts(t,l);o.selected=a,a&&e.push(l)}this.$$value=e}else for(let e=0,r=se(this.options||[]),n=r.length;e<n;e++){let i=r[e].richValue;if(i==t){this.$$value=[i],this.selectedIndex=e;break}}}[ie](){if(this.syncValue(),this[pt])return this[pt]=null}};f(so,dd,"HTMLSelectElement",1,an);var Bp=so,fd=Symbol(),no=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}};f(no,fd,"HTMLOptionElement",1,dn);var Gp=no,md=Symbol(),io=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[oe](t){return this.data=this.value,L()}[ie](){let t=this.data;if(t==null&&(t=""),this[le]&&this.value!=t&&(this.value=t),this[pt])return this[pt]=null}};f(io,md,"HTMLTextAreaElement",1,un);var Yp=io,pd=Symbol(),oo=class{[oe](t){let e=this.type;if(!(e=="checkbox"||e=="radio")&&!(e=="number"&&Number.isNaN(this.valueAsNumber)))return this.$$value=void 0,this.data=this.richValue,L()}[ne](t){let e=this.data,r=this.richValue;if(this.type=="checkbox"||this.type=="radio"){let n=this.checked;Zr(e)?n?es(e,r):rs(e,r):this.data=n?r:!1}return L()}setRichValue(t){this.$$value!==t&&(this.$$value=t,this.value!==t&&(this.value=t))}getRichValue(){if(this.$$value!==void 0)return this.$$value;let t=this.value,e=this.type;if(e=="range"||e=="number"){let r=this.valueAsNumber;Number.isNaN(r)&&(r=Number(t.replace(/\,/,".")+0)),Number.isNaN(r)&&(r=null),t=r}else e=="checkbox"&&(t==null||t==="on")&&(t=!0);return t}[ie](){if(this[le]){let t=this.type;if(t=="checkbox"||t=="radio"){let e=this.data;e===!0||e===!1||e==null?this.checked=!!e:this.checked=ts(e,this.richValue)}else this.richValue=this.data}this[pt]&&(this[pt]=null)}};f(oo,pd,"HTMLInputElement",1,hn);var Qp=oo,gd=Symbol(),lo=class{get checked(){return this.$checked}set checked(t){t!=this.$checked&&(this.$checked=t,this.flags.toggle("checked",!!t))}setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[Xe](t){let e=this.data,r=this.checked,n=this.richValue;return Zr(e)?r?rs(e,n):es(e,n):this.$$value==null?this.data=!r:this.data=r?null:n,this[ie](),L()}[ie](){if(this[le]){let t=this.data,e=this.$$value==null?!0:this.$$value;Zr(t)?this.checked=ts(t,e):this.checked=t==e}this[pt]&&(this[pt]=null)}};f(lo,gd,"HTMLButtonElement",1,cn);var Zp=lo;function vd(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function ao(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var yd=Symbol.for("#getSlot"),bd=Symbol.for("#container"),Sd=Symbol.for("#afterVisit"),ae=Symbol.for("#__init__"),Qe=Symbol.for("#listeners"),J=Symbol.for("#slot"),wd=Symbol.for("#parent"),z=Symbol.for("##container"),ss=Symbol.for("#domTarget"),ho=Symbol.for("#insertInto"),xd=Symbol.for("#removeFrom"),_d=Symbol.for("#teleport"),Td=Symbol.for("#self"),Ed=Symbol.for("#target"),$d=Symbol(),uo=class extends $e{constructor(){super(...arguments),super[ae]||this[ae]()}[ae](t=null,e=!0,r=!0){e&&super[ae]&&super[ae](...arguments),this.to=t?t.to:void 0}build(){return this[Qe]=[],this.win=globalThis,this.doc=globalThis.document}setup(){return this.setAttribute("style","display:none !important;")}[yd](t,e){return this[J]||(this[J]=Ee(0,this[wd])),this[J]}get[bd](){if(!this[z]){let t=this.className;this[z]=this.doc.createElement("div"),this[z].className=t,this[z].style.cssText="display:contents !important;"}return this[z]}get domTarget(){return this[ss]||(this[ss]=vd(this.to,F)?this.to:this.closest(this.to)||this.doc.querySelector(this.to))}get eventTarget(){return this.domTarget}get style(){return this[z]?this[z].style:super.style}get classList(){return this[z]?this[z].classList:super.classList}get className(){return this[z]?this[z].className:super.className}set className(t){this[z]?this[z].className=t:super.className=t}[Sd](){if(this.mounted\u03A6&&this[J]&&!this[J].parentNode)return this[J][ho](this.target)}mount(){for(let e=0,r=ao(this[Qe]),n=r.length;e<n;e++){let[i,o,l]=r[e];this.eventTarget.addEventListener(i,o,l)}let t=this.domTarget;return this[J]&&this[J][ho](t),this}unmount(){for(let t=0,e=ao(this[Qe]),r=e.length;t<r;t++){let[n,i,o]=e[t];this.eventTarget.removeEventListener(n,i,o)}return this[J]&&this[J][xd](this.domTarget),this[ss]=null,this}addEventListener(t,e,r={}){var n;if(e[_d]=this,e[Td]=this,this[Qe].push([t,e,r]),this.mounted\u03A6&&(n=this.eventTarget)!=null&&n.addEventListener)return this.eventTarget.addEventListener(t,e,r)}};f(uo,$d,"TeleportHook",24);var co=uo,kd=Symbol(),fo=class extends co{get domTarget(){return this.doc.body}get eventTarget(){return this.win}addEventListener(t,e,r={}){return e[Ed]=this.domTarget.parentNode,super.addEventListener(...arguments)}on$resize(t,e,r,n){return this.addEventListener("resize",r,n),r}};f(fo,kd,"GlobalHook",8);var Nd=fo;globalThis.customElements&&(globalThis.customElements.define("i-teleport",co),globalThis.customElements.define("i-global",Nd));function Dh(){return globalThis.imba.uses_dom_teleport=!0,!0}function Y(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}function Od(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var Z=Symbol.for("#__init__"),Je=Symbol.for("#insertInto"),Ze=Symbol.for("#removeFrom"),Cd=Symbol.for("#all"),he=Symbol.for("#phase"),tt=Symbol.for("#nodes"),Pd=Symbol.for("#sizes"),It=Symbol.for("#linked"),mo=Symbol.for("#mode"),po=Symbol.for("#enabled"),Ld=Symbol.for("#easer"),Mt=Symbol.for("#group"),ns=Symbol.for("#_easer_"),is=Symbol(),Id=Symbol(),go=class extends xe{constructor(){super(...arguments),super[Z]||this[Z]()}[Z](t=null,e=!0,r=!0){var n;e&&super[Z]&&super[Z](...arguments),this.selectors=t&&(n=t.selectors)!==void 0?n:{}}addSelectors(t,e){var r;return((r=this.selectors)[e]||(r[e]=[])).push(...t),!0}getSelectors(...t){let e=[];for(let r=0,n=Y(t),i=n.length;r<i;r++){let o=n[r];this.selectors[o]&&e.push(...this.selectors[o])}return e&&e.length?e.join(","):null}nodesForBase(t,e="transition"){let r=[t],n=(this.selectors[e]||[]).join(",");if(n=="")return r;let i=t.querySelectorAll(n);for(let o=0,l=Y(i),a=l.length;o<a;o++){let h=l[o];h.closest("._ease_")==t&&r.push(h)}return r[Cd]=i,r}nodesWithSize(t,e="in"){let r=this.getSelectors("_off_sized","_"+e+"_sized");return r?t.filter(function(n){return n.matches(r)}):[]}};f(go,Id,"Transitions",16);var Md=go,ke=new Md,Fd=globalThis.imba||(globalThis.imba={});Fd.transitions=ke;var Rd=Symbol(),vo=class extends xe{[Z](t=null,e=!0,r=!0){var n;e&&super[Z]&&super[Z](...arguments),this.flushing\u03A6=t&&(n=t.flushing\u03A6)!==void 0?n:!1,this.mutations=t&&(n=t.mutations)!==void 0?n:[]}constructor(t){super(),super[Z]||this[Z](),this.callback=t}insert(t,e,r){return this.mutations.push({target:t,addedNodes:[e],removedNodes:[],nextSibling:r})}remove(t,e){return this.mutations.push({target:t,addedNodes:[],removedNodes:[e]})}flush(){let t=this.mutations.slice(0);if(!t.length)return this;this.mutations=[],Od(this.callback,Function)&&this.callback(t),this.emit("start",this,t),this.flushing\u03A6=!0;for(let e of Y(t)){for(let r of Y(e.addedNodes))r[Je](e.target,e.nextSibling);for(let r of Y(e.removedNodes))r[Ze](e.target)}return this.flushing\u03A6=!1,this.emit("end",this,t)}};f(vo,Rd,"EaseGroup",16);var Vh=vo,jd=Symbol(),yo=class extends xe{constructor(t){super(),this.dom=t,this[he]=null,this[tt]=[],this[Pd]=new Map}log(...t){}get flags(){return this.dom.flags}link(t){return this[It]||(this[It]=new Set),this[It].add(t)}unlink(t){return this[It].delete(t)}flag(t){for(let e=0,r=Y(this[tt]),n=r.length;e<n;e++)r[e].flags.add(t);return this}unflag(t){for(let e=0,r=Y(this[tt]),n=r.length;e<n;e++)r[e].flags.remove(t);return this}commit(){return this.dom.offsetWidth}enable(t){return t&&(this[mo]=t),this[po]!=!0&&(this[po]=!0,!0)?(this.dom[Je]=this[Je].bind(this),this.dom[Ze]=this[Ze].bind(this),this.flags.add("_ease_")):this}disable(){return this.flags.remove("_ease_"),!0}supports\u039Esize\u039Ekeywords(){var t,e=Us(this);return(t=e[is])!=null||(e[is]={support:CSS.supports("interpolate-size","allow-keywords")&&globalThis.window.getComputedStyle(globalThis.document.body)["interpolate-size"]=="allow-keywords"}),e[is].support}set phase(t){var e,r,n,i,o,l,a,h,d,c,v,T,u,m,p,g,S,w,y,b,_,O,K,at;let X=this[he];this[he]!=t&&(this[he]=t,!0)&&(X&&this.unflag("@"+X),t&&this.flag("@"+t),t?this.flags.add("_easing_"):this.flags.remove("_easing_"),t||(this.unflag("@out"),this.unflag("@in"),this.unflag("@off"),this[tt]=null),t=="enter"&&X=="leave"&&((r=(e=this.dom)==null?void 0:e.emit)==null||r.call(e,"outcancel"),(i=(n=this.dom)==null?void 0:n.transition\u039Eout\u039Ecancel)==null||i.call(n,this)),t=="leave"&&X=="enter"&&((l=(o=this.dom)==null?void 0:o.emit)==null||l.call(o,"incancel"),(h=(a=this.dom)==null?void 0:a.transition\u039Ein\u039Ecancel)==null||h.call(a,this)),t=="enter"&&((c=(d=this.dom)==null?void 0:d.emit)==null||c.call(d,"in"),(T=(v=this.dom)==null?void 0:v.transition\u039Ein)==null||T.call(v,this)),t=="leave"&&((m=(u=this.dom)==null?void 0:u.emit)==null||m.call(u,"out"),(g=(p=this.dom)==null?void 0:p.transition\u039Eout)==null||g.call(p,this)),X=="leave"&&!t&&((w=(S=this.dom)==null?void 0:S.emit)==null||w.call(S,"outend"),(b=(y=this.dom)==null?void 0:y.transition\u039Eout\u039Eend)==null||b.call(y,this)),X=="enter"&&!t&&((O=(_=this.dom)==null?void 0:_.emit)==null||O.call(_,"inend"),(at=(K=this.dom)==null?void 0:K.transition\u039Ein\u039Eend)==null||at.call(K,this)))}get phase(){return this[he]}get leaving\u03A6(){return this.phase=="leave"}get entering\u03A6(){return this.phase=="enter"}get idle\u03A6(){return this.phase==null}track(t){var e=this;let r={before:Te().getAnimations()};return this.commit(),t(),this.commit(),r.after=Te().getAnimations(),r.fresh=r.after.filter(function(n){return r.before.indexOf(n)==-1}),r.deep=r.fresh.filter(function(n){let i;return!!((i=n.effect.target)&&i.closest("._ease_")!=e.dom)}),r.own=r.fresh.filter(function(n){return r.deep.indexOf(n)==-1}),r.own.length?r.finished=new Promise(function(n){let i=new Set(r.own),o=function(){if(i.delete(this),i.size==0)return n()};for(let l=0,a=Y(r.own),h=a.length;l<h;l++){let d=a[l];d[Ld]=e,d.addEventListener("finish",o,{once:!0}),d.addEventListener("cancel",o,{once:!0})}}):r.finished=Promise.resolve(!0),r}getAnimatedNodes(){let t=ke.nodesForBase(this.dom);return this[It]&&(t=t.concat(Array.from(this[It]))),t}getNodeSizes(t="in",e=this[tt]){let r=ke.nodesWithSize(e,t),n=new Map;for(let i=0,o=Y(r),l=o.length;i<l;i++){let a=o[i],h=window.getComputedStyle(a);n.set(a,{width:h.width,height:h.height})}return n}applyNodeSizes(t){for(let[e,r]of Y(t))e.style.width=r.width,e.style.height=r.height;return t}clearNodeSizes(t){if(t){for(let[e,r]of Y(t))e.style.removeProperty("width"),e.style.removeProperty("height");return t}}[Je](t,e){var r,n,i=this;if(this[Mt]&&!this[Mt].flushing\u03A6)return this[Mt].insert(t,this.dom,e),this.dom;let o;if(this.entering\u03A6)return this.dom;let l=function(){if(o&&i.clearNodeSizes(o),i.entering\u03A6)return i.phase=null};if(this.leaving\u03A6)return this.track(function(){return i.phase="enter",i.unflag("@off"),i.unflag("@out")}).finished.then(l,function(h){return i.log("error cancel leave",h)}),this.dom;let a=Te().contains(t);return e?this.dom.nextSibling!=e&&t.insertBefore(this.dom,e):this.dom.parentNode!=t&&t.appendChild(this.dom),this[tt]=this.getAnimatedNodes(),this.flag("_instant_"),this.unflag("@out"),this.commit(),this.supports\u039Esize\u039Ekeywords()||(o=this[tt].sized=this.getNodeSizes("in")),(n=(r=this.dom)==null?void 0:r.transition\u039Ein\u039Einit)==null||n.call(r,this),this.flag("@off"),this.flag("@in"),this.flag("@enter"),this.commit(),this.unflag("_instant_"),this.track(function(){return i.phase="enter",o&&i.applyNodeSizes(o),i.unflag("@off"),i.unflag("@in")}).finished.then(l,function(h){return o&&i.clearNodeSizes(o),i.log("cancelled insert into",h)}),this.dom}[Ze](t){var e=this;if(this[Mt]&&!this[Mt].flushing\u03A6){this[Mt].remove(t,this.dom);return}if(this.leaving\u03A6)return;let r,n=function(){if(e.phase=="leave")return e.dom.emit("easeoutend",{}),t.removeChild(e.dom),e.phase=null};if(this.entering\u03A6&&this[mo]!="forward"){let o=this.track(function(){if(e.flag("@off"),e.flag("@in"),e.unflag("@out"),e.phase="leave",e[tt].sized)return e.clearNodeSizes(e[tt].sized)});this.log("cancel enter anims own",o.own,o),o.finished.then(n,function(l){return e.log("error cancel entering",l)});return}this[tt]=this.getAnimatedNodes(),this.supports\u039Esize\u039Ekeywords()||(r=this.getNodeSizes("out"),this.applyNodeSizes(r)),this.flag("@leave");let i=this.track(function(){if(e.phase="leave",e.flag("@off"),e.flag("@out"),r)return e.clearNodeSizes(r)});if(!i.own.length){n();return}i.finished.then(n,function(){return!0})}};f(yo,jd,"Easer",16);var Sn=yo,Ad=Symbol(),bo=class{transition\u039Ein\u039Einit(t){return!0}transition\u039Ein(t){return!0}transition\u039Ein\u039Eend(t){return!0}transition\u039Ein\u039Ecancel(t){return!0}transition\u039Eout(t){return!0}transition\u039Eout\u039Eend(t){return!0}transition\u039Eout\u039Ecancel(t){return!0}get ease(){return this[ns]||(this[ns]=new Sn(this))}set ease(t){var e,r;if(t==!1){(r=(e=this[ns])==null?void 0:e.disable)==null||r.call(e);return}this.ease.enable(t)}};f(bo,Ad,"Element",1,Element);var og=bo;function zh(){return globalThis.imba.uses_dom_transitions=!0,!0}function wn(){return globalThis.imba.uses_events_keyboard=!0,!0}var Dd=Symbol(),So=class{\u03B1esc(){return this.keyCode==27}\u03B1tab(){return this.keyCode==9}\u03B1enter(){return this.keyCode==13}\u03B1space(){return this.keyCode==32}\u03B1up(){return this.keyCode==38}\u03B1down(){return this.keyCode==40}\u03B1left(){return this.keyCode==37}\u03B1right(){return this.keyCode==39}\u03B1del(){return this.keyCode==8||this.keyCode==46}\u03B1key(t){if(typeof t=="string")return this.key==t;if(typeof t=="number")return this.keyCode==t}\u03B1shift(){return!!this.shiftKey}\u03B1alt(){return!!this.altKey}\u03B1ctrl(){return!!this.ctrlKey}\u03B1meta(){return!!this.metaKey}\u03B1mod(){let t=globalThis.navigator.platform;return/^(Mac|iPhone|iPad|iPod)/.test(t||"")?!!this.metaKey:!!this.ctrlKey}};f(So,Dd,"KeyboardEvent",1,on);var ag=So;function $r(){return globalThis.imba.uses_events_mouse=!0,!0}var Vd=Symbol(),wo=class{\u03B1left(){return this.button==0}\u03B1middle(){return this.button==1}\u03B1right(){return this.button==2}\u03B1shift(){return!!this.shiftKey}\u03B1alt(){return!!this.altKey}\u03B1ctrl(){return!!this.ctrlKey}\u03B1meta(){return!!this.metaKey}\u03B1mod(){let t=globalThis.navigator.platform;return/^(Mac|iPhone|iPad|iPod)/.test(t||"")?!!this.metaKey:!!this.ctrlKey}};f(wo,Vd,"MouseEvent",1,sn);var ug=wo;function et(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function os(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var zd=Symbol.for("#extendType"),Hd=Symbol.for("#modifierState"),tr=Symbol.for("#sharedModifierState"),xo=Symbol.for("#onceHandlerEnd"),_o=Symbol.for("#extendDescriptors"),I=Symbol.for("#context"),er=Symbol.for("#defaultPrevented"),ls=Symbol.for("#stopPropagation"),To=Symbol.for("#self"),Kd=Symbol.for("#target"),qd=Symbol.for("#teleport");wn(),$r();var Bd=Symbol(),Eo=class{[zd](t){var e,r;let n=t[_o]||(t[_o]=(e=Object.getOwnPropertyDescriptors(t.prototype),r=e.constructor,delete e.constructor,e));return Object.defineProperties(this,n)}};f(Eo,Bd,"CustomEvent",1,CustomEvent);var dg=Eo,Ud=Symbol(),$o=class{get original(){return this.originalEvent||this}get[Hd](){var t,e;return(t=this[I])[e=this[I].step]||(t[e]={})}get[tr](){var t,e;return(t=this[I].handler)[e=this[I].step]||(t[e]={})}[xo](t){return V(this[I],"end",t)}\u03B1sel(t){return!!this.target.matches(String(t))}\u03B1closest(t){return!!this.target.closest(String(t))}\u03B1prevent(){return this[er]=!0,this.preventDefault(),!0}\u03B1trap(){return this[ls]=!0,this.stopImmediatePropagation(),this[er]=!0,this.preventDefault(),!0}\u03B1focin(t){var e;let r=this[I].element;return r=et(t,Element)?t:t?r.closest(t):r,(e=r?.contains)==null?void 0:e.call(r,globalThis.document.activeElement)}\u03B1log(...t){return console.info(...t),!0}\u03B1trusted(){return!!this.isTrusted}\u03B1untrusted(){return!this.isTrusted}\u03B1if(t){return!!t}\u03B1wait(t=250){return new Promise(function(e){return setTimeout(e,Bt(t))})}\u03B1self(){return this.target==this[I].element}\u03B1cooldown(t=250){let e=this[tr];return e.active?!1:(e.active=!0,e.target=this[I].element,e.target.flags.incr("cooldown"),this[xo](function(){return setTimeout(function(){return e.target.flags.decr("cooldown"),e.active=!1},Bt(t))}),!0)}\u03B1throttle(t=250,e="throttled"){let r=this[tr];return r.active?(r.next&&r.next(!1),new Promise(function(n){return r.next=function(i){return r.next=null,n(i)}})):(r.active=!0,r.el||(r.el=this[I].element),e&&r.el.flags.incr(e),V(this[I],"end",function(){let n=Bt(t);return r.interval=setInterval(function(){r.next?r.next(!0):(clearInterval(r.interval),e&&r.el.flags.decr(e),r.active=!1)},n)}),!0)}\u03B1debounce(t=250){let e=this[tr],r=this;return e.queue||(e.queue=[]),e.queue.push(e.last=r),new Promise(function(n){return setTimeout(function(){return e.last==r?(r.debounced=e.queue,e.last=null,e.queue=[],n(!0)):n(!1)},Bt(t))})}\u03B1flag(t,e){let{element:r,step:n,state:i,id:o,current:l}=this[I],a=et(e,Element)?e:e?r.closest(e):r;if(!a)return!0;this[I].commit=!0,i[n]=o,a.flags.incr(t);let h=Date.now();return V(l,"end",function(){let d=Date.now()-h,c=Math.max(250-d,0);return setTimeout(function(){return a.flags.decr(t)},c)}),!0}\u03B1busy(t){return this.\u03B1flag("busy",t)}\u03B1outside(){let{handler:t}=this[I];if(t&&t[To])return!t[To].parentNode.contains(this.target)}async \u03B1post(t,e={}){return await globalThis.fetch(t,{method:"POST",...e})}async \u03B1fetch(t,e={}){return await globalThis.fetch(t,e)}};f($o,Ud,"Event",1,Event);var mg=$o,Gd=Symbol(),ko=class{\u03B1self(){let t=this[I].element;return this.type=="focusout"?this.relatedTarget&&!t.contains(this.relatedTarget):this.type=="focusin"?!this.relatedTarget||!t.contains(this.relatedTarget):this.target==t}};f(ko,Gd,"FocusEvent",1,FocusEvent);var gg=ko,Hh={};function Kh(){return globalThis.imba.uses_events=!0,!0}var Wd=Symbol(),No=class{constructor(t,e){this.params=t,this.closure=e}getHandlerForMethod(t,e){return t?t[e]?t:this.getHandlerForMethod(t.parentNode,e):null}abortCurrentHandlers(){var t;if(this.currentEvents)for(let e of os(this.currentEvents))e.aborted=!0,(t=e?.resolver)==null||t.call(e,!0);return 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 Ut(this,t,...e)}get passive\u03A6(){return this.params.passive}get capture\u03A6(){return this.params.capture}get silent\u03A6(){return this.params.silent}get global\u03A6(){return this.params.global}async handleEvent(t){if(this.disabled)return;let e=this[Kd]||t.currentTarget,r=this.params,n=null,i=r.silence||r.silent;this.count||(this.count=0),this.state||(this.state={});let o=this.lastState={element:e,event:t,modifiers:r,handler:this,id:++this.count,step:-1,state:this.state,commit:null,called:!1,current:null,aborted:!1};if(o.current=o,t.handle$mod&&t.handle$mod.apply(o,r.options||[])==!1)return;let l=Event[this.type+"$handle"]||Event[t.type+"$handle"]||this.guard;if(!(l&&l.apply(o,r.options||[])==!1)){this.currentEvents||(this.currentEvents=new Set),this.currentEvents.add(o);for(let a=0,h=Object.keys(r),d=h.length,c,v;a<d&&(c=h[a],v=r[c],!o.aborted);a++){if(o.step++,c[0]=="_")continue;c.indexOf("~")>0&&(c=c.split("~")[0]);let T=null,u=[t,o],m,p=null,g,S=!1,w=typeof c=="string";if(c[0]=="$"&&c[1]=="_"&&et(v[0],Function))t[I]=o,c=v[0],o.called=!0,c.passive||(o.commit=!0),u=[t,o].concat(v.slice(1)),p=e;else if(et(v,Array)){u=v.slice(),T=u;for(let y=0,b=os(u),_=b.length;y<_;y++){let O=b[y];if(typeof O=="string"&&O[0]=="~"&&O[1]=="$"){let K=O.slice(2).split("."),at=o[K.shift()]||t;for(let X=0,Cn=os(K),_u=Cn.length;X<_u;X++){let Tu=Cn[X];at=at?at[Tu]:void 0}u[y]=at}}}if(typeof c=="string"&&(g=c.match(/^(emit|flag|mod|moved|pin|fit|refit|map|remap|css)-(.+)$/))&&(T||(T=u=[]),u.unshift(g[2]),c=g[1]),c=="trap")t[ls]=!0,t.stopImmediatePropagation(),t[er]=!0,t.preventDefault();else if(c=="stop")t[ls]=!0,t.stopImmediatePropagation();else if(c=="prevent")t[er]=!0,t.preventDefault();else if(c=="commit")o.commit=!0;else if(c=="once")e.removeEventListener(t.type,this);else{if(c=="options"||c=="silence"||c=="silent")continue;if(c=="emit"){let y=u[0],b=u[1];o.called=!0;let _=new CustomEvent(y,{bubbles:!0,detail:b});_.originalEvent=t;let O=(this[qd]||e).dispatchEvent(_)}else if(typeof c=="string"){c[0]=="!"&&(S=!0,c=c.slice(1));let y="\u03B1"+c,b=t[y];b||(b=this.type&&Event[this.type+"$"+c+"$mod"]),b||(b=t[c+"$mod"]||Event[t.type+"$"+c]||Event[c+"$mod"]),et(b,Function)?(c=b,p=o,u=T||[],t[y]&&(p=t,t[I]=o)):c[0]=="_"?(c=c.slice(1),p=this.closure):p=this.getHandlerForMethod(e,c)}}try{et(c,Function)?m=c.apply(p||e,u):p&&(m=p[c].apply(p,u)),m&&et(m.then,Function)&&m!=P.$promise&&(o.commit&&!i&&P.commit(),m=await m)}catch(y){n=y;break}if(S&&m===!0||!S&&m===!1)break;o.value=m}if(lt(o,"end",o),o.commit&&!i&&P.commit(),this.currentEvents.delete(o),this.currentEvents.size==0&&this.emit("idle"),n!=null){if(this.type!="error"){let a=et(n,Error)?n.message:n,h=new CustomEvent("error",{detail:a,bubbles:!0,cancelable:!0});h.error=n,h.originalEvent=t;let d=e.dispatchEvent(h);if(h.defaultPrevented)return}throw n}return o}}};f(No,Wd,"EventHandler",16);var kr=No,Yd=Symbol(),Oo=class{on$(t,e,r){let n="on$"+t,i=e.capture||!1,o=e.passive,l,a=i;return o&&(a={passive:o,capture:i}),et(this[n],Function)?(this[n].length>2&&(l=new kr(e,r)),l=this[n](e,r,l,a)):(l=new kr(e,r),this.addEventListener(t,l,a)),l}on$error(t,e,r,n){var i;return(i=t.options)!=null&&i.length&&(r.guard=function(...o){let l=this.event.error;return!!o.find(function(a){return et(l,a)})}),this.addEventListener("error",r,n),r}};f(Oo,Yd,"Element",1,Element);var bg=Oo;function Xd(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var Qd=Symbol(),as,hs=new(as=class{get ios\u03A6(){let s=globalThis.navigator.platform||"";return!!(s.match(/iPhone|iPod|iPad/)||s=="MacIntel"&&globalThis.navigator.maxTouchPoints>2)}},f(as,Qd,null,0),as);function us(s,t){let e=t;return Xd(s,Element)?s:typeof s=="string"?s=="this"||s==""?e:s=="up"?e.parentNode:s=="op"?e.offsetParent:e.closest(s)||e.querySelector(s)||globalThis.document.querySelector(s):null}function Ft(s){if(typeof s=="string"){let[t,e,r]=s.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(e),r]}else if(typeof s=="number")return[s]}function cs(s,t=1){let e=1/t;return Math.round(s*e)/e}function Jd(s,t,e){return t>e?Math.max(e,Math.min(t,s)):Math.min(e,Math.max(t,s))}function Co(s,t,e,r,n=.1){let[i,o]=Ft(e),[l,a]=Ft(r),[h,d]=Ft(n);return o=="%"&&(i=(t-s)*(i/100)),a=="%"&&(l=(t-s)*(l/100)),d=="%"&&(h=(l-i)*(h/100)),function(c,v){let T=(c-s)/(t-s),u=i+(l-i)*T;return n&&(u=cs(u,h)),v&&(u=Jd(u,i,l)),u}}$r();function qh(){return globalThis.imba.uses_events_pointer=!0,!0}var Zd=Symbol(),Po=class{\u03B1primary(){return!!this.isPrimary&&(this.pointerType!="mouse"||this.button==0)}\u03B1secondary(){return!this.isPrimary&&this.button!=0}\u03B1mouse(){return this.pointerType=="mouse"}\u03B1pen(){return this.pointerType=="pen"}\u03B1touch(){return this.pointerType=="touch"}\u03B1pressure(t=.5){return this.pressure>=t}\u03B1lock(){return!0}};f(Po,Zd,"PointerEvent",1,nn);var wg=Po;function Rt(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var Lo=Symbol.for("#capture"),rt=Symbol.for("#step"),tf=Symbol.for("#cancel"),ds=Symbol.for("#reframe"),Io=Symbol.for("#mods"),fs=Symbol.for("#dx"),ms=Symbol.for("#dy"),gt=Symbol.for("#context"),rr=Symbol.for("#locked"),Mo=Symbol.for("#teardown"),Fo=Symbol.for("#x"),Ro=Symbol.for("#y"),ef=Symbol.for("#pinTarget");function Bh(){return globalThis.imba.uses_events_touch=!0,!0}var jo=null,rf=Symbol(),Ao=class{constructor(t,e,r){this.phase="init",this.events=[],this.originalEvent=t,this.handler=e,this.target=this.currentTarget=r,this[Io]={}}set event(t){this.events.push(t)}get ctrlKey(){return this.originalEvent.ctrlKey}get altKey(){return this.originalEvent.altKey}get shiftKey(){return this.originalEvent.shiftKey}get metaKey(){return this.originalEvent.metaKey}get isPrimary(){return this.originalEvent.isPrimary}get pointerType(){return this.originalEvent.pointerType}get start(){return this.originalEvent}get originalTarget(){return this.originalEvent.target}get event(){return this.events[this.events.length-1]}get elapsed(){return this.event.timeStamp-this.events[0].timeStamp}get type(){return this.event.type}get pointerId(){return this.originalEvent.pointerId}get pressure(){return this.event.pressure}get clientX(){return this.event.clientX}get clientY(){return this.event.clientY}get offsetX(){return this.event.offsetX}get offsetY(){return this.event.offsetY}get active\u03A6(){return this.phase!="ended"}get ended\u03A6(){return this.phase=="ended"}get dx(){return this[fs]==null?this.event.x-this.start.x:this[fs]}get dy(){return this[ms]==null?this.event.y-this.start.y:this[ms]}get dr(){return Math.sqrt(this.dx*this.dx+this.dy*this.dy)}stopImmediatePropagation(){return this.cancelBubble=!0,this.event.stopImmediatePropagation(),this}stopPropagation(){return this.cancelBubble=!0,this.event.stopPropagation(),this}preventDefault(){return this.defaultPrevented=!0,this.event.preventDefault()}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 Ut(this,t,...e)}\u03B1flag(t,e){let{element:r}=this[gt],n=Date.now(),i=Rt(e,F)?e:e?r.closest(e):r;return this[rt].setup!=!0&&(this[rt].setup=!0,!0)&&(i.flags.incr(t),V(this,"end",function(){return i.flags.decr(t)})),!0}\u03B1lock(){return this[Lo](),!0}[Lo](){if(this[rr]!=!0&&(this[rr]=!0,!0))return this[gt].element.setPointerCapture(this.pointerId)}get[rt](){var t,e;return(t=this[Io])[e=this[gt].step]||(t[e]={})}[tf](){return this[Mo]()}\u03B1moved(t,e){let r=this[rt],{element:n,state:i,event:o}=this[gt];if(!r.setup){let c=t||4;typeof t=="string"&&t.match(/^(up|down|left|right|x|y)$/)&&(r.dir=t,c=e||4),typeof e=="string"&&e.match(/^(up|down|left|right|x|y)$/)&&(r.dir=e),r.setup=!0;let[v,T]=Ft(c);r.threshold=v,r.sy=v,r.x0=this.x,r.y0=this.y,r.dir||(r.dir="dist"),r.x=r.left=r.right=r.y=r.up=r.down=r.dist=0,T&&T!="px"&&console.warn("only px threshold allowed in @touch.moved")}if(r.active)return!0;if(r.cancelled)return!1;let l=r.threshold,a=this.x-r.x0,h=this.y-r.y0;r.x=Math.max(r.x,Math.abs(a)),r.y=Math.max(r.y,Math.abs(h)),r.left=Math.max(r.left,-a),r.right=Math.max(r.right,a),r.up=Math.max(r.up,-h),r.down=Math.max(r.down,h),r.dist=Math.max(r.dist,Math.sqrt(a*a+h*h));let d=r[r.dir];if(d>l&&d>=r.x&&d>=r.y){r.active=!0;let c=i.pinTarget;return n.flags.incr("@move"),c&&c.flags.incr("@move"),this.preventDefault(),V(this,"end",function(){return c&&c.flags.decr("@move"),n.flags.decr("@move")}),!0}else if(r.x>l||r.y>l)return r.cancelled=!0,!1;return!1}\u03B1hold(t=250){var e=this;let r=this[rt],n=this[gt].element;if(r.cancelled)return!1;if(r.setup&&!r.active){let i=this.clientX,o=this.clientY,l=i-r.x,a=o-r.y;Math.sqrt(l*l+a*a)>5&&!r.cancelled&&(clearTimeout(r.timeout),r.cancelled=!0)}if(r.setup!=!0&&(r.setup=!0,!0)){r.active=!1,r.x=this.clientX,r.y=this.clientY;let i;return r.timeout=setTimeout(function(){return r.active=!0,e.preventDefault(),n.flags.incr("@hold"),i&&i(!0),i=null},t),V(this,"end",function(){return r.active&&n.flags.decr("@hold"),clearTimeout(r.timeout),i&&i(!1),i=null}),new Promise(function(o){return i=o})}return r.active}\u03B1sync(t,e="x",r="y"){let n=this[rt];return n.setup!=!0&&(n.setup=!0,!0)?(n.x=t[e]||0,n.y=t[r]||0,n.tx=this.x,n.ty=this.y):(e&&(t[e]=n.x+(this.x-n.tx)),r&&(t[r]=n.y+(this.y-n.ty))),this[gt].commit=!0,!0}\u03B1apply(t,e="x",r="y"){return e&&(t[e]=this.x),r&&(t[r]=this.y),this[gt].commit=!0,!0}\u03B1css(t="x",e="y"){let r=this[rt];if(r.setup!=!0&&(r.setup=!0,!0))r.el=this[gt].element,r.x=r.el[Fo]||0,r.y=r.el[Ro]||0,r.tx=this.x,r.ty=this.y;else{let n=r.el[Fo]=r.x+(this.x-r.tx),i=r.el[Ro]=r.y+(this.y-r.ty);t&&r.el.style.setProperty("--x",n+"px"),e&&r.el.style.setProperty("--y",i+"px")}return!0}\u03B1end(){return this.phase=="ended"}\u03B1shift(){return!!this.shiftKey}\u03B1alt(){return!!this.altKey}\u03B1ctrl(){return!!this.ctrlKey}\u03B1meta(){return!!this.metaKey}\u03B1primary(){return!!this.isPrimary&&(this.pointerType!="mouse"||this.originalEvent.button==0)}\u03B1mouse(){return this.pointerType=="mouse"}\u03B1pen(){return this.pointerType=="pen"}\u03B1touch(){return this.pointerType=="touch"}\u03B1pressure(t=.5){return this.pressure>=t}\u03B1log(...t){return console.info(...t),!0}\u03B1left(){return this.originalEvent.button==0}\u03B1middle(){return this.originalEvent.button==1}\u03B1right(){return this.originalEvent.button==2}\u03B1round(t=1,e=t){return this.x=cs(this.x,t),this.y=cs(this.y,e),!0}[ds](...t){let e=this[rt];if(e.setup!=!0&&(e.setup=!0,!0)){let r=this.target,n=t.length,i=t[0],o=0,l="100%",a=0,h=typeof i;h=="number"||h=="string"&&/^([-+]?\d[\d\.]*)(%|\w+)$/.test(i)||Rt(i,Array)?i=null:h=="string"&&(i=="this"||i==""?i=r:i=="up"?i=r.parentNode:i=="op"?i=r.offsetParent:i=r.closest(i)||r.querySelector(i)),i==null&&(n++,t.unshift(i=r)),n==2?a=t[1]:n>2&&([o,l,a=0]=t.slice(1));let d=i.getBoundingClientRect();Rt(o,Array)||(o=[o,o]),Rt(l,Array)||(l=[l,l]),Rt(a,Array)||(a=[a,a]),e.rect=d,e.x=Co(d.left,d.right,o[0],l[0],a[0]),e.y=Co(d.top,d.bottom,o[1],l[1],a[1]),this.x0=this.x=e.x(this.x,e.clamp),this.y0=this.y=e.y(this.y,e.clamp)}else{let r=this.x=e.x(this.x,e.clamp),n=this.y=e.y(this.y,e.clamp);this[fs]=r-this.x0,this[ms]=n-this.y0}return!0}\u03B1fit(...t){return this[rt].clamp=!0,this[ds](...t)}\u03B1reframe(...t){return this[ds](...t)}\u03B1pin(...t){var e;let r=this[rt];if(r.setup!=!0&&(r.setup=!0,!0)){let n=us(t[0],this.target);Rt(n,F)||t.unshift(n=this.target);let i=t[1]||0,o=(e=t[2])!=null?e:t[2]=i,l=n.getBoundingClientRect();r.x=this.clientX-(l.left+l.width*i),r.y=this.clientY-(l.top+l.height*o),n&&(this[ef]=n,n.flags.incr("_touch_"),V(this,"end",function(){return n.flags.decr("_touch_")}))}return this.x-=r.x,this.y-=r.y,!0}};f(Ao,rf,"Touch",16);var xn=Ao,sf=Symbol(),Do=class{on$touch(t,e,r,n){return r.type="touch",this.addEventListener("pointerdown",r,{passive:!1}),hs.ios\u03A6&&globalThis.parent!=globalThis&&jo!=!0&&(jo=!0,!0)&&globalThis.parent.postMessage("setupTouchFix"),r}};f(Do,sf,"Element",1,F);var Tg=Do;if(globalThis.parent==globalThis&&hs.ios\u03A6){let s=function(t){if(t.data=="setupTouchFix")return globalThis.addEventListener("touchmove",function(){return!1},{passive:!1}),globalThis.removeEventListener("message",s)};globalThis.addEventListener("message",s)}wr.touch$handle=function(){let s=this.event,t=this.element,e=this.state.pointerId,r=this.modifiers,n=this.handler,i=hs.ios\u03A6;if(this.current=this.state,e!=null)return e==s.pointerId;if(r.ctrl&&!s.ctrlKey||r.alt&&!s.altKey||r.meta&&!s.metaKey||r.shift&&!s.shiftKey||r.if&&!r.if[0]||r.self&&s.target!=t||r.primary&&!s.isPrimary||r.pen&&s.pointerType!="pen"||r.mouse&&s.pointerType!="mouse"||r.touch&&s.pointerType!="touch"||r.sel&&!s.target.matches(String(r.sel[0]))||r["!sel"]&&s.target.matches(String(r["!sel"][0])))return;let o=this.state=n.state=this.current=new xn(s,n,t);e=o.pointerId;let l=function(u){return u.preventDefault(),!1},a=null,h=Symbol(),d=function(u){let m=o.clientX,p=o.clientY,g=u.clientX,S=u.clientY;(o[rr]||o.defaultPrevented)&&(u.pointerId==o.pointerId||m==g&&p==S)&&(u.preventDefault(),u.stopPropagation()),d&&(globalThis.removeEventListener("click",d,{capture:!0}),d=null)},c=function(u){if(!(o.type=="touchmove"&&u.changedTouches[0].identifier!=e)&&(o.defaultPrevented||o[rr]))return u.preventDefault()},v=function(u){let m=u.type,p=o.phase;if(u.pointerId&&o.pointerId!=u.pointerId||u[h])return;u[h]=!0;let g=m=="pointerup"||m=="pointercancel";if(u.pressure==0&&u.pointerType=="mouse"&&m=="pointermove"&&o.originalEvent.pressure>0)return a(u);m=="pointercancel"?(o.x=o.clientX,o.y=o.clientY):(o.x=u.clientX,o.y=u.clientY),o.event=u,g&&(o.phase="ended");try{n.handleEvent(o)}catch{}if(p=="init"&&!g&&(o.phase="active"),g&&a)return a(u)},T=!1;return a=function(u){if(!T&&(T=!0,t.flags.decr("_touch_"),o.phase!="ended"&&(o.phase="ended",o.x=o.clientX,o.y=o.clientY,n.handleEvent(o)),o.emit("end"),r.passive||--n.prevents==0&&t.style.removeProperty("touch-action"),n.state={},globalThis.removeEventListener("pointermove",v,{passive:!!r.passive}),globalThis.removeEventListener("pointerup",v),globalThis.removeEventListener("pointercancel",v),setTimeout(function(){if(d&&(globalThis.removeEventListener("click",d,{capture:!0}),d=null),i&&c)return globalThis.removeEventListener("touchend",c),globalThis.removeEventListener("touchmove",c,{passive:!1}),c=null},100),!r.passive))return globalThis.document.removeEventListener("selectstart",l,{capture:!0})},o[Mo]=a,r.passive||(n.prevents||(n.prevents=0),n.prevents++,t.style.setProperty("touch-action","none"),t.offsetWidth),t.flags.incr("_touch_"),globalThis.addEventListener("pointermove",v,{passive:!!r.passive}),globalThis.addEventListener("pointerup",v),globalThis.addEventListener("pointercancel",v),globalThis.addEventListener("click",d,{capture:!0}),i&&!r.passive&&(globalThis.addEventListener("touchend",c),globalThis.addEventListener("touchmove",c,{passive:!1})),r.passive||globalThis.document.addEventListener("selectstart",l,{capture:!0}),v(s),!1};function Vo(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}function zo(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var nf=Symbol.for("#context"),of=Symbol.for("#extendType");function Uh(){return globalThis.imba.uses_events_intersect=!0,!0}var Ho=new(globalThis.WeakMap||Map),Ne={threshold:[0]},lf={};wr.intersect$handle=function(){let s=this.event.detail.observer;return this.modifiers._observer==s};var af=Symbol(),Ko=class extends H{\u03B1in(){return this.delta>=0&&this.entry.isIntersecting}\u03B1out(){return this.delta<0}\u03B1css(t="ratio"){return this.target.style.setProperty("--ratio",this.ratio),!0}\u03B1flag(t,e){let{state:r,step:n}=this[nf],i=us(e||"",this.target);return this.isIntersecting&&!r[n]?(i.flags.incr(t),r[n]=!0):r[n]&&!this.isIntersecting&&(i.flags.decr(t),r[n]=!1),!0}};f(Ko,af,"IntersectionEvent",0);var hf=Ko;function uf(s,t){return function(e,r){let n=r.prevRatios||(r.prevRatios=new WeakMap);for(let i=0,o=Vo(e),l=o.length;i<l;i++){let a=o[i],h=n.get(a.target)||0,d=a.intersectionRatio,c={entry:a,ratio:d,from:h,delta:d-h,observer:r},v=new H(s,{bubbles:!1,detail:c});v[of](hf),v.entry=a,v.isIntersecting=a.isIntersecting,v.delta=c.delta,v.ratio=c.ratio,n.set(a.target,d),a.target.dispatchEvent(v)}}}function qo(s=Ne){let t=s.threshold.join("-")+s.rootMargin;!s.root&&Ne.root&&(s.root||(s.root=Ne.root));let e=s.root||lf,r=Ho.get(e);return r||Ho.set(e,r={}),r[t]||(r[t]=new IntersectionObserver(uf("intersect",t),s))}var cf=Symbol(),Bo=class{on$intersect(t,e,r,n){let i;if(t.options){let o=[],l={threshold:o};for(let a=0,h=Vo(t.options),d=h.length;a<d;a++){let c=h[a];zo(c,F)||zo(c,fn)?l.root=c:typeof c=="number"?o.push(c):typeof c=="string"?l.rootMargin=c:typeof c=="object"&&Object.assign(l,c)}if(o.length==1){let a=o[0];if(a>1)for(o[0]=0;o.length<a;)o.push(o.length/(a-1))}o.length==0&&o.push(0),i=qo(l)}else i=qo();return t._observer=i,i.observe(this),this.addEventListener("intersect",r,n),r}};f(Bo,cf,"Element",1,F);var kg=Bo;function df(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Uo=Symbol.for("#width"),Go=Symbol.for("#height"),ff=Symbol.for("#extendType");function Gh(){return globalThis.imba.uses_events_resize=!0,!0}var sr=null,mf=Symbol(),Wo=class extends H{\u03B1css(t="1elw",e="1elh",r="",n=""){var i;let o=(i=this.entry)==null?void 0:i.target;if(r=="px"&&(n=r,r=""),o&&o.offsetParent){let l=Ft(t),a=Ft(e),h=us(r,o),d=l?"--u_"+l[1]:"--"+t,c=a?"--u_"+a[1]:"--"+e,v=l?this.width/l[0]:this.width,T=a?this.height/a[0]:this.height;h.style.setProperty(d,v+n),h.style.setProperty(c,T+n)}return!0}get width(){var t;return(t=this[Uo])!=null?t:this[Uo]=this.entry.target.offsetWidth}get height(){var t;return(t=this[Go])!=null?t:this[Go]=this.entry.target.offsetHeight}};f(Wo,mf,"ResizeEvent",0);var pf=Wo;function gf(){return globalThis.ResizeObserver||sr||(console.warn(":resize not supported in this browser"),sr={observe:function(){return!0}}),globalThis.imbaResizeObserver=sr||(sr=new ResizeObserver(function(s){for(let t=0,e=df(s),r=e.length;t<r;t++){let n=e[t],i=new H("resize",{bubbles:!1,detail:n});i.entry=n,i.rect=n.contentRect,i[ff](pf),n.target.dispatchEvent(i);let o=new H("resized",{bubbles:!0,detail:n});n.target.dispatchEvent(o)}}))}var vf=Symbol(),Yo=class{on$resize(t,e,r,n){return gf().observe(this),this.addEventListener("resize",r,n),r}};f(Yo,vf,"Element",1,F);var Cg=Yo;function yf(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var bf=Symbol.for("#extendType"),Sf=Symbol.for("#options");function Wh(){return globalThis.imba.uses_events_mutate=!0,!0}var wf=Symbol(),Xo=class extends H{};f(Xo,wf,"MutationEvent",0);var xf=Xo,_f=Symbol(),Qo=class{on$mutate(t,e,r,n){var i=this,o,l,a,h;r.observer||(r.observer=new MutationObserver(function(c){let v=new H("mutate",{bubbles:!!t.bubble,detail:c});return v[bf](xf),i.dispatchEvent(v)}));let d=r[Sf]={};return t.subtree&&(o=t.subtree,delete t.subtree,d.subtree=!0),t.text&&(l=t.text,delete t.text,d.characterData=!0,d.characterDataOldValue=!0),t.childList&&(a=t.childList,delete t.childList,d.childList=!0),t.attributes&&(yf(t.attributes,Array)&&(d.attributeFilter=t.attributes),h=t.attributes,delete t.attributes,d.attributes=!0),!d.attributes&&!d.childList&&(d.childList=!0),r.observer.observe(this,d),this.addEventListener("mutate",r,n),r}};f(Qo,_f,"Element",1,F);var Ig=Qo;function Yh(){return globalThis.imba.uses_events_selection=!0,!0}var ps,Jo=Symbol();function Tf(){if(!ps)return ps=function(s){if(s[Jo])return;s[Jo]=!0;let t=globalThis.document.activeElement;if(t&&t.matches("input,textarea")){let e=new H("selection",{detail:{start:t.selectionStart,end:t.selectionEnd}});return t.dispatchEvent(e)}},globalThis.document.addEventListener("selectionchange",ps)}var Ef=Symbol(),Zo=class{on$selection(t,e,r,n){return Tf(),this.addEventListener("selection",r,n),r}};f(Zo,Ef,"Element",1,F);var Fg=Zo,tl=Symbol.for("#string"),el=Symbol.for("#html"),st={win:{sep:"+",name:"win",order:["meta","ctrl","mod","alt","option","shift"].reverse(),labels:{option:"alt",mod:"ctrl",meta:"win"}},mac:{sep:"",name:"mac",order:["ctrl","alt","option","shift","mod","command"].reverse(),labels:{left:"\u2192",up:"\u2191",down:"\u2193",right:"\u2190",plus:"+",tab:"\u21E5",meta:"\u2318",mod:"\u2318",ctrl:"\u2303",option:"\u2325",alt:"\u2325",del:"\u2326",shift:"\u21E7",enter:"\u21A9",esc:"\u238B",backspace:"\u232B"}}};st.auto=st.win,(globalThis.navigator.platform||"").match(/iPhone|iPod|iPad|Mac/)&&(st.auto=st.mac);var gs={};function rl(s,t="auto"){let e=""+s+":"+t;if(gs[e])return gs[e];let r=st[t]||st.win,n=s.split(" ").map(function(i){return i.split("+").sort(function(o,l){return r.order.indexOf(l)-r.order.indexOf(o)}).map(function(o){let l=r.labels[o]||o;return l=l[0].toUpperCase()+(l.slice(1)||"")})});return gs[e]=n}function $f(s,t){let e=rl(s,t),r=st[t]||st.win;return e[tl]||(e[tl]=e.map(function(n){return n.join(r.sep)}).join(" "))}function kf(s,t){let e=rl(s,t),r=st[t]||st.win;return e[el]||(e[el]=e.map(function(n){return"<kbd>"+n.map(function(i){return"<kbd>"+i+"</kbd>"}).join("")+"</kbd>"}).join(" "))}var vt={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},sl={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},nl={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},il={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},ue;for(nt=1;nt<20;++nt)vt[111+nt]="f"+nt;var nt;for(nt=0;nt<=9;++nt)vt[nt+96]=nt.toString();function vs(s,t,e){if(s.addEventListener){s.addEventListener(t,e,!1);return}s.attachEvent("on"+t,e)}function ys(s,t,e){if(s.removeEventListener){s.removeEventListener(t,e,!1);return}s.detachEvent("on"+t,e)}function ol(s){if(s.type=="keypress"){var t=String.fromCharCode(s.which);return s.shiftKey||(t=t.toLowerCase()),t}return vt[s.which]?vt[s.which]:sl[s.which]?sl[s.which]:String.fromCharCode(s.which).toLowerCase()}function Nf(s,t){return s.sort().join(",")===t.sort().join(",")}function Of(s){var t=[];return s.shiftKey&&t.push("shift"),s.altKey&&t.push("alt"),s.ctrlKey&&t.push("ctrl"),s.metaKey&&t.push("meta"),t}function Cf(s){if(s.preventDefault){s.preventDefault();return}s.returnValue=!1}function Pf(s){if(s.stopPropagation){s.stopPropagation();return}s.cancelBubble=!0}function bs(s){return s=="shift"||s=="ctrl"||s=="alt"||s=="meta"}function Lf(){if(!ue){ue={};for(var s in vt)s>95&&s<112||vt.hasOwnProperty(s)&&(ue[vt[s]]=s)}return ue}function If(s,t,e){return e||(e=Lf()[s]?"keydown":"keypress"),e=="keypress"&&t.length&&(e="keydown"),e}function Mf(s){return s==="+"?["+"]:(s=s.replace(/\+{2}/g,"+plus"),s.split("+"))}function ll(s,t){var e,r,n,i=[];for(e=Mf(s),n=0;n<e.length;++n)r=e[n],il[r]&&(r=il[r]),t&&t!="keypress"&&nl[r]&&(r=nl[r],i.push("shift")),bs(r)&&i.push(r);return t=If(r,i,t),{key:r,modifiers:i,action:t}}function al(s,t){return s===null||s===document?!1:s===t?!0:al(s.parentNode,t)}function j(s){var t=this;if(s=s||document,!(t instanceof j))return new j(s);t.handleKeyEvent=d,t.target=s,t._callbacks={},t._directMap={};var e={},r,n=!1,i=!1,o=!1;function l(u){u=u||{};var m=!1,p;for(p in e){if(u[p]){m=!0;continue}e[p]=0}m||(o=!1)}function a(u,m,p,g,S,w){var y,b,_=[],O=p.type;if(!t._callbacks[u])return[];for(O=="keyup"&&bs(u)&&(m=[u]),y=0;y<t._callbacks[u].length;++y)if(b=t._callbacks[u][y],!(!g&&b.seq&&e[b.seq]!=b.level)&&O==b.action&&(O=="keypress"&&!p.metaKey&&!p.ctrlKey||Nf(m,b.modifiers))){var K=!g&&b.combo==S,at=g&&b.seq==g&&b.level==w;(K||at)&&t._callbacks[u].splice(y,1),_.push(b)}return _}function h(u,m,p,g){t.stopCallback(m,m.target||m.srcElement,p,g)||u(m,p)===!1&&(Cf(m),Pf(m))}t._handleKey=function(u,m,p){var g=a(u,m,p),S,w={},y=0,b=!1;for(S=0;S<g.length;++S)g[S].seq&&(y=Math.max(y,g[S].level));for(S=0;S<g.length;++S){if(g[S].seq){if(g[S].level!=y)continue;b=!0,w[g[S].seq]=1,h(g[S].callback,p,g[S].combo,g[S].seq);continue}b||h(g[S].callback,p,g[S].combo)}var _=p.type=="keypress"&&i;p.type==o&&!bs(u)&&!_&&l(w),i=b&&p.type=="keydown"};function d(u){typeof u.which!="number"&&(u.which=u.keyCode);var m=ol(u);if(m){if(u.type=="keyup"&&n===m){n=!1;return}t.handleKey(m,Of(u),u)}}function c(){clearTimeout(r),r=setTimeout(l,1e3)}function v(u,m,p,g){e[u]=0;function S(O){return function(){o=O,++e[u],c()}}function w(O){h(p,O,u),g!=="keyup"&&(n=ol(O)),setTimeout(l,10)}for(var y=0;y<m.length;++y){var b=y+1===m.length,_=b?w:S(g||ll(m[y+1]).action);T(m[y],_,g,u,y)}}function T(u,m,p,g,S){t._directMap[u+":"+p]=m,u=u.replace(/\s+/g," ");var w=u.split(" "),y;if(w.length>1){v(u,w,m,p);return}y=ll(u,p),t._callbacks[y.key]=t._callbacks[y.key]||[],a(y.key,y.modifiers,{type:y.action},g,u,S),t._callbacks[y.key][g?"unshift":"push"]({callback:m,modifiers:y.modifiers,action:y.action,seq:g,level:S,combo:u})}t._bindMultiple=function(u,m,p){for(var g=0;g<u.length;++g)T(u[g],m,p)},t.enable=function(){vs(s,"keypress",d),vs(s,"keydown",d),vs(s,"keyup",d)},t.disable=function(){ys(s,"keypress",d),ys(s,"keydown",d),ys(s,"keyup",d)},t.enable()}j.prototype.bind=function(s,t,e){var r=this;return s=s instanceof Array?s:[s],r._bindMultiple.call(r,s,t,e),r},j.prototype.unbind=function(s,t){var e=this;return e.bind.call(e,s,function(){},t)},j.prototype.trigger=function(s,t){var e=this;return e._directMap[s+":"+t]&&e._directMap[s+":"+t]({},s),e},j.prototype.reset=function(){var s=this;return s._callbacks={},s._directMap={},s},j.prototype.stopCallback=function(s,t){var e=this;return(" "+t.className+" ").indexOf(" mousetrap ")>-1||al(t,e.target)?!1:t.tagName=="INPUT"||t.tagName=="SELECT"||t.tagName=="TEXTAREA"||t.isContentEditable},j.prototype.handleKey=function(){var s=this;return s._handleKey.apply(s,arguments)},j.addKeycodes=function(s){for(var t in s)s.hasOwnProperty(t)&&(vt[t]=s[t]);ue=null},j.init=function(){var s=j(document);for(var t in s)t.charAt(0)!=="_"&&(j[t]=function(e){return function(){return s[e].apply(s,arguments)}}(t))};function jt(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}function Ff(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var Ss=Symbol.for("#updateHotKeys"),Rf=Symbol.for("#context"),jf=Symbol.for("#inInput"),ws=Symbol.for("#inEditable"),Af=Symbol.for("#hotkeyTarget"),hl=Symbol.for("#hotkeyCombos"),At=Symbol.for("#hotkeyHandlers"),xt=Symbol.for("#combos"),ul=Symbol.for("#extendType"),xs=Symbol.for("#defaultPrevented"),_s=Symbol.for("#target"),Df=Symbol.for("#stopPropagation"),Vf=Symbol.for("#visit"),cl=Symbol.for("#key"),zf;try{zf=(globalThis.navigator.platform||"").match(/iPhone|iPod|iPad|Mac/)}catch{}function Xh(){return globalThis.imba.uses_events_hotkey=!0,!0}var Ts={esc:!0},Hf=Symbol(),dl=class extends H{\u03B1focus(t){let e=this[Rf].element,r=e.ownerDocument;return t&&(e=e.querySelector(t)||e.closest(t)||r.querySelector(t)),e==r.body?r.activeElement!=r.body&&r.activeElement.blur():e.focus(),!0}\u03B1local(){return!0}\u03B1repeat(){return!0}};f(dl,Hf,"HotkeyEvent",0);var fl=dl,Kf=function(s,t,e){return t.tagName=="INPUT"&&(e=="down"||e=="up")?!1:t.tagName=="INPUT"||t.tagName=="SELECT"||t.tagName=="TEXTAREA"?Ts[e]?(s[jf]=!0,s[ws]=!0,!1):!0:t.contentEditable&&(t.contentEditable=="true"||t.contentEditable=="plaintext-only")?Ts[e]?(s[ws]=!0,!1):!0:!1},qf=Symbol(),ml=class{constructor(){this.combos={"*":{}},this.identifiers={},this.labels={},this.handler=this.handle.bind(this),this.mousetrap=null,this.hothandler=this.handle.bind(this)}addKeycodes(t){return j.addKeycodes(t)}trigger(t){var e,r;return(r=(e=this.mousetrap)==null?void 0:e.trigger)==null?void 0:r.call(e,t)}register(t,e={}){return this.mousetrap||(this.mousetrap=j(globalThis.document),this.mousetrap.stopCallback=Kf),this.combos[t]||(this.combos[t]=!0,this.mousetrap.bind(t,this.handler)),(e.capture||e.force)&&(Ts[t]=!0),this}comboIdentifier(t){var e;return(e=this.identifiers)[t]||(e[t]=t.replace(/\+/g,"_").replace(/\ /g,"-").replace(/\*/g,"all").replace(/\|/g," "))}humanize(t,e="auto"){return $f(t,e)}htmlify(t,e="auto"){return kf(t,e)}matchCombo(t){return!0}handleEvent(t){var e,r;return(r=(e=this.mousetrap)==null?void 0:e.handleKeyEvent)==null?void 0:r.call(e,t)}handle(t,e){var r;let n=t.target&&t.target[Af]||t.target||globalThis.document.body,i=Array.from(globalThis.document.querySelectorAll("[data-hotkey]")),o=n.ownerDocument,l=n,a=[];for(;l&&l!=o&&l.hotkeys!==!0;)l=l.parentNode;i=i.reverse().filter(function(u){let m=u[hl],p=m&&m[e],g=m&&m["*"];if(!(p||g))return!1;let S=u[At],w=u;for(;w&&w!=o;){if(w.hotkeys===!1)return!1;if(w.hotkeys===!0&&!w.contains(n)){let y=!0;for(let b=0,_=jt(S),O=_.length;b<O;b++){let K=_[b];(K[xt][e]||K[xt]["*"])&&K.global\u03A6&&(y=!1)}if(y)return!1}w=w.parentNode}return!0});let h=globalThis.document.activeElement;if(i.length>1){let u=i.filter(function(p){return h.contains(p)});u.length&&(i=u);let m=i.filter(function(p){try{return!p.hidden\u03A6}catch{}});m.length>0&&(i=m)}if(!i.length)return;let d=new H("beforehotkey",{bubbles:!0,detail:this.detail});if(d[ul](fl),d.hotkey=e,n.dispatchEvent(d),d[xs])return;let c={combo:e,originalEvent:t,targets:i},v=new H("hotkey",{bubbles:!0,detail:c});v[ul](fl),v.originalEvent=t,v.hotkey=e,n.dispatchEvent(v);for(let u=0,m=jt(i),p=m.length;u<p;u++){let g=m[u];for(let S=0,w=jt(g[At]),y=w.length;S<y;S++){let b=w[S];if(b[xt][e]||b[xt]["*"]){if(b.params.local&&!b[_s].contains(n)||b.params.unobstructed&&!g.unobstructed\u03A6)continue;if(!t[ws]||b.capture\u03A6||b.params.force){let _=b[_s];(l&&(l.contains(_)||_.contains(l))||b.global\u03A6)&&a.push(b)}}}}let T=[];for(let u=0,m=jt(a),p=m.length;u<p;u++){let g=m[u],S;(!t.repeat||g.params.repeat)&&(S=g.handleEvent(v));let w=g.lastState||{};if(T.push(w),(!g.passive\u03A6&&w.called||v[xs])&&((r=t?.preventDefault)==null||r.call(t)),!(g.passive\u03A6||w.called==!1&&!v[Df]&&!v[xs]))break}return T}};f(ml,qf,"HotKeyManager",16);var Bf=ml,_n=new Bf,pl=function(s,t){let e=t.element;Ff(e,F)&&(e.matches("input,textarea,select,option")?e.focus():e.click())};pl.passive=!0;var Uf=Symbol(),gl=class{on$hotkey(t,e,r,n){var i=this;return this[At]||(this[At]=[]),this[At].push(r),r[_s]=this,t.$_||(t.$_=[pl]),t[Vf]=function(){return i[Ss]()},this[Ss](),r}[Ss](){let t={};for(let e=0,r=jt(this[At]),n=r.length;e<n;e++){let i=r[e],o=i.params,l=o.options[0];if(i[cl]!=l&&(i[cl]=l,!0)){i[xt]={};for(let a=0,h=jt(l.split("|")),d=h.length;a<d;a++){let c=h[a];_n.register(c,o),i[xt][c]=!0}}Object.assign(t,i[xt])}return this[hl]=t,this.dataset.hotkey=Object.keys(t).join(" "),this}};f(gl,Uf,"Element",1,F);var Dg=gl,Dt=typeof Reflect=="object"?Reflect:null,vl=Dt&&typeof Dt.apply=="function"?Dt.apply:function(s,t,e){return Function.prototype.apply.call(s,t,e)},nr;Dt&&typeof Dt.ownKeys=="function"?nr=Dt.ownKeys:Object.getOwnPropertySymbols?nr=function(s){return Object.getOwnPropertyNames(s).concat(Object.getOwnPropertySymbols(s))}:nr=function(s){return Object.getOwnPropertyNames(s)};function Gf(s){console&&console.warn&&console.warn(s)}var yl=Number.isNaN||function(s){return s!==s};function E(){E.init.call(this)}E.EventEmitter=E,E.prototype._events=void 0,E.prototype._eventsCount=0,E.prototype._maxListeners=void 0;var bl=10;function ir(s){if(typeof s!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof s)}Object.defineProperty(E,"defaultMaxListeners",{enumerable:!0,get:function(){return bl},set:function(s){if(typeof s!="number"||s<0||yl(s))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+s+".");bl=s}}),E.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},E.prototype.setMaxListeners=function(s){if(typeof s!="number"||s<0||yl(s))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+s+".");return this._maxListeners=s,this};function Sl(s){return s._maxListeners===void 0?E.defaultMaxListeners:s._maxListeners}E.prototype.getMaxListeners=function(){return Sl(this)},E.prototype.emit=function(s){for(var t=[],e=1;e<arguments.length;e++)t.push(arguments[e]);var r=s==="error",n=this._events;if(n!==void 0)r=r&&n.error===void 0;else if(!r)return!1;if(r){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var o=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw o.context=i,o}var l=n[s];if(l===void 0)return!1;if(typeof l=="function")vl(l,this,t);else for(var a=l.length,h=El(l,a),e=0;e<a;++e)vl(h[e],this,t);return!0};function wl(s,t,e,r){var n,i,o;if(ir(e),i=s._events,i===void 0?(i=s._events=Object.create(null),s._eventsCount=0):(i.newListener!==void 0&&(s.emit("newListener",t,e.listener?e.listener:e),i=s._events),o=i[t]),o===void 0)o=i[t]=e,++s._eventsCount;else if(typeof o=="function"?o=i[t]=r?[e,o]:[o,e]:r?o.unshift(e):o.push(e),n=Sl(s),n>0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=s,l.type=t,l.count=o.length,Gf(l)}return s}E.prototype.addListener=function(s,t){return wl(this,s,t,!1)},E.prototype.on=E.prototype.addListener,E.prototype.prependListener=function(s,t){return wl(this,s,t,!0)};function Wf(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function xl(s,t,e){var r={fired:!1,wrapFn:void 0,target:s,type:t,listener:e},n=Wf.bind(r);return n.listener=e,r.wrapFn=n,n}E.prototype.once=function(s,t){return ir(t),this.on(s,xl(this,s,t)),this},E.prototype.prependOnceListener=function(s,t){return ir(t),this.prependListener(s,xl(this,s,t)),this},E.prototype.removeListener=function(s,t){var e,r,n,i,o;if(ir(t),r=this._events,r===void 0)return this;if(e=r[s],e===void 0)return this;if(e===t||e.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[s],r.removeListener&&this.emit("removeListener",s,e.listener||t));else if(typeof e!="function"){for(n=-1,i=e.length-1;i>=0;i--)if(e[i]===t||e[i].listener===t){o=e[i].listener,n=i;break}if(n<0)return this;n===0?e.shift():Yf(e,n),e.length===1&&(r[s]=e[0]),r.removeListener!==void 0&&this.emit("removeListener",s,o||t)}return this},E.prototype.off=E.prototype.removeListener,E.prototype.removeAllListeners=function(s){var t,e,r;if(e=this._events,e===void 0)return this;if(e.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):e[s]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete e[s]),this;if(arguments.length===0){var n=Object.keys(e),i;for(r=0;r<n.length;++r)i=n[r],i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=e[s],typeof t=="function")this.removeListener(s,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(s,t[r]);return this};function _l(s,t,e){var r=s._events;if(r===void 0)return[];var n=r[t];return n===void 0?[]:typeof n=="function"?e?[n.listener||n]:[n]:e?Xf(n):El(n,n.length)}E.prototype.listeners=function(s){return _l(this,s,!0)},E.prototype.rawListeners=function(s){return _l(this,s,!1)},E.listenerCount=function(s,t){return typeof s.listenerCount=="function"?s.listenerCount(t):Tl.call(s,t)},E.prototype.listenerCount=Tl;function Tl(s){var t=this._events;if(t!==void 0){var e=t[s];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}E.prototype.eventNames=function(){return this._eventsCount>0?nr(this._events):[]};function El(s,t){for(var e=new Array(t),r=0;r<t;++r)e[r]=s[r];return e}function Yf(s,t){for(;t+1<s.length;t++)s[t]=s[t+1];s.pop()}function Xf(s){for(var t=new Array(s.length),e=0;e<t.length;++e)t[e]=s[e].listener||s[e];return t}function Es(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var $s=Symbol.for("#getQueryParam"),$l=Symbol.for("#setQueryParam"),kl=Symbol.for("#query"),Qf=Symbol(),Nl=class Nr{static parse(t,e){return Es(t,Nr)?t:new Nr(t,e)}constructor(t,e){this.router=e,this.parse(t)}parse(t){var e;let r;return Es(t,URL)||(t=new URL(t,this.router.origin)),(r=(e=this.router)==null?void 0:e.aliases[t.pathname])&&(t.pathname=r),this.url=t,this}get active\u03A6(){return this.router.location==this}reparse(){return this.parse(this.url)}get searchParams(){return this.url.searchParams}search(){let t=this.searchParams?this.searchParams.toString():"";return t?"?"+t:""}update(t){if(Es(t,Object))for(let e=0,r=Object.keys(t),n=r.length,i,o;e<n;e++)i=r[e],o=t[i],this.searchParams.set(i,o);else typeof t=="string"&&this.parse(t);return this}clone(){return new Nr(this.url.href,this.router)}equals(t){return this.toString()==String(t)}get href(){return this.url.href}get path(){return this.url.href.slice(this.url.origin.length)}get pathname(){return this.url.pathname}get query(){return this[kl]||(this[kl]=new Proxy({},{get:this[$s].bind(this),set:this[$l].bind(this)}))}toString(){return this.href}[$s](t,e){return this.searchParams.get(e)}[$l](t,e,r){var n;let i=(n=this[$s](t,e))!=null?n:"";return r=r??"",i!=r&&(r==null||r==""?this.searchParams.delete(e):this.searchParams.set(e,r),this.active\u03A6&&(this.router.history.replaceState({},null,this.path),this.router.touch())),!0}};f(Nl,Qf,"Location",16);var or=Nl;function Ol(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function Jf(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}function ks(){return function(){return!0}}var Zf=Symbol(),Cl=class Or{constructor(t,e=""){this.store=t||{},this.cache={raw:{},rich:{}},this.ns=e,this.local=t==globalThis.sessionStorage,this.children=new Map}serialize(t,e){return JSON.stringify(t)}deserialize(t,e){return JSON.parse(t)}getItem(t){let e=String(this.ns)+":"+t;if(Ol(this.store,Or))return this.store.getItem(e);if(this.local&&this.cache.rich[e]!=null)return this.cache.rich[e];let r=this.store.getItem(e);if(r!=null)return this.cache.raw[e]==r?this.cache.rich[e]:(this.cache.raw[e]=r,this.cache.rich[e]=this.deserialize(r,e))}setItem(t,e){var r,n;let i=String(this.ns)+":"+t;if(Ol(this.store,Or))return this.store.setItem(i,e);let o=this.cache.rich[i],l=typeof e;if(this.local&&(this.cache.rich[i]=e),o!==e||l=="object"){let a=this.store.getItem(i);if(e==null)return this.store.removeItem(i),r=this.cache.rich[i],delete this.cache.rich[i],n=this.cache.raw[i],delete this.cache.raw[i],L();{let h=this.serialize(e,i);if(this.cache.rich[i]=e,this.cache.raw[i]=h,a!=h)return this.store.setItem(i,h),L()}}}removeItem(t){var e;let r=String(this.ns)+":"+t;return e=this.cache[r],delete this.cache[r],this.store.removeItem(r)}get(t,e,r){return this.getItem(e)}set(t,e,r,n){return this.setItem(e,r),!0}apply(t,e,[r]){let n=this.children.get(r);return n||this.children.set(r,n=new Proxy(ks(),new Or(this,r))),n}deleteProperty(t,e){return this.removeItem(e),!0}ownKeys(t){let e=["prototype"],r=this.ns+":";for(let n=0,i=Jf(Object.keys(this.store)),o=i.length;n<o;n++){let l=i[n];l.indexOf(r)==0&&e.push(l.slice(r.length))}return e}};f(Cl,Zf,"Storage",16);var Pl=Cl,Qh=new Proxy(ks(),new Pl(globalThis.localStorage)),Tn=new Proxy(ks(),new Pl(globalThis.sessionStorage));function tm(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var ce=Symbol.for("#states"),Ll=new WeakMap,em=Symbol(),Il=class{static from(t,e){return e?new this(t,e):null}constructor(t,e,r=!1){Ll.set(this,t),this.path=e.path,this.data=e.data||{},this.index=e.index,this.type=e.type,this.local=r}get history(){return Ll.get(this)}get next(){return this.history.at(this.index+1)}get prev(){return this.history.at(this.index-1)}toJSON(){return{path:this.path,data:this.data,index:this.index,type:this.type}}save(){return this.history.cache[this.index]=this,this}toString(){return""+this.history.id+"|"+this.index}};f(Il,em,"State",16);var Ns=Il,rm=Symbol(),Ml=class{constructor(t){this.router=t,this.store=Tn("router"),this[ce]=[],this.cache={},this.index=-1;let e=globalThis.history.state,r;if(typeof e=="string"){let n=e.split("|");this.id=parseInt(n[0]),this.index=parseInt(n[1]),this.cache=this.store(this.id)}else this.id=this.store.id=(this.store.id||0)+1,this.cache=this.store(this.id);this.index==-1&&this.replaceState({initial:!0},null,t.path)}get length(){return this.cache.length}get state(){return this.at(this.index)}get states(){let t=this.length,e=0;for(;e<t;)this.at(e++);return this[ce]}get currentStates(){return this.states.slice(0,this.length)}get next(){return this.state.next}get prev(){return this.state.prev}slice(t,e=this.length){let r=[];for(;t<e;)r.push(this.at(t++));return r}at(t){var e;if(!(t>=this.length))return(e=this[ce])[t]||(e[t]=Ns.from(this,this.cache[t]))}buildState(t,e,r=!0){let n={data:t,index:this.index+1,path:e||this.router.path,type:r?"push":"replace"};return new Ns(this,n,!0)}pushState(t,e,r,n=!0){return tm(t,Ns)||(t=this.buildState(t,r,n)),this.index=t.index,this.cache[this.index]=t,this[ce][this.index]=t,this[ce].length=this.cache.length=Math.max(t.index+1,0),globalThis.history[n?"pushState":"replaceState"](String(t),e||null,t.path),this}replaceState(t,e,r){return this.pushState(t,e,r,!1)}};f(Ml,rm,"History",16);var sm=Ml,nm=Symbol(),Fl=class{constructor(t,e,r,n){this.params=n,this.router=t,e&&(this.location=or.parse(e),this.original=this.location.clone()),this.referrer=r}get apply(){return this.params.apply||[]}get revert(){return this.params.revert||[]}get state(){return this.params.state}get mode(){return this.params.mode}redirect(t){var e,r;return(r=(e=this.location)==null?void 0:e.update)==null||r.call(e,t),this}get path(){var t;return(t=this.location)==null?void 0:t.path}get url(){var t,e;return(e=(t=this.location)==null?void 0:t.toString)==null?void 0:e.call(t)}set path(t){this.location.path=t}abort(t=!1){return this.aborted=!0,t&&(this.forceAbort=t),this}match(t){return this.location?this.router.route(t).match(this.path):null}};f(Fl,nm,"Request",16);var Rl=Fl;function jl(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var lr=Symbol.for("#routes"),Os=Symbol.for("#match"),im=Symbol.for("#symbol"),Al=Symbol.for("#matches"),Cs=new Map,Ps={},Dl={},om=/.*/;function lm(s){if(!Cs.has(s)){let t=new Map;return Cs.set(s,t),t}return Cs.get(s)}function am(s,t){let e=lm(s);if(!e.has(t)){let r=Object.create(s);return Object.assign(r,t),e.set(t,r),r}return e.get(t)}var hm=Symbol(),Vl=class{};f(Vl,hm,"Match",0);var um=Vl;function cm(s){if(Ps[s])return Ps[s];let t=Ps[s]={url:s},e=s.indexOf("?"),r=s.indexOf("#");if(r>=0&&(t.hash=s.slice(r+1),s=t.url=s.slice(0,r)),e>=0){let n=t.query=s.slice(e+1);s=s.slice(0,e),t.query=Dl[n]||(Dl[n]=new URLSearchParams(n))}return t.path=s,t}var dm=Symbol(),zl=class{constructor(t){this.router=t,this.fullPath="",this[lr]={},this[Os]=new um,this[Os].path=""}route(t){var e;return(e=this[lr])[t]||(e[t]=new pm(this.router,t,this))}match(){return this[Os]}resolve(t){return"/"}};f(zl,dm,"RootRoute",16);var fm=zl,mm=Symbol(),Hl=class Jh{constructor(t,e,r){this.parent=r||t.rootRoute,this.router=t,this.status=200,this.path=e,this[im]=Symbol(),this[Al]={},this[lr]={}}route(t){var e;return(e=this[lr])[t]||(e[t]=new Jh(this.router,t,this))}get fullPath(){return""+this.parent.fullPath+"/"+this.$path}load(t){return this.router.queue.add(t)}set path(t){var e=this;if(this.$path==t)return;if(this.raw=t,this.$path=t,this.groups=[],this.cache={},this.dynamic=!1,t.indexOf("?")>=0){let n=t.split("?");t=n.shift(),this.query={};for(let i=0,o=jl(n.join("?").split("&")),l=o.length;i<l;i++){let a=o[i];if(!a)continue;let[h,d]=a.split("=");h[0]=="!"&&(this.dynamic=!0,h=h.slice(1),d=!1),d===""&&(d=!1),d&&d[0]==":"&&(this.dynamic=!0),this.query[h]=d||d!==!1}}if(t=t.replace(/\:(\w+|\*)(\.)?/g,function(n,i,o){e.dynamic=!0,i!="*"&&e.groups.push(i);let l=e.router.matchers[i]||(o?"([^/#.?]+)":"([^/#?]+)");return o?""+l+".":l}),t==""&&this.query)return;if(t=="*")return this.regex=om,this;t="^"+t;let r=t[t.length-1];(r=="$"||r=="/")&&(t=t.slice(0,-1)+"(?=/?[#?]|/?$)"),r!="/"&&r!="$"&&t!="^/"&&(t=t+"(?=[/#?]|$)"),this.regex=new RegExp(t)}match(t=this.router.path){var e,r,n;let i,o=this.parent.match(t);if(!o)return null;let l=cm(t),a=l.url,h="";if(o.path&&l.path.indexOf(o.path)==0&&(h=o.path+"/",a=a.slice(h.length)),i=this.regex?a.match(this.regex):[""]){let d=h+i[0],c=[this.$path],v={};if(this.groups.length)for(let m=0,p=jl(i),g=p.length,S;m<g;m++){let w=p[m];(S=this.groups[m-1])&&(v[S]=w,c.push(w))}if(this.query)for(let m=this.query,p=0,g=Object.keys(m),S=g.length,w,y;p<S;p++){w=g[p],y=m[w];let b=w,_=(r=(e=l.query)==null?void 0:e.get)==null?void 0:r.call(e,w);if(y===!1){if(_)return null;c.push("1");continue}if(y[0]==":"&&(b=y.slice(1),y=!0),y==!0&&_||y==_)v[b]=_,c.push(_);else return null}let T=c.join("*");v=(n=this[Al])[T]||(n[T]=v);let u=am(o,v);return u.path=d,u}return null}resolve(t=this.router.path){if(this.raw[0]=="/"&&!this.dynamic)return this.raw.replace(/\$/g,"");let e=this.parent.match(t),r=this.parent.resolve(t),n;if(this.dynamic){let i=this.match(t);return i?i.path:null}return this.raw[0]=="?"?n=(r||"/")+this.raw:n=r+"/"+this.raw,n.replace(/\$/g,"").replace(/\/\/+/g,"/")}};f(Hl,mm,"Route",16);var pm=Hl;function Kl(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}var Ls=Symbol.for("#enter"),Is=Symbol.for("#resolved"),ar=Symbol.for("#leave"),ql=Symbol.for("#afterVisitRouted"),Bl=Symbol.for("#afterVisitRouteTo"),Vt=Symbol.for("#doc"),ct=Symbol.for("#version"),gm=Symbol.for("#routes"),Ul=Symbol.for("#origin"),Ms=Symbol.for("#request"),de=Symbol.for("#hash"),B=Symbol.for("#routeTo"),fe=Symbol.for("#path"),it=Symbol.for("#match"),me=Symbol.for("#options"),vm=Symbol.for("#cache"),Gl=Symbol.for("#unmatched"),yt=Symbol.for("#active"),ym=Symbol.for("#resolvedPath"),bm=Symbol.for("#dataKey"),Sm=Symbol.for("#activeKey"),pe=Symbol.for("#urlKey"),zt=Symbol.for("#dataMap"),Ht=Symbol.for("#href"),A=Symbol.for("#route"),Wl=Symbol.for("#context"),Yl=Symbol.for("#afterVisit"),Xl=Symbol.for("#routeHandler"),wm=Symbol.for("#parentNode"),xm=Symbol.for("#visitContext"),Ql=Symbol.for("##visitContext"),_m=Symbol.for("#attachToParent"),Tm=Symbol.for("#detachFromParent"),Jl=Symbol.for("#router");function Zh(){return globalThis.imba.use_router=!0,!0}var tu=Ws(function(){return globalThis.document.router}),Em=Symbol(),Zl=class extends E{constructor(t,e={}){super(),this[Vt]=t,this[ct]=0,this[gm]={},this.aliases={},this.redirects={},this.rules={},this.matchers={},this.options=e,this.busy=[],this.queue=new en,this.root=new fm(this),this.location=new or(e.url||t.location.href,this),this.history=new sm(this),this.mode=e.mode||"history",this.queue.on("busy",function(){return globalThis.document.flags.incr("_routing_")}),this.queue.on("idle",function(){return globalThis.document.flags.decr("_routing_"),L()}),this.setup()}get origin(){return this[Ul]||(this[Ul]=this[Vt].location.origin)}get query(){return this.location.query}init(){return this.refresh({mode:"replace"}),this}alias(t,e){return this.aliases[t]=e,this.location.reparse(),this}touch(){return this[ct]++}option(t,e){return e==null?this.options[t]:(this.options[t]=e,this)}get realpath(){let t=this[Vt].location;return t.href.slice(t.origin.length)}get state(){return this.history.state}get states(){return this.history.currentStates}set state(t){this.state.data=t,this.state.save()}get ctx(){return this[Ms]}pushState(t,e,r){return this.history.pushState(t,e||null,String(r))}replaceState(t,e,r){return this.history.replaceState(t,e||null,String(r))}refresh(t={}){var e=this;if(this.refreshing)return;this.refreshing=!0;let r=this.location,n=or.parse(t.location||this.realpath,this),i=t.mode,o=this[Ms];if(!n.equals(r)||!o||t.state){let l=new Rl(this,n,r,t);this[Ms]=l,this.emit("beforechange",l),l.aborted&&(!l.forceAbort&&globalThis.window.confirm("Are you sure you want to leave? You might have unsaved changes")?l.aborted=!1:i=="pop"?this.pushState(this.state,null,String(r)):i=="replace"&&this.replaceState(this.state,null,String(r))),l.aborted||(this.location=l.location,i=="push"?this.pushState(l.state,null,String(this.location)):i=="replace"?this.replaceState(l.state,null,String(this.location)):i=="pop"&&(this.history.index=t.index),this.refreshing=!1,this.emit("change",l),this.touch(),L())}return P.add(function(){let l=e[Vt].location.hash;if(l!=e[de])return e.emit("hashchange",e[de]=l)}),this.refreshing=!1,this}onpopstate(t){let e=this.history.index,r=e,n={pop:!0,index:0,from:e,mode:"pop"};try{if(typeof t.state=="string"){let[i,o]=t.state.split("|");r=n.index=parseInt(o),r<e?n.revert=this.history.slice(r+1,e+1).reverse():r>e&&(n.apply=this.history.slice(e+1,r+1))}}catch{}return this.refresh(n),this}onbeforeunload(t){let e=new Rl(this,null,this.location,{mode:"unload"});if(this.emit("beforechange",e),e.aborted)return!0}onhashchange(t){return this.emit("hashchange",this[de]=this[Vt].location.hash),L()}setup(){this.onclick=this.onclick.bind(this),this.onhashchange=this.onhashchange.bind(this);let t=globalThis.window;return this[de]=this[Vt].location.hash,this.location=or.parse(this.realpath,this),t.onpopstate=this.onpopstate.bind(this),t.onbeforeunload=this.onbeforeunload.bind(this),t.addEventListener("hashchange",this.onhashchange),t.addEventListener("click",this.onclick,{capture:!0}),t.document.documentElement.emit("routerinit",this),this.refresh,this}onclick(t){if(t.metaKey||t.altKey)return;let e=null,r=null,n=t.target;for(;n&&(!e||!r);)!e&&n.nodeName=="A"&&(e=n),!r&&n[B]&&(r=n),n=n.parentNode;if(e&&r!=e&&(!r||r.contains(e))){let i=e.getAttribute("href");i&&!i.match(/\:\/\//)&&(!e.getAttribute("target")||e.getAttribute("target")=="_self")&&!e.classList.contains("external")&&e.addEventListener("click",this.onclicklink.bind(this),{once:!0})}return!0}onclicklink(t){let e=t.currentTarget||t.target;e[B]&&e[B].resolve();let r=e.getAttribute("href"),n=new URL(e.href),i=n.href.slice(n.origin.length),o=this.realpath.split("#")[0],l=i.split("#")[0];return o==l?globalThis.document.location.hash=n.hash:e[B]?e[B].go():this.go(i),t.stopPropagation(),t.preventDefault()}get url(){return this.location.url}get path(){let t=this.location.path;return this.aliases[t]||t}get pathname(){return this.location.pathname}serializeParams(t){var e;if(Kl(t,Object)){e=[];for(let r=0,n=Object.keys(t),i=n.length,o,l;r<i;r++)o=n[r],l=t[o],e.push([o,globalThis.encodeURI(l)].join("="));return e.join("&")}return t||""}get hash(){return this[de]}set hash(t){let e="#"+this.serializeParams(t);globalThis.history.replaceState(this.state,null,e)}match(t){return this.route(t).match(this.path)}route(t){return this.root.route(t)}go(t,e=null){if(typeof t=="object"&&e===null&&(e=t,t=this.path),typeof t=="number")return globalThis.history.go(t),this;let r=this.location.clone().update(t),n=this.history.buildState(e,r.path,!0);return this.refresh({push:!0,mode:"push",location:r,state:n,apply:[n]}),this}replace(t,e=null){typeof t=="object"&&e===null&&(e=t,t=this.path);let r=this.location.clone().update(t),n=this.history.buildState(e,r.path,!1);return this.refresh({replace:!0,mode:"replace",location:r,state:n,apply:[n]})}};f(Zl,Em,"Router",16);var En=Zl,$m=Symbol(),ta=class{constructor(t,e,r,n={}){this.parent=r,this.node=t,this[fe]=e,this[it]=null,this[me]=n,this[vm]={},this[Gl]={},this[yt]=null,this[ym]=null,this[bm]=Symbol(),this[Sm]=Symbol(),this[pe]=Symbol()}get router(){return this.node.ownerDocument.router}get route(){var t,e;return(e=(t=(this.parent?this.parent.route:this.router)||this.router)==null?void 0:t.route)==null?void 0:e.call(t,this[fe])}get match(){return this[it]}get params(){return this[it]||this[Gl]}get state(){let t=this[zt]||(this[zt]=new Map),e=this.params,r=this[zt].get(e);return r||this[zt].set(e,r={}),r}set state(t){(this[zt]||(this[zt]=new Map)).set(this.params,t)}set path(t){this[fe]!=t&&(this[fe]=t,!0)&&this.router.touch()}get path(){return this[fe]}get isActive(){return!!this[yt]}get active\u03A6(){return!!this[yt]}resolve(){let t=this.router[ct];if(!(this[ct]!=t&&(this[ct]=t,!0)))return;let e=this.route,r=this[me],n=this.router.path,i=e.match(n),o=this[yt],l=this[it],a=i!=l,h=i&&i[this[pe]];return i&&(this[yt]=!0,this[it]=i,i[this[pe]]=n),i&&(a||h!=n||!o)&&this[Is](i,l,h),!o&&i&&this[Ls](),!i&&(o||o===null)&&(this[yt]=!1,this[ar]()),this[it]}[Ls](){var t,e;return this.node.flags.remove("not-routed"),this.node.flags.add("routed"),(e=(t=this.node)==null?void 0:t.routeDidEnter)==null?void 0:e.call(t,this)}[Is](t,e,r=""){var n,i;return(i=(n=this.node)==null?void 0:n.routeDidResolve)==null?void 0:i.call(n,this,t,e,r)}[ar](){var t,e;return this.node.flags.add("not-routed"),this.node.flags.remove("routed"),(e=(t=this.node)==null?void 0:t.routeDidLeave)==null?void 0:e.call(t,this)}};f(ta,$m,"ElementRoute",16);var Cr=ta,km=Symbol(),ea=class extends Cr{[Ls](){return this}[Is](){return this}[ar](){return this}resolve(){let t=this.router[ct];if(!(this[ct]!=t&&(this[ct]=t,!0)))return;let e=this[me],r=this.route,n=this.router.path,i=this.route.resolve(n),o=this.route.match(n);o&&(this[it]=o,this[it][this[pe]]=n),e.sticky&&this[it]&&(i=this[it][this[pe]]),this[Ht]!=i&&(this[Ht]=i,!0)&&this.node.nodeName=="A"&&this.node.setAttribute("href",i),this.node.flags.toggle("active",!!o)}get url(){return this.resolve(),globalThis.location.origin+this[Ht]}go(){return this.resolve(),this[me]&&this[me].replace?this.router.replace(this[Ht]):this.router.path==this[Ht]?!0:this.router.go(this[Ht])}};f(ea,km,"ElementRouteTo",0);var $n=ea,Nm=Symbol(),ra=class{get router(){return this.ownerDocument.router}};f(ra,Nm,"Node",1,Node);var Yg=ra,Om=Symbol(),sa=class{set route(t){if(t==null)return;if(this[A]){this[A].path=t;return}let e=t[0]!="/"?this[Wl].route:null;this[A]=new Cr(this,t,e,this.route__),this[Yl]=this[ql]}get route(){return this[A]}set route\u039Eto(t){var e=this;if(t==null)return;if(this[B]){this[B].path=t;return}let r=t[0]!="/"?this[Wl].route:null;this[A]=this[B]=new $n(this,t,r,this.routeTo__),this[Yl]=this[Bl],this.onclick=function(n){if(!n.altKey&&!n.metaKey&&!n[Xl])return n.preventDefault(),n[Xl]=e[B],e[B].go()}}[ql](){if(this[A]){let t=this[wm],e=t&&t[xm];if(e&&e.matchedRoute&&e.matchedRoute!=this[A]){this[A][yt]!=!1&&(this[A][yt]=!1,!0)&&(this[A][ar](),this[A][ct]=-1);return}if(this[A].resolve(),this[A].active\u03A6)e.matchedRoute=this[A];else return}if(this.visit&&this.visit(),this[Ql])return this[Ql]=null}[Bl](){if(this[B]&&this[B].resolve(),this.visit)return this.visit()}routeDidEnter(t){return this[_m]()}routeDidLeave(t){return this[Tm]()}routeDidResolve(t,e,r){var n=this;Kl(this.routed,Function)&&e!=r&&this.router.queue.add(async function(){n.suspend();let i=await n.routed(e,t.state,r);return n.unsuspend()})}};f(sa,Om,"Element",1,Element);var Qg=sa,Cm=Symbol(),na=class{get router(){return this[Jl]||(this[Jl]=new En(this))}};f(na,Cm,"Document",1,Document);var Zg=na;function hr(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function R(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var ge=Symbol.for("##reactive"),_t=Symbol.for("##referenced"),ve=Symbol.for("##dereferenced"),ur=Symbol.for("#map"),ia=Symbol.for("#__init__"),cr=Symbol.for("#child"),Fs=Symbol.for("##spy"),ye=Symbol.for("#reactions"),Rs=Symbol.for("#promise"),$={TOUCHING:2,STALE:4,OBJECT:8,RUNNING:16,INVALIDATING:32,POSSIBLY_STALE:64,AUTORUN:128,DEACTIVATED:256},k=0,oa=!1,Tt=null,Pm=0,la=1,js={META:new Map,VALUE:new Map,REF:new Map},D,Yt={root:null,ctx:null,get context(){return x},get atomics(){return Tt},get ownref(){return M},flush(){if(x==D)return D.flush()}},M=Symbol.for("~"),aa=Symbol.for("~~"),As=function(s,t){return t.has(s)||t.set(s,Symbol()),t.get(s)},dr=function(s){return typeof s=="symbol"?As(s,js.VALUE):Symbol.for(s)},Ds=function(s){return typeof s=="symbol"?As(s,js.META):Symbol.for("#"+s+"__")},fr=function(s){return typeof s=="symbol"?As(s,js.REF):Symbol.for("~"+s)},N=function(s,t){return k&&x.add(s[M]),t},U=function(s,t){return s[M].$$invalidated(0),t},Kt=function(s,t,e){let r=s[M];return r||(r=s[M]=new Xt,Object.defineProperties(s,e)),t&&r.addSubscriber(t),s},Vs=function(s,t){let e=s[M];return e&&e.removeSubscriber(t),s},Lm=Symbol(),ha=class{constructor(t){this.changes=new Map,this.cleanup(),t&&this.reset(t)}reset(t=[]){return this.array=t,this.initialLength=t.length}cleanup(){return this.idx=0,this.array=null,this.changes.clear(),this.dirty=!1}push(t){if(this.initialLength==0){this.array.indexOf(t)<0&&(this.changes.set(t,1),this.array.push(t),this.idx++);return}let e=this.idx,r=this.array[e];if(r===t)++this.idx;else{if(e>0&&this.array[e-1]===t)return;let n=this.array.indexOf(t),i=this.changes.get(t);if(n===-1)this.array.splice(e,0,t),this.changes.set(t,1),this.idx++;else{if(n<e)return;n===e+1?(r&&this.changes.set(r,-1),this.array.splice(e,1),++this.idx):(n>e&&this.array.splice(n,1),this.array.splice(e,0,t))}i==-1&&this.changes.delete(t)}}end(){if(this.array.length>=this.idx)for(;this.array.length>this.idx;)this.changes.set(this.array.pop(),-1);return this.array}patch(){return this.end()}};f(ha,Lm,"ArrayPatcher",16);var Im=ha;function zs(s){var t,e;let r=Object.getOwnPropertyDescriptors(s.prototype);return t=r.name,delete r.name,e=r.constructor,delete r.constructor,r}function Mm(){if(oa!=!0&&(oa=!0,!0))return tn.on("inited",function(s){let t=s[aa];if(t){let e=globalThis.Node&&hr(s,globalThis.Node),r=s[M]||(s[M]={});for(let n=0,i=Object.keys(t),o=i.length,l,a;n<o;n++){l=i[n],a=t[l];let h=r[l]=new Se(s[l],s,a);e||h.call()}e&&(ot(s,"mount",function(){for(let n=0,i=R(Object.values(r)),o=i.length;n<o;n++){let l=i[n];hr(l,Se)&&l.activate()}}),ot(s,"unmount",function(){for(let n=0,i=R(Object.values(r)),o=i.length;n<o;n++){let l=i[n];hr(l,Se)&&l.deactivate()}}))}})}function Fm(s,t=aa){return s.hasOwnProperty(t)||(s[t]=Object.assign({},s[t]||{})),s[t]}var Rm=Symbol(),ua=class eu{constructor(t,e=0){this.depth=e,this.parent=t,this.target=null,this.spy=null,this.patcher=new Im}get active\u03A6(){return x==this}get root\u03A6(){return this==D}get snapshot(){let t=[],e=this[cr];for(;e&&e.target;)t.push({depth:e.depth,target:e.target,beacon:e.beacon}),e=e[cr];return t}reset(t){var e,r;this.target=t,this.beacon=t.beacon;let n=this.spy=t[Fs];return this.tracking=n&&(e=n.tracking)!=null?e:!0,this.patcher.reset(t.observing||(t.observing=[])),n&&((r=n?.enter)==null||r.call(n,this)),this}add(t,e){var r,n;this.tracking&&t&&this.beacon&&this.patcher.push(t),this.spy&&((n=(r=this.spy)==null?void 0:r.observed)==null||n.call(r,this,t,e))}react(t){var e,r;return this.spy&&((r=(e=this.spy)==null?void 0:e.react)==null||r.call(e,this,t)),D.reactions.add(t)}push(t){return Yt.ctx=x=this.child.reset(t)}pop(){var t,e;let r=null;if(this.beacon){r=this.patcher.end();let n=this.patcher.changes;if(n.size)for(let[i,o]of R(n))o===1?i.addSubscriber(this.beacon):i.removeSubscriber(this.beacon)}return this.spy&&((e=(t=this.spy)==null?void 0:t.leave)==null||e.call(t,this)),this.patcher.cleanup(),this.target=this.beacon=null,x=this.parent,x==D?(D.flush(),Yt.ctx=null):Yt.ctx=x,r}get child(){return this[cr]||(this[cr]=new eu(this,this.depth+1))}get reactions(){return this[ye]||(this[ye]=new Set)}flush(){if(!this[ye])return;let t=this[ye];this[ye]=null;for(let e of R(t))e.call()}};f(ua,Rm,"Context",16);var jm=ua,Am=Symbol(),ca=class extends jm{add(){return!0}};f(ca,Am,"Root",0);var Dm=ca,x=D=Yt.root=new Dm(null,0),Vm=function(){return x.tracking=!1},da=function(s,t,e,r,n){let i=s[e],o=s[n];return o||(o=s[n]=new Xt(r,t,i)),x.add(o,s),i},fa=function(s,t,e,r,n,i){let o=s[e];if(r!=o){s[e]=r;let l=s[i];l&&l.changed(0,r,o)}},zm=Symbol(),ma=class{constructor(t,e,r){return this.id=la++,this.observer=null,this.observers=null,this.v=0,this.o=t||null,r&&r[_t]&&r[_t](this),this}get $$v(){return this.v}changed(t,e,r){if(Pm++,this.v++,r&&r[ve]&&r[ve](this,e),e&&e[_t]&&e[_t](this,r),this.observer&&this.observer.$$invalidated(t+1,this,e,r),this.observers)for(let n of R(this.observers))n.$$invalidated(t+1,this,e,r);x==D&&x.flush()}invalidated(t,e){return console.warn("Ref.invalidated is deprecated - use $$invalidated"),this.$$invalidated(t,e)}$$invalidated(t,e){if(Tt)return Tt.add(this),!0;if(this.v++,t>30){console.warn("Ref observer chain too deep",this,e);return}if(this.observer&&this.observer.$$invalidated(t+1,this),this.observers)for(let r of R(this.observers))r.$$invalidated(t+1,this);return t==0&&x==D&&x.flush(),!0}addSubscriber(t){this.observer?(this.observers||(this.observers=new Set),this.observers.add(t)):this.observer=t}removeSubscriber(t){this.observer==t&&(this.observer=null);let e=this.observers;e&&e.delete(t)}reportChanged(){return this.changed(0)}reportObserved(t){return x.add(this,t)}};f(ma,zm,"Ref",16);var Xt=ma;function ru(s){return new Xt(null,s,null)}var Hm=Symbol(),pa=class extends Array{push(){return U(this,super.push(...arguments))}pop(){return U(this,super.pop(...arguments))}unshift(){return U(this,super.unshift(...arguments))}shift(){return U(this,super.shift(...arguments))}splice(){return U(this,super.splice(...arguments))}at(){return N(this,super.at(...arguments))}map(){return N(this,super.map(...arguments))}flatMap(){return N(this,super.flatMap(...arguments))}flat(){return N(this,super.flat(...arguments))}filter(){return N(this,super.filter(...arguments))}find(){return N(this,super.find(...arguments))}slice(){return N(this,super.slice(...arguments))}sort(){return N(this,super.sort(...arguments))}get len(){return N(this,this.length)}set len(t){this.length=t,U(this)}toIterable(){return k&&x.add(this[M]),this}[Symbol.iterator](){return N(this,super[Symbol.iterator](...arguments))}};f(pa,Hm,"ObservableArray",8);var kn=pa,ga=zs(kn),Km=Symbol(),va=class{get len(){return this.length}set len(t){this.length=t}get[ge](){return Kt(this,null,ga)}[_t](t){return Kt(this,t,ga)}[ve](t){return Vs(this,t)}};f(va,Km,"Array",1,Array);var iv=va,ya=Set.prototype.has,qm=Symbol(),ba=class extends Set{has(){return N(this,super.has(...arguments))}keys(){return N(this,super.keys(...arguments))}values(){return N(this,super.values(...arguments))}entries(){return N(this,super.entries(...arguments))}add(t){return ya.call(this,t)?this:U(this,super.add(...arguments))}delete(t){return ya.call(this,t)?U(this,super.delete(...arguments)):this}clear(){return this.size?U(this,super.clear(...arguments)):this}};f(ba,qm,"ObservableSet",8);var Bm=ba,Sa=zs(Bm),Um=Symbol(),wa=class{get[ge](){return Kt(this,null,Sa)}[_t](t){return Kt(this,t,Sa)}[ve](t){return Vs(this,t)}};f(wa,Um,"Set",1,Set);var av=wa,Gm=Symbol(),xa=class extends Map{get(){return N(this,super.get(...arguments))}has(){return N(this,super.has(...arguments))}keys(){return N(this,super.keys(...arguments))}values(){return N(this,super.values(...arguments))}entries(){return N(this,super.entries(...arguments))}set(){return U(this,super.set(...arguments))}clear(){return U(this,super.clear(...arguments))}delete(){return U(this,super.delete(...arguments))}};f(xa,Gm,"ObservableMap",8);var Wm=xa,_a=zs(Wm),Ym=Symbol(),Ta=class{get[ge](){return Kt(this,null,_a)}[_t](t){return Kt(this,t,_a)}[ve](t){return Vs(this,t)}};f(Ta,Ym,"Map",1,Map);var cv=Ta,Xm=Symbol(),Ea=class{constructor(t,e={}){var r,n=this;this.name=t,this.options=e;let i=this.key=dr(t),o=fr(t),l=this.descriptor={enumerable:(r=e.enumerable)!=null?r:!0,configurable:!1,get:function(){return k?da(this,t,i,n,o):this[i]},set:function(h){return k||this[o]?fa(this,t,i,h,n,o):this[i]=h}},a=this.lazyDescriptor={enumerable:!1,configurable:!0,get:function(){return k?(Object.defineProperty(this,t,l),this[t]):this[i]},set:function(h){return this[i]=h,this[o]=null,Object.defineProperty(this,t,l)}}}};f(Ea,Xm,"PropertyType",16);var Qm=Ea,Jm=Symbol(),$a=class{constructor(t=null){this[ia](t)}[ia](t=null,e=!0,r=!0){var n;this[ur]=t&&(n=t[ur])!==void 0?n:new Map}for(t){let e=this[ur].get(t);return e||this[ur].set(t,e=[]),e}get(t){let e=this.for(t);return e[M]||e[ge],k&&N(e),e}add(t,e){return this.for(t).push(e)}delete(t,e){let r=this.for(t),n=r.indexOf(e);r.splice(n,1)}};f($a,Jm,"RefIndex",16);var Zm=$a,tp=Symbol(),ka=class{constructor(t,e){var r=this;this.name=t,this.key=e,this.index=new Zm;let n=fr(t),i=this.descriptor={enumerable:!0,configurable:!1,get:function(){return k?da(this,t,e,r,n):this[e]},set:function(l){let a=this[e];if(k||this[n]?fa(this,t,e,l,r,n):this[e]=l,a!=l&&(a&&r.index.delete(a,this),l))return r.index.add(l,this)}},o=this.lazyDescriptor={set:function(l){return this[e]=l,l&&r.index.add(l,this),Object.defineProperty(this,t,i),this[n]=null}}}where(t){return this.index.get(t)}};f(ka,tp,"RefType",16);var ep=ka,rp=Symbol(),Na=class{constructor(t,e,r,n){this.observing=null,this.observers=null,this.flags=68,this.target=t,this.func=e,this.vkey=r,this.type=n,this.v=0}get beacon(){return this}addSubscriber(t){if(t==this){console.warn("@computed depends on itself");return}this.observer?(this.observers||(this.observers=[]),this.observers.push(t)):this.observer=t}removeSubscriber(t){if(this.observer==t)return this.observer=null;let e=this.observers,r=e?e.indexOf(t):-1;r>=0&&e.splice(r,1)}$$invalidated(t,e){if(this.flags|=$.STALE|$.POSSIBLY_STALE,t>40){console.warn("Memo invalidated observer chain too deep",this,e);return}if(this.observer&&this.observer.$$invalidated(t+1,this),!!this.observers){for(let r=0,n=R(this.observers),i=n.length;r<i;r++)n[r].$$invalidated(t+1,this);return this}}deactivate(){if(this.observing)for(let t=0,e=R(this.observing),r=e.length;t<r;t++)e[t].removeSubscriber(this);return this.observing=null,this}value(){if(k&&x.add(this),!(this.flags&$.POSSIBLY_STALE))return this.target[this.vkey];k++,this.flags|=$.RUNNING,x.push(this);let t=this.func.call(this.target);x.pop(this);let e=this.target[this.vkey],r=!1;if(t&&e&&t.constructor===e.constructor&&t instanceof Array){let n=t.length;if(n!=e.length)r=!0;else{let i=0;for(;i<n;){if(t[i]!=e[i]){r=!0;break}i++}}}else r=t!==e;return this.target[this.vkey]=t,this.flags&=~($.STALE|$.POSSIBLY_STALE|$.RUNNING),r&&this.v++,k--,t}};f(Na,rp,"Memo",16);var be=Na,sp=Symbol(),Oa=class{constructor(t,e){var r=this;this.name=t;let n=fr(t),i=dr(t),o=this.descriptor={enumerable:!1,configurable:!1,get:function(){return this[n].value()}},l=this.lazyDescriptor={enumerable:!1,configurable:!0,get:function(){let a=this[n]=new be(this,e,i,r.type);return Object.defineProperty(this,t,o),a.value()}}}};f(Oa,sp,"ComputedType",16);var Nn=Oa,np=Symbol(),Ca=class{get beacon(){return this}constructor(t,e,r={}){this.cb=t,this.context=e,this.options=r,this.flags=0,this.id=la++,this.cachedComputedVersions=new WeakMap,this.checkComputedValues=new Set,this.observing=[],this.timeout=null}get running\u03A6(){return this.flags&$.RUNNING}$$invalidated(t,e){var r,n;e instanceof be?(this.flags|=$.POSSIBLY_STALE,(n=(r=this.checkComputedValues)==null?void 0:r.add)==null||n.call(r,e)):this.flags|=$.STALE,this.observing&&x.react(this)}activate(){return this.observing=[],this.cachedComputedVersions=new WeakMap,this.checkComputedValues=new Set,this.call(),this}deactivate(){if(this.timeout&&clearTimeout(this.timeout),this.observing)for(let t=0,e=R(this.observing),r=e.length;t<r;t++)e[t].removeSubscriber(this);return this.observing=this.checkComputedValues=this.cachedComputedVersions=null,this}call(){var t=this;if(k&&console.warn("should not call reaction inside an autorunning context?",D.snapshot,this),this.flags&$.POSSIBLY_STALE&&!(this.flags&$.STALE)){let e=!1;for(let r of R(this.checkComputedValues)){let n=this.cachedComputedVersions.get(r);r.value();let i=r.v;if(n!=i){e=!0;break}}if(!e){this.flags&=~$.POSSIBLY_STALE,this.checkComputedValues.clear();return}}if(this.options.delay){clearTimeout(this.timeout);let e=this.options.delay;typeof e!="number"&&(e=1e3),this.timeout=setTimeout(function(){return t.run()},e);return}return this.run()}run(){k++,this.flags|=$.RUNNING;let t=x.push(this),e=this.cb.call(this.context,Vm),r=x.pop(this);this.observing=r,this.checkComputedValues.clear();for(let n=0,i=R(r),o=i.length;n<o;n++){let l=i[n];l instanceof be&&this.cachedComputedVersions.set(l,l.v)}return this.flags&=~($.RUNNING|$.STALE|$.POSSIBLY_STALE),k--,this.options.silent||L(),e}dispose(){return this.deactivate(),this.cb=this.context=this.options=null,this}};f(Ca,np,"Reaction",16);var Se=Ca,ip=Symbol(),Pa=class extends Se{resolve(t){return this.deactivate(),this.resolved=t}then(...t){var e=this;return this.resolved!==void 0?Promise.resolve(this.resolved).then(...t):(this[Rs]||(this[Rs]=new Promise(function(r){return e.resolve=function(n){return e.deactivate(),e.resolved=n,r(n)}})),this[Rs].then(...t))}run(){k++,this.flags|=$.RUNNING;let t=x.push(this),e=this.cb.call(this.context),r=x.pop(this);this.observing=r,this.checkComputedValues.clear();for(let n=0,i=R(r),o=i.length;n<o;n++){let l=i[n];l instanceof be&&this.cachedComputedVersions.set(l,l.v)}return this.flags&=~($.RUNNING|$.STALE|$.POSSIBLY_STALE),k--,e!=!1&&e!=null&&e!=null&&(this.resolve(e),this.options.silent||L()),e}};f(Pa,ip,"Awaits",0);var op=Pa,lp=Symbol(),La=class{constructor(t,e){this.scope=e,this.cb=t}get ctx(){return x}run(t=this.scope,e=[],r=!1){x.push(this);try{r&&k++;let n=this.cb.apply(t,e);return r&&k--,x.pop(this),n}catch(n){throw r&&k--,x.pop(this),n}}};f(La,lp,"Action",16);var Pr=La;function su(s,t={}){let e=new Se(s,globalThis,t);return e.call(),e}function nu(s,t={}){let e=new op(s,globalThis,t);return e.call(),e}function iu(s){return s[ge]}function ou(s){let t=Tt,e;if(t)return s();{let r=Tt=new Set;try{e=s()}catch(n){Tt=null;for(let i of R(r))i.$$invalidated(1,r);throw D==x&&D.flush(),n}Tt=null;for(let n of R(r))n.$$invalidated(1,r);return D==x&&D.flush(),e}}function lu(s){return new Pr(s,globalThis).run()}function au(s,t,e=null){s[Fs]||(s[Fs]=s),x.push(s);try{k++;let r=e?t.call(e,s):t(s,e);return k--,x.pop(s),r}catch(r){throw k--,x.pop(s),r}}function hu(s){return s&&s[M]&&s[M].$$invalidated(0),s}function uu(s){return s&&s[M]&&s[M].$$invalidated(0),s}function cu(s,t){return s&&s[M]&&s[M].reportObserved(t),s}function du(s=$.OBJECT){return new Xt}function fu(s){let t=Object.getOwnPropertySymbols(s);for(let e=0,r=R(t),n=r.length;e<n;e++){let i=r[e];hr(s[i],be)&&s[i].deactivate()}return s}function mu(s,t){return s[fr(t)]}function pu(s,t,e){let r=Ds(t);return(s[r]=new Nn(t,e.get)).lazyDescriptor}function gu(s,t,e){let r=Ds(t),n=dr(t),i=this[0]||{},o=s[r]=new Qm(t,i);return e?(Object.defineProperty(s,n,Object.assign({},e)),o.lazyDescriptor):(Object.defineProperty(s,t,o.lazyDescriptor),null)}function vu(s,t,e){let r=Ds(t);return s.constructor[t],(s[r]=new ep(t,dr(t))).lazyDescriptor}function yu(s,t,e){let r=Fm(s),n=this[0]||{};return n.flags=$.AUTORUN,Mm(),r[t]=n,e}function bu(s,t,e){if(e.value){let r=new Pr(e.value,null);e.value=function(){return r.run(this,arguments)}}return e}function ap(s,t){var e;return typeof t=="string"?typeof s===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,s)}function hp(s){let t;return s&&((t=s.toIterable)?t.call(s):s)}var Ia=Symbol.for("#__init__"),mr=Symbol.for("#watchers");function Su(s,t,e,r,n,i){return s&&ap(s.$accessor,Function)?s=s.$accessor(t,e,r,n,i):i[n]=s,s&&!(s!=null&&s.$init)&&(s.$init=s.$set||function(){return!0}),s}function wu(s){return s}var up=Symbol(),Ma=class{constructor(t=null){this[Ia](t)}[Ia](t=null,e=!0,r=!0){var n;this.local=t&&(n=t.local)!==void 0?n:!1,this.session=t&&(n=t.session)!==void 0?n:!1,this.weak=t&&(n=t.weak)!==void 0?n:!1}watch(t){return(this[mr]||(this[mr]=[])).push(t)}$get(t,e){return t[e]}$set(t,e,r,n){if(this[mr]){let i=this.$get(e,r,n);if(i!=t){e[r]=t;for(let o=0,l=hp(this[mr]),a=l.length;o<a;o++){let h=l[o].call(e,t,i,this)}}}else e[r]=t}$accessor(t,e,r,n,i){return i[n]=this}};f(Ma,up,"Accessor",16);var On=Ma;function xu(){return new On}