imba
Version:
6 lines (4 loc) • 153 kB
JavaScript
var wu=Object.create;var br=Object.defineProperty;var _u=Object.getOwnPropertyDescriptor;var Tu=Object.getOwnPropertyNames;var Lu=Object.getPrototypeOf,Cu=Object.prototype.hasOwnProperty;var Nu=(i,t)=>{for(var e in t)br(i,e,{get:t[e],enumerable:!0})},Fl=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Tu(t))!Cu.call(i,s)&&s!==e&&br(i,s,{get:()=>t[s],enumerable:!(r=_u(t,s))||r.enumerable});return i};var we=(i,t,e)=>(e=i!=null?wu(Lu(i)):{},Fl(t||!i||!i.__esModule?br(e,"default",{value:i,enumerable:!0}):e,i)),Eu=i=>Fl(br({},"__esModule",{value:!0}),i);var Tg={};Nu(Tg,{Accessor:()=>Fi,Action:()=>pr,CUSTOM_TYPES:()=>xh,ClassFlags:()=>_e,Comment:()=>ft,Component:()=>Tt,ComputedType:()=>Oi,CustomEvent:()=>L,Document:()=>ct,DocumentFragment:()=>Ge,EaseGroup:()=>Dn,Easer:()=>ui,Element:()=>y,ElementRoute:()=>ur,ElementRouteTo:()=>Ti,Emitter:()=>Pt,Event:()=>A,EventHandler:()=>ir,FocusEvent:()=>ze,Fragment:()=>gt,HAS:()=>Ru,HTMLButtonElement:()=>oe,HTMLElement:()=>F,HTMLHtmlElement:()=>Fr,HTMLInputElement:()=>se,HTMLLinkElement:()=>Rr,HTMLOptionElement:()=>le,HTMLScriptElement:()=>Ar,HTMLSelectElement:()=>ie,HTMLStyleElement:()=>Hr,HTMLTextAreaElement:()=>ne,ImbaElement:()=>pd,IntersectionEventDefaults:()=>gi,KeyboardEvent:()=>Ue,LazyProxy:()=>Sr,Location:()=>re,MouseEvent:()=>ae,Node:()=>O,OBSERVED:()=>_,ObservableArray:()=>Mi,PointerEvent:()=>Be,Queue:()=>Pe,Ref:()=>Ut,RenderContext:()=>ht,Router:()=>_i,SVGElement:()=>ue,SVGSVGElement:()=>Vr,Scheduler:()=>Lr,ShadowRoot:()=>Ps,StyleDeclaration:()=>kr,Text:()=>Ht,Touch:()=>mi,UIEvent:()=>he,Window:()=>Cs,__has__$:()=>Hl,__hooks__$:()=>Hi,__imba__$:()=>vr,__init__$:()=>qt,__inited__$:()=>Rl,__initor__$:()=>Vi,__meta__$:()=>Vl,__mixin__$:()=>Ou,__patch__$:()=>Mu,__served__:()=>Qu,accessor:()=>yg,afterReconcile$:()=>Fu,afterVisit$:()=>Iu,appendChild$:()=>Pu,atomic:()=>eg,augment$:()=>xr,autorun:()=>Jm,awaits:()=>Zm,beforeReconcile$:()=>ku,clearInterval:()=>ql,clearTimeout:()=>Yl,colors:()=>Sd,commit:()=>k,createAtom:()=>Rm,createComment:()=>pt,createComponent:()=>wh,createDynamic:()=>kf,createElement:()=>Of,createFragment:()=>If,createIndexedList:()=>rd,createKeyedList:()=>od,createLiveFragment:()=>Kf,createRef:()=>lg,createRenderContext:()=>Ie,createSVGElement:()=>Pf,createSlot:()=>qe,createTextNode:()=>zr,customElements:()=>Jc,decorate$:()=>Uu,defineConfig:()=>ec,defineTag:()=>Ff,descriptor:()=>bg,devlog$:()=>zu,disposeObservables:()=>hg,document:()=>Ms,emit:()=>D,env:()=>Ji,events:()=>dp,extend$:()=>ji,getComputed:()=>ag,getDeepPropertyDescriptor:()=>wr,getRenderContext:()=>Nc,getSuperTagType:()=>Zc,getTagType:()=>ut,get_document:()=>ce,has$:()=>ju,hooks:()=>Xi,hotkeys:()=>Xp,hydrate:()=>fd,idx$:()=>Gu,inited$:()=>Wu,is$:()=>Vu,isa$:()=>Du,iterable$:()=>Di,listen:()=>V,locals:()=>wg,logFormatter:()=>nh,matcher:()=>Dl,memofunc:()=>$c,mount:()=>Kh,multi$:()=>qu,observable:()=>tg,once:()=>E,parseTime:()=>Xt,proxy:()=>Gi,register$:()=>a,render:()=>Ld,renderContext:()=>M,renderer:()=>Zt,reportChanged:()=>sg,reportInvalidated:()=>ng,reportObserved:()=>og,router:()=>Sm,run:()=>rg,rx:()=>fr,scheduler:()=>C,serve:()=>bc,session:()=>_g,setInterval:()=>Kl,setTimeout:()=>Ul,spy:()=>ig,statics$:()=>Bu,styles:()=>zh,sup$:()=>Yu,toCamelCase:()=>Zu,transitions:()=>ai,unlisten:()=>vt,unmount:()=>qh,up$:()=>Au,use_devlog:()=>Sc,use_dom_bind:()=>Cd,use_dom_teleport:()=>qd,use_dom_transitions:()=>ip,use_events:()=>pp,use_events_hotkey:()=>Yp,use_events_intersect:()=>Ep,use_events_keyboard:()=>Un,use_events_mouse:()=>rr,use_events_mutate:()=>Gp,use_events_pointer:()=>vp,use_events_resize:()=>Ap,use_events_selection:()=>Up,use_events_touch:()=>_p,use_hooks:()=>lc,use_router:()=>xm,use_slots:()=>Gf,use_styles:()=>wd,use_window:()=>Wc,αaction:()=>pg,αautorun:()=>dg,αbound:()=>ac,αcomputed:()=>ug,αlazy:()=>hc,αobservable:()=>cg,αprop:()=>vg,αref:()=>fg,αthenable:()=>uc});module.exports=Eu(Tg);var qt=Symbol.for("#__init__"),Vi=Symbol.for("#__initor__"),Rl=Symbol.for("#__inited__"),Hi=Symbol.for("#__hooks__"),Mu=Symbol.for("#__patch__"),Hl=Symbol.for("#has"),Vl=Symbol.for("#meta"),vr=Symbol.for("imba"),Ou=Symbol.for("#__mixin__"),Dl=Symbol.for("#matcher"),$r=Symbol.for("#L"),Pu=Symbol.for("#appendChild"),Iu=Symbol.for("#afterVisit"),ku=Symbol.for("#beforeReconcile"),Fu=Symbol.for("#afterReconcile"),Au=Symbol.for("##up"),Ru={SUPERCALLS:1<<3,CONSTRUCTOR:1<<4},_e={IsExtension:1<<0,IsTag:1<<1,HasDescriptors:1<<2,HasSuperCalls:1<<3,HasConstructor:1<<4,HasFields:1<<5,HasMixins:1<<6,HasInitor:1<<7,HasDecorators:1<<8,IsObjectExtension:1<<9},Yt=new Map,Hu=globalThis[vr]||(globalThis[vr]={counter:0,classes:Yt});function Wt(i,t={}){return Yt.has(i)||Yt.set(i,{symbol:Symbol(i.name),parent:Object.getPrototypeOf(i.prototype)?.constructor,for:i,uses:null,inits:null,id:Hu.counter++,...t}),Yt.get(i)}var Al=new WeakMap;function Vu(i,t){return i===t||t?.[Dl]?.(i)}function Du(i,t){return typeof t=="string"?typeof i===t:t?.[Symbol.hasInstance]?.(i)}function ju(i,t){return t?.[Hl]?.(i)??t?.includes?.(i)??t?.has?.(i)??!1}function Gu(i,t){return t?.indexOf?t.indexOf(i):Array.prototype.indexOf.call(i,t)}function zu(i,t,...e){return t&&t[$r]instanceof Function?i=t[$r](i,t,...e):globalThis[$r]instanceof Function&&(i=globalThis[$r](i,t,...e)),i}function Bu(i){return Al.get(i)||Al.set(i,{}).get(i)}function Di(i){return i?.toIterable?.()||i}function Uu(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 Ku(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 ji(i,t,e,r={}){let s=i.constructor;!e&&t&&(e=Object.getOwnPropertyDescriptors(t),delete e.constructor,e[qt]&&(console.warn(`Cannot define plain fields when extending class ${s.name}`),delete e[qt]));let n=Wt(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 f=o.get(u);f||o.set(u,f={});let c=Object.getOwnPropertyDescriptor(u.prototype,l);c&&!Ku(h,c)?console.warn("wont extend",l,c,h):f[l]=e[l]}}for(let[l,h]of o)Object.keys(h).length&&ji(l.prototype,null,h)}return Object.defineProperties(i,e),i}function xr(i,t){let e=Wt(i),r=Wt(t);if(r.parent&&!(i.prototype instanceof r.parent))throw new Error(`Mixin ${t.name} has superclass not present in target class`);if(!r.augments){r.augments=new Set;let n=r.ref=Symbol(t.name),o=Object[Symbol.hasInstance];t.prototype[n]=!0,Object.defineProperty(t,Symbol.hasInstance,{value:function(l){return this===t?l&&!!l[n]:o.call(this,l)}})}if(i.prototype[r.ref])return i;if(r.uses)for(let n of r.uses)xr(i,n);r.augments.add(i),e.uses||(e.uses=[]),e.uses.push(t);let s=Object.getOwnPropertyDescriptors(t.prototype);return delete s.constructor,s[qt]&&(e.inits||(e.inits=[]),e.inits.push(t.prototype[qt]),delete s[qt]),Object.defineProperties(i.prototype,s),t?.mixed instanceof Function&&t.mixed(i),i}function qu(i,t,...e){let r=t?class extends t{}:class{},s=Wt(r,{symbol:i});for(let n of e)xr(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 Q={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(i,t,...e)=>Q.target[t].apply(Q.self,e),get:(i,t)=>Reflect.get(Q.target,t,Q.self),set:(i,t,e,r)=>Reflect.set(Q.target,t,e,Q.self)})};function Yu(i,t){return Q.self=i,Q.target=Q.cache[t],Q.proxy}function a(i,t,e,r,s=null){let n=Object.getPrototypeOf(i.prototype),o=r&_e.HasMixins,l;if(o&&(Yt.set(i,Yt.get(n.constructor)),n=Object.getPrototypeOf(n)),s){let u=r&_e.IsObjectExtension?s:s.prototype,f=Wt(i);if(f.uses){s===u&&console.warn("Cannot extend object with mixins");for(let c of f.uses)xr(s,c)}return r&_e.HasSuperCalls&&(Q.cache[t]=Object.create(Object.getPrototypeOf(u),Object.getOwnPropertyDescriptors(u))),ji(u,i.prototype),s}let h=n?.constructor;if(l=Wt(i,{symbol:t}),Object.defineProperty(i,Vl,{value:l,enumerable:!1,configurable:!0}),e&&i.name!==e&&Object.defineProperty(i,"name",{value:e,configurable:!0}),l.flags=r,r&_e.HasConstructor&&(i.prototype[Vi]=t),l.uses)for(let u of l.uses)u.mixes?.(i);return h?.inherited instanceof Function&&h.inherited(i),i}function Wu(i,t){i[Vi]===t&&(i[Rl]?.(),i[Hi]&&i[Hi].inited(i))}var Te=Symbol.for("#__listeners__"),Xu=/-./g,Qu=new Set,Ju=Symbol(),zi=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}},Sr=zi;(()=>{a(zi,Ju,"LazyProxy",16)})();function Gi(i,t={}){return new Proxy(t,new Sr(i))}function Xt(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 Zu(i){return i.indexOf("-")>=0?i.replace(Xu,function(t){return t.charAt(1).toUpperCase()}):i}function wr(i,t,e){if(!i)return;let r=Object.getOwnPropertyDescriptor(i,t);return r||i==e?r||void 0:wr(Reflect.getPrototypeOf(i),t,e)}var jl=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 V(i,t,e,r){let s,n,o;return s=i[Te]||(i[Te]={}),n=s[t]||(s[t]={}),o=n.tail||(n.tail=n.next={}),o.listener=e,o.path=r,n.tail=o.next={},o}function E(i,t,e){let r=V(i,t,e);return r.times=1,r}function vt(i,t,e,r){if(!e)return;let s,n,o=i[Te];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 D(i,t,e=null){let r;(r=i[Te])&&(r[t]&&jl(t,e,r[t]),r.all&&jl(t,[t,e],r.all))}var tc=Symbol(),Bi=class{emit(t,...e){return D(this,t,e)}on(t,...e){return V(this,t,...e)}once(t,...e){return E(this,t,...e)}un(t,...e){return vt(this,t,...e)}},Pt=Bi;(()=>{a(Bi,tc,"Emitter",0)})();function ec(i){return i}function Ui(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function rc(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var Gl=Symbol.for("#__init__"),zl=Symbol.for("#schedule"),Ki=Symbol.for("#frames"),_r=Symbol.for("#interval"),Qt=Symbol.for("#stage"),Jt=Symbol.for("#scheduled"),Tr=Symbol.for("#version"),ic=Symbol.for("#fps"),Bl=Symbol.for("#ticker"),sc=globalThis.requestAnimationFrame||function(i){return globalThis.setTimeout(i,1e3/60)};var Ig=1/60,nc=Symbol(),Yi=class{constructor(t=null){this[Gl](t)}[Gl](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[Ki],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[_r]=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[_r]&&(globalThis.clearInterval(this[_r]),this[_r]=null),this.active=!1,this}},qi=Yi;(()=>{a(Yi,nc,"Scheduled",16)})();var oc=Symbol(),Wi=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[Qt]=-1,this[Ki]=0,this[Jt]=!1,this[Tr]=0,this.listeners={},this.intervals={},this.commit=function(){return t.add("commit"),t},this[ic]=0,this.$promise=null,this.$resolve=null,this[Bl]=function(e){return t[Jt]=!1,t.tick(e)}}touch(){return this[Tr]++}get version(){return this[Tr]}add(t,e=!1){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[Jt]||this[zl](),this}get committingΦ(){return this.queue.indexOf("commit")>=0}get syncingΦ(){return this[Qt]==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[Ki]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[Qt]=1,this[Tr]++,r.length)for(let n=0,o=rc(r),l=o.length;n<l;n++){let h=o[n];typeof h=="string"&&this.listeners[h]?this.listeners[h].forEach(function(u){if(Ui(u.tick,Function))return u.tick(e,h);if(Ui(u,Function))return u(e,h)}):Ui(h,Function)?h(this.dt,this):h.tick&&h.tick(this.dt,this)}return this[Qt]=this[Jt]?0:-1,this.$promise&&(this.$resolve(this),this.$promise=this.$resolve=null),this.listeners.raf&&this.add("raf"),this}[zl](){return this[Jt]||(this[Jt]=!0,this[Qt]==-1&&(this[Qt]=0),sc(this[Bl])),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 qi({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}},Lr=Wi;(()=>{a(Wi,oc,"Scheduler",16)})();var C=new Lr;function k(){return C.add("commit").promise}function Ul(i,t){return globalThis.setTimeout(function(){i(),k()},t)}function Kl(i,t){return globalThis.setInterval(function(){i(),k()},t)}var ql=globalThis.clearInterval,Yl=globalThis.clearTimeout,Le=globalThis.imba||(globalThis.imba={});Le.commit=k;Le.setTimeout=Ul;Le.setInterval=Kl;Le.clearInterval=ql;Le.clearTimeout=Yl;var Xi={on:function(i,t){return V(this,i,t)},inited:function(i){return D(this,"inited",[i])}};function lc(){return!0}function Xl(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function hc(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 ac(i,t,e){var r,s;if(Xl(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 Wl=new WeakMap;function uc(i,t,e){let r=this[0]||{},s=e.value,n=Symbol(),o=new WeakMap,l=Wl.get(i),h=r.timeout||20*1e3,u=""+(i.constructor?.name||"")+"."+String(typeof t=="symbol"?t.description:t);if(l||Wl.set(i,l={}),l.key)throw new Error("@thenable "+u+" not allowed - @thenable "+l.key+" already defined");if(!Xl(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 f=function(g){return console.trace("@thenable "+u+" took more than "+h+"ms - make sure method does not return self.",g)},c=function(g){let d=o.get(g);return d||o.set(g,d={}),d},m=function(g,d){let p=this,$=c(p);return($.promise||($.promise=new Promise(function(I,xe){let S=r.timeout!==!1?setTimeout(f,r.timeout||2e4,p):null,X=function($t){return S&&clearTimeout(S),$.met=!0,$.error=$t,console.trace("@thenable "+u+" threw error",$t),xe($t)};return p[t]().then(function(){return S&&clearTimeout(S),$.met=!0,I(p)},X)}))).then(g,d)};return Object.defineProperty(i,"then",{enumerable:!1,configurable:!0,get:function(){return c(this).met?null:m}}),e.value=function(g){let d=c(this);return d.wrapped??(d.wrapped=Promise.resolve(s.call(this,d))),d.wrapped},e.value.reset=function(g){let d=c(g);o.delete(g)},e.value.check=c,e}var rs=we(require("cluster")),K=we(require("fs")),kt=we(require("path")),rh=require("events");var Qi=we(require("path")),cc=Symbol(),Ce,Ji=new(Ce=class{get rootDir(){return process.env.IMBA_OUTDIR||Qi.default.dirname(process.env.pm_exec_path||process.argv[1])}get publicPath(){return Qi.default.resolve(this.rootDir,process.env.IMBA_PUBDIR||globalThis.IMBA_PUBDIR||"public")}},(()=>{a(Ce,cc,"Env",0)})(),Ce);var ih=we(require("http"));function U(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}function th(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var eh=Symbol.for("#setup"),Ql=Symbol.for("#setup?"),fc=Symbol.for("#dom"),dc=Symbol.for("#server"),Ne={html:{"Content-Type":"text/html; charset=utf-8"},txt:{"Content-Type":"text/plain; charset=utf-8"},js:{"Content-Type":"text/javascript; charset=utf-8"},cjs:{"Content-Type":"text/javascript; charset=utf-8"},mjs:{"Content-Type":"text/javascript; charset=utf-8"},json:{"Content-Type":"application/json; charset=utf-8"},css:{"Content-Type":"text/css; charset=utf-8"},map:{"Content-Type":"application/json; charset=utf-8"},otf:{"Content-Type":"font/otf"},ttf:{"Content-Type":"font/ttf"},woff:{"Content-Type":"font/woff"},woff2:{"Content-Type":"font/woff2"},svg:{"Content-Type":"image/svg+xml"},avif:{"Content-Type":"image/avif"},gif:{"Content-Type":"image/gif"},png:{"Content-Type":"image/png"},apng:{"Content-Type":"image/apng"},webp:{"Content-Type":"image/webp"},jpg:{"Content-Type":"image/jpeg"},jpeg:{"Content-Type":"image/jpeg"},ico:{"Content-Type":"image/x-icon"},bmp:{"Content-Type":"image/bmp"},pdf:{"Content-Type":"application/pdf"},webm:{"Content-Type":"video/webm"},weba:{"Content-Type":"audio/webm"},avi:{"Content-Type":"video/x-msvideo"},mp3:{"Content-Type":"audio/mpeg"},mp4:{"Content-Type":"video/mp4"},m4a:{"Content-Type":"audio/m4a"},mov:{"Content-Type":"video/quicktime"},wmv:{"Content-Type":"video/x-ms-wmv"},mpeg:{"Content-Type":"video/mpeg"},wav:{"Content-Type":"audio/wav"},ogg:{"Content-Type":"audio/ogg"},ogv:{"Content-Type":"video/ogg"},oga:{"Content-Type":"audio/ogg"},opus:{"Content-Type":"audio/opus"}},Jl={id:Date.now()},z=globalThis.process,pc=Symbol(),is=class extends Set{call(t,...e){var r;r=[];for(let s of U(this))r.push(s[t](...e));return r}close(t={}){var e;e=[];for(let r of U(this))e.push(r.close(t));return e}reload(t={}){var e;e=[];for(let r of U(this))e.push(r.reload(t));return e}broadcast(t,...e){var r;r=[];for(let s of U(this))r.push(s.broadcast(t,...e));return r}emit(t,e){var r;r=[];for(let s of U(this))r.push(s.emit(t,e));return r}sseEnd(){let t=[];for(let e of U(this))for(let r of U(e.clients))t.push(new Promise(function(s){return r.on("finish",s),r.end()}));return Promise.all(t)}},Zi=is;(()=>{a(is,pc,"Servers",0)})();var It=new Zi,mc=Symbol(),Ee,Zl=new(Ee=class extends rh.EventEmitter{constructor(){var t;super(...arguments),t=this,this.autoreload=!1,this.state={},globalThis.IMBA_RUN&&(rs.default.isWorker?z.on("message",function(e){if(t.emit("message",e),e[0]=="emit")return t.emit(...e.slice(1))}):z.on("message",function(e){if(e[0]=="emit")return t.emit(...e.slice(1))}))}[eh](){var t=this;if(this[Ql]!=!0&&(this[Ql]=!0,!0))return this.on("rebuild",function(e){let r=globalThis.IMBA_MANIFEST;return globalThis.IMBA_MANIFEST=e,It.broadcast("rebuild",e)}),this.on("reloadHard",async function(e){return It.broadcast("reloadHard",e),await It.sseEnd(),z.exit(0)}),this.on("reloading",function(e){var r;t.state.reloading=!0,r=[];for(let s of U(It))r.push(s.pause());return r}),this.on("reloaded",async function(e){var r;t.state.reloaded=!0,It.broadcast("reloaded"),await new Promise(function(n){return setTimeout(n,100)}),r=[];for(let n of U(It))r.push(n.close());let s=r;return setTimeout(function(){return z.exit(0)},100),await Promise.all(s),z.exit(0)}),!0}send(t){if(th(z.send,Function))return z.send(t)}on(t,e){return super.on(...arguments)}reload(){if(!(this.isReloading!=!0&&(this.isReloading=!0,!0)))return this;if(this.state.reloading=!0,!z.env.IMBA_SERVE){console.warn("not possible to gracefully reload servers not started via imba start");return}this.send("reload")}},(()=>{a(Ee,mc,"Process",24)})(),Ee);function sh(i,t=[],e=0){let r=globalThis.IMBA_MANIFEST[i];if(t.indexOf(i)>=0)return t;if(r?.imports)for(let s=0,n=U(r?.imports),o=n.length;s<o;s++){let l=n[s];t.push(l),sh(l,t,e+1)}return t}var gc=Symbol(),ss=class{constructor(t,e,r={}){this.server=t,this.url=e,[this.pathname,this.query]=e.split("?"),this.ext=kt.default.extname(this.pathname),this.headers={"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public, max-age=31536000"},Object.assign(this.headers,t.options.assetHeaders||{}),Object.assign(this.headers,Ne[this.ext.slice(1)]||{}),this.headers["max-age"]=864e5,r.imports&&t.options.preload!==!1&&(this.headers.Link=sh(e).map(function(s){return"<"+s+">; rel=modulepreload; as=script"}).join(", ")),this.path=t.localPathForUrl(e)}respond(t,e){var r=this;return K.default.access(this.path,K.default.constants.R_OK,function(s){if(s)return e.writeHead(404,{}),e.end();try{if(r.server.options.setHeaders&&r.server.options.setHeaders(e,r.path),globalThis.BUN)return K.default.readFile(r.path,function(n,o){return e.writeHead(200,r.headers),e.end(o)});{let n=K.default.createReadStream(r.path);return e.writeHead(200,r.headers),n.pipe(e)}}catch{return e.writeHead(503,{}),e.end()}})}createReadStream(){return K.default.createReadStream(this.path)}pipe(t){return this.createReadStream().pipe(t)}},ts=ss;(()=>{a(ss,gc,"AssetResponder",16)})();var yc=Symbol(),ns=class{static wrap(t,e={}){return new this(t,e)}localPathForUrl(t){var n;let e,r,s=t.replace(/\?.*$/,"");return(n=this.urlToLocalPathMap)[s]??(n[s]=(e=kt.default.resolve(Ji.publicPath,"."+s),r=K.default.existsSync(e)&&e,!r&&this.staticDir&&(e=kt.default.resolve(this.staticDir,"."+s),r=K.default.existsSync(e)&&e),r))}headersForAsset(t){let e,r=kt.default.extname(t);return e=Object.assign({"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public"},Ne[r.slice(1)]||{})}get manifest(){return globalThis.IMBA_MANIFEST||{}}constructor(t,e={}){var r=this;It.add(this),this.id=Math.random(),this.startedAt=Date.now(),this.options=e,this.closed=!1,this.paused=!1,this.server=t,this.clients=new Set,this.stalledResponses=[],this.assetResponders={},this.urlToLocalPathMap={},this.publicExistsMap={},this.staticDir=globalThis.IMBA_STATICDIR||"",z.env.IMBA_PATH&&(this.devtoolsPath=kt.default.resolve(z.env.IMBA_PATH,"hmr.js")),this.scheme=th(t,ih.default.Server)?"http":"https";let s=this.server._events.request,n=globalThis[fc];t.off("request",s),s[dc]=this,t.on("listening",function(){let o=r.server.address(),l=o.address;(l=="::"||l=="0.0.0.0")&&(l="localhost");let h=""+r.scheme+"://"+l+":"+o.port+"/";if(!z.env.IMBA_CLUSTER)return console.log("listening on "+h)}),globalThis.IMBA_HMR&&(globalThis.IMBA_HMR_PATH="/__hmr__.js"),this.handler=function(o,l){var d;let h,u=o.constructor.name=="Http2ServerRequest",f=o.url;if(r.paused||r.closed)return l.statusCode=302,l.setHeader("Location",o.url),u||l.setHeader("Connection","close"),r.closed?(u&&o.stream.session.close(),l.end()):r.stalledResponses.push(l);if(f=="/__imba__.mjs"){l.writeHead(200,Ne.mjs);let p=kt.default.resolve(z.env.IMBA_PATH,"dist","imba.mjs");return K.default.createReadStream(p).pipe(l)}if(globalThis.IMBA_HMR){if(f=="/__hmr__.json")return l.writeHead(200,Ne.json),l.end(JSON.stringify(Jl));if(f=="/__hmr__.js"&&r.devtoolsPath){let p=K.default.createReadStream(r.devtoolsPath);return l.writeHead(200,Ne.js),p.pipe(l)}if(f=="/__hmr__"){let p={"Content-Type":"text/event-stream","Cache-Control":"no-cache"};return u||(p.Connection="keep-alive"),l.writeHead(200,p),r.clients.add(l),r.broadcast("init",globalThis.IMBA_MANIFEST,[l]),r.broadcast("state",Jl,[l]),o.on("close",function(){return r.clients.delete(l)}),!0}}let c=o.headers,m;u?m=c[":scheme"]+"://"+c[":authority"]:m=(o.connection.encrypted?"https":"http")+"://"+c.host;let g=r.manifest[f];if(g&&r.localPathForUrl(f))return((d=r.assetResponders)[f]||(d[f]=new ts(r,f,g))).respond(o,l);if((f.match(/\.[A-Z\d]{8}\./)||f.match(/\.\w{1,4}($|\?)/))&&(h=r.localPathForUrl(f)))try{let p=r.headersForAsset(h);if(e.setHeaders&&e.setHeaders(l,h),globalThis.BUN)return K.default.readFile(h,function($,T){return $?(l.writeHead(500,{}),l.write("Error getting the file: "+$)):(l.writeHead(200,p),l.end(T))});{let $=K.default.createReadStream(h);return l.writeHead(200,p),$.pipe(l)}}catch{return l.writeHead(503,{}),l.end()}if(n){let p=new n.Location(o.url,m);return n.Document.create({location:p},function(){return s(o,l)})}else return s(o,l)},t.on("request",this.handler),t.on("close",function(){return console.log("server is closing!")}),globalThis.IMBA_RUN&&(rs.default.isWorker||z.env.IMBA_WATCH)&&(Zl[eh](),Zl.send("serve"))}broadcast(t,e={},r=this.clients){e=JSON.stringify(e);let s="data: "+e+`
`;for(let n of U(r))n.write("event: "+t+`
`),n.write(`id: imba
`),n.write(s);return this}pause(){return this.paused!=!0&&(this.paused=!0,!0)&&this.broadcast("paused"),this}resume(){if(this.paused!=!1&&(this.paused=!1,!0))return this.broadcast("resumed"),this.flushStalledResponses()}flushStalledResponses(){for(let t=0,e=U(this.stalledResponses),r=e.length;t<r;t++)e[t].end();return this.stalledResponses=[]}close(){var t=this;return this.pause(),new Promise(function(e){return t.closed=!0,t.server.close(e),t.flushStalledResponses()})}},es=ns;(()=>{a(ns,yc,"Server",16)})();function bc(i,...t){return es.wrap(i,...t)}var os={};function $c(i,t,e){if(t!=null){let r=os[i]||(os[i]=new WeakMap);return r.get(t)||r.set(t,(e.memoized=i)&&e).get(t)}return e}function vc(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var Me=Symbol.for("#idler"),Oe=Symbol.for("#resolve"),xc=Symbol(),ls=class extends Set{constructor(){super(),this[Me]=Promise.resolve(this)}emit(t,...e){return D(this,t,e)}on(t,...e){return V(this,t,...e)}once(t,...e){return E(this,t,...e)}un(t,...e){return vt(this,t,...e)}add(t){var e=this;if(vc(t,Function)&&(t=t()),!this.has(t)){let r=this.size==0;super.add(t),r&&(this[Me]=this[Oe]=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[Oe]&&(this[Oe](!0),this[Oe]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[Me]||(this[Me]=new Promise(function(e){return t.size==0?e(!0):t[Oe]=e}))}get idleΦ(){return this.size==0}then(t,e){return this.idle.then(t,e)}},Pe=ls;(()=>{a(ls,xc,"Queue",24)})();function nh(i,t){if(t?.debugΦ==!1)return;let e=[],r=[];for(let s=0,n=Di(i),o=n.length;s<o;s++){let l=n[s];if(s%2!=0)continue;let h=i[s+1];if(l==""){r.push("%s");let u="\x1B[40m\x1B[32m";e.push(""+u+h+"\x1B[0m")}else r.push("%s %O"),e.push("\x1B[44m\x1B[97m"+l+"\x1B[0m"),e.push(h)}return[r.join(" "),...e]}var Cr=Symbol.for("#L");function Sc(){return globalThis[Cr]||(globalThis[Cr]=globalThis[Cr]||nh),!0}function wc(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var J={"":[-1,{id:1,slot:1,part:1,elementTiming:"elementtiming"}],HTML:[-1,{title:1,lang:1,translate:1,dir:1,accessKey:"accesskey",draggable:1,spellcheck:1,autocapitalize:1,inputMode:"inputmode",style:1,tabIndex:"tabindex",enterKeyHint:"enterkeyhint"}],HTMLAnchor:[1,{target:1,download:1,ping:1,rel:1,relList:"rel",hreflang:1,type:1,referrerPolicy:"referrerpolicy",coords:1,charset:1,name:1,rev:1,shape:1,href:1}],HTMLArea:[1,{alt:1,coords:1,download:1,shape:1,target:1,ping:1,rel:1,relList:"rel",referrerPolicy:"referrerpolicy",href:1}],HTMLMedia:[1,{src:1,crossOrigin:"crossorigin",preload:1,controlsList:"controlslist"}],HTMLAudio:[4,{}],HTMLBase:[1,{href:1,target:1}],HTMLQuote:[1,{cite:1}],HTMLBody:[1,{text:1,link:1,vLink:"vlink",aLink:"alink",bgColor:"bgcolor",background:1}],HTMLBR:[1,{clear:1}],HTMLButton:[1,{formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",name:1,type:1,value:1}],HTMLCanvas:[1,{width:1,height:1}],HTMLTableCaption:[1,{align:1}],HTMLTableCol:[1,{span:1,align:1,ch:"char",chOff:"charoff",vAlign:"valign",width:1}],HTMLData:[1,{value:1}],HTMLDataList:[1,{}],HTMLMod:[1,{cite:1,dateTime:"datetime"}],HTMLDetails:[1,{}],HTMLDialog:[1,{}],HTMLDiv:[1,{align:1}],HTMLDList:[1,{}],HTMLEmbed:[1,{src:1,type:1,width:1,height:1,align:1,name:1}],HTMLFieldSet:[1,{name:1}],HTMLForm:[1,{acceptCharset:"accept-charset",action:1,autocomplete:1,enctype:1,encoding:"enctype",method:1,name:1,target:1}],HTMLHeading:[1,{align:1}],HTMLHead:[1,{}],HTMLHR:[1,{align:1,color:1,size:1,width:1}],HTMLHtml:[1,{version:1}],HTMLIFrame:[1,{src:1,srcdoc:1,name:1,sandbox:1,width:1,height:1,referrerPolicy:"referrerpolicy",csp:1,allow:1,align:1,scrolling:1,frameBorder:"frameborder",longDesc:"longdesc",marginHeight:"marginheight",marginWidth:"marginwidth",loading:1}],HTMLImage:[1,{alt:1,src:1,srcset:1,sizes:1,crossOrigin:"crossorigin",useMap:"usemap",width:1,height:1,referrerPolicy:"referrerpolicy",decoding:1,name:1,lowsrc:1,align:1,hspace:1,vspace:1,longDesc:"longdesc",border:1,loading:1}],HTMLInput:[1,{accept:1,alt:1,autocomplete:1,dirName:"dirname",formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",height:1,max:1,maxLength:"maxlength",min:1,minLength:"minlength",name:1,pattern:1,placeholder:1,src:1,step:1,type:1,defaultValue:"value",value:1,width:1,align:1,useMap:"usemap",required:1}],HTMLLabel:[1,{htmlFor:"for"}],HTMLLegend:[1,{align:1}],HTMLLI:[1,{value:1,type:1}],HTMLLink:[1,{href:1,crossOrigin:"crossorigin",rel:1,relList:"rel",media:1,hreflang:1,type:1,as:1,referrerPolicy:"referrerpolicy",sizes:1,imageSrcset:"imagesrcset",imageSizes:"imagesizes",charset:1,rev:1,target:1,integrity:1}],HTMLMap:[1,{name:1}],HTMLMenu:[1,{}],HTMLMeta:[1,{name:1,httpEquiv:"http-equiv",content:1,scheme:1,property:1,charset:1}],HTMLMeter:[1,{value:1,min:1,max:1,low:1,high:1,optimum:1}],HTMLObject:[1,{data:1,type:1,name:1,useMap:"usemap",width:1,height:1,align:1,archive:1,code:1,hspace:1,standby:1,vspace:1,codeBase:"codebase",codeType:"codetype",border:1}],HTMLOList:[1,{start:1,type:1}],HTMLOptGroup:[1,{label:1}],HTMLOption:[1,{label:1,value:1}],HTMLOutput:[1,{htmlFor:"for",name:1}],HTMLParagraph:[1,{align:1}],HTMLParam:[1,{name:1,value:1,type:1,valueType:"valuetype"}],HTMLPicture:[1,{}],HTMLPre:[1,{width:1}],HTMLProgress:[1,{value:1,max:1}],HTMLScript:[1,{src:1,type:1,charset:1,crossOrigin:"crossorigin",referrerPolicy:"referrerpolicy",event:1,htmlFor:"for",integrity:1,defer:1,async:1}],HTMLSelect:[1,{autocomplete:1,name:1,size:1,value:1,required:1}],HTMLSlot:[1,{name:1}],HTMLSource:[1,{src:1,type:1,srcset:1,sizes:1,media:1}],HTMLSpan:[1,{}],HTMLStyle:[1,{media:1,type:1}],HTMLTable:[1,{align:1,border:1,frame:1,rules:1,summary:1,width:1,bgColor:"bgcolor",cellPadding:"cellpadding",cellSpacing:"cellspacing"}],HTMLTableSection:[1,{align:1,ch:"char",chOff:"charoff",vAlign:"valign"}],HTMLTableCell:[1,{colSpan:"colspan",rowSpan:"rowspan",headers:1,align:1,axis:1,height:1,width:1,ch:"char",chOff:"charoff",vAlign:"valign",bgColor:"bgcolor",abbr:1,scope:1}],HTMLTemplate:[1,{}],HTMLTextArea:[1,{autocomplete:1,cols:1,dirName:"dirname",maxLength:"maxlength",minLength:"minlength",name:1,placeholder:1,rows:1,wrap:1}],HTMLTime:[1,{dateTime:"datetime"}],HTMLTitle:[1,{}],HTMLTableRow:[1,{align:1,ch:"char",chOff:"charoff",vAlign:"valign",bgColor:"bgcolor"}],HTMLTrack:[1,{kind:1,src:1,srclang:1,label:1}],HTMLUList:[1,{type:1}],HTMLVideo:[4,{width:1,height:1,poster:1}],SVG:[-1,{}],SVGGraphics:[66,{transform:1}],SVGA:[67,{}],SVGAnimation:[66,{}],SVGAnimate:[69,{}],SVGAnimateMotion:[69,{}],SVGAnimateTransform:[69,{}],SVGGeometry:[67,{}],SVGCircle:[73,{cx:1,cy:1,r:1}],SVGClipPath:[67,{clipPathUnits:1}],SVGDefs:[67,{}],SVGDesc:[66,{}],SVGDiscard:[66,{}],SVGEllipse:[73,{cx:1,cy:1,rx:1,ry:1}],SVGFEBlend:[66,{mode:1,x:1,y:1,width:1,height:1}],SVGFEColorMatrix:[66,{type:1,values:1,x:1,y:1,width:1,height:1}],SVGFEComponentTransfer:[66,{x:1,y:1,width:1,height:1}],SVGFEComposite:[66,{operator:1,x:1,y:1,width:1,height:1}],SVGFEConvolveMatrix:[66,{orderX:1,orderY:1,kernelMatrix:1,divisor:1,edgeMode:1,x:1,y:1,width:1,height:1}],SVGFEDiffuseLighting:[66,{surfaceScale:1,diffuseConstant:1,x:1,y:1,width:1,height:1}],SVGFEDisplacementMap:[66,{xChannelSelector:1,yChannelSelector:1,x:1,y:1,width:1,height:1}],SVGFEDistantLight:[66,{}],SVGFEDropShadow:[66,{dx:1,dy:1,stdDeviationX:1,stdDeviationY:1,x:1,y:1,width:1,height:1}],SVGFEFlood:[66,{x:1,y:1,width:1,height:1}],SVGComponentTransferFunction:[66,{type:1,tableValues:1,slope:1,amplitude:1,exponent:1}],SVGFEFuncA:[90,{}],SVGFEFuncB:[90,{}],SVGFEFuncG:[90,{}],SVGFEFuncR:[90,{}],SVGFEGaussianBlur:[66,{x:1,y:1,width:1,height:1}],SVGFEImage:[66,{preserveAspectRatio:1,x:1,y:1,width:1,height:1}],SVGFEMerge:[66,{x:1,y:1,width:1,height:1}],SVGFEMergeNode:[66,{}],SVGFEMorphology:[66,{operator:1,x:1,y:1,width:1,height:1}],SVGFEOffset:[66,{x:1,y:1,width:1,height:1}],SVGFEPointLight:[66,{}],SVGFESpecularLighting:[66,{surfaceScale:1,specularConstant:1,specularExponent:1,x:1,y:1,width:1,height:1}],SVGFESpotLight:[66,{specularExponent:1}],SVGFETile:[66,{x:1,y:1,width:1,height:1}],SVGFETurbulence:[66,{numOctaves:1,stitchTiles:1,type:1,x:1,y:1,width:1,height:1}],SVGFilter:[66,{filterUnits:1,primitiveUnits:1,x:1,y:1,width:1,height:1}],SVGForeignObject:[67,{x:1,y:1,width:1,height:1}],SVGG:[67,{}],SVGImage:[67,{x:1,y:1,width:1,height:1,preserveAspectRatio:1}],SVGLine:[73,{x1:1,y1:1,x2:1,y2:1}],SVGGradient:[66,{gradientUnits:1,gradientTransform:1,spreadMethod:1}],SVGLinearGradient:[111,{x1:1,y1:1,x2:1,y2:1}],SVGMarker:[66,{refX:1,refY:1,markerUnits:1,markerWidth:1,markerHeight:1,orientType:1,orientAngle:1,viewBox:1,preserveAspectRatio:1}],SVGMask:[66,{maskUnits:1,maskContentUnits:1,x:1,y:1,width:1,height:1}],SVGMetadata:[66,{}],SVGMPath:[66,{}],SVGPath:[73,{}],SVGPattern:[66,{patternUnits:1,patternContentUnits:1,patternTransform:1,x:1,y:1,width:1,height:1,viewBox:1,preserveAspectRatio:1}],SVGPolygon:[73,{}],SVGPolyline:[73,{}],SVGRadialGradient:[111,{cx:1,cy:1,r:1,fx:1,fy:1,fr:1}],SVGRect:[73,{x:1,y:1,width:1,height:1,rx:1,ry:1}],SVGScript:[66,{}],SVGSet:[69,{}],SVGStop:[66,{}],SVGStyle:[66,{}],SVGSVG:[67,{x:1,y:1,width:1,height:1,viewBox:1,preserveAspectRatio:1}],SVGSwitch:[67,{}],SVGSymbol:[66,{viewBox:1,preserveAspectRatio:1}],SVGTextContent:[67,{textLength:1,lengthAdjust:1}],SVGTextPositioning:[130,{x:1,y:1,dx:1,dy:1,rotate:1}],SVGText:[131,{}],SVGTextPath:[130,{startOffset:1,method:1,spacing:1}],SVGTitle:[66,{}],SVGTSpan:[131,{}],SVGUse:[67,{x:1,y:1,width:1,height:1}],SVGView:[66,{viewBox:1,preserveAspectRatio:1}]},N={a:2,abbr:1,address:1,area:3,article:1,aside:1,audio:5,b:1,base:6,bdi:1,bdo:1,blockquote:7,body:8,br:9,button:10,canvas:11,caption:12,cite:1,code:1,col:13,colgroup:13,data:14,datalist:15,dd:1,del:16,details:17,dfn:1,dialog:18,div:19,dl:20,dt:1,em:1,embed:21,fieldset:22,figcaption:1,figure:1,footer:1,form:23,h1:24,h2:24,h3:24,h4:24,h5:24,h6:24,head:25,header:1,hgroup:1,hr:26,html:27,i:1,iframe:28,img:29,input:30,ins:16,kbd:1,label:31,legend:32,li:33,link:34,main:1,map:35,mark:1,menu:36,meta:37,meter:38,nav:1,noscript:1,object:39,ol:40,optgroup:41,option:42,output:43,p:44,param:45,picture:46,pre:47,progress:48,q:7,rp:1,rt:1,ruby:1,s:1,samp:1,script:49,section:1,select:50,slot:51,small:1,source:52,span:53,strike:1,strong:1,style:54,sub:1,summary:1,sup:1,table:55,tbody:56,td:57,template:58,textarea:59,tfoot:56,th:57,thead:56,time:60,title:61,tr:62,track:63,u:1,ul:64,var:1,video:65,wbr:1,svg_a:68,svg_animate:70,svg_animateMotion:71,svg_animateTransform:72,svg_audio:66,svg_canvas:66,svg_circle:74,svg_clipPath:75,svg_defs:76,svg_desc:77,svg_discard:78,svg_ellipse:79,svg_feBlend:80,svg_feColorMatrix:81,svg_feComponentTransfer:82,svg_feComposite:83,svg_feConvolveMatrix:84,svg_feDiffuseLighting:85,svg_feDisplacementMap:86,svg_feDistantLight:87,svg_feDropShadow:88,svg_feFlood:89,svg_feFuncA:91,svg_feFuncB:92,svg_feFuncG:93,svg_feFuncR:94,svg_feGaussianBlur:95,svg_feImage:96,svg_feMerge:97,svg_feMergeNode:98,svg_feMorphology:99,svg_feOffset:100,svg_fePointLight:101,svg_feSpecularLighting:102,svg_feSpotLight:103,svg_feTile:104,svg_feTurbulence:105,svg_filter:106,svg_foreignObject:107,svg_g:108,svg_iframe:66,svg_image:109,svg_line:110,svg_linearGradient:112,svg_marker:113,svg_mask:114,svg_metadata:115,svg_mpath:116,svg_path:117,svg_pattern:118,svg_polygon:119,svg_polyline:120,svg_radialGradient:121,svg_rect:122,svg_script:123,svg_set:124,svg_stop:125,svg_style:126,svg_svg:127,svg_switch:128,svg_symbol:129,svg_text:132,svg_textPath:133,svg_title:134,svg_tspan:135,svg_unknown:66,svg_use:136,svg_video:66,svg_view:137},hs=Object.keys(J);for(let i=0,t=wc(hs),e=t.length;i<e;i++){let r=t[i],s=J[r];s.name=r+"Element",s.up=J[hs[s[0]]]}for(let i=0,t=Object.keys(N),e=t.length,r,s;i<e;i++)r=t[i],s=N[r],N[r]=J[hs[s]],r.indexOf("svg_")==0&&(N[r.replace("_",":")]=N[r]);var as=require("async_hooks");var oh=Symbol.for("#toStringDeopt"),lh=Symbol.for("#symbols"),hh=Symbol.for("#batches"),ah=Symbol.for("#extras"),us=Symbol.for("#stacks"),_c=Symbol(),cs=class{constructor(t){this.dom=t,this.string=""}contains(t){return this.dom.classList.contains(t)}has(t){return this.dom.classList.contains(t)}add(t){return this.contains(t)?this:(this.string+=(this.string?" ":"")+t,this.dom.classList.add(t),this)}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[lh],s=this[hh],n=!0;if(!r)r=this[lh]=[t],s=this[hh]=[e||""],this.toString=this.valueOf=this[oh];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[ah]=" "+s.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[oh](){return this.string+(this[ah]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[us]||(this[us]={})}},Ft=cs;(()=>{a(cs,_c,"Flags",16)})();var uh=Symbol.for("#__init__"),fs=Symbol.for("#getRenderContext"),Tc=Symbol.for("#getDynamicContext"),M={context:null},Lc=Symbol(),ps=class{constructor(t=null){this[uh](t)}[uh](t=null,e=!0,r=!0){var s;this.stack=t&&(s=t.stack)!==void 0?s:[]}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}},ds=ps;(()=>{a(ps,Lc,"Renderer",16)})();var Zt=new ds,Cc=Symbol(),Nr=class extends Map{constructor(t,e=null){super(),this._=t,this.sym=e}pop(){return M.context=null}[fs](t){let e=this.get(t);return e||this.set(t,e=new Nr(this._,t)),M.context=e}[Tc](t,e){return this[fs](t)[fs](e)}run(t){return this.value=t,M.context==this&&(M.context=null),this.get(t)}cache(t){return this.set(this.value,t),t}},ht=Nr;(()=>{a(Nr,Cc,"RenderContext",16)})();function Ie(i,t=Symbol(),e=i){return M.context=i[t]||(i[t]=new ht(e,t))}function Nc(){let i=M.context,t=i||new ht(null);return globalThis.DEBUG_IMBA&&!i&&Zt.stack.length>0&&console.trace("detected unmemoized nodes in",Zt.stack.slice(0),"see https://imba.io",t),i&&(M.context=null),t}function tt(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function Ve(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var Ls=Symbol.for("#parent"),bh=Symbol.for("#context"),ch=Symbol.for("#closestNode"),Ec=Symbol.for("#parentNode"),At=Symbol.for("#__init__"),Mc=Symbol.for("##inited"),ms=Symbol.for("#getRenderContext"),Oc=Symbol.for("#getDynamicContext"),gs=Symbol.for("#replaceChild"),je=Symbol.for("#appendChild"),fh=Symbol.for("#removeChild"),xt=Symbol.for("#insertInto"),dh=Symbol.for("#insertChild"),ke=Symbol.for("#removeFrom"),ph=Symbol.for("#removeFromDeopt"),te=Symbol.for("#replaceWith"),mh=Symbol.for("#replaceWithDeopt"),ys=Symbol.for("#placeholderNode"),Pc=Symbol.for("#attachToParent"),Ic=Symbol.for("#detachFromParent"),kc=Symbol.for("#placeChild"),Fc=Symbol.for("#beforeReconcile"),Ac=Symbol.for("#afterReconcile"),Rc=Symbol.for("#afterVisit"),Hc=Symbol.for("#visitContext"),bs=Symbol.for("#document"),Or=Symbol.for("#htmlNodeName"),gh=Symbol.for("#ImbaElement"),$s=Symbol.for("#flags"),ee=Symbol.for("#scripts"),Er=Symbol.for("#location"),vs=Symbol.for("##document"),$h=Symbol.for("##parent"),Vc=Symbol.for("##up"),xs=Symbol.for("##context"),Fe=Symbol.for("#domNode"),Ae=Symbol.for("##placeholderNode"),yh=Symbol.for("#domDeopt"),Dc=Symbol.for("#insertIntoDeopt"),Ss=Symbol.for("##classList"),Re=Symbol.for("##style"),ws=Symbol.for("##dataset"),at=Symbol.for("#asset"),_s=Symbol.for("#innerHTML"),He=Symbol.for("##visitContext"),jc=Symbol.for("#isRichElement"),De=Symbol.for("#src"),Gc=Symbol.for("#getSlot"),zc=Symbol.for("#cssns"),Bc=Symbol.for("#cssid"),Uc=Symbol.for("#dom"),Kc={},Pr=null,qc=Symbol(),Is=class extends URL{},re=Is;(()=>{a(Is,qc,"Location",0)})();var Yc=Symbol(),ks=class{get document(){return this[bs]||(this[bs]=new this.Document(this))}get location(){return this.document.location}},Cs=ks;(()=>{a(ks,Yc,"Window",0)})();function Wc(){return globalThis.imba.uses_window=!0,!0}var Xc={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Z=null,vh={},Qc=Symbol(),Fs=class{define(){return this}get(){return this}upgrade(){}whenDefined(){}},Ns=Fs;(()=>{a(Fs,Qc,"CustomElementRegistry",0)})();var Jc=new Ns,xh={};function ut(i,t){let e=i;if(typeof i=="string"&&(i=J[i]||N[i]||J[i+"Element"]||N["svg_"+i]),tt(i,O))return i;if(!i)return ut("HTML");if(i&&!i.klass){let r=Symbol(),n=class extends ut(i.up){},s=n;(()=>{a(n,r,"element",0)})(),i.klass=s}if(i&&!i.idl){i.idl=!0;let r=Object.getOwnPropertyDescriptors(i.klass.prototype);for(let s=i[1],n=0,o=Object.keys(s),l=o.length,h,u;n<l;n++){h=o[n],u=s[h];let f=u==1?h:u;r[f]||f=="style"||Object.defineProperty(i.klass.prototype,h,{set:function(c){this.setAttribute(f,c)},get:function(){return this.getAttribute(f)}})}}return i.klass}function Zc(i,t,e){var n;let r=ut(i,t);if(!(r==e||tt(r.prototype,e)||r.prototype[Or])){let o=r.prototype[gh];if(!o){let l=Symbol();o=(n=class extends r{constructor(){super(...arguments),this.__slots={},this.__F=0}},(()=>{a(n,l,"CustomBuiltInElement",16)})(),n),r.prototype[gh]=o;let h=Object.getOwnPropertyDescriptors(e.prototype);Object.defineProperties(o.prototype,h),o.prototype[Or]=i}return o}return r}var Mr=function(i){let t=typeof i=="string"?i:String(i);return t.indexOf('"')>=0&&(t=t.replace(/\"/g,""")),t},Es=function(i,t){let e=typeof i=="string"?i:String(i);return t=="script"||(e.indexOf('"')>=0&&(e=e.replace(/\"/g,""")),e.indexOf("<")>=0&&(e=e.replace(/\</g,"<")),e.indexOf(">")>=0&&(e=e.replace(/\>/g,">"))),e},tf=Symbol(),Dr=class{static create(t,e){let r=new Dr;return r[bh]=t,r.location=t.location,Pr||(Pr=new as.AsyncLocalStorage),Pr.run(r,e),r}constructor(){}get flags(){return this[$s]||(this[$s]=new Ft({classList:new Ir(this)}))}get scripts(){return this[ee]||(this[ee]=[])}set location(t){typeof t=="string"&&(t=new re(t)),this[Er]=t}get location(){return this[Er]||(this[Er]=new re("http://localhost/"))}createElement(t){let e=ut(t),r=new e(t);return r.nodeName=t,r}createElementNS(t,e){if(t=="http://www.w3.org/2000/svg"){let r=ut("svg_"+e),s=new r;return s.nodeName=e,s}return this.createElement(e)}createTextNode(t){return new Ht(t)}createComment(t){return new ft(t)}createDocumentFragment(){return new Ge}getElementById(t){return null}},ct=Dr;(()=>{a(Dr,tf,"Document",16)})();var dt=new ct,Ms=dt;function ce(){return Pr&&Pr?.getStore?.()||dt}var ef=Symbol(),jr=class{constructor(t,e){this.classes=e||[],this.dom=t}add(t){return this.classes.indexOf(t)<0&&this.classes.push(t),this}remove(t){let e=this.classes.indexOf(t);return e>=0&&(this.classes[e]=""),this}toggle(t){return this.contains(t)?this.remove(t):this.add(t),this}contains(t){return this.classes.indexOf(t)>=0}clone(t){return new jr(t,this.classes.slice(0))}toString(){return this.classes.join(" ").trim()}},Ir=jr;(()=>{a(jr,ef,"DOMTokenList",16)})();var rf=Symbol(),As=class{constructor(){}removeProperty(t){var e;return e=this[t],delete this[t],e}setProperty(t,e){return this[t]=e}toString(){let t=[];for(let e=this,r=0,s=Object.keys(e),n=s.length,o,l;r<n;r++)o=s[r],l=e[o],tt(l,Function)||t.push(""+o+": "+l);return t.join(";")}},kr=As;(()=>{a(As,rf,"StyleDeclaration",16)})();var sf=Symbol(),Gr=class{static wrap(t){return new Proxy(t.attributes,new Gr)}set(t,e,r){return t["data-"+e]=r,!0}get(t,e){return t["data-"+e]}},Os=Gr;(()=>{a(Gr,sf,"DataSet",0)})();var nf={get(i,t){let e=i,r;for(;e&&r==null;)(e=e[Ls])&&(r=e[t]);return r}},of=Symbol(),Rs=class{toString(){return this.outerHTML}get outerHTML(){return""}text$(t){return this.textContent=t,this}get ownerDocument(){return this[vs]||(this[vs]=ce())}get[Ls](){return this[$h]||this.parentNode||this[Vc]}get[bh](){return this[xs]||(this[xs]=new Proxy(this,nf))}get[ch](){return this}get[Ec](){return this[Ls]?.[ch]}[At](){return this}[Mc](){return this}[ms](t){return Ie(this,t)}[Oc](t,e){return this[ms](t)[ms](e)}[gs](t,e){let r=this[dh](t,e);return this[fh](e),r}[je](t){return t[xt](this,null)}[fh](t){return t[ke](this)}[xt](t,e){return e?t.insertBefore(this,e):t.appendChild(this),this}[dh](t,e){return t[xt](this,e)}[ke](t){return t.removeChild(this)}[ph](t){return t.removeChild(this[Fe]||this)}[te](t,e){return e[gs](t,this)}[mh](t,e){return e[gs](t,this[Fe]||this)}get[ys](){return this[Ae]||(this[Ae]=dt.createComment("placeholder"))}set[ys](t){let e=this[Ae];this[Ae]=t,e&&e!=t&&e.parentNode&&e[te](t)}[Pc](){let t=this[Fe],e=t&&t.parentNode;return t&&e&&t!=this&&(this[Fe]=null,this[xt](e,t),t[ke](e)),this}[Ic](){this[yh]!=!0&&(this[yh]=!0,!0)&&(this[te]=this[mh],this[ke]=this[ph],this[xt]=this[Dc]);let t=this[ys];return this.parentNode&&t!=this&&(t[xt](this.parentNode,this),this[ke](this.parentNode)),this[Fe]=t,this}[kc](t,e,r){let s=typeof t;if(s==="undefined"||t===null){if(r&&tt(r,ft))return r;let n=new ft("");return r?r[te](n,this):n[xt](this,null)}if(t===r)return t;if(s!=="object"){let n,o=t;return e&128&&e&256,r?tt(r,Ht)?(r.textContent=o,r):(n=Ms.createTextNode(o),r[te](n,this),n):(this.appendChild(n=Ms.createTextNode(o)),n)}else return r?r[te](t,this):t[xt](this,null)}},O=Rs;(()=>{a(Rs,of,"Node",0)})();var lf=Symbol(),Hs=class extends O{constructor(t){super(),this.textContent=t??""}get outerHTML(){return this.textContent}},Ht=Hs;(()=>{a(Hs,lf,"Text",16)})();var hf=Symbol(),Vs=class extends O{constructor(t){super(),this.value=t}get outerHTML(){return"<!-- "+Es(this.value)+" -->"}toString(){return this.tag&&this.tag.toNodeString?this.tag.toNodeString():this.outerHTML}},ft=Vs;(()=>{a(Vs,hf,"Comment",16)})();var af=Symbol(),Rt=class extends O{constructor(t){super(),this.nodeName=t,this.childNodes=[],this.attributes={}}emit(t,e,r={bubbles:!0}){console.warn("Element#emit not supported on node")}get classList(){return this[Ss]||(this[Ss]=new Ir(this))}get style(){return this[Re]||(this[Re]=new kr)}get dataset(){return this[ws]||(this[ws]=Os.wrap(this))}get richValue(){return this.value}set richValue(t){this.value=t}set asset(t){this[at]=t}get asset(){return this[at]}flag$(){return this}flagIf$(){return this}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t}removeChild(t){let e=this.childNodes.indexOf(t);return e>=0&&this.childNodes.splice(e,1),this}replaceChild(t,e){let r=this.childNodes.indexOf(e);return r>=0&&(this.childNodes.splice(r,1,t),t.parentNode=this),e}insertBefore(t,e){let r=this.childNodes.indexOf(e);return this.childNodes.splice(r,0,t),this}setAttribute(t,e){return this.attributes[t]=e,this}setAttributeNS(t,e,r){return this.setAttribute(t+":"+e,r)}getAttribute(t){return this.attributes?this.attributes[t]:void 0}getAttributeNS(t,e){return this.getAttribute(t+":"+e)}removeAttribute(t){var e;return e=this.attributes[t],delete this.attributes[t],!0}addEventListener(){return this}removeEventListener(){return this}resolve(){return this}set innerHTML(t){this[_s]=t}get innerHTML(){let t="";if(this[_s])return this[_s];if(this.textContent!=null)return Es(this.textContent);for(let e=0,r=Ve(this.childNodes),s=r.length;e<s;e++){let n=r[e];typeof n=="string"?t+=Es(n,this.nodeName):tt(n,Number)?t+=""+n:n&&(t+=n.outerHTML)}return t}get outerHTML(){let t=this.nodeName,e=this[Or],r=""+t;e&&(r=""+e+" is='"+t+"'",t=e);let s,n=this.classList.toString();this.dehydrate&&(n=n?"_ssr_ "+n:"_ssr_",this.dehydrate()),(s=this.id)&&(r+=' id="'+Mr(s)+'"'),n&&(r+=' class="'+Mr(n)+'"');for(let o=this.attributes,l=0,h=Object.keys(o),u=h.length,f,c;l<u;l++)f=h[l],c=o[f],r+=" "+f+'="'+Mr(c)+'"';return this[Re]&&(r+=' style="'+Mr(this[Re].toString())+'"'),Xc[t]?"<"+r+">":"<"+r+">"+this.innerHTML+"</"+t+">"}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get firstElementChild(){let t=this.childNodes.length,e=0;for(;e<t;){let r=this.childNodes[e++];if(tt(r,Rt))return r}return null}get lastElementChild(){let t=this.childNodes.length;for(;t>0;){let e=this.childNodes[--t];if(tt(e,Rt))return e}return null}get className(){return this.classList.toString()}set className(t){this.classList.classes=(t||"").split(" "),this.classList.toString()}log(...t){return console.log(...t)}text$(t){return this.textContent=t,this}[Fc](){return this}[Ac](){return this}[Rc](){this.render&&this.render(),this[He]&&(this[He]=null)}get[Hc](){return this[He]||(this[He]={})}get flags(){return this.$flags||(this.$flags=new Ft(this),this.flag$==Rt.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=wr(this,t,Rt);!r||!r.set?this.setAttribute(t,e):this[t]=e}},y=Rt;(()=>{a(Rt,af,"Element",16)})();y.prototype.setn