@ouidesigner/ouider 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,134 @@
1
+ import kr from'route-parser';var ye=Object.defineProperty,Ve=Object.defineProperties;var ze=Object.getOwnPropertyDescriptors;var Rt=Object.getOwnPropertySymbols;var we=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var Dt=(a,t,e)=>t in a?ye(a,t,{enumerable:true,configurable:true,writable:true,value:e}):a[t]=e,G=(a,t)=>{for(var e in t||(t={}))we.call(t,e)&&Dt(a,e,t[e]);if(Rt)for(var e of Rt(t))ge.call(t,e)&&Dt(a,e,t[e]);return a},ve=(a,t)=>Ve(a,ze(t)),f=(a,t)=>ye(a,"name",{value:t,configurable:true});var be=(a,t)=>{var e={};for(var s in a)we.call(a,s)&&t.indexOf(s)<0&&(e[s]=a[s]);if(a!=null&&Rt)for(var s of Rt(a))t.indexOf(s)<0&&ge.call(a,s)&&(e[s]=a[s]);return e};var p=(a,t,e)=>Dt(a,typeof t!="symbol"?t+"":t,e);var Ft=class Ft{constructor(){p(this,"components",new Map);}register(t,e){console.log(`[OUID] - Registering component: ${t}`);let s=t.toLocaleLowerCase();this.components.has(s)||this.components.set(s,e);}unregister(t){let e=t.toLocaleLowerCase();this.components.delete(e);}get(t){return this.components.get(t.toLocaleLowerCase())}has(t){return this.components.has(t)}getAll(){return Array.from(this.components.entries())}};f(Ft,"ComponentsRegistry");var mt=Ft,it=new mt;var Bt=class Bt{constructor(t){p(this,"events");this.events=t;}emit(t,...e){let s=this.events[t];s?s(...e):console.log("Not handler found for ",t);}};f(Bt,"Emits");var yt=Bt;var Vt=new WeakMap,wt=Symbol("iterate"),ht=null,Ct=[],dt,We=(dt=class{constructor(t,e,s){p(this,"fn");p(this,"scheduler");p(this,"onStop");p(this,"deps",[]);p(this,"active",true);this.fn=t,this.scheduler=e,this.onStop=s;}run(){var t;if(!this.active)return this.fn();try{return Ct.push(this),ht=this,Ee(this),this.fn()}finally{Ct.pop(),ht=(t=Ct[Ct.length-1])!=null?t:null;}}stop(){var t;this.active&&(Ee(this),this.active=false,(t=this.onStop)==null||t.call(this));}},f(dt,"ReactiveEffect"),dt);function Ee(a){for(let t of a.deps)t.delete(a);a.deps.length=0;}f(Ee,"cleanupEffect");function Ot(a,t){if(!ht)return;let e=Vt.get(a);e||Vt.set(a,e=new Map);let s=e.get(t);s||e.set(t,s=new Set),s.has(ht)||(s.add(ht),ht.deps.push(s));}f(Ot,"track");function W(a,t){let e=Vt.get(a);if(!e)return;let s=e.get(t);if(!s)return;let i=new Set(s);for(let c of i)c.scheduler?c.scheduler():c.run();}f(W,"trigger");var qt=new Set,Ht=false;function Ke(a){if(typeof queueMicrotask=="function"){queueMicrotask(a);return}if(typeof Promise!="undefined"){Promise.resolve().then(a);return}setTimeout(a,0);}f(Ke,"scheduleMicrotask");function Ge(a){qt.add(a),!Ht&&(Ht=true,Ke(()=>{try{for(let t of qt)t();}finally{qt.clear(),Ht=false;}}));}f(Ge,"queueJob");function vt(a,t){let e=new We(a,t==null?void 0:t.scheduler,t==null?void 0:t.onStop),s=e.run.bind(e);return s.effect=e,t!=null&&t.lazy||s(),s}f(vt,"effect");function Ye(a){a.effect.stop();}f(Ye,"stop");function gt(a){return a!==null&&typeof a=="object"}f(gt,"isObject");function ke(a){return a.__isRef===true||a instanceof Date||a instanceof RegExp||a instanceof ArrayBuffer||a instanceof DataView||ArrayBuffer.isView(a)||a instanceof Map||a instanceof Set||a instanceof WeakMap||a instanceof WeakSet||a instanceof Error}f(ke,"isSkippableReactive");var xt=new WeakMap,At=new WeakSet;function nt(a){if(!gt(a)||At.has(a)||ke(a))return a;let t=xt.get(a);if(t)return t;let e=new Proxy(a,{get(s,i,c){let u=Reflect.get(s,i,c);return Ot(s,i),gt(u)?nt(u):u},set(s,i,c,u){let l=Reflect.get(s,i,u),y=Array.isArray(s)?s.length:void 0,g=Reflect.set(s,i,c,u);return Object.is(l,c)||(W(s,i),Array.isArray(s)&&i==="length"&&W(s,wt),Array.isArray(s)&&i!=="length"&&typeof i!="symbol"&&Number.isInteger(Number(i))&&W(s,wt),Array.isArray(s)&&i!=="length"&&typeof i!="symbol"&&Number.isInteger(Number(i))&&y!==void 0&&Number(i)>=y&&W(s,"length")),g},deleteProperty(s,i){let c=Object.prototype.hasOwnProperty.call(s,i),u=Reflect.deleteProperty(s,i);return c&&u&&(W(s,i),Array.isArray(s)&&(W(s,"length"),W(s,wt))),u}});return xt.set(a,e),At.add(e),e}f(nt,"reactive");function Te(a){if(!gt(a)||At.has(a)||ke(a))return a;let t=xt.get(a);if(t)return t;let e=new Proxy(a,{get(s,i,c){let u=Reflect.get(s,i,c);return Ot(s,i),u},set(s,i,c,u){let l=Reflect.get(s,i,u),y=Reflect.set(s,i,c,u);return Object.is(l,c)||W(s,i),y},deleteProperty(s,i){let c=Object.prototype.hasOwnProperty.call(s,i),u=Reflect.deleteProperty(s,i);return c&&u&&W(s,i),u}});return xt.set(a,e),At.add(e),e}f(Te,"shallowReactive");function Pt(a){return !!a&&typeof a=="object"&&a.__isRef===true}f(Pt,"isRef");function zt(a){let t=gt(a)?nt(a):a,e={__isRef:true,get value(){return Ot(e,"value"),t},set value(s){let i=gt(s)?nt(s):s;Object.is(i,t)||(t=i,W(e,"value"));}};return e}f(zt,"ref");function Se(a){let t=true,e,s={__isRef:true},i=vt(a,{lazy:true,scheduler:f(()=>{t||(t=true,W(s,"value"));},"scheduler")});return Object.defineProperty(s,"value",{get(){return Ot(s,"value"),t&&(t=false,e=i()),e},set(){throw new Error("computed is readonly")},enumerable:true}),s}f(Se,"computed");function Re(a){let t,e=f(i=>t=i,"onCleanup"),s=vt(()=>{t==null||t(),t=void 0,a(e);},{scheduler:f(()=>Ge(s),"scheduler"),onStop:f(()=>{t==null||t(),t=void 0;},"onStop")});return ()=>Ye(s)}f(Re,"watchEffect");function Wt(a){return Pt(a)}f(Wt,"isStated");function Ce(a){return zt(a)}f(Ce,"stated");var Kt=class Kt{constructor(t){p(this,"_ctx");this._ctx=nt(t);}wrap(t){return zt(t)}computed(t){return Se(t)}watchEffect(t){return Re(t)}get value(){return this._ctx}};f(Kt,"State");var bt=Kt;var Je=0;function Gt(a){return function(t){var i;let e=(i=class extends t{constructor(){super(...arguments);p(this,"template",a.template);p(this,"css",a.css);p(this,"tag",a.tag);p(this,"use",a.use);p(this,"hostClasses",a.hostClasses);p(this,"hash","component-"+Je+"-"+a.tag);}},f(i,"WithDecoration"),i),s=e;return s.tag=a.tag,e}}f(Gt,"Component");var _t=class _t{constructor(t,e=[]){p(this,"node");p(this,"children");this.node=t,this.children=e;}attachTo(t){if(typeof this.node=="string"){t.innerHTML=this.node;return}let e=this.node;for(let s of this.children)s.attachTo(e);t.appendChild(e);}static of(t,e=[]){return new _t(t,e)}addChild(t){return this.children.push(t),this}};f(_t,"RenderNode");var ft=_t,Et=class Et{constructor(t,e){p(this,"data");p(this,"css");this.data=t,this.css=e;}toString(){let t=this.css?this.css+`
2
+ `:"";for(let e in this.data){let s=this.data[e];typeof s=="string"?t+=`${e} { ${s} }
3
+ `:s instanceof Et&&(t+=`${e} {
4
+ ${s.toString()}}
5
+ `);}return t}static of(t,...e){return new Et(t,e.join(`
6
+ `))}};f(Et,"StyleData");var It=Et;function Yt(a,t,e){let s=new a(t,e);for(let i of Object.keys(s)){let c=s[i];c&&typeof c=="object"&&!Pt(c)&&!(c instanceof bt)&&!(c instanceof yt)&&!(c instanceof Map)&&(s[i]=nt(c));}return Te(s)}f(Yt,"createComponent");var Jt=class Jt{constructor(t={},e={}){p(this,"state");p(this,"parent");p(this,"emits");p(this,"props");p(this,"provides",new Map);this.state=new bt({}),this.props=t,this.emits=new yt(e);}onActivated(){}onDeactivated(){}onMounted(){}willMount(){}willUnmount(){}provide(t,e){this.provides.set(t,e);}inject(t){let e=this;for(;e;){if(e.provides.has(t))return e.provides.get(t);e=e.parent;}}decorateHostElement(t){return Promise.resolve()}};f(Jt,"OComponent");var at=Jt;function Z(a){let t=Date.now();return `${(1e3+Math.floor(Math.random()*9e3)+a.length).toString(16)}-${t.toString(16)}`}f(Z,"generateUIID");function Xt(a){return new Promise(t=>setTimeout(t,a))}f(Xt,"delay");var Xe=typeof globalThis.queueMicrotask=="function",tt=f(a=>a?Xe?queueMicrotask(a):Promise.resolve().then(a):Promise.resolve(),"deferMicro");function Qt(a){return a.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,"").replace(/<object\b[^<]*(?:(?!<\/object>)<[^<]*)*<\/object>/gi,"").replace(/<embed\b[^>]*>/gi,"").replace(/<link\b[^>]*>/gi,"").replace(/<meta\b[^>]*>/gi,"").replace(/\s+on[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/\s+(href|src|xlink:href)\s*=\s*(["'])\s*(?:javascript:|data:text\/html)[\s\S]*?\2/gi,"").replace(/\s+(href|src|xlink:href)\s*=\s*(?:javascript:|data:text\/html)[^\s>]*/gi,"")}f(Qt,"sanitizeHTML");(function(a){var F,v,k,N,_,z,ot,D,ct,ut,et,rt,st;let t=(F=class{constructor(){p(this,"actions",[]);}async exec(){await this.commit();}add(h){return this.actions.push(h),this}async commit(){let h=this.actions;this.actions=[],await Promise.all(h.map(async r=>await r()));}},f(F,"BatchActions"),F);a.BatchActions=t;let e=new Set(["invoke","dispatchEvent","setProperty"]),s=[],i=new Map,c=false,u=[];function l(K){return `${K.fn}|${K.args.map(h=>{var r,n;return h==null?"":typeof h=="object"?(n=(r=h.__ref__)!=null?r:h.uid)!=null?n:"[object]":String(h)}).join("|")}`}f(l,"batchKey");function y(){if(c)return;c=true;let K=f(()=>{c=false,g();},"runner");typeof queueMicrotask=="function"?queueMicrotask(K):setTimeout(K,0);}f(y,"scheduleBatchFlush");async function g(){let K=s;s=[],i.clear();let h=u;u=[];try{K.length&&await w.batchActions(K);for(let r of h)r.resolve();}catch(r){for(let n of h)n.reject(r);}}f(g,"flushBatchQueue");function b(K){for(let h of K){if(e.has(h.fn)){s.push(h);continue}let r=l(h),n=i.get(r);n!==void 0?s[n]=h:(i.set(r,s.length),s.push(h));}return y(),new Promise((h,r)=>{u.push({resolve:h,reject:r});})}f(b,"enqueueBatchActions");let T=(v=class{constructor(h){p(this,"node");p(this,"operations",[]);this.node=h;}accept(h){this.operations.push(...h.operations),h.operations=[];}async exec(h=false){let r=this.operations;this.operations=[];let n=[],o=r.map(d=>typeof d=="object"?(n.push({fn:d.fn,args:[d.node.uid,...d.args.map(m=>m instanceof S?m.uid:m)]}),null):d()).filter(d=>d!=null);if(n.length>0){let d=new Set,m=[];n.forEach(R=>{let A=l(R);d.has(A)&&!["invoke","setProperty","dispatchEvent"].includes(R.fn)||(d.add(A),m.push(R));}),h?o.unshift(w.batchActions(m)):o.unshift(b(m));}try{await Promise.all(o);}catch(d){console.error("Error while batch updates");}}append(h,...r){return this.operations.push({fn:h,args:r,node:this.node}),this}add(h,r,...n){return typeof h=="function"?this.operations.push(h):this.operations.push({fn:h,args:n,node:r}),this}addEventListener(h,r,n,o){return this.add(()=>{this.node.addEventListener(h,r,{options:n,policy:o});})}setProperty(h,r){return this.append("setProperty",h,r)}dettachEventListener(h){return this.append("dettachEventListener",h)}invoke(h,...r){return this.append("invoke",h,...r.map(n=>n instanceof S?n.ref:n))}dispatchEvent(h,r,n){return this.append("dispatchEvent",h,r,n)}addClass(...h){return this.append("addClass",...h)}removeClass(...h){return this.append("removeClass",...h)}setAttribute(h,r){return this.append("setAttribute",h,r)}removeAttribute(h){return this.append("removeAttribute",h)}appendChild(h){return this.append("appendChild",h.uid)}removeChild(h){return this.append("removeChild",h.uid)}remove(){return this.append("remove")}removeAndRelease(){return this.append("remove").append("release")}release(){return this.append("release")}innerHTML(h){return this.append("setHTML",Qt(h))}replaceChildNode(h,r){return this.append("replaceChildNode",h,r)}replaceWith(h){return this.append("replaceWith",h.uid)}after(h){return this.append("after",h.uid)}setInnerText(h){return this.append("setInnerText",h)}setContentText(h){return this.append("setContentText",h)}insertBefore(h,r){return this.append("insertBefore",h.uid,r.uid)}setInputValue(h){return this.append("setInputValue",h)}setStyle(h,r){return this.append("setStyle",h,r)}},f(v,"BatchUpdates"),v);a.BatchUpdates=T;let S=(k=class{constructor(h,r){p(this,"uid");p(this,"tag");this.uid=h,this.tag=r;}static toInstance(h){return new k(h.uid,h.tag)}async release(){await w.call("releaseNode",this.uid);}async addEventListener(h,r,n){return w.addEventListener(this,h,r,{options:n==null?void 0:n.options,policy:n==null?void 0:n.policy})}async dettachEventListener(h){await w.dettachEventListener(h);}async invoke(h,...r){return await w.call("invokeObjectMethod",this.uid,h,...r)}async invokeAndHold(h,...r){let n=await w.call("invokeObjectMethodAndHold",this.uid,h,...r);return n&&new k(n.uid,n.tag)}async getProperty(h){return await w.call("getObjectProperty",this.uid,h)}async getPropertyAndHold(h){let r=await w.call("getObjectPropertyAndHold",this.uid,h);return r&&new k(r.uid,r.tag)}async setProperty(h,r){await w.call("setObjectProperty",this.uid,h,r);}async indexAccessAndHold(h){let r=await w.call("indexAccessAndHold",this.uid,h);return r&&new k(r.uid,r.tag)}async indexAccess(h){return await w.call("indexAccess",this.uid,h)}async dispatchEvent(h,r,n){await w.call("dispatchEvent",this.uid,h,r,n);}updates(){return new T(this)}batches(){return new T(this)}get ref(){return {__ref__:this.uid}}},f(k,"OObject"),k);a.OObject=S;let M=(N=class extends S{constructor(r){super(r.uid,r.tag);p(this,"textContent");p(this,"type","Unknown");p(this,"attributes");p(this,"children");p(this,"classes");p(this,"style");for(let m in r)this[m]=r[m];(this.attributes)!=null||(this.attributes=[]),(this.classes)!=null||(this.classes=[]),(this.style)!=null||(this.style="");}},f(N,"ONode"),N);a.ONode=M;let E=(_=class extends M{constructor(r){super(r);p(this,"_hydrated",false);}async addClass(...r){await w.call("addClass",this.uid,...r);}async removeClass(...r){await w.call("removeClass",this.uid,...r);}async setAttribute(r,n){let o=await w.call("setAttribute",this.uid,r,n);o&&(this.attributes=o);}async removeAttribute(r){let n=await w.call("removeAttribute",this.uid,r);n&&(this.attributes=n);}async appendChild(r){await w.call("appendChild",this.uid,r.uid);}set innerHTML(r){this.setHTML(r);}async cloneNode(r){let n=await w.call("cloneNode",this.uid,r);return n?new _(n):null}async remove(){await w.call("removeNode",this.uid);}async removeAndRelease(){await this.remove(),await this.release();}async removeChild(r){await w.call("removeChild",this.uid,r.uid);}async replaceChildNode(r,n){await w.call("replaceChildNode",this.uid,r.uid,n.uid);}async replaceWith(r){await w.call("replaceWith",this.uid,r.uid);}async after(r){await w.call("insertAfter",this.uid,r.uid);}async setHTML(r){await w.call("setInnerHTML",this.uid,Qt(r));}async HTML(){var r;return (r=await w.call("getInnerHTML",this.uid))!=null?r:""}async setInnerText(r){await w.call("setInnerText",this.uid,r);}async setContentText(r){await w.call("setContentText",this.uid,r);}async getContentText(){var r;return (r=await w.call("getContentText",this.uid))!=null?r:""}async content(){var r;try{return (r=await w.call("getInnerText",this.uid))!=null?r:""}catch(n){return console.error(n),""}}async childNodes(){var r,n;return (n=(r=await w.call("childNodes",this.uid))==null?void 0:r.map(o=>new _(o)))!=null?n:[]}hasAttribute(r){return !!this.attributes.find(n=>n.name===r)}async getAttribute(r){var n;return (n=await w.call("getAttribte",this.uid,r))!=null?n:""}attribute(r){var n,o;return (o=(n=this.attributes.find(d=>d.name===r))==null?void 0:n.value)!=null?o:null}async nextSibling(){let r=await w.call("nextSibling",this.uid);return r?new _(r):null}async getAttributeNames(){var r;return (r=await w.call("getAttributeNames",this.uid))!=null?r:[]}async parentNode(){let r=await w.call("parentNode",this.uid);return r?new _(r):null}async insertBefore(r,n){await w.call("insertBefore",this.uid,r.uid,n.uid);}async setInputValue(r){await w.call("setInputValue",this.uid,r);}async inputValue(){var r;return (r=await w.call("inputValue",this.uid))!=null?r:""}get hydrated(){return this._hydrated}hydrate(){this._hydrated=true,this.addClass("hydrated");}async query(r,n){return await w.query(r,n,this.uid)}async queryAll(r,n){return await w.queryAll(r,n,this.uid)}async setStyle(r,n){await w.call("setStyle",this.uid,r,n);}async animate(r,n){return w.createAnimation(this,r,n)}},f(_,"OElement"),_);a.OElement=E;let O=(z=class extends S{constructor(r){super(r.uid,r.tag);p(this,"pendingEffectFragments",[]);p(this,"pendingEffectTiming");p(this,"pendingRawKeyframes");p(this,"effectFlushScheduled",false);}set(r,n){return this.pendingRawKeyframes=r,this.pendingEffectFragments=[],this.mergeTiming(n),this.scheduleEffectFlush(),this}timing(r){return this.mergeTiming(r),this.scheduleEffectFlush(),this}timingFunction(r){return this.timing({timingFunction:r})}async commitEffects(){if(!this.pendingRawKeyframes&&this.pendingEffectFragments.length===0&&typeof this.pendingEffectTiming=="undefined")return this.effectFlushScheduled=false,this;let r=this.pendingRawKeyframes,n=this.pendingEffectFragments,o=this.pendingEffectTiming;return this.pendingRawKeyframes=void 0,this.pendingEffectFragments=[],this.pendingEffectTiming=void 0,this.effectFlushScheduled=false,r?await this.invoke("effect.setKeyframes",r):n.length>0&&await this.invoke("effect.setKeyframes",tr(n)),typeof o!="undefined"&&await this.invoke("effect.updateTiming",Zt(o)),this}property(r,n,o,d,m=""){return this.queueEffect({property:r,from:$(n,m),to:$(o,m),group:"style"},d)}transformList(r,n,o){return this.transform(r.join(" "),n.join(" "),o)}scale(r,n,o){return this.transform(`scale(${P(r)})`,`scale(${P(n)})`,o)}scaleX(r,n,o){return this.transform(`scaleX(${P(r)})`,`scaleX(${P(n)})`,o)}scaleY(r,n,o){return this.transform(`scaleY(${P(r)})`,`scaleY(${P(n)})`,o)}scaleZ(r,n,o){return this.transform(`scaleZ(${P(r)})`,`scaleZ(${P(n)})`,o)}scale3d(r,n,o){let d=Ae(r),m=Ae(n);return this.transform(`scale3d(${d.x}, ${d.y}, ${d.z})`,`scale3d(${m.x}, ${m.y}, ${m.z})`,o)}perspective(r,n,o){return this.transform(`perspective(${Y(r)})`,`perspective(${Y(n)})`,o)}matrix(r,n,o){return this.transform(`matrix(${r.join(", ")})`,`matrix(${n.join(", ")})`,o)}matrix3d(r,n,o){return this.transform(`matrix3d(${r.join(", ")})`,`matrix3d(${n.join(", ")})`,o)}rotate(r,n,o){return this.transform(`rotate(${q(r)})`,`rotate(${q(n)})`,o)}rotateX(r,n,o){return this.transform(`rotateX(${q(r)})`,`rotateX(${q(n)})`,o)}rotateY(r,n,o){return this.transform(`rotateY(${q(r)})`,`rotateY(${q(n)})`,o)}rotateZ(r,n,o){return this.transform(`rotateZ(${q(r)})`,`rotateZ(${q(n)})`,o)}rotate3d(r,n,o,d,m,R){return this.transform(`rotate3d(${r}, ${n}, ${o}, ${q(d)})`,`rotate3d(${r}, ${n}, ${o}, ${q(m)})`,R)}skew(r,n,o){let d=Nt(r,"deg"),m=Nt(n,"deg");return this.transform(`skew(${d.x}, ${d.y})`,`skew(${m.x}, ${m.y})`,o)}skewX(r,n,o){return this.transform(`skewX(${q(r)})`,`skewX(${q(n)})`,o)}skewY(r,n,o){return this.transform(`skewY(${q(r)})`,`skewY(${q(n)})`,o)}translate(r,n,o){let d=Nt(r,"px"),m=Nt(n,"px");return this.transform(`translate(${d.x}, ${d.y})`,`translate(${m.x}, ${m.y})`,o)}translateX(r,n,o){return this.transform(`translateX(${Y(r)})`,`translateX(${Y(n)})`,o)}translateY(r,n,o){return this.transform(`translateY(${Y(r)})`,`translateY(${Y(n)})`,o)}translateZ(r,n,o){return this.transform(`translateZ(${Y(r)})`,`translateZ(${Y(n)})`,o)}translate3d(r,n,o){let d=xe(r,"px"),m=xe(n,"px");return this.transform(`translate3d(${d.x}, ${d.y}, ${d.z})`,`translate3d(${m.x}, ${m.y}, ${m.z})`,o)}top(r,n,o){return this.css("top",r,n,o)}right(r,n,o){return this.css("right",r,n,o)}left(r,n,o){return this.css("left",r,n,o)}bottom(r,n,o){return this.css("bottom",r,n,o)}opacity(r,n,o){return this.property("opacity",r,n,o)}width(r,n,o){return this.css("width",r,n,o)}height(r,n,o){return this.css("height",r,n,o)}minWidth(r,n,o){return this.css("minWidth",r,n,o)}minHeight(r,n,o){return this.css("minHeight",r,n,o)}maxWidth(r,n,o){return this.css("maxWidth",r,n,o)}maxHeight(r,n,o){return this.css("maxHeight",r,n,o)}margin(r,n,o){return this.css("margin",r,n,o)}marginTop(r,n,o){return this.css("marginTop",r,n,o)}marginRight(r,n,o){return this.css("marginRight",r,n,o)}marginBottom(r,n,o){return this.css("marginBottom",r,n,o)}marginLeft(r,n,o){return this.css("marginLeft",r,n,o)}padding(r,n,o){return this.css("padding",r,n,o)}paddingTop(r,n,o){return this.css("paddingTop",r,n,o)}paddingRight(r,n,o){return this.css("paddingRight",r,n,o)}paddingBottom(r,n,o){return this.css("paddingBottom",r,n,o)}paddingLeft(r,n,o){return this.css("paddingLeft",r,n,o)}borderRadius(r,n,o){return this.css("borderRadius",r,n,o)}borderWidth(r,n,o){return this.css("borderWidth",r,n,o)}outlineWidth(r,n,o){return this.css("outlineWidth",r,n,o)}gap(r,n,o){return this.css("gap",r,n,o)}rowGap(r,n,o){return this.css("rowGap",r,n,o)}columnGap(r,n,o){return this.css("columnGap",r,n,o)}fontSize(r,n,o){return this.css("fontSize",r,n,o)}lineHeight(r,n,o){return this.property("lineHeight",r,n,o)}letterSpacing(r,n,o){return this.css("letterSpacing",r,n,o)}zIndex(r,n,o){return this.property("zIndex",r,n,o)}flexGrow(r,n,o){return this.property("flexGrow",r,n,o)}flexShrink(r,n,o){return this.property("flexShrink",r,n,o)}color(r,n,o){return this.property("color",r,n,o)}backgroundColor(r,n,o){return this.property("backgroundColor",r,n,o)}borderColor(r,n,o){return this.property("borderColor",r,n,o)}outlineColor(r,n,o){return this.property("outlineColor",r,n,o)}boxShadow(r,n,o){return this.property("boxShadow",r,n,o)}textShadow(r,n,o){return this.property("textShadow",r,n,o)}clipPath(r,n,o){return this.property("clipPath",r,n,o)}backgroundPosition(r,n,o){return this.property("backgroundPosition",r,n,o)}backgroundSize(r,n,o){return this.property("backgroundSize",r,n,o)}objectPosition(r,n,o){return this.property("objectPosition",r,n,o)}filter(r,n,o){return this.queueEffect({property:"filter",from:r,to:n,group:"filter"},o)}backdropFilter(r,n,o){return this.property("backdropFilter",r,n,o)}blur(r,n,o){return this.filter(`blur(${Y(r)})`,`blur(${Y(n)})`,o)}brightness(r,n,o){return this.filter(`brightness(${P(r)})`,`brightness(${P(n)})`,o)}contrast(r,n,o){return this.filter(`contrast(${P(r)})`,`contrast(${P(n)})`,o)}grayscale(r,n,o){return this.filter(`grayscale(${P(r)})`,`grayscale(${P(n)})`,o)}hueRotate(r,n,o){return this.filter(`hue-rotate(${q(r)})`,`hue-rotate(${q(n)})`,o)}invert(r,n,o){return this.filter(`invert(${P(r)})`,`invert(${P(n)})`,o)}saturate(r,n,o){return this.filter(`saturate(${P(r)})`,`saturate(${P(n)})`,o)}sepia(r,n,o){return this.filter(`sepia(${P(r)})`,`sepia(${P(n)})`,o)}dropShadow(r,n,o){return this.filter(`drop-shadow(${r})`,`drop-shadow(${n})`,o)}transform(r,n,o){return this.queueEffect({property:"transform",from:r,to:n,group:"transform"},o)}css(r,n,o,d){return this.property(r,n,o,d,"px")}async play(){await this.commitEffects(),await this.invoke("play");}async pause(){await this.commitEffects(),await this.invoke("pause");}async cancel(){await this.commitEffects(),await this.invoke("cancel");}async finish(){await this.commitEffects(),await this.invoke("finish");}async reverse(){await this.commitEffects(),await this.invoke("reverse");}async commitStyles(){await this.commitEffects(),await this.invoke("commitStyles");}async persist(){await this.commitEffects(),await this.invoke("persist");}async updatePlaybackRate(r){await this.invoke("updatePlaybackRate",r);}async playState(){return await this.getProperty("playState")}async currentTime(){return await this.getProperty("currentTime")}async setCurrentTime(r){await this.setProperty("currentTime",r);}async playbackRate(){return await this.getProperty("playbackRate")}async setPlaybackRate(r){await this.setProperty("playbackRate",r);}queueEffect(r,n){return this.pendingRawKeyframes=void 0,this.pendingEffectFragments.push(r),this.mergeTiming(n),this.scheduleEffectFlush(),this}mergeTiming(r){if(typeof r!="undefined"){if(typeof r=="number"){this.pendingEffectTiming=Zt(r);return}this.pendingEffectTiming=G(G({},typeof this.pendingEffectTiming=="object"?this.pendingEffectTiming:{}),Zt(r));}}scheduleEffectFlush(){this.effectFlushScheduled||(this.effectFlushScheduled=true,w.nextTick(()=>{this.commitEffects().catch(r=>console.error("Failed to commit animation effects",r));}));}},f(z,"OAnimation"),z);a.OAnimation=O;let I=(ot=class extends S{constructor(h){super(h.uid,h.tag);}addColorStop(h,r){return this.invoke("addColorStop",h,r),this}},f(ot,"CanvasGradient"),ot);a.CanvasGradient=I;let L=(D=class extends S{constructor(r){super(r.uid,r.tag);p(this,"batch",new T(this));}static async new(r){let n=typeof r!="undefined"?await w.newObject("DOMMatrix",r):await w.newObject("DOMMatrix");return n?new D(n):null}invertSelf(){return this.batch.invoke("invertSelf"),this}multiplySelf(r){return this.batch.invoke("multiplySelf",...r?[r.ref]:[]),this}premultiplySelf(r){return this.batch.invoke("premultiplySelf",...r?[r.ref]:[]),this}rotateAxisAngleSelf(r,n,o,d){let m=[];return r&&m.push(r),n&&m.push(n),o&&m.push(o),d&&m.push(d),this.batch.invoke("rotateAxisAngleSelf",...m),this}rotateFromVectorSelf(r,n){let o=[];return r&&o.push(r),n&&o.push(n),this.batch.invoke("rotateFromVectorSelf",...o),this}rotateSelf(r,n,o){let d=[];return r&&d.push(r),n&&d.push(n),o&&d.push(o),this.batch.invoke("rotateFromVectorSelf",...d),this}scale3dSelf(r,n,o,d){let m=[];return r&&m.push(r),n&&m.push(n),o&&m.push(o),d&&m.push(d),this.batch.invoke("scale3dSelf",...m),this}scaleSelf(r,n,o,d,m,R){let A=[];return r&&A.push(r),n&&A.push(n),o&&A.push(o),d&&A.push(d),m&&A.push(m),R&&A.push(R),this.batch.invoke("scaleSelf",...A),this}setMatrixValue(r){return this.invoke("setMatrixValue",r),this}skewXSelf(r){return this.batch.invoke("skewXSelf",r),this}skewYSelf(r){return this.batch.invoke("skewYSelf",r),this}translateSelf(r,n,o){return this.batch.invoke("translateSelf",r,n,...o?[o]:[]),this}async commit(){await this.batch.exec();}async is2D(){var r;return (r=await this.invoke("is2D"))!=null?r:false}async isIdentity(){var r;return (r=await this.invoke("isIdentity"))!=null?r:false}async flipX(){let r=await this.invokeAndHold("flipX");return r?new D(r):null}async flipY(){let r=await this.invokeAndHold("flipY");return r?new D(r):null}async inverse(){let r=await this.invokeAndHold("inverse");return r?new D(r):null}async multiply(r){let n=await this.invokeAndHold("multiply",...r?[r.ref]:[]);return n?new D(n):null}async rotate(r,n,o){let d=[];r&&d.push(r),n&&d.push(n),o&&d.push(o);let m=await this.invokeAndHold("rotate",...d);return m?new D(m):null}async rotateAxisAngle(r,n,o,d){let m=[];r&&m.push(r),n&&m.push(n),o&&m.push(o),d&&m.push(d);let R=await this.invokeAndHold("rotateAxisAngle",...m);return R?new D(R):null}async rotateFromVector(r,n){let o=[];r&&o.push(r),n&&o.push(n);let d=await this.invokeAndHold("rotateFromVector",...o);return d?new D(d):null}async scale(r,n,o,d,m,R){let A=[];r&&A.push(r),n&&A.push(n),o&&A.push(o),d&&A.push(d),m&&A.push(m),R&&A.push(R);let V=await this.invokeAndHold("scale",...A);return V?new D(V):null}async scale3d(r,n,o,d){let m=[];r&&m.push(r),n&&m.push(n),o&&m.push(o),d&&m.push(d);let R=await this.invokeAndHold("scale",...m);return R?new D(R):null}async skewX(r){let n=[];r&&n.push(r);let o=await this.invokeAndHold("skewX",...n);return o?new D(o):null}async skewY(r){let n=[];r&&n.push(r);let o=await this.invokeAndHold("skewY",...n);return o?new D(o):null}toJSON(){return this.invoke("toJSON")}async toString(){return this.invoke("toString")}async translate(r,n,o){let d=[];r&&d.push(r),n&&d.push(n),o&&d.push(o);let m=await this.invokeAndHold("translate",...d);return m?new D(m):null}},f(D,"DOMMatrix"),D);a.DOMMatrix=L;let j=(ct=class extends S{constructor(h){super(h.uid,h.tag);}async setTransform(h){await this.invoke("setTransform",h.ref);}},f(ct,"CanvasPattern"),ct);a.CanvasPattern=j;let C=(ut=class extends S{constructor(r){super(r,"unknown");p(this,"batch",new T(this));}arc(r,n,o,d,m,R=false){return this.batch.invoke("arc",r,n,o,d,m,R),this}arcTo(r,n,o,d,m){return this.batch.invoke("arcTo",r,n,o,d,m),this}bezierCurveTo(r,n,o,d,m,R){return this.batch.invoke("bezierCurveTo",r,n,o,d,m,R),this}clearRect(r,n,o,d){return this.batch.invoke("clearRect",r,n,o,d),this}clip(r,n){let o=[];return typeof r=="string"?o.push(r):r instanceof Q&&(r.commit(this.batch),o.push(r.ref)),typeof n=="string"&&o.push(n),this.batch.invoke("clip",...o),this}beginPath(){return this.batch.invoke("beginPath"),this}closePath(){return this.batch.invoke("closePath"),this}async createConicGradient(r,n,o){let d=await this.invokeAndHold("createConicGradient",r,n,o);return d?new I(d):null}async createLinearGradient(r,n,o,d){let m=await this.invokeAndHold("createLinearGradient",r,n,o,d);return m?new I(m):null}async createPattern(r,n=""){let o=await this.invokeAndHold("createPattern",r.ref,n);return o?new j(o):null}async createRadialGradient(r,n,o,d,m,R){let A=await this.invokeAndHold("createRadialGradient",r,n,o,d,m,R);return A?new I(A):null}drawImage(r,n,o,d,m,R,A,V,He){let lt=[r.ref];return typeof R=="undefined"?(lt.push(n,o),d&&lt.push(d),m&&lt.push(m),this.batch.invoke("drawImage",...lt),this):(lt.push(n,o,d,m,R,A,V,He),this.batch.invoke("drawImage",...lt),this)}ellipse(r,n,o,d,m,R,A,V=false){return this.batch.invoke("ellipse",r,n,o,d,m,R,A,V),this}fill(r,n){let o=[];return r&&o.push(typeof r=="string"?r:(r.commit(this.batch),r.ref)),n&&o.push(n),this.batch.invoke("fill",...o),this}fillRect(r,n,o,d){return this.batch.invoke("fillRect",r,n,o,d),this}fillText(r,n,o,d){return this.batch.invoke("fillText",r,n,o,...d?[d]:[]),this}getImageData(r,n,o,d,m){return this.invokeAndHold("getImageData",r,n,o,d,...m?[m]:[])}getLineDash(){return this.invoke("getLineDash")}async getTransform(){let r=await this.invokeAndHold("getTransform");return r?new L(r):null}async isContextLost(){return await this.invoke("isContextLost")}async isPointInPath(r,n,o,d){let m=[];return typeof r=="number"?(m.push(r,n),o&&m.push(o)):(await r.commit(this.batch),m.push(r.ref,n,o),d&&m.push(d)),await this.invoke("isPointInPath",...m)}async isPointInStroke(r,n,o){var m;let d=[];return typeof r=="number"?d.push(r,n):(await r.commit(),d.push(r.ref,n,o)),(m=await this.invoke("isPointInStroke",...d))!=null?m:false}lineTo(r,n){return this.batch.invoke("lineTo",r,n),this}async measureText(r){var n;return (n=await this.invoke("measureText",r))!=null?n:0}moveTo(r,n){return this.batch.invoke("moveTo",r,n),this}putImageData(r,n,o,d,m,R,A){let V=[r.ref,n,o];return d&&V.push(d),m&&V.push(m),R&&V.push(R),A&&V.push(A),this.batch.invoke("putImageData",...V),this}quadraticCurveTo(r,n,o,d){return this.batch.invoke("quadraticCurveTo",r,n,o,d),this}rect(r,n,o,d){return this.batch.invoke("rect",r,n,o,d),this}reset(){this.invoke("reset");}resetTransform(){this.invoke("resetTransform");}restore(){return this.batch.invoke("restore")}rotate(r){return this.batch.invoke("rotate",r),this}roundRect(r,n,o,d,m){return this.batch.invoke("roundRect",r,n,o,d,m),this}save(){return this.batch.invoke("save")}scale(r,n){return this.batch.invoke("scale",r,n),this}setLineDash(r){return this.invoke("setLineDash",r)}setTransform(r,n,o,d,m,R){typeof r=="number"?this.batch.invoke("setTransform",r,n,o,d,m,R):this.batch.invoke("setTransform",r.ref);}stroke(r){return this.batch.invoke("stroke",...r?[(r.commit(this.batch),r.ref)]:[]),this}strokeRect(r,n,o,d){return this.batch.invoke("strokeRect",r,n,o,d),this}strokeText(r,n,o,d){return this.batch.invoke("strokeText",r,n,o,...d?[d]:[]),this}transform(r,n,o,d,m,R){return this.batch.invoke("transform",r,n,o,d,m,R),this}translate(r,n){return this.batch.invoke("translate",r,n),this}set fillStyle(r){this.setFillStyle(r);}setFillStyle(r){return this.batch.setProperty("fillStyle",typeof r=="string"?r:r instanceof S?r.ref:r),this}set filter(r){this.setFilter(r);}setFilter(r){return this.batch.setProperty("filter",r),this}set font(r){this.setFont(r);}setFont(r){return this.batch.setProperty("font",r),this}set fontKerning(r){this.setFontKerning(r);}setFontKerning(r){return this.batch.setProperty("fontKerning",r),this}set fontStretch(r){this.setFontStretch(r);}setFontStretch(r){return this.batch.setProperty("fontStretch",r),this}set fontVariantCaps(r){this.setFontVariantCaps(r);}setFontVariantCaps(r){return this.batch.setProperty("fontVariantCaps",r),this}set globalAlpha(r){this.setGlobalAlpha(r);}setGlobalAlpha(r){return this.batch.setProperty("globalAlpha",r),this}set globalCompositeOperation(r){this.setGlobalCompositeOperation(r);}setGlobalCompositeOperation(r){return this.batch.setProperty("globalCompositeOperation",r),this}set imageSmoothingEnabled(r){this.setImageSmoothingEnabled(r);}setImageSmoothingEnabled(r){return this.batch.setProperty("imageSmoothingEnabled",r),this}set imageSmoothingQuality(r){this.setImageSmoothingQuality(r);}setImageSmoothingQuality(r){return this.batch.setProperty("imageSmoothingQuality",r),this}set letterSpacing(r){this.setLetterSpacing(r);}setLetterSpacing(r){return this.batch.setProperty("letterSpacing",r),this}set lineCap(r){this.setLineCap(r);}setLineCap(r){return this.batch.setProperty("lineCap",r),this}set lineDashOffset(r){this.setLineDashOffset(r);}setLineDashOffset(r){return this.batch.setProperty("lineDashOffset",r),this}set lineJoin(r){this.setLineJoin(r);}setLineJoin(r){return this.batch.setProperty("lineJoin",r),this}set lineWidth(r){this.setLineWidth(r);}setLineWidth(r){return this.batch.setProperty("lineWidth",r),this}set miterLimit(r){this.setMiterLimit(r);}setMiterLimit(r){return this.batch.setProperty("miterLimit",r),this}set shadowBlur(r){this.setShadowBlur(r);}setShadowBlur(r){return this.batch.setProperty("shadowBlur",r),this}set shadowColor(r){this.setShadowColor(r);}setShadowColor(r){return this.batch.setProperty("shadowColor",r),this}set shadowOffsetX(r){this.setShadowOffsetX(r);}setShadowOffsetX(r){return this.batch.setProperty("shadowOffsetX",r),this}set shadowOffsetY(r){this.setShadowOffsetY(r);}setShadowOffsetY(r){return this.batch.setProperty("shadowOffsetY",r),this}set strokeStyle(r){this.setStrokeStyle(r);}setStrokeStyle(r){return this.batch.setProperty("strokeStyle",typeof r=="string"?r:r instanceof S?r.ref:r),this}set textAlign(r){this.setTextAlign(r);}setTextAlign(r){return this.batch.setProperty("textAlign",r),this}set textBaseline(r){this.setTextBaseline(r);}setTextBaseline(r){return this.batch.setProperty("textBaseline",r),this}set wordSpacing(r){this.setWordSpacing(r);}setWordSpacing(r){return this.batch.setProperty("wordSpacing",r),this}set textRendering(r){this.setTextRendering(r);}setTextRendering(r){return this.batch.setProperty("textRendering",r),this}async commit(){await this.batch.exec();}},f(ut,"Canvas2DContext"),ut);a.Canvas2DContext=C;let x=(et=class extends S{constructor(h){super(h.uid,h.tag);}static async new(h,r){let n=[];h&&n.push(h),r&&n.push(r);let o=await w.newObject("Image",...n);return o?new et(o):null}async width(){var h;return (h=await this.getProperty("width"))!=null?h:0}async height(){var h;return (h=await this.getProperty("height"))!=null?h:0}async naturalWidth(){var h;return (h=await this.getProperty("naturalWidth"))!=null?h:0}async naturalHeight(){var h;return (h=await this.getProperty("naturalHeight"))!=null?h:0}async src(){return await this.getProperty("src")}async currentSrc(){return await this.getProperty("currentSrc")}async setSrc(h){await this.setProperty("src",h);}},f(et,"Image"),et);a.Image=x;let Q=(rt=class extends S{constructor(r){super(r.uid,r.tag);p(this,"batch",new T(this));}static async create(){let r=await w.newObject("Path2D");return r?new rt(r):null}addPath(r){return this.batch.invoke("addPath",r.ref),this}arc(r,n,o,d,m,R=false){return this.batch.invoke("arc",r,n,o,d,m,R),this}arcTo(r,n,o,d,m){return this.batch.invoke("arcTo",r,n,o,d,m),this}bezierCurveTo(r,n,o,d,m,R){return this.batch.invoke("bezierCurveTo",r,n,o,d,m,R),this}quadraticCurveTo(r,n,o,d){return this.batch.invoke("quadraticCurveTo",r,n,o,d),this}closePath(){return this.batch.invoke("closePath"),this}ellipse(r,n,o,d,m,R,A,V=false){return this.batch.invoke("ellipse",r,n,o,d,m,R,A,V),this}moveTo(r,n){return this.batch.invoke("moveTo",r,n),this}lineTo(r,n){return this.batch.invoke("lineTo",r,n),this}rect(r,n,o,d){return this.batch.invoke("rect",r,n,o,d),this}roundRect(r,n,o,d,m){return this.batch.invoke("roundRect",r,n,o,d,m),this}commit(r){return r?(r.accept(this.batch),Promise.resolve()):this.batch.exec()}},f(rt,"CanvasPath2D"),rt);a.CanvasPath2D=Q;let J=(st=class extends E{constructor(h){super(h);}async width(){return this.getProperty("width")}async height(){return this.getProperty("height")}async setWidth(h){this.setProperty("width",h);}async setHeight(h){this.setProperty("height",h);}async getContext(h){let r=await this.invokeAndHold("getContext",h);return r&&new C(r.uid)}static async of(h,r,n){let o=await w.query(h,r);return o?new st(o):null}},f(st,"CanvasElement"),st);a.CanvasElement=J;})(U||(U={}));var Qe={after:"insertAfter",invoke:"invokeObjectMethod",release:"releaseNode",remove:"removeNode",replaceWith:"replaceNode",setHTML:"setInnerHTML",setProperty:"setObjectProperty"};function Ie(a){if(typeof a!="string")return null;let t=a.trim();return !t||t.length>2048||!t.startsWith("/")||t.startsWith("//")||/^[a-z][a-z0-9+.-]*:/i.test(t)||/[\u0000-\u001f\u007f]/.test(t)?null:t}f(Ie,"normalizeLaunchRoute");function Ze(a){let t=a&&typeof a=="object"?a:{},e=t.params&&typeof t.params=="object"&&!Array.isArray(t.params)?t.params:{};return {initialRoute:Ie(t.initialRoute),params:e}}f(Ze,"normalizeLaunchOptions");function Zt(a){if(typeof a=="number")return {duration:a};let s=a,{timingFunction:t}=s,e=be(s,["timingFunction"]);return t?ve(G({},e),{easing:t}):e}f(Zt,"normalizeAnimationTiming");function $(a,t=""){return typeof a=="number"?`${a}${t}`:a}f($,"formatValue");function Y(a){return $(a,"px")}f(Y,"formatLength");function q(a){return $(a,"deg")}f(q,"formatAngle");function P(a){return $(a)}f(P,"formatUnitless");function Nt(a,t){var e;return Array.isArray(a)?{x:$(a[0],t),y:$(a[1],t)}:typeof a=="object"?{x:$(a.x,t),y:$((e=a.y)!=null?e:0,t)}:{x:$(a,t),y:$(0,t)}}f(Nt,"formatVector2");function xe(a,t){var e,s;return Array.isArray(a)?{x:$(a[0],t),y:$(a[1],t),z:$(a[2],t)}:typeof a=="object"?{x:$(a.x,t),y:$((e=a.y)!=null?e:0,t),z:$((s=a.z)!=null?s:0,t)}:{x:$(a,t),y:$(0,t),z:$(0,t)}}f(xe,"formatVector3");function Ae(a){var t,e;return Array.isArray(a)?{x:P(a[0]),y:P(a[1]),z:P(a[2])}:typeof a=="object"?{x:P(a.x),y:P((t=a.y)!=null?t:1),z:P((e=a.z)!=null?e:1)}:{x:P(a),y:P(a),z:P(a)}}f(Ae,"formatScaleVector3");function tr(a){let t={},e={},s=[],i=[],c=[],u=[];for(let l of a)l.group==="transform"?(s.push(l.from),i.push(l.to)):l.group==="filter"?(c.push(l.from),u.push(l.to)):(t[l.property]=l.from,e[l.property]=l.to);return s.length&&(t.transform=s.join(" "),e.transform=i.join(" ")),c.length&&(t.filter=c.join(" "),e.filter=u.join(" ")),[t,e]}f(tr,"composeAnimationFragments");var er=`
7
+ :root {
8
+ color-scheme: light;
9
+ --oui-bg: #ffffff;
10
+ --oui-surface: #f7f7f8;
11
+ --oui-text: #111111;
12
+ --oui-muted: #666666;
13
+ --oui-border: #dddddd;
14
+ --oui-primary: #fe9800;
15
+ }
16
+ :root[data-oui-theme="dark"] {
17
+ color-scheme: dark;
18
+ --oui-bg: #101114;
19
+ --oui-surface: #1a1c20;
20
+ --oui-text: #f5f5f5;
21
+ --oui-muted: #a6a6a6;
22
+ --oui-border: #30343a;
23
+ --oui-primary: #ffae3d;
24
+ }
25
+ body {
26
+ background: var(--oui-bg);
27
+ color: var(--oui-text);
28
+ }
29
+ `;function rr(a){var t;return a.startsWith("_ouid_")?a:`_ouid_${(t=Qe[a])!=null?t:a}`}f(rr,"normalizeBridgeCallName");function sr(a){return a.startsWith("_ouid_")?a:`_ouid_${a}`}f(sr,"normalizeNativeCallName");function te(a){return a==="light"||a==="dark"||a==="system"?a:"system"}f(te,"normalizeThemeMode");function Oe(a){return a==="dark"?"dark":"light"}f(Oe,"normalizeResolvedThemeMode");function pt(){var a,t;try{return (t=(a=globalThis.matchMedia)==null?void 0:a.call(globalThis,"(prefers-color-scheme: dark)"))!=null&&t.matches?"dark":"light"}catch(e){return "light"}}f(pt,"browserSystemMode");function ir(){var T,S;let a=globalThis.window,t=globalThis.navigator,e=globalThis.document,s=Number((a==null?void 0:a.devicePixelRatio)||1),i=a==null?void 0:a.screen,c=Number((a==null?void 0:a.innerWidth)||(i==null?void 0:i.width)||0),u=Number((a==null?void 0:a.innerHeight)||(i==null?void 0:i.height)||0),l=Number.parseFloat(e!=null&&e.documentElement?(S=(T=a==null?void 0:a.getComputedStyle)==null?void 0:T.call(a,e.documentElement))==null?void 0:S.fontSize:"")||16,y=Math.round(c*s),g=Math.round(u*s),b=pt();return {brand:"unknown",model:(t==null?void 0:t.platform)||"browser",pixelRatio:s,screenWidth:Math.round(Number((i==null?void 0:i.width)||c)*s),screenHeight:Math.round(Number((i==null?void 0:i.height)||u)*s),windowWidth:y,windowHeight:g,statusBarHeight:0,language:(t==null?void 0:t.language)||"unknown",version:(t==null?void 0:t.appVersion)||"",system:(t==null?void 0:t.userAgent)||"browser",platform:"web",fontSize:Math.round(l*s),safeArea:{left:0,right:y,top:0,bottom:g,width:y,height:g},theme:b,abi:"unknown",deviceAbi:[],cpuType:t!=null&&t.hardwareConcurrency?`${t.hardwareConcurrency}-core`:"unknown",memorySize:Number((t==null?void 0:t.deviceMemory)||0)*1024*1024*1024,benchmarkLevel:0}}f(ir,"browserSystemInfo");function nr(){let a=globalThis.document,t=(a==null?void 0:a.visibilityState)==="hidden";return {state:t?"background":"active",timestamp:Date.now(),focused:!t,visibility:t?"hidden":"visible"}}f(nr,"browserAppState");function Pe(){try{return typeof WebOUID!="undefined"&&!!WebOUID}catch(a){return false}}f(Pe,"hasNativeBridge");var ae=class ae{constructor(){p(this,"state",{mode:"system",resolvedMode:pt(),systemMode:pt()});p(this,"handlers",new Set);p(this,"initialized",false);p(this,"cssInstalled",false);p(this,"hostUnsubscribe");}get mode(){return this.state.mode}get resolvedMode(){return this.state.resolvedMode}get systemMode(){return this.state.systemMode}get isDark(){return this.state.resolvedMode==="dark"}async install(t){let e=t!=null?t:this.state.mode;return this.initialized&&this.state.mode===e?(await this.apply(),this.read()):(this.initialized=true,this.state.mode=e,await this.installCss(),await this.refresh(e),await this.subscribeHostChanges(),this.read())}read(){return G({},this.state)}async refresh(t=this.state.mode){let e=await w.call("theme","read");if(e)this.update(e);else {let s=pt(),i=te(t);this.update({mode:i,systemMode:s,resolvedMode:i==="system"?s:i});}return this.read()}async setMode(t){let e=te(t),s=await w.call("theme","setMode",e);if(s)this.update(s);else {let i=pt();this.update({mode:e,systemMode:i,resolvedMode:e==="system"?i:e});}return this.read()}onChange(t){return this.handlers.add(t),t(this.read()),()=>{this.handlers.delete(t);}}async installCss(){this.cssInstalled||(this.cssInstalled=true,await w.createComponentStyles(er));}async subscribeHostChanges(){var t;if(!this.hostUnsubscribe)try{this.hostUnsubscribe=await w.onHostEvent("themechange",e=>{this.update(e);});}catch(e){if(typeof globalThis.matchMedia=="function"){let s=globalThis.matchMedia("(prefers-color-scheme: dark)"),i=f(()=>{if(this.state.mode!=="system")return;let c=pt();this.update({mode:"system",systemMode:c,resolvedMode:c});},"listener");(t=s.addEventListener)==null||t.call(s,"change",i);}}}update(t){var u,l,y;let e=te((u=t.mode)!=null?u:this.state.mode),s=Oe((l=t.systemMode)!=null?l:this.state.systemMode),i=Oe((y=t.resolvedMode)!=null?y:e==="system"?s:e),c=this.state.mode!==e||this.state.systemMode!==s||this.state.resolvedMode!==i;if(this.state={mode:e,systemMode:s,resolvedMode:i},this.apply(),c){let g=this.read();this.handlers.forEach(b=>b(g));}}async apply(){let t=this.state.resolvedMode,e=globalThis.document;if(e!=null&&e.documentElement){e.documentElement.setAttribute("data-oui-theme",t),e.documentElement.style.colorScheme=t;return}try{let s=await w.query("html");await(s==null?void 0:s.setAttribute("data-oui-theme",t)),await(s==null?void 0:s.setStyle("colorScheme",t));}catch(s){}}};f(ae,"OUIDThemeController");var ee=ae,oe=class oe{constructor(){p(this,"backButtonHandlers",new Map);globalThis.__ouid_handle_back_button__=()=>this.handleBackButton();}async exit(t={}){var e;return w.call("app","exit",{reason:t.reason,result:(e=t.result)!=null?e:{}})}async openMiniApp(t){var s,i,c;let e=(s=t.appId)==null?void 0:s.trim();if(!e)throw new Error("OUID.app.openMiniApp requires appId");return w.call("app","openMiniApp",{appId:e,route:Ie((i=t.route)!=null?i:t.initialRoute),params:t.params&&typeof t.params=="object"&&!Array.isArray(t.params)?t.params:{},mode:(c=t.mode)!=null?c:"push"})}async canOpenMiniApp(t){let e=t.trim();if(!e)return false;let s=await w.call("app","canOpenMiniApp",{appId:e});return (s==null?void 0:s.canOpen)===true||(s==null?void 0:s.data)===true}onBackButton(t){let e=Z("app:back");return this.backButtonHandlers.set(e,t),()=>{this.backButtonHandlers.delete(e);}}handleBackButton(){let t=Array.from(this.backButtonHandlers.values()).reverse();for(let e of t)try{if(e()===!0)return !0}catch(s){console.error("Error in OUID.app.onBackButton handler",s);}return false}};f(oe,"OUIDAppController");var re=oe,ce=class ce{async getInfo(){return Pe()?await w.call("system","getInfo"):ir()}async getAppState(){return Pe()?await w.call("system","getAppState"):nr()}async onAppStateChange(t){return w.onHostEvent("appstatechange",t)}async onForeground(t){return w.onHostEvent("appforeground",t)}async onBackground(t){return w.onHostEvent("appbackground",t)}async onInactive(t){return w.onHostEvent("appinactive",t)}};f(ce,"OUIDSystemController");var se=ce,ue=class ue{constructor(t){p(this,"bridge");this.bridge=t;}async native(t,...e){let s=await this.bridge.invoke("_ouid_permissions",t,...e);return s==null?void 0:s.data}async query(t){return t?this.native("query",t):this.native("query")}async request(t){return this.native("request",t)}async requestMany(t){return this.native("requestMany",t!=null?t:[])}async openSettings(){return this.native("openSettings")}async openAbout(){return this.native("openAbout")}};f(ue,"OUIDPermissionController");var ie=ue,le=class le{constructor(){p(this,"callbacks",new Map);p(this,"DOM_EVENT_LISTENERS",new Map);p(this,"HOST_EVENT_LISTENERS",new Map);p(this,"timers",new Map);p(this,"listeners",new Map);p(this,"app",new re);p(this,"system",new se);p(this,"theme",new ee);p(this,"permissions",new ie(this));this.subscribe("__ouid_native_event_success__",(t,e)=>{let s=this.callbacks.get(t);if(s){this.callbacks.delete(t);let i=JSON.parse(e);return s.success(...Array.isArray(i)?i:[i])}}),this.subscribe("__ouid_native_event_error__",(t,e)=>{let s=this.callbacks.get(t);if(s){this.callbacks.delete(t);let i=JSON.parse(e);return s.error(...Array.isArray(i)?i:[i])}}),this.subscribe("__ouid_web_event__",(t,e)=>{let s=this.DOM_EVENT_LISTENERS.get(t),i=JSON.parse(e);if(s){let c=i[1];return c&&typeof c=="object"&&(c.target=c!=null&&c.target?new U.OElement(c.target):null,c.currentTarget=c!=null&&c.currentTarget?new U.OElement(c.currentTarget):null,c.relatedTarget=c!=null&&c.relatedTarget?new U.OElement(c.relatedTarget):null),s(c)}else console.error("No cb found for ",t,i[0]);}),this.subscribe("__ouid_host_event__",(t,e)=>{let s=this.parseHostEvent(t,e);this.HOST_EVENT_LISTENERS.forEach(i=>{if(i.event===s.type)try{i.callback(s.data,s);}catch(c){console.error(`Error in host event listener for '${s.type}'`,c);}});});}config(){return this.theme.install(),this}launch(){return Ze(globalThis.__OUID_LAUNCH__)}invoke(t,...e){let s=Z(t);return new Promise((i,c)=>{this.callbacks.set(s,{success:i,error:c});try{if(!WebOUID)throw new Error("NativeOUID bridge not available");WebOUID.invoke(s,t,JSON.stringify(e));}catch(u){console.error(u),this.callbacks.delete(s),c(u);}})}registerComponent(t,e){it.register(t,e);}unregisterComponent(t,e){it.unregister(t);}async call(t,...e){try{return (await this.invoke(`_ouid_${t}`,...e)).data}catch(s){return console.error(s),null}}async callMany(t,e={}){var i,c;if(t.length===0)return {};let s=t.map(u=>({id:u.id,fn:rr(u.fn),args:u.args}));return (c=await this.call("callMany",s,(i=e.mode)!=null?i:"serial"))!=null?c:{}}async readMany(t){return this.callMany(t,{mode:"parallel"})}async callNativeMany(t){var s;if(t.length===0)return {};let e=t.map(i=>({id:i.id,fn:sr(i.fn),args:i.args}));return (s=await this.call("callNativeMany",e))!=null?s:{}}emit(t,e){WebOUID==null||WebOUID.invoke("event",t,JSON.stringify(e));}subscribe(t,e){this.listeners.has(t)||(this.listeners.set(t,[]),globalThis[t]=(s,i)=>{var c;(c=this.listeners.get(t))==null||c.forEach(u=>u(s,i));}),this.listeners.get(t).push(e);}parseHostEvent(t,e){var i;let s={type:t,data:e,timestamp:Date.now()};try{let c=JSON.parse(e),u=Array.isArray(c)?c[0]:c;return u&&typeof u=="object"?{type:String((i=u.type)!=null?i:t),data:u.data,timestamp:typeof u.timestamp=="number"?u.timestamp:Date.now(),source:typeof u.source=="string"?u.source:void 0}:{type:t,data:u,timestamp:Date.now()}}catch(c){return s}}async addHostEventListener(t,e){let s=t.trim();if(!s)throw new Error("Host event name cannot be empty");let i=Z(`host:${s}`);if(this.HOST_EVENT_LISTENERS.set(i,{event:s,callback:e}),await this.call("addHostEventListener",i,s)==null)throw this.HOST_EVENT_LISTENERS.delete(i),new Error(`Unable to attach host event listener for '${s}'`);return i}async removeHostEventListener(t){this.HOST_EVENT_LISTENERS.delete(t),await this.call("removeHostEventListener",t);}async onHostEvent(t,e){let s=await this.addHostEventListener(t,e);return async()=>{await this.removeHostEventListener(s);}}async query(t,e,s){let i=await this.call("query",t,e,s);return i?new U.OElement(i):null}async queryAll(t,e,s){let i=await this.call("queryAll",t,e,s);return i?i.map(c=>new U.OElement(c)):[]}async createElement(t,e={}){let s=await this.call("createElement",t,e);return s?new U.OElement(s):null}async createComment(t){let e=await this.call("createComment",t);return e?new U.OElement(e):null}async addEventListener(t,e,s,i){let c=Z(e+(typeof t=="string"?t:t.tag));return this.DOM_EVENT_LISTENERS.set(c,s),await w.call("attachEventListener",typeof t=="string"?t:t.uid,c,e,i==null?void 0:i.options,i==null?void 0:i.policy),c}async dettachEventListener(t){this.DOM_EVENT_LISTENERS.delete(t),await w.call("dettachEventListener",t);}async createComponentStyles(t,e=true){let s=await w.call("createComponentStyles",t,e);return s?new U.OElement(s):null}async appendComponentStyles(t){await w.call("appendComponentStyles",t);}async rejectComponentStyles(t){await w.call("rejectComponentStyles",t.uid);}async loadFont(t,e,s={}){return typeof t=="string"?await w.call("loadFont",t,e,s):await w.call("loadFont",t)}async unloadFont(t,e){let s=typeof t=="string"?t:t.uid||t.family;return await w.call("unloadFont",s,e)}async createAnimation(t,e,s){let i=typeof t=="string"?t:t.uid,c=await w.call("createAnimation",i,e,s);return c?new U.OAnimation(c):null}async getOObject(t){let e=await w.call("getOObject",t);return e?new U.OObject(e.uid,e.tag):null}async acquireObject(t){let e=await w.call("acquireObject",t);return e?new U.OObject(e.uid,e.tag):null}async setTimeout(t,e){var c;let s=Z("setTimeout"+e);this.DOM_EVENT_LISTENERS.set(s,()=>{t();let u=this.timers.get(i);u&&(this.timers.delete(i),this.DOM_EVENT_LISTENERS.delete(u));});let i=(c=await w.call("setTimeout",s,e))!=null?c:-1;return i>=0&&this.timers.set(i,s),i}async clearTimeout(t){let e=this.timers.get(t);e&&(this.timers.delete(t),this.DOM_EVENT_LISTENERS.delete(e),await w.call("clearTimeout",t));}async setInterval(t,e){var c;let s=Z("setInterval"+e);this.DOM_EVENT_LISTENERS.set(s,t);let i=(c=await w.call("setInterval",s,e))!=null?c:-1;return i>=0&&this.timers.set(i,s),i}async clearInterval(t){let e=this.timers.get(t);e&&(this.timers.delete(t),this.DOM_EVENT_LISTENERS.delete(e),await w.call("clearInterval",t));}async fetch(t,e,s="json"){let i=await w.call("fetch",t,e,s);return s==="buffer"||s==="bytes"?U.OObject.toInstance(i):i}async alert(t){console.log("Alerting:::",t),await w.call("alert",t);}async prompt(t){await w.call("prompt",t);}async openAbout(){return this.permissions.openAbout()}async openSettings(){return this.permissions.openSettings()}async newObject(t,...e){return w.call("newObject",t,...e)}async requestAnimationFrame(t){var i;let e=Z("requestAnimationFrame");this.DOM_EVENT_LISTENERS.set(e,c=>{t(c);let u=this.timers.get(s);u&&(this.DOM_EVENT_LISTENERS.delete(u),this.timers.delete(s));});let s=(i=await w.call("requestAnimationFrame",e))!=null?i:-1;return s>=0&&this.timers.set(s,e),s}async cancelAnimationFrame(t){let e=this.timers.get(t);e&&(this.timers.delete(t),await w.call("cancelAnimationFrame",t),this.DOM_EVENT_LISTENERS.delete(e));}async batchActions(t){await w.call("batchActions",t);}nextTick(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t);}async readFile(t){return new Promise(async(e,s)=>{let i=await t.getPropertyAndHold("0");if(!i)return null;let c=await w.newObject("FileReader");if(!c)return null;let u=U.OObject.toInstance(c);await u.invoke("readAsDataURL",i.ref),await i.release(),u.addEventListener("load",async()=>{e(await u.getProperty("result"));}),u.addEventListener("error",async()=>{s("Error reading file");});})}};f(le,"OUIDBridge");var ne=le,w=new Proxy(new ne,{get:f((a,t)=>t in a?a[t]:async(...e)=>await a.call(t,...e),"get")});globalThis.OUID=w;var U;function ar(a){return a.replace(/-([a-z])/g,(t,e)=>e.toUpperCase())}f(ar,"toCamelCase");function or(a){return a.replace(/(?!^)([A-Z])/g,(t,e)=>`-${e.toLowerCase()}`)}f(or,"toSnakeCase");function B(a){return Wt(a)?a.value:a}f(B,"normaliseValue");function cr(a){return typeof a=="function"&&!("prototype"in a)}f(cr,"isLazyLoader");var _e=new Map,Ne=new Map,Me=new WeakMap,Mt=new Set(["__proto__","prototype","constructor","this","new","class","function","import","Object","Reflect","Proxy","process","require","globalThis","window","document","eval","Function","AsyncFunction","GeneratorFunction","WebOUID","NativeOUID","OUID","fetch","XMLHttpRequest","localStorage","sessionStorage","setTimeout","setInterval","clearTimeout","clearInterval","requestAnimationFrame","cancelAnimationFrame"]);function ur(a){return /[A-Za-z_$]/.test(a)}f(ur,"isIdentifierStart");function lr(a){return /[\w$]/.test(a)}f(lr,"isIdentifierPart");function hr(a){if(Mt.has(a))throw new Error("[OUID] Unsafe template expression blocked")}f(hr,"assertSafeToken");function dr(a,t){let e=a[t];if(e==="`")throw new Error("[OUID] Template literals are not allowed in template expressions");let s="",i=t+1;for(;i<a.length;){let c=a[i++];if(c===e)return {token:{type:"string",value:s},end:i};if(c!=="\\"){s+=c;continue}if(i>=a.length)break;let u=a[i++];switch(u){case "n":s+=`
30
+ `;break;case "r":s+="\r";break;case "t":s+=" ";break;case "b":s+="\b";break;case "f":s+="\f";break;case "v":s+="\v";break;case "0":s+="\0";break;case "x":{let l=a.slice(i,i+2);if(!/^[0-9a-fA-F]{2}$/.test(l))throw new Error("[OUID] Invalid string escape");s+=String.fromCharCode(parseInt(l,16)),i+=2;break}case "u":{if(a[i]==="{"){let l=a.indexOf("}",i+1);if(l<0)throw new Error("[OUID] Invalid string escape");let y=parseInt(a.slice(i+1,l),16);if(!Number.isFinite(y))throw new Error("[OUID] Invalid string escape");s+=String.fromCodePoint(y),i=l+1;}else {let l=a.slice(i,i+4);if(!/^[0-9a-fA-F]{4}$/.test(l))throw new Error("[OUID] Invalid string escape");s+=String.fromCharCode(parseInt(l,16)),i+=4;}break}default:s+=u;}}throw new Error("[OUID] Unterminated string literal")}f(dr,"readStringLiteral");function fr(a){let t=[],e=0;for(;e<a.length;){let s=a[e];if(/\s/.test(s)){e++;continue}if(s==="\\"||s==="`")throw new Error("[OUID] Unsafe template expression blocked");if(s==="'"||s==='"'){let{token:i,end:c}=dr(a,e);t.push(i),e=c;continue}if(ur(s)){let i=e++;for(;e<a.length&&lr(a[e]);)e++;t.push({type:"identifier",value:a.slice(i,e)});continue}if(/\d/.test(s)){let i=e++;for(;e<a.length&&/[\w.]/.test(a[e]);)e++;t.push({type:"number",value:a.slice(i,e)});continue}t.push({type:"punctuator",value:s}),e++;}return t}f(fr,"tokenizeExpression");function pr(a,t){let e=a[t-1];return e?e.type==="identifier"||e.type==="string"||e.type==="number"||e.value===")"||e.value==="]"||e.value===".":false}f(pr,"isMemberBracket");function mr(a){for(let t=0;t<a.length;t++){if(a[t].value!=="["||!pr(a,t))continue;let e=1,s=t+1;for(;s<a.length;s++)if(a[s].value==="[")e++;else if(a[s].value==="]"&&(e--,e===0))break;if(e!==0)throw new Error("[OUID] Invalid member expression");let i=a.slice(t+1,s);if(!(i.length===1&&(i[0].type==="identifier"||i[0].type==="string"||i[0].type==="number")))throw new Error("[OUID] Complex member expressions are not allowed");t=s;}}f(mr,"validateMemberBrackets");function yr(a){let t=fr(a);for(let e of t)(e.type==="identifier"||e.type==="string")&&hr(e.value);mr(t);}f(yr,"assertSafeExpression");function wr(a){if(!a||typeof a!="object"&&typeof a!="function")return {};let t=Me.get(a);if(t)return t;let e=Object.create(null);for(let s=a;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let i of Object.getOwnPropertyNames(s)){if(i==="constructor"||i.startsWith("__")||i.endsWith("__")||i in e)continue;let c=Object.getOwnPropertyDescriptor(s,i);c&&(typeof c.value=="function"?e[i]=c.value.bind(a):c.get&&Object.defineProperty(e,i,{get:f(()=>c.get.call(a),"get"),enumerable:true}));}return Me.set(a,e),e}f(wr,"getMethodsView");function Ue(a,t){let e=_e.get(a);return e||(yr(a),e=new Function("s","with (s) { return ("+a+"); }"),_e.set(a,e)),e(t)}f(Ue,"evalInScope");function gr(a){let t=Ne.get(a);if(t)return t;let e=[],s=0;for(;s<a.length;){let i=a.indexOf("{{",s);if(i<0){e.push({t:a.slice(s)});break}i>s&&e.push({t:a.slice(s,i)});let c=a.indexOf("}}",i+2),u=c>=0?a.slice(i+2,c).trim():a.slice(i+2).trim();e.push({e:u}),s=c>=0?c+2:a.length;}return t=f(i=>{let c="";for(let u of e)if(u.t!==void 0)c+=u.t;else if(u.e!==void 0){let l=B(Ue(u.e,i));c+=l==null?"":String(l);}return c},"fn"),Ne.set(a,t),t}f(gr,"compileInterpolated");var Le,H=class H{constructor(t,e,s,...i){p(this,"app");p(this,"component");p(this,"parentContext");p(this,"bindings",[]);p(this,"directives",[]);p(this,"mountedComponents",(Le=Lt(H.MOUNTED_COMPONENTS_TOKEN))!=null?Le:new Map);p(this,"componentsRegistry",new mt);p(this,"updatingDirectives",false);p(this,"updatingBindings",false);p(this,"_stack",[]);p(this,"flatStack",Object.create(null));p(this,"viewUpdates");p(this,"mountedQueue",[]);this.app=t,this.component=e,this.parentContext=s;for(let c of i)this.push(c);}get hostElement(){return this.component._hostElement}get stack(){return this._stack}set stack(t){this.flatStack=Object.create(null),this._stack=[];for(let e of t)this.push(e);}getRoot(){let t=this;for(;t.parentContext;)t=t.parentContext;return t}enqueueMounted(t){this.getRoot().mountedQueue.push(t);}async flushMounted(){let t=this.getRoot(),e=t.mountedQueue;t.mountedQueue=[];for(let s of e)try{s();}catch(i){console.error("onMounted error:",i);}}getMountedComponent(t){return this.mountedComponents.get(t.uid)}bind(t){this.bindings.push(t);}directive(t){this.directives.push(t);}evaluateExpression(t){return this.resolve(t)}resolveScope(...t){var i;let e=(i=this.component)!=null?i:{},s=wr(e);return new Proxy(Object.create(null),{get:f((c,u)=>{if(typeof u=="string"&&!Mt.has(u)){for(let l=t.length-1;l>=0;l--)if(u in t[l])return B(t[l][u]);return u in this.flatStack?B(this.flatStack[u]):u in s?B(s[u]):B(e[u])}},"get"),set:f((c,u,l)=>{if(typeof u!="string"||Mt.has(u))return false;let y;for(let g=t.length-1;g>=0;g--)if(u in t[g]){y=t[g][u];break}return y===void 0&&(u in this.flatStack?y=this.flatStack[u]:u in s?y=s[u]:y=e[u]),y!==void 0&&Wt(y)?(y.value=l,true):false},"set"),has:f((c,u)=>typeof u!="string"?false:Mt.has(u)?true:t.some(l=>u in l)||u in this.flatStack||u in s||u in e,"has")})}resolve(t,...e){if(!t)return;let s=this.resolveScope(...e);try{return Ue(t,s)}catch(i){return}}updateValue(t,e){this.resolve(`${t}=__o_model_value__`,{__o_model_value__:e});}push(t){this._stack.unshift(t),Object.assign(this.flatStack,t);}pop(){let t=this._stack.shift();if(t)for(let e of Object.keys(t))delete this.flatStack[e];}resolveTag(t){var s;let e=this;for(;;){if(e.componentsRegistry.has(t))return e.componentsRegistry.get(t);if(e=(s=e==null?void 0:e.parentContext)!=null?s:null,!e)break}return it.get(t)}async updateBindings(){if(!this.updatingBindings){this.updatingBindings=true;try{for(let t of this.bindings)await this.updateBinding(t);}finally{this.updatingBindings=false;}}}async updateBinding(t){var e;if(t.type==="model"){let s=(e=B(t.context.resolve(t.key)))!=null?e:"";Object.is(t.modelValue,s)||(t.modelValue=s,await t.node.setProperty("value",s));return}if(t.type==="interpolation"){let s=t.templateFn(t.context.resolveScope());this.viewUpdates.add("setContentText",t.node,s);return}if(t.type==="attribute"){let s=t.key,i=B(this.resolve(t.template));s==="class"?this.expandClass(t.node,i):s==="style"?this.expandStyle(t.node,i):typeof i!="object"&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="undefined"&&this.viewUpdates.add("setAttribute",t.node,s,i.toString());return}if(t.type==="prop"&&t.context.component){let s=B(this.resolve(t.template));try{t.context.component.props[t.key]=s,Promise.all([t.context.updateBindings(),t.context.updateDirectives()]).then(()=>{t.context.viewUpdates.exec();});}catch(i){console.error(i);}return}}async updateDirectives(){var s,i,c;if(this.updatingDirectives)return;let t=new U.BatchActions,e=true;this.updatingDirectives=true;try{for(let u of this.directives){if(u.type==="if"){if(!B(u.context.evaluateExpression(u.expr))){if(u.active===!1)continue;u.active=!1,u.renderedNode&&(u.destroy?(await this.unmountComponent(u.renderedNode),u.renderedNode=void 0):this.viewUpdates.add("addClass",u.renderedNode,"oui-hidden"));continue}if(u.active===!0)continue;u.active=!0;let y=u.renderedNode;if(!y||u.destroy){let g=await u.node.cloneNode(!0);u.renderedNode=g,await u.context.render(g),this.viewUpdates.add("after",u.placeholder,g);}else this.viewUpdates.add("removeClass",y,"oui-hidden");}if(u.type==="for"){let l=(s=u.children)!=null?s:new Map,y=new Map,g=f((C,x)=>u.key?B(u.context.resolve(u.key,{[u.item]:C})):x,"keyFn"),b=B(u.context.resolve(u.list))||[],T=l.size>0?await u.placeholder.parentNode():null,S=T?await T.childNodes():[],M=new Map;for(let C=0;C<S.length;C++)M.set(S[C].uid,S[C+1]);let E=new U.BatchActions,O=32,I=0,L=u.placeholder;for(let C=0;C<b.length;C++){let x=b[C],Q=g(x,C),J=l.get(Q),F,v,k,N=L;if(J){F=J.node,v=J.ctx,k=J.stop,v.stack=[{[u.item]:x},...u.context.stack];let _=M.get(L.uid);F.uid!==(_==null?void 0:_.uid)&&E.add(()=>N.after(F)),(i=v.__renderRunner__)==null||i.call(v),await Promise.all([v.updateBindings(),v.updateDirectives()]);}else {if(v=new H(this.app,this.component,this),v.viewUpdates=this.viewUpdates,v.stack=[{[u.item]:x},...u.context.stack],F=await u.node.cloneNode(!0),E.add(async()=>{await N.after(F);}),await v.render(F,{deferUpdates:!0}),await Promise.all([v.updateBindings(),v.updateDirectives()]),!v.__renderRunner__){let z=vt(()=>{v.collectDepsForBindingsAndDirectives();},{lazy:!0,scheduler:f(()=>{v.scheduleReactiveFlush();},"scheduler")});v.__renderRunner__=z,z(),k=f(()=>z.effect.stop(),"stop");}v.__renderRunner__();}L=F,y.set(Q,{node:F,ctx:v,stop:k}),++I>=O&&(I=0,await E.commit(),await tt());}let j=[];for(let[C,x]of l.entries())y.has(C)||((c=x.stop)==null||c.call(x),j.push(this.unmountComponent(x.node)));await Promise.all(j),await E.commit(),u.children=y;}}e&&await t.commit();}finally{this.updatingDirectives=false;}}async render(t,e){if(!t.hydrated&&!(e!=null&&e.skipSlotted&&t.hasAttribute("slotted"))){switch(t.type){case "Text":this.handleTextNode(t);break;case "Element":await this.handleElementNode(t,e);break;}e!=null&&e.deferUpdates||await Promise.all([this.updateBindings(),this.updateDirectives()]),this.viewUpdates.add("addClass",t,"hydrated");}}async expandClass(t,e){let s=[],i=[];e==null||e===false?s=[]:typeof e=="object"?Array.isArray(e)?s=e.filter(Boolean).map(String):(s=Object.keys(e).filter(c=>e[c]),i=Object.keys(e).filter(c=>!e[c])):s=e.toString().split(/\s+/).filter(Boolean),s.length>0&&this.viewUpdates.add("addClass",t,...s),i.length>0&&this.viewUpdates.add("removeClass",t,...i);}expandStyle(t,e){let s=e;typeof e=="object"&&!Array.isArray(e)&&(s=Object.keys(e).filter(i=>e[i]).map(i=>`${or(i)}: ${e[i]}`).join(";")),s&&this.viewUpdates.add("setAttribute",t,"style",s);}expandStandardAttributes(t){[...t.attributes].filter(e=>e.name.startsWith(":")).forEach(e=>{let s=e.name.substring(1);this.bind({type:"attribute",node:t,key:s,context:this,template:e.value.trim()}),this.viewUpdates.add("removeAttribute",t,e.name);});}setRefValue(t,e){let s=t.trim();this.updateValue(s,e);}async handleElementNode(t,e){var M;let s=null,i=t.hasAttribute("o-if")?"o-if":t.hasAttribute("o-show")?"o-show":null;if(i){let E=await t.parentNode(),O=await t.getAttribute(i),I=await OUID.createComment(i+":"+O),L=i==="o-if";await E.insertBefore(t,I),await t.updates().removeAttribute(i).remove().exec(),this.directive({type:"if",expr:O,node:t,placeholder:I,context:this,active:void 0,destroy:L}),s="if";return}if(t.hasAttribute("o-for")){if(s==="if")throw new Error("Can't have o-if and o-for on the same component");let E=await t.parentNode(),O=await t.getAttribute("o-for"),[I,L]=O.split(" of ").map(x=>x.trim()),j=await OUID.createComment("for:"+O),C=(M=t.attribute(":key"))!=null?M:"";await(E==null?void 0:E.insertBefore(t,j)),await t.updates().removeAttribute("o-for").removeAttribute(":key").remove().exec(),this.directive({type:"for",item:I,list:L,node:t,placeholder:j,context:this,key:C}),s="for";return}let c=t.tag.toLowerCase(),u=this.resolveTag(c),l=t.updates();[...t.attributes].forEach(async E=>{if(E.name==="o-model"){let O=E.value.trim(),I="input",L=B(this.resolve(O)),j={node:t,key:O,type:"model",context:this,modelValue:L};l.setInputValue(L).addEventListener(I,async C=>{let x=typeof(C==null?void 0:C.value)!="undefined"?C.value:await C.target.getProperty("value");j.modelValue=x,this.updateValue(O,x);}),this.bind(j),l.removeAttribute(E.name);}else E.name==="ref"&&(u||this.setRefValue(E.value,t));});let y={},g={},{props:b,events:T}=this.componentAttributes(t,this);if(y=b,g=T,this.expandStandardAttributes(t),Object.keys(g).forEach(async E=>{let O=g[E];u||l.addEventListener(E,I=>{typeof O=="function"&&O.apply(this.component,[I]);}),l.removeAttribute("@"+E);}),this.viewUpdates.accept(l),u){await this.mountComponent(t,u,this,y,g);return}let S=t.children?t.children.map(E=>new U.OElement(E)):await t.childNodes();e!=null&&e.skipSlotted&&(S=S.filter(E=>!E.hasAttribute("slotted")));for(let E of S)await this.render(E,e);}handleTextNode(t){var s;let e=(s=t.textContent)!=null?s:"";e.includes("{{")&&this.bind({type:"interpolation",node:t,key:"__template__",templateFn:gr(e),context:this});}collectDepsForBindingsAndDirectives(){for(let t of this.bindings)t.type==="model"?B(this.resolve(t.key)):t.type==="interpolation"?t.templateFn(this.resolveScope()):t.type==="attribute"?B(this.resolve(t.template)):t.type==="prop"&&B(this.resolve(t.template));for(let t of this.directives)if(t.type==="if")B(t.context.evaluateExpression(t.expr));else if(t.type==="for"){let e=B(t.context.resolve(t.list));Array.isArray(e)&&e[wt];}}scheduleReactiveFlush(){tt(()=>{this.flushReactiveUpdate();});}async flushReactiveUpdate(){var e;let t=this;if(t.__updating){t.__pendingUpdate=true;return}do{t.__pendingUpdate=false,(e=t.__renderRunner__)==null||e.call(t),t.__updating=true;try{await Promise.all([this.updateBindings(),this.updateDirectives()]),await this.viewUpdates.exec(),await this.flushMounted();}finally{t.__updating=false;}}while(t.__pendingUpdate)}componentAttributes(t,e){let s={},i={},c=["import","interface","module","o-model","o-if","o-for"];return [...t.attributes].filter(u=>!c.includes(u.name)).forEach(u=>{let l=u.name;if(l.startsWith("@")){let b=e==null?void 0:e.resolve(u.value);if(typeof b!="function")throw new Error("Event handler can only be function");l=l.substring(1),i[l]=b;return}let y=null,g=u.value;l.startsWith(":")&&(y=u.value,l=l.substring(1),g=B(e==null?void 0:e.resolve(u.value))),l=ar(l),s[l]={name:l,value:g,expr:y};}),{props:s,events:i}}async mountComponent(t,e,s,i={},c={}){var O,I,L,j,C,x,J,F;if(this.viewUpdates=(I=(O=this.viewUpdates)!=null?O:s==null?void 0:s.viewUpdates)!=null?I:new U.BatchUpdates(t),this.mountedComponents.has(t.uid))return this.mountedComponents.get(t.uid);let u=new H(this.app,{},this);u.viewUpdates=this.viewUpdates;let l={},y;for(let v of Object.keys(i)){let k=i[v];if(k.name==="ref"&&!k.expr){y=k;continue}k.expr&&this.bind({type:"prop",node:t,key:v,context:u,template:k.expr}),l[v]=k.value;}let g=await vr(e,l,c);u.component=g,u.stack=[],this.mountedComponents.set(t.uid,g),y&&this.setRefValue(y.value,g);{let v=t.updates();for(let N of Object.keys(i))i[N].expr||v.setAttribute(N,i[N].value);let k=(L=g.hostClasses)!=null?L:[];k&&(k=typeof k=="string"?[k]:k),k.push("o-component-host"),t.tag.toLowerCase()!=="div"&&k.push("c-"+t.tag.toLowerCase()),v.addClass(...k),this.viewUpdates.accept(v);}tt(async()=>{try{await g.decorateHostElement(t);}catch(v){}});{let v=(j=g.use)!=null?j:{};for(let k of Object.keys(v))u.componentsRegistry.register(k,v[k]);}if(g._hostElement=t,g.parent=(C=s==null?void 0:s.component)!=null?C:void 0,g.provide(H.PROVIDE_TOKEN,u),g.willMount(),!e.cssInstance){let v=g.style?(x=g.style())==null?void 0:x.toString():g.css;v&&((e.cssInstance)!=null||(e.cssInstance=await OUID.createComponentStyles(v,false)));}tt(()=>{var k;let v=e.cssInstance;if(v){let N=(k=H.STYLE_REF.get(v))!=null?k:0;N===0&&OUID.appendComponentStyles(v.uid),H.STYLE_REF.set(v,N+1),g.cssInstance=v;}});let b=[];if(g.render){b=await t.childNodes();let v=await g.render(u);v&&v.attachTo(t);}else {let v=g.template.trim();v.includes("<slot")&&(b=await t.childNodes()),await t.setHTML(v);}let T=await OUID.readMany([{id:"slots",fn:"queryAll",args:["slot",null,t.uid]},{id:"children",fn:"childTree",args:[t.uid]}]),S=((J=T.slots)!=null?J:[]).map(v=>new U.OElement(v)),M=((F=T.children)!=null?F:[]).map(v=>new U.OElement(v));S&&S.length&&(await Promise.all(S.filter(v=>{var k;return !((k=v.classes)!=null&&k.includes("hydrated"))}).map(async v=>{let k=v.attribute("name"),N=b.filter(_=>k?_.type==="Element"&&_.attribute("slot")===k:_.type!=="Element"||!_.hasAttribute("slot"));if(N.length){for(let _ of N)this.viewUpdates.add("setAttribute",_,"slotted","true"),this.viewUpdates.add("appendChild",v,_);await this.viewUpdates.exec(),await Promise.all(N.map(_=>this.render(_)));}})),M=await t.childNodes());{let v=M,k=6,N=0;for(;N<v.length;){let _=v.slice(N,N+k);await Promise.all(_.map(z=>u.render(z,{skipSlotted:true,deferUpdates:true}))),N+=k;}await Promise.all([u.updateBindings(),u.updateDirectives()]);}u.viewUpdates.add("addClass",t,"hydrated"),this.enqueueMounted(()=>{try{g.onMounted();}catch(v){}}),await u.viewUpdates.exec();let E=vt(()=>{u.collectDepsForBindingsAndDirectives();},{lazy:true,scheduler:f(()=>{u.scheduleReactiveFlush();},"scheduler")});return u.__renderRunner__=E,E(),g.__effects__=[()=>E.effect.stop()],g}async unmountComponent(t){var i,c;let e=this.mountedComponents.get(t.uid),s=(i=await t.childNodes())!=null?i:[];for(let u of s)await this.unmountComponent(u);if(e){let u=e.cssInstance;if(u){let y=(c=H.STYLE_REF.get(u))!=null?c:1;y===1?(await OUID.rejectComponentStyles(u),H.STYLE_REF.delete(u)):H.STYLE_REF.set(u,y-1);}e.willUnmount();let l=e.__effects__;l==null||l.forEach(y=>{try{y();}catch(g){}}),e.effects=void 0,e._hostElement=null,e.cssInstance=null;}this.mountedComponents.delete(t.uid),t.hasAttribute("ref")&&this.setRefValue(t.attribute("ref"),null),await t.removeAndRelease();}};f(H,"RenderContext"),p(H,"PROVIDE_TOKEN","RENDER_CONTEXT"),p(H,"MOUNTED_COMPONENTS_TOKEN","RENDER_CONTEXT_MOUNTED_COMPONENTS"),p(H,"STYLE_REF",new WeakMap);var X=H;async function es(a,t,e=[],s){let i=t!=null?t:{},c=await OUID.createElement(a,Object.keys(i).reduce((u,l)=>(u[l]=i[l],u),{}));return Object.keys(s!=null?s:{}).forEach(u=>{c==null||c.addEventListener(u,l=>{let y=s[u];typeof y=="function"&&y(l);});}),new ft(c,e)}f(es,"node");function vr(a,t,e){return cr(a)?a().then(s=>Yt(s.default,t,e)):Yt(a,t,e)}f(vr,"o");function br(a){return typeof a=="function"}f(br,"isProvideFunction");var kt=class kt{constructor(t,e){p(this,"root");p(this,"options");p(this,"providers",new Map);this.root=t,this.options=e,kt.currentApp=this;}provide(t,e){if(this.providers.has(t)){console.warn(`[OUID] - Provider ${t} already exists`);return}this.providers.set(t,br(e)?{provide:e}:{value:e});}inject(t){let e=this.providers.get(t);if(e)return e.provide?e.provide():e.value}use(t,e){return t.install(this,e),this}async mount(t){var i;if(!globalThis.__OUI_PUR_JS_CONTEXT__)return;await OUID.theme.install(),(i=this.options)!=null&&i.css&&await OUID.createComponentStyles(this.options.css),await OUID.createComponentStyles(`
31
+ * {
32
+ ${t} * {
33
+ visibility: hidden;
34
+ }
35
+ ${t} *.hydrated {
36
+ visibility: inherit;
37
+ }
38
+ .oui-hidden {
39
+ display: none !important;
40
+ }
41
+ `),Er(X.MOUNTED_COMPONENTS_TOKEN,new Map);let e=await OUID.query(t);if(!e)throw new Error("No selector found for "+t);let s=new X(this,{},null);s.mountComponent(e,this.root,null).then(async()=>{s.updateBindings(),s.updateDirectives(),await s.flushMounted();});}};f(kt,"App"),p(kt,"currentApp",null);var Ut=kt;function Er(a,t){var e;(e=Ut.currentApp)==null||e.provide(a,t);}f(Er,"provide");function Lt(a){var t,e;return (e=(t=Ut.currentApp)==null?void 0:t.inject(a))!=null?e:void 0}f(Lt,"inject");function Fe(a,t,e,s){var i=arguments.length,c=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(a,t,e,s);else for(var l=a.length-1;l>=0;l--)(u=a[l])&&(c=(i<3?u(c):i>3?u(t,e,c):u(t,e))||c);return i>3&&c&&Object.defineProperty(t,e,c),c}f(Fe,"_ts_decorate");var de=class de extends at{constructor(){super(...arguments);p(this,"router");}willMount(){}onMounted(){var e;this.router=$t(),(e=this.router)==null||e.bind(this).then(s=>{s==null||s();});}willUnmount(){var e;(e=this.router)==null||e.unbind();}};f(de,"ORouter");var Tt=de;Tt=Fe([Gt({tag:"o-router",template:`
42
+ <div id="router-view"></div>
43
+ `,css:`
44
+ .c-o-router,
45
+ o-router {
46
+ display: block;
47
+ height: 100%;
48
+ min-height: 0;
49
+ }
50
+
51
+ #router-view {
52
+ position: relative;
53
+ height: 100%;
54
+ min-height: 0;
55
+ width: 100%;
56
+ overflow: hidden;
57
+ }
58
+
59
+ .route-view {
60
+ position: absolute;
61
+ inset: 0;
62
+ width: 100%;
63
+ height: 100%;
64
+ opacity: 1;
65
+ overflow-x: hidden;
66
+ overflow-y: auto;
67
+ overscroll-behavior: contain;
68
+ visibility: visible;
69
+ -webkit-overflow-scrolling: touch;
70
+ backface-visibility: hidden;
71
+ contain: layout paint;
72
+ transform: translate3d(0, 0, 0);
73
+ will-change: transform, opacity;
74
+ background: var(--o-background, #FEFEFE);
75
+ z-index: 0;
76
+ }
77
+
78
+ .route-active {
79
+ z-index: 2;
80
+ }
81
+
82
+ /* shared transition */
83
+ .route-transitioning {
84
+ transition-duration: var(--oui-router-transition-duration, 250ms);
85
+ transition-property: transform, opacity;
86
+ transition-timing-function: ease-out;
87
+ z-index: 999
88
+ }
89
+
90
+ /* PUSH: new page comes from right */
91
+ .route-push-start {
92
+ transform: translate3d(100%, 0, 0);
93
+ }
94
+ .route-push-end {
95
+ transform: translate3d(0, 0, 0);
96
+ }
97
+
98
+ /* POP: current page goes to right, revealing underneath */
99
+ .route-pop-start {
100
+ transform: translate3d(0, 0, 0);
101
+ }
102
+ .route-pop-end {
103
+ transform: translate3d(100%, 0, 0);
104
+ }
105
+
106
+ .route-fade-start {
107
+ opacity: 0;
108
+ }
109
+
110
+ .route-fade-end {
111
+ opacity: 1;
112
+ }
113
+
114
+ .route-view.route-hidden {
115
+ opacity: 0;
116
+ pointer-events: none;
117
+ visibility: hidden;
118
+ z-index: 0;
119
+ }
120
+ `})],Tt);var Be="OROUTER_TOKEN",je="ACTIVE_ROUTE",Tr="CURRENT_ROUTE",Sr=250,Rr=40,jt=120;function $t(){return Lt(Be)}f($t,"useRouter");var De,fe=class fe extends at{constructor(){super(...arguments);p(this,"active",this.state.wrap(false));p(this,"activeClass",(De=this.props.activeClass)!=null?De:"router-link-active");p(this,"removeAfterEach");}onMounted(){let e=$t();this.removeAfterEach=e==null?void 0:e.afterEach(()=>{this.syncActive();}),this.syncActive();}willUnmount(){var e;(e=this.removeAfterEach)==null||e.call(this);}navigate(){let e=$t(),s=this.resolveTo();if(!(!e||!s)){if(this.props.replace){e.replace(s);return}e.push(s);}}onKeydown(e){((e==null?void 0:e.key)==="Enter"||(e==null?void 0:e.key)===" ")&&this.navigate();}syncActive(){let e=$t(),s=this.resolveTo();this.active.value=!!e&&!!s&&e.isActive(s);}resolveTo(){let e=this.props.to;return e?typeof e=="string"?{path:e,absolute:true}:e:null}};f(fe,"OLink");var St=fe;St=Fe([Gt({tag:"o-link",template:`
121
+ <span
122
+ role="link"
123
+ tabindex="0"
124
+ :class="active.value ? activeClass : ''"
125
+ @click="() => navigate()"
126
+ @keydown="(event) => onKeydown(event)"
127
+ ><slot></slot></span>
128
+ `})],St);function ps(a,t){return new he(a,t)}f(ps,"createRouter");function Cr(a){a&&(a.__isActive=true,typeof a.onActivated=="function"&&a.onActivated());}f(Cr,"activate");function $e(a){a&&(a.__isActive=false,typeof a.onDeactivated=="function"&&a.onDeactivated());}f($e,"deactivate");var pe=class pe{constructor(t,e={}){p(this,"routes");p(this,"windowObject",null);p(this,"guards",[]);p(this,"eventRegistration",null);p(this,"compiled");p(this,"outletEl",null);p(this,"boundComponent",null);p(this,"outletConfigured",false);p(this,"stack",[]);p(this,"tabStacks",new Map);p(this,"activeTabKey",null);p(this,"routeCache",new Map);p(this,"currentEntry",null);p(this,"currentPath","");p(this,"pendingNav",null);p(this,"queuedNav",null);p(this,"historyIndex",0);p(this,"bindToken",0);p(this,"preloadTimer",null);p(this,"preloadStarted",false);p(this,"preloadingRoutes",new Map);p(this,"activeRoute",{params:{},query:{}});p(this,"currentRoute",Ce(null));p(this,"options");var s,i,c,u,l,y,g,b,T,S,M,E,O,I,L;this.routes=t,this.compiled=t.map(j=>({route:j,parser:new kr(j.path)})),this.options={defaultTransition:(s=e.defaultTransition)!=null?s:"slide",transitionDuration:(i=e.transitionDuration)!=null?i:Sr,cache:{strategy:(u=(c=e.cache)==null?void 0:c.strategy)!=null?u:"stack",max:(y=(l=e.cache)==null?void 0:l.max)!=null?y:10},preload:{tabs:(b=(g=e.preload)==null?void 0:g.tabs)!=null?b:false,routes:(S=(T=e.preload)==null?void 0:T.routes)!=null?S:[],delay:(E=(M=e.preload)==null?void 0:M.delay)!=null?E:80},notFound:(O=e.notFound)!=null?O:null,backFallback:(I=e.backFallback)!=null?I:null,scrollRestoration:(L=e.scrollRestoration)!=null?L:true,scrollBehavior:e.scrollBehavior};}install(t){t.provide(Be,this),t.provide(je,this.activeRoute),t.provide(Tr,this.currentRoute),w.registerComponent("o-router",Tt),w.registerComponent("o-link",St);}resolveByName(t){for(let e of this.compiled)if(e.route.name===t)return {route:e.route,params:{},query:{},hash:"",parser:e.parser};return null}mapPath(t,e={},s={},i=""){let c=t.reverse(e);if(!c)return null;let u=Object.keys(s).map(l=>`${encodeURIComponent(l)}=${encodeURIComponent(s[l])}`).join("&");return u&&(c+=`?${u}`),i&&(c+=i.startsWith("#")?i:`#${i}`),c}resolve(t,e=new Set){let{path:s,query:i,hash:c}=this.parseUrl(t),u=this.stringifyPath(s,i,c);if(e.has(u))return console.warn(`[OUID-Router]: redirect loop detected for ${u}`),null;e.add(u);for(let l of this.compiled){if(l.route.path==="*")continue;let y=l.parser.match(s);if(y){if(l.route.redirectTo){let g=this.resolveRedirect(l.route.redirectTo,y,i,c);return g?this.resolve(g,e):null}return {route:l.route,params:y,query:i,hash:c,parser:l.parser}}}return this.resolveNotFound(s,i,c)}parseUrl(t){let[e,s=""]=t.split("#"),[i,c=""]=e.split("?"),u=i||"/",l={};if(c)try{new URLSearchParams(c).forEach((g,b)=>{l[b]=g;});}catch(y){return {path:u,query:{},hash:s?`#${s}`:""}}return {path:u,query:l,hash:s?`#${s}`:""}}stringifyPath(t,e={},s=""){let i=t||"/",c=Object.keys(e).map(u=>`${encodeURIComponent(u)}=${encodeURIComponent(e[u])}`).join("&");return c&&(i+=`?${c}`),s&&(i+=s.startsWith("#")?s:`#${s}`),i}resolveRedirect(t,e,s,i){if(typeof t=="string")return t;let c=this.resolveByName(t.name);return c?this.mapPath(c.parser,e,s,i):null}resolveNotFound(t,e,s){if(this.options.notFound){let c=typeof this.options.notFound=="string"?this.options.notFound.startsWith("/")?{path:this.options.notFound,absolute:true}:{name:this.options.notFound}:this.options.notFound,u=this.resolveNavigationTarget(c,false);if(u)return u.matched}let i=this.compiled.find(c=>c.route.path==="*");return i?{route:i.route,params:{path:t},query:e,hash:s,parser:i.parser}:null}replace(t){return this.push(t,true)}push(t,e=false){return !t.path&&!t.name?(console.warn("[OUID-Router]: no path or name provided to push"),Promise.resolve({type:"failed",from:this.currentRoute.value,error:new Error("No path or name provided")})):this.enqueueNavigation(()=>this.navigate(t,e))}resolveLocation(t){let e=this.resolveNavigationTarget(t);return e?this.toRouteLocation(e.path,e.matched):null}href(t){var e,s;return (s=(e=this.resolveLocation(t))==null?void 0:e.fullPath)!=null?s:"#"}isActive(t,e=true){let s=this.resolveLocation(t),i=this.currentRoute.value;return !s||!i?false:e?i.fullPath===s.fullPath:i.path.startsWith(s.path)}canGoBack(){return this.getActiveStack().length>1||this.historyIndex>0}resolveNavigationTarget(t,e=true){var s,i;if(t.name){let c=this.resolveByName(t.name);if(!c)return console.warn("[OUID-Router]: No matched route name found"),null;let u=this.mapPath(c.parser,t.params,t.query,t.hash);return u?{matched:(s=e?this.resolve(u):this.resolveWithoutNotFound(u))!=null?s:c,path:u}:null}if(t.absolute&&t.path){let c=e?this.resolve(t.path):this.resolveWithoutNotFound(t.path);return c?{matched:c,path:t.path}:null}if(t.path){let c=e?this.resolve(t.path):this.resolveWithoutNotFound(t.path);if(c){let u=this.mapPath(c.parser,G(G({},c.params),t.params),G(G({},c.query),t.query),(i=t.hash)!=null?i:c.hash);if(u)return {matched:c,path:u}}}return null}resolveWithoutNotFound(t){let{path:e,query:s,hash:i}=this.parseUrl(t);for(let c of this.compiled){if(c.route.path==="*")continue;let u=c.parser.match(e);if(u)return {route:c.route,params:u,query:s,hash:i,parser:c.parser}}return null}async navigate(t,e=false,s=0){var b;if(s>10)return {type:"failed",from:this.currentRoute.value,error:new Error("Too many router redirects")};this.windowObject||(this.windowObject=await w.acquireObject("window"));let i=this.resolveNavigationTarget(t),c=this.currentRoute.value;if(!i)return {type:"not-found",from:c};let u=this.toRouteLocation(i.path,i.matched);if(!e&&i.path===this.currentPath)return {type:"duplicated",to:u,from:c};let l=await this.beforeRouteGoing(u,c);if(l===false)return {type:"cancelled",to:u,from:c};if(this.isRouteRedirect(l)){let T=await this.navigate(l,true,s+1);return {type:"redirected",to:u,from:c,redirectedTo:T.to}}let y={navIndex:e?this.historyIndex:this.historyIndex+1};this.commitHistory(i.path,y,e),this.historyIndex=y.navIndex;let g=await this.renderMatched(i.path,i.matched,{direction:e?"replace":"forward",mode:(b=t.mode)!=null?b:this.resolveRouteNavigationMode(i.matched.route),transition:this.resolveRouteTransition(i.matched.route,t,e?"replace":"forward"),replace:e},true,c);return g!=null?g:{type:"success",to:u,from:c}}async pop(t={}){return this.back(t)}async back(t={}){var c,u;let e=this.currentRoute.value;if(!this.canGoBack()){let l=(c=t.fallback)!=null?c:this.options.backFallback;return l?this.replace(l):{type:"cancelled",from:e}}this.windowObject||(this.windowObject=await w.acquireObject("window"));let s=this.getActiveStack(),i=s[s.length-2];return (u=this.windowObject)==null||u.invoke("history.back").catch(l=>{console.warn("[OUID-Router]: history.back failed",l);}),{type:"success",from:e,to:i==null?void 0:i.location}}async backOrExit(){return this.back()}async beforeRouteGoing(t,e){var c;let s=(c=this.currentEntry)==null?void 0:c.inst;if(s&&typeof s.onBeforeRouteLeave=="function"){let u=await s.onBeforeRouteLeave(t,e);if(u===false||this.isRouteRedirect(u))return u}for(let u of this.guards.filter(l=>l.type==="before")){let l=await u.fn(t,e);if(l===false||this.isRouteRedirect(l))return l}let i=Array.isArray(t.route.beforeEnter)?t.route.beforeEnter:t.route.beforeEnter?[t.route.beforeEnter]:[];for(let u of i){let l=await u(t,e);if(l===false||this.isRouteRedirect(l))return l}}async afterRouteGoing(t,e){for(let s of this.guards.filter(i=>i.type==="after")){let i=await s.fn(t,e);if(i===false||this.isRouteRedirect(i))return i}}async bind(t){this.boundComponent=t,this.windowObject=await w.acquireObject("window");let e=++this.bindToken,s=this.resolveLaunchInitialRoute(),i=s?Promise.resolve(s):this.safelyResolvePath("/");return this.setupHistoryTracking(i,e),()=>{this.renderInitialPath(i,e);}}resolveLaunchInitialRoute(){var t;try{return (t=w.launch().initialRoute)!=null?t:null}catch(e){return null}}async renderInitialPath(t,e){let i=await this.withTimeout(t,Rr,"/");this.isCurrentBinding(e)&&(await this.enqueueNavigation(()=>this.renderPath(i,"initial")),i==="/"&&t.then(c=>{c!==i&&this.isCurrentBinding(e)&&this.enqueueNavigation(()=>this.renderPath(c,"replace"));}));}async setupHistoryTracking(t,e){var s;try{let i=await this.withTimeout(t,jt,"/");if(!this.isCurrentBinding(e)||!this.windowObject)return;let c=await this.withTimeout(this.readHistoryState(),jt,null);c&&typeof c.navIndex=="number"?this.historyIndex=c.navIndex:this.commitHistory(i,{navIndex:this.historyIndex},!0);let u=await this.windowObject.addEventListener("popstate",l=>{this.handlePopState(l);});if(!this.isCurrentBinding(e)){await((s=this.windowObject)==null?void 0:s.dettachEventListener(u));return}this.eventRegistration=u;}catch(i){console.warn("[OUID-Router]: history tracking setup failed",i);}}async handlePopState(t){var y;let e=await this.withTimeout(this.safelyResolvePath(this.currentPath||"/"),jt,this.currentPath||"/"),s=(y=t==null?void 0:t.state)!=null?y:await this.withTimeout(this.readHistoryState(),jt,null),i=0;s&&typeof s.navIndex=="number"&&(i=s.navIndex);let c=i>this.historyIndex?"forward":i<this.historyIndex?"back":"none",u=this.historyIndex;this.historyIndex=i,(await this.enqueueNavigation(()=>this.renderPath(e,c))).type==="cancelled"&&this.currentPath&&(this.historyIndex=u,this.commitHistory(this.currentPath,{navIndex:u},true));}readHistoryState(){return this.windowObject?this.windowObject.getProperty("history.state").then(t=>t!=null?t:null).catch(t=>(console.warn("[OUID-Router]: history.state read failed",t),null)):Promise.resolve(null)}safelyResolvePath(t){return this.resolvePath().catch(e=>(console.warn("[OUID-Router]: location read failed",e),t))}commitHistory(t,e,s){var c;let i=s?"history.replaceState":"history.pushState";(c=this.windowObject)==null||c.invoke(i,e,"",t).catch(u=>{console.warn(`[OUID-Router]: ${i} failed`,u);});}async withTimeout(t,e,s){return Promise.race([t.catch(()=>s),Xt(e).then(()=>s)])}isCurrentBinding(t){return this.bindToken===t&&this.boundComponent!==null}enqueueNavigation(t){return this.pendingNav?(this.queuedNav&&this.queuedNav.resolve({type:"cancelled",from:this.currentRoute.value}),new Promise((e,s)=>{this.queuedNav={task:t,resolve:e,reject:s};})):(this.pendingNav=(async()=>{try{return await t()}catch(e){return console.error("[OUID-Router]: navigation failed",e),{type:"failed",from:this.currentRoute.value,error:e}}finally{this.pendingNav=null;let e=this.queuedNav;this.queuedNav=null,e&&this.enqueueNavigation(e.task).then(e.resolve,e.reject);}})(),this.pendingNav)}async renderPath(t,e){let s=this.resolve(t),i=this.currentRoute.value;return s?await this.renderMatched(t,s,this.createNavigationPlan(s.route,{},e,e==="replace"),false,i):(console.warn(`[Router] No route found for: ${t}`),{type:"not-found",from:i})}async renderMatched(t,e,s,i,c=this.currentRoute.value){var S,M,E;let u=this.boundComponent;if(!u)return {type:"failed",from:c,error:new Error("Router is not bound")};let l=this.toRouteLocation(t,e);if(!e.route.component)return console.warn(`[Router] Route "${e.route.name}" has no component`),{type:"failed",to:l,from:c,error:new Error(`Route "${e.route.name}" has no component`)};if(!i){let O=await this.beforeRouteGoing(l,c);if(O===false)return {type:"cancelled",to:l,from:c};if(this.isRouteRedirect(O)){let I=await this.navigate(O,true,1);return {type:"redirected",to:l,from:c,redirectedTo:I.to}}}let y=u.inject(X.PROVIDE_TOKEN);if(!y)return {type:"failed",to:l,from:c,error:new Error("Router context not found")};this.outletEl||(this.outletEl=await y.hostElement.query("#router-view"));let g=this.outletEl;if(!g)return {type:"failed",to:l,from:c,error:new Error("Router outlet not found")};this.outletConfigured||(this.outletConfigured=true,await g.setStyle("--oui-router-transition-duration",`${this.options.transitionDuration}ms`));let b=this.currentEntry,T=await this.resolveRouteEntry(y,g,e,t,s);return T?(await this.captureScroll(b),(b==null?void 0:b.host.uid)!==T.host.uid?($e((S=b==null?void 0:b.inst)!=null?S:null),await this.runTransition(s,(M=b==null?void 0:b.host)!=null?M:null,T.host),await this.applyStackChange(s,b,T)):(await this.runTransitionNone((E=b==null?void 0:b.host)!=null?E:null,T.host),await this.applyStackChange(s,b,T)),this.currentEntry=T,this.currentPath=t,this.updateActiveRoute(l),u.provide(je,this.activeRoute),await this.applyScroll(l,c,T,s),Cr(T.inst),await this.afterRouteGoing(l,c),s.direction==="initial"&&this.scheduleRoutePreload(t),await tt(),{type:"success",to:l,from:c}):{type:"failed",to:l,from:c,error:new Error("Route entry could not be resolved")}}createNavigationPlan(t,e,s,i){var y,g,b,T;let c=(y=e.mode)!=null?y:this.resolveRouteNavigationMode(t),u=(T=(b=e.transition)!=null?b:(g=t.meta)==null?void 0:g.transition)!=null?T:t.transition,l=u!=null?u:s==="initial"||s==="replace"||c==="tab"?"none":this.options.defaultTransition;return {direction:s,mode:c,transition:l,replace:i}}toRouteLocation(t,e){let s=this.parseUrl(t);return {url:t,fullPath:t,path:s.path,name:e.route.name,params:e.params,query:e.query,hash:e.hash||s.hash,route:e.route}}updateActiveRoute(t){this.activeRoute.url=t.url,this.activeRoute.fullPath=t.fullPath,this.activeRoute.path=t.path,this.activeRoute.name=t.name,this.activeRoute.params=t.params,this.activeRoute.query=t.query,this.activeRoute.hash=t.hash,this.activeRoute.route=t.route,this.currentRoute.value=t;}isRouteRedirect(t){return !!t&&typeof t=="object"&&("name"in t||"path"in t)}resolveRouteNavigationMode(t){var e,s;return (s=(e=t.meta)==null?void 0:e.navigation)!=null?s:"stack"}resolveRouteTransition(t,e,s){return this.createNavigationPlan(t,e,s,s==="replace").transition}routeCacheKey(t,e){return `${t.route.name}:${e}`}shouldKeepAlive(t,e){var s;return typeof((s=t.meta)==null?void 0:s.keepAlive)=="boolean"?t.meta.keepAlive:e.mode==="tab"?true:this.options.cache.strategy==="route"}getActiveStack(){if(this.activeTabKey){let t=this.tabStacks.get(this.activeTabKey);if(t)return t}return this.stack}setActiveStack(t){this.stack=t,this.activeTabKey&&this.tabStacks.set(this.activeTabKey,t);}isEntryInAnyStack(t){if(this.stack.includes(t))return true;for(let e of this.tabStacks.values())if(e.includes(t))return true;return false}async resolveRouteEntry(t,e,s,i,c,u={}){var O,I,L,j;let l=this.routeCacheKey(s,i),y=u.forceKeepAlive||this.shouldKeepAlive(s.route,c),g=c.direction==="back"?this.stack[this.stack.length-2]:void 0,b=(g==null?void 0:g.path)===i?g:this.routeCache.get(l);if(b&&b.host.uid!==((O=this.currentEntry)==null?void 0:O.host.uid))return c.mode==="tab"?await this.prepareCachedEntry(b):await this.bringEntryToFront(e,b),await Promise.all([b.ctx.updateBindings(),b.ctx.updateDirectives()]),b;if(b&&b.host.uid===((I=this.currentEntry)==null?void 0:I.host.uid))return b;if(!u.skipInflightPreload){let C=this.preloadingRoutes.get(l);if(C){let x=await C;if(x&&x.host.uid!==((L=this.currentEntry)==null?void 0:L.host.uid))return c.mode==="tab"?await this.prepareCachedEntry(x):await this.bringEntryToFront(e,x),await Promise.all([x.ctx.updateBindings(),x.ctx.updateDirectives()]),x;if(x)return x}}let T=await w.createElement("div",{class:"route-view route-hidden"});await e.appendChild(T);let S=await t.mountComponent(T,s.route.component,t),M=(j=S.inject(X.PROVIDE_TOKEN))!=null?j:t;t.flushMounted();let E={key:l,route:s.route,path:i,location:this.toRouteLocation(i,s),host:T,ctx:M,inst:S,keepAlive:y};return y&&this.options.cache.strategy!=="none"&&(this.routeCache.set(l,E),await this.trimRouteCache()),E}scheduleRoutePreload(t){if(this.preloadStarted||this.preloadTimer)return;let e=this.preloadCandidates(t);if(!e.length)return;this.preloadStarted=true;let s=this.bindToken,i=f(()=>{this.preloadTimer=null,this.preloadRoutes(e,s);},"run"),c=globalThis.setTimeout;typeof c=="function"?this.preloadTimer=c(i,this.options.preload.delay):tt(i);}preloadCandidates(t){var i,c,u;let e=new Set(this.options.preload.routes),s=[];for(let l of e){if(!l.startsWith("/")||l===t)continue;let y=this.resolve(l);y!=null&&y.route.component&&((i=y.route.meta)==null?void 0:i.preload)!==false&&s.push({matched:y,path:l});}for(let l of this.compiled){if(!l.route.component||((c=l.route.meta)==null?void 0:c.preload)===false)continue;let y=this.mapPath(l.parser);if(!y||y===t)continue;let g=((u=l.route.meta)==null?void 0:u.preload)===true,b=e.has(l.route.name)||e.has(y),T=this.options.preload.tabs&&this.resolveRouteNavigationMode(l.route)==="tab";if(!g&&!b&&!T)continue;let S=this.resolve(y);S&&!s.some(M=>M.path===y)&&s.push({matched:S,path:y});}return s}async preloadRoutes(t,e){let s=this.boundComponent;if(!s||!this.isCurrentBinding(e))return;let i=s.inject(X.PROVIDE_TOKEN);if(!i)return;this.outletEl||(this.outletEl=await i.hostElement.query("#router-view"));let c=this.outletEl;if(!(!c||!this.isCurrentBinding(e))){this.outletConfigured||(this.outletConfigured=true,await c.setStyle("--oui-router-transition-duration",`${this.options.transitionDuration}ms`));for(let u of t){if(!this.isCurrentBinding(e)||u.path===this.currentPath)continue;let l=this.routeCacheKey(u.matched,u.path);if(this.routeCache.has(l)||this.preloadingRoutes.has(l))continue;let y=this.createNavigationPlan(u.matched.route,{transition:"none"},"replace",false),g=this.resolveRouteEntry(i,c,u.matched,u.path,y,{skipInflightPreload:true,forceKeepAlive:true}).catch(b=>(console.warn("[OUID-Router]: route preload failed",b),null)).finally(()=>{this.preloadingRoutes.delete(l);});this.preloadingRoutes.set(l,g),await g;}}}async bringEntryToFront(t,e){await t.updates().add("appendChild",t,e.host).add("removeClass",e.host,"route-active","route-transitioning","route-push-start","route-push-end","route-pop-start","route-pop-end","route-fade-start","route-fade-end").exec();}async prepareCachedEntry(t){await t.host.updates().removeClass("route-active","route-transitioning","route-push-start","route-push-end","route-pop-start","route-pop-end","route-fade-start","route-fade-end").exec();}async trimRouteCache(){if(!(this.options.cache.max<=0))for(;this.routeCache.size>this.options.cache.max;){let t=Array.from(this.routeCache.entries()).find(([,i])=>i!==this.currentEntry&&!this.isEntryInAnyStack(i));if(!t)return;let[e,s]=t;this.routeCache.delete(e),await this.unmountEntry(s);}}async applyStackChange(t,e,s){var c,u,l;if(t.mode==="tab"){this.activeTabKey=s.route.name;let y=(c=this.tabStacks.get(this.activeTabKey))!=null?c:[],g=[s];this.tabStacks.set(this.activeTabKey,g),this.stack=g;for(let b of y)b!==s&&await this.releaseEntryIfUnused(b);e&&e!==s&&!this.isEntryInAnyStack(e)&&await this.releaseEntryIfUnused(e);return}let i=this.getActiveStack();if(t.direction==="initial"){this.setActiveStack([s]);return}if(t.direction==="back"){let y=(u=i.pop())!=null?u:e;i[i.length-1]!==s&&i.push(s),this.setActiveStack(i),y&&y!==s&&await this.releaseEntryIfUnused(y);return}if(t.replace){let y=(l=i.pop())!=null?l:e;i.push(s),this.setActiveStack(i),y&&y!==s&&await this.releaseEntryIfUnused(y);return}i[i.length-1]!==s&&i.push(s),this.setActiveStack(i);}async releaseEntryIfUnused(t){if(!this.isEntryInAnyStack(t)){if(t.keepAlive&&this.routeCache.get(t.key)===t){await t.host.updates().addClass("route-hidden").removeClass("route-active","route-transitioning").exec();return}await this.unmountEntry(t);}}async captureScroll(t){var e,s,i,c;if(!(!t||!this.options.scrollRestoration))try{let u=await w.readMany([{id:"top",fn:"getObjectProperty",args:[t.host.uid,"scrollTop"]},{id:"left",fn:"getObjectProperty",args:[t.host.uid,"scrollLeft"]}]);t.scrollTop=Number((e=u.top)!=null?e:0),t.scrollLeft=Number((s=u.left)!=null?s:0);}catch(u){t.scrollTop=(i=t.scrollTop)!=null?i:0,t.scrollLeft=(c=t.scrollLeft)!=null?c:0;}}async applyScroll(t,e,s,i){var T,S,M,E;if(!this.options.scrollRestoration)return;let c;if(this.options.scrollBehavior&&(c=await this.options.scrollBehavior(t,e),c===false))return;let u=c&&typeof c=="object"?c:{},l=typeof s.scrollTop=="number"||typeof s.scrollLeft=="number",y=i.direction==="back"||i.mode==="tab"&&l,g=(S=u.top)!=null?S:y&&(T=s.scrollTop)!=null?T:0,b=(E=u.left)!=null?E:y&&(M=s.scrollLeft)!=null?M:0;await s.host.updates().setProperty("scrollTop",g).setProperty("scrollLeft",b).exec();}async unmountEntry(t){$e(t.inst),this.routeCache.delete(t.key),await t.ctx.unmountComponent(t.host);}async runTransition(t,e,s){if(t.transition==="none"){await this.runTransitionNone(e,s);return}if(t.transition==="fade"){await this.runTransitionFade(e,s);return}if((t.direction==="back"?"pop":"push")==="pop"&&e){await this.runTransitionPop(e,s);return}await this.runTransitionPush(e,s);}async waitForTransition(t){let e=null,s=false;await Promise.race([new Promise(i=>{t.addEventListener("transitionend",()=>{s||(s=true,i());},{options:{once:true},policy:{payload:"none"}}).then(c=>{if(s){t.dettachEventListener(c).catch(()=>{});return}e=c;}).catch(()=>i());}),Xt(this.options.transitionDuration+80)]),s=true,e&&await t.dettachEventListener(e).catch(()=>{});}async resolvePath(){let t=await this.windowObject.getProperty("location.href"),e=await this.windowObject.getProperty("location.origin"),s=t.replace(e,"");return s.startsWith("/")||(s="/"+s),s}unbind(){var t;this.bindToken++,this.eventRegistration&&((t=this.windowObject)==null||t.dettachEventListener(this.eventRegistration),this.eventRegistration=null),this.preloadTimer&&typeof globalThis.clearTimeout=="function"&&globalThis.clearTimeout(this.preloadTimer),this.preloadTimer=null,this.preloadingRoutes.clear(),this.preloadStarted=false,this.boundComponent=null,this.outletEl=null,this.outletConfigured=false,this.activeTabKey=null;}async runTransitionNone(t,e){let s=e.updates();s.removeClass("route-hidden","route-transitioning","route-push-start","route-push-end","route-pop-start","route-pop-end","route-fade-start","route-fade-end").addClass("route-view","route-active"),t&&t.uid!==e.uid&&(s.add("addClass",t,"route-hidden"),s.add("removeClass",t,"route-active","route-transitioning","route-push-start","route-push-end","route-pop-start","route-pop-end","route-fade-start","route-fade-end")),await s.exec();}async runTransitionFade(t,e){if(!t){await this.runTransitionNone(null,e);return}await e.updates().addClass("route-view","route-active","route-fade-start").removeClass("route-hidden","route-fade-end").exec(),await new Promise(c=>{w.requestAnimationFrame(()=>c());});let s=this.waitForTransition(e);await e.updates().addClass("route-transitioning","route-fade-end").removeClass("route-fade-start").exec(),await s;let i=e.updates();i.removeClass("route-transitioning","route-fade-start"),i.add("addClass",t,"route-hidden"),i.add("removeClass",t,"route-active","route-transitioning","route-fade-start"),await i.exec();}async runTransitionPush(t,e){if(!t){await e.updates().removeClass("route-hidden","route-transitioning","route-push-start").addClass("route-view","route-active","route-push-end").exec();return}let s=e.updates();s.addClass("route-view","route-active"),t&&s.add("addClass",t,"route-view"),s.removeClass("route-hidden","route-push-end","route-pop-end").addClass("route-push-start"),await s.exec(),await new Promise(l=>{w.requestAnimationFrame(()=>l());});let i=this.waitForTransition(e),c=e.updates();c.addClass("route-transitioning").removeClass("route-push-start").addClass("route-push-end"),await c.exec(),await i;let u=e.updates();u.removeClass("route-transitioning","route-push-start"),t&&(u.add("addClass",t,"route-hidden"),u.add("removeClass",t,"route-active")),await u.exec();}async runTransitionPop(t,e){let s=t.updates();s.addClass("route-view"),s.add("addClass",e,"route-view","route-active"),s.add("removeClass",e,"route-hidden"),s.addClass("route-pop-start").removeClass("route-push-end","route-pop-end"),await s.exec(),await new Promise(l=>{w.requestAnimationFrame(()=>l());});let i=this.waitForTransition(t),c=t.updates();c.addClass("route-transitioning"),c.removeClass("route-pop-start").addClass("route-pop-end"),await c.exec(),await i;let u=t.updates();u.addClass("route-hidden").removeClass("route-active","route-transitioning","route-pop-start"),await u.exec();}beforeEach(t){let e={fn:t,type:"before"};return this.guards.push(e),()=>{let s=this.guards.indexOf(e);s>=0&&this.guards.splice(s,1);}}afterEach(t){let e={fn:t,type:"after"};return this.guards.push(e),()=>{let s=this.guards.indexOf(e);s>=0&&this.guards.splice(s,1);}}};f(pe,"Router");var he=pe;var me=class me extends at{render(t){return ft.of('<i class="o-icon"><slot></slot></i>')}style(){return It.of({i:`
129
+ display: inline-block;
130
+ width: 1em;
131
+ height: 1em;
132
+ vertical-align: -0.15em;
133
+ overflow: hidden;
134
+ `})}};f(me,"OIcon");var qe=me;function Es(){return it.getAll().reduce((t,[e,s])=>(t[e]=s,t),{})}f(Es,"components");export{je as ACTIVE_ROUTE_TOKEN,Ut as App,Tr as CURRENT_ROUTE_TOKEN,Gt as Component,yt as Emits,at as OComponent,U as ODOM,qe as OIcon,St as OLink,Tt as ORouter,w as OUID,re as OUIDAppController,ne as OUIDBridge,ie as OUIDPermissionController,se as OUIDSystemController,ee as OUIDThemeController,Be as ROUTER_INJECTION_TOKEN,X as RenderContext,ft as RenderNode,he as Router,bt as State,It as StyleData,Es as components,Yt as createComponent,ps as createRouter,Lt as inject,Wt as isStated,es as node,vr as o,Er as provide,Ce as stated,$t as useRouter};
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@ouidesigner/ouider",
3
+ "version": "0.3.0",
4
+ "main": "index.js",
5
+ "type": "module",
6
+ "scripts": {
7
+ "clean": "rm -rf dist",
8
+ "build": "npm run clean;tsup",
9
+ "test:integration": "npm run build && node tests/integration-reactivity.mjs"
10
+ },
11
+ "keywords": [],
12
+ "author": "",
13
+ "license": "MIT",
14
+ "description": "OUIDesigner render framework core package, including a router",
15
+ "devDependencies": {
16
+ "@types/route-parser": "^0.1.7",
17
+ "tsup": "^8.5.0",
18
+ "typescript": "^5.9.2"
19
+ },
20
+ "exports": {
21
+ ".": {
22
+ "import": "./dist/index.js",
23
+ "require": "./dist/index.cjs"
24
+ },
25
+ "./dom": {
26
+ "types": "./dist/dom/dom.d.ts",
27
+ "import": "./dist/dom/dom.js",
28
+ "require": "./dist/dom/dom.cjs"
29
+ }
30
+ },
31
+ "types": "dist/index.d.ts",
32
+ "files": [
33
+ "/dist"
34
+ ],
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "dependencies": {
39
+ "route-parser": "^0.0.5"
40
+ }
41
+ }