UNPKG

imba

Version:

Intuitive and powerful language for building webapps that fly

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