compelem 0.6.11-b1 → 0.7.0-b1
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/CompElem.d.ts +7 -0
- package/IComponent.d.ts +1 -0
- package/README.md +1 -0
- package/compelem.umd.js +2 -2
- package/constants.d.ts +0 -1
- package/decorators/prop.d.ts +0 -4
- package/index.js +2 -2
- package/package.json +1 -1
- package/reactive.d.ts +3 -4
- package/render/Template.d.ts +4 -0
- package/render/render.d.ts +1 -1
- package/types.d.ts +1 -0
package/CompElem.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IComponent } from "./IComponent";
|
|
2
2
|
import { Template } from "./render/Template";
|
|
3
3
|
import { DefaultProps, TmplFn } from "./types";
|
|
4
|
+
export declare const PROP_OBJECT_KEY_MAP_SYMBOL: unique symbol;
|
|
4
5
|
/**
|
|
5
6
|
* CompElem基类,意为组件元素。提供了基本内置属性及生命周期等必备接口
|
|
6
7
|
* 每个组件都需要继承自该类
|
|
@@ -12,6 +13,8 @@ export declare class CompElem extends HTMLElement implements IComponent {
|
|
|
12
13
|
static __l_globalRule: HTMLStyleElement;
|
|
13
14
|
static defaults(options: DefaultProps): void;
|
|
14
15
|
__events: Record<string, Array<Node | ((e: Event) => void)>[]>;
|
|
16
|
+
_propObjectKeyMap: Record<string, string>;
|
|
17
|
+
get [PROP_OBJECT_KEY_MAP_SYMBOL](): Record<string, string>;
|
|
15
18
|
get [Symbol.toStringTag](): string;
|
|
16
19
|
get cid(): number;
|
|
17
20
|
get reactiveData(): Record<string, any>;
|
|
@@ -34,6 +37,10 @@ export declare class CompElem extends HTMLElement implements IComponent {
|
|
|
34
37
|
static get hostStyles(): Array<string>;
|
|
35
38
|
get styles(): Array<() => string>;
|
|
36
39
|
constructor(...args: any[]);
|
|
40
|
+
/**
|
|
41
|
+
* Returns the root component in the parent chain, or itself if it's the top-level component.
|
|
42
|
+
*/
|
|
43
|
+
get rootComponent(): CompElem;
|
|
37
44
|
connectedCallback(): void;
|
|
38
45
|
disconnectedCallback(): void;
|
|
39
46
|
__init(): void;
|
package/IComponent.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface IComponent {
|
|
|
10
10
|
get props(): Record<string, any>;
|
|
11
11
|
get renderRoot(): HTMLElement;
|
|
12
12
|
get renderRoots(): HTMLElement[];
|
|
13
|
+
get rootComponent(): HTMLElement;
|
|
13
14
|
get parentComponent(): HTMLElement | null;
|
|
14
15
|
get wrapperComponent(): HTMLElement | null;
|
|
15
16
|
get slots(): Record<string, Array<Node>>;
|
package/README.md
CHANGED
|
@@ -234,6 +234,7 @@ export class PageTest extends CompElem {
|
|
|
234
234
|
<div ref="${divRef}"></div>`;
|
|
235
235
|
```
|
|
236
236
|
- ### 内置属性及函数
|
|
237
|
+
- `readonly` rootComponent 根组件引用
|
|
237
238
|
- `readonly` parentComponent 父组件引用,可能为空
|
|
238
239
|
- `readonly` wrapperComponent 包装(组件所在视图归属)组件引用,可能为空
|
|
239
240
|
- `readonly` renderRoot/renderRoots 渲染根元素/渲染根元素列表
|
package/compelem.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* compelem v0.
|
|
2
|
+
* compelem v0.7.0-b1.1759918554
|
|
3
3
|
* A modern, reactive, fast, lightweight and flexible lib for building web components
|
|
4
4
|
* @holyhigh2
|
|
5
5
|
* https://github.com/holyhigh2/compelem
|
|
6
6
|
*/
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("myfx")):"function"==typeof define&&define.amd?define(["exports","myfx"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).compelem={},e.myfx)}(this,(function(e,t){"use strict";const r=new WeakMap,n=/\s+\.?key\s*=/;var s,o,i,a;function l(e){console.error("[CompElem]",e)}function c(e,t){console.error(`[CompElem <${e}>]`,t)}function u(e){return t.toPath(e).join("-")}function d(e){return Object.getPrototypeOf(e)}function p(e){let r=e;return t.isString(e)&&/(?:^true$)|(?:^false$)/.test(r)?r="true"===r:(t.isUndefined(r)||t.isBlank(r))&&(r=!0),r}!function(e){e[e.CSS=1]="CSS",e[e.COMPUTED=2]="COMPUTED"}(s||(s={})),function(e){e.PROPS="__deco_props",e.STATES="__deco_states",e.COMPUTED="__deco_computed",e.WATCH="__deco_watch",e.EVENTS="__deco_events"}(o||(o={})),function(e){e.Prod="prod",e.Dev="dev"}(i||(i={})),e.DecoratorType=void 0,(a=e.DecoratorType||(e.DecoratorType={})).CLASS="class",a.FIELD="field",a.METHOD="method";class h{static get priority(){return 0}}const f="getKey",g="__decorators",m=new WeakMap;class y{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(e,r,n){this.args=e,this.metadata=r,this.decoratorClass=n,this.priority=t.get(n,"priority",0),this.instanceMap=new WeakMap}create(r){let n,s=new this.decoratorClass(...this.args),o=s.targets,i=this.metadata[2];t.isObject(i)&&t.isDefined(t.get(i,"configurable"))?n=e.DecoratorType.METHOD:t.isUndefined(this.metadata[2])&&(n=e.DecoratorType.FIELD),!t.isEmpty(o)&&n&&o.includes(n)?(s.created(r,...this.metadata),this.instanceMap.set(r,s)):l(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${o.join(",")}' bug got '${n}'`)}beforeMount(e,t){this.instanceMap.get(e).beforeMount(e,t,...this.metadata)}mounted(e,t){this.instanceMap.get(e).mounted(e,t,...this.metadata)}updated(e,t){this.instanceMap.get(e).updated(e,t)}}const v=new WeakMap;function E(e){let r=(...r)=>(...n)=>{let s=n[0].constructor,o=s[g];if(!t.has(s,g)){let e=Object.getPrototypeOf(s);o=e?t.concat(e[g]??[]):[],Reflect.defineProperty(s,g,{configurable:!1,enumerable:!1,value:o})}let i,a={},l=e[f];if(l){let t=v.get(e);if(t||(t=new WeakMap,v.set(e,t)),a=t.get(s),a||(a={},t.set(s,a)),i=l(...r),a[i])return a[i]}let c=new y(r,n,e);return a[i]=c,o?.push(c),c};return m.set(r,!0),r}const b=new WeakMap;function T(e,r,n,s){let i;if(t.isLowerCaseChar(r[0])||l(`Prop '${r}' must be in CamelCase`),!t.has(e.constructor,o.PROPS)){const r={};let n=e.constructor;for(;(n=d(n))!==j;)t.merge(r,n[o.PROPS]?t.cloneDeep(n[o.PROPS]):{});Reflect.defineProperty(e.constructor,o.PROPS,{configurable:!1,enumerable:!1,value:r}),i=new Set,t.each(r,((e,r)=>{if(e.attribute){let e=t.kebabCase(r);i?.add(e)}})),b.set(e.constructor,i)}if(s&&(s.get&&(n.getter=s.get),s.set&&(n.setter=s.set)),n.attribute){i||(i=b.get(e.constructor));let n=t.kebabCase(r);i?.add(n)}t.has(e.constructor,"observedAttributes")||(e.constructor.observedAttributes=[]),e.constructor.observedAttributes=t.toArray(i),n.shallow=n.shallow||!1,e.constructor[o.PROPS][r]=n}const S=new Set;function N(e){return b.get(e)??S}const C={collectWatch(e,t,r){let n=D.get(e);n||(n={},D.set(e,n));let s=n[r];s||(s=n[r]=[]),s.push(t)},startCollect(e,t){this.__collectType=t,this.__collecting=e},setUpdater(e){this.__updater=e},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(e){let r=t.last(this.__directiveQ);const n=e?e.join(","):"",s=r?r.join(","):"";r&&n===s||(r&&r.length<e.length&&t.startsWith(n,s)?this.__directiveQ[this.__directiveQ.length-1]=e:this.__directiveQ.push(e))},popDirectiveQ(){let e=t.concat(this.__directiveQ);return this.__directiveQ=[],e},startRender(e){this.__renderCollecting=!0,this.__renderContext=e},endRender(e){this.__renderCollection.forEach((t=>{e._regDeps(t,this.__renderContext)})),this.__renderCollection.clear(),this.__renderCollecting=!1,this.__renderContext=null},collect(e){this.__renderCollection.add(e)},clear(){this.__directiveQ=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},_=new WeakMap,P=new WeakMap,A=new WeakMap,w=new WeakMap,D=new WeakMap,k=new WeakSet;function M(e,n){if(!t.isObject(e))return e;const i=k.has(e)?e:new Proxy(e,{get(e,r,n){if(!r)return;const i=Reflect.get(e,r,n);if("string"!=typeof r&&"number"!=typeof r)return i;let a=r in e;if((C.__renderCollecting||C.__collecting)&&(a&&e.hasOwnProperty(r)||!a)){let e=P.get(n)??[],a=t.concat(e,[r]);if(a.length>1){let e=_.get(n).from,r=t.get(e.constructor,o.PROPS),s=t.get(e.constructor,o.STATES);if(t.get(r,[a[0],"shallow"])||t.get(s,[a[0],"shallow"]))return i}let l=a.join("-");if(C.__renderCollecting)C.collect(u(a)),C.setDirectiveQ(a);else if(C.__collecting){let e;switch(C.__collectType){case s.COMPUTED:e=A.get(C.__collecting),e||(e={},A.set(C.__collecting,e));break;case s.CSS:e=w.get(C.__collecting),e||(e={},w.set(C.__collecting,e))}let t=e[l];t||(t=e[l]=[]),t.push(C.__updater)}}return i},set(e,n,s,i){if(!n)return!1;let a=e[n];if(!t.isObject(a)&&a===s)return!0;if(Number.isNaN(s)&&Number.isNaN(a))return!0;let l=P.get(i)??[],c=t.concat(l,[n]),u=_.get(i).from,d=t.get(u.constructor,o.PROPS),p=t.get(u.constructor,o.STATES),h=t.get(d,[c[0],"hasChanged"])||t.get(p,[c[0],"hasChanged"]);if(h){if(!h.call(u,s,a))return!0}else if(a===s&&!r.has(a))return!0;d&&d[n]&&e.__isData&&d[n].sync&&u.emit("update:"+n,{value:s});let f=_.get(i)?.contextSet,g=s;!t.isObject(s)||t.isFunction(s)||s instanceof Node||Object.isFrozen(s)||f.forEach((e=>{let r=_.get(i)?.pathMap,s=r?.get(e);s&&(c=t.concat(s,[n]),P.set(g,c),g=M(g,e),k.add(g),P.set(g,c))}));let m=Reflect.set(e,n,g),y=_.get(i).pathMap;return f.forEach((e=>{let r=y.get(e);if(!r)return;e===u&&l.length>1&&r.length>1&&l[0]===r[0]&&(r=l),c=t.concat(r,"length"==n&&t.isArray(i)?[]:[n]);let s=A.get(e),o=w.get(e),d=D.get(e);if(s||o||d){let e=c.length;for(;e;){let r=c.slice(0,e).join("-");if(d){const n=d[r];e===c.length?n?.forEach((e=>{let t=e();t.ov=a,x.pushWatch(t)})):n?.forEach((e=>{let r=e();t.get(r,"deep")&&(r.ov=a,x.pushWatch(r))}))}if(s){let e=s[r];if(!t.isEmpty(e))for(let t=0;t<e.length;t++){const r=e[t];x.pushComputed(r)}}if(o){let e=o[r];if(!t.isEmpty(e))for(let t=0;t<e.length;t++){const r=e[t];x.pushCss(r)}}e--}}let p=e._notify(a,c);x.pushNext(p,e.cid)})),m}});k.has(i)||k.add(i);let a=P.get(e)??[];if(Object.isExtensible(e)&&!_.get(i)){let e=new Set;e.add(n);let t=new WeakMap;t.set(n,a),_.set(i,{from:n,contextSet:e,pathMap:t})}else{_.get(i).contextSet.add(n);let e=_.get(i).pathMap,r=e.get(n),s=t.concat(a);if(r&&r.join("")!==s.join("")){let e=t.get(n,t.initial(r));t.isArray(e)||function(...e){console.warn("[CompElem]",...e)}(`The object is referenced by more than one @state '${s.join(".")},${r.join(".")}'`),r=s}else e.set(n,s)}let l=t.get(n.constructor,o.PROPS),c=t.get(n.constructor,o.STATES);for(let r in e){const s=e[r];let o=t.get(l,[r,"shallow"])||t.get(c,[r,"shallow"]);!t.isObject(s)||k.has(s)||t.isFunction(s)||s instanceof Node||Object.isFrozen(s)||o||(P.set(s,t.concat(a,[r])),e[r]=M(s,n),k.add(e[r]),P.set(e[r],t.concat(a,[r])))}return i}const O=new Map;class x{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){x.nextPending=!1;let e=Array.from(x.watchSet);x.watchSet.clear();let r=Array.from(x.computedSet);x.computedSet.clear();let n=Array.from(x.cssSet);x.cssSet.clear();let s=Array.from(x.nextSet);x.nextSet.clear(),e.forEach((e=>e(t.get(e,"ov")))),r.forEach((e=>e())),n.forEach((e=>e())),s.forEach((e=>e())),O.clear()}static pushWatch(e){x.watchSet.add(e)}static pushComputed(e){x.computedSet.add(e)}static pushCss(e){x.cssSet.add(e)}static pushNext(e,t){if(t){if(O.has(t))return;O.set(t,e)}x.nextSet.add(e),x.nextPending||(x.nextPending=!0,x.next())}}(()=>{const e=Promise.resolve(),t=x.flush;x.next=()=>{e.then(t)}})();const R={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},L=new WeakMap;let U=[],W=0;const H=new Map,$=new WeakMap;class j extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(e){U=t.flatMap(e.css,(e=>{if(t.isString(e)){let t=new CSSStyleSheet;return t.replaceSync(e),t}return e instanceof CSSStyleSheet?e:[]})),e.global,t.each(e,((e,r)=>{t.test(r[0],/[A-Z]/)}))}#e;#t={};#r={"#slots":{}};#n={};#s={};#o;#i={};__events={};get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#e}get reactiveData(){return this.#n}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#u}get parentComponent(){return this.#d}get wrapperComponent(){return this.#p}get slotHooks(){return this.#h}get css(){return L.get(this.constructor)}get globalStyleSheet(){return H.get(this.constructor)?.sheet}get isMounted(){return this.#f}get slots(){return this.#r["#slots"]}#a;#l;#c;#u;#d;#p;#g={};#h={};#m={};#f=!1;static get styles(){return[]}static get globalStyles(){return[]}static get hostStyles(){return[]}get styles(){return[]}#y=!1;#v=!1;constructor(...e){super(),this.#e=W++,1===t.size(e)&&(this.#l={},t.assign(this.#l,t.first(e)));let r=this.render.bind(this);this.render=function(){let e;return C.startRender(this),e=r(),C.endRender(this),e};let n=t.get(this.constructor,"globalStyles"),s=H.has(this.constructor);if(!t.isEmpty(n)&&!s){let e="";n.forEach((r=>{t.isString(r)&&(e+=r+"\n")}));let r=document.createElement("style");r.textContent+=e,H.set(this.constructor,r),document.head.appendChild(r)}let o=L.get(this.constructor),i=o??[];o||(t.each(t.get(this.constructor,"styles"),(e=>{if(t.isString(e)){let t=new CSSStyleSheet;t.replaceSync(e),i.push(t)}else i.push(e)})),L.set(this.constructor,i)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...U,...i],this.#E();let a=t.get(this.constructor,g);a&&a.sort(((e,t)=>t.priority-e.priority)).forEach((e=>e.create(this))),this.#b=this.#T.bind(this)}#b;connectedCallback(){let e=t.closest(this.parentNode,(e=>e instanceof j||e.host instanceof j),"parentNode");this.#d=e?e instanceof j?e:e.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#y)return;if(this.#v)return;this.#v=!0,this.#E();const e=this.#S();this.propsReady(e);for(const t in e){const r=e[t];this.#r[t]=r}this.#N(),t.each(this.#r,((e,t)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,t);Reflect.defineProperty(this,t,{get(){let e=Reflect.get(this.#n,t);return r?.get?r?.get():e},set(e){r?.set?r?.set(e):Reflect.set(this.#n,t,e)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=M(this.#r,this);let r=t.get(this.constructor,o.COMPUTED);t.each(r,((e,t)=>{C.startCollect(this,s.COMPUTED),C.setUpdater((()=>{this.#n[t]=e.call(this)})),this.#r[t]=e.call(this),C.endCollect(),Reflect.defineProperty(this,t,{get(){return Reflect.get(this.#n,t)},set(e){c(this.tagName,"Cannot set a computed property '"+t+"'")}})}));let n=t.get(this.constructor,o.WATCH);t.each(n,((e,r)=>{e.forEach((e=>{let{source:n,options:s,handler:o}=e,i=o.bind(this);t.get(s,"once",!1)&&(i=t.once(i));const a=function(e){let r=t.get(this,n.replaceAll("-","."));i(r,e,n)}.bind(this);let l=t.get(s,"deep",!1);if(a.deep=l,C.collectWatch(this,(()=>a),r),!t.get(s,"immediate",!1))return;let c=t.get(this,n.replaceAll("-","."));i(c,c,n)}))}));let i=function(e,r){let n,s=[];if(Oe.has(r.constructor)){let o=Oe.get(r.constructor),i=function(e,r){let n=t.concat(r.vars),s=r.strings.length-1;for(let o=0;o<=s;o++){let s=t.get(r.vars,o,"");if(s instanceof Ze){let[t,r]=Ie(e,s);n.splice(o,1,...r)}}return n}(r,e);n=xe.has(r.constructor)?function(e,r,n){let s=xe.get(n.constructor)?.cloneNode(!0),o=Re.get(n.constructor);const i=document.createNodeIterator(s,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let a,l,c=0,u=0;for(;a=i.nextNode();){let s;if(u++,l&&!l.contains(a)&&(l=void 0),a instanceof HTMLElement||a instanceof SVGElement){a instanceof j&&(l=a);let i={};o[u].forEach((o=>{let u=r[c++];switch(o.type){case Le.Event:s=t.clone(o.up),o.value||c--,o.value&&Te(o.name,u.bind(n),a,n),a.removeAttribute(o.attrName);break;case Le.AttrSlot:l&&o.name,a.removeAttribute(o.attrName);break;case Le.Ref:s=t.clone(o.up),u.current=a,a.removeAttribute(o.attrName);break;case Le.AttrKey:s=t.clone(o.up),a.setAttribute(we,u);break;case Le.AttrBool:s=t.clone(o.up),s.value=!!u,s.node=a,s.value&&a.setAttribute(o.name,""),a.removeAttribute(o.attrName);break;case Le.AttrProp:s=t.clone(o.up),s.value=u,s.node=a,i[o.name]=u;break;case Le.AttrRef:case Le.Attr:s=t.clone(o.up),s.value=u,s.node=a,a.setAttribute(o.attrName,u),Le.AttrRef===o.type&&a.removeAttribute(o.name);break;case Le.DirectiveAttr:case Le.DirectiveTag:case Le.DirectiveProp:s=t.clone(o.up),s.value=u,s.node=a;let e=t.clone(o.point);e.startNode=a;let[r,d,p,h,f]=u,g=Ve.get(a);if(g||(g={},Ve.set(a,g)),g[o.attrName??Symbol.keyFor(r)]=[e,n,l],p(e,d,void 0,{renderComponent:n,slotComponent:l,varChain:f}),Le.DirectiveAttr===o.type){let e=a.getAttribute(o.attrName);e=t.replace(e,ze,""),a.setAttribute(o.attrName,e)}o.name&&a.removeAttribute(o.name)}s&&e.push(s)})),a instanceof j?(a._initProps(i),a._regWrapper(n)):a instanceof HTMLSlotElement&&n._bindSlot(a,a.name||"default",i)}else{o[u].forEach((o=>{let i=r[c++];switch(o.type){case Le.DirectiveSlot:case Le.DirectiveText:s=t.clone(o.up),s.value=i,s.node=a;let[e,r,c,u,d]=i,p=Symbol.keyFor(e),h=document.createComment(`compelem-${n.tagName}-${p}-start`);s.textNode=h,a.parentNode.insertBefore(h,a),a.nodeValue=`compelem-${n.tagName}-${p}-end`;let f=t.clone(o.point);f.startNode=h,f.endNode=a,$e.set(a,[f,n,l,r,d]),He.set(a,c),je.set(a,s),C.startRender(a);let g=c(f,r,void 0,{renderComponent:n,slotComponent:l,varChain:d});C.endRender(n);let m=Ke(a,g[1],n);m&&m.length>0&&Xe.insertBefore(a,Array.from(m));break;case Le.Text:s=t.clone(o.up),s.node=a;let y=t.toString(i??""),v=document.createTextNode(y);a.replaceWith(v),s.textNode=v}s&&e.push(s)}))}}return s.childNodes}(s,i,r):Ge(s,o,i,r)}else{let[t,o]=Ie(r,e);Oe.set(r.constructor,t),n=Ge(s,t,o,r)}return Ue.set(r,s),n}(this.render(),this);i&&(this.#o.append(...i),this.#u=t.filter(this.#o.childNodes,(e=>e.nodeType===Node.ELEMENT_NODE)),this.#c=this.#u[0]),t.each(this.#h,((e,t)=>{this.#C(t)}));const a=this;let l=t.get(this.constructor,g);l&&l.sort(((e,t)=>t.priority-e.priority)).forEach((e=>{e.beforeMount(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}));let u=t.get(this.constructor,"hostStyles"),d=this.#p?.shadowRoot??this.ownerDocument,p=$.get(d);if(!p?.includes(this.constructor)&&u.length>0){let e=[];t.each(u,(r=>{if(t.isString(r)){let t=new CSSStyleSheet;t.replaceSync(r),e.push(t)}else e.push(r)})),d.adoptedStyleSheets=[...d.adoptedStyleSheets,...e],p?.push(this.constructor)}this.beforeMount();let h=t.get(this.constructor,o.EVENTS);h&&h.forEach((async e=>{let r=e.name,n=t.assign({target:document,once:!1,passive:!1,capture:!1},e.options),s=t.bind(e.fn,this),o=n.target;t.isFunction(o)&&(o=await o.call(this,this)),o?o.addEventListener(r,s,n):c(this.tagName,"The target of @event('"+r+"',...) is invalid")})),C.startCollect(this,s.CSS);let f=[];this.styles.forEach((e=>{if(!t.isFunction(e))return;let r=new CSSStyleSheet;f.push(r),C.setUpdater((()=>{let t=e()??"";r.replaceSync(t)}));let n=e();t.isBlank(n)||r.replaceSync(n)})),C.endCollect(),f.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...f]),setTimeout((()=>{this.#f=!0,this.mounted(),l&&l.forEach((e=>{e.mounted(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}))}),0),this.#y=!0}propsReady(e){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#_(e,r){this.#E();let n=t.get(this.#t[r],"props");n&&t.each(this.slots,((e,r)=>{e.filter((e=>e.nodeType===Node.ELEMENT_NODE)).forEach((e=>{e instanceof j?e._updateProps(n):t.each(n,((r,n)=>{if(e instanceof HTMLSlotElement){let s=t.get(e,"__l_comp");if(s){let t=e.name||"default",o=s.#t[t];o||(o=s.#t[t]={props:{}}),o.props||(o.props={}),o.props[n]=r,s.#_(e,t)}}else e.setAttribute(n,r)}))}))})),this.slotChange(e,r)}slotChange(e,t){}attributeChangedCallback(e,t,r){this.#P(e,t,r)}shouldUpdate(e){return!0}updated(e){}#A={};_notify(e,n){let s=[];for(let o=0;o<n.length;o++){const i=n[o];s.push(i);let a=t.get(this,s),l=u(s);this.#s[l]={value:a,chain:"slots"===l?["slots"]:s,oldValue:e,end:s.length===n.length},t.isObject(a)&&"#"!=l[0]&&r.set(a,l)}return this.#b}#T(){if(t.size(this.#s)<1)return;const e=this.#s;this.#s={};let n=t.get(this.constructor,g);if(n&&n.sort(((e,t)=>t.priority-e.priority)).forEach((t=>{t.updated(this,e)})),!this.shouldUpdate(e))return;let s=new Set;t.each(e,(({value:e,chain:t,oldValue:r,end:n},o)=>{this.#i[o]&&this.#i[o].forEach((e=>{s.add(e)}))})),s.forEach((e=>{e===this?Qe(this.render(),this):qe(e,this)})),this.#w.forEach((e=>{this.#C(e)})),this.updated(e),t.each(e,(({value:e,chain:n,oldValue:s},o)=>{t.isObject(e)&&r.has(e)&&r.delete(e)}))}#S(){let e=t.get(this.constructor,o.PROPS),r=this.attributes,n=this.tagName,s=this.#l,i={};t.each(r,(({name:r,value:n})=>{if(r[0]===Se||r[0]===Ne||r[0]===Ce||r===Ae||"slot"===r)return;let s=t.camelCase(r);e&&!e[s]&&(i[r]=n)})),this.#a=this.#a?t.assign(this.#a,i):i;let a={};if(!e)return Object.seal(a);let l=Object.keys(e),u=l.length;for(let o=0;o<u;o++){const i=l[o];let u,h=e[i],f=t.has(s,i),g=t.get(this,i);if(!("_defaultValue"in h)&&(h._defaultValue=g,!h.type)){t.isUndefined(g)&&c(n,"Prop '"+i+"' has neither propType nor defaultValue be used for type inference");let e=typeof g;t.isArray(g)&&(e="array");let r=R[e];h.type=r}if(f)u=t.isNil(s[i])?g:s[i];else{u=g;let e=r.getNamedItem(t.kebabCase(i))||r.getNamedItem(Ne+t.kebabCase(i));e&&(f=!0,u=e.value)}if(h.required&&!f){c(n,"Prop '"+i+"' is required");break}u=this.#D(e,i,u);let m=t.get(e,[i,"getter"]);m&&(m=t.bind(m,this));let y=t.get(e,[i,"setter"]);if(y&&(y=t.bind(y,this)),(m||y)&&Reflect.defineProperty(this.#r,i,{set:y||function(e){},get:m}),h.attribute&&t.isDefined(u)&&!t.isObject(u)){let e=t.kebabCase(i),r=t.trim(u);(d=h.type)===Boolean||t.some(d,(e=>e===Boolean))?(r=p(u),t.isBoolean(r)?this.toggleAttribute(e,r):this.setAttribute(e,r)):this.setAttribute(e,r)}this.#r[i]=u,a[i]=u}var d;return Object.seal(a)}#k(e,r){let n=e;try{for(let s=0;s<r.length;s++){const o=r[s];n=o===Boolean?p(e):o===Number?Number(e):o===String?String(e):o===Object||o===Array?t.parseJSON(e):o===Date?new Date(e):new o(e)}}catch(t){c(this.tagName,"Convert attribute error with "+e)}return n}#D(e,r,n){let s=e[r];if(!s)return n;let o=s.isValid,i=s.type,a=t.isArray(i)?i:[i],l=s.converter,u=n;if(!t.some(a,(e=>e===String))&&t.isString(u)&&!t.isNull(u))try{u=l?l(u):this.#k(u,a)}catch(e){c(this.tagName,`Convert attribute '${r}' error with `+u)}for(let e=0;e<a.length;e++){"Boolean"===a[e].name&&(u=p(u))}let d=typeof u,h=!t.isDefined(u);for(let e=0;e<a.length;e++){const r=a[e];if(t.test(d,r.name,"i")||u instanceof r||Object.prototype.toString.call(u)===Object.prototype.toString.call(r.prototype)){h=!0;break}}return h||c(this.tagName,`Invalid prop '${r}'. expected '${a.map((e=>e.name||e))}' but got '${d}'`),o&&(o.call(this,u,this.#r)||c(this.tagName,`Invalid prop '${r}'. IsValid() check failed`)),u}#N(){let e=t.get(this.constructor,o.STATES);t.each(e,((r,n)=>{let s=e[n],o=t.get(this,n);if(s){let e=s.prop;o=e?t.cloneDeep(this.#r[e]):t.get(this,n)}this.#r[n]=o}))}#M=t.debounce(this.propsReady,100);_setParentProps(e,r){if(this.#y){let n=t.get(this.constructor,o.PROPS);t.each(e,((e,r)=>{let s=t.camelCase(r),o=n[s];if(!o)return;let i=this.#r[s];e=this.#D(n,s,e),o.hasChanged&&!o.hasChanged.call(this,e,i)||(this.#r[s]=e,this._notify(i,[s]))})),t.assign(this.#l,e),t.assign(this.#a,r),this.#M(this.#l)}}_updateProps(e){let r=t.get(this.constructor,o.PROPS);t.each(e,((e,n)=>{let s=t.camelCase(n);r[s]&&(e=this.#D(r,s,e),C.__skipCheck=!0,t.set(this,s,e),C.__skipCheck=!1)})),t.assign(this.#l,e),this.#M(this.#l)}_initProps(e,r){this.#l=t.merge(this.#l||{},e),this.#a=t.merge(this.#a||{},r)}_bindSlot(e,r,n){if(this.#g[r]||(this.#g[r]=e,Reflect.defineProperty(e,"__l_comp",{value:this})),e.addEventListener("slotchange",(t=>{this.#y&&this.#_(e,"default"===r?"":r)})),!t.isEmpty(n)){let e=this.#t[r];e||(e=this.#t[r]={}),e.props=n}}_bindSlotHook(e,t){this.#h[e]=t}#w=new Set;_updateSlot(e,t,r){let n=this.#g[e],s=this.#h[e];if(!s&&!n)return;let o=this.#t[e];if(t&&(o.props||(o.props={}),o.props[t]=r),s)this.#w.add(e);else{let e=n.assignedElements({flatten:!0});for(let n=0;n<e.length;n++){e[n].setAttribute(t,r+"")}}}#E(){const e=t.flatMap(this.childNodes,(e=>e.nodeType===Node.COMMENT_NODE?[]:e instanceof HTMLSlotElement?e.assignedNodes({flatten:!0}):e));let r=t.groupBy(e,(e=>e.nodeType===Node.TEXT_NODE?"default":e instanceof Element?e.getAttribute("slot")||"default":void 0));if(t.isEmpty(r))return void(t.isEmpty(this.#r["#slots"])||(this.#y?this.#n["#slots"]={}:this.#r["#slots"]={}));t.each(r,((e,r)=>{if(r){for(;e.length>0;){let r=e[0];if(!(r.nodeType===Node.TEXT_NODE&&t.isBlank(r.textContent)||r instanceof HTMLSlotElement&&t.isEmpty(r.assignedNodes({flatten:!0}))))break;e.shift()}for(;e.length>0;){let r=t.last(e);if(!(r.nodeType===Node.TEXT_NODE&&t.isBlank(r.textContent)||r instanceof HTMLSlotElement&&t.isEmpty(r.assignedNodes({flatten:!0}))))break;e.pop()}}}));let n={};t.each(r,((e,r)=>{t.isEmpty(e)||(n[r]=e)})),this.#y?this.#n["#slots"]=n:this.#r["#slots"]=n}#C(e){let r=this.#h[e];if(!r)return;let n=this.#t[e];if(!this.#r["#slots"][e])return;this.renderAsync(r,t.get(n,"props"));const s=this._asyncDirectives.get(r);let o=s?.buildView(r(t.get(n,"props"))),i=t.reject(t.toArray(o),(e=>e.nodeType===Node.COMMENT_NODE));if(i){let r=this.#m[e];if(!t.isEmpty(r))for(let e=0;e<r.length;e++){const t=r[e];t.parentNode?.removeChild(t)}this.#m[e]=i,this.append(...i),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(e,...t){}#P(e,r,n){if(!this.#y)return;if(N(this.constructor).has(e)){let r=t.camelCase(e);if(t.isNull(n)){n=t.get(this.constructor,o.PROPS)[r]._defaultValue}this._updateProps({[r]:n})}}_regDeps(e,t){let r=this.#i[e];r||(r=this.#i[e]=new Set),r.add(t);let n=e.split("-");if(n.pop(),n.length<1)return;let s=n.join("-");r=this.#i[s],r||(r=this.#i[s]=new Set),r.add(t)}_regWrapper(e){this.#p=e}emit(e,r={},n){n&&n.event&&(r.event=n.event),r.target=this,this.dispatchEvent(new CustomEvent(e,{bubbles:t.get(n,"bubbles",!1),composed:t.get(n,"composed",!1),cancelable:!0,detail:r}))}on(e,t){this.#A[e]||(this.#A[e]=[]);let r=t.bind(this);this.#A[e].push(r),this.addEventListener(e,r)}nextTick(e,t){x.pushNext(e,t)}forceUpdate(){t.each(this.#n,((e,t)=>{this.#s[t]={value:void 0,chain:void 0}})),this.#T()}}var V,I,B;e.EnterPointType=void 0,(V=e.EnterPointType||(e.EnterPointType={})).ATTR="attr",V.PROP="prop",V.TEXT="text",V.CLASS="class",V.STYLE="style",V.SLOT="slot",V.TAG="tag",e.DirectiveUpdateTag=void 0,(I=e.DirectiveUpdateTag||(e.DirectiveUpdateTag={})).NONE="NONE",I.REMOVE="REMOVE",I.REPLACE="REPLACE",I.UPDATE="UPDATE",I.APPEND="APPEND";class F{key;varIndex;value;isText=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;notUpdated;constructor(e,t,r,n){this.varIndex=e,this.node=t,r&&(this.attrName=r),n&&(this.attrTmpl=n)}}class z{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(e,t,r){this.startNode=e,this.attrName=t,this.type=r}setVarIndex(e){this.varIndex=e}getNodes(){let e=this.startNode.nextSibling;if(!this.endNode)return[e];let t=[];for(;e&&e!==this.endNode;)t.push(e),e=e?.nextSibling;return t}}!function(e){e.AFTER_BEGIN="afterbegin"}(B||(B={}));const G={};function K(r,n,s,o,i,a,c,u=!1){let d;if(u?(C.startRender(r.endNode),d=o(r,n,s,{renderComponent:i,slotComponent:a,varChain:c}),C.endRender(i)):d=o(r,n,s,{renderComponent:i,slotComponent:a,varChain:c}),!d)return;let[p,h]=d;if(p===e.DirectiveUpdateTag.NONE)return;let f=r.getNodes();if(p===e.DirectiveUpdateTag.REMOVE)for(let e=0;e<f.length;e++){const t=f[e];t.parentNode?.removeChild(t)}else if(p===e.DirectiveUpdateTag.REPLACE){let e=[];for(let e=0;e<f.length;e++){const t=f[e];t.parentNode?.removeChild(t)}let n=Ke(r.endNode,h,i);e=t.toArray(n);let s=document.createDocumentFragment();s.append(...e),r.endNode.parentNode.insertBefore(s,r.endNode)}else if(p===e.DirectiveUpdateTag.UPDATE){let e,n={},s=[],o=[],a=We.get(r.endNode);if(h||(h=new Ze([],[])),t.isEmpty(f)){let e=Ke(r.endNode,h,i);return void r.startNode.after(...e)}let c={};h instanceof Ze&&h.vars.forEach((e=>{if(e instanceof Ze){const t=e.getKey();c[t]=e,n[t]=!0,o.push(t)}})),f=t.filter(t.compact(f),(e=>e.nodeType===Node.ELEMENT_NODE)),e=t.filter(t.compact(t.toArray(e)),(e=>e.nodeType===Node.ELEMENT_NODE));let u={},d="",p={};for(let e=0;e<f.length;e++){let t=f[e],r=t.getAttribute("key");if(r){if(u[r]){d=r;break}u[r]=t,s.push(r),p[r]=!0}}if(d)return void l(`${t.camelCase(r.endNode._diName)} - duplicate key '${d}'`);let g=n;const m=r.startNode.parentNode;let y=[],v=[];t.each(p,((e,r)=>{g[r]||(v.push(r),delete p[r],t.remove(s,(e=>e===r)))}));let E,b=!1;if(!t.isEmpty(o)){let e=-1,n=[],i=[],a=0,l=0;for(;l<o.length;l++){const c=o[l];let d=s.findIndex((e=>e===c));if(d<0){let e=o[l-1],t=e?u[e]||e:r.startNode;y.push({prevNode:t,newkey:c}),a++}else if(d>-1&&d!==l-a){if(e<0||1===Math.abs(e-d)){let e=t.last(n);n.push({nodeId:c,targetId:0===l?B.AFTER_BEGIN:e?e.nodeId:o[l-1]})}else i.push({moveGroup:n,moveIndex:l+n.length}),n=[],n.push({nodeId:c,targetId:o[l-1]});e=d}}if(n.length>0&&i.push({moveGroup:n,moveIndex:l+n.length}),i.length>0){b=!0;let e=i.sort(((e,t)=>e.moveGroup.length-t.moveGroup.length));if(e.length<2){let{moveGroup:n}=e[0];if(n.length>1){let e=t.last(n).targetId;n[n.length-2].nodeId===e&&(n=t.initial(n))}n.forEach((({targetId:e,nodeId:t})=>{let n,s=u[t];e===B.AFTER_BEGIN?(n=r.startNode,n.after(s)):(n=u[e],n.after(s))}))}else{let n=t.last(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-n)&&(e=t.initial(e)),e.forEach((({moveGroup:e})=>{e.forEach((({targetId:e,nodeId:t})=>{let n,s=u[t];e===B.AFTER_BEGIN?(n=r.startNode,n.after(s)):(n=u[e],n.after(s))}))}))}}}if(y.length>0&&(E=function(e,r,n,s,o,i){const a=[],l=[],c=[];let u,d=[];e.forEach((e=>{let n=t.last(d);n&&u===e.prevNode?(n.group||(n.group=[u]),n.group.push(e.newkey)):d.push(e),u=e.newkey;let s=e.newkey;c.push(s),a.push(""),l.push(r[s])})),a.push("");let p=new Ze(a,l),h=[...o],f=Ke(i,p,s),g=We.get(i);o.length=0,o.push(...g);let m=new Map;return f.forEach((e=>{const t=e.getAttribute("key");c.includes(t)&&(m.set(t,!0),G[t]=e)})),h.forEach(((e,t)=>{const r=e.key+"";!m.get(r)&&n.includes(r)&&o.push(e)})),d}(y,c,o,i,a,r.endNode),E.forEach(((e,n)=>{let s=e.newkey,o=G[s],i=e.prevNode;if(e.group){let r=document.createDocumentFragment();r.append(...t.map(e.group,(e=>G[e]))),o=r}i===r.endNode?i.before(o):i===r.startNode?i.after(o):"string"==typeof i?G[i].after(o):i.after(o)}))),v.forEach((e=>{let t=u[e];t&&t.parentNode&&m.removeChild(t)})),h.vars[0]instanceof Ze){let e=[],r=[];t.each(h.vars,(n=>{r.push(...n.vars),e.push(...t.map(n.vars,(e=>"1")))})),e.push("1"),h=new Ze(e,r)}if(b||v.length>0||E){const e=t.groupBy(a,(e=>e.key));let r=[],n=0;o.forEach((t=>{e[t].forEach((e=>{e.varIndex=n++,r.push(e)}))})),a=r}qe(r.endNode,i,h,a)}}let Q=0;function q(e,r){let n=e.name||"Di-"+Q++,s=Symbol.for(n);return(...n)=>{let o=e(...n);return[s,n,o,e=>{process.env.DEV&&(t.isEmpty(r)||t.test(r.join(","),e)||l(`Directive '${Symbol.keyFor(s)}' is out of scopes, expect '${r.join(",")}' bug got '${e}'`))},C.popDirectiveQ()]}}const X=["resize","outside","mutate"],Y=new WeakMap,J=[],Z=[],ee=[],te=new ResizeObserver((e=>{for(const t of e){const e=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize,r=Array.isArray(t.borderBoxSize)?t.borderBoxSize[0]:t.borderBoxSize;let n=Y.get(t.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:e.inlineSize,h:e.blockSize}}}),t.target)}}}));var re;!function(e){e.Child="child",e.Tree="tree",e.Attr="attr",e.Char="char"}(re||(re={}));const ne=new WeakMap,se=new MutationObserver((e=>{for(let t=0;t<e.length;t++){const r=e[t];let n=ne.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=re.Tree,o=n[re.Tree];break;case"childList":s.type=re.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[re.Child];break;case"attributes":s.type=re.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[re.Attr];break;case"characterData":s.type=re.Char,s.oldValue=r.oldValue,o=n[re.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function oe(e,r,n,s){if("resize"===e)!function(e,t){Y.has(e)||(Y.set(e,t),te.observe(e))}(r,n);else if("outside"===e)switch(s[0]){case"mousedown":!function(e,t){J.push([e,t])}(r,n);break;case"dblclick":!function(e,t){ee.push([e,t])}(r,n);break;default:!function(e,t){Z.push([e,t])}(r,n)}else"mutate"===e&&function(e,r,n){let s=t.includes(n,"child"),o=t.includes(n,"attr"),i=t.includes(n,"char"),a=t.includes(n,"tree"),l=ne.get(e);l||(l={},ne.set(e,l),s&&(l[re.Child]=r),o&&(l[re.Attr]=r),i&&(l[re.Char]=r),a&&(l[re.Tree]=r),se.observe(e,{childList:s,attributes:o,characterData:i,subtree:a}))}(r,n,s)}document.addEventListener("mousedown",(e=>{let r=t.get(e.composedPath(),0,e.target);J.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1),document.addEventListener("click",(e=>{let r=t.get(e.composedPath(),0,e.target);Z.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1),document.addEventListener("dblclick",(e=>{let r=t.get(e.composedPath(),0,e.target);ee.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1);const ie=/,|^(debounce:.+)|(debounce$)/,ae=/,|^(throttle:.+)|(throttle$)/,le="self",ce="stop",ue="prevent",de="once",pe="left",he="right",fe="middle",ge="ctrl",me="alt",ye="shift",ve="meta",Ee={esc:"escape"},be=":";function Te(e,r,n,s){let o,i=e.split("."),a=i.shift(),l=i.includes(de),c=r;if(o=t.find(i,(e=>ie.test(e)))){let e=o.split(be);c=t.debounce(c,parseInt(e[1])||100)}if(o=t.find(i,(e=>ae.test(e)))){let e=o.split(be);c=t.throttle(c,parseInt(e[1])||100)}if(l&&(c=t.once(c)),function(e){return X.includes(e)}(a))return oe(a,n,c,i),c;let u=e=>{if(i.includes(ue)&&e.preventDefault(),i.includes(ce)&&e.stopPropagation(),!i.includes(le)||e.target===e.currentTarget){if(e instanceof MouseEvent){if(i.includes(pe)&&0!=e.button)return;if(i.includes(he)&&2!=e.button)return;if(i.includes(fe)&&1!=e.button)return}else if(e instanceof KeyboardEvent){if(t.remove(i,(e=>e==ge))[0]&&!e.ctrlKey)return;if(t.remove(i,(e=>e==me))[0]&&!e.altKey)return;if(t.remove(i,(e=>e==ye))[0]&&!e.shiftKey)return;if(t.remove(i,(e=>e==ve))[0]&&!e.metaKey)return;if(!t.map(i,(e=>Ee[e]||e)).includes(e.key.toLowerCase()))return}c(e)}};n.addEventListener(a,u);let d=s.__events[a];return d||(d=s.__events[a]=[]),d.push([n,u]),u}const Se="@",Ne=".",Ce="?",_e="*",Pe=":",Ae="ref",we="key",De=/[.?-a-z]+\s*=\s*(['"])\s*([^='"]*<\!--c_ui-pl_df-->){2,}.*?\1/ims,ke=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,Me="slot-props",Oe=new Map,xe=new Map,Re=new Map;var Le;!function(e){e.Event="event",e.Directive="directive",e.DirectiveTag="directiveTag",e.DirectiveAttr="directiveAttr",e.DirectiveProp="directiveProp",e.DirectiveText="directiveText",e.DirectiveSlot="directiveSlot",e.Attr="attr",e.AttrProp="attrProp",e.AttrBool="attrBool",e.AttrRef="attrRef",e.AttrSlot="attrSlot",e.AttrKey="key",e.Ref="ref",e.Text="text"}(Le||(Le={}));const Ue=new WeakMap,We=new WeakMap,He=new WeakMap,$e=new WeakMap,je=new WeakMap,Ve=new WeakMap;function Ie(e,r){let n="",s=t.concat(r.vars),o=r.strings.length-1,i=r.vars.length-1,a=0;for(let l=0;l<=o;l++){const o=r.strings[l];let c=t.get(s,a,"");if(c instanceof Ze){let[t,r]=Ie(e,c);c=t,s.splice(a,1,...r),a+=r.length-1}else c=l>i?"":Be;a++,n=n+o+c}if(process.env.DEV){let e=n.match(De);if(e){return l(`Parse error: attribute value can be set only one interpolation —— \n ${t.replaceAll(e[0],Be,"${...}")}`),["",s]}}let c=0;return n=n.replace(ke,((e,r)=>t.replaceAll(e,Be,(()=>Be.replace("--\x3e","")+c++)))),n=n.replace(Je,"$1><").trim(),[n,s]}const Be="\x3c!--c_ui-pl_df--\x3e",Fe="\x3c!--c_ui-pl_df",ze=/<!--c_ui-pl_df\d*(-->)?/;function Ge(r,n,s,o,i=!1){const a=document.createElement("div");a.innerHTML=n;const l=Re.has(o.constructor);i||!l||xe.has(o.constructor)||xe.set(o.constructor,a.cloneNode(!0));let u=0;const d=document.createNodeIterator(a,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let p,h,f=0,g=l?void 0:{},m=null,y="";for(;p=d.nextNode();){u++;let n=l?void 0:[];if(h&&!h.contains(p)&&(h=void 0),p instanceof HTMLElement||p instanceof SVGElement){p instanceof j&&(h=p);let i={},a=t.toArray(p.attributes);for(let l=0;l<a.length;l++){const u=a[l];let{name:d,value:g}=u;if(d!==Me)if(t.startsWith(d,Fe)){let i=s[f];if(t.isArray(i)&&t.isSymbol(i[0])){let[,t,s,a,l]=i;a(e.EnterPointType.TAG);let c=new z(p,d.substring(1),e.EnterPointType.TAG),u=Ve.get(p);u||(u={},Ve.set(p,u)),u[Symbol.keyFor(i[0])]=[c,o,h];let g=new F(f,p);g.isDirective=!0,g.value=i,g.isComponent=!!h,r.push(g),m&&m?.contains(p)&&(g.key=y),f++,s(c,t,void 0,{renderComponent:o,slotComponent:h,varChain:l}),n&&n.push({type:Le.DirectiveTag,point:c,up:g,name:d})}p.removeAttribute(d)}else if(d[0]!==Se)if(d!==Ae)if(d!==we)if(!process.env.DEV||d[0]!==Ne||ze.test(g)){if(ze.test(g)){let a=s[f],l=new F(f,p,d.replace(/\.|\?|@/,""),g);if(l.isComponent=!!h,m&&m?.contains(p)&&(l.key=y),d[0]===Ne||d[0]===Ce||d[0]===_e){if(t.isArray(a)&&t.isSymbol(a[0])){let[,t,r,s,i]=a;s(e.EnterPointType.PROP);let c=d.substring(1),u=new z(p,c,e.EnterPointType.PROP),f=Ve.get(p);f||(f={},Ve.set(p,f)),f[c]=[u,o,h],r(u,t,void 0,{renderComponent:o,slotComponent:h}),l.value=a,l.isDirective=!0,n&&n.push({type:Le.DirectiveProp,up:l,point:u,name:d,attrName:c})}else if(d[0]===Ce){l.isToggleProp=!0,l.value=!!a;let e=d.substring(1);l.value&&p.setAttribute(e,""),n&&n.push({type:Le.AttrBool,name:e,up:l,attrName:d})}else if(d[0]===_e){l.value=a;let e=d.substring(1);const[r,s]=e.split(Pe);let o=r;switch(s){case"camel":o=t.camelCase(o);break;case"kebab":o=t.kebabCase(o);break;case"snake":o=t.snakeCase(o)}l.attrName=o,p.setAttribute(o,a),n&&n.push({type:Le.AttrRef,up:l,name:d,attrName:o})}else if(!process.env.DEV||p instanceof j||"SLOT"===p.tagName){let e=t.camelCase(d.substring(1));process.env.DEV&&!(e in p)&&"SLOT"!==p.tagName&&c(p.tagName,`Prop '${d}' is not defined in ${p.tagName}`),l.value=a,l.isProp=!0,i[e]=a,n&&n.push({type:Le.AttrProp,up:l,name:e,attrName:d})}else c(p.tagName,`Prop '${d}' can only be set on a CompElem or a slot`);p.removeAttribute(d),a=""}else{let r,s;l.value=a;let i={type:Le.Attr,up:l,attrName:d};if(t.isArray(a)&&t.isSymbol(a[0])){let t=e.EnterPointType.ATTR;"class"===d?t=e.EnterPointType.CLASS:"style"===d&&(t=e.EnterPointType.STYLE);let[,n,c,u,f]=a;u(t),l.isDirective=!0,l.attrName=d;let g=new z(p,d,t),m=Ve.get(p);m||(m={},Ve.set(p,m)),m[d]=[g,o,h],s=n,r=c,a="",i.type=Le.DirectiveAttr,i.point=g}g=t.replace(g,ze,a),u.value=g,r&&r(i.point,s,void 0,{renderComponent:o,slotComponent:h}),n&&n.push(i)}r.push(l),f++}}else c(p.tagName,`Prop '${d}' must be an interpolation`);else{let e=s[f];p.setAttribute(d,e);let t=new F(f,p);t.notUpdated=!0,m&&m?.contains(p)&&(t.key=y),r.push(t),f++,m=p,y=e,n&&n.push({up:t,type:Le.AttrKey}),r.length>0&&r.forEach((t=>{t.key=t.key??e}))}else{if(ze.test(g)){let e=s[f];if(process.env.DEV&&!t.has(e,"current")){c(p.tagName,"Ref must be a RefObject");continue}let o=new F(f,p);o.notUpdated=!0,m&&m?.contains(p)&&(o.key=y),r.push(o),f++,e.current=p,n&&n.push({type:Le.Ref,up:o,attrName:d})}p.removeAttribute(d)}else{let e=e=>{},i=new F(f,p);i.notUpdated=!0,m&&m?.contains(p)&&(i.key=y),r.push(i);let a=!1;if(ze.test(g)){let r=s[f];if(process.env.DEV&&!t.isFunction(r)){c(p.tagName,`Event '${d}' must be a function`);continue}e=r.bind(o),f++,a=!0}let l=d.substring(1);Te(l,e,p,o),p.removeAttribute(d),n&&n.push({type:Le.Event,up:i,name:l,attrName:d,value:a})}else{let e=p.getAttribute("name")||"default";n&&n.push({type:Le.AttrSlot,name:e,attrName:d})}}p instanceof j?(p._initProps(i),p._regWrapper(o)):p instanceof HTMLSlotElement&&o._bindSlot(p,p.name||"default",i)}else{let i=p;if(`\x3c!--${i.nodeValue}--\x3e`!==Be)continue;let a=new F(f,p);m&&m?.contains(p)&&(a.key=y),r.push(a),a.isComponent=!!h,a.isText=!0;let l=s[f];if(t.isArray(l)&&t.isSymbol(l[0])){const t=Symbol.keyFor(l[0]);let r;r=document.createComment(`compelem-${o.tagName}-${t}-start`),a.textNode=r,i.parentNode.insertBefore(r,i),i.nodeValue=`compelem-${o.tagName}-${t}-end`,i._diName=t,a.isDirective=!0,a.value=l;let s=h?e.EnterPointType.SLOT:e.EnterPointType.TEXT,[,c,u,d,p]=l;d(s);let f=new z(r,"",s);f.endNode=i,$e.set(i,[f,o,h,c,p]),He.set(i,u),je.set(i,a),C.startRender(i);let g=u(f,c,void 0,{renderComponent:o,slotComponent:h,varChain:p});if(C.endRender(o),g){let e=Ke(i,g[1],o);e&&e.length>0&&Xe.insertBefore(i,Array.from(e))}l=void 0,n&&n.push({type:s===e.EnterPointType.SLOT?Le.DirectiveSlot:Le.DirectiveText,up:a,point:f})}else a.value=l,n&&n.push({type:Le.Text,up:a});f++;let c=t.toString(l??""),u=document.createTextNode(c);i.parentNode.insertBefore(u,i),a.textNode=u}g&&n&&(g[u]=n),m&&!m.contains(p)&&m!==p&&(m=null,y="")}return!i&&g&&Re.set(o.constructor,g),a.childNodes}function Ke(e,t,r){let[n,s]=Ie(r,t),o=[],i=Ge(o,n,s,r,!0);return We.set(e,o),i}function Qe(r,n,s){if(t.isBlank(t.join(r.strings)))return;if(!Ue.has(n))return;let{vars:o}=r;s=s??Ue.get(n);for(let r=0;r<s.length;r++){const i=s[r];let a=i.varIndex;if(a<0)continue;if(i.notUpdated)continue;let l=i.value,c=o,u=i.node,d=t.split(a,"-");for(let e=0;e<d.length;e++){const n=d[e];c=t.get(c,n),c&&c.vars&&r<d.length-1&&(c=c.vars)}if(!t.isObject(l)&&l===c)continue;let p=u;if(i.isDirective){let[t,r,n,,s]=i.value,o=$e.get(u);if(!o){const e=Ve.get(u);o=e[i.attrName]||e[Symbol.keyFor(t)]}let[a,l,d]=o,[,p]=c;const h=je.get(u);if(h){h.value=c;$e.get(u)[3]=p}K(a,p,r,n,l,d,s,a.type==e.EnterPointType.TEXT||a.type==e.EnterPointType.SLOT)}else if(i.isToggleProp){if(!!c===l)continue;p.toggleAttribute(i.attrName,!!c),t.set(p,i.attrName,!!c)}else if(i.isProp){if(!t.isObject(c)&&c===l)continue;u instanceof j?u._updateProps({[i.attrName]:c}):u instanceof HTMLSlotElement&&n._updateSlot(u.getAttribute("name")||"default",i.attrName,c)}else if(i.attrName){if(!t.isEqual(l,c))switch(i.attrName){case"value":if(u instanceof HTMLInputElement){u.value=c;break}default:u.setAttribute(i.attrName,t.replace(i.attrTmpl,ze,c+""))}}else if(i.isText){i.textNode.textContent=t.toString(c??"")}i.value=c}}function qe(e,r,n,s){const o=He.get(e),[i,a,l,c,u]=$e.get(e),d=je.get(e);if(!n){let e=o(i,d.value[1],c,{renderComponent:a,slotComponent:l,varChain:u});if(!e)return;n=e[1]}if(n&&n.vars[0]instanceof Ze){let e=[],r=[];t.each(n.vars,(n=>{r.push(...n.vars),e.push(...t.map(n.vars,(e=>"1")))})),e.push("1"),n=new Ze(e,r)}s&&We.set(e,s),Qe(n,r,s=s??We.get(e))}const Xe={insertBefore:function(e,t){if(!e.parentNode)return;let r=document.createDocumentFragment();r.append(...t),e.parentNode.insertBefore(r,e)},remove:function(e,t){if(e===t)return void e?.parentNode?.removeChild(e);let r=e.nextSibling;for(;r&&r!==t;)r?.parentNode?.removeChild(r),r=e.nextSibling}};function Ye(e,...r){return new Ze(t.isString(e)?[e]:e,r)}const Je=/([a-z0-9"'])\s*>\s*</gim;class Ze{strings;vars;constructor(e,r){this.strings=t.concat(e),this.vars=r}getKey(){let e=this.vars,r="";return t.each(this.strings,((s,o)=>{if(n.test(s))return r=t.toString(e[o]),!1})),r}getKeys(){let e=this.vars,r=[];for(let s=0;s<this.strings.length;s++){const o=this.strings[s];if(n.test(o)){let n=t.toString(e[s]);r.push(n)}}return t.isEmpty(r)&&e.forEach((e=>{if(e instanceof Ze){let t=e.getKey();r.push(t)}})),r}append(e){let r=t.last(this.strings);return e.strings.forEach(((e,t)=>{0!=t?this.strings.push(e):this.strings[this.strings.length-1]=r+e})),this.vars=t.concat(this.vars,e.vars),this}insert(e,t){let r=t.strings.shift();return this.strings[e]+=r,this.strings.splice(e+1,0,...t.strings),this.vars.splice(e,0,...t.vars),this}getHTML(e){let[r,n]=Ie(e,this),s=Ge([],r,n,e);return t.reduce(s,((e,t)=>e+(t.outerHTML??"")),"")}}const et=E(class extends h{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.get(e,n);t.set(e,n,t.debounce(o,this.wait,this.immediate));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;immediate;result;constructor(e,t=!1){super(),this.wait=e,this.immediate=t}});const tt=E(class extends h{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.bind(t.get(e,n),e);t.set(e,n,t.once(o));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;result;constructor(){super()}});var rt;e.QueryCache=void 0,(rt=e.QueryCache||(e.QueryCache={})).ONCE="once",rt.UPDATABLE="updatable";class nt extends h{static get priority(){return Number.MAX_VALUE}created(e,t,r,...n){}mounted(e,t,...r){}get targets(){return[e.DecoratorType.FIELD]}selector;cache;result;constructor(e,t){super(),this.selector=e,this.cache=t}static getKey(e){return e}getter(e){this.result=e.shadowRoot?.querySelector(this.selector)}beforeMount(e,t,r,n,...s){const o=this;Reflect.defineProperty(e,n,{get:()=>(o.result&&o.cache||o.getter(e),o.result)})}updated(t,r){this.cache===e.QueryCache.UPDATABLE&&this.getter(t)}}const st=E(nt),ot=E(class extends nt{getter(e){this.result=e.shadowRoot?.querySelectorAll(this.selector)}});function it(e,r,n){if(!t.has(e.constructor,o.STATES)){const r={};let n=e.constructor;for(;(n=d(n))!==j;)t.merge(r,n[o.STATES]?t.cloneDeep(n[o.STATES]):{});Reflect.defineProperty(e.constructor,o.STATES,{configurable:!1,enumerable:!1,value:r})}n.shallow=n.shallow||!1,e.constructor[o.STATES][r]=n}const at=E(class extends h{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.get(e,n);t.set(e,n,t.throttle(o,this.wait));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;result;constructor(e){super(),this.wait=e}});const lt=["key"],ct=q((function(e){return(e,[r],n)=>{let s=e.startNode;if(n)t.each(r,((e,t)=>{s.setAttribute(t,e)}));else if(s instanceof j){let e={},n={},i=t.get(s.constructor,o.PROPS);t.each(r,((r,s)=>{if(lt.includes(s))return;let o=t.camelCase(s);i[o]?e[s]=r:n[s]=r+""})),s._initProps(e,n)}else t.each(r,((e,t)=>{s.setAttribute(t,e)}))}}),[e.EnterPointType.TAG]),ut=new Map,dt=q((function(e){return(e,[r],n,{renderComponent:s})=>{let o=[];if(t.isArray(r)?o=t.compact(r):t.isObject(r)?o=t.flatMap(r,((e,t)=>e?t:[])):t.isString(r)&&(o=r.split(" ")),o.length<1&&!n)return;let i=e.startNode;if(ut.get(i)&&ut.get(i).length===o.length&&t.isMatch(ut.get(i),o))return;let a=ut.get(i);t.each(a,(e=>{i.classList.remove(e)})),t.each(o,(e=>{i.classList.add(e)})),a=t.concat(o),ut.set(i,a)}}),[e.EnterPointType.CLASS]),pt=new Map,ht=new Map,ft=q((function(r,s){return(r,o,i,{varChain:a})=>{let c=r.startNode,u=function(e,r,s){let o=t.map(e,((e,t)=>r(e,t)));if(o.length<1){let e=new Ze([],[]);return ht.set(s,e),e}let i=[],a=[];const c=[],u=[];for(let e=0;e<o.length;e++){const r=o[e];let s=t.last(a),d=r.vars,p=!0,h=r.strings;for(let e=0;e<h.length;e++){const t=h[e];if(n.test(t)){let t=d[e]+"";if(i.includes(t))return void l(`forEach - duplicate key '${t}'`);i.push(t),p=!1}0==e&&s?a[a.length-1]=s+t:a.push(t)}if(p)return void l("forEach - missing 'key' prop");let f=t.last(c);f&&h.length>0&&(c[c.length-1]=t.trim(f)+h.shift()),c.push(""),u.push(r)}c.push("");let d=new Ze(c,u);return ht.set(s,d),d}(o[0],s,c);if(i){const n=pt.get(c);if(t.isEmpty(r.getNodes())&&(!o||t.isEmpty(o[0])))return[e.DirectiveUpdateTag.NONE,u];if(t.isMatch(n,o[0])&&n.length===o[0].length)return[e.DirectiveUpdateTag.NONE,u]}return pt.set(c,t.clone(o[0])),i?[e.DirectiveUpdateTag.UPDATE,u]:[e.DirectiveUpdateTag.APPEND,u]}}),[e.EnterPointType.TEXT,e.EnterPointType.SLOT]);const gt=new WeakMap,mt=q((function(t,r,n){return(s,[o,i],a,{renderComponent:l})=>{let c=s.endNode;if(a){if(!!o==!!a[0]){let t=gt.get(c);return[e.DirectiveUpdateTag.NONE,t.call(l,o)]}let t=o?r:n;return gt.set(c,t),[e.DirectiveUpdateTag.REPLACE,t.call(l,o)]}{let s=o?r:n;return gt.set(c,s),[e.DirectiveUpdateTag.APPEND,s.call(l,t)]}}}),[e.EnterPointType.TEXT,e.EnterPointType.SLOT]),yt=q((function(t,r){return(t,[r,n],s)=>s?r===s[0]?[e.DirectiveUpdateTag.NONE,r?n():Ye``]:r?[e.DirectiveUpdateTag.REPLACE,r?n():Ye``]:[e.DirectiveUpdateTag.REMOVE]:[e.DirectiveUpdateTag.APPEND,r?n():Ye``]}),[e.EnterPointType.TEXT,e.EnterPointType.SLOT]);var vt;e.ModelTriggerType=void 0,(vt=e.ModelTriggerType||(e.ModelTriggerType={})).CHANGE="change",vt.INPUT="input";const Et=new WeakMap,bt=q((function(e,r="value"){return(n,s,o,{varChain:i,renderComponent:a})=>{const l=n.startNode;if(o){if(t.isEqual(s,o))return;if(!t.isEqual(s,o)){let e=s[0];if(l instanceof j)l._updateProps({[r]:e});else if(l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement)l.setAttribute(r,e+"");else if(l instanceof HTMLInputElement){if(l.value==e)return;switch(l.type){case"checkbox":case"radio":e?l.setAttribute("checked",""):l.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":l.setAttribute(r,e+""),t.set(l,r,e);break;default:l.setAttribute(r,e+"")}}}return}if("binded"===t.get(l,"_model"))return;let c=t.last(i);if(Et.set(l,c),t.isObject(e)||t.trim(e)||(e=""),l instanceof j)l._initProps({[r]:e}),l.addEventListener("update:"+r,(e=>{t.set(a,c,e.detail.value)})),t.set(l,"_model","binded");else if(l instanceof HTMLTextAreaElement)l.setAttribute(r,e+""),l.addEventListener("input",(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded");else if(l instanceof HTMLInputElement){let n="",s="";switch(l.type){case"checkbox":case"radio":n="checked",s="change";break;default:n="value",s="input"}l.setAttribute(r??n,e+""),l.addEventListener(s,(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded")}else l instanceof HTMLSelectElement&&(l.setAttribute(r,e+""),l.addEventListener("change",(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded"))}}),[e.EnterPointType.TAG]),Tt=new Map,St=q((function(e,t){return(e,[r],n)=>{if(n&&r===n[0])return;let s=e.startNode;if(!Tt.has(s)){let e=s.style.display;Tt.set(s,"none"==e?"unset":e)}s.style.display=r?Tt.get(s):"none",t&&t(s,r)}}),[e.EnterPointType.TAG]),Nt=q((function(e,t){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(e=e.bind(o),i._bindSlotHook(t||"default",e))}}),[e.EnterPointType.SLOT]);class Ct{static getCssText(e,r=!1){return t.isString(e)?e:t.join(t.map(e,((e,n)=>n.startsWith("--")?n+":"+e+(r?" !important":""):t.kebabCase(n)+":"+e+(r?" !important":""))),";")}static setStyle(e,r){if(t.isString(e)&&!t.trim(e))return{};let n=Ct.getCssText(e),s={};return t.each(n.split(";"),(e=>{let n=e.split(":"),o=t.trim(n[0]),i=t.trim(n[1]);s[o]=r.style.getPropertyValue(o),r.style.setProperty(o,i)})),s}}const _t=new Map;let Pt=0;const At=q((function(e){return(e,t,r,{renderComponent:n})=>{let s=e.startNode,o=_t.get(s);o||(o="style_d"+Pt++,_t.set(s,o)),n.nextTick((()=>{Ct.setStyle(t[0],s)}),o)}}),[e.EnterPointType.STYLE]),wt=q((function(e){return(r,n,s,{renderComponent:o,varChain:i})=>{const a=r.startNode;if(s){if(!t.isEqual(n,s)){let e=r.attrName;a._updateProps({[e]:n[0]})}return}let l=t.last(i),c=r.attrName;a._initProps({[c]:e}),a.addEventListener("update:"+c,(e=>{t.set(o,l,e.detail.value)}))}}),[e.EnterPointType.PROP]),Dt=q((function(r,n){return(r,[n,s],o)=>{let i=()=>Ye``,a=[],l=[];t.each(s,((e,r)=>{if(t.isFunction(e))a.push(r),l.push(e);else{let t=e[0],r=e[1];a.push(t),l.push(r)}"default"===r&&(i=e)}));let c=t.findIndex(a,(e=>t.isFunction(e)?e(n):e==n));return o?[e.DirectiveUpdateTag.REPLACE,t.call(l[c]??i)]:[e.DirectiveUpdateTag.APPEND,t.call(l[c]??i)]}}),[e.EnterPointType.TEXT,e.EnterPointType.SLOT]);e.CompElem=j,e.CssHelper=Ct,e.Decorator=h,e.DecoratorWrapper=y,e.EnterPoint=z,e.GetKeyFnName=f,e.Template=Ze,e.UpdatePoint=F,e._DecoratorMap=m,e._DecoratorsKey=g,e._getObservedAttrs=N,e.bind=ct,e.buildHTML=Ie,e.classes=dt,e.computed=function(e,r,n){n.get||l(`Computed '${r}' must be a getter`),t.has(e.constructor,o.COMPUTED)||(e.constructor[o.COMPUTED]=t.isEmpty(e.constructor[o.COMPUTED])?{}:t.cloneDeep(e.constructor[o.COMPUTED])),e.constructor[o.COMPUTED][r]=n.get},e.createRef=function(e){return{current:e}},e.debounced=et,e.decorator=E,e.directive=q,e.event=function(e,r){return(n,s,i)=>{t.has(n.constructor,o.EVENTS)||(n.constructor[o.EVENTS]=t.isEmpty(n.constructor[o.EVENTS])?[]:t.cloneDeep(n.constructor[o.EVENTS])),n.constructor[o.EVENTS].push({name:e,options:r,fn:n[s]})}},e.forEach=ft,e.html=Ye,e.ifElse=mt,e.ifTrue=yt,e.makeState=function(e,t,r){it(e.prototype,t,r||{prop:""})},e.model=bt,e.onced=tt,e.prop=function(e){if(1===arguments.length)return(t,r,n)=>{e.required=e.required||!1,e.attribute=!1!==e.attribute,T(t,r,e,n)};let r=arguments[0],n=arguments[1],s=arguments[2];e={type:void 0,required:!1,attribute:!0},s&&"function"==typeof s.type&&(e=t.defaults(s,e),s=void 0),T(r,n,e,s)},e.query=st,e.queryAll=ot,e.show=St,e.slot=Nt,e.state=function(e){if(1===arguments.length)return(t,r)=>{it(t,r,e)};it(arguments[0],arguments[1],{prop:""})},e.styles=At,e.sync=wt,e.tag=function(e){return t=>{if(t){if(t.prototype.hasOwnProperty("attributeChangedCallback")){let e=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,r,n){j.prototype.attributeChangedCallback.call(this,t,r,n),e.call(this,t,r,n)}}if(t.prototype.hasOwnProperty("connectedCallback")){let e=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){j.prototype.connectedCallback.call(this),e.call(this)}}if(t.prototype.hasOwnProperty("disconnectedCallback")){let e=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){j.prototype.disconnectedCallback.call(this),e.call(this)}}customElements.define(e,t)}}},e.throttled=at,e.updateDirective=K,e.watch=function(e,r){return(n,s)=>{t.has(n.constructor,o.WATCH)||(n.constructor[o.WATCH]=t.isEmpty(n.constructor[o.WATCH])?{}:t.cloneDeep(n.constructor[o.WATCH]));(t.isArray(e)?e:[e]).forEach((e=>{let i=e.replaceAll(".","-"),a=n.constructor[o.WATCH][i];t.isArray(a)||(a=n.constructor[o.WATCH][i]=[]),a.push({source:e,options:r,handler:n[s]})}))}},e.when=Dt,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("myfx")):"function"==typeof define&&define.amd?define(["exports","myfx"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).compelem={},e.myfx)}(this,(function(e,t){"use strict";const r=/\s+\.?key\s*=/;var n,s,o,i;function a(e){console.error("[CompElem]",e)}function l(e,t){console.error(`[CompElem <${e}>]`,t)}function c(e){return t.toPath(e).join("-")}function u(e){return Object.getPrototypeOf(e)}function d(e){let r=e;return t.isString(e)&&/(?:^true$)|(?:^false$)/.test(r)?r="true"===r:(t.isUndefined(r)||t.isBlank(r))&&(r=!0),r}!function(e){e[e.CSS=1]="CSS",e[e.COMPUTED=2]="COMPUTED"}(n||(n={})),function(e){e.PROPS="__deco_props",e.STATES="__deco_states",e.COMPUTED="__deco_computed",e.WATCH="__deco_watch",e.EVENTS="__deco_events"}(s||(s={})),function(e){e.Prod="prod",e.Dev="dev"}(o||(o={})),e.DecoratorType=void 0,(i=e.DecoratorType||(e.DecoratorType={})).CLASS="class",i.FIELD="field",i.METHOD="method";class p{static get priority(){return 0}}const h="getKey",f="__decorators",g=new WeakMap;class m{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(e,r,n){this.args=e,this.metadata=r,this.decoratorClass=n,this.priority=t.get(n,"priority",0),this.instanceMap=new WeakMap}create(r){let n,s=new this.decoratorClass(...this.args),o=s.targets,i=this.metadata[2];t.isObject(i)&&t.isDefined(t.get(i,"configurable"))?n=e.DecoratorType.METHOD:t.isUndefined(this.metadata[2])&&(n=e.DecoratorType.FIELD),!t.isEmpty(o)&&n&&o.includes(n)?(s.created(r,...this.metadata),this.instanceMap.set(r,s)):a(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${o.join(",")}' bug got '${n}'`)}beforeMount(e,t){this.instanceMap.get(e).beforeMount(e,t,...this.metadata)}mounted(e,t){this.instanceMap.get(e).mounted(e,t,...this.metadata)}updated(e,t){this.instanceMap.get(e).updated(e,t)}}const y=new WeakMap;function v(e){let r=(...r)=>(...n)=>{let s=n[0].constructor,o=s[f];if(!t.has(s,f)){let e=Object.getPrototypeOf(s);o=e?t.concat(e[f]??[]):[],Reflect.defineProperty(s,f,{configurable:!1,enumerable:!1,value:o})}let i,a={},l=e[h];if(l){let t=y.get(e);if(t||(t=new WeakMap,y.set(e,t)),a=t.get(s),a||(a={},t.set(s,a)),i=l(...r),a[i])return a[i]}let c=new m(r,n,e);return a[i]=c,o?.push(c),c};return g.set(r,!0),r}const E=new WeakMap;function b(e,r,n,o){let i;if(t.isLowerCaseChar(r[0])||a(`Prop '${r}' must be in CamelCase`),!t.has(e.constructor,s.PROPS)){const r={};let n=e.constructor;for(;(n=u(n))!==K;)t.merge(r,n[s.PROPS]?t.cloneDeep(n[s.PROPS]):{});Reflect.defineProperty(e.constructor,s.PROPS,{configurable:!1,enumerable:!1,value:r}),i=new Set,t.each(r,((e,r)=>{if(e.attribute){let e=t.kebabCase(r);i?.add(e)}})),E.set(e.constructor,i)}if(o&&(o.get&&(n.getter=o.get),o.set&&(n.setter=o.set)),n.attribute){i||(i=E.get(e.constructor));let n=t.kebabCase(r);i?.add(n)}t.has(e.constructor,"observedAttributes")||(e.constructor.observedAttributes=[]),e.constructor.observedAttributes=t.toArray(i),e.constructor[s.PROPS][r]=n}const T=new Set;function S(e){return E.get(e)??T}var C,_;e.EnterPointType=void 0,(C=e.EnterPointType||(e.EnterPointType={})).ATTR="attr",C.PROP="prop",C.TEXT="text",C.CLASS="class",C.STYLE="style",C.SLOT="slot",C.TAG="tag",e.DirectiveUpdateTag=void 0,(_=e.DirectiveUpdateTag||(e.DirectiveUpdateTag={})).NONE="NONE",_.REMOVE="REMOVE",_.REPLACE="REPLACE",_.UPDATE="UPDATE",_.APPEND="APPEND";class N{key;varIndex;value;isText=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;notUpdated;constructor(e,t,r,n){this.varIndex=e,this.node=t,r&&(this.attrName=r),n&&(this.attrTmpl=n)}}const A="-",P={collectWatch(e,t,r){let n=O.get(e);n||(n={},O.set(e,n));let s=n[r];s||(s=n[r]=[]),s.push(t)},startCollect(e,t){this.__collectType=t,this.__collecting=e},setUpdater(e){this.__updater=e},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(e){let r=t.last(this.__directiveQ);const n=e?e.join(","):"",s=r?r.join(","):"";r&&n===s||(r&&r.length<e.length&&t.startsWith(n,s)?this.__directiveQ[this.__directiveQ.length-1]=e:this.__directiveQ.push(e))},popDirectiveQ(){let e=t.concat(this.__directiveQ);return this.__directiveQ=[],e},startRender(e){this.__renderCollecting=!0,this.__renderContext=e},endRender(e){this.__renderCollection.forEach((t=>{e._regDeps(t,this.__renderContext)})),this.__renderCollection.clear(),this.__renderCollecting=!1,this.__renderContext=null},collect(e){this.__renderCollection.add(e)},clear(){this.__directiveQ=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},w=new WeakMap,k=new WeakMap,D=new WeakMap,M=new WeakMap,O=new WeakMap,x=new WeakMap;function R(e,r){if(!t.isObject(e))return e;if(x.has(e))return x.get(e);if(w.has(e))return e;const o=new Proxy(e,{get(e,r,o){if(!r)return;const i=Reflect.get(e,r,o);if(t.isSymbol(r))return i;if("length"===r&&t.isArray(e))return i;let a=k.get(o)??[],l=t.concat(a,[r]),u=r in e;if((P.__renderCollecting||P.__collecting)&&(u&&e.hasOwnProperty(r)||!u)){let e=l.join(A);if(P.__renderCollecting)P.collect(c(l)),P.setDirectiveQ(l);else if(P.__collecting){let t;switch(P.__collectType){case n.COMPUTED:t=D.get(P.__collecting),t||(t={},D.set(P.__collecting,t));break;case n.CSS:t=M.get(P.__collecting),t||(t={},M.set(P.__collecting,t))}let r=t[e];r||(r=t[e]=[]),r.push(P.__updater)}}const d=w.get(o);let p=d.from,h=t.get(p.constructor,s.STATES);if(t.get(h,[r,"shallow"]))return i;let f=i;if(t.isObject(i)&&!t.isFunction(i)&&!(i instanceof Node)&&!Object.isFrozen(i)){let e=d.pathMap;d.contextSet.forEach((n=>{let s=e?.get(n);s&&(l=t.concat(s,[r]),f=R(i,n),x.set(i,f),k.has(f)||k.set(f,l))}))}return f},set(e,n,o,i){if(!n)return!1;let a=e[n],l=k.get(i)??[],c=t.concat(l,[n]),u=t.get(r.constructor,s.PROPS),d=t.get(r.constructor,s.STATES),p=t.get(u,[c[0],"hasChanged"])||t.get(d,[c[0],"hasChanged"]);if(p){if(!p.call(r,o,a))return!0}else if(Object.is(a,o))return!0;u&&u[n]&&e.__isData&&u[n].sync&&r.emit("update:"+n,{value:o});let h=o,f=Reflect.set(e,n,h);return L(r,a,c),f}});let i=k.get(e)??[];if(Object.isExtensible(e)&&!w.get(o)){let e=new Set;e.add(r);let t=new WeakMap;t.set(r,i),w.set(o,{from:r,contextSet:e,pathMap:t})}else{w.get(o).contextSet.add(r);let e=w.get(o).pathMap,n=e.get(r),s=t.concat(i);if(n&&n.join("")!==s.join("")){let e=t.get(r,t.initial(n));t.isArray(e)||function(...e){console.warn("[CompElem]",...e)}(`The object is referenced by more than one @state '${s.join(".")},${n.join(".")}'`),n=s}else e.set(r,s)}return x.set(e,o),o}function L(e,r,n){let s=D.get(e),o=M.get(e),i=O.get(e);if(s||o||i){let e=n.length;for(;e;){let a=n.slice(0,e).join(A);if(i){const s=i[a];e===n.length?s?.forEach((e=>{let t=e();t.ov=r,W.pushWatch(t)})):s?.forEach((e=>{let n=e();t.get(n,"deep")&&(n.ov=r,W.pushWatch(n))}))}if(s){let e=s[a];if(!t.isEmpty(e))for(let t=0;t<e.length;t++){const r=e[t];W.pushComputed(r)}}if(o){let e=o[a];if(!t.isEmpty(e))for(let t=0;t<e.length;t++){const r=e[t];W.pushCss(r)}}e--}}let a=e._notify(r,n);W.pushNext(a,e.cid)}const U=new Map;class W{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){W.nextPending=!1;let e=Array.from(W.watchSet);W.watchSet.clear();let r=Array.from(W.computedSet);W.computedSet.clear();let n=Array.from(W.cssSet);W.cssSet.clear();let s=Array.from(W.nextSet);W.nextSet.clear(),e.forEach((e=>e(t.get(e,"ov")))),r.forEach((e=>e())),n.forEach((e=>e())),s.forEach((e=>e())),U.clear()}static pushWatch(e){W.watchSet.add(e)}static pushComputed(e){W.computedSet.add(e)}static pushCss(e){W.cssSet.add(e)}static pushNext(e,t){if(t){if(U.has(t))return;U.set(t,e)}W.nextSet.add(e),W.nextPending||(W.nextPending=!0,W.next())}}(()=>{const e=Promise.resolve(),t=W.flush;W.next=()=>{e.then(t)}})();const j={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},H=new WeakMap;let B=[],I=0;const V=new Map,$=new WeakMap,F=Symbol.for("PROP_OBJECT_KEY_MAP_SYMBOL");class K extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(e){B=t.flatMap(e.css,(e=>{if(t.isString(e)){let t=new CSSStyleSheet;return t.replaceSync(e),t}return e instanceof CSSStyleSheet?e:[]})),e.global,t.each(e,((e,r)=>{t.test(r[0],/[A-Z]/)}))}#e;#t={};#r={"#slots":{}};#n={};#s={};#o;#i={};__events={};_propObjectKeyMap={};get[F](){return this._propObjectKeyMap}get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#e}get reactiveData(){return this.#n}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#u}get parentComponent(){return this.#d}get wrapperComponent(){return this.#p}get slotHooks(){return this.#h}get css(){return H.get(this.constructor)}get globalStyleSheet(){return V.get(this.constructor)?.sheet}get isMounted(){return this.#f}get slots(){return this.#r["#slots"]}#a;#l;#c;#u;#d;#p;#g={};#h={};#m={};#f=!1;static get styles(){return[]}static get globalStyles(){return[]}static get hostStyles(){return[]}get styles(){return[]}#y=!1;#v=!1;constructor(...e){super(),this.#e=I++,1===t.size(e)&&(this.#l={},t.assign(this.#l,t.first(e)));let r=this.render.bind(this);this.render=function(){let e;return P.startRender(this),e=r(),P.endRender(this),e};let n=t.get(this.constructor,"globalStyles"),s=V.has(this.constructor);if(!t.isEmpty(n)&&!s){let e="";n.forEach((r=>{t.isString(r)&&(e+=r+"\n")}));let r=document.createElement("style");r.textContent+=e,V.set(this.constructor,r),document.head.appendChild(r)}let o=H.get(this.constructor),i=o??[];o||(t.each(t.get(this.constructor,"styles"),(e=>{if(t.isString(e)){let t=new CSSStyleSheet;t.replaceSync(e),i.push(t)}else i.push(e)})),H.set(this.constructor,i)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...B,...i],this.#E();let a=t.get(this.constructor,f);a&&a.sort(((e,t)=>t.priority-e.priority)).forEach((e=>e.create(this))),this.#b=this.#T.bind(this)}get rootComponent(){let e=this;for(;e.parentComponent;)e=e.parentComponent;return e}#b;connectedCallback(){let e=t.closest(this.parentNode,(e=>e instanceof K||e.host instanceof K),"parentNode");this.#d=e?e instanceof K?e:e.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#y)return;if(this.#v)return;this.#v=!0,this.#E();const e=this.#S();this.propsReady(e);for(const t in e){const r=e[t];this.#r[t]=r}this.#C(),t.each(this.#r,((e,t)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,t);Reflect.defineProperty(this,t,{get(){let e=Reflect.get(this.#n,t);return r?.get?r?.get():e},set(e){r?.set?r?.set(e):Reflect.set(this.#n,t,e)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=R(this.#r,this);let r=t.get(this.constructor,s.COMPUTED);t.each(r,((e,t)=>{P.startCollect(this,n.COMPUTED),P.setUpdater((()=>{this.#n[t]=e.call(this)})),this.#r[t]=e.call(this),P.endCollect(),Reflect.defineProperty(this,t,{get(){return Reflect.get(this.#n,t)},set(e){l(this.tagName,"Cannot set a computed property '"+t+"'")}})}));let o=t.get(this.constructor,s.WATCH);t.each(o,((e,r)=>{e.forEach((e=>{let{source:n,options:s,handler:o}=e,i=o.bind(this);t.get(s,"once",!1)&&(i=t.once(i));const a=function(e){let r=t.get(this,n.replaceAll(A,"."));i(r,e,n)}.bind(this);let l=t.get(s,"deep",!1);if(a.deep=l,P.collectWatch(this,(()=>a),r),!t.get(s,"immediate",!1))return;let c=t.get(this,n.replaceAll(A,"."));i(c,c,n)}))}));let i=function(e,r){let n,s=[];if(xe.has(r.constructor)){let o=xe.get(r.constructor),i=function(e,r){let n=t.concat(r.vars),s=r.strings.length-1;for(let o=0;o<=s;o++){let s=t.get(r.vars,o,"");if(s instanceof et){let[t,r]=$e(e,s);n.splice(o,1,...r)}}return n}(r,e);n=Re.has(r.constructor)?function(e,r,n){let s=Re.get(n.constructor)?.cloneNode(!0),o=Le.get(n.constructor);const i=document.createNodeIterator(s,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let a,l,c=0,u=0;for(;a=i.nextNode();){let s;if(u++,l&&!l.contains(a)&&(l=void 0),a instanceof HTMLElement||a instanceof SVGElement){a instanceof K&&(l=a);let i={};o[u].forEach((o=>{let u=r[c++];switch(o.type){case Ue.Event:s=t.clone(o.up),o.value||c--,o.value&&Ce(o.name,u.bind(n),a,n),a.removeAttribute(o.attrName);break;case Ue.AttrSlot:l&&o.name,a.removeAttribute(o.attrName);break;case Ue.Ref:s=t.clone(o.up),u.current=a,a.removeAttribute(o.attrName);break;case Ue.AttrKey:s=t.clone(o.up),a.setAttribute(De,u);break;case Ue.AttrBool:s=t.clone(o.up),s.value=!!u,s.node=a,s.value&&a.setAttribute(o.name,""),a.removeAttribute(o.attrName);break;case Ue.AttrProp:s=t.clone(o.up),s.value=u,s.node=a,i[o.name]=u,o.attrName&&a.removeAttribute(o.attrName);break;case Ue.AttrRef:case Ue.Attr:s=t.clone(o.up),s.value=u,s.node=a,a.setAttribute(o.attrName,u),Ue.AttrRef===o.type&&a.removeAttribute(o.name);break;case Ue.DirectiveAttr:case Ue.DirectiveTag:case Ue.DirectiveProp:s=t.clone(o.up),s.value=u,s.node=a;let e=t.clone(o.point);e.startNode=a;let[r,d,p,h,f]=u,g=Ve.get(a);if(g||(g={},Ve.set(a,g)),g[o.attrName??Symbol.keyFor(r)]=[e,n,l],p(e,d,void 0,{renderComponent:n,slotComponent:l,varChain:f}),Ue.DirectiveAttr===o.type){let e=a.getAttribute(o.attrName);e=t.replace(e,Ge,""),a.setAttribute(o.attrName,e)}o.name&&a.removeAttribute(o.name)}s&&e.push(s)})),a instanceof K?(a._initProps(i),a._regWrapper(n)):a instanceof HTMLSlotElement&&n._bindSlot(a,a.name||"default",i)}else{o[u].forEach((o=>{let i=r[c++];switch(o.type){case Ue.DirectiveSlot:case Ue.DirectiveText:s=t.clone(o.up),s.value=i,s.node=a;let[e,r,c,u,d]=i,p=Symbol.keyFor(e),h=document.createComment(`compelem-${n.tagName}-${p}-start`);s.textNode=h,a.parentNode.insertBefore(h,a),a.nodeValue=`compelem-${n.tagName}-${p}-end`;let f=t.clone(o.point);f.startNode=h,f.endNode=a,Be.set(a,[f,n,l,r,d]),He.set(a,c),Ie.set(a,s),P.startRender(a);let g=c(f,r,void 0,{renderComponent:n,slotComponent:l,varChain:d});P.endRender(n);let m=Qe(a,g[1],n);m&&m.length>0&&Ye.insertBefore(a,Array.from(m));break;case Ue.Text:s=t.clone(o.up),s.node=a;let y=t.toString(i??""),v=document.createTextNode(y);a.replaceWith(v),s.textNode=v}s&&e.push(s)}))}}return s.childNodes}(s,i,r):ze(s,o,i,r)}else{let[t,o]=$e(r,e);xe.set(r.constructor,t),n=ze(s,t,o,r)}return We.set(r,s),n}(this.render(),this);i&&(this.#o.append(...i),this.#u=t.filter(this.#o.childNodes,(e=>e.nodeType===Node.ELEMENT_NODE)),this.#c=this.#u[0]),t.each(this.#h,((e,t)=>{this.#_(t)}));const a=this;let c=t.get(this.constructor,f);c&&c.sort(((e,t)=>t.priority-e.priority)).forEach((e=>{e.beforeMount(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}));let u=t.get(this.constructor,"hostStyles"),d=this.#p?.shadowRoot??this.ownerDocument,p=$.get(d);if(!p?.includes(this.constructor)&&u.length>0){let e=[];t.each(u,(r=>{if(t.isString(r)){let t=new CSSStyleSheet;t.replaceSync(r),e.push(t)}else e.push(r)})),d.adoptedStyleSheets=[...d.adoptedStyleSheets,...e],p?.push(this.constructor)}this.beforeMount();let h=t.get(this.constructor,s.EVENTS);h&&h.forEach((async e=>{let r=e.name,n=t.assign({target:document,once:!1,passive:!1,capture:!1},e.options),s=t.bind(e.fn,this),o=n.target;t.isFunction(o)&&(o=await o.call(this,this)),o?o.addEventListener(r,s,n):l(this.tagName,"The target of @event('"+r+"',...) is invalid")})),P.startCollect(this,n.CSS);let g=[];this.styles.forEach((e=>{if(!t.isFunction(e))return;let r=new CSSStyleSheet;g.push(r),P.setUpdater((()=>{let t=e()??"";r.replaceSync(t)}));let n=e();t.isBlank(n)||r.replaceSync(n)})),P.endCollect(),g.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...g]),setTimeout((()=>{this.#f=!0,this.mounted(),c&&c.forEach((e=>{e.mounted(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}))}),0),this.#y=!0}propsReady(e){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#N(e,r){this.#E();let n=t.get(this.#t[r],"props");n&&t.each(this.slots,((e,r)=>{e.filter((e=>e.nodeType===Node.ELEMENT_NODE)).forEach((e=>{e instanceof K?e._updateProps(n):t.each(n,((r,n)=>{if(e instanceof HTMLSlotElement){let s=t.get(e,"__l_comp");if(s){let t=e.name||"default",o=s.#t[t];o||(o=s.#t[t]={props:{}}),o.props||(o.props={}),o.props[n]=r,s.#N(e,t)}}else e.setAttribute(n,r)}))}))})),this.slotChange(e,r)}slotChange(e,t){}attributeChangedCallback(e,t,r){this.#A(e,t,r)}shouldUpdate(e){return!0}updated(e){}#P={};_notify(e,r){let n=[];for(let s=0;s<r.length;s++){const o=r[s];n.push(o);let i=t.get(this,n),a=c(n);this.#s[a]={value:i,chain:"slots"===a?["slots"]:n,oldValue:e,end:n.length===r.length}}return this.#b}#T(){if(t.size(this.#s)<1)return;const e=this.#s;this.#s={};const r=Object.keys(e);let n=t.get(this.constructor,f);if(n&&n.sort(((e,t)=>t.priority-e.priority)).forEach((t=>{t.updated(this,e)})),!this.shouldUpdate(e))return;let s=new Set;t.each(e,(({value:e,chain:t,oldValue:r,end:n},o)=>{this.#i[o]&&this.#i[o].forEach((e=>{s.add(e)}))})),s.forEach((e=>{e===this?qe(this.render(),this,void 0,r):Xe(e,this)})),this.#w.forEach((e=>{this.#_(e)})),this.updated(e)}#S(){let e=t.get(this.constructor,s.PROPS),r=this.attributes,n=this.tagName,o=this.#l,i={};t.each(r,(({name:r,value:n})=>{if(r[0]===_e||r[0]===Ne||r[0]===Ae||r===ke||"slot"===r)return;let s=t.camelCase(r);e&&!e[s]&&(i[r]=n)})),this.#a=this.#a?t.assign(this.#a,i):i;let a={};if(!e)return Object.seal(a);let c=Object.keys(e),u=c.length;for(let s=0;s<u;s++){const i=c[s],u=t.kebabCase(i),h=this.hasAttribute(u);let f,g=e[i],m=t.has(o,i),y=t.get(this,i);if(!("_defaultValue"in g)&&(g._defaultValue=y,!g.type)){t.isUndefined(y)&&l(n,"Prop '"+i+"' has neither propType nor defaultValue be used for type inference");let e=typeof y;t.isArray(y)&&(e="array");let r=j[e];g.type=r}if(m)f=t.isNil(o[i])?y:o[i];else{f=y;let e=r.getNamedItem(u)||r.getNamedItem(Ne+u);e&&(m=!0,f=e.value)}if(g.required&&!m){l(n,"Prop '"+i+"' is required");break}f=this.#k(e,i,f,h);let v=t.get(e,[i,"getter"]);v&&(v=t.bind(v,this));let E=t.get(e,[i,"setter"]);if(E&&(E=t.bind(E,this)),(v||E)&&Reflect.defineProperty(this.#r,i,{set:E||function(e){},get:v}),g.attribute&&t.isDefined(f)&&!t.isObject(f)){let e=t.kebabCase(i),r=t.trim(f);(p=g.type)===Boolean||t.some(p,(e=>e===Boolean))?(r=d(f),t.isBoolean(r)?this.toggleAttribute(e,r):this.setAttribute(e,r)):this.setAttribute(e,r)}this.#r[i]=f,a[i]=f}var p;return Object.seal(a)}#D(e,r){let n=e;try{for(let s=0;s<r.length;s++){const o=r[s];n=o===Boolean?d(e):o===Number?Number(e):o===String?String(e):o===Object||o===Array?t.parseJSON(e):o===Date?new Date(e):new o(e)}}catch(t){l(this.tagName,"Convert attribute error with "+e)}return n}#k(e,r,n,s){let o=e[r];if(!o)return n;let i=o.isValid,a=o.type,c=t.isArray(a)?a:[a],u=o.converter,p=n;if(!t.some(c,(e=>e===String))&&t.isString(p)&&!t.isNull(p))try{p=u?u(p):this.#D(p,c)}catch(e){l(this.tagName,`Convert attribute '${r}' error with `+p)}for(let e=0;e<c.length;e++){"Boolean"===c[e].name&&(p=(!1!==s||!t.isBlank(p))&&d(p))}if(t.isNil(p))return p;let h=typeof p,f=!t.isDefined(p);for(let e=0;e<c.length;e++){const r=c[e];if(t.test(h,r.name,"i")||p instanceof r||Object.prototype.toString.call(p)===Object.prototype.toString.call(r.prototype)){f=!0;break}}return f||l(this.tagName,`Invalid prop '${r}'. expected '${c.map((e=>e.name||e))}' but got '${h}'`),i&&(i.call(this,p,this.#r)||l(this.tagName,`Invalid prop '${r}'. IsValid() check failed`)),p}#C(){let e=t.get(this.constructor,s.STATES);t.each(e,((r,n)=>{let s=e[n],o=t.get(this,n);if(s){let e=s.prop;o=e?t.cloneDeep(this.#r[e]):t.get(this,n)}this.#r[n]=o}))}#M=t.debounce(this.propsReady,100);_setParentProps(e,r){if(this.#y){let n=t.get(this.constructor,s.PROPS);t.each(e,((e,r)=>{let s=t.camelCase(r),o=n[s];if(!o)return;let i=this.#r[s];e=this.#k(n,s,e),o.hasChanged&&!o.hasChanged.call(this,e,i)||(this.#r[s]=e,this._notify(i,[s]))})),t.assign(this.#l,e),t.assign(this.#a,r),this.#M(this.#l)}}_updateProps(e){let r=t.get(this.constructor,s.PROPS);t.each(e,((e,n)=>{let s=t.camelCase(n);r[s]&&(e=this.#k(r,s,e),P.__skipCheck=!0,t.set(this,s,e),P.__skipCheck=!1)})),t.assign(this.#l,e),this.#M(this.#l)}_initProps(e,r){this.#l=t.merge(this.#l||{},e),this.#a=t.merge(this.#a||{},r)}_bindSlot(e,r,n){if(this.#g[r]||(this.#g[r]=e,Reflect.defineProperty(e,"__l_comp",{value:this})),e.addEventListener("slotchange",(t=>{this.#y&&this.#N(e,"default"===r?"":r)})),!t.isEmpty(n)){let e=this.#t[r];e||(e=this.#t[r]={}),e.props=n}}_bindSlotHook(e,t){this.#h[e]=t}#w=new Set;_updateSlot(e,t,r){let n=this.#g[e],s=this.#h[e];if(!s&&!n)return;let o=this.#t[e];if(t&&(o.props||(o.props={}),o.props[t]=r),s)this.#w.add(e);else{let e=n.assignedElements({flatten:!0});for(let n=0;n<e.length;n++){e[n].setAttribute(t,r+"")}}}#E(){const e=t.flatMap(this.childNodes,(e=>e.nodeType===Node.COMMENT_NODE?[]:e instanceof HTMLSlotElement?e.assignedNodes({flatten:!0}):e));let r=t.groupBy(e,(e=>e.nodeType===Node.TEXT_NODE?"default":e instanceof Element?e.getAttribute("slot")||"default":void 0));if(t.isEmpty(r))return void(t.isEmpty(this.#r["#slots"])||(this.#y?this.#n["#slots"]={}:this.#r["#slots"]={}));t.each(r,((e,r)=>{if(r){for(;e.length>0;){let r=e[0];if(!(r.nodeType===Node.TEXT_NODE&&t.isBlank(r.textContent)||r instanceof HTMLSlotElement&&t.isEmpty(r.assignedNodes({flatten:!0}))))break;e.shift()}for(;e.length>0;){let r=t.last(e);if(!(r.nodeType===Node.TEXT_NODE&&t.isBlank(r.textContent)||r instanceof HTMLSlotElement&&t.isEmpty(r.assignedNodes({flatten:!0}))))break;e.pop()}}}));let n={};t.each(r,((e,r)=>{t.isEmpty(e)||(n[r]=e)})),this.#y?this.#n["#slots"]=n:this.#r["#slots"]=n}#_(e){let r=this.#h[e];if(!r)return;let n=this.#t[e];if(!this.#r["#slots"][e])return;this.renderAsync(r,t.get(n,"props"));const s=this._asyncDirectives.get(r);let o=s?.buildView(r(t.get(n,"props"))),i=t.reject(t.toArray(o),(e=>e.nodeType===Node.COMMENT_NODE));if(i){let r=this.#m[e];if(!t.isEmpty(r))for(let e=0;e<r.length;e++){const t=r[e];t.parentNode?.removeChild(t)}this.#m[e]=i,this.append(...i),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(e,...t){}#A(e,r,n){if(!this.#y)return;if(S(this.constructor).has(e)){let r=t.camelCase(e);if(t.isNull(n)){n=t.get(this.constructor,s.PROPS)[r]._defaultValue}this._updateProps({[r]:n})}}_regDeps(e,t){let r=this.#i[e];r||(r=this.#i[e]=new Set),r.add(t);let n=e.split(A);if(n.pop(),n.length<1)return;let s=n.join(A);r=this.#i[s],r||(r=this.#i[s]=new Set),r.add(t)}_regWrapper(e){this.#p=e}emit(e,r={},n){n&&n.event&&(r.event=n.event),r.target=this,this.dispatchEvent(new CustomEvent(e,{bubbles:t.get(n,"bubbles",!1),composed:t.get(n,"composed",!1),cancelable:!0,detail:r}))}on(e,t){this.#P[e]||(this.#P[e]=[]);let r=t.bind(this);this.#P[e].push(r),this.addEventListener(e,r)}nextTick(e,t){W.pushNext(e,t)}forceUpdate(){t.each(this.#n,((e,t)=>{this.#s[t]={value:void 0,chain:void 0}})),this.#T()}}class G{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(e,t,r){this.startNode=e,this.attrName=t,this.type=r}setVarIndex(e){this.varIndex=e}getNodes(){let e=this.startNode.nextSibling;if(!this.endNode)return[e];let t=[];for(;e&&e!==this.endNode;)t.push(e),e=e?.nextSibling;return t}}var z;!function(e){e.AFTER_BEGIN="afterbegin"}(z||(z={}));const Q={};function q(r,n,s,o,i,l,c,u=!1){let d;if(u?(P.startRender(r.endNode),d=o(r,n,s,{renderComponent:i,slotComponent:l,varChain:c}),P.endRender(i)):d=o(r,n,s,{renderComponent:i,slotComponent:l,varChain:c}),!d)return;let[p,h]=d;if(p===e.DirectiveUpdateTag.NONE)return;let f=r.getNodes();if(p===e.DirectiveUpdateTag.REMOVE)for(let e=0;e<f.length;e++){const t=f[e];t.parentNode?.removeChild(t)}else if(p===e.DirectiveUpdateTag.REPLACE){let e=[];for(let e=0;e<f.length;e++){const t=f[e];t.parentNode?.removeChild(t)}let n=Qe(r.endNode,h,i);e=t.toArray(n);let s=document.createDocumentFragment();s.append(...e),r.endNode.parentNode.insertBefore(s,r.endNode)}else if(p===e.DirectiveUpdateTag.UPDATE){let e,n={},s=[],o=[],l=je.get(r.endNode);if(h||(h=new et([],[])),t.isEmpty(f)){let e=Qe(r.endNode,h,i);return void r.startNode.after(...e)}let c={};h instanceof et&&h.vars.forEach((e=>{if(e instanceof et){const t=e.getKey();c[t]=e,n[t]=!0,o.push(t)}})),f=t.filter(t.compact(f),(e=>e.nodeType===Node.ELEMENT_NODE)),e=t.filter(t.compact(t.toArray(e)),(e=>e.nodeType===Node.ELEMENT_NODE));let u={},d="",p={};for(let e=0;e<f.length;e++){let t=f[e],r=t.getAttribute("key");if(r){if(u[r]){d=r;break}u[r]=t,s.push(r),p[r]=!0}}if(d)return void a(`${t.camelCase(r.endNode._diName)} - duplicate key '${d}'`);let g=n;const m=r.startNode.parentNode;let y=[],v=[];t.each(p,((e,r)=>{g[r]||(v.push(r),delete p[r],t.remove(s,(e=>e===r)))}));let E,b=!1;if(!t.isEmpty(o)){let e=-1,n=[],i=[],a=0,l=0;for(;l<o.length;l++){const c=o[l];let d=s.findIndex((e=>e===c));if(d<0){let e=o[l-1],t=e?u[e]||e:r.startNode;y.push({prevNode:t,newkey:c}),a++}else if(d>-1&&d!==l-a){if(e<0||1===Math.abs(e-d)){let e=t.last(n);n.push({nodeId:c,targetId:0===l?z.AFTER_BEGIN:e?e.nodeId:o[l-1]})}else i.push({moveGroup:n,moveIndex:l+n.length}),n=[],n.push({nodeId:c,targetId:o[l-1]});e=d}}if(n.length>0&&i.push({moveGroup:n,moveIndex:l+n.length}),i.length>0){b=!0;let e=i.sort(((e,t)=>e.moveGroup.length-t.moveGroup.length));if(e.length<2){let{moveGroup:n}=e[0];if(n.length>1){let e=t.last(n).targetId;n[n.length-2].nodeId===e&&(n=t.initial(n))}n.forEach((({targetId:e,nodeId:t})=>{let n,s=u[t];e===z.AFTER_BEGIN?(n=r.startNode,n.after(s)):(n=u[e],n.after(s))}))}else{let n=t.last(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-n)&&(e=t.initial(e)),e.forEach((({moveGroup:e})=>{e.forEach((({targetId:e,nodeId:t})=>{let n,s=u[t];e===z.AFTER_BEGIN?(n=r.startNode,n.after(s)):(n=u[e],n.after(s))}))}))}}}if(y.length>0&&(E=function(e,r,n,s,o,i){const a=[],l=[],c=[];let u,d=[];e.forEach((e=>{let n=t.last(d);n&&u===e.prevNode?(n.group||(n.group=[u]),n.group.push(e.newkey)):d.push(e),u=e.newkey;let s=e.newkey;c.push(s),a.push(""),l.push(r[s])})),a.push("");let p=new et(a,l),h=[...o],f=Qe(i,p,s),g=je.get(i);o.length=0,o.push(...g);let m=new Map;return f.forEach((e=>{const t=e.getAttribute("key");c.includes(t)&&(m.set(t,!0),Q[t]=e)})),h.forEach(((e,t)=>{const r=e.key+"";!m.get(r)&&n.includes(r)&&o.push(e)})),d}(y,c,o,i,l,r.endNode),E.forEach(((e,n)=>{let s=e.newkey,o=Q[s],i=e.prevNode;if(e.group){let r=document.createDocumentFragment();r.append(...t.map(e.group,(e=>Q[e]))),o=r}i===r.endNode?i.before(o):i===r.startNode?i.after(o):"string"==typeof i?Q[i].after(o):i.after(o)}))),v.forEach((e=>{let t=u[e];t&&t.parentNode&&m.removeChild(t)})),h.vars[0]instanceof et){let e=[],r=[];t.each(h.vars,(n=>{r.push(...n.vars),e.push(...t.map(n.vars,(e=>"1")))})),e.push("1"),h=new et(e,r)}if(b||v.length>0||E){const e=t.groupBy(l,(e=>e.key));let r=[],n=0;o.forEach((t=>{e[t].forEach((e=>{e.varIndex=n++,r.push(e)}))})),l=r}Xe(r.endNode,i,h,l)}}let X=0;function Y(e,t){let r=e.name||"Di-"+X++,n=Symbol.for(r);return(...t)=>{let r=e(...t);return[n,t,r,e=>{},P.popDirectiveQ()]}}const J=["resize","outside","mutate"],Z=new WeakMap,ee=[],te=[],re=[],ne=new ResizeObserver((e=>{for(const t of e){const e=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize,r=Array.isArray(t.borderBoxSize)?t.borderBoxSize[0]:t.borderBoxSize;let n=Z.get(t.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:e.inlineSize,h:e.blockSize}}}),t.target)}}}));var se;!function(e){e.Child="child",e.Tree="tree",e.Attr="attr",e.Char="char"}(se||(se={}));const oe=new WeakMap,ie=new MutationObserver((e=>{for(let t=0;t<e.length;t++){const r=e[t];let n=oe.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=se.Tree,o=n[se.Tree];break;case"childList":s.type=se.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[se.Child];break;case"attributes":s.type=se.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[se.Attr];break;case"characterData":s.type=se.Char,s.oldValue=r.oldValue,o=n[se.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function ae(e,r,n,s){if("resize"===e)!function(e,t){Z.has(e)||(Z.set(e,t),ne.observe(e))}(r,n);else if("outside"===e)switch(s[0]){case"mousedown":!function(e,t){ee.push([e,t])}(r,n);break;case"dblclick":!function(e,t){re.push([e,t])}(r,n);break;default:!function(e,t){te.push([e,t])}(r,n)}else"mutate"===e&&function(e,r,n){let s=t.includes(n,"child"),o=t.includes(n,"attr"),i=t.includes(n,"char"),a=t.includes(n,"tree"),l=oe.get(e);l||(l={},oe.set(e,l),s&&(l[se.Child]=r),o&&(l[se.Attr]=r),i&&(l[se.Char]=r),a&&(l[se.Tree]=r),ie.observe(e,{childList:s,attributes:o,characterData:i,subtree:a}))}(r,n,s)}document.addEventListener("mousedown",(e=>{let r=t.get(e.composedPath(),0,e.target);ee.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1),document.addEventListener("click",(e=>{let r=t.get(e.composedPath(),0,e.target);te.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1),document.addEventListener("dblclick",(e=>{let r=t.get(e.composedPath(),0,e.target);re.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1);const le=/,|^(debounce:.+)|(debounce$)/,ce=/,|^(throttle:.+)|(throttle$)/,ue="self",de="stop",pe="prevent",he="once",fe="left",ge="right",me="middle",ye="ctrl",ve="alt",Ee="shift",be="meta",Te={esc:"escape"},Se=":";function Ce(e,r,n,s){let o,i=e.split("."),a=i.shift(),l=i.includes(he),c=r;if(o=t.find(i,(e=>le.test(e)))){let e=o.split(Se);c=t.debounce(c,parseInt(e[1])||100)}if(o=t.find(i,(e=>ce.test(e)))){let e=o.split(Se);c=t.throttle(c,parseInt(e[1])||100)}if(l&&(c=t.once(c)),function(e){return J.includes(e)}(a))return ae(a,n,c,i),c;let u=e=>{if(i.includes(pe)&&e.preventDefault(),i.includes(de)&&e.stopPropagation(),!i.includes(ue)||e.target===e.currentTarget){if(e instanceof MouseEvent){if(i.includes(fe)&&0!=e.button)return;if(i.includes(ge)&&2!=e.button)return;if(i.includes(me)&&1!=e.button)return}else if(e instanceof KeyboardEvent){if(t.remove(i,(e=>e==ye))[0]&&!e.ctrlKey)return;if(t.remove(i,(e=>e==ve))[0]&&!e.altKey)return;if(t.remove(i,(e=>e==Ee))[0]&&!e.shiftKey)return;if(t.remove(i,(e=>e==be))[0]&&!e.metaKey)return;if(!t.map(i,(e=>Te[e]||e)).includes(e.key.toLowerCase()))return}c(e)}};n.addEventListener(a,u);let d=s.__events[a];return d||(d=s.__events[a]=[]),d.push([n,u]),u}const _e="@",Ne=".",Ae="?",Pe="*",we=":",ke="ref",De="key",Me=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,Oe="slot-props",xe=new Map,Re=new Map,Le=new Map;var Ue;!function(e){e.Event="event",e.Directive="directive",e.DirectiveTag="directiveTag",e.DirectiveAttr="directiveAttr",e.DirectiveProp="directiveProp",e.DirectiveText="directiveText",e.DirectiveSlot="directiveSlot",e.Attr="attr",e.AttrProp="attrProp",e.AttrBool="attrBool",e.AttrRef="attrRef",e.AttrSlot="attrSlot",e.AttrKey="key",e.Ref="ref",e.Text="text"}(Ue||(Ue={}));const We=new WeakMap,je=new WeakMap,He=new WeakMap,Be=new WeakMap,Ie=new WeakMap,Ve=new WeakMap;function $e(e,r){let n="",s=t.concat(r.vars),o=r.strings.length-1,i=r.vars.length-1,a=0;for(let l=0;l<=o;l++){const o=r.strings[l];let c=t.get(s,a,"");if(c instanceof et){let[t,r]=$e(e,c);c=t,s.splice(a,1,...r),a+=r.length-1}else c=l>i?"":Fe;a++,n=n+o+c}let l=0;return n=n.replace(Me,((e,r)=>t.replaceAll(e,Fe,(()=>Fe.replace("--\x3e","")+l++)))),n=n.replace(Ze,"$1><").trim(),[n,s]}const Fe="\x3c!--c_ui-pl_df--\x3e",Ke="\x3c!--c_ui-pl_df",Ge=/<!--c_ui-pl_df\d*(-->)?/;function ze(r,n,s,o,i=!1){const a=document.createElement("div");a.innerHTML=n;const l=Le.has(o.constructor);i||!l||Re.has(o.constructor)||Re.set(o.constructor,a.cloneNode(!0));let c=0;const u=document.createNodeIterator(a,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let d,p,h=0,f=l?void 0:{},g=null,m="";for(;d=u.nextNode();){c++;let n=l?void 0:[];if(p&&!p.contains(d)&&(p=void 0),d instanceof HTMLElement||d instanceof SVGElement){d instanceof K&&(p=d);let i={},a=t.toArray(d.attributes);for(let l=0;l<a.length;l++){const c=a[l];let{name:u,value:f}=c;if(u!==Oe)if(t.startsWith(u,Ke)){let i=s[h];if(t.isArray(i)&&t.isSymbol(i[0])){let[,t,s,a,l]=i;a(e.EnterPointType.TAG);let c=new G(d,u.substring(1),e.EnterPointType.TAG),f=Ve.get(d);f||(f={},Ve.set(d,f)),f[Symbol.keyFor(i[0])]=[c,o,p];let y=new N(h,d);y.isDirective=!0,y.value=i,y.isComponent=!!p,r.push(y),g&&g?.contains(d)&&(y.key=m),h++,s(c,t,void 0,{renderComponent:o,slotComponent:p,varChain:l}),n&&n.push({type:Ue.DirectiveTag,point:c,up:y,name:u})}d.removeAttribute(u)}else if(u[0]!==_e)if(u!==ke)if(u!==De){if(Ge.test(f)){let a=s[h],l=new N(h,d,u.replace(/\.|\?|@/,""),f);if(l.isComponent=!!p,g&&g?.contains(d)&&(l.key=m),u[0]===Ne||u[0]===Ae||u[0]===Pe){if(t.isArray(a)&&t.isSymbol(a[0])){let[,t,r,s,i]=a;s(e.EnterPointType.PROP);let c=u.substring(1),h=new G(d,c,e.EnterPointType.PROP),f=Ve.get(d);f||(f={},Ve.set(d,f)),f[c]=[h,o,p],r(h,t,void 0,{renderComponent:o,slotComponent:p}),l.value=a,l.isDirective=!0,n&&n.push({type:Ue.DirectiveProp,up:l,point:h,name:u,attrName:c})}else if(u[0]===Ae){l.isToggleProp=!0,l.value=!!a;let e=u.substring(1);l.value&&d.setAttribute(e,""),n&&n.push({type:Ue.AttrBool,name:e,up:l,attrName:u})}else if(u[0]===Pe){l.value=a;let e=u.substring(1);const[r,s]=e.split(we);let o=r;switch(s){case"camel":o=t.camelCase(o);break;case"kebab":o=t.kebabCase(o);break;case"snake":o=t.snakeCase(o)}l.attrName=o,d.setAttribute(o,a),n&&n.push({type:Ue.AttrRef,up:l,name:u,attrName:o})}else{let e=t.camelCase(u.substring(1)),r=k.get(a);r&&(d._propObjectKeyMap[r.join(A)]=e),l.value=a,l.isProp=!0,i[e]=a,n&&n.push({type:Ue.AttrProp,up:l,name:e,attrName:u})}d.removeAttribute(u),a=""}else{let r,s;l.value=a;let i={type:Ue.Attr,up:l,attrName:u};if(t.isArray(a)&&t.isSymbol(a[0])){let t=e.EnterPointType.ATTR;"class"===u?t=e.EnterPointType.CLASS:"style"===u&&(t=e.EnterPointType.STYLE);let[,n,c,h,f]=a;h(t),l.isDirective=!0,l.attrName=u;let g=new G(d,u,t),m=Ve.get(d);m||(m={},Ve.set(d,m)),m[u]=[g,o,p],s=n,r=c,a="",i.type=Ue.DirectiveAttr,i.point=g}f=t.replace(f,Ge,a),c.value=f,r&&r(i.point,s,void 0,{renderComponent:o,slotComponent:p}),n&&n.push(i)}r.push(l),h++}}else{let e=s[h];d.setAttribute(u,e);let t=new N(h,d);t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),h++,g=d,m=e,n&&n.push({up:t,type:Ue.AttrKey}),r.length>0&&r.forEach((t=>{t.key=t.key??e}))}else{if(Ge.test(f)){let e=s[h],t=new N(h,d);t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),h++,e.current=d,n&&n.push({type:Ue.Ref,up:t,attrName:u})}d.removeAttribute(u)}else{let e=e=>{},t=null,i=!1;if(Ge.test(f)){t=new N(h,d),t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),e=s[h].bind(o),h++,i=!0}let a=u.substring(1);Ce(a,e,d,o),d.removeAttribute(u),n&&n.push({type:Ue.Event,up:t,name:a,attrName:u,value:i})}else{let e=d.getAttribute("name")||"default";n&&n.push({type:Ue.AttrSlot,name:e,attrName:u})}}d instanceof K?(d._initProps(i),d._regWrapper(o)):d instanceof HTMLSlotElement&&o._bindSlot(d,d.name||"default",i)}else{let i=d;if(`\x3c!--${i.nodeValue}--\x3e`!==Fe)continue;let a=new N(h,d);g&&g?.contains(d)&&(a.key=m),r.push(a),a.isComponent=!!p,a.isText=!0;let l=s[h];if(t.isArray(l)&&t.isSymbol(l[0])){const t=Symbol.keyFor(l[0]);let r;r=document.createComment(`compelem-${o.tagName}-${t}-start`),a.textNode=r,i.parentNode.insertBefore(r,i),i.nodeValue=`compelem-${o.tagName}-${t}-end`,i._diName=t,a.isDirective=!0,a.value=l;let s=p?e.EnterPointType.SLOT:e.EnterPointType.TEXT,[,c,u,d,h]=l;d(s);let f=new G(r,"",s);f.endNode=i,Be.set(i,[f,o,p,c,h]),He.set(i,u),Ie.set(i,a),P.startRender(i);let g=u(f,c,void 0,{renderComponent:o,slotComponent:p,varChain:h});if(P.endRender(o),g){let e=Qe(i,g[1],o);e&&e.length>0&&Ye.insertBefore(i,Array.from(e))}l=void 0,n&&n.push({type:s===e.EnterPointType.SLOT?Ue.DirectiveSlot:Ue.DirectiveText,up:a,point:f})}else a.value=l,n&&n.push({type:Ue.Text,up:a});h++;let c=t.toString(l??""),u=document.createTextNode(c);i.parentNode.insertBefore(u,i),a.textNode=u}f&&n&&(f[c]=n),g&&!g.contains(d)&&g!==d&&(g=null,m="")}return!i&&f&&Le.set(o.constructor,f),a.childNodes}function Qe(e,t,r){let[n,s]=$e(r,t),o=[],i=ze(o,n,s,r,!0);return je.set(e,o),i}function qe(r,n,s,o){if(t.isBlank(t.join(r.strings)))return;if(!We.has(n))return;let i=r.flatVars(n);s=s??We.get(n);for(let r=0;r<s.length;r++){const a=s[r];let l=a.varIndex;if(l<0)continue;if(a.notUpdated)continue;let c=a.value,u=i,d=a.node,p=t.split(l,A);for(let e=0;e<p.length;e++){const n=p[e];u=t.get(u,n),u&&u.vars&&r<p.length-1&&(u=u.vars)}if(!t.isObject(c)&&c===u)continue;let h=d;if(a.isDirective){let[t,r,n,,s]=a.value,o=Be.get(d);if(!o){const e=Ve.get(d);o=e[a.attrName]||e[Symbol.keyFor(t)]}let[i,l,c]=o,[,p]=u;const h=Ie.get(d);if(h){h.value=u;Be.get(d)[3]=p}q(i,p,r,n,l,c,s,i.type==e.EnterPointType.TEXT||i.type==e.EnterPointType.SLOT)}else if(a.isToggleProp){if(!!u===c)continue;h.toggleAttribute(a.attrName,!!u),t.set(h,a.attrName,!!u)}else if(a.isProp){if(!t.isObject(u)&&u===c)continue;if(d instanceof K)if(t.isObject(u)&&Object.is(u,c)){let e=t.camelCase(a.attrName),r=[e];if(o&&o.length>0){let n="",s=t.join(k.get(a.value),A);o.forEach((e=>{e.startsWith(s)&&e.length>n.length&&(n=e)})),r=t.concat(t.split(n.replace(s,e),A))}L(d,c,r)}else d._updateProps({[a.attrName]:u});else d instanceof HTMLSlotElement&&n._updateSlot(d.getAttribute("name")||"default",a.attrName,u)}else if(a.attrName){if(!t.isEqual(c,u))switch(a.attrName){case"value":if(d instanceof HTMLInputElement){d.value=u;break}default:d.setAttribute(a.attrName,t.replace(a.attrTmpl,Ge,u+""))}}else if(a.isText){a.textNode.textContent=t.toString(u??"")}a.value=u}}function Xe(e,r,n,s){const o=He.get(e),[i,a,l,c,u]=Be.get(e),d=Ie.get(e);if(!n){let e=o(i,d.value[1],c,{renderComponent:a,slotComponent:l,varChain:u});if(!e)return;n=e[1]}if(n&&n.vars[0]instanceof et){let e=[],r=[];t.each(n.vars,(n=>{r.push(...n.vars),e.push(...t.map(n.vars,(e=>"1")))})),e.push("1"),n=new et(e,r)}s&&je.set(e,s),qe(n,r,s=s??je.get(e))}const Ye={insertBefore:function(e,t){if(!e.parentNode)return;let r=document.createDocumentFragment();r.append(...t),e.parentNode.insertBefore(r,e)},remove:function(e,t){if(e===t)return void e?.parentNode?.removeChild(e);let r=e.nextSibling;for(;r&&r!==t;)r?.parentNode?.removeChild(r),r=e.nextSibling}};function Je(e,...r){return new et(t.isString(e)?[e]:e,r)}const Ze=/([a-z0-9"'])\s*>\s*</gim;class et{strings;vars;constructor(e,r){this.strings=t.concat(e),this.vars=r}getKey(){let e=this.vars,n="";return t.each(this.strings,((s,o)=>{if(r.test(s))return n=t.toString(e[o]),!1})),n}getKeys(){let e=this.vars,n=[];for(let s=0;s<this.strings.length;s++){const o=this.strings[s];if(r.test(o)){let r=t.toString(e[s]);n.push(r)}}return t.isEmpty(n)&&e.forEach((e=>{if(e instanceof et){let t=e.getKey();n.push(t)}})),n}append(e){let r=t.last(this.strings);return e.strings.forEach(((e,t)=>{0!=t?this.strings.push(e):this.strings[this.strings.length-1]=r+e})),this.vars=t.concat(this.vars,e.vars),this}insert(e,t){let r=t.strings.shift();return this.strings[e]+=r,this.strings.splice(e+1,0,...t.strings),this.vars.splice(e,0,...t.vars),this}getHTML(e){let[r,n]=$e(e,this),s=ze([],r,n,e);return t.reduce(s,((e,t)=>e+(t.outerHTML??"")),"")}flatVars(e){let r=t.concat(this.vars),n=this.strings.length-1,s=0;for(let o=0;o<=n;o++){let n=t.get(r,s,"");if(n instanceof et&&n.vars.length>0){let[t,o]=$e(e,n);n=t,r.splice(s,1,...o),s+=o.length-1}s++}return r}}const tt=v(class extends p{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.get(e,n);t.set(e,n,t.debounce(o,this.wait,this.immediate));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;immediate;result;constructor(e,t=!1){super(),this.wait=e,this.immediate=t}});const rt=v(class extends p{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.bind(t.get(e,n),e);t.set(e,n,t.once(o));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;result;constructor(){super()}});var nt;e.QueryCache=void 0,(nt=e.QueryCache||(e.QueryCache={})).ONCE="once",nt.UPDATABLE="updatable";class st extends p{static get priority(){return Number.MAX_VALUE}created(e,t,r,...n){}mounted(e,t,...r){}get targets(){return[e.DecoratorType.FIELD]}selector;cache;result;constructor(e,t){super(),this.selector=e,this.cache=t}static getKey(e){return e}getter(e){this.result=e.shadowRoot?.querySelector(this.selector)}beforeMount(e,t,r,n,...s){const o=this;Reflect.defineProperty(e,n,{get:()=>(o.result&&o.cache||o.getter(e),o.result)})}updated(t,r){this.cache===e.QueryCache.UPDATABLE&&this.getter(t)}}const ot=v(st),it=v(class extends st{getter(e){this.result=e.shadowRoot?.querySelectorAll(this.selector)}});function at(e,r,n){if(!t.has(e.constructor,s.STATES)){const r={};let n=e.constructor;for(;(n=u(n))!==K;)t.merge(r,n[s.STATES]?t.cloneDeep(n[s.STATES]):{});Reflect.defineProperty(e.constructor,s.STATES,{configurable:!1,enumerable:!1,value:r})}n.shallow=n.shallow||!1,e.constructor[s.STATES][r]=n}const lt=v(class extends p{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.get(e,n);t.set(e,n,t.throttle(o,this.wait));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;result;constructor(e){super(),this.wait=e}});const ct=["key"],ut=Y((function(e){return(e,[r],n)=>{let o=e.startNode;if(n)t.each(r,((e,t)=>{o.setAttribute(t,e)}));else if(o instanceof K){let e={},n={},i=t.get(o.constructor,s.PROPS);t.each(r,((r,s)=>{if(ct.includes(s))return;let o=t.camelCase(s);i[o]?e[s]=r:n[s]=r+""})),o._initProps(e,n)}else t.each(r,((e,t)=>{o.setAttribute(t,e)}))}}),e.EnterPointType.TAG),dt=new Map,pt=Y((function(e){return(e,[r],n,{renderComponent:s})=>{let o=[];if(t.isArray(r)?o=t.compact(r):t.isObject(r)?o=t.flatMap(r,((e,t)=>e?t:[])):t.isString(r)&&(o=r.split(" ")),o.length<1&&!n)return;let i=e.startNode;if(dt.get(i)&&dt.get(i).length===o.length&&t.isMatch(dt.get(i),o))return;let a=dt.get(i);t.each(a,(e=>{i.classList.remove(e)})),t.each(o,(e=>{i.classList.add(e)})),a=t.concat(o),dt.set(i,a)}}),e.EnterPointType.CLASS),ht=new Map,ft=new Map,gt=Y((function(n,s){return(n,o,i,{varChain:l})=>{let c=n.startNode,u=function(e,n,s){let o=t.map(e,((e,t)=>n(e,t)));if(o.length<1){let e=new et([],[]);return ft.set(s,e),e}let i=[],l=[];const c=[],u=[];for(let e=0;e<o.length;e++){const n=o[e];let s=t.last(l),d=n.vars,p=!0,h=n.strings;for(let e=0;e<h.length;e++){const t=h[e];if(r.test(t)){let t=d[e]+"";if(i.includes(t))return void a(`forEach - duplicate key '${t}'`);i.push(t),p=!1}0==e&&s?l[l.length-1]=s+t:l.push(t)}if(p)return void a("forEach - missing 'key' prop");let f=t.last(c);f&&h.length>0&&(c[c.length-1]=t.trim(f)+h.shift()),c.push(""),u.push(n)}c.push("");let d=new et(c,u);return ft.set(s,d),d}(o[0],s,c);if(i&&i[0]){const r=ht.get(c);if(t.isEmpty(n.getNodes())&&(!o||t.isEmpty(o[0])))return[e.DirectiveUpdateTag.NONE,u];if(r&&t.isMatch(r,o[0])&&r.length===o[0].length)return[e.DirectiveUpdateTag.NONE,u]}return ht.set(c,t.clone(o[0])),i?[e.DirectiveUpdateTag.UPDATE,u]:[e.DirectiveUpdateTag.APPEND,u]}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));const mt=new WeakMap,yt=Y((function(t,r,n){return(s,[o,i],a,{renderComponent:l})=>{let c=s.endNode;if(a){if(!!o==!!a[0]){let t=mt.get(c);return[e.DirectiveUpdateTag.NONE,t.call(l,o)]}let t=o?r:n;return mt.set(c,t),[e.DirectiveUpdateTag.REPLACE,t.call(l,o)]}{let s=o?r:n;return mt.set(c,s),[e.DirectiveUpdateTag.APPEND,s.call(l,t)]}}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT)),vt=Y((function(t,r){return(t,[r,n],s)=>s?r===s[0]?[e.DirectiveUpdateTag.NONE,r?n():Je``]:r?[e.DirectiveUpdateTag.REPLACE,r?n():Je``]:[e.DirectiveUpdateTag.REMOVE]:[e.DirectiveUpdateTag.APPEND,r?n():Je``]}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));var Et;e.ModelTriggerType=void 0,(Et=e.ModelTriggerType||(e.ModelTriggerType={})).CHANGE="change",Et.INPUT="input";const bt=new WeakMap,Tt=Y((function(e,r="value"){return(n,s,o,{varChain:i,renderComponent:a})=>{const l=n.startNode;if(o){if(t.isEqual(s,o))return;if(!t.isEqual(s,o)){let e=s[0];if(l instanceof K)l._updateProps({[r]:e});else if(l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement){if(l.setAttribute(r,e+""),l instanceof HTMLSelectElement){let r=t.find(l.querySelectorAll("option"),(t=>t.value==e));r&&(r.selected=!0)}}else if(l instanceof HTMLInputElement){if(l.value==e)return;switch(l.type){case"checkbox":case"radio":e?l.setAttribute("checked",""):l.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":l.setAttribute(r,e+""),t.set(l,r,e);break;default:l.setAttribute(r,e+"")}}}return}if("binded"===t.get(l,"_model"))return;let c=t.last(i),u=c.join(A),d=Object.keys(a._propObjectKeyMap);if(d.length>0&&t.each(d,(e=>{if(u.startsWith(e)){let t=u.replace(e,a._propObjectKeyMap[e]);return c=t.split(A),!1}})),bt.set(l,c),t.isObject(e)||t.trim(e)||(e=""),l instanceof K)l._initProps({[r]:e}),l.addEventListener("update:"+r,(e=>{t.set(a,c,e.detail.value)})),t.set(l,"_model","binded");else if(l instanceof HTMLTextAreaElement)l.setAttribute(r,e+""),l.addEventListener("input",(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded");else if(l instanceof HTMLInputElement){let n="",s="";switch(l.type){case"checkbox":case"radio":n="checked",s="change";break;default:n="value",s="input"}l.setAttribute(r??n,e+""),l.addEventListener(s,(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded")}else l instanceof HTMLSelectElement&&(l.setAttribute(r,e+""),l.addEventListener("change",(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded"))}}),e.EnterPointType.TAG),St=new Map,Ct=Y((function(e,t){return(e,[r],n)=>{if(n&&r===n[0])return;let s=e.startNode;if(!St.has(s)){let e=s.style.display;St.set(s,"none"==e?"unset":e)}s.style.display=r?St.get(s):"none",t&&t(s,r)}}),e.EnterPointType.TAG),_t=Y((function(e,t){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(e=e.bind(o),i._bindSlotHook(t||"default",e))}}),e.EnterPointType.SLOT);class Nt{static getCssText(e,r=!1){return t.isString(e)?e:t.join(t.map(e,((e,n)=>n.startsWith("--")?n+":"+e+(r?" !important":""):t.kebabCase(n)+":"+e+(r?" !important":""))),";")}static setStyle(e,r){if(t.isString(e)&&!t.trim(e))return{};let n=Nt.getCssText(e),s={};return t.each(n.split(";"),(e=>{let n=e.split(":"),o=t.trim(n[0]),i=t.trim(n[1]);s[o]=r.style.getPropertyValue(o),r.style.setProperty(o,i)})),s}}const At=new Map;let Pt=0;const wt=Y((function(e){return(e,t,r,{renderComponent:n})=>{let s=e.startNode,o=At.get(s);o||(o="style_d"+Pt++,At.set(s,o)),n.nextTick((()=>{Nt.setStyle(t[0],s)}),o)}}),e.EnterPointType.STYLE),kt=Y((function(e){return(r,n,s,{renderComponent:o,varChain:i})=>{const a=r.startNode;if(s){if(!t.isEqual(n,s)){let e=r.attrName;a._updateProps({[e]:n[0]})}return}let l=t.last(i),c=r.attrName;a._initProps({[c]:e}),a.addEventListener("update:"+c,(e=>{t.set(o,l,e.detail.value)}))}}),e.EnterPointType.PROP),Dt=Y((function(r,n){return(r,[n,s],o)=>{let i=()=>Je``,a=[],l=[];t.each(s,((e,r)=>{if(t.isFunction(e))a.push(r),l.push(e);else{let t=e[0],r=e[1];a.push(t),l.push(r)}"default"===r&&(i=e)}));let c=t.findIndex(a,(e=>t.isFunction(e)?e(n):e==n));return o?[e.DirectiveUpdateTag.REPLACE,t.call(l[c]??i)]:[e.DirectiveUpdateTag.APPEND,t.call(l[c]??i)]}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));e.CompElem=K,e.CssHelper=Nt,e.Decorator=p,e.DecoratorWrapper=m,e.EnterPoint=G,e.GetKeyFnName=h,e.PATH_SEPARATOR=A,e.PROP_OBJECT_KEY_MAP_SYMBOL=F,e.Template=et,e.UpdatePoint=N,e._DecoratorMap=g,e._DecoratorsKey=f,e._getObservedAttrs=S,e.bind=ut,e.buildHTML=$e,e.classes=pt,e.computed=function(e,r,n){n.get||a(`Computed '${r}' must be a getter`),t.has(e.constructor,s.COMPUTED)||(e.constructor[s.COMPUTED]=t.isEmpty(e.constructor[s.COMPUTED])?{}:t.cloneDeep(e.constructor[s.COMPUTED])),e.constructor[s.COMPUTED][r]=n.get},e.createRef=function(e){return{current:e}},e.debounced=tt,e.decorator=v,e.directive=Y,e.event=function(e,r){return(n,o,i)=>{t.has(n.constructor,s.EVENTS)||(n.constructor[s.EVENTS]=t.isEmpty(n.constructor[s.EVENTS])?[]:t.cloneDeep(n.constructor[s.EVENTS])),n.constructor[s.EVENTS].push({name:e,options:r,fn:n[o]})}},e.forEach=gt,e.html=Je,e.ifElse=yt,e.ifTrue=vt,e.makeState=function(e,t,r){at(e.prototype,t,r||{prop:""})},e.model=Tt,e.onced=rt,e.prop=function(e){if(1===arguments.length)return(t,r,n)=>{e.required=e.required||!1,e.attribute=!1!==e.attribute,b(t,r,e,n)};let r=arguments[0],n=arguments[1],s=arguments[2];e={type:void 0,required:!1,attribute:!0},s&&"function"==typeof s.type&&(e=t.defaults(s,e),s=void 0),b(r,n,e,s)},e.query=ot,e.queryAll=it,e.show=Ct,e.slot=_t,e.state=function(e){if(1===arguments.length)return(t,r)=>{at(t,r,e)};at(arguments[0],arguments[1],{prop:""})},e.styles=wt,e.sync=kt,e.tag=function(e){return t=>{if(t){if(t.prototype.hasOwnProperty("attributeChangedCallback")){let e=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,r,n){K.prototype.attributeChangedCallback.call(this,t,r,n),e.call(this,t,r,n)}}if(t.prototype.hasOwnProperty("connectedCallback")){let e=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){K.prototype.connectedCallback.call(this),e.call(this)}}if(t.prototype.hasOwnProperty("disconnectedCallback")){let e=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){K.prototype.disconnectedCallback.call(this),e.call(this)}}customElements.define(e,t)}}},e.throttled=lt,e.updateDirective=q,e.watch=function(e,r){return(n,o)=>{t.has(n.constructor,s.WATCH)||(n.constructor[s.WATCH]=t.isEmpty(n.constructor[s.WATCH])?{}:t.cloneDeep(n.constructor[s.WATCH]));(t.isArray(e)?e:[e]).forEach((e=>{let i=e.replaceAll(".",A),a=n.constructor[s.WATCH][i];t.isArray(a)||(a=n.constructor[s.WATCH][i]=[]),a.push({source:e,options:r,handler:n[o]})}))}},e.when=Dt,Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/constants.d.ts
CHANGED
package/decorators/prop.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* compelem v0.
|
|
2
|
+
* compelem v0.7.0-b1.1759918554
|
|
3
3
|
* A modern, reactive, fast, lightweight and flexible lib for building web components
|
|
4
4
|
* @holyhigh2
|
|
5
5
|
* https://github.com/holyhigh2/compelem
|
|
6
6
|
*/
|
|
7
|
-
import{toPath as t,some as e,isString as r,isUndefined as n,isBlank as s,get as o,isObject as i,isDefined as a,isEmpty as l,has as c,concat as u,defaults as d,isLowerCaseChar as p,merge as h,cloneDeep as f,each as g,kebabCase as m,toArray as v,last as b,startsWith as E,isFunction as y,isArray as S,initial as N,flatMap as _,test as C,size as T,assign as A,first as w,closest as P,once as k,bind as M,camelCase as D,isNil as x,trim as O,isBoolean as R,parseJSON as L,isNull as W,debounce as H,set as $,groupBy as V,reject as I,filter as U,compact as B,remove as j,map as F,includes as z,find as G,throttle as K,join as X,split as Q,isEqual as q,replace as Y,toString as Z,replaceAll as J,isSymbol as tt,snakeCase as et,clone as rt,reduce as nt,isMatch as st,findIndex as ot,call as it}from"myfx";const at=new WeakMap,lt=/\s+\.?key\s*=/;var ct,ut,dt,pt;function ht(t){console.error("[CompElem]",t)}function ft(t,e){console.error(`[CompElem <${t}>]`,e)}function gt(e){return t(e).join("-")}function mt(t){return Object.getPrototypeOf(t)}function vt(t){let e=t;return r(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||s(e))&&(e=!0),e}!function(t){t[t.CSS=1]="CSS",t[t.COMPUTED=2]="COMPUTED"}(ct||(ct={})),function(t){t.PROPS="__deco_props",t.STATES="__deco_states",t.COMPUTED="__deco_computed",t.WATCH="__deco_watch",t.EVENTS="__deco_events"}(ut||(ut={})),function(t){t.Prod="prod",t.Dev="dev"}(dt||(dt={})),function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(pt||(pt={}));class bt{static get priority(){return 0}}const Et="getKey",yt="__decorators",St=new WeakMap;class Nt{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(t,e,r){this.args=t,this.metadata=e,this.decoratorClass=r,this.priority=o(r,"priority",0),this.instanceMap=new WeakMap}create(t){let e,r=new this.decoratorClass(...this.args),s=r.targets,c=this.metadata[2];i(c)&&a(o(c,"configurable"))?e=pt.METHOD:n(this.metadata[2])&&(e=pt.FIELD),!l(s)&&e&&s.includes(e)?(r.created(t,...this.metadata),this.instanceMap.set(t,r)):ht(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${s.join(",")}' bug got '${e}'`)}beforeMount(t,e){this.instanceMap.get(t).beforeMount(t,e,...this.metadata)}mounted(t,e){this.instanceMap.get(t).mounted(t,e,...this.metadata)}updated(t,e){this.instanceMap.get(t).updated(t,e)}}const _t=new WeakMap;function Ct(t){let e=(...e)=>(...r)=>{let n=r[0].constructor,s=n[yt];if(!c(n,yt)){let t=Object.getPrototypeOf(n);s=t?u(t[yt]??[]):[],Reflect.defineProperty(n,yt,{configurable:!1,enumerable:!1,value:s})}let o,i={},a=t[Et];if(a){let r=_t.get(t);if(r||(r=new WeakMap,_t.set(t,r)),i=r.get(n),i||(i={},r.set(n,i)),o=a(...e),i[o])return i[o]}let l=new Nt(e,r,t);return i[o]=l,s?.push(l),l};return St.set(e,!0),e}const Tt=new WeakMap;function At(t){if(1===arguments.length)return(e,r,n)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,wt(e,r,t,n)};let e=arguments[0],r=arguments[1],n=arguments[2];t={type:void 0,required:!1,attribute:!0},n&&"function"==typeof n.type&&(t=d(n,t),n=void 0),wt(e,r,t,n)}function wt(t,e,r,n){let s;if(p(e[0])||ht(`Prop '${e}' must be in CamelCase`),!c(t.constructor,ut.PROPS)){const e={};let r=t.constructor;for(;(r=mt(r))!==Gt;)h(e,r[ut.PROPS]?f(r[ut.PROPS]):{});Reflect.defineProperty(t.constructor,ut.PROPS,{configurable:!1,enumerable:!1,value:e}),s=new Set,g(e,((t,e)=>{if(t.attribute){let t=m(e);s?.add(t)}})),Tt.set(t.constructor,s)}if(n&&(n.get&&(r.getter=n.get),n.set&&(r.setter=n.set)),r.attribute){s||(s=Tt.get(t.constructor));let r=m(e);s?.add(r)}c(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),t.constructor.observedAttributes=v(s),r.shallow=r.shallow||!1,t.constructor[ut.PROPS][e]=r}const Pt=new Set;function kt(t){return Tt.get(t)??Pt}const Mt={collectWatch(t,e,r){let n=Lt.get(t);n||(n={},Lt.set(t,n));let s=n[r];s||(s=n[r]=[]),s.push(e)},startCollect(t,e){this.__collectType=e,this.__collecting=t},setUpdater(t){this.__updater=t},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(t){let e=b(this.__directiveQ);const r=t?t.join(","):"",n=e?e.join(","):"";e&&r===n||(e&&e.length<t.length&&E(r,n)?this.__directiveQ[this.__directiveQ.length-1]=t:this.__directiveQ.push(t))},popDirectiveQ(){let t=u(this.__directiveQ);return this.__directiveQ=[],t},startRender(t){this.__renderCollecting=!0,this.__renderContext=t},endRender(t){this.__renderCollection.forEach((e=>{t._regDeps(e,this.__renderContext)})),this.__renderCollection.clear(),this.__renderCollecting=!1,this.__renderContext=null},collect(t){this.__renderCollection.add(t)},clear(){this.__directiveQ=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},Dt=new WeakMap,xt=new WeakMap,Ot=new WeakMap,Rt=new WeakMap,Lt=new WeakMap,Wt=new WeakSet;function Ht(t,e){if(!i(t))return t;const r=Wt.has(t)?t:new Proxy(t,{get(t,e,r){if(!e)return;const n=Reflect.get(t,e,r);if("string"!=typeof e&&"number"!=typeof e)return n;let s=e in t;if((Mt.__renderCollecting||Mt.__collecting)&&(s&&t.hasOwnProperty(e)||!s)){let t=xt.get(r)??[],s=u(t,[e]);if(s.length>1){let t=Dt.get(r).from,e=o(t.constructor,ut.PROPS),i=o(t.constructor,ut.STATES);if(o(e,[s[0],"shallow"])||o(i,[s[0],"shallow"]))return n}let i=s.join("-");if(Mt.__renderCollecting)Mt.collect(gt(s)),Mt.setDirectiveQ(s);else if(Mt.__collecting){let t;switch(Mt.__collectType){case ct.COMPUTED:t=Ot.get(Mt.__collecting),t||(t={},Ot.set(Mt.__collecting,t));break;case ct.CSS:t=Rt.get(Mt.__collecting),t||(t={},Rt.set(Mt.__collecting,t))}let e=t[i];e||(e=t[i]=[]),e.push(Mt.__updater)}}return n},set(t,e,r,n){if(!e)return!1;let s=t[e];if(!i(s)&&s===r)return!0;if(Number.isNaN(r)&&Number.isNaN(s))return!0;let a=xt.get(n)??[],c=u(a,[e]),d=Dt.get(n).from,p=o(d.constructor,ut.PROPS),h=o(d.constructor,ut.STATES),f=o(p,[c[0],"hasChanged"])||o(h,[c[0],"hasChanged"]);if(f){if(!f.call(d,r,s))return!0}else if(s===r&&!at.has(s))return!0;p&&p[e]&&t.__isData&&p[e].sync&&d.emit("update:"+e,{value:r});let g=Dt.get(n)?.contextSet,m=r;!i(r)||y(r)||r instanceof Node||Object.isFrozen(r)||g.forEach((t=>{let r=Dt.get(n)?.pathMap,s=r?.get(t);s&&(c=u(s,[e]),xt.set(m,c),m=Ht(m,t),Wt.add(m),xt.set(m,c))}));let v=Reflect.set(t,e,m),b=Dt.get(n).pathMap;return g.forEach((t=>{let r=b.get(t);if(!r)return;t===d&&a.length>1&&r.length>1&&a[0]===r[0]&&(r=a),c=u(r,"length"==e&&S(n)?[]:[e]);let i=Ot.get(t),p=Rt.get(t),h=Lt.get(t);if(i||p||h){let t=c.length;for(;t;){let e=c.slice(0,t).join("-");if(h){const r=h[e];t===c.length?r?.forEach((t=>{let e=t();e.ov=s,Vt.pushWatch(e)})):r?.forEach((t=>{let e=t();o(e,"deep")&&(e.ov=s,Vt.pushWatch(e))}))}if(i){let t=i[e];if(!l(t))for(let e=0;e<t.length;e++){const r=t[e];Vt.pushComputed(r)}}if(p){let t=p[e];if(!l(t))for(let e=0;e<t.length;e++){const r=t[e];Vt.pushCss(r)}}t--}}let f=t._notify(s,c);Vt.pushNext(f,t.cid)})),v}});Wt.has(r)||Wt.add(r);let n=xt.get(t)??[];if(Object.isExtensible(t)&&!Dt.get(r)){let t=new Set;t.add(e);let s=new WeakMap;s.set(e,n),Dt.set(r,{from:e,contextSet:t,pathMap:s})}else{Dt.get(r).contextSet.add(e);let t=Dt.get(r).pathMap,s=t.get(e),i=u(n);if(s&&s.join("")!==i.join("")){let t=o(e,N(s));S(t)||function(...t){console.warn("[CompElem]",...t)}(`The object is referenced by more than one @state '${i.join(".")},${s.join(".")}'`),s=i}else t.set(e,i)}let s=o(e.constructor,ut.PROPS),a=o(e.constructor,ut.STATES);for(let r in t){const l=t[r];let c=o(s,[r,"shallow"])||o(a,[r,"shallow"]);!i(l)||Wt.has(l)||y(l)||l instanceof Node||Object.isFrozen(l)||c||(xt.set(l,u(n,[r])),t[r]=Ht(l,e),Wt.add(t[r]),xt.set(t[r],u(n,[r])))}return r}const $t=new Map;class Vt{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){Vt.nextPending=!1;let t=Array.from(Vt.watchSet);Vt.watchSet.clear();let e=Array.from(Vt.computedSet);Vt.computedSet.clear();let r=Array.from(Vt.cssSet);Vt.cssSet.clear();let n=Array.from(Vt.nextSet);Vt.nextSet.clear(),t.forEach((t=>t(o(t,"ov")))),e.forEach((t=>t())),r.forEach((t=>t())),n.forEach((t=>t())),$t.clear()}static pushWatch(t){Vt.watchSet.add(t)}static pushComputed(t){Vt.computedSet.add(t)}static pushCss(t){Vt.cssSet.add(t)}static pushNext(t,e){if(e){if($t.has(e))return;$t.set(e,t)}Vt.nextSet.add(t),Vt.nextPending||(Vt.nextPending=!0,Vt.next())}}(()=>{const t=Promise.resolve(),e=Vt.flush;Vt.next=()=>{t.then(e)}})();const It={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},Ut=new WeakMap;let Bt=[],jt=0;const Ft=new Map,zt=new WeakMap;class Gt extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){Bt=_(t.css,(t=>{if(r(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,g(t,((t,e)=>{C(e[0],/[A-Z]/)}))}#t;#e={};#r={"#slots":{}};#n={};#s={};#o;#i={};__events={};get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get reactiveData(){return this.#n}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#u}get parentComponent(){return this.#d}get wrapperComponent(){return this.#p}get slotHooks(){return this.#h}get css(){return Ut.get(this.constructor)}get globalStyleSheet(){return Ft.get(this.constructor)?.sheet}get isMounted(){return this.#f}get slots(){return this.#r["#slots"]}#a;#l;#c;#u;#d;#p;#g={};#h={};#m={};#f=!1;static get styles(){return[]}static get globalStyles(){return[]}static get hostStyles(){return[]}get styles(){return[]}#v=!1;#b=!1;constructor(...t){super(),this.#t=jt++,1===T(t)&&(this.#l={},A(this.#l,w(t)));let e=this.render.bind(this);this.render=function(){let t;return Mt.startRender(this),t=e(),Mt.endRender(this),t};let n=o(this.constructor,"globalStyles"),s=Ft.has(this.constructor);if(!l(n)&&!s){let t="";n.forEach((e=>{r(e)&&(t+=e+"\n")}));let e=document.createElement("style");e.textContent+=t,Ft.set(this.constructor,e),document.head.appendChild(e)}let i=Ut.get(this.constructor),a=i??[];i||(g(o(this.constructor,"styles"),(t=>{if(r(t)){let e=new CSSStyleSheet;e.replaceSync(t),a.push(e)}else a.push(t)})),Ut.set(this.constructor,a)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...Bt,...a],this.#E();let c=o(this.constructor,yt);c&&c.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#y=this.#S.bind(this)}#y;connectedCallback(){let t=P(this.parentNode,(t=>t instanceof Gt||t.host instanceof Gt),"parentNode");this.#d=t?t instanceof Gt?t:t.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#v)return;if(this.#b)return;this.#b=!0,this.#E();const t=this.#N();this.propsReady(t);for(const e in t){const r=t[e];this.#r[e]=r}this.#_(),g(this.#r,((t,e)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,e);Reflect.defineProperty(this,e,{get(){let t=Reflect.get(this.#n,e);return r?.get?r?.get():t},set(t){r?.set?r?.set(t):Reflect.set(this.#n,e,t)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=Ht(this.#r,this);let e=o(this.constructor,ut.COMPUTED);g(e,((t,e)=>{Mt.startCollect(this,ct.COMPUTED),Mt.setUpdater((()=>{this.#n[e]=t.call(this)})),this.#r[e]=t.call(this),Mt.endCollect(),Reflect.defineProperty(this,e,{get(){return Reflect.get(this.#n,e)},set(t){ft(this.tagName,"Cannot set a computed property '"+e+"'")}})}));let n=o(this.constructor,ut.WATCH);g(n,((t,e)=>{t.forEach((t=>{let{source:r,options:n,handler:s}=t,i=s.bind(this);o(n,"once",!1)&&(i=k(i));const a=function(t){let e=o(this,r.replaceAll("-","."));i(e,t,r)}.bind(this);let l=o(n,"deep",!1);if(a.deep=l,Mt.collectWatch(this,(()=>a),e),!o(n,"immediate",!1))return;let c=o(this,r.replaceAll("-","."));i(c,c,r)}))}));let i=function(t,e){let r,n=[];if($e.has(e.constructor)){let s=$e.get(e.constructor),i=function(t,e){let r=u(e.vars),n=e.strings.length-1;for(let s=0;s<=n;s++){let n=o(e.vars,s,"");if(n instanceof ir){let[e,o]=Xe(t,n);r.splice(s,1,...o)}}return r}(e,t);r=Ve.has(e.constructor)?function(t,e,r){let n=Ve.get(r.constructor)?.cloneNode(!0),s=Ie.get(r.constructor);const o=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let i,a,l=0,c=0;for(;i=o.nextNode();){let n;if(c++,a&&!a.contains(i)&&(a=void 0),i instanceof HTMLElement||i instanceof SVGElement){i instanceof Gt&&(a=i);let o={};s[c].forEach((s=>{let c=e[l++];switch(s.type){case Ue.Event:n=rt(s.up),s.value||l--,s.value&&we(s.name,c.bind(r),i,r),i.removeAttribute(s.attrName);break;case Ue.AttrSlot:a&&s.name,i.removeAttribute(s.attrName);break;case Ue.Ref:n=rt(s.up),c.current=i,i.removeAttribute(s.attrName);break;case Ue.AttrKey:n=rt(s.up),i.setAttribute(Re,c);break;case Ue.AttrBool:n=rt(s.up),n.value=!!c,n.node=i,n.value&&i.setAttribute(s.name,""),i.removeAttribute(s.attrName);break;case Ue.AttrProp:n=rt(s.up),n.value=c,n.node=i,o[s.name]=c;break;case Ue.AttrRef:case Ue.Attr:n=rt(s.up),n.value=c,n.node=i,i.setAttribute(s.attrName,c),Ue.AttrRef===s.type&&i.removeAttribute(s.name);break;case Ue.DirectiveAttr:case Ue.DirectiveTag:case Ue.DirectiveProp:n=rt(s.up),n.value=c,n.node=i;let t=rt(s.point);t.startNode=i;let[e,u,d,p,h]=c,f=Ke.get(i);if(f||(f={},Ke.set(i,f)),f[s.attrName??Symbol.keyFor(e)]=[t,r,a],d(t,u,void 0,{renderComponent:r,slotComponent:a,varChain:h}),Ue.DirectiveAttr===s.type){let t=i.getAttribute(s.attrName);t=Y(t,Ye,""),i.setAttribute(s.attrName,t)}s.name&&i.removeAttribute(s.name)}n&&t.push(n)})),i instanceof Gt?(i._initProps(o),i._regWrapper(r)):i instanceof HTMLSlotElement&&r._bindSlot(i,i.name||"default",o)}else{s[c].forEach((s=>{let o=e[l++];switch(s.type){case Ue.DirectiveSlot:case Ue.DirectiveText:n=rt(s.up),n.value=o,n.node=i;let[t,e,l,c,u]=o,d=Symbol.keyFor(t),p=document.createComment(`compelem-${r.tagName}-${d}-start`);n.textNode=p,i.parentNode.insertBefore(p,i),i.nodeValue=`compelem-${r.tagName}-${d}-end`;let h=rt(s.point);h.startNode=p,h.endNode=i,ze.set(i,[h,r,a,e,u]),Fe.set(i,l),Ge.set(i,n),Mt.startRender(i);let f=l(h,e,void 0,{renderComponent:r,slotComponent:a,varChain:u});Mt.endRender(r);let g=Je(i,f[1],r);g&&g.length>0&&rr.insertBefore(i,Array.from(g));break;case Ue.Text:n=rt(s.up),n.node=i;let m=Z(o??""),v=document.createTextNode(m);i.replaceWith(v),n.textNode=v}n&&t.push(n)}))}}return n.childNodes}(n,i,e):Ze(n,s,i,e)}else{let[s,o]=Xe(e,t);$e.set(e.constructor,s),r=Ze(n,s,o,e)}return Be.set(e,n),r}(this.render(),this);i&&(this.#o.append(...i),this.#u=U(this.#o.childNodes,(t=>t.nodeType===Node.ELEMENT_NODE)),this.#c=this.#u[0]),g(this.#h,((t,e)=>{this.#C(e)}));const a=this;let l=o(this.constructor,yt);l&&l.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(a.#n[t]=e,a.#n[t])))}));let c=o(this.constructor,"hostStyles"),d=this.#p?.shadowRoot??this.ownerDocument,p=zt.get(d);if(!p?.includes(this.constructor)&&c.length>0){let t=[];g(c,(e=>{if(r(e)){let r=new CSSStyleSheet;r.replaceSync(e),t.push(r)}else t.push(e)})),d.adoptedStyleSheets=[...d.adoptedStyleSheets,...t],p?.push(this.constructor)}this.beforeMount();let h=o(this.constructor,ut.EVENTS);h&&h.forEach((async t=>{let e=t.name,r=A({target:document,once:!1,passive:!1,capture:!1},t.options),n=M(t.fn,this),s=r.target;y(s)&&(s=await s.call(this,this)),s?s.addEventListener(e,n,r):ft(this.tagName,"The target of @event('"+e+"',...) is invalid")})),Mt.startCollect(this,ct.CSS);let f=[];this.styles.forEach((t=>{if(!y(t))return;let e=new CSSStyleSheet;f.push(e),Mt.setUpdater((()=>{let r=t()??"";e.replaceSync(r)}));let r=t();s(r)||e.replaceSync(r)})),Mt.endCollect(),f.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...f]),setTimeout((()=>{this.#f=!0,this.mounted(),l&&l.forEach((t=>{t.mounted(this,((t,e)=>(a.#n[t]=e,a.#n[t])))}))}),0),this.#v=!0}propsReady(t){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#T(t,e){this.#E();let r=o(this.#e[e],"props");r&&g(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof Gt?t._updateProps(r):g(r,((e,r)=>{if(t instanceof HTMLSlotElement){let n=o(t,"__l_comp");if(n){let s=t.name||"default",o=n.#e[s];o||(o=n.#e[s]={props:{}}),o.props||(o.props={}),o.props[r]=e,n.#T(t,s)}}else t.setAttribute(r,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,r){this.#A(t,e,r)}shouldUpdate(t){return!0}updated(t){}#w={};_notify(t,e){let r=[];for(let n=0;n<e.length;n++){const s=e[n];r.push(s);let a=o(this,r),l=gt(r);this.#s[l]={value:a,chain:"slots"===l?["slots"]:r,oldValue:t,end:r.length===e.length},i(a)&&"#"!=l[0]&&at.set(a,l)}return this.#y}#S(){if(T(this.#s)<1)return;const t=this.#s;this.#s={};let e=o(this.constructor,yt);if(e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)})),!this.shouldUpdate(t))return;let r=new Set;g(t,(({value:t,chain:e,oldValue:n,end:s},o)=>{this.#i[o]&&this.#i[o].forEach((t=>{r.add(t)}))})),r.forEach((t=>{t===this?tr(this.render(),this):er(t,this)})),this.#P.forEach((t=>{this.#C(t)})),this.updated(t),g(t,(({value:t,chain:e,oldValue:r},n)=>{i(t)&&at.has(t)&&at.delete(t)}))}#N(){let t=o(this.constructor,ut.PROPS),r=this.attributes,s=this.tagName,l=this.#l,u={};g(r,(({name:e,value:r})=>{if(e[0]===Pe||e[0]===ke||e[0]===Me||e===Oe||"slot"===e)return;let n=D(e);t&&!t[n]&&(u[e]=r)})),this.#a=this.#a?A(this.#a,u):u;let d={};if(!t)return Object.seal(d);let p=Object.keys(t),h=p.length;for(let u=0;u<h;u++){const h=p[u];let g,v=t[h],b=c(l,h),E=o(this,h);if(!("_defaultValue"in v)&&(v._defaultValue=E,!v.type)){n(E)&&ft(s,"Prop '"+h+"' has neither propType nor defaultValue be used for type inference");let t=typeof E;S(E)&&(t="array");let e=It[t];v.type=e}if(b)g=x(l[h])?E:l[h];else{g=E;let t=r.getNamedItem(m(h))||r.getNamedItem(ke+m(h));t&&(b=!0,g=t.value)}if(v.required&&!b){ft(s,"Prop '"+h+"' is required");break}g=this.#k(t,h,g);let y=o(t,[h,"getter"]);y&&(y=M(y,this));let N=o(t,[h,"setter"]);if(N&&(N=M(N,this)),(y||N)&&Reflect.defineProperty(this.#r,h,{set:N||function(t){},get:y}),v.attribute&&a(g)&&!i(g)){let t=m(h),r=O(g);(f=v.type)===Boolean||e(f,(t=>t===Boolean))?(r=vt(g),R(r)?this.toggleAttribute(t,r):this.setAttribute(t,r)):this.setAttribute(t,r)}this.#r[h]=g,d[h]=g}var f;return Object.seal(d)}#M(t,e){let r=t;try{for(let n=0;n<e.length;n++){const s=e[n];r=s===Boolean?vt(t):s===Number?Number(t):s===String?String(t):s===Object||s===Array?L(t):s===Date?new Date(t):new s(t)}}catch(e){ft(this.tagName,"Convert attribute error with "+t)}return r}#k(t,n,s){let o=t[n];if(!o)return s;let i=o.isValid,l=o.type,c=S(l)?l:[l],u=o.converter,d=s;if(!e(c,(t=>t===String))&&r(d)&&!W(d))try{d=u?u(d):this.#M(d,c)}catch(t){ft(this.tagName,`Convert attribute '${n}' error with `+d)}for(let t=0;t<c.length;t++){"Boolean"===c[t].name&&(d=vt(d))}let p=typeof d,h=!a(d);for(let t=0;t<c.length;t++){const e=c[t];if(C(p,e.name,"i")||d instanceof e||Object.prototype.toString.call(d)===Object.prototype.toString.call(e.prototype)){h=!0;break}}return h||ft(this.tagName,`Invalid prop '${n}'. expected '${c.map((t=>t.name||t))}' but got '${p}'`),i&&(i.call(this,d,this.#r)||ft(this.tagName,`Invalid prop '${n}'. IsValid() check failed`)),d}#_(){let t=o(this.constructor,ut.STATES);g(t,((e,r)=>{let n=t[r],s=o(this,r);if(n){let t=n.prop;s=t?f(this.#r[t]):o(this,r)}this.#r[r]=s}))}#D=H(this.propsReady,100);_setParentProps(t,e){if(this.#v){let r=o(this.constructor,ut.PROPS);g(t,((t,e)=>{let n=D(e),s=r[n];if(!s)return;let o=this.#r[n];t=this.#k(r,n,t),s.hasChanged&&!s.hasChanged.call(this,t,o)||(this.#r[n]=t,this._notify(o,[n]))})),A(this.#l,t),A(this.#a,e),this.#D(this.#l)}}_updateProps(t){let e=o(this.constructor,ut.PROPS);g(t,((t,r)=>{let n=D(r);e[n]&&(t=this.#k(e,n,t),Mt.__skipCheck=!0,$(this,n,t),Mt.__skipCheck=!1)})),A(this.#l,t),this.#D(this.#l)}_initProps(t,e){this.#l=h(this.#l||{},t),this.#a=h(this.#a||{},e)}_bindSlot(t,e,r){if(this.#g[e]||(this.#g[e]=t,Reflect.defineProperty(t,"__l_comp",{value:this})),t.addEventListener("slotchange",(r=>{this.#v&&this.#T(t,"default"===e?"":e)})),!l(r)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=r}}_bindSlotHook(t,e){this.#h[t]=e}#P=new Set;_updateSlot(t,e,r){let n=this.#g[t],s=this.#h[t];if(!s&&!n)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=r),s)this.#P.add(t);else{let t=n.assignedElements({flatten:!0});for(let n=0;n<t.length;n++){t[n].setAttribute(e,r+"")}}}#E(){const t=_(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let e=V(t,(t=>t.nodeType===Node.TEXT_NODE?"default":t instanceof Element?t.getAttribute("slot")||"default":void 0));if(l(e))return void(l(this.#r["#slots"])||(this.#v?this.#n["#slots"]={}:this.#r["#slots"]={}));g(e,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&s(e.textContent)||e instanceof HTMLSlotElement&&l(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=b(t);if(!(e.nodeType===Node.TEXT_NODE&&s(e.textContent)||e instanceof HTMLSlotElement&&l(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let r={};g(e,((t,e)=>{l(t)||(r[e]=t)})),this.#v?this.#n["#slots"]=r:this.#r["#slots"]=r}#C(t){let e=this.#h[t];if(!e)return;let r=this.#e[t];if(!this.#r["#slots"][t])return;this.renderAsync(e,o(r,"props"));const n=this._asyncDirectives.get(e);let s=n?.buildView(e(o(r,"props"))),i=I(v(s),(t=>t.nodeType===Node.COMMENT_NODE));if(i){let e=this.#m[t];if(!l(e))for(let t=0;t<e.length;t++){const r=e[t];r.parentNode?.removeChild(r)}this.#m[t]=i,this.append(...i),this.#P.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#A(t,e,r){if(!this.#v)return;if(kt(this.constructor).has(t)){let e=D(t);if(W(r)){r=o(this.constructor,ut.PROPS)[e]._defaultValue}this._updateProps({[e]:r})}}_regDeps(t,e){let r=this.#i[t];r||(r=this.#i[t]=new Set),r.add(e);let n=t.split("-");if(n.pop(),n.length<1)return;let s=n.join("-");r=this.#i[s],r||(r=this.#i[s]=new Set),r.add(e)}_regWrapper(t){this.#p=t}emit(t,e={},r){r&&r.event&&(e.event=r.event),e.target=this,this.dispatchEvent(new CustomEvent(t,{bubbles:o(r,"bubbles",!1),composed:o(r,"composed",!1),cancelable:!0,detail:e}))}on(t,e){this.#w[t]||(this.#w[t]=[]);let r=e.bind(this);this.#w[t].push(r),this.addEventListener(t,r)}nextTick(t,e){Vt.pushNext(t,e)}forceUpdate(){g(this.#n,((t,e)=>{this.#s[e]={value:void 0,chain:void 0}})),this.#S()}}var Kt,Xt,Qt;!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(Kt||(Kt={})),function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(Xt||(Xt={}));class qt{key;varIndex;value;isText=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;notUpdated;constructor(t,e,r,n){this.varIndex=t,this.node=e,r&&(this.attrName=r),n&&(this.attrTmpl=n)}}class Yt{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(t,e,r){this.startNode=t,this.attrName=e,this.type=r}setVarIndex(t){this.varIndex=t}getNodes(){let t=this.startNode.nextSibling;if(!this.endNode)return[t];let e=[];for(;t&&t!==this.endNode;)e.push(t),t=t?.nextSibling;return e}}!function(t){t.AFTER_BEGIN="afterbegin"}(Qt||(Qt={}));const Zt={};function Jt(t,e,r,n,s,o,i,a=!1){let c;if(a?(Mt.startRender(t.endNode),c=n(t,e,r,{renderComponent:s,slotComponent:o,varChain:i}),Mt.endRender(s)):c=n(t,e,r,{renderComponent:s,slotComponent:o,varChain:i}),!c)return;let[u,d]=c;if(u===Xt.NONE)return;let p=t.getNodes();if(u===Xt.REMOVE)for(let t=0;t<p.length;t++){const e=p[t];e.parentNode?.removeChild(e)}else if(u===Xt.REPLACE){let e=[];for(let t=0;t<p.length;t++){const e=p[t];e.parentNode?.removeChild(e)}let r=Je(t.endNode,d,s);e=v(r);let n=document.createDocumentFragment();n.append(...e),t.endNode.parentNode.insertBefore(n,t.endNode)}else if(u===Xt.UPDATE){let e,r={},n=[],o=[],i=je.get(t.endNode);if(d||(d=new ir([],[])),l(p)){let e=Je(t.endNode,d,s);return void t.startNode.after(...e)}let a={};d instanceof ir&&d.vars.forEach((t=>{if(t instanceof ir){const e=t.getKey();a[e]=t,r[e]=!0,o.push(e)}})),p=U(B(p),(t=>t.nodeType===Node.ELEMENT_NODE)),e=U(B(v(e)),(t=>t.nodeType===Node.ELEMENT_NODE));let c={},u="",h={};for(let t=0;t<p.length;t++){let e=p[t],r=e.getAttribute("key");if(r){if(c[r]){u=r;break}c[r]=e,n.push(r),h[r]=!0}}if(u)return void ht(`${D(t.endNode._diName)} - duplicate key '${u}'`);let f=r;const m=t.startNode.parentNode;let E=[],y=[];g(h,((t,e)=>{f[e]||(y.push(e),delete h[e],j(n,(t=>t===e)))}));let S,_=!1;if(!l(o)){let e=-1,r=[],s=[],i=0,a=0;for(;a<o.length;a++){const l=o[a];let u=n.findIndex((t=>t===l));if(u<0){let e=o[a-1],r=e?c[e]||e:t.startNode;E.push({prevNode:r,newkey:l}),i++}else if(u>-1&&u!==a-i){if(e<0||1===Math.abs(e-u)){let t=b(r);r.push({nodeId:l,targetId:0===a?Qt.AFTER_BEGIN:t?t.nodeId:o[a-1]})}else s.push({moveGroup:r,moveIndex:a+r.length}),r=[],r.push({nodeId:l,targetId:o[a-1]});e=u}}if(r.length>0&&s.push({moveGroup:r,moveIndex:a+r.length}),s.length>0){_=!0;let e=s.sort(((t,e)=>t.moveGroup.length-e.moveGroup.length));if(e.length<2){let{moveGroup:r}=e[0];if(r.length>1){let t=b(r).targetId;r[r.length-2].nodeId===t&&(r=N(r))}r.forEach((({targetId:e,nodeId:r})=>{let n,s=c[r];e===Qt.AFTER_BEGIN?(n=t.startNode,n.after(s)):(n=c[e],n.after(s))}))}else{let r=b(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-r)&&(e=N(e)),e.forEach((({moveGroup:e})=>{e.forEach((({targetId:e,nodeId:r})=>{let n,s=c[r];e===Qt.AFTER_BEGIN?(n=t.startNode,n.after(s)):(n=c[e],n.after(s))}))}))}}}if(E.length>0&&(S=function(t,e,r,n,s,o){const i=[],a=[],l=[];let c,u=[];t.forEach((t=>{let r=b(u);r&&c===t.prevNode?(r.group||(r.group=[c]),r.group.push(t.newkey)):u.push(t),c=t.newkey;let n=t.newkey;l.push(n),i.push(""),a.push(e[n])})),i.push("");let d=new ir(i,a),p=[...s],h=Je(o,d,n),f=je.get(o);s.length=0,s.push(...f);let g=new Map;return h.forEach((t=>{const e=t.getAttribute("key");l.includes(e)&&(g.set(e,!0),Zt[e]=t)})),p.forEach(((t,e)=>{const n=t.key+"";!g.get(n)&&r.includes(n)&&s.push(t)})),u}(E,a,o,s,i,t.endNode),S.forEach(((e,r)=>{let n=e.newkey,s=Zt[n],o=e.prevNode;if(e.group){let t=document.createDocumentFragment();t.append(...F(e.group,(t=>Zt[t]))),s=t}o===t.endNode?o.before(s):o===t.startNode?o.after(s):"string"==typeof o?Zt[o].after(s):o.after(s)}))),y.forEach((t=>{let e=c[t];e&&e.parentNode&&m.removeChild(e)})),d.vars[0]instanceof ir){let t=[],e=[];g(d.vars,(r=>{e.push(...r.vars),t.push(...F(r.vars,(t=>"1")))})),t.push("1"),d=new ir(t,e)}if(_||y.length>0||S){const t=V(i,(t=>t.key));let e=[],r=0;o.forEach((n=>{t[n].forEach((t=>{t.varIndex=r++,e.push(t)}))})),i=e}er(t.endNode,s,d,i)}}let te=0;function ee(t,e){let r=t.name||"Di-"+te++,n=Symbol.for(r);return(...r)=>{let s=t(...r);return[n,r,s,t=>{process.env.DEV&&(l(e)||C(e.join(","),t)||ht(`Directive '${Symbol.keyFor(n)}' is out of scopes, expect '${e.join(",")}' bug got '${t}'`))},Mt.popDirectiveQ()]}}const re=["resize","outside","mutate"],ne=new WeakMap,se=[],oe=[],ie=[],ae=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,r=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;let n=ne.get(e.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:t.inlineSize,h:t.blockSize}}}),e.target)}}}));var le;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(le||(le={}));const ce=new WeakMap,ue=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const r=t[e];let n=ce.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=le.Tree,o=n[le.Tree];break;case"childList":s.type=le.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[le.Child];break;case"attributes":s.type=le.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[le.Attr];break;case"characterData":s.type=le.Char,s.oldValue=r.oldValue,o=n[le.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function de(t,e,r,n){if("resize"===t)!function(t,e){ne.has(t)||(ne.set(t,e),ae.observe(t))}(e,r);else if("outside"===t)switch(n[0]){case"mousedown":!function(t,e){se.push([t,e])}(e,r);break;case"dblclick":!function(t,e){ie.push([t,e])}(e,r);break;default:!function(t,e){oe.push([t,e])}(e,r)}else"mutate"===t&&function(t,e,r){let n=z(r,"child"),s=z(r,"attr"),o=z(r,"char"),i=z(r,"tree"),a=ce.get(t);a||(a={},ce.set(t,a),n&&(a[le.Child]=e),s&&(a[le.Attr]=e),o&&(a[le.Char]=e),i&&(a[le.Tree]=e),ue.observe(t,{childList:n,attributes:s,characterData:o,subtree:i}))}(e,r,n)}document.addEventListener("mousedown",(t=>{let e=o(t.composedPath(),0,t.target);se.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(P(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1),document.addEventListener("click",(t=>{let e=o(t.composedPath(),0,t.target);oe.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(P(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1),document.addEventListener("dblclick",(t=>{let e=o(t.composedPath(),0,t.target);ie.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(P(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1);const pe=/,|^(debounce:.+)|(debounce$)/,he=/,|^(throttle:.+)|(throttle$)/,fe="self",ge="stop",me="prevent",ve="once",be="left",Ee="right",ye="middle",Se="ctrl",Ne="alt",_e="shift",Ce="meta",Te={esc:"escape"},Ae=":";function we(t,e,r,n){let s,o=t.split("."),i=o.shift(),a=o.includes(ve),l=e;if(s=G(o,(t=>pe.test(t)))){let t=s.split(Ae);l=H(l,parseInt(t[1])||100)}if(s=G(o,(t=>he.test(t)))){let t=s.split(Ae);l=K(l,parseInt(t[1])||100)}if(a&&(l=k(l)),function(t){return re.includes(t)}(i))return de(i,r,l,o),l;let c=t=>{if(o.includes(me)&&t.preventDefault(),o.includes(ge)&&t.stopPropagation(),!o.includes(fe)||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes(be)&&0!=t.button)return;if(o.includes(Ee)&&2!=t.button)return;if(o.includes(ye)&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(j(o,(t=>t==Se))[0]&&!t.ctrlKey)return;if(j(o,(t=>t==Ne))[0]&&!t.altKey)return;if(j(o,(t=>t==_e))[0]&&!t.shiftKey)return;if(j(o,(t=>t==Ce))[0]&&!t.metaKey)return;if(!F(o,(t=>Te[t]||t)).includes(t.key.toLowerCase()))return}l(t)}};r.addEventListener(i,c);let u=n.__events[i];return u||(u=n.__events[i]=[]),u.push([r,c]),c}const Pe="@",ke=".",Me="?",De="*",xe=":",Oe="ref",Re="key",Le=/[.?-a-z]+\s*=\s*(['"])\s*([^='"]*<\!--c_ui-pl_df-->){2,}.*?\1/ims,We=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,He="slot-props",$e=new Map,Ve=new Map,Ie=new Map;var Ue;!function(t){t.Event="event",t.Directive="directive",t.DirectiveTag="directiveTag",t.DirectiveAttr="directiveAttr",t.DirectiveProp="directiveProp",t.DirectiveText="directiveText",t.DirectiveSlot="directiveSlot",t.Attr="attr",t.AttrProp="attrProp",t.AttrBool="attrBool",t.AttrRef="attrRef",t.AttrSlot="attrSlot",t.AttrKey="key",t.Ref="ref",t.Text="text"}(Ue||(Ue={}));const Be=new WeakMap,je=new WeakMap,Fe=new WeakMap,ze=new WeakMap,Ge=new WeakMap,Ke=new WeakMap;function Xe(t,e){let r="",n=u(e.vars),s=e.strings.length-1,i=e.vars.length-1,a=0;for(let l=0;l<=s;l++){const s=e.strings[l];let c=o(n,a,"");if(c instanceof ir){let[e,r]=Xe(t,c);c=e,n.splice(a,1,...r),a+=r.length-1}else c=l>i?"":Qe;a++,r=r+s+c}if(process.env.DEV){let t=r.match(Le);if(t){return ht(`Parse error: attribute value can be set only one interpolation —— \n ${J(t[0],Qe,"${...}")}`),["",n]}}let l=0;return r=r.replace(We,((t,e)=>J(t,Qe,(()=>Qe.replace("--\x3e","")+l++)))),r=r.replace(sr,"$1><").trim(),[r,n]}const Qe="\x3c!--c_ui-pl_df--\x3e",qe="\x3c!--c_ui-pl_df",Ye=/<!--c_ui-pl_df\d*(-->)?/;function Ze(t,e,r,n,s=!1){const o=document.createElement("div");o.innerHTML=e;const i=Ie.has(n.constructor);s||!i||Ve.has(n.constructor)||Ve.set(n.constructor,o.cloneNode(!0));let a=0;const l=document.createNodeIterator(o,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let u,d,p=0,h=i?void 0:{},f=null,g="";for(;u=l.nextNode();){a++;let e=i?void 0:[];if(d&&!d.contains(u)&&(d=void 0),u instanceof HTMLElement||u instanceof SVGElement){u instanceof Gt&&(d=u);let s={},o=v(u.attributes);for(let i=0;i<o.length;i++){const a=o[i];let{name:l,value:h}=a;if(l!==He)if(E(l,qe)){let s=r[p];if(S(s)&&tt(s[0])){let[,r,o,i,a]=s;i(Kt.TAG);let c=new Yt(u,l.substring(1),Kt.TAG),h=Ke.get(u);h||(h={},Ke.set(u,h)),h[Symbol.keyFor(s[0])]=[c,n,d];let m=new qt(p,u);m.isDirective=!0,m.value=s,m.isComponent=!!d,t.push(m),f&&f?.contains(u)&&(m.key=g),p++,o(c,r,void 0,{renderComponent:n,slotComponent:d,varChain:a}),e&&e.push({type:Ue.DirectiveTag,point:c,up:m,name:l})}u.removeAttribute(l)}else if(l[0]!==Pe)if(l!==Oe)if(l!==Re)if(!process.env.DEV||l[0]!==ke||Ye.test(h)){if(Ye.test(h)){let o=r[p],i=new qt(p,u,l.replace(/\.|\?|@/,""),h);if(i.isComponent=!!d,f&&f?.contains(u)&&(i.key=g),l[0]===ke||l[0]===Me||l[0]===De){if(S(o)&&tt(o[0])){let[,t,r,s,a]=o;s(Kt.PROP);let c=l.substring(1),p=new Yt(u,c,Kt.PROP),h=Ke.get(u);h||(h={},Ke.set(u,h)),h[c]=[p,n,d],r(p,t,void 0,{renderComponent:n,slotComponent:d}),i.value=o,i.isDirective=!0,e&&e.push({type:Ue.DirectiveProp,up:i,point:p,name:l,attrName:c})}else if(l[0]===Me){i.isToggleProp=!0,i.value=!!o;let t=l.substring(1);i.value&&u.setAttribute(t,""),e&&e.push({type:Ue.AttrBool,name:t,up:i,attrName:l})}else if(l[0]===De){i.value=o;let t=l.substring(1);const[r,n]=t.split(xe);let s=r;switch(n){case"camel":s=D(s);break;case"kebab":s=m(s);break;case"snake":s=et(s)}i.attrName=s,u.setAttribute(s,o),e&&e.push({type:Ue.AttrRef,up:i,name:l,attrName:s})}else if(!process.env.DEV||u instanceof Gt||"SLOT"===u.tagName){let t=D(l.substring(1));process.env.DEV&&!(t in u)&&"SLOT"!==u.tagName&&ft(u.tagName,`Prop '${l}' is not defined in ${u.tagName}`),i.value=o,i.isProp=!0,s[t]=o,e&&e.push({type:Ue.AttrProp,up:i,name:t,attrName:l})}else ft(u.tagName,`Prop '${l}' can only be set on a CompElem or a slot`);u.removeAttribute(l),o=""}else{let t,r;i.value=o;let s={type:Ue.Attr,up:i,attrName:l};if(S(o)&&tt(o[0])){let e=Kt.ATTR;"class"===l?e=Kt.CLASS:"style"===l&&(e=Kt.STYLE);let[,a,c,p,h]=o;p(e),i.isDirective=!0,i.attrName=l;let f=new Yt(u,l,e),g=Ke.get(u);g||(g={},Ke.set(u,g)),g[l]=[f,n,d],r=a,t=c,o="",s.type=Ue.DirectiveAttr,s.point=f}h=Y(h,Ye,o),a.value=h,t&&t(s.point,r,void 0,{renderComponent:n,slotComponent:d}),e&&e.push(s)}t.push(i),p++}}else ft(u.tagName,`Prop '${l}' must be an interpolation`);else{let n=r[p];u.setAttribute(l,n);let s=new qt(p,u);s.notUpdated=!0,f&&f?.contains(u)&&(s.key=g),t.push(s),p++,f=u,g=n,e&&e.push({up:s,type:Ue.AttrKey}),t.length>0&&t.forEach((t=>{t.key=t.key??n}))}else{if(Ye.test(h)){let n=r[p];if(process.env.DEV&&!c(n,"current")){ft(u.tagName,"Ref must be a RefObject");continue}let s=new qt(p,u);s.notUpdated=!0,f&&f?.contains(u)&&(s.key=g),t.push(s),p++,n.current=u,e&&e.push({type:Ue.Ref,up:s,attrName:l})}u.removeAttribute(l)}else{let s=t=>{},o=new qt(p,u);o.notUpdated=!0,f&&f?.contains(u)&&(o.key=g),t.push(o);let i=!1;if(Ye.test(h)){let t=r[p];if(process.env.DEV&&!y(t)){ft(u.tagName,`Event '${l}' must be a function`);continue}s=t.bind(n),p++,i=!0}let a=l.substring(1);we(a,s,u,n),u.removeAttribute(l),e&&e.push({type:Ue.Event,up:o,name:a,attrName:l,value:i})}else{let t=u.getAttribute("name")||"default";e&&e.push({type:Ue.AttrSlot,name:t,attrName:l})}}u instanceof Gt?(u._initProps(s),u._regWrapper(n)):u instanceof HTMLSlotElement&&n._bindSlot(u,u.name||"default",s)}else{let s=u;if(`\x3c!--${s.nodeValue}--\x3e`!==Qe)continue;let o=new qt(p,u);f&&f?.contains(u)&&(o.key=g),t.push(o),o.isComponent=!!d,o.isText=!0;let i=r[p];if(S(i)&&tt(i[0])){const t=Symbol.keyFor(i[0]);let r;r=document.createComment(`compelem-${n.tagName}-${t}-start`),o.textNode=r,s.parentNode.insertBefore(r,s),s.nodeValue=`compelem-${n.tagName}-${t}-end`,s._diName=t,o.isDirective=!0,o.value=i;let a=d?Kt.SLOT:Kt.TEXT,[,l,c,u,p]=i;u(a);let h=new Yt(r,"",a);h.endNode=s,ze.set(s,[h,n,d,l,p]),Fe.set(s,c),Ge.set(s,o),Mt.startRender(s);let f=c(h,l,void 0,{renderComponent:n,slotComponent:d,varChain:p});if(Mt.endRender(n),f){let t=Je(s,f[1],n);t&&t.length>0&&rr.insertBefore(s,Array.from(t))}i=void 0,e&&e.push({type:a===Kt.SLOT?Ue.DirectiveSlot:Ue.DirectiveText,up:o,point:h})}else o.value=i,e&&e.push({type:Ue.Text,up:o});p++;let a=Z(i??""),l=document.createTextNode(a);s.parentNode.insertBefore(l,s),o.textNode=l}h&&e&&(h[a]=e),f&&!f.contains(u)&&f!==u&&(f=null,g="")}return!s&&h&&Ie.set(n.constructor,h),o.childNodes}function Je(t,e,r){let[n,s]=Xe(r,e),o=[],i=Ze(o,n,s,r,!0);return je.set(t,o),i}function tr(t,e,r){if(s(X(t.strings)))return;if(!Be.has(e))return;let{vars:n}=t;r=r??Be.get(e);for(let t=0;t<r.length;t++){const s=r[t];let a=s.varIndex;if(a<0)continue;if(s.notUpdated)continue;let l=s.value,c=n,u=s.node,d=Q(a,"-");for(let e=0;e<d.length;e++){const r=d[e];c=o(c,r),c&&c.vars&&t<d.length-1&&(c=c.vars)}if(!i(l)&&l===c)continue;let p=u;if(s.isDirective){let[t,e,r,,n]=s.value,o=ze.get(u);if(!o){const e=Ke.get(u);o=e[s.attrName]||e[Symbol.keyFor(t)]}let[i,a,l]=o,[,d]=c;const p=Ge.get(u);if(p){p.value=c;ze.get(u)[3]=d}Jt(i,d,e,r,a,l,n,i.type==Kt.TEXT||i.type==Kt.SLOT)}else if(s.isToggleProp){if(!!c===l)continue;p.toggleAttribute(s.attrName,!!c),$(p,s.attrName,!!c)}else if(s.isProp){if(!i(c)&&c===l)continue;u instanceof Gt?u._updateProps({[s.attrName]:c}):u instanceof HTMLSlotElement&&e._updateSlot(u.getAttribute("name")||"default",s.attrName,c)}else if(s.attrName){if(!q(l,c))switch(s.attrName){case"value":if(u instanceof HTMLInputElement){u.value=c;break}default:u.setAttribute(s.attrName,Y(s.attrTmpl,Ye,c+""))}}else if(s.isText){s.textNode.textContent=Z(c??"")}s.value=c}}function er(t,e,r,n){const s=Fe.get(t),[o,i,a,l,c]=ze.get(t),u=Ge.get(t);if(!r){let t=s(o,u.value[1],l,{renderComponent:i,slotComponent:a,varChain:c});if(!t)return;r=t[1]}if(r&&r.vars[0]instanceof ir){let t=[],e=[];g(r.vars,(r=>{e.push(...r.vars),t.push(...F(r.vars,(t=>"1")))})),t.push("1"),r=new ir(t,e)}n&&je.set(t,n),tr(r,e,n=n??je.get(t))}const rr={insertBefore:function(t,e){if(!t.parentNode)return;let r=document.createDocumentFragment();r.append(...e),t.parentNode.insertBefore(r,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let r=t.nextSibling;for(;r&&r!==e;)r?.parentNode?.removeChild(r),r=t.nextSibling}};function nr(t,...e){return new ir(r(t)?[t]:t,e)}const sr=/([a-z0-9"'])\s*>\s*</gim;function or(t){return{current:t}}class ir{strings;vars;constructor(t,e){this.strings=u(t),this.vars=e}getKey(){let t=this.vars,e="";return g(this.strings,((r,n)=>{if(lt.test(r))return e=Z(t[n]),!1})),e}getKeys(){let t=this.vars,e=[];for(let r=0;r<this.strings.length;r++){const n=this.strings[r];if(lt.test(n)){let n=Z(t[r]);e.push(n)}}return l(e)&&t.forEach((t=>{if(t instanceof ir){let r=t.getKey();e.push(r)}})),e}append(t){let e=b(this.strings);return t.strings.forEach(((t,r)=>{0!=r?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=u(this.vars,t.vars),this}insert(t,e){let r=e.strings.shift();return this.strings[t]+=r,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,r]=Xe(t,this),n=Ze([],e,r,t);return nt(n,((t,e)=>t+(e.outerHTML??"")),"")}}function ar(t,e,r){r.get||ht(`Computed '${e}' must be a getter`),c(t.constructor,ut.COMPUTED)||(t.constructor[ut.COMPUTED]=l(t.constructor[ut.COMPUTED])?{}:f(t.constructor[ut.COMPUTED])),t.constructor[ut.COMPUTED][e]=r.get}const lr=Ct(class extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=o(t,r);$(t,r,H(s,this.wait,this.immediate));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&$(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[pt.METHOD]}wait;immediate;result;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function cr(t,e){return(r,n,s)=>{c(r.constructor,ut.EVENTS)||(r.constructor[ut.EVENTS]=l(r.constructor[ut.EVENTS])?[]:f(r.constructor[ut.EVENTS])),r.constructor[ut.EVENTS].push({name:t,options:e,fn:r[n]})}}const ur=Ct(class extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=M(o(t,r),t);$(t,r,k(s));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&$(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[pt.METHOD]}wait;result;constructor(){super()}});var dr;!function(t){t.ONCE="once",t.UPDATABLE="updatable"}(dr||(dr={}));class pr extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){}mounted(t,e,...r){}get targets(){return[pt.FIELD]}selector;cache;result;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){this.result=t.shadowRoot?.querySelector(this.selector)}beforeMount(t,e,r,n,...s){const o=this;Reflect.defineProperty(t,n,{get:()=>(o.result&&o.cache||o.getter(t),o.result)})}updated(t,e){this.cache===dr.UPDATABLE&&this.getter(t)}}const hr=Ct(pr),fr=Ct(class extends pr{getter(t){this.result=t.shadowRoot?.querySelectorAll(this.selector)}});function gr(t){if(1===arguments.length)return(e,r)=>{mr(e,r,t)};mr(arguments[0],arguments[1],{prop:""})}function mr(t,e,r){if(!c(t.constructor,ut.STATES)){const e={};let r=t.constructor;for(;(r=mt(r))!==Gt;)h(e,r[ut.STATES]?f(r[ut.STATES]):{});Reflect.defineProperty(t.constructor,ut.STATES,{configurable:!1,enumerable:!1,value:e})}r.shallow=r.shallow||!1,t.constructor[ut.STATES][e]=r}function vr(t,e,r){mr(t.prototype,e,r||{prop:""})}function br(t){return e=>{if(e){if(e.prototype.hasOwnProperty("attributeChangedCallback")){let t=e.prototype.attributeChangedCallback;e.prototype.attributeChangedCallback=function(e,r,n){Gt.prototype.attributeChangedCallback.call(this,e,r,n),t.call(this,e,r,n)}}if(e.prototype.hasOwnProperty("connectedCallback")){let t=e.prototype.connectedCallback;e.prototype.connectedCallback=function(){Gt.prototype.connectedCallback.call(this),t.call(this)}}if(e.prototype.hasOwnProperty("disconnectedCallback")){let t=e.prototype.disconnectedCallback;e.prototype.disconnectedCallback=function(){Gt.prototype.disconnectedCallback.call(this),t.call(this)}}customElements.define(t,e)}}}const Er=Ct(class extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=o(t,r);$(t,r,K(s,this.wait));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&$(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[pt.METHOD]}wait;result;constructor(t){super(),this.wait=t}});function yr(t,e){return(r,n)=>{c(r.constructor,ut.WATCH)||(r.constructor[ut.WATCH]=l(r.constructor[ut.WATCH])?{}:f(r.constructor[ut.WATCH]));(S(t)?t:[t]).forEach((t=>{let s=t.replaceAll(".","-"),o=r.constructor[ut.WATCH][s];S(o)||(o=r.constructor[ut.WATCH][s]=[]),o.push({source:t,options:e,handler:r[n]})}))}}const Sr=["key"],Nr=ee((function(t){return(t,[e],r)=>{let n=t.startNode;if(r)g(e,((t,e)=>{n.setAttribute(e,t)}));else if(n instanceof Gt){let t={},r={},s=o(n.constructor,ut.PROPS);g(e,((e,n)=>{if(Sr.includes(n))return;let o=D(n);s[o]?t[n]=e:r[n]=e+""})),n._initProps(t,r)}else g(e,((t,e)=>{n.setAttribute(e,t)}))}}),[Kt.TAG]),_r=new Map,Cr=ee((function(t){return(t,[e],n,{renderComponent:s})=>{let o=[];if(S(e)?o=B(e):i(e)?o=_(e,((t,e)=>t?e:[])):r(e)&&(o=e.split(" ")),o.length<1&&!n)return;let a=t.startNode;if(_r.get(a)&&_r.get(a).length===o.length&&st(_r.get(a),o))return;let l=_r.get(a);g(l,(t=>{a.classList.remove(t)})),g(o,(t=>{a.classList.add(t)})),l=u(o),_r.set(a,l)}}),[Kt.CLASS]),Tr=new Map,Ar=new Map,wr=ee((function(t,e){return(t,r,n,{varChain:s})=>{let o=t.startNode,i=function(t,e,r){let n=F(t,((t,r)=>e(t,r)));if(n.length<1){let t=new ir([],[]);return Ar.set(r,t),t}let s=[],o=[];const i=[],a=[];for(let t=0;t<n.length;t++){const e=n[t];let r=b(o),l=e.vars,c=!0,u=e.strings;for(let t=0;t<u.length;t++){const e=u[t];if(lt.test(e)){let e=l[t]+"";if(s.includes(e))return void ht(`forEach - duplicate key '${e}'`);s.push(e),c=!1}0==t&&r?o[o.length-1]=r+e:o.push(e)}if(c)return void ht("forEach - missing 'key' prop");let d=b(i);d&&u.length>0&&(i[i.length-1]=O(d)+u.shift()),i.push(""),a.push(e)}i.push("");let l=new ir(i,a);return Ar.set(r,l),l}(r[0],e,o);if(n){const e=Tr.get(o);if(l(t.getNodes())&&(!r||l(r[0])))return[Xt.NONE,i];if(st(e,r[0])&&e.length===r[0].length)return[Xt.NONE,i]}return Tr.set(o,rt(r[0])),n?[Xt.UPDATE,i]:[Xt.APPEND,i]}}),[Kt.TEXT,Kt.SLOT]);const Pr=new WeakMap,kr=ee((function(t,e,r){return(n,[s,o],i,{renderComponent:a})=>{let l=n.endNode;if(i){if(!!s==!!i[0]){let t=Pr.get(l);return[Xt.NONE,t.call(a,s)]}let t=s?e:r;return Pr.set(l,t),[Xt.REPLACE,t.call(a,s)]}{let n=s?e:r;return Pr.set(l,n),[Xt.APPEND,n.call(a,t)]}}}),[Kt.TEXT,Kt.SLOT]),Mr=ee((function(t,e){return(t,[e,r],n)=>n?e===n[0]?[Xt.NONE,e?r():nr``]:e?[Xt.REPLACE,e?r():nr``]:[Xt.REMOVE]:[Xt.APPEND,e?r():nr``]}),[Kt.TEXT,Kt.SLOT]);var Dr;!function(t){t.CHANGE="change",t.INPUT="input"}(Dr||(Dr={}));const xr=new WeakMap,Or=ee((function(t,e="value"){return(r,n,s,{varChain:a,renderComponent:l})=>{const c=r.startNode;if(s){if(q(n,s))return;if(!q(n,s)){let t=n[0];if(c instanceof Gt)c._updateProps({[e]:t});else if(c instanceof HTMLTextAreaElement||c instanceof HTMLSelectElement)c.setAttribute(e,t+"");else if(c instanceof HTMLInputElement){if(c.value==t)return;switch(c.type){case"checkbox":case"radio":t?c.setAttribute("checked",""):c.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":c.setAttribute(e,t+""),$(c,e,t);break;default:c.setAttribute(e,t+"")}}}return}if("binded"===o(c,"_model"))return;let u=b(a);if(xr.set(c,u),i(t)||O(t)||(t=""),c instanceof Gt)c._initProps({[e]:t}),c.addEventListener("update:"+e,(t=>{$(l,u,t.detail.value)})),$(c,"_model","binded");else if(c instanceof HTMLTextAreaElement)c.setAttribute(e,t+""),c.addEventListener("input",(t=>{let e=t.target;$(l,u,e.value)})),$(c,"_model","binded");else if(c instanceof HTMLInputElement){let r="",n="";switch(c.type){case"checkbox":case"radio":r="checked",n="change";break;default:r="value",n="input"}c.setAttribute(e??r,t+""),c.addEventListener(n,(t=>{let e=t.target;$(l,u,e.value)})),$(c,"_model","binded")}else c instanceof HTMLSelectElement&&(c.setAttribute(e,t+""),c.addEventListener("change",(t=>{let e=t.target;$(l,u,e.value)})),$(c,"_model","binded"))}}),[Kt.TAG]),Rr=new Map,Lr=ee((function(t,e){return(t,[r],n)=>{if(n&&r===n[0])return;let s=t.startNode;if(!Rr.has(s)){let t=s.style.display;Rr.set(s,"none"==t?"unset":t)}s.style.display=r?Rr.get(s):"none",e&&e(s,r)}}),[Kt.TAG]),Wr=ee((function(t,e){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(t=t.bind(o),i._bindSlotHook(e||"default",t))}}),[Kt.SLOT]);class Hr{static getCssText(t,e=!1){return r(t)?t:X(F(t,((t,r)=>r.startsWith("--")?r+":"+t+(e?" !important":""):m(r)+":"+t+(e?" !important":""))),";")}static setStyle(t,e){if(r(t)&&!O(t))return{};let n=Hr.getCssText(t),s={};return g(n.split(";"),(t=>{let r=t.split(":"),n=O(r[0]),o=O(r[1]);s[n]=e.style.getPropertyValue(n),e.style.setProperty(n,o)})),s}}const $r=new Map;let Vr=0;const Ir=ee((function(t){return(t,e,r,{renderComponent:n})=>{let s=t.startNode,o=$r.get(s);o||(o="style_d"+Vr++,$r.set(s,o)),n.nextTick((()=>{Hr.setStyle(e[0],s)}),o)}}),[Kt.STYLE]),Ur=ee((function(t){return(e,r,n,{renderComponent:s,varChain:o})=>{const i=e.startNode;if(n){if(!q(r,n)){let t=e.attrName;i._updateProps({[t]:r[0]})}return}let a=b(o),l=e.attrName;i._initProps({[l]:t}),i.addEventListener("update:"+l,(t=>{$(s,a,t.detail.value)}))}}),[Kt.PROP]),Br=ee((function(t,e){return(t,[e,r],n)=>{let s=()=>nr``,o=[],i=[];g(r,((t,e)=>{if(y(t))o.push(e),i.push(t);else{let e=t[0],r=t[1];o.push(e),i.push(r)}"default"===e&&(s=t)}));let a=ot(o,(t=>y(t)?t(e):t==e));return n?[Xt.REPLACE,it(i[a]??s)]:[Xt.APPEND,it(i[a]??s)]}}),[Kt.TEXT,Kt.SLOT]);export{Gt as CompElem,Hr as CssHelper,bt as Decorator,pt as DecoratorType,Nt as DecoratorWrapper,Xt as DirectiveUpdateTag,Yt as EnterPoint,Kt as EnterPointType,Et as GetKeyFnName,Dr as ModelTriggerType,dr as QueryCache,ir as Template,qt as UpdatePoint,St as _DecoratorMap,yt as _DecoratorsKey,kt as _getObservedAttrs,Nr as bind,Xe as buildHTML,Cr as classes,ar as computed,or as createRef,lr as debounced,Ct as decorator,ee as directive,cr as event,wr as forEach,nr as html,kr as ifElse,Mr as ifTrue,vr as makeState,Or as model,ur as onced,At as prop,hr as query,fr as queryAll,Lr as show,Wr as slot,gr as state,Ir as styles,Ur as sync,br as tag,Er as throttled,Jt as updateDirective,yr as watch,Br as when};
|
|
7
|
+
import{toPath as t,some as e,isString as r,isUndefined as n,isBlank as s,get as o,isObject as i,isDefined as a,isEmpty as l,has as c,concat as u,defaults as d,isLowerCaseChar as p,merge as h,cloneDeep as f,each as g,kebabCase as m,toArray as v,last as b,startsWith as y,isSymbol as E,isArray as S,isFunction as N,initial as _,flatMap as C,test as T,size as A,assign as w,first as P,closest as k,once as M,bind as x,camelCase as O,isNil as D,trim as R,isBoolean as L,parseJSON as W,isNull as H,debounce as I,set as V,groupBy as $,reject as j,filter as B,compact as U,remove as F,map as K,includes as G,find as z,throttle as X,join as Q,split as q,isEqual as Y,replace as J,toString as Z,replaceAll as tt,snakeCase as et,clone as rt,reduce as nt,isMatch as st,findIndex as ot,call as it}from"myfx";const at=/\s+\.?key\s*=/;var lt,ct,ut,dt;function pt(t){console.error("[CompElem]",t)}function ht(t,e){console.error(`[CompElem <${t}>]`,e)}function ft(e){return t(e).join("-")}function gt(t){return Object.getPrototypeOf(t)}function mt(t){let e=t;return r(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||s(e))&&(e=!0),e}!function(t){t[t.CSS=1]="CSS",t[t.COMPUTED=2]="COMPUTED"}(lt||(lt={})),function(t){t.PROPS="__deco_props",t.STATES="__deco_states",t.COMPUTED="__deco_computed",t.WATCH="__deco_watch",t.EVENTS="__deco_events"}(ct||(ct={})),function(t){t.Prod="prod",t.Dev="dev"}(ut||(ut={})),function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(dt||(dt={}));class vt{static get priority(){return 0}}const bt="getKey",yt="__decorators",Et=new WeakMap;class St{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(t,e,r){this.args=t,this.metadata=e,this.decoratorClass=r,this.priority=o(r,"priority",0),this.instanceMap=new WeakMap}create(t){let e,r=new this.decoratorClass(...this.args),s=r.targets,c=this.metadata[2];i(c)&&a(o(c,"configurable"))?e=dt.METHOD:n(this.metadata[2])&&(e=dt.FIELD),!l(s)&&e&&s.includes(e)?(r.created(t,...this.metadata),this.instanceMap.set(t,r)):pt(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${s.join(",")}' bug got '${e}'`)}beforeMount(t,e){this.instanceMap.get(t).beforeMount(t,e,...this.metadata)}mounted(t,e){this.instanceMap.get(t).mounted(t,e,...this.metadata)}updated(t,e){this.instanceMap.get(t).updated(t,e)}}const Nt=new WeakMap;function _t(t){let e=(...e)=>(...r)=>{let n=r[0].constructor,s=n[yt];if(!c(n,yt)){let t=Object.getPrototypeOf(n);s=t?u(t[yt]??[]):[],Reflect.defineProperty(n,yt,{configurable:!1,enumerable:!1,value:s})}let o,i={},a=t[bt];if(a){let r=Nt.get(t);if(r||(r=new WeakMap,Nt.set(t,r)),i=r.get(n),i||(i={},r.set(n,i)),o=a(...e),i[o])return i[o]}let l=new St(e,r,t);return i[o]=l,s?.push(l),l};return Et.set(e,!0),e}const Ct=new WeakMap;function Tt(t){if(1===arguments.length)return(e,r,n)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,At(e,r,t,n)};let e=arguments[0],r=arguments[1],n=arguments[2];t={type:void 0,required:!1,attribute:!0},n&&"function"==typeof n.type&&(t=d(n,t),n=void 0),At(e,r,t,n)}function At(t,e,r,n){let s;if(p(e[0])||pt(`Prop '${e}' must be in CamelCase`),!c(t.constructor,ct.PROPS)){const e={};let r=t.constructor;for(;(r=gt(r))!==Yt;)h(e,r[ct.PROPS]?f(r[ct.PROPS]):{});Reflect.defineProperty(t.constructor,ct.PROPS,{configurable:!1,enumerable:!1,value:e}),s=new Set,g(e,((t,e)=>{if(t.attribute){let t=m(e);s?.add(t)}})),Ct.set(t.constructor,s)}if(n&&(n.get&&(r.getter=n.get),n.set&&(r.setter=n.set)),r.attribute){s||(s=Ct.get(t.constructor));let r=m(e);s?.add(r)}c(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),t.constructor.observedAttributes=v(s),t.constructor[ct.PROPS][e]=r}const wt=new Set;function Pt(t){return Ct.get(t)??wt}var kt,Mt;!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(kt||(kt={})),function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(Mt||(Mt={}));class xt{key;varIndex;value;isText=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;notUpdated;constructor(t,e,r,n){this.varIndex=t,this.node=e,r&&(this.attrName=r),n&&(this.attrTmpl=n)}}const Ot="-",Dt={collectWatch(t,e,r){let n=It.get(t);n||(n={},It.set(t,n));let s=n[r];s||(s=n[r]=[]),s.push(e)},startCollect(t,e){this.__collectType=e,this.__collecting=t},setUpdater(t){this.__updater=t},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(t){let e=b(this.__directiveQ);const r=t?t.join(","):"",n=e?e.join(","):"";e&&r===n||(e&&e.length<t.length&&y(r,n)?this.__directiveQ[this.__directiveQ.length-1]=t:this.__directiveQ.push(t))},popDirectiveQ(){let t=u(this.__directiveQ);return this.__directiveQ=[],t},startRender(t){this.__renderCollecting=!0,this.__renderContext=t},endRender(t){this.__renderCollection.forEach((e=>{t._regDeps(e,this.__renderContext)})),this.__renderCollection.clear(),this.__renderCollecting=!1,this.__renderContext=null},collect(t){this.__renderCollection.add(t)},clear(){this.__directiveQ=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},Rt=new WeakMap,Lt=new WeakMap,Wt=new WeakMap,Ht=new WeakMap,It=new WeakMap,Vt=new WeakMap;function $t(t,e){if(!i(t))return t;if(Vt.has(t))return Vt.get(t);if(Rt.has(t))return t;const r=new Proxy(t,{get(t,e,r){if(!e)return;const n=Reflect.get(t,e,r);if(E(e))return n;if("length"===e&&S(t))return n;let s=Lt.get(r)??[],a=u(s,[e]),l=e in t;if((Dt.__renderCollecting||Dt.__collecting)&&(l&&t.hasOwnProperty(e)||!l)){let t=a.join(Ot);if(Dt.__renderCollecting)Dt.collect(ft(a)),Dt.setDirectiveQ(a);else if(Dt.__collecting){let e;switch(Dt.__collectType){case lt.COMPUTED:e=Wt.get(Dt.__collecting),e||(e={},Wt.set(Dt.__collecting,e));break;case lt.CSS:e=Ht.get(Dt.__collecting),e||(e={},Ht.set(Dt.__collecting,e))}let r=e[t];r||(r=e[t]=[]),r.push(Dt.__updater)}}const c=Rt.get(r);let d=c.from,p=o(d.constructor,ct.STATES);if(o(p,[e,"shallow"]))return n;let h=n;if(i(n)&&!N(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=c.pathMap;c.contextSet.forEach((r=>{let s=t?.get(r);s&&(a=u(s,[e]),h=$t(n,r),Vt.set(n,h),Lt.has(h)||Lt.set(h,a))}))}return h},set(t,r,n,s){if(!r)return!1;let i=t[r],a=Lt.get(s)??[],l=u(a,[r]),c=o(e.constructor,ct.PROPS),d=o(e.constructor,ct.STATES),p=o(c,[l[0],"hasChanged"])||o(d,[l[0],"hasChanged"]);if(p){if(!p.call(e,n,i))return!0}else if(Object.is(i,n))return!0;c&&c[r]&&t.__isData&&c[r].sync&&e.emit("update:"+r,{value:n});let h=n,f=Reflect.set(t,r,h);return jt(e,i,l),f}});let n=Lt.get(t)??[];if(Object.isExtensible(t)&&!Rt.get(r)){let t=new Set;t.add(e);let s=new WeakMap;s.set(e,n),Rt.set(r,{from:e,contextSet:t,pathMap:s})}else{Rt.get(r).contextSet.add(e);let t=Rt.get(r).pathMap,s=t.get(e),i=u(n);if(s&&s.join("")!==i.join("")){let t=o(e,_(s));S(t)||function(...t){console.warn("[CompElem]",...t)}(`The object is referenced by more than one @state '${i.join(".")},${s.join(".")}'`),s=i}else t.set(e,i)}return Vt.set(t,r),r}function jt(t,e,r){let n=Wt.get(t),s=Ht.get(t),i=It.get(t);if(n||s||i){let t=r.length;for(;t;){let a=r.slice(0,t).join(Ot);if(i){const n=i[a];t===r.length?n?.forEach((t=>{let r=t();r.ov=e,Ut.pushWatch(r)})):n?.forEach((t=>{let r=t();o(r,"deep")&&(r.ov=e,Ut.pushWatch(r))}))}if(n){let t=n[a];if(!l(t))for(let e=0;e<t.length;e++){const r=t[e];Ut.pushComputed(r)}}if(s){let t=s[a];if(!l(t))for(let e=0;e<t.length;e++){const r=t[e];Ut.pushCss(r)}}t--}}let a=t._notify(e,r);Ut.pushNext(a,t.cid)}const Bt=new Map;class Ut{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){Ut.nextPending=!1;let t=Array.from(Ut.watchSet);Ut.watchSet.clear();let e=Array.from(Ut.computedSet);Ut.computedSet.clear();let r=Array.from(Ut.cssSet);Ut.cssSet.clear();let n=Array.from(Ut.nextSet);Ut.nextSet.clear(),t.forEach((t=>t(o(t,"ov")))),e.forEach((t=>t())),r.forEach((t=>t())),n.forEach((t=>t())),Bt.clear()}static pushWatch(t){Ut.watchSet.add(t)}static pushComputed(t){Ut.computedSet.add(t)}static pushCss(t){Ut.cssSet.add(t)}static pushNext(t,e){if(e){if(Bt.has(e))return;Bt.set(e,t)}Ut.nextSet.add(t),Ut.nextPending||(Ut.nextPending=!0,Ut.next())}}(()=>{const t=Promise.resolve(),e=Ut.flush;Ut.next=()=>{t.then(e)}})();const Ft={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},Kt=new WeakMap;let Gt=[],zt=0;const Xt=new Map,Qt=new WeakMap,qt=Symbol.for("PROP_OBJECT_KEY_MAP_SYMBOL");class Yt extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){Gt=C(t.css,(t=>{if(r(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,g(t,((t,e)=>{T(e[0],/[A-Z]/)}))}#t;#e={};#r={"#slots":{}};#n={};#s={};#o;#i={};__events={};_propObjectKeyMap={};get[qt](){return this._propObjectKeyMap}get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get reactiveData(){return this.#n}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#u}get parentComponent(){return this.#d}get wrapperComponent(){return this.#p}get slotHooks(){return this.#h}get css(){return Kt.get(this.constructor)}get globalStyleSheet(){return Xt.get(this.constructor)?.sheet}get isMounted(){return this.#f}get slots(){return this.#r["#slots"]}#a;#l;#c;#u;#d;#p;#g={};#h={};#m={};#f=!1;static get styles(){return[]}static get globalStyles(){return[]}static get hostStyles(){return[]}get styles(){return[]}#v=!1;#b=!1;constructor(...t){super(),this.#t=zt++,1===A(t)&&(this.#l={},w(this.#l,P(t)));let e=this.render.bind(this);this.render=function(){let t;return Dt.startRender(this),t=e(),Dt.endRender(this),t};let n=o(this.constructor,"globalStyles"),s=Xt.has(this.constructor);if(!l(n)&&!s){let t="";n.forEach((e=>{r(e)&&(t+=e+"\n")}));let e=document.createElement("style");e.textContent+=t,Xt.set(this.constructor,e),document.head.appendChild(e)}let i=Kt.get(this.constructor),a=i??[];i||(g(o(this.constructor,"styles"),(t=>{if(r(t)){let e=new CSSStyleSheet;e.replaceSync(t),a.push(e)}else a.push(t)})),Kt.set(this.constructor,a)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...Gt,...a],this.#y();let c=o(this.constructor,yt);c&&c.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#E=this.#S.bind(this)}get rootComponent(){let t=this;for(;t.parentComponent;)t=t.parentComponent;return t}#E;connectedCallback(){let t=k(this.parentNode,(t=>t instanceof Yt||t.host instanceof Yt),"parentNode");this.#d=t?t instanceof Yt?t:t.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#v)return;if(this.#b)return;this.#b=!0,this.#y();const t=this.#N();this.propsReady(t);for(const e in t){const r=t[e];this.#r[e]=r}this.#_(),g(this.#r,((t,e)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,e);Reflect.defineProperty(this,e,{get(){let t=Reflect.get(this.#n,e);return r?.get?r?.get():t},set(t){r?.set?r?.set(t):Reflect.set(this.#n,e,t)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=$t(this.#r,this);let e=o(this.constructor,ct.COMPUTED);g(e,((t,e)=>{Dt.startCollect(this,lt.COMPUTED),Dt.setUpdater((()=>{this.#n[e]=t.call(this)})),this.#r[e]=t.call(this),Dt.endCollect(),Reflect.defineProperty(this,e,{get(){return Reflect.get(this.#n,e)},set(t){ht(this.tagName,"Cannot set a computed property '"+e+"'")}})}));let n=o(this.constructor,ct.WATCH);g(n,((t,e)=>{t.forEach((t=>{let{source:r,options:n,handler:s}=t,i=s.bind(this);o(n,"once",!1)&&(i=M(i));const a=function(t){let e=o(this,r.replaceAll(Ot,"."));i(e,t,r)}.bind(this);let l=o(n,"deep",!1);if(a.deep=l,Dt.collectWatch(this,(()=>a),e),!o(n,"immediate",!1))return;let c=o(this,r.replaceAll(Ot,"."));i(c,c,r)}))}));let i=function(t,e){let r,n=[];if(Ve.has(e.constructor)){let s=Ve.get(e.constructor),i=function(t,e){let r=u(e.vars),n=e.strings.length-1;for(let s=0;s<=n;s++){let n=o(e.vars,s,"");if(n instanceof ar){let[e,o]=Qe(t,n);r.splice(s,1,...o)}}return r}(e,t);r=$e.has(e.constructor)?function(t,e,r){let n=$e.get(r.constructor)?.cloneNode(!0),s=je.get(r.constructor);const o=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let i,a,l=0,c=0;for(;i=o.nextNode();){let n;if(c++,a&&!a.contains(i)&&(a=void 0),i instanceof HTMLElement||i instanceof SVGElement){i instanceof Yt&&(a=i);let o={};s[c].forEach((s=>{let c=e[l++];switch(s.type){case Be.Event:n=rt(s.up),s.value||l--,s.value&&ke(s.name,c.bind(r),i,r),i.removeAttribute(s.attrName);break;case Be.AttrSlot:a&&s.name,i.removeAttribute(s.attrName);break;case Be.Ref:n=rt(s.up),c.current=i,i.removeAttribute(s.attrName);break;case Be.AttrKey:n=rt(s.up),i.setAttribute(We,c);break;case Be.AttrBool:n=rt(s.up),n.value=!!c,n.node=i,n.value&&i.setAttribute(s.name,""),i.removeAttribute(s.attrName);break;case Be.AttrProp:n=rt(s.up),n.value=c,n.node=i,o[s.name]=c,s.attrName&&i.removeAttribute(s.attrName);break;case Be.AttrRef:case Be.Attr:n=rt(s.up),n.value=c,n.node=i,i.setAttribute(s.attrName,c),Be.AttrRef===s.type&&i.removeAttribute(s.name);break;case Be.DirectiveAttr:case Be.DirectiveTag:case Be.DirectiveProp:n=rt(s.up),n.value=c,n.node=i;let t=rt(s.point);t.startNode=i;let[e,u,d,p,h]=c,f=Xe.get(i);if(f||(f={},Xe.set(i,f)),f[s.attrName??Symbol.keyFor(e)]=[t,r,a],d(t,u,void 0,{renderComponent:r,slotComponent:a,varChain:h}),Be.DirectiveAttr===s.type){let t=i.getAttribute(s.attrName);t=J(t,Je,""),i.setAttribute(s.attrName,t)}s.name&&i.removeAttribute(s.name)}n&&t.push(n)})),i instanceof Yt?(i._initProps(o),i._regWrapper(r)):i instanceof HTMLSlotElement&&r._bindSlot(i,i.name||"default",o)}else{s[c].forEach((s=>{let o=e[l++];switch(s.type){case Be.DirectiveSlot:case Be.DirectiveText:n=rt(s.up),n.value=o,n.node=i;let[t,e,l,c,u]=o,d=Symbol.keyFor(t),p=document.createComment(`compelem-${r.tagName}-${d}-start`);n.textNode=p,i.parentNode.insertBefore(p,i),i.nodeValue=`compelem-${r.tagName}-${d}-end`;let h=rt(s.point);h.startNode=p,h.endNode=i,Ge.set(i,[h,r,a,e,u]),Ke.set(i,l),ze.set(i,n),Dt.startRender(i);let f=l(h,e,void 0,{renderComponent:r,slotComponent:a,varChain:u});Dt.endRender(r);let g=tr(i,f[1],r);g&&g.length>0&&nr.insertBefore(i,Array.from(g));break;case Be.Text:n=rt(s.up),n.node=i;let m=Z(o??""),v=document.createTextNode(m);i.replaceWith(v),n.textNode=v}n&&t.push(n)}))}}return n.childNodes}(n,i,e):Ze(n,s,i,e)}else{let[s,o]=Qe(e,t);Ve.set(e.constructor,s),r=Ze(n,s,o,e)}return Ue.set(e,n),r}(this.render(),this);i&&(this.#o.append(...i),this.#u=B(this.#o.childNodes,(t=>t.nodeType===Node.ELEMENT_NODE)),this.#c=this.#u[0]),g(this.#h,((t,e)=>{this.#C(e)}));const a=this;let l=o(this.constructor,yt);l&&l.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(a.#n[t]=e,a.#n[t])))}));let c=o(this.constructor,"hostStyles"),d=this.#p?.shadowRoot??this.ownerDocument,p=Qt.get(d);if(!p?.includes(this.constructor)&&c.length>0){let t=[];g(c,(e=>{if(r(e)){let r=new CSSStyleSheet;r.replaceSync(e),t.push(r)}else t.push(e)})),d.adoptedStyleSheets=[...d.adoptedStyleSheets,...t],p?.push(this.constructor)}this.beforeMount();let h=o(this.constructor,ct.EVENTS);h&&h.forEach((async t=>{let e=t.name,r=w({target:document,once:!1,passive:!1,capture:!1},t.options),n=x(t.fn,this),s=r.target;N(s)&&(s=await s.call(this,this)),s?s.addEventListener(e,n,r):ht(this.tagName,"The target of @event('"+e+"',...) is invalid")})),Dt.startCollect(this,lt.CSS);let f=[];this.styles.forEach((t=>{if(!N(t))return;let e=new CSSStyleSheet;f.push(e),Dt.setUpdater((()=>{let r=t()??"";e.replaceSync(r)}));let r=t();s(r)||e.replaceSync(r)})),Dt.endCollect(),f.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...f]),setTimeout((()=>{this.#f=!0,this.mounted(),l&&l.forEach((t=>{t.mounted(this,((t,e)=>(a.#n[t]=e,a.#n[t])))}))}),0),this.#v=!0}propsReady(t){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#T(t,e){this.#y();let r=o(this.#e[e],"props");r&&g(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof Yt?t._updateProps(r):g(r,((e,r)=>{if(t instanceof HTMLSlotElement){let n=o(t,"__l_comp");if(n){let s=t.name||"default",o=n.#e[s];o||(o=n.#e[s]={props:{}}),o.props||(o.props={}),o.props[r]=e,n.#T(t,s)}}else t.setAttribute(r,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,r){this.#A(t,e,r)}shouldUpdate(t){return!0}updated(t){}#w={};_notify(t,e){let r=[];for(let n=0;n<e.length;n++){const s=e[n];r.push(s);let i=o(this,r),a=ft(r);this.#s[a]={value:i,chain:"slots"===a?["slots"]:r,oldValue:t,end:r.length===e.length}}return this.#E}#S(){if(A(this.#s)<1)return;const t=this.#s;this.#s={};const e=Object.keys(t);let r=o(this.constructor,yt);if(r&&r.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)})),!this.shouldUpdate(t))return;let n=new Set;g(t,(({value:t,chain:e,oldValue:r,end:s},o)=>{this.#i[o]&&this.#i[o].forEach((t=>{n.add(t)}))})),n.forEach((t=>{t===this?er(this.render(),this,void 0,e):rr(t,this)})),this.#P.forEach((t=>{this.#C(t)})),this.updated(t)}#N(){let t=o(this.constructor,ct.PROPS),r=this.attributes,s=this.tagName,l=this.#l,u={};g(r,(({name:e,value:r})=>{if(e[0]===Me||e[0]===xe||e[0]===Oe||e===Le||"slot"===e)return;let n=O(e);t&&!t[n]&&(u[e]=r)})),this.#a=this.#a?w(this.#a,u):u;let d={};if(!t)return Object.seal(d);let p=Object.keys(t),h=p.length;for(let u=0;u<h;u++){const h=p[u],g=m(h),v=this.hasAttribute(g);let b,y=t[h],E=c(l,h),N=o(this,h);if(!("_defaultValue"in y)&&(y._defaultValue=N,!y.type)){n(N)&&ht(s,"Prop '"+h+"' has neither propType nor defaultValue be used for type inference");let t=typeof N;S(N)&&(t="array");let e=Ft[t];y.type=e}if(E)b=D(l[h])?N:l[h];else{b=N;let t=r.getNamedItem(g)||r.getNamedItem(xe+g);t&&(E=!0,b=t.value)}if(y.required&&!E){ht(s,"Prop '"+h+"' is required");break}b=this.#k(t,h,b,v);let _=o(t,[h,"getter"]);_&&(_=x(_,this));let C=o(t,[h,"setter"]);if(C&&(C=x(C,this)),(_||C)&&Reflect.defineProperty(this.#r,h,{set:C||function(t){},get:_}),y.attribute&&a(b)&&!i(b)){let t=m(h),r=R(b);(f=y.type)===Boolean||e(f,(t=>t===Boolean))?(r=mt(b),L(r)?this.toggleAttribute(t,r):this.setAttribute(t,r)):this.setAttribute(t,r)}this.#r[h]=b,d[h]=b}var f;return Object.seal(d)}#M(t,e){let r=t;try{for(let n=0;n<e.length;n++){const s=e[n];r=s===Boolean?mt(t):s===Number?Number(t):s===String?String(t):s===Object||s===Array?W(t):s===Date?new Date(t):new s(t)}}catch(e){ht(this.tagName,"Convert attribute error with "+t)}return r}#k(t,n,o,i){let l=t[n];if(!l)return o;let c=l.isValid,u=l.type,d=S(u)?u:[u],p=l.converter,h=o;if(!e(d,(t=>t===String))&&r(h)&&!H(h))try{h=p?p(h):this.#M(h,d)}catch(t){ht(this.tagName,`Convert attribute '${n}' error with `+h)}for(let t=0;t<d.length;t++){"Boolean"===d[t].name&&(h=(!1!==i||!s(h))&&mt(h))}if(D(h))return h;let f=typeof h,g=!a(h);for(let t=0;t<d.length;t++){const e=d[t];if(T(f,e.name,"i")||h instanceof e||Object.prototype.toString.call(h)===Object.prototype.toString.call(e.prototype)){g=!0;break}}return g||ht(this.tagName,`Invalid prop '${n}'. expected '${d.map((t=>t.name||t))}' but got '${f}'`),c&&(c.call(this,h,this.#r)||ht(this.tagName,`Invalid prop '${n}'. IsValid() check failed`)),h}#_(){let t=o(this.constructor,ct.STATES);g(t,((e,r)=>{let n=t[r],s=o(this,r);if(n){let t=n.prop;s=t?f(this.#r[t]):o(this,r)}this.#r[r]=s}))}#x=I(this.propsReady,100);_setParentProps(t,e){if(this.#v){let r=o(this.constructor,ct.PROPS);g(t,((t,e)=>{let n=O(e),s=r[n];if(!s)return;let o=this.#r[n];t=this.#k(r,n,t),s.hasChanged&&!s.hasChanged.call(this,t,o)||(this.#r[n]=t,this._notify(o,[n]))})),w(this.#l,t),w(this.#a,e),this.#x(this.#l)}}_updateProps(t){let e=o(this.constructor,ct.PROPS);g(t,((t,r)=>{let n=O(r);e[n]&&(t=this.#k(e,n,t),Dt.__skipCheck=!0,V(this,n,t),Dt.__skipCheck=!1)})),w(this.#l,t),this.#x(this.#l)}_initProps(t,e){this.#l=h(this.#l||{},t),this.#a=h(this.#a||{},e)}_bindSlot(t,e,r){if(this.#g[e]||(this.#g[e]=t,Reflect.defineProperty(t,"__l_comp",{value:this})),t.addEventListener("slotchange",(r=>{this.#v&&this.#T(t,"default"===e?"":e)})),!l(r)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=r}}_bindSlotHook(t,e){this.#h[t]=e}#P=new Set;_updateSlot(t,e,r){let n=this.#g[t],s=this.#h[t];if(!s&&!n)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=r),s)this.#P.add(t);else{let t=n.assignedElements({flatten:!0});for(let n=0;n<t.length;n++){t[n].setAttribute(e,r+"")}}}#y(){const t=C(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let e=$(t,(t=>t.nodeType===Node.TEXT_NODE?"default":t instanceof Element?t.getAttribute("slot")||"default":void 0));if(l(e))return void(l(this.#r["#slots"])||(this.#v?this.#n["#slots"]={}:this.#r["#slots"]={}));g(e,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&s(e.textContent)||e instanceof HTMLSlotElement&&l(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=b(t);if(!(e.nodeType===Node.TEXT_NODE&&s(e.textContent)||e instanceof HTMLSlotElement&&l(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let r={};g(e,((t,e)=>{l(t)||(r[e]=t)})),this.#v?this.#n["#slots"]=r:this.#r["#slots"]=r}#C(t){let e=this.#h[t];if(!e)return;let r=this.#e[t];if(!this.#r["#slots"][t])return;this.renderAsync(e,o(r,"props"));const n=this._asyncDirectives.get(e);let s=n?.buildView(e(o(r,"props"))),i=j(v(s),(t=>t.nodeType===Node.COMMENT_NODE));if(i){let e=this.#m[t];if(!l(e))for(let t=0;t<e.length;t++){const r=e[t];r.parentNode?.removeChild(r)}this.#m[t]=i,this.append(...i),this.#P.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#A(t,e,r){if(!this.#v)return;if(Pt(this.constructor).has(t)){let e=O(t);if(H(r)){r=o(this.constructor,ct.PROPS)[e]._defaultValue}this._updateProps({[e]:r})}}_regDeps(t,e){let r=this.#i[t];r||(r=this.#i[t]=new Set),r.add(e);let n=t.split(Ot);if(n.pop(),n.length<1)return;let s=n.join(Ot);r=this.#i[s],r||(r=this.#i[s]=new Set),r.add(e)}_regWrapper(t){this.#p=t}emit(t,e={},r){r&&r.event&&(e.event=r.event),e.target=this,this.dispatchEvent(new CustomEvent(t,{bubbles:o(r,"bubbles",!1),composed:o(r,"composed",!1),cancelable:!0,detail:e}))}on(t,e){this.#w[t]||(this.#w[t]=[]);let r=e.bind(this);this.#w[t].push(r),this.addEventListener(t,r)}nextTick(t,e){Ut.pushNext(t,e)}forceUpdate(){g(this.#n,((t,e)=>{this.#s[e]={value:void 0,chain:void 0}})),this.#S()}}class Jt{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(t,e,r){this.startNode=t,this.attrName=e,this.type=r}setVarIndex(t){this.varIndex=t}getNodes(){let t=this.startNode.nextSibling;if(!this.endNode)return[t];let e=[];for(;t&&t!==this.endNode;)e.push(t),t=t?.nextSibling;return e}}var Zt;!function(t){t.AFTER_BEGIN="afterbegin"}(Zt||(Zt={}));const te={};function ee(t,e,r,n,s,o,i,a=!1){let c;if(a?(Dt.startRender(t.endNode),c=n(t,e,r,{renderComponent:s,slotComponent:o,varChain:i}),Dt.endRender(s)):c=n(t,e,r,{renderComponent:s,slotComponent:o,varChain:i}),!c)return;let[u,d]=c;if(u===Mt.NONE)return;let p=t.getNodes();if(u===Mt.REMOVE)for(let t=0;t<p.length;t++){const e=p[t];e.parentNode?.removeChild(e)}else if(u===Mt.REPLACE){let e=[];for(let t=0;t<p.length;t++){const e=p[t];e.parentNode?.removeChild(e)}let r=tr(t.endNode,d,s);e=v(r);let n=document.createDocumentFragment();n.append(...e),t.endNode.parentNode.insertBefore(n,t.endNode)}else if(u===Mt.UPDATE){let e,r={},n=[],o=[],i=Fe.get(t.endNode);if(d||(d=new ar([],[])),l(p)){let e=tr(t.endNode,d,s);return void t.startNode.after(...e)}let a={};d instanceof ar&&d.vars.forEach((t=>{if(t instanceof ar){const e=t.getKey();a[e]=t,r[e]=!0,o.push(e)}})),p=B(U(p),(t=>t.nodeType===Node.ELEMENT_NODE)),e=B(U(v(e)),(t=>t.nodeType===Node.ELEMENT_NODE));let c={},u="",h={};for(let t=0;t<p.length;t++){let e=p[t],r=e.getAttribute("key");if(r){if(c[r]){u=r;break}c[r]=e,n.push(r),h[r]=!0}}if(u)return void pt(`${O(t.endNode._diName)} - duplicate key '${u}'`);let f=r;const m=t.startNode.parentNode;let y=[],E=[];g(h,((t,e)=>{f[e]||(E.push(e),delete h[e],F(n,(t=>t===e)))}));let S,N=!1;if(!l(o)){let e=-1,r=[],s=[],i=0,a=0;for(;a<o.length;a++){const l=o[a];let u=n.findIndex((t=>t===l));if(u<0){let e=o[a-1],r=e?c[e]||e:t.startNode;y.push({prevNode:r,newkey:l}),i++}else if(u>-1&&u!==a-i){if(e<0||1===Math.abs(e-u)){let t=b(r);r.push({nodeId:l,targetId:0===a?Zt.AFTER_BEGIN:t?t.nodeId:o[a-1]})}else s.push({moveGroup:r,moveIndex:a+r.length}),r=[],r.push({nodeId:l,targetId:o[a-1]});e=u}}if(r.length>0&&s.push({moveGroup:r,moveIndex:a+r.length}),s.length>0){N=!0;let e=s.sort(((t,e)=>t.moveGroup.length-e.moveGroup.length));if(e.length<2){let{moveGroup:r}=e[0];if(r.length>1){let t=b(r).targetId;r[r.length-2].nodeId===t&&(r=_(r))}r.forEach((({targetId:e,nodeId:r})=>{let n,s=c[r];e===Zt.AFTER_BEGIN?(n=t.startNode,n.after(s)):(n=c[e],n.after(s))}))}else{let r=b(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-r)&&(e=_(e)),e.forEach((({moveGroup:e})=>{e.forEach((({targetId:e,nodeId:r})=>{let n,s=c[r];e===Zt.AFTER_BEGIN?(n=t.startNode,n.after(s)):(n=c[e],n.after(s))}))}))}}}if(y.length>0&&(S=function(t,e,r,n,s,o){const i=[],a=[],l=[];let c,u=[];t.forEach((t=>{let r=b(u);r&&c===t.prevNode?(r.group||(r.group=[c]),r.group.push(t.newkey)):u.push(t),c=t.newkey;let n=t.newkey;l.push(n),i.push(""),a.push(e[n])})),i.push("");let d=new ar(i,a),p=[...s],h=tr(o,d,n),f=Fe.get(o);s.length=0,s.push(...f);let g=new Map;return h.forEach((t=>{const e=t.getAttribute("key");l.includes(e)&&(g.set(e,!0),te[e]=t)})),p.forEach(((t,e)=>{const n=t.key+"";!g.get(n)&&r.includes(n)&&s.push(t)})),u}(y,a,o,s,i,t.endNode),S.forEach(((e,r)=>{let n=e.newkey,s=te[n],o=e.prevNode;if(e.group){let t=document.createDocumentFragment();t.append(...K(e.group,(t=>te[t]))),s=t}o===t.endNode?o.before(s):o===t.startNode?o.after(s):"string"==typeof o?te[o].after(s):o.after(s)}))),E.forEach((t=>{let e=c[t];e&&e.parentNode&&m.removeChild(e)})),d.vars[0]instanceof ar){let t=[],e=[];g(d.vars,(r=>{e.push(...r.vars),t.push(...K(r.vars,(t=>"1")))})),t.push("1"),d=new ar(t,e)}if(N||E.length>0||S){const t=$(i,(t=>t.key));let e=[],r=0;o.forEach((n=>{t[n].forEach((t=>{t.varIndex=r++,e.push(t)}))})),i=e}rr(t.endNode,s,d,i)}}let re=0;function ne(t,e){let r=t.name||"Di-"+re++,n=Symbol.for(r);return(...e)=>{let r=t(...e);return[n,e,r,t=>{},Dt.popDirectiveQ()]}}const se=["resize","outside","mutate"],oe=new WeakMap,ie=[],ae=[],le=[],ce=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,r=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;let n=oe.get(e.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:t.inlineSize,h:t.blockSize}}}),e.target)}}}));var ue;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(ue||(ue={}));const de=new WeakMap,pe=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const r=t[e];let n=de.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=ue.Tree,o=n[ue.Tree];break;case"childList":s.type=ue.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[ue.Child];break;case"attributes":s.type=ue.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[ue.Attr];break;case"characterData":s.type=ue.Char,s.oldValue=r.oldValue,o=n[ue.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function he(t,e,r,n){if("resize"===t)!function(t,e){oe.has(t)||(oe.set(t,e),ce.observe(t))}(e,r);else if("outside"===t)switch(n[0]){case"mousedown":!function(t,e){ie.push([t,e])}(e,r);break;case"dblclick":!function(t,e){le.push([t,e])}(e,r);break;default:!function(t,e){ae.push([t,e])}(e,r)}else"mutate"===t&&function(t,e,r){let n=G(r,"child"),s=G(r,"attr"),o=G(r,"char"),i=G(r,"tree"),a=de.get(t);a||(a={},de.set(t,a),n&&(a[ue.Child]=e),s&&(a[ue.Attr]=e),o&&(a[ue.Char]=e),i&&(a[ue.Tree]=e),pe.observe(t,{childList:n,attributes:s,characterData:o,subtree:i}))}(e,r,n)}document.addEventListener("mousedown",(t=>{let e=o(t.composedPath(),0,t.target);ie.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(k(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1),document.addEventListener("click",(t=>{let e=o(t.composedPath(),0,t.target);ae.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(k(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1),document.addEventListener("dblclick",(t=>{let e=o(t.composedPath(),0,t.target);le.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(k(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1);const fe=/,|^(debounce:.+)|(debounce$)/,ge=/,|^(throttle:.+)|(throttle$)/,me="self",ve="stop",be="prevent",ye="once",Ee="left",Se="right",Ne="middle",_e="ctrl",Ce="alt",Te="shift",Ae="meta",we={esc:"escape"},Pe=":";function ke(t,e,r,n){let s,o=t.split("."),i=o.shift(),a=o.includes(ye),l=e;if(s=z(o,(t=>fe.test(t)))){let t=s.split(Pe);l=I(l,parseInt(t[1])||100)}if(s=z(o,(t=>ge.test(t)))){let t=s.split(Pe);l=X(l,parseInt(t[1])||100)}if(a&&(l=M(l)),function(t){return se.includes(t)}(i))return he(i,r,l,o),l;let c=t=>{if(o.includes(be)&&t.preventDefault(),o.includes(ve)&&t.stopPropagation(),!o.includes(me)||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes(Ee)&&0!=t.button)return;if(o.includes(Se)&&2!=t.button)return;if(o.includes(Ne)&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(F(o,(t=>t==_e))[0]&&!t.ctrlKey)return;if(F(o,(t=>t==Ce))[0]&&!t.altKey)return;if(F(o,(t=>t==Te))[0]&&!t.shiftKey)return;if(F(o,(t=>t==Ae))[0]&&!t.metaKey)return;if(!K(o,(t=>we[t]||t)).includes(t.key.toLowerCase()))return}l(t)}};r.addEventListener(i,c);let u=n.__events[i];return u||(u=n.__events[i]=[]),u.push([r,c]),c}const Me="@",xe=".",Oe="?",De="*",Re=":",Le="ref",We="key",He=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,Ie="slot-props",Ve=new Map,$e=new Map,je=new Map;var Be;!function(t){t.Event="event",t.Directive="directive",t.DirectiveTag="directiveTag",t.DirectiveAttr="directiveAttr",t.DirectiveProp="directiveProp",t.DirectiveText="directiveText",t.DirectiveSlot="directiveSlot",t.Attr="attr",t.AttrProp="attrProp",t.AttrBool="attrBool",t.AttrRef="attrRef",t.AttrSlot="attrSlot",t.AttrKey="key",t.Ref="ref",t.Text="text"}(Be||(Be={}));const Ue=new WeakMap,Fe=new WeakMap,Ke=new WeakMap,Ge=new WeakMap,ze=new WeakMap,Xe=new WeakMap;function Qe(t,e){let r="",n=u(e.vars),s=e.strings.length-1,i=e.vars.length-1,a=0;for(let l=0;l<=s;l++){const s=e.strings[l];let c=o(n,a,"");if(c instanceof ar){let[e,r]=Qe(t,c);c=e,n.splice(a,1,...r),a+=r.length-1}else c=l>i?"":qe;a++,r=r+s+c}let l=0;return r=r.replace(He,((t,e)=>tt(t,qe,(()=>qe.replace("--\x3e","")+l++)))),r=r.replace(or,"$1><").trim(),[r,n]}const qe="\x3c!--c_ui-pl_df--\x3e",Ye="\x3c!--c_ui-pl_df",Je=/<!--c_ui-pl_df\d*(-->)?/;function Ze(t,e,r,n,s=!1){const o=document.createElement("div");o.innerHTML=e;const i=je.has(n.constructor);s||!i||$e.has(n.constructor)||$e.set(n.constructor,o.cloneNode(!0));let a=0;const l=document.createNodeIterator(o,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let c,u,d=0,p=i?void 0:{},h=null,f="";for(;c=l.nextNode();){a++;let e=i?void 0:[];if(u&&!u.contains(c)&&(u=void 0),c instanceof HTMLElement||c instanceof SVGElement){c instanceof Yt&&(u=c);let s={},o=v(c.attributes);for(let i=0;i<o.length;i++){const a=o[i];let{name:l,value:p}=a;if(l!==Ie)if(y(l,Ye)){let s=r[d];if(S(s)&&E(s[0])){let[,r,o,i,a]=s;i(kt.TAG);let p=new Jt(c,l.substring(1),kt.TAG),g=Xe.get(c);g||(g={},Xe.set(c,g)),g[Symbol.keyFor(s[0])]=[p,n,u];let m=new xt(d,c);m.isDirective=!0,m.value=s,m.isComponent=!!u,t.push(m),h&&h?.contains(c)&&(m.key=f),d++,o(p,r,void 0,{renderComponent:n,slotComponent:u,varChain:a}),e&&e.push({type:Be.DirectiveTag,point:p,up:m,name:l})}c.removeAttribute(l)}else if(l[0]!==Me)if(l!==Le)if(l!==We){if(Je.test(p)){let o=r[d],i=new xt(d,c,l.replace(/\.|\?|@/,""),p);if(i.isComponent=!!u,h&&h?.contains(c)&&(i.key=f),l[0]===xe||l[0]===Oe||l[0]===De){if(S(o)&&E(o[0])){let[,t,r,s,a]=o;s(kt.PROP);let d=l.substring(1),p=new Jt(c,d,kt.PROP),h=Xe.get(c);h||(h={},Xe.set(c,h)),h[d]=[p,n,u],r(p,t,void 0,{renderComponent:n,slotComponent:u}),i.value=o,i.isDirective=!0,e&&e.push({type:Be.DirectiveProp,up:i,point:p,name:l,attrName:d})}else if(l[0]===Oe){i.isToggleProp=!0,i.value=!!o;let t=l.substring(1);i.value&&c.setAttribute(t,""),e&&e.push({type:Be.AttrBool,name:t,up:i,attrName:l})}else if(l[0]===De){i.value=o;let t=l.substring(1);const[r,n]=t.split(Re);let s=r;switch(n){case"camel":s=O(s);break;case"kebab":s=m(s);break;case"snake":s=et(s)}i.attrName=s,c.setAttribute(s,o),e&&e.push({type:Be.AttrRef,up:i,name:l,attrName:s})}else{let t=O(l.substring(1)),r=Lt.get(o);r&&(c._propObjectKeyMap[r.join(Ot)]=t),i.value=o,i.isProp=!0,s[t]=o,e&&e.push({type:Be.AttrProp,up:i,name:t,attrName:l})}c.removeAttribute(l),o=""}else{let t,r;i.value=o;let s={type:Be.Attr,up:i,attrName:l};if(S(o)&&E(o[0])){let e=kt.ATTR;"class"===l?e=kt.CLASS:"style"===l&&(e=kt.STYLE);let[,a,d,p,h]=o;p(e),i.isDirective=!0,i.attrName=l;let f=new Jt(c,l,e),g=Xe.get(c);g||(g={},Xe.set(c,g)),g[l]=[f,n,u],r=a,t=d,o="",s.type=Be.DirectiveAttr,s.point=f}p=J(p,Je,o),a.value=p,t&&t(s.point,r,void 0,{renderComponent:n,slotComponent:u}),e&&e.push(s)}t.push(i),d++}}else{let n=r[d];c.setAttribute(l,n);let s=new xt(d,c);s.notUpdated=!0,h&&h?.contains(c)&&(s.key=f),t.push(s),d++,h=c,f=n,e&&e.push({up:s,type:Be.AttrKey}),t.length>0&&t.forEach((t=>{t.key=t.key??n}))}else{if(Je.test(p)){let n=r[d],s=new xt(d,c);s.notUpdated=!0,h&&h?.contains(c)&&(s.key=f),t.push(s),d++,n.current=c,e&&e.push({type:Be.Ref,up:s,attrName:l})}c.removeAttribute(l)}else{let s=t=>{},o=null,i=!1;if(Je.test(p)){o=new xt(d,c),o.notUpdated=!0,h&&h?.contains(c)&&(o.key=f),t.push(o),s=r[d].bind(n),d++,i=!0}let a=l.substring(1);ke(a,s,c,n),c.removeAttribute(l),e&&e.push({type:Be.Event,up:o,name:a,attrName:l,value:i})}else{let t=c.getAttribute("name")||"default";e&&e.push({type:Be.AttrSlot,name:t,attrName:l})}}c instanceof Yt?(c._initProps(s),c._regWrapper(n)):c instanceof HTMLSlotElement&&n._bindSlot(c,c.name||"default",s)}else{let s=c;if(`\x3c!--${s.nodeValue}--\x3e`!==qe)continue;let o=new xt(d,c);h&&h?.contains(c)&&(o.key=f),t.push(o),o.isComponent=!!u,o.isText=!0;let i=r[d];if(S(i)&&E(i[0])){const t=Symbol.keyFor(i[0]);let r;r=document.createComment(`compelem-${n.tagName}-${t}-start`),o.textNode=r,s.parentNode.insertBefore(r,s),s.nodeValue=`compelem-${n.tagName}-${t}-end`,s._diName=t,o.isDirective=!0,o.value=i;let a=u?kt.SLOT:kt.TEXT,[,l,c,d,p]=i;d(a);let h=new Jt(r,"",a);h.endNode=s,Ge.set(s,[h,n,u,l,p]),Ke.set(s,c),ze.set(s,o),Dt.startRender(s);let f=c(h,l,void 0,{renderComponent:n,slotComponent:u,varChain:p});if(Dt.endRender(n),f){let t=tr(s,f[1],n);t&&t.length>0&&nr.insertBefore(s,Array.from(t))}i=void 0,e&&e.push({type:a===kt.SLOT?Be.DirectiveSlot:Be.DirectiveText,up:o,point:h})}else o.value=i,e&&e.push({type:Be.Text,up:o});d++;let a=Z(i??""),l=document.createTextNode(a);s.parentNode.insertBefore(l,s),o.textNode=l}p&&e&&(p[a]=e),h&&!h.contains(c)&&h!==c&&(h=null,f="")}return!s&&p&&je.set(n.constructor,p),o.childNodes}function tr(t,e,r){let[n,s]=Qe(r,e),o=[],i=Ze(o,n,s,r,!0);return Fe.set(t,o),i}function er(t,e,r,n){if(s(Q(t.strings)))return;if(!Ue.has(e))return;let a=t.flatVars(e);r=r??Ue.get(e);for(let t=0;t<r.length;t++){const s=r[t];let l=s.varIndex;if(l<0)continue;if(s.notUpdated)continue;let c=s.value,d=a,p=s.node,h=q(l,Ot);for(let e=0;e<h.length;e++){const r=h[e];d=o(d,r),d&&d.vars&&t<h.length-1&&(d=d.vars)}if(!i(c)&&c===d)continue;let f=p;if(s.isDirective){let[t,e,r,,n]=s.value,o=Ge.get(p);if(!o){const e=Xe.get(p);o=e[s.attrName]||e[Symbol.keyFor(t)]}let[i,a,l]=o,[,c]=d;const u=ze.get(p);if(u){u.value=d;Ge.get(p)[3]=c}ee(i,c,e,r,a,l,n,i.type==kt.TEXT||i.type==kt.SLOT)}else if(s.isToggleProp){if(!!d===c)continue;f.toggleAttribute(s.attrName,!!d),V(f,s.attrName,!!d)}else if(s.isProp){if(!i(d)&&d===c)continue;if(p instanceof Yt)if(i(d)&&Object.is(d,c)){let t=O(s.attrName),e=[t];if(n&&n.length>0){let r="",o=Q(Lt.get(s.value),Ot);n.forEach((t=>{t.startsWith(o)&&t.length>r.length&&(r=t)})),e=u(q(r.replace(o,t),Ot))}jt(p,c,e)}else p._updateProps({[s.attrName]:d});else p instanceof HTMLSlotElement&&e._updateSlot(p.getAttribute("name")||"default",s.attrName,d)}else if(s.attrName){if(!Y(c,d))switch(s.attrName){case"value":if(p instanceof HTMLInputElement){p.value=d;break}default:p.setAttribute(s.attrName,J(s.attrTmpl,Je,d+""))}}else if(s.isText){s.textNode.textContent=Z(d??"")}s.value=d}}function rr(t,e,r,n){const s=Ke.get(t),[o,i,a,l,c]=Ge.get(t),u=ze.get(t);if(!r){let t=s(o,u.value[1],l,{renderComponent:i,slotComponent:a,varChain:c});if(!t)return;r=t[1]}if(r&&r.vars[0]instanceof ar){let t=[],e=[];g(r.vars,(r=>{e.push(...r.vars),t.push(...K(r.vars,(t=>"1")))})),t.push("1"),r=new ar(t,e)}n&&Fe.set(t,n),er(r,e,n=n??Fe.get(t))}const nr={insertBefore:function(t,e){if(!t.parentNode)return;let r=document.createDocumentFragment();r.append(...e),t.parentNode.insertBefore(r,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let r=t.nextSibling;for(;r&&r!==e;)r?.parentNode?.removeChild(r),r=t.nextSibling}};function sr(t,...e){return new ar(r(t)?[t]:t,e)}const or=/([a-z0-9"'])\s*>\s*</gim;function ir(t){return{current:t}}class ar{strings;vars;constructor(t,e){this.strings=u(t),this.vars=e}getKey(){let t=this.vars,e="";return g(this.strings,((r,n)=>{if(at.test(r))return e=Z(t[n]),!1})),e}getKeys(){let t=this.vars,e=[];for(let r=0;r<this.strings.length;r++){const n=this.strings[r];if(at.test(n)){let n=Z(t[r]);e.push(n)}}return l(e)&&t.forEach((t=>{if(t instanceof ar){let r=t.getKey();e.push(r)}})),e}append(t){let e=b(this.strings);return t.strings.forEach(((t,r)=>{0!=r?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=u(this.vars,t.vars),this}insert(t,e){let r=e.strings.shift();return this.strings[t]+=r,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,r]=Qe(t,this),n=Ze([],e,r,t);return nt(n,((t,e)=>t+(e.outerHTML??"")),"")}flatVars(t){let e=u(this.vars),r=this.strings.length-1,n=0;for(let s=0;s<=r;s++){let r=o(e,n,"");if(r instanceof ar&&r.vars.length>0){let[s,o]=Qe(t,r);r=s,e.splice(n,1,...o),n+=o.length-1}n++}return e}}function lr(t,e,r){r.get||pt(`Computed '${e}' must be a getter`),c(t.constructor,ct.COMPUTED)||(t.constructor[ct.COMPUTED]=l(t.constructor[ct.COMPUTED])?{}:f(t.constructor[ct.COMPUTED])),t.constructor[ct.COMPUTED][e]=r.get}const cr=_t(class extends vt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=o(t,r);V(t,r,I(s,this.wait,this.immediate));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&V(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[dt.METHOD]}wait;immediate;result;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function ur(t,e){return(r,n,s)=>{c(r.constructor,ct.EVENTS)||(r.constructor[ct.EVENTS]=l(r.constructor[ct.EVENTS])?[]:f(r.constructor[ct.EVENTS])),r.constructor[ct.EVENTS].push({name:t,options:e,fn:r[n]})}}const dr=_t(class extends vt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=x(o(t,r),t);V(t,r,M(s));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&V(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[dt.METHOD]}wait;result;constructor(){super()}});var pr;!function(t){t.ONCE="once",t.UPDATABLE="updatable"}(pr||(pr={}));class hr extends vt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){}mounted(t,e,...r){}get targets(){return[dt.FIELD]}selector;cache;result;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){this.result=t.shadowRoot?.querySelector(this.selector)}beforeMount(t,e,r,n,...s){const o=this;Reflect.defineProperty(t,n,{get:()=>(o.result&&o.cache||o.getter(t),o.result)})}updated(t,e){this.cache===pr.UPDATABLE&&this.getter(t)}}const fr=_t(hr),gr=_t(class extends hr{getter(t){this.result=t.shadowRoot?.querySelectorAll(this.selector)}});function mr(t){if(1===arguments.length)return(e,r)=>{vr(e,r,t)};vr(arguments[0],arguments[1],{prop:""})}function vr(t,e,r){if(!c(t.constructor,ct.STATES)){const e={};let r=t.constructor;for(;(r=gt(r))!==Yt;)h(e,r[ct.STATES]?f(r[ct.STATES]):{});Reflect.defineProperty(t.constructor,ct.STATES,{configurable:!1,enumerable:!1,value:e})}r.shallow=r.shallow||!1,t.constructor[ct.STATES][e]=r}function br(t,e,r){vr(t.prototype,e,r||{prop:""})}function yr(t){return e=>{if(e){if(e.prototype.hasOwnProperty("attributeChangedCallback")){let t=e.prototype.attributeChangedCallback;e.prototype.attributeChangedCallback=function(e,r,n){Yt.prototype.attributeChangedCallback.call(this,e,r,n),t.call(this,e,r,n)}}if(e.prototype.hasOwnProperty("connectedCallback")){let t=e.prototype.connectedCallback;e.prototype.connectedCallback=function(){Yt.prototype.connectedCallback.call(this),t.call(this)}}if(e.prototype.hasOwnProperty("disconnectedCallback")){let t=e.prototype.disconnectedCallback;e.prototype.disconnectedCallback=function(){Yt.prototype.disconnectedCallback.call(this),t.call(this)}}customElements.define(t,e)}}}const Er=_t(class extends vt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=o(t,r);V(t,r,X(s,this.wait));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&V(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[dt.METHOD]}wait;result;constructor(t){super(),this.wait=t}});function Sr(t,e){return(r,n)=>{c(r.constructor,ct.WATCH)||(r.constructor[ct.WATCH]=l(r.constructor[ct.WATCH])?{}:f(r.constructor[ct.WATCH]));(S(t)?t:[t]).forEach((t=>{let s=t.replaceAll(".",Ot),o=r.constructor[ct.WATCH][s];S(o)||(o=r.constructor[ct.WATCH][s]=[]),o.push({source:t,options:e,handler:r[n]})}))}}const Nr=["key"],_r=ne((function(t){return(t,[e],r)=>{let n=t.startNode;if(r)g(e,((t,e)=>{n.setAttribute(e,t)}));else if(n instanceof Yt){let t={},r={},s=o(n.constructor,ct.PROPS);g(e,((e,n)=>{if(Nr.includes(n))return;let o=O(n);s[o]?t[n]=e:r[n]=e+""})),n._initProps(t,r)}else g(e,((t,e)=>{n.setAttribute(e,t)}))}}),kt.TAG),Cr=new Map,Tr=ne((function(t){return(t,[e],n,{renderComponent:s})=>{let o=[];if(S(e)?o=U(e):i(e)?o=C(e,((t,e)=>t?e:[])):r(e)&&(o=e.split(" ")),o.length<1&&!n)return;let a=t.startNode;if(Cr.get(a)&&Cr.get(a).length===o.length&&st(Cr.get(a),o))return;let l=Cr.get(a);g(l,(t=>{a.classList.remove(t)})),g(o,(t=>{a.classList.add(t)})),l=u(o),Cr.set(a,l)}}),kt.CLASS),Ar=new Map,wr=new Map,Pr=ne((function(t,e){return(t,r,n,{varChain:s})=>{let o=t.startNode,i=function(t,e,r){let n=K(t,((t,r)=>e(t,r)));if(n.length<1){let t=new ar([],[]);return wr.set(r,t),t}let s=[],o=[];const i=[],a=[];for(let t=0;t<n.length;t++){const e=n[t];let r=b(o),l=e.vars,c=!0,u=e.strings;for(let t=0;t<u.length;t++){const e=u[t];if(at.test(e)){let e=l[t]+"";if(s.includes(e))return void pt(`forEach - duplicate key '${e}'`);s.push(e),c=!1}0==t&&r?o[o.length-1]=r+e:o.push(e)}if(c)return void pt("forEach - missing 'key' prop");let d=b(i);d&&u.length>0&&(i[i.length-1]=R(d)+u.shift()),i.push(""),a.push(e)}i.push("");let l=new ar(i,a);return wr.set(r,l),l}(r[0],e,o);if(n&&n[0]){const e=Ar.get(o);if(l(t.getNodes())&&(!r||l(r[0])))return[Mt.NONE,i];if(e&&st(e,r[0])&&e.length===r[0].length)return[Mt.NONE,i]}return Ar.set(o,rt(r[0])),n?[Mt.UPDATE,i]:[Mt.APPEND,i]}}),(kt.TEXT,kt.SLOT));const kr=new WeakMap,Mr=ne((function(t,e,r){return(n,[s,o],i,{renderComponent:a})=>{let l=n.endNode;if(i){if(!!s==!!i[0]){let t=kr.get(l);return[Mt.NONE,t.call(a,s)]}let t=s?e:r;return kr.set(l,t),[Mt.REPLACE,t.call(a,s)]}{let n=s?e:r;return kr.set(l,n),[Mt.APPEND,n.call(a,t)]}}}),(kt.TEXT,kt.SLOT)),xr=ne((function(t,e){return(t,[e,r],n)=>n?e===n[0]?[Mt.NONE,e?r():sr``]:e?[Mt.REPLACE,e?r():sr``]:[Mt.REMOVE]:[Mt.APPEND,e?r():sr``]}),(kt.TEXT,kt.SLOT));var Or;!function(t){t.CHANGE="change",t.INPUT="input"}(Or||(Or={}));const Dr=new WeakMap,Rr=ne((function(t,e="value"){return(r,n,s,{varChain:a,renderComponent:l})=>{const c=r.startNode;if(s){if(Y(n,s))return;if(!Y(n,s)){let t=n[0];if(c instanceof Yt)c._updateProps({[e]:t});else if(c instanceof HTMLTextAreaElement||c instanceof HTMLSelectElement){if(c.setAttribute(e,t+""),c instanceof HTMLSelectElement){let e=z(c.querySelectorAll("option"),(e=>e.value==t));e&&(e.selected=!0)}}else if(c instanceof HTMLInputElement){if(c.value==t)return;switch(c.type){case"checkbox":case"radio":t?c.setAttribute("checked",""):c.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":c.setAttribute(e,t+""),V(c,e,t);break;default:c.setAttribute(e,t+"")}}}return}if("binded"===o(c,"_model"))return;let u=b(a),d=u.join(Ot),p=Object.keys(l._propObjectKeyMap);if(p.length>0&&g(p,(t=>{if(d.startsWith(t)){let e=d.replace(t,l._propObjectKeyMap[t]);return u=e.split(Ot),!1}})),Dr.set(c,u),i(t)||R(t)||(t=""),c instanceof Yt)c._initProps({[e]:t}),c.addEventListener("update:"+e,(t=>{V(l,u,t.detail.value)})),V(c,"_model","binded");else if(c instanceof HTMLTextAreaElement)c.setAttribute(e,t+""),c.addEventListener("input",(t=>{let e=t.target;V(l,u,e.value)})),V(c,"_model","binded");else if(c instanceof HTMLInputElement){let r="",n="";switch(c.type){case"checkbox":case"radio":r="checked",n="change";break;default:r="value",n="input"}c.setAttribute(e??r,t+""),c.addEventListener(n,(t=>{let e=t.target;V(l,u,e.value)})),V(c,"_model","binded")}else c instanceof HTMLSelectElement&&(c.setAttribute(e,t+""),c.addEventListener("change",(t=>{let e=t.target;V(l,u,e.value)})),V(c,"_model","binded"))}}),kt.TAG),Lr=new Map,Wr=ne((function(t,e){return(t,[r],n)=>{if(n&&r===n[0])return;let s=t.startNode;if(!Lr.has(s)){let t=s.style.display;Lr.set(s,"none"==t?"unset":t)}s.style.display=r?Lr.get(s):"none",e&&e(s,r)}}),kt.TAG),Hr=ne((function(t,e){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(t=t.bind(o),i._bindSlotHook(e||"default",t))}}),kt.SLOT);class Ir{static getCssText(t,e=!1){return r(t)?t:Q(K(t,((t,r)=>r.startsWith("--")?r+":"+t+(e?" !important":""):m(r)+":"+t+(e?" !important":""))),";")}static setStyle(t,e){if(r(t)&&!R(t))return{};let n=Ir.getCssText(t),s={};return g(n.split(";"),(t=>{let r=t.split(":"),n=R(r[0]),o=R(r[1]);s[n]=e.style.getPropertyValue(n),e.style.setProperty(n,o)})),s}}const Vr=new Map;let $r=0;const jr=ne((function(t){return(t,e,r,{renderComponent:n})=>{let s=t.startNode,o=Vr.get(s);o||(o="style_d"+$r++,Vr.set(s,o)),n.nextTick((()=>{Ir.setStyle(e[0],s)}),o)}}),kt.STYLE),Br=ne((function(t){return(e,r,n,{renderComponent:s,varChain:o})=>{const i=e.startNode;if(n){if(!Y(r,n)){let t=e.attrName;i._updateProps({[t]:r[0]})}return}let a=b(o),l=e.attrName;i._initProps({[l]:t}),i.addEventListener("update:"+l,(t=>{V(s,a,t.detail.value)}))}}),kt.PROP),Ur=ne((function(t,e){return(t,[e,r],n)=>{let s=()=>sr``,o=[],i=[];g(r,((t,e)=>{if(N(t))o.push(e),i.push(t);else{let e=t[0],r=t[1];o.push(e),i.push(r)}"default"===e&&(s=t)}));let a=ot(o,(t=>N(t)?t(e):t==e));return n?[Mt.REPLACE,it(i[a]??s)]:[Mt.APPEND,it(i[a]??s)]}}),(kt.TEXT,kt.SLOT));export{Yt as CompElem,Ir as CssHelper,vt as Decorator,dt as DecoratorType,St as DecoratorWrapper,Mt as DirectiveUpdateTag,Jt as EnterPoint,kt as EnterPointType,bt as GetKeyFnName,Or as ModelTriggerType,Ot as PATH_SEPARATOR,qt as PROP_OBJECT_KEY_MAP_SYMBOL,pr as QueryCache,ar as Template,xt as UpdatePoint,Et as _DecoratorMap,yt as _DecoratorsKey,Pt as _getObservedAttrs,_r as bind,Qe as buildHTML,Tr as classes,lr as computed,ir as createRef,cr as debounced,_t as decorator,ne as directive,ur as event,Pr as forEach,sr as html,Mr as ifElse,xr as ifTrue,br as makeState,Rr as model,dr as onced,Tt as prop,fr as query,gr as queryAll,Wr as show,Hr as slot,mr as state,jr as styles,Br as sync,yr as tag,Er as throttled,ee as updateDirective,Sr as watch,Ur as when};
|
package/package.json
CHANGED
package/reactive.d.ts
CHANGED
|
@@ -25,15 +25,14 @@ export declare const Collector: {
|
|
|
25
25
|
__renderCollecting: boolean;
|
|
26
26
|
__skipCheck: boolean;
|
|
27
27
|
};
|
|
28
|
+
export declare const OBJECT_VAR_PATH: WeakMap<any, string[]>;
|
|
28
29
|
/**
|
|
29
|
-
* 1. 初始化时obj都是普通对象
|
|
30
|
-
* 2. OBJECT_VAR_PATH 首次是普通对象
|
|
31
|
-
* 3. OBJECT_META_DATA 直接绑定代理对象
|
|
32
30
|
* @param obj
|
|
33
31
|
* @param context
|
|
34
32
|
* @returns
|
|
35
33
|
*/
|
|
36
|
-
export declare function reactive(obj: Record<string, any>, context: any):
|
|
34
|
+
export declare function reactive(obj: Record<string, any>, context: any): ProxyConstructor;
|
|
35
|
+
export declare function notifyUpdate(context: CompElem, ov: any, path: Array<string>): void;
|
|
37
36
|
export declare class Queue {
|
|
38
37
|
static watchSet: Set<Updater>;
|
|
39
38
|
static computedSet: Set<Updater>;
|
package/render/Template.d.ts
CHANGED
package/render/render.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare function buildTmplate(updatePoints: Array<UpdatePoint>, html: str
|
|
|
36
36
|
export declare function buildTmplate2(updatePoints: Array<UpdatePoint>, vars: any[], component: CompElem): NodeListOf<ChildNode>;
|
|
37
37
|
export declare function buildView(tmpl: Template, component: CompElem): NodeListOf<ChildNode>;
|
|
38
38
|
export declare function buildDirectiveView(pointNode: Node, tmpl: Template, component: CompElem): NodeListOf<ChildNode>;
|
|
39
|
-
export declare function updateView(tmpl: Template, comp: CompElem, updatePoints?: UpdatePoint[]): void;
|
|
39
|
+
export declare function updateView(tmpl: Template, comp: CompElem, updatePoints?: UpdatePoint[], changedKeys?: string[]): void;
|
|
40
40
|
export declare function updateDirectiveView(node: Node, comp: CompElem, tmpl?: Template, updatePoints?: UpdatePoint[]): void;
|
|
41
41
|
export declare const DomUtil: {
|
|
42
42
|
insertBefore: (node: Node, newNodes: any[]) => void;
|
package/types.d.ts
CHANGED