compelem 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CompElem.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { IComponent } from "./IComponent";
2
2
  import { Template } from "./render/Template";
3
- import { DefaultProps, TmplFn, UpdatePoint } from "./types";
3
+ import { UpdatePoint } from "./render/UpdatePoint";
4
+ import { DefaultProps, TplFn } from "./types";
4
5
  /**
5
6
  * CompElem基类,意为组件元素。提供了基本内置属性及生命周期等必备接口
6
7
  * 每个组件都需要继承自该类
@@ -14,7 +15,6 @@ export declare class CompElem<T = HTMLElement> extends HTMLElement implements IC
14
15
  __data_: Record<string, any>;
15
16
  __updateTree: Array<UpdatePoint>;
16
17
  _eventBindList: Array<[string, Function, Node, Function?]>;
17
- _listerners: Record<string, Function>;
18
18
  __docoEventMap: Map<string, Function>;
19
19
  __updateSubViewDeps: Map<string, Set<UpdatePoint>>;
20
20
  _cssUpdateInNextTick: boolean;
@@ -23,6 +23,8 @@ export declare class CompElem<T = HTMLElement> extends HTMLElement implements IC
23
23
  _watchUpdateSetInNextTick: Set<Function>;
24
24
  _watchUpdateArgsInNextTick: Map<Function, Record<string, any>>;
25
25
  _computedUpdateSetInNextTick: Set<Function>;
26
+ _subComponentEventSn: number;
27
+ _subComponentEventMap: Map<number, Record<string, Function>>;
26
28
  get [Symbol.toStringTag](): string;
27
29
  get cid(): number;
28
30
  get attrs(): Record<string, string>;
@@ -36,7 +38,6 @@ export declare class CompElem<T = HTMLElement> extends HTMLElement implements IC
36
38
  get cssSheets(): CSSStyleSheet[];
37
39
  get globalCssSheet(): CSSStyleSheet;
38
40
  get isMounted(): boolean;
39
- __wrapperComponent: WeakRef<CompElem> | undefined;
40
41
  /**
41
42
  * 组件样式,CSSStyleSheet可动态变更
42
43
  */
@@ -87,7 +88,7 @@ export declare class CompElem<T = HTMLElement> extends HTMLElement implements IC
87
88
  * @param rootStateKey 如果是对象内部属性变更,会返回根属性名
88
89
  * @returns
89
90
  */
90
- _notify(ov: any, chain: string[], subNewValue?: any, subOldValue?: any): void;
91
+ _notify(nv: any | undefined, ov: any, chain: string[], subNewValue?: any, subOldValue?: any): void;
91
92
  updateProps(props: Record<string, any>): void;
92
93
  _wrapperProp: Record<string, string>;
93
94
  _initProps(props: Record<string, any>, attrs?: Record<string, any>): void;
@@ -95,10 +96,9 @@ export declare class CompElem<T = HTMLElement> extends HTMLElement implements IC
95
96
  * 绑定slot标签,render时调用
96
97
  */
97
98
  _bindSlot(slot: HTMLSlotElement, name: string, props: Record<string, any>): void;
98
- _bindSlotHook(name: string, hook: (...args: any[]) => Template): void;
99
99
  _updateSlot(name: string, propName?: string, value?: any): void;
100
- _asyncDirectives: WeakMap<TmplFn, any>;
101
- renderAsync(cbk: TmplFn, ...args: any[]): void;
100
+ _asyncDirectives: WeakMap<TplFn, any>;
101
+ renderAsync(cbk: TplFn, ...args: any[]): void;
102
102
  _regSubViewDeps(props: string[], up: UpdatePoint): void;
103
103
  _getPrivateData(): Record<string, any>;
104
104
  /**
@@ -107,7 +107,7 @@ export declare class CompElem<T = HTMLElement> extends HTMLElement implements IC
107
107
  * @param args 自定义参数
108
108
  */
109
109
  emit(evName: string, arg?: Record<string, any>, event?: Event): void;
110
- _addEvent(evName: string, hook: (e: Event) => void): void;
110
+ _callEmitEvent(evSrc: number, evName: string, arg: Record<string, any>): void;
111
111
  /**
112
112
  * 下一帧执行
113
113
  * @param cbk
package/README.md CHANGED
@@ -76,7 +76,7 @@ export class PageTest extends CompElem {
76
76
  }, 5000);
77
77
  }
78
78
  render(): Template {
79
- return html`<div>
79
+ return h`<div>
80
80
  <i>Welcome to</i>
81
81
  <br>
82
82
  <h2>CompElem</h2>
@@ -106,7 +106,7 @@ export class PageTest extends CompElem {
106
106
  使用`render()`函数定义组件视图模板
107
107
  ```ts
108
108
  render(): Template{
109
- return html`<div>Hello CompElem</div>`
109
+ return h`<div>Hello CompElem</div>`
110
110
  }
111
111
  //对于无需内部样式的组件(如容器类)可返回null(或跳过定义该方法),此时不会创建Shadow DOM
112
112
  render(){
@@ -128,7 +128,7 @@ export class PageTest extends CompElem {
128
128
 
129
129
  ```ts
130
130
  render(): Template{
131
- return html`<svg *view-box:camel="">...</svg>`// <svg viewBox="">
131
+ return h`<svg *view-box:camel="">...</svg>`// <svg viewBox="">
132
132
  }
133
133
  ```
134
134
 
@@ -258,7 +258,7 @@ export class PageTest extends CompElem {
258
258
  ```ts
259
259
  divRef = createRef<HTMLDivElement>();
260
260
  //视图片段
261
- return html` <l-icon></l-icon>
261
+ return h` <l-icon></l-icon>
262
262
  <div ref="${divRef}"></div>`;
263
263
  ```
264
264
  - ### 内置属性及函数
@@ -353,9 +353,9 @@ CompElem 组件既可以在 CompElem 环境内调用,也可以直接在原生
353
353
 
354
354
  ```ts
355
355
  //仅可用于CompElem组件中
356
- return html` <l-tooltip>
356
+ return h` <l-tooltip>
357
357
  ${slot(
358
- (args: Record<string, any>) => html`
358
+ (args: Record<string, any>) => h`
359
359
  <div>我是动态内容-${args.data.id}</div>
360
360
  `,
361
361
  "content"
@@ -398,8 +398,6 @@ return html` <l-tooltip>
398
398
  |ATTR|特性|可用于任何特性值之中,仅能插入一个|`attr="${xxx}"`|
399
399
  |PROP|属性|可用于任何属性值之中,必须是组件标签,仅能插入一个|`.value="${xxx}"`|
400
400
  |TEXT|文本|标签体内,可插入多个|`<div>${xx1}${xx2}${...}</div>`|
401
- |CLASS|样式类|用于 class 属性值中,仅能插入一个|`class="a ${b}"`|
402
- |STYLE|样式规则|用于 style 属性值中,仅能插入一个|`style="a:1;${b}"`|
403
401
  |SLOT|插槽|与 TEXT 类似,但标签必须是组件||
404
402
  |TAG|标签|直接插入在节点标签上|`<div a="b" ${show(..)}>`|
405
403
 
@@ -410,15 +408,14 @@ return html` <l-tooltip>
410
408
  | bind | TAG | 绑定属性/特性到标签上,根据标签类型及组件 prop 定义自动判断 | `<div a="b" ${bind(obj)}>` |
411
409
  | show | TAG | 隐藏/显示标签(基于 display) | `<div a="b" ${show(visible)}>` |
412
410
  | model | TAG | 双向绑定 | `<div a="b" ${model(xx,modelPath?)}>`
413
- | classes | CLASS | 绑定样式类属性,支持对象/数组/字符串。可以和静态字符混用 | `<div class="otherClass ${classes(obj)}>"` |
414
- | styles | STYLE | 绑定样式规则属性,支持对象/字符串。可以和静态字符混用 | `<div style="a:b;${styles(obj)}>"` |
415
- | forEach | TEXT/SLOT | 输出循环结构 | `...>${forEach(ary,(item)=>html`...`)}<...` |
416
- | ifTrue | TEXT/SLOT | 当条件为 true 时输出模板内容 | `...>${ifTrue(condition,()=>html`...`)}<...` |
417
- | ifElse | TEXT/SLOT | 当条件为 true/false 时输出对应模板内容 | ` ...>${ifElse(condition,()=>html``,()=>html``)}<... ` |
418
- | when | TEXT/SLOT | 多条件分支,支持 switch/ifelse 两种模式 | ` ...>${when(condition,{c1:()=>html``,c2:...})}<... ` |
419
- | slot | SLOT | 动态插槽 | ` ...>${slot((args) => html``)}<... ` |
420
- | htmlD | TAG | 向指定元素插入HTML内容 | `<div a="b" ${htmlD('<b>1</b>')}>` |
421
- | htmlC | TEXT/SLOT | 向指定文本位置插入指定HTML内容 | `...>${htmlC('<b>1</b>')}><...` |
411
+ | classes | TAG | 绑定样式类属性,支持对象/数组/字符串。可以和静态字符混用 | `<div class="otherClass" ${classes(obj)}>` |
412
+ | styles | TAG | 绑定样式规则属性,支持对象/字符串。可以和静态字符混用 | `<div style="a:b" ${styles(obj)}>` |
413
+ | forEach | TEXT/SLOT | 输出循环结构 | `...>${forEach(ary, item=>item.id, (item)=>h`...`)}<...` |
414
+ | ifTrue | TEXT/SLOT | 当条件为 true 时输出模板内容 | `...>${ifTrue(condition,()=>h`...`)}<...` |
415
+ | ifElse | TEXT/SLOT | 当条件为 true/false 时输出对应模板内容 | ` ...>${ifElse(condition,()=>h``,()=>h``)}<... ` |
416
+ | when | TEXT/SLOT | 多条件分支,支持 switch/ifelse 两种模式 | ` ...>${when(condition,{c1:()=>h``,c2:...})}<... ` |
417
+ | slot | SLOT | 动态插槽 | ` ...>${slot((args) => h``)}<... ` |
418
+ | html | TAG/TEXT/SLOT | 向指定元素/文本位置插入HTML内容 | `<div a="b" ${html('<b>1</b>')}> ...>${html('<b>1</b>')}<...` |
422
419
 
423
420
  ## 装饰器 Decorator
424
421
 
package/constants.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CompElem } from "./CompElem";
2
2
  import { DecoratorWrapper } from "./decorator";
3
- import { Getter, PropOption, StateOption } from "./types";
3
+ import { Getter, PropOption, StateOption, TplFn } from "./types";
4
4
  export declare const SLOT_NAME_DEFAULT = "default";
5
5
  /**
6
6
  * 共享内容
@@ -35,7 +35,12 @@ export declare const PropShallowKeySetMap: WeakMap<Function, Set<string>>;
35
35
  export declare const HasChangedPropOrStateMap: WeakMap<Function, Map<string, Function>>;
36
36
  export declare const ComputedUpdateDepsMap: WeakMap<Function, Map<string, Set<Function>>>;
37
37
  export declare const CssUpdateDepsMap: WeakMap<Function, Set<string>>;
38
+ export declare const DirectiveScopeMap: Map<Function, string[]>;
38
39
  export declare const ComponentDynamicCssUpdaterMap: WeakMap<CompElem<any>, Map<Function, CSSStyleSheet>>;
40
+ export declare const ComponentUninitializedSubComponentPropMap: WeakMap<CompElem<any>, Map<Node, Record<string, any>>>;
41
+ export declare const ComponentUninitializedSlotFunctionMap: WeakMap<Node, Record<string, TplFn>>;
42
+ export declare const ComponentUninitializedWrapperComponentMap: WeakMap<Node, CompElem<any>>;
39
43
  export declare const PATH_SEPARATOR = "-";
40
44
  export declare const PROP_NAME_SLOTS = "slots";
41
45
  export declare const DATA_KEY = "__data_";
46
+ export declare const PLACEHOLDER = "\u27EC\u010A\u27ED";
@@ -1,11 +1,11 @@
1
1
  import { CompElem } from "../CompElem";
2
- import { DirectiveExecutor, DirectiveInstance, EnterPointType, UpdatedSource, UpdatePoint } from "../types";
3
- export declare const DI_COMMENT_START_NODE_MAP: WeakMap<Node, Node>;
4
- export declare const TextOrSlotDirectiveExecutorMap: Map<string, DirectiveExecutor>;
5
- export declare function updateDirective(pointNode: Node, newArgs: any[], oldArgs: any[], executor: DirectiveExecutor, renderComponent: CompElem, slotComponent: CompElem, varChain: any[], up: UpdatePoint, updatedMap?: Record<string, UpdatedSource>): void;
2
+ import { UpdatePoint } from "../render/UpdatePoint";
3
+ import { DirectiveExecutor, DirectiveInstance, EnterPointType, UpdatedSource } from "../types";
4
+ export declare function updateDirective(diFn: Function, pointNode: Node, newArgs: any[], oldArgs: any[], executor: DirectiveExecutor, renderComponent: CompElem, slotComponent: CompElem, varChain: any[], up: UpdatePoint, updatedMap?: Record<string, UpdatedSource>): true | undefined;
6
5
  /**
7
6
  * 返回指令调用函数
8
7
  * @param di
9
8
  * @returns
10
9
  */
11
10
  export declare function directive<T extends Array<any>>(fn: (...args: T) => DirectiveExecutor, scopes: EnterPointType[]): (...args: T) => DirectiveInstance;
11
+ export declare function directiveScopeChecker(diFn: Function, scopeType: string, tagName: string): void;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 根据变量内容自动插入class,仅能用于class属性
2
+ * 根据变量内容自动插入class,与静态class自动合并
3
3
  * @param styles 对象/数组/字符串
4
4
  */
5
5
  export declare const classes: (clazz: string | Record<string, string | boolean> | string[]) => import("../types").DirectiveInstance;
@@ -1,7 +1,7 @@
1
- import { TmplFn } from "../types";
1
+ import { KeyFn, TplFn } from "../types";
2
2
  /**
3
- * 循环列表并自动优化列表更新
4
- * foreach循环的只能是节点,且必须有key属性。非节点元素会被过滤掉
5
- * 使用序号作为key时可能会导致异常问题
3
+ * 循环节点指令
4
+ * 1. 支持多根输出
5
+ * 2.
6
6
  */
7
- export declare const forEach: (value: any[] | Record<string, any>, cbk: TmplFn) => import("../types").DirectiveInstance;
7
+ export declare const forEach: (value: any[] | Record<string, any>, keyFn: KeyFn, tmpl: TplFn) => import("../types").DirectiveInstance;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 向元素/文本中插入指定HTML内容
3
+ * 注意,应用该指令的元素内部不应再出现表达式,否则会导致异常显示
4
+ * @param htmlStr html内容
5
+ */
6
+ export declare const html: (htmlStr?: string | undefined) => import("../types").DirectiveInstance;
@@ -1,7 +1,7 @@
1
- import { TmplFn } from "../types";
1
+ import { TplFn } from "../types";
2
2
  /**
3
3
  * 条件为真时返回参数1,否则返回参数2,仅能用于文本节点
4
4
  * @param condition 条件
5
5
  * @param tmpl 模板
6
6
  */
7
- export declare const ifElse: (condition: boolean, ifTmpl: TmplFn, elseTmpl: TmplFn) => import("../types").DirectiveInstance;
7
+ export declare const ifElse: (condition: boolean, ifTmpl: TplFn, elseTmpl: TplFn) => import("../types").DirectiveInstance;
@@ -1,7 +1,7 @@
1
- import { TmplFn } from "../types";
1
+ import { TplFn } from "../types";
2
2
  /**
3
3
  * 条件为真时返回内容,仅能用于文本节点
4
4
  * @param condition 条件
5
5
  * @param tmpl 模板
6
6
  */
7
- export declare const ifTrue: (condition: boolean, tmplFn: TmplFn) => import("../types").DirectiveInstance;
7
+ export declare const ifTrue: (condition: boolean, tplFn: TplFn) => import("../types").DirectiveInstance;
@@ -1,7 +1,7 @@
1
- import { TmplFn } from "../types";
1
+ import { TplFn } from "../types";
2
2
  /**
3
3
  * 创建一个动态插槽内容
4
4
  * @param cbk 回调函数,函数接收插槽上定义得变量
5
5
  * @param slotName 插槽名词,默认default
6
6
  */
7
- export declare const slot: (cbk: TmplFn, slotName?: string | undefined) => import("../types").DirectiveInstance;
7
+ export declare const slot: (cbk: TplFn, slotName?: string | undefined) => import("../types").DirectiveInstance;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 根据变量内容设置元素样式,仅能用于style属性
2
+ * 根据变量内容设置元素样式,与静态样式自动合并
3
3
  * @param styles 对象/字符串
4
4
  */
5
5
  export declare const styles: (...args: (string | Record<string, string>)[]) => import("../types").DirectiveInstance;
@@ -1,22 +1,22 @@
1
- import { TmplFn } from "../types";
1
+ import { TplFn } from "../types";
2
2
  /**
3
3
  * 分支指令,具有switch / else if 两种模式
4
4
  * @example
5
5
  * switch 模式
6
6
  * ${when(var, {
7
- closed: () => html``, //case 1
8
- connecting: () => html``, //case 2
9
- default: () => html``// default是switch模式下的关键字key
7
+ closed: () => h``, //case 1
8
+ connecting: () => h``, //case 2
9
+ default: () => h``// default是switch模式下的关键字key
10
10
  })}
11
11
 
12
12
  else if 模式
13
13
  * ${when(this.editingTitle, [
14
- [(v: any) => v.substring(2) > 0, () => html`<div style="${PageHome.tunnelLight}"></div>`],
15
- [(v: any) => v == 'closed', () => html`<div style="${PageHome.tunnelLight}"></div>`],
16
- [() => true, () => html`默认`]
14
+ [(v: any) => v.substring(2) > 0, () => h`<div style="${PageHome.tunnelLight}"></div>`],
15
+ [(v: any) => v == 'closed', () => h`<div style="${PageHome.tunnelLight}"></div>`],
16
+ [() => true, () => h`默认`]
17
17
  ])}
18
18
  *
19
19
  * @param condition 条件
20
20
  * @param tmpl 模板
21
21
  */
22
- export declare const when: (value: string | number, cases: [(v: any) => boolean, TmplFn][] | Record<string | number, TmplFn>) => import("../types").DirectiveInstance;
22
+ export declare const when: (value: string | number, cases: [(v: any) => boolean, TplFn][] | Record<string | number, TplFn>) => import("../types").DirectiveInstance;
package/events/event.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import { CompElem } from "../CompElem";
2
2
  export type EvHadler = (ev: Event) => any;
3
- export declare function addEvent(fullName: string, cbk: EvHadler, node: Element, component: CompElem<any>): void | ((remove?: boolean) => void);
3
+ export declare function addEvent(fullName: string, cbk: EvHadler, node: Element, component: CompElem<any>): ((remove?: boolean) => void) | undefined;
4
+ export declare function addEmitEvent(node: Element, component: CompElem<any>, evName: string, c: EvHadler): void;
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { buildHTML, createRef, html } from "./render/render";
1
+ import { createRef, h } from "./render/render";
2
2
  import { Template } from './render/Template';
3
3
  export * from "./decorator/Decorator";
4
4
  export * from "./decorator/index";
@@ -16,8 +16,7 @@ export * from "./directive/index";
16
16
  export * from "./directives/Bind";
17
17
  export * from "./directives/Classes";
18
18
  export * from "./directives/ForEach";
19
- export * from "./directives/HtmlC";
20
- export * from "./directives/HtmlD";
19
+ export * from "./directives/Html";
21
20
  export * from "./directives/IfElse";
22
21
  export * from "./directives/IfTrue";
23
22
  export * from "./directives/Model";
@@ -25,7 +24,7 @@ export * from "./directives/Show";
25
24
  export * from "./directives/Slot";
26
25
  export * from "./directives/Styles";
27
26
  export * from "./directives/When";
28
- export { buildHTML, createRef, html, Template };
27
+ export { createRef, h, Template };
29
28
  export declare function regComponents(): void;
30
29
  export * from './CompElem';
31
30
  export * from './types';
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * compelem v0.23.0.1782402012
2
+ * compelem v0.25.0.1785068357
3
3
  * A modern, reactive, fast, lightweight and flexible lib for building web components
4
4
  * @holyhigh2
5
5
  * git+https://github.com/holyhigh2/compelem.git
6
6
  */
