UNPKG

imba

Version:

Intuitive and powerful language for building webapps that fly

9 lines (8 loc) 115 kB
var Pl=Object.create,or=Object.defineProperty,kl=Object.getPrototypeOf,Ll=Object.prototype.hasOwnProperty,Ml=Object.getOwnPropertyNames,Fl=Object.getOwnPropertyDescriptor;var Il=i=>or(i,"__esModule",{value:!0});var Dl=(i,t)=>()=>(t||(t={exports:{}},i(t.exports,t)),t.exports);var Rl=(i,t,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ml(t))!Ll.call(i,r)&&r!=="default"&&or(i,r,{get:()=>t[r],enumerable:!(e=Fl(t,r))||e.enumerable});return i},Al=i=>Rl(Il(or(i!=null?Pl(kl(i)):{},"default",i&&i.__esModule&&"default"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var Io=Dl((id,hi)=>{"use strict";var Pt=typeof Reflect=="object"?Reflect:null,Oo=Pt&&typeof Pt.apply=="function"?Pt.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},Ve;Pt&&typeof Pt.ownKeys=="function"?Ve=Pt.ownKeys:Object.getOwnPropertySymbols?Ve=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Ve=function(t){return Object.getOwnPropertyNames(t)};function va(i){console&&console.warn&&console.warn(i)}var No=Number.isNaN||function(t){return t!==t};function S(){S.init.call(this)}hi.exports=S;hi.exports.once=xa;S.EventEmitter=S;S.prototype._events=void 0;S.prototype._eventsCount=0;S.prototype._maxListeners=void 0;var Co=10;function He(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(S,"defaultMaxListeners",{enumerable:!0,get:function(){return Co},set:function(i){if(typeof i!="number"||i<0||No(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");Co=i}});S.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};S.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||No(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 $o(i){return i._maxListeners===void 0?S.defaultMaxListeners:i._maxListeners}S.prototype.getMaxListeners=function(){return $o(this)};S.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")Oo(h,this,e);else for(var a=h.length,c=Po(h,a),r=0;r<a;++r)Oo(c[r],this,e);return!0};function ko(i,t,e,r){var s,n,o;if(He(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=$o(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,va(l)}return i}S.prototype.addListener=function(t,e){return ko(this,t,e,!1)};S.prototype.on=S.prototype.addListener;S.prototype.prependListener=function(t,e){return ko(this,t,e,!0)};function Sa(){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 Lo(i,t,e){var r={fired:!1,wrapFn:void 0,target:i,type:t,listener:e},s=Sa.bind(r);return s.listener=e,r.wrapFn=s,s}S.prototype.once=function(t,e){return He(e),this.on(t,Lo(this,t,e)),this};S.prototype.prependOnceListener=function(t,e){return He(e),this.prependListener(t,Lo(this,t,e)),this};S.prototype.removeListener=function(t,e){var r,s,n,o,l;if(He(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():wa(r,n),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,l||e)}return this};S.prototype.off=S.prototype.removeListener;S.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 Mo(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?Ea(s):Po(s,s.length)}S.prototype.listeners=function(t){return Mo(this,t,!0)};S.prototype.rawListeners=function(t){return Mo(this,t,!1)};S.listenerCount=function(i,t){return typeof i.listenerCount=="function"?i.listenerCount(t):Fo.call(i,t)};S.prototype.listenerCount=Fo;function Fo(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}S.prototype.eventNames=function(){return this._eventsCount>0?Ve(this._events):[]};function Po(i,t){for(var e=new Array(t),r=0;r<t;++r)e[r]=i[r];return e}function wa(i,t){for(;t+1<i.length;t++)i[t]=i[t+1];i.pop()}function Ea(i){for(var t=new Array(i.length),e=0;e<t.length;++e)t[e]=i[e].listener||i[e];return t}function xa(i,t){return new Promise(function(e,r){function s(){n!==void 0&&i.removeListener("error",n),e([].slice.call(arguments))}var n;t!=="error"&&(n=function(l){i.removeListener(t,s),r(l)},i.once("error",n)),i.once(t,s)})}});function ue(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var ef=Symbol.for("#__initor__"),rf=Symbol.for("#__inited__"),jl=Symbol.for("#type"),ae=Symbol.for("#__listeners__"),ql=/-./g,lr=class{static for(t){return new Proxy({},new this(t))}constructor(t){this.getter=t}get target(){return this.getter()}get(t,e){return this.target[e]}set(t,e,r){return this.target[e]=r,!0}};function hr(i,t={}){return new Proxy(t,new lr(i))}function yt(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 zl(i){let t=new Map,e=[],r=!1,s=function(h,a){if(a&&a[jl]&&h!==""){let c=t.get(a);return t.has(a)||(t.set(a,c="$$"+e.length+"$$"),e.push(a)),h==null?a:c}return a},n=JSON.stringify(i,s,2),o=0;for(r=!0;o<e.length;)e[o]=JSON.stringify(e[o],s,2),o++;let l="";for(let h=0,a=ue(e),c=a.length;h<c;h++){let u=a[h];l+='"$$'+h+'$$":'+u+`, `}return n="{"+l+n.slice(1),n}function Kl(i,t=null){let e={},r=/\$\$\d+\$\$/,s=function(l){return e[l]||(e[l]=t?t(l):{})},n=function(l,h){if(typeof h=="string"){if(h[0]=="$"&&r.test(h))return s(h)}else if(typeof l=="string"&&l[0]=="$"&&r.test(l)){let a=s(l);return Object.assign(a,h),a}return h};return JSON.parse(i,n)}function Vl(i,t){var e,r,s,n;let o={},l={added:[],changed:[],removed:[],all:[],urls:{}};if(i.assets)for(let h=0,a=ue(i.assets),c=a.length;h<c;h++){let u=a[h],d=u.originalPath||u.path;o[d]=u,u.url&&((e=t.urls)[r=u.url]||(e[r]=u))}for(let h=0,a=ue(t.assets||[]),c=a.length;h<c;h++){let u=a[h],d=u.originalPath||u.path,b=o[d];u.url&&i.urls&&(i.urls[u.url]=u),b?(b.hash!=u.hash&&(b.invalidated=Date.now(),b.replacedBy=u,u.replaces=b,l.changed.push(u),l.all.push(u),b==i.main&&(l.main=u)),s=o[d],delete o[d]):(l.added.push(u),l.all.push(u))}for(let h=0,a=Object.keys(o),c=a.length,u,d;h<c;h++)u=a[h],d=o[u],d.removed=Date.now(),l.all.push(d);for(let h=0,a=ue(l.all),c=a.length;h<c;h++){let u=a[h];(l[n=u.type]||(l[n]=[])).push(u)}return l.removed=Object.values(o),t.changes=l,t}function Hl(i){return i.indexOf("-")>=0?i.replace(ql,function(t){return t.charAt(1).toUpperCase()}):i}function It(i,t,e){if(!i)return;let r=Object.getOwnPropertyDescriptor(i,t);return r||i==e?r||void 0:It(Reflect.getPrototypeOf(i),t,e)}var Pi=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 R(i,t,e,r){var s;let n,o,l;return n=i[ae]||(i[ae]={}),o=n[t]||(n[t]={}),l=o.tail||(o.tail=o.next={}),l.listener=e,l.path=r,o.tail=l.next={},l}function F(i,t,e){let r=R(i,t,e);return r.times=1,r}function ct(i,t,e,r){let s,n,o=i[ae];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 A(i,t,e){let r;(r=i[ae])&&(r[t]&&Pi(t,e,r[t]),r.all&&Pi(t,[t,e],r.all))}function Ul(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var ki=Symbol.for("#__init__"),nf=Symbol.for("#__initor__"),of=Symbol.for("#__inited__"),Li=Symbol.for("#schedule"),ur=Symbol.for("#frames"),fe=Symbol.for("#interval"),_t=Symbol.for("#stage"),bt=Symbol.for("#scheduled"),ce=Symbol.for("#version"),Bl=Symbol.for("#fps"),Mi=Symbol.for("#ticker"),Yl=globalThis.requestAnimationFrame||function(i){return globalThis.setTimeout(i,1e3/60)};var lf=1/60,Fi=class{constructor(t=null){this[ki](t)}[ki](t=null){var e;this.owner=t&&(e=t.owner)!==void 0?e:null,this.target=t&&(e=t.target)!==void 0?e:null,this.active=t&&(e=t.active)!==void 0?e:!1,this.value=t&&(e=t.value)!==void 0?e:void 0,this.skip=t&&(e=t.skip)!==void 0?e:0,this.last=t&&(e=t.last)!==void 0?e:0}tick(t,e){return this.last=this.owner[ur],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/(1e3/60)<=2?this.owner.on("raf",this):this[fe]=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[fe]&&(globalThis.clearInterval(this[fe]),this[fe]=null),this.active=!1,this}},ar=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[_t]=-1,this[ur]=0,this[bt]=!1,this[ce]=0,this.listeners={},this.intervals={},t.commit=function(){return t.add("commit"),t},this[Bl]=0,t.$promise=null,t.$resolve=null,this[Mi]=function(e){return t[bt]=!1,t.tick(e)}}touch(){return this[ce]++}get version(){return this[ce]}add(t,e){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[bt]||this[Li](),this}get committingΦ(){return this.queue.indexOf("commit")>=0}get syncingΦ(){return this[_t]==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 t.$promise||(t.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let r=this.queue,s=this[ur]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[_t]=1,this[ce]++,r.length)for(let n=0,o=Ul(r),l=o.length;n<l;n++){let h=o[n];typeof h=="string"&&this.listeners[h]?e.listeners[h].forEach(function(a){if(a.tick instanceof Function)return a.tick(e,h);if(a instanceof Function)return a(e,h)}):h instanceof Function?h(e.dt,e):h.tick&&h.tick(e.dt,e)}return this[_t]=this[bt]?0:-1,e.$promise&&(e.$resolve(e),e.$promise=e.$resolve=null),e.listeners.raf&&e.add("raf"),e}[Li](){return this[bt]||(this[bt]=!0,this[_t]==-1&&(this[_t]=0),Yl(this[Mi])),this}schedule(t,e){var r,s;return e||(e=t[r=this.id]||(t[r]={value:!0})),(e[s=this.id]||(e[s]=new Fi({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=new ar;function k(){return C.add("commit").promise}function Ii(i,t){return globalThis.setTimeout(function(){i(),k()},t)}function Di(i,t){return globalThis.setInterval(function(){i(),k()},t)}var Ri=globalThis.clearInterval,Ai=globalThis.clearTimeout,Dt=globalThis.imba||(globalThis.imba={});Dt.commit=k;Dt.setTimeout=Ii;Dt.setInterval=Di;Dt.clearInterval=Ri;Dt.clearTimeout=Ai;var uf=Symbol.for("#__initor__"),af=Symbol.for("#__inited__"),ji=class{constructor(){this.data={}}},fr=new ji;var Wl={};var pf=Symbol.for("#__initor__"),mf=Symbol.for("#__inited__"),qi=Symbol.for("#__init__"),zi=Symbol.for("#warned"),vt=Symbol.for("#asset"),de=class{static wrap(t){let e=new de(t);return new Proxy(e,e)}constructor(t){this.meta=t}get input(){return fr.inputs[this.meta.input]}get asset(){return globalThis._MF_?this.meta:this.input?this.input.asset:null}set(t,e,r){return!0}get(t,e){return this.meta.meta&&this.meta.meta[e]!=null?this.meta.meta[e]:this.asset?e=="absPath"&&!this.asset.absPath?this.asset.url:this.asset[e]:((this.meta[zi]!=!0?(this.meta[zi]=!0,!0):!1)&&console.warn("Asset for '"+this.meta.input+"' not found"),e=="valueOf"?function(){return""}:null)}},Ki=class{constructor(t=null){this[qi](t)}[qi](t=null){this.url=t?t.url:void 0,this.meta=t?t.meta:void 0}adoptNode(t){var e;if((e=this.meta)==null?void 0:e.content){for(let r=this.meta.attributes,s=0,n=Object.keys(r),o=n.length,l,h;s<o;s++)l=n[s],h=r[l],t.setAttribute(l,h);t.innerHTML=this.meta.content}return this}toString(){return this.url}toStyleString(){return"url("+this.url+")"}};function Gl(i){var t,e;if(i[vt])return i[vt];if(i.type=="svg")return i[vt]||(i[vt]=new Ki(i));if(i.input){let r=globalThis._MF_&&globalThis._MF_[i.input];return r&&(Object.assign(i,r),i.toString=function(){return this.absPath}),i[vt]||(i[vt]=de.wrap(i))}return i}var cr={on:function(i,t){return R(this,i,t)},inited:function(i){return A(this,"inited",[i])}};function Xl(){return!0}function Ql(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}var Vi=Symbol.for("#toStringDeopt"),vf=Symbol.for("#__initor__"),xf=Symbol.for("#__inited__"),Hi=Symbol.for("#symbols"),Ui=Symbol.for("#batches"),Bi=Symbol.for("#extras"),Yi=Symbol.for("#stacks"),Rt=class{constructor(t){this.dom=t,this.string=""}contains(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)}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){let r=this[Hi],s=this[Ui],n=!0;if(!r)r=this[Hi]=[t],s=this[Ui]=[e||""],this.toString=this.valueOf=this[Vi];else{let o=r.indexOf(t),l=e||"";o==-1?(r.push(t),s.push(l)):s[o]!=l?s[o]=l:n=!1}n&&(this[Bi]=" "+s.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[Vi](){return this.string+(this[Bi]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[Yi]||(this[Yi]={})}};var pe=Symbol.for("#__init__"),Wi=Symbol.for("#__initor__"),Gi=Symbol.for("#__inited__"),dr=Symbol.for("#getRenderContext"),Jl=Symbol.for("#getDynamicContext"),Xi=Symbol(),$={context:null},Qi=class{constructor(t=null){this[pe](t)}[pe](t=null){var e;this.stack=t&&(e=t.stack)!==void 0?e:[]}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}},xt=new Qi,B=class extends Map{static[pe](){return this.prototype[Wi]=Xi,this}constructor(t,e=null){super();this._=t,this.sym=e,this[Wi]===Xi&&this[Gi]&&this[Gi]()}pop(){return $.context=null}[dr](t){let e=this.get(t);return e||this.set(t,e=new B(this._,t)),$.context=e}[Jl](t,e){return this[dr](t)[dr](e)}run(t){return this.value=t,$.context==this&&($.context=null),this.get(t)}cache(t){return this.set(this.value,t),t}};B[pe]();function pr(i,t=Symbol(),e=i){return $.context=i[t]||(i[t]=new B(e,t))}function Zl(){let i=$.context,t=i||new B(null);return globalThis.DEBUG_IMBA&&!i&&xt.stack.length>0&&console.warn("detected unmemoized nodes in",xt.stack,"see https://imba.io",t),i&&($.context=null),t}function At(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}function th(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var me=Symbol.for("#parent"),Ji=Symbol.for("#closestNode"),eh=Symbol.for("#parentNode"),rh=Symbol.for("#context"),ge=Symbol.for("#__init__"),Zi=Symbol.for("##inited"),mr=Symbol.for("#getRenderContext"),ih=Symbol.for("#getDynamicContext"),ts=Symbol.for("#insertChild"),jt=Symbol.for("#appendChild"),gr=Symbol.for("#replaceChild"),es=Symbol.for("#removeChild"),Z=Symbol.for("#insertInto"),rs=Symbol.for("#insertIntoDeopt"),qt=Symbol.for("#removeFrom"),is=Symbol.for("#removeFromDeopt"),St=Symbol.for("#replaceWith"),ss=Symbol.for("#replaceWithDeopt"),yr=Symbol.for("#placeholderNode"),sh=Symbol.for("#attachToParent"),nh=Symbol.for("#detachFromParent"),oh=Symbol.for("#placeChild"),lh=Symbol.for("#beforeReconcile"),hh=Symbol.for("#afterReconcile"),uh=Symbol.for("#afterVisit"),ns=Symbol.for("#__initor__"),os=Symbol.for("#__inited__"),ls=Symbol.for("##parent"),ah=Symbol.for("##up"),hs=Symbol.for("##context"),dt=Symbol.for("#domNode"),ye=Symbol.for("##placeholderNode"),us=Symbol.for("#domDeopt"),as=Symbol.for("#isRichElement"),fs=Symbol.for("#src"),wt=Symbol.for("#htmlNodeName"),fh=Symbol.for("#getSlot"),cs=Symbol.for("#ImbaElement"),ds=Symbol.for("#cssns"),ch=Symbol.for("#cssid"),ps=Symbol(),{Event:K,UIEvent:dh,MouseEvent:_r,PointerEvent:br,KeyboardEvent:vr,CustomEvent:P,Node:I,Comment:zt,Text:_e,Element:v,HTMLElement:be,HTMLHtmlElement:ph,HTMLSelectElement:xr,HTMLInputElement:Sr,HTMLTextAreaElement:wr,HTMLButtonElement:Er,HTMLOptionElement:Tr,HTMLScriptElement:mh,SVGElement:Or,DocumentFragment:gh,ShadowRoot:yh,Document:Et,Window:_h,customElements:bh}=globalThis.window,ms={};function gs(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==Or?e[t]=r||null:gs(Reflect.getPrototypeOf(i),t,e)}var Nr={},Cr={},ve={},ys={};function Kt(){return globalThis.document}function vh(){return!0}var xh={get(i,t){let e=i,r;for(;e&&r==null;)(e=e[me])&&(r=e[t]);return r},set(i,t,e){let r=i,s;for(;r&&s==null;){if(It(r,t,v))return r[t]=e,!0;r=r[me]}return!0}},_s=class{get flags(){return this.documentElement.flags}};At(Et.prototype,_s.prototype);var bs=class{get[me](){return this[ls]||this.parentNode||this[ah]}get[Ji](){return this}get[eh](){return this[me][Ji]}get[rh](){return this[hs]||(this[hs]=new Proxy(this,xh))}[ge](){return this}[Zi](){return this}[mr](t){return pr(this,t)}[ih](t,e){return this[mr](t)[mr](e)}[ts](t,e){return t[Z](this,e)}[jt](t){return t[Z](this,null)}[gr](t,e){let r=this[ts](t,e);return this[es](e),r}[es](t){return t[qt](this)}[Z](t,e=null){return e?t.insertBefore(this,e):t.appendChild(this),this}[rs](t,e){return e?t.insertBefore(this[dt]||this,e):t.appendChild(this[dt]||this),this}[qt](t){return t.removeChild(this)}[is](t){return t.removeChild(this[dt]||this)}[St](t,e){return e[gr](t,this)}[ss](t,e){return e[gr](t,this[dt]||this)}get[yr](){return this[ye]||(this[ye]=globalThis.document.createComment("placeholder"))}set[yr](t){let e=this[ye];this[ye]=t,e&&e!=t&&e.parentNode&&e[St](t)}[sh](){let t=this[dt],e=t&&t.parentNode;return t&&e&&t!=this&&(this[dt]=null,this[Z](e,t),t[qt](e)),this}[nh](){(this[us]!=!0?(this[us]=!0,!0):!1)&&(this[St]=this[ss],this[qt]=this[is],this[Z]=this[rs]);let t=this[yr];return this.parentNode&&t!=this&&(t[Z](this.parentNode,this),this[qt](this.parentNode)),this[dt]=t,this}[oh](t,e,r){let s=typeof t;if(s==="undefined"||t===null){if(r&&r instanceof zt)return r;let n=globalThis.document.createComment("");return r?r[St](n,this):n[Z](this,null)}if(t===r)return t;if(s!=="object"){let n,o=t;return e&128&&e&256,r?r instanceof _e?(r.textContent=o,r):(n=globalThis.document.createTextNode(o),r[St](n,this),n):(this.appendChild(n=globalThis.document.createTextNode(o)),n)}else{if(globalThis.DEBUG_IMBA&&!t[Z])throw console.warn("Tried to insert",t,"into",this),new TypeError("Only DOM Nodes can be inserted into DOM");return r?r[St](t,this):t[Z](this,null)}}};At(I.prototype,bs.prototype);var vs=class{log(...t){return console.log(...t),this}emit(t,e,r={bubbles:!0,cancelable:!0}){e!=null&&(r.detail=e);let s=new P(t,r),n=this.dispatchEvent(s);return s}text$(t){return this.textContent=t,this}[lh](){return this}[hh](){return this}[uh](){this.render&&this.render()}get flags(){return this.$flags||(this.$flags=new Rt(this),this.flag$==v.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$,t.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=It(this,t,v);!r||!r.set?this.setAttribute(t,e):this[t]=e}get richValue(){return this.value}set richValue(t){this.value=t}};At(v.prototype,vs.prototype);v.prototype.setns$=v.prototype.setAttributeNS;v.prototype[as]=!0;function Sh(i,t,e,r){let s=globalThis.document.createElement(i);return e&&(s.className=e),r!==null&&s.text$(r),t&&t[jt]&&t[jt](s),s}var xs=class{set$(t,e){var r;let s=ms[r=this.nodeName]||(ms[r]={}),n=gs(this,t,s);!n||!n.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 e.flag$=function(r){return e.flagSync$(e.flags$ext=r)},e.flagSelf$=function(r){return e.flagSync$(e.flags$own=r)},e.flagSelf$(t)}flagSync$(){return this.setAttribute("class",(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||""))}};At(Or.prototype,xs.prototype);var Ss=class{set src(t){if((this[fs]!=t?(this[fs]=t,!0):!1)&&t){if(t.adoptNode)t.adoptNode(this);else if(t.content){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}}}};At(SVGSVGElement.prototype,Ss.prototype);function wh(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[jt]&&t[jt](n),r&&(n.textContent=r),n}function tt(i){return globalThis.document.createComment(i)}function xe(i){return globalThis.document.createTextNode(i)}function Eh(){return globalThis.document.createDocumentFragment()}var Se=globalThis.navigator,Th=Se&&Se.vendor||"",ws=Se&&Se.userAgent||"",Oh=Th.indexOf("Apple")>-1||ws.indexOf("CriOS")>=0||ws.indexOf("FxiOS")>=0,we=!Oh,Es=new Map,Ts=class extends be{connectedCallback(){return we?this.parentNode.removeChild(this):this.parentNode.connectedCallback()}disconnectedCallback(){if(!we)return this.parentNode.disconnectedCallback()}};window.customElements.define("i-hook",Ts);function Nh(i,t){let e=Es.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=th(s),l=o.length;n<l;n++){let h=o[n],a=Object.getOwnPropertyDescriptors(h);Object.assign(e,a)}Es.set(t,e)}return e}function Os(i,t,e,r,s){let n;typeof i!="string"&&i&&i.nodeName&&(i=i.nodeName);let o=Cr[i]||i;if(Nr[i]){let l=Nr[i],h=l.prototype[wt];if(h&&we)n=globalThis.document.createElement(h,{is:i});else if(l.create$&&h){n=globalThis.document.createElement(h),n.setAttribute("is",o);let a=Nh(n,l);Object.defineProperties(n,a),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(Cr[i]||i);return n[ls]=t,n[ge](),n[Zi](),r!==null&&n[fh]("__").text$(r),(e||n.flags$ns)&&n.flag$(e||""),n}function Ch(i,t,e,r){if(i==null||i==null)return tt("");if(i instanceof I)return i;if(i[as])return i;if(typeof i=="string"||i&&i.prototype instanceof I)return Os(i,t,e,r)}function Ns(i,t){if(ve[i])return ve[i];if(window[t])return window[t];if(window[i])return window[i]}function $h(i,t,e){let r=Ns(i,t);if(!(r==e||r.prototype instanceof e||r.prototype[wt])){let n=r.prototype[cs];if(!n){n=class extends r{static[ge](){return this.prototype[ns]=ps,this}constructor(){super(...arguments);this.__slots={},this.__F=0,this[ns]===ps&&this[os]&&this[os]()}}[ge](),r.prototype[cs]=n;let o=Object.getOwnPropertyDescriptors(e.prototype);Object.defineProperties(n.prototype,o),n.prototype[wt]=i}return n}return r}function Ph(i,t,e={}){ve[i]=ys[i]=t,t.nodeName=i;let r=i,s=t.prototype;if(i.indexOf("-")==-1&&(r=""+i+"-tag",Cr[i]=r),e.cssns){let n=(s._ns_||s[ds]||"")+" "+(e.cssns||"");s._ns_=n.trim()+" ",s[ds]=e.cssns}if(e.cssid){let n=(s.flags$ns||"")+" "+e.cssid;s[ch]=e.cssid,s.flags$ns=n.trim()+" "}return s[wt]&&!e.extends&&(e.extends=s[wt]),e.extends?(s[wt]=e.extends,Nr[i]=t,we&&window.customElements.define(r,t,{extends:e.extends})):window.customElements.define(r,t),t}var kh=globalThis.imba||(globalThis.imba={});kh.document=globalThis.document;function $r(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}function Lh(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var Ee=Symbol.for("#parent"),Cs=Symbol.for("#closestNode"),Mh=Symbol.for("#isRichElement"),Fh=Symbol.for("#afterVisit"),$s=Symbol.for("#__initor__"),Ps=Symbol.for("#__inited__"),ks=Symbol.for("#appendChild"),Ls=Symbol.for("#removeChild"),et=Symbol.for("#insertInto"),Te=Symbol.for("#replaceWith"),Ms=Symbol.for("#insertChild"),Oe=Symbol.for("#removeFrom"),Fs=Symbol.for("#placeChild"),Is=Symbol.for("#__init__"),Ih=Symbol.for("#registerFunctionalSlot"),Dh=Symbol.for("#getFunctionalSlot"),Ds=Symbol.for("#getSlot"),Pr=Symbol.for("##parent"),Ne=Symbol.for("##up"),Rs=Symbol.for("##flags"),Rh=Symbol.for("#domFlags"),V=Symbol.for("#end"),As=Symbol.for("#textContent"),Ce=Symbol.for("#textNode"),kr=Symbol.for("#functionalSlots"),js=Symbol();function Ah(){return!0}var st=class{constructor(){this.childNodes=[]}log(...t){}hasChildNodes(){return!1}set[Ee](t){this[Pr]=t}get[Ee](){return this[Pr]||this[Ne]}get[Cs](){return this[Ee][Cs]}get[Mh](){return!0}get flags(){return this[Rs]||(this[Rs]=new Rt(this))}flagSync$(){return this}[Fh](){return this}},jh=0,$e=class extends st{static[Is](){return this.prototype[$s]=js,this}constructor(t,e){super(...arguments);this[Ne]=e,this.parentNode=null,this[Rh]=t,this.childNodes=[],this[V]=tt("slot"+jh++),e&&e[ks](this),this[$s]===js&&this[Ps]&&this[Ps]()}get[Ee](){return this[Pr]||this.parentNode||this[Ne]}set textContent(t){this[As]=t}get textContent(){return this[As]}hasChildNodes(){for(let t=0,e=$r(this.childNodes),r=e.length;t<r;t++){let s=e[t];if(s instanceof st&&s.hasChildNodes())return!0;if(!(s instanceof zt)){if(s instanceof I)return!0}}return!1}text$(t){return this[Ce]?this[Ce].textContent=t:this[Ce]=this[Fs](t),this[Ce]}appendChild(t){return this.parentNode&&t[et](this.parentNode,this[V]),this.childNodes.push(t)}[ks](t){return this.parentNode&&t[et](this.parentNode,this[V]),this.childNodes.push(t)}insertBefore(t,e){this.parentNode&&this.parentNode[Ms](t,e);let r=this.childNodes.indexOf(e);return r>=0&&this.childNodes.splice(r,0,t),t}[Ls](t){this.parentNode&&this.parentNode[Ls](t);let e=this.childNodes.indexOf(t);e>=0&&this.childNodes.splice(e,1)}[et](t,e){let r=this.parentNode;if(this.parentNode!=t?(this.parentNode=t,!0):!1){this[V]&&(e=this[V][et](t,e));for(let s=0,n=$r(this.childNodes),o=n.length;s<o;s++)n[s][et](t,e)}return this}[Te](t,e){let r=t[et](e,this[V]);return this[Oe](e),r}[Ms](t,e){if(this.parentNode&&this.insertBefore(t,e||this[V]),e){let r=this.childNodes.indexOf(e);r>=0&&this.childNodes.splice(r,0,t)}else this.childNodes.push(t);return t}[Oe](t){for(let e=0,r=$r(this.childNodes),s=r.length;e<s;e++)r[e][Oe](t);return this[V]&&this[V][Oe](t),this.parentNode=null,this}[Fs](t,e,r){let s=this.parentNode,n=typeof t;if(n==="undefined"||t===null){if(r&&r instanceof zt)return r;let o=tt("");if(r){let l=this.childNodes.indexOf(r);return this.childNodes.splice(l,1,o),s&&r[Te](o,s),o}return this.childNodes.push(o),s&&o[et](s,this[V]),o}if(t===r)return t;if(n!=="object"){let o,l=t;if(r){if(r instanceof _e)return r.textContent=l,r;{o=xe(l);let h=this.childNodes.indexOf(r);return this.childNodes.splice(h,1,o),s&&r[Te](o,s),o}}else return this.childNodes.push(o=xe(l)),s&&o[et](s,this[V]),o}else if(r){let o=this.childNodes.indexOf(r);return this.childNodes.splice(o,1,t),s&&r[Te](t,s),t}else return this.childNodes.push(t),s&&t[et](s,this[V]),t}};$e[Is]();function qh(i,t){return new $e(i,t)}function Vt(i,t){let e=new $e(i,null);return e[Ne]=t,e}var qs=class{[Ih](t){let e=this[kr]||(this[kr]={});return e[t]||(e[t]=Vt(0,this))}[Dh](t,e){let r=this[kr];return r&&r[t]||this[Ds](t,e)}[Ds](t,e){var r;return t=="__"&&!this.render?this:(r=this.__slots)[t]||(r[t]=Vt(0,this))}};Lh(I.prototype,qs.prototype);function zh(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Kh=Symbol.for("#afterVisit"),Pe=Symbol.for("#insertInto"),zs=Symbol.for("#appendChild"),Vh=Symbol.for("#replaceWith"),Lr=Symbol.for("#removeFrom"),Ks=Symbol.for("#__initor__"),Vs=Symbol.for("#__inited__"),Hs=Symbol.for("#__init__"),Hh=Symbol.for("#domFlags"),Uh=Symbol.for("##parent"),nt=Symbol.for("#end"),Bh=Symbol.for("#removeChild"),Yh=Symbol.for("#insertChild"),Us=Symbol(),Mr=class extends st{static[Hs](){return this.prototype[Ks]=Us,this}constructor(t,e){super(...arguments);this[Hh]=t,this[Uh]=e,t&256||(this[nt]=tt("list")),this.$=this.childNodes,this.length=0,e&&e[zs](this),this[Ks]===Us&&this[Vs]&&this[Vs]()}hasChildNodes(){return this.length!=0}[Kh](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[nt];if(e>t)for(;e>t;)r[Bh](s[--e]);else if(t>e)for(;t>e;)r[Yh](s[e++],n);this.length=t}[Pe](t,e){this.parentNode=t,this[nt]&&this[nt][Pe](t,e),e=this[nt];for(let r=0,s=zh(this.childNodes),n=s.length;r<n;r++){let o=s[r];if(r==this.length)break;o[Pe](t,e)}return this}[zs](t){}[Vh](t,e){let r=t[Pe](e,this[nt]);return this[Lr](e),r}[Lr](t){let e=this.length;for(;e>0;)this.childNodes[--e][Lr](t);this[nt]&&t.removeChild(this[nt]),this.parentNode=null}};Mr[Hs]();function Wh(i,t){return new Mr(i,t)}function Bs(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Fr=Symbol.for("#appendChild"),ke=Symbol.for("#insertChild"),Gh=Symbol.for("#replaceWith"),Le=Symbol.for("#insertInto"),Ir=Symbol.for("#removeFrom"),Xh=Symbol.for("#afterVisit"),Ys=Symbol.for("#__initor__"),Ws=Symbol.for("#__inited__"),Gs=Symbol.for("#__init__"),Me=Symbol.for("#domFlags"),Xs=Symbol.for("##parent"),ot=Symbol.for("#end"),Qs=Symbol.for("#removeChild"),Js=Symbol(),Dr=class extends st{static[Gs](){return this.prototype[Ys]=Js,this}constructor(t,e){super(...arguments);this[Me]=t,this[Xs]=e,this.changes=new Map,this.dirty=!1,this.array=this.childNodes,this.$=new B(this,Symbol()),t&256||(this[ot]=tt("map")),e&&e[Fr](this),this[Ys]===Js&&this[Ws]&&this[Ws]()}[Fr](t){if(this.parentNode)return this.parentNode[ke](t,this[ot])}hasChildNodes(){return this.childNodes.length!=0}push(t,e){if(!(this[Me]&1)){this.array.push(t),this[Fr](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[ke](t,n.nextSibling)}else s[ke](t,this.childNodes[e+1]||this[ot])}moveChild(t,e,r){return this.insertChild(t,e,r)}removeChild(t,e){t.parentNode&&t[Ir](t.parentNode)}[ke](t,e){}[Gh](t,e){let r=t[Le](e,this[ot]);return this[Ir](e),r}[Le](t,e){this[Xs]=t;let r=this.parentNode;if(t!=r){this.parentNode=t;for(let s=0,n=Bs(this.array),o=n.length;s<o;s++)n[s][Le](t,e);this[ot]&&this[ot][Le](t,e)}return this}[Ir](t){for(let e=0,r=Bs(this.array),s=r.length;e<s;e++){let n=r[e];t[Qs](n)}return this[ot]&&t[Qs](this[ot]),this.parentNode=null}[Xh](t){var e=this;if(!(this[Me]&1)){this[Me]|=1;return}if(this.dirty&&(e.changes.forEach(function(r,s){if(r==-1)return e.removeChild(s)}),e.changes.clear(),e.dirty=!1),e.array.length>t)for(;e.array.length>t;){let r=e.array.pop();e.removeChild(r)}}};Dr[Gs]();function Qh(i,t){return new Dr(i,t)}var Tt=Symbol.for("#__init__"),Zs=Symbol.for("#__initor__"),tn=Symbol.for("#__inited__"),Jh=Symbol.for("##inited"),Zh=Symbol.for("#afterVisit"),tu=Symbol.for("#beforeReconcile"),eu=Symbol.for("#afterReconcile"),en=Symbol.for("#__hooks__"),Ot=Symbol.for("#autorender"),rn=Symbol(),sn=new class{constructor(i=null){this[Tt](i)}[Tt](i=null){var t;this.items=i&&(t=i.items)!==void 0?t:[],this.current=i&&(t=i.current)!==void 0?t:null,this.lastQueued=i&&(t=i.lastQueued)!==void 0?t:null,this.tests=i&&(t=i.tests)!==void 0?t:0}flush(){let i=null;for(;i=this.items.shift();){if(!i.parentNode||i.hydratedΦ)continue;let t=this.current;this.current=i,i.__F|=1024,i.connectedCallback(),this.current=t}}queue(i){var t=this;let e=this.items.length,r=0,s=this.lastQueued;this.lastQueued=i;let n=I.DOCUMENT_POSITION_PRECEDING,o=I.DOCUMENT_POSITION_FOLLOWING;if(e){let l=this.items.indexOf(s),h=l,a=function(u,d){return t.tests++,u.compareDocumentPosition(d)};(l==-1||s.nodeName!=i.nodeName)&&(h=l=0);let c=t.items[h];for(;c&&a(c,i)&o;)c=t.items[++h];if(h!=l)c?t.items.splice(h,0,i):t.items.push(i);else{for(;c&&a(c,i)&n;)c=t.items[--h];h!=l&&(c?t.items.splice(h+1,0,i):t.items.unshift(i))}}else t.items.push(i),t.current||globalThis.queueMicrotask(t.flush.bind(t))}};function ru(){return sn.flush()}var Nt=class extends be{static[Tt](){return this.prototype[Zs]=rn,this}constructor(){super();this.flags$ns&&(this.flag$=this.flagExt$),this.setup$(),this.build(),this[Zs]===rn&&this[tn]&&this[tn]()}setup$(){return this.__slots={},this.__F=0}[Tt](){return this.__F|=1|2,this}[Jh](){if(this[en])return this[en].inited(this)}flag$(t){this.className=this.flags$ext=t}build(){return this}awaken(){return this}mount(){return this}unmount(){return this}rendered(){return this}dehydrate(){return this}hydrate(){return this.autoschedule=!0,this}tick(){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)&~256&~8192):(this.__F|=8192,this)}get autoschedule(){return(this.__F&64)!=0}set autoschedule(t){t?this.__F|=64:this.__F&=~64}set autorender(t){let e=this[Ot]||(this[Ot]={});e.value=t,this.mountedΦ&&C.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}schedule(){return C.on("commit",this),this.__F|=128,this}unschedule(){return C.un("commit",this),this.__F&=~128,this}async suspend(t=null){let e=this.flags.incr("_suspended_");return this.__F|=4096,t instanceof Function&&(await t(),this.unsuspend()),this}unsuspend(){return this.flags.decr("_suspended_")==0&&(this.__F&=~4096,this.commit()),this}[Zh](){return this.visit()}[tu](){return this.__F&1024&&(this.__F=this.__F&~1024,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&&xt.push(this),this}[eu](){return globalThis.DEBUG_IMBA&&xt.pop(this),this}connectedCallback(){let t=this.__F,e=t&1,r=t&8;if(!e&&!(t&1024)){sn.queue(this);return}if(t&(16|32))return;this.__F|=16,e||this[Tt](),t&2||(this.flags$ext=this.className,this.__F|=2,this.hydrate(),this.commit()),r||(this.awaken(),this.__F|=8),A(this,"mount");let s=this.mount();return s&&s.then instanceof Function&&s.then(C.commit),t=this.__F=(this.__F|32)&~16,t&64&&this.schedule(),this[Ot]&&C.schedule(this,this[Ot]),this}disconnectedCallback(){if(this.__F=this.__F&(~32&~16),this.__F&128&&this.unschedule(),A(this,"unmount"),this.unmount(),this[Ot])return C.unschedule(this,this[Ot])}};Nt[Tt]();var iu=Nt;function su(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var nn=Symbol.for("#__init__"),Wf=Symbol.for("#__initor__"),Gf=Symbol.for("#__inited__"),nu={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 on={prefix:1,suffix:1,content:1},Rr={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]]},ou=new RegExp("^("+Object.keys(Rr).join("|")+")(\\d+(?:\\.\\d+)?)$"),lu=/^([xyz])$/,hu=/^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/,uu=`*,::before,::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: currentColor; }`,ln=class{constructor(t=null){this[nn](t)}[nn](t=null){var e;this.entries=t&&(e=t.entries)!==void 0?e:{}}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",uu),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;on[r]&&(t=String(t));let o=typeof t;if(o=="number"){if(e||(lu.test(r)?e="px":hu.test(r)?e="u":r=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return nu[e]?t+e:e=="u"?t*4+"px":"calc(var(--u_"+e+",1px) * "+t+")"}else if(o=="string"){if(r&&on[r]&&t[0]!='"'&&t[0]!="'"&&(t.indexOf('"')>=0?t.indexOf("'")==-1&&(t="'"+t+"'"):t='"'+t+'"'),n=t.match(ou)){let h=Rr[n[1]][parseInt(n[2])],a="100%";if(typeof s=="number"?a=s+"%":typeof s=="string"&&(a=s),h)return"hsla("+h[0]+","+h[1]+"%,"+h[2]+"%,"+a+")"}}else if(t&&t.toStyleString instanceof 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]}},hn=new ln,au=Object.keys(Rr);function fu(){return!0}var un=class{css$(t,e,r){return this.style[t]=e}css$var(t,e,r,s,n=null){let o=hn.toValue(e,r,s,n);this.style.setProperty(t,o)}};su(v.prototype,un.prototype);var cu=Symbol.for("#insertInto"),an=Symbol.for("#removeFrom");function du(i,t={}){let e=$.context;$.context=t;let r=i(t);return $.context==t&&($.context=e),r}function fn(i,t){let e=t||globalThis.document.body,r=i;if(i instanceof Function){let s=new B(e,null),n=function(){let o=$.context;$.context=s;let l=i(s);return $.context==s&&($.context=o),l};r=n(),C.listen("commit",n)}else r.__F|=64;return r[cu](e),r}function cn(i){return i&&i[an]&&i[an](i.parentNode),i}var dn=globalThis.imba||(globalThis.imba={});dn.mount=fn;dn.unmount=cn;function Ct(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}function Ht(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Ut=Symbol.for("#afterVisit");function pu(){return!0}var mu={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},Ar=function(i){return i instanceof Array||i&&i.has instanceof Function},jr=function(i,t){return i==t?!0:i instanceof Array?i.indexOf(t)>=0:i&&i.has instanceof Function?i.has(t):i&&i.contains instanceof Function?i.contains(t):!1},qr=function(i,t){if(i instanceof Array)return i.push(t);if(i&&i.add instanceof Function)return i.add(t)},zr=function(i,t){if(i instanceof Array){let e=i.indexOf(t);if(e>=0)return i.splice(e,1)}else if(i&&i.delete instanceof Function)return i.delete(t)};function gu(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 pn=class{getRichValue(){return this.value}setRichValue(t){return this.value=t}bind$(t,e){let r=e||[];return t=="data"&&!this.$$bound&&mu[this.nodeName]&&(this.$$bound=!0,this.change$&&this.addEventListener("change",this.change$=this.change$.bind(this)),this.input$&&this.addEventListener("input",this.input$=this.input$.bind(this),{capture:!0}),this.click$&&this.addEventListener("click",this.click$=this.click$.bind(this),{capture:!0})),Object.defineProperty(this,t,r instanceof Array?gu(r):r),r}};Ct(v.prototype,pn.prototype);Object.defineProperty(v.prototype,"richValue",{get:function(){return this.getRichValue()},set:function(i){return this.setRichValue(i)}});var mn=class{change$(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=Ht(r),l=o.length;n<l;n++){let h=o[n];s.indexOf(h)==-1&&zr(e,h)}for(let n=0,o=Ht(s),l=o.length;n<l;n++){let h=o[n];(!r||r.indexOf(h)==-1)&&qr(e,h)}}else this.data=s[0];return k(),this}getRichValue(){var t;if(this.$$value)return this.$$value;t=[];for(let e=0,r=Ht(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=Ht(this.options),n=s.length;r<n;r++){let o=s[r],l=o.richValue,h=jr(t,l);o.selected=h,h&&e.push(l)}this.$$value=e}else for(let e=0,r=Ht(this.options),s=r.length;e<s;e++){let o=r[e].richValue;if(o==t){this.$$value=[o],this.selectedIndex=e;break}}}[Ut](){return this.syncValue()}};Ct(xr.prototype,mn.prototype);var gn=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}};Ct(Tr.prototype,gn.prototype);var yn=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}input$(t){return this.data=this.value,k()}[Ut](){let t=this.data;if(t==null&&(t=""),this.$$bound&&this.value!=t)return this.value=t}};Ct(wr.prototype,yn.prototype);var _n=class{input$(t){let e=this.type;if(!(e=="checkbox"||e=="radio"))return this.$$value=void 0,this.data=this.richValue,k()}change$(t){let e=this.data,r=this.richValue;if(this.type=="checkbox"||this.type=="radio"){let s=this.checked;Ar(e)?s?qr(e,r):zr(e,r):this.data=s?r:!1}return k()}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;return e=="range"||e=="number"?(t=this.valueAsNumber,Number.isNaN(t)&&(t=null)):e=="checkbox"&&(t==null||t==="on")&&(t=!0),t}[Ut](){if(this.$$bound){let t=this.type;if(t=="checkbox"||t=="radio"){let e=this.data;e===!0||e===!1||e==null?this.checked=!!e:this.checked=jr(e,this.richValue)}else this.richValue=this.data}}};Ct(Sr.prototype,_n.prototype);var bn=class{get checked(){return this.$checked}set checked(t){t!=this.$checked&&(this.$checked=t,this.flags.toggle("checked",!!t))}setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}click$(t){let e=this.data,r=this.checked,s=this.richValue;return Ar(e)?r?zr(e,s):qr(e,s):this.$$value==null?this.data=!r:this.data=r?null:s,this[Ut](),k()}[Ut](){if(this.$$bound){let t=this.data,e=this.$$value==null?!0:this.$$value;Ar(t)?this.checked=jr(t,e):this.checked=t==e}}};Ct(Er.prototype,bn.prototype);function vn(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var yu=Symbol.for("#getSlot"),_u=Symbol.for("#container"),bu=Symbol.for("#afterVisit"),pt=Symbol.for("#__init__"),xn=Symbol.for("#__initor__"),Sn=Symbol.for("#__inited__"),Fe=Symbol.for("#listeners"),W=Symbol.for("#slot"),vu=Symbol.for("#parent"),j=Symbol.for("##container"),Kr=Symbol.for("#domTarget"),wn=Symbol.for("#insertInto"),xu=Symbol.for("#removeFrom"),Su=Symbol.for("#self"),wu=Symbol.for("#target"),En=Symbol(),Ie=class extends Nt{static[pt](){return this.prototype[xn]=En,this}constructor(){super(...arguments);super[pt]||this[pt](),this[xn]===En&&this[Sn]&&this[Sn]()}[pt](t=null){super[pt]&&super[pt](...arguments),this.to=t?t.to:void 0}build(){return this[Fe]=[],this.win=globalThis,this.doc=globalThis.document}setup(){return this.setAttribute("style","display:none !important;")}[yu](t,e){return this[W]||(this[W]=Vt(0,this[vu])),this[W]}get[_u](){if(!this[j]){let t=this.className;this[j]=this.doc.createElement("div"),this[j].className=t,this[j].style.cssText="display:contents !important;"}return this[j]}get domTarget(){return this[Kr]||(this[Kr]=this.to instanceof v?this.to:this.closest(this.to)||this.doc.querySelector(this.to))}get eventTarget(){return this.domTarget}get style(){return this[j]?this[j].style:super.style}get classList(){return this[j]?this[j].classList:super.classList}get className(){return this[j]?this[j].className:super.className}set className(t){this[j]?this[j].className=t:super.className=t}[bu](){if(this.mountedΦ&&this[W]&&!this[W].parentNode)return this[W][wn](this.target)}mount(){for(let e=0,r=vn(this[Fe]),s=r.length;e<s;e++){let[n,o,l]=r[e];this.eventTarget.addEventListener(n,o,l)}let t=this.domTarget;return this[W]&&this[W][wn](t),this}unmount(){for(let t=0,e=vn(this[Fe]),r=e.length;t<r;t++){let[s,n,o]=e[t];this.eventTarget.removeEventListener(s,n,o)}return this[W]&&this[W][xu](this.domTarget),this[Kr]=null,this}addEventListener(t,e,r={}){var s;if(e[Su]=this,this[Fe].push([t,e,r]),this.mountedΦ&&((s=this.eventTarget)==null?void 0:s.addEventListener))return this.eventTarget.addEventListener(t,e,r)}};Ie[pt]();var Tn=class extends Ie{get domTarget(){return this.doc.body}get eventTarget(){return this.win}addEventListener(t,e,r={}){return e[wu]=this.domTarget.parentNode,super.addEventListener(...arguments)}on$resize(t,e,r,s){return this.addEventListener("resize",r,s),r}};globalThis.customElements&&(globalThis.customElements.define("i-teleport",Ie),globalThis.customElements.define("i-global",Tn));function Eu(){return!0}function mt(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}function Tu(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var On=Symbol.for("#__init__"),hc=Symbol.for("#__initor__"),uc=Symbol.for("#__inited__"),Vr=Symbol.for("#insertInto"),Hr=Symbol.for("#removeFrom"),Ou=Symbol.for("#all"),Bt=Symbol.for("#phase"),rt=Symbol.for("#nodes"),Nu=Symbol.for("#sizes"),Nn=Symbol.for("#mode"),Cn=Symbol.for("#enabled"),$n=Symbol.for("#anims"),Ur=Symbol.for("#_easer_"),Pn=cl