imba
Version:
6 lines (4 loc) • 150 kB
JavaScript
var zu=Object.create;var Ge=Object.defineProperty;var Uu=Object.getOwnPropertyDescriptor;var qu=Object.getOwnPropertyNames;var Ku=Object.getPrototypeOf,Wu=Object.prototype.hasOwnProperty;var Yu=(t,e)=>{for(var s in e)Ge(t,s,{get:e[s],enumerable:!0})},qi=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qu(e))!Wu.call(t,i)&&i!==s&&Ge(t,i,{get:()=>e[i],enumerable:!(r=Uu(e,i))||r.enumerable});return t};var se=(t,e,s)=>(s=t!=null?zu(Ku(t)):{},qi(e||!t||!t.__esModule?Ge(s,"default",{value:t,enumerable:!0}):s,t)),Xu=t=>qi(Ge({},"__esModule",{value:!0}),t);var Km={};Yu(Km,{Accessor:()=>Bi,Action:()=>qs,CUSTOM_TYPES:()=>xi,ClassFlags:()=>qt,Comment:()=>$t,Component:()=>Re,ComputedType:()=>Gi,CustomEvent:()=>D,Document:()=>Pe,DocumentFragment:()=>Hs,EaseGroup:()=>nu,Easer:()=>Fi,Element:()=>b,ElementRoute:()=>Us,ElementRouteTo:()=>ji,Emitter:()=>ke,Event:()=>K,EventHandler:()=>zs,FocusEvent:()=>Ni,Fragment:()=>Jt,HAS:()=>dh,HTMLButtonElement:()=>Vs,HTMLElement:()=>F,HTMLHtmlElement:()=>wi,HTMLInputElement:()=>As,HTMLLinkElement:()=>Ei,HTMLOptionElement:()=>js,HTMLScriptElement:()=>Li,HTMLSelectElement:()=>Fs,HTMLStyleElement:()=>Mi,HTMLTextAreaElement:()=>Rs,ImbaElement:()=>Zh,IntersectionEventDefaults:()=>je,KeyboardEvent:()=>Ci,LazyProxy:()=>hi,Location:()=>Oe,MouseEvent:()=>Ds,Node:()=>j,OBSERVED:()=>w,ObservableArray:()=>Di,PointerEvent:()=>$i,Queue:()=>Si,Ref:()=>te,RenderContext:()=>Xt,Router:()=>Vi,SVGElement:()=>Fe,SVGSVGElement:()=>ki,Scheduler:()=>ci,ShadowRoot:()=>Gh,StyleDeclaration:()=>Ti,Text:()=>Ie,Touch:()=>Ri,UIEvent:()=>He,Window:()=>Rh,__has__$:()=>ni,__hooks__$:()=>$s,__imba__$:()=>Cs,__init__$:()=>Mt,__inited__$:()=>ii,__initor__$:()=>Ns,__meta__$:()=>oi,__mixin__$:()=>lh,__patch__$:()=>oh,__served__:()=>wh,accessor:()=>Au,afterReconcile$:()=>ch,afterVisit$:()=>hh,appendChild$:()=>ah,atomic:()=>Tu,augment$:()=>Ce,autorun:()=>Su,awaits:()=>_u,beforeReconcile$:()=>uh,clearInterval:()=>pi,clearTimeout:()=>mi,colors:()=>tu,commit:()=>H,createAtom:()=>bu,createComment:()=>Ct,createComponent:()=>Oi,createDynamic:()=>qh,createElement:()=>Bh,createFragment:()=>Uh,createIndexedList:()=>Xh,createKeyedList:()=>Qh,createLiveFragment:()=>Yh,createRef:()=>$u,createRenderContext:()=>Ps,createSVGElement:()=>zh,createSlot:()=>Ae,createTextNode:()=>Gs,customElements:()=>jh,decorate$:()=>Sh,defineConfig:()=>Eh,defineTag:()=>Kh,descriptor:()=>Ru,devlog$:()=>vh,disposeObservables:()=>Cu,document:()=>Is,emit:()=>nt,env:()=>bi,events:()=>lu,extend$:()=>ks,getComputed:()=>ku,getDeepPropertyDescriptor:()=>Os,getRenderContext:()=>Ah,getSuperTagType:()=>Dh,getTagType:()=>ot,get_document:()=>Qt,has$:()=>gh,hooks:()=>gi,hotkeys:()=>gu,hydrate:()=>Jh,idx$:()=>yh,inited$:()=>Th,is$:()=>ph,isa$:()=>mh,iterable$:()=>ai,listen:()=>it,locals:()=>ju,logFormatter:()=>_i,matcher:()=>li,memofunc:()=>Ih,mount:()=>Ii,multi$:()=>_h,observable:()=>xu,once:()=>I,parseTime:()=>Kt,proxy:()=>ui,register$:()=>a,render:()=>su,renderContext:()=>M,renderer:()=>Yt,reportChanged:()=>Eu,reportInvalidated:()=>Mu,reportObserved:()=>Nu,router:()=>vu,run:()=>wu,rx:()=>Zt,scheduler:()=>C,serve:()=>Ph,session:()=>Du,setInterval:()=>di,setTimeout:()=>fi,spy:()=>Lu,statics$:()=>bh,styles:()=>Pi,sup$:()=>xh,toCamelCase:()=>Lh,transitions:()=>Ve,unlisten:()=>Wt,unmount:()=>Hi,up$:()=>fh,use_devlog:()=>Hh,use_dom_bind:()=>ru,use_dom_teleport:()=>iu,use_dom_transitions:()=>ou,use_events:()=>au,use_events_hotkey:()=>mu,use_events_intersect:()=>cu,use_events_keyboard:()=>Ai,use_events_mouse:()=>Bs,use_events_mutate:()=>du,use_events_pointer:()=>hu,use_events_resize:()=>fu,use_events_selection:()=>pu,use_events_touch:()=>uu,use_hooks:()=>Mh,use_router:()=>yu,use_slots:()=>Wh,use_styles:()=>eu,use_window:()=>Vh,\u03B1action:()=>Fu,\u03B1autorun:()=>Hu,\u03B1bound:()=>$h,\u03B1computed:()=>Ou,\u03B1lazy:()=>Nh,\u03B1observable:()=>Pu,\u03B1prop:()=>Vu,\u03B1ref:()=>Iu,\u03B1thenable:()=>Ch});module.exports=Xu(Km);var yi=se(require("cluster")),q=se(require("fs")),Nt=se(require("path")),kh=require("events"),vi=se(require("path")),Oh=se(require("http")),Fh=require("async_hooks"),Mt=Symbol.for("#__init__"),Ns=Symbol.for("#__initor__"),ii=Symbol.for("#__inited__"),$s=Symbol.for("#__hooks__"),oh=Symbol.for("#__patch__"),ni=Symbol.for("#has"),oi=Symbol.for("#meta"),Cs=Symbol.for("imba"),lh=Symbol.for("#__mixin__"),li=Symbol.for("#matcher"),Be=Symbol.for("#L"),ah=Symbol.for("#appendChild"),hh=Symbol.for("#afterVisit"),uh=Symbol.for("#beforeReconcile"),ch=Symbol.for("#afterReconcile"),fh=Symbol.for("##up"),dh={SUPERCALLS:1<<3,CONSTRUCTOR:1<<4},qt={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},kt=new Map,Qu=globalThis[Cs]||(globalThis[Cs]={counter:0,classes:kt});function Ot(t,e={}){return kt.has(t)||kt.set(t,{symbol:Symbol(t.name),parent:Object.getPrototypeOf(t.prototype)?.constructor,for:t,uses:null,inits:null,id:Qu.counter++,...e}),kt.get(t)}var Ki=new WeakMap;function ph(t,e){return t===e||e?.[li]?.(t)}function mh(t,e){return typeof e=="string"?typeof t===e:e?.[Symbol.hasInstance]?.(t)}function gh(t,e){return e?.[ni]?.(t)??e?.includes?.(t)??e?.has?.(t)??!1}function yh(t,e){return e?.indexOf?e.indexOf(t):Array.prototype.indexOf.call(t,e)}function vh(t,e,...s){return e&&e[Be]instanceof Function?t=e[Be](t,e,...s):globalThis[Be]instanceof Function&&(t=globalThis[Be](t,e,...s)),t}function bh(t){return Ki.get(t)||Ki.set(t,{}).get(t)}function ai(t){return t?.toIterable?.()||t}function Sh(t,e,s,r){let i,n=arguments.length,o=t.length,l=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,s):r;for(;o>0;)(i=t[--o])&&(l=(n<3?i(l):n>3?i(e,s,l):i(e,s))||l);return n>3&&l&&Object.defineProperty(e,s,l),l}function Ju(t,e){if(!t||!e)return!1;if(t.get)return e.get===t.get;if(t.set)return e.set===t.set;if(t.value)return t.value===e.value}function ks(t,e,s,r={}){let i=t.constructor;!s&&e&&(s=Object.getOwnPropertyDescriptors(e),delete s.constructor,s[Mt]&&(console.warn(`Cannot define plain fields when extending class ${i.name}`),delete s[Mt]));let n=Ot(i);if(n&&n.augments){let o=new Map;for(let l of Object.keys(s)){let h=Object.getOwnPropertyDescriptor(t,l);for(let c of n.augments){let u=o.get(c);u||o.set(c,u={});let d=Object.getOwnPropertyDescriptor(c.prototype,l);d&&!Ju(h,d)?console.warn("wont extend",l,d,h):u[l]=s[l]}}for(let[l,h]of o)Object.keys(h).length&&ks(l.prototype,null,h)}return Object.defineProperties(t,s),t}function Ce(t,e){let s=Ot(t),r=Ot(e);if(r.parent&&!(t.prototype instanceof r.parent))throw new Error(`Mixin ${e.name} has superclass not present in target class`);if(!r.augments){r.augments=new Set;let n=r.ref=Symbol(e.name),o=Object[Symbol.hasInstance];e.prototype[n]=!0,Object.defineProperty(e,Symbol.hasInstance,{value:function(l){return this===e?l&&!!l[n]:o.call(this,l)}})}if(t.prototype[r.ref])return t;if(r.uses)for(let n of r.uses)Ce(t,n);r.augments.add(t),s.uses||(s.uses=[]),s.uses.push(e);let i=Object.getOwnPropertyDescriptors(e.prototype);return delete i.constructor,i[Mt]&&(s.inits||(s.inits=[]),s.inits.push(e.prototype[Mt]),delete i[Mt]),Object.defineProperties(t.prototype,i),e?.mixed instanceof Function&&e.mixed(t),t}function _h(t,e,...s){let r=e?class extends e{}:class{},i=Ot(r,{symbol:t});for(let n of s)Ce(r,n);return r.prototype[t]=function(n,o,l){if(i.inits)for(let h of i.inits)h.call(this,n,!1,l)},r}var W={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(t,e,...s)=>W.target[e].apply(W.self,s),get:(t,e)=>Reflect.get(W.target,e,W.self),set:(t,e,s,r)=>Reflect.set(W.target,e,s,W.self)})};function xh(t,e){return W.self=t,W.target=W.cache[e],W.proxy}function a(t,e,s,r,i=null){let n=Object.getPrototypeOf(t.prototype),o=r&qt.HasMixins,l;if(o&&(kt.set(t,kt.get(n.constructor)),n=Object.getPrototypeOf(n)),i){let c=r&qt.IsObjectExtension?i:i.prototype,u=Ot(t);if(u.uses){i===c&&console.warn("Cannot extend object with mixins");for(let d of u.uses)Ce(i,d)}return r&qt.HasSuperCalls&&(W.cache[e]=Object.create(Object.getPrototypeOf(c),Object.getOwnPropertyDescriptors(c))),ks(c,t.prototype),i}let h=n?.constructor;if(l=Ot(t,{symbol:e}),Object.defineProperty(t,oi,{value:l,enumerable:!1,configurable:!0}),s&&t.name!==s&&Object.defineProperty(t,"name",{value:s,configurable:!0}),l.flags=r,r&qt.HasConstructor&&(t.prototype[Ns]=e),l.uses)for(let c of l.uses)c.mixes?.(t);return h?.inherited instanceof Function&&h.inherited(t),t}function Th(t,e){t[Ns]===e&&(t[ii]?.(),t[$s]&&t[$s].inited(t))}var ze=Symbol.for("#__listeners__"),Zu=/-./g,wh=new Set,tc=Symbol(),Wi=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,s){return this.target[e]=s,!0}},hi=Wi;a(Wi,tc,"LazyProxy",16);function ui(t,e={}){return new Proxy(e,new hi(t))}function Kt(t){let e=typeof t;if(e=="number")return t;if(e=="string"){if(/^\d+fps$/.test(t))return 1e3/parseFloat(t);if(/^([-+]?[\d\.]+)s$/.test(t))return parseFloat(t)*1e3;if(/^([-+]?[\d\.]+)ms$/.test(t))return parseFloat(t)}return null}function Lh(t){return t.indexOf("-")>=0?t.replace(Zu,function(e){return e.charAt(1).toUpperCase()}):t}function Os(t,e,s){if(!t)return;let r=Object.getOwnPropertyDescriptor(t,e);return r||t==s?r||void 0:Os(Reflect.getPrototypeOf(t),e,s)}var Yi=function(t,e,s){let r,i,n;for(;(r=s)&&(s=s.next);)(i=s.listener)&&(s.path&&i[s.path]?n=e?i[s.path].apply(i,e):i[s.path]():n=e?i.apply(s,e):i.call(s)),s.times&&--s.times<=0&&(r.next=s.next,s.listener=null)};function it(t,e,s,r){let i,n,o;return i=t[ze]||(t[ze]={}),n=i[e]||(i[e]={}),o=n.tail||(n.tail=n.next={}),o.listener=s,o.path=r,n.tail=o.next={},o}function I(t,e,s){let r=it(t,e,s);return r.times=1,r}function Wt(t,e,s,r){if(!s)return;let i,n,o=t[ze];if(!!o&&(i=o[e])){for(;(n=i)&&(i=i.next);)if(i==s||i.listener==s){n.next=i.next,i.listener=null;break}}}function nt(t,e,s=null){let r;(r=t[ze])&&(r[e]&&Yi(e,s,r[e]),r.all&&Yi(e,[e,s],r.all))}var ec=Symbol(),Xi=class{emit(t,...e){return nt(this,t,e)}on(t,...e){return it(this,t,...e)}once(t,...e){return I(this,t,...e)}un(t,...e){return Wt(this,t,...e)}},ke=Xi;a(Xi,ec,"Emitter",0);function Eh(t){return t}function Ws(t,e){return typeof e=="string"?typeof t===e:e[Symbol.hasInstance]?.(t)}function sc(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Qi=Symbol.for("#__init__"),Ji=Symbol.for("#schedule"),Ys=Symbol.for("#frames"),Ue=Symbol.for("#interval"),Pt=Symbol.for("#stage"),It=Symbol.for("#scheduled"),qe=Symbol.for("#version"),rc=Symbol.for("#fps"),Zi=Symbol.for("#ticker"),ic=globalThis.requestAnimationFrame||function(t){return globalThis.setTimeout(t,1e3/60)},Ym=1/60,nc=Symbol(),tn=class{constructor(t=null){this[Qi](t)}[Qi](t=null,e=!0,s=!0){var r;this.owner=t&&(r=t.owner)!==void 0?r:null,this.target=t&&(r=t.target)!==void 0?r:null,this.active=t&&(r=t.active)!==void 0?r:!1,this.value=t&&(r=t.value)!==void 0?r:void 0,this.skip=t&&(r=t.skip)!==void 0?r:0,this.last=t&&(r=t.last)!==void 0?r:0}tick(t,e){return this.last=this.owner[Ys],this.target.tick(this,e),1}update(t,e){let s=this.active,r=t.value;return this.value!=r&&(this.deactivate(),this.value=r),(this.value||s||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[Ue]=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[Ue]&&(globalThis.clearInterval(this[Ue]),this[Ue]=null),this.active=!1,this}},oc=tn;a(tn,nc,"Scheduled",16);var lc=Symbol(),en=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[Pt]=-1,this[Ys]=0,this[It]=!1,this[qe]=0,this.listeners={},this.intervals={},this.commit=function(){return t.add("commit"),t},this[rc]=0,this.$promise=null,this.$resolve=null,this[Zi]=function(e){return t[It]=!1,t.tick(e)}}touch(){return this[qe]++}get version(){return this[qe]}add(t,e=!1){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[It]||this[Ji](),this}get committing\u03A6(){return this.queue.indexOf("commit")>=0}get syncing\u03A6(){return this[Pt]==1}listen(t,e){let s=this.listeners[t],r=!s;return s||(s=this.listeners[t]=new Set),s.add(e),t=="raf"&&r&&this.add("raf"),this}unlisten(t,e){var s;let r=this.listeners[t];return r&&r.delete(e),t=="raf"&&r&&r.size==0&&(s=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 s=this.queue,r=this[Ys]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[Pt]=1,this[qe]++,s.length)for(let i=0,n=sc(s),o=n.length;i<o;i++){let l=n[i];typeof l=="string"&&this.listeners[l]?this.listeners[l].forEach(function(h){if(Ws(h.tick,Function))return h.tick(e,l);if(Ws(h,Function))return h(e,l)}):Ws(l,Function)?l(this.dt,this):l.tick&&l.tick(this.dt,this)}return this[Pt]=this[It]?0:-1,this.$promise&&(this.$resolve(this),this.$promise=this.$resolve=null),this.listeners.raf&&this.add("raf"),this}[Ji](){return this[It]||(this[It]=!0,this[Pt]==-1&&(this[Pt]=0),ic(this[Zi])),this}schedule(t,e){var s,r;return e||(e=t[s=this.id]||(t[s]={value:!0})),(e[r=this.id]||(e[r]=new oc({owner:this,target:t}))).update(e,!0)}unschedule(t,e={}){e||(e=t[this.id]);let s=e&&e[this.id];return s&&s.active&&s.deactivate(),this}},ci=en;a(en,lc,"Scheduler",16);var C=new ci;function H(){return C.add("commit").promise}function fi(t,e){return globalThis.setTimeout(function(){t(),H()},e)}function di(t,e){return globalThis.setInterval(function(){t(),H()},e)}var pi=globalThis.clearInterval,mi=globalThis.clearTimeout,re=globalThis.imba||(globalThis.imba={});re.commit=H,re.setTimeout=fi,re.setInterval=di,re.clearInterval=pi,re.clearTimeout=mi;var gi={on:function(t,e){return it(this,t,e)},inited:function(t){return nt(this,"inited",[t])}};function Mh(){return!0}function sn(t,e){return typeof e=="string"?typeof t===e:e[Symbol.hasInstance]?.(t)}function Nh(t,e,s){if(s.get){let r=s.get;s.get=function(){let i=r.call(this);return Object.defineProperty(this,e,{enumerable:!1,value:i}),i}}return s}function $h(t,e,s){var r,i;if(sn(s.value,Function)){let n=s.value;s.get=function(){if(this==t)return n;let o=n.bind(this);return Object.defineProperty(this,e,{enumerable:!1,value:o}),o},r=s.value,delete s.value,i=s.writable,delete s.writable}return s}var rn=new WeakMap;function Ch(t,e,s){let r=this[0]||{},i=s.value,n=Symbol(),o=new WeakMap,l=rn.get(t),h=r.timeout||20*1e3,c=""+(t.constructor?.name||"")+"."+String(typeof e=="symbol"?e.description:e);if(l||rn.set(t,l={}),l.key)throw new Error("@thenable "+c+" not allowed - @thenable "+l.key+" already defined");if(!sn(i,Function))throw new Error("@thenable "+c+" only supports functions");if(i.length>0)throw new Error("@thenable "+c+" methods cannot be called with arguments");let u=function(m){return console.trace("@thenable "+c+" took more than "+h+"ms - make sure method does not return self.",m)},d=function(m){let f=o.get(m);return f||o.set(m,f={}),f},p=function(m,f){let y=this,S=d(y);return(S.promise||(S.promise=new Promise(function(L,_t){let x=r.timeout!==!1?setTimeout(u,r.timeout||2e4,y):null,A=function(dt){return x&&clearTimeout(x),S.met=!0,S.error=dt,console.trace("@thenable "+c+" threw error",dt),_t(dt)};return y[e]().then(function(){return x&&clearTimeout(x),S.met=!0,L(y)},A)}))).then(m,f)};return Object.defineProperty(t,"then",{enumerable:!1,configurable:!0,get:function(){return d(this).met?null:p}}),s.value=function(m){let f=d(this);return f.wrapped??(f.wrapped=Promise.resolve(i.call(this,f))),f.wrapped},s.value.reset=function(m){let f=d(m);o.delete(m)},s.value.check=d,s}var ac=Symbol(),Xs,bi=new(Xs=class{get rootDir(){return process.env.IMBA_OUTDIR||vi.default.dirname(process.env.pm_exec_path||process.argv[1])}get publicPath(){return vi.default.resolve(this.rootDir,process.env.IMBA_PUBDIR||globalThis.IMBA_PUBDIR||"public")}},a(Xs,ac,"Env",0),Xs);function G(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}function nn(t,e){return typeof e=="string"?typeof t===e:e[Symbol.hasInstance]?.(t)}var on=Symbol.for("#setup"),ln=Symbol.for("#setup?"),hc=Symbol.for("#dom"),uc=Symbol.for("#server"),ie={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"}},an={id:Date.now()},R=globalThis.process,cc=Symbol(),hn=class extends Set{call(t,...e){var s;s=[];for(let r of G(this))s.push(r[t](...e));return s}close(t={}){var e;e=[];for(let s of G(this))e.push(s.close(t));return e}reload(t={}){var e;e=[];for(let s of G(this))e.push(s.reload(t));return e}broadcast(t,...e){var s;s=[];for(let r of G(this))s.push(r.broadcast(t,...e));return s}emit(t,e){var s;s=[];for(let r of G(this))s.push(r.emit(t,e));return s}sseEnd(){let t=[];for(let e of G(this))for(let s of G(e.clients))t.push(new Promise(function(r){return s.on("finish",r),s.end()}));return Promise.all(t)}},fc=hn;a(hn,cc,"Servers",0);var xt=new fc,dc=Symbol(),Qs,un=new(Qs=class extends kh.EventEmitter{constructor(){var t;super(...arguments),t=this,this.autoreload=!1,this.state={},globalThis.IMBA_RUN&&(yi.default.isWorker?R.on("message",function(e){if(t.emit("message",e),e[0]=="emit")return t.emit(...e.slice(1))}):R.on("message",function(e){if(e[0]=="emit")return t.emit(...e.slice(1))}))}[on](){var t=this;if(this[ln]!=!0&&(this[ln]=!0,!0))return this.on("rebuild",function(e){let s=globalThis.IMBA_MANIFEST;return globalThis.IMBA_MANIFEST=e,xt.broadcast("rebuild",e)}),this.on("reloadHard",async function(e){return xt.broadcast("reloadHard",e),await xt.sseEnd(),R.exit(0)}),this.on("reloading",function(e){var s;t.state.reloading=!0,s=[];for(let r of G(xt))s.push(r.pause());return s}),this.on("reloaded",async function(e){var s;t.state.reloaded=!0,xt.broadcast("reloaded"),await new Promise(function(i){return setTimeout(i,100)}),s=[];for(let i of G(xt))s.push(i.close());let r=s;return setTimeout(function(){return R.exit(0)},100),await Promise.all(r),R.exit(0)}),!0}send(t){if(nn(R.send,Function))return R.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,!R.env.IMBA_SERVE){console.warn("not possible to gracefully reload servers not started via imba start");return}this.send("reload")}},a(Qs,dc,"Process",24),Qs);function cn(t,e=[],s=0){let r=globalThis.IMBA_MANIFEST[t];if(e.indexOf(t)>=0)return e;if(r?.imports)for(let i=0,n=G(r?.imports),o=n.length;i<o;i++){let l=n[i];e.push(l),cn(l,e,s+1)}return e}var pc=Symbol(),fn=class{constructor(t,e,s={}){this.server=t,this.url=e,[this.pathname,this.query]=e.split("?"),this.ext=Nt.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,ie[this.ext.slice(1)]||{}),this.headers["max-age"]=864e5,s.imports&&t.options.preload!==!1&&(this.headers.Link=cn(e).map(function(r){return"<"+r+">; rel=modulepreload; as=script"}).join(", ")),this.path=t.localPathForUrl(e)}respond(t,e){var s=this;return q.default.access(this.path,q.default.constants.R_OK,function(r){if(r)return e.writeHead(404,{}),e.end();try{if(s.server.options.setHeaders&&s.server.options.setHeaders(e,s.path),globalThis.BUN)return q.default.readFile(s.path,function(i,n){return e.writeHead(200,s.headers),e.end(n)});{let i=q.default.createReadStream(s.path);return e.writeHead(200,s.headers),i.pipe(e)}}catch{return e.writeHead(503,{}),e.end()}})}createReadStream(){return q.default.createReadStream(this.path)}pipe(t){return this.createReadStream().pipe(t)}},mc=fn;a(fn,pc,"AssetResponder",16);var gc=Symbol(),dn=class{static wrap(t,e={}){return new this(t,e)}localPathForUrl(t){var e;let s,r,i=t.replace(/\?.*$/,"");return(e=this.urlToLocalPathMap)[i]??(e[i]=(s=Nt.default.resolve(bi.publicPath,"."+i),r=q.default.existsSync(s)&&s,!r&&this.staticDir&&(s=Nt.default.resolve(this.staticDir,"."+i),r=q.default.existsSync(s)&&s),r))}headersForAsset(t){let e,s=Nt.default.extname(t);return e=Object.assign({"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public"},ie[s.slice(1)]||{})}get manifest(){return globalThis.IMBA_MANIFEST||{}}constructor(t,e={}){var s=this;xt.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||"",R.env.IMBA_PATH&&(this.devtoolsPath=Nt.default.resolve(R.env.IMBA_PATH,"hmr.js")),this.scheme=nn(t,Oh.default.Server)?"http":"https";let r=this.server._events.request,i=globalThis[hc];t.off("request",r),r[uc]=this,t.on("listening",function(){let n=s.server.address(),o=n.address;(o=="::"||o=="0.0.0.0")&&(o="localhost");let l=""+s.scheme+"://"+o+":"+n.port+"/";if(!R.env.IMBA_CLUSTER)return console.log("listening on "+l)}),globalThis.IMBA_HMR&&(globalThis.IMBA_HMR_PATH="/__hmr__.js"),this.handler=function(n,o){var l;let h,c=n.constructor.name=="Http2ServerRequest",u=n.url;if(s.paused||s.closed)return o.statusCode=302,o.setHeader("Location",n.url),c||o.setHeader("Connection","close"),s.closed?(c&&n.stream.session.close(),o.end()):s.stalledResponses.push(o);if(u=="/__imba__.mjs"){o.writeHead(200,ie.mjs);let f=Nt.default.resolve(R.env.IMBA_PATH,"dist","imba.mjs");return q.default.createReadStream(f).pipe(o)}if(globalThis.IMBA_HMR){if(u=="/__hmr__.json")return o.writeHead(200,ie.json),o.end(JSON.stringify(an));if(u=="/__hmr__.js"&&s.devtoolsPath){let f=q.default.createReadStream(s.devtoolsPath);return o.writeHead(200,ie.js),f.pipe(o)}if(u=="/__hmr__"){let f={"Content-Type":"text/event-stream","Cache-Control":"no-cache"};return c||(f.Connection="keep-alive"),o.writeHead(200,f),s.clients.add(o),s.broadcast("init",globalThis.IMBA_MANIFEST,[o]),s.broadcast("state",an,[o]),n.on("close",function(){return s.clients.delete(o)}),!0}}let d=n.headers,p;c?p=d[":scheme"]+"://"+d[":authority"]:p=(n.connection.encrypted?"https":"http")+"://"+d.host;let m=s.manifest[u];if(m&&s.localPathForUrl(u))return((l=s.assetResponders)[u]||(l[u]=new mc(s,u,m))).respond(n,o);if((u.match(/\.[A-Z\d]{8}\./)||u.match(/\.\w{1,4}($|\?)/))&&(h=s.localPathForUrl(u)))try{let f=s.headersForAsset(h);if(e.setHeaders&&e.setHeaders(o,h),globalThis.BUN)return q.default.readFile(h,function(y,S){return y?(o.writeHead(500,{}),o.write("Error getting the file: "+y)):(o.writeHead(200,f),o.end(S))});{let y=q.default.createReadStream(h);return o.writeHead(200,f),y.pipe(o)}}catch{return o.writeHead(503,{}),o.end()}if(i){let f=new i.Location(n.url,p);return i.Document.create({location:f},function(){return r(n,o)})}else return r(n,o)},t.on("request",this.handler),t.on("close",function(){return console.log("server is closing!")}),globalThis.IMBA_RUN&&(yi.default.isWorker||R.env.IMBA_WATCH)&&(un[on](),un.send("serve"))}broadcast(t,e={},s=this.clients){e=JSON.stringify(e);let r="data: "+e+`
`;for(let i of G(s))i.write("event: "+t+`
`),i.write(`id: imba
`),i.write(r);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=G(this.stalledResponses),s=e.length;t<s;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()})}},yc=dn;a(dn,gc,"Server",16);function Ph(t,...e){return yc.wrap(t,...e)}var pn={};function Ih(t,e,s){if(e!=null){let r=pn[t]||(pn[t]=new WeakMap);return r.get(e)||r.set(e,(s.memoized=t)&&s).get(e)}return s}function vc(t,e){return typeof e=="string"?typeof t===e:e[Symbol.hasInstance]?.(t)}var Ke=Symbol.for("#idler"),ne=Symbol.for("#resolve"),bc=Symbol(),mn=class extends Set{constructor(){super(),this[Ke]=Promise.resolve(this)}emit(t,...e){return nt(this,t,e)}on(t,...e){return it(this,t,...e)}once(t,...e){return I(this,t,...e)}un(t,...e){return Wt(this,t,...e)}add(t){var e=this;if(vc(t,Function)&&(t=t()),!this.has(t)){let s=this.size==0;super.add(t),s&&(this[Ke]=this[ne]=null,this.emit("busy",this)),this.emit("add",t,this);let r=function(){return e.delete(t)};t.then(r,r)}return t}delete(t){return super.delete(t)?(this.emit("delete",t,this),this.size==0&&(this[ne]&&(this[ne](!0),this[ne]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[Ke]||(this[Ke]=new Promise(function(e){return t.size==0?e(!0):t[ne]=e}))}get idle\u03A6(){return this.size==0}then(t,e){return this.idle.then(t,e)}},Si=mn;a(mn,bc,"Queue",24);function _i(t,e){if(e?.debug\u03A6==!1)return;let s=[],r=[];for(let i=0,n=ai(t),o=n.length;i<o;i++){let l=n[i];if(i%2!=0)continue;let h=t[i+1];if(l==""){r.push("%s");let c="\x1B[40m\x1B[32m";s.push(""+c+h+"\x1B[0m")}else r.push("%s %O"),s.push("\x1B[44m\x1B[97m"+l+"\x1B[0m"),s.push(h)}return[r.join(" "),...s]}var Js=Symbol.for("#L");function Hh(){return globalThis[Js]||(globalThis[Js]=globalThis[Js]||_i),!0}function Sc(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Q={"":[-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}]},E={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},Zs=Object.keys(Q);for(let t=0,e=Sc(Zs),s=e.length;t<s;t++){let r=e[t],i=Q[r];i.name=r+"Element",i.up=Q[Zs[i[0]]]}for(let t=0,e=Object.keys(E),s=e.length,r,i;t<s;t++)r=e[t],i=E[r],E[r]=Q[Zs[i]],r.indexOf("svg_")==0&&(E[r.replace("_",":")]=E[r]);var gn=Symbol.for("#toStringDeopt"),yn=Symbol.for("#symbols"),vn=Symbol.for("#batches"),bn=Symbol.for("#extras"),Sn=Symbol.for("#stacks"),_c=Symbol(),_n=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 s=this;let r=this.stacks,i=r[t]||0;return i<1&&this.add(t),e>0&&setTimeout(function(){return s.decr(t)},e),r[t]=Math.max(i,0)+1}decr(t){let e=this.stacks,s=e[t]||0;return s==1&&this.remove(t),e[t]=Math.max(s,1)-1}reconcile(t,e){let s=this[yn],r=this[vn],i=!0;if(!s)s=this[yn]=[t],r=this[vn]=[e||""],this.toString=this.valueOf=this[gn];else{let n=s.indexOf(t),o=e||"";n==-1?(s.push(t),r.push(o)):r[n]!=o?r[n]=o:i=!1}i&&(this[bn]=" "+r.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[gn](){return this.string+(this[bn]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[Sn]||(this[Sn]={})}},tr=_n;a(_n,_c,"Flags",16);var xn=Symbol.for("#__init__"),er=Symbol.for("#getRenderContext"),xc=Symbol.for("#getDynamicContext"),M={context:null},Tc=Symbol(),Tn=class{constructor(t=null){this[xn](t)}[xn](t=null,e=!0,s=!0){var r;this.stack=t&&(r=t.stack)!==void 0?r:[]}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}},wc=Tn;a(Tn,Tc,"Renderer",16);var Yt=new wc,Lc=Symbol(),sr=class extends Map{constructor(t,e=null){super(),this._=t,this.sym=e}pop(){return M.context=null}[er](t){let e=this.get(t);return e||this.set(t,e=new sr(this._,t)),M.context=e}[xc](t,e){return this[er](t)[er](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}},Xt=sr;a(sr,Lc,"RenderContext",16);function Ps(t,e=Symbol(),s=t){return M.context=t[e]||(t[e]=new Xt(s,e))}function Ah(){let t=M.context,e=t||new Xt(null);return globalThis.DEBUG_IMBA&&!t&&Yt.stack.length>0&&console.trace("detected unmemoized nodes in",Yt.stack.slice(0),"see https://imba.io",e),t&&(M.context=null),e}function Y(t,e){return typeof e=="string"?typeof t===e:e[Symbol.hasInstance]?.(t)}function oe(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var rr=Symbol.for("#parent"),wn=Symbol.for("#context"),Ln=Symbol.for("#closestNode"),Ec=Symbol.for("#parentNode"),Tt=Symbol.for("#__init__"),Mc=Symbol.for("##inited"),ir=Symbol.for("#getRenderContext"),Nc=Symbol.for("#getDynamicContext"),nr=Symbol.for("#replaceChild"),le=Symbol.for("#appendChild"),En=Symbol.for("#removeChild"),pt=Symbol.for("#insertInto"),Mn=Symbol.for("#insertChild"),ae=Symbol.for("#removeFrom"),Nn=Symbol.for("#removeFromDeopt"),Ht=Symbol.for("#replaceWith"),$n=Symbol.for("#replaceWithDeopt"),or=Symbol.for("#placeholderNode"),$c=Symbol.for("#attachToParent"),Cc=Symbol.for("#detachFromParent"),kc=Symbol.for("#placeChild"),Oc=Symbol.for("#beforeReconcile"),Pc=Symbol.for("#afterReconcile"),Ic=Symbol.for("#afterVisit"),Hc=Symbol.for("#visitContext"),Cn=Symbol.for("#document"),We=Symbol.for("#htmlNodeName"),kn=Symbol.for("#ImbaElement"),On=Symbol.for("#flags"),Ye=Symbol.for("#scripts"),lr=Symbol.for("#location"),Pn=Symbol.for("##document"),In=Symbol.for("##parent"),Fc=Symbol.for("##up"),Hn=Symbol.for("##context"),he=Symbol.for("#domNode"),Xe=Symbol.for("##placeholderNode"),Fn=Symbol.for("#domDeopt"),Ac=Symbol.for("#insertIntoDeopt"),An=Symbol.for("##classList"),Qe=Symbol.for("##style"),Rn=Symbol.for("##dataset"),lt=Symbol.for("#asset"),ar=Symbol.for("#innerHTML"),Je=Symbol.for("##visitContext"),Rc=Symbol.for("#isRichElement"),ue=Symbol.for("#src"),Vc=Symbol.for("#getSlot"),jc=Symbol.for("#cssns"),Dc=Symbol.for("#cssid"),Gc=Symbol.for("#dom"),Bc={},ce=null,zc=Symbol(),Vn=class extends URL{},Oe=Vn;a(Vn,zc,"Location",0);var Uc=Symbol(),jn=class{get document(){return this[Cn]||(this[Cn]=new this.Document(this))}get location(){return this.document.location}},Rh=jn;a(jn,Uc,"Window",0);function Vh(){return globalThis.imba.uses_window=!0,!0}var qc={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},at=null,Dn={},Kc=Symbol(),Gn=class{define(){return this}get(){return this}upgrade(){}whenDefined(){}},Wc=Gn;a(Gn,Kc,"CustomElementRegistry",0);var jh=new Wc,xi={};function ot(t,e){let s=t;if(typeof t=="string"&&(t=Q[t]||E[t]||Q[t+"Element"]||E["svg_"+t]),Y(t,j))return t;if(!t)return ot("HTML");if(t&&!t.klass){let r=Symbol(),i=class extends ot(t.up){},n=i;a(i,r,"element",0),t.klass=n}if(t&&!t.idl){t.idl=!0;let r=Object.getOwnPropertyDescriptors(t.klass.prototype);for(let i=t[1],n=0,o=Object.keys(i),l=o.length,h,c;n<l;n++){h=o[n],c=i[h];let u=c==1?h:c;r[u]||u=="style"||Object.defineProperty(t.klass.prototype,h,{set:function(d){this.setAttribute(u,d)},get:function(){return this.getAttribute(u)}})}}return t.klass}function Dh(t,e,s){var r;let i=ot(t,e);if(!(i==s||Y(i.prototype,s)||i.prototype[We])){let n=i.prototype[kn];if(!n){let o=Symbol();n=(r=class extends i{constructor(){super(...arguments),this.__slots={},this.__F=0}},a(r,o,"CustomBuiltInElement",16),r),i.prototype[kn]=n;let l=Object.getOwnPropertyDescriptors(s.prototype);Object.defineProperties(n.prototype,l),n.prototype[We]=t}return n}return i}var Ze=function(t){let e=typeof t=="string"?t:String(t);return e.indexOf('"')>=0&&(e=e.replace(/\"/g,""")),e},hr=function(t,e){let s=typeof t=="string"?t:String(t);return e=="script"||(s.indexOf('"')>=0&&(s=s.replace(/\"/g,""")),s.indexOf("<")>=0&&(s=s.replace(/\</g,"<")),s.indexOf(">")>=0&&(s=s.replace(/\>/g,">"))),s},Yc=Symbol(),ur=class{static create(t,e){let s=new ur;return s[wn]=t,s.location=t.location,ce||(ce=new Fh.AsyncLocalStorage),ce.run(s,e),s}constructor(){}get flags(){return this[On]||(this[On]=new tr({classList:new Bn(this)}))}get scripts(){return this[Ye]||(this[Ye]=[])}set location(t){typeof t=="string"&&(t=new Oe(t)),this[lr]=t}get location(){return this[lr]||(this[lr]=new Oe("http://localhost/"))}createElement(t){let e=ot(t),s=new e(t);return s.nodeName=t,s}createElementNS(t,e){if(t=="http://www.w3.org/2000/svg"){let s=ot("svg_"+e),r=new s;return r.nodeName=e,r}return this.createElement(e)}createTextNode(t){return new Ie(t)}createComment(t){return new $t(t)}createDocumentFragment(){return new Hs}getElementById(t){return null}},Pe=ur;a(ur,Yc,"Document",16);var ht=new Pe,Is=ht;function Qt(){return ce&&ce?.getStore?.()||ht}var Xc=Symbol(),cr=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 cr(t,this.classes.slice(0))}toString(){return this.classes.join(" ").trim()}},Bn=cr;a(cr,Xc,"DOMTokenList",16);var Qc=Symbol(),zn=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,s=0,r=Object.keys(e),i=r.length,n,o;s<i;s++)n=r[s],o=e[n],Y(o,Function)||t.push(""+n+": "+o);return t.join(";")}},Ti=zn;a(zn,Qc,"StyleDeclaration",16);var Jc=Symbol(),fr=class{static wrap(t){return new Proxy(t.attributes,new fr)}set(t,e,s){return t["data-"+e]=s,!0}get(t,e){return t["data-"+e]}},Zc=fr;a(fr,Jc,"DataSet",0);var tf={get(t,e){let s=t,r;for(;s&&r==null;)(s=s[rr])&&(r=s[e]);return r}},ef=Symbol(),Un=class{toString(){return this.outerHTML}get outerHTML(){return""}text$(t){return this.textContent=t,this}get ownerDocument(){return this[Pn]||(this[Pn]=Qt())}get[rr](){return this[In]||this.parentNode||this[Fc]}get[wn](){return this[Hn]||(this[Hn]=new Proxy(this,tf))}get[Ln](){return this}get[Ec](){return this[rr]?.[Ln]}[Tt](){return this}[Mc](){return this}[ir](t){return Ps(this,t)}[Nc](t,e){return this[ir](t)[ir](e)}[nr](t,e){let s=this[Mn](t,e);return this[En](e),s}[le](t){return t[pt](this,null)}[En](t){return t[ae](this)}[pt](t,e){return e?t.insertBefore(this,e):t.appendChild(this),this}[Mn](t,e){return t[pt](this,e)}[ae](t){return t.removeChild(this)}[Nn](t){return t.removeChild(this[he]||this)}[Ht](t,e){return e[nr](t,this)}[$n](t,e){return e[nr](t,this[he]||this)}get[or](){return this[Xe]||(this[Xe]=ht.createComment("placeholder"))}set[or](t){let e=this[Xe];this[Xe]=t,e&&e!=t&&e.parentNode&&e[Ht](t)}[$c](){let t=this[he],e=t&&t.parentNode;return t&&e&&t!=this&&(this[he]=null,this[pt](e,t),t[ae](e)),this}[Cc](){this[Fn]!=!0&&(this[Fn]=!0,!0)&&(this[Ht]=this[$n],this[ae]=this[Nn],this[pt]=this[Ac]);let t=this[or];return this.parentNode&&t!=this&&(t[pt](this.parentNode,this),this[ae](this.parentNode)),this[he]=t,this}[kc](t,e,s){let r=typeof t;if(r==="undefined"||t===null){if(s&&Y(s,$t))return s;let i=new $t("");return s?s[Ht](i,this):i[pt](this,null)}if(t===s)return t;if(r!=="object"){let i,n=t;return e&128&&e&256,s?Y(s,Ie)?(s.textContent=n,s):(i=Is.createTextNode(n),s[Ht](i,this),i):(this.appendChild(i=Is.createTextNode(n)),i)}else return s?s[Ht](t,this):t[pt](this,null)}},j=Un;a(Un,ef,"Node",0);var sf=Symbol(),qn=class extends j{constructor(t){super(),this.textContent=t??""}get outerHTML(){return this.textContent}},Ie=qn;a(qn,sf,"Text",16);var rf=Symbol(),Kn=class extends j{constructor(t){super(),this.value=t}get outerHTML(){return"<!-- "+hr(this.value)+" -->"}toString(){return this.tag&&this.tag.toNodeString?this.tag.toNodeString():this.outerHTML}},$t=Kn;a(Kn,rf,"Comment",16);var nf=Symbol(),Ft=class extends j{constructor(t){super(),this.nodeName=t,this.childNodes=[],this.attributes={}}emit(t,e,s={bubbles:!0}){console.warn("Element#emit not supported on node")}get classList(){return this[An]||(this[An]=new Bn(this))}get style(){return this[Qe]||(this[Qe]=new Ti)}get dataset(){return this[Rn]||(this[Rn]=Zc.wrap(this))}get richValue(){return this.value}set richValue(t){this.value=t}set asset(t){this[lt]=t}get asset(){return this[lt]}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 s=this.childNodes.indexOf(e);return s>=0&&(this.childNodes.splice(s,1,t),t.parentNode=this),e}insertBefore(t,e){let s=this.childNodes.indexOf(e);return this.childNodes.splice(s,0,t),this}setAttribute(t,e){return this.attributes[t]=e,this}setAttributeNS(t,e,s){return this.setAttribute(t+":"+e,s)}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[ar]=t}get innerHTML(){let t="";if(this[ar])return this[ar];if(this.textContent!=null)return hr(this.textContent);for(let e=0,s=oe(this.childNodes),r=s.length;e<r;e++){let i=s[e];typeof i=="string"?t+=hr(i,this.nodeName):Y(i,Number)?t+=""+i:i&&(t+=i.outerHTML)}return t}get outerHTML(){let t=this.nodeName,e=this[We],s=""+t;e&&(s=""+e+" is='"+t+"'",t=e);let r,i=this.classList.toString();this.dehydrate&&(i=i?"_ssr_ "+i:"_ssr_",this.dehydrate()),(r=this.id)&&(s+=' id="'+Ze(r)+'"'),i&&(s+=' class="'+Ze(i)+'"');for(let n=this.attributes,o=0,l=Object.keys(n),h=l.length,c,u;o<h;o++)c=l[o],u=n[c],s+=" "+c+'="'+Ze(u)+'"';return this[Qe]&&(s+=' style="'+Ze(this[Qe].toString())+'"'),qc[t]?"<"+s+">":"<"+s+">"+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 s=this.childNodes[e++];if(Y(s,Ft))return s}return null}get lastElementChild(){let t=this.childNodes.length;for(;t>0;){let e=this.childNodes[--t];if(Y(e,Ft))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}[Oc](){return this}[Pc](){return this}[Ic](){this.render&&this.render(),this[Je]&&(this[Je]=null)}get[Hc](){return this[Je]||(this[Je]={})}get flags(){return this.$flags||(this.$flags=new tr(this),this.flag$==Ft.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 s=Os(this,t,Ft);!s||!s.set?this.setAttribute(t,e):this[t]=e}},b=Ft;a(Ft,nf,"Element",16),b.prototype.setns$=b.prototype.setAttributeNS,b.prototype[Rc]=!0;var of=Symbol(),Wn=class extends b{constructor(){super(null)}get outerHTML(){return this.innerHTML}},Hs=Wn;a(Wn,of,"DocumentFragment",16);var lf=Symbol(),Yn=cl