7
- import t,{toPath as e,some as s,isString as r,isUndefined as n,isBlank as o,closest as i,isObject as a,isFunction as l,startsWith as c,get as u,concat as h,toArray as d,isSymbol as p,isArray as f,defaults as g,merge as _,clone as m,each as v,kebabCase as y,has as E,set as w,includes as b,find as S,debounce as T,throttle as N,once as C,remove as k,map as M,size as A,flatMap as P,test as x,assign as D,first as R,walkTree as L,isEmpty as O,filter as I,isNil as V,camelCase as W,isNull as H,isDefined as U,trim as B,isBoolean as $,parseJSON as j,cloneDeep as F,keys as z,groupBy as G,last as X,reject as K,toString as q,reduce as Q,compact as Y,initial as Z,except as J,join as tt,split as et,isEqual as st,replace as rt,replaceAll as nt,snakeCase as ot,bind as it,isMatch as at,endsWith as lt,findIndex as ct,call as ut}from"myfx";const ht="default",dt=/\s+\.?key\s*=/;var pt,ft;!function(t){t[t.RENDER=1]="RENDER",t[t.COMPUTED=2]="COMPUTED",t[t.DIRECTIVE=3]="DIRECTIVE"}(pt||(pt={})),function(t){t.Prod="prod",t.Dev="dev"}(ft||(ft={}));const gt=new Map,_t={},mt={},vt=new WeakMap,yt=new WeakMap,Et=new WeakMap,wt=new WeakMap,bt=new Map,St=new Map,Tt=new WeakMap,Nt=new WeakMap,Ct=new WeakMap,kt=new WeakMap,Mt=new WeakMap,At=new WeakMap,Pt=new WeakMap,xt=new WeakMap,Dt=new WeakMap,Rt=new WeakMap,Lt=new WeakMap,Ot=new WeakMap,It="__data_";function Vt(t){console.error("[CompElem]",t)}function Wt(t,e){console.error(`[CompElem <${t}>]`,e)}function Ht(...t){console.warn("[CompElem]",...t)}function Ut(t,e){console.warn(`[CompElem <${t}>]`,e)}function Bt(t){return e(t).join("-")}function $t(t){return Object.getPrototypeOf(t)}function jt(t){return t===Boolean||s(t,(t=>t===Boolean))}function Ft(t){let e=t;return r(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||o(e))&&(e=!0),e}const zt={getNodes(t,e){let s=t.nextSibling;if(!e)return[s];let r=[];for(;s&&s!==e;)r.push(s),s=s?.nextSibling;return r},insertBefore:function(t,e){if(!t.parentNode)return;let s=document.createDocumentFragment();s.append(...e),t.parentNode.insertBefore(s,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let s=t.nextSibling;for(;s&&s!==e;)s?.parentNode?.removeChild(s),s=t.nextSibling},clear(t,e){if(!t)return;let s,r=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT);for(r=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_ELEMENT);s=r.nextNode();)t!==s&&(s instanceof Comment||s instanceof Ve&&s.destroy())}};function Gt(t,e){let s=i(t,(t=>t.host&&t.host instanceof Ve),"parentNode");if(!s||s.host!==e)return s?s.host:void 0}function Xt(t,e){let s=e,r=Reflect.get(s[It],t);if(Zt.__collecting&&Zt.__varPathList.push(t),ee.has(r)){let t=re.get(r);return t||(t=new Set,re.set(r,t)),t.add(s.__thisRef),ee.get(r)}if(a(r)&&!l(r)&&!(r instanceof Node)&&!Object.isFrozen(r)){let e=Pt.get(s.constructor),n=e?.has(t);n||(e=xt.get(s.constructor),n=e?.has(t)),r=n||"slots"===t?r:ne(r,s,t)}return r}function Kt(t,e,s){let r=s;if(!r.__inited)return void Reflect.set(r[It],t,e);let n=r[It][t],o=Dt.get(r.constructor),i=o?.get(t);if(i){if(!i.call(r,e,n,[t],e,n))return!0}else{if(Object.is(n,e))return!0;if(a(e)&&ee.get(n)===e)return!0}qt(r,e,n,t),Qt(r,t),Yt(r,t),Reflect.set(r[It],t,e),r._notify(n,[t])}function qt(t,e,s,r,n,o){let i=$t(t.constructor),a=Ct.get(t.constructor)??Ct.get(i),l=Nt.get(t.constructor)??Nt.get(i),p=Mt.get(t.constructor)??Mt.get(i),f=kt.get(t.constructor)??kt.get(i),g=Tt.get(t.constructor)??Tt.get(i);a?.forEach((i=>{(r===i||c(i,r+".")&&!Object.is(u(t._getPrivateData(),i),u(e,i))||c(r,i+".")&&l?.includes(i)&&!Object.is(u(t._getPrivateData(),i),u(e,i)))&&h(d(f[i]),d(p[i])).forEach((a=>{a&&!0!==g.get(i)&&(t._watchUpdateArgsInNextTick?.set(a,{newValue:e,oldValue:s,chain:r.split("."),rootObjNew:n,rootObjOld:o,fullMatch:i===r}),t._watchUpdateSetInNextTick?.add(a),g.has(i)&&g.set(i,!0))}))}))}function Qt(t,e){let s=Rt.get(t.constructor);s?.has(e)&&s.get(e)?.forEach((e=>{t._computedUpdateSetInNextTick.add(e)}))}function Yt(t,e){let s=Lt.get(t.constructor);if(!s)return;let r=e.split("."),n="";r.forEach((e=>{n=n?n+"."+e:e,s.has(n)&&(t._cssUpdateInNextTick=!0)}))}const Zt={popDirectiveQ(){return this.__varPathList.reduceRight(((t,e)=>(t.includes(e)||t.unshift(e),t)),[])},start(){this.__collecting=!0,this.__varPathList=[]},end(t,e){t&&e&&t._regSubViewDeps(Zt.popVarPathList(),e),this.__collecting=!1},popVarPathList(){let t=Array.from(new Set(this.__varPathList));return this.__varPathList=[],t},__varPathList:[],__collecting:!1},Jt=new WeakMap,te=new WeakMap,ee=new WeakMap,se=new WeakMap,re=new WeakMap;function ne(t,e,r){if(ee.has(t))return ee.get(t);if(se.has(t)){if(r){let n=Jt.get(e);n||(n=new WeakMap,Jt.set(e,n)),n.set(t,r);let o=re.get(t);o||(o=new Set,re.set(t,o)),s(o.values(),(t=>t.deref()===e))||o.add(new WeakRef(e))}return t}const n=new Proxy(t,{get(t,s,r){if(!s)return;const n=Reflect.get(t,s,r);if(p(s))return n;if(l(n))return n;if("length"===s&&f(t))return n;if("__"===s.substring(0,2))return n;if(Zt.__collecting){let t=te.has(r)?h(te.get(r)):[];t.push(s);let e=t.join(".");Zt.__varPathList.push(e)}if(ee.has(n))return ee.get(n);let o=n;if(a(n)&&!l(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=te.has(r)?h(te.get(r)):[];o=ne(n,e),t.push(s),te.set(o,t),ee.set(n,o)}return o},set(t,s,r,n){if(!s)return!1;let o=t[s],i=te.get(n)??[],a=h(i,[s]),l=Dt.get(e.constructor),c=l?.get(a[0]),u=a.length>1,d=r,p=o;if(u&&(p=d=e._getPrivateData()[a[0]]),c){if(!c.call(e,d,p,a,r,o))return!0}else if(Object.is(o,r))return!0;let f=r,g=Reflect.set(t,s,f),_=re.get(n);return ie(e,f,o,a),_?.forEach((t=>{let e=t.deref();if(!e)return;let s=e._wrapperProp[a[0]],r=a.join(".");r=r.replace(a[0],s),qt(e,f,o,r),Qt(e,r),Yt(e,r),oe(e,p,r.split("."))})),g}});if(te.has(n)||te.set(n,r?[r]:[]),ee.set(t,n),r&&(se.set(n,e),!Jt.has(e))){let t=new WeakMap;t.set(n,r),Jt.set(e,t)}return n}function oe(t,e,s,r,n){t._notify(e,s)}function ie(t,e,s,r){let n=e,o=s;r.length>1&&(o=n=t._getPrivateData()[r[0]]);let i=r.join(".");qt(t,e,s,i,n,o),Qt(t,i),Yt(t,i),oe(t,o,r)}const ae=new Map;class le{static nextSet=new Set;static nextPending=!1;static next;static flush(){le.nextPending=!1;let t=Array.from(le.nextSet);le.nextSet.clear(),ae.clear(),t.forEach((t=>t())),t=null}static pushNext(t){le.nextSet.add(t),le.nextPending||(le.nextPending=!0,le.next())}}function ce(t){if(1===arguments.length)return(e,s,r)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,ue(e,s,t)};let e=arguments[0],s=arguments[1],r=arguments[2];t={type:void 0,required:!1,attribute:!0},r&&"function"==typeof r.type&&(t=g(r,t),r=void 0),t.shallow=t.shallow||!1,ue(e,s,t)}function ue(t,e,s,r){let n;if(!Et.has(t.constructor)){const e={};let s=t.constructor;for(;(s=$t(s))!==Ve;)_(e,m(Et.get(s)??{}));n=new Set,v(e,((t,e)=>{if(t.attribute){let t=y(e);n?.add(t)}})),St.set(t.constructor,n),Et.set(t.constructor,e)}if(s.attribute){n||(n=St.get(t.constructor));let s=y(e);n?.add(s)}if(s.model){let s=wt.get(t.constructor);s||(s=[],wt.set(t.constructor,s)),s.includes(e)||s.push(e)}if(E(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),n&&(t.constructor.observedAttributes=d(n)),w(Et.get(t.constructor),e,s),s.hasChanged){let r=Dt.get(t.constructor);r||(r=new Map,Dt.set(t.constructor,r)),r.set(e,s.hasChanged)}if(s.shallow){let s=xt.get(t.constructor);s||(s=new Set,xt.set(t.constructor,s)),s.add(e)}Reflect.defineProperty(t,e,{get(){return Xt(e,this)},set(s){wt.get(t.constructor)?.includes(e)&&function(t,e,s){s.emit("update:"+t,{value:e})}(e,s,this)}})}(()=>{const t=Promise.resolve(),e=le.flush;le.next=()=>{t.then(e)}})();const he=new Set;function de(t){return St.get(t)??he}const pe=["resize","outside","mutate"],fe=new WeakMap,ge=[],_e=[],me=[],ve=new WeakSet,ye=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,s=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;if(!ve.has(e.target)){ve.add(e.target);continue}let r=fe.get(e.target);r&&r({target:e.target,contentBoxSize:t,borderBoxSize:s,type:"resize"})}}));var Ee;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(Ee||(Ee={}));const we=new WeakMap,be=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const s=t[e];let r=we.get(s.target);if(!r)return;let n={target:s.target},o=null;switch(s.type){case"subtree":n.type=Ee.Tree,o=r[Ee.Tree];break;case"childList":n.type=Ee.Child,n.addedNodes=s.addedNodes,n.removedNodes=s.removedNodes,o=r[Ee.Child];break;case"attributes":n.type=Ee.Attr,n.attributeName=s.attributeName,n.oldValue=s.oldValue,o=r[Ee.Attr];break;case"characterData":n.type=Ee.Char,n.oldValue=s.oldValue,o=r[Ee.Char]}o&&(n.type="mutate",o(n))}}));function Se(e,s,r,n,o){if("resize"===e)return function(t,e){if(fe.has(t))return;fe.set(t,e),ye.observe(t);let s=ye;return(e=!1)=>{s.unobserve(t),fe.delete(t),e&&(s=t=null)}}(s,r);if("outside"===e)switch(n[0]){case"mousedown":return function(e,s){return ge.push([e,s]),(r=!1)=>{t.remove(ge,(t=>t[0]===e&&t[1]===s))}}(s,r);case"dblclick":return function(e,s){return me.push([e,s]),(r=!1)=>{t.remove(me,(t=>t[0]===e&&t[1]===s))}}(s,r);default:return function(e,s){return _e.push([e,s]),(r=!1)=>{t.remove(_e,(t=>t[0]===e&&t[1]===s))}}(s,r)}else if("mutate"===e)return function(t,e,s){let r=b(s,"child"),n=b(s,"attr"),o=b(s,"char"),i=b(s,"tree"),a=we.get(t);if(!a)return a={},we.set(t,a),r&&(a[Ee.Child]=e),n&&(a[Ee.Attr]=e),o&&(a[Ee.Char]=e),i&&(a[Ee.Tree]=e),be.observe(t,{childList:r,attributes:n,characterData:o,subtree:i}),(e=!1)=>{we.delete(t),e&&(t=null)}}(s,r,n)}document.addEventListener("mousedown",(t=>{let e=u(t.composedPath(),0,t.target);ge.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"mousedown",event:t})}))}),!1),document.addEventListener("click",(t=>{let e=u(t.composedPath(),0,t.target);_e.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"click",event:t})}))}),!1),document.addEventListener("dblclick",(t=>{let e=u(t.composedPath(),0,t.target);me.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"dblclick",event:t})}))}),!1);const Te=/,|^(debounce:.+)|(debounce$)/,Ne=/,|^(throttle:.+)|(throttle$)/,Ce="native",ke={esc:"escape"},Me=()=>{};function Ae(t,e,s,r){let n,o=t.split("."),i=o.shift(),a=o.includes("once"),l=e??Me;if(n=S(o,(t=>Te.test(t)))){let t=n.split(":");l=T(l,parseInt(t[1])||100)}if(n=S(o,(t=>Ne.test(t)))){let t=n.split(":");l=N(l,parseInt(t[1])||100)}if(a&&(l=C(l)),s instanceof Ve&&(s!==r||o.includes(Ce)||o.push(Ce),!o.includes(Ce)))return s._addEvent(i,e);if(function(t){return pe.includes(t)}(i))return Se(i,s,l,o);let c=t=>{if(o.includes("prevent")&&t.preventDefault(),o.includes("stop")&&t.stopPropagation(),!o.includes("self")||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes("left")&&0!=t.button)return;if(o.includes("right")&&2!=t.button)return;if(o.includes("middle")&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(k(o,(t=>"ctrl"==t))[0]&&!t.ctrlKey)return;if(k(o,(t=>"alt"==t))[0]&&!t.altKey)return;if(k(o,(t=>"shift"==t))[0]&&!t.shiftKey)return;if(k(o,(t=>"meta"==t))[0]&&!t.metaKey)return;let e=M(o,(t=>ke[t]||t));if(A(e)>0&&!e.includes(t.key.toLowerCase()))return}l(t)}},u={capture:o.includes("capture")||!1,passive:o.includes("passive")||!1};return s.addEventListener(i,c,u),(t=!1)=>{s.removeEventListener(i,c,u),t&&(s=null)}}const Pe={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},xe=new WeakMap;let De=[],Re=0;const Le=new WeakMap,Oe={},Ie="slots";class Ve extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){De=P(t.css,(t=>{if(r(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,v(t,((t,e)=>{x(e[0],/[A-Z]/)}))}#t;#e={};__data_={};#s={};#r;__updateTree;_eventBindList;_listerners={};__docoEventMap;__updateSubViewDeps;_cssUpdateInNextTick=!1;_cssVarOldValueMap;__cssSheets;_watchUpdateSetInNextTick;_watchUpdateArgsInNextTick;_computedUpdateSetInNextTick;get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get attrs(){return this.#n}get props(){return this.#o}get renderRoot(){return this.#i?.deref()}get renderRoots(){return this.#a.flatMap((t=>t.deref()??[]))}get parentComponent(){return this.#l?.deref()}get wrapperComponent(){return this.__wrapperComponent?.deref()}get slots(){return Oe}get slotHooks(){return this.#c}get cssSheets(){return xe.get(this.constructor)}get globalCssSheet(){return Ve.__l_globalRule.sheet}get isMounted(){return this.#u}#n;#o;#i;#a;#l;__wrapperComponent;#h={};#c={};#d={};#u=!1;#p=!1;#f;static get css(){return[]}static get globalCss(){}static get hostCss(){}get cssVars(){return{}}__inited=!1;#g=!1;#_;__thisRef;constructor(...t){super(),this.#t=Re++,this.__updateTree=[],this.__thisRef=new WeakRef(this),this.#_=this.#m.bind(this),1===A(t)&&(this.#o={},D(this.#o,R(t))),Reflect.getOwnPropertyDescriptor(this.constructor.prototype,"slots")||Reflect.defineProperty(this.constructor.prototype,"slots",{get(){return Xt("slots",this)},set(t){Kt("slots",t,this)}});let e=bt.get(this.constructor)??bt.get($t(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#v=this.#y.bind(this)}insertStyleSheet(t){if(!this.#r)return null;let e;if(r(t)){e=new CSSStyleSheet;try{e.replaceSync(t)}catch(t){}}else{if(this.#r.adoptedStyleSheets.includes(t))return t;e=t}return this.#r.adoptedStyleSheets=[...this.#r.adoptedStyleSheets,e],e}get rootComponent(){let t=this;for(;t.parentComponent;)t=t.parentComponent;return t}#v;connectedCallback(){let t=i(this.parentNode,(t=>t instanceof Ve||t.host instanceof Ve),"parentNode");this.#l=t?t instanceof Ve?new WeakRef(t):new WeakRef(t.host):void 0,Ve.__l_globalRule.parentNode||document.head.appendChild(Ve.__l_globalRule);let e=u(this.constructor,"hostCss"),s=u(this.constructor,"hostCssSheet");if(e){s||(r(e)?(s=new CSSStyleSheet,s.replaceSync(e)):s=e,w(this.constructor,"hostCssSheet",s));let t=this.__wrapperComponent?.deref()?.shadowRoot??this.#l?.deref()?.shadowRoot??this.ownerDocument;this.__wrapperComponent&&!this.__wrapperComponent.deref()?.shadowRoot?.contains(this)&&(t=i(this,(t=>t instanceof HTMLDocument||t instanceof ShadowRoot),"parentNode")),t&&s&&!t.adoptedStyleSheets.includes(s)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,s])}this.__init(),this.__bindEvents()}disconnectedCallback(){this.__unbindEvents()}__bindEvents(){let t=this._eventBindList;v(t,(t=>{let[e,s,r,n]=t;if(n)return;if(!r)return;let o=Ae(e,s?s.bind(this):s,r,this);t[3]=o}));let e=gt.get(this.constructor);A(e)>0&&(this.__docoEventMap||(this.__docoEventMap=new Map),v(e,(({name:t,targetFn:e,fnName:s})=>{if(this.__docoEventMap.has(t+"@"+s))return;let r=e?e(this):this,n=u(this,s),o=Ae(t,n?n.bind(this):n,r,this);this.__docoEventMap.set(t+"@"+s,o)})))}__unbindEvents(){v(this._eventBindList,(t=>{let[,,,e]=t;e&&e(),t[3]=null}));let t=[];v(this.__docoEventMap,((e,s)=>{e&&e(),t.push(s)})),t.forEach((t=>this.__docoEventMap.delete(t)))}beforeDestroyed(){}destroyed(){}get isDestroyed(){return this.#E}#E=!1;destroy(){if(this.#E)return;this.#E=!0;let t=bt.get(this.constructor)??bt.get($t(this.constructor));if(t&&t.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.destroy(this)})),this.beforeDestroyed(),this.__unbindEvents(),this._listerners=null,this.__docoEventMap?.clear(),this.__docoEventMap=this._eventBindList=null,Ot.get(this)?.clear(),Ot.delete(this),this._watchUpdateArgsInNextTick?.clear(),this._watchUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick=null,this.__cssSheets=null,this.__updateSubViewDeps?.clear(),this.#l){let t=this.#l.deref();t&&L(t.__updateTree,(e=>{e.__destroyed||e.node?.deref()===this&&(e.destroy(t),k(e.parent?e.parent.children:t.__updateTree,(t=>t===e)))}))}v(this.__updateTree,(t=>t?.destroy(this))),v(this.#h,(t=>{Le.delete(t),t.remove()})),v(this.#d,(t=>{v(t,(t=>t.remove()))})),v(this.__data_.slots,((t,e)=>{v(t,(t=>t.remove()))})),this.#w.clear(),this.#d=this.#h=this.#w=this.#e=this.__data_.slots=null,this.remove(),this._wrapperProp=this.#b=this.#i=this.#a=this.#r=this.#s=this.#n=this.#o=this.#i=this.#a=this.#c=this.#v=this.__data_=this.__updateTree=this.#l=this._asyncDirectives=this.__wrapperComponent=null,this.destroyed()}__init(){if(this.__inited)return;if(this.#g)return;this.#g=!0;let t=u(this.constructor,"globalCss");O(t)||!r(t)||u(this.constructor,"_globalRuleInserted")||(Ve.__l_globalRule.textContent+=t,w(this.constructor,"_globalRuleInserted",!0));let e=xe.get(this.constructor),s=e??[];e||(v(u(this.constructor,"css"),(t=>{if(r(t)){let e=new CSSStyleSheet;e.replaceSync(t),s.push(e)}else l(t)||s.push(t)})),xe.set(this.constructor,s));const n=this.#S();this.propsReady(n);for(const t in n){const e=n[t];this.__data_[t]=e}this.#T(),this.__data_.slots={},Reflect.defineProperty(this.__data_,"__isData",{enumerable:!1,value:!0});let i=$t(this.constructor);if(Ct.get(this.constructor)??Ct.get(i)){this._watchUpdateSetInNextTick=new Set,this._watchUpdateArgsInNextTick=new Map;let t=Tt.get(this.constructor)??Tt.get(i),e=At.get(this.constructor)??At.get(i);v(e,((e,s)=>{let r=u(this,s);e.forEach((t=>{t.call(this,r,void 0,s)})),t.has(s)&&t.set(s,!0)}))}let a=D({},vt.get(this.constructor),vt.get(i));if(a){this._computedUpdateSetInNextTick=new Set;let t=Rt.get(this.constructor);t?v(a,((t,e)=>{this[It][e]=t.call(this)})):(t=new Map,Rt.set(this.constructor,t),v(a,((e,s)=>{w(e,"key",s),Zt.start(),this[It][s]=e.call(this),Zt.end(),Zt.popVarPathList().forEach((s=>{let r=t.get(s);r||(r=new Set,t.set(s,r)),r.add(e)}))})))}Zt.start();let c=this.render();Zt.end();let h,d=Zt.popVarPathList();this.constructor.prototype._viewDeps||(this.constructor.prototype._viewDeps=d),null===c?(this.#a=[],this.#i=void 0):(this.#r=this.attachShadow({mode:"open"}),this.#r.adoptedStyleSheets=[...De,...xe.get(this.constructor)??[]],h=function(t,e){let s,r=[];if(is.has(e.constructor)){s=ps(r,is.get(e.constructor),cs(e,t),e)}else{let[n,o]=as(e,t);is.set(e.constructor,n),s=ps(r,n,o,e)}return e.__updateTree=r,s}(c,this),h&&(this.#a=I(h,(t=>t.nodeType===Node.ELEMENT_NODE)).map((t=>new WeakRef(t))),this.#i=this.#a[0])),this.__inited=!0,this.#N(),v(this.#c,((t,e)=>{this.#C(e)}));const p=this;let f=bt.get(this.constructor)??bt.get($t(this.constructor));f&&f.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(p.__data_[t]=e,p.__data_[t])))})),this.beforeMount(),setTimeout((()=>{if(!this.isDestroyed){if(this.#u=!0,this.#r){Zt.start();let t=this.cssVars;if(Zt.end(),!O(t)){this._cssVarOldValueMap={};let e=Lt.get(this.constructor);e||(e=new Set(Zt.popVarPathList()),Lt.set(this.constructor,e));let s="";v(t,((t,e)=>{let r="--"+y(e).replace(/^-+/,"");(o(t)||V(t))&&(t="initial"),this._cssVarOldValueMap[r]=t,s+=";"+r+":"+t})),this.style.cssText+=s}}h&&this.#r.append(...h),f&&f.forEach((t=>{t.mounted(this,((t,e)=>(p.__data_[t]=e,p.__data_[t])))})),this.#f&&this.#f.forEach((t=>le.pushNext(t))),this.#p&&le.pushNext(this.#v),this.__bindEvents(),this.mounted()}}),0)}propsReady(t){}render(){return null}beforeMount(){}mounted(){}#m(t){let e=t.currentTarget,s="";v(this.#h,((t,r)=>{if(t===e)return s=r,!1})),this.__inited&&this.#k(e,s===ht?"":s)}#k(t,e){this.#N();let s=u(this.#e[e],"props");s&&v(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof Ve?t.updateProps(s):v(s,((e,s)=>{if(t instanceof HTMLSlotElement){let r=Le.get(t);if(r){let n=t.name||ht,o=r.#e[n];o||(o=r.#e[n]={props:{}}),o.props||(o.props={}),o.props[s]=e,r.#k(t,n)}}else t.setAttribute(s,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,s){if(!this.__inited)return;if(Object.is(s,e))return;"undefined"===s&&(s=null);let r=W(t);if(jt(Et.get(this.constructor)[r].type)){let t=!H(s)&&Ft(s);if(u(this,r)===t)return}this.#M(t,e,s)}shouldUpdate(t){return!0}updated(t){}_notify(t,e,s,r){let n=[];for(let o=0;o<e.length;o++){const i=e[o];n.push(i);let a=u(this,n),l=Bt(n);this.#s[l]={value:a,chain:l===Ie?[Ie]:n,oldValue:t,end:n.length===e.length,subNewValue:s,subOldValue:r}}this.isMounted?le.pushNext(this.#v):this.#p=!0}#y(){if(A(this.#s)<1)return;if(!this.isMounted)return;const t=this.#s;if(this.#s={},!this.shouldUpdate(t))return;let e=bt.get(this.constructor)??bt.get($t(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)}));let s=!1,r=new Set,n=this.constructor.prototype._viewDeps;if(v(t,((t,e)=>{if(!s&&n?.includes(e)&&(s=!0),this.__updateSubViewDeps?.has(e)){let t=this.__updateSubViewDeps.get(e);t&&t.forEach((t=>{r.add(t)}))}})),this._watchUpdateSetInNextTick?.forEach((t=>{let{newValue:e,oldValue:s,chain:r,rootObjNew:n,rootObjOld:o,fullMatch:i}=this._watchUpdateArgsInNextTick.get(t),a=i?e:n,l=i?s:o;t.call(this,a,l,r,e,s)})),this._watchUpdateSetInNextTick?.clear(),this._watchUpdateArgsInNextTick?.clear(),this._computedUpdateSetInNextTick?.forEach((t=>{let e=u(t,"key"),s=this.__data_[e],r=t.call(this);(a(r)||r!==s)&&(this.__data_[e]=r,this._notify(s,[e]))})),this._computedUpdateSetInNextTick?.clear(),this._cssUpdateInNextTick){let t=this.cssVars;v(t,((t,e)=>{let s="--"+y(e).replace(/^-+/,"");this._cssVarOldValueMap[s]!=t&&((o(t)||V(t))&&(t="initial"),this._cssVarOldValueMap[s]=t,this.style.setProperty(s,t+""))}))}this.#i?.deref()&&(s&&gs(this.render(),this,this.__updateTree,r,t),A(r)>0&&r.forEach((e=>{_s(e,this,void 0,t)}))),this.#w.forEach((t=>{this.#C(t)})),this.updated(t)}#S(){let t=Et.get(this.constructor)??Et.get($t(this.constructor)),e=this.attributes,s=this.tagName,r=this.#o,o={};v(e,(({name:e,value:s})=>{if(e[0]===qe||e[0]===Qe||e[0]===Ye||e===ts||"slot"===e)return;let r=W(e);t&&!t[r]&&(o[e]=s)})),this.#n=this.#n?D(this.#n,o):o;let i={};if(!t)return i;let l=Object.keys(t),c=l.length;for(let o=0;o<c;o++){const c=l[o],h=y(c),d=this.hasAttribute(h);let p,g=t[c],_=E(r,c),m=u(this,c);if(!("_defaultValue"in g)&&(g._defaultValue=m,!g.type)){n(m)&&Wt(s,"Prop '"+c+"' has neither propType nor defaultValue be used for type inference");let t=typeof m;f(m)&&(t="array");let e=Pe[t];g.type=e}if(_)p=V(r[c])?m:r[c];else{p=m;let t=e.getNamedItem(h)||e.getNamedItem(Qe+h)||e.getNamedItem(h+Qe);t&&(_=!0,p=t.value)}if(g.required&&!_){Wt(s,"Prop '"+c+"' is required");break}p=this.#A(t,c,p,d),g.attribute&&U(p)&&!a(p)&&this.#P(g,c,p),this.__data_[c]=p,i[c]=p,delete this[c]}return i}#P(t,e,s){let r=y(e),n=B(s);jt(t.type)?(n=Ft(s),$(n)?n&&!this.hasAttribute(r)?this.toggleAttribute(r,!0):!n&&this.hasAttribute(r)&&this.toggleAttribute(r,!1):this.getAttribute(r)!==n&&this.setAttribute(r,n)):this.getAttribute(r)!==n&&this.setAttribute(r,n)}#x(t,e){let s=t;try{for(let r=0;r<e.length;r++){const n=e[r];s=n===Boolean?Ft(t):n===Number?Number(t):n===String?String(t):n===Object||n===Array?j(t):n===Date?new Date(t):new n(t)}}catch(e){Wt(this.tagName,"Convert attribute error with "+t)}return s}#A(t,e,n,o){let i=t[e];if(!i)return n;let a=i.isValid,l=i.type,c=f(l)?l:[l],u=i.converter,h=n;if(!s(c,(t=>t===String))&&r(h)&&!H(h))try{h=u?u(h):this.#x(h,c)}catch(t){Wt(this.tagName,`Convert attribute '${e}' error with `+h)}for(let t=0;t<c.length;t++){"Boolean"===c[t].name&&o&&(h=Ft(h))}if(V(h))return h;let d=typeof h,p=!U(h);for(let t=0;t<c.length;t++){const e=c[t];if(x(d,e.name,"i")||h instanceof e||Object.prototype.toString.call(h)===Object.prototype.toString.call(e.prototype)){p=!0;break}}return p||Wt(this.tagName,`Invalid prop '${e}'. expected '${c.map((t=>t.name||t))}' but got '${d}'`),a&&(a.call(this,h,this.__data_)||Wt(this.tagName,`Invalid prop '${e}'. IsValid() check failed`)),h}#T(){let t=yt.get(this.constructor)??yt.get($t(this.constructor));t&&v(t,((e,s)=>{let r=t[s],n=u(this,s);if(r){let t=r.prop;n=t?F(this.__data_[t]):u(this,s)}this.__data_[s]=n,delete this[s]}))}#b=T(this.propsReady,100);updateProps(t){let e=Et.get(this.constructor);if(!e)return;if(!this.__inited)return;let s=[];v(t,((t,r)=>{let n=W(r),o=e[n];if(!o)return;t=this.#A(e,n,t);let i=this.__data_[n],l=Dt.get(this.constructor),c=l?.get(n);if(c){if(!c.call(this,t,i,[n],t,i))return!0}else if(a(t)){let e=xt.get(this.constructor);if(e?.has(n)&&Object.is(i,t))return!0}else if(Object.is(i,t))return!0;o.attribute&&U(t)&&!a(t)&&s.push([o,n,t]),w(this.__data_,n,t),ie(this,t,i,[r])})),D(this.#o,t),s.forEach((([t,e,s])=>{this.#P(t,e,s)})),this.#o&&this.#b(this.#o)}_wrapperProp={};_initProps(t,e){this.#o=_(this.#o||{},t),this.#n=_(this.#n||{},e),v(t,((t,e)=>{if(a(t)){let s=te.get(t);if(s){let t=s.join("-");this._wrapperProp[t]=e;let r=this.wrapperComponent?yt.get(this.wrapperComponent?.constructor):null,n=s[0];if(r&&r[n]){let t=Et.get(this.constructor);w(t,[e,"shallow"],r[n].shallow)}}}}))}_bindSlot(t,e,s){this.#h[e]||(this.#h[e]=t,Le.set(t,this));let r="slotchange",n=Ae(r,this.#_,t,this);if(this._eventBindList.push([r,this.#_,t,n]),!O(s)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=s}}_bindSlotHook(t,e){this.#c[t]=e}#w=new Set;_updateSlot(t,e,s){let r=this.#h[t],n=this.#c[t];if(!n&&!r)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=s),n)this.#w.add(t);else{let t=r.assignedElements({flatten:!0});for(let r=0;r<t.length;r++){t[r].setAttribute(e,s+"")}}}#N(){if(!this.#i)return;let t=z(this.#h);if(O(t))return;const e=P(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let s=G(e,(e=>{if(e.nodeType===Node.TEXT_NODE&&t.includes(ht))return ht;if(e instanceof Element){let s=e.getAttribute("slot")||ht;if(t.includes(s))return s}}));if(O(s))return void(this.slots={});v(s,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&O(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=X(t);if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&O(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let r={};v(s,((t,e)=>{O(t)||(r[e]=t)})),this.slots=r}#C(t){let e=this.#c[t];if(!e)return;let s=this.#e[t];if(!this.__data_.slots)return;if(!this.__data_.slots[t])return;this.renderAsync(e,u(s,"props"));const r=this._asyncDirectives.get(e);let n=r?.buildView(e(u(s,"props"))),o=K(d(n),(t=>t.nodeType===Node.COMMENT_NODE));if(o){let e=this.#d[t];if(!O(e))for(let t=0;t<e.length;t++){const s=e[t];s.parentNode?.removeChild(s)}this.#d[t]=o,this.append(...o),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#M(t,e,s){if(!this.__inited)return;if(de(this.constructor).has(t)){let e=W(t);if(H(s)){let t=Et.get(this.constructor);t&&(s=t[e]._defaultValue)}this.updateProps({[e]:s})}}_regSubViewDeps(t,e){this.__updateSubViewDeps||(this.__updateSubViewDeps=new Map),t.forEach((t=>{let s=this.__updateSubViewDeps.get(t);s||(s=new Set,this.__updateSubViewDeps.set(t,s)),s.add(e)}))}_getPrivateData(){return this.__data_}emit(t,e={},s){s&&(e.event=s),e.target=this,E(this.#n,"emit-native")?this.dispatchEvent(new CustomEvent(t,{bubbles:!1,composed:!1,cancelable:!0,detail:e})):this._listerners[t]&&this._listerners[t](e)}_addEvent(t,e){this._listerners||(this._listerners={}),this._listerners[t]=e}nextTick(t){if(!this.isMounted)return this.#f||(this.#f=[]),void this.#f.push(t);le.pushNext(t)}forceUpdate(){v(this.__data_,((t,e)=>{this.#s[e]={value:void 0,chain:void 0}})),this.#y()}}class We{strings;vars;constructor(t,e){this.strings=h(t),this.vars=e}getKey(){let t=this.vars,e="";return v(this.strings,((s,r)=>{if(dt.test(s))return e=q(t[r]),!1})),e}getKeys(){let t=this.vars,e=[];for(let s=0;s<this.strings.length;s++){const r=this.strings[s];if(dt.test(r)){let r=q(t[s]);e.push(r)}}return O(e)&&t.forEach((t=>{if(t instanceof We){let s=t.getKey();e.push(s)}})),e}append(t){let e=X(this.strings);return t.strings.forEach(((t,s)=>{0!=s?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=h(this.vars,t.vars),this}insert(t,e){let s=e.strings.shift();return this.strings[t]+=s,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,s]=as(t,this),r=ps([],e,s,t);return Q(r,((t,e)=>t+(e.nodeType==Node.TEXT_NODE?e.nodeValue:e.outerHTML??"")),"")}flatVars(t){let e=h(this.vars),s=this.strings.length-1,r=0;for(let n=0;n<=s;n++){let s=u(e,r,"");if(s instanceof We&&s.vars.length>0){let[n,o]=as(t,s);s=n,e.splice(r,1,...o),r+=o.length-1}r++}return e}destroy(){this.strings=this.vars=null}}var He,Ue;!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(He||(He={})),function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(Ue||(Ue={}));class Be{key;varIndex;value;node;attrName;attrTmpl;isText=!1;isDirective=!1;isComponent=!1;isProp=!1;isToggleProp=!1;isPlaceholder;__destroyed=!1;directiveOldValue;children;parent;constructor(t,e,s,r){this.varIndex=t,e&&(this.node=e),s&&(this.attrName=s),r&&(this.attrTmpl=r)}static createFrom(t){let e=new Be(t.varIndex,t.node,t.attrName,t.attrTmpl);return e.key=t.key,e.value=t.value,e.isText=t.isText,e.isDirective=t.isDirective,e.isComponent=t.isComponent,e.isProp=t.isProp,e.isToggleProp=t.isToggleProp,e.isPlaceholder=t.isPlaceholder,e}destroy(t){if(this.__destroyed)return;this.__destroyed=!0;let e=this.node,s=this.children;this.parent;if(this.node=this.value=this.directiveOldValue=this.children=this.parent=null,!e)return;let r=s;r?.forEach(((e,s)=>{e.destroy(t)})),e instanceof Ve&&e.destroy(),t&&zt.clear(e.deref(),t),e.deref()?.remove()}insert(t){t.parent=this,this.children||(this.children=[]),this.children.push(t)}}const $e=new WeakMap,je=new Map;var Fe;!function(t){t.AFTER_BEGIN="afterbegin"}(Fe||(Fe={}));let ze={};function Ge(t,e,s,r,n,o,i,a,l){let c;if([He.TEXT,He.SLOT].includes(u(r,"__scope",""))?(Zt.start(),c=r(t,e,s,{renderComponent:n,slotComponent:o,varChain:i,updatedMap:l}),Zt.end(n,a)):c=r(t,e,s,{renderComponent:n,slotComponent:o,varChain:i,updatedMap:l}),!c)return;let[h,p]=c;if(h===Ue.NONE)return;let f=$e.get(t),g=zt.getNodes(f,t),_=a.children;if(h===Ue.REMOVE){for(let t=0;t<g.length;t++){const e=g[t];e.remove(),e instanceof Ve&&e.destroy()}_?.forEach(((t,e)=>{t.destroy(n)}))}else if(h===Ue.REPLACE){let e=[];for(let t=0;t<g.length;t++){const e=g[t];e.parentNode?.removeChild(e),e instanceof Ve&&e.destroy()}_?.forEach(((t,e)=>{t.destroy(n)}));let s=fs(t,p,n,a,!0);e=d(s);let r=document.createDocumentFragment();r.append(...e),t.parentNode.insertBefore(r,t)}else if(h===Ue.UPDATE){let e,s={},r=[],o=[];if(p||(p=new We([],[])),O(g)){let e=fs(t,p,n,a,!0);return void f.after(...e)}let i={};p instanceof We&&p.vars.forEach((t=>{if(t instanceof We){const e=t.getKey();if(!e)return;i[e]=t,s[e]=!0,o.push(e)}})),g=I(Y(g),(t=>t.nodeType===Node.ELEMENT_NODE)),e=I(Y(d(e)),(t=>t.nodeType===Node.ELEMENT_NODE));let l={},c="",u={};for(let t=0;t<g.length;t++){let e=g[t],s=e.getAttribute("key");if(!V(s)){if(l[s]){c=s;break}l[s]=e,r.push(s),u[s]=!0}}if(c)return void Vt(`${W(t.nodeValue)} - duplicate key '${c}'`);let h=s,m=[],y=[];v(u,((t,e)=>{h[e]||(y.push(e),delete u[e],k(r,(t=>t===e)))}));let E,w=!1;if(!O(o)){let t=-1,e=[],s=[],n=0,i=0;for(;i<o.length;i++){const a=o[i];let c=r.findIndex((t=>t===a));if(c<0){let t=o[i-1],e=t?l[t]||t:f;m.push({prevNode:e,newkey:a}),n++}else if(c>-1&&c!==i-n){if(t<0||1===Math.abs(t-c)){let t=X(e);e.push({nodeId:a,targetId:0===i?Fe.AFTER_BEGIN:t?t.nodeId:o[i-1]})}else s.push({moveGroup:e,moveIndex:i+e.length}),e=[],e.push({nodeId:a,targetId:o[i-1]});t=c}}if(e.length>0&&s.push({moveGroup:e,moveIndex:i+e.length}),s.length>0){w=!0;let t=s.sort(((t,e)=>t.moveGroup.length-e.moveGroup.length));if(t.length<2){let{moveGroup:e}=t[0];if(e.length>1){let t=X(e).targetId;e[e.length-2].nodeId===t&&(e=Z(e))}e.forEach((({targetId:t,nodeId:e})=>{let s,r=l[e];t===Fe.AFTER_BEGIN?(s=f,s.after(r)):l[t]&&(s=l[t],s.after(r))}))}else{let e=X(t).moveIndex;1===Math.abs(t[t.length-2].moveIndex-e)&&(t=Z(t)),t.forEach((({moveGroup:t})=>{t.forEach((({targetId:t,nodeId:e})=>{let s,r=l[e];t===Fe.AFTER_BEGIN?(s=f,s.after(r)):(s=l[t],s.after(r))}))}))}}}if(y.forEach((t=>{let e=l[t];if(e&&e.parentNode){l[t]=null,e.remove();let s=k(_,(e=>e.key==t));s.forEach((t=>t.destroy(n)))}})),m.length>0&&(E=function(t,e,s,r,n,o){const i=[],a=[],l=[];let c,u=[];t.forEach((t=>{let s=X(u);s&&c===t.prevNode?(s.group||(s.group=[c]),s.group.push(t.newkey)):u.push(t),c=t.newkey;let r=t.newkey;l.push(r),i.push(""),a.push(e[r])})),i.push("");let h=fs(r,new We(i,a),s,o,!0),d=new Map;return h.forEach((t=>{const e=t.getAttribute("key");l.includes(e)&&(d.set(e,!0),n[e]=t)})),u}(m,i,n,t,ze,a),E.forEach(((e,s)=>{let r=e.newkey,n=ze[r],o=e.prevNode;if(e.group){let t=document.createDocumentFragment();t.append(...M(e.group,(t=>ze[t]))),n=t}o===t?o.before(n):o===f?o.after(n):"string"==typeof o?ze[o].after(n):o.after(n)})),ze=null,ze={}),p.vars[0]instanceof We){let t=[],e=[];v(p.vars,(s=>{e.push(...s.vars),t.push(...M(s.vars,(t=>"1")))})),t.push("1"),p=new We(t,e)}if(w||y.length>0||E){const t=G(_,(t=>t.key));let e=[],s=0;o.forEach((r=>{t[r]&&t[r].forEach((t=>{t.varIndex=s++,e.push(t)}))})),J(_,e).forEach((t=>t.destroy(n))),a.children=e}_s(a,n,p)}}let Xe=0;function Ke(t,e){let s=t.name||"Di-"+Xe++,r=Symbol.for(s);return(...n)=>{let o=t(...n);return(b(e,He.TEXT)||b(e,He.SLOT))&&je.set(s,o),w(o,"__scope",e[0]),[r,n,o,(t,e)=>{},Zt.popDirectiveQ()]}}const qe="@",Qe=".",Ye="?",Ze="*",Je=":",ts="ref",es="key",ss=/(<\/?)\s*([A-Z][A-Za-z0-9]*)([\s>])/gm,rs=/\s+([\.?@*])?((?:[a-zA-Z]*[A-Z][^\s<>="']+))(?=[\s=>])/gm,ns=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,os="slot-props",is=new Map;function as(t,e){let s="",r=h(e.vars),n=e.strings.length-1,o=e.vars.length-1,i=0;for(let a=0;a<=n;a++){const n=e.strings[a];let l=u(r,i,"");if(l instanceof We){let[e,s]=as(t,l);l=e,r.splice(i,1,...s),i+=s.length-1}else l=a>o?"":us;i++,s=s+n+l}let a=0;return s=s.replace(ns,((t,e)=>nt(t,us,(()=>us.replace("--\x3e","")+a++)))),s=s.replace(vs,"$1><").trim(),s=ls(s),[s,r]}function ls(t){return r(t)?t=(t=t.replace(rs,((t,e,s)=>` ${e??""}${y(s)}`))).replace(ss,((t,e,s,r)=>e+_t[s]+r)):t+""}function cs(t,e){let s=h(e.vars),r=e.strings.length-1;for(let n=0;n<=r;n++){let r=u(e.vars,n,"");if(r instanceof We){let e=cs(t,r);s.splice(n,1,...e)}}return s}const us="\x3c!--c_ui-pl_df--\x3e",hs="\x3c!--c_ui-pl_df",ds=/<!--c_ui-pl_df\d*(-->)?/;function ps(t,e,s,r){const n=document.createElement("div");n.innerHTML=e;let o=r._eventBindList;o||(o=r._eventBindList=[]);const i=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let a,l,u=0,h=null,d="";for(;a=i.nextNode();){if(l&&!l.contains(a)&&(l=void 0),a instanceof HTMLElement||a instanceof SVGElement){a instanceof Ve&&(l=a);let e={},n=M(a.attributes,(t=>({name:t.name,value:t.value})));for(let i=0;i<n.length;i++){const g=n[i];let{name:_,value:m}=g;if(_!==os)if(c(_,hs)){let e=s[u];if(f(e)&&p(e[0])){let[,s,n,o,i]=e;o(He.TAG,r.tagName);let c=new Be(u,new WeakRef(a));c.isDirective=!0,c.value=e,c.isComponent=!!l,t.push(c),h&&h?.contains(a)&&(c.key=d),u++,n(a,s,void 0,{renderComponent:r,slotComponent:l,varChain:i})}a.removeAttribute(_)}else if(_[0]!==qe)if(_!==ts)if(_!==es)if(X(_)!==Qe){if(ds.test(m)){let n=s[u],o=new Be(u,new WeakRef(a),_.replace(/\.|\?|@/,""),m);if(o.isComponent=!!l,h&&h?.contains(a)&&(o.key=d),_[0]===Qe||_[0]===Ye||_[0]===Ze){if(f(n)&&p(n[0])){let[,t,e,s,i]=n,c=He.PROP,u=_.substring(1);u!==He.STYLE&&u!==He.CLASS||(c=u),s(c,r.tagName),e(a,t,void 0,{renderComponent:r,slotComponent:l,varChain:i,attrName:u}),o.value=n,o.isDirective=!0}else if(_[0]===Ye){o.isToggleProp=!0,o.value=!!n;let t=_.substring(1);o.value&&a.setAttribute(t,n)}else if(_[0]===Ze){o.value=n;let t=_.substring(1);const[e,s]=t.split(Je);let r=e;switch(s){case"camel":r=W(r);break;case"kebab":r=y(r);break;case"snake":r=ot(r)}o.attrName=r,a.setAttribute(r,n)}else{let t=W(_.substring(1));o.value=n,o.isProp=!0,e[t]=n}a.removeAttribute(_),n=""}else{let t,e;if(o.value=n,f(n)&&p(n[0])){He.ATTR,_===He.CLASS?He.CLASS:_===He.STYLE&&He.STYLE;let[,s,r,i]=n;o.isDirective=!0,o.attrName=_,e=s,t=r,n=""}m=rt(m,ds,n),a.getAttributeNode(_).value=m,U(m)&&a.setAttribute(_,m),t&&t(a,e,void 0,{renderComponent:r,slotComponent:l})}t.push(o),u++}}else e[_.substring(0,_.length-1)]=m,a.removeAttribute(_);else{let e=s[u];a.setAttribute(_,e);let r=new Be(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=d),t.push(r),u++,h=a,d=e,t.length>0&&t.forEach((t=>{t.key=t.key??e}))}else{if(ds.test(m)){let e=s[u],r=new Be(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=d),t.push(r),u++,e.__setRef(new WeakRef(a))}a.removeAttribute(_)}else{let e;if(ds.test(m)){let r=new Be(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=d),t.push(r),e=s[u],u++}let r=_.substring(1);o.push([r,e,a]),a.removeAttribute(_)}}a instanceof Ve?(g=r,a.__wrapperComponent=new WeakRef(g),A(e)>0&&a._initProps(e)):a instanceof HTMLSlotElement&&r._bindSlot(a,a.name||"default",e)}else{let e=a;if(`\x3c!--${e.nodeValue}--\x3e`!==us)continue;let n=new Be(u,new WeakRef(a));h&&h?.contains(a)&&(n.key=d),t.push(n),n.isComponent=!!l,n.isText=!0;let o=s[u];if(f(o)&&p(o[0])){const t=Symbol.keyFor(o[0]);let s;s=document.createComment(`compelem-${r.tagName}-${t}-start`),e.parentNode.insertBefore(s,e),e.nodeValue=`compelem-${r.tagName}-${t}-end`,e._diName=t,$e.set(e,s),n.isDirective=!0,n.value=o;let i=l?He.SLOT:He.TEXT,[,a,c,u,h]=o;u(i,r.tagName),n.directiveOldValue=[a,h],Zt.start();let d=c(e,a,void 0,{renderComponent:r,slotComponent:l,varChain:h});if(Zt.end(r,n),d){let t=fs(e,d[1],r,n),s=t.length;t&&s>0&&zt.insertBefore(e,Array.from(t))}o=void 0}else n.value=o,n.node=null;if(u++,!n.isDirective){let t=q(o??""),s=document.createTextNode(t);e.parentNode.insertBefore(s,e),e.remove(),a=s,n.node=new WeakRef(s)}}h&&!h.contains(a)&&h!==a&&(h=null,d="")}var g;return n.childNodes}function fs(t,e,s,r,n=!1){let[o,i]=as(s,e),a=[],l=ps(a,o,i,s);return n&&s.__bindEvents(),a.forEach((t=>{r.insert(t)})),l}function gs(t,e,s,r,n){if(o(tt(t.strings)))return;if(!s)return;let i=t.flatVars(e);for(let t=0;t<s.length;t++){const o=s[t];let l=o.varIndex;if(l<0)continue;if(o.isPlaceholder)continue;if(o.__destroyed)continue;let c=o.value,h=i,d=o.node.deref();if(!d)continue;let p=et(l,"-");for(let e=0;e<p.length;e++){const s=p[e];h=u(h,s),h&&h.vars&&t<p.length-1&&(h=h.vars)}if(!a(c)&&c===h)continue;let g=d;if(o.isDirective){r?.delete(o);let[,t,s,,i]=o.value;if(!f(h))continue;let a=Gt(d,e),[,l]=h;Ge(d,l,t,s,e,a,i,o,n)}else if(o.isToggleProp){if(!!h===c)continue;g.toggleAttribute(o.attrName,!!h),g instanceof Ve&&g.updateProps({[o.attrName]:!!h})}else if(o.isProp){if(!a(h)&&h===c)continue;d instanceof Ve?d.updateProps({[o.attrName]:h}):d instanceof HTMLSlotElement&&e._updateSlot(d.getAttribute("name")||"default",o.attrName,h)}else if(o.attrName){if(!st(c,h))switch(o.attrName){case"value":if(d instanceof HTMLInputElement){d.value=h;break}default:d.setAttribute(o.attrName,rt(o.attrTmpl,ds,h+""))}}else if(o.isText){o.node.deref().textContent=q(h??"")}o.value=h}}function _s(t,e,s,r){if(!t||t.__destroyed)return;let n=t.node.deref();const o=je.get(n._diName);let i=Gt(n,e);const[a,l]=t.directiveOldValue;if(!s){let c=o(n,t.value[1],a,{renderComponent:e,slotComponent:i,varChain:l,updatedMap:r});if(!c)return;s=c[1]}if(s){if(s.vars[0]instanceof We){let t=[],e=[];v(s.vars,(s=>{e.push(...s.vars),t.push(...M(s.vars,(t=>"1")))})),t.push("1"),s=new We(t,e)}gs(s,e,t.children,void 0,r)}}function ms(t,...e){return new We(r(t)?[t]:t,e)}const vs=/([a-z0-9"'])\s*>\s*</gim;class ys{__ref;get current(){return this.__ref?.deref()}__setRef(t){this.__ref=t}}function Es(){return new ys}var ws;!function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(ws||(ws={}));class bs{static get priority(){return 0}created(t,...e){}beforeMount(t,e,...s){}mounted(t,e,...s){}updated(t,e){}beforeDestroy(t,...e){}}class Ss{metadata;decorator;key;priority=0;constructor(t,e,s){this.metadata=e,this.decorator=new s(...t),this.priority=u(s,"priority",0)}dispose(){this.metadata=null,this.decorator=null}create(t){let e,s=this.decorator.targets,r=this.metadata[1];a(r)&&U(u(r,"configurable"))?e=ws.METHOD:n(this.metadata[1])&&(e=ws.FIELD),!O(s)&&e&&s.includes(e)?this.decorator.created(t,...this.metadata):Vt(`Decorator '${this.decorator.constructor.name}' is out of targets, expect '${s.join(",")}' bug got '${e}'`)}beforeMount(t,e){this.decorator.beforeMount(t,e,...this.metadata)}mounted(t,e){this.decorator.mounted(t,e,...this.metadata)}updated(t,e){this.decorator.updated(t,e)}destroy(t){this.decorator.beforeDestroy(t,...this.metadata)}}function Ts(t){return(...e)=>(...s)=>{let r=s[0].constructor,n=bt.get(r);if(!bt.has(r)){let t=Object.getPrototypeOf(r);n=t?h(bt.get(t)??[]):[],bt.set(r,n)}let o=new Ss(e,s.splice(1),t);return n?.push(o),o}}function Ns(t){return(...e)=>{if(!e||e.length<1)return;let s=e[0].constructor,r=bt.get(s);if(!bt.has(s)){let t=Object.getPrototypeOf(s);r=t?h(bt.get(t)??[]):[],bt.set(s,r)}let n=new Ss([],e.splice(1),t);return r?.push(n),n}}function Cs(t,e,s){return vt.has(t.constructor)||vt.set(t.constructor,{}),vt.get(t.constructor)[e]=s.get,delete t[e],Reflect.defineProperty(t,e,{get(){return Zt.__collecting&&Zt.__varPathList.push(e),Reflect.get(this[It],e)}}),Reflect.getOwnPropertyDescriptor(t,e)}const ks=Ts(class extends bs{static get priority(){return Number.MAX_VALUE}created(t,e,...s){let r=u(t,e);w(t,e,T(r,this.wait,this.immediate)),w(t,e+"_$__",r)}beforeDestroy(t,e){w(t,e,null),w(t,e+"_$__",null)}get targets(){return[ws.METHOD]}wait;immediate;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function Ms(t,e){return(s,r,n)=>{if(!gt.has(s.constructor)){let t=[],e=s.constructor;for(;(e=$t(e))!==Ve;)t=h(t,gt.get(e)??[]);gt.set(s.constructor,t)}gt.get(s.constructor)?.push({name:t,targetFn:e,fnName:r})}}const As=Ts(class extends bs{static get priority(){return Number.MAX_VALUE}created(t,e,s,...r){let n=it(u(t,s),t);w(t,s,C(n)),w(t,s+"_$__",n)}beforeDestroy(t,e){w(t,e,null),w(t,e+"_$__",null)}get targets(){return[ws.METHOD]}});var Ps;!function(t){t.ONCE="once"}(Ps||(Ps={}));const xs=new WeakMap;class Ds extends bs{static get priority(){return Number.MAX_VALUE}get targets(){return[ws.FIELD]}selector;cache;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){let e=t?.shadowRoot?.querySelector(this.selector),s=xs.get(t);s||(s=new Map,xs.set(t,s)),s.set(this.selector,e)}mounted(t,e,s,...r){const n=this;let o=new WeakRef(t);Reflect.defineProperty(t,s,{configurable:!0,get(){let t=o.deref();return xs.has(t)&&xs.get(t)?.has(n.selector)&&n.cache===Ps.ONCE||n.getter(t),xs.get(t)?.get(n.selector)}})}beforeDestroy(t,e){xs.get(t)?.clear(),xs.delete(t)}updated(t,e){this.cache!==Ps.ONCE&&this.getter(t)}}const Rs=Ts(Ds),Ls=Ts(class extends Ds{getter(t){let e=t.shadowRoot?.querySelectorAll(this.selector),s=xs.get(t);s||(s=new Map,xs.set(t,s)),s.set(this.selector,e)}});function Os(t){if(1===arguments.length)return(e,s)=>{Is(e,s,t)};Is(arguments[0],arguments[1],{prop:""})}function Is(t,e,s){if(!yt.has(t.constructor)){const e={};let s=t.constructor;for(;(s=$t(s))!==Ve;)_(e,yt.get(s)??{});yt.set(t.constructor,e)}if(s.shallow=s.shallow||!1,w(yt.get(t.constructor),e,s),s.hasChanged){let r=Dt.get(t.constructor);r||(r=new Map,Dt.set(t.constructor,r)),r.set(e,s.hasChanged)}if(s.shallow){let s=Pt.get(t.constructor);s||(s=new Set,Pt.set(t.constructor,s)),s.add(e)}Reflect.defineProperty(t.constructor.prototype,e,{get(){return Xt(e,this)},set(t){Kt(e,t,this)}})}function Vs(t,e,s){Is(t.prototype,e,s||{prop:""})}function Ws(t){return e=>{e&&(_t[e.name]=t,mt[t]=e)}}const Hs=Ts(class extends bs{static get priority(){return Number.MAX_VALUE}created(t,e,...s){let r=u(t,e);w(t,e,N(r,this.wait)),w(t,e+"_$__",r)}beforeDestroy(t,e){w(t,e,null),w(t,e+"_$__",null)}get targets(){return[ws.METHOD]}wait;constructor(t){super(),this.wait=t}});function Us(t,e){return(s,r)=>{let n=Mt.get(s.constructor),o=kt.get(s.constructor),i=Tt.get(s.constructor),a=Nt.get(s.constructor),l=Ct.get(s.constructor),c=At.get(s.constructor);if(!l){l=[],Ct.set(s.constructor,l),a=[],Nt.set(s.constructor,a),i=new Map,Tt.set(s.constructor,i),n={},Mt.set(s.constructor,n),o={},kt.set(s.constructor,o),c={},At.set(s.constructor,c);let t=$t(s.constructor);for(;t;)Ct.has(t)&&(l.push(...Ct.get(t)),a.push(...Nt.get(t)),Tt.get(t)?.forEach(((t,e)=>{i.set(e,t)})),D(n,Mt.get(t)),D(o,kt.get(t)),D(c,At.get(t))),t=$t(t)}(f(t)?t:[t]).forEach((t=>{let h=s[r];u(e,"once",!1)&&i.set(t,!1);let d=u(e,"deep",!1);if(l.push(t),d?(n[t]=n[t]??new Set,n[t].add(h),a.push(t)):(o[t]=o[t]??new Set,o[t].add(h)),u(e,"immediate",!1)){let e=c[t];e||(e=c[t]=new Set),e.add(h)}}))}}const Bs=["key"],$s=Ke((function(t){return(t,[e],s)=>{let r=t;if(s)v(e,((t,e)=>{r.setAttribute(e,t)}));else if(r instanceof Ve){let t={},s={},n=Et.get(r.constructor);v(e,((e,r)=>{if(Bs.includes(r))return;let o=W(r);(n?n[o]:void 0)?t[r]=e:s[r]=e+""})),r._initProps(t,s)}else v(e,((t,e)=>{r.setAttribute(e,t)}))}}),[He.TAG]),js=new WeakMap,Fs=Ke((function(t){return(t,[e],s,{renderComponent:n})=>{let o=[];if(f(e)?o=Y(e):a(e)?o=P(e,((t,e)=>t?e:[])):r(e)&&(o=e.split(" ")),o.length<1&&!s)return;let i=t;if(js.get(i)&&js.get(i).length===o.length&&at(js.get(i),o))return;let l=js.get(i);v(l,(t=>{i.classList.remove(t)})),v(o,(t=>{i.classList.add(t)})),l=h(o),js.set(i,l)}}),[He.CLASS]),zs=new WeakMap,Gs=Ke((function(t,e){return(t,e,s,{varChain:r,updatedMap:n})=>{let o=t,i=function(t,e,s){let r=M(t,((t,s)=>e(t,s)));if(r.length<1){let t=new We([],[]);return zs.set(s,t),t}let n=[],o=[];const i=[],a=[];for(let t=0;t<r.length;t++){const e=r[t];let s=X(o),l=e.vars,c=!0,u=e.strings;for(let t=0;t<u.length;t++){const e=u[t];if(dt.test(e)){let e=l[t]+"";if(n.includes(e))return void Vt(`forEach - duplicate key '${e}'`);n.push(e),c=!1}0==t&&s?o[o.length-1]=s+e:o.push(e)}if(c)return void Vt("forEach - missing 'key' prop");let h=X(i);h&&u.length>0&&(i[i.length-1]=B(h)+u.shift()),i.push(""),a.push(e)}i.push("");let l=new We(i,a);return zs.set(s,l),l}(e[0],e[1],o);if(s&&s[0]&&A(e[0])===A(s[0])){let t=z(n).find((t=>lt(t,X(r))));if(t&&u(n,[t,"end"],!0)){const t=zs.get(o);return[Ue.NONE,t]}}return s?[Ue.UPDATE,i]:[Ue.APPEND,i]}}),[He.TEXT,He.SLOT]);let Xs=document.createElement("div");const Ks=Ke((function(t){return(t,e,s,{renderComponent:r,slotComponent:n})=>{s&&e[0]==s[0]||V(e[0])||(Xs.innerHTML=ls(e[0]),t.after(...Xs.childNodes))}}),[He.TEXT,He.SLOT]),qs=Ke((function(t){return(t,e,s,{renderComponent:r,slotComponent:n})=>{s&&e[0]==s[0]||V(e[0])||(t.innerHTML=ls(e[0]))}}),[He.TAG]),Qs=new WeakMap,Ys=Ke((function(t,e,s){return(t,[e,s,r],n,{renderComponent:o})=>{let i=t;if(n){if(!!e==!!n[0]){let t=Qs.get(i);return[Ue.UPDATE,new We(["",""],[t.call(o,e)])]}let t=e?s:r;return Qs.set(i,t),[Ue.REPLACE,t.call(o,e)]}{let t=e?s:r;return Qs.set(i,t),[Ue.APPEND,t.call(o,e)]}}}),[He.TEXT,He.SLOT]),Zs=Ke((function(t,e){return(t,[e,s],r)=>r?e===r[0]?[Ue.UPDATE,new We(["",""],[e?s():ms``])]:e?[Ue.REPLACE,e?s():ms``]:[Ue.REMOVE]:[Ue.APPEND,e?s():ms``]}),[He.TEXT,He.SLOT]);var Js;!function(t){t.CHANGE="change",t.INPUT="input"}(Js||(Js={}));const tr=Ke((function(t,s="value",n){return(t,[s,n,o],i,{varChain:l,renderComponent:c})=>{n=n??"value";const h=t;if(i){const t=i[0],e=s;if(!a(e)&&Object.is(e,t))return;if(h instanceof Ve)h.updateProps({[n]:e});else if(h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement){if(h.setAttribute(n,e+""),h instanceof HTMLSelectElement){let t=S(h.querySelectorAll("option"),(t=>t.value==e));t&&(t.selected=!0)}}else if(h instanceof HTMLInputElement){if(h.value==e)return;switch(h.type){case"checkbox":case"radio":e?h.setAttribute("checked",""):h.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":h.setAttribute(n,e+""),w(h,n,e);break;default:h.setAttribute(n,e+"")}}return}let d;d=r(o)?e(o)[0]:X(l);const p=et(d,".")[0];p in c||c._wrapperProp[p]||Vt(`model - property '${p}' is not defined on the instance of `+c.tagName);let f=c._eventBindList;if(a(s)||B(s)||(s=""),h instanceof Ve){h._initProps({[n]:s});let t="update:"+n;f.push([t,function(t){let e=this,s=e._wrapperProp[p];!(p in e)&&s&&u(e.wrapperComponent,p)===u(e,s)&&(e=e.wrapperComponent||e),w(e,d,t.value)},h])}else if(h instanceof HTMLTextAreaElement){h.setAttribute(n,s+"");let t="input";f.push([t,function(t){let e=t.target;w(this,d,e.value)},h])}else if(h instanceof HTMLInputElement){let t="",e="";switch(h.type){case"checkbox":case"radio":t="checked",e="change";break;default:t="value",e="input"}h.setAttribute(n??t,s+""),f.push([e,function(t){let e=t.target;w(this,d,e.value)},h])}else h instanceof HTMLSelectElement&&(h.setAttribute(n,s+""),f.push(["change",function(t){let e=t.target,s=this,r=s._wrapperProp[p];!(p in s)&&r&&u(s.wrapperComponent,p)===u(s,r)&&(s=s.wrapperComponent||s),w(s,d,e.value)},h]))}}),[He.TAG]),er=new WeakMap,sr=Ke((function(t,e){return(t,[e,s],r)=>{if(r&&e===r[0])return;let n=t;if(!er.has(n)){let t=n.style.display;er.set(n,"none"==t?"unset":t)}n.style.display=e?er.get(n):"none",s&&s(n,e)}}),[He.TAG]),rr=Ke((function(t,e){return(t,[e,s],r,{renderComponent:n,slotComponent:o})=>{r||(e=e.bind(n),o._bindSlotHook(s||"default",e))}}),[He.SLOT]);class nr{static getCssText(t,e=!1){return r(t)?t:tt(M(t,((t,s)=>s.startsWith("--")?s+":"+t+(e?" !important":""):y(s)+":"+t+(e?" !important":""))),";")+";"}static setStyle(t,e){if(r(t)&&!B(t))return;let s=nr.getCssText(t);e.style.cssText=s}}const or=Ke((function(...t){return(t,e,s,{renderComponent:r})=>{let n=t,o=Q(e,((t,e)=>t+nr.getCssText(e)),""),i=Y(o.split(";").map((t=>t.split(":")[0]))),a=Y(n.style.cssText.split(";")),l=K(a,(t=>i.some((e=>t.trim().startsWith(e)))));n.style.cssText=o+l.join(";")}}),[He.STYLE]),ir=new WeakMap,ar=Ke((function(t,e){return(t,[e,s],r)=>{let n=()=>ms``,o=[],i=[];v(s,((t,e)=>{if(l(t))o.push(e),i.push(t);else{let e=t[0],s=t[1];o.push(e),i.push(s)}"default"===e&&(n=t)}));let a=ct(o,(t=>l(t)?t(e):t==e)),c=ir.get(t);return ir.set(t,a),r?c==a?[Ue.UPDATE,ut(i[a]??n)]:[Ue.REPLACE,ut(i[a]??n)]:[Ue.APPEND,ut(i[a]??n)]}}),[He.TEXT,He.SLOT]);function lr(){v(mt,((t,e)=>{customElements.define(e,t)}))}export{Ve as CompElem,nr as CssHelper,$e as DI_COMMENT_START_NODE_MAP,bs as Decorator,ws as DecoratorType,Ss as DecoratorWrapper,Ue as DirectiveUpdateTag,zt as DomUtil,He as EnterPointType,Js as ModelTriggerType,Ps as QueryCache,We as Template,je as TextOrSlotDirectiveExecutorMap,Be as UpdatePoint,de as _getObservedAttrs,$t as _getSuper,Bt as _toUpdatePath,$s as bind,as as buildHTML,Fs as classes,Cs as computed,Es as createRef,ks as debounced,Ts as decorator,Ns as decoratorWithNoArgs,Ke as directive,Ms as event,Gs as forEach,Ft as getBooleanValue,Gt as getSlotComponent,ms as html,Ks as htmlC,qs as htmlD,Ys as ifElse,Zs as ifTrue,jt as isBooleanProp,Vs as makeState,tr as model,As as onced,ce as prop,Rs as query,Ls as queryAll,lr as regComponents,sr as show,Vt as showError,Wt as showTagError,Ut as showTagWarn,Ht as showWarn,rr as slot,Os as state,or as styles,Ws as tag,Hs as throttled,Ge as updateDirective,Us as watch,ar as when};
7
+ import t,{toPath as e,some as r,isString as s,isUndefined as n,isBlank as o,closest as i,assign as a,isObject as l,isFunction as c,startsWith as u,get as h,concat as d,toArray as p,isSymbol as f,isArray as g,defaults as _,merge as m,clone as E,each as w,kebabCase as v,has as y,set as b,includes as N,find as S,debounce as T,throttle as M,once as C,noop as k,remove as R,map as x,size as A,flatMap as P,test as I,first as L,walkTree as O,isEmpty as D,filter as V,isNil as W,camelCase as H,isNull as U,isDefined as B,trim as j,isBoolean as F,parseJSON as K,cloneDeep as $,keys as G,groupBy as X,last as z,reject as q,compact as Q,intersect as Z,except as J,initial as Y,findIndex as tt,toString as et,reduce as rt,split as st,isEqual as nt,replace as ot,snakeCase as it,range as at,bind as lt,isMatch as ct,isElement as ut,join as ht}from"myfx";const dt="default",pt=/\s+\.?key\s*=/;var ft,gt;!function(t){t[t.RENDER=1]="RENDER",t[t.COMPUTED=2]="COMPUTED",t[t.DIRECTIVE=3]="DIRECTIVE"}(ft||(ft={})),function(t){t.Prod="prod",t.Dev="dev"}(gt||(gt={}));const _t=new Map,mt={},Et={},wt=new WeakMap,vt=new WeakMap,yt=new WeakMap,bt=new WeakMap,Nt=new Map,St=new Map,Tt=new WeakMap,Mt=new WeakMap,Ct=new WeakMap,kt=new WeakMap,Rt=new WeakMap,xt=new WeakMap,At=new WeakMap,Pt=new WeakMap,It=new WeakMap,Lt=new WeakMap,Ot=new WeakMap,Dt=new Map,Vt=new WeakMap,Wt=new WeakMap,Ht=new WeakMap,Ut=new WeakMap,Bt="__data_",jt="⟬Ċ⟭";function Ft(t){console.error("[CompElem]",t)}function Kt(t,e){console.error(`[CompElem <${t}>]`,e)}function $t(...t){console.warn("[CompElem]",...t)}function Gt(t,e){console.warn(`[CompElem <${t}>]`,e)}function Xt(t){return e(t).join("-")}function zt(t){return Object.getPrototypeOf(t)}function qt(t){return t===Boolean||r(t,(t=>t===Boolean))}function Qt(t){let e=t;return s(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||o(e))&&(e=!0),e}const Zt={getNodes(t,e){let r=t.nextSibling;if(!e)return[r];let s=[];for(;r&&r!==e;)s.push(r),r=r?.nextSibling;return s},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},clear(t,e){if(!t)return;let r,s=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT);for(s=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_ELEMENT);r=s.nextNode();)t!==r&&(r instanceof Comment||r instanceof Ge&&r.destroy())}};function Jt(t,e){let r=i(t,(t=>t.host&&t.host instanceof Ge),"parentNode");if(!r||r.host!==e)return r?r.host:void 0}function Yt(t){return!!Et[t.tagName.toLowerCase()]}function te(t,e,r){let s=Wt.get(t);s||(s=new Map,Wt.set(t,s));let n=s.get(e)??{};s.set(e,a(n,r))}function ee(t,e){let r=e,s=Reflect.get(r[Bt],t);if(ie.__collecting&&ie.__varPathList.push(t),ce.has(s)){let n=he.get(s);n||(n=new Set,he.set(s,n));let o=ae.get(e);o||(o={},ae.set(e,o));let i=ce.get(s);if(ue.get(i)!==e){let e=le.get(i);e&&(o[e[0]]=t)}return n.add(r.__thisRef),i}if(l(s)&&!c(s)&&!(s instanceof Node)&&!Object.isFrozen(s)){let e=At.get(r.constructor),n=e?.has(t);n||(e=Pt.get(r.constructor),n=e?.has(t)),s=n||"slots"===t?s:de(s,r,t)}return s}function re(t,e,r){let s=r;if(!s.__inited)return void Reflect.set(s[Bt],t,e);let n=s[Bt][t],o=It.get(s.constructor),i=o?.get(t);if(i){if(!i.call(s,e,n,[t],e,n))return!0}else{if(Object.is(n,e))return!0;if(l(e)&&ce.get(n)===e)return!0}se(s,e,n,t),ne(s,t),oe(s,t),Reflect.set(s[Bt],t,e),s._notify(e,n,[t])}function se(t,e,r,s,n,o){let i=zt(t.constructor),a=Ct.get(t.constructor)??Ct.get(i),l=Mt.get(t.constructor)??Mt.get(i),c=Rt.get(t.constructor)??Rt.get(i),f=kt.get(t.constructor)??kt.get(i),g=Tt.get(t.constructor)??Tt.get(i);a?.forEach((i=>{(s===i||u(i,s+".")&&!Object.is(h(t._getPrivateData(),i),h(e,i))||u(s,i+".")&&l?.includes(i)&&!Object.is(h(t._getPrivateData(),i),h(e,i)))&&d(p(f[i]),p(c[i])).forEach((a=>{a&&!0!==g.get(i)&&(t._watchUpdateArgsInNextTick?.set(a,{newValue:e,oldValue:r,chain:s.split("."),rootObjNew:n,rootObjOld:o,fullMatch:i===s}),t._watchUpdateSetInNextTick?.add(a),g.has(i)&&g.set(i,!0))}))}))}function ne(t,e){let r=Lt.get(t.constructor);r?.has(e)&&r.get(e)?.forEach((e=>{t._computedUpdateSetInNextTick.add(e)}))}function oe(t,e){let r=Ot.get(t.constructor);if(!r)return;let s=e.split("."),n="";s.forEach((e=>{n=n?n+"."+e:e,r.has(n)&&(t._cssUpdateInNextTick=!0)}))}const ie={popDirectiveQ(){return this.__varPathList.reduceRight(((t,e)=>(t.includes(e)||t.unshift(e),t)),[])},start(){this.__collecting=!0,this.__varPathList=[]},end(t,e){t&&e&&t._regSubViewDeps(ie.popVarPathList(),e),this.__collecting=!1},popVarPathList(){let t=Array.from(new Set(this.__varPathList));return this.__varPathList=[],t},__varPathList:[],__collecting:!1},ae=new WeakMap,le=new WeakMap,ce=new WeakMap,ue=new WeakMap,he=new WeakMap;function de(t,e,r){if(ce.has(t))return ce.get(t);if(ue.has(t))return t;const s=new Proxy(t,{get(t,r,s){if(!r)return;const n=Reflect.get(t,r,s);if(f(r))return n;if(c(n))return n;if("length"===r&&g(t))return n;if("__"===r.substring(0,2))return n;if(ie.__collecting){let t=le.has(s)?d(le.get(s)):[];t.push(r);let e=t.join(".");ie.__varPathList.push(e)}if(ce.has(n))return ce.get(n);let o=n;if(l(n)&&!c(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=le.has(s)?d(le.get(s)):[];o=de(n,e),t.push(r),le.set(o,t),ce.set(n,o)}return o},set(t,r,s,n){if(!r)return!1;let o=t[r],i=le.get(n)??[],a=d(i,[r]),l=It.get(e.constructor),c=l?.get(a[0]),u=a.length>1,h=s,p=o;if(u&&(p=h=e._getPrivateData()[a[0]]),c){if(!c.call(e,h,p,a,s,o))return!0}else if(Object.is(o,s))return!0;let f=s,g=Reflect.set(t,r,f),_=he.get(n);return fe(e,f,o,a),_?.forEach((t=>{let e=t.deref();if(!e)return;let r=e._wrapperProp[a[0]],s=a.join(".");s=s.replace(a[0],r),se(e,f,o,s),ne(e,s),oe(e,s),pe(e,h,p,s.split("."))})),g}});return le.has(s)||le.set(s,r?[r]:[]),ce.set(t,s),r&&ue.set(s,e),s}function pe(t,e,r,s,n,o){t._notify(e,r,s)}function fe(t,e,r,s){let n=e,o=r;s.length>1&&(o=n=t._getPrivateData()[s[0]]);let i=s.join(".");se(t,e,r,i,n,o),ne(t,i),oe(t,i),pe(t,n,o,s)}const ge=new Map;class _e{static nextSet=new Set;static nextPending=!1;static next;static flush(){_e.nextPending=!1;let t=Array.from(_e.nextSet);_e.nextSet.clear(),ge.clear(),t.forEach((t=>t())),t=null}static pushNext(t){_e.nextSet.add(t),_e.nextPending||(_e.nextPending=!0,_e.next())}}function me(t){if(1===arguments.length)return(e,r,s)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,Ee(e,r,t)};let e=arguments[0],r=arguments[1],s=arguments[2];t={type:void 0,required:!1,attribute:!0},s&&"function"==typeof s.type&&(t=_(s,t),s=void 0),t.shallow=t.shallow||!1,Ee(e,r,t)}function Ee(t,e,r,s){let n;if(!yt.has(t.constructor)){const e={};let r=t.constructor;for(;(r=zt(r))!==Ge;)m(e,E(yt.get(r)??{}));n=new Set,w(e,((t,e)=>{if(t.attribute){let t=v(e);n?.add(t)}})),St.set(t.constructor,n),yt.set(t.constructor,e)}if(r.attribute){n||(n=St.get(t.constructor));let r=v(e);n?.add(r)}if(r.model){let r=bt.get(t.constructor);r||(r=[],bt.set(t.constructor,r)),r.includes(e)||r.push(e)}if(y(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),n&&(t.constructor.observedAttributes=p(n)),b(yt.get(t.constructor),e,r),r.hasChanged){let s=It.get(t.constructor);s||(s=new Map,It.set(t.constructor,s)),s.set(e,r.hasChanged)}if(r.shallow){let r=Pt.get(t.constructor);r||(r=new Set,Pt.set(t.constructor,r)),r.add(e)}Reflect.defineProperty(t,e,{get(){return ee(e,this)},set(r){bt.get(t.constructor)?.includes(e)&&function(t,e,r){r.emit("update:"+t,{value:e})}(e,r,this)}})}(()=>{const t=Promise.resolve(),e=_e.flush;_e.next=()=>{t.then(e)}})();const we=new Set;function ve(t){return St.get(t)??we}const ye=["resize","outside","mutate"],be=new WeakMap,Ne=[],Se=[],Te=[],Me=new WeakSet,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;if(!Me.has(e.target)){Me.add(e.target);continue}let s=be.get(e.target);s&&s({target:e.target,contentBoxSize:t,borderBoxSize:r,type:"resize"})}}));var ke;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(ke||(ke={}));const Re=new WeakMap,xe=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const r=t[e];let s=Re.get(r.target);if(!s)return;let n={target:r.target},o=null;switch(r.type){case"subtree":n.type=ke.Tree,o=s[ke.Tree];break;case"childList":n.type=ke.Child,n.addedNodes=r.addedNodes,n.removedNodes=r.removedNodes,o=s[ke.Child];break;case"attributes":n.type=ke.Attr,n.attributeName=r.attributeName,n.oldValue=r.oldValue,o=s[ke.Attr];break;case"characterData":n.type=ke.Char,n.oldValue=r.oldValue,o=s[ke.Char]}o&&(n.type="mutate",o(n))}}));function Ae(e,r,s,n,o){if("resize"===e)return function(t,e){if(be.has(t))return;be.set(t,e),Ce.observe(t);let r=Ce;return(e=!1)=>{r.unobserve(t),be.delete(t),e&&(r=t=null)}}(r,s);if("outside"===e)switch(n[0]){case"mousedown":return function(e,r){return Ne.push([e,r]),(s=!1)=>{t.remove(Ne,(t=>t[0]===e&&t[1]===r))}}(r,s);case"dblclick":return function(e,r){return Te.push([e,r]),(s=!1)=>{t.remove(Te,(t=>t[0]===e&&t[1]===r))}}(r,s);default:return function(e,r){return Se.push([e,r]),(s=!1)=>{t.remove(Se,(t=>t[0]===e&&t[1]===r))}}(r,s)}else if("mutate"===e)return function(t,e,r){let s=N(r,"child"),n=N(r,"attr"),o=N(r,"char"),i=N(r,"tree"),a=Re.get(t);if(!a)return a={},Re.set(t,a),s&&(a[ke.Child]=e),n&&(a[ke.Attr]=e),o&&(a[ke.Char]=e),i&&(a[ke.Tree]=e),xe.observe(t,{childList:s,attributes:n,characterData:o,subtree:i}),(e=!1)=>{Re.delete(t),e&&(t=null)}}(r,s,n)}document.addEventListener("mousedown",(t=>{let e=h(t.composedPath(),0,t.target);Ne.forEach((([r,s])=>{r.contains(e)||r.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||s({type:"outside",target:r,modifier:"mousedown",event:t})}))}),!1),document.addEventListener("click",(t=>{let e=h(t.composedPath(),0,t.target);Se.forEach((([r,s])=>{r.contains(e)||r.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||s({type:"outside",target:r,modifier:"click",event:t})}))}),!1),document.addEventListener("dblclick",(t=>{let e=h(t.composedPath(),0,t.target);Te.forEach((([r,s])=>{r.contains(e)||r.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||s({type:"outside",target:r,modifier:"dblclick",event:t})}))}),!1);const Pe=/,|^(debounce:.+)|(debounce$)/,Ie=/,|^(throttle:.+)|(throttle$)/,Le="native",Oe={esc:"escape"},De=()=>{};function Ve(t,e,r,s){let n,o=t.split("."),i=o.shift(),a=o.includes("once"),l=e??De;if(n=S(o,(t=>Pe.test(t)))){let t=n.split(":");l=T(l,parseInt(t[1])||100)}if(n=S(o,(t=>Ie.test(t)))){let t=n.split(":");l=M(l,parseInt(t[1])||100)}if(a&&(l=C(l)),Et[r.tagName.toLowerCase()]&&(r!==s||o.includes(Le)||o.push(Le),!o.includes(Le)))return We(r,s,i,l),k;if(function(t){return ye.includes(t)}(i))return Ae(i,r,l,o);let c=t=>{if(o.includes("prevent")&&t.preventDefault(),o.includes("stop")&&t.stopPropagation(),!o.includes("self")||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes("left")&&0!=t.button)return;if(o.includes("right")&&2!=t.button)return;if(o.includes("middle")&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(R(o,(t=>"ctrl"==t))[0]&&!t.ctrlKey)return;if(R(o,(t=>"alt"==t))[0]&&!t.altKey)return;if(R(o,(t=>"shift"==t))[0]&&!t.shiftKey)return;if(R(o,(t=>"meta"==t))[0]&&!t.metaKey)return;let e=x(o,(t=>Oe[t]||t));if(A(e)>0&&!e.includes(t.key.toLowerCase()))return}l(t)}},u={capture:o.includes("capture")||!1,passive:o.includes("passive")||!1};return r.addEventListener(i,c,u),(t=!1)=>{r.removeEventListener(i,c,u),t&&(r=null)}}function We(t,e,r,s){let n=h(t,"__c_emit_event_")??e._subComponentEventSn++;b(t,"__c_emit_event_",n);let o=e._subComponentEventMap.get(n);o||(o={},e._subComponentEventMap.set(n,o)),o[r]=s}const He={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},Ue=new WeakMap;let Be=[],je=0;const Fe=new WeakMap,Ke={},$e="slots";class Ge extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){Be=P(t.css,(t=>{if(s(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,w(t,((t,e)=>{I(e[0],/[A-Z]/)}))}#t;#e={};__data_={};#r={};#s;__updateTree;_eventBindList;__docoEventMap;__updateSubViewDeps;_cssUpdateInNextTick=!1;_cssVarOldValueMap;__cssSheets;_watchUpdateSetInNextTick;_watchUpdateArgsInNextTick;_computedUpdateSetInNextTick;_subComponentEventSn=0;_subComponentEventMap=new Map;get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get attrs(){return this.#n}get props(){return this.#o}get renderRoot(){return this.#i?.deref()}get renderRoots(){return this.#a.flatMap((t=>t.deref()??[]))}get parentComponent(){return this.#l?.deref()}get wrapperComponent(){return this.#c?.deref()}get slots(){return Ke}get slotHooks(){return this.#u}get cssSheets(){return Ue.get(this.constructor)}get globalCssSheet(){return Ge.__l_globalRule.sheet}get isMounted(){return this.#h}#n;#o;#i;#a;#l;#c;#d={};#u={};#p={};#h=!1;#f=!1;#g;static get css(){return[]}static get globalCss(){}static get hostCss(){}get cssVars(){return{}}__inited=!1;#_=!1;#m;__thisRef;constructor(...t){super(),this.#t=je++,this.__updateTree=[],this.__thisRef=new WeakRef(this),this.#m=this.#E.bind(this),1===A(t)&&(this.#o={},a(this.#o,L(t))),Reflect.getOwnPropertyDescriptor(this.constructor.prototype,"slots")||Reflect.defineProperty(this.constructor.prototype,"slots",{get(){return ee("slots",this)},set(t){re("slots",t,this)}});let e=Nt.get(this.constructor)??Nt.get(zt(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#w=this.#v.bind(this)}insertStyleSheet(t){if(!this.#s)return null;let e;if(s(t)){e=new CSSStyleSheet;try{e.replaceSync(t)}catch(t){}}else{if(this.#s.adoptedStyleSheets.includes(t))return t;e=t}return this.#s.adoptedStyleSheets=[...this.#s.adoptedStyleSheets,e],e}get rootComponent(){let t=this;for(;t.parentComponent;)t=t.parentComponent;return t}#w;connectedCallback(){let t=i(this.parentNode,(t=>t instanceof Ge||t.host instanceof Ge),"parentNode");this.#l=t?t instanceof Ge?new WeakRef(t):new WeakRef(t.host):void 0;let e=Ut.get(this);e&&(this.#c=new WeakRef(e),Ut.delete(this)),Ge.__l_globalRule.parentNode||document.head.appendChild(Ge.__l_globalRule);let r=h(this.constructor,"hostCss"),n=h(this.constructor,"hostCssSheet");if(r){n||(s(r)?(n=new CSSStyleSheet,n.replaceSync(r)):n=r,b(this.constructor,"hostCssSheet",n));let t=this.#c?.deref()?.shadowRoot??this.#l?.deref()?.shadowRoot??this.ownerDocument;this.#c&&!this.#c.deref()?.shadowRoot?.contains(this)&&(t=i(this,(t=>t instanceof HTMLDocument||t instanceof ShadowRoot),"parentNode")),t&&n&&!t.adoptedStyleSheets.includes(n)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,n])}this.__init(),this.__bindEvents()}disconnectedCallback(){this.__unbindEvents()}__bindEvents(){let t=this._eventBindList;w(t,(t=>{let[e,r,s,n]=t;if(n)return;if(!s)return;let o=Ve(e,r&&h(globalThis,r.name)!==r?r.bind(this):r,s,this);t[3]=o}));let e=_t.get(this.constructor);A(e)>0&&(this.__docoEventMap||(this.__docoEventMap=new Map),w(e,(({name:t,targetFn:e,fnName:r})=>{if(this.__docoEventMap.has(t+"@"+r))return;let s=e?e(this):this,n=h(this,r),o=Ve(t,n&&h(globalThis,n.name)!==n?n.bind(this):n,s,this);this.__docoEventMap.set(t+"@"+r,o)})))}__unbindEvents(){w(this._eventBindList,(t=>{let[,,,e]=t;e&&e(),t[3]=null}));let t=[];w(this.__docoEventMap,((e,r)=>{e&&e(),t.push(r)})),t.forEach((t=>this.__docoEventMap.delete(t)))}beforeDestroyed(){}destroyed(){}get isDestroyed(){return this.#y}#y=!1;destroy(){if(this.#y)return;this.#y=!0;let t=Nt.get(this.constructor)??Nt.get(zt(this.constructor));if(t&&t.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.destroy(this)})),this.beforeDestroyed(),this.__unbindEvents(),this.__docoEventMap?.clear(),this.__docoEventMap=this._eventBindList=null,Vt.get(this)?.clear(),Vt.delete(this),this._watchUpdateArgsInNextTick?.clear(),this._watchUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick=null,this.__cssSheets=null,this.__updateSubViewDeps?.clear(),this.#l){let t=this.#l.deref();t&&O(t.__updateTree,(e=>{e.__destroyed||e.node?.deref()===this&&(e.destroy(t),R(e.parent?e.parent.children:t.__updateTree,(t=>t===e)))}))}w(this.__updateTree,(t=>t?.destroy(this))),w(this.#d,(t=>{Fe.delete(t),t.remove()})),w(this.#p,(t=>{w(t,(t=>t.remove()))})),w(this.__data_.slots,((t,e)=>{w(t,(t=>t.remove()))})),this.#b.clear(),this.#p=this.#d=this.#b=this.#e=this.__data_.slots=null,this.remove(),this._wrapperProp=this.#N=this.#i=this.#a=this.#s=this.#r=this.#n=this.#o=this.#i=this.#a=this.#u=this.#w=this.__data_=this.__updateTree=this.#l=this._asyncDirectives=this.#c=null,this.destroyed()}__init(){if(this.__inited)return;if(this.#_)return;this.#_=!0;let t=h(this.constructor,"globalCss");D(t)||!s(t)||h(this.constructor,"_globalRuleInserted")||(Ge.__l_globalRule.textContent+=t,b(this.constructor,"_globalRuleInserted",!0));let e=Ue.get(this.constructor),r=e??[];e||(w(h(this.constructor,"css"),(t=>{if(s(t)){let e=new CSSStyleSheet;e.replaceSync(t),r.push(e)}else c(t)||r.push(t)})),Ue.set(this.constructor,r));const n=this.#S();this.propsReady(n);for(const t in n){const e=n[t];this.__data_[t]=e}this.#T(),this.__data_.slots={},Reflect.defineProperty(this.__data_,"__isData",{enumerable:!1,value:!0});let i=zt(this.constructor);if(Ct.get(this.constructor)??Ct.get(i)){this._watchUpdateSetInNextTick=new Set,this._watchUpdateArgsInNextTick=new Map;let t=Tt.get(this.constructor)??Tt.get(i),e=xt.get(this.constructor)??xt.get(i);w(e,((e,r)=>{let s=h(this,r);e.forEach((t=>{t.call(this,s,void 0,r)})),t.has(r)&&t.set(r,!0)}))}let l=a({},wt.get(this.constructor),wt.get(i));if(l){this._computedUpdateSetInNextTick=new Set;let t=Lt.get(this.constructor);t?w(l,((t,e)=>{this[Bt][e]=t.call(this)})):(t=new Map,Lt.set(this.constructor,t),w(l,((e,r)=>{b(e,"key",r),ie.start(),this[Bt][r]=e.call(this),ie.end(),ie.popVarPathList().forEach((r=>{let s=t.get(r);s||(s=new Set,t.set(r,s)),s.add(e)}))})))}ie.start();let u=this.render();ie.end();let d,p=ie.popVarPathList();this.constructor.prototype._viewDeps||(this.constructor.prototype._viewDeps=p),null===u?(this.#a=[],this.#i=void 0):(this.#s=this.attachShadow({mode:"open"}),this.#s.adoptedStyleSheets=[...Be,...Ue.get(this.constructor)??[]],d=function(t,e){let r,s=[];gr.has(e.constructor)?(r=gr.get(e.constructor),s=Er(t)):(r=new er(t,e,s),gr.set(e.constructor,r));let[n,o]=wr(e,r.fragment,r.updatePointMetas,s);return e.__updateTree=o,n}(u,this),d&&A(d.children)>0&&(this.#a=V(d.children,(t=>t.nodeType===Node.ELEMENT_NODE)).map((t=>new WeakRef(t))),this.#i=this.#a[0])),this.__inited=!0,this.#M();let f=Ht.get(this);f&&(this.#u=f,Ht.delete(this)),w(this.#u,((t,e)=>{this.#C(e)}));const g=this;let _=Nt.get(this.constructor)??Nt.get(zt(this.constructor));_&&_.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(g.__data_[t]=e,g.__data_[t])))})),this.beforeMount(),setTimeout((()=>{if(!this.isDestroyed){if(this.#h=!0,this.#s){ie.start();let t=this.cssVars;if(ie.end(),!D(t)){this._cssVarOldValueMap={};let e=Ot.get(this.constructor);e||(e=new Set(ie.popVarPathList()),Ot.set(this.constructor,e));let r="";w(t,((t,e)=>{let s="--"+v(e).replace(/^-+/,"");(o(t)||W(t))&&(t="initial"),this._cssVarOldValueMap[s]=t,r+=";"+s+":"+t})),this.style.cssText+=r}}d&&A(d.children)>0&&(this.#s.append(d),Wt.delete(this)),_&&_.forEach((t=>{t.mounted(this,((t,e)=>(g.__data_[t]=e,g.__data_[t])))})),this.#g&&this.#g.forEach((t=>_e.pushNext(t))),this.#f&&_e.pushNext(this.#w),this.__bindEvents(),this.mounted()}}),0)}propsReady(t){}render(){return null}beforeMount(){}mounted(){}#E(t){let e=t.currentTarget,r="";w(this.#d,((t,s)=>{if(t===e)return r=s,!1})),this.__inited&&this.#k(e,r===dt?"":r)}#k(t,e){this.#M();let r=h(this.#e[e],"props");r&&w(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof Ge?t.updateProps(r):w(r,((e,r)=>{if(t instanceof HTMLSlotElement){let s=Fe.get(t);if(s){let n=t.name||dt,o=s.#e[n];o||(o=s.#e[n]={props:{}}),o.props||(o.props={}),o.props[r]=e,s.#k(t,n)}}else t.setAttribute(r,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,r){if(!this.__inited)return;if(Object.is(r,e))return;"undefined"===r&&(r=null);let s=H(t);if(qt(yt.get(this.constructor)[s].type)){let t=!U(r)&&Qt(r);if(h(this,s)===t)return}this.#R(t,e,r)}shouldUpdate(t){return!0}updated(t){}_notify(t=void 0,e,r,s,n){let o=[];for(let i=0;i<r.length;i++){const a=r[i];o.push(a);let l=h(this,o)??t,c=Xt(o);this.#r[c]={value:l,chain:c===$e?[$e]:o,oldValue:e,end:o.length===r.length,subNewValue:s,subOldValue:n}}this.isMounted?_e.pushNext(this.#w):this.#f=!0}#v(){if(A(this.#r)<1)return;if(!this.isMounted)return;const t=this.#r;if(this.#r={},!this.shouldUpdate(t))return;let e=Nt.get(this.constructor)??Nt.get(zt(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)}));let r=!1,s=new Set,n=this.constructor.prototype._viewDeps;if(w(t,((t,e)=>{if(!r&&n?.includes(e)&&(r=!0),this.__updateSubViewDeps?.has(e)){let t=this.__updateSubViewDeps.get(e);t&&t.forEach((t=>{s.add(t)}))}})),this._watchUpdateSetInNextTick?.forEach((t=>{let{newValue:e,oldValue:r,chain:s,rootObjNew:n,rootObjOld:o,fullMatch:i}=this._watchUpdateArgsInNextTick.get(t),a=i?e:n,l=i?r:o;t.call(this,a,l,s,e,r)})),this._watchUpdateSetInNextTick?.clear(),this._watchUpdateArgsInNextTick?.clear(),this._computedUpdateSetInNextTick?.forEach((t=>{let e=h(t,"key"),r=this.__data_[e],s=t.call(this);(l(s)||s!==r)&&(this.__data_[e]=s,this._notify(s,r,[e]))})),this._computedUpdateSetInNextTick?.clear(),this._cssUpdateInNextTick){let t=this.cssVars;w(t,((t,e)=>{let r="--"+v(e).replace(/^-+/,"");this._cssVarOldValueMap[r]!=t&&((o(t)||W(t))&&(t="initial"),this._cssVarOldValueMap[r]=t,this.style.setProperty(r,t+""))}))}this.#i?.deref()&&(r&&yr(Er(this.render()),this,this.__updateTree,s,t),A(s)>0&&s.forEach((e=>{!function(t,e,r,s){if(!t||t.__destroyed)return;let n=t.node.deref();const[o,i,a,l]=t.value;let u,d=Jt(n,e);if(!r){let r=o(n,t.value[1],i,{renderComponent:e,slotComponent:d,varChain:l,updatedMap:s,pointType:h(Dt.get(a),[0],Xe.TEXT)});if(!r)return;if(r[0]!==ze.REFRESH)return;u=c(r[1])?Er(r[1].call(e,t.value[1][0])):r[1]}if(!u)return;yr(u,e,t.children,void 0,s)}(e,this,void 0,t)}))),this.#b.forEach((t=>{this.#C(t)})),this.updated(t)}#S(){let t=yt.get(this.constructor)??yt.get(zt(this.constructor)),e=this.attributes,r=this.tagName,s=m(this.#o??{},Wt.get(this.wrapperComponent)?.get(this)??{}),o={};w(e,(({name:e,value:r})=>{if(e[0]===or||e[0]===ir||e[0]===ar||e===ur||"slot"===e)return;let s=H(e);t&&!t[s]&&(o[e]=r)})),this.#n=this.#n?a(this.#n,o):o;let i={};if(!t)return i;let c=Object.keys(t),u=c.length;for(let o=0;o<u;o++){const a=c[o],u=v(a),d=this.hasAttribute(u);let p,f=t[a],_=y(s,a),m=h(this,a);if(!("_defaultValue"in f)&&(f._defaultValue=m,!f.type)){n(m)&&Kt(r,"Prop '"+a+"' has neither propType nor defaultValue be used for type inference");let t=typeof m;g(m)&&(t="array");let e=He[t];f.type=e}if(_)p=W(s[a])?m:s[a];else{p=m;let t=e.getNamedItem(u)||e.getNamedItem(ir+u)||e.getNamedItem(u+ir);t&&(_=!0,p=t.value)}if(f.required&&!_){Kt(r,"Prop '"+a+"' is required");break}p=this.#x(t,a,p,d),f.attribute&&B(p)&&!l(p)&&this.#A(f,a,p),this.__data_[a]=p,i[a]=p,delete this[a]}return i}#A(t,e,r){let s=v(e),n=j(r);qt(t.type)?(n=Qt(r),F(n)?n&&!this.hasAttribute(s)?this.toggleAttribute(s,!0):!n&&this.hasAttribute(s)&&this.toggleAttribute(s,!1):this.getAttribute(s)!==n&&this.setAttribute(s,n)):this.getAttribute(s)!==n&&this.setAttribute(s,n)}#P(t,e){let r=t;try{for(let s=0;s<e.length;s++){const n=e[s];r=n===Boolean?Qt(t):n===Number?Number(t):n===String?String(t):n===Object||n===Array?K(t):n===Date?new Date(t):new n(t)}}catch(e){Kt(this.tagName,"Convert attribute error with "+t)}return r}#x(t,e,n,o){let i=t[e];if(!i)return n;let a=i.isValid,l=i.type,c=g(l)?l:[l],u=i.converter,h=n;if(!r(c,(t=>t===String))&&s(h)&&!U(h))try{h=u?u(h):this.#P(h,c)}catch(t){Kt(this.tagName,`Convert attribute '${e}' error with `+h)}for(let t=0;t<c.length;t++){"Boolean"===c[t].name&&o&&(h=Qt(h))}if(W(h))return h;let d=typeof h,p=!B(h);for(let t=0;t<c.length;t++){const e=c[t];if(I(d,e.name,"i")||h instanceof e||Object.prototype.toString.call(h)===Object.prototype.toString.call(e.prototype)){p=!0;break}}return p||Kt(this.tagName,`Invalid prop '${e}'. expected '${c.map((t=>t.name||t))}' but got '${d}'`),a&&(a.call(this,h,this.__data_)||Kt(this.tagName,`Invalid prop '${e}'. IsValid() check failed`)),h}#T(){let t=vt.get(this.constructor)??vt.get(zt(this.constructor));t&&w(t,((e,r)=>{let s=t[r],n=h(this,r);if(s){let t=s.prop;n=t?$(this.__data_[t]):h(this,r)}this.__data_[r]=n,delete this[r]}))}#N=T(this.propsReady,100);updateProps(t){let e=yt.get(this.constructor);if(!e)return;if(!this.__inited)return void a(this.#o,t);let r=[];w(t,((t,s)=>{let n=H(s),o=e[n];if(!o)return;t=this.#x(e,n,t);let i=this.__data_[n],a=It.get(this.constructor),c=a?.get(n);if(c){if(!c.call(this,t,i,[n],t,i))return!0}else if(l(t)){let e=Pt.get(this.constructor);if(e?.has(n)&&Object.is(i,t))return!0}else if(Object.is(i,t))return!0;o.attribute&&B(t)&&!l(t)&&r.push([o,n,t]),b(this.__data_,n,t),fe(this,t,i,[n])})),a(this.#o,t),r.forEach((([t,e,r])=>{this.#A(t,e,r)})),this.#o&&this.#N(this.#o)}_wrapperProp={};_initProps(t,e){this.#o=m(this.#o||{},t),this.#n=m(this.#n||{},e),w(t,((t,e)=>{if(l(t)){let r=le.get(t);if(r){let t=r.join("-");this._wrapperProp[t]=e;let s=this.wrapperComponent?vt.get(this.wrapperComponent?.constructor):null,n=r[0];if(s&&s[n]){let t=yt.get(this.constructor);b(t,[e,"shallow"],s[n].shallow)}}}}))}_bindSlot(t,e,r){this.#d[e]||(this.#d[e]=t,Fe.set(t,this));let s="slotchange",n=Ve(s,this.#m,t,this);if(this._eventBindList.push([s,this.#m,t,n]),!D(r)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=r}}#b=new Set;_updateSlot(t,e,r){let s=this.#d[t],n=this.#u[t];if(!n&&!s)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=r),n)this.#b.add(t);else{let t=s.assignedElements({flatten:!0});for(let s=0;s<t.length;s++){t[s].setAttribute(e,r+"")}}}#M(){if(!this.#i)return;let t=G(this.#d);if(D(t))return;const e=P(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let r=X(e,(e=>{if(e.nodeType===Node.TEXT_NODE&&t.includes(dt))return dt;if(e instanceof Element){let r=e.getAttribute("slot")||dt;if(t.includes(r))return r}}));if(D(r))return void(this.slots={});w(r,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&D(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=z(t);if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&D(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let s={};w(r,((t,e)=>{D(t)||(s[e]=t)})),this.slots=s}#C(t){let e=this.#u[t];if(!e)return;let r=this.#e[t];if(!this.__data_.slots)return;if(!this.__data_.slots[t])return;this.renderAsync(e,h(r,"props"));const s=this._asyncDirectives.get(e);let n=s?.buildView(e(h(r,"props"))),o=q(p(n),(t=>t.nodeType===Node.COMMENT_NODE));if(o){let e=this.#p[t];if(!D(e))for(let t=0;t<e.length;t++){const r=e[t];r.parentNode?.removeChild(r)}this.#p[t]=o,this.append(...o),this.#b.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#R(t,e,r){if(!this.__inited)return;if(ve(this.constructor).has(t)){let e=H(t);if(U(r)){let t=yt.get(this.constructor);t&&(r=t[e]._defaultValue)}this.updateProps({[e]:r})}}_regSubViewDeps(t,e){this.__updateSubViewDeps||(this.__updateSubViewDeps=new Map),t.forEach((t=>{let r=this.__updateSubViewDeps.get(t);r||(r=new Set,this.__updateSubViewDeps.set(t,r)),r.add(e)}))}_getPrivateData(){return this.__data_}emit(t,e={},r){if(r&&(e.event=r),e.target=this,y(this.#n,"emit-native"))this.dispatchEvent(new CustomEvent(t,{bubbles:!1,composed:!1,cancelable:!0,detail:e}));else{let r=h(this,"__c_emit_event_");this.wrapperComponent?._callEmitEvent(r,t,e)}}_callEmitEvent(t,e,r){let s=this._subComponentEventMap.get(t),n=h(s,e);c(n)&&n.call(this,r)}nextTick(t){if(!this.isMounted)return this.#g||(this.#g=[]),void this.#g.push(t);_e.pushNext(t)}forceUpdate(){w(this.__data_,((t,e)=>{this.#r[e]={value:void 0,chain:void 0}})),this.#v()}}var Xe,ze,qe;function Qe(t,e,r,s,n,o,i,a,l,c){let d,f=h(Dt.get(t),[0],"");if([Xe.TEXT,Xe.SLOT].includes(f)?(ie.start(),d=n(e,r,s,{renderComponent:o,slotComponent:i,varChain:a,updatedMap:c,pointType:f}),ie.end(o,l)):d=n(e,r,s,{renderComponent:o,slotComponent:i,varChain:a,updatedMap:c,pointType:f}),!d)return;let[_,m,E,v,y,N]=d;if(_===ze.NONE)return;if(_===ze.REFRESH)return;let S=N,T=!1;g(N)||(S=x(N,((t,e)=>t)),T=!0);let M=h(e,"__anchor__"),C={};w(G(e),(t=>{"__anchor__"!==t&&u(t,"__c-")&&(C[t]=h(e,[t]))}));let k=l.subViewRootNodes,A=l.children;if(_===ze.REMOVE){let t=[];w(k,((e,r)=>{if(g(e))w(e,(t=>{let e=t.deref();e.remove(),e instanceof Ge&&e.destroy()}));else{let r=e.deref();r.remove(),t.push(e),r instanceof Ge&&r.destroy()}})),t.forEach((t=>{R(k,(e=>e===t))})),A?.forEach(((t,e)=>{t.destroy(o),A[e]=null})),l.children=Q(A),g(k)?l.subViewRootNodes=[]:l.subViewRootNodes={}}else if(_===ze.REPLACE){w(k,(t=>{let e=t.deref();e.remove(),e instanceof Ge&&e.destroy()})),A?.forEach(((t,e)=>{t.destroy(o),A[e]=null})),l.children=Q(A);let[,t,r]=d;vr(e,l,t,r,o)}else if(_===ze.UPDATE){if(D(k))return void vr(e,l,y,m,o,S,((t,e,r)=>E[r]));let t={},r={};w(v,(r=>{let s=t[r];s||(s=t[r]=[]),V(e.parentElement.childNodes,(t=>h(t,["__c-"+M])==r)).forEach((t=>{s.push(t)}))})),l.children?.forEach((t=>{r[t.key]?r[t.key].push(t):r[t.key]=[t]}));let s,n=v,i=E,a=Z(v,E),u=J(v,a),d=[],f=[],g=!1;if(!D(i)){let e=-1,r=[],s=[],o=0,a=0;for(;a<i.length;a++){const l=i[a];let c=n.findIndex((t=>t===l));if(c<0){let e=i[a-1];t[l]=[],d.push({refKey:e,newKey:l}),o++}else if(c>-1&&c!==a-o){if(e<0||1===Math.abs(e-c)){let e=z(r),s=0===a?qe.AFTER_BEGIN:e?e.newKey:i[a-1],n=!1;0!==a&&D(t[s])&&(n=!0),r.push({newKey:l,refKey:s,refNew:n})}else{s.push({moveGroup:r,moveIndex:a+r.length});let e=i[a-1],n=!1;D(t[e])&&(n=!0),r=[],r.push({newKey:l,refKey:e,refNew:n})}e=c}}if(r.length>0&&s.push({moveGroup:r,moveIndex:a+r.length}),s.length>0){g=!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=z(r).refKey;r[r.length-2].newKey===t&&(r=Y(r))}Ze(r,t,v)}else{let r=z(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-r)&&(e=Y(e)),e.forEach((({moveGroup:e})=>{e[0].refNew?f.push(e):Ze(e,t,v)}))}}}if(d.length>0&&(d.forEach((e=>{let r=tt(E,(t=>t==e.newKey)),s=S[r],n=s;T&&(n=s[0],E[r]);let i=Er(y.call(o,n,e.newKey,r)),[a,c]=wr(o,m.fragment,m.updatePointMetas,i);e.fragment=a,w(c,(t=>{t.key=e.newKey,l.children?.push(t)}));let u=p(a.childNodes),h=t[e.newKey];w(u,(t=>{h.push(t),a.childNodes.forEach((t=>b(t,"__c-"+M,e.newKey+""))),w(C,((e,r)=>b(t,r,e)))}))})),o.__bindEvents(),s=function(t){let e,r=[];return t.forEach((t=>{let s=z(r);s&&e===t.refKey?(s.group||(s.group=[s.fragment]),s.group.push(t.fragment)):r.push(t),e=t.newKey})),r}(d),s.forEach(((r,s)=>{let n=r.fragment,o=t[r.refKey??v[0]],i=L(o),a=z(o);if(r.group){let t=document.createDocumentFragment();t.append(...r.group),n=t}i===e?i.before(n):r.refKey?"string"==typeof i||a.after(n):i.before(n)}))),w(f,(e=>{Ze(e,t,v)})),u.forEach((e=>{t[e].forEach((t=>{t.parentNode?.removeChild(t)})),r[e].forEach((t=>{t.destroy()}))})),g||u.length>0||s){const t=X(A,(t=>t.key));let e=[],r=0;i.forEach((s=>{t[s]&&t[s].forEach((t=>{t.varIndex=r++,e.push(t)}))})),J(A,e).forEach((t=>t.destroy(o))),l.children=e}let _={};if(w(S,((e,r)=>{let s=E[r],n=t[s];_[s]=n.map((t=>new WeakRef(t)))})),l.subViewRootNodes=_,a.length>0){let t=[];w(S,((e,r)=>{let s=r,n=e;T&&(n=e[0],s=e[1]);let i=Er(y.call(o,n,s,r));t.push(...i)})),yr(t,o,l.children,void 0,c)}}return!0}function Ze(t,e,r){t.forEach((({refKey:t,newKey:s})=>{let n=e[s];if(t===qe.AFTER_BEGIN){let t=e[r[0]];L(t).before(...n)}else if(e[t]){let r=e[t],s=z(r);s?.after(...n)}}))}function Je(t,e){return Dt.set(t,e),(...e)=>[t(...e),e,t,ie.popDirectiveQ()]}function Ye(t,e,r){Dt.get(t)}!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.SLOT="slot",t.TAG="tag"}(Xe||(Xe={})),function(t){t.NONE="NONE",t.REFRESH="REFRESH",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.INIT="INIT"}(ze||(ze={})),function(t){t.AFTER_BEGIN="afterbegin"}(qe||(qe={}));const tr=new RegExp(`([a-z0-9"'${jt}])\\s*>\\s*<`,"img");class er{updatePointMetas;fragment;constructor(t,e,r){let[s,n]=this.parseTemplate(t);r&&a(r,n),this.updatePointMetas=[],this.fragment=function(t,e,r,s){const n=document.createElement("template");n.innerHTML=e;const i=document.createNodeIterator(n.content,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);let a,l,u=0,h=-1,d=-1;for(;a=i.nextNode();)if(h++,l&&!l.contains(a)&&(l=void 0,d=-1),a instanceof HTMLElement||a instanceof SVGElement){Yt(a)&&(l=a,d=h);let e={},n=x(a.attributes,(t=>({name:t.name,value:t.value})));for(let o=0;o<n.length;o++){const i=n[o];let{name:p,value:f}=i;if(p!==fr)if(hr.test(p)){let e=r[u];if(g(e)&&c(e[0])){let[,,r,n]=e;Ye(r,Xe.TAG,s.tagName);let o=new nr(u);o.isDirective=!0,o.directiveType=Xe.TAG,o.nodeSn=h,o.directiveVarChain=n,l&&(o.slotNodeSn=d),t.push(o),u++}a.removeAttribute(p)}else if(p[0]!==or)if(p!==ur)if(z(p)!==ir){if(f.includes(jt)){let e=new nr(u);if(e.attrName=p.replace(/\.|\?|@/,""),e.nodeSn=h,l&&(e.slotNodeSn=d),p[0]===ir||p[0]===ar||p[0]===lr){if(p[0]===ar)e.isToggleProp=!0,e.attrName=p.substring(1);else if(p[0]===lr){e.isRefAttr=!0;let t=p.substring(1);const[r,s]=t.split(cr);let n=r;switch(s){case"camel":n=H(n);break;case"kebab":n=v(n);break;case"snake":n=it(n)}e.attrName=n}else{let t=Et[a.tagName.toLowerCase()];yt.get(t);{let t=H(p.substring(1));e.isProp=!0,e.attrName=t}}a.removeAttribute(p)}else e.attrTmpl=f;t.push(e),u++}}else{e[p.substring(0,p.length-1)]=f,a.removeAttribute(p);let t=new nr(u);t.attrName=p.substring(0,p.length-1),t.nodeSn=h,t.isPropPerfix=!0}else{if(hr.test(f)){r[u];let e=new nr(u);e.isRef=!0,e.nodeSn=h,t.push(e),u++}a.removeAttribute(p)}else{if(hr.test(f)){let e=new nr(u);e.isEvent=!0,e.attrName=p.substring(1),e.nodeSn=h,t.push(e),r[u],u++}a.removeAttribute(p)}}}else{let e=j(a.nodeValue).split(hr);if(e.length<2)continue;w(at(e.length-1),(n=>{let i=j(e[n]);if(!o(i)){let t=document.createTextNode(i);a.parentNode.insertBefore(t,a),h++}let p=document.createTextNode("");a.parentNode.insertBefore(p,a);let f=new nr(u);f.isText=!0,f.nodeSn=h,t.push(f);let _=r[u];if(g(_)&&c(_[0])){let t=l?Xe.SLOT:Xe.TEXT;f.isDirective=!0,f.directiveType=t,l&&(f.slotNodeSn=d);let[,,e]=_;Ye(e,0,s.tagName),_=void 0}u++,h++})),h--;let n=j(z(e));if(o(n)){let t=a.previousSibling;a.parentNode.removeChild(a),a=t}else a.nodeValue=n,h++}return n.content}(this.updatePointMetas,s,n,e)}parseTemplate(t){let e="",r=d(t.vars),s=t.strings.length-1,n=t.vars.length-1,o=0;for(let i=0;i<=s;i++){const s=t.strings[i];let a=h(r,o,"");if(a instanceof rr){let[t,e]=this.parseTemplate(a);a=t,r.splice(o,1,...e),o+=e.length-1}else a=i>n?"":jt+o;o++,e=e+s+a}return e=e.replace(tr,"$1><").trim(),e=mr(e),[e,r]}}class rr{strings;vars;constructor(t,e){this.strings=d(t),this.vars=e}getKey(){let t=this.vars,e="";return w(this.strings,((r,s)=>{if(pt.test(r))return e=et(t[s]),!1})),e}getKeys(){let t=this.vars,e=[];for(let r=0;r<this.strings.length;r++){const s=this.strings[r];if(pt.test(s)){let s=et(t[r]);e.push(s)}}return D(e)&&t.forEach((t=>{if(t instanceof rr){let r=t.getKey();e.push(r)}})),e}append(t){let e=z(this.strings);return t.strings.forEach(((t,r)=>{0!=r?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=d(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=new er(this,t,e),[s,n]=wr(t,r.fragment,r.updatePointMetas,e);return rt(s.childNodes,((t,e)=>t+(e.nodeType==Node.TEXT_NODE?e.nodeValue:e.outerHTML??"")),"")}destroy(){this.strings=this.vars=null}}class sr{metaInfo;key;varIndex;value;node;subViewRootNodes;__destroyed=!1;children;parent;constructor(t){this.varIndex=t}static createFrom(t){let e=new sr(t.varIndex);return e.metaInfo=t,e}destroy(t){if(this.__destroyed)return;this.__destroyed=!0;let e=this.node,r=this.children;if(this.parent,this.node=this.value=this.children=this.parent=this.metaInfo=null,!e)return;let s=r;s?.forEach(((e,r)=>{e.destroy(t)})),e instanceof Ge&&e.destroy(),t&&Zt.clear(e.deref(),t),e.deref()?.remove()}insert(t){t.parent=this,this.children||(this.children=[]),this.children.push(t)}}class nr{varIndex;attrName;attrTmpl;isText=!1;isDirective=!1;directiveType;directiveVarChain;isProp=!1;isPropPerfix=!1;isToggleProp=!1;isPlaceholder=!1;isEvent=!1;isRef=!1;isKey=!1;isRefAttr=!1;isComponent=!1;isSlot=!1;nodeSn=-1;slotNodeSn=-1;constructor(t){this.varIndex=t}}const or="@",ir=".",ar="?",lr="*",cr=":",ur="ref",hr=new RegExp(`${jt}\\d+`),dr=/(<\/?)\s*([A-Z][A-Za-z0-9]*)([\s>])/gm,pr=/\s+([\.?@*])?((?:[a-zA-Z]*[A-Z][^\s<>="']+))(?=[\s=>])/gm,fr="slot-props",gr=new Map;let _r=0;function mr(t){return s(t)?t=(t=t.replace(pr,((t,e,r)=>` ${e??""}${v(r)}`))).replace(dr,((t,e,r,s)=>e+mt[r]+s)):t+""}function Er(t){let e=d(t.vars),r=t.strings.length-1;for(let s=0;s<=r;s++){let r=h(t.vars,s,"");if(r instanceof rr){let t=Er(r);e.splice(s,1,...t)}}return e}function wr(t,e,r,s){let n,o=e.cloneNode(!0),i=[],a=[],l=[],c=t._eventBindList;c||(c=t._eventBindList=[]);const u=document.createNodeIterator(o,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);let h={},d={};r.forEach(((t,e)=>{h[t.nodeSn]||(h[t.nodeSn]=[]),h[t.nodeSn].push(t),t.slotNodeSn>-1&&(d[t.slotNodeSn]=null)}));let p=-1,f=0;for(;n=u.nextNode();){p++,null===d[p]&&(d[p]=n);let e={};const r=h[p];r&&r.forEach((t=>{let r=s[f++],o=sr.createFrom(t);if(o.node=new WeakRef(n),o.value=r,t.isProp||t.isPropPerfix)e[t.attrName]=r;else if(t.isRef)r.__setRef(new WeakRef(n));else if(t.isEvent)c.push([t.attrName,r,n]);else if(t.isToggleProp)o.value=!!r,n.toggleAttribute(t.attrName,o.value);else if(t.isRefAttr)n.setAttribute(t.attrName,r);else if(t.isText)if(t.isDirective){let e=t.attrName,s=d[t.slotNodeSn],[i,l,,c]=r;a.push([n,e,s,i,l,c,o])}else n.textContent=r;else if(t.isDirective){let e=d[t.slotNodeSn],[s,o,,i]=r,a=t.attrName;D(i)&&A(t.directiveVarChain)>0&&(i=t.directiveVarChain),l.push([n,a,e,s,o,i,t.directiveType])}else n.setAttribute(t.attrName,t.attrTmpl.replace(hr,r));i.push(o)})),n instanceof HTMLSlotElement?t._bindSlot(n,n.name||"default",e):n instanceof HTMLElement&&Yt(n)&&(Ut.set(n,t),te(t,n,e))}return a.forEach((([e,r,s,n,o,i,a])=>{b(e,"__anchor__",_r++),ie.start();let l=n(e,o,void 0,{renderComponent:t,slotComponent:s,varChain:i,attrName:r,pointType:a.directiveType});if(ie.end(t,a),l&&l.length>1){let[,r,s,n,o]=l;vr(e,a,r,s,t,n,o)}})),l.forEach((([e,r,s,n,o,i,a])=>{n(e,o,void 0,{renderComponent:t,slotComponent:s,varChain:i,attrName:r,pointType:a})})),[o,i]}function vr(t,e,r,s,n,o,i){let a=[],l=i?{}:void 0;o=o??[0];let c=document.createDocumentFragment(),u=h(t,"__anchor__");w(o,((t,o,h,d)=>{ie.start();let f=Er(r.call(n,t,o,d));ie.end(n);let[g,_]=wr(n,s.fragment,s.updatePointMetas,f),m=p(g.childNodes).map((t=>new WeakRef(t)));if(i){let e=i.call(n,t,o,d)+"";m.forEach((t=>{let r=t.deref();b(r,"__c-"+u,e)})),l[e]=m,_.forEach((t=>{t.key=e})),a.push(..._),c.append(g)}else c=g,e.subViewRootNodes=m,_.forEach((t=>{e.insert(t)}))})),l&&(e.subViewRootNodes=l,a.forEach(((t,r)=>{t.varIndex=r,e.insert(t)}))),c.childNodes.length>0&&(n.__bindEvents(),t.parentNode.insertBefore(c,t))}function yr(t,e,r,s,n){if(!o(t)&&r)for(let o=0;o<r.length;o++){const i=r[o];let a=i.varIndex;if(a<0)continue;let c=i.metaInfo;if(c.isPlaceholder||c.isPropPerfix||c.isRef||c.isEvent||c.isRefAttr||c.isKey)continue;if(i.__destroyed)continue;let u=i.value,d=t,p=i.node.deref();if(!p)continue;let f=st(a,"-");for(let t=0;t<f.length;t++){const e=f[t];d=h(d,e),d&&d.vars&&o<f.length-1&&(d=d.vars)}if(!l(u)&&u===d)continue;let _=p;if(c.isDirective){let[t,r,o,a]=i.value;if(!g(d))continue;let l=Jt(p,e),[,c]=d;Qe(o,p,c,r,t,e,l,a,i,n)&&s?.delete(i)}else if(c.isToggleProp){if(!!d===u)continue;_.toggleAttribute(c.attrName,!!d),_ instanceof Ge&&_.updateProps({[c.attrName]:!!d})}else if(c.isProp){if(!l(d)&&d===u)continue;p instanceof Ge?p.updateProps({[c.attrName]:d}):p instanceof HTMLSlotElement&&e._updateSlot(p.getAttribute("name")||"default",c.attrName,d)}else if(c.attrName){if(!nt(u,d))switch(c.attrName){case"value":if(p instanceof HTMLInputElement){p.value=d;break}default:p.setAttribute(c.attrName,ot(c.attrTmpl,hr,d+""))}}else if(c.isText){let t=i.node,e=et(d??"");e!==t.deref().textContent&&(t.deref().textContent=e)}i.value=d}}function br(t,...e){return new rr(s(t)?[t]:t,e)}class Nr{__ref;get current(){return this.__ref?.deref()}__setRef(t){this.__ref=t}}function Sr(){return new Nr}var Tr;!function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(Tr||(Tr={}));class Mr{static get priority(){return 0}created(t,...e){}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}beforeDestroy(t,...e){}}class Cr{metadata;decorator;key;priority=0;constructor(t,e,r){this.metadata=e,this.decorator=new r(...t),this.priority=h(r,"priority",0)}dispose(){this.metadata=null,this.decorator=null}create(t){let e,r=this.decorator.targets,s=this.metadata[1];l(s)&&B(h(s,"configurable"))?e=Tr.METHOD:n(this.metadata[1])&&(e=Tr.FIELD),!D(r)&&e&&r.includes(e)?this.decorator.created(t,...this.metadata):Ft(`Decorator '${this.decorator.constructor.name}' is out of targets, expect '${r.join(",")}' bug got '${e}'`)}beforeMount(t,e){this.decorator.beforeMount(t,e,...this.metadata)}mounted(t,e){this.decorator.mounted(t,e,...this.metadata)}updated(t,e){this.decorator.updated(t,e)}destroy(t){this.decorator.beforeDestroy(t,...this.metadata)}}function kr(t){return(...e)=>(...r)=>{let s=r[0].constructor,n=Nt.get(s);if(!Nt.has(s)){let t=Object.getPrototypeOf(s);n=t?d(Nt.get(t)??[]):[],Nt.set(s,n)}let o=new Cr(e,r.splice(1),t);return n?.push(o),o}}function Rr(t){return(...e)=>{if(!e||e.length<1)return;let r=e[0].constructor,s=Nt.get(r);if(!Nt.has(r)){let t=Object.getPrototypeOf(r);s=t?d(Nt.get(t)??[]):[],Nt.set(r,s)}let n=new Cr([],e.splice(1),t);return s?.push(n),n}}function xr(t,e,r){return wt.has(t.constructor)||wt.set(t.constructor,{}),wt.get(t.constructor)[e]=r.get,delete t[e],Reflect.defineProperty(t,e,{get(){return ie.__collecting&&ie.__varPathList.push(e),Reflect.get(this[Bt],e)}}),Reflect.getOwnPropertyDescriptor(t,e)}const Ar=kr(class extends Mr{static get priority(){return Number.MAX_VALUE}created(t,e,...r){let s=h(t,e);b(t,e,T(s,this.wait,this.immediate)),b(t,e+"_$__",s)}beforeDestroy(t,e){b(t,e,null),b(t,e+"_$__",null)}get targets(){return[Tr.METHOD]}wait;immediate;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function Pr(t,e){return(r,s,n)=>{if(!_t.has(r.constructor)){let t=[],e=r.constructor;for(;(e=zt(e))!==Ge;)t=d(t,_t.get(e)??[]);_t.set(r.constructor,t)}_t.get(r.constructor)?.push({name:t,targetFn:e,fnName:s})}}const Ir=kr(class extends Mr{static get priority(){return Number.MAX_VALUE}created(t,e,r,...s){let n=lt(h(t,r),t);b(t,r,C(n)),b(t,r+"_$__",n)}beforeDestroy(t,e){b(t,e,null),b(t,e+"_$__",null)}get targets(){return[Tr.METHOD]}});var Lr;!function(t){t.ONCE="once"}(Lr||(Lr={}));const Or=new WeakMap;class Dr extends Mr{static get priority(){return Number.MAX_VALUE}get targets(){return[Tr.FIELD]}selector;cache;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){let e=t?.shadowRoot?.querySelector(this.selector),r=Or.get(t);r||(r=new Map,Or.set(t,r)),r.set(this.selector,e)}mounted(t,e,r,...s){const n=this;let o=new WeakRef(t);Reflect.defineProperty(t,r,{configurable:!0,get(){let t=o.deref();return Or.has(t)&&Or.get(t)?.has(n.selector)&&n.cache===Lr.ONCE||n.getter(t),Or.get(t)?.get(n.selector)}})}beforeDestroy(t,e){Or.get(t)?.clear(),Or.delete(t)}updated(t,e){this.cache!==Lr.ONCE&&this.getter(t)}}const Vr=kr(Dr),Wr=kr(class extends Dr{getter(t){let e=t.shadowRoot?.querySelectorAll(this.selector),r=Or.get(t);r||(r=new Map,Or.set(t,r)),r.set(this.selector,e)}});function Hr(t){if(1===arguments.length)return(e,r)=>{Ur(e,r,t)};Ur(arguments[0],arguments[1],{prop:""})}function Ur(t,e,r){if(!vt.has(t.constructor)){const e={};let r=t.constructor;for(;(r=zt(r))!==Ge;)m(e,vt.get(r)??{});vt.set(t.constructor,e)}if(r.shallow=r.shallow||!1,b(vt.get(t.constructor),e,r),r.hasChanged){let s=It.get(t.constructor);s||(s=new Map,It.set(t.constructor,s)),s.set(e,r.hasChanged)}if(r.shallow){let r=At.get(t.constructor);r||(r=new Set,At.set(t.constructor,r)),r.add(e)}Reflect.defineProperty(t.constructor.prototype,e,{get(){return ee(e,this)},set(t){re(e,t,this)}})}function Br(t,e,r){Ur(t.prototype,e,r||{prop:""})}function jr(t){return e=>{e&&(mt[e.name]=t,Et[t]=e)}}const Fr=kr(class extends Mr{static get priority(){return Number.MAX_VALUE}created(t,e,...r){let s=h(t,e);b(t,e,M(s,this.wait)),b(t,e+"_$__",s)}beforeDestroy(t,e){b(t,e,null),b(t,e+"_$__",null)}get targets(){return[Tr.METHOD]}wait;constructor(t){super(),this.wait=t}});function Kr(t,e){return(r,s)=>{let n=Rt.get(r.constructor),o=kt.get(r.constructor),i=Tt.get(r.constructor),l=Mt.get(r.constructor),c=Ct.get(r.constructor),u=xt.get(r.constructor);if(!c){c=[],Ct.set(r.constructor,c),l=[],Mt.set(r.constructor,l),i=new Map,Tt.set(r.constructor,i),n={},Rt.set(r.constructor,n),o={},kt.set(r.constructor,o),u={},xt.set(r.constructor,u);let t=zt(r.constructor);for(;t;)Ct.has(t)&&(c.push(...Ct.get(t)),l.push(...Mt.get(t)),Tt.get(t)?.forEach(((t,e)=>{i.set(e,t)})),a(n,Rt.get(t)),a(o,kt.get(t)),a(u,xt.get(t))),t=zt(t)}(g(t)?t:[t]).forEach((t=>{let a=r[s];h(e,"once",!1)&&i.set(t,!1);let d=h(e,"deep",!1);if(c.push(t),d?(n[t]=n[t]??new Set,n[t].add(a),l.push(t)):(o[t]=o[t]??new Set,o[t].add(a)),h(e,"immediate",!1)){let e=u[t];e||(e=u[t]=new Set),e.add(a)}}))}}const $r=["key"],Gr=Je((function(t){return(t,[e],r,{renderComponent:s})=>{let n=t;if(r)w(e,((t,e)=>{n.setAttribute(e,t)}));else if(Yt(n)){let t={},r=yt.get(n.constructor);w(e,((e,s)=>{if($r.includes(s))return;let o=H(s);(r?r[o]:void 0)?t[s]=e:n.setAttribute(s,e+"")})),te(s,n,t)}else w(e,((t,e)=>{n.setAttribute(e,t)}))}}),[Xe.TAG]),Xr=new WeakMap,zr=Je((function(t){return(t,[e],r,{renderComponent:n})=>{let o=[];if(g(e)?o=Q(e):l(e)?o=P(e,((t,e)=>t?e:[])):s(e)&&(o=e.split(" ")),o.length<1&&!r)return;let i=t;if(Xr.get(i)&&Xr.get(i).length===o.length&&ct(Xr.get(i),o))return;let a=Xr.get(i);w(a,(t=>{i.classList.remove(t)})),w(o,(t=>{i.classList.add(t)})),a=d(o),Xr.set(i,a)}}),[Xe.TAG]),qr=new WeakMap,Qr=new WeakMap,Zr=Je((function(t,e,r){return(t,s,o,{renderComponent:i,varChain:a,updatedMap:l})=>{let c=s[0];if(h(o,0),D(c)&&n(o))return[ze.INIT];let u=0,d=Q(x(c,((t,r)=>e.call(i,t,r,u++)+"")));if(d.length!=new Set(d).size)return void Ft(`forEach - duplicate key in '${d}'`);let p,f=qr.get(t);if(qr.set(t,d),o){if(D(d))return[ze.REMOVE];if(A(d)===A(f)&&nt(d,f))return[ze.REFRESH,Jr(c,r,i)]}let g=s[2];if(Qr.has(t))p=Qr.get(t);else{let e=G(c)[0],r=c[e],s=g.call(i,r,e,0);p=new er(s,i),Qr.set(t,p)}return o?[ze.UPDATE,p,d,f,g,c]:[ze.INIT,r,p,c,e]}}),[Xe.TEXT,Xe.SLOT]);function Jr(t,e,r){let s=[];return w(t,((t,n)=>{let o=Er(e.call(r,t,n));s.push(...o)})),s}let Yr=document.createElement("template"),ts=new WeakMap;const es=Je((function(t){return(t,e,r,{renderComponent:s})=>{if(!(r&&e[0]==r[0]||W(e[0])))if(ut(t))t.innerHTML=mr(e[0]);else{let s=ts.get(t);s||(s=document.createTextNode(""),t.parentNode?.insertBefore(s,t),ts.set(t,s)),Yr.innerHTML=mr(e[0]),o(r)||Zt.remove(s,t),t.before(Yr.content.cloneNode(!0))}}}),[Xe.TAG,Xe.TEXT,Xe.SLOT]),rs=new WeakMap,ss=new WeakMap,ns=new WeakMap,os=Je((function(t,e,r){return(t,[e,r,s],n,{renderComponent:o})=>{let i;if(n){if(!!e==!!n[0]){let e=rs.get(t);return[ze.REFRESH,e]}let a=e?r:s;return e?(i=ss.get(t),i||(i=new er(a.call(o,e),o),ss.set(t,i))):(i=ns.get(t),i||(i=new er(a.call(o,e),o),ns.set(t,i))),[ze.REPLACE,a,i]}let a=e?r:s;return e?(i=ss.get(t),i||(i=new er(a.call(o,e),o),ss.set(t,i))):(i=ns.get(t),i||(i=new er(a.call(o,e),o),ns.set(t,i))),rs.set(t,a),[ze.INIT,a,i]}}),[Xe.TEXT,Xe.SLOT]),is=new WeakMap,as=Je((function(t,e){return(t,[e,r],s,{renderComponent:n})=>{let o=is.get(t);return e&&!is.has(t)&&(o=new er(r.call(n),n),is.set(t,o)),s?s[0]?e?[ze.REFRESH,r]:[ze.REMOVE]:e?[ze.REPLACE,r,o]:[ze.NONE]:[ze.INIT,...e?[r,o]:[]]}}),[Xe.TEXT,Xe.SLOT]);var ls;!function(t){t.CHANGE="change",t.INPUT="input"}(ls||(ls={}));const cs=Je((function(t,r="value",n){return(t,[r,n,o],i,{varChain:a,renderComponent:c})=>{n=n??"value";const u=t;if(i){const t=i[0],e=r;if(!l(e)&&Object.is(e,t))return;if(u instanceof Ge)u.updateProps({[n]:e});else if(u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement){if(u.setAttribute(n,e+""),u instanceof HTMLSelectElement){let t=S(u.querySelectorAll("option"),(t=>t.value==e));t&&(t.selected=!0)}}else if(u instanceof HTMLInputElement){if(u.value==e)return;switch(u.type){case"checkbox":case"radio":e?u.setAttribute("checked",""):u.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":u.setAttribute(n,e+""),b(u,n,e);break;default:u.setAttribute(n,e+"")}}return}let d;d=s(o)?e(o)[0]:z(a);const p=st(d,".")[0];let f=ae.get(c),g="";f&&(g=f[p]),p in c||!g||g in c||Ft(`model - property '${p}' is not defined on the instance of `+c.tagName);let _=c._eventBindList;if(l(r)||j(r)||(r=""),Et[u.tagName.toLowerCase()]){te(c,u,{[n]:r}),We(u,c,"update:"+n,(function(t){let e=this,r=e._wrapperProp[p];!(p in e)&&r&&h(e.wrapperComponent,p)===h(e,r)&&(e=e.wrapperComponent||e),b(e,d,t.value)}))}else if(u instanceof HTMLTextAreaElement){u.setAttribute(n,r+"");let t="input";_.push([t,function(t){let e=t.target;b(this,d,e.value)},u])}else if(u instanceof HTMLInputElement){let t="",e="";switch(u.type){case"checkbox":case"radio":t="checked",e="change";break;default:t="value",e="input"}u.setAttribute(n??t,r+""),_.push([e,function(t){let e=t.target;b(this,d,e.value)},u])}else u instanceof HTMLSelectElement&&(u.setAttribute(n,r+""),_.push(["change",function(t){let e=t.target,r=this,s=r._wrapperProp[p];!(p in r)&&s&&h(r.wrapperComponent,p)===h(r,s)&&(r=r.wrapperComponent||r),b(r,d,e.value)},u]))}}),[Xe.TAG]),us=new WeakMap,hs=Je((function(t,e){return(t,[e,r],s)=>{if(s&&e===s[0])return;let n=t;if(!us.has(n)){let t=n.style.display;us.set(n,"none"==t?"unset":t)}n.style.display=e?us.get(n):"none",r&&r(n,e)}}),[Xe.TAG]),ds=Je((function(t,e){return(t,[e,r],s,{renderComponent:n,slotComponent:o})=>{if(s)return;e=e.bind(n);let i=Ht.get(o);i||(i={},Ht.set(o,i)),i[r||"default"]=e}}),[Xe.SLOT]);class ps{static getCssText(t,e=!1){return s(t)?t:ht(x(t,((t,r)=>r.startsWith("--")?r+":"+t+(e?" !important":""):v(r)+":"+t+(e?" !important":""))),";")+";"}static setStyle(t,e){if(s(t)&&!j(t))return;let r=ps.getCssText(t);e.style.cssText=r}}const fs=Je((function(...t){return(t,e,r,{renderComponent:s})=>{let n=t,o=rt(e,((t,e)=>t+ps.getCssText(e)),""),i=Q(o.split(";").map((t=>t.split(":")[0]))),a=Q(n.style.cssText.split(";")),l=q(a,(t=>i.some((e=>t.trim().startsWith(e)))));n.style.cssText=o+l.join(";")}}),[Xe.TAG]),gs=new WeakMap,_s=new WeakMap,ms=Je((function(t,e){return(t,[e,r],s,{renderComponent:n})=>{let o=()=>br``,i=[],a=[];w(r,((t,e)=>{if(c(t))i.push(e),a.push(t);else{let e=t[0],r=t[1];i.push(e),a.push(r)}"default"===e&&(o=t)}));let l=tt(i,(t=>c(t)?t(e):t==e)),u=gs.get(t);gs.set(t,l);let h=_s.get(t);if(h||(h=[],_s.set(t,h)),!h[l]){let t=new er((a[l]??o).call(n),n);h[l]=t}return s?u==l?[ze.REFRESH,a[l]??o]:[ze.REPLACE,a[l]??o,h[l]]:[ze.INIT,a[l]??o,h[l]]}}),[Xe.TEXT,Xe.SLOT]);function Es(){w(Et,((t,e)=>{customElements.define(e,t)}))}export{Ge as CompElem,ps as CssHelper,Mr as Decorator,Tr as DecoratorType,Cr as DecoratorWrapper,ze as DirectiveUpdateTag,Zt as DomUtil,Xe as EnterPointType,ls as ModelTriggerType,Lr as QueryCache,rr as Template,ve as _getObservedAttrs,zt as _getSuper,Xt as _toUpdatePath,te as addUninitializedSubComponentProp,Gr as bind,zr as classes,xr as computed,Sr as createRef,Ar as debounced,kr as decorator,Rr as decoratorWithNoArgs,Je as directive,Ye as directiveScopeChecker,Pr as event,Zr as forEach,Qt as getBooleanValue,Jt as getSlotComponent,br as h,es as html,os as ifElse,as as ifTrue,qt as isBooleanProp,Yt as isCompElemNode,Br as makeState,cs as model,Ir as onced,me as prop,Vr as query,Wr as queryAll,Es as regComponents,hs as show,Ft as showError,Kt as showTagError,Gt as showTagWarn,$t as showWarn,ds as slot,Hr as state,fs as styles,jr as tag,Fr as throttled,Qe as updateDirective,Kr as watch,ms as when};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compelem",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "A modern, reactive, fast, lightweight and flexible lib for building web components",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -36,7 +36,7 @@
36
36
  "bootstrap-icons": "^1.11.3",
37
37
  "eslint": "9.19.0",
38
38
  "eslint-config-prettier": "^10.0.1",
39
- "myfx": "^1.14.1",
39
+ "myfx": "^1.15.10",
40
40
  "postcss": "^8.4.38",
41
41
  "prettier": "^2.8.3",
42
42
  "rollup-plugin-banner2": "1.2.2",
package/reactive.d.ts CHANGED
@@ -3,7 +3,8 @@
3
3
  * @author holyhigh2
4
4
  */
5
5
  import { CompElem } from "./CompElem";
6
- import { UpdatePoint, Updater } from "./types";
6
+ import { UpdatePoint } from "./render/UpdatePoint";
7
+ import { Updater } from "./types";
7
8
  export declare function getterValue(propertyKey: string, context: CompElem): any;
8
9
  export declare function setterValue(propertyKey: string, v: any, context: CompElem): true | undefined;
9
10
  export declare function emitModelEvent(propertyKey: string, v: any, context: CompElem): void;
@@ -15,11 +16,12 @@ export declare const Collector: {
15
16
  __varPathList: string[];
16
17
  __collecting: boolean;
17
18
  };
19
+ export declare const OBJECT_VAR_ROOT_PATH_IN_CONTEXT: WeakMap<CompElem<any>, Record<string, string>>;
18
20
  export declare const OBJECT_VAR_PATH: WeakMap<any, string[]>;
19
21
  export declare const PROXY_MAP: WeakMap<Record<string, any>, ProxyConstructor>;
20
22
  export declare const EXTRA_CONTEXT_OF_VAR: WeakMap<any, Set<WeakRef<CompElem<any>>>>;
21
23
  export declare function reactive(obj: Record<string, any>, context: CompElem<any>, rootProp?: string): ProxyConstructor;
22
- export declare function notifyUpdate(context: CompElem, oldValue: any, path: string[], subNewValue?: any, subOldValue?: any): void;
24
+ export declare function notifyUpdate(context: CompElem, newValue: any, oldValue: any, path: string[], subNewValue?: any, subOldValue?: any): void;
23
25
  export declare function requestUpdate(context: CompElem<any>, nv: any, ov: any, subChain: string[]): void;
24
26
  export declare class Queue {
25
27
  static nextSet: Set<Updater>;
@@ -23,9 +23,5 @@ export declare class Template {
23
23
  */
24
24
  insert(position: number, tmpl: Template): this;
25
25
  getHTML(comp: CompElem): string;
26
- /**
27
- * 对var中的Template类型进行合并
28
- */
29
- flatVars(comp: CompElem): any[];
30
26
  destroy(): void;
31
27
  }
@@ -0,0 +1,13 @@
1
+ import { CompElem } from "../CompElem";
2
+ import { Template } from "./Template";
3
+ import { UpdatePointMeta } from "./UpdatePointMeta";
4
+ /**
5
+ * 视图模板元信息
6
+ * @author holyhigh2
7
+ */
8
+ export declare class TemplateMeta {
9
+ updatePointMetas: Array<UpdatePointMeta>;
10
+ fragment: DocumentFragment;
11
+ constructor(tmpl: Template, component: CompElem<any>, vars?: any[]);
12
+ parseTemplate(tmpl: Template): [string, any[]];
13
+ }
@@ -0,0 +1,20 @@
1
+ import { CompElem } from "../CompElem";
2
+ import { UpdatePointMeta } from "./UpdatePointMeta";
3
+ /**
4
+ * 视图更新点
5
+ */
6
+ export declare class UpdatePoint {
7
+ metaInfo: UpdatePointMeta;
8
+ key: string;
9
+ varIndex: number;
10
+ value: any;
11
+ node: WeakRef<Node>;
12
+ subViewRootNodes: Record<string, WeakRef<any>[]> | WeakRef<any>[];
13
+ __destroyed: boolean;
14
+ children: UpdatePoint[] | null;
15
+ parent: UpdatePoint | null;
16
+ constructor(varIndex: number);
17
+ static createFrom(upm: UpdatePointMeta): UpdatePoint;
18
+ destroy(contextComponent?: CompElem<any>): void;
19
+ insert(up: UpdatePoint): void;
20
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 视图更新点元数据
3
+ */
4
+ export declare class UpdatePointMeta {
5
+ varIndex: number;
6
+ attrName: string;
7
+ attrTmpl: string;
8
+ isText: boolean;
9
+ isDirective: boolean;
10
+ directiveType: string;
11
+ directiveVarChain: string[];
12
+ isProp: boolean;
13
+ isPropPerfix: boolean;
14
+ isToggleProp: boolean;
15
+ isPlaceholder: boolean;
16
+ isEvent: boolean;
17
+ isRef: boolean;
18
+ isKey: boolean;
19
+ isRefAttr: boolean;
20
+ isComponent: boolean;
21
+ isSlot: boolean;
22
+ nodeSn: number;
23
+ slotNodeSn: number;
24
+ constructor(varIndex: number);
25
+ }
@@ -1,35 +1,37 @@
1
1
  import { CompElem } from "../CompElem";
2
- import { UpdatedSource, UpdatePoint } from "../types";
2
+ import { KeyFn, TplFn, UpdatedSource } from "../types";
3
3
  import { Template } from "./Template";
4
+ import { TemplateMeta } from "./TemplateMeta";
5
+ import { UpdatePoint } from "./UpdatePoint";
6
+ import { UpdatePointMeta } from "./UpdatePointMeta";
4
7
  export declare const ATTR_PREFIX_EVENT = "@";
5
8
  export declare const ATTR_PREFIX_PROP = ".";
6
9
  export declare const ATTR_PREFIX_BOOLEAN = "?";
7
10
  export declare const ATTR_PREFIX_REF = "*";
8
11
  export declare const ATTR_PROP_DELIMITER = ":";
9
12
  export declare const ATTR_REF = "ref";
10
- export declare const ATTR_KEY = "key";
11
13
  /**
12
14
  * 提供渲染函数相关操作
13
15
  * @author holyhigh2
14
16
  */
15
- export declare function buildHTML(component: CompElem, tmpl: Template): [string, any[]];
16
17
  export declare function convertHTML(html: string): string;
17
- export declare const PLACEHOLDER_EXP: RegExp;
18
+ export declare function buildVars(tmpl: Template): any[];
18
19
  /**
19
- * 构建模板为DOM结构
20
+ * 构建模板DOM
20
21
  * @param html
21
22
  */
22
- export declare function buildTmplate(updatePoints: Array<UpdatePoint>, html: string, vars: any[], renderComponent: CompElem): NodeListOf<ChildNode>;
23
- export declare function buildView(tmpl: Template, component: CompElem<any>): NodeListOf<ChildNode>;
24
- export declare function buildSubView(pointNode: Comment, tmpl: Template, component: CompElem<any>, po: UpdatePoint, bindEvent?: boolean): NodeListOf<ChildNode>;
25
- export declare function updateView(tmpl: Template, renderComponent: CompElem<any>, updatePoints: UpdatePoint[], renderedUps?: Set<UpdatePoint>, changed?: Record<string, UpdatedSource>): void;
23
+ export declare function createTemplate(updatePoints: Array<UpdatePointMeta>, html: string, vars: any[], renderComponent: CompElem): DocumentFragment;
24
+ export declare function renderTemplate(component: CompElem<any>, fragment: DocumentFragment, updatePointMetas: UpdatePointMeta[], vars: any[]): [DocumentFragment, UpdatePoint[]];
25
+ export declare function buildView(tmpl: Template, component: CompElem<any>): DocumentFragment;
26
+ export declare function insertSubView(node: Node, point: UpdatePoint, tmplFn: TplFn, tmplM: TemplateMeta, component: CompElem<any>, valueAry?: any[], keyFn?: KeyFn): void;
27
+ export declare function updateView(vars: any[], renderComponent: CompElem<any>, updatePoints: UpdatePoint[], renderedUps?: Set<UpdatePoint>, changed?: Record<string, UpdatedSource>): void;
26
28
  export declare function updateSubScopeView(subScopeUpdatePoint: UpdatePoint, renderComponent: CompElem<any>, tmpl?: Template, updatedMap?: Record<string, UpdatedSource>): void;
27
29
  /**
28
- * 标签函数,用于构建模板
30
+ * HTML模板函数,用于构建模板
29
31
  * @param strings
30
32
  * @param vars
31
33
  */
32
- export declare function html(strings: TemplateStringsArray, ...vars: any): Template;
34
+ export declare function h(strings: TemplateStringsArray, ...vars: any): Template;
33
35
  declare class RefObject<T extends Node> {
34
36
  __ref: WeakRef<T> | undefined;
35
37
  get current(): T | undefined;
package/types.d.ts CHANGED
@@ -13,7 +13,8 @@ export type SlotOptions = {
13
13
  props: Record<string, any>;
14
14
  hook: Function;
15
15
  };
16
- export type TmplFn = (...args: any[]) => Template;
16
+ export type TplFn = (...args: any[]) => Template;
17
+ export type KeyFn = (item: any, k: string | number, i: number) => string | number;
17
18
  export type UpdatedSource = {
18
19
  value: any;
19
20
  chain?: string[];
@@ -29,8 +30,6 @@ export declare enum EnterPointType {
29
30
  ATTR = "attr",//属性,文本内容,可以内嵌多插值
30
31
  PROP = "prop",//参数,智能内嵌一个插值
31
32
  TEXT = "text",
32
- CLASS = "class",
33
- STYLE = "style",
34
33
  SLOT = "slot",
35
34
  TAG = "tag"
36
35
  }
@@ -131,53 +130,29 @@ export type PropOption = {
131
130
  isValid?: (value: any, props?: Record<string, any>) => boolean;
132
131
  };
133
132
  export type DirectiveExecutor = (node: Node, newArgs: any[], oldArgs: any[] | undefined, meta?: {
133
+ pointType?: string;
134
134
  renderComponent?: CompElem;
135
135
  slotComponent?: CompElem;
136
136
  varChain?: string[];
137
137
  attrName?: string;
138
138
  updatedMap?: Record<string, UpdatedSource>;
139
- }) => [DirectiveUpdateTag, Template?] | void;
139
+ }) => [DirectiveUpdateTag, ...any] | void;
140
140
  export type DirectiveInstance = [
141
- symbol,
142
- Array<any>,
143
141
  DirectiveExecutor,
144
- (scopeType: string, tagName: string) => void,
142
+ Array<any>,
143
+ Function,
145
144
  any[]
146
145
  ];
147
146
  export declare enum DirectiveUpdateTag {
148
147
  NONE = "NONE",//框架不处理
148
+ REFRESH = "REFRESH",//刷新视图
149
149
  REMOVE = "REMOVE",//删除指令创建的节点
150
150
  REPLACE = "REPLACE",//删除已有节点后插入
151
151
  UPDATE = "UPDATE",//对比更新
152
- APPEND = "APPEND"
152
+ INIT = "INIT"
153
153
  }
154
154
  export type DefaultProps = Partial<{
155
155
  css: Array<string | CSSStyleSheet>;
156
156
  global: Record<string, any>;
157
157
  [key: string]: Record<string, any>;
158
158
  }>;
159
- /**
160
- * 视图更新点
161
- */
162
- export declare class UpdatePoint {
163
- key: string;
164
- varIndex: number;
165
- value: any;
166
- node: WeakRef<Node>;
167
- attrName: string;
168
- attrTmpl: string;
169
- isText: boolean;
170
- isDirective: boolean;
171
- isComponent: boolean;
172
- isProp: boolean;
173
- isToggleProp: boolean;
174
- isPlaceholder: boolean;
175
- __destroyed: boolean;
176
- directiveOldValue: Array<any> | null;
177
- children: UpdatePoint[] | null;
178
- parent: UpdatePoint | null;
179
- constructor(varIndex: number, node?: WeakRef<Node>, attrName?: string, attrTmpl?: string);
180
- static createFrom(up: UpdatePoint): UpdatePoint;
181
- destroy(contextComponent?: CompElem<any>): void;
182
- insert(up: UpdatePoint): void;
183
- }
package/utils.d.ts CHANGED
@@ -14,3 +14,5 @@ export declare const DomUtil: {
14
14
  clear(container: Element, comp: CompElem): void;
15
15
  };
16
16
  export declare function getSlotComponent(node: Node, renderComponent: CompElem): any;
17
+ export declare function isCompElemNode(node: Element): boolean;
18
+ export declare function addUninitializedSubComponentProp(wrapperComponent: CompElem, node: Element, props: Record<string, any>): void;
@@ -1,5 +0,0 @@
1
- /**
2
- * 向指定文本位置插入指定HTML内容
3
- * @param htmlStr html内容
4
- */
5
- export declare const htmlC: (htmlStr?: string | undefined) => import("../types").DirectiveInstance;
@@ -1,6 +0,0 @@
1
- /**
2
- * 向元素中插入指定HTML内容
3
- * 注意,应用该指令的元素内部不应再出现表达式,否则会导致异常显示
4
- * @param htmlStr html内容
5
- */
6
- export declare const htmlD: (htmlStr?: string | undefined) => import("../types").DirectiveInstance;