j-templates 5.0.48 → 5.0.49
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/Node/componentNode.js +11 -6
- package/Node/elementNode.js +2 -8
- package/Node/nodeRef.d.ts +1 -1
- package/Node/nodeRef.js +7 -3
- package/jTemplates.js +20 -17
- package/jTemplates.js.map +1 -1
- package/package.json +1 -1
package/Node/componentNode.js
CHANGED
|
@@ -8,6 +8,7 @@ const component_1 = require("./component");
|
|
|
8
8
|
const injector_1 = require("../Utils/injector");
|
|
9
9
|
const decorators_1 = require("../Utils/decorators");
|
|
10
10
|
const thread_1 = require("../Utils/thread");
|
|
11
|
+
const list_1 = require("../Utils/list");
|
|
11
12
|
var ComponentNode;
|
|
12
13
|
(function (ComponentNode) {
|
|
13
14
|
function Fire(event, data) {
|
|
@@ -55,7 +56,7 @@ function AddPreReqTemplate(node) {
|
|
|
55
56
|
(0, thread_1.Schedule)(function () {
|
|
56
57
|
if (node.destroyed)
|
|
57
58
|
return;
|
|
58
|
-
nodeRef_1.NodeRef.InitAll(preNodes);
|
|
59
|
+
nodeRef_1.NodeRef.InitAll(node, preNodes);
|
|
59
60
|
});
|
|
60
61
|
(0, thread_1.Thread)(function () {
|
|
61
62
|
if (node.destroyed)
|
|
@@ -91,20 +92,24 @@ function AddTemplate(node, init) {
|
|
|
91
92
|
return;
|
|
92
93
|
const nodes = injector_1.Injector.Scope(node.injector, InvokeNodeTemplate, node);
|
|
93
94
|
(0, thread_1.Schedule)(function () {
|
|
94
|
-
nodeRef_1.NodeRef.InitAll(nodes);
|
|
95
|
+
nodeRef_1.NodeRef.InitAll(node, nodes);
|
|
95
96
|
});
|
|
96
97
|
(0, thread_1.Thread)(function () {
|
|
97
98
|
if (node.destroyed)
|
|
98
99
|
return;
|
|
100
|
+
const list = list_1.List.Create();
|
|
101
|
+
list_1.List.Add(list, {
|
|
102
|
+
value: undefined,
|
|
103
|
+
init: true,
|
|
104
|
+
nodes
|
|
105
|
+
});
|
|
99
106
|
if (init)
|
|
100
|
-
|
|
101
|
-
nodeRef_1.NodeRef.AddChild(node, nodes[x]);
|
|
107
|
+
nodeRef_1.NodeRef.ReconcileChildren(node, list);
|
|
102
108
|
else
|
|
103
109
|
nodeConfig_1.NodeConfig.scheduleUpdate(function () {
|
|
104
110
|
if (node.destroyed)
|
|
105
111
|
return;
|
|
106
|
-
|
|
107
|
-
nodeRef_1.NodeRef.AddChild(node, nodes[x]);
|
|
112
|
+
nodeRef_1.NodeRef.ReconcileChildren(node, list);
|
|
108
113
|
});
|
|
109
114
|
});
|
|
110
115
|
if (node.component.Bound !== component_1.Component.prototype.Bound)
|
package/Node/elementNode.js
CHANGED
|
@@ -63,7 +63,7 @@ function SetDefaultData(node) {
|
|
|
63
63
|
(0, thread_1.Synch)(function () {
|
|
64
64
|
const nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, true);
|
|
65
65
|
if (nodes.length > 0) {
|
|
66
|
-
nodeRef_1.NodeRef.InitAll(nodes);
|
|
66
|
+
nodeRef_1.NodeRef.InitAll(node, nodes);
|
|
67
67
|
(0, thread_1.Thread)(function () {
|
|
68
68
|
if (node.destroyed)
|
|
69
69
|
return;
|
|
@@ -119,7 +119,7 @@ function ReconcileNodeData(node, values) {
|
|
|
119
119
|
(0, thread_1.Schedule)(function () {
|
|
120
120
|
if (node.destroyed || nextNodeList.size === 0)
|
|
121
121
|
return;
|
|
122
|
-
nodeRef_1.NodeRef.InitAll(data.nodes);
|
|
122
|
+
nodeRef_1.NodeRef.InitAll(node, data.nodes);
|
|
123
123
|
data.init = true;
|
|
124
124
|
});
|
|
125
125
|
curNode = curNode.next;
|
|
@@ -134,12 +134,6 @@ function ReconcileNodeData(node, values) {
|
|
|
134
134
|
}
|
|
135
135
|
list_1.List.Clear(currentNodeList);
|
|
136
136
|
}
|
|
137
|
-
let curAttach = nextNodeList.head;
|
|
138
|
-
while (curAttach) {
|
|
139
|
-
for (let x = 0; x < curAttach.data.nodes.length; x++)
|
|
140
|
-
node.childNodes.add(curAttach.data.nodes[x]);
|
|
141
|
-
curAttach = curAttach.next;
|
|
142
|
-
}
|
|
143
137
|
node.nodeList = nextNodeList;
|
|
144
138
|
}
|
|
145
139
|
function SetData(node, values, init = false) {
|
package/Node/nodeRef.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare namespace NodeRef {
|
|
|
13
13
|
function Wrap(node: any): INodeRef;
|
|
14
14
|
function Create(nodeType: any, namespace: string, type: NodeRefType): INodeRef | IBoundNode | IElementNode<any> | IComponentNode<any, any, any>;
|
|
15
15
|
function Init(nodeRef: NodeRefTypes): void;
|
|
16
|
-
function InitAll(nodeRefs: Array<NodeRefTypes>): void;
|
|
16
|
+
function InitAll(parentNode: NodeRefTypes, nodeRefs: Array<NodeRefTypes>): void;
|
|
17
17
|
function AddChild(node: INodeRefBase, child: INodeRefBase): void;
|
|
18
18
|
function AddChildAfter(node: INodeRefBase, currentChild: INodeRefBase, newChild: INodeRefBase): void;
|
|
19
19
|
function ReconcileChildren(node: INodeRefBase, nextChildren: IList<IElementDataNode<unknown>>): void;
|
package/Node/nodeRef.js
CHANGED
|
@@ -113,9 +113,12 @@ var NodeRef;
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
NodeRef.Init = Init;
|
|
116
|
-
function InitAll(nodeRefs) {
|
|
117
|
-
for (var x = 0; x < nodeRefs.length; x++)
|
|
116
|
+
function InitAll(parentNode, nodeRefs) {
|
|
117
|
+
for (var x = 0; x < nodeRefs.length; x++) {
|
|
118
|
+
nodeRefs[x].parent = parentNode;
|
|
119
|
+
parentNode.childNodes.add(nodeRefs[x]);
|
|
118
120
|
Init(nodeRefs[x]);
|
|
121
|
+
}
|
|
119
122
|
}
|
|
120
123
|
NodeRef.InitAll = InitAll;
|
|
121
124
|
function AddChild(node, child) {
|
|
@@ -143,7 +146,8 @@ var NodeRef;
|
|
|
143
146
|
while (curDataNode) {
|
|
144
147
|
for (let x = 0; x < curDataNode.data.nodes.length; x++) {
|
|
145
148
|
const actualNode = priorNode ? nodeConfig_1.NodeConfig.getNextSibling(priorNode) : nodeConfig_1.NodeConfig.getFirstChild(rootNode);
|
|
146
|
-
const
|
|
149
|
+
const virtualNode = curDataNode.data.nodes[x];
|
|
150
|
+
const expectedNode = virtualNode.node;
|
|
147
151
|
if (actualNode !== expectedNode) {
|
|
148
152
|
nodeConfig_1.NodeConfig.addChildBefore(rootNode, actualNode, expectedNode);
|
|
149
153
|
}
|
package/jTemplates.js
CHANGED
|
@@ -551,6 +551,7 @@ const component_1 = __webpack_require__(/*! ./component */ "./src/Node/component
|
|
|
551
551
|
const injector_1 = __webpack_require__(/*! ../Utils/injector */ "./src/Utils/injector.ts");
|
|
552
552
|
const decorators_1 = __webpack_require__(/*! ../Utils/decorators */ "./src/Utils/decorators.ts");
|
|
553
553
|
const thread_1 = __webpack_require__(/*! ../Utils/thread */ "./src/Utils/thread.ts");
|
|
554
|
+
const list_1 = __webpack_require__(/*! ../Utils/list */ "./src/Utils/list.ts");
|
|
554
555
|
var ComponentNode;
|
|
555
556
|
(function (ComponentNode) {
|
|
556
557
|
function Fire(event, data) {
|
|
@@ -598,7 +599,7 @@ function AddPreReqTemplate(node) {
|
|
|
598
599
|
(0, thread_1.Schedule)(function () {
|
|
599
600
|
if (node.destroyed)
|
|
600
601
|
return;
|
|
601
|
-
nodeRef_1.NodeRef.InitAll(preNodes);
|
|
602
|
+
nodeRef_1.NodeRef.InitAll(node, preNodes);
|
|
602
603
|
});
|
|
603
604
|
(0, thread_1.Thread)(function () {
|
|
604
605
|
if (node.destroyed)
|
|
@@ -634,20 +635,24 @@ function AddTemplate(node, init) {
|
|
|
634
635
|
return;
|
|
635
636
|
const nodes = injector_1.Injector.Scope(node.injector, InvokeNodeTemplate, node);
|
|
636
637
|
(0, thread_1.Schedule)(function () {
|
|
637
|
-
nodeRef_1.NodeRef.InitAll(nodes);
|
|
638
|
+
nodeRef_1.NodeRef.InitAll(node, nodes);
|
|
638
639
|
});
|
|
639
640
|
(0, thread_1.Thread)(function () {
|
|
640
641
|
if (node.destroyed)
|
|
641
642
|
return;
|
|
643
|
+
const list = list_1.List.Create();
|
|
644
|
+
list_1.List.Add(list, {
|
|
645
|
+
value: undefined,
|
|
646
|
+
init: true,
|
|
647
|
+
nodes
|
|
648
|
+
});
|
|
642
649
|
if (init)
|
|
643
|
-
|
|
644
|
-
nodeRef_1.NodeRef.AddChild(node, nodes[x]);
|
|
650
|
+
nodeRef_1.NodeRef.ReconcileChildren(node, list);
|
|
645
651
|
else
|
|
646
652
|
nodeConfig_1.NodeConfig.scheduleUpdate(function () {
|
|
647
653
|
if (node.destroyed)
|
|
648
654
|
return;
|
|
649
|
-
|
|
650
|
-
nodeRef_1.NodeRef.AddChild(node, nodes[x]);
|
|
655
|
+
nodeRef_1.NodeRef.ReconcileChildren(node, list);
|
|
651
656
|
});
|
|
652
657
|
});
|
|
653
658
|
if (node.component.Bound !== component_1.Component.prototype.Bound)
|
|
@@ -731,7 +736,7 @@ function SetDefaultData(node) {
|
|
|
731
736
|
(0, thread_1.Synch)(function () {
|
|
732
737
|
const nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, true);
|
|
733
738
|
if (nodes.length > 0) {
|
|
734
|
-
nodeRef_1.NodeRef.InitAll(nodes);
|
|
739
|
+
nodeRef_1.NodeRef.InitAll(node, nodes);
|
|
735
740
|
(0, thread_1.Thread)(function () {
|
|
736
741
|
if (node.destroyed)
|
|
737
742
|
return;
|
|
@@ -787,7 +792,7 @@ function ReconcileNodeData(node, values) {
|
|
|
787
792
|
(0, thread_1.Schedule)(function () {
|
|
788
793
|
if (node.destroyed || nextNodeList.size === 0)
|
|
789
794
|
return;
|
|
790
|
-
nodeRef_1.NodeRef.InitAll(data.nodes);
|
|
795
|
+
nodeRef_1.NodeRef.InitAll(node, data.nodes);
|
|
791
796
|
data.init = true;
|
|
792
797
|
});
|
|
793
798
|
curNode = curNode.next;
|
|
@@ -802,12 +807,6 @@ function ReconcileNodeData(node, values) {
|
|
|
802
807
|
}
|
|
803
808
|
list_1.List.Clear(currentNodeList);
|
|
804
809
|
}
|
|
805
|
-
let curAttach = nextNodeList.head;
|
|
806
|
-
while (curAttach) {
|
|
807
|
-
for (let x = 0; x < curAttach.data.nodes.length; x++)
|
|
808
|
-
node.childNodes.add(curAttach.data.nodes[x]);
|
|
809
|
-
curAttach = curAttach.next;
|
|
810
|
-
}
|
|
811
810
|
node.nodeList = nextNodeList;
|
|
812
811
|
}
|
|
813
812
|
function SetData(node, values, init = false) {
|
|
@@ -983,9 +982,12 @@ var NodeRef;
|
|
|
983
982
|
}
|
|
984
983
|
}
|
|
985
984
|
NodeRef.Init = Init;
|
|
986
|
-
function InitAll(nodeRefs) {
|
|
987
|
-
for (var x = 0; x < nodeRefs.length; x++)
|
|
985
|
+
function InitAll(parentNode, nodeRefs) {
|
|
986
|
+
for (var x = 0; x < nodeRefs.length; x++) {
|
|
987
|
+
nodeRefs[x].parent = parentNode;
|
|
988
|
+
parentNode.childNodes.add(nodeRefs[x]);
|
|
988
989
|
Init(nodeRefs[x]);
|
|
990
|
+
}
|
|
989
991
|
}
|
|
990
992
|
NodeRef.InitAll = InitAll;
|
|
991
993
|
function AddChild(node, child) {
|
|
@@ -1013,7 +1015,8 @@ var NodeRef;
|
|
|
1013
1015
|
while (curDataNode) {
|
|
1014
1016
|
for (let x = 0; x < curDataNode.data.nodes.length; x++) {
|
|
1015
1017
|
const actualNode = priorNode ? nodeConfig_1.NodeConfig.getNextSibling(priorNode) : nodeConfig_1.NodeConfig.getFirstChild(rootNode);
|
|
1016
|
-
const
|
|
1018
|
+
const virtualNode = curDataNode.data.nodes[x];
|
|
1019
|
+
const expectedNode = virtualNode.node;
|
|
1017
1020
|
if (actualNode !== expectedNode) {
|
|
1018
1021
|
nodeConfig_1.NodeConfig.addChildBefore(rootNode, actualNode, expectedNode);
|
|
1019
1022
|
}
|
package/jTemplates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jTemplates.js","mappings":";;;;;;;;;;AAAa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB,iBAAiB,mBAAO,CAAC,qCAAU;AACnC,eAAe,mBAAO,CAAC,0CAAe;AACtC,gBAAgB,mBAAO,CAAC,mCAAS;AACjC,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;;;;;;;;;;;AC1Fa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW;AACrU,sBAAsB,mBAAO,CAAC,sDAAqB;AACnD;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;;;;;;;;;;;AC/FG;AACb;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,yCAAY;AACjC,aAAa,mBAAO,CAAC,+CAAe;AACpC,aAAa,mBAAO,CAAC,mCAAS;;;;;;;;;;;AClBjB;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc,GAAG,SAAS,GAAG,WAAW;AACxC,sBAAsB,mBAAO,CAAC,sDAAqB;AACnD;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,cAAc;;;;;;;;;;;AChBD;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;;;;;;;;;;AC9CR;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ,YAAY,kDAAkD,oIAAsB;;;;;;;;;;;ACHvE;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,0CAA0C;AACxH;AACA;AACA;AACA;AACA;AACA,8EAA8E,0CAA0C;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA,aAAa;AACb,8EAA8E,sCAAsC;AACpH;AACA;AACA;AACA;AACA,CAAC,gBAAgB,iBAAiB,iBAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AClGa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,kBAAkB,mBAAO,CAAC,wCAAW;AACrC,wBAAwB,mBAAO,CAAC,oDAAiB;AACjD,qBAAqB,mBAAO,CAAC,sDAAqB;AAClD,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,KAAK;AACrD;AACA;AACA;AACA,uDAAuD,cAAc;AACrE,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gBAAgB,iBAAiB,iBAAiB;;;;;;;;;;;AC/EtC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,kBAAkB,mBAAO,CAAC,wCAAW;AACrC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,qBAAqB,mBAAO,CAAC,sDAAqB;AAClD,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oBAAoB,qBAAqB,qBAAqB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA,oCAAoC,qBAAqB;AACzD;AACA;AACA;AACA;AACA,wCAAwC,qBAAqB;AAC7D;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,gCAAgC,kBAAkB;AAClD;AACA;AACA;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA,iBAAiB;AACjB,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb,KAAK;AACL;;;;;;;;;;;AClHa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,eAAe,mBAAO,CAAC,0CAAe;AACtC,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,kBAAkB,mBAAO,CAAC,wCAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kBAAkB,mBAAmB,mBAAmB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iCAAiC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iCAAiC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AChLa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,wBAAwB,mBAAO,CAAC,wDAAsB;AACtD,kBAAkB;;;;;;;;;;;ACJL;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe,GAAG,mBAAmB;AACrC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,sBAAsB,mBAAO,CAAC,gDAAe;AAC7C,wBAAwB,mBAAO,CAAC,oDAAiB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kBAAkB,mBAAmB,mBAAmB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mCAAmC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA,CAAC,cAAc,eAAe,eAAe;;;;;;;;;;;ACrLhC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,gDAAY;AACvC,sBAAsB,mBAAO,CAAC,sDAAe;AAC7C,qBAAqB,mBAAO,CAAC,oDAAc;AAC3C;AACA;AACA;AACA;AACA;AACA,gCAAgC,mDAAmD;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,8CAA8C;AAC3F;AACA;AACA,6CAA6C,wCAAwC;AACrF;AACA;AACA,sCAAsC,gDAAgD;AACtF;AACA;AACA,6CAA6C,sCAAsC;AACnF;AACA;AACA;AACA;AACA;AACA,iBAAiB;;;;;;;;;;;ACnCJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,gDAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;;;;;;;;;;AC1BH;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,oBAAoB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,KAAK;AACrC;AACA,aAAa;AACb;AACA,4BAA4B,qBAAqB;AACjD,4CAA4C,KAAK,GAAG,EAAE,OAAO,EAAE;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,KAAK,GAAG,qBAAqB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,KAAK,GAAG,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,IAAI;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;;;;;;;;;;ACvOR;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,mBAAmB,mBAAO,CAAC,gDAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,yBAAyB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,iBAAiB,kBAAkB,kBAAkB;;;;;;;;;;;AClBzC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,eAAe,mBAAO,CAAC,6CAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,mBAAmB;;;;;;;;;;;AClCN;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa;AACb,yBAAyB,mBAAO,CAAC,kEAAwB;AACzD,sBAAsB,mBAAO,CAAC,uDAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;;;;;;;;;;AC9BA;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,yBAAyB,mBAAO,CAAC,kEAAwB;AACzD,oBAAoB,mBAAO,CAAC,wDAAmB;AAC/C,2BAA2B,mBAAO,CAAC,iEAAoB;AACvD,qBAAqB,mBAAO,CAAC,yDAAwB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;;;;;;;;;;AChDL;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS,SAAS,GAAG,IAAI,qBAAqB;AACzF;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA,oDAAoD,SAAS,GAAG,OAAO;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;;;;;;;;;;;ACnDX;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,sDAAkB;AAC7C,yBAAyB,mBAAO,CAAC,kEAAwB;AACzD,0BAA0B,mBAAO,CAAC,+DAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;;;;;;;;;;AChCJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS,SAAS,GAAG,IAAI,qBAAqB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,SAAS,GAAG,OAAO;AACvD,qCAAqC,SAAS,GAAG,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;;;;;;;;;;;ACxCV;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS,GAAG,IAAI;AACzD;AACA;AACA;AACA,qCAAqC,SAAS,GAAG,cAAc;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;;;;;;;;;;;AC7BN;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,uBAAuB,GAAG,8BAA8B,GAAG,4BAA4B;AACvF,kBAAkB,mBAAO,CAAC,mDAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB,uBAAuB,uBAAuB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;;;;ACvKa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,sBAAsB;AACtB,0BAA0B,mBAAO,CAAC,oEAAyB;AAC3D;AACA;AACA;AACA;AACA;AACA,CAAC,oBAAoB;AACrB,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,mBAAmB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sDAAsD;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC,oCAAoC,KAAK,GAAG,QAAQ;AACpD;AACA;AACA;AACA,sBAAsB;;;;;;;;;;;ACxOT;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,uBAAuB,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,aAAa;AAChF,cAAc,mBAAO,CAAC,iDAAe;AACrC,yCAAwC,EAAE,qCAAqC,yBAAyB,EAAC;AACzG,kBAAkB,mBAAO,CAAC,yDAAmB;AAC7C,6CAA4C,EAAE,qCAAqC,iCAAiC,EAAC;AACrH,mBAAmB,mBAAO,CAAC,2DAAoB;AAC/C,8CAA6C,EAAE,qCAAqC,mCAAmC,EAAC;AACxH,wBAAwB,mBAAO,CAAC,mEAAwB;AACxD,mDAAkD,EAAE,qCAAqC,6CAA6C,EAAC;;;;;;;;;;;ACV1H;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,qBAAqB;AACzC;AACA;AACA;AACA;AACA,kCAAkC,WAAW;AAC7C;AACA;AACA;AACA;AACA;AACA,kCAAkC,WAAW;AAC7C;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACA;AACA,CAAC,oBAAoB,qBAAqB,qBAAqB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mCAAmC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB;;;;;;;;;;;AC3GJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,mCAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;;;;;;;;;;ACzCL;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc,GAAG,sBAAsB,GAAG,eAAe,GAAG,cAAc,GAAG,qBAAqB,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,aAAa,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,aAAa;AACrN,gBAAgB,mBAAO,CAAC,wDAAsB;AAC9C,gBAAgB,mBAAO,CAAC,sCAAU;AAClC,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE,yBAAyB,mBAAO,CAAC,wEAA8B;AAC/D;AACA;AACA;AACA,aAAa;AACb;AACA,sCAAsC,YAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,2CAA2C,YAAY;AACvD,kDAAkD,YAAY;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,qEAAqE,0BAA0B;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,sCAAsC,YAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,sCAAsC,YAAY;AAClD;AACA,qCAAqC,YAAY;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gDAAgD,YAAY;AAC5D,gDAAgD,YAAY;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,gDAAgD,YAAY;AAC5D,gDAAgD,YAAY;AAC5D,0DAA0D,YAAY;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,yEAAyE,gCAAgC;AACzG;AACA;AACA,sCAAsC,gCAAgC;AACtE,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,cAAc,eAAe,eAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,qBAAqB,sBAAsB,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,aAAa,cAAc,cAAc;AAC1C;AACA;AACA;AACA;AACA;;;;;;;;;;;ACrTa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,cAAc,eAAe,eAAe;;;;;;;;;;;ACvBhC;AACb;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,+CAAc;AACnC,aAAa,mBAAO,CAAC,6CAAa;;;;;;;;;;;ACjBrB;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,eAAe,gBAAgB,gBAAgB;;;;;;;;;;;ACrCnC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,WAAW,YAAY,YAAY;;;;;;;;;;;AC7JvB;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,cAAc,GAAG,aAAa,GAAG,gBAAgB,GAAG,aAAa,GAAG,gBAAgB;AAC1G,eAAe,mBAAO,CAAC,mCAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,mBAAmB;;;;;;;;;;;AC3GN;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,kBAAkB,mBAAO,CAAC,iDAAkB;AAC5C,6CAA4C,EAAE,qCAAqC,iCAAiC,EAAC;;;;;;;;;;;ACJxG;AACb;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB,GAAG,aAAa,GAAG,uBAAuB;AAC5D,aAAa,mBAAO,CAAC,+BAAS;AAC9B,aAAa,mBAAO,CAAC,qCAAS;AAC9B,cAAc,mBAAO,CAAC,qCAAS;AAC/B,mDAAkD,EAAE,qCAAqC,mCAAmC,EAAC;AAC7H,yCAAwC,EAAE,qCAAqC,yBAAyB,EAAC;AACzG,8CAA6C,EAAE,qCAAqC,8BAA8B,EAAC;AACnH,aAAa,mBAAO,CAAC,iCAAO;;;;;;;UCvB5B;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;;ACtBa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY,mBAAO,CAAC,yCAAc;AAClC;AACA","sources":["webpack://j-templates/./src/DOM/domNodeConfig.ts","webpack://j-templates/./src/DOM/elements.ts","webpack://j-templates/./src/DOM/index.ts","webpack://j-templates/./src/DOM/svgElements.ts","webpack://j-templates/./src/DOM/utils.ts","webpack://j-templates/./src/DOM/window.ts","webpack://j-templates/./src/Node/boundNode.ts","webpack://j-templates/./src/Node/component.ts","webpack://j-templates/./src/Node/componentNode.ts","webpack://j-templates/./src/Node/elementNode.ts","webpack://j-templates/./src/Node/nodeConfig.ts","webpack://j-templates/./src/Node/nodeRef.ts","webpack://j-templates/./src/Store/Diff/diffAsync.ts","webpack://j-templates/./src/Store/Diff/diffSync.ts","webpack://j-templates/./src/Store/Diff/diffTree.ts","webpack://j-templates/./src/Store/Diff/diffWorker.ts","webpack://j-templates/./src/Store/Diff/workerQueue.ts","webpack://j-templates/./src/Store/Store/store.ts","webpack://j-templates/./src/Store/Store/storeAsync.ts","webpack://j-templates/./src/Store/Store/storeAsyncWriter.ts","webpack://j-templates/./src/Store/Store/storeSync.ts","webpack://j-templates/./src/Store/Store/storeSyncWriter.ts","webpack://j-templates/./src/Store/Store/storeWriter.ts","webpack://j-templates/./src/Store/Tree/observableScope.ts","webpack://j-templates/./src/Store/Tree/observableTree.ts","webpack://j-templates/./src/Store/index.ts","webpack://j-templates/./src/Utils/animation.ts","webpack://j-templates/./src/Utils/asyncQueue.ts","webpack://j-templates/./src/Utils/decorators.ts","webpack://j-templates/./src/Utils/emitter.ts","webpack://j-templates/./src/Utils/index.ts","webpack://j-templates/./src/Utils/injector.ts","webpack://j-templates/./src/Utils/list.ts","webpack://j-templates/./src/Utils/thread.ts","webpack://j-templates/./src/index.ts","webpack://j-templates/./src/web.export.ts","webpack://j-templates/webpack/bootstrap","webpack://j-templates/./src/web.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DOMNodeConfig = void 0;\nconst window_1 = require(\"./window\");\nconst list_1 = require(\"../Utils/list\");\nconst utils_1 = require(\"./utils\");\nconst thread_1 = require(\"../Utils/thread\");\nvar pendingUpdates = list_1.List.Create();\nvar updateScheduled = false;\nfunction processUpdates() {\n list_1.List.Add(pendingUpdates, null);\n var callback;\n while ((callback = list_1.List.Pop(pendingUpdates)))\n (0, thread_1.Synch)(callback);\n if (pendingUpdates.size === 0)\n updateScheduled = false;\n else\n window_1.wndw.requestAnimationFrame(processUpdates);\n}\nexports.DOMNodeConfig = {\n createNode(type, namespace) {\n return type !== \"text\" ?\n namespace ?\n window_1.wndw.document.createElementNS(namespace, type) :\n window_1.wndw.document.createElement(type) :\n window_1.wndw.document.createTextNode(\"\");\n },\n scheduleUpdate(callback) {\n list_1.List.Add(pendingUpdates, callback);\n if (!updateScheduled) {\n updateScheduled = true;\n window_1.wndw.requestAnimationFrame(processUpdates);\n }\n },\n addListener(target, type, callback) {\n target.addEventListener(type, callback);\n },\n removeListener(target, type, callback) {\n target.removeEventListener(type, callback);\n },\n addChild(root, child) {\n root.appendChild(child);\n },\n addChildFirst(root, child) {\n exports.DOMNodeConfig.addChildBefore(root, root.firstChild, child);\n },\n addChildBefore(root, sibling, child) {\n if (!sibling) {\n exports.DOMNodeConfig.addChild(root, child);\n return;\n }\n if (child !== sibling)\n root.insertBefore(child, sibling);\n },\n addChildAfter(root, sibling, child) {\n if (!sibling) {\n exports.DOMNodeConfig.addChildFirst(root, child);\n return;\n }\n exports.DOMNodeConfig.addChildBefore(root, sibling.nextSibling, child);\n },\n removeChild(root, child) {\n root.removeChild(child);\n },\n remove(target) {\n target && target.parentNode && target.parentNode.removeChild(target);\n },\n setText(target, text) {\n target.textContent = text;\n },\n getAttribute(target, attribute) {\n return target.getAttribute(attribute);\n },\n setAttribute(target, attribute, value) {\n target.setAttribute(attribute, value);\n },\n fireEvent(target, event, data) {\n var cEvent = new CustomEvent(event, data);\n target.dispatchEvent(cEvent);\n },\n setProperties: utils_1.SetProperties,\n getFirstChild(target) {\n return target.firstChild;\n },\n getNextSibling(target) {\n return target.nextSibling;\n },\n replaceChildren(target, children) {\n target.replaceChildren(...children);\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.td = exports.tr = exports.th = exports.table = exports.button = exports.style = exports.p = exports.h3 = exports.h2 = exports.h1 = exports.option = exports.select = exports.input = exports.source = exports.video = exports.img = exports.span = exports.b = exports.br = exports.li = exports.ul = exports.a = exports.div = void 0;\nconst elementNode_1 = require(\"../Node/elementNode\");\nfunction div(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"div\", null, nodeDef, children);\n}\nexports.div = div;\nfunction a(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"a\", null, nodeDef, children);\n}\nexports.a = a;\nfunction ul(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"ul\", null, nodeDef, children);\n}\nexports.ul = ul;\nfunction li(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"li\", null, nodeDef, children);\n}\nexports.li = li;\nfunction br(nodeDef) {\n return elementNode_1.ElementNode.Create(\"br\", null, nodeDef, null);\n}\nexports.br = br;\nfunction b(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"b\", null, nodeDef, children);\n}\nexports.b = b;\nfunction span(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"span\", null, nodeDef, children);\n}\nexports.span = span;\nfunction img(nodeDef) {\n return elementNode_1.ElementNode.Create(\"img\", null, nodeDef, null);\n}\nexports.img = img;\nfunction video(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"video\", null, nodeDef, children);\n}\nexports.video = video;\nfunction source(nodeDef) {\n return elementNode_1.ElementNode.Create(\"source\", null, nodeDef, null);\n}\nexports.source = source;\nfunction input(nodeDef) {\n return elementNode_1.ElementNode.Create(\"input\", null, nodeDef, null);\n}\nexports.input = input;\nfunction select(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"select\", null, nodeDef, children);\n}\nexports.select = select;\nfunction option(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"option\", null, nodeDef, children);\n}\nexports.option = option;\nfunction h1(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h1\", null, nodeDef, children);\n}\nexports.h1 = h1;\nfunction h2(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h2\", null, nodeDef, children);\n}\nexports.h2 = h2;\nfunction h3(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h3\", null, nodeDef, children);\n}\nexports.h3 = h3;\nfunction p(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"p\", null, nodeDef, children);\n}\nexports.p = p;\nfunction style(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"style\", null, nodeDef, children);\n}\nexports.style = style;\nfunction button(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"button\", null, nodeDef, children);\n}\nexports.button = button;\nfunction table(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"table\", null, nodeDef, children);\n}\nexports.table = table;\nfunction th(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"th\", null, nodeDef, children);\n}\nexports.th = th;\nfunction tr(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"tr\", null, nodeDef, children);\n}\nexports.tr = tr;\nfunction td(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"td\", null, nodeDef, children);\n}\nexports.td = td;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./elements\"), exports);\n__exportStar(require(\"./svgElements\"), exports);\n__exportStar(require(\"./utils\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.circle = exports.g = exports.svg = void 0;\nconst elementNode_1 = require(\"../Node/elementNode\");\nconst svgNs = \"http://www.w3.org/2000/svg\";\nfunction svg(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"svg\", svgNs, nodeDef, children);\n}\nexports.svg = svg;\nfunction g(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"g\", svgNs, nodeDef, children);\n}\nexports.g = g;\nfunction circle(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"circle\", svgNs, nodeDef, children);\n}\nexports.circle = circle;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SetProperties = void 0;\nfunction SetValue(target, value) {\n switch (target.nodeName) {\n case \"INPUT\":\n var start = target.selectionStart;\n var end = target.selectionEnd;\n target.value = value;\n if (target.ownerDocument.activeElement === target)\n target.setSelectionRange(start, end);\n break;\n default:\n target.value = value;\n }\n}\nfunction SetStyle(target, styleDef, lastStyleDef) {\n for (var key in styleDef)\n if (!lastStyleDef || lastStyleDef[key] !== styleDef[key])\n target.style[key] = styleDef[key];\n}\nfunction SetRootProperty(target, prop, value, lastValue) {\n switch (prop) {\n case \"value\":\n SetValue(target, value);\n break;\n case \"style\":\n SetStyle(target, value, lastValue);\n break;\n default:\n target[prop] = value;\n }\n}\nfunction SetChangedProperties(target, lastProperties, properties) {\n const keys = Object.keys(properties);\n for (let x = 0; x < keys.length; x++) {\n if (!lastProperties || lastProperties[keys[x]] !== properties[keys[x]])\n SetRootProperty(target, keys[x], properties[keys[x]], lastProperties && lastProperties[keys[x]]);\n }\n}\nfunction SetProperties(target, lastProperties, properties) {\n if (!lastProperties && target.nodeType === Node.TEXT_NODE)\n target.nodeValue = properties.nodeValue;\n else\n SetChangedProperties(target, lastProperties, properties);\n}\nexports.SetProperties = SetProperties;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wndw = void 0;\nexports.wndw = typeof window !== \"undefined\" ? window : (new (require(\"jsdom\").JSDOM(\"\")).window);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BoundNode = void 0;\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nvar BoundNode;\n(function (BoundNode) {\n function Init(boundNode) {\n const nodeDef = boundNode.nodeDef;\n if (nodeDef.props) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.props);\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetProperties(boundNode, scope); });\n SetProperties(boundNode, observableScope_1.ObservableScope.Value(scope));\n }\n if (nodeDef.attrs) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.attrs);\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetAttributes(boundNode, scope); });\n SetAttributes(boundNode, observableScope_1.ObservableScope.Value(scope));\n }\n if (nodeDef.on) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.on);\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\n boundNode.destroyables.push({\n Destroy() {\n SetEvents(boundNode, {});\n }\n });\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetEvents(boundNode, scope); });\n SetEvents(boundNode, observableScope_1.ObservableScope.Value(scope));\n }\n }\n BoundNode.Init = Init;\n})(BoundNode || (exports.BoundNode = BoundNode = {}));\nfunction CreateScopeDestroyable(scope) {\n return {\n Destroy() {\n observableScope_1.ObservableScope.Destroy(scope);\n }\n };\n}\nfunction ScheduleSetProperties(node, scope) {\n if (node.setProperties)\n return;\n node.setProperties = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setProperties = false;\n if (node.destroyed)\n return;\n SetProperties(node, observableScope_1.ObservableScope.Value(scope));\n });\n}\nfunction SetProperties(node, properties) {\n if (!properties)\n return;\n nodeConfig_1.NodeConfig.setProperties(node.node, node.lastProperties, properties);\n node.lastProperties = properties;\n}\nfunction ScheduleSetAttributes(node, scope) {\n if (node.setAttributes)\n return;\n node.setAttributes = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setAttributes = false;\n if (node.destroyed)\n return;\n SetAttributes(node, observableScope_1.ObservableScope.Value(scope));\n });\n}\nfunction SetAttributes(node, attributes) {\n if (!attributes)\n return;\n for (var key in attributes) {\n var val = nodeConfig_1.NodeConfig.getAttribute(node.node, key);\n if (val !== attributes[key])\n nodeConfig_1.NodeConfig.setAttribute(node.node, key, attributes[key]);\n }\n}\nfunction ScheduleSetEvents(node, scope) {\n if (node.setEvents)\n return;\n node.setEvents = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setEvents = false;\n if (node.destroyed)\n return;\n SetEvents(node, observableScope_1.ObservableScope.Value(scope));\n });\n}\nfunction SetEvents(node, events) {\n if (!events)\n return;\n for (var key in node.lastEvents)\n nodeConfig_1.NodeConfig.removeListener(node.node, key, node.lastEvents[key]);\n for (var key in events)\n nodeConfig_1.NodeConfig.addListener(node.node, key, events[key]);\n node.lastEvents = events;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nconst nodeRef_1 = require(\"./nodeRef\");\nconst componentNode_1 = require(\"./componentNode\");\nconst decorators_1 = require(\"../Utils/decorators\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nclass Component {\n nodeRef;\n componentEvents;\n scope;\n templates;\n decoratorMap;\n get Injector() {\n return this.nodeRef.injector;\n }\n get Destroyed() {\n return this.nodeRef.destroyed;\n }\n get DecoratorMap() {\n return this.decoratorMap;\n }\n get Scope() {\n return this.scope;\n }\n get Data() {\n return this.scope.Value;\n }\n get NodeRef() {\n return this.nodeRef;\n }\n get Templates() {\n return this.templates;\n }\n constructor(data, templates, nodeRef, componentEvents) {\n this.nodeRef = nodeRef;\n this.componentEvents = componentEvents;\n this.scope = new observableScope_1.ObservableScope(data);\n this.templates = templates || {};\n this.decoratorMap = new Map();\n }\n Template() {\n return [];\n }\n Bound() {\n }\n Fire(event, data) {\n var eventCallback = this.componentEvents && this.componentEvents[event];\n eventCallback && eventCallback(data);\n }\n Destroy() {\n decorators_1.Destroy.All(this);\n }\n}\nexports.Component = Component;\n(function (Component) {\n function ToFunction(type, namespace, constructor) {\n return componentNode_1.ComponentNode.ToFunction(type, namespace, constructor);\n }\n Component.ToFunction = ToFunction;\n function Register(name, constructor) {\n const componentFunction = ToFunction(`${name}-component`, undefined, constructor);\n class WebComponent extends HTMLElement {\n constructor() {\n super();\n const shadowRoot = this.attachShadow({ mode: 'open' });\n const node = componentFunction({});\n Attach(shadowRoot, node);\n }\n }\n customElements.define(name, WebComponent);\n }\n Component.Register = Register;\n function Attach(node, nodeRef) {\n nodeRef_1.NodeRef.Init(nodeRef);\n var rootRef = nodeRef_1.NodeRef.Wrap(node);\n nodeRef_1.NodeRef.AddChild(rootRef, nodeRef);\n }\n Component.Attach = Attach;\n})(Component || (exports.Component = Component = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ComponentNode = void 0;\nconst boundNode_1 = require(\"./boundNode\");\nconst nodeRef_1 = require(\"./nodeRef\");\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst component_1 = require(\"./component\");\nconst injector_1 = require(\"../Utils/injector\");\nconst decorators_1 = require(\"../Utils/decorators\");\nconst thread_1 = require(\"../Utils/thread\");\nvar ComponentNode;\n(function (ComponentNode) {\n function Fire(event, data) {\n var eventCallback = this.componentEvents && this.componentEvents[event];\n eventCallback && eventCallback(data);\n }\n ComponentNode.Fire = Fire;\n function ToFunction(type, namespace, constructor) {\n return function (nodeDef, templates) {\n return Create(type, namespace, nodeDef, constructor, templates);\n };\n }\n ComponentNode.ToFunction = ToFunction;\n function Init(componentNode) {\n var nodeDef = componentNode.nodeDef;\n var events = nodeDef.on;\n nodeDef.on = null;\n componentNode.component = new componentNode.constructor(nodeDef.data, componentNode.templates, componentNode, events);\n SetChildren(componentNode);\n componentNode.destroyables.push(componentNode.component);\n boundNode_1.BoundNode.Init(componentNode);\n }\n ComponentNode.Init = Init;\n})(ComponentNode || (exports.ComponentNode = ComponentNode = {}));\nfunction Create(type, namespace, nodeDef, constructor, templates) {\n var compNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ComponentNode);\n compNode.nodeDef = nodeDef;\n compNode.constructor = constructor;\n compNode.templates = templates;\n return compNode;\n}\nfunction SetChildren(node) {\n if (decorators_1.PreReq.Has(node.component)) {\n AddPreReqTemplate(node).then(function () {\n AddTemplate(node, false);\n });\n }\n else\n AddTemplate(node, true);\n}\nfunction AddPreReqTemplate(node) {\n return new Promise(resolve => {\n (0, thread_1.Thread)(function () {\n const preNodes = injector_1.Injector.Scope(node.injector, decorators_1.PreReqTemplate.Get, node.component);\n (0, thread_1.Schedule)(function () {\n if (node.destroyed)\n return;\n nodeRef_1.NodeRef.InitAll(preNodes);\n });\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.AddChild(node, preNodes[x]);\n decorators_1.PreReq.All(node.component).then(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.Destroy(preNodes[x]);\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.DetachChild(node, preNodes[x]);\n resolve();\n });\n });\n });\n });\n });\n}\nfunction InvokeNodeTemplate(node) {\n const nodes = node.component.Template();\n if (!Array.isArray(nodes))\n return [nodes];\n return nodes;\n}\nfunction AddTemplate(node, init) {\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const nodes = injector_1.Injector.Scope(node.injector, InvokeNodeTemplate, node);\n (0, thread_1.Schedule)(function () {\n nodeRef_1.NodeRef.InitAll(nodes);\n });\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n if (init)\n for (var x = 0; x < nodes.length; x++)\n nodeRef_1.NodeRef.AddChild(node, nodes[x]);\n else\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < nodes.length; x++)\n nodeRef_1.NodeRef.AddChild(node, nodes[x]);\n });\n });\n if (node.component.Bound !== component_1.Component.prototype.Bound)\n (0, thread_1.After)(function () {\n nodeConfig_1.NodeConfig.scheduleUpdate(() => setTimeout(() => node.component.Bound(), 0));\n });\n });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ElementNode = void 0;\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nconst injector_1 = require(\"../Utils/injector\");\nconst list_1 = require(\"../Utils/list\");\nconst thread_1 = require(\"../Utils/thread\");\nconst boundNode_1 = require(\"./boundNode\");\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst nodeRef_1 = require(\"./nodeRef\");\nvar ElementNode;\n(function (ElementNode) {\n function Create(type, namespace, nodeDef, children) {\n var elemNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ElementNode);\n elemNode.nodeDef = nodeDef;\n elemNode.childrenFunc = children;\n return elemNode;\n }\n ElementNode.Create = Create;\n function Init(elementNode) {\n if (elementNode.childrenFunc) {\n var nodeDef = elementNode.nodeDef;\n if (nodeDef.data) {\n const dataScope = observableScope_1.ObservableScope.Create(nodeDef.data);\n observableScope_1.ObservableScope.Watch(dataScope, function () {\n ScheduleSetData(elementNode, dataScope);\n });\n SetData(elementNode, GetValue(dataScope), true);\n elementNode.destroyables.push({\n Destroy: function () {\n observableScope_1.ObservableScope.Destroy(dataScope);\n }\n });\n }\n else\n SetDefaultData(elementNode);\n }\n boundNode_1.BoundNode.Init(elementNode);\n }\n ElementNode.Init = Init;\n})(ElementNode || (exports.ElementNode = ElementNode = {}));\nconst valueDefault = [];\nfunction GetValue(dataScope) {\n var value = observableScope_1.ObservableScope.Value(dataScope);\n if (!value)\n return valueDefault;\n if (!Array.isArray(value))\n value = [value];\n return value;\n}\nfunction ScheduleSetData(node, scope) {\n if (node.setData)\n return;\n node.setData = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setData = false;\n if (node.destroyed)\n return;\n SetData(node, GetValue(scope));\n });\n}\nfunction SetDefaultData(node) {\n (0, thread_1.Synch)(function () {\n const nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, true);\n if (nodes.length > 0) {\n nodeRef_1.NodeRef.InitAll(nodes);\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const defaultNodeList = list_1.List.Create();\n list_1.List.Add(defaultNodeList, {\n value: null,\n init: true,\n nodes\n });\n nodeRef_1.NodeRef.ReconcileChildren(node, defaultNodeList);\n });\n }\n });\n}\nfunction GetDataValue(data) {\n return data.value;\n}\nfunction ReconcileNodeData(node, values) {\n const nextNodeList = list_1.List.Create();\n const initNodeList = list_1.List.Create();\n const currentNodeList = node.nodeList;\n const nodeMap = currentNodeList && list_1.List.ToNodeMap(currentNodeList, GetDataValue);\n for (let x = 0; x < values.length; x++) {\n let curNode;\n if (nodeMap) {\n const nodeArr = nodeMap.get(values[x]);\n if (nodeArr) {\n let y = nodeArr.length - 1;\n for (; y >= 0 && !curNode; y--) {\n curNode = nodeArr[y];\n nodeArr[y] = null;\n }\n }\n }\n if (curNode) {\n list_1.List.RemoveNode(currentNodeList, curNode);\n list_1.List.AddNode(nextNodeList, curNode);\n if (!curNode.data.init)\n list_1.List.Add(initNodeList, curNode.data);\n }\n else {\n curNode = list_1.List.Add(nextNodeList, {\n value: values[x],\n init: false,\n nodes: injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, values[x])\n });\n list_1.List.Add(initNodeList, curNode.data);\n }\n }\n let curNode = initNodeList.head;\n while (curNode) {\n const data = curNode.data;\n (0, thread_1.Schedule)(function () {\n if (node.destroyed || nextNodeList.size === 0)\n return;\n nodeRef_1.NodeRef.InitAll(data.nodes);\n data.init = true;\n });\n curNode = curNode.next;\n }\n if (currentNodeList) {\n let curDetach = currentNodeList.head;\n while (curDetach) {\n nodeRef_1.NodeRef.DestroyAll(curDetach.data.nodes);\n for (let x = 0; x < curDetach.data.nodes.length; x++)\n node.childNodes.delete(curDetach.data.nodes[x]);\n curDetach = curDetach.next;\n }\n list_1.List.Clear(currentNodeList);\n }\n let curAttach = nextNodeList.head;\n while (curAttach) {\n for (let x = 0; x < curAttach.data.nodes.length; x++)\n node.childNodes.add(curAttach.data.nodes[x]);\n curAttach = curAttach.next;\n }\n node.nodeList = nextNodeList;\n}\nfunction SetData(node, values, init = false) {\n (0, thread_1.Synch)(function () {\n ReconcileNodeData(node, values);\n const attachNodes = node.nodeList;\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n if (init)\n nodeRef_1.NodeRef.ReconcileChildren(node, attachNodes);\n else\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed || attachNodes.size < node.childNodes.size)\n return;\n nodeRef_1.NodeRef.ReconcileChildren(node, attachNodes);\n });\n });\n });\n}\nfunction CreateNodeArray(childrenFunc, value) {\n var newNodes = childrenFunc(value);\n if (typeof newNodes === \"string\") {\n var textNode = nodeRef_1.NodeRef.Create(\"text\", null, nodeRef_1.NodeRefType.BoundNode);\n textNode.nodeDef = {\n props: function () {\n return { nodeValue: childrenFunc(value) };\n }\n };\n return [textNode];\n }\n if (Array.isArray(newNodes))\n return newNodes;\n return [newNodes];\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeConfig = void 0;\nconst domNodeConfig_1 = require(\"../DOM/domNodeConfig\");\nexports.NodeConfig = domNodeConfig_1.DOMNodeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeRef = exports.NodeRefType = void 0;\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst injector_1 = require(\"../Utils/injector\");\nconst boundNode_1 = require(\"./boundNode\");\nconst elementNode_1 = require(\"./elementNode\");\nconst componentNode_1 = require(\"./componentNode\");\nvar NodeRefType;\n(function (NodeRefType) {\n NodeRefType[NodeRefType[\"NodeRef\"] = 0] = \"NodeRef\";\n NodeRefType[NodeRefType[\"BoundNode\"] = 1] = \"BoundNode\";\n NodeRefType[NodeRefType[\"ElementNode\"] = 2] = \"ElementNode\";\n NodeRefType[NodeRefType[\"ComponentNode\"] = 3] = \"ComponentNode\";\n})(NodeRefType || (exports.NodeRefType = NodeRefType = {}));\nvar NodeRef;\n(function (NodeRef) {\n function Wrap(node) {\n var nodeRef = Create(null, null, NodeRefType.NodeRef);\n nodeRef.node = node;\n nodeRef.childNodes = new Set();\n return nodeRef;\n }\n NodeRef.Wrap = Wrap;\n function Create(nodeType, namespace, type) {\n switch (type) {\n case NodeRefType.NodeRef:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.NodeRef,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: []\n };\n case NodeRefType.BoundNode:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.BoundNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: [],\n lastProperties: null,\n lastEvents: null,\n setProperties: false,\n setAttributes: false,\n setEvents: false\n };\n case NodeRefType.ElementNode:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.ElementNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: [],\n lastProperties: null,\n lastEvents: null,\n setProperties: false,\n setAttributes: false,\n setEvents: false,\n childrenFunc: null,\n nodeList: null,\n setData: false\n };\n case NodeRefType.ComponentNode:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.ComponentNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: [],\n lastProperties: null,\n lastEvents: null,\n setProperties: false,\n setAttributes: false,\n setEvents: false,\n component: null,\n componentEvents: null\n };\n }\n }\n NodeRef.Create = Create;\n function Init(nodeRef) {\n if (nodeRef.node)\n return;\n nodeRef.node = nodeConfig_1.NodeConfig.createNode(nodeRef.nodeType, nodeRef.nodeNamespace);\n nodeRef.childNodes = new Set();\n switch (nodeRef.type) {\n case NodeRefType.BoundNode:\n boundNode_1.BoundNode.Init(nodeRef);\n break;\n case NodeRefType.ElementNode:\n elementNode_1.ElementNode.Init(nodeRef);\n break;\n case NodeRefType.ComponentNode:\n componentNode_1.ComponentNode.Init(nodeRef);\n break;\n }\n }\n NodeRef.Init = Init;\n function InitAll(nodeRefs) {\n for (var x = 0; x < nodeRefs.length; x++)\n Init(nodeRefs[x]);\n }\n NodeRef.InitAll = InitAll;\n function AddChild(node, child) {\n child.parent = node;\n node.childNodes.add(child);\n nodeConfig_1.NodeConfig.addChild(node.node, child.node);\n }\n NodeRef.AddChild = AddChild;\n function AddChildAfter(node, currentChild, newChild) {\n if (currentChild && currentChild.parent !== node)\n throw \"currentChild is not valid\";\n newChild.parent = node;\n node.childNodes.add(newChild);\n nodeConfig_1.NodeConfig.addChildAfter(node.node, currentChild && currentChild.node, newChild.node);\n }\n NodeRef.AddChildAfter = AddChildAfter;\n function ReconcileChildren(node, nextChildren) {\n const rootNode = node.node;\n if (nextChildren.size === 0) {\n nodeConfig_1.NodeConfig.replaceChildren(rootNode, []);\n return;\n }\n let priorNode;\n let curDataNode = nextChildren?.head;\n while (curDataNode) {\n for (let x = 0; x < curDataNode.data.nodes.length; x++) {\n const actualNode = priorNode ? nodeConfig_1.NodeConfig.getNextSibling(priorNode) : nodeConfig_1.NodeConfig.getFirstChild(rootNode);\n const expectedNode = curDataNode.data.nodes[x].node;\n if (actualNode !== expectedNode) {\n nodeConfig_1.NodeConfig.addChildBefore(rootNode, actualNode, expectedNode);\n }\n priorNode = expectedNode;\n }\n curDataNode = curDataNode.next;\n }\n let remainingSibling = priorNode && nodeConfig_1.NodeConfig.getNextSibling(priorNode);\n while (remainingSibling) {\n nodeConfig_1.NodeConfig.removeChild(rootNode, remainingSibling);\n remainingSibling = nodeConfig_1.NodeConfig.getNextSibling(priorNode);\n }\n }\n NodeRef.ReconcileChildren = ReconcileChildren;\n function DetachChild(node, child) {\n if (node.childNodes.delete(child)) {\n nodeConfig_1.NodeConfig.removeChild(node.node, child.node);\n child.parent = null;\n }\n }\n NodeRef.DetachChild = DetachChild;\n function Destroy(node) {\n if (node.destroyed)\n return;\n node.destroyed = true;\n node.childNodes?.forEach(Destroy);\n for (let x = 0; x < node.destroyables.length; x++)\n node.destroyables[x]?.Destroy();\n }\n NodeRef.Destroy = Destroy;\n function DestroyAll(nodes) {\n for (var x = 0; x < nodes.length; x++)\n Destroy(nodes[x]);\n }\n NodeRef.DestroyAll = DestroyAll;\n})(NodeRef || (exports.NodeRef = NodeRef = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffAsync = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nconst workerQueue_1 = require(\"./workerQueue\");\nconst diffWorker_1 = require(\"./diffWorker\");\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\nclass DiffAsync {\n workerQueue;\n constructor(keyFunc) {\n this.workerQueue = new workerQueue_1.WorkerQueue(diffWorker_1.DiffWorker.Create());\n this.workerQueue.Push({ method: \"create\", arguments: [keyFunc.toString()] });\n }\n static GetKeyRef(key) {\n return diffCnstr.GetKeyRef(key);\n }\n static ReadKeyRef(ref) {\n return diffCnstr.ReadKeyRef(ref);\n }\n async DiffPath(path, value) {\n return await this.workerQueue.Push({ method: \"diffpath\", arguments: [path, value] });\n }\n async DiffBatch(data) {\n return await this.workerQueue.Push({ method: \"diffbatch\", arguments: [data] });\n }\n async UpdatePath(path, value) {\n await this.workerQueue.Push({ method: \"updatepath\", arguments: [path, value] });\n }\n async GetPath(path) {\n return await this.workerQueue.Push({ method: \"getpath\", arguments: [path] });\n }\n Destroy() {\n this.workerQueue.Destroy();\n }\n}\nexports.DiffAsync = DiffAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffSync = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\nclass DiffSync {\n diffTree;\n constructor(keyFunc) {\n this.diffTree = new diffCnstr(keyFunc);\n }\n static GetKeyRef(key) {\n return diffCnstr.GetKeyRef(key);\n }\n static ReadKeyRef(ref) {\n return diffCnstr.ReadKeyRef(ref);\n }\n DiffPath(path, value) {\n return this.diffTree.DiffPath(path, value);\n }\n DiffBatch(data) {\n return this.diffTree.DiffBatch(data);\n }\n UpdatePath(path, value) {\n this.diffTree.UpdatePath(path, value);\n }\n}\nexports.DiffSync = DiffSync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffTreeScope = void 0;\nfunction DiffTreeScope(worker) {\n const ctx = this;\n if (ctx && worker) {\n let diffTree = null;\n ctx.onmessage = function (event) {\n var data = event.data;\n switch (data.method) {\n case \"create\":\n var keyFunc = data.arguments[0] ? eval(data.arguments[0]) : undefined;\n diffTree = new DiffTree(keyFunc);\n ctx.postMessage(null);\n break;\n case \"diffpath\":\n var diff = diffTree.DiffPath(data.arguments[0], data.arguments[1]);\n ctx.postMessage(diff);\n break;\n case \"diffbatch\":\n var diff = diffTree.DiffBatch(data.arguments[0]);\n ctx.postMessage(diff);\n break;\n case \"updatepath\":\n diffTree.UpdatePath(data.arguments[0], data.arguments[1]);\n ctx.postMessage(null);\n break;\n case \"getpath\":\n var ret = diffTree.GetPath(data.arguments[0]);\n ctx.postMessage(ret);\n break;\n }\n };\n }\n const jsonConstructor = {}.constructor;\n function IsValue(value) {\n if (!value)\n return true;\n return !(jsonConstructor === value.constructor || Array.isArray(value));\n }\n let Type;\n (function (Type) {\n Type[Type[\"Value\"] = 0] = \"Value\";\n Type[Type[\"Object\"] = 1] = \"Object\";\n Type[Type[\"Array\"] = 2] = \"Array\";\n })(Type || (Type = {}));\n function TypeOf(value) {\n if (!value)\n return Type.Value;\n if (jsonConstructor === value.constructor)\n return Type.Object;\n if (Array.isArray(value))\n return Type.Array;\n return Type.Value;\n }\n function JsonDiffRecursive(path, newValue, oldValue, resp) {\n if (newValue === oldValue)\n return false;\n const newType = TypeOf(newValue);\n const oldType = TypeOf(oldValue);\n const changedPathLength = resp.length;\n let allChildrenChanged = true;\n if (newType === oldType)\n switch (newType) {\n case Type.Array: {\n allChildrenChanged = JsonDiffArrays(path, newValue, oldValue, resp);\n break;\n }\n case Type.Object: {\n allChildrenChanged = JsonDiffObjects(path, newValue, oldValue, resp);\n break;\n }\n }\n if (allChildrenChanged) {\n resp.splice(changedPathLength);\n resp.push({\n path,\n value: newValue\n });\n return true;\n }\n return false;\n }\n function JsonDiffArrays(path, newValue, oldValue, resp) {\n let allChildrenChanged = true;\n if (newValue.length !== oldValue.length)\n resp.push({\n path: path ? `${path}.length` : 'length',\n value: newValue.length\n });\n if (newValue.length > 0 || oldValue.length > 0) {\n for (let y = 0; y < newValue.length; y++) {\n const arrayPath = path ? `${path}.${y}` : `${y}`;\n allChildrenChanged = JsonDiffRecursive(arrayPath, newValue[y], oldValue[y], resp) && allChildrenChanged;\n }\n }\n else\n allChildrenChanged = false;\n return allChildrenChanged;\n }\n function JsonDiffObjects(path, newValue, oldValue, resp) {\n let allChildrenChanged = true;\n const newKeys = Object.keys(newValue);\n const oldKeys = Object.keys(oldValue);\n if (newKeys.length === 0 && oldKeys.length === 0) {\n return false;\n }\n if (newKeys.length >= oldKeys.length) {\n let newKeyIndex = 0;\n let oldKeyIndex = 0;\n while (newKeyIndex < newKeys.length) {\n const childPath = path ? `${path}.${newKeys[newKeyIndex]}` : newKeys[newKeyIndex];\n if (oldKeyIndex < oldKeys.length && newKeys[newKeyIndex] === oldKeys[oldKeyIndex]) {\n allChildrenChanged =\n JsonDiffRecursive(childPath, newValue[newKeys[newKeyIndex]], oldValue[oldKeys[oldKeyIndex]], resp) &&\n allChildrenChanged;\n oldKeyIndex++;\n }\n else if (newValue[newKeys[newKeyIndex]] !== undefined) {\n resp.push({\n path: childPath,\n value: newValue[newKeys[newKeyIndex]]\n });\n }\n newKeyIndex++;\n }\n if (oldKeyIndex < oldKeys.length)\n allChildrenChanged = true;\n }\n return allChildrenChanged;\n }\n function BreakUpValue(path, parent, keyFunc, prop, map) {\n const value = prop ? parent[prop] : parent;\n const isValue = IsValue(value);\n if (!map && isValue)\n return new Map([[path, value]]);\n map = map || new Map();\n if (isValue)\n return map;\n const key = keyFunc ? keyFunc(value) : null;\n const keyRef = key && DiffTree.GetKeyRef(key);\n if (key && key !== path) {\n if (prop)\n parent[prop] = keyRef;\n BreakUpValue(key, value, keyFunc, null, map);\n }\n else {\n for (const subProp in value) {\n const childPath = `${path}.${subProp}`;\n BreakUpValue(childPath, value, keyFunc, subProp, map);\n }\n }\n if (!prop)\n map.set(path, key === path ? value : keyRef || value);\n return map;\n }\n class DiffTree {\n keyFunc;\n rootStateMap = new Map();\n constructor(keyFunc) {\n this.keyFunc = keyFunc;\n }\n static GetKeyRef(key) {\n return `___DiffTreeKeyRef.${key}`;\n }\n static ReadKeyRef(ref) {\n if (!ref)\n return undefined;\n var matches = ref.match(/^___DiffTreeKeyRef\\.([^.]+$)/);\n if (!matches)\n return undefined;\n return matches[1];\n }\n DiffBatch(data) {\n var resp = [];\n ;\n for (var x = 0; x < data.length; x++)\n this.RunDiff(data[x].path, data[x].value, resp);\n return resp;\n }\n DiffPath(path, value) {\n var resp = [];\n this.RunDiff(path, value, resp);\n return resp;\n }\n UpdatePath(path, value) {\n this.SetPathValue(path, value);\n }\n GetPath(path) {\n return this.GetPathValue(path);\n }\n RunDiff(path, value, diffResp) {\n var breakupMap = this.GetBreakUpMap(path, value);\n var resp = diffResp || [];\n breakupMap.forEach((value, key) => {\n var currentValue = key.split(\".\").reduce((pre, curr, index) => {\n if (index === 0)\n return this.rootStateMap.get(curr);\n return pre && pre[curr];\n }, null);\n JsonDiffRecursive(key, value, currentValue, resp);\n });\n for (var x = 0; x < resp.length; x++)\n this.SetPathValue(resp[x].path, resp[x].value);\n }\n GetPathValue(path) {\n var parts = path.split(\".\");\n var curr = this.rootStateMap.get(parts[0]);\n for (var x = 1; x < parts.length; x++)\n curr = curr && curr[parts[x]];\n return curr;\n }\n SetPathValue(path, value) {\n var parts = path.split(\".\");\n if (parts.length === 1)\n this.rootStateMap.set(parts[0], value);\n else {\n var curr = this.rootStateMap.get(parts[0]);\n for (var x = 1; x < parts.length - 1; x++)\n curr = curr[parts[x]];\n curr[parts[parts.length - 1]] = value;\n }\n }\n GetBreakUpMap(path, value) {\n if (!this.keyFunc)\n return new Map([[path, value]]);\n return BreakUpValue(path, value, this.keyFunc);\n }\n }\n return DiffTree;\n}\nexports.DiffTreeScope = DiffTreeScope;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffWorker = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nvar DiffWorker;\n(function (DiffWorker) {\n var workerConstructor = null;\n var workerParameter = null;\n if (typeof Worker !== 'undefined') {\n workerConstructor = Worker;\n workerParameter = URL.createObjectURL(new Blob([`(${diffTree_1.DiffTreeScope}).call(this, true)`]));\n }\n function Create() {\n if (!workerConstructor)\n throw \"Worker is not available\";\n return new workerConstructor(workerParameter);\n }\n DiffWorker.Create = Create;\n})(DiffWorker || (exports.DiffWorker = DiffWorker = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkerQueue = void 0;\nconst list_1 = require(\"../../Utils/list\");\nclass WorkerQueue {\n callbacks;\n worker;\n constructor(worker) {\n this.worker = worker;\n this.callbacks = list_1.List.Create();\n this.worker.onerror = (err) => {\n var cb = list_1.List.Pop(this.callbacks);\n cb && cb(null, err);\n };\n this.worker.onmessage = (message) => {\n var cb = list_1.List.Pop(this.callbacks);\n cb && cb(message.data);\n };\n }\n Push(message) {\n return new Promise((resolve, reject) => {\n list_1.List.Add(this.callbacks, function (data, err) {\n if (err)\n reject(err);\n else\n resolve(data);\n });\n this.worker.postMessage(message);\n });\n }\n Destroy() {\n this.worker.terminate();\n }\n}\nexports.WorkerQueue = WorkerQueue;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Store = void 0;\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst storeWriter_1 = require(\"./storeWriter\");\nclass Store {\n observableTree = new observableTree_1.ObservableTree();\n storeWriter = new storeWriter_1.StoreWriter(this.observableTree);\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\n get Root() {\n return this.rootScope;\n }\n constructor(init) {\n if (init)\n this.Write(init);\n }\n Action(action) {\n var proxy = this.observableTree.Get(\"ROOT\");\n action(proxy, this.storeWriter);\n }\n Write(data) {\n this.Action((root, writer) => writer.Write(root, data));\n }\n Merge(data) {\n this.Action((root, writer) => writer.Merge(root, data));\n }\n Destroy() {\n this.rootScope.Destroy();\n }\n}\nexports.Store = Store;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsync = void 0;\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst diffAsync_1 = require(\"../Diff/diffAsync\");\nconst storeAsyncWriter_1 = require(\"./storeAsyncWriter\");\nconst asyncQueue_1 = require(\"../../Utils/asyncQueue\");\nclass StoreAsync {\n idFunc;\n diffAsync;\n observableTree;\n asyncWriter;\n asyncQueue;\n constructor(idFunc, init) {\n this.idFunc = idFunc;\n this.diffAsync = new diffAsync_1.DiffAsync(this.idFunc);\n this.observableTree = new observableTree_1.ObservableTree(diffAsync_1.DiffAsync.ReadKeyRef);\n this.asyncWriter = new storeAsyncWriter_1.StoreAsyncWriter(this.idFunc, this.diffAsync, this.observableTree);\n this.asyncQueue = new asyncQueue_1.AsyncQueue();\n if (init) {\n var id = this.idFunc(init);\n this.observableTree.Write(id, init);\n this.Write(init);\n }\n }\n Scope(id, func) {\n return this.observableTree.Scope(id, func);\n }\n async Action(id, action) {\n await this.asyncQueue.Next(async () => {\n await action(id && this.observableTree.Get(id), this.asyncWriter);\n });\n }\n async Write(data) {\n await this.Action(null, async (val, writer) => {\n await writer.Write(val, data);\n });\n }\n async Merge(id, data) {\n await this.Action(id, async (val, writer) => {\n await writer.Merge(val, data);\n });\n }\n Destroy() {\n this.asyncQueue.Stop();\n this.diffAsync.Destroy();\n }\n}\nexports.StoreAsync = StoreAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsyncWriter = void 0;\nclass StoreAsyncWriter {\n idFunc;\n diffAsync;\n observableTree;\n constructor(idFunc, diffAsync, observableTree) {\n this.idFunc = idFunc;\n this.diffAsync = diffAsync;\n this.observableTree = observableTree;\n }\n async Write(source, data) {\n let path;\n if (source) {\n path = this.observableTree.GetPathOf(source);\n }\n else {\n path = this.idFunc(data);\n if (!path)\n throw new Error(\"data must have an id\");\n }\n let diff = await this.diffAsync.DiffPath(path, data);\n this.ApplyChanges(diff);\n }\n async Merge(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n const keys = Object.keys(data);\n const message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\n const diff = await this.diffAsync.DiffBatch(message);\n this.ApplyChanges(diff);\n }\n async Push(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n var lengthPath = `${rootPath}.length`;\n var length = await this.diffAsync.GetPath(lengthPath);\n var diff = await this.diffAsync.DiffPath(`${rootPath}.${length}`, data);\n this.ApplyChanges(diff);\n }\n async Splice(source, start, deleteCount, ...items) {\n var rootPath = this.observableTree.GetPathOf(source);\n var array = await this.diffAsync.GetPath(rootPath);\n array = array.slice();\n array.splice(start, deleteCount, ...items);\n var diff = await this.diffAsync.DiffPath(rootPath, array);\n this.ApplyChanges(diff);\n }\n ApplyChanges(diff) {\n this.observableTree.WriteAll(diff);\n }\n}\nexports.StoreAsyncWriter = StoreAsyncWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreSync = void 0;\nconst diffSync_1 = require(\"../Diff/diffSync\");\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst storeSyncWriter_1 = require(\"./storeSyncWriter\");\nclass StoreSync {\n diffSync = new diffSync_1.DiffSync();\n observableTree = new observableTree_1.ObservableTree();\n storeWriter = new storeSyncWriter_1.StoreSyncWriter(this.diffSync, this.observableTree);\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\n get Root() {\n return this.rootScope;\n }\n constructor(init) {\n if (init)\n this.Write(init);\n }\n Action(action) {\n var proxy = this.observableTree.Get(\"ROOT\");\n action(proxy, this.storeWriter);\n }\n Write(data) {\n this.Action((root, writer) => writer.Write(root, data));\n }\n Merge(data) {\n this.Action((root, writer) => writer.Merge(root, data));\n }\n Destroy() {\n this.rootScope.Destroy();\n }\n}\nexports.StoreSync = StoreSync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreSyncWriter = void 0;\nclass StoreSyncWriter {\n diffSync;\n observableTree;\n constructor(diffSync, observableTree) {\n this.diffSync = diffSync;\n this.observableTree = observableTree;\n }\n Write(source, data) {\n var rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\n var diff = this.diffSync.DiffPath(rootPath, data);\n this.ApplyChanges(diff);\n }\n Merge(source, data) {\n var rootPath = this.observableTree.GetPathOf(source);\n var keys = Object.keys(data);\n var message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\n var diff = this.diffSync.DiffBatch(message);\n this.ApplyChanges(diff);\n }\n Push(source, data) {\n var rootPath = this.observableTree.GetPathOf(source);\n var length = source.length;\n this.diffSync.UpdatePath(`${rootPath}.${length}`, data);\n this.observableTree.Write(`${rootPath}.${length}`, data);\n }\n Splice(source, start, deleteCount, ...items) {\n var rootPath = this.observableTree.GetPathOf(source);\n var proxy = this.observableTree.Get(rootPath);\n const array = proxy.toJSON().slice();\n array.splice(start, deleteCount, ...items);\n this.diffSync.UpdatePath(rootPath, array);\n this.observableTree.Write(rootPath, array);\n }\n ApplyChanges(diff) {\n this.observableTree.WriteAll(diff);\n }\n}\nexports.StoreSyncWriter = StoreSyncWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreWriter = void 0;\nclass StoreWriter {\n observableTree;\n constructor(observableTree) {\n this.observableTree = observableTree;\n }\n Write(source, data) {\n const rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\n this.observableTree.Write(rootPath, data);\n }\n Merge(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n for (const key in data)\n this.observableTree.Write(`${rootPath}.${key}`, data[key]);\n }\n Push(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n this.observableTree.Write(`${rootPath}.${source.length}`, data);\n }\n Splice(source, start, deleteCount, ...items) {\n const json = source.toJSON();\n const copy = json.slice();\n copy.splice(start, deleteCount, ...items);\n const rootPath = this.observableTree.GetPathOf(source);\n this.observableTree.Write(rootPath, copy);\n }\n}\nexports.StoreWriter = StoreWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableScope = exports.ObservableScopeWrapper = exports.ObservableScopeValue = void 0;\nconst emitter_1 = require(\"../../Utils/emitter\");\nclass ObservableScopeValue {\n scope;\n get Value() {\n return ObservableScope.Value(this.scope);\n }\n constructor(scope) {\n this.scope = scope;\n }\n}\nexports.ObservableScopeValue = ObservableScopeValue;\nclass ObservableScopeWrapper extends ObservableScopeValue {\n scopeEmitter;\n constructor(scope) {\n super(scope);\n if (scope.emitter) {\n this.scopeEmitter = emitter_1.Emitter.Create();\n emitter_1.Emitter.On(scope.emitter, () => emitter_1.Emitter.Emit(this.scopeEmitter, this));\n }\n }\n Scope(callback) {\n return new ObservableScope(() => callback(this.Value));\n }\n Watch(callback) {\n if (!this.scopeEmitter)\n return;\n emitter_1.Emitter.On(this.scopeEmitter, callback);\n callback(this);\n }\n Unwatch(callback) {\n if (!this.scopeEmitter)\n return;\n emitter_1.Emitter.Remove(this.scopeEmitter, callback);\n }\n Destroy() {\n DestroyScope(this.scope);\n this.scopeEmitter && this.scopeEmitter.clear();\n }\n}\nexports.ObservableScopeWrapper = ObservableScopeWrapper;\nclass ObservableScope extends ObservableScopeWrapper {\n constructor(getFunction) {\n super(ObservableScope.Create(getFunction));\n }\n}\nexports.ObservableScope = ObservableScope;\nvar currentSet = null;\nvar watching = false;\nfunction WatchAction(action) {\n var parentSet = currentSet;\n currentSet = null;\n var parentWatching = watching;\n watching = true;\n action();\n var lastSet = currentSet;\n currentSet = parentSet;\n watching = parentWatching;\n return lastSet;\n}\n(function (ObservableScope) {\n function Create(valueFunction) {\n if (typeof valueFunction !== 'function')\n return {\n value: valueFunction,\n dirty: false,\n destroyed: false\n };\n var scope = {\n getFunction: valueFunction,\n async: valueFunction[Symbol.toStringTag] === 'AsyncFunction',\n value: null,\n dirty: true,\n emitter: emitter_1.Emitter.Create(),\n emitters: null,\n destroyed: false,\n setCallback: function () {\n OnSet(scope);\n }\n };\n return scope;\n }\n ObservableScope.Create = Create;\n function Register(emitter) {\n if (!watching || !emitter)\n return;\n currentSet = currentSet || new Set();\n currentSet.add(emitter);\n }\n ObservableScope.Register = Register;\n function Value(scope) {\n if (!scope)\n return undefined;\n Register(scope.emitter);\n UpdateValue(scope);\n return scope.value;\n }\n ObservableScope.Value = Value;\n function Watching() {\n return watching;\n }\n ObservableScope.Watching = Watching;\n function Watch(scope, callback) {\n if (!scope || !scope.emitter)\n return;\n emitter_1.Emitter.On(scope.emitter, callback);\n }\n ObservableScope.Watch = Watch;\n function Unwatch(scope, callback) {\n if (!scope || !scope.emitter)\n return;\n emitter_1.Emitter.Remove(scope.emitter, callback);\n }\n ObservableScope.Unwatch = Unwatch;\n function Update(scope) {\n OnSet(scope);\n }\n ObservableScope.Update = Update;\n function Emit(scope) {\n emitter_1.Emitter.Emit(scope.emitter);\n }\n ObservableScope.Emit = Emit;\n function Destroy(scope) {\n DestroyScope(scope);\n }\n ObservableScope.Destroy = Destroy;\n})(ObservableScope || (exports.ObservableScope = ObservableScope = {}));\nfunction OnSet(scope) {\n if (!scope || scope.dirty)\n return;\n scope.dirty = true;\n emitter_1.Emitter.Emit(scope.emitter, scope);\n}\nfunction UpdateValue(scope) {\n if (!scope.dirty)\n return;\n scope.dirty = false;\n var value = null;\n var emitters = scope.getFunction && WatchAction(() => value = scope.getFunction());\n if (scope.async)\n Promise.resolve(value).then(val => {\n scope.value = val;\n emitter_1.Emitter.Emit(scope.emitter, scope);\n });\n else\n scope.value = value;\n UpdateEmitters(scope, emitters);\n}\nfunction DestroyScope(scope) {\n if (!scope)\n return;\n scope.emitters && scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\n scope.emitters && scope.emitters.clear();\n scope.emitter && scope.emitter.clear();\n scope.destroyed = true;\n}\nfunction UpdateEmitters(scope, newEmitters) {\n if (newEmitters)\n newEmitters.forEach(e => {\n if (!scope.emitters || !scope.emitters.delete(e))\n emitter_1.Emitter.On(e, scope.setCallback);\n });\n if (scope.emitters)\n scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\n scope.emitters = newEmitters;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableTree = void 0;\nconst observableScope_1 = require(\"../Tree/observableScope\");\nvar Type;\n(function (Type) {\n Type[Type[\"Value\"] = 0] = \"Value\";\n Type[Type[\"Object\"] = 1] = \"Object\";\n Type[Type[\"Array\"] = 2] = \"Array\";\n})(Type || (Type = {}));\nconst jsonConstructor = {}.constructor;\nfunction TypeOf(value) {\n if (!value)\n return Type.Value;\n if (jsonConstructor === value.constructor)\n return Type.Object;\n if (Array.isArray(value))\n return Type.Array;\n return Type.Value;\n}\nclass ObservableTree {\n valuePathResolver;\n undefinedScope = observableScope_1.ObservableScope.Create(function () { return undefined; });\n scopeCache = new WeakMap();\n leafScopeCache = new WeakMap();\n proxyCache = new WeakMap();\n pathCache = new WeakMap();\n rootStateMap = new Map();\n constructor(valuePathResolver) {\n this.valuePathResolver = valuePathResolver;\n }\n static UnwrapProxyValues(value) {\n if (value?.toJSON && typeof value.toJSON === 'function')\n return value.toJSON();\n const type = TypeOf(value);\n if (type === Type.Value)\n return value;\n if (type === Type.Array) {\n const arr = value;\n for (let x = 0; x < arr.length; x++)\n arr[x] = ObservableTree.UnwrapProxyValues(arr[x]);\n }\n else {\n const keys = Object.keys(value);\n for (let x = 0; x < keys.length; x++)\n value[keys[x]] = ObservableTree.UnwrapProxyValues(value[keys[x]]);\n }\n return value;\n }\n Get(path) {\n const val = path.split(\".\").reduce((pre, curr, index) => {\n if (index === 0) {\n let value = this.rootStateMap.get(curr);\n const scope = this.GetParentScope(value);\n return observableScope_1.ObservableScope.Value(scope);\n }\n return pre && pre[curr];\n }, null);\n return val;\n }\n GetPathOf(value) {\n if (value.toJSON && typeof value.toJSON === 'function')\n value = value.toJSON();\n return this.pathCache.get(value);\n }\n Scope(path, callback) {\n return new observableScope_1.ObservableScope(() => {\n const obj = this.Get(path);\n return callback && callback(obj) || obj;\n });\n }\n Write(path, value) {\n const scope = this.WritePath(path, value);\n observableScope_1.ObservableScope.Update(scope);\n }\n WriteAll(data) {\n const scopeSet = new Set();\n for (var x = 0; x < data.length; x++) {\n const scope = this.WritePath(data[x].path, data[x].value);\n scopeSet.add(scope);\n }\n scopeSet.forEach(scope => observableScope_1.ObservableScope.Update(scope));\n }\n GetParentScope(value) {\n if (value === undefined)\n return this.undefinedScope;\n let scope = this.scopeCache.get(value);\n if (!scope) {\n scope = observableScope_1.ObservableScope.Create(() => this.GetValueProxy(value));\n this.scopeCache.set(value, scope);\n }\n return scope;\n }\n GetPropertyScope(parent, prop) {\n const value = parent[prop];\n const type = TypeOf(value);\n if (type === Type.Value) {\n let leafScopes = this.leafScopeCache.get(parent) || {};\n leafScopes[prop] = leafScopes[prop] || observableScope_1.ObservableScope.Create(() => {\n const parentScope = this.scopeCache.get(parent);\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\n const parentJson = parentValue.toJSON();\n const currentValue = parentJson[prop];\n let path;\n if (this.valuePathResolver && typeof currentValue === 'string' && (path = this.valuePathResolver(currentValue)))\n return this.Get(path);\n return currentValue;\n });\n this.leafScopeCache.set(parent, leafScopes);\n return leafScopes[prop];\n }\n else {\n let scope = this.scopeCache.get(value);\n if (!scope) {\n scope = observableScope_1.ObservableScope.Create(() => {\n const parentScope = this.scopeCache.get(parent);\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\n const parentJson = parentValue.toJSON();\n const currentValue = parentJson[prop];\n return this.GetValueProxy(currentValue);\n });\n this.scopeCache.set(value, scope);\n }\n return scope;\n }\n }\n GetValueProxy(value) {\n let proxy = this.proxyCache.get(value);\n if (!proxy) {\n proxy = this.CreateProxy(value);\n this.proxyCache.set(value, proxy);\n }\n return proxy;\n }\n ObjectProxyGetter = (value, prop) => {\n function toJSON() {\n return value;\n }\n ;\n switch (prop) {\n case \"toJSON\":\n return toJSON;\n default:\n if (typeof prop === 'symbol')\n return value[prop];\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\n }\n };\n CreateObjectProxy(value) {\n return new Proxy(value, {\n get: this.ObjectProxyGetter\n });\n }\n ArrayProxyGetter = (value, prop) => {\n function toJSON() {\n return value;\n }\n ;\n switch (prop) {\n case \"toJSON\":\n return toJSON;\n default:\n if (typeof prop === 'symbol')\n return value[prop];\n if (isNaN(parseInt(prop))) {\n const ret = value[prop];\n if (typeof ret === 'function') {\n const copy = value.map((val, index) => observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, index.toString())));\n return ret.bind(copy);\n }\n return ret;\n }\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\n }\n };\n CreateArrayProxy(value) {\n return new Proxy(value, {\n get: this.ArrayProxyGetter\n });\n }\n CreateProxy(value) {\n const type = TypeOf(value);\n switch (type) {\n case Type.Object:\n return this.CreateObjectProxy(value);\n case Type.Array:\n return this.CreateArrayProxy(value);\n default:\n return value;\n }\n }\n WritePath(path, value) {\n this.UpdatePathCache(path, value);\n const pathParts = path.split(\".\");\n if (pathParts.length === 1) {\n const currentValue = this.rootStateMap.get(pathParts[0]);\n this.rootStateMap.set(pathParts[0], value);\n return currentValue === undefined ? this.undefinedScope : this.scopeCache.get(currentValue);\n }\n let parentValue;\n let x = 0;\n for (; x < pathParts.length - 1 && (x === 0 || parentValue); x++) {\n if (x === 0)\n parentValue = this.rootStateMap.get(pathParts[x]);\n else\n parentValue = parentValue && parentValue[pathParts[x]];\n }\n if (!parentValue)\n throw new Error(\"Unable to write path: \" + path + \". Falsey value found at: \" + pathParts.slice(0, x).join(\".\"));\n const prop = pathParts[x];\n const oldValue = parentValue[prop];\n const oldType = TypeOf(oldValue);\n parentValue[prop] = value;\n if (oldType !== Type.Value || Array.isArray(parentValue))\n return this.scopeCache.get(parentValue) || this.scopeCache.get(oldValue);\n const leafScopes = this.leafScopeCache.get(parentValue);\n return leafScopes && leafScopes[prop] || this.scopeCache.get(parentValue);\n }\n UpdatePathCache(path, value) {\n const type = TypeOf(value);\n if (type === Type.Value)\n return;\n this.pathCache.set(value, path);\n this.proxyCache.delete(value);\n this.scopeCache.delete(value);\n this.leafScopeCache.delete(value);\n const keys = Object.keys(value);\n for (let x = 0; x < keys.length; x++)\n this.UpdatePathCache(`${path}.${keys[x]}`, value[keys[x]]);\n return value;\n }\n}\nexports.ObservableTree = ObservableTree;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableScope = exports.StoreAsync = exports.StoreSync = exports.Store = void 0;\nvar store_1 = require(\"./Store/store\");\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return store_1.Store; } });\nvar storeSync_1 = require(\"./Store/storeSync\");\nObject.defineProperty(exports, \"StoreSync\", { enumerable: true, get: function () { return storeSync_1.StoreSync; } });\nvar storeAsync_1 = require(\"./Store/storeAsync\");\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return storeAsync_1.StoreAsync; } });\nvar observableScope_1 = require(\"./Tree/observableScope\");\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return observableScope_1.ObservableScope; } });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Animation = exports.AnimationType = void 0;\nvar StepFunctions;\n(function (StepFunctions) {\n function* EaseIn(count) {\n var diff = 1 / count;\n for (var t = diff, x = 0; x < count; x++, t += diff)\n yield (1 - t) * (1 - t) * (1 - t) * 0 + 3 * (1 - t) * (1 - t) * t * 1 + 3 * (1 - t) * t * t * 1 + t * t * t * 1;\n }\n StepFunctions.EaseIn = EaseIn;\n function* Linear(count) {\n var diff = 1 / count;\n for (var t = diff, x = 0; x < count; x++, t += diff)\n yield t;\n }\n StepFunctions.Linear = Linear;\n})(StepFunctions || (StepFunctions = {}));\nvar AnimationType;\n(function (AnimationType) {\n AnimationType[AnimationType[\"Linear\"] = 0] = \"Linear\";\n AnimationType[AnimationType[\"EaseIn\"] = 1] = \"EaseIn\";\n})(AnimationType || (exports.AnimationType = AnimationType = {}));\nclass Animation {\n type;\n frameCount;\n frameTimings;\n update;\n animationTimeouts;\n running;\n start;\n end;\n enabled;\n get Running() {\n return this.running;\n }\n get Start() {\n return this.start;\n }\n get End() {\n return this.end;\n }\n get Enabled() {\n return this.enabled;\n }\n constructor(type, duration, update) {\n this.running = false;\n this.start = null;\n this.end = null;\n this.enabled = true;\n this.type = type;\n this.frameCount = Math.ceil((duration / 1000) * 60);\n this.frameTimings = [];\n var frameTime = duration / this.frameCount;\n for (var x = 0; x < this.frameCount; x++)\n this.frameTimings[x] = (x + 1) * frameTime;\n this.update = update;\n this.animationTimeouts = [];\n }\n Animate(start, end) {\n if (!this.enabled)\n return;\n var diff = end - start;\n if (diff === 0)\n return;\n this.Cancel();\n this.running = true;\n this.start = start;\n this.end = end;\n return new Promise(resolve => {\n var stepFunc = StepFunctions[AnimationType[this.type]];\n var index = 0;\n for (var step of stepFunc(this.frameCount)) {\n var value = (step * diff) + start;\n this.SetTimeout(index, value, index === (this.frameCount - 1) ? resolve : null);\n index++;\n }\n }).then(() => {\n this.running = false;\n this.start = null;\n this.end = null;\n });\n }\n Disable() {\n this.Cancel();\n this.enabled = false;\n }\n Enable() {\n this.enabled = true;\n }\n Cancel() {\n for (var x = 0; x < this.animationTimeouts.length; x++)\n clearTimeout(this.animationTimeouts[x]);\n this.running = false;\n this.start = null;\n this.end = null;\n }\n Destroy() {\n this.Cancel();\n }\n SetTimeout(index, value, resolve) {\n this.animationTimeouts[index] = setTimeout(() => {\n this.update(value);\n resolve && resolve();\n }, this.frameTimings[index]);\n }\n}\nexports.Animation = Animation;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncQueue = void 0;\nconst list_1 = require(\"./list\");\nclass AsyncQueue {\n running = false;\n queue = list_1.List.Create();\n Next(callback) {\n const ret = new Promise((resolve, reject) => {\n list_1.List.Add(this.queue, async function () {\n try {\n const ret = await callback();\n resolve(ret);\n }\n catch (e) {\n reject(e);\n }\n });\n });\n this.Start();\n return ret;\n }\n Stop() {\n list_1.List.Clear(this.queue);\n }\n Start() {\n if (this.running)\n return;\n this.running = true;\n this.ExecuteQueue();\n }\n async ExecuteQueue() {\n const callback = list_1.List.Pop(this.queue);\n if (callback !== null) {\n await callback();\n this.ExecuteQueue();\n }\n else\n this.running = false;\n }\n}\nexports.AsyncQueue = AsyncQueue;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PreReq = exports.PreReqTemplate = exports.Destroy = exports.Inject = exports.ComputedAsync = exports.Computed = exports.DestroyScope = exports.Scope = exports.StateAsync = exports.StateSync = exports.State = void 0;\nconst store_1 = require(\"../Store/Store/store\");\nconst Store_1 = require(\"../Store\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nconst observableTree_1 = require(\"../Store/Tree/observableTree\");\nfunction State() {\n return StateDecorator;\n}\nexports.State = State;\nfunction StateDecorator(target, propertyKey) {\n const propKey = `StoreDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n const value = store && store.Root.Value;\n if (observableScope_1.ObservableScope.Watching())\n return value;\n return observableTree_1.ObservableTree.UnwrapProxyValues(value);\n },\n set: function (val) {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n if (!store)\n map.set(propKey, new store_1.Store(val));\n else\n store.Merge(val);\n }\n };\n}\nfunction StateSync() {\n return StateSyncDecorator;\n}\nexports.StateSync = StateSync;\nfunction StateSyncDecorator(target, propertyKey) {\n const propKey = `StoreSyncDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n const value = store && store.Root.Value;\n if (observableScope_1.ObservableScope.Watching())\n return value;\n return observableTree_1.ObservableTree.UnwrapProxyValues(value);\n },\n set: function (val) {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n if (!store)\n map.set(propKey, new Store_1.StoreSync(val));\n else\n store.Merge(val);\n }\n };\n}\nfunction StateAsync() {\n return StateAsyncDecorator;\n}\nexports.StateAsync = StateAsync;\nfunction StateAsyncDecorator(target, propertyKey) {\n const propKey = `StoreAsyncDecorator_${propertyKey}`;\n const scopeKey = `StoreAsyncDecorator_Scope_${propertyKey}`;\n DestroyDecorator(target, propKey);\n DestroyDecorator(target, scopeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(scopeKey);\n const value = scope && scope.Value;\n if (observableScope_1.ObservableScope.Watching())\n return value;\n return observableTree_1.ObservableTree.UnwrapProxyValues(value);\n },\n set: function (val) {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n if (!store) {\n store = new Store_1.StoreAsync((val) => val.___id, { ___id: \"ROOT\", data: val });\n map.set(propKey, store);\n map.set(scopeKey, store.Scope(\"ROOT\", val => val.data));\n }\n else\n store.Action(\"ROOT\", async (root, writer) => await writer.Merge(root.data, val));\n }\n };\n}\nfunction Scope() {\n return ScopeDecorator;\n}\nexports.Scope = Scope;\nfunction ScopeDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Scope decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Scope decorator does not support setters\";\n const propKey = `ScopeDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(propKey);\n if (!scope) {\n const getter = descriptor.get.bind(this);\n scope = new observableScope_1.ObservableScope(getter);\n map.set(propKey, scope);\n }\n return scope.Value;\n }\n };\n}\nfunction DestroyScope() {\n return DestroyScopeDecorator;\n}\nexports.DestroyScope = DestroyScope;\nfunction DestroyScopeDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Destroy Scope decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Destroy Scope decorator does not support setters\";\n const propKey = `ScopeDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n const valKey = `ScopeDecorator_${propertyKey}_Value`;\n DestroyDecorator(target, valKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(propKey);\n if (!scope) {\n const getter = descriptor.get.bind(this);\n scope = new observableScope_1.ObservableScope(getter);\n map.set(propKey, scope);\n scope.Watch(scope => {\n var lastValue = map.get(valKey);\n lastValue && lastValue.Destroy();\n map.set(valKey, scope.Value);\n });\n }\n return scope.Value;\n }\n };\n}\nfunction Computed() {\n return ComputedDecorator;\n}\nexports.Computed = Computed;\nfunction ComputedDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Computed decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Computed decorator does not support setters\";\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\n DestroyDecorator(target, scopeKey);\n DestroyDecorator(target, storeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var store = map.get(storeKey);\n if (!store) {\n const getter = descriptor.get.bind(this);\n const scope = new observableScope_1.ObservableScope(getter);\n store = new Store_1.StoreSync(scope.Value);\n scope.Watch(scope => {\n if (!this.Destroyed)\n store.Write(scope.Value);\n });\n map.set(scopeKey, scope);\n map.set(storeKey, store);\n }\n return store.Root.Value;\n }\n };\n}\nfunction ComputedAsync(idFunc) {\n return ComputedAsyncDecorator.bind(null, idFunc);\n}\nexports.ComputedAsync = ComputedAsync;\nfunction ComputedAsyncDecorator(idFunc, target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"ComputedAsync decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"ComputedAsync decorator does not support setters\";\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\n const storeScopeKey = `ComputedDecorator_StoreScope_${propertyKey}`;\n DestroyDecorator(target, scopeKey);\n DestroyDecorator(target, storeKey);\n DestroyDecorator(target, storeScopeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var storeScope = map.get(storeScopeKey);\n if (!storeScope) {\n const getter = descriptor.get.bind(this);\n const scope = new observableScope_1.ObservableScope(() => {\n var value = getter();\n if (value && typeof value.toJSON === 'function')\n value = value.toJSON();\n return value;\n });\n const store = new Store_1.StoreAsync((val) => val._id, { _id: \"ROOT\", data: scope.Value });\n scope.Watch(scope => {\n if (!this.Destroyed)\n store.Write({ _id: \"ROOT\", data: scope.Value });\n });\n storeScope = store.Scope(\"ROOT\", (val) => val.data);\n map.set(storeScopeKey, storeScope);\n map.set(scopeKey, scope);\n map.set(storeKey, store);\n }\n return storeScope.Value;\n }\n };\n}\nfunction Inject(type) {\n return InjectorDecorator.bind(null, type);\n}\nexports.Inject = Inject;\nfunction InjectorDecorator(type, target, propertyKey, descriptor) {\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n return this.Injector.Get(type);\n },\n set: function (val) {\n this.Injector.Set(type, val);\n }\n };\n}\nfunction Destroy() {\n return DestroyDecorator;\n}\nexports.Destroy = Destroy;\n(function (Destroy) {\n function Get(value) {\n return value && value.DestroyDecorator_Destroys || [];\n }\n function All(value) {\n var arr = Get(value);\n arr.map(prop => (value[prop] || value.DecoratorMap.get(prop)))\n .filter(o => !!o)\n .forEach(o => o.Destroy());\n }\n Destroy.All = All;\n})(Destroy || (exports.Destroy = Destroy = {}));\nfunction DestroyDecorator(target, propertyKey) {\n var proto = target;\n proto.DestroyDecorator_Destroys = proto.DestroyDecorator_Destroys || [];\n proto.DestroyDecorator_Destroys.push(propertyKey);\n}\nfunction PreReqTemplate(template) {\n return PreReqTemplateDecorator.bind(null, template);\n}\nexports.PreReqTemplate = PreReqTemplate;\n(function (PreReqTemplate) {\n function Get(value) {\n var func = value && value.PreReqTemplateDecorator_Template;\n var ret = func ? func() : [];\n if (!Array.isArray(ret))\n ret = [ret];\n return ret;\n }\n PreReqTemplate.Get = Get;\n})(PreReqTemplate || (exports.PreReqTemplate = PreReqTemplate = {}));\nfunction PreReqTemplateDecorator(template, target) {\n var proto = target.prototype;\n proto.PreReqTemplateDecorator_Template = template;\n}\nfunction PreReq() {\n return PreReqDecorator;\n}\nexports.PreReq = PreReq;\n(function (PreReq) {\n function Get(value) {\n return value && value.PreReqDecorator_PreReqs || [];\n }\n function All(value) {\n var arr = Get(value).map((prop) => (value[prop] && value[prop].Init) || Promise.resolve());\n return Promise.all(arr);\n }\n PreReq.All = All;\n function Has(value) {\n return Get(value).length > 0;\n }\n PreReq.Has = Has;\n})(PreReq || (exports.PreReq = PreReq = {}));\nfunction PreReqDecorator(target, propertyKey) {\n var proto = target;\n proto.PreReqDecorator_PreReqs = proto.PreReqDecorator_PreReqs || [];\n proto.PreReqDecorator_PreReqs.push(propertyKey);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\nvar Emitter;\n(function (Emitter) {\n function Create() {\n return new Set();\n }\n Emitter.Create = Create;\n function On(emitter, callback) {\n emitter.add(callback);\n }\n Emitter.On = On;\n function Emit(emitter, ...args) {\n emitter.forEach(function (cb) {\n cb(...args);\n });\n }\n Emitter.Emit = Emit;\n function Remove(emitter, callback) {\n emitter.delete(callback);\n }\n Emitter.Remove = Remove;\n})(Emitter || (exports.Emitter = Emitter = {}));\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./decorators\"), exports);\n__exportStar(require(\"./animation\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Injector = void 0;\nclass Injector {\n parent;\n typeMap;\n constructor() {\n this.parent = Injector.Current();\n this.typeMap = new Map();\n }\n Get(type) {\n if (this.typeMap.size === 0)\n return this.parent && this.parent.Get(type);\n var ret = this.typeMap.get(type);\n if (!ret)\n ret = this.parent && this.parent.Get(type);\n return ret;\n }\n Set(type, instance) {\n this.typeMap.set(type, instance);\n }\n}\nexports.Injector = Injector;\n(function (Injector) {\n var scope = null;\n function Current() {\n return scope;\n }\n Injector.Current = Current;\n function Scope(injector, action, ...args) {\n var parent = Current();\n scope = injector;\n const ret = action(...args);\n scope = parent;\n return ret;\n }\n Injector.Scope = Scope;\n})(Injector || (exports.Injector = Injector = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.List = void 0;\nvar List;\n(function (List) {\n function Create() {\n return {\n head: null,\n tail: null,\n size: 0\n };\n }\n List.Create = Create;\n function Clear(list) {\n list.head = null;\n list.tail = null;\n list.size = 0;\n }\n List.Clear = Clear;\n function Push(list, data) {\n var node = { previous: null, next: null, data: data };\n if (list.size === 0) {\n list.head = node;\n list.tail = node;\n list.size = 1;\n }\n else {\n node.next = list.head;\n list.head.previous = node;\n list.head = node;\n list.size++;\n }\n return node;\n }\n List.Push = Push;\n function Pop(list) {\n if (list.size === 0)\n return null;\n var node = list.head;\n list.head = node.next;\n if (list.head)\n list.head.previous = null;\n list.size--;\n if (list.size === 0)\n list.tail = null;\n return node.data;\n }\n List.Pop = Pop;\n function Add(list, data) {\n const node = { previous: null, next: null, data: data };\n return AddNode(list, node);\n }\n List.Add = Add;\n function AddNode(list, node) {\n if (list.size === 0) {\n list.head = node;\n list.tail = node;\n list.size = 1;\n }\n else {\n node.previous = list.tail;\n list.tail.next = node;\n list.tail = node;\n list.size++;\n }\n return node;\n }\n List.AddNode = AddNode;\n function AddBefore(list, node, data) {\n if (!node)\n return List.Add(list, data);\n var newNode = { previous: null, next: null, data: data };\n var prevNode = node.previous;\n newNode.next = node;\n node.previous = newNode;\n if (list.head === node)\n list.head = newNode;\n if (prevNode) {\n prevNode.next = newNode;\n newNode.previous = prevNode;\n }\n list.size++;\n return newNode;\n }\n List.AddBefore = AddBefore;\n function AddAfter(list, node, data) {\n if (!node)\n return List.Push(list, data);\n var newNode = { previous: null, next: null, data: data };\n var nextNode = node.next;\n node.next = newNode;\n newNode.previous = node;\n if (list.tail === node)\n list.tail = newNode;\n if (nextNode) {\n nextNode.previous = newNode;\n newNode.next = nextNode;\n }\n list.size++;\n return newNode;\n }\n List.AddAfter = AddAfter;\n function Remove(list) {\n if (list.size === 0)\n return null;\n var node = list.tail;\n list.tail = node.previous;\n if (list.tail)\n list.tail.next = null;\n list.size--;\n if (list.size === 0)\n list.head = null;\n return node.data;\n }\n List.Remove = Remove;\n function RemoveNode(list, node) {\n if (list.head === node) {\n list.head = node.next;\n }\n else if (list.tail === node) {\n list.tail = node.previous;\n }\n else {\n const prev = node.previous;\n const next = node.next;\n prev.next = next;\n next.previous = prev;\n }\n node.next = node.previous = null;\n list.size--;\n if (list.size > 0)\n list.head.previous = list.tail.next = null;\n }\n List.RemoveNode = RemoveNode;\n function ForEach(list, callback) {\n var node = list.head;\n while (node) {\n callback(node.data);\n node = node.next;\n }\n }\n List.ForEach = ForEach;\n function ToNodeMap(list, keyCallback) {\n const map = new Map();\n let node = list.head;\n while (node) {\n const key = keyCallback(node.data);\n const nodes = map.get(key) || [node];\n if (nodes[0] !== node)\n nodes.push(node);\n else\n map.set(key, nodes);\n node = node.next;\n }\n return map;\n }\n List.ToNodeMap = ToNodeMap;\n})(List || (exports.List = List = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ThreadAsync = exports.Thread = exports.Synch = exports.Callback = exports.After = exports.Schedule = void 0;\nconst list_1 = require(\"./list\");\nconst workTimeMs = 16;\nconst contextQueue = list_1.List.Create();\nvar threadContext = null;\nvar timeoutRunning = false;\nfunction ProcessQueue() {\n var workEndTime = Date.now() + workTimeMs;\n var ctx;\n while (Date.now() < workEndTime && (ctx = list_1.List.Pop(contextQueue)))\n DoWork(ctx, workEndTime);\n if (contextQueue.size > 0)\n setTimeout(ProcessQueue);\n else\n timeoutRunning = false;\n}\nfunction ScheduleWork(ctx) {\n list_1.List.Add(contextQueue, ctx);\n if (timeoutRunning)\n return;\n timeoutRunning = true;\n setTimeout(ProcessQueue);\n}\nfunction Invoke(ctx, callback) {\n var parent = ctx.workEndNode;\n ctx.workEndNode = ctx.workList.head;\n callback();\n ctx.workEndNode = parent;\n}\nfunction DoWork(ctx, workEndTime = Date.now() + workTimeMs) {\n var parentContext = threadContext;\n threadContext = ctx;\n var async = ctx.async;\n var callback;\n while (async === ctx.async && Date.now() < workEndTime && (callback = list_1.List.Pop(ctx.workList)))\n Invoke(ctx, callback);\n if (ctx.workList.size > 0)\n ScheduleWork(ctx);\n threadContext = parentContext;\n}\nfunction CreateContext() {\n return {\n async: false,\n workEndNode: null,\n workList: list_1.List.Create()\n };\n}\nfunction ScheduleCallback(callback, before, async) {\n threadContext = threadContext || CreateContext();\n threadContext.async = threadContext.async || async;\n if (before)\n list_1.List.AddBefore(threadContext.workList, threadContext.workEndNode, callback);\n else if (threadContext.workEndNode)\n list_1.List.AddAfter(threadContext.workList, threadContext.workEndNode, callback);\n else\n threadContext.workEndNode = list_1.List.Add(threadContext.workList, callback);\n}\nfunction SynchWithoutThread(callback) {\n var workEndTime = Date.now() + workTimeMs;\n callback();\n if (threadContext)\n if (threadContext.async)\n ScheduleWork(threadContext);\n else\n DoWork(threadContext, workEndTime);\n threadContext = null;\n}\nfunction Schedule(callback) {\n ScheduleCallback(callback, true, true);\n}\nexports.Schedule = Schedule;\nfunction After(callback) {\n ScheduleCallback(callback, false, false);\n}\nexports.After = After;\nfunction Callback(callback) {\n return function (a, b, c, d) {\n Schedule(function () { callback(a, b, c, d); });\n };\n}\nexports.Callback = Callback;\nvar inSynchCallback = false;\nfunction Synch(callback) {\n if (threadContext || inSynchCallback)\n callback();\n else {\n inSynchCallback = true;\n SynchWithoutThread(callback);\n inSynchCallback = false;\n }\n}\nexports.Synch = Synch;\nfunction Thread(callback) {\n if (threadContext)\n ScheduleCallback(callback, true, false);\n else\n Synch(callback);\n}\nexports.Thread = Thread;\nfunction ThreadAsync(callback) {\n return new Promise(resolve => Thread(function () {\n callback();\n Thread(resolve);\n }));\n}\nexports.ThreadAsync = ThreadAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar component_1 = require(\"./Node/component\");\nObject.defineProperty(exports, \"Component\", { enumerable: true, get: function () { return component_1.Component; } });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsync = exports.Store = exports.ObservableScope = void 0;\n__exportStar(require(\"./index\"), exports);\n__exportStar(require(\"./Utils\"), exports);\nvar Store_1 = require(\"./Store\");\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return Store_1.ObservableScope; } });\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return Store_1.Store; } });\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return Store_1.StoreAsync; } });\n__exportStar(require(\"./DOM\"), exports);\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst Web = require(\"./web.export\");\nfor (var key in Web)\n window[key] = Web[key];\n"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"jTemplates.js","mappings":";;;;;;;;;;AAAa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB,iBAAiB,mBAAO,CAAC,qCAAU;AACnC,eAAe,mBAAO,CAAC,0CAAe;AACtC,gBAAgB,mBAAO,CAAC,mCAAS;AACjC,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;;;;;;;;;;;AC1Fa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW;AACrU,sBAAsB,mBAAO,CAAC,sDAAqB;AACnD;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;;;;;;;;;;;AC/FG;AACb;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,yCAAY;AACjC,aAAa,mBAAO,CAAC,+CAAe;AACpC,aAAa,mBAAO,CAAC,mCAAS;;;;;;;;;;;AClBjB;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc,GAAG,SAAS,GAAG,WAAW;AACxC,sBAAsB,mBAAO,CAAC,sDAAqB;AACnD;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,cAAc;;;;;;;;;;;AChBD;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;;;;;;;;;;AC9CR;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ,YAAY,kDAAkD,oIAAsB;;;;;;;;;;;ACHvE;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,0CAA0C;AACxH;AACA;AACA;AACA;AACA;AACA,8EAA8E,0CAA0C;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA,aAAa;AACb,8EAA8E,sCAAsC;AACpH;AACA;AACA;AACA;AACA,CAAC,gBAAgB,iBAAiB,iBAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AClGa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,kBAAkB,mBAAO,CAAC,wCAAW;AACrC,wBAAwB,mBAAO,CAAC,oDAAiB;AACjD,qBAAqB,mBAAO,CAAC,sDAAqB;AAClD,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,KAAK;AACrD;AACA;AACA;AACA,uDAAuD,cAAc;AACrE,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gBAAgB,iBAAiB,iBAAiB;;;;;;;;;;;AC/EtC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,kBAAkB,mBAAO,CAAC,wCAAW;AACrC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,qBAAqB,mBAAO,CAAC,sDAAqB;AAClD,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C,eAAe,mBAAO,CAAC,0CAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oBAAoB,qBAAqB,qBAAqB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA,oCAAoC,qBAAqB;AACzD;AACA;AACA;AACA;AACA,wCAAwC,qBAAqB;AAC7D;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb,KAAK;AACL;;;;;;;;;;;ACvHa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,eAAe,mBAAO,CAAC,0CAAe;AACtC,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,kBAAkB,mBAAO,CAAC,wCAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kBAAkB,mBAAmB,mBAAmB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iCAAiC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC1Ka;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,wBAAwB,mBAAO,CAAC,wDAAsB;AACtD,kBAAkB;;;;;;;;;;;ACJL;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe,GAAG,mBAAmB;AACrC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,sBAAsB,mBAAO,CAAC,gDAAe;AAC7C,wBAAwB,mBAAO,CAAC,oDAAiB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kBAAkB,mBAAmB,mBAAmB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mCAAmC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA,CAAC,cAAc,eAAe,eAAe;;;;;;;;;;;ACzLhC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,gDAAY;AACvC,sBAAsB,mBAAO,CAAC,sDAAe;AAC7C,qBAAqB,mBAAO,CAAC,oDAAc;AAC3C;AACA;AACA;AACA;AACA;AACA,gCAAgC,mDAAmD;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,8CAA8C;AAC3F;AACA;AACA,6CAA6C,wCAAwC;AACrF;AACA;AACA,sCAAsC,gDAAgD;AACtF;AACA;AACA,6CAA6C,sCAAsC;AACnF;AACA;AACA;AACA;AACA;AACA,iBAAiB;;;;;;;;;;;ACnCJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,gDAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;;;;;;;;;;AC1BH;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,oBAAoB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,KAAK;AACrC;AACA,aAAa;AACb;AACA,4BAA4B,qBAAqB;AACjD,4CAA4C,KAAK,GAAG,EAAE,OAAO,EAAE;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,KAAK,GAAG,qBAAqB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,KAAK,GAAG,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,IAAI;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;;;;;;;;;;ACvOR;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,mBAAmB,mBAAO,CAAC,gDAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,yBAAyB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,iBAAiB,kBAAkB,kBAAkB;;;;;;;;;;;AClBzC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,eAAe,mBAAO,CAAC,6CAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,mBAAmB;;;;;;;;;;;AClCN;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa;AACb,yBAAyB,mBAAO,CAAC,kEAAwB;AACzD,sBAAsB,mBAAO,CAAC,uDAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;;;;;;;;;;AC9BA;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,yBAAyB,mBAAO,CAAC,kEAAwB;AACzD,oBAAoB,mBAAO,CAAC,wDAAmB;AAC/C,2BAA2B,mBAAO,CAAC,iEAAoB;AACvD,qBAAqB,mBAAO,CAAC,yDAAwB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;;;;;;;;;;AChDL;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS,SAAS,GAAG,IAAI,qBAAqB;AACzF;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA,oDAAoD,SAAS,GAAG,OAAO;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;;;;;;;;;;;ACnDX;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,sDAAkB;AAC7C,yBAAyB,mBAAO,CAAC,kEAAwB;AACzD,0BAA0B,mBAAO,CAAC,+DAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;;;;;;;;;;AChCJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS,SAAS,GAAG,IAAI,qBAAqB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,SAAS,GAAG,OAAO;AACvD,qCAAqC,SAAS,GAAG,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;;;;;;;;;;;ACxCV;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS,GAAG,IAAI;AACzD;AACA;AACA;AACA,qCAAqC,SAAS,GAAG,cAAc;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;;;;;;;;;;;AC7BN;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,uBAAuB,GAAG,8BAA8B,GAAG,4BAA4B;AACvF,kBAAkB,mBAAO,CAAC,mDAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB,uBAAuB,uBAAuB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;;;;ACvKa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,sBAAsB;AACtB,0BAA0B,mBAAO,CAAC,oEAAyB;AAC3D;AACA;AACA;AACA;AACA;AACA,CAAC,oBAAoB;AACrB,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,mBAAmB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sDAAsD;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC,oCAAoC,KAAK,GAAG,QAAQ;AACpD;AACA;AACA;AACA,sBAAsB;;;;;;;;;;;ACxOT;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,uBAAuB,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,aAAa;AAChF,cAAc,mBAAO,CAAC,iDAAe;AACrC,yCAAwC,EAAE,qCAAqC,yBAAyB,EAAC;AACzG,kBAAkB,mBAAO,CAAC,yDAAmB;AAC7C,6CAA4C,EAAE,qCAAqC,iCAAiC,EAAC;AACrH,mBAAmB,mBAAO,CAAC,2DAAoB;AAC/C,8CAA6C,EAAE,qCAAqC,mCAAmC,EAAC;AACxH,wBAAwB,mBAAO,CAAC,mEAAwB;AACxD,mDAAkD,EAAE,qCAAqC,6CAA6C,EAAC;;;;;;;;;;;ACV1H;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,qBAAqB;AACzC;AACA;AACA;AACA;AACA,kCAAkC,WAAW;AAC7C;AACA;AACA;AACA;AACA;AACA,kCAAkC,WAAW;AAC7C;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACA;AACA,CAAC,oBAAoB,qBAAqB,qBAAqB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mCAAmC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB;;;;;;;;;;;AC3GJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,mCAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;;;;;;;;;;ACzCL;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc,GAAG,sBAAsB,GAAG,eAAe,GAAG,cAAc,GAAG,qBAAqB,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,aAAa,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,aAAa;AACrN,gBAAgB,mBAAO,CAAC,wDAAsB;AAC9C,gBAAgB,mBAAO,CAAC,sCAAU;AAClC,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE,yBAAyB,mBAAO,CAAC,wEAA8B;AAC/D;AACA;AACA;AACA,aAAa;AACb;AACA,sCAAsC,YAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,2CAA2C,YAAY;AACvD,kDAAkD,YAAY;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,qEAAqE,0BAA0B;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,sCAAsC,YAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,sCAAsC,YAAY;AAClD;AACA,qCAAqC,YAAY;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gDAAgD,YAAY;AAC5D,gDAAgD,YAAY;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,gDAAgD,YAAY;AAC5D,gDAAgD,YAAY;AAC5D,0DAA0D,YAAY;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,yEAAyE,gCAAgC;AACzG;AACA;AACA,sCAAsC,gCAAgC;AACtE,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,cAAc,eAAe,eAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,qBAAqB,sBAAsB,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,aAAa,cAAc,cAAc;AAC1C;AACA;AACA;AACA;AACA;;;;;;;;;;;ACrTa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,cAAc,eAAe,eAAe;;;;;;;;;;;ACvBhC;AACb;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,+CAAc;AACnC,aAAa,mBAAO,CAAC,6CAAa;;;;;;;;;;;ACjBrB;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,eAAe,gBAAgB,gBAAgB;;;;;;;;;;;ACrCnC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,WAAW,YAAY,YAAY;;;;;;;;;;;AC7JvB;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,cAAc,GAAG,aAAa,GAAG,gBAAgB,GAAG,aAAa,GAAG,gBAAgB;AAC1G,eAAe,mBAAO,CAAC,mCAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,mBAAmB;;;;;;;;;;;AC3GN;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,kBAAkB,mBAAO,CAAC,iDAAkB;AAC5C,6CAA4C,EAAE,qCAAqC,iCAAiC,EAAC;;;;;;;;;;;ACJxG;AACb;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB,GAAG,aAAa,GAAG,uBAAuB;AAC5D,aAAa,mBAAO,CAAC,+BAAS;AAC9B,aAAa,mBAAO,CAAC,qCAAS;AAC9B,cAAc,mBAAO,CAAC,qCAAS;AAC/B,mDAAkD,EAAE,qCAAqC,mCAAmC,EAAC;AAC7H,yCAAwC,EAAE,qCAAqC,yBAAyB,EAAC;AACzG,8CAA6C,EAAE,qCAAqC,8BAA8B,EAAC;AACnH,aAAa,mBAAO,CAAC,iCAAO;;;;;;;UCvB5B;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;;ACtBa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY,mBAAO,CAAC,yCAAc;AAClC;AACA","sources":["webpack://j-templates/./src/DOM/domNodeConfig.ts","webpack://j-templates/./src/DOM/elements.ts","webpack://j-templates/./src/DOM/index.ts","webpack://j-templates/./src/DOM/svgElements.ts","webpack://j-templates/./src/DOM/utils.ts","webpack://j-templates/./src/DOM/window.ts","webpack://j-templates/./src/Node/boundNode.ts","webpack://j-templates/./src/Node/component.ts","webpack://j-templates/./src/Node/componentNode.ts","webpack://j-templates/./src/Node/elementNode.ts","webpack://j-templates/./src/Node/nodeConfig.ts","webpack://j-templates/./src/Node/nodeRef.ts","webpack://j-templates/./src/Store/Diff/diffAsync.ts","webpack://j-templates/./src/Store/Diff/diffSync.ts","webpack://j-templates/./src/Store/Diff/diffTree.ts","webpack://j-templates/./src/Store/Diff/diffWorker.ts","webpack://j-templates/./src/Store/Diff/workerQueue.ts","webpack://j-templates/./src/Store/Store/store.ts","webpack://j-templates/./src/Store/Store/storeAsync.ts","webpack://j-templates/./src/Store/Store/storeAsyncWriter.ts","webpack://j-templates/./src/Store/Store/storeSync.ts","webpack://j-templates/./src/Store/Store/storeSyncWriter.ts","webpack://j-templates/./src/Store/Store/storeWriter.ts","webpack://j-templates/./src/Store/Tree/observableScope.ts","webpack://j-templates/./src/Store/Tree/observableTree.ts","webpack://j-templates/./src/Store/index.ts","webpack://j-templates/./src/Utils/animation.ts","webpack://j-templates/./src/Utils/asyncQueue.ts","webpack://j-templates/./src/Utils/decorators.ts","webpack://j-templates/./src/Utils/emitter.ts","webpack://j-templates/./src/Utils/index.ts","webpack://j-templates/./src/Utils/injector.ts","webpack://j-templates/./src/Utils/list.ts","webpack://j-templates/./src/Utils/thread.ts","webpack://j-templates/./src/index.ts","webpack://j-templates/./src/web.export.ts","webpack://j-templates/webpack/bootstrap","webpack://j-templates/./src/web.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DOMNodeConfig = void 0;\nconst window_1 = require(\"./window\");\nconst list_1 = require(\"../Utils/list\");\nconst utils_1 = require(\"./utils\");\nconst thread_1 = require(\"../Utils/thread\");\nvar pendingUpdates = list_1.List.Create();\nvar updateScheduled = false;\nfunction processUpdates() {\n list_1.List.Add(pendingUpdates, null);\n var callback;\n while ((callback = list_1.List.Pop(pendingUpdates)))\n (0, thread_1.Synch)(callback);\n if (pendingUpdates.size === 0)\n updateScheduled = false;\n else\n window_1.wndw.requestAnimationFrame(processUpdates);\n}\nexports.DOMNodeConfig = {\n createNode(type, namespace) {\n return type !== \"text\" ?\n namespace ?\n window_1.wndw.document.createElementNS(namespace, type) :\n window_1.wndw.document.createElement(type) :\n window_1.wndw.document.createTextNode(\"\");\n },\n scheduleUpdate(callback) {\n list_1.List.Add(pendingUpdates, callback);\n if (!updateScheduled) {\n updateScheduled = true;\n window_1.wndw.requestAnimationFrame(processUpdates);\n }\n },\n addListener(target, type, callback) {\n target.addEventListener(type, callback);\n },\n removeListener(target, type, callback) {\n target.removeEventListener(type, callback);\n },\n addChild(root, child) {\n root.appendChild(child);\n },\n addChildFirst(root, child) {\n exports.DOMNodeConfig.addChildBefore(root, root.firstChild, child);\n },\n addChildBefore(root, sibling, child) {\n if (!sibling) {\n exports.DOMNodeConfig.addChild(root, child);\n return;\n }\n if (child !== sibling)\n root.insertBefore(child, sibling);\n },\n addChildAfter(root, sibling, child) {\n if (!sibling) {\n exports.DOMNodeConfig.addChildFirst(root, child);\n return;\n }\n exports.DOMNodeConfig.addChildBefore(root, sibling.nextSibling, child);\n },\n removeChild(root, child) {\n root.removeChild(child);\n },\n remove(target) {\n target && target.parentNode && target.parentNode.removeChild(target);\n },\n setText(target, text) {\n target.textContent = text;\n },\n getAttribute(target, attribute) {\n return target.getAttribute(attribute);\n },\n setAttribute(target, attribute, value) {\n target.setAttribute(attribute, value);\n },\n fireEvent(target, event, data) {\n var cEvent = new CustomEvent(event, data);\n target.dispatchEvent(cEvent);\n },\n setProperties: utils_1.SetProperties,\n getFirstChild(target) {\n return target.firstChild;\n },\n getNextSibling(target) {\n return target.nextSibling;\n },\n replaceChildren(target, children) {\n target.replaceChildren(...children);\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.td = exports.tr = exports.th = exports.table = exports.button = exports.style = exports.p = exports.h3 = exports.h2 = exports.h1 = exports.option = exports.select = exports.input = exports.source = exports.video = exports.img = exports.span = exports.b = exports.br = exports.li = exports.ul = exports.a = exports.div = void 0;\nconst elementNode_1 = require(\"../Node/elementNode\");\nfunction div(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"div\", null, nodeDef, children);\n}\nexports.div = div;\nfunction a(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"a\", null, nodeDef, children);\n}\nexports.a = a;\nfunction ul(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"ul\", null, nodeDef, children);\n}\nexports.ul = ul;\nfunction li(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"li\", null, nodeDef, children);\n}\nexports.li = li;\nfunction br(nodeDef) {\n return elementNode_1.ElementNode.Create(\"br\", null, nodeDef, null);\n}\nexports.br = br;\nfunction b(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"b\", null, nodeDef, children);\n}\nexports.b = b;\nfunction span(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"span\", null, nodeDef, children);\n}\nexports.span = span;\nfunction img(nodeDef) {\n return elementNode_1.ElementNode.Create(\"img\", null, nodeDef, null);\n}\nexports.img = img;\nfunction video(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"video\", null, nodeDef, children);\n}\nexports.video = video;\nfunction source(nodeDef) {\n return elementNode_1.ElementNode.Create(\"source\", null, nodeDef, null);\n}\nexports.source = source;\nfunction input(nodeDef) {\n return elementNode_1.ElementNode.Create(\"input\", null, nodeDef, null);\n}\nexports.input = input;\nfunction select(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"select\", null, nodeDef, children);\n}\nexports.select = select;\nfunction option(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"option\", null, nodeDef, children);\n}\nexports.option = option;\nfunction h1(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h1\", null, nodeDef, children);\n}\nexports.h1 = h1;\nfunction h2(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h2\", null, nodeDef, children);\n}\nexports.h2 = h2;\nfunction h3(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h3\", null, nodeDef, children);\n}\nexports.h3 = h3;\nfunction p(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"p\", null, nodeDef, children);\n}\nexports.p = p;\nfunction style(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"style\", null, nodeDef, children);\n}\nexports.style = style;\nfunction button(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"button\", null, nodeDef, children);\n}\nexports.button = button;\nfunction table(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"table\", null, nodeDef, children);\n}\nexports.table = table;\nfunction th(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"th\", null, nodeDef, children);\n}\nexports.th = th;\nfunction tr(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"tr\", null, nodeDef, children);\n}\nexports.tr = tr;\nfunction td(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"td\", null, nodeDef, children);\n}\nexports.td = td;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./elements\"), exports);\n__exportStar(require(\"./svgElements\"), exports);\n__exportStar(require(\"./utils\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.circle = exports.g = exports.svg = void 0;\nconst elementNode_1 = require(\"../Node/elementNode\");\nconst svgNs = \"http://www.w3.org/2000/svg\";\nfunction svg(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"svg\", svgNs, nodeDef, children);\n}\nexports.svg = svg;\nfunction g(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"g\", svgNs, nodeDef, children);\n}\nexports.g = g;\nfunction circle(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"circle\", svgNs, nodeDef, children);\n}\nexports.circle = circle;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SetProperties = void 0;\nfunction SetValue(target, value) {\n switch (target.nodeName) {\n case \"INPUT\":\n var start = target.selectionStart;\n var end = target.selectionEnd;\n target.value = value;\n if (target.ownerDocument.activeElement === target)\n target.setSelectionRange(start, end);\n break;\n default:\n target.value = value;\n }\n}\nfunction SetStyle(target, styleDef, lastStyleDef) {\n for (var key in styleDef)\n if (!lastStyleDef || lastStyleDef[key] !== styleDef[key])\n target.style[key] = styleDef[key];\n}\nfunction SetRootProperty(target, prop, value, lastValue) {\n switch (prop) {\n case \"value\":\n SetValue(target, value);\n break;\n case \"style\":\n SetStyle(target, value, lastValue);\n break;\n default:\n target[prop] = value;\n }\n}\nfunction SetChangedProperties(target, lastProperties, properties) {\n const keys = Object.keys(properties);\n for (let x = 0; x < keys.length; x++) {\n if (!lastProperties || lastProperties[keys[x]] !== properties[keys[x]])\n SetRootProperty(target, keys[x], properties[keys[x]], lastProperties && lastProperties[keys[x]]);\n }\n}\nfunction SetProperties(target, lastProperties, properties) {\n if (!lastProperties && target.nodeType === Node.TEXT_NODE)\n target.nodeValue = properties.nodeValue;\n else\n SetChangedProperties(target, lastProperties, properties);\n}\nexports.SetProperties = SetProperties;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wndw = void 0;\nexports.wndw = typeof window !== \"undefined\" ? window : (new (require(\"jsdom\").JSDOM(\"\")).window);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BoundNode = void 0;\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nvar BoundNode;\n(function (BoundNode) {\n function Init(boundNode) {\n const nodeDef = boundNode.nodeDef;\n if (nodeDef.props) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.props);\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetProperties(boundNode, scope); });\n SetProperties(boundNode, observableScope_1.ObservableScope.Value(scope));\n }\n if (nodeDef.attrs) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.attrs);\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetAttributes(boundNode, scope); });\n SetAttributes(boundNode, observableScope_1.ObservableScope.Value(scope));\n }\n if (nodeDef.on) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.on);\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\n boundNode.destroyables.push({\n Destroy() {\n SetEvents(boundNode, {});\n }\n });\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetEvents(boundNode, scope); });\n SetEvents(boundNode, observableScope_1.ObservableScope.Value(scope));\n }\n }\n BoundNode.Init = Init;\n})(BoundNode || (exports.BoundNode = BoundNode = {}));\nfunction CreateScopeDestroyable(scope) {\n return {\n Destroy() {\n observableScope_1.ObservableScope.Destroy(scope);\n }\n };\n}\nfunction ScheduleSetProperties(node, scope) {\n if (node.setProperties)\n return;\n node.setProperties = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setProperties = false;\n if (node.destroyed)\n return;\n SetProperties(node, observableScope_1.ObservableScope.Value(scope));\n });\n}\nfunction SetProperties(node, properties) {\n if (!properties)\n return;\n nodeConfig_1.NodeConfig.setProperties(node.node, node.lastProperties, properties);\n node.lastProperties = properties;\n}\nfunction ScheduleSetAttributes(node, scope) {\n if (node.setAttributes)\n return;\n node.setAttributes = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setAttributes = false;\n if (node.destroyed)\n return;\n SetAttributes(node, observableScope_1.ObservableScope.Value(scope));\n });\n}\nfunction SetAttributes(node, attributes) {\n if (!attributes)\n return;\n for (var key in attributes) {\n var val = nodeConfig_1.NodeConfig.getAttribute(node.node, key);\n if (val !== attributes[key])\n nodeConfig_1.NodeConfig.setAttribute(node.node, key, attributes[key]);\n }\n}\nfunction ScheduleSetEvents(node, scope) {\n if (node.setEvents)\n return;\n node.setEvents = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setEvents = false;\n if (node.destroyed)\n return;\n SetEvents(node, observableScope_1.ObservableScope.Value(scope));\n });\n}\nfunction SetEvents(node, events) {\n if (!events)\n return;\n for (var key in node.lastEvents)\n nodeConfig_1.NodeConfig.removeListener(node.node, key, node.lastEvents[key]);\n for (var key in events)\n nodeConfig_1.NodeConfig.addListener(node.node, key, events[key]);\n node.lastEvents = events;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nconst nodeRef_1 = require(\"./nodeRef\");\nconst componentNode_1 = require(\"./componentNode\");\nconst decorators_1 = require(\"../Utils/decorators\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nclass Component {\n nodeRef;\n componentEvents;\n scope;\n templates;\n decoratorMap;\n get Injector() {\n return this.nodeRef.injector;\n }\n get Destroyed() {\n return this.nodeRef.destroyed;\n }\n get DecoratorMap() {\n return this.decoratorMap;\n }\n get Scope() {\n return this.scope;\n }\n get Data() {\n return this.scope.Value;\n }\n get NodeRef() {\n return this.nodeRef;\n }\n get Templates() {\n return this.templates;\n }\n constructor(data, templates, nodeRef, componentEvents) {\n this.nodeRef = nodeRef;\n this.componentEvents = componentEvents;\n this.scope = new observableScope_1.ObservableScope(data);\n this.templates = templates || {};\n this.decoratorMap = new Map();\n }\n Template() {\n return [];\n }\n Bound() {\n }\n Fire(event, data) {\n var eventCallback = this.componentEvents && this.componentEvents[event];\n eventCallback && eventCallback(data);\n }\n Destroy() {\n decorators_1.Destroy.All(this);\n }\n}\nexports.Component = Component;\n(function (Component) {\n function ToFunction(type, namespace, constructor) {\n return componentNode_1.ComponentNode.ToFunction(type, namespace, constructor);\n }\n Component.ToFunction = ToFunction;\n function Register(name, constructor) {\n const componentFunction = ToFunction(`${name}-component`, undefined, constructor);\n class WebComponent extends HTMLElement {\n constructor() {\n super();\n const shadowRoot = this.attachShadow({ mode: 'open' });\n const node = componentFunction({});\n Attach(shadowRoot, node);\n }\n }\n customElements.define(name, WebComponent);\n }\n Component.Register = Register;\n function Attach(node, nodeRef) {\n nodeRef_1.NodeRef.Init(nodeRef);\n var rootRef = nodeRef_1.NodeRef.Wrap(node);\n nodeRef_1.NodeRef.AddChild(rootRef, nodeRef);\n }\n Component.Attach = Attach;\n})(Component || (exports.Component = Component = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ComponentNode = void 0;\nconst boundNode_1 = require(\"./boundNode\");\nconst nodeRef_1 = require(\"./nodeRef\");\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst component_1 = require(\"./component\");\nconst injector_1 = require(\"../Utils/injector\");\nconst decorators_1 = require(\"../Utils/decorators\");\nconst thread_1 = require(\"../Utils/thread\");\nconst list_1 = require(\"../Utils/list\");\nvar ComponentNode;\n(function (ComponentNode) {\n function Fire(event, data) {\n var eventCallback = this.componentEvents && this.componentEvents[event];\n eventCallback && eventCallback(data);\n }\n ComponentNode.Fire = Fire;\n function ToFunction(type, namespace, constructor) {\n return function (nodeDef, templates) {\n return Create(type, namespace, nodeDef, constructor, templates);\n };\n }\n ComponentNode.ToFunction = ToFunction;\n function Init(componentNode) {\n var nodeDef = componentNode.nodeDef;\n var events = nodeDef.on;\n nodeDef.on = null;\n componentNode.component = new componentNode.constructor(nodeDef.data, componentNode.templates, componentNode, events);\n SetChildren(componentNode);\n componentNode.destroyables.push(componentNode.component);\n boundNode_1.BoundNode.Init(componentNode);\n }\n ComponentNode.Init = Init;\n})(ComponentNode || (exports.ComponentNode = ComponentNode = {}));\nfunction Create(type, namespace, nodeDef, constructor, templates) {\n var compNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ComponentNode);\n compNode.nodeDef = nodeDef;\n compNode.constructor = constructor;\n compNode.templates = templates;\n return compNode;\n}\nfunction SetChildren(node) {\n if (decorators_1.PreReq.Has(node.component)) {\n AddPreReqTemplate(node).then(function () {\n AddTemplate(node, false);\n });\n }\n else\n AddTemplate(node, true);\n}\nfunction AddPreReqTemplate(node) {\n return new Promise(resolve => {\n (0, thread_1.Thread)(function () {\n const preNodes = injector_1.Injector.Scope(node.injector, decorators_1.PreReqTemplate.Get, node.component);\n (0, thread_1.Schedule)(function () {\n if (node.destroyed)\n return;\n nodeRef_1.NodeRef.InitAll(node, preNodes);\n });\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.AddChild(node, preNodes[x]);\n decorators_1.PreReq.All(node.component).then(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.Destroy(preNodes[x]);\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.DetachChild(node, preNodes[x]);\n resolve();\n });\n });\n });\n });\n });\n}\nfunction InvokeNodeTemplate(node) {\n const nodes = node.component.Template();\n if (!Array.isArray(nodes))\n return [nodes];\n return nodes;\n}\nfunction AddTemplate(node, init) {\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const nodes = injector_1.Injector.Scope(node.injector, InvokeNodeTemplate, node);\n (0, thread_1.Schedule)(function () {\n nodeRef_1.NodeRef.InitAll(node, nodes);\n });\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const list = list_1.List.Create();\n list_1.List.Add(list, {\n value: undefined,\n init: true,\n nodes\n });\n if (init)\n nodeRef_1.NodeRef.ReconcileChildren(node, list);\n else\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed)\n return;\n nodeRef_1.NodeRef.ReconcileChildren(node, list);\n });\n });\n if (node.component.Bound !== component_1.Component.prototype.Bound)\n (0, thread_1.After)(function () {\n nodeConfig_1.NodeConfig.scheduleUpdate(() => setTimeout(() => node.component.Bound(), 0));\n });\n });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ElementNode = void 0;\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nconst injector_1 = require(\"../Utils/injector\");\nconst list_1 = require(\"../Utils/list\");\nconst thread_1 = require(\"../Utils/thread\");\nconst boundNode_1 = require(\"./boundNode\");\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst nodeRef_1 = require(\"./nodeRef\");\nvar ElementNode;\n(function (ElementNode) {\n function Create(type, namespace, nodeDef, children) {\n var elemNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ElementNode);\n elemNode.nodeDef = nodeDef;\n elemNode.childrenFunc = children;\n return elemNode;\n }\n ElementNode.Create = Create;\n function Init(elementNode) {\n if (elementNode.childrenFunc) {\n var nodeDef = elementNode.nodeDef;\n if (nodeDef.data) {\n const dataScope = observableScope_1.ObservableScope.Create(nodeDef.data);\n observableScope_1.ObservableScope.Watch(dataScope, function () {\n ScheduleSetData(elementNode, dataScope);\n });\n SetData(elementNode, GetValue(dataScope), true);\n elementNode.destroyables.push({\n Destroy: function () {\n observableScope_1.ObservableScope.Destroy(dataScope);\n }\n });\n }\n else\n SetDefaultData(elementNode);\n }\n boundNode_1.BoundNode.Init(elementNode);\n }\n ElementNode.Init = Init;\n})(ElementNode || (exports.ElementNode = ElementNode = {}));\nconst valueDefault = [];\nfunction GetValue(dataScope) {\n var value = observableScope_1.ObservableScope.Value(dataScope);\n if (!value)\n return valueDefault;\n if (!Array.isArray(value))\n value = [value];\n return value;\n}\nfunction ScheduleSetData(node, scope) {\n if (node.setData)\n return;\n node.setData = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setData = false;\n if (node.destroyed)\n return;\n SetData(node, GetValue(scope));\n });\n}\nfunction SetDefaultData(node) {\n (0, thread_1.Synch)(function () {\n const nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, true);\n if (nodes.length > 0) {\n nodeRef_1.NodeRef.InitAll(node, nodes);\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const defaultNodeList = list_1.List.Create();\n list_1.List.Add(defaultNodeList, {\n value: null,\n init: true,\n nodes\n });\n nodeRef_1.NodeRef.ReconcileChildren(node, defaultNodeList);\n });\n }\n });\n}\nfunction GetDataValue(data) {\n return data.value;\n}\nfunction ReconcileNodeData(node, values) {\n const nextNodeList = list_1.List.Create();\n const initNodeList = list_1.List.Create();\n const currentNodeList = node.nodeList;\n const nodeMap = currentNodeList && list_1.List.ToNodeMap(currentNodeList, GetDataValue);\n for (let x = 0; x < values.length; x++) {\n let curNode;\n if (nodeMap) {\n const nodeArr = nodeMap.get(values[x]);\n if (nodeArr) {\n let y = nodeArr.length - 1;\n for (; y >= 0 && !curNode; y--) {\n curNode = nodeArr[y];\n nodeArr[y] = null;\n }\n }\n }\n if (curNode) {\n list_1.List.RemoveNode(currentNodeList, curNode);\n list_1.List.AddNode(nextNodeList, curNode);\n if (!curNode.data.init)\n list_1.List.Add(initNodeList, curNode.data);\n }\n else {\n curNode = list_1.List.Add(nextNodeList, {\n value: values[x],\n init: false,\n nodes: injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, values[x])\n });\n list_1.List.Add(initNodeList, curNode.data);\n }\n }\n let curNode = initNodeList.head;\n while (curNode) {\n const data = curNode.data;\n (0, thread_1.Schedule)(function () {\n if (node.destroyed || nextNodeList.size === 0)\n return;\n nodeRef_1.NodeRef.InitAll(node, data.nodes);\n data.init = true;\n });\n curNode = curNode.next;\n }\n if (currentNodeList) {\n let curDetach = currentNodeList.head;\n while (curDetach) {\n nodeRef_1.NodeRef.DestroyAll(curDetach.data.nodes);\n for (let x = 0; x < curDetach.data.nodes.length; x++)\n node.childNodes.delete(curDetach.data.nodes[x]);\n curDetach = curDetach.next;\n }\n list_1.List.Clear(currentNodeList);\n }\n node.nodeList = nextNodeList;\n}\nfunction SetData(node, values, init = false) {\n (0, thread_1.Synch)(function () {\n ReconcileNodeData(node, values);\n const attachNodes = node.nodeList;\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n if (init)\n nodeRef_1.NodeRef.ReconcileChildren(node, attachNodes);\n else\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed || attachNodes.size < node.childNodes.size)\n return;\n nodeRef_1.NodeRef.ReconcileChildren(node, attachNodes);\n });\n });\n });\n}\nfunction CreateNodeArray(childrenFunc, value) {\n var newNodes = childrenFunc(value);\n if (typeof newNodes === \"string\") {\n var textNode = nodeRef_1.NodeRef.Create(\"text\", null, nodeRef_1.NodeRefType.BoundNode);\n textNode.nodeDef = {\n props: function () {\n return { nodeValue: childrenFunc(value) };\n }\n };\n return [textNode];\n }\n if (Array.isArray(newNodes))\n return newNodes;\n return [newNodes];\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeConfig = void 0;\nconst domNodeConfig_1 = require(\"../DOM/domNodeConfig\");\nexports.NodeConfig = domNodeConfig_1.DOMNodeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeRef = exports.NodeRefType = void 0;\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst injector_1 = require(\"../Utils/injector\");\nconst boundNode_1 = require(\"./boundNode\");\nconst elementNode_1 = require(\"./elementNode\");\nconst componentNode_1 = require(\"./componentNode\");\nvar NodeRefType;\n(function (NodeRefType) {\n NodeRefType[NodeRefType[\"NodeRef\"] = 0] = \"NodeRef\";\n NodeRefType[NodeRefType[\"BoundNode\"] = 1] = \"BoundNode\";\n NodeRefType[NodeRefType[\"ElementNode\"] = 2] = \"ElementNode\";\n NodeRefType[NodeRefType[\"ComponentNode\"] = 3] = \"ComponentNode\";\n})(NodeRefType || (exports.NodeRefType = NodeRefType = {}));\nvar NodeRef;\n(function (NodeRef) {\n function Wrap(node) {\n var nodeRef = Create(null, null, NodeRefType.NodeRef);\n nodeRef.node = node;\n nodeRef.childNodes = new Set();\n return nodeRef;\n }\n NodeRef.Wrap = Wrap;\n function Create(nodeType, namespace, type) {\n switch (type) {\n case NodeRefType.NodeRef:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.NodeRef,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: []\n };\n case NodeRefType.BoundNode:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.BoundNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: [],\n lastProperties: null,\n lastEvents: null,\n setProperties: false,\n setAttributes: false,\n setEvents: false\n };\n case NodeRefType.ElementNode:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.ElementNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: [],\n lastProperties: null,\n lastEvents: null,\n setProperties: false,\n setAttributes: false,\n setEvents: false,\n childrenFunc: null,\n nodeList: null,\n setData: false\n };\n case NodeRefType.ComponentNode:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.ComponentNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: [],\n lastProperties: null,\n lastEvents: null,\n setProperties: false,\n setAttributes: false,\n setEvents: false,\n component: null,\n componentEvents: null\n };\n }\n }\n NodeRef.Create = Create;\n function Init(nodeRef) {\n if (nodeRef.node)\n return;\n nodeRef.node = nodeConfig_1.NodeConfig.createNode(nodeRef.nodeType, nodeRef.nodeNamespace);\n nodeRef.childNodes = new Set();\n switch (nodeRef.type) {\n case NodeRefType.BoundNode:\n boundNode_1.BoundNode.Init(nodeRef);\n break;\n case NodeRefType.ElementNode:\n elementNode_1.ElementNode.Init(nodeRef);\n break;\n case NodeRefType.ComponentNode:\n componentNode_1.ComponentNode.Init(nodeRef);\n break;\n }\n }\n NodeRef.Init = Init;\n function InitAll(parentNode, nodeRefs) {\n for (var x = 0; x < nodeRefs.length; x++) {\n nodeRefs[x].parent = parentNode;\n parentNode.childNodes.add(nodeRefs[x]);\n Init(nodeRefs[x]);\n }\n }\n NodeRef.InitAll = InitAll;\n function AddChild(node, child) {\n child.parent = node;\n node.childNodes.add(child);\n nodeConfig_1.NodeConfig.addChild(node.node, child.node);\n }\n NodeRef.AddChild = AddChild;\n function AddChildAfter(node, currentChild, newChild) {\n if (currentChild && currentChild.parent !== node)\n throw \"currentChild is not valid\";\n newChild.parent = node;\n node.childNodes.add(newChild);\n nodeConfig_1.NodeConfig.addChildAfter(node.node, currentChild && currentChild.node, newChild.node);\n }\n NodeRef.AddChildAfter = AddChildAfter;\n function ReconcileChildren(node, nextChildren) {\n const rootNode = node.node;\n if (nextChildren.size === 0) {\n nodeConfig_1.NodeConfig.replaceChildren(rootNode, []);\n return;\n }\n let priorNode;\n let curDataNode = nextChildren?.head;\n while (curDataNode) {\n for (let x = 0; x < curDataNode.data.nodes.length; x++) {\n const actualNode = priorNode ? nodeConfig_1.NodeConfig.getNextSibling(priorNode) : nodeConfig_1.NodeConfig.getFirstChild(rootNode);\n const virtualNode = curDataNode.data.nodes[x];\n const expectedNode = virtualNode.node;\n if (actualNode !== expectedNode) {\n nodeConfig_1.NodeConfig.addChildBefore(rootNode, actualNode, expectedNode);\n }\n priorNode = expectedNode;\n }\n curDataNode = curDataNode.next;\n }\n let remainingSibling = priorNode && nodeConfig_1.NodeConfig.getNextSibling(priorNode);\n while (remainingSibling) {\n nodeConfig_1.NodeConfig.removeChild(rootNode, remainingSibling);\n remainingSibling = nodeConfig_1.NodeConfig.getNextSibling(priorNode);\n }\n }\n NodeRef.ReconcileChildren = ReconcileChildren;\n function DetachChild(node, child) {\n if (node.childNodes.delete(child)) {\n nodeConfig_1.NodeConfig.removeChild(node.node, child.node);\n child.parent = null;\n }\n }\n NodeRef.DetachChild = DetachChild;\n function Destroy(node) {\n if (node.destroyed)\n return;\n node.destroyed = true;\n node.childNodes?.forEach(Destroy);\n for (let x = 0; x < node.destroyables.length; x++)\n node.destroyables[x]?.Destroy();\n }\n NodeRef.Destroy = Destroy;\n function DestroyAll(nodes) {\n for (var x = 0; x < nodes.length; x++)\n Destroy(nodes[x]);\n }\n NodeRef.DestroyAll = DestroyAll;\n})(NodeRef || (exports.NodeRef = NodeRef = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffAsync = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nconst workerQueue_1 = require(\"./workerQueue\");\nconst diffWorker_1 = require(\"./diffWorker\");\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\nclass DiffAsync {\n workerQueue;\n constructor(keyFunc) {\n this.workerQueue = new workerQueue_1.WorkerQueue(diffWorker_1.DiffWorker.Create());\n this.workerQueue.Push({ method: \"create\", arguments: [keyFunc.toString()] });\n }\n static GetKeyRef(key) {\n return diffCnstr.GetKeyRef(key);\n }\n static ReadKeyRef(ref) {\n return diffCnstr.ReadKeyRef(ref);\n }\n async DiffPath(path, value) {\n return await this.workerQueue.Push({ method: \"diffpath\", arguments: [path, value] });\n }\n async DiffBatch(data) {\n return await this.workerQueue.Push({ method: \"diffbatch\", arguments: [data] });\n }\n async UpdatePath(path, value) {\n await this.workerQueue.Push({ method: \"updatepath\", arguments: [path, value] });\n }\n async GetPath(path) {\n return await this.workerQueue.Push({ method: \"getpath\", arguments: [path] });\n }\n Destroy() {\n this.workerQueue.Destroy();\n }\n}\nexports.DiffAsync = DiffAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffSync = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\nclass DiffSync {\n diffTree;\n constructor(keyFunc) {\n this.diffTree = new diffCnstr(keyFunc);\n }\n static GetKeyRef(key) {\n return diffCnstr.GetKeyRef(key);\n }\n static ReadKeyRef(ref) {\n return diffCnstr.ReadKeyRef(ref);\n }\n DiffPath(path, value) {\n return this.diffTree.DiffPath(path, value);\n }\n DiffBatch(data) {\n return this.diffTree.DiffBatch(data);\n }\n UpdatePath(path, value) {\n this.diffTree.UpdatePath(path, value);\n }\n}\nexports.DiffSync = DiffSync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffTreeScope = void 0;\nfunction DiffTreeScope(worker) {\n const ctx = this;\n if (ctx && worker) {\n let diffTree = null;\n ctx.onmessage = function (event) {\n var data = event.data;\n switch (data.method) {\n case \"create\":\n var keyFunc = data.arguments[0] ? eval(data.arguments[0]) : undefined;\n diffTree = new DiffTree(keyFunc);\n ctx.postMessage(null);\n break;\n case \"diffpath\":\n var diff = diffTree.DiffPath(data.arguments[0], data.arguments[1]);\n ctx.postMessage(diff);\n break;\n case \"diffbatch\":\n var diff = diffTree.DiffBatch(data.arguments[0]);\n ctx.postMessage(diff);\n break;\n case \"updatepath\":\n diffTree.UpdatePath(data.arguments[0], data.arguments[1]);\n ctx.postMessage(null);\n break;\n case \"getpath\":\n var ret = diffTree.GetPath(data.arguments[0]);\n ctx.postMessage(ret);\n break;\n }\n };\n }\n const jsonConstructor = {}.constructor;\n function IsValue(value) {\n if (!value)\n return true;\n return !(jsonConstructor === value.constructor || Array.isArray(value));\n }\n let Type;\n (function (Type) {\n Type[Type[\"Value\"] = 0] = \"Value\";\n Type[Type[\"Object\"] = 1] = \"Object\";\n Type[Type[\"Array\"] = 2] = \"Array\";\n })(Type || (Type = {}));\n function TypeOf(value) {\n if (!value)\n return Type.Value;\n if (jsonConstructor === value.constructor)\n return Type.Object;\n if (Array.isArray(value))\n return Type.Array;\n return Type.Value;\n }\n function JsonDiffRecursive(path, newValue, oldValue, resp) {\n if (newValue === oldValue)\n return false;\n const newType = TypeOf(newValue);\n const oldType = TypeOf(oldValue);\n const changedPathLength = resp.length;\n let allChildrenChanged = true;\n if (newType === oldType)\n switch (newType) {\n case Type.Array: {\n allChildrenChanged = JsonDiffArrays(path, newValue, oldValue, resp);\n break;\n }\n case Type.Object: {\n allChildrenChanged = JsonDiffObjects(path, newValue, oldValue, resp);\n break;\n }\n }\n if (allChildrenChanged) {\n resp.splice(changedPathLength);\n resp.push({\n path,\n value: newValue\n });\n return true;\n }\n return false;\n }\n function JsonDiffArrays(path, newValue, oldValue, resp) {\n let allChildrenChanged = true;\n if (newValue.length !== oldValue.length)\n resp.push({\n path: path ? `${path}.length` : 'length',\n value: newValue.length\n });\n if (newValue.length > 0 || oldValue.length > 0) {\n for (let y = 0; y < newValue.length; y++) {\n const arrayPath = path ? `${path}.${y}` : `${y}`;\n allChildrenChanged = JsonDiffRecursive(arrayPath, newValue[y], oldValue[y], resp) && allChildrenChanged;\n }\n }\n else\n allChildrenChanged = false;\n return allChildrenChanged;\n }\n function JsonDiffObjects(path, newValue, oldValue, resp) {\n let allChildrenChanged = true;\n const newKeys = Object.keys(newValue);\n const oldKeys = Object.keys(oldValue);\n if (newKeys.length === 0 && oldKeys.length === 0) {\n return false;\n }\n if (newKeys.length >= oldKeys.length) {\n let newKeyIndex = 0;\n let oldKeyIndex = 0;\n while (newKeyIndex < newKeys.length) {\n const childPath = path ? `${path}.${newKeys[newKeyIndex]}` : newKeys[newKeyIndex];\n if (oldKeyIndex < oldKeys.length && newKeys[newKeyIndex] === oldKeys[oldKeyIndex]) {\n allChildrenChanged =\n JsonDiffRecursive(childPath, newValue[newKeys[newKeyIndex]], oldValue[oldKeys[oldKeyIndex]], resp) &&\n allChildrenChanged;\n oldKeyIndex++;\n }\n else if (newValue[newKeys[newKeyIndex]] !== undefined) {\n resp.push({\n path: childPath,\n value: newValue[newKeys[newKeyIndex]]\n });\n }\n newKeyIndex++;\n }\n if (oldKeyIndex < oldKeys.length)\n allChildrenChanged = true;\n }\n return allChildrenChanged;\n }\n function BreakUpValue(path, parent, keyFunc, prop, map) {\n const value = prop ? parent[prop] : parent;\n const isValue = IsValue(value);\n if (!map && isValue)\n return new Map([[path, value]]);\n map = map || new Map();\n if (isValue)\n return map;\n const key = keyFunc ? keyFunc(value) : null;\n const keyRef = key && DiffTree.GetKeyRef(key);\n if (key && key !== path) {\n if (prop)\n parent[prop] = keyRef;\n BreakUpValue(key, value, keyFunc, null, map);\n }\n else {\n for (const subProp in value) {\n const childPath = `${path}.${subProp}`;\n BreakUpValue(childPath, value, keyFunc, subProp, map);\n }\n }\n if (!prop)\n map.set(path, key === path ? value : keyRef || value);\n return map;\n }\n class DiffTree {\n keyFunc;\n rootStateMap = new Map();\n constructor(keyFunc) {\n this.keyFunc = keyFunc;\n }\n static GetKeyRef(key) {\n return `___DiffTreeKeyRef.${key}`;\n }\n static ReadKeyRef(ref) {\n if (!ref)\n return undefined;\n var matches = ref.match(/^___DiffTreeKeyRef\\.([^.]+$)/);\n if (!matches)\n return undefined;\n return matches[1];\n }\n DiffBatch(data) {\n var resp = [];\n ;\n for (var x = 0; x < data.length; x++)\n this.RunDiff(data[x].path, data[x].value, resp);\n return resp;\n }\n DiffPath(path, value) {\n var resp = [];\n this.RunDiff(path, value, resp);\n return resp;\n }\n UpdatePath(path, value) {\n this.SetPathValue(path, value);\n }\n GetPath(path) {\n return this.GetPathValue(path);\n }\n RunDiff(path, value, diffResp) {\n var breakupMap = this.GetBreakUpMap(path, value);\n var resp = diffResp || [];\n breakupMap.forEach((value, key) => {\n var currentValue = key.split(\".\").reduce((pre, curr, index) => {\n if (index === 0)\n return this.rootStateMap.get(curr);\n return pre && pre[curr];\n }, null);\n JsonDiffRecursive(key, value, currentValue, resp);\n });\n for (var x = 0; x < resp.length; x++)\n this.SetPathValue(resp[x].path, resp[x].value);\n }\n GetPathValue(path) {\n var parts = path.split(\".\");\n var curr = this.rootStateMap.get(parts[0]);\n for (var x = 1; x < parts.length; x++)\n curr = curr && curr[parts[x]];\n return curr;\n }\n SetPathValue(path, value) {\n var parts = path.split(\".\");\n if (parts.length === 1)\n this.rootStateMap.set(parts[0], value);\n else {\n var curr = this.rootStateMap.get(parts[0]);\n for (var x = 1; x < parts.length - 1; x++)\n curr = curr[parts[x]];\n curr[parts[parts.length - 1]] = value;\n }\n }\n GetBreakUpMap(path, value) {\n if (!this.keyFunc)\n return new Map([[path, value]]);\n return BreakUpValue(path, value, this.keyFunc);\n }\n }\n return DiffTree;\n}\nexports.DiffTreeScope = DiffTreeScope;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffWorker = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nvar DiffWorker;\n(function (DiffWorker) {\n var workerConstructor = null;\n var workerParameter = null;\n if (typeof Worker !== 'undefined') {\n workerConstructor = Worker;\n workerParameter = URL.createObjectURL(new Blob([`(${diffTree_1.DiffTreeScope}).call(this, true)`]));\n }\n function Create() {\n if (!workerConstructor)\n throw \"Worker is not available\";\n return new workerConstructor(workerParameter);\n }\n DiffWorker.Create = Create;\n})(DiffWorker || (exports.DiffWorker = DiffWorker = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkerQueue = void 0;\nconst list_1 = require(\"../../Utils/list\");\nclass WorkerQueue {\n callbacks;\n worker;\n constructor(worker) {\n this.worker = worker;\n this.callbacks = list_1.List.Create();\n this.worker.onerror = (err) => {\n var cb = list_1.List.Pop(this.callbacks);\n cb && cb(null, err);\n };\n this.worker.onmessage = (message) => {\n var cb = list_1.List.Pop(this.callbacks);\n cb && cb(message.data);\n };\n }\n Push(message) {\n return new Promise((resolve, reject) => {\n list_1.List.Add(this.callbacks, function (data, err) {\n if (err)\n reject(err);\n else\n resolve(data);\n });\n this.worker.postMessage(message);\n });\n }\n Destroy() {\n this.worker.terminate();\n }\n}\nexports.WorkerQueue = WorkerQueue;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Store = void 0;\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst storeWriter_1 = require(\"./storeWriter\");\nclass Store {\n observableTree = new observableTree_1.ObservableTree();\n storeWriter = new storeWriter_1.StoreWriter(this.observableTree);\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\n get Root() {\n return this.rootScope;\n }\n constructor(init) {\n if (init)\n this.Write(init);\n }\n Action(action) {\n var proxy = this.observableTree.Get(\"ROOT\");\n action(proxy, this.storeWriter);\n }\n Write(data) {\n this.Action((root, writer) => writer.Write(root, data));\n }\n Merge(data) {\n this.Action((root, writer) => writer.Merge(root, data));\n }\n Destroy() {\n this.rootScope.Destroy();\n }\n}\nexports.Store = Store;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsync = void 0;\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst diffAsync_1 = require(\"../Diff/diffAsync\");\nconst storeAsyncWriter_1 = require(\"./storeAsyncWriter\");\nconst asyncQueue_1 = require(\"../../Utils/asyncQueue\");\nclass StoreAsync {\n idFunc;\n diffAsync;\n observableTree;\n asyncWriter;\n asyncQueue;\n constructor(idFunc, init) {\n this.idFunc = idFunc;\n this.diffAsync = new diffAsync_1.DiffAsync(this.idFunc);\n this.observableTree = new observableTree_1.ObservableTree(diffAsync_1.DiffAsync.ReadKeyRef);\n this.asyncWriter = new storeAsyncWriter_1.StoreAsyncWriter(this.idFunc, this.diffAsync, this.observableTree);\n this.asyncQueue = new asyncQueue_1.AsyncQueue();\n if (init) {\n var id = this.idFunc(init);\n this.observableTree.Write(id, init);\n this.Write(init);\n }\n }\n Scope(id, func) {\n return this.observableTree.Scope(id, func);\n }\n async Action(id, action) {\n await this.asyncQueue.Next(async () => {\n await action(id && this.observableTree.Get(id), this.asyncWriter);\n });\n }\n async Write(data) {\n await this.Action(null, async (val, writer) => {\n await writer.Write(val, data);\n });\n }\n async Merge(id, data) {\n await this.Action(id, async (val, writer) => {\n await writer.Merge(val, data);\n });\n }\n Destroy() {\n this.asyncQueue.Stop();\n this.diffAsync.Destroy();\n }\n}\nexports.StoreAsync = StoreAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsyncWriter = void 0;\nclass StoreAsyncWriter {\n idFunc;\n diffAsync;\n observableTree;\n constructor(idFunc, diffAsync, observableTree) {\n this.idFunc = idFunc;\n this.diffAsync = diffAsync;\n this.observableTree = observableTree;\n }\n async Write(source, data) {\n let path;\n if (source) {\n path = this.observableTree.GetPathOf(source);\n }\n else {\n path = this.idFunc(data);\n if (!path)\n throw new Error(\"data must have an id\");\n }\n let diff = await this.diffAsync.DiffPath(path, data);\n this.ApplyChanges(diff);\n }\n async Merge(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n const keys = Object.keys(data);\n const message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\n const diff = await this.diffAsync.DiffBatch(message);\n this.ApplyChanges(diff);\n }\n async Push(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n var lengthPath = `${rootPath}.length`;\n var length = await this.diffAsync.GetPath(lengthPath);\n var diff = await this.diffAsync.DiffPath(`${rootPath}.${length}`, data);\n this.ApplyChanges(diff);\n }\n async Splice(source, start, deleteCount, ...items) {\n var rootPath = this.observableTree.GetPathOf(source);\n var array = await this.diffAsync.GetPath(rootPath);\n array = array.slice();\n array.splice(start, deleteCount, ...items);\n var diff = await this.diffAsync.DiffPath(rootPath, array);\n this.ApplyChanges(diff);\n }\n ApplyChanges(diff) {\n this.observableTree.WriteAll(diff);\n }\n}\nexports.StoreAsyncWriter = StoreAsyncWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreSync = void 0;\nconst diffSync_1 = require(\"../Diff/diffSync\");\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst storeSyncWriter_1 = require(\"./storeSyncWriter\");\nclass StoreSync {\n diffSync = new diffSync_1.DiffSync();\n observableTree = new observableTree_1.ObservableTree();\n storeWriter = new storeSyncWriter_1.StoreSyncWriter(this.diffSync, this.observableTree);\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\n get Root() {\n return this.rootScope;\n }\n constructor(init) {\n if (init)\n this.Write(init);\n }\n Action(action) {\n var proxy = this.observableTree.Get(\"ROOT\");\n action(proxy, this.storeWriter);\n }\n Write(data) {\n this.Action((root, writer) => writer.Write(root, data));\n }\n Merge(data) {\n this.Action((root, writer) => writer.Merge(root, data));\n }\n Destroy() {\n this.rootScope.Destroy();\n }\n}\nexports.StoreSync = StoreSync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreSyncWriter = void 0;\nclass StoreSyncWriter {\n diffSync;\n observableTree;\n constructor(diffSync, observableTree) {\n this.diffSync = diffSync;\n this.observableTree = observableTree;\n }\n Write(source, data) {\n var rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\n var diff = this.diffSync.DiffPath(rootPath, data);\n this.ApplyChanges(diff);\n }\n Merge(source, data) {\n var rootPath = this.observableTree.GetPathOf(source);\n var keys = Object.keys(data);\n var message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\n var diff = this.diffSync.DiffBatch(message);\n this.ApplyChanges(diff);\n }\n Push(source, data) {\n var rootPath = this.observableTree.GetPathOf(source);\n var length = source.length;\n this.diffSync.UpdatePath(`${rootPath}.${length}`, data);\n this.observableTree.Write(`${rootPath}.${length}`, data);\n }\n Splice(source, start, deleteCount, ...items) {\n var rootPath = this.observableTree.GetPathOf(source);\n var proxy = this.observableTree.Get(rootPath);\n const array = proxy.toJSON().slice();\n array.splice(start, deleteCount, ...items);\n this.diffSync.UpdatePath(rootPath, array);\n this.observableTree.Write(rootPath, array);\n }\n ApplyChanges(diff) {\n this.observableTree.WriteAll(diff);\n }\n}\nexports.StoreSyncWriter = StoreSyncWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreWriter = void 0;\nclass StoreWriter {\n observableTree;\n constructor(observableTree) {\n this.observableTree = observableTree;\n }\n Write(source, data) {\n const rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\n this.observableTree.Write(rootPath, data);\n }\n Merge(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n for (const key in data)\n this.observableTree.Write(`${rootPath}.${key}`, data[key]);\n }\n Push(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n this.observableTree.Write(`${rootPath}.${source.length}`, data);\n }\n Splice(source, start, deleteCount, ...items) {\n const json = source.toJSON();\n const copy = json.slice();\n copy.splice(start, deleteCount, ...items);\n const rootPath = this.observableTree.GetPathOf(source);\n this.observableTree.Write(rootPath, copy);\n }\n}\nexports.StoreWriter = StoreWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableScope = exports.ObservableScopeWrapper = exports.ObservableScopeValue = void 0;\nconst emitter_1 = require(\"../../Utils/emitter\");\nclass ObservableScopeValue {\n scope;\n get Value() {\n return ObservableScope.Value(this.scope);\n }\n constructor(scope) {\n this.scope = scope;\n }\n}\nexports.ObservableScopeValue = ObservableScopeValue;\nclass ObservableScopeWrapper extends ObservableScopeValue {\n scopeEmitter;\n constructor(scope) {\n super(scope);\n if (scope.emitter) {\n this.scopeEmitter = emitter_1.Emitter.Create();\n emitter_1.Emitter.On(scope.emitter, () => emitter_1.Emitter.Emit(this.scopeEmitter, this));\n }\n }\n Scope(callback) {\n return new ObservableScope(() => callback(this.Value));\n }\n Watch(callback) {\n if (!this.scopeEmitter)\n return;\n emitter_1.Emitter.On(this.scopeEmitter, callback);\n callback(this);\n }\n Unwatch(callback) {\n if (!this.scopeEmitter)\n return;\n emitter_1.Emitter.Remove(this.scopeEmitter, callback);\n }\n Destroy() {\n DestroyScope(this.scope);\n this.scopeEmitter && this.scopeEmitter.clear();\n }\n}\nexports.ObservableScopeWrapper = ObservableScopeWrapper;\nclass ObservableScope extends ObservableScopeWrapper {\n constructor(getFunction) {\n super(ObservableScope.Create(getFunction));\n }\n}\nexports.ObservableScope = ObservableScope;\nvar currentSet = null;\nvar watching = false;\nfunction WatchAction(action) {\n var parentSet = currentSet;\n currentSet = null;\n var parentWatching = watching;\n watching = true;\n action();\n var lastSet = currentSet;\n currentSet = parentSet;\n watching = parentWatching;\n return lastSet;\n}\n(function (ObservableScope) {\n function Create(valueFunction) {\n if (typeof valueFunction !== 'function')\n return {\n value: valueFunction,\n dirty: false,\n destroyed: false\n };\n var scope = {\n getFunction: valueFunction,\n async: valueFunction[Symbol.toStringTag] === 'AsyncFunction',\n value: null,\n dirty: true,\n emitter: emitter_1.Emitter.Create(),\n emitters: null,\n destroyed: false,\n setCallback: function () {\n OnSet(scope);\n }\n };\n return scope;\n }\n ObservableScope.Create = Create;\n function Register(emitter) {\n if (!watching || !emitter)\n return;\n currentSet = currentSet || new Set();\n currentSet.add(emitter);\n }\n ObservableScope.Register = Register;\n function Value(scope) {\n if (!scope)\n return undefined;\n Register(scope.emitter);\n UpdateValue(scope);\n return scope.value;\n }\n ObservableScope.Value = Value;\n function Watching() {\n return watching;\n }\n ObservableScope.Watching = Watching;\n function Watch(scope, callback) {\n if (!scope || !scope.emitter)\n return;\n emitter_1.Emitter.On(scope.emitter, callback);\n }\n ObservableScope.Watch = Watch;\n function Unwatch(scope, callback) {\n if (!scope || !scope.emitter)\n return;\n emitter_1.Emitter.Remove(scope.emitter, callback);\n }\n ObservableScope.Unwatch = Unwatch;\n function Update(scope) {\n OnSet(scope);\n }\n ObservableScope.Update = Update;\n function Emit(scope) {\n emitter_1.Emitter.Emit(scope.emitter);\n }\n ObservableScope.Emit = Emit;\n function Destroy(scope) {\n DestroyScope(scope);\n }\n ObservableScope.Destroy = Destroy;\n})(ObservableScope || (exports.ObservableScope = ObservableScope = {}));\nfunction OnSet(scope) {\n if (!scope || scope.dirty)\n return;\n scope.dirty = true;\n emitter_1.Emitter.Emit(scope.emitter, scope);\n}\nfunction UpdateValue(scope) {\n if (!scope.dirty)\n return;\n scope.dirty = false;\n var value = null;\n var emitters = scope.getFunction && WatchAction(() => value = scope.getFunction());\n if (scope.async)\n Promise.resolve(value).then(val => {\n scope.value = val;\n emitter_1.Emitter.Emit(scope.emitter, scope);\n });\n else\n scope.value = value;\n UpdateEmitters(scope, emitters);\n}\nfunction DestroyScope(scope) {\n if (!scope)\n return;\n scope.emitters && scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\n scope.emitters && scope.emitters.clear();\n scope.emitter && scope.emitter.clear();\n scope.destroyed = true;\n}\nfunction UpdateEmitters(scope, newEmitters) {\n if (newEmitters)\n newEmitters.forEach(e => {\n if (!scope.emitters || !scope.emitters.delete(e))\n emitter_1.Emitter.On(e, scope.setCallback);\n });\n if (scope.emitters)\n scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\n scope.emitters = newEmitters;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableTree = void 0;\nconst observableScope_1 = require(\"../Tree/observableScope\");\nvar Type;\n(function (Type) {\n Type[Type[\"Value\"] = 0] = \"Value\";\n Type[Type[\"Object\"] = 1] = \"Object\";\n Type[Type[\"Array\"] = 2] = \"Array\";\n})(Type || (Type = {}));\nconst jsonConstructor = {}.constructor;\nfunction TypeOf(value) {\n if (!value)\n return Type.Value;\n if (jsonConstructor === value.constructor)\n return Type.Object;\n if (Array.isArray(value))\n return Type.Array;\n return Type.Value;\n}\nclass ObservableTree {\n valuePathResolver;\n undefinedScope = observableScope_1.ObservableScope.Create(function () { return undefined; });\n scopeCache = new WeakMap();\n leafScopeCache = new WeakMap();\n proxyCache = new WeakMap();\n pathCache = new WeakMap();\n rootStateMap = new Map();\n constructor(valuePathResolver) {\n this.valuePathResolver = valuePathResolver;\n }\n static UnwrapProxyValues(value) {\n if (value?.toJSON && typeof value.toJSON === 'function')\n return value.toJSON();\n const type = TypeOf(value);\n if (type === Type.Value)\n return value;\n if (type === Type.Array) {\n const arr = value;\n for (let x = 0; x < arr.length; x++)\n arr[x] = ObservableTree.UnwrapProxyValues(arr[x]);\n }\n else {\n const keys = Object.keys(value);\n for (let x = 0; x < keys.length; x++)\n value[keys[x]] = ObservableTree.UnwrapProxyValues(value[keys[x]]);\n }\n return value;\n }\n Get(path) {\n const val = path.split(\".\").reduce((pre, curr, index) => {\n if (index === 0) {\n let value = this.rootStateMap.get(curr);\n const scope = this.GetParentScope(value);\n return observableScope_1.ObservableScope.Value(scope);\n }\n return pre && pre[curr];\n }, null);\n return val;\n }\n GetPathOf(value) {\n if (value.toJSON && typeof value.toJSON === 'function')\n value = value.toJSON();\n return this.pathCache.get(value);\n }\n Scope(path, callback) {\n return new observableScope_1.ObservableScope(() => {\n const obj = this.Get(path);\n return callback && callback(obj) || obj;\n });\n }\n Write(path, value) {\n const scope = this.WritePath(path, value);\n observableScope_1.ObservableScope.Update(scope);\n }\n WriteAll(data) {\n const scopeSet = new Set();\n for (var x = 0; x < data.length; x++) {\n const scope = this.WritePath(data[x].path, data[x].value);\n scopeSet.add(scope);\n }\n scopeSet.forEach(scope => observableScope_1.ObservableScope.Update(scope));\n }\n GetParentScope(value) {\n if (value === undefined)\n return this.undefinedScope;\n let scope = this.scopeCache.get(value);\n if (!scope) {\n scope = observableScope_1.ObservableScope.Create(() => this.GetValueProxy(value));\n this.scopeCache.set(value, scope);\n }\n return scope;\n }\n GetPropertyScope(parent, prop) {\n const value = parent[prop];\n const type = TypeOf(value);\n if (type === Type.Value) {\n let leafScopes = this.leafScopeCache.get(parent) || {};\n leafScopes[prop] = leafScopes[prop] || observableScope_1.ObservableScope.Create(() => {\n const parentScope = this.scopeCache.get(parent);\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\n const parentJson = parentValue.toJSON();\n const currentValue = parentJson[prop];\n let path;\n if (this.valuePathResolver && typeof currentValue === 'string' && (path = this.valuePathResolver(currentValue)))\n return this.Get(path);\n return currentValue;\n });\n this.leafScopeCache.set(parent, leafScopes);\n return leafScopes[prop];\n }\n else {\n let scope = this.scopeCache.get(value);\n if (!scope) {\n scope = observableScope_1.ObservableScope.Create(() => {\n const parentScope = this.scopeCache.get(parent);\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\n const parentJson = parentValue.toJSON();\n const currentValue = parentJson[prop];\n return this.GetValueProxy(currentValue);\n });\n this.scopeCache.set(value, scope);\n }\n return scope;\n }\n }\n GetValueProxy(value) {\n let proxy = this.proxyCache.get(value);\n if (!proxy) {\n proxy = this.CreateProxy(value);\n this.proxyCache.set(value, proxy);\n }\n return proxy;\n }\n ObjectProxyGetter = (value, prop) => {\n function toJSON() {\n return value;\n }\n ;\n switch (prop) {\n case \"toJSON\":\n return toJSON;\n default:\n if (typeof prop === 'symbol')\n return value[prop];\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\n }\n };\n CreateObjectProxy(value) {\n return new Proxy(value, {\n get: this.ObjectProxyGetter\n });\n }\n ArrayProxyGetter = (value, prop) => {\n function toJSON() {\n return value;\n }\n ;\n switch (prop) {\n case \"toJSON\":\n return toJSON;\n default:\n if (typeof prop === 'symbol')\n return value[prop];\n if (isNaN(parseInt(prop))) {\n const ret = value[prop];\n if (typeof ret === 'function') {\n const copy = value.map((val, index) => observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, index.toString())));\n return ret.bind(copy);\n }\n return ret;\n }\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\n }\n };\n CreateArrayProxy(value) {\n return new Proxy(value, {\n get: this.ArrayProxyGetter\n });\n }\n CreateProxy(value) {\n const type = TypeOf(value);\n switch (type) {\n case Type.Object:\n return this.CreateObjectProxy(value);\n case Type.Array:\n return this.CreateArrayProxy(value);\n default:\n return value;\n }\n }\n WritePath(path, value) {\n this.UpdatePathCache(path, value);\n const pathParts = path.split(\".\");\n if (pathParts.length === 1) {\n const currentValue = this.rootStateMap.get(pathParts[0]);\n this.rootStateMap.set(pathParts[0], value);\n return currentValue === undefined ? this.undefinedScope : this.scopeCache.get(currentValue);\n }\n let parentValue;\n let x = 0;\n for (; x < pathParts.length - 1 && (x === 0 || parentValue); x++) {\n if (x === 0)\n parentValue = this.rootStateMap.get(pathParts[x]);\n else\n parentValue = parentValue && parentValue[pathParts[x]];\n }\n if (!parentValue)\n throw new Error(\"Unable to write path: \" + path + \". Falsey value found at: \" + pathParts.slice(0, x).join(\".\"));\n const prop = pathParts[x];\n const oldValue = parentValue[prop];\n const oldType = TypeOf(oldValue);\n parentValue[prop] = value;\n if (oldType !== Type.Value || Array.isArray(parentValue))\n return this.scopeCache.get(parentValue) || this.scopeCache.get(oldValue);\n const leafScopes = this.leafScopeCache.get(parentValue);\n return leafScopes && leafScopes[prop] || this.scopeCache.get(parentValue);\n }\n UpdatePathCache(path, value) {\n const type = TypeOf(value);\n if (type === Type.Value)\n return;\n this.pathCache.set(value, path);\n this.proxyCache.delete(value);\n this.scopeCache.delete(value);\n this.leafScopeCache.delete(value);\n const keys = Object.keys(value);\n for (let x = 0; x < keys.length; x++)\n this.UpdatePathCache(`${path}.${keys[x]}`, value[keys[x]]);\n return value;\n }\n}\nexports.ObservableTree = ObservableTree;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableScope = exports.StoreAsync = exports.StoreSync = exports.Store = void 0;\nvar store_1 = require(\"./Store/store\");\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return store_1.Store; } });\nvar storeSync_1 = require(\"./Store/storeSync\");\nObject.defineProperty(exports, \"StoreSync\", { enumerable: true, get: function () { return storeSync_1.StoreSync; } });\nvar storeAsync_1 = require(\"./Store/storeAsync\");\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return storeAsync_1.StoreAsync; } });\nvar observableScope_1 = require(\"./Tree/observableScope\");\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return observableScope_1.ObservableScope; } });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Animation = exports.AnimationType = void 0;\nvar StepFunctions;\n(function (StepFunctions) {\n function* EaseIn(count) {\n var diff = 1 / count;\n for (var t = diff, x = 0; x < count; x++, t += diff)\n yield (1 - t) * (1 - t) * (1 - t) * 0 + 3 * (1 - t) * (1 - t) * t * 1 + 3 * (1 - t) * t * t * 1 + t * t * t * 1;\n }\n StepFunctions.EaseIn = EaseIn;\n function* Linear(count) {\n var diff = 1 / count;\n for (var t = diff, x = 0; x < count; x++, t += diff)\n yield t;\n }\n StepFunctions.Linear = Linear;\n})(StepFunctions || (StepFunctions = {}));\nvar AnimationType;\n(function (AnimationType) {\n AnimationType[AnimationType[\"Linear\"] = 0] = \"Linear\";\n AnimationType[AnimationType[\"EaseIn\"] = 1] = \"EaseIn\";\n})(AnimationType || (exports.AnimationType = AnimationType = {}));\nclass Animation {\n type;\n frameCount;\n frameTimings;\n update;\n animationTimeouts;\n running;\n start;\n end;\n enabled;\n get Running() {\n return this.running;\n }\n get Start() {\n return this.start;\n }\n get End() {\n return this.end;\n }\n get Enabled() {\n return this.enabled;\n }\n constructor(type, duration, update) {\n this.running = false;\n this.start = null;\n this.end = null;\n this.enabled = true;\n this.type = type;\n this.frameCount = Math.ceil((duration / 1000) * 60);\n this.frameTimings = [];\n var frameTime = duration / this.frameCount;\n for (var x = 0; x < this.frameCount; x++)\n this.frameTimings[x] = (x + 1) * frameTime;\n this.update = update;\n this.animationTimeouts = [];\n }\n Animate(start, end) {\n if (!this.enabled)\n return;\n var diff = end - start;\n if (diff === 0)\n return;\n this.Cancel();\n this.running = true;\n this.start = start;\n this.end = end;\n return new Promise(resolve => {\n var stepFunc = StepFunctions[AnimationType[this.type]];\n var index = 0;\n for (var step of stepFunc(this.frameCount)) {\n var value = (step * diff) + start;\n this.SetTimeout(index, value, index === (this.frameCount - 1) ? resolve : null);\n index++;\n }\n }).then(() => {\n this.running = false;\n this.start = null;\n this.end = null;\n });\n }\n Disable() {\n this.Cancel();\n this.enabled = false;\n }\n Enable() {\n this.enabled = true;\n }\n Cancel() {\n for (var x = 0; x < this.animationTimeouts.length; x++)\n clearTimeout(this.animationTimeouts[x]);\n this.running = false;\n this.start = null;\n this.end = null;\n }\n Destroy() {\n this.Cancel();\n }\n SetTimeout(index, value, resolve) {\n this.animationTimeouts[index] = setTimeout(() => {\n this.update(value);\n resolve && resolve();\n }, this.frameTimings[index]);\n }\n}\nexports.Animation = Animation;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncQueue = void 0;\nconst list_1 = require(\"./list\");\nclass AsyncQueue {\n running = false;\n queue = list_1.List.Create();\n Next(callback) {\n const ret = new Promise((resolve, reject) => {\n list_1.List.Add(this.queue, async function () {\n try {\n const ret = await callback();\n resolve(ret);\n }\n catch (e) {\n reject(e);\n }\n });\n });\n this.Start();\n return ret;\n }\n Stop() {\n list_1.List.Clear(this.queue);\n }\n Start() {\n if (this.running)\n return;\n this.running = true;\n this.ExecuteQueue();\n }\n async ExecuteQueue() {\n const callback = list_1.List.Pop(this.queue);\n if (callback !== null) {\n await callback();\n this.ExecuteQueue();\n }\n else\n this.running = false;\n }\n}\nexports.AsyncQueue = AsyncQueue;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PreReq = exports.PreReqTemplate = exports.Destroy = exports.Inject = exports.ComputedAsync = exports.Computed = exports.DestroyScope = exports.Scope = exports.StateAsync = exports.StateSync = exports.State = void 0;\nconst store_1 = require(\"../Store/Store/store\");\nconst Store_1 = require(\"../Store\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nconst observableTree_1 = require(\"../Store/Tree/observableTree\");\nfunction State() {\n return StateDecorator;\n}\nexports.State = State;\nfunction StateDecorator(target, propertyKey) {\n const propKey = `StoreDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n const value = store && store.Root.Value;\n if (observableScope_1.ObservableScope.Watching())\n return value;\n return observableTree_1.ObservableTree.UnwrapProxyValues(value);\n },\n set: function (val) {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n if (!store)\n map.set(propKey, new store_1.Store(val));\n else\n store.Merge(val);\n }\n };\n}\nfunction StateSync() {\n return StateSyncDecorator;\n}\nexports.StateSync = StateSync;\nfunction StateSyncDecorator(target, propertyKey) {\n const propKey = `StoreSyncDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n const value = store && store.Root.Value;\n if (observableScope_1.ObservableScope.Watching())\n return value;\n return observableTree_1.ObservableTree.UnwrapProxyValues(value);\n },\n set: function (val) {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n if (!store)\n map.set(propKey, new Store_1.StoreSync(val));\n else\n store.Merge(val);\n }\n };\n}\nfunction StateAsync() {\n return StateAsyncDecorator;\n}\nexports.StateAsync = StateAsync;\nfunction StateAsyncDecorator(target, propertyKey) {\n const propKey = `StoreAsyncDecorator_${propertyKey}`;\n const scopeKey = `StoreAsyncDecorator_Scope_${propertyKey}`;\n DestroyDecorator(target, propKey);\n DestroyDecorator(target, scopeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(scopeKey);\n const value = scope && scope.Value;\n if (observableScope_1.ObservableScope.Watching())\n return value;\n return observableTree_1.ObservableTree.UnwrapProxyValues(value);\n },\n set: function (val) {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n if (!store) {\n store = new Store_1.StoreAsync((val) => val.___id, { ___id: \"ROOT\", data: val });\n map.set(propKey, store);\n map.set(scopeKey, store.Scope(\"ROOT\", val => val.data));\n }\n else\n store.Action(\"ROOT\", async (root, writer) => await writer.Merge(root.data, val));\n }\n };\n}\nfunction Scope() {\n return ScopeDecorator;\n}\nexports.Scope = Scope;\nfunction ScopeDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Scope decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Scope decorator does not support setters\";\n const propKey = `ScopeDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(propKey);\n if (!scope) {\n const getter = descriptor.get.bind(this);\n scope = new observableScope_1.ObservableScope(getter);\n map.set(propKey, scope);\n }\n return scope.Value;\n }\n };\n}\nfunction DestroyScope() {\n return DestroyScopeDecorator;\n}\nexports.DestroyScope = DestroyScope;\nfunction DestroyScopeDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Destroy Scope decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Destroy Scope decorator does not support setters\";\n const propKey = `ScopeDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n const valKey = `ScopeDecorator_${propertyKey}_Value`;\n DestroyDecorator(target, valKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(propKey);\n if (!scope) {\n const getter = descriptor.get.bind(this);\n scope = new observableScope_1.ObservableScope(getter);\n map.set(propKey, scope);\n scope.Watch(scope => {\n var lastValue = map.get(valKey);\n lastValue && lastValue.Destroy();\n map.set(valKey, scope.Value);\n });\n }\n return scope.Value;\n }\n };\n}\nfunction Computed() {\n return ComputedDecorator;\n}\nexports.Computed = Computed;\nfunction ComputedDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Computed decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Computed decorator does not support setters\";\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\n DestroyDecorator(target, scopeKey);\n DestroyDecorator(target, storeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var store = map.get(storeKey);\n if (!store) {\n const getter = descriptor.get.bind(this);\n const scope = new observableScope_1.ObservableScope(getter);\n store = new Store_1.StoreSync(scope.Value);\n scope.Watch(scope => {\n if (!this.Destroyed)\n store.Write(scope.Value);\n });\n map.set(scopeKey, scope);\n map.set(storeKey, store);\n }\n return store.Root.Value;\n }\n };\n}\nfunction ComputedAsync(idFunc) {\n return ComputedAsyncDecorator.bind(null, idFunc);\n}\nexports.ComputedAsync = ComputedAsync;\nfunction ComputedAsyncDecorator(idFunc, target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"ComputedAsync decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"ComputedAsync decorator does not support setters\";\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\n const storeScopeKey = `ComputedDecorator_StoreScope_${propertyKey}`;\n DestroyDecorator(target, scopeKey);\n DestroyDecorator(target, storeKey);\n DestroyDecorator(target, storeScopeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var storeScope = map.get(storeScopeKey);\n if (!storeScope) {\n const getter = descriptor.get.bind(this);\n const scope = new observableScope_1.ObservableScope(() => {\n var value = getter();\n if (value && typeof value.toJSON === 'function')\n value = value.toJSON();\n return value;\n });\n const store = new Store_1.StoreAsync((val) => val._id, { _id: \"ROOT\", data: scope.Value });\n scope.Watch(scope => {\n if (!this.Destroyed)\n store.Write({ _id: \"ROOT\", data: scope.Value });\n });\n storeScope = store.Scope(\"ROOT\", (val) => val.data);\n map.set(storeScopeKey, storeScope);\n map.set(scopeKey, scope);\n map.set(storeKey, store);\n }\n return storeScope.Value;\n }\n };\n}\nfunction Inject(type) {\n return InjectorDecorator.bind(null, type);\n}\nexports.Inject = Inject;\nfunction InjectorDecorator(type, target, propertyKey, descriptor) {\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n return this.Injector.Get(type);\n },\n set: function (val) {\n this.Injector.Set(type, val);\n }\n };\n}\nfunction Destroy() {\n return DestroyDecorator;\n}\nexports.Destroy = Destroy;\n(function (Destroy) {\n function Get(value) {\n return value && value.DestroyDecorator_Destroys || [];\n }\n function All(value) {\n var arr = Get(value);\n arr.map(prop => (value[prop] || value.DecoratorMap.get(prop)))\n .filter(o => !!o)\n .forEach(o => o.Destroy());\n }\n Destroy.All = All;\n})(Destroy || (exports.Destroy = Destroy = {}));\nfunction DestroyDecorator(target, propertyKey) {\n var proto = target;\n proto.DestroyDecorator_Destroys = proto.DestroyDecorator_Destroys || [];\n proto.DestroyDecorator_Destroys.push(propertyKey);\n}\nfunction PreReqTemplate(template) {\n return PreReqTemplateDecorator.bind(null, template);\n}\nexports.PreReqTemplate = PreReqTemplate;\n(function (PreReqTemplate) {\n function Get(value) {\n var func = value && value.PreReqTemplateDecorator_Template;\n var ret = func ? func() : [];\n if (!Array.isArray(ret))\n ret = [ret];\n return ret;\n }\n PreReqTemplate.Get = Get;\n})(PreReqTemplate || (exports.PreReqTemplate = PreReqTemplate = {}));\nfunction PreReqTemplateDecorator(template, target) {\n var proto = target.prototype;\n proto.PreReqTemplateDecorator_Template = template;\n}\nfunction PreReq() {\n return PreReqDecorator;\n}\nexports.PreReq = PreReq;\n(function (PreReq) {\n function Get(value) {\n return value && value.PreReqDecorator_PreReqs || [];\n }\n function All(value) {\n var arr = Get(value).map((prop) => (value[prop] && value[prop].Init) || Promise.resolve());\n return Promise.all(arr);\n }\n PreReq.All = All;\n function Has(value) {\n return Get(value).length > 0;\n }\n PreReq.Has = Has;\n})(PreReq || (exports.PreReq = PreReq = {}));\nfunction PreReqDecorator(target, propertyKey) {\n var proto = target;\n proto.PreReqDecorator_PreReqs = proto.PreReqDecorator_PreReqs || [];\n proto.PreReqDecorator_PreReqs.push(propertyKey);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\nvar Emitter;\n(function (Emitter) {\n function Create() {\n return new Set();\n }\n Emitter.Create = Create;\n function On(emitter, callback) {\n emitter.add(callback);\n }\n Emitter.On = On;\n function Emit(emitter, ...args) {\n emitter.forEach(function (cb) {\n cb(...args);\n });\n }\n Emitter.Emit = Emit;\n function Remove(emitter, callback) {\n emitter.delete(callback);\n }\n Emitter.Remove = Remove;\n})(Emitter || (exports.Emitter = Emitter = {}));\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./decorators\"), exports);\n__exportStar(require(\"./animation\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Injector = void 0;\nclass Injector {\n parent;\n typeMap;\n constructor() {\n this.parent = Injector.Current();\n this.typeMap = new Map();\n }\n Get(type) {\n if (this.typeMap.size === 0)\n return this.parent && this.parent.Get(type);\n var ret = this.typeMap.get(type);\n if (!ret)\n ret = this.parent && this.parent.Get(type);\n return ret;\n }\n Set(type, instance) {\n this.typeMap.set(type, instance);\n }\n}\nexports.Injector = Injector;\n(function (Injector) {\n var scope = null;\n function Current() {\n return scope;\n }\n Injector.Current = Current;\n function Scope(injector, action, ...args) {\n var parent = Current();\n scope = injector;\n const ret = action(...args);\n scope = parent;\n return ret;\n }\n Injector.Scope = Scope;\n})(Injector || (exports.Injector = Injector = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.List = void 0;\nvar List;\n(function (List) {\n function Create() {\n return {\n head: null,\n tail: null,\n size: 0\n };\n }\n List.Create = Create;\n function Clear(list) {\n list.head = null;\n list.tail = null;\n list.size = 0;\n }\n List.Clear = Clear;\n function Push(list, data) {\n var node = { previous: null, next: null, data: data };\n if (list.size === 0) {\n list.head = node;\n list.tail = node;\n list.size = 1;\n }\n else {\n node.next = list.head;\n list.head.previous = node;\n list.head = node;\n list.size++;\n }\n return node;\n }\n List.Push = Push;\n function Pop(list) {\n if (list.size === 0)\n return null;\n var node = list.head;\n list.head = node.next;\n if (list.head)\n list.head.previous = null;\n list.size--;\n if (list.size === 0)\n list.tail = null;\n return node.data;\n }\n List.Pop = Pop;\n function Add(list, data) {\n const node = { previous: null, next: null, data: data };\n return AddNode(list, node);\n }\n List.Add = Add;\n function AddNode(list, node) {\n if (list.size === 0) {\n list.head = node;\n list.tail = node;\n list.size = 1;\n }\n else {\n node.previous = list.tail;\n list.tail.next = node;\n list.tail = node;\n list.size++;\n }\n return node;\n }\n List.AddNode = AddNode;\n function AddBefore(list, node, data) {\n if (!node)\n return List.Add(list, data);\n var newNode = { previous: null, next: null, data: data };\n var prevNode = node.previous;\n newNode.next = node;\n node.previous = newNode;\n if (list.head === node)\n list.head = newNode;\n if (prevNode) {\n prevNode.next = newNode;\n newNode.previous = prevNode;\n }\n list.size++;\n return newNode;\n }\n List.AddBefore = AddBefore;\n function AddAfter(list, node, data) {\n if (!node)\n return List.Push(list, data);\n var newNode = { previous: null, next: null, data: data };\n var nextNode = node.next;\n node.next = newNode;\n newNode.previous = node;\n if (list.tail === node)\n list.tail = newNode;\n if (nextNode) {\n nextNode.previous = newNode;\n newNode.next = nextNode;\n }\n list.size++;\n return newNode;\n }\n List.AddAfter = AddAfter;\n function Remove(list) {\n if (list.size === 0)\n return null;\n var node = list.tail;\n list.tail = node.previous;\n if (list.tail)\n list.tail.next = null;\n list.size--;\n if (list.size === 0)\n list.head = null;\n return node.data;\n }\n List.Remove = Remove;\n function RemoveNode(list, node) {\n if (list.head === node) {\n list.head = node.next;\n }\n else if (list.tail === node) {\n list.tail = node.previous;\n }\n else {\n const prev = node.previous;\n const next = node.next;\n prev.next = next;\n next.previous = prev;\n }\n node.next = node.previous = null;\n list.size--;\n if (list.size > 0)\n list.head.previous = list.tail.next = null;\n }\n List.RemoveNode = RemoveNode;\n function ForEach(list, callback) {\n var node = list.head;\n while (node) {\n callback(node.data);\n node = node.next;\n }\n }\n List.ForEach = ForEach;\n function ToNodeMap(list, keyCallback) {\n const map = new Map();\n let node = list.head;\n while (node) {\n const key = keyCallback(node.data);\n const nodes = map.get(key) || [node];\n if (nodes[0] !== node)\n nodes.push(node);\n else\n map.set(key, nodes);\n node = node.next;\n }\n return map;\n }\n List.ToNodeMap = ToNodeMap;\n})(List || (exports.List = List = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ThreadAsync = exports.Thread = exports.Synch = exports.Callback = exports.After = exports.Schedule = void 0;\nconst list_1 = require(\"./list\");\nconst workTimeMs = 16;\nconst contextQueue = list_1.List.Create();\nvar threadContext = null;\nvar timeoutRunning = false;\nfunction ProcessQueue() {\n var workEndTime = Date.now() + workTimeMs;\n var ctx;\n while (Date.now() < workEndTime && (ctx = list_1.List.Pop(contextQueue)))\n DoWork(ctx, workEndTime);\n if (contextQueue.size > 0)\n setTimeout(ProcessQueue);\n else\n timeoutRunning = false;\n}\nfunction ScheduleWork(ctx) {\n list_1.List.Add(contextQueue, ctx);\n if (timeoutRunning)\n return;\n timeoutRunning = true;\n setTimeout(ProcessQueue);\n}\nfunction Invoke(ctx, callback) {\n var parent = ctx.workEndNode;\n ctx.workEndNode = ctx.workList.head;\n callback();\n ctx.workEndNode = parent;\n}\nfunction DoWork(ctx, workEndTime = Date.now() + workTimeMs) {\n var parentContext = threadContext;\n threadContext = ctx;\n var async = ctx.async;\n var callback;\n while (async === ctx.async && Date.now() < workEndTime && (callback = list_1.List.Pop(ctx.workList)))\n Invoke(ctx, callback);\n if (ctx.workList.size > 0)\n ScheduleWork(ctx);\n threadContext = parentContext;\n}\nfunction CreateContext() {\n return {\n async: false,\n workEndNode: null,\n workList: list_1.List.Create()\n };\n}\nfunction ScheduleCallback(callback, before, async) {\n threadContext = threadContext || CreateContext();\n threadContext.async = threadContext.async || async;\n if (before)\n list_1.List.AddBefore(threadContext.workList, threadContext.workEndNode, callback);\n else if (threadContext.workEndNode)\n list_1.List.AddAfter(threadContext.workList, threadContext.workEndNode, callback);\n else\n threadContext.workEndNode = list_1.List.Add(threadContext.workList, callback);\n}\nfunction SynchWithoutThread(callback) {\n var workEndTime = Date.now() + workTimeMs;\n callback();\n if (threadContext)\n if (threadContext.async)\n ScheduleWork(threadContext);\n else\n DoWork(threadContext, workEndTime);\n threadContext = null;\n}\nfunction Schedule(callback) {\n ScheduleCallback(callback, true, true);\n}\nexports.Schedule = Schedule;\nfunction After(callback) {\n ScheduleCallback(callback, false, false);\n}\nexports.After = After;\nfunction Callback(callback) {\n return function (a, b, c, d) {\n Schedule(function () { callback(a, b, c, d); });\n };\n}\nexports.Callback = Callback;\nvar inSynchCallback = false;\nfunction Synch(callback) {\n if (threadContext || inSynchCallback)\n callback();\n else {\n inSynchCallback = true;\n SynchWithoutThread(callback);\n inSynchCallback = false;\n }\n}\nexports.Synch = Synch;\nfunction Thread(callback) {\n if (threadContext)\n ScheduleCallback(callback, true, false);\n else\n Synch(callback);\n}\nexports.Thread = Thread;\nfunction ThreadAsync(callback) {\n return new Promise(resolve => Thread(function () {\n callback();\n Thread(resolve);\n }));\n}\nexports.ThreadAsync = ThreadAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar component_1 = require(\"./Node/component\");\nObject.defineProperty(exports, \"Component\", { enumerable: true, get: function () { return component_1.Component; } });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsync = exports.Store = exports.ObservableScope = void 0;\n__exportStar(require(\"./index\"), exports);\n__exportStar(require(\"./Utils\"), exports);\nvar Store_1 = require(\"./Store\");\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return Store_1.ObservableScope; } });\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return Store_1.Store; } });\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return Store_1.StoreAsync; } });\n__exportStar(require(\"./DOM\"), exports);\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst Web = require(\"./web.export\");\nfor (var key in Web)\n window[key] = Web[key];\n"],"names":[],"sourceRoot":""}
|