j-templates 5.0.43 → 5.0.45

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.
@@ -17,10 +17,13 @@ function processUpdates() {
17
17
  else
18
18
  window_1.wndw.requestAnimationFrame(processUpdates);
19
19
  }
20
- const htmlNs = "http://www.w3.org/1999/xhtml";
21
20
  exports.DOMNodeConfig = {
22
21
  createNode(type, namespace) {
23
- return type !== "text" ? window_1.wndw.document.createElementNS(namespace || htmlNs, type) : window_1.wndw.document.createTextNode("");
22
+ return type !== "text" ?
23
+ namespace ?
24
+ window_1.wndw.document.createElementNS(namespace, type) :
25
+ window_1.wndw.document.createElement(type) :
26
+ window_1.wndw.document.createTextNode("");
24
27
  },
25
28
  scheduleUpdate(callback) {
26
29
  list_1.List.Add(pendingUpdates, callback);
package/DOM/utils.js CHANGED
@@ -32,9 +32,10 @@ function SetRootProperty(target, prop, value, lastValue) {
32
32
  }
33
33
  }
34
34
  function SetChangedProperties(target, lastProperties, properties) {
35
- for (var key in properties) {
36
- (!lastProperties || lastProperties[key] !== properties[key]) &&
37
- SetRootProperty(target, key, properties[key], lastProperties && lastProperties[key]);
35
+ const keys = Object.keys(properties);
36
+ for (let x = 0; x < keys.length; x++) {
37
+ if (!lastProperties || lastProperties[keys[x]] !== properties[keys[x]])
38
+ SetRootProperty(target, keys[x], properties[keys[x]], lastProperties && lastProperties[keys[x]]);
38
39
  }
39
40
  }
40
41
  function SetProperties(target, lastProperties, properties) {
package/Node/boundNode.js CHANGED
@@ -6,29 +6,35 @@ const observableScope_1 = require("../Store/Tree/observableScope");
6
6
  var BoundNode;
7
7
  (function (BoundNode) {
8
8
  function Init(boundNode) {
9
- var nodeDef = boundNode.nodeDef;
10
- var propertiesScope = nodeDef.props ?
11
- observableScope_1.ObservableScope.Create(nodeDef.props) : null;
12
- var attributesScope = nodeDef.attrs ?
13
- observableScope_1.ObservableScope.Create(nodeDef.attrs) : null;
14
- var eventsScope = nodeDef.on ?
15
- observableScope_1.ObservableScope.Create(nodeDef.on) : null;
16
- observableScope_1.ObservableScope.Watch(propertiesScope, function () { ScheduleSetProperties(boundNode, propertiesScope); });
17
- observableScope_1.ObservableScope.Watch(attributesScope, function () { ScheduleSetAttributes(boundNode, attributesScope); });
18
- observableScope_1.ObservableScope.Watch(eventsScope, function () { ScheduleSetEvents(boundNode, eventsScope); });
19
- SetProperties(boundNode, observableScope_1.ObservableScope.Value(propertiesScope));
20
- SetAttributes(boundNode, observableScope_1.ObservableScope.Value(attributesScope));
21
- SetEvents(boundNode, observableScope_1.ObservableScope.Value(eventsScope));
22
- boundNode.destroyables.push({
23
- Destroy: function () {
24
- observableScope_1.ObservableScope.Destroy(propertiesScope);
25
- observableScope_1.ObservableScope.Destroy(attributesScope);
26
- observableScope_1.ObservableScope.Destroy(eventsScope);
27
- }
28
- });
9
+ const nodeDef = boundNode.nodeDef;
10
+ if (nodeDef.props) {
11
+ const scope = observableScope_1.ObservableScope.Create(nodeDef.props);
12
+ boundNode.destroyables.push(CreateScopeDestroyable(scope));
13
+ observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetProperties(boundNode, scope); });
14
+ SetProperties(boundNode, observableScope_1.ObservableScope.Value(scope));
15
+ }
16
+ if (nodeDef.attrs) {
17
+ const scope = observableScope_1.ObservableScope.Create(nodeDef.attrs);
18
+ boundNode.destroyables.push(CreateScopeDestroyable(scope));
19
+ observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetAttributes(boundNode, scope); });
20
+ SetAttributes(boundNode, observableScope_1.ObservableScope.Value(scope));
21
+ }
22
+ if (nodeDef.on) {
23
+ const scope = observableScope_1.ObservableScope.Create(nodeDef.on);
24
+ boundNode.destroyables.push(CreateScopeDestroyable(scope));
25
+ observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetEvents(boundNode, scope); });
26
+ SetEvents(boundNode, observableScope_1.ObservableScope.Value(scope));
27
+ }
29
28
  }
30
29
  BoundNode.Init = Init;
31
30
  })(BoundNode = exports.BoundNode || (exports.BoundNode = {}));
