@yuneta/gobj-js 7.25.8 → 7.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -24
- package/dist/gobj-js.cjs.js +608 -132
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +1300 -1027
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +605 -133
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +1344 -1071
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +608 -132
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +1351 -1078
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +608 -132
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +1340 -1067
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +2 -2
package/dist/gobj-js.es.min.js
CHANGED
|
@@ -17,16 +17,15 @@ var e = {
|
|
|
17
17
|
};
|
|
18
18
|
function t(n) {
|
|
19
19
|
return function(n, r) {
|
|
20
|
-
var l, o, i, s, a, u, _, c, f
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
l = l[s.keys[i]];
|
|
20
|
+
for (var l, o, i, s, a, u, _, c, f = 1, g = n.length, d = "", b = 0; b < g; b++) if ("string" == typeof n[b]) d += n[b];
|
|
21
|
+
else if ("object" == typeof n[b]) {
|
|
22
|
+
if ((i = n[b]).keys) for (l = r[f], o = 0; o < i.keys.length; o++) {
|
|
23
|
+
if (null == l) throw new Error(t("[sprintf] Cannot access property \"%s\" of undefined value \"%s\"", i.keys[o], i.keys[o - 1]));
|
|
24
|
+
l = l[i.keys[o]];
|
|
26
25
|
}
|
|
27
|
-
else l =
|
|
28
|
-
if (e.not_type.test(
|
|
29
|
-
switch (e.number.test(
|
|
26
|
+
else l = i.param_no ? r[i.param_no] : r[f++];
|
|
27
|
+
if (e.not_type.test(i.type) && e.not_primitive.test(i.type) && l instanceof Function && (l = l()), e.numeric_arg.test(i.type) && "number" != typeof l && isNaN(l)) throw new TypeError(t("[sprintf] expecting number but found %T", l));
|
|
28
|
+
switch (e.number.test(i.type) && (_ = l >= 0), i.type) {
|
|
30
29
|
case "b":
|
|
31
30
|
l = parseInt(l, 10).toString(2);
|
|
32
31
|
break;
|
|
@@ -38,43 +37,43 @@ function t(n) {
|
|
|
38
37
|
l = parseInt(l, 10);
|
|
39
38
|
break;
|
|
40
39
|
case "j":
|
|
41
|
-
l = JSON.stringify(l, null,
|
|
40
|
+
l = JSON.stringify(l, null, i.width ? parseInt(i.width) : 0);
|
|
42
41
|
break;
|
|
43
42
|
case "e":
|
|
44
|
-
l =
|
|
43
|
+
l = i.precision ? parseFloat(l).toExponential(i.precision) : parseFloat(l).toExponential();
|
|
45
44
|
break;
|
|
46
45
|
case "f":
|
|
47
|
-
l =
|
|
46
|
+
l = i.precision ? parseFloat(l).toFixed(i.precision) : parseFloat(l);
|
|
48
47
|
break;
|
|
49
48
|
case "g":
|
|
50
|
-
l =
|
|
49
|
+
l = i.precision ? String(Number(l.toPrecision(i.precision))) : parseFloat(l);
|
|
51
50
|
break;
|
|
52
51
|
case "o":
|
|
53
52
|
l = (parseInt(l, 10) >>> 0).toString(8);
|
|
54
53
|
break;
|
|
55
54
|
case "s":
|
|
56
|
-
l = String(l), l =
|
|
55
|
+
l = String(l), l = i.precision ? l.substring(0, i.precision) : l;
|
|
57
56
|
break;
|
|
58
57
|
case "t":
|
|
59
|
-
l = String(!!l), l =
|
|
58
|
+
l = String(!!l), l = i.precision ? l.substring(0, i.precision) : l;
|
|
60
59
|
break;
|
|
61
60
|
case "T":
|
|
62
|
-
l = Object.prototype.toString.call(l).slice(8, -1).toLowerCase(), l =
|
|
61
|
+
l = Object.prototype.toString.call(l).slice(8, -1).toLowerCase(), l = i.precision ? l.substring(0, i.precision) : l;
|
|
63
62
|
break;
|
|
64
63
|
case "u":
|
|
65
64
|
l = parseInt(l, 10) >>> 0;
|
|
66
65
|
break;
|
|
67
66
|
case "v":
|
|
68
|
-
l = l.valueOf(), l =
|
|
67
|
+
l = l.valueOf(), l = i.precision ? l.substring(0, i.precision) : l;
|
|
69
68
|
break;
|
|
70
69
|
case "x":
|
|
71
70
|
l = (parseInt(l, 10) >>> 0).toString(16);
|
|
72
71
|
break;
|
|
73
72
|
case "X": l = (parseInt(l, 10) >>> 0).toString(16).toUpperCase();
|
|
74
73
|
}
|
|
75
|
-
e.json.test(
|
|
74
|
+
e.json.test(i.type) ? d += l : (!e.number.test(i.type) || _ && !i.sign ? c = "" : (c = _ ? "+" : "-", l = l.toString().replace(e.sign, "")), a = i.pad_char ? "0" === i.pad_char ? "0" : i.pad_char.charAt(1) : " ", u = i.width - (c + l).length, s = i.width && u > 0 ? a.repeat(u) : "", d += i.align ? c + l + s : "0" === a ? c + s + l : s + c + l);
|
|
76
75
|
}
|
|
77
|
-
return
|
|
76
|
+
return d;
|
|
78
77
|
}(function(t) {
|
|
79
78
|
if (r[t]) return r[t];
|
|
80
79
|
let n, l = t, o = [], i = 0;
|
|
@@ -120,7 +119,7 @@ function l(e, t, n, r) {}
|
|
|
120
119
|
function o(e, t, n, r, l) {
|
|
121
120
|
return {
|
|
122
121
|
result: t,
|
|
123
|
-
comment: n ||
|
|
122
|
+
comment: n || "",
|
|
124
123
|
schema: r || {},
|
|
125
124
|
data: l || []
|
|
126
125
|
};
|
|
@@ -134,7 +133,7 @@ function s(e, t, n, r, l) {
|
|
|
134
133
|
data: l || []
|
|
135
134
|
};
|
|
136
135
|
}
|
|
137
|
-
var a = "7.0.0a", u = null, _ = null, c = null, f = null, g = null, d = null, b = [], p = Object.create(null), m =
|
|
136
|
+
var a = "7.0.0a", u = null, _ = null, c = null, f = null, g = null, d = null, b = [], p = Object.create(null), m = Object.create(null), h = null, E = null, T = 0, y = Object.freeze({
|
|
138
137
|
DTP_STRING: 1,
|
|
139
138
|
DTP_BOOLEAN: 2,
|
|
140
139
|
DTP_INTEGER: 3,
|
|
@@ -169,17 +168,17 @@ var v = Object.freeze({
|
|
|
169
168
|
SDF_AUTHZ_RS: 1048576
|
|
170
169
|
});
|
|
171
170
|
v.SDF_RD, v.SDF_WR, v.SDF_STATS, v.SDF_PERSIST, v.SDF_VOLATIL, v.SDF_RSTATS, v.SDF_PSTATS, v.SDF_WR, v.SDF_PERSIST;
|
|
172
|
-
var
|
|
171
|
+
var O = class {
|
|
173
172
|
constructor(e, t, n = 0, r = null, l = "", o = null, i = null, s = 0, a = null, u = null, _ = null) {
|
|
174
173
|
this.type = e, this.name = t, this.alias = o, this.flag = n, this.default_value = r, this.header = i, this.fillspace = s, this.description = l, this.json_fn = a, this.schema = u, this.authpth = _;
|
|
175
174
|
}
|
|
176
|
-
},
|
|
175
|
+
}, S = () => new O(0, null), N = (e, t, n, r, l) => new O(e, t, n, r, l), w = (e, t, n, r, l, o) => new O(e, t, 0, null, o, n, null, 0, l, r, null), j = (e, t, n, r, l, o, i) => new O(e, t, n, null, i, r, null, 0, o, l, null), R = (e, t, n, r, l) => new O(e, t, n, r, l), $ = (e, t, n, r, l, o) => new O(e, t, n, null, o, r, null, 0, null, l, null), D = (e, t, n, r, l) => new O(e, t, n, null, l, null, null, 0, null, null, r), A = (e, t, n, r, l, o) => new O(e, t, n, null, o, null, r, l), I = class {
|
|
177
176
|
constructor(e, t, n, r, l, o, i, s, a) {
|
|
178
177
|
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = l, this.authz_table = o, this.command_table = i, this.s_user_trace_level = s, this.gclass_flag = Number(a) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
179
178
|
}
|
|
180
179
|
}, k = class {
|
|
181
180
|
constructor(e, t, n, r, l) {
|
|
182
|
-
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv =
|
|
181
|
+
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = jr(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
183
182
|
}
|
|
184
183
|
}, C = Object.freeze({
|
|
185
184
|
gcflag_manual_start: 1,
|
|
@@ -195,11 +194,11 @@ var S = class {
|
|
|
195
194
|
gobj_flag_pure_child: 16,
|
|
196
195
|
gobj_flag_autostart: 32,
|
|
197
196
|
gobj_flag_autoplay: 64
|
|
198
|
-
}),
|
|
197
|
+
}), P = Object.freeze({
|
|
199
198
|
obflag_destroying: 1,
|
|
200
199
|
obflag_destroyed: 2,
|
|
201
200
|
obflag_created: 4
|
|
202
|
-
}),
|
|
201
|
+
}), U = Object.freeze({
|
|
203
202
|
EVF_NO_WARN_SUBS: 1,
|
|
204
203
|
EVF_OUTPUT_EVENT: 2,
|
|
205
204
|
EVF_SYSTEM_EVENT: 4,
|
|
@@ -210,11 +209,11 @@ var S = class {
|
|
|
210
209
|
WALK_BYLEVEL: 4,
|
|
211
210
|
WALK_FIRST2LAST: 16,
|
|
212
211
|
WALK_LAST2FIRST: 32
|
|
213
|
-
}),
|
|
212
|
+
}), V = class {
|
|
214
213
|
constructor(e, t, n) {
|
|
215
214
|
this.event_name = e, this.action = t, this.next_state = n;
|
|
216
215
|
}
|
|
217
|
-
},
|
|
216
|
+
}, G = class {
|
|
218
217
|
constructor(e) {
|
|
219
218
|
this.state_name = e, this.dl_actions = [];
|
|
220
219
|
}
|
|
@@ -224,14 +223,14 @@ var S = class {
|
|
|
224
223
|
}
|
|
225
224
|
};
|
|
226
225
|
var W = 1;
|
|
227
|
-
function
|
|
226
|
+
function x(e) {
|
|
228
227
|
W = 1 === Number(e) ? 1 : 0;
|
|
229
228
|
}
|
|
230
|
-
function
|
|
229
|
+
function K() {
|
|
231
230
|
return W;
|
|
232
231
|
}
|
|
233
232
|
function Y(e) {
|
|
234
|
-
|
|
233
|
+
Yr(e) && (e = JSON.stringify(e)), ur(" ".repeat(Math.max(1, 2 * T)) + String(e));
|
|
235
234
|
}
|
|
236
235
|
var B = Object.freeze({
|
|
237
236
|
TRACE_MACHINE: 65536,
|
|
@@ -333,7 +332,7 @@ function z(e, t) {
|
|
|
333
332
|
return n;
|
|
334
333
|
}
|
|
335
334
|
function X(e, t, n) {
|
|
336
|
-
if (
|
|
335
|
+
if (tl(e)) return void 0 === n ? 268369920 : 65535;
|
|
337
336
|
if (/^[0-9]+$/.test(String(e))) {
|
|
338
337
|
const t = Number(e);
|
|
339
338
|
if (t) return t;
|
|
@@ -344,7 +343,7 @@ function X(e, t, n) {
|
|
|
344
343
|
for (let n = 0; n < t.length && n < 16; n++) if (t[n] && t[n][0] === e) return 1 << n;
|
|
345
344
|
}
|
|
346
345
|
return 0;
|
|
347
|
-
}(String(e), n) || (
|
|
346
|
+
}(String(e), n) || (ir(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
348
347
|
}
|
|
349
348
|
function Z(e) {
|
|
350
349
|
if (Q) return 4294967295;
|
|
@@ -406,43 +405,43 @@ function de() {
|
|
|
406
405
|
return z(H, null);
|
|
407
406
|
}
|
|
408
407
|
function be(e) {
|
|
409
|
-
const t =
|
|
410
|
-
return t ? z(t.trace_level | q, t.s_user_trace_level) : (
|
|
408
|
+
const t = Jr(e) ? Me(e) : e;
|
|
409
|
+
return t ? z(t.trace_level | q, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
411
410
|
}
|
|
412
411
|
function pe(e) {
|
|
413
|
-
const t =
|
|
414
|
-
return t ? z(t.trace_level, t.s_user_trace_level) : (
|
|
412
|
+
const t = Jr(e) ? Me(e) : e;
|
|
413
|
+
return t ? z(t.trace_level, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
415
414
|
}
|
|
416
415
|
function me(e) {
|
|
417
|
-
const t =
|
|
418
|
-
return t ? z(t.no_trace_level, t.s_user_trace_level) : (
|
|
416
|
+
const t = Jr(e) ? Me(e) : e;
|
|
417
|
+
return t ? z(t.no_trace_level, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
419
418
|
}
|
|
420
|
-
function
|
|
419
|
+
function he(e) {
|
|
421
420
|
return Q = Number(e) || 0, 0;
|
|
422
421
|
}
|
|
423
|
-
function
|
|
424
|
-
const r =
|
|
425
|
-
if (!r) return
|
|
422
|
+
function Ee(e, t, n) {
|
|
423
|
+
const r = Jr(e) ? Me(e) : e;
|
|
424
|
+
if (!r) return ir(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
426
425
|
const l = null === t ? 4294967295 : X(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
427
426
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
428
427
|
}
|
|
429
428
|
function Te(e, t, n) {
|
|
430
|
-
if (!e) return
|
|
429
|
+
if (!e) return ir("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
431
430
|
const r = X(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
432
431
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
433
432
|
}
|
|
434
433
|
function ye(e, t, n) {
|
|
435
|
-
const r =
|
|
436
|
-
if (!r) return
|
|
434
|
+
const r = Jr(e) ? Me(e) : e;
|
|
435
|
+
if (!r) return ir(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
437
436
|
const l = null === t ? 4294967295 : X(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
438
437
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
439
438
|
}
|
|
440
439
|
function ve(e, t, n) {
|
|
441
|
-
if (!e) return
|
|
440
|
+
if (!e) return ir("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
442
441
|
const r = X(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
443
442
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
444
443
|
}
|
|
445
|
-
function
|
|
444
|
+
function Oe() {
|
|
446
445
|
return J.map(([e, t, n]) => ({
|
|
447
446
|
name: e,
|
|
448
447
|
bit: t,
|
|
@@ -450,176 +449,175 @@ function Se() {
|
|
|
450
449
|
set: !!(q & t)
|
|
451
450
|
}));
|
|
452
451
|
}
|
|
453
|
-
function
|
|
452
|
+
function Se(e, t, n, r, l, o, i) {
|
|
454
453
|
u = t, _ = n, c = r, f = l, g = o, d = i;
|
|
455
|
-
const s = [["EV_STATE_CHANGED",
|
|
454
|
+
const s = [["EV_STATE_CHANGED", U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS], [0, 0]];
|
|
456
455
|
for (let e = 0; e < s.length; e++) {
|
|
457
456
|
let t = s[e][0], n = s[e][1];
|
|
458
|
-
|
|
457
|
+
Ue(b, t, n);
|
|
459
458
|
}
|
|
460
459
|
return 0;
|
|
461
460
|
}
|
|
462
461
|
function Ne(e, t) {
|
|
463
462
|
let n = {};
|
|
464
|
-
if (!
|
|
463
|
+
if (!Br(t)) return ir("sdata_desc MUST be an array"), cr(t), n;
|
|
465
464
|
for (let r = 0; r < t.length; r++) {
|
|
466
465
|
const l = t[r];
|
|
467
|
-
l.name &&
|
|
466
|
+
l.name && we(e, n, l);
|
|
468
467
|
}
|
|
469
468
|
return n;
|
|
470
469
|
}
|
|
471
|
-
function
|
|
470
|
+
function we(e, t, n) {
|
|
472
471
|
let r, l = n.default_value;
|
|
473
472
|
switch (n.type) {
|
|
474
473
|
case y.DTP_STRING:
|
|
475
474
|
r = String(l);
|
|
476
475
|
break;
|
|
477
476
|
case y.DTP_BOOLEAN:
|
|
478
|
-
r =
|
|
477
|
+
r = nl(l);
|
|
479
478
|
break;
|
|
480
479
|
case y.DTP_INTEGER:
|
|
481
|
-
r = parseInt(l), isNaN(r) &&
|
|
480
|
+
r = parseInt(l), isNaN(r) && ir(`${$t(e)}: attr NaN: ${n.name}`);
|
|
482
481
|
break;
|
|
483
482
|
case y.DTP_REAL:
|
|
484
|
-
r = Number(l), isNaN(r) &&
|
|
483
|
+
r = Number(l), isNaN(r) && ir(`${$t(e)}: attr NaN: ${n.name}`);
|
|
485
484
|
break;
|
|
486
485
|
case y.DTP_LIST:
|
|
487
|
-
if (
|
|
486
|
+
if (Jr(l)) try {
|
|
488
487
|
r = JSON.parse(l);
|
|
489
488
|
} catch (e) {
|
|
490
|
-
|
|
489
|
+
ir(`JSON parse error: ${e.message}`);
|
|
491
490
|
}
|
|
492
491
|
else r = l;
|
|
493
|
-
|
|
492
|
+
Br(r) || (r = []);
|
|
494
493
|
break;
|
|
495
494
|
case y.DTP_DICT:
|
|
496
|
-
if (
|
|
495
|
+
if (Jr(l)) try {
|
|
497
496
|
r = JSON.parse(l);
|
|
498
497
|
} catch (e) {
|
|
499
|
-
|
|
498
|
+
ir(`JSON parse error: ${e.message}`);
|
|
500
499
|
}
|
|
501
500
|
else r = l;
|
|
502
|
-
|
|
501
|
+
Yr(r) || (r = {});
|
|
503
502
|
break;
|
|
504
503
|
case y.DTP_JSON:
|
|
505
|
-
if (
|
|
504
|
+
if ("" === l || void 0 === l) r = null;
|
|
505
|
+
else if (Jr(l)) try {
|
|
506
506
|
r = JSON.parse(l);
|
|
507
507
|
} catch (e) {
|
|
508
|
-
|
|
508
|
+
ir(`JSON parse error: ${e.message}`);
|
|
509
509
|
}
|
|
510
510
|
else r = l;
|
|
511
511
|
break;
|
|
512
512
|
case y.DTP_POINTER: r = l;
|
|
513
513
|
}
|
|
514
|
-
return void 0 === r && (
|
|
514
|
+
return void 0 === r && (ir(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
515
515
|
}
|
|
516
516
|
function je(e, t, n, r) {
|
|
517
517
|
let l;
|
|
518
518
|
switch (n.type) {
|
|
519
519
|
case y.DTP_STRING:
|
|
520
520
|
if (null == r) l = "";
|
|
521
|
-
else if (
|
|
521
|
+
else if (Jr(r)) l = String(r);
|
|
522
522
|
else {
|
|
523
523
|
let e = JSON.stringify(r);
|
|
524
524
|
e && (l = String(e));
|
|
525
525
|
}
|
|
526
526
|
break;
|
|
527
527
|
case y.DTP_BOOLEAN:
|
|
528
|
-
l =
|
|
528
|
+
l = nl(r);
|
|
529
529
|
break;
|
|
530
530
|
case y.DTP_INTEGER:
|
|
531
|
-
l = parseInt(r), isNaN(l)
|
|
531
|
+
if (l = parseInt(r), isNaN(l)) return ir(`${$t(e)}: attr NaN: ${n.name}`), -1;
|
|
532
532
|
break;
|
|
533
533
|
case y.DTP_REAL:
|
|
534
|
-
l = Number(r), isNaN(l)
|
|
534
|
+
if (l = Number(r), isNaN(l)) return ir(`${$t(e)}: attr NaN: ${n.name}`), -1;
|
|
535
535
|
break;
|
|
536
536
|
case y.DTP_LIST:
|
|
537
|
-
if (
|
|
537
|
+
if (Jr(r)) try {
|
|
538
538
|
l = JSON.parse(r);
|
|
539
539
|
} catch (e) {
|
|
540
|
-
|
|
540
|
+
ir(`JSON parse error: ${e.message}`);
|
|
541
541
|
}
|
|
542
542
|
else l = r;
|
|
543
|
-
if (!
|
|
543
|
+
if (!Br(l)) return ir(`attr must be an array: ${n.name}`), -1;
|
|
544
544
|
break;
|
|
545
545
|
case y.DTP_DICT:
|
|
546
|
-
if (
|
|
546
|
+
if (Jr(r)) try {
|
|
547
547
|
l = JSON.parse(r);
|
|
548
548
|
} catch (e) {
|
|
549
|
-
|
|
549
|
+
ir(`JSON parse error: ${e.message}`);
|
|
550
550
|
}
|
|
551
551
|
else l = r;
|
|
552
|
-
if (!
|
|
552
|
+
if (!Yr(l)) return ir(`attr must be an object: ${n.name}`), -1;
|
|
553
553
|
break;
|
|
554
554
|
case y.DTP_JSON:
|
|
555
|
-
if (
|
|
555
|
+
if (l = r, Jr(r)) try {
|
|
556
556
|
l = JSON.parse(r);
|
|
557
557
|
} catch (e) {
|
|
558
|
-
|
|
558
|
+
l = r;
|
|
559
559
|
}
|
|
560
|
-
else l = r;
|
|
561
|
-
if (!wr(l) && !jr(l)) return rr(`attr must be a json dict/list: ${n.name}`), -1;
|
|
562
560
|
break;
|
|
563
561
|
case y.DTP_POINTER: l = r;
|
|
564
562
|
}
|
|
565
|
-
return void 0 === l &&
|
|
563
|
+
return void 0 === l && ir(`${$t(e)}: attr undefined: ${n.name}`), t[n.name] = l, Yr(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = l), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
566
564
|
}
|
|
567
|
-
function
|
|
565
|
+
function Re(e) {
|
|
568
566
|
return e.jn_attrs;
|
|
569
567
|
}
|
|
570
|
-
function De(e, t, n) {
|
|
571
|
-
return Qt(e, t) ? we(e) : e && e.bottom_gobj ? De(e.bottom_gobj, t, n) : (n && rr(`GClass Attribute NOT FOUND: ${Dt(e)}, attr ${t}`), null);
|
|
572
|
-
}
|
|
573
568
|
function $e(e, t, n) {
|
|
574
|
-
|
|
569
|
+
return Qt(e, t) ? Re(e) : e && e.bottom_gobj ? $e(e.bottom_gobj, t, n) : (n && ir(`GClass Attribute NOT FOUND: ${$t(e)}, attr ${t}`), null);
|
|
570
|
+
}
|
|
571
|
+
function De(e, t, n) {
|
|
572
|
+
if (!(e && e instanceof I)) return n && ir("gclass NULL"), null;
|
|
575
573
|
if (!t) return e.attrs_table;
|
|
576
574
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
577
575
|
const r = e.attrs_table[n];
|
|
578
576
|
if (r.name && r.name === t) return r;
|
|
579
577
|
}
|
|
580
|
-
return n &&
|
|
578
|
+
return n && ir(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
581
579
|
}
|
|
582
580
|
function Ae(e, t, n, r, l, o, i, s, a, u, _) {
|
|
583
|
-
if (
|
|
584
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
585
|
-
if (Me(e)) return
|
|
581
|
+
if (tl(e)) return ir("gclass_name EMPTY"), null;
|
|
582
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return ir(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
583
|
+
if (Me(e)) return ir(`GClass ALREADY exists: ${e}`), null;
|
|
586
584
|
let c = new I(e, r, l, o, i, s, a, u, _);
|
|
587
585
|
(function(e, t) {
|
|
588
|
-
e && e instanceof I ? t ? p[t] ?
|
|
586
|
+
e && e instanceof I ? t ? p[t] ? ir(`gclass ALREADY REGISTERED: ${t}`) : p[t] = e : ir("gclass_name undefined") : ir("gclass undefined");
|
|
589
587
|
})(c, e);
|
|
590
588
|
const f = n.length;
|
|
591
589
|
for (let e = 0; e < f; e++) {
|
|
592
590
|
let t = n[e][0], r = n[e][1];
|
|
593
|
-
if (
|
|
591
|
+
if (tl(t)) continue;
|
|
594
592
|
if (Le(c, t) < 0) return Ie(c), null;
|
|
595
593
|
const l = r.length;
|
|
596
594
|
for (let e = 0; e < l; e++) {
|
|
597
595
|
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
598
|
-
|
|
596
|
+
tl(n) || Pe(c, t, n, l, o);
|
|
599
597
|
}
|
|
600
598
|
}
|
|
601
599
|
for (let e = 0; e < t.length; e++) {
|
|
602
600
|
let n = t[e][0], r = t[e][1];
|
|
603
|
-
if (!
|
|
604
|
-
if (
|
|
601
|
+
if (!tl(n)) {
|
|
602
|
+
if (Ve(c, n)) return ir(`SMachine: event repeated in input_events: ${n}`), Ie(c), null;
|
|
605
603
|
Fe(c, n, r);
|
|
606
604
|
}
|
|
607
605
|
}
|
|
608
606
|
if (!c.fsm_checked) {
|
|
609
|
-
if (
|
|
607
|
+
if (Ge(c) < 0) return Ie(c), null;
|
|
610
608
|
c.fsm_checked = !0;
|
|
611
609
|
}
|
|
612
610
|
return c;
|
|
613
611
|
}
|
|
614
612
|
function Ie(e) {
|
|
615
613
|
let t;
|
|
616
|
-
if (
|
|
614
|
+
if (Jr(e)) t = e;
|
|
617
615
|
else {
|
|
618
|
-
if (!(e instanceof I)) return
|
|
616
|
+
if (!(e instanceof I)) return ir("Cannot unregister gclass, type unknown"), -1;
|
|
619
617
|
t = e.gclass_name;
|
|
620
618
|
}
|
|
621
619
|
let n = p[t];
|
|
622
|
-
return n ? n.instances > 0 ? (
|
|
620
|
+
return n ? n.instances > 0 ? (ir(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete p[t], 0) : (ir(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
623
621
|
}
|
|
624
622
|
function ke(e, t) {
|
|
625
623
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -638,22 +636,22 @@ function Ce(e, t) {
|
|
|
638
636
|
return null;
|
|
639
637
|
}
|
|
640
638
|
function Le(e, t) {
|
|
641
|
-
return e instanceof I ? ke(e, t) ? (
|
|
639
|
+
return e instanceof I ? ke(e, t) ? (ir(`state already exists: ${t}`), -1) : (e.dl_states.push(new G(t)), 0) : (ir("Cannot add state, typeof not GClass"), -1);
|
|
642
640
|
}
|
|
643
|
-
function
|
|
644
|
-
if (!(e instanceof I)) return
|
|
645
|
-
if (
|
|
641
|
+
function Pe(e, t, n, r, l) {
|
|
642
|
+
if (!(e instanceof I)) return ir("Cannot add state, typeof not GClass"), -1;
|
|
643
|
+
if (tl(t)) return ir("state_name EMPTY"), -1;
|
|
646
644
|
let o = ke(e, t);
|
|
647
|
-
return o ? Ce(o, n) ? (
|
|
645
|
+
return o ? Ce(o, n) ? (ir(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new V(n, r, l)), 0) : (ir(`state not found: ${t}`), -1);
|
|
648
646
|
}
|
|
649
|
-
function
|
|
650
|
-
|
|
647
|
+
function Ue(e, t, n) {
|
|
648
|
+
tl(t) || e.push(new M(t, n));
|
|
651
649
|
}
|
|
652
650
|
function Fe(e, t, n) {
|
|
653
|
-
return e instanceof I ?
|
|
651
|
+
return e instanceof I ? Ue(e.dl_events, t, n) : (ir("Cannot add state, typeof not GClass"), -1);
|
|
654
652
|
}
|
|
655
|
-
function
|
|
656
|
-
if (!(e instanceof I)) return
|
|
653
|
+
function Ve(e, t) {
|
|
654
|
+
if (!(e instanceof I)) return ir("Cannot add state, typeof not GClass"), 0;
|
|
657
655
|
const n = e.dl_events.length, r = e.dl_events;
|
|
658
656
|
for (let e = 0; e < n; e++) {
|
|
659
657
|
let n = r[e];
|
|
@@ -661,26 +659,26 @@ function Ge(e, t) {
|
|
|
661
659
|
}
|
|
662
660
|
return null;
|
|
663
661
|
}
|
|
664
|
-
function
|
|
665
|
-
if (!(e instanceof I)) return
|
|
662
|
+
function Ge(e) {
|
|
663
|
+
if (!(e instanceof I)) return ir("Cannot add state, typeof not GClass"), -1;
|
|
666
664
|
let t = 0;
|
|
667
|
-
|
|
665
|
+
Wr(e.dl_states) || (ir(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
668
666
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
669
667
|
let r = e.dl_states[n];
|
|
670
|
-
if (!
|
|
668
|
+
if (!tl(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
671
669
|
let l = r.dl_actions[n];
|
|
672
|
-
|
|
670
|
+
tl(l.event_name) || (Ve(e, l.event_name) || (ir(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${l.event_name}`), t += -1), l.next_state && (ke(e, l.next_state) || (ir(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
673
671
|
}
|
|
674
672
|
}
|
|
675
673
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
676
674
|
let r = e.dl_events[n];
|
|
677
|
-
if (!
|
|
675
|
+
if (!tl(r.event_name) && (qr(r.event_flag) || (ir(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & U.EVF_OUTPUT_EVENT))) {
|
|
678
676
|
let n = !1;
|
|
679
677
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
680
678
|
let l = e.dl_states[t];
|
|
681
|
-
|
|
679
|
+
tl(l.state_name) || Ce(l, r.event_name) && (n = !0);
|
|
682
680
|
}
|
|
683
|
-
n || (
|
|
681
|
+
n || (ir(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
684
682
|
}
|
|
685
683
|
}
|
|
686
684
|
return t;
|
|
@@ -690,85 +688,89 @@ function Me(e, t) {
|
|
|
690
688
|
try {
|
|
691
689
|
n = p[e];
|
|
692
690
|
} catch (e) {}
|
|
693
|
-
return n || (t &&
|
|
691
|
+
return n || (t && ir(`gclass not found: ${e}`), null);
|
|
694
692
|
}
|
|
695
693
|
function We() {
|
|
696
694
|
let e = [];
|
|
697
|
-
for (const t of Object.keys(m))
|
|
695
|
+
for (const t of Object.keys(m)) Fr(e, t);
|
|
698
696
|
return e;
|
|
699
697
|
}
|
|
700
|
-
function
|
|
701
|
-
return !
|
|
698
|
+
function xe() {
|
|
699
|
+
return !E || E.obflag & P.obflag_destroyed ? null : E;
|
|
702
700
|
}
|
|
703
|
-
function
|
|
701
|
+
function Ke(e, t) {
|
|
702
|
+
if (!Jr(e)) return ir(`gobj_find_service(): service name must be a string: ${e}`), null;
|
|
704
703
|
e = e.toLowerCase();
|
|
705
|
-
return m[e] || (t &&
|
|
704
|
+
return m[e] || (t && ir(`gobj service not found: ${e}`), null);
|
|
706
705
|
}
|
|
707
706
|
function Ye(e) {
|
|
708
707
|
let t = jt(e);
|
|
709
|
-
return t = t.toLowerCase(), m[t] &&
|
|
708
|
+
return t = t.toLowerCase(), m[t] && ir(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), m[t] = e, 0;
|
|
710
709
|
}
|
|
711
710
|
function Be(e, t) {
|
|
712
|
-
t.parent &&
|
|
711
|
+
t.parent && ir(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
713
712
|
}
|
|
714
713
|
function Je(e, t) {
|
|
715
|
-
let n =
|
|
716
|
-
n >= 0 && (
|
|
714
|
+
let n = Oo(e.dl_children, t);
|
|
715
|
+
n >= 0 && (Vr(e.dl_children, n), t.parent = null);
|
|
717
716
|
}
|
|
718
717
|
function qe(e, t) {
|
|
719
|
-
return yt(e) ? u ? u(e, t) : -1 : (
|
|
718
|
+
return yt(e) ? u ? u(e, t) : -1 : (ir(`${$t(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
720
719
|
}
|
|
721
720
|
function He(e, t) {
|
|
722
|
-
return yt(e) ? _ ? _(e, t) : -1 : (
|
|
721
|
+
return yt(e) ? _ ? _(e, t) : -1 : (ir(`${$t(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
723
722
|
}
|
|
724
723
|
function Qe(e, t) {
|
|
725
|
-
return yt(e) ? c ? c(e, t) : -1 : (
|
|
724
|
+
return yt(e) ? c ? c(e, t) : -1 : (ir(`${$t(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
726
725
|
}
|
|
727
726
|
function ze(e, t) {
|
|
728
727
|
return f ? f(e, t) : null;
|
|
729
728
|
}
|
|
730
729
|
function Xe(e, t) {
|
|
731
|
-
"__json_config_variables__" !== t &&
|
|
730
|
+
"__json_config_variables__" !== t && ir(`GClass Attribute NOT FOUND: ${$t(e)}, attr ${t}`);
|
|
732
731
|
}
|
|
733
732
|
function Ze(e, t, n) {
|
|
734
733
|
let r = t;
|
|
735
734
|
(function(e, t, n, r, l) {
|
|
736
|
-
if (!e || !t) return
|
|
735
|
+
if (!e || !t) return ir("hsdata or kw NULL"), -1;
|
|
737
736
|
let o = 0;
|
|
738
737
|
for (const [i, s] of Object.entries(t)) {
|
|
739
|
-
const t =
|
|
740
|
-
t ? (-1 === n || t.flag & n) && (t.flag & v.SDF_DEPRECATED &&
|
|
738
|
+
const t = De(l.gclass, i, !1);
|
|
739
|
+
t ? (-1 === n || t.flag & n) && (t.flag & v.SDF_DEPRECATED && sr(`${$t(l)}: Deprecated attribute used in gobj creation: ${i}`), o += je(l, e, t, s)) : r && (r(l, i), o--);
|
|
741
740
|
}
|
|
742
741
|
return o;
|
|
743
|
-
})(
|
|
742
|
+
})(Re(e), r, -1, e.gclass.gclass_flag & C.gcflag_ignore_unknown_attrs ? 0 : Xe, e) < 0 && (ir(`${$t(e)} json2data() FAILED`), wr(r));
|
|
744
743
|
}
|
|
745
744
|
function et(e, n, r, l, o) {
|
|
746
745
|
if (o & L.gobj_flag_yuno) {
|
|
747
|
-
if (
|
|
746
|
+
if (h) return ir("__yuno__ already created"), null;
|
|
748
747
|
o |= L.gobj_flag_service;
|
|
749
748
|
} else {
|
|
750
|
-
if (!l) return
|
|
751
|
-
if (!("string" == typeof l || l instanceof k)) return
|
|
752
|
-
if (
|
|
749
|
+
if (!l) return ir("gobj NEEDS a parent!"), null;
|
|
750
|
+
if (!("string" == typeof l || l instanceof k)) return ir(`BAD TYPE of parent: ${l}`), null;
|
|
751
|
+
if (Jr(l)) {
|
|
752
|
+
const e = l;
|
|
753
|
+
if (!(l = Ke(e))) return sr(`parent service not found: ${e}`), null;
|
|
754
|
+
}
|
|
753
755
|
}
|
|
754
|
-
if (o & L.gobj_flag_service &&
|
|
756
|
+
if (o & L.gobj_flag_service && Ke(e, !1)) return ir(`service ALREADY registered: ${n}^${e}`), null;
|
|
755
757
|
if (o & L.gobj_flag_default_service) {
|
|
756
|
-
if (
|
|
758
|
+
if (E) return ir(`default service ALREADY registered: ${n}^${e}`), null;
|
|
757
759
|
o |= L.gobj_flag_service;
|
|
758
760
|
}
|
|
759
|
-
if (
|
|
761
|
+
if (tl(n)) return ir("gclass_name must be a string"), null;
|
|
760
762
|
let i = Me(n, !1);
|
|
761
|
-
if (!i) return
|
|
762
|
-
if (!
|
|
763
|
-
if (!
|
|
764
|
-
if (e.includes("`")) return
|
|
765
|
-
if (e.includes("^")) return
|
|
763
|
+
if (!i) return ir(`GClass not registered: ${n}^${e}`), null;
|
|
764
|
+
if (!Jr(e)) return ir(`gobj_name must be a string: ${n}`), null;
|
|
765
|
+
if (!tl(e)) {
|
|
766
|
+
if (e.includes("`")) return ir(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
767
|
+
if (e.includes("^")) return ir(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
766
768
|
}
|
|
767
769
|
let s = new k(e, i, r, l, o);
|
|
768
770
|
s.jn_attrs = Ne(s, i.attrs_table);
|
|
769
771
|
for (const [e, t] of Object.entries(s.jn_attrs)) e in s.priv && (s.priv[e] = t);
|
|
770
772
|
let a = te(s);
|
|
771
|
-
return a && Y(t("💙💙⏩ creating: %s^%s", i.gclass_name, e)), s.gobj_flag & L.gobj_flag_service && Ye(s), s.gobj_flag & L.gobj_flag_yuno && (
|
|
773
|
+
return a && Y(t("💙💙⏩ creating: %s^%s", i.gclass_name, e)), s.gobj_flag & L.gobj_flag_service && Ye(s), s.gobj_flag & L.gobj_flag_yuno && (h = s), s.gobj_flag & L.gobj_flag_default_service && (E = s), s.gobj_flag & L.gobj_flag_yuno || Be(l, s), s.obflag |= P.obflag_created, s.gclass.instances++, Ze(s, r), s.gobj_flag & L.gobj_flag_service && u && u(s, null), s.gclass.gmt.mt_create2 ? s.gclass.gmt.mt_create2(s, r) : s.gclass.gmt.mt_create && s.gclass.gmt.mt_create(s), l && l.gclass.gmt.mt_child_added && (a && Y(t("👦👦🔵 child_added(%s): %s", Dt(l), $t(s))), l.gclass.gmt.mt_child_added(l, s)), a && Y(t("💙💙⏪ created: %s", Dt(s))), s;
|
|
772
774
|
}
|
|
773
775
|
function tt(e, t, n) {
|
|
774
776
|
return et(e, t, n, null, L.gobj_flag_yuno);
|
|
@@ -789,78 +791,78 @@ function it(e, t, n, r) {
|
|
|
789
791
|
return et(e, t, n, r, 0);
|
|
790
792
|
}
|
|
791
793
|
function st(e) {
|
|
792
|
-
if (Ct(e)) return void
|
|
793
|
-
e.__refs__ > 0 &&
|
|
794
|
+
if (Ct(e)) return void ir("gobj NULL or DESTROYED");
|
|
795
|
+
e.__refs__ > 0 && ir(`${$t(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (ir(`Destroying a PLAYING gobj: ${Dt(e)}`), ht(e)), e.running && (ir(`Destroying a RUNNING gobj: ${Dt(e)}`), gt(e)), e.obflag |= P.obflag_destroying, function(e) {
|
|
794
796
|
if (0 === pn.length) return;
|
|
795
797
|
for (let t of pn) t.src === e && (t.src = null);
|
|
796
798
|
pn = pn.filter((t) => t.dst !== e);
|
|
797
799
|
}(e);
|
|
798
800
|
let n = te(e);
|
|
799
|
-
n && Y(t("💔💔⏩ destroying: %s",
|
|
801
|
+
n && Y(t("💔💔⏩ destroying: %s", Dt(e)));
|
|
800
802
|
let r = At(e);
|
|
801
|
-
r && r.gclass.gmt.mt_child_removed && (n && Y(t("👦👦🔴 child_removed(%s): %s",
|
|
803
|
+
r && r.gclass.gmt.mt_child_removed && (n && Y(t("👦👦🔴 child_removed(%s): %s", Dt(r), $t(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & L.gobj_flag_service && function(e) {
|
|
802
804
|
let t = jt(e);
|
|
803
|
-
t = t.toLowerCase(), m[t] ? delete m[t] :
|
|
804
|
-
}(e),
|
|
805
|
+
t = t.toLowerCase(), m[t] ? delete m[t] : ir(`"service NOT found in register": ${t}`);
|
|
806
|
+
}(e), e === E && (E = null), In(e, e.dl_subscriptions, !0), In(e, e.dl_subscribings, !0), r && (Je(r, e), It(e) && (Lt(r) !== e || Ct(r) || Pt(r, null))), function(e) {
|
|
805
807
|
let t = e.dl_children.slice();
|
|
806
808
|
for (let e = 0; e < t.length; e++) {
|
|
807
809
|
let n = t[e];
|
|
808
810
|
Ct(n) || st(n);
|
|
809
811
|
}
|
|
810
|
-
}(e), e.obflag &
|
|
812
|
+
}(e), e.obflag & P.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n && Y(t("💔💔⏪ destroyed: %s", Dt(e))), e.obflag |= P.obflag_destroyed, e.obflag & P.obflag_created && e.gclass.instances--;
|
|
811
813
|
}
|
|
812
814
|
function at(e) {
|
|
813
|
-
if (Ct(e)) return
|
|
814
|
-
if (e.running) return
|
|
815
|
-
if (e.disabled) return
|
|
816
|
-
re(e) && Y(t("⏺ ⏺ start: %s",
|
|
815
|
+
if (Ct(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
816
|
+
if (e.running) return ir(`${$t(e)}: GObj ALREADY RUNNING`), -1;
|
|
817
|
+
if (e.disabled) return ir(`${$t(e)}: GObj DISABLED`), -1;
|
|
818
|
+
re(e) && Y(t("⏺ ⏺ start: %s", Dt(e))), e.running = !0;
|
|
817
819
|
let n = 0;
|
|
818
820
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
819
821
|
}
|
|
820
822
|
function ut(e, t, n) {
|
|
821
|
-
return e.gclass.gclass_flag & C.gcflag_manual_start || Ct(e) ||
|
|
823
|
+
return e.gclass.gclass_flag & C.gcflag_manual_start || Ct(e) || Et(e) || Tt(e) || at(e), 0;
|
|
822
824
|
}
|
|
823
825
|
function _t(e) {
|
|
824
|
-
return Ct(e) ? (
|
|
826
|
+
return Ct(e) ? (ir("gobj NULL or DESTROYED"), -1) : Ft(e, F.WALK_FIRST2LAST, ut, 0, 0);
|
|
825
827
|
}
|
|
826
828
|
function ct(e, t, n) {
|
|
827
|
-
return e.gclass.gclass_flag & C.gcflag_manual_start || Tt(e) ? 1 : (
|
|
829
|
+
return e.gclass.gclass_flag & C.gcflag_manual_start || Tt(e) ? 1 : (Et(e) || at(e), 0);
|
|
828
830
|
}
|
|
829
831
|
function ft(e) {
|
|
830
|
-
return Ct(e) ? (
|
|
832
|
+
return Ct(e) ? (ir("gobj NULL or DESTROYED"), -1) : (re(e) && Y(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", Dt(e))), e.gclass.gclass_flag & C.gcflag_manual_start || e.disabled ? 0 : (e.running || at(e), Vt(e, F.WALK_TOP2BOTTOM, ct, 0, 0)));
|
|
831
833
|
}
|
|
832
834
|
function gt(e) {
|
|
833
|
-
if (Ct(e)) return
|
|
834
|
-
if (!e.running) return
|
|
835
|
-
e.playing && (
|
|
835
|
+
if (Ct(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
836
|
+
if (!e.running) return ir(`${$t(e)}: GObj NOT RUNNING`), -1;
|
|
837
|
+
e.playing && (sr(`${$t(e)}: GObj stopping without previous pause`), ht(e)), re(e) && Y(t("⏹ ⏹ stop: %s", Dt(e))), e.running = !1;
|
|
836
838
|
let n = 0;
|
|
837
839
|
return e.gclass.gmt.mt_stop && (n = e.gclass.gmt.mt_stop(e)), n;
|
|
838
840
|
}
|
|
839
841
|
function dt(e, t, n) {
|
|
840
|
-
return
|
|
842
|
+
return Et(e) && gt(e), 0;
|
|
841
843
|
}
|
|
842
844
|
function bt(e) {
|
|
843
|
-
return Ct(e) ? (
|
|
845
|
+
return Ct(e) ? (ir("gobj NULL or DESTROYED"), -1) : Ft(e, F.WALK_FIRST2LAST, dt, 0, 0);
|
|
844
846
|
}
|
|
845
847
|
function pt(e) {
|
|
846
|
-
return Ct(e) ? (
|
|
848
|
+
return Ct(e) ? (ir("gobj NULL or DESTROYED"), -1) : (re(e) && Y(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Dt(e))), Et(e) && gt(e), Vt(e, F.WALK_TOP2BOTTOM, dt, 0, 0));
|
|
847
849
|
}
|
|
848
850
|
function mt(e) {
|
|
849
|
-
if (Ct(e)) return
|
|
850
|
-
if (e.playing) return
|
|
851
|
-
if (e.disabled) return
|
|
852
|
-
if (!
|
|
853
|
-
if (e.gclass.gclass_flag & C.gcflag_required_start_to_play) return
|
|
854
|
-
|
|
855
|
-
}
|
|
856
|
-
re(e) && Y(t("⏯ ⏯ play: %s",
|
|
851
|
+
if (Ct(e)) return ir(`gobj NULL or DESTROYED: ${$t(e)}`), -1;
|
|
852
|
+
if (e.playing) return ir(`${$t(e)}: GObj ALREADY PLAYING`), -1;
|
|
853
|
+
if (e.disabled) return ir(`${$t(e)}: GObj DISABLED`), -1;
|
|
854
|
+
if (!Et(e)) {
|
|
855
|
+
if (e.gclass.gclass_flag & C.gcflag_required_start_to_play) return ir(`${$t(e)}: Cannot play, start not done`), -1;
|
|
856
|
+
sr(`${$t(e)}: GObj playing without previous start`), at(e);
|
|
857
|
+
}
|
|
858
|
+
re(e) && Y(t("⏯ ⏯ play: %s", Dt(e))), e.playing = !0;
|
|
857
859
|
let n = 0;
|
|
858
860
|
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), (n < 0 || !1 === n) && (e.playing = !1)), n;
|
|
859
861
|
}
|
|
860
|
-
function Et(e) {
|
|
861
|
-
return Ct(e) ? (rr("gobj NULL or DESTROYED"), -1) : e.playing ? (re(e) && Y(t("⏸ ⏸ pause: %s", $t(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (rr(`${Dt(e)}: GObj NOT PLAYING`), -1);
|
|
862
|
-
}
|
|
863
862
|
function ht(e) {
|
|
863
|
+
return Ct(e) ? (ir("gobj NULL or DESTROYED"), -1) : e.playing ? (re(e) && Y(t("⏸ ⏸ pause: %s", Dt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (ir(`${$t(e)}: GObj NOT PLAYING`), -1);
|
|
864
|
+
}
|
|
865
|
+
function Et(e) {
|
|
864
866
|
return !Ct(e) && e.running;
|
|
865
867
|
}
|
|
866
868
|
function Tt(e) {
|
|
@@ -872,77 +874,77 @@ function yt(e) {
|
|
|
872
874
|
function vt(e) {
|
|
873
875
|
return !Ct(e) && e.playing;
|
|
874
876
|
}
|
|
875
|
-
function St() {
|
|
876
|
-
return !E || E.obflag & U.obflag_destroyed ? null : E;
|
|
877
|
-
}
|
|
878
877
|
function Ot() {
|
|
879
|
-
|
|
878
|
+
return !h || h.obflag & P.obflag_destroyed ? null : h;
|
|
879
|
+
}
|
|
880
|
+
function St() {
|
|
881
|
+
let e = Ot();
|
|
880
882
|
return e ? jt(e) : "";
|
|
881
883
|
}
|
|
882
884
|
function Nt() {
|
|
883
|
-
let e =
|
|
885
|
+
let e = Ot();
|
|
884
886
|
return e ? tn(e, "yuno_role") : "";
|
|
885
887
|
}
|
|
886
|
-
function
|
|
887
|
-
let e =
|
|
888
|
+
function wt() {
|
|
889
|
+
let e = Ot();
|
|
888
890
|
return e ? tn(e, "yuno_id") : "";
|
|
889
891
|
}
|
|
890
892
|
function jt(e) {
|
|
891
|
-
return
|
|
893
|
+
return el(e) ? e.gobj_name : (ir("gobj bad type"), null);
|
|
892
894
|
}
|
|
893
|
-
function
|
|
894
|
-
return
|
|
895
|
-
}
|
|
896
|
-
function Dt(e) {
|
|
897
|
-
return Ur(e) ? e.gclass.gclass_name + "^" + jt(e) : (rr("gobj bad type"), null);
|
|
895
|
+
function Rt(e) {
|
|
896
|
+
return el(e) ? e.gclass.gclass_name : (ir("gobj NULL of bad type"), null);
|
|
898
897
|
}
|
|
899
898
|
function $t(e) {
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
899
|
+
return el(e) ? e.gclass.gclass_name + "^" + jt(e) : (ir("gobj bad type"), null);
|
|
900
|
+
}
|
|
901
|
+
function Dt(e) {
|
|
902
|
+
if (!el(e)) return ir("gobj NULL of bad type"), null;
|
|
903
|
+
let t = $t(e), n = At(e);
|
|
904
|
+
for (; n;) t = $t(n) + "`" + t, n = At(n);
|
|
903
905
|
return t;
|
|
904
906
|
}
|
|
905
907
|
function At(e) {
|
|
906
|
-
return
|
|
908
|
+
return el(e) ? e.parent : (ir("gobj NULL of bad type"), null);
|
|
907
909
|
}
|
|
908
910
|
function It(e) {
|
|
909
|
-
return
|
|
911
|
+
return el(e) ? !!(e.gobj_flag & L.gobj_flag_volatil) : (ir("gobj NULL of bad type"), null);
|
|
910
912
|
}
|
|
911
913
|
function kt(e) {
|
|
912
|
-
return
|
|
914
|
+
return el(e) ? !!(e.gobj_flag & L.gobj_flag_pure_child) : (ir("gobj NULL of bad type"), null);
|
|
913
915
|
}
|
|
914
916
|
function Ct(e) {
|
|
915
|
-
return !
|
|
917
|
+
return !el(e) || !!(e.obflag & (P.obflag_destroyed | P.obflag_destroying));
|
|
916
918
|
}
|
|
917
919
|
function Lt(e) {
|
|
918
|
-
return
|
|
920
|
+
return el(e) ? e.bottom_gobj : (ir("gobj NULL of bad type"), null);
|
|
919
921
|
}
|
|
920
|
-
function
|
|
921
|
-
if (!
|
|
922
|
-
e.bottom_gobj &&
|
|
922
|
+
function Pt(e, t) {
|
|
923
|
+
if (!el(e)) return ir("gobj NULL of bad type"), null;
|
|
924
|
+
e.bottom_gobj && t && sr(`${$t(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
923
925
|
}
|
|
924
|
-
function
|
|
925
|
-
return
|
|
926
|
+
function Ut(e, t, n) {
|
|
927
|
+
return el(e) ? t ? De(e.gclass, t, n) : e.gclass.attrs_table : (ir("gobj NULL of bad type"), null);
|
|
926
928
|
}
|
|
927
929
|
function Ft(e, t, n, r, l) {
|
|
928
|
-
return Ct(e) ? (
|
|
930
|
+
return Ct(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : Mt(e.dl_children, t, n, r, l);
|
|
929
931
|
}
|
|
930
|
-
function
|
|
931
|
-
return Ct(e) ? (
|
|
932
|
+
function Vt(e, t, n, r, l) {
|
|
933
|
+
return Ct(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : xt(e.dl_children, t, n, r, l);
|
|
932
934
|
}
|
|
933
|
-
function
|
|
934
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
935
|
+
function Gt(e) {
|
|
936
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || ir(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
935
937
|
}
|
|
936
938
|
function Mt(e, t, n, r, l) {
|
|
937
939
|
let o, i = [...e];
|
|
938
940
|
if (t & F.WALK_LAST2FIRST) for (let e = i.length; e > 0; e--) {
|
|
939
941
|
o = i[e - 1];
|
|
940
|
-
let t =
|
|
942
|
+
let t = Gt(n(o, r, l));
|
|
941
943
|
if (t < 0) return t;
|
|
942
944
|
}
|
|
943
945
|
else for (let e = 0; e < i.length; e++) {
|
|
944
946
|
o = i[e];
|
|
945
|
-
let t =
|
|
947
|
+
let t = Gt(n(o, r, l));
|
|
946
948
|
if (t < 0) return t;
|
|
947
949
|
}
|
|
948
950
|
return 0;
|
|
@@ -955,30 +957,30 @@ function Wt(e, t, n, r, l) {
|
|
|
955
957
|
} else for (let s = 0; s < e.length; s++) if (o = e[s], i = Wt([...o.dl_children], t, n, r, l), i < 0) return i;
|
|
956
958
|
return i;
|
|
957
959
|
}
|
|
958
|
-
function
|
|
960
|
+
function xt(e, t, n, r, l) {
|
|
959
961
|
if (t & F.WALK_BYLEVEL) return Wt(e, t, n, r, l);
|
|
960
962
|
let o, i;
|
|
961
963
|
if (t & F.WALK_BOTTOM2TOP) for (let s = e.length; s > 0; s--) {
|
|
962
|
-
if (i = e[s - 1], o =
|
|
963
|
-
if (o =
|
|
964
|
+
if (i = e[s - 1], o = xt([...i.dl_children], t, n, r, l), o < 0) return o;
|
|
965
|
+
if (o = Gt(n(i, r, l)), o < 0) return o;
|
|
964
966
|
}
|
|
965
967
|
else for (let s = 0; s < e.length; s++) {
|
|
966
|
-
if (i = e[s], o =
|
|
967
|
-
if (0 === o && (o =
|
|
968
|
+
if (i = e[s], o = Gt(n(i, r, l)), o < 0) return o;
|
|
969
|
+
if (0 === o && (o = xt([...i.dl_children], t, n, r, l), o < 0)) return o;
|
|
968
970
|
}
|
|
969
971
|
return 0;
|
|
970
972
|
}
|
|
971
|
-
function
|
|
972
|
-
if (
|
|
973
|
+
function Kt(e, t) {
|
|
974
|
+
if (tl(t)) return null;
|
|
973
975
|
const n = t.toLowerCase();
|
|
974
|
-
return "__default_service__" === n ?
|
|
976
|
+
return "__default_service__" === n ? E : "__yuno__" === n || "__root__" === n ? h : Ht(h, t);
|
|
975
977
|
}
|
|
976
978
|
function Yt(e, t) {
|
|
977
|
-
if (!
|
|
979
|
+
if (!el(e)) return ir("gobj NULL of bad type"), !1;
|
|
978
980
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
979
981
|
t.__disabled__;
|
|
980
982
|
let o = t.__state__;
|
|
981
|
-
if (n && n !==
|
|
983
|
+
if (n && n !== Rt(e)) return !1;
|
|
982
984
|
if (r && r !== jt(e)) return !1;
|
|
983
985
|
if (l) {
|
|
984
986
|
let t = l.length;
|
|
@@ -990,7 +992,7 @@ function Yt(e, t) {
|
|
|
990
992
|
return !0;
|
|
991
993
|
}
|
|
992
994
|
function Bt(e, t) {
|
|
993
|
-
if (Ct(e)) return
|
|
995
|
+
if (Ct(e)) return ir("gobj NULL or DESTROYED"), null;
|
|
994
996
|
const n = e.dl_children;
|
|
995
997
|
for (let e = 0; e < n.length; e++) {
|
|
996
998
|
const r = n[e];
|
|
@@ -999,7 +1001,7 @@ function Bt(e, t) {
|
|
|
999
1001
|
return null;
|
|
1000
1002
|
}
|
|
1001
1003
|
function Jt(e, t) {
|
|
1002
|
-
if (Ct(e)) return
|
|
1004
|
+
if (Ct(e)) return ir("gobj NULL or DESTROYED"), null;
|
|
1003
1005
|
t = t || {};
|
|
1004
1006
|
let n = [];
|
|
1005
1007
|
const r = e.dl_children;
|
|
@@ -1026,7 +1028,7 @@ function Ht(e, t) {
|
|
|
1026
1028
|
if (!function(e, t) {
|
|
1027
1029
|
let n = t.split("^"), r = null, l = null;
|
|
1028
1030
|
if (2 === n.length) {
|
|
1029
|
-
if (l = n[0], r = n[1], l !==
|
|
1031
|
+
if (l = n[0], r = n[1], l !== Rt(e)) return !1;
|
|
1030
1032
|
} else {
|
|
1031
1033
|
if (1 !== n.length) return !1;
|
|
1032
1034
|
r = n[0];
|
|
@@ -1040,7 +1042,7 @@ function Ht(e, t) {
|
|
|
1040
1042
|
return o ? (n.splice(0, 1), n = n.join("`"), Ht(o, n)) : null;
|
|
1041
1043
|
}
|
|
1042
1044
|
function Qt(e, t) {
|
|
1043
|
-
return !
|
|
1045
|
+
return !tl(t) && !!De(e.gclass, t, !1);
|
|
1044
1046
|
}
|
|
1045
1047
|
function zt(e, t, n) {
|
|
1046
1048
|
let r = e.jn_attrs;
|
|
@@ -1048,7 +1050,7 @@ function zt(e, t, n) {
|
|
|
1048
1050
|
let n = r[t];
|
|
1049
1051
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
1050
1052
|
}
|
|
1051
|
-
return
|
|
1053
|
+
return ir(`${$t(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
1052
1054
|
}
|
|
1053
1055
|
function Xt(e, t, n) {
|
|
1054
1056
|
let r = {}, l = e.gclass.attrs_table;
|
|
@@ -1056,41 +1058,41 @@ function Xt(e, t, n) {
|
|
|
1056
1058
|
const o = l[n];
|
|
1057
1059
|
if (o.name && (-1 === t || o.flag & t)) {
|
|
1058
1060
|
let t;
|
|
1059
|
-
!e.gclass.gmt.mt_reading || e.obflag &
|
|
1061
|
+
!e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? t = kr(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = kr(e.jn_attrs, o.name))), Lr(r, o.name, t);
|
|
1060
1062
|
}
|
|
1061
1063
|
}
|
|
1062
1064
|
return r;
|
|
1063
1065
|
}
|
|
1064
1066
|
function Zt(e, t) {
|
|
1065
1067
|
if (t) {
|
|
1066
|
-
if (0 ===
|
|
1067
|
-
if (0 ===
|
|
1068
|
-
if (0 ===
|
|
1069
|
-
if (0 ===
|
|
1068
|
+
if (0 === ol(t, "__disabled__")) return Tt(e);
|
|
1069
|
+
if (0 === ol(t, "__running__")) return Et(e);
|
|
1070
|
+
if (0 === ol(t, "__playing__")) return vt(e);
|
|
1071
|
+
if (0 === ol(t, "__service__")) return yt(e);
|
|
1070
1072
|
}
|
|
1071
|
-
let n =
|
|
1072
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag &
|
|
1073
|
+
let n = $e(e, t, !1);
|
|
1074
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? kr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${$t(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1073
1075
|
}
|
|
1074
1076
|
function en(e, t) {
|
|
1075
|
-
t &&
|
|
1076
|
-
let n =
|
|
1077
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag &
|
|
1077
|
+
t && ol(t, "__trace_level__");
|
|
1078
|
+
let n = $e(e, t, !1);
|
|
1079
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? kr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${$t(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1078
1080
|
}
|
|
1079
1081
|
function tn(e, t) {
|
|
1080
|
-
if (t && 0 ===
|
|
1081
|
-
let n =
|
|
1082
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag &
|
|
1082
|
+
if (t && 0 === ol(t, "__state__")) return cn(e);
|
|
1083
|
+
let n = $e(e, t, !1);
|
|
1084
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? kr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${$t(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1083
1085
|
}
|
|
1084
1086
|
function nn(e, t) {
|
|
1085
|
-
let n =
|
|
1086
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag &
|
|
1087
|
+
let n = $e(e, t, !1);
|
|
1088
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? kr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${$t(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1087
1089
|
}
|
|
1088
1090
|
function rn(e, n, r, l) {
|
|
1089
|
-
if (!
|
|
1091
|
+
if (!Jr(n)) return ir(t("gobj_write_attr(%s): path must be a string", $t(e))), -1;
|
|
1090
1092
|
let o, i = e.jn_attrs, s = n.split("`");
|
|
1091
1093
|
if (s.length <= 1) {
|
|
1092
1094
|
let l = n;
|
|
1093
|
-
return l in i && i.hasOwnProperty(l) ? (i[l] = r,
|
|
1095
|
+
return l in i && i.hasOwnProperty(l) ? (i[l] = r, Yr(e.priv) && e.priv.hasOwnProperty(l) && (e.priv[l] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (ir(t("gobj_write_attr(%s): attr not found '%s'", $t(e), l)), -1);
|
|
1094
1096
|
}
|
|
1095
1097
|
let a = s.length;
|
|
1096
1098
|
for (let t = 0; t < a; t++) {
|
|
@@ -1101,65 +1103,62 @@ function rn(e, n, r, l) {
|
|
|
1101
1103
|
continue;
|
|
1102
1104
|
}
|
|
1103
1105
|
let l = e.jn_attrs;
|
|
1104
|
-
if (o in l && l.hasOwnProperty(o)) return l[o] = r,
|
|
1106
|
+
if (o in l && l.hasOwnProperty(o)) return l[o] = r, Yr(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0;
|
|
1105
1107
|
break;
|
|
1106
1108
|
}
|
|
1107
|
-
return
|
|
1109
|
+
return ir(t("gobj_write_attr(%s): attr not found '%s'", $t(e), o)), -1;
|
|
1108
1110
|
}
|
|
1109
1111
|
function ln(e) {
|
|
1110
1112
|
return function(e, t, n) {
|
|
1111
|
-
if (Ct(e)) return
|
|
1113
|
+
if (Ct(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
1112
1114
|
let r = e.gclass.attrs_table;
|
|
1113
1115
|
for (let l = 0; l < r.length; l++) {
|
|
1114
1116
|
const o = r[l];
|
|
1115
|
-
|
|
1116
|
-
const t = Re(e, e.jn_attrs, o);
|
|
1117
|
-
jr(e.priv) && e.priv.hasOwnProperty(o.name) && (e.priv[o.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name);
|
|
1118
|
-
}
|
|
1117
|
+
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (we(e, e.jn_attrs, o), Yr(e.priv) && e.priv.hasOwnProperty(o.name) && (e.priv[o.name] = e.jn_attrs[o.name]), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name)));
|
|
1119
1118
|
}
|
|
1120
1119
|
return 0;
|
|
1121
1120
|
}(e, v.SDF_VOLATIL, 0);
|
|
1122
1121
|
}
|
|
1123
1122
|
function on(e, t, n, r) {
|
|
1124
|
-
let l =
|
|
1123
|
+
let l = Re(e), o = 0;
|
|
1125
1124
|
for (const [r, i] of Object.entries(t)) {
|
|
1126
|
-
let t =
|
|
1125
|
+
let t = Ut(e, r, !0);
|
|
1127
1126
|
t && (-1 === n || t.flag & n) && (o += je(e, l, t, i));
|
|
1128
1127
|
}
|
|
1129
1128
|
return o;
|
|
1130
1129
|
}
|
|
1131
1130
|
function sn(e, t, n) {
|
|
1132
|
-
let r =
|
|
1133
|
-
return r ? (r[t] =
|
|
1131
|
+
let r = $e(e, t, !1);
|
|
1132
|
+
return r ? (r[t] = nl(n), Yr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = r[t]), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (ir(`${$t(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1134
1133
|
}
|
|
1135
1134
|
function an(e, t, n) {
|
|
1136
|
-
let r =
|
|
1137
|
-
return r ? (r[t] = parseInt(n),
|
|
1135
|
+
let r = $e(e, t, !1);
|
|
1136
|
+
return r ? (r[t] = parseInt(n), Yr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = r[t]), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (ir(`${$t(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1138
1137
|
}
|
|
1139
1138
|
function un(e, t, n) {
|
|
1140
|
-
let r =
|
|
1141
|
-
return r ? (r[t] = String(n),
|
|
1139
|
+
let r = $e(e, t, !1);
|
|
1140
|
+
return r ? (r[t] = String(n), Yr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = r[t]), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (ir(`${$t(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1142
1141
|
}
|
|
1143
1142
|
function _n(e, n) {
|
|
1144
|
-
if (Ct(e)) return
|
|
1143
|
+
if (Ct(e)) return ir("gobj NULL or DESTROYED"), null;
|
|
1145
1144
|
if (e.current_state.state_name === n) return !1;
|
|
1146
1145
|
let r = ke(e.gclass, n);
|
|
1147
|
-
if (!r) return
|
|
1146
|
+
if (!r) return ir(`${$t(e)}: state unknown, state ${n}`), !1;
|
|
1148
1147
|
e.last_state = e.current_state, e.current_state = r;
|
|
1149
1148
|
let l = oe(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1150
1149
|
return Z(e) & B.TRACE_STATES;
|
|
1151
1150
|
}(e);
|
|
1152
|
-
return (l || o) && (1 === W || Y(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!",
|
|
1151
|
+
return (l || o) && (1 === W || Y(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Rt(e), jt(e), cn(e), e.last_state.state_name))), !0;
|
|
1153
1152
|
}
|
|
1154
1153
|
function cn(e) {
|
|
1155
|
-
return
|
|
1154
|
+
return el(e) ? e.current_state.state_name : (ir("hgobj NULL"), "");
|
|
1156
1155
|
}
|
|
1157
1156
|
function fn(e, n) {
|
|
1158
|
-
return Ct(e) ? (
|
|
1157
|
+
return Ct(e) ? (ir("gobj NULL or DESTROYED"), null) : n instanceof k ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && (Je(e.parent, e), e.parent = null), Be(n, e), n.gclass.gmt.mt_child_added && (te(e) && ur(t("👦👦🔵 child_added(%s): %s", Dt(n), $t(e))), n.gclass.gmt.mt_child_added(n, e)), 0) : (ir(`${$t(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
1159
1158
|
}
|
|
1160
1159
|
function gn(e, t, n) {
|
|
1161
|
-
if (!
|
|
1162
|
-
let r =
|
|
1160
|
+
if (!el(e)) return ir("gobj NULL of bad type"), null;
|
|
1161
|
+
let r = Ve(e.gclass, t);
|
|
1163
1162
|
if (r) return r;
|
|
1164
1163
|
if (n) {
|
|
1165
1164
|
const e = b.length, n = b;
|
|
@@ -1176,18 +1175,18 @@ function dn(e, t, n) {
|
|
|
1176
1175
|
}
|
|
1177
1176
|
function bn(e, t, n) {
|
|
1178
1177
|
let r = gn(e, t, !1);
|
|
1179
|
-
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag &
|
|
1178
|
+
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & U.EVF_OUTPUT_EVENT);
|
|
1180
1179
|
}
|
|
1181
1180
|
var pn = [], mn = !1;
|
|
1182
|
-
function
|
|
1183
|
-
return e && e instanceof k ? e.obflag & (
|
|
1181
|
+
function hn(e, n, r, l) {
|
|
1182
|
+
return e && e instanceof k ? e.obflag & (P.obflag_destroyed | P.obflag_destroying) ? (ir(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : tl(n) ? (ir("gobj_post_event(): event EMPTY"), -1) : dn(e, n, 0) ? pn.length >= 1e4 ? (ir(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${pn.length}`), -1) : (pn.push({
|
|
1184
1183
|
dst: e,
|
|
1185
1184
|
event: n,
|
|
1186
1185
|
kw: r,
|
|
1187
1186
|
src: l
|
|
1188
|
-
}), oe(e, n) && !ie(l, n) && Y(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!",
|
|
1187
|
+
}), oe(e, n) && !ie(l, n) && Y(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", $t(e), n, pn.length)), mn || (mn = !0, setTimeout(Tn, 0)), 0) : (ir(`gobj_post_event(): event NOT DEFINED in gclass ${Rt(e)}, event ${n}`), -1) : (ir(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
1189
1188
|
}
|
|
1190
|
-
function
|
|
1189
|
+
function En() {
|
|
1191
1190
|
return pn.length;
|
|
1192
1191
|
}
|
|
1193
1192
|
function Tn() {
|
|
@@ -1195,37 +1194,68 @@ function Tn() {
|
|
|
1195
1194
|
let e = pn;
|
|
1196
1195
|
pn = [];
|
|
1197
1196
|
let t = 0;
|
|
1198
|
-
for (let n
|
|
1197
|
+
for (let n = 0; n < e.length; n++) {
|
|
1198
|
+
const r = e[n];
|
|
1199
|
+
if (!(r.dst.obflag & (P.obflag_destroyed | P.obflag_destroying))) {
|
|
1200
|
+
try {
|
|
1201
|
+
yn(r.dst, r.event, r.kw, r.src);
|
|
1202
|
+
} catch (t) {
|
|
1203
|
+
throw (pn = e.slice(n + 1).concat(pn)).length > 0 && !mn && (mn = !0, setTimeout(Tn, 0)), t;
|
|
1204
|
+
}
|
|
1205
|
+
t++;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1199
1208
|
return pn.length > 0 && !mn && (mn = !0, setTimeout(Tn, 0)), t;
|
|
1200
1209
|
}
|
|
1201
1210
|
function yn(e, n, r, l) {
|
|
1202
|
-
if (!(e && e instanceof k)) return
|
|
1203
|
-
if (e.obflag & (
|
|
1211
|
+
if (!(e && e instanceof k)) return ir("gobj dst NULL"), -1;
|
|
1212
|
+
if (e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return ir("gobj dst DESTROYED"), -1;
|
|
1204
1213
|
let o = e.current_state;
|
|
1205
|
-
if (!o) return
|
|
1214
|
+
if (!o) return ir(`${$t(e)}: current_state NULL`), -1;
|
|
1206
1215
|
let i = oe(e, n) && !ie(l, n);
|
|
1207
1216
|
T++;
|
|
1208
1217
|
let s = Ce(o, n);
|
|
1209
|
-
if (!s) return e.gclass.gmt.mt_inject_event ? (T--, i && (Y(1 === W ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!",
|
|
1218
|
+
if (!s) return e.gclass.gmt.mt_inject_event ? (T--, i && (Y(1 === W ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!", $t(e), o.state_name) : t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", $t(e), o.state_name, n || "", l && !l.running ? "!!" : "", $t(l))), r && le(e) && Mr(r) && wr(r)), e.gclass.gmt.mt_inject_event(e, n, r, l)) : (i && Y(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Rt(e), jt(e), o.state_name, n || "", l && !l.running ? "!!" : "", Rt(l), jt(l))), ir(`📛📛 Event NOT DEFINED in state 📛📛: ${$t(e)}, ${o.state_name}, ${n}`), T--, -1);
|
|
1210
1219
|
if (i) {
|
|
1211
|
-
if (1 === W) Y(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!",
|
|
1220
|
+
if (1 === W) Y(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", $t(e), o.state_name, l && !l.running ? "!!" : "", $t(l)));
|
|
1212
1221
|
else {
|
|
1213
1222
|
let r = "";
|
|
1214
|
-
s.action && (r =
|
|
1223
|
+
s.action && (r = wo(s.action)), Y(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Rt(e), jt(e), o.state_name, "", n || "", "", r, l && !l.running ? "!!" : "", Rt(l), jt(l)));
|
|
1215
1224
|
}
|
|
1216
|
-
r && le(e) &&
|
|
1225
|
+
r && le(e) && Mr(r) && wr(r);
|
|
1217
1226
|
}
|
|
1218
1227
|
s.next_state && _n(e, s.next_state);
|
|
1219
1228
|
let a = -1;
|
|
1220
1229
|
try {
|
|
1221
1230
|
s.action && (a = s.action(e, n, r, l));
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1231
|
+
} catch (t) {
|
|
1232
|
+
if (T--, !t || !t.__gobj_logged__) {
|
|
1233
|
+
ir(`${$t(e)}: action of ${n} in ${e.current_state.state_name} THREW: ${t && t.stack ? t.stack : t}`);
|
|
1234
|
+
try {
|
|
1235
|
+
t.__gobj_logged__ = !0;
|
|
1236
|
+
} catch (e) {}
|
|
1237
|
+
}
|
|
1238
|
+
throw t;
|
|
1239
|
+
}
|
|
1240
|
+
return !i || 1 === W || e.obflag & P.obflag_destroyed || Y(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Rt(e), jt(e), e.current_state.state_name, n || "", qr(a) ? a : 0)), T--, a;
|
|
1224
1241
|
}
|
|
1225
1242
|
var vn = Object.freeze({
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1243
|
+
__rename_event_name__: 1,
|
|
1244
|
+
__hard_subscription__: 2,
|
|
1245
|
+
__own_event__: 4
|
|
1246
|
+
});
|
|
1247
|
+
function On(e) {
|
|
1248
|
+
let t = String(e).toLowerCase();
|
|
1249
|
+
for (let e in p) {
|
|
1250
|
+
let n = p[e].dl_events;
|
|
1251
|
+
for (let e = 0; e < n.length; e++) {
|
|
1252
|
+
let r = n[e];
|
|
1253
|
+
if (r.event_name && r.event_name.toLowerCase() === t) return r;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
return null;
|
|
1257
|
+
}
|
|
1258
|
+
var Sn = [
|
|
1229
1259
|
N(y.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1230
1260
|
N(y.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1231
1261
|
N(y.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
@@ -1236,50 +1266,65 @@ var vn = Object.freeze({
|
|
|
1236
1266
|
N(y.DTP_JSON, "__local__", 0, null, "local kw, remove in publishing"),
|
|
1237
1267
|
N(y.DTP_JSON, "__filter__", 0, null, "filter kw, filter in publishing"),
|
|
1238
1268
|
N(y.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1239
|
-
|
|
1269
|
+
S()
|
|
1240
1270
|
];
|
|
1241
|
-
function
|
|
1242
|
-
let
|
|
1243
|
-
if (
|
|
1244
|
-
|
|
1245
|
-
|
|
1271
|
+
function Nn(e, t) {
|
|
1272
|
+
let n = e ? e.__config__ : null;
|
|
1273
|
+
if (!Yr(n) || !cl(n, "__hard_subscription__") && !cl(n, "__own_event__") && !cl(n, "__rename_event_name__")) return {
|
|
1274
|
+
kw: e,
|
|
1275
|
+
renamed_event: ""
|
|
1276
|
+
};
|
|
1277
|
+
let r = Object.assign({}, e), l = Object.assign({}, n);
|
|
1278
|
+
r.__config__ = l;
|
|
1279
|
+
let o = "", i = l.__rename_event_name__, s = "string" != typeof i || tl(i) ? null : On(i);
|
|
1280
|
+
return s && (o = s.event_name, delete l.__rename_event_name__, t && xr(r.__global__) > 0 && (r.__global__ = Object.assign({}, r.__global__, { __original_event_name__: t }))), delete l.__hard_subscription__, delete l.__own_event__, {
|
|
1281
|
+
kw: r,
|
|
1282
|
+
renamed_event: o
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
function wn(e, t, n, r, l, o) {
|
|
1286
|
+
let i = yl(t, l, "__config__", null), s = yl(t, l, "__global__", null), a = yl(t, l, "__local__", null), u = vl(t, l, "__filter__", null), _ = !0;
|
|
1287
|
+
if (t && t !== Tl(null, e, "publisher", null) && (_ = !1), o && o !== Tl(null, e, "subscriber", null) && (_ = !1), n && n !== El(null, e, "event", "") && (_ = !1), r && r !== El(null, e, "renamed_event", "") && (_ = !1), xr(i) > 0) {
|
|
1288
|
+
let t = yl(null, e, "__config__", null);
|
|
1289
|
+
xr(t) > 0 && $r(t, i) || (_ = !1);
|
|
1246
1290
|
}
|
|
1247
|
-
if (
|
|
1248
|
-
let t =
|
|
1249
|
-
|
|
1291
|
+
if (xr(s) > 0) {
|
|
1292
|
+
let t = yl(null, e, "__global__", null);
|
|
1293
|
+
xr(t) > 0 && $r(t, s) || (_ = !1);
|
|
1250
1294
|
}
|
|
1251
|
-
if (
|
|
1252
|
-
let t =
|
|
1253
|
-
|
|
1295
|
+
if (xr(a) > 0) {
|
|
1296
|
+
let t = yl(null, e, "__local__", null);
|
|
1297
|
+
xr(t) > 0 && $r(t, a) || (_ = !1);
|
|
1254
1298
|
}
|
|
1255
|
-
if (
|
|
1256
|
-
let t =
|
|
1257
|
-
|
|
1299
|
+
if (xr(u) > 0) {
|
|
1300
|
+
let t = vl(null, e, "__filter__", null);
|
|
1301
|
+
xr(t) > 0 && $r(t, u) || (_ = !1);
|
|
1258
1302
|
}
|
|
1259
|
-
return
|
|
1303
|
+
return _;
|
|
1260
1304
|
}
|
|
1261
|
-
function
|
|
1262
|
-
let
|
|
1263
|
-
for (let
|
|
1264
|
-
let
|
|
1265
|
-
|
|
1305
|
+
function jn(e, t, n, r, l, o) {
|
|
1306
|
+
let i = [];
|
|
1307
|
+
for (let s = 0; s < e.length; s++) {
|
|
1308
|
+
let a = e[s];
|
|
1309
|
+
wn(a, t, n, r, l, o) && Ur(i, a);
|
|
1266
1310
|
}
|
|
1267
|
-
return
|
|
1268
|
-
}
|
|
1269
|
-
function Rn(e, t, n, r, l) {
|
|
1270
|
-
for (let o = 0; o < e.length; o++) if (On(e[o], t, n, r, l)) return o;
|
|
1271
|
-
return -1;
|
|
1272
|
-
}
|
|
1273
|
-
function jn(e, n, r, l) {
|
|
1274
|
-
let o = el(e, n, "publisher", null, Pn.KW_REQUIRED), i = el(e, n, "subscriber", null, Pn.KW_REQUIRED), s = Zr(e, n, "event", "", Pn.KW_REQUIRED);
|
|
1275
|
-
if (!!(zr(e, n, "subs_flag", null, Pn.KW_REQUIRED) & vn.__hard_subscription__) && !r) return -1;
|
|
1276
|
-
(ne(i) || ne(o)) && (Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Dt(o), Dt(i))), ar(n)), o.obflag & U.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, n);
|
|
1277
|
-
let a = Rn(o.dl_subscriptions, o, s, n, i);
|
|
1278
|
-
return a >= 0 ? yr(o.dl_subscriptions, a) : (rr(`${Dt(e)}: subscription in publisher not found`), ar(n)), a = Rn(i.dl_subscribings, o, s, n, i), a >= 0 ? yr(i.dl_subscribings, a) : (rr(`${Dt(e)}: subscription in subscriber not found`), ar(n)), 0;
|
|
1311
|
+
return i;
|
|
1279
1312
|
}
|
|
1280
|
-
function
|
|
1281
|
-
|
|
1282
|
-
|
|
1313
|
+
function Rn(e, t) {
|
|
1314
|
+
return e.indexOf(t);
|
|
1315
|
+
}
|
|
1316
|
+
function $n(e, n, r, l) {
|
|
1317
|
+
let o = Tl(e, n, "publisher", null, Vn.KW_REQUIRED), i = Tl(e, n, "subscriber", null, Vn.KW_REQUIRED), s = El(e, n, "event", "", Vn.KW_REQUIRED);
|
|
1318
|
+
if (!!(ml(e, n, "subs_flag", null, Vn.KW_REQUIRED) & vn.__hard_subscription__) && !r) return -1;
|
|
1319
|
+
let a = ne(i) || ne(o);
|
|
1320
|
+
if (Rn(o.dl_subscriptions, n) < 0) return a && Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", s || "", $t(o), $t(i))), 1;
|
|
1321
|
+
a && (Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", $t(o), $t(i))), cr(n)), o.obflag & P.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, n);
|
|
1322
|
+
let u = Rn(o.dl_subscriptions, n);
|
|
1323
|
+
return u >= 0 ? Vr(o.dl_subscriptions, u) : (ir(`${$t(e)}: subscription in publisher not found`), cr(n)), u = Rn(i.dl_subscribings, n), u >= 0 ? Vr(i.dl_subscribings, u) : (ir(`${$t(e)}: subscription in subscriber not found`), cr(n)), 0;
|
|
1324
|
+
}
|
|
1325
|
+
function Dn(e, n, r, l) {
|
|
1326
|
+
if (null == r && (r = {}), !e) return ir(`publisher NULL: ev ${n}`), 0;
|
|
1327
|
+
if (!l) return ir(`subscriber NULL: ev ${n}`), 0;
|
|
1283
1328
|
const o = /* @__PURE__ */ new Set([
|
|
1284
1329
|
"__config__",
|
|
1285
1330
|
"__global__",
|
|
@@ -1288,42 +1333,57 @@ function wn(e, n, r, l) {
|
|
|
1288
1333
|
"__service__"
|
|
1289
1334
|
]);
|
|
1290
1335
|
if (Object.keys(r).forEach((t) => {
|
|
1291
|
-
o.has(t) ||
|
|
1292
|
-
}),
|
|
1293
|
-
else if (!(bn(e, n,
|
|
1294
|
-
let i = Nn(e.dl_subscriptions, e, n,
|
|
1295
|
-
|
|
1296
|
-
|
|
1336
|
+
o.has(t) || ir(`${$t(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1337
|
+
}), tl(n)) n = "";
|
|
1338
|
+
else if (!(bn(e, n, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${$t(e)}, ${n}`), 0;
|
|
1339
|
+
let i = Nn(r, n), s = jn(e.dl_subscriptions, e, n, i.renamed_event, i.kw, l), a = null;
|
|
1340
|
+
for (let t = 0; t < s.length; t++) if (ml(e, s[t], "subs_flag", 0, Vn.KW_REQUIRED) & vn.__hard_subscription__) {
|
|
1341
|
+
a = s[t];
|
|
1342
|
+
break;
|
|
1343
|
+
}
|
|
1344
|
+
if (a) return sr(`${$t(e)}: Hard subscription REPEATED, the one there is kept and returned (event: ${n}, subscriber: ${$t(l)})`), a;
|
|
1345
|
+
Wr(s) > 0 && (ir(`${$t(e)}: ${Wr(s)} subscription(s) REPEATED, will be deleted and override`), cr(s, "subscription REPEATED"), In(e, s, !1));
|
|
1346
|
+
let u = function(e, t, n, r) {
|
|
1297
1347
|
let l = Ne(e, Sn);
|
|
1298
|
-
|
|
1348
|
+
Pr(l, "event", t), Pr(l, "subscriber", r), Pr(l, "publisher", e);
|
|
1299
1349
|
let o = 0;
|
|
1300
1350
|
if (n) {
|
|
1301
|
-
let
|
|
1302
|
-
if (
|
|
1303
|
-
let n =
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1351
|
+
let r = yl(e, n, "__config__", null), i = yl(e, n, "__global__", null), s = yl(e, n, "__local__", null), a = vl(e, n, "__filter__", null), u = El(e, n, "__service__", "");
|
|
1352
|
+
if (xr(i) > 0 && Pr(l, "__global__", jr(i)), xr(r) > 0) {
|
|
1353
|
+
let n = jr(r);
|
|
1354
|
+
Pr(l, "__config__", n);
|
|
1355
|
+
let i = El(e, n, "__rename_event_name__", "");
|
|
1356
|
+
if (!tl(i)) {
|
|
1357
|
+
let r = On(i);
|
|
1358
|
+
if (r) {
|
|
1359
|
+
Pr(l, "renamed_event", r.event_name), delete n.__rename_event_name__, o |= vn.__rename_event_name__;
|
|
1360
|
+
let i = yl(e, l, "__global__", null);
|
|
1361
|
+
Yr(i) || (i = {}, Pr(l, "__global__", i)), i.__original_event_name__ = t;
|
|
1362
|
+
} else ir(`${$t(e)}: EVENT NOT FOUND (__rename_event_name__: ${i})`);
|
|
1363
|
+
}
|
|
1364
|
+
if (cl(n, "__hard_subscription__")) {
|
|
1365
|
+
let t = pl(e, n, "__hard_subscription__", !1);
|
|
1366
|
+
Cr(n, "__hard_subscription__"), t && (o |= vn.__hard_subscription__);
|
|
1307
1367
|
}
|
|
1308
|
-
if (
|
|
1309
|
-
let t =
|
|
1310
|
-
|
|
1368
|
+
if (cl(n, "__own_event__")) {
|
|
1369
|
+
let t = pl(e, n, "__own_event__", !1);
|
|
1370
|
+
Cr(n, "__own_event__"), t && (o |= vn.__own_event__);
|
|
1311
1371
|
}
|
|
1312
1372
|
}
|
|
1313
|
-
|
|
1373
|
+
xr(s) > 0 && Pr(l, "__local__", jr(s)), xr(a) > 0 && Pr(l, "__filter__", jr(a)), tl(u) || Pr(l, "__service__", u);
|
|
1314
1374
|
}
|
|
1315
|
-
return
|
|
1375
|
+
return Pr(l, "subs_flag", o), l;
|
|
1316
1376
|
}(e, n, r, l);
|
|
1317
|
-
if (!
|
|
1318
|
-
if (
|
|
1319
|
-
let t = e.gclass.gmt.mt_subscription_added(e,
|
|
1320
|
-
(t < 0 || !1 === t) && (
|
|
1377
|
+
if (!u) return ir(`${$t(e)}: _create_subscription() FAILED`), 0;
|
|
1378
|
+
if (Ur(e.dl_subscriptions, u), Ur(l.dl_subscribings, u), (ne(l) || ne(e)) && (Y(t("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", n || "", $t(e), $t(l))), r && (le(l) || le(e)) && wr(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1379
|
+
let t = e.gclass.gmt.mt_subscription_added(e, u);
|
|
1380
|
+
(t < 0 || !1 === t) && ($n(e, u, !0, !0), u = 0);
|
|
1321
1381
|
}
|
|
1322
|
-
return
|
|
1382
|
+
return u;
|
|
1323
1383
|
}
|
|
1324
|
-
function
|
|
1325
|
-
if (null == n && (n = {}), !e) return
|
|
1326
|
-
if (!r) return
|
|
1384
|
+
function An(e, t, n, r) {
|
|
1385
|
+
if (null == n && (n = {}), !e) return ir(`publisher NULL: ev ${t}`), 0;
|
|
1386
|
+
if (!r) return ir(`subscriber NULL: ev ${t}`), 0;
|
|
1327
1387
|
const l = /* @__PURE__ */ new Set([
|
|
1328
1388
|
"__config__",
|
|
1329
1389
|
"__global__",
|
|
@@ -1332,52 +1392,52 @@ function Dn(e, t, n, r) {
|
|
|
1332
1392
|
"__service__"
|
|
1333
1393
|
]);
|
|
1334
1394
|
if (Object.keys(n).forEach((n) => {
|
|
1335
|
-
l.has(n) ||
|
|
1336
|
-
}),
|
|
1337
|
-
else if (!(bn(e, t,
|
|
1338
|
-
let o = Nn(e.dl_subscriptions, e, t,
|
|
1339
|
-
for (let t = 0; t <
|
|
1340
|
-
let n =
|
|
1341
|
-
|
|
1342
|
-
}
|
|
1343
|
-
return
|
|
1344
|
-
}
|
|
1345
|
-
function $n(e, t, n) {
|
|
1346
|
-
let r = [...t];
|
|
1347
|
-
for (let t = 0; t < r.length; t++) jn(e, r[t], n, !1);
|
|
1348
|
-
return 0;
|
|
1395
|
+
l.has(n) || ir(`${$t(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1396
|
+
}), tl(t)) t = "";
|
|
1397
|
+
else if (!(bn(e, t, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${$t(e)}, ev ${t}`), 0;
|
|
1398
|
+
let o = Nn(n, t), i = jn(e.dl_subscriptions, e, t, o.renamed_event, o.kw, r), s = 0, a = 0, u = 0;
|
|
1399
|
+
for (let t = 0; t < i.length; t++) {
|
|
1400
|
+
let n = i[t], r = $n(e, n, !1, !1);
|
|
1401
|
+
0 === r ? s++ : r < 0 ? a++ : u++;
|
|
1402
|
+
}
|
|
1403
|
+
return a ? sr(`${$t(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${a})`) : s || u || (sr(`${$t(e)}: No subscription found`), wr(n, "No subscription found")), 0;
|
|
1349
1404
|
}
|
|
1350
|
-
function
|
|
1351
|
-
|
|
1405
|
+
function In(e, t, n) {
|
|
1406
|
+
let r = [...t], l = 0;
|
|
1407
|
+
for (let t = 0; t < r.length; t++) $n(e, r[t], n, !1) > 0 && l++;
|
|
1408
|
+
return l && sr(`${$t(e)}: Subscription(s) already removed, nothing to remove (count: ${l})`), 0;
|
|
1352
1409
|
}
|
|
1353
|
-
function
|
|
1354
|
-
|
|
1410
|
+
function kn(e, t, n, r) {
|
|
1411
|
+
return null == n && (n = {}), jn(e.dl_subscriptions, e, t, null, n, r);
|
|
1412
|
+
}
|
|
1413
|
+
function Cn(e) {
|
|
1414
|
+
let t = kn(e, null, null, null);
|
|
1355
1415
|
for (let n = 0; n < t.length; n++) {
|
|
1356
|
-
let r = t[n], l =
|
|
1357
|
-
|
|
1416
|
+
let r = t[n], l = Tl(e, r, "publisher", null, Vn.KW_REQUIRED), o = Tl(e, r, "subscriber", null, Vn.KW_REQUIRED);
|
|
1417
|
+
Pr(r, "s_event", El(e, r, "event", "", Vn.KW_REQUIRED)), Pr(r, "s_publisher", $t(l)), Pr(r, "s_subscriber", $t(o));
|
|
1358
1418
|
}
|
|
1359
|
-
let n =
|
|
1419
|
+
let n = Ln(e, 0, null, 0);
|
|
1360
1420
|
for (let t = 0; t < n.length; t++) {
|
|
1361
|
-
let r = n[t], l =
|
|
1362
|
-
|
|
1421
|
+
let r = n[t], l = Tl(e, r, "publisher", null, Vn.KW_REQUIRED), o = Tl(e, r, "subscriber", null, Vn.KW_REQUIRED);
|
|
1422
|
+
Pr(r, "s_event", El(e, r, "event", "", Vn.KW_REQUIRED)), Pr(r, "s_publisher", $t(l)), Pr(r, "s_subscriber", $t(o));
|
|
1363
1423
|
}
|
|
1364
1424
|
return {
|
|
1365
1425
|
subscriptions: t,
|
|
1366
1426
|
subscribings: n,
|
|
1367
|
-
"total subscriptions":
|
|
1368
|
-
total_subscribings:
|
|
1427
|
+
"total subscriptions": Wr(t),
|
|
1428
|
+
total_subscribings: Wr(n)
|
|
1369
1429
|
};
|
|
1370
1430
|
}
|
|
1371
|
-
function
|
|
1372
|
-
return
|
|
1431
|
+
function Ln(e, t, n, r) {
|
|
1432
|
+
return jn(e.dl_subscribings, r, t, null, n, e);
|
|
1373
1433
|
}
|
|
1374
|
-
function
|
|
1375
|
-
if (
|
|
1376
|
-
if (
|
|
1434
|
+
function Pn(e, n, r) {
|
|
1435
|
+
if (Yr(r) || (r = {}), !e || e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return ir("gobj NULL or DESTROYED"), -1;
|
|
1436
|
+
if (tl(n)) return ir(`${$t(e)}: event EMPTY`), -1;
|
|
1377
1437
|
let l = gn(e, n, !0);
|
|
1378
|
-
if (!(l && l.event_flag & (
|
|
1438
|
+
if (!(l && l.event_flag & (U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${$t(e)}, ev ${n}`), -1;
|
|
1379
1439
|
let o = (ne(e) || oe(e, n)) && !ie(e, n);
|
|
1380
|
-
if (o && (Y(1 === W ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!",
|
|
1440
|
+
if (o && (Y(1 === W ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!", $t(e), e.current_state.state_name) : t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Rt(e), jt(e), e.current_state.state_name, "", n || "", "")), le(e) && Mr(r) && wr(r)), e.gclass.gmt.mt_publish_event) {
|
|
1381
1441
|
let t = e.gclass.gmt.mt_publish_event(e, n, r);
|
|
1382
1442
|
if (t <= 0) return t;
|
|
1383
1443
|
}
|
|
@@ -1389,37 +1449,44 @@ function Cn(e, n, r) {
|
|
|
1389
1449
|
if (t < 0) break;
|
|
1390
1450
|
if (!t) continue;
|
|
1391
1451
|
}
|
|
1392
|
-
let _ =
|
|
1452
|
+
let _ = Tl(e, u, "subscriber", null, Vn.KW_REQUIRED);
|
|
1393
1453
|
if (!_ || Ct(_)) continue;
|
|
1394
|
-
let c =
|
|
1395
|
-
if (
|
|
1396
|
-
|
|
1397
|
-
let l =
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
if (
|
|
1402
|
-
let b =
|
|
1403
|
-
|
|
1404
|
-
let p =
|
|
1405
|
-
|
|
1454
|
+
let c = ml(e, u, "subs_flag", 0, Vn.KW_REQUIRED), f = El(e, u, "event", "", Vn.KW_REQUIRED);
|
|
1455
|
+
if (tl(f) || 0 === ol(f, n)) {
|
|
1456
|
+
yl(e, u, "__config__", null, 0);
|
|
1457
|
+
let l = yl(e, u, "__global__", null, 0), i = yl(e, u, "__local__", null, 0), f = vl(e, u, "__filter__", null, 0), g = u.renamed_event;
|
|
1458
|
+
tl(g) && (g = n);
|
|
1459
|
+
let d = 1;
|
|
1460
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, r, _) : xr(f) > 0 && (d = jl(r, f) ? 1 : 0, o && (Y(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", n || "", $t(_), $t(e))), cr(f))), d < 0) break;
|
|
1461
|
+
if (!d) continue;
|
|
1462
|
+
let b = gn(_, n, !0);
|
|
1463
|
+
if (b && b.event_flag & U.EVF_SYSTEM_EVENT && !dn(_, b.event_name, 0)) continue;
|
|
1464
|
+
let p = r;
|
|
1465
|
+
(xr(i) > 0 || xr(l) > 0) && (p = Object.assign({}, r)), xr(i) > 0 && _l(p, i), xr(l) > 0 && Dr(p, jr(l)), o && (Y(1 === W ? t("🔝🔄 %s (%s) %s%s", n || "", g || "", _.running ? "" : "!!", $t(_)) : t("🔝🔄 mach(%s%s), st: %s, ev: %s (%s), from(%s%s)", _.running ? "" : "!!", $t(_), cn(_), n || "", g || "", e && !e.running ? "!!" : "", $t(e))), le(e) && Mr(p) && wr(p));
|
|
1466
|
+
let m = yn(_, g, p, e);
|
|
1467
|
+
if (m < 0 && c & vn.__own_event__) {
|
|
1406
1468
|
s = -1;
|
|
1407
1469
|
break;
|
|
1408
1470
|
}
|
|
1409
|
-
if (a +=
|
|
1471
|
+
if (a += m, s++, Ct(e)) break;
|
|
1410
1472
|
}
|
|
1411
1473
|
}
|
|
1412
|
-
return s || l && l.event_flag &
|
|
1474
|
+
return s || l && l.event_flag & U.EVF_NO_WARN_SUBS || sr(`${$t(e)}: Publish event WITHOUT subscribers, ev ${n}`), a;
|
|
1413
1475
|
}
|
|
1414
|
-
function
|
|
1415
|
-
|
|
1476
|
+
function Un(e, n, r, l) {
|
|
1477
|
+
if (Ct(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
1478
|
+
if (function(e) {
|
|
1416
1479
|
return Q > 1 || !!e && !!(Z(e) & B.TRACE_COMMANDS);
|
|
1417
|
-
}(e) || oe(e, null) && !ie(l, null))
|
|
1480
|
+
}(e) || oe(e, null) && !ie(l, null)) {
|
|
1481
|
+
let o = Tr(n);
|
|
1482
|
+
Y(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", Et(e) ? "" : "!!", $t(e), null !== o ? o : n, $t(l))), le(e) && wr(r);
|
|
1483
|
+
}
|
|
1484
|
+
return e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, n, r, l) : e.gclass.command_table ? g ? g(e, n, r, l) : o(0, -1, t("%s: global command parser not available", $t(e)), 0, 0) : o(0, -1, t("%s: command table not available", $t(e)), 0, 0);
|
|
1418
1485
|
}
|
|
1419
|
-
function
|
|
1420
|
-
return Ct(e) ? (
|
|
1486
|
+
function Fn(e, n, r, l) {
|
|
1487
|
+
return Ct(e) ? (ir("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, n, r, l) : d ? d(e, n, r, l) : s(0, -1, t("%s, stats parser not available", $t(e)), 0, 0);
|
|
1421
1488
|
}
|
|
1422
|
-
var
|
|
1489
|
+
var Vn = Object.freeze({
|
|
1423
1490
|
KW_REQUIRED: 1,
|
|
1424
1491
|
KW_CREATE: 2,
|
|
1425
1492
|
KW_WILD_NUMBER: 4,
|
|
@@ -1439,71 +1506,79 @@ Object.freeze({
|
|
|
1439
1506
|
JSON_FALSE: 7,
|
|
1440
1507
|
JSON_NULL: 8
|
|
1441
1508
|
});
|
|
1442
|
-
var
|
|
1443
|
-
function
|
|
1444
|
-
if ((e = "function" == typeof e ? e : null) && e !==
|
|
1445
|
-
|
|
1446
|
-
for (const [e, t, n] of
|
|
1509
|
+
var Gn = "undefined" != typeof window ? window.console : console, Mn = Gn.error, Wn = Gn.warn, xn = Gn.info, Kn = Gn.debug, Yn = null, Bn = 600, Jn = [];
|
|
1510
|
+
function qn(e) {
|
|
1511
|
+
if ((e = "function" == typeof e ? e : null) && e !== Yn) {
|
|
1512
|
+
Yn = e;
|
|
1513
|
+
for (const [e, t, n] of Jn.slice()) {
|
|
1447
1514
|
let r = t;
|
|
1448
1515
|
if ("json" === e) try {
|
|
1449
1516
|
r = JSON.parse(t);
|
|
1450
1517
|
} catch (e) {
|
|
1451
1518
|
r = t;
|
|
1452
1519
|
}
|
|
1453
|
-
|
|
1520
|
+
nr(e, r, n);
|
|
1454
1521
|
}
|
|
1455
|
-
} else
|
|
1522
|
+
} else Yn = e;
|
|
1456
1523
|
}
|
|
1457
|
-
var
|
|
1458
|
-
function qn(e) {
|
|
1459
|
-
Jn = !!e;
|
|
1460
|
-
}
|
|
1461
|
-
var Hn = null;
|
|
1524
|
+
var Hn = !0;
|
|
1462
1525
|
function Qn(e) {
|
|
1463
|
-
Hn =
|
|
1526
|
+
Hn = !!e;
|
|
1527
|
+
}
|
|
1528
|
+
var zn = null;
|
|
1529
|
+
function Xn(e) {
|
|
1530
|
+
zn = "function" == typeof e ? e : null;
|
|
1464
1531
|
}
|
|
1465
|
-
function
|
|
1466
|
-
if (!
|
|
1467
|
-
if (!
|
|
1532
|
+
function Zn(e, t) {
|
|
1533
|
+
if (!Hn) return !1;
|
|
1534
|
+
if (!zn) return !0;
|
|
1468
1535
|
try {
|
|
1469
|
-
return !!
|
|
1536
|
+
return !!zn(e, t);
|
|
1470
1537
|
} catch (e) {
|
|
1471
1538
|
return !0;
|
|
1472
1539
|
}
|
|
1473
1540
|
}
|
|
1474
|
-
var
|
|
1475
|
-
function
|
|
1476
|
-
|
|
1541
|
+
var er = !1;
|
|
1542
|
+
function tr(e, t, n) {
|
|
1543
|
+
er || (function(e, t, n) {
|
|
1477
1544
|
let r = t;
|
|
1478
1545
|
if ("json" === e) try {
|
|
1479
1546
|
r = JSON.stringify(t);
|
|
1480
1547
|
} catch (e) {
|
|
1481
1548
|
r = String(t);
|
|
1482
1549
|
}
|
|
1483
|
-
|
|
1550
|
+
Jn.push([
|
|
1484
1551
|
e,
|
|
1485
1552
|
r,
|
|
1486
1553
|
n
|
|
1487
|
-
]),
|
|
1488
|
-
}(e, t, n),
|
|
1554
|
+
]), Jn.length > Bn && Jn.shift();
|
|
1555
|
+
}(e, t, n), nr(e, t, n));
|
|
1489
1556
|
}
|
|
1490
|
-
function
|
|
1491
|
-
if (
|
|
1492
|
-
|
|
1557
|
+
function nr(e, t, n) {
|
|
1558
|
+
if (Yn && !er) {
|
|
1559
|
+
er = !0;
|
|
1493
1560
|
try {
|
|
1494
|
-
|
|
1561
|
+
Yn(e, t, n);
|
|
1495
1562
|
} catch (e) {} finally {
|
|
1496
|
-
|
|
1563
|
+
er = !1;
|
|
1497
1564
|
}
|
|
1498
1565
|
}
|
|
1499
1566
|
}
|
|
1500
|
-
function
|
|
1501
|
-
e ? (
|
|
1567
|
+
function rr(e) {
|
|
1568
|
+
e ? (Mn = e, Wn = e) : (Mn = Gn.error, Wn = Gn.warn);
|
|
1569
|
+
}
|
|
1570
|
+
function lr(e) {
|
|
1571
|
+
try {
|
|
1572
|
+
return JSON.stringify(e);
|
|
1573
|
+
} catch (t) {
|
|
1574
|
+
return String(e);
|
|
1575
|
+
}
|
|
1502
1576
|
}
|
|
1503
|
-
function
|
|
1577
|
+
function or(e) {
|
|
1504
1578
|
const t = Array.prototype.slice.call(arguments);
|
|
1505
1579
|
let n = "";
|
|
1506
1580
|
if ("string" == typeof e) {
|
|
1581
|
+
if (1 === t.length) return e;
|
|
1507
1582
|
let r = 1;
|
|
1508
1583
|
n = e.replace(/%[sdifoO]/g, (e) => {
|
|
1509
1584
|
const n = t[r++];
|
|
@@ -1513,42 +1588,212 @@ function nr(e) {
|
|
|
1513
1588
|
case "%i": return parseInt(n);
|
|
1514
1589
|
case "%f": return parseFloat(n);
|
|
1515
1590
|
case "%o":
|
|
1516
|
-
case "%O": return "object" == typeof n ?
|
|
1591
|
+
case "%O": return "object" == typeof n ? lr(n) : String(n);
|
|
1517
1592
|
default: return e;
|
|
1518
1593
|
}
|
|
1519
1594
|
});
|
|
1520
|
-
const l = t.slice(r).map((e) => "object" == typeof e ?
|
|
1595
|
+
const l = t.slice(r).map((e) => "object" == typeof e ? lr(e) : String(e));
|
|
1521
1596
|
l.length > 0 && (n += " " + l.join(" "));
|
|
1522
|
-
} else n = t.map((e) => "object" == typeof e ?
|
|
1597
|
+
} else n = t.map((e) => "object" == typeof e ? lr(e) : String(e)).join(" ");
|
|
1523
1598
|
return n;
|
|
1524
1599
|
}
|
|
1525
|
-
function
|
|
1526
|
-
let
|
|
1527
|
-
|
|
1600
|
+
function ir(e, ...t) {
|
|
1601
|
+
let n = or(e, ...t), r = yo();
|
|
1602
|
+
Mn && (Mn === Gn.error ? Zn("error", n) && Mn("%c" + r + " ERROR: " + String(n), "color:red") : (Zn("error", n) && Gn.error("%c" + r + " ERROR: " + String(n), "color:red"), Mn(`${r} ERROR: ${String(n)}`))), tr("error", n, r);
|
|
1528
1603
|
}
|
|
1529
|
-
function
|
|
1530
|
-
let
|
|
1531
|
-
|
|
1604
|
+
function sr(e, ...t) {
|
|
1605
|
+
let n = or(e, ...t), r = yo();
|
|
1606
|
+
Wn && (Wn === Gn.warn ? Zn("warning", n) && Wn("%c" + r + " WARNING: " + String(n), "color:yellow") : (Zn("warning", n) && Gn.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), Wn(`${r} WARNING: ${String(n)}`))), tr("warning", n, r);
|
|
1532
1607
|
}
|
|
1533
|
-
function
|
|
1534
|
-
let
|
|
1535
|
-
|
|
1608
|
+
function ar(e, ...t) {
|
|
1609
|
+
let n = or(e, ...t), r = yo();
|
|
1610
|
+
xn && Zn("info", n) && xn("%c" + r + " INFO: " + String(n), "color:cyan"), tr("info", n, r);
|
|
1611
|
+
}
|
|
1612
|
+
function ur(e, ...t) {
|
|
1613
|
+
let n = or(e, ...t), r = yo();
|
|
1614
|
+
Kn && Zn("debug", n) && Kn("%c" + r + " DEBUG: " + String(n), "color:silver"), tr("debug", n, r);
|
|
1615
|
+
}
|
|
1616
|
+
function _r(e, ...t) {
|
|
1617
|
+
let n = or(e, ...t), r = yo();
|
|
1618
|
+
Kn && Zn("msg", n) && Kn("%c" + r + " MSG: " + String(n), "color:cyan"), tr("msg", n, r);
|
|
1619
|
+
}
|
|
1620
|
+
function cr(e, t) {
|
|
1621
|
+
Zn("json", t) && (t && Gn.warn("=====> " + t), Gn.dir(e)), tr("json", e, yo());
|
|
1622
|
+
}
|
|
1623
|
+
var fr = [
|
|
1624
|
+
"passw",
|
|
1625
|
+
"pwd",
|
|
1626
|
+
"passphrase",
|
|
1627
|
+
"secret",
|
|
1628
|
+
"token",
|
|
1629
|
+
"jwt",
|
|
1630
|
+
"bearer",
|
|
1631
|
+
"authorization",
|
|
1632
|
+
"cookie",
|
|
1633
|
+
"credential",
|
|
1634
|
+
"salt"
|
|
1635
|
+
], gr = [
|
|
1636
|
+
"apikey",
|
|
1637
|
+
"sessionid",
|
|
1638
|
+
"sessionkey",
|
|
1639
|
+
"authdata"
|
|
1640
|
+
], dr = /* @__PURE__ */ new Set([
|
|
1641
|
+
"endpoint",
|
|
1642
|
+
"url",
|
|
1643
|
+
"uri",
|
|
1644
|
+
"domain",
|
|
1645
|
+
"path",
|
|
1646
|
+
"file",
|
|
1647
|
+
"public",
|
|
1648
|
+
"pub",
|
|
1649
|
+
"count",
|
|
1650
|
+
"counts",
|
|
1651
|
+
"type",
|
|
1652
|
+
"name",
|
|
1653
|
+
"len",
|
|
1654
|
+
"length",
|
|
1655
|
+
"size",
|
|
1656
|
+
"max",
|
|
1657
|
+
"min",
|
|
1658
|
+
"ttl",
|
|
1659
|
+
"timeout",
|
|
1660
|
+
"expiry",
|
|
1661
|
+
"expires",
|
|
1662
|
+
"mode"
|
|
1663
|
+
]);
|
|
1664
|
+
function br(e) {
|
|
1665
|
+
if ("string" != typeof e || e.length < 3) return !1;
|
|
1666
|
+
let t = e.toLowerCase(), n = !1;
|
|
1667
|
+
for (const e of fr) if (t.indexOf(e) >= 0) {
|
|
1668
|
+
n = !0;
|
|
1669
|
+
break;
|
|
1670
|
+
}
|
|
1671
|
+
if (!n) {
|
|
1672
|
+
let e = t.replace(/[_\-. \t]/g, "");
|
|
1673
|
+
for (const t of gr) if (e.indexOf(t) >= 0) {
|
|
1674
|
+
n = !0;
|
|
1675
|
+
break;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
if (n || (n = t.indexOf("priv") >= 0 && t.indexOf("key") >= 0), !n) return !1;
|
|
1679
|
+
for (const e of t.split(/[_\-. \t]/)) if (dr.has(e)) return !1;
|
|
1680
|
+
return !0;
|
|
1536
1681
|
}
|
|
1537
|
-
function
|
|
1538
|
-
|
|
1539
|
-
|
|
1682
|
+
function pr(e, t, n) {
|
|
1683
|
+
const r = (e) => " " === e || " " === e, l = (t) => n && e[t] === n && (t + 1 >= e.length || r(e[t + 1]));
|
|
1684
|
+
let o = t;
|
|
1685
|
+
for (;;) {
|
|
1686
|
+
for (; o < e.length && !r(e[o]);) {
|
|
1687
|
+
if (l(o)) return o;
|
|
1688
|
+
o++;
|
|
1689
|
+
}
|
|
1690
|
+
if (o >= e.length) return o;
|
|
1691
|
+
let t = o;
|
|
1692
|
+
for (; t < e.length && r(e[t]);) t++;
|
|
1693
|
+
if (t >= e.length || l(t)) return o;
|
|
1694
|
+
for (let n = t; n < e.length && !r(e[n]) && !l(n); n++) if ("=" === e[n] && n > t) return o;
|
|
1695
|
+
o = t;
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
var mr = 128, hr = 4194304, Er = "<not shown: too large to mask>";
|
|
1699
|
+
function Tr(e) {
|
|
1700
|
+
if ("string" != typeof e || e.indexOf("=") < 0) return null;
|
|
1701
|
+
if (e.length > hr) return Er;
|
|
1702
|
+
let t, n = !1, r = /(^|[ \t])attribute=["']?([^ \t"']*)/g;
|
|
1703
|
+
for (; null !== (t = r.exec(e));) br(t[2].slice(-128)) && (n = !0);
|
|
1704
|
+
let l = [], o = 0, i = !1, s = "", a = 0, u = 0;
|
|
1705
|
+
const _ = (t) => t >= e.length || " " === e[t] || " " === e[t];
|
|
1706
|
+
for (; u < e.length;) {
|
|
1707
|
+
let t = e[u];
|
|
1708
|
+
if (" " === t || " " === t) {
|
|
1709
|
+
u++, a = u;
|
|
1710
|
+
continue;
|
|
1711
|
+
}
|
|
1712
|
+
if ("\"" !== t && "'" !== t || (s || 0 !== u && " " !== e[u - 1] && " " !== e[u - 1] && "=" !== e[u - 1] ? t === s && _(u + 1) && (s = "") : s = t), "=" !== t) {
|
|
1713
|
+
u++;
|
|
1714
|
+
continue;
|
|
1715
|
+
}
|
|
1716
|
+
let r = e.substring(Math.max(a, u - mr), u);
|
|
1717
|
+
if (a = u + 1, !(br(r) || n && "value" === r.toLowerCase())) {
|
|
1718
|
+
u++;
|
|
1719
|
+
continue;
|
|
1720
|
+
}
|
|
1721
|
+
u++;
|
|
1722
|
+
let c, f = "\"" === e[u] || "'" === e[u] ? e[u] : "";
|
|
1723
|
+
if (f) {
|
|
1724
|
+
for (c = u + 1; c < e.length && e[c] !== f;) c++;
|
|
1725
|
+
e[c] === f && c++;
|
|
1726
|
+
} else c = pr(e, u, s);
|
|
1727
|
+
c > u && (l.push(e.substring(o, u)), l.push("********"), o = c, i = !0), u = c, a = u;
|
|
1728
|
+
}
|
|
1729
|
+
return i ? (l.push(e.substring(o)), l.join("")) : null;
|
|
1540
1730
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1731
|
+
var yr = 64, vr = "<not shown: the masking failed>";
|
|
1732
|
+
var Or = Symbol("mask-in-progress");
|
|
1733
|
+
function Sr(e, t, n, r) {
|
|
1734
|
+
if ("string" == typeof e) {
|
|
1735
|
+
if (e.length > r.left) return r.left = 0, Er;
|
|
1736
|
+
r.left -= e.length;
|
|
1737
|
+
let t = Tr(e);
|
|
1738
|
+
return null !== t ? t : e;
|
|
1739
|
+
}
|
|
1740
|
+
let l = Array.isArray(e);
|
|
1741
|
+
if (!l && !function(e) {
|
|
1742
|
+
if (null === e || "object" != typeof e) return !1;
|
|
1743
|
+
let t = Object.getPrototypeOf(e);
|
|
1744
|
+
return t === Object.prototype || null === t;
|
|
1745
|
+
}(e)) return e;
|
|
1746
|
+
if (r.left <= 0) return Er;
|
|
1747
|
+
if (t.has(e)) {
|
|
1748
|
+
let n = t.get(e);
|
|
1749
|
+
return n === Or ? "<cycle>" : n;
|
|
1750
|
+
}
|
|
1751
|
+
if (n >= yr) return "<deeper not shown>";
|
|
1752
|
+
r.left -= 1, t.set(e, Or);
|
|
1753
|
+
let o, i = !1, s = !1;
|
|
1754
|
+
if (l) {
|
|
1755
|
+
o = [];
|
|
1756
|
+
for (let l = 0; l < e.length; l++) {
|
|
1757
|
+
if (r.left <= 0) {
|
|
1758
|
+
s = !0;
|
|
1759
|
+
break;
|
|
1760
|
+
}
|
|
1761
|
+
r.left -= 1;
|
|
1762
|
+
let a = Sr(e[l], t, n + 1, r);
|
|
1763
|
+
a !== e[l] && (i = !0), o.push(a);
|
|
1764
|
+
}
|
|
1765
|
+
s && o.push(Er);
|
|
1766
|
+
} else {
|
|
1767
|
+
o = Object.create(Object.getPrototypeOf(e));
|
|
1768
|
+
let l = "string" == typeof e.attribute && br(e.attribute.slice(-128));
|
|
1769
|
+
for (const a in e) {
|
|
1770
|
+
if (!Object.prototype.hasOwnProperty.call(e, a)) continue;
|
|
1771
|
+
if (r.left <= 0) {
|
|
1772
|
+
s = !0;
|
|
1773
|
+
break;
|
|
1774
|
+
}
|
|
1775
|
+
r.left -= 1 + a.length;
|
|
1776
|
+
let u, _ = e[a];
|
|
1777
|
+
u = (br(a.slice(-128)) || l && "value" === a) && null != _ && "" !== _ ? "********" : Sr(_, t, n + 1, r), u !== _ && (i = !0), o[a] = u;
|
|
1778
|
+
}
|
|
1779
|
+
s && (o["<more>"] = Er);
|
|
1780
|
+
}
|
|
1781
|
+
return i || s || (o = e), t.set(e, o), o;
|
|
1544
1782
|
}
|
|
1545
|
-
function
|
|
1546
|
-
|
|
1783
|
+
function Nr(e) {
|
|
1784
|
+
try {
|
|
1785
|
+
return Sr(e, /* @__PURE__ */ new WeakMap(), 0, { left: hr });
|
|
1786
|
+
} catch (e) {
|
|
1787
|
+
return vr;
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
function wr(e, t) {
|
|
1791
|
+
cr(Nr(e), t);
|
|
1547
1792
|
}
|
|
1548
|
-
function
|
|
1793
|
+
function jr(e) {
|
|
1549
1794
|
return structuredClone(e);
|
|
1550
1795
|
}
|
|
1551
|
-
function
|
|
1796
|
+
function Rr(...e) {
|
|
1552
1797
|
const t = {};
|
|
1553
1798
|
for (const n of e) {
|
|
1554
1799
|
const e = structuredClone(n);
|
|
@@ -1556,14 +1801,14 @@ function _r(...e) {
|
|
|
1556
1801
|
}
|
|
1557
1802
|
return t;
|
|
1558
1803
|
}
|
|
1559
|
-
function
|
|
1804
|
+
function $r(e, t) {
|
|
1560
1805
|
if (e === t) return !0;
|
|
1561
1806
|
if (null === e || null === t) return e === t;
|
|
1562
1807
|
if (typeof e != typeof t) return !1;
|
|
1563
1808
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1564
1809
|
if (Array.isArray(e)) {
|
|
1565
1810
|
if (e.length !== t.length) return !1;
|
|
1566
|
-
for (let n = 0; n < e.length; n++) if (
|
|
1811
|
+
for (let n = 0; n < e.length; n++) if (!$r(e[n], t[n])) return !1;
|
|
1567
1812
|
return !0;
|
|
1568
1813
|
}
|
|
1569
1814
|
if ("object" == typeof e) {
|
|
@@ -1571,340 +1816,351 @@ function cr(e, t) {
|
|
|
1571
1816
|
if (n.length !== r.length) return !1;
|
|
1572
1817
|
for (let l = 0; l < n.length; l++) {
|
|
1573
1818
|
if (n[l] !== r[l]) return !1;
|
|
1574
|
-
if (
|
|
1819
|
+
if (!$r(e[n[l]], t[r[l]])) return !1;
|
|
1575
1820
|
}
|
|
1576
1821
|
return !0;
|
|
1577
1822
|
}
|
|
1578
1823
|
return e === t;
|
|
1579
1824
|
}
|
|
1580
|
-
function
|
|
1825
|
+
function Dr(e, t) {
|
|
1581
1826
|
if (!t) return e;
|
|
1582
1827
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1583
1828
|
return e;
|
|
1584
1829
|
}
|
|
1585
|
-
function
|
|
1830
|
+
function Ar(e, t) {
|
|
1586
1831
|
if (!t) return e;
|
|
1587
1832
|
for (let n in t) t.hasOwnProperty(n) && e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1588
1833
|
return e;
|
|
1589
1834
|
}
|
|
1590
|
-
function
|
|
1835
|
+
function Ir(e, t) {
|
|
1591
1836
|
if (!t) return e;
|
|
1592
1837
|
for (let n in t) t.hasOwnProperty(n) && !e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1593
1838
|
return e;
|
|
1594
1839
|
}
|
|
1595
|
-
function
|
|
1840
|
+
function kr(e, t) {
|
|
1596
1841
|
if (e && e.hasOwnProperty(t)) return e[t];
|
|
1597
1842
|
}
|
|
1598
|
-
function
|
|
1843
|
+
function Cr(e, t) {
|
|
1599
1844
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1600
1845
|
}
|
|
1601
|
-
function
|
|
1846
|
+
function Lr(e, t, n) {
|
|
1602
1847
|
e[t] = n;
|
|
1603
1848
|
}
|
|
1604
|
-
function
|
|
1849
|
+
function Pr(e, t, n) {
|
|
1605
1850
|
e[t] = n;
|
|
1606
1851
|
}
|
|
1607
|
-
function
|
|
1852
|
+
function Ur(e, t) {
|
|
1608
1853
|
e.push(t);
|
|
1609
1854
|
}
|
|
1610
|
-
function
|
|
1855
|
+
function Fr(e, t) {
|
|
1611
1856
|
e.push(t);
|
|
1612
1857
|
}
|
|
1613
|
-
function
|
|
1858
|
+
function Vr(e, t) {
|
|
1614
1859
|
e.splice(t, 1);
|
|
1615
1860
|
}
|
|
1616
|
-
function
|
|
1861
|
+
function Gr(e, t) {
|
|
1617
1862
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
1618
1863
|
}
|
|
1619
|
-
function
|
|
1620
|
-
return
|
|
1864
|
+
function Mr(e) {
|
|
1865
|
+
return Yr(e) ? Object.keys(e).length : 0;
|
|
1621
1866
|
}
|
|
1622
|
-
function
|
|
1623
|
-
return
|
|
1867
|
+
function Wr(e) {
|
|
1868
|
+
return Br(e) ? e.length : 0;
|
|
1624
1869
|
}
|
|
1625
|
-
function
|
|
1626
|
-
return
|
|
1870
|
+
function xr(e) {
|
|
1871
|
+
return Yr(e) ? Object.keys(e).length : Br(e) ? e.length : Jr(e) && e.length > 0 ? 1 : 0;
|
|
1627
1872
|
}
|
|
1628
|
-
function
|
|
1629
|
-
return 0 ===
|
|
1873
|
+
function Kr(e) {
|
|
1874
|
+
return 0 === xr(e);
|
|
1630
1875
|
}
|
|
1631
|
-
function
|
|
1876
|
+
function Yr(e) {
|
|
1632
1877
|
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1633
1878
|
}
|
|
1634
|
-
function
|
|
1879
|
+
function Br(e) {
|
|
1635
1880
|
return Array.isArray(e);
|
|
1636
1881
|
}
|
|
1637
|
-
function
|
|
1882
|
+
function Jr(e) {
|
|
1638
1883
|
return "string" == typeof e;
|
|
1639
1884
|
}
|
|
1640
|
-
function
|
|
1885
|
+
function qr(e) {
|
|
1641
1886
|
return "number" == typeof e && Number.isFinite(e);
|
|
1642
1887
|
}
|
|
1643
|
-
function
|
|
1888
|
+
function Hr(e) {
|
|
1644
1889
|
return "boolean" == typeof e;
|
|
1645
1890
|
}
|
|
1646
|
-
function
|
|
1891
|
+
function Qr(e) {
|
|
1647
1892
|
return null == e;
|
|
1648
1893
|
}
|
|
1649
|
-
function
|
|
1650
|
-
if (
|
|
1651
|
-
if (!
|
|
1894
|
+
function zr(e) {
|
|
1895
|
+
if (qr(e)) return !0;
|
|
1896
|
+
if (!Jr(e)) return !1;
|
|
1652
1897
|
const t = Number(e);
|
|
1653
1898
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
1654
1899
|
}
|
|
1655
|
-
function
|
|
1900
|
+
function Xr(e) {
|
|
1656
1901
|
return e instanceof Date && !isNaN(e);
|
|
1657
1902
|
}
|
|
1658
|
-
function
|
|
1903
|
+
function Zr(e) {
|
|
1659
1904
|
return "function" == typeof e;
|
|
1660
1905
|
}
|
|
1661
|
-
function
|
|
1906
|
+
function el(e) {
|
|
1662
1907
|
return e instanceof k;
|
|
1663
1908
|
}
|
|
1664
|
-
function
|
|
1665
|
-
return !
|
|
1909
|
+
function tl(e) {
|
|
1910
|
+
return !Jr(e) || 0 === e.length;
|
|
1666
1911
|
}
|
|
1667
|
-
function
|
|
1668
|
-
return
|
|
1912
|
+
function nl(e) {
|
|
1913
|
+
return qr(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1669
1914
|
}
|
|
1670
|
-
function
|
|
1915
|
+
function rl(e, t, n) {
|
|
1671
1916
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
1672
1917
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
1673
1918
|
}
|
|
1674
|
-
function
|
|
1919
|
+
function ll(e, t) {
|
|
1675
1920
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1676
1921
|
}
|
|
1677
|
-
function
|
|
1922
|
+
function ol(e, t) {
|
|
1678
1923
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1679
1924
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1680
1925
|
}
|
|
1681
|
-
function
|
|
1682
|
-
if (
|
|
1683
|
-
if (
|
|
1926
|
+
function il(e, t) {
|
|
1927
|
+
if (Yr(e) || Yr(t) || Br(e) || Br(t)) return 0;
|
|
1928
|
+
if (qr(e) || qr(t)) {
|
|
1684
1929
|
let n = Number(e), r = Number(t);
|
|
1685
|
-
return n > r ? 1 : n < r ? -1 : 0;
|
|
1930
|
+
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
1686
1931
|
}
|
|
1687
|
-
if (
|
|
1932
|
+
if (Hr(e) || Hr(t)) {
|
|
1688
1933
|
let n = Number(e), r = Number(t);
|
|
1689
1934
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1690
1935
|
}
|
|
1691
|
-
return
|
|
1936
|
+
return ll(String(e), String(t));
|
|
1692
1937
|
}
|
|
1693
|
-
function
|
|
1938
|
+
function sl(e, t, n) {
|
|
1694
1939
|
var r;
|
|
1695
1940
|
return -1 !== (r = (e += "").indexOf(t)) && (n ? e.substring(0, r) : e.slice(r));
|
|
1696
1941
|
}
|
|
1697
|
-
function
|
|
1698
|
-
if (!
|
|
1699
|
-
let t;
|
|
1700
|
-
for (
|
|
1942
|
+
function al(e) {
|
|
1943
|
+
if (!Jr(e)) return !1;
|
|
1944
|
+
let t = 0;
|
|
1945
|
+
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
1701
1946
|
return 2 === t;
|
|
1702
1947
|
}
|
|
1703
|
-
function
|
|
1704
|
-
if (!
|
|
1705
|
-
let t;
|
|
1706
|
-
for (
|
|
1948
|
+
function ul(e) {
|
|
1949
|
+
if (!Jr(e)) return !1;
|
|
1950
|
+
let t = 0;
|
|
1951
|
+
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
1707
1952
|
return 1 === t;
|
|
1708
1953
|
}
|
|
1709
|
-
function
|
|
1710
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1954
|
+
function _l(e, t) {
|
|
1955
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) _l(e, n);
|
|
1711
1956
|
else "string" == typeof t && delete e[t];
|
|
1712
1957
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1713
1958
|
}
|
|
1714
|
-
function
|
|
1959
|
+
function cl(e, t) {
|
|
1715
1960
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1716
1961
|
}
|
|
1717
|
-
function
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1962
|
+
function fl(e, t) {
|
|
1963
|
+
return ("__proto__" === t || "constructor" === t || "prototype" === t) && !Object.prototype.hasOwnProperty.call(e, t);
|
|
1964
|
+
}
|
|
1965
|
+
function gl(e, t, n) {
|
|
1966
|
+
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
1967
|
+
value: n,
|
|
1968
|
+
writable: !0,
|
|
1969
|
+
enumerable: !0,
|
|
1970
|
+
configurable: !0
|
|
1971
|
+
}) : e[t] = n;
|
|
1972
|
+
}
|
|
1973
|
+
function dl(e, t, n, r) {
|
|
1974
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
1975
|
+
const l = e ? `${$t(e)}: ` : "";
|
|
1976
|
+
if (!Yr(t) && !Br(t)) return void ir(`${l}kw must be list or dict: '${String(n)}'`);
|
|
1977
|
+
if (!Jr(n)) return void ir(`${l}path must be a string: ${String(n)}`);
|
|
1722
1978
|
let o = n.split("`"), i = o.length;
|
|
1723
|
-
for (let e = 0; e < i
|
|
1724
|
-
if (
|
|
1725
|
-
if (
|
|
1979
|
+
for (let e = 0; e < i; e++) {
|
|
1980
|
+
if (fl(t, o[e])) return void (r && ir(`${l}path not found: '${n}'`));
|
|
1981
|
+
if (e === i - 1) break;
|
|
1982
|
+
if (null == (t = t[o[e]])) return void (r && ir(`${l}path not found: '${n}'`));
|
|
1983
|
+
if (!Yr(t) && !Br(t)) return void ir(`${l}kw must be list or dict: '${n}'`);
|
|
1726
1984
|
}
|
|
1727
1985
|
let s = t[o[i - 1]];
|
|
1728
|
-
return void 0 === s && r &&
|
|
1986
|
+
return void 0 === s && r && ir(`${l}path not found: '${n}'`), s;
|
|
1729
1987
|
}
|
|
1730
|
-
function
|
|
1731
|
-
e && !
|
|
1988
|
+
function bl(e, t, n) {
|
|
1989
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
1732
1990
|
let [r, l] = function(e, t) {
|
|
1733
1991
|
let n = e.lastIndexOf(t);
|
|
1734
1992
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1735
1993
|
}(n, "`");
|
|
1736
|
-
return
|
|
1994
|
+
return tl(l) ? Cr(t, n) : Cr(dl(e, t, r, !0), l), 0;
|
|
1737
1995
|
}
|
|
1738
|
-
function
|
|
1739
|
-
e && !
|
|
1740
|
-
let o =
|
|
1741
|
-
const i = l && l &
|
|
1996
|
+
function pl(e, t, n, r, l) {
|
|
1997
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
1998
|
+
let o = dl(e, t, n, !1);
|
|
1999
|
+
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT, u = l && l & Vn.KW_WILD_NUMBER;
|
|
1742
2000
|
if (void 0 === o) {
|
|
1743
2001
|
if (s && t) {
|
|
1744
2002
|
let l = Boolean(r);
|
|
1745
|
-
return
|
|
2003
|
+
return Sl(e, t, n, l), l;
|
|
1746
2004
|
}
|
|
1747
|
-
return i && (
|
|
2005
|
+
return i && (ir(`path not found: '${n}'`), wr(t)), Boolean(r);
|
|
1748
2006
|
}
|
|
1749
2007
|
let _;
|
|
1750
|
-
if (
|
|
1751
|
-
else if (u &&
|
|
1752
|
-
else if (u &&
|
|
2008
|
+
if (Hr(o)) _ = o;
|
|
2009
|
+
else if (u && qr(o)) _ = 0 !== o;
|
|
2010
|
+
else if (u && Jr(o)) _ = "true" === o.toLowerCase() || "false" !== o.toLowerCase() && 0 !== (parseInt(o, 10) || 0);
|
|
1753
2011
|
else {
|
|
1754
|
-
if (!u || null !== o) return u ? (
|
|
2012
|
+
if (!u || null !== o) return u ? (ir(`${e ? $t(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), wr(t), !1) : (ir(`${e ? $t(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), wr(t), Boolean(r));
|
|
1755
2013
|
_ = !1;
|
|
1756
2014
|
}
|
|
1757
|
-
return a &&
|
|
2015
|
+
return a && bl(e, t, n), _;
|
|
1758
2016
|
}
|
|
1759
|
-
function
|
|
1760
|
-
e && !
|
|
1761
|
-
let o =
|
|
1762
|
-
const i = l && l &
|
|
2017
|
+
function ml(e, t, n, r, l) {
|
|
2018
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
2019
|
+
let o = dl(e, t, n, !1);
|
|
2020
|
+
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT, u = l && l & Vn.KW_WILD_NUMBER;
|
|
1763
2021
|
if (void 0 === o) {
|
|
1764
2022
|
if (s && t) {
|
|
1765
2023
|
let l = parseInt(r);
|
|
1766
|
-
return
|
|
2024
|
+
return Sl(e, t, n, l), l;
|
|
1767
2025
|
}
|
|
1768
|
-
return i && (
|
|
2026
|
+
return i && (ir(`path not found: '${n}'`), wr(t)), parseInt(r);
|
|
1769
2027
|
}
|
|
1770
2028
|
let _;
|
|
1771
|
-
if (
|
|
2029
|
+
if (qr(o)) _ = Math.trunc(o);
|
|
1772
2030
|
else {
|
|
1773
|
-
if (!u) return
|
|
1774
|
-
if (
|
|
1775
|
-
else if (
|
|
2031
|
+
if (!u) return ir(`${e ? $t(e) + ": " : ""}path MUST BE a json integer: '${n}'`), wr(t), parseInt(r);
|
|
2032
|
+
if (Hr(o)) _ = o ? 1 : 0;
|
|
2033
|
+
else if (Jr(o)) _ = function(e) {
|
|
1776
2034
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
1777
2035
|
if (!t) return 0;
|
|
1778
2036
|
let n, r = t[2];
|
|
1779
2037
|
return n = r.length > 1 && ("x" === r[1] || "X" === r[1]) ? parseInt(r.substring(2), 16) : "0" === r[0] ? parseInt(r, 8) : parseInt(r, 10), "-" === t[1] ? -n : n;
|
|
1780
2038
|
}(o);
|
|
1781
2039
|
else {
|
|
1782
|
-
if (null !== o) return
|
|
2040
|
+
if (null !== o) return ir(`${e ? $t(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), wr(t), 0;
|
|
1783
2041
|
_ = 0;
|
|
1784
2042
|
}
|
|
1785
2043
|
}
|
|
1786
|
-
return a &&
|
|
2044
|
+
return a && bl(e, t, n), _;
|
|
1787
2045
|
}
|
|
1788
|
-
function
|
|
1789
|
-
e && !
|
|
1790
|
-
let o =
|
|
1791
|
-
const i = l && l &
|
|
2046
|
+
function hl(e, t, n, r, l) {
|
|
2047
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
2048
|
+
let o = dl(e, t, n, !1);
|
|
2049
|
+
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT, u = l && l & Vn.KW_WILD_NUMBER;
|
|
1792
2050
|
if (void 0 === o) {
|
|
1793
2051
|
if (s && t) {
|
|
1794
2052
|
let l = Number(r);
|
|
1795
|
-
return
|
|
2053
|
+
return Sl(e, t, n, l), l;
|
|
1796
2054
|
}
|
|
1797
|
-
return i && (
|
|
2055
|
+
return i && (ir(`path not found: '${n}'`), wr(t)), Number(r);
|
|
1798
2056
|
}
|
|
1799
2057
|
let _;
|
|
1800
|
-
if (
|
|
2058
|
+
if (qr(o)) _ = o;
|
|
1801
2059
|
else {
|
|
1802
|
-
if (!u) return
|
|
1803
|
-
if (
|
|
1804
|
-
else if (
|
|
2060
|
+
if (!u) return ir(`${e ? $t(e) + ": " : ""}path MUST BE a json real: '${n}'`), wr(t), Number(r);
|
|
2061
|
+
if (Hr(o)) _ = o ? 1 : 0;
|
|
2062
|
+
else if (Jr(o)) _ = parseFloat(o), Number.isNaN(_) && (_ = 0);
|
|
1805
2063
|
else {
|
|
1806
|
-
if (null !== o) return
|
|
2064
|
+
if (null !== o) return ir(`${e ? $t(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), wr(t), 0;
|
|
1807
2065
|
_ = 0;
|
|
1808
2066
|
}
|
|
1809
2067
|
}
|
|
1810
|
-
return a &&
|
|
2068
|
+
return a && bl(e, t, n), _;
|
|
1811
2069
|
}
|
|
1812
|
-
function
|
|
1813
|
-
e && !
|
|
1814
|
-
let o =
|
|
1815
|
-
const i = l && l &
|
|
1816
|
-
return void 0 === o ? s && t ? (
|
|
1817
|
-
let n =
|
|
2070
|
+
function El(e, t, n, r, l) {
|
|
2071
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
2072
|
+
let o = dl(e, t, n, !1);
|
|
2073
|
+
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2074
|
+
return void 0 === o ? s && t ? (Sl(e, t, n, Jr(r) ? r : null), r) : (i && !function(e, t) {
|
|
2075
|
+
let n = Jr(t) ? t.split("`") : [], r = e;
|
|
1818
2076
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1819
|
-
if (!
|
|
2077
|
+
if (!Yr(r) && !Br(r)) return !1;
|
|
1820
2078
|
r = r[n[e]];
|
|
1821
2079
|
}
|
|
1822
|
-
return !(!
|
|
1823
|
-
}(t, n) && (
|
|
2080
|
+
return !(!Yr(r) && !Br(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
2081
|
+
}(t, n) && (ir(`path not found: '${n}'`), wr(t)), r) : Jr(o) ? (a && bl(e, t, n), o) : (null !== o && (ir(`${e ? $t(e) + ": " : ""}path MUST BE a json str: '${n}'`), wr(t)), r);
|
|
1824
2082
|
}
|
|
1825
|
-
function
|
|
1826
|
-
e && !
|
|
1827
|
-
let o =
|
|
1828
|
-
const i = l && l &
|
|
2083
|
+
function Tl(e, t, n, r, l) {
|
|
2084
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
2085
|
+
let o = dl(e, t, n, !1);
|
|
2086
|
+
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
1829
2087
|
if (void 0 === o) {
|
|
1830
2088
|
if (s) {
|
|
1831
2089
|
let l = r;
|
|
1832
|
-
return
|
|
2090
|
+
return Sl(e, t, n, l), l;
|
|
1833
2091
|
}
|
|
1834
|
-
return i && (
|
|
2092
|
+
return i && (ir(`path not found: '${n}'`), wr(t)), r;
|
|
1835
2093
|
}
|
|
1836
|
-
return a &&
|
|
2094
|
+
return a && bl(e, t, n), o;
|
|
1837
2095
|
}
|
|
1838
|
-
function
|
|
1839
|
-
e && !
|
|
1840
|
-
let o =
|
|
1841
|
-
const i = l && l &
|
|
1842
|
-
return void 0 === o ? s &&
|
|
2096
|
+
function yl(e, t, n, r, l) {
|
|
2097
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
2098
|
+
let o = dl(e, t, n, !1);
|
|
2099
|
+
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2100
|
+
return void 0 === o ? s && Yr(r) && t ? (Sl(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), wr(t)), r) : Yr(o) ? (a && bl(e, t, n), o) : (i && (ir(`${e ? $t(e) + ": " : ""}path MUST BE a json dict: '${n}'`), wr(t)), r);
|
|
1843
2101
|
}
|
|
1844
|
-
function
|
|
1845
|
-
e && !
|
|
1846
|
-
let o =
|
|
1847
|
-
const i = l && l &
|
|
2102
|
+
function vl(e, t, n, r, l) {
|
|
2103
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
2104
|
+
let o = dl(e, t, n, !1);
|
|
2105
|
+
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
1848
2106
|
if (void 0 === o) {
|
|
1849
2107
|
if (s) {
|
|
1850
2108
|
let l = r;
|
|
1851
|
-
return
|
|
2109
|
+
return Sl(e, t, n, l), l;
|
|
1852
2110
|
}
|
|
1853
|
-
return i && (
|
|
2111
|
+
return i && (ir(`path not found: '${n}'`), wr(t)), r;
|
|
1854
2112
|
}
|
|
1855
|
-
return a &&
|
|
2113
|
+
return a && bl(e, t, n), o;
|
|
1856
2114
|
}
|
|
1857
|
-
function
|
|
1858
|
-
e && !
|
|
1859
|
-
let o =
|
|
1860
|
-
const i = l && l &
|
|
1861
|
-
return void 0 === o ? s &&
|
|
2115
|
+
function Ol(e, t, n, r, l) {
|
|
2116
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
2117
|
+
let o = dl(e, t, n, !1);
|
|
2118
|
+
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2119
|
+
return void 0 === o ? s && Br(r) && t ? (Sl(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), wr(t)), r) : Br(o) ? (a && bl(e, t, n), o) : (i && (ir(`${e ? $t(e) + ": " : ""}path MUST BE a json list: '${n}'`), wr(t)), r);
|
|
1862
2120
|
}
|
|
1863
|
-
function
|
|
1864
|
-
if (e && !
|
|
1865
|
-
let l = n.split("`");
|
|
1866
|
-
if (l.length <= 1) return t[n] = r, 0;
|
|
1867
|
-
let o = l.length;
|
|
2121
|
+
function Sl(e, t, n, r) {
|
|
2122
|
+
if (e && !el(e) && ir("GObj bad instanceof"), !Yr(t)) return ir("kw is not an object"), -1;
|
|
2123
|
+
let l = n.split("`"), o = l.length;
|
|
1868
2124
|
for (let i = 0; i < o; i++) {
|
|
1869
2125
|
let s = l[i];
|
|
1870
|
-
if (i === o - 1) t
|
|
2126
|
+
if (i === o - 1) gl(t, s, r);
|
|
1871
2127
|
else {
|
|
1872
|
-
let r = t[s];
|
|
1873
|
-
if (void 0 === r) t
|
|
1874
|
-
else if (!
|
|
2128
|
+
let r = fl(t, s) ? void 0 : t[s];
|
|
2129
|
+
if (void 0 === r) gl(t, s, {});
|
|
2130
|
+
else if (!Yr(r) && !Br(r)) return ir(`${e ? $t(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not a dict or a list: '${n}'`), -1;
|
|
1875
2131
|
t = t[s];
|
|
1876
2132
|
}
|
|
1877
2133
|
}
|
|
1878
2134
|
return 0;
|
|
1879
2135
|
}
|
|
1880
|
-
function
|
|
1881
|
-
if (e && !
|
|
1882
|
-
let o =
|
|
1883
|
-
return
|
|
2136
|
+
function Nl(e, t, n, r, l) {
|
|
2137
|
+
if (e && !el(e) && ir("GObj bad instanceof"), !Yr(t)) return ir("kw is not an object"), -1;
|
|
2138
|
+
let o = yl(e, t, n, {}, Vn.KW_CREATE);
|
|
2139
|
+
return Yr(o) ? (o[r] = l, 0) : (ir("subdict is not an object"), -1);
|
|
1884
2140
|
}
|
|
1885
|
-
function
|
|
2141
|
+
function wl(e, n, r) {
|
|
1886
2142
|
let l = "", o = !1;
|
|
1887
|
-
if (
|
|
2143
|
+
if (Br(n)) {
|
|
1888
2144
|
o = !1;
|
|
1889
2145
|
for (let i = 0; i < n.length; i++) {
|
|
1890
2146
|
let s = n[i];
|
|
1891
|
-
if (l =
|
|
2147
|
+
if (l = tl(r) ? t("%s", r) : t("%s`%d", r, i), o = wl(e, s, l), o) break;
|
|
1892
2148
|
}
|
|
1893
|
-
} else if (
|
|
2149
|
+
} else if (Yr(n)) {
|
|
1894
2150
|
o = !0;
|
|
1895
2151
|
let i = Object.keys(n);
|
|
1896
2152
|
for (let s = 0; s < i.length; s++) {
|
|
1897
2153
|
let a = i[s], u = n[a];
|
|
1898
|
-
if (l =
|
|
1899
|
-
if (o =
|
|
2154
|
+
if (l = tl(r) ? t("%s", a) : t("%s`%s", r, a), Br(u) || Yr(u)) {
|
|
2155
|
+
if (o = wl(e, u, l), !o) break;
|
|
1900
2156
|
continue;
|
|
1901
2157
|
}
|
|
1902
|
-
let _ =
|
|
1903
|
-
if (_
|
|
2158
|
+
let _ = vl(0, e, l, void 0, 0);
|
|
2159
|
+
if (void 0 === _ && (_ = kr(e, l)), void 0 === _) {
|
|
1904
2160
|
o = !1;
|
|
1905
2161
|
break;
|
|
1906
2162
|
}
|
|
1907
|
-
if (0 !==
|
|
2163
|
+
if (0 !== il(_, u)) {
|
|
1908
2164
|
o = !1;
|
|
1909
2165
|
break;
|
|
1910
2166
|
}
|
|
@@ -1912,91 +2168,92 @@ function il(e, n, r) {
|
|
|
1912
2168
|
}
|
|
1913
2169
|
return o;
|
|
1914
2170
|
}
|
|
1915
|
-
function
|
|
1916
|
-
return 0 ===
|
|
2171
|
+
function jl(e, t) {
|
|
2172
|
+
return 0 === xr(t) || wl(e, t, "");
|
|
1917
2173
|
}
|
|
1918
|
-
function
|
|
1919
|
-
if (!n || !
|
|
1920
|
-
for (let e = 0; e < t.length; e++) if (
|
|
1921
|
-
return r &&
|
|
2174
|
+
function Rl(e, t, n, r) {
|
|
2175
|
+
if (!n || !Br(t)) return r && ir("item NULL or kw_list is not a list"), -1;
|
|
2176
|
+
for (let e = 0; e < t.length; e++) if ($r(n, t[e])) return e;
|
|
2177
|
+
return r && ir("item not found in this list"), -1;
|
|
1922
2178
|
}
|
|
1923
|
-
function
|
|
1924
|
-
if (e && !
|
|
1925
|
-
r || (r =
|
|
2179
|
+
function $l(e, t, n, r) {
|
|
2180
|
+
if (e && !el(e) && ir("GObj bad instanceof"), !t) return null;
|
|
2181
|
+
r || (r = jl);
|
|
1926
2182
|
let l = [];
|
|
1927
|
-
if (
|
|
2183
|
+
if (Br(t)) for (let e = 0; e < t.length; e++) {
|
|
1928
2184
|
let o = t[e];
|
|
1929
|
-
r(o, n) && l.push(
|
|
2185
|
+
r(o, n) && l.push(jr(o));
|
|
1930
2186
|
}
|
|
1931
2187
|
else {
|
|
1932
|
-
if (!
|
|
1933
|
-
r(t, n) && l.push(
|
|
2188
|
+
if (!Yr(t)) return ir("kw_select() BAD kw parameter"), null;
|
|
2189
|
+
r(t, n) && l.push(jr(t));
|
|
1934
2190
|
}
|
|
1935
2191
|
return l;
|
|
1936
2192
|
}
|
|
1937
|
-
function
|
|
1938
|
-
if (e && !
|
|
1939
|
-
r || (r =
|
|
2193
|
+
function Dl(e, t, n, r) {
|
|
2194
|
+
if (e && !el(e) && ir("GObj bad instanceof"), !t) return null;
|
|
2195
|
+
r || (r = jl);
|
|
1940
2196
|
let l = [];
|
|
1941
|
-
if (
|
|
2197
|
+
if (Br(t)) for (let e = 0; e < t.length; e++) {
|
|
1942
2198
|
let o = t[e];
|
|
1943
2199
|
r(o, n) && l.push(o);
|
|
1944
2200
|
}
|
|
1945
2201
|
else {
|
|
1946
|
-
if (!
|
|
2202
|
+
if (!Yr(t)) return ir("kw_select() BAD kw parameter"), null;
|
|
1947
2203
|
r(t, n) && l.push(t);
|
|
1948
2204
|
}
|
|
1949
2205
|
return l;
|
|
1950
2206
|
}
|
|
1951
|
-
function
|
|
1952
|
-
e && !
|
|
2207
|
+
function Al(e, t, n, r) {
|
|
2208
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
1953
2209
|
let l = {};
|
|
1954
|
-
if (
|
|
2210
|
+
if (Jr(n) && !tl(n)) {
|
|
1955
2211
|
let o = n;
|
|
1956
|
-
t.hasOwnProperty(o) ? l[o] = t[o] : r &&
|
|
1957
|
-
} else if (
|
|
2212
|
+
t.hasOwnProperty(o) ? l[o] = t[o] : r && ir(`${$t(e)}: key not found: ${o}`);
|
|
2213
|
+
} else if (Yr(n) && Mr(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? l[o] = t[o] : r && ir(`${$t(e)}: key not found: ${o}`);
|
|
1958
2214
|
else {
|
|
1959
|
-
if (!(
|
|
2215
|
+
if (!(Br(n) && Wr(n) > 0)) return t;
|
|
1960
2216
|
for (let o = 0; o < n.length; o++) {
|
|
1961
2217
|
let i = n[o];
|
|
1962
|
-
t.hasOwnProperty(i) ? l[i] = t[i] : r &&
|
|
2218
|
+
t.hasOwnProperty(i) ? l[i] = t[i] : r && ir(`${$t(e)}: key not found: ${i}`);
|
|
1963
2219
|
}
|
|
1964
2220
|
}
|
|
1965
2221
|
return l;
|
|
1966
2222
|
}
|
|
1967
|
-
function
|
|
2223
|
+
function Il(e, t, n, r) {
|
|
1968
2224
|
let l = {};
|
|
1969
|
-
if (
|
|
2225
|
+
if (!Yr(t)) return l;
|
|
2226
|
+
if (Dr(l, t), Jr(n) && !tl(n)) {
|
|
1970
2227
|
let o = n;
|
|
1971
|
-
|
|
1972
|
-
} else if (
|
|
2228
|
+
t.hasOwnProperty(o) ? Cr(l, o) : r && ir(`${$t(e)}: key not found: ${o}`);
|
|
2229
|
+
} else if (Yr(n) && Mr(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? Cr(l, o) : r && ir(`${$t(e)}: key not found: ${o}`);
|
|
1973
2230
|
else {
|
|
1974
|
-
if (!(
|
|
2231
|
+
if (!(Br(n) && Wr(n) > 0)) return {};
|
|
1975
2232
|
for (let o = 0; o < n.length; o++) {
|
|
1976
2233
|
let i = n[o];
|
|
1977
|
-
t.hasOwnProperty(i) ?
|
|
2234
|
+
t.hasOwnProperty(i) ? Cr(l, i) : r && ir(`${$t(e)}: key not found: ${i}`);
|
|
1978
2235
|
}
|
|
1979
2236
|
}
|
|
1980
2237
|
return l;
|
|
1981
2238
|
}
|
|
1982
|
-
function
|
|
2239
|
+
function kl(e, t, n = !1) {
|
|
1983
2240
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1984
2241
|
let r = window.localStorage.getItem(e);
|
|
1985
|
-
return null === r ? (n &&
|
|
2242
|
+
return null === r ? (n && Cl(e, t), t) : JSON.parse(r);
|
|
1986
2243
|
} catch (n) {
|
|
1987
2244
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1988
2245
|
}
|
|
1989
2246
|
}
|
|
1990
|
-
function
|
|
2247
|
+
function Cl(e, t) {
|
|
1991
2248
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1992
|
-
if (!e || void 0 === t) return
|
|
2249
|
+
if (!e || void 0 === t) return ir(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1993
2250
|
try {
|
|
1994
2251
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1995
2252
|
} catch (t) {
|
|
1996
|
-
return
|
|
2253
|
+
return ir(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1997
2254
|
}
|
|
1998
2255
|
}
|
|
1999
|
-
function
|
|
2256
|
+
function Ll(e) {
|
|
2000
2257
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
2001
2258
|
window.localStorage.removeItem(e);
|
|
2002
2259
|
} catch (t) {
|
|
@@ -2004,125 +2261,125 @@ function bl(e) {
|
|
|
2004
2261
|
}
|
|
2005
2262
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
2006
2263
|
}
|
|
2007
|
-
function
|
|
2008
|
-
if (
|
|
2009
|
-
if (
|
|
2264
|
+
function Pl(e, t) {
|
|
2265
|
+
if (Qr(e) || Qr(t)) return !0;
|
|
2266
|
+
if (Br(e)) {
|
|
2010
2267
|
if (0 === e.length) return !0;
|
|
2011
2268
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
2012
|
-
} else if (
|
|
2269
|
+
} else if (Yr(e)) {
|
|
2013
2270
|
if (0 === Object.keys(e).length) return !0;
|
|
2014
2271
|
for (let n in e) if (n === t) return !0;
|
|
2015
|
-
} else if (
|
|
2272
|
+
} else if (Jr(e) && e === t) return !0;
|
|
2016
2273
|
return !1;
|
|
2017
2274
|
}
|
|
2018
|
-
function
|
|
2019
|
-
if (e && !
|
|
2020
|
-
l || (l =
|
|
2275
|
+
function Ul(e, t, n, r, l) {
|
|
2276
|
+
if (e && !el(e) && ir("GObj bad instanceof"), !t) return null;
|
|
2277
|
+
l || (l = jl);
|
|
2021
2278
|
let o = [];
|
|
2022
|
-
if (
|
|
2279
|
+
if (Br(t)) for (let i = 0; i < t.length; i++) {
|
|
2023
2280
|
let s, a = t[i];
|
|
2024
|
-
if (
|
|
2281
|
+
if (Yr(a)) s = El(e, a, "id", "", 0);
|
|
2025
2282
|
else {
|
|
2026
|
-
if (!
|
|
2283
|
+
if (!Jr(a)) continue;
|
|
2027
2284
|
s = a;
|
|
2028
2285
|
}
|
|
2029
|
-
|
|
2286
|
+
Pl(n, s) && l(a, r) && o.push(a);
|
|
2030
2287
|
}
|
|
2031
2288
|
else {
|
|
2032
|
-
if (!
|
|
2289
|
+
if (!Yr(t)) return ir("kw_collect() BAD kw parameter"), null;
|
|
2033
2290
|
for (let e of Object.keys(t)) {
|
|
2034
2291
|
let i = t[e];
|
|
2035
|
-
|
|
2292
|
+
Pl(n, e) && l(i, r) && o.push(i);
|
|
2036
2293
|
}
|
|
2037
2294
|
}
|
|
2038
2295
|
return o;
|
|
2039
2296
|
}
|
|
2040
|
-
function
|
|
2041
|
-
e && !
|
|
2297
|
+
function Fl(e, t, n) {
|
|
2298
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
2042
2299
|
let r = {};
|
|
2043
|
-
if (
|
|
2044
|
-
else if (
|
|
2045
|
-
let l = t[n], o =
|
|
2046
|
-
|
|
2300
|
+
if (tl(n) || (t = dl(e, t, n)), Yr(t)) r = t;
|
|
2301
|
+
else if (Br(t)) for (let n = 0; n < t.length; n++) {
|
|
2302
|
+
let l = t[n], o = El(e, l, "id", "", Vn.KW_REQUIRED);
|
|
2303
|
+
tl(o) || (r[o] = l);
|
|
2047
2304
|
}
|
|
2048
|
-
else
|
|
2305
|
+
else ir(`${$t(e)} kwid_new_dict: data type unknown`);
|
|
2049
2306
|
return r;
|
|
2050
2307
|
}
|
|
2051
|
-
function
|
|
2052
|
-
if (e && !
|
|
2053
|
-
if (
|
|
2308
|
+
function Vl(e, t, n) {
|
|
2309
|
+
if (e && !el(e) && ir("GObj bad instanceof"), tl(n) || (t = dl(e, t, n)), Br(t)) return t;
|
|
2310
|
+
if (Yr(t)) {
|
|
2054
2311
|
let n = [];
|
|
2055
2312
|
for (let r of Object.keys(t)) {
|
|
2056
2313
|
let l = t[r];
|
|
2057
|
-
|
|
2314
|
+
Yr(l) ? (l.id = r, n.push(l)) : ir(`${$t(e)} kwid_new_list: not a record: '${r}'`);
|
|
2058
2315
|
}
|
|
2059
2316
|
return n;
|
|
2060
2317
|
}
|
|
2061
|
-
return
|
|
2318
|
+
return ir(`${$t(e)} kwid_new_list: wrong type for list`), [];
|
|
2062
2319
|
}
|
|
2063
|
-
function
|
|
2064
|
-
e && !
|
|
2065
|
-
let o =
|
|
2320
|
+
function Gl(e, t, n, r, l) {
|
|
2321
|
+
e && !el(e) && ir("GObj bad instanceof");
|
|
2322
|
+
let o = Ul(e, t, n, r, l);
|
|
2066
2323
|
return o && 0 !== o.length ? o[0] : null;
|
|
2067
2324
|
}
|
|
2068
|
-
function
|
|
2069
|
-
if (e && !
|
|
2325
|
+
function Ml(e, t) {
|
|
2326
|
+
if (e && !el(e) && ir("GObj bad instanceof"), !t) return [];
|
|
2070
2327
|
let n = [];
|
|
2071
|
-
if (
|
|
2072
|
-
else if (
|
|
2073
|
-
else
|
|
2074
|
-
if (
|
|
2075
|
-
else if (
|
|
2076
|
-
let r =
|
|
2328
|
+
if (Jr(t)) n.push(t);
|
|
2329
|
+
else if (Yr(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2330
|
+
else Br(t) && t.forEach(function(t) {
|
|
2331
|
+
if (Jr(t)) tl(t) || n.push(t);
|
|
2332
|
+
else if (Yr(t)) {
|
|
2333
|
+
let r = El(e, t, "id", 0, 0);
|
|
2077
2334
|
r && n.push(r);
|
|
2078
2335
|
}
|
|
2079
2336
|
});
|
|
2080
2337
|
return n;
|
|
2081
2338
|
}
|
|
2082
|
-
function
|
|
2339
|
+
function Wl(e, t, n) {
|
|
2083
2340
|
t = t || "id", n = n || "value";
|
|
2084
2341
|
let r = [];
|
|
2085
|
-
if (
|
|
2342
|
+
if (Br(e)) for (let l = 0; l < e.length; l++) {
|
|
2086
2343
|
let o = e[l];
|
|
2087
|
-
if (
|
|
2344
|
+
if (Jr(o)) r.push({
|
|
2088
2345
|
id: e[l],
|
|
2089
2346
|
value: e[l]
|
|
2090
2347
|
});
|
|
2091
|
-
else if (
|
|
2348
|
+
else if (Yr(o)) {
|
|
2092
2349
|
let e = {};
|
|
2093
|
-
if (
|
|
2094
|
-
if (!
|
|
2095
|
-
if (!(
|
|
2096
|
-
|
|
2350
|
+
if (cl(o, t)) {
|
|
2351
|
+
if (!cl(o, n)) {
|
|
2352
|
+
if (!(xr(o) > 0)) {
|
|
2353
|
+
ir("list2options(): object without field value: " + n);
|
|
2097
2354
|
continue;
|
|
2098
2355
|
}
|
|
2099
2356
|
n = Object.keys(o)[0];
|
|
2100
2357
|
}
|
|
2101
2358
|
e.id = o[t], e.value = o[n];
|
|
2102
2359
|
} else {
|
|
2103
|
-
if (!(
|
|
2104
|
-
|
|
2360
|
+
if (!(xr(o) > 0)) {
|
|
2361
|
+
ir("list2options(): object without field id: " + t);
|
|
2105
2362
|
continue;
|
|
2106
2363
|
}
|
|
2107
2364
|
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
2108
2365
|
}
|
|
2109
2366
|
r.push(e);
|
|
2110
|
-
} else
|
|
2367
|
+
} else ir("list2options(): case1 not implemented");
|
|
2111
2368
|
}
|
|
2112
|
-
else if (
|
|
2369
|
+
else if (Yr(e)) for (let t of Object.keys(e)) r.push({
|
|
2113
2370
|
id: t,
|
|
2114
2371
|
value: t
|
|
2115
2372
|
});
|
|
2116
|
-
else
|
|
2373
|
+
else ir("list2options(): case2 not implemented");
|
|
2117
2374
|
return r;
|
|
2118
2375
|
}
|
|
2119
|
-
function
|
|
2376
|
+
function xl(e, t) {
|
|
2120
2377
|
if (!e) return -1;
|
|
2121
2378
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
2122
2379
|
return -1;
|
|
2123
2380
|
}
|
|
2124
|
-
function
|
|
2125
|
-
if (!e || !t) return
|
|
2381
|
+
function Kl(e, t, n) {
|
|
2382
|
+
if (!e || !t) return ir("ERROR: str_in_list() list or str empty"), !1;
|
|
2126
2383
|
let r = e.length;
|
|
2127
2384
|
if (n) {
|
|
2128
2385
|
t = t.toLowerCase();
|
|
@@ -2133,17 +2390,17 @@ function Ol(e, t, n) {
|
|
|
2133
2390
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
2134
2391
|
return !1;
|
|
2135
2392
|
}
|
|
2136
|
-
function
|
|
2137
|
-
if (!e) return
|
|
2138
|
-
if (!t) return
|
|
2139
|
-
for (let r = 0; r < t.length; r++) if (
|
|
2393
|
+
function Yl(e, t, n) {
|
|
2394
|
+
if (!e) return ir("ERROR: strs_in_list() list empty"), !1;
|
|
2395
|
+
if (!t) return ir("ERROR: strs_in_list() str empty"), !1;
|
|
2396
|
+
for (let r = 0; r < t.length; r++) if (Kl(e, t[r], n)) return !0;
|
|
2140
2397
|
return !1;
|
|
2141
2398
|
}
|
|
2142
|
-
function
|
|
2399
|
+
function Bl(e, t) {
|
|
2143
2400
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return e.splice(n, 1), !0;
|
|
2144
2401
|
return !1;
|
|
2145
2402
|
}
|
|
2146
|
-
function
|
|
2403
|
+
function Jl(e, t) {
|
|
2147
2404
|
try {
|
|
2148
2405
|
let n = e.__md_iev__;
|
|
2149
2406
|
if (n) return n[t];
|
|
@@ -2151,53 +2408,53 @@ function jl(e, t) {
|
|
|
2151
2408
|
return;
|
|
2152
2409
|
}
|
|
2153
2410
|
}
|
|
2154
|
-
function
|
|
2411
|
+
function ql(e, t, n) {
|
|
2155
2412
|
let r = e.__md_iev__;
|
|
2156
2413
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2157
2414
|
}
|
|
2158
|
-
function
|
|
2159
|
-
if (!
|
|
2415
|
+
function Hl(e, t, n, r) {
|
|
2416
|
+
if (!el(e)) return ir("gobj is not a GObj"), null;
|
|
2160
2417
|
if (!t) return;
|
|
2161
|
-
let l =
|
|
2162
|
-
l || (l = [],
|
|
2418
|
+
let l = Jl(t, n);
|
|
2419
|
+
l || (l = [], ql(t, n, l));
|
|
2163
2420
|
try {
|
|
2164
|
-
|
|
2421
|
+
Br(l) && l.unshift(r);
|
|
2165
2422
|
} catch (e) {
|
|
2166
|
-
|
|
2423
|
+
ir(e);
|
|
2167
2424
|
}
|
|
2168
2425
|
}
|
|
2169
|
-
function
|
|
2170
|
-
if (!
|
|
2171
|
-
if (!
|
|
2172
|
-
let l =
|
|
2173
|
-
return l ? 0 === l.length ? (r &&
|
|
2426
|
+
function Ql(e, t, n, r) {
|
|
2427
|
+
if (!el(e)) return ir("gobj is not a GObj"), null;
|
|
2428
|
+
if (!Yr(t)) return ir("kw is not a dict"), null;
|
|
2429
|
+
let l = Jl(t, n);
|
|
2430
|
+
return l ? 0 === l.length ? (r && ir(`stack empty: ${n}`), null) : l[0] : (r && ir(`stack NOT FOUND: ${n}`), null);
|
|
2174
2431
|
}
|
|
2175
|
-
function
|
|
2176
|
-
return
|
|
2432
|
+
function zl(e, t, n) {
|
|
2433
|
+
return tl(n) ? bl(e, t, "__md_iev__`__msg_type__") : Nl(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2177
2434
|
}
|
|
2178
|
-
function
|
|
2179
|
-
return
|
|
2435
|
+
function Xl(e, t) {
|
|
2436
|
+
return El(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2180
2437
|
}
|
|
2181
|
-
function
|
|
2438
|
+
function Zl(e, t, n) {
|
|
2182
2439
|
let r = new XMLHttpRequest();
|
|
2183
2440
|
r.open("GET", e, !0), r.setRequestHeader("Accept", "application/json"), r.onreadystatechange = function() {
|
|
2184
2441
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2185
2442
|
t(JSON.parse(r.responseText));
|
|
2186
2443
|
} catch (e) {
|
|
2187
|
-
n && (
|
|
2444
|
+
n && (ir(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2188
2445
|
}
|
|
2189
2446
|
else n && n(r.status);
|
|
2190
2447
|
var e;
|
|
2191
2448
|
}, r.send();
|
|
2192
2449
|
}
|
|
2193
|
-
function
|
|
2450
|
+
function eo(e, t, n) {
|
|
2194
2451
|
let r = new XMLHttpRequest();
|
|
2195
2452
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
2196
2453
|
4 === r.readyState && n(r.status, r.responseText);
|
|
2197
2454
|
}, r.send(t);
|
|
2198
2455
|
}
|
|
2199
|
-
function
|
|
2200
|
-
void 0 !== n &&
|
|
2456
|
+
function to(e, t, n) {
|
|
2457
|
+
void 0 !== n && Jr(n) || (n = "");
|
|
2201
2458
|
for (let r of Object.keys(e)) {
|
|
2202
2459
|
if (!e.hasOwnProperty(r)) continue;
|
|
2203
2460
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -2206,61 +2463,61 @@ function Ll(e, t, n) {
|
|
|
2206
2463
|
r,
|
|
2207
2464
|
e[r],
|
|
2208
2465
|
n
|
|
2209
|
-
]),
|
|
2466
|
+
]), Yr(e[r]) && to(e[r], t, n), n = n.slice(0, -l.length);
|
|
2210
2467
|
}
|
|
2211
2468
|
}
|
|
2212
|
-
function
|
|
2213
|
-
n && (e =
|
|
2214
|
-
let r =
|
|
2215
|
-
|
|
2216
|
-
let l =
|
|
2217
|
-
return
|
|
2218
|
-
"__" !== t.substring(0, 2) &&
|
|
2469
|
+
function no(e, t, n) {
|
|
2470
|
+
n && (e = jr(e));
|
|
2471
|
+
let r = vl(null, e, "type", [], 1);
|
|
2472
|
+
El(null, e, "hook", "data", 1);
|
|
2473
|
+
let l = vl(null, e, "schema", {}, 1), o = vl(null, e, "topics", {}, 1);
|
|
2474
|
+
return to(l, function(e, t, n, l) {
|
|
2475
|
+
"__" !== t.substring(0, 2) && vl(null, o, l, jr(r), 1);
|
|
2219
2476
|
}, t), e;
|
|
2220
2477
|
}
|
|
2221
|
-
function
|
|
2222
|
-
let l =
|
|
2223
|
-
if (!l) return
|
|
2224
|
-
if (
|
|
2478
|
+
function ro(e, t, n, r) {
|
|
2479
|
+
let l = vl(null, vl(null, e, "topics", null, 0), t, null, 0);
|
|
2480
|
+
if (!l) return ir("jdb_update: topic not found: " + t), null;
|
|
2481
|
+
if (tl(r.id)) return ir("jdb_update: record without id: " + r), _r(r), null;
|
|
2225
2482
|
let o, i = n.split("`"), s = l;
|
|
2226
|
-
for (; (o = i.shift()) && !
|
|
2227
|
-
if (0 === i.length && s) if (
|
|
2483
|
+
for (; (o = i.shift()) && !tl(o) && s;) Yr(s) && (s = vl(null, s, e.hook, [], 1)), s = ao(s, null, o, !1);
|
|
2484
|
+
if (0 === i.length && s) if (Br(s)) s.push(r);
|
|
2228
2485
|
else if (s.id === r.id) Object.assign(s, r);
|
|
2229
2486
|
else {
|
|
2230
|
-
let t =
|
|
2487
|
+
let t = vl(null, s, e.hook, [], 1), n = ao(t, e.hook, r.id, !1);
|
|
2231
2488
|
n ? Object.assign(n, r) : t.push(r);
|
|
2232
2489
|
}
|
|
2233
2490
|
return l;
|
|
2234
2491
|
}
|
|
2235
|
-
function
|
|
2236
|
-
let l =
|
|
2237
|
-
if (!l) return
|
|
2238
|
-
if (
|
|
2492
|
+
function lo(e, t, n, r) {
|
|
2493
|
+
let l = vl(null, vl(null, e, "topics", null, 0), t, null, 0);
|
|
2494
|
+
if (!l) return ir("jdb_delete: topic not found: " + t), null;
|
|
2495
|
+
if (tl(r.id)) return ir("jdb_delete: record without id: " + r), _r(r), null;
|
|
2239
2496
|
let o, i = n.split("`"), s = l;
|
|
2240
|
-
for (; (o = i.shift()) && !
|
|
2241
|
-
if (0 === i.length && s) if (
|
|
2242
|
-
let e =
|
|
2497
|
+
for (; (o = i.shift()) && !tl(o) && s;) Yr(s) && (s = vl(null, s, e.hook, null, 0)), s = ao(s, null, o, !1);
|
|
2498
|
+
if (0 === i.length && s) if (Br(s)) {
|
|
2499
|
+
let e = xl(s, r.id);
|
|
2243
2500
|
e >= 0 && s.splice(e, 1);
|
|
2244
2501
|
} else {
|
|
2245
|
-
let t =
|
|
2502
|
+
let t = vl(null, s, e.hook, null, 0), n = xl(t, r.id);
|
|
2246
2503
|
n >= 0 && t.splice(n, 1);
|
|
2247
2504
|
}
|
|
2248
2505
|
return l;
|
|
2249
2506
|
}
|
|
2250
|
-
function
|
|
2251
|
-
let n =
|
|
2252
|
-
if (!n) return
|
|
2253
|
-
return
|
|
2507
|
+
function oo(e, t) {
|
|
2508
|
+
let n = vl(null, e, "topics", null, 0);
|
|
2509
|
+
if (!n) return ir("jdb topics section not found"), _r(e), null;
|
|
2510
|
+
return vl(null, n, t, null, 0) || (ir("jdb topic not found: " + t), _r(n), null);
|
|
2254
2511
|
}
|
|
2255
|
-
function
|
|
2256
|
-
let l =
|
|
2257
|
-
return l ? (void 0 === r && (r = !0),
|
|
2512
|
+
function io(e, t, n, r) {
|
|
2513
|
+
let l = vl(null, vl(null, e, "topics", null, 0), t, null, 0);
|
|
2514
|
+
return l ? (void 0 === r && (r = !0), ao(l, e.hook, n, r)) : (ir("jdb_get: topic not found: " + t), null);
|
|
2258
2515
|
}
|
|
2259
|
-
function
|
|
2260
|
-
let r =
|
|
2261
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2516
|
+
function so(e, t, n) {
|
|
2517
|
+
let r = vl(null, vl(null, e, "topics", null, 0), t, null, 0);
|
|
2518
|
+
return r ? n < r.length ? r[n] : {} : (ir("jdb_get_by_idx: topic not found: " + t), null);
|
|
2262
2519
|
}
|
|
2263
|
-
function
|
|
2520
|
+
function ao(e, t, n, r) {
|
|
2264
2521
|
if (!e) return null;
|
|
2265
2522
|
let l, o = e.length;
|
|
2266
2523
|
for (l = 0; l < o; l++) {
|
|
@@ -2268,19 +2525,19 @@ function Wl(e, t, n, r) {
|
|
|
2268
2525
|
if (o) {
|
|
2269
2526
|
let e = o.id;
|
|
2270
2527
|
if (e && e === n) return o;
|
|
2271
|
-
if (r &&
|
|
2272
|
-
let e =
|
|
2528
|
+
if (r && cl(o, t)) {
|
|
2529
|
+
let e = ao(o[t], t, n, r);
|
|
2273
2530
|
if (e) return e;
|
|
2274
2531
|
}
|
|
2275
2532
|
}
|
|
2276
2533
|
}
|
|
2277
2534
|
return null;
|
|
2278
2535
|
}
|
|
2279
|
-
function
|
|
2280
|
-
let n =
|
|
2281
|
-
return
|
|
2536
|
+
function uo(e, t) {
|
|
2537
|
+
let n = jr(e);
|
|
2538
|
+
return Ar(n, t), n;
|
|
2282
2539
|
}
|
|
2283
|
-
function
|
|
2540
|
+
function _o(e) {
|
|
2284
2541
|
function t(e) {
|
|
2285
2542
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2286
2543
|
switch (t.length % 4) {
|
|
@@ -2311,9 +2568,9 @@ function xl(e) {
|
|
|
2311
2568
|
signature: t(n[2])
|
|
2312
2569
|
};
|
|
2313
2570
|
}
|
|
2314
|
-
function
|
|
2571
|
+
function co(e, t) {
|
|
2315
2572
|
try {
|
|
2316
|
-
let n =
|
|
2573
|
+
let n = _o(e);
|
|
2317
2574
|
switch (t) {
|
|
2318
2575
|
case "header": return JSON.parse(n.header);
|
|
2319
2576
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2323,38 +2580,38 @@ function Yl(e, t) {
|
|
|
2323
2580
|
return null;
|
|
2324
2581
|
}
|
|
2325
2582
|
}
|
|
2326
|
-
function
|
|
2583
|
+
function fo(e) {
|
|
2327
2584
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2328
2585
|
}
|
|
2329
|
-
function
|
|
2586
|
+
function go(e) {
|
|
2330
2587
|
if (!e) return "";
|
|
2331
2588
|
const t = String(e).trim();
|
|
2332
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
2589
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : fo(t);
|
|
2333
2590
|
}
|
|
2334
|
-
function
|
|
2591
|
+
function bo(e) {
|
|
2335
2592
|
const t = document.createElement("template");
|
|
2336
2593
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2337
2594
|
}
|
|
2338
|
-
function
|
|
2595
|
+
function po(e, t) {
|
|
2339
2596
|
let [n, r, l, o] = e;
|
|
2340
|
-
if (!n) return void
|
|
2597
|
+
if (!n) return void ir("Tag must be a valid HTML element.");
|
|
2341
2598
|
let i = document.createElement(n), s = "";
|
|
2342
2599
|
if (r && "object" == typeof r) for (let e of Object.keys(r)) if ("style" === e && "object" == typeof r[e]) {
|
|
2343
2600
|
let t = "";
|
|
2344
2601
|
for (const n of Object.keys(r[e])) t += `${n}: ${r[e][n]};`;
|
|
2345
2602
|
i.style.cssText = t;
|
|
2346
2603
|
} else "style" === e ? i.style.cssText = r[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== r[e] && void 0 !== r[e] && (s = r[e], i.setAttribute("data-i18n", s)) : i.setAttribute(e, r[e]);
|
|
2347
|
-
if (
|
|
2604
|
+
if (Jr(l)) if (l = l.trim(), l.length > 0 && "<" === l[0]) i.appendChild(bo(l));
|
|
2348
2605
|
else if (t && s) i.textContent = t(s) || l;
|
|
2349
2606
|
else i.textContent = l;
|
|
2350
|
-
else if (
|
|
2351
|
-
if (l.length > 0) if (
|
|
2352
|
-
else for (let e of l) Array.isArray(e) && e.length > 0 ? i.appendChild(
|
|
2353
|
-
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? i.appendChild(l) : null != l && (
|
|
2607
|
+
else if (Br(l)) {
|
|
2608
|
+
if (l.length > 0) if (Jr(l[0])) i.appendChild(po(l, t));
|
|
2609
|
+
else for (let e of l) Array.isArray(e) && e.length > 0 ? i.appendChild(po(e, t)) : e instanceof HTMLElement && i.appendChild(e);
|
|
2610
|
+
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? i.appendChild(l) : null != l && (ir("content ignored"), cr(l));
|
|
2354
2611
|
if (o && "object" == typeof o) for (const e of Object.keys(o)) i.addEventListener(e, o[e]);
|
|
2355
2612
|
return i;
|
|
2356
2613
|
}
|
|
2357
|
-
function
|
|
2614
|
+
function mo(e) {
|
|
2358
2615
|
if (!e) return {
|
|
2359
2616
|
top: 0,
|
|
2360
2617
|
left: 0,
|
|
@@ -2374,11 +2631,11 @@ function Ql(e) {
|
|
|
2374
2631
|
bottom: t + i + l
|
|
2375
2632
|
};
|
|
2376
2633
|
}
|
|
2377
|
-
function
|
|
2634
|
+
function ho(e) {
|
|
2378
2635
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2379
2636
|
}
|
|
2380
|
-
function
|
|
2381
|
-
if (!
|
|
2637
|
+
function Eo(e, t) {
|
|
2638
|
+
if (!Zr(t)) return void ir("You must supply a translation function");
|
|
2382
2639
|
e || (e = document);
|
|
2383
2640
|
const n = (t) => {
|
|
2384
2641
|
let n = [];
|
|
@@ -2401,41 +2658,41 @@ function Xl(e, t) {
|
|
|
2401
2658
|
n && e.setAttribute("placeholder", t(n));
|
|
2402
2659
|
});
|
|
2403
2660
|
}
|
|
2404
|
-
function
|
|
2661
|
+
function To(e = "Time Tracker", t = !1) {
|
|
2405
2662
|
const n = e, r = performance.now();
|
|
2406
2663
|
let l = r;
|
|
2407
|
-
return t &&
|
|
2664
|
+
return t && sr(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
2408
2665
|
const i = performance.now(), s = (i - l) / 1e3, a = (i - r) / 1e3;
|
|
2409
|
-
return t &&
|
|
2666
|
+
return t && sr(`--\x3e ${n} ${e} - partial: ${s} sec, total: ${a} sec, ${o}`), l = i, {
|
|
2410
2667
|
partial: s,
|
|
2411
2668
|
total: a
|
|
2412
2669
|
};
|
|
2413
2670
|
} };
|
|
2414
2671
|
}
|
|
2415
|
-
function
|
|
2672
|
+
function yo(e) {
|
|
2416
2673
|
const t = (e, t) => String(e).padStart(t, "0"), n = `${(e = e || /* @__PURE__ */ new Date()).getFullYear()}-${t(e.getMonth() + 1, 2)}-${t(e.getDate(), 2)}T${t(e.getHours(), 2)}:${t(e.getMinutes(), 2)}:${t(e.getSeconds(), 2)}`, r = t(e.getMilliseconds(), 3), l = e.getTimezoneOffset();
|
|
2417
2674
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
2418
2675
|
}
|
|
2419
|
-
function
|
|
2676
|
+
function vo() {
|
|
2420
2677
|
return Math.floor(Date.now() / 1e3);
|
|
2421
2678
|
}
|
|
2422
|
-
function
|
|
2679
|
+
function Oo(e, t) {
|
|
2423
2680
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2424
2681
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2425
2682
|
return -1;
|
|
2426
2683
|
}
|
|
2427
|
-
function
|
|
2684
|
+
function So() {
|
|
2428
2685
|
let e = "";
|
|
2429
2686
|
return "undefined" != typeof window && window.localStorage ? (e = window.localStorage.getItem("host_uuid"), !e && window.crypto?.randomUUID && (e = window.crypto.randomUUID(), window.localStorage.setItem("host_uuid", e))) : e = "undefined" != typeof globalThis && globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : "00000000-0000-0000-0000-000000000000", e;
|
|
2430
2687
|
}
|
|
2431
|
-
function
|
|
2688
|
+
function No(e) {
|
|
2432
2689
|
return e.replace(/[?# ^:]/g, "_");
|
|
2433
2690
|
}
|
|
2434
|
-
function
|
|
2691
|
+
function wo(e) {
|
|
2435
2692
|
let t = null;
|
|
2436
2693
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2437
2694
|
}
|
|
2438
|
-
function
|
|
2695
|
+
function jo(e, t = 0, n = !1) {
|
|
2439
2696
|
let r = null, l = null, o = null;
|
|
2440
2697
|
const i = (...i) => {
|
|
2441
2698
|
o = this, l = i;
|
|
@@ -2450,20 +2707,20 @@ function io(e, t = 0, n = !1) {
|
|
|
2450
2707
|
clearTimeout(r), r = null, l = null, o = null;
|
|
2451
2708
|
}, i;
|
|
2452
2709
|
}
|
|
2453
|
-
function
|
|
2710
|
+
function Ro(...e) {
|
|
2454
2711
|
let t = "", n = 0;
|
|
2455
2712
|
for (let r of e) null != r && "" !== r && (r = String(r), r = 0 === n ? r.replace(/\/+$/, "") : r.replace(/^\/+/, "").replace(/\/+$/, ""), "" !== r && (n > 0 && (t += "/"), t += r, n++));
|
|
2456
2713
|
return t;
|
|
2457
2714
|
}
|
|
2458
|
-
var
|
|
2459
|
-
function
|
|
2715
|
+
var $o = 256, Do = 1e5;
|
|
2716
|
+
function Ao(e) {
|
|
2460
2717
|
const t = String(e).replace(/`/g, "``");
|
|
2461
2718
|
return "[" === t[0] ? "[" + t : t;
|
|
2462
2719
|
}
|
|
2463
|
-
function
|
|
2464
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
2720
|
+
function Io(e) {
|
|
2721
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Ao(e)).join("`") : "";
|
|
2465
2722
|
}
|
|
2466
|
-
function
|
|
2723
|
+
function ko(e) {
|
|
2467
2724
|
if ("string" != typeof e) return null;
|
|
2468
2725
|
let t = [], n = "";
|
|
2469
2726
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2484,9 +2741,9 @@ function fo(e) {
|
|
|
2484
2741
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2485
2742
|
});
|
|
2486
2743
|
}
|
|
2487
|
-
function
|
|
2744
|
+
function Co(e) {
|
|
2488
2745
|
const t = {}, n = (e, r, l) => {
|
|
2489
|
-
if (l >
|
|
2746
|
+
if (l > $o) throw new Error("json2flat: deeper than 256");
|
|
2490
2747
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
2491
2748
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
2492
2749
|
const o = `[${t}]`;
|
|
@@ -2496,7 +2753,7 @@ function go(e) {
|
|
|
2496
2753
|
const t = Object.keys(e);
|
|
2497
2754
|
if (t.length > 0) {
|
|
2498
2755
|
for (const o of t) {
|
|
2499
|
-
const t =
|
|
2756
|
+
const t = Ao(o);
|
|
2500
2757
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
2501
2758
|
}
|
|
2502
2759
|
return;
|
|
@@ -2506,20 +2763,20 @@ function go(e) {
|
|
|
2506
2763
|
};
|
|
2507
2764
|
return null == e || n(e, "", 0), t;
|
|
2508
2765
|
}
|
|
2509
|
-
function
|
|
2766
|
+
function Lo(e) {
|
|
2510
2767
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2511
2768
|
let t = null;
|
|
2512
2769
|
for (const n of Object.keys(e)) {
|
|
2513
|
-
const r =
|
|
2770
|
+
const r = ko(n);
|
|
2514
2771
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2515
|
-
if (r.length >
|
|
2772
|
+
if (r.length > $o) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2516
2773
|
const l = "number" == typeof r[0];
|
|
2517
2774
|
if (null === t) t = l ? [] : {};
|
|
2518
2775
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2519
2776
|
let o = t;
|
|
2520
2777
|
for (let t = 0; t < r.length; t++) {
|
|
2521
2778
|
const l = r[t], i = "number" == typeof l, s = t === r.length - 1, a = !s && "number" == typeof r[t + 1];
|
|
2522
|
-
if (i && l >
|
|
2779
|
+
if (i && l > Do) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2523
2780
|
if (i !== Array.isArray(o)) throw new Error(`flat2json: '${n}' uses a ${i ? "array index" : "key"} where the tree already has a ${Array.isArray(o) ? "array" : "object"}`);
|
|
2524
2781
|
if (s) {
|
|
2525
2782
|
if (Array.isArray(o)) {
|
|
@@ -2527,7 +2784,7 @@ function bo(e) {
|
|
|
2527
2784
|
o[l] = e[n];
|
|
2528
2785
|
} else {
|
|
2529
2786
|
if (Object.prototype.hasOwnProperty.call(o, l)) throw new Error(`flat2json: '${n}' is written twice, or once as a value and once as a container`);
|
|
2530
|
-
o
|
|
2787
|
+
gl(o, l, e[n]);
|
|
2531
2788
|
}
|
|
2532
2789
|
break;
|
|
2533
2790
|
}
|
|
@@ -2535,7 +2792,7 @@ function bo(e) {
|
|
|
2535
2792
|
if (Array.isArray(o)) {
|
|
2536
2793
|
for (; o.length <= l;) o.push(null);
|
|
2537
2794
|
u = o[l], null == u && (u = a ? [] : {}, o[l] = u);
|
|
2538
|
-
} else u = o[l], void 0 === u && (u = a ? [] : {}, o
|
|
2795
|
+
} else u = fl(o, l) ? void 0 : o[l], void 0 === u && (u = a ? [] : {}, gl(o, l, u));
|
|
2539
2796
|
if (null === u || "object" != typeof u) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
2540
2797
|
if (a !== Array.isArray(u)) throw new Error(`flat2json: '${n}' needs a ${a ? "array" : "object"} where the tree already has a ${Array.isArray(u) ? "array" : "object"}`);
|
|
2541
2798
|
o = u;
|
|
@@ -2543,23 +2800,23 @@ function bo(e) {
|
|
|
2543
2800
|
}
|
|
2544
2801
|
return null === t ? {} : t;
|
|
2545
2802
|
}
|
|
2546
|
-
function
|
|
2803
|
+
function Po(e, t) {
|
|
2547
2804
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2548
2805
|
}
|
|
2549
|
-
function
|
|
2806
|
+
function Uo(e, t) {
|
|
2550
2807
|
const n = e && "object" == typeof e ? e : {}, r = t && "object" == typeof t ? t : {}, l = {
|
|
2551
2808
|
added: {},
|
|
2552
2809
|
removed: {},
|
|
2553
2810
|
changed: {}
|
|
2554
2811
|
};
|
|
2555
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2812
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? Po(n[e], r[e]) || (l.changed[e] = {
|
|
2556
2813
|
from: n[e],
|
|
2557
2814
|
to: r[e]
|
|
2558
2815
|
}) : l.removed[e] = n[e];
|
|
2559
2816
|
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (l.added[e] = r[e]);
|
|
2560
2817
|
return l;
|
|
2561
2818
|
}
|
|
2562
|
-
function
|
|
2819
|
+
function Fo(e, t) {
|
|
2563
2820
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2564
2821
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2565
2822
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
@@ -2571,40 +2828,40 @@ function Eo(e, t) {
|
|
|
2571
2828
|
}
|
|
2572
2829
|
return e;
|
|
2573
2830
|
}
|
|
2574
|
-
function
|
|
2575
|
-
return "persistent-attrs-" +
|
|
2831
|
+
function Vo(e) {
|
|
2832
|
+
return "persistent-attrs-" + $t(e);
|
|
2576
2833
|
}
|
|
2577
|
-
function
|
|
2578
|
-
let n = Xt(e, v.SDF_PERSIST), r =
|
|
2579
|
-
if (r &&
|
|
2580
|
-
let l =
|
|
2581
|
-
l =
|
|
2834
|
+
function Go(e, t) {
|
|
2835
|
+
let n = Xt(e, v.SDF_PERSIST), r = kl(Vo(e), null, !1);
|
|
2836
|
+
if (r && Yr(r)) {
|
|
2837
|
+
let l = Al(e, r, t, !1);
|
|
2838
|
+
l = Al(e, l, n, !1), on(e, l, v.SDF_PERSIST);
|
|
2582
2839
|
}
|
|
2583
2840
|
}
|
|
2584
|
-
function
|
|
2585
|
-
let n =
|
|
2586
|
-
return r &&
|
|
2841
|
+
function Mo(e, t) {
|
|
2842
|
+
let n = Al(e, Xt(e, v.SDF_PERSIST), t, !1), r = kl(Vo(e), null, !1);
|
|
2843
|
+
return r && Yr(r) && Ir(n, r), Cl(Vo(e), n);
|
|
2587
2844
|
}
|
|
2588
|
-
function
|
|
2589
|
-
let n =
|
|
2590
|
-
0 ===
|
|
2845
|
+
function Wo(e, t) {
|
|
2846
|
+
let n = Il(e, kl(Vo(e), null, !1), t, !1);
|
|
2847
|
+
0 === Mr(n) ? Ll(Vo(e)) : Cl(Vo(e), n);
|
|
2591
2848
|
}
|
|
2592
|
-
function
|
|
2593
|
-
let n =
|
|
2594
|
-
return n &&
|
|
2849
|
+
function xo(e, t) {
|
|
2850
|
+
let n = kl(Vo(e), null, !1), r = {};
|
|
2851
|
+
return n && Yr(n) && (r = Al(e, n, t, !1)), r;
|
|
2595
2852
|
}
|
|
2596
|
-
function
|
|
2597
|
-
if (
|
|
2853
|
+
function Ko(e) {
|
|
2854
|
+
if (Br(e) && 1 === xr(e)) {
|
|
2598
2855
|
let t = e[0];
|
|
2599
|
-
return
|
|
2856
|
+
return cl(t, "size") ? t.size : 1;
|
|
2600
2857
|
}
|
|
2601
|
-
return
|
|
2858
|
+
return xr(e);
|
|
2602
2859
|
}
|
|
2603
|
-
function
|
|
2604
|
-
if (
|
|
2860
|
+
function Yo(e, t) {
|
|
2861
|
+
if (Jr(t)) {
|
|
2605
2862
|
if (-1 === t.indexOf("^")) {
|
|
2606
2863
|
let n, r, l = e.fkey;
|
|
2607
|
-
if (1 !==
|
|
2864
|
+
if (1 !== Mr(l)) return ir("bad fkey 1"), ir(e), ir(t), null;
|
|
2608
2865
|
for (const e of Object.keys(l)) {
|
|
2609
2866
|
n = e, r = l[e];
|
|
2610
2867
|
break;
|
|
@@ -2617,28 +2874,28 @@ function No(e, t) {
|
|
|
2617
2874
|
}
|
|
2618
2875
|
{
|
|
2619
2876
|
let n = t.split("^");
|
|
2620
|
-
return 3 !== n.length ? (
|
|
2877
|
+
return 3 !== n.length ? (ir("bad fkey 2"), ir(e), ir(t), null) : {
|
|
2621
2878
|
topic_name: n[0],
|
|
2622
2879
|
id: n[1],
|
|
2623
2880
|
hook_name: n[2]
|
|
2624
2881
|
};
|
|
2625
2882
|
}
|
|
2626
2883
|
}
|
|
2627
|
-
return
|
|
2884
|
+
return Yr(t) ? {
|
|
2628
2885
|
topic_name: t.topic_name,
|
|
2629
2886
|
id: t.id,
|
|
2630
2887
|
hook_name: t.hook_name
|
|
2631
|
-
} : (
|
|
2888
|
+
} : (ir("bad fkey 3"), ir(e), ir(t), null);
|
|
2632
2889
|
}
|
|
2633
|
-
function
|
|
2634
|
-
let n =
|
|
2890
|
+
function Bo(e, t) {
|
|
2891
|
+
let n = Yo(e, t);
|
|
2635
2892
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
2636
2893
|
}
|
|
2637
|
-
function
|
|
2638
|
-
if (
|
|
2894
|
+
function Jo(e, t) {
|
|
2895
|
+
if (Jr(t)) {
|
|
2639
2896
|
if (-1 === t.indexOf("^")) {
|
|
2640
2897
|
let n, r = e.hook;
|
|
2641
|
-
if (1 !==
|
|
2898
|
+
if (1 !== Mr(r)) return ir("bad hook 1"), ir(e), ir(t), null;
|
|
2642
2899
|
for (let e of Object.keys(r)) {
|
|
2643
2900
|
n = e, r[e];
|
|
2644
2901
|
break;
|
|
@@ -2650,18 +2907,18 @@ function jo(e, t) {
|
|
|
2650
2907
|
}
|
|
2651
2908
|
{
|
|
2652
2909
|
let n = t.split("^");
|
|
2653
|
-
return 2 !== n.length ? (
|
|
2910
|
+
return 2 !== n.length ? (ir("bad hook 2"), ir(e), ir(t), null) : {
|
|
2654
2911
|
topic_name: n[0],
|
|
2655
2912
|
id: n[1]
|
|
2656
2913
|
};
|
|
2657
2914
|
}
|
|
2658
2915
|
}
|
|
2659
|
-
return
|
|
2916
|
+
return Yr(t) ? {
|
|
2660
2917
|
topic_name: t.topic_name,
|
|
2661
2918
|
id: t.id
|
|
2662
|
-
} : (
|
|
2919
|
+
} : (ir("bad hook 3"), ir(e), ir(t), null);
|
|
2663
2920
|
}
|
|
2664
|
-
var
|
|
2921
|
+
var qo = [
|
|
2665
2922
|
"string",
|
|
2666
2923
|
"integer",
|
|
2667
2924
|
"object",
|
|
@@ -2671,7 +2928,7 @@ var wo = [
|
|
|
2671
2928
|
"real",
|
|
2672
2929
|
"boolean",
|
|
2673
2930
|
"blob"
|
|
2674
|
-
],
|
|
2931
|
+
], Ho = [
|
|
2675
2932
|
"persistent",
|
|
2676
2933
|
"required",
|
|
2677
2934
|
"notnull",
|
|
@@ -2683,7 +2940,7 @@ var wo = [
|
|
|
2683
2940
|
"stats",
|
|
2684
2941
|
"rstats",
|
|
2685
2942
|
"pstats"
|
|
2686
|
-
],
|
|
2943
|
+
], Qo = [
|
|
2687
2944
|
"hook",
|
|
2688
2945
|
"fkey",
|
|
2689
2946
|
"enum",
|
|
@@ -2712,7 +2969,7 @@ var wo = [
|
|
|
2712
2969
|
"coordinates",
|
|
2713
2970
|
"gbuffer"
|
|
2714
2971
|
];
|
|
2715
|
-
function
|
|
2972
|
+
function zo(e) {
|
|
2716
2973
|
let t = {
|
|
2717
2974
|
name: e.id,
|
|
2718
2975
|
header: e.header,
|
|
@@ -2731,7 +2988,7 @@ function Ao(e) {
|
|
|
2731
2988
|
if (!e.flag) return t;
|
|
2732
2989
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2733
2990
|
let r = e.flag[n];
|
|
2734
|
-
if (
|
|
2991
|
+
if (Kl(Qo, r)) {
|
|
2735
2992
|
switch (r) {
|
|
2736
2993
|
case "enum":
|
|
2737
2994
|
t.enum_list = e.enum;
|
|
@@ -2745,7 +3002,7 @@ function Ao(e) {
|
|
|
2745
3002
|
case "file": t.is_file = !0;
|
|
2746
3003
|
}
|
|
2747
3004
|
t.type = r;
|
|
2748
|
-
} else if (
|
|
3005
|
+
} else if (Kl(Ho, r)) switch (r) {
|
|
2749
3006
|
case "writable":
|
|
2750
3007
|
t.is_writable = !0;
|
|
2751
3008
|
break;
|
|
@@ -2758,7 +3015,7 @@ function Ao(e) {
|
|
|
2758
3015
|
}
|
|
2759
3016
|
return t.is_file && (t.type = "file"), t;
|
|
2760
3017
|
}
|
|
2761
|
-
function
|
|
3018
|
+
function Xo(e, t) {
|
|
2762
3019
|
let n = {
|
|
2763
3020
|
name: e,
|
|
2764
3021
|
header: e,
|
|
@@ -2772,13 +3029,13 @@ function Io(e, t) {
|
|
|
2772
3029
|
placeholder: void 0,
|
|
2773
3030
|
fkey: null
|
|
2774
3031
|
};
|
|
2775
|
-
if (
|
|
3032
|
+
if (Jr(t)) {
|
|
2776
3033
|
let e = t.split(".");
|
|
2777
3034
|
for (let t = 0; t < e.length; t++) {
|
|
2778
3035
|
let r = e[t];
|
|
2779
|
-
if (
|
|
2780
|
-
else if (
|
|
2781
|
-
else if (
|
|
3036
|
+
if (Kl(qo, r)) n.real_type || (n.real_type = r);
|
|
3037
|
+
else if (Kl(Qo, r)) n.type || (n.type = r);
|
|
3038
|
+
else if (Kl(Ho, r)) switch (r) {
|
|
2782
3039
|
case "writable":
|
|
2783
3040
|
n.is_writable = !0;
|
|
2784
3041
|
break;
|
|
@@ -2790,39 +3047,39 @@ function Io(e, t) {
|
|
|
2790
3047
|
}
|
|
2791
3048
|
}
|
|
2792
3049
|
n.real_type || (n.real_type = "string");
|
|
2793
|
-
} else
|
|
3050
|
+
} else Yr(t) ? (n = zo(t), n.name || (n.name = e), n.header || (n.header = e)) : Br(t) && (n.real_type = "array", n.enum_list = t);
|
|
2794
3051
|
return n.type || (n.type = n.real_type), n;
|
|
2795
3052
|
}
|
|
2796
|
-
function
|
|
3053
|
+
function Zo(e, t) {
|
|
2797
3054
|
let n = {};
|
|
2798
3055
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2799
3056
|
let l;
|
|
2800
|
-
|
|
2801
|
-
let o =
|
|
3057
|
+
Yr(r) && (l = r.default);
|
|
3058
|
+
let o = vl(null, t, e, l);
|
|
2802
3059
|
n[e] = o;
|
|
2803
3060
|
}), n;
|
|
2804
3061
|
}
|
|
2805
|
-
var
|
|
3062
|
+
var ei = [
|
|
2806
3063
|
N(y.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2807
3064
|
N(y.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2808
3065
|
N(y.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2809
|
-
|
|
2810
|
-
],
|
|
3066
|
+
S()
|
|
3067
|
+
], ti = {
|
|
2811
3068
|
periodic: !1,
|
|
2812
3069
|
msec: 0,
|
|
2813
3070
|
timer_id: -1
|
|
2814
|
-
},
|
|
2815
|
-
function
|
|
3071
|
+
}, ni = null;
|
|
3072
|
+
function ri(e, t, n, r) {
|
|
2816
3073
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2817
3074
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2818
3075
|
yn(e, "EV_TIMEOUT", {}, e);
|
|
2819
|
-
}, l.msec) : l.timer_id = -1, kt(e) ? yn(At(e), o, {}, e) :
|
|
3076
|
+
}, l.msec) : l.timer_id = -1, kt(e) ? yn(At(e), o, {}, e) : Pn(e, o, {}), l.periodic || -1 !== l.timer_id || Et(e) && gt(e), 0;
|
|
2820
3077
|
}
|
|
2821
|
-
var
|
|
3078
|
+
var li = {
|
|
2822
3079
|
mt_create: function(e) {
|
|
2823
3080
|
let t = e.priv;
|
|
2824
3081
|
const n = nn(e, "subscriber");
|
|
2825
|
-
n &&
|
|
3082
|
+
n && Dn(e, null, {}, n), t.periodic = Zt(e, "periodic"), t.msec = en(e, "msec");
|
|
2826
3083
|
},
|
|
2827
3084
|
mt_writing: function(e, t) {
|
|
2828
3085
|
let n = e.priv;
|
|
@@ -2832,7 +3089,7 @@ var Fo = {
|
|
|
2832
3089
|
break;
|
|
2833
3090
|
case "msec": n.msec = en(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
2834
3091
|
yn(e, "EV_TIMEOUT", {}, e);
|
|
2835
|
-
}, n.msec)), n.msec > 0 ?
|
|
3092
|
+
}, n.msec)), n.msec > 0 ? Et(e) || at(e) : Et(e) && gt(e);
|
|
2836
3093
|
}
|
|
2837
3094
|
},
|
|
2838
3095
|
mt_start: function(e) {
|
|
@@ -2843,31 +3100,31 @@ var Fo = {
|
|
|
2843
3100
|
},
|
|
2844
3101
|
mt_destroy: function(e) {}
|
|
2845
3102
|
};
|
|
2846
|
-
function
|
|
3103
|
+
function oi() {
|
|
2847
3104
|
return function(e) {
|
|
2848
|
-
if (
|
|
3105
|
+
if (ni) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
2849
3106
|
const t = [["ST_IDLE", [[
|
|
2850
3107
|
"EV_TIMEOUT",
|
|
2851
|
-
|
|
3108
|
+
ri,
|
|
2852
3109
|
null
|
|
2853
3110
|
]]]];
|
|
2854
|
-
return (
|
|
2855
|
-
["EV_TIMEOUT",
|
|
2856
|
-
["EV_TIMEOUT_PERIODIC",
|
|
3111
|
+
return (ni = Ae(e, [
|
|
3112
|
+
["EV_TIMEOUT", U.EVF_OUTPUT_EVENT],
|
|
3113
|
+
["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT],
|
|
2857
3114
|
[0, 0]
|
|
2858
|
-
], t,
|
|
3115
|
+
], t, li, 0, ei, ti, 0, 0, 0, C.gcflag_manual_start)) ? 0 : -1;
|
|
2859
3116
|
}("C_TIMER");
|
|
2860
3117
|
}
|
|
2861
|
-
function
|
|
2862
|
-
return e instanceof k ? "C_TIMER" !==
|
|
3118
|
+
function ii(e, t) {
|
|
3119
|
+
return e instanceof k ? "C_TIMER" !== Rt(e) ? (ir("not C_TIMER GObj"), -1) : (sn(e, "periodic", !1), void an(e, "msec", t)) : (ir("not GObj TYPE"), -1);
|
|
2863
3120
|
}
|
|
2864
|
-
function
|
|
2865
|
-
return e instanceof k ? "C_TIMER" !==
|
|
3121
|
+
function si(e, t) {
|
|
3122
|
+
return e instanceof k ? "C_TIMER" !== Rt(e) ? (ir("not C_TIMER GObj"), -1) : (sn(e, "periodic", !0), void an(e, "msec", t)) : (ir("not GObj TYPE"), -1);
|
|
2866
3123
|
}
|
|
2867
|
-
function
|
|
2868
|
-
return e instanceof k ? "C_TIMER" !==
|
|
3124
|
+
function ai(e) {
|
|
3125
|
+
return e instanceof k ? "C_TIMER" !== Rt(e) ? (ir("not C_TIMER GObj"), -1) : void an(e, "msec", -1) : (ir("not GObj TYPE"), -1);
|
|
2869
3126
|
}
|
|
2870
|
-
var
|
|
3127
|
+
var ui = [
|
|
2871
3128
|
N(y.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2872
3129
|
N(y.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2873
3130
|
N(y.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2886,72 +3143,73 @@ var Ko = [
|
|
|
2886
3143
|
N(y.DTP_POINTER, "trace_ievent_callback", 0, null, "Where the traffic trace goes (C_IEVENT_CLI levels ievents/ievents2); console when null"),
|
|
2887
3144
|
N(y.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2888
3145
|
N(y.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2889
|
-
|
|
2890
|
-
],
|
|
2891
|
-
function
|
|
3146
|
+
S()
|
|
3147
|
+
], _i = { gobj_timer: null }, ci = null;
|
|
3148
|
+
function fi(e, t, n, r) {
|
|
2892
3149
|
let l = zt(e, t);
|
|
2893
|
-
return
|
|
3150
|
+
return Yr(l) || (l = {}), l[n] = r, rn(e, t, l), He(e, t);
|
|
2894
3151
|
}
|
|
2895
|
-
function
|
|
3152
|
+
function gi(e) {
|
|
2896
3153
|
if (!0 === e || !1 === e) return e;
|
|
2897
3154
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
2898
3155
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
2899
3156
|
}
|
|
2900
|
-
function
|
|
2901
|
-
return `${Nt()}^${
|
|
3157
|
+
function di() {
|
|
3158
|
+
return `${Nt()}^${St()}`;
|
|
2902
3159
|
}
|
|
2903
|
-
function
|
|
2904
|
-
return
|
|
3160
|
+
function bi(e, t, n, r) {
|
|
3161
|
+
return Pn(e, t, n), 0;
|
|
2905
3162
|
}
|
|
2906
|
-
var
|
|
3163
|
+
var pi = {
|
|
2907
3164
|
mt_create: function(e) {
|
|
2908
3165
|
let t = e.priv;
|
|
2909
|
-
un(e, "start_date",
|
|
3166
|
+
un(e, "start_date", yo()), un(e, "node_uuid", So()), e.priv.gobj_timer = ot(jt(e), "C_TIMER", {}, e), t.periodic_timeout = zt(e, "periodic_timeout"), function(e) {
|
|
2910
3167
|
let t = zt(e, "trace_levels");
|
|
2911
|
-
if (!
|
|
3168
|
+
if (!Yr(t)) return 0;
|
|
2912
3169
|
let n = t.__global_trace__;
|
|
2913
|
-
if (
|
|
3170
|
+
if (Br(n)) {
|
|
2914
3171
|
ce(4294967295, !1);
|
|
2915
3172
|
for (let e of n) se(e, !0);
|
|
2916
3173
|
}
|
|
2917
3174
|
for (const [n, r] of Object.entries(t)) {
|
|
2918
3175
|
let t = Me(n);
|
|
2919
|
-
if (t) if (
|
|
2920
|
-
|
|
2921
|
-
for (let e of r)
|
|
2922
|
-
} else
|
|
3176
|
+
if (t) if (Br(r)) {
|
|
3177
|
+
Ee(t, null, !1);
|
|
3178
|
+
for (let e of r) Ee(t, e, !0);
|
|
3179
|
+
} else ir(`${jt(e)}: trace_levels of ${n} MUST be a list`);
|
|
2923
3180
|
}
|
|
2924
3181
|
}(e), function(e) {
|
|
2925
3182
|
let t = zt(e, "no_trace_levels");
|
|
2926
|
-
if (!
|
|
3183
|
+
if (!Yr(t)) return 0;
|
|
2927
3184
|
let n = t.__global_no_trace__;
|
|
2928
|
-
if (
|
|
3185
|
+
if (Br(n)) {
|
|
2929
3186
|
fe(4294967295, !1);
|
|
2930
3187
|
for (let e of n) ae(e, !0);
|
|
2931
3188
|
}
|
|
2932
3189
|
for (const [n, r] of Object.entries(t)) {
|
|
2933
3190
|
let t = Me(n);
|
|
2934
|
-
if (t) if (
|
|
3191
|
+
if (t) if (Br(r)) {
|
|
2935
3192
|
ye(t, null, !1);
|
|
2936
3193
|
for (let e of r) ye(t, e, !0);
|
|
2937
|
-
} else
|
|
3194
|
+
} else ir(`${jt(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2938
3195
|
}
|
|
2939
3196
|
}(e);
|
|
2940
3197
|
},
|
|
2941
3198
|
mt_writing: function(e, t) {},
|
|
2942
3199
|
mt_start: function(e) {
|
|
2943
|
-
return
|
|
3200
|
+
return si(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2944
3201
|
},
|
|
2945
3202
|
mt_stop: function(e) {
|
|
2946
|
-
return
|
|
3203
|
+
return ai(e.priv.gobj_timer), bt(e), 0;
|
|
2947
3204
|
},
|
|
2948
3205
|
mt_destroy: function(e) {},
|
|
2949
3206
|
mt_play: function(e) {
|
|
2950
|
-
let t =
|
|
2951
|
-
return
|
|
3207
|
+
let t = xe();
|
|
3208
|
+
return t ? (Et(t) || at(t), vt(t) || mt(t), 0) : 0;
|
|
2952
3209
|
},
|
|
2953
3210
|
mt_pause: function(e) {
|
|
2954
|
-
|
|
3211
|
+
let t = xe();
|
|
3212
|
+
return t && vt(t) && ht(t), 0;
|
|
2955
3213
|
},
|
|
2956
3214
|
mt_command_parser: function(e, t, n, r) {
|
|
2957
3215
|
switch (n = n || {}, t) {
|
|
@@ -2959,35 +3217,35 @@ var Qo = {
|
|
|
2959
3217
|
case "get-global-no-trace": return o(0, 0, null, null, de());
|
|
2960
3218
|
case "set-global-trace":
|
|
2961
3219
|
case "set-global-no-trace": {
|
|
2962
|
-
let r = "set-global-no-trace" === t, l = n.level, i =
|
|
2963
|
-
return l ? null === i ? o(0, -1, `${
|
|
3220
|
+
let r = "set-global-no-trace" === t, l = n.level, i = gi(n.set);
|
|
3221
|
+
return l ? null === i ? o(0, -1, `${di()}: bitmask set or re-set?`, null, null) : (r ? ae(l, i) : se(l, i)) < 0 ? o(0, -1, `${di()}: global trace level not found: ${l}`, null, null) : r ? (fi(e, "no_trace_levels", "__global_no_trace__", de()), o(0, 0, null, null, de())) : (fi(e, "trace_levels", "__global_trace__", ge()), o(0, 0, null, null, ge())) : o(0, -1, `${di()}: what level?`, null, null);
|
|
2964
3222
|
}
|
|
2965
3223
|
case "get-gclass-trace":
|
|
2966
3224
|
case "get-gclass-no-trace":
|
|
2967
3225
|
case "set-gclass-trace":
|
|
2968
3226
|
case "set-gclass-no-trace": {
|
|
2969
3227
|
let r = t.indexOf("no-trace") >= 0, l = n.gclass_name || n.gclass || "", i = Me(l);
|
|
2970
|
-
if (!i) return o(0, -1, `${
|
|
3228
|
+
if (!i) return o(0, -1, `${di()}: what gclass is '${l}'?`, null, null);
|
|
2971
3229
|
if (0 === t.indexOf("get-")) return o(0, 0, null, null, r ? me(i) : be(i));
|
|
2972
|
-
let s = n.level, a =
|
|
2973
|
-
return s ? null === a ? o(0, -1, `${
|
|
3230
|
+
let s = n.level, a = gi(n.set);
|
|
3231
|
+
return s ? null === a ? o(0, -1, `${di()}: bitmask set or re-set?`, null, null) : (r ? ye(i, s, a) : Ee(i, s, a)) < 0 ? o(0, -1, `${di()}: trace level of ${l} not found: ${s}`, null, null) : r ? (fi(e, "no_trace_levels", l, me(i)), o(0, 0, null, null, me(i))) : (fi(e, "trace_levels", l, pe(i)), o(0, 0, null, null, be(i))) : o(0, -1, `${di()}: what level?`, null, null);
|
|
2974
3232
|
}
|
|
2975
|
-
default: return o(0, -1, `${
|
|
3233
|
+
default: return o(0, -1, `${di()}: command not available: ${t}`, null, null);
|
|
2976
3234
|
}
|
|
2977
3235
|
}
|
|
2978
3236
|
};
|
|
2979
|
-
function
|
|
3237
|
+
function mi() {
|
|
2980
3238
|
return function(e) {
|
|
2981
|
-
if (
|
|
3239
|
+
if (ci) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
2982
3240
|
const t = [["ST_IDLE", [[
|
|
2983
3241
|
"EV_TIMEOUT_PERIODIC",
|
|
2984
|
-
|
|
3242
|
+
bi,
|
|
2985
3243
|
null
|
|
2986
3244
|
]]]];
|
|
2987
|
-
return (
|
|
3245
|
+
return (ci = Ae(e, [["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS], [0, 0]], t, pi, 0, ui, _i, 0, 0, 0, 0)) ? 0 : -1;
|
|
2988
3246
|
}("C_YUNO");
|
|
2989
3247
|
}
|
|
2990
|
-
var
|
|
3248
|
+
var hi = "ievent_gate_stack", Ei = [
|
|
2991
3249
|
N(y.DTP_STRING, "wanted_yuno_role", v.SDF_RD, "", "wanted yuno role"),
|
|
2992
3250
|
N(y.DTP_STRING, "wanted_yuno_name", v.SDF_RD, "", "wanted yuno name"),
|
|
2993
3251
|
N(y.DTP_STRING, "wanted_yuno_service", v.SDF_RD, "", "wanted yuno service"),
|
|
@@ -3003,16 +3261,16 @@ var Xo = "ievent_gate_stack", Zo = [
|
|
|
3003
3261
|
N(y.DTP_INTEGER, "timeout_retry_max", v.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
3004
3262
|
N(y.DTP_INTEGER, "timeout_idack", v.SDF_RD, "5000", "timeout waiting idAck"),
|
|
3005
3263
|
N(y.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
3006
|
-
|
|
3007
|
-
],
|
|
3264
|
+
S()
|
|
3265
|
+
], Ti = [
|
|
3008
3266
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
3009
3267
|
["ievents2", "Trace inter-events with full kw"],
|
|
3010
3268
|
["identity-card", "Trace identity_card messages"]
|
|
3011
3269
|
];
|
|
3012
|
-
function
|
|
3270
|
+
function yi(e) {
|
|
3013
3271
|
return !!(3 & Z(e));
|
|
3014
3272
|
}
|
|
3015
|
-
var
|
|
3273
|
+
var vi = {
|
|
3016
3274
|
url: null,
|
|
3017
3275
|
remote_yuno_name: null,
|
|
3018
3276
|
remote_yuno_role: null,
|
|
@@ -3022,91 +3280,99 @@ var ni = {
|
|
|
3022
3280
|
websocket: null,
|
|
3023
3281
|
inside_on_open: !1,
|
|
3024
3282
|
retry_ms: 0
|
|
3025
|
-
},
|
|
3026
|
-
function
|
|
3027
|
-
e.priv.websocket &&
|
|
3283
|
+
}, Oi = null;
|
|
3284
|
+
function Si(e) {
|
|
3285
|
+
e.priv.websocket && ir("Websocket ALREADY setup");
|
|
3028
3286
|
const t = tn(e, "url");
|
|
3029
3287
|
let n;
|
|
3030
|
-
|
|
3288
|
+
ur(`====> Starting WebSocket to '${t}' (${$t(e)})`);
|
|
3031
3289
|
try {
|
|
3032
3290
|
n = new WebSocket(t);
|
|
3033
3291
|
} catch (n) {
|
|
3034
|
-
return
|
|
3292
|
+
return ir(`${$t(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
3035
3293
|
}
|
|
3036
|
-
|
|
3037
|
-
|
|
3294
|
+
if (!n) return ir(`${$t(e)}: Failed to initialize WebSocket.`), null;
|
|
3295
|
+
const r = ++e.priv.ws_seq;
|
|
3296
|
+
return n.onopen = () => {
|
|
3297
|
+
r !== e.priv.ws_seq || Ct(e) || yn(e, "EV_ON_OPEN", {
|
|
3298
|
+
url: t,
|
|
3299
|
+
ws_seq: r
|
|
3300
|
+
}, e);
|
|
3038
3301
|
}, n.onmessage = (n) => {
|
|
3039
|
-
yn(e, "EV_ON_MESSAGE", {
|
|
3302
|
+
r !== e.priv.ws_seq || Ct(e) || yn(e, "EV_ON_MESSAGE", {
|
|
3040
3303
|
url: t,
|
|
3041
3304
|
data: n.data
|
|
3042
3305
|
}, e);
|
|
3043
3306
|
}, n.onclose = (n) => {
|
|
3044
|
-
Ct(e) || (Zt(
|
|
3307
|
+
Ct(e) || r === e.priv.ws_seq && (Zt(Ot(), "browser_beforeunload") ? sr("Close websocket by unload page") : yn(e, "EV_ON_CLOSE", {
|
|
3045
3308
|
url: t,
|
|
3046
|
-
|
|
3309
|
+
ws_seq: r,
|
|
3310
|
+
code: n.code,
|
|
3311
|
+
reason: n.reason,
|
|
3312
|
+
was_clean: n.wasClean
|
|
3047
3313
|
}, e));
|
|
3048
|
-
}, n
|
|
3314
|
+
}, n;
|
|
3049
3315
|
}
|
|
3050
|
-
function
|
|
3316
|
+
function Ni(e, t = 1e3, n = "") {
|
|
3051
3317
|
let r = e.priv, l = r.websocket;
|
|
3052
3318
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
3053
|
-
|
|
3319
|
+
ur(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
3054
3320
|
try {
|
|
3055
3321
|
l.close(t, n);
|
|
3056
|
-
} catch (
|
|
3057
|
-
|
|
3322
|
+
} catch (t) {
|
|
3323
|
+
ir(`${$t(e)}: Error closing WebSocket: ${t.message}`);
|
|
3058
3324
|
}
|
|
3059
|
-
} else
|
|
3325
|
+
} else sr("WebSocket is already closed or in the process of closing.");
|
|
3060
3326
|
}
|
|
3061
|
-
function
|
|
3062
|
-
let r =
|
|
3327
|
+
function wi(e, t, n) {
|
|
3328
|
+
let r = yo();
|
|
3063
3329
|
try {
|
|
3064
|
-
|
|
3330
|
+
ur("\n" + r + " " + t + "\n"), wr(n);
|
|
3065
3331
|
} catch (e) {
|
|
3066
|
-
|
|
3332
|
+
ur("ERROR in trace_inter_event: " + e);
|
|
3067
3333
|
}
|
|
3068
3334
|
}
|
|
3069
|
-
var
|
|
3335
|
+
var ji = class {
|
|
3070
3336
|
constructor(e, t) {
|
|
3071
3337
|
this.event = e, this.kw = t || {};
|
|
3072
3338
|
}
|
|
3073
3339
|
};
|
|
3074
|
-
function
|
|
3340
|
+
function Ri(e, t, n, r) {
|
|
3075
3341
|
return function(e, t) {
|
|
3076
3342
|
let n = e.priv, r = JSON.stringify(t);
|
|
3077
|
-
if (
|
|
3078
|
-
let n = tn(e, "url"), l = jt(
|
|
3079
|
-
o ? o(l, t, 1, r.length) :
|
|
3343
|
+
if (yi(e)) {
|
|
3344
|
+
let n = tn(e, "url"), l = jt(Ot()) + " ==> " + n, o = zt(Ot(), "trace_ievent_callback");
|
|
3345
|
+
o ? o(l, t, 1, r.length) : wi(0, l, t);
|
|
3080
3346
|
}
|
|
3081
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
3347
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return sr(`${$t(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
3082
3348
|
try {
|
|
3083
3349
|
n.websocket.send(r);
|
|
3084
3350
|
} catch (t) {
|
|
3085
|
-
|
|
3351
|
+
ir(`${$t(e)}: send_iev(): ${t}`);
|
|
3086
3352
|
}
|
|
3087
3353
|
return 0;
|
|
3088
3354
|
}(e, function(e, t) {
|
|
3089
|
-
return
|
|
3355
|
+
return tl(e) ? (ir("iev_create() event NULL"), null) : new ji(e, t);
|
|
3090
3356
|
}(t, n));
|
|
3091
3357
|
}
|
|
3092
|
-
function
|
|
3093
|
-
return
|
|
3358
|
+
function $i(e, t, n) {
|
|
3359
|
+
return tl(n) && (n = tn(e, "wanted_yuno_service")), {
|
|
3094
3360
|
dst_yuno: tn(e, "wanted_yuno_name"),
|
|
3095
3361
|
dst_role: tn(e, "wanted_yuno_role"),
|
|
3096
3362
|
dst_service: n,
|
|
3097
|
-
src_yuno:
|
|
3363
|
+
src_yuno: St(),
|
|
3098
3364
|
src_role: Nt(),
|
|
3099
3365
|
src_service: t,
|
|
3100
|
-
host:
|
|
3366
|
+
host: So()
|
|
3101
3367
|
};
|
|
3102
3368
|
}
|
|
3103
|
-
function
|
|
3104
|
-
let t = e.priv, n = vt(
|
|
3105
|
-
i && i.length || (i = zt(
|
|
3369
|
+
function Di(e) {
|
|
3370
|
+
let t = e.priv, n = vt(Ot()), r = tn(Ot(), "yuno_version"), l = tn(Ot(), "yuno_release"), o = tn(Ot(), "yuno_tag"), i = zt(e, "required_services");
|
|
3371
|
+
i && i.length || (i = zt(Ot(), "required_services"));
|
|
3106
3372
|
let s = {
|
|
3107
3373
|
yuno_role: Nt(),
|
|
3108
|
-
yuno_id:
|
|
3109
|
-
yuno_name:
|
|
3374
|
+
yuno_id: wt(),
|
|
3375
|
+
yuno_name: St(),
|
|
3110
3376
|
yuno_tag: o,
|
|
3111
3377
|
yuno_version: r,
|
|
3112
3378
|
yuno_release: l,
|
|
@@ -3115,45 +3381,45 @@ function _i(e) {
|
|
|
3115
3381
|
pid: 0,
|
|
3116
3382
|
watcher_pid: 0,
|
|
3117
3383
|
jwt: tn(e, "jwt"),
|
|
3118
|
-
username: tn(
|
|
3384
|
+
username: tn(Ot(), "__username__"),
|
|
3119
3385
|
launch_id: 0,
|
|
3120
|
-
yuno_startdate: tn(
|
|
3121
|
-
id:
|
|
3386
|
+
yuno_startdate: tn(Ot(), "start_date"),
|
|
3387
|
+
id: So(),
|
|
3122
3388
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
3123
3389
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
3124
3390
|
required_services: i
|
|
3125
3391
|
};
|
|
3126
|
-
return
|
|
3392
|
+
return Hl(e, s, hi, $i(e, jt(At(e)), null)), zl(e, s, "__identity__"), ii(t.gobj_timer, en(e, "timeout_idack")), Ri(e, "EV_IDENTITY_CARD", s);
|
|
3127
3393
|
}
|
|
3128
|
-
function
|
|
3129
|
-
if (
|
|
3394
|
+
function Ai(e, t) {
|
|
3395
|
+
if (tl(t.event)) return -1;
|
|
3130
3396
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, i = t.__service__, s = t.subscriber;
|
|
3131
3397
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
3132
|
-
return
|
|
3398
|
+
return Hl(e, n, hi, $i(e, jt(s), i)), zl(e, n, "__subscribing__"), Ri(e, t.event, n);
|
|
3133
3399
|
}
|
|
3134
|
-
function
|
|
3400
|
+
function Ii(e, t, n, r) {
|
|
3135
3401
|
let l = e.priv;
|
|
3136
|
-
return
|
|
3402
|
+
return Et(e) && (l.websocket = Si(e)), 0;
|
|
3137
3403
|
}
|
|
3138
|
-
function
|
|
3139
|
-
return
|
|
3404
|
+
function ki(e, t, n, r) {
|
|
3405
|
+
return ur("Websocket opened: " + e.priv.url), Di(e), 0;
|
|
3140
3406
|
}
|
|
3141
|
-
function
|
|
3142
|
-
let l = e.priv, o = n.
|
|
3143
|
-
return
|
|
3144
|
-
url:
|
|
3407
|
+
function Ci(e, t, n, r) {
|
|
3408
|
+
let l = e.priv, o = n.url;
|
|
3409
|
+
return rr(), sr(`${$t(e)}: WebSocket closed ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), l.websocket && (l.websocket.onopen = null, l.websocket.onmessage = null, l.websocket.onerror = null, l.websocket.onclose = null, l.websocket = null), l.inform_on_close ? (l.inform_on_close = !1, Pn(e, "EV_ON_CLOSE", {
|
|
3410
|
+
url: o,
|
|
3145
3411
|
remote_yuno_name: l.remote_yuno_name,
|
|
3146
3412
|
remote_yuno_role: l.remote_yuno_role,
|
|
3147
3413
|
remote_yuno_service: l.remote_yuno_service
|
|
3148
|
-
})) : (
|
|
3149
|
-
url:
|
|
3414
|
+
})) : (sr(`${$t(e)}: EV_ON_OPEN_ERROR cannot open ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), Pn(e, "EV_ON_OPEN_ERROR", {
|
|
3415
|
+
url: o,
|
|
3150
3416
|
remote_yuno_name: l.remote_yuno_name,
|
|
3151
3417
|
remote_yuno_role: l.remote_yuno_role,
|
|
3152
3418
|
remote_yuno_service: l.remote_yuno_service,
|
|
3153
|
-
code:
|
|
3154
|
-
reason:
|
|
3155
|
-
was_clean:
|
|
3156
|
-
})),
|
|
3419
|
+
code: n.code,
|
|
3420
|
+
reason: n.reason,
|
|
3421
|
+
was_clean: n.was_clean
|
|
3422
|
+
})), Et(e) && ii(l.gobj_timer, function(e) {
|
|
3157
3423
|
let t = e.priv, n = en(e, "timeout_retry"), r = en(e, "timeout_retry_max");
|
|
3158
3424
|
r < n && (r = n);
|
|
3159
3425
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
@@ -3161,17 +3427,17 @@ function di(e, t, n, r) {
|
|
|
3161
3427
|
return Math.max(1, Math.round(o));
|
|
3162
3428
|
}(e)), 0;
|
|
3163
3429
|
}
|
|
3164
|
-
function
|
|
3165
|
-
return
|
|
3430
|
+
function Li(e, t, n, r) {
|
|
3431
|
+
return Di(e), 0;
|
|
3166
3432
|
}
|
|
3167
|
-
function
|
|
3433
|
+
function Pi(e, t, n, r) {
|
|
3168
3434
|
let l = e.priv;
|
|
3169
|
-
|
|
3170
|
-
let o =
|
|
3435
|
+
ai(l.gobj_timer);
|
|
3436
|
+
let o = Ql(e, n, hi, !0), i = El(e, o, "src_yuno", ""), s = El(e, o, "src_role", ""), a = El(e, o, "src_service", "");
|
|
3171
3437
|
un(e, "remote_yuno_name", i), un(e, "remote_yuno_role", s), un(e, "remote_yuno_service", a);
|
|
3172
|
-
let u =
|
|
3438
|
+
let u = ml(e, n, "result", -1, 0), _ = El(e, n, "comment", "", 0), c = El(e, n, "username", "", 0), f = vl(e, n, "services_roles", {});
|
|
3173
3439
|
if (u < 0) {
|
|
3174
|
-
|
|
3440
|
+
Ni(e);
|
|
3175
3441
|
let t = {
|
|
3176
3442
|
url: tn(e, "url"),
|
|
3177
3443
|
result: u,
|
|
@@ -3181,7 +3447,7 @@ function pi(e, t, n, r) {
|
|
|
3181
3447
|
remote_yuno_role: s,
|
|
3182
3448
|
remote_yuno_service: a
|
|
3183
3449
|
};
|
|
3184
|
-
kt(e) ? yn(At(e), "EV_ON_ID_NAK", t, e) :
|
|
3450
|
+
kt(e) ? yn(At(e), "EV_ON_ID_NAK", t, e) : Pn(e, "EV_ON_ID_NAK", t);
|
|
3185
3451
|
} else {
|
|
3186
3452
|
if (_n(e, "ST_SESSION"), l.inside_on_open = !0, l.retry_ms = 0, !l.inform_on_close) {
|
|
3187
3453
|
l.inform_on_close = !0;
|
|
@@ -3192,69 +3458,70 @@ function pi(e, t, n, r) {
|
|
|
3192
3458
|
remote_yuno_service: a,
|
|
3193
3459
|
services_roles: f
|
|
3194
3460
|
};
|
|
3195
|
-
kt(e) ? yn(At(e), "EV_ON_OPEN", t, e) :
|
|
3461
|
+
kt(e) ? yn(At(e), "EV_ON_OPEN", t, e) : Pn(e, "EV_ON_OPEN", t);
|
|
3196
3462
|
}
|
|
3197
3463
|
l.inside_on_open = !1, function(e) {
|
|
3198
|
-
let t =
|
|
3199
|
-
for (let n = 0; n < t.length; n++)
|
|
3464
|
+
let t = kn(e, null, null, null);
|
|
3465
|
+
for (let n = 0; n < t.length; n++) Ai(e, t[n]);
|
|
3200
3466
|
}(e);
|
|
3201
3467
|
}
|
|
3202
3468
|
return 0;
|
|
3203
3469
|
}
|
|
3204
|
-
function
|
|
3470
|
+
function Ui(e, t, n, r) {
|
|
3205
3471
|
let l = e.priv.url, o = function(e, t) {
|
|
3206
3472
|
let n;
|
|
3207
3473
|
try {
|
|
3208
3474
|
n = JSON.parse(t);
|
|
3209
|
-
} catch (
|
|
3210
|
-
return
|
|
3475
|
+
} catch (t) {
|
|
3476
|
+
return sr(`${$t(e)}: parsing inter_event json: ${t}`), null;
|
|
3211
3477
|
}
|
|
3212
|
-
if (!(n instanceof Object)) return
|
|
3478
|
+
if (!(n instanceof Object)) return sr(`${$t(e)}: parsing inter_event: websocket data not a json object`), null;
|
|
3213
3479
|
let r = n.event;
|
|
3214
|
-
if (!r) return
|
|
3215
|
-
if ("string" != typeof r) return
|
|
3480
|
+
if (!r) return sr(`${$t(e)}: parsing inter_event: no event`), null;
|
|
3481
|
+
if ("string" != typeof r) return sr(`${$t(e)}: parsing inter_event: event not a string`), null;
|
|
3216
3482
|
let l = n.kw;
|
|
3217
3483
|
return l ? l instanceof Object ? {
|
|
3218
3484
|
event: r,
|
|
3219
3485
|
kw: l || {}
|
|
3220
|
-
} : (
|
|
3221
|
-
}(
|
|
3222
|
-
if (
|
|
3223
|
-
|
|
3224
|
-
|
|
3486
|
+
} : (sr(`${$t(e)}: parsing inter_event: kw not a json object`), null) : (sr(`${$t(e)}: parsing inter_kw: no kw`), null);
|
|
3487
|
+
}(e, n.data);
|
|
3488
|
+
if (!o) return sr(`${$t(e)}: frame dropped from ${l}: ${String(n.data).substring(0, 256)}`), -1;
|
|
3489
|
+
if (yi(e)) {
|
|
3490
|
+
let e = jt(Ot()) + " <== " + l, t = n.data.length, r = zt(Ot(), "trace_ievent_callback");
|
|
3491
|
+
r ? r(e, o, 2, t) : wi(0, e, o);
|
|
3225
3492
|
}
|
|
3226
3493
|
let i = o.event, s = o.kw;
|
|
3227
3494
|
if ("ST_SESSION" !== cn(e)) {
|
|
3228
|
-
if (dn(e, i,
|
|
3495
|
+
if (dn(e, i, U.EVF_PUBLIC_EVENT)) {
|
|
3229
3496
|
if (!(yn(e, i, s, e) < 0)) return 0;
|
|
3230
|
-
} else
|
|
3231
|
-
return
|
|
3497
|
+
} else ir(`${$t(e)}: event UNKNOWN in not-session state ${i}`);
|
|
3498
|
+
return Ni(e), -1;
|
|
3232
3499
|
}
|
|
3233
3500
|
o = null;
|
|
3234
|
-
let a =
|
|
3235
|
-
if (_.toLowerCase() !== Nt().toLowerCase()) return
|
|
3236
|
-
let c =
|
|
3237
|
-
if ("__subscribing__" === a) return -1;
|
|
3238
|
-
if ("__unsubscribing__" === a) return -1;
|
|
3239
|
-
if (dn(e, i,
|
|
3240
|
-
if (!
|
|
3241
|
-
let t =
|
|
3242
|
-
return t ? dn(t, i,
|
|
3243
|
-
}
|
|
3244
|
-
return kt(e) ? yn(At(e), i, s, e) :
|
|
3245
|
-
}
|
|
3246
|
-
function
|
|
3501
|
+
let a = Xl(e, s), u = Ql(e, s, hi), _ = El(e, u, "dst_role", "");
|
|
3502
|
+
if (_.toLowerCase() !== Nt().toLowerCase()) return ir(`"It's not my role, dst_role: ${_}, my_role: ${Nt()}`), 0;
|
|
3503
|
+
let c = El(e, u, "dst_service", "");
|
|
3504
|
+
if ("__subscribing__" === a) return sr(`${$t(e)}: subscription event ignored, I'm client (service: ${c}, event: ${i})`), -1;
|
|
3505
|
+
if ("__unsubscribing__" === a) return sr(`${$t(e)}: unsubscription event ignored, I'm client (service: ${c}, event: ${i})`), -1;
|
|
3506
|
+
if (dn(e, i, U.EVF_PUBLIC_EVENT)) return yn(e, i, s, e), 0;
|
|
3507
|
+
if (!tl(c)) {
|
|
3508
|
+
let t = Ke(c, !1);
|
|
3509
|
+
return t ? dn(t, i, U.EVF_PUBLIC_EVENT) ? (yn(t, i, s, e), 0) : (ir(`${$t(e)}: Service found but no event or not public, service '${$t(t)}', ev '${i}'`), -1) : (sr(`${$t(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${i}'`), 0);
|
|
3510
|
+
}
|
|
3511
|
+
return kt(e) ? yn(At(e), i, s, e) : Pn(e, i, s), 0;
|
|
3512
|
+
}
|
|
3513
|
+
function Fi(e, t, n, r) {
|
|
3247
3514
|
return 0;
|
|
3248
3515
|
}
|
|
3249
|
-
function
|
|
3516
|
+
function Vi(e, t, n, r) {
|
|
3250
3517
|
return 0;
|
|
3251
3518
|
}
|
|
3252
|
-
var
|
|
3519
|
+
var Gi = {
|
|
3253
3520
|
mt_create: function(e) {
|
|
3254
3521
|
let t = e.priv;
|
|
3255
|
-
t.gobj_timer = ot(jt(e), "C_TIMER", {}, e), t.url = tn(e, "url"), t.remote_yuno_name = tn(e, "remote_yuno_name"), t.remote_yuno_role = tn(e, "remote_yuno_role"), t.remote_yuno_service = tn(e, "remote_yuno_service"), un(e, "wanted_yuno_name", t.remote_yuno_name), un(e, "wanted_yuno_role", t.remote_yuno_role), un(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
3522
|
+
t.gobj_timer = ot(jt(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = tn(e, "url"), t.remote_yuno_name = tn(e, "remote_yuno_name"), t.remote_yuno_role = tn(e, "remote_yuno_role"), t.remote_yuno_service = tn(e, "remote_yuno_service"), un(e, "wanted_yuno_name", t.remote_yuno_name), un(e, "wanted_yuno_role", t.remote_yuno_role), un(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
3256
3523
|
const n = nn(e, "subscriber");
|
|
3257
|
-
n &&
|
|
3524
|
+
n && Dn(e, null, {}, n);
|
|
3258
3525
|
},
|
|
3259
3526
|
mt_writing: function(e, t) {
|
|
3260
3527
|
let n = e.priv;
|
|
@@ -3273,72 +3540,78 @@ var Ti = {
|
|
|
3273
3540
|
},
|
|
3274
3541
|
mt_start: function(e) {
|
|
3275
3542
|
let t = e.priv;
|
|
3276
|
-
return t.retry_ms = 0,
|
|
3543
|
+
return t.retry_ms = 0, "ST_DISCONNECTED" !== cn(e) && (yn(e, "EV_ON_CLOSE", {
|
|
3544
|
+
url: t.url,
|
|
3545
|
+
ws_seq: t.ws_seq,
|
|
3546
|
+
code: 1e3,
|
|
3547
|
+
reason: "restarted",
|
|
3548
|
+
was_clean: !0
|
|
3549
|
+
}, e), ai(t.gobj_timer)), t.websocket = Si(e), 0;
|
|
3277
3550
|
},
|
|
3278
3551
|
mt_stop: function(e) {
|
|
3279
3552
|
let t = e.priv;
|
|
3280
|
-
return
|
|
3553
|
+
return ai(t.gobj_timer), t.websocket && Ni(e), 0;
|
|
3281
3554
|
},
|
|
3282
3555
|
mt_destroy: function(e) {},
|
|
3283
3556
|
mt_stats: function(e, t, n, r) {
|
|
3284
|
-
if ("ST_SESSION" !== cn(e)) return
|
|
3557
|
+
if ("ST_SESSION" !== cn(e)) return ir("Not in session"), null;
|
|
3285
3558
|
n || (n = {});
|
|
3286
|
-
let l =
|
|
3287
|
-
return o || (o = {}),
|
|
3559
|
+
let l = $i(e, jt(r), El(e, n, "service", null, 0)), o = vl(e, n, "__md_stats__", null, Vn.KW_EXTRACT);
|
|
3560
|
+
return o || (o = {}), Hl(e, n, "stats_stack", {
|
|
3288
3561
|
stats: t,
|
|
3289
3562
|
kw: o
|
|
3290
|
-
}),
|
|
3563
|
+
}), Hl(e, n, hi, l), n.__stats__ = t, zl(e, n, "__stats__"), Ri(e, "EV_MT_STATS", n, r), null;
|
|
3291
3564
|
},
|
|
3292
3565
|
mt_command_parser: function(e, t, n, r) {
|
|
3293
|
-
if ("ST_SESSION" !== cn(e)) return
|
|
3566
|
+
if ("ST_SESSION" !== cn(e)) return ir("Not in session"), null;
|
|
3294
3567
|
n || (n = {});
|
|
3295
|
-
let l =
|
|
3296
|
-
return o || (o = {}),
|
|
3568
|
+
let l = $i(e, jt(r), El(e, n, "service", "", 0)), o = vl(e, n, "__md_command__", null, Vn.KW_EXTRACT);
|
|
3569
|
+
return o || (o = {}), Hl(e, n, "command_stack", {
|
|
3297
3570
|
command: t,
|
|
3298
3571
|
kw: o
|
|
3299
|
-
}),
|
|
3572
|
+
}), Hl(e, n, hi, l), n.__command__ = t, zl(e, n, "__command__"), Ri(e, "EV_MT_COMMAND", n, r), null;
|
|
3300
3573
|
},
|
|
3301
3574
|
mt_inject_event: function(e, t, n, r) {
|
|
3302
3575
|
if ("ST_SESSION" !== cn(e)) return window.console.error("Not in session"), -1;
|
|
3303
|
-
if (n = Object.assign({},
|
|
3576
|
+
if (n = Object.assign({}, Yr(n) ? n : {}), Yr(n.__md_iev__) && (n.__md_iev__ = jr(n.__md_iev__)), Ql(e, n, hi));
|
|
3304
3577
|
else {
|
|
3305
|
-
let l =
|
|
3306
|
-
|
|
3578
|
+
let l = $i(e, jt(r), El(e, n, "__service__", 0, 0));
|
|
3579
|
+
Cr(n, "__service__"), Hl(e, n, "__message__", t), Hl(e, n, hi, l);
|
|
3307
3580
|
}
|
|
3308
|
-
return
|
|
3581
|
+
return zl(e, n, "__message__"), Ri(e, t, n, r);
|
|
3309
3582
|
},
|
|
3310
3583
|
mt_subscription_added: function(e, t) {
|
|
3311
3584
|
let n = e.priv;
|
|
3312
|
-
return "ST_SESSION" === cn(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
3585
|
+
return "ST_SESSION" === cn(e) && n.websocket ? n.inside_on_open ? 0 : Ai(e, t) : 0;
|
|
3313
3586
|
},
|
|
3314
3587
|
mt_subscription_deleted: function(e, t) {
|
|
3315
3588
|
let n = e.priv;
|
|
3316
3589
|
if ("ST_SESSION" !== cn(e) || !n.websocket) return 0;
|
|
3317
3590
|
if (n.inside_on_open) return 0;
|
|
3318
|
-
if (
|
|
3591
|
+
if (tl(t.event)) return 0;
|
|
3319
3592
|
let r = {}, l = t.__global__, o = t.__config__, i = t.__filter__, s = t.__service__, a = t.subscriber;
|
|
3320
3593
|
o && (r.__config__ = o), l && (r.__global__ = l), i && (r.__filter__ = i);
|
|
3321
|
-
return
|
|
3594
|
+
return Hl(e, r, hi, $i(e, jt(a), s)), zl(e, r, "__unsubscribing__"), Ri(e, t.event, r, e);
|
|
3322
3595
|
}
|
|
3323
3596
|
};
|
|
3324
|
-
function
|
|
3597
|
+
function Mi() {
|
|
3325
3598
|
return function(e) {
|
|
3326
|
-
if (
|
|
3599
|
+
if (Oi) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
3327
3600
|
const t = [
|
|
3328
3601
|
["ST_DISCONNECTED", [
|
|
3329
3602
|
[
|
|
3330
3603
|
"EV_ON_OPEN",
|
|
3331
|
-
|
|
3604
|
+
ki,
|
|
3332
3605
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3333
3606
|
],
|
|
3334
3607
|
[
|
|
3335
3608
|
"EV_ON_CLOSE",
|
|
3336
|
-
|
|
3609
|
+
Ci,
|
|
3337
3610
|
null
|
|
3338
3611
|
],
|
|
3339
3612
|
[
|
|
3340
3613
|
"EV_TIMEOUT",
|
|
3341
|
-
|
|
3614
|
+
Ii,
|
|
3342
3615
|
null
|
|
3343
3616
|
],
|
|
3344
3617
|
[
|
|
@@ -3350,22 +3623,22 @@ function yi() {
|
|
|
3350
3623
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3351
3624
|
[
|
|
3352
3625
|
"EV_ON_MESSAGE",
|
|
3353
|
-
|
|
3626
|
+
Ui,
|
|
3354
3627
|
null
|
|
3355
3628
|
],
|
|
3356
3629
|
[
|
|
3357
3630
|
"EV_IDENTITY_CARD_ACK",
|
|
3358
|
-
|
|
3631
|
+
Pi,
|
|
3359
3632
|
null
|
|
3360
3633
|
],
|
|
3361
3634
|
[
|
|
3362
3635
|
"EV_ON_CLOSE",
|
|
3363
|
-
|
|
3636
|
+
Ci,
|
|
3364
3637
|
"ST_DISCONNECTED"
|
|
3365
3638
|
],
|
|
3366
3639
|
[
|
|
3367
3640
|
"EV_TIMEOUT",
|
|
3368
|
-
|
|
3641
|
+
Li,
|
|
3369
3642
|
null
|
|
3370
3643
|
],
|
|
3371
3644
|
[
|
|
@@ -3377,22 +3650,22 @@ function yi() {
|
|
|
3377
3650
|
["ST_SESSION", [
|
|
3378
3651
|
[
|
|
3379
3652
|
"EV_ON_MESSAGE",
|
|
3380
|
-
|
|
3653
|
+
Ui,
|
|
3381
3654
|
null
|
|
3382
3655
|
],
|
|
3383
3656
|
[
|
|
3384
3657
|
"EV_MT_STATS",
|
|
3385
|
-
|
|
3658
|
+
Fi,
|
|
3386
3659
|
null
|
|
3387
3660
|
],
|
|
3388
3661
|
[
|
|
3389
3662
|
"EV_MT_COMMAND",
|
|
3390
|
-
|
|
3663
|
+
Vi,
|
|
3391
3664
|
null
|
|
3392
3665
|
],
|
|
3393
3666
|
[
|
|
3394
3667
|
"EV_ON_CLOSE",
|
|
3395
|
-
|
|
3668
|
+
Ci,
|
|
3396
3669
|
"ST_DISCONNECTED"
|
|
3397
3670
|
],
|
|
3398
3671
|
[
|
|
@@ -3403,20 +3676,20 @@ function yi() {
|
|
|
3403
3676
|
]],
|
|
3404
3677
|
[null, null]
|
|
3405
3678
|
];
|
|
3406
|
-
return (
|
|
3407
|
-
["EV_ON_MESSAGE",
|
|
3408
|
-
["EV_IDENTITY_CARD_ACK",
|
|
3409
|
-
["EV_ON_ID_NAK",
|
|
3410
|
-
["EV_MT_STATS",
|
|
3411
|
-
["EV_MT_COMMAND",
|
|
3412
|
-
["EV_ON_OPEN",
|
|
3413
|
-
["EV_ON_CLOSE",
|
|
3414
|
-
["EV_ON_OPEN_ERROR",
|
|
3679
|
+
return (Oi = Ae(e, [
|
|
3680
|
+
["EV_ON_MESSAGE", U.EVF_OUTPUT_EVENT],
|
|
3681
|
+
["EV_IDENTITY_CARD_ACK", U.EVF_PUBLIC_EVENT],
|
|
3682
|
+
["EV_ON_ID_NAK", U.EVF_PUBLIC_EVENT | U.EVF_OUTPUT_EVENT],
|
|
3683
|
+
["EV_MT_STATS", U.EVF_PUBLIC_EVENT],
|
|
3684
|
+
["EV_MT_COMMAND", U.EVF_PUBLIC_EVENT],
|
|
3685
|
+
["EV_ON_OPEN", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS],
|
|
3686
|
+
["EV_ON_CLOSE", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS],
|
|
3687
|
+
["EV_ON_OPEN_ERROR", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS],
|
|
3415
3688
|
["EV_TIMEOUT", 0],
|
|
3416
3689
|
[null, 0]
|
|
3417
|
-
], t,
|
|
3690
|
+
], t, Gi, 0, Ei, vi, 0, 0, Ti, C.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3418
3691
|
}("C_IEVENT_CLI");
|
|
3419
3692
|
}
|
|
3420
|
-
export { k as GObj, N as SDATA,
|
|
3693
|
+
export { k as GObj, N as SDATA, $ as SDATAAUTHZ, w as SDATACM, j as SDATACM2, A as SDATADF, R as SDATAPM, D as SDATAPM0, S as SDATA_END, O as SDataDesc, a as YUNETA_VERSION, h as __yuno__, o as build_command_response, Ro as build_path, s as build_stats_response, No as clean_name, ai as clear_timeout, il as cmp_two_simple_json, l as command_parser, po as createElement2, bo as createOneHtml, uo as create_json_record, Zo as create_template_record, yo as current_timestamp, y as data_type_t, xo as db_list_persistent_attrs, Go as db_load_persistent_attrs, Wo as db_remove_persistent_attrs, Mo as db_save_persistent_attrs, jo as debounce, Bl as delete_from_list, Rr as duplicate_objects, Kr as empty_json, tl as empty_string, fo as escapeHtml, U as event_flag_t, Lo as flat2json, Fo as flat_apply, Uo as flat_diff, Io as flat_key_join, ko as flat_key_split, Pe as gclass_add_ev_action, Fe as gclass_add_event_type, Le as gclass_add_state, Ge as gclass_check_fsm, Ae as gclass_create, Ve as gclass_event_type, Me as gclass_find_by_name, C as gclass_flag_t, Ie as gclass_unregister, mo as getPositionRelativeToBody, wo as get_function_name, vo as get_now, Lt as gobj_bottom_gobj, fn as gobj_change_parent, _n as gobj_change_state, Un as gobj_command, it as gobj_create, et as gobj_create2, rt as gobj_create_default_service, ot as gobj_create_pure_child, nt as gobj_create_service, lt as gobj_create_volatil, tt as gobj_create_yuno, cn as gobj_current_state, xe as gobj_default_service, Tn as gobj_deliver_posted_events, st as gobj_destroy, Bt as gobj_find_child, Kt as gobj_find_gobj, Ke as gobj_find_service, Ln as gobj_find_subscribings, kn as gobj_find_subscriptions, L as gobj_flag_t, Dt as gobj_full_name, Rt as gobj_gclass_name, be as gobj_get_gclass_trace_level, pe as gobj_get_gclass_trace_level2, me as gobj_get_gclass_trace_no_level, ge as gobj_get_global_trace_level, de as gobj_get_global_trace_no_level, ue as gobj_global_trace_level, _e as gobj_global_trace_no_level, Qt as gobj_has_attr, dn as gobj_has_event, bn as gobj_has_output_event, Re as gobj_hsdata, Ct as gobj_is_destroying, vt as gobj_is_playing, kt as gobj_is_pure_child, Et as gobj_is_running, yt as gobj_is_service, It as gobj_is_volatil, ze as gobj_list_persistent_attrs, Cn as gobj_list_subscriptions, qe as gobj_load_persistent_attrs, Jt as gobj_match_children, qt as gobj_match_children_tree, Yt as gobj_match_gobj, jt as gobj_name, At as gobj_parent, ht as gobj_pause, mt as gobj_play, hn as gobj_post_event, En as gobj_posted_events_size, Pn as gobj_publish_event, zt as gobj_read_attr, Xt as gobj_read_attrs, Zt as gobj_read_bool_attr, en as gobj_read_integer_attr, nn as gobj_read_pointer_attr, tn as gobj_read_str_attr, Qe as gobj_remove_persistent_attrs, Oe as gobj_repr_global_trace_levels, ln as gobj_reset_volatil_attrs, He as gobj_save_persistent_attrs, Ht as gobj_search_path, yn as gobj_send_event, We as gobj_services, Pt as gobj_set_bottom_gobj, he as gobj_set_deep_trace, ye as gobj_set_gclass_no_trace, Ee as gobj_set_gclass_trace, ae as gobj_set_global_no_trace, fe as gobj_set_global_no_trace2, se as gobj_set_global_trace, ce as gobj_set_global_trace2, ve as gobj_set_gobj_no_trace, Te as gobj_set_gobj_trace, x as gobj_set_trace_machine_format, $t as gobj_short_name, at as gobj_start, _t as gobj_start_children, ft as gobj_start_tree, Se as gobj_start_up, Fn as gobj_stats, gt as gobj_stop, bt as gobj_stop_children, pt as gobj_stop_tree, Dn as gobj_subscribe_event, Z as gobj_trace_level, K as gobj_trace_machine_format, ee as gobj_trace_no_level, An as gobj_unsubscribe_event, In as gobj_unsubscribe_list, Ft as gobj_walk_gobj_children, Vt as gobj_walk_gobj_children_tree, rn as gobj_write_attr, on as gobj_write_attrs, sn as gobj_write_bool_attr, an as gobj_write_integer_attr, un as gobj_write_str_attr, Ot as gobj_yuno, wt as gobj_yuno_id, St as gobj_yuno_name, Nt as gobj_yuno_role, xl as id_index_in_obj_list, Oo as index_in_list, Br as is_array, Hr as is_boolean, Xr as is_date, Zr as is_function, el as is_gobj, al as is_metadata_key, Qr as is_null, qr as is_number, Yr as is_object, ul as is_private_key, zr as is_pure_number, br as is_secret_name, Jr as is_string, lo as jdb_delete, io as jdb_get, so as jdb_get_by_idx, oo as jdb_get_topic, no as jdb_init, ro as jdb_update, Co as json2flat, Ur as json_array_append, Fr as json_array_append_new, Gr as json_array_extend, Vr as json_array_remove, Wr as json_array_size, jr as json_deep_copy, $r as json_is_identical, Nr as json_mask_secrets, Cr as json_object_del, kr as json_object_get, Lr as json_object_set, Pr as json_object_set_new, Mr as json_object_size, Dr as json_object_update, Ar as json_object_update_existing, Ir as json_object_update_missing, xr as json_size, co as jwt2json, _o as jwtDecode, Al as kw_clone_by_keys, Il as kw_clone_by_not_keys, Dl as kw_collect, bl as kw_delete, Rl as kw_find_json_in_list, dl as kw_find_path, Vn as kw_flag_t, pl as kw_get_bool, yl as kw_get_dict, vl as kw_get_dict_value, ml as kw_get_int, Ol as kw_get_list, kl as kw_get_local_storage_value, Tl as kw_get_pointer, hl as kw_get_real, El as kw_get_str, cl as kw_has_key, jl as kw_match_simple, _l as kw_pop, Ll as kw_remove_local_storage_value, $l as kw_select, Sl as kw_set_dict_value, Cl as kw_set_local_storage_value, Nl as kw_set_subdict_value, Ul as kwid_collect, Gl as kwid_find_one_record, Ml as kwid_get_ids, Pl as kwid_match_id, Fl as kwid_new_dict, Vl as kwid_new_list, Wl as list2options, Zl as load_json_file, ur as log_debug, ir as log_error, ar as log_info, sr as log_warning, Tr as mask_secrets_inline, Xl as msg_iev_get_msg_type, Ql as msg_iev_get_stack, Hl as msg_iev_push_stack, Jl as msg_iev_read_key, zl as msg_iev_set_msg_type, ql as msg_iev_write_key, So as node_uuid, nl as parseBoolean, ho as parseSVG, Eo as refresh_language, Mi as register_c_ievent_cli, oi as register_c_timer, mi as register_c_yuno, go as safeSrc, v as sdata_flag_t, eo as send_http_json_post, Qn as set_console_log_enabled, Xn as set_console_log_filter, qn as set_log_callback, rr as set_remote_log_functions, ii as set_timeout, si as set_timeout_periodic, t as sprintf, i as stats_parser, Kl as str_in_list, ol as strcasecmp, ll as strcmp, rl as strncmp, Yl as strs_in_list, sl as strstr, Xo as template_get_field_desc, To as timeTracker, cr as trace_json, wr as trace_json_masked, B as trace_level_t, _r as trace_msg, Yo as treedb_decoder_fkey, Jo as treedb_decoder_hook, Bo as treedb_encoder_fkey, zo as treedb_get_field_desc, Ko as treedb_hook_data_size, n as vsprintf, F as walk_type_t };
|
|
3421
3694
|
|
|
3422
3695
|
//# sourceMappingURL=gobj-js.es.min.js.map
|