j-templates 5.0.50 → 5.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DOM/createEventAssignment.d.ts +3 -0
- package/DOM/createEventAssignment.js +29 -0
- package/DOM/createPropertyAssignment.d.ts +4 -0
- package/DOM/createPropertyAssignment.js +74 -0
- package/DOM/domNodeConfig.d.ts +1 -1
- package/DOM/domNodeConfig.js +27 -12
- package/DOM/elements.d.ts +1 -0
- package/DOM/elements.js +27 -24
- package/DOM/index.d.ts +2 -1
- package/DOM/index.js +2 -1
- package/DOM/svgElements.js +3 -4
- package/Node/boundNode.js +16 -34
- package/Node/boundNode.types.d.ts +10 -4
- package/Node/component.js +1 -0
- package/Node/componentNode.js +0 -1
- package/Node/elementNode.js +12 -13
- package/Node/nodeConfig.d.ts +10 -1
- package/Node/nodeRef.d.ts +1 -1
- package/Node/nodeRef.js +58 -26
- package/Node/nodeRef.types.d.ts +2 -4
- package/Store/Diff/diffTree.js +1 -2
- package/Store/Tree/observableComputed.d.ts +4 -0
- package/Store/Tree/observableComputed.js +45 -0
- package/Store/Tree/observableNode.d.ts +3 -0
- package/Store/Tree/observableNode.js +195 -0
- package/Store/Tree/observableScope.d.ts +7 -12
- package/Store/Tree/observableScope.js +38 -34
- package/Store/index.d.ts +2 -0
- package/Store/index.js +5 -1
- package/Utils/decorators.d.ts +3 -1
- package/Utils/decorators.js +36 -39
- package/Utils/emitter.d.ts +2 -6
- package/Utils/emitter.js +8 -1
- package/Utils/json.d.ts +7 -0
- package/Utils/json.js +109 -0
- package/Utils/list.js +7 -7
- package/Utils/thread.d.ts +9 -15
- package/Utils/thread.js +36 -29
- package/jTemplates.js +1 -3176
- package/jTemplates.js.map +1 -1
- package/package.json +1 -1
- package/web.export.d.ts +1 -1
- package/web.export.js +3 -1
- package/DOM/utils.d.ts +0 -1
- package/DOM/utils.js +0 -47
package/jTemplates.js
CHANGED
|
@@ -1,3177 +1,2 @@
|
|
|
1
|
-
/******/ (() => { // webpackBootstrap
|
|
2
|
-
/******/ "use strict";
|
|
3
|
-
/******/ var __webpack_modules__ = ({
|
|
4
|
-
|
|
5
|
-
/***/ "./src/DOM/domNodeConfig.ts":
|
|
6
|
-
/*!**********************************!*\
|
|
7
|
-
!*** ./src/DOM/domNodeConfig.ts ***!
|
|
8
|
-
\**********************************/
|
|
9
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13
|
-
exports.DOMNodeConfig = void 0;
|
|
14
|
-
const window_1 = __webpack_require__(/*! ./window */ "./src/DOM/window.ts");
|
|
15
|
-
const list_1 = __webpack_require__(/*! ../Utils/list */ "./src/Utils/list.ts");
|
|
16
|
-
const utils_1 = __webpack_require__(/*! ./utils */ "./src/DOM/utils.ts");
|
|
17
|
-
const thread_1 = __webpack_require__(/*! ../Utils/thread */ "./src/Utils/thread.ts");
|
|
18
|
-
var pendingUpdates = list_1.List.Create();
|
|
19
|
-
var updateScheduled = false;
|
|
20
|
-
function processUpdates() {
|
|
21
|
-
list_1.List.Add(pendingUpdates, null);
|
|
22
|
-
var callback;
|
|
23
|
-
while ((callback = list_1.List.Pop(pendingUpdates)))
|
|
24
|
-
(0, thread_1.Synch)(callback);
|
|
25
|
-
if (pendingUpdates.size === 0)
|
|
26
|
-
updateScheduled = false;
|
|
27
|
-
else
|
|
28
|
-
window_1.wndw.requestAnimationFrame(processUpdates);
|
|
29
|
-
}
|
|
30
|
-
exports.DOMNodeConfig = {
|
|
31
|
-
createNode(type, namespace) {
|
|
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("");
|
|
37
|
-
},
|
|
38
|
-
scheduleUpdate(callback) {
|
|
39
|
-
list_1.List.Add(pendingUpdates, callback);
|
|
40
|
-
if (!updateScheduled) {
|
|
41
|
-
updateScheduled = true;
|
|
42
|
-
window_1.wndw.requestAnimationFrame(processUpdates);
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
addListener(target, type, callback) {
|
|
46
|
-
target.addEventListener(type, callback);
|
|
47
|
-
},
|
|
48
|
-
removeListener(target, type, callback) {
|
|
49
|
-
target.removeEventListener(type, callback);
|
|
50
|
-
},
|
|
51
|
-
addChild(root, child) {
|
|
52
|
-
root.appendChild(child);
|
|
53
|
-
},
|
|
54
|
-
addChildFirst(root, child) {
|
|
55
|
-
exports.DOMNodeConfig.addChildBefore(root, root.firstChild, child);
|
|
56
|
-
},
|
|
57
|
-
addChildBefore(root, sibling, child) {
|
|
58
|
-
if (!sibling) {
|
|
59
|
-
exports.DOMNodeConfig.addChild(root, child);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (child !== sibling)
|
|
63
|
-
root.insertBefore(child, sibling);
|
|
64
|
-
},
|
|
65
|
-
addChildAfter(root, sibling, child) {
|
|
66
|
-
if (!sibling) {
|
|
67
|
-
exports.DOMNodeConfig.addChildFirst(root, child);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
exports.DOMNodeConfig.addChildBefore(root, sibling.nextSibling, child);
|
|
71
|
-
},
|
|
72
|
-
removeChild(root, child) {
|
|
73
|
-
root.removeChild(child);
|
|
74
|
-
},
|
|
75
|
-
remove(target) {
|
|
76
|
-
target && target.parentNode && target.parentNode.removeChild(target);
|
|
77
|
-
},
|
|
78
|
-
setText(target, text) {
|
|
79
|
-
target.textContent = text;
|
|
80
|
-
},
|
|
81
|
-
getAttribute(target, attribute) {
|
|
82
|
-
return target.getAttribute(attribute);
|
|
83
|
-
},
|
|
84
|
-
setAttribute(target, attribute, value) {
|
|
85
|
-
target.setAttribute(attribute, value);
|
|
86
|
-
},
|
|
87
|
-
fireEvent(target, event, data) {
|
|
88
|
-
var cEvent = new CustomEvent(event, data);
|
|
89
|
-
target.dispatchEvent(cEvent);
|
|
90
|
-
},
|
|
91
|
-
setProperties: utils_1.SetProperties,
|
|
92
|
-
getFirstChild(target) {
|
|
93
|
-
return target.firstChild;
|
|
94
|
-
},
|
|
95
|
-
getNextSibling(target) {
|
|
96
|
-
return target.nextSibling;
|
|
97
|
-
},
|
|
98
|
-
replaceChildren(target, children) {
|
|
99
|
-
target.replaceChildren(...children);
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/***/ }),
|
|
105
|
-
|
|
106
|
-
/***/ "./src/DOM/elements.ts":
|
|
107
|
-
/*!*****************************!*\
|
|
108
|
-
!*** ./src/DOM/elements.ts ***!
|
|
109
|
-
\*****************************/
|
|
110
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
114
|
-
exports.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;
|
|
115
|
-
const elementNode_1 = __webpack_require__(/*! ../Node/elementNode */ "./src/Node/elementNode.ts");
|
|
116
|
-
function div(nodeDef, children) {
|
|
117
|
-
return elementNode_1.ElementNode.Create("div", null, nodeDef, children);
|
|
118
|
-
}
|
|
119
|
-
exports.div = div;
|
|
120
|
-
function a(nodeDef, children) {
|
|
121
|
-
return elementNode_1.ElementNode.Create("a", null, nodeDef, children);
|
|
122
|
-
}
|
|
123
|
-
exports.a = a;
|
|
124
|
-
function ul(nodeDef, children) {
|
|
125
|
-
return elementNode_1.ElementNode.Create("ul", null, nodeDef, children);
|
|
126
|
-
}
|
|
127
|
-
exports.ul = ul;
|
|
128
|
-
function li(nodeDef, children) {
|
|
129
|
-
return elementNode_1.ElementNode.Create("li", null, nodeDef, children);
|
|
130
|
-
}
|
|
131
|
-
exports.li = li;
|
|
132
|
-
function br(nodeDef) {
|
|
133
|
-
return elementNode_1.ElementNode.Create("br", null, nodeDef, null);
|
|
134
|
-
}
|
|
135
|
-
exports.br = br;
|
|
136
|
-
function b(nodeDef, children) {
|
|
137
|
-
return elementNode_1.ElementNode.Create("b", null, nodeDef, children);
|
|
138
|
-
}
|
|
139
|
-
exports.b = b;
|
|
140
|
-
function span(nodeDef, children) {
|
|
141
|
-
return elementNode_1.ElementNode.Create("span", null, nodeDef, children);
|
|
142
|
-
}
|
|
143
|
-
exports.span = span;
|
|
144
|
-
function img(nodeDef) {
|
|
145
|
-
return elementNode_1.ElementNode.Create("img", null, nodeDef, null);
|
|
146
|
-
}
|
|
147
|
-
exports.img = img;
|
|
148
|
-
function video(nodeDef, children) {
|
|
149
|
-
return elementNode_1.ElementNode.Create("video", null, nodeDef, children);
|
|
150
|
-
}
|
|
151
|
-
exports.video = video;
|
|
152
|
-
function source(nodeDef) {
|
|
153
|
-
return elementNode_1.ElementNode.Create("source", null, nodeDef, null);
|
|
154
|
-
}
|
|
155
|
-
exports.source = source;
|
|
156
|
-
function input(nodeDef) {
|
|
157
|
-
return elementNode_1.ElementNode.Create("input", null, nodeDef, null);
|
|
158
|
-
}
|
|
159
|
-
exports.input = input;
|
|
160
|
-
function select(nodeDef, children) {
|
|
161
|
-
return elementNode_1.ElementNode.Create("select", null, nodeDef, children);
|
|
162
|
-
}
|
|
163
|
-
exports.select = select;
|
|
164
|
-
function option(nodeDef, children) {
|
|
165
|
-
return elementNode_1.ElementNode.Create("option", null, nodeDef, children);
|
|
166
|
-
}
|
|
167
|
-
exports.option = option;
|
|
168
|
-
function h1(nodeDef, children) {
|
|
169
|
-
return elementNode_1.ElementNode.Create("h1", null, nodeDef, children);
|
|
170
|
-
}
|
|
171
|
-
exports.h1 = h1;
|
|
172
|
-
function h2(nodeDef, children) {
|
|
173
|
-
return elementNode_1.ElementNode.Create("h2", null, nodeDef, children);
|
|
174
|
-
}
|
|
175
|
-
exports.h2 = h2;
|
|
176
|
-
function h3(nodeDef, children) {
|
|
177
|
-
return elementNode_1.ElementNode.Create("h3", null, nodeDef, children);
|
|
178
|
-
}
|
|
179
|
-
exports.h3 = h3;
|
|
180
|
-
function p(nodeDef, children) {
|
|
181
|
-
return elementNode_1.ElementNode.Create("p", null, nodeDef, children);
|
|
182
|
-
}
|
|
183
|
-
exports.p = p;
|
|
184
|
-
function style(nodeDef, children) {
|
|
185
|
-
return elementNode_1.ElementNode.Create("style", null, nodeDef, children);
|
|
186
|
-
}
|
|
187
|
-
exports.style = style;
|
|
188
|
-
function button(nodeDef, children) {
|
|
189
|
-
return elementNode_1.ElementNode.Create("button", null, nodeDef, children);
|
|
190
|
-
}
|
|
191
|
-
exports.button = button;
|
|
192
|
-
function table(nodeDef, children) {
|
|
193
|
-
return elementNode_1.ElementNode.Create("table", null, nodeDef, children);
|
|
194
|
-
}
|
|
195
|
-
exports.table = table;
|
|
196
|
-
function th(nodeDef, children) {
|
|
197
|
-
return elementNode_1.ElementNode.Create("th", null, nodeDef, children);
|
|
198
|
-
}
|
|
199
|
-
exports.th = th;
|
|
200
|
-
function tr(nodeDef, children) {
|
|
201
|
-
return elementNode_1.ElementNode.Create("tr", null, nodeDef, children);
|
|
202
|
-
}
|
|
203
|
-
exports.tr = tr;
|
|
204
|
-
function td(nodeDef, children) {
|
|
205
|
-
return elementNode_1.ElementNode.Create("td", null, nodeDef, children);
|
|
206
|
-
}
|
|
207
|
-
exports.td = td;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
/***/ }),
|
|
211
|
-
|
|
212
|
-
/***/ "./src/DOM/index.ts":
|
|
213
|
-
/*!**************************!*\
|
|
214
|
-
!*** ./src/DOM/index.ts ***!
|
|
215
|
-
\**************************/
|
|
216
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
220
|
-
if (k2 === undefined) k2 = k;
|
|
221
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
222
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
223
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
224
|
-
}
|
|
225
|
-
Object.defineProperty(o, k2, desc);
|
|
226
|
-
}) : (function(o, m, k, k2) {
|
|
227
|
-
if (k2 === undefined) k2 = k;
|
|
228
|
-
o[k2] = m[k];
|
|
229
|
-
}));
|
|
230
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
231
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
232
|
-
};
|
|
233
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
234
|
-
__exportStar(__webpack_require__(/*! ./elements */ "./src/DOM/elements.ts"), exports);
|
|
235
|
-
__exportStar(__webpack_require__(/*! ./svgElements */ "./src/DOM/svgElements.ts"), exports);
|
|
236
|
-
__exportStar(__webpack_require__(/*! ./utils */ "./src/DOM/utils.ts"), exports);
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
/***/ }),
|
|
240
|
-
|
|
241
|
-
/***/ "./src/DOM/svgElements.ts":
|
|
242
|
-
/*!********************************!*\
|
|
243
|
-
!*** ./src/DOM/svgElements.ts ***!
|
|
244
|
-
\********************************/
|
|
245
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
249
|
-
exports.circle = exports.g = exports.svg = void 0;
|
|
250
|
-
const elementNode_1 = __webpack_require__(/*! ../Node/elementNode */ "./src/Node/elementNode.ts");
|
|
251
|
-
const svgNs = "http://www.w3.org/2000/svg";
|
|
252
|
-
function svg(nodeDef, children) {
|
|
253
|
-
return elementNode_1.ElementNode.Create("svg", svgNs, nodeDef, children);
|
|
254
|
-
}
|
|
255
|
-
exports.svg = svg;
|
|
256
|
-
function g(nodeDef, children) {
|
|
257
|
-
return elementNode_1.ElementNode.Create("g", svgNs, nodeDef, children);
|
|
258
|
-
}
|
|
259
|
-
exports.g = g;
|
|
260
|
-
function circle(nodeDef, children) {
|
|
261
|
-
return elementNode_1.ElementNode.Create("circle", svgNs, nodeDef, children);
|
|
262
|
-
}
|
|
263
|
-
exports.circle = circle;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
/***/ }),
|
|
267
|
-
|
|
268
|
-
/***/ "./src/DOM/utils.ts":
|
|
269
|
-
/*!**************************!*\
|
|
270
|
-
!*** ./src/DOM/utils.ts ***!
|
|
271
|
-
\**************************/
|
|
272
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
276
|
-
exports.SetProperties = void 0;
|
|
277
|
-
function SetValue(target, value) {
|
|
278
|
-
switch (target.nodeName) {
|
|
279
|
-
case "INPUT":
|
|
280
|
-
var start = target.selectionStart;
|
|
281
|
-
var end = target.selectionEnd;
|
|
282
|
-
target.value = value;
|
|
283
|
-
if (target.ownerDocument.activeElement === target)
|
|
284
|
-
target.setSelectionRange(start, end);
|
|
285
|
-
break;
|
|
286
|
-
default:
|
|
287
|
-
target.value = value;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
function SetStyle(target, styleDef, lastStyleDef) {
|
|
291
|
-
for (var key in styleDef)
|
|
292
|
-
if (!lastStyleDef || lastStyleDef[key] !== styleDef[key])
|
|
293
|
-
target.style[key] = styleDef[key];
|
|
294
|
-
}
|
|
295
|
-
function SetRootProperty(target, prop, value, lastValue) {
|
|
296
|
-
switch (prop) {
|
|
297
|
-
case "value":
|
|
298
|
-
SetValue(target, value);
|
|
299
|
-
break;
|
|
300
|
-
case "style":
|
|
301
|
-
SetStyle(target, value, lastValue);
|
|
302
|
-
break;
|
|
303
|
-
default:
|
|
304
|
-
target[prop] = value;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
function SetChangedProperties(target, lastProperties, properties) {
|
|
308
|
-
const keys = Object.keys(properties);
|
|
309
|
-
for (let x = 0; x < keys.length; x++) {
|
|
310
|
-
if (!lastProperties || lastProperties[keys[x]] !== properties[keys[x]])
|
|
311
|
-
SetRootProperty(target, keys[x], properties[keys[x]], lastProperties && lastProperties[keys[x]]);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
function SetProperties(target, lastProperties, properties) {
|
|
315
|
-
if (!lastProperties && target.nodeType === Node.TEXT_NODE)
|
|
316
|
-
target.nodeValue = properties.nodeValue;
|
|
317
|
-
else
|
|
318
|
-
SetChangedProperties(target, lastProperties, properties);
|
|
319
|
-
}
|
|
320
|
-
exports.SetProperties = SetProperties;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
/***/ }),
|
|
324
|
-
|
|
325
|
-
/***/ "./src/DOM/window.ts":
|
|
326
|
-
/*!***************************!*\
|
|
327
|
-
!*** ./src/DOM/window.ts ***!
|
|
328
|
-
\***************************/
|
|
329
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
333
|
-
exports.wndw = void 0;
|
|
334
|
-
exports.wndw = typeof window !== "undefined" ? window : (new (Object(function webpackMissingModule() { var e = new Error("Cannot find module 'jsdom'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())("")).window);
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
/***/ }),
|
|
338
|
-
|
|
339
|
-
/***/ "./src/Node/boundNode.ts":
|
|
340
|
-
/*!*******************************!*\
|
|
341
|
-
!*** ./src/Node/boundNode.ts ***!
|
|
342
|
-
\*******************************/
|
|
343
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
347
|
-
exports.BoundNode = void 0;
|
|
348
|
-
const nodeConfig_1 = __webpack_require__(/*! ./nodeConfig */ "./src/Node/nodeConfig.ts");
|
|
349
|
-
const observableScope_1 = __webpack_require__(/*! ../Store/Tree/observableScope */ "./src/Store/Tree/observableScope.ts");
|
|
350
|
-
var BoundNode;
|
|
351
|
-
(function (BoundNode) {
|
|
352
|
-
function Init(boundNode) {
|
|
353
|
-
const nodeDef = boundNode.nodeDef;
|
|
354
|
-
if (nodeDef.props) {
|
|
355
|
-
const scope = observableScope_1.ObservableScope.Create(nodeDef.props);
|
|
356
|
-
boundNode.destroyables.push(CreateScopeDestroyable(scope));
|
|
357
|
-
observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetProperties(boundNode, scope); });
|
|
358
|
-
SetProperties(boundNode, observableScope_1.ObservableScope.Value(scope));
|
|
359
|
-
}
|
|
360
|
-
if (nodeDef.attrs) {
|
|
361
|
-
const scope = observableScope_1.ObservableScope.Create(nodeDef.attrs);
|
|
362
|
-
boundNode.destroyables.push(CreateScopeDestroyable(scope));
|
|
363
|
-
observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetAttributes(boundNode, scope); });
|
|
364
|
-
SetAttributes(boundNode, observableScope_1.ObservableScope.Value(scope));
|
|
365
|
-
}
|
|
366
|
-
if (nodeDef.on) {
|
|
367
|
-
const scope = observableScope_1.ObservableScope.Create(nodeDef.on);
|
|
368
|
-
boundNode.destroyables.push(CreateScopeDestroyable(scope));
|
|
369
|
-
boundNode.destroyables.push({
|
|
370
|
-
Destroy() {
|
|
371
|
-
SetEvents(boundNode, {});
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetEvents(boundNode, scope); });
|
|
375
|
-
SetEvents(boundNode, observableScope_1.ObservableScope.Value(scope));
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
BoundNode.Init = Init;
|
|
379
|
-
})(BoundNode || (exports.BoundNode = BoundNode = {}));
|
|
380
|
-
function CreateScopeDestroyable(scope) {
|
|
381
|
-
return {
|
|
382
|
-
Destroy() {
|
|
383
|
-
observableScope_1.ObservableScope.Destroy(scope);
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
function ScheduleSetProperties(node, scope) {
|
|
388
|
-
if (node.setProperties)
|
|
389
|
-
return;
|
|
390
|
-
node.setProperties = true;
|
|
391
|
-
nodeConfig_1.NodeConfig.scheduleUpdate(function () {
|
|
392
|
-
node.setProperties = false;
|
|
393
|
-
if (node.destroyed)
|
|
394
|
-
return;
|
|
395
|
-
SetProperties(node, observableScope_1.ObservableScope.Value(scope));
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
function SetProperties(node, properties) {
|
|
399
|
-
if (!properties)
|
|
400
|
-
return;
|
|
401
|
-
nodeConfig_1.NodeConfig.setProperties(node.node, node.lastProperties, properties);
|
|
402
|
-
node.lastProperties = properties;
|
|
403
|
-
}
|
|
404
|
-
function ScheduleSetAttributes(node, scope) {
|
|
405
|
-
if (node.setAttributes)
|
|
406
|
-
return;
|
|
407
|
-
node.setAttributes = true;
|
|
408
|
-
nodeConfig_1.NodeConfig.scheduleUpdate(function () {
|
|
409
|
-
node.setAttributes = false;
|
|
410
|
-
if (node.destroyed)
|
|
411
|
-
return;
|
|
412
|
-
SetAttributes(node, observableScope_1.ObservableScope.Value(scope));
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
function SetAttributes(node, attributes) {
|
|
416
|
-
if (!attributes)
|
|
417
|
-
return;
|
|
418
|
-
for (var key in attributes) {
|
|
419
|
-
var val = nodeConfig_1.NodeConfig.getAttribute(node.node, key);
|
|
420
|
-
if (val !== attributes[key])
|
|
421
|
-
nodeConfig_1.NodeConfig.setAttribute(node.node, key, attributes[key]);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
function ScheduleSetEvents(node, scope) {
|
|
425
|
-
if (node.setEvents)
|
|
426
|
-
return;
|
|
427
|
-
node.setEvents = true;
|
|
428
|
-
nodeConfig_1.NodeConfig.scheduleUpdate(function () {
|
|
429
|
-
node.setEvents = false;
|
|
430
|
-
if (node.destroyed)
|
|
431
|
-
return;
|
|
432
|
-
SetEvents(node, observableScope_1.ObservableScope.Value(scope));
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
function SetEvents(node, events) {
|
|
436
|
-
if (!events)
|
|
437
|
-
return;
|
|
438
|
-
for (var key in node.lastEvents)
|
|
439
|
-
nodeConfig_1.NodeConfig.removeListener(node.node, key, node.lastEvents[key]);
|
|
440
|
-
for (var key in events)
|
|
441
|
-
nodeConfig_1.NodeConfig.addListener(node.node, key, events[key]);
|
|
442
|
-
node.lastEvents = events;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
/***/ }),
|
|
447
|
-
|
|
448
|
-
/***/ "./src/Node/component.ts":
|
|
449
|
-
/*!*******************************!*\
|
|
450
|
-
!*** ./src/Node/component.ts ***!
|
|
451
|
-
\*******************************/
|
|
452
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
456
|
-
exports.Component = void 0;
|
|
457
|
-
const nodeRef_1 = __webpack_require__(/*! ./nodeRef */ "./src/Node/nodeRef.ts");
|
|
458
|
-
const componentNode_1 = __webpack_require__(/*! ./componentNode */ "./src/Node/componentNode.ts");
|
|
459
|
-
const decorators_1 = __webpack_require__(/*! ../Utils/decorators */ "./src/Utils/decorators.ts");
|
|
460
|
-
const observableScope_1 = __webpack_require__(/*! ../Store/Tree/observableScope */ "./src/Store/Tree/observableScope.ts");
|
|
461
|
-
class Component {
|
|
462
|
-
nodeRef;
|
|
463
|
-
componentEvents;
|
|
464
|
-
scope;
|
|
465
|
-
templates;
|
|
466
|
-
decoratorMap;
|
|
467
|
-
get Injector() {
|
|
468
|
-
return this.nodeRef.injector;
|
|
469
|
-
}
|
|
470
|
-
get Destroyed() {
|
|
471
|
-
return this.nodeRef.destroyed;
|
|
472
|
-
}
|
|
473
|
-
get DecoratorMap() {
|
|
474
|
-
return this.decoratorMap;
|
|
475
|
-
}
|
|
476
|
-
get Scope() {
|
|
477
|
-
return this.scope;
|
|
478
|
-
}
|
|
479
|
-
get Data() {
|
|
480
|
-
return this.scope.Value;
|
|
481
|
-
}
|
|
482
|
-
get NodeRef() {
|
|
483
|
-
return this.nodeRef;
|
|
484
|
-
}
|
|
485
|
-
get Templates() {
|
|
486
|
-
return this.templates;
|
|
487
|
-
}
|
|
488
|
-
constructor(data, templates, nodeRef, componentEvents) {
|
|
489
|
-
this.nodeRef = nodeRef;
|
|
490
|
-
this.componentEvents = componentEvents;
|
|
491
|
-
this.scope = new observableScope_1.ObservableScope(data);
|
|
492
|
-
this.templates = templates || {};
|
|
493
|
-
this.decoratorMap = new Map();
|
|
494
|
-
}
|
|
495
|
-
Template() {
|
|
496
|
-
return [];
|
|
497
|
-
}
|
|
498
|
-
Bound() {
|
|
499
|
-
}
|
|
500
|
-
Fire(event, data) {
|
|
501
|
-
var eventCallback = this.componentEvents && this.componentEvents[event];
|
|
502
|
-
eventCallback && eventCallback(data);
|
|
503
|
-
}
|
|
504
|
-
Destroy() {
|
|
505
|
-
decorators_1.Destroy.All(this);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
exports.Component = Component;
|
|
509
|
-
(function (Component) {
|
|
510
|
-
function ToFunction(type, namespace, constructor) {
|
|
511
|
-
return componentNode_1.ComponentNode.ToFunction(type, namespace, constructor);
|
|
512
|
-
}
|
|
513
|
-
Component.ToFunction = ToFunction;
|
|
514
|
-
function Register(name, constructor) {
|
|
515
|
-
const componentFunction = ToFunction(`${name}-component`, undefined, constructor);
|
|
516
|
-
class WebComponent extends HTMLElement {
|
|
517
|
-
constructor() {
|
|
518
|
-
super();
|
|
519
|
-
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
520
|
-
const node = componentFunction({});
|
|
521
|
-
Attach(shadowRoot, node);
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
customElements.define(name, WebComponent);
|
|
525
|
-
}
|
|
526
|
-
Component.Register = Register;
|
|
527
|
-
function Attach(node, nodeRef) {
|
|
528
|
-
nodeRef_1.NodeRef.Init(nodeRef);
|
|
529
|
-
var rootRef = nodeRef_1.NodeRef.Wrap(node);
|
|
530
|
-
nodeRef_1.NodeRef.AddChild(rootRef, nodeRef);
|
|
531
|
-
}
|
|
532
|
-
Component.Attach = Attach;
|
|
533
|
-
})(Component || (exports.Component = Component = {}));
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
/***/ }),
|
|
537
|
-
|
|
538
|
-
/***/ "./src/Node/componentNode.ts":
|
|
539
|
-
/*!***********************************!*\
|
|
540
|
-
!*** ./src/Node/componentNode.ts ***!
|
|
541
|
-
\***********************************/
|
|
542
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
546
|
-
exports.ComponentNode = void 0;
|
|
547
|
-
const boundNode_1 = __webpack_require__(/*! ./boundNode */ "./src/Node/boundNode.ts");
|
|
548
|
-
const nodeRef_1 = __webpack_require__(/*! ./nodeRef */ "./src/Node/nodeRef.ts");
|
|
549
|
-
const nodeConfig_1 = __webpack_require__(/*! ./nodeConfig */ "./src/Node/nodeConfig.ts");
|
|
550
|
-
const component_1 = __webpack_require__(/*! ./component */ "./src/Node/component.ts");
|
|
551
|
-
const injector_1 = __webpack_require__(/*! ../Utils/injector */ "./src/Utils/injector.ts");
|
|
552
|
-
const decorators_1 = __webpack_require__(/*! ../Utils/decorators */ "./src/Utils/decorators.ts");
|
|
553
|
-
const thread_1 = __webpack_require__(/*! ../Utils/thread */ "./src/Utils/thread.ts");
|
|
554
|
-
const list_1 = __webpack_require__(/*! ../Utils/list */ "./src/Utils/list.ts");
|
|
555
|
-
var ComponentNode;
|
|
556
|
-
(function (ComponentNode) {
|
|
557
|
-
function Fire(event, data) {
|
|
558
|
-
var eventCallback = this.componentEvents && this.componentEvents[event];
|
|
559
|
-
eventCallback && eventCallback(data);
|
|
560
|
-
}
|
|
561
|
-
ComponentNode.Fire = Fire;
|
|
562
|
-
function ToFunction(type, namespace, constructor) {
|
|
563
|
-
return function (nodeDef, templates) {
|
|
564
|
-
return Create(type, namespace, nodeDef, constructor, templates);
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
ComponentNode.ToFunction = ToFunction;
|
|
568
|
-
function Init(componentNode) {
|
|
569
|
-
var nodeDef = componentNode.nodeDef;
|
|
570
|
-
var events = nodeDef.on;
|
|
571
|
-
nodeDef.on = null;
|
|
572
|
-
componentNode.component = new componentNode.constructor(nodeDef.data, componentNode.templates, componentNode, events);
|
|
573
|
-
SetChildren(componentNode);
|
|
574
|
-
componentNode.destroyables.push(componentNode.component);
|
|
575
|
-
boundNode_1.BoundNode.Init(componentNode);
|
|
576
|
-
}
|
|
577
|
-
ComponentNode.Init = Init;
|
|
578
|
-
})(ComponentNode || (exports.ComponentNode = ComponentNode = {}));
|
|
579
|
-
function Create(type, namespace, nodeDef, constructor, templates) {
|
|
580
|
-
var compNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ComponentNode);
|
|
581
|
-
compNode.nodeDef = nodeDef;
|
|
582
|
-
compNode.constructor = constructor;
|
|
583
|
-
compNode.templates = templates;
|
|
584
|
-
return compNode;
|
|
585
|
-
}
|
|
586
|
-
function SetChildren(node) {
|
|
587
|
-
if (decorators_1.PreReq.Has(node.component)) {
|
|
588
|
-
AddPreReqTemplate(node).then(function () {
|
|
589
|
-
AddTemplate(node, false);
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
else
|
|
593
|
-
AddTemplate(node, true);
|
|
594
|
-
}
|
|
595
|
-
function AddPreReqTemplate(node) {
|
|
596
|
-
return new Promise(resolve => {
|
|
597
|
-
(0, thread_1.Thread)(function () {
|
|
598
|
-
const preNodes = injector_1.Injector.Scope(node.injector, decorators_1.PreReqTemplate.Get, node.component);
|
|
599
|
-
(0, thread_1.Schedule)(function () {
|
|
600
|
-
if (node.destroyed)
|
|
601
|
-
return;
|
|
602
|
-
nodeRef_1.NodeRef.InitAll(node, preNodes);
|
|
603
|
-
});
|
|
604
|
-
(0, thread_1.Thread)(function () {
|
|
605
|
-
if (node.destroyed)
|
|
606
|
-
return;
|
|
607
|
-
for (var x = 0; x < preNodes.length; x++)
|
|
608
|
-
nodeRef_1.NodeRef.AddChild(node, preNodes[x]);
|
|
609
|
-
decorators_1.PreReq.All(node.component).then(function () {
|
|
610
|
-
if (node.destroyed)
|
|
611
|
-
return;
|
|
612
|
-
for (var x = 0; x < preNodes.length; x++)
|
|
613
|
-
nodeRef_1.NodeRef.Destroy(preNodes[x]);
|
|
614
|
-
nodeConfig_1.NodeConfig.scheduleUpdate(function () {
|
|
615
|
-
if (node.destroyed)
|
|
616
|
-
return;
|
|
617
|
-
for (var x = 0; x < preNodes.length; x++)
|
|
618
|
-
nodeRef_1.NodeRef.DetachChild(node, preNodes[x]);
|
|
619
|
-
resolve();
|
|
620
|
-
});
|
|
621
|
-
});
|
|
622
|
-
});
|
|
623
|
-
});
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
function InvokeNodeTemplate(node) {
|
|
627
|
-
const nodes = node.component.Template();
|
|
628
|
-
if (!Array.isArray(nodes))
|
|
629
|
-
return [nodes];
|
|
630
|
-
return nodes;
|
|
631
|
-
}
|
|
632
|
-
function AddTemplate(node, init) {
|
|
633
|
-
(0, thread_1.Thread)(function () {
|
|
634
|
-
if (node.destroyed)
|
|
635
|
-
return;
|
|
636
|
-
const nodes = injector_1.Injector.Scope(node.injector, InvokeNodeTemplate, node);
|
|
637
|
-
(0, thread_1.Schedule)(function () {
|
|
638
|
-
nodeRef_1.NodeRef.InitAll(node, nodes);
|
|
639
|
-
});
|
|
640
|
-
(0, thread_1.Thread)(function () {
|
|
641
|
-
if (node.destroyed)
|
|
642
|
-
return;
|
|
643
|
-
const list = list_1.List.Create();
|
|
644
|
-
list_1.List.Add(list, {
|
|
645
|
-
value: undefined,
|
|
646
|
-
init: true,
|
|
647
|
-
nodes
|
|
648
|
-
});
|
|
649
|
-
if (init)
|
|
650
|
-
nodeRef_1.NodeRef.ReconcileChildren(node, list);
|
|
651
|
-
else
|
|
652
|
-
nodeConfig_1.NodeConfig.scheduleUpdate(function () {
|
|
653
|
-
if (node.destroyed)
|
|
654
|
-
return;
|
|
655
|
-
nodeRef_1.NodeRef.ReconcileChildren(node, list);
|
|
656
|
-
});
|
|
657
|
-
});
|
|
658
|
-
if (node.component.Bound !== component_1.Component.prototype.Bound)
|
|
659
|
-
(0, thread_1.After)(function () {
|
|
660
|
-
nodeConfig_1.NodeConfig.scheduleUpdate(() => setTimeout(() => node.component.Bound(), 0));
|
|
661
|
-
});
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
/***/ }),
|
|
667
|
-
|
|
668
|
-
/***/ "./src/Node/elementNode.ts":
|
|
669
|
-
/*!*********************************!*\
|
|
670
|
-
!*** ./src/Node/elementNode.ts ***!
|
|
671
|
-
\*********************************/
|
|
672
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
676
|
-
exports.ElementNode = void 0;
|
|
677
|
-
const observableScope_1 = __webpack_require__(/*! ../Store/Tree/observableScope */ "./src/Store/Tree/observableScope.ts");
|
|
678
|
-
const injector_1 = __webpack_require__(/*! ../Utils/injector */ "./src/Utils/injector.ts");
|
|
679
|
-
const list_1 = __webpack_require__(/*! ../Utils/list */ "./src/Utils/list.ts");
|
|
680
|
-
const thread_1 = __webpack_require__(/*! ../Utils/thread */ "./src/Utils/thread.ts");
|
|
681
|
-
const boundNode_1 = __webpack_require__(/*! ./boundNode */ "./src/Node/boundNode.ts");
|
|
682
|
-
const nodeConfig_1 = __webpack_require__(/*! ./nodeConfig */ "./src/Node/nodeConfig.ts");
|
|
683
|
-
const nodeRef_1 = __webpack_require__(/*! ./nodeRef */ "./src/Node/nodeRef.ts");
|
|
684
|
-
var ElementNode;
|
|
685
|
-
(function (ElementNode) {
|
|
686
|
-
function Create(type, namespace, nodeDef, children) {
|
|
687
|
-
var elemNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ElementNode);
|
|
688
|
-
elemNode.nodeDef = nodeDef;
|
|
689
|
-
elemNode.childrenFunc = children;
|
|
690
|
-
return elemNode;
|
|
691
|
-
}
|
|
692
|
-
ElementNode.Create = Create;
|
|
693
|
-
function Init(elementNode) {
|
|
694
|
-
if (elementNode.childrenFunc) {
|
|
695
|
-
var nodeDef = elementNode.nodeDef;
|
|
696
|
-
if (nodeDef.data) {
|
|
697
|
-
const dataScope = observableScope_1.ObservableScope.Create(nodeDef.data);
|
|
698
|
-
observableScope_1.ObservableScope.Watch(dataScope, function () {
|
|
699
|
-
ScheduleSetData(elementNode, dataScope);
|
|
700
|
-
});
|
|
701
|
-
SetData(elementNode, GetValue(dataScope), true);
|
|
702
|
-
elementNode.destroyables.push({
|
|
703
|
-
Destroy: function () {
|
|
704
|
-
observableScope_1.ObservableScope.Destroy(dataScope);
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
else
|
|
709
|
-
SetDefaultData(elementNode);
|
|
710
|
-
}
|
|
711
|
-
boundNode_1.BoundNode.Init(elementNode);
|
|
712
|
-
}
|
|
713
|
-
ElementNode.Init = Init;
|
|
714
|
-
})(ElementNode || (exports.ElementNode = ElementNode = {}));
|
|
715
|
-
const valueDefault = [];
|
|
716
|
-
function GetValue(dataScope) {
|
|
717
|
-
var value = observableScope_1.ObservableScope.Value(dataScope);
|
|
718
|
-
if (!value)
|
|
719
|
-
return valueDefault;
|
|
720
|
-
if (!Array.isArray(value))
|
|
721
|
-
value = [value];
|
|
722
|
-
return value;
|
|
723
|
-
}
|
|
724
|
-
function ScheduleSetData(node, scope) {
|
|
725
|
-
if (node.setData)
|
|
726
|
-
return;
|
|
727
|
-
node.setData = true;
|
|
728
|
-
nodeConfig_1.NodeConfig.scheduleUpdate(function () {
|
|
729
|
-
node.setData = false;
|
|
730
|
-
if (node.destroyed)
|
|
731
|
-
return;
|
|
732
|
-
SetData(node, GetValue(scope));
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
function SetDefaultData(node) {
|
|
736
|
-
(0, thread_1.Synch)(function () {
|
|
737
|
-
const nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, true);
|
|
738
|
-
if (nodes.length > 0) {
|
|
739
|
-
nodeRef_1.NodeRef.InitAll(node, nodes);
|
|
740
|
-
(0, thread_1.Thread)(function () {
|
|
741
|
-
if (node.destroyed)
|
|
742
|
-
return;
|
|
743
|
-
const defaultNodeList = list_1.List.Create();
|
|
744
|
-
list_1.List.Add(defaultNodeList, {
|
|
745
|
-
value: null,
|
|
746
|
-
init: true,
|
|
747
|
-
nodes
|
|
748
|
-
});
|
|
749
|
-
nodeRef_1.NodeRef.ReconcileChildren(node, defaultNodeList);
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
function GetDataValue(data) {
|
|
755
|
-
return data.value;
|
|
756
|
-
}
|
|
757
|
-
function ReconcileNodeData(node, values) {
|
|
758
|
-
const nextNodeList = list_1.List.Create();
|
|
759
|
-
const initNodeList = list_1.List.Create();
|
|
760
|
-
const currentNodeList = node.nodeList;
|
|
761
|
-
const nodeMap = currentNodeList && list_1.List.ToNodeMap(currentNodeList, GetDataValue);
|
|
762
|
-
for (let x = 0; x < values.length; x++) {
|
|
763
|
-
let curNode;
|
|
764
|
-
if (nodeMap) {
|
|
765
|
-
const nodeArr = nodeMap.get(values[x]);
|
|
766
|
-
if (nodeArr) {
|
|
767
|
-
let y = nodeArr.length - 1;
|
|
768
|
-
for (; y >= 0 && !curNode; y--) {
|
|
769
|
-
curNode = nodeArr[y];
|
|
770
|
-
nodeArr[y] = null;
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
if (curNode) {
|
|
775
|
-
list_1.List.RemoveNode(currentNodeList, curNode);
|
|
776
|
-
list_1.List.AddNode(nextNodeList, curNode);
|
|
777
|
-
if (!curNode.data.init)
|
|
778
|
-
list_1.List.Add(initNodeList, curNode.data);
|
|
779
|
-
}
|
|
780
|
-
else {
|
|
781
|
-
curNode = list_1.List.Add(nextNodeList, {
|
|
782
|
-
value: values[x],
|
|
783
|
-
init: false,
|
|
784
|
-
nodes: injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, values[x])
|
|
785
|
-
});
|
|
786
|
-
list_1.List.Add(initNodeList, curNode.data);
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
let curNode = initNodeList.head;
|
|
790
|
-
while (curNode) {
|
|
791
|
-
const data = curNode.data;
|
|
792
|
-
(0, thread_1.Schedule)(function () {
|
|
793
|
-
if (node.destroyed || nextNodeList.size === 0)
|
|
794
|
-
return;
|
|
795
|
-
nodeRef_1.NodeRef.InitAll(node, data.nodes);
|
|
796
|
-
data.init = true;
|
|
797
|
-
});
|
|
798
|
-
curNode = curNode.next;
|
|
799
|
-
}
|
|
800
|
-
if (currentNodeList) {
|
|
801
|
-
let curDetach = currentNodeList.head;
|
|
802
|
-
while (curDetach) {
|
|
803
|
-
nodeRef_1.NodeRef.DestroyAll(curDetach.data.nodes);
|
|
804
|
-
for (let x = 0; x < curDetach.data.nodes.length; x++)
|
|
805
|
-
node.childNodes.delete(curDetach.data.nodes[x]);
|
|
806
|
-
curDetach = curDetach.next;
|
|
807
|
-
}
|
|
808
|
-
list_1.List.Clear(currentNodeList);
|
|
809
|
-
}
|
|
810
|
-
node.nodeList = nextNodeList;
|
|
811
|
-
}
|
|
812
|
-
function SetData(node, values, init = false) {
|
|
813
|
-
(0, thread_1.Synch)(function () {
|
|
814
|
-
ReconcileNodeData(node, values);
|
|
815
|
-
const attachNodes = node.nodeList;
|
|
816
|
-
const startSize = attachNodes.size;
|
|
817
|
-
(0, thread_1.Thread)(function () {
|
|
818
|
-
if (node.destroyed)
|
|
819
|
-
return;
|
|
820
|
-
if (init)
|
|
821
|
-
nodeRef_1.NodeRef.ReconcileChildren(node, attachNodes);
|
|
822
|
-
else
|
|
823
|
-
nodeConfig_1.NodeConfig.scheduleUpdate(function () {
|
|
824
|
-
if (node.destroyed || attachNodes.size !== startSize)
|
|
825
|
-
return;
|
|
826
|
-
nodeRef_1.NodeRef.ReconcileChildren(node, attachNodes);
|
|
827
|
-
});
|
|
828
|
-
});
|
|
829
|
-
});
|
|
830
|
-
}
|
|
831
|
-
function CreateNodeArray(childrenFunc, value) {
|
|
832
|
-
var newNodes = childrenFunc(value);
|
|
833
|
-
if (typeof newNodes === "string") {
|
|
834
|
-
var textNode = nodeRef_1.NodeRef.Create("text", null, nodeRef_1.NodeRefType.BoundNode);
|
|
835
|
-
textNode.nodeDef = {
|
|
836
|
-
props: function () {
|
|
837
|
-
return { nodeValue: childrenFunc(value) };
|
|
838
|
-
}
|
|
839
|
-
};
|
|
840
|
-
return [textNode];
|
|
841
|
-
}
|
|
842
|
-
if (Array.isArray(newNodes))
|
|
843
|
-
return newNodes;
|
|
844
|
-
return [newNodes];
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
/***/ }),
|
|
849
|
-
|
|
850
|
-
/***/ "./src/Node/nodeConfig.ts":
|
|
851
|
-
/*!********************************!*\
|
|
852
|
-
!*** ./src/Node/nodeConfig.ts ***!
|
|
853
|
-
\********************************/
|
|
854
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
858
|
-
exports.NodeConfig = void 0;
|
|
859
|
-
const domNodeConfig_1 = __webpack_require__(/*! ../DOM/domNodeConfig */ "./src/DOM/domNodeConfig.ts");
|
|
860
|
-
exports.NodeConfig = domNodeConfig_1.DOMNodeConfig;
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
/***/ }),
|
|
864
|
-
|
|
865
|
-
/***/ "./src/Node/nodeRef.ts":
|
|
866
|
-
/*!*****************************!*\
|
|
867
|
-
!*** ./src/Node/nodeRef.ts ***!
|
|
868
|
-
\*****************************/
|
|
869
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
873
|
-
exports.NodeRef = exports.NodeRefType = void 0;
|
|
874
|
-
const nodeConfig_1 = __webpack_require__(/*! ./nodeConfig */ "./src/Node/nodeConfig.ts");
|
|
875
|
-
const injector_1 = __webpack_require__(/*! ../Utils/injector */ "./src/Utils/injector.ts");
|
|
876
|
-
const boundNode_1 = __webpack_require__(/*! ./boundNode */ "./src/Node/boundNode.ts");
|
|
877
|
-
const elementNode_1 = __webpack_require__(/*! ./elementNode */ "./src/Node/elementNode.ts");
|
|
878
|
-
const componentNode_1 = __webpack_require__(/*! ./componentNode */ "./src/Node/componentNode.ts");
|
|
879
|
-
var NodeRefType;
|
|
880
|
-
(function (NodeRefType) {
|
|
881
|
-
NodeRefType[NodeRefType["NodeRef"] = 0] = "NodeRef";
|
|
882
|
-
NodeRefType[NodeRefType["BoundNode"] = 1] = "BoundNode";
|
|
883
|
-
NodeRefType[NodeRefType["ElementNode"] = 2] = "ElementNode";
|
|
884
|
-
NodeRefType[NodeRefType["ComponentNode"] = 3] = "ComponentNode";
|
|
885
|
-
})(NodeRefType || (exports.NodeRefType = NodeRefType = {}));
|
|
886
|
-
var NodeRef;
|
|
887
|
-
(function (NodeRef) {
|
|
888
|
-
function Wrap(node) {
|
|
889
|
-
var nodeRef = Create(null, null, NodeRefType.NodeRef);
|
|
890
|
-
nodeRef.node = node;
|
|
891
|
-
nodeRef.childNodes = new Set();
|
|
892
|
-
return nodeRef;
|
|
893
|
-
}
|
|
894
|
-
NodeRef.Wrap = Wrap;
|
|
895
|
-
function Create(nodeType, namespace, type) {
|
|
896
|
-
switch (type) {
|
|
897
|
-
case NodeRefType.NodeRef:
|
|
898
|
-
return {
|
|
899
|
-
node: null,
|
|
900
|
-
nodeType: nodeType,
|
|
901
|
-
nodeNamespace: namespace,
|
|
902
|
-
type: NodeRefType.NodeRef,
|
|
903
|
-
injector: injector_1.Injector.Current() || new injector_1.Injector(),
|
|
904
|
-
parent: null,
|
|
905
|
-
childNodes: null,
|
|
906
|
-
destroyed: false,
|
|
907
|
-
destroyables: []
|
|
908
|
-
};
|
|
909
|
-
case NodeRefType.BoundNode:
|
|
910
|
-
return {
|
|
911
|
-
node: null,
|
|
912
|
-
nodeType: nodeType,
|
|
913
|
-
nodeNamespace: namespace,
|
|
914
|
-
type: NodeRefType.BoundNode,
|
|
915
|
-
injector: injector_1.Injector.Current() || new injector_1.Injector(),
|
|
916
|
-
parent: null,
|
|
917
|
-
childNodes: null,
|
|
918
|
-
destroyed: false,
|
|
919
|
-
destroyables: [],
|
|
920
|
-
lastProperties: null,
|
|
921
|
-
lastEvents: null,
|
|
922
|
-
setProperties: false,
|
|
923
|
-
setAttributes: false,
|
|
924
|
-
setEvents: false
|
|
925
|
-
};
|
|
926
|
-
case NodeRefType.ElementNode:
|
|
927
|
-
return {
|
|
928
|
-
node: null,
|
|
929
|
-
nodeType: nodeType,
|
|
930
|
-
nodeNamespace: namespace,
|
|
931
|
-
type: NodeRefType.ElementNode,
|
|
932
|
-
injector: injector_1.Injector.Current() || new injector_1.Injector(),
|
|
933
|
-
parent: null,
|
|
934
|
-
childNodes: null,
|
|
935
|
-
destroyed: false,
|
|
936
|
-
destroyables: [],
|
|
937
|
-
lastProperties: null,
|
|
938
|
-
lastEvents: null,
|
|
939
|
-
setProperties: false,
|
|
940
|
-
setAttributes: false,
|
|
941
|
-
setEvents: false,
|
|
942
|
-
childrenFunc: null,
|
|
943
|
-
nodeList: null,
|
|
944
|
-
setData: false
|
|
945
|
-
};
|
|
946
|
-
case NodeRefType.ComponentNode:
|
|
947
|
-
return {
|
|
948
|
-
node: null,
|
|
949
|
-
nodeType: nodeType,
|
|
950
|
-
nodeNamespace: namespace,
|
|
951
|
-
type: NodeRefType.ComponentNode,
|
|
952
|
-
injector: injector_1.Injector.Current() || new injector_1.Injector(),
|
|
953
|
-
parent: null,
|
|
954
|
-
childNodes: null,
|
|
955
|
-
destroyed: false,
|
|
956
|
-
destroyables: [],
|
|
957
|
-
lastProperties: null,
|
|
958
|
-
lastEvents: null,
|
|
959
|
-
setProperties: false,
|
|
960
|
-
setAttributes: false,
|
|
961
|
-
setEvents: false,
|
|
962
|
-
component: null,
|
|
963
|
-
componentEvents: null
|
|
964
|
-
};
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
NodeRef.Create = Create;
|
|
968
|
-
function Init(nodeRef) {
|
|
969
|
-
if (nodeRef.node)
|
|
970
|
-
return;
|
|
971
|
-
nodeRef.node = nodeConfig_1.NodeConfig.createNode(nodeRef.nodeType, nodeRef.nodeNamespace);
|
|
972
|
-
nodeRef.childNodes = new Set();
|
|
973
|
-
switch (nodeRef.type) {
|
|
974
|
-
case NodeRefType.BoundNode:
|
|
975
|
-
boundNode_1.BoundNode.Init(nodeRef);
|
|
976
|
-
break;
|
|
977
|
-
case NodeRefType.ElementNode:
|
|
978
|
-
elementNode_1.ElementNode.Init(nodeRef);
|
|
979
|
-
break;
|
|
980
|
-
case NodeRefType.ComponentNode:
|
|
981
|
-
componentNode_1.ComponentNode.Init(nodeRef);
|
|
982
|
-
break;
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
NodeRef.Init = Init;
|
|
986
|
-
function InitAll(parentNode, nodeRefs) {
|
|
987
|
-
for (var x = 0; x < nodeRefs.length; x++) {
|
|
988
|
-
nodeRefs[x].parent = parentNode;
|
|
989
|
-
parentNode.childNodes.add(nodeRefs[x]);
|
|
990
|
-
Init(nodeRefs[x]);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
NodeRef.InitAll = InitAll;
|
|
994
|
-
function AddChild(node, child) {
|
|
995
|
-
child.parent = node;
|
|
996
|
-
node.childNodes.add(child);
|
|
997
|
-
nodeConfig_1.NodeConfig.addChild(node.node, child.node);
|
|
998
|
-
}
|
|
999
|
-
NodeRef.AddChild = AddChild;
|
|
1000
|
-
function AddChildAfter(node, currentChild, newChild) {
|
|
1001
|
-
if (currentChild && currentChild.parent !== node)
|
|
1002
|
-
throw "currentChild is not valid";
|
|
1003
|
-
newChild.parent = node;
|
|
1004
|
-
node.childNodes.add(newChild);
|
|
1005
|
-
nodeConfig_1.NodeConfig.addChildAfter(node.node, currentChild && currentChild.node, newChild.node);
|
|
1006
|
-
}
|
|
1007
|
-
NodeRef.AddChildAfter = AddChildAfter;
|
|
1008
|
-
function ReconcileChildren(node, nextChildren) {
|
|
1009
|
-
const rootNode = node.node;
|
|
1010
|
-
if (nextChildren.size === 0) {
|
|
1011
|
-
nodeConfig_1.NodeConfig.replaceChildren(rootNode, []);
|
|
1012
|
-
return;
|
|
1013
|
-
}
|
|
1014
|
-
let priorNode;
|
|
1015
|
-
let curDataNode = nextChildren?.head;
|
|
1016
|
-
while (curDataNode) {
|
|
1017
|
-
for (let x = 0; x < curDataNode.data.nodes.length; x++) {
|
|
1018
|
-
const actualNode = priorNode ? nodeConfig_1.NodeConfig.getNextSibling(priorNode) : nodeConfig_1.NodeConfig.getFirstChild(rootNode);
|
|
1019
|
-
const virtualNode = curDataNode.data.nodes[x];
|
|
1020
|
-
const expectedNode = virtualNode.node;
|
|
1021
|
-
if (actualNode !== expectedNode) {
|
|
1022
|
-
nodeConfig_1.NodeConfig.addChildBefore(rootNode, actualNode, expectedNode);
|
|
1023
|
-
}
|
|
1024
|
-
priorNode = expectedNode;
|
|
1025
|
-
}
|
|
1026
|
-
curDataNode = curDataNode.next;
|
|
1027
|
-
}
|
|
1028
|
-
let remainingSibling = priorNode && nodeConfig_1.NodeConfig.getNextSibling(priorNode);
|
|
1029
|
-
while (remainingSibling) {
|
|
1030
|
-
nodeConfig_1.NodeConfig.removeChild(rootNode, remainingSibling);
|
|
1031
|
-
remainingSibling = nodeConfig_1.NodeConfig.getNextSibling(priorNode);
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
NodeRef.ReconcileChildren = ReconcileChildren;
|
|
1035
|
-
function DetachChild(node, child) {
|
|
1036
|
-
if (node.childNodes.delete(child)) {
|
|
1037
|
-
nodeConfig_1.NodeConfig.removeChild(node.node, child.node);
|
|
1038
|
-
child.parent = null;
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
NodeRef.DetachChild = DetachChild;
|
|
1042
|
-
function Destroy(node) {
|
|
1043
|
-
if (node.destroyed)
|
|
1044
|
-
return;
|
|
1045
|
-
node.destroyed = true;
|
|
1046
|
-
node.childNodes?.forEach(Destroy);
|
|
1047
|
-
for (let x = 0; x < node.destroyables.length; x++)
|
|
1048
|
-
node.destroyables[x]?.Destroy();
|
|
1049
|
-
}
|
|
1050
|
-
NodeRef.Destroy = Destroy;
|
|
1051
|
-
function DestroyAll(nodes) {
|
|
1052
|
-
for (var x = 0; x < nodes.length; x++)
|
|
1053
|
-
Destroy(nodes[x]);
|
|
1054
|
-
}
|
|
1055
|
-
NodeRef.DestroyAll = DestroyAll;
|
|
1056
|
-
})(NodeRef || (exports.NodeRef = NodeRef = {}));
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
/***/ }),
|
|
1060
|
-
|
|
1061
|
-
/***/ "./src/Store/Diff/diffAsync.ts":
|
|
1062
|
-
/*!*************************************!*\
|
|
1063
|
-
!*** ./src/Store/Diff/diffAsync.ts ***!
|
|
1064
|
-
\*************************************/
|
|
1065
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1069
|
-
exports.DiffAsync = void 0;
|
|
1070
|
-
const diffTree_1 = __webpack_require__(/*! ./diffTree */ "./src/Store/Diff/diffTree.ts");
|
|
1071
|
-
const workerQueue_1 = __webpack_require__(/*! ./workerQueue */ "./src/Store/Diff/workerQueue.ts");
|
|
1072
|
-
const diffWorker_1 = __webpack_require__(/*! ./diffWorker */ "./src/Store/Diff/diffWorker.ts");
|
|
1073
|
-
const diffCnstr = (0, diffTree_1.DiffTreeScope)();
|
|
1074
|
-
class DiffAsync {
|
|
1075
|
-
workerQueue;
|
|
1076
|
-
constructor(keyFunc) {
|
|
1077
|
-
this.workerQueue = new workerQueue_1.WorkerQueue(diffWorker_1.DiffWorker.Create());
|
|
1078
|
-
this.workerQueue.Push({ method: "create", arguments: [keyFunc.toString()] });
|
|
1079
|
-
}
|
|
1080
|
-
static GetKeyRef(key) {
|
|
1081
|
-
return diffCnstr.GetKeyRef(key);
|
|
1082
|
-
}
|
|
1083
|
-
static ReadKeyRef(ref) {
|
|
1084
|
-
return diffCnstr.ReadKeyRef(ref);
|
|
1085
|
-
}
|
|
1086
|
-
async DiffPath(path, value) {
|
|
1087
|
-
return await this.workerQueue.Push({ method: "diffpath", arguments: [path, value] });
|
|
1088
|
-
}
|
|
1089
|
-
async DiffBatch(data) {
|
|
1090
|
-
return await this.workerQueue.Push({ method: "diffbatch", arguments: [data] });
|
|
1091
|
-
}
|
|
1092
|
-
async UpdatePath(path, value) {
|
|
1093
|
-
await this.workerQueue.Push({ method: "updatepath", arguments: [path, value] });
|
|
1094
|
-
}
|
|
1095
|
-
async GetPath(path) {
|
|
1096
|
-
return await this.workerQueue.Push({ method: "getpath", arguments: [path] });
|
|
1097
|
-
}
|
|
1098
|
-
Destroy() {
|
|
1099
|
-
this.workerQueue.Destroy();
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
exports.DiffAsync = DiffAsync;
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
/***/ }),
|
|
1106
|
-
|
|
1107
|
-
/***/ "./src/Store/Diff/diffSync.ts":
|
|
1108
|
-
/*!************************************!*\
|
|
1109
|
-
!*** ./src/Store/Diff/diffSync.ts ***!
|
|
1110
|
-
\************************************/
|
|
1111
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1115
|
-
exports.DiffSync = void 0;
|
|
1116
|
-
const diffTree_1 = __webpack_require__(/*! ./diffTree */ "./src/Store/Diff/diffTree.ts");
|
|
1117
|
-
const diffCnstr = (0, diffTree_1.DiffTreeScope)();
|
|
1118
|
-
class DiffSync {
|
|
1119
|
-
diffTree;
|
|
1120
|
-
constructor(keyFunc) {
|
|
1121
|
-
this.diffTree = new diffCnstr(keyFunc);
|
|
1122
|
-
}
|
|
1123
|
-
static GetKeyRef(key) {
|
|
1124
|
-
return diffCnstr.GetKeyRef(key);
|
|
1125
|
-
}
|
|
1126
|
-
static ReadKeyRef(ref) {
|
|
1127
|
-
return diffCnstr.ReadKeyRef(ref);
|
|
1128
|
-
}
|
|
1129
|
-
DiffPath(path, value) {
|
|
1130
|
-
return this.diffTree.DiffPath(path, value);
|
|
1131
|
-
}
|
|
1132
|
-
DiffBatch(data) {
|
|
1133
|
-
return this.diffTree.DiffBatch(data);
|
|
1134
|
-
}
|
|
1135
|
-
UpdatePath(path, value) {
|
|
1136
|
-
this.diffTree.UpdatePath(path, value);
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
exports.DiffSync = DiffSync;
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
/***/ }),
|
|
1143
|
-
|
|
1144
|
-
/***/ "./src/Store/Diff/diffTree.ts":
|
|
1145
|
-
/*!************************************!*\
|
|
1146
|
-
!*** ./src/Store/Diff/diffTree.ts ***!
|
|
1147
|
-
\************************************/
|
|
1148
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1152
|
-
exports.DiffTreeScope = void 0;
|
|
1153
|
-
function DiffTreeScope(worker) {
|
|
1154
|
-
const ctx = this;
|
|
1155
|
-
if (ctx && worker) {
|
|
1156
|
-
let diffTree = null;
|
|
1157
|
-
ctx.onmessage = function (event) {
|
|
1158
|
-
var data = event.data;
|
|
1159
|
-
switch (data.method) {
|
|
1160
|
-
case "create":
|
|
1161
|
-
var keyFunc = data.arguments[0] ? eval(data.arguments[0]) : undefined;
|
|
1162
|
-
diffTree = new DiffTree(keyFunc);
|
|
1163
|
-
ctx.postMessage(null);
|
|
1164
|
-
break;
|
|
1165
|
-
case "diffpath":
|
|
1166
|
-
var diff = diffTree.DiffPath(data.arguments[0], data.arguments[1]);
|
|
1167
|
-
ctx.postMessage(diff);
|
|
1168
|
-
break;
|
|
1169
|
-
case "diffbatch":
|
|
1170
|
-
var diff = diffTree.DiffBatch(data.arguments[0]);
|
|
1171
|
-
ctx.postMessage(diff);
|
|
1172
|
-
break;
|
|
1173
|
-
case "updatepath":
|
|
1174
|
-
diffTree.UpdatePath(data.arguments[0], data.arguments[1]);
|
|
1175
|
-
ctx.postMessage(null);
|
|
1176
|
-
break;
|
|
1177
|
-
case "getpath":
|
|
1178
|
-
var ret = diffTree.GetPath(data.arguments[0]);
|
|
1179
|
-
ctx.postMessage(ret);
|
|
1180
|
-
break;
|
|
1181
|
-
}
|
|
1182
|
-
};
|
|
1183
|
-
}
|
|
1184
|
-
const jsonConstructor = {}.constructor;
|
|
1185
|
-
function IsValue(value) {
|
|
1186
|
-
if (!value)
|
|
1187
|
-
return true;
|
|
1188
|
-
return !(jsonConstructor === value.constructor || Array.isArray(value));
|
|
1189
|
-
}
|
|
1190
|
-
let Type;
|
|
1191
|
-
(function (Type) {
|
|
1192
|
-
Type[Type["Value"] = 0] = "Value";
|
|
1193
|
-
Type[Type["Object"] = 1] = "Object";
|
|
1194
|
-
Type[Type["Array"] = 2] = "Array";
|
|
1195
|
-
})(Type || (Type = {}));
|
|
1196
|
-
function TypeOf(value) {
|
|
1197
|
-
if (!value)
|
|
1198
|
-
return Type.Value;
|
|
1199
|
-
if (jsonConstructor === value.constructor)
|
|
1200
|
-
return Type.Object;
|
|
1201
|
-
if (Array.isArray(value))
|
|
1202
|
-
return Type.Array;
|
|
1203
|
-
return Type.Value;
|
|
1204
|
-
}
|
|
1205
|
-
function JsonDiffRecursive(path, newValue, oldValue, resp) {
|
|
1206
|
-
if (newValue === oldValue)
|
|
1207
|
-
return false;
|
|
1208
|
-
const newType = TypeOf(newValue);
|
|
1209
|
-
const oldType = TypeOf(oldValue);
|
|
1210
|
-
const changedPathLength = resp.length;
|
|
1211
|
-
let allChildrenChanged = true;
|
|
1212
|
-
if (newType === oldType)
|
|
1213
|
-
switch (newType) {
|
|
1214
|
-
case Type.Array: {
|
|
1215
|
-
allChildrenChanged = JsonDiffArrays(path, newValue, oldValue, resp);
|
|
1216
|
-
break;
|
|
1217
|
-
}
|
|
1218
|
-
case Type.Object: {
|
|
1219
|
-
allChildrenChanged = JsonDiffObjects(path, newValue, oldValue, resp);
|
|
1220
|
-
break;
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
if (allChildrenChanged) {
|
|
1224
|
-
resp.splice(changedPathLength);
|
|
1225
|
-
resp.push({
|
|
1226
|
-
path,
|
|
1227
|
-
value: newValue
|
|
1228
|
-
});
|
|
1229
|
-
return true;
|
|
1230
|
-
}
|
|
1231
|
-
return false;
|
|
1232
|
-
}
|
|
1233
|
-
function JsonDiffArrays(path, newValue, oldValue, resp) {
|
|
1234
|
-
let allChildrenChanged = true;
|
|
1235
|
-
if (newValue.length !== oldValue.length)
|
|
1236
|
-
resp.push({
|
|
1237
|
-
path: path ? `${path}.length` : 'length',
|
|
1238
|
-
value: newValue.length
|
|
1239
|
-
});
|
|
1240
|
-
if (newValue.length > 0 || oldValue.length > 0) {
|
|
1241
|
-
for (let y = 0; y < newValue.length; y++) {
|
|
1242
|
-
const arrayPath = path ? `${path}.${y}` : `${y}`;
|
|
1243
|
-
allChildrenChanged = JsonDiffRecursive(arrayPath, newValue[y], oldValue[y], resp) && allChildrenChanged;
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
else
|
|
1247
|
-
allChildrenChanged = false;
|
|
1248
|
-
return allChildrenChanged;
|
|
1249
|
-
}
|
|
1250
|
-
function JsonDiffObjects(path, newValue, oldValue, resp) {
|
|
1251
|
-
let allChildrenChanged = true;
|
|
1252
|
-
const newKeys = Object.keys(newValue);
|
|
1253
|
-
const oldKeys = Object.keys(oldValue);
|
|
1254
|
-
if (newKeys.length === 0 && oldKeys.length === 0) {
|
|
1255
|
-
return false;
|
|
1256
|
-
}
|
|
1257
|
-
if (newKeys.length >= oldKeys.length) {
|
|
1258
|
-
let newKeyIndex = 0;
|
|
1259
|
-
let oldKeyIndex = 0;
|
|
1260
|
-
while (newKeyIndex < newKeys.length) {
|
|
1261
|
-
const childPath = path ? `${path}.${newKeys[newKeyIndex]}` : newKeys[newKeyIndex];
|
|
1262
|
-
if (oldKeyIndex < oldKeys.length && newKeys[newKeyIndex] === oldKeys[oldKeyIndex]) {
|
|
1263
|
-
allChildrenChanged =
|
|
1264
|
-
JsonDiffRecursive(childPath, newValue[newKeys[newKeyIndex]], oldValue[oldKeys[oldKeyIndex]], resp) &&
|
|
1265
|
-
allChildrenChanged;
|
|
1266
|
-
oldKeyIndex++;
|
|
1267
|
-
}
|
|
1268
|
-
else if (newValue[newKeys[newKeyIndex]] !== undefined) {
|
|
1269
|
-
resp.push({
|
|
1270
|
-
path: childPath,
|
|
1271
|
-
value: newValue[newKeys[newKeyIndex]]
|
|
1272
|
-
});
|
|
1273
|
-
}
|
|
1274
|
-
newKeyIndex++;
|
|
1275
|
-
}
|
|
1276
|
-
if (oldKeyIndex < oldKeys.length)
|
|
1277
|
-
allChildrenChanged = true;
|
|
1278
|
-
}
|
|
1279
|
-
return allChildrenChanged;
|
|
1280
|
-
}
|
|
1281
|
-
function BreakUpValue(path, parent, keyFunc, prop, map) {
|
|
1282
|
-
const value = prop ? parent[prop] : parent;
|
|
1283
|
-
const isValue = IsValue(value);
|
|
1284
|
-
if (!map && isValue)
|
|
1285
|
-
return new Map([[path, value]]);
|
|
1286
|
-
map = map || new Map();
|
|
1287
|
-
if (isValue)
|
|
1288
|
-
return map;
|
|
1289
|
-
const key = keyFunc ? keyFunc(value) : null;
|
|
1290
|
-
const keyRef = key && DiffTree.GetKeyRef(key);
|
|
1291
|
-
if (key && key !== path) {
|
|
1292
|
-
if (prop)
|
|
1293
|
-
parent[prop] = keyRef;
|
|
1294
|
-
BreakUpValue(key, value, keyFunc, null, map);
|
|
1295
|
-
}
|
|
1296
|
-
else {
|
|
1297
|
-
for (const subProp in value) {
|
|
1298
|
-
const childPath = `${path}.${subProp}`;
|
|
1299
|
-
BreakUpValue(childPath, value, keyFunc, subProp, map);
|
|
1300
|
-
}
|
|
1301
|
-
}
|
|
1302
|
-
if (!prop)
|
|
1303
|
-
map.set(path, key === path ? value : keyRef || value);
|
|
1304
|
-
return map;
|
|
1305
|
-
}
|
|
1306
|
-
class DiffTree {
|
|
1307
|
-
keyFunc;
|
|
1308
|
-
rootStateMap = new Map();
|
|
1309
|
-
constructor(keyFunc) {
|
|
1310
|
-
this.keyFunc = keyFunc;
|
|
1311
|
-
}
|
|
1312
|
-
static GetKeyRef(key) {
|
|
1313
|
-
return `___DiffTreeKeyRef.${key}`;
|
|
1314
|
-
}
|
|
1315
|
-
static ReadKeyRef(ref) {
|
|
1316
|
-
if (!ref)
|
|
1317
|
-
return undefined;
|
|
1318
|
-
var matches = ref.match(/^___DiffTreeKeyRef\.([^.]+$)/);
|
|
1319
|
-
if (!matches)
|
|
1320
|
-
return undefined;
|
|
1321
|
-
return matches[1];
|
|
1322
|
-
}
|
|
1323
|
-
DiffBatch(data) {
|
|
1324
|
-
var resp = [];
|
|
1325
|
-
;
|
|
1326
|
-
for (var x = 0; x < data.length; x++)
|
|
1327
|
-
this.RunDiff(data[x].path, data[x].value, resp);
|
|
1328
|
-
return resp;
|
|
1329
|
-
}
|
|
1330
|
-
DiffPath(path, value) {
|
|
1331
|
-
var resp = [];
|
|
1332
|
-
this.RunDiff(path, value, resp);
|
|
1333
|
-
return resp;
|
|
1334
|
-
}
|
|
1335
|
-
UpdatePath(path, value) {
|
|
1336
|
-
this.SetPathValue(path, value);
|
|
1337
|
-
}
|
|
1338
|
-
GetPath(path) {
|
|
1339
|
-
return this.GetPathValue(path);
|
|
1340
|
-
}
|
|
1341
|
-
RunDiff(path, value, diffResp) {
|
|
1342
|
-
var breakupMap = this.GetBreakUpMap(path, value);
|
|
1343
|
-
var resp = diffResp || [];
|
|
1344
|
-
breakupMap.forEach((value, key) => {
|
|
1345
|
-
var currentValue = key.split(".").reduce((pre, curr, index) => {
|
|
1346
|
-
if (index === 0)
|
|
1347
|
-
return this.rootStateMap.get(curr);
|
|
1348
|
-
return pre && pre[curr];
|
|
1349
|
-
}, null);
|
|
1350
|
-
JsonDiffRecursive(key, value, currentValue, resp);
|
|
1351
|
-
});
|
|
1352
|
-
for (var x = 0; x < resp.length; x++)
|
|
1353
|
-
this.SetPathValue(resp[x].path, resp[x].value);
|
|
1354
|
-
}
|
|
1355
|
-
GetPathValue(path) {
|
|
1356
|
-
var parts = path.split(".");
|
|
1357
|
-
var curr = this.rootStateMap.get(parts[0]);
|
|
1358
|
-
for (var x = 1; x < parts.length; x++)
|
|
1359
|
-
curr = curr && curr[parts[x]];
|
|
1360
|
-
return curr;
|
|
1361
|
-
}
|
|
1362
|
-
SetPathValue(path, value) {
|
|
1363
|
-
var parts = path.split(".");
|
|
1364
|
-
if (parts.length === 1)
|
|
1365
|
-
this.rootStateMap.set(parts[0], value);
|
|
1366
|
-
else {
|
|
1367
|
-
var curr = this.rootStateMap.get(parts[0]);
|
|
1368
|
-
for (var x = 1; x < parts.length - 1; x++)
|
|
1369
|
-
curr = curr[parts[x]];
|
|
1370
|
-
curr[parts[parts.length - 1]] = value;
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
GetBreakUpMap(path, value) {
|
|
1374
|
-
if (!this.keyFunc)
|
|
1375
|
-
return new Map([[path, value]]);
|
|
1376
|
-
return BreakUpValue(path, value, this.keyFunc);
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
return DiffTree;
|
|
1380
|
-
}
|
|
1381
|
-
exports.DiffTreeScope = DiffTreeScope;
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
/***/ }),
|
|
1385
|
-
|
|
1386
|
-
/***/ "./src/Store/Diff/diffWorker.ts":
|
|
1387
|
-
/*!**************************************!*\
|
|
1388
|
-
!*** ./src/Store/Diff/diffWorker.ts ***!
|
|
1389
|
-
\**************************************/
|
|
1390
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1394
|
-
exports.DiffWorker = void 0;
|
|
1395
|
-
const diffTree_1 = __webpack_require__(/*! ./diffTree */ "./src/Store/Diff/diffTree.ts");
|
|
1396
|
-
var DiffWorker;
|
|
1397
|
-
(function (DiffWorker) {
|
|
1398
|
-
var workerConstructor = null;
|
|
1399
|
-
var workerParameter = null;
|
|
1400
|
-
if (typeof Worker !== 'undefined') {
|
|
1401
|
-
workerConstructor = Worker;
|
|
1402
|
-
workerParameter = URL.createObjectURL(new Blob([`(${diffTree_1.DiffTreeScope}).call(this, true)`]));
|
|
1403
|
-
}
|
|
1404
|
-
function Create() {
|
|
1405
|
-
if (!workerConstructor)
|
|
1406
|
-
throw "Worker is not available";
|
|
1407
|
-
return new workerConstructor(workerParameter);
|
|
1408
|
-
}
|
|
1409
|
-
DiffWorker.Create = Create;
|
|
1410
|
-
})(DiffWorker || (exports.DiffWorker = DiffWorker = {}));
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
/***/ }),
|
|
1414
|
-
|
|
1415
|
-
/***/ "./src/Store/Diff/workerQueue.ts":
|
|
1416
|
-
/*!***************************************!*\
|
|
1417
|
-
!*** ./src/Store/Diff/workerQueue.ts ***!
|
|
1418
|
-
\***************************************/
|
|
1419
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1423
|
-
exports.WorkerQueue = void 0;
|
|
1424
|
-
const list_1 = __webpack_require__(/*! ../../Utils/list */ "./src/Utils/list.ts");
|
|
1425
|
-
class WorkerQueue {
|
|
1426
|
-
callbacks;
|
|
1427
|
-
worker;
|
|
1428
|
-
constructor(worker) {
|
|
1429
|
-
this.worker = worker;
|
|
1430
|
-
this.callbacks = list_1.List.Create();
|
|
1431
|
-
this.worker.onerror = (err) => {
|
|
1432
|
-
var cb = list_1.List.Pop(this.callbacks);
|
|
1433
|
-
cb && cb(null, err);
|
|
1434
|
-
};
|
|
1435
|
-
this.worker.onmessage = (message) => {
|
|
1436
|
-
var cb = list_1.List.Pop(this.callbacks);
|
|
1437
|
-
cb && cb(message.data);
|
|
1438
|
-
};
|
|
1439
|
-
}
|
|
1440
|
-
Push(message) {
|
|
1441
|
-
return new Promise((resolve, reject) => {
|
|
1442
|
-
list_1.List.Add(this.callbacks, function (data, err) {
|
|
1443
|
-
if (err)
|
|
1444
|
-
reject(err);
|
|
1445
|
-
else
|
|
1446
|
-
resolve(data);
|
|
1447
|
-
});
|
|
1448
|
-
this.worker.postMessage(message);
|
|
1449
|
-
});
|
|
1450
|
-
}
|
|
1451
|
-
Destroy() {
|
|
1452
|
-
this.worker.terminate();
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
exports.WorkerQueue = WorkerQueue;
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
/***/ }),
|
|
1459
|
-
|
|
1460
|
-
/***/ "./src/Store/Store/store.ts":
|
|
1461
|
-
/*!**********************************!*\
|
|
1462
|
-
!*** ./src/Store/Store/store.ts ***!
|
|
1463
|
-
\**********************************/
|
|
1464
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1468
|
-
exports.Store = void 0;
|
|
1469
|
-
const observableTree_1 = __webpack_require__(/*! ../Tree/observableTree */ "./src/Store/Tree/observableTree.ts");
|
|
1470
|
-
const storeWriter_1 = __webpack_require__(/*! ./storeWriter */ "./src/Store/Store/storeWriter.ts");
|
|
1471
|
-
class Store {
|
|
1472
|
-
observableTree = new observableTree_1.ObservableTree();
|
|
1473
|
-
storeWriter = new storeWriter_1.StoreWriter(this.observableTree);
|
|
1474
|
-
rootScope = this.observableTree.Scope("ROOT", root => root);
|
|
1475
|
-
get Root() {
|
|
1476
|
-
return this.rootScope;
|
|
1477
|
-
}
|
|
1478
|
-
constructor(init) {
|
|
1479
|
-
if (init)
|
|
1480
|
-
this.Write(init);
|
|
1481
|
-
}
|
|
1482
|
-
Action(action) {
|
|
1483
|
-
var proxy = this.observableTree.Get("ROOT");
|
|
1484
|
-
action(proxy, this.storeWriter);
|
|
1485
|
-
}
|
|
1486
|
-
Write(data) {
|
|
1487
|
-
this.Action((root, writer) => writer.Write(root, data));
|
|
1488
|
-
}
|
|
1489
|
-
Merge(data) {
|
|
1490
|
-
this.Action((root, writer) => writer.Merge(root, data));
|
|
1491
|
-
}
|
|
1492
|
-
Destroy() {
|
|
1493
|
-
this.rootScope.Destroy();
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
exports.Store = Store;
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
/***/ }),
|
|
1500
|
-
|
|
1501
|
-
/***/ "./src/Store/Store/storeAsync.ts":
|
|
1502
|
-
/*!***************************************!*\
|
|
1503
|
-
!*** ./src/Store/Store/storeAsync.ts ***!
|
|
1504
|
-
\***************************************/
|
|
1505
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1509
|
-
exports.StoreAsync = void 0;
|
|
1510
|
-
const observableTree_1 = __webpack_require__(/*! ../Tree/observableTree */ "./src/Store/Tree/observableTree.ts");
|
|
1511
|
-
const diffAsync_1 = __webpack_require__(/*! ../Diff/diffAsync */ "./src/Store/Diff/diffAsync.ts");
|
|
1512
|
-
const storeAsyncWriter_1 = __webpack_require__(/*! ./storeAsyncWriter */ "./src/Store/Store/storeAsyncWriter.ts");
|
|
1513
|
-
const asyncQueue_1 = __webpack_require__(/*! ../../Utils/asyncQueue */ "./src/Utils/asyncQueue.ts");
|
|
1514
|
-
class StoreAsync {
|
|
1515
|
-
idFunc;
|
|
1516
|
-
diffAsync;
|
|
1517
|
-
observableTree;
|
|
1518
|
-
asyncWriter;
|
|
1519
|
-
asyncQueue;
|
|
1520
|
-
constructor(idFunc, init) {
|
|
1521
|
-
this.idFunc = idFunc;
|
|
1522
|
-
this.diffAsync = new diffAsync_1.DiffAsync(this.idFunc);
|
|
1523
|
-
this.observableTree = new observableTree_1.ObservableTree(diffAsync_1.DiffAsync.ReadKeyRef);
|
|
1524
|
-
this.asyncWriter = new storeAsyncWriter_1.StoreAsyncWriter(this.idFunc, this.diffAsync, this.observableTree);
|
|
1525
|
-
this.asyncQueue = new asyncQueue_1.AsyncQueue();
|
|
1526
|
-
if (init) {
|
|
1527
|
-
var id = this.idFunc(init);
|
|
1528
|
-
this.observableTree.Write(id, init);
|
|
1529
|
-
this.Write(init);
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
Scope(id, func) {
|
|
1533
|
-
return this.observableTree.Scope(id, func);
|
|
1534
|
-
}
|
|
1535
|
-
async Action(id, action) {
|
|
1536
|
-
await this.asyncQueue.Next(async () => {
|
|
1537
|
-
await action(id && this.observableTree.Get(id), this.asyncWriter);
|
|
1538
|
-
});
|
|
1539
|
-
}
|
|
1540
|
-
async Write(data) {
|
|
1541
|
-
await this.Action(null, async (val, writer) => {
|
|
1542
|
-
await writer.Write(val, data);
|
|
1543
|
-
});
|
|
1544
|
-
}
|
|
1545
|
-
async Merge(id, data) {
|
|
1546
|
-
await this.Action(id, async (val, writer) => {
|
|
1547
|
-
await writer.Merge(val, data);
|
|
1548
|
-
});
|
|
1549
|
-
}
|
|
1550
|
-
Destroy() {
|
|
1551
|
-
this.asyncQueue.Stop();
|
|
1552
|
-
this.diffAsync.Destroy();
|
|
1553
|
-
}
|
|
1554
|
-
}
|
|
1555
|
-
exports.StoreAsync = StoreAsync;
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
/***/ }),
|
|
1559
|
-
|
|
1560
|
-
/***/ "./src/Store/Store/storeAsyncWriter.ts":
|
|
1561
|
-
/*!*********************************************!*\
|
|
1562
|
-
!*** ./src/Store/Store/storeAsyncWriter.ts ***!
|
|
1563
|
-
\*********************************************/
|
|
1564
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1568
|
-
exports.StoreAsyncWriter = void 0;
|
|
1569
|
-
class StoreAsyncWriter {
|
|
1570
|
-
idFunc;
|
|
1571
|
-
diffAsync;
|
|
1572
|
-
observableTree;
|
|
1573
|
-
constructor(idFunc, diffAsync, observableTree) {
|
|
1574
|
-
this.idFunc = idFunc;
|
|
1575
|
-
this.diffAsync = diffAsync;
|
|
1576
|
-
this.observableTree = observableTree;
|
|
1577
|
-
}
|
|
1578
|
-
async Write(source, data) {
|
|
1579
|
-
let path;
|
|
1580
|
-
if (source) {
|
|
1581
|
-
path = this.observableTree.GetPathOf(source);
|
|
1582
|
-
}
|
|
1583
|
-
else {
|
|
1584
|
-
path = this.idFunc(data);
|
|
1585
|
-
if (!path)
|
|
1586
|
-
throw new Error("data must have an id");
|
|
1587
|
-
}
|
|
1588
|
-
let diff = await this.diffAsync.DiffPath(path, data);
|
|
1589
|
-
this.ApplyChanges(diff);
|
|
1590
|
-
}
|
|
1591
|
-
async Merge(source, data) {
|
|
1592
|
-
const rootPath = this.observableTree.GetPathOf(source);
|
|
1593
|
-
const keys = Object.keys(data);
|
|
1594
|
-
const message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));
|
|
1595
|
-
const diff = await this.diffAsync.DiffBatch(message);
|
|
1596
|
-
this.ApplyChanges(diff);
|
|
1597
|
-
}
|
|
1598
|
-
async Push(source, data) {
|
|
1599
|
-
const rootPath = this.observableTree.GetPathOf(source);
|
|
1600
|
-
var lengthPath = `${rootPath}.length`;
|
|
1601
|
-
var length = await this.diffAsync.GetPath(lengthPath);
|
|
1602
|
-
var diff = await this.diffAsync.DiffPath(`${rootPath}.${length}`, data);
|
|
1603
|
-
this.ApplyChanges(diff);
|
|
1604
|
-
}
|
|
1605
|
-
async Splice(source, start, deleteCount, ...items) {
|
|
1606
|
-
var rootPath = this.observableTree.GetPathOf(source);
|
|
1607
|
-
var array = await this.diffAsync.GetPath(rootPath);
|
|
1608
|
-
array = array.slice();
|
|
1609
|
-
array.splice(start, deleteCount, ...items);
|
|
1610
|
-
var diff = await this.diffAsync.DiffPath(rootPath, array);
|
|
1611
|
-
this.ApplyChanges(diff);
|
|
1612
|
-
}
|
|
1613
|
-
ApplyChanges(diff) {
|
|
1614
|
-
this.observableTree.WriteAll(diff);
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
exports.StoreAsyncWriter = StoreAsyncWriter;
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
/***/ }),
|
|
1621
|
-
|
|
1622
|
-
/***/ "./src/Store/Store/storeSync.ts":
|
|
1623
|
-
/*!**************************************!*\
|
|
1624
|
-
!*** ./src/Store/Store/storeSync.ts ***!
|
|
1625
|
-
\**************************************/
|
|
1626
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1630
|
-
exports.StoreSync = void 0;
|
|
1631
|
-
const diffSync_1 = __webpack_require__(/*! ../Diff/diffSync */ "./src/Store/Diff/diffSync.ts");
|
|
1632
|
-
const observableTree_1 = __webpack_require__(/*! ../Tree/observableTree */ "./src/Store/Tree/observableTree.ts");
|
|
1633
|
-
const storeSyncWriter_1 = __webpack_require__(/*! ./storeSyncWriter */ "./src/Store/Store/storeSyncWriter.ts");
|
|
1634
|
-
class StoreSync {
|
|
1635
|
-
diffSync = new diffSync_1.DiffSync();
|
|
1636
|
-
observableTree = new observableTree_1.ObservableTree();
|
|
1637
|
-
storeWriter = new storeSyncWriter_1.StoreSyncWriter(this.diffSync, this.observableTree);
|
|
1638
|
-
rootScope = this.observableTree.Scope("ROOT", root => root);
|
|
1639
|
-
get Root() {
|
|
1640
|
-
return this.rootScope;
|
|
1641
|
-
}
|
|
1642
|
-
constructor(init) {
|
|
1643
|
-
if (init)
|
|
1644
|
-
this.Write(init);
|
|
1645
|
-
}
|
|
1646
|
-
Action(action) {
|
|
1647
|
-
var proxy = this.observableTree.Get("ROOT");
|
|
1648
|
-
action(proxy, this.storeWriter);
|
|
1649
|
-
}
|
|
1650
|
-
Write(data) {
|
|
1651
|
-
this.Action((root, writer) => writer.Write(root, data));
|
|
1652
|
-
}
|
|
1653
|
-
Merge(data) {
|
|
1654
|
-
this.Action((root, writer) => writer.Merge(root, data));
|
|
1655
|
-
}
|
|
1656
|
-
Destroy() {
|
|
1657
|
-
this.rootScope.Destroy();
|
|
1658
|
-
}
|
|
1659
|
-
}
|
|
1660
|
-
exports.StoreSync = StoreSync;
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
/***/ }),
|
|
1664
|
-
|
|
1665
|
-
/***/ "./src/Store/Store/storeSyncWriter.ts":
|
|
1666
|
-
/*!********************************************!*\
|
|
1667
|
-
!*** ./src/Store/Store/storeSyncWriter.ts ***!
|
|
1668
|
-
\********************************************/
|
|
1669
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1673
|
-
exports.StoreSyncWriter = void 0;
|
|
1674
|
-
class StoreSyncWriter {
|
|
1675
|
-
diffSync;
|
|
1676
|
-
observableTree;
|
|
1677
|
-
constructor(diffSync, observableTree) {
|
|
1678
|
-
this.diffSync = diffSync;
|
|
1679
|
-
this.observableTree = observableTree;
|
|
1680
|
-
}
|
|
1681
|
-
Write(source, data) {
|
|
1682
|
-
var rootPath = source && this.observableTree.GetPathOf(source) || "ROOT";
|
|
1683
|
-
var diff = this.diffSync.DiffPath(rootPath, data);
|
|
1684
|
-
this.ApplyChanges(diff);
|
|
1685
|
-
}
|
|
1686
|
-
Merge(source, data) {
|
|
1687
|
-
var rootPath = this.observableTree.GetPathOf(source);
|
|
1688
|
-
var keys = Object.keys(data);
|
|
1689
|
-
var message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));
|
|
1690
|
-
var diff = this.diffSync.DiffBatch(message);
|
|
1691
|
-
this.ApplyChanges(diff);
|
|
1692
|
-
}
|
|
1693
|
-
Push(source, data) {
|
|
1694
|
-
var rootPath = this.observableTree.GetPathOf(source);
|
|
1695
|
-
var length = source.length;
|
|
1696
|
-
this.diffSync.UpdatePath(`${rootPath}.${length}`, data);
|
|
1697
|
-
this.observableTree.Write(`${rootPath}.${length}`, data);
|
|
1698
|
-
}
|
|
1699
|
-
Splice(source, start, deleteCount, ...items) {
|
|
1700
|
-
var rootPath = this.observableTree.GetPathOf(source);
|
|
1701
|
-
var proxy = this.observableTree.Get(rootPath);
|
|
1702
|
-
const array = proxy.toJSON().slice();
|
|
1703
|
-
array.splice(start, deleteCount, ...items);
|
|
1704
|
-
this.diffSync.UpdatePath(rootPath, array);
|
|
1705
|
-
this.observableTree.Write(rootPath, array);
|
|
1706
|
-
}
|
|
1707
|
-
ApplyChanges(diff) {
|
|
1708
|
-
this.observableTree.WriteAll(diff);
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
exports.StoreSyncWriter = StoreSyncWriter;
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
/***/ }),
|
|
1715
|
-
|
|
1716
|
-
/***/ "./src/Store/Store/storeWriter.ts":
|
|
1717
|
-
/*!****************************************!*\
|
|
1718
|
-
!*** ./src/Store/Store/storeWriter.ts ***!
|
|
1719
|
-
\****************************************/
|
|
1720
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1724
|
-
exports.StoreWriter = void 0;
|
|
1725
|
-
class StoreWriter {
|
|
1726
|
-
observableTree;
|
|
1727
|
-
constructor(observableTree) {
|
|
1728
|
-
this.observableTree = observableTree;
|
|
1729
|
-
}
|
|
1730
|
-
Write(source, data) {
|
|
1731
|
-
const rootPath = source && this.observableTree.GetPathOf(source) || "ROOT";
|
|
1732
|
-
this.observableTree.Write(rootPath, data);
|
|
1733
|
-
}
|
|
1734
|
-
Merge(source, data) {
|
|
1735
|
-
const rootPath = this.observableTree.GetPathOf(source);
|
|
1736
|
-
for (const key in data)
|
|
1737
|
-
this.observableTree.Write(`${rootPath}.${key}`, data[key]);
|
|
1738
|
-
}
|
|
1739
|
-
Push(source, data) {
|
|
1740
|
-
const rootPath = this.observableTree.GetPathOf(source);
|
|
1741
|
-
this.observableTree.Write(`${rootPath}.${source.length}`, data);
|
|
1742
|
-
}
|
|
1743
|
-
Splice(source, start, deleteCount, ...items) {
|
|
1744
|
-
const json = source.toJSON();
|
|
1745
|
-
const copy = json.slice();
|
|
1746
|
-
copy.splice(start, deleteCount, ...items);
|
|
1747
|
-
const rootPath = this.observableTree.GetPathOf(source);
|
|
1748
|
-
this.observableTree.Write(rootPath, copy);
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
exports.StoreWriter = StoreWriter;
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
/***/ }),
|
|
1755
|
-
|
|
1756
|
-
/***/ "./src/Store/Tree/observableScope.ts":
|
|
1757
|
-
/*!*******************************************!*\
|
|
1758
|
-
!*** ./src/Store/Tree/observableScope.ts ***!
|
|
1759
|
-
\*******************************************/
|
|
1760
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1764
|
-
exports.ObservableScope = exports.ObservableScopeWrapper = exports.ObservableScopeValue = void 0;
|
|
1765
|
-
const emitter_1 = __webpack_require__(/*! ../../Utils/emitter */ "./src/Utils/emitter.ts");
|
|
1766
|
-
class ObservableScopeValue {
|
|
1767
|
-
scope;
|
|
1768
|
-
get Value() {
|
|
1769
|
-
return ObservableScope.Value(this.scope);
|
|
1770
|
-
}
|
|
1771
|
-
constructor(scope) {
|
|
1772
|
-
this.scope = scope;
|
|
1773
|
-
}
|
|
1774
|
-
}
|
|
1775
|
-
exports.ObservableScopeValue = ObservableScopeValue;
|
|
1776
|
-
class ObservableScopeWrapper extends ObservableScopeValue {
|
|
1777
|
-
scopeEmitter;
|
|
1778
|
-
constructor(scope) {
|
|
1779
|
-
super(scope);
|
|
1780
|
-
if (scope.emitter) {
|
|
1781
|
-
this.scopeEmitter = emitter_1.Emitter.Create();
|
|
1782
|
-
emitter_1.Emitter.On(scope.emitter, () => emitter_1.Emitter.Emit(this.scopeEmitter, this));
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
Scope(callback) {
|
|
1786
|
-
return new ObservableScope(() => callback(this.Value));
|
|
1787
|
-
}
|
|
1788
|
-
Watch(callback) {
|
|
1789
|
-
if (!this.scopeEmitter)
|
|
1790
|
-
return;
|
|
1791
|
-
emitter_1.Emitter.On(this.scopeEmitter, callback);
|
|
1792
|
-
callback(this);
|
|
1793
|
-
}
|
|
1794
|
-
Unwatch(callback) {
|
|
1795
|
-
if (!this.scopeEmitter)
|
|
1796
|
-
return;
|
|
1797
|
-
emitter_1.Emitter.Remove(this.scopeEmitter, callback);
|
|
1798
|
-
}
|
|
1799
|
-
Destroy() {
|
|
1800
|
-
DestroyScope(this.scope);
|
|
1801
|
-
this.scopeEmitter && this.scopeEmitter.clear();
|
|
1802
|
-
}
|
|
1803
|
-
}
|
|
1804
|
-
exports.ObservableScopeWrapper = ObservableScopeWrapper;
|
|
1805
|
-
class ObservableScope extends ObservableScopeWrapper {
|
|
1806
|
-
constructor(getFunction) {
|
|
1807
|
-
super(ObservableScope.Create(getFunction));
|
|
1808
|
-
}
|
|
1809
|
-
}
|
|
1810
|
-
exports.ObservableScope = ObservableScope;
|
|
1811
|
-
var currentSet = null;
|
|
1812
|
-
var watching = false;
|
|
1813
|
-
function WatchAction(action) {
|
|
1814
|
-
var parentSet = currentSet;
|
|
1815
|
-
currentSet = null;
|
|
1816
|
-
var parentWatching = watching;
|
|
1817
|
-
watching = true;
|
|
1818
|
-
action();
|
|
1819
|
-
var lastSet = currentSet;
|
|
1820
|
-
currentSet = parentSet;
|
|
1821
|
-
watching = parentWatching;
|
|
1822
|
-
return lastSet;
|
|
1823
|
-
}
|
|
1824
|
-
(function (ObservableScope) {
|
|
1825
|
-
function Create(valueFunction) {
|
|
1826
|
-
if (typeof valueFunction !== 'function')
|
|
1827
|
-
return {
|
|
1828
|
-
value: valueFunction,
|
|
1829
|
-
dirty: false,
|
|
1830
|
-
destroyed: false
|
|
1831
|
-
};
|
|
1832
|
-
var scope = {
|
|
1833
|
-
getFunction: valueFunction,
|
|
1834
|
-
async: valueFunction[Symbol.toStringTag] === 'AsyncFunction',
|
|
1835
|
-
value: null,
|
|
1836
|
-
dirty: true,
|
|
1837
|
-
emitter: emitter_1.Emitter.Create(),
|
|
1838
|
-
emitters: null,
|
|
1839
|
-
destroyed: false,
|
|
1840
|
-
setCallback: function () {
|
|
1841
|
-
OnSet(scope);
|
|
1842
|
-
}
|
|
1843
|
-
};
|
|
1844
|
-
return scope;
|
|
1845
|
-
}
|
|
1846
|
-
ObservableScope.Create = Create;
|
|
1847
|
-
function Register(emitter) {
|
|
1848
|
-
if (!watching || !emitter)
|
|
1849
|
-
return;
|
|
1850
|
-
currentSet = currentSet || new Set();
|
|
1851
|
-
currentSet.add(emitter);
|
|
1852
|
-
}
|
|
1853
|
-
ObservableScope.Register = Register;
|
|
1854
|
-
function Value(scope) {
|
|
1855
|
-
if (!scope)
|
|
1856
|
-
return undefined;
|
|
1857
|
-
Register(scope.emitter);
|
|
1858
|
-
UpdateValue(scope);
|
|
1859
|
-
return scope.value;
|
|
1860
|
-
}
|
|
1861
|
-
ObservableScope.Value = Value;
|
|
1862
|
-
function Watching() {
|
|
1863
|
-
return watching;
|
|
1864
|
-
}
|
|
1865
|
-
ObservableScope.Watching = Watching;
|
|
1866
|
-
function Watch(scope, callback) {
|
|
1867
|
-
if (!scope || !scope.emitter)
|
|
1868
|
-
return;
|
|
1869
|
-
emitter_1.Emitter.On(scope.emitter, callback);
|
|
1870
|
-
}
|
|
1871
|
-
ObservableScope.Watch = Watch;
|
|
1872
|
-
function Unwatch(scope, callback) {
|
|
1873
|
-
if (!scope || !scope.emitter)
|
|
1874
|
-
return;
|
|
1875
|
-
emitter_1.Emitter.Remove(scope.emitter, callback);
|
|
1876
|
-
}
|
|
1877
|
-
ObservableScope.Unwatch = Unwatch;
|
|
1878
|
-
function Update(scope) {
|
|
1879
|
-
OnSet(scope);
|
|
1880
|
-
}
|
|
1881
|
-
ObservableScope.Update = Update;
|
|
1882
|
-
function Emit(scope) {
|
|
1883
|
-
emitter_1.Emitter.Emit(scope.emitter);
|
|
1884
|
-
}
|
|
1885
|
-
ObservableScope.Emit = Emit;
|
|
1886
|
-
function Destroy(scope) {
|
|
1887
|
-
DestroyScope(scope);
|
|
1888
|
-
}
|
|
1889
|
-
ObservableScope.Destroy = Destroy;
|
|
1890
|
-
})(ObservableScope || (exports.ObservableScope = ObservableScope = {}));
|
|
1891
|
-
function OnSet(scope) {
|
|
1892
|
-
if (!scope || scope.dirty)
|
|
1893
|
-
return;
|
|
1894
|
-
scope.dirty = true;
|
|
1895
|
-
emitter_1.Emitter.Emit(scope.emitter, scope);
|
|
1896
|
-
}
|
|
1897
|
-
function UpdateValue(scope) {
|
|
1898
|
-
if (!scope.dirty)
|
|
1899
|
-
return;
|
|
1900
|
-
scope.dirty = false;
|
|
1901
|
-
var value = null;
|
|
1902
|
-
var emitters = scope.getFunction && WatchAction(() => value = scope.getFunction());
|
|
1903
|
-
if (scope.async)
|
|
1904
|
-
Promise.resolve(value).then(val => {
|
|
1905
|
-
scope.value = val;
|
|
1906
|
-
emitter_1.Emitter.Emit(scope.emitter, scope);
|
|
1907
|
-
});
|
|
1908
|
-
else
|
|
1909
|
-
scope.value = value;
|
|
1910
|
-
UpdateEmitters(scope, emitters);
|
|
1911
|
-
}
|
|
1912
|
-
function DestroyScope(scope) {
|
|
1913
|
-
if (!scope)
|
|
1914
|
-
return;
|
|
1915
|
-
scope.emitters && scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));
|
|
1916
|
-
scope.emitters && scope.emitters.clear();
|
|
1917
|
-
scope.emitter && scope.emitter.clear();
|
|
1918
|
-
scope.destroyed = true;
|
|
1919
|
-
}
|
|
1920
|
-
function UpdateEmitters(scope, newEmitters) {
|
|
1921
|
-
if (newEmitters)
|
|
1922
|
-
newEmitters.forEach(e => {
|
|
1923
|
-
if (!scope.emitters || !scope.emitters.delete(e))
|
|
1924
|
-
emitter_1.Emitter.On(e, scope.setCallback);
|
|
1925
|
-
});
|
|
1926
|
-
if (scope.emitters)
|
|
1927
|
-
scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));
|
|
1928
|
-
scope.emitters = newEmitters;
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
/***/ }),
|
|
1933
|
-
|
|
1934
|
-
/***/ "./src/Store/Tree/observableTree.ts":
|
|
1935
|
-
/*!******************************************!*\
|
|
1936
|
-
!*** ./src/Store/Tree/observableTree.ts ***!
|
|
1937
|
-
\******************************************/
|
|
1938
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1942
|
-
exports.ObservableTree = void 0;
|
|
1943
|
-
const observableScope_1 = __webpack_require__(/*! ../Tree/observableScope */ "./src/Store/Tree/observableScope.ts");
|
|
1944
|
-
var Type;
|
|
1945
|
-
(function (Type) {
|
|
1946
|
-
Type[Type["Value"] = 0] = "Value";
|
|
1947
|
-
Type[Type["Object"] = 1] = "Object";
|
|
1948
|
-
Type[Type["Array"] = 2] = "Array";
|
|
1949
|
-
})(Type || (Type = {}));
|
|
1950
|
-
const jsonConstructor = {}.constructor;
|
|
1951
|
-
function TypeOf(value) {
|
|
1952
|
-
if (!value)
|
|
1953
|
-
return Type.Value;
|
|
1954
|
-
if (jsonConstructor === value.constructor)
|
|
1955
|
-
return Type.Object;
|
|
1956
|
-
if (Array.isArray(value))
|
|
1957
|
-
return Type.Array;
|
|
1958
|
-
return Type.Value;
|
|
1959
|
-
}
|
|
1960
|
-
class ObservableTree {
|
|
1961
|
-
valuePathResolver;
|
|
1962
|
-
undefinedScope = observableScope_1.ObservableScope.Create(function () { return undefined; });
|
|
1963
|
-
scopeCache = new WeakMap();
|
|
1964
|
-
leafScopeCache = new WeakMap();
|
|
1965
|
-
proxyCache = new WeakMap();
|
|
1966
|
-
pathCache = new WeakMap();
|
|
1967
|
-
rootStateMap = new Map();
|
|
1968
|
-
constructor(valuePathResolver) {
|
|
1969
|
-
this.valuePathResolver = valuePathResolver;
|
|
1970
|
-
}
|
|
1971
|
-
static UnwrapProxyValues(value) {
|
|
1972
|
-
if (value?.toJSON && typeof value.toJSON === 'function')
|
|
1973
|
-
return value.toJSON();
|
|
1974
|
-
const type = TypeOf(value);
|
|
1975
|
-
if (type === Type.Value)
|
|
1976
|
-
return value;
|
|
1977
|
-
if (type === Type.Array) {
|
|
1978
|
-
const arr = value;
|
|
1979
|
-
for (let x = 0; x < arr.length; x++)
|
|
1980
|
-
arr[x] = ObservableTree.UnwrapProxyValues(arr[x]);
|
|
1981
|
-
}
|
|
1982
|
-
else {
|
|
1983
|
-
const keys = Object.keys(value);
|
|
1984
|
-
for (let x = 0; x < keys.length; x++)
|
|
1985
|
-
value[keys[x]] = ObservableTree.UnwrapProxyValues(value[keys[x]]);
|
|
1986
|
-
}
|
|
1987
|
-
return value;
|
|
1988
|
-
}
|
|
1989
|
-
Get(path) {
|
|
1990
|
-
const val = path.split(".").reduce((pre, curr, index) => {
|
|
1991
|
-
if (index === 0) {
|
|
1992
|
-
let value = this.rootStateMap.get(curr);
|
|
1993
|
-
const scope = this.GetParentScope(value);
|
|
1994
|
-
return observableScope_1.ObservableScope.Value(scope);
|
|
1995
|
-
}
|
|
1996
|
-
return pre && pre[curr];
|
|
1997
|
-
}, null);
|
|
1998
|
-
return val;
|
|
1999
|
-
}
|
|
2000
|
-
GetPathOf(value) {
|
|
2001
|
-
if (value.toJSON && typeof value.toJSON === 'function')
|
|
2002
|
-
value = value.toJSON();
|
|
2003
|
-
return this.pathCache.get(value);
|
|
2004
|
-
}
|
|
2005
|
-
Scope(path, callback) {
|
|
2006
|
-
return new observableScope_1.ObservableScope(() => {
|
|
2007
|
-
const obj = this.Get(path);
|
|
2008
|
-
return callback && callback(obj) || obj;
|
|
2009
|
-
});
|
|
2010
|
-
}
|
|
2011
|
-
Write(path, value) {
|
|
2012
|
-
const scope = this.WritePath(path, value);
|
|
2013
|
-
observableScope_1.ObservableScope.Update(scope);
|
|
2014
|
-
}
|
|
2015
|
-
WriteAll(data) {
|
|
2016
|
-
const scopeSet = new Set();
|
|
2017
|
-
for (var x = 0; x < data.length; x++) {
|
|
2018
|
-
const scope = this.WritePath(data[x].path, data[x].value);
|
|
2019
|
-
scopeSet.add(scope);
|
|
2020
|
-
}
|
|
2021
|
-
scopeSet.forEach(scope => observableScope_1.ObservableScope.Update(scope));
|
|
2022
|
-
}
|
|
2023
|
-
GetParentScope(value) {
|
|
2024
|
-
if (value === undefined)
|
|
2025
|
-
return this.undefinedScope;
|
|
2026
|
-
let scope = this.scopeCache.get(value);
|
|
2027
|
-
if (!scope) {
|
|
2028
|
-
scope = observableScope_1.ObservableScope.Create(() => this.GetValueProxy(value));
|
|
2029
|
-
this.scopeCache.set(value, scope);
|
|
2030
|
-
}
|
|
2031
|
-
return scope;
|
|
2032
|
-
}
|
|
2033
|
-
GetPropertyScope(parent, prop) {
|
|
2034
|
-
const value = parent[prop];
|
|
2035
|
-
const type = TypeOf(value);
|
|
2036
|
-
if (type === Type.Value) {
|
|
2037
|
-
let leafScopes = this.leafScopeCache.get(parent) || {};
|
|
2038
|
-
leafScopes[prop] = leafScopes[prop] || observableScope_1.ObservableScope.Create(() => {
|
|
2039
|
-
const parentScope = this.scopeCache.get(parent);
|
|
2040
|
-
const parentValue = observableScope_1.ObservableScope.Value(parentScope);
|
|
2041
|
-
const parentJson = parentValue.toJSON();
|
|
2042
|
-
const currentValue = parentJson[prop];
|
|
2043
|
-
let path;
|
|
2044
|
-
if (this.valuePathResolver && typeof currentValue === 'string' && (path = this.valuePathResolver(currentValue)))
|
|
2045
|
-
return this.Get(path);
|
|
2046
|
-
return currentValue;
|
|
2047
|
-
});
|
|
2048
|
-
this.leafScopeCache.set(parent, leafScopes);
|
|
2049
|
-
return leafScopes[prop];
|
|
2050
|
-
}
|
|
2051
|
-
else {
|
|
2052
|
-
let scope = this.scopeCache.get(value);
|
|
2053
|
-
if (!scope) {
|
|
2054
|
-
scope = observableScope_1.ObservableScope.Create(() => {
|
|
2055
|
-
const parentScope = this.scopeCache.get(parent);
|
|
2056
|
-
const parentValue = observableScope_1.ObservableScope.Value(parentScope);
|
|
2057
|
-
const parentJson = parentValue.toJSON();
|
|
2058
|
-
const currentValue = parentJson[prop];
|
|
2059
|
-
return this.GetValueProxy(currentValue);
|
|
2060
|
-
});
|
|
2061
|
-
this.scopeCache.set(value, scope);
|
|
2062
|
-
}
|
|
2063
|
-
return scope;
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
GetValueProxy(value) {
|
|
2067
|
-
let proxy = this.proxyCache.get(value);
|
|
2068
|
-
if (!proxy) {
|
|
2069
|
-
proxy = this.CreateProxy(value);
|
|
2070
|
-
this.proxyCache.set(value, proxy);
|
|
2071
|
-
}
|
|
2072
|
-
return proxy;
|
|
2073
|
-
}
|
|
2074
|
-
ObjectProxyGetter = (value, prop) => {
|
|
2075
|
-
function toJSON() {
|
|
2076
|
-
return value;
|
|
2077
|
-
}
|
|
2078
|
-
;
|
|
2079
|
-
switch (prop) {
|
|
2080
|
-
case "toJSON":
|
|
2081
|
-
return toJSON;
|
|
2082
|
-
default:
|
|
2083
|
-
if (typeof prop === 'symbol')
|
|
2084
|
-
return value[prop];
|
|
2085
|
-
return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));
|
|
2086
|
-
}
|
|
2087
|
-
};
|
|
2088
|
-
CreateObjectProxy(value) {
|
|
2089
|
-
return new Proxy(value, {
|
|
2090
|
-
get: this.ObjectProxyGetter
|
|
2091
|
-
});
|
|
2092
|
-
}
|
|
2093
|
-
ArrayProxyGetter = (value, prop) => {
|
|
2094
|
-
function toJSON() {
|
|
2095
|
-
return value;
|
|
2096
|
-
}
|
|
2097
|
-
;
|
|
2098
|
-
switch (prop) {
|
|
2099
|
-
case "toJSON":
|
|
2100
|
-
return toJSON;
|
|
2101
|
-
default:
|
|
2102
|
-
if (typeof prop === 'symbol')
|
|
2103
|
-
return value[prop];
|
|
2104
|
-
if (isNaN(parseInt(prop))) {
|
|
2105
|
-
const ret = value[prop];
|
|
2106
|
-
if (typeof ret === 'function') {
|
|
2107
|
-
const copy = value.map((val, index) => observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, index.toString())));
|
|
2108
|
-
return ret.bind(copy);
|
|
2109
|
-
}
|
|
2110
|
-
return ret;
|
|
2111
|
-
}
|
|
2112
|
-
return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));
|
|
2113
|
-
}
|
|
2114
|
-
};
|
|
2115
|
-
CreateArrayProxy(value) {
|
|
2116
|
-
return new Proxy(value, {
|
|
2117
|
-
get: this.ArrayProxyGetter
|
|
2118
|
-
});
|
|
2119
|
-
}
|
|
2120
|
-
CreateProxy(value) {
|
|
2121
|
-
const type = TypeOf(value);
|
|
2122
|
-
switch (type) {
|
|
2123
|
-
case Type.Object:
|
|
2124
|
-
return this.CreateObjectProxy(value);
|
|
2125
|
-
case Type.Array:
|
|
2126
|
-
return this.CreateArrayProxy(value);
|
|
2127
|
-
default:
|
|
2128
|
-
return value;
|
|
2129
|
-
}
|
|
2130
|
-
}
|
|
2131
|
-
WritePath(path, value) {
|
|
2132
|
-
this.UpdatePathCache(path, value);
|
|
2133
|
-
const pathParts = path.split(".");
|
|
2134
|
-
if (pathParts.length === 1) {
|
|
2135
|
-
const currentValue = this.rootStateMap.get(pathParts[0]);
|
|
2136
|
-
this.rootStateMap.set(pathParts[0], value);
|
|
2137
|
-
return currentValue === undefined ? this.undefinedScope : this.scopeCache.get(currentValue);
|
|
2138
|
-
}
|
|
2139
|
-
let parentValue;
|
|
2140
|
-
let x = 0;
|
|
2141
|
-
for (; x < pathParts.length - 1 && (x === 0 || parentValue); x++) {
|
|
2142
|
-
if (x === 0)
|
|
2143
|
-
parentValue = this.rootStateMap.get(pathParts[x]);
|
|
2144
|
-
else
|
|
2145
|
-
parentValue = parentValue && parentValue[pathParts[x]];
|
|
2146
|
-
}
|
|
2147
|
-
if (!parentValue)
|
|
2148
|
-
throw new Error("Unable to write path: " + path + ". Falsey value found at: " + pathParts.slice(0, x).join("."));
|
|
2149
|
-
const prop = pathParts[x];
|
|
2150
|
-
const oldValue = parentValue[prop];
|
|
2151
|
-
const oldType = TypeOf(oldValue);
|
|
2152
|
-
parentValue[prop] = value;
|
|
2153
|
-
if (oldType !== Type.Value || Array.isArray(parentValue))
|
|
2154
|
-
return this.scopeCache.get(parentValue) || this.scopeCache.get(oldValue);
|
|
2155
|
-
const leafScopes = this.leafScopeCache.get(parentValue);
|
|
2156
|
-
return leafScopes && leafScopes[prop] || this.scopeCache.get(parentValue);
|
|
2157
|
-
}
|
|
2158
|
-
UpdatePathCache(path, value) {
|
|
2159
|
-
const type = TypeOf(value);
|
|
2160
|
-
if (type === Type.Value)
|
|
2161
|
-
return;
|
|
2162
|
-
this.pathCache.set(value, path);
|
|
2163
|
-
this.proxyCache.delete(value);
|
|
2164
|
-
this.scopeCache.delete(value);
|
|
2165
|
-
this.leafScopeCache.delete(value);
|
|
2166
|
-
const keys = Object.keys(value);
|
|
2167
|
-
for (let x = 0; x < keys.length; x++)
|
|
2168
|
-
this.UpdatePathCache(`${path}.${keys[x]}`, value[keys[x]]);
|
|
2169
|
-
return value;
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
exports.ObservableTree = ObservableTree;
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
/***/ }),
|
|
2176
|
-
|
|
2177
|
-
/***/ "./src/Store/index.ts":
|
|
2178
|
-
/*!****************************!*\
|
|
2179
|
-
!*** ./src/Store/index.ts ***!
|
|
2180
|
-
\****************************/
|
|
2181
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2185
|
-
exports.ObservableScope = exports.StoreAsync = exports.StoreSync = exports.Store = void 0;
|
|
2186
|
-
var store_1 = __webpack_require__(/*! ./Store/store */ "./src/Store/Store/store.ts");
|
|
2187
|
-
Object.defineProperty(exports, "Store", ({ enumerable: true, get: function () { return store_1.Store; } }));
|
|
2188
|
-
var storeSync_1 = __webpack_require__(/*! ./Store/storeSync */ "./src/Store/Store/storeSync.ts");
|
|
2189
|
-
Object.defineProperty(exports, "StoreSync", ({ enumerable: true, get: function () { return storeSync_1.StoreSync; } }));
|
|
2190
|
-
var storeAsync_1 = __webpack_require__(/*! ./Store/storeAsync */ "./src/Store/Store/storeAsync.ts");
|
|
2191
|
-
Object.defineProperty(exports, "StoreAsync", ({ enumerable: true, get: function () { return storeAsync_1.StoreAsync; } }));
|
|
2192
|
-
var observableScope_1 = __webpack_require__(/*! ./Tree/observableScope */ "./src/Store/Tree/observableScope.ts");
|
|
2193
|
-
Object.defineProperty(exports, "ObservableScope", ({ enumerable: true, get: function () { return observableScope_1.ObservableScope; } }));
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
/***/ }),
|
|
2197
|
-
|
|
2198
|
-
/***/ "./src/Utils/animation.ts":
|
|
2199
|
-
/*!********************************!*\
|
|
2200
|
-
!*** ./src/Utils/animation.ts ***!
|
|
2201
|
-
\********************************/
|
|
2202
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2206
|
-
exports.Animation = exports.AnimationType = void 0;
|
|
2207
|
-
var StepFunctions;
|
|
2208
|
-
(function (StepFunctions) {
|
|
2209
|
-
function* EaseIn(count) {
|
|
2210
|
-
var diff = 1 / count;
|
|
2211
|
-
for (var t = diff, x = 0; x < count; x++, t += diff)
|
|
2212
|
-
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;
|
|
2213
|
-
}
|
|
2214
|
-
StepFunctions.EaseIn = EaseIn;
|
|
2215
|
-
function* Linear(count) {
|
|
2216
|
-
var diff = 1 / count;
|
|
2217
|
-
for (var t = diff, x = 0; x < count; x++, t += diff)
|
|
2218
|
-
yield t;
|
|
2219
|
-
}
|
|
2220
|
-
StepFunctions.Linear = Linear;
|
|
2221
|
-
})(StepFunctions || (StepFunctions = {}));
|
|
2222
|
-
var AnimationType;
|
|
2223
|
-
(function (AnimationType) {
|
|
2224
|
-
AnimationType[AnimationType["Linear"] = 0] = "Linear";
|
|
2225
|
-
AnimationType[AnimationType["EaseIn"] = 1] = "EaseIn";
|
|
2226
|
-
})(AnimationType || (exports.AnimationType = AnimationType = {}));
|
|
2227
|
-
class Animation {
|
|
2228
|
-
type;
|
|
2229
|
-
frameCount;
|
|
2230
|
-
frameTimings;
|
|
2231
|
-
update;
|
|
2232
|
-
animationTimeouts;
|
|
2233
|
-
running;
|
|
2234
|
-
start;
|
|
2235
|
-
end;
|
|
2236
|
-
enabled;
|
|
2237
|
-
get Running() {
|
|
2238
|
-
return this.running;
|
|
2239
|
-
}
|
|
2240
|
-
get Start() {
|
|
2241
|
-
return this.start;
|
|
2242
|
-
}
|
|
2243
|
-
get End() {
|
|
2244
|
-
return this.end;
|
|
2245
|
-
}
|
|
2246
|
-
get Enabled() {
|
|
2247
|
-
return this.enabled;
|
|
2248
|
-
}
|
|
2249
|
-
constructor(type, duration, update) {
|
|
2250
|
-
this.running = false;
|
|
2251
|
-
this.start = null;
|
|
2252
|
-
this.end = null;
|
|
2253
|
-
this.enabled = true;
|
|
2254
|
-
this.type = type;
|
|
2255
|
-
this.frameCount = Math.ceil((duration / 1000) * 60);
|
|
2256
|
-
this.frameTimings = [];
|
|
2257
|
-
var frameTime = duration / this.frameCount;
|
|
2258
|
-
for (var x = 0; x < this.frameCount; x++)
|
|
2259
|
-
this.frameTimings[x] = (x + 1) * frameTime;
|
|
2260
|
-
this.update = update;
|
|
2261
|
-
this.animationTimeouts = [];
|
|
2262
|
-
}
|
|
2263
|
-
Animate(start, end) {
|
|
2264
|
-
if (!this.enabled)
|
|
2265
|
-
return;
|
|
2266
|
-
var diff = end - start;
|
|
2267
|
-
if (diff === 0)
|
|
2268
|
-
return;
|
|
2269
|
-
this.Cancel();
|
|
2270
|
-
this.running = true;
|
|
2271
|
-
this.start = start;
|
|
2272
|
-
this.end = end;
|
|
2273
|
-
return new Promise(resolve => {
|
|
2274
|
-
var stepFunc = StepFunctions[AnimationType[this.type]];
|
|
2275
|
-
var index = 0;
|
|
2276
|
-
for (var step of stepFunc(this.frameCount)) {
|
|
2277
|
-
var value = (step * diff) + start;
|
|
2278
|
-
this.SetTimeout(index, value, index === (this.frameCount - 1) ? resolve : null);
|
|
2279
|
-
index++;
|
|
2280
|
-
}
|
|
2281
|
-
}).then(() => {
|
|
2282
|
-
this.running = false;
|
|
2283
|
-
this.start = null;
|
|
2284
|
-
this.end = null;
|
|
2285
|
-
});
|
|
2286
|
-
}
|
|
2287
|
-
Disable() {
|
|
2288
|
-
this.Cancel();
|
|
2289
|
-
this.enabled = false;
|
|
2290
|
-
}
|
|
2291
|
-
Enable() {
|
|
2292
|
-
this.enabled = true;
|
|
2293
|
-
}
|
|
2294
|
-
Cancel() {
|
|
2295
|
-
for (var x = 0; x < this.animationTimeouts.length; x++)
|
|
2296
|
-
clearTimeout(this.animationTimeouts[x]);
|
|
2297
|
-
this.running = false;
|
|
2298
|
-
this.start = null;
|
|
2299
|
-
this.end = null;
|
|
2300
|
-
}
|
|
2301
|
-
Destroy() {
|
|
2302
|
-
this.Cancel();
|
|
2303
|
-
}
|
|
2304
|
-
SetTimeout(index, value, resolve) {
|
|
2305
|
-
this.animationTimeouts[index] = setTimeout(() => {
|
|
2306
|
-
this.update(value);
|
|
2307
|
-
resolve && resolve();
|
|
2308
|
-
}, this.frameTimings[index]);
|
|
2309
|
-
}
|
|
2310
|
-
}
|
|
2311
|
-
exports.Animation = Animation;
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
/***/ }),
|
|
2315
|
-
|
|
2316
|
-
/***/ "./src/Utils/asyncQueue.ts":
|
|
2317
|
-
/*!*********************************!*\
|
|
2318
|
-
!*** ./src/Utils/asyncQueue.ts ***!
|
|
2319
|
-
\*********************************/
|
|
2320
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2324
|
-
exports.AsyncQueue = void 0;
|
|
2325
|
-
const list_1 = __webpack_require__(/*! ./list */ "./src/Utils/list.ts");
|
|
2326
|
-
class AsyncQueue {
|
|
2327
|
-
running = false;
|
|
2328
|
-
queue = list_1.List.Create();
|
|
2329
|
-
Next(callback) {
|
|
2330
|
-
const ret = new Promise((resolve, reject) => {
|
|
2331
|
-
list_1.List.Add(this.queue, async function () {
|
|
2332
|
-
try {
|
|
2333
|
-
const ret = await callback();
|
|
2334
|
-
resolve(ret);
|
|
2335
|
-
}
|
|
2336
|
-
catch (e) {
|
|
2337
|
-
reject(e);
|
|
2338
|
-
}
|
|
2339
|
-
});
|
|
2340
|
-
});
|
|
2341
|
-
this.Start();
|
|
2342
|
-
return ret;
|
|
2343
|
-
}
|
|
2344
|
-
Stop() {
|
|
2345
|
-
list_1.List.Clear(this.queue);
|
|
2346
|
-
}
|
|
2347
|
-
Start() {
|
|
2348
|
-
if (this.running)
|
|
2349
|
-
return;
|
|
2350
|
-
this.running = true;
|
|
2351
|
-
this.ExecuteQueue();
|
|
2352
|
-
}
|
|
2353
|
-
async ExecuteQueue() {
|
|
2354
|
-
const callback = list_1.List.Pop(this.queue);
|
|
2355
|
-
if (callback !== null) {
|
|
2356
|
-
await callback();
|
|
2357
|
-
this.ExecuteQueue();
|
|
2358
|
-
}
|
|
2359
|
-
else
|
|
2360
|
-
this.running = false;
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
exports.AsyncQueue = AsyncQueue;
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
/***/ }),
|
|
2367
|
-
|
|
2368
|
-
/***/ "./src/Utils/decorators.ts":
|
|
2369
|
-
/*!*********************************!*\
|
|
2370
|
-
!*** ./src/Utils/decorators.ts ***!
|
|
2371
|
-
\*********************************/
|
|
2372
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2376
|
-
exports.PreReq = exports.PreReqTemplate = exports.Destroy = exports.Inject = exports.ComputedAsync = exports.Computed = exports.DestroyScope = exports.Scope = exports.StateAsync = exports.StateSync = exports.State = void 0;
|
|
2377
|
-
const store_1 = __webpack_require__(/*! ../Store/Store/store */ "./src/Store/Store/store.ts");
|
|
2378
|
-
const Store_1 = __webpack_require__(/*! ../Store */ "./src/Store/index.ts");
|
|
2379
|
-
const observableScope_1 = __webpack_require__(/*! ../Store/Tree/observableScope */ "./src/Store/Tree/observableScope.ts");
|
|
2380
|
-
const observableTree_1 = __webpack_require__(/*! ../Store/Tree/observableTree */ "./src/Store/Tree/observableTree.ts");
|
|
2381
|
-
function State() {
|
|
2382
|
-
return StateDecorator;
|
|
2383
|
-
}
|
|
2384
|
-
exports.State = State;
|
|
2385
|
-
function StateDecorator(target, propertyKey) {
|
|
2386
|
-
const propKey = `StoreDecorator_${propertyKey}`;
|
|
2387
|
-
DestroyDecorator(target, propKey);
|
|
2388
|
-
return {
|
|
2389
|
-
configurable: false,
|
|
2390
|
-
enumerable: true,
|
|
2391
|
-
get: function () {
|
|
2392
|
-
var map = this.DecoratorMap;
|
|
2393
|
-
var store = map.get(propKey);
|
|
2394
|
-
const value = store && store.Root.Value;
|
|
2395
|
-
if (observableScope_1.ObservableScope.Watching())
|
|
2396
|
-
return value;
|
|
2397
|
-
return observableTree_1.ObservableTree.UnwrapProxyValues(value);
|
|
2398
|
-
},
|
|
2399
|
-
set: function (val) {
|
|
2400
|
-
var map = this.DecoratorMap;
|
|
2401
|
-
var store = map.get(propKey);
|
|
2402
|
-
if (!store)
|
|
2403
|
-
map.set(propKey, new store_1.Store(val));
|
|
2404
|
-
else
|
|
2405
|
-
store.Merge(val);
|
|
2406
|
-
}
|
|
2407
|
-
};
|
|
2408
|
-
}
|
|
2409
|
-
function StateSync() {
|
|
2410
|
-
return StateSyncDecorator;
|
|
2411
|
-
}
|
|
2412
|
-
exports.StateSync = StateSync;
|
|
2413
|
-
function StateSyncDecorator(target, propertyKey) {
|
|
2414
|
-
const propKey = `StoreSyncDecorator_${propertyKey}`;
|
|
2415
|
-
DestroyDecorator(target, propKey);
|
|
2416
|
-
return {
|
|
2417
|
-
configurable: false,
|
|
2418
|
-
enumerable: true,
|
|
2419
|
-
get: function () {
|
|
2420
|
-
var map = this.DecoratorMap;
|
|
2421
|
-
var store = map.get(propKey);
|
|
2422
|
-
const value = store && store.Root.Value;
|
|
2423
|
-
if (observableScope_1.ObservableScope.Watching())
|
|
2424
|
-
return value;
|
|
2425
|
-
return observableTree_1.ObservableTree.UnwrapProxyValues(value);
|
|
2426
|
-
},
|
|
2427
|
-
set: function (val) {
|
|
2428
|
-
var map = this.DecoratorMap;
|
|
2429
|
-
var store = map.get(propKey);
|
|
2430
|
-
if (!store)
|
|
2431
|
-
map.set(propKey, new Store_1.StoreSync(val));
|
|
2432
|
-
else
|
|
2433
|
-
store.Merge(val);
|
|
2434
|
-
}
|
|
2435
|
-
};
|
|
2436
|
-
}
|
|
2437
|
-
function StateAsync() {
|
|
2438
|
-
return StateAsyncDecorator;
|
|
2439
|
-
}
|
|
2440
|
-
exports.StateAsync = StateAsync;
|
|
2441
|
-
function StateAsyncDecorator(target, propertyKey) {
|
|
2442
|
-
const propKey = `StoreAsyncDecorator_${propertyKey}`;
|
|
2443
|
-
const scopeKey = `StoreAsyncDecorator_Scope_${propertyKey}`;
|
|
2444
|
-
DestroyDecorator(target, propKey);
|
|
2445
|
-
DestroyDecorator(target, scopeKey);
|
|
2446
|
-
return {
|
|
2447
|
-
configurable: false,
|
|
2448
|
-
enumerable: true,
|
|
2449
|
-
get: function () {
|
|
2450
|
-
var map = this.DecoratorMap;
|
|
2451
|
-
var scope = map.get(scopeKey);
|
|
2452
|
-
const value = scope && scope.Value;
|
|
2453
|
-
if (observableScope_1.ObservableScope.Watching())
|
|
2454
|
-
return value;
|
|
2455
|
-
return observableTree_1.ObservableTree.UnwrapProxyValues(value);
|
|
2456
|
-
},
|
|
2457
|
-
set: function (val) {
|
|
2458
|
-
var map = this.DecoratorMap;
|
|
2459
|
-
var store = map.get(propKey);
|
|
2460
|
-
if (!store) {
|
|
2461
|
-
store = new Store_1.StoreAsync((val) => val.___id, { ___id: "ROOT", data: val });
|
|
2462
|
-
map.set(propKey, store);
|
|
2463
|
-
map.set(scopeKey, store.Scope("ROOT", val => val.data));
|
|
2464
|
-
}
|
|
2465
|
-
else
|
|
2466
|
-
store.Action("ROOT", async (root, writer) => await writer.Merge(root.data, val));
|
|
2467
|
-
}
|
|
2468
|
-
};
|
|
2469
|
-
}
|
|
2470
|
-
function Scope() {
|
|
2471
|
-
return ScopeDecorator;
|
|
2472
|
-
}
|
|
2473
|
-
exports.Scope = Scope;
|
|
2474
|
-
function ScopeDecorator(target, propertyKey, descriptor) {
|
|
2475
|
-
if (!(descriptor && descriptor.get))
|
|
2476
|
-
throw "Scope decorator requires a getter";
|
|
2477
|
-
if (descriptor && descriptor.set)
|
|
2478
|
-
throw "Scope decorator does not support setters";
|
|
2479
|
-
const propKey = `ScopeDecorator_${propertyKey}`;
|
|
2480
|
-
DestroyDecorator(target, propKey);
|
|
2481
|
-
return {
|
|
2482
|
-
configurable: false,
|
|
2483
|
-
enumerable: true,
|
|
2484
|
-
get: function () {
|
|
2485
|
-
var map = this.DecoratorMap;
|
|
2486
|
-
var scope = map.get(propKey);
|
|
2487
|
-
if (!scope) {
|
|
2488
|
-
const getter = descriptor.get.bind(this);
|
|
2489
|
-
scope = new observableScope_1.ObservableScope(getter);
|
|
2490
|
-
map.set(propKey, scope);
|
|
2491
|
-
}
|
|
2492
|
-
return scope.Value;
|
|
2493
|
-
}
|
|
2494
|
-
};
|
|
2495
|
-
}
|
|
2496
|
-
function DestroyScope() {
|
|
2497
|
-
return DestroyScopeDecorator;
|
|
2498
|
-
}
|
|
2499
|
-
exports.DestroyScope = DestroyScope;
|
|
2500
|
-
function DestroyScopeDecorator(target, propertyKey, descriptor) {
|
|
2501
|
-
if (!(descriptor && descriptor.get))
|
|
2502
|
-
throw "Destroy Scope decorator requires a getter";
|
|
2503
|
-
if (descriptor && descriptor.set)
|
|
2504
|
-
throw "Destroy Scope decorator does not support setters";
|
|
2505
|
-
const propKey = `ScopeDecorator_${propertyKey}`;
|
|
2506
|
-
DestroyDecorator(target, propKey);
|
|
2507
|
-
const valKey = `ScopeDecorator_${propertyKey}_Value`;
|
|
2508
|
-
DestroyDecorator(target, valKey);
|
|
2509
|
-
return {
|
|
2510
|
-
configurable: false,
|
|
2511
|
-
enumerable: true,
|
|
2512
|
-
get: function () {
|
|
2513
|
-
var map = this.DecoratorMap;
|
|
2514
|
-
var scope = map.get(propKey);
|
|
2515
|
-
if (!scope) {
|
|
2516
|
-
const getter = descriptor.get.bind(this);
|
|
2517
|
-
scope = new observableScope_1.ObservableScope(getter);
|
|
2518
|
-
map.set(propKey, scope);
|
|
2519
|
-
scope.Watch(scope => {
|
|
2520
|
-
var lastValue = map.get(valKey);
|
|
2521
|
-
lastValue && lastValue.Destroy();
|
|
2522
|
-
map.set(valKey, scope.Value);
|
|
2523
|
-
});
|
|
2524
|
-
}
|
|
2525
|
-
return scope.Value;
|
|
2526
|
-
}
|
|
2527
|
-
};
|
|
2528
|
-
}
|
|
2529
|
-
function Computed() {
|
|
2530
|
-
return ComputedDecorator;
|
|
2531
|
-
}
|
|
2532
|
-
exports.Computed = Computed;
|
|
2533
|
-
function ComputedDecorator(target, propertyKey, descriptor) {
|
|
2534
|
-
if (!(descriptor && descriptor.get))
|
|
2535
|
-
throw "Computed decorator requires a getter";
|
|
2536
|
-
if (descriptor && descriptor.set)
|
|
2537
|
-
throw "Computed decorator does not support setters";
|
|
2538
|
-
const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;
|
|
2539
|
-
const storeKey = `ComputedDecorator_Store_${propertyKey}`;
|
|
2540
|
-
DestroyDecorator(target, scopeKey);
|
|
2541
|
-
DestroyDecorator(target, storeKey);
|
|
2542
|
-
return {
|
|
2543
|
-
configurable: false,
|
|
2544
|
-
enumerable: true,
|
|
2545
|
-
get: function () {
|
|
2546
|
-
var map = this.DecoratorMap;
|
|
2547
|
-
var store = map.get(storeKey);
|
|
2548
|
-
if (!store) {
|
|
2549
|
-
const getter = descriptor.get.bind(this);
|
|
2550
|
-
const scope = new observableScope_1.ObservableScope(getter);
|
|
2551
|
-
store = new Store_1.StoreSync(scope.Value);
|
|
2552
|
-
scope.Watch(scope => {
|
|
2553
|
-
if (!this.Destroyed)
|
|
2554
|
-
store.Write(scope.Value);
|
|
2555
|
-
});
|
|
2556
|
-
map.set(scopeKey, scope);
|
|
2557
|
-
map.set(storeKey, store);
|
|
2558
|
-
}
|
|
2559
|
-
return store.Root.Value;
|
|
2560
|
-
}
|
|
2561
|
-
};
|
|
2562
|
-
}
|
|
2563
|
-
function ComputedAsync(idFunc) {
|
|
2564
|
-
return ComputedAsyncDecorator.bind(null, idFunc);
|
|
2565
|
-
}
|
|
2566
|
-
exports.ComputedAsync = ComputedAsync;
|
|
2567
|
-
function ComputedAsyncDecorator(idFunc, target, propertyKey, descriptor) {
|
|
2568
|
-
if (!(descriptor && descriptor.get))
|
|
2569
|
-
throw "ComputedAsync decorator requires a getter";
|
|
2570
|
-
if (descriptor && descriptor.set)
|
|
2571
|
-
throw "ComputedAsync decorator does not support setters";
|
|
2572
|
-
const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;
|
|
2573
|
-
const storeKey = `ComputedDecorator_Store_${propertyKey}`;
|
|
2574
|
-
const storeScopeKey = `ComputedDecorator_StoreScope_${propertyKey}`;
|
|
2575
|
-
DestroyDecorator(target, scopeKey);
|
|
2576
|
-
DestroyDecorator(target, storeKey);
|
|
2577
|
-
DestroyDecorator(target, storeScopeKey);
|
|
2578
|
-
return {
|
|
2579
|
-
configurable: false,
|
|
2580
|
-
enumerable: true,
|
|
2581
|
-
get: function () {
|
|
2582
|
-
var map = this.DecoratorMap;
|
|
2583
|
-
var storeScope = map.get(storeScopeKey);
|
|
2584
|
-
if (!storeScope) {
|
|
2585
|
-
const getter = descriptor.get.bind(this);
|
|
2586
|
-
const scope = new observableScope_1.ObservableScope(() => {
|
|
2587
|
-
var value = getter();
|
|
2588
|
-
if (value && typeof value.toJSON === 'function')
|
|
2589
|
-
value = value.toJSON();
|
|
2590
|
-
return value;
|
|
2591
|
-
});
|
|
2592
|
-
const store = new Store_1.StoreAsync((val) => val._id, { _id: "ROOT", data: scope.Value });
|
|
2593
|
-
scope.Watch(scope => {
|
|
2594
|
-
if (!this.Destroyed)
|
|
2595
|
-
store.Write({ _id: "ROOT", data: scope.Value });
|
|
2596
|
-
});
|
|
2597
|
-
storeScope = store.Scope("ROOT", (val) => val.data);
|
|
2598
|
-
map.set(storeScopeKey, storeScope);
|
|
2599
|
-
map.set(scopeKey, scope);
|
|
2600
|
-
map.set(storeKey, store);
|
|
2601
|
-
}
|
|
2602
|
-
return storeScope.Value;
|
|
2603
|
-
}
|
|
2604
|
-
};
|
|
2605
|
-
}
|
|
2606
|
-
function Inject(type) {
|
|
2607
|
-
return InjectorDecorator.bind(null, type);
|
|
2608
|
-
}
|
|
2609
|
-
exports.Inject = Inject;
|
|
2610
|
-
function InjectorDecorator(type, target, propertyKey, descriptor) {
|
|
2611
|
-
return {
|
|
2612
|
-
configurable: false,
|
|
2613
|
-
enumerable: true,
|
|
2614
|
-
get: function () {
|
|
2615
|
-
return this.Injector.Get(type);
|
|
2616
|
-
},
|
|
2617
|
-
set: function (val) {
|
|
2618
|
-
this.Injector.Set(type, val);
|
|
2619
|
-
}
|
|
2620
|
-
};
|
|
2621
|
-
}
|
|
2622
|
-
function Destroy() {
|
|
2623
|
-
return DestroyDecorator;
|
|
2624
|
-
}
|
|
2625
|
-
exports.Destroy = Destroy;
|
|
2626
|
-
(function (Destroy) {
|
|
2627
|
-
function Get(value) {
|
|
2628
|
-
return value && value.DestroyDecorator_Destroys || [];
|
|
2629
|
-
}
|
|
2630
|
-
function All(value) {
|
|
2631
|
-
var arr = Get(value);
|
|
2632
|
-
arr.map(prop => (value[prop] || value.DecoratorMap.get(prop)))
|
|
2633
|
-
.filter(o => !!o)
|
|
2634
|
-
.forEach(o => o.Destroy());
|
|
2635
|
-
}
|
|
2636
|
-
Destroy.All = All;
|
|
2637
|
-
})(Destroy || (exports.Destroy = Destroy = {}));
|
|
2638
|
-
function DestroyDecorator(target, propertyKey) {
|
|
2639
|
-
var proto = target;
|
|
2640
|
-
proto.DestroyDecorator_Destroys = proto.DestroyDecorator_Destroys || [];
|
|
2641
|
-
proto.DestroyDecorator_Destroys.push(propertyKey);
|
|
2642
|
-
}
|
|
2643
|
-
function PreReqTemplate(template) {
|
|
2644
|
-
return PreReqTemplateDecorator.bind(null, template);
|
|
2645
|
-
}
|
|
2646
|
-
exports.PreReqTemplate = PreReqTemplate;
|
|
2647
|
-
(function (PreReqTemplate) {
|
|
2648
|
-
function Get(value) {
|
|
2649
|
-
var func = value && value.PreReqTemplateDecorator_Template;
|
|
2650
|
-
var ret = func ? func() : [];
|
|
2651
|
-
if (!Array.isArray(ret))
|
|
2652
|
-
ret = [ret];
|
|
2653
|
-
return ret;
|
|
2654
|
-
}
|
|
2655
|
-
PreReqTemplate.Get = Get;
|
|
2656
|
-
})(PreReqTemplate || (exports.PreReqTemplate = PreReqTemplate = {}));
|
|
2657
|
-
function PreReqTemplateDecorator(template, target) {
|
|
2658
|
-
var proto = target.prototype;
|
|
2659
|
-
proto.PreReqTemplateDecorator_Template = template;
|
|
2660
|
-
}
|
|
2661
|
-
function PreReq() {
|
|
2662
|
-
return PreReqDecorator;
|
|
2663
|
-
}
|
|
2664
|
-
exports.PreReq = PreReq;
|
|
2665
|
-
(function (PreReq) {
|
|
2666
|
-
function Get(value) {
|
|
2667
|
-
return value && value.PreReqDecorator_PreReqs || [];
|
|
2668
|
-
}
|
|
2669
|
-
function All(value) {
|
|
2670
|
-
var arr = Get(value).map((prop) => (value[prop] && value[prop].Init) || Promise.resolve());
|
|
2671
|
-
return Promise.all(arr);
|
|
2672
|
-
}
|
|
2673
|
-
PreReq.All = All;
|
|
2674
|
-
function Has(value) {
|
|
2675
|
-
return Get(value).length > 0;
|
|
2676
|
-
}
|
|
2677
|
-
PreReq.Has = Has;
|
|
2678
|
-
})(PreReq || (exports.PreReq = PreReq = {}));
|
|
2679
|
-
function PreReqDecorator(target, propertyKey) {
|
|
2680
|
-
var proto = target;
|
|
2681
|
-
proto.PreReqDecorator_PreReqs = proto.PreReqDecorator_PreReqs || [];
|
|
2682
|
-
proto.PreReqDecorator_PreReqs.push(propertyKey);
|
|
2683
|
-
}
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
/***/ }),
|
|
2687
|
-
|
|
2688
|
-
/***/ "./src/Utils/emitter.ts":
|
|
2689
|
-
/*!******************************!*\
|
|
2690
|
-
!*** ./src/Utils/emitter.ts ***!
|
|
2691
|
-
\******************************/
|
|
2692
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2696
|
-
exports.Emitter = void 0;
|
|
2697
|
-
var Emitter;
|
|
2698
|
-
(function (Emitter) {
|
|
2699
|
-
function Create() {
|
|
2700
|
-
return new Set();
|
|
2701
|
-
}
|
|
2702
|
-
Emitter.Create = Create;
|
|
2703
|
-
function On(emitter, callback) {
|
|
2704
|
-
emitter.add(callback);
|
|
2705
|
-
}
|
|
2706
|
-
Emitter.On = On;
|
|
2707
|
-
function Emit(emitter, ...args) {
|
|
2708
|
-
emitter.forEach(function (cb) {
|
|
2709
|
-
cb(...args);
|
|
2710
|
-
});
|
|
2711
|
-
}
|
|
2712
|
-
Emitter.Emit = Emit;
|
|
2713
|
-
function Remove(emitter, callback) {
|
|
2714
|
-
emitter.delete(callback);
|
|
2715
|
-
}
|
|
2716
|
-
Emitter.Remove = Remove;
|
|
2717
|
-
})(Emitter || (exports.Emitter = Emitter = {}));
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
/***/ }),
|
|
2721
|
-
|
|
2722
|
-
/***/ "./src/Utils/index.ts":
|
|
2723
|
-
/*!****************************!*\
|
|
2724
|
-
!*** ./src/Utils/index.ts ***!
|
|
2725
|
-
\****************************/
|
|
2726
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2730
|
-
if (k2 === undefined) k2 = k;
|
|
2731
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2732
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2733
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2734
|
-
}
|
|
2735
|
-
Object.defineProperty(o, k2, desc);
|
|
2736
|
-
}) : (function(o, m, k, k2) {
|
|
2737
|
-
if (k2 === undefined) k2 = k;
|
|
2738
|
-
o[k2] = m[k];
|
|
2739
|
-
}));
|
|
2740
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
2741
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
2742
|
-
};
|
|
2743
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2744
|
-
__exportStar(__webpack_require__(/*! ./decorators */ "./src/Utils/decorators.ts"), exports);
|
|
2745
|
-
__exportStar(__webpack_require__(/*! ./animation */ "./src/Utils/animation.ts"), exports);
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
/***/ }),
|
|
2749
|
-
|
|
2750
|
-
/***/ "./src/Utils/injector.ts":
|
|
2751
|
-
/*!*******************************!*\
|
|
2752
|
-
!*** ./src/Utils/injector.ts ***!
|
|
2753
|
-
\*******************************/
|
|
2754
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2758
|
-
exports.Injector = void 0;
|
|
2759
|
-
class Injector {
|
|
2760
|
-
parent;
|
|
2761
|
-
typeMap;
|
|
2762
|
-
constructor() {
|
|
2763
|
-
this.parent = Injector.Current();
|
|
2764
|
-
this.typeMap = new Map();
|
|
2765
|
-
}
|
|
2766
|
-
Get(type) {
|
|
2767
|
-
if (this.typeMap.size === 0)
|
|
2768
|
-
return this.parent && this.parent.Get(type);
|
|
2769
|
-
var ret = this.typeMap.get(type);
|
|
2770
|
-
if (!ret)
|
|
2771
|
-
ret = this.parent && this.parent.Get(type);
|
|
2772
|
-
return ret;
|
|
2773
|
-
}
|
|
2774
|
-
Set(type, instance) {
|
|
2775
|
-
this.typeMap.set(type, instance);
|
|
2776
|
-
}
|
|
2777
|
-
}
|
|
2778
|
-
exports.Injector = Injector;
|
|
2779
|
-
(function (Injector) {
|
|
2780
|
-
var scope = null;
|
|
2781
|
-
function Current() {
|
|
2782
|
-
return scope;
|
|
2783
|
-
}
|
|
2784
|
-
Injector.Current = Current;
|
|
2785
|
-
function Scope(injector, action, ...args) {
|
|
2786
|
-
var parent = Current();
|
|
2787
|
-
scope = injector;
|
|
2788
|
-
const ret = action(...args);
|
|
2789
|
-
scope = parent;
|
|
2790
|
-
return ret;
|
|
2791
|
-
}
|
|
2792
|
-
Injector.Scope = Scope;
|
|
2793
|
-
})(Injector || (exports.Injector = Injector = {}));
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
/***/ }),
|
|
2797
|
-
|
|
2798
|
-
/***/ "./src/Utils/list.ts":
|
|
2799
|
-
/*!***************************!*\
|
|
2800
|
-
!*** ./src/Utils/list.ts ***!
|
|
2801
|
-
\***************************/
|
|
2802
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2806
|
-
exports.List = void 0;
|
|
2807
|
-
var List;
|
|
2808
|
-
(function (List) {
|
|
2809
|
-
function Create() {
|
|
2810
|
-
return {
|
|
2811
|
-
head: null,
|
|
2812
|
-
tail: null,
|
|
2813
|
-
size: 0
|
|
2814
|
-
};
|
|
2815
|
-
}
|
|
2816
|
-
List.Create = Create;
|
|
2817
|
-
function Clear(list) {
|
|
2818
|
-
list.head = null;
|
|
2819
|
-
list.tail = null;
|
|
2820
|
-
list.size = 0;
|
|
2821
|
-
}
|
|
2822
|
-
List.Clear = Clear;
|
|
2823
|
-
function Push(list, data) {
|
|
2824
|
-
var node = { previous: null, next: null, data: data };
|
|
2825
|
-
if (list.size === 0) {
|
|
2826
|
-
list.head = node;
|
|
2827
|
-
list.tail = node;
|
|
2828
|
-
list.size = 1;
|
|
2829
|
-
}
|
|
2830
|
-
else {
|
|
2831
|
-
node.next = list.head;
|
|
2832
|
-
list.head.previous = node;
|
|
2833
|
-
list.head = node;
|
|
2834
|
-
list.size++;
|
|
2835
|
-
}
|
|
2836
|
-
return node;
|
|
2837
|
-
}
|
|
2838
|
-
List.Push = Push;
|
|
2839
|
-
function Pop(list) {
|
|
2840
|
-
if (list.size === 0)
|
|
2841
|
-
return null;
|
|
2842
|
-
var node = list.head;
|
|
2843
|
-
list.head = node.next;
|
|
2844
|
-
if (list.head)
|
|
2845
|
-
list.head.previous = null;
|
|
2846
|
-
list.size--;
|
|
2847
|
-
if (list.size === 0)
|
|
2848
|
-
list.tail = null;
|
|
2849
|
-
return node.data;
|
|
2850
|
-
}
|
|
2851
|
-
List.Pop = Pop;
|
|
2852
|
-
function Add(list, data) {
|
|
2853
|
-
const node = { previous: null, next: null, data: data };
|
|
2854
|
-
return AddNode(list, node);
|
|
2855
|
-
}
|
|
2856
|
-
List.Add = Add;
|
|
2857
|
-
function AddNode(list, node) {
|
|
2858
|
-
if (list.size === 0) {
|
|
2859
|
-
list.head = node;
|
|
2860
|
-
list.tail = node;
|
|
2861
|
-
list.size = 1;
|
|
2862
|
-
}
|
|
2863
|
-
else {
|
|
2864
|
-
node.previous = list.tail;
|
|
2865
|
-
list.tail.next = node;
|
|
2866
|
-
list.tail = node;
|
|
2867
|
-
list.size++;
|
|
2868
|
-
}
|
|
2869
|
-
return node;
|
|
2870
|
-
}
|
|
2871
|
-
List.AddNode = AddNode;
|
|
2872
|
-
function AddBefore(list, node, data) {
|
|
2873
|
-
if (!node)
|
|
2874
|
-
return List.Add(list, data);
|
|
2875
|
-
var newNode = { previous: null, next: null, data: data };
|
|
2876
|
-
var prevNode = node.previous;
|
|
2877
|
-
newNode.next = node;
|
|
2878
|
-
node.previous = newNode;
|
|
2879
|
-
if (list.head === node)
|
|
2880
|
-
list.head = newNode;
|
|
2881
|
-
if (prevNode) {
|
|
2882
|
-
prevNode.next = newNode;
|
|
2883
|
-
newNode.previous = prevNode;
|
|
2884
|
-
}
|
|
2885
|
-
list.size++;
|
|
2886
|
-
return newNode;
|
|
2887
|
-
}
|
|
2888
|
-
List.AddBefore = AddBefore;
|
|
2889
|
-
function AddAfter(list, node, data) {
|
|
2890
|
-
if (!node)
|
|
2891
|
-
return List.Push(list, data);
|
|
2892
|
-
var newNode = { previous: null, next: null, data: data };
|
|
2893
|
-
var nextNode = node.next;
|
|
2894
|
-
node.next = newNode;
|
|
2895
|
-
newNode.previous = node;
|
|
2896
|
-
if (list.tail === node)
|
|
2897
|
-
list.tail = newNode;
|
|
2898
|
-
if (nextNode) {
|
|
2899
|
-
nextNode.previous = newNode;
|
|
2900
|
-
newNode.next = nextNode;
|
|
2901
|
-
}
|
|
2902
|
-
list.size++;
|
|
2903
|
-
return newNode;
|
|
2904
|
-
}
|
|
2905
|
-
List.AddAfter = AddAfter;
|
|
2906
|
-
function Remove(list) {
|
|
2907
|
-
if (list.size === 0)
|
|
2908
|
-
return null;
|
|
2909
|
-
var node = list.tail;
|
|
2910
|
-
list.tail = node.previous;
|
|
2911
|
-
if (list.tail)
|
|
2912
|
-
list.tail.next = null;
|
|
2913
|
-
list.size--;
|
|
2914
|
-
if (list.size === 0)
|
|
2915
|
-
list.head = null;
|
|
2916
|
-
return node.data;
|
|
2917
|
-
}
|
|
2918
|
-
List.Remove = Remove;
|
|
2919
|
-
function RemoveNode(list, node) {
|
|
2920
|
-
if (list.head === node) {
|
|
2921
|
-
list.head = node.next;
|
|
2922
|
-
}
|
|
2923
|
-
else if (list.tail === node) {
|
|
2924
|
-
list.tail = node.previous;
|
|
2925
|
-
}
|
|
2926
|
-
else {
|
|
2927
|
-
const prev = node.previous;
|
|
2928
|
-
const next = node.next;
|
|
2929
|
-
prev.next = next;
|
|
2930
|
-
next.previous = prev;
|
|
2931
|
-
}
|
|
2932
|
-
node.next = node.previous = null;
|
|
2933
|
-
list.size--;
|
|
2934
|
-
if (list.size > 0)
|
|
2935
|
-
list.head.previous = list.tail.next = null;
|
|
2936
|
-
}
|
|
2937
|
-
List.RemoveNode = RemoveNode;
|
|
2938
|
-
function ForEach(list, callback) {
|
|
2939
|
-
var node = list.head;
|
|
2940
|
-
while (node) {
|
|
2941
|
-
callback(node.data);
|
|
2942
|
-
node = node.next;
|
|
2943
|
-
}
|
|
2944
|
-
}
|
|
2945
|
-
List.ForEach = ForEach;
|
|
2946
|
-
function ToNodeMap(list, keyCallback) {
|
|
2947
|
-
const map = new Map();
|
|
2948
|
-
let node = list.head;
|
|
2949
|
-
while (node) {
|
|
2950
|
-
const key = keyCallback(node.data);
|
|
2951
|
-
const nodes = map.get(key) || [node];
|
|
2952
|
-
if (nodes[0] !== node)
|
|
2953
|
-
nodes.push(node);
|
|
2954
|
-
else
|
|
2955
|
-
map.set(key, nodes);
|
|
2956
|
-
node = node.next;
|
|
2957
|
-
}
|
|
2958
|
-
return map;
|
|
2959
|
-
}
|
|
2960
|
-
List.ToNodeMap = ToNodeMap;
|
|
2961
|
-
})(List || (exports.List = List = {}));
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
/***/ }),
|
|
2965
|
-
|
|
2966
|
-
/***/ "./src/Utils/thread.ts":
|
|
2967
|
-
/*!*****************************!*\
|
|
2968
|
-
!*** ./src/Utils/thread.ts ***!
|
|
2969
|
-
\*****************************/
|
|
2970
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2974
|
-
exports.ThreadAsync = exports.Thread = exports.Synch = exports.Callback = exports.After = exports.Schedule = void 0;
|
|
2975
|
-
const list_1 = __webpack_require__(/*! ./list */ "./src/Utils/list.ts");
|
|
2976
|
-
const workTimeMs = 16;
|
|
2977
|
-
const contextQueue = list_1.List.Create();
|
|
2978
|
-
var threadContext = null;
|
|
2979
|
-
var timeoutRunning = false;
|
|
2980
|
-
function ProcessQueue() {
|
|
2981
|
-
var workEndTime = Date.now() + workTimeMs;
|
|
2982
|
-
var ctx;
|
|
2983
|
-
while (Date.now() < workEndTime && (ctx = list_1.List.Pop(contextQueue)))
|
|
2984
|
-
DoWork(ctx, workEndTime);
|
|
2985
|
-
if (contextQueue.size > 0)
|
|
2986
|
-
setTimeout(ProcessQueue);
|
|
2987
|
-
else
|
|
2988
|
-
timeoutRunning = false;
|
|
2989
|
-
}
|
|
2990
|
-
function ScheduleWork(ctx) {
|
|
2991
|
-
list_1.List.Add(contextQueue, ctx);
|
|
2992
|
-
if (timeoutRunning)
|
|
2993
|
-
return;
|
|
2994
|
-
timeoutRunning = true;
|
|
2995
|
-
setTimeout(ProcessQueue);
|
|
2996
|
-
}
|
|
2997
|
-
function Invoke(ctx, callback) {
|
|
2998
|
-
var parent = ctx.workEndNode;
|
|
2999
|
-
ctx.workEndNode = ctx.workList.head;
|
|
3000
|
-
callback();
|
|
3001
|
-
ctx.workEndNode = parent;
|
|
3002
|
-
}
|
|
3003
|
-
function DoWork(ctx, workEndTime = Date.now() + workTimeMs) {
|
|
3004
|
-
var parentContext = threadContext;
|
|
3005
|
-
threadContext = ctx;
|
|
3006
|
-
var async = ctx.async;
|
|
3007
|
-
var callback;
|
|
3008
|
-
while (async === ctx.async && Date.now() < workEndTime && (callback = list_1.List.Pop(ctx.workList)))
|
|
3009
|
-
Invoke(ctx, callback);
|
|
3010
|
-
if (ctx.workList.size > 0)
|
|
3011
|
-
ScheduleWork(ctx);
|
|
3012
|
-
threadContext = parentContext;
|
|
3013
|
-
}
|
|
3014
|
-
function CreateContext() {
|
|
3015
|
-
return {
|
|
3016
|
-
async: false,
|
|
3017
|
-
workEndNode: null,
|
|
3018
|
-
workList: list_1.List.Create()
|
|
3019
|
-
};
|
|
3020
|
-
}
|
|
3021
|
-
function ScheduleCallback(callback, before, async) {
|
|
3022
|
-
threadContext = threadContext || CreateContext();
|
|
3023
|
-
threadContext.async = threadContext.async || async;
|
|
3024
|
-
if (before)
|
|
3025
|
-
list_1.List.AddBefore(threadContext.workList, threadContext.workEndNode, callback);
|
|
3026
|
-
else if (threadContext.workEndNode)
|
|
3027
|
-
list_1.List.AddAfter(threadContext.workList, threadContext.workEndNode, callback);
|
|
3028
|
-
else
|
|
3029
|
-
threadContext.workEndNode = list_1.List.Add(threadContext.workList, callback);
|
|
3030
|
-
}
|
|
3031
|
-
function SynchWithoutThread(callback) {
|
|
3032
|
-
var workEndTime = Date.now() + workTimeMs;
|
|
3033
|
-
callback();
|
|
3034
|
-
if (threadContext)
|
|
3035
|
-
if (threadContext.async)
|
|
3036
|
-
ScheduleWork(threadContext);
|
|
3037
|
-
else
|
|
3038
|
-
DoWork(threadContext, workEndTime);
|
|
3039
|
-
threadContext = null;
|
|
3040
|
-
}
|
|
3041
|
-
function Schedule(callback) {
|
|
3042
|
-
ScheduleCallback(callback, true, true);
|
|
3043
|
-
}
|
|
3044
|
-
exports.Schedule = Schedule;
|
|
3045
|
-
function After(callback) {
|
|
3046
|
-
ScheduleCallback(callback, false, false);
|
|
3047
|
-
}
|
|
3048
|
-
exports.After = After;
|
|
3049
|
-
function Callback(callback) {
|
|
3050
|
-
return function (a, b, c, d) {
|
|
3051
|
-
Schedule(function () { callback(a, b, c, d); });
|
|
3052
|
-
};
|
|
3053
|
-
}
|
|
3054
|
-
exports.Callback = Callback;
|
|
3055
|
-
var inSynchCallback = false;
|
|
3056
|
-
function Synch(callback) {
|
|
3057
|
-
if (threadContext || inSynchCallback)
|
|
3058
|
-
callback();
|
|
3059
|
-
else {
|
|
3060
|
-
inSynchCallback = true;
|
|
3061
|
-
SynchWithoutThread(callback);
|
|
3062
|
-
inSynchCallback = false;
|
|
3063
|
-
}
|
|
3064
|
-
}
|
|
3065
|
-
exports.Synch = Synch;
|
|
3066
|
-
function Thread(callback) {
|
|
3067
|
-
if (threadContext)
|
|
3068
|
-
ScheduleCallback(callback, true, false);
|
|
3069
|
-
else
|
|
3070
|
-
Synch(callback);
|
|
3071
|
-
}
|
|
3072
|
-
exports.Thread = Thread;
|
|
3073
|
-
function ThreadAsync(callback) {
|
|
3074
|
-
return new Promise(resolve => Thread(function () {
|
|
3075
|
-
callback();
|
|
3076
|
-
Thread(resolve);
|
|
3077
|
-
}));
|
|
3078
|
-
}
|
|
3079
|
-
exports.ThreadAsync = ThreadAsync;
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
/***/ }),
|
|
3083
|
-
|
|
3084
|
-
/***/ "./src/index.ts":
|
|
3085
|
-
/*!**********************!*\
|
|
3086
|
-
!*** ./src/index.ts ***!
|
|
3087
|
-
\**********************/
|
|
3088
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3092
|
-
exports.Component = void 0;
|
|
3093
|
-
var component_1 = __webpack_require__(/*! ./Node/component */ "./src/Node/component.ts");
|
|
3094
|
-
Object.defineProperty(exports, "Component", ({ enumerable: true, get: function () { return component_1.Component; } }));
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
/***/ }),
|
|
3098
|
-
|
|
3099
|
-
/***/ "./src/web.export.ts":
|
|
3100
|
-
/*!***************************!*\
|
|
3101
|
-
!*** ./src/web.export.ts ***!
|
|
3102
|
-
\***************************/
|
|
3103
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3107
|
-
if (k2 === undefined) k2 = k;
|
|
3108
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3109
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3110
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
3111
|
-
}
|
|
3112
|
-
Object.defineProperty(o, k2, desc);
|
|
3113
|
-
}) : (function(o, m, k, k2) {
|
|
3114
|
-
if (k2 === undefined) k2 = k;
|
|
3115
|
-
o[k2] = m[k];
|
|
3116
|
-
}));
|
|
3117
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
3118
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3119
|
-
};
|
|
3120
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3121
|
-
exports.StoreAsync = exports.Store = exports.ObservableScope = void 0;
|
|
3122
|
-
__exportStar(__webpack_require__(/*! ./index */ "./src/index.ts"), exports);
|
|
3123
|
-
__exportStar(__webpack_require__(/*! ./Utils */ "./src/Utils/index.ts"), exports);
|
|
3124
|
-
var Store_1 = __webpack_require__(/*! ./Store */ "./src/Store/index.ts");
|
|
3125
|
-
Object.defineProperty(exports, "ObservableScope", ({ enumerable: true, get: function () { return Store_1.ObservableScope; } }));
|
|
3126
|
-
Object.defineProperty(exports, "Store", ({ enumerable: true, get: function () { return Store_1.Store; } }));
|
|
3127
|
-
Object.defineProperty(exports, "StoreAsync", ({ enumerable: true, get: function () { return Store_1.StoreAsync; } }));
|
|
3128
|
-
__exportStar(__webpack_require__(/*! ./DOM */ "./src/DOM/index.ts"), exports);
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
/***/ })
|
|
3132
|
-
|
|
3133
|
-
/******/ });
|
|
3134
|
-
/************************************************************************/
|
|
3135
|
-
/******/ // The module cache
|
|
3136
|
-
/******/ var __webpack_module_cache__ = {};
|
|
3137
|
-
/******/
|
|
3138
|
-
/******/ // The require function
|
|
3139
|
-
/******/ function __webpack_require__(moduleId) {
|
|
3140
|
-
/******/ // Check if module is in cache
|
|
3141
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
3142
|
-
/******/ if (cachedModule !== undefined) {
|
|
3143
|
-
/******/ return cachedModule.exports;
|
|
3144
|
-
/******/ }
|
|
3145
|
-
/******/ // Create a new module (and put it into the cache)
|
|
3146
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
3147
|
-
/******/ // no module.id needed
|
|
3148
|
-
/******/ // no module.loaded needed
|
|
3149
|
-
/******/ exports: {}
|
|
3150
|
-
/******/ };
|
|
3151
|
-
/******/
|
|
3152
|
-
/******/ // Execute the module function
|
|
3153
|
-
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
3154
|
-
/******/
|
|
3155
|
-
/******/ // Return the exports of the module
|
|
3156
|
-
/******/ return module.exports;
|
|
3157
|
-
/******/ }
|
|
3158
|
-
/******/
|
|
3159
|
-
/************************************************************************/
|
|
3160
|
-
var __webpack_exports__ = {};
|
|
3161
|
-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
3162
|
-
(() => {
|
|
3163
|
-
var exports = __webpack_exports__;
|
|
3164
|
-
/*!********************!*\
|
|
3165
|
-
!*** ./src/web.ts ***!
|
|
3166
|
-
\********************/
|
|
3167
|
-
|
|
3168
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3169
|
-
const Web = __webpack_require__(/*! ./web.export */ "./src/web.export.ts");
|
|
3170
|
-
for (var key in Web)
|
|
3171
|
-
window[key] = Web[key];
|
|
3172
|
-
|
|
3173
|
-
})();
|
|
3174
|
-
|
|
3175
|
-
/******/ })()
|
|
3176
|
-
;
|
|
1
|
+
(()=>{"use strict";var __webpack_modules__={642:(e,t)=>{function n(e,t,n,r){const o=n;t[r]??=function(e,t){let n;return function(r){r!==n&&(n&&e.removeEventListener(t,n),r&&e.addEventListener(t,r),n=r)}}(e,r),t[r](o)}Object.defineProperty(t,"__esModule",{value:!0}),t.CreateEventAssignment=function(e){let t;const r={};return function(o){const i=null!==o?Object.keys(o):[],s=void 0===t?i:i.concat(t);t=i;for(let t=0;t<s.length;t++)n(e,r,o&&o[s[t]],s[t])}}},543:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateNodeValueAssignment=function(e){let t=e.nodeValue;return function(n){n.nodeValue!==t&&(e.nodeValue=n.nodeValue,t=n.nodeValue)}},t.CreatePropertyAssignment=s;const r=n(874);function o(e,t,n){t.value??=function(e){let t=e.value;return e.addEventListener("blur",(function(){e.value=t})),function(n){if(n!==t){const r=e.selectionStart,o=e.selectionEnd;e.value=n,e.ownerDocument.activeElement===e&&e.setSelectionRange(r,o),t=n}}}(e),t.value(n.value)}function i(e,t,n,o){const i=n[o];t[o]??="value"===(0,r.JsonType)(i)?function(e,t){let n=e[t];return function(r){r!==n&&(e[t]=r,n=r)}}(e,o):s(e[o],!1),t[o](i)}function s(e,t=!0){const n={};return function(r){const s=Object.keys(r);for(let a=0;a<s.length;a++)!0===t&&"value"===s[a]?o(e,n,r):i(e,n,r,s[a])}}},641:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DOMNodeConfig=void 0;const r=n(819),o=n(496),i=n(543),s=n(642);let a=o.List.Create(),c=!1;function u(){o.List.Add(a,null);const e=Date.now();let t;for(;t=o.List.Pop(a);)t();0===a.size?c=!1:Date.now()-e<16?u():r.wndw.requestAnimationFrame(u)}t.DOMNodeConfig={createNode:(e,t)=>t?r.wndw.document.createElementNS(t,e):r.wndw.document.createElement(e),createTextNode:(e="")=>r.wndw.document.createTextNode(e),scheduleUpdate(e){o.List.Add(a,e),c||(c=!0,r.wndw.requestAnimationFrame(u))},addListener(e,t,n){e.addEventListener(t,n)},removeListener(e,t,n){e.removeEventListener(t,n)},addChild(e,t){e.appendChild(t)},addChildFirst(e,n){t.DOMNodeConfig.addChildBefore(e,e.firstChild,n)},addChildBefore(e,n,r){n?r!==n&&e.insertBefore(r,n):t.DOMNodeConfig.addChild(e,r)},addChildAfter(e,n,r){n?t.DOMNodeConfig.addChildBefore(e,n.nextSibling,r):t.DOMNodeConfig.addChildFirst(e,r)},removeChild(e,t){e.removeChild(t)},remove(e){e&&e.parentNode&&e.parentNode.removeChild(e)},setText(e,t){e.textContent=t},getAttribute:(e,t)=>e.getAttribute(t),setAttribute(e,t,n){e.setAttribute(t,n)},createPropertyAssignment:e=>e.nodeType===Node.TEXT_NODE?(0,i.CreateNodeValueAssignment)(e):(0,i.CreatePropertyAssignment)(e),createEventAssignment:e=>(0,s.CreateEventAssignment)(e),fireEvent(e,t,n){var r=new CustomEvent(t,n);e.dispatchEvent(r)},getFirstChild:e=>e.firstChild,getLastChild:e=>e.lastChild,getNextSibling:e=>e.nextSibling,replaceChildren(e,t){e.replaceChildren(...t)}}},774:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.div=function(e,t){return r.ElementNode.Create("div",null,e,t)},t.a=function(e,t){return r.ElementNode.Create("a",null,e,t)},t.ul=function(e,t){return r.ElementNode.Create("ul",null,e,t)},t.li=function(e,t){return r.ElementNode.Create("li",null,e,t)},t.br=function(e){return r.ElementNode.Create("br",null,e,null)},t.b=function(e,t){return r.ElementNode.Create("b",null,e,t)},t.span=function(e,t){return r.ElementNode.Create("span",null,e,t)},t.img=function(e){return r.ElementNode.Create("img",null,e,null)},t.video=function(e,t){return r.ElementNode.Create("video",null,e,t)},t.source=function(e){return r.ElementNode.Create("source",null,e,null)},t.input=function(e){return r.ElementNode.Create("input",null,e,null)},t.textarea=function(e){return r.ElementNode.Create("textarea",null,e,null)},t.select=function(e,t){return r.ElementNode.Create("select",null,e,t)},t.option=function(e,t){return r.ElementNode.Create("option",null,e,t)},t.h1=function(e,t){return r.ElementNode.Create("h1",null,e,t)},t.h2=function(e,t){return r.ElementNode.Create("h2",null,e,t)},t.h3=function(e,t){return r.ElementNode.Create("h3",null,e,t)},t.p=function(e,t){return r.ElementNode.Create("p",null,e,t)},t.style=function(e,t){return r.ElementNode.Create("style",null,e,t)},t.button=function(e,t){return r.ElementNode.Create("button",null,e,t)},t.table=function(e,t){return r.ElementNode.Create("table",null,e,t)},t.th=function(e,t){return r.ElementNode.Create("th",null,e,t)},t.tr=function(e,t){return r.ElementNode.Create("tr",null,e,t)},t.td=function(e,t){return r.ElementNode.Create("td",null,e,t)};const r=n(413)},147:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(774),t),o(n(716),t),o(n(543),t),o(n(642),t)},716:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.svg=function(e,t){return r.ElementNode.Create("svg",o,e,t)},t.g=function(e,t){return r.ElementNode.Create("g",o,e,t)},t.circle=function(e,t){return r.ElementNode.Create("circle",o,e,t)};const r=n(413),o="http://www.w3.org/2000/svg"},819:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wndw=void 0,t.wndw="undefined"!=typeof window?window:new(Object(function(){var e=new Error("Cannot find module 'jsdom'");throw e.code="MODULE_NOT_FOUND",e}())("").window)},173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BoundNode=void 0;const r=n(267),o=n(948);var i;function s(e,t){if(t)for(var n in t)r.NodeConfig.getAttribute(e.node,n)!==t[n]&&r.NodeConfig.setAttribute(e.node,n,t[n])}!function(e){e.Init=function(e){const t=e.nodeDef;if(t.props){const n=o.ObservableScope.Create(t.props);e.scopes??=[],e.scopes.push(n),e.assignProperties=r.NodeConfig.createPropertyAssignment(e.node),o.ObservableScope.Watch(n,(function(t){!function(e,t){e.setProperties||(e.setProperties=!0,r.NodeConfig.scheduleUpdate((function(){if(e.setProperties=!1,e.destroyed)return;const n=o.ObservableScope.Value(t);e.assignProperties(n)})))}(e,t)}));const i=o.ObservableScope.Value(n);e.assignProperties(i)}if(t.attrs){const n=o.ObservableScope.Create(t.attrs);e.scopes??=[],e.scopes.push(n),o.ObservableScope.Watch(n,(function(t){!function(e,t){e.setAttributes||(e.setAttributes=!0,r.NodeConfig.scheduleUpdate((function(){e.setAttributes=!1,e.destroyed||s(e,o.ObservableScope.Value(t))})))}(e,t)})),s(e,o.ObservableScope.Value(n))}if(t.on){const n=o.ObservableScope.Create(t.on);e.scopes??=[],e.scopes.push(n),e.assignEvents=r.NodeConfig.createEventAssignment(e.node),o.ObservableScope.Watch(n,(function(t){!function(e,t){e.setEvents||(e.setEvents=!0,r.NodeConfig.scheduleUpdate((function(){if(e.setEvents=!1,e.destroyed)return;const n=o.ObservableScope.Value(t);e.assignEvents(n)})))}(e,t)}));const i=o.ObservableScope.Value(n);e.assignEvents(i)}}}(i||(t.BoundNode=i={}))},342:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const r=n(64),o=n(230),i=n(334),s=n(948);class a{nodeRef;componentEvents;scope;templates;decoratorMap;get Injector(){return this.nodeRef.injector}get Destroyed(){return this.nodeRef.destroyed}get DecoratorMap(){return this.decoratorMap}get Scope(){return this.scope}get Data(){return this.scope.Value}get NodeRef(){return this.nodeRef}get Templates(){return this.templates}constructor(e,t,n,r){this.nodeRef=n,this.componentEvents=r,this.scope=new s.ObservableScope(e),this.templates=t||{},this.decoratorMap=new Map}Template(){return[]}Bound(){}Fire(e,t){var n=this.componentEvents&&this.componentEvents[e];n&&n(t)}Destroy(){this.scope.Destroy(),i.Destroy.All(this)}}t.Component=a,function(e){function t(e,t,n){return o.ComponentNode.ToFunction(e,t,n)}function n(e,t){r.NodeRef.Init(t);var n=r.NodeRef.Wrap(e);r.NodeRef.AddChild(n,t)}e.ToFunction=t,e.Register=function(e,r){const o=t(`${e}-component`,void 0,r);class i extends HTMLElement{constructor(){super(),n(this.attachShadow({mode:"open"}),o({}))}}customElements.define(e,i)},e.Attach=n}(a||(t.Component=a={}))},230:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentNode=void 0;const r=n(173),o=n(64),i=n(267),s=n(342),a=n(880),c=n(334),u=n(224),l=n(496);var d;function f(e){const t=e.component.Template();return Array.isArray(t)?t:[t]}function h(e,t){(0,u.Thread)((function(){if(e.destroyed)return;const n=a.Injector.Scope(e.injector,f,e);(0,u.Schedule)((function(){o.NodeRef.InitAll(e,n)})),(0,u.Thread)((function(){if(e.destroyed)return;const r=l.List.Create();l.List.Add(r,{value:void 0,init:!0,nodes:n}),t?o.NodeRef.ReconcileChildren(e,r):i.NodeConfig.scheduleUpdate((function(){e.destroyed||o.NodeRef.ReconcileChildren(e,r)}))})),e.component.Bound!==s.Component.prototype.Bound&&(0,u.After)((function(){i.NodeConfig.scheduleUpdate((()=>setTimeout((()=>e.component.Bound()),0)))}))}))}!function(e){e.Fire=function(e,t){var n=this.componentEvents&&this.componentEvents[e];n&&n(t)},e.ToFunction=function(e,t,n){return function(r,i){return function(e,t,n,r,i){var s=o.NodeRef.Create(e,t,o.NodeRefType.ComponentNode);return s.nodeDef=n,s.constructor=r,s.templates=i,s}(e,t,r,n,i)}},e.Init=function(e){var t,n=e.nodeDef,s=n.on;n.on=null,e.component=new e.constructor(n.data,e.templates,e,s),t=e,c.PreReq.Has(t.component)?function(e){return new Promise((t=>{(0,u.Thread)((function(){const n=a.Injector.Scope(e.injector,c.PreReqTemplate.Get,e.component);(0,u.Schedule)((function(){e.destroyed||o.NodeRef.InitAll(e,n)})),(0,u.Thread)((function(){if(!e.destroyed){for(var r=0;r<n.length;r++)o.NodeRef.AddChild(e,n[r]);c.PreReq.All(e.component).then((function(){if(!e.destroyed){for(var r=0;r<n.length;r++)o.NodeRef.Destroy(n[r]);i.NodeConfig.scheduleUpdate((function(){if(!e.destroyed){for(var r=0;r<n.length;r++)o.NodeRef.DetachChild(e,n[r]);t()}}))}}))}}))}))}))}(t).then((function(){h(t,!1)})):h(t,!0),r.BoundNode.Init(e)}}(d||(t.ComponentNode=d={}))},413:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ElementNode=void 0;const r=n(948),o=n(880),i=n(496),s=n(224),a=n(173),c=n(267),u=n(64);var l;!function(e){e.Create=function(e,t,n,r){var o=u.NodeRef.Create(e,t,u.NodeRefType.ElementNode);return o.nodeDef=n,o.childrenFunc=r,o},e.Init=function(e){if(e.childrenFunc){var t=e.nodeDef;if(t.data){const n=r.ObservableScope.Create(t.data);e.childNodes=new Set,e.scopes??=[],e.scopes.push(n),r.ObservableScope.Watch(n,(function(){!function(e,t){e.setData||(e.setData=!0,c.NodeConfig.scheduleUpdate((function(){e.setData=!1,e.destroyed||p(e,f(t))})))}(e,n)})),p(e,f(n),!0)}else n=e,(0,s.Synch)((function(){const e=o.Injector.Scope(n.injector,b,n.childrenFunc,!0);e.length>0&&(u.NodeRef.InitAll(n,e),(0,s.Thread)((function(){if(n.destroyed)return;const t=i.List.Create();i.List.Add(t,{value:null,init:!0,nodes:e}),u.NodeRef.ReconcileChildren(n,t)})))}))}var n;a.BoundNode.Init(e)}}(l||(t.ElementNode=l={}));const d=[];function f(e){var t=r.ObservableScope.Value(e);return t?(Array.isArray(t)||(t=[t]),t):d}function h(e){return e.value}function p(e,t,n=!1){(0,s.Synch)((function(){!function(e,t){const n=i.List.Create(),r=i.List.Create(),a=e.nodeList,c=a&&i.List.ToNodeMap(a,h);for(let s=0;s<t.length;s++){let u;if(c){const e=c.get(t[s]);if(e){let t=e.length-1;for(;t>=0&&!u;t--)u=e[t],e[t]=null}}u?(i.List.RemoveNode(a,u),i.List.AddNode(n,u),u.data.init||i.List.Add(r,u.data)):(u=i.List.Add(n,{value:t[s],init:!1,nodes:o.Injector.Scope(e.injector,b,e.childrenFunc,t[s])}),i.List.Add(r,u.data))}let l=r.head;for(;l;){const t=l.data;(0,s.Schedule)((function(){e.destroyed||0===n.size||(u.NodeRef.InitAll(e,t.nodes),t.init=!0)})),l=l.next}if(a){let t=a.head;for(;t;){const n=t.data;t=t.next;for(let t=0;t<n.nodes.length;t++)e.childNodes.delete(n.nodes[t]);u.NodeRef.DestroyAll(n.nodes)}i.List.Clear(a)}e.nodeList=n}(e,t);const r=e.nodeList,a=r.size;(0,s.Thread)((function(t){e.destroyed||(n||!t?u.NodeRef.ReconcileChildren(e,r):c.NodeConfig.scheduleUpdate((function(){e.destroyed||r.size!==a||u.NodeRef.ReconcileChildren(e,r)})))}))}))}function b(e,t){const n=e(t);if("string"==typeof n||!n){const n=u.NodeRef.Create("text",null,u.NodeRefType.BoundNode);return n.nodeDef={props:function(){return{nodeValue:e(t)}}},[n]}return Array.isArray(n)?n:[n]}},267:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeConfig=void 0;const r=n(641);t.NodeConfig=r.DOMNodeConfig},64:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRef=t.NodeRefType=void 0;const r=n(267),o=n(880),i=n(173),s=n(413),a=n(230),c=n(890);var u,l;!function(e){e[e.NodeRef=0]="NodeRef",e[e.BoundNode=1]="BoundNode",e[e.ElementNode=2]="ElementNode",e[e.ComponentNode=3]="ComponentNode"}(u||(t.NodeRefType=u={})),function(e){function t(e,t,n){switch(n){case u.NodeRef:return{node:null,nodeType:e,nodeNamespace:t,type:u.NodeRef,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1};case u.BoundNode:return{node:null,nodeDef:null,nodeType:e,nodeNamespace:t,type:u.BoundNode,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1,lastEvents:null,setProperties:!1,assignProperties:null,assignEvents:null,setAttributes:!1,setEvents:!1,scopes:null};case u.ElementNode:return{node:null,nodeDef:null,nodeType:e,nodeNamespace:t,type:u.ElementNode,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1,lastEvents:null,setProperties:!1,assignProperties:null,assignEvents:null,setAttributes:!1,setEvents:!1,childrenFunc:null,nodeList:null,setData:!1,scopes:null};case u.ComponentNode:return{node:null,nodeDef:null,nodeType:e,nodeNamespace:t,type:u.ComponentNode,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1,setProperties:!1,assignProperties:null,assignEvents:null,setAttributes:!1,setEvents:!1,component:null,componentEvents:null,scopes:null}}}function n(e){if(!e.node)switch(e.node="text"===e.nodeType?r.NodeConfig.createTextNode():r.NodeConfig.createNode(e.nodeType,e.nodeNamespace),e.childNodes="text"!==e.nodeType?[]:null,e.type){case u.BoundNode:i.BoundNode.Init(e);break;case u.ElementNode:s.ElementNode.Init(e);break;case u.ComponentNode:a.ComponentNode.Init(e)}}function l(e,t){Array.isArray(e.childNodes)?e.childNodes.push(t):e.childNodes.add(t)}function d(e){if(!e.destroyed){if(e.destroyed=!0,Array.isArray(e.childNodes))for(let t=0;t<e.childNodes.length;t++)d(e.childNodes[t]);else e.childNodes?.forEach(d);switch(e.type){case u.ComponentNode:e.component?.Destroy();case u.ElementNode:e.assignEvents?.(null);case u.BoundNode:for(let t=0;e.scopes&&t<e.scopes.length;t++)c.ObservableScope.Destroy(e.scopes[t])}e.node=null}}e.Wrap=function(e){var n=t(null,null,u.NodeRef);return n.node=e,n.childNodes=new Set,n},e.Create=t,e.Init=n,e.InitAll=function(e,t){for(var r=0;r<t.length;r++)t[r].parent=e,l(e,t[r]),n(t[r])},e.AddChild=function(e,t){t.parent=e,l(e,t),r.NodeConfig.addChild(e.node,t.node)},e.AddChildAfter=function(e,t,n){if(t&&t.parent!==e)throw"currentChild is not valid";n.parent=e,l(e,n),r.NodeConfig.addChildAfter(e.node,t&&t.node,n.node)},e.ReconcileChildren=function(e,t){const n=e.node;if(0===t.size)return void r.NodeConfig.replaceChildren(n,[]);let o,i=t?.head,s=!1,a=!1;for(;i;){for(let e=0;e<i.data.nodes.length;e++){const t=o?r.NodeConfig.getNextSibling(o):r.NodeConfig.getFirstChild(n),c=i.data.nodes[e].node;t!==c?(r.NodeConfig.addChildBefore(n,t,c),!a&&s&&t&&r.NodeConfig.removeChild(n,t),a=s,s=!0):(s=!1,a=!1),o=c}i=i.next}let c=r.NodeConfig.getLastChild(n);for(;o&&o!==c;)r.NodeConfig.removeChild(n,c),c=r.NodeConfig.getLastChild(n)},e.DetachChild=function(e,t){!Array.isArray(e.childNodes)&&e.childNodes.delete(t)&&(r.NodeConfig.removeChild(e.node,t.node),t.parent=null)},e.Destroy=d,e.DestroyAll=function(e){for(let t=0;t<e.length;t++)d(e[t])}}(l||(t.NodeRef=l={}))},377:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiffAsync=void 0;const r=n(285),o=n(521),i=n(547),s=(0,r.DiffTreeScope)();t.DiffAsync=class{workerQueue;constructor(e){this.workerQueue=new o.WorkerQueue(i.DiffWorker.Create()),this.workerQueue.Push({method:"create",arguments:[e.toString()]})}static GetKeyRef(e){return s.GetKeyRef(e)}static ReadKeyRef(e){return s.ReadKeyRef(e)}async DiffPath(e,t){return await this.workerQueue.Push({method:"diffpath",arguments:[e,t]})}async DiffBatch(e){return await this.workerQueue.Push({method:"diffbatch",arguments:[e]})}async UpdatePath(e,t){await this.workerQueue.Push({method:"updatepath",arguments:[e,t]})}async GetPath(e){return await this.workerQueue.Push({method:"getpath",arguments:[e]})}Destroy(){this.workerQueue.Destroy()}}},606:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiffSync=void 0;const r=(0,n(285).DiffTreeScope)();t.DiffSync=class{diffTree;constructor(e){this.diffTree=new r(e)}static GetKeyRef(e){return r.GetKeyRef(e)}static ReadKeyRef(e){return r.ReadKeyRef(e)}DiffPath(e,t){return this.diffTree.DiffPath(e,t)}DiffBatch(e){return this.diffTree.DiffBatch(e)}UpdatePath(e,t){this.diffTree.UpdatePath(e,t)}}},285:(__unused_webpack_module,exports)=>{function DiffTreeScope(worker){const ctx=this;if(ctx&&worker){let diffTree=null;ctx.onmessage=function(event){var data=event.data;switch(data.method){case"create":var keyFunc=data.arguments[0]?eval(data.arguments[0]):void 0;diffTree=new DiffTree(keyFunc),ctx.postMessage(null);break;case"diffpath":var diff=diffTree.DiffPath(data.arguments[0],data.arguments[1]);ctx.postMessage(diff);break;case"diffbatch":var diff=diffTree.DiffBatch(data.arguments[0]);ctx.postMessage(diff);break;case"updatepath":diffTree.UpdatePath(data.arguments[0],data.arguments[1]),ctx.postMessage(null);break;case"getpath":var ret=diffTree.GetPath(data.arguments[0]);ctx.postMessage(ret)}}}const jsonConstructor={}.constructor;function IsValue(e){return!e||!(jsonConstructor===e.constructor||Array.isArray(e))}let Type;function TypeOf(e){return e?jsonConstructor===e.constructor?Type.Object:Array.isArray(e)?Type.Array:Type.Value:Type.Value}function JsonDiffRecursive(e,t,n,r){if(t===n)return!1;const o=TypeOf(t),i=TypeOf(n),s=r.length;let a=!0;if(o===i)switch(o){case Type.Array:a=JsonDiffArrays(e,t,n,r);break;case Type.Object:a=JsonDiffObjects(e,t,n,r)}return!!a&&(r.splice(s),r.push({path:e,value:t}),!0)}function JsonDiffArrays(e,t,n,r){let o=!0;if(t.length!==n.length&&r.push({path:e?`${e}.length`:"length",value:t.length}),t.length>0||n.length>0)for(let i=0;i<t.length;i++)o=JsonDiffRecursive(e?`${e}.${i}`:`${i}`,t[i],n[i],r)&&o;else o=!1;return o}function JsonDiffObjects(e,t,n,r){let o=!0;const i=Object.keys(t),s=Object.keys(n);if(0===i.length&&0===s.length)return!1;if(i.length>=s.length){let a=0,c=0;for(;a<i.length;){const u=e?`${e}.${i[a]}`:i[a];c<s.length&&i[a]===s[c]?(o=JsonDiffRecursive(u,t[i[a]],n[s[c]],r)&&o,c++):void 0!==t[i[a]]&&r.push({path:u,value:t[i[a]]}),a++}c<s.length&&(o=!0)}return o}function BreakUpValue(e,t,n,r,o){const i=r?t[r]:t,s=IsValue(i);if(!o&&s)return new Map([[e,i]]);if(o=o||new Map,s)return o;const a=n?n(i):null,c=a&&DiffTree.GetKeyRef(a);if(a&&a!==e)r&&(t[r]=c),BreakUpValue(a,i,n,null,o);else for(const t in i)BreakUpValue(`${e}.${t}`,i,n,t,o);return r||o.set(e,a===e?i:c||i),o}!function(e){e[e.Value=0]="Value",e[e.Object=1]="Object",e[e.Array=2]="Array"}(Type||(Type={}));class DiffTree{keyFunc;rootStateMap=new Map;constructor(e){this.keyFunc=e}static GetKeyRef(e){return`___DiffTreeKeyRef.${e}`}static ReadKeyRef(e){if(e){var t=e.match(/^___DiffTreeKeyRef\.([^.]+$)/);if(t)return t[1]}}DiffBatch(e){for(var t=[],n=0;n<e.length;n++)this.RunDiff(e[n].path,e[n].value,t);return t}DiffPath(e,t){var n=[];return this.RunDiff(e,t,n),n}UpdatePath(e,t){this.SetPathValue(e,t)}GetPath(e){return this.GetPathValue(e)}RunDiff(e,t,n){var r=this.GetBreakUpMap(e,t),o=n||[];r.forEach(((e,t)=>{var n=t.split(".").reduce(((e,t,n)=>0===n?this.rootStateMap.get(t):e&&e[t]),null);JsonDiffRecursive(t,e,n,o)}));for(var i=0;i<o.length;i++)this.SetPathValue(o[i].path,o[i].value)}GetPathValue(e){for(var t=e.split("."),n=this.rootStateMap.get(t[0]),r=1;r<t.length;r++)n=n&&n[t[r]];return n}SetPathValue(e,t){var n=e.split(".");if(1===n.length)this.rootStateMap.set(n[0],t);else{for(var r=this.rootStateMap.get(n[0]),o=1;o<n.length-1;o++)r=r[n[o]];r[n[n.length-1]]=t}}GetBreakUpMap(e,t){return this.keyFunc?BreakUpValue(e,t,this.keyFunc):new Map([[e,t]])}}return DiffTree}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DiffTreeScope=DiffTreeScope},547:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiffWorker=void 0;const r=n(285);var o;!function(e){var t=null,n=null;"undefined"!=typeof Worker&&(t=Worker,n=URL.createObjectURL(new Blob([`(${r.DiffTreeScope}).call(this, true)`]))),e.Create=function(){if(!t)throw"Worker is not available";return new t(n)}}(o||(t.DiffWorker=o={}))},521:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerQueue=void 0;const r=n(496);t.WorkerQueue=class{callbacks;worker;constructor(e){this.worker=e,this.callbacks=r.List.Create(),this.worker.onerror=e=>{var t=r.List.Pop(this.callbacks);t&&t(null,e)},this.worker.onmessage=e=>{var t=r.List.Pop(this.callbacks);t&&t(e.data)}}Push(e){return new Promise(((t,n)=>{r.List.Add(this.callbacks,(function(e,r){r?n(r):t(e)})),this.worker.postMessage(e)}))}Destroy(){this.worker.terminate()}}},501:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Store=void 0;const r=n(586),o=n(778);t.Store=class{observableTree=new r.ObservableTree;storeWriter=new o.StoreWriter(this.observableTree);rootScope=this.observableTree.Scope("ROOT",(e=>e));get Root(){return this.rootScope}constructor(e){e&&this.Write(e)}Action(e){e(this.observableTree.Get("ROOT"),this.storeWriter)}Write(e){this.Action(((t,n)=>n.Write(t,e)))}Merge(e){this.Action(((t,n)=>n.Merge(t,e)))}Destroy(){this.rootScope.Destroy()}}},161:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreAsync=void 0;const r=n(586),o=n(377),i=n(22),s=n(263);t.StoreAsync=class{idFunc;diffAsync;observableTree;asyncWriter;asyncQueue;constructor(e,t){if(this.idFunc=e,this.diffAsync=new o.DiffAsync(this.idFunc),this.observableTree=new r.ObservableTree(o.DiffAsync.ReadKeyRef),this.asyncWriter=new i.StoreAsyncWriter(this.idFunc,this.diffAsync,this.observableTree),this.asyncQueue=new s.AsyncQueue,t){var n=this.idFunc(t);this.observableTree.Write(n,t),this.Write(t)}}Scope(e,t){return this.observableTree.Scope(e,t)}async Action(e,t){await this.asyncQueue.Next((async()=>{await t(e&&this.observableTree.Get(e),this.asyncWriter)}))}async Write(e){await this.Action(null,(async(t,n)=>{await n.Write(t,e)}))}async Merge(e,t){await this.Action(e,(async(e,n)=>{await n.Merge(e,t)}))}Destroy(){this.asyncQueue.Stop(),this.diffAsync.Destroy()}}},22:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreAsyncWriter=void 0,t.StoreAsyncWriter=class{idFunc;diffAsync;observableTree;constructor(e,t,n){this.idFunc=e,this.diffAsync=t,this.observableTree=n}async Write(e,t){let n;if(e)n=this.observableTree.GetPathOf(e);else if(n=this.idFunc(t),!n)throw new Error("data must have an id");let r=await this.diffAsync.DiffPath(n,t);this.ApplyChanges(r)}async Merge(e,t){const n=this.observableTree.GetPathOf(e),r=Object.keys(t).map((e=>({path:`${n}.${e}`,value:t[e]}))),o=await this.diffAsync.DiffBatch(r);this.ApplyChanges(o)}async Push(e,t){const n=this.observableTree.GetPathOf(e);var r=`${n}.length`,o=await this.diffAsync.GetPath(r),i=await this.diffAsync.DiffPath(`${n}.${o}`,t);this.ApplyChanges(i)}async Splice(e,t,n,...r){var o=this.observableTree.GetPathOf(e),i=await this.diffAsync.GetPath(o);(i=i.slice()).splice(t,n,...r);var s=await this.diffAsync.DiffPath(o,i);this.ApplyChanges(s)}ApplyChanges(e){this.observableTree.WriteAll(e)}}},961:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreSync=void 0;const r=n(606),o=n(586),i=n(921);t.StoreSync=class{diffSync=new r.DiffSync;observableTree=new o.ObservableTree;storeWriter=new i.StoreSyncWriter(this.diffSync,this.observableTree);rootScope=this.observableTree.Scope("ROOT",(e=>e));get Root(){return this.rootScope}constructor(e){e&&this.Write(e)}Action(e){e(this.observableTree.Get("ROOT"),this.storeWriter)}Write(e){this.Action(((t,n)=>n.Write(t,e)))}Merge(e){this.Action(((t,n)=>n.Merge(t,e)))}Destroy(){this.rootScope.Destroy()}}},921:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreSyncWriter=void 0,t.StoreSyncWriter=class{diffSync;observableTree;constructor(e,t){this.diffSync=e,this.observableTree=t}Write(e,t){var n=e&&this.observableTree.GetPathOf(e)||"ROOT",r=this.diffSync.DiffPath(n,t);this.ApplyChanges(r)}Merge(e,t){var n=this.observableTree.GetPathOf(e),r=Object.keys(t).map((e=>({path:`${n}.${e}`,value:t[e]}))),o=this.diffSync.DiffBatch(r);this.ApplyChanges(o)}Push(e,t){var n=this.observableTree.GetPathOf(e),r=e.length;this.diffSync.UpdatePath(`${n}.${r}`,t),this.observableTree.Write(`${n}.${r}`,t)}Splice(e,t,n,...r){var o=this.observableTree.GetPathOf(e);const i=this.observableTree.Get(o).toJSON().slice();i.splice(t,n,...r),this.diffSync.UpdatePath(o,i),this.observableTree.Write(o,i)}ApplyChanges(e){this.observableTree.WriteAll(e)}}},778:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreWriter=void 0,t.StoreWriter=class{observableTree;constructor(e){this.observableTree=e}Write(e,t){const n=e&&this.observableTree.GetPathOf(e)||"ROOT";this.observableTree.Write(n,t)}Merge(e,t){const n=this.observableTree.GetPathOf(e);for(const e in t)this.observableTree.Write(`${n}.${e}`,t[e])}Push(e,t){const n=this.observableTree.GetPathOf(e);this.observableTree.Write(`${n}.${e.length}`,t)}Splice(e,t,n,...r){const o=e.toJSON().slice();o.splice(t,n,...r);const i=this.observableTree.GetPathOf(e);this.observableTree.Write(i,o)}}},645:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableComputed=void 0;const r=n(874),o=n(496),i=n(318),s=n(948),a=new Set,c=o.List.Create();function u({node:e,scope:t}){const n=s.ObservableScope.Value(t);e.data=(0,r.JsonDeepClone)(n)}let l=!1;var d;!function(e){e.Create=function(e){return function(e){const t=s.ObservableScope.Create(e),n=i.ObservableNode.Create({data:null});return s.ObservableScope.Watch(t,(function(e){!function(e,t){a.has(e)||(a.add(e),o.List.Add(c,{node:e,scope:t}),l||(l=!0,queueMicrotask((function(){l=!1,a.clear(),o.List.ForEach(c,u),o.List.Clear(c)}))))}(n,e)})),n.data=s.ObservableScope.Value(t),s.ObservableScope.Create((function(){return n.data}),[t])}(e)}}(d||(t.ObservableComputed=d={}))},318:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableNode=void 0;const r=n(874),o=n(948),i=new WeakMap,s=new WeakMap;function a(e,t){return{...Object.getOwnPropertyDescriptor(e,t),configurable:!0}}function c(e,t){return{...Object.getOwnPropertyDescriptor(e,t),configurable:!0}}function u(e,t){return Object.hasOwn(e,t)}function l(e,t){return Object.hasOwn(e,t)}function d(e){return Object.keys(e)}function f(e){return Object.keys(e)}function h(e){if(!e)return e;if(e.toJSON&&"function"==typeof e.toJSON)return e.toJSON();switch((0,r.JsonType)(e)){case"object":{const t=Object.keys(e);for(let n=0;n<t.length;n++)e[t[n]]=h(e[t[n]])}case"array":for(let t=0;t<e.length;t++)e[t]=h(e[t])}return e}function p(e,t,n){n=h(n),e[t]=n;const r=s.get(e);return o.ObservableScope.Update(r),!0}function b(e,t){const n=s.get(e);if(e=o.ObservableScope.Value(n),"toJSON"===t)return function(){return e};{const r=e[t];return"symbol"==typeof t?r:"function"==typeof r?function(...r){const s=e.slice();for(let e=0;e<s.length;e++)s[e]=i.get(s[e])??m(s[e]);let a=s[t](...r);switch(t){case"push":case"unshift":case"splice":case"pop":case"shift":case"sort":case"reverse":e.length=s.length;for(let t=0;t<s.length;t++)e[t]=h(s[t]);o.ObservableScope.Update(n)}return a}:m(r)}}let v=!1;function y(e,t,n){const a=s.get(e);if(n=h(n),v)e[t]=n,o.ObservableScope.Update(a);else{v=!0;const o=i.get(e),s=o.toJSON(),a=(0,r.JsonDiff)(n,s[t]);for(let e=0;e<a.length;e++)if(0===a[e].path.length)o[t]=a[e].value;else{const n=a[e].path;let r=o[t],i=0;for(;i<n.length-1;i++)r=r[n[i]];r[n[i]]=a[e].value}v=!1}return!0}function g(e,t){const n=s.get(e);if(e=o.ObservableScope.Value(n),"toJSON"===t)return function(){return e};{const n=e[t];return"symbol"==typeof t?n:m(n)}}function m(e){switch((0,r.JsonType)(e)){case"object":{const t=i.get(e)??function(e){const t=o.ObservableScope.Create((()=>e)),n=new Proxy(e,{get:g,set:y,has:u,ownKeys:d,getOwnPropertyDescriptor:a});return s.set(e,t),i.set(e,n),n}(e);return t}case"array":{const t=i.get(e)??function(e){const t=o.ObservableScope.Create((()=>e)),n=new Proxy(e,{get:b,set:p,has:l,ownKeys:f,getOwnPropertyDescriptor:c});return s.set(e,t),i.set(e,n),n}(e);return o.ObservableScope.Touch(s.get(e)),t}default:return e}}var O;!function(e){e.Create=function(e){return m(e=h(e))}}(O||(t.ObservableNode=O={}))},948:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableScope=t.ObservableScopeWrapper=t.ObservableScopeValue=void 0;const r=n(116);class o{scope;get Value(){return s.Value(this.scope)}constructor(e){this.scope=e}}t.ObservableScopeValue=o;class i extends o{scopeEmitter;constructor(e){super(e),e.emitter&&(this.scopeEmitter=r.Emitter.Create(),r.Emitter.On(e.emitter,(()=>r.Emitter.Emit(this.scopeEmitter,this))))}Scope(e){return new s((()=>e(this.Value)))}Watch(e){this.scopeEmitter&&(r.Emitter.On(this.scopeEmitter,e),e(this))}Unwatch(e){this.scopeEmitter&&r.Emitter.Remove(this.scopeEmitter,e)}Destroy(){l(this.scope),this.scopeEmitter&&this.scopeEmitter.clear()}}t.ObservableScopeWrapper=i;class s extends i{constructor(e){super(s.Create(e))}}t.ObservableScope=s;let a=null,c=!1;function u(e){return!e||e.dirty||e.destroyed?e.destroyed:(e.dirty=!!e.getFunction,r.Emitter.Emit(e.emitter,e),!1)}function l(e){if(e){if(void 0!==e.dependencies)for(let t=0;t<e.dependencies.length;t++)l(e.dependencies[t]);e.emitters&&e.emitters.clear(),e.emitter&&e.emitter.clear(),e.getFunction=null,e.setCallback=null,e.destroyed=!0}}!function(e){function t(e){c&&e&&(a??=new Set,a.add(e))}e.Create=function(e,t){const n="function"==typeof e,o={getFunction:n?e:null,value:n?null:e,async:!!n&&"AsyncFunction"===e[Symbol.toStringTag],dirty:n,emitter:n?r.Emitter.Create():null,emitters:null,destroyed:!1,setCallback:n?function(){return u(o)}:null,dependencies:t};return o},e.Register=t,e.Value=function(e){if(e)return t(e.emitter),function(e){if(!e.dirty)return;e.dirty=!1;let t=null;const n=e.getFunction&&function(n){const r=a;a=null;const o=c;c=!0,t=e.getFunction();const i=a;return a=r,c=o,i}();e.async?Promise.resolve(t).then((t=>{e.value=t,r.Emitter.Emit(e.emitter,e)})):e.value=t,function(e,t){t&&t.forEach((t=>{e.emitters?.delete(t)||r.Emitter.On(t,e.setCallback)})),e.emitters&&e.emitters.forEach((t=>r.Emitter.Remove(t,e.setCallback))),e.emitters=t}(e,n)}(e),e.value},e.Watching=function(){return c},e.Touch=function(e){e&&e.emitter&&t(e.emitter)},e.Watch=function(e,t){e&&e.emitter&&r.Emitter.On(e.emitter,t)},e.Unwatch=function(e,t){e&&e.emitter&&r.Emitter.Remove(e.emitter,t)},e.Update=function(e){u(e)},e.Destroy=function(e){l(e)}}(s||(t.ObservableScope=s={}))},586:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableTree=void 0;const r=n(948);var o;!function(e){e[e.Value=0]="Value",e[e.Object=1]="Object",e[e.Array=2]="Array"}(o||(o={}));const i={}.constructor;function s(e){return e?i===e.constructor?o.Object:Array.isArray(e)?o.Array:o.Value:o.Value}class a{valuePathResolver;undefinedScope=r.ObservableScope.Create((function(){}));scopeCache=new WeakMap;leafScopeCache=new WeakMap;proxyCache=new WeakMap;pathCache=new WeakMap;rootStateMap=new Map;constructor(e){this.valuePathResolver=e}static UnwrapProxyValues(e){if(e?.toJSON&&"function"==typeof e.toJSON)return e.toJSON();const t=s(e);if(t===o.Value)return e;if(t===o.Array){const t=e;for(let e=0;e<t.length;e++)t[e]=a.UnwrapProxyValues(t[e])}else{const t=Object.keys(e);for(let n=0;n<t.length;n++)e[t[n]]=a.UnwrapProxyValues(e[t[n]])}return e}Get(e){return e.split(".").reduce(((e,t,n)=>{if(0===n){let e=this.rootStateMap.get(t);const n=this.GetParentScope(e);return r.ObservableScope.Value(n)}return e&&e[t]}),null)}GetPathOf(e){return e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),this.pathCache.get(e)}Scope(e,t){return new r.ObservableScope((()=>{const n=this.Get(e);return t&&t(n)||n}))}Write(e,t){const n=this.WritePath(e,t);r.ObservableScope.Update(n)}WriteAll(e){const t=new Set;for(var n=0;n<e.length;n++){const r=this.WritePath(e[n].path,e[n].value);t.add(r)}t.forEach((e=>r.ObservableScope.Update(e)))}GetParentScope(e){if(void 0===e)return this.undefinedScope;let t=this.scopeCache.get(e);return t||(t=r.ObservableScope.Create((()=>this.GetValueProxy(e))),this.scopeCache.set(e,t)),t}GetPropertyScope(e,t){const n=e[t];if(s(n)===o.Value){let n=this.leafScopeCache.get(e)||{};return n[t]=n[t]||r.ObservableScope.Create((()=>{const n=this.scopeCache.get(e),o=r.ObservableScope.Value(n).toJSON()[t];let i;return this.valuePathResolver&&"string"==typeof o&&(i=this.valuePathResolver(o))?this.Get(i):o})),this.leafScopeCache.set(e,n),n[t]}{let o=this.scopeCache.get(n);return o||(o=r.ObservableScope.Create((()=>{const n=this.scopeCache.get(e),o=r.ObservableScope.Value(n).toJSON()[t];return this.GetValueProxy(o)})),this.scopeCache.set(n,o)),o}}GetValueProxy(e){let t=this.proxyCache.get(e);return t||(t=this.CreateProxy(e),this.proxyCache.set(e,t)),t}ObjectProxyGetter=(e,t)=>"toJSON"===t?function(){return e}:"symbol"==typeof t?e[t]:r.ObservableScope.Value(this.GetPropertyScope(e,t));CreateObjectProxy(e){return new Proxy(e,{get:this.ObjectProxyGetter})}ArrayProxyGetter=(e,t)=>{if("toJSON"===t)return function(){return e};if("symbol"==typeof t)return e[t];if(isNaN(parseInt(t))){const n=e[t];if("function"==typeof n){const t=e.map(((t,n)=>r.ObservableScope.Value(this.GetPropertyScope(e,n.toString()))));return n.bind(t)}return n}return r.ObservableScope.Value(this.GetPropertyScope(e,t))};CreateArrayProxy(e){return new Proxy(e,{get:this.ArrayProxyGetter})}CreateProxy(e){switch(s(e)){case o.Object:return this.CreateObjectProxy(e);case o.Array:return this.CreateArrayProxy(e);default:return e}}WritePath(e,t){this.UpdatePathCache(e,t);const n=e.split(".");if(1===n.length){const e=this.rootStateMap.get(n[0]);return this.rootStateMap.set(n[0],t),void 0===e?this.undefinedScope:this.scopeCache.get(e)}let r,i=0;for(;i<n.length-1&&(0===i||r);i++)r=0===i?this.rootStateMap.get(n[i]):r&&r[n[i]];if(!r)throw new Error("Unable to write path: "+e+". Falsey value found at: "+n.slice(0,i).join("."));const a=n[i],c=r[a],u=s(c);if(r[a]=t,u!==o.Value||Array.isArray(r))return this.scopeCache.get(r)||this.scopeCache.get(c);const l=this.leafScopeCache.get(r);return l&&l[a]||this.scopeCache.get(r)}UpdatePathCache(e,t){if(s(t)===o.Value)return;this.pathCache.set(t,e),this.proxyCache.delete(t),this.scopeCache.delete(t),this.leafScopeCache.delete(t);const n=Object.keys(t);for(let r=0;r<n.length;r++)this.UpdatePathCache(`${e}.${n[r]}`,t[n[r]]);return t}}t.ObservableTree=a},890:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableComputed=t.ObservableNode=t.ObservableScope=t.StoreAsync=t.StoreSync=t.Store=void 0;var r=n(501);Object.defineProperty(t,"Store",{enumerable:!0,get:function(){return r.Store}});var o=n(961);Object.defineProperty(t,"StoreSync",{enumerable:!0,get:function(){return o.StoreSync}});var i=n(161);Object.defineProperty(t,"StoreAsync",{enumerable:!0,get:function(){return i.StoreAsync}});var s=n(948);Object.defineProperty(t,"ObservableScope",{enumerable:!0,get:function(){return s.ObservableScope}});var a=n(318);Object.defineProperty(t,"ObservableNode",{enumerable:!0,get:function(){return a.ObservableNode}});var c=n(645);Object.defineProperty(t,"ObservableComputed",{enumerable:!0,get:function(){return c.ObservableComputed}})},20:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.Animation=t.AnimationType=void 0,function(e){e.EaseIn=function*(e){for(var t=1/e,n=t,r=0;r<e;r++,n+=t)yield(1-n)*(1-n)*(1-n)*0+3*(1-n)*(1-n)*n*1+3*(1-n)*n*n*1+n*n*n*1},e.Linear=function*(e){for(var t=1/e,n=t,r=0;r<e;r++,n+=t)yield n}}(n||(n={})),function(e){e[e.Linear=0]="Linear",e[e.EaseIn=1]="EaseIn"}(r||(t.AnimationType=r={})),t.Animation=class{type;frameCount;frameTimings;update;animationTimeouts;running;start;end;enabled;get Running(){return this.running}get Start(){return this.start}get End(){return this.end}get Enabled(){return this.enabled}constructor(e,t,n){this.running=!1,this.start=null,this.end=null,this.enabled=!0,this.type=e,this.frameCount=Math.ceil(t/1e3*60),this.frameTimings=[];for(var r=t/this.frameCount,o=0;o<this.frameCount;o++)this.frameTimings[o]=(o+1)*r;this.update=n,this.animationTimeouts=[]}Animate(e,t){if(this.enabled){var o=t-e;if(0!==o)return this.Cancel(),this.running=!0,this.start=e,this.end=t,new Promise((t=>{var i=n[r[this.type]],s=0;for(var a of i(this.frameCount)){var c=a*o+e;this.SetTimeout(s,c,s===this.frameCount-1?t:null),s++}})).then((()=>{this.running=!1,this.start=null,this.end=null}))}}Disable(){this.Cancel(),this.enabled=!1}Enable(){this.enabled=!0}Cancel(){for(var e=0;e<this.animationTimeouts.length;e++)clearTimeout(this.animationTimeouts[e]);this.running=!1,this.start=null,this.end=null}Destroy(){this.Cancel()}SetTimeout(e,t,n){this.animationTimeouts[e]=setTimeout((()=>{this.update(t),n&&n()}),this.frameTimings[e])}}},263:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncQueue=void 0;const r=n(496);t.AsyncQueue=class{running=!1;queue=r.List.Create();Next(e){const t=new Promise(((t,n)=>{r.List.Add(this.queue,(async function(){try{const n=await e();t(n)}catch(e){n(e)}}))}));return this.Start(),t}Stop(){r.List.Clear(this.queue)}Start(){this.running||(this.running=!0,this.ExecuteQueue())}async ExecuteQueue(){const e=r.List.Pop(this.queue);null!==e?(await e(),this.ExecuteQueue()):this.running=!1}}},334:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.State=function(){return a},t.StateSync=function(){return c},t.StateAsync=function(){return u},t.Scope=function(){return l},t.DestroyScope=function(){return d},t.Computed=function(){return f},t.ComputedAsync=function(e){return h.bind(null,e)},t.Inject=function(e){return p.bind(null,e)},t.Destroy=b,t.PreReqTemplate=y,t.PreReq=m;const r=n(890),o=n(948),i=n(586),s=n(318);function a(e,t){const n=`StoreDecorator_${t}`;return{configurable:!1,enumerable:!0,get:function(){return this.DecoratorMap.get(n)},set:function(e){const t=this.DecoratorMap,r=t.get(n);if(r){const t=Object.keys(e);for(let n=0;n<t.length;n++)r[t[n]]=e[t[n]]}else t.set(n,s.ObservableNode.Create(e))}}}function c(e,t){const n=`StoreSyncDecorator_${t}`;return{configurable:!1,enumerable:!0,get:function(){return this.DecoratorMap.get(n)},set:function(e){const t=this.DecoratorMap,r=t.get(n);if(r){const t=Object.keys(e);for(let n=0;n<t.length;n++)r[t[n]]=e[t[n]]}else t.set(n,s.ObservableNode.Create(e))}}}function u(e,t){const n=`StoreAsyncDecorator_${t}`,s=`StoreAsyncDecorator_Scope_${t}`;return v(e,n),v(e,s),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap.get(s);const t=e&&e.Value;return o.ObservableScope.Watching()?t:i.ObservableTree.UnwrapProxyValues(t)},set:function(e){var t=this.DecoratorMap,o=t.get(n);o?o.Action("ROOT",(async(t,n)=>await n.Merge(t.data,e))):(o=new r.StoreAsync((e=>e.___id),{___id:"ROOT",data:e}),t.set(n,o),t.set(s,o.Scope("ROOT",(e=>e.data))))}}}function l(e,t,n){if(!n||!n.get)throw"Scope decorator requires a getter";if(n&&n.set)throw"Scope decorator does not support setters";const r=`ScopeDecorator_${t}`;return v(e,r),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(r);if(!t){const i=n.get.bind(this);t=new o.ObservableScope(i),e.set(r,t)}return t.Value}}}function d(e,t,n){if(!n||!n.get)throw"Destroy Scope decorator requires a getter";if(n&&n.set)throw"Destroy Scope decorator does not support setters";const r=`ScopeDecorator_${t}`;v(e,r);const i=`ScopeDecorator_${t}_Value`;return v(e,i),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(r);if(!t){const s=n.get.bind(this);t=new o.ObservableScope(s),e.set(r,t),t.Watch((t=>{var n=e.get(i);n&&n.Destroy(),e.set(i,t.Value)}))}return t.Value}}}function f(e,t,n){if(!n||!n.get)throw"Computed decorator requires a getter";if(n&&n.set)throw"Computed decorator does not support setters";const i=`ComputedDecorator_Scope_${t}`,s=`ComputedDecorator_Store_${t}`;return v(e,i),v(e,s),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(s);if(!t){const a=n.get.bind(this),c=new o.ObservableScope(a);t=new r.StoreSync(c.Value),c.Watch((e=>{this.Destroyed||t.Write(e.Value)})),e.set(i,c),e.set(s,t)}return t.Root.Value}}}function h(e,t,n,i){if(!i||!i.get)throw"ComputedAsync decorator requires a getter";if(i&&i.set)throw"ComputedAsync decorator does not support setters";const s=`ComputedDecorator_Scope_${n}`,a=`ComputedDecorator_Store_${n}`,c=`ComputedDecorator_StoreScope_${n}`;return v(t,s),v(t,a),v(t,c),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(c);if(!t){const n=i.get.bind(this),u=new o.ObservableScope((()=>{var e=n();return e&&"function"==typeof e.toJSON&&(e=e.toJSON()),e})),l=new r.StoreAsync((e=>e._id),{_id:"ROOT",data:u.Value});u.Watch((e=>{this.Destroyed||l.Write({_id:"ROOT",data:e.Value})})),t=l.Scope("ROOT",(e=>e.data)),e.set(c,t),e.set(s,u),e.set(a,l)}return t.Value}}}function p(e,t,n,r){return{configurable:!1,enumerable:!0,get:function(){return this.Injector.Get(e)},set:function(t){this.Injector.Set(e,t)}}}function b(){return v}function v(e,t){var n=e;n.DestroyDecorator_Destroys=n.DestroyDecorator_Destroys||[],n.DestroyDecorator_Destroys.push(t)}function y(e){return g.bind(null,e)}function g(e,t){t.prototype.PreReqTemplateDecorator_Template=e}function m(){return O}function O(e,t){var n=e;n.PreReqDecorator_PreReqs=n.PreReqDecorator_PreReqs||[],n.PreReqDecorator_PreReqs.push(t)}!function(e){e.All=function(e){(function(e){return e&&e.DestroyDecorator_Destroys||[]})(e).map((t=>e[t]||e.DecoratorMap.get(t))).filter((e=>!!e)).forEach((e=>e.Destroy()))}}(b||(t.Destroy=b={})),function(e){e.Get=function(e){var t=e&&e.PreReqTemplateDecorator_Template,n=t?t():[];return Array.isArray(n)||(n=[n]),n}}(y||(t.PreReqTemplate=y={})),function(e){function t(e){return e&&e.PreReqDecorator_PreReqs||[]}e.All=function(e){var n=t(e).map((t=>e[t]&&e[t].Init||Promise.resolve()));return Promise.all(n)},e.Has=function(e){return t(e).length>0}}(m||(t.PreReq=m={}))},116:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=void 0,function(e){function t(e,t){e.delete(t)}e.Create=function(){return new Set},e.On=function(e,t){e.add(t)},e.Emit=function(e,...n){let r;e.forEach((function(e){!0===e(...n)&&(r??=[],r.push(e))}));for(let n=0;void 0!==r&&n<r.length;n++)t(e,r[n])},e.Remove=t}(n||(t.Emitter=n={}))},205:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(334),t),o(n(20),t)},880:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Injector=void 0;class n{parent;typeMap;constructor(){this.parent=n.Current(),this.typeMap=new Map}Get(e){if(0===this.typeMap.size)return this.parent&&this.parent.Get(e);var t=this.typeMap.get(e);return t||(t=this.parent&&this.parent.Get(e)),t}Set(e,t){this.typeMap.set(e,t)}}t.Injector=n,function(e){var t=null;function n(){return t}e.Current=n,e.Scope=function(e,r,...o){var i=n();t=e;const s=r(...o);return t=i,s}}(n||(t.Injector=n={}))},874:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonType=r,t.JsonDeepClone=function e(t){switch(r(t)){case"array":return t.map(e);case"object":{const n={},r=Object.keys(t);for(let o=0;o<r.length;o++)n[r[o]]=e(t[r[o]]);return n}default:return t}},t.JsonDiff=function(e,t){const n=[];return o([],e,t,n),n};const n=Object.getPrototypeOf({});function r(e){return null==e?"value":Array.isArray(e)?"array":n===Object.getPrototypeOf(e)?"object":"value"}function o(e,t,n,i){if(t===n)return!1;const s=r(t),a=r(n),c=i.length;let u=!0;if(s===a)switch(s){case"array":u=function(e,t,n,r){let i=!0;if(t.length!==n.length&&r.push({path:e.concat("length"),value:t.length}),t.length>0||n.length>0)for(let s=0;s<t.length;s++){const a=e.concat(s),c=n[s];i=o(a,t[s],c,r)&&i}else i=!1;return i}(e,t,n,i);break;case"object":u=function(e,t,n,r){const i=Object.keys(t).sort(),s=Object.keys(n).sort();if(0===i.length&&0===s.length)return!1;if(i.length<s.length)return!0;let a=0,c=0;for(;a<i.length;){const u=e.concat(i[a]);c<s.length&&i[a]===s[c]?(o(u,t[i[a]],n[s[c]],r),c++):void 0!==t[i[a]]&&r.push({path:u,value:t[i[a]]}),a++}return c<s.length}(e,t,n,i)}return!!u&&(i.splice(c),i.push({path:e,value:t}),!0)}},496:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.List=void 0,function(e){function t(e,t){return 0===e.size?(e.head=t,e.tail=t,e.size=1):(t.previous=e.tail,e.tail.next=t,e.tail=t,e.size++),t}e.Create=function(){return{head:null,tail:null,size:0}},e.Clear=function(e){e.head=null,e.tail=null,e.size=0},e.Push=function(e,t){const n={previous:null,next:null,data:t};return 0===e.size?(e.head=n,e.tail=n,e.size=1):(n.next=e.head,e.head.previous=n,e.head=n,e.size++),n},e.Pop=function(e){if(0===e.size)return null;const t=e.head;return e.head=t.next,e.head&&(e.head.previous=null),e.size--,0===e.size&&(e.tail=null),t.data},e.Add=function(e,n){return t(e,{previous:null,next:null,data:n})},e.AddNode=t,e.AddBefore=function(t,n,r){if(!n)return e.Add(t,r);const o={previous:null,next:null,data:r},i=n.previous;return o.next=n,n.previous=o,t.head===n&&(t.head=o),i&&(i.next=o,o.previous=i),t.size++,o},e.AddAfter=function(t,n,r){if(!n)return e.Push(t,r);const o={previous:null,next:null,data:r},i=n.next;return n.next=o,o.previous=n,t.tail===n&&(t.tail=o),i&&(i.previous=o,o.next=i),t.size++,o},e.Remove=function(e){if(0===e.size)return null;var t=e.tail;return e.tail=t.previous,e.tail&&(e.tail.next=null),e.size--,0===e.size&&(e.head=null),t.data},e.RemoveNode=function(e,t){if(e.head===t)e.head=t.next;else if(e.tail===t)e.tail=t.previous;else{const e=t.previous,n=t.next;e.next=n,n.previous=e}t.next=t.previous=null,e.size--,e.size>0&&(e.head.previous=e.tail.next=null)},e.ForEach=function(e,t){let n=e.head;for(;n;)t(n.data),n=n.next},e.ToNodeMap=function(e,t){const n=new Map;let r=e.head;for(;r;){const e=t(r.data),o=n.get(e)||[r];o[0]!==r?o.push(r):n.set(e,o),r=r.next}return n}}(n||(t.List=n={}))},224:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Schedule=v,t.After=function(e){b(e,!1,!1)},t.Callback=function(e){return function(t,n,r,o){v((function(){e(t,n,r,o)}))}},t.Synch=g,t.Thread=m,t.ThreadAsync=function(e){return new Promise((t=>m((function(n){e(n),m(t)}))))};const r=n(496),o=16,i=r.List.Create();let s=null,a=!1;const c=setTimeout;function u(){return this.end-Date.now()}function l(){return{end:Date.now()+o,timeRemaining:u}}function d(e=l()){let t;for(;e.timeRemaining()>0&&(t=r.List.Pop(i));)p(t,e);i.size>0?c(d):a=!1}function f(e){r.List.Add(i,e),a||(a=!0,c(d))}function h(e,t){const n=e.workEndNode;e.workEndNode=e.workList.head,t(!0),e.workEndNode=n}function p(e,t=l()){const n=s;s=e;const o=e.async;let i;for(;o===e.async&&t.timeRemaining()>0&&(i=r.List.Pop(e.workList));)h(e,i);e.workList.size>0&&f(e),s=n}function b(e,t,n){s=s||{async:!1,workEndNode:null,workList:r.List.Create()},s.async=s.async||n,t?r.List.AddBefore(s.workList,s.workEndNode,e):s.workEndNode?r.List.AddAfter(s.workList,s.workEndNode,e):s.workEndNode=r.List.Add(s.workList,e)}function v(e){b(e,!0,!0)}var y=!1;function g(e){s||y?e(!1):(y=!0,function(e){e(!1),s&&(s.async?f(s):p(s)),s=null}(e),y=!1)}function m(e){s?b(e,!0,!1):g(e)}},156:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var r=n(342);Object.defineProperty(t,"Component",{enumerable:!0,get:function(){return r.Component}})},576:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableComputed=t.ObservableNode=t.StoreAsync=t.Store=t.ObservableScope=void 0,o(n(156),t),o(n(205),t);var i=n(890);Object.defineProperty(t,"ObservableScope",{enumerable:!0,get:function(){return i.ObservableScope}}),Object.defineProperty(t,"Store",{enumerable:!0,get:function(){return i.Store}}),Object.defineProperty(t,"StoreAsync",{enumerable:!0,get:function(){return i.StoreAsync}}),Object.defineProperty(t,"ObservableNode",{enumerable:!0,get:function(){return i.ObservableNode}}),Object.defineProperty(t,"ObservableComputed",{enumerable:!0,get:function(){return i.ObservableComputed}}),o(n(147),t)}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}var __webpack_exports__={};(()=>{const e=__webpack_require__(576);for(var t in e)window[t]=e[t]})()})();
|
|
3177
2
|
//# sourceMappingURL=jTemplates.js.map
|