31
+ function CreateScopeDestroyable(scope) {
32
+ return {
33
+ Destroy() {
34
+ observableScope_1.ObservableScope.Destroy(scope);
35
+ }
36
+ };
37
+ }
32
38
  function ScheduleSetProperties(node, scope) {
33
39
  if (node.setProperties)
34
40
  return;
@@ -51,8 +51,7 @@ function SetChildren(node) {
51
51
  function AddPreReqTemplate(node) {
52
52
  return new Promise(resolve => {
53
53
  (0, thread_1.Thread)(function () {
54
- var preNodes;
55
- injector_1.Injector.Scope(node.injector, () => preNodes = decorators_1.PreReqTemplate.Get(node.component));
54
+ const preNodes = injector_1.Injector.Scope(node.injector, decorators_1.PreReqTemplate.Get, node.component);
56
55
  (0, thread_1.Schedule)(function () {
57
56
  if (node.destroyed)
58
57
  return;
@@ -80,16 +79,17 @@ function AddPreReqTemplate(node) {
80
79
  });
81
80
  });
82
81
  }
82
+ function InvokeNodeTemplate(node) {
83
+ const nodes = node.component.Template();
84
+ if (!Array.isArray(nodes))
85
+ return [nodes];
86
+ return nodes;
87
+ }
83
88
  function AddTemplate(node, init) {
84
89
  (0, thread_1.Thread)(function () {
85
90
  if (node.destroyed)
86
91
  return;
87
- var nodes;
88
- injector_1.Injector.Scope(node.injector, function () {
89
- nodes = node.component.Template();
90
- });
91
- if (!Array.isArray(nodes))
92
- nodes = [nodes];
92
+ const nodes = injector_1.Injector.Scope(node.injector, InvokeNodeTemplate, node);
93
93
  (0, thread_1.Schedule)(function () {
94
94
  nodeRef_1.NodeRef.InitAll(nodes);
95
95
  });
@@ -61,16 +61,9 @@ function ScheduleSetData(node, scope) {
61
61
  }
62
62
  function SetDefaultData(node) {
63
63
  (0, thread_1.Synch)(function () {
64
- var nodes;
65
- injector_1.Injector.Scope(node.injector, function () {
66
- nodes = CreateNodeArray(node.childrenFunc, true);
67
- });
64
+ const nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, true);
68
65
  if (nodes.length > 0) {
69
- (0, thread_1.Schedule)(function () {
70
- if (node.destroyed)
71
- return;
72
- nodeRef_1.NodeRef.InitAll(nodes);
73
- });
66
+ nodeRef_1.NodeRef.InitAll(nodes);
74
67
  (0, thread_1.Thread)(function () {
75
68
  if (node.destroyed)
76
69
  return;
@@ -97,9 +90,7 @@ function SetData(node, value, init = false) {
97
90
  newNodesMap.set(value, newNodeArrayList);
98
91
  }
99
92
  if (!nodes) {
100
- injector_1.Injector.Scope(node.injector, function () {
101
- nodes = CreateNodeArray(node.childrenFunc, value);
102
- });
93
+ nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, value);
103
94
  (0, thread_1.Schedule)(function () {
104
95
  if (node.destroyed || newNodesMap.size === 0)
105
96
  return;
package/Node/nodeRef.js CHANGED
@@ -145,7 +145,8 @@ var NodeRef;
145
145
  return;
146
146
  node.destroyed = true;
147
147
  node.childNodes.forEach(Destroy);
148
- node.destroyables.forEach(d => d && d.Destroy());
148
+ for (let x = 0; x < node.destroyables.length; x++)
149
+ node.destroyables[x]?.Destroy();
149
150
  }
150
151
  NodeRef.Destroy = Destroy;
151
152
  function DestroyAll(nodes) {
@@ -7,7 +7,7 @@ export declare class Injector {
7
7
  }
8
8
  export declare namespace Injector {
9
9
  function Current(): Injector;
10
- function Scope(injector: Injector, action: {
11
- (): void;
12
- }): void;
10
+ function Scope<R = void, P extends any[] = []>(injector: Injector, action: {
11
+ (...args: P): R;
12
+ }, ...args: P): R;
13
13
  }
package/Utils/injector.js CHANGED
@@ -27,11 +27,12 @@ exports.Injector = Injector;
27
27
  return scope;
28
28
  }
29
29
  Injector.Current = Current;
30
- function Scope(injector, action) {
30
+ function Scope(injector, action, ...args) {
31
31
  var parent = Current();
32
32
  scope = injector;
33
- action();
33
+ const ret = action(...args);
34
34
  scope = parent;
35
+ return ret;
35
36
  }
36
37
  Injector.Scope = Scope;
37
38
  })(Injector = exports.Injector || (exports.Injector = {}));
package/Utils/thread.js CHANGED
@@ -7,10 +7,10 @@ const contextQueue = list_1.List.Create();
7
7
  var threadContext = null;
8
8
  var timeoutRunning = false;
9
9
  function ProcessQueue() {
10
- var workStartTime = Date.now();
10
+ var workEndTime = Date.now() + workTimeMs;
11
11
  var ctx;
12
- while ((Date.now() - workStartTime) < workTimeMs && (ctx = list_1.List.Pop(contextQueue)))
13
- DoWork(ctx, workStartTime);
12
+ while (Date.now() < workEndTime && (ctx = list_1.List.Pop(contextQueue)))
13
+ DoWork(ctx, workEndTime);
14
14
  if (contextQueue.size > 0)
15
15
  setTimeout(ProcessQueue);
16
16
  else
@@ -29,12 +29,12 @@ function Invoke(ctx, callback) {
29
29
  callback();
30
30
  ctx.workEndNode = parent;
31
31
  }
32
- function DoWork(ctx, workStartTime = Date.now()) {
32
+ function DoWork(ctx, workEndTime = Date.now() + workTimeMs) {
33
33
  var parentContext = threadContext;
34
34
  threadContext = ctx;
35
35
  var async = ctx.async;
36
36
  var callback;
37
- while (async === ctx.async && (Date.now() - workStartTime) < workTimeMs && (callback = list_1.List.Pop(ctx.workList)))
37
+ while (async === ctx.async && Date.now() < workEndTime && (callback = list_1.List.Pop(ctx.workList)))
38
38
  Invoke(ctx, callback);
39
39
  if (ctx.workList.size > 0)
40
40
  ScheduleWork(ctx);
@@ -58,13 +58,13 @@ function ScheduleCallback(callback, before, async) {
58
58
  threadContext.workEndNode = list_1.List.Add(threadContext.workList, callback);
59
59
  }
60
60
  function SynchWithoutThread(callback) {
61
- var workStartTime = Date.now();
61
+ var workEndTime = Date.now() + workTimeMs;
62
62
  callback();
63
63
  if (threadContext)
64
64
  if (threadContext.async)
65
65
  ScheduleWork(threadContext);
66
66
  else
67
- DoWork(threadContext, workStartTime);
67
+ DoWork(threadContext, workEndTime);
68
68
  threadContext = null;
69
69
  }
70
70
  function Schedule(callback) {
package/jTemplates.js CHANGED
@@ -27,10 +27,13 @@ function processUpdates() {
27
27
  else
28
28
  window_1.wndw.requestAnimationFrame(processUpdates);
29
29
  }
30
- const htmlNs = "http://www.w3.org/1999/xhtml";
31
30
  exports.DOMNodeConfig = {
32
31
  createNode(type, namespace) {
33
- return type !== "text" ? window_1.wndw.document.createElementNS(namespace || htmlNs, type) : window_1.wndw.document.createTextNode("");
32
+ return type !== "text" ?
33
+ namespace ?
34
+ window_1.wndw.document.createElementNS(namespace, type) :
35
+ window_1.wndw.document.createElement(type) :
36
+ window_1.wndw.document.createTextNode("");
34
37
  },
35
38
  scheduleUpdate(callback) {
36
39
  list_1.List.Add(pendingUpdates, callback);
@@ -293,9 +296,10 @@ function SetRootProperty(target, prop, value, lastValue) {
293
296
  }
294
297
  }
295
298
  function SetChangedProperties(target, lastProperties, properties) {
296
- for (var key in properties) {
297
- (!lastProperties || lastProperties[key] !== properties[key]) &&
298
- SetRootProperty(target, key, properties[key], lastProperties && lastProperties[key]);
299
+ const keys = Object.keys(properties);
300
+ for (let x = 0; x < keys.length; x++) {
301
+ if (!lastProperties || lastProperties[keys[x]] !== properties[keys[x]])
302
+ SetRootProperty(target, keys[x], properties[keys[x]], lastProperties && lastProperties[keys[x]]);
299
303
  }
300
304
  }
301
305
  function SetProperties(target, lastProperties, properties) {
@@ -337,29 +341,35 @@ const observableScope_1 = __webpack_require__(/*! ../Store/Tree/observableScope
337
341
  var BoundNode;
338
342
  (function (BoundNode) {
339
343
  function Init(boundNode) {
340
- var nodeDef = boundNode.nodeDef;
341
- var propertiesScope = nodeDef.props ?
342
- observableScope_1.ObservableScope.Create(nodeDef.props) : null;
343
- var attributesScope = nodeDef.attrs ?
344
- observableScope_1.ObservableScope.Create(nodeDef.attrs) : null;
345
- var eventsScope = nodeDef.on ?
346
- observableScope_1.ObservableScope.Create(nodeDef.on) : null;
347
- observableScope_1.ObservableScope.Watch(propertiesScope, function () { ScheduleSetProperties(boundNode, propertiesScope); });
348
- observableScope_1.ObservableScope.Watch(attributesScope, function () { ScheduleSetAttributes(boundNode, attributesScope); });
349
- observableScope_1.ObservableScope.Watch(eventsScope, function () { ScheduleSetEvents(boundNode, eventsScope); });
350
- SetProperties(boundNode, observableScope_1.ObservableScope.Value(propertiesScope));
351
- SetAttributes(boundNode, observableScope_1.ObservableScope.Value(attributesScope));
352
- SetEvents(boundNode, observableScope_1.ObservableScope.Value(eventsScope));
353
- boundNode.destroyables.push({
354
- Destroy: function () {
355
- observableScope_1.ObservableScope.Destroy(propertiesScope);
356
- observableScope_1.ObservableScope.Destroy(attributesScope);
357
- observableScope_1.ObservableScope.Destroy(eventsScope);
358
- }
359
- });
344
+ const nodeDef = boundNode.nodeDef;
345
+ if (nodeDef.props) {
346
+ const scope = observableScope_1.ObservableScope.Create(nodeDef.props);
347
+ boundNode.destroyables.push(CreateScopeDestroyable(scope));
348
+ observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetProperties(boundNode, scope); });
349
+ SetProperties(boundNode, observableScope_1.ObservableScope.Value(scope));
350
+ }
351
+ if (nodeDef.attrs) {
352
+ const scope = observableScope_1.ObservableScope.Create(nodeDef.attrs);
353
+ boundNode.destroyables.push(CreateScopeDestroyable(scope));
354
+ observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetAttributes(boundNode, scope); });
355
+ SetAttributes(boundNode, observableScope_1.ObservableScope.Value(scope));
356
+ }
357
+ if (nodeDef.on) {
358
+ const scope = observableScope_1.ObservableScope.Create(nodeDef.on);
359
+ boundNode.destroyables.push(CreateScopeDestroyable(scope));
360
+ observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetEvents(boundNode, scope); });
361
+ SetEvents(boundNode, observableScope_1.ObservableScope.Value(scope));
362
+ }
360
363
  }
361
364
  BoundNode.Init = Init;
362
365
  })(BoundNode = exports.BoundNode || (exports.BoundNode = {}));
366
+ function CreateScopeDestroyable(scope) {
367
+ return {
368
+ Destroy() {
369
+ observableScope_1.ObservableScope.Destroy(scope);
370
+ }
371
+ };
372
+ }
363
373
  function ScheduleSetProperties(node, scope) {
364
374
  if (node.setProperties)
365
375
  return;
@@ -570,8 +580,7 @@ function SetChildren(node) {
570
580
  function AddPreReqTemplate(node) {
571
581
  return new Promise(resolve => {
572
582
  (0, thread_1.Thread)(function () {
573
- var preNodes;
574
- injector_1.Injector.Scope(node.injector, () => preNodes = decorators_1.PreReqTemplate.Get(node.component));
583
+ const preNodes = injector_1.Injector.Scope(node.injector, decorators_1.PreReqTemplate.Get, node.component);
575
584
  (0, thread_1.Schedule)(function () {
576
585
  if (node.destroyed)
577
586
  return;
@@ -599,16 +608,17 @@ function AddPreReqTemplate(node) {
599
608
  });
600
609
  });
601
610
  }
611
+ function InvokeNodeTemplate(node) {
612
+ const nodes = node.component.Template();
613
+ if (!Array.isArray(nodes))
614
+ return [nodes];
615
+ return nodes;
616
+ }
602
617
  function AddTemplate(node, init) {
603
618
  (0, thread_1.Thread)(function () {
604
619
  if (node.destroyed)
605
620
  return;
606
- var nodes;
607
- injector_1.Injector.Scope(node.injector, function () {
608
- nodes = node.component.Template();
609
- });
610
- if (!Array.isArray(nodes))
611
- nodes = [nodes];
621
+ const nodes = injector_1.Injector.Scope(node.injector, InvokeNodeTemplate, node);
612
622
  (0, thread_1.Schedule)(function () {
613
623
  nodeRef_1.NodeRef.InitAll(nodes);
614
624
  });
@@ -705,16 +715,9 @@ function ScheduleSetData(node, scope) {
705
715
  }
706
716
  function SetDefaultData(node) {
707
717
  (0, thread_1.Synch)(function () {
708
- var nodes;
709
- injector_1.Injector.Scope(node.injector, function () {
710
- nodes = CreateNodeArray(node.childrenFunc, true);
711
- });
718
+ const nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, true);
712
719
  if (nodes.length > 0) {
713
- (0, thread_1.Schedule)(function () {
714
- if (node.destroyed)
715
- return;
716
- nodeRef_1.NodeRef.InitAll(nodes);
717
- });
720
+ nodeRef_1.NodeRef.InitAll(nodes);
718
721
  (0, thread_1.Thread)(function () {
719
722
  if (node.destroyed)
720
723
  return;
@@ -741,9 +744,7 @@ function SetData(node, value, init = false) {
741
744
  newNodesMap.set(value, newNodeArrayList);
742
745
  }
743
746
  if (!nodes) {
744
- injector_1.Injector.Scope(node.injector, function () {
745
- nodes = CreateNodeArray(node.childrenFunc, value);
746
- });
747
+ nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, value);
747
748
  (0, thread_1.Schedule)(function () {
748
749
  if (node.destroyed || newNodesMap.size === 0)
749
750
  return;
@@ -981,7 +982,8 @@ var NodeRef;
981
982
  return;
982
983
  node.destroyed = true;
983
984
  node.childNodes.forEach(Destroy);
984
- node.destroyables.forEach(d => d && d.Destroy());
985
+ for (let x = 0; x < node.destroyables.length; x++)
986
+ node.destroyables[x]?.Destroy();
985
987
  }
986
988
  NodeRef.Destroy = Destroy;
987
989
  function DestroyAll(nodes) {
@@ -2674,11 +2676,12 @@ exports.Injector = Injector;
2674
2676
  return scope;
2675
2677
  }
2676
2678
  Injector.Current = Current;
2677
- function Scope(injector, action) {
2679
+ function Scope(injector, action, ...args) {
2678
2680
  var parent = Current();
2679
2681
  scope = injector;
2680
- action();
2682
+ const ret = action(...args);
2681
2683
  scope = parent;
2684
+ return ret;
2682
2685
  }
2683
2686
  Injector.Scope = Scope;
2684
2687
  })(Injector = exports.Injector || (exports.Injector = {}));
@@ -2831,10 +2834,10 @@ const contextQueue = list_1.List.Create();
2831
2834
  var threadContext = null;
2832
2835
  var timeoutRunning = false;
2833
2836
  function ProcessQueue() {
2834
- var workStartTime = Date.now();
2837
+ var workEndTime = Date.now() + workTimeMs;
2835
2838
  var ctx;
2836
- while ((Date.now() - workStartTime) < workTimeMs && (ctx = list_1.List.Pop(contextQueue)))
2837
- DoWork(ctx, workStartTime);
2839
+ while (Date.now() < workEndTime && (ctx = list_1.List.Pop(contextQueue)))
2840
+ DoWork(ctx, workEndTime);
2838
2841
  if (contextQueue.size > 0)
2839
2842
  setTimeout(ProcessQueue);
2840
2843
  else
@@ -2853,12 +2856,12 @@ function Invoke(ctx, callback) {
2853
2856
  callback();
2854
2857
  ctx.workEndNode = parent;
2855
2858
  }
2856
- function DoWork(ctx, workStartTime = Date.now()) {
2859
+ function DoWork(ctx, workEndTime = Date.now() + workTimeMs) {
2857
2860
  var parentContext = threadContext;
2858
2861
  threadContext = ctx;
2859
2862
  var async = ctx.async;
2860
2863
  var callback;
2861
- while (async === ctx.async && (Date.now() - workStartTime) < workTimeMs && (callback = list_1.List.Pop(ctx.workList)))
2864
+ while (async === ctx.async && Date.now() < workEndTime && (callback = list_1.List.Pop(ctx.workList)))
2862
2865
  Invoke(ctx, callback);
2863
2866
  if (ctx.workList.size > 0)
2864
2867
  ScheduleWork(ctx);
@@ -2882,13 +2885,13 @@ function ScheduleCallback(callback, before, async) {
2882
2885
  threadContext.workEndNode = list_1.List.Add(threadContext.workList, callback);
2883
2886
  }
2884
2887
  function SynchWithoutThread(callback) {
2885
- var workStartTime = Date.now();
2888
+ var workEndTime = Date.now() + workTimeMs;
2886
2889
  callback();
2887
2890
  if (threadContext)
2888
2891
  if (threadContext.async)
2889
2892
  ScheduleWork(threadContext);
2890
2893
  else
2891
- DoWork(threadContext, workStartTime);
2894
+ DoWork(threadContext, workEndTime);
2892
2895
  threadContext = null;
2893
2896
  }
2894
2897
  function Schedule(callback) {
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;AACA,qBAAqB;AACrB;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;;;;;;;;;;;AC9Ea;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;;;;;;;;;;AC7CR;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;AACA;AACA;AACA,+EAA+E,oDAAoD;AACnI,+EAA+E,oDAAoD;AACnI,2EAA2E,4CAA4C;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC,oCAAoC,iBAAiB,KAAK;AAC3D;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;;;;;;;;;;;ACvFa;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,oCAAoC,iBAAiB,KAAK;;;;;;;;;;;AC/E9C;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,4CAA4C,qBAAqB,KAAK;AACvE;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,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,SAAS;AACT;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,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,eAAe,mBAAO,CAAC,0CAAe;AACtC,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C,kBAAkB,mBAAO,CAAC,wCAAW;AACrC,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE;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,wCAAwC,mBAAmB,KAAK;AACjE;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL;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,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;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,oBAAoB,wBAAwB;AAC5C;AACA,4BAA4B,kBAAkB;AAC9C;AACA,SAAS;AACT;AACA,oBAAoB,iCAAiC;AACrD,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACtKa;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,wCAAwC,mBAAmB,KAAK;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA,CAAC,gCAAgC,eAAe,KAAK;;;;;;;;;;;AC3JxC;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,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,KAAK,GAAG,QAAQ;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,KAAK;AAC7C;AACA,qBAAqB;AACrB,gCAAgC,qBAAqB;AACrD,gDAAgD,KAAK,GAAG,EAAE,OAAO,EAAE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,KAAK,GAAG,qBAAqB;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;;;;;;;;;;AC5NR;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,sCAAsC,kBAAkB,KAAK;;;;;;;;;;;AClBjD;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,OAAO;AACxD;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,CAAC,gDAAgD,uBAAuB,KAAK;AAC7E;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;;;;;;;;;;;ACnKa;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,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,wBAAwB,iBAAiB;AACzC,oCAAoC,KAAK,GAAG,QAAQ;AACpD;AACA;AACA;AACA,sBAAsB;;;;;;;;;;;ACrNT;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,4CAA4C,qBAAqB,KAAK;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA,aAAa;AACb;AACA,sCAAsC,YAAY;AAClD;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,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,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,gCAAgC,eAAe,KAAK;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C,sBAAsB,KAAK;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B,cAAc,KAAK;AAClD;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3Sa;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,gCAAgC,eAAe,KAAK;;;;;;;;;;;ACvBxC;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,CAAC,kCAAkC,gBAAgB,KAAK;;;;;;;;;;;ACpC3C;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,qBAAqB;AACrB;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,CAAC,0BAA0B,YAAY,KAAK;;;;;;;;;;;ACvH/B;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\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DOMNodeConfig = void 0;\r\nconst window_1 = require(\"./window\");\r\nconst list_1 = require(\"../Utils/list\");\r\nconst utils_1 = require(\"./utils\");\r\nconst thread_1 = require(\"../Utils/thread\");\r\nvar pendingUpdates = list_1.List.Create();\r\nvar updateScheduled = false;\r\nfunction processUpdates() {\r\n list_1.List.Add(pendingUpdates, null);\r\n var callback;\r\n while ((callback = list_1.List.Pop(pendingUpdates)))\r\n (0, thread_1.Synch)(callback);\r\n if (pendingUpdates.size === 0)\r\n updateScheduled = false;\r\n else\r\n window_1.wndw.requestAnimationFrame(processUpdates);\r\n}\r\nconst htmlNs = \"http://www.w3.org/1999/xhtml\";\r\nexports.DOMNodeConfig = {\r\n createNode(type, namespace) {\r\n return type !== \"text\" ? window_1.wndw.document.createElementNS(namespace || htmlNs, type) : window_1.wndw.document.createTextNode(\"\");\r\n },\r\n scheduleUpdate(callback) {\r\n list_1.List.Add(pendingUpdates, callback);\r\n if (!updateScheduled) {\r\n updateScheduled = true;\r\n window_1.wndw.requestAnimationFrame(processUpdates);\r\n }\r\n },\r\n addListener(target, type, callback) {\r\n target.addEventListener(type, callback);\r\n },\r\n removeListener(target, type, callback) {\r\n target.removeEventListener(type, callback);\r\n },\r\n addChild(root, child) {\r\n root.appendChild(child);\r\n },\r\n addChildFirst(root, child) {\r\n exports.DOMNodeConfig.addChildBefore(root, root.firstChild, child);\r\n },\r\n addChildBefore(root, sibling, child) {\r\n if (!sibling) {\r\n exports.DOMNodeConfig.addChild(root, child);\r\n return;\r\n }\r\n if (child !== sibling)\r\n root.insertBefore(child, sibling);\r\n },\r\n addChildAfter(root, sibling, child) {\r\n if (!sibling) {\r\n exports.DOMNodeConfig.addChildFirst(root, child);\r\n return;\r\n }\r\n exports.DOMNodeConfig.addChildBefore(root, sibling.nextSibling, child);\r\n },\r\n removeChild(root, child) {\r\n root.removeChild(child);\r\n },\r\n remove(target) {\r\n target && target.parentNode && target.parentNode.removeChild(target);\r\n },\r\n setText(target, text) {\r\n target.textContent = text;\r\n },\r\n getAttribute(target, attribute) {\r\n return target.getAttribute(attribute);\r\n },\r\n setAttribute(target, attribute, value) {\r\n target.setAttribute(attribute, value);\r\n },\r\n fireEvent(target, event, data) {\r\n var cEvent = new CustomEvent(event, data);\r\n target.dispatchEvent(cEvent);\r\n },\r\n setProperties: utils_1.SetProperties\r\n};\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\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;\r\nconst elementNode_1 = require(\"../Node/elementNode\");\r\nfunction div(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"div\", null, nodeDef, children);\r\n}\r\nexports.div = div;\r\nfunction a(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"a\", null, nodeDef, children);\r\n}\r\nexports.a = a;\r\nfunction ul(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"ul\", null, nodeDef, children);\r\n}\r\nexports.ul = ul;\r\nfunction li(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"li\", null, nodeDef, children);\r\n}\r\nexports.li = li;\r\nfunction br(nodeDef) {\r\n return elementNode_1.ElementNode.Create(\"br\", null, nodeDef, null);\r\n}\r\nexports.br = br;\r\nfunction b(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"b\", null, nodeDef, children);\r\n}\r\nexports.b = b;\r\nfunction span(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"span\", null, nodeDef, children);\r\n}\r\nexports.span = span;\r\nfunction img(nodeDef) {\r\n return elementNode_1.ElementNode.Create(\"img\", null, nodeDef, null);\r\n}\r\nexports.img = img;\r\nfunction video(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"video\", null, nodeDef, children);\r\n}\r\nexports.video = video;\r\nfunction source(nodeDef) {\r\n return elementNode_1.ElementNode.Create(\"source\", null, nodeDef, null);\r\n}\r\nexports.source = source;\r\nfunction input(nodeDef) {\r\n return elementNode_1.ElementNode.Create(\"input\", null, nodeDef, null);\r\n}\r\nexports.input = input;\r\nfunction select(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"select\", null, nodeDef, children);\r\n}\r\nexports.select = select;\r\nfunction option(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"option\", null, nodeDef, children);\r\n}\r\nexports.option = option;\r\nfunction h1(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"h1\", null, nodeDef, children);\r\n}\r\nexports.h1 = h1;\r\nfunction h2(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"h2\", null, nodeDef, children);\r\n}\r\nexports.h2 = h2;\r\nfunction h3(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"h3\", null, nodeDef, children);\r\n}\r\nexports.h3 = h3;\r\nfunction p(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"p\", null, nodeDef, children);\r\n}\r\nexports.p = p;\r\nfunction style(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"style\", null, nodeDef, children);\r\n}\r\nexports.style = style;\r\nfunction button(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"button\", null, nodeDef, children);\r\n}\r\nexports.button = button;\r\nfunction table(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"table\", null, nodeDef, children);\r\n}\r\nexports.table = table;\r\nfunction th(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"th\", null, nodeDef, children);\r\n}\r\nexports.th = th;\r\nfunction tr(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"tr\", null, nodeDef, children);\r\n}\r\nexports.tr = tr;\r\nfunction td(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"td\", null, nodeDef, children);\r\n}\r\nexports.td = td;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n__exportStar(require(\"./elements\"), exports);\r\n__exportStar(require(\"./svgElements\"), exports);\r\n__exportStar(require(\"./utils\"), exports);\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.circle = exports.g = exports.svg = void 0;\r\nconst elementNode_1 = require(\"../Node/elementNode\");\r\nconst svgNs = \"http://www.w3.org/2000/svg\";\r\nfunction svg(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"svg\", svgNs, nodeDef, children);\r\n}\r\nexports.svg = svg;\r\nfunction g(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"g\", svgNs, nodeDef, children);\r\n}\r\nexports.g = g;\r\nfunction circle(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"circle\", svgNs, nodeDef, children);\r\n}\r\nexports.circle = circle;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SetProperties = void 0;\r\nfunction SetValue(target, value) {\r\n switch (target.nodeName) {\r\n case \"INPUT\":\r\n var start = target.selectionStart;\r\n var end = target.selectionEnd;\r\n target.value = value;\r\n if (target.ownerDocument.activeElement === target)\r\n target.setSelectionRange(start, end);\r\n break;\r\n default:\r\n target.value = value;\r\n }\r\n}\r\nfunction SetStyle(target, styleDef, lastStyleDef) {\r\n for (var key in styleDef)\r\n if (!lastStyleDef || lastStyleDef[key] !== styleDef[key])\r\n target.style[key] = styleDef[key];\r\n}\r\nfunction SetRootProperty(target, prop, value, lastValue) {\r\n switch (prop) {\r\n case \"value\":\r\n SetValue(target, value);\r\n break;\r\n case \"style\":\r\n SetStyle(target, value, lastValue);\r\n break;\r\n default:\r\n target[prop] = value;\r\n }\r\n}\r\nfunction SetChangedProperties(target, lastProperties, properties) {\r\n for (var key in properties) {\r\n (!lastProperties || lastProperties[key] !== properties[key]) &&\r\n SetRootProperty(target, key, properties[key], lastProperties && lastProperties[key]);\r\n }\r\n}\r\nfunction SetProperties(target, lastProperties, properties) {\r\n if (!lastProperties && target.nodeType === Node.TEXT_NODE)\r\n target.nodeValue = properties.nodeValue;\r\n else\r\n SetChangedProperties(target, lastProperties, properties);\r\n}\r\nexports.SetProperties = SetProperties;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.wndw = void 0;\r\nexports.wndw = typeof window !== \"undefined\" ? window : (new (require(\"jsdom\").JSDOM(\"\")).window);\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.BoundNode = void 0;\r\nconst nodeConfig_1 = require(\"./nodeConfig\");\r\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\r\nvar BoundNode;\r\n(function (BoundNode) {\r\n function Init(boundNode) {\r\n var nodeDef = boundNode.nodeDef;\r\n var propertiesScope = nodeDef.props ?\r\n observableScope_1.ObservableScope.Create(nodeDef.props) : null;\r\n var attributesScope = nodeDef.attrs ?\r\n observableScope_1.ObservableScope.Create(nodeDef.attrs) : null;\r\n var eventsScope = nodeDef.on ?\r\n observableScope_1.ObservableScope.Create(nodeDef.on) : null;\r\n observableScope_1.ObservableScope.Watch(propertiesScope, function () { ScheduleSetProperties(boundNode, propertiesScope); });\r\n observableScope_1.ObservableScope.Watch(attributesScope, function () { ScheduleSetAttributes(boundNode, attributesScope); });\r\n observableScope_1.ObservableScope.Watch(eventsScope, function () { ScheduleSetEvents(boundNode, eventsScope); });\r\n SetProperties(boundNode, observableScope_1.ObservableScope.Value(propertiesScope));\r\n SetAttributes(boundNode, observableScope_1.ObservableScope.Value(attributesScope));\r\n SetEvents(boundNode, observableScope_1.ObservableScope.Value(eventsScope));\r\n boundNode.destroyables.push({\r\n Destroy: function () {\r\n observableScope_1.ObservableScope.Destroy(propertiesScope);\r\n observableScope_1.ObservableScope.Destroy(attributesScope);\r\n observableScope_1.ObservableScope.Destroy(eventsScope);\r\n }\r\n });\r\n }\r\n BoundNode.Init = Init;\r\n})(BoundNode = exports.BoundNode || (exports.BoundNode = {}));\r\nfunction ScheduleSetProperties(node, scope) {\r\n if (node.setProperties)\r\n return;\r\n node.setProperties = true;\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n node.setProperties = false;\r\n if (node.destroyed)\r\n return;\r\n SetProperties(node, observableScope_1.ObservableScope.Value(scope));\r\n });\r\n}\r\nfunction SetProperties(node, properties) {\r\n if (!properties)\r\n return;\r\n nodeConfig_1.NodeConfig.setProperties(node.node, node.lastProperties, properties);\r\n node.lastProperties = properties;\r\n}\r\nfunction ScheduleSetAttributes(node, scope) {\r\n if (node.setAttributes)\r\n return;\r\n node.setAttributes = true;\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n node.setAttributes = false;\r\n if (node.destroyed)\r\n return;\r\n SetAttributes(node, observableScope_1.ObservableScope.Value(scope));\r\n });\r\n}\r\nfunction SetAttributes(node, attributes) {\r\n if (!attributes)\r\n return;\r\n for (var key in attributes) {\r\n var val = nodeConfig_1.NodeConfig.getAttribute(node.node, key);\r\n if (val !== attributes[key])\r\n nodeConfig_1.NodeConfig.setAttribute(node.node, key, attributes[key]);\r\n }\r\n}\r\nfunction ScheduleSetEvents(node, scope) {\r\n if (node.setEvents)\r\n return;\r\n node.setEvents = true;\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n node.setEvents = false;\r\n if (node.destroyed)\r\n return;\r\n SetEvents(node, observableScope_1.ObservableScope.Value(scope));\r\n });\r\n}\r\nfunction SetEvents(node, events) {\r\n if (!events)\r\n return;\r\n for (var key in node.lastEvents)\r\n nodeConfig_1.NodeConfig.removeListener(node.node, key, node.lastEvents[key]);\r\n for (var key in events)\r\n nodeConfig_1.NodeConfig.addListener(node.node, key, events[key]);\r\n node.lastEvents = events;\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Component = void 0;\r\nconst nodeRef_1 = require(\"./nodeRef\");\r\nconst componentNode_1 = require(\"./componentNode\");\r\nconst decorators_1 = require(\"../Utils/decorators\");\r\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\r\nclass Component {\r\n nodeRef;\r\n componentEvents;\r\n scope;\r\n templates;\r\n decoratorMap;\r\n get Injector() {\r\n return this.nodeRef.injector;\r\n }\r\n get Destroyed() {\r\n return this.nodeRef.destroyed;\r\n }\r\n get DecoratorMap() {\r\n return this.decoratorMap;\r\n }\r\n get Scope() {\r\n return this.scope;\r\n }\r\n get Data() {\r\n return this.scope.Value;\r\n }\r\n get NodeRef() {\r\n return this.nodeRef;\r\n }\r\n get Templates() {\r\n return this.templates;\r\n }\r\n constructor(data, templates, nodeRef, componentEvents) {\r\n this.nodeRef = nodeRef;\r\n this.componentEvents = componentEvents;\r\n this.scope = new observableScope_1.ObservableScope(data);\r\n this.templates = templates || {};\r\n this.decoratorMap = new Map();\r\n }\r\n Template() {\r\n return [];\r\n }\r\n Bound() {\r\n }\r\n Fire(event, data) {\r\n var eventCallback = this.componentEvents && this.componentEvents[event];\r\n eventCallback && eventCallback(data);\r\n }\r\n Destroy() {\r\n decorators_1.Destroy.All(this);\r\n }\r\n}\r\nexports.Component = Component;\r\n(function (Component) {\r\n function ToFunction(type, namespace, constructor) {\r\n return componentNode_1.ComponentNode.ToFunction(type, namespace, constructor);\r\n }\r\n Component.ToFunction = ToFunction;\r\n function Register(name, constructor) {\r\n const componentFunction = ToFunction(`${name}-component`, undefined, constructor);\r\n class WebComponent extends HTMLElement {\r\n constructor() {\r\n super();\r\n const shadowRoot = this.attachShadow({ mode: 'open' });\r\n const node = componentFunction({});\r\n Attach(shadowRoot, node);\r\n }\r\n }\r\n customElements.define(name, WebComponent);\r\n }\r\n Component.Register = Register;\r\n function Attach(node, nodeRef) {\r\n nodeRef_1.NodeRef.Init(nodeRef);\r\n var rootRef = nodeRef_1.NodeRef.Wrap(node);\r\n nodeRef_1.NodeRef.AddChild(rootRef, nodeRef);\r\n }\r\n Component.Attach = Attach;\r\n})(Component = exports.Component || (exports.Component = {}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ComponentNode = void 0;\r\nconst boundNode_1 = require(\"./boundNode\");\r\nconst nodeRef_1 = require(\"./nodeRef\");\r\nconst nodeConfig_1 = require(\"./nodeConfig\");\r\nconst component_1 = require(\"./component\");\r\nconst injector_1 = require(\"../Utils/injector\");\r\nconst decorators_1 = require(\"../Utils/decorators\");\r\nconst thread_1 = require(\"../Utils/thread\");\r\nvar ComponentNode;\r\n(function (ComponentNode) {\r\n function Fire(event, data) {\r\n var eventCallback = this.componentEvents && this.componentEvents[event];\r\n eventCallback && eventCallback(data);\r\n }\r\n ComponentNode.Fire = Fire;\r\n function ToFunction(type, namespace, constructor) {\r\n return function (nodeDef, templates) {\r\n return Create(type, namespace, nodeDef, constructor, templates);\r\n };\r\n }\r\n ComponentNode.ToFunction = ToFunction;\r\n function Init(componentNode) {\r\n var nodeDef = componentNode.nodeDef;\r\n var events = nodeDef.on;\r\n nodeDef.on = null;\r\n componentNode.component = new componentNode.constructor(nodeDef.data, componentNode.templates, componentNode, events);\r\n SetChildren(componentNode);\r\n componentNode.destroyables.push(componentNode.component);\r\n boundNode_1.BoundNode.Init(componentNode);\r\n }\r\n ComponentNode.Init = Init;\r\n})(ComponentNode = exports.ComponentNode || (exports.ComponentNode = {}));\r\nfunction Create(type, namespace, nodeDef, constructor, templates) {\r\n var compNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ComponentNode);\r\n compNode.nodeDef = nodeDef;\r\n compNode.constructor = constructor;\r\n compNode.templates = templates;\r\n return compNode;\r\n}\r\nfunction SetChildren(node) {\r\n if (decorators_1.PreReq.Has(node.component)) {\r\n AddPreReqTemplate(node).then(function () {\r\n AddTemplate(node, false);\r\n });\r\n }\r\n else\r\n AddTemplate(node, true);\r\n}\r\nfunction AddPreReqTemplate(node) {\r\n return new Promise(resolve => {\r\n (0, thread_1.Thread)(function () {\r\n var preNodes;\r\n injector_1.Injector.Scope(node.injector, () => preNodes = decorators_1.PreReqTemplate.Get(node.component));\r\n (0, thread_1.Schedule)(function () {\r\n if (node.destroyed)\r\n return;\r\n nodeRef_1.NodeRef.InitAll(preNodes);\r\n });\r\n (0, thread_1.Thread)(function () {\r\n if (node.destroyed)\r\n return;\r\n for (var x = 0; x < preNodes.length; x++)\r\n nodeRef_1.NodeRef.AddChild(node, preNodes[x]);\r\n decorators_1.PreReq.All(node.component).then(function () {\r\n if (node.destroyed)\r\n return;\r\n for (var x = 0; x < preNodes.length; x++)\r\n nodeRef_1.NodeRef.Destroy(preNodes[x]);\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n if (node.destroyed)\r\n return;\r\n for (var x = 0; x < preNodes.length; x++)\r\n nodeRef_1.NodeRef.DetachChild(node, preNodes[x]);\r\n resolve();\r\n });\r\n });\r\n });\r\n });\r\n });\r\n}\r\nfunction AddTemplate(node, init) {\r\n (0, thread_1.Thread)(function () {\r\n if (node.destroyed)\r\n return;\r\n var nodes;\r\n injector_1.Injector.Scope(node.injector, function () {\r\n nodes = node.component.Template();\r\n });\r\n if (!Array.isArray(nodes))\r\n nodes = [nodes];\r\n (0, thread_1.Schedule)(function () {\r\n nodeRef_1.NodeRef.InitAll(nodes);\r\n });\r\n (0, thread_1.Thread)(function () {\r\n if (node.destroyed)\r\n return;\r\n if (init)\r\n for (var x = 0; x < nodes.length; x++)\r\n nodeRef_1.NodeRef.AddChild(node, nodes[x]);\r\n else\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n if (node.destroyed)\r\n return;\r\n for (var x = 0; x < nodes.length; x++)\r\n nodeRef_1.NodeRef.AddChild(node, nodes[x]);\r\n });\r\n });\r\n if (node.component.Bound !== component_1.Component.prototype.Bound)\r\n (0, thread_1.After)(function () {\r\n nodeConfig_1.NodeConfig.scheduleUpdate(() => setTimeout(() => node.component.Bound(), 0));\r\n });\r\n });\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ElementNode = void 0;\r\nconst boundNode_1 = require(\"./boundNode\");\r\nconst nodeConfig_1 = require(\"./nodeConfig\");\r\nconst injector_1 = require(\"../Utils/injector\");\r\nconst list_1 = require(\"../Utils/list\");\r\nconst thread_1 = require(\"../Utils/thread\");\r\nconst nodeRef_1 = require(\"./nodeRef\");\r\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\r\nvar ElementNode;\r\n(function (ElementNode) {\r\n function Create(type, namespace, nodeDef, children) {\r\n var elemNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ElementNode);\r\n elemNode.nodeDef = nodeDef;\r\n elemNode.childrenFunc = children;\r\n return elemNode;\r\n }\r\n ElementNode.Create = Create;\r\n function Init(elementNode) {\r\n if (elementNode.childrenFunc) {\r\n var nodeDef = elementNode.nodeDef;\r\n if (nodeDef.data) {\r\n const dataScope = observableScope_1.ObservableScope.Create(nodeDef.data);\r\n observableScope_1.ObservableScope.Watch(dataScope, function () {\r\n ScheduleSetData(elementNode, dataScope);\r\n });\r\n SetData(elementNode, GetValue(dataScope), true);\r\n elementNode.destroyables.push({\r\n Destroy: function () {\r\n observableScope_1.ObservableScope.Destroy(dataScope);\r\n }\r\n });\r\n }\r\n else\r\n SetDefaultData(elementNode);\r\n }\r\n boundNode_1.BoundNode.Init(elementNode);\r\n }\r\n ElementNode.Init = Init;\r\n})(ElementNode = exports.ElementNode || (exports.ElementNode = {}));\r\nconst valueDefault = [];\r\nfunction GetValue(dataScope) {\r\n var value = observableScope_1.ObservableScope.Value(dataScope);\r\n if (!value)\r\n return valueDefault;\r\n if (!Array.isArray(value))\r\n value = [value];\r\n return value;\r\n}\r\nfunction ScheduleSetData(node, scope) {\r\n if (node.setData)\r\n return;\r\n node.setData = true;\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n node.setData = false;\r\n if (node.destroyed)\r\n return;\r\n SetData(node, GetValue(scope));\r\n });\r\n}\r\nfunction SetDefaultData(node) {\r\n (0, thread_1.Synch)(function () {\r\n var nodes;\r\n injector_1.Injector.Scope(node.injector, function () {\r\n nodes = CreateNodeArray(node.childrenFunc, true);\r\n });\r\n if (nodes.length > 0) {\r\n (0, thread_1.Schedule)(function () {\r\n if (node.destroyed)\r\n return;\r\n nodeRef_1.NodeRef.InitAll(nodes);\r\n });\r\n (0, thread_1.Thread)(function () {\r\n if (node.destroyed)\r\n return;\r\n DetachAndAddNodes(node, [], [nodes]);\r\n });\r\n }\r\n });\r\n}\r\nfunction SetData(node, value, init = false) {\r\n (0, thread_1.Synch)(function () {\r\n var newNodesMap = new Map();\r\n var values = value || valueDefault;\r\n if (!Array.isArray(values))\r\n values = [values];\r\n var newNodesArrays = values.map(function (value) {\r\n var nodes;\r\n if (node.nodesMap) {\r\n var nodeArrayList = node.nodesMap.get(value);\r\n nodes = nodeArrayList && list_1.List.Remove(nodeArrayList);\r\n }\r\n var newNodeArrayList = newNodesMap.get(value);\r\n if (!newNodeArrayList) {\r\n newNodeArrayList = list_1.List.Create();\r\n newNodesMap.set(value, newNodeArrayList);\r\n }\r\n if (!nodes) {\r\n injector_1.Injector.Scope(node.injector, function () {\r\n nodes = CreateNodeArray(node.childrenFunc, value);\r\n });\r\n (0, thread_1.Schedule)(function () {\r\n if (node.destroyed || newNodesMap.size === 0)\r\n return;\r\n nodeRef_1.NodeRef.InitAll(nodes);\r\n list_1.List.Push(newNodeArrayList, nodes);\r\n });\r\n }\r\n else\r\n list_1.List.Push(newNodeArrayList, nodes);\r\n return nodes;\r\n });\r\n var detachNodes = [];\r\n if (node.nodesMap) {\r\n for (var nodeArrayList of node.nodesMap.values())\r\n nodeArrayList.size > 0 && detachNodes.push(DestroyNodeArrayList(nodeArrayList));\r\n node.nodesMap.clear();\r\n }\r\n node.nodesMap = newNodesMap;\r\n (0, thread_1.Thread)(function () {\r\n if (node.destroyed)\r\n return;\r\n if (init)\r\n DetachAndAddNodes(node, detachNodes, newNodesMap.size > 0 && newNodesArrays);\r\n else\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n if (node.destroyed)\r\n return;\r\n DetachAndAddNodes(node, detachNodes, newNodesMap.size > 0 && newNodesArrays);\r\n });\r\n });\r\n });\r\n}\r\nfunction DetachAndAddNodes(node, detachNodes, newNodes) {\r\n for (var x = 0; x < detachNodes.length; x++)\r\n list_1.List.ForEach(detachNodes[x], function (nodes) {\r\n for (var x = 0; x < nodes.length; x++)\r\n nodeRef_1.NodeRef.DetachChild(node, nodes[x]);\r\n });\r\n var previousNode = null;\r\n for (var x = 0; newNodes && x < newNodes.length; x++) {\r\n for (var y = 0; y < newNodes[x].length; y++) {\r\n nodeRef_1.NodeRef.AddChildAfter(node, previousNode, newNodes[x][y]);\r\n previousNode = newNodes[x][y];\r\n }\r\n }\r\n}\r\nfunction CreateNodeArray(childrenFunc, value) {\r\n var newNodes = childrenFunc(value);\r\n if (typeof newNodes === \"string\") {\r\n var textNode = nodeRef_1.NodeRef.Create(\"text\", null, nodeRef_1.NodeRefType.BoundNode);\r\n textNode.nodeDef = {\r\n props: function () {\r\n return { nodeValue: childrenFunc(value) };\r\n }\r\n };\r\n return [textNode];\r\n }\r\n if (Array.isArray(newNodes))\r\n return newNodes;\r\n return [newNodes];\r\n}\r\nfunction DestroyNodeArrayList(nodeArrayList) {\r\n list_1.List.ForEach(nodeArrayList, nodeRef_1.NodeRef.DestroyAll);\r\n return nodeArrayList;\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.NodeConfig = void 0;\r\nconst domNodeConfig_1 = require(\"../DOM/domNodeConfig\");\r\nexports.NodeConfig = domNodeConfig_1.DOMNodeConfig;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.NodeRef = exports.NodeRefType = void 0;\r\nconst nodeConfig_1 = require(\"./nodeConfig\");\r\nconst injector_1 = require(\"../Utils/injector\");\r\nconst boundNode_1 = require(\"./boundNode\");\r\nconst elementNode_1 = require(\"./elementNode\");\r\nconst componentNode_1 = require(\"./componentNode\");\r\nvar NodeRefType;\r\n(function (NodeRefType) {\r\n NodeRefType[NodeRefType[\"NodeRef\"] = 0] = \"NodeRef\";\r\n NodeRefType[NodeRefType[\"BoundNode\"] = 1] = \"BoundNode\";\r\n NodeRefType[NodeRefType[\"ElementNode\"] = 2] = \"ElementNode\";\r\n NodeRefType[NodeRefType[\"ComponentNode\"] = 3] = \"ComponentNode\";\r\n})(NodeRefType = exports.NodeRefType || (exports.NodeRefType = {}));\r\nvar NodeRef;\r\n(function (NodeRef) {\r\n function Wrap(node) {\r\n var nodeRef = Create(null, null, NodeRefType.NodeRef);\r\n nodeRef.node = node;\r\n nodeRef.childNodes = new Set();\r\n return nodeRef;\r\n }\r\n NodeRef.Wrap = Wrap;\r\n function Create(nodeType, namespace, type) {\r\n switch (type) {\r\n case NodeRefType.NodeRef:\r\n return {\r\n node: null,\r\n nodeType: nodeType,\r\n nodeNamespace: namespace,\r\n type: NodeRefType.NodeRef,\r\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\r\n parent: null,\r\n childNodes: null,\r\n destroyed: false,\r\n destroyables: []\r\n };\r\n case NodeRefType.BoundNode:\r\n return {\r\n node: null,\r\n nodeType: nodeType,\r\n nodeNamespace: namespace,\r\n type: NodeRefType.BoundNode,\r\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\r\n parent: null,\r\n childNodes: null,\r\n destroyed: false,\r\n destroyables: [],\r\n lastProperties: null,\r\n lastEvents: null,\r\n setProperties: false,\r\n setAttributes: false,\r\n setEvents: false\r\n };\r\n case NodeRefType.ElementNode:\r\n return {\r\n node: null,\r\n nodeType: nodeType,\r\n nodeNamespace: namespace,\r\n type: NodeRefType.ElementNode,\r\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\r\n parent: null,\r\n childNodes: null,\r\n destroyed: false,\r\n destroyables: [],\r\n lastProperties: null,\r\n lastEvents: null,\r\n setProperties: false,\r\n setAttributes: false,\r\n setEvents: false,\r\n childrenFunc: null,\r\n nodesMap: null,\r\n setData: false\r\n };\r\n case NodeRefType.ComponentNode:\r\n return {\r\n node: null,\r\n nodeType: nodeType,\r\n nodeNamespace: namespace,\r\n type: NodeRefType.ComponentNode,\r\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\r\n parent: null,\r\n childNodes: null,\r\n destroyed: false,\r\n destroyables: [],\r\n lastProperties: null,\r\n lastEvents: null,\r\n setProperties: false,\r\n setAttributes: false,\r\n setEvents: false,\r\n component: null,\r\n componentEvents: null\r\n };\r\n }\r\n }\r\n NodeRef.Create = Create;\r\n function Init(nodeRef) {\r\n if (nodeRef.node)\r\n return;\r\n nodeRef.node = nodeConfig_1.NodeConfig.createNode(nodeRef.nodeType, nodeRef.nodeNamespace);\r\n nodeRef.childNodes = new Set();\r\n switch (nodeRef.type) {\r\n case NodeRefType.BoundNode:\r\n boundNode_1.BoundNode.Init(nodeRef);\r\n break;\r\n case NodeRefType.ElementNode:\r\n elementNode_1.ElementNode.Init(nodeRef);\r\n break;\r\n case NodeRefType.ComponentNode:\r\n componentNode_1.ComponentNode.Init(nodeRef);\r\n break;\r\n }\r\n }\r\n NodeRef.Init = Init;\r\n function InitAll(nodeRefs) {\r\n for (var x = 0; x < nodeRefs.length; x++)\r\n Init(nodeRefs[x]);\r\n }\r\n NodeRef.InitAll = InitAll;\r\n function AddChild(node, child) {\r\n child.parent = node;\r\n node.childNodes.add(child);\r\n nodeConfig_1.NodeConfig.addChild(node.node, child.node);\r\n }\r\n NodeRef.AddChild = AddChild;\r\n function AddChildAfter(node, currentChild, newChild) {\r\n if (currentChild && !node.childNodes.has(currentChild))\r\n throw \"currentChild is not valid\";\r\n newChild.parent = node;\r\n node.childNodes.add(newChild);\r\n nodeConfig_1.NodeConfig.addChildAfter(node.node, currentChild && currentChild.node, newChild.node);\r\n }\r\n NodeRef.AddChildAfter = AddChildAfter;\r\n function DetachChild(node, child) {\r\n if (node.childNodes.has(child)) {\r\n node.childNodes.delete(child);\r\n nodeConfig_1.NodeConfig.removeChild(node.node, child.node);\r\n child.parent = null;\r\n }\r\n }\r\n NodeRef.DetachChild = DetachChild;\r\n function Destroy(node) {\r\n if (node.destroyed)\r\n return;\r\n node.destroyed = true;\r\n node.childNodes.forEach(Destroy);\r\n node.destroyables.forEach(d => d && d.Destroy());\r\n }\r\n NodeRef.Destroy = Destroy;\r\n function DestroyAll(nodes) {\r\n for (var x = 0; x < nodes.length; x++)\r\n Destroy(nodes[x]);\r\n }\r\n NodeRef.DestroyAll = DestroyAll;\r\n})(NodeRef = exports.NodeRef || (exports.NodeRef = {}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DiffAsync = void 0;\r\nconst diffTree_1 = require(\"./diffTree\");\r\nconst workerQueue_1 = require(\"./workerQueue\");\r\nconst diffWorker_1 = require(\"./diffWorker\");\r\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\r\nclass DiffAsync {\r\n workerQueue;\r\n constructor(keyFunc) {\r\n this.workerQueue = new workerQueue_1.WorkerQueue(diffWorker_1.DiffWorker.Create());\r\n this.workerQueue.Push({ method: \"create\", arguments: [keyFunc.toString()] });\r\n }\r\n static GetKeyRef(key) {\r\n return diffCnstr.GetKeyRef(key);\r\n }\r\n static ReadKeyRef(ref) {\r\n return diffCnstr.ReadKeyRef(ref);\r\n }\r\n async DiffPath(path, value) {\r\n return await this.workerQueue.Push({ method: \"diffpath\", arguments: [path, value] });\r\n }\r\n async DiffBatch(data) {\r\n return await this.workerQueue.Push({ method: \"diffbatch\", arguments: [data] });\r\n }\r\n async UpdatePath(path, value) {\r\n await this.workerQueue.Push({ method: \"updatepath\", arguments: [path, value] });\r\n }\r\n async GetPath(path) {\r\n return await this.workerQueue.Push({ method: \"getpath\", arguments: [path] });\r\n }\r\n Destroy() {\r\n this.workerQueue.Destroy();\r\n }\r\n}\r\nexports.DiffAsync = DiffAsync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DiffSync = void 0;\r\nconst diffTree_1 = require(\"./diffTree\");\r\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\r\nclass DiffSync {\r\n diffTree;\r\n constructor(keyFunc) {\r\n this.diffTree = new diffCnstr(keyFunc);\r\n }\r\n static GetKeyRef(key) {\r\n return diffCnstr.GetKeyRef(key);\r\n }\r\n static ReadKeyRef(ref) {\r\n return diffCnstr.ReadKeyRef(ref);\r\n }\r\n DiffPath(path, value) {\r\n return this.diffTree.DiffPath(path, value);\r\n }\r\n DiffBatch(data) {\r\n return this.diffTree.DiffBatch(data);\r\n }\r\n UpdatePath(path, value) {\r\n this.diffTree.UpdatePath(path, value);\r\n }\r\n}\r\nexports.DiffSync = DiffSync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DiffTreeScope = void 0;\r\nfunction DiffTreeScope(worker) {\r\n const ctx = this;\r\n if (ctx && worker) {\r\n let diffTree = null;\r\n ctx.onmessage = function (event) {\r\n var data = event.data;\r\n switch (data.method) {\r\n case \"create\":\r\n var keyFunc = data.arguments[0] ? eval(data.arguments[0]) : undefined;\r\n diffTree = new DiffTree(keyFunc);\r\n ctx.postMessage(null);\r\n break;\r\n case \"diffpath\":\r\n var diff = diffTree.DiffPath(data.arguments[0], data.arguments[1]);\r\n ctx.postMessage(diff);\r\n break;\r\n case \"diffbatch\":\r\n var diff = diffTree.DiffBatch(data.arguments[0]);\r\n ctx.postMessage(diff);\r\n break;\r\n case \"updatepath\":\r\n diffTree.UpdatePath(data.arguments[0], data.arguments[1]);\r\n ctx.postMessage(null);\r\n break;\r\n case \"getpath\":\r\n var ret = diffTree.GetPath(data.arguments[0]);\r\n ctx.postMessage(ret);\r\n break;\r\n }\r\n };\r\n }\r\n const jsonConstructor = {}.constructor;\r\n function IsValue(value) {\r\n if (!value)\r\n return true;\r\n return !(jsonConstructor === value.constructor || Array.isArray(value));\r\n }\r\n let Type;\r\n (function (Type) {\r\n Type[Type[\"Value\"] = 0] = \"Value\";\r\n Type[Type[\"Object\"] = 1] = \"Object\";\r\n Type[Type[\"Array\"] = 2] = \"Array\";\r\n })(Type || (Type = {}));\r\n function TypeOf(value) {\r\n if (!value)\r\n return Type.Value;\r\n if (jsonConstructor === value.constructor)\r\n return Type.Object;\r\n if (Array.isArray(value))\r\n return Type.Array;\r\n return Type.Value;\r\n }\r\n class DiffTree {\r\n keyFunc;\r\n rootStateMap = new Map();\r\n constructor(keyFunc) {\r\n this.keyFunc = keyFunc;\r\n }\r\n static GetKeyRef(key) {\r\n return `___DiffTreeKeyRef.${key}`;\r\n }\r\n static ReadKeyRef(ref) {\r\n if (!ref)\r\n return undefined;\r\n var matches = ref.match(/^___DiffTreeKeyRef\\.([^.]+$)/);\r\n if (!matches)\r\n return undefined;\r\n return matches[1];\r\n }\r\n DiffBatch(data) {\r\n var resp = [];\r\n ;\r\n for (var x = 0; x < data.length; x++)\r\n this.RunDiff(data[x].path, data[x].value, resp);\r\n return resp;\r\n }\r\n DiffPath(path, value) {\r\n var resp = [];\r\n this.RunDiff(path, value, resp);\r\n return resp;\r\n }\r\n UpdatePath(path, value) {\r\n this.SetPathValue(path, value);\r\n }\r\n GetPath(path) {\r\n return this.GetPathValue(path);\r\n }\r\n RunDiff(path, value, diffResp) {\r\n var breakupMap = this.GetBreakUpMap(path, value);\r\n var resp = diffResp || [];\r\n breakupMap.forEach((value, key) => {\r\n var currentValue = key.split(\".\").reduce((pre, curr, index) => {\r\n if (index === 0)\r\n return this.rootStateMap.get(curr);\r\n return pre && pre[curr];\r\n }, null);\r\n this.DiffJson(key, value, currentValue, resp);\r\n });\r\n for (var x = 0; x < resp.length; x++)\r\n this.SetPathValue(resp[x].path, resp[x].value);\r\n }\r\n GetPathValue(path) {\r\n var parts = path.split(\".\");\r\n var curr = this.rootStateMap.get(parts[0]);\r\n for (var x = 1; x < parts.length; x++)\r\n curr = curr && curr[parts[x]];\r\n return curr;\r\n }\r\n SetPathValue(path, value) {\r\n var parts = path.split(\".\");\r\n if (parts.length === 1)\r\n this.rootStateMap.set(parts[0], value);\r\n else {\r\n var curr = this.rootStateMap.get(parts[0]);\r\n for (var x = 1; x < parts.length - 1; x++)\r\n curr = curr[parts[x]];\r\n curr[parts[parts.length - 1]] = value;\r\n }\r\n }\r\n GetBreakUpMap(path, value) {\r\n if (!this.keyFunc)\r\n return new Map([[path, value]]);\r\n return this.BreakUpValue(path, value);\r\n }\r\n BreakUpValue(path, parent, prop, map) {\r\n var value = prop ? parent[prop] : parent;\r\n var isValue = IsValue(value);\r\n if (!map && isValue)\r\n return new Map([[path, value]]);\r\n map = map || new Map();\r\n if (isValue)\r\n return map;\r\n var key = this.keyFunc ? this.keyFunc(value) : null;\r\n var keyRef = key && DiffTree.GetKeyRef(key);\r\n if (key && key !== path) {\r\n if (prop)\r\n parent[prop] = keyRef;\r\n this.BreakUpValue(key, value, null, map);\r\n }\r\n else {\r\n for (var subProp in value) {\r\n var childPath = `${path}.${subProp}`;\r\n this.BreakUpValue(childPath, value, subProp, map);\r\n }\r\n }\r\n if (!prop)\r\n map.set(path, key === path ? value : keyRef || value);\r\n return map;\r\n }\r\n DiffJson(path, newValue, oldValue, resp) {\r\n const newType = TypeOf(newValue);\r\n const oldType = TypeOf(oldValue);\r\n if (newType !== oldType) {\r\n resp.push({\r\n path,\r\n value: newValue\r\n });\r\n return true;\r\n }\r\n if (newType === Type.Value || oldType === Type.Value) {\r\n if (newValue !== oldValue) {\r\n resp.push({\r\n path,\r\n value: newValue\r\n });\r\n return true;\r\n }\r\n return false;\r\n }\r\n const changedPathLength = resp.length;\r\n let allChildrenChanged = true;\r\n if (newType === Type.Array) {\r\n if (newValue.length !== oldValue.length)\r\n resp.push({\r\n path: path ? `${path}.length` : 'length',\r\n value: newValue.length\r\n });\r\n for (let y = 0; y < newValue.length; y++) {\r\n const arrayPath = path ? `${path}.${y}` : `${y}`;\r\n allChildrenChanged = this.DiffJson(arrayPath, newValue[y], oldValue[y], resp) && allChildrenChanged;\r\n }\r\n }\r\n else if (newType === Type.Object) {\r\n const newKeys = Object.keys(newValue).sort();\r\n const oldKeys = Object.keys(oldValue).sort();\r\n if (newKeys.length >= oldKeys.length) {\r\n let newKeyIndex = 0;\r\n let oldKeyIndex = 0;\r\n while (newKeyIndex < newKeys.length) {\r\n const childPath = path ? `${path}.${newKeys[newKeyIndex]}` : newKeys[newKeyIndex];\r\n if (oldKeyIndex < oldKeys.length && newKeys[newKeyIndex] === oldKeys[oldKeyIndex]) {\r\n allChildrenChanged = this.DiffJson(childPath, newValue[newKeys[newKeyIndex]], oldValue[oldKeys[oldKeyIndex]], resp) && allChildrenChanged;\r\n oldKeyIndex++;\r\n }\r\n else {\r\n resp.push({\r\n path: childPath,\r\n value: newValue[newKeys[newKeyIndex]]\r\n });\r\n }\r\n newKeyIndex++;\r\n }\r\n }\r\n }\r\n if (path && allChildrenChanged) {\r\n resp.splice(changedPathLength);\r\n resp.push({\r\n path,\r\n value: newValue\r\n });\r\n return true;\r\n }\r\n return false;\r\n }\r\n }\r\n return DiffTree;\r\n}\r\nexports.DiffTreeScope = DiffTreeScope;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DiffWorker = void 0;\r\nconst diffTree_1 = require(\"./diffTree\");\r\nvar DiffWorker;\r\n(function (DiffWorker) {\r\n var workerConstructor = null;\r\n var workerParameter = null;\r\n if (typeof Worker !== 'undefined') {\r\n workerConstructor = Worker;\r\n workerParameter = URL.createObjectURL(new Blob([`(${diffTree_1.DiffTreeScope}).call(this, true)`]));\r\n }\r\n function Create() {\r\n if (!workerConstructor)\r\n throw \"Worker is not available\";\r\n return new workerConstructor(workerParameter);\r\n }\r\n DiffWorker.Create = Create;\r\n})(DiffWorker = exports.DiffWorker || (exports.DiffWorker = {}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.WorkerQueue = void 0;\r\nconst list_1 = require(\"../../Utils/list\");\r\nclass WorkerQueue {\r\n callbacks;\r\n worker;\r\n constructor(worker) {\r\n this.worker = worker;\r\n this.callbacks = list_1.List.Create();\r\n this.worker.onerror = (err) => {\r\n var cb = list_1.List.Pop(this.callbacks);\r\n cb && cb(null, err);\r\n };\r\n this.worker.onmessage = (message) => {\r\n var cb = list_1.List.Pop(this.callbacks);\r\n cb && cb(message.data);\r\n };\r\n }\r\n Push(message) {\r\n return new Promise((resolve, reject) => {\r\n list_1.List.Add(this.callbacks, function (data, err) {\r\n if (err)\r\n reject(err);\r\n else\r\n resolve(data);\r\n });\r\n this.worker.postMessage(message);\r\n });\r\n }\r\n Destroy() {\r\n this.worker.terminate();\r\n }\r\n}\r\nexports.WorkerQueue = WorkerQueue;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Store = void 0;\r\nconst observableTree_1 = require(\"../Tree/observableTree\");\r\nconst storeWriter_1 = require(\"./storeWriter\");\r\nclass Store {\r\n observableTree = new observableTree_1.ObservableTree();\r\n storeWriter = new storeWriter_1.StoreWriter(this.observableTree);\r\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\r\n get Root() {\r\n return this.rootScope;\r\n }\r\n constructor(init) {\r\n if (init)\r\n this.Write(init);\r\n }\r\n Action(action) {\r\n var proxy = this.observableTree.Get(\"ROOT\");\r\n action(proxy, this.storeWriter);\r\n }\r\n Write(data) {\r\n this.Action((root, writer) => writer.Write(root, data));\r\n }\r\n Merge(data) {\r\n this.Action((root, writer) => writer.Merge(root, data));\r\n }\r\n Destroy() {\r\n this.rootScope.Destroy();\r\n }\r\n}\r\nexports.Store = Store;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreAsync = void 0;\r\nconst observableTree_1 = require(\"../Tree/observableTree\");\r\nconst diffAsync_1 = require(\"../Diff/diffAsync\");\r\nconst storeAsyncWriter_1 = require(\"./storeAsyncWriter\");\r\nconst asyncQueue_1 = require(\"../../Utils/asyncQueue\");\r\nclass StoreAsync {\r\n idFunc;\r\n diffAsync;\r\n observableTree;\r\n asyncWriter;\r\n asyncQueue;\r\n constructor(idFunc, init) {\r\n this.idFunc = idFunc;\r\n this.diffAsync = new diffAsync_1.DiffAsync(this.idFunc);\r\n this.observableTree = new observableTree_1.ObservableTree(diffAsync_1.DiffAsync.ReadKeyRef);\r\n this.asyncWriter = new storeAsyncWriter_1.StoreAsyncWriter(this.idFunc, this.diffAsync, this.observableTree);\r\n this.asyncQueue = new asyncQueue_1.AsyncQueue();\r\n if (init) {\r\n var id = this.idFunc(init);\r\n this.observableTree.Write(id, init);\r\n this.Write(init);\r\n }\r\n }\r\n Scope(id, func) {\r\n return this.observableTree.Scope(id, func);\r\n }\r\n async Action(id, action) {\r\n await this.asyncQueue.Next(async () => {\r\n await action(id && this.observableTree.Get(id), this.asyncWriter);\r\n });\r\n }\r\n async Write(data) {\r\n await this.Action(null, async (val, writer) => {\r\n await writer.Write(val, data);\r\n });\r\n }\r\n async Merge(id, data) {\r\n await this.Action(id, async (val, writer) => {\r\n await writer.Merge(val, data);\r\n });\r\n }\r\n Destroy() {\r\n this.asyncQueue.Stop();\r\n this.diffAsync.Destroy();\r\n }\r\n}\r\nexports.StoreAsync = StoreAsync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreAsyncWriter = void 0;\r\nclass StoreAsyncWriter {\r\n idFunc;\r\n diffAsync;\r\n observableTree;\r\n constructor(idFunc, diffAsync, observableTree) {\r\n this.idFunc = idFunc;\r\n this.diffAsync = diffAsync;\r\n this.observableTree = observableTree;\r\n }\r\n async Write(source, data) {\r\n let path;\r\n if (source) {\r\n path = this.observableTree.GetPathOf(source);\r\n }\r\n else {\r\n path = this.idFunc(data);\r\n if (!path)\r\n throw new Error(\"data must have an id\");\r\n }\r\n let diff = await this.diffAsync.DiffPath(path, data);\r\n this.ApplyChanges(diff);\r\n }\r\n async Merge(source, data) {\r\n const rootPath = this.observableTree.GetPathOf(source);\r\n const keys = Object.keys(data);\r\n const message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\r\n const diff = await this.diffAsync.DiffBatch(message);\r\n this.ApplyChanges(diff);\r\n }\r\n async Push(source, data) {\r\n const rootPath = this.observableTree.GetPathOf(source);\r\n var lengthPath = `${rootPath}.length`;\r\n var length = await this.diffAsync.GetPath(lengthPath);\r\n var diff = await this.diffAsync.DiffPath(`${rootPath}.${length}`, data);\r\n this.ApplyChanges(diff);\r\n }\r\n async Splice(source, start, deleteCount, ...items) {\r\n var rootPath = this.observableTree.GetPathOf(source);\r\n var array = await this.diffAsync.GetPath(rootPath);\r\n array = array.slice();\r\n array.splice(start, deleteCount, ...items);\r\n var diff = await this.diffAsync.DiffPath(rootPath, array);\r\n this.ApplyChanges(diff);\r\n }\r\n ApplyChanges(diff) {\r\n this.observableTree.WriteAll(diff);\r\n }\r\n}\r\nexports.StoreAsyncWriter = StoreAsyncWriter;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreSync = void 0;\r\nconst diffSync_1 = require(\"../Diff/diffSync\");\r\nconst observableTree_1 = require(\"../Tree/observableTree\");\r\nconst storeSyncWriter_1 = require(\"./storeSyncWriter\");\r\nclass StoreSync {\r\n diffSync = new diffSync_1.DiffSync();\r\n observableTree = new observableTree_1.ObservableTree();\r\n storeWriter = new storeSyncWriter_1.StoreSyncWriter(this.diffSync, this.observableTree);\r\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\r\n get Root() {\r\n return this.rootScope;\r\n }\r\n constructor(init) {\r\n if (init)\r\n this.Write(init);\r\n }\r\n Action(action) {\r\n var proxy = this.observableTree.Get(\"ROOT\");\r\n action(proxy, this.storeWriter);\r\n }\r\n Write(data) {\r\n this.Action((root, writer) => writer.Write(root, data));\r\n }\r\n Merge(data) {\r\n this.Action((root, writer) => writer.Merge(root, data));\r\n }\r\n Destroy() {\r\n this.rootScope.Destroy();\r\n }\r\n}\r\nexports.StoreSync = StoreSync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreSyncWriter = void 0;\r\nclass StoreSyncWriter {\r\n diffSync;\r\n observableTree;\r\n constructor(diffSync, observableTree) {\r\n this.diffSync = diffSync;\r\n this.observableTree = observableTree;\r\n }\r\n Write(source, data) {\r\n var rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\r\n var diff = this.diffSync.DiffPath(rootPath, data);\r\n this.ApplyChanges(diff);\r\n }\r\n Merge(source, data) {\r\n var rootPath = this.observableTree.GetPathOf(source);\r\n var keys = Object.keys(data);\r\n var message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\r\n var diff = this.diffSync.DiffBatch(message);\r\n this.ApplyChanges(diff);\r\n }\r\n Push(source, data) {\r\n var rootPath = this.observableTree.GetPathOf(source);\r\n var length = source.length;\r\n this.diffSync.UpdatePath(`${rootPath}.${length}`, data);\r\n this.observableTree.Write(`${rootPath}.${length}`, data);\r\n }\r\n Splice(source, start, deleteCount, ...items) {\r\n var rootPath = this.observableTree.GetPathOf(source);\r\n var proxy = this.observableTree.Get(rootPath);\r\n const array = proxy.toJSON().slice();\r\n array.splice(start, deleteCount, ...items);\r\n this.diffSync.UpdatePath(rootPath, array);\r\n this.observableTree.Write(rootPath, array);\r\n }\r\n ApplyChanges(diff) {\r\n this.observableTree.WriteAll(diff);\r\n }\r\n}\r\nexports.StoreSyncWriter = StoreSyncWriter;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreWriter = void 0;\r\nclass StoreWriter {\r\n observableTree;\r\n constructor(observableTree) {\r\n this.observableTree = observableTree;\r\n }\r\n Write(source, data) {\r\n const rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\r\n this.observableTree.Write(rootPath, data);\r\n }\r\n Merge(source, data) {\r\n const rootPath = this.observableTree.GetPathOf(source);\r\n for (const key in data)\r\n this.observableTree.Write(`${rootPath}.${key}`, data[key]);\r\n }\r\n Push(source, data) {\r\n const rootPath = this.observableTree.GetPathOf(source);\r\n this.observableTree.Write(`${rootPath}.${length}`, data);\r\n }\r\n Splice(source, start, deleteCount, ...items) {\r\n const json = source.toJSON();\r\n const copy = json.slice();\r\n copy.splice(start, deleteCount, ...items);\r\n const rootPath = this.observableTree.GetPathOf(source);\r\n this.observableTree.Write(rootPath, copy);\r\n }\r\n}\r\nexports.StoreWriter = StoreWriter;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ObservableScope = exports.ObservableScopeWrapper = exports.ObservableScopeValue = void 0;\r\nconst emitter_1 = require(\"../../Utils/emitter\");\r\nclass ObservableScopeValue {\r\n scope;\r\n get Value() {\r\n return ObservableScope.Value(this.scope);\r\n }\r\n constructor(scope) {\r\n this.scope = scope;\r\n }\r\n}\r\nexports.ObservableScopeValue = ObservableScopeValue;\r\nclass ObservableScopeWrapper extends ObservableScopeValue {\r\n scopeEmitter;\r\n constructor(scope) {\r\n super(scope);\r\n if (scope.emitter) {\r\n this.scopeEmitter = emitter_1.Emitter.Create();\r\n emitter_1.Emitter.On(scope.emitter, () => emitter_1.Emitter.Emit(this.scopeEmitter, this));\r\n }\r\n }\r\n Scope(callback) {\r\n return new ObservableScope(() => callback(this.Value));\r\n }\r\n Watch(callback) {\r\n if (!this.scopeEmitter)\r\n return;\r\n emitter_1.Emitter.On(this.scopeEmitter, callback);\r\n callback(this);\r\n }\r\n Unwatch(callback) {\r\n if (!this.scopeEmitter)\r\n return;\r\n emitter_1.Emitter.Remove(this.scopeEmitter, callback);\r\n }\r\n Destroy() {\r\n DestroyScope(this.scope);\r\n this.scopeEmitter && this.scopeEmitter.clear();\r\n }\r\n}\r\nexports.ObservableScopeWrapper = ObservableScopeWrapper;\r\nclass ObservableScope extends ObservableScopeWrapper {\r\n constructor(getFunction) {\r\n super(ObservableScope.Create(getFunction));\r\n }\r\n}\r\nexports.ObservableScope = ObservableScope;\r\nvar currentSet = null;\r\nvar watching = false;\r\nfunction WatchAction(action) {\r\n var parentSet = currentSet;\r\n currentSet = null;\r\n var parentWatching = watching;\r\n watching = true;\r\n action();\r\n var lastSet = currentSet;\r\n currentSet = parentSet;\r\n watching = parentWatching;\r\n return lastSet;\r\n}\r\n(function (ObservableScope) {\r\n function Create(valueFunction) {\r\n if (typeof valueFunction !== 'function')\r\n return {\r\n value: valueFunction,\r\n dirty: false,\r\n destroyed: false\r\n };\r\n var scope = {\r\n getFunction: valueFunction,\r\n async: valueFunction[Symbol.toStringTag] === 'AsyncFunction',\r\n value: null,\r\n dirty: true,\r\n emitter: emitter_1.Emitter.Create(),\r\n emitters: null,\r\n destroyed: false,\r\n setCallback: function () {\r\n OnSet(scope);\r\n }\r\n };\r\n return scope;\r\n }\r\n ObservableScope.Create = Create;\r\n function Register(emitter) {\r\n if (!watching || !emitter)\r\n return;\r\n currentSet = currentSet || new Set();\r\n currentSet.add(emitter);\r\n }\r\n ObservableScope.Register = Register;\r\n function Value(scope) {\r\n if (!scope)\r\n return undefined;\r\n Register(scope.emitter);\r\n UpdateValue(scope);\r\n return scope.value;\r\n }\r\n ObservableScope.Value = Value;\r\n function Watch(scope, callback) {\r\n if (!scope || !scope.emitter)\r\n return;\r\n emitter_1.Emitter.On(scope.emitter, callback);\r\n }\r\n ObservableScope.Watch = Watch;\r\n function Unwatch(scope, callback) {\r\n if (!scope || !scope.emitter)\r\n return;\r\n emitter_1.Emitter.Remove(scope.emitter, callback);\r\n }\r\n ObservableScope.Unwatch = Unwatch;\r\n function Update(scope) {\r\n OnSet(scope);\r\n }\r\n ObservableScope.Update = Update;\r\n function Emit(scope) {\r\n emitter_1.Emitter.Emit(scope.emitter);\r\n }\r\n ObservableScope.Emit = Emit;\r\n function Destroy(scope) {\r\n DestroyScope(scope);\r\n }\r\n ObservableScope.Destroy = Destroy;\r\n})(ObservableScope = exports.ObservableScope || (exports.ObservableScope = {}));\r\nfunction OnSet(scope) {\r\n if (!scope || scope.dirty)\r\n return;\r\n scope.dirty = true;\r\n emitter_1.Emitter.Emit(scope.emitter, scope);\r\n}\r\nfunction UpdateValue(scope) {\r\n if (!scope.dirty)\r\n return;\r\n scope.dirty = false;\r\n var value = null;\r\n var emitters = scope.getFunction && WatchAction(() => value = scope.getFunction());\r\n if (scope.async)\r\n Promise.resolve(value).then(val => {\r\n scope.value = val;\r\n emitter_1.Emitter.Emit(scope.emitter, scope);\r\n });\r\n else\r\n scope.value = value;\r\n UpdateEmitters(scope, emitters);\r\n}\r\nfunction DestroyScope(scope) {\r\n if (!scope)\r\n return;\r\n scope.emitters && scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\r\n scope.emitters && scope.emitters.clear();\r\n scope.emitter && scope.emitter.clear();\r\n scope.destroyed = true;\r\n}\r\nfunction UpdateEmitters(scope, newEmitters) {\r\n if (newEmitters)\r\n newEmitters.forEach(e => {\r\n if (!scope.emitters || !scope.emitters.delete(e))\r\n emitter_1.Emitter.On(e, scope.setCallback);\r\n });\r\n if (scope.emitters)\r\n scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\r\n scope.emitters = newEmitters;\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ObservableTree = void 0;\r\nconst observableScope_1 = require(\"../Tree/observableScope\");\r\nvar Type;\r\n(function (Type) {\r\n Type[Type[\"Value\"] = 0] = \"Value\";\r\n Type[Type[\"Object\"] = 1] = \"Object\";\r\n Type[Type[\"Array\"] = 2] = \"Array\";\r\n})(Type || (Type = {}));\r\nconst jsonConstructor = {}.constructor;\r\nfunction TypeOf(value) {\r\n if (!value)\r\n return Type.Value;\r\n if (jsonConstructor === value.constructor)\r\n return Type.Object;\r\n if (Array.isArray(value))\r\n return Type.Array;\r\n return Type.Value;\r\n}\r\nclass ObservableTree {\r\n valuePathResolver;\r\n undefinedScope = observableScope_1.ObservableScope.Create(function () { return undefined; });\r\n scopeCache = new WeakMap();\r\n leafScopeCache = new WeakMap();\r\n proxyCache = new WeakMap();\r\n pathCache = new WeakMap();\r\n rootStateMap = new Map();\r\n constructor(valuePathResolver) {\r\n this.valuePathResolver = valuePathResolver;\r\n }\r\n Get(path) {\r\n const val = path.split(\".\").reduce((pre, curr, index) => {\r\n if (index === 0) {\r\n let value = this.rootStateMap.get(curr);\r\n const scope = this.GetParentScope(value);\r\n return observableScope_1.ObservableScope.Value(scope);\r\n }\r\n return pre && pre[curr];\r\n }, null);\r\n return val;\r\n }\r\n GetPathOf(value) {\r\n if (value.toJSON && typeof value.toJSON === 'function')\r\n value = value.toJSON();\r\n return this.pathCache.get(value);\r\n }\r\n Scope(path, callback) {\r\n return new observableScope_1.ObservableScope(() => {\r\n const obj = this.Get(path);\r\n return callback && callback(obj) || obj;\r\n });\r\n }\r\n Write(path, value) {\r\n const scope = this.WritePath(path, value);\r\n observableScope_1.ObservableScope.Update(scope);\r\n }\r\n WriteAll(data) {\r\n const scopeSet = new Set();\r\n for (var x = 0; x < data.length; x++) {\r\n const scope = this.WritePath(data[x].path, data[x].value);\r\n scopeSet.add(scope);\r\n }\r\n scopeSet.forEach(scope => observableScope_1.ObservableScope.Update(scope));\r\n }\r\n GetParentScope(value) {\r\n if (value === undefined)\r\n return this.undefinedScope;\r\n let scope = this.scopeCache.get(value);\r\n if (!scope) {\r\n scope = observableScope_1.ObservableScope.Create(() => this.GetValueProxy(value));\r\n this.scopeCache.set(value, scope);\r\n }\r\n return scope;\r\n }\r\n GetPropertyScope(parent, prop) {\r\n const value = parent[prop];\r\n const type = TypeOf(value);\r\n if (type === Type.Value) {\r\n let leafScopes = this.leafScopeCache.get(parent) || {};\r\n leafScopes[prop] = leafScopes[prop] || observableScope_1.ObservableScope.Create(() => {\r\n const parentScope = this.scopeCache.get(parent);\r\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\r\n const parentJson = parentValue.toJSON();\r\n const currentValue = parentJson[prop];\r\n let path;\r\n if (this.valuePathResolver && typeof currentValue === 'string' && (path = this.valuePathResolver(currentValue)))\r\n return this.Get(path);\r\n return currentValue;\r\n });\r\n this.leafScopeCache.set(parent, leafScopes);\r\n return leafScopes[prop];\r\n }\r\n else {\r\n let scope = this.scopeCache.get(value);\r\n if (!scope) {\r\n scope = observableScope_1.ObservableScope.Create(() => {\r\n const parentScope = this.scopeCache.get(parent);\r\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\r\n const parentJson = parentValue.toJSON();\r\n const currentValue = parentJson[prop];\r\n return this.GetValueProxy(currentValue);\r\n });\r\n this.scopeCache.set(value, scope);\r\n }\r\n return scope;\r\n }\r\n }\r\n GetValueProxy(value) {\r\n let proxy = this.proxyCache.get(value);\r\n if (!proxy) {\r\n proxy = this.CreateProxy(value);\r\n this.proxyCache.set(value, proxy);\r\n }\r\n return proxy;\r\n }\r\n ObjectProxyGetter = (value, prop) => {\r\n function toJSON() {\r\n return value;\r\n }\r\n ;\r\n switch (prop) {\r\n case \"toJSON\":\r\n return toJSON;\r\n default:\r\n if (typeof prop === 'symbol')\r\n return value[prop];\r\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\r\n }\r\n };\r\n CreateObjectProxy(value) {\r\n return new Proxy(value, {\r\n get: this.ObjectProxyGetter\r\n });\r\n }\r\n ArrayProxyGetter = (value, prop) => {\r\n function toJSON() {\r\n return value;\r\n }\r\n ;\r\n switch (prop) {\r\n case \"toJSON\":\r\n return toJSON;\r\n default:\r\n if (typeof prop === 'symbol')\r\n return value[prop];\r\n if (isNaN(parseInt(prop))) {\r\n const ret = value[prop];\r\n if (typeof ret === 'function') {\r\n const copy = value.map((val, index) => observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, index.toString())));\r\n return ret.bind(copy);\r\n }\r\n return ret;\r\n }\r\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\r\n }\r\n };\r\n CreateArrayProxy(value) {\r\n return new Proxy(value, {\r\n get: this.ArrayProxyGetter\r\n });\r\n }\r\n CreateProxy(value) {\r\n const type = TypeOf(value);\r\n switch (type) {\r\n case Type.Object:\r\n return this.CreateObjectProxy(value);\r\n case Type.Array:\r\n return this.CreateArrayProxy(value);\r\n default:\r\n return value;\r\n }\r\n }\r\n WritePath(path, value) {\r\n this.UpdatePathCache(path, value);\r\n const pathParts = path.split(\".\");\r\n if (pathParts.length === 1) {\r\n const currentValue = this.rootStateMap.get(pathParts[0]);\r\n this.rootStateMap.set(pathParts[0], value);\r\n return currentValue === undefined ? this.undefinedScope : this.scopeCache.get(currentValue);\r\n }\r\n let parentValue;\r\n let x = 0;\r\n for (; x < pathParts.length - 1 && (x === 0 || parentValue); x++) {\r\n if (x === 0)\r\n parentValue = this.rootStateMap.get(pathParts[x]);\r\n else\r\n parentValue = parentValue && parentValue[pathParts[x]];\r\n }\r\n if (!parentValue)\r\n throw new Error(\"Unable to write path: \" + path + \". Falsey value found at: \" + pathParts.slice(0, x).join(\".\"));\r\n const prop = pathParts[x];\r\n const exists = Object.hasOwn(parentValue, prop);\r\n const oldValue = parentValue[prop];\r\n const oldType = TypeOf(oldValue);\r\n parentValue[prop] = value;\r\n if (oldType !== Type.Value)\r\n return this.scopeCache.get(oldValue) ||\r\n this.scopeCache.get(parentValue);\r\n const leafScopes = exists && this.leafScopeCache.get(parentValue);\r\n return leafScopes && leafScopes[prop] || this.scopeCache.get(parentValue);\r\n }\r\n UpdatePathCache(path, value) {\r\n const type = TypeOf(value);\r\n if (type === Type.Value)\r\n return;\r\n this.pathCache.set(value, path);\r\n const keys = Object.keys(value);\r\n for (let x = 0; x < keys.length; x++)\r\n this.UpdatePathCache(`${path}.${keys[x]}`, value[keys[x]]);\r\n return value;\r\n }\r\n}\r\nexports.ObservableTree = ObservableTree;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ObservableScope = exports.StoreAsync = exports.StoreSync = exports.Store = void 0;\r\nvar store_1 = require(\"./Store/store\");\r\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return store_1.Store; } });\r\nvar storeSync_1 = require(\"./Store/storeSync\");\r\nObject.defineProperty(exports, \"StoreSync\", { enumerable: true, get: function () { return storeSync_1.StoreSync; } });\r\nvar storeAsync_1 = require(\"./Store/storeAsync\");\r\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return storeAsync_1.StoreAsync; } });\r\nvar observableScope_1 = require(\"./Tree/observableScope\");\r\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return observableScope_1.ObservableScope; } });\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Animation = exports.AnimationType = void 0;\r\nvar StepFunctions;\r\n(function (StepFunctions) {\r\n function* EaseIn(count) {\r\n var diff = 1 / count;\r\n for (var t = diff, x = 0; x < count; x++, t += diff)\r\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;\r\n }\r\n StepFunctions.EaseIn = EaseIn;\r\n function* Linear(count) {\r\n var diff = 1 / count;\r\n for (var t = diff, x = 0; x < count; x++, t += diff)\r\n yield t;\r\n }\r\n StepFunctions.Linear = Linear;\r\n})(StepFunctions || (StepFunctions = {}));\r\nvar AnimationType;\r\n(function (AnimationType) {\r\n AnimationType[AnimationType[\"Linear\"] = 0] = \"Linear\";\r\n AnimationType[AnimationType[\"EaseIn\"] = 1] = \"EaseIn\";\r\n})(AnimationType = exports.AnimationType || (exports.AnimationType = {}));\r\nclass Animation {\r\n type;\r\n frameCount;\r\n frameTimings;\r\n update;\r\n animationTimeouts;\r\n running;\r\n start;\r\n end;\r\n enabled;\r\n get Running() {\r\n return this.running;\r\n }\r\n get Start() {\r\n return this.start;\r\n }\r\n get End() {\r\n return this.end;\r\n }\r\n get Enabled() {\r\n return this.enabled;\r\n }\r\n constructor(type, duration, update) {\r\n this.running = false;\r\n this.start = null;\r\n this.end = null;\r\n this.enabled = true;\r\n this.type = type;\r\n this.frameCount = Math.ceil((duration / 1000) * 60);\r\n this.frameTimings = [];\r\n var frameTime = duration / this.frameCount;\r\n for (var x = 0; x < this.frameCount; x++)\r\n this.frameTimings[x] = (x + 1) * frameTime;\r\n this.update = update;\r\n this.animationTimeouts = [];\r\n }\r\n Animate(start, end) {\r\n if (!this.enabled)\r\n return;\r\n var diff = end - start;\r\n if (diff === 0)\r\n return;\r\n this.Cancel();\r\n this.running = true;\r\n this.start = start;\r\n this.end = end;\r\n return new Promise(resolve => {\r\n var stepFunc = StepFunctions[AnimationType[this.type]];\r\n var index = 0;\r\n for (var step of stepFunc(this.frameCount)) {\r\n var value = (step * diff) + start;\r\n this.SetTimeout(index, value, index === (this.frameCount - 1) ? resolve : null);\r\n index++;\r\n }\r\n }).then(() => {\r\n this.running = false;\r\n this.start = null;\r\n this.end = null;\r\n });\r\n }\r\n Disable() {\r\n this.Cancel();\r\n this.enabled = false;\r\n }\r\n Enable() {\r\n this.enabled = true;\r\n }\r\n Cancel() {\r\n for (var x = 0; x < this.animationTimeouts.length; x++)\r\n clearTimeout(this.animationTimeouts[x]);\r\n this.running = false;\r\n this.start = null;\r\n this.end = null;\r\n }\r\n Destroy() {\r\n this.Cancel();\r\n }\r\n SetTimeout(index, value, resolve) {\r\n this.animationTimeouts[index] = setTimeout(() => {\r\n this.update(value);\r\n resolve && resolve();\r\n }, this.frameTimings[index]);\r\n }\r\n}\r\nexports.Animation = Animation;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.AsyncQueue = void 0;\r\nconst list_1 = require(\"./list\");\r\nclass AsyncQueue {\r\n running = false;\r\n queue = list_1.List.Create();\r\n Next(callback) {\r\n const ret = new Promise((resolve, reject) => {\r\n list_1.List.Add(this.queue, async function () {\r\n try {\r\n const ret = await callback();\r\n resolve(ret);\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n });\r\n });\r\n this.Start();\r\n return ret;\r\n }\r\n Stop() {\r\n list_1.List.Clear(this.queue);\r\n }\r\n Start() {\r\n if (this.running)\r\n return;\r\n this.running = true;\r\n this.ExecuteQueue();\r\n }\r\n async ExecuteQueue() {\r\n const callback = list_1.List.Pop(this.queue);\r\n if (callback !== null) {\r\n await callback();\r\n this.ExecuteQueue();\r\n }\r\n else\r\n this.running = false;\r\n }\r\n}\r\nexports.AsyncQueue = AsyncQueue;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.PreReq = exports.PreReqTemplate = exports.Destroy = exports.Inject = exports.ComputedAsync = exports.Computed = exports.DestroyScope = exports.Scope = exports.StateAsync = exports.StateSync = exports.State = void 0;\r\nconst store_1 = require(\"../Store/Store/store\");\r\nconst Store_1 = require(\"../Store\");\r\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\r\nfunction State() {\r\n return StateDecorator;\r\n}\r\nexports.State = State;\r\nfunction StateDecorator(target, propertyKey) {\r\n const propKey = `StoreDecorator_${propertyKey}`;\r\n DestroyDecorator(target, propKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var store = map.get(propKey);\r\n return store ? store.Root.Value : null;\r\n },\r\n set: function (val) {\r\n var map = this.DecoratorMap;\r\n var store = map.get(propKey);\r\n if (!store)\r\n map.set(propKey, new store_1.Store(val));\r\n else\r\n store.Merge(val);\r\n }\r\n };\r\n}\r\nfunction StateSync() {\r\n return StateSyncDecorator;\r\n}\r\nexports.StateSync = StateSync;\r\nfunction StateSyncDecorator(target, propertyKey) {\r\n const propKey = `StoreSyncDecorator_${propertyKey}`;\r\n DestroyDecorator(target, propKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var store = map.get(propKey);\r\n return store ? store.Root.Value : null;\r\n },\r\n set: function (val) {\r\n var map = this.DecoratorMap;\r\n var store = map.get(propKey);\r\n if (!store)\r\n map.set(propKey, new Store_1.StoreSync(val));\r\n else\r\n store.Merge(val);\r\n }\r\n };\r\n}\r\nfunction StateAsync() {\r\n return StateAsyncDecorator;\r\n}\r\nexports.StateAsync = StateAsync;\r\nfunction StateAsyncDecorator(target, propertyKey) {\r\n const propKey = `StoreAsyncDecorator_${propertyKey}`;\r\n const scopeKey = `StoreAsyncDecorator_Scope_${propertyKey}`;\r\n DestroyDecorator(target, propKey);\r\n DestroyDecorator(target, scopeKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var scope = map.get(scopeKey);\r\n return scope ? scope.Value : null;\r\n },\r\n set: function (val) {\r\n var map = this.DecoratorMap;\r\n var store = map.get(propKey);\r\n if (!store) {\r\n store = new Store_1.StoreAsync((val) => val.___id, { ___id: \"ROOT\", data: val });\r\n map.set(propKey, store);\r\n map.set(scopeKey, store.Scope(\"ROOT\", val => val.data));\r\n }\r\n else\r\n store.Action(\"ROOT\", async (root, writer) => await writer.Merge(root.data, val));\r\n }\r\n };\r\n}\r\nfunction Scope() {\r\n return ScopeDecorator;\r\n}\r\nexports.Scope = Scope;\r\nfunction ScopeDecorator(target, propertyKey, descriptor) {\r\n if (!(descriptor && descriptor.get))\r\n throw \"Scope decorator requires a getter\";\r\n if (descriptor && descriptor.set)\r\n throw \"Scope decorator does not support setters\";\r\n const propKey = `ScopeDecorator_${propertyKey}`;\r\n DestroyDecorator(target, propKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var scope = map.get(propKey);\r\n if (!scope) {\r\n const getter = descriptor.get.bind(this);\r\n scope = new observableScope_1.ObservableScope(getter);\r\n map.set(propKey, scope);\r\n }\r\n return scope.Value;\r\n }\r\n };\r\n}\r\nfunction DestroyScope() {\r\n return DestroyScopeDecorator;\r\n}\r\nexports.DestroyScope = DestroyScope;\r\nfunction DestroyScopeDecorator(target, propertyKey, descriptor) {\r\n if (!(descriptor && descriptor.get))\r\n throw \"Destroy Scope decorator requires a getter\";\r\n if (descriptor && descriptor.set)\r\n throw \"Destroy Scope decorator does not support setters\";\r\n const propKey = `ScopeDecorator_${propertyKey}`;\r\n DestroyDecorator(target, propKey);\r\n const valKey = `ScopeDecorator_${propertyKey}_Value`;\r\n DestroyDecorator(target, valKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var scope = map.get(propKey);\r\n if (!scope) {\r\n const getter = descriptor.get.bind(this);\r\n scope = new observableScope_1.ObservableScope(getter);\r\n map.set(propKey, scope);\r\n scope.Watch(scope => {\r\n var lastValue = map.get(valKey);\r\n lastValue && lastValue.Destroy();\r\n map.set(valKey, scope.Value);\r\n });\r\n }\r\n return scope.Value;\r\n }\r\n };\r\n}\r\nfunction Computed() {\r\n return ComputedDecorator;\r\n}\r\nexports.Computed = Computed;\r\nfunction ComputedDecorator(target, propertyKey, descriptor) {\r\n if (!(descriptor && descriptor.get))\r\n throw \"Computed decorator requires a getter\";\r\n if (descriptor && descriptor.set)\r\n throw \"Computed decorator does not support setters\";\r\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\r\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\r\n DestroyDecorator(target, scopeKey);\r\n DestroyDecorator(target, storeKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var store = map.get(storeKey);\r\n if (!store) {\r\n const getter = descriptor.get.bind(this);\r\n const scope = new observableScope_1.ObservableScope(getter);\r\n store = new Store_1.StoreSync(scope.Value);\r\n scope.Watch(scope => {\r\n if (!this.Destroyed)\r\n store.Write(scope.Value);\r\n });\r\n map.set(scopeKey, scope);\r\n map.set(storeKey, store);\r\n }\r\n return store.Root.Value;\r\n }\r\n };\r\n}\r\nfunction ComputedAsync(idFunc) {\r\n return ComputedAsyncDecorator.bind(null, idFunc);\r\n}\r\nexports.ComputedAsync = ComputedAsync;\r\nfunction ComputedAsyncDecorator(idFunc, target, propertyKey, descriptor) {\r\n if (!(descriptor && descriptor.get))\r\n throw \"ComputedAsync decorator requires a getter\";\r\n if (descriptor && descriptor.set)\r\n throw \"ComputedAsync decorator does not support setters\";\r\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\r\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\r\n const storeScopeKey = `ComputedDecorator_StoreScope_${propertyKey}`;\r\n DestroyDecorator(target, scopeKey);\r\n DestroyDecorator(target, storeKey);\r\n DestroyDecorator(target, storeScopeKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var storeScope = map.get(storeScopeKey);\r\n if (!storeScope) {\r\n const getter = descriptor.get.bind(this);\r\n const scope = new observableScope_1.ObservableScope(() => {\r\n var value = getter();\r\n if (value && typeof value.toJSON === 'function')\r\n value = value.toJSON();\r\n return value;\r\n });\r\n const store = new Store_1.StoreAsync((val) => val._id, { _id: \"ROOT\", data: scope.Value });\r\n scope.Watch(scope => {\r\n if (!this.Destroyed)\r\n store.Write({ _id: \"ROOT\", data: scope.Value });\r\n });\r\n storeScope = store.Scope(\"ROOT\", (val) => val.data);\r\n map.set(storeScopeKey, storeScope);\r\n map.set(scopeKey, scope);\r\n map.set(storeKey, store);\r\n }\r\n return storeScope.Value;\r\n }\r\n };\r\n}\r\nfunction Inject(type) {\r\n return InjectorDecorator.bind(null, type);\r\n}\r\nexports.Inject = Inject;\r\nfunction InjectorDecorator(type, target, propertyKey, descriptor) {\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n return this.Injector.Get(type);\r\n },\r\n set: function (val) {\r\n this.Injector.Set(type, val);\r\n }\r\n };\r\n}\r\nfunction Destroy() {\r\n return DestroyDecorator;\r\n}\r\nexports.Destroy = Destroy;\r\n(function (Destroy) {\r\n function Get(value) {\r\n return value && value.DestroyDecorator_Destroys || [];\r\n }\r\n function All(value) {\r\n var arr = Get(value);\r\n arr.map(prop => (value[prop] || value.DecoratorMap.get(prop)))\r\n .filter(o => !!o)\r\n .forEach(o => o.Destroy());\r\n }\r\n Destroy.All = All;\r\n})(Destroy = exports.Destroy || (exports.Destroy = {}));\r\nfunction DestroyDecorator(target, propertyKey) {\r\n var proto = target;\r\n proto.DestroyDecorator_Destroys = proto.DestroyDecorator_Destroys || [];\r\n proto.DestroyDecorator_Destroys.push(propertyKey);\r\n}\r\nfunction PreReqTemplate(template) {\r\n return PreReqTemplateDecorator.bind(null, template);\r\n}\r\nexports.PreReqTemplate = PreReqTemplate;\r\n(function (PreReqTemplate) {\r\n function Get(value) {\r\n var func = value && value.PreReqTemplateDecorator_Template;\r\n var ret = func ? func() : [];\r\n if (!Array.isArray(ret))\r\n ret = [ret];\r\n return ret;\r\n }\r\n PreReqTemplate.Get = Get;\r\n})(PreReqTemplate = exports.PreReqTemplate || (exports.PreReqTemplate = {}));\r\nfunction PreReqTemplateDecorator(template, target) {\r\n var proto = target.prototype;\r\n proto.PreReqTemplateDecorator_Template = template;\r\n}\r\nfunction PreReq() {\r\n return PreReqDecorator;\r\n}\r\nexports.PreReq = PreReq;\r\n(function (PreReq) {\r\n function Get(value) {\r\n return value && value.PreReqDecorator_PreReqs || [];\r\n }\r\n function All(value) {\r\n var arr = Get(value).map((prop) => (value[prop] && value[prop].Init) || Promise.resolve());\r\n return Promise.all(arr);\r\n }\r\n PreReq.All = All;\r\n function Has(value) {\r\n return Get(value).length > 0;\r\n }\r\n PreReq.Has = Has;\r\n})(PreReq = exports.PreReq || (exports.PreReq = {}));\r\nfunction PreReqDecorator(target, propertyKey) {\r\n var proto = target;\r\n proto.PreReqDecorator_PreReqs = proto.PreReqDecorator_PreReqs || [];\r\n proto.PreReqDecorator_PreReqs.push(propertyKey);\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Emitter = void 0;\r\nvar Emitter;\r\n(function (Emitter) {\r\n function Create() {\r\n return new Set();\r\n }\r\n Emitter.Create = Create;\r\n function On(emitter, callback) {\r\n emitter.add(callback);\r\n }\r\n Emitter.On = On;\r\n function Emit(emitter, ...args) {\r\n emitter.forEach(function (cb) {\r\n cb(...args);\r\n });\r\n }\r\n Emitter.Emit = Emit;\r\n function Remove(emitter, callback) {\r\n emitter.delete(callback);\r\n }\r\n Emitter.Remove = Remove;\r\n})(Emitter = exports.Emitter || (exports.Emitter = {}));\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n__exportStar(require(\"./decorators\"), exports);\r\n__exportStar(require(\"./animation\"), exports);\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Injector = void 0;\r\nclass Injector {\r\n parent;\r\n typeMap;\r\n constructor() {\r\n this.parent = Injector.Current();\r\n this.typeMap = new Map();\r\n }\r\n Get(type) {\r\n if (this.typeMap.size === 0)\r\n return this.parent && this.parent.Get(type);\r\n var ret = this.typeMap.get(type);\r\n if (!ret)\r\n ret = this.parent && this.parent.Get(type);\r\n return ret;\r\n }\r\n Set(type, instance) {\r\n this.typeMap.set(type, instance);\r\n }\r\n}\r\nexports.Injector = Injector;\r\n(function (Injector) {\r\n var scope = null;\r\n function Current() {\r\n return scope;\r\n }\r\n Injector.Current = Current;\r\n function Scope(injector, action) {\r\n var parent = Current();\r\n scope = injector;\r\n action();\r\n scope = parent;\r\n }\r\n Injector.Scope = Scope;\r\n})(Injector = exports.Injector || (exports.Injector = {}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.List = void 0;\r\nvar List;\r\n(function (List) {\r\n function Create() {\r\n return {\r\n head: null,\r\n tail: null,\r\n size: 0\r\n };\r\n }\r\n List.Create = Create;\r\n function Clear(list) {\r\n list.head = null;\r\n list.tail = null;\r\n list.size = 0;\r\n }\r\n List.Clear = Clear;\r\n function Push(list, data) {\r\n var node = { previous: null, next: null, data: data };\r\n if (list.size === 0) {\r\n list.head = node;\r\n list.tail = node;\r\n list.size = 1;\r\n }\r\n else {\r\n node.next = list.head;\r\n list.head.previous = node;\r\n list.head = node;\r\n list.size++;\r\n }\r\n return node;\r\n }\r\n List.Push = Push;\r\n function Pop(list) {\r\n if (list.size === 0)\r\n return null;\r\n var node = list.head;\r\n list.head = node.next;\r\n if (list.head)\r\n list.head.previous = null;\r\n list.size--;\r\n if (list.size === 0)\r\n list.tail = null;\r\n return node.data;\r\n }\r\n List.Pop = Pop;\r\n function Add(list, data) {\r\n var node = { previous: null, next: null, data: data };\r\n if (list.size === 0) {\r\n list.head = node;\r\n list.tail = node;\r\n list.size = 1;\r\n }\r\n else {\r\n node.previous = list.tail;\r\n list.tail.next = node;\r\n list.tail = node;\r\n list.size++;\r\n }\r\n return node;\r\n }\r\n List.Add = Add;\r\n function AddBefore(list, node, data) {\r\n if (!node)\r\n return List.Add(list, data);\r\n var newNode = { previous: null, next: null, data: data };\r\n var prevNode = node.previous;\r\n newNode.next = node;\r\n node.previous = newNode;\r\n if (list.head === node)\r\n list.head = newNode;\r\n if (prevNode) {\r\n prevNode.next = newNode;\r\n newNode.previous = prevNode;\r\n }\r\n list.size++;\r\n return newNode;\r\n }\r\n List.AddBefore = AddBefore;\r\n function AddAfter(list, node, data) {\r\n if (!node)\r\n return List.Push(list, data);\r\n var newNode = { previous: null, next: null, data: data };\r\n var nextNode = node.next;\r\n node.next = newNode;\r\n newNode.previous = node;\r\n if (list.tail === node)\r\n list.tail = newNode;\r\n if (nextNode) {\r\n nextNode.previous = newNode;\r\n newNode.next = nextNode;\r\n }\r\n list.size++;\r\n return newNode;\r\n }\r\n List.AddAfter = AddAfter;\r\n function Remove(list) {\r\n if (list.size === 0)\r\n return null;\r\n var node = list.tail;\r\n list.tail = node.previous;\r\n if (list.tail)\r\n list.tail.next = null;\r\n list.size--;\r\n if (list.size === 0)\r\n list.head = null;\r\n return node.data;\r\n }\r\n List.Remove = Remove;\r\n function ForEach(list, callback) {\r\n var node = list.head;\r\n while (node) {\r\n callback(node.data);\r\n node = node.next;\r\n }\r\n }\r\n List.ForEach = ForEach;\r\n})(List = exports.List || (exports.List = {}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ThreadAsync = exports.Thread = exports.Synch = exports.Callback = exports.After = exports.Schedule = void 0;\r\nconst list_1 = require(\"./list\");\r\nconst workTimeMs = 16;\r\nconst contextQueue = list_1.List.Create();\r\nvar threadContext = null;\r\nvar timeoutRunning = false;\r\nfunction ProcessQueue() {\r\n var workStartTime = Date.now();\r\n var ctx;\r\n while ((Date.now() - workStartTime) < workTimeMs && (ctx = list_1.List.Pop(contextQueue)))\r\n DoWork(ctx, workStartTime);\r\n if (contextQueue.size > 0)\r\n setTimeout(ProcessQueue);\r\n else\r\n timeoutRunning = false;\r\n}\r\nfunction ScheduleWork(ctx) {\r\n list_1.List.Add(contextQueue, ctx);\r\n if (timeoutRunning)\r\n return;\r\n timeoutRunning = true;\r\n setTimeout(ProcessQueue);\r\n}\r\nfunction Invoke(ctx, callback) {\r\n var parent = ctx.workEndNode;\r\n ctx.workEndNode = ctx.workList.head;\r\n callback();\r\n ctx.workEndNode = parent;\r\n}\r\nfunction DoWork(ctx, workStartTime = Date.now()) {\r\n var parentContext = threadContext;\r\n threadContext = ctx;\r\n var async = ctx.async;\r\n var callback;\r\n while (async === ctx.async && (Date.now() - workStartTime) < workTimeMs && (callback = list_1.List.Pop(ctx.workList)))\r\n Invoke(ctx, callback);\r\n if (ctx.workList.size > 0)\r\n ScheduleWork(ctx);\r\n threadContext = parentContext;\r\n}\r\nfunction CreateContext() {\r\n return {\r\n async: false,\r\n workEndNode: null,\r\n workList: list_1.List.Create()\r\n };\r\n}\r\nfunction ScheduleCallback(callback, before, async) {\r\n threadContext = threadContext || CreateContext();\r\n threadContext.async = threadContext.async || async;\r\n if (before)\r\n list_1.List.AddBefore(threadContext.workList, threadContext.workEndNode, callback);\r\n else if (threadContext.workEndNode)\r\n list_1.List.AddAfter(threadContext.workList, threadContext.workEndNode, callback);\r\n else\r\n threadContext.workEndNode = list_1.List.Add(threadContext.workList, callback);\r\n}\r\nfunction SynchWithoutThread(callback) {\r\n var workStartTime = Date.now();\r\n callback();\r\n if (threadContext)\r\n if (threadContext.async)\r\n ScheduleWork(threadContext);\r\n else\r\n DoWork(threadContext, workStartTime);\r\n threadContext = null;\r\n}\r\nfunction Schedule(callback) {\r\n ScheduleCallback(callback, true, true);\r\n}\r\nexports.Schedule = Schedule;\r\nfunction After(callback) {\r\n ScheduleCallback(callback, false, false);\r\n}\r\nexports.After = After;\r\nfunction Callback(callback) {\r\n return function (a, b, c, d) {\r\n Schedule(function () { callback(a, b, c, d); });\r\n };\r\n}\r\nexports.Callback = Callback;\r\nvar inSynchCallback = false;\r\nfunction Synch(callback) {\r\n if (threadContext || inSynchCallback)\r\n callback();\r\n else {\r\n inSynchCallback = true;\r\n SynchWithoutThread(callback);\r\n inSynchCallback = false;\r\n }\r\n}\r\nexports.Synch = Synch;\r\nfunction Thread(callback) {\r\n if (threadContext)\r\n ScheduleCallback(callback, true, false);\r\n else\r\n Synch(callback);\r\n}\r\nexports.Thread = Thread;\r\nfunction ThreadAsync(callback) {\r\n return new Promise(resolve => Thread(function () {\r\n callback();\r\n Thread(resolve);\r\n }));\r\n}\r\nexports.ThreadAsync = ThreadAsync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Component = void 0;\r\nvar component_1 = require(\"./Node/component\");\r\nObject.defineProperty(exports, \"Component\", { enumerable: true, get: function () { return component_1.Component; } });\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreAsync = exports.Store = exports.ObservableScope = void 0;\r\n__exportStar(require(\"./index\"), exports);\r\n__exportStar(require(\"./Utils\"), exports);\r\nvar Store_1 = require(\"./Store\");\r\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return Store_1.ObservableScope; } });\r\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return Store_1.Store; } });\r\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return Store_1.StoreAsync; } });\r\n__exportStar(require(\"./DOM\"), exports);\r\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\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst Web = require(\"./web.export\");\r\nfor (var key in Web)\r\n window[key] = Web[key];\r\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;;;;;;;;;;;ACjFa;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,8EAA8E,sCAAsC;AACpH;AACA;AACA;AACA;AACA,CAAC,oCAAoC,iBAAiB,KAAK;AAC3D;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;;;;;;;;;;;AC7Fa;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,oCAAoC,iBAAiB,KAAK;;;;;;;;;;;AC/E9C;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,4CAA4C,qBAAqB,KAAK;AACvE;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,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,eAAe,mBAAO,CAAC,0CAAe;AACtC,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C,kBAAkB,mBAAO,CAAC,wCAAW;AACrC,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE;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,wCAAwC,mBAAmB,KAAK;AACjE;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,aAAa;AACb;AACA,KAAK;AACL;AACA;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,SAAS;AACT;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,oBAAoB,wBAAwB;AAC5C;AACA,4BAA4B,kBAAkB;AAC9C;AACA,SAAS;AACT;AACA,oBAAoB,iCAAiC;AACrD,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC7Ja;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,wCAAwC,mBAAmB,KAAK;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA,CAAC,gCAAgC,eAAe,KAAK;;;;;;;;;;;AC5JxC;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,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,KAAK,GAAG,QAAQ;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,KAAK;AAC7C;AACA,qBAAqB;AACrB,gCAAgC,qBAAqB;AACrD,gDAAgD,KAAK,GAAG,EAAE,OAAO,EAAE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,KAAK,GAAG,qBAAqB;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;;;;;;;;;;AC5NR;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,sCAAsC,kBAAkB,KAAK;;;;;;;;;;;AClBjD;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,OAAO;AACxD;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,CAAC,gDAAgD,uBAAuB,KAAK;AAC7E;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;;;;;;;;;;;ACnKa;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,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,wBAAwB,iBAAiB;AACzC,oCAAoC,KAAK,GAAG,QAAQ;AACpD;AACA;AACA;AACA,sBAAsB;;;;;;;;;;;ACrNT;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,4CAA4C,qBAAqB,KAAK;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA,aAAa;AACb;AACA,sCAAsC,YAAY;AAClD;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,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,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,gCAAgC,eAAe,KAAK;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C,sBAAsB,KAAK;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B,cAAc,KAAK;AAClD;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3Sa;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,gCAAgC,eAAe,KAAK;;;;;;;;;;;ACvBxC;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,kCAAkC,gBAAgB,KAAK;;;;;;;;;;;ACrC3C;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,qBAAqB;AACrB;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,CAAC,0BAA0B,YAAY,KAAK;;;;;;;;;;;ACvH/B;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\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DOMNodeConfig = void 0;\r\nconst window_1 = require(\"./window\");\r\nconst list_1 = require(\"../Utils/list\");\r\nconst utils_1 = require(\"./utils\");\r\nconst thread_1 = require(\"../Utils/thread\");\r\nvar pendingUpdates = list_1.List.Create();\r\nvar updateScheduled = false;\r\nfunction processUpdates() {\r\n list_1.List.Add(pendingUpdates, null);\r\n var callback;\r\n while ((callback = list_1.List.Pop(pendingUpdates)))\r\n (0, thread_1.Synch)(callback);\r\n if (pendingUpdates.size === 0)\r\n updateScheduled = false;\r\n else\r\n window_1.wndw.requestAnimationFrame(processUpdates);\r\n}\r\nexports.DOMNodeConfig = {\r\n createNode(type, namespace) {\r\n return type !== \"text\" ?\r\n namespace ?\r\n window_1.wndw.document.createElementNS(namespace, type) :\r\n window_1.wndw.document.createElement(type) :\r\n window_1.wndw.document.createTextNode(\"\");\r\n },\r\n scheduleUpdate(callback) {\r\n list_1.List.Add(pendingUpdates, callback);\r\n if (!updateScheduled) {\r\n updateScheduled = true;\r\n window_1.wndw.requestAnimationFrame(processUpdates);\r\n }\r\n },\r\n addListener(target, type, callback) {\r\n target.addEventListener(type, callback);\r\n },\r\n removeListener(target, type, callback) {\r\n target.removeEventListener(type, callback);\r\n },\r\n addChild(root, child) {\r\n root.appendChild(child);\r\n },\r\n addChildFirst(root, child) {\r\n exports.DOMNodeConfig.addChildBefore(root, root.firstChild, child);\r\n },\r\n addChildBefore(root, sibling, child) {\r\n if (!sibling) {\r\n exports.DOMNodeConfig.addChild(root, child);\r\n return;\r\n }\r\n if (child !== sibling)\r\n root.insertBefore(child, sibling);\r\n },\r\n addChildAfter(root, sibling, child) {\r\n if (!sibling) {\r\n exports.DOMNodeConfig.addChildFirst(root, child);\r\n return;\r\n }\r\n exports.DOMNodeConfig.addChildBefore(root, sibling.nextSibling, child);\r\n },\r\n removeChild(root, child) {\r\n root.removeChild(child);\r\n },\r\n remove(target) {\r\n target && target.parentNode && target.parentNode.removeChild(target);\r\n },\r\n setText(target, text) {\r\n target.textContent = text;\r\n },\r\n getAttribute(target, attribute) {\r\n return target.getAttribute(attribute);\r\n },\r\n setAttribute(target, attribute, value) {\r\n target.setAttribute(attribute, value);\r\n },\r\n fireEvent(target, event, data) {\r\n var cEvent = new CustomEvent(event, data);\r\n target.dispatchEvent(cEvent);\r\n },\r\n setProperties: utils_1.SetProperties\r\n};\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\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;\r\nconst elementNode_1 = require(\"../Node/elementNode\");\r\nfunction div(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"div\", null, nodeDef, children);\r\n}\r\nexports.div = div;\r\nfunction a(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"a\", null, nodeDef, children);\r\n}\r\nexports.a = a;\r\nfunction ul(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"ul\", null, nodeDef, children);\r\n}\r\nexports.ul = ul;\r\nfunction li(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"li\", null, nodeDef, children);\r\n}\r\nexports.li = li;\r\nfunction br(nodeDef) {\r\n return elementNode_1.ElementNode.Create(\"br\", null, nodeDef, null);\r\n}\r\nexports.br = br;\r\nfunction b(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"b\", null, nodeDef, children);\r\n}\r\nexports.b = b;\r\nfunction span(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"span\", null, nodeDef, children);\r\n}\r\nexports.span = span;\r\nfunction img(nodeDef) {\r\n return elementNode_1.ElementNode.Create(\"img\", null, nodeDef, null);\r\n}\r\nexports.img = img;\r\nfunction video(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"video\", null, nodeDef, children);\r\n}\r\nexports.video = video;\r\nfunction source(nodeDef) {\r\n return elementNode_1.ElementNode.Create(\"source\", null, nodeDef, null);\r\n}\r\nexports.source = source;\r\nfunction input(nodeDef) {\r\n return elementNode_1.ElementNode.Create(\"input\", null, nodeDef, null);\r\n}\r\nexports.input = input;\r\nfunction select(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"select\", null, nodeDef, children);\r\n}\r\nexports.select = select;\r\nfunction option(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"option\", null, nodeDef, children);\r\n}\r\nexports.option = option;\r\nfunction h1(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"h1\", null, nodeDef, children);\r\n}\r\nexports.h1 = h1;\r\nfunction h2(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"h2\", null, nodeDef, children);\r\n}\r\nexports.h2 = h2;\r\nfunction h3(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"h3\", null, nodeDef, children);\r\n}\r\nexports.h3 = h3;\r\nfunction p(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"p\", null, nodeDef, children);\r\n}\r\nexports.p = p;\r\nfunction style(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"style\", null, nodeDef, children);\r\n}\r\nexports.style = style;\r\nfunction button(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"button\", null, nodeDef, children);\r\n}\r\nexports.button = button;\r\nfunction table(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"table\", null, nodeDef, children);\r\n}\r\nexports.table = table;\r\nfunction th(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"th\", null, nodeDef, children);\r\n}\r\nexports.th = th;\r\nfunction tr(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"tr\", null, nodeDef, children);\r\n}\r\nexports.tr = tr;\r\nfunction td(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"td\", null, nodeDef, children);\r\n}\r\nexports.td = td;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n__exportStar(require(\"./elements\"), exports);\r\n__exportStar(require(\"./svgElements\"), exports);\r\n__exportStar(require(\"./utils\"), exports);\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.circle = exports.g = exports.svg = void 0;\r\nconst elementNode_1 = require(\"../Node/elementNode\");\r\nconst svgNs = \"http://www.w3.org/2000/svg\";\r\nfunction svg(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"svg\", svgNs, nodeDef, children);\r\n}\r\nexports.svg = svg;\r\nfunction g(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"g\", svgNs, nodeDef, children);\r\n}\r\nexports.g = g;\r\nfunction circle(nodeDef, children) {\r\n return elementNode_1.ElementNode.Create(\"circle\", svgNs, nodeDef, children);\r\n}\r\nexports.circle = circle;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SetProperties = void 0;\r\nfunction SetValue(target, value) {\r\n switch (target.nodeName) {\r\n case \"INPUT\":\r\n var start = target.selectionStart;\r\n var end = target.selectionEnd;\r\n target.value = value;\r\n if (target.ownerDocument.activeElement === target)\r\n target.setSelectionRange(start, end);\r\n break;\r\n default:\r\n target.value = value;\r\n }\r\n}\r\nfunction SetStyle(target, styleDef, lastStyleDef) {\r\n for (var key in styleDef)\r\n if (!lastStyleDef || lastStyleDef[key] !== styleDef[key])\r\n target.style[key] = styleDef[key];\r\n}\r\nfunction SetRootProperty(target, prop, value, lastValue) {\r\n switch (prop) {\r\n case \"value\":\r\n SetValue(target, value);\r\n break;\r\n case \"style\":\r\n SetStyle(target, value, lastValue);\r\n break;\r\n default:\r\n target[prop] = value;\r\n }\r\n}\r\nfunction SetChangedProperties(target, lastProperties, properties) {\r\n const keys = Object.keys(properties);\r\n for (let x = 0; x < keys.length; x++) {\r\n if (!lastProperties || lastProperties[keys[x]] !== properties[keys[x]])\r\n SetRootProperty(target, keys[x], properties[keys[x]], lastProperties && lastProperties[keys[x]]);\r\n }\r\n}\r\nfunction SetProperties(target, lastProperties, properties) {\r\n if (!lastProperties && target.nodeType === Node.TEXT_NODE)\r\n target.nodeValue = properties.nodeValue;\r\n else\r\n SetChangedProperties(target, lastProperties, properties);\r\n}\r\nexports.SetProperties = SetProperties;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.wndw = void 0;\r\nexports.wndw = typeof window !== \"undefined\" ? window : (new (require(\"jsdom\").JSDOM(\"\")).window);\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.BoundNode = void 0;\r\nconst nodeConfig_1 = require(\"./nodeConfig\");\r\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\r\nvar BoundNode;\r\n(function (BoundNode) {\r\n function Init(boundNode) {\r\n const nodeDef = boundNode.nodeDef;\r\n if (nodeDef.props) {\r\n const scope = observableScope_1.ObservableScope.Create(nodeDef.props);\r\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\r\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetProperties(boundNode, scope); });\r\n SetProperties(boundNode, observableScope_1.ObservableScope.Value(scope));\r\n }\r\n if (nodeDef.attrs) {\r\n const scope = observableScope_1.ObservableScope.Create(nodeDef.attrs);\r\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\r\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetAttributes(boundNode, scope); });\r\n SetAttributes(boundNode, observableScope_1.ObservableScope.Value(scope));\r\n }\r\n if (nodeDef.on) {\r\n const scope = observableScope_1.ObservableScope.Create(nodeDef.on);\r\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\r\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetEvents(boundNode, scope); });\r\n SetEvents(boundNode, observableScope_1.ObservableScope.Value(scope));\r\n }\r\n }\r\n BoundNode.Init = Init;\r\n})(BoundNode = exports.BoundNode || (exports.BoundNode = {}));\r\nfunction CreateScopeDestroyable(scope) {\r\n return {\r\n Destroy() {\r\n observableScope_1.ObservableScope.Destroy(scope);\r\n }\r\n };\r\n}\r\nfunction ScheduleSetProperties(node, scope) {\r\n if (node.setProperties)\r\n return;\r\n node.setProperties = true;\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n node.setProperties = false;\r\n if (node.destroyed)\r\n return;\r\n SetProperties(node, observableScope_1.ObservableScope.Value(scope));\r\n });\r\n}\r\nfunction SetProperties(node, properties) {\r\n if (!properties)\r\n return;\r\n nodeConfig_1.NodeConfig.setProperties(node.node, node.lastProperties, properties);\r\n node.lastProperties = properties;\r\n}\r\nfunction ScheduleSetAttributes(node, scope) {\r\n if (node.setAttributes)\r\n return;\r\n node.setAttributes = true;\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n node.setAttributes = false;\r\n if (node.destroyed)\r\n return;\r\n SetAttributes(node, observableScope_1.ObservableScope.Value(scope));\r\n });\r\n}\r\nfunction SetAttributes(node, attributes) {\r\n if (!attributes)\r\n return;\r\n for (var key in attributes) {\r\n var val = nodeConfig_1.NodeConfig.getAttribute(node.node, key);\r\n if (val !== attributes[key])\r\n nodeConfig_1.NodeConfig.setAttribute(node.node, key, attributes[key]);\r\n }\r\n}\r\nfunction ScheduleSetEvents(node, scope) {\r\n if (node.setEvents)\r\n return;\r\n node.setEvents = true;\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n node.setEvents = false;\r\n if (node.destroyed)\r\n return;\r\n SetEvents(node, observableScope_1.ObservableScope.Value(scope));\r\n });\r\n}\r\nfunction SetEvents(node, events) {\r\n if (!events)\r\n return;\r\n for (var key in node.lastEvents)\r\n nodeConfig_1.NodeConfig.removeListener(node.node, key, node.lastEvents[key]);\r\n for (var key in events)\r\n nodeConfig_1.NodeConfig.addListener(node.node, key, events[key]);\r\n node.lastEvents = events;\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Component = void 0;\r\nconst nodeRef_1 = require(\"./nodeRef\");\r\nconst componentNode_1 = require(\"./componentNode\");\r\nconst decorators_1 = require(\"../Utils/decorators\");\r\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\r\nclass Component {\r\n nodeRef;\r\n componentEvents;\r\n scope;\r\n templates;\r\n decoratorMap;\r\n get Injector() {\r\n return this.nodeRef.injector;\r\n }\r\n get Destroyed() {\r\n return this.nodeRef.destroyed;\r\n }\r\n get DecoratorMap() {\r\n return this.decoratorMap;\r\n }\r\n get Scope() {\r\n return this.scope;\r\n }\r\n get Data() {\r\n return this.scope.Value;\r\n }\r\n get NodeRef() {\r\n return this.nodeRef;\r\n }\r\n get Templates() {\r\n return this.templates;\r\n }\r\n constructor(data, templates, nodeRef, componentEvents) {\r\n this.nodeRef = nodeRef;\r\n this.componentEvents = componentEvents;\r\n this.scope = new observableScope_1.ObservableScope(data);\r\n this.templates = templates || {};\r\n this.decoratorMap = new Map();\r\n }\r\n Template() {\r\n return [];\r\n }\r\n Bound() {\r\n }\r\n Fire(event, data) {\r\n var eventCallback = this.componentEvents && this.componentEvents[event];\r\n eventCallback && eventCallback(data);\r\n }\r\n Destroy() {\r\n decorators_1.Destroy.All(this);\r\n }\r\n}\r\nexports.Component = Component;\r\n(function (Component) {\r\n function ToFunction(type, namespace, constructor) {\r\n return componentNode_1.ComponentNode.ToFunction(type, namespace, constructor);\r\n }\r\n Component.ToFunction = ToFunction;\r\n function Register(name, constructor) {\r\n const componentFunction = ToFunction(`${name}-component`, undefined, constructor);\r\n class WebComponent extends HTMLElement {\r\n constructor() {\r\n super();\r\n const shadowRoot = this.attachShadow({ mode: 'open' });\r\n const node = componentFunction({});\r\n Attach(shadowRoot, node);\r\n }\r\n }\r\n customElements.define(name, WebComponent);\r\n }\r\n Component.Register = Register;\r\n function Attach(node, nodeRef) {\r\n nodeRef_1.NodeRef.Init(nodeRef);\r\n var rootRef = nodeRef_1.NodeRef.Wrap(node);\r\n nodeRef_1.NodeRef.AddChild(rootRef, nodeRef);\r\n }\r\n Component.Attach = Attach;\r\n})(Component = exports.Component || (exports.Component = {}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ComponentNode = void 0;\r\nconst boundNode_1 = require(\"./boundNode\");\r\nconst nodeRef_1 = require(\"./nodeRef\");\r\nconst nodeConfig_1 = require(\"./nodeConfig\");\r\nconst component_1 = require(\"./component\");\r\nconst injector_1 = require(\"../Utils/injector\");\r\nconst decorators_1 = require(\"../Utils/decorators\");\r\nconst thread_1 = require(\"../Utils/thread\");\r\nvar ComponentNode;\r\n(function (ComponentNode) {\r\n function Fire(event, data) {\r\n var eventCallback = this.componentEvents && this.componentEvents[event];\r\n eventCallback && eventCallback(data);\r\n }\r\n ComponentNode.Fire = Fire;\r\n function ToFunction(type, namespace, constructor) {\r\n return function (nodeDef, templates) {\r\n return Create(type, namespace, nodeDef, constructor, templates);\r\n };\r\n }\r\n ComponentNode.ToFunction = ToFunction;\r\n function Init(componentNode) {\r\n var nodeDef = componentNode.nodeDef;\r\n var events = nodeDef.on;\r\n nodeDef.on = null;\r\n componentNode.component = new componentNode.constructor(nodeDef.data, componentNode.templates, componentNode, events);\r\n SetChildren(componentNode);\r\n componentNode.destroyables.push(componentNode.component);\r\n boundNode_1.BoundNode.Init(componentNode);\r\n }\r\n ComponentNode.Init = Init;\r\n})(ComponentNode = exports.ComponentNode || (exports.ComponentNode = {}));\r\nfunction Create(type, namespace, nodeDef, constructor, templates) {\r\n var compNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ComponentNode);\r\n compNode.nodeDef = nodeDef;\r\n compNode.constructor = constructor;\r\n compNode.templates = templates;\r\n return compNode;\r\n}\r\nfunction SetChildren(node) {\r\n if (decorators_1.PreReq.Has(node.component)) {\r\n AddPreReqTemplate(node).then(function () {\r\n AddTemplate(node, false);\r\n });\r\n }\r\n else\r\n AddTemplate(node, true);\r\n}\r\nfunction AddPreReqTemplate(node) {\r\n return new Promise(resolve => {\r\n (0, thread_1.Thread)(function () {\r\n const preNodes = injector_1.Injector.Scope(node.injector, decorators_1.PreReqTemplate.Get, node.component);\r\n (0, thread_1.Schedule)(function () {\r\n if (node.destroyed)\r\n return;\r\n nodeRef_1.NodeRef.InitAll(preNodes);\r\n });\r\n (0, thread_1.Thread)(function () {\r\n if (node.destroyed)\r\n return;\r\n for (var x = 0; x < preNodes.length; x++)\r\n nodeRef_1.NodeRef.AddChild(node, preNodes[x]);\r\n decorators_1.PreReq.All(node.component).then(function () {\r\n if (node.destroyed)\r\n return;\r\n for (var x = 0; x < preNodes.length; x++)\r\n nodeRef_1.NodeRef.Destroy(preNodes[x]);\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n if (node.destroyed)\r\n return;\r\n for (var x = 0; x < preNodes.length; x++)\r\n nodeRef_1.NodeRef.DetachChild(node, preNodes[x]);\r\n resolve();\r\n });\r\n });\r\n });\r\n });\r\n });\r\n}\r\nfunction InvokeNodeTemplate(node) {\r\n const nodes = node.component.Template();\r\n if (!Array.isArray(nodes))\r\n return [nodes];\r\n return nodes;\r\n}\r\nfunction AddTemplate(node, init) {\r\n (0, thread_1.Thread)(function () {\r\n if (node.destroyed)\r\n return;\r\n const nodes = injector_1.Injector.Scope(node.injector, InvokeNodeTemplate, node);\r\n (0, thread_1.Schedule)(function () {\r\n nodeRef_1.NodeRef.InitAll(nodes);\r\n });\r\n (0, thread_1.Thread)(function () {\r\n if (node.destroyed)\r\n return;\r\n if (init)\r\n for (var x = 0; x < nodes.length; x++)\r\n nodeRef_1.NodeRef.AddChild(node, nodes[x]);\r\n else\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n if (node.destroyed)\r\n return;\r\n for (var x = 0; x < nodes.length; x++)\r\n nodeRef_1.NodeRef.AddChild(node, nodes[x]);\r\n });\r\n });\r\n if (node.component.Bound !== component_1.Component.prototype.Bound)\r\n (0, thread_1.After)(function () {\r\n nodeConfig_1.NodeConfig.scheduleUpdate(() => setTimeout(() => node.component.Bound(), 0));\r\n });\r\n });\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ElementNode = void 0;\r\nconst boundNode_1 = require(\"./boundNode\");\r\nconst nodeConfig_1 = require(\"./nodeConfig\");\r\nconst injector_1 = require(\"../Utils/injector\");\r\nconst list_1 = require(\"../Utils/list\");\r\nconst thread_1 = require(\"../Utils/thread\");\r\nconst nodeRef_1 = require(\"./nodeRef\");\r\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\r\nvar ElementNode;\r\n(function (ElementNode) {\r\n function Create(type, namespace, nodeDef, children) {\r\n var elemNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ElementNode);\r\n elemNode.nodeDef = nodeDef;\r\n elemNode.childrenFunc = children;\r\n return elemNode;\r\n }\r\n ElementNode.Create = Create;\r\n function Init(elementNode) {\r\n if (elementNode.childrenFunc) {\r\n var nodeDef = elementNode.nodeDef;\r\n if (nodeDef.data) {\r\n const dataScope = observableScope_1.ObservableScope.Create(nodeDef.data);\r\n observableScope_1.ObservableScope.Watch(dataScope, function () {\r\n ScheduleSetData(elementNode, dataScope);\r\n });\r\n SetData(elementNode, GetValue(dataScope), true);\r\n elementNode.destroyables.push({\r\n Destroy: function () {\r\n observableScope_1.ObservableScope.Destroy(dataScope);\r\n }\r\n });\r\n }\r\n else\r\n SetDefaultData(elementNode);\r\n }\r\n boundNode_1.BoundNode.Init(elementNode);\r\n }\r\n ElementNode.Init = Init;\r\n})(ElementNode = exports.ElementNode || (exports.ElementNode = {}));\r\nconst valueDefault = [];\r\nfunction GetValue(dataScope) {\r\n var value = observableScope_1.ObservableScope.Value(dataScope);\r\n if (!value)\r\n return valueDefault;\r\n if (!Array.isArray(value))\r\n value = [value];\r\n return value;\r\n}\r\nfunction ScheduleSetData(node, scope) {\r\n if (node.setData)\r\n return;\r\n node.setData = true;\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n node.setData = false;\r\n if (node.destroyed)\r\n return;\r\n SetData(node, GetValue(scope));\r\n });\r\n}\r\nfunction SetDefaultData(node) {\r\n (0, thread_1.Synch)(function () {\r\n const nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, true);\r\n if (nodes.length > 0) {\r\n nodeRef_1.NodeRef.InitAll(nodes);\r\n (0, thread_1.Thread)(function () {\r\n if (node.destroyed)\r\n return;\r\n DetachAndAddNodes(node, [], [nodes]);\r\n });\r\n }\r\n });\r\n}\r\nfunction SetData(node, value, init = false) {\r\n (0, thread_1.Synch)(function () {\r\n var newNodesMap = new Map();\r\n var values = value || valueDefault;\r\n if (!Array.isArray(values))\r\n values = [values];\r\n var newNodesArrays = values.map(function (value) {\r\n var nodes;\r\n if (node.nodesMap) {\r\n var nodeArrayList = node.nodesMap.get(value);\r\n nodes = nodeArrayList && list_1.List.Remove(nodeArrayList);\r\n }\r\n var newNodeArrayList = newNodesMap.get(value);\r\n if (!newNodeArrayList) {\r\n newNodeArrayList = list_1.List.Create();\r\n newNodesMap.set(value, newNodeArrayList);\r\n }\r\n if (!nodes) {\r\n nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, value);\r\n (0, thread_1.Schedule)(function () {\r\n if (node.destroyed || newNodesMap.size === 0)\r\n return;\r\n nodeRef_1.NodeRef.InitAll(nodes);\r\n list_1.List.Push(newNodeArrayList, nodes);\r\n });\r\n }\r\n else\r\n list_1.List.Push(newNodeArrayList, nodes);\r\n return nodes;\r\n });\r\n var detachNodes = [];\r\n if (node.nodesMap) {\r\n for (var nodeArrayList of node.nodesMap.values())\r\n nodeArrayList.size > 0 && detachNodes.push(DestroyNodeArrayList(nodeArrayList));\r\n node.nodesMap.clear();\r\n }\r\n node.nodesMap = newNodesMap;\r\n (0, thread_1.Thread)(function () {\r\n if (node.destroyed)\r\n return;\r\n if (init)\r\n DetachAndAddNodes(node, detachNodes, newNodesMap.size > 0 && newNodesArrays);\r\n else\r\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\r\n if (node.destroyed)\r\n return;\r\n DetachAndAddNodes(node, detachNodes, newNodesMap.size > 0 && newNodesArrays);\r\n });\r\n });\r\n });\r\n}\r\nfunction DetachAndAddNodes(node, detachNodes, newNodes) {\r\n for (var x = 0; x < detachNodes.length; x++)\r\n list_1.List.ForEach(detachNodes[x], function (nodes) {\r\n for (var x = 0; x < nodes.length; x++)\r\n nodeRef_1.NodeRef.DetachChild(node, nodes[x]);\r\n });\r\n var previousNode = null;\r\n for (var x = 0; newNodes && x < newNodes.length; x++) {\r\n for (var y = 0; y < newNodes[x].length; y++) {\r\n nodeRef_1.NodeRef.AddChildAfter(node, previousNode, newNodes[x][y]);\r\n previousNode = newNodes[x][y];\r\n }\r\n }\r\n}\r\nfunction CreateNodeArray(childrenFunc, value) {\r\n var newNodes = childrenFunc(value);\r\n if (typeof newNodes === \"string\") {\r\n var textNode = nodeRef_1.NodeRef.Create(\"text\", null, nodeRef_1.NodeRefType.BoundNode);\r\n textNode.nodeDef = {\r\n props: function () {\r\n return { nodeValue: childrenFunc(value) };\r\n }\r\n };\r\n return [textNode];\r\n }\r\n if (Array.isArray(newNodes))\r\n return newNodes;\r\n return [newNodes];\r\n}\r\nfunction DestroyNodeArrayList(nodeArrayList) {\r\n list_1.List.ForEach(nodeArrayList, nodeRef_1.NodeRef.DestroyAll);\r\n return nodeArrayList;\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.NodeConfig = void 0;\r\nconst domNodeConfig_1 = require(\"../DOM/domNodeConfig\");\r\nexports.NodeConfig = domNodeConfig_1.DOMNodeConfig;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.NodeRef = exports.NodeRefType = void 0;\r\nconst nodeConfig_1 = require(\"./nodeConfig\");\r\nconst injector_1 = require(\"../Utils/injector\");\r\nconst boundNode_1 = require(\"./boundNode\");\r\nconst elementNode_1 = require(\"./elementNode\");\r\nconst componentNode_1 = require(\"./componentNode\");\r\nvar NodeRefType;\r\n(function (NodeRefType) {\r\n NodeRefType[NodeRefType[\"NodeRef\"] = 0] = \"NodeRef\";\r\n NodeRefType[NodeRefType[\"BoundNode\"] = 1] = \"BoundNode\";\r\n NodeRefType[NodeRefType[\"ElementNode\"] = 2] = \"ElementNode\";\r\n NodeRefType[NodeRefType[\"ComponentNode\"] = 3] = \"ComponentNode\";\r\n})(NodeRefType = exports.NodeRefType || (exports.NodeRefType = {}));\r\nvar NodeRef;\r\n(function (NodeRef) {\r\n function Wrap(node) {\r\n var nodeRef = Create(null, null, NodeRefType.NodeRef);\r\n nodeRef.node = node;\r\n nodeRef.childNodes = new Set();\r\n return nodeRef;\r\n }\r\n NodeRef.Wrap = Wrap;\r\n function Create(nodeType, namespace, type) {\r\n switch (type) {\r\n case NodeRefType.NodeRef:\r\n return {\r\n node: null,\r\n nodeType: nodeType,\r\n nodeNamespace: namespace,\r\n type: NodeRefType.NodeRef,\r\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\r\n parent: null,\r\n childNodes: null,\r\n destroyed: false,\r\n destroyables: []\r\n };\r\n case NodeRefType.BoundNode:\r\n return {\r\n node: null,\r\n nodeType: nodeType,\r\n nodeNamespace: namespace,\r\n type: NodeRefType.BoundNode,\r\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\r\n parent: null,\r\n childNodes: null,\r\n destroyed: false,\r\n destroyables: [],\r\n lastProperties: null,\r\n lastEvents: null,\r\n setProperties: false,\r\n setAttributes: false,\r\n setEvents: false\r\n };\r\n case NodeRefType.ElementNode:\r\n return {\r\n node: null,\r\n nodeType: nodeType,\r\n nodeNamespace: namespace,\r\n type: NodeRefType.ElementNode,\r\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\r\n parent: null,\r\n childNodes: null,\r\n destroyed: false,\r\n destroyables: [],\r\n lastProperties: null,\r\n lastEvents: null,\r\n setProperties: false,\r\n setAttributes: false,\r\n setEvents: false,\r\n childrenFunc: null,\r\n nodesMap: null,\r\n setData: false\r\n };\r\n case NodeRefType.ComponentNode:\r\n return {\r\n node: null,\r\n nodeType: nodeType,\r\n nodeNamespace: namespace,\r\n type: NodeRefType.ComponentNode,\r\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\r\n parent: null,\r\n childNodes: null,\r\n destroyed: false,\r\n destroyables: [],\r\n lastProperties: null,\r\n lastEvents: null,\r\n setProperties: false,\r\n setAttributes: false,\r\n setEvents: false,\r\n component: null,\r\n componentEvents: null\r\n };\r\n }\r\n }\r\n NodeRef.Create = Create;\r\n function Init(nodeRef) {\r\n if (nodeRef.node)\r\n return;\r\n nodeRef.node = nodeConfig_1.NodeConfig.createNode(nodeRef.nodeType, nodeRef.nodeNamespace);\r\n nodeRef.childNodes = new Set();\r\n switch (nodeRef.type) {\r\n case NodeRefType.BoundNode:\r\n boundNode_1.BoundNode.Init(nodeRef);\r\n break;\r\n case NodeRefType.ElementNode:\r\n elementNode_1.ElementNode.Init(nodeRef);\r\n break;\r\n case NodeRefType.ComponentNode:\r\n componentNode_1.ComponentNode.Init(nodeRef);\r\n break;\r\n }\r\n }\r\n NodeRef.Init = Init;\r\n function InitAll(nodeRefs) {\r\n for (var x = 0; x < nodeRefs.length; x++)\r\n Init(nodeRefs[x]);\r\n }\r\n NodeRef.InitAll = InitAll;\r\n function AddChild(node, child) {\r\n child.parent = node;\r\n node.childNodes.add(child);\r\n nodeConfig_1.NodeConfig.addChild(node.node, child.node);\r\n }\r\n NodeRef.AddChild = AddChild;\r\n function AddChildAfter(node, currentChild, newChild) {\r\n if (currentChild && !node.childNodes.has(currentChild))\r\n throw \"currentChild is not valid\";\r\n newChild.parent = node;\r\n node.childNodes.add(newChild);\r\n nodeConfig_1.NodeConfig.addChildAfter(node.node, currentChild && currentChild.node, newChild.node);\r\n }\r\n NodeRef.AddChildAfter = AddChildAfter;\r\n function DetachChild(node, child) {\r\n if (node.childNodes.has(child)) {\r\n node.childNodes.delete(child);\r\n nodeConfig_1.NodeConfig.removeChild(node.node, child.node);\r\n child.parent = null;\r\n }\r\n }\r\n NodeRef.DetachChild = DetachChild;\r\n function Destroy(node) {\r\n if (node.destroyed)\r\n return;\r\n node.destroyed = true;\r\n node.childNodes.forEach(Destroy);\r\n for (let x = 0; x < node.destroyables.length; x++)\r\n node.destroyables[x]?.Destroy();\r\n }\r\n NodeRef.Destroy = Destroy;\r\n function DestroyAll(nodes) {\r\n for (var x = 0; x < nodes.length; x++)\r\n Destroy(nodes[x]);\r\n }\r\n NodeRef.DestroyAll = DestroyAll;\r\n})(NodeRef = exports.NodeRef || (exports.NodeRef = {}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DiffAsync = void 0;\r\nconst diffTree_1 = require(\"./diffTree\");\r\nconst workerQueue_1 = require(\"./workerQueue\");\r\nconst diffWorker_1 = require(\"./diffWorker\");\r\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\r\nclass DiffAsync {\r\n workerQueue;\r\n constructor(keyFunc) {\r\n this.workerQueue = new workerQueue_1.WorkerQueue(diffWorker_1.DiffWorker.Create());\r\n this.workerQueue.Push({ method: \"create\", arguments: [keyFunc.toString()] });\r\n }\r\n static GetKeyRef(key) {\r\n return diffCnstr.GetKeyRef(key);\r\n }\r\n static ReadKeyRef(ref) {\r\n return diffCnstr.ReadKeyRef(ref);\r\n }\r\n async DiffPath(path, value) {\r\n return await this.workerQueue.Push({ method: \"diffpath\", arguments: [path, value] });\r\n }\r\n async DiffBatch(data) {\r\n return await this.workerQueue.Push({ method: \"diffbatch\", arguments: [data] });\r\n }\r\n async UpdatePath(path, value) {\r\n await this.workerQueue.Push({ method: \"updatepath\", arguments: [path, value] });\r\n }\r\n async GetPath(path) {\r\n return await this.workerQueue.Push({ method: \"getpath\", arguments: [path] });\r\n }\r\n Destroy() {\r\n this.workerQueue.Destroy();\r\n }\r\n}\r\nexports.DiffAsync = DiffAsync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DiffSync = void 0;\r\nconst diffTree_1 = require(\"./diffTree\");\r\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\r\nclass DiffSync {\r\n diffTree;\r\n constructor(keyFunc) {\r\n this.diffTree = new diffCnstr(keyFunc);\r\n }\r\n static GetKeyRef(key) {\r\n return diffCnstr.GetKeyRef(key);\r\n }\r\n static ReadKeyRef(ref) {\r\n return diffCnstr.ReadKeyRef(ref);\r\n }\r\n DiffPath(path, value) {\r\n return this.diffTree.DiffPath(path, value);\r\n }\r\n DiffBatch(data) {\r\n return this.diffTree.DiffBatch(data);\r\n }\r\n UpdatePath(path, value) {\r\n this.diffTree.UpdatePath(path, value);\r\n }\r\n}\r\nexports.DiffSync = DiffSync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DiffTreeScope = void 0;\r\nfunction DiffTreeScope(worker) {\r\n const ctx = this;\r\n if (ctx && worker) {\r\n let diffTree = null;\r\n ctx.onmessage = function (event) {\r\n var data = event.data;\r\n switch (data.method) {\r\n case \"create\":\r\n var keyFunc = data.arguments[0] ? eval(data.arguments[0]) : undefined;\r\n diffTree = new DiffTree(keyFunc);\r\n ctx.postMessage(null);\r\n break;\r\n case \"diffpath\":\r\n var diff = diffTree.DiffPath(data.arguments[0], data.arguments[1]);\r\n ctx.postMessage(diff);\r\n break;\r\n case \"diffbatch\":\r\n var diff = diffTree.DiffBatch(data.arguments[0]);\r\n ctx.postMessage(diff);\r\n break;\r\n case \"updatepath\":\r\n diffTree.UpdatePath(data.arguments[0], data.arguments[1]);\r\n ctx.postMessage(null);\r\n break;\r\n case \"getpath\":\r\n var ret = diffTree.GetPath(data.arguments[0]);\r\n ctx.postMessage(ret);\r\n break;\r\n }\r\n };\r\n }\r\n const jsonConstructor = {}.constructor;\r\n function IsValue(value) {\r\n if (!value)\r\n return true;\r\n return !(jsonConstructor === value.constructor || Array.isArray(value));\r\n }\r\n let Type;\r\n (function (Type) {\r\n Type[Type[\"Value\"] = 0] = \"Value\";\r\n Type[Type[\"Object\"] = 1] = \"Object\";\r\n Type[Type[\"Array\"] = 2] = \"Array\";\r\n })(Type || (Type = {}));\r\n function TypeOf(value) {\r\n if (!value)\r\n return Type.Value;\r\n if (jsonConstructor === value.constructor)\r\n return Type.Object;\r\n if (Array.isArray(value))\r\n return Type.Array;\r\n return Type.Value;\r\n }\r\n class DiffTree {\r\n keyFunc;\r\n rootStateMap = new Map();\r\n constructor(keyFunc) {\r\n this.keyFunc = keyFunc;\r\n }\r\n static GetKeyRef(key) {\r\n return `___DiffTreeKeyRef.${key}`;\r\n }\r\n static ReadKeyRef(ref) {\r\n if (!ref)\r\n return undefined;\r\n var matches = ref.match(/^___DiffTreeKeyRef\\.([^.]+$)/);\r\n if (!matches)\r\n return undefined;\r\n return matches[1];\r\n }\r\n DiffBatch(data) {\r\n var resp = [];\r\n ;\r\n for (var x = 0; x < data.length; x++)\r\n this.RunDiff(data[x].path, data[x].value, resp);\r\n return resp;\r\n }\r\n DiffPath(path, value) {\r\n var resp = [];\r\n this.RunDiff(path, value, resp);\r\n return resp;\r\n }\r\n UpdatePath(path, value) {\r\n this.SetPathValue(path, value);\r\n }\r\n GetPath(path) {\r\n return this.GetPathValue(path);\r\n }\r\n RunDiff(path, value, diffResp) {\r\n var breakupMap = this.GetBreakUpMap(path, value);\r\n var resp = diffResp || [];\r\n breakupMap.forEach((value, key) => {\r\n var currentValue = key.split(\".\").reduce((pre, curr, index) => {\r\n if (index === 0)\r\n return this.rootStateMap.get(curr);\r\n return pre && pre[curr];\r\n }, null);\r\n this.DiffJson(key, value, currentValue, resp);\r\n });\r\n for (var x = 0; x < resp.length; x++)\r\n this.SetPathValue(resp[x].path, resp[x].value);\r\n }\r\n GetPathValue(path) {\r\n var parts = path.split(\".\");\r\n var curr = this.rootStateMap.get(parts[0]);\r\n for (var x = 1; x < parts.length; x++)\r\n curr = curr && curr[parts[x]];\r\n return curr;\r\n }\r\n SetPathValue(path, value) {\r\n var parts = path.split(\".\");\r\n if (parts.length === 1)\r\n this.rootStateMap.set(parts[0], value);\r\n else {\r\n var curr = this.rootStateMap.get(parts[0]);\r\n for (var x = 1; x < parts.length - 1; x++)\r\n curr = curr[parts[x]];\r\n curr[parts[parts.length - 1]] = value;\r\n }\r\n }\r\n GetBreakUpMap(path, value) {\r\n if (!this.keyFunc)\r\n return new Map([[path, value]]);\r\n return this.BreakUpValue(path, value);\r\n }\r\n BreakUpValue(path, parent, prop, map) {\r\n var value = prop ? parent[prop] : parent;\r\n var isValue = IsValue(value);\r\n if (!map && isValue)\r\n return new Map([[path, value]]);\r\n map = map || new Map();\r\n if (isValue)\r\n return map;\r\n var key = this.keyFunc ? this.keyFunc(value) : null;\r\n var keyRef = key && DiffTree.GetKeyRef(key);\r\n if (key && key !== path) {\r\n if (prop)\r\n parent[prop] = keyRef;\r\n this.BreakUpValue(key, value, null, map);\r\n }\r\n else {\r\n for (var subProp in value) {\r\n var childPath = `${path}.${subProp}`;\r\n this.BreakUpValue(childPath, value, subProp, map);\r\n }\r\n }\r\n if (!prop)\r\n map.set(path, key === path ? value : keyRef || value);\r\n return map;\r\n }\r\n DiffJson(path, newValue, oldValue, resp) {\r\n const newType = TypeOf(newValue);\r\n const oldType = TypeOf(oldValue);\r\n if (newType !== oldType) {\r\n resp.push({\r\n path,\r\n value: newValue\r\n });\r\n return true;\r\n }\r\n if (newType === Type.Value || oldType === Type.Value) {\r\n if (newValue !== oldValue) {\r\n resp.push({\r\n path,\r\n value: newValue\r\n });\r\n return true;\r\n }\r\n return false;\r\n }\r\n const changedPathLength = resp.length;\r\n let allChildrenChanged = true;\r\n if (newType === Type.Array) {\r\n if (newValue.length !== oldValue.length)\r\n resp.push({\r\n path: path ? `${path}.length` : 'length',\r\n value: newValue.length\r\n });\r\n for (let y = 0; y < newValue.length; y++) {\r\n const arrayPath = path ? `${path}.${y}` : `${y}`;\r\n allChildrenChanged = this.DiffJson(arrayPath, newValue[y], oldValue[y], resp) && allChildrenChanged;\r\n }\r\n }\r\n else if (newType === Type.Object) {\r\n const newKeys = Object.keys(newValue).sort();\r\n const oldKeys = Object.keys(oldValue).sort();\r\n if (newKeys.length >= oldKeys.length) {\r\n let newKeyIndex = 0;\r\n let oldKeyIndex = 0;\r\n while (newKeyIndex < newKeys.length) {\r\n const childPath = path ? `${path}.${newKeys[newKeyIndex]}` : newKeys[newKeyIndex];\r\n if (oldKeyIndex < oldKeys.length && newKeys[newKeyIndex] === oldKeys[oldKeyIndex]) {\r\n allChildrenChanged = this.DiffJson(childPath, newValue[newKeys[newKeyIndex]], oldValue[oldKeys[oldKeyIndex]], resp) && allChildrenChanged;\r\n oldKeyIndex++;\r\n }\r\n else {\r\n resp.push({\r\n path: childPath,\r\n value: newValue[newKeys[newKeyIndex]]\r\n });\r\n }\r\n newKeyIndex++;\r\n }\r\n }\r\n }\r\n if (path && allChildrenChanged) {\r\n resp.splice(changedPathLength);\r\n resp.push({\r\n path,\r\n value: newValue\r\n });\r\n return true;\r\n }\r\n return false;\r\n }\r\n }\r\n return DiffTree;\r\n}\r\nexports.DiffTreeScope = DiffTreeScope;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DiffWorker = void 0;\r\nconst diffTree_1 = require(\"./diffTree\");\r\nvar DiffWorker;\r\n(function (DiffWorker) {\r\n var workerConstructor = null;\r\n var workerParameter = null;\r\n if (typeof Worker !== 'undefined') {\r\n workerConstructor = Worker;\r\n workerParameter = URL.createObjectURL(new Blob([`(${diffTree_1.DiffTreeScope}).call(this, true)`]));\r\n }\r\n function Create() {\r\n if (!workerConstructor)\r\n throw \"Worker is not available\";\r\n return new workerConstructor(workerParameter);\r\n }\r\n DiffWorker.Create = Create;\r\n})(DiffWorker = exports.DiffWorker || (exports.DiffWorker = {}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.WorkerQueue = void 0;\r\nconst list_1 = require(\"../../Utils/list\");\r\nclass WorkerQueue {\r\n callbacks;\r\n worker;\r\n constructor(worker) {\r\n this.worker = worker;\r\n this.callbacks = list_1.List.Create();\r\n this.worker.onerror = (err) => {\r\n var cb = list_1.List.Pop(this.callbacks);\r\n cb && cb(null, err);\r\n };\r\n this.worker.onmessage = (message) => {\r\n var cb = list_1.List.Pop(this.callbacks);\r\n cb && cb(message.data);\r\n };\r\n }\r\n Push(message) {\r\n return new Promise((resolve, reject) => {\r\n list_1.List.Add(this.callbacks, function (data, err) {\r\n if (err)\r\n reject(err);\r\n else\r\n resolve(data);\r\n });\r\n this.worker.postMessage(message);\r\n });\r\n }\r\n Destroy() {\r\n this.worker.terminate();\r\n }\r\n}\r\nexports.WorkerQueue = WorkerQueue;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Store = void 0;\r\nconst observableTree_1 = require(\"../Tree/observableTree\");\r\nconst storeWriter_1 = require(\"./storeWriter\");\r\nclass Store {\r\n observableTree = new observableTree_1.ObservableTree();\r\n storeWriter = new storeWriter_1.StoreWriter(this.observableTree);\r\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\r\n get Root() {\r\n return this.rootScope;\r\n }\r\n constructor(init) {\r\n if (init)\r\n this.Write(init);\r\n }\r\n Action(action) {\r\n var proxy = this.observableTree.Get(\"ROOT\");\r\n action(proxy, this.storeWriter);\r\n }\r\n Write(data) {\r\n this.Action((root, writer) => writer.Write(root, data));\r\n }\r\n Merge(data) {\r\n this.Action((root, writer) => writer.Merge(root, data));\r\n }\r\n Destroy() {\r\n this.rootScope.Destroy();\r\n }\r\n}\r\nexports.Store = Store;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreAsync = void 0;\r\nconst observableTree_1 = require(\"../Tree/observableTree\");\r\nconst diffAsync_1 = require(\"../Diff/diffAsync\");\r\nconst storeAsyncWriter_1 = require(\"./storeAsyncWriter\");\r\nconst asyncQueue_1 = require(\"../../Utils/asyncQueue\");\r\nclass StoreAsync {\r\n idFunc;\r\n diffAsync;\r\n observableTree;\r\n asyncWriter;\r\n asyncQueue;\r\n constructor(idFunc, init) {\r\n this.idFunc = idFunc;\r\n this.diffAsync = new diffAsync_1.DiffAsync(this.idFunc);\r\n this.observableTree = new observableTree_1.ObservableTree(diffAsync_1.DiffAsync.ReadKeyRef);\r\n this.asyncWriter = new storeAsyncWriter_1.StoreAsyncWriter(this.idFunc, this.diffAsync, this.observableTree);\r\n this.asyncQueue = new asyncQueue_1.AsyncQueue();\r\n if (init) {\r\n var id = this.idFunc(init);\r\n this.observableTree.Write(id, init);\r\n this.Write(init);\r\n }\r\n }\r\n Scope(id, func) {\r\n return this.observableTree.Scope(id, func);\r\n }\r\n async Action(id, action) {\r\n await this.asyncQueue.Next(async () => {\r\n await action(id && this.observableTree.Get(id), this.asyncWriter);\r\n });\r\n }\r\n async Write(data) {\r\n await this.Action(null, async (val, writer) => {\r\n await writer.Write(val, data);\r\n });\r\n }\r\n async Merge(id, data) {\r\n await this.Action(id, async (val, writer) => {\r\n await writer.Merge(val, data);\r\n });\r\n }\r\n Destroy() {\r\n this.asyncQueue.Stop();\r\n this.diffAsync.Destroy();\r\n }\r\n}\r\nexports.StoreAsync = StoreAsync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreAsyncWriter = void 0;\r\nclass StoreAsyncWriter {\r\n idFunc;\r\n diffAsync;\r\n observableTree;\r\n constructor(idFunc, diffAsync, observableTree) {\r\n this.idFunc = idFunc;\r\n this.diffAsync = diffAsync;\r\n this.observableTree = observableTree;\r\n }\r\n async Write(source, data) {\r\n let path;\r\n if (source) {\r\n path = this.observableTree.GetPathOf(source);\r\n }\r\n else {\r\n path = this.idFunc(data);\r\n if (!path)\r\n throw new Error(\"data must have an id\");\r\n }\r\n let diff = await this.diffAsync.DiffPath(path, data);\r\n this.ApplyChanges(diff);\r\n }\r\n async Merge(source, data) {\r\n const rootPath = this.observableTree.GetPathOf(source);\r\n const keys = Object.keys(data);\r\n const message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\r\n const diff = await this.diffAsync.DiffBatch(message);\r\n this.ApplyChanges(diff);\r\n }\r\n async Push(source, data) {\r\n const rootPath = this.observableTree.GetPathOf(source);\r\n var lengthPath = `${rootPath}.length`;\r\n var length = await this.diffAsync.GetPath(lengthPath);\r\n var diff = await this.diffAsync.DiffPath(`${rootPath}.${length}`, data);\r\n this.ApplyChanges(diff);\r\n }\r\n async Splice(source, start, deleteCount, ...items) {\r\n var rootPath = this.observableTree.GetPathOf(source);\r\n var array = await this.diffAsync.GetPath(rootPath);\r\n array = array.slice();\r\n array.splice(start, deleteCount, ...items);\r\n var diff = await this.diffAsync.DiffPath(rootPath, array);\r\n this.ApplyChanges(diff);\r\n }\r\n ApplyChanges(diff) {\r\n this.observableTree.WriteAll(diff);\r\n }\r\n}\r\nexports.StoreAsyncWriter = StoreAsyncWriter;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreSync = void 0;\r\nconst diffSync_1 = require(\"../Diff/diffSync\");\r\nconst observableTree_1 = require(\"../Tree/observableTree\");\r\nconst storeSyncWriter_1 = require(\"./storeSyncWriter\");\r\nclass StoreSync {\r\n diffSync = new diffSync_1.DiffSync();\r\n observableTree = new observableTree_1.ObservableTree();\r\n storeWriter = new storeSyncWriter_1.StoreSyncWriter(this.diffSync, this.observableTree);\r\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\r\n get Root() {\r\n return this.rootScope;\r\n }\r\n constructor(init) {\r\n if (init)\r\n this.Write(init);\r\n }\r\n Action(action) {\r\n var proxy = this.observableTree.Get(\"ROOT\");\r\n action(proxy, this.storeWriter);\r\n }\r\n Write(data) {\r\n this.Action((root, writer) => writer.Write(root, data));\r\n }\r\n Merge(data) {\r\n this.Action((root, writer) => writer.Merge(root, data));\r\n }\r\n Destroy() {\r\n this.rootScope.Destroy();\r\n }\r\n}\r\nexports.StoreSync = StoreSync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreSyncWriter = void 0;\r\nclass StoreSyncWriter {\r\n diffSync;\r\n observableTree;\r\n constructor(diffSync, observableTree) {\r\n this.diffSync = diffSync;\r\n this.observableTree = observableTree;\r\n }\r\n Write(source, data) {\r\n var rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\r\n var diff = this.diffSync.DiffPath(rootPath, data);\r\n this.ApplyChanges(diff);\r\n }\r\n Merge(source, data) {\r\n var rootPath = this.observableTree.GetPathOf(source);\r\n var keys = Object.keys(data);\r\n var message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\r\n var diff = this.diffSync.DiffBatch(message);\r\n this.ApplyChanges(diff);\r\n }\r\n Push(source, data) {\r\n var rootPath = this.observableTree.GetPathOf(source);\r\n var length = source.length;\r\n this.diffSync.UpdatePath(`${rootPath}.${length}`, data);\r\n this.observableTree.Write(`${rootPath}.${length}`, data);\r\n }\r\n Splice(source, start, deleteCount, ...items) {\r\n var rootPath = this.observableTree.GetPathOf(source);\r\n var proxy = this.observableTree.Get(rootPath);\r\n const array = proxy.toJSON().slice();\r\n array.splice(start, deleteCount, ...items);\r\n this.diffSync.UpdatePath(rootPath, array);\r\n this.observableTree.Write(rootPath, array);\r\n }\r\n ApplyChanges(diff) {\r\n this.observableTree.WriteAll(diff);\r\n }\r\n}\r\nexports.StoreSyncWriter = StoreSyncWriter;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreWriter = void 0;\r\nclass StoreWriter {\r\n observableTree;\r\n constructor(observableTree) {\r\n this.observableTree = observableTree;\r\n }\r\n Write(source, data) {\r\n const rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\r\n this.observableTree.Write(rootPath, data);\r\n }\r\n Merge(source, data) {\r\n const rootPath = this.observableTree.GetPathOf(source);\r\n for (const key in data)\r\n this.observableTree.Write(`${rootPath}.${key}`, data[key]);\r\n }\r\n Push(source, data) {\r\n const rootPath = this.observableTree.GetPathOf(source);\r\n this.observableTree.Write(`${rootPath}.${length}`, data);\r\n }\r\n Splice(source, start, deleteCount, ...items) {\r\n const json = source.toJSON();\r\n const copy = json.slice();\r\n copy.splice(start, deleteCount, ...items);\r\n const rootPath = this.observableTree.GetPathOf(source);\r\n this.observableTree.Write(rootPath, copy);\r\n }\r\n}\r\nexports.StoreWriter = StoreWriter;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ObservableScope = exports.ObservableScopeWrapper = exports.ObservableScopeValue = void 0;\r\nconst emitter_1 = require(\"../../Utils/emitter\");\r\nclass ObservableScopeValue {\r\n scope;\r\n get Value() {\r\n return ObservableScope.Value(this.scope);\r\n }\r\n constructor(scope) {\r\n this.scope = scope;\r\n }\r\n}\r\nexports.ObservableScopeValue = ObservableScopeValue;\r\nclass ObservableScopeWrapper extends ObservableScopeValue {\r\n scopeEmitter;\r\n constructor(scope) {\r\n super(scope);\r\n if (scope.emitter) {\r\n this.scopeEmitter = emitter_1.Emitter.Create();\r\n emitter_1.Emitter.On(scope.emitter, () => emitter_1.Emitter.Emit(this.scopeEmitter, this));\r\n }\r\n }\r\n Scope(callback) {\r\n return new ObservableScope(() => callback(this.Value));\r\n }\r\n Watch(callback) {\r\n if (!this.scopeEmitter)\r\n return;\r\n emitter_1.Emitter.On(this.scopeEmitter, callback);\r\n callback(this);\r\n }\r\n Unwatch(callback) {\r\n if (!this.scopeEmitter)\r\n return;\r\n emitter_1.Emitter.Remove(this.scopeEmitter, callback);\r\n }\r\n Destroy() {\r\n DestroyScope(this.scope);\r\n this.scopeEmitter && this.scopeEmitter.clear();\r\n }\r\n}\r\nexports.ObservableScopeWrapper = ObservableScopeWrapper;\r\nclass ObservableScope extends ObservableScopeWrapper {\r\n constructor(getFunction) {\r\n super(ObservableScope.Create(getFunction));\r\n }\r\n}\r\nexports.ObservableScope = ObservableScope;\r\nvar currentSet = null;\r\nvar watching = false;\r\nfunction WatchAction(action) {\r\n var parentSet = currentSet;\r\n currentSet = null;\r\n var parentWatching = watching;\r\n watching = true;\r\n action();\r\n var lastSet = currentSet;\r\n currentSet = parentSet;\r\n watching = parentWatching;\r\n return lastSet;\r\n}\r\n(function (ObservableScope) {\r\n function Create(valueFunction) {\r\n if (typeof valueFunction !== 'function')\r\n return {\r\n value: valueFunction,\r\n dirty: false,\r\n destroyed: false\r\n };\r\n var scope = {\r\n getFunction: valueFunction,\r\n async: valueFunction[Symbol.toStringTag] === 'AsyncFunction',\r\n value: null,\r\n dirty: true,\r\n emitter: emitter_1.Emitter.Create(),\r\n emitters: null,\r\n destroyed: false,\r\n setCallback: function () {\r\n OnSet(scope);\r\n }\r\n };\r\n return scope;\r\n }\r\n ObservableScope.Create = Create;\r\n function Register(emitter) {\r\n if (!watching || !emitter)\r\n return;\r\n currentSet = currentSet || new Set();\r\n currentSet.add(emitter);\r\n }\r\n ObservableScope.Register = Register;\r\n function Value(scope) {\r\n if (!scope)\r\n return undefined;\r\n Register(scope.emitter);\r\n UpdateValue(scope);\r\n return scope.value;\r\n }\r\n ObservableScope.Value = Value;\r\n function Watch(scope, callback) {\r\n if (!scope || !scope.emitter)\r\n return;\r\n emitter_1.Emitter.On(scope.emitter, callback);\r\n }\r\n ObservableScope.Watch = Watch;\r\n function Unwatch(scope, callback) {\r\n if (!scope || !scope.emitter)\r\n return;\r\n emitter_1.Emitter.Remove(scope.emitter, callback);\r\n }\r\n ObservableScope.Unwatch = Unwatch;\r\n function Update(scope) {\r\n OnSet(scope);\r\n }\r\n ObservableScope.Update = Update;\r\n function Emit(scope) {\r\n emitter_1.Emitter.Emit(scope.emitter);\r\n }\r\n ObservableScope.Emit = Emit;\r\n function Destroy(scope) {\r\n DestroyScope(scope);\r\n }\r\n ObservableScope.Destroy = Destroy;\r\n})(ObservableScope = exports.ObservableScope || (exports.ObservableScope = {}));\r\nfunction OnSet(scope) {\r\n if (!scope || scope.dirty)\r\n return;\r\n scope.dirty = true;\r\n emitter_1.Emitter.Emit(scope.emitter, scope);\r\n}\r\nfunction UpdateValue(scope) {\r\n if (!scope.dirty)\r\n return;\r\n scope.dirty = false;\r\n var value = null;\r\n var emitters = scope.getFunction && WatchAction(() => value = scope.getFunction());\r\n if (scope.async)\r\n Promise.resolve(value).then(val => {\r\n scope.value = val;\r\n emitter_1.Emitter.Emit(scope.emitter, scope);\r\n });\r\n else\r\n scope.value = value;\r\n UpdateEmitters(scope, emitters);\r\n}\r\nfunction DestroyScope(scope) {\r\n if (!scope)\r\n return;\r\n scope.emitters && scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\r\n scope.emitters && scope.emitters.clear();\r\n scope.emitter && scope.emitter.clear();\r\n scope.destroyed = true;\r\n}\r\nfunction UpdateEmitters(scope, newEmitters) {\r\n if (newEmitters)\r\n newEmitters.forEach(e => {\r\n if (!scope.emitters || !scope.emitters.delete(e))\r\n emitter_1.Emitter.On(e, scope.setCallback);\r\n });\r\n if (scope.emitters)\r\n scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\r\n scope.emitters = newEmitters;\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ObservableTree = void 0;\r\nconst observableScope_1 = require(\"../Tree/observableScope\");\r\nvar Type;\r\n(function (Type) {\r\n Type[Type[\"Value\"] = 0] = \"Value\";\r\n Type[Type[\"Object\"] = 1] = \"Object\";\r\n Type[Type[\"Array\"] = 2] = \"Array\";\r\n})(Type || (Type = {}));\r\nconst jsonConstructor = {}.constructor;\r\nfunction TypeOf(value) {\r\n if (!value)\r\n return Type.Value;\r\n if (jsonConstructor === value.constructor)\r\n return Type.Object;\r\n if (Array.isArray(value))\r\n return Type.Array;\r\n return Type.Value;\r\n}\r\nclass ObservableTree {\r\n valuePathResolver;\r\n undefinedScope = observableScope_1.ObservableScope.Create(function () { return undefined; });\r\n scopeCache = new WeakMap();\r\n leafScopeCache = new WeakMap();\r\n proxyCache = new WeakMap();\r\n pathCache = new WeakMap();\r\n rootStateMap = new Map();\r\n constructor(valuePathResolver) {\r\n this.valuePathResolver = valuePathResolver;\r\n }\r\n Get(path) {\r\n const val = path.split(\".\").reduce((pre, curr, index) => {\r\n if (index === 0) {\r\n let value = this.rootStateMap.get(curr);\r\n const scope = this.GetParentScope(value);\r\n return observableScope_1.ObservableScope.Value(scope);\r\n }\r\n return pre && pre[curr];\r\n }, null);\r\n return val;\r\n }\r\n GetPathOf(value) {\r\n if (value.toJSON && typeof value.toJSON === 'function')\r\n value = value.toJSON();\r\n return this.pathCache.get(value);\r\n }\r\n Scope(path, callback) {\r\n return new observableScope_1.ObservableScope(() => {\r\n const obj = this.Get(path);\r\n return callback && callback(obj) || obj;\r\n });\r\n }\r\n Write(path, value) {\r\n const scope = this.WritePath(path, value);\r\n observableScope_1.ObservableScope.Update(scope);\r\n }\r\n WriteAll(data) {\r\n const scopeSet = new Set();\r\n for (var x = 0; x < data.length; x++) {\r\n const scope = this.WritePath(data[x].path, data[x].value);\r\n scopeSet.add(scope);\r\n }\r\n scopeSet.forEach(scope => observableScope_1.ObservableScope.Update(scope));\r\n }\r\n GetParentScope(value) {\r\n if (value === undefined)\r\n return this.undefinedScope;\r\n let scope = this.scopeCache.get(value);\r\n if (!scope) {\r\n scope = observableScope_1.ObservableScope.Create(() => this.GetValueProxy(value));\r\n this.scopeCache.set(value, scope);\r\n }\r\n return scope;\r\n }\r\n GetPropertyScope(parent, prop) {\r\n const value = parent[prop];\r\n const type = TypeOf(value);\r\n if (type === Type.Value) {\r\n let leafScopes = this.leafScopeCache.get(parent) || {};\r\n leafScopes[prop] = leafScopes[prop] || observableScope_1.ObservableScope.Create(() => {\r\n const parentScope = this.scopeCache.get(parent);\r\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\r\n const parentJson = parentValue.toJSON();\r\n const currentValue = parentJson[prop];\r\n let path;\r\n if (this.valuePathResolver && typeof currentValue === 'string' && (path = this.valuePathResolver(currentValue)))\r\n return this.Get(path);\r\n return currentValue;\r\n });\r\n this.leafScopeCache.set(parent, leafScopes);\r\n return leafScopes[prop];\r\n }\r\n else {\r\n let scope = this.scopeCache.get(value);\r\n if (!scope) {\r\n scope = observableScope_1.ObservableScope.Create(() => {\r\n const parentScope = this.scopeCache.get(parent);\r\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\r\n const parentJson = parentValue.toJSON();\r\n const currentValue = parentJson[prop];\r\n return this.GetValueProxy(currentValue);\r\n });\r\n this.scopeCache.set(value, scope);\r\n }\r\n return scope;\r\n }\r\n }\r\n GetValueProxy(value) {\r\n let proxy = this.proxyCache.get(value);\r\n if (!proxy) {\r\n proxy = this.CreateProxy(value);\r\n this.proxyCache.set(value, proxy);\r\n }\r\n return proxy;\r\n }\r\n ObjectProxyGetter = (value, prop) => {\r\n function toJSON() {\r\n return value;\r\n }\r\n ;\r\n switch (prop) {\r\n case \"toJSON\":\r\n return toJSON;\r\n default:\r\n if (typeof prop === 'symbol')\r\n return value[prop];\r\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\r\n }\r\n };\r\n CreateObjectProxy(value) {\r\n return new Proxy(value, {\r\n get: this.ObjectProxyGetter\r\n });\r\n }\r\n ArrayProxyGetter = (value, prop) => {\r\n function toJSON() {\r\n return value;\r\n }\r\n ;\r\n switch (prop) {\r\n case \"toJSON\":\r\n return toJSON;\r\n default:\r\n if (typeof prop === 'symbol')\r\n return value[prop];\r\n if (isNaN(parseInt(prop))) {\r\n const ret = value[prop];\r\n if (typeof ret === 'function') {\r\n const copy = value.map((val, index) => observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, index.toString())));\r\n return ret.bind(copy);\r\n }\r\n return ret;\r\n }\r\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\r\n }\r\n };\r\n CreateArrayProxy(value) {\r\n return new Proxy(value, {\r\n get: this.ArrayProxyGetter\r\n });\r\n }\r\n CreateProxy(value) {\r\n const type = TypeOf(value);\r\n switch (type) {\r\n case Type.Object:\r\n return this.CreateObjectProxy(value);\r\n case Type.Array:\r\n return this.CreateArrayProxy(value);\r\n default:\r\n return value;\r\n }\r\n }\r\n WritePath(path, value) {\r\n this.UpdatePathCache(path, value);\r\n const pathParts = path.split(\".\");\r\n if (pathParts.length === 1) {\r\n const currentValue = this.rootStateMap.get(pathParts[0]);\r\n this.rootStateMap.set(pathParts[0], value);\r\n return currentValue === undefined ? this.undefinedScope : this.scopeCache.get(currentValue);\r\n }\r\n let parentValue;\r\n let x = 0;\r\n for (; x < pathParts.length - 1 && (x === 0 || parentValue); x++) {\r\n if (x === 0)\r\n parentValue = this.rootStateMap.get(pathParts[x]);\r\n else\r\n parentValue = parentValue && parentValue[pathParts[x]];\r\n }\r\n if (!parentValue)\r\n throw new Error(\"Unable to write path: \" + path + \". Falsey value found at: \" + pathParts.slice(0, x).join(\".\"));\r\n const prop = pathParts[x];\r\n const exists = Object.hasOwn(parentValue, prop);\r\n const oldValue = parentValue[prop];\r\n const oldType = TypeOf(oldValue);\r\n parentValue[prop] = value;\r\n if (oldType !== Type.Value)\r\n return this.scopeCache.get(oldValue) ||\r\n this.scopeCache.get(parentValue);\r\n const leafScopes = exists && this.leafScopeCache.get(parentValue);\r\n return leafScopes && leafScopes[prop] || this.scopeCache.get(parentValue);\r\n }\r\n UpdatePathCache(path, value) {\r\n const type = TypeOf(value);\r\n if (type === Type.Value)\r\n return;\r\n this.pathCache.set(value, path);\r\n const keys = Object.keys(value);\r\n for (let x = 0; x < keys.length; x++)\r\n this.UpdatePathCache(`${path}.${keys[x]}`, value[keys[x]]);\r\n return value;\r\n }\r\n}\r\nexports.ObservableTree = ObservableTree;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ObservableScope = exports.StoreAsync = exports.StoreSync = exports.Store = void 0;\r\nvar store_1 = require(\"./Store/store\");\r\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return store_1.Store; } });\r\nvar storeSync_1 = require(\"./Store/storeSync\");\r\nObject.defineProperty(exports, \"StoreSync\", { enumerable: true, get: function () { return storeSync_1.StoreSync; } });\r\nvar storeAsync_1 = require(\"./Store/storeAsync\");\r\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return storeAsync_1.StoreAsync; } });\r\nvar observableScope_1 = require(\"./Tree/observableScope\");\r\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return observableScope_1.ObservableScope; } });\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Animation = exports.AnimationType = void 0;\r\nvar StepFunctions;\r\n(function (StepFunctions) {\r\n function* EaseIn(count) {\r\n var diff = 1 / count;\r\n for (var t = diff, x = 0; x < count; x++, t += diff)\r\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;\r\n }\r\n StepFunctions.EaseIn = EaseIn;\r\n function* Linear(count) {\r\n var diff = 1 / count;\r\n for (var t = diff, x = 0; x < count; x++, t += diff)\r\n yield t;\r\n }\r\n StepFunctions.Linear = Linear;\r\n})(StepFunctions || (StepFunctions = {}));\r\nvar AnimationType;\r\n(function (AnimationType) {\r\n AnimationType[AnimationType[\"Linear\"] = 0] = \"Linear\";\r\n AnimationType[AnimationType[\"EaseIn\"] = 1] = \"EaseIn\";\r\n})(AnimationType = exports.AnimationType || (exports.AnimationType = {}));\r\nclass Animation {\r\n type;\r\n frameCount;\r\n frameTimings;\r\n update;\r\n animationTimeouts;\r\n running;\r\n start;\r\n end;\r\n enabled;\r\n get Running() {\r\n return this.running;\r\n }\r\n get Start() {\r\n return this.start;\r\n }\r\n get End() {\r\n return this.end;\r\n }\r\n get Enabled() {\r\n return this.enabled;\r\n }\r\n constructor(type, duration, update) {\r\n this.running = false;\r\n this.start = null;\r\n this.end = null;\r\n this.enabled = true;\r\n this.type = type;\r\n this.frameCount = Math.ceil((duration / 1000) * 60);\r\n this.frameTimings = [];\r\n var frameTime = duration / this.frameCount;\r\n for (var x = 0; x < this.frameCount; x++)\r\n this.frameTimings[x] = (x + 1) * frameTime;\r\n this.update = update;\r\n this.animationTimeouts = [];\r\n }\r\n Animate(start, end) {\r\n if (!this.enabled)\r\n return;\r\n var diff = end - start;\r\n if (diff === 0)\r\n return;\r\n this.Cancel();\r\n this.running = true;\r\n this.start = start;\r\n this.end = end;\r\n return new Promise(resolve => {\r\n var stepFunc = StepFunctions[AnimationType[this.type]];\r\n var index = 0;\r\n for (var step of stepFunc(this.frameCount)) {\r\n var value = (step * diff) + start;\r\n this.SetTimeout(index, value, index === (this.frameCount - 1) ? resolve : null);\r\n index++;\r\n }\r\n }).then(() => {\r\n this.running = false;\r\n this.start = null;\r\n this.end = null;\r\n });\r\n }\r\n Disable() {\r\n this.Cancel();\r\n this.enabled = false;\r\n }\r\n Enable() {\r\n this.enabled = true;\r\n }\r\n Cancel() {\r\n for (var x = 0; x < this.animationTimeouts.length; x++)\r\n clearTimeout(this.animationTimeouts[x]);\r\n this.running = false;\r\n this.start = null;\r\n this.end = null;\r\n }\r\n Destroy() {\r\n this.Cancel();\r\n }\r\n SetTimeout(index, value, resolve) {\r\n this.animationTimeouts[index] = setTimeout(() => {\r\n this.update(value);\r\n resolve && resolve();\r\n }, this.frameTimings[index]);\r\n }\r\n}\r\nexports.Animation = Animation;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.AsyncQueue = void 0;\r\nconst list_1 = require(\"./list\");\r\nclass AsyncQueue {\r\n running = false;\r\n queue = list_1.List.Create();\r\n Next(callback) {\r\n const ret = new Promise((resolve, reject) => {\r\n list_1.List.Add(this.queue, async function () {\r\n try {\r\n const ret = await callback();\r\n resolve(ret);\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n });\r\n });\r\n this.Start();\r\n return ret;\r\n }\r\n Stop() {\r\n list_1.List.Clear(this.queue);\r\n }\r\n Start() {\r\n if (this.running)\r\n return;\r\n this.running = true;\r\n this.ExecuteQueue();\r\n }\r\n async ExecuteQueue() {\r\n const callback = list_1.List.Pop(this.queue);\r\n if (callback !== null) {\r\n await callback();\r\n this.ExecuteQueue();\r\n }\r\n else\r\n this.running = false;\r\n }\r\n}\r\nexports.AsyncQueue = AsyncQueue;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.PreReq = exports.PreReqTemplate = exports.Destroy = exports.Inject = exports.ComputedAsync = exports.Computed = exports.DestroyScope = exports.Scope = exports.StateAsync = exports.StateSync = exports.State = void 0;\r\nconst store_1 = require(\"../Store/Store/store\");\r\nconst Store_1 = require(\"../Store\");\r\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\r\nfunction State() {\r\n return StateDecorator;\r\n}\r\nexports.State = State;\r\nfunction StateDecorator(target, propertyKey) {\r\n const propKey = `StoreDecorator_${propertyKey}`;\r\n DestroyDecorator(target, propKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var store = map.get(propKey);\r\n return store ? store.Root.Value : null;\r\n },\r\n set: function (val) {\r\n var map = this.DecoratorMap;\r\n var store = map.get(propKey);\r\n if (!store)\r\n map.set(propKey, new store_1.Store(val));\r\n else\r\n store.Merge(val);\r\n }\r\n };\r\n}\r\nfunction StateSync() {\r\n return StateSyncDecorator;\r\n}\r\nexports.StateSync = StateSync;\r\nfunction StateSyncDecorator(target, propertyKey) {\r\n const propKey = `StoreSyncDecorator_${propertyKey}`;\r\n DestroyDecorator(target, propKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var store = map.get(propKey);\r\n return store ? store.Root.Value : null;\r\n },\r\n set: function (val) {\r\n var map = this.DecoratorMap;\r\n var store = map.get(propKey);\r\n if (!store)\r\n map.set(propKey, new Store_1.StoreSync(val));\r\n else\r\n store.Merge(val);\r\n }\r\n };\r\n}\r\nfunction StateAsync() {\r\n return StateAsyncDecorator;\r\n}\r\nexports.StateAsync = StateAsync;\r\nfunction StateAsyncDecorator(target, propertyKey) {\r\n const propKey = `StoreAsyncDecorator_${propertyKey}`;\r\n const scopeKey = `StoreAsyncDecorator_Scope_${propertyKey}`;\r\n DestroyDecorator(target, propKey);\r\n DestroyDecorator(target, scopeKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var scope = map.get(scopeKey);\r\n return scope ? scope.Value : null;\r\n },\r\n set: function (val) {\r\n var map = this.DecoratorMap;\r\n var store = map.get(propKey);\r\n if (!store) {\r\n store = new Store_1.StoreAsync((val) => val.___id, { ___id: \"ROOT\", data: val });\r\n map.set(propKey, store);\r\n map.set(scopeKey, store.Scope(\"ROOT\", val => val.data));\r\n }\r\n else\r\n store.Action(\"ROOT\", async (root, writer) => await writer.Merge(root.data, val));\r\n }\r\n };\r\n}\r\nfunction Scope() {\r\n return ScopeDecorator;\r\n}\r\nexports.Scope = Scope;\r\nfunction ScopeDecorator(target, propertyKey, descriptor) {\r\n if (!(descriptor && descriptor.get))\r\n throw \"Scope decorator requires a getter\";\r\n if (descriptor && descriptor.set)\r\n throw \"Scope decorator does not support setters\";\r\n const propKey = `ScopeDecorator_${propertyKey}`;\r\n DestroyDecorator(target, propKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var scope = map.get(propKey);\r\n if (!scope) {\r\n const getter = descriptor.get.bind(this);\r\n scope = new observableScope_1.ObservableScope(getter);\r\n map.set(propKey, scope);\r\n }\r\n return scope.Value;\r\n }\r\n };\r\n}\r\nfunction DestroyScope() {\r\n return DestroyScopeDecorator;\r\n}\r\nexports.DestroyScope = DestroyScope;\r\nfunction DestroyScopeDecorator(target, propertyKey, descriptor) {\r\n if (!(descriptor && descriptor.get))\r\n throw \"Destroy Scope decorator requires a getter\";\r\n if (descriptor && descriptor.set)\r\n throw \"Destroy Scope decorator does not support setters\";\r\n const propKey = `ScopeDecorator_${propertyKey}`;\r\n DestroyDecorator(target, propKey);\r\n const valKey = `ScopeDecorator_${propertyKey}_Value`;\r\n DestroyDecorator(target, valKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var scope = map.get(propKey);\r\n if (!scope) {\r\n const getter = descriptor.get.bind(this);\r\n scope = new observableScope_1.ObservableScope(getter);\r\n map.set(propKey, scope);\r\n scope.Watch(scope => {\r\n var lastValue = map.get(valKey);\r\n lastValue && lastValue.Destroy();\r\n map.set(valKey, scope.Value);\r\n });\r\n }\r\n return scope.Value;\r\n }\r\n };\r\n}\r\nfunction Computed() {\r\n return ComputedDecorator;\r\n}\r\nexports.Computed = Computed;\r\nfunction ComputedDecorator(target, propertyKey, descriptor) {\r\n if (!(descriptor && descriptor.get))\r\n throw \"Computed decorator requires a getter\";\r\n if (descriptor && descriptor.set)\r\n throw \"Computed decorator does not support setters\";\r\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\r\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\r\n DestroyDecorator(target, scopeKey);\r\n DestroyDecorator(target, storeKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var store = map.get(storeKey);\r\n if (!store) {\r\n const getter = descriptor.get.bind(this);\r\n const scope = new observableScope_1.ObservableScope(getter);\r\n store = new Store_1.StoreSync(scope.Value);\r\n scope.Watch(scope => {\r\n if (!this.Destroyed)\r\n store.Write(scope.Value);\r\n });\r\n map.set(scopeKey, scope);\r\n map.set(storeKey, store);\r\n }\r\n return store.Root.Value;\r\n }\r\n };\r\n}\r\nfunction ComputedAsync(idFunc) {\r\n return ComputedAsyncDecorator.bind(null, idFunc);\r\n}\r\nexports.ComputedAsync = ComputedAsync;\r\nfunction ComputedAsyncDecorator(idFunc, target, propertyKey, descriptor) {\r\n if (!(descriptor && descriptor.get))\r\n throw \"ComputedAsync decorator requires a getter\";\r\n if (descriptor && descriptor.set)\r\n throw \"ComputedAsync decorator does not support setters\";\r\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\r\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\r\n const storeScopeKey = `ComputedDecorator_StoreScope_${propertyKey}`;\r\n DestroyDecorator(target, scopeKey);\r\n DestroyDecorator(target, storeKey);\r\n DestroyDecorator(target, storeScopeKey);\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n var map = this.DecoratorMap;\r\n var storeScope = map.get(storeScopeKey);\r\n if (!storeScope) {\r\n const getter = descriptor.get.bind(this);\r\n const scope = new observableScope_1.ObservableScope(() => {\r\n var value = getter();\r\n if (value && typeof value.toJSON === 'function')\r\n value = value.toJSON();\r\n return value;\r\n });\r\n const store = new Store_1.StoreAsync((val) => val._id, { _id: \"ROOT\", data: scope.Value });\r\n scope.Watch(scope => {\r\n if (!this.Destroyed)\r\n store.Write({ _id: \"ROOT\", data: scope.Value });\r\n });\r\n storeScope = store.Scope(\"ROOT\", (val) => val.data);\r\n map.set(storeScopeKey, storeScope);\r\n map.set(scopeKey, scope);\r\n map.set(storeKey, store);\r\n }\r\n return storeScope.Value;\r\n }\r\n };\r\n}\r\nfunction Inject(type) {\r\n return InjectorDecorator.bind(null, type);\r\n}\r\nexports.Inject = Inject;\r\nfunction InjectorDecorator(type, target, propertyKey, descriptor) {\r\n return {\r\n configurable: false,\r\n enumerable: true,\r\n get: function () {\r\n return this.Injector.Get(type);\r\n },\r\n set: function (val) {\r\n this.Injector.Set(type, val);\r\n }\r\n };\r\n}\r\nfunction Destroy() {\r\n return DestroyDecorator;\r\n}\r\nexports.Destroy = Destroy;\r\n(function (Destroy) {\r\n function Get(value) {\r\n return value && value.DestroyDecorator_Destroys || [];\r\n }\r\n function All(value) {\r\n var arr = Get(value);\r\n arr.map(prop => (value[prop] || value.DecoratorMap.get(prop)))\r\n .filter(o => !!o)\r\n .forEach(o => o.Destroy());\r\n }\r\n Destroy.All = All;\r\n})(Destroy = exports.Destroy || (exports.Destroy = {}));\r\nfunction DestroyDecorator(target, propertyKey) {\r\n var proto = target;\r\n proto.DestroyDecorator_Destroys = proto.DestroyDecorator_Destroys || [];\r\n proto.DestroyDecorator_Destroys.push(propertyKey);\r\n}\r\nfunction PreReqTemplate(template) {\r\n return PreReqTemplateDecorator.bind(null, template);\r\n}\r\nexports.PreReqTemplate = PreReqTemplate;\r\n(function (PreReqTemplate) {\r\n function Get(value) {\r\n var func = value && value.PreReqTemplateDecorator_Template;\r\n var ret = func ? func() : [];\r\n if (!Array.isArray(ret))\r\n ret = [ret];\r\n return ret;\r\n }\r\n PreReqTemplate.Get = Get;\r\n})(PreReqTemplate = exports.PreReqTemplate || (exports.PreReqTemplate = {}));\r\nfunction PreReqTemplateDecorator(template, target) {\r\n var proto = target.prototype;\r\n proto.PreReqTemplateDecorator_Template = template;\r\n}\r\nfunction PreReq() {\r\n return PreReqDecorator;\r\n}\r\nexports.PreReq = PreReq;\r\n(function (PreReq) {\r\n function Get(value) {\r\n return value && value.PreReqDecorator_PreReqs || [];\r\n }\r\n function All(value) {\r\n var arr = Get(value).map((prop) => (value[prop] && value[prop].Init) || Promise.resolve());\r\n return Promise.all(arr);\r\n }\r\n PreReq.All = All;\r\n function Has(value) {\r\n return Get(value).length > 0;\r\n }\r\n PreReq.Has = Has;\r\n})(PreReq = exports.PreReq || (exports.PreReq = {}));\r\nfunction PreReqDecorator(target, propertyKey) {\r\n var proto = target;\r\n proto.PreReqDecorator_PreReqs = proto.PreReqDecorator_PreReqs || [];\r\n proto.PreReqDecorator_PreReqs.push(propertyKey);\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Emitter = void 0;\r\nvar Emitter;\r\n(function (Emitter) {\r\n function Create() {\r\n return new Set();\r\n }\r\n Emitter.Create = Create;\r\n function On(emitter, callback) {\r\n emitter.add(callback);\r\n }\r\n Emitter.On = On;\r\n function Emit(emitter, ...args) {\r\n emitter.forEach(function (cb) {\r\n cb(...args);\r\n });\r\n }\r\n Emitter.Emit = Emit;\r\n function Remove(emitter, callback) {\r\n emitter.delete(callback);\r\n }\r\n Emitter.Remove = Remove;\r\n})(Emitter = exports.Emitter || (exports.Emitter = {}));\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n__exportStar(require(\"./decorators\"), exports);\r\n__exportStar(require(\"./animation\"), exports);\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Injector = void 0;\r\nclass Injector {\r\n parent;\r\n typeMap;\r\n constructor() {\r\n this.parent = Injector.Current();\r\n this.typeMap = new Map();\r\n }\r\n Get(type) {\r\n if (this.typeMap.size === 0)\r\n return this.parent && this.parent.Get(type);\r\n var ret = this.typeMap.get(type);\r\n if (!ret)\r\n ret = this.parent && this.parent.Get(type);\r\n return ret;\r\n }\r\n Set(type, instance) {\r\n this.typeMap.set(type, instance);\r\n }\r\n}\r\nexports.Injector = Injector;\r\n(function (Injector) {\r\n var scope = null;\r\n function Current() {\r\n return scope;\r\n }\r\n Injector.Current = Current;\r\n function Scope(injector, action, ...args) {\r\n var parent = Current();\r\n scope = injector;\r\n const ret = action(...args);\r\n scope = parent;\r\n return ret;\r\n }\r\n Injector.Scope = Scope;\r\n})(Injector = exports.Injector || (exports.Injector = {}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.List = void 0;\r\nvar List;\r\n(function (List) {\r\n function Create() {\r\n return {\r\n head: null,\r\n tail: null,\r\n size: 0\r\n };\r\n }\r\n List.Create = Create;\r\n function Clear(list) {\r\n list.head = null;\r\n list.tail = null;\r\n list.size = 0;\r\n }\r\n List.Clear = Clear;\r\n function Push(list, data) {\r\n var node = { previous: null, next: null, data: data };\r\n if (list.size === 0) {\r\n list.head = node;\r\n list.tail = node;\r\n list.size = 1;\r\n }\r\n else {\r\n node.next = list.head;\r\n list.head.previous = node;\r\n list.head = node;\r\n list.size++;\r\n }\r\n return node;\r\n }\r\n List.Push = Push;\r\n function Pop(list) {\r\n if (list.size === 0)\r\n return null;\r\n var node = list.head;\r\n list.head = node.next;\r\n if (list.head)\r\n list.head.previous = null;\r\n list.size--;\r\n if (list.size === 0)\r\n list.tail = null;\r\n return node.data;\r\n }\r\n List.Pop = Pop;\r\n function Add(list, data) {\r\n var node = { previous: null, next: null, data: data };\r\n if (list.size === 0) {\r\n list.head = node;\r\n list.tail = node;\r\n list.size = 1;\r\n }\r\n else {\r\n node.previous = list.tail;\r\n list.tail.next = node;\r\n list.tail = node;\r\n list.size++;\r\n }\r\n return node;\r\n }\r\n List.Add = Add;\r\n function AddBefore(list, node, data) {\r\n if (!node)\r\n return List.Add(list, data);\r\n var newNode = { previous: null, next: null, data: data };\r\n var prevNode = node.previous;\r\n newNode.next = node;\r\n node.previous = newNode;\r\n if (list.head === node)\r\n list.head = newNode;\r\n if (prevNode) {\r\n prevNode.next = newNode;\r\n newNode.previous = prevNode;\r\n }\r\n list.size++;\r\n return newNode;\r\n }\r\n List.AddBefore = AddBefore;\r\n function AddAfter(list, node, data) {\r\n if (!node)\r\n return List.Push(list, data);\r\n var newNode = { previous: null, next: null, data: data };\r\n var nextNode = node.next;\r\n node.next = newNode;\r\n newNode.previous = node;\r\n if (list.tail === node)\r\n list.tail = newNode;\r\n if (nextNode) {\r\n nextNode.previous = newNode;\r\n newNode.next = nextNode;\r\n }\r\n list.size++;\r\n return newNode;\r\n }\r\n List.AddAfter = AddAfter;\r\n function Remove(list) {\r\n if (list.size === 0)\r\n return null;\r\n var node = list.tail;\r\n list.tail = node.previous;\r\n if (list.tail)\r\n list.tail.next = null;\r\n list.size--;\r\n if (list.size === 0)\r\n list.head = null;\r\n return node.data;\r\n }\r\n List.Remove = Remove;\r\n function ForEach(list, callback) {\r\n var node = list.head;\r\n while (node) {\r\n callback(node.data);\r\n node = node.next;\r\n }\r\n }\r\n List.ForEach = ForEach;\r\n})(List = exports.List || (exports.List = {}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ThreadAsync = exports.Thread = exports.Synch = exports.Callback = exports.After = exports.Schedule = void 0;\r\nconst list_1 = require(\"./list\");\r\nconst workTimeMs = 16;\r\nconst contextQueue = list_1.List.Create();\r\nvar threadContext = null;\r\nvar timeoutRunning = false;\r\nfunction ProcessQueue() {\r\n var workEndTime = Date.now() + workTimeMs;\r\n var ctx;\r\n while (Date.now() < workEndTime && (ctx = list_1.List.Pop(contextQueue)))\r\n DoWork(ctx, workEndTime);\r\n if (contextQueue.size > 0)\r\n setTimeout(ProcessQueue);\r\n else\r\n timeoutRunning = false;\r\n}\r\nfunction ScheduleWork(ctx) {\r\n list_1.List.Add(contextQueue, ctx);\r\n if (timeoutRunning)\r\n return;\r\n timeoutRunning = true;\r\n setTimeout(ProcessQueue);\r\n}\r\nfunction Invoke(ctx, callback) {\r\n var parent = ctx.workEndNode;\r\n ctx.workEndNode = ctx.workList.head;\r\n callback();\r\n ctx.workEndNode = parent;\r\n}\r\nfunction DoWork(ctx, workEndTime = Date.now() + workTimeMs) {\r\n var parentContext = threadContext;\r\n threadContext = ctx;\r\n var async = ctx.async;\r\n var callback;\r\n while (async === ctx.async && Date.now() < workEndTime && (callback = list_1.List.Pop(ctx.workList)))\r\n Invoke(ctx, callback);\r\n if (ctx.workList.size > 0)\r\n ScheduleWork(ctx);\r\n threadContext = parentContext;\r\n}\r\nfunction CreateContext() {\r\n return {\r\n async: false,\r\n workEndNode: null,\r\n workList: list_1.List.Create()\r\n };\r\n}\r\nfunction ScheduleCallback(callback, before, async) {\r\n threadContext = threadContext || CreateContext();\r\n threadContext.async = threadContext.async || async;\r\n if (before)\r\n list_1.List.AddBefore(threadContext.workList, threadContext.workEndNode, callback);\r\n else if (threadContext.workEndNode)\r\n list_1.List.AddAfter(threadContext.workList, threadContext.workEndNode, callback);\r\n else\r\n threadContext.workEndNode = list_1.List.Add(threadContext.workList, callback);\r\n}\r\nfunction SynchWithoutThread(callback) {\r\n var workEndTime = Date.now() + workTimeMs;\r\n callback();\r\n if (threadContext)\r\n if (threadContext.async)\r\n ScheduleWork(threadContext);\r\n else\r\n DoWork(threadContext, workEndTime);\r\n threadContext = null;\r\n}\r\nfunction Schedule(callback) {\r\n ScheduleCallback(callback, true, true);\r\n}\r\nexports.Schedule = Schedule;\r\nfunction After(callback) {\r\n ScheduleCallback(callback, false, false);\r\n}\r\nexports.After = After;\r\nfunction Callback(callback) {\r\n return function (a, b, c, d) {\r\n Schedule(function () { callback(a, b, c, d); });\r\n };\r\n}\r\nexports.Callback = Callback;\r\nvar inSynchCallback = false;\r\nfunction Synch(callback) {\r\n if (threadContext || inSynchCallback)\r\n callback();\r\n else {\r\n inSynchCallback = true;\r\n SynchWithoutThread(callback);\r\n inSynchCallback = false;\r\n }\r\n}\r\nexports.Synch = Synch;\r\nfunction Thread(callback) {\r\n if (threadContext)\r\n ScheduleCallback(callback, true, false);\r\n else\r\n Synch(callback);\r\n}\r\nexports.Thread = Thread;\r\nfunction ThreadAsync(callback) {\r\n return new Promise(resolve => Thread(function () {\r\n callback();\r\n Thread(resolve);\r\n }));\r\n}\r\nexports.ThreadAsync = ThreadAsync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Component = void 0;\r\nvar component_1 = require(\"./Node/component\");\r\nObject.defineProperty(exports, \"Component\", { enumerable: true, get: function () { return component_1.Component; } });\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StoreAsync = exports.Store = exports.ObservableScope = void 0;\r\n__exportStar(require(\"./index\"), exports);\r\n__exportStar(require(\"./Utils\"), exports);\r\nvar Store_1 = require(\"./Store\");\r\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return Store_1.ObservableScope; } });\r\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return Store_1.Store; } });\r\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return Store_1.StoreAsync; } });\r\n__exportStar(require(\"./DOM\"), exports);\r\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\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst Web = require(\"./web.export\");\r\nfor (var key in Web)\r\n window[key] = Web[key];\r\n"],"names":[],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "j-templates",
3
- "version": "5.0.43",
3
+ "version": "5.0.45",
4
4
  "description": "j-templates",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/TypesInCode/jTemplates",