var sh=Object.create;var Xs=Object.defineProperty;var nh=Object.getOwnPropertyDescriptor;var oh=Object.getOwnPropertyNames;var lh=Object.getPrototypeOf,hh=Object.prototype.hasOwnProperty;var ah=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var uh=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of oh(t))!hh.call(i,s)&&s!==e&&Xs(i,s,{get:()=>t[s],enumerable:!(r=nh(t,s))||r.enumerable});return i};var ch=(i,t,e)=>(e=i!=null?sh(lh(i)):{},uh(t||!i||!i.__esModule?Xs(e,"default",{value:i,enumerable:!0}):e,i));var vl=ah((Zf,us)=>{"use strict";var zt=typeof Reflect=="object"?Reflect:null,cl=zt&&typeof zt.apply=="function"?zt.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},xr;zt&&typeof zt.ownKeys=="function"?xr=zt.ownKeys:Object.getOwnPropertySymbols?xr=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:xr=function(t){return Object.getOwnPropertyNames(t)};function lu(i){console&&console.warn&&console.warn(i)}var dl=Number.isNaN||function(t){return t!==t};function g(){g.init.call(this)}us.exports=g;us.exports.once=cu;g.EventEmitter=g;g.prototype._events=void 0;g.prototype._eventsCount=0;g.prototype._maxListeners=void 0;var fl=10;function Sr(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return fl},set:function(i){if(typeof i!="number"||i<0||dl(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");fl=i}});g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};g.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||dl(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function pl(i){return i._maxListeners===void 0?g.defaultMaxListeners:i._maxListeners}g.prototype.getMaxListeners=function(){return pl(this)};g.prototype.emit=function(t){for(var e=[],r=1;r0&&(o=e[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var h=n[t];if(h===void 0)return!1;if(typeof h=="function")cl(h,this,e);else for(var a=h.length,c=_l(h,a),r=0;r0&&o.length>s&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=i,l.type=t,l.count=o.length,lu(l)}return i}g.prototype.addListener=function(t,e){return ml(this,t,e,!1)};g.prototype.on=g.prototype.addListener;g.prototype.prependListener=function(t,e){return ml(this,t,e,!0)};function hu(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function gl(i,t,e){var r={fired:!1,wrapFn:void 0,target:i,type:t,listener:e},s=hu.bind(r);return s.listener=e,r.wrapFn=s,s}g.prototype.once=function(t,e){return Sr(e),this.on(t,gl(this,t,e)),this};g.prototype.prependOnceListener=function(t,e){return Sr(e),this.prependListener(t,gl(this,t,e)),this};g.prototype.removeListener=function(t,e){var r,s,n,o,l;if(Sr(e),s=this._events,s===void 0)return this;if(r=s[t],r===void 0)return this;if(r===e||r.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){l=r[o].listener,n=o;break}if(n<0)return this;n===0?r.shift():au(r,n),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,l||e)}return this};g.prototype.off=g.prototype.removeListener;g.prototype.removeAllListeners=function(t){var e,r,s;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var n=Object.keys(r),o;for(s=0;s=0;s--)this.removeListener(t,e[s]);return this};function yl(i,t,e){var r=i._events;if(r===void 0)return[];var s=r[t];return s===void 0?[]:typeof s=="function"?e?[s.listener||s]:[s]:e?uu(s):_l(s,s.length)}g.prototype.listeners=function(t){return yl(this,t,!0)};g.prototype.rawListeners=function(t){return yl(this,t,!1)};g.listenerCount=function(i,t){return typeof i.listenerCount=="function"?i.listenerCount(t):bl.call(i,t)};g.prototype.listenerCount=bl;function bl(i){var t=this._events;if(t!==void 0){var e=t[i];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?xr(this._events):[]};function _l(i,t){for(var e=new Array(t),r=0;r=0?i.replace(fh,function(t){return t.charAt(1).toUpperCase()}):i}function Hr(i,t,e){if(!i)return;let r=Object.getOwnPropertyDescriptor(i,t);return r||i==e?r||void 0:Hr(Reflect.getPrototypeOf(i),t,e)}var Qs=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){var s;let n,o,l;return n=i[De]||(i[De]={}),o=n[t]||(n[t]={}),l=o.tail||(o.tail=o.next={}),l.listener=e,l.path=r,o.tail=l.next={},l}function I(i,t,e){let r=V(i,t,e);return r.times=1,r}function Ct(i,t,e,r){let s,n,o=i[De];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){let r;(r=i[De])&&(r[t]&&Qs(t,e,r[t]),r.all&&Qs(t,[t,e],r.all))}var Wt=class{emit(t,...e){return D(this,t,e)}on(t,...e){return V(this,t,...e)}once(t,...e){return I(this,t,...e)}un(t,...e){return Ct(this,t,...e)}};function dh(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Zs=Symbol.for("#__init__");var tn=Symbol.for("#schedule"),jr=Symbol.for("#frames"),He=Symbol.for("#interval"),At=Symbol.for("#stage"),Rt=Symbol.for("#scheduled"),je=Symbol.for("#version"),ph=Symbol.for("#fps"),en=Symbol.for("#ticker"),mh=globalThis.requestAnimationFrame||function(i){return globalThis.setTimeout(i,1e3/60)};var Iu=1/60,Gr=class{constructor(t=null){this[Zs](t)}[Zs](t=null){var e;this.owner=t&&(e=t.owner)!==void 0?e:null,this.target=t&&(e=t.target)!==void 0?e:null,this.active=t&&(e=t.active)!==void 0?e:!1,this.value=t&&(e=t.value)!==void 0?e:void 0,this.skip=t&&(e=t.skip)!==void 0?e:0,this.last=t&&(e=t.last)!==void 0?e:0}tick(t,e){return this.last=this.owner[jr],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[He]=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[He]&&(globalThis.clearInterval(this[He]),this[He]=null),this.active=!1,this}},$r=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[At]=-1,this[jr]=0,this[Rt]=!1,this[je]=0,this.listeners={},this.intervals={},t.commit=function(){return t.add("commit"),t},this[ph]=0,t.$promise=null,t.$resolve=null,this[en]=function(e){return t[Rt]=!1,t.tick(e)}}touch(){return this[je]++}get version(){return this[je]}add(t,e){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[Rt]||this[tn](),this}get committingΦ(){return this.queue.indexOf("commit")>=0}get syncingΦ(){return this[At]==1}listen(t,e){let r=this.listeners[t],s=!r;return r||(r=this.listeners[t]=new Set),r.add(e),t=="raf"&&s&&this.add("raf"),this}unlisten(t,e){var r;let s=this.listeners[t];return s&&s.delete(e),t=="raf"&&s&&s.size==0&&(r=this.listeners.raf,delete this.listeners.raf),this}on(t,e){return this.listen(t,e)}un(t,e){return this.unlisten(t,e)}get promise(){var t=this;return t.$promise||(t.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let r=this.queue,s=this[jr]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[At]=1,this[je]++,r.length)for(let n=0,o=dh(r),l=o.length;n=0)return t;if(r?.imports)for(let s=0,n=Z(r?.imports),o=n.length;s; rel=modulepreload; as=script"}).join(", ")),this.path=t.localPathForUrl(e)}respond(t,e){var r=this;return tt.access(this.path,tt.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 tt.readFile(r.path,function(n,o){return e.writeHead(200,r.headers),e.end(o)});{let n=tt.createReadStream(r.path);return e.writeHead(200,r.headers),n.pipe(e)}}catch{return e.writeHead(503,{}),e.end()}})}createReadStream(){return tt.createReadStream(this.path)}pipe(t){return this.createReadStream().pipe(t)}},qr=class{static wrap(t,e={}){return new this(t,e)}localPathForUrl(t){var e,r,s;let n=t.replace(/\?.*$/,"");return(e=this.urlToLocalPathMap)[n]==null?e[n]=(r=Ot.resolve(this.publicPath,"."+n),s=tt.existsSync(r)&&r,!s&&this.staticDir&&(r=Ot.resolve(this.staticDir,"."+n),s=tt.existsSync(r)&&r),s):e[n]}headersForAsset(t){let e,r=Ot.extname(t);return e=Object.assign({"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public"},Br[r.slice(1)]||{})}get manifest(){return globalThis.IMBA_MANIFEST||{}}constructor(t,e={}){var r=this;Jt.add(this),this.id=Math.random(),this.options=e,this.closed=!1,this.paused=!1,this.server=t,this.clients=new Set,this.stalledResponses=[],this.assetResponders={},this.urlToLocalPathMap={},this.publicExistsMap={};try{this.rootDir=H.env.IMBA_OUTDIR||Ot.dirname(H.env.pm_exec_path||H.argv[1])}catch{}try{this.publicPath=Ot.resolve(this.rootDir,H.env.IMBA_PUBDIR||globalThis.IMBA_PUBDIR||"public")}catch{}this.staticDir=globalThis.IMBA_STATICDIR||"",H.env.IMBA_PATH&&(this.devtoolsPath=Ot.resolve(H.env.IMBA_PATH,"dist","hmr.js")),this.scheme=t instanceof wh.Server?"http":"https";let s=this.server._events.request,n=globalThis[vh];t.off("request",s),s[xh]=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(!H.env.IMBA_CLUSTER)return console.log("listening on "+h)}),globalThis.IMBA_HMR&&(globalThis.IMBA_HMR_PATH="/__hmr__.js"),r.handler=function(o,l){var h,a;let c=o.constructor.name=="Http2ServerRequest",u=o.url;if(r.paused||r.closed)return l.statusCode=302,l.setHeader("Location",o.url),c||l.setHeader("Connection","close"),r.closed?(c&&o.stream.session.close(),l.end()):r.stalledResponses.push(l);if(globalThis.IMBA_HMR){if(u=="/__hmr__.js"&&r.devtoolsPath){let m=tt.createReadStream(r.devtoolsPath);return l.writeHead(200,Br.js),m.pipe(l)}if(u=="/__hmr__"){let m={"Content-Type":"text/event-stream","Cache-Control":"no-cache"};return c||(m.Connection="keep-alive"),l.writeHead(200,m),r.clients.add(l),r.broadcast("init",globalThis.IMBA_MANIFEST,[l]),o.on("close",function(){return r.clients.delete(l)}),!0}}let p=o.headers,b;c?b=p[":scheme"]+"://"+p[":authority"]:b=(o.connection.encrypted?"https":"http")+"://"+p.host;let f=r.manifest[u];if(f&&r.localPathForUrl(u))return((a=r.assetResponders)[u]||(a[u]=new Ur(r,u,f))).respond(o,l);if((u.match(/\.[A-Z\d]{8}\./)||u.match(/\.\w{1,4}($|\?)/))&&(h=r.localPathForUrl(u)))try{let m=r.headersForAsset(h);if(e.setHeaders&&e.setHeaders(l,h),globalThis.BUN)return tt.readFile(h,function(_,S){return _?(l.writeHead(500,{}),l.write("Error getting the file: "+_)):(l.writeHead(200,m),l.end(S))});{let _=tt.createReadStream(h);return l.writeHead(200,m),_.pipe(l)}}catch{return l.writeHead(503,{}),l.end()}if(n){let m=new n.Location(o.url,b);return n.Document.create({location:m},function(){return s(o,l)})}else return s(o,l)},t.on("request",r.handler),t.on("close",function(){return console.log("server is closing!!!")}),globalThis.IMBA_RUN&&cn.isWorker&&(an[un](),an.send("serve"))}broadcast(t,e={},r=this.clients){e=JSON.stringify(e);let s="data: "+e+` `;for(let n of Z(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=Z(this.stalledResponses),r=e.length;t0&&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[gn],s=this[yn],n=!0;if(!r)r=this[gn]=[t],s=this[yn]=[e||""],this.toString=this.valueOf=this[mn];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[bn]=" "+s.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[mn](){return this.string+(this[bn]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[_n]||(this[_n]={})}};var Ge=Symbol.for("#__init__"),vn=Symbol.for("#__initor__"),xn=Symbol.for("#__inited__"),Yr=Symbol.for("#getRenderContext"),Lh=Symbol.for("#getDynamicContext"),Sn=Symbol(),C={context:null},Wr=class{constructor(t=null){this[Ge](t)}[Ge](t=null){var e;this.stack=t&&(e=t.stack)!==void 0?e:[]}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}},Zt=new Wr,X=class extends Map{static[Ge](){return this.prototype[vn]=Sn,this}constructor(t,e=null){super(),this._=t,this.sym=e,this[vn]===Sn&&this[xn]&&this[xn]()}pop(){return C.context=null}[Yr](t){let e=this.get(t);return e||this.set(t,e=new X(this._,t)),C.context=e}[Lh](t,e){return this[Yr](t)[Yr](e)}run(t){return this.value=t,C.context==this&&(C.context=null),this.get(t)}cache(t){return this.set(this.value,t),t}};X[Ge]();function wn(i,t=Symbol(),e=i){return C.context=i[t]||(i[t]=new X(e,t))}function ic(){let i=C.context,t=i||new X(null);return globalThis.DEBUG_IMBA&&!i&&Zt.stack.length>0&&console.warn("detected unmemoized nodes in",Zt.stack.slice(0),"see https://imba.io",t),i&&(C.context=null),t}function ei(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var B=Symbol.for("#__initor__"),z=Symbol.for("#__inited__"),w=Symbol.for("#__init__"),ri=Symbol.for("#parent"),Kn=Symbol.for("#context"),Tn=Symbol.for("#closestNode"),Nh=Symbol.for("#parentNode"),Ch=Symbol.for("##inited"),Xr=Symbol.for("#getRenderContext"),Oh=Symbol.for("#getDynamicContext"),Qr=Symbol.for("#replaceChild"),se=Symbol.for("#appendChild"),Ln=Symbol.for("#removeChild"),dt=Symbol.for("#insertInto"),Nn=Symbol.for("#insertChild"),te=Symbol.for("#removeFrom"),Cn=Symbol.for("#removeFromDeopt"),Vt=Symbol.for("#replaceWith"),On=Symbol.for("#replaceWithDeopt"),Jr=Symbol.for("#placeholderNode"),Mh=Symbol.for("#attachToParent"),Ph=Symbol.for("#detachFromParent"),kh=Symbol.for("#placeChild"),Eh=Symbol.for("#beforeReconcile"),Fh=Symbol.for("#afterReconcile"),Ih=Symbol.for("#afterVisit"),Ah=Symbol.for("#visitContext"),Mn=Symbol.for("#document"),qe=Symbol.for("#htmlNodeName"),Pn=Symbol.for("#ImbaElement"),kn=Symbol.for("#flags"),Ke=Symbol.for("#scripts"),Zr=Symbol.for("#location"),En=Symbol.for("##document"),Yn=Symbol.for("##parent"),Rh=Symbol.for("##up"),Fn=Symbol.for("##context"),ee=Symbol.for("#domNode"),$e=Symbol.for("##placeholderNode"),In=Symbol.for("#domDeopt"),Vh=Symbol.for("#insertIntoDeopt"),An=Symbol.for("##classList"),Be=Symbol.for("##style"),Rn=Symbol.for("##dataset"),nt=Symbol.for("#asset"),ti=Symbol.for("#innerHTML"),ze=Symbol.for("##visitContext"),Dh=Symbol.for("#isRichElement"),re=Symbol.for("#src"),Hh=Symbol.for("#getSlot"),jh=Symbol.for("#cssns"),Gh=Symbol.for("#cssid"),$h=Symbol.for("#dom"),Vn=Symbol(),Dn=Symbol(),Hn=Symbol(),jn=Symbol(),Gn=Symbol(),$n=Symbol(),Bh={},ie=null,ne=class extends URL{},Bn=class{get document(){return this[Mn]||(this[Mn]=new this.Document(this))}get location(){return this.document.location}};function uc(){return!0}var zh={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},ot=null,Wn={},ii=class{define(){return this}get(){return this}upgrade(){}whenDefined(){}},cc=new ii,Uh={};function pt(i,t){let e=i;if(typeof i=="string"&&(i=W[i]||T[i]||W[i+"Element"]||T["svg_"+i]),i instanceof L)return i;if(!i)return pt("HTML");if(i&&!i.klass){class r extends pt(i.up){}i.klass=r}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,a;n=0&&(t=t.replace(/\"/g,""")),t},si=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(/\")>=0&&(e=e.replace(/\>/g,">"))),e},et=class{static create(t,e){let r=new et;return r[Kn]=t,r.location=t.location,ie||(ie=new pn),ie.run(r,e),r}constructor(){}get flags(){return this[kn]||(this[kn]=new Mt({classList:new Dt(this)}))}get scripts(){return this[Ke]||(this[Ke]=[])}set location(t){typeof t=="string"&&(t=new ne(t)),this[Zr]=t}get location(){return this[Zr]||(this[Zr]=new ne("http://localhost/"))}createElement(t){let e=pt(t),r=new e(t);return r.nodeName=t,r}createElementNS(t,e){if(t=="http://www.w3.org/2000/svg"){let r=pt("svg_"+e),s=new r;return s.nodeName=e,s}return this.createElement(e)}createTextNode(t){return new Pt(t)}createComment(t){return new lt(t)}createDocumentFragment(){return new le}getElementById(t){return null}},ht=new et,zn=ht;function me(){return ie&&ie?.getStore?.()||ht}var Dt=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 Dt(t,this.classes.slice(0))}toString(){return this.classes.join(" ").trim()}},ni=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"}toString(){return this.tag&&this.tag.toNodeString?this.tag.toNodeString():this.outerHTML}};lt[w]();var d=class extends L{static[w](){return this.prototype[B]=jn,this}constructor(t){super(),this.nodeName=t,this.childNodes=[],this.attributes={},this[B]===jn&&this[z]&&this[z]()}emit(t,e,r={bubbles:!0}){console.warn("Element#emit not supported on node")}get classList(){return this[An]||(this[An]=new Dt(this))}get style(){return this[Be]||(this[Be]=new ni)}get dataset(){return this[Rn]||(this[Rn]=oe.wrap(this))}get richValue(){return this.value}set richValue(t){this.value=t}set asset(t){this[nt]=t}get asset(){return this[nt]}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[ti]=t}get innerHTML(){let t="";if(this[ti])return this[ti];if(this.textContent!=null)return si(this.textContent);for(let e=0,r=ei(this.childNodes),s=r.length;e":"<"+r+">"+this.innerHTML+""}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(;e0;){let e=this.childNodes[--t];if(e instanceof d)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}[Eh](){return this}[Fh](){return this}[Ih](){this.render&&this.render(),this[ze]&&(this[ze]=null)}get[Ah](){return this[ze]||(this[ze]={})}get flags(){return this.$flags||(this.$flags=new Mt(this),this.flag$==d.prototype.flag$&&(this.flags$ext=this.className),this.flagDeopt$()),this.$flags}flag$(t){let e=this.flags$ns;this.className=e?e+(this.flags$ext=t):this.flags$ext=t}flagDeopt$(){var t=this;this.flag$=this.flagExt$,t.flagSelf$=function(e){return t.flagSync$(t.flags$own=e)}}flagExt$(t){return this.flagSync$(this.flags$ext=t)}flagSelf$(t){return this.flagDeopt$(),this.flagSelf$(t)}flagSync$(){return this.className=(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||"")}set$(t,e){let r=Hr(this,t,d);!r||!r.set?this.setAttribute(t,e):this[t]=e}};d[w]();d.prototype.setns$=d.prototype.setAttributeNS;d.prototype[Dh]=!0;var le=class extends d{static[w](){return this.prototype[B]=Gn,this}constructor(){super(null),this[B]===Gn&&this[z]&&this[z]()}get outerHTML(){return this.innerHTML}};le[w]();var Un=class extends le{get outerHTML(){return this.innerHTML}},P=class extends d{},Ye=class extends P{static[w](){return this.prototype[B]=$n,this}constructor(){super(...arguments),super[w]||this[w](),this[B]===$n&&this[z]&&this[z]()}[w](t=null){super[w]&&super[w](...arguments),this.hmr=t?t.hmr:void 0}get scripts(){return this[Ke]||(this[Ke]=[])}get outerHTML(){let t=ot;ot=this;let e=super.outerHTML,r=new Set,s=[],n=[];if(globalThis.IMBA_HMR_PATH&&this.hmr!==!1&&n.